« first day (927 days earlier)      last day (4246 days later) » 

10:02
can I write like this
echo "<option value='$user_arr[$i]->employee_name'>$user_arr[$i]->employee_name</option>";
printf(
    '<option value="%1$s">%1$s</option>',
    htmlspecialchars($user_arr[$i]->employee_name)
);
morning
@Gordon kind of you bro :)
@Gordon its working but can you pl explain what is this %1$s
How to reduce load on wordpress blog??
10:07
@udaysagar stop writing blog posts people want to read?
@Gordon I know that %d and %s (I admit that I never used them in my practical life), but I never thought of such statement. thanks.
@TheLuckyGoof be careful with argument swapping (the 1$ element of the format string) - make sure you use single quotes for the PHP string. Consider "%1$s" - this will come out as %1<value of the variable $s> - if $s exists it will use that value, if it doesn't it will come out as %1 and you will get and undefined variable warning
I really wish they had chosen a different character for the arg swap modifier :-(
That has bitten me more than once
@DaveRandom you could still write it without the numbered argument
@udaysagar get rid of most of the plugins, install and activate some caching, get a better hosting, go to wordpress.stackexchange.com and if you're still slow, get rid of wordpress and write on something lighter
10:14
printf(
    '<option value="%s">%s</option>',
    htmlspecialchars($user_arr[$i]->employee_name)
    htmlspecialchars($user_arr[$i]->employee_name)
);
would work, too
@DaveRandom @Gordon thanks for helping me in understanding how mature(immature) i'm
@Gordon Oh yes of course you could, but the first option is much better/cleaner. You just need to be aware of that little pitfall
No speakers :-(
@Gordon All hail me!
Good news everyone
10:25
@PeeHaa埽 Hail King @PeeHaa埽
user652649
@Wes why is it showing me this? Oo
user652649
old games, like pitfall ... :P
pitfall was awesome
user652649
i still often play to prince of persia 1 & 2
user652649
10:29
one of the greatest games ever made youtube.com/watch?v=UgKP0kYnGmU
I prefer LucasArts point and clicks
@DaveRandom yay
full throttle ftw!
@Gordon When can I decide Im ready for using a framework like CI, Laravel, CakePHP, Zend.... Fuel....
@Duikboot If you still talk about ci, cake etc you are not ready
@PeeHaa埽 I love that it has Mark Hamill as Ripburger
Also Indiana Jones and The Fate of Atlantis is awesome
10:32
Oeh Indiana Jones. yeah
I was kinda disappointed when it wasn't the story for the 4th movie. Although having seen the 4th movie I'm now glad it wasn't
CI = dead
@Duikboot s/dead/crap
:D
What about CakePHP?
The Cake Is A Lie
10:33
@Duikboot Worse
@Duikboot when you can write the majority of the framework's functionality yourself
Ask @Gordon for recent hands on experience
user652649
@DaveRandom did you glimpse at this github.com/WesNetmo/php-template-inheritance yet?
user652649
morning @PeeHaa埽
10:36
@Wes mornigins
@Wes Wes Netmo and the Template of Doom
user652649
:(
i didnt look at it. im just making puns
@Wes Why use late static bindings when you have declared the class final?
@Wes Why is everything a static?
10:38
@PeeHaa埽 "These aren't the frameworks you are looking for"
user652649
it's just a test, could be easily rewritten using oop
Also we often only fully uppercase our names when they are constants by convention
Also I don't like $THIS, firstly I don't like people shouting their name at me from across the room and secondly calling a variable $this in any context other than its real meaning is pretty opaque
@Wes Remember that this is pretty much the worst possible place to come to ask for a code review if you want a positive review :-P
user652649
you can change that variable name, it's used in the user space... can be named as you wish
And what does renderInternal do that you need to keep track whether you are rendering static::$RENDERING = true; / static::$RENDERING = false;?
user652649
10:40
@DaveRandom that's why i'm asking here
user652649
@PeeHaa埽 YOU as I said it's just a test. i was seriously drunk when i wrote that :P
user652649
i want you judge the idea not the actual implementation
user652649
:P
"$THIS IS SPARTA"
@Bracketworks $THIS = 'SPARTA';
10:44
@DaveRandom Better ;)
I'm gonna start putting that in every project
user652649
:(
Reassignment of $this to Sparta?
user652649
i hate you all.
@Wes Nah, you love us :)
10:46
posted on April 29, 2013 by Evert Pot

I just launched a new version of my blog, and you're looking at it :). I've went through a number of platforms, most recently habari, which I still have a lot of love for. But my installation was going rapidly out of date, was becoming very slow due to using Sqlite as a backend, and most of all, I wanted to use GitHub to store my posts so everyone can make edits. So I settled on using Jekyl

I don't care about your new personal blog, @Feeds (The link for which doesn't even work)
$sparta = $this. Then work with $sparta all the time
sick if $this ? use $that $that=$this; :)
No no no! Closures everywhere! Rebind the context! Rebind EVERYTHING!
user652649
:(
10:49
Seriously though, reassigning or repurposing $this is (or will be at some point) confusing. Even closure rebinding will catch you off guard if you're not careful (not to mention most IDEs dunno wtf $this is anymore and you lose autocomplete)
user652649
that's not $this, it's a reference to the instance inside the closure
@Gordon HCOONa matata got me
lol
@Bracketworks I could totally relate to write < or >. I would have written the same :)
@Gordon lol, I could relate to several of these; I used to draw answers all the time.
Overall, I think I came out in the positives ;)
10:55
Pic of giraffe and invigilator saying +1 for it got me
"When I am 16 or 20, I will buy my own hores" -- Ahh 17? Damn, missed the boat; 3 more years.
I'm still giggling at the fallopian feline.
can anybody help me with Zend framework 2
?
still on strike?
8
Q: Replace every character with an element

Jens TörnellThis is what I have $str = 'Just a <span class="green">little</span> -text åäö width 123#'; This is what I need Results in spans and spaces, might be newlines as well. $result = '<span></span><span></span><span></span><span></span> <span></span> <span class="green"><span></span><span></span><...

@kaᵠ by an anonymous user
Hi All of you
@Gordon the guy surely has an account, maybe you have an ip or some tool...
@Bracketworks Pretty certain you can't reassign $this, it's built-in.
@Shyam Hi just you
11:17
unset $this); $this=false; ?
That seems very wrong...from a philisophical point of view in any case. ;)
we could increase this uptake of programming in the classroom by changing $this to $dis
@kaᵠ i'd rather say he is deleted already
@DaveRandom Of all the bad things PHP is it still isn't javascript :P
11:19
and having "fo" loops
k @G just thought to announce some clear vandalism
@kaᵠ codepad.viper-7.com/xyNrxo - looks like it's an error at compile time as well (note that the first var_dump() isn't executed either)
hi all
@Leigh lol
11:21
hello
lol SIGSEGV
bug?
Looks like it, same in 5.4.9 as well. Needs reporting if there isn't a report already
gonna be pretty low priority though, E_PEBKAC is not really something internals should be devoting time to...
@DaveRandom Doubt they will "fix" that
11:24
The fix should be to blow up if you try to unset($this)
@DaveRandom Yes, it's a compiler error (most of the time): lxr.php.net/xref/PHP_5_5/Zend/zend_compile.c#960
@DaveRandom I would vote on that
@DaveRandom true ^
Hello
11:25
Hola
I'm going to get so drunk soon
Hmm, this is definitely a bug though: codepad.viper-7.com/XPqsq6
nice
@DaveRandom as is this: codepad.viper-7.com/gb3Lc4
@DaveRandom Stop looking for those wicked edge cases or you'll open pandoras box
11:27
#fail
@PeeHaa埽 Pass by ref isn't that much of an edge case. You could conceivably want to do that, and it would be a real f*cker of a bug to track down
My doubt is about : pastebin.com/rSrAf0B1 why the second foreach if it's once looped why wont loop anymore?
@DaveRandom pass by ref is always an edge-case, especially when you're actually using it...
@rokimoki: how did you find it won't iterate for the second time?
He's British. They just love to pass shit by ref over there
11:32
mysql between dates returning empty set, any suggestions...
http://pastebin.com/Ysv1KBwD
thanks
@zerkms I did some echo's
@rokimoki: where?
@kaᵠ HUH?
not in that example... I resumed
@TheLuckyGoof: when you're asking a question about mysql - remove everything irrelevant
Holy SQL Injection batman!
@TheLuckyGoof: how are we supposed to know what's in $start_date?
@ircmaxell: he uses mysqli, so it's fine ))
@zerkms its in yyyy-mm-dd format, no issues with that, even in db, its stored in same format with date as datatype
@TheLuckyGoof: so if it's fine - then the query works as expected
... by mysql developers
well... bye i'll figure it out, thanks
11:36
@TheLuckyGoof: but still - if you want a particular answer - ask a particular question. Without any php - just a plain sql
@zerkms lol
hello everyone
anybody knows wordpress?
Good news everyone
@PeeHaa埽: I'm just tired of people thinking that a proper DB client makes an app more secure. The opposite is true as well
and especially tired of "stop using mysql_*" in every mysql-and-php related question
I kinda agree
11:38
@zerkms i just copied the whole code for understanding and cross verification (if am wrong with php-mysqli)
@TheLuckyGoof: copying the whole code isn't helpful. If you want to ask something about mysql behaviour - provide us a plain sql query. That simple
Hey everyone i wanna build a community is php the right language to write it in??
Best regards SP
@SimonPertersen 42
hello
Best regards The King of The Netherlands
11:40
anybody knows wordpress?
No need to keep repeating your question @User25
@User25 whats the issue
@TheLuckyGoof: following your idea he will now copy the whole WP sources here ;-P
@PeeHaa埽 hi
@PeeHaa埽 ???
@zerkms is it sin to paste in pastebin and provide the relative link here !
@SimonPertersen tinyurl.com/9mc4tyc
It'll never get fixed obviously, but at least now its reported others will have something to reference
looool
11:43
@Gordon: LOL!!!!!!
mad skillz
Anthony "Bruce Wayne" Ferrara
@zerkms i have read the guide to the gallaxy

But it dosn't really help me in my search for an answer of php is a good language to write a community in
posted on April 30, 2013 by Henri Bergius

The web is built of links, of pages linking to other resources on the internet. But making those links manually is tedious. This is another area where modern inline editors could do better. Yesterday on Hacker News, there was a thread about Wikidata, Wikimedia Foundation's new knowledge base. This comment struck me especially: I was using Wikipedia the other day and it occurred to me how pr

@Gordon shhhhhhhhhhhhhhhhhhh
why you gotta blow my cover like that?
@SimonPertersen: now you know what is 42
11:47
@SimonPertersen It's the only true answer to your question
@ircmaxell How would I know it's really you? Commissioner Gordon never knew it either. And that guy on the picture is wearing a mask
i get where your going - you cant really explain which is better and no one can so its a question thats still unanswer = 42
@SimonPertersen: the original question just doesn't have an answer
it's like - what would I eat - an apple or a grapefruit?
how could you know which I like better?
@Gordon lol
Hey
11:51
thx for the answer tough :) im a front end developer in day time and i know abit of php but does it have any advantages compaired to C# ?
could anyone please me with this ?stackoverflow.com/questions/16297730/…
1
Q: Image upload from smartphone fails

ItamarI've built a website which allows image uploading and once an image is uploaded , some specific information about the photo is displayed. Uploading pictures from computers works just fine , the problem comes up when I'm trying to upload an image from a smartphone. The upload success but it seems ...

@SimonPertersen It runs on nix machines
@zerkms yeah it is working as expected, I was entering the dates between which its null
I've been trying to upload the same image from both computer and smartphone and recieved different results , and I don't have a clue about what makes that happen
@PeeHaa埽: you may run c# on linux as well :-)
@SimonPertersen: "advantages" is something vague as well. If you're in doubts - choose the one you know better
and keep in mind that every project implemented with a completely new (for you) technology should be deleted after (with very rare exceptions)
11:54
@zerkms Isn't that... painful at best?
Thanks for your "precise" answers :)

But iv'd just asked the people i work with and they work with c# but i like and better know PHP so i ofc prefer that
are we on strike today .. ?
:P
@zerkms c# on linux ... woot :P
0
Q: Editing a starred post in chat breaks display for user who starred it

David X. RandomSteps to reproduce: User A posts a message User B stars it, the star next to the post appears yellow User A edits the post The display of the star in User B's view becomes black, as if they haven't starred it This is the worst bug ever in the history of StackExchange and makes the entire netw...

@PeeHaa埽: when I've been a fulltime linux desktop user - I've run several .net apps. And it wasn't something unnatural :-)
11:56
hhmhmmm
@zerkms That all runs on mono right?
guys, c++, java or c# - what would you recommend to continue mastering for me (as for a person who is bored of php)
@PeeHaa埽: yup
or 42?
@zerkms algol
@Leigh: malbolge
@zerkms c++
Go for C, and learn it while poking at php-src
12:01
C makes me sad with its lack of object model
@zerkms then c++
if (!c) c++;
@zerkms c/c++, brainfuck and whitespace are a must
@kaᵠ Congratulations. You just proved Gordwin's Law!
12:05
@zerkms c++ :)
@Gordon do I get a prize from gate A/B/C ?
@Gordon: a programmers modification about brainfuck?
Apr 15 at 13:29, by Gordon
Brainfuck is the Hitler of Programming Language Discussions #godwin
2
CI lovers help me please ;) stackoverflow.com/questions/16299443/…
@kaᵠ yes!!!
12:06
@okok loooool
yes, please...
star this message if when you see CI you're thinking about Continuous Integration not about Codeigniter
ci lovers, in this chatroom...
@NikiC can't understand why you lol , but LOL
@okok asking for CI lover's in here is like asking for red meat at a vegetarian's ball.
12:07
@Gordon i didn't compare anything, so not proven yet
there's a CI dedicated chat room, by the way :P
/ping
\pong
12:26
/elho
@Gordon so what you like ? ... Zend :/
hope laravel at least :P
ACK
lol ^
preferred scene yep
@PeeHaa埽 ebuddy admins :D
12:33
:)
IllumiRoom looks really cool
@Gordon what?
@Gordon epic, I bought 3D tv few days ago, can't stop watching :D
@kaᵠ BLAM?
12:39
that's low res unfoirttunatelly
can't stop laughing
can you watch 3D on laptop screen with "active" glasses? if someone knows...
@cryptic second letter from the left fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-prn1/…
@webarto Should work as long as the resolution/response time is good enough
(of the panel)
@DaveRandom Nice info mate, you know all the things.
user image
3
:)
12:52
:D
Tomorrow, it's BBQ time... it's silly how in poor countries they celebrate, and in rich ones they strike...
which would be better...
1. Use an array to store class properties (1 for privates and 1 for publics)
2. Use different variables
a. Use magic setters and getters
b. Use different functions for each property.
@webarto Realistically you'd have to suck it an see. But the real magic of active 3D is in the glasses so in theory it should work with any display capable of rendering the input video source precisely as it's encoded (i.e. without any "error correction" algos getting in the way).
@webarto We need to defend the city against Neonazis tomorrow.
@DaveRandom My thoughts exactly, don't know why they sell TV's as 3D when you need active glasses. They are cheaper, but if you buy 4 pairs of glasses it's the same price in the end.
12:57
any one knows about best domain reseller
there's no such thing
GoDaddy
Best regarding price and support
GoDaddy
@webarto Personally the tech is nowhere near ready for me to spend any money on it. I can't see the 3D TVs of 5 years from now being anything like the current systems, and we will quite likely encounter at least a couple of BC breaks between here and there.
13:00
@webarto dont support teh evil
@DaveRandom Don't know much about it, but I think LG kicks ass in that field, I bought everything LG, it's cheap(er) and it's quality. I agree, but you gotta buy something, consumer electronics, they say :)
@Gordon I'm just trying to demonstrate what's he asking is highly subjective.
I know some people that wanted to give their daughters to MediaTemple and that hosting always sucked for me.
@webarto optimist :)
@Gordon At some point in the year :P
Follow me, Google.
am just thinking .. google saves all my customization preferences in database?
@TheLuckyGoof no. they have people write it down on paper and type it back in whenever you need them :P
13:12
@Gordon somewhat reminds me of google.com/technology/pigeonrank.html and spell check dude :D
@webarto yes. that's how it works. I just confused people with pigeons. both start with a p.
> ... Page and Brin reasoned that low cost pigeon clusters (PCs) could be used to compute ...
@webarto some way it is related to my question!
I'm making "AdSense" sites, goal is to make enough money to at least pay the bills, anyone else here doing the same thing and cares to give a few advices?
@webarto that time has kinda passed, but if you must... get some valuable and unique information that's the best advice
13:22
It's not entirely, Google makes most revenue from AdSense.
Or not :P
@Gordon 3v4l.org/7DNMU this is good?
Modern forum software by Jeff Atwood: codinghorror.com/blog/2013/02/…
The downside is that it requires Ruby on Rails, PostgreSQL, and Redis 2.6+
user652649
@webarto me! hey chap how are you? :P
@LeviMorrison and the UI sucks (at least last time I checked)
I can understand not wanting to use PHP, Jeff, but Ruby on Rails, PostgreSQL, and Redis 2.6+? Seriously?
Do you want people to actually use this?
13:26
@Wes Hey Wes, short on money, as you can assume :P
@LeviMorrison or to put more bluntly: I dont see this to be anywhere close a phpbb killer
user652649
lol
If you want to be Wordpress of forum software, then write it in PHP. Holy cow, Jeff! How did you miss that critical piece?
@webarto develop an addicted audience. not usually easy with your particular expertise (programming), but definitely a sustainable income model. i have a couple sites that i recap baseball games on, and i get ~50,000 page views per site with only ~1,000 uniques
@LeviMorrison people don't use rails?
@iroegbu explain the code to me please (i understand it but I want you to do it anyway).
13:27
@LeviMorrison hey nothing wrong with postgres
user652649
main problem of adsense are the publishers, not how you implement it. are you starting a new site?
@dyelawn Redis is hardly used and I like Postgres but it's not nearly as popular as other SQL databases.
My point was that it's a strange stack to build something you want DEEP market penetration with.
@LeviMorrison we used redis at the last project
@Gordon I'm just looking at using __get() and __set()
@iroegbu no, please. tell me what the code achieves. in plain english.
13:29
is it better or should I use different functions for each property
user895378
> Occasionally, startups will ask me for advice. That's a shame, because I am a terrible person to ask for advice.
this does nothing
@LeviMorrison don't know anything about redis and never used postgres in real life, so i'd agree on those two. i'd have left rails out though :)
@iroegbu if it does nothing, you can delete it. no need to have code that does nothing.
@iroegbu why did you write it if it does nothing?
@dyelawn Something like that, I had a site with 6-7k uniques and it generated about $200 per months solely from AdSense no one clicked on, but I don't have that site anymore. Thanks :)
13:31
morning friends
@Gordon was just playing aroung with magic fns, I wondering why I can $bar->fooId = 2
@iroegbu you are evading my questions :)
@webarto dont know your interests, but if you follow anything on an almost daily basis that makes it crazy easy. people are inclined to check daily, you can easily add content daily
because of the kind of setter function, note that $fooId is private
I wrote it to test out the __set() function
@iroegbu what you did was create private properties you can get and set like public properties. Which effectively does makes them public. But because PHP already allows setting of public properties out of the box the whole code is - sorry to say - pointless.
13:34
re: rails, i am especially enjoying this: github.com/RailsApps/rails-composer
@DaveRandom Certainly, but I'm pretty certain I've seen some hacks that don't involve closure rebinding.
Not use either, since can't 'use' $this, a lexical variable or whatever.
@dyelawn I especially like Rails MVC and ActiveRecord ORM. Best thing since sliced bread!!! And dont forget Rails REST. Did I mention scaffolding? Scaffolding is great. No need to write code yourself anymore. Rails does it all. And it's inherently secure, too.
The point though, was that regardless of how or whether you can do it, you shouldn't.
@Gordon I understand that now. I was trying to understand how to set properties. why do we have those functions when we can just set the properties to public? :s
@iroegbu because __get and __set are not a substitute for getters and setters. there is people who disagree with me on this, but I think of them as error handlers since they only get triggered when an inaccessible property is accessed (which will cause an error unless the magic methods exist)
13:38
@Gordon i think i'm sensing sarcasm...
ok... thanks.
I'm looking for a shortcut for setting and getting properties... assuming there are many properties
@Gordon they are useful to implement property accessors <_<
@dyelawn sarcASM is my favorite Assembler dialect
/me hides
Assembly is my favorite code for going back in time
13:39
@Ocramius yes, they are. as useful as shooting yourself in the foot is. and they will greatly enhance your inheritance hierarchies.
@Gordon oh, indeed :)
@Daniel I think you mean JMPing back in time. and in space too, across the globe to NZ.
lol exactly, MOVing back in time as well
@iroegbu add a method setProperties. Pass it an associative array. assign the properties within the class. Or simply add getters and setters. Any IDE will generate for you. Or make them properties public.
@Gordon i don't really like ActiveRecord, not for any good reason, just bc I'm still learning it. but I don't see the point of the comment. i do like having required boilerplate generated automatically; is that not a good thing?
13:44
@iroegbu in general, dont focus too much on properties. but focus on responsibilities.
@dyelawn how do you validate the generated code?
@Gordon usually i'll read it; i always end up using it in the additional code that i write
/me just wrote an interesting email that will wind up tearing a vendor a new arse hole
$user->getFriends()->getAccounts()->getOfficeAddresses()->getBuildings()->getFloors()->getRooms()->getChairs()[0]->setName('foo chair');
@dyelawn scaffolded code is usually what the name implies: a quick skeleton or auxiliary. its nice to get up and running but it's Technical Debt. You will have to pay it back in the end.
13:47
not only does it save some time, but i think it's a lot less likely for a generator to make a silly spelling, punctuation, or capitalization mistake
@Gordon i don't see the Technical Debt
@Gordon ok, I have getProperties (exact opposite of setProperties) in my DAO. I'm thinking of doing a mapper class
This is interesting:
$this = 42;       // Fatal error: Cannot re-assign $this
var_dump($this);

extract(['this' => 42]);
var_dump($this);  // int(42)

$this += 1;
var_dump($this);  // int(43)

$this = 17;       // Fatal error: Cannot re-assign $this
var_dump($this);
+= for the what?
3
A: What is the point of scaffolding?

GordonYou use Scaffolding to get some results rapdily, for instance to quickly whip out an early protoype or to get functionality like CRUD in place. Usually the code generated through scaffolding is a crutch you have to replace or extend later with something more sophisticated. So yes, you are right....

@Bracketworks that's quite nice, did not know about the extract trick.
13:50
@igorw useless though; not in an object context any attempt to dereference a property or method gives you "derp: not in object context"
So increment-assignment isn't assignment?
different handler
single opcode vs 3
@gordon ok, i still don't see how generated stock setters and getters, CRUD, schema, etc. are a Technical Debt. yes, they will require additive editing, but usually not removal editing.
additionally, in directing the conversation to what essentially amounts to the merits of frameworks (in any language), we've missed a key component of rails that i enjoy: ruby syntax
@dyelawn now you are trolling
i find ruby about as readable as perl
13:58
@Bracketworks for reference stackoverflow.com/questions/11415760/…
@Gordon example?
The question was basically "Why can I still use $this after overwriting it"

« first day (927 days earlier)      last day (4246 days later) »