« first day (1477 days earlier)      last day (3467 days later) » 

12:11 AM
People do a lot of weird things to try an appeal classical music to the younger generations :P
 
Everyone enjoy halloween friday?
 
 
2 hours later…
2:09 AM
this room is dead atm. :(
 
It usually is on a friday night....and as it's also halloween, doubly so.
@rdlowrey Talking of things being haunted - I made a very simple loop test to check the memory usage in Artax. It seems to definitely be losing about 70kB per loop in gist.github.com/Danack/845a1913746a7e136d5d
The response data is only about 20kB in size. BTW xhprof doesn't seem to be compatible with Artax at all - running with it enabled results in the application hanging...
 
user895378
lol okay
 
user895378
No xhprof is not compatible at all.
 
user895378
There's no good tool for something like that ... I basically just have to get my hands dirty :)
 
user895378
Wait ...
 
user895378
2:12 AM
in your test you're storing the $promise and never letting it be GC'd
 
user895378
That will keep everything for the request in memory.
 
user895378
Oh wait, no you aren't
 
user895378
$promises = []; // <-- that line is doing nothing BTW
 
Yeah - the reference gets overwritten...
Sorry - yes, was from a bigger example....forgot to delete it.
 
user895378
Actually ... wait.
 
user895378
2:14 AM
Nah, your test is definitely legit. I obviously haven't had a chance to debug leaks yet.
 
user895378
I will work on it over the next couple of days though (not tonight)
 
Hmm.....I just added gc_collect_cycles(); - the 'memory leak' goes away....
 
user895378
Here's what I usually test with:
 
user895378
function outputStats() {
    gc_collect_cycles();
    $elapsed = (microtime(true) - START_TIME);
    printf("\nused: %10d | allocated: %10d | peak: %10d | elapsed: %5.2f\n",
        memory_get_usage(),
        memory_get_usage(true),
        memory_get_peak_usage(true),
        $elapsed
    );
}
 
user895378
And I have gc_collect_cycles() in there and haven't noticed leaks lately.
 
user895378
2:18 AM
But it has been a couple of weeks at least since I did serious leak checking to be sure, so I've been needing to look into it either way just to be sure.
 
@rdlowrey In the example I posted, the leak goes away when I'm calling gc_collect_cycles() manually.....
 
@Danack Here in the netherlands we don't really do anything with halloween #lazy people here :P
If you go be spooky outside people be like idiots calling you a kid...
 
So it's not a leak...just the GC not firing?
 
If I was in America I would love to go to a christian church for once and experience that aswell as do a halloween night, and on top of that I want to walk around in Silicon Valley
 
user895378
Seems like it. It probably makes sense for me to address that in the event reactor.
 
user895378
2:22 AM
I don't fully understand the cycle collection mechanism to know why it would have problems ... perhaps it's because your test is executing inside a while loop in the top level namespace?
 
user895378
(I don't really understand it)
 
user895378
But even if there's some valid reason why the event loop things can't be GC'd that is a problem that can easily be addressed at the reactor layer.
 
user895378
/me can't type.
 
user895378
From the manual it seems like GC happens when the number of buffered zvals exceeds a certain threshold. Is it possible that because you're only doing one request at a time and it's always essentially the same number of zvals in use (basically the same code path on every request) that you're never exceeding the threshold for GC to take place?
 
user895378
I dunno, just throwing out guesses really.
 
2:31 AM
@rdlowrey I guess it's possible....it's still weird that it didn't seem to be happening during the first beta of Artax, but has started since then. Ooh, there's a flag to enable GC debugging - php.net/manual/en/features.gc.performance-considerations.php
I'll give that a go 'tomorrow' and see if it says anything sensible.
Anyway nn.
 
user895378
Later :)
 
3:16 AM
@rdlowrey So..
I wish everyone would give up on HTTP interfaces and classes in core PHP.
We just need a few functions; that's all.
1) Give us the raw HTTP request
2) Decoders for form/multipart
Can't think of anything else that really needs to be there.
Even the decoder isn't strictly necessary
 
gonna work on some last projects tomorrow :) (parteh)
1) class diagram (for c# application)
2) PHP Installation on IIS 7 guide
sleep well everyone!
 
 
3 hours later…
6:31 AM
Ho guys.. :)
Are there anyone in the group now
 
6:59 AM
Morning
 
7:11 AM
Can anyone hElp me?
my if(!(isset($se))) is not working
  $num=1;$a=intval($num);
        $data = json_decode($output, true);
        $se= $data['items'][$a]['pagemap']['cse_image'][0]['src'];

        echo $se;
//Till here $se is set to a string 'aaaaa'
       if(!(isset($se))){ // this should not execute as $se is set already


         echo '<h4>Trying another api (Current : 1)</h4><br>Error:<i>'.$output.' </i><br>';
        $curl_handle=curl_init();
        curl_setopt($curl_handle, CURLOPT_URL,'http://fun.catbolt.com/api2.php');
        curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
But its executing ! Why?
@Leri Help?
 
@AsheshKumar I'd if you did not randomly ping me. That's really annoying. :-)
 
@Leri What ?
@Leri Oh Sorry!
I am new
@Leri Will you help?
 
Stop pinging me, please.
 
ok, sorry
Will you help?
?
?
??
?
?
?
?
?
@anyone Help>
@Leri (Sorry) Final time please help me
Please
@Leri Please
@Leri Please p
@Leri Please pp
 
@AsheshKumar Welcome to my ignore list.
 
7:22 AM
@Leri Please ppplel
@Leri thanks
 
@AsheshKumar Do not flag users for ignoring you.
 
@SomeKittens they can ignoore me but they can't tease me
Like "Welcome to my ignore list :)"
 
That was not teasing. This is teasing: "@AsheshKumar is a skinny twerp"
@obiNullPoiиteяkenobi that is a BRILLIANT avatar.
 
@AsheshKumar you are annoying the room
@SomeKittens thanks ;-)
 
@obiNullPoiиteяkenobi :)
isn't this room for Php?
 
7:28 AM
yupp but with billions of rule and rule 1 is Don't ask to ask, just ask and ask once! and 2 dont ping people randomly ...
 
That's two rules, but I'll forgive an off-by-one error
 
@SomeKittens cat in your avatar is too cute to be a bat :)
 
@obi (asking final time) Can anyone help me?
 
@AsheshKumar they asked you not to ping everyone with your problems.
 
@Gordon ok, another rule!
Any one help (not pinging !)
 
7:35 AM
@AsheshKumar codepad.viper-7.com/UFXvmh your if works fine
 
@obi i still dont get it!
$num=1;$a=intval($num);
        $data = json_decode($output, true);
        $se= $data['items'][$a]['pagemap']['cse_image'][0]['src'];

        echo $se;
//Till here $se is set to a string 'aaaaa'
       if(!(isset($se))){ // this should not execute as $se is set already
but it is executing
 
var_dump($se) ?
 
string(130) "http://img1.wikia.nocookie.net/__cb20140909190909/gravityfalls/images/thumb/a/a5‌​/S2e4_library_shot.png/185px-S2e4_library_shot.png"
 
even it is $se is set to be empty like $se=''; is set will see it as set codepad.viper-7.com/E4EZQA
 
its set to string(130) "http://img1.wikia.nocookie.net/__cb20140909190909/gravityfalls/images/thumb/a/a5‌​/S2e4_library_shot.png/185px-S2e4_library_shot.png"
 
7:39 AM
have you tried ctrl+s after edit ? :D
 
which edit?
Yes
I have saved it a lot of times
 
your code looks fine to me .. may its due to some magic :)
 
(this line is just an addon)
deleted, not solved!
 
sorry i am little buys now
 
ok, thanks for the help
@obiNullPoiиteяkenobi Fianlly Soved (really soved)
i encoded the url and somehow it worked
Anyone can tell how how do i encode all the crrent URLS in mysql table
 
8:10 AM
hi guys
I have 1 que. after submitting form suppose on cancel click i want to refresh page then why conformation popup comes
 
@AsheshKumar you don't. you only encode them when you need to use/output them. but you don't store them that way.
@John because that's how your browser vendor implemented it
 
i think then this is working correctly
window.location.replace(window.location.href);
 
@Gordon but if I don't inside them before inserting ,then it will fail my query
*don't encode
 
mornin
how's the hangover ?
 
I think because url conting special characters
*contains
I want to escape the url
 
8:23 AM
@AsheshKumar if you use prepared statement, then that stops being a problem
 
@AsheshKumar no, it won't. your database doesn't care whether they are encoded or not. It's your code that needs the encoding apparently.
 
If I directly insert the url, will it fail my query?
Because url can v contain slashes and periods etc.
 
your curl might care for the encoding. your database doesnt. your database is not trying to load the urls. your curl does.
 
also, damn, I am still addicted to this song .. I still keep playing it.
 
8:30 AM
after my code there is also a code that retrives and check that the given url by user is already in database or not
Will select statement fail?
I mean if I insert encoded, I must also inside the use input then comare?
 
@AsheshKumar you only need to urlencode the url when you pass it to curl
 
I need nothing to do with sql?
 
I dont know your query code, but you surely dont need to urlencode a url to insert or retrieve it from a database.
 
Ok, thank you
 
ThW
9:08 AM
Morning
 
9:21 AM
Morning
Just for knowledge, if i want to encode all data in url table and in url column , then what will i do?
 
jeez ... he's still going on about it
da fak
 
9:37 AM
@tereško think before you say, See this stackoverflow.com/questions/26687861/…
I wanted to help him!
 
10:23 AM
@AsheshKumar what do you mean by I wanted to help "him"?
 
10:49 AM
Morning
 
Good mornings @hakre
 
user652649
11:25 AM
good morning. i have to pick a definitive design strategy about collections. the problem is basically that "array as objects" (those implementing traversable, arrayaccess) are not interchangeable with php native arrays. in short, how i decide if a method should be `myMethod(Array $array)` or `myMethod(iCollection $array)`?
should i always type-hint `iCollection` and use `Array` only in collections' constructors? `class Collection implements iCollection { function __construct(Array){} }` ty in advance :P
 
user652649
i hate markdown
 
php-fpm, chrooted. Every time I try and instantiate a DateTime I get Timezone database is corrupt - this should *never* happen. Only way I can fix seems to be to not chroot. Halp.
@WesleyCrushed Why not just not type-hint, docblock is as @param iCollection|array $array and (optional) do if (!is_array($array) || !($array instanceof iCollection)) { throw ... }
You don't have to specify a type to the engine...
 
user652649
my OCD can't allow that. i have no control over it xD
 
Word up
 
Morning all
> marked as duplicate by hakre 15 mins ago
:-)
?
 
@PeeHaa yeh but it works without the chroot, and serverfault.com/questions/413293/… <-- I'm pretty sure that's worked for me before...
I pinged Derick in IRC, he'll probably know off the top of his head
 
Yeah. Let me check my chroot if I have the same issue
 
11:52 AM
Wifes back tomorrow. I can eat again :)
 
Also @PeeHaa that's built in to ext/date I think, not sure why it's maintained as a separate PECL ext
 
@Fabien Wifes you have more than one wife ? :S
 
heh. 's*
One is plenty -_-
 
good morning
 
This doesn't look promising @DaveRandom
> 2014/11/01 12:56:34 [error] 28601#0: *248284 FastCGI sent in stderr: "PHP message: PHP Warning: file_get_contents(https://codepad-jail.pieterhordijk.com?id=5454ca71db1955.54646749): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error
in /srv/www/beta.codepad.pieterhordijk.com/index.php on line 14" while reading response header from upstream, client: 77.172.80.34, server: beta-codepad.pieterhordijk.com, request: "GET /?id=5454ca71db1955.54646749 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "beta-codepad.pieterhordijk.com", referrer: "https://beta-codep
 
11:58 AM
I'm reading the sauce, I can't see any reason why it wouldn't work
I'm using Remi's 5.6 build, maybe he's patched it in a weird way or something
 
I think I am also running a remi build
 
He's not in IRC atm, dammit why are these people such slackers :-P
 
:D
Also it looks like I have fucked up my certificates in my server somehow at some point :(
Curl fails on me for ssl
 
Some root certs were revoked recently IIRC, try just yum updating it
 
holy shit 160 packages :O It wasn't really that long ago
Also while you are here and sober @DaveRandom. Stupid question. How to convert a CIDR thing to a ip range?
Damnit I read pixman as pacman. Now I am disappointed :(
> pixman-0.26.2-5.1.el6_5.x86_64
 
Code is a bit horrid, I wrote it ages ago, but it works and does All The Subnetting Related Things
 
<3 @salathe @DaveRandom
 
@PeeHaa installing that PECL ext fixes it
Installing gcc takes forever
right, gotta go do some RL stuff, bbiab
 
lator
 
1:04 PM
@ircmaxell stupid question, what "random generator" is used for in-built password_* i.e. can it be re-used in userland?
  public function toRange()
  {
    $ip = $this->parseIp(); // e.g. 127.0.0.1/24

    if ( empty( $ip[ 'cidr' ] ) ) {
      $ip[ 'cidr' ] = 32;
    }

    $ip[ 'cidr' ] = (int)$ip[ 'cidr' ];
    $ipCount      = 1 << ( 32 - $ip[ 'cidr' ] );

    $base = $ip['ip'];
    $bits = $ip['cidr'];

    list( $a, $b, $c, $d ) = explode( '.', $base );

    $i    = ( $a << 24 ) + ( $b << 16 ) + ( $c << 8 ) + $d;
    $mask = $bits == 0 ? 0 : ( ~0 << ( 32 - $bits ) );

    $start = long2ip( $i & $mask );
    $end   = long2ip( $i | ( ~$mask & 0xFFFFFFFF ) );
@PeeHaa But I have no idea, some stuff I "copied" (from github) didn't work for me.
 
tanks
 
@webarto /dev/urandom
 
@Narf Is that the single source or there are others, like in RandomLib? :)
 
@webarto yes it does
Look at the compat lib
 
@webarto When it doesn't read straight from /dev/urandom, it either calls mcrypt_create_iv() with MCRYPT_DEV_URANDOM or openssl_random_pseudo_bytes()
 
1:10 PM
Yeah, yeah, thanks.
 
It does what you are asking
 
Am I the only one that works on weekend and drinks on work days?
Drinks and works on weekend that is.
 
I do both during the entire week
 
Bro.
 
It's (not) Friday, (not) Friday, (no longer) getting down on Friday, Everybody's (not) looking forward to the weekend, weekend
@DaveRandom Yes please! I was thinking both of these things would be cool. ++++
 
1:22 PM
Someone recognizes melody? @Ocramius maybe? :P
You're from olive oil country :P
 
1:43 PM
@webarto sup man
 
why the hell is this "opinion-based" ?
http://networkengineering.stackexchange.com/questions/12763/duplicate-icmp-sequence
looks like those guys don't know what that reason means..
 
2:02 PM
@DaveRandom Yeah........this is fun. Basically the timezone file is outside of the chroot, so you have to find out what the path is, and map it into the chroot with the same path....
@DaveRandom Yeah........this is fun. Basically the timezone file is outside of the chroot, so you have to find out what the path is, and map it into the chroot with the same path....
 
@DaveRandom Yeah........this is fun. Basically the timezone file is outside of the chroot, so you have to find out what the path is, and map it into the chroot with the same path....
 
@DaveRandom Yeah........this is fun. Basically the timezone file is outside of the chroot, so you have to find out what the path is, and map it into the chroot with the same path....
 
2:19 PM
@DaveRandom Yeah........this is fun. Basically the timezone file is outside of the chroot, so you have to find out what the path is, and map it into the chroot with the same path....
 
@DaveRandom Yeah........this is fun. Basically the timezone file is outside of the chroot, so you have to find out what the path is, and map it into the chroot with the same path....
 
@DaveRandom Yeah........this is fun. Basically the timezone file is outside of the chroot, so you have to find out what the path is, and map it into the chroot with the same path....
 
anyone here?
 
@Jasch1 Nope.
 
2:35 PM
E_WAT
 
2:46 PM
@AlmaDo probably there can be two response packages from the same sequence? E.g. two routes to host?
 
How do you insert python script into php?
 
@Jasch1 with a text-editor?
 
adobe brackets
 
3:00 PM
@Jasch1 no, via a function call, e.g. from the Python PHP PECL extension: python_exec($code);.
 
@hakre the answer actually is googleable more or less (at least it's possible to figure out some list of reasons for duplicate sequence num). But since we have networking SE site, and it's beta, I just wanted to test how useful will it be. And if possible, get precise reason. Shame, but it didn't work there.
 
il look at that harke
have u tried it yourself?
 
lol
 
Also - apparently PHP has a built in code highlighter?
Completely useless hard-coded to fuck, but it's there.
 
3:14 PM
@Danack Isn't that for .phps ?
 
php -s someFile.php
outputs html
 
Also phps
AddType application/x-httpd-php-source
For whatever goddamn stupid reason :P
 
@Danack PHP has some wonderful source code comments, e.g. lxr.php.net/xref/PHP_5_6/Zend/zend_compile.h#139
 
@Danack :D
 
3:20 PM
Good morning
 
Morning
 
Morning, Anthony :)
 
last night was... interesting...
 
What happened last night?
 
Was ist passiert?
 
3:22 PM
@ircmaxell do tell
 
(away, eat)
 
o I saw, is that the parade you somehow got involved in ?
 
wow that sponsor ticker is annoying
 
yup
about to go through the photos now :-)
 
3:24 PM
cool
 
It'd be helpful if the manual would tell you why a given function may fail; ie sort
Non-array arguments are seemingly a reason, but I had to go elsewhere to discover that.
 
Hello everyone. Who can help me with a advise in question?
Question is simple
 
@AllenDegrud room-11.github.io/#dont_3 — Just ask the question. :)
 
@webarto multiple, with fallbacks. And it could be re-used in userland, but I wouldn't
 
hi
 
3:54 PM
@AllenDegrud What does $this->redis->zRange('mergedArr', 0, -1, true); give?
 
@salathe One moment, check
@salathe Wau, I got a array with a 15 values
 
good
 
Works, but how I can get latest 10 notes from a merge array?
how as like in SQL LIMIT 0,10
then LIMIT 10, 20
 
Do you not care about restricting the scores between $start and $end?
 
Yes, did care. My srore is a timestamp of post
In result I want to get a sorted data by timestamp(score)
 
4:00 PM
Ok
You do know that you were trying to get the scores (timestamps) between now and 5 days in the future?..
 
Yes, I tried, but i am not sure in this case
 
Are there supposed to be any scores (timestamps) between now and 5 days in the future?
(your question did mention getting values from the last 7 days)
 
From last 7 days may be not data, it is a problem.
May be get LIMITED data with a function ZRANGE by index? It is a more same with SQL operator LIMIT, or not?
So, user add a post in Redis, with a score timestamp. I need get last 10 or any data from store for some KEYS(users), sorted by timestamp(score)
 
@AllenDegrud oh, so it sounds like you might want $this->redis->zRange('mergedArr', -10, -1, true);
 
@salathe It will give me sorted data by score time in DESC?
 
4:08 PM
@AllenDegrud No, but zRevRange will
 
Ok, now will check
@salathe Works, great! But key and values in array is inverted :) So, if I will specify -20, -10 then i get data from 10 to 20?
including?
 
You probably don't want negative values with zRevRange. 0 will be the newest timestamp (highest score), so zRevRange('mergedArr', 0, 9) should get the newest 10 values in descending order
 
Yes, so then 9, 10 ?
 
Try it and see :)
 
@salathe Okay :) Thank you for fast help!
 
4:26 PM
hi
i need help in simple html dom
any one help me?
 
@AtmiyaDas2014 Ask please
 
html string :
<span class="mfNoWrap">
<span>sa<span class="mfBefog"> </span>
<img src="/img/content_area/main/empty.gif">les</span>
<span class="mfBefog"> </span>
<img src="/img/content_area/main/empty.gif">
<img src="/img/content_area/main/symbol.gif" alt="at">
<span>jordanchalk<span class="mfBefog"> </span>
<img src="/img/content_area/main/empty.gif">.com</span></span>
i need to email address : sales@jordanchalk.com
it's possible?
 
@AtmiyaDas2014 Do you need get email from this HTML?
or send this HTML code to Email address?
 
@AllenDegrud any suggestion?
yes
second line in "sa"
3rd line in "les" ....
@ -> image
 
@AtmiyaDas2014 sounds a bit sketchy. why do you need this?
 
4:40 PM
i try scrap 1 web page
any solution @Patrick
 
@AtmiyaDas2014 I dont understand what you need
 
@AtmiyaDas2014 I don't think the guy who set up the website wants his email adresses to be scraped
 
i need scrap email address from above html string
 
Smells like email spam to me
 
means?
 
4:43 PM
That means unless you present a valid use case you won't get any help from me.
 
my code :
$album = array();
$album['first'] = $div->find('span',2)->plaintext;
$album['second'] = $div->find('span',5)->plaintext;
$albums[] = $album;
echo trim($albums['first']."@".$albums['second']);
output : @sa les @jordanchalk .com
any best solution?
 
@ircmaxell Thanks, was just curious but sucked at reading C :)
 
:-)
 
5:28 PM
How get value of array in this case? $arr = array(456 => array()); ?
Can $arr[456], but else case?
 
which value ?
 
Yes
get value
return current($arr); ?
 
@AllenDegrud yes you can get value by that
 
it returns me key 456, so I can do: return $arr[current($arr )];
 
 
1 hour later…
6:35 PM
current() also works on objects:

<?php

  echo current((object) array('one', 'two')); // Outputs: one

?>
what the fuck
Seriously, what?
 
A hidden iterable interface? Or something crazy like that?
 
What, objects implicitly implement traversable?!
 
Kind of.... 3v4l.org/JCU73
I seriously object to programming like this....but it's there.
 
Maybe I'm stupid, but would it be a good idea for PHP to have a base class from which everything inherits?
Like, have StdClass be the base class
 
NOONONOONONONONONONONOONONONONONONONO
 
6:49 PM
god no
 
Huh, why not?
 
Because Java.
 
Sorry my backs in a lot pain today, so not going to give a coherent answer...but imho it means that all difficult problems that should be solved at the language level just get shoved into the base god object class.
 
@AndreaFaulds what problem would that solve?
 
6:51 PM
Hey all,
If someone has any experience with this, I have a friend looking for IT Consultants in London, can any body please tell me what's the best site to find the best out there. He wants me to suggest the best ONE that would get us good candidates, so that he may pay only for that. I was thinking about "Stackoverflow Careers", "The Guardian Jobs" or "Linkedin". What would you guys suggest?
 
@tereško Nothing, actually
 
@AndreaFaulds Really? That's news to you?
 
@salathe Yes, I didn't realise objects were iterable by default, or indeed that current() worked on iterables.
It weirded me out because I didn't know current() worked on iterables.
 
Anyone know why php.net/manual/en/function.class-implements.php doesn't return that iterable interface for classes?
 
Friends, who have used a Codeigniter, look here please: stackoverflow.com/questions/26691606/…
 
6:55 PM
Friends don't let friends use Codeigniter.
9
 
@Danack You can make an exception :)
 
@AndreaFaulds I don't know exactly what you mean by "iterable", but yes it works on objects (independently of the Traversable/Iterator iteration).
 
@salathe I keep saying Iterable, bad habit
 
@Danack What iterable interface? ;)
 
@salathe Gross.
 

« first day (1477 days earlier)      last day (3467 days later) »