« first day (1569 days earlier)      last day (3383 days later) » 

2:00 PM
I have edited it out of posts, for example there was a correct answer on UTF-8 in urls with where the guy starts wondering that: "but I do not know, w3school says that only iso-8859-1 characters are allowed percent-escaped in URIs."
 
I see Rick Waldron in w3fools...
 
What does it take to qualify as a "senior software engineer"?
 
you can teach juniors :D
 
That's actually the criteria?
 
dunno
 
2:01 PM
closed as primarily opinion-based :P
I keep seeing in published jobs' descriptions "senior"
They never taught about seniority in the academy.
 
if you are out of academy then you are not senior
senior is someone who is so damned good already.
when you feel you are a senior software engineer then probably you are one.
say I did talk with 1 company that wanted to hire a senior engineer about writing linux drivers, the requirement was that from first day on that SSWE would go to the customer premises and teach their junior staff how to write linux drivers.
so the seniority depends on a field too...
I had to said: "I wouldn't qualify"
@JonClements @MartijnPieters 3-yr-old toddler shot at parents in New Mex...
 
@AnttiHaapala I find these kind of jobs to be rare as opposed to people who claim to be,, and are accepted as, senior programmers. Maybe i'll know more when I move to the city
 
2:16 PM
another way to put it is that, if you are a senior it means that there is probably no one in the company that can teach you about your field of expertise...
 
I work for a small company..
 
so are you senior there by that definition?
 
lol
RuntimeError: maximum recursion depth exceeded
by that definition yeah, but it's only me and two more actual programmers
although I can learn other stuff (not in my area)
 
if the two more actual programmers need to learn from you all the time and you need to tutor them about the tech then yes I'd say you are a senior software developer; or engineer...
ofc there might be places where the titles are protected...
 
no, I would say we're on the same level, more or less.
there are others here who learn from the three of us a lot
 
2:21 PM
for example my co there are 3 coders
 
where do you work?
 
and I consider 2 being seniors
 
I know people who hold a job targetted for seniors, and honestly they aren't great programmers.
 
as both have 10+ yrs working experience and we are like applying solutions by our own judgment though we ask each other about which would be the best way to do some new X.
 
re-cbg
 
2:22 PM
that's why I asked
 
and the 3rd guy then not yet can do really anything on his own initiative. He's a great python coder, but that's it. Junior.
cbg fizzygood
 
I understand. I do lack the guidance of people who actually built something great
which is why I'm wondering if I should stick to a small company like I work for now or move to a big company (at least try to)
 
@davidism come on mate. 100 rep to go. It's time for the 80s montage.
 
hello @Ffisegydd
 
I'd move to a big company if there were any good alternatives.
 
2:26 PM
I once applied to Intel but didn't get the job (when I was second year in the university)
 
and I'm pretty bad at interviews
 
too bad in my hometown I couldn't assume seniority in most of the companies where I'd want to go to work. They don't do Python, or desktop java or C or something else...
On the other hand I cannot get any better in what I am doing right now. Just doing remash of the same thing over and over again...
 
sounds like randomsort.
 
I am good at good interviews
if a good company interviews me then it is good
if a bad company interviews me, then it will be bad :d
 
2:33 PM
what's a bad company?
 
a hour-sweatshop that bargains for big projects with low rate...
 
didn't know those existed
at least in that profession
 
you didnt?
 
for programming related stuff, nope not really
 
3:01 PM
stackoverflow.com/questions/28228654/… I wish I could answer this :d
0
A: Where does C function execution stop

Antti HaapalaYou really should run the code under debugger, compiling the .so with -g etc. But one obvious error is that char* pcReceiptSignature is declared an out parameter? thus I guess you want to reserve some space for it, to be filled by the function, but none is available (you are using c_char_p inste...

woot I wrote an answer and as soon as I submitted, the guy edits the code and removes half of it
 
someone told him to
 
including the 1 obvious error that I spotted...
nice
xml_bytes = bytearray(b'<xml><TransactionPrintFileName>trx0001.prt</TransactionPrintFileName></xml>')
XMLparamsVal = (ctypes.c_byte*513)(*xml_bytes)
does this work right?
 
Please be generous with downvotes on that question, so that we can nuke-vote.
 
3:20 PM
dvd
 
Melon :-) I nuke-voted it.
 
BLEH. I miss Python.
 
so many problems with that code
 
@Ffisegydd you got that r job?
 
3:27 PM
No, never heard back from the company. I'm doing some non-Python programming now and missing string methods terribly.
 
if a.lower is not ('e','y','p','d'): is simply brilliant
 
I think that needs an in
 
@vaultah isnt it funny: docs.python.org/3/tutorial/…
the section title on while loops is "first steps towards programming" :D
 
Heh
 
maybe OP's a scheme convert?
omg vultures came to the carcass already
 
3:34 PM
Yay, 3 answers and counting
 
nuke them all
 
The good thing is, we didn't (yet) see the actual code of his "Currency Converter"
 
at least should shorten that code, just the 6 damned lines are enough
0
A: time_t wrap around date

Antti Haapala64-bit long would have the wraparound at somewhere around the year 292,277,026,596, which is ~20 times the current age of the universe from now. As the Earth's rotation would be unlikely to hold until at that time, and neither would people really care much, at that time it is very apt to return (...

 
3:58 PM
waits for Lake and Palmer to join the room
 
I think I'll start answering crap questions again :(
 
4:17 PM
if this can't get closed votes then why would this one should be closed? stackoverflow.com/questions/816391/…sadaf2605 5 mins ago
Dafaq?
 
Unclear/too broad/not reproducible/no code
 
@Ffisegydd I'm feeling it! Gonna be sitting around watching the Super Bowl, maybe I can get those last answers.
 
@AnttiHaapala: isn't this one too broad: stackoverflow.com/questions/28228654/… ?
Bounty on it, so it'd need a flag.
 
@MartijnPieters not really
I am just not sure how the loss function behaves on LDA
 
user559633
It's too broad, but i imagine it would clean up nicely with a "what have you tried, be more specific"
 
4:30 PM
I mean, with the SGD the loss is just a single value and it is pretty good
 
I'll leave it to those who've actually used Vowpal
 
but python tag could be removed from there, no relation to python whatsoever
or maybe should tell to go to statistics.se
 
Lol
I can write Python myself — elyking2001 1 min ago
 
4:52 PM
Hmm, the reject edit reasons seem to have changed.
 
1 hour ago, by vaultah
The good thing is, we didn't (yet) see the actual code of his "Currency Converter"
THNX IN ADVANCE — mark tennant 55 secs ago
if a.lower == ("y") and b.lower == ("p"):

    y_p = input("How much Japanese Yen do you want to convert:  ¥")

    answer = YenToPounds(int(y-p))
Arrrrgh. Okay, I'll stop.
 
5:09 PM
The people approving these edits drive me insane: stackoverflow.com/review/suggested-edits/6913832
 
NOOB Q: This has probably (definitely) been answered before but not sure what to search for... I'm looking for a way to run a python script in a console window without actually typing the "python" keyword before it. An example of this is how 'brew' works. E.g. We don't have to type "python brew.py" in the terminal. Is the correct approach to doing this just creating a source file without the ".py" extension and chmod'ing? E.g. "myApp" chmod 755 "myApp" or are there other tricks to doing this?
 
You need to put it on your path, so whatever folder contains it should show up in echo $PATH.
And it also needs to be executable, which is what chmod 755 will accomplish.
 
chmod +x?
 
And the first line should be #!/usr/bin/env python
@vaultah sure, or that
 
Gotcha. Thanks! I'm guessing this is what most installers do so will look into this further :)
 
5:19 PM
I'm trying to do a custom sort on a Pandas series. The sort is
sorted(x, key=lambda v: [int(p) for p in v.split('.') if p.isdigit()])
where x is a series. But the thing that is returned is a list. How can I get it to return a series?
 
Hey all c:
How is everyone?
 
user559633
Hey @Iplodman! How are you? (i'm fine)
 
I'm doing well thanks ;P
Well, Node.js is being... Node.js.
 
D:
 
5:30 PM
Yup. (I did post it as you may have seen, but it's not Python ;P)
 
Pssh. It's not as if the room is overflowing at the moment.
How's school?
 
Well, I can re-post if someone wants it ;P
School's doing good c:
My CS teacher said I'm an 'expert' at Python.
;P
C:\Users\harry>npm -f install socket.io
npm WARN using --force I sure hope you know what you are doing.
-


> ws@0.5.0 install C:\Users\harry\node_modules\socket.io\node_modules\engine.io\
node_modules\ws
Heh.
How's work/school for you?
 
Bleh. Almost finished. Need to find a job.
 
(Sorry, I realised I just posted loads.)
 
I knew a lot more about computers than my teacher when I was in high school.
 
5:35 PM
@Ffisegydd Ooh, fancy ;P
@Ffisegydd Same here with Python, although I'm nothing compared to some of the Gurus here.
 
I've been doing a bit of JS lately actually.
Mainly D3.js though.
 
What's that?
(I'm new to JS; can you tell?)
;P
 
D3.js is Data-Driven Documents.
 
It's basically a plotting/graphing library.
 
5:42 PM
Wanted to post like @Ffisegydd But, it crapped
 
You have no idea how much messing about I did to get 10k exactly.
 
It is crap tough
So near yet so faaaaaaaaaaaaar
 
Look back for an answer you've downvoted and that's been edited, then undownvote it.
That's what I had to do.
 
@Ffisegydd Sounds interesting.
 
That *** didn't edit it ... He's left it like that for 4 days
 
How to identify a Russian, lesson 0:
You want inplace processing with a generator depending on original data and without extra memory used. No way)) — bav 9 mins ago
 
cbg Antti
 
Hey!
 
6:17 PM
re-cbg
 
cbg Jon
 
I am curious to know what course you are taking; I've seen about 30 very similar questions in the past couple of weeks. — Hugh Bothwell 8 mins ago
 
Oh, wow. I've found the task that we're going to be given for GCSEs. I saw the first sentence (I was given a hint towards what it was) and scrolled back up.
That's a scary coincidence.
 
6:23 PM
@davidism I would dupe close it - but I think I'll write a script to do so... :p
 
hey, I have a dictionary which contain strings from a user input, is there a way to check if each field is blank using a while loop?
 
Yes
 
cause while loops can't iterate over a dictionary unlike a foor loop
for*
@vaul
@vaultah how exactly can i do this? :S
 
@Inthuson Key/values. if dictionary['key'] == "": ...
Wait, I misuderstood ;P
My mistake.
 
6:29 PM
lol dw :P
 
Is there any reason you aren't using a for loop?
 
well, i have a bunch of fields in the dictionary, and i need to check if any are blank, and if they are i need the user to edit them and carry on checking, and the most efficent way i could think of was using a while loop
 
@Inthuson you can have i = iter(dict) and then key = next(i), but whenever the iterator is exhausted it will throw a StopIteration exception which you wouldnt necessary like
and nope, while loop is almost never the most efficient way
 
for key,value in my_dict.items(): if not value: print key
 
@Inthuson the most effective is if any(is_blank(k, v) for k, v in dct.items()): print("Please check your values")
if you want to check them all at once, or Joran's if you want to check them individually
 
6:32 PM
@Inthuson the easiest and the most straightforward way I can think of:
d = {'a': '', 'b': 'not empty'}

i = 0
items = list(d.items())
while i < len(d):
    if items[i][1] == '':
        print('empty value at key', items[i][0])
    i += 1
 
what ...
 
I wouldn't use this :P
 
why are u using a while loop ....
 
7 mins ago, by Inthuson
hey, I have a dictionary which contain strings from a user input, is there a way to check if each field is blank using a while loop?
 
I'm using pyqt4 aswell so i'm using the setFocus method onto the field
so i should use a for loop? since it's more efficient?
 
6:34 PM
@vaultah that reminds me of 1
 
@inuthuson you should probably use a for loop
 
there was a question "how do I sum numbers in a function that has a while loop"
 
@Inthuson why don't you disallow empty entries to start with?
 
5
A: Python to make a while sum up the integers of a list

Antti Haapaladef sumOfPositiveNumbers(li): while True: return sum(i for i in li if i > 0) Though I prefer the following function because instead of sum, it uses lambda expressions only def sumOfPositiveNumbers(li): while True: return ((lambda f: (lambda x: x(x)) (lambda y: ...

 
I use regex to check the values entered into the field and when the button is clicked, I'm using this to check if any of them are blank and then setfocus ?
@JonClements
 
6:36 PM
@AnttiHaapala nice :D
 
@Inthuson then set your regex to not allow blank strings?
 
def createQLineEdit():
edit = QtGui.QLineEdit()
regex = QtCore.QRegExp(r"(?:[a-zA-Z]+)")
validator = QtGui.QRegExpValidator(regex)
edit.setValidator(validator)
return edit
how do i do that? :S and would it not matter if the user never clicks on the field?
@JonClements
 
@Inthuson Ahhh that's a good point... you're right - it depends when QT enforces the validation... sorry, not a QT user
 
No worries :) @JonClements
 
6:41 PM
since i dont use QT much those methods probably arent necessarily right ... but more to give you an idea of how I would do it ...
 
I feel like there should be some better way to include javascript on an index.html page by now...
 
(Although you might want to raise a custom exception that you could display in a message box or something)
@corvid how so?
 
@JoranBeasley yeah i guess it is a better way to go about it
I was going to add a custom message box but in order to do that i need to first use this to check if any are blank
 
@JoranBeasley like, with angular there is two-way dependency injection, but you still have to include every javascript file on the HTML page. I wish you could just say "include all javascript in scripts/ folder"
 
@DSM @vaultah are you two tag teaming that answerer on that number->words question... are we going to see a good cop/bad copy thing in a bit? :p
 
6:45 PM
I deleted my comment, because it was incorrect ;(
Haha. He "fixed" his answer and my comment started to make sense.
 
DSM
@vaultah; yeah, that was funny. :-)
This one's for @Ffisegydd; link
> Actually, the LinkedIn themselves transfered their developpers forum to stackoverflow!! There should be then the possibility to ask legal questions!! – Hassan-Roland Nasser
 
cracks knuckles
 
DSM
@vaultah: okay, now it looks like that guy's just faking his output.
 
@Ffisegydd maybe you could ask @davidism to write a script to destroy for you? runs away quickly :p
 
@Inthuson maybe something like this? gist.github.com/anonymous/e18918afe4cbfe9c8d2a
 
6:53 PM
@DSM he deleted his answer
 
hohoho
 
daj
hello
 
hello @daj
 
DSM
@vaultah: probably best. Faking code transcripts -- which is fortunately rare -- annoys me more than anything else on SO. I'd link to some of my favourite examples but @Antti would just get them deleted, so :P
 
this guy with the get int from user question for gcse's or whatever ... may as well just give up on the coding path now
 
7:11 PM
@DSM that is why you have 10k rep privs!
so that you can see the fav examples :d
 
DSM
So I have to take snapshots if I want to show someone <10k? And if I don't bookmark it, I can't find it later? Bah.
 
@JoranBeasley I manged to fix most parts of it
but
if checkpass() == True:
                for key in user:
                    try:
                        if isblank(user[key]) == True:
                            user[key].setFocus()
                            break
                    except AttributeError:
                        None
                    return True
 
Don't use == True - simply use if checkpass():
 
it returns true after the it checks the first fields
 
also, if you want a dummy statement, use pass instead of None
 
7:14 PM
okay @ThiefMaster
thanks
 
don't use camelCase for your methods either (assuming setFocus is not part of some crappy library that uses camelCase)
 
you should return false instead of break
its QT's function ... who knows what its called
 
ah, qt.. then nevermind ;x
 
hmmmm nope
 
haha its got nothing to do with Qt
 
7:15 PM
you should return True 1 level up, now
 
one sec let me explain
 
it returns true if the first field does not fail
 
def checkpass():
            password = user['Password'].text()
            verify = user['Verify Password'].text()
            if password is not '':
                if password == verify:
                    return True
                else:
                    user['Verify Password'].setFocus()
                    return False
            else:
                user['Password'].setFocus()
                return False

        def isblank(field):
            if field.text() == '':
                return True
there you go, see i put it in a dictionary with the texts
 
you should do return True in else or return False instead of break
probably
 
if password is not ' - no! never use is for strings.
 
7:16 PM
surely if you are using QT it has a setFocus method that you cannot control the capitalization rules ... that is what we were talking about
 
is checks for identical objects. it's not what you want in most cases
(the most notable exception is is None and is not None where you should use is)
 
just write if password:
that should be plenty
 
now once the password is verified, i check the fields, but after it setfocus on the first field it creates the user
 
isblank is not very useful as a function. just perform the check directly. if not field.text()
 
you need to check the return ... if its false do not create if true do create
I dunno I gotta go do some errands ... good luck :) you are close
 
7:22 PM
thanks @ThiefMaster and @JoranBeasley fixed it! :) Works properly now
def verifyfields():
           if checkpass():
                for key in user:
                    try:
                        if not user[key].text():
                            user[key].setFocus()
                            return False
                    except AttributeError:
                        pass
                return True
 
if not checkpass():
    return
why not do that at the beginning of your function?
then you save one level of indentation for everything else
also, which attribute doesn't always exist? that except AttributeError looks somewhat dirty there..
 
There is a comboBox and Date from pyqt
 
Another brilliant line: if try_again.lower == 'Y':
I bet this is the same user
 
DSM
Eh, someone upvoted the answer. :-/
 
LOOL you think that's me? @vaultah
 
DSM
smh
 
Wow... I had to work a bit to grok this answer - not sure how much luck the question asker is going to have from that
 
DSM
That character's pretty scattershot in his answers.
 
I'm new in programming and that's my homework. Can you help me? — Crokie 16 secs ago
 
a knapsack problem seems harsh for a homework assignment... especially if they haven't a clue to start with...
 
7:46 PM
Don't think itertools.combinations-based solution will be particularly appreciated though
 
cbg
@vaultah did you see my answer on that?
 
@Adam did you intentionally complicate your answer? :P
Also, cbg
 
@vaultah was sum_of = functools.partial(functools.reduce, operator.add) your first clue? :D
 
Yep, and unused val, and vars() in the first place, and combo[:] ;)
 
oh oops, that's actually a typo
should be [val for var,val in vars().items() if re.match(r"[a-z]", var)]
 
7:51 PM
Ah, okies
 
easy recursion
 
ooh though I could do variables = [var for var,val in ... then values = [map(vars().get, variables]
ah well
 
@AdamSmith you are so cruel
if OP can explain that to teacher, well I think it is enough learned already ;)
 
exactly
I love answering "Gimme codez for my homeworkz" questions with something FAR too advanced for them to possibly know it
If they won't learn on their own, at least make it obvious to the instructor that they've plagiarized.
 
There are so many things wrong with that answer... I like it.
 
7:58 PM
But hey -- I didn't use any magic numbers! :P
 
is django much different than flask? Are most of the skills transferrable?
 
@AdamSmith you mean, instead of 0, write: 0xDEADBEEF * 0xBADB00B2 % 1
 
Write all the constants as binary, but not using a binary constant. a = 0*2**0 + 0*2**1 + 1*2**2 + 1*2**3 + 0*2**4 + 0*2**5 + 0*2**6 + 1*2**7
 
bwah not like that :P
 
8:04 PM
Then assure the asker that since computers works in binary, writing their constants in units of two is a necessary speed increase
 
not kewl, just calculate a polynomial and then take modulos
 
And that every novice-level programmer can look at that and do the math in their head.
imply there's something wrong with them that they can't
 
@davidism and that is so wrong there:
"only problem with clojure is that it is lisp1 not lisp2" wtf?
the OP has no clue about anything really :D
 
Oops, forgot to actually give a link to the review.
 
8:07 PM
yeah, I almsot reopened it by accident :d
 
Same :D
 
They should really fix that, maybe I'll make a meta post about it
 
anyhow, it is like 1 guy from php has no idea about lisp1 and lisp2 and bwaaaah
 
you should actually vote though :D (unless the review is cached and I'm not seeing it)
 
cant, completed
 
8:09 PM
looked decided when I checked it
 
Wow... another maths question - although - doesn't appear they've actually got as far as the others...
 
huh, if the review was completed, why are the three reopen votes still there?
 
Review completed 3 mins ago:
vaultah reviewed this 3 mins ago: Leave Closed
rkhb reviewed this 4 mins ago: Leave Closed
davidism reviewed this 7 mins ago: Leave Closed
manlio reviewed this 16 mins ago: Reopen
James A Mohler reviewed this 19 mins ago: Reopen
@davidism
 
yeah, apparently that just prevents more reopen votes from the queue, but the existing ones don't age away for another few days
 
rbrb -- off to do something unproductive for a bit while the kid's watching cartoons lol
 
8:14 PM
rbrb @Adam
 
DSM
When a question isn't well put together, I wish people would wait at least a few minutes to have the OP turn it into something more respectable, rather than immediately guessing and hoping for the best. Experienced users usually guess right, but then the OP is seldom motivated to fix the Q. :-/
Anyway, time to go get ready for some championship gridiron!
Rhubarb for all.
 
rbrb @DSM
Wow... new Education Secretary cracking down on schools where children haven't managed to learn their times tables by age 11
ffs... I knew my times tables first year at school
Our education system is seriously flawed if kids can't remember them by 11
 
or pocket calculators good :D
 
9:09 PM
@MartijnPieters haha... my bad - comment deleted... was getting ready to watch Dragon's Den
 
Soo... how would you guys handle having both OAuth users and Local users in a database?
 
9:38 PM
@JonClements I'm not an expert on this stuff, but this does sound like a typical politician idea re: education policy: appeal to adults sense' of "what? they don't know their times table? Grr etc."
def mult1(a, b):
    return sum(a for _ in range(b))

def mult2(a, b):
    return TIMES_TABLE[a][b]
Which is better?
 
@ZeroPiraeus mult2 since hash lookups are faster than repeated addition :P
 
>>> mult2(17,23)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in mult2
IndexError: list index out of range
I just think it's possible that people who've been studying educational methods for decades might have come to some conclusions regarding which method works best, and that a brand new Education Secretary's gut feeling shouldn't necessarily supercede that.
 
def mult(*args):
    try:
        return functools.reduce(mult2, args)
    except IndexError:
        return functools.reduce(mult1, args)
 
9:59 PM
hi .. can any body tell me whats wrong with stackoverflow.com/a/28265928/2867928 ?
 
@Kasra why are you asking what's wrong with them?
 
@KasraAD what makes you think there's something wrong with them?
 
i dont know but as there is some same answer
and those get vote ! ;)
 
So?
 
while we're at it, http://stackoverflow.com/questions/28265920/get-pairs-of-list-python‌​/28265928#28265928 canonical dupe
 
10:02 PM
so i think there is a problem with that i couldn't find it
:)
 
Probably more a function of English not being your first language. It's harder to read for a native speaker (though certainly still very intelligible) so since all the answers seem to have come in within a minute or so of themselves, the easiest one to vote up is the shortest and easiest to read
 
yes English is not my first lan , but about answer i dont care about vote i just think that there is a problem with and i dont want to have any miss understanding about coding
as my only purpose of being here is learning
 
I don't see any fundamental problems with either answer
 
@KasraAD I wouldn't assume there's a problem unless you get downvotes. A similar answer getting upvoted when yours didn't might just mean the upvoter saw the other one first, or they found the explanation easier to read, or they noticed the other answerer had a higher rep and therefore thought their answer must be better for that reason, or they're mates with the other answerer in some chatroom or other ... you've no way of knowing, and it's pointless to worry about it.
 
@KasraAD the only thing I'd mention (and it's nitpicky) is that filter won't return a list in Python3 RE: stackoverflow.com/a/28265116/3058609
 
10:09 PM
also i hope you know this that when you're first lan is not English its hard to transform :) your Knowledge :(
 
Do we really not have a canonical "Why can't I mutate this list while iterating on it" on sopython.com?
I'm sure it has to exist
 
yep , thanks
@ZeroPiraeus yes , im agree !
@AdamSmith i dont know anty thing about ! i need to see
 
ummm don't really like web apps with Python, prefer real programs and scripts etc
 
Not even really sure what that's supposed to mean
 
10:53 PM
stackoverflow.com/questions/28268878/… OP is trying to exit his while True loop by doing True = not True
roippi points out that you can't do that
OP asks: "Should I do True = False instead?"
Holy crud I had no idea you could change the value of True in Python2 (thanks @DSM). It was a much more morally relativistic time...
 

« first day (1569 days earlier)      last day (3383 days later) »