« first day (1555 days earlier)      last day (3396 days later) » 
00:00 - 16:0016:00 - 00:00

12:00 AM
sure
 
processScores('theText.txt',score)
Traceback (most recent call last):
File "<pyshell#15>", line 1, in <module>
processScores('theText.txt',score)
NameError: name 'score' is not defined
 
you can also show the code if you want, I'm sure some people are watching or will watch later and can help
you need to do something like this:
 
ok ill post the code right after the error messages
but then if I use Score
processScores('theText.txt',Score)
Traceback (most recent call last):
File "<pyshell#16>", line 1, in <module>
processScores('theText.txt',Score)
File "C:/Users/christopher/Desktop/hw2.py", line 48, in processScores
score.initialScore(start) #checks if first line is a number if it is adds it to intial score
TypeError: initialScore() missing 1 required positional argument: 'start'
 
score = Score()
# now we have an instance of the class 'Score' named 'score'
processScores('theText.txt',score)
 
huh ok ill try that
 
12:01 AM
try adding the instantiation of score -> (score = Score())
anything?
 
and I would put that in my function def processScores? which is outside of the class? or in my class or outside both?
and just in case, Im going to post the code real quick
 
probably outside both for now
 
ok will do
class Score:
# class to hold a running score, from object to parameter
# also to set number of scores that contribute to total of 1

def __init__(self):
#initalizes the running score and score input accumilators
self.runScore = 0
self.scoreInputs = 0

def initialScore(self, start):
#takes the initial score in line one of the file and updates
#the running score to the inital score
self.runScore += start
print('Grabing intial score from file, inital score set to ' + start)


def updateOne (self, amount):
 
put it right before processScores to see that it actually does something positive
 
will do
 
12:03 AM
you can't post a bunch of code here, use an external site that's meant for that and post a link, that'll be more readable
 
ok i will. but I think I have progress
i still have an error but its just in my print statement. a quick fix i think
Traceback (most recent call last):
File "<pyshell#17>", line 1, in <module>
processScores('theText.txt',score)
File "C:/Users/christopher/Desktop/hw2.py", line 50, in processScores
score.initialScore(start) #checks if first line is a number if it is adds it to intial score
File "C:/Users/christopher/Desktop/hw2.py", line 14, in initialScore
print('Grabing intial score from file, inital score set to ' + start)
TypeError: Can't convert 'int' object to str implicitly
its just str.start to fix
 
... + str(start), but string formatting may be better... docs.python.org/3.1/library/string.html#string-formatting
you can also do: print('Grabing intial score from file, inital score set to: %d ' % start) which will be more convenient later if you wnat to change the message formats
 
thank you for the correction. and I will use string formating but just for now to get the code working ill do it str(start) please excuse me for a minute as I make the correction to all my print statements. Thank you again for your help
 
No problem, I'll be away as well, make sure you understand the difference between a class and it's instances. later
 
will do thank you
ill post my results after the print statment fixes just in case you are still on
progress! but not out of the woods yet,
new error
more progress as the initial score should be 50 not 5. it is now reading 50 still working on the valueError
still working on the valueError, does anyone have any ideas?
 
1:09 AM
post full tace
 
1:34 AM
will do
code is currently as this. Let me just set it real quick and finish changes
so this is code thus far I am currently trying to write a exception for ValueError. However I am unsure on how to write the execption so that it ignores the thing which called the execption and presses on
class Score:
# class to hold a running score, from object to parameter
# also to set number of scores that contribute to total of 1

def __init__(self):
#initalizes the running score and score input accumilators
self.runScore = 0
self.scoreInputs = 0

def initialScore(self, start):
#takes the initial score in line one of the file and updates
#the running score to the inital score
self.runScore += start
print('Grabing intial score from file, inital score set to ' + str(start))


def updateOne (self, amount):
again sorry for posting the full code on here
 
2:16 AM
and im back. I had to move to another location
 
 
1 hour later…
3:19 AM
@MartijnPieters Your answer in the Python import question is not very clear.
 
Is this the right way to update a value in a row in SQLalchemy
stdcode = STDcodes.query.filter_by(STDcodes.city.startswith(line))
stdcode.state= "TELANGANA"
db.session.add(stdcode)
db.session.commit()
 
Okay, the example makes it a little clearer.
 
@Wally I'm a db noob too but I'm using autocommit (seems to be easier but if you are doing a lot of db processing then it will reduce performance)
 
Ok, but is it the right way to update it.
 
3:35 AM
Dunno, I don't know more than you ☺.
 
@thefourtheye Package imports are dark magic anyway.
 
Your text might be little confusing I am afraid, but the example makes it a little clearer
 
@thefourtheye I tweaked it ever so slightly.
 
It looks better now :)
I think you can still improve replaced the logging global part.
 
3:54 AM
It looks like I won't be going to pycon this year.
 
hi. how to write multiple python statements when using the -c switch....you know python -c "..."
 
@deostroll I would suggest instead doing echo 'print("stuffies")'|python -
 
does python have a pythonw.exe equivalent in linux?
 
Does anyone here have experience with centos 7?
 
@deostroll there's no need for it in linux; /usr/bin/python is the same as pythonw.exe
(only in Windows when opening python.exe a window pops up, but in Linux such behavior is not there)
@DemCodeLines Simply ask your question.
 
4:09 AM
so that won't spin up the shell in an attempt to, say, show a tk- program?
 
It won't pop up a terminal window.
 
Well I'm on the "Software Selection" screen and I have no clue which option I should install.
 
@thefourtheye forgot to say I tweaked that some more.
Ugh, two terrible answers on the BeautifulSoup question.
Unclear.
 
@DemCodeLines try doing something like sudo yum install python (not sure about yum)
 
bah, humbug, laptop out of power, and so am I.
Time for some sleep
rhubarb all!
 
4:13 AM
no power connection?
or you are travelling?
 
5:00 AM
@Wally stop asking lazy questions
my answer was correct, not sure why you felt the need to self answer while saying "thanks" and doing exactly what I said...
the next question you ask has no information about why it doesn't work, you just say "it doesn't work"
 
@MartijnPieters It is perfect now :)
 
Both those questions basically sound like "debug my code", and very simple debugging at that. Try slowing down and experimenting yourself more.
 
5:16 AM
@davidism In other news, I had breakfast :)
 
need any help with that?
I'm re-watching Firefly before bed, but for some reason I can't stay away from SO.
 
Same thing with me. Yesterday, I couldn't stay away from google analytics :D
I just kept watching the numbers change
Right now watching a documentary on boeing 787
 
@davidism your avatar makes me see you as a tired, worn out
 
Really quite interesting :D Gives me more reasons to distrust business people.
 
That emotion is "not impressed".
 
5:22 AM
s/business people/people
 
@davidism Which anime is that from?
 
I was watching some comedy shows by trevor noah
@GamesBrainiac Yuuta Togashi
(person name)
(don't know anything about anime; I just used reverse-image search)
 
Ahh. Never watched that anime.
@davidism Is it any good?
 
It's called Chūnibyō demo Koi ga Shitai!. It's really funny, really well done.
 
@davidism Them I'm watching it :)
 
5:31 AM
Is it appropriate to ask an algorithms question in the python stackexchange? Is programmers a more appropriate place?
 
If the problem is in python sure. But remember, make sure that you've done your research before posting a question otherwise, it will get downvoted.
 
It's a general algo problem, although I happen to want a python solution
 
There is no python Stack Exchange, there's just the python tag on Stack Overflow...
 
yeah sorry, that's what I mean. SO vs programmers
 
just ask ☺
 
5:33 AM
You can't ask for the solution to a general question, you need a specific, narrow problem.
We're not going to make the algorithm for you, but we could identify why something isn't doing what you expect.
 
So my specific problem is: I know that there's an O(1) time algorithm to keep a rolling maximum over a sliding window. That is, O(1) for each element added or removed...
 
@davidism Thats why I thought :P
 
I'm trying to figure out if there's an O(1) time algorithm to keep a max over a sliding window of a*x+y, if x and y are two series and I pick an arbitrary value of a when I ask for the max
I know that sounds a little complicated
 
yeah, that's probably too general to ask, or sounds more like a math problem
 
I wish there was a "I will pay $20 for a solution to this problem" website
 
5:39 AM
 
great idea, I will post there
 
^click it, cs.se is in beta but might be appropriate
 
yeah I actually subscribe to the weekly updates from CS, I had just forgotten about it
 
hey everyone got a quick question for you
if next(item) moves to the next item in a list
 
Just ask.
 
5:47 AM
whats the eqvilant of doing next next(item) which I know we cant do but is there a method of doing so
perhaps 2*(next(item))?
 
next(item);value = next(item)
(not sure if this is the best way)
 
thats interesting ramchandra
 
basically next() pops out the next value of the generator, kind of like list.pop().
 
so by that method it would be fair to assume like for example reading lines
 
for looping through a generator use for x in generator
 
5:50 AM
that the code would read the second line after the call to next item rather than the first after
 
firstline = next(item);secondline = next(item);thirdline=next(item)
basically every next runs the generator code and makes its internal state advance ahead
 
awesome so if I wanted to put this into my current code i could do something like..
 
to get a slice of an iterable use itertools.islice
 
hamsterFace = next(item); next(item)

print(hamsterFace)
 
yes, that is how you could use it, but my code is more ugly, use itertools.islice
 
5:53 AM
ive never heard of itertools.islice im going to have to look into that
 
(suppose you wanted the third item; then you would have to put next() three times! So simply use itertools.islice which is the better solution)
 
@ChristopherJakob I really can't tell what you want. Do you want to store one line, then skip the next line, or do you want to skip a line then store a line? Either way, don't put multiple statements on the same line, it's bad form.
 
@ChristopherJakob Infact I would suggest reading the entire itertools module. It's really useful; like a swiss-army knife
 
and really, the simplest way is to call next however many times you need, I don't think you're looking for a slice
 
5:54 AM
@davidism here ill show you and @RamchandraApte I will check that out
50

0

200
 
Single-item slice looks neater. Using next() makes it hard to tell what the code does
 
ok so when the code sees the O...
 
@RamchandraApte really? It's hard to tell that next() three times reads three lines?
there's no O in the block you pasted
 
i need it to append the 200 to a running score. but since the next item is a empty line. I need the second line not the next line
typo
o
 
and there's more than one 0, so that's ambiguous
 
5:55 AM
btw to get accumulate values use itertools
 
there's no o either
 
@davidism you are right, the islice version is more ugly
 
@RamchandraApte I think you need to slow down your answers, you seem to be overcomplicating an underexplained question
@ChristopherJakob rather than reading multiple lines, just continue if the line is empty
 
@ChristopherJakob I would suggest using filter() on the lines to empty it
(or continue as davidism suggested, depending on the code structure)
 
score = 0
for line in open('my_file`):
    if not line:
        continue
    score += int(line)
 
5:57 AM
@davidism that can be done better using itertools, lemme hack it quick
 
here before we get carried away here let me show you the file and then the code that executes the tasks using class methods
the file
 
1 message moved to Trash can
 
sum(map(int, filter(open('my file'))))
 
dpaste.com
ok
 
5:59 AM
@RamchandraApte until one of the lines isn't an int
really, it's not always better to make a one liner
 
Yes, I know, it's a hack
 
the for loop is pretty much the most straightforward way to do it
 
I'm so used to hack-y one-liners :-(
 
@RamchandraApte rather than providing hack-y one liners, either provide a good answer or don't answer
sorry if that sounds harsh but we have a certain way we like to operate in this room
 
6:01 AM
slow and steady, I see.
 
and fast answers pointing to five different concepts is not what we want
@ChristopherJakob and? What's wrong with it? I'm not reading through all that.
 
@davidism The python community is fixated on one liners.
 
to their detrement
 
Sometimes, list comprehensions are super hard to read.
Yea, it is problematic.
 
But still, mine wasn't that bad :-(
 
6:03 AM
its just context. as to why I need a next(item); next(item) thing
 
@RamchandraApte yes it was, see his file, it would have failed
in other words, don't answer until the problem is actually known
 
Anyway forget I ever said that answer.
 
@ChristopherJakob in conclusion, just use next however many times you need to, or skip empty lines with continue as I showed
seems like you've got the rest under control
 
thanks David this has been a labor of love for most of the day haha. I just started CS sooo.. but I can say I learned a ton!!
 
No problem. Keep it up! :)
 
6:06 AM
hope you guys are enjoying your saturday night
 
hm.. why does int("1234", 0) work? I'm assuming something for backwards-compatibility?
(anything else than 0 outside the 2 to 36 range gives "ValueError: int() base must be >= 2 and <= 36")
@davidism I totally forgot that it was a homework assignment. I beg the cabbage gods forgiveness.
 
ah but @RamchandraApte you didnt help me code, you helped me understand a tool in code to be used in my code. perfectly fine =)
you guys mind if I ask another? I tried the next(item); next(item) thing and it failed
 
wow. people still play runescape?
 
6:21 AM
I don't play for sure.
 
Phew... After a long time, I had to do a lot of reading to answer a question. And OP preferred my answer over Alex Martelli's answer. Yay :-)
 
From help(int) If base is zero, the proper base is guessed based on the
| string content.
 
6:41 AM
@PM2Ring Yes, but I already red the int() docs :-)
@ChristopherJakob sure, ask ahead
 
@RamchandraApte In that case, I guess I don't understand your question. What do you think the second argument should be to indicate that int() has to guess the base from the string content? I suppose None would be ok, but saying the base is None isn't really any better than saying it's zero. IMHO.
 
@PM2Ring Not a question, I was wondering why it works (and doesn't give an error). Now I found out what it does.
 
7:01 AM
@RamchandraApte That behaviour is inherited from the C standard library function strtol().
 
@PM2Ring Cool :-)
 
7:15 AM
Cbg
 
7:30 AM
I want to get a list of all columns with a particular var called pincode with a secific value.
I'm using the current code.
 num = pinCodes.query.filter_by(pincode = int_pin(pincode)).all()
I'm getting filter() got an unexpected keyword argument 'pincode' error
 
I'm rewatching the first Terminator after not seeing it for, I don't know, at least a decade... The graphics, they, they hurt my face!
 
7:47 AM
@Wally use lambda and use is_int() function of floats
 
@RamchandraApte I don't get you
 
your code is calling filter_by with a keyword argument pincode
the argument to filter_by is a function
you can write a function like def is_int(pincode):return pincode.is_int()
and then supply that function to filter_by()
@Wally ^
 
 
1 hour later…
9:04 AM
Uhh, stackoverflow is down
 
hello
 
Now I have to think what I am doing with my life :(
 
and stackexchange.com is offline too
and @StackStatus is silent D:
 
9:21 AM
Cbg
 
cbg
 
@vaultah Ah. That explains it. I was just about to restart my browser to see if that fixed things.
 
9:41 AM
We are investigating a routing issue with our network provider
 
I blame sunspots. Or terrorists.
 
working
 
10:00 AM
brief Sunday cbg
 
10:27 AM
I just tried
python -c "import telnetlib;tn=telnetlib.Telnet('bofh.jeffballard.us',666);print tn.read_all()"
and got
routing problems on the neural net
Spooky! :)
 
10:51 AM
cough I am sick since like 3-4 hours ago
 
11:28 AM
@RamchandraApte I had a nasty bug for a while... seems to have cleared up now though
 
Someone beat the computer player I designed for my n-in-a-row game. I am a failure
 
Umm... if written correctly, you should always be able to force a draw
 
for any N?
but yeah it lost ont he standard so I guess that's what you mean
And I used minimax, probably missed something but I'm not home to fix it
 
11:44 AM
Well, whoever goes first wins on 1N and 2N
 
I added diagonal win when adding the computer player and didn't add unit-tests for diagonal win. Maybe I missed something there
 
I think 3N can be won by the first player fairly easily if played correctly
 
12:46 PM
cbg, closed
 
cbg @Jerry - thanks
 
12:58 PM
@Martin quite surprised yours wasn't the accepted answer/get more votes on that dupe target - it's frustrating when you take the time to explain things and write a decent post and someone with a single paragraph gets it :(
 
SIng lol!
 
1:18 PM
stackoverflow.com/questions/28009587/… This question says unable to sing into playstore
"SING"
 
Oh.... didn't even notice that :p
 
Cbg all ...I'm still not able to load SO properly... Have they yet fixed the problems?
 
Works fine for me.
 
Umm... well - it all loads fine... and it looks like they're fixing the styling bit by bit
 
It used to take less than a sec to load ... Now it's more than five mins and not yet loaded?
 
1:30 PM
Umm... not experiencing that
 
But chat is workin flawlessly ...
 
bhargav@bhargav:~$ ping www.stackoverflow.com
PING stackoverflow.com (198.252.206.140) 56(84) bytes of data.
64 bytes from stackoverflow.com (198.252.206.140): icmp_seq=2 ttl=45 time=287 ms
64 bytes from stackoverflow.com (198.252.206.140): icmp_seq=4 ttl=45 time=292 ms
It had never crossed 100ms
 
I'm getting 85ms.... maybe it's your connection?
 
Naw google is at 20ms
bhargav@bhargav:~$ ping www.google.com
PING www.google.com (74.125.236.49) 56(84) bytes of data.
64 bytes from maa03s04-in-f17.1e100.net (74.125.236.49): icmp_seq=1 ttl=56 time=23.4 ms
64 bytes from maa03s04-in-f17.1e100.net (74.125.236.49): icmp_seq=2 ttl=56 time=22.2 ms
 
1:36 PM
cbg
 
cbg
 
cbg @ComradeVader :)
 
Sad point is that, I want SO for askin a ques and answering sumthin
 
So I want to use vitrualenvs. I need pytohn version 3.3.6 for kivy. I have install on my system 2.7 and 3.4
 
@ReutSharabani What have you done? :(
 
1:41 PM
how should I install 3.3.6?
I found that I can install it like this method does
71
Q: How do I install Python 3.3?

gonewildI have downloaded Python 3.3 from the official site but no idea how to install it. I'm using Ubuntu 12.04

or I could use something like this
 
@thefourtheye ?
 
which seems to be designed for this sorta things
but I am not sure which way is the best way
 
Though [x.append('a') or x for x in a] gets the job done, I am not sure if its the right way :(
 
@thefourtheye what's trying to be done - 'cos that's horrible :p
 
Puppppppppppppppppppppppy bro :)
 
1:43 PM
@thefourtheye evil twin!
woof woof bark woof meow!
 
some one will now throw a stick
 
@thefourtheye I use it from time to time, it may not be right in every case, which is why I added the explanation on how it works... But it does work.
 
woof woof
 
Catch the stick little puppy
 
Not in the mood, fever... Try my evil twin...
 
1:45 PM
Damn .. why am I not able to get SO running in my sys ... It is working in app
 
@thefourtheye awww... definitely something going around
 
Why not just x = chr(i) ? — Jon Clements 7 mins ago
Spot on, Puppy :) I should focus more on the actual problem :(
 
@thefourtheye a[:] = [el + ['a'] for el in a] is probably the most correct if a should be mutated
 
Fev
hi...
 
wb @Fev
 
1:47 PM
@Fev cbg
 
Fev
oh hi..
 
Hey Hey I need you attention now. SO is not opening up in my normal browser (chrome) but in incognito ... What is the problem
Any ideas?
 
Clear the cache and cookies and try again
 
I did that and deleted even history
It still is crap
 
1:52 PM
Are you able to ping it?
Oops, sorry. I didn't notice that, it works in incognito mode.
 
But it is not practically possible for it to happen so
 
Try other browsers
 
Yeah, doin that. Installing firefox now
 
cbg
 
cbg @Unihedro - how goes it?
@Ffisegydd Did you see that pull request for nidaba? Who and what!? I'm confused...
 
1:56 PM
It been well and I'm still looking for ways to prevent mocking myself.
 
How's the chat bot stuff going?
 
@Jon no completely missed that O_o
I need to sort out Chillar's PR.
 
@Ffisegydd I'm just more curious as to who it is :)
 
Mushrooms - Stuff is constantly borking itself.
Though at last a license is settled on.
 
Haha, sounds about right for getting stuff working with chat. What licence did you go for?
 
2:00 PM
Oh! We're using ASL 2.0 for the chat bot, and dual licensing ASL 2.0 and GPL 2.0 for the library.
 
This is bad... Others go to incognito for sumthin .... I'm using incognito to browse stack overflow ... :(
 
@BhargavRao Hmm, I notice that happening around, it's kind of an obscure problem. I'm using Chrome and doesn't get the issue.
 
I don't srsly get what is the problem. It is happening only when I am logged in.
Can anyone check if I am deleted :P
 
Errr.... doesn't look like it, otherwise you wouldn't be able to use chat, and your account doesn't say "suspended" or anything on it
 
2:04 PM
I started to feel like this programmer
 
@Unihedro I like that your style there shows gold badges as blue :)
 
:)
Blue badge, platinum badge and glass badge!!
 
Why didn't SO think of doing it like that :p
 
Creepy
 
Fev
the profile page above looks like my friendster profile..
everything is black, including my face
 
2:17 PM
@vaultah looks like I'm suffering from hypothermia and done a bunch of drugs or something :(
 
Yay!!! My evil twin will be arrested by Police for drug usage... I can rule the world happily
 
@thefourtheye mind you - I imagine when pulling all night coding sessions, the amount of coffee I consume probably makes my eyes look like that :p
 
The judge has to believe you Puppy :D They will run a lot of tests on you... Who knows, they might send you to Mars :D :D :D
Laika (Russian: Лайка; c. 1954 – November 3, 1957) was a Soviet space dog who became one of the first animals in space, and the first animal to orbit the Earth. Laika, a stray dog from the streets of Moscow, was selected to be the occupant of the Soviet spacecraft Sputnik 2 that was launched into outer space on November 3, 1957. Little was known about the impact of spaceflight on living creatures at the time of Laika's mission, and the technology to de-orbit had not yet been developed, therefore Laika's survival was not expected. Some scientists believed humans would be unable to survive the launch...
 
But Laika looks more like @thefourtheye
 
Nah, its black and white... Its actually my evil twin only...
 
2:23 PM
I have a sad habit of confusing between twins ;)
 
Fev
haha
 
@Bhargav evil non-identical twins like @thefourtheye and myself? :p
 
Now who is the evil twin ?
(My mind is crapped with dog pics)
 
@Bhargav @thefourtheye is...
 
@Bhargav @JonClements is...
Huh, should you even ask...
 
2:28 PM
Aha ... The profile pic makes it clear as to who is the evil twin
 
@BhargavRao don't listen to @thefourtheye - since he's evil, he will lie...
 
What happened to the cat and the rat ?
 
@BhargavRao My evil twin is good at convincing people
 
@thefourtheye We can have a virtual toss and decide
 
@BhargavRao okay: heads - I'm the good puppy, tails - @thefourtheye's the evil puppy... okay?
 
2:31 PM
Yeah ... Perfect
 
Well - you flip the coin so we get a fair result...
 
Fine ... Up goes the coin
 
Huh, lets go public...\
All the good people in the room, please vote for me as the good puppy.
I ll make sure that, all my puppy bros to not to pee in your carpet...
 
Oh No ... Some (evil) puppy has grabbed the coin
 
Typical of the evil one to resort to veiled threats...
 
2:49 PM
Puppy, give the coin back...
 
Umm.... I think it was one of those chocolate gold coins... :(
It'll be available in a few hours...
 
Yeah, Should have flipped real coin
Be careful, I had mixed sleep inducing drugs in the chocolate coin
 
@davidism errr, I take it it's that dupe? :p
 
yeah
 
from antti import cbg
 
00:00 - 16:0016:00 - 00:00

« first day (1555 days earlier)      last day (3396 days later) »