« first day (781 days earlier)      last day (4185 days later) » 

9:00 PM
"Too many connections"
I cant see none of my sites
 
And why do you think you have been DDOS'ed besides that one message?
 
googled the problem, they said you probably have been ddos'ed
 
Go away.
 
im trying to check it in my ubuntu server log, but i dont know how to do it
 
How many connections are allowed?
Also is this shared hosting?
 
9:03 PM
I dont know exactly, but there were never been problems like this
its cloud hosting
 
This is not your hosting support chat.
 
@martincpt what company?
 
cloudee
 
What is cloud hosting? As in amazon webscale elastic amazon cloud hosting?
 
It's webscale, that is all it matters...
 
9:06 PM
30 GB disk max :|
@martincpt What is your domain?
 
itrapps.com
 
@martincpt login to the box. open mysql shell. And see what is happening ` SHOW PROCESSLIST`
 
@PeeHaa Not mine; no. Just the place where I found this lovely kitten.
 
mysql -u root -p, then mysql> SHOW PROCESSLIST?
 
mysql> SHOW PROCESSLIST;
Yes
 
9:20 PM
@LeviMorrison Never thought of you as a placeholder :) And hiya
 
@PeeHaa I see a lot of request on my other site
 
I was creating a website for class project and I needed a placeholder image, and guess where I went?
 
user1125394
lorempixel.com/640/480/nature a great background
 
@martincpt How many are a lot? What host are they coming from? WHat users?
 
@PeeHaa its strange because the latest queries are from one of my cronjob
 
9:36 PM
So the chances of it being a DOSS have became smaller?
 
@cyril This is cool, I like this system of serving images.
 
user1125394
@webarto but it seems there not many different pics, you better do you own with flickr
 
@cyril yaymicro.com I have a plan :P
 
@NikiC How do I edit/delete user submitted notes in the PHP manual?
 
9:58 PM
@LeviMorrison hi
@webarto .... ping
@PeeHaa just did something stupid but it was interesting anyway
 
Yo
 
@webarto have you ever implementing a replacement for implode without loop
 
@Baba impossibru
 
I had my fun trying
3
A: Assign entire array values to string without looping in PHP

BabaSimply Use Implode echo implode($myarray); Or Just reduce the array with array_reduce echo array_reduce($myarray, function($a,$b){$a .= $b; return $a;}); Play around with vsprintf echo vsprintf(str_repeat("%s", count($myarray)), $myarray); We also have some crazy ways .. echo preg_rep...

Now i know how important implode is ... :)
@LeviMorrison hold on let me run a benchmark
 
It may look like there is no loop, but in fact, you can't do anything without loops.
 
10:05 PM
@webarto definitely ... time is a loop its self
just thinking if someone else has a better idea
 
array_walk($myarray, function($s){echo $s;});
maybe better than array_reduce one... @Baba
Actually, no, you need return, not echo.
 
Just Included it to my test
Guess the fastest ....
for loop is faster than implode
lol
 
language construct, right
 
Hold on let me add the script online
 
Single Run
Array
(
    [m1] => 0.022030115127563
    [m2] => 2.2939040660858
    [m3] => 0.034219026565552
    [m4] => 0.033432006835938
    [m5] => 0.010767221450806
    [m6] => 0.062453985214233
    [m7] => 0.00010299682617188
)
I get that result
 
10:18 PM
lol
Look at that time
the difference is just too much
 
I thought that lower is better...?
 
Single Run
Array
(
    [m1] => 0.028177976608276
    [m2] => 6.8392789363861
    [m3] => 0.04231595993042
    [m4] => 0.033381938934326
    [m5] => 0.012403964996338
    [m6] => 0.23280787467957
    [m7] => 2.0980834960938E-5
)
 
@ShaquinTrifonoff .. how can a slow script be better
m2 is the slowest
m7 fastest
 
Yeah..
I don't see how you got your result though :P
nvm
 
@ShaquinTrifonoff again ...
		$alpha = microtime(true);
		$key($range);
		$result[$key] += microtime(true) - $alpha;
 
10:21 PM
@Baba Adding count slows it down.
 
you mean for m3
let me remove the count
 
function m7($array) {
	$l = ""; $c = count($array);
	for($i = 0; $i <= $c; ++ $i) {
		$l .= $array[$i];
	}
	return $l;
}
@Baba but "slows" is measured in microseconds...
 
Hold on
 
Btw, it should be $i < 4 ?
 
Yeah
but it really slowed down
it made str_replace the fastest
its only fair to add count
m3 also using count
 
10:27 PM
function m7($array) {
	$l = "";
	for($i = 0; $i < count($array); ++ $i) {
		$l .= $array[$i];
	}
	return $l;
}
:P
 
for($i = 0; $i < count($array); ++ $i) { bad code
 
for($i = count($array); $i > 0; --$i) {
 
 Array (
-    0 => 3
-    1 => 4
+    0 => 4
+    1 => 3
 )
Failing test, wow...
sort to the rescue!
 
@webarto test script
 
In my own tests, array_shift works great
 
10:39 PM
[3,4] !== [4,3]
that is the "problem", results are returned from database in reversed order...
 
@ShaquinTrifonoff how did you use array_shift
 
@Baba I'll post a link to my test in a min
 
Still, -1 for "benchmarking" this! — salathe 6 mins ago
 
evening
@salathe causing trouble again? :-P
 
@DaveRandom lol
It thinks a simple benchmarking a simple script is wrong
just to prove that loop is not that bad
0
Q: Assign entire array values to string without looping in PHP

DavidI have an array about 1000 values, I've just shuffled them using shuffle(). Now I want to echo the shuffled results. But here's the catch, can it be done without looping through the array or displaying array 'syntax'? ie: <?php $myarray = array('a','b','c','d'); shuffle($myarray); ...

@DaveRandom we are looking at implode replacement without loop
 
10:45 PM
@Baba I think question should be downvoted, you gave proper answer, but to a stupid question unfortunately..
 
@LeviMorrison you first log in on master, then the respective actions will be available next to the notes
 
@webarto ... lol
@DaveRandom what do you think .. do you think the benchmarking is wrong ?
 
Okay...
0
A: Assign entire array values to string without looping in PHP

Shaquin TrifonoffThe simplest solution is to use implode. echo implode($array); If you do care about speed... well... I'm hoping I won't get a response like this: -1 for "benchmarking" this But anyway, here is my test (I used some functions from @Baba's script for comparison): codepad.org/BwBLpmgp. R...

 
I'm hoping I won't get a response like this:
lol
 
10:50 PM
@Baba I think benchmarking anything over 4 iterations is wrong. I also think that benchmarking anything that performs operations as trivial as this is irrelevant.
I also tend to agree that the question is a bit stupid, at best it's a theoretical question that probably belongs on programmers, if not in the bin.
 
@DaveRandom ... ok would take to your advice
 
I also think that @webarto has broken my cv helper build somehow :-(
 
@ShaquinTrifonoff have you used for with count? Have you tried foreach?
 
(well, that cv request did something odd anyway)
 
10:52 PM
@DaveRandom Force is strong in me.
 
@webarto foreach isn't particularly impressive: codepad.org/0T7wOeqx
 
Anyways @DaveOl'Chap , chat.stackoverflow.com/transcript/message/6553709#6553709 is there something like [3,4] == [4,3] == true ?
 
@webarto Much impertinence you have.
 
yesterday, by DaveRandom
@webarto WHO SAID ANYTHING ABOUT PATIENCE??? :-P
 
@webarto What, as in only care about the values but not the order?
 
10:54 PM
;) Yes yes...
 
@ShaquinTrifonoff there is soothing wrong with your benchmark approach
 
1) DepartmentsTest::testDepartmentGroups
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => 3
-    1 => 4
+    0 => 4
+    1 => 3
 )
@DaveRandom I should probably change my method, and sort array with sort, but I'm curious nevertheless... which is not the reason to annoy you and take your precious time.
 
if you switch code places you would get different results
give it a try
 
oh
I'll create separate files to test then
 
10:56 PM
@webarto All values in the array are integers? Any possibility of repeated values? Maybe array_flip($arr1) == array_flip($arr2)?
oh no, that won't work
 
@DaveRandom ID's from database, so no repeating values I guess.
 
Can't you just sort them?
 
  public static function find()
  {
    $_args = func_get_args();
    if(empty($_args))
      return [];

    $_ids = [];

    $_names = [];
    foreach($_args as $value)
    {
      if(array_key_exists($value, self::$_groups))
        $_names = array_merge($_names, self::$_groups[$value]);
      else
        $_names[] = $value;
    }

    $query = Doctrine_Query::create()
             ->select('d.id')
             ->from('Departments d')
             ->whereIn('d.short_name', $_names)
             ->orderBy('d.id ASC');
 
@ShaquinTrifonoff codepad.viper-7.com/RakL7Y
 
@DaveRandom I added order by id ASC, what do you think, MySQL sort, or PHP array sort? or BOTH :D
 
10:58 PM
-1 for "benchmarking" this — salathe 2 mins ago
@salathe I knew it :) — Shaquin Trifonoff 1 min ago
 
@webarto Don't know enough about MySQL sort to be certain, but I have a suspicion it will be quicker.
 
@DaveRandom I'm sure it will, and it is equally "safe". But it is easy to miss it. You'd naturally look for some sort function applied on Array.
 
@ShaquinTrifonoff lol
 
@webarto Why? If data is coming from a database I generally assume that the order is determined in the database, so if the order is specified you specify it in the database. Is that wrong, do you think?
 
1
Q: What counts as an operator and operand in PHP when calculating Halstead complexity?

TrashyMcTrashI have this code that I want to use for calculating the Halstead complexity: <?php $words = explode("\n", file_get_contents('http://www.puzzlers.org/pub/wordlists/unixdict.txt')); foreach ($words as $word) { $chars = str_split($word); sort($chars); $anagram[implode($chars)][] = $w...

 
11:04 PM
@webarto hang on, is the only reason for this to satisfy the unit test?
 
str_replace is the fastest (but no-one can prove it)
 
:) funny right
 
@DaveRandom It comes as DESC, but I need ASC... I'd generally not care, but because [3,4] !== [4,3] I have to... so yes, is ordering in database equal as in language itself, regardless of performance :P ?
@DaveRandom Yeah man, they are satisfied already, that, and order should be from lower to higher (to make sense when presented graphically).
I've taken too much of your time, have a :beer: in return;.
 
@webarto Hang on, !array_diff([3, 4], [4, 3])
 
@DaveRandom Awesome!
 
11:12 PM
Be careful though, that relies on the fact that either the arrays are the same length or the larger array gets passed to the first argument in order for results to be reliable.
 
@Baba I updated my post :p
 
@ShaquinTrifonoff :)
 
Hey guys could some one give me a quick answer to:stackoverflow.com/questions/13734224/…
your help would be appreciated
 
Can somebody please explain to me why Javascript's date is so stupid?
 
Because
 
11:20 PM
@PeeHaa ...because it's Javascript?
 
That just must be it
 
Care to expand?
 
It is not jQuery?
 
Just simply the stupidness in doing new Date(ms since epoch). Now I would expect when doing for example to string or whatever to be x ms since epoch. but nooooo. Let's convert UTC to GMT+1 just for shits and giggles
Go home Date you're drunk
 
@KyleAdams So just create a method on the current object and pass that as the callback.
@PeeHaa I don't think I have ever done anything with Date other than (new Date()).getTime(). I let PHP worry about that stuff, I don't trust users to have their clock set to the right year, let alone the right time.
Multimultiping!
 
11:31 PM
@DaveRandom That's not a multimultiping! This is a multimultiping!
 
:P
doublemultiping
 
I will block you, and it will hurt. I won't block you on chat, I will come round to your house with some concrete blocks and catapult them at you.
:-P
 
Fly home @DaveRandom you're high.
 
But you are on the opposite side of the world! :P
 
lol
 
11:35 PM
Not really relevant, I'm British. I saw a great statistic the other day that of nearly 200 countries in the world today, only 12 have never been invaded by us at some point in history.
 
I'm not on the opposite, I'm on the wrong side.
 
@webarto It's more when you are that concerns me. Your profile states that you live in a country that hasn't technically existed for 10 years.
 
@DaveRandom I'm all around it because it would be difficult to change Slovenia, Croatia, Bosnia & Herzegovina (Federation of Bosnia & Herzegovina / Republic of Srpska), Serbia, Kosovo, Montenegro, Former Yugoslavian Republic of Macedonia, and such :)
I'm around number 15 now :P
 
@webarto Why do you move around so much?
 
@DaveRandom My work here is done I try to travel somewhere near every weekend, but I often live few months in other places.. I can't live in EU for example.. only travel.
 
11:45 PM
@NikiC ping .. .. ..
 
@webarto What country is on your passport? Slovenia is an EU member state these days, I'm sure the rest of the the former Yugoslavia can't be too far behind (in relative terms) - having said that, my grasp of world politics in general sucks :S
 
@DaveRandom Serbia/Bosnia, both suck... Croatia is about 5 years ahead because they sold their soul to Germany/Austria (they were always allies) and they have enormous debt to IMF. Slovenia is EU but sun isn't shining there either cbc.ca/news/world/story/2012/12/01/slovenia-protests.html (recent news)... so major f* up... For the record, we couldn't travel anywhere until 2 years ago. So I'm trying to use that privilege because as far as history goes, they'll revoke that :)
 

« first day (781 days earlier)      last day (4185 days later) »