« first day (2043 days earlier)      last day (2906 days later) » 

12:06 AM
hey guys. morning
i got a problem. does anyone know why I cant connect to my postgresql database. I'm using docker containers to connect.
library is psycopg2
 
lol I have been fighting with my database all day... welcome to the club
 
lol.. I find that my problem is not the database. rather the python library itself
able to connect. but not able to execute commands
what problem you having
 
I can make a connection to make a new table in an existing db but everything else is all sorts of crazy
 
12:25 AM
what library you are using.
postgresql for db?
 
MySQLdb I am trying with flask
 
ah i see.
never tried that before.
have you used postgresql in docker? or mysql in docker?
 
heyo
 
12:41 AM
sorry dogs
I have all my own server so what ever I want, was just think about saving the code and popping a nuke on the os and just starting over with a fresh pallet
 
no problem. thats good too.
 
I don't know I was using rails for awhile but didn't like all the you can't do thats about it so I was trying this on for size... hmmm oh well sooner or later. The templated pages and everything else work great... just trying to get the db stuff down. So frustrating when I just pop open a terminal and try the SQL in and works fine then trying to get database interface to work with same sql ... different story.
 
1:30 AM
boom goes the dinomite 10 hours later lol
 
2:24 AM
Ive used postgres in docker ... its pretty straight forward ... but you typically run it in its own container with ports exposed
at least thats what Ive found ... if i installed it inside a docker image (ubuntu14.2 for example) it would never start so I just used docker-compose and the postgres image with the port exposed
@ming
 
2:57 AM
I haven't used docker yet maybe that would help my cause
 
 
1 hour later…
4:20 AM
@JoranBeasley yeah. i just realised my mistake. i forgot to put the command conn.commit()
its very different from the postgresql docs. Theirs assumes data is available even before conn.commit() so got confused there. probably it isnt on a docker environment.
 
 
2 hours later…
 
1 hour later…
7:24 AM
hey guys. anyone know what is pip -m
 
@Ming there is no such switch on the top-level pip command. Is that part of a specific sub command? Have you tried pip <subcommand> --help?
 
sry. it was a typo. code was python -m pip install
 
@Ming -m loads a module as a main script.
So python -m pip loads the pip module from the Python module search path, then runs that as if it is a script. A if __name__ == '__main__': test would pass.
 
@MartijnPieters actually whats the purpose of that? I dont fully get it. the command was
`python -m pip install pymongo`
 
Using that means you don't have to have the script installed in your path for the module to work.
The pip module uses that to detect that you want to use the module as a script behaves exactly as if you ran the pip script (which would also load the pip module).
 
7:34 AM
i just did pip install pymongo and it worked fine
is pip similar to npm? it doesn't seem to have that separation of modules at directory level like npm
 
Sure, if pip install pymongo works for you, then use that.
python -m pip works too.
The advantage of -m pip is that a) you can choose what specific Python binary to install for and b) it works for more people (only the python command has to be on the path).
 
@MartijnPieters ah i see. ok. thanks for the advise :)
@MartijnPieters i see you are a very established programmer. Just wanted to ask your advise. I'm trying to transition into programming but I'm not from a programming background. How long would it take for me to be employable. I'm looking to get into data science.
if i commit 80hrs a week
and focus on python / js.
 
Data Science is the new black.
 
7:58 AM
Cabbage
 
@Ming if you have the passion and understanding, very quickly perhaps.
Keep doing what you are doing. There is no fixed timeline, but passion counts for a lot.
 
@MartijnPieters but what is the core stuff that i have to learn and that companies lookout for. since i have to focus.
 
20 years ago I bluffed my way from college to a part-time job as web developer by having built 1 webpage and read one photoshop book. I did grow up with a computer on which I hacked before that though.
I don't know what core stuff to focus on for data science, sorry.
 
@Ming how old are you? What stage in your school/university/career are you?
 
as a general programmer? should people focus more on learning libraries very well, or learning the actual language very well. if you had to choose either.
im 25
this year
 
8:04 AM
So you're out of uni?
 
yeah
 
Are you a software developer?
 
no. came from finance background
 
For my line (general software engineering) I found basic CS algorithms a lot of help. So this kind of stuff: ocw.mit.edu/courses/electrical-engineering-and-computer-science/…
 
I think we've discussed Data Science before IIRC.
 
8:06 AM
In the meantime, keep hacking on stuff. Read Stack Overflow answers on questions that interest you. Try to solve the questions yourself and see what answers were posted after.
 
ah i see.
 
Most of all, code, code, code.
 
haha. ok. yeah. hear that alot.
 
Not to disagree with my esteemed colleague (:P), but if you're looking to go into Data Science then you need more than just coding. You need to have a firm grounding in mathematics and statistics.
You also need to have some experience in data visualisation. Not just the coding of visualisations, but also the design of them.
You also need to be able to write and present reports/presentations (similar to the designing data vis part).
In fact the more general thing would be: you need to be able to present and report on your data in whatever format is most appropriate for that scenario.
 
@Ffisegydd yeah. agree to on that. but i find now, the programming part is the hardest. because data science involves not just the programming, but the database, grabbing data, streaming data, storing data, then only analysing data with scipy etc...
 
8:10 AM
It's also helpful if you can work with clients/customers in a more consultant role sometimes, being able to talk to them confidently to better understand their real problems (which might well be very different to what they say the problem is).
 
so much stuff. dont know if thats possible. plus all the stuff u just mentioned.
 
You really should not abandon the rest just to focus solely on coding though.
 
Yeah, listen to my esteemed colleague Fizzy there, he's an actual data scientist.
 
You need a wide breadth of skills. And importantly you need the ability to get going on things that you don't know too much about. To do that requires a strong base, but not necessarily too much in-depth knowledge on a particular subject (at the start of your career anyway).
 
This is me and data science:
 
8:11 AM
haha
 
This is Fizzy:
 
@Ffisegydd so what do you feel are the most important skills (techincal wise) for starting in data science?
 
I'd say the most important thing is the ability to pick up new skills/libraries/etc quickly on the fly.
Which sounds a bit wishy washy.
For example, I recently had to do a lot of work using Apache Avro. I'd never used it before. Had no idea what to do, what it was, how it worked. So I learned.
 
Yeah, I agree on that. Never stop learning, accept that the field is constantly changing.
 
8:14 AM
@Ffisegydd i can get that point. so to be able to pickup skills quickly, what to do that.
 
To be able to just pick things up quickly like that, you need a really, really strong base foundation.
 
base foundation in ?
 
Everything.
:P
It depends on what you need to learn quickly though.
Say you need to learn a programming system quickly, a foundation in programming will obviously help. If you need to learn a mathematical theory quickly, then a foundation in maths will help.
 
when you say base foundation, meaning the fundamentals? I'm guessing
1) The language itself?
2) Database?
3) Linux??
 
I realise what I'm saying sounds silly and obvious, but you'd be surprised how many people don't understand it.
 
8:16 AM
databases have fundamental principles.
So do programming languages.
And operating systems.
 
got it.
what things should a person not focus on.
 
A lot of people, I've found, will instead try to focus on specific things (and typically it's the things that they find cool/the most interesting).
 
if they are focusing on the fundamentals
 
For example, "I'm going to learn the most in-depth things I can about machine learning". Great. Good for you. You can make a fantastic ML model. Now sit down next to these engineers and make a usable system out of it. Wait, what? You don't understand what git is? You don't know how to work with other programmers and build a system? Your code isn't documented because you don't understand the basics of best practices? Then your ML model is useless.
That's a bit of an extreme example, I admit.
Chances are the engineers could take your code and implement it for you in a usable production system. But it would make you very unpopular and not help your career if others are having to do the actual work to make your work usable.
 
is there such a thing biz dev analysts with programming skills?
 
8:21 AM
Yes.
 
means a mix of programmer + business analyst/dev
 
Yes, it's called a data scientist.
If you're making beautiful ML models that have no business value, then you're wasting time and money.
 
hmm true.
so your advise is learn all the fundamentals?
and be able to learn quickly.
 
Yes, absolutely. At this stage in your career it will stand you in better stead than anything else.
It'll make you versatile, mean that you can work on different projects and learn new skills.
And as time goes on, you can get more advanced knowledge in what you want.
And as Martijn said earlier, always be learning.
If you're on a project and you're not learning anything new, you should be looking to change. Either change within the project onto something new, or look to change projects (if you can, within business needs, etc)
You should also be reading about technologies in your spare time and doing research. You don't need to be reading academic papers, but keep up to date with blog posts on the latest emerging technology.
 
ok. so companies will assume that the programmer will be doing some learning on the job?
or do they expect the coder to come in and be productive day 1
 
8:26 AM
If they're a good company, you should be able to do both I think.
Especially if they understand you're still pretty junior.
 
got it. thanks for the advices. appreciate it. @Ffisegydd @MartijnPieters
@Ffisegydd as juniors, are they expected to know things like concurrency, load balancing and decorators. example with python.
or metaprogramming.
just trying to figure out how much i have ahead.
 
Maybe? Maybe not. It depends on the place.
I couldn't write a concurrent application right now.
But give me a few days to play about and learn I'd be able to give it a good crack.
Not saying it'd be perfect, but I'd be able to get started.
 
I'd not expect juniors to know about metaprogramming. Knowing about the basics of concurrency, load balancing, yes. Working in Python not knowing about decorators would be slightly disappointing, since there are a lot of decorators in the standard library that I'd expect you to be able to use.
 
Yeah. But it goes back to my original point, I might not be able to write a concurrent app right now, but I know a bit about it, I know what it is, I could name some of the issues that might come up.
 
@Ffisegydd i see. ok thanks. at least know the basics so if needed can learn up on it quickly if i get you correctly.
@MartijnPieters ah thanks. wanted to get a clear picture of my python level.
 
8:41 AM
If you do get to be a data scientist, we have a few positions open: facebook.com/careers/teams/data
You'll be able to see a bit of our office here in about 18 minutes: facebook.com/jamieoliver
He's about to go live from the 338 office (where we ate, @Ffisegydd)
 
@MartijnPieters i also hope too. haha. thanks. will check it out... (when im ready) :)
 
Ah cool, I might see if I can get it up at work.
 
9:06 AM
Morning peeps
> If you're making beautiful ML models that have no business value, then you're wasting time and money.
Or you're an academic
The Venn diagram of which may have a rather large overlap :)
 
I was going to reply along the same lines until I read your last line.
 
9:53 AM
cabbage
@JRichardSnape does ML stand for machine learning there?
 
Yes
He was quoting me from earlier, but like a bad academic he failed to cite.
 
lol:D
found it, thanks
 
10:39 AM
Like the slapdash academic I aspire to be :)
I should have prefaced it with "It is generally accepted that..."
a.k.a. <I couldn't be bothered to find the reference for...>
 
Heh.
 
friday cbg
 
10:55 AM
Hi there
Could someone have a look at this question?
it is about "Unpickling object after changing module directory"
 
today at this office: RFT hell.
I want to program buhuhuhu
instead I've been doing one documents for one tender, and at the same time been consulting an official in how to make a good RFT and sorting out responses to ITT.
%-)
 
@AnttiHaapala: what is RFT?
 
I'm assuming Request for Tender?
 
I have an extremely noob question (I'm new to Python):
class keys:
left=False
right=False
def goRight(e):
right=true

But for some reason calling keys.goRight() doesn't work, why?
(The indentation is correct, but was not pasted)
 
Also, hi @Peque, not sure I've seen you here before so welcome. Posting recent questions is against the room rules here - see sopython.com/chatroom for why and a few other rules of the road.
 
11:04 AM
@JRichardSnape: oh, I am sorry, thanks for the link
 
No problem
 
@Peque @JRichardSnape yes
 
@ShaharNacht: mabe you should have a look at this
specially part 9.3
 
You have my great sympathy, Antti.
 
Thanks! I will!
 
11:08 AM
@ShaharNacht: and note the "self" keyword when implementing methods, that is important :-)
 
so at the same time I am trying to close all loopholes in one set of legal documents while trying to exploit all loopholes in another set of legal documents :D
IANAL :D
 
@ShaharNacht Also, if your code sample is a literal copy / paste - you have a typo. true is not the same as True and in general, true will not be defined.
 
@Peque I tried with self, but it said that self is not defined
@JRichardSnape Noticed that after, it's actually True in my code
 
@AnttiHaapala Ah the joys. Leave yourself plenty of scope for expensive "Variations to Contract"... ;P
 
@ShaharNacht: I think you should better take a little time to read the documentation, that will help you a lot ^^
 
11:10 AM
@Peque Alright! =)
 
/me is reading the chat room rules, realizing he didn't start very well... xD
 
OK, read the docs. To my understanding, since keys will not have instances in my code, any time I want to change a variable inside a method of keys, I call keys.right=True.
Is that the way to go?
 
@ShaharNacht: so you want to create a class and then do not instanciate it?
maybe you are trying to solve your problem with the wrong tool :-)
 
@Peque Yes, just to store a lot of variables inside a single variable, for order puposes! ;-)
How would you suggest I do that?
 
@ShaharNacht: would that number of variables be fixed? (and always the same names?)
 
11:25 AM
@Peque I think so?... Pretty sure I can guarantee that?...
 
@ShaharNacht: maybe you could have a look at dictionaries or at this class-based implementation of a struct
 
@Peque OK, thanks! =)
 
@ShaharNacht: but as long as you want to modify those values, if you are using a class, I would rather create instance attributes, not class attributes (which means you do need to instanciate the class and, in case you want to have a default set of attributes in the class, you should use the init method)
* __init__
 
So, in the case of keys, define the class, and then only ever create one instance of it?
Isn't that a bit redundant?
 
@JRichardSnape alas the problem is that the one we're bidding to doesn't really have any loopholes.
 
11:31 AM
@ShaharNacht: it's all right I think (but I'm not the most experienced here) :-P
 
Haha OK
Anyway, from a brief look it seems like dictionaries are what I'm looking for.
But one question about those, can they have methods?
 
yeah, you can inherit from a dictionary type
 
What does that mean?
 
or, if it is simpler for you, you can always create a class with an attribute that is a dictionary (then you don't need to inherit from dict if you don't know how to do it)
@ShaharNacht: you'll have to read the full page I shared with you in order to understand that :-)
 
OK then.
 
Big ol' shoutout to you, @Peque, for being this helpful and friendly! :D
And bye!
 
@ShaharNacht: glad to hear that, bye! :-)
 
@AnttiHaapala read line by line, send through a pipe to an interactive python?
 
@ShaharNacht ctrl+k
@bereal @IljaEverilä had a nice ast solution
 
@AnttiHaapala What are we talking about?
 
11:39 AM
@ShaharNacht click on the arrow
 
What arrow?
[Ctrl]+[K] just writes "?" in my URL bar for some reason...
(Yes it's a question mark, not a failed character :P )
 
@ShaharNacht: read for CTRL+K here, the arrow he means is just a reference you your (ugly) pasted code before (no identation) ;-)
 
Ohhhhhhhhhh, OK, thanks! =)
 
@ShaharNacht the arrow left of @ShaharNacht
 
The one that lets me edit, delete, flag?
What about it?
 
11:46 AM
rather Antti's message: "(arrow) @ShaharNacht ctrl+k"
^ that (arrow)
 
Ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
 
do I need to post a screenshot damnit :D
 
Now I get it...............................................
 
xD
 
Sorry, first time here
..
 
11:47 AM
must leave, have a nice day all!
 
12:36 PM
good morning everyone
 
DSM
Cabbage for the crow.
 
Good morning Pythonnam!
 
DSM
@Antti: It looks like the Vietnamese word for Python (the language) is just Python, which makes sense but isn't as much fun. Is that right?
 
hmm?
why'd it be any different :D
python itself would be con trăn, or con mãng xà
the animal
but Python gets its name from Monty Python which of course happens to be a proper noun, and there's no reason to translate it since, well vietnames uses latin letters, and py + thon is not even hard to pronounce at least somehow correctly :d
 
1:26 PM
Cbg all.
 
Surprised nobody has gone for the low-hanging fruit of Is it the right output?. The laziest answer is "remove the parentheses in the print statement"
Maybe the usually-opportunistic answerers have come to learn that answering a question with 5+ downvotes will usually earn you a downvote, even if your answer is technically correct. There's no profit in it.
 
user559633
stackoverflow has a main site?
 
I thought this was IRC?
 
There we go, there's an answer. But it doesn't actually suggest the right syntax.
Hey, I was right. The technically correct answer got downvoted. Aaand he's self-deleted.
All according to keikaku.
 
!kb tristan
 
user559633
1:37 PM
if you kick ban me, i will cause a netsplit so deep that generations will fall into it
 
Will that stop new users from joining?
Think before answering.
 
user559633
man i hope so
 
The wrong answer will cause you to be kick banned to eternity.
My computer keeps on running out of RAM.
 
Close some programs.
 
But it's okay because Kenny Loggins just came on my playlist.
But what if I need all these tabs?
I accidentally killed Explorer using Ctrl+Alt+Del and now I don't have a Start Menu anymore.
 
1:41 PM
You can open them again. Unless you're using an Iron Man web browser, which DDOSes each page as you navigate away from it.
 
user559633
map/reduce the content into your brain
 
(Hmm, not sure if that reference makes sense outside of the MTG community. Within the community, "Iron Man" refers to a variant of play where you rip your cards in half when they die in the game)
 
user559633
(jk, every time i try to quickly close tabs, if you came back later and asked me what i had learned, i'd say "something about yoghurt?(?)")
 
I assume that that's where the athletes got the name from.
 
I assume Iron Man marathons don't kill the participants that can't pass the finish line.
 
1:43 PM
I'm too distracted to make jokes because I'm on a highway to somewhere called the "Danger Zone" with my hero Kenny.
 
Unless they've failed to pass the finish line because they died.
 
That was my understanding of the race, but then I often don't listen properly.
 
user559633
I imagine in Iron Man marathons, it's mostly flying with a minority segment of laser blasting
 
I think you've confused reality with a Stephen King novel, as you often do. This time, it's The Long Walk.
 
Thankee sai.
 
1:46 PM
Remember last week when you forgot we're not living in the narrative of The Shawshank Redemption? You crawled through ninety feet of putrid sewer to escape the room. we kept telling you the doors weren't locked.
Hang on, is that even a Stephen King book? Or am I thinking of the Green Mile.
 
No it is.
It's a short story/novella.
 
Both are aren't they?
 
I don't think the full film is a book though. Can't remember. It's definitely based on a King book.
 
Wait, they're both Stephen King books. How many times can you tell a story about prisoners? What a hack.
 
do we all always check computational complexity when coding ?
 
1:49 PM
I have no idea how to even do that.
 
I just wait until the computer sets on fire then think "Oh maybe O(n!) isn't quite good enough."
 
Only for extra-mathy applications. If I'm writing a GUI around some dead-simple operation, I don't bother
 
(says the man who's computer is literally crashing as we speak due to running some code)
 
What morgan said.
 
It's easy. You look at the loops in your program, then you [action which is impossible to describe due to the lack of richness of language with respect to internal mental state], and bam you have the complexity.
 
1:52 PM
Boom. Top 100 in the Kaggle competition.
 
user559633
i "budget" a section of code with a number of seconds and if the call goes into "debt", then i go back and refactor
 
Smoke-filled computer is totally worth it.
 
Alright... so how are you supposed to structure oauth within SQL-like databases? Just a table which contains token, user_id, email, profile?
 
user559633
420 smoke cores everyday
 
Now I just need to work out how to get my Start Menu back D:
 
1:53 PM
@corvid sure, or just store the token and id in the session, and the rest of the user data in the database. That's what sopython-site does.
 
(inb4: "Install Linux")
 
@Ffisegydd Nice. Is this the pet shelter data thing you were working on a few days ago?
 
Yeah. I'm working on it with JRich BY MYSELF.
 
@davidism Have you used the json-like functions in Postgres much? I'm wondering it using them is a bad idea
 
Using them is fine, but I haven't needed to.
 
user559633
1:55 PM
i use the json functions when storing non-relational data
 
Slowly improving my model. I think I'll get a better result when I get on my Mac and can use a separate classifier that you have to compile (that I can't easily get going at work)
 
SQLAlchemy has pretty good support for json now.
 
user559633
i'm terrible at sqlalchemy. for some reason, it just doesn't "click" in my head (mostly around non-trivial relations)
 
@Ffisegydd when are you going to be in the top 100 for Nidaba?
 
I already am. #1.
 
1:57 PM
I was looking at the issue @DSM reported, getting a 404 when logging in to the "What tutorial should I read?" page. Looks like it might be unfixable because Werkzeug is really aggressive about unquoting special characters in urls.
 
Surely the fix is just to rename the page
 
I think I might just make the title slug more restrictive.
 
For a given definition of "fix"
 

« first day (2043 days earlier)      last day (2906 days later) »