IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1982.49 MB
Powered by
Channel Info
Network: freenodeChannel: #php |
Search in www.irclog.org
Log from #php at freenode 2006-06-17
Pages: 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
31
32
Next >
[00:00]<irdevxjs>xshad, thanks.
[00:01]<wsxrm>hope it works ;)
[00:03]<jdddd>http://static.flickr.com/48/168468822_dc3b8e2bc9.jpg
[00:12]<nfuyfy2zyud>hiya
[00:13]<apzjtuzp>is there a function that will check for a negative number
[00:13]<zdzxzzmfdgzx>AfroTurf: if ($x < 0) { echo "you're so negative."; }
[00:13]<cyffnzslrd>if ($foo < 0) ?
[00:13]<apzjtuzp>lol k
[00:14]<apzjtuzp>don't know why i couldn't think of that
[00:14]<wsxrm>maybe your brain is out for vacation
[00:14]<cyffnzslrd>:D
[00:14]<cyffnzslrd>I have a Q...
[00:14]<apzjtuzp>maybe
[00:14]<apzjtuzp>:)
[00:15]<cyffnzslrd>I want to validate the nesting of bbcode
[00:15]<wsxrm>wth... gmail's spam filter is broken O.o
[00:15]<cyffnzslrd>and then if some of the nesting is messed up, display the section where it is
[00:16]<tjufgg>killerspam: okay great
[00:16]<tjufgg>though that was more of a statement than a question
[00:16]<cyffnzslrd>yeah, sorry
[00:16]<zdzxzzmfdgzx>killerspam: You essentially want to write a parser in PHP... At a minimalist point of view, http://php.net/strtok and substr are all you need. PHP may have more fancy functions, and I think I saw that some kind of parser was slated for PHP 6...
[00:16]<cyffnzslrd>watching big brother :D
[00:17]<cyffnzslrd>basically, any general ideas how to do it?
[00:17]<cyffnzslrd>im thinking building 2 arrays, one in reverse, of all the tags
[00:17]<tjufgg>or you could just use a stack
[00:17]<tjufgg>and push/pop each set of matching tags
[00:18]<cyffnzslrd>could you explain that a little?
[00:18]<zdzxzzmfdgzx>You will definitely want a stack: <b>text<i>blah<b>foo</b>more</i>and more</b> is syntactically valid, if goofy.
[00:18]<cyffnzslrd>not familiar with stacks, since doing it a few years ago in school
[00:18]<cyffnzslrd>yeah richardlynch thats what I was thinking
[00:18]<tjufgg>a stack is a lifo list
[00:19]<cyffnzslrd>with you so far :D
[00:19]<tjufgg>[b]..[i]..[u]..[/u]..[/i]..[/b] <-- example string
[00:19]<cyffnzslrd>sure
[00:19]<tjufgg>so you just procede through the string and you end up with a stack like [b, i, u]
[00:19]<tjufgg>and then when you reach the /u you pop off the u
[00:20]<tjufgg>and you are left with [b, i]
[00:20]<tjufgg>and just keep doing that until you get to the end.
[00:20]<cyffnzslrd>and the error detection comes where?
[00:20]<cyffnzslrd>im just running through my head here..
[00:20]<tjufgg>If you get a closing tag that doesn't match the top of the stack then you don't have proper nesting
[00:20]<cyffnzslrd>ah yes
[00:20]<cyffnzslrd>makes simple sense
[00:21]<cyffnzslrd>i'll want to store the positions in the string of each tag too
[00:21]<cyffnzslrd>so I can report an error of where it was
[00:21]<tjufgg>That's completely up to you.
[00:21]<cyffnzslrd>so can this stack be 2d?
[00:21]<tjufgg>I'm just giving the conceptual view. The actual implementation details is an exercise left for the reader.
[00:22]<cyffnzslrd>yeah i get it now, mental block a bit i think
[00:23]<cyffnzslrd>much appreciated
[00:24]<rgg-q>hi
[00:24]<zywvx>$tagArray = $this->db->multipleRows($this->db->prepareSql($sql)); << why on earth would that throw "Array to string conversion"? The $this->db method returns an array, and I am not using type casting, so why would I get that error?
[00:24]<rgg-q>how to do a query to find out the biggest number in a filed? like this: "SELECT id FROM admins WHERE id is_the_biggest"?
[00:24]<zywvx>Hi, gen-2
[00:24]<wsxrm>gen-2 #sql
[00:24]<zywvx>gen-2, SELECT id FROM admins ORDER BY id DESC LIMIT 1
[00:25]<rgg-q>rixth: okay thats easy what means DESC LIMIT 1?
[00:25]<wsxrm>!tell gen-2 about g8
[00:25]<zywvx>xshad, leave him alone =(
[00:25]<zywvx>ORDER BY id DESC means sort by the id descending, LIMIT 1 means get one row (which will be the highest id number)
[00:26]<wsxrm>I'm doing it
[00:26]<rgg-q>okay thanks
[00:26]<rgg-q>cya
[00:26]<tjufgg>rixth: um what exactly is throwing that error?
[00:26]<tjufgg>php doesn't complain about array to string conversions.
[00:26]<zdzxzzmfdgzx>gen-2: select max(id) from admins
[00:26]<tjufgg>It just converts an array to "Array"
[00:26]<zywvx>Touqen, I use E_STRICT
[00:27]<tjufgg>oh
[00:27]<tjufgg>s/slightly/very/
[00:28]<tjufgg>what data types does prepareSql return?
[00:28]<zdzxzzmfdgzx>rixth: Tear apart the 10 operations into separate lines, so you can figure out what is going on.
[00:28]<zywvx>Touqen, an integer
[00:28]<zdzxzzmfdgzx>$db = $this->db; would be your first line.
[00:28]<zywvx>richardlynch, alright
[00:28]<zdzxzzmfdgzx>And use var_dump() on whatever seems "wrong"
[00:29]<tjufgg>what does multipleRows take as a parameter?
[00:30]<zywvx>Ah, I'm in idiot. It said the error was in videoCategories.php, and I was looking in another file.
[00:30]<zywvx>multipleRows take an integer
[00:30]<tjufgg>nevermind
[00:30]<tjufgg>no need to explain if you already figured it out
[00:32]<wsxrm>Wolfpaws *poke*
[00:32]<ceredtuw>does anyone here have some good php 5 oop examples I can take a look at?
[00:32]<wsxrm>CrazyTux g1.tigris.org ;)
[00:33]<vzyvjg>why does echo 20060616143048+3; print out 2.00606161431E+13 instead of the number?
[00:34]<vzyvjg>it kind of messes up my timestamp function
[00:34]<dj_slyg>what is that, date time?
[00:34]<dj_slyg>heh, yeah
[00:34]<wsxrm>Triton php isn't good with numbers, you'd use math ext
[00:34]<drvvdaa>Triton: I get the number.
[00:35]<wsxrm>and... wtf with this huge number ? :)
[00:35]<vzyvjg>its a timestamp, june 16 2006
[00:36]<dj_slyg>2:30 and 48 secs
[00:36]<dj_slyg>;p
[00:36]<wsxrm>isn't a timestamp
[00:36]<vzyvjg>ok... is there a setting to not do the scientific notation for simple math
[00:36]<dj_slyg>i also get the full number
[00:36]<wsxrm>I got the number too
[00:37]<ceredtuw>Triton, sum ?







