« first day (1831 days earlier)      last day (3124 days later) » 

12:03 AM
@marcio need to look at it tomorrow again…
 
Hello PHP gurus, anyone of you is experienced on Wordpress? Can we cal wp_localize_script() a second time with the same $name and update the $data values?
1
Q: Update Data parameter of a localized script in Wordpress

Naourass DerouichiI'm working in a child theme, In my-page-template.php I have : //... $id_curr= 5; wp_localize_script('my_js', 'ajaxload', array('post_id' => $id_curr)); In my_js.js I have an AJAX call : $.ajax({ //... type: 'post', data: { action: 'ajax_load', post_id: ajaxload.post_id ...

 
12:59 AM
@samayo Native lib?
@marcio I'll add chat-main tomorrow, but actually chat is the most important repository.
 
1:57 AM
what's the most-raw way to do a doctrine query? want to use symfony goodness without most of the doctrine overhead (changesets, etc) for bulk inserts.
 
where do you get the zend oauth frame from?
 
2:27 AM
Morning's
 
2:42 AM
evenings
 
3:04 AM
nightsa
has anyone ever built with opauth?
 
not really
 
i'm trying to figure out how to integrate it into my site
 
morning
 
you mean oauth? there should be a number of guides out there
it's somewhat of a standard, so you can implement yourself, or there are probably libraries you can use
 
try google oauth
 
Anonymous
3:24 AM
@Trowski lazy and dumb question, why does icicle require apache, if it is a 'server'?
 
3:39 AM
opauth the framework
 
@samayo It doesn't require Apache.
He just was using Apache to serve static files. I never would have done it that way... I don't know why he did.
 
Anonymous
It's strange
 
The filesystem component wasn't ready when he wrote that article, that's probably why.
Now you can write a complete HTTP server with Icicle, no need to use anything else to serve files.
I hope to post the WebSocket package in a day or two.
 
Anonymous
You can tell him the update the article, if that is possible.
 
Anonymous
I think they update articles from time to time
 
3:47 AM
We'd have to ask the editor, but yeah, updating would help.
 
good morning
 
@Orangepill Morning
 
@trowski you ready for madison?
 
@Orangepill heh, no, I haven't made my slides yet.
I just wrote an article about the same topic, so I have most of the content.
 
4:06 AM
you publish the article yet...
I'm still on the fence if I am going or not. I start the new gig next monday.
 
@Orangepill The article is for php[architect], will be in the November issue.
@Orangepill Should go if you can manage it. Where are you going to be working?
 
@Trowski WhenIWork.com in St.Paul
 
hi
 
remote work but onboarding will be in the office.
hi
 
4:21 AM
@Orangepill I'm looking for something new right now. I'd like to be able to work from St. Cloud, but I would have no problem driving to the cities occasionally, even a few times a week sometimes.
 
@Orangepill OMG they run PHP 5.5!
These guys are bleeding edge.
ohh looky and laravel too
 
@Sherif who?
 
WhenIWork.com
Your new employer?
 
@Orangepill Looks like they're hiring another full-stack PHP developer, suppose I could apply.
 
@trowski you should
@sherif they are using HHVM... where do you see the laravel thing?
 
4:24 AM
I like the idea of pants being optional when going to "work"
 
Inspect headers
> X-Powered-By: PHP/5.5.29-1+deb.sury.org~trusty+3
Cache-Control: no-cache
Date: Wed, 21 Oct 2015 04:22:54 GMT
Set-Cookie: laravel_session=
 
@Orangepill Should get them to switch to PHP 7 :P
 
@trowski They are excited about 7
 
I'm shocked that Jazz is becoming a serious competitor to Greenhouse.io
These guys did just about everything wrong for the last 3 years and their investors just kept handing them more money.
 
@sherif the app isn't laravel... just the site.
 
4:30 AM
@Orangepill Yea, never used the app. Was just looking at the home page.
 
app is in kohana but they are migrating to sparkphp
they have some really smart people working there ...I'm looking forward to learning a lot from them.
 
Spark is cool.
But it's also one of those things that makes me think... hmmm... it's so dumb it's brilliant!
 
yeah... it's very concise and clean
 
clean is an illusion these days
clean gets dirty real quick every time you touch it
It's like quantum cryptography. Everytime you look at it - it changes.
 
I like that it's up to the developer to put the dirty in..... It doesn't come that way.
 
4:38 AM
I really need to do something interesting with phplab.io
 
That has a lot of possibilities
 
Well, it was going to be the new realestate for my PHP coding exercise platform which I was hoping to put on php.io originally, but someone snagged it from me literally moments before I was able to register it.
 
The php testing/training tool should definitely find a home there.
 
Yea that thing needs a lot of work. Maybe when I get some downtime coming holiday.
 
It's a really cool idea
 
4:46 AM
@Sherif Pretty neat so far.
 
I was actually pondering putting it in a startup incubator last summer, but I really don't want to go back to building a company from scratch again.
There's a huge market where codecademy is right now and there are investors seeking to disrupt it.
 
How much code goes into each of the exercises?
 
shrug it's just a prototype. The idea was to prove you could teach someone to code something simple and have an autonomous system infer whether the code would work or not.
codecademy's business model was genius though. Give it to all the students for free :D
smart SOBs
 
The idea is a winner IMO ... provided that the quality of the content says high.
 
What do you mean by content?
 
5:02 AM
The exercises themself.
 
morning day dwellers
@SalmanShahid hola
 
Man someone added me to laravellist group on twitter.
How they can do it :P
 
there is nothing wrong in it.. may be even laravel is bad but you can surely learn many things from it
also i am not against it at all... though it doesnt mean i want to use it.. though using it isnt pan either in most cases
 
5:18 AM
@NullPoiиteя Can't understand you! :(
 
hola => Similar to hey! or hi! :)
 
Yeah but I never touched laravel so it's shocking that they added me to grp :P
And mornin
 
@NullPoiиteя :) which language is this?
 
afaik Spanish
 
5:25 AM
@Orangepill no problem any more buddy i am getting used to of it :)
 
@NullPoiиteя that one wasn't for you.
 
\o
http://stackoverflow.com/questions/33251433/how-to-create-website-li‌​ke-yahoo-email-page-neo-launch-rand-cj4likvk6u3i6642
also ^
http://stackoverflow.com/q/33251594/1723893
 
Abe
5:49 AM
 
Guyz i have a question about object oriented programming i want you expert guyz to check my class if any vulnerability or bad approach or any other bug. Should i post my class here?
 
@SalmanShahid you shouldnt post code directly in the chat room. Use some pastebin service (like gist) and past the link here
also, writing words with "z" in them, makes you sound like a 12-year-old
 
how's your health now?? are you ok now!
 
I like zebras
 
@AnmolRaghuvanshi I am not 100% .. yet
 
6:02 AM
get well soon :)
 
moin
 
morning Joe
 
@LGL to do that task (access to private url i hade to use cloudfront with cookie )
 
6:17 AM
@tereško Thanks for criticism That will definitely help. :)
 
\o
 
Abe
moto ambulance in warsaw youtube.com/watch?v=DPK8UXkh0Nc get first aid in a couple of minutes
 
6:29 AM
@Abe I was expecting to see someone passed out or having a heart attack at the end of that. Did he just park at a police station?
 
@Abe pretty cool, can't imagine a car getting through that traffic
 
Abe
just a demo
why don't we have motorbike ambulances everywhere? they are just perfect for that
 
I wouldn't classify it as a ambulance.
 
An ambulance needs to actually transport people to a hospital.
 
^
 
6:32 AM
Also, you can't fit an oxygen tank on a motorcycle.
 
I mean sure, if you broke a arm or have some minor accident then perhaps you could fit on the bike, but anything else would really require a proper car.
 
posted on October 21, 2015 by nlecointre

/* by chole */

 
Abe
but for first aid is awesome, eventually an actual ambulance will arrive
 
On that we agree.
It's a faster alternative than the "doctor car" (No idea what it's translates to properly).
 
just fyi, there are paramedic bikes in uk ... and they have a bunch of equipment on them ....
 
Abe
6:34 AM
a lot of people dies because no one around can give first aid (properly)
 
> All single responders have been fully trained to work on their own. Our motorcycles carry the same life-saving equipment as ambulances, including a defibrillator—a machine used to restart a patient’s heart when they have had a cardiac arrest.
 
Abe
@JoeWatkins awesome!
 
there's a big push for big shops to have defibs in them at the moment, lots already do but at their own expense, and it's considerable expense, I think the health service will provide them eventually
 
Although they should put a drug addict / criminal on one of those cars / bikes, and tell him that the destination is a safe place, I'd like to see anyone get there faster, and with the cars/bikes own sirens the criminal would panic thinking the police was on his tail all the way :D
 
Abe
lol
 
6:45 AM
Please check this class and leave your comments if you found any vulnerabilities or bugs thanks gist.github.com/salmanshahid527/8cb2d60736e1a69d3788
 
Abe
class User extends DB
@SalmanShahid __seter and __geter are bad. get rid of them. you should inject data using the constructor __construct($firstname, $surname, $stuff). the constructor is not optional, setters are
 
Mornigfn
 
Abe
also you should separate the domain from the infrastructure, the queries must stay in a different class:
$user = $userMapper->fetch($ID);
@PeeHaa yo o/
also, how does this help you handle problems?
catch(Exception $px){
echo($px->getMessage());
}
and most importantly, don't mix tabs and spaces...
 
good mornings
 
7:01 AM
the queries must stay in a different class: Can you post any example please?
 
@SalmanShahid oh dear ... what a mess
first of all, "extends" roughly translates as "is a"
so, what you have basically written there means "User is a Database", which is kinda insulting
and then are those __geter() and __seter() methods
what is the point of those?
also the User::get_user() method make no sense. Do you really have a table where there will be only a single row?
 
TL;DR your code is bad and you should feel bad ...
 
Its an example. It is actually Login user i have updated
 
well, your "example" is a sample of really bad code
 
7:12 AM
'extends' is also considered evil ?
 
@AnmolRaghuvanshi no, but it's common for newbies to abuse LSP
 
ok see this did you consult this to read ibm.com/developerworks/library/os-php-7oohabits
 
hi
 
morning!
 
7:32 AM
hmmm... I think I just discovered an interesting way to abuse android's photo backups
I wonder if anyone else has caught on to this yet
 
@Sherif Making dickpics and sharing it in a whatsapp group is hardly interesting anymore... :P
 
@Abe Thanks that will help. But one thing that i'm seeing this structure first time. :)
Is this the advanced approached used in OOP?
 
Abe
kinda, it's a start @SalmanShahid
 
Hi dudes
I'm new to here
 
7:46 AM
hi Trevane
 
help masters i want to load page without refreshing the page im using codeigniter
 
i have use ajax still error thou
 
What is error
 
morning guys
 
7:50 AM
Good afternoon as per india timings :-)
 
anyone who can give me a headsup on where I can find good beginner materials for task queues on PHP
 
i debug it using firebug the error is GET localhost/url/undefined where in undefined i already define the page thou
 
in Ci Ajax URL
is different for example : url: '<?php echo base_url()."ajax/test";?>',
 
w8 @SiddhuSiddharthaRoy i will my code here
$(document).ready(function(){
$("a").click(function(){
var page = $(this).attr('href');
$(".container").load("<?php echo base_url('');?>"+ page)
});

});
 
see your base_url is wrong
remove "" in your base url function
<?php echo base_url();?>
 
7:55 AM
k let me try
 
Great @Micaela
 
@SiddhuSiddharthaRoy im i doing it right or not $("ul.sidebar-nav a li").click(function(){ or $("ul.sidebar-nav, a, li").click(function(){
 
has someone been able to get to @DaveRandom?
 
Negative
 
8:00 AM
Instead of taking all ul and li
give to them dynamic ids
Id="exp1"
Id="exp2"
like that.. then directly call event id
to get accurate result
 
k let me try @SiddhuSiddharthaRoy
 
I hope he is okay
 
@SiddhuSiddharthaRoy it works tnx
 
:-) welcome
 
8:10 AM
morning Jimbo
 
ohayoo! sensei @Jimbo
 
Abe
morning
@bwoebi i think most of people hated having to import variables in the closure's scope using "use", but with the new syntax the auto import won't work if you still want a multiline body, am i right?
$x = 10;
$result = array_map(function() => {
    return $x * 2;
}, $elements);
would this work?
what do u want, you don't even use php anymore :P
 
@Abe Yeah, wrong room :D
 
Abe
ahaha
 
Saw the syntax function() => { and thought wtf is this?
Then saw the $
 
Abe
8:20 AM
:P
wtf is this -> it's php :D
 
should it be >=
 
@TrevaneJeminico It should be <==3
 
lol
and return should be return x*2;
 
@Abe No wait, I'm right and you're an idiot
The shortened syntax is { $x * 2; }
 
@madara you still fighting
 
8:23 AM
Not your function() => { abomination
 
@MadaraUchiha can you explain the codesnippit he just post
 
Abe
there is a new rfc, idiot
function($foo) ____
                   \____,---->> { return $foo * $baz; }
 
8:25 AM
E_TOO_MANY_RFCS
 
Mornin'!
Anyone kicked off with Aerys yet?
 
Aerys still new to it and a bit confused
 
Abe
new rfc is:
$a = 10;
// a is undefined, anon func (requires use() for to function)
(function(){ return $a + 10; })();

// a is defined, closure-ish
(function() => $a + 10; )();

// would also add:
(function() => { return $a + 10; })();
 
@Abe What's the point of that?
Link to RFC?
 
@abe why $a still used as $a
 
Abe
8:28 AM
shorter syntax and auto imported variables
 
Been loving the shorter syntax in ES6
 
o/ -- Almost friday
 
Abe
scalar values are imported by value and not by ref, and local closure variables are just local
you can only return them
 
are there any tutorials regarding rfc @Abe
 
Also makes stuff like array_reduce so much nicer
 
8:30 AM
/me looks up array clone
 
@Abe is there any tutorial regarding rfc
 
Abe
can someone kick him pls
 
posted on October 21, 2015 by nlecointre

/* by webbeur */

 
Abe
@MadaraUchiha
js:
var x = 5;
(function(){ x = x + 10; })();
// x is 15

php:
$x = 5;
(function() => $x = $x + 10)();
// $x is 5
sorry for multiple pings :P
basically, you can't write variables in outer scopes
 
8:37 AM
@Abe if you were to do $x=5; function(){$x =$x+10; return $x} //$x=15 yes/no?
 
Abe
yes, you can only return stuff
 
and it would overwrite x to 15 yes?
 
Abe
only if you assign it explicitly
$x = 5;
$x = (function() => { return $x + 10; })();
 
@Abe his asking if $x=15 if return
 
on what version of php does the above apply for?
syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting '{'
 
8:51 AM
@Abe If you didn't want confusion with the array separator, why the hell would they want to use =>
PHP tried to adapt these features from other languages, but completely misses the point
 
@GotaloveCode PHP7 presumably
 
function($x) => $x + 5 is not significantly shorter than function($x) { return $x + 5; }
function($x) => { return $x + 5; } is longer than function($x) { return $x + 5; }
 
Abe
@MadaraUchiha you mean the fact that variables are local? i agree, but nobody had a valid argument against it
 
@Abe I even prefers Java's approach to closures over PHP's
And that says something
In Java, if you want to pass a variable into a closure, it must be final or effectively final
That is, it must not change since it was defined (similar to JS's const)
And that's it, the compiler determines whether or not I can pass this variable in
Why do I have to hint the compiler in PHP what should be passed in and what should not?
Why can it not figure it out on its own?
From what I read the proposed syntax is there just to overcome that stupid use keyword that serves absolutely no purpose aside from annoying anyone who even thinks of writing functional in PHP.
 
I like Java's syntax better than PHP's
fn( ($x, $y) -> { return $x + $y} ) is quite nice and concise
 
9:04 AM
@Gordon Java did a lot of very right things in Java 8
A lot of the woes of the past were corrected (or at least aimed to be corrected)
 
Hi everyone. I would like to use imagecopyresampled() and the second parameter is the $image which is from imagecreatefromjpeg().. if i have the image data can i simply just have that as in the $image or do i need to use imagecreatefromjpeg()?
 
9:20 AM
If I'm creating an object which is based around an XML string, should I accept that string as the constructor or use a method like setInput()?
 
@Sean What is the objects primary responsibility?
 
Api Response
 
To "represent" the contents of an XML string, as in, map some of it's attributes to an object?
 
Yeah, pretty much.
 
Don't forget, your object must only exist in a valid state. Therefore, you could make your object with all the constructor parameters as it's properties for it to exist in a valid state, then use a factory|mapper to build that object from the xml.
 
9:27 AM
@Jimbo I think I need to look into a bit more about what you said before I can absolutely understand it ^^, but thanks!
 
@Sean $factory->createFromXml($xml); // returns ApiResponse :-)
 
when i call "use Zend\Mvc\Controller\AbstractActionController;" or something like that whats mechanism runs behind the scene?
@Gordon when i call "use Zend\Mvc\Controller\AbstractActionController;" or something like that whats mechanism runs behind the scene?
 
@Jimbo So the factory does all the translating from XML to the specific properties / data, which could then be provided to a new instance of the response class?
 
@NeelIon why would you ask me specifically?!
 
@Sean You can do it however you like in the factory, even use another object to map the properties / validate etc. But in essence, you call your factory, you get back what you want or an exception
 
9:31 AM
Yeah, makes total sense.
Thanks!
 
@NeelIon google "zend framework dispatch process". it will probably give you the answer you are looking for
 
@Gordon i think you are the right person and who works with zend framework
 
@NeelIon I don't know why you think that. I haven't used ZF for years. I basically know nothing about ZF2.
 
:D
 
hi guys
my ajax call stopped working when I moved my code to another server but to that another I haven't linked my domain name .So I am accessing my site using ip address only .. Its giving me error. "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at 1.1.1.1/myfolder/main.php. This can be fixed by moving the resource to the same domain or enabling CORS."
any idea?
 
9:51 AM
@Gordon sorry in advance, is that a trait or what?
 
@John Read into Cross Origin Requests and workarounds if you -really- need to. Something like JSONP could be a temporary bandaid until you're all set up.
There's a fair amount of solutions for it though, I'm positive that Stack Overflow has plenty of answers around the subject.
 
What is mean of "CPU: 1core - 2.4GHz" ? It is mean the CPU will process 2.4 Gb/Sec ?
 
maximum of 2.4 giga/hertz per sec.
 
44
A: How does Access-Control-Allow-Origin header work?

Wayne YeCross-Origin Request Sharing - CORS (A.K.A. Cross-Domain AJAX request) is an issue that most web developers might encounter, according to Same-Origin-Policy, browsers restrict client JavaScript in a security sandbox, usually JS cannot directly communicate with a remote server from a different dom...

 
Abe
@Duikboot u fooled me, thought it was thursday youtube.com/watch?v=T63BuCh190U :|
 
9:56 AM
@TrevaneJeminico tnx
 
@Sajad np if this is a desktop processor you can over-clock the process sample 2.4ghz to 3.0 ghz but over-clock at your own risk
 
no, it is a server
 
oh then its a maximum
 
@Duikboot asshole :P
 
yeah !
 

« first day (1831 days earlier)      last day (3124 days later) »