« first day (1695 days earlier)      last day (3269 days later) » 
00:00 - 21:0021:00 - 00:00

12:28 AM
hey guys. is this ternary operator correct $x = ( 2== 2) and 43; //x = 43
and if $x = (2==3) and 43; //x = undefinied variable?
 
Anonymous
12:43 AM
bad idea choosing to watch The Babadook at 2:00 am.
 
Anonymous
good idea closing it at 2:43 am
 
@this.Tony is this the operator and? Anyway $x will be a boolean in both cases.
 
$x would equal 43 on the first line?
@Rangad
 
No $x should be (bool)true
 
ok yeah
can you explain why @Rangad
it will equal boolean
 
12:51 AM
Because logical operators are defined to always evaluate to a boolean value in php
 
@this.Tony The and operator has a stupidly low precedence, lower than the assignment (aka =) - php.net/manual/en/language.operators.precedence.php
But I don't get undefined variable for that code - 3v4l.org/iIHRm
 
Well, the code above should equal to ($x = (2 == 3)) and 43; which equals to $x = 2 == 3; (short circuit), right?
 
I <3 php
 
yea sort circuit
0
Q: Ternary Operators. Possible for a one sided action?

BenetoI've used ternary operators for a while and was wondering if there was a method to let say call a function without the else clause. Example: if(isset($foo)){ callFunction(); }else{ } Now obviously we can leave out the else to make: if(isset($foo)){ callFunction(); } Now for a terna...

so i want to set a variable with data this method would be better?
$var = ($var2 = $var2) ? "this" : "that";
 
$var2 = $var2 ? Typo?
 
1:06 AM
no its basically (true) thats what i should have put
 
If you know the value is true - just write $var = "this";.
 
so would that be a better method than a short circuit?
yeah sorry about that
 
what short circuit?
 
Or you could give an actual example of your code.....
 
(count_query("SELECT * FROM table", [], $conn) == 1 ) and $blah_color = "style='opacity: 1;'"; so basically im setting a variable within the short circuit if there is 1 row returned
is this better than if i did
$blah_color = (count_query("SELECT * FROM table", [], $conn) == 1 ) and "style='opacity: 1;'";
 
1:12 AM
Just use an if statement?
$count = count_query("SELECT * FROM table", [], $conn);
if ($count == 1) {
    $blah_color = "style='opacity: 1;'";
}
 
i had that before
i want to simplify that
to a ternary operator i just would like to know what is better for a ternary
 
there's nothing wrong with the if
 
i know i like if's but i want to be able to have simple code within a line i know i can do
if ($count == 1) { $blah_color = "style='opacity: 1;'"; } but most of alll ternarys are within a line so i want to move onto a ternary .. get me?
(count_query("SELECT * FROM table", [], $conn) == 1 ) and $blah_color = "style='opacity: 1;'";
would this be ok?
 
Yes, I get you. You're a little bit insane.
 
i shouldnt run into any problems with that line of code?
i like simple, sorry.
 
1:16 AM
Apart from being fired from your job, no.
 
LMAO
ok thanks man
 
1:48 AM
Hey Guys/Gals, Having an issue with some php code. Trying to make a upload page, where a user is able to upload an image. The code looks like this: http://pastebin.com/rGxt9gmy The error I get is this. http://pastebin.com/NK7Tmeny
Been thumping my head for past few hours. Any1 able to assist me?
 
2:01 AM
Hi, am facing issues with my solved query, stackoverflow.com/questions/30492387/…, How do I run a running sum balance when I use pagination?
 
Hi guys
@JoeM still have an issue ?
@JoeM I havn't tested it yet, but a user here have shared this repo with us a couple of days ago, and it look really robust :) github.com/samayo/bulletproof#fork-destination-box
 
2:59 AM
how to solve this problem $a = array(); array_push($a,$temp); it showes error $a is null but i have to start this array to be null
 
array_push first arguments must be what you want to push, and the second arguments in what you want to push it
I think you mixed them
 
Yes..
humm sorry
 
here my first one is array and second is value
 
it was me who misread it lol
 
3:02 AM
ok but how to overcome to this problem. because here it show an error like array must not be null
 
@santosh do you have a piece of code to show what happen ?
 
in my $temp i have taking data dynamically using for loop trying to make an array
push will work if my $a which is an array with some values in it then it will definitely work but i initially i dont have values to insert in it.
 
@santosh it should work...
 
@JonathanLafleur thanks, initially i have declared the variable as $a later i have changed to $all but not changed in array_push so that only it failed thanks once again
 
no problem :) @santosh have a great time
 
 
2 hours later…
5:26 AM
Hi, anyone there?
 
hi
 
6:32 AM
am new to php. why php dev career is vulnerable? Firstly, Is this true?
-1
Q: Am I failed in life by choosing PHP development as a career?

0____________0Am I failed in life by choosing PHP development as a career ? See, I have work experience in PHP of total 2 years. I got recruited thru campus interview by my company. I was in 8 people selected out of 467 students. Then my company assigned my PHP(core OOP php, frameworks,REST api,wordpress,mag...

3
 
6:48 AM
Could be symfony2 composer a composer for Laravel projects?
 
@overexchange yes, it is true
@JavaFan what is a symfony composer?
 
It's a composer.phar file
I am Newbie
so my conception might be totally wrong
 
@JavaFan in that case, you mean getcomposer.org
it's the default package manager for the php language
you can use it for laravel, too
 
okay
@Gordon have you idea about phpstorm?
 
7:15 AM
@JavaFan yes, use it.
 
It 's built with some symfony2 packages?
 
@JavaFan it has framework support for sf2, yes
there is also an external plugin which enhances the framework support
the latter is more useful to me than the native support
because it offers autocomplete for the DI container and services
 
okay, but I tend to use Laravel because it's easy syntax!
 
laravel is cool and easy
 
7:24 AM
@NullPoiиteя On other side Symfony has much largerer community I don't know the reason.
@Gordon thank you for the link
 
7:36 AM
@JavaFan PHPstrome is best ide for every php related development
 
yes really
@NullPoiиteя I don't need to specify debugger in PHPstrome true?
there is Zend dubgger with it 's port should I change the port if I work with Xampp?
 
Morning
 
morning
 
morning
 
9:15 AM
Anyone there?
 
Yup
Anyone here using PHPfiddle could tell me how to delete files from the codespace plz
Cant find the option
 
@NullPoiиteя how hard can it be spelling PHPStorm right? :D 1 2 3 4 5

spell checker

May 9 at 17:32, 3 minutes total – 3 messages, 3 users, 3 stars

Bookmarked 20 secs ago by Worf

 
hehehe
 
In phpstorm why I must download PHP xdebug
 
:P
 
9:28 AM
Can anyone help me to send mail from windows ?
I have installed wampserver-2.1 , put sendmail in C:\wamp\bin\sendmail\sendmail.exe
 
why that? use your provider's smtp?
 
I am trying to send through gmail account
@Worf ^
Has anyone sent email through smtp.gmail.com using php mail on windows?
 
i did
 
@Worf, Can you pastebin the configuration of sendmail.ini and php.ini ?
 
you don't need sendmail
get swiftmailer
 
9:41 AM
Did you use swiftmailer to send emails using php mail on windows?
 
yes
 
can you pastebin configurations of php.ini and other configuration files?
 
you don't need to change anything in php.ini
just google "swiftmailer gmail smtp" and you will get a bunch of results
 
hello all, can anybody help regarding mysql. actually i have table in which i have index_id, name, address, and some colomes but know i want to update my name colomn to name,indexid in whole table and table may contain 3000 rows so how to do it
 
@santosh alter MySQL table name?
 
9:53 AM
@Worf, What's wrong with php mail function?
 
@santosh or copy column?
 
Has anyone sent email through php mail on windows(wamp installed here) ?
 
@PeeHaa working on something new? :D what happened to dreddr? :P
 
@Worf It's still on the list. I need to finish my website first
 
cool, is it responsive? :D
 
10:07 AM
@Worf I use some theme so yes :P
 
lol
noob!
 
Yeap :)
 
@Worf, can you help me to fix this problem ?
I would not use swiftmailer or other mail library
But i want to use wamp, sendmail and php mail
 
and reason is? planetary alignment?
 
@shibly Mailing without a library is hard. Mailing using fake sendmail on windows is insane imo
 
10:17 AM
@PeeHaa, which library do/did you use?
 
Hey Guys/Gals, Having an issue with some php code. Trying to make a upload page, where a user is able to upload an image. The code looks like this: http://pastebin.com/rGxt9gmy The error I get is this. http://pastebin.com/NK7Tmeny
Been thumping my head for past few hours. Any1 able to assist me? (sorry for a repost, I fell asleep!)
 
@shibly swift
 
ever happened to you that you have so many things to do that you don't even have the idea from where to start?
 
All the time
 
my god
 
10:28 AM
morning guys :)
i have task to make scheduling system
we have different venue and each venue (work place) have their own operating timing (week days - start and close)
and then we have people who are working
we know when the worker(people) are available to work which week day and what time
any good idea about the database design to store these monday - sunday (start - end) timing
and automatically generate rota
anyone?
 
Anoyne here can confirm it's impossible to delete Files in PHPFiddle.org
 
@Gordon thanks mate :) appreciated
 
just because I gave you a link doesnt mean you are supposed to show me your sql queries
 
@Gordon i mean what you think
about this sql?
 
Hello, anyone here worked with PHPMailer? I have a simple question: On their github page they suggest that you read the SMTP transcript, how could I do this? (debug is set to 2)
Do I need to use a tool like Ethereal?
 
10:58 AM
@Warosaurus it is easy $mail->SMTPDebug = 3;
no just enable this line
and see output buffer
 
How can I read the output buffer?
 
you can increase level of SMTPDebug to 4 -5 to get more in depth log
just i meant enable the lines
you will automatically see
 
Will it echo out the result?
 
@Warosaurus yes it will
just give it a go
you will see
 
Thanks so much! :D
 
11:01 AM
i wrote the driver class over the php mailer class
so i can get the settings and easily send the email without fill implementation every time
in client code
 
@FaizRasool i think you should read the paper I linked you to.
 
Talk about doing things by hand :?
 
@Gordon i know but i found another legacy code which i did 2 year ago
client is just talking about timing every shit time
so have to complete it
this sql was from legacy code
now working on presentation layer
 
Is it normal for PHPMailer to try to connect to your local computer? This is the line: Connection: opening to 127.0.53.53:587
 
it would be 127.0.0.1
if you are using local host
i'm not sure about port
check if your smtp server is running
ping this ip
 
11:16 AM
I don't have an SMTP server, I'm trying to use Google, is the problem that it's resolving smtp.google.com as 127.0.0.1?
 
yes it is
 
Oh okay.. Thanks again :)
 
127.0.0.1 is not google smtp server ip address
check your host file in computer
might be you are over riding it
 
@FaizRasool You're exactly right, I set up a local DNS server sometime ago just to see how it would work, it failed miserably.. :/
 
Faizs-Mac-Book-2:~ faizrasool$ traceroute smtp.gmail.com
traceroute: Warning: smtp.gmail.com has multiple addresses; using 64.233.166.108
traceroute to gmail-smtp-msa.l.google.com (64.233.166.108), 64 hops max, 52 byte packets
1 192.168.1.254 (192.168.1.254) 24.092 ms 1.814 ms 1.740 ms
2 *
it is smtp.gmail.com
not smtp.google.com
and you will resolve to 64.233.166.108
 
11:21 AM
Oh goodness.. Yeah that was an oversight
 
Hello, anyone knows how to use share buttons on iframe object?
I tried googling for hours but seems impossible to find anything related
 
simone only way you can do that is using proxy
if it exits on the cross domain
 
yes
 
@Simone get the page using get_file_content
or similar command google it
and then get that page which is printing the get file content
that would be local and in domain
and you can apply jQuery logic
 
@FaizRasool Thank you so much, everything is up and running now.
 
11:26 AM
@Warosaurus i'm grateful
 
@FaizRasool thanks, just another question...is it possible to use iframe and change url for ajax pages inside the iframe?
 
@simone yes you can
 
@FaizRasool do you know any guide to work around?
 
like the variable you will get for example $file = file_get_contents('www.google.com');
now file has all html of that page
now pregmatch
or apply jquery at the bottom
echo $file;
echo <<<: $("#geturlhere").val("changevalue") <<<;
arrange it
it is just rough draft
 
@FaizRasool got it! Thank you very much
 
11:31 AM
@Simone welcome mate
 
:)
 
 
2 hours later…
1:22 PM
@FaizRasool emm .. what is "jquery logic" ?
 
1:45 PM
@tereško i meant just apply some jQuery to elements
if required
 
2:04 PM
Hello Teresko!
@tereško Yesterday I thought about you...I was reading Schopenhauer
@FaizRasool I'm not able to set proxy for the purpose
is there any questions here around that could help?
 
@Worf lol :p It supposed to be misspelled ;)
 
ok @NullBoileя
and anyway, if you want to distort the name, you should be calling it poopstorm
which is just epiclolrofl
 
@FaizRasool in the meaning that I can find only results for security policy, and it's not my purpose
 
2:22 PM
@Simone you will have to elaborate
 
@tereško I thought that iframe could help me alot...I was wrong, completely wrong
 
.. and now I am confused
 
why using iframe if there is no communication between the main window and the iframe window?
 
wat
 
@Worf for example if you have ajax in the iframe you cannot use it, since in the main window the url still the same when you navigate through the iframe.
or if you have share buttons inside the iframe...are all referred to the iframe, not the parent window
I tried googling for hours but I can't find anything related...it seems impossible to me
 
2:40 PM
rule of thumb is: don't use iframes
it's never the right answer
 
@tereško But what would you do if for job you had to join a wordpress site to a php script?
 
make a wp plugin to act as a bridge
 
Man, driving on the autobahn is quite challenging
Have to keep slaming on the brakes for someone who doesn't know how to use a mirror...
@tereško the dirty things you can do tho
 
Have you considered that they know how to use a mirror, they're just jerks who rely upon you slamming on your brakes? Maybe you should try not slamming on the brakes one time to teach them a lesson =D
 
Ummm
 
2:52 PM
@ircmaxell it's kinda the same as with "goto" and "eval"
there is a really tiny and highly specific usecase ... and the rest of it is pure abuse
 
@ircmaxell In Germany?
 
@Simone what is the problem
 
@bwoebi yup, about 30 km outside of Berlin right now.
 
so, how it goes in Germany?
 
@FaizRasool apparently use iframe is the wrong thing to do...what do you think? For job I need to join a wordpress site to a php script
 
2:57 PM
So far so good. Taking a break for 10-15, drove 4.5 hours straight. Many of which at near top speed
 
@ircmaxell Also… whether you have to slam the brakes depends on how fast you are …^^
 
@tereško I used iframe because I don't want enter inside wordpress terrible mechanism :)
 
@ircmaxell top speed means?
 
@ircmaxell When I'm driving on routes with speed limits (unlike Germany) I have to hit the brakes much more rarely… (because I'm not that fast and relative speeds are not that important)
 
@Gordon over 180 kph
 
3:00 PM
@ircmaxell I usually dont go over the recommended 130 and rarely drive left, so little use of the brakes for me
 
@ircmaxell yeah, no wonder. Then don't complain ;-D
 
@bwoebi hey, would be fine if people kept to the right if not passing...
What can I say, I like to drive fast...
 
given the speed limit on american highways I can totally understand that :)
 
@ircmaxell me too ;-) Driving usually between 170 and 185 km/h in Germany…
 
@bwoebi you should try in Italy...there are so many holes
 
3:06 PM
@Simone you mean routes in bad condition?
 
@bwoebi yes :) we are forced to go under 130 km / h
 
Peaked at just over 220 kph (not sure of peak number, was paying attention to road)
@Simone the Italian roads I drove weren't horrible. Not great, but come drive by me in the US sometime :-)
Now, the swiss roads were amazing
 
@ircmaxell it would be too good!
 
Esp the mountain passes ;-)
 
@ircmaxell I wish my car would go that fast at all, haha… Fastest I had is around 205-210 km/h downhill…
 
3:09 PM
I think America is the dream for everyone...for many things
 
@bwoebi my fastest ever was 240kph, in a BMW 5 series
 
@Simone … and also for many things not.
 
ahahahahhaha
 
@ircmaxell not bad.
 
@bwoebi you're just as well in Germany
 
3:10 PM
I grew too responsible for going fast over long distances
sure, it's more fun but it's also more gas, more risk, more stress
 
@Gordon agree...especially for long journeys
 
@Gordon mosly I am doing these in short ribs. I will maintain 170kph if conditions permit, but not over 200...
 
@Gordon sometimes I get the feel that I pay better attention to the route when driving 160 than 130…
 
Short runs
 
@ircmaxell agree. Going 190 all the time is just too fast. When nobody is on the route, okay. But not usually.
 
3:13 PM
OK, off to check out Potsdam
 
okay, have fun :-)
 
@ircmaxell yeah, short runs are fine
take care
 
@ircmaxell have fun!
 
3:46 PM
@Simone one problem you would have if words press is using relative url
you would have problem because the site will try to load from local domain then original
if you manage to get the jQuery on the page and force the url to be full site url
it will work
 
Anonymous
words press :)
 
@Simone i will give you my template for proxy
wait
@Simone
public function ProxyAction(){
    //load jquery first
    echo $load = '<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>';
    //load the webpage
    echo $file =  file_get_contents("http://www.bbc.co.uk/iplayer/a-z/g");
    //custom script over ride
    echo $customjquery = '<script>$("#orb-header").html("modifed");</script>';
}
i'm using framework thats why i'm using proxy Action you dont have to use this
see the bbc page now
 
4:41 PM
Hi guys!
 
I made few new files in phpstorm and commit them in git, pulled from origin and they disappeared in merge conflict. Anybody has idea how to return them?
 
"they disappeared in merge conflict." - merge conflicts wouldn't do that. What commands did you actually run?
 
I'm not sure what actually happened
 
I usually SourceTree as a GUI for git, so that I can see what is happening with files.
 
History in terminal:
git status
git add .
git commit -m "Init JS files & ctl"
git pull --rebase && git push
i'm using gitg, those files aren't mentioned anywhere
 
4:48 PM
ctl? what does ctl mean? cthulu?
 
@Stol3x What do you think/imagine git add . does?
 
@Gordon does it really matters? ctl as controller
@Danack Stages all files?!
 
@Stol3x it doesnt matter for your problem at hand, but it matters for readability for everyone else
 
Is there any cache or history where from I can revert them? Or anything?
I forgot to mention, only half files are missing, not all. What the
 
Can I get ReflectionClass from last created in Auryn?
OK, stupid question ^
 
5:02 PM
@Stol3x can you see the files when you do a git reflog -all
 
@Gordon yes, commit seems to be there
 
@Stol3x if you can see the commit with those files in it, you can recover it. I forgot the details though
I only had to do that once myself
 
@Gordon I think you saved my day :) Thank you
@Gordon do you want beer or something? :)
 
5:30 PM
@FaizRasool wow, thanks for your support...I thought the solution with "file_get_contents" was something to avoid for security reason and for loading time
 
@Simone there is no security issue as long as the page you are redirecting generating flat html
 
6:02 PM
This is happening: http://t.co/s1zNhqXzWX
This talk is REALLY happening. http://t.co/UxVkeBGBAI
 
doesn't work for me
it either needs flash or jre
 
@Stol3x nah, thanks :)
 
6:25 PM
I want to create a custom search feature for a website that doesn't use any CMS? How should I start with this?
 
7:01 PM
looks like a bug but not sure
 
@Worf Which of it?
 
date("Y-m-d", strtotime('monday this week')) returns monday of next week even if timezone is set correctly any ideas?
 
@NikiC no idea. does the unset() use the iterator's offsetUnset, or the arrayobject's offsetUnset ?
 
Currently is still a sunday in my Timezone
 
i presume the latter
 
7:09 PM
@VeeeneX When you say next week do you actually mean the first coming monday?
 
yes @PeeHaa
 
Over here weeks start on sunday
Not sure whether that is your problem though
 
Ahh, so the real question is hot to set begining of the week?
 
7:25 PM
@NikiC that was a stupid question. it clearly uses collection's offsetunset, so the behavior is correct, but why does hack handle it right?
 
7:47 PM
@Worf Sorry but I have no idea what "right" is here
 
yeah, i meant "differently" :P
 
@Worf In that case, because modification during iteration is implementation-defined behavior.
 
Anonymous
8:01 PM
has anyone tested anything using codeception? to test a web site's functionality.
 
8:13 PM
@NikiC how would you implement an iterator that has a predictable behavior while changing the original structure and that allows also concurrent modification (like two nested iterations on the same list)
observer pattern?
 
8:34 PM
yeah, it works! yay. good job, me!
 
Anonymous
8:51 PM
@NikiC Moronic monday?
 
Anonymous
Can we have a function call with omitting the first argument as func(, $foo)?
 
Anonymous
We currently do the same for list(, $b) = ['a', 'b'];
 
Anonymous
Here is a bad use-case, but a good example:
 
Anonymous
class foo {
    static function header($case = "Location", $value){
        header($case . ": " . $value);

    }
}
foo::header(, '/');
 
Anonymous
ex: if I wanted to redirect a page, I would not need to call the first arg..
 
8:58 PM
@samaYo Nope.
Keep the optionals at the end, that signature is just insane
 
Anonymous
I know that, but not some functions look weird when you misplace the args ...
 
00:00 - 21:0021:00 - 00:00

« first day (1695 days earlier)      last day (3269 days later) »