sepp2k's Profile User Rating: *****

Reputation: 2277 Grandmaster
Group:
Mentors
Active Posts:
3,521 (2.07 per day)
Joined:
21-June 11
Profile Views:
60,489
Last Active:
User is offline Private
Currently:
Offline

Previous Fields

Country:
DE
OS Preference:
Linux
Favorite Browser:
Who Cares
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0
Expert In:
C/C++, Functional Programming, Java, Python, Computer Science
Icon   sepp2k has not set their status

Posts I've Made

  1. In Topic: Please help me understand this recursion

    Posted 13 Feb 2016

    i is a local variable. As such calling a function will not cause i to change its value (unless you're passing a pointer or reference to i, which you're not). This does not change if the function you're calling is the function you're currently in.

    That is, calling a function recursively does not change its local variables anymore than calling a different function would.
  2. In Topic: PYqt tutorial gives me an error...

    Posted 22 Nov 2015

    You missed a space on that line.
  3. In Topic: Can someone explain this?

    Posted 22 Nov 2015

    From inside out:

    freq.items() gives you a list of the key-value pairs in freq. The list comprehension [(v,k) for k,v in ...] then takes each such pair, assigns the key and value to k and v respectively and produces the pair (v,k). So we now have a list of value-key pairs. sorted now takes that list and produces a sorted version of it (pairs are compared by first comparing the first element and only comparing the second element if the first is equal, so the key and value were swapped to sort by the value). Then the outer list comprehension again swaps the keys and values, so you get back a sorted (by value) list of key-value pairs.

    PS: The sorted function can also be given a comparison function as its second argument, so you accomplish the same thing without swapping the pairs and swapping them back.
  4. In Topic: Beginning Git (Version Control)

    Posted 22 Nov 2015

    View Postkathy025, on 22 November 2015 - 06:08 AM, said:

    Where does it say it's "commit #1" or "commit #2" (since both of them are green boxes)?


    It doesn't. I just gave them sequential numbers to refer to them because I didn't want to spell out their hash or commit message. Git doesn't assign sequential numbers to commits.

    It might have been clearer had I said: The branches clone-master and master are at commit "modified in master branch" and the branches clone-kat-develop and kat-develop are at commit "edited in kat-develop branch" (as signified by the green boxes).
  5. In Topic: Beginning Git (Version Control)

    Posted 21 Nov 2015

    You have two commits. The second one is the commit you're currently at as signified by the yellow dot (as signified by the yellow dot as opposed to blue dots for other commits). The second commit is a direct child of the first one (as signified by the fact that there's a line between them). The branches clone-master and master are at commit #1 and the branches clone-kat-develop and kat-develop are at commit #2 (as signified by the green boxes). Your current branch is kat-develop (that's why it's bold).