« first day (1380 days earlier)      last day (3573 days later) » 
01:00 - 16:0016:00 - 00:00

4:01 PM
But what's the alternative to a full python process?
 
a C process? Multithreading?
 
@AaronHall Isn't multithreading problematic because of the GIL?
 
Not in a language that doesn't have it.
 
@AaronHall I thought we were talking about Python
 
You asked for the alternative. The alternative is not to use Python.
 
4:08 PM
@AaronHall Ah. I meant within Python.
 
That's it. That's all you've got. No other alternatives inside of Python. There is threading, but it only works in serial due to the GIL as you already know.
That doesn't mean you can't use Python as your glue and major architecture, you just have to sometimes manage subprocesses that aren't Python processes.
 
@AaronHall Sure.
Well, trying to track down the MP error. Fun.
 
4:29 PM
Looks like the problem is with the args, not the function.
 
the problem with python ofc is the shared mutable data
if the architecture is shared nothing then you do not need any locks
or share readonly
 
If someone is willing to give me a two minute primer in IPython debugging, I could use it. I've never used a debugger in my life, despite building pretty big (Java) things, and I'm only getting started with Python.
Specific question about it:
So I have this infinite loop:
def string_splosion(str2):
    i = 1
    output = ""
    while(i < (len(str2) + 1)):
        output += str2[:i]
    return  output

string_splosion("hello")
Can someone please show me simply how to set a breakpoint in the loop, so I can print the value of output on each iteration?
(The problem is that I'm not incrementing i.)
 
Never used ipython debugging sorry
@aliteralmind docs.google.com/presentation/d/… might help though
 
4:48 PM
Yeah, I've been watching videos and reading stuff, but it's just too much information at the moment. I just need a step-by-step trivial walkthrough to get me started. Haven't found one.
Will definitely take a look at the presentation. Thank you @Ffisegydd
 
@AnttiHaapala ofc?
 
@aliteralmind I know you're asking for a tool/technique to do so - but isn't it obvious by the code itself?
 
Does anyone actually find debuggers useful? I use print statements.
 
I'm trying to learn how to debug. I've never done it before. I figured this obvious error was a good place to start trying it..
I've been using nothing but System.out.println()s (Java) for a decade. :)
 
Out of curiosity what is that function meant to even return?
 
4:54 PM
@aliteralmind why don't you use for ... in ... range
 
Eg. What's the output of "hello" supposed to be
 
It seems pickle doesn't like a constructed SQLAlalchemy object that I'm passing as an argument. This argument is pretty much a constant - is there some way of making it available to the function without passing it around via pickle?
 
@FaheemMitha depends of the object, you could pass its pk instead
and then use get() to fetch it
 
@AnttiHaapala pk?
 
4:55 PM
primary key
supposed it is a model object
 
@aliteralmind then you're approaching it in the wrong way to start with
 
@AnttiHaapala Hmm, right. This is a synthetic object, including stuff like model, right. I still have to look it up from somewhere, so that pushes thing back a step.
Maybe some kind of shared memory thingy?
 
@JonClements I appreciate the advice, and I definitely would like to consider what you're suggesting. But at the moment I'm just trying to figure out debugging.
 
Time to look up documentation, dammit.
@aliteralmind Is the ipython debugger different from pdb?
 
def string_splosion(txt):
    return ''.join(txt[:i] for i in range(len(txt) + 1))
didn't need a debugger.
 
4:59 PM
Fair enough - I tend to only debug what appears to be correctly written lines of code (using pdb) - not those that are immediately visibly wrong
 
@aliteralmind first code everything right, then when you want to debug, you can use the pdb to setup breakpoint in code
just do:
import pdb
def string_splosion(str2):
    i = 1
    output = ""
    pdb.set_trace() # <-breakpoint here
    while(i < (len(str2) + 1)):
        output += str2[:i]
    return  output
 
What @Antti said ;-)
 
@AnttiHaapala Nice splosion function :)
So is pdb.set_trace() a Python thing, or an IPython thing?
 
@aliteralmind you need to unlearn all java
pdb is a python debugger in standard library
@aliteralmind never use a while loop.
except... when you cannot think of anything else to use
 
@Antti well while True in generators is a good use - but struggle to find another one
 
5:04 PM
@aliteralmind pdf is the Python debugger but ipdb is the iPython debugger.
I assume that ipdb uses pdb internally though.
 
@aliteralmind the thing about pdb is that you can run the script on command line
and it will still drop you to debugger on that set_trace line
 
Okay. Let me give it a try...
 
So, it running pdb better than print statements?
 
well easier than write 2000 print statement to set 1 pdb break point
@FaheemMitha 1 project we have, 10k line python
there are 448 for loops or list comprehensions
9 while loops :P
 
@AnttiHaapala That's a lot of loops. So pdb is pretty usable then?
 
5:16 PM
nope, my point is
one never needs while, almost
 
Gentlefolk, why does the notification bell sound different here than on other chats?
 
sorry 7 while loops :P
1 of them is while True
 
@AnttiHaapala Oh, is that your point? I thought we were talking about debugging.
 
@FaheemMitha wrong highlight :D
 
@AnttiHaapala Ah
 
5:18 PM
@FaheemMitha yes using a proper debugger is "better" than print statements but sometimes using a print statement is perfectly satisfactory.
 
@aliteralmind 1 project we have, 10k line python
there are 448 for loops or list comprehensions. 7 while loops
 
@Ffisegydd I used to use gdb once. But at least at the time it could not cope with C++ constructs. No doubt python does better.
 
say if you do not have a console :P
where to control the debugger...
@FaheemMitha actually if you use python-dbg, gdb can debug python pretty nicely too
 
Right, that can be a problem. Like some embedded thing. Or web programming
 
that is say on ubuntu install python-dbg...
 
5:19 PM
@FaheemMitha web programming have their own debuggers.
I love the Flask debugger.
 
@AnttiHaapala Oh?
 
on web programming: pyramid_debugtoolbar say
 
@Ffisegydd Depends, I tried using Django. I ddin't see no debugger.
 
So you did see one? (Grammer joke, shoot me)
 
@AnttiHaapala You use pyramid? Is it good stuff?
 
5:20 PM
Grammar*
 
;)
 
cbg : )
 
I said grammer joke, not a spelling joke.
 
hehe
: )
i was scared to have offended :D you, glad you took it as a joke!: )
 
5:22 PM
@Ffisegydd Attempt to use the vernacular to sound homespun and folksy. Apparently not working on this audience.
 
@FaheemMitha in my course of life I have seen so many web frameworks. All of them have made me cry. However with pyramid they are tears of joy :P
 
@AnttiHaapala That's nice. Is Ben Bangert still working on it? He seemed like a good guy.
Well, he presumably still is...
 
I do not know, maybe not really
 
@Ffisegydd Now I think it's a good tiiiiiime. To learn some "grammar". Now did I stammer? Work on that grammar. :)
 
@FaheemMitha afaik he sort of sidestepped
 
5:26 PM
@AnttiHaapala sidestepped?
 
:P does something with go now
 
@AnttiHaapala Don't follow.
 
golang
 
@AnttiHaapala oh, right, so Ben does not work on web frameworks any longer? Shame.
 
but there's Chris McDonough aka mcdonc who is just there right above the god
 
5:29 PM
@AnttiHaapala Don't know him.
 
bc he is of zope folks
you should pop to IRC at freenode, channel #pyramid
this is a good pres
 
@AnttiHaapala well, since I don't use it, I wouldn't have much to say. but sure, why not. I often idle on #freenode.
 
djangocon pres by mcdonc
 
@AnttiHaapala Yes, I see it.
Thanks.
 
5:52 PM
@AnttiHaapala On of the many things I disliked about Django is that it kept breaking its API. Is Pyramid better? And how does it compare with the old Pylons framework?
 
pyramid api is sort of that they deprecated old stuff but it is stabilizing
and compared to old pylons, old pylons was very brittle because of the superglobals (request, response etc...)
but pyramid fixed about it all
it is like took all lessons learned from pylons
 
@AnttiHaapala Ah, interesting. Always good to learn lessons.
 
we had a project on pylons/turbogears 2
we migrated it to pyramid, in live... in increments
and when we were done we were like "whew".
bc it simplified our stranger code a lot (localization, middleware etc).
 
@AnttiHaapala I see. That does sound like a strong recommendation. I suppose Flask is much smaller, right?
 
I haven't used flask. I used turbogears and django before and after that pyramid.
but I am sure that I prefer pyramid over flask for what I have seen in the docs
 
6:00 PM
@AnttiHaapala Ok. And how stable is the pyramid API?
BTW, does web development pay decently these days?
 
I do not know about pay
I live here in 7th circle of hell :D
 
@AnttiHaapala ok
@AnttiHaapala ??!
 
Oulu Finland is the ground zero,
 
So you don't live in Finland? :-)
 
microsoft nuked the city last week :D
 
6:02 PM
@AnttiHaapala You lost me.
So, is Pyramid a better model than Django overall? I never liked Django. Too damn inflexible.
 
the company formerly known as nokia and broadcom announced layoffs of 1000 in here last week, no one seems to be willing to hire anyone anymore :d
yes, definitely. nothing is more flexible than pyramid
except maybe some java abomination like spring, but that is too flexible
 
@AnttiHaapala This is in Finland?
 
my hometown
200k ppl, over last yr like 5000 hightech laid off and none employing
 
@AnttiHaapala Nasty. What is its name?
 
OUlu again
every jobs seem to be 600 km away
don't want to move right now but really hard to get contractor stuff that can do remotely
 
6:06 PM
@AnttiHaapala Oh, right. sorry.
 
Haha, I've was close to there a few years back
I was *
 
@AnttiHaapala Is this hard in general? Of for what you do?
 
dunno exactly.
there are lots of those "startups" now
but none of them have any money :D
 
@AnttiHaapala :-(
 
just before the Eflop was imported from canada as the CEO of Nokia everything was quite fine :D
in the tech industry here
 
6:08 PM
@AnttiHaapala Eflop?
 
I noticed that everyone in Finland really felt like Nokia was their own. Up until Microsoft came in.
 
@agam360 Not getting the MS connection. Did MS buy Nokia? If so, condolences.
 
not rly like that
but there was lots of subcontracting
but Eflop then gave the midfinger to everything
 
@AnttiHaapala Who is this Eflop? New CEO?
 
@AnttiHaapala, how is the Army in Finland helping the tech industry, is that a thing?
 
6:11 PM
google.fi/… yes the new old ceo
@agam360 not at all
 
Looking at oulu, looks like a place that is freezing all the time. I don't think I would enjoy it.
 
yeah, right now like 30C
+
 
Oh, I see his name is actually Elop.
@AnttiHaapala Well, it's summer, I guess.
 
anw, 1/2 of tech companies got substantial amount of income from nokia synergies
and then this idiot comes and says "we are selling crap, all jump through windows"
 
Sorry to hear about Nokia. I didn't know.
@AnttiHaapala The idiot being Elop, I presume.
 
6:15 PM
yes
Stephen Elop (born 31 December 1963 in Canada) is the Executive Vice President of Microsoft's Devices & Services business unit. In the past he has worked in Nokia as the first non-Finn CEO and later as Executive Vice President, Devices & Services, as well as the head of the Microsoft Business Division, as the COO of Juniper Networks, as the president of worldwide field operations at Adobe Systems, in several senior positions in Macromedia and as the CIO at Boston Chicken. == Personal life == Elop was born in Ancaster, Ontario, Canada. In his spare time, he is an avid recreational pilot. He filed...
ah there's a hash there in the link
@FaheemMitha and no, ms didnt buy nokia, only mobile phone development
 
@AnttiHaapala ok
 
they wanted to make sure nokia cannot compete with m$ using yet another platform
 
@AnttiHaapala I see.
 
but what is left is just a ghost here :D
used to employ 7000 ppl directly in my hometown
and indirectly another
due to all structuring they then fscked up all those jobs exactly here :D
 
6:33 PM
cbg
 
@AnttiHaapala Sorry to hear that. But you don't work for Nokia yourself, do you?
 
cbg @jon
 
@JonClements lemongrass
 
My brother's birthday, so popped around to give him his prezzie, we went out for a meal and had a pint (or two)
 
@JonClements That's nice.
If your profile didn't say so, that sentence would be enough to tell you were English.
 
6:37 PM
cbg
 
@FaheemMitha no, but I want to change jobs.
 
went to a Mexican... more spicy food than I'd normally appreciate, but... enjoyed the time
 
I am working for a startup that was dead at birth
 
@FaheemMitha oh ?
 
@AnttiHaapala Right. So, less options.
 
6:37 PM
and doing some gigs too
 
@JonClements Yup.
 
in city with 2000 unemployed software engineers
 
@AnttiHaapala Sheesh
 
no one exactly calls home and says "come to work here" :d
 
@AnttiHaapala you up for remote working ?
 
6:38 PM
@AnttiHaapala what kinds of gigs?
 
yes, I am doing that half the time
I have 80 hours / month for 1 engineering company
I do a cad system in java for designing railway signalling systems
they pay me less than a php developer gets here
rly the only contract position in my hometown on web programming i have seen in ages
was the local newspaper kaleva.fi wanted 3 months of webdev in django...
 
I don't take less than £60 an hour...
 
that was like more than 1 yrs ago
usually they contact companies directly, but I do not know who :d
but I am also tired for working for old style consultancy companies
in oulu they just sell skins
all the good ones I would have to move :(
there are lots of gigs in helsinki
but they are always 100 % load and at least some months
which means I would have to live in a hotel or try to rent a ridiculously priced apartment
and my wife wouldn't be too happy either :D
--> move :D
maybe I should move to UK or germany
or try to get to work for google
btw, this is the coolest startup at the time in Oulu
 
6:55 PM
@JonClements Is that good pay for the UK? I guess it depends on location.
@AnttiHaapala moving sounds reasonable under the circumstances.
 
no one wants to buy apartments in Oulu :d
 
@AnttiHaapala :-(
 
@AnttiHaapala Why the anti-while loop?
 
@aliteralmind bc there is a thing called "pythonic"
and while loop is antipythonic
it is the "javaic" solution
 
Hm.
I don't use whiles that much in Java either. I'll keep it in mind.
I'm going to try to figure out the problem again without looking at your one-liner. @AnttiHaapala Thanks for the tips.
 
7:06 PM
the solution there also does not use while loop
on the page
 
7:22 PM
0
Q: List stock data by weeks and days using Python

Philipp BraunI would like to list different stock data which were published in one week. The stock data should all be in seperate arrays. The different array elements should represent the different days and the arrays itself should be the different weeks. So for example week_1[55.5,23.1,234.8,,23.6]. The code...

 
Anyone know how to eliminate single items from the command history (what you've typed), and to reorganize history items?
In IPython
 
trying to find, never had a need
I use the control-r to search for items always so does not matter
5
Q: How to open ipython command history on a text editor?

Feng MaiI am using a windows machine and would like to open ipython history commands using the default text editor. Is there a command that allows me to do this? Thanks.

 
7:36 PM
@AnttiHaapala Got it. Doesn't seem to be a way. I feel like it's a big missing feature, but I'm sure I'll find something eventually that replaces it or renders it less important.
 
I don't believe you can remove anything, and even if you did the line will have still been ran if that makes sense?
So you could remove it from the history but not the effects.
You need to reset the kernel which resets all commands
(Well the kernel is for the notebooks at least, not sure about ipython terminal itself)
I don't really understand your use-case for wanting to delete previous commands though.
 
@Ffisegydd When you mistype a command/line of code that you use a lot, and want to get rid of it. Such as %edit working.oy (should be .py)
 
You mean just remove it from view?
 
If I'm understanding you, yes. Just remove it from my IPython history, as I view it.
 
I see. I suppose I've never cared if I made a mistake in the past so never thought about that.
 
7:55 PM
1
A: Closing a file descriptor I've used with fdopen

Antti HaapalaIn Python 2 and normally in Python 3 the file is opened with fdopen the C standard IO owns the file descriptor. When the file is closed with fclose then the underlying descriptor is also closed. Thus the file is closed at the end of the with block. The linux manual on fdopen(3) says The fdop...

I learned something new today :d
 
@AnttiHaapala Not quite as elegant, but better than my original while :)
 
@aliteralmind almost the same as the solution on the web page
the web page had 1 difference to this :P
 
def string_splosion(str2):
     output = ""
     for i in range(len(str2) + 1):
          output += str2[:i]
     return  output
 
yours (and mine too) do add '' in the beginning
(needlessly)
 
def string_splosion(str2):
     output = ""
     for i in range(1, len(str2) + 1):
          output += str2[:i]
     return  output
:D
 
8:00 PM
yeap, that is acceptable
 
@AnttiHaapala Nice meeting you, and thanks for the help. Bye.
 
8:28 PM
Ok, multiprocessing sucks. Or maybe pickle sucks. Apparently a decorator is enough to make it freak out.
 
 
3 hours later…
11:06 PM
@AnttiHaapala is this your startup? I think you should work on the design of the site :p
 
01:00 - 16:0016:00 - 00:00

« first day (1380 days earlier)      last day (3573 days later) »