« first day (1385 days earlier)      last day (3570 days later) » 

5:00 PM
anyway @Kevin I guess I will try threading first, and if it is still slow as hell, then I move on to multiprocessing -- if I didn't misunderstand you threading is a bit easier then multiprocessing
 
@PeterVaro The "does it block entirely?" question would be solved easily enough by trying it out and seeing. the "does it make downloads slower?" would be harder to prove.
I certainly believe that communication is easier in threading, since objects can be shared between threads.
 
okay, then I try threading then, thanks!
 
DSM
No, C++ exception. That it was a PEBKAC issue doesn't mean you're forgiven.
 
Can't star from phone :(
 
I think some Wikipedia editor made this paragraph intentionally depressing. "Here and there, a wooden box with a vitrified cover a few fading artificial flowers and other decorations can be seen. Crosses stand askew on the shifting permafrost."
Did we really need that reminder of the impermanence of things?
 
DSM
5:05 PM
It's a little Ozymandian.
 
@tristan You have to admit - the brits do (possibly the best in world) comedy well :)
 
user559633
My lawyer has advised me to never admit or apologize for anything.
 
user559633
But yes, Britain does put out possibly the best comedy in the world.
 
Depends on the medium, I think. I admit your superiority in sketch comedies and black humor sitcoms, but I can think of more American standup comedians, than British.
(although perhaps I'm biased because I exclusively watch American tv networks???)
 
DSM
I don't know if people outside of the Anglosphere feel the same way about British comedy.
 
5:16 PM
I watched George Carlin's 2001 special, and I've never had more fun listening to swear words and descriptions of crusty scabs.
 
user559633
is it possible to under a git checkout?
 
oh, I quite like George Carlin - and what's that guy with the puppets? One of them being (insert name here) the terrorist?
 
Hmm, what's his name... Jeff something?
Jeff Dunham, that's it.
 
@tristan checkout the previous branch, or reset the head back one
 
user559633
:( the changes were uncommitted. to the backups i go!
 
5:18 PM
I have mixed feelings towards him. Laughing at a joke and then getting mad that I laughed at such a dumb joke.
 
@tristan confused then... how did you checkout without them having been somewhere and having had a previous commit?
 
user559633
the file had commits and previous revisions. was working on a local copy and accidentally hit the up arrow, which landed on a git checkout !$
 
Maria Bamford best comedian
 
In high school I watched some comedian's special and it was funny enough that I couldn't breathe for about half a minute.
Wish I could remember his name. Darn that pesky memory loss due to oxygen deprivation!
 
I might know who it is... remember any of his act?
 
5:24 PM
@DSM you have a problem then you use C++, now you have 2^n problems
 
I quite liked Bad Education
 
Nothing whatsoever of the act, only its effects.
 
if one reads C++ FQA then one realizes that C++ exceptions cannot be caught in C++
 
i have a few files. A gui and some few scripts. How am i able to get the gui to open up cmd so that i can get variable(the text) from my gui and pass it to the cmd with the script i selected?

For example,

i got the appended string from variables i got from my GUI ( gui.py) `Tonight.mp3 16 00:00:00 00:00:00 G` and then selected the desired script (segmentation.py)

finally, i need to pass it to cmd

which is

segmentation.py Tonight.mp3 16 00:00:00 00:00:00 G

What is your advice? i know i have to use subprocess
 
The Amazing Johnathan?
 
5:27 PM
Maybe it was Todd Barry... Or Jim Gaffigan? It is a mystery.
@user3817491 subprocess.call(name_of_script_to_call, arguments)?
 
ughhgghh.... pet peeve when I get an h in my name (well the one that isn't/shouldn't be there that is)
 
user559633
John? edit: not sure why my brain was like "Ha ha! Jo*H*n isn't a name!"
 
That's rough. I'm lucky that I get "Kelvin" like once every three years and that's it.
 
DSM
Kelvin would be a great name.
 
That H is like an appendix. It doesn't do anything, may as well remove it.
 
5:30 PM
Everyone spells Keiron wrong
Apart from me
 
I-E transposition is tricky to get right.
 
DSM
True, I'd have guessed Kieron.
 
Hell my legal, official name is Kerion because the registrar spelt it wrong on my birth certificate.
 
DSM
Hah.
 
Kevin it's also o/a and C/K
 
5:32 PM
Did you know, there are more exceptions to "I before E except after C" than there are words that follow it?
 
@kevin i do not need to open cmd?
 
Generally, no
 
user559633
thank guido for backups
 
@Ffisegydd Oh come on - I got the K right, I just didn't get the i and e in the right order :)
 
@Kevin alright,thanks :)
 
5:38 PM
 
That's exactly the clip where I learned that fact :-)
 
def printing():
commandline = a + " " + str(chunk.get()) + " " + str(start_censorship.get()) + " " + str(start_censorship.get())
print commandline
subprocess.call("segmentation.py", 'commandline')
" raise TypeError("bufsize must be an integer")
TypeError: bufsize must be an integer
"
i keep getting this error
 
Think you've got some extra quote marks there. Did you mean subprocess.call("segmentation.py", commandline)?
 
yes
bascially, i need to make a command line "segmentation.py Tonight.mp3 4 00:00:00 00:00:00"
 
DSM
Apart from the extra apostrophes Kevin pointed out, I think the call signature is more like call(['segmentation.py', 'Tonight.mp3', '4', ...]).
 
5:45 PM
but i can't hard-code my variables
 
This post may be useful, as he is getting the same error you are
You don't need to hard code the variables, as long as they're all in a list.
 
Wow.... what we were talking about the other day about doing jobs that aren't needed to be done
 
You could do subprocess.call(["segmentation.py", a, chunk.get(), start_censorship.get(), start_censorship.get()])
(I'm assuming all of those gets return a string. Convert as necessary.)
 
i read that a while ago,i am quite new to python so that article was like "wow what's that"
okay :)
i will try and let you know if i have any errors later
 
DSM
Time for naan. And some stuff to dip it in, I suppose.
 
5:50 PM
Exception in Tkinter callback
Traceback (most recent call last):
File "D:\Python27\lib\lib-tk\Tkinter.py", line 1486, in __call__
return self.func(*args)
File "C:\Users\Xavier_\Desktop\xavier\segmentation_GUI.py", line 115, in printing
subprocess.call(["segmentation.py", a, str(chunk.get()), str(start_censorship.get()), str(start_censorship.get())])
File "D:\Python27\lib\subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "D:\Python27\lib\subprocess.py", line 710, in __init__
 
We're having Indian too.
Chicken Dhansak.
 
Say, I don't suppose you could rewrite segmentation.py so you could just do import segmentation; segmentation.segment(a, chunk.get(), start_censorship.get())?
Thus eliminating the need for subprocess entirely.
@JonClements I wish my own rants were of that caliber :-)
 
i cannot write that because for "segmentation.py" i have sys.argv[1],etc written in it
 
There's a way to write a script so it can be both imported or invoked from the command line. One moment.
 
okay sure
 
5:59 PM
@Kevin this is quite a good one - hadn't realised before
 
I'm guessing the script is doing something like:
import sys

#do segmentation
song_name = sys.argv[1]
track = sys.argv[2]
start = sys.argv[3]
end = sys.argv[4]

#insert segmentation code here - open the file, cut it up, save it, etc
But you could refactor it to be like:
import sys

def segment(song_name, track, start, end):
    #insert segmentation code here - open the file, cut it up, save it, etc


#the contents of this if block are only executed
#when this script is run from the command line,
#not when it is imported by another script.
if __name__ == "__main__":
    song_name = sys.argv[1]
    track = sys.argv[2]
    start = sys.argv[3]
    end = sys.argv[4]
    segment(song_name, start, track, end)
Subsequently, you can import segmentation and it won't care about the contents of sys.argv, only what you explicitly give it when you call segment
@JonClements Alas! Not available in my country.
 
import sys
import subprocess


def get_total_time(filename):

proc = subprocess.Popen(["ffmpeg", "-i", filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
lines = proc.communicate()[1]
target = [line for line in lines.split('\n') if 'Duration:' in line][0]
time = target.split('Duration: ')[-1].split(',', 1)[0]
return time

#change hh:mm:ss to seconds:
#l is an array of 3 strings['00','00','20'], int(l[0]) converts string to integer. l[0]= hours l[1] = mins l[2] mins.
#multiply mins by 60 and hours by 3600 to get seconds
mine is like this
a short part of it
 
haven't used regex very much in python, how do I do a simple "does it match"?
 
Yeah, so all the bits starting with if len(sys.argv) < 4 would go in if __name__ == "main":
 
I know I can do re.match(pattern, string).group() to get a capture group
but how do I do a simple match
 
6:05 PM
@Humdinger IIRC, match returns a truthy object on a success, and None otherwise, so matched = bool(re.match(pattern, string)) ought to do it
 
ok thanks
 
If you're using the value right away, if re.match(pattern, string): suffices, no explicit bool call required
 
so simple I missed it... thanks
 
let say i want to stick to command line, how do i use subprocess, having the string of "Tonight.mp3 16 00:00:01 00:00:01" and the file "segmentation.py"
so i know "subprocess.call(["segmentation.py", a, chunk.get(), start_censorship.get(), start_censorship.get()])" is a good example
 
I'm not sure what's causing %1 is not a valid Win32 application. maybe you need shell=False as the final argument to call?
The vagueness of that error is what prompted me to steer you towards import, since I'm lazy and I think it's easier than subprocess.
 
6:19 PM
Sometimes you have to disappoint someone: sorry, you cannot do that at all.
Nope, you cannot use Google charts in Twitter photo cards: stackoverflow.com/a/25076393
 
I have a hard time telling people "you can't do that"
Conceivably, they could get a job at Google and modify the Charts API so it integrates with Twitter photos.
I'm more comfortable disappointing people that want to solve the bin packing problem in O(log(n)) time. Not even Google can change that.
 
That's what you think...
Using the Googlputer, anything is possible...
 
But can it simulate a rock so large, that it can't simulate it?
 
xD
 
Yes.
 
6:30 PM
Ok, that all checks out then.
 
getting sick and tired out helping mates our with their mortage
 
:-(
 
user559633
woof.
 
Sounds like a rough situation. I think we've discussed this previously.
 
user559633
do you expect to see that money again?
 
6:35 PM
my sassy cats are so sassy
 
@Kevin yes we have... I've done it one last time... no more - it ends now
 
nods. Total support, dude.
 
@tristan nope - never expect it back
I also don't expect to see on facebook "we're off the isle of wight" or "we've gone to a theme park" or "we decided to have pizza [at a faily expensive restraurant]"
 
user559633
Woof and or bark.
 
:/
 
6:39 PM
How do people not get that if you don't have money, you can't spend it...
 
I blame credit cards. It removes the cause (spending too much money) with the effect (getting evicted a year later).
 
user559633
because people have bailed them out i suppose
 
Proper negative conditioning requires a far more immediate response time.
 
@tristan this is their last chance though... not doing it again
 
Slashdot had an article yesterday, claiming that 35% of Americans have some kind of debt that collection agencies are pursuing... It's crazy.
 
user559633
6:43 PM
Wow. 35%.
 
dinnertime
 
user559633
Last time I was in debt, I was 20.
 
cheers all, see ya'll later.
Rhubarb.
 
i am trying to check whether a variable was supplied or not in my function
 
Enjoy
 
user559633
6:43 PM
Later @MartijnPieters, have a good weekend
 
it will either be a string... or not supplied at all
 
What does the signature of your function look like? As in, what comes after the def?
 
user559633
post your code @Bubbas
 
user559633
i aint guessing
 
def Export(Level,where=""):
    if where in locals():
        #do shit with where string
 
6:45 PM
You might check whether where is an empty string or not using if where:. This returns False for "".
 
i tried that first
i actually did if not where
 
user559633
def Export(Level, where=None):
    if where is not None:
        print "no thanks, i'll where it out"
 
^this is also good.
 
+1 Imaginary Internet Point for @tristan.
 
is None a python keyword?
 
6:45 PM
cant you just do if where?
 
brb
 
@Bubbas Yes. None is a python keyword
Its like a "null"
 
ok
 
user559633
@Humdinger if where is false-ish, it will cause issues. e.g. I pass it 0 or False
 
I grew up in a family where mum and dad had to take it in turns to eat the evening meal, but they always made sure I had one. Quite annoyed that a mate of mine puts fun days above their mortgage and their food bills
 
6:47 PM
thats true... but if where is always expected to be a string is should work right?
 
user559633
yeah, that's really messed up @JonClements. I'd try to get that money back and then terminate that friendship.
 
user559633
@Humdinger maybe an empty string is okay.
 
seems to be working. thank you!
 
DSM
The only case in which you can't use None is when you might need None as a value. That's pretty rare.
 
i learned a new python keyword in the process as well :P
 
user559633
6:48 PM
No problem @Bubbas, but you would really benefit from doing the python tutorial docs.python.org/2/tutorial
 
i undertand
 
user559633
At least an hour or so will solve most of the questions you'll have next.
 
python introduced me to code in general a couple years ago
i dont use it much anymore :/
 
user559633
python tutorial
 
but, i will still heed your advice
Lol!
so creepy
 
6:49 PM
im not quite sure what to think of that gif...
 
user559633
hahaha that gif makes me so uncomfortable, but i can't stop laughing
 
yea thats....
thats pretty bad actually!
 
DSM
Image blocking tools are handy.
 
@DSM can you literally "point and click" an image away
?
that would be a neat tool
 
DSM
I tend to do it when people post animations. Even when they're not creepy, they're distracting. There was a zooming-fractal one which was hypnotic.
 
6:52 PM
replace with a blank div of the same dimensions of the image so it didnt screw your dom too much
lol, yes fractals
 
That was probably one of mine :-D
 
Bah.. @Kevin! there you go again!
 
1 message moved to Trash can
@tristan I've moved that to the trash as I found it very uncomfortable to be present in this room
 
user559633
:) Thanks!
 
I used to have a lovely firefox extension that could hide images with a single mouse swipe... Now I have to navigate a zillion menus to remove it with firebug
Or the built-in html inspector, either one.
 
6:56 PM
good ole DOM manipping
 
"An unknown error occured" - that's remarkably useful
 
This is why you have a PROBLEM light. So you know there's a problem, you see.
 
blah, rbrb... need to sort this out
 
lol people are funny
 
cbg
I need some help, I forgot something about python
I am not sure what this is called, and I need to find the docs on it
print('You owe %i dollars').(i = debt)
something where you can have a var in a string and point to it after the string
not sure what it is anymore
the code is just an example from my imagination
 
7:01 PM
@Vader % formatting operator, though you shouldnt be using it anymore
 
inline var?
 
you should use ''.format() for all new code
from here to eternity
 
>>> print "You owe {i} dollars".format(i=23)
You owe 23 dollars
 
this is the old
you should be using the
 
thanks guys
 
7:03 PM
print("You owe {i} dollars".format(i=23))
python 3 for practically all new code :d
 
DSM
I think it's usually called "string interpolation".
 
Format is the new hotness. percent is old and busted.
 
@DSM well... no...
 
:o
 
printf-style String Formatting
is the one used by new docs
 
DSM
7:05 PM
@Antti: I mean the general process of putting stuff in strings. See string interpolation, for example.
 
I guess it bears a slight resemblance to mathematical interpolation.
The format string is the equation, the bits in the curly brackets are the unknown coefficients, and the arguments are the discrete points.
 
DSM
I think it just meant it in the sense of putting stuff in other stuff.
But your analogy is impressive. :^)
 
Don't look at it too closely. It's like a Magic Eye poster, and you'll lose the sailboat if you stare too long.
 
user559633
I like the % formatting for strings,.
 
DSM
Oh, man! I remember when those came out. It was like a cult. A friend brought in a black and white one from the back of Scientific American or something, just a small ad, and tried to convince us all that it worked. I was initially sceptical.
 
7:12 PM
@tristan Stop liking things I don't like!
 
user559633
"{something} blind mice".format(str(mice_int)) is bland compared to "%s blind mice" % mice_int
 
You can be lazy like me and skip the something: "{} blind mice".format(mice_int)
 
DSM
Aargh, I was just writing that.
 
still longer than %, though. I have no excuse.
 
user559633
Sure, but if you have to resort to "{0}, {1}".format(thing, other), than you lose functionality for no real improvement in readability
 
DSM
7:17 PM
No need to write the numbers if you don't want to.
 
I probably just have residual feelings from C++, where I thought stdout >> thingIWantToPrint was the dumbest syntax in the world. >> is for bit shifting, not for printing! % is for modulus, not providing arguments!
 
user559633
Yeah, so then you have a moustache convention
 
DSM
... Friday afternoon before a long weekend. 15:21 local time, and everyone except me has left the office. I'm not sure what to think about that.
 
My coworkers are exhibiting signs of leaving early, but I carpooled today, so it's the usual departure time for me :-(
Darn my carpool partner's scrupulous punctuality!
 
I use to get in for 7, and leave about 8
am and pm respectively
 
DSM
7:24 PM
I could spend 13 hours at the office, but I wouldn't produce thirteen hours of work.
 
I couldn't produce 13 hours of work in any conceivable circumstance.
 
Anyway, eaten my Indian takeaway - very delicious - put "The Hunt For Red October" on the big screen, going to neglect duties of all sorts and watch that
 
good, good.
 
DSM
Who's the local Flask expert who isn't davidism?
 
Ummm. Crow?
 
7:27 PM
<starts to raise hand...> aw
 
rbrb
 
DSM
@davidism: that was meant as a courtesy, not a criticism. :^)
 
He's certainly asked a lot of questions about it, so I assume he must now have many many answers.
 
probably for the better, I should be doing work :)
 
DSM
Can we still call him Crow?
 
7:29 PM
Not really, if we want to maximally respect everyone's right to choose their own name.
 
I haven't the energy to not stomp on civil liberties today, though.
 
DSM
corvid, have you been collecting flasky knowledge?
 
shiny shiny knowledge.
 
DSM
shiny beakers of knowledge!
 
7:31 PM
"Sure, I've got a whole flask of it right here", reaches over, spills flask, "Oh no, my cabbages!"
 
I actually do have a flask at my computer
 
DSM
That'd be funny if it weren't so apt.
 
it says "why is the rum always gone -Captain Jack Sparrow"
 
Whenever I crammed for a test in college, I got a visceral feeling that my knowledge was contained in a wide mouthed container, and liable to spill out if I tipped over.
Then when the test ended, I would smash the metaphorical tankard on the floor, as its contents were now useless to me.
 
DSM
@davidism: oh no you don't. No after-the-fact salad wildcarding!
Annnyyywayyy, I'm looking for a good example of Flask -> JS -> Flask interaction, if any exist.
 
7:35 PM
I might be able to help, whatcha looking to do?
 
DSM
The use pattern I'm trying to implement is something like "click on JS widget" -> get event trigged in Python -> call pure Python function (which calls wrapped c++ library, which calls sql interface..) which returns data -> feed data into d3.js plotting widget -> see shiny, shiny plot.
 
I see, I've actually done that a lot
 
$('your-widget').click(function() {
  $.post(your-endpoint, function(data) {
    $('some_div').d3(data)
  })
});
 
DSM
@corvid: then you might be just the chordate I'm looking for!
 
7:40 PM
I should learn d3.js...
 
haven't used d3js but did it with highcharts a few times
then on the backend you could just do:
 
d3 does look pretty cool, but I feel like the data I have would be too boring for it
 
@DSM I know, I would not call python formatting a string interpolation, bc to me it SI means that of perl, php etc. Python does not have it :D
 
d3 is a bit like matplotlib. It's very customisable and can do crazy stuff but for simple stuff there are other, better, libraries.
 
(and it is not necessarily a bad thing)
 
7:42 PM
@app.route('/some/endpoint', methods=['GET', 'POST'])
def get_data():
   # ...
  return jsonify(data)
 
@DSM notice that there they didnt mention C, even though there is snprintf in C...
 
DSM
@AnttiHappala: all I can do is tell you what phrases are in common use, I can't make you like them. :^)
 
if someone comes and asks "does python support string/variable interpolation in stirngs", I say "no, but you can achieve the same with formatting ops"
 
@tristan He wouldn't fit in here :l He's one of those weird social people.
 
Ewww.
 
7:50 PM
Neurotypicals! crosses self, spits on ground
 
Google's 'Neurotypical'
Yeah, I know right?!
Oh, a cabbage related starred question reminded me of something I saw on Twitter. NSFW.
 
Oh those non-weirdos, with their lack of interest in Star Wars or model train sets.
 
Weirdness through not being weird, as being weird is purely through perspective.
 
This is true. Everything I do, is ordinary in at least one community somewhere.
Although I doubt very much there is a community that finds everything I do usual.
 
We do.
You're the most usual person I know Kevin Kevinson.
 
DSM
7:57 PM
We're raising what might be the first generation of human beings who may never have to wonder "am I the only one?" because five seconds later they can find the mailing list.
I'm not sure how this will end.
 
I think that's a good thing for the most part :-)
 
I am immune to electricity, but am not weird in Raj Mohan's eyes.
 
DSM
I remember reading about an anorexia support group once: not a group for support in overcoming it, but a support group about how to be a better anorexic.
 
@DSM Be a suffragist?
My brother pointed out that there is very often two consecutive conversations going on in this room. A stupid one, and a serious one. This is true.
 

« first day (1385 days earlier)      last day (3570 days later) »