« first day (1833 days earlier)      last day (3122 days later) » 

12:39 AM
good evening!
 
Evening.
 
what are you up to this fine evening
 
12:53 AM
Working on some PHP freelance stuff. :/
You?
 
1:05 AM
ick....watching tv browsing SO
 
cbg
 
Sounds fun.
 
user559633
gentlemen
 
sir
 
1:19 AM
I suspect that question may be a troll question.
 
Yeah, I think you're right.
Java can't find pi because to find pi I need titan cores and only jython can import titan. — Johnathon Shatly 59 secs ago
 
I don't even know what to say to that.
 
user559633
Yeah, lazy troll
 
I frequently tangle with Python, but I've never Javaed with Python. Is that when you put coffee in your disk drive to overclock the interpreter?
 
user559633
I've Java'd with Python via Java->JNI->C<-ctypes<-Python
 
user559633
1:27 AM
my coworkers responded with it "you can do that?", "oh", and "what happened to you as a child?"
 
My first question would be "Why?", followed by "How high are you?"
 
I want a CJytherlangisp interpreter so I can C in Python while I Java in Perl while I Erlang in Lisp.
...As long as I can import Fortran.
 
user559633
"because i can", followed by "a standard thursday quantity. pounds? what's the appropriate quantity here, furlongs?"
 
user559633
although to be honest, i don't get high. i'm boring
 
Yeah, I don't any more either. I get panic attacks when I do.
 
user559633
1:32 AM
for me it's just not worth the legal risk. i don't like that it's criminal for me to put substances into my own body, but yeah, not worth the risk.
 
Eh, I'm in a stoner college town. The cops don't care at all.
 
user559633
the real reason is because a different portion of my company is all java and i wanted to show that we could collaborate
 
And did they let you collaborate or did they still say no?
 
one of my older jobs, the entire backend platform was java, so we used jython to write certain extensions exposed by the API
 
user559633
We could. It was more of a "we're not so different after all are DO NOT LOOK AT ME DIRECTLY IN THE EYES"
 
user559633
1:36 AM
>>> def int_check():
...   if POISON_INT:
...     return 0
...
>>> def bool_check():
...   if POISON_BOOL:
...     return 0
...
>>> POISON_INT=1
>>> POISON_BOOL=True
 
user559633
>>> timeit.timeit(int_check); timeit.timeit(int_check);timeit.timeit(int_check); timeit.timeit(int_check);
0.11714486597338691
0.12074635701719671
0.1136307209962979
0.12179105100221932
>>> timeit.timeit(bool_check); timeit.timeit(bool_check);timeit.timeit(bool_check);timeit.timeit(bool_check);
0.11324246297590435
0.10327441000845283
0.10497996996855363
0.10312449198681861
 
At my old company, we would have meetings to decide things, then eventually tell relevant people about what was decided at the meeting they should have been invited to, then solicit their input, then tell them their input can't be taken into account because a decision was already made at the original meeting.
 
user559633
I didn't expect that to be any different considering that 1 is a constant
 
The expert was lucky to be at that meeting.
 
user559633
Biting my tongue about my current job.
 
1:46 AM
Ah, the joys of being an intern while your company makes a right-hand turn into synergy.
 
1:57 AM
well ex-machina is turning out to be an interesting movie.
 
2:10 AM
is there any certification exam for python?
 
user559633
@AvinashRaj sure, i offer one for $50 usd
 
Mine is $49.99.
 
user559633
Yes, but mine is Premium
 
Mine is a no-frills, sensible way to get the certification you need in this day and age.
 
user559633
Yes, but mine is Premium
 
2:23 AM
I can't compete with that.
 
user559633
 
So I'll label my certification Premium and move my certification headquarters to China so you can't touch me on copyright.
 
user559633
free for official sopython members
 
@tristan A disassembly of your function shows it uses POP_JUMP_IF_FALSE, and the source code for that special cases True and False.
@AvinashRaj My offer is but a single letter different from Tristan's: I offer one for $50 used.
 
@PatrickMaupin Neat
 
2:27 AM
Perfect! Then after we get certification we can demand a refund because it can't be any good if it came from someone who has no certification (anymore).
 
user559633
Both use POP_JUMP_IS_FALSE and load global and the op codes look the same. I wonder what's missing -- typing?
 
@TigerhawkT3 That has an accepted answer with a link to codecademy...
 
user559633
Tristan University has been an accredited van school for the past .05 decades. That's a pedigree you can trust
 
@tristan The function for POP_JUMP_IF_FALSE actually does a C compare (e.g. if object is True) for True and False before looking at everything else.
 
Accepted answer on what?
 
2:30 AM
@TigerhawkT3 funny circular reference, if all of the people issuing certs had a cert to begin with, then the first one to issue one ever would be a fraud...
 
user559633
@PatrickMaupin Ah. Makes sense.
 
Unless the first one got a certification from someone.
And a time machine.
 
I got mine from the FSM.
 
well that makes perfect sense
 
Or wait -- maybe that was my Verilog cert.
 
user559633
2:32 AM
@CSᵠ Unless you need to pay yearly for the snakeoil like microsoft certs
 
whaaaaa
 
user559633
Most of my certs were issued from "Tristan's House of Certs and Freegan Ribs"
 
user559633
It used to be "Classy Pete's House of Trust"
 
That explains the funny dark-orangey stain.
 
.
 
2:34 AM
I always issue expired certs. That way I can't be responsible. Also, if the cert-holder can't leverage them into a job by showing that I got these so long ago they already expired, he's probably not very good anyway.
 
user559633
I do a PKI for most of my infrastructure and have my own CA
 
user559633
My Python cert from above is only valid for as long as I remember I issued it to you
 
@PatrickMaupin good lol, certs are certainly good for users who can't code
 
alright, voted to delete that question.
If anyone else here can vote to delete it would probably marginally improve the Universe: stackoverflow.com/q/33293182/541136
 
do deleted questions resulting in the rep gains/losses associated with the answers attached to them be removed too?
 
2:45 AM
@AaronHall It's because of biased people like you that Mr. Shatly has a complex that interferes with his higher cognitive abilities.
 
I'm 75 rep away from voting!
 
@metatoaster I hope so.
 
I think..
it unlocks at 3k right?
 
@metatoaster under certain circumstances answers keep the rep, but I don't have the specific meta reference
 
yeah it isn't a thing that comes up terribly often.
and delete vote requires 10k rep iirc
 
2:47 AM
I say marginally because the Hubble telescope just scoped out some neato galaxies whose light has been allegedly travelling for 18 billion years to get to us.
 
welll technically the light arrived instantaneously from its frame of reference...
 
oh it's close that is at 3K.
 
who cares what photons think?
 
I do.
 
Bleeding heart liberal.
 
2:49 AM
It affects troop morale when I send my photonic soldiers to do battle with darkness.
 
@AaronHall I didn't know you were a phase-ist.
 
Up with holograms' rights! Photons Be Free!
 
they have feelings too.
 
Flips off a light switch
 
the glowing rectangle you are staring at says otherwise.
 
2:53 AM
I'm not sure if that's photon abortion or photon anti-immigration.
 
Prophylactic energy planning.
Yeah, that answerer went from 162 to 119.
 
ah, that answers it.
 
15 + 30 - 2 = 43
162 - 43 = 119
It's all wapped up in a nice neat package.
 
Let's see you try to do all that math in the dark!
 
:)
wapped up. lol
 
3:04 AM
I just assumed that was your Elmer Fudd impersonation.
 
I feel like Zaphod in the Total Perspective Vortex. youtube.com/watch?v=kSnJl7B_TVs
 
We'll start calling you "Beebs".
 
I'd be honored, baby.
nighty night folks!
 
3:26 AM
Night night.
 
g'night and rhubarb to Beebs and all!
 
3:49 AM
Good rhubarb, Patrick.
 
user5365803
4:33 AM
hello hi
 
Nik
Hi there, I'm having trouble installing pygame. Which one do I choose and how do I get it working?
 
4:48 AM
@Nik Your command prompt says Python 2.7, so pick a 2.7 one. And it looks like you have a 64-bit processor/OS, so you could use a 64-bit version (if you want to be safe, you can use a 32-bit version, but your computer would have to be really old to actually need that).
 
based on what you have (python 2.7.10, amd64) you might want to try pygame-1.9.2a0-cp27-none-win-amd64.whl
3
Q: Installing Pygame on 64-bit Windows 7 and 64-bit Python 2.7

KubiK888The title says it all. I do see similar questions, someone suggested about http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame, but all the pygame downloadable files are in .whl format which I have no idea how to run on Windows 7. I tried "cd [directory] > pip install [filename]" without success.

 
Nik
5:02 AM
Yes, but now, how do I open the .whl?
 
Did you visit the above linked question?
 
Nik
1
A: Installing Pygame on 64-bit Windows 7 and 64-bit Python 2.7

Avijeet GhoshOpen the .whl file through WinRar and just extract the contents(you will find 3 folders) into your Python folder. For example : if you had installed python 2.7.3 in C:, then your directory to extract will be C:\Python27

 
Did you miss the top-rated, accepted answer?
 
wow that answer is wrong. Works, but bad advice.
 
Nik
@TigerhawkT3 No, I'm not terminal literate. I don't know how to get pip.
 
5:08 AM
terminal skill is probably one of the important skills to learn if you want to program in python...
anyway, start > run, cmd, in the prompt, type pip and see if it's a recognized command
 
All you have to do is type the given command into a command prompt, using whatever correct file name you have on your computer.
 
Nik
@metatoaster It's not recognized. I'll try installing it
 
@NIk python 2.7.10 already comes with it
Unless someone else have a better way to get the python path added so that pip can be run anywhere on Windows...
 
Nik
5:26 AM
 
Nik
pip ain;t recognized
 
you could manually verify the existence of the executable you need to run by opening the target directory
 
HELLO
 
but please search harder online for guides, especially the ones that are detailed like python-guide.org.
 
5:30 AM
can someone quickly show me what the problem is with this code?
from Tkinter import *
class F(object):
    def saveas(self):
        filewin = Toplevel()
        e1=Entry(filewin)
        e1.grid()
        button = Button(filewin, text="Save", command=self.save)
        button.grid()

    def save(self):
        f=open(self.e1.get(), "w")
        f.write(Main.t1.get())

class Main(object):
    root = Tk()
    root.geometry("100x100")
    b1=Button(text="save", command=F.saveas)
    b1.grid()
    root.mainloop()
Hello?
 
what is class Main supposed to be and why does its declaration directly run the root.mainloop()?
 
It is the main script that runs the window.
i put it in a class so i could access the variables in the functions
 
@inspectorG4dget vanakam I too am from chennai
 
@JonahFleming You might want to search for a tutorial to go through first zetcode.com/gui/tkinter before stabbing around blindly
and Main is declared as a class so it doesn't behave like a function which you might have expected
zetcode.com/gui/tkinter/introduction Please review the simple example and see what you did wrong.
 
cbg..
 
5:38 AM
cbg
 
@VigneshKalai Hi...
 
@AvinashRaj how are you regex master
 
5in BTW i'm not the regex master..
 
Then what are you :p
A wizard/ninja with regex power ?
 
just an SO member..
@VigneshKalai made a ping from another room.
 
5:40 AM
Modesty so how is job
 
just jump into that..
 
Did not get a ping
 
search for room Jo.*
 
@JonahFleming There's no need to repost your question in chat less than a minute after you posted it as a full question.
 
Nik
pip is frustrating. I'll install it later. Atleast I got pygame by unzipping the wheel. Thank you for watering my brain :)
 
5:55 AM
@Nik you need the correct file name, have you downloaded that anywhere?
really though more like Windows is frustrating, but each to their own...
 
Nik
@metatoaster yeah the wheel is in the downloads directory and the pip.exe is at C:\Python27\Scripts\pip.exe
 
but if you read the error message you will see that it is looking for it in the same directory as pip.exe
you need the full path to the whl file, or you need to change to that directory and run the first command.
 
Hey up all
 
I dunno, I didn't have any Windows problems with pip/Python.
 
Huh?
 
6:01 AM
@VigneshKalai cool! btw, so is @thefourtheye
cbg all!
 
Yeah already knew I came to this room because of him
 
So born in chennai
 
oh cool! which part of Chennai are you at now?
 
@Ffisegydd again my joke went wrong :P
Triplicane you mate
 
6:02 AM
Not so much problems, more the frustrations resulting from the added effort, but as I said each to their own :p
 
@VigneshKalai I think you're confusing me. See oxforddictionaries.com/definition/english/hey-up
 
cool! not far from me. When I'm there, I'm in Mylapore
 
So now went there to study ?
 
I see.
 
pretty much
heya Dr. Fizzy! What's happening?
 
6:05 AM
I found Python Windows development to be painless as far as problems due to OS. Contrast that with my Python Linux experience, in which I eventually discovered that Ubuntu comes with Python but not Tcl...
 
lol! I think you're the first person I've heard say that
 
Sup inspector. Not much, on the bus to work.
 
can't sleep, so I'm at my favorite hang out :P
 
Climate would be very cold right compared to here
 
right now, it's about 2C
 
6:07 AM
I found windows generally fine. I click a button and it's installed, no issues. On Linux I had to manually build my python install (multiple times) and it's still not 100%
 
oRly? apt-get didn't work?
 
I wish it was 2C here. I love the cold.
 
doesn't it get that cold there, Fizzy?
 
I had issues trying to get age old versions of python (think python 2.3) working on modern distros
 
Using CentOS so the only version yum installable is 6
 
6:08 AM
If it is 2C it would be snowing there right?
 
ugh! CentOS has gotta make things difficult
 
All I had wanted to do in Linux was use cx_freeze to package an executable of my program for Linux. It took quite a while to figure out that Tkinter wasn't working because there was no Tk for Python to inter with. I ended up giving up. If someone wants to run my app, they're welcome to the source code. :P
 
@inspectorG4dget it does get that cold but is not currently that cold
 
basically you need to grab all the dev packages... CentOS is one of the worst distros for getting modern things working, so yeah I get you.
 
It's not snowing right now, but we did have some snow a couple of days ago
 
6:10 AM
because RedHat, and yum/rpm is one of the most annoying package management system I've dealt with
but as I said before, each to their own :p
 
Eh. I understand the point in that it's hella stable. It just means developing on it day to day is painful.
 
also installing latest versions of packages on top of it kind of defeats the point of its stability. If you need a dumb stable system using only its packages it's great, but for actual work/development and keeping up with the more modern development/library ecosystems it's a huge pain.
anyway, rbrb
 
rbrb
 
rbrb Tiger
 
I feel 22C is too cold and turn OFF the air-conditioner
 
6:13 AM
whoa yeah, I remember those days
then again, AC induced cold is a lot different from natural cold
 
22C is about as hot as I'd ever want it to get
Mid teens is best.
(Phrasing)
 
I don't know Fizzy, I kinda draw the line at 23. Then again I'm 27, and you might be younger
(I'm so sorry for that terrible joke)
 
I'm 26 ;-;
 
Current temperature is 30C I feel this temperature is ideal for me not too cold not too hot
 
30C is horrific.
 
6:15 AM
I'm 29. Urge to tell stories about how things were back in my day... rising...
 
I am 23 the youngest yeah !!!
 
technically, I'm the youngest - I've only had six birthdays
 
I haven't seen snow in my whole life :p
 
go to Kashmir... or even Delhi
 
It's white and cold and wet and heavy.
 
6:18 AM
But once I have witnessed ice rain :P
they are colorless and heavy :p and can break a leg :p
 
I think you're talking about hail
 
Yeah it happened in chennai if you remember
 
no! when did this happen?
then again, I haven't lived there since 2006
 
2010-2014 don't remember it correctly .I only remember getting hit by one ice
 
I didn't live there in that time, so I could have easily missed it
 
6:24 AM
Yeah you would have . climate changes are pretty drastic now days 36C in morning and 28C in evening
 
So in which field are you doing your Phd ?
 
Wow nice so you should be pretty good in maths?
 
don't really need a ton of msth
 
6:28 AM
Really I thought you need a whole heck of maths to do AI
 
if you're trying to invent a deep neural net which is meant for rapid descent and generalization in a large feature space, then yes, you're going to need some linear algebra and quite a bit of calculus
but, if you're trying to make something like a variance-reducing mixture of experts or random forest or anything like that, you're likely more interested in training methodologies than the math
especially if you're doing evolutionary algorithms, you don't need as much math - some stats, yes. But the hard core math can be almost entirely avoided with EAs
I work mostly with evolutionary algorithms and hybrid systems. The math is pretty simple there
 
Oh did not know so much details. I would be trying out a predictor model to match my input with the given categories.
Haven't started that yet will start that after a 3 months have other commitments
 
but again, what kind of model do you want to use? A neural net, clustering, evolutionary algorithms, trees? I mean there's a ton of models out there
also, note that I listed model types - there's a ton of subtypes in each
 
I still am trying to figure out :P
I thought bayesian would be nice since I heard it can be used in almost all of the models
 
for example, with evolutionary algorithms: GA (so many different types), ES, ACO, Bees, Macrophage, AIS, the list goes on...
ok, so you want to use some bayesian technique. Are we talking about some sort of MLP, decision trees, straight up ML+Priors?' (there's more)
 
6:39 AM
You are trying to scare me :P
 
nahh... I just know a lot of this stuff
 
I am going to start from learning coursera machine learning course
 
it's alright, from what I've seen
python has a lot of machine learning in scikit. So learn scikit and numpy
 
I thought I should know basics of ML before going into scikit
and also heard that many are using R since it has many libraries for machine learning
 
@inspectorG4dget Thala, Mylapore ah? Super... I thought you are in the North Chennai
 
6:49 AM
@thefourtheye: மாப்பிள்ளை (roughly translated: "dude"/"bro")! how's life?
I can walk to Savera in about 5 minutes
 
@inspectorG4dget I'm actually working in AI (a bit) for my current project at BigCorp.
 
@inspectorG4dget அட்டகாசம் மச்சி. அங்க எப்படி? (Roughly translated: Awesome, how are you?)
 
I can walk to beach in 3 minutes :p
 
@Ffisegydd: wanna talk about it? I'm happy to talk discuss ideas, if you need to chat sometime
 
@inspectorG4dget @VigneshKalai Its drizzling now :-)
 
6:53 AM
@inspector I would if I could but I can't so I shan't
 
@thefourtheye @VigneshKalai: ரொம்ப குளுரு. கொஞ்சம் வெய்யில் அனுப்பேன் (roughly translated: very cold. Please send some sun)
@Ffisegydd: NDA?
 
It is still cloudy here @thefourtheye office at tambaram
 
@inspectorG4dget ha ha ha, its fun to do the translation :D
 
clear skies here tonight
 
@VigneshKalai Oh, Sholinganalliur area is like Ooty in summer :D
 
6:56 AM
@inspectorG4dget Not a specific one, just not allowed to really discuss projects in specific detail.
 
@thefourtheye: I just realized, we can write whatever, and give it a very under-the-radar translation Err... I mean puppies! everybody loves puppies
 
Yay, Puppies FTW :)
 
doesn't matter - as long as you can explain the mathematical nature of the problem, I should be able to meaningfully discuss appropriate algorithms
 
@inspectorG4dget நீங்கள் குளிர் அனுப்ப நான் வெப்பம் அனுப்ப translated as you send cold and i will send heat
but not now it is starting to get pretty cold now
even google translator is confused because of my english :P
 
@thefourtheye: நாய்யே ! (translation: "dog!". Context: usual usage is in insult, but there is enough sarcasm in this usage for it to be interpreted as not an insult, and as a reference to the previous comment). <damn! that was long>
@VigneshKalai: using translator? I use transliterate
 
7:00 AM
@inspectorG4dget really?//
 
yeah @AvinashRaj! where are you?
 
@inspectorG4dget perungudi.. (near velachery)
 
I'm just realizing how many "homeboys" (am I using that right) are on here
 
Speaking of puppies, I petted a 9-week-old Australian Shepherd the other day.
 
oh fun @TigerhawkT3
 
7:02 AM
@inspectorG4dget True, but if we use puppy, then the actual translation would become நாய்க்குட்டி :D
@TigerhawkT3 I bet that doesn't look better than me :D
 
shhh! :P
 
you are acting in direct contradiction to the crossed out text :P
 
Instead of making a growly face, the puppy was licking me and going nuts for petting.
I like puppies a lot.
 
@inspectorG4dget ha ha ha...
 
7:03 AM
who doesn't! Puppies are awesome!
 
Cats are better.
 
Cats are better at being cats. Dogs are better at being liked by me.
 
@Ffisegydd Whaaaat?!?! I thought you loved me :'(
 
got nothing against them. I love them both
 
Cats are scary
 
7:05 AM
whoa @thefourtheye! I'm sorry, but when someone says puppy in here, I immediately think @JonClements
 
@inspectorG4dget ninja three legged puppy..
 
Burn.
 
@inspectorG4dget Hmmm, that's true. Many longtimers of this room often confuse me with my evil twin.
 
hahahaha
 
@thefourtheye your dog seems scary to me..
 
7:06 AM
I just assumed it was a Dr Jekyll and Mr Hyde scenario.
 
it actually looks like a wolf in the conversation window. Only when I open it up, do I see that it's a dog
 
Cats growl at one another to say “Back off before I have to use my claws rather than my voice!”
 
Looks deceive Humans!!!
 
Actually this happened to me many times
 
KKKKKKKKK
runlength encode that to get K9
 
7:08 AM
ROFL :D
 
@thefourtheye when I see your pic i think of the famous dialogue Why so serious?
 
All of my team is away today, the stand up will be fun. Me sitting in the kitchen on my own, talking to the wall about my plans for the day.
 
@VigneshKalai No no no, you are mistaken... That was me, trying my romantic smile :D
 
Does that get the girls[bitch :p] @thefourtheye
 
:-)
 
7:12 AM
@Ffisegydd Even when people are there in the standups, most of the times I feel the same way :D
 
@Ffisegydd lol! That's a whole other spin on talking by the water cooler
 
@VigneshKalai Well, be it puppies are men, they gotta try :D
 
Looks like you are doing a good job :p
Happy Friday all have heck of jobs to do will chat later :)
 
alright all, it's 3.20AM here. Sleepy time for me
 
Have a nice sleep thala :-)
 
7:24 AM
Thanks. I shall सो जा , सिर उठा के (sleep with my head up - a play on a coke commercial from a while back)
rbrb all
 
Cbg :)
 
7:51 AM
Cabbage
 
8:15 AM
Cabbage!
Here’s something I never thought I would say: A PHP question sparked an interesting follow-up question today.
>>> Decimal(40 * (10 / 100 + 1))
Decimal('44')
>>> Decimal(50 * (10 / 100 + 1))
Decimal('55.00000000000000710542735760100185871124267578125')
> Aren't both […] affected by the same shortcomings of floating point representation by binary mantissa?
So what makes the 40 special that it works and gives an exact result?
 
8:59 AM
@poke Whatever makes 40 special also makes 10, 20, 30, 60, 70, 80, 120, and 130 special. If I'd tested for n beyond 130 I'm sure I would've found more.
Dunno what the secret is yet.
 
>>> Decimal(50 * (10 / 100 + 1))
Decimal('50')
what did I do wrong?
 
You did it on Python 2.
 
My git-fu is getting stronger.
 
gah, I had the wrong interpreter running
 
The only reason I even have Python 2 installed on my machine is for testing and answering 2.x-specific questions.
 
9:04 AM
Yeah, I did this on the other tab when testing out how __closure__ behaves under python 2......
 
My old workplace standardized on Python 2. =\
"Isn't Python 3 an unstable development beta?"
 
well to be fair I still use a lot of python2. If Zope/Plone can get their act together and make stuff work completely under Python3
 
Does anyone know of a good design pattern/method for testing database queries? So I'm looking to write tests for my middleware. I can test the internal logic of the middleware my mocking the results I get back from my database queries, but what's the best way to test the actual queries themselves?
 
@TigerhawkT3 That’s like saying “We shouldn’t use Windows 7 yet, it’s unstable. Let’s use XP or Vista instead.”
 
the floating point thing can be kind of explained if you look into the byte representation
 
9:17 AM
@metatoaster The question isn’t why floating points are not precise enough to represent those numbers. The question is why the 40 * <imprecise float> makes it a clear integer while 50 * <imprecise float> doesn’t.
@Ffisegydd in-memory databases. Or if you can’t do that, blank databases with test fixtures
 
>>> x = 10 / 100 + 1
>>> Decimal(x)
Decimal('1.100000000000000088817841970012523233890533447265625')
>>> Decimal(40 * x)
Decimal('44')
>>> Decimal(50 * x)
Decimal('55.00000000000000710542735760100185871124267578125')
 
it's... complicated
>>> b2a_hex(pack('>d', 50. * (10 / 100 + 1)))
b'404b800000000001'
>>> b2a_hex(pack('>d', 51. * (10 / 100 + 1)))
b'404c0ccccccccccd'
>>> b2a_hex(pack('>d', 52. * (10 / 100 + 1)))
b'404c99999999999a'
>>> b2a_hex(pack('>d', 53. * (10 / 100 + 1)))
b'404d266666666667'
>>> b2a_hex(pack('>d', 54. * (10 / 100 + 1)))
b'404db33333333334'
>>> b2a_hex(pack('>d', 55. * (10 / 100 + 1)))
b'404e400000000001'
 
@poke yeah I've got that part sorted (made a dedicated slave VM with my database on that I can build/tear without affecting anything else). I was more thinking of how to actually test the queries. I think my issue is that my middleware logic is (not currently) fully separated from my frontend logic and so just writing the tests is awkward (ironically, I need the tests so that we can fully separate the two logics ;-;).
 
>>> b2a_hex(pack('>d', 35. * (10 / 100 + 1)))
b'4043400000000000'
>>> b2a_hex(pack('>d', 36. * (10 / 100 + 1)))
b'4043cccccccccccd'
>>> b2a_hex(pack('>d', 37. * (10 / 100 + 1)))
b'404459999999999a'
>>> b2a_hex(pack('>d', 38. * (10 / 100 + 1)))
b'4044e66666666667'
>>> b2a_hex(pack('>d', 39. * (10 / 100 + 1)))
b'4045733333333334'
>>> b2a_hex(pack('>d', 40. * (10 / 100 + 1)))
b'4046000000000000'
Then the ones leading upward from 41 onwards no longer meet back at 0s
anyway apologies for the spam, this is interesting but I think it has to do with how that multiplication algorithm works.
 
9:21 AM
@metatoaster So it’s more like just a happy conincidence that 40 brings it back?
 
so does 35, but note now the pattern shifts
c, 9, 6, 3
 
Where’s b2a_hex from?
 
but eventually somewhere the extra 1 bit is carried forward
from binascii import b2a_hex
 
@Ffisegydd Ideally, you have some service, or database something that just runs the queries, so you test that against your test database.
 
@poke Yeah, my response was basically "D=".
 
9:25 AM
@poke yeah that's the plan. I'll just wing it for now. Woo, javascript tests ;_;
 
@metatoaster It’s kind of sad how a factor of 50 has that one bit at the very end :(
 
mysteries of floating point numbers
 
for i in range(35, 70):
    print(i, b2a_hex(pack('>d', i * (10 / 100 + 1))))
The pattern of the last byte is interesting.
 
well, it's really the very last bit
>>> b2a_hex(pack('>d', (10 / 100 + 1)))
b'3ff199999999999a'
that's the original number and it had the extra 1 "carry" bit
 
yeah
 
9:34 AM
>>> unpack('>d', a2b_hex(b'3ff1999999999999'))[0] * 50
54.99999999999999
>>> unpack('>d', a2b_hex(b'3ff199999999999a'))[0] * 50
55.00000000000001

This is interesting, too
 
9:47 AM
stackoverflow.com/questions/33299245/… unclear – C# question, but so odd that I didn’t want you to miss it.
 
that is pretty odd.
 

« first day (1833 days earlier)      last day (3122 days later) »