« first day (1762 days earlier)      last day (3410 days later) » 

00:25
you need to add your buttonsizer to the main sizer
self.GetSizer().Add(self.buttonsizer) ... I think would work
 
1 hour later…
01:41
Who's there?
@AaronHall Me, maybe.
Oh, well how the heck are you?
Not bad, but I was waiting for a package today to put together some hardware, and it never showed up. Talking to people at the vendor is always fun.
And now it looks like my credit card was declined for the second order for possible fraud reasons.
And you?
01:59
Well... Communications still hasn't officially approved my talk, but talks like they will when I give them a "final" copy of my slides tomorrow morning.
Oh, I broke someone's production last night due to our code residing in a timestamped DB allowing applications to run off of a timestamp (code as of a certain datetime) and some of the code is actually not timestamped so that config changes can be picked up immediately.
So that's interesting.
02:15
Never ask permission.
That's an interesting strategy for delineating production code.
I do it by the book, I like my job.
Of course, if they told me no, then I'd have to question how much I really like my job.
Speaking of doing it by the book, our book is changing. The current VPN is Cisco; but they are changing to Fortinet. They want me to bring in my home computer so they can have their way with it.
BYOD where the D is desktop?
That's very interesting.
That's actually a special case, because I'm stubborn.
They will supply me with a Windows laptop.
Maybe I should do that, I could SSH into my own box. But I'd still be behind the firewall. What I really need is unlimited wireless data on my laptop.
A windows laptop. Le sigh.
02:22
Right now I Cisco VPN into work, and can access subversion and internal websites, and can then SSH into my box (actually, several different boxes, if I care).
Do you know why they're changing?
Yeah. I'll probably scrub my Linux laptop, and let them have their way with that, and start docking it.
No idea.
Corporate-wise, they're a big Windows shop. It's silly, because we're a chip company, and all the chip-design work gets done with Linux.
weird that we feel like we need a 3rd party VPN provider.
Somebody greases some palms somewhere, I suppose.
Or uses the right scare tactics.
The IT guy told me that all the intrusions have been traced back to personal devices. He didn't bother to tell me the OSes. He also didn't discuss the unknown unknowns.
Well they're all on Windows, so naturally.
02:27
'zackly
I kinda wish I could link up with our security people and get permission to try to hack us from the outside, just for the experience. But I've got too many extracurriculars already.
Yeah, security is fairly piecemeal and they rely far too heavily on the firewall where I work. It's slowly changing, I think.
I keep hoping our major competitors will steal our plans and get set back 10 years.
I think we're doing a good job of following the onion approach.
It's silly. I've been slogging through leftovers, answering questions all night with no rep, and I just happened to be the first one on a question 3 minutes ago, and got 3 upvotes...
that's the way it goes. we reward being fast too much on this site.
And we should all vote more. Down included.
Caveat, looks like that only applies to the California Bay Area.
02:52
Is it just me, or is that first graph giving me the finger?
So where are you based?
I thought salaries were high there, too, at least in the financial sector (lots o' Python programmers).
I assume they're getting high here in Austin, as well -- lots of companies hiring Python programmers.
Yeah, pretty comparable, I'd guess.
But my field is finance, so I figure I'm in the right spot.
Frankly, I'd have a hard time justifying a move to either the Bay Area or New York for the top money shown, because of the cost of living. I'm sure some get more, though.
They do. Plus you can rent more affordably if you don't mind a 30 + minute commute via subway.
03:06
Ah. Commute. Hmmm.... My commute is < 10 minutes in my little electric car, from my.. wait, what? rent???
Some people in Austin have horrible commutes, though. Comes from ostrich-head-in-the-sand, don't-build-it-and-they-won't-come type road planning.
We had been looking in Manhattan for a place, almost taking one, but then we started walking around near downtown Brooklyn, and jumped at a one bedroom slightly less than 3k a month.
Hey, my wife wants me to practice some music with her, I gotta go.
Hey so im making a mario clone in pygame and I was reading about command patterns. And in my mario game all objects that are drawn to the screen have an update function (an abstract method defined in their base class), and some of objects redefine their update function in their own class. My question is, would using command patterns in this situation be good?
With command patterns, I believe me goal is to be able to loop through a list of all the objects and call update on each of them. But if each of them takes different parameters, how can I do this?
03:12
I know nothing about game programming, and at first blush the command pattern looks reasonable. OTOH, I also feel that design patterns are overrated
03:32
ok, my weak and delicate fingers are now sore and cramped.
I used to play the guitar much more regularly. Then I got married to a violinist snob. Since she can't find anyone to play for free at her Fake wedding expo, suddenly I'm not so much of a musical liability.
I can't, like, do more than one note at a time. Although my daughter can -- she's a musical genius.
She's actually paying $400 to play for them. I don't see how musicians make it in this city.
Heh. Austin's probably worse.
Music is where you can really see the long tail in action.
I pay good money to play in a community band...
03:37
Plus it's a small freaking world. She got hired for a gig. The guy asked her to find another person. She called two of her friends, and gave it to the first one who called her back. Then the other one called her and claimed she was already hired by the same guy, and then contacted the guy and got canceled (so I guess she wasn't really hired.)
long tail?
Cut-throat, too, apparently. Learn who your friends are.
Well we're talking about $60. I'm glad my wife's getting it, but I feel bad for the violinist who on the outs on it.
As far as who makes money. Just google "long tail." I'm sure the results will be right.
The band dues are $50/month, but we play four free concerts a year, and a few of us kick in a few hundred more each to make it possible -- insurance, printing, buying music, venues.
Plus my good tuba was $10K...
My wife's played like 6 times this year for Wicked as a sub. She's the real deal. But no way could she make it on her own just playing music with the amount of work she's getting. I don't know what to tell her. But she needs more regular work.
We saw Kristen Chenoweth in San Antonio about a year ago. It was amusing seeing all her gay followers among all the rubes that were completely clueless about some of the innuendo. Most of it wasn't really my sort of music, but it made my wife happy and the venue was fantastic.
03:45
That's pretty cool.
You wouldn't think there would be a theater like that in Texas, but there it is
Oh I believe it, everything's bigger in Texas.
But they still don't have a Broadway, which is one of several reasons I chose NYC instead of Texas, California, Miami, Atlanta, etc...
True dat. Lots o' culture.
Wife wanted it for Broadway, it's centrality in all of our pop culture, and a sense that it was much more like the land of her birth than Pensacola.
I liked all the money that's here.
Also I knew the meetup and convention scene was great here.
New York is certainly someplace we'd consider if the conditions were right. But those conditions don't include the kind of money on that chart. My wife's never worked, so it's hard to imagine she'd be contributing much to the budget.
03:55
But it was really hard the first two years before I got my break.
Yeah, I'm too old to wait for a break.
Well she might get work as an executive assistant or something like that, and with your experience, I doubt you'd be waiting for a job. I'd probably find you something fast where I work.
Where is that?
I didn't have any hireable experience when I got here. I was a failed salesman.
And how did you convince them to take you in?
04:00
I made a friend at church, and I told him all about my meetups and projects I was working on, and he told me about what his firm was doing with Python, which got me really excited and I told him I'd love to work with him, I told him when I got hired at a couple of business schools as an adjunct, and when one of them let me go, he got me on his team reporting to him.
Networking is key. I haven't had a "serious" (e.g. needing to get past the HR gatekeepers) interview in approximately 20 years.
Don't get me wrong -- they've been serious technically, but based on the perceived needs of the interviewing future co-workers, rather than just buzzword bingo.
Wow, that off-the-cuff answer (that I later expanded a bit) is up to 60 points of rep -- it's my second-highest ranked answer. The 8 questions I answered tonight before it are all still sitting at zero, even though I have the only answer on 7 of them. Some of those might hit tonight, though, I suppose.
"Networking is key" Well, yeah, it can be really important (it certainly is to me), but in this climate, seems like anybody can get hired.
So where is it you work?
When I interviewed people for our team, I felt like I was trying to dodge a bullet.
04:06
One of the banks in America. Hint hint.
Some might call it the bank.
My wife would probably look askance at that, but she goes along to get along. I do pride myself on refusing one job on moral grounds -- at the little company I worked for, they laid off the entire company, and work was scarce, and the first offer I got was improving predictive-calling algorithms.
I anonymize them for Communications' sake, so they have as little problem as possible with me giving talks, which I (try to) do a few of a year.
That's interesting. Would they have trouble with you putting their name out there?
04:11
Yeah, I offered to tell people from the podium how much I liked working there, and they declined.
I used to represent their subsidiary to the public as a financial advisor.
Some people feel they need to have really tight control over the message.
Perfectly fine by me. In retrospect, I don't want the responsibility, honestly.
Do they do any FPGA stuff?
One of my specialities is partitioning hardware and software and making things go fast. Although with graphics coprocessors as fast as they are these days, FPGAs are probably not as important, at least until the Intel/Altera marriage bears serious fruit.
FPGA? We have some training on assembler. Maybe some low level stuff, but I don't know.
I do Python all day long.
I love Python. Not so enamored of UI or any kind of web front-end, though.
04:20
I do a bit of UI stuff. Can't get away from it. Everyone wants a UI.
Which seems to be a lot of what it gets used for these days.
My users are perfectly happy with whatever I give them :-)
Anyway, got to get to bed so I can get up and write some code tomorrow. Controlling hardware with Python is always fun.
Rbrb
Ditto, good night!!!
04:52
Can anyone give me some pointers on how I might be able to tackle this? gist.github.com/raylu/5053677#file-go-py
05:19
Hey up all
Morning
Not able to access SO. Anyone having same issues?
05:46
Works fine for me
06:00
@brohemian what's exactly your question?
Do you want the board to follow the rules?
Ah, I see, it's in the comments. My take on it would be searching for the groups of stones and counting "liberties" (i.e. free intersections next to the group).
If there are no liberties left, the whole group is captured.
+ remember that it's not allowed to kill your own group and, the last one, the rule of "ko".
the hardest thing would be grouping the stones together; maybe, search in depth would work, and, if you maintain groups as the game goes, you don't have to do it after each turn.
dammit, that's an interesting exercise.
Nerd sniped.
06:38
Any way to run python script which resides locally but run on remote machine without copy it over there?
Pipe it over ssh?
47
A: Can I pipe stdout on one server to stdin on another server?

Scott PackThis is an unabashed yes. When one uses ssh to execute a command on a remote server it performs some kind of fancy internal input/output redirection. In fact, I find this to be one of the subtly nicer features of OpenSSH. Specifically, if you use ssh to execute an arbitrary command on a remote sy...

07:15
Cabbage!
07:27
@kiran Depends what you mean by "run on" and "copy." There's no way to execute code of any kind without it being present on the machine that runs it, but @tuomur's answer indicates there are ways to communicate the results of remotely run processes.
Cabbage, all, by the way
07:38
@Holde
@holdenweb thanks..you mean we can't run on a remote machine without copy my script
@kiran well, I'm presuming you want the interpreter to run on a local machine? So the code has to be available to the interpreter somehow. You could use a remote-mounted filesystem like NFS, but loading a file from an NFS filesystem counts as "copying" it, in my book. Maybe I'm being too picky.
What is the use case that gave rise to this requirement?
I have a script in my local machine which should run on server as it is accessing folder structure of server machine but I don't wan't to copy it on the server side
Because ... ?
07:59
because this is instructed to me, do not keep scripts on server
because?
can you keep them temporarily?
I meant writing the script source to remote interpreter's stdin like cat helloworld.py | ssh remotehost "python -". Assuming it is just a one script file.
I'd use something like Fabric instead if possible.
I don't have idea about fabric
heya Steve
08:18
Cabbage, Jon. You know Greg Wilson?
@kiran sounds to me like you've been briefed by someone who doesn't really understand what it is they want
@holdenweb doesn't ring a bell I'm afraid. Should I?
Probably not. Software Carpentry guy. Staying in Canterbury until December, I believe, which was why I mentioned him
@RomanLuštrik I really need to know if I need to learn r
@tuomur Or even ssh remotehost "python -" < helloworld.py perhaps
Or just stick with python. Because I want to become a data scientists
I personally think that python does all the things which r does sorry if I am wrong and I can not see to find a solution on the internet for this
08:24
@tuomur cat helloworld.py | ssh remotehost "python -" is not working for me..it is saying helloworld.py is not exist though it is present locally..can u help me with this
what does cat helloworld.py say?
@holdenweb ahhh okies :)
@kiran if your computer is telling you a file doesn't exist you would do well to believe it. Does cat helloworld.py work on its own?
08:40
Cabbage
@davidism But when I try that within PyCharm's command line (on a Windows machine, supposedly running a venv), it doesn't recognise pip as being valid.
@IntrepidBrit hmm- that's the way I've done it before (but not in PyCharm). A %PATH% issue?
It's how I normally do it when I'm on *nix, but my laptop is in for repairs, so I'm trying to get my work machine capable of coding in comfort
(firing it up now)
Ah, you know what JRS. You've hit the nail on the head. Looks like the PyCharm console doesn't use the venv I've set up for the project
08:59
cat helloworld.py is showing the content in script
09:18
@kiran Good. So now use the up-arrow to repeat the same command, and at the end add | ssh remotehost "python -" - but substitute the real hostname for "remotehost"
@VigneshKalai Based on the facts that I have, I would have to say "yes". :)
Could you give me any cases :)
Cases of what?
Cases of R being superior then python in certain tasks
09:27
I have one word. ggplot2.
If you want to do any serious data analysis and visualization, R has the most "natural" structures. While Pandas is catching up in terms of implementing data.frames, it's not there yet.
In addition, there are a lot of packages that enable visualizing data using javascript and other resources (i.e. Bokeh).
there is ggplot module in python is it not as powerfull as r ggplot2
@VigneshKalai I can't really comment on what ggplot can do since I don't use it (outside R).
@RomanLuštrik thanks for the valuable information :) and I to agree that r is good in data analysis just wanted to know if python capable of doing that but from you view it is clear that certain tasks still run better in r
You can probably come close with what R and Python can do. Everything else is syntactic sugar and bitterness. I will admit I despise Python's native structures for data analysis (i.e. no data.frames)).
That's why you have pandas working with numpy arrays :p
Although, pandas might be extinct soon, as they're spending far too much time doing numeric analysis and not bothering to procreate... might have to train some other creatures at some point :p
09:39
@JonClements You clearly haven't met factors that make our lives soooo easy. :)
It's a bit unfair to compare the native data structures of a general purpose scripting language and a statistical programming environment and conclude that the former is broken because it isn't the latter. It's not supposed to be!
I'm not saying it's broken, it's just that I despise them. :)
@Roman but at the same time, I can scrape the web, parse tables and analysis them, then construct a database, generate pdf documents and html then serve them from a local webserver in one language - keeping the same syntax and style, rather than context switching all the time :p
I guess my point is that that's your fault for having tried to misuse them for data analysis, rather than Python's fault for providing them!
@JonClements Every language has its merits. R is good for data visualization and modeling (as atested for by 7000 packages in the official repository). When it comes to what you said, it's still doable, but probably not as 'natively'.
09:42
Choose the right tool for the right job is the motto :p
Looks like I started a debate :p
Eggzekli.
That's why I learn R, Python, recently Javascript, html... you can't expect to be a good blacksmith if all you know is how to light up the forge.
@JonClements I propose Rabbit
That's true :) @RomanLuštrik
@jonrsharpe haha... one of your deleted comments just made me laugh
09:46
@JonClements which of my comments was deleted?!
one of the one's that's not there anymore - obviously? Sheesh :p
...they're quite difficult to look for :oS
shrugs? :p
Well, I'm glad you enjoyed it, anyhow
10:07
@IntrepidBrit hope that got you going (sorry to start a conversation then immediately real life drags me away...)
Ah it's fine. It happens. No, still no joy. mutters something darkly about Windows not doing what it's told
It never does what it's told
Are you trying to use a venv, then?
and install the wheel only in that?
At this point, I'd be happy to just install the wheel in such a way that PyCharm can see it
Even if it's global
Cabbage
10:15
@IntrepidBrit OK - well, I'd just point direct to pip and let it do its magic - i.e. <path_to_python_base>\Scripts\pip.exe install <your_wheel>.whl
e.g. on my machine C:\Python33\Scripts\pip.exe install my_app.whl
That will install it in its default location e.g. site-packages
I've done that a few times when Windows-wrangling
OTOH - the link from @jonr looks interesting for PyCharm in particular (I use Notepad++ and the default python interpreter only on Windows)
Sometimes I love SO, answering a question about colorbar of matplotlib, lead me to dig into it's base (ColorbarBase) and now I want to change all my plot code to use that instead :P
@jonrsharpe I've seen that article before. Works for some things, but doesn't work for PyGame
I suspect my attempt to use PyGame to make a quick fluid UI demo is going to fail...
@IntrepidBrit ah, that's a pain
@JRichardSnape Hm. Doesn't like my wheel. That's fine, it's something I can bet getting on with
Cheers guys
10:37
Cabbage
@IntrepidBrit Could be cross compiler issues. Any C code will need to have been compiled with Visual Studio. If it's a standard-ish library - look for a wheel on Gohlke's page. If it's your own.......
That's where I got the wheel from (Gohlke)
ooh - they almost always work
never had one fail
32 vs 64 bit?
Got 64 bit, on 64 bit
10:40
or 2.6,2.7,3.3,3.4 ?
Don't mean to patronise, but even if machine and windows is 64 bit - is the python executable? i.e. if you start the interpreter
For instance - i have 32 bit python on a 64 bit machine running 64 bit windoze
I know what you mean. But hey, I'd rather someone make me re-check the basics and sorted the problem early on that me haring off down some obscure route
:) good - glad you're of similar mind to me
Weird, does this say for anyone else that I have 0 approved and rejected edits: stackoverflow.com/review/suggested-edits/9138738
@IntrepidBrit d'ya want to tell me which wheel you're trying? I can see if it works for me
"SuperBiasedMan has approved 0 edit suggestions and rejected 0 edit suggestions"
10:54
Python 3.4, 32-bit and 64-bit. Either or works for me. Both are installed
pygame‑1.9.2a0‑cp34‑none‑win32.whl
pygame‑1.9.2a0‑cp34‑none‑win_amd64.whl
@jonrsharpe Must be a bug, I'll post on meta about it.
Does it show the same stats where you've just accepted/rejected (i.e. is it a bug with Reject-and-Edit)?
It's just with Reject and Edit, yeah. But it looks like there's a post about it already.
79
Q: Suggested edits showing the wrong stats

gunr2171Yesterday I made a post about putting a reviewer's stats when the Improve or Reject and Edit. That post is about including the information. This post is about the information shown being '0' or being wrong. I did some more reviewing of suggested edits and found this: This is obviously wrong, ...

@IntrepidBrit All just works for me :( Pasted command prompt session here dpaste.com/0Q5XAJJ Shows pygame not installed, installation of wheel and then it is installed. 3.4 32 bit
11:00
Okay, cheers JRS. Must be something else going on. Going to go for a full python wipe and will try again
No probs - happy to be able to eliminate a few options. Good luck!
Ahhh... there's the 2 days rain they promised
You're welcome. The sun has come on holiday to Scotland for the time being. You can have our rain
11:19
@JonClements wanted to know this can you see who downvoted a question/answer
@VigneshKalai nope - votes are anoymous
Very bad :P it would be nice if you could know :)
I really don't think it would be!
Sounds like a recipe for recrimination and bitterness all round.
11:32
Am I missing something or does "If your intention is for a given key you want to keep appending values in a list, you should look at collections.defaultdict" make no sense?
(from here)
It makes sense to me but that's probably because I'm not a native speaker
Cabbage all, I got a little question, I got this formula : viscositeit = (pi*(viscositeit_d**4)* differentialPressure) / (coriolisMassFlow* viscositeit_constante * L) somethimes the differentialPressure or coriolisMassFlow = 0. then I get a ZeroDivisionError. When I get this error I want the function to return 0 and not a error. How can I catch that error?
It makes sense to me and also I too am not a native speaker :P
try: {your code} except ZeroDivisionError: return 0
I suggest that you read up on EAFP (Easier to ask forgiveness) as it's the pythonic thing to do
@BasJansen Thx for response. Oke done that, but when it doenst give a error I want it to return the viscositeit. Can I use "else" for that? like try: {code} except ZerroDivisionError: return 0 else: return viscositeit?
11:40
easy, correct thing then is
try: {your code} except ZeroDivisionError: viscositeit = 0
and at the end do a return viscositeit
The previous snippet is exactly what you asked but one should never return anywhere other than at the end of a function
@SuperBiasedMan Looks grammatically correct to me but not particularly clear. "want to" are usually part of the same verb phrase, but they're actually separate here. "a given key you want" is all one noun group. Removing the redundancy, it reads "If you want a key to keep appending values in a list..."
a function with returns all over the place is a clear sign of bad programming
@BasJansen I see, thx for help :)
In other words, if you want a = {}; a[1] = 2; a[1] = 3 to cause a to look like {1:[2,3]}, use a defaultdict(list).
no worries ;) Also, one of these days I will learn how to do a new line in this chat without sending a message so that I can write correctly indented tiny snippets here
11:42
Although even that is slightly inaccurate because you would need to use append rather than index assignment
I guess it was extra confusing for me because the context was someone asking what happened when they tried to use the same key for a dictionary twice
ie.
hash_eg[10]= "name1"
hash_eg[10]= "name2"
@RowanKleinGunnewiek Take a minute to read this post if you can -> stackoverflow.com/questions/404795/lbyl-vs-eafp-in-java
and i linked the wrong post.... yay
Which is... sorta the opposite of using a defaultdict. But I think they might have been suggesting adding an empty list to which you can append multiple values.
@BasJansen got it :)
Makes sense to me. "Ordinary dicts behave this way. If you want a dict that behaves this other way, use this other kind of dict"
11:51
morning y'all
@BasJansen I agree that it's good design to only have one exit point in a function, but I won't agree that you should never use a return statement inside the function body. And neither does Guido, otherwise it would be a syntax error. :) Sure, try to design your functions so they have a single return at the end, but if the code is cleaner with multiple returns, then do it! One classic legitimate use case for this pattern is when you need to break out of a nested loop.
I use early return out of nested loops in numerical programming at times.
Fair point, there are exceptions
I have just had to 'fix' to many functions that had a return at every possible condition
worst scenario I had was a 50 line function (roughly) with 14 return lines
11:54
@poke laurel :D
I don’t want to click the link
Hence I may have an unfunded dislike for the concept
@BasJansen yeah, that's almost undoubtedly bad :)
without seeing a single line of it
classic example was if a == x: return something elif a == y: return something else and so forth
@poke For the love of God, Montessori!
11:55
I came across this profile looks like he won't be using SO for a long time
anyhow... let's not listen to me ranting about that
2025, lol
10 years is a loooong ban
Hmm, that person seemed a good user based on glancing at his answers shrug. He must have done something very very bad
Why do they ban a person in SO
any ideas what he did?
11:57
Excuse me?
@BasJansen mmm, not immediately obvious
I think he was in the top 2% or 1% category his profile status shows what kind of person he was Fighting idiots, fighting morons.
@VigneshKalai you can read the link from "Temporarily suspended" blog.stackexchange.com/2009/04/a-day-in-the-penalty-box
I do recall one user asking one of the mods (I think it was Anna Lear) to suspend him because he was spending too much time and had to finish his A levels. Maybe this was him
You can probably find the post on meta about it
if it was a temp ban (just displayed as 10 years) to ensure that he studies... then that deserves praise actually
I'm not saying that's him - just I recall it dimly from something I read months (years?) ago
12:03
I recall some quite addictive board, where temporary suspension of your own account was a paid feature.
@BasJansen Yeah, I agree that can be ugly. It's not quite as bad as the spaghetti code that can be achieved using goto, but it's getting close. :)
they should merge lodash and underscore into javascript's core, every language needs a lodash by default :\
this point in the link your account will be placed in timed suspension for anywhere from 1 to 365 days.
In today's episode of "Newbies Write the Darndest Code": datetime.datetime.now().strftime('14:00'). Taken from stackoverflow.com/questions/31986225/…
It would be nice if we know the background story of the ban :)
12:08
Wouldn't that be comparing two strings? That's silly
@corvid Agreed. Comparing time strings is silly, but fortunately, time strings created by strftime('%H:%M') do behave sensibly when compared, since the hour field will always contain 2 digits. It's still silly, though. :)
eh, epoch time is usually best for comparison imo
+1 for epoch
12:27
@corvid Usually. But in this case, I think using the local time is ok, as they want to increment the pickup date if the time the order was placed is after 2PM local time. However, the question isn't very clear, and I'm thinking of cv'ing if the OP doesn't reply soon to my comment about the format of pickup_date.
+365.24*24*60*60*1000 for epoch
whaddya done, jon?
@Jon Did you ban that user for 10 years?
eyes narrow at JRS comment Nobody likes a smart-arse
cutting up courgettes, mushrooms and various things
millenia have come and gone and I still can't resist...
done a good job of slicing my finger
@poke nah you're still safe :p
I know a classic example of Bad Things that happened when a C programmer used localtime instead of gmtime. Their code controlled the operation of equipment at a brewery which ran 24/7. The program turned on the tap to fill a rather large vat with water at 2AM, as usual, and various other ingredients were added. Then an hour later Daylight Saving Time finished and so it was 2AM again. So the tap got turned on again, and there was soon a big mess on the brewery floor.
@PM2Ring I only remember goto statements from when I got my first programming book (or magazine) for the C64
12:34
@JRichardSnape Surely you mean 365.2425, assuming we're using the Gregorian calendar. :)
shudder
(well for Basic, I should say)
Imagine having a pacemaker that measures your heart rate and delivers a shock when it gets too low. On the night that the clocks spring forward, it notices that there are no heart beats recorded for 2 AM to 3 AM! Uh oh. Better deliver one hell of a shock!
@BasJansen To be fair, the small amount of RAM in those days meant that you often had to resort to really ugly coding tricks. But yeah, a lot of C64 code was uglier than it needed to be.
(that's not how pacemakers work? Ok, substitute in insulin monitor or assisted breathing device or something until the example makes sense)
I think it was because with the introduction of affordable home computers, a lot of people wanted to try programming which lead to a huge increase in 'I can into programming' type people
compared to the extremely limited number of people having access to computers before via their university or what not
12:37
Per this answer, do we have some consensus on line breaking around if/and in a long ternary? PEP-8 says after for and/or, but that doesn't look right with the conditionals.
@Kevin My guess is that medical monitoring people have that one covered. :)
Do not be so sure, one rather large mass spec company, supplied us with a MALDI last year that killed itself because of DST
and it started it's source cleaning twice (attempting to go from atmospheric pressure to low vacuum within seconds)
I assume life-critical programming has so much regulation that it becomes safe merely by virtue of repelling 99% of programmers from the industry, leaving only the super-dedicated.
If you're about to say, "no, programmers in the medical industry are about as lazy and incompetent as anywhere else", consider not saying that so I can live in peaceful ignorance
remains quiet for Kevin's peace of mind
Thanks :-)
12:41
^_^
@PM2Ring always happy to be corrected by my betters ;)
worked on the railway and saw some of the programming
@jonrsharpe boolB if boolA else boolC is a very weird construct in the first place. Use boolA and boolB or boolC
Internals chat. Is the outcome of d = {1:2, 1:3} well-defined?
@Kevin I will say that things that are developed in academic hospitals here go through the same clinical trials (1, 2 and 3) for exactly that reason
Guys, I did it, I finally did it!
12:44
You trained a crow to code for you? I'll buy one!
I AM a crow trained to code!
More specifically, is the outcome of dict(list_containing_duplicate_keys) well-defined?
@Kevin let's hope no-one is measuring "time since last heartbeat" with reference to a calendar
@Kevin it will consume the iterable in order, so whichever pair appears last for a given key will have its value in the result
(i will catch up, I will, I really will...)
12:47
@jonrsharpe Ok, thanks. I was trying to puzzle out whether this guy's second approach actually worked.
Cabbage.
@JRichardSnape Reminds me of Futurama, when the 160 year old professor cuts his neck and says "Ouch! that's going to bleed when my heart beats"
Yes, that will leave the highest value for each key. That's neat! Although not easy to interpret.
@Kevin I appreciate that reference :)
I wonder if I should wizz in his cheerios and say that my answer has better big O complexity
12:50
@jonrsharpe IMHO it makes sense to do what your code does and put the line break before the if / else of a conditional expression. OTOH, that's a pretty hairy while condition, so it's going to slow down any reader no matter how you format it. :)
His Cheeri-big-O-s, you mean?
:-)
Actually I'm not sure how his first approach compares to mine because I don't know the complexity of OrderedDict operations.
If it turned out to be equal to mine, and preserved original ordering, I'd be fairly humiliated.
Read the source Kevin.
Then trust your feelings.
Aw, man... Can't I just wait for someone to put a nice table on the wiki?
@PM2Ring I’m going to revert OP’s change to the question if you don’t have any objections.
12:53
Per the equivalent Python version linked from the docs: code.activestate.com/recipes/576693 "Big-O running times for all methods are the same as for regular dictionaries."
Yeah, when people change their question out from under your answer, don't hesitate to roll it back and tell them to write a new question.
What is the opinion on explaining what code does in comment lines (referring to when you post an edited code snippet in an answer)?
@poke Please revert it!
@jonrsharpe Dang.
@poke @pm2ring Your patience is exemplary. And. How dare he obliterate my careful editing ;)
12:58
@Kevin unlucky! The fixed costs will be slightly higher, of course, otherwise we'd probably just use them for everything!
This is true.
And it still amuses me how he continues to ask me about things when he’s using PM2Ring’s solution now…
Time to ask a new question, Sandy. Hope he heeds your comment

« first day (1762 days earlier)      last day (3410 days later) »