« first day (2159 days earlier)      last day (2792 days later) » 

12:36 AM
anybody use yii2 ?
 
Wes
\o
 
Ekn
o/
 
0
Q: json last error returns 4

BOTJr.I am trying to send an array from js to php through an ajax call.To achieve this i first converted my string to json by using JSON.stringify() and then at the other end i used json_decode() to decode, but it didn't work out. Using json_last_error() i found the error to be 4. Js code looks like ...

anyone ?
i really need help on this
 
1:09 AM
@BOTJr. When asking a question about code, always make sure you include the relevant steps and data to reproduce the problem for MCVE. I can copy/paste JSON into my IDE and lint it. I can't copy/paste an image, unfortunately.
 
i can provide you with a test data ? would that work?
@Sherif
 
@BOTJr. Use var_export to include $new_product['extraITEMS'] in your question.
 
wait.. @Sherif
@Sherif updated
 
@BOTJr. That's a string.
json_decode didn't give you a syntax error decoding that. That just decodes to a string.
 
yes it did
plus how could i make it as an array
i am getting null when i do json decode
 
1:22 AM
You missed my point. You encoded your value in Javascript to a JSON string.
@BOTJr. Not from that data you aren't.
Maybe what you actually tried to json_decode isn't what you just posted in your question. If you tried running what you showed me through json_decode what you would get in PHP is a string with JSON in it.
 
wait i will show you the output of json decode as well
if that helps?
@Sherif
 
@BOTJr. Not at all since I already know what the output is. I can run PHP just like you can run PHP.
I just told you what the output of json_decode would be on that input.
 
NULL this is the output
i have shown you the whole code, that is all i am doing
i don't get it
@Sherif
 
3 mins ago, by Sherif
@BOTJr. Not from that data you aren't.
The data you provided does not result in what you say it does.
Therefore you either have different data than what you told me you have or you messed something else up that I'm not aware of.
 
1:28 AM
wait let me update my question with before datas and aafter json stringify
@Sherif
 
@BOTJr. Right, ignore everything I said and try some arbitrary thing. Keep going you're doing great.
 
@Sherif just updated it again, you could take a look :)
 
@BOTJr. Nah, instead I chose to ignore everything you said and tried running your code through Python.
 
yeah i did see that link, i dont know how the data differ so much
 
@BOTJr. Because what you said you did and what you actually did aren't the same thing?
The data isn't what's different here.
Therefore the result can't be different.
Unless.... you told you one thing and did something completely different?
 
1:34 AM
i did tell you everything , you can see my updated question now.It contains all the info , probably.
 
@BOTJr. I ran your code and as you can see, it does not do what you said it does. Anyone can also take this same code with the data that you provided, and they will get the same result.
 
let me run every thing again.
 
So it's time to do some fact checking. Show your actual PHP code that did use.
 
@Sherif
wait
i will update that as well
@Sherif here's the link.See if it helps.
 
filter_var($value, FILTER_SANITIZE_STRING)
 
1:39 AM
This link doesn't show anything
@Sherif
face desk one
 
Just stop using FILTER_SANITIZE_STRING on your input. That makes no sense.
 
i get
it
:3
i really didn't know about this
god dang it
:3
 
Well, then stop writing code if you don't know what it does.
 
my bad
wait i will update my question , you can then answer on that one
thanks :)
you have been a great help
 
1:43 AM
@Tiffany debug_backtrace()?
 
@Sherif updated.
 
Wes
got a speech in a meeting with 40+ people in 5 hours. i should prepare something to say
 
@Wes Open with a joke. "The best part about UDP is... I don't care if you get it!"
"There are 10 types of people in this world. Those who understand binary and those who don't."
 
Wes
it's very informal but there will be a lot of people that don't know me
 
"There are 2 hard problems in computer science. Naming things, cache invalidation, and off-by-one errors"
 
Wes
1:48 AM
i'm too lazy to write down something
 
Or my favorite joke of all time. "Java. The End"
 
Wes
lol
@PeeHaa anywhere you want?
 
2:12 AM
> I know how to write a database test... I'll use transactions! Obviously this is great for testing since I can just rollBack() all teh things at the end of the test!
 
Wes
keeps happening...
 
@Wes Jesus is your follower now. Don't lead him astray!
 
Wes
sorry jesus i can't be what i am not
 
... you can't be followed? ;P
 
Wes
i'm a messiah
 
2:27 AM
i really wish yasuo would run things by a fluent english speaker before updating the manual php.net/manual/en/session.security.php
2
 
..seconded
 
> There are many network setup that setup
Yea, I don't see any comprehension issues.
What'd they do run this through Google translate or something?
 
Wes
3:00 AM
the oldest bug in the book
0
Q: Why can't Windows just leave my desktop icons where I left them?

WesYou would think that after decades of Windows releases this issue would be solved. But... no. In the past (I'd say up to Windows XP) icons in the desktop grid were just rearranged, all of them, from the top left of the screen if, for some reason only god knows, their saved position couldn't be a...

(feel free to flag it hard :B)
 
@Wes when you've got your desktop icons where you want them, right click on your desktop and click refresh
 
Wes
3:27 AM
ha
all my life, are you even kidding me? it works, why must I have suffered these many years? — RozzA Feb 8 at 22:04
@PaulCrovella i didn't know that, will try it out
 
3:54 AM
hai @Wes
i have one problem in php
@Wes
 
why wes
 
ok any one
@littlepootis
pls help me
 
just as your question
don't ask to ask
 
and don't ping random people
 
Actually i am ios developer
I am sending the values to the php side in a String format
and in php , i am not able to convert that into json
php code is
 
3:59 AM
You should totally drop that and try reactjs. it even transpiles to android, kinda
 
0
Q: convert string data to json Array in Iphone

purushothamWhen i am sending the values to server from my iOS, in php backend they are getting as String values. Is there any other way to get the JSON format in the iOS? My iOS code is: - (IBAction)btnSaveAction:(id)sender { int arrayCount; NSMutableDictionary *question_array = [[NSMutableDictio...

i want to convert into json data
 
can any one suggest me on that problem
 
@MadaraUchiha I came across a plagiarized answer and flagged it for a mod. Went poking through some of the user's other answers, found more and flagged them individually as well. Is it useful for me to continue or is further investigation of the user something a mod handling the flag(s) will do anyway?
 
Flag a few of them. He'll probably get a ban for plag.
 
4:30 AM
morning
 
@PaulCrovella Curious, plagiarized from where? Another SO answer?
 
As in... they just copy/pasted the same answer rather than closing as duplicate?
 
yes
in one case they went through the trouble of copying and pasting from two different answers
 
That's dedication right there.
They want to do their due diligence in plagiarism.
 
4:37 AM
in their answer to the dup i linked above they changed the function name and screwed up the whitespace
 
@PaulCrovella This part interest me because I've been working on a way to detect code plagiarism, specifically, on SO. It's funny, if you obviate all names in PHP code examples and focus purely on semantics, you get a very tiny percentage of answers that demonstrate authenticity.
If that is indeed a measure of authenticity.
Easiest thing for a novice to do is to change function/variable names in copied code.
 
if you focus purely on semantics you're going to get a lot of false positives for shorter snippets and places where there's an obvious way of doing something
but if you look at this it's quite obviously plagiarized from this
 
@PaulCrovella Indeed. Which then if you set a threshhold for smaller code snippets you get a new metric by which to detect specific re-asked questions to more generalized canonical/answers.
But, according to Tim Post, this is something StackExchange is apparently already figured out.
 
they figured out how to detect plagiarism?
 
@PaulCrovella Yup, that would have been caught by my filter. Because it compares the AST and ignores names.
@PaulCrovella They figured they suck at detecting duplicates and providing a sensible interface for finding them. Plagiarism technically is a subset of duplication.
The way I see it is, it's kind of like detecting stop words in search. If the frequency of a certain piece of code shows up as a subset of other code in so many different answers then it should be ignored all together. So you're just looking for subtrees in the AST that are technically "stop words". Then you focus on everything else and the false positives go down.
But doing that is so much easier said then done when you start looking at all the ways you could manipulate something like that to get false negatives :/
But the good news is people would probably down vote answers that tried to escape those filters as their code would generally be viewed as awkward for no apparent reason.
 
4:57 AM
if someone rewrites something to do it their own way it's hard to say that's still plagiarism, regardless of their motivation for changing it. though as usual it'd depend on the extent of the change
 
happy tuesday all
 
@PaulCrovella Right, that's the tricky part. Figuring out what other metrics to look at to determine how likely something is to be plagiarism vs. say "I'm providing a better answer".
Which is why you need good training data and on top of that you have to rely on crowd sourcing.
But for moderation purposes, at the very least, you could build a more autonomous tool for flagging something as "potentially plagiarized"
 
oh goodie, that guy moved on to plagiarizing from other source now too..
I'm not sure why I'm as annoyed about this as I am.
 
You care about integrity?
 
posted on September 13, 2016

New Cyanide and Happiness Comic

 
5:26 AM
hahah feeds
 
@Sherif if you're looking beyond code snippets as well, one tell I'm noticing is a capitalized word after a comma example - it's typically the start of a sentence copied and pasted from elsewhere
ffs, of the 13 answers I looked at 8 were plagiarized from elsewhere (the others were either unsearchable or too trivial to bother)... and they have 84 more answers to check
 
5:49 AM
@PaulCrovella only safe solution is to take a screenshot and use it as background image when everything is well positioned :-)
 
@staabm did that to a coworker one day and hid all the real desktop icons.. also changed his keyboard language and taped off the bottom of his mouse.. listening to the stream of discoveries from across the room was fun
 
lol
that mountain :P
 
Wes
beautiful :P
 
6:22 AM
Good morning peeps
 
6:34 AM
Morgen
 
Wes
\o
 
Mornin o/
@Wes That's just natural abnormality. It's just like cold. Will pass eventually.
 
oh jesus, SJW's have once more reached the meta ^^
 
(50 years later.. What have we done?! D:)
 
Wes
aaaah, you were joking :B
 
6:40 AM
:P
"It's propaganda." "Conspiracy theory. How can Earth get warmer when it's cold out here?" "No way humans are to blame."
Right
 
7:00 AM
moin
 
o/
 
\o
 
moin
 
I got a pretty interesting email this morning. Recruiter looking specifically for a PHP extension engineer (based in Paris) - I don't want to do it since I literally relocated to London 6 weeks ago, but if anyone is looking for work and wants an internals element, ping me and I can forward your details on.
 
no remote?
 
7:03 AM
Doesn't mention it in the email.
 
moin Joe,Patrick,Dave,Leigh
 
one does not do offices
 
It's also in a security related field... if I hadn't just moved, I'd be all over this.
 
moin
 
Anyway, if anyone is interested, ding me
 
7:06 AM
maybe ping pierre, or julien
 
Good morning guys
 
yomin
 
Good mornin
 
julien is actually in Paris @Leigh
iirc pierre is also, but his profile on twitter doesn't mention location
 
Mornigns
 
7:08 AM
1 min ago, by Joe Watkins
yomin
 
:)
 
How many of you are likely to complete a survey where you type in your swear words and rank them by severity? I need this for scientific purposes.
Only 2 questions and no contact info required. None whatsoever.
 
∞ Cunt
done ...
 
Nice ranking
 
	private function _doExport(){

		$zip = new ZipArchive();
		/*
		//create the file and throw the error if unsuccessful
		if ($zip->open(sys_get_temp_dir()."/".$this->_archive_name, ZIPARCHIVE::CREATE )!==TRUE) {
			exit("cannot open <$this->_archive_name>
					");
		}
	 	*/

		if ($zip->open( _DATA_DIR . $this->_archive_name, ZIPARCHIVE::CREATE )!==TRUE) {
			exit("cannot open <$this->_archive_name>
					");
		}

		foreach ( $this->_settings  as $setting ){

			$method = "_get_" . $setting;

			if ( method_exists( $this, $method ) )
can someone help me understand why is it that when i remove the file after adding it to the zip, the downloaded zip is empty and when i don' it's working
? please
 
7:11 AM
OUCH
 
Nice wall of code
 
:/
sorry bout that
 
guide.room11.org see rule #3 :-)
 
try closing first
closing will write headers most likely
possibly even output the file ... I feel unsure ... but it seems wrong to unlink what you are still using ...
 
7:13 AM
yes, you have to close the zip first
 
but that's the thing i have added it to the zip some normally i don't need it anymore ?
 
so $files[] = $file; and foreach over the list after closing to unlink them
 
but i want to add multiple files, so do i need to open and close it mulitple times ?
 
no
am I making sense ?
 
one second please ; trying to make sense
 
7:15 AM
@JoeWatkins his github says he's in Thailand :P
 
i have none , lol
 
you're out of ingredients for sense?
 
	private function _doExport(){

		$zip = new ZipArchive();
		/*
		//create the file and throw the error if unsuccessful
		if ($zip->open(sys_get_temp_dir()."/".$this->_archive_name, ZIPARCHIVE::CREATE )!==TRUE) {
			exit("cannot open <$this->_archive_name>
					");
		}
	 	*/

		if ($zip->open( _DATA_DIR . $this->_archive_name, ZIPARCHIVE::CREATE )!==TRUE) {
			exit("cannot open <$this->_archive_name>
					");
		}

		foreach ( $this->_settings  as $setting ){

			$method = "_get_" . $setting;

			if ( method_exists( $this, $method ) )
sorry, he started it ...
do that @Joseph
 
:P
 
Lol
 
7:18 AM
exiting in code is really horrible
 
@JoeWatkins thanks, i won't be exiting, this is for test purposes
 
/me is afk on school run
 
Wes
\o phpeeps
 
jo wes
 
morning wes
 
7:21 AM
meurning!
 
mourning
 
Anonymous
uiaefdjgnsning
 
@JayIsTooCommon I think you missed the memo where random keyboard head-bashing greeting at least have to start with "mo" so it makes some sense ;-)
 
Anonymous
it's been that kind of uiaefdjgnsning
 
@PeeHaa flights?
 
Anonymous
7:29 AM
We (r11) going out for drinks on the Friday night?
 
7:48 AM
Hello. I'm going tomorrow to the Zend certification PHP Exam. Any advice?
 
@MiguelGonzalez Just be relaxed. Don't panic too much and read the questions properly as there are trick questions.
 
@MiguelGonzalez No advice. Just a question. Why?
 
Thanks, I'm aware of the tricky questions. I'll pay attention but I'm against the time in the exam.
 
@JayIsTooCommon yup, although I might try and do the hackathon properly this year
 
\o
 
7:52 AM
(I doubt that will actually happen though)
@Sean o/
 
@Patrick Reasonless, I have a anual budget in my company to do this kind of things yearly.
So I'd rather do this exam instead of nothing.
 
ZCE is not worthless
 
Day 2 with SOAP, ¯\_(ツ)_/¯
 
Anonymous
The hackathon is at pm right?
 
It's not a good indicator that someone is any good, but it's something to put on your CV
@Sean don't drop it
@JayIsTooCommon yeh from like 7 I think
 
7:54 AM
Ooh, is this for PHPNW?
 
I heard the companies look into their listing of ZCE certified for candidates?
 
Is there any channel of contact during the conf, because I have no idea what any of you look like :P
 
Anonymous
Eh i'll come along if you're all going. I can't do anything but i'll be there for moral support..
 
dunno, I might not bother, but I do sort of feel a little out of place in pubs/clubs at night since I don't drink
ping @Farkie
 
Anonymous
@Sean Yeah SO isn't great for notifications so maybe hangouts or something
 
Anonymous
7:56 AM
or @Fabor's chat app which will be fully developed by then
 
Hey
i need a regex to get the month out of this: 2016-09-12T13:04:20Z. im not really good with regex, can u give some hints ?
 
Anonymous
@Sean What time are you getting there on Friday?
 
@Sean follow me on twitter and I'll DM you my mob num
 
@Traxstar ^\d{4}\-(\d{2}) It's crap but it gets the job done. :P
Can you not use strtotime?
!!docs strtotime
 
[ strtotime() ] Parse about any English textual datetime description into a Unix timestamp
 
7:59 AM
@JayIsTooCommon I just sent you a gtalk invite, I'll send you my mob num on there
 
!!docs DateTime::createFromFormat
 
[ DateTime::createFromFormat ] Returns new DateTime object formatted according to the specified format
 

« first day (2159 days earlier)      last day (2792 days later) »