User Controls
Posts by Parker Brother
-
2015-12-04 at 6:52 PM UTC in Anyone here have video game dreams?I've had a couple of Doom dreams in my life. One when I was a kid, after playing it for the first time, and the other just recently after playing Brutal Doom.
Both were pretty terrifying. Doom is very stressful. You're just minding your own business, looking for a red keycard, then you enter a dark room and you hear a door open and you turn around and suddenly there are 400 robot spider demons chasing you. -
2015-12-04 at 6:27 PM UTC in What month were you born in?December. It will be my birthday in three more days.
-
2015-11-25 at 5:40 PM UTC in What you niggas be drank on?I actually drank a couple bottles of my homebrew oatmeal stout for the first time last night. It turned out pretty well. My brother seemed to like it, too. 31 more bottles to go.
-
2015-11-20 at 6:04 PM UTC in Do you ever eat spam?I've tried it a couple times in my life, but I wasn't able to eat it. I really don't like canned meats. I don't think they smell good.
-
2015-11-03 at 6:58 PM UTC in Happy Halloween!I went to a party dressed like Patrick Bateman from American Psycho. I wasn't very happy with the costume because the suit was way too big and I couldn't find a raincoat, so I had to use a poncho. I looked more like Patrick Bateman's son wearing his dad's clothes.
-
2015-10-26 at 7:13 PM UTC in Sometimes the earth seems not NOT big, and other times it seems REALLY HUGEWhen I was a young kid I knew the earth was round and I'd look to the west and see mountains, then I'd look to the east and see mountains and I assumed they were the same mountains. I thought that if you walked in a straight line west, you'd walk up the western mountains, then walk down the eastern mountains.
-
2015-10-26 at 6:54 PM UTC in Wats the most unordinary meat you've ate?Frog maybe? I went frog gigging one time with a friend. I shined a flashlight in the frog's eyes and he stabbed them with a spear. After we caught a few we cut their legs off then went back to his place and breaded and fried them.
They weren't bad, but the next day I got a really bad stomach ache while getting my eye's examined at the Optometrist.
The same friend once asked me to sample some taco meat. After I took a bite, he told me it was deer tongue. -
2015-10-24 at 9:38 PM UTC in Vizier is Dead!I think Vizier lived in Sonora. If that's the case, it looks like he'll be fine.
-
2015-10-17 at 1:28 AM UTC in Passing options/args and class questions. (Python)
Alright, so where you type object.doSomething() i should put the name of the method from the class i want to execute right? So if i have a method called send_packets i should type object.send_packets() or not?
Yeah, that's right. And maybe your scan option doesn't work because you wrote "elif a in ..." instead of "elif o in ..." like all the other ones? -
2015-10-16 at 6:12 PM UTC in Passing options/args and class questions. (Python)You can't call modules, you'll need to call a function in that module. You could create a function in "scanner.py" called "scan" and do "import scanner; scanner.scan()" or you could just import the function from scanner and call it with "from scanner import scan; scan()".
Importing a module executes any code in it that isn't in a function or class, so if "scanner.py" is like that and you just want to execute it, just importing it should do the trick. Just remove the "scanner()" line.
Edit: Somehow I missed the part where you said you wanted to import a class. Importing a class is just like importing a function: "import module; object=module.Class(); object.doSomething()" or "from module import Class; object=Class(); object.doSomething()". -
2015-10-09 at 7:25 PM UTC in Algorithm for photo enhancementI suppose you could generate images of the diagonal line and checker box patterns the same size as your source image, then analyze your source image and for each pixel that should be patterned, sample the corresponding pixel from the pattern image and copy the pixel to the source image.
As for calculating the darkness/lightness of a pixel, here are some algorithms. Check out the first answer:
https://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color
OpenGL is well suited for this sort of stuff. It would be very fast, too, due to all the calculations being performed on the GPU. -
2015-10-05 at 5:43 PM UTC in Whats the most sugar you eaten at once?I took a cooking class in highschool and one of the dishes we made was "fruit pizza". We used sugar cookie dough as the crust, cream cheese frosting as the sauce, and covered it with various sliced fruits.
We ate it and washed it down with Kool-Aid. It was actually really good, but I didn't feel so good afterwards. -
2015-10-01 at 7:13 PM UTC in Combining two python programs?
Word, thanks for the reply. But it needs to go in reverse. I want to call the second script from within the PyCat script and have it execute by means of a command line argument.
Ahh, ok. Well, Python's subprocess module might be what you need, then: https://docs.python.org/2/library/subprocess.html -
2015-10-01 at 6:31 PM UTC in Combining two python programs?Damn it, I spent like 20 minutes writing a post on my tablet, but then I touched the wrong thing and lost it all. I'm at my computer now and I'll recreate it:
In Python it's real easy to import one file into another. Just put both of the files in the same directory and use the import statement. If your PyCat program is named "pycat.py", you can import it into the other program with "import pycat".
To do it this way, you'll need to make a function in PyCat that the other program can call. It should be just like "main", but use function arguments instead of command line arguments (argv). Let's call this function "execute".
Then you'll need to do something to prevent PyCat from calling "main" when it's imported. This can be done by replacing the last line of PyCat, "main()", with:
if __name__ == '__main__':
main()
Now "main" will only be called if the program is run directly, not when it's imported from the other program.
Now you can import PyCat into the other program and run it with the "execute" function:
import pycat
pycat.execute("192.168.0.1",5555,listen=True,command=True) -
2015-09-24 at 5:12 AM UTC in What Games Are You Currently PlayingPretty much exclusively Battlefield 4. Both my brothers play too, so most of the time I play with them.
-
2015-09-18 at 8 PM UTC in Someone explain this hexdump function to me.The if/else statement you refer to is Python's version of the Ternary Operator. It is pretty much shorthand for
if isinstance(src,unicode):
digits=4
else:
digits=2
In most other programming languages the Ternary Operator is written as
[i]condition[/i]? [i]true_value[/i]:[i]false_value[/i]
So that line would be written as
digits=isinstance(src,unicode)? 4:2
-
2015-07-22 at 5:19 PM UTC in post your favorite album covers
-
2015-07-02 at 5:46 PM UTC in What's the temperature where you're at?90 degrees F (32 C) here in Montana. Luckily it's only 73 F (22 C) in the basement.