« first day (1123 days earlier)      last day (3839 days later) » 

7:00 PM
@SweetieBelle assembly? :)
 
@reikyoushin Originally Ruby, rewritten in D.
 
@LucasB An easy way to handle this, especially if you have a large number of possible product types (domains, hosting, animal-grooming) is to make an array of the product key names, and loop through that:
$itemCount   = 0;
$productKeys = ['domains', 'other', 'stuff'];
foreach ($productKeys as $productKey)
{
    if (!empty($_SESSION['cart'][$productKey]))
    {
        $itemCount += count($_SESSION['cart'][$productKey]);
    }
}
echo "You have {$itemCount} items in your cart.";
 
I see, so "foreach ($productKeys as $productKey)" makes each item of the $productKeys array an $productKey variable, then I can use it on the script, right?
 
@LucasB Yes, it'll iterate through $productKeys and on each iteration it'll contain the subsequent value; in this case 'domains', 'other' and 'stuff'
 
what would be an efficient way to parse the string "{wordone|wordtwo {wordthree|wordfour}}" into a 2d array in PHP?
expected result is array('wordone','wordtwo',array('wordthree','wordfour'));
 
7:06 PM
Basically what I was doing today :D
 
lol, I was just going to say "that question look familiar"
 
@codecowboy regex would be the quick and easy way, and explode the longer way.
 
@DanLugg It's not coincidence, man, they know, man.
 
@crypticツ care to elaborate?
 
7:10 PM
@DanLugg, with this new code it trows an unexpected '[' in
$productKeys = ['domains', 'other', 'stuff'];
 
@codecowboy when you mean 'elaborate' do mean you want me to give you the code to copy/paste?
 
@codecowboy Do you really need array, or you just want to spin the sentence?
 
hello guys, I have a guestion.
I have this [snippet](http://codepaste.net/ugcsiz) only 5 lines.
My problem is that the $name is null but from xdebug I can see the value of `$groups->attributes->name`. Any hint why is this happening?
 
@webarto spin the sentence? I prefer english...
 
Well, you're not getting any code, you're rude, man.
 
7:13 PM
@Christos Difficult to say what exactly is $allGroups? Do you have an var_dump() of it?
 
it is a multinested array
 
@webarto apologies, just dont know what spin the sentence means
 
@codecowboy You'll need to write a parser that keeps state if you have arbitrary depth.
 
No the depth is known an the same each time.
 
@codecowboy 3v4l.org/I6oHP#v5413 Take a look here, might help. At least with the regexp, then, you'd explode and push to array.
 
7:15 PM
the group, attributes are nested arrays
 
@webarto awesome. thanks :) will take a look
 
I found my solution codepaste.net/nh6hn9
thx! anyway!
 
@webarto is it better to use a WAF on http or https? because i have a dilemma >.<
 
@MadaraUchiha did you want a review?
 
Sure
Game's still on
 
7:28 PM
hello every body, am new to php can anyone tell me how can i detect the user language to set specific content based in this language. I have the following code

`<?php
$lc = "";
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
$lc = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
}
if($lc == "ru"){
//russian content goes here << THIS ONE WORKS FINE!
exit();
}
if($lc == "ar"){
//arabic content goes here << THIS ONE DOESN'T WORK!!!
exit();
}`

how can i detect if its Arabic Lanuguage? , Thanks
 
oh. TIL you need to wait 24 hours to award a bounty on an existing answer.
 
@DanLugg, you there?
 
@LucasB Yes sir.
 
Hey bro, that code you suggested is trowing an error, any ideas why?
$itemCount = 0;
$productKeys = ['domains', 'other', 'stuff'];
foreach ($productKeys as $productKey)
{
if (!empty($_SESSION['cart'][$productKey]))
{
$itemCount += count($_SESSION['cart'][$productKey]);
}
}
echo "You have {$itemCount} items in your cart.";
unexpected '[' on $productKeys
 
Copy-paste the exact error.
 
7:37 PM
Parse error: syntax error, unexpected '[' in /home/crweb/whmcsdata/templates_c/%%8E^8E3^8E3E8A8B%%header.tpl.php on line 108
It's a billing system called WHMCS
that's why the ugly url
 
Damn, I was gonna try to be clever, but there's too many damn syntax errors coming up in Google.
It's a syntax error because your version of PHP doesn't support the short array syntax.
[ ... ]
You'll need to use the older array( ... ) syntax; specifically, array('domains', 'other', 'stuff').
 
@LucasB Which PHP version do you use?
:-)
 
Until yesterday, I was running 5.4, now 5.5
You, I'm guessing, are using 5.3
 
I'm searching here in WHM
apparently 5
 
7:40 PM
Default PHP Version (.php files) 5
it only says "5"
 
PHP Version 5.3.23
 
@DanLugg: Isn't it array dereferencing?
 
yeah, no fancy [] support
 
@AmalMurali Isn't what array dereferencing?
 
7:42 PM
@AmalMurali no that's func()['index']
 
@AmalMurali no, in this case just the short syntax
 
^^ what they said ;-)
 
$foo = array(1, 2); vs $foo = [1, 2];
 
@DanLugg, Yeah! array('domains', 'other', 'stuff') worked!
Should I update PHP?
 
7:43 PM
@LucasB Yes.
 
yes
if you can
 
And if you can't, update it anyway.
 
check the documentation for the product first
 
it won't cause like, compatibility issues with past scripts?
I'll do a backup and do it lol
 
Sure could.
 
7:43 PM
make sure the new php versions are supported
 
@DanLugg: Never mind. :P I thought @LucasB was trying to use array dereferencing on a PHP version that doesn't support it. The syntax error looked similar..
 
@LucasB If the libraries you're using are well written, chances are, they'll be mostly fine even in worst cases. However, if you're using a clusterfuck like Wordpress, then good luck with the inevitable codesplosion.
 
@AmalMurali it would
 
I've retired wordpress
 
in both cases you have an [ at a position in your source the parser does not expect it
 
7:46 PM
gotta take a var_dump lol, brb
 
lol
Uncle Gordon knows whats best. — Simon _eQ Jul 31 at 12:26
:3
 
E_TO_MUCH_INFORMATION
 
wtf, ok so I ran composer against an empty vendors directory with the command composer install it downloaded and installed everything without an problems, immediately after it completed I ran it again and it updated two packages...really?
  - Removing leafo/lessphp (v0.3.9)
  - Installing leafo/lessphp (v0.4.0)
    Loading from cache

  - Removing piwik/piwik (2.0-b3)
  - Installing piwik/piwik (1.12)
    Loading from cache
I have a hard time believing that within those few minutes both those packages changed. Also not sure why it is removing the beta version of Piwik and installing the stable on the 2nd run.
 
@crypticツ did the project contain an composer.lock?
and did you run install or update the second time?
 
@ThomasWeinert the first run all it has was a composer.json with the packages I wanted. The 2nd run of the command it did contain the lock file. But still, even if it did, why would it choose different versions on each run? Piwik btw is not a dependency but a package I have required in my composer file.
 
8:00 PM
Is this seriously a good fit for SO: stackoverflow.com/review/reopen/3342346
 
composer install should act on an existing composer.lock, prefereing version from the lockfile
 
I have it set to install latest beta version if available, which it did install the latest beta Piwik on the first run, but then on second run using the exact same command and composer file it removed the beta and installed the stable, which goes against what the composer file specifies.
 
weird
 
@cheesemacfly No. Looks like it should be on apple.se
 
Just failed an audit on it :/
 
8:04 PM
sigh I should build some Arduino+Ratchet example, but I am feeling lazy
 
night
 
 
@BenjaminGruenbaum If I understood correctly, the message is basically: Try to separate state-storage to immutable value-objects. If so, agree. I tend to do things that way (performance constrains notwithstanding).
 
@NikiC Cool, thanks.
 
yes, you did
 
Anyone been to Cuba?
 
@webarto does Guantanamo count?
 
8:44 PM
does GitMo count?
 
I don't fancy 3m fence, blocking the view :P
@ircmaxell I was thinking more of a resort for non-potential-threat/terrorist-to-USA-almighty :P
 
lol
 
It's cheaper than Greece (I can go by car there), I've never traveled by plane. I want to fly away.
But I'm jobless now so it might be a better idea to save money :D
Jobless or terrorist? :P
weworkremotely.com It appears, that in fact, there are no jobs for !USA.
1.) You're in USA 2.) You know s 3.) You don't need to give a f
You're what they call, 1337.
So, anyone knows a good company? :D
 
> Some practices of Crip gang life generally include rapping, graffiti and substitutions and deletions of particular letters of the alphabet.
 
8:54 PM
@ircmaxell I think it's really funny, if only I could get it, can you explain? :)
 
lol
 
Hey
 
current mood:
 
Moving to imaginary /bin/video initiated
executing sleep(30); first
1 message moved to /bin/gif
 
I raise you :D
 
8:58 PM
1 message moved to bin Reason: looks not nice
 
wtf?
videos are fine. Gifs get binned because they take up CPU
 
@ircmaxell ah, didn't know that
I thought it'd be because they interrupt chat flow.
 
if a video is bad, sometimes we can bin it, especially if there's other conversation going on
it's all good
gauge the situation
if it looks like it's disrupting a convo, or is inappropriate, feel free to bin it
if there's not much "serious" going on, and it's not bad, then it's fine to leave it around
 
Okay
 
:-D
 
9:01 PM
It would be cool, if there's "mute" option...
jQuery!
 
@webarto there is, it's called "use another channel" :-P
 
@webarto yeah, ask in the JS room.
 
:D
#seriousbusiness
 
@webarto ever seen its gigantic whitelist? (room info -> access)
 
:-P
@bwoebi oh, and feel free to call me out if you disagree with me
to be fair, I didn't give you back owner right away, because I wanted to have this conversation first.
 
9:05 PM
:12905215 Luckily for you, you didn't go (South-)Eastern :)
 
@webarto I've been
 
Really, where? (If you don't mind me asking)
 
Stuttgart
 
I was thinking of Balkans, Russian satellites, etc :P
 
9:07 PM
Ohhhh
no, I want to though!
 
My casa es tua caza
 
Well, considering the thing from before, it may be some time
and I want to find a conference out that way to go
especially to Russia...
 
@ircmaxell well, I personally disagree, but you're right in a more general sense: It's me personally who doesn't like these videos on the internet/youtube. As I mostly see these videos as blatant shit (there are useful ones, but the most popular videos are of that genre). Dumb videos people just create to become popular. It just annoys me to click on a video and see then such dumb things.
 
@bwoebi What whitelist? (I'm maybe blind) :)
 
fair enough, but you could say the same thing about images, about most of the off-topic banter, etc
so I think it really comes down to where the line gets drawn
if in doubt, feel free to discuss
 
9:10 PM
@ircmaxell If it really just are words, I can ignore them easily; but the images and videos………
 
quite fair, let's discuss as a group next time @gordon and some of the other owners are around!
 
OR, make a websucket chat on php.net.so :P
#seriousbusiness
 
@ircmaxell that's not so easy to have them all online at the same time… timezones etc.
 
Sometimes, we all like funny images.
 
@bwoebi it happens often enough
 
9:13 PM
@ircmaxell well, I've seen Gordon lately more rarely…
 
well we'll ping him when some of the others are around. We'll talk about it
 
okay
 
or setup a side-room to discuss in side-channel
 
@bwoebi Thanks for crashing my browser :D
 
meta-php-room? :)
 
9:14 PM
@NikiC edzachery
 
@ircmaxell we already have that internals room, this one is enough^^
 
php.meta
 
@ircmaxell If you ever come, we can go drive Porsches all day :D
 
nice!
 
Having a millionaire friend is nice :P
 
9:16 PM
/me heads to the airport
 
:12905215 btw. why are people in my neighbour country weird?^^ (answer to chat.stackoverflow.com/messages/12905215/history)
 
lol, it's more of an ongoing joke.
 
@ircmaxell explain? :-)
 
and what country would you be from then?
 
err, what's the explicit write access for? (besides the one written there)
 
9:18 PM
@ircmaxell Luxembourg
 
@webarto Good that I always check where links point to before I click them…
 
@bwoebi Ah nice, a country I want to visit, but have not yet had the opportunity
 
@ircmaxell do you do something about bad bots in your blog? or how do you handle them?
 
I let google handle them
 
9:21 PM
I didn't get that with the taste and the flesh… I was this summer in NY, but didn't notice anything abnormal about flesh? :o
 
@ircmaxell i mean preventing scrapers, bad crawlers etc..
 
why do I want to prevent scrapers?
 
@ircmaxell you mean you just let them do whatever they want and let google decide?
@ircmaxell those that copy content and such.. not the legit search crawlers..
 
@bwoebi I noticed some weird things on TV, which kind of re-enforced it
@reikyoushin whatever, let them. unless it's someone big doing it I don't really care
 
@ircmaxell some weird things is not very explicative
 
9:23 PM
@bwoebi most are things not discussed in polite society ;-)
 
@ircmaxell then switch the channel… lol.
 
@reikyoushin there's a site in russia that keeps translating my content. I'm fine with it, because I get a crap load of traffic from it
 
BDSM pr0n?
 
weirder
 
@ircmaxell what did you watch (which channel)?
 
9:24 PM
not going there
 
@ircmaxell because i have this dilemma, i use a free cdn/waf but it does not support ssl/tls on the free account.. now if i want to use https, i will need to disable the waf and expose my self to lots of bad bots as said in the waf's dashboard logs..
 
Oh, come'on now. You can't tickle curiosity like that!
 
animal pr0n is next, which is really weird..
#idonotapprove
cnet.com.au/create-instagram-like-photos-with-php-339334978.htm my tutorial, @ircmaxell thanks for reminding me that I actually wrote something in my life :P
 
you guys speaking of pron made me remember this site
 
@ircmaxell well, you confused me more than you told me anything :-)
 
9:27 PM
On the topic of inappropriate matter, someone posted a link to the whole C++ lounge kerfuffle earlier. I revisited it and noticed mention of the content that started the whole thing. Did a bit of reading. I am very disgusted.
 
@reikyoushin :D
 
I've lost half a day somewhere ...
 
@JoeWatkins Check under your bed. I always lose shit under it.
 
I can't trace my whereabouts for the last 6 hours
 
Are you drunk?
 
9:28 PM
I guess I might have been asleep
no
 
Use debugger :D
 
does nobody else use their own WAF here in room 11?
 
@reikyoushin Sorry, what's WAF? :)
 
@webarto use explain.so
 
Wife Acceptance Factor, Wife Approval Factor, or Wife Appeal Factor (WAF), are design elements that increase the likelihood a wife will approve the purchase of expensive consumer electronics products such as high-fidelity loudspeakers, home theater systems and personal computers. Stylish, compact, unobtrusive forms and appealing colors are commonly considered WAF. The term is a tongue-in-cheek play on electronics jargon such as "form factor" and "power factor" and derives from the gender stereotype that men are predisposed to appreciate gadgetry and performance criteria whereas women must b...
 
Factor is too low :D
 
@webarto lol, suddenly everything costs twice as much.
 
@reikyoushin Not really, I just implement some basic "hacking" protection, and write mostly secure apps. It's pretty tight already, DDoS or server weakness is out of my league.
 
@JoeWatkins 6 hours ago you were still committing to phpdbg…
 
yeah bout 5 hours ago github says
I fell asleep I think
 
9:34 PM
LinkedIn is crappiest high traffic website. There, I've said it.
Notifications come after 2 days. Right in time.
 
@webarto because i'm using this now.. so bots wouldn't take my bandwidth (i have a limited hosting account for personal use only, so it has low bandwidth limits).. but using this would mean i couldn't use https.. so either i turn the WAF off or i don't use https.. what do you think?
 
@JoeWatkins Yes, dude, you've overflowed.
 
@JoeWatkins go sleep again, your day-night rhythm needs repair…
 
I woke up few hours ago (10pm here), but I'm unemployed :D
 
@webarto that's no excuse!
 
9:37 PM
@reikyoushin For $15 (a year) you can get RamNode with 500GB traffic, so, you shouldn't worry about that :)
 
yeah time is bit broken
 
@webarto my hosting only costs me $3 a month :P and i dont need a vps (yet), so i am still squeezing everything i can with this..
 
@JoeWatkins you want to fix time? make day start at noon :-D and we'd work forever in the dark time :-)
 
@bwoebi lately I have given up on circadian rhythm
 
ooooh they are quite cheap, bookmarked ...
 
9:38 PM
I run a (databased) website on that hosting with 100 visitors every minute, no lag whatsoever.
 
no servers from ovh in months now ...
 
@tereško what's your rhythm now?
 
~30h
 
20h awake, 10h sleeping?
 
something like that , yes
 
9:40 PM
I was once like @tereško, but then I started not being a zombie :D
 
@tereško It's nice to not be time-bound…
 
@webarto on that 128mb vps?
 
@reikyoushin Yup, also, a big forum (have that account too).
I have a big-ass server on Hetzner.de, but didn't want to put other sites on it, so I bought these small ones.
 
@webarto yet no admin panel.. right? you have a bare web server there?
 
Hetzner FTW
@reikyoushin Well, you have a server control panel (reinstall/reboot), but you're SSH'ed most of the time. No cPanel and such.
 
9:44 PM
@webarto :-D
 
good night.
 
@webarto that's my prob.. i don't know how to secure such servers..
 
gn
@reikyoushin They're already secure ;)
 
@bwoebi g'nyt!
 
@reikyoushin in this chat I learn all day new abbreviations…
 
9:46 PM
Not sure what to think of this: en.reddit.com/r/PHP/comments/1qe19b/…
 
@webarto eh? but.. aren't you the one setting apache, db and stuff? like who can remote on the db, who only has access and everything..
that's my prob t'was why i'm not into VPSs yet
 
@ircmaxell that's maybe what I told you yesterday as feedback…
 
i took 1 month on one of the hosts from lowendbox but only to experiment..
 
@reikyoushin It's apt-get install apache2 php5 mysql etc, and it's done :) Packages are already configured to be safe, you are not compiling.
 
read up the thread
out of context, I get it, in context, I don't
from there down
 
9:48 PM
@webarto there's securing ssh and not allowing root too.. and a lot of things i haven't done yet
 
@reikyoushin Quick google search would tell you how to do that in few commands. Just do it, help yourself :)
If you have another computer, install Debian from USB stick, play with it.
It'll all make sense and you'll never look back.
FREE YOURSELF
Florence + Machine FTW
 
yes
I need to go... I need to walk or something
it's been a rollercoaster of a day...
 
@ircmaxell Don't forget your jacket
it's freezing cold outside :p
 
I...
 
Good luck, mate.
 
9:55 PM
It's not what's going to happen that bothers me
it's the not having control that bothers me. And it's timed quite nicely with other "issues" going on in my life right now. Or not issues, but "complex situations"
 
Well, it's always like that... It happened to me now, it happened last year too, and year before...
 
the thing itself is fine
seriously, I've got other offers
 
Of course you have :)
 
it's literally everything except my home is changing at the same time
 
Silicone Valley? :)
 
9:58 PM
no, I'm not leaving NYC
at least for any length of time
 
Sorry, misread your message.
 
what I meant is everything except where I live is changing at the same time. Which is turbulant. Any one by itself would be tolerable and "easy" or "fun". together, it's just uphevial
 
Well, I sort of get it... Currently I'm living in moldy apartment and I pay rent, I left my recently pimped apartment, in pursue of college degree, I lost my job in the process, and still have almost a year to payoff. And I'm in Bosnia, there is no job whatsoever.
So guys, whenever you bitch around how you're not satisfied in 1st world countries, remember me, saying that you suck :)
 
@ircmaxell ... your gender is changing? o.0
 
no
 
10:02 PM
lol
 
shut up, you know what I meant
 
lol, I know.
 
@ircmaxell You did say literally
 
On the other hand, Florence Welch is a man.
 
shut it :-P
 
10:03 PM
cv-pls: Meaning/Docs, Backlog (mirror) | Addons: [cv-pls] (Chrome/Firefox), PHP Manual Linkifier | Snippets: ext/mysql | Reference: Errors, Operators
7
 
@webarto what now?
 
He sings great.
Can someone help me style this, please :)
 
@ircmaxell So I assume your job is changing, then? Any hints on the new gig?
 
(good thing @bwoebi is not here, he'd bin it) :P
 
@LeviMorrison no new gig. And nothing official, but many signs point in a single direction. I will find out tomorrow at 2pm
 
10:05 PM
Let us know :)
We're family, hehe.
 
@webarto "Joel" doesn't look that professional for a President. Do you have control over his picture?
lol
 
@LeviMorrison Joel is awesome :) Too bad he fired me, haha.
Really good developer.
But he's not doing it anymore, who would when you can hire someone from Bosnia for $40k a year :)
I was only PHP developer, along with 10 Ruby devs, and I was just not paying off anymore, basically, "my work here is done". So I didn't want to say long goodbyes and just left.
 
although I did have a phone interview today that I thought went really well
 
Hope they buy you a Porsche for welcome :)
I wonder guys, you are all creme de la creme, what's beyond that?
I might be short sighted.
 
@webarto is debian lighter than centos or ubuntu?
 
10:13 PM
I can't process that companies like Facebook higher some noobs (college grads) and you can't get a job there by just applying.
@reikyoushin Beats me :) You shouldn't worry about that IMHO.
 
@webarto 40k a year is much more than the salaries of average devs here in PH T-T
 
creme de la creme? nah. There is always up
 
@reikyoushin That's 6 average salaries per month, in my country, I know, but at the same time someone is getting triple for the same work :)
 
@webarto is 128mb really enough?
 
Depends, but I'd say yes. What's the website in question?
 
10:16 PM
@webarto even without the optimizations and stuff?
 
Install opcode cache (5.5 already has it), and you're good. Cache DB results if you can.
Again, I have 100 visits per minute, runs without flickering. But it's "optimized".
 
2-5 blogs, 2-5 main sites, it would work as my private git repo too..
 
It's fine IMHO.
 
i took my surname's domain so i am expecting i'll be setting up my family's sites if they need it..
like name1.surname.com , name2.surname.com, name3.surname.com and such..
 
@ircmaxell Ok, but at least in top 1% overall? :)
 
10:19 PM
@webarto nah, perception bias
 
@webarto for 6gb this is cheap, but i dunno if the provider can be relied upon.. and i dunno if i need 6gb anyway :P
 
0
A: APC User-Cache suitable for high load environments?

Joe WatkinsLesson 1: https://www.kernel.org/doc/Documentation/spinlocks.txt The single spin-lock primitives above are by no means the only ones. They are the most safe ones, and the ones that work under all circumstances, but partly because they are safe they are also fairly slow. They are slower ...

I hate when ppl say "but facebook said _____"
 
@reikyoushin Yeah, that's even cheaper, don't worry, go for it :)
@JoeWatkins why don't you work at Facebook? :)
 
eih
 
10:39 PM
Add company logos? webarto.com
Gawd, how I don't regret writing mainstream tutorials.
I wanted to say, it's because you suck, but that'll look bad coming from author :D
 
#فͤ҈ͥ҉ͦ҈ͧ҉ͨ҈ͩ҉ͪ҈ͫ҉ͬ҈ͭ҉ͮ҈ͯ҉ͨ҈ͬ҉ͧ҈ͣ҉ͨ҈ͧ҉ͯ҈ͮ҉ͭ҈ͤ҉ͦ҈ͥ҉ͧ҈ͩ҉ͭ҈ͨ҉ͣ҈ͪ҉ͧ҈ͭ҉ͩ҈ͤ҉ͮ҈ͯ҉ͬ҈ͭ҉ͦ҈ͨ҉ͥ҈ͯ҉ͧ҈ͫ҉ͭ҈ͯ҉ͦ҈ͥ҉ͧ҈ͩ҉ͭ҈ͨ҉ͣ҈ͪ҉ͧ҈ͭ҉ͩ҈ͤ҉ͮ҈ͯ҉ͧ҈ͣ҉ͨ҈ͧ҉ͯ҈ͮ҉ͭ҈ͤ҉ͭ҈
@ircmaxell Noob.
 
hello?
 

« first day (1123 days earlier)      last day (3839 days later) »