« first day (1567 days earlier)      last day (3367 days later) » 

9:00 PM
@AdamSmith Darn those unreliable Multivacs. Should have used a Mac instead.
 
DSM
Always fun to write a document convincing people that you're not going to do the work you'd suggested you would because after looking at the data you've realized it's not possible.. but that they should pay you anyway.
 
user559633
That's why you build in a stage of the contract called "discovery"
 
That reminds me!
 
@DSM Is this one of those clients who tacks on the "simple" additional objectives of solving P=NP?
 
@AdamSmith Or the one who insist on parsing unspecified number of nested matching parenthesis by regular expression?
 
9:05 PM
Hail Zalgo
 
I actually don't understand the difference in difficulties between those two objectives... (unless by GIS they are referring to metadata and not the content of the visual pic itself)
 
"Whether they're in a national park" not "Whether they're taking a picture of a national park"
 
gotcha
 
@MyNameIsKhan I suspect it to basically be a check of GPS coordinates against a database.
 
awh... graduating GPA is 2.99 so close
 
9:12 PM
Demand a recount! If it's good enough for American politics, it's good enough for you.
 
DSM
@AdamSmith: well, it's a client who asked of us a certain kind of algorithm -- which we obligingly developed -- and now wants to use it in a very different application for which by happy accident it sort of works, some of the time. I've brought up multiple times that this off-label use isn't going to work.. ♫ I talk to the trees ♫ but they don't listen to me ♫
 
@DSM that's massively better than our software company, who tends to respond to feature requests with "Well, you could use feature XY, and it'll halfway work at most part of the time. We'll put it in our development backlog, so it'll make it into release in about 5 years."
Case and point: in the course of using one of their applications, several reports print automatically as the user fills in data.
 
DSM
What, like to a physical printer?
 
I know, right?
Anyhow
we found that the users wanted to review those reports on-screen, sometimes a week or so later.
So our software vendor gave us an application that was supposed to allow the user to look up a previous report
It does its job for about 1/3 of the reports that exist. The rest of them have been renamed sometime between now and when the application was developed for Windows 3.1
and the report names are hardcoded
Fixing that has been on their backlog for 3 years now.
 
My coworker mentioned today that you can submit your W-2 form to the IRS just by taking a picture of it with your phone. "It's amazing how far we've come", he said. And then there are apps that print hard copies of your reports as you submit them. The future is here, but not evenly distributed.
 
9:24 PM
@Kevin it's worse than that, actually. It prints two hard copies, one stays at the site and the other gets sent through intra-office mail to the corporate office
the corporate office ALSO receives the PDFs of those reports, so they can reprint them as needed
 
:-|
 
Learning about CSS, I don't see why people complain about it so much. Then again I'm just reading about it, not actually using it :P
 
I hate CSS because I can't figure out how to make two columns of content side by side, like in a newspaper.
 
It's annoying that it doesn't have features like variables
There's a new columns property for that Kevin
 
@Ffisegydd I always felt like CSS was pretty straightforward
 
I also can't figure out how to arrange eight images around a span containing arbitrary elements so that they make a seamless surrounding border line.
 
DSM
That makes it sound like one of those toothpick-rearrangement puzzles that I was never any good at.
 
I also can't figure out how to align a box element so that it lies a fixed X and Y pixels displaced from the position of its parent element.
 
user559633
@Kevin use tables :D
 
@tristan I tried, but I couldn't figure out how to get rid of the blank space between cells :-(
 
user559633
9:29 PM
if someone criticizes you, remind then that you're talking about HTML
 
even when setting border=0
 
border-spacing lol
 
user559633
border:0 padding:0 margin:0
 
Anyway, I don't expect anyone to solve these problems. I just want you guys to say "I feel your pain".
 
I feel your pain
 
9:29 PM
@Kevin Isn't that just position:relative? It's been a LONG time since I was doing any of this though.....
 
Thanks :-) But now I must be going.
 
user559633
LET ME SOLVE YOUR PROBLEMS
 
K guys I can't figure out how to loop through the lines in my file. Here's a gist of what's happening: gist.github.com/martin-wiseweb/dbbc20c90cc75c91774a
 
@AdamSmith Yeah, but it only works if the parent has absolute positioning. Or something.
 
@Kevin works with parent having position:relative too
 
user559633
9:31 PM
make a png of the thing you want :)
 
@Martin when you do num_lines = sum(1 for line in url_list) it exhausts the iterator
do url_list.seek(0) between there and your for loop
 
@AdamSmith Amazing thank you
As you can tell I'm a Python noob but I'm learning ;)
 
DSM
While you're at it, ` def ___init___(self)` has too many _s; you want two on each side ("dunderscores" = "double underscores").
 
@Martin as a recommendation, don't pass the file object, pass the path and have your method open the object with a context manager
 
oh wow I never figured out that's what "dunder" meant
 
9:33 PM
Okay, thanks for the tips guys
 
with open(path_to_url_list, 'r') as url_list:
    do_stuff()
 
Ok cool
 
unless you need that file object for something else outside the method call
 
Also, what is the normal variable naming convention in Python? Underscores or camel case?
 
DSM
While we're giving advice, why not go to one the wisest men who ever lived?
 
9:34 PM
Instead of str.replace(), you can use str.strip(); no arguments and it removes all whitespace from the start and end.
 
underscores
 
That includes newlines.
 
DSM
> As Confucius said, "If names be not correct, language is not in accordance with the truth of things. If language be not in accordance with the truth of things, affairs cannot be carried on to success."
 
Or you can use str.rstrip('\n') to remove just the newline from the end.
 
DSM
9:34 PM
IOW: it's a bad idea to call something url_list if it's not a Python list.
 
Thanks @MartijnPieters
Lol this is great I'm gonna have to write this all down
 
@DSM I like that you wrote "Why not go to one of the wisest men who ever lived" IMMEDIATELY before Martijn responded.
 
DSM
Heh
 
Nice, thanks
 
9:40 PM
I've got something that might be an SQLAlchemy how-to question but I suspect is actually an XY problem. Prototyping a sim/"spreadsheet game", save files would be databases defined in SQLAlchemy's declarative style.
I'd need to store some "metadata" in the save file -- data about the global state of the sim world, e.g., the current date. Would you approach this with some kind of singleton logic, whether in the definition of the model or maybe at the point in the application layer where the data access occurs, or some other solution entirely?
 
@davidism so I heard you made a burnination bot!
 
DSM
Spreadsheet game? Kids these days. I remember when we put pucks in nets and balls through hoops to have fun.
 
DSM
Wow.
 
big files everywhere
 
9:53 PM
The prediction data is interesting.
  "MinorOtherDeveloperKinds": {
   "DatabaseAdministration": 0.1,
   "Desktop": 0.3,
   "GraphicsProgramming": 0,
   "StatsOrMathBackground": 0.4,
   "SystemAdministration": 0.2
  },
Would not have called the StatsOrMathBackground rating there.
  "TechStacks": {
   "FullStackWebPython": 0.508851018132017,
no surpises there then.
Good idea with the SQL database, I hadn't thought of that — David542 3 mins ago
ORLY
 
DSM
@Martijn:I think their MinorOtherDeveloperKinds prior is pretty strong. Those are exactly the same values I get.
Plus the fact they don't have many digits attached makes me think they might not be being computed at all..
 
@DSM: same here
 
@DSM interesting.
The TagViews object is a little large to scan through for me.
 
DSM
Now it's my turn not to be surprised:
[('python', 36772), ('pandas', 6883), ('numpy', 5149), ('python-2.7', 3836), ('list', 3498), ('python-3.x', 3118), ('arrays', 2281), ('dictionary', 2077), ('string', 1586), ('csv', 1578)]
 
I am surprised:
[(u'python', 23182),
 (u'python-2.7', 2704),
 (u'python-3.x', 2616),
 (u'list', 1614),
 (u'dictionary', 1320),
 (u'string', 1026),
 (u'flask', 1021),
 (u'json', 872),
 (u'passport.js', 707),
 (u'beautifulsoup', 682),
 (u'unicode', 674),
 (u'python-requests', 640),
 (u'node.js', 626),
 (u'django', 564),
 (u'javascript', 556),
 (u'algorithm', 494),
 (u'html', 447),
 (u'python-internals', 445),
 (u'regex', 441),
 (u'java', 439),
 (u'csv', 427),
 (u'class', 397),
 (u'c++', 355),
 (u'for-loop', 354),
passport.js, node.js..
but I did do a huge retagging spree on those, I suppose.
java and c++ though? Perhaps the programming contest burnination?
 
DSM
10:01 PM
37 node.js and 0 passport.js for me, which seems about right. I think they might both be on my exclude list.
 
>>> len(pp['Data']['TagViews'])
3433
and a total of 81299 tag views (but the data already included that number, presumably for scaling).
No idea how those numbers stack against someone... less active.
anywho, time to knock off.
Rhubarb everyone!
@davidism: careful with the anglebrackets now, d"ja hear?
 
DSM
End-of-week rhubarb.
 
if anyone have some experience with django and angular. that may help me stackoverflow.com/questions/28245038/…
 
10:25 PM
if you have a better solution than the accepted solution on an old post ... should you post it? I think so ... right
0
A: How do you reverse the significant bits of an integer in python?

Joran Beasleylate but better late than never def flip_bits(n,n_bits=32): return int("1"*n_bits,2)&~n here are the timeit results from the various solutions on this page TIMEIT RESULT gribbler : 5.54813278434 TIMEIT RESULT joran : 0.0961343930868 TIMEIT RESULT dfan : 5.9509364783 TIMEIT RESULT justin p...

 
yes, why not.
 
yeah i dunno why I asked ... thinking about it and its obvious :P
 
knowledge does not hurt
oh, you beat them all
 
even the "fast" one ...
I was actually suprised by how much better my string thing worked
granted gribblers could be sped up by not using a generator expression, and using a LC instead
 
cbg everyone. Is pandas the best Python equivalent to R data frames?
 
10:39 PM
Guys, does the second function at wiki.python.org/moin/EscapingHtml make sense? I'm triyng to use it but it's not working
 
@Martin makes sense to me. Translate the symbol if it's in the list, otherwise show the symbol. What are you trying to use it on?
 
I put in Keurig® 2.0 K500 Brewing System and I get that right back
 
you might be looking for unicode.decode("htmlentities") ... or maybe thats a urllib func
 
What about cgi.escape?
 
Doesn't cgi.escape only do < > & ?
 
10:50 PM
Maybe, just thought I'd mention it just in case.
 
@Martin I can't replicate your error
 
@AdamSmith When you use it, it decodes your characters?
 
Yes
>>> escape_symbols('',"Keurig® 2.0 K500 Brewing System")
'Keurig&reg; 2.0 K500 Brewing System'
 
disregard ... its neither of what I thought
 
@AdamSmith That's so weird
 
10:54 PM
How are you running it?
 
@AdamSmith I'm using Sublime Text and I'm running it with ctrl+B
 
A standard windows terminal won't render ® so if that's where your output goes....
oh then IDK
 
Frustrating
Could it be a Python version thing?
I'm using 2.7
 
I ran mine in 3.4
sec
on 2.7:
>>> escape_symbols('',"Keurig® 2.0 K500 Brewing System")
'Keurig&reg; 2.0 K500 Brewing System'
 
Fuck
 
11:11 PM
can anyone with dual experience compare/contrast R data frames with the corresponding Python support, presumably Pandas?
Such a comparison would be OT on SE proper, I suppose.
Specifically, are there any clear advantages over using one rather than the other in a language-agnostic scenario?
 
11:23 PM
man Im tired that stupid bit solution wasnt the problem the OP was describing :P
 
I didn't get time to read it -- what was your answer solving?
 
R is a statistical analysis language ... if all you want is statistical analysis then its great python is more general purpose .... pandas and numpy give you alot of R's functionality and anything it is missing you can write yourself ... Ive used both ... they are simillar(R dataframe and pandas dataframe) but R is very different than python ... I would pick python pretty much everytime ... but I wouldnt call myself language agnostic
flipping the bits of a 32 bit integer .... not reversing ...
 
Oh so 0010 -> 1101 instead of 0010 -> 0100 ?
 
yeah but 32 bits so 2 0b10 => 0b111111111111111111111111111111101
or whatever big int that is
 
and he actually wants 0b01000.. ?
or just flip the significant bits?
 
11:30 PM
yeah he wants to reverse it
 
0b0...001
 
I thought he wanted to flip the bits ... just dumb ...
 
gotcha
 
11:47 PM
re-cbg
 
@JoranBeasley ok, thanks.
I prefer python over R, myself, certainly.
But R has a bunch of built-in stuff that is useful. Though it is a crappy and annoying language that is not fun to use.
 
@JoranBeasley RE: my answer: yeah but I had to draw the line at just how ridiculous I expect their data structure to be. Like you said: the correct approach is to fix the data structure, but if you have to monkey wrench it....
 

« first day (1567 days earlier)      last day (3367 days later) »