« first day (1438 days earlier)      last day (3505 days later) » 
03:00 - 15:0015:00 - 00:00

3:30 AM
ok, what's the punishment for using sock-puppets?
Because I'm pretty sure I caught it red handed...
 
3:49 AM
@AaronHall the accounts generally get merged, I think - flag an offending post for moderator attention.
 
-3
Q: Transformation of string column

Prashant KuranjekarI have a input.CSV file and first column consist of EMI_EMF Cultural Resources Hazardous Materials Parcels Footprints Now I want the output.csv file in the below mentioned format "EMI_EMF", "Cultural Resources", "Hazardous Materials", "Parcels", "Footprints"

Be sure to merge into the lower rep account
 
@AaronHall is that your suspected sockpuppet?
 
4:19 AM
any python package that converts .doc to .docx except for win32 and comtypes ?
i guess pandoc doesn't support doc files , otherwise it was a nice bet
 
5:04 AM
I think my abuse of the code highlighter to get html highlighting in python strings might be too clever.
0
A: How to create chained selectfield in flask without refreshing the page?

davidismIf you want something dynamic on the client, there's no way around writing some JavaScript. Luckily it's not the 400+ lines you estimate. This example doesn't use WTForms, but that's not really important. The key part is sending the available choices as JSON, and dynamically changing the avail...

 
@davidism that's brilliant
 
5:21 AM
Man, Safaribooksonline is awesome...
 
What are you reading about?
 
user559633
nice and clean @davidism
 
I am just seeing the list of books, it is awesome
The mobile app sucks though... Search never gets completed
 
user559633
yeah, info hoarding rules
 
Does anyone here use pycharm with GAE?
/crickets
 
user559633
5:31 AM
oof. once.
 
cbg()
 
user559633
Greetings.hi(@Jeeva)
 
user559633
What's a really adorable name for a dog
 
Jon :3
... I mean thefourtheye >_>
 
mm.. Lucky .. :)
 
5:37 AM
snake
 
user559633
hah
 
user559633
went with sprinkles
 
6:30 AM
I am watching Person of Interest these days... So I would go with bear
 
6:44 AM
cbg()
 
6:55 AM
Cbg
I quite liked the topic of python2 vs python3 - is there a lot of stuff that something like six doesn't cover? Or is there a different reason for stuff not being converted?
 
"I quite liked the topic of python2 vs python3" → You're a cruel man.
 
I mean why people don't want to use Python 3 :)
I'm like you, I would rather use the latest version unless I really can't
 
Many libraries have been split in this war, it's not something to relish but something to remember in solemn silence.
 
That's not the face you wear to a FUNERAL!
(:¬|)-|-<
 
7:11 AM
 
¬_¬
But srsly, Six is for lame-OS. python-future.org is where it's at.
 
Okay, that looks cool already
 
Or where it will be, one might say ;)
 
I'm only interested because it seems that the lethargy around upgrading to 3.x and the (still) not quite noob-friendly web deployment (I know, I know) are two big things putting people off Python
That would be a good slogan for the project: "It's where it will be" :)
...at
 
Their logo looks like a mashup of Python's and... Ubuntu's
 
7:15 AM
from difflib import SequenceMatcher
q= difflib.SequenceMatcher(None,"hello","hell")
q

<difflib.SequenceMatcher instance at 0x00000000111F7848>
why doesn't this display the value?
 
Because the import is wrong
 
Do you have to run it or something?
Or that.
 
it should display a float value between 0 and 1
 
import difflib
q = difflib.SequenceMatcher(None,"hello","hell")
q.ratio()
Reading the documentation is easy. :/
 
Flip, that python-future project is actually amazing, at least in scope
 
7:18 AM
Yup
Also
q.quick_ratio()
 
Once it's mature, Guido will come along and write a basic version of it called Sunflower and put it into core :)
 
damn , how could i forget that , i used it some months back..
 
And my favourite...
q.real_quick_ratio()
 
i was checking this place
what does quick and real quick do ? save a few lives?
 
7:20 AM
Heh
It's just a faster diff algorithm
You won't notice the difference if you have small strings
It'll matter when you're comparing, say, files
help(q.real_quick_ratio)
#>>> Help on method real_quick_ratio in module difflib:
#>>>
#>>> real_quick_ratio() method of difflib.SequenceMatcher instance
#>>>     Return an upper bound on ratio() very quickly.
#>>>
#>>>     This isn't defined beyond that it is an upper bound on .ratio(), and
#>>>     is faster to compute than either .ratio() or .quick_ratio().
#>>>
In theory it could just always return float("inf")...
 
and does speed come at the cost of say ,something i cant think of currently??
 
Accuracy?
 
yeah that would be one thing
 
I think it's actually more accurate, but you have to sell your soul.
Something to do with hexes.
 
as long as the interpreter does it , there's no fight for me , but if i have to do something extra complex , i'd continue with the former approach.
and considering the time for typing that extra "quick" word and the actual time saved in running the program ,is this worth it ?? :P
 
7:26 AM
It depends how fast a typer you are, doesn't it?
Or how fast the interpreter reads...
Which reminds me of a story about PHP
 
PHP troll??
 
@Swordy also, there is the Levenshtein library which I am unfortunate enough to currently maintain
 
yes i was playing with it before sequence matcher
wasn't working that great for long strings.. returned a 0
 
I should make a new release but
 
7:29 AM
are you a contributor?
 
i am a pypi maintainer
my friend used to be the maintainer, I needed py3k version in pypi and he then said "go and upload it"
 
and you uploaded it?
 
and then people forked it?
 
nope, no one forks it :D
people just complain to me about bugs
"fix this"
 
7:32 AM
pun unintended
lazy people
 
and no one even gives me an example
"it crashes"
and no one pays me for fixing it :D
 
Oh dear
Is it v2 and v3 compatible?
 
try except is a life saver when it comes to crashes..
 
it should be 2 and 3 compatible, but there might be some problems
there is no test suite :D
should have to write a test suite, better docs, everything
all while currently I do not have any need for knowing edit distances or text matching :d
 
so all these different packages people write , are just out of passion??
 
7:35 AM
nope
most of it ppl get paid
one way or another
 
i've never seen adverts though.
 
I did port the code to python 3 so that we can do edit distance calcs in... python 3..
but it worked, and now then we also do not need it.
 
cbg
 
@Bestasttung cbg
 
7:40 AM
@RobertGrant cbg
 
@Swordy cbg
 
thought of creating a cabbage loop
darn , we'll have to start it all over :(
:D
 
Oh sorry, I played Mirror Image
 
:)
rbrb
 
@AnttiHaapala is the implementation much more comprehensive than these: en.wikibooks.org/wiki/Algorithm_Implementation/Strings/… (each of those seems to have a documented problem)
 
7:50 AM
Cbg :)
 
@RobertGrant it is C
 
Sorry, yes I realised that and hoped you hadn't seen my question :)
 
also it is not only levenshtein but related algos too
and i am not responsible for whatever crap it is D:
I just tried to make it better :D
 
And it's python2, python3 and C compatible as well?
 
7:56 AM
cbg
 
at some point it was in google code or something, then stackoverflow.com/users/315168/mikko-ohtamaa wanted it to github and setuptools compatible, and now I am the poor one who ppl bug bc it is now under my acco in github :D
 
:)
That sounds like a clever yet tedious balance of languages
Why don't you say you're going to stop accepting pull requests until another maintainer is found?
 
And if you've got expertise in the algorithm then maybe make a pure python version or something?
 
stop accepting pull requests?
 
7:59 AM
Well, pull requests, bug reports, whatever :)
 
the thing is
I would gladly accept pull requests
or even bug reports
 
Or complaints, then :)
 
I know the topic is Python here, and not bash, but I'm used to come here, that's why I ask here ;)

How to make a backup of all my home directory and subdirectories that are on my server (into tar/gz or zip or anything else) *all files except all .RAR files*
 
what does this have to do with bash
use tar, tar has --exclude=PATTERN
 
@AnttiHaapala because I am connected to server with SSH, and it seems to be bash
 
8:05 AM
tar cfj foo.tar.gz /home/user --exclude=\*.rar
 
@AnttiHaapala yuor levinshtein library is buggy and keeps crashing Can you fix it plz thanks. here is my error
>>> print Levenshtein.distance("hello", "there")
  File "<stdin>", line 1
    print Levenshtein.distance("hello", "there")
                    ^
SyntaxError: invalid syntax
 
@AnttiHaapala what is cfj ?
 
@Veedrac :D
 
if current dir is home, can I do :
tar cfj foo.tar.gz . --exclude=\*.rar
Is this correct ?
 
*sorry
tar cfj foo.tar.bz2 /home/user --exclude=*.rar
c = create an archive
f = filename is given
j = compress with bzip2
 
8:08 AM
@Veedrac :)
 
@AnttiHaapala ok, is it =*.rar or = \ *.rar
 
\*.rar
but stupid chat eats the \ or something
 
why the antislash ?
 
bc you do not want shell to expand it
antislash, also called backslash :D
 
@AnttiHaapala right :)
 
8:10 AM
also, you do not want to run tar for .
 
Use "`" marks to stop them being eaten: there \\ are \ some\ backslashes.
 
@AnttiHaapala why ?
 
bc it then tries to also add the newly created archive in there
 
@AnttiHaapala oh right ;)
@AnttiHaapala are you sure ? bc tar cfj foo.tar.gz . --exclude=*.rar would be much simpler for me than adding every subfolder to the tar...
 
I mean
you would execute the command so that your bz2 outside
 
8:13 AM
I cannot go outside...
 
ok, then exclude it :P
tar cfj foo.tar.gz --exclude=\*.rar --exclude=foo.tar.bz2 .
 
@AnttiHaapala the /logs/ subfolder has files with permission problems for me, can I exclude it as well with --exclude=logs/ ?
 
think so, though logs/ could exclude all subdirs with that name :D
not sure
ah
add v for verbose, so cfjv
 
weird that its default isn't to exclude its output file
 
@AnttiHaapala have you tested that by default it would include its output file ?
 
8:18 AM
@AnttiHaapala yeah come on! What are we paying you for? :)
 
[~/foo]% tar cfz foo.tar.gz .
tar: .: file changed as we read it
seemed to be like this
sometimes it can cause skips
the output file was not there though
ah
nvm
not to worry :d
 
Which is better: a watch that's fast or a watch that's slow?
 
@Veedrac tar --help
 
8:26 AM
Maybe it's time for a better looking tar
tart?
 
I use atools.
 
I use tar, always.
except when mailing something to my stupid boss
 
@Veedrac haha
@AnttiHaapala I got an error at the end of tar : tar: .: file changed as we read it
 
yeah, it does not matter
it is that in the beginning tar reads the directory, and also at the end
and if they differ it gives a warning
if you didnt have any other changes, this is bc of your archive appearing in the directory
 
@AnttiHaapala ok, so I shouldn't care about this ?
 
8:38 AM
shouldn't
 
ok thanks for this tar help ! @AnttiHaapala
 
P = NP.
 
@AnttiHaapala prove it :)
 
problem = no problem :D
 
;)
 
9:37 AM
hmhm
 
>>> getattr(Antti, 'greet')()
cbg
 
9:49 AM
I've got some invitations for keybase.io if anyone is interested. I seem to remember you being interested @Jon ?
 
@Ffisegydd I was curious about it, but not sure I need use of it at the moment... so probably best you keep invites for people that are more serious than mere curiousity mate - thanks though :)
 
Cool. Oh btw.
@Jon BRIIIIIIIIIIIAN!!!!!
 
oh yes @Ffisegydd STEWIE!!!!!!!!!!!!!!!!!!!!!
 
10:09 AM
That explains all the gists I've been seeing
 
Hah, yes
I don't really need encrypted email and such, I don't have such interesting secrets to hide, but it's an interesting thing nonetheless.
They need to add SO/SE validation though.
 
It seems to be some kind of computer code ^_^
 
It's puzzling
I can't tell whether it's obfuscated or just really terrible
 
people really fell for this? I do like the two comments at the bottom though :)
 
10:22 AM
The difference between LinkedIn and Facebook is I don't allow recruiters to be my friends on Facebook.
 
There was once a rumor that an IOS update came with waterproofing
People fell for that
 
fin.
 
danke
 
10:34 AM
helloc @PeterVaro
 
that's the other room ;)
it is cabbage(@Swordy)
 
@Peter are you basing your C room on this room? That's just cheating... come up with ya own stuff :p
 
@JonClements :P what are you talking about? :P
 
try:
    helloc @PeterVaro
except KeyError:
    cbg(@PeterVaro)
 
@JonClements sure, we have our own cabbage -- however it wasn't this room who invented in human history the secret handshakes, was it? ;)
 
10:37 AM
Er... I'll think you'll find it was... I have evidence...
(or will, when I've fabricated it anyway... gimme a sec' :p)
 
@Swordy magical -- except how will you run it without an interpreter? or how will you compile it inside python?
 
thats where @AnttiHaapala comes in the picture . I'll say "Please upload" :P
 
@Ffisegydd CIV:BE out 24th next month... we'll need to get some human/puppy practice in - I've only played computers recently (and not that much)
 
I've only ever played computers.
 
10:40 AM
@Ffisegydd well... we could try 40/50 turns here and there? Just bloomin' difficult to know if we're both free at any one time :)
 
I will be free Friday evening and Saturday this weekend.
Also Sunday during the day.
 
@JonClements ur username "joncle" sounds like jon uncle.. That reflects negativity on your young ,tender age..
 
I want to get in some ML work but I'm sure I can squeeze in some Civ :D after all what's the point of having dual monitors if I'm not gonna play video games on one while coding on t'other?
 
@Ffisegydd it's not like it's RTS - so heck - get distracted - can't suddenly just be swarmed by troops :)
 
Yeah exactly, I can code while you play :P
Plus it'll be nice to give my new RAM a tryout. Running Civ 5 on one screen and running a 10GB model on the other!
 
10:46 AM
@Sword or you could pronounce it Jon Clee (which sounds similar to a certain actor) related to the world of Python :)
 
Right I'm off for lunch. Yeah @Jon let me know about Civ 5, whenever you're convenient really as my weekend can be structured however. I've got the expansions but if you don't have them then we can play without them (no point you buying them seeing as how soon BE will be out).
 
I'm totally addicted to Star Wars Commander on my phone
 
I think I might have some as part of the bundle, but haven't installed them if I do... just wanted to be able to get back into the mentality of it again. Enjoy your lunch @Ffisegydd - see you in a bit :)
 
Which is basically identical to clash of clans etc, but when I turn my sound on STAR WARS MUSIC PLAYS
 
It's funny sometimes what crap answers can get upvotes, when others that you lovingly pour your soul into get hardly anything: case in point.
 
10:58 AM
People can understand easy answers, so they know when to upvote.
Further, more people answer easy questions, so there are more views.
 
@Veedrac a BIKESHED!? I know those!!!
 
@Ffisegydd Tim was very nice on this one - good sportsmanship and all that...
 
11:12 AM
It's always easy to find outliers that show some absurd trend. Eg X vs Y. But I remain convinced that good answers on average get many more upvotes.
 
@Veedrac you don't sound bitter at the end of the "Y" post at all do you :)
 
Of course not...
maybe a little
To be fair, there are good reasons why my answer wasn't accepted. It's not just about asymptotic complexity.
 
umm.... gotta love politicians: lbc.co.uk/…
 
11:32 AM
Wow... a lot of Famous Question badges for this user
 
Is there any way we can get only the country part of the SO users' location field?
 
Using the API yeah... don't see why not
 
@thefourtheye the api has a location response, that's it
So you could attempt to parse the string
 
But I am finding it difficult to do that in data.stackexchange... Is there any way we can parse that in the query?
 
Something like this?
 
11:44 AM
When I give the input as india, it picks up results with indianapolis as well
 
@thefourtheye yeah... because it's a substring match :)
 
ofc. Well, I could filter those out with regex, but.. I don't think it'll be supported
few sql engines do
 
Exactly! Is this why we should normalize our DBs? ;)
@Jerry ya, Oracle has a function but it is not available in our site
 
You should create a generalised database that everyone agrees on insert relevant xkcd
 
Actually, I was asked by someone, something similar to that type of normalization. How can I store all the address fields in a relational DB without violating 1st NF?
 
11:49 AM
well, it's kind of hard to do that with user input. It's easier with dropdowns, listboxes and the like
 
What do you think is the less ugly way to do this?
# new_command = PluginDBCommand()
# new_command.__dict__ = deepcopy(command.__dict__)  # copy state
new_command = deepcopy(command)
new_command.__class__ = PluginDBCommand
(PluginDBCommand is a subclass of command's class)
 
@thefourtheye or you could run it without the wildcards: link
except you'll miss those who put things like Nepal, India
or maybe use %##Location##
now you'll miss those who say India, Nepal
 
Yup :(
Yay, wrote my first own query in data.stackexchange site :-)
afk
 
12:11 PM
@thefourtheye A negative rep doesn't always mean an unhelpful answer. I've seen some dv'd answers that actually helped the OP, but since few users looked at the question, there weren't many people to counter-vote it back up.
 
 
1 hour later…
1:16 PM
good morning friends
 
@corvid cbg
 
btw, Robert, I fixed that problem yesterday
 
cool, what was it?
 
delete the project and remake it, and it worked plenty fine
 
Ah :)
 
1:19 PM
I just added multi-build-pack, added nodejs, bower, and python to the builds, and pushed it. Everything installed fine, and it's up now corvidsite.herokuapp.com/#/about_me
Thanks for the help, by the way
 
Nice
Pleasure; moral support is essential when using Heroku :)
Nice site btw, did you use a template? :)
 
nah, just used some really generic HTML, I have shortcuts for bootstrap elements in sublime text
 
Hi! How to do this quickly in Python (I'm a bit struggling) :
convert hundreds of elements like
<item><text>blah</text> <x>23.23</x> <y>-12.13</y>  <size>51</size></item>
to
<item x="23.23", y="-12.13", size="51">blah</item>
 
1:36 PM
okay, dumb question, but when I want to add a model, is there a way to enforce regex on specific attributes when it's being made?
 
Is there any straight forward way to find only my deleted posts excluding the posts which are undeleted?
 
@Basj I recommend the xml.etree.ElementTree module.
You can use that to parse your input XML and discover its values
 
@Kevin yes! I'm doing it with lxml, which is not very far
 
Hey! I just found out SO has also a Python chatroom! That's totally bananas!
Sometimes the internet is actually a good place to hang out
 
1:51 PM
is there any reason why I get SyntaxError invalid syntax on simple print statements when they are inside exception-handling blocks? I just want to print a custom error
try:
    word = self._step1ab(word)
except IndexError:
    print word
^^^ gives `print word
^
SyntaxError: invalid syntax`
?
 
Are you using Python 3?
 
@Ffisegydd that was my initial thought, but no, 2.7
@Ffisegydd but it seems to want to use python 3 in try blocks
 
Look above the try to see if the SyntaxError is further up
An error further up the page can cause a SyntaxError further down.
 
@Ffisegydd must be, because if I use print(word) instead, it defers to another, later error
ahh crap, I just saw this library declares: from __future__ import print_function, unicode_literals
there's a good start
 
Hah.
 
2:04 PM
I feel like this chat needs some variable bound to a user as to which version of python they're using
because the question always comes up whenever anyone asks a question; "which version of python is this?"
 
chat.stackoverflow.com/rooms/441/python3
 
Hi guys, quick question: why does this happen? (py2.7)
In [34]: d
Out[34]: {'aa': 0.2, 'aaa': 0.5, 'bb': 0.5, 'sf': 0.8, 'z': 0.5}

In [35]: [(k, list(v)) for k, v in itertools.groupby(d.keys(), lambda x: d[x])]
Out[35]: [(0.2, ['aa']), (0.5, ['z', 'aaa']), (0.8, ['sf']), (0.5, ['bb'])]
I.e. it gives 2 groups with the same key (0.5)
 
group_by always is pretty confusing, imo... hmm
minimum annual salary. What are new grads supposed to ask for? Like 35k - 40k?
 
where?
 
anywhere, right now applying to BMW
 
2:19 PM
I mean, what country?
 
The mystical kingdom of Murickah
 
@iuliux Most likely, the 0.5 values are actually different, but have the same display value.
ex. one is truly 0.49999999998
 
@Kevin, no, they are entered manually
found the answer, and it's wierd
the iterable received by groupby has to be sorted
 
That was my next guess ;-)
 
yep, would've been a worthy mention in the docs
 
2:23 PM
FWIW, the decimal module is quite useful for investigating the true value of floats:
>>> decimal.Decimal(1/3.0)
Decimal('0.333333333333333314829616256247390992939472198486328125')
But yeah, a manually entered 0.5 value really is exactly one half
 
:)
@corvid, wow, so BMW now hires over EveOnline?
 
I am trying to find that comic where it is a captcha saying "prove that you are a robot, solve this math problem: 2 + 3" and his response is "5.00000000000000000001"
 
Floats aren't that imprecise :-)
 
but I'm too lazy to count zeroes :\
 
DSM
2:41 PM
Morning cabbage to all!
 
cbg @DSM
 
cbg @DSM
 
mornin DSM
 
I know it's not their fault, but "suggested me to" and "clarify my doubts" are the two most annoying translation errors from non-native speakers.
Unfortunately, it's usually correlated with a bad question.
 
It's weird changing languages, that stage of rewiring the thinking takes a long time
 
DSM
2:55 PM
And then one day you wake up and find yourself writing like Proust. [Disclaimer: has not yet actually happened to anyone.]
 
I went back to java this semester. Everything seems so bizarre compared to python and javascript :\
 
03:00 - 15:0015:00 - 00:00

« first day (1438 days earlier)      last day (3505 days later) »