« first day (1287 days earlier)      last day (3666 days later) » 
01:00 - 15:0015:00 - 00:00

3:00 PM
And you have qt-libs for both linux and MS.
 
I have a big file, what I must do is: every time one line starts with a certain string, I want to detect the third line before this line. What can I do?
 
@5555555555 you already asked this question earlier and received replies. Do you really need to ask again? Did you not understand your first answers?
 
Iterate over the lines and keep track of the last four lines. Once your condition is met, use your buffer to do whatever you need to do with the line in question.
 
The answer did not work with me
 
@Hyperboreus "A nice looking GUI in no time". Just what I need! :)
 
3:06 PM
And native L&F. Not like so many language-specific GUI toolkits that look like crap on ALL platforms
 
@5555555555 then you'll need to explain how it didn't work. Otherwise you'll get pretty much the exact same answers as last time, except from different people. This ends up wasting peoples time and makes them less likely to help you.
 
L&F ?
 
look and feel
It also has good internationalization support
@5555555555 Why don't you just post a question detailing your exact problem, instead of asking this in chat?
 
ah. internat is good too! Diacritics and ligutares all over.
 
Also translatable GUI. I.e. you write your GUI once with "string tables" for different locales, and depending on the locale of the system running your app, the user will have it in their own language.
 
3:11 PM
That's nice, but not necessary right now. But, you have answered my question. QT it be.
Thank you all.
 
with open("mybigfile") as file:
lines = file.readlines()

for idx, line in enumerate(lines):
if line.startswith("A certain string"):
line_to_detect = lines[idx-3]
this detect many lines
but i want only the third one
before the line which starts with the string
 
@5555555555 I would suggest you ask a question on the main site as Hyperboreus has suggested.
 
It gaves me an error
 
lines_to_detect = [a for a, b in zip(lines, lines[3:]) if a.startswith('something')]
 
It sayes that is not a good question
 
3:14 PM
if b.startswith that is
@5555555555 Most probably your way of asking is not good, and not the question itself.
Post your question and link it here
 
cpx
3:38 PM
lol
 
DSM
For those interested, the "third line before" question seems to have been posted here. The OP also seems to count in a somewhat idiosyncratic way.
 
@RolfBly: welkom!
 
cpx
I'm watching "The Hobbit" finally.
After that an another hobbit and an another hobbit is coming this year.
I haven't watched the lord of rings yet either.
 
@MartijnPieters hallo , wie geht es dir?
 
A lot of hobbits coming then.
 
3:51 PM
@MortezaIpo Ganz schön
Aber, ich bin nicht Deutsch..
(quick, correct the spelling before @Poke and @Thiefmaster start to correct / mock me)
@cpx Ni! Ni! Go away, you unbeliever!
 
Oranje?
 
@Martijn Dank je!
Ik wou dat ik dit eerder gevonden had.
 
cpx
Ni Ni Ni!
 
We are no longer the knights who say Ni! We are now the knights who say ekki-ekki-ekki-pitang-zoom-boing!
 
Cabbage!
 
4:04 PM
¡Repollo!
 
@Terfin that's 'ftang'-zoom-boing.
 
@MartijnPieters Aww, I was too late ;P
 
Oh well
 
@Martijn Can you give your input on this? You know the internals better than me.
 
cpx
Is 'Ni' like we say Cabbage?
 
4:09 PM
@poke Looks right to me!
 
@cpx No, quite the opposite, see here
At the risk of using a greeting reserved for founder-members: rabarber.
 
4:37 PM
1 message moved to Trash can
 
cabbage...
 
cbg abhi
 
4:58 PM
@Hyperboreus Hey, missed that. Yes, Oranje.
 
The "ij" gave you away.
 
5:15 PM
I don’t really answer anything for about a week, and don’t get a lot rep per day. Then, I answer a question on one day, and suddenly I also get a lot rep for many other (unrelated) answers… so odd.
 
5:27 PM
codebabes.com JUST WHY!? o.O
 
DSM
I have trouble concentrating when multiple windows are open. I don't think that's going to help.
 
@poke @Martijn cabbage
 
@MartijnPieters Works for me.
Hey Jon
 
5:34 PM
@poke Yeah, it's back again.
But in read-only mode:
> This site is currently in read-only mode; we’ll return with full functionality soon.
 
Not for me :o
 
Says @poke the moment read-only mode is disabled..
 
@Martijn job board app is back on track-ish :)
 
You trolling or what? :-P
@JonClements I saw!
 
Phew, 5 minute break from the meeting.
 
5:40 PM
so apologies to @poke - we're still using his server for a few bits :)
 
Now it’s my server? Wow, things have changed a lot xD
 
@Kevin it makes it sound like you've just come up for air :)
 
I should probably expand on this answer, but it's a monumental undertaking
 
@MartijnPieters I’m still blaming your timing here. Don’t be so overly attached to SO, just when it gets unvailable for a minute, jeez..
 
@JonClements It feels that way, yeah
 
5:41 PM
@poke the server I pay for, but you're in charge of? Is that easier? :)
 
@poke But people are wrong on it! How can I prove my superiority if I cannot post!?
 
@JonClements Wish life would always work like that.
 
You guys clicked too hard and broke our secondary data center's load balancers - we are failing back and investigating the root cause.
 
Anyway, have added a new user account... that'll be used for a bit - we can lock it out later if needs be
@poke just keeping you informed what's happening
no access to the super secret publically available sopython project though :)
wb @copy
@poke also considering moving that server off DO and putting it on a linode server instead
 
Cabbage
 
5:45 PM
hey @copy and eva
 
@poke depends if you feel like a setup job again :)
 
ugh
Well, just tell me in advance…
 
Well, nidaba requires more disk than DO can offer, so looking at a 200gb plan on linode
already got a few servers with them, so gonna be cheeky and see if I can't get a discount for another one
we only get 40gb on DO
jon@sopython:~$ df
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/vda        41153856 16342052  22698268  42% /
 
Well, you know what I think about that, but do what you want ^^"
 
Not sure I do know what you think... remind me? :)
 
5:52 PM
I don’t think we need to think at that scale yet when the thing we want to do with all that data is far from being done.
 
jon@sopython:~$ ls -al stack*
-rw-rw-r-- 1 jon jon 4960840356 Jan 23 05:48 stackoverflow.com-Posts.7z
-rw-rw-r-- 1 jon jon   81023925 Jan 23 05:50 stackoverflow.com-Users.7z
 
-h
 
It's that bugger... no way can we hold the past posts for analytics
jon@sopython:~$ ls -alh stack*
-rw-rw-r-- 1 jon jon 4.7G Jan 23 05:48 stackoverflow.com-Posts.7z
-rw-rw-r-- 1 jon jon  78M Jan 23 05:50 stackoverflow.com-Users.7z
 
cbg
 
@roippi cbg!
It's a blooming XML document as well... so once it's uncompressed it still needs parsing to put into the DB
so 5x the uncompressed size is reasonable
heya @TRiG
 
6:06 PM
@JonClements Hi.
Just starting on learning Python.
 
Good man! :)
How you finding it?
 
Mainly because I've been thinking of doing so for a while; but also partly because a kid in CoderDojo has started learning it and I want to keep up with the kids I'm supposedly teaching.
And when I say "just started" I really mean just started.
I'm using codecademy.com
 
Ahh okies... very "just starting" then... you coming from previous experience in other languages?
 
Have we got a canonical dupe target for accessing values from nested dicts? if so, stackoverflow.com/questions/23300037/…
 
@poke We can do the 2gb package to start with then move to the 8gb when I've got the DB stuff ready
 
6:10 PM
Hmm
 
We're already paying $20 for sopython so I'd rather move it to somewhere that's more flexible
 
Yep, definitely close vote pls, a commenter found a nice target.
 
Your money, you decide :P
 
You're happy with whatever choice I make? You are our sys admin @poke :)
 
I should add that to my CV…
 
6:15 PM
Umm, I wonder if I should put "Python room owner" under the "positions of leadership" header on my resume... :-)
 
@poke where do we want the server?
Dallas, TX or Newark NY
options of London and Singapore though
 
hey guys!
 
Hi
 
How's it been?
 
ltns @samrap - potato?
 
6:23 PM
Banana. And you? @Jon
btw, good job on the redesign of sopython :)
 
Cabbage!
 
I was going to say "I'm bananas" but that'd be more rather matter of fact than informative :)
 
Yea we already knew that @Jon ;P
I need to get back to chat more often I miss you guys!
 
@samrap wasn't me on sopython.com - blame other people @poke for instance :)
 
Inspiration comes from @Peter though. He made the logo and used those colors first :P
 
6:26 PM
Well good job to everyone involved! Checked out @Peter website about a month back. Impressive work
 
@poke new server created
 
Oh noes.
You mean, now?
 
What's up and do you need any assistance?
 
@poke why not now... :)
brb... need to work out this control panel thingy
 
Because I’m not sure yet, if I’ll be available this evening..
 
6:28 PM
plesk ftw?
 
I hate Plesk. That’s the first thing I’ll get rid of when I redo my own server.
 
I like sshing my way to glory. No need for no stinkin' panel!
 
What do you use your server for @poke ? Got a website?
 
Yeah, I’m redoing it though, so not telling.. originally planned to use Plesk to have a side-set of other stuff I previously had on shared hosting, but because that was so confusing, I just decided to get rid of it completely and do it myself using manual configuration.
 
dedicated box?
 
6:33 PM
Just a VM
 
nice. I use iPage for hosting. I'd like to learn how to configure my own server one day though. It would be a fun project
 
Well, I did quite a few things for sopython I never did before, so I feel more confident now xD
 
I use either MediaTemple if I need a server for a real project, otherwise I use AWS for testing, in case I can't test things locally on a VM.
 
@poke at least it helped in someway then :P
 
The one thing I still need to figure out is how to properly set up a mail server though.
 
6:37 PM
That's cool, I've taken a longg break from Python. Haven't written a line of it in months. I took a break to build my website, then ordered KR C Programming language book, I'm about a quarter of the way through and I'm also doing a slight redesign adding some more content for my website right now
Needless to say I haven't done much programming in the past 3 months
hmm mail server. sounds tough
 
I think that securing a mail server should be way harder than setting it up tbh
 
@poke done a 14.04 ubuntu setup
@poke just booting it now... let's see
ugh... this means I need to remember my passwords for the DNS
@poke emailed you details
 
So I saw..
*sigh*
 
Oh come on... it's errr, experience right? :p
 
Jon makes the best passwords ever.
 
6:48 PM
That's complete bunny - I don't :)
 
is it ilovebunnys42?
 
I gotta go guys. Talk to you soon!
 
@Ahmad That’s actually pretty close.
bye @samrap!
“Welcome to Ubuntu 14.04 LTS” *sigh* Here we go…
 
@poke sorry?
 
Wow, you really didn’t do anything there yet :o
 
6:59 PM
Nope, just paid for it and did a runner
Your baby as it were
 
aptitude doesn’t work o.O
 
I need to get dinner else I'm gonna flake
"all" we need to do is move sopython :)
 
I can’t install packages because the plus-key isn’t recognized o.O
 
@poke ?
 
wat
 
7:03 PM
In aptitude, you press + to add packages to the download list. Well, that doesn’t work D:
 
just use apt-get or compile 'em :)
 
yup
 
Yes, but for a longer list of things, aptitude is useful especially if you don’t remember those stupid names..
 
apt-cache search
 
gotta love our system admin :)
lots of hugs or something, I need to eat :)
 
7:06 PM
WOW
I’m smart.
The plus key didn’t work, because it was already installed.
 
@poke if you have time to just create the user accounts and the nginx/uwsgi thing, I'll port the database later
 
olol.
 
on phone if needed bbiab
 
I don’t even know what to start with… I’m lost…
 
hehe
 
7:12 PM
@poke nginx is a good start ;-)
 
7:31 PM
I’m going to do things later…
 
@JonClements No formal training in CS, but I work with PHP and javascript daily. I'm having to resist the urge to put semi-colons on the end of every line.
 
Why?;
 
I don't mind semicolons much, but adopters really gotta cut back on their parentheses. if (x==1): return (23) else: return ((int)(1.5**8)). Totally gratuitous.
 
Still, that's not as bad as carefully documenting the meaning of every self parameter in class methods.
This self is a reference to the class instance the method belongs to. And so does this one, and this one, and...
 
7:46 PM
or adding in semicolons everywhere, but not quite everywhere.
 
Best thing:Optional semicolons that are added automatically if not present.
 
@Kevin Is there any language in which return (23) would be required? Or even expected?
 
Not in anything mainstream, I don't think. I can imagine a hypothetical language where return is a function, but that would be highly unusual.
 
@poke à la javascript?
 
Yes, that was my reference :P
 
7:55 PM
Nonetheless, I see people do it. I guess it makes them feel secure.
 
@poke JS is flipping weird, but I actually quite like it. Perhaps I'm flipping weird.
Perhaps I just need to learn more languages, so I have more to compare it with.
Yes, probably that.
 
ugh - back
 
I think js is weird whenever it behaves in a way I don't expect it to. But I think that is a problem with my mental model of the language, rather than the language itself.
A more proficient user would probably find it to be totally sensible.
 
Back in the "dating circle" - long time no doing, just ugh
 
Well, good luck :-)
 
8:01 PM
@Kevin just bought meals and saw a lovely lady... physically attractive... however, she'd be massively surprised if 2+2=4 kind of thing
Not sure how many times you can throw "ya know" and "innit?" into a conversation with me before I just don't care :)
 
What's that old saying? Beautiful, intelligent, sane, choose only two?
Come to America, nobody says "innit" here :-)
You'll get a lot of "like"s though
 
Yeah... when will you bloody Americans actually respect English :p
 
never
ps. i'm dutch
 
We're way more likely to just sever entirely, and rename our version to "American"
 
We weren't the largest empire in the world for you guys to take out u arbitrarily :)
 
8:08 PM
And spell "aluminum" with one fewer syllable for no reason
 
Exactly! The greatest superpower on this planet has a heap load to answer for! :)
 
No one can tell us how to pronounce "nuclear", because of our nuke-you-lar stockpile B-)
 
hrmph. Trying to make something more pythonic. Searching an array for a PID
 
The UK may no longer be a superpower, but dammit, for our size we're bigger than anyone else :)
 
Sure, you've got a theoretically infinite perimeter! No contest there
 
8:14 PM
The British Empire comprised the dominions, colonies, protectorates, mandates and other territories ruled or administered by the United Kingdom. It originated with the overseas possessions and trading posts established by England between the late 16th and early 18th centuries. At its height, it was the largest empire in history and, for over a century, was the foremost global power. By 1922 the British Empire held sway over about 458 million people, one-fifth of the world's population at the time. The empire covered more than , almost a quarter of the Earth's total land area. As a res...
 
@Crow myArray.find(myPID)? [item for item in myArray if item.PID == myPID]?
 
Speaking of Brits, remember Bridge over the River Kwai?
 
PyQt5 seems rather a hassle, perhaps immature(?), to install on Windows. Am I right in thinking it's safer, less work to install PyQT4?
 
srsly, brittish just isnt my cup of tea
@RolfBly why would you want to use outdated libs?
if you want save, use another OS :-P
 
8:21 PM
'Safe', bedoel je.
 
mja, dattum
 
I'd prefer stable libraries to updated unstable ones, especially if I can avoid horror stories like these
 
The easiest way to install PyQt is to just use the installer (Link in your answer, step #5). If you install python 3.3, the installer will add all of the PyQt5 extras to that python installation automatically. You won't need to do any compiling (none of: nmake, nmake install, python configure).
the answer is right there
 
I notice Riverbank's "Downloads" sidebar still puts PyQt4 above PyQt5. An implicit recommendation, perhaps?
 
anyways, i'm more of a GTK guy myself
 
8:26 PM
I'm lazy and use Tkinter so I don't have to install anything
 
me neither
i use linux distro's that have it installed already
 
I saw that. I hate seemingly/possibly contradictory information. According to here, I must install SIP. That other link would mean the installer is all I need.
 
Gotta go. Happy Friday, everyone.
 
Are there any Brits left now?
 
8:35 PM
Yep
 
regarding that bridge over the river kwai, right?
 
well our first kingsday tomorrow
\o/ new dsm update added geoip to block countries!
finally
now they just need to rewrite it in python instead of php and they would be really awesome
 
You were taken prisoner of war. They treated you really really bad. Nevertheless, you built a bridge (during WWII) for the enemy, a bridge that lasts to this day(!), because you felt it would boost morale?
 
@RolfBly I've never actually seen the movie/read the story so I'll have to take your word for it :P
 
I mean, that's not cricket. As it were.
That's irrational. Big time.
 
8:40 PM
well at first it might not be obvious, unless you are brittish
they make good porn though
 
Ugh, UI fonts in pycharm 3.4 look horrible on windows with cleartype disabled
 
Bit inappropriate for a python chatroom, no?
 
@ThiefMaster no problem on Fedora 20
@Ffisegydd you are probably right
but we were already way offtopic
anyways i'm off to bed
 
That's no excuse to go down conversation routes that would be inappropriate really. A lot of the conversation in this room is off-topic and that's cool and froody but there's appropriate off-topic and not.
 
so porno isnt a appropriate discussion to have in a room thats mostly offtopic anyways?
 
8:47 PM
I would say it is inappropriate, yes.
We have children/teenagers coming into here asking questions.
 
well its not like i'm linking to explicit content
@ThiefMaster PyCharm 3.4? where dit you get it? i'm still on 3.1(recieved a update today)
 
good night, guys.
 
rbrb @RolfBly
 
@AlexanderMeesters: EAP download, it was released recently
 
Those are some good changes in Pycharm
 
8:54 PM
Looks like some nice new features
With Multiple Selection, we can now put a cursor in multiple locations in a file and write code simultaneously in these positions. Press and hold “Alt” on the keyboard and use the mouse to select the locations of the cursors that's beautiful...
 
@Ffisegydd yeah, sublime text killer :p
Actually that's the feature I'd like to try out.. but not with a font that gives me a headache
 
Can anyone help me with an import issue in Python 3, or suggest a more correct approach?
 
You don't have to ask, just post the problem
 
(Typing :) ) I'm working in a project that was started by someone else, and adding code in a feature branch. The code is intended to be run as a script from a "main.py" file. My work requires a lot more tests than the creators, so I've got multiple tests files in a "tests" directory at the same level as the "main.py" file, where there is also a directory containing most of the source code.
I want to add a helper file in my "tests" directory to put code that will be used by multiple tests files
But no matter what I try, my imports in the test files seem to raise an exception like "SystemError: Parent module '' not loaded, cannot perform relative import"
I have a sense of what is "wrong" about this from: stackoverflow.com/questions/16981921/python-3-relative-imports
But I'm still unclear on what the correct approach to this is if the final code is to be run as a script. I'm running my tests through PyCharms' unittest runner (which is presumably where the run as script within a package issue is arising)
 
Are you using if __name__ == '__main__':... to only have certain bits of code run if it's a script?
 
9:07 PM
No, not in my tests
Nor in any of the code under test
PyCharm is running my tests with a shell command like:
ssh://vagrant@127.0.0.1:2222/home/vagrant/.virtualenvs/python3-jira/bin/python -u /home/vagrant/.pycharm_helpers/pycharm/utrunner.py /vagrant/tests/test_FogBugzModel.py::FogBugzModelIntegrationTests true
where FogBugzModelIntegrationTests is a unittest.TestCase subclass and in that file I'm trying something like "from .helper import get_json_conf"
 
Right ok. And you have a (usually) empty __init__.py file in your tests folder?
 
I do, yes
 
Ah.. they switched from tahoma to segoe ui. overriding the ui font fixed it
 
@NilsRocine it's strange because I've done a similar thing to you with PyCharm before yet I found no problems, let me boot up the project.
@NilsRocine have you looked at stackoverflow.com/questions/16637428/…?
 
hah, not I actually didn't try to get rid of the init file, trying now
*no I
 
9:13 PM
@NilsRocine when I ran my tests using PyCharm unittests I imported modules from "the top" of the module. So my structure is basically
__init__.py
d4c.py (main bit of code)
tests/
    __init__.py
    test_d4c.py
 
@Kevin no, because another number can represent the PID. The processes start at 8000 and go to 10000 in the array though, each is the same length. What I'd really like to do is map them to a list of dictionaries if possible
 
@Ffisegydd removing the init.py file seemed to do the trick
 
and when I imported my d4c code in test_d4c.py I used from backcor.d4c import D4c
Where backcor is the name of my package
 
I see, I did plan to do something like that, but my "package" is also the repository root which has a dash in the name
so I was kind of at a lost as how to approach it
 
Ah. Unfortunate :(
 
9:18 PM
Yeah, I was hoping I could skirt around making major changes to the structure of the project. And your recommendation to remove init did get me past this hump
Thanks a lot for your time
 
No problem :)
 
meh, the multi-caret feature is not very good so far. the only way to place new carets is by clicking with the mouse. because i really want to use the mouse when editing stuff ...
 
Hello guys! In django, I extended the user model by creating a student model(one to one to use) and by assigning a foreign key to a table Courses. Now i want to add another model teachers which inherits from User(one to one) and also is related to the table Modules. Since a teacher can have many modules, but a module can be edited by only one teacher, which do you think is the proper relationship? I'm a bit confused with ManyToManyRel and ManyToManyField.
 
9:42 PM
back
@ManolisC. I think you should make a proper SO question regarding that - with the details you've put here and some code attempts
 
Yeap I guess so. I think I'll give it a try with ManyToManyField. Already started coding. So I'll go with this one and in case I got no results, I'll grab a beer and post to SO.
 
How can I get a mortarboard badge on Meta.SO?
 
@ManolisC. what is a ManyToManyRel?? I have only seen ManyToManyField's on django
 
9:58 PM
Hello folks!
 
@ZachR Well that's what I was looking for. It seems that the normal relationship is ManyToManyField. I can't find what a ManyToManyRel is. I got confused because PyCharm autocompletion showed it.
 
ManyToManyRel is in the source code apparently:

http://stackoverflow.com/questions/5216891/django-what-is-the-difference-rel-field
So use the Field :P
 
Yeap! That's the question I read and made me use ManyToManyField
lol
 
10:16 PM
alright, here's a bit of a challenging list comprehension. I want to take an array, starting from 8000, and make OrderedDicts of every 19 increments within it, and json.dumps it
 
DSM
.. if you're not making a list, why bother using a list comprehension?
 
user3444876
11:07 PM
CABBAGE
 
user3444876
ALL
 
01:00 - 15:0015:00 - 00:00

« first day (1287 days earlier)      last day (3666 days later) »