« first day (961 days earlier)      last day (3990 days later) » 

4:25 AM
Anyone here familiar with OAuth2?
 
 
2 hours later…
6:02 AM
(Spam post.) If anyone can help me with stackoverflow.com/q/16862660 (there, of course, not here), I'd much appreciate it.
 
 
1 hour later…
7:30 AM
hi
 
howdy
 
hi there
 
@InbarRose got a cold to go with the headache now - w00t!
 
How's you?
 
7:44 AM
Hows I?
 
Indeed
 
Struggling with stupid VMs
 
Delete them - delete them all!!!! muu hahahahahahaa
 
erm, no,.
That is pretty much the backbone of the company :P
We need them!
 
Oh... don't listen to my solution then....
 
7:49 AM
I wasn't planning on doing so.
I have an annoying VM, each time it reboots it switches its IP.... :(
And the linux pros aren't here yet (I came earlier today) so I am trying to figure this out by myself
And it is not going very well
 
Umm... I believe it requires a sacrifice of a first born...
 
That is the problem!
Damn, I knew I forgot something,.
 
Or possibly a text editor and /etc/network/interfaces.
 
oh
That is the path I have been looking for!
 
@Cairnarvon umm, but where's the fun in that?
 
7:54 AM
@Cairnarvon Do I just write the "ifconfig eth0 IP netmask MASK up" line under eth0 ?
 
No. man interfaces.
 
iface eth0 inet static
    address IP
    netmask MASK
?
 
Probably, yes. Also a gateway. It depends on what you want it to be.
 
How do I keep the hostname from changing on reboot?
 
Sacrifice the second born?
 
7:58 AM
No man, I found a loophole!
Python chat on SO! :)
 
/etc/hostname
 
Ahhh - yes - it's easy to forget about that...
 
If you aren't getting your IP through DHCP you presumably aren't sending out DHCP requests at all, so it won't even try to change your hostname anymore anyway.
 
Yes, But I need to do some rigorous setup on this machine.
The hostname is part of the testing.
I am pretty sure I am good now :)
 
Some deity may not be too impressed though...
 
8:00 AM
Except I want a nice colored shell.
And the shell is all black and whitey :(
Other VMs have nice colors
Mine sucks :(
 
Ahhh.... go for flashing green on flashing pink - awesome setup
 
github.com/Cairnarvon/dotfiles/blob/master/.bashrc This is my .bashrc. It's full of colour.
 
Nah.....
@Cairnarvon I am lost
I am not a linux pro
I know basics
 
Don't forget to add the obligatory ASCII art in /etc/issue and /etc/motd.
 
this VM is just another VM in a vast array of automation machines.
 
8:03 AM
Aww - are fortune cookies no longer cool?
 
ANSI escape codes are the thing to google if you want colours or animation or things that make your eyes bleed.
 
I just want so that when I connect to it, the prompts will have color so I can easier read and go through what is going on the screen
 
The prompt is the PS1 environment variable.
Mine is overly complicated because I have a thing that displays more information when the cwd is a git repository.
Oh. It's 10 AM.
I guess I forgot to sleep.
 
Wow - errr - kinda sucks noticing that...
 
top of the cabbage to you, tomatoes!
 
8:07 AM
yam you
potato?
 
:D
always nice to see you, inbar ,)
 
You called me a tomato.
So yam you.
 
CheckiO keeps adding problems that have pretty much the same solution. I think I've used A* five times now.
 
Also, i'm banana, melon.
 
8:10 AM
@Cairnarvon it hasn't quite roped me in... Found it a bit boring - but then, only did a couple of things
 
Some of the harder problems are fun, but a lot of them are just chores.
 
I suppose it'd be more fun if it wasn't just a case of looking at something, and thinking "oh that's the whatever problem, I can use whatever" - been there done that...
 
Apparently the best solutions to the problems in the GitHub sections can win free paid accounts, but there aren't any details about when that's judged or what the terms are.
 
umm, that's something I suppose, but strangely doesn't motivate me...
 
Mostly I just like implementing A* a bunch of times. It reminds me of my AI class in college, which was the only decent class we had.
And I'm doing all of the problems in Python 3, which is good practice. I mostly use 2.6 otherwise.
 
8:21 AM
cabbage folks
 
@BasJansen greetings and salutations
 
8:48 AM
people who put reload() statements in production code deserve to be shot in the balls
 
@ThiefMaster with a shotgun - at close range - repeatedly
 
Dragon's Breath is an exotic 12 gauge incendiary round. Dragon's Breath is primarily made up of magnesium pellets/shards. When the round is fired, sparks and flames can shoot out to about 100 ft. Dragons Breath is normally chambered in 12 gauge 2 3/4" shot shell. They are safe to fire out of an improved cylinder bore as well as a modified (tactical choke) barrel, commonly found on Remington 870 tactical, security and express model shotguns. While its tactical uses are very limited, the visual effect it produces is impressive, similar to that of a short-ranged flamethrower. The rounds are...
^ with this ammo
 
That looks like a fantastic idea - I'll go with that
at close range- repeatedly... ;)
 
just spent half an hour debugging why isinstance(some_instance_of_X, X) failed even though type(some_instance_of_X) and X had the same reprs (but were not equal for no obvious reason)
 
Ahh - strangely - I never know whether I feel better after having solved such debugging problems, or just more pissed off that it existed in the first place...
 
8:55 AM
cabbage
 
howdy @Volatility
 
cabbage-cabbage
 
cabbage - cabbage = umm, None or 0 ?
 
@JonClements I believe you get an empty cabbage patch
 
:) Oh, I did not know, we have operators in the SALAD LANGUAGE
 
8:59 AM
NoCabbage ?
MoreCabbageRequired?
 
Blasphemy?
 
Oooo - that's a cool result
DieYouUnbelievingFiendDieDieDie
(or is that a bit harsh)
 
:D
Traceback (most recent call last):
  File "cabbage_patch", line 1, in <module>
    cabbage - cabbage
Blasphemy: there must always be cabbage!
 
"Cabbage is eternal - There is an error with your universe"
 
I almost managed to destroy my stapler
 
9:11 AM
Did the stapler grieve you in any particular way to deserve its fate?
 
erm, it failed to staple my paper?
 
Umm.... Seems somewhat harsh a punishment - not going for a three strikes and you're out kind of rule?
 
Well, I did say "almost"
I seemed to have tried to use it to staple too many pages
 
So, through your own action, you ended an innocent staplers life?
 
No, just momentarily made it unconscious
It's fine now, after my desperate attempts to bring it back ;)
 
9:17 AM
phew - my faith in humanity is restored!
 
@JonClements really?
Is it really restored? Your faith in humanity because of a stapler?
 
I fear that should I set any target even more remotely taxing, I shall be faithless for evermore? :)
 
is a stapler one who staples or is it the stapler itself? ;)
if the first, then Volatility is a harsh employer and or slaveowner.
 
9:32 AM
indeed...
 
I was talking about the plastic/metallic object
 
Umm, so it's not made of solid titanium then?
 
Was it necessary to include the "solid" part? I don't think anyone would have assumed it would be made of "liquid" or "gaseous" titanium?
 
It's one of those lightweight ones
 
Titanium is a metal.
 
9:40 AM
The tiny staplers that you can carry around in your pocket
 
Umm, cold use a nailgun instead?
people might get a bit funny if you carry those around in your pocket though
 
Staples are for amateurs.
 
fancy!
 
I remember seeing them as a "new idea" on TV :)
 
 
1 hour later…
11:15 AM
Hello
 
hello maxpower
or as we say here in Python
CABBAGE!
 
cabbage
potato
 
im banana, melon, and you?
 
just working on some script while at work
trying to figure out some stuff
 
Do you need asparagus?
 
11:18 AM
i'm not too familiar with this terminology
 
Cabbage
 
cabbage Harry
 
Asparagus
 
what does Asparagus mean?
 
def processQueue(self):
        threading.Timer(10.0, self.processQueue).start()
 
11:19 AM
help
 
oh ok
 
Does that syntax look Banana
 
Well you could help by looking at my question and then maybe help me figure out the answer some guy posted... but it's a lot of stuff and i'd understand if you can't be bothered atm
 
God the chat really laggs for me
Takes a while to update, anyone else getting that issue?
 
I don't think so
 
11:26 AM
Does my syntax look Banana, not sure if its Banana or not
 
I can't really say since i'm far from being an expert
but it looks quite clean to me :)
 
Lol cool thanks
Melon :)
 
12:04 PM
watermelon :)
 
Potato
 
banana.
lots of ripe bananas.
 
LOl
Will Salad be extended soon, does it allow imports of modules?
 
Soon.
We expand it slowly
We started with only "Cabbage"
and slowly added rhubarb
And then suddenly a big boost of the rest.
We need time for the initial words to set in.
And see if some just suck
And where more are needed. :)
 
Yeah, I fear that I will soon use Salad in the real world
But there will not be a large enough variety of vegetables and fruit to complete the language!
 
12:15 PM
Artichoke!?!!
 
lol
 
guys if anyone feels like he's up for a challenge: stackoverflow.com/questions/16893219/… iv'e been struggling on this for more than a day now and some Asparagus would be quite banana... That emmanuel helped me but i cannot seem to adapt his answer into my current code which is based on read two files at a time with a "with" execution block...
 
First of all
use a "smaller" example
like... 3 lines in each file
and tell us what you want the output to be
To answer that question, I do not need to start parsing your data for you.
And, if I understand correctly, each 'file' is a dictionary?
Why not use pickle?
Also - I can not for the life of me, understand your use-case.
 
12:32 PM
Ok, i edited the examples. And i did write what the output is supposed to be like. And no you do not need to start parsing data for me, this is not an answer and it was not my question. Each file is consisted of many dictionaries that each take up one line. I don't know what pickle is, i'll check that out. My use case is not that complicated, i can explain it here if you like.
 
It is VERY important that you understand something. You are trying to accomplish "X" and to do that, you have thought of method "Y" but it is not working for you, so you come here and ask for help with method "Y" . However - what you should do is ask for help accomplishing the task "X" and saying that you have tried method "Y". Then we can either help you with "Y" or give you a solution "Z" that works better. But giving us only "Y" is not helpful.
Always consult [The Zen of Python](http://www.python.org/dev/peps/pep-0020/jj):
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
 
The XYZ complex is just a matter of wording my question better
 
If the implementation is hard to explain, it's a bad idea.
I am having a TON of trouble understanding what you are trying to do, and why...
 
Are you reffering to "My use case is not that complicated, i can explain it here if you like." as the implementation?
 
What?
 
12:38 PM
I need to compare two files which have the same ammount of frames but different ID's. What i need to eventually write out is the start and end frame of every ID that has a difference between both of the files
 
No
That is wrong
 
What do you mean "why" i am trying to find differences between two video files that are translated into CSV files... do you want me to write a prologue for the answer? it would get edited out....
 
That is not what you have to do
 
How can you say that?
 
you were not given a task "please find the differences in these files"
You were given a different task. Those files represent data from that task, that you are trying to parse.
I posit that there must be better way to accomplish your task than by parsing files and building matches for lines and frames and etc.
 
12:42 PM
This task is only a part of the task i took upon myself. The full code produces these files that i present as an example at the start of my question
 
But why would the code you write produce those files if other code is then reading them? Why not pass the data directly?
And if you are writing them - why not write them in a format that is easier to read?
Have you heard of Pickle?
 
Well, if i figure out how to get the output i eventually need, i might be able to edit the former code and "pass the data directly". And this format is sort of the best i could do. And no i havent heard of pickle but i will check it out.
Also, my eventual output has to be a written text file that will be opened by avisynth... so writing this data as a string and concatenating it to a few other things is more than logical in my opinion
 
Pickling and unpickling isn't really easier than writing repr output to a file and passing the file contents to eval, for data structures as basic as dicts of nested lists of integers.
I'm not fond of binary serialisation formats as a go-to solution. Python may not be the only language through which someone might be trying to read your output.
 
this is a personal tool therefore there is no risk of exposure or whatever... in this specific case
 
Well, it would be MUCH easier, if you wrote the files differenly
Instead of:
{17:[2, [-3, 88, 16, 28], 3, [-6, 84, 20, 32]]}
Use:
{17: {2: [-3, 88, 16, 28], 3: [-6, 84, 20, 32]}}
Then it can simply be read with ast.literal_eval()
 
12:51 PM
ok
are those dictionaries inside a dictionary?
 
yes
Which is OKAY
the whole file could then have a {} around it
and then you would have a single dictionary per file
which had outer_keys which are what you called "frames"
and inner_keys of what you call "ids"
 
yeah
 
Then you would solve your problems
 
Well this is how i format the lines '{{{}:{}}}\n'.format(frame, rects)) Rects being the 4 values in each list
 
the files would look like this... small sample:

{
16:{3: [-7, 87, 20, 32]}
17:{2: [-3, 88, 16, 28], 3: [-6, 84, 20, 32]}
18:{2: [-1, 88, 16, 28], 3: [-3, 84, 20, 32]}
19:{2: [1, 89, 16, 28], 3: [-2, 85, 20, 32]}
}
and you can just read the entire file into a dictionary of the same structure with ast.literal_eval()
 
12:56 PM
alright, i'll try that
thanks.
 
No problem.
If it works - don't forget to Answer your own Question with your solution to help others.
 
yeah i doubt that will happen anytime soon
 
Don't be hard on yourself.
 
Just being realistic :)
if i remove the id's from the equation it might become more simple
but that would kind of defeat the purpose
 
@InbarRose Or you could read it with json I believe.
 
1:08 PM
@mgilson Yes actually, in that format you could read it with json as well
But I don't think json comes bundled with Python.
 
Sure it does
import json
 
really?
I always thought I had downloaded it somewhere and forgot.
 
Cool, pleasantly surprised.
 
Before python 2.6, you needed to get simplejson I believe
 
1:10 PM
Maybe that is what I remember.
 
but, I think that's about the same time-frame for ast.literal_eval
 
well, before that it would be simply eval()
and then an arrow to the knee.
"I used to be a Programmer - but then I took an eval() to the code"
 
lol
 
It is a lot better than "I used to be an argparser - but then I took an error in the tee"
 
Oh tee
How infrequently I use that command.
 
1:14 PM
:)
Ever since you took an Error in it.
xD
 
Zac
Whats the name of those data structures that like a vector you can pop and push stuff on both ends ?
 
queue?
 
Zac
ah yes a deque
 
1:16 PM
(yes kevin, I modified my post on purpose to be JUST like yours - only Python2)
 
Good answers naturally converge towards one another :-)
 
great minds and all that jazz.
 
Zac
I think thats what I need, I'd like a string store of 3 compartments that when you put a new one in the last one pops off
 
BTW - cabbage @Kevin. Welcome out from Lurk mode.
 
Thanks. I've been in my own little world all morning.
 
1:18 PM
@Zac -- That's a perfect use-case for a deque
compartments = deque([],3) will create a container than can hold at most 3 elements
 
It's been a philosophical day for me. I've been trying to reconcile my feelings about my own work ethic. Usually I rationalize goofing off as, "programming is an art, and artists tend to have peaks and troughs of productivity"
But now I'm wondering if that line of thinking stands up to scrutiny.
 
What triggered the question?
 
Maybe programming is more like a craft. You don't need a burst of inspiration to build a birdhouse.
 
If i do this; processQueue(self)
And it says self is not defined
What issue am i having here
 
Zac
nice thanks, @mgilson now I just need to find a deque in Actionscript 3
 
1:21 PM
@HarryBeasant Depends - are you in a class?
 
If a craftsman is really good at his craft, it can become art @Kevin
 
Not in a class
 
then self does not exist
 
This has all come about because I've got a work assignment that I've struggled to find a "nice" solution for.
 
@Kevin -- I suppose that depends on how much you care about how creative the birdhouse is
Personally, I think that there's a time and a place for "just get it to work"
 
1:22 PM
If I sit and think for a few more weeks, I'm sure I'll come up with an elegant solution. But perhaps there's a solution that requires less thinking and more typing.
 
and a time and a place for coming up with a really good solution.
 
@Kevin Some people like to define programmers as people who write code. But that is not true, you do not just write the code, you have to conceive of it, and plan it, and go through the logic. It is an artistic field. Most of your time is spent thinking, not doing.
 
Ah okay
Let me make a class
 
Often I find that the process of just getting it to work sometimes gives the inspiration necessary to create a really good solution.
 
I've heard that before, in the form of "plan to throw the first implementation away"
 
1:24 PM
@Kevin I often do that at work
 
I don't know if I'd say that
Just whatever you do, make sure that every little piece of it is written clearly
 
Everything is modular, and the circle of programming just constantly goes around and improves the old modules, and constantly increases the circle of modules as it goes around, until you have a group of very well functioning modules
 
Some tasks don't lend themselves to "nice" solutions
 
And sometimes they need to be completely rehauled because of new features, or specs.
 
But as long as each piece is clearly documented, I think you're Ok
 
1:25 PM
My primary intrinsic motivation is to write beautiful solutions. But this doesn't always jive with my employer's motivation of "get a working product in a timely fashion"
 
Well, I agree with @mgilson here "Get it to work" and then "improve the hell out of it"
 
Yes, it would make my job a lot easier if I could adopt the "get it working" mind set.
Now, how do I change my mind set?
Brain surgery? Powerful magnets?
 
beer
 
well.... don't.. just realize that sometimes it is better to get something working in a BAD way, so that you can better to see how to do it in a GOOD way
the wright brothers didn't just sit in their garage for years and then suddenly come up with a plane that worked, they did trial and error.
Thomas Edison tried to invent the lightbulb like 600 times, and when asked he said "I didn't fail 600 times, I found 600 ways NOT to make a lightbulb"
 
yeah, second that last statement
 
1:29 PM
So - you need to channel that pioneering spirit. Just make it happen, see what is and isn't good. And improve.
 
just did an algorithm here at work which was horribly implemented but then i spent a few hours today refactoring it.
 
If you hope to create masterpieces without many iterations of crap, then you are going to be dissapointed.
 
and the code i had and the code i now produced was horrible and less horrible but still i saw improvements and it worked a tiny bit better.
 
Think of this very site many questions are about "I am trying to do X, but it is not working" and then there are people who answer, "do X this way" and "do X that way"... and eventually the "best" way is chosen.... with many working methods.. none of which are "bad" they just are not "the best"
Well, I have exhausted my motivational speeches for today.
 
I do like the "fast prototyping" design method, in principle. It's why all of my home projects are in Python :-)
 
1:33 PM
disclaimer, the best answer is not always chosen ;-)
 
Now to take these lessons, and propagate them downwards into my subconscious, and lizard hindbrain. So that the next time a problem comes around, I am not tempted to just stare at a wall until the best solution appears fully formed from the ether.
 
@Kevin Good luck.
 
i'd say it depends on how long it takes for such solution to manifest :)
 
@MaxPower Don't start.
 
Seems like all of my hardest problems are in the realm of psychology and not actual computing >:-(
 
1:41 PM
haha
 
We are trying to Ween him OFF doing that.
 
There is no ether [Michelson and Morley, 1887]
 
I have little interest in squishy biological computers! But my own requires so much troubleshooting.
 
If i wanted to access a function within a module, within a class
How would i do that?
 
@mgilson, next you'll be telling me there's more than four elements.
 
1:43 PM
earth, air, fire, water -- What else could there be?
 
import QueueProcessing
 
`from module import class
class.myFunction()`
 
electricity?
 
Class in the module is called QP = class QP:
 
you make an instance of that class
 
1:43 PM
And then the function is = def ProcessQueue():
 
just like you do a = list()
and then you have a.pop()
pop() being a method of the class list.
so you would do
a = QP()
a.ProcessQueue()
 
@mgilson Heart?
 
@mgilson Energy ;-)
 
@K.Niemczyk -- That's just necessary for captain planet -- It's not really an element
 
1:48 PM
Okay cool
 
rbrb
 
@InbarRose -- You mean to say "whatever bruce willis is made of"
 
Also, lets say im running a function from within a class
Do i have to specify the class as well
Like QP.processQueue()
If the class is QP:
 
self.processQueue()
 
1:51 PM
You should read about Classes.
 
Should i specify self in the class
 
Okay thank you
 
Is it possible to convert a file object into a string without reading it? does that make sense?
 
1:53 PM
@MaxPower -- Doesn't make sense to me ;-)
What do you want the string to contain?
 
the file's interior
 
what's wrong with f.read()?
 
with open(PATH) as f:
    for line in f:
        # code
or...
with open(PATH) as f:
    content = f.read()
 
Does this merely pause the script? threading.Timer(10.0, insert).start()
 

« first day (961 days earlier)      last day (3990 days later) »