« first day (1658 days earlier)      last day (3514 days later) » 

00:26
cbg
@AdamSmith time to quit using windows? I a gree
Does anyone know what the best way to get the file path of the file selected in a Gtk FileChooserDialog would be?
Obviously, there's the get_filename() function, but that only works within the function that the file chooser is started in.
ummmm no it probably needs to be called on the filepicker ... it doesnt have anything to do with what function you do it in ...
@JoranBeasley filepicker?
FileChooserDialog
Right.
Yes, that's how it works and that's what I'm doing. Problem is, I can't access that later on in the program outside of that specific function :P
00:36
then get the filename in that function and save it ...
or save the dialog somewhere
so you can access the functions later
How would I do that?
I've tried declaring a global in the function, and that just makes the FileChooserDialog stay visible even after the file has been chosen.
Same thing if I try a return statement.
self.path = dia.get_filename()
then you can just access it as self.path\
or myInstance.path
That's what I've tried, and it works, but the dialog stays visible after the user has chosen the file and I can't figure out why.
^ should display the same behavior.
Wait...wut.
It doesn't.
What is going on...
maybe go to sleep.... at this point i think the problem is existing between the keyboard and chair
I honestly can't tell why the code works fine by itself, but when it's mixed in with the rest of my code it doesn't work...
This is so strange.
00:51
I stand by my previous advice
It is pretty good advice
Yeah...I'm just so baffled by why it works by itself, and why it doesn't mixed in with the rest of my code, even when the variable is being used both times in the exact same manner.
So... IDE question *ducks*

I am introducing a friend to programming, primarily in python. I would like to introduce her with an IDE that has the following properties...

1) Simple and intuitive to make small 1-file programs.
2) One-button running, with output in a manner you can see.
3) Line-by-line debugging.
IDLE dude. Seriously.
I checked the wiki page already. Nothing seems to be what I'm looking for.
01:03
It works, has decent features, and is fairly simple.
IMO
Wait... does this editor... come with python?
I think so.
I like PyCharm, but introducing any IDE adds a learning curve
Also, the question should first be: what IDE is the friend familiar with?
I tried PyCharm, it's just more heavyweight than I was hoping.
None. She's a total noob.
Ah, personally I've had a lot of luck using Python Fiddle for teaching the very basics (meaning both basics of programming and Python)
01:08
Basically... when I think back to learning programming, I learned using RHIDE which was like the easiest thing in the world. I'd like that for her.
Wow, fiddle is slick too.
there's also repl.it but it only has text editor not code complete or other IDE like features
yeah, fiddle worked for some of my students as they didn't have to install anything, didn't need more powerful features or many modules, could just focus on coding basics, could use it at school or home/laptop - and could instantly share their coding problems with me for instruction....not good for real development but helpful for this teaching stuff :)
You're a teacher? Nice =)
nope, just tutor people
cbg @AdamSmith
user559633
cbg jg adamsmith
01:21
I really like fiddle. I think I'll go with that for now. Shame there's no line-by-line debugger though.
early on most new programmers can only handle print() for debugging anyway
user559633
^^ truth
user559633
i used print() for my first year of python development
I found step-line debugging illuminating for me when I was learning loops.
user559633
i used debuggers in other languages before -- it was only until i ran into an OS specific issue that i moved beyond print or log
03:08
Cbg
03:20
I find 99% of the time print is sufficient for me
I think NinjaIDE is great for single file programs
I like vim for single file programs ;)
I'm trying to use vim less
I used to hack in nothing but vim
heh...I still use vim for note taking in class
03:40
I use vim for non-coding crud like that. I end up building csv files by hand fairly frequently for work and use vim for that
inoremap <Tab> <Space>,<Space> is actually in my .vimrc haha
building csv? or rebuilding broken ones?
building them. We have a stupid broken ugly piece of database software that is often easier to make a csv to import into than to try and create new rows through the application itself
ouch, I usually just have to fix bad excel files
easier to do "/search term; f ,; .; .; a" for fixing errors then find and replace methods - fields are to variable
anyway rbrb, time for bed. to rest my weary head
03:56
night @JGreenwell
04:18
Alright, I'm stumped and have resorted to that most shameful of actions. Posting a question on Stack Overflow :(
04:29
And less than 10 minutes later someone solves it with a[n originally] snide comment. At least it's fixed
05:23
lo
I could not get this point in this answer: The real issue here is that in par1, your r1 and r2 intervals both appear on both sides of a division operation. When your division function computes the reciprocal of its second argument, it reverses the order of the interval boundaries, so the upper bound of the input effects the lower bound of the output.
@overexchange then read it again and again until you get it
06:20
am not getting this point in the above para: it reverses the order of the interval boundaries,
then read it again, what does it help if I get it for you
that is your assignment
to understand why the result is incorrect
you asked it on the main site and got the answer you wanted for but the problem is that you want us to interpret the answer for you
@AnttiHaapala that's lot of questions ;)
lol "5 delete votes left" :D
@Vyktor then get more rep :D
stackoverflow.com/questions/19452601/… FIRST GOOD SYNTAX ERROR WORTH LEAVING OPEN.
stackoverflow.com/questions/24291621/… this is so nicely formatted :D maybe it will get a dupe :D
06:37
@AnttiHaapala donate some with bounty :D I worked with php for 8 years... and I just got sick of that and now I work with python/C# (bit of asm) and I just don't have level required for posting insideful answers... So I'm stuck with the same rep for a while now...
no, the problem is
I have the feeling I need to really grind for the rep
Wow, should ser=serial.Serial("/dev/ttyUSB0", 115200) work on Windows?
the more insightful answer, the more certainly it will stay at score 0 forever
@vaultah dunno, maybe it does translate the filenames, otherwise very doubtful
0
Q: Image transmission and reception over usb port using python

Shamsudheen PadathI am totally new to python. I am using python 3.4.3 and I have been trying to transmit data to usb to a LED driving circuitry.I want to modulate data which is reaching to the usb port. I have a usb to serial converter installed in my system. can anyone suggest a programme code for the same. The p...

06:48
@AnttiHaapala you're probably right... I've just spend 2 hours playing around with python interpreter and gdb to figure out few things around bytes/bytearray and created long detailed answer... I guess its stays score=0 forever :D
of course
it's not about the rep, it's about getting better at using certain tools...
I mean: the fact is that is not getting the upvotes anymore
guess everyone is fancying the or or so :D
@Vyktor for example I have better upvote ratios from C, Java, C++ etc... than from Python
I answer a very simple question in any of them and get more upvotes than from 4 python answers
1 reason could be the crap coming to , ppl don't want to read it anymore
we need the canonical parentheses missing and colon missing syntax error post
stackoverflow.com/questions/29842758/… guy is getting errors from `` repr backticks :D
-1
Q: Wannted to write a python scripts and describitions are as below

HelloRWannted to write a python scripts and my scripts will take input in command line arguments as two files named as "inp_date_time_range" , "inp_pattern_to_be_serached".The files contained are as below. inp_date_time_range ( This input file can be more than one values ): ('Jan 01 02:32-Mar 31 23:31...

6k chars
downvote pls :d
@vaultah cv pls fast, kasra edited that ^, now it will get an answer from him
Hey up
@AnttiHaapala voted already :d
@Ffisegydd hurry up :D
put on hold as off-topic by vaultah, Antti Haapala, DNA, Kasra, Ffisegydd just now
lol :D at least Kasra was there
Cbg :)
prff
07:49
prff?
3
Q: Appropriate use of "nascent" on chatroom FAQ page

royhowieOn the chat.stackoverflow.com/faq page, under the Why don't you guys just use IRC, man? section, the IRC client is described as "nascent": We're trying to build a system better and easier to use than IRC, that is native to modern web browsers. Will we support XMPP? We're not sure yet. In the ...

LOOL :D
upvoted
@AnttiHaapala I'm just casting close votes like crazy :D
good for you
you should be :D
actually I should start using my 40 all the time... on the review queue
"You've reached maximum of close votes, come back in 16 hours" :D
good :D
think about it if every one of us really used the 40 every day :D
07:57
Umm... or maybe for gold tag badge holders - not only do you get a dupe hammer, but either more close votes for that tag per day or something? :p
yeah
write a post and I'll upvote
I have a headache
I would upvote it too...
It's already been suggested
It was suggested for silver badge holders actually.
(I am happy as a child... for the first time in long time I have answer that I am proud of... whee)
@Ffisegydd ahhh... that'd be good... I know there's been a lot of suggestions on meta...
07:59
@AnttiHaapala you should drink more
I think I am at a point that if I have 1 beer I will have headache (yeah yesterday I did drink 1 pint)
is there a way to bounty on meta?
lol, I had 4 with my sister 2 days ago
since there is not, then maybe should raise discussion on it
@AnttiHaapala no bounties on per-site meta's, no...
pfft
the python situation is intolerable
I guess many do not notice it but since I have these 3 month sprints every now and then only, I notice that getting rep is much harder, except for repwhores
and we are pretty much drowning in the repeated syntax errors now, that wasn't the case in 2013 say
08:09
Should bring back corporal punishment for help vampires.
@Ffisegydd nah... let's go for capital punishment!
hehe
Like this:
What makes you think you can remove it? You can't, it is the initializer for the Frame class that makes your object work. — Antti Haapala 19 secs ago
@AnttiHaapala that particular question shows lack of basic knowledge of python... but does it mean it's a bad question?
no I do not think it is a bad question excepting for the "unclear what you're asking" :D
08:15
I like this Welsh MP - I have no idea what she's rabbiting about on the radio, but with her accent it sounds great anyway :p
eh... 6000 dead and 13k injured in Nepal
08:38
@Vyktor who wants to shoot up in the numbers
that is not the last number I am afraid
09:05
@AnttiHaapala I think so too
colleague of mine was in Kathmandu 8 days before the earth quake
lol, the moment when you shutdown your computer because of low battery and windows starts installing updates :D
@Vyktor I'd be startled :D
like "how in hell do I have windows running on this computer"
How do I write a generator expression for this?
    result = interval(0, 0)
    for interval in seq:
        if  non_zero(interval):
            result = add_interval(result, square_interval(interval))
    if non_zero(result):
        return result
@AnttiHaapala I have 3 machines at home :D personal notebook (with archlinux on it), desktop for games and company NB with windows... long live the visual studio
@Vyktor I'd say "short die visual studio"
that has always been horrible :d though 7 was the last one that I touched :D
@overexchange write a generator expression for what?
@AnttiHaapala wow, you're old :D
09:18
old? if 2 ** 5 is old...
@overexchange I very much understood which code you are referring to, but your question makes no sense, generator expression yielding what?
@AnttiHaapala Seems young to me :)
ah that one
now I understand what you mean, well, you really can't.
@AnttiHaapala generator expression yieding sum of squares of interval using reduce
09:21
the generator expression items are independent
@AnttiHaapala compared with 2 ** 5 ^57, it's old ;)
you'd use reduce:
using reduce
result = reduce(add_interval, map(square_interval, intervals), interval(0, 0))
it does not handle the non-zero case specially, but hey it shouldn't change anything
if non_zero(result):
    return result
this is broken IMO, you'd return the result no matter if it is zero or not.
return reduce(add_interval, map(square_interval, filter(non_zero, seq)))
09:23
no
non_zero is not needed and the reduce needs the initializer, the 3rd argument interval(0, 0)
why do you need to filter for non_zero, add_interval with zero interval is a no-op, right?
strictly you do not need the initializer except for the case if the intervals is empty
but it is good to include there for the sake of completeness
def sum_nonzero_with_map_filter_reduce(seq):
    """Returns an interval that is the sum of the squares of the non-zero
    intervals in seq, using using map, filter, and reduce.

    >>> str_interval(sum_nonzero_with_map_filter_reduce(seq))
    '0.25 to 2.25'
	"""
    return reduce(add_interval, map(square_interval, filter(non_zero, seq)))
whatever
@Vyktor and I was paid for it :P actually 7 was more horrible than 6 :D
am looking for generator expression that uses only reduce without map and filter. something like (c * 5 for c in 'Python') style
map and filter can be replaced with a generator expression
a reduce cannot
yes I mean the same
09:30
return reduce(add_interval, (square_interval(i) for i in seq if not non_zero(i)))
ugly as hell
in this case the map, filter could be slightly faster
ok
so here generator expr is ` (square_interval(i) for i in seq if non_zero(i))`
sorry :D
if non_zero(i)))
of course
so map(x, filter(y, z)) can be written as (x(i) for i in z if y(z))
map(x, y) can be written as (x(i) for i in y)
filter(x, map(y, z)) can be written as ugly as (j for j in (y(i) for i in z) if x(j))
I use map and filter if their arguments are functions, genexp otherwise
actually am new to generator expression syntax, this is my first program
Guitar-heroine ): this is my next lab exercise
09:46
Guitar Heroin
Hey up again
hey up
@Ffisegydd did you cv all of the above? :D
I did not.
Ahhh... going to have some pork Welsh Cheddar and spring onion sausages tonight - they're delish...
09:53
pork?
I may go back through and look at them, but not right now.
10:04
ne = now eating
ne: cơm tấm, sườn, bì, chả
10:30
hi
foo="a=0 b=1 c=3"
ans=eval( 'dict(%s)'%foo.replace(' ',',')) )
i understand how eval works..take a string and execute it
but i've trouble understanding how it took a string and changed it into a dict
Don't use eval.
i used list comprehensio
but just trying to understand how did it work
dict( (n,int(v)) for n,v in (i.split('=') for i in foo.split() ) )
this can do a similar thing but didn't understand the eval except the replace part
10:48
@Ajay do it in parts in your shell
aka
foo="a=0 b=1 c=3"
'dict(%s)' % foo.replace(' ',',')
what did it do
'dict(a=0,b=1,c=3)'
yeah
now try the contents of that string within the shell itself :D
a.k.a: dict(a=0,b=1,c=3)
what happend to '='
i thought
dict takes an iterable object and convert the tuples inside the iterable into key value pair
It can take that, yes.
So dict([('a',2), ('b',4)])
But it can also take dict(a=2, b=4)
You could even do d = dict([('a', 1), ('b', 2)], c=3)
Ffisegydd, reading for 3 hours now on mongodb aggregation, still a bit unclear , how to know what the thing will output, i know i can "force" it with $project in a way, but other than that i am very foggy
11:03
@Stephan I have no idea what your project is, what you're trying to do, or anything.
So I don't know why you're asking me specifically.
ok i am sorry
@Ffisegydd Thanks..
Stephan if you have problems, ask the room as a whole, not individual users (within reason). As per sopython.com/chatroom, which I've linked to you before.
oh i thought i did not ping you, because your name is in cursive
You didn't ping me yes, but you did address me.
I say 'within reason' because occasionally you may be continuing a previous conversation etc
11:11
@StephanKetterer aggregate operates on stream of documents, $project only changes the stream. Changed stream will be the end result.
it is a list. That is the output you get if you print a list. Please read the Python tutorial 3.1.3 ListsAntti Haapala 1 min ago
asdkljfasdfkljasdlkfjasdflkjsadflkjasdlkfjasdlfkjasdlfkjasdflkjasdfasldjkf
I wish there was a way to suspend users until they read the Python tutorial
In [1]: list_with_strings=["name","Ajay Kumar","age",25,"place","India"]

In [2]: dict(zip(*[iter(list_with_strings)]*2))
Out[2]: {'age': 25, 'name': 'Ajay Kumar', 'place': 'India'}
In this i understood everything except the * in zip function
isn't there any better room for mongodb?
* is an argument unpacking
i asked 1 question , i am sorry
dict(zip(*[iter(list_with_strings)]*2)) is the same as
l = [iter(list_with_strings)]*2
dict(zip(l[0], l[1]))
func(*a) is the same as func(a[0], a[1], a[2], a[3] ... a[n]) if ahad n items
11:15
thanks a lot..
48
A: What do *args and **kwargs mean?

oripNotice the cool thing in S.Lott's comment - you can also call functions with *mylist and **mydict to unpack positional and keyword arguments: def foo(a, b, c, d): print a, b, c, d l = [0, 1] d = {"d":3, "c":2} foo(*l, **d) Will print: 0 1 2 3

@MartijnPieters maybe we should undupe this: stackoverflow.com/questions/2921847/…
this talks about star-call and the other calls about star-args
C̷̙̲̝͖ͭ̏ͥͮ͟A̡͊͠͝BBA̡͊͠͝GȆ̴̟̟͙̞ͩ͌͝
cabbage
@BhargavRao please cv those cvplss :d
un dupe it?
ah I mean like much earlier
5 hours ago, by Antti Haapala
http://stackoverflow.com/questions/18712042/syntaxerror-invalid-syntax-variable
somewhere here
11:24
Sad that you deleted Ninja's 8 upv answer
ahh
which one :d
if it is 8 upv it does not matter
nope
it is a notable answer
So if a answer is deleted, the rep count does not go off?
no but accept rep is lost :d
but hey it is 80 rep for martijn for an offtopic question
then you should have cvd it
you should have cvd it and not answer
your fault
11:29
Yeah
Yesterday's storm was the worst in 10 years!
@AnttiHaapala Asap ^
I was late :d
so bad questions today
and the interesting ones, I do not even get an upvote? :D
let alone an accept
@BhargavRao
Need career suggestion
Lol, why me? @Ajay
11:35
@Bh
you are from Bangalore
Yeah. Native of Bangalore Bengaluru
i've been working as a mining engineer in a psu..
i want to pursue masters in CS.
it's a decent job,zero work...but not interesting...so wanna quit it
If ya don't like quit it :)
Apart from that I'm still a student, So i'm poor on givin career advice
your page said you are working for an offshore company
Yeah. I am
Work from home
I get 12.5K rupees
11:42
is this ok to chat or will i get banned for non programming chat
:D
Naw! THere is no ban for non programming talk
you're a b.tech student?
Yeah. Comp Sc
has anybody tried using the new Visual Studio Code with python on Windows? I've tried to create a python task to save me from swapping to command line but it doesn't work.
Err. Windoze? Nope
11:46
Aye, it isn't by choice
who are these sadist bosses who force the windows :d
thankfully vmware workstation comes supplied (Y)
never mind. I might post a question at superuser or something. thanks anyway
Had a weird Homework to create a tutorial
Using html and js
@Federer that's on-topic on Stackoverflow actually
since VS is a programming-only tool

« first day (1658 days earlier)      last day (3514 days later) »