« first day (1 day earlier)      last day (38 days later) » 

12:00 AM
The little shooter things in Blek are a challenge.
 
I'm answering questions, don't know why there's a lot of simple questions but nobody go to answer them.
 
¯\(°_o)/¯
 
@TigerhawkT3 Do you think this question is too broad? I can do it, just check the output of ps command and use os.system or subprocess to run the gedit. But that's sounds like So look here, I wrote a program for you.
0
Q: how to write bash to restart open programs (good start already)

Thomas SheraEDIT: The goal is to have all programs open how they were when the computer was last used. This is automatic unless the computer has been turned off, which is what I am trying to program for here. This is like custom version of Windows' programs to auto-start on boot. With chrome I can open all ...

I don't think his start is good.
 
Checking now.
Looks like pseudocode with everything after time.sleep being bash commands, right?
 
Yep
And While True <--- While should be while.
 
12:13 AM
So the answer would consist of Python code to run those commands and operate on the results?
 
Nope
He want the program save the processes before last reboot. And run them again.
 
Oh, he would also need the "something" after gedit?
 
Yeah
I was thinking that he just want run a program again if it has been killed, but looks not now.
 
I don't know how much code that would require. I can't tell if it's too broad.
 
I think...the hard part is: We need save the last session.
As he said:
 
12:16 AM
The simplistic answer to that question is "use Sleep or Hibernate."
 
> With chrome I can open all my tabs from previous browsing session. I want to apply this to all programs.
The hard part is: He wants the program save the last session.
 
Sounds like it would have to save the program's RAM contents to disk, then unpickle it.
By far the easiest way to do that is with Hibernate.
 
@TigerhawkT3 Hmm...seems so.
 
Or with each program's Save function (most programs remember settings already).
 
@TigerhawkT3 Oh yeah, Hibernate is good. Then you can go to comment :P
 
12:18 AM
I will.
 
Okay, and now I found another dupe question: stackoverflow.com/questions/34582956/…
 
Answered by a gold tag badge user. I'm not even gonna try.
 
BUT THAT IS CLEAR A DUPE QUESTION, HAS BEEN ASKED AT LEAST 1000 TIMES.
 
It's apparently a good, well-researched question, judging by its votes. Judging by the answers, it's worth answering. Judging by their votes, they are imparting new/useful information.
I agree that's it's an easy dup, but you underestimate how much people care about closures on question's they've answered.
 
But remember, close a question as dupe doesn't mean that it's a bad question. For example, our system auto delete closed questions foobar days later, but expect dupe questions. Also we can use it as a dupe target even it has been closed as dupe right?
 
12:25 AM
What would it accomplish, anyway? It's a very basic question and there isn't much to say about it other than "Python 2's input() evaluates; use raw_input()."
One DV reason for questions is lack of research.
 
Yep, but DV != CV.
 
Yep, not all dup questions deserve a DV. Sometimes the terminology is very specific and you would basically have to already know the answer to find the question.
The other end of the spectrum is "I Googled your title and the answer was the top result."
 
So however, I'd say vote to close it as dupe. But downvote isn't needed. Agreed? Because it's a clear dupe question, I think the answerers wouldn't go to reopen it.
 
"I think the answerers wouldn't go to reopen it." I used to think that, too.
Then I learned better.
 
If you don't think so, what about give SOCVR this job? And let's see what'll happen.
Searching for keyword Python input NameError, and got lots of dupe targets.
Voted, found a dupe train: A dupe B dupe C dupe D dupe E...
 
12:38 AM
Yep, appropriate for regular SOCVR.
But I only closed something like two questions yesterday, and one of them got reopened by one of its answerers.
 
Yeah, I know. When I'm back and checking some dupe questions, I found it and saw you were talking about it in SOCVR.
Just saw you hammered a question :P
 
I did. I sure hope it sticks.
It's a fun gotcha that everyone likes to go on and on about.
It shows that you understand pointers and are therefore a Real Programmer.
 
RealProgrammer™
Well, I also want a hammer, that's so cool...like the below one:
 
You'd have to learn PHP for that one.
 
lol
 
12:45 AM
People sound so frustrated when they talk about PHP.
 
Opening PHP room and see what's people looks like.
 
Do you know how many built-in functions PHP had as of 2010?
 
Well, never try to learn PHP, so no.
 
The first sign of a problem is that it's an SO question with four different answers and no one seems to agree on an exact number.
 
Huh, there's 151 things in Python builtins module.
 
12:49 AM
The largest-value answer is 16.6% larger than the smallest.
 
7
Q: Total number of built-in functions in php?

coderexdoes any one know how many built in functions are there in PHP (latest version)? Thanks

 
But generally it looks like somewhere around 5500.
Yep.
You passed the Google test! You are officially more capable than 95% of SO question askers.
 
lol
A more interesting question about PHP:
114
Q: Why are the built in functions in PHP named so randomly?

Rich BradshawIt seems that there is no real pattern to the way functions are named, str_replace, strrpos, strip_tags, stripslashes are just some. Why is this the case? EDIT - this wasn't meant as a "troll" type post - just something that I think everytime I use the language!

 
Some languages (like Python) are created. Others just happen, and no one wants to take the blame.
 
Yeah, so let's see how does PHP create a new function (name):
>>> import random
>>> import string
>>> ''.join(random.choice(string.ascii_letters) for i in range(12))
'NgLlKOSWPAVY'
>>>
brb
 
12:57 AM
Good naming convention.
 
1:13 AM
Brb as well.
 
Back
@TigerhawkT3 What's possible wrong when UnboundLocalError: local variable 'name' referenced before assignment raised?
 
2:03 AM
@KevinGuan Back.
name doesn't exist at that point. I'd need to see more before I could get more specific.
 
@TigerhawkT3 Okay I've got it. Because the file is empty (answering a question, and OP says it raised the above error).
1
A: Change text in file with Python

Kevin GuanWhat about try replace tip = True with type = 'True' and replace str(red) with '/'.join([username, lel, type]) like below? def false_to_true(): name = input("Input name: ") with open("users.txt", "r") as file: # I'd also suggest use `with` here lines = file.readlines() for...

^ That one
 
Checking.
type masks built-in type() by the way.
Why is there a while in there at all?
 
2:21 AM
That's OP's code, not mine.
I'd say that question is little No MCVE. Since: 1. OP's code actually doesn't gives the expect output, maybe he just wants change all False to True which in his file. 2. However, OP's now asking another question below my answer about his another function...
However, I do can rewrite his code and do the same thing or he expected thing (possible) in simple way, but in my answer, I was just want fix the error in his code.
 
Does he just want to enter a bunch of names and change False to True for them?
 
I think so, but not sure.
 
Because that would just be:
with open('names.txt') as f, open('result.txt', 'w') as out:
    names = {name for name in iter(input, '')}
    f = ['{}/{}/{}'.format(a,b,'True' if a in names else c) for a,b,c in (line.split('/') for line in f)]
    output.write('\n'.join(f))
 
2:48 AM
@TigerhawkT3 Well, I still think use str.join() would be better, and there's some bugs in your code:
with open('users.txt') as f, open('result.txt', 'w') as output:
    names = {name for name in iter(input, '')}

    l = ['/'.join([a, b, 'True\n' if a in names else c])
         for a, b, c in (line.split('/') for line in f)]

    output.writelines(l)
Sorry, was afk.
Problems in your code:
> 1. output.write('\n'.join(f)), but open('result.txt', 'w') as out:.
> 2. Your code's output looks like:
Marko123/male/True
Mimi007/female/False

John33/male/True
Lisa12/female/False

Inna23/female/False

Alisa27/female/False
Because the list is:
['Marko123/male/True',
 'Mimi007/female/False\n',
 'John33/male/False\n',
 'Lisa12/female/False\n',
 'Inna23/female/False\n',
 'Alisa27/female/False\n']
 
else c.strip() then.
 
Yep, I know. But this would be more clear.
Depends, on the value of clear.
However, you can go to post an answer and hope OP check that :P
 
I don't know if that actually is what they want, so I'll leave it alone.
 
Fine, I'll check if OP reply my comment. Otherwise I got 10 free rep :P
Let's talk about something funny, do you know that ROs can star their own messages?
^ Like that
 
Oh, for announcements I guess. Makes sense.
 
3:01 AM
Yeah, I thought that it's a bug and posted a question on MSO, and got .
And, try post a message with <(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+>. (Like this message).
 
 
1 hour later…
4:29 AM
I've been coding today, and spending a lot of time tracking down mistakes like this; and deleting a flag right after I set it and then wondering why there are no flags.
I had been deleting "killed" targets, so I unthinkingly did the same for targets that shoot, forgetting that I needed to track the shooting state.
 
@TigerhawkT3 Now I understand what's you talking about in SOCVR :P. Let me check.
@TigerhawkT3 Vote to close your question as No MCVE :P
 
I mean, I had something like l = [{0:5, 'flag'=False}], and then looping through with for obj in l: if condition: obj['flag'] = True; break, and then right after I would l.pop(idx) that dictionary, and later I had if not any(d['flag'] for d in l): and it was giving the same result every time, because l was empty.
Save a state, then immediately delete it, then wonder where it went.
Well, the shooters are working. Next up: make them rotate.
 
4:46 AM
Revote as No longer reproduce.
 
"nvm sry guys i fixed it lol can a mod pls delete thx for ur help happy new year"
 
lol
Typo in the above message of mine: what's you talking about should be what's you are talking about.
 
 
2 hours later…
6:38 AM
@TigerhawkT3 Are you here now?
 
Yep.
 
A question: How to use Windows environment variable in Python, for example %SystemRoot% ?
 
Great, thanks. Vote to close my question as dupe.
 
:P
(I searched your profile for such a question and didn't find it. genius)
 
6:42 AM
lol
Didn't really ask a question like that.
Wait, os.getenv('%SystemRoot%') or os.getenv('SystemRoot')? (I need install Windows if I want develope a cross platform program right?)
 
Probably a good idea for testing.
 
Whatever, no enough money to buy a Windows, that's why I use Linux :P (can't believe right?)
 
:(
I suppose you could ask people with Windows machines.
 
Ah yeah, good idea.
Or install Microsoft IE virtual machine
 
There's a free MS VM?
 
6:48 AM
Yep
 
That's pretty cool. Use that. :)
 
Does it let you install things other than IE/Edge?
 
Yep, it's a full VM.
I've tried it before, that's very good...and free.
 
That's... impressive.
 
7:01 AM
Didn't hear about it before?
 
Nope.
 
Huh, that's fine.
 
VMs of every OS they've released for the last 15 years... for free...
 
Yeah, and you can use them do everything.
Also no need install. Out-of-the-box.
 
I suppose the performance isn't as good as running the actual OS.
 
7:06 AM
Huh, I tried Windows XP IE 6 on my Linux machine with Virtualbox, since my computer only has 2G RAM so I only gives that VM 812M RAM. However, my Linux and VM both was running fine.
 
:P
I'm not saying the performance will be bad, just that it won't be as good as running it without a VM. I mean, you would then be able to give Windows 2GB of RAM instead of 812MB.
I'm sure it's fine for testing compatibility stuff, which is what it's intended for.
 
Oh, that. Yeah.
About that question, what do you think about my edited answer?
 
Note that those VMs expire after 90 days. MS recommends you take a snapshot so you can roll back. I don't really know what that means.
If he doesn't care about order, that's a good solution too.
 
@TigerhawkT3 That means VMs will die after 90 days if you don't have enough rep for them.
@TigerhawkT3 Ah, I should mention that in my answer.
 
Rep?
 
7:23 AM
Oops, I mean gasline.
:P
 
:P
.items() OOPS
Probably a sign that I should get ready for bed. I woke up early today, so I'm a bit tired.
@KevinGuan I might be back on a bit later if I feel up for it, but going AFK for a while.
Never mind I'm back.
 
7:53 AM
Sorry, was afk.
@TigerhawkT3 So where are you from?
However, it's just 4 PM here.
 
8:14 AM
Hey, I'm in PST (UTC-8).
 
So here's UTC+8, then it's 16 - 8 - 8 == midnight!
 
Yep!
 
Okay, sleep well if you'll go to sleep :)
 
In a little while. :P
 
8:21 AM
I was briefly excited because I saw something about "angle" in Tkinter documentation but then I saw that it was for a different widget. :(
It would've been nice if there was a neat little rotation method built in.
 
Back, was eating lunch. (Yeah, eat lunch at 16:20. Don't know when I can have dinner :P)
 
Nothing wrong with a late dinner. :)
 
@TigerhawkT3 Well, I don't use Python develop GUI programs. So don't look at me.
@TigerhawkT3 Yeah :P
 
It works okay.
 
still don't look at me.
 
8:36 AM
Don't look at me either. I'm sure I'm supposed to use Pygame for this sort of thing.
 
Turned off my eyes.
 
I only have two major features to implement: shooter rotation, and portals.
 
Wait, what are you designing?
 
The Blek clone, remember?
 
> Blek is a 2013 puzzle video game for iOS and Android by Kunabi Brother, a team of brothers Denis and Davor Mikan.
Got it.
 
8:45 AM
There are dots to avoid (that I call bumpers) and dots to hit (targets). You draw a shape, and when you stop touching the screen it repeats that shape starting at where you ended.
I think I linked you a GIF?
 
Yeah, really understand now.
 
Now I have to figure out how to move a point around a bounding box.
 
@TigerhawkT3 Oooooooh, sounds funny.
 
Yeah, I'm having such a good time with it. -_-
 
Okay, let's talk about answer questions. Do you understand this?
0
Q: Iterative to recursion function for non-tail recursive methods

aswinI am trying to write an iterative method for the following recursion program. I tried multiple methods but that got me nowhere. I tried Googling too but was not able to figure it out. Could someone give me some idea on how to deal with it? Please note that my function is non-tail recursive. I h...

 
8:53 AM
Looks like he just wants to make it iterative instead of recursive. Good practice. Probably homework.
It doesn't look fun.
 
Huh, seems so.
Always so funny:
 
Such a joker. :P
Is that the "this was a test to make sure you're paying attention" thing?
 
Yep
 
9:09 AM
Okay, I think I figured it out, with minimal repetition and still clear.
 
About that Blek?
 
Just the path around the bounding box thing.
I have an x1,y1 for one corner and an x2,y2 for the opposite corner.
 
Oh, so with minimal repetition rep and still clear. :P
 
And then I have a point somewhere on the border which I would like to move along the border in a circuit, like a marquee (but with only one "light").
Yeah, I'll get no rep from this one. :P
Although there is one question about something else that I've been thinking about posting for weeks, but haven't gotten around to it.
 
Wait, you're doing all of them use tk? How is that possible?
 
9:17 AM
With tons of LoC.
 
Great, never hear about that.
 
I ran it and it was wrong.
But it was close!
And no error!
 
Then what's wrong?
 
I'm trying to find a quick GIF maker so I can show you.
Any suggestion?
 
Nope.
I also wish I could find a GIF maker, and I tried 3 or 4 times, but I can't find a good GIF maker on Linux.
 
9:22 AM
There's a square, and there's an arrow in it like a clock hand.
I couldn't even find a good GIF maker that worked for me on Windows. :(
 
Wow, searching for Python GIF maker and found this...I don't think it can works: github.com/python-pillow/Pillow/blob/master/Scripts/gifmaker.py
But still searching.
 
This arrow is pointing southeast (16:30 on the clock). The end is supposed to move left along the bottom edge of the box, then up the left edge, and so on. Instead, it started to move left along the bottom edge... then kept going. Goodbye, arrowhead.
 
Hmm...Cannot imagine without a GIF.
 
Since the coords returned by Canvas.coords are float, it's probably this.
First I'll do some print debugging to check, then I'll cast to int and see if that helps.
 
Fine, however no idea what you're currently talking about.
 
9:29 AM
I will take some pictures.
 
Thanks.
 
See how it keeps going left instead of moving upwards?
 
Hmm...
 
So I mapped the return values from coords() to int, and got an error in my print debugging because you can't do '{:.20}' for integers. Which makes sense.
 
Looks werid.
 
9:35 AM
THANKS
 
lol
 
Still doesn't work. Same behavior. :(
 
Debugging is important than coding <--- Okay I understand.
 
I don't know why it's doing this.
I will have to think.
 
Ah, I can't help since I don't know about it.
 
9:40 AM
No worries; I'll see it eventually.
 
Good luck :)
 
I found it.
And it works now.
My condition to go left along the bottom was "the arrow tip is at the bottom edge of the bounding box" and nothing else.
There was nothing making it stop doing that and go to the else for "up."
 
Congrats!
 
Aaaaaand now I have a ZeroDivisionError.
Changed it back and tested more; that error was unrelated to the fix.
The way I find the direction of the arrow is by doing height / width of the arrow's bounding box. When it's pointing straight up or down... zero width. Kaboom.
It had seemed fine when I was just testing an arrow pointing at a diagonal. :(
 
10 mins ago, by Kevin Guan
Good luck :)
 
9:52 AM
Yeah, lol.
Sometimes the arrow flies off in the wrong direction.
Ooooo I know what I did for that one.
 
13 mins ago, by Kevin Guan
Congrats!
 
I think.
This isn't easy. :P
 
:P
Saved these two messages for when you get stuck and solve it yourself.
 
Lol...
 
Okay, so what about now?
 
10:03 AM
I... don't know.
 
Sounds not good.
 
The single 45-degree angle shooter was working so well. :'(
 
Okay, I don't know anything about it so possible I'm wrong: Isn't just use the same function and just change a number to change the degree?
 
If a single arrow (the rotating one) leaves the screen before the other one hits the target, it's an auto-lose. Oops. And it moves more quickly the more vertical it is.
Well, that would require a rotate function that doesn't seem to exist.
 
@TigerhawkT3 Hmmmmmmmmmmm.......yeah.
 
10:14 AM
I think I'm going to remove most of the manual win/lose checking and just do it every 0.5 seconds or so.
 
Don't understand again. However:
28 mins ago, by Kevin Guan
10 mins ago, by Kevin Guan
Good luck :)
 
Thanks for rubberducking.
 
lol
 
10:51 AM
@TigerhawkT3 Are you free now?
 
I have found new problems in this thing.
 
However, I think all answers here are wrong, and the question is too broad or No MCVE. But they all got upvotes. What do you think about it?
0
Q: Run Python script every 10 seconds

jianbing MaI have a function to do some work. There is 130 million work to do. Currently, I use crontab to run this py script every 1 min. It too long time, I want this py script run to do something first time, and sleep 10 or less seconds, then run second time...It will always run until there is no work t...

 
Sometimes it sends a win/lose message, ends the game, and immediately starts a new one and sends a win message.
When a rotating shooter sends an arrow to the left, it doesn't display the arrow.
:(
Lemme check that question.
 
Thanks, I need afk a bit.
@TigerhawkT3 Sounds that's a big bug.
Really afk now.
 
Ok.
 
11:14 AM
@TigerhawkT3 Back, what do you think about that question?
 
11:28 AM
@KevinGuan I don't think I have enough knowledge about whatever they're doing (crontab).
These arrows hardly work at all. I thought I had them all set up. :(
 
@TigerhawkT3 Ah...fine. Let's forget that and move on.
@TigerhawkT3 Huh? Did you get another issue?
 
If an arrow is pointing at all to the left (from 6 o'clock to 12 o'clock), it flies backwards, in the wrong direction.
                <--
    <-- # should go here
                        <-- # goes this way
                                        <-- no stop
                                                          <-- aaahhhh
 
lol
But from 12 o'clock to 6 o'clock is fine?
 
Yeah.
 
ISN'T THAT STRANGE?
 
11:40 AM
And the non-rotating one that used to be pointing to 1:30 and worked fine, which I changed to point to 10:30, just vanishes.
Yes. :(
 
So debugging isn't helpful?
 
It would be if I were better at it but I don't know what I did wrong.
 
See, it's hard to debug when your code is running but it doesn't give you the expect output.
 
Yeah.
I would really like to know why the non-rotating one disappears.
 
Ask a question on StackOverflow!
 
11:44 AM
"hi guys i have this code that's supposed to clone a popular game and it's not working, the arrows go backwards or disappear " posts 222 LoC "thx in advance"
 
"below is my code which has 2000 lines:"
 
Now that I don't think I've seen.
 
lol
 
Okay, as long as the shooters don't rotate, and as long as they point between 12:00-6:00, it works perfectly.
 
Okay, at least these are good news.
 
11:51 AM
"As long as the fireballs don't bounce, and as long as Mario only fires them to the right, they work perfectly!"
 
lol
 
I thought I would have this feature finished today.
 
Hmm...it's 4 AM there right?
 
Yeah, I need to sleep soon.
 
Wow, I thought that you don't need sleep.
:P
 
11:57 AM
Heh.
 
But... When do you get up?
 
OMG I DID width and 1.
 
WOW, SOUNDS LIKE YOU FOUND THE ERROR.
2 hours ago, by Kevin Guan
13 mins ago, by Kevin Guan
Congrats!
 
CAPSLOCK: THE UNIVERSAL LANGUAGE
 
LOL
 
12:05 PM
Now they just fly the completely wrong direction.
I should call my high school geometry teacher and complain.
 
in SO Close Vote Reviewers, Dec 30 '15 at 1:08, by TigerhawkT3
Asks meta question complaining about Kevin's dup chat
 
Well, I've narrowed it down to the calculation for slope/direction.
 
See, when you know what's wrong in your program, then it's easy to fix it.
 
12:11 PM
Okay, then I was increasing x by the arrow's width instead of the 2 pixels I was using in the last build.
I think I'll just reduce the granularity.
 
:P
And that program broken again after debug.
 
It works.
 
13 mins ago, by Kevin Guan
2 hours ago, by Kevin Guan
13 mins ago, by Kevin Guan
Congrats!
 
This rubber ducks quacks very loudly.
 
Yep.
 
12:14 PM
Good job, duck.
 
If you saw the x1 y1 x2 y2 width height bbox dy * / I had to work with, you would understand.
 
But I didn't see it :P
 
And you were lucky.
 
Why?
 
12:17 PM
Because it was bad.
Okay, that part works. Now I just need to fix the win checking (it's a bit unpredictable), then portals, then some stability testing, then I can make more boards.
 
Good luck!
 
Thanks!
 
And...what's this question asking? stackoverflow.com/questions/34590958/…
 
Beyond comparing lines of two files, I don't know.
 
Me too.
 
12:25 PM
Well, I have to sleep. Talk to you tomorrow. :)
 
12:35 PM
Night :)
I CAN NEVER WRITE CODE LIKE THIS:
0
Q: Invalid syntax error in Python for vigenere cipher

joseph WooollastonMy code has been working before. It now comes up with a invalid syntax error, I do not know how to fix this. According to the error the invalid syntax is with the line, else: (line 14) phrase = input('message you would like to encrypt: ') shift_key = input('shift key: ') def keywrord(key, phra...

That's fine, a tip: I found at least 30 issues. Try to fix them all. Good luck! — Kevin Guan 50 secs ago
 
 
11 hours later…
11:34 PM
@TigerhawkT3 Oh, about that question we were talked about yesterday morning:
-3
Q: Change text in file with Python

Heimerdingerdef false_to_true(): name = input("Input name: ") file=open("users.txt","r") lines = file.readlines() file.close() for line in lines: username, lel, type = line.split("/") while name == username: name = input("input name again: ") tip = True ...

And OP says:
> No, i wont to change False to True only in line who contain inputed username, other lines stay same as before. – Heimerdinger ↵ 8 hours ago
Seems you're correct, then you could go to post an answer.
 

« first day (1 day earlier)      last day (38 days later) »