@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30



Comments:

<0> such as a validator cl***
<1> kosmonaft, Wow, I'm in linux too. since when did that stop people from having "telnet"
<2> Whtiger: telnet ok
<2> Whtiger: then?
<1> kosmonaft, PM me, I don't want to bother everyone else here
<2> Whtiger: ok
<1> er
<2> Whtiger: hmm...
<2> Whtiger: just join #kosmonaft
<1> /msg Whtiger message?
<2> Whtiger: tried that.. doesn't work
<3> is there anyway to figure out what the mysql unique ID will be after an insert?
<1> yes
<1> ask #mysql
<1> I'm sure they know =p



<4> hello all
<4> alrighty, here is my question of the day. would it be stupid or plasuable to try to parse a log file like this into an array in PHP? http://pastebin.com/572528
<5> its very plausable with some ReGEX
<4> awesome
<4> yeah, i know php quite decently, but am not too experienced with parsing files or with ReGEX
<4> would it be too killer for me to do?
<5> you'll want to look for NAME: and NUMBER:
<5> it might be some trial error, but shouldnt be to difficult..
<5> im not a regex person either,. but it not that complicated
<4> hm, sweet
<4> cause that log file is ugly when it has several thousands calls in it
<4> but i figure i could fix that with PHP :-)
<4> *thousand
<6> NSGN, it's possible to do that without RegEX (although it's the logical path to the solution) without substr()... some if's, etc
<5> right.. explode on \n
<5> or \r
<5> and substr in PHONE:
<6> or just use file() which reads the lines of a file in as an array
<7> http://hashmysql.org/paste/viewentry.php?id=1490
<7> I know it's a mysql question, butthe folks don't answer, can someone help ? want to convert this query to use joins instead of nested queries
<4> tempest1: hmm...really?
<4> that sounds tempting
<4> cause i would prefer to not learn Regex right now
<4> hehe
<6> SELECT M.*, P.label FROM metas M, pages P WHERE P.action_id = actions.id where actions.name = 'splash' AND P.meta_id = M.id LIMIT 1
<4> dang...i just realized how slow this might be
<4> the log file currently has 1600+ lines
<4> a while loop takes FOREVER
<8> anyone know of a good php/mysql code generator?
<5> 1600 would only take 5 seconds or so
<5> maybe faster
<7> tempest1: doesn't work
<9> ola GEAN
<5> glaucontech: php/mysql are two seperate things.... what are you trying to generate?
<8> like ruby's rake etc....
<9> everybody say hello to my friend GEAN
<10> When I turn on safe_mode, may per-domain session.save_path settings are reverted to /tmp (!!)
<10> anyone know why?
<8> something to generate php functions for mysql databases
<11> Ola galera
<5> whats rake do, im not familiar with ruby
<9> english, please GEAN
<4> rockbiter: my computer is being pwned by this loop
<11> hello
<4> i have to be doing something wrong
<5> NSGN how did you setup your loop?
<4> im checking, haha
<8> you just give a script access to a mysql db and it generates all the inserts, updates, deletes etc
<8> i've found a few projects... phpGen, phpGenie, php Form Generator
<4> rotfl
<11> where i can find good tutorials about php
<4> ok, i had a problem stopping my while
<4> fixed
<4> man, *whew*
<4> that was stupid
<8> none of them look like they are maintained though
<5> glaucontech, so you dotn want to do any code then... like makeform(this.db);
<8> no i want to do code, but i'd like a skeleton of insert, update, and delete methods
<5> you need a framework, or at least a cl*** to do it.. there are tons out there, or you can write your own.



<5> try PEAR - the most kept up one
<11> somebody can help me?
<8> what is makeform?
<5> or i think Symphony is similar to rails setup
<5> an non existant function..
<5> i just made up for an example
<9> To be a noob is a problem here
<9> nobody seams to help a noob
<5> caracas_brasil: did you ask a question?
<4> hm, now what was someone saying about parsing this log without regex?
<4> cause i'd love that
<9> not me, but my friend GEAN
<4> i dont see how it could be done via substr
<5> tutorials? http://www.google.com
<4> but i suppose it is possible..
<5> php.net
<12> GEAN: php.net/tutorial
<11> ok
<11> thanks
<9> he sad GOOD TUTORIALS, not any (google)
<9> said
<5> NSGN: $Name = substr($currentline, str_pos("NAME:"));
<5> ***uming you are looping each line
<5> sets starting poitn at NAME, and goes to end of line
<5> $name = trim(substr($currentline, str_pos("NAME:")));
<5> similar for phone etc..
<5> but thats goign to be much slower than a regex
<4> hm
<5> sorry strpos
<5> not str_pos
<4> hm, i dont see how that could work, because not every line contains NAME:
<13> salut tlm
<4> only one in four or five
<5> right
<13> oups sorry
<5> you would do wrap in an if
<4> ah
<4> alright
<5> if(strpos("NAME:") > 0)
<5> its very bulky.....
<5> and not the efficiant way, but would work
<14> hmm, my php server can't create files with fopen
<15> RockBiter, strpos returns 0 if NAME: starts the line
<15> so try
<15> if(strpos() !== false)
<14> i do $handle = fopen('foo', 'w'); if(file_exists('foo')) echo 'it's there';
<14> but it's not
<5> pyp: your right, but it appears the file he is workign with is always the same, a generated report
<15> do it the right way
<5> yes
<4> rockbiter: dang, this combined with substr is working very fast and well
<15> combined with substr?
<15> just use strstr
<5> hey, look at that..
<5> thats why you should read the manual... trial/erro gets you to the end, but reading first would get you there faster an more efficiently
<4> pyp: there is a bunch of stupid spacing
<4> so i am using substr for a reason
<15> well SOOOOOOOOORYYYYYYYYYYYYY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<4> this log was not meant to be parsed :-P
<15> use preg_replace preg_match
<5> NSGN: i had the same problem and old DOS app used to run lprint reports i had to pars
<4> rockbiter: fun
<16> Why are people doing PHP and C++ speed-oriented? I mean, on php6 discussion, people say that dynamically loading the cl*** makes it slower.
<16> Considering that the php script executes in considerably less time than it takes to transmit the source over the net, I don't see the issue...
<17> not all do
<5> cause C++ guys are always saying PHP is slow
<5> its a nother way to knock PHP -
<18> tell them to come say it to my face
<5> i use PHP for all my cli stuff, i stopped with C.. i hate compiling ****
<16> Okay, C++ is faster than PHP.
<16> By... oh, gee, a whole milliseconed.
<5> for 99% of real applications, its not noticibly faster
<16> (Generating 10^5 random numbers, then writing them to a file.)


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #php
or
Go to some related logs:

#perl
#debian
#linux
#perl
sticking keys xorg.conf
#suse
tunap utility
suse j2ee_home
route add default gw hostname lookup failure
#perl



Home  |  disclaimer  |  contact  |  submit quotes