« first day (1647 days earlier)      last day (3295 days later) » 

1:48 AM
cbg
 
 
1 hour later…
2:51 AM
cbg
 
3:11 AM
cabbage, fourtheye
 
Cbg
 
3:41 AM
cbg all
 
 
1 hour later…
4:49 AM
Nope
 
5:04 AM
What does cbg mean anyways?
 
@EnglishMaster Its a word in our friendly room language Salad :-)
 
He is "trolling"
I already feel offended
:'''( y u do dis
 
how's everybody?
 
@EnglishMaster This is a friendly place, please be nice to us :-)
@AdamSmith Monday morning, Can't complain :) Whats up?
 
Not much. Killing time for another hour and some because I have to do some after-hours maintenance on a machine
10pm Sunday for me~
 
5:11 AM
Ah, you are still enjoying(?) your Sunday... :D
 
yes ha
 
5:22 AM
:''(
Yep.. u made me cry
 
6:12 AM
Sigh
 
yay which country should I move to?
 
Wales
 
Results of the Finnish elections and possible base for the new cabinet: 1st: center party that derives its support mainly from the Bible belt of Finland, rural areas etc. 2nd: perussuomalaiset, the Nazis of Finland, 3rd: the National coalition party with nazi youth rising.
the first one has corrupt ex-politicians who were dropped 4 years ago re-elected as a "wind of change", the second one rides with "Finland for Finns", and while the third one does not, the rising youth is of the "do not spare the rod with the poor / close the borders, now"
these make the UKIP feel like a dream :D
 
6:39 AM
Is anyone of them down-to-earth person?
 
6:50 AM
No, but down-to-hell, for sure.
@davidism you had fun here?
 
Is there any other way with which this Multithreading code can be improved?
I used a Counting Semaphore here, but I feel that its a bit of overkill.
 
Sup dawg
Got an interview today
 
@Ffisegydd All the best :-)
 
@thefourtheye actually the thread shouldn't exit...
 
7:00 AM
@Ffisegydd cool :)
 
@AnttiHaapala OP is using _thread which is low-level (as per the docs) and it exits in this case.
 
If anyone wants to debug some mediocre code, please take a look at mine :) It's for codeeval, and passes the sample tests, but only "Partially" completes the problem. Whatever that means. Code's here, and sample data here.
 
@thefourtheye thought it was "daemon vs non-daemon"
ah it is threading
@thefourtheye that's the solution: ask to use threading instead
 
@AnttiHaapala But he wants to know how he can fix it :(
 
by using threading :D
you can mention it under ----
that's why you should mention it
 
7:05 AM
@corvid The fuck that's cool!
@Ffisegydd good luck
 
@AnttiHaapala I mentioned it, but is there any other way to make the main thread wait for the child threads to exit?
I still feel that Counting Semaphore is too much for this
 
I mean: there is no merit to that question, if it is not good enough for you you should be using the threading library
 
7:28 AM
Now included locking method also... Why am I doing this? :(
 
Cbg :)
 
@IanClark Cabbage :-)
 
179
Q: 2015 Moderator Election Q&A - Questionnaire

Grace NoteCandidate Index Election candidates deceze (nomination) Ed Cottrell (nomination) Jeremy Banks (nomination) Jon Clements (nomination) Martijn Pieters (nomination) Matt (nomination) meagar (nomination) Raghav Sood (nomination) Second Rikudo (nomination) Eliminated in the primaries Andy (nomina...

btw remember to go vote your fav answers there too :D
 
The moderator UI does allow for the suspension to be waived when communicating to a user... as you will discover :) — Bohemian ♦ yesterday
He has seen the future :D
 
good morning !
 
7:37 AM
cbg all
 
Pupppppiiiiiiieeeeee :)
 
good morning Jon, following your advice, started the code academy tutorial, supposed to be 13 hours, i only did 33% as of yet
 
@Stephan that wasn't my advvice... you're confusing me with someone else :p
@thefourtheye puppy!!!!
 
oh i am sorry :(
 
7:41 AM
@JonClements Looks like you had a good sleep :)
Cabbage @MartijnPieters :)
 
@thefourtheye on & off... but better than normal
 
Good to hear :)
 
~> python
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 80 - 27
53
>>> 80-27
fish: Job 1, 'python' terminated by signal SIGSEGV (Address boundary error)
My Python prompt will, reproducibly, crash if I enter 80-27, but not 80 - 27.
How about that. (Not blaming Python. My PC's not doing very well.)
 
hello i am facing problem with nltk .generate() is not working in nltk 3.0.2.please give me suggestions
 
@AnttiHaapala I just noticed that, the documentation also says this
> When the main thread exits, it is system defined whether the other threads survive. On most systems, they are killed without executing try ... finally clauses or executing object destructors.
Now we don't know if the I/O is not flushed or the threads are murdered
 
7:52 AM
so how can i make it work or is it versions problem?
 
I had to change the answer a little bit and I am still not sure if it is really okay :(
 
i am getting this error ->"AttributeError: 'generator' object has no attribute 'generate'"
when i use this type of commands "starting_words = content_model.generate(100)[-2:]"
 
Just one more; it is way too broad and a blacklist would never be complete.
 
Science has gone too far!
 
square donuts?
 
8:00 AM
Yeah
 
hello please help me regarding my issue
i am newbie in python
i am getting this error ->"AttributeError: 'generator' object has no attribute 'generate'"
when i use this type of commands "starting_words = content_model.generate(100)[-2:]"
 
Flagged for mod attention.
 
@TusharKorat I don't know what you are doing, but list(content_model.generate(100))[-2:] should work. Please check the documentation.
 
Will one of you two hurry up and be bloody elected so you can ban him or something?
 
@thefourtheye
i am using nltk in python for text generation and this generate() is not working it shows me error AttributeError: 'generator' object has no attribute 'generate
 
8:03 AM
content_model is not what you think it is.
 
oh yea, also apparently there exist cubical watermelons and they are worth quite a sum if you want to buy one.
 
but given example in nltk documantation.
text3.generate() will show me same error
 
@Ffisegydd better?
 
I'm going to go lie down away from the world.
 
8:09 AM
@Ffisegydd the moon?
 
@Jerry do they just grow that way, or do they put a box around them while they grow to force them into that shape?
 
the latter @TheBlackCat
 
Can I get a list of my bookmarked conversations?
 
or the ones you starred?
oh wait, the above are for the ones you starred
that one is yours that have been starred
 
8:20 AM
hello folks!!
:8 :8 I thought doughnuts came in only shape..
only one shape*
 
apparently not anymore :)
 
See also: circular (donoid?) with jam vs toroid without jam
 
@RobertGrant you mean you created a conversation, like these things?
There is a tab for that in your chat profile too.
 
Aaah
Thanks!
 
8:34 AM
Cabbage!
 
@MartijnPieters now I regret downvoting you with my bot army
 
With a great bot army comes great responsibility.
 
And, it seems, vulnerability to @MartijnPieters' bot air force
 
@RobertGrant So that is where my 186 primary downvotes came from..
 
8:39 AM
... which is hardly an "army" :p
 
If anyone has time to debug my working but not 100% passing codeeval solution, let me know; it's really annoying me :)
 
It's only partially passing because it's too slow. You should have used a real language instead of python, something like Java.
 
@Ffisegydd you meant KevinScript there, right? :)
 
I'm nervous before this interview, forgive me Robert-san. When I get anxious I get sarcastic and trollish.
 
8:55 AM
Don't do that - I think our resident MTFL is already doing a great job ;)
@Ffisegydd what time's the interview?
 
@Ffisegydd that wouldn't be one of the times I'd have said you were talking to me sarcastically :)
 
11. And I could out snark that wannabe hipster any day of the week. I'd just probably get banned.
And yeah a raw python implementation may genuinely be a bit small. Like the best trolling, there was a hint of truth in it.
*slow
 
i am using nltk in python for text generation and this generate() is not working it shows me error AttributeError: 'generator' object has no attribute 'generate
 
Yes you asked a while ago. I'd suggest you ask a question on the main site if no one is answering you here
Please don't ask over and over again.
 
Right - need to get some reports sent out - good luck @Ffisegydd!
 
9:43 AM
ah no :D
 
Re-cbg
 
rerecbg
@Ffisegydd AND HEY UP
 
Hey up mate :D
 
Lol
Such a great day, cracked my phone's screen
 
D:
 
9:51 AM
But I'll be smart enough not to post a screenshot
:D
 
:D haha
 
@vaultah oh gods, people really do that?
 
@F4z do you know how to use exception handling yet?
 
F4z
I was just thinking about it but, is there a way to do this without exception handling?
 
10:04 AM
You can put those two lines in try..except IndexError to handle the exception.
 
F4z
is it not possible to do thos without exception handling?
 
Yes, just test for the list length; if len(each_item_in_book) > 2: means there are more than 2 items.
 
@vaultah :D and facepalm at the same time.
Love the 'I thought she meant jailbroken' comments.
Bash.org link should be one-boxed.
Just sayin'
 
Yeah
According to codeeval, I'm in the top 10% of Python 3 developers
applies for that CTO position
 
10:12 AM
so if I say "this is not a good gun" then comes a moron who says "why do you complain, a good shooter can shoot a perfect series with that gun too"
 
F4z
@MartijnPiethe Thanks! if len(each_item_in_book) > 2 worked
 
10:31 AM
@RobertGrant what sht is that site?
the 2nd challenge is: "make a program that prints 929"
 
@AnttiHaapala they get harder :)
 
I mean, at first I thought "oh.."
 
I just found it when @MartijnPieters posted that link about language popularity, and started doing the exercises
 
but it is a program that prints 929, it is stated that the output should be that
but you get points for uniqueness
 
Which one?
 
10:32 AM
so I did: "print('9' + '2' + '9')"
the prime palindrome
 
And given I haven't done a lot of python, it's really beneficial to me to work through these exercises
 
Input sample:

There is no input for this program.
Output sample:

Print to stdout the largest prime palindrome less than 1000.

929
score 100
 
I did it the computational way :)
 
print(0x383261)
@RobertGrant you did worng
technically you didn't do it as per the instructions
you did a program that calculates the largest prime palindrome less than 1000 and then prints it
mine just prints it
this program prints the sum of 1000 smallest primes
score 100
 
@AnttiHaapala bad day? :)
 
10:36 AM
no
I just said that what a pointless site, I do not want to get hired by anyone who uses that for employee qualification.
 
Well, maybe if you come back later there'll be exercises other than that one
 
♫ Snow is falling down just a little bit / The world's so quiet and still ♫
:(
Apparently chat invitations are delivered instantly whereas chat mentions are delivered in ~30 minutes
 
@RobertGrant Just keep being active, as that stat applies to the last 3 months of activity only or so.
 
@MartijnPieters so doing all the easy ones over the weekend probably helped :)
 
@MartijnPieters do you feel their exercises good?
 
10:50 AM
@AnttiHaapala they have a nice spread of difficulties.
@RobertGrant you are further along than I am then; 15 hard, 55 medium and 39 easy completed.
 
difficulties maybe but they're not very good for assessing a devs skills, just maybe the command of the language
 
STARRED! Lest we forget.
Oh crap, it doesn't show who you were talking to
 
@AnttiHaapala you can learn a surprising amount of info from what people submit to these kinds of challenges.
I certainly tried to create the challenges for the Indian competition Velocix organised to a) not be easily googled and b) teach us something about how the candidates understand the problem they are solving.
 
ah so one can see the code :D
 
Unfortunately the site that ran the competition botched the whole thing rather badly.
 
10:54 AM
Best way to build a list of lengths of strings? lengths = map(len, string_list)?
 
I was given the code of the submissions of that competition, I cannot see the CodeEval submisssions.
 
in that case I'd have my code mention that it specifically does according to the spec
@MartijnPieters there was a task in codeeval for saying: "print the sum of primes < 1000"
example output: nnnnnnnnnn
so I converted that to hex, then print(0x123123) and get 100 and a unique program :D
there was no requirement that I need to calculate it; and it was even given out for free.
 
Most exercises give you an input, so it would be a file with a different limit on each line, and you have to print the sums. That's how most of them work.
 
programmers are supposed to cheat
and be lazy
use all possible loopholes in the problem
 
Yeah but they should obsess over major things, not things that don't matter :)
 
10:58 AM
ah ok the 191 challenge is good :d
 
@AnttiHaapala sure, but probably not the point of the exercise :-P Other challenges are not as simple as all that.
In any case, the competition showed that the vast majority of submissions chose to brute-force their way out of a problem.
Rather disappointingly.
 
Do you see that from the memory used etc?
 
Given an integer target_size, how many pairs of integers out of a sequence given fit in that target if summed? So given a sequence of positive integers, name all pairs that sum to that target size.
 
@MartijnPieters there are good bruteforcing and bad bruteforcing
 
@RobertGrant no, I saw it from the submissions I was asked to rate.
 
11:07 AM
@MartijnPieters yeah, using N*N for that is bad
 
@AnttiHaapala what, a double loop over all the integers and finding the integers that sum to the target?
we explicitly passed in the input integers in sorted order.
so a deque (or a simple list with two indices) would have been far more efficient; you can easily do it in O(N) time.
 
or iter and reversed
 
not quite, as you can overshoot the target.
so you want to re-use the lower value to test it against the next lower high value.
 
can be worked around by storing the most recently tried lower value.
 
11:09 AM
ah that's what you mean
 
@EricBal please see the chatroom rules under Posting Question/Answer Links
 
@EricBal: those of us interesting in answering Python questions already have a tab open for that.
 
Sorry...
 
Ugly :/
 
11:14 AM
@vaultah what's that?
 
@AnttiHaapala the style of the page switcher in the mobile web view, I'd say.
 
dunno :D
 
As a sample of how I'm trying to write answers in codeeval, does this look okay: paste2.org/3A6Py8s0 (for codeeval.com/open_challenges/2/submit)
(It says solved, I'm just wondering about style etc. 19 loc.)
 
@RobertGrant open without with is wrong :P
list() -> []
these kinds of things are revealing
is ''
is utterly wrong
same for is 0
 
What does it reveal?
 
11:18 AM
it reveals that you do not know how to program correct Python code, for you it is good enough that it produces the correct output for some limited cases.
 
@AnttiHaapala yep, Martijn is right
 
(ouch xD)
 
is 0 mustn't be used ever in any Python code
or line is ''
there is no guarantee that these point to the same object (though they very well might be because of optimization)
 
Okay, well thanks for the technical feedback. I'll change that for the next exercise.
 
no it is not technical feedback
your code is wrong
you must write == 0 and == '', it is not matter of style
314
Q: Why does comparing strings in Python using either '==' or 'is' sometimes produce a different result?

jottosI've got a python program where two variables are set to the value 'public'. In a conditional expression I have the comparison var1 is var2 which fails, but if I change it to var1 == var2 it returns True. now if I open my python interpreter and do the same "is" comparison it succeeds >>> s1 = '...

 
11:22 AM
Yeah, I get it.
 
btw, there is a solution to this in the standard library: heapq.nlargest
 
I was distinguishing between your feedback on how to code it better and the general unpleasantness
 
@RobertGrant :D I was being blunt yes, trying to be like a review audit failure
that is: "STOP! Look and listen"
 
cbg
@RobertGrant Do you already have a list of the strings themselves? If so, making a new list just of the lengths is probably wasteful. Python container objects all store their lengths as an attribute, and len() compiles to an attribute lookup. So you can save a tiny bit of time by caching collection lengths, but it's rarely worth it.
 
@PM2Ring yeah, you're right
Don't even need to loop over lines
Oh, maybe I do. Dunno.
 
11:36 AM
from heapq import nlargest
import sys

with open(sys.argv[1], 'r') as f:
    limit = int(next(f))
    for l in nlargest(limit, iterable=f, key=len):
        print(l.strip())
 
hi, someone there with exprience in aws architectures that can give me a tip?
 
@RobertGrant Don't worry about Antti - his bark is worse than his bite. He sometimes comes across as a bit blunt or harsh, but I just put that down to him <s>being a crazy Finn</s> not being a native speaker of English. :)
4
 
What is a good book for Learning Python with some experiência in programming? I man I book that won't take 3 Pages to teach whileloops
experience*
 
cbg
 
@Catgocat did you try the Python tutorial?
 
11:42 AM
What tutorial?
 
@PM2Ring that is true, actually I'd not bark if I didn't like @RobertGrant
(and yes I have a bad morning) :D
 
@AnttiHaapala Do you think that is all I need to dive in Python? And also, should I care about Python 2?
 
@Catgocat you shouldn't care about Python 2 (in the beginning at least)
(except if you ask @PM2Ring, who uses Python 2.6)
 
Do you think that tutorial is all I need to dive in?
 
the 2 are not compatible; python 3 has been around for 7 years
@Catgocat it is all for you to start
 
11:47 AM
Thank you for the suggestion.
 
I never read any Python book myself
 
:) Even though I still use Python 2.6 I certainly don't recommend it to newcomers. @Catgocat: Learn Python 3! You may need to learn about some Python 2 stuff in the future if you need to use, modify, or understand old code, but right now you should just focus on Python 3.
 
@Catgocat there are many many many questions posted on SO about someone doing really advanced code (expert programmers it seems but not quite familiar with Python), and the answer will link to a chapter in the tutorial...
 
The official Python tutorial is aimed at people who are familiar with programming, so it's not ideal for total newbies. But it's really helpful in explaining the core of Python, especially those features that Python does differently from other well-known languages.
 
@PM2Ring I was doing that lengths thing before I remembered I could just sort the thing, then I found out about sorting by key, and by then that lengths list was pointless but I'd left it in :)
 
11:54 AM
@AnttiHaapala My first intro to Python was the official tutorial. About 6 months later I read a couple of chapters of a fairly ancient version of "Dive Into Python", but I got bored with it and went back to reading the standard module docs and my trial & error experiments.
 
yeah, that is also good...
the standard library reference is really good read...
@Catgocat you can read the tutorial, read some Python code, have a quick browse of the standard library reference of things that you shouldn't reinvent, read the most upvoted python questions on stackoverflow
and our room canonical questions at sopython.com/canon
these are questions that pop up all the time in stackoverflow, really the top-FAQ
 
@RobertGrant Ah. Rightio. By a curious coincidence, I just answered a question about sorting by key: stackoverflow.com/q/29744744/4014959 . It might be a GCSE task question, or just uncannily similar. :) But either way, I guess it's homework, so I didn't write a program that the OP can just hand in as their own work.
 
@AnttiHaapala I will certainly do that. I come from JavaScript / Node.js
 
if you are a guru in JS then you definitely must learn the tutorial :D
not a book :D
 
@RobertGrant oh, dear..
 

« first day (1647 days earlier)      last day (3295 days later) »