« first day (1012 days earlier)      last day (4162 days later) » 

20:00
mb_convert_encoding($string, 'utf8', 'cp437');
try that
0
Q: Using eval in PHP

GlaucoI have a file "xxx.php" which has HTML and PHP code in it. When I use include("xxx.php"); it's fine and it works as expected. But I am developing a system where I cannot use include but I can use file_get_contents(). The problem is that if I do echo file_get_contents("xxx.php") it shows the enti...

BTW, code page 437 sounds like some blackops government program
Just sayin
or try CP850
You're the one who is answering it without telling OP to stop using evil() ;-)
php 5.6 should have evil() as alias for eval()
20:02
Actually, should be UTF-8
@teresko see the power of eval in the hands of a noob :)
In that case I also suggest to use mysqli_stmt::puke as an alias for mysqli_stmt::bind_param
@ircmaxell Boggled. If I use cp437, I get an "Illegal character encoding" error. 850, using utf8 as the source, turns it into "10 Nada Más.mp3". If I use "ASCII" as the source (which mb_detect` says it is), I get "10 Nada M?s.mp3"
So, I think this is the right track... just gotta figure out why php doesn't like cp437
it's not implemented
Balls
20:05
Code page 850 (also known as CP 850, IBM 00850, OEM 850, MS-DOS Latin 1) is a code page used under MS-DOS in Western Europe. It is the code page commonly used by the version of MS-DOS underlying Windows ME. English DOS systems also sometimes use code page 850, although code page 437 is generally the default on those. Systems largely replaced code page 850 with, firstly, Windows-1252 (often mislabeled as ISO-8859-1), and later with UCS-2, and finally with UTF-16 (the NT line was natively Unicode from the start, but issues of development tool support and compatibility with Windows 9x kept ...
that's wrong 0xa0 according to that article is the lowercase ascii
Jan
Jan
@tereško haha, now I understand :D which framework would you recommend?
@NikiC php-parser question. just tried to make a ternary with a null value for $else but it's not supported. I was able to fix it by changing the type hint from PHPParser_Node_Expr to PHPParser_Node and supplying new PHPParser_Node_Name('null'). but that probably breaks other stuff. any chance I could get a real fix?
@Jan for a noob - Silex. For semi-professional - Symfony2. Professional developers should be able to judge their requirements independently.
What do you call a service that's in charge of keeping shared state between several classes using it?
hmmm, it says CP850 here
20:10
In JavaScript you can do this: var test = var1 || var2; where test will be set equal to var2 when var1 is undefined. Is there a way you can do that in PHP with the same one-liner compact notation?
@ircmaxell What, mb_detect on exec/DOS output?
disable-functions should be a ini_setable.
The only way I know how to do it is to use if(isset() etc etc etc
neither
give me a few seconds, something looks weird
@Jan you might benefit from this list of links, to expand your understanding of OOP
20:11
Benjamin: bad idea in JS? I've seen some very well-regarded JS programmers use it
@tereško I'd say that silex imposes less structure and gives you more flexibility than sf2.
@ircmaxell check out chcp from DOS, too, out of curiosity. The host box is 437, Windows 8.
yeah, CP850 works
@BenjaminGruenbaum var data = data || {};
$string = hex2bin("3130204e616461204da0732e6d7033");

foreach (mb_list_encodings() as $type) {
    $test = mb_convert_encoding($string, "UTF-8", $type);
    if ($test === "10 Nada Más.mp3") {
        var_dump($type);
    }
}

var_dump(bin2hex(mb_convert_encoding($string, "UTF-8", "CP850")));
20:12
@tereško Yeah, there are use cases, but they are more and more scarce as I code more.
@igorw it also has less code, therefore is easier for a newbie to comprehend
string(5) "CP850"
string(32) "3130204e616461204dc3a1732e6d7033"
@tereško Yeah that's a great example
Nicholas Zakas uses it all the time from code of his I've seen
and 0xC3A1 is the correct converted code point: fileformat.info/info/unicode/char/00e1/index.htm
and he's one smart JS programmer
20:12
@rdlowrey I think I now know what I have done wrong. It just ran too often…
I'm not saying using || isn't idiomatic, but it can bite you in the ass.
user895378
@bwoebi So how frequently are you doing it now?
i use it in this context:
var exports = exports || {};
(function (globals) {
    // some lib
}(exports));
different languages, different idioms
20:14
@tereško yes. less structure means less new conventions to learn. but it also means less guidance, and having to come up with your own way of doing things. which may give newbies too much freedom.
@rdlowrey going to change and test now… I just figured out the cause
@igorw it also means less bad practices
uh huh
in JavaScript, 5 secs ago, by Neal
Anyone want to give me puzzles for: http://jsfiddle.net/maniator/XP9Qv/ ? ^_^
20:16
@igorw would you really want a newbie digging in symfony's routing mechanism ?
@tereško Why would you call them globals in the IIFE? Meh, not the point, if exports is somehow initially a value type doing exports || {} can really mess up with your code. I still use it sometime but I'd rather just typeof check often.
@igorw i know why it is made this way, you know why it is made this way , but a newbie will only see sparkling eval() everywhere
@PeeHaa umm....
What?
In the good case - it's null which means you get a type error. In the bad case it's a primitive which means it gets autoboxed, the properties get attached and then it gets unboxed.
@Neal Naggers?
Why would anybody flag that
???
Damn racists in here
20:17
@BenjaminGruenbaum LOL
@BenjaminGruenbaum what does it matter how i call it ?
@PeeHaa Yeah. Noggers really are annoying.
I got to add themes for the puzzles
@PeeHaa classic
right now you just have to guess lol
20:18
@rdlowrey what do you think is good for CPU? 1/3%?
How do you call a component whose purpose is to contain shared state across several other components?
(In programming, in general)
@BenjaminGruenbaum session? database? :|
user895378
@bwoebi That's fine. The only issue with the timers on socket acceptance is that you're forcing the cpu to wakeup constantly even if there's nothing for it to do :/
registry perhaps?
20:19
LOL
user895378
It's better if you can watch the socket without a timeout.
@BenjaminGruenbaum wonderbleh
@rdlowrey the CPU needs to check if there is something to do?
i actually use exports as name in the local scope too ... just changed it for sake of lessening the confusions
@rdlowrey But this problem, I suppose, you have too… you need to check in every tick() if there's something to write…
20:21
Honestly for the last couple of months I either use node or use RequireJS :/
user895378
@bwoebi Not for a server that isn't busy :)
@ircmaxell are you doing this from command line, yes?
@rdlowrey once you use it in production, you can assume it will always be busy…
@Chris yes
on OSX
heretic
user895378
20:24
@bwoebi True ... the other issue for you is the system select call. If you don't use libev or libevent to watch the sockets for activity you won't be able to handle more than a couple hundred simultaneous clients before things really slow down.
@rdlowrey hm. I'll try to open a few hundred sockets from my server to my server…
user895378
@bwoebi My experience is that I start to get failures around 200-300 sporadically and then the serious slowdown starts around 500.
user895378
Good luck trying to unleash ~20,000 at it without libevent/libev watching the sockets.
@rdlowrey that cookie corruption problem is a mess... Giving Artax a spin right now
time to pay the bills
20:27
my environment variables (php and mysql) don't work, am I doing something wrong?
user895378
@Ocramius lemme know if you run into issues or anything you don't expect.
@rdlowrey not on packagist? :P
1st stop :D
user895378
@Ocramius ugh, that's what I was complaining about the other day when I ranted about composer.
heh
could need that :P
user895378
20:28
Every time I try to add it to packagist it only shows up with v0.1.0
@DaveChen You need to press OK
user895378
But the current version is like 0.3.x
@rdlowrey you called?
@rdlowrey even forced refresh?
20:29
hahahah I like that xD (yeah I pressed okay and restarted the machine)
user895378
Okay, you guys are both here. I'm going to try again and take advantage of your captain planet powers combined if I can't make it work.
@rdlowrey rofl
0
Q: Convert string syntax of an array to an array

Mike OltmansI want to turn a string as it is literally into an array. Below is a more indepth explanation of my problem. If you have the below line of code: <input onclick="retrieve_data('[[\'site_users\', \'SELECT * FROM site_users WHERE id = 8\']]' 'site_users', '1','');"> Within here: retrieve_data(...

LOL
@ircmaxell So when I run that in the browser (no document, just dumping output), I get results like Nada MÂ s.mp3and the like. Close, but not correct. When I run the same script in CLI, I get Nada M s.mp3 for any legible encoding
I wanna screw with that guy's website
20:30
	foreach (mb_list_encodings() as $type) {
	    $test = mb_convert_encoding($r, "ASCII", $type);
		echo 'Type: '.$type."\n";
		echo 'Test: '.$test."\n";
	}
Using that script
Does that mean there's something wrong with the code pages?!
Damnit... why can't we just not play Spanish artists?
Stupid rest of the world that isn't America messing up my script!
@Chris Well, in the browser, are you setting the headers correctly?
user895378
@Ocramius + @igorw Okay: packagist (only shows v0.1.0), the composer.json (is it right? I don't know), and the github releases page which shows it at v0.3.6
that's why
your browser output is interpreted as ISO-8859-1
set the headers appropriately
@rdlowrey there's no composer.json in tagged version v0.3.6
user895378
@Chris For reals. Why doesn't everyone else just learn to speak American?!?!?
@rdlowrey happens :)
here, take my palm
are you able to tag a v0.3.7? =)
user895378
Yeah, one minute.
user895378
20:35
$ git tag -a v0.3.7 -m "Learned how to operate a computer"
there it is
@rdlowrey more like "fuck composer"
@rdlowrey for releases, btw, try github.com/weierophinney/changelog_generator
I find it very useful =D
user895378
Hey, I can admit when I'm wrong :)
20:37
@igorw Regarding github.com/composer/composer/issues/1761 basically there's no way to rename a project without composer borking out is there?
user895378
@Ocramius + @igorw I feel like I should be sentenced to a day walking around Manhattan with one of those sandwich boards reading "PHP Composer is my shining ★."
3
@ircmaxell Where's @PeeHaa?
@MadaraUchiha I have no idea. Am I his keeper?
@ircmaxell First one to said that... didn't end well :P
/me isn't the first one
20:41
@ircmaxell I wasn't basing my "still doesn't work" statement on the browser output alone, just noting the appearance of the output differed from console to page. file_exists is still not able to find the file, buuuut.... I am on the right track. Thank you very much for the help, sir.
@igorw Name isn't the right thing here, needs to be a node for a constant lookup
@NikiC ah, const. thanks!
I.e. new PHPParser_Node_Expr_ConstFetch(new PHPParser_Node_Name('null'))
@Chris you'd need to convert back to CP850 for the filesystem operation
... and now i'm ~300$ poorer
That's what got me on this track in the first place... filesize was trying to get "10 Nada M s.mp3" (per FS logs), which does not exist. So I dumped the output and noticed the encoding issue and went from there
All I wanted was a Pepsi, just one Pepsi
@tereško do you think it is ok for the view to have access to the request object sometimes? as long as the template does not
@rdlowrey how do I disable ssl peer verification?
this crappy site has an expired cert...
i am listing off categories on the left side of my page and if the user selected a category i need to expand under that category and show the sub categories of the selected category
and I do not know how else I would know which category the user selected
unless the view has access to the request in this case
@David not really, no
how would I work around this then though
ya know .. i dont care
20:49
Wow. I just got banned on both SO and meta
geeeeees
That is just nagging
@peehaa how did you manage that...
@Orangepill reference to both southpark and the wheel of fortune
@PeeHaa Huh?
@peehaa that is ban worthy?
@PeeHaa What do you mean? Banned?
20:50
in Tavern on the Meta on Meta Stack Overflow Chat, 24 mins ago, by TRiG
@PeeHaa An offensive joke does not magically become less offensive because it's a reference to an offensive TV show.
WTF
Apperently you can call people nazis on there but not reference a cartoon
... things that americans and muslims have in common
That was my first reaction... however....
in Tavern on the Meta on Meta Stack Overflow Chat, 23 mins ago, by PeeHaa
Let me guess. You're from the USA?
@rdlowrey I'm wondering why you you can with libevent manage a lot more connections? does libevent not have to do the select() syscall internally?
user895378
@bwoebi No it uses epoll/kqueue
user895378
@Ocramius one second.
20:52
if you use php anyways you should use a template engine, i.e. smarty and raintplultima_rat0 1 min ago
@MadaraUchiha :O
It's these sorts of comments that make me lose hope in the PHP community.
That's the equivalent of "How do I make an AJAX request in JavaScript?" "Irrelevant, you don't need to know, just use jQuery!"
user895378
$client->setOption('tlsOptions', ['verify_peer' => FALSE]); <-- @Ocramius
Come on.
I'm from the USA, and not a rube or a prude.
I find that insinuation offensive.
:p
20:53
@Chris you and your people :D
@peehaa I can understand if you referenced Taylor Swift .... that would be ban worthy.
@rdlowrey seems to do the trick, thx :)
@rdlowrey ah. hmmm
@Orangepill hehehehe
@PeeHaa Actually, that comment could have been considered offensive.
I didn't vote up the flag, but let's say that if it weren't you, I might just would have.
20:55
"My people" is kind of meaningless in the States. Every time I encounter someone who is really acting Euro-superior, I like to remind them that "we" are "you". America is the natural progression of Europe without the constraints of centuries of history and culture. This is Europeans Gone Wild over here. You look at us and should see yourselves, reflected back, not wearing pants. Don't like it? lol.
@MadaraUchiha That wasn't flagged
Reference to a cartoon or not
@PeeHaa The N.GGERS one
That one got you banned, did it not?
@MadaraUchiha That says more about the people who are offended than anything else
user895378
20:56
@Chris Every time Europeans get uppity about cultural superiority I just remind them that they can't even host a damn football match without racist chants breaking out.
@PeeHaa Fact is, enough people were offended to get you suspended.
Seriously, he got suspended?
That offends me.
@MadaraUchiha Actually no
It's either that your humor pushed it a bit too far, or that everyone else have a very weak sense of humor.
it was a single mod
20:57
I'd rather have PeeHaa than people who get all sweaty palmed over silly words
@PeeHaa Mods don't act on their own, remember?
@MadaraUchiha yes they do
user895378
@PeeHaa Don't feel bad -- I got a 30 minute chat ban once for assassinating the character of @Lusitanian's mother.
@rdlowrey Ow those were the times
@rdlowrey You stopped with her character, I went full anal and no one even noticed.
20:57
How is @Lusitanian's mother btw? Still hot?
@rdlowrey as in WoW ?
@peehaa now I gotta know what the comment was
user895378
@PeeHaa Don't know. I don't ever take off the paper bag.
6
@Orangepill 1 sec
Post it to a pastebin :p
20:58
Hmm
@rdlowrey artax fails on the same logic too >.<
user895378
@tereško No, as in calling her a prostitute of biblical proportions.
does this syntax work for a mysql update:
 UPDATE table T
			SET
				T.ITEM_ID = T2.ITEM_PARENT_ID,
				T.ITEM_TYPE = T2.ITEM_TYPE
			JOIN table2 T2
				ON T.ITEM_ID = T2.ITEM_ID
			WHERE T.ITEM_TYPE = 'IT'
user895378
@Ocramius What is it? What site?
@Orangepill "People that annoy me: N.GGERS"
meh, only pvt
20:59
@rdlowrey i have never really understood that phrase
ah, nvm, can't even tell at all :(
user895378
@tereško character assassination?
@MadaraUchiha Of course the answer is NAGGERS
20:59
no " ... of biblical proportions"

« first day (1012 days earlier)      last day (4162 days later) »