« first day (1124 days earlier)      last day (3831 days later) » 

12:00 AM
It's cool, I found previous one after 4-5 days I left previous-previous.
 
user652649
i can ask around even for remote, but it will be tough
 
user652649
i know that already
 
user652649
@webarto lol, risky
 
user652649
do you by chance talk italian? that would help a lot. i don't want to deceive you but i can try
 
Went to course, 2 out of 6 semesters :) I appreciate your help, but you don't really have to pull your string or bother 'cause of me :)
 
user652649
12:12 AM
no prob, i'm starting to look for a new job too and i'm taking a look around anyway
 
user652649
i'll let you know if i have something though
 
:+1:
I would love to live in Italy at some point, btw.
Senza cuore saremmo solo macchine, that's all I know :D
 
user652649
ahah
 
Tutti motori turbo, yay!
 
user652649
lol :P
 
12:52 AM
@Gordon Well, I meant more from a room-owner perspective, not a mod perspective
 
@JoeWatkins Were you talking about D earlier?
It seems to balance power and simplicity quite wonderfully.
Why the hell isn't it more popular? Support?
 
What's D?
 
Oh :)
 
@webarto, that glitchr_ tweet is derping my screen.
lol
 
1:03 AM
Can you take a screenshot? :)
It just overflows?
 
Yea, it's actually smoothly scrolling slightly to the right every time a message is posted
 
I̶̧̺̱̥̥͗̀ ̟̩̊̊͑̂̾J̣̙̜̮̖͕͕̅̅ͩ́͢U̩͎̜͙̰̼͂̈́ͪͧ̋S̸̤̭̣͇̤ͯ̑̐̊̄͗T̶̞̦ͩ̔ͫ̿͋ ̵̷͓̦̟͙̜̓̾͑ͥ̍S͙̣̮̘̞̲͚̙̭ͤͦ̆ͭ͐͂͂͝Ẹ̴̘̺̩͉̹͒ͨ̔ͭ͌͐̊́ͅȨ̩̹̠͕͙͓̄̾͋̐̓̍̒͗̋ ̟͇̝̹̯ͩ̈́̈̏̊͒́A̴̛͖̙̐̉͋̓̂̿̓̌͛ ̢̱̙͍̤ͪ̔ͫ͌͊͒V̷̹̻̬̻͚̯̱͖̈͛̊̇͂ͪ͌-̶̎͟͏͕̖L̦̬̟̯̊̃̒͜Ḭ͖̗͖̹͋̂ͧͣN̯̠̰͆ͥͯͩ̓ͣE̷ͦ͋͘͏̭̠̺̼͚̤
Mac?
 
Nah, Windows. I'm on a different monitor; it's only 1152x854
It's the one ^ up there ^, because it runs off the page.
 
Is there ever a good reason to use goto?
 
YES
Nov 1 at 12:16, by webarto
user image
:)
I'd say it depends, 99% there isn't.
 
1:09 AM
@crypticツ When writing a parser, it can be handy; jumping between states.
 
ok so, I have a CLI PHP script which prompts the user for an option from whatever list at whatever step. using $option = fgets(STDIN); well if they enter in an invalid option not on the list I want it to output error message and repeat the step again for them to choose by displaying list again. Would goto be the best way to do it?
 
I thought that would be situation...
 
user652649
@crypticツ i consider goto an easter egg
 
@crypticツ Sounds like the input/output behavior should be a loop that delegates to the input handler and output builder; if it's invalid, it would delegate accordingly.\
 
1:13 AM
Artax is sick... @rdlowrey (bro where are thou?)
 
@DanLugg I don't know what that means >.<
here let me show you an example in a few minutes of what I am doing
 
Okie doke.
 
Blocking.
 
How to test Authentication with sms code but with out sending sms ? :^ ) Where i can send message?
 
@DanLugg viper-7.com/kPbpjb something like that. I tested and it works exactly as I expected, but it is a good way to do it? I don't need anything super complex =oP
 
1:24 AM
@crypticツ I figure while (true) with break (or if wrapped in a function perhaps return) should be sufficient.
Hold on, was writing an example in 3v4l but need RDP.
 
@Wes why is that?
 
user652649
File:Carl Oswald Rostosky - Zwei Kaninchen und ein Igel 1861.jpg|250px|thumb|right|When viewed on the Wikipedia website, this picture reveals a hidden "Easter egg" if the user clicks on or hovers their mouse pointer over the hedgehog. rect 271 383 680 434 [http://upload.wikimedia.org/wikipedia/commons/5/54/Bg-easter-eggs.jpg You're not going to believe this, but I'm sitting on an enormous basket of eggs.] desc none An Easter egg is an intentional inside joke, hidden message, or feature in a work such as a computer program, movie, book, or crossword. According to game designer Warren Ro...
 
This is how I typically structure CLI scripts at a minimum: 3v4l.org/kpSpq
I wrote a nice lib to handle most of this, so I could manage handlers and ANSI colors, etc; I'd just create an instance of CliApplication and inject handlers; it could even hot-load them. I dunno what I did with it ....
 
user652649
@crypticツ never found an easter egg in any software whatsoever?
 
@Wes I have, but why do you refer goto as an easter egg? It's a documented feature.
 
1:34 AM
$resource = fopen('php://stdin', 'r');
function stdin($resource)
{
  return trim(fgets($resource), PHP_EOL);
}

do
{
  $o = (int) stdin($resource);
  if ($condition = $o < 1 || $o > 3 )
  {
    echo "\033[1;37;41m Error: invalid option\033[0m\n\n";
  }
} while($condition);
Sucks, but... @crypticツ
 
@webarto That's pretty much the same as mine, just a lot less code ;-)
 
@webarto but won't I need for repeat a lot of code if I am doing the loop method though if say I have like 8 steps and each one will accept input, validate, and then do a task or proceed to another step?
 
@crypticツ The symfony console component is meant to be reasonably good for making command line tools: github.com/symfony/Console . Composer uses it as it's command line parser.
 
@DanLugg Sorry, didn't see :)
 
Well, different, but same principle
 
user652649
1:36 AM
@crypticツ of course it isn't hidden but i'm sure who decided to put goto in php also enjoyed the funny part of it being nonconformist, since goto is considered to be "evil"
 
@Danack oh, didn't know about that. Already using Symfony components in the app so will check it out.
 
user652649
i guess it may result to be useful sometimes but not often
 
@Wes While I'm sure fun was had, it's a pretty fundamental language construct. I'm glad they put it in, if not just for completeness.
 
It may seem like overkill using something that heavy-weight for command line apps, but it's so nice to be able to use a consistent framework.
 
user652649
but seriously even with micro optimizations does it make difference in performances?
 
1:40 AM
@Danack Exactly; just like any application that can grow unwieldy.
 
user652649
ie a function is really that heavier than goto?
 
It's not about performance, it's about breaking the flow.
"unless you're facebook"
If you know what you're doing, goto is fine.
 
user652649
well you can manipulate the flow even with functions, no?
 
not exactly, function is called, but execution continues, goto moves "pointer".
I think you mean recursion.
 
user652649
yeah
 
user652649
1:48 AM
i mean return somefunc() flow is readdressed as in goto
 
user652649
also with functions you have the advantage of garbage collection instead of unsetting things yourself
 
user652649
i'm not pretending to know anything about programming tho, i am wrong?
 
user652649
not saying it's totally useless, i used it many times like a switch() kinda
 
It has a use, but you'll most probably never encounter a need for it.
It's implemented in PHP because of facebook I think.
 
user652649
so the introduction of goto in php has nothing to do with performances? i thought that was the reason
 
1:59 AM
> I think there are only two cases where goto is really interesting: a) Error handling. b) Auto-generating code or compiler compilers
You don't need goto in MVC thingy apps.
 
user652649
i'm starting too see its purpose, in fact i often use switch for error handling, i think it's close
 
user652649
The structured program theorem, also called Böhm-Jacopini theorem, is a result in programming language theory. It states that a given class of algorithms can compute any computable function if those algorithms combine subprograms in only three specific ways. In other words, any algorithm can be expressed using only three control structures. They are #Executing one subprogram, and then another subprogram (sequence) #Executing one of two subprograms according to the value of a boolean expression (selection) #Executing a subprogram until a boolean expression is true (iteration) Note that the...
 
user652649
TIL ^
 
Yes, we're born late :)
webarto, Vienna, Austria
10.2k 2 20 44
 
user652649
2:16 AM
@webarto ^ HIRE HIM
 
user652649
xD
 
Haha NO
FORGOT TO DELETE; DAMN
 
user652649
@webarto ahah ye ye, sure xD
 
2:41 AM
Is it possible to chroot PhpStorm? Say I have a folder /myfolder/servername/usr/local/.... which matches up to /usr/local/... on remote server. Is there a way to have PhpStorm treat the filespaths where / is read as /myfolder/servername/ ?
1 message moved to Trash can
It won't clutter up chat with large blocks of code, allows syntax highlighting so easier to read your code and help you.
 
Sorry, here it is: 3v4l.org/53dUH
(there's any better site for pasting code?)
 
You could always pastebin stuff, but 3v4l is pretty solid.
 
sweet, adding to favorites
@DanLugg, this is the 'almost' final code you help me build ;) I just have to add the other products besides domains now
 
user652649
@crypticツ really took this job at the php room seriously
 
user652649
reign of terror is over
 
user652649
2:48 AM
 
as I know very little of php I wonder if it's secure
 
@crypticツ Link it? ln --help
 
I don't know about SQL injection; you don't have any SQL in that snippet, but you're using a number of "features" you're probably better off without: such as global.
Mixing output with processing logic (as in dumping HTML in that code)
 
@webarto but won't that overwrite my current /usr/local directory?
 
Yes, have no idea then...
Maybe, ENV, dunno.
Why don't you play with chdir?
 
2:52 AM
@LucasB also don't do assignments within your expressions.
 
In bootstrap file in root folder run chdir with path depending on server.
 
@webarto that's what I am doing right now, it's just hacking to have to make an exception for local server. I even started to use relative paths, but those get messy real quick.
 
That won't work well e.g. for shebangs, not sure what's your use case, but can't think of elegant solution, ideally, you'd have similar setup.
 
Thanks @crypticツ and @DanLugg, I'll look into it
 
@crypticツ "Is there a way to have PhpStorm treat the filespaths where..." What do you want to do that for? Be able to find css/JS files? Have it run as a webserver?
 
2:57 AM
@Danack basically say if I tried to load a file with the path /usr/local/somefile it will load /myfolder/servername/usr/local/somefile
 
define, load a file
 
including for instance, running a file, opening a file, etc
I know for include I can set the include path
 
Is there a PHP script that will return the status (offline/online) of a TwitchTV stream? Or a script of the sort and display text accordingly?
 
@crypticツ I either set a PATH_TO_ROOT and then include(PATH_TO_ROOT."/some/otherfile.php")in my front controller script or you can do `include(realpath(__ DIR__).'/testFile.txt'));
 
evening all
 
3:01 AM
@MatthewH That seems like a question more appropriate for, say, Google...
@JoeWatkins howdy
 
Oi @JoeWatkins.
 
@cspray I have looked. Maybe I wasn't searching the right thing. I guess I'll search again
 
@JoeWatkins Re-ping!!
2 hours ago, by Dan Lugg
@JoeWatkins Were you talking about D earlier?
 
@MatthewH Unless they have an api, not really. Twitch TV is all delivered through Flash so PHP's going to have a really difficult time inspecting it.
 
@Danack Hm..let me check about the apis
 
3:02 AM
I dunno, can't remember earlier ... might have been ... I think @SweetieBelle is into it at the moment, it does look rather cool
 
@Danack but what if working script is in some subfolder so`__DIR__ is lower in tree than the file being accessed. I would have to do ../ reason trying to find a way I can access by absolute path starting from root.
 
Ah, maybe; I just recall a discussion about writing something in D, perhaps it was you. Piqued my curiosity anyway, now I'll all butt-hurt as to why it's not more ubiquitous (or at least it doesn't seem it is)
Actually, I'm more peeved that I wasted my extra long weekend not learning it.
 
There is an API. I believe I found the script to use. I don't know why it didn't show before.
Now I need to figure out how to implement it into my HTML.
 
Neato, D has pretty interesting web/HTTP-framework support in the community.
 
is one of those things I intend to get some books about ..
there are many such things ...
 
3:19 AM
Hm, do you think one of you could help me do this? I'm not extremely good with PHP.
 
@crypticツ If I have scripts in sub-folders, then I tend to either just define define('PATH_TO_ROOT', '../../'); in those scripts or make a path.php in each directory, that contains just the path to root if I think I'm going to be copying files around a lot.
 
Review please: webarto.com
 
@webarto Contact page borken - webarto.com/contact
 
Yeah, forgot to remove it. Contact is in footer :)
 
Good Morning All
 
3:23 AM
Morning?
 
MRONING!!1!
 
@MatthewH good morning
 
@webarto It's night for me haha
 
Yes, and that's irrelevant here :)
 
3:25 AM
@DanLugg I see what you did there ;)
 
Indeed you did ;-)
 
Okay. So can I type up my question with the expectation you guys will attempt to help me or would I just be wasting my time? Just checking
 
And on that note, good night folks. I may disappear into the world of D for awhile.
 
@webarto Here be my résumé. is the pirate talk intended?
 
Yup, removed that link too.
 
3:29 AM
In 2012 I happily accepted job offer from Site5 web hosting company. *a job offer
 
@crypticツ Thanks
 
@webarto 2008 – 2010 (abandoned), I dunno if "abandoned" is the best term to use here.
 
other was a dropout :D
 
Indeterminate hiatus?
 
3:30 AM
@DanLugg *2008 – 2010 (no fucks given), *
 
@Danack Well I'm asking because I always fear of people judging my site in a bad way and I wish to only go into detail and ask my question if I am not wasting my time. You know?
 
lol
 
@webarto ...websites and/or applications, from smallest ones to big ones. from smallest one to big ones is not correct wording.
 
Also, kidding about "indeterminate hiatus", but something a bit softer than "abandoned"
Even just "hiatus", although that does imply you intend to complete it.
 
how about from small to large scale websites and/or applications @webarto
 
3:33 AM
Will do, I suck at writing in general, it's not just English.
 
Buggy or stable, dispatched or called, an app is an app no matter how small.
^^ I'd hire you if you had that.
Anyway, I'm gone for realsies, night.
 
@webarto This is just my opinion Most of all I enjoy travelling with my wife Raska and Terry the JRT. I think you should actually spell out jack russell terrier. You don't want people to have to pause to think about what that means if they don't know it.
 
I appreciate your comments, thanks.
 
Screw it. I'll ask. Hold on let me type it out
How do you do multi-line code?
 
3:48 AM
echo $var; // press enter key
echo $var2;
if that's not what you are asking, then elaborate on multi-line
 
Shift + Enter, and then Shift + K to <pre> it.
 
oh multi-line code in chat
 
Yeah. I can't seem to get it.
Hm..oh well...
Here's my question.
By the way. I do have a ClientID, I just removed it for the question.
 
@MatthewH See github.com/PHP-Chat/cv-pls.com/blob/master/… it's the easiest and recommended way to share code to those in the chatroom.
 
@crypticツ Can't remove the message. But I'll post now.
Nevermind. It won't work right. But there's the pastie for it
 
4:02 AM
pastie.org/8476488 syntax highlighted
2 messages moved to Trash can
 
@crypticツ Thank you! :D Can you help me out though?
 
@MatthewH about to go to bed, but will check out the code and see.
 
@crypticツ Shall I post the HTML too that I'm using? In a pastie
Here's that pastie pastie.org/8476496
 
@MatthewH ok read the first pastie, but what is the question regarding it?
 
How I could implement it with the HTML in the second pastie. But also being able to use the same code multiple times with multiple channels.
Get it?
 
4:07 AM
@MatthewH just use include()/require()
you would include that PHP code into the template that is used across the site, as long as the $_GET['ColdfireTube'] variable is set it will correctly process the image for that channel.
Just make sure you put some additional checks to ensure the code does not break if the query is not provided.
 
Hm...okay. Thank you. I'll give it a shot! I might mess up though. Haha. I suck at PHP
 
@MatthewH have you read the manual? Includes are one of the first things to learn and are very important.
 
@crypticツ Yes and no. The only problem I have with is where I put the includes. Where I put the PHP code and how I call on it. You know?
 
@crypticツ Will do. Thank you :)
 
4:48 AM
Hi There.. I am a Classic ASP Programmer and want to know few things about PHP
I have created a login script in Classic ASP way back which cannot be decrypted by hacker.. easily. I used VB (.DLL code) to generate a unique code that is used for login to the site and that DLL is registered on server
So if someone gets access to FTP or DB they wont be able to break it ..
So is there anything in PHP that can be done similarly ?
So if someone gets access to PHP or MYSQL DB
they wouldnt be able to login to the site
 
5:18 AM
@crypticツ
Hi There.. I am a Classic ASP Programmer and want to know few things about PHP
I have created a login script in Classic ASP way back which cannot be decrypted by hacker.. easily. I used VB (.DLL code) to generate a unique code that is used for login to the site and that DLL is registered on server
So if someone gets access to FTP or DB they wont be able to break it ..
So is there anything in PHP that can be done similarly ?
So if someone gets access to PHP or MYSQL DB
they wouldnt be able to login to the site
 
user895378
5:47 AM
@webarto and @NikiC and others ... Sorry for my extended absences recently. It's kind of explained over in the dartlang room starting with this message:
 
user895378
in Dart Lang, 11 mins ago, by rdlowrey
Hey guys sorry I'm not around much lately. I've actually been co-producing a pilot for a documentary series following amateur MMA fighters (seriously).
 
cool
 
user895378
Here's a really rough early trailer if you wanna see why I've been derelict in my programming duties lately ... It's going we'll and we've been in talks with a couple of networks already:
 
user895378
 
user895378
Not really the kind of show I'd watch, but cable networks love this kind of thing right now.
 
6:05 AM
do anybody know how can we access database in config.php for defining varibale as global in codeigniter??
 
6:31 AM
@webarto I wouldn't have binned that^^
 
6:43 AM
morning @bwoebi
hi @rdlowrey nice to see u around :)
 
@ircmaxell from a room owner perspective I find it disappointing that we have all these rules all of a sudden. It worked out fine without for years simply through common sense, etiquette and communication. And now there is this chatroom pact thing nonsense. So I guess it figures that there is new rules to add to to that now, but I don't think any of that is necessary at all.
 
@Gordon huh.. I think no rules could help is someone have no sense of etiquette and polite communication
so may be you're right - and such rules are near pointless: they will not help if someone can't communicate well and they are not necessary for those who can
 
7:03 AM
Morning.
I'd recommend rewriting this code because it has several problems: 1. Deprecated database API is used. 2. Three layers (presentation logic, data access logic and business logic) are mixed up. 3. HTML is inlined in php code that makes graphical changes PITA. — Leri 1 min ago
I hope it does not sound rude, does it? ^^
 
also, somewhat pointless
 
crap
hi, @Leri
 
Hi.
 
this is a shame
and answers there are a shame too
 
7:12 AM
@AlmaDo However, idea writing app that will calculate your math problems for you is not a bad idea. :p
 
huh? what do you mean?
 
My math exercises at school were really generic. You have few types of exercises, you can write app where you input numbers given in book and app will solve and format answer for you.
 
@Leri well.. my exercises were hard :p
 
@AlmaDo That'd be great. Here it was just endless routine doing the same over and over again.
 
@Leri here's equation solver :p code is awful, but I've created it before joining SO :p
 
7:18 AM
Naming is awful. Otherwise, it's ok I guess.
 
@Leri yeah. now I've fixed naming in all my code except that
 
need wordpress rewrite help : stackoverflow.com/questions/19947666/…
Thanks
 
@AlmaDo BTW, why does equation extends float operations? Could not get the idea.
 
@Leri another strange solution. My though was - it is so because it's above R (i.e. field of real numbers)
but obviously I've mixed math logic and data type logic
so now it looks strange
 
It makes sense now.
 
7:23 AM
well, a little. because float (or double) has very few common with real (math sense, R field)
 
good mornings
 
hi, @iroegbu
 
Anyone uses e-book reader? Does it worth buying?
 
@Leri I use my iPhone ..
@Leri btw I've tested recursion solution against my stack solution :p I won! :p 5-7 sec. on 1E6 iterations
 
@AlmaDo Nope, I mean something like kindle. When I read on my laptop or tablet I feel that I my eyes get tired.
@AlmaDo Have you tested my solution?
 
7:27 AM
@Leri huh? you've only provided re-arranging. Am i wrong?
 
It would be veeeery slow, but just curious.
@AlmaDo No, you are not but creating tree from flat array which has parents defined is way too trivial. :p
 
@Leri huhm then
function benchmark(callable $function, $args = null, $count = 1)
{
   $time = microtime(1);
   for($i=0; $i<$count; $i++)
   {
      $result = is_array($args)?
                call_user_func_array($function, $args):
                call_user_func_array($function);
   }
   return [
      'total'   => microtime(1) - $time,
      'average' => (microtime(1) - $time)/$count
   ];
}
use that to test :p
 
thx.
 
What can we test with that? :)
 
my result for 1E6 was ~70 sec for array in my question and ~30 sec for array from 6 elements, where all levels are 1 (replace levels for each element in question's array to 1)
 
7:33 AM
Ooooh and, good morning by the way!
 
@Duikboot huh? why not?
 
Whatfore was my question :)
 
@Duikboot you can use that for comparative benchmark. I.e. test one function against another. It's not a good idea to use that to get absolute (or at least as most precise as possible) time value
 
Oh and how important is it to do such tests?
When are you considering such a test?
 
@Duikboot here's a case, where it's important for me:
2
Q: Transform flat array to tree with one-time loop

Alma DoSO, The problem Suppose we have flat array with following structure: $array = [ ['level'=>1, 'name' => 'Root #1'], ['level'=>1, 'name' => 'Root #2'], ['level'=>2, 'name' => 'subroot 2-1'], ['level'=>3, 'name' => '__subroot 2-1/1'], ['level'=>2, 'name' => 'subroot 2-2'], ['level'=>1...

@Duikboot I'm doing that where I'm dealing with huge data, for example
 
7:40 AM
oh ok :)
Thats for me when Im more experienced I htink
 
1
Q: Does FP mess up your OOP skills?

bonomoI've been learning functional programming in Haskell and F# for awhile and now when I got some skills it gets harder for me to think in OOP way and program in C# and JavaScript. Everything seems to be ass-backwards there with classes, interfaces, objects and I often stare at the screen trying to ...

 
@Duikboot and it's also funny to compare your own solution to another :p
 
8:00 AM
ooh god
and this guy is hacked too in the adobe db
 
@DamienOvereem yet again, there's no such algorithm which will detect retards :p
 
We very much need one ..
Its actually becoming hard to find questions that are worth answering
 
I agree. And many good questions are just sinking in this shitstorm...
 
Hello guys..
I was looking around in MySQl room and apparently no one there.. so can I ask my question here?
 
@mamdouhalramadan go ahead.
 
Another of those questions that actually landed a guy a gold badge .. while it doesnt even fit stack ><
 
well, I have this sql which I wrote, and it is working, but what I don't understand is, how mysql really translate it
sql statement:

SELECT (sum(`item_price`*`item_quantity`)) as `total_sales`, `crown_order`.`order_date` as `selling_date`
FROM (`order_item`)
LEFT JOIN `crown_order` ON `crown_order`.`id` = `order_item`.`crown_order_id`
WHERE `crown_order`.`order_date` >= '2013-10-29 00:00:11'
AND `crown_order`.`order_date` <= '2013-11-13 00:01:28'
GROUP BY `crown_order`.`order_date`
ORDER BY `crown_order`.`order_date`
 
That question didn't make sense to me ..
 
what do you mean translate
 
8:10 AM
the part I don't understand is how { sum(`item_price`*`item_quantity`) }
is understood-able by mysql
 
its because of your group by
 
Show us your original statement then?
 
sum sums up what is grouped by the group by statement
 
well my original one is completely the same without the multiplication part, and I just gave it a try to do the multiplication hoping it will work and it did
so, you mean that mysql will do what is inside the sum function on each record according to my group by, right?
 
Maybe im not good in english but what is your exact question about the query?
 
8:15 AM
@AlmaDo Here's my benchmark: `array(3) {
["count"]=>
int(1000000)
["total"]=>
float(14.665838956833)
["average"]=>
float(1.4665838956833E-5)
}`
 
the exact question would be, how mysql interpret the sum(item_price*item_quantity) part of the query?
 
And this is what I used.
 
Sorry in advance if this isn't the right place for this but I could use some help... Anyone here ever feel like you get burt out? How do you cope with it? I have so much work coming in it's overwhelming me and all I want to do is sleep.
 
@Leri hm.. let me see
 
@mamdouh: i'm guessing it will add up all the item_price values and item_quantities as stated by the group by en multiply the calculated values
 
8:18 AM
@AlmaDo Sorry for messed up indentation. I had to write in notepad. :)
 
@Leri ah, got it! you're re-arranging array :p
@Leri 40sec on my machine
 
well, that would be awesome, sometimes I get lucky and I like it :D
 
well, it's not good to copy array :\
but time is nice
 
@AlmaDo No need to copy. 1 sec.
 
@Synexis Go asleep.
 
8:22 AM
pastebin.com/8up2vvup Got rid of one not needed copying.
 
@Dulkboot Haha thanks but it's a recurring problem. I sleep then just wake up to the same workload that seems insurmountable.
 
Mornin' all :-)
 
@Leri reduced to 30 secs now. looks good. I'm thinking about it
 
@AlmaDo Also, I'd add 'memory_usage' => memory_get_usage(true) to get mem usage.
 
@Leri no sense to do this
 
8:24 AM
?
 
@Leri you'll never get correct memory usage value with that benchmark
it will be always something like 1440
or zero
 
@Leri , sorry for interrupting, but may I ask why you're using the level to determine father child analogy?!
 
@mamdouhalramadan Could you clarify your question?
@AlmaDo I think, you are right not sure, though.
 
@Leri you can't measure memory is such way cause garbage collector issues... i.e. actual memory uage will be hidden inside function which is called by call_user_func_array
 
Sure. What I meant is, by using level to determine who's the father and who's the child you might miss some functionality like using a multi-dimensional array to build up the tree, or something else.
that's just an assumption :D
 
8:30 AM
@Leri you can place array_fill(str_repeat('foo', 1E6), 0, 1E6) (possible memory overflow here) - but you'll never discover that
 
@mamdouhalramadan You are missing context here: stackoverflow.com/questions/19927176/…
@AlmaDo Got it, thanks for explanation.
 
@Leri i have an idea
 
What idea?
 
Windows Phone made me use service location :S
 
@Leri 1 min
I'm researching time dependance from max nesting level
@Leri got it
with 3 levels it's 70 vs 30 (i.e. more than 100% difference). But on 24 levels it's only 250 vs 210 (less than 20% difference) - so I think for 100 levels stack will be faster
 
8:44 AM
@AlmaDo Yes, and I told that yesterday, that performance for re-arranging is O(n*m) where m ~ k where k is a number of levels chained.
 
@Leri I'll try :p
 
0
Q: Dynamically creating an object using eval() JS

Kamran AhmedI am trying to dynamically create an object in javascript. Here is the JS code that I have written: var table = $("#eidtPersonalInfoTbl"); var trs = table.find('tr'); var obj = { }; $(trs).each(function(index, row){ var field = $(row).find('td').eq(0).html(); var value = $(row).find(...

Any one please.
 
@Leri no, it's non-linear :p on 1000 it's 120 vs 160 (1E4 count)
 
damn this is so cool :) youtube.com/watch?v=WhBoR_tgXCI
 
anyway, your solution in practice seems better. may be stack will win on 1E6 depth.. but I doubt such structure will even exist in real situation
 
8:54 AM
@AlmaDo I have one idea, I may not need nesting at all. And that should be the fastest solution.
 
@KamranAhmed As a side note: I suggest using .html() only if really needed and .text() by default, your field and value variables look more like text to me.
Good Morning
 
@AlmaDo Never mind, impossible because if I reorder initial nodes, I won't be able to get correct parent-child relationship.
Since my solution is fast enough I'll post it as an answer later.
 
@Leri your solution is still good
yes, I was about to propose you to post that as an answer
since in question there's a strict condition (about one-way loop) - please, add benchmarks to your answer :p
 
@ThomasWeinert. Got it. Thanks :-)
 
@AlmaDo Ok.
Off to university and then real-world work. See you later.
 
9:01 AM
bye
 
9:17 AM
In case we have jquery guru's here: is there a way to get the posted data in the success/complete callback ?
 
Can anyone tell who to implement "people also viewed" functionality in shopping cart. just an idea to get me started ?
 
idea to get started is to open google
 
thankyou, anyone else
 
9:50 AM
Kinda easy.. You need to keep track of a database which stores (for each session) what items they looked at
Then when someone looks at an item, you look at all the entries in that data where the viewed item is in the list. And show the top X other items that also appear in the same result set.
For optimalisation you'd probably need to cache the results though.. or it'll end up being slow. (which you dont want for a webshop)
 

« first day (1124 days earlier)      last day (3831 days later) »