« first day (1625 days earlier)      last day (3321 days later) » 

12:23 AM
@Martijn np :-)
Didn't respond earlier because you said you had to run (and in fact, can't stick around here long: dinner is promised al tiro)
I will say that each time I've posted a canonical Q/A pair I've made sure that there were people around here who knew what it was, so that hopefully early upvotes would alert potential downvoters that maybe it wasn't a no-effort post. And as mentioned, one caught a dv anyway.
 
1:20 AM
Diced smokey bacon with a bit of sweet and sour sauce with pasta - interesting taste
 
cbg
 
How's everybody's weekend :)
Well your weekend Jon
 
1:38 AM
Ummm... wel it's 2:38am and I'm working... so errr, same old I guess :p
 
lol damn
Only 9:40 for me here
 
I've always liked working the night shift
 
Me too, but not all the time
I find it kinda zen from time to time
 
quiet, just code, I like it best when I'm working on research stuff - more thinking and planning then production code for known problems or systems
like right now (writing my essay for acceptance for graduate studies)
 
What a fun bunch we all are, hey? :p
 
1:51 AM
actually, I just had a fun conversation with one of my professors about corporate work (yep, I was part of a cube farm) in the 80s
Though for me it was the 90s
all the geeky stuff we'd do during breaks or when waiting for new projects
so day shift can be fun too I guess :)
 
My office is a blast. I actually look forward to going to work
 
I want to have nerf wars again
Programming a nerf turret, that your co-worker built, through the usb using perl...so much fun
 
>_>
 
2:09 AM
now you can just buy them online
 
>< Not cool, a guy really pulled my leg and lost my time today on SO...
 
sorry @Cilyan, what's up?
 
@JGreenwell ah, nevermind. I'm just mad because we're here to help others and have fun solving problems, but lately I got too much of "hey slave, do that for me"
And the last one was so disguised that I went up to chatting with him only to find after two days of ping-pong that he just tricked me...
 
I echoed that same sentiment two days ago
 
2:26 AM
Well, let's look on the bright side, I made the proof that regexes are the fastest at finding a list of words inside sentences :)
This is good to know
 
as compared to?
interested in that benchmark
 
As for example trying to split the sentence into words and checking if they are in the said list.
 
4
Q: sort speed c++ vs python

Nathan SchmidtSorting a list of ints in python 3 seems to be faster than sorting an array of ints in C++. Below is the code for 1 python program and 2 C++ programs that I used for the test. Any reason why the C++ programs are slower? It doesn't make sense to me. ----- Program 1 - python 3.4 ----- from time i...

 
The other solution is not even good, as it will only say if a word is present but not how many times if there are several occurences.
@Blob: without reading the question: merge sort?
 
@Cilyan didn't read code. OP's not using any optimization flag, though.
 
2:34 AM
@Cilyan that's a surprising timing difference
 
Anyway, having its name in a renowned algorithm is classy... Timsort by Tim I wonder if I can create a Cilyansort :)
 
The answer links to a "C++ implementation" that's written in C :|
 
anytime I hear any question about the speed of A vs. the speed of B. My instinct is to say "cause one is using the correct algorithm for the situation and the other isn't"
 
the comments claim the C++ one takes 0.05s w/ optimization
 
@JGreenwell I don't know, but compiled regexes are very efficient. I'm no expert, but you get basically a finite state automaton that is probably able to execute more efficiently than the Python VM, as it knows that it only manipulates strings and the instruction set is reduced.
Maybe also a list isn't a good idea... At least with dicts, you get the advantage of hashing. Not sure that word in list uses hashing...
 
2:41 AM
@Cilyan oh, the speed of A vs. B comment was toward the sort speed c++ vs. python btw
 
Oh yeah, I got it so. Anyway, my point is same as yours, regexes seemed better in that situation, and I wouldn't bet for other situations :)
Yeah... "x in l" is O(n). So there
 
heh, in fact I once had an argument with a peer where I proved a COBOL implementation of a certain data structure had faster sort and searching options then a Java version
Yes, compiled regex = cool and fast (and better for that particular situation) but not always faster nor the best answer
 
Right... I'm not a designer, so I've kinda had to hack apart a template - but what'd we think of weddingclassiccars.webs.com versus weddingclassiccars.co.uk:18181
 
Never touch a Fiat
Ever
 
Actually, my second statement whenever I hear a "speed A vs B" question is "how badly does this obfuscate the code and what does it do to adaptability?"
 
2:46 AM
By the way, here is another benchmark that truely surprised me: gist.github.com/Cilyan/50b9ee3e2dad67bb8a6b
A double for loop performed better than any functional based solution we proposed...
 
That surprises me less, I've run benchmarks on recursive functions in similar situations (particular with simply mathematical calculations) that have beat out the better approaches
 
@JonClements: I really mean it, I'm working for an equipment provider, and the tester team was able to break the brake pedal in two pieces last week. They told me it was usual. In all the other customer teams, I'd never heard such a story!!
 
in Java, haven't run into that with perl, numpy and scipy and the ilk are pretty powerful
hah, working in too many languages: in python, duh :P
 
@Cilyan welll, these are like 50 years old or something and do limited mileage, and get serviced every month - but anyway - not my business... not my concern :)
 
@JGreenwell doing both Python and Java isn't forbidden? (just joking)
 
3:01 AM
currently, Java (mostly Android), Python, Perl, Javascript (AngularJS, Bootstrap, with JQuery), PowerShell and some .Net with C#, and various SQL systems (MySQL, SQLite, SQL Server).....brain = mush sometimes
never agree to tutor students for a college: They will send you everybody
 
Ha ha
I learned Clojure recently, for a CodingGame challenge... It's not nice...
 
that's a Lisp derivative isn't it?
 
Yep
That compiles on Java
 
....that's just wrong >;)
 
But I do not see the point in S-expressions for coding, it makes the whole thing extremely complicated. Which is not helped by the functional concept...
And I hardly remember a language giving that little information on errors. All you get is a traceback of the VM in java (in case you'd like to debug the language itself)
 
3:10 AM
only have to deal with Lisp and Haskell stuff when I work on machine language stuff - all I know about why people like them is: "cause that's how we did it in the 80s"
 
Thank you RMS...
 
luckily, most of that is moved/moving over to python/R or other such
 
We'll rule the world... just wait :)
 
actually, that's why I started python, though I've done very little in that area....why do other subjects always seem to pull you away from the one that most interests you?
other then that's life, I mean :)
 
Ha ha, that's why I'm on SO :)
 
3:20 AM
actually, same here. I mostly ignore harder SQL questions, which I could answer easily (unless I see them go unanswered) for questions I have to look for the answer to in python - as it helps me learn the features and basically is a nice change in pace
 
3:41 AM
anyway, rbrb all.
 
4:02 AM
@JGreenwell rbrb!
 
rhubarb
 
 
3 hours later…
7:09 AM
cbg
 
7:29 AM
cbg
 
7:49 AM
 
the duplicate you linked to is another duplicate... shouldn't you link to the first question instead (of which your linked question is the duplicate)?
 
8:36 AM
@Jerry I think the answer there is valuable, so it's best if the OP goes through the first one and has the link to the main dup
 
http://stackoverflow.com/questions/146557/do-you-use-the-global-stat‌​ement-in-python
 
@AnttiHaapala duped one, to the other, then too broaded the 6 yr old one
 
9:36 AM
teah
*yeah
 
cbg
 
9:54 AM
Probably a typo, but the OP is not responding: stackoverflow.com/questions/29327493/…
Here's a little script I wrote the other day to check how active this Chatroom is when I don't have it open in my browser. Of course it uses Python2isms; it also parses the Web page data using a regex. :)
 
10:42 AM
Sound in my Ubuntu started working \o/
 
10:56 AM
I suppose the sound wasn't working because my motherboard is really new..
 
I'm glad the sound on your system is working; I couldn't cope with a computer that can't play music. I guess you weren't able to test your new motherboard with your Ubuntu before you got it.
 
cbg
 
11:12 AM
@PM2Ring well, at least the sound was working in Windows (there was a DVD with drivers for Windows), it's kind of sad they don't really care about Linux users..
FWIW, the motherboard is ASUS X99-DELUXE
 
It is sad, but hardware manufacturers don't make Windows drivers out of the goodness of their hearts. They do it for money, and it's not like they're going to get a pile of cash for creating *nix drivers.
 
@PM2Ring Aussies won!
congrats
 
And with some hardware they may not be permitted to make the necessary details available to the Open Source community to write the drivers due to the licensing arrangements they have with Microsoft... although that sort of thing isn't as bad as it used to be.
@BhargavRao Thanks! (As I said the other day, I don't follow cricket)
 
But still
 
Yeah. :) I bet my step-dad's pretty happy about the Aussies winning.
 
11:21 AM
Twas a nice match
 
Oh, good. Although I'm not into cricket I do appreciate the high level of skill involved in top-grade games. And I kind of like the old English feel of the game; Americans (and most of the non-Commonwealth world) find it baffling. :)
 
Even I added a comment like you did ;P
:D
 
11:36 AM
@BhargavRao Yeah, I noticed. It's not a fantastic answer, but I guess we shouldn't bombard the newbies with fancy tricks like zip(*[iter(seq)] * rowsize) :)
 
Yeah
Sylvian's answer was a little overkill
 
Hey guys.

I'm using python, scikit-image and pyqt to make an image processing application. Basically, I need to provide the user the ability to do some image processing on an image.

I've loaded the image using QPixmap onto a label.

My concern is, if this is the correct tool to use in going about it. Also, how do I edit the image and re-render it on the screen.
 
11:58 AM
@BhargavRao A little. I do like the zip(*[iter(seq)] * rowsize), but it's probably mind-boggling to newbies; If I were answering that question, I'd probably use something like this:
table = [seq[i:i+rowsize] for i in range(0, len(seq), rowsize)]
for row in table:
    print ' '.join(row)
But for my own use I'd do:
def square_square(rowsize):
    maxnum = rowsize ** 2
    width = len(str(maxnum ** 2))
    seq = (str(i*i).rjust(width) for i in range(1, 1 + maxnum))
    for row in zip(*[iter(seq)] * rowsize):
        print ' '.join(row)
 
Yep! You should have added it as an answer! The OP could have learnt better methods :)
Yes, maybe I cant see the obvious because Im tired. — LaraChícharo 1 min ago
lol
 
@WasifHyder Sorry, there doesn't seem to be any Qt experts around here right now - I do my GUIs in GTK2+. OTOH, a Pixmap is an X windows thing, and works the same way in any GUI system (although different systems may provide different toolsets for manipulating them).
 
Thank you :) Can you just give me your thought process on what you'd do or look for?

I mean. The application, to a large extent is a subset of most scanning software, or very basic image editing software. I'll load an image. The user can choose (like on instagram or HP's scanning) what effect to apply. Wherever I'm displaying the image, it will update based on the setting selected.

Even if I have a high level idea. I'll be able to fill in details.
 
A Pixmap is ok for drawing and some simple image processing operations. A Pixbuf may be more efficient, and provide things like scaling. Using a Label to display it is probably not the best idea. Labels aren't really optimized for that sort of thing - they're supposed to be mostly static areas, and I expect that Qt supplies some sort of object that's intended for general drawing use. GTK has a DrawingArea for that sort of thing; it also has an Image.
 
12:15 PM
@PM2Ring Thanks a lot man! :) I'll look into it.
 
@BhargavRao I know that feeling. :)
 
@BhargavRao I'm betting it's a homework problem and I don't want to give them a program that will earn them top marks. :) The reason I think it's homework is that they're writing a range to a text file with one program & reading it back in with another - no sane person would do that in a real program. :)
 
Hell yeah
That was on purpose, as OP question seemed so clueless (like homework), I felt I had to answer with something to involved/magic that OP could see that it worked, but might be unable to comprehend why it worked, or would be unable to maintain this code (just think of adding a temporary variable in this function, or placing it in a class). — qarma Sep 23 '14 at 12:27
 
12:35 PM
@BhargavRao I vaguely remember seeing that one before. It's a classic, but I understand why it got all the down-votes. smci makes some good points, but I'm mystified why he says that we should use j instead of i for the transformed index. I guess it'd make sense if we wanted to use both a 0-based index and a 1-based index in the same function. But that's not happening in the code on that page.
Speaking of mixing 0-based and 1-based indices reminds me of one of my favourite xkcds: xkcd.com/163
 
 
1 hour later…
1:43 PM
hey
 
He could just represent S expressions in the JSON :D
Actually, I'd just send the expression over as a string, and parse it on the other end.
Writing simple expressions parsers is fun.
 
yeah, if ppl would use lisp they wouldn't need to reimplement it
 
2:05 PM
Hi
I have installed a module name robobroswer on Python 2.7 32-bit and it doesn't work. It gives me the following error:

ImportError: No module named robobrowser
Do anyone know how do i fix it ?
 
How did you attempt to install it? (If you'd actually installed it you wouldn't get an ImportError). Did you use pip?
 
Hi
Thanks for the answer and i fixed it.
It just hasn't been added to my path
 
ok
 
2:30 PM
rhubarb
 
What?
 
I've edited the question, because I don't think it's as opinion-based as the wording made it seem: there is a genuine (potential, at least) technical problem with OP's JSON.
 
Outstanding answer. Have a cookie.
Writing the code to evaluate an S-expression type of structure is super trivial.
 
'zackly :-)
 
The OP gets it. I love it when that happens.
 
2:43 PM
It is nice, yeah :-)
 
Bah, four close votes? I swear.... SO is spring-loaded to close everything. I'm pretty sure they should just take the "ask a question" button off and stop wasting people's time.
Sorry. Need more coffee.
 
It did appear more opinion-based as originally written: the dread word "better" in both title and text.
 
Oh. OK.
 
3:12 PM
cbg
@WayneConrad: Why use "none" for "not" or "nor"? It seems a bit complicated. Using "not" would be sufficient and self-explainatory
 
It's more consistent with the use of "all" and "any".
@Cilyan Also, "not" is not self explanatory when there is more than one operand.
 
3:29 PM
Okay, I was writing something and then understood the meaning you give to "none", like "none of them".
 
Woo. Released 0.1 of my data package.
 
Still confusing to me, as None has a very different meaning in Python, but at least I get your idea
 
Oh, right, in Python None is the equivalent of null or nil, right?
 
I'd suggest "noneof" or just "not" with only one operand allowed
Yes
 
In Ruby, our collections have none (along with any and all), so it seems natural to me.
 
3:32 PM
And in Python "any" and "all" are actually known function that behave like and and or but can take any number of operands
 
Yep. Just in Ruby, we didn't misuse the word None and make it no good for other purposes :D
 
:)
 
I think I'd just use "not" - in combination with the comparisons, "any" and "all" you can do anything you need to, and given that we are basically talking about a transport format, simpler parsing code is probably a higher priority than human-readability in the particular case of { "not": { "any": [...] } } vs { "none_of": [...] }.
 
What does "not" do with multiple operands?
 
Not allowed. Period.
 
3:36 PM
That would work, then.
 
3:47 PM
cbg
 
Is this valid? 0 < num < 10000000000000000000000. Ruby would hate that.
 
@WayneConrad perfectly valid
 
Very cool.
In any case, that code is awful. Using an exception for normal flow control.... magic numbers... duplicated magic numbers...
 
@Wayne the custom read and write functions made me chuckle
 
I don't know enough Python to get the punch line there.
 
4:47 PM
@Wayne they've basically re-written input() and print() badly
 
Oh, haha!
I know it ruins the joke if it has to be explained, so thanks.
Something doesn't make sense about the question. There's a lie somewhere in it... I just don't know where.
If a teacher wanted you to intuit binary search (which seems likely, given the way the code is structured), then the teacher would write a working program. What I see isn't teacher-written code. It's barely code at all.
If the teacher wanted you to write the binary-search guess-the-number game, then the assignment would be to "crack the ...server."
 
My crystal ball is failing me - not even sure why socket is there...
(and there's no too low/too high etc... just a straight == - so doesn't appear to be a binary search exercise)
 
That, too.
This question is actually making me giggle. There's a kind of charm to getting so many things wrong at once.
 
and ast.literal_eval is interesting... something must be wrong with int obviously :)
Especially since you could then enter {'a': 1, 'b': 2} and have it succeed :p
 
elk is god tier meat
 
5:01 PM
@corvid your markov chain generator is getting worse :p
 
I'm going to VTC, now that I can see that there's no programming in it.
Yeah, elk is yummy. I've heard that cow moose is even better, but never had it so I don't know.
 
5:26 PM
Today is @Ashwini Chaudhary's Birthday... :-)
 
0
A: Trying to crack the guessing server

Antti HaapalaThe key is the ast.literal_eval. It allows for floating point numbers to be entered. The floating point numbers have a precision of <16 digits. By entering 0.99999999999e22 you make the end result after summation also 0.99999999999e22, thus you can enter it twice to get in.

 
Happy Birthday, @Aswini Claudhary!
@AnttiHaapala Oo. Let me go retract that close vote... I think it's a marginal question, but I'm alright with marginal questions when I like the answer.
Nicely done.
 
@AnttiHaapala I took your advice and undeleted my answer :-) I included DSM's solution also
2
A: Search for same values in 2 lists but only once if duplicate

thefourtheyeThe best way I can readily think of is, maintain a set of already seen numbers and if the number is not in the already seen set then add the index to the result and the number to the seen set. result, seen = [], set() for index, item in enumerate(lst1): if item not in seen and item in lst2: ...

 
@thefourtheye good
 
Sorry, last night I couldn't respond because I slept at my desk itself :'(
 
5:48 PM
Yeah, I shouldn't have deleted the above message...
 
6:01 PM
Please revoke downvotes. — Malik Brahimi 15 secs ago
;D
 
Hell I'll downvote someone just for saying "Please revoke downvotes"
 
There's an argument for saying it should be on Code Review, I guess, but as edited I don't think it's opinion-based.
 
It sorta is. But, again, I like the answer, so I'll vote to reopen.
 
6:30 PM
cbg
I'm the only guy who both cv'd and reopened the question :D
 
What's the problem? I took the tuple from the dictionary and concatenated the list with the converted tuple. Thank you for the downvote! — Malik Brahimi 38 secs ago
Please tell me I'm not wrong and his answer is actually wrong..
 
@vaultah Malik is wrong
 
\o/
 
6:45 PM
This answer giving the code dump 5 mins after I post the explanation
sigh
 
@BhargavRao ---
nope...
@BhargavRao write the code for the loop, using while loop and no recursion
 
Sry, I did not get you
 
you can also compare len(words) with words_needed
hmmm
does not make sense to have "words needed" that is increased :(
 
Frgt all of that
The code has more errors than I expected
The code is highly screwed up
else:
        words_needed >= 5
?
 
6:53 PM
Ah! That too
 
newbie :)
not using test-driven development obviously
 
Hopefully not a hv
Else I'll just delete my ans ;)
 
I don't think so...
 
Quite an interesting one
Yay Ninja's back
 
Very interesting indeed.
 
7:04 PM
@Wayne, If Ninja tells it is interesting then there is no other doubt on it! :P
Am Sure the guy who answers it will get a badge within no time
And I suspect marty is already half way through
 
7:24 PM
It should be deleted and we should move on. — Frédéric Hamidi 47 secs ago
Swag
 
7:53 PM
@BhargavRao why does that have 14 upvotes????
 
8:13 PM
Is it me or does asking a kaggle question on SO - violate the rules of the contest
 
8:50 PM
@BhargavRao I havent gotten even an upvote
now the other user who doesn't really know what he's talking about...
 
9:25 PM
@MartijnPieters lol :D
 
@davidism as a fellow fan of Murakami I present to you fosslien.com/murakami
 
10:43 PM
If statement won't work in python 2.7.9
:)
we must call Guido urgently, it's a huge bug...
 
anyone in here know java android
 
@DevinTripp: Wrong room I guess :s
 
@DevinTripp this is the python room
 
yeah but no other room is responding
@a
 
then wait
 
11:01 PM
@antti
for 22h
 
go to java room
go to android room
ask your question on the site
 
@AnttiHaapala: What is this cv-pls tag I see each time ?
 
did no one has answered and the java and android room arent there
 
@Cilyan means close vote (if you think it is closeable) please
 
@DevinTripp nevermind, we'll not beat you for asking Java here, just saying that you'll most probably get even fever answers as in Java chat. It's like asking for some bread at a butcher because the bakery is closed... It's fun to try, but you'll get no bread :)
@AnttiHaapala ok
 
11:07 PM
@Cilyan so get yourself 3000 rep and you can hammer those qs down
 
@AnttiHaapala trying, but a good one year brought me to 1700 yet... So it's not gonna happen too soon. Anyway, I'm just having fun here :)
 
casting close votes is part of the "fun"
if ppl would learn to ask proper questions and just not do unformatted code dumps followed by "HJELP ANY1?"
 
Want to cast close votes? See here: chat.stackoverflow.com/rooms/73989/…
 
@Ffisegydd "adjective: slippery" and "facial feature: eyebrows" were really good choices
 

« first day (1625 days earlier)      last day (3321 days later) »