« first day (1753 days earlier)      last day (3202 days later) » 

12:05 AM
@NikiC Are you aware that line numbers in PHP 7 with AST always point to the last line? e.g. a function call over multiple lines (especially when a closure is an arg) … the line number refers to the closing }); which I find very confusing :-(
@NikiC or even on completely wrong lines… like…
foo($a + $b, function() {
    // some code
});
the ZEND_ADD lands on line 3, after the function…
 
well ... fuck. I think I will need to buy a UPS
 
woops, bad example, should be:
$a + $b->do(function() {
    // some code
});
the addition should be there where the operator is.
just like in PHP 5.
oh, disregard that… I'll have another look when I'm not tired.
 
12:57 AM
@PeeHaa do you have any idea what opcache.file_update_protection is other than something that makes my website slower?
 
Abe
1:29 AM
@Danack it won't op-cache files whose timestamps are less than N seconds old. that for to avoid caching partial files that aren't fully written yet by the editor that is saving them
just guessing though
which means that you don't want it to be enabled, unless you do modifications on production sites :P
so i guess it makes things slower because it requires a stat call
 
1:56 AM
Alright, I need me a n00bish victim to test this on
<*insert evil grin here*>
 
2:32 AM
@sherif what evil thing do you want to unleash on the world
 
@Orangepill heh, it's not evil, even though my grin is :P phpden.info/skittlez/invite/…
I just need some basic usability testing to try and figure out how useful a tool like this will be for someone learning.
It's harder than you'd think writing automation tests for code reviews, heh
 
well you got your first victim... :)
 
You tried using strpos didn't you?
:p
 
is using str_replace an acceptable solution for the second question
yeah I did ... it was a negative test ahmm..
 
@Orangepill Is that how'd you implement that function?
 
2:43 AM
I'd use strpos :)
 
Yea, but what if strpos didn't exist?
 
str_replace if I was feeling lazy but probably just incremental character matching if not.
 
@Orangepill But would str_replace be an effective solution?
 
yeah..
str_replace($needle, '', $haystack) != $haystack;
and force the case on all of the parameters if you wanted a case insensitive version.
 
@Orangepill so what happens when $haystack is really long and $needle is not in $haystack?
 
2:51 AM
probably not too efficient in either memory or processor utilization.
 
Yea, now if only I can write a tool that would give you that kind of feedback :/
hey this works but.....
 
That's a tough one...
 
It's so easy to write a tool that tells you when the computer doesn't understand your code... so much harder to write that tells you when a human might have trouble understanding it or might have a better way of doing it.
But hey, if this works well think of how many more people will have an opportunity to learn by getting some real hands-on code-writing experience rather than just reading through the daunting manual they so hate!
 
well and the "better way" is often tied closely to what the input is. Maybe the thing to do would be to show other solutions and in what cases they are applicable.
 
That's definitely an option.
This is meant to be a very interactive experience though.
So I could do things like highlight a certain line of code in the editor and display a popup that gives you some hint like that.
But that's so much easier said than done and my first few attempts at this were pretty fruitless.
 
3:02 AM
gamification is being proven to be more and more effective way to teach people... I think you got a really good idea here.
is this meant to focus more on programming or php.
 
It's meant to create a framework for designing interactive tutorials for any programming language really, but this is very early stages as you can see :P
I'm also trying to connect popular SO questions with bits from the manual and have them display directly in the feedback section. The idea is to remove as much distance as possible between you and the interruptions of learning and bring you closer to the solution more quickly.
 
Good idea... shows real world applicability as well... you know "these are real problems that real programmers have to deal with not just some academic circle jerk"
 
yup, it's the trouble of figuring out how to immerse them in a really friendly and interactive experience that's going to encourage them to learn about the solution that's hard
So far the lowest-hanging fruit was "I don't know how to setup PHP on my computer", "I don't know where to start", "I have 1 billion and 1 configuration/installation issues that made me give up and throw stuff at my cat..."
Which I think is solved quite nicely by just giving them an editor and working latest version of PHP right in the browser.
No hassles!
And here's a very specific problem to solve: and here's some feedback as you try to solve it
 
3:20 AM
I can see how once a program is written you can capture the output and respond to specific misimplementations but while writing it would be tough to anticipate their intent.
but you should be able to offer some nudges after failed attempts to find a solution.
 
@Orangepill It doesn't look at output. It inspects the code itself.
 
seems like you would have to be looking for a very specific implementation then.
 
Nope
 
impressive then... to me that seems like a very non-trivial task.
i wouldn't even know where to start at solving that one.
 
It basically looks at your code the same way the PHP engine does. So it can play with it and manipulate in an isolated environment to see if it works. It's kind of like writing a unit a test, except you can do much more interesting things beyond what a unit test aims to do.
 
3:31 AM
-1
Q: How to send an authorized put request to a specific url with data/modified data

Know MeGood Morning.I would like to know how to send an authorized put request to a specific url with data/modified data using php and curl. I am new to php and just discovered curl yesterday. Thank you.

Hi everyone. I have a question here.
 
It's like a unit/integration/systems test with a bit of insanity in the middle :/
 
@Sherif It doesn't like this:
function subStringExists($needle, $haystack) {
   for($x = 0; $x < strlen($haystack); $x++){
       if ($haystack[$x] == $needle[0]){
           if (substr($haystack, $x, strlen($needle)) == $needle){
               return true;
           }
       }
   }
   return false;
}
 
@Orangepill - do u have any idea
 
@Orangepill Yea, it doesn't like any code that generates errors
 
3:47 AM
in what case does this generate errors?
 
Try running it with a zero-length needle ;)
subStringExists('', ' ')
You assume the string always has a 0th byte
It tries to use your code in much the same way anyone would use a stdlib function (like it's a black box and it has no idea what the implementation is)
 
@Orangepill ok looking at it
 
okay...
so in the zero-length needle case the output should be .... true?
 
No, why would the output be true? How do you find a zero-length substring in a string of any size?
It's not possible. But the point is your code shouldn't make that assumption and cause PHP to generate an error.
 
if I'm looking for nothing I'm going to find it anywhere I look
 
3:52 AM
heh, it's an empty string. Last I checked you couldn't test the existence of nothing.
If it's an empty string you can safely return early with false, because there's nothing to look for. No needle to find the haystack.
That's what strpos will do, with the exception that it explicitly generates a warning to inform you of that.
Warning: strpos(): Empty needle in...
But your code doesn't explicitly generate an error. It fails to check that $needle does in fact have a 0th byte, before trying to use it. So it's considered buggy.
Of course, right now it doesn't understand the difference between an error/exception that you triggered vs. one by PHP, but these are just practice questions.
 
@Orangepill - looking at the link u sent me - where to give the url
 
I like it ... in for form it is now it is useful.. if you can get it to give relevant feedback based on which test failed ... kinda like what you did above Try running it with a zero-length needle that alone would make it an effective tool imho.... anything beyond that would be pure awesome.
@knowme line 2 ... where it says $this->_serviceUrl.$id... replace that with the url you want
 
@Orangepill - ok thank you
 
@Orangepill Yeah, see that's the tricky part. Generalizing that kind of feedback is not at all trivial :)
I'm trying to build this as a framework so that it can be applied to a vast majority of programming problems and be used easily to build tutorials like these.
 
@Orangepill - what is this for - if(!$response) {return false;}
 
4:06 AM
@KnowME and if you mean basiic authentication when you say "authorizied put request" then you need to put something like curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password); in there as well
 
Finding the right balance of gathering information from the code and make it abstract enough to provide feedback from the client, is ... how shall I say ... FUCKING INSANE!
 
@knowme if you don't get a response then the function should return false
 
ok
@Orangepill - does this mean that I need to get this data and store this somewhere
 
@Sherif I can imagine... but in that particular case you know what conditions resulted in the error so a canned response should be on the table.... but I can see how other less trivial errors can get hairy
 
@Orangepill - and what do I have to do with it
 
4:09 AM
@Knowme whatever you need to ... do you expect a response from the service? Should you do anything with the data included in the response
 
@Orangepill Oh yea, I agree. I know how I'd do the canned response. I'm just trying to figure out how to not force people to hard-code in those canned responses.
 
yeah... FUCKING INSANE is an understatement then
 
I'm learning a lot though :D
 
@knowme with a null response checking the results of curl_errno($ch) for a non 0 value might be a good idea
 
@Orangepill - I need to use this with google contacts
 
4:15 AM
@knowme don't know anything about google contacts but I would look at the google php client instead of trying to use a low level api like curl.
 
@Orangepill - ok
 
4:32 AM
why strpos('sfsdf/abc/this', 'sfsdf/') is giving me false ?
 
@Orangepill
@Orangepill - are u here
 
dont ping randomly
 
@Richerd fuld - who
 
4:51 AM
Anyone there?
 
5:18 AM
Just us chickens
 
I have a question about sending email in php, may i ask?
 
What's stopping you?
 
What php client to install to send emails in php?
 
You could try PHPMailer
 
Is PHPMailer a mail client? or does it use any mail client?
 
5:23 AM
It's a library for sending emails in PHP. It's not an MTA, if that's what you mean.
 
If it is not mail client or mail server, how does it send emails then?
 
It doesn't. It just abstracts away some of the work involved in shipping the email to your MTA.
 
PHPMailer doesn't send emails ?
 
It isn't responsible for delivering the email to an inbox, but it can be used to talk to a mail server from PHP.
 
5:41 AM
Do you use PHPMailer ?
 
phpmailer is usually used as the "quick tool"
it requires less time to set up, but plays worth with large scale applications
 
good roaming
 
6:02 AM
@SergeyTelshevsky I can never achieve that ^^
 
6:20 AM
what are` __DIR__, __FILE__, __LINE__` and all that called?
okay... magic constants
I guess they are magic because they are not constant
 
6:39 AM
moin
 
morning
 
7:00 AM
'nin
 
@MarcelBurkhard Sure you can :)
It's just 3.3333333 enthusiasts!
 
posted on August 04, 2015 by kbironneau

/* by eimink */

 
my highest was something like 87 but then I missed a day when I was on vacation.
 
@Orangepill Write a script that visits the site every day. Done :D
 
That's cheating though
 
7:08 AM
@Orangepill Who cares, got badge.
 
@MadaraUchiha is that how you got it?
 
@Orangepill Nope :D
When I joined Stack Overflow, I had no life :D
 
@MadaraUchiha so you have life now :D
 
I was just on a rep whore spree when I started
 
@NullPoiиteя That's implied, yes.
I stopped programming in PHP, and thus got a life.
 
7:12 AM
so, what do you use now ?
I started to work as php developer now ;P
@Orangepill I think we all did once :)
 
You can see on the graph where I found chat and got spanked for being such a dirty whore
 
@Orangepill - I want you to check something out
 
ya there is bug in your graph
or bar have greater than 385 rep
 
What bug is that?
 
user1804599
@Orangepill They're magic because you can't define them yourself.
 
7:17 AM
Those aren't bugs
 
@Orangepill - can u do me a favor
 
@knowme what is that
 
@NullPoiиteя yeah that's not a bug....that's just how big of a whore I was
 
it should show all details ... but its not showing try clicking on another bar
so its bug no matter how big whore you were :D :P
 
7:22 AM
I'm seeing a lot more then that
 
@NullPoiиteя that's what I am seeing
 
@Orangepill - pls open it and click on the button
 
Morning
 
@knowme no thanks
 
7:26 AM
@Orangepill - its ur choice - but why - just a favor
 
I make it a habit of not letting people manage my contacts
nothing personal
 
@Orangepill - oh ok - but i won't know anything about ur contacts through it - anyway forget it and let's move onto another topic
@Orangepill - thanks for trying
 
@Orangepill i am getting different :( this is discrimination by Stackexchange ) :D
 
@NullPointer I know... shows the same if I have it suppress the deleted posts as well
 
do you play at agor.io too ! awesome game :)
 
7:31 AM
@Orangepill - so actually when I import the google contacts - i get something like this
 
@NullPoiиteя I suck though.
 
@Orangepill - check it out here :pastebin.com/27vxV8Lz
 
morning
 
i suck too
 
@knowme looks promising
 
7:33 AM
@Orangepill agor.io?
 
@Orangepill - thanks
 
@MadaraUchiha agar.io
 
hi
is anybody can solve my doubt?
 
@lovemyfate maybe
 
on my php.ini file i set upload_maxfilesize as 10mb
when I am tried to upload multiple files(2 numbers) with 6MB. is that affect
my file uploading?
 
7:38 AM
yes... if you do it in a single post then you are going to exceed the max file size
your web server may also impose a limit on how large of a post body it will accept
and with a 10MB limit after the file is base64 encode you are only going to be able to push up just under 7MB in a transaction....
I believe base64 adds on average about 33% to your file size.
actually I'm not sure if the upload_max_filesize directive references the size on disk or on the wire so 10MB might acutally mean 10MB to php but the limitrequestbody directive in apache is the base64 encoded version.
well I'm out for the night
 
@Orangepill okay... Is there any solution for this problem?? because all users may upload below 2mb but they can upload unlimited files at same time.....
 
7:54 AM
Hi All
Somebody please help me
0
Q: When there are more than one inner array elements present how to sort them in ascending order of UNIX time stamp value?

user2839497I've an multi-dimensional array titled $events as follows : print_r($events); Array ( [0] => Array ( [0] => Array ( [rsvp_id] => [is_liked] => [group_name] => Student Organisation ...

 
@Orangepill - actually, when I do that, so actually, I have a page which has a list of rows of people details - Name,Phone,Last visit day,Type,Average Spending,No of visit, Remarks - so actually when clicked on any of the rows - I get a bootbox dialog box to change some of these details or other details - and I can also change the name &/or phone
@Orangepill - there are many contacts
@Orangepill - all these can be done in the database at the moment
@Orangepill - i want to change in google contacts - too
 
Morning
 
@Fabor o/
 
@Orangepill - I want to change the data of the contact in google contacts at the same time(if name &/or phone is changed) - the problem is how to change the correct one in google contacts - i just know that i need to send an authorized put request with modified data using the linking u gave me - but don't know what I need to put in the put request - so the details - name &/or phone will be changed for the correct google contacts - at the moment they are changed in the database cor
@Orangepill - i think u know what i want to say and what my problem actually is
 
Good morning
 
7:59 AM
@Orangepill - do u have any idea or direction or know anyone who might be able to do that
@Orangepill - so that they can give me the direction
@Orangepill - thanks a lot
 
@tereško I detect a simple way for converting Gregorian date to Solar date: here is a demo
@KnowMe ?
 
Do u have any idea on the question I asked @Orangepill
sometime ago
 
Don't random ping people. It's annoying and will get you ignored.
 
@KnowMe Please don't ping random people
@KnowMe I will now definitely not answer any questions from you
 
@AllenJB - I won't next time - sorry
@AllenJB - and it is ur choice whether or not to answer my questions
@AllenJB - first time - to ping randomly - sorry
sorry all stackoverflowers
anyway, does anyone of u have any solution
to my problem
@Sajad - thanks for ur reply - do u have any solution to my problem
 
user1804599
8:18 AM
hahaha
 
@KnowMe actually no !
 
8:47 AM
@KnowMe u pinged?
Oooo random pings, that won't get you anywhere ^^
 
@Naruto - yes sorry
@AllenJB Did u block me on chat
 
@KnowMe he asked you to stop pinging him half hour ago and you pinged him 4 times since then ...
 
Good moaning :)
 
moin
 
@Joe Watkins - no he didn't, where did he say "don't ping me"
 
8:58 AM
45 mins ago, by AllenJB
@KnowMe Please don't ping random people
 
@Joe Watkins - anyway, i won't ping him anymore now
 
don't ping me either !
 
@Joe Watkins - it doesn't mean to not ping him - am I not random to u then
@JoeWatkins -anyway thanks for ur advice - i won't ping him
 
lol
This is seriously golden :D
 
9:04 AM
much facepalm
 
don't ping me either - pings him 2 times instantly after xD
 
@Naruto - who are u talking about
 
@Danack No idea tbh I still need to properly look into the thing both src as well as for the gui
 
FlatBuffers ... show of hands, heard of it ?
 
Mornming all
 
9:12 AM
@Naruto keep quiet or get pinged to death
 
@SergeyTelshevsky People seem to forget that you can ignore others.
Tiny avatars ftw
 
@MadaraUchiha and miss all the fun? hell no!
 
@SergeyTelshevsky I already regretted saying something the moment I pressed enter ^^
@PeeHaa good meurning!
 
Mogguh
 
no hands ?
 
9:24 AM
good morning
 
@JoeWatkins o/
 
moin
 
christopher o/
 
 
@salathe It's a broken arm? :(
 
9:32 AM
0
Q: ajax posting to database and google contacts at same time

Know MeGood Afternoon. I am new to codeigniter, ajax and web - I want to know whether a view can call 2 (more than 1) functions in the model - 1 to make changes in the database and 1 to make changes in google contacts. If it is possible, how to do so. Thank you.

Hi guys, please help me if u can. Thanks a lot.
 
@PeeHaa I think it's more of an Italian driver's frustrated hand gesture
 
@PeeHaa it's whatever you want it to be, dear
 
I can't see it :(
 
@Orangepill - I am trying the way u told me
 
Get a real computer
 
9:42 AM
@Orangepill - do u know about this :ajax posting to database and google contacts at same time
 
Or just do this
 
@salathe :)
 
i'm on FF..
 
@Orangepill - tell me if u don't know
 
@rdlowrey I nominate @JoeWatkins and @PhilSturgeon
 
9:47 AM
For couple of the year?
 
No, that's @JoeWatkins and @rdlowrey, there's no point in nominating for that, it's a foregone conclusion
 
that's a thing
 
10:04 AM
Hi Guys
I want to ask something
 
$.ajax({
url : "<?php echo base_url(); ?>index.php/home/update_customer_record",
type: "post",
data: {
"expense" : post_array,
"group" : $('#group_select').val(),
"customer_id" : record_id,
"last_booking" : $('#last_booking').val(),
"search" : $('#search').val(),
"remarks" : $('#remarks').val(),
"name": $('#name').val(),
"phone_no": $('#phone_no').val(),
},
success: function(response2){

}
});
is it ok to have 2 url in this ajax
 
Damn
 
morning
 
Abe
10:18 AM
o/
 
@SergeyTelshevsky You had one job...
 
@DaveRandom Actually, I'm fairly sure that several people have messed up their jobs for that to happen :P
 
I blame the tea lady
 
Anonymous
is there anything wrong with using the same library for more than one site, as long as the application is sperated?
 
Anonymous
10:31 AM
in other words, use one symfony install for many sites, one bundle for one site..
 
Anonymous
but they share the libraries
 
why would you even do that from a floating platform
 
hi guyz, any one have idea about asterisk voip using php
 
Anonymous
@SergeyTelshevsky maintenance .. once you find a bug in your framework, you have to make a change in all the projects to .... or just one.
 
@samaYo lol :) I was talking about my link posted earlier :)
 
Anonymous
10:33 AM
:)
 
Splitting app features in bundles isn't a bad approach afaik
 
Hi guys
To have 2 url, is this ok:
 
@samaYo That's what composer global installs are for (and before that include_path), in general it's not considered a good idea. The only reason to do it would be to conserve disk space, that's not likely to be a real concern these days, disk space is cheap. However, there are many disadvantages - for example, if you migrate one app to use a newer version of a lib, you cannot update the lib until all apps that use it are updated.
tl;dr you can but don't
 
Abe
@DaveRandom ahahaha
 
Anonymous
10:38 AM
@DaveRandom good point
 
Hi guys, is there any room for ajax in stackoverflow chat
 
Anonymous

AJAX

If you hate jQuery & like AJAX, You are welcome :)
 
Anonymous
@Gordon unfreez pls
 
thank you samaYo
 
@samaYo Then you update all those projects, it's just a case of running composer update for each project, you could easily write a script to do that for you (just cd/composer update in a loop). Keeping in mind that at the top level application you should be committing the composer.lock file anyway, so you probably don't actually want to do this in any case from a VCS point of view.
 
Abe
10:39 AM
 
@samaYo - how to open it - thank yu
 
Anonymous
Yeah it's harder than it seems @DaveRandom
 
(this is quite a composer-centric argument but at the moment I think that's a valid angle)
 
@samaYo - can u send me the link pls
 
@Abe I'm picturing a man throwing expletives around and exclaiming "Mama Mia!" in an overly theatrical manner
 
10:41 AM
@samaYo - thank you
 
@Abe Your guess about what it does?
 
Abe
@DaveRandom lol
@PeeHaa yep
i guessed what it does reading apc documentation :P
 
You know opcache and apc aren't the same thing, right?
 
Abe
i know.
 
:-P
 
10:43 AM
It does what you say it does, but not for the reason you say it
 
Abe
that's why i said "i guessed" :P
 
> avoid caching partial files that aren't fully written yet by the editor that is saving them
 
@samaYo - busy ?
 
Abe
@PeeHaa editor / thing that is transferring the file
 
@PeeHaa Implying running opcache on a dev machine :-S
 
10:45 AM
@DaveRandom I do that, but only because of my work on the gui :P
 
Abe
@DaveRandom more like doing changes on a production machine :P
 
@PeeHaa E_TOO_META :-P
 
I would actually think editor saves are atomic?
 
@Abe /me tuts disapprovingly while pretending that I never type :wq on production machines
 
But yeah FTP transfers e.g.
 
10:47 AM
@PeeHaa, yes, thats the normal button combo for screenshots.
 
oh ok - i can open it now - @samaYo
@samaYo - thanks a lot
 
Button combo?
It's a swipe gesture :P
 
@PeeHaa flock() all the things!
 
@DaveRandom FTP?
 
Oh sorry, I seem to have done that thing where I've woken up in 1992 again, brb
 
10:49 AM
lol
 
/cc @Jimbo :-P
 
This javascript table search filter code is pretty cool considering how small it is too.
 
morning-bake..
 
11:07 AM
@DaveRandom What what?
 
each browser has its own cookie ?
If user logged in chrome, is it also login in firefox ?
 
/me flails wildly
 
@Leigh You're alive!
PHPNW?
 
naturally
 
:-)
 
11:11 AM
Been so incredibly busy with the new job, really really haven't felt like doing any code outside of work (which I guess is a good thing - getting my fill during the daytime)
 
11:24 AM
Hi all
Please somebody help me
1
Q: Why the inner array values are not getting sorted in ascending order of UNIX times tamp values in following scenario?

user2839497I've an multi-dimensional array titled $events as follows : print_r($events); Array ( [0] => Array ( [0] => Array ( [rsvp_id] => [is_liked] => [group_name] => Student Organisation ...

 
Abe
@ircmaxell your lib's Promise::bind and Maybe::bind are not compatible with that in Monad::bind. how would you fix them to not get the warning? was thinking to change Monad::bind to Monad::bindBase and make it protected
 
@user2839497 your arrays are nested more than your loops. You're sorting the 2nd level and not the 3rd
 
@Leigh:ok, please correct the mistake I'm making.
 
11:40 AM
correct it yourself
 
@PeeHaa Well, didn't read the second part, because the site was pretty slow on mobile.
 
:)
 
morning
 
@samaYo why? There is no point in unfreezing it just because one user asks whether there is an Ajax room. He'd just go in there, see that no one else is in and then leaves again. Then the room idles for seven days and freezes. So no. Sorry.
 
11:57 AM
@Abe Thanks....another setting then that only caters for people doing bad things.
 
Abe
eheh
 

« first day (1753 days earlier)      last day (3202 days later) »