« first day (2063 days earlier)      last day (2880 days later) » 

12:12 AM
you mean the dubstep genre?;)
no idea
 
cbg all
 
@clickhere a library that does both video and audio processing (they are separate things) for you? no, but I hear a lot about gstreamer when it comes to that type of stuff
 
has anyone here worked on hackthissite stuff?
 
user559633
12:39 AM
@clickhere a module? that's something you could easily do in ableton
 
looks like a costly piece of software
 
user559633
you should be able to get an ableton lite copy legally and cheap. maybe free even?
 
user559633
good luck on your journey to make an obnoxious sound clip
 
i used httpie for most of the basic "missions". (httpie written in python) so it's not totally off topic :)
 
user559633
@wgwz ask the specific question
 
user559633
12:44 AM
if it's about programming things in python, it's probably close enough to on topic
 
don't really have a specific question at the moment
 
hah, ty tristan
 
 
2 hours later…
3:17 AM
Sorry can you delete it?
 
nope. I'm not a Room Owner
 
And I wont do it again.
 
user559633
I got you :) Thanks for not arguing about the rule
 
user559633
anyone have a favorite high-end mouse that lasts for years? i go through a logitech every 18 months or so
 
3:21 AM
I use GE and haven't had a problem
 
user559633
it's always the left clicker button that stops working for either click or click+drag.
 
you know what mouse has lasted longer than I can remember, and is still going strong?
that mouse
 
user559633
oooh intellimouse, yeah, i used to love mine
 
I can't remember the model name yeah! intellimouse!
 
user559633
3:23 AM
way to internet, me
 
user559633
[the image prediction is wrong on that]
 
and that mouse took a beating
 
user559633
yeah. i used to use it a lot when i was doing cool guy stuff
 
I'm still using it now actually. It's connected to my Windows machine
 
user559633
3:24 AM
alright, you busted me. back when i played counterstrike competitively
 
UT2K4 was my thing
 
user559633
 
user559633
i'm going to get this and just bust it out of my computer bag during meetings without reacting
 
that would be fantastic. Midway talking about something really important
 
user559633
yeah, my favorite IT/helpdesk guys that i worked with ordered a hello kitty set after a coworker made a big deal to express that he didn't care what keyboard/mouse model
 
3:27 AM
well played
 
user559633
of course the guy didn't use it
 
user559633
[i ended up using it when pairing because :D]
 
haha
 
3:42 AM
sigh...I knew I shouldn't have answered that question until OP clarified
 
Night cabbage, all.
 
user559633
yeah, i saw that and assumed the user would say "and also baz and also oo and also"
 
user559633
hey @MorganThrapp
 
Did you like my artistic rendering of you and fizzy?
 
user559633
it's lovely
 
3:44 AM
I thought it really evoked the nuance of your forbidden love.
 
granted, I only noticed the fact that he hit up chat after I answered (which would have been an indicator of a need for garlic)
 
user559633
sometimes i forgot that i still exist in your minds when i'm not in the room
 
ah, well. mark as dupe and move on
 
best thing to do
 
Also, I'm drunk and waiting for the gf to get back from hanging out with her old college roommate, so I'm entrusting y'all with entertaining me.
 
3:46 AM
scroll up. Tristan is buying a hello kitty mouse
 
user559633
@JGreenwell when NLTKing on boxes that need to respond to requests, how do you load the wordbanks? do you put them in ram?
 
Beautiful.
 
I only answered because I see a lot of new programmers struggle with the idea of "strings" as "array/list/tuple of characters" and I wanted to point OP towards this idea
 
user559633
or at least some mouse. i computered too much and my macbook air keys are mushy and my mouse doesn't want to click
 
...I blame Java for the string thing
 
user559633
3:48 AM
eh, i think the "strings aren't like natural languages" thing comes from not coming from java/c/c++/lower-level-of-the-higher-level-languages
 
user559633
@MorganThrapp what kind of music do you like when drinking?
 
user559633
pretty sure anything i'll talk about from now until 4-6am won't be interesting
 
how large are the requests and can you use "semi" canned responses while processing (like "Thank you for that question handsome") to reduce the delay in response?
 
user559633
javascript's Date() constructor is really reasonable
 
user559633
new Date("2016-06-08 20:00")
Wed Jun 08 2016 20:00:00 GMT-0400 (EDT)
new Date("2016-06-08 20:00:00.123456+00")
Wed Jun 08 2016 16:00:00 GMT-0400 (EDT)
 
3:50 AM
not a hit against Java, its a hit against how strings are taught in a lot of Intro Java courses
 
user559633
@JGreenwell the architecture is a set of worker boxes pulling tasks off a queue, so it's more about not tearing down/building up for each 300 word corpora
 
.....
 
user559633
i'm currently doing it by loading a process and threading out, but i didn't know (and doubt) that any of the wordbank stays in memory
 
Mar 9 at 22:46, by idjaw
new Date('2016-03-09')
Tue Mar 08 2016 19:00:00 GMT-0500 (EST)
new Date('3/9/2016')
Wed Mar 09 2016 00:00:00 GMT-0500 (EST)
heheh
 
user559633
lol i can only assume i said something profoundly stupid
 
user559633
3:52 AM
so i'll just say what i said to my first wife: i can and will have you deported
 
> @JGreenwell This is different because it deals specifically with input()
 
@tristan Anything some what catchy. I currently have a mix of Hit That Jive Jack, and Missed The Boat stuck in my head.
 
really?
 
user559633
@MorganThrapp this is catchy
 
@idjaw I. Wat? Why? How?
@tristan You're catchy.
 
user559633
3:53 AM
yeah the date constructor owns
 
as long as I could avoid hitting recursion limits, or optimize enough not to, I would use RAM in that situation
 
user559633
i was trimming responses from postgres and let one slide through and was pleasantly surprised
 
One day I'll work with PostGRES, it seems to be the only sane database these days.
 
I like tricking people into thinking I responding to them with NLTK....not that I ever do that
 
user559633
@JGreenwell yeah, i'm being a little clever about how i'm handling the input in that i typically only operate on log input size
 
user559633
3:55 AM
i'll do some benchmarking and write-up what i come up with
 
I like PostgreS but admit to being sentimental cause it was the first database I ever used (professional/academically/just for fun)
 
user559633
maybe it's doing some magic now, but i kind of doubt it as that would be an insane assumption
 
Cool, I'd be interested in that. It actually sounds like something I was looking at (in regards to complexity theory and memory handling) a semester or two ago....man, those are starting to blend together
"how does your code work daddy?" well, son first we make a sacrifice to the compiler, and pray it is not angry with us....
 
Postgres is delightful
@JGreenwell I have a hit against Java (strings? equality? whatever the heck it is) - they don't compare with ==, they require .equals().
 
as long as you check for nulls
hence, the only time I tried to do analysis with Java - I nearly always had to override the method to add some custom null handling
 
user559633
4:11 AM
kind of related: i've recently taken to a behavior where i raise custom exceptions, then implement logging in the exception
 
meaning, logger.exception('fnord')?
The other thing you can do with Java is if you're using magic strings "the droids I'm looking for".equals(these_droids)
 
Why would you pass an empty string to a method? Man, that's annoying ...
 
yes it is
 
user559633
class TristanCompanyBackendException(Exception):
    """Exception that optionally fires off a message to server logs."""

    def __init__(self, message="Server error.  This is our fault, sorry.", server_log_function=None, server_log_message="", placeholder_object=None):
        """
        :param message: the message to communicate with the exception
        :param server_log_function: the function designated for receiving log messages
        :param server_log_message: the message to send to the server_log_function
 
I like looking at my logs and seeing query stings like 'select * from table; drop table' and getting to think "ah, you sad child. Did you think I wouldn't sanitize my queries."
 
user559633
4:20 AM
i wish SO Corp would spend some time on chat features
 
I always like how metas about Chat always have a bunch of comments/answers which start: "I don't use chat but ..."
 
user559633
yeah. i'd be super hyped about a zulip or slack integration
 
I just want IRC :P
 
user559633
running your own bouncer and dealing with netsplits suck. and as an italic named member of this room, it would mean i'd also have to think about nick registration or ensuring that a RO is always the first to join after a netsplit
 
I think my brain is shutting down. Time for a cold one then bed. Rbrb all.
 
user559633
4:26 AM
interesting though. i bet i could hack together a plugin that stored user-specific chat history and could play it back when requested (where the benefit of a server-side plugin is that it has access to all chats)
 
user559633
(later jgreenwell, have a good night)
 
4:36 AM
rbrb jgreenwell
Well, I know that gitter manages it. I don't know if they give ops powers... I've never really tried, but I don't think they do
 
x='var_name'
y=12
x=y
How do I make var_name to return 12 without using the assignment?
print var_name should be 12. Is it possible?
 
user559633
are you looking for something equivalent to PHP's variable variables?
 
yes
 
user559633
also, is this a curiosity, or are you actually writing software like this intentionally?
 
I want to generate dataframes dynamically. For each dataframe there should be a different name.
 
user559633
4:43 AM
why does the dataframe need to know its variable name?
 
The dataframe names should be x_1 x_2 x_3 and so on.
 
user559633
in any case, variable variables just look up in a table as far as i know
 
user559633
>>> x = "var_name"
>>> y = {x: 12}
>>> y["var_name"]
12
 
user559633
you can use a dict as such a table
 
user559633
there's lots of other ways, but that's the first that came to mind
 
4:46 AM
I'm calling it a night
rbrb
 
user559633
take care mate
 
cheers
 
mydict={}
for mycollege_id in college_id['id']:
mydict[mydf]='df_'+str(mycollege_id)
query = ('some query order by marks desc') % (mycollege_id, mycollege_id, mycollege_id)
mydict[mydf]=pd.read_sql(query, conn)
This did not generate separate dataframes as I expected.
 
@shantanuo note, you can edit the post and click the 'fixed width' button that will appear over there ----------------------->
 
mydict={}
for mycollege_id in college_id['id']:
    mydict[mydf]='df_'+str(mycollege_id)
    query = ('select name, marks, ( case when first_pref=%s then 1 when second_pref = %s then 2 when third_pref = %s then 3 else 0 end ) as mypref from students having mypref > 0 order by  marks desc')  % (mycollege_id, mycollege_id, mycollege_id)
    mydict[mydf]=pd.read_sql(query, conn)
 
4:54 AM
or paste a whole new message :P
 
user559633
mydf is coming from where?
 
I'm curious why your item assignment would be doing something with a dataframe?
I mean, mydict is a dict. You're giving it a value of df_whatever, and then all you're doing later is replacing that value
 
For each query output I am trying to generate a separate dataframe. mydf is just a temporary variable used in dictionary.
 
unless I seriously mistunderstand how mydict[mydf]= works
yeah it's a temporary variable - what type is it, and what is its value?
is it an int? a tuple? None?
 
user559633
yes, but where is mydf coming from?
 
user559633
4:58 AM
i assume defined above
 
user559633
where it's not being defined or modified by the loop, it's just getting overwritten repeatedly
 
I just want to save all dataframes in a dictionary with distinct name that will identify the data within the frame. I had done this before and It worked. I just don't remember how I did this.
mylist=[]
for mycollege_id in college_id['id']:
    mydf='df_'+str(mycollege_id)
    query = ('select name, marks, ( case when first_pref=%s then 1 when second_pref = %s then 2 when third_pref = %s then 3 else 0 end ) as mypref from students having mypref > 0 order by  marks desc')  % (mycollege_id, mycollege_id, mycollege_id)
    mydf=pd.read_sql(query, conn)
    mylist.append(mydf)
    print mylist
This works. But it does not store the names of dataframe.
 
Do you understand how a dictionary works?
 
user559633
garlic
 
My thoughts exactly -_-
Certainly revealing: stackoverflow.com/…
rbrb. It's time to succumb to the syncope
 
user559633
5:21 AM
take care/good luck/hope it's restful
 
5:47 AM
I want to use Django+authorize.net, I have tried merchant but could not figure it out, is there any tutorial/information I can use?
 
6:09 AM
cbg
@arshpreet authorize.net has an API that you should use. I don't see how Django has anything to do with this
Bretty simple. Send xml/JSON, receive xml/json.
 
even then you messed up the case
 
@khajvah yes but i was looking for skelton project
 
@arshpreet DIY
 
@khajvah OK
 
I'm wondering, why is python's copyfile so slow compared to copy and paste? Is there some command that accepts a array as an argument?
 
user559633
6:29 AM
how are you copying the file
 
user559633
i'm wondering if you're reading a file into python, which means reading from disk, into the interpreter, streaming back out to a file
 
user559633
and sometimes the OS will tell you a file operation finished before the writing is complete (and certainly before the disk is done on any modern drive)
 
user559633
anyway, you have options: perhaps shutil would be quick (if that's not what you meant by copyfile, i assume there's more than one module with that method), or you could subprocess so the OS optimizations/behavior would be done, you could do boost python, ctypes, etc
 
6:49 AM
hate refactoring days
 
cabbage
 
Cabbage :-)
 
Cbg @thefourtheye, Howyadoin?
 
user559633
cbg
 
@BhargavRao I am fine... Thanks :-) How are you?
 
7:00 AM
Doing quite well! Ty. :)
 
@davidism Hello! I saw my post putting on hold stackoverflow.com/questions/37696936/… and i reformatted it again to make it more user friendly. I hope not to become closed?
@Zulan Hello! I saw my post putting on hold stackoverflow.com/questions/… and i reformatted it again to make it more user friendly. I hope not to become closed?
 
You don't need to ping individual users, They'll see your post and do the needful
 
They have pinged my post to off-topic that is crucial to me
 
@Bhargav why make multiple tiny edits?
 
@Ffisegydd I forgot one edit so, I had to re-edit. Fortunately it was within the grace period and the edit is registered as one.
 
7:15 AM
Ah ok. Just I was editing at the same time and got 2 "A new edit has been whatever..." notifications, and both were you :P
 
Haha, Even I dislike that when it happens. Sorry. :D
 
user559633
rhubarb
 
Cya
cbg @vaultah
You guys work in shifts? One RO leaves and the other enters :P
 
My Intranet blocks code.activestate.com
:'(
 
7:36 AM
@thefourtheye seriously :d
 
I read that the other day.
 
@AnttiHaapala Yup... I asked the team which maintains the security policies for an explanation.
 
It'll be an automated procedure where the security software does some NLP/tagging/whatever to try and deduce the category of site (i.e. "Gaming", "Pornography", "IT", etc).
It might well have mis-categorised ActiveState.
But usually security teams can put in exceptions along the lines of "No matter what PicturesOfCats.com is tagged as, allow it through"
 
Ya, I think they will explicitly whitelist this site. Hopefully...
 
If it's a sane classification system (not guaranteed) then they might be able to whitelist in such a way that it actually improves the classification algorithm in general, rather than just being a block whitelist.
 
7:43 AM
@thefourtheye there was a mandatory filtering program being installed to many school computers in Finland...
from exactly 1 provider (surely a case of corruption)
... but the problem is that Finnish language is highly synthetic, so you cannot use simple word matching.
One of the blacklisted words was porn*
 
These days browsers themselves have basic blacklisted websites. I think that itself is enough.
 
... which meant you couldn't browse information about
Pornainen (Finnish pronunciation: [ˈpornɑinen]; Swedish: Borgnäs) is a municipality of Finland. It is located in the province of Southern Finland and is part of the Uusimaa region. The municipality has a population of 5,108 (31 March 2016) and covers an area of 150.09 square kilometres (57.95 sq mi) of which 3.59 km2 (1.39 sq mi) is water. The population density is 34.87 inhabitants per square kilometre (90.3/sq mi). The municipality is unilingually Finnish. == Politics == Results of the Finnish parliamentary election, 2011 in Pornainen: True Finns 25.4% Social Democratic Party 22.8% Nati...
 
@thefourtheye Really?
 
actually it blocked all sites which just listed all municipalities in Finland <3
 
@BhargavRao he might have tranformed into me, The Mask
and cbg 😉
 
7:47 AM
Oh, Then I need to be more careful ;)
 
@Ffisegydd Ya, Chrome issues a warning about a few sites every now and then
 
You been looking at some dodgy websites then? :P
 
@AnttiHaapala I am going to use this as an example to tell people that wildcards need not necessarily work always ;-)
 
They don't blacklist them though, just show warnings.
 
@Ffisegydd Who doesn't? ;-)
@Ffisegydd Oh yes. They just warn. Okay, I think I understand why we need that software.
 
7:51 AM
Generally they're for sites that have been flagged as containing malware.
 
MongoDB: Because /dev/null doesn't support sharding. - Random Guy On Hacker News.
 
8:21 AM
 
8:31 AM
I like
> as defined by some guy on Hacker News with
maximal opinions and minimal evidence.
 
cabbage
 
Mongo is a good DB for something like a prototype, rather than a fully engineered solution. The issue comes when people take it past the prototyping stage.
 
why getters are considered evil in this article? can someone please explain that to me? yegor256.com/2016/04/05/printers-instead-of-getters.html
 
@AnttiHaapala that could've happened here too. Especially the "from exactly 1 provider" part:D
@MidoriKocak because it's java:P
@MidoriKocak and there's a link to why they say it's evil
 
@AndrasDeak that is the same guy. I understood setters part. But getters? not
 
8:36 AM
OK but you're asking "why are they saying it's evil" and linking to the wrong article in the wrong language
there's also a reference to this article
which has a reference to this article, which is about extends, which is not a thing in Python
so we're losing track
 
I read that too. I know Python has OOP too. I am asking the philosophy.
 
I don't think you can separate philosophy from language entirely
 
the latter one is something related to gof "composition over inheritance" isnt it?
@AndrasDeak separate quicksort from python please.
 
especially that many of the "X is bad" rules come from X not being bad, but stupid users using X for all the wrong reasons, and abusing it
in this sense "X is bad" is very language specific: Java idiots and Python idiots are probably different
 
I think for the philosophy, you can read the article linked about Java. The main argument to keep them seems to be that some frameworks (especially in Java and some Ruby apparently) rely on them. But that's a pragmatic argument (very powerful if you use the frameworks), not a philosophical one.
 
8:40 AM
@MidoriKocak just because some questions are language-agnostic doesn't mean that all of them are:)
 
There very much is a difference in philosophy between Java and Python, though. The get/set argument is much clearer in Python IMHO.
 
I am asking because I don't understand what the fuck is the alternative to getters. Really.
 
Just access the variable directly, if it is needed.
(in Python)
 
I am not defending that article too.
 
are there even private class member variables in python?
which goes back to my argument about this not being a language-agnostic question
 
8:42 AM
You will notice that the article you linked he talks about using printers (I know you're not defending it). So, he has (philosophically speaking) hit the same issue as you are worrying about I think. In that he needs to be able to "see" or "access" the variables in some sense.
@AndrasDeak No, but yes, but no....
;)
 
@JRichardSnape Dutch...:D
 
@JRichardSnape is the book's responsibility to print itself?
 
So if you can't access some variables otherwise, I understand that you need get/set and there's an argument about it. The question might not arise in the first place in Python, unless you intentionally want users to use getters/setters
 
@AndrasDeak :D touché
 
matplotlib has a lot of those, ax.get_xticklabels() and whatever
but you can also access the same information directly
it juts takes more elbow grease
 
8:46 AM
@AndrasDeak Yes - hence why I said the argument was more settled due to the philosophy of Python - c.f. the BDFL's “we are all consenting adults here”
 
I know that python trusts developers. That's an awesome thing. But all those responsibility things are confusing me.
 
@JRichardSnape I'm very happy with that notion:)
 
I have to mention a package in requirements.txt in python project which needed to pull from github(github.com/pierxco/merchant) how it will be mentioned?
will django-merchant==github.com/pierxco/merchant work?
 
@MidoriKocak What I was saying (you asked on the philosophical level) is that obviously an object has to expose some of its state to the outside world. Whether you call it myBook.getContents(), myBook.json() or myBook.printMeYourContentsGoodSir() isn't too importent.
People get a quasi-religious attachment to certain naming schemes and patterns, which then inspires a similarly zealous resistance.
4
 
8:49 AM
@JRichardSnape I appreciate any explanations now, hence I am lost.
 
@MidoriKocak Well, I'm not sure I can help entirely. My first comment (I Java sometimes, for my sins) is that the article you originally linked is highly opinionated and his whole blog seems that way. You might also notice that the root article linked is from 2003, yet still the argument rages - implying it is far from "settled"
 
I think there is a philosophical difference in Python. There is no such thing as "private" philosophically. In Java it's baked into the language.
cbg @antti
 
h
 
@MidoriKocak I didn't read anything (to confuse myself). Getters are not considered evil in Python. They're just unnecessary
 
9:01 AM
guesses Antti has a better informed and more stongly held opinion on getters than me
 
in Java you need to have getFoo() and setFoo() to achieve the same thing that you can achieve in Python with a simple @property.
 
...and yes, makes a good point immediately.
 
in Java, you need to write public Bar getFoo() { return foo; } public void setFoo(Bar foo) { this.foo = foo; } even if there is nothing special now
if you instead did public Bar foo; as an attribute in Java, you cannot modify the get/set behaviour later on without breaking your API. Neither can you modify it in the subclasses.
However in Python you can do:
 
I just read Martijn's @property post but it's way too early for me
sorry for the interjection interruption (?) :P
 
@AnttiHaapala @Ffisegydd virustotal.com/en/domain/code.activestate.com/information. This is why it is blocked in my Intranet it seems.
 
9:23 AM
@AndrasDeak "way too early?"
 
@AnttiHaapala as in "I only slept 4 hours and haven't had coffee yet":)
@AnttiHaapala thanks, will do
 
10:14 AM
Say you had a custom object that stored some x, y data. Would you prefer to access it through data to return a tuple (x, y) or using the x and y attr directly?
 
depends
both better :d
or return a namedtuple/let data be a namedtuple :D
 
I did consider that also, but then obj.data.x is a bit verbose.
That's an extra 5 characters.
I've stopped using libraries for less.
 
Bad time to be a librarian.
 
> I've stopped using libraries for less
:D
 
I also say "both"
obj.data, obj.x/xdata, obj.y/ydata
 
10:21 AM
Oh god so many failed tests.
 
You were testing me? O.O
you monster!
 
I'm always testing, both my code and people's patience.
 
cbg
 
cabbage PM
 
@vaultah I suspect they want the number itself, if it's an exact multiple of 10, otherwise they want the next higher multiple of 10. Which can easily be done with -n//10*-10. But since they're not responding to clarification requests, stuff 'em. :)
FWIW, there do seem to be an awful lot of those GTIN-8 code questions, they're almost as popular as the broken phone diagnosis ones.
Hi, Andras.
typo stackoverflow.com/questions/37723045/… quick, before more answers get posted. :(
Thanks, people! Answering code typo questions is bad enough, but when it's a typo in the yamming data? :facepalm:
 
10:45 AM
at least no 150k users have answered
 
@AndrasDeak :) FWIW, Tim Peters has been answering newbie questions lately, eg stackoverflow.com/questions/37715461/…
 
OP self answered even, and it's still a mystery what's it about
 
@PM2Ring well that seems like much less of a blatant noob question
I'm mostly infuriated by language syntax basics and typos
 
@AndrasDeak True, it's fairly reasonable, but easily answered by consulting the docs. But I guess you have to know where to look.
@asimkon Ok. That pyconfig.h file does look broken, so I've voted to re-open your question. I know C, but I don't know Windows, so I can't offer any advice.
 
10:55 AM
Hi all! what is the easiest way to find pattern in string I have "bla bla bla... \\number,number\... bla bla bla" how to define searching two slashes and after that two numbers?
 
Regex.
 
So it would be find ('\\\\\d,\d')?
 
@XuMuK BTW, they are backslashes, not slashes. You need to be careful when using backslashes, since they are used as an escape character in Python. And it's even trickier doing stuff with them in Regular Expressions, because they are a regex escape character as well. Fortunately, Python provides a raw string syntax r'this is a raw string' that makes it a bit simpler.
 
@PM2Ring Thank you! Yes, raw string is more understandable!
 
11:15 AM
Do we have a dupe for "in tuple unpacking, rhs is evaluated first"?
 
Your answer ends in a question. Perhaps you should edit your question instead and post this information there? — Antti Haapala 18 secs ago
@IljaEverilä ^
 
@PM2Ring But how to search at the same time raw and regex? r"zzz"+\.. ?
 
@BhargavRao The question in your target is not an exact match, but Martijn's answer covers all the necessary points, IMHO.
 
morning everyone
 
11:26 AM
@PM2Ring Self Hammered, So the OP Understood
@corvid morning \o
 
@BhargavRao Cool! If only more OP's were that cooperative. :)
 
I closed it as a dupe of a wrong link and noticed it a few mins after that stackoverflow.com/posts/37724186/revisions
@PM2Ring Yep. "If" only. ;)
 
@corvid 14:31, Good day!
 
@XuMuK Here's an example:
import re
pat = re.compile(r'\\\\(\d+),(\d+)')
data = r"bla bla bla\\123,456hey hey hey\\789,987bye bye"
a = pat.findall(data)
print(a)
#output
[('123', '456'), ('789', '987')]
Note that if we don't use a raw string for the regex we need 8 backslashes in a row: '\\\\\\\\(\d+),(\d+)' That's hard to read and too easy to mess up.
 
11:47 AM
Am I wrong to think that with a web server set up to automatically compress what it sends, using either XML or JSON is going to result in pretty much the same size of data transferred across the network?
 
@RobertGrant always? or it will compress xml or json roughly to the same size?
 
The latter - the compressed result will be very similar in size
Just because quite a lot of the extra "weight" in xml is closing tags, which can be compressed out pretty well
(Is my theory)
 
@PM2Ring Thank you! I forgot to use "()"!
 
pretty easy to test - serialize a variety of structures to xml/json, and then gzip them. See what size they end out as.
 
@RobertGrant That should be roughly correct, although there's a bit more overhead in XML with all those named tags (and attributes), and even though it's chaff it can't be compressed away completely.
 
11:55 AM
cause (AFAIK) that's what most compression uses in the web browser world. Of course that also requires the clients to accept compressed data.
 
If you write a good gzip question Mark Adler himself may even answer it. :)
 
@PM2Ring Thanks! I downloaded ActivePython 2.7.1 from activestate.com/activepython/downloads , i do not know why pyconfig.h is broken?
 
of course that's also ignoring the fact that you're going to put an increased load on your server to compress it all.
but if you have loads of computation to spare, and you're paying by the bit, then that certainly could be a useful approach
 
@asimkon As I said earlier, I can't offer any advice because I'm not familiar enough with Windows, and I've never used any C compiler on Windows.
 

« first day (2063 days earlier)      last day (2880 days later) »