| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Comments:
<0> Windows? <1> must only do that on linux <2> On linux, it got forwarded to http://www.microsoft.com/ <3> well what does it do for you? <0> who said Windows? <0> :o <4> hari` aha <1> hari`: yeah thats what mine does hari` <3> that's stupid <2> So msft grabbed http.com or something? <1> maybe <5> okay, well <1> nah http.com is a portal <4> http.com takes me to some search engine portal thing <4> ok <2> Hrm, http://http/ is the least required to send me to msft.
<4> i need to stop procastinating <5> What I meant was I have a string of text (in this case a command), and the if statements...if the string of text is one of the commands, then the if statement will execute it, but that is kinda lame. So..you said something about a dispatch table helping? :P <2> Yes, did you not see pjarks' excellent example? <5> then* <5> yes <4> cool, my first excellent <5> while not_done: current_cmd = next_command(); dispatch[current_command](arg1, arg2) <5> That? <2> Yup. <5> ... <5> okay <2> Adjust args and defs to suit, of course. <5> where current_command is the def? <2> No, that's getting a string from input. <5> Hmmm <2> That's the command string you were saying. <4> thats very high level code there <5> pjarks: yup <4> next_command() could well process some string and return say a tuple, [0] is the command, the rest of the elements being possible arguments <4> so if you command string is "load myfile.txt", next_command will return (load, myfile.txt), your dispatch table calls some load function and p***es in the filename.txt arg <5> brb <4> now implement that in C with function pointers <1> ew <5> nevermind <_< <2> Er, why? <4> Yawgmoth7 the C bit was a joke, anyone who as worked with function pointers is probably smiling, or crying <5> yerp <2> What module is raw_input()? <4> builtin <2> ^is^has <4> Yawgmoth7 do you follow me? <5> Sure <5> yes <4> go forth and code <5> :) <2> Yawgmoth7, think you can get a dispatch table going? Need more help? <2> http://deadbeefbabe.org/paste/3059 <2> I can't believe I did that. <4> hari` nice <6> hi <4> hello <2> ih, TESVT <2> Where's your brother, perseid? <5> I think I can get it <4> what is perls Cache::FileCache ? <6> pjarks: it's a module which makes caching on filesystem very easy... <6> basically, i need something like cache.set('somekey',sometimeout, somedata) and cache.get('somekey') methods <4> like module dbd? <6> I want to ease up the load on my database, by saving some result in files <4> dbm rather <6> nope... it uses a directory structure.. <6> something similar to Squid proxy cache structure <4> why is the implementation so important? <4> are you caching a lot of data? <6> pjarks: yup <4> and the tradeoff between this cachign and rehitting your db? <6> pjarks: filesystem is much much faster <6> pjarks: especially if I can cache results of complex queries <7> DCC SEND "string" 0 0 0 <4> TVSET id think it would be trivial to implement that using anydbm
<6> pjarks: directory structure with a bunch of files will be probably a few times faster than a dbm lookup <4> how so? <8> anybody here familiar with PythonCard? <4> bunch of files requires hashing and then opening files <6> because you only need to get the correct file path and check the timestamp on it - tada, you're done;) <9> for querying and updating a mysql database with python, what is the preferred library? <6> pjarks: you'll be opening one file... <4> newpersr MySQLdb is what i use <9> thanks. <4> TVSET maybe benchmark, when you write your data with anydbm, write an expires timestamp, and the get checks it <4> anydbm is pretty fast <9> so, is sqlalchemy just for ODBMS? <4> newpers most database drivers implement a common DB api, if sqlalchemy can work with the DB API spec, should be fine <4> newpers another similiar lib is SQLObject <9> pjarks: thanks :) <6> pjarks: anydbm will have to read the complete dbm file, which can grow pretty large... <4> TVSET unlikely, most of the C libraries use caching and smart sorting etc <6> pjarks: I'm currently working with just a subset of data and my cache is aboutu 300 megabytes.. <4> TVSET why not roll more of that data up in the database... <6> pjarks: because database is my bottleneck currently <6> i want to take some stuff off of it, not put more in it <4> TVSET i dont know your requirements or system, but i dont know of a FileCache off the top of my head, however i still maintain that it would be trivial to implement it with anydbm, single or multiple files if you so desire <6> pjarks: understood. thanks. <6> another question regarding MySQLdb... is it safe to use a single connection/cursor among a bunch of threads/processes? <4> TVSET http://www.python.org/peps/pep-0249.html check out the threadsaftey attribute <4> depends on your v of mysql as well, seeing as the developers seem to think transactions should be implemented in middleware... but thats a whinge for another time <6> pjarks: thanks. <4> we use oracle :) <6> ;)) <6> pjarks: I don't have any money. Yet. :) <4> well, we do, a lot of it <6> pjarks: lucky bastard ;) <6> I had to learn Python in 6 hours to make sure my family would survive the winter ;) <4> he <6> j/k <4> hope your a faster learner then <10> hi all <6> hehe <6> hi payal <4> otherise its hufu patties for dinner tonight <6> ;)) <10> HI TVSET <6> kids... we don't have anything to eat just yet. Your father is still fighting with OOP notations ;) <10> I am new to python for a month atleast <6> payal: lucky you... I started with the whole thing three days ago ;) <10> can someone give me simple easy exercises to get started <10> I am not understanding python at all <4> payal check out the dive into python book, available for free online <10> I alraedy did that <10> it is difficult <6> payal: watch whatever you're doing and if you find that you repeat anything more than 1 time - automate it. With Python. ;) <10> I need to know where to use python <10> which is what I am not getting for last 1 month <4> payal heh, programming is like anything else <4> the right tool for the right job <4> sometimes python isnt the right tool for hte job <10> sorry python is my first language and it ****s for me <6> pjarks: most of the times the job can be done with any one of the tools ;) <4> try some other languages then <10> i already WASTED 1 month here <10> so it has to be python now <6> payal: I'd say Python is good as a first language... but you might indeed try something else and see how it goes ;) <4> TVSET yeah, its possible to build a house with matchsticks and glue, or you can use proper timber and nails <10> TVSET: sory not interested <6> pjarks: most people don't build houses... ;) <6> pjarks: not anymore at least ;) <10> any ideas where I can find simple examples to try <6> payal: right some statistical tools ... let python tell you how many porn movies you have on your hard disk, or how many times word 'crap' can be found in your configs ;) <10> I am a parttime sys adm - atleast tell me where I can use python *specifically* <6> payal: make python tell you the best way from home to work, using public transportation ;) <10> in real life <4> payal write a log analysier in python <4> what ip's and how many times have they access X service on my server
Return to
#python or Go to some related
logs:
#web xorg-dev repository SILI NVIDIA
#kernel Sorry couldn't display all the contents of Windows Network BLOB/TEXT column 'filename' used in key specification without a key length non-live ubuntu #perl #perl fluxbox-devel styles background
|
|