« first day (1626 days earlier)      last day (3340 days later) » 

2:00 PM
@Katherina solved! :)
 
@RobertGrant Was that the year of Hindenburg?
 
user4433485
That easy @RobertGrant :D
 
No , there's no code lol
Hindenburg? that's like 1930s
 
@poke Lol how old ARE you?
 
wat?
 
user4433485
2:01 PM
what no
 
You think the Hindenburg was in the 70s, I'm assuming you're annoyingly (for me) young
 
What has that to do with my age?
 
For newsreel coverage of the event, see Hindenburg disaster newsreel footage. The Hindenburg disaster took place on Thursday, May 6, 1937, as the German passenger airship LZ 129 Hindenburg caught fire and was destroyed during its attempt to dock with its mooring mast at Naval Air Station Lakehurst, which is located adjacent to the borough of Lakehurst, New Jersey, United States. Of the 97 people on board (36 passengers and 61 crewmen), there were 35 fatalities (13 passengers and 22 crewmen). One worker on the ground was also killed, making a total of 36 dead. The disaster was the subject of...
 
I’m 26.
 
user4433485
o you right, 1936
 
2:01 PM
1937
 
Oh. 37. Close enough… *cough*
 
user4433485
37*
 
:)
Oh the annoyingly young humanity
 
But that one had only few fatalities, as the zeppelin was near the ground already.
 
user4433485
so true @RobertGrant, like every 16 years old is now doctor, lawyer, and cook
 
2:06 PM
Too broad and an external resource request.
 
Pew pew
 
@RobertGrant You’re only 6 years older than me!
 
I know. I seem older and crazier.
@AnttiHaapala the people shouldn't write articles about how Python3 is the worst thing ever record
 
user4433485
It feels good to be 20 years old:D
 
@MartijnPieters which record
:P
 
2:12 PM
@Katherina I actually prefer life now to life then, but wish I also had the energy I had then :)
 
user4433485
How comes? I enjoy having no responsibilities, Can't even think about it, fulltime job, children etc.
 
The only children I can think about right now are DOM children…
 
I enjoy having responsibilities :)
 
@MartijnPieters the problem with all these answers is that ppl who don't know python just read that "ok python has lots of problems", when it is really Python 2...
 
user4433485
Nobody expects anything from me, pure freedom =D
 
2:14 PM
and if it is tagged then it is not correct to have an answer that solely says "In Python 3..." either :D
 
user4433485
@RobertGrant with responsibilities comes daily routines, how can you enjoy that more than when you had no responsibilities at all?
 
Why is immutable.js 55KB o.O
 
@Katherina it's not that, it's that I like being able to provide for me and my wife (who also has a job, but it doesn't pay as well), and get set up in case parents etc need financial help in the future (they saved well, but just in case), that sort of thing. I want to be able to help.
 
@AnttiHaapala the one with the scratch in it getting stuck. :-P
 
@poke they wanted to optimise it, but the file's read-only
 
2:18 PM
good one.
 
@Katherina carefree just means "turns a blind eye to all the good they could do"
It's not "no cares", it's "don't care"
Not that I was like this at 20, or even 25, but it's more how I am now
 
user4433485
You sound like a good guy to me, I hope I will meet someone as you later :) I guess I am to selfish to think that way, or it comes with age, maybe.
 
My dad is ridiculously like that. He used to have a very stressful job, driving to and from it 2 hours a day in a VERY old car which he used to maintain in the evenings, and go to his dad once a week in London (in that car) because he was getting more and more ill. Very dedicated. I wasn't like that for a long time :)
I'm getting there
 
Family car:
Parp parp!
 
user4433485
2:24 PM
hehe V-Tec kicked in
 
user4433485
Sounds like a good family tho
 
user4433485
maybe it's the education :)
 
But anyway. If I were you I'd jump into Python and learn everything you can for a couple of years. You've got time to learn some languages and get in deep with them, which is awesome. I wish I'd been in a chat room like this at 20
 
user4433485
I keep moving from country to country with my parents;) They don't care about my opinion and it's OK since I am used to it. Perhaps that made me selfish
 
2:27 PM
Yeah, we all have things that make us who we are I guess, but I wouldn't assume you're particularly selfish, when we all are. So much stuff on TV etc constantly tells us that the easier thing to do is the better thing (generally to sell something that makes something easier). It's hard to not be influenced by that.
 
user4433485
I am trying to learn as much as possible and the community teaches me everyday
 
Maybe you'll make a decent living and get to help some people in ten years' time :)
That would be cool
 
user4433485
It would be nice indeed
 
user4433485
but first I need to learn and have fun
 
2:31 PM
You can still have fun :)
My wife actually is very generous and she also helps me a lot. I'm not naturally particularly generous, so I'm glad she is, and can nudge me further that way.
 
user4433485
Ofc! but in a different way
 
But I definitely find learning harder now, so definitely do that :)
 
user4433485
I am trying ^^
 
user4433485
Programming is not easy to learn
 
No, definitely not. But this is an awesome time to be learning it, so if you can pick it up, it's really really cool.
 
user4433485
2:36 PM
I know
 
user4433485
I need more motivation sometimes, that's it
 
Have you done the Codecademy Python course?
 
user4433485
I did until I got stuck
 
I'm planning on using Python to work on Machine Learning things
For the most part, Python seems really simple
(I'm learning it, but I have prior experience with other languages, so picking it up is fairly easy)
 
user4433485
Machine? like in Robotica?
 
2:41 PM
the codecademy isn't that good
it is actually pretty annoying what much I tried it :D
 
@Katherina Like Artificial Intelligence stuff
I'm taking the Machine Learning course on Coursera, so once that's done, I figure I can use Python to try making something on my own
 
user4433485
Oh okay never heard off ^^
 
user4433485
I thought you use Lisp for Artificial Intelligence stuff
 
A lot of people do
 
user4433485
you had a question about something?
 
2:45 PM
@AnttiHaapala yeah but you're an expert, and don't need gamificationy stuff and browser access to an interpreter to make it simpler for you :)
@Katherina maybe start it again, and see if you get further this time
 
no, I mean the programming tasks
and that it does not teach in correct order and so...
 
user4433485
@RobertGrant I will, did you use it aswell?
 
@Katherina yes I did
Python and Ruby
 
user4433485
Cool
 
Anyway, good luck! I'm off home.
Rbrb all
 
user4433485
2:47 PM
cya later @RobertGrant
 
@Katherina Nope, I was just talking
 
user4433485
Okay @SomeGuy Welcome btw:)
 
Melon!
 
user4433485
=D
 
user4433485
Bananas
 
2:50 PM
I've actually been lurking in this room for a few weeks
 
user4433485
ooh ok:)
 
user4433485
You said Python was quite easy to learn?
 
user4433485
It's alot harder as PHP I'm afraid
 
Yeah?
So far, I've found it pretty easy
 
user4396006
Hey guys!
 
2:56 PM
But I've never used it to make anything really, so I guess I'm no one to talk
 
user4396006
Anyone could help me?
 
user4433485
I can't handle the white spaces, no idea what I do wrong tho:p
 
user4433485
Tell us @JuanRocamonde
 
user4396006
I am trying to transform a standard dictionary to a plain list, like
 
user4396006
{"a": "b", "c": "d"}
 
user4396006
2:56 PM
["a", "b", "c", "d"]
 
DSM
Morning cabbage for all.
 
user4433485
Cabbage @DSM
 
user4396006
Does anyone know how?
 
DSM
@JuanRocamonde: just to be clear, since dictionaries aren't ordered, unless you sort to get a canonical order (say, on the keys), it's as likely you'd get ["c","d","a","b"] out. Is that okay?
 
user4433485
@JuanRocamonde unfortunately you've got the wrong person tho, I am sure someone is willing to help you, I however, cant help you out
 
user4396006
2:58 PM
yes
 
user4396006
perfectly
 
user4396006
@DSM How would I do so?
 
DSM
You can get the pairs via d.items(), and then flatten that. For example:
>>> d = {"a": "b", "c": "d"}
>>> d.items()
dict_items([('c', 'd'), ('a', 'b')])
>>> [elem for pair in d.items() for elem in pair]
['c', 'd', 'a', 'b']
 
user4433485
I am off, Driving home! Cya all
 
user4396006
Ah yes
 
DSM
3:00 PM
Rhubarb.
 
user4396006
thank you very much
 
user4396006
I could do the same with an OrderedDict
 
@JuanRocamonde But the big question is: why do you want to do this? :)
 
user4396006
couldn't I?
 
user4396006
Well
 
user4396006
3:01 PM
I hava a class
 
user4396006
have*
 
user4396006
Which is related with databases
 
user4396006
and needs to create the database
 
user4396006
the data columns and the data type
 
user4396006
I get them from a dictionary
 
user4396006
3:02 PM
and then I want to put them into a sql statement like 'CREATE TABLE IF NOT EXISTS Users(id INTEGER PRIMARY KEY, device_idn TEXT, network_name TEXT)'
 
user4396006
I guess if I get them in a list I can simply join them with a space between and then with a comma
 
user4396006
:22391101
 
user4396006
Do you see a better approach, then?
 
Yeah, ok. I guess that makes sense. FWIW, you can do the join with ', '.join(mylist)
 
user4396006
ahh :D I was so stupid, thank you
 
DSM
3:06 PM
Remember that it's a bad idea to do string interpolation into SQL commands; pass them as arguments to execute instead.
 
No worries. I originally thought it was a bit weird that you wanted to mix keys and values into one list, but it all makes sense now.
 
user4396006
@DSM Why?
 
user4396006
Security reasons?
 
When people ask how to do stuff that seems weird, I immediately suspect that it might be an XY problem
 
DSM
3:09 PM
That's usually the way to bet.
 
user4396006
hahaha so funny
 
user4396006
anyway
 
user4396006
That would not happen since
 
user4396006
the interpolation is done surrounding the string with escaped quotees
 
user4396006
quotes
 
user4396006
3:10 PM
and the data inserted passes a regex before the sql command being executed
 
user4396006
so dont worry, thank you anyway
 
user4396006
:22391287
 
What happened to that last hour? Oh well. Rhubarb time.
 
DSM
Rhubarb for you.
 
user4396006
what do you mean with that? :P
 
user4396006
3:15 PM
AH ok
 
user4396006
dont worry I found out
 
I think I might have found the worst band ever
 
cbg
 
DSM
End-of-the-morning to you.
 
user4396006
Where are you guys from? Here in Spain its 17.30 PM
 
3:26 PM
@JuanRocamonde "just wanting to share my code" is not a valid reason to make a Q&A post on Stack Overflow. It is a valid reason to make a blog post.
 
user4396006
But people might wanted to suggest improvements
 
user4396006
:22391706
 
user4396006
@davidism I am sorry if it's not quite appropriate.
 
"people might want to share improvements" is not a valid reason to make a Q&A post just to post code that needs to be improved.
 
DSM
3:27 PM
Yeah, blogs are good locations; can put code on one of the big free sites like github; etc.
 
user4396006
Ok don't be rough with me... :D
 
if you want people to use and improved your code, github is a much better place to put it
 
user4396006
I won't do such a thing again
 
we're not being rough with you, we're explaining how this site works
 
user4396006
Ok thank you
 
3:28 PM
Ultimately, what I'm trying to get you to do is not do it now. Remove the post and put it in an appropriate place.
 
It's highly misleading to anyone stumbling on that post. They see and "answer" and think they should use that rather than any number of betters solutions out there.
That code is also not very good, and the db practices it shows are not very robust or correct.
 
user4396006
Sorry, this question has answers and cannot be deleted; flag it for moderator attention instead.
 
That's your own answer...
 
user4396006
YE
 
user4396006
3:32 PM
YEs
 
So you can delete it, at which point the question has no answers.
 
user4396006
Ah ok done
 
cbg :)
 
@JuanRocamonde you got a badge :d
 
@vaultah even though you weren't referencing @JuanRocamonde's code, that statement is still relevant. Scary.
@JuanRocamonde your entire code is subject to sql injection
 
user4396006
hah
 
I guess you will get disciplined too
 
user4396006
I do not get sql injection
 
"Deleted own post with score of 3 or higher"
 
user4396006
I know that might seem ridiculous
 
3:35 PM
You do string formatting instead of parameter interpolation.
 
user4396006
but
 
user4396006
the code is supposed to run in a local machine
 
Within the 10 minute rule because that question is not going to go anywhere.
 
@JuanRocamonde then that's a huge caveat that anyone who stumbles on that code should be aware of
 
user4396006
3:36 PM
Ok
 
anyway, that's secondary to the fact that the question should just not be there
 
user4396006
How should I prevent the injection though
 
user4396006
?
 
Use the database driver's support for interpolation. You send it a query with placeholders, and send the values separately. It will do the proper escaping internally.
cursor.execute(query, (param1, param2, ...))
Or you use a real orm
 
or real sql support lib = sqlalchemy
 
user4396006
3:38 PM
I am passing the formatting as kwargs. Can i do so without doing the interpolation?
 
(no need to think sqlalchemy is just an orm)
 
DSM
31 mins ago, by DSM
Remember that it's a bad idea to do string interpolation into SQL commands; pass them as arguments to execute instead.
 
@JuanRocamonde probably, but that's really just pointing out a failure in your design, not an excuse for doing it your way
Or you use a real orm, in which case you can do all kinds of things
 
use sqlalchemy <3
 
user4396006
I am happier with building my own code :D
 
3:39 PM
Bad idea
 
user4396006
I know
 
user4396006
its just for learinng
 
user4396006
learning
 
that is tinkering as opposed to engineering
 
user4396006
I am going to use it then, now you've said that
 
3:39 PM
please try to type sentences on one line
 
user4396006
Ok.
 
you can also edit/delete your previous messages
 
user4396006
SQLalchemy is in version 0.9.9. Should I actually go ahead with that one?
 
yep, that's a number
 
DSM
Well, three.
 
user4396006
3:41 PM
:D. I mean that it may be not very strong... (I know, stronger than my code, for sure)
 
why do you think 0.9.9 means you shouldn't go with it?
 
sqlalchemy will be 1 very soon :P
been using it since 0.5 or so
 
user4396006
@AnttiHaapala Yes, I have seen so. Still beta, though
 
end-of-morning? It's always morning
 
it's not beta
it's just not version 1.0
 
user4396006
3:42 PM
The 1.0 version
 
the version strings without context mean nothing
 
zzzeeek is just quite cautious with bumping version numbers
 
cbg all
 
the test suite SQLAlchemy uses is incredibly impressive
 
argh I need to provide my patch
 
3:47 PM
Although Dolphin Emulator probably has the coolest test framework: dolphin-emu.org/blog/2015/01/25/…. It renders and diffs games to spot regressions in graphics support.
 
user4396006
Since this needs to be installed into the machine, do you know how could I request the automatic installation if the package is not found in the system, inside the python code itself?
 
user4396006
I am talking about SQLAlchemy
 
DSM
@davidism: now that's very clever.
 
Yes, you make a package with a setup.py that is installable and lists requirements
 
user4396006
And are installed automatically?
 
3:49 PM
see sopython-site's setup.py for example: github.com/sopython/sopython-site/blob/master/setup.py
yes, dependencies are installed when a package is installed. You've used pip before, right?
 
(not gonna lie, I have totally used that setup.py davidism mentioned as reference several times before; it's very useful)
 
@davidism did you get my ping the other week about a mini sopython meeting to discuss the dev projects? Basically: would you be interested in including sopython-site for discussion or just keep it to Kesh/Nidaba?
 
user4396006
@corvid But it's got external references to other files. Where are they?
 
Not gonna be too big and formal like the normal General Meetings.
 
Umm, I'm not sure what I'd say at it, but sure.
@JuanRocamonde it's a whole package, see the rest of the repository...
 
3:52 PM
@JuanRocamonde within the github page, there's a "requirements.txt" file. Generally speaking, when you pip install dependencies, you can do pip freeze > requirements.txt to save a list of them. The setup.py opens that file to get the requirements
 
user4396006
@davidism I know, but I haven't found it. Let me check again
 
Well we could discuss plans and how things are gonna work. I'm starting to get some work done with Apache Kafka and the websockets, so we will be able to get live data from SO in real time.
 
It's a github repository, it's right there
 
user4396006
Can you import a TXT too? I didn't know that
 
@Ffisegydd sure, sounds good
no, you cannot import text files, and it's not
 
user4396006
3:54 PM
Ah sorry, I misread
 
you'll probably be better served by reading this: python-packaging-user-guide.readthedocs.org/en/latest and then looking at more examples of how projects actually do this, such as sopython-site and sqlalchemy themselves
 
it's not really "importing" a text file, it's opening a file in read mode
 
user4396006
yes yes, I realised @corvid
 
Does anyone know if PyTables supports parallel (multiprocessing) writes?
 
what history should I read now?
 

« first day (1626 days earlier)      last day (3340 days later) »