« first day (1818 days earlier)      last day (3134 days later) » 

DSM
6:00 PM
MOAR FUNCTIONS, I guess.
 
@Kevin You always have the option to implement your own
 
Or I guess by "functions" I mean "a word followed by parenthesis"
So java's JsonParer(BufferedReader(IOReader(StringReader(ByteObjectFactoryBean("input.txt‌​"))))))))) qualifies even if they're all classes
 
nobody has ever complained about loads being limited
@Kevin cute
 
DSM
I've seen people complain about the fact not every object has an automatic round-tripping serialization into json, but that's different.
 
Of course I'm being uncharitable to the article. The author doesn't want to force everyone to replace loads with five function calls. He only wants it to be possible to do so, in case someone only wants to load json halfway for some reason.
 
DSM
6:04 PM
Strong YAGNI in that particular case, although it would be unfair to concentrate too much on the specifics if he's only using it as an example.
 
@Kevin yeah exactly
 
MOAR PYTHON
 
The TLDR I'm getting from the article is "why reinvent the wheel when it's already been implemented in the standard libs? Devs, please make these wheels accessible to me"
 
Mine: use classes in your design for different levels of abstraction, so we can replace different levels if we want
 
that's actually right. Many tiimes I ended up switching to classes after writing functions.
 
6:08 PM
Huh, didn't know GvR used to be active on SO.
 
user559633
Yeah, he only has 12k rep, which means he doesn't really know much about programming
6
 
noob
 
12k....peasant.
 
What does that say about you?
 
user559633
@Programmer why do you even have chat permissions
 
6:10 PM
I wouldn't hire that guy
 
DSM
He doesn't even have a gold badge in Python.
 
user559633
/me kicks dirt at you
 
My vintage dirt collection!
 
I'm sorry :[
 
user559633
i'm considering taking tomorrow as a sick day to work on an open source project instead of going to work. said open source project will be used every day at at $primary_employer. something about this scenario tickles part of my brain
 
6:14 PM
It's the part of your brain that still wants leverage come salary negotiation time
 
DSM
A while ago I got to tell a potential employer he was already using my code. :-)
 
user559633
@RobertGrant next month :) started offer farming at other companies/competitors last month
 
When I grow up I want to be able to do that
And also go back in time, because I'm probably older than you
 
user559633
"No promotion?!? I don't need to take this. I already have an offer to be a waitress at a Boise, Idaho truck stop Dennys!"
 
user559633
I'm 30 and started taking my career seriously ~2 years ago.
 
6:18 PM
I started too early but I am suffering with a full-time job and a full-time university
 
GvR's answer down-voted, what a blasphemy stackoverflow.com/a/12100439/770830
 
But at 60 I'll have some massive advantage over current me
 
user559633
I've been working full time and did a full time job while in university (both times), but I'd always just play around and not take anything seriously
 
@bereal lol what a noob
who is it?
 
no idea
 
6:21 PM
I'm probably about to get TTJ'd, but Guido van Rossum created Python.
 
Yeah I'm mostly still like that and I'm 33. Somehow managed to get paid very decently for it, and this next job should be a good opportunity, but my problem seems to be I always choose the short term slightly more responsibility, slightly less technically in-depth role these days, which doesn't bode well long term
 
@tristan the only option I see for me is starting my own project, as I am underpaid but it will most probably fail.
 
@Kevin created what?
 
All I want out of a job is to not wake up every morning and think "oh no it's today"
6
 
user559633
@khajvah Finish university, study hard and read about things that you might not think can be used immediately. Worry about your projects/career/money after.
 
DSM
6:22 PM
pre-meeting lunch rhubarb for all1
 
user559633
@Kevin I reached that point by always being willing to get fired and never taking a job I'd be afraid to lose.
 
I'm more afraid of the social stigma of unemployment than of actually being unemployed
 
@tristan I am afraid university years are the years I should start a project, seeing how many people are becoming JavaScript developers who hate their jobs after graduation.
 
user559633
Yeah, I quit my last job before this one without lining anything up. Everything worked out fine.
 
user559633
@khajvah Stop looking at what other people are doing.
 
user559633
6:25 PM
Enjoy university, learn some theory, and realize that you'll reach a point at a company in which you feel hugely underqualified.
 
I think it's mostly the influence of my parents, who probably assume I'll just watch Spongebob all day if I'm not working.
 
get out of my head tristan
:P
 
They'd prefer I have a less-than-ideal job if the alternative is that I abandon the scraps of respectability I've got now
 
@tristan did you do freelance stuff for a while?
 
user559633
@RobertGrant i'm still a contractor even though i'm at a full time job
 
6:28 PM
@Kevin yeah obviously (as we're the same) but I feel as though my ability to earn money legitimises my job in the eyes of my family
Probably not as much truth to that as there is to the idea that it legitimises it to me, but anyway.
 
user559633
You have a baby on the way -- you have to take things a bit more seriously
 
user559633
I either want to be able to retire or dead by 40
 
^^that's why I have a fear of being unemployed. Paying for a family keeps me in the constant pursuit of financial stability
 
Yeah. I may have to switch to buying lottery tickets
But seriously I'm totally happy providing for a family; much worse ways to spend a working life
 
@RobertGrant We can split the cost of lottery tickets in Canada...you don't get taxed for winning the lottery here.
 
6:30 PM
And maybe I'll get lucky and land/create a cool job on the way
 
user559633
I'm currently making a run at getting promoted, building leadership skills, and saving up money so that I can quit and just work on stuff that I want later in life.
 
@tristan I study math, which I feel like am not going to use in future but yeah, you are right, I should concentrate on stuff that interests me most
 
user559633
@khajvah I wish I retained and studied more math in school. You'll be thankful for your background when your projects get complex.
 
Yeah definitely keep the maths; I can't tell you how much I wish I had way more of it
 
oh wow
 
user559633
6:31 PM
You're in school -- this is the time that you can just learn and not have to waste your time on meetings and project management methodologies.
 
The guy who makes a polished web application for a final year project vs the guy who makes a basic (lower case) compiler - I'm picking the latter guy.
 
:+1:
 
nicely put
 
My senior design project was 90% math
 
Now hire me and pay me lots of money to say things like that
 
6:33 PM
trigonometry and alpha blending and point-in-polygon problems
 
user559633
In one of my side projects, ~50% of the code is trigonometry-based, 30% application logic, 20% integration with APIs.
 
I like numerical analysis. I might do my senior project on it
 
Granted, it was all math I learned in high school or could have learned in high school
 
user559633
It's a nightlife app. You'll probably find uses for math in the future as a developer (if that's the path you go)
 
I didn't realize I wanted to be a software dev until I graduated from university
in computer engineering....
 
6:35 PM
CBG
Was wondering if there is any way to split lists in into halves without using len :)

zip(d,d[len(d)/2:])
 
no
 
user559633
you could get the size of the items in the list if they're statically sized and then use that to calculate your slice
 
@tristan I knew I should have qualified that with "there's no way simpler than that"
 
user559633
@davidism ha ha this isn't even my final form
 
user559633
first, we must think, what is an atom
 
user559633
6:38 PM
i hate reddit so much
 
user559633
ugh slots are unpython PFFF why are they reinventing the wheel and turning into perl
 
Reddit is mostly 16 year olds, and this post is six years old, so those users are all ten. They're surprisingly articulate, considering.
 
user559633
reddit: hackernews for bigger idiots
 
I've been on r/cscareerquestions and I'm pretty sure it's 100% interns asking other interns about how to get internships
Real big on "cs" and "questions", not so much "career"
 
6:43 PM
cbg
 
user559633
cbg
 
@MartijnPieters Super annoying behavior. Especially without giving any feedback. Left a comment.
 
Don't sweat the small stuff.
 
user559633
small is a relative term
 
user559633
cnn.com/TECH/space/9909/30/mars.metric.02 don't sweat the small stuff
 
6:59 PM
Yeah, is that metric small or imperial small?
 
Why use Enums in Python? I'm looking for the use-case.
 
When you need to enumerate choices and compare them
 
There is this example too.
 
A nice thing about enums (conceptually) is the different types are a data type instead of being buried in code/documentation.
 
Enums make more sense in a statically typed environment, I agree.
 
7:17 PM
Ideally python enums would monkey wrench static typing in somehow. I'm not sure how they work though.
Like this is not a great error...
>>> import codecs
>>> codecs.encode('Hello World!', 'utf-9')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
LookupError: unknown encoding: utf-9
Ideally you'd have something like utf-9 not in codecs.codec_list so you can just dir codec_list.
And in my head an enum is a datastructure that enforces that stuff automagically and maybe brings some performance improvement.
 
Is there something like while(n--) in python .. which is like inline loop ... or any shorter version of coding

while n:
  a += "some_calculations"
  n -=1     #Can this be removed #for loops may cost me more chars
 
Yea a programmer could do that stuff manually, but then you have to have the presence of mind to worry about errors and who wants to do that?
 
enforce it how though? That you don’t pass 'utf-9'?
You don’t need enums for that, just a module that provides all those strings as named members
 
@VineetKumarDoshi
>>> for i in range(10, 0, -1):
...   print(i)
...
10
9
8
7
6
5
4
3
2
1
>>>
 
@VineetKumarDoshi If there is no additional logic that may affect n just do a for _ in range(n) loop
 
7:22 PM
I think he just wants least chars possible for one of those contest thingies
 
@Programmer correct
 
What is n? A number?
 
no, you can't do assignment in if/for/while expressions
 
Could you do something like a = sum(calc for _ in i)?
 
Take care though, sum refuses to work on strings
 
7:26 PM
@Kevin Good point.
 
So I guess it depends on how literally we're supposed to take "some calculations"
 
>>> exec('a+=1;'*n)
 
oh honey no
 
@QuestionC Oooo, nice.
For code golf? Why not?
 
Because those pyth jerks will beat us no matter what we do ;_;
 
7:28 PM
Yeah. :(
 
@MorganThrapp n is a number

@QuestionC i tried it .. they are same chars ... it look shorter :D
 
@VineetKumarDoshi How? I get 20 for the loop and 15 for the exec.
 
pyth and cjam are the Paralympic runners of the code golf world.
 
Well, fewer bytes anyway.
 
@MorganThrapp
exec(';'*n) = 11 chrs #spaces are not counted :)
whilen:n-=1 = chrs 11 :D
 
7:33 PM
Ok, and now I'm reviewing code with mock.patch all over the place...
 
@VineetKumarDoshi Oh, huh. I've never seen code golf where whitespace isn't counted.
 
@AaronHall is it on gh?
 
nope
 
I'm in a huge unittest craze these days...was curious to look at it :)
 
unit tests are more important than the actual code
 
7:36 PM
absolutely
it just makes life so much easier having well tested code.
 
yeah, easier and stress-free
 
naturally it means it takes you longer to come up with your final product you have confidence in. But you end up with a more refined product faster. If that makes any sense :)
 
of course it does. You can't possible control your project without unit tests. Any code that is meant to be maintained should be tested
plus they define the requirements of the application, which is great.
 
I really need to write tests for my current application. I just got sick of trying to figure out how to mock out my database.
 
Interesting. Interested in talking about it?
 
7:43 PM
@idjaw Sure. All of my code revolves around parsing out flat files and sticking them in an MSSQL instance. I briefly tried writing some tests, but I couldn't figure out how to mock the DB. Let me see if I still have my attempts.
 
@MorganThrapp Is the layer between the database code and business logic isolated?
 
@khajvah Not nearly enough, no.
 
@MorganThrapp then you have a huge problem
 
It mostly is, any function that deals with the database just deals with the database.
 
with the proper separation it ultimately can be trivial to mock out whatever talks to your database
 
7:46 PM
But I don't have a separate database class or anything, I just use a global pymssql.connection object.
 
whatever library you are using to communicate with you just need to ensure what the data looks like coming back and what data structure it expects
ah
refactoring is on the horizon friend
 
@MorganThrapp no, that won't work. You need to isolate the sql.
your objects shouldn't depend on the database you are using
 
@khajvah It's mostly isolated. All the functions that fetch things from the database just do that.
 
do you have this code available?
 
Um, I suppose there's nothing technically proprietary.
 
7:49 PM
@MorganThrapp here is an article about this stuff.
 
awesome thanks
 
Yeah, no problem. Thanks for taking a look.
 
so are you looking to mock calls to the db
 
I now have contributor permissions on the Flask and Flask-SQLAlchemy repositories. One step closer to world domination.
 
7:53 PM
or unit test the db portion
 
@idjaw Mock calls to the DB. The actual SQL is super simple.
 
@davidism that is awesome!
 
SELECT LOWER(COLUMN_NAME) as Name, DATA_TYPE as Type, CHARACTER_MAXIMUM_LENGTH as Length, COLLATION_NAME as Collation
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = %s AND COLUMNPROPERTY(object_id(TABLE_NAME), COLUMN_NAME, 'IsIdentity') = 0
ORDER BY COLUMN_NAME
 
I'm pretty amazed right now that it happened.
 
That's probably the most complex chunk of sql.
Congrats, Davidism!
 
7:54 PM
@davidism something I really hope you feel proud of. That is wonderful. congrats
 
Don't screw it up. :)
 
hahah
@AaronHall I just got flashbacks of my dad talking to me on my first day of University
 
Hello, I am new to numpy and I have some questions regarding processing moderately large text files. The input file has the structure of "date float float float", with occasional lines that aren't relevant. However, some of the lines are repeats. I want to clean this data.
In Java I used a hash map to map the array of floats by date and as I processed the file I would test if the date was already used (b/c the date will be unique with certainty). Any suggestions about how to approach this with Python and Numpy?
 
They probably reviewed all his "Nope"s on stackoverflow and figured he'd be perfect.
 
@MorganThrapp if we were to discuss in greater detail about your code...should we keep the conversation here? Or better to move it over somewhere else?
 
7:56 PM
@idjaw Might be better to take it to a private room, just to not clutter the room.
 
agreed
 
@poke Did you see the comments on the question? Since Ethan dupehammered the question he was pingable there, so I did.
 
@Martijn Yes, I replied there :P
 
@d0rmLife The Python equivalent of Java's HashMap is a dictionary.
So just use that.
 
Now I really can github issues!
 
7:57 PM
@davidism Hmm?
 
I can close issues on Flask and Flask-SQLAlchemy.
 
@Kevin Is this known as a structured array in Numpy?
 
@poke: I see the votes have been removed on both posts; I'll clean up those comments now.
 
Good, thanks
 
@d0rmLife, I don't know, I don't use numpy.
 
7:59 PM
@davidism Not sure what you’re saying. Did you get contributor access to the Flask repo?
 
@Kevin Lol, thanks anyways.
 
@poke yeah
 
Oh nice :)
 
@davidism can I ask you dumb Flask questions?
 
you probably can, just ask
 
8:00 PM
@idjaw I should have given that speech to some old high school friends who followed me to FSU - they kinda blew it by not going to class and flunking out.
@khajvah Don't ask to ask.
 
oh nice,. not yet though. I am gonna start using Flask in a few days, I will have some dumb questions.
 
For these kind of questions it doesn’t need davidism though to answer them ;)
 
yeah, there's some others here who can answer too
 
@d0rmLife Why do you want to use numpy stuff?
 
I want to learn flask so I can ask davidism dumb questions, too.
 
8:06 PM
@d0rmLife that name doesn't sound like it's a hashmap
 
And make websites or whatever. But that's a secondary concern.
 
I was expecting him to say "no, get out" but then I remembered this isn't the Lounge.
 
Nah, here in Python we'll at least listen to the question before deciding it's boring and we don't want to help.
 
@khajvah Because I will be searching the data for patterns and getting graphs similar instances so Numpy will be useful for those goals.
graphs of*
My current approach is to make a dictionary and then convert it to an Numpy array, which I'm sure is not the most elegant solution available. But hey, it should work.
 
Where do you get the data from?
 
8:14 PM
The text file is local to the system
 
Buh, stackoverflow careers is awesome
 
Starring that comment.
@corvid tell me what you like about it?
 
8:31 PM
The jobs in Cambridge offer crazy good benefits, and so many for front end software devs
 
Ok, then. Good to know.
 
Seeing our C# code for the first time actually made me a little angry.
Thousands of lines and literally not a single comment. It's like trying to find a tree in a salt flat.
 
no other documentation?
 
They gave their methods and variables vaguely meaningful names. That's their documentation.
Seriously, this is crap.
 
we don't have much documentation here either....but our unit tests are very well detailed and reading them tells you exactly how everything works.
and we have pretty comprehensive readme's on our gh
at the very least
 
8:43 PM
yeah, unit tests can document it pretty well
 
especially a well named test method
we actually have unittests to make sure you wrote docstrings for any new API call you are introducing
 
if I am splitting input (for line in document: line = line.split()...), what is a way to test if, say line[4] exists for a certain line?
 
len(line)
 
Duh. Thanks.
 
9:42 PM
@davidism congrats
 
10:36 PM
Does anyone know how to capture sound from the speakers, and output sound to a virtual microphone. I can only do the standard capture from microphone, send to speakers.
 
is there an AV.SE?
 
11:24 PM
what is that
 
Presumably an audio/visual stack exchange site
 
:)
That's not for programming its more for music editing etc
 
I'm not joking; it's 1:30am so I may be stupid
 
I'm not joking either, there's no python questions/answers there :)
 
11:42 PM
Someone just posted this on my FB newsfeed just now. I compared the URL's they are identical. @Kevin your gifs are going viral!111!11!
 
11:53 PM
@idjaw a better way to tell if it's his is by waiting 5 hours until the dots briefly jump to say Kevin, and then resume rotating.
 
challenge accepted.
 

« first day (1818 days earlier)      last day (3134 days later) »