« first day (963 days earlier)      last day (3968 days later) » 
00:00 - 14:0014:00 - 23:00

12:04 AM
Anyone, feel free to criticize my gits, thanks!
 
Why is GetchUnix a class?
 
12:48 AM
how good is python for game programming on android?
 
 
1 hour later…
2:02 AM
Hi guys, anyone about?
I have a question about pyramid. Is there a way I can create a subscriber inside subscribe.py and add an event handler for NewRequest event type in which I modify the http protocol to https?
 
 
4 hours later…
5:47 AM
Hello
 
Hi :)

I really haven't played around with Python lately so I have no idea about your question... sorry :(
 
cabbage
 
cabbage @limelights
 
6:29 AM
Hi..
 
cabbage all
 
7:01 AM
Banana Morning Folk, Cabbage all.
 
legacy work is underrated
 
I got my code to work as i originally intended :)
now i guess i can start fine-tuning it
 
7:20 AM
Pacific Rim is an upcoming 2013 American science fiction monster film directed by Guillermo del Toro and written by del Toro and Travis Beacham. The film is set in a near future where soldiers pilot giant robots into battle against invading giant monsters who have risen from beneath the ocean. The film was produced by Legendary Pictures and will be distributed by Warner Bros. Pictures. The film will be released in 3-D and IMAX 3D on July 12, 2013. Plot In the near future, giant monsters identified as "Kaiju" have risen from a crevasse in the Pacific Ocean, resulting in a war which takes ...
rofl so cheesy but awesome :P
reminds me of this oldschool game
oh right
King of the Monsters is a series of video games created by SNK Corporation (the predecessor of the current SNK Playmore) for the Neo-Geo, featuring giant monsters reminiscent of kaiju and tokusatsu. King of the Monsters King of the Monsters is a fighting/wrestling game. It was released by SNK on July 1, 1991 in Japan (later released on the Virtual Console), with later ports for the Super NES and Sega Genesis by Takara. King of the Monsters was included as part of SNK Arcade Classics Vol. 1 which was released for the Wii, PlayStation 2 and PSP in 2008. Gameplay Players get to choose any ...
 
@MaxPower Is there a reason you are posting this stuff here?
 
just boredom
 
Shouldn't you be solving your code problems?
Let me see what you have so far.
 
i took a break :) been working hard this past week
 
heh
 
7:27 AM
the refined version of the code you gave me is on hold for now
i will work on making my code more and more similar to it
 
That already looks much better.
But why did you remove all the docstrings?
 
oh, forgot about that, i'll work on adding them in
 
Also - you have this tendancy to want to READ everything, and then work on it, and then WRITE it.
What you should do is read line-by-line and write immediately, that way you don't end up lagging the computer by bloating the memmory.
 
Indeed. file.readlines() is virtually never something you want to use.
To be honest, I would have liked to see it go in 3.x in favour of list(file).
 
You should open f_in1 and f_out1 at the same time, and then for each line in f_in1 you parse it and write it to f_out1 immediately.
 
7:32 AM
It would have made it more obvious it's a bad idea.
 
Then you don't need the frame holder dict.
frame_rects
you won't need it.
There will be no extra memory over head.
That is what I did in my version of your code, I simply read each line and wrote it immediately.
 
Alright
 
also this [row[3],row[4],row[5],row[6]] can be written as: row[3:7]
 
Why not 3:6 though?
 
because you limit it to the 6
you want to get the 6 value
so "everything from 3 up to 7" is not including 7.
 
7:37 AM
Oh i see
 
That is how slicing works.
 
Yeah i have to read about that too
 
Listen - I am going to post a better version of that method for you.
and ffs, stop using CamelCase
this is Python
 
LOL
ok :P
 
all variables are lower_case_with_underscore
Classes are CamelCase
 
7:38 AM
alright
 
You did the opposite
 
i know xD
I'm not very consistent when it comes to naming
But from now on i will pay more attention to that
But overall, this code is a bunch of workarounds tied up together so it looks like a Frankenstein
 
It's easy enough to get into the habit, given time.
 
@MaxPower . look.... this is your new method
Damnit.
Stupid formatting, 1 minute
That's all.
 
cabbage all
 
7:46 AM
You don't need all that extra stuff :P
Cabbage Jon.
 
Cabbage @JonClements
@InbarRose ok thanks
 
@MaxPower Also - file_paths (or file names) should ALWAYS be passed in their entirety, the fact that you append .txt to each file_path that you get is HORRIBLE
 
hehe ok.
But then i'd have to write 'bla.txt' instead of just 'bla' if i want to call a specific function and pass it the file name as an arguement
or is there a better way doing that?
 
That is how it is done
 
i thought the +'.txt' was smart :P
 
7:50 AM
When you ask me "what is the file?" I don't tell you "file_name" i tell you "file_name.txt" or "file_name.html"
There could be multiple files with the same base name, and different extensions.
 
True but in this specific casse i only work with .txt files
Yeah i can see why it's not that good
 
8:02 AM
The Zen of Python says:
Explicit is better than implicit.
and
Beautiful is better than ugly.
Having code that constantly appends ".txt" to file names is gross.
and there is no mention of this happening.
Always consult the Zen of Python
17
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.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
 
Yeah that's so awesomely condensed with so many useful tips
 
Ummm, it's missing the #1 rule...
 
which is?
 
Brassic Prime rules, okay? :)
heya @steeeveb
 
8:35 AM
So Brassica prime is some kind of a cabbage god from Runescape? lol
 
Haven't played Runescape but i heard they have shifted their whole engine from Java to Javascript and HTML5 which is kinda cool
I'm more of a Diablo guy
 
cabbage ya'all!
 
cabbage @PeterVaro
 
8:46 AM
It's not a virus if you have to copy/paste it into a shell for it to work.
 
yeah-yeah, but it sounds better, than "poetic command" doesn't it?
 
@JonClements hi jon
 
Cabbage folks
 
cabbage
@PeterVaro why is it considered "poetic" though?
 
I think because of it's wordlessness — am I spell this right? — I mean look at that :(){ :|:& };: it is like ASCII-art, or something
 
8:55 AM
Oh i see
 
But actually I didn't name it, I just found it this morning
for me: regexes are also poetic — I really love them. They are pretty simple, yet so powerful! And it is also like ascii-art:) ..looked pretty scary for an outsider, even if every last character of it makes perfectly sense.
 
:)
I love regular expressions.
 
Me too.. once you got the taste of it, you want to use it everywhere.. I mean: in Sublime you can search/find and replace with regexes. And I'm really-really used to it, even if I want to search on a website, I just start typing the regex formulas before I realise — this is only a webbrowser:)
 
9:11 AM
:P
There is an addon for that I am sure.
 
11
Q: regex search on google-chrome or firefox browsers?

130490868091234How can I search for expressions like 'foo|bar' on webpages using browsers like google-chrome or firefox?

 
Nice.
 
How to get other PC's MAC address?
 
9:26 AM
Depends
Could you describe your use-case (situation)
Is it a computer that is on the same network as yours? Is it a computer you have physical access to? Is it on an external network ( the internet )?
 
9:39 AM
Yes,all the computers are in a Local Area Network.I wanna get other PC's MAC address.
 
Okay.
icmp
whois
 
How to code it?
 
10:05 AM
Hello! I would like to refresh a picture I'm displaying with pyqt4 every second, but the window changes to "not responding". Code: pastebin.com/PLRpuw8z
 
10:25 AM
what a slow day...
 
it's very slow
 
@JonClements am I the only one, who think this question has no sense at all?
-2
Q: python regex - anything proceded by space or nothing at all

SÅ‚awomir LenartI have patterns like a W b W c W where a,b,c .. are words [a-zA-Z]+ and W is any amount of words - zero or more example: pattern a W b could be a b, a b b b, a e f b ,etc but not ab, not af b, not a fb one space there is required between a and b two space around w is required if w is not empty ...

I mean — there is not a real pattern there...
 
umm, read it twice and ummm, not getting what the question is
 
OK, thanks, that's what I feel too...
 
10:54 AM
lol i tried to read that and got very confused very quick
"the problem is with space in 'a W' and in 'W a' which should exist only if W exist" <- mind yammed
 
My favourite part is the new update: "W is a* what means ([a-zA-Z]+ )* - in my code above just .* (to simplify!), please understand what
non-greedy means and what lookahead assertions is"
which means: we are the idiots, who can't understand what greedy and non-greedy means..
 
Hi folks!)
 
Cabbage @ZagorulkinDmitry
 
I don't pretend to fully understand regex but the way he is describing his problem is just too confusing
hey Zagroul
 
@PeterVaro what does cabbage means?
 
11:07 AM
@MaxPower the problem is — I commented there — is that there is no yamming way to make a difference between two words, in a word-pattern, where the first is always there, and second can be more than once there or zero times
@ZagorulkinDmitry pastebin.com/z7zQqzCw
 
@PeterVaro yeah i understood that ;)
 
@Peter Who had developer this lang?
 
I guess it is the community of the python chat room
it started with cabbage, rhubarb got there later
and now we have a full-blown salad language
:P
 
=)
why you like python?
 
me?
 
11:13 AM
you and other persons from python community
 
@ZagorulkinDmitry what is there not to like? :P
 
actually I'm not a developer, I'm a designer — who never learnt any programming paradigms or OOP or regexes, or threads, etc. But who always wanted to learn programming, but never could.. tried Javascript, Processing, AppleScript, RhinoScript and SassScript.. none of them worked for me
but more than half a year ago, I started learning python — and my life changed forever:)
that's why I love it.. it is so easy to catch up with, to understand all the details of programming
 
i like python and java and noSQL.
 
I started with Java but i couldnt keep on to it. it was just not appealing in my opinion
With Python i find myself more immersed in the code.... i guess it has something to do with the syntax
 
it is absolutely with the syntax: because it is 99% really consistent and straigthforward
no matter what: I can always read others code, and understand it
and +1 bonus: you have an interactive interpreter — you can always test small snippets while developing
 
11:22 AM
@MaxPower now i have ejb(java beans) training from oracle. =)
 
@ZagorulkinDmitry Nice... I was supposed to do an Oracle certification exam at the end of a course i took but i ended up giving up on that
 
Cabbage Folks. Back from lunch. yum! :)
 
Cabbage @InbarRose
 
cabbage @InbarRose
 
cabbage
 
11:33 AM
woo! :)
(just noticed that all the starred messages are mine, except Jon's)
 
I'm responsible for some of those :P
 
11:53 AM
:)
 
12:03 PM
Apparently you have a lot of interesting things to say @InbarRose
 
is it a good idea to initialize an instance of some class X in a python file1 and import that instance from file1
i am reading source code of some new project at my workplace and i am getting all kinds of questions like how long does the variable references stay in the namespace?
Is the instance created every time we run the file1?
Or does the instance persist?
what happens on systems like servers ... where the system never shuts down .. does the name space is never gets cleared or is it coz of gb action
 
@Sandy What you are saying/asking does not make much cohesive sense.
Why don't you start by telling me(us) what you are trying to accomplish
And what methods you have attempted so far.
 
@InbarRose right, thats maybe because i am so confused :(
@InbarRose i am reading a source code of a project and what i see there is there is file 1 where they have created instances of class x and in file2 they have imported that instance
 
@Sandy and what is the problem with that?
actually @InbarRose is right, what are you trying to accomplish?
cabbage @Haidro
 
cabbage
 
12:09 PM
and looking at this i had all sorts of questions running in my mind
i want to understand how long can one instance stay if it is initialized as a global instance like this
@PeterVaro I am just trying to understand the project :)
i am getting confused with the life of pyc file ... which will live as long as there is no change in the file, which takes for re-compilation or it is deleted
 
What kind of project is this? A single script, that will run once, and produces some output? Or a full-blown application?
 
@Sandy i think that's called a module so you might wanna search for "creating and importing your own modules"
 
its is a big web application; but this current file1 is a service script
now i also have a question .. is this good , are there any hidden traps in doing anything like this
Because i havent seen anything like this before... my ideology has always been initialize when u need to but in this case ... even if i never need call file 1 .. file 1 would have created some instances :|
But in the case
 
Sandy... "the life of a pyc file" that makes no sense... What do you mean "how long does the variable references stay in the namespace" ?? You are speaking as if in a foreign language. What is your experience with Programming? and Python in particular.
 
@MaxPower I am comfortable with modules but here we are importing an instance,,, is that good thing to do?
 
12:17 PM
You can not import an instance.
No such thing.
 
@InbarRose but thats what i see in the code
 
If a module has in its namespace a reference to an instance, for example, if on the top of the module I write "X = []"
and you do "from module import X"
 
cache = LocalMemCache() is written in file1
and cache is imported to file2
 
then X will be the empty list.
But you do not import the instance. you get a reference to it.
which means that any time you use "cache" it is like you are running it in its modules namespace.
imagine the following scenario...
A module which has a class which deals with READING from a large SQL database. This module has "DB = .... " where DB is an instance of this class.... So you can import from this module the reference "DB" and act on it.
This makes sense...
Here is where it gets interesting...
If ANOTHER module/script ALSO imports that database module and gets the DB reference. it will be the same object.
As opposed to another instance of the class.
 
@InbarRose true... that can be risky
 
12:21 PM
Or - it can be useful
 
@InbarRose oh yes sure
 
if your database can only incurr one connection, this way you have only 1 instance which deals with it
And if this class is threaded, then each action you perform on it can be added to a queue, and a certain thread will perform all the queues.
Now that we have that clarrified
What exactly is your situation?
 
@InbarRose ok now if apache requests we can assume that there will always be multiple instances right
 
I do not like to assume anything.
 
@InbarRose i am in a fix i am just trying to evaluate and understand if this is a good or a bad thing to do
 
12:23 PM
Do you have right now a working model ?
 
@InbarRose ok how does things work on process level ? do they share pyc? and their name space?
 
Look - pyc is just a compiled python script. it is a file type, I am not sure why you keep using that word
 
@InbarRose no, my task is to understand the code first and then propose any if there any suggestions
 
What?
 
:) sure so the files are shared across processes? ok that means even the namespaces would be shared
i am just trying to understand the internal working
 
12:28 PM
Well, you are doing it wrong
the files are just bits on a harddrive
they don't do anything
 
ok ... i always had problem understanding that bit
 
When you start/run a python program, it reads from a file (usually the script you run) and loads that into the memory.
In the memory you have namespaces
You could run multiple scripts all at once, all using the same file, and they would not share the same namespace
It is all a process heirarchy
 
@InbarRose ok ... so every process makes its copy of the file in memory?
 
yes
 
@InbarRose okay.. thanks sounds good
 
12:31 PM
and if the process/script has multple elements that all load from the same module the same instance, then they will all share that same instance. BUT - a different process will have its own
Like tabs in a browser.
All the tabs share the same browser, and so if you log into Facebook in one, in the others you are also logged in.
But if you open another browser- you won't be logged in
But if you do log in, then all those tabs will also share that login.
 
@InbarRose wow.. cool thanks , i can visualize things now
 
And since Facebook itself has its own service - they will log you out of the previous browser, because they only let your login have one browser.
(I might be wrong on that - but just imagine I am true for this example)
 
@InbarRose :D
 
Does that help clear things up?
 
oh yes thank you soo much for that
now i am just looking at that instance import and trying to check if i understood that as well
@InbarRose ok cool i will make a note of that point and check with the developers if there was any particular reason they wanted to make a common instance available across places
 
12:45 PM
1
Q: why is here list comprehension and dict comprehension but no tuple comprehension in python?

ShadyXuAs we all know, there is list comprehension as [i for i in [1,2,3,4]] and dict comprehension as {i:j for i,j in {1:'a', 2:'b'}}, but (i for i in (1,2,3)) will end up with a generator, not a tuple comprehension, why is that? My guess is that tuple is immutable, but this does not seem to be the a...

Interesting question.
 
but isn't a tuple always a pair of values?
 
not always a pair.
 
Oh
 
type((1,2,3,4,5))
>> <type 'tuple'>
 
@InbarRose I've wanted a tuple-comp on multiple occasions
I just think there isn't a syntax for it with current keyboards :)
 
12:54 PM
Is it just me or the question's title is kinda yammed up with the "why is here" part? :P
 
The reason a comprehension is "faster" than normal loops is because it creates the container AFTER it already creates the objects to go into it.
 
but in that question, this isn't a valid syntax: {i:j for i,j in {1:'a', 2:'b'}}
 
correct
it should be
{i:j for i,j in {1:'a', 2:'b'}.items()}
 
or iteritems()
 
yeah well. same idea.
 
12:56 PM
@PeterVaro The syntax is valid, but it will raise a TypeError or ValueError (unless the keys are 2-tuples)
 
hehe
well, yeah:)
 
BTW - I don't like how Martijn and I answered with the same "solution" I even offered MORE INFORMATION. and he has more votes... uncool :P
Makes me sad panda :(
 
@InbarRose -- I was responding to the statement "Whereas a tuple should be a singular thing that is not modified."
 
I think people tend to vote up the ones with the highest rep
 
I don't see how that has any bearing on whether you can make a tuple comprehension or not.
 
1:00 PM
@mgilson which I don't really understand, why can't it be simple as that: for key:value in dictionary: # do something with key and value — why this syntax sugar is not in python..
 
List and Dict comprehensions exist to make it faster to create containers, instead of looping over the item and "appending" each value to a list... With a tuple, you never need a loop, since you can not create a tuple and append things to it.
 
@InbarRose -- I disagree. List, Dict and Set comprehensions exist to provide a clean and elegant syntax for creating a list, dictionary or set. The fact that they're faster is just a side-bonus.
 
But the way to create a tuple is to simple create one.
(1, 2, 3)
there, it is done.
usually with values that are pre-determined.
 
But what if you want a tuple with 1000 elements?
 
tuple(range(1000))
 
1:04 PM
but why not use list(range(1000))?
 
Why do you want a tuple with 1000 elements?
 
instead of [x for x in range(1000)]
Why do you want a list with 1000 elements?
:)
 
each container type has its uses
tuples are for passing a set of immutable objects
not for holding data
well.. I mean not for holding "THE DATA"
it can hold bits of data
You will never have a tuple which contains the lines of a file
it makes no sense.
 
@InbarRose -- Perhaps you want to hash your file's lines or to dynamically create dictionary keys on the fly or ...
 
yes, but never 1000 values.
 
1:07 PM
What's nicer:
d[tuple(x *2 for x in iter)] or something like d[x*2 for x in iter]?
It's also an interesting question -- Why no literal syntax for frozenset?
e.g. f{1,2,3}
But ultimately, that just doesn't look clean and doesn't fit with the Zen.
It could be super useful.
 
The Zen of Python says, that explicit is better than implicit.
 
And I agree with that
I'm not advocating anything "implicit"
 
A Tuple is a special kind of container
it should be treated specially
 
(I don't think that d[x*2 for x in iter] should be valid)
 
It can still be iterated, but not assigned to.
 
1:11 PM
But you can argue that a list is a special kind of container too -- they're all special
Because they all do things that the others can't
 
True, but in this sense, the tuple is different in that it can not be assigned to - which means that it is important to note when you create a tuple as opposed to another container type
 
Ultimately, some are just more useful/general than others -- They're the ones that get comprehensions until we run out of ways to think of a clean syntax for new comprehensions
@InbarRose -- But I still fail to see how the immutability of a tuple means that they shouldn't have a comprehension syntax.
That's a connection that I can't make in my mind.
 
Comphrehension assigns/appends values to the container, a tuple can not do that.
 
Comprehensions look purely declarative to me. I don't agree that it looks like there's any mutation going on.
 
Okay - let me give you an example.
 
1:20 PM
Thanks @Cairnarvon :-)
 
>>> {i:j for i,j in [('1', 'a'), ('2', 'b'), ('1', 'c'), ('2', 'd')]}
{'1': 'c', '2': 'd'}
As you can see, it overwrites the older values in favor of the newer ones.
 
Cabbage
 
But that's a dictionary ... It can't hold new ones ... What is it supposed to do?
 
I was asking a question yesterday to @Cairnarvon i believe and i just wanted to get other peoples take on what method i should use
Basically, i am writing statistics from a linux box to a mysql database and i need a method to queue the data if the database loses connection (DDoS or something)
So then when the database connection is back up, i can run through the queues, writing to the database
 
@HarryBeasant -- Unforutunately, I'm not much help. I don't know anything about databases and such.
 
1:33 PM
use rabbit mq or something in the likes
that way you stack up on messages that get processed when your connection is back up
 
@limelights With rabbit MQ, is that automatic?
 
yeah
 
Ah that looks perfect for what i need
I will be sending large dictionaries, would that still work?
 
should work.
basically how it works is that you have a sender and a reciever which will be two diffrent applications.
reciever does the work you want (write to db) and sender sends the data to process
 
ah okay
 
1:41 PM
and rabbitmq is the dude in the middle getting all the messages (calls to reciever) and then delivers it
 
Nice, this could be perfect
Thanks so much for letting me know
 
no problem, there are other brokers that can do the same thing but rabbitmq is the one with the most bindings (i think). if you're using django you can hook it up with celery
 
Hi lo there
 
yello
 
Hi
OPs annoy me...
requirement from who? — Neal 46 secs ago
 
1:55 PM
gotta love it when that happens.
 
@mgilson rrrrrggg looks like homework now... I want to take back my upvote on the question... :-(
 
Cabbge. was rbrb sorry.
 
00:00 - 14:0014:00 - 23:00

« first day (963 days earlier)      last day (3968 days later) »