« first day (1679 days earlier)      last day (3255 days later) » 

1:48 AM
Holiday monday?
Memorial day?
explains my flurry of activity earlier this week and next to nothing today. I expect that until Tuesday I'll get no votes... :(
I do a dict.update in my latest project, too. :)
so I guess people need it.
I do it with keyword arguments though
So it's extra cool.
anybody there?
 
2:15 AM
I've been at work for 12 hours. I just dropped my dev database by mistake. It's time to go home. :-[
rhubarb
 
 
2 hours later…
3:53 AM
@Ffisegydd Congrats! :D
 
 
1 hour later…
5:22 AM
CBG!
What is the difference between the following codes ?
def outer():
    x = 1
    def inner():
        print x
    return inner() ## notice the () here
and
def outer():
    x = 1
    def inner():
        print x
    return inner # notice the absence of () here
 
When you call outer in the first, it'll return the return value of calling inner
Which is nothing, since inner doesn't return anything
You'll probably see the distinction more clearly if you change the print x to return x
In the second, calling outer will return the function inner itself, not the a value
The second one won't print x either, because it's never being called
 
Ok
I'll try that
@SomeGuy : I read your lines 10 times to get what you were saying!
Thanks! tons!
 
5:38 AM
Hehe, as long as you understood it eventually
It's much easier to understand if you experiment with it
 
F4z
hey, guys quick question why am i getting a key error? : pastebin.com/VM6mgRH1
 
What is character_list?
 
I did try actually! I know the rules of SO. Don't ask questions without trying it yourself first! :P
I was going through closures and decorators and then I came across this concept
 
F4z
@SomeGuy:

open_file = open(filename,"r")
open_file_text = open_file.read()
open_file_text = open_file_text
character_list = open_file_text.lower().split()
 
third line is useless
 
F4z
5:41 AM
third line splits the words
 
open_file_text = open_file_text this line ?
 
F4z
ok, updated the error
yea, got rid of that @d-coder
 
What does the error say?
 
F4z
Traceback (most recent call last):
File "Debug.py", line 17, in <module>
words_frequency('text2.txt')
File "Debug.py", line 12, in words_frequency
word_dict[word] += 1
KeyError: 'explicit'
 
trying to update dictionary keys automatically ?
 
F4z
5:43 AM
yes, suing for loop
 
Those keys probably don't exist
 
Yes
 
You may want a defaultdict
 
@SomeGuy So return inner()is same as calling the function inner() right ?
 
@d-coder Well, not really
return inner() calls the function and returns the value in the outer function
You could think of it as doing:
def outer():
    x = 10
    return x
Instead of:
def outer():
    x = 10
    def inner():
        return x
    return inner()
The outcome of calling outer is essentially the same in both cases
 
5:50 AM
Ok! I'm confused o_O
 
Try doing things in the interpreter
Easier to understand
Just define the inner function first
Call it
What does that return when x is 10?
It returns 10
So calling inner will return 10
This doesn't change if it's been done inside another function, in this case, the other function is outer
 
OK@ BRB!
 
 
1 hour later…
7:05 AM
Cbg
 
Hey up chuck
 
Cabbage
 
@IntrepidBrit got a bit further last night. Wife slept, so Rob can code :)
Work will let me buy my laptop in 2 weeks
Not amazing, but it's got 8GB of RAM. I'm thinking of putting some friendly distro on it
What's friendly these days? Ubuntu? Mint?
 
7:22 AM
Davidism and Peter will recommend Arch.
I have no opinion.
 
You like the one that they got half of free and still charge the most for
:D
Investigates Arch
 
I recommend OS X :p
 
Cabbage
 
7:37 AM
@RobertGrant Define "friendly". :) Do you just want it to be easy to use for a typical casual user (who just wants to do some Web browsing, email, word processing, play media files, and rip/burn CDs & DVDs), or do you also want it to be easy to customize low-level stuff? And I should also mention that Linux package management systems (usually) make it very easy to install a wide range of software simply & safely.
 
Cabbage!
I challenge you all to beat the AI while being red: codepen.io/mudrenok/pen/gpMXgg
 
7:53 AM
@PM2Ring well I'll do dev on it, but I'd also like to be able to skype
That's probably my range :)
 
Ubuntu's pretty nice, although it's got some bloat (as I say from Ubuntu)
 
Well I was a Debian man way back when, so I suppose Ubuntu is the modern equivalent
(I know Debian still exists etc)
 
Honestly though, if you get rid of Unity, there's not too much reason to use Ubuntu as opposed to Debian.
 
Ubuntu comes with Python 3 I guess :)
 
Yeah, I think Ubuntu's just a lot more end-user friendly.
Like, they even set your .bashrc by default to say:
alias rm="rm -i"
 
7:56 AM
@RobertGrant I discovered LXDE and find it blazing fast
 
I've been using Awesome
 
ohh
while being red..then nvm
 
well done @PeterVaro
 
I dunno, I like not having to load all of GTK bloat normally...
 
I am looking forward to the increased speed due to not having full disk encryption, and if I switch to Linux, the increased battery life
 
7:59 AM
Yeah, my first experience with Linux somehow didn't set me off, even though I installed Fedora right after they switched to Gnome...
So I was wondering my CPU was constantly at 100% just running background processes (old comp at the time, shitty everything).
 
8:11 AM
Ah okay
I might try Ubuntu, just because it probably receives more attention from Skype than some distros.
 
cabbage by the way
 
:p
And Ubuntu... eh, I have issues with Skype using PulseAudio..
Which is of course the sound system for Ubuntu
 
Ah hm okay. Are they hardware related issues?
Because, you know, sound hardware is moving forward in such leaps and bounds that there's no way Ubuntu could keep up with that
 
I've had same with audio and Skype on my laptop. Not hardware because I can coax it into action
Just not simple
Ubuntu obvs
Cbg @JonClements
 
8:26 AM
@PeterVaro Green is “easy” (easy as in pretty difficult because the AI is really good, but doable).
 
@poke but it's isn't easy being green... Kermit said so!
 
..
 
Kinda ruins it if I have to explain the popular culture media reference thingy :)
 
Also ain't easy being cheesy
 
Thanks BobbyG :)
 
8:33 AM
And we are cheesy
 
yeah man - we so stilton we're cheddar!
saddest thing is - I bet that probably means something horrible in some street gang language
umm... cheddar could rhyme with deader...
bit stuck thinking of where to take stilton here...
 
More bling than (paris) stilton?
 
git st
meh
I hate when that happens…
 
8:57 AM
almost the right window I guess? :p
 
Almost the right computer (as in virtual machine)
 
@RobertGrant (Sorry about the delay, I had domestic stuff to attend to).
Skype should be fine on any distro, assuming you don't have audio issues. Most distros these days come as an .iso that you can run live without installing, so you can burn a bootable DVD (or CD) & check that it works ok with your hardware before you actually install the distro to your HD. Linux hardware support is generally pretty good these days, but there can still be problems with stuff that's designed to uses proprietary Windows drivers.
One fun distro to check out is Puppy Linux: it's so tiny that the whole thing can load into RAM, so everything loads blazingly fast. It's mostly intended for use as a portable distro, or to revive older hardware, but it's pretty good on new hardware too.
 
Yeah - puppy is fun - I've used it on decrepit old machines
 
@PM2Ring heh that does sound quite fun
 
I wouldn't want to put you off Linux (quite the reverse). I did get skype working on Ubuntu and the issue was not skype per se - it was with the interplay between skype and the audio software (PulseAudio). I think PM2 is right - it's probably because Skype was designed with proprietary drivers in mind
 
9:10 AM
@JonClements I assume you use Puppy Linux
Yeah I'll check with a bootable ROM; good idea
Just bandwidth over here is not amazing so I can't download lots of different things to try
 
@PM2Ring Interesting, thanks!
 
@RobertGrant Strangely no :) I prefer Mint
Used to use Ubuntu - but really didn't like where it was heading UI wise... found Mint... and it's basically Ubuntu with what I find to be a much more usable windows manager
 
Yeah I like the look of more, and it's based on Ubuntu, I believe
A lot of the Linux UIs seem quite chunky, so I'll have to get over that I guess
 
9:30 AM
@Robert I'm not one for fancy UIs - I prefer recently modern, but functional without too many bells and whistles - so Mint with Cinnamon works great for me
Wow - found another unexploded WW2 bomb...
near Wembley stadium - wonder how many of those are left :)
 
When I was in France staying on a farm, they regularly find one or two unexploded WW2 grenades a year tilling the earth
 
@poke That's hard - too tempting for work time...
 
Apparently this one had a 50kg charge - not an explosives expert, but sounds like it'd make a good "bang"
 
user4433485
Cabbage All!
 
back from your coffee break again @Katherina :p
 
user4433485
9:38 AM
Yeah @JonClements haha
 
user4433485
I need another one tho :p
 
@Katherina considered just getting a caffeine IV drip? :p
 
user4433485
haha
 
user4433485
I've got a six-pack redbull :p
 
(says the puppy on his 4th mug of tea)
 
9:39 AM
@JRichardSnape lunch break? :P
 
user4433485
haha @JonClements
 
user4433485
Don't worry, Redbull shots in the car :p
 
user4433485
for 'emergency'
 
my mate's girlfriend use to have about 4 cans of redbull in her handbag at all times
 
user4433485
So do I
 
user4433485
9:41 AM
haha
 
user4433485
2 packs of cigarettes in the car at all times;p
 
bottle of vodka/scotch in the boot just in case? :p
 
user4433485
That's a damn good idea!
 
user4433485
I like it to be an alcoholic =P
 
Well - there you go then... you got the redbull... put a couple of glasses in the boot as well... get stuck in traffic... have a ciggie, quick vodka redbull etc... what could possibly go wrong!?
 
9:45 AM
Oh, cabbage @Katherina, you haven’t been here in a while
 
user4433485
haha yeh @poke I trying to learn your language :p
 
user4433485
I am quite good at it
 
user4433485
haha @JonClements
 
Oh, really? Dann lass uns auf deutsch schreiben! ;P
 
user4433485
haha
 
user4433485
9:47 AM
Nein ich bin nicht so gut in schreiben
 
user4433485
difficult accents
 
user4433485
and grammar
 
:)
 
user4433485
die das der and that ß
 
Esset?
 
user4433485
9:48 AM
hard to write, but easy to speak if you speak dutch
 
That’s true.
@RobertGrant Eszett :)
never had any problems talking to Dutch in Holland :P
 
user4433485
hehe
 
user4433485
as long as you know how to say 'korting' you will be fine here
 
user4433485
haha
 
^^
 
user4433485
9:50 AM
ive been a week in Berlin :p
 
user4433485
What was planned to be 1 day
 
user4433485
became 1 week haha
 
How come? :D
 
user4433485
I freakin love your country haha
 
Then just move here?
 
user4433485
9:56 AM
Alot history, Car meetings, clubs and stuff
 
user4433485
I want to
 
Hello everyone
 
user4433485
need to finish my study
 
Cabbage @Katherina Comment ca va ?
 
user4433485
Will do my Bachelor 'Engine tuning' in Germany I think =D but I don't know if it is possible since I can't write 'deutsch' ;p
 
user4433485
9:58 AM
@XavierCombelle ca va est toi ?
 
user4433485
le 22 julliet je part vers Dordogne!
 
Today I discovered a very weak philosophy of Python and it is, Python gets regular updates with it's features and syntax ans there's almost no agreed standards, each month a new syntax is added and a complete new idea will come up with the following version. How would programmers learn all these stuff and they're already busy with their projects which makes matters worse when they're required to shift from version to another.
 
@RobertGrant A typical Puppy .iso is around 150 MB, so downloading it shouldn't be too painful. The default Puppy installation tends to be fairly spartan, as you might guess from the small size, but it's got all the essentials and the main desktop menu system is feature-packed. A standard Puppy distro normally provides a very minimal Web browser, but it also makes it easy to DL & install a more fully-featured browser.
For historical reasons Puppy has its own packaging system, but modern Puppies can also use the repos of more well-known distros, like Ubuntu or Slackware. So you can get all the goodies without the bloat.
 
Interesting
@direprobs not sure what "There are no agreed standards" means
 
FWIW, Puppy has a good reputation for working with a wide range of Wifi cards, but if you do have hardware compatibility problems the Puppy community forum can be very helpful. I don't use Puppy as my main distro, but I like to carry a Puppy with me on USB when I visit friends. And Puppy has helped me fix several broken systems, both Linux & Windows, and when worse comes to worse, to salvage data from dying systems.
 
10:06 AM
@PM2Ring I'll read further
Yeah it may be helpful to have anyway, for that sort of stuff!
 
Definitely!
 
@direprobs "each month a new syntax is added" - no, syntax enhancements are very rare
 
I should warn you that Puppy is a little quirky in various ways, but I guess that's to be expected from such a compact distro. Eg, it's normal to run Puppy as root user. This isn't the security risk that it would be with other distros, since you're essentially installing it to the RAM every time you boot up.
 
How does that mitigate the risk?
 
@vaultah forget about syntax. If you're used to Python 2.X you would easily forget the the comparison < or > works with dict and doesn't work in 3.X, however == (equality) works in both 2.X and 3.X, they're tons of cases like this
How you remember them ? unless each time referring to the documentation, lots of time is wasted.
@RobertGrant, I mean with no standards like shifting from one place to another each time like a monkey, from a tree to another. Also the quick updates of the versions is technically tedious, some if not most programmers won't shift to another version without making changes in their codes, you know this process isn't that easy. The programmer needs to re-program his mind again and again for each update. That's awful at least to me.
 
10:17 AM
It would be, were it true
 
Well, it doesn't totally mitigate the risk, because a sufficiently malicious attack could do stuff to your HD / USB stick partitions. But the main OS directories are running on a layered filesystem. The upper layer is sitting in RAM, the lower layer(s) is on your HD or USB stick partition which is mounted read only. So any changes only happen in the upper layer.
When you shut down you have the option of saving the RAM stuff to a file, which is automatically loaded on the next boot. So if you suspect that Bad Things have happened you just don't save the RAM stuff, or you save it to an alternate file.
 
@PM2Ring I see what you mean, yeah
But if you want to update files on your computer, e.g. if you're working, you're going to have to click yes save it, or lose your work?
 
@direprobs “each month a new syntax is added” [citation needed] – The whole PEP system prevents any of this from happening.
 
** I wish that you don't confuse the fact that Python is a lovely programming language with its silly, updating system. Not to say that I don't want Python to enhance its features, that's good, but not too often. At least they should wait for a year or so, this is the minimum period so programmers get used to it and not to confuse the past with the futures.
 
Older versions of Puppy used UnionFS to do the layering stuff, modern ones use the updated aufs
 
10:20 AM
Python 2 vs Python 3 is a different case; Python 3 is incompatible to Python 2 (that was the whole point of making a new major release). But that’s it. There haven’t really been much syntax changes since then, and most actually brought back some compatibility. But it’s usually all backwards compatible.
 
@poke don't take my sentence literally, I meant (features) and significant changes
 
@PM2Ring sorry, now I think more about it: do you mean core stuff isn't saved to disk, it's just refreshed?
 
@direprobs There is no “updating system”; what are you even talking about? Give some examples…
 
@direprobs python 3.4 was released march last year. They're almost at the point of releasing 3.5, 14 months later.
 
And 3.5 will only introduce additional stuff without breaking anything that worked before.
 
10:22 AM
@poke there are many things and rules were broken by Python itself
 
@PM2Ring but non-OS stuff is saved to disk as normal?
 
I gave an example above
about the comparison and how they made it more complicated
 
Yeah, he explained that
But you're talking about features changing every month. Do you still believe that happens?
 
Yea, with minor version sometimes
 
@RobertGrant Yes. You can directly read & write to other partitions, if you want, although they aren't mounted by default - you have to explicitly mount them. But that can be done with a click of the icon: Puppy puts an icon for each partition that it detects during bootup.
 
10:24 AM
@direprobs As I said: Python 2 vs. Python 3 doesn’t count at all.
 
On a related note, the standard Puppy filemanager understands .iso files - if you click on the icon of an .iso it automatically mounts it via the loop device, so you can use it like a normal filesystem. IIRC, it normally mounts .iso files read-only so you don't accidentally damage them.
 
@direprobs can you give an example?
@direprobs (also, stop talking in metaphors and making us drag stuff out of you. Don't just say yes; give an example or it's pointless saying it at all.)
@PM2Ring sensible stuff
@direprobs and bear in mind I just told you that the last minor version release was in march last year
 
Look, imagine you're working with a huge gaming company that uses Python 2.x for its software for example. Now you're required by the company to translate all the codes to Python 3.x so that the code would be compatible. Indeed, you wouldn't learn a newer version of Python in that case, you would wasted your time trying to forget about Python 2.x and thinking about Python 3.x. I guarantee if anyone of you was a programmer in Python 2.x then shifted to PYthon 3.x he/she would confuse-
 
^ Nobody does that.
 
Yeah that is an issue, but nothing to do with monthly breaking changes
I'm still waiting for your example or your saying that you were wrong about those
 
10:29 AM
> I guarantee if anyone of you was a programmer in Python 2.x then shifted to PYthon 3.x he/she would confuse
 
a lot of important terms, like comparison, cross type ordering, etc... they're many cases in which you'll find yourself stuck with that. But you would never thought about these simple stuff indeed at all.
 
Note that most of us at some point switched from Python 2 to Python 3.
 
@poke you hate me for that ?
 
@direprobs you're getting yourself very confused
 
@direprobs are you just ranting or do you have any serious remark to make?
 
10:30 AM
I’m just saying that I managed to do it, and didn’t run into huge problems.
 
Do you think we created Python, and therefore should've thought of that?
 
Instead, Python 3 actually made a lot things easier for me.
@direprobs Still just words, no examples.
 
Your opinion
 
@direprobs It's his opinion that Python 3 made things easier for him?
 
Yea
 
10:31 AM
Not my opinion but my actual experience. If your opinion/experience if different, then that’s your problem, not Python’s.
 
Ok this gets really silly
 
+1 to poke
 
@direprobs you don't understand what an opinion is then
 
I don't agree with you about how they shift from a version to another, that's very stupid
 
@direprobs you're definitely struggling to understand what's being said. Poke saying that Python 3 made things easier for him is obviously not an opinion
@direprobs every piece of software does that
 
10:33 AM
No, to him not to me
he said to him
 
@direprobs and I'm still waiting for you to back up your claim that there are monthly minor versions that break things
 
could be true and could be false
 
@direprobs yeah and you incorrectly said that it was his opinion, when it's a fact that Python 3 made things easier for him
 
whistles innocently
 
You do realize that Python 2 is still around and receiving patches? So what prevents you from staying at Python 2 if you so desperately want it? A lot people actually still do.
@Jon Aww, Jon! :(
 
10:34 AM
:D
 
The day finally got eventful… :(
 
@direprobs incidentally, this may help you in your quest for monthly version changes:
3.0: Dec 2008
3.1: June 2009
3.2: Feb 2011
3.3: Sep 2012
3.4: March 2014
 
@RobertGrant It depends where you put it. You can directly read & write to your partitions if you want to.
 
@poke and it's "realise" - don't go all American on me :)
 
@direprobs make sense?
 
10:34 AM
Cabbage
 
Cbg all
 
ఠ_ఠ
 
Hey up again
 
hey up fizzy
 
re-cbg
 
10:35 AM
jobs still rolling in?
 
@JonClements Color me unpersuaded :P
@RobertGrant 2008? Has it been that long already? Wow.
 
underlines @poke with wiggly red line
 
@poke I think someone kicked him before he saw it :(
 
Yeah, Jon did.
Such a shame. I had so many arguments left!
 
Although it's rather old now & somewhat outdated, this article may be helpful: How Puppy works. See the diagram & text under the heading "Architecture Overview".
 
10:38 AM
Thanks :)
 
@PM2Ring hahahahah.... I'm not the only one that messes up the markdown now and then :p
 
But you’re the only one who laughs meanly about it :(
 
The rest of us laugh too, we just don't type the letters.
 
Puppy comes with Geany as a text editor, which is quite a nice editor / mini-IDE. And of course Geany has syntax highlighting for Python. :) Unlike many distros, Python isn't installed by default on Puppy, but it's easy enough to do so. Also, default Puppy doesn't come with a C compiler / development tool chain, either, to keep things small.
@JonClements I'm happy to admit that I frequently make mistakes. But I normally spot them & fix them fairly quickly. :)
 
I might just try it in a virtualbox thingy
Just to have a squizz
 
10:43 AM
Geany is pretty good
 
I love vagrant/virtualbox.
 
@RobertGrant Sure. OTOH, Puppy's almost its own Virtualbox. :) If you boot it from a CD it won't automatically mount any of your HD partitions, so it can't screw up your system.
 
I need a fast way to count number of set bits :D
 
That sounds like fun. how fast is fast? How many bits?
 
10:48 AM
Precalculated table, if there aren't too many :)
 
29 bits actually
calculating that table will be slower :D
 
One downside of Puppy is that it tends to not work well with generic USB-boot thingies like UNetbootin. OTOH, once you've booted it from CD you can easily create a bootable Puppy USB stick from the desktop menu.
 
currently i am using bin(i).count('1')
 
My next problem is finding a DVD-RW
 
but it is quite slow
 
10:49 AM
Bugger - been offered a nice FT job, but going through my contracts, I can't do it :(
 
Why?
 
@Robert you can put isos on usb sticks to boot with.
 
Oh yeah true
 
@RobertGrant legal reasons
 
Need to change your BIOS to allow usb booting, that's all.
 
10:50 AM
I can boot a virtualbox while still working, though :)
 
@JonClements non-competition
 
@AnttiHaapala I suspect that a loop of bitshifting, bitwise AND and addition would be faster.
 
@Antti yup - expires in Nov. but that'll be too late me thinks
 
@PM2Ring negative...
 
Sucks when cool jobs come up you can't do yet
 
10:54 AM
pondering if I can buy myself out and sub
 
@Ffisegydd You can, but it's not necessarily efficient if the .iso file isn't contiguous. IIRC, any boot loaders that can boot non-contiguous .iso files have to copy them to RAM (or somewhere) in order to recover contiguity so they can boot from them without error.
 
@JonClements the hiring company might buy it out
 
cabbage all
 
@RobertGrant it's direct...
cbg @Rowan!
 
Direct?
 
10:56 AM
@AnttiHaapala Can you give me an example input and output?
 
@Robert someone I use to work for... they're CEO of another company, he wants me as CTO
 
2 ** 29 - 1 -> 29
def x3(i, bintable=bintable, bool=bool):
    rv = 0
    f = i.__and__
    for j in bintable:
        if f(j):
            rv += 1
    return rv
this is 10 times slower than bin(i).count('1') :P
 
general question: How much of you guys use UML for designing a program?
 
@RowanKleinGunnewiek nope
 
these are 29 bit numbers (bitsets) corresponding to letters a-z, å, ä, ö
 
10:57 AM
Not exactly, anyway
 
You could consider using bitarray package - it's a C extension, I think and therefore might be quicker than bitstring
 
@JonClements yeah I just mean people's noncompetes can be paid off by the hiring company
 
@RowanKleinGunnewiek I've found UML overkill for almost any of my design tasks
I have used a subset of it sometimes in Java design - just mapping out the classes, members, methods etc.
 
@AnttiHaapala Try this:
 
@Robert yeah... I'll have my lawyer look over stuff next week... if I've signed something - I'll stick by it - else I wouldn't sign it
 
10:59 AM
def bitcount (n):
    c = 0
    while n > 0:
        n, r = divmod(n, 2)
        c += r
    return c
 
hmm glad to hear. Just had an exam in UML but I really suck in it. Was wondering how much I would actually use this.
 

« first day (1679 days earlier)      last day (3255 days later) »