« first day (685 days earlier)      last day (4489 days later) » 

19:00
@tereško > NOTE: All data should be public static variables, to just be 'magically'
* accessible from anywhere.
definetly
Wow I will sue that guy for my patents on Super::$tatic. I knew there is some money to make with it!
I don't understand why people build crappy things for general purposes...
At least that C frameworks have speed...
Because their matters of general is just crapping around.
Build a framework, publish to github, tweet it, blog it ??? profit?
19:05
anyone got a line on a good place to score various icons for dev languages
like php, RoR, node html5 etc..
@gorelative English please...
i am trying to find sexsie icons curious if anyones got a source to get them
for development languages, like the php logo, or the ror logo etc.
I think you mean "of", not "for" ... understood.
I haven't seen them all on one place.
19:07
yeah looks like im going to have to piece them together
@Gordon it's a valid question. what's the problem?
Yeah, publish on github, tweet it, blog it...
first things first, download photoshop again
@cHao the setup is the problem. he's got a class with no methods. wtf?
1. Release PHP framework
2. ?
3. Profit
19:10
@DaveRandom nicely put :P
what's up?
someone frameworking again?
yup
yup
Phase PHP Framework
lnk?
eliw.wordpress.com/2012/08/31/… @NikiC give me @php.net so I can rape the docs, pretty please
19:13
@webarto How much does it suck?
On a scale of 1 to 10?
1 hour ago, by tereško
@Feeds another sad joke of a framework
> NOTE: I’ve already been called out for Treb not having tests. No, it doesn’t, I wouldn’t argue if it began acquiring them, but it doesn’t have tests written for it because it’s a child of a rapid-startup-culture web application. I plan on writing up another blog post about that soon.
let's check, it's not the fastest, and it stole @hakra SUPER::$tatic patent
@webarto sue it
sue it hard
Yeah, I will mail github so they take it down.
19:14
funk dat, let's take github down
It would be really nice to get a patent on some really bad design pattern :D
So you can sue everybody using it
logic^-1
=> no more bad software :D
I'm really pissed to see others build on top of my inventions wihtout even giving credits nor to negotiate about payments.
@NikiC How about the quadruple nested decorator?
(I have seen it)
19:15
@NikiC you are a smart not yet allowed to drink and drive guy
@DaveRandom That's bad?
@webarto But I'm close ;)
@NikiC It is when the thing being wrapped has no additional functionality or abstraction added at all
It's just some global static shitbaking, but now, read this:
@NikiC I was washing cars for living when I was your age :D
19:17
> It does however require PHP 5.3+, as it uses some advanced aspects of PHP, and will move to PHP 5.4 in the near future.
m'kay
LOLzOMG
Let me guess: Late Static Binding and the PHP 5.4 feature this is thirsty for is traits.
a winrar is you
Because the Model Layer can really profit from it or so. Or maybe the view with it's helperz.
is there a maybe_ functions in it?
so... lots of code for nothing?
19:22
@webarto I will suggest that guy to join wordpress development instead and help them out to move to static class functions.
github.com/EliW/treb/blob/master/framework/controller.php#L217 am I retarded or this could be solved by just fetching value based on key...
They have some "straight forward, just doing so PHP framework as well".
@hakra haha, my boss opened up WP today, and I haven't heard from him since... maybe he went somewhere to cry.
@webarto Two weeks ago I was even willing to held a talk about WP as somebody had asked for that. But that person didn't show up for the whole conference. I mean it can be fun, but if you don't take it lightly, it's just a one-way thingy.
C++ room fun:
in Lounge<C++>, Jul 20 at 0:31, by sehe
Prime user highlights:

 Moderators:

419: 419                  Kev ♦
105971: 105971            Anna Lear ♦
811: 811                  Shog9 ♦

 Known (In good standing):

944687: 944687            Desmond Hume
707111: 707111            minitech
119963: 119963            Jefromi

 Unknown (Interesting names):

1364309: 1364309          Ray Cheng
717341: 717341            Lukas Knuth
572059: 572059            Linus (NOTE: might move to next section)

 Known (assholes):

1414697: 1414697          jaffa           (I knew it!)
19:30
@Gordon so, the question might deserve a downvote. but close? hardly
@hakra WP can bring money for relatively little knowledge, and I hate that PHP == WP, makes us look bad... Why don't they make WP4 that is OO and sane...
Okay I now put the parameters and the builder into one class. I thought it's okay because it's pretty compact and related enough anyway. Also I didn't want to make the example too complicated:
1
A: Practicing Creating DB classes, need a little guidance

hakraIf I read your question right, you are looking for a so called Query-Builder. A query builder is a class that has some parameters and which can return the query based on the parameters. Actually this needs nothing more and nothing less if the example you have above is what you need. You only nee...

@webarto Well I would not even say that all this is bad and such and any project with some history has stories to tell. And OOP isn't the end of the flagpole. Those who think will loose a lot in programming.
@webarto github.com/EliW/treb/blob/master/framework/controller.php#L284 Apparently there's a superglobal that even PHP doesn't know about called $_EXTRA. Also it would seem that $_REQUEST is safe to use without sanitisation. Who knew?
@hakra Yes, of course, they probably know all that but can't change anything because of the audience that use it...
git: how to fetch/checkout/pull a branch out of forked repository of yours? (someone forked your repository and you want to fetch some branch of it)
git remote add coworker git://path/to/coworkers/repo.git
git fetch coworker
git checkout --track coworker/foo
19:47
@webarto Uhm, no, that is not the case. And you're right, WP is a good example for bad code ;)
Building a WP theme pays more than building a framework :D
But I'm just a hater, don't mind me... Is there a plugin for that?
@webarto Building a jQuery plugin pays the most, as I'm sure you are well aware
20:59
Anyone knows then name of the software to show stars in password fields in programs?
I forgot my MSN pass and I wanna see it from the remembered :D
Thanks
@Truth Also SnadBoy's Revelation rocks edit DL link broken, think I've got a mirror somewhere
Worked it out, thanks guys :D
NB: very old, never tried it on anything >XP and am on XP ATM so can't test it
21:18
Another quick question, anyone has a torrentleech invitation?
Hey people. For example, there are 3 people and each one has a random generated number. I would like to print out the names of those people from biggest to smallest number. Is there any different way instead of just using if clauses? It gets a little hard to maintain where it comes to more 'people'. For real i need it for printing out the benchmarking results. Thanks
@BikerJohn ksort()?
@DaveRandom thanks
21:36
sigh...
That was an X-Room sigh?
yup
XRS... Sorta like XSS, but with chat rooms instead of sighs...
$table = array();
if ($stmt->num_rows > 0) {
$i = 0;
while($table[$i] = mysqli_fetch_assoc($result))
$i++;

unset($table[$i]);
what will be the prepared statement equivalent of mysqli_fetch_assoc ?? will it be $stmt->use_result()
@ircmaxell what you sighing about?
@NikiC after reading @blackbee's post, I'm not sure...
21:40
oops
@ircmaxell I just managed to look at a line of C++ code and find three new syntax elements I didn't previously know in there ^^
yeah. C++ is a bunch of good ideas wrapped in a fubar implementation
like Drupal...
wait, you're in #php.pecl?
yep
the thing is like this, in the profile, the left hand side will show the post by the user and the number of comments associated with the post, if the user click clicks on the number of comments, it is going to show the comments.
what i am doing is if the user is in http://mysite.com/profile.php?user_id$userid; then the url for the no. of coments is http:/mysite.com/getcomment.php?commntid=$commentid.
so when thn user clicks, i want to return the comments rom getcomments.php using an array...
is there a better way to display the comments without redirecting to any other page
@blackbee php.net/manual/en/… does that help you?
21:51
@orourkek He's clearly using MySQLi...
oops yeah, read that one wrong/too quickly
thought he was converting from mysqli -> PDO
@orourkek well, i am using mysqli prepared statements :(
ok, i think i got the idea how to do it, or may be i am just overthinking........ but i will come back if i can't write the codes correctly
@hakra Is that the OP's nick or just a description of the question?
22:07
An interesting problem solving problem for people to try:
Given a triangle:

    1
   2 3
  4 5 6

Find the maximum total of all of the possible paths.

Ex: in this case, the max total is 10, 6 + 3 + 1...

Given a file input consisting of a format:
1
2 3
4 5 6

With 1000 rows (1000 levels), find the maximum total...
@DaveRandom I actually asked something like that myself ;)
@ircmaxell assume you mean paths going upwards/downwards?
I*
@ircmaxell Only some idea what a path is so hard to answer.
@ircmaxell Surely that's just $total = 0; foreach ($rows as $row) { $total += max($row); }? I must be missing something.
22:11
you don't need to provide the path, only the total
@DaveRandom no, consider this table:
1 can go to 1 only? So it's one path?
    1
  11 2
  5 2 6
the total is 17, not 18...
2 can go to 2, 3 can go to 3 and 3 can go to 2 that is the same as 2 can got to 3 so this is three paths?
Right OK.
But it'll still be either the left side or the right side, correct?
22:12
@hakra only one element on each level
@orourkek correct
@ircmaxell you mean one element on each line? And why are those numbers and not just dots?
@hakra the numbers are what you add... and yes, one element per level
add to what?
@hakra each other to get the value
so you are loking for the maximum total value of a path through all levels?
22:14
correct
ah but you want the pyramid, so one node has only two choices in the next level.
Is that a Project Euler question? I'm sure I've seen it somewhere before...
and not all on the next level
@hakra exactly
@DaveRandom no, I found it somewhere, but not there
is it okay to create all paths and then just take the one that has the largest result?
22:17
so when the pyramid is more than 3 2 rows, the path could not be straight?
I mean it would take some time but would solve it.
@orourkek When the pyramid is more than 2 rows the path could not be straight. The challenge is so find an intelligent method and not just brute-force it (which any idiot could, given enough CPU cycles)
actually this might be even necessary if you do not index all numbers first.
I remember a similar, but totally rudimentary problem from HS comp sci, that's why I ask
@DaveRandom thanks for calling me an idiot, and there is nothing wrong in actually having CPU power :)
22:20
@DaveRandom brute forcing a 1000 level will take literally decades in PHP
also you can just let run the bruteforce while thinking about a different approach
because there are 2^1000 possible combinations
@hakra /** @see: bitcoin */
i wrote a problem like this using C ( i mean we had to) when we studied trees n graph theory, but its not exactly the same as the problem being discussed
@orourkek for example but it is worth less and less the work :/
22:21
there's a really simple and elegent solution that runs in O(n) time...
meouw
@ircmaxell you mean constructing a tree at each "decision" point? (1 row shorter each time)
I say nothing further
bleh, I can visualize it but I don't have the time to code it :P
22:25
please draw a picture. i still have no clue to easily formulate
I only see the first point which has only two decisions.
@hakra But you are an idiot, if you haven't realised that by now you must be an idi... oh, right. :-P
@hakra each of those 2 decisions has 2 decisions below it
there's definitely two ways to do it, but i dunno which would be faster without coding it
you could go bottom-up, if you had the stones for it
there's more than 2...
I meant two efficient ways that I could think of
22:28
there's an O(n) where each element would be visited at most twice...
@ircmaxell you can reduce per line. one path wins there. in the end it is either left or right. so maximum of two times. you can ignore the first line as it is invariant
solution or GTFO
@ircmaxell are the numbers unique?
says the boy in NY. my alcohol level is actually much too high to code anything.
@ircmaxell well that tipped me towards one of the approaches :] now I have to code it...
22:31
@NikiC no
hi @NikiC
@hakra me too...
@hakra I'm on that train. I'm not even going to try and think about it at the moment, it will not end well for my brain.
        1
       / \
    2     3
   /\     /\
  4 5   5    6
o sorry, i am wrong
you only need the sum, right?
22:34
wait,
we can carrange it as
1
2 3
4 5 6
and then start from the bottom row and compare each adjancent pairs . Take the bigger one and add it to the number above the pair
you can solve this iterative and you do not even need to bruteforce.
@hakra hi @hakra :)
@NikiC: We need an AST parser in PHP.
Actually I need one, but that's another story ;)
Sure we do
The interest part is why you need it?
-1
Q: Having big broblem with Jquery "if" statement (not check the conditions and send data)

irplayboyI have a big problem with jquery if condition: I have a div and if user click on it, calling ajax and user put a data and submit form. I check the input with jQuery and if it was OK send to another ajax form. for the first time it work and if check the conditions but for the second time if user c...

jQuery if statement ):
22:37
@NikiC I have a descendant recursive parser implemented but I now need a datastructure it should create.
@ircmaxell will this work
we can carrange it as
1
2 3
4 5 6
and then start from the bottom row and compare each adjancent pairs . Take the bigger one and add it to the number above the pair
I say nothing
@hakra A descendant recursive parser for what?
@NikiC for grammar of CSS selector syntax.
22:38
oh wait
I think now I understand what you mean
Or not
You mean something like a built-in parser generator?
Question: I thought when you included a file ( include('config.php'); ) it would also include the variable values throughout the scope of the entire process. I found out that my configuration values from config.php weren't transfered when I tried to call on variables on a different script. Is there a way to pass variable values from one file to another, so a configuration file is possible?
it's about converting CSS selector into XPATH in the end, in between there should be some AST. Parser works, but just does not output any data-structure. But it would be useful to further on process ;)
still now quite getting the issue :D
I mean, what's the problem with creating the AST?
@Alec they are transfered, include is scope aware.
@NikiC That is my question. What is an AST, how to create it. I got the parser (with expect() and accept()) but how to turn that into AST?
@hakra An AST is a node tree. Each parsing method constructs a new (larger) node tree out of node trees constructed by other parsing methods
22:43
@NikiC So if I make use of the visitor pattern within accept() and expect() I might be able to construct it if I keep the AST as the structure in a parallel context. So I exploit static state to create the data-structure.
Maybe I just need some good examples how to create an AST to wrap my head around it.
Also I have the feeling that using an S-Expression is good enough for the node tree.
github.com/hakre/XDOM/blob/master/src/XDOM/CssParser.php => In there you would basically replace the return trues with return $partOfAst
Though it's obviously a bit more complicated than that
Because you often don't know which of the possibilities will be used
@NikiC I can only return true or false so far for these. That is how parsing works. However, I could return FALSE and TRUE would be the partial AST. Good idea.
not sure what you mean
@ircmaxell codepad.org/q6bbCdIA Anything like the right answer? Seems to work, not sure though as have not thoroughly tested it. Assumes tree is a 0-indexed array of 0-indexed arrays with the top of the tree as the first element. PS Yeh, I got sucked in
@NikiC I can return the partial AST on TRUE, and FALSE will still be FALSE
22:48
@ircmaxell are you asking or this is a test??
@ircmaxell codepad.viper-7.com/93NYxC (essentially)
however this will consume some memory.
@hakra yes, that's what I mean
@hakra And do some useless work
@blackbee It's a test
basically, both @orourkek and @DaveRandom got the algorithms...
although @DaveRandom's is simpler...
lol
well I wasn't going for simplicity
more of clarity of code
2
22:51
Yeh my code is a little unreadable
it's understandable if you know what you're reading
@NikiC The work is not useless. The work needs to be done, it is parsing. And if the data-structure for the bare AST is not that expensive, the memory overhead should not be that high.
...and with that minor triumph, I'm going to get too drunk to be able to type. Night all.
@hakra Oh I found my issue. It was how I was trying to use the value in a function. Apparently that doesn't work. I got it working a different way.
@hakra I mean that the construction of the AST is useless if it is discarded later on again ;)
22:56
@ircmaxell So if it was a test, what was it a test for? Entry into a codegolf competition of the same problem?
@NikiC yeah, but only if it is not necessary to build it in the first place (which it is).
That would actually be a fairly easy one to do in assembly
@ircmaxell I'm I missing something?

$left = $right = $rows[0][0];
for($i=1; $i<count($rows); $i++) {
    $left += $rows[$i][0];
    $right += end($rows[$i]);
}

$side = ($left > $right) ? $left . '(left)'  : $right . '(right)';
@hakra I'm not sure we are talking about the same thing ^^
22:58
@Keyne yes, the lines aren't always straight down the sides
@orourkek hmm... okay :P
can some mod help me out here to explain to a new one how "single link answer" is bad stackoverflow.com/a/12223272/245552
wooo its 4, later everyone :] thanks for the brain teaser @ircmaxell
@NikiC While parsing, you do not know up to a certain point if or if not the current stack is the right one. So it is yet both TRUE and FALSE. Therefore, for TRUE, the AST strucutre need to be build until it's known that it is FALSE. So it is necessary to build it.
The only way around it I see is to first parse and then if you know there is a result, parse again but this time with AST building.
23:00
I don't think that's true
Let me think for a bit
You don't have to build the AST
you can build it as soon as you know it matches
If you use a generated LALR parser that's how it is done
It will only reduce when it knows that something matches, so the semantic action building the AST will only be called then
But I'm not sure whether doing this is feasible in a hand-implemented parser
@NikiC It should be I'd say.
Or is a generated parser building all paths so it can execute each one with a single invoke? Then it would be as I wrote above. First parse and if successfull, parse again with creating the AST.
I think the parser I have currently is something of the Left whatever camp.
okay, LARL parser have some shortcoming here to which they exploit the path. My hand implemented parser has all paths so is truly unoptimized lookahead so does not have that shortcoming of the LARL parser.
However this means that I can not do that easily segmented look-aheads.
@hakra No, at least LALR does not. But it builds a proper state machine, so it can delay running the reduction methods until it knows something will match (or all won't)
why isn't there matches for while chat.stackoverflow.com/…
But that obviously assumes that the grammar is limited ;)
So you can't build everything with it
@NikiC a LARL parser can not deal with all rules in a left hand notation. Some create errors because of the optimization.
23:10
Not sure what you mean
But yes, LALR isn't well with right hand side recursion
Performs suboptimally in that case
No idea what that is
Though most things can be specified with left-recursion
But I was referring to this:
> In a LR(1) parser the state sequence is correctly resolved to A3, because the lookahead information has been preserved through the detailed rule system. In a LALR parser the state sequence cannot be resolved because the parser encounters a duplicate rule, which is an error. The above grammar will be declared ambiguous by a LALR parser generator.
I like the point 9 of Advantages.
@hakra :D Well, it really is a lot simpler :)
But yes, sure, LALR can't do anything. And for some complex syntax you may need to use an uglier grammar to avoid conflicts
But for the vast majority it works well
E.g. PHP uses a LALR(1) parser ;) And PHP has lots of ugly syntax. And doesn't build an AST, which makes things a lot worse from a conflicts-pov ;)
@NikiC Why hasn't been the engine ported to the LLVM framework anyway??? :)
23:17
:P
$tree = array(
array(1),
array(2,3),
array(5, 4, 6),
);
$k=count($table)-2;
for($i=$k;$i>=0;$i--)
{
foreach($table[$i] as $j =>$maxval)
$maxval=$maxval+max($table[$i][$j],$table[$j+1]);
}
echo $maxval;

i wrote it.... although i am a very fast coder
It hasn't even moved to C++ yet
Okay, if it is simpler (great!) I'm still somewhat puzzled about creating the AST for this little thingy.
@blackbee fixed font
compared two adjancent value from the bottom.......
23:19
30 mins ago, by DaveRandom
@ircmaxell http://codepad.org/q6bbCdIA Anything like the right answer? Seems to work, not sure though as have not thoroughly tested it. Assumes tree is a 0-indexed array of 0-indexed arrays with the top of the tree as the first element. PS Yeh, I got sucked in
@hakra, o mg....... but u see, i wrote the theory behind my code before it was solved.......
58 mins ago, by hakra
@ircmaxell you can reduce per line. one path wins there. in the end it is either left or right. so maximum of two times. you can ignore the first line as it is invariant
if i write
$t=array(array());
$t[0][0]=$cmntid;
$t[0][1]=$comment;
$t[1][0]=$cmntid2;
$t[1][1]=$comment2;
then what will be the return statement to return the 2d array
return $t?
xD i am not taking a test.... , i'll try that..
well, i cudnot solve it, i need to display only the comments for a post, for which he opts out
for example, if there are the posts
A says hi
     3 comments
A says hello
     2 comments
A says bye
     1 comment
now if the user clicks on 2 comments,  it will display
A says hi
    3 comments
A says hello
 b says hey
 c says long time
A says bye
   1 comment
i need an idea............to solve this
sad indeed
@webarto oh a webserver. how cool. haven't seen one lately.

« first day (685 days earlier)      last day (4489 days later) »