« first day (2039 days earlier)      last day (2925 days later) » 

1:47 AM
Something weird with Python 2.7 and Python 3.5
import math

class Point:
def __init__(self, x=0, y=0):
self.x = x
self.y = y
def slope_from_origin(self, target):
return ((self.y - target.y)/(self.x - target.x))
Gah, how do you indent... new to this.
Anyway:
q = Point(5, 12)
r = Point()
print("slope_from_origin:"),
print(r.slope_from_origin(q))
And, in Python 2.7, it returns 2. In 3.5, it returns 2.4, which is correct, I think.
It appears to me to be a serious difference. Is there a math error on its part, or my part?
 
2:34 AM
hey!
This is an issue I am stuck at github.com/kivy/kivy/issues/4285, I am using pdf2svg for converting a pdf to sv.
 
2:55 AM
@AbhishekBhatia Are you talking about Python 2.7 and 3.5 discrepancies like me?
 
3:51 AM
@PhonicsTheHedgehog The way / division works has changed. In Python 2, integer / integer will do integer division. So you need to cast one of those operands to a float. But there's a better way for recent versions of Python 2: you can tell it to use Python 3's division behaviour with:
from __future__ import division
Note that the __future__ import must be the first executable statement in the script, or you'll get an error message. For more details about the change to division in Python, please see PEP 238
 
 
1 hour later…
5:18 AM
@PM2Ring That is very interesting! Thank you for explaining it to me!
 
5:59 AM
cbg
@tristan glacier has this recovery pricing, did you do large recoveries and did you use some throttling recovery tool
and if so would you recommend that tool or sth.
@PM2Ring casting as float is not right either :d
@PhonicsTheHedgehog long story short,
they did the division this way in python 0.0, and it was a mistake
however fixing it would have broken backward-compatibility, so they'd instead make it optional in python 2 with from __future__ import division
since python3 broke the backward-compatibility anyway, they fixed that wart too
(Then there are some idiots who keep telling that it wasn't even broken. Ignore them.)
 
Ah, I see.
Heh, I have a friend who insists on going back to 2.7 because he liked it much more. :P
 
ok, ignore them as well
 
the amish also like to live without modern technology.
but you're not obliged to follow them
 
6:18 AM
True
 
6:41 AM
cabbage
 
7:00 AM
stackoverflow.com/questions/37106789/… unclear / code screenshot / question in Spanish
cabbage
 
7:22 AM
@AnttiHaapala nice
 
(long lost) cbg!
 
@bereal so interesting - I wonder if the Spanish SO has the same rules etc
@IanClark wow, cbg
 
o/ - how be @RobertGrant? :)
 
@RobertGrant now that's their problem :)
 
Sick in bed :)
 
7:23 AM
Oh noes! :(
Over the weekend too?
 
Yeah
 
That's the worst
 
Also it's go live week. Expensive pen tester scheduled tomorrow -> Thurs, go live is also Thurs, etc.
 
Nice
 
:/ - so are you forced to WFB (work from bed)?
 
7:25 AM
Definitely a bad week.
 
I can pen test for you if you like. I've got some paper right here.
5
 
Yeah I'll do a bit of work. My cool D3 screen needs some tweaks.
My first baby.
 
trolol
 
@Ffisegydd oh go on, have a star
 
precious
 
7:26 AM
Good luck for Thursday ;)
 
Haha thanks
Once it's up and running I can stop being a fun dev and start being a boring architect
How's Ian? Been up to much?
 
Boo! (Architect) - yeh Ian's well thanks. Not especially, spending about 50/50 time on Python/JS at the minute which is nice but have neglected community / SO time :(
 
Thehe
 
8:37 AM
@AnttiHaapala I did say the best way is to do the future import... To be pedantic, Python doesn't really do type casting. :p I guess that in general doing 1.0 * a is better than float(a) since that also works for complex a. IIRC, last time we had this conversation you said the main problem with casting is the loss of precision involved in converting a big int to float, and I guess multiplying by 1.0 suffers the same defect as calling float().
Of course, the final result is going to be a float anyway, but it'd be nice to minimize the precision loss. One way to do that would be to cast the least precise operand, alternatively, do ((scale * a) / b) / float(scale), where scale is a large binary power integer.
 
8:53 AM
@AbhishekBhatia Simple solution: just strip the 'pt' off your size strings. A PostScript / PDF point equals 1/72 inch, and is their standard unit for distances; PS / PDF code normally works in points as that's a standard distance unit in the printing industry. It is possible to do stuff at the device pixel level, but that's rare and not recommended; the usual practice in PS / PDF code is to work in points and let the PS / PDF interpreter handle the point to pixel conversion.
 
@IanClark if I were a good enough dev then I could get paid this much to do that, but instead to get more salary I have to do this :)
It does involve a reasonable amount of dev, but also lots of not dev
 
:) - yeh I guess it's a natural way of progressing (to go into architecture)
 
Do you get to roar "I am DevOp" on occasion?
Morning all
 
@PM2Ring it doesn't suffer ;)
ah sorry yeah it does
decimal doesn't
@PM2Ring in any case multiplying by 1.0 will cause less problems than casting to float (casting to float also screws up with decimal)
 
9:08 AM
@AnttiHaapala Ah, I forgot about converting via the Decimal module. But I guess that would be noticeably slower, which may be undesirable if you're looping over a lot of data.
 
10:03 AM
@PM2Ring Thanks, i'll have a look at the rectangle containing black box stuff. I'm confused over the calculate by line instead of by pixel. How can I calculate an entire line of M colours without still having to work it out by pixel?
 
@DCA- You do have to work it out pixel by pixel, but you don't need to render each pixel individually: it's much faster to render a line or rectangle of pixels as a single unit than to render each pixel one by one.
 
10:36 AM
informatically confused cabbage
Last night I closed down my laptop's lid to put it to sleep, now I've opened it up and it booted up
kernel log doesn't say anything about going to sleep, and there's some corruption in the log file before the booting bit:D
but I didn't have to press the power button, just opening the lid booted it up
well this is new...
maybe the OS got fed up with being restarted once every (other) month...
 
Actual OS crash?
 
I'm not sure what happened...
and with my user level, we'll never know:P
 
When mine started that kind of thing, was a HDD failure in progress
 
oh, good to know, thanks
lemme check the smarts
 
Get your backup solution going... ;)
 
10:40 AM
well that's a longer project:)
but yeah, I should at least put my important shit on a usb stick
 
Yeah, some failed writes caused Ubuntu to crash seemingly without cause iirc (it's some 3 years ago, so memory hazy)
 
It may also be worthwhile to do a (read-only) badblocks scan.
 
I think it was because it auromatically put tge enrire fs in ro mode
Bloody phone, ignore typo
 
ah
is my suspicion correct that an OK S.M.A.R.T. check means nothing?
 
@JRichardSnape Yeah, mounting RO is normal Linux behaviour when a filesystem is dodgy, it's not just a Ubuntu thing.
 
10:44 AM
Well, could mean all OK. My experience may be totally unrelated, of course
 
actually, my memory was quite full before going to sleep, I'm not sure if that can imply anything
 
@AndrasDeak Correct. If S.M.A.R.T says it's bad, it really is bad, but if it says it's OK then there may still be problems at the filesystem level, but the hardware itself is probably fine... or at least still usable.
 
probably not...sleeping doesn't involve any playing around with memory (like hibernation does), does it?
@PM2Ring and I guess there can easily be catastrophic failures which are as predictable as major earthquakes
 
@pm2 yeah, I read up on it. Decent strategy really, but causes very hard to interpret behaviours until you've seen it once. I learnt a lot of tools to recover poorly disks...
 
Wow, Got a journal reject with good reviews. :o
 
10:48 AM
wat
 
@PM2Ring Ah, i've got this covered then, I'm not rendering each pixel individually. Only calculating.
 
The last one stating that work more and submit it the next time.
 
@BhargavRao editor didn't like it??
Meh, sorry to hear that. I mean, it's better than being rejected with "this is crap", but it's a reject none the less:(
 
Hah, Dunno. Had worked for some 3 months. I had expected it to be rejected
 
10:49 AM
I just wanted reviews. ;)
 
oh, then kudos:D
opens champagne
 
Well, an accept would have put my publ count at 6. But anyway, I am resubmitting it in December sometime
 
The title here... stackoverflow.com/questions/37251912/how-to-write-good-programming-logic
 
@AndrasDeak Thanks :)
 
Needs addition of "for Great Good"
 
10:51 AM
@BhargavRao so you have time conveniently, right? That's great:)
@JRichardSnape heh...top comment... "The code is intended properly"
intended for Great Good
 
@AndrasDeak Yep, Will be working on it from July.
 
@BhargavRao cool:) You'll be fat with publications in the end, then. Good job!
 
@AndrasDeak Hopefully, you've just had a minor failure. It's still annoying if a file has been scrambled due to a bad block or two, since you need to replace that file with a non-corrupt version, but an HD should have a pool of spare blocks and it will map out the bad block for you, and the disk may remain usable for several more years. OTOH, if you get lots of bad blocks, and more appear each time you run the scan, then it's time to panic. :)
 
@AndrasDeak Thanks.
 
@PM2Ring yeah...from what I've gathered, 1 bad block is more than enough:P
oh wait, what I mean might be relocated sectors
that's a lot of blocks, right?
 
10:53 AM
That's what I had, gradual onset block failure...
 
HDD Crash?
 
@BhargavRao crash of unknown origin
computer rebooted when woken from sleep
kernel log doesn't say anything about going to sleep, but the log is corrupted before the event
so I don't know if the sleep failed, or the file was not flushed before rebooting or something
 
Damn, Have a copy of the data somewhere?
 
I'll get my external hdd ready:P
@BhargavRao no data lost so far, other than the kernel log:D
I wasn't doing anything
maybe my firefox cache is affected:P
 
Some problems are just weird. A faulty USB driver brought down a system in my college.
 
10:56 AM
good thing is that all of my computations run on a cluster, so worst case is some post proc getting lost
 
Let's all move to the cloud.
 
@AndrasDeak Even brand new drives may have bad blocks, but they get mapped out, so you don't need to worry about them. And the low-level disk driver will (normally) take care of mapping out any new bad blocks encountered, although of course it can't de-corrupt a file that's been corrupted due to a block failure. FWIW, modern disk hardware performs bad bit detection and correction. IIRC, single bit errors are repaired automatically; double bit errors can be detected but not corrected.
 
@BhargavRao bah:P
@PM2Ring ah OK, so this is at a much lower level as what SMART sees, right?
anyway, I should be backing up anyway
-anyway
gotta go have breakfast?lunch?brunch?, be back soon
 
@BhargavRao My Dad's old computer had a dodgy USB bus - if you twiddled the mouse while it was printing it would set the LSB of some of the bytes in the print output, so chars with an even ASCII code would be converted to the following char.
So an B would get converted into a C, etc. It made it look like it was printing in Hungarian, or some other weird language. ;)
 
Lol, That's funny. :D
 
11:03 AM
Dad figured out that the corruption only happened if he fiddled with the mouse; I figured out the LSB stuff.
 
It would have worked like a caesar cipher.
You don't want someone to understand what you are printing, fiddle the mouse - Done, Encrypted :P
 
@BhargavRao Not quite, since it didn't affect bytes that already have a 1 in the LSB, so the transformation is one-way.
 
Damn, then it's a Mixed Cipher; Can't be deciphered
 
@PM2Ring cool feature:P
 
@AndrasDeak Hmmm. *nix is designed to be run without needing periodic rebooting. But if you don't reboot regularly you do need to schedule regular fsck checks on your filesystems.
@AndrasDeak :D
 
11:10 AM
@PM2Ring I guess I do:P
 
Didn't know that you could turn off the dino game in Chrome 9gag.com/gag/aL27goA
 
I didn't know there was a dino game
then again, I use fox
 
FWIW, you can force the driver to map out all bad blocks by simply writing to the disk, eg with dd if=/dev/zero of=/dev/sda bs=64K. Of course, you may wish to back up the files (or whole partitions) before wiping the drive. :)
 
heh, yeah, writing zeros to the entire partition would make debugging easier, but it would interfere with my work a bit:P
 
If anyone wants to tell this guy why we need to close dupes, please feel free... meta.stackoverflow.com/a/323101/4014959
 
11:17 AM
wow, I even backed up my stuff in October, after finishing my PhD!
pats self on back
> [...] why not spend less time and just answer it?
rep whoooooore
 
Brief-rbrb, Gotta meet prof
 
@BhargavRao good luck;)
 
Thanks.
 
@PM2Ring actually, Braiam's answer addresses it pretty well
> Because, we are filled with too much crap that finding an appropriated duplicated is increasingly difficult.
 
@AndrasDeak Agreed. But I still think Matthew Taylor's answer deserves some "attention". ;)
 
11:21 AM
I attentioned it as much as I could:P
I think you've said most of what I'd say
with the exception that The Right Thing is to close all the crap:P
in SO Close Vote Reviewers, 4 mins ago, by PM 2Ring
@MacroMan Thanks for that. Hopefully, the downvotes will make him realise that his opinion is not popular among those of us who are trying to keep SO tidy and useful.
@PM2Ring as long as his opinion doesn't spread like the yamming Plague, we're fine
I just wouldn't leave this comment in SOCVR:D
 
11:40 AM
cbg
 
cabbage
 
@AndrasDeak Well, I didn't actually say "Please downvote this answer"; I'd never do that sort of thing. ;)
 
obviously :P
anyway, gang downvoting should be OK on meta: you downvote because you disagree, which is exactly what downvotes convey:D
but I'm aware this is an unorthodox notion
and I'm not saying it's OK:P
 
11:56 AM
@AndrasDeak I suppose so...
 
stackoverflow.com/questions/37253487/… 1. not using pip properly 2. email should be there already
 
1:03 PM
Morning everyone
 
morning corv
 
Afternoon :)
 
Morning cabbage.
 
cbg
 
It's evening here :/
@MorganThrapp cabbage
 
1:06 PM
Checking for bad blocks (read-only test): done
Pass completed, 0 bad blocks found. (0/0/0 errors)
at least my OS partition is clean
 
\o/
 
I'm trying to figure out how to into SQL, I feel like I should know how to do this already
 
does anyone know if there is a way to split up / link your starting app.py document into smaller .py files in a flash project?
 
Adobe Flash integrates with Python these days? Neat.
 
No, integrating Barry Allen into your python
My code's so fast it puts Barry Allen to shame
 
1:12 PM
@convid how are you going about connecting to your database
 
DSM
Morning #garrick #allen #west #allen2 cabbage for all.
 
cbg DSM
 
and it woke up from sleep this time:P
 
@AndrasDeak So far, so good...
 
DSM
(skims up) I'd still make sure everything you cared about is backed up..
 
1:15 PM
@DSM I've just done that, thanks:)
both photos and research stuff
even SO stuff
 
Yeah it seem when it comes to SQL no one really likes dealing with that language. I mean from the command line I can navigate fairly quickly getting it do it in the right order inbetween jamming it through several programming langs. framworks, and other jazz... thats another story
 
DSM
A few years ago my hard drive failed, and the symptom was that everything gradually became slower. But it happened so slowly (over such a long period of time, I mean) that I didn't notice until a friend stopped by my terminal and was all "whoa, dude, slow much?"
 
it's good to have a friend near your terminal every once in a while
 
Rhubarb all, Going out. \o
 
bye:)
actually, my laptop's been doing a lot of iowait
 
DSM
1:17 PM
Rhubarb for Bhargav.
 
ever since I cryptod/uncryptod my home directory
 
So, many months ago I downloaded some software called GifCam. It captures screenshots of whatever's on your monitor and makes it into a gif. What's interesting about it is that the GifCam window has a transparent rectangle in the middle indicating what parts will be cropped out. You can see right through the rectangle to whatever is behind the window.
 
@DSM you're friends with Seann William Scott?
 
I have a half-formed idea for an application that involves taking screenshots, so I'm wondering if that transparency effect is difficult to replicate.
 
DSM
I'm sure that joke would have been hilarious if #igotthatreference..
 
1:20 PM
 
@DSM dude!
 
DSM
@Kevin: I suspect it's either very difficult or trivial. If they provide an alpha channel in the windows bitmap, it'll take less time than this sentence.
 
My first attempt at googling reveals that it's easy to make a Tkinter window transparent, but it makes the entire window transparent. If there's a way to make just a single rectangle completely clear while making everything else completely opaque, it isn't in the first three search results.
 
@RobertGrant "Sweet. Now what does mine say??"
 
I may have to use a different language for this.
I wonder why the GifCam guy provides his software free of charge, but doesn't publish the source. His perfectly justifiable life choices are making things difficult for me.
 
DSM
1:34 PM
One reason I haven't released a bunch of my data utilities is that I'm too lazy to do the requisite code cleanup, and I'd be embarrassed if everyone read the code at the moment.
 
cabbage all
 
DSM
Cabbage for davidism.
 
@davidism cbg
Been on a Netflix anime binge
 
My guess is, he wants people to come to his site and see his other projects, which boosts donations / ad views / whatever. If he lets people fork his project, it fragments the user base.
Crackpot theory: the software is actually a trojan for a bitcoin miner.
 
Check out where I'm staying for PyCon, it looks pretty cool: mcmenamins.com/CrystalHotel
Got everything booked now, super excited.
@RobertGrant what did you finish?
 
1:40 PM
I like the look of that place.
 
That Netflix Ajin series
 
Yeah, I keep seeing it, was it any good?
 
Yeah I liked it - super high budget.
Magi - The Labyrinth of Magic season 1
Super high budget basically seems to mean when characters get excited, they're still drawn correctly rather than the high-speed scribble thing that normally happens :)
Also some of the Marvel animated things, they're okay
Although not amazing
And the Seven Deadly Sins
 
I watched that. B+.
 
Also a couple of episodes of Black Lagoon, which didn't grab me
And that's all in May :)
 
1:44 PM
Did you watch Gargantia and Eureka Seven?
 
Black Lagoon was p. good
 
No, not seen them yet
 
Argh, I forgot to watch Jojo yesterday.
 
So much more to watch :)
 
Ooh, I get to watch Jojo this evening.
 
1:47 PM
Life is a rollercoaster
 
I still want to see the next season of Attack on Titan
That was the first one I watched on netflix and it's so creepy, it's great
 
DSM
Ah, Black Lagoon. I loved the setting, and I can still hear the sad notes that played at the end of every episode as the credits started in my mind. Plus, "sing the Volga to you" is one of my all-time favourite lyrics.
 
I think at the moment any anime I see that could be filmed live-action is a waste of anime :)
Possibly I haven't hit the episode where they make a deal with Satan and demons bubble out of the walls, but there it is.
 
If the protagonist doesn't have a sword made from their own blood and also the blood is acid, why bother animating it?
 
Preferably the blood is also the entire universe
 
1:52 PM
Bah, just been invited to a conference in Vermont and won't be able to go. And it looks all pretty and everything there :(
 
@JRichardSnape not to forget Ben & Jerry's... :P
 
hello guys, anyone here knows how rml works?
 
I did some work with sml back in the day... don't know if that counts
 
I have never seen that acronym before. I bet it's a markup language.
 
1:55 PM
yes, its used by openerp
 
that takes me out of the running
 
Nailed it B-)
 
ehehe
 
It sounds like an elf in LotR
 
alright, let's play pyramid:
clues: "HT, X, XHT, R"
answer: "markup languages!"
 
1:58 PM
My only MLs ∈ {HT, X, YA}
 
YA - the most agreeable markup language :P
 

« first day (2039 days earlier)      last day (2925 days later) »