« first day (1550 days earlier)      last day (3413 days later) » 

2:00 PM
So, my pelican post got featured on the first page of HN, and I missed it :( This totally sucks XD
 
Sup @Games. Fixed your website for mobile yet? <3
 
@Ffisegydd Nope. I plan to today though :D
 
I'm also going to sort my website today/tonight.
 
But I don't want to touch CSS bro. Its so bad, so horribly bad XD
@Ffisegydd Yea, but it definitely works for mobile ;)
 
Oh, I almost used Pelican last year for something
 
2:12 PM
@ReutSharabani Your revisions you make to posts that are not deleted are part of your activity tab
So when I checked back on the account I saw that they were suspended and poked about as to what else they had been up to.
 
@GamesBrainiac, I also use Pelican+iPython notebook for my blog. Quite happy with the workflow.
 
@elyase Yea, that seems to be a pretty popular method.
I personally like rst more because its hackable.
 
I have a question guys, is life different when you get over 10k rep?
 
@elyase ask me in a week or two :P
 
@elyase Nope.
 
2:20 PM
Interesting form of plagiarism; I didn't even see that it was a copy at first: meta.stackoverflow.com/questions/283375/…
 
@ReutSharabani I just realised there's another option: rather than calling __repr__() from inside __str__(), you can just do __str__ = __repr__ after you define __repr__(). But I reckon letting the interpreter call __repr__() if it can't find a definition for __str__() is probably the simplest approach.
OTOH, that might be a tad slow if there's a big inheritance chain, since it has to check all parent classes before it decides that there's no __str__(). Maybe Martijn has some thoughts on this topic...
 
anyone have success running world of warcraft on linux mint?
 
rhubarb
 
I want to answer stackoverflow.com/q/27924439/3005188 but don't want to just gief the codez #FirstWorldSOPythonProblems
 
2:36 PM
> have you tried anything?
I don't know why that response made me laugh
 
"Yes, I tried to ask on SO."
Pah! tobias_k answered my answer (kinda) so best leave it.
 
cel
a very elegant one-liner :)
 
I like how a lot of languages have a generator for a basic project. Hopefully they get advanced enough to just do all my work for me
 
user559633
Did you see that guy's comment @Ffisegydd?
 
user559633
That guy is way too old to be so cringeworthy.
 
2:43 PM
@tristan I did, I flagged it. It was pretty shocking.
 
user559633
Yeah, I called him out on it, then removed my comment after it was removed.
 
The words "butthurt" should not be used be someone over the age of 30.
 
which comment?
 
user559633
@corvid he made some comment about people that were telling him not to be a time vampire that they were being "butthurt"
 
I'm surprised that preallocating a vector doesn't buy time.
    def nopre():
        a = []
        for i in range(0, 100):
            a.append(random.random())

    def yespre():
        a = [0.0] * (10000-1)
        for i in range(0, 100):
            a[i] = random.random()

    if __name__ == "__main__":
        import timeit
        import random
        print "Starting first benchmark"
        print(timeit.timeit("nopre()", setup = "from __main__ import nopre", number = 10000))
        print "Starting second benchmark"
        print(timeit.timeit("yespre()", setup = "from __main__ import yespre", number = 10000))
 
2:46 PM
probably new to SO
 
user559633
@corvid nope. just an embarrassing jerk.
 
using "butthurt" on a website like stack overflow seems pretty immature, even by my astoundingly low standards...
 
user559633
Agreed, 100%. Moving on :)
 
user559633
@RomanLuštrik why would expect nopre to be slower?
 
@Roman I suppose it depends on what is the slow part of the functions? Maybe generating random.random is the main part.
 
2:48 PM
steam level: 503 I... what?
 
It's my ignorance of how Python works. I was assuming it copies each element before appending a new one.
@Ffisegydd Random generation parts are suppose to be identical?
 
user559633
both have random.random, but the yespreallocates way more floats into an array than it ends up using, and then is doing a lookup for each insert of a random char instead of just throwing bytes onto the end of an array
 
Coming from R, everything is done by copying, so preallocating buys a lot of time.
Oh poop, I forgot to change the 10000-1 part.
 
Oh yeah derp >.<
 
Rule one of coding: If there's something strange, it's usually your fault.
 
user559633
2:51 PM
I thought rule one of coding was "don't say anything without your lawyer present"
 
After properly preallocating a, the results are
Starting first benchmark
0.247144029491
Starting second benchmark
0.158817552735
@tristan We're scientists, there's no stupid questions. :)
 
user559633
I'm a scientist like...third or fourth.
 
Oh I'm dying to hear what 0, 1 and 2 are.
 
user559633
I'm actually pretty surprised the second one is quicker for you now. run dis.dis and profile on it? i'd expect it to be slower
 
>>> dis.dis(nopre)
  2           0 BUILD_LIST               0
              3 STORE_FAST               0 (a)

  3           6 SETUP_LOOP              42 (to 51)
              9 LOAD_GLOBAL              0 (range)
             12 LOAD_CONST               1 (0)
             15 LOAD_CONST               2 (100)
             18 CALL_FUNCTION            2
             21 GET_ITER
        >>   22 FOR_ITER                25 (to 50)
             25 STORE_FAST               1 (i)

  4          28 LOAD_FAST                0 (a)
 
2:58 PM
i'm curious if random.random performs in identical time each loop... i'm expecting not but...
 
@PaoloCasciello Let's see.
 
SCIENCE!
 
I've rewritten both functions so that the value from random.random() is stored in a separate variable. The lines that correspond to generating the variable are:
 
@PM2Ring thanks
 
3:01 PM
4          28 LOAD_GLOBAL              1 (random)
             31 LOAD_ATTR                1 (random)
             34 CALL_FUNCTION            0
             37 STORE_FAST               2 (ri)

4          35 LOAD_GLOBAL              1 (random)
             38 LOAD_ATTR                1 (random)
             41 CALL_FUNCTION            0
             44 STORE_FAST               2 (ri)
 
user559633
and is anything else running when you're timing it?
 
user559633
Am i reading it correctly that a.append(random.random()) is requiring 2 function calls? otherwise, the only real difference is STORE_SUBSCR v POP_TOP
 
user559633
(store_subscr is the assignment to the dict)
 
user559633
appending to an array should be O(1) and i don't see anything that would require shifting elements in the array
 
user559633
3:07 PM
and either i don't know the instruction or i don't see the array being resized (which i would expect to affect your timing)
 
Instead of using listobject.append() in a loop, you can use a list comprehension here:
[random.random() for _ in range(100)]
It'll be marginally faster as no list.append method lookups have to be executed each loop iteration.
@tristan Yes, you need to look up the random attribute from the random object (so function on module).
 
"But man, you guys swooped down on this question like a pack of hungry vultures." Heh.
 
If you used from random import random you'd have a reference to the function directly.
@RomanLuštrik: Python is highly dynamic so the interpreter cannot make assumptions and optimise.
Pre-allocating doesn't buy you anything, you are just giving the interpreter more work.
List objects are just long dynamic arrays of pointers.
So the preallocation has to create a huge array with references to the 0.0 float (which will be a constant in your function, as it is specified as a literal).
Next, it doesn't matter if you replace the random.random() call in the loop with using a constant that you determined once per test.
 
Interesting. I'll look into this a bit later. I gotta run home.
 
You only altered the constant cost of the loop.
 
3:30 PM
@Ffisegydd Mobile is weird. At one point, it looks fine, on my tablet, but it looks horrible on phone.
 
This is why Bootstrap is popular I guess. Makes it easy to just get something vaguely working.
 
DSM
Vaguely-working cabbage for all!
 
@MartijnPieters Actually, the function with the pre-allocated list was faster in this case. But the list-comp version was faster still.
@RomanLuštrik This probably happens because of the way that lists grow in size in Python. I'm not sure of the details completely, but it's something like this:
A list starts off with room for 4 items allocated, even though they're unfilled. Once they fill up, the list doubles in size; so it now has 4 items in it, but room for 8 items total. Once the list fills up, it doubles in size; so now it has 8 items in it, but room for 16 items.
Probably the reason that the preallocated version is faster is that the list doesn't have to grow in size more than once, so no memory is getting moved around.
It's still not that much faster, though.
 
4:17 PM
Afternoon folks
 
Sup brah.
 
cbg @Intrepid
 
yo
 
I had a creepy text
"I'm outside"
Nothing else. Unknown number
They haven't responded. I'm going to 3D print myself a baseball cricket bat
 
hello @raxacoricofallapatorius
 
4:21 PM
@davidism Thanks. So the real question is what the future is likely to look like. It sounds like your package is quite active.
 
user559633
You can press up to edit text in chat.
 
I really don't want to bash Flask-Migrate, because it does what it sets out to do, which is wrap Alembic for Flask-SQLAlchemy, and the author actively responds to requests.
I made Flask-Alembic because I needed to get at the internals more, rather than just call the commands. There's also "better" support for newer features such as branched migrations and Click commands.
Flask-Alembic is used for this chat room's website, and I also use it at work.
 
Both look great, so perhaps the way to phrase the question is, To what extent will you be using it going forward (if you know). (Click — new to me — also looks relevant.)
Thanks; I'll try both and see what works for me.
 
mmap ftw.
 
I'll keep supporting it for the foreseeable future.
 
4:28 PM
And: why are our chat icons blurry? Other folks seem mohave sharp ones (I'm on a Retina machine).
 
They're only 32x32 (I think?). If you have a simple image then it'll look clear.
 
Purple cabbage (only want to see you bathing in it?)
 
whoosh
 
R Greivance #5. You can have keyword arguments BEFORE positional arguments, meaning sd(rm.na=FALSE, d) is perfectly fine.
 
Can anyone say if the following is bad
def __init__(self, _id, **kw):
    vars(self).update(kw)
 
4:34 PM
@davidism Purple rain? No?
 
never heard of it
 
I've officially given up on mobile.
 
Boo!
 
You know, mobile browsers put a bunch of work into being able to reflow "normal" websites, before the whole mobile site craze came around. It works pretty well if you don't go crazy on the design.
 
This is the wierd thing @davidism. Two paragraph sections have the exact same style
But, one looks bigger than the other in vertical mode.
 
4:38 PM
what is the benefit to NoSQL vs SQL databases on web applications?
 
@davidism I'm not sure if that means you live under a rock or I'm officially too old at 30
 
It looks fine in horizontal mode.
 
@corvid there is no benefit, stay away
 
user559633
@corvid one is not sql and the other is sql?
 
@corvid NoSQL is hip and trendy and brings your application into the 24th and a half century
 
4:39 PM
just use relational databases and be happy
 
@corvid Take @davidism 's advice.
 
user559633
f u grandpa does kickflip over ur head
 
and if you switch to postgresql you get the JSONB type, which makes nosql irrelevant
 
@corvid listen to Games.
 
4:39 PM
@corvid NoSQL is Web Scale.
 
argh, zero was too fast
 
user559633
i've used mongo as a denormalized copy of my sql data for reads and i was happy with it
 
I'm using node.js, it seems MongoDB is the "default"... can I use an ORM and a SQL db if I felt like it?
 
I knew it would come. This is the thing that breaks our community apart. I want to tell you that I love you all, and will miss you dearly.
 
argh, zero was too fast on the edit too
@corvid don't use node.js, it's crap
^ opinions facts
 
4:41 PM
what's wrong with it?
 
I don't want to get into it, but have fun!
 
That video is actually making me lol in the office.
 
There are articles out there describing how it basically reinvents the wheel to no benefit versus just being competent in deploying any other framework.
But node.js is WEB SCALE, so there's that.
 
"If there's a problem writing your data, you're f**ked! Does that sound like a good design to you?"
 
Is that video narrating an actual conversation thread?
 
user559633
 
yep, that's the other one
 
"Shards are the secret ingredient in the web scale sauce."
 
@AirThomas not any particular conversation, but it goes that way all the time
 
You know, the other side of this is the one where we've been using Oracle for 20 years
 
user559633
what's for lunch, guys? thinking salad
 
4:44 PM
Because management likes paying for Oracle
 
I'm just kinda curious as to why it's so popular, want to see what it's all about
 
I've actually had to step outside the office because that video was making me laugh too much.
 
@corvid It's popular because of a combination of trend/hype and ease of use
The thing is, it's also easier to get in and out of a car that doesn't have seatbelts
or doors
If you want to go 85 on the highway in a golf cart, that's your business
 
user559633
@corvid mongodb is popular because it's easy to get started, but you have to do your own stuff like upserts and architecting for distributed databases. nodejs is trendy because it's javascript and people don't understand what they're talking about when they scream async
 
seems like most web application frameworks nowadays are easy to use... the technology seems fairly mature for web apps
 
user559633
4:47 PM
what do you mean?
 
What constitutes "mature" web technology depends in large part on how people use the web, and that's mutable.
 
@tristan Most are just "here are a few database models, and a few routes that return json" in the most basic web apps
 
user559633
What are "Most"
 
user559633
There are literally thousands of "frameworks" in dozens of languages, with different benefits and levels of maturity
 
@corvid yes, basically any program ever can be boiled down to "data" and "accessing it"
 
user559633
4:50 PM
You can write a nginx plugin that does that
 
That video had a point. Mongo DB really is web scale.
 
"Web scale" sounds like a skin disease
 
Hahaha
 
I'd like to officially integrate "web scale" into the Official SOPython Jokes List, along side "do the needful", "Kevin is a star-fiend", and "Martijn is an AI robot sent back in time to answer all of SO's questions"
 
basically, the main thing edging towards node is just that it's in JavaScript and so is the front end, isn't that a pretty good benefit?
 
4:53 PM
My eyes are watering because I'm trying not to laugh. If people in my office look at me right now they'll think something tragic just happened.
 
If you want some empirical evidence of why MongoDB is not all that and a bag of chips, consider the examples they give of prominent web sites built with their product.
 
"All of a sudden our team was crawling with Bohemian Ruby hipsters with Macintosh laptops and hemp satchels"
 
user559633
I love crapping on MongoDB, but nosql can be useful for figuring out what kind of data you have before trying to write good models. (and brb food time)
 
There's one website they're missing there though! They're missing...Project Nidaba...
 
The few times I actually tried to use it, I ended up writing validation anyway, since your data has to be somewhat structured in almost all cases. Maybe I was just doing it wrong.
 
4:56 PM
Rapid prototyping seems like a good NoSQL use case.
 
@AirThomas city of chicago... call me a rampant republican but whenever I see the government used it that makes me think it's terrible
 
@corvid Government is huge, government uses everything. You rampant republican, you.
I work for government. We use Oracle, MySQL and PostgreSQL that I know of.
We also use Python. :)
 
and Java?
 
@AirThomas where at? My company does contracting for defense.
 
State of California.
 
4:59 PM
The project I designed is all Python and PostgreSQL, it's a huge framework for tying different "security" reporting tools together. I only got away with it because I was the only developer contracted to the task for a year, and they had no design documents.
 
Here in beautiful Sacramento, we employ all the best tech sector talent that Silicon Valley won't
 
@davidism what's wrong with using python for that? Would they have preferred something different?
Off-topic: is it common for companies to allow dogs in the office? Every place I've interviewed at had dogs in the office. IT WAS AWESOME.
 
Yes, they would have preferred Java because it is "enterprise". But I never would have gotten this much done if I tried to do that.
 
DSM
"enterprise"
 
@corvid Assuming @davidism works for a sizable organization, any sizable organization likes sticking with a set of familiar tools. They also tend to feel safer with licensed proprietary tools, lets them feel like they have someone to point the finger at in case of liability
 
5:02 PM
whoa, every day learning something new, now I learned about gyrobus
 
Rarely saw a post so worthy of my 'not a debugging service' pro-forma comment.
 
@MartijnPieters link or it didnt happen
 
@AnttiHaapala I'm disappointed that is not a food truck that sells gyros
 
I work for a small 30 developer, 3 administrative person company. The contract I'm on is for SPAWAR and the DoD though.
 
-7
Q: plz help. not sure what to do cuz i suck at coding

isuckatcodingdef gnum(prompt): while 1: try: rv= int(input(prompt+": ")) break except: print ("eh?") return rv first= gnum("First integer") second= gnum("Second integer") print () print ("Sum is "+str(first+second))

 
5:03 PM
@AirThomas oh yeah... I used to work for a defense contractor. Didn't care for that detail of it
 
@AirThomas rapid prototyping not so much use case for mongo anymore
 
because if something new, it's at least inherently interesting by nature
 
postgresql 9.4 runs circles with jsonb around mongodb on any day...
 
What about redis? What's redis' deal?
 
with sqlalchemy, we can access json schema data just as if it were your ordinary columns too
 
5:06 PM
redis isn't a database, it's a key:value store
 
it is a caching system as I see it
 
I mostly see it used for caching and message passing
but then again, that's reinventing the wheel too, as there's already memcached
 
the key on wikipedia is "optional durability"
 
Depends on how restrictive your definition of "database"
 
and zeromq/rabbitmq for messaging
 
5:07 PM
"my database is optionally durable"
 
does anybody know how to add a column to pandas dataframe
 
Too broad / requesting a recommendation, take your pick.
 
starting from 0
 
by what metrics are databases and web frameworks reliably measured? For web frameworks, I tend to only see json responses/second
 
5:07 PM
ending at the length of the dataframe
 
@MartijnPieters Wow, that was fast
@corvid You mean performance metrics?
 
I honestly don't care that framework X is 5x faster than Flask, I'm nowhere near the scale where that matters
and probably never will be
 
@DataTx df['column_name'] = range(len(df))
 
@AirThomas I guess I just kind of want to know what the major benefits of each framework are. Like Flask might be easy to handle routing, for example.
 
GOOOOOOOOOONG
 
5:10 PM
the benefits are usually the ecosystem (updates, support, extensions, discussion)
the problem become when the ecosystem is overcrowded by clueless people, like php or java "enterprise"
 
Never mind, that was silly. You just need to ask people who have used more than one, and find enough such people to get coverage of the field
 
pyramid, the major benefit is that it was built not by aliens but gods themselves.
 
Bah - unit testing. It always takes me a wee while to get into the "groove" of writing tests at he right level
 
@AnttiHaapala Goa'uld?
 
why is PHP very popular? I can see why java might have a pretty good sized audience but PHP seems a bit... meh...
 
5:13 PM
@davidism goauld were aliens
@davidism these are the local deities
:(
 
cbg
 
PHP is very widespread because it is easily coupled with stupidity, which in turn is quite abundant.
 
laid over at SFO after my connecting flight was rerouted due to weather. What can I do in a 2hr layover?
 
DSM
Read a medium-sized novella.
 
@AdamSmith drink free beer in a lounge.
 
5:16 PM
The edit made that much more attractive, @AnttiHaapala
:)
 
PHP is great because when you want to do the thing, you have great functions available such as do_the_thing() and thingDo() and iDoGlobal(thing) and someday, one of them will behave predictably and we'll just deprecate the rest
 
hmm it does not quite work like that...
eventually they decide that it is a bad thing to pollute the namespace
so they do "do_the_thing(thing, 'thingDo')" and "do_the_thing(thing, 'iDoGlobal')"
though as half the time, they are boolean parameters, as php does not have keyword arguments, so
 
I'll just wait until there is a ZhuLi library that will do the thing for me
 
Suddenly regretting not setting my laptop's development environment up
 
the prototype is do_the_thing(thing, do_thingDo=FALSE, do_iDoGlobal=FALSE) and the documentation specifies that only one of the latter flags may be true at a given time.
 
DSM
5:20 PM
Almost everyone in my firm just went to an important presentation, and everyone else went to lunch. I am now lord of the office.
 
@AdamSmith free beer waits...
 
My boss just sat down next to me saying she ALLLLMOST went to get a shot of Fireball while we waited
 
user2555451
@DSM - It sounds more like they abandoned you. :P
 
oh changing gates and moved up to leaving asap
 
Ugh. Fireball is atrocious.
 
5:21 PM
rbrb
 
DSM
So much for layovers..
 
My boss has to attend jury selection this morning. We have a section meeting. He said we should just run it without him but I don't think anyone really wants to...
Downtime is lame.
 
user2555451
stackoverflow.com/q/27927743/2555451 - This is basically asking "What is the terribly insecure and inelegant Lua equivalent of this terribly insecure and inelegant Python code?"
 
DSM
Wow.
 
hmm? how is that python code even supposed to work :D
TCC :d
 
5:28 PM
@AnttiHaapala It is illustrating how it'd generate the Lua syntax, is my guess.
 
my favourite scripting language
 
guys I have too many animals :|
 
I'll take a cat.
 
so, anyone done this? I have made a program for which you can write a program in python, which gets compiled into C source code which is then loaded into a C program using TCC for filtering the big data.
anyone else would probably write their own DSL (and they have) but nah, python it is.
 
@Ffisegydd no cats. Got goats, horses, and tons of dogs
 
5:30 PM
Did you say big data? Sounds like an enterprise web scale venture to me... How can I invest?
 
@AirThomas I wouldnt
 
@corvid You have goats??? I'LL TAKE ONE
 
goats are cool. Goats will eat anything
 
As long as they're not La Manchas
 
but if you have an extra useless million on your bank account, then by all means lets do business :d
 
5:31 PM
gotta keep an eye out for Chupacabras
 
It is among my primary life goals to build a goat tower
 
build it, and they will come. Your yard will be overflowing with goats
 
DSM
"Goat tower" isn't a thing I expected to learn about today.
 
Yesterday aerosol flow dynamics, today goat towers. Tomorrow TBD.
 
and gyrobusses
 
@Ffisegydd thank you!
 
@raxacoricofallapatorius I'm pushing a new version right now. Please report future problems here or on the bug tracker, as the comments of that answer aren't really the appropriate place.
It's up. Py2 is sort of secondary for me, I should really set up tox to test compatibility.
@raxacoricofallapatorius I also moved my comments into my post, so we can delete the comments now.
 
6:13 PM
@davidism Thanks. That was fast! I've got another: ImportError: No module named cli in flask_alembic/cli/click.py, line 11, when calling from flask_alembic.cli.click import cli as alembic_cli.
 
don't use click if you're not using the latest flask development version
it's not available in older flask versions, you need to use the Flask-Script extension instead
 
@davidism Ah, missed that. For the future then, right?
 
yeah
 
6:33 PM
Goats are web scale.
 
Hahaha, just googled "magical date" to see whether it was a term with a recognised meaning (in order to maybe improve a badly-worded question), and got an unexpected dose of Japanese culture.
 
6:59 PM
Sorting wit Flask-SQLAlchemy pagination too broad, or maybe asking for library
 
good morning @ZeroPiraeus!
cbg all!
 
@davidism I think there is a pretty easy solution to that one
 
cbg @inspectorG4dget :-)
 
7:37 PM
I refuse to CV the "correct way to use forms"
the question was about forms, and obviously there is 1 correct way to use forms: use forms / get post data, and that is what the OP is not doing
 
Forget it...
 
I cant forget it since I didnt see it!
request denied
 
Yeah that is broad, sort-of resource request, not very clear
 
user559633
7:55 PM
suggestions for new coffee mug?
 
@vaultah: so a Google recruiter wants to talk to you. Sure, you can classify it as spam, but the recruiter isn't bulk-mailing and many developers do want to hear from that specific company.
 
@tristan how about this one?
 
user559633
@inspectorG4dget classic
 

« first day (1550 days earlier)      last day (3413 days later) »