« first day (1404 days earlier)      last day (3769 days later) » 

03:26
@Humdinger if any(my_value == item for item in my_list):
@Humdinger if item in lst: checks for equivalence
Cbg all
Object checking would be any(item is x for x in lst)
Right, I messed that up.
04:02
@Humdinger or make a set/dict keyed by id
 
3 hours later…
06:48
cbg
cbg
@JonClements good machine learning remarks here
surprisingly jus a set of a few key features does detect twitter spam as well as bag of words or bi/trigrams :P
@Antti that's a good thing though, surely? :)
if the project nidaba is to at first produce a list of "worst posts" to hammer down next or something similar, then it can be that surprisingly few features will do already
asdfklmasdflkj
Ï cant write
@Antti I've just put the kettle on - would you like some coffee? :)
@JonClements for example our spam filter on twitter was 0.9393 ham , 0.7718 spam labelled correctly for features that did not include the actual tweet words in any way
06:54
Interesting...
and 0.9385, 0.8289 with all features we invented
Cabbage all :)
and with bag of words and bi, trigrams 0.9274, 0.8247 :P
cbg
so it does not much matter at all which features we use
@Games!!! How ya doing?
@JonClements Well. I just need to get done with exams, then I'm free! Free I tell you!!!! laughs like a maniac.
07:00
As - you're as sane as normal - thank goodness for that... Exams can do strange things to your mind! :)
which exams?
@JonClements Have you ever worked with arduinos?
@AnttiHaapala University exams.
@Ffisegydd are we super happy now?
@Peter cbg
@PeterVaro cbg :)
07:03
@Games nope... something I'm interested in, but never had the time
morning/night folks ;)
== cabbage everyone
@JonClements Same here, but this break I'm thinking that I'm finally going to get down and do it.
Make it so!
Right... I've gotta somehow get 10 days work done in 6... so I'm gonna crack on... I'll bbl
@Peter I've seen that before and, depending on how it works, it could actually be used in my research. Use it to remove the magnetic scattering from my atomic structure work :p
07:18
@Ffisegydd it looks/sounds very interesting -- especially the prediction that we can use this method to separate other properties
@PeterVaro first bug in that article: "classic children's book" :D
I suspect that someone revenge down voted my questions.
However as I only actually have two questions it's not so much of a deal.
Still annoying though.
 
2 hours later…
09:25
@Ffisegydd Imma call you Eph now :P
Eph?
Oh "F"
How very droll. I was going to give you a present too, but now I'll keep it all for myself!
"Here download some code from this random pastebin"
No explanation of the problem.
@Games are you about on Hangout quickly? Got a Dropbox link for you.
sure on hangout
10:16
why oh why does not the statistics module support percentiles
@Antti You mean the new one in Python 3.4?
To be honest I've not used it yet. I read the PEP pre-3.4 and it seemed like a nice addition.
@Ffisegydd dat title (for the question of the answer you linked)
@Ffisegydd yeah
so for anythign other than 50
I need to do sort data and take x[p * len(x)]
I thought the statistics package was just for a good set of basics. When you start getting into percentiles you're starting to get into distributions and more advanced stuff. Though it has been a long time since I read the pep so I may be mistaken.
In any case, scipy.stats is your friend :P
"I can't share example data for security reasons" ...well I can't answer your question for "security reasons".
@Ffisegydd median is the 50th percentile, no different from calculating any other nth percentile
I just want to calculate 1th percentile or 99th
11:01
Cabbage!
11:38
Is there a standard way to modify and recompile python libraries ?
I tried using py_compile option, but it says IO Error: permission denied
Do you have permissions for that directory?
yes....turns out it is a symbolic link
I sudo'ed and it worked alright.
cheers
11:54
Hi guys, Any webdevelopers ?
Yes, usually
Yes, thanks
pyramid(pylons) ?
Nope, asp.net
12:00
"You may ask your question without a preamble.
For example, you do not need to say “anyone here know Django?” before asking a question about Django."
Okie, What should be the memory usage when a request completes and another request starts
Example
At startup - 10MB
request-1 - 12MB
request-2 - 13MB
request-3 - 15MB
request-4 - 17MB
Memory is adding up, Is this the expected behaviour ?
Perhaps there's some kind of cache that's recording the history of your requests.
If so, I'd expect it to level off at some point. If it continues to grow after, say, a day of running the server, that would be worth worrying about
Yes looks like cache, when i request for same records memory wont increase.
Problem is its growing vigorously, dont know how to cleanit up
Try thousand requests. How much does it take?
stackoverflow.com/questions/25404346/… what reason for close vote?
Not sure :/
nvm someone has gone TB so I'll roll with that.
12:13
Too broad is my first choice, opinion based is my second
its growing up to GBs
I wonder if there's a setting to limit the size of the cache.
(assuming the cache is in fact at fault here)
@naren Now that is certainly not expected I would say.
Not sure its cache related issue or something else, I am properly closing sessions as suggested by sqlalchmey docs.
still not able to clear of memory
tried gc.collect(), clears nothing
12:29
I would suggest creating minimal possible app and see if it exhibits the same problem.
@Fenikso I have a standalone app github.com/Narengowda/pyramid_sqlalchemy_app
how do I shift a chart created with matplotlib programmatically?
I can do it with pan/zoom tool bar option using a mouse, but how to pan to the left in python code ?
@user994572 you mean adjust the axis limits?
not sure...but I think that will help.
say if the x axis contains 5 points. my chart will end at 4
Well that's what you effectively do when you pan and zoom
12:33
@naren Well, I guess it is time to convert it to a nicely formatted and self contained SO question then.
how can I do it in python code ?
(Dealing just with the x-axis for simplicity) you adjust the limits from (0, 10) to (2, 12) if you "pan across"
@Ffisegydd right - that's better. New card and cleared the account balance for sopython
@Jon did you manage to get your money back?
@Ffisegydd yup... my bank's good like that
12:34
That's good.
@user994572 are you using the object-oriented programming side of mpl or the simpler plt.plot wrapper side?
simpler plt.plot
You just want plt.xlim and plt.ylim then. So plt.xlim(0, 10) will adjust the current plot to have x-limits of 0 and 10
If you want to pan 5 to the left then it'd be plt.xlim(-5, 5)
and if you wanted to zoom in 10 times as much then it'd be plt.xlim(0, 1) etc
great. Thank you @Ffisegydd. I'll try that.
@Fenikso I do have a question added stackoverflow.com/questions/25200475/…
@naren Hmmm, time for bounty then, if it does not get enough attention?
12:41
:) @Fenikso started bounty
Upvoted, good luck in your bounty :)
@Ffisegydd Need answers badly, I even asked the same question in Google groups, but no response.
@naren maybe fix title too ;)
@Antti where does "Ztane" come from? Does it mean something or is it just a randomish name?
(mild interest)
12:45
randomish
Ah ok. Wasn't sure whether it meant something in Finnish like "Ztane (noun) - Person who doesn't like Python 2 and thinks everyone should upgrade to Python 3 immediately."
@Ffisegydd I reckon the Fins should implement that definition immediately...
who said I didn't like python 2
it is only that there is a strong preferral for python 3
Ok yes fair point.
"Person who prefers Python 3..."
stackoverflow.com/questions/25405082/… look at the <br/> in that...
It's not like I hate Python 1.5, but I'd prefer 2.5 :p
12:50
yes
exactly
I found out my fileserver has been upgraded to Python 2.6! Woop!
Unfortunately no pip, virtualenv, or anything.
So can't install any of my own packages.
<br/> is a reasonable guess for "how do I do a single line break in this dumb markup system"
and more discoverable than "your single newlines are ignored unless you end the previous line with two spaces"
I didn't know about the two spaces thing.
I just split things with newlines in between them
12:57
Same. I don't feel the need to put all my sentences on their own line. Paragraphs are fine.
What's the name of that website where you have to inspect the page source and solve riddles to get the url of the next page?
Thanks
@Ffisegydd install virtualenv locally
13:13
Dang, I wanted to solve this question on the Puzzles SE, but the original context is in Finnish.
Puzzle sites are cryptic enough when you don't have to run them through Google translate!
If only you knew someone Finnish...
back for a little bit
@Kevin though that is german obv.
I'll take your word for it :-)
Guys, does anyone know what 00 bytes in x86 assembly mean? Like I have RET instruction and then it seems to be a few zeros before anything meaningful starts again. Can this by some kind of padding?
13:24
I dimly recall an article by Raymond Chen, discussing internal practices of Windows executables.
One such practice is to put no-ops between functions. They do this so that later they can hand-edit the instructions to add additional commands, without having to reposition any later blocks.
Hmm, but that does not seem to have 0x00 opcode.
(which is a lot more annoying in assembly than in high level languages, since you'd have to recalculate all your jumps)
According to this table, x86 does have an 0x00 opcode. It's ADD.
fizzygood answering my questions
@Swordy :P
@Kevin Yes, it is, so it is even more weird. because any add in those parts of code do not make any sense. Argh.
13:30
A suffusion of brassica to you all ...
wotcha @Zero
If the code never executes because it always RETs before reaching that part, it doesn't have to make sense :-)
Umm... I'm sure we should have a reasonable dupe for this
Ain't no syntax errors in assembly.
@Jon I have an answer which could be dupe voted :P
13:34
@Ffisegydd link?
12
A: adding all the letters of a string up by 1 python

FfisegyddYou can use translate to directly change a letter to a different letter: old = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' new = 'bcdefghijklmnopqrstuvwxyzaBCDEFGHIJKLMNOPQRSTUVWXYZA' # Create a translate table. trans = str.maketrans(old, new) # Translate your string using trans pri...

It's one of mine though so I feel bad promoting it (as such I won't vote)
@Kevin Yeah. Does not make me like it or anything, but it may actually be right. Damn you, Borland!
Hey guys, I have a question..
That alphabet question is about subtracting letters, though. Totally different field.
Reverse engineering is fun. Except the times when it is not.
13:36
I look forward to hearing it, @Stormie :-)
I want to stop my programming shutting down when an error is thrown, in this case the error is going to be a keyerror
Oh, hey Kevin. It's in relation to my question we were just commenting on
One typically uses try-except to keep an exception from stopping the script
For reference, the loop I'm using can be found here stackoverflow.com/questions/25405427/…
Ah, so I just need to add an exception for a keyerror
Can I get some fresh eyes on stackoverflow.com/a/25406028/3005188? In particular why that Quentin fellow would feel except KeyError: pass is bad.
@Kevin Thanks, again! :)
13:40
Good luck with your project :-)
@Ffisegydd, maybe he learned that "an except block containing no code is always bad practice"
Which I don't agree with. All absolute statements have exceptions, including this one.
@Ffisegydd Well, personally I would do if as it does not strike me as an exception, rather part of algorithm.
Yeah I've written it that way so you can easily add dict3, dict4, dict5 to the list if needs be. Rather than having to replicate lots of lines.
Thanks a lot, again.
I've got everything working now. :)
But I suppose I could re-write it and keep the for loop still.
@Ffisegydd is @Swordy using Python 2.7? Your .keys() example won't work if so
13:44
Hmm, maybe dict[3] += dic.get(key, []). Might be less understandable than an explicit if key in dic check
(you'd have to change it to .viewkeys() for Python 2.7)
cbg @DanielRoseman
@Ffisegydd Incidentally, I think you wrote dict[3] when you meant dict3
I've changed it back to viewkeys for Swordy
@Ffisegydd to make it version agnostic, you could use for key in set().union(dict1, dict2) instead of for key in (dict1.keys() | dict2.keys())
Ta @Jon <3
13:47
I think I'd prefer to iterate through dic's keys, like
dict3 = defaultdict(list)
for dic in [dict1, dict2]:
    for key, value in dic.iteritems():
        dict3[key].extend(value)
(disclaimer, not tested, etc)
I've edited it enough now. I'm leaving it and running away to join the circus. Bloody Python 2.7.
cabbage.
Come back, I want to paint the bike shed more!
pytHon 2.7 here. how do I parse this json?
I suggest the json module for parsing json
13:50
for an ordered dict do I still need to parse json?
i am wondering, if there's a shortcut.
There doesn't appear to be any json in that document
i am mistaken and you're correct.
itisalreadyparsed
Huzzah!
now I just need to print specific values.
print opp['CreatedById']
from itertools import chain

def merge_dicts(*dicts):
	all_keys = set().union(*dicts)
	return {
		key: list(chain.from_iterable(d.get(key, ()) for d in dicts))
		for key in all_keys
	}
@Ffisegydd you can nick that - ignore the fact my editor has lost my settings again...
that'll do an arbitrary amount of dicts
13:55
Cbg
cbg @mamasi
ooh, set().union(*args). I'll have to remember that one.
Holy s*** poke just answered a question.
....
obj_field = getattr(item, header)

if type(obj_field) == bool:
if obj_field == True:
obj_field = u"YES"
else:
obj_field = u"NO"
Is this the optimal way to check the type?
@Ffisegydd I've seen him about a little bit
13:57
@mamasi when checking if something is True use is True
merge_dicts = lambda dicts: {key: sum([dict.get(key, []) for dict in dicts], []) for key in set().union(*dicts)}
>>> 1 == True
True
(don't actually use this, as sum composes lists in O(N^2) time or something ridiculous)
@mamasi use isinstance
@mamasi depending on what else is going on...
try:
	obj_field = {True: 'YES', False: 'NO'}[getattr(item, header)]
except KeyError:
	# wasn't a boolean True/False

« first day (1404 days earlier)      last day (3769 days later) »