« first day (2008 days earlier)      last day (2934 days later) » 

12:00 AM
@TheBeast there would be a line number. it means you are trying to echo an object
 
ok
you want to see line number?
 
well... if you can find the line number, you can find the line and ultimately the wrongly used stdClass
 
Kay
@FélixGagnon-Grenier Okay thanks..this is how I have it right now gist.github.com/anonymous/da1ff1a8e8b1347714c7d8614db649c1
 
line 481 @FélixGagnon-Grenier
 
Live NOW! Discussing asynchronous programming in PHP http://phproundtable.com
 
12:03 AM
you'll to tell which line it is... I can't really guess from the code you pasted @TheBeast
it might even not be in your code sample
the error message should tell you the file as well
 
@FélixGagnon-Grenier pastebin.com/eRpJbScB
 
... which line is 481? there are 50 in your code, I can't divine which line throws the error
it's probably even not in your sample
you have to find in your own code, which line is 481.
 
that is in a fuction
a wordpress
that makes a page
line 15
@FélixGagnon-Grenier
 
12:20 AM
that seems to mean $header is not what you think it is
var_dump($header); before that line should confirm it is indeed an stdClass
 
ok
how can i fix it
?
@FélixGagnon-Grenier
 
@Sara Is there a chat accompanying the roundtable?
 
Just twitter, essentially
 
Concurrency is orthogonal to parallelism is all I wanted to chime in with.
^_^
 
I'll bring that up :)
 
12:28 AM
You can use them independently or together.
 
Actually, I did mention that earlier, in a form
 
Yes, you did.
It was just scattered ^_^
Might be a helpful resource.
 
Ekn
^ that was a great talk
 
@LeviMorrison concurrency though shares some of the problems like race conditions with parallelism… :x
 
12:55 AM
@bwoebi Not necessarily, but sometimes sure.
 
Kay
1:31 AM
Question. Does this logic make sense?
IF P,D,E

ELSE IF PD
ELSE IF EP
ELSE DE


IF P
ELSE IF D
ELSE E
 
Hi Beatiful girls
 
1:58 AM
mrnging
@Kay that isn't logic
If P,D => P || D and PD => P && D, then it is.
 
Kay
@littlepootis I'm not following
 
2:14 AM
morning
 
2:42 AM
@Kay It doesn't really make sense
What does P,D,E mean?
 
Kay
@littlepootis poundRate, dollarRate, euroRate....It's basically for the POST method script
 
Now what does "IF P,D,E" mean
What does the , mean
 
Kay
@littlepootis I asked that because I figured I need to change the if(isset($_POST['pRate'], $_POST['dRate'], $_POST['eRate'])) code for each case
 
the latter method is better
brb
 
Kay
@littlepootis okay. I have it like this gist.github.com/anonymous/97b0ceaa35197b14298239a9fb9ae9c8
 
3:00 AM
@Kay mysql_* functions were removed in 7.0, don't use them.
Are you sure every one of those variables will be sent?
 
Ekn
@Kay See this paste and this might help
mornin
 
o/
http://stackoverflow.com/questions/36637640/difference-between-php-a‌​nd-php-in-codeigniter-coding-formating-style
 
3:25 AM
is there a easy way using php to replace code of existing js file with json handles object
 
3:37 AM
monin
 
mornin tereško o/
 
can anyone help me with a simple php task
 
3:54 AM
hello guys im new to php and i was curious is there a way using php to POST data from client side to existing .js file on the server
 
Desperately need help, this is driving me nuts
working on an Email template for mailchimp....shudder....and it looks fine in a lot of email clients, but in outlook it looks like balls
teevee.hybridwebdev.com/…
sorry
teevee.hybridwebdev.com/…
gah.
 
<link href="./assets/css/snah.css" r relative path for CSS?
 
@GeorgiAntonov you can perform a POST request using AJAX .. or you can trigger form submission from JS too
 
i have already done the javascript part
now i need php code that handles the data passed via ajax and replace the old script in .js file with the new one (passed data )
 
you need to send a correct content type header then
 
4:03 AM
i can give you link to my stackoverflow question
 
it has to be sent with application/x-www-form-urlencoded header from JS
 
there i explain it better
 
hmm .... reading the question
 
0
Q: Handle json object with php and push it to .js file

Georgi AntonovI have this function on the client-side function ajaxPost(obj){ $.ajax({ type: "POST", url: "url to the php file",//I'm not sure about this line contentType: 'application/json', data: JSON.stringify(obj), dataType: 'json' }); } and this p...

 
ah, so you are using a json content type
do you have any framework used on PHP side?
 
4:05 AM
im not sure if i have to
nope
 
something that could fuck with php://input .. ah, that's a no
 
the php script is inside php file on the server
 
gimme a sec
 
im really new to php and server-side
would appreciate some help
 
@GeorgiAntonov why do you want to post the data to js file?
 
4:07 AM
@GeorgiAntonov did you verify that $json on php side turns out empty?
or are you getting some content there?
 
because visitors of the website ask for the js file each minute via ajax request
 
@astrosixer he's probably implementing some REST-like API
 
y sometihng like that
the whole idea is
 
so, is $json empty?
 
that visitors of the website will see real time currency rates
and when i want to change the rates from admin page they dont need to refresh the page and instead the next ajax call returns modified json
well inside the admin page on button click im collecting new currency rates from input boxes then wrap them in js object and then this js object is passed
so i guess $json is not empty when i populate the new currencies and click the button
actually is this a proper way for this task
 
4:13 AM
please use question marks :P
yes, it's the proper way to do it, when you are implementing a REST-ish stuff
 
aha so im on the right way :D
 
the PHP's default SAPI can is only good at handling standard HTML requests
 
so the idea is that i want to manipulate .js file content on the server from the admin page
 
you need to turn it into an object or an array
$data = json_decode($json);
this will turn that JSON string in a proper object
 
4:15 AM
there is a second (optional) parameter for that function php.net/manual/en/function.json-encode.php , for when you want it instead to be an array
fuck wrong link
 
the json is like this
 
var currencies = {
EURbuy : '1.95',
EURsell : '1.96',
USDbuy : '1.7',
USDsell : '1.76'
};
 
so, you do $data = json_decode($string, true); and then $data['EURbuy'] to access that array value
assuming that "currencies" was all of the json that you sent
 
4:19 AM
Hi :-) I'm new to this chat room...
 
my condolences
 
maybe i can implement that way but let me explain deeply what im trying to do incase you missunderstand me
 
yeah, your english is pretty rough :(
 
is there any reason, why PDOStatement::debugDumpParams() doesn't display the values of the params... ?
I think it's pretty annoying.
 
the visitors make ajax requests from the server and the server gives them json object from the .js file im talking
and the json always looks like currencies
so far so good
but if i want to change the currency rates for example EURbuy to be 1.94
I enter the admin page populate the new rate and click button
when button is clicked a javascript object is created just like currencies
and then its send to the php on the server
then the PHP on the server must rewrite the .js file with the
 
4:23 AM
@Andreas could it be that you are using emulated prepares?
 
nope, using native statements in MySQL :)
 
huh?
@Andreas show me your code (I am interested in initialization of PDO instance and the code surrounding debugDumpParams)
 
@tereško wraping data from input boxes to objects..do objects are class concepts?
 
@astrosixer wat
 
objects are js objects
 
4:26 AM
@GeorgiAntonov you probably could just do file_put_contents('/path/to/currencies.json', file_get_contents('php://input'));
 
I mean he was saying that ... inside the admin page on button click im collecting new currency rates from input boxes then wrap them in js object and then this js object is passed ...?
 
will take some minutes :)
 
@Andreas well ... I have been trying to make breakfast for .. well .. 20min now
so take your time
 
but this code if im not mistaken will not erase the previous object inside the js file
 
yes
you could read the existing JSON file, read the new input
then combine the both and write the new data to the file
 
4:29 AM
but if the old object is not erased there would be 2 objects and the ajax request from the visitors will fail
 
is there a special code formatting feature in this chat ?
 
@Andreas for posting code, please us gist.github.com
 
ah, sure, thanks :)
 
can't i instead erase all the data in the js file and put the new
 
4:32 AM
$original = json_decode(file_get_contents('stuff.json'), true);
$change = json_decode(file_get_contents('php://input'), true);

$original['some']['element'] = $change;

file_put_contents('stuff.json', json_encode($original));
@GeorgiAntonov something like this
@Andreas yeah, it looks correct. What does your prepare/execute code looks like?
 
Output of PDOStatement::debugDumpParams() is like this: gist.github.com/anonymous/18b0fe8179971aeee958419972251cc4
 
@Andreas so ... it's working as expected
 
@tereško: Well, yeah, but that was what my question was about. :) there's not the values of the bound params there... like e.g. '4571' for publisherKey, etc.
 
oh
 
there's also a bug report filled at php.net, but it seems like nobody is interested in fixing that :-/
I was just wondering, if there's any reason why no values are displayed (e.g. technical, etc.)
 
4:37 AM
there is technical reason: it is not implemented
that "bug" is a feature request
 
yeah, obviously, I agree :)
 
you can always just var_dump the values yourself
yes, it's a pain , but then again, you WOULD be expected to use xdebug and step-by-step debugging ... which nobody actually does
 
we sometimes do, but only with severe performance bugs, etc.
because it takes a lot of time
but thanks, just hoping this function will be implemented someday
 
Mornings!
 
I am not even sure why it hasnt been implemented
 
4:43 AM
me neither, that was the reason I wanted to ask in this chat. I know here are some PHP core developers here :D
 
they're sleeping
though, Joe should be awake soon-ish
it's almost 6AM where he is
 
ah, I see. this is Western Europe, right?
 
Ekn
http://stackoverflow.com/questions/36637759/do-variables-need-need-t‌​o-be-in-curly-braces-when-using-echo
 
oddly enough, yeah, most of the php room users are from EU
 
me too :D but currently in Asia, so a different timezone
 
4:54 AM
that explains it
 
I often read this chat here as a guest. but I was a bit scared of typing a message.
 
moin
 
Ekn
mornin
 
5:10 AM
o/
 
What kinds of implications would there be for doing this, yet not blocking access to those files via .htaccess?
 
morning
 
Ekn
5:37 AM
 
oh yay, it's friday
 
teresko im really close
<?php
$obj = $_POST['myData'];
?>
is the php

and im passing directly json object
 
!!rebecca
 
@Ekn \o/
 
5:47 AM
\o/
 
Ekn
it's the google result of "what!? raiden plays guitar?"
 
Wes
6:11 AM
mndfnsding
 
ronming
 
good morning
 
Good morning and Happy Rebecca day!!
 
Wes
i wish i know why marshmallow doesn't turn off the screen sometimes
i think it's been turned on for 4-5 hours and battery is flat now. bah
 
posted on April 15, 2016

New Cyanide and Happiness Comic

 
6:28 AM
mmorning
 
Happy Rebecca Day
 
o/
 
Wooo, got our new worker server today
time to install vvmware.
 
'install' meaning you are going to set up an installation and play games all day again? ;)
 
Yeps.. I mean, no
Just hope I can get the freaking spider to read the ISO this time
 
6:42 AM
\o
 
@Epodax What is that used for VMWare? Is it like VirtualBox and Parallels?
 
Aye
Hosting / creating virtual machines
 
Maybe im totally wrong but when you buy some setup from DigitalOcean you are also setting up a virtual machine? So it's a bit simillar?
 
No idea, never bought anything from digitalOcean
But in general (or atleast how we use vmware) is that we have a server, and then we install vmware as the OS and use it to create smaller servers from our main servers hardware :P
And wooo, it' found the ISO
 
Wes
6:57 AM
found a bug with inheritance 3v4l.org/YaXVN cc @JoeWatkins do your magic :D
so, it's about abstract classes possibly checked in the wrong order 3v4l.org/LBY4s
am i right? or i am being dumb? coffee didn't kick in yet
 
that should error
 
Wes
which?
 
both, I think
ah
 
Wes
nope, why? it's valid LSP
 
yeah
it's not about order I don't think ...
I'll have a look ... but busy today, so might be tomorrow, or later tonight ...
 
Wes
7:08 AM
i think yes
Declaration of AAA::method($x) must be compatible with BBB::method($x, $y = NULL)
basically checks a super class to be compatible with a child type, should be the opposite
no hurry @JoeWatkins
 
afk, school run
 
MOrnign
 
Anonymous
7:24 AM
morning
 
morebeccaning
 
moin
!!rebecca
 
7:42 AM
@PaulCrovella I hate you
 
LOL, still playing? :D
 
yup
 
8:00 AM
Morning
 
Wes
i keep writing count() without the o
 
is it working?
 
@Wes :P
Does it work? :P
 
Wes
nope
 
:(
 
8:02 AM
@DaveRandom Don't blame me, I wasn't the little new worm who just popped the one you had been doing so well with.
 
report a bug now
 
use function count as...
 
@DaveRandom I hate you now
 
use function extract as fuck_you;

fuck_you($_REQUEST);
@FlorianMargaine It's taken you this long?
Most people hate me within seconds
 
@DaveRandom I hadn't clicked the slither link before you mentioned it
 
8:13 AM
@PeeHaa how did you create that php team? I cannot seem to find a button to do this
 
@Gordon on github?
 
stackoverflow.com/questions/36641449/… ... before more answers get copied back and forth
 
8:29 AM
 
woah, wtf
 
@Gordon you need to pay $500
 
good morning
 
@FlorianMargaine I strongly doubt PeeHaa or Jimbo did that
 
@Gordon meta.stackoverflow.com/a/312713/889949 looks like you need to be manually added to a beta list
 
8:32 AM
aha
 
how to hide a column with angularJs
 
@undefined wrong room, also too vague question
 
@gordon I have a list of users in a table with email name etc and I want to check a box to hide a column I tried to use ng-hide and ng-show but in vain
 
ok, we are getting somewhere. now ask that in the right room ;)
 
morning guys
 
8:36 AM
@Gordon it wouldn't surprise me from @PeeHaa :P
 
@Gordon is there a room for angularJs in stackoverflow ?
 
@FlorianMargaine he spends all his money on beer afaik
 
i have a quick question, i have an array of array keys [key1][key2][key3], how can I use it to on another array to change the element?
 
@Gordon he spent much more than $500 in billable hours on @Jeeves...
 
@undefined yes, there is. and there is a javascript room in case it's empty. you are aware that you can browse and search available rooms at chat.stackoverflow.com, are you?
 
8:39 AM
like get it to look like this $somevar[key1][key2][key3] = whatever?
 
or is it better i ask on main site?
 
@grasshopper if you ask it the same way you just asked it here on the main site, it would get closed, because no one would understand what you are asking
at least, I didnt understand it
 
mmm ok
 
Yeah, too vague.
 
8:43 AM
ok i have searched another multi array to find the keys to a maching element which returned the keys of that element as an array
 
@grasshopper maybe if you describe what you are trying to achieve we can help you
 
now i have the matching keys now i want to update the matched element
 
> $somevar[key1][key2][key3] = whatever?
 
hello
can i ask a question??
 
You already did
:D
 
8:46 AM
hahahaha
exactly
 
cmon alreaaady
 
i fresh grads and i start work with factory industry...
my background study is networking, but i required to create simple php system
 
@grasshopper i have a vague idea what you are asking, but still very unsure. can you show some code in a pastebin that illustrates what you are trying to do?
 
i have very basic knowledge about php
let me explain 1st what system that i want to create...
 
/me grabs his Too Broad flags
 
8:53 AM
this factory is small factory but have a lot of product. after finishing, our operator will paste the label.. for label pasting, our engineer was create the JIG for operator easy to paste and make sure the label are paste on correct part.because have many product with different size, so has many JIG also. our engineer put all the JIG on the drawer(6-8 drawer). i required to create the system which is, when product come on label part, operator will scan the product.
 
@Gordon thanks gordon, heres the pastebin pastebin.com/1KyvVJHa
 
after that,operator will showed the product detail and the JIG location(ie: Drawer 2 Slot 3). operator will take the JIG and scan the JIG barcode. if the JIG barcode match with JIG number on the system, operator will showed the product spec. if not match, they need to find the correct JIG
 
@Mu
 
i have create the system.. but i have problem with if 1 Product have 2 JIG...
if 1 product have 1 JIG, i was created that part successfully
how can i post code on this chat ???
 
@MuhammadYusufAhmadShahRudd You can use pastebin.com and drop a link here
 
9:00 AM
i see you guys still here after many years gordon+daverandom, the oldguys of php chatroom
i feel i am too slow at coding, at end of projects my code works but i take very long, what can I do to code faster?
 
Happy Rebeccaday!
Do you typically store tests the same way you store your class/namespaces?
 
Wes
@Sean yes, i try to use the same namespace/folder structure
 
@grasshopper tried a crash course in how to type? ^^ the faster you type, the faster you can code
@Sean there is no such thing as a happy rebecca day unless no links were clicked :P
 
0
Q: Javascript mouse movement parallax div

PhilippI have a problem with this javascript. On my website is a parallax div and it should scroll if i move my mouse. This script works so far but it scrolls on the body and not on the parallax div, like it should. var x, y; function handleMouse(e) { if (x && y) { window.scrollBy(e.clientX - x, ...

sorry i posted in the wrong place....
 
9:19 AM
@grasshopper sorry, I still dont understand the question. If you want to change the array with key 0 you just use the key 0
 
@Gordon basically i want something like this: $user_files[array_values($arr_index)];, maybe this makes more sense?
 
@Naruto I find that I spent much more time thinking about things than typing them out
@grasshopper yes, so why cant you do that?
 
because i cant have an array as keys for another array
it should be like: $user_files[array_values($arr_index)]= array();
 
@grasshopper ok, so you have $key = [0, 'foo', 'bar'] and you want to turn that into $data[0]['foo']['bar']? is that what you are asking?
 
9:22 AM
which becomes $user_files[0][1][2] = array();
exactly
 
@grasshopper This is fairly easy but you need to loop, there's no built-in. Where it gets harder and a lot more horrible is when you need to assign to it like that
Basically, whatever you are doing is probably the wrong way to do it. What's the use case?
 
@DaveRandom could write a function that returns the value as a reference
 
> a lot more horrible
 
:)
 
9:28 AM
ok so i scan dir for files then take from db list and check for matches, to add new properties there
 
Either you probably want an object model or to stringify it, most likely the former
 
You may need to elaborate/reference on what an object model is -_-
 
@grasshopper File paths are already strings, just use strings
@Fabor well that would depend heavily on the specific case, hence need more information about app before elaboration is possible/useful
 
@DaveRandom ahahaha, so simple, thanks im going to use that, see and this is why i take forever with coding, cant see easy solutions
 
Wes
@grasshopper if array length is known you could do 3v4l.org/uupXj
 
9:32 AM
lol wtf
go home @Wes, you're drunk :-P
 
Wes
lul
 
@Wes thanks wes, but daves method already works :) ill let you know it that also works
 
Wes
i'm not paying much attention tho. missed what the ultimate goal is
 
The ultimate goal is to get the most money. That's hows you win at life.
 
@Wes lol i checked the code and it just loops back to the original problem, anyways got it working now
 
Anonymous
9:40 AM
ffs. Ruby is a piece of fucking shit.
6
 
@Gordon he only asked to type code faster ^^
 
@DaveRandom :D Is hat your goal?
 
Wes
@DaveRandom i'm failing hard then. but i'm happy
 
9:57 AM
@DaveRandom Bill Gates wins \o/
 
Im trying to save as much as I can February was my best month ever.
 

« first day (2008 days earlier)      last day (2934 days later) »