« first day (894 days earlier)      last day (4055 days later) » 
00:00 - 15:0015:00 - 23:00

12:03 AM
finally got my fanatic badge, my first in the network: stackoverflow.com/badges/83/fanatic?userid=321731
 
12:13 AM
@Tshepang well done ;)
 
:)
@JonClements do you notice anything strange about the review queue?
I am seeing a heck of a lot more First Posts
Some aren't so new (few days old). Maybe there's a glitch.
 
yeah - err, 7k when it's normally empty - very odd
 
7
Q: Sudden spike in the number "First Posts" in the StackOverflow review queue

JSW189I was just looking at the review queue on Stackoverflow and there were zero "First Posts" to be reviewed. A minute later, there was suddenly 9.9k "First Posts" in the review queue! Is this a bug? I completed 20 reviews, so it is not just the number being displayed that has a bug.

am 1 edit away from getting Copy Editor badge
 
12:30 AM
awesome - I'm still about 50 away
 
what to do with outdated stuff like this
11
Q: Pylint equivalent for Py3k

TshepangPylint doesn't yet support Py3k, so am looking for an alternative. [note] An immature branch off some VCS would be sufficient enough for me to try out.

 
I wouldn't worry about it...
 
eyesore :)
Thanks in advaned.: stackoverflow.com/q/15627312
 
12:45 AM
?
 
advaned
new word :)
 
that Q could also do some work with grammar
 
damn, there's only 726 Copy Editors stackoverflow.com/badges/223
closing eyes RSN
 
lol
But strangely 105 gold Python badges
heya Matt
 
1:52 AM
What is up with all the new questions on SO this week? I have typically only seen "0 new questions to be reviewed", but it has somehow reached the thousands?
 
@jakebird451 see the meta post posted up the channel a bit, it was a glitch in the system that's now fixed... so hence zero is now in the thousands... ;)
Mind you - it's being processed quickly by the looks of it, I saw it at 7k, then not much later about 6k.... so errr....
4.6k now then... nice
 
@JonClements Ok, that makes more sense. I should hop on meta more often.
 
same here ;)
@jakebird451 just thinking a bit about sopython.com for the time being
 
@JonClements Yea, SO is a reviewing machine. (except with the close votes, which always stays at ~50k) or unless that is another glitch posted on meta... in which I REALLY need to look at meta more often
@JonClements That seems very promising. I would mind poking my head in there every so often.
 
@jakebird451 that's what it's there for...
 
 
1 hour later…
3:18 AM
heya @Jared
 
hi
 
4:16 AM
Hi
I would like to know whether I can find someone to help me with conversion of a script in python into R.
 
 
3 hours later…
7:18 AM
morning
 
8:15 AM
Hi everyone.
 
8:26 AM
hi @InbarRose
 
How are you?
 
sleepy
I keep cheating on my sleep
yesterday was gunning for Copy Editor and Fantatic
 
8:48 AM
morning chaps
 
@Tshepang more like today morning
 
9:08 AM
Morning
 
 
1 hour later…
10:15 AM
hi there
 
10:30 AM
had to wait 12 days for this to be accepted
15
A: print() not working in python

VolatilityYou still have to call the function. def main(): # declaring a function just declares it - the code doesn't run print("boo") main() # here we call the function

 
12 days
oh ha
thats a long time for such a simple kind of stuff
maybe you should have write a decoratervariant of the main method ;)
 
lol
 
Why adopt a simple approach when we can adopt a complicated one *hehehehe*
So .. voted for you too :)
 
:P
thanks
 
fellow victims must pull togehter ;9
;)
 
10:40 AM
im more wondering why he even wants to declare main
he must be too stuck in the C mindset but then... i'm missing his return statement and similar typical C things :P
 
10:52 AM
is it so unusual to declare main?
 
11:04 AM
depends on what you use python for i guess, I mostly just process data and therefore have small scripts and don't bother with declaring main
or functions
 
hello ;)
 
hey qwerty
 
Zac
11:21 AM
morning!
 
11:39 AM
Y0
 
@Bas: I'm working with mainalso most over time.
Simple scripts, command line tools, GUI applications/tools, etc.
my IDE ships out templates with main methods too
 
Zac
whats the best way to have a string "Hello this is my string" and put it into a python list of words?... oh and the best way to index the words afterwards ie should I do it by going words[0] .... words[sizeof(words)] ?
 
It is good practice to use a def main() function and if __name__ == __main__`: test.
to make your code more reusable.
 
agree with Martijn
 
@Volatility: only 12 days?
 
11:49 AM
and to avoid execution if you just want to import
 
If I got a penny for every one of my answer with the OP commenting 'Thank you!' but no accept..
My highest-voted non-accepted answer with thank you comment: stackoverflow.com/questions/13473433/…
November last year.
 
Zac
I'll ask a question if you like and you can answer it and I'll accept it
 
... that's commonly
 
Zac
"How do I calculate the average wind speed velocity of a non laiden sparrow in python ? "
 
well
@Zac print "Average Air Speed Velocity of a non laiden sparrow: %f" % sum(non_laiden_sparrow_velocity_list)/len(non_laiden_sparrow_velocity_list)
 
Zac
11:58 AM
That doesn't take into account whether it is an African or European Sparrow!
 
You did not ask!
The list I have combines them all.
 
Zac
Not sure if you got the joke
 
Of course I do.
 
Zac
well seeing as you're here maybe you can help with that string question
 
Silly English Kniggit.
What String question?
 
Zac
12:01 PM
and this is a serious question
I have a string "this is my string" and I want to put it into a list of words
and what is the best way to index it ?
 
I do not understand your question
 
Zac
ok, let me elaborate
I have user input string "Hello this is my string"
 
You want a list like ['this', 'is', 'my', 'string']
?
You want continual user input to be appended to an existing list?
 
Zac
I want to put it into a list ['Hello', 'this', 'is', 'my', 'string'] and then access each one independantly
 
Okay.
lst = "Hello this is my string".split()
 
Zac
12:03 PM
because I have this on a chat line
and I want to add user commands
so if the user says
 
You can also specify what to split the string on.
 
Zac
\addperson thisperson
 
with .split() you can split a string on the spaces.
 
"".split(' ')
 
Zac
it will look at string one realise it is a command
 
12:04 PM
default split is all whitespace, space, enter, tab....
 
Zac
and then look at string two and add themn
 
You want split()
 
@Zac: then .split() is the comon way. Commandline parser libs are using the same technique
 
Zac
how do I then index the new list ?
 
12:05 PM
"Hello this is my string".split()[0] will result in "Hello"
 
you can use sort if you want them in order
 
Zac
what happens if I stray outside the index of the list ?
 
you can use every method a list is supported
iterate, enumerate, sort ...
 
Zac
ie words[5] when it doesn't exsist
 
index
you can check the length
 
Zac
12:07 PM
ok cool
 
if len(lst) <= 3: print("you fool, enter at least 4 words") etc
 
Zac
nice will do
 
in Ruby you will have 'nil' of you want to beyond the length of the array, In python you will get an IndexError
 
you can do everything here is described: docs.python.org/2.7/library/…
 
Zac
does python throw an error if I was to do wordList[5] and the wordList was only 3 elements long ?
 
12:12 PM
I already mentioned , you will get IndexError
 
Zac
ok cos I think I want to have it so that I can have a dictionary of say usernames and greetings and at the user prompt I can add new ones to the file by saying "\adduser theirname greeting"
but obviously if I take the message .split() it and then say look for wordList[2] for greeting when say I forgot to add one, it'll throw a wobbly
brb gotta go, will keep this open and be back later
 
guys if you are free, I want to propose a discussion topic....
"Ruby's Symbol in Python"
I mean using the intern() method
to point two different strings at one memory location
 
12:37 PM
Sounds a little bit confusing.
 
intern() will reuse the same string object.
 
Two (string) variables pointing to one and the same string => violates the python string immutability.
 
To make it sound as if two different strings are pointing to one memory location is.. incorrect at best.
 
Make that sense?
Or ... what are the use case?
 
mystring = 'foobar'
intern(mystring)
someothervar = 'foobar'
now 'foobar' will be the same string object.
e.g. id(someothervar) == id(mystring).
which can save memory if 'foobar' is used a lot and is recreated a lot.
if you are parsing a XML file with the same element names over and over again, it can help to intern the element names, for example.
Note that python already will intern short strings.
 
12:41 PM
okay ... mhm
 
Actually, I got that example wrong.
mystring = intern('foobar')
someothervar = intern('foobar')
The intern() call basically will remove the existing string object if it already exists.
otherwise it'll return a new object.
my mistake.
 
ah,k
that works :)
does this works also in lists and dicts?
 
But again, the interpreter can choose to do this automatically anyway.
no, it only works for strings.
 
right, I see
but I see no real use case for using in common python scripts, apps
maybe in frameworks or under python skin
 
exactly.
You reach for this only when you a) know what you are doing, b) have determined that there are savings to be made.
 
12:46 PM
so, nice but mostly unutilized feature g
 
e.g. you have solid proof that the string isn't already being interned.
That is why it is listed under the Non-essential section :-)
> There are several built-in functions that are no longer essential to learn, know or use in modern Python programming. They have been kept here to maintain backwards compatibility with programs written for older versions of Python.
 
hehe :) okay
 
a="Jack"
print id(a)
b="".join(["J","a","c","k"])
print id(b)
b=intern(b)
print id(b)
 
is there any way to run python without installing it, I mean portable version ??
single exe or single DLL will do
if anyone knows pls reply
 
i dont think there is any portable version, never heard about it
but why u want that ?? python is small in size
 
12:58 PM
There are applications which turn python scripts into executables.
However, it itself requires python, IIRC
 
it easy to run batch commands using python but not installed every where so
 
A Py2Exe (and similar tools) installation will include the interpreter.
 
Hi all
 
So, if your developer machine has python, and you want to export your project to a client machine that does not have python, that tool is suitable.
 
Hi Jon.
 
12:59 PM
@MartijnPieters hey buddy
 
its better to have runtime, it still not popolar to have inbuilt runtime.
but great language to deal with issues
easily
 
Mac comes with Python by default.
Python had to keep a FAQ for the longest time because all HP machines came with Python pre-installed.
it is easy enough to install. :-)
You can install it on a USB too, it's not that hard.
Erm, although that may run into path issues.
Will have to retract the USB remark there..
 
How can I install it on USB
 
more python calculator questions :(
 
1:04 PM
I am looking for that @MartijnPieters
 
@MarmiK: you are in luck: portablepython.com
 
hey thanx
that made day
:)
 
How did you not find that on your own? @MarmiK
 
I was searching in portable apps :P
ok bye for the day :)
have good time every one
 
take care @MarmiK
 
1:14 PM
Instead of portablepython, I prefer (and recommend) Enthought python (EPD)
 
hello guys! Don't you mind answer my little question? :)
It's a little bit connected to python cause the system uses a tornado web server...
 
Just ask the question, don't ask to ask :-)
 
What the Ninja said.
 
tornado is written in Python, so that sounds on-topic to me.
 
This tornado web server is used for interaction with mobile devices. It has some set of API methods, that is called by mobile devices (Android, iPhone)
DB is Mongo
And also there is a web part (which is web site written in Rails), it interacts with other system with Mongo DB...
 
1:21 PM
@InbarRose +1 haha :D
 
Now I need to create some kind of a chat on the web part, and I think its better to reuse API methods on tornado web server. The question is how I could accomplish both easy and secure way?
 
how can i create find the precision of a float number ..this is actually part of my program .. like .125 is a 3 digits after decimal
 
What do you meant Sandy?
 
How about you convert the float to a string, and count the characters appearing after the decimal point? len(str(0.125).partition(".")[2])
 
You want to find out at what point your floating point number decimals are just going to print 0?
 
1:26 PM
@kevin thats what came to my mind also but i didnt like doing that
 
@alphacentauri it's a small question but requires a big answer ;)
 
@alphacentauri: Plenty of sites have been built with reusing the API of another server.
@alphacentauri: But it's a broad topic
too many issues to easily give you advice here in a chat channel.
 
@MartijnPieters i want to find the number of digits after a decimal place .. so that i can write .125 as 125/1000
 
I thought about something like symmetric encryption algorithm...
 
I once, in a phone interview had some head of development ask me broad questions like that.
I reflected that right back at him with more questions to constrain the problem.
I don't think I ever gave a straight answer, because that was impossible.
 
1:29 PM
oh ... actually i am trying to solve an interview question which asks us to convert decimal number to a rational number eg .125 as 1/8
 
But really, don't all floats have the same number of signifigant digits? In whatever base the float uses, of course.
 
@Sandy: Use the fractions module for that..
 
@Sandy look at the fractions module
 
no then it wouldnt be an interview question ;)
 
and study the source code if you want to learn to do that yourself.
 
1:30 PM
oh yeah i can study that module
thanks
 
@Sandy >>> a = 1.5
>>> a
1.5
>>> type(a)
<type 'float'>
>>> a.as_integer_ratio()
(3, 2)
 
@InbarRose: which is exactly what the fractions module does..
 
@Sandy I thought you had an interview today?
 
@InbarRose thanks for the function ... thats new to me .. but generally for interviews they expect us to solve without inbuild functions
 
@MartijnPieters Yeah, I tabbed to write that before I saw you all told him to use that.
 
1:31 PM
@JonClements no i am just preparing :D
 
What do you mean you can't use built-in modules?
* functions.
 
@MartijnPieters ok, thanks
 
@Sandy: Next step then is to open the float object source for that function.
 
I really dislike questions that specify, "don't use built-in functions". OK, that probably means as_integer_ratio is out, but what about len or str or +?
 
How can you do any basic work without functions?
 
1:32 PM
@InbarRose i mean generally the interviewers expect us to see if we can think ground up and build something
 
But you will always use functions
Even len, str, etc as @Kevin just said.
 
The interviewer ought to ask you to build something that can't already be done in one line with an existing function
 
It might just be me, but I wouldn't employ someone that new all the CS stuff, but rather someone than can use the tool....
 
@Kevin true .. i agree i should frame questions better ... i mean if the question expects us to do some task they dont want us to use any function for that .. they want us to write the logic
 
If I was giving you an interview in Python, I would expect you to know that you can do as_integer_ratio instead of making it yourself.
 
1:34 PM
I'd rather someone than can show proficiency in being able to use a hammer or a screw driver for the job, rather than telling me how greatly they could make them...
 
If you are being interviewed somewhere that is checking whether or not you can convert decimals to fractions... they are doing something wrong.
 
@InbarRose thanks thats a great advise .. i can tell them that there is this inbuild function and i can also implement the logic
 
The candidates that are filtered out of the process because they CAN pass the decimal -> fractions test... Doesn't seem they aim so high.
 
i agree guys but when there are jobs for a different language than my experience they would probably try to judge on my logical skills may be thats why some companies also keep such question
 
@InbarRose, that filters out people that can passably glue together frameworks to make simple CRUD apps, but have never implemented an algorithm more complex than Fizzbuzz.
 
1:38 PM
@kevin true
 
Zac
Back from lunch
 
Wow - feel like I'm back at school - cramming quiz books for quiz night tonight :)
Only had a month to prepare - and I'm trying to ram stuff into my head just 6 hours before...
 
Sounds brutal
 
@ColinO'Coal fitting a 5" hardbook into your ear takes a lot of work.... think I've worked it out though... ;)
 
@JonClements lol what quiz is it
 
1:47 PM
It normally covers history, science, literature, music, sport, music, technology... etc... etc...
And other "stupid" things such as - in a recent survey what percentage of hairdressers said they were happy in their work
 
oh ha
that is brutal
 
Sounds like University Challenge..
 
Not even the usual quiz master tonight - so I reckon we might get completely different Qs
 
Pub Quiz?
 
@MartijnPieters yup - haven't been to it for while now - an opportunity to meet some old friends - and well, always a learning experience :)
And since I forgot about St Patricks day, perfect excuse for a couple of Guinness's (or should that be Guinea? :P)
 
1:54 PM
in the pythons fraction class they use same function as told by @InbarRose i am trying to look for the source code
the call looks like this -> return cls(*f.as_integer_ratio())
but i cant find that function anywhere in numbers.py
(cls is the Rational class in numbers.py )

need help pls
 
@Sandy are you really sure you're not over analysing this?
 
so, afk for a couples of hour
s
 
@ColinO'Coal have fun?
 
@Sandy: What function are you looking for?
I already linked you to the .as_integer_ratio() method.
earlier, it's implemented in C.
The cls() in that method is the Fraction class itself.
 
@MartijnPieters u gave me this link hg.python.org/cpython/file/2.7/Lib/fractions.py
 
2:03 PM
He links to the float object source code in this post.
 
@MartijnPieters you on Skype?
 
oh thanks i picked up something else my bad
 
Huzzah! Finally got pyOpenGL to recognize my freeglut dll. I wish it was easier to tell which dlls are 32 bits and which are 64.
 
while i am looking .. anybody interested in listening to my mini composition? - i have never taken any music classes and so there can some technical mistakes lol - youtube.com/watch?v=sbsGfloX0jo
 
Music is very mysterious to me. Like, when someone sings off-key, why is it unpleasant to listen to? Is there something inherent about sound that makes 1046.5 Hz nice to hear, and 1046.6 bad?
 
2:13 PM
haha lol i told u i havent learnt music :P
 
Tempted to add a comment to meta.stackoverflow.com/questions/173992/…: I spend my time voting to close NC questions.
 
@MartijnPieters you're not the "average" user ;)
 
From context, he does refer to people like me, I'd say.
 
The average user has something like 56 rep a year - not close to hunting down/beating Skeet daily ;)
 
Well, apart from that...
 
2:28 PM
Since it says - "where do you hang out" - would it be a shameless plug for me to put this room in a link in a comment?
 
The word 'average' is, I think, not what he was after.
 
Zac
Hey, I'm writting a python 'module' and was wondering if there is a standard function that gets called when people do /help or something for it
ie, is there a standard way to write the usage document ?
for example my function is from a userinput and when they type /addgreet username greeting it adds it to a database
 
You give it a __doc__ string.
The first string in a module becomes that string.
So, at the top of your module, simply create a string, do not assign it to anything.
Just like with classes and functions.
 
Zac
so I add something like doc "Contains functions \addgreet, call \help functionname for futher info"
will contain more than one funtion when I'm done
Is there a standard method call that displays the doc string or do I have to implement one ?
 
help() ?
 
2:41 PM
printing \addgreet is probably a bad idea. \a is the bell character, which causes a rather piercing beep to play.
 
@Kevin good catch
@zac you may want to also consider sphinx-doc.org
 
@Zac probably avoid using the escape character.
 
Zac
yeah sorry I changed it to \\
rather odd for me because I'm used to that being the comment symbol
or is it the other one
either way
its sorted
:D
it is the other one
I feel my lack of credentials is showing
 
We'll just assume you meant // and pretend it didn't happen ;)
 
I prefer the python comment syntax: #
there's little chance there of getting the slantiness of the character wrong.
On my keyboard, at least, there's only one button that looks like that.
 
2:56 PM
Once set up my computer to use US keyboard layout
that was confusing
You don't end up writing complete non-sense - but ummm
 
I use US layout keyboards. Can't use anything else.
Except for my Kinesis.. but that is sorta US layout.
 
00:00 - 15:0015:00 - 23:00

« first day (894 days earlier)      last day (4055 days later) »