« first day (1772 days earlier)      last day (3183 days later) » 

3:00 PM
What?
I didn't notice it because I was on CodeReview.
Ok remove it now.
Sent f/r.
 
3:15 PM
lol
 
Hello everyone
I have an issue regarding file_get_contents in php
I am trying to get all content of a file
but whenever <?php tag comes it does not show any thing
 
Abe
Happy Birthday @Ocramius !!!
24
 
This is my php code
<?php
$file = file_get_contents('/all.txt', true);
echo $file;
?>
and this is my file content:
 
anyone can help?
 
Happy birthday @Ocramius! That we may see lots more of genius horror code from you! :)
 
Abe
3:19 PM
As a birthday present, I received… taxes. Yep, not kidding, just got the notice :|
 
Awesome birthday present troll
 
Abe
ahaha
 
I need help plz
 
@FaisalShaikh That is an absolute path
 
3:21 PM
So you have that file in the root?
I think not...
 
@PeeHaa chroot/jail?
 
@tereško In that case the second param makes no sense
 
if I remove "<?php" from my file content then it work
 
DAMN
GOT ARRESTED for 10 MINUTES
 
3:22 PM
I got arrested for murder
5
in this gang
*game
 
Was continuously killing cops with my buddies.
 
5 mins ago, by Faisal Shaikh
and this is my file content:
we are still waiting for the content of your file
 
@PeeHaa if I remove "<?php" from my file content then it work properly
 
@FaisalShaikh If the file is indeed in the root (FS root not doc root) why are you setting the second param?
 
3:24 PM
@tereško I think his file content is null.
 
IIRC that is for adding the include path
 
File Content:
<?php
ksajfois sdlfdjsf glojdsog fsdgojfsd
 
That ain't valid PHP mate.
 
Abe
@marcio so ultimately, there is no chance to haveinterface List{}in php7? (hai, i'm Worf :P) getting unexpected T_LIST :(
 
@HassanAlthaf pay attention or shut up. It's a text file: chat.stackoverflow.com/transcript/message/25258474#25258474
 
3:25 PM
sorry @tereško
 
Abe
gotta find a synonym for List/Sequence
do you like Chain?
 
@PeeHaa Given the effort we (regularly) go through to support it, someone better be using it!
 
@tereško Oh god.. chill man, where is your sense of humour..
 
List and sequence or not really the same thing @Abe
@NikiC Well I tried and no it didn't work :P
 
I google and i found file_get_contents works for php file also
 
Abe
3:26 PM
@PeeHaa every language has its own definition, but words are kinda interchangeable
 
but I am not able to use
 
Abe
in c++ sequence is the interface, while list is a linked list
in java list is the interface
 
@Abe Imo list can be just any list. Sequence imo actually defines a list of following items
 
anyone is interested to help me
plzz
 
@FaisalShaikh try getting the file's content with fread()
 
3:28 PM
That's my first reaction though
 
Abe
i agree though, list doesn't look to have an order (as in "ordered list")
but it is known to have one because of java/c#
> a series of names or other items written or printed together in a meaningful grouping or sequence so as to constitute a record
dictionary says it has an order
 
Stupid naming shit
Just call it 1a and 1b
 
Abe
lol
 
:P
 
Abe
synonyms for Sequence? how about Chain?
Row? Line?
 
3:30 PM
Not the last two at least
 
Abe
would just be happy to have interface List :P
 
@tereško same result
unlucky
 
what's your code
 
my code:
<?php
//$file = file_get_contents('/all.txt', true);
$handle = fopen('./all.txt', "r");
$file = fread($handle, filesize('./all.txt'));
echo $file;
?>
my file content:
<?php
ksajfois sdlfdjsf glojdsog fsdgojfsd
 
@Abe Chain or series.
 
3:32 PM
 
say @tereško @PeeHaa
 
did you view page source in the browser?
 
view page resources is following:
<?php
ksajfois sdlfdjsf glojdsog fsdgojfsd
 
internet makes me sad
 
lol
 
Abe
3:35 PM
@kelunik not sure about series. chain sounds ok but it's a new word for a very old thing. Sequence is already taken and it is its super interface
 
how can i solve this
 
so, you still don't understand what is going on?
try echo htmlspecialchars($file, ENT_QUOTES, "UTF-8");
 
@tereško s/htmlentities/htmlspecialchars
Also look up XSS vulnerabilities in general @FaisalShaikh you need it
 
I can never remember
 
I read several tutorial for installing a virtualbox, but all of them are 'Oracle'. I want mysql, there is any virtualbox for mysql ?
 
Abe
3:40 PM
maybe series would fit too
 
@Abe Why do you need a second one?
 
I kinda like series
@kelunik My guess is interface vs implementation name :)
Because it sure looks like the struggles I always have :P
 
@Sajad do you understand what VirtualBox is?
 
it is a OS (virtual), right ? @tereško
 
Abe
currently it's:
Sequential
Sequence // an array
SequentialSet // an ordered set
SequentialMap // an ordered map
 
3:42 PM
Does anyone know why it's 7.0.0beta1, but 7.0.0RC1 in uppercase?
 
Abe
but i hate Sequential, would like it to be Sequence
 
@PeeHaa huh? example?
It ought to mostly work nowadays on recent php versions
 
@Sajad not exactly. It is a tool that lets you run any OS in a virtualized form on your current operating system
 
Abe
@NikiC hi :D is there a way to define the "booly value" of an object by using the php's extension api? something like python's __nonzero__()?
 
@NikiC I'm about to go out for dinner now. I'll set up an example when I get back
 
3:44 PM
@tereško aha, So I can install a MAC on virtualbox ? (you said any OS)
 
@Abe There's a cast_object handler for that
 
@Sajad yes, as long as you can find an ISO for it
 
@Sajad You can, but it is painful
 
aha
 
install it and I will give you a quick tutorial
 
3:46 PM
ok, So what is oracle ? why when I search about virtualbox, I see several time "oracle" word, I think oracle is a database
 
@NikiC Problem was with cleaning up the output buffer with finally { return ob_get_clean(); } instead of having the return in the try and finally { ob_end_clean(); }. The output buffer isn't cleared then.
 
Abe
@NikiC so not just bool but other types as well? that's great. why don't we have that in userland code? :D
 
@Sajad oracle is an evil corporation, which owns a lot of stuff: mysql, solaris, java, virtualbox would few notable examples
@Sajad get virtualbox and download this ISO: ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/10.2/… (I picked freebsd, because it will be easiest for me to walk you through)
 
oh, 230mb, I can download it in the home, I should to go univercity !
 
@kelunik I don't see why that wouldn't work
 
3:50 PM
@tereško anyway tnx, I will download it
 
@Sajad gimme a second, I might have a smaller version
 
@Abe Because certain conservative factions dislike operator overloading
 
Abe
those conservative factions could just not use it :P
 
but you will have to unzip it, to get the ISO out of it
 
3:52 PM
:-) ! good, but what is its problem ?
what is IOS ?
 
An ISO image is an archive file of an optical disc, a type of disk image composed of the data contents from every written sector on an optical disc, including the optical disc file system. ISO image files usually have a file extension of .iso. The name ISO is taken from the ISO 9660 file system used with CD-ROM media, but what is known as an ISO image might also contain a UDF (ISO/IEC 13346) file system (commonly used by DVDs and Blu-ray Discs). ISO images can be created from optical discs by disk imaging software, or from a collection of files by optical disc authoring software, or from a different...
 
ok
just for your information, I have win 8.1 now, I can install that virtualbox (50MB) ?
 
1 question: do you have some kind of download limit for home internet ?
5 mins ago, by Sajad
oh, 230mb, I can download it in the home, I should to go univercity !
 
yes, why ? (2 GB in month)
 
well .. shit
 
3:56 PM
why ?
I need to download something else ?
 
I have no idea how much installing the software will take
 
oh !
 
@kelunik I just tried and return ob_get_clean() works fine for me
 
so I should stop downloading !
 
because after you install the OS on virtualbox, you will still need to download php and apache and mysql
 
3:57 PM
aha !
 
Maybe @PeeHaa's issue was that it (correctly) discards any thrown exception?
 
@NikiC Yeah, me too. Works fine here, too.
 
is it possible to I use of mysql and php from xampp ?
I can copy these folders: mysql , php
 
no
 
aha ok
 
3:57 PM
stop downloading
 
I did !
 
your best option would be to fix your xampp installation
 
there is not any free VPS for two days ?
 
@NikiC chat.stackoverflow.com/transcript/message/25257407#25257407 < @PeeHaa said this wouldn't work, but I can't see any issue there. It worked without return in finally.
 
you can find some VPS trial
but seriously, 2GB? that's brutal
last movie I downloaded was 1.5GB .. and I got it in about 20min
 
4:01 PM
@tereško :-)
 
I would cap it out in about 30mins
as in "reach the bandwidth cap/limit"
 
@NikiC Yes
That was probably it
 
what is the speed of your download ? @tereško
 
But why is that correct?
Now I'm really going out for dinner
 
depends, for torrents it's about 8MB/s
 
4:03 PM
oh !!
 
@PeeHaa Because finally always wins
 
I hate you ...! that is Injustice
 
@PeeHaa pastie.org/10370491 works perfectly, should be the thing your first code tried.
 
If you return or throw from finally, that's what's going to happen, independently of what's going on in the try block
 
I don't have a bandwidth cap even on my phone :(
 
4:05 PM
@tereško why you are sad ?
 
@NikiC Well, yeah, that's the thing... It's unexpected, but it's the same in other languages.
@Danack Fatal error: Return inside a finally block is not supported in /in/4Y1HD on line 7 ;-)
@NikiC The second valid use case for try ... finally is hiding internal dependencies' exceptions then? Or how would you hide them? It's probably way better to catch them one-by-one, but we don't have multi-catch, right?
 
@tereško how much is the size of mysql and php for virtualbox ?
 
@kelunik not sure I get what you mean. How is finally related to that?
 
4:21 PM
@Sajad I honestly have no idea
 
almost
more than 100MB ?
 
if mysql page can be trusted, 273.5M is just the mysql
 
@NikiC finally automatically chains exceptions: 3v4l.org/Vt8KX, so you can use it to throw a defined exception instead of letting a dependency's exception bubble up.
 
and that does not include dependencies
 
oh !!
@tereško ok, one thing, can I install the old version xampp on my real vps ?
 
4:23 PM
you really shouldn't
 
If I do that, all problems will be solve
because my website is fine on that old ver
 
the problem you have is in the configuration
you won't be able to install windows version on linux to begin with
 
I think my problem is Collection
@tereško aha ! alright
 
and relaying on pre-packaged server "solutions" make your whole setup extremely fragile
 
@kelunik Yes, but that would mean you always throw. Doesn't seem very useful
 
4:28 PM
I'm really disappointed and tried ! I don't know what should I do ...! :-(
 
what exactly was the error ?
 
@NikiC Ohh right, it throws always then, nevermind.
 
@tereško the routing has error
my website has 3 parts
1. homepage
 
ah, mod_rewrite was not enabled
 
2. result page (all result)
3. result page (one result (selecter))
@tereško no, I checked it
so, the problem is 3 case !
 
4:31 PM
open xampp control panel
 
@tereško so ?
 
in the service list, there should be Apache listed
and beside that there should be a config button located
click that
 
your mean is this ^ ?
 
well .. that might be good enough
go to C:/xampp folder
 
so ?
 
4:39 PM
what folder do you see there ?
 
anonymous
apache
cgi-bin
filezillaFTP
htdocs
install
licenses
MercuryMail
mysql
perl
php
phpmyadmin
security
sendmail
tmp
webalized
{and several files}
webadav
 
go to apache fodler
what's in it?
 
symbols
modules
logs
icons
 
modules
 
error
conf
bin
I go to modules ?
 
4:46 PM
yes
 
so ?
 
is there mod_rewrite file located in there ?
 
yes it is
its format is SO
I can not open it
 
don't
next, go one folder up and in /conf
is there httpd.conf file there? or maybe apache.conf
 
there is httpd.conf
 
4:49 PM
yes
 
I know what you whant
your mean is this:
LoadModule rewrite_module modules/mod_rewrite.so
?
 
yes
 
I activated it already
 
is that line un-commented ?
the find <Directory in that file
it probably will be <Directory />
 
your mean is AllowOverride None ?
 
4:50 PM
it should be
<Directory />
    Options All
    AllowOverride All
</Directory>
 
it is this now :
 
(kids, don't do this on production server)
 
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
 
that might be good enough
it need to be
<Directory />
    Options All
    AllowOverride All
    Order deny,allow
    Deny from all
</Directory>
 
ok
 
4:52 PM
I am not sure about "Deny" there .. havent played with apache for few years
now you should restart apache
 
ok
Does not matter ! :(
 
go to folder C:/xampp/apache/logs
 
so
 
there should be some file kinda like "error_log"
see what is at the bottom of it
 
OW ! I see something, I will fix it, tnx, I got to go now, I will ask you more later
 
4:59 PM
bye
 
@tereško tnx bye
 
food, ETA: 11min
 
Hi
The third parameter of Exception::__construct is meant to accept \Throwable, right? Just experimenting with the new PHP7 features and want to make sure that this stays that way. It's not documented(migration, exception docs, throwable rfc) yet (or I'm blind today).
 
5:15 PM
@Rangad It should be \Throwable. I guess.
 
Well, there is a test for it, should be safe to use, even if it isn't mentioned anywere yet, I assume
 
@Rangad Yeah, I should update the docs.
@Danack Are there other reasons preg_match() can return false? I assume invalid regex would be one.
I was looking at creating an RFC to throw if the PCRE engine fails, but it does seem odd to throw for one reason, and return false for others.
 
5:33 PM
@Trowski Yes, invalid regex is another one.
 
@Trowski I'd need to look at the code....it appears to give warnings for invalid reged.
 
Honestly I'd rather just throw for any failure, but I doubt that would be accepted.
 
Warning: preg_match(): No ending delimiter '#' found in ...
 
@Trowski Throwing there should be something which should be done when a lot of functions can be converted to exceptions at once.
 
@Danack Right, and it probably returns false.
@kelunik That's actually what I'm thinking now.
 
5:35 PM
@Trowski At least a warning should be there in case it fails in PHP 7, you're talking about JIT stack limit, right?
 
@kelunik Yes.
 
@Trowski I think would be okay (for now) with just giving a non-exception error for the cases where the PCRE engine fails.....i) All non-insane people convert errors to exceptions ii) I can imagine some weird cases involving large chunks of text were it would be 'acceptable' for the code to continue if the regex fails to be executed.
 
@Danack Agreed. I haven't tried it, is a warning issued already in those cases?
 
Currently it returns false without any warning, right?
 
@Trowski No. it fails silently \o/
In totally unrelated news, I need to buy some booze.
 
5:37 PM
I think a warning would be appropriate. I don't think anyone would object to that.
 
Actually, I don't know any function that returns false for failure and doesn't issue a warning in such a case.
 
@Danack Are you planning on patching it to issue a warning then?
 
6:29 PM
how to create paypal mobile checkout using php
 
PHP CLI has stopped working, outch how can I debug this?
 
6:55 PM
I'm literally a few lines away from fixing at least 4 files
 
7:05 PM
Fix what?
Convert to PDO or something?
Wtf, why has everyone starred my message?
I was talking about a game.
 
resen
 
Morning again /me has eaten waaay too much
 
No not pdo
@TanMath IDK about that...
 
@PeeHaa /me has just ordered some pizza and salad - however I was helping chief in the kitchen (and grill) @ weekend for 10-12 people since friday so there was a lot to eat at the weekend :D
 
@hakre You know you are not supposed to eat everything yourself don't you ;-)
:D
 
7:19 PM
@PeeHaa I am currently having the same problem
I made my favorite "clay pot" dish and ate ALL of it
 
What was in said clay pot?
 
@PeeHaa yea, made about 3,5kg of noodle bake. Nice but gone within 36 hrs. ;D
 
We are all pigs :P
 
And we love it :P
 
:D
BTW @kelunik I am probably using trello wrong, but as a todo list it just works great :)
 
7:25 PM
@PeeHaa I use it only as todo list. ;-)
 
It's sooo useful. every time I think of something I can just write it down now and will be reminded of it every time I open it
So nice
 
@PeeHaa vegies, shrooms and sweet cream
oh and pile of spices
 
@tereško Do you have a picture?
 
maybe .. lemme check my phone
yes
 
Looks nice!
 
7:31 PM
I can understand that it's something you can't stop eating even if you're already full.
 
sometimes I can
 
Oh that looks delicious and I'm hungry :/
 
Yeah, fortunately, I just started to cook.
 
Just about to order asian food ;D
 
only thing "asian" about mine was the spices
 
7:43 PM
@PeeHaa Is your project's Trello board public?
 
Don't think so. (At least no on purpose)
I can give you access though
Can you access this trello.com/b/hDFzbI8z/codecollab ?
 
nope
 
Can you try again?
 
yep, works
 
\o/
 
7:48 PM
Haven't been online there for some time, some nice UI changes. :-)
 
Like? I don't think I have seen any chances, but I might have started too late to notice :)
Oh lol. Also I just noticed the "private" label on the board :P
Oh lol 2. And now I also noticed the archive button :D
 
Yeah, looks pretty good.
 
8:04 PM
@PeeHaa I know, I know :)
Problem is: Next grill will be on Tuesday.
I think tomorrow only fruits and lots of water.
 
@hakre :D
 
it would be so nice to have random_bits() in PHP 7 as well because it's so hard to calculate random bits with the entropy it's not about the size of an octet.
 
composer licenses is pretty nice, just checked all kelunik/chat deps, only MIT and BSD-3-Clause, amphp/mysql still needs a license @bwoebi
@hakre do you really need that?
 
@kelunik TIL
 
@PeeHaa same here, just had a look because of your card about defuse.
 
8:17 PM
:)
 
@kelunik I assume you're asking for a practical example, right?
 
@hakre yes
 
4
Q: Bitarithmetrics to Base X

hakreI've got the following theoretical problem which puzzles me a bit: I can obtain a string of n bytes (as octets, one byte = one octet = eight bits) of random data. I need to preserve the randomness while reducing the base from 256 to x where x is below 256 (and not 0, 1, 2, 4, 8, 16, 32, 64 or 12...

 
@hakre random_bits wouldn't help there, as you're searching for bases not being 1, 2, 4, 8, 16, ..., 128.
 
hmm...
 
8:23 PM
@hakre Generally the answer to that is "random is cheap, mistakes aren't, use rejection sampling"
 
@NikiC that's fine unless "rejection sampling" is the mistake.
 
Not much to do wrong when rejection sampling
 
I finally solved/fixed my issues on my own!
 
 
2 hours later…
Anonymous
10:32 PM
^ Simon says boogie boogie
 
@Abe I was going to try a new RFC, but later I got to the conclusion that it would require us to lex FQ names as a single token and that's a BC break - 3v4l.org/Wrndo - maybe for PHP8 :)
hmmm, this test shouldn't really be passing gist.github.com/marcioAlmada/0e7d080dd39826309bbe
 

« first day (1772 days earlier)      last day (3183 days later) »