« first day (552 days earlier)      last day (4392 days later) » 
09:00 - 15:0015:00 - 22:00

9:01 AM
morning all
 
hey Brady
 
hi
 
morning
 
9:16 AM
morning all
(actually it's afternoon here)
 
Can any PHP guru look over this:
if( ! function_exists( "is_child" ) )
{
    function is_child( $parent = '' )
    {
        global $post;

       	if ( is_int( $parent ) && $parent === $post->post_parent )
       		return true;

        $parent_obj = get_page( $post->post_parent );

       	if ( $parent === $parent_obj->post_title )
       		return true;

       	if ( $parent === $parent_obj->post_name )
       		return true;

        return false;
    }
}
make it any better? efficient?
 
return $parent === $parent_obj->post_name;
 
@toscho nice :) I think @Rarst would disapprove though :)
 
return $parent === $parent_obj->post_name or $parent === $parent_obj->post_title;
This would be even shorter.
You should check if $parent_obj exists and is an object.
 
9:32 AM
@toscho but how would: $parent_obj = get_page( $post->post_parent ); fail?
 
Oh, and not a WP_Error object of course.
@Brady On a post without parent post_parent is 0. The page with ID 0 may not exist.
 
ah ok
 
You know, one can delete posts in WP. :D
 
I think the count purposely starts with 1 because 0 is for no parent designation
 
I heard that WP is getting better core code, is that true? Also, it's often said that Drupal's core code is the neatest among CMSs, is that true as well? Any experiences anyone?
 
9:39 AM
@toscho ok here is it updated:
if( ! function_exists( "is_child" ) )
{
    function is_child( $parent = '' )
    {
        global $post, $wp_query;

        if ( ! isset( $wp_query ) )
        {
       		_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
       		return false;
       	}

        if( 0 === $post->post_parent )
            return false;

       	if ( is_int( $parent ) && $parent === $post->post_parent )
       		return true;
missed anything?
 
@Brady Seems to be fine.
 
@Brady there is no real need for that is_int() check... latter part will either match or not... and maybe looser check because number can be passed as string and if so it will fail when it shouldn't
is_child( '1' );
 
@toscho don't go away I need to check my is_ancestor() function
@Rarst good suggestion
 
we need some code pad we can use, sharing snippets in chat sucks
 
@Rarst well normally I use pastebin and happy with that
 
9:45 AM
wait, looser check is bad... cast as int instead
@Brady can others edit your paste?
 
yeah but its essentially saved as a new paste
 
not convenient :(
same with gists...
 
@Rarst whys that?
just incase you have a post called 1?
 
0
Q: oneUseless escaping in chat codes

toschoWhen some posts a rather long code fragment in chat it is shortened and a link to a separate page is created. The linked page is send as text/plain. But the code is escaped as HTML. This makes the code hard to read. It is not necessary. Example

Eeek, the editor misplaced my words.
 
@Brady because '' == 0 is true
you check for zero earlier, but still cast is cleaner
 
9:49 AM
so go with:
   	if ( $parent === $post->post_parent )
   		return true;
or
   	if ( is_int( $parent ) && $parent === $post->post_parent )
   		return true;
 
I'd do if( (int) $parent === $post->post_parent ) but in context this is more semantic than technical
or $parent == $post->post_parent which is essentially same minus explicit cast
 
A strict comparison is okay.
 
@toscho as above - not if string, containing number, is passed to function
 
@Rarst So what? Then the programmer using the function has to fix his/her code.
 
@toscho ehm... lol? this is simply to easy to screw up in PHP... you pass output from one third party function to input of another... and you might have no idea that one spits out string where other expects strict integer
 
9:57 AM
Ok here comes my next function:
if( ! function_exists( "is_ancestor" ) )
{
    function is_ancestor( $ancestor = '' )
    {
        global $post, $wp_query, $wpdb;

        if ( ! isset( $wp_query ) )
        {
            _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
            return false;
       	}

        $ancestors = get_post_ancestors( $post->ID );

        $where = $wpdb->prepare( "`post_title` = '%s' OR `post_name` = '%s'", $ancestor, $ancestor );
feedback?
I worried about this: ! is_int( $ancestor_page_ID ) im not sure if get_var will return an int or a string
 
I'd rewrite w ithout custom queries... because they usually end up hurt sooner or later
 
@Rarst I cannot think of another way without making it hugely inefficient
 
also - return early if ancestors are empty
yeah, it's complicated that you want to check both title and slug
 
Easy to check if just allowing ID
I could use get_page_by_title() and get_page_by_path() but both pull a full page which is wastful. A query seems better in my eyes
Right time to take these bad boys for a spin :)
 
10:23 AM
$wpdb->get_var I was right. get_var returns the int as a string
so it fails on is_int()
will change the check to:
if( empty( $ancestor_page_ID ) || is_wp_error( $ancestor_page_ID ) )
    return false;
 
10:37 AM
they work smashing. perfect combination with widget logic plugin
 
10:55 AM
googling for codepads... I miss Wave... :(
"The main benefit of using WP_Query is that it can accept more arguments than the get_posts() function, thus offering more flexibility when you’re building specific queries." facepalm
 
@Rarst Sounds like a quote from Catswhocode.
 
@toscho smashingmag (yeah, not their best post on WP)
 
11:23 AM
@Rarst Who wrote that?
nvm... smashing mag
@Rarst google wave?
 
@Brady yeah
 
@Rarst looking for collaborative coding?
 
@Soulseekah looking for something more sane than posting bunch of code here in chat
@Brady nothing seems nice and fitting
 
11:27 AM
many tools around, too many :)
 
@Brady overkill?
 
as far as how "sane" that's too subjective
I didn't find wave too sane for code back in the days
I use this for quick collaborations that don't need code highlighting piratepad.net/front-page
 
@Soulseekah gist that doesn't need for to edit
 
lots of etherpad-based solutions out there
 
@Soulseekah Wave was a damn nice platform for things like that to come
@Soulseekah yeah, those are usually crazy unstable
 
11:30 AM
it was a blast overall
but for code it wasn't too fantastic
 
I wish gist was made more fork-friendly...
 
they're working on it probably, still very young
jsfiddle has a nice revision system btw
 
@Soulseekah but it's not PHP, right...
 
yeh
 
Haven't tried it, but it got live updates: codr.cc
 
11:34 AM
wow that looks nice
share a link let's try collab
very new
 
@kaiser I just tried it but the damn cursor is out of alignment...
 
hmm... yeh glitchy, doesn't like <?
 
hangs for me :)
 
for a moment I was excited there
 
Yea, hangs for me too... Script line showed after changing lang in toolbar, then disappeared again, after typing the next letter.
 
11:42 AM
this might make cool WP theme... maybe code out Pears some
 
@Rarst ?
 
@kaiser pea.rs add PHP and collab
 
@Rarst That's a personal snippet library?
 
@kaiser that is WP theme for snippet library
 
great. thanks :)
 
11:48 AM
hmmmm... how about this stypi.com/ihcoscpl
live update completely borked for me
 
@Rarst uah! confused by live update
 
ops
yeah, broken...
reported as bug
 
nice find
 
@Rarst which license do/would you use for open source projects?
 
@geekpanth3r WTFPL. if needs to be polite - MIT
but of course most of the time stuck with GPL
Apache License 2.0 if you feel like MIT but also feel like screwing people stuck with GPL
 
12:01 PM
Does MPL sound nonsense to you?
 
@Rarst Is this a Twenty Ten child theme?
 
@geekpanth3r whic of the two, Microsoft or Mozilla?
 
mozilla
 
@kaiser probably, hadn't poked much
 
Looking at the license text, I felt it's the most complete license that keeps the developer in mind
As it does not allow someone to start a competing fork of your own project
 
12:03 PM
@geekpanth3r from wikipedia summary seems like bastard CYA legalese of MIT and GPL
 
@Rarst Hm. "If you want to use that, then you'll have to override it with a custom template in your child theme"...
 
@Rarst hmm...
 
@kaiser seems fork rather than child
 
@kaiser From my experience, official WP themes are much harder to tweak (at least that was the case with me)
 
@Rarst Yea. Just wondered about comments.php and such
 
12:05 PM
@geekpanth3r there are different paradigms in theme development, mostly about balance of control via hook vs control via templates. official themes are extreme case of template control
 
@Rarst oh...
 
I dig Hybrid which is strongly hook-controlled (although can be used in template fashion without issue)
 
mmm
I got so used to WooThemes' Canvas theme (their flagship theme) that anything else looks like rubbish (when it comes to tweaking)
 
I don't get to use many themes... had seen some free ones from Woo and code was rubbish, but been while back
 
Yes. Code is very complex. Code goes too deep (sometimes multiple files)
@Rarst I think it's the same now as well :P
 
12:12 PM
I try to hammer on my code until I have green or bright green (if at all possible) status in PhpStorm... I'd seen too many extremely embarrassing typos and issues released by some of the very hip WP shops :)
 
hehe!
God MPL is fascinating! I'm in love!
My suggestion: plz read it everyone
 
I am really looking forward to codesniffer support in PhpStorm 4...
 
(just saying)
 
@geekpanth3r too much text
 
I like Rarst's WTFPL best
 
12:15 PM
Then you might want to read the summary here: zdnet.com/blog/burnette/…
well put
@Soulseekah It's license text doesn't come with warranty / liability clauses by default.
 
@geekpanth3r thank you, I prefer licenses where I can read and understand license itself instead of summary (or summary of summary for GPL :)
 
Although I am not really sure, that means trouble
 
@Rarst lol
 
@geekpanth3r have you written code that you're dying to protect?
i.e. code that you're willing to sell and make money on? etc.
 
12:17 PM
@Soulseekah I am learning to code...
:P
No. I dont want to sell code
 
So why are you exploring licensing?
Leave that to the lawyers :D
 
@Soulseekah newb eagerness I would guess :P still under illusion it means crap
 
Come up with good, profitable code - get a lawyer.
 
No, no. I plan to start open source projects only.
 
So what are you afraid of?
 
12:19 PM
@Soulseekah The thing is I dont want someone to start a competing fork of your own project
 
Big guys coming after your open source projects and making money on them?
 
get my point?
People who didn't care to read MPL license text are probably missing somthing imp.
Anyway, I am not arguing... just saying.
 
function get_the_tag_list( $before = '', $sep = '', $after = '', $id = 0 )
 
@geekpanth3r yeh, you do have a point, but you have to have a project worth forking first, and that, in my experience is seldom the case at early stages of one's career.
 
@Soulseekah right... but I am only pre-planning. :P
I know, I know... don't say it. :)
 
12:23 PM
@geekpanth3r and always consult a lawyer, don't listen to programmers :D
I think the free software foundation has a team of dedicated lawyers
 
oh... hmm
 
The Software Freedom Law Center (SFLC) is an organization that provides pro bono legal representation and related services to not-for-profit developers of free software/open source software. It was launched in February 2005 with Eben Moglen as Chairman. Initial funding of US$4 million was pledged by Open Source Development Labs. A news article stated: Moglen expects – in fact, plans for – a large turnover in the staff. After five years, he anticipates 20 to 30 lawyers will have passed through the Center. By the time these alumni move on, Moglen hopes that its members will ...
 
my papa is one. :)
(In my country -- IN)
 
A lawyer you mean?
 
yes
Gotta run... be back soon.
 
12:26 PM
take care
 
@geekpanth3r now you need designer spouse and you are all set for succesful web dev career :)
 
:D
where do people get these cartoonish icons from anyway?
 
@Soulseekah which?
 
The one geekpanth3r has
 
ah... I think there is some site out there for making them
 
12:28 PM
lots of people have them, I wonder where they get them from? Are they custom made or something?
ah I see, always wondered
 
best are more likely original/custom made
 
The best source for profile images are photos of my cat.
 
Is it me or most tech geeks prefer cats to dogs?
It's always about cats.
@Rarst, by the way how is adoptr coming along any progress?
 
@Soulseekah cats are more biologically attractive to humans
@Soulseekah no idea
 
I have a distaste for cats.
 
12:33 PM
I don't have to leave my computer when my cat needs to pee.
 
The only excersize I get is 2 times a day, walking my dog
without that I'd be stuck to the chair by now
 
@toscho on other hand dog can walk itself to vet... cat needs to be carried... and the suckers can get heaaavy!
 
@Rarst This is my yearly exercise. It's okay.
 
haahaha
no excersize
our old cat refuses to eat cat food, eats dog food instead
he's almost 15 years old now
after this one, no more cats in the house, thank you! :D
 
12:39 PM
@Soulseekah Cats are intelligent. Tech guys prefer cats therefore.
 
Are they!? :D
I people and dolphins were intelligent.
Cats? First time I hear.
 
@Soulseekah i prefer dogs by a long way
 
...oh and monkeys too.
 
Intelligent enough to let them make you bring something.
 
@kaiser really!? :D Video or it didn't happen!
 
12:42 PM
Dogs are like employees. You want something. You get it. Then they waggle their tail.
 
@kaiser studies suggest dogs are more intelligent than cats, and are capable of mental techniques cats aren't
 
@kaiser watched this documentary last time about dogs on TDF, there's a dog somewhere in Germany brings things when you show the picture of them. i.e. have abstraction skills.
 
#1 (most powerful) mental technique a cat can handle: Stare you to death. If you don't bring it.
 
@TomJNowell You haven't seen the stylesheets my cat writes.
 
one of the best docs around
I understand that there are dog people and cat people etc. it's always been like that
but the Internet is more on the cat side is seems
always made me wonder
there's lolcatz but no omgdawgz
 
@Soulseekah as above - biology. cats more attractive so on average more interest
 
But in real life as many dog lovers as there are cat lovers
oh ravens :D omg
 
@Soulseekah proof? :)
 
cats don't understand cause and effect relationships
dogs do
 
@Rarst you think it's not 50% 50% in real life?
 
@TomJNowell They simply don't care
 
@Soulseekah I don't remember any data to suggest that. especially on worldwide scale
 
12:46 PM
The real reason why love cats and not dogs: Dogs always smell bad.
 
@kaiser that can be tested, a cat would care if it meant the difference between eating and not eating
 
@Rarst more cats in US, you're right.
but not by so much as to neglect dogs of any good memes
 
@TomJNowell No. It would make you care :D
 
We need some good dog memes asap.
 
Animals have been submitted as applicants to suspected diploma mills and, on occasion, admitted and granted a degree, as reported in reliable sources. In one case, a cat's degree helped lead to a successful fraud prosecution against the institution which issued it. Cats Colby Nolan Colby Nolan is a housecat who was awarded an MBA degree in 2004 by Trinity Southern University, a Dallas, Texas-based diploma mill, sparking a fraud lawsuit by the Pennsylvania attorney general's office. Colby Nolan belongs to a deputy attorney general. In looking to expose Trinity Southern University for fr...
 
12:47 PM
@kaiser you haven't smellt our cat
@kaiser dog gets shower every other day + 2 times after each walk gets paws washed
cat digs around shit in his box and walks on bed
 
Ok, guys. You're taking that discussion far too serious.
 
that diploma article is hilarious
 
(...)became the subject of an article by the American Bar Association(...)
 
@kaiser that's how we roll (especially on fridays)
 
oh damn, today is Friday
gotta go do my WordPress trunk news post
completely lost count of days
that's what you get when you reverse engineer java disassembly into C
 
12:51 PM
does all plugins on wordpress plugin directory safe and virus scanned?
 
@Sisir NO
 
:-/
 
1:05 PM
@Soulseekah faceyourmanga.it
 
ah how nice
 
@Rarst that would be great actually, added she's beautiful too :P
 
@geekpanth3r picky, are we...
 
@Rarst of course!
 
got my mangatar yippie
I'm not as fancy as all other tech geeks
 
1:15 PM
another one collabedit.com/pwt8t poke it.
it was fine... and then it got booorked
 
can't chat
when someone types
my cursor keeps jumping and missing keys
 
meh...
 
@Rarst it seems to be working fine
 
my new avatar :D like or not?
 
1:18 PM
@Soulseekah lol!
 
@Soulseekah tad ghoulish
 
kinda devilish :P
 
that's me after 2-3 days non stop hex
I don't remember the last time I shaved now
 
hehe!
@Soulseekah same here
 
Wife's gonna kick me out soon
 
1:19 PM
(trimmed in my case)
 
along with my dog
 
oh... you have a dog
I have a retriever
@Soulseekah what's yours?
 
and there we go again...
 
:P
Mozilla has some very good web designers. Their CSS alone is so good.
I mean, they make excellent use of CSS.
 
1:33 PM
5400RPM hard drive for system disk is torture... how people still using that?..
 
mine is 7200 on PC :(
both suck
 
@Rarst SSD here. It goes over 9000!
 
@Brady Umm....!
 
@Brady Bwahaha
 
@toscho That's the response I was looking for :)
 
1:40 PM
@Brady I am pretty sure that RPM would tear it apart, not balanced for that :P
 
@Rarst who said anything about RPM
 
@Brady 9000 of what did you mean then?
 
over 9000! you make your own conclusions to 9000 whats...
@Rarst its power level
 
I wish forked gist set up upstream when cloned... (jargon win of the day)
 
9000?
my disk is failing
gotta get new PC
 
1:52 PM
Hey... it looks like GPL overrides any license when a work licensed under GPL is included in your work. Then what's the point of MPL, BSD, MIT, etc? The end-result is, your project is now licensed under G-P-L. :(
GPL makes people cry
 
@geekpanth3r the point is not every project is GPL
@geekpanth3r that it does
 
@Rarst many are..... it doesn't make sense -- why would some org called "free soft foundation" create such a ridiculous license? It's like MPAA or RIAA of free software.
 
@geekpanth3r because nothing extreme is without downsides and GPL is radical version of freedom
 
My head hurts. It's best I stop thinking about software licenses (at least for) now.
@Rarst you nailed it.
...gotta run again.
 
2:26 PM
@geekpanth3r it must be GPL compatible, not necessarily GPL itself
else you violate the GPL license of WordPress
 
I love bug fixing. Makes you feel all warm and fuzzy inside when you fix something thats been bugging you for ages
 
@TomJNowell Hi Tom. The thing is, even if my project is licensed under MPL/ BSD or MIT (or someother), if I use a work licensed under GPL, my work on the whole (which uses the GPL-licensed work) now falls under GPL. Which is really sad...
 
as my understanding is
it doesn't fall under GPL
rather
you're in violation of GPL
not the same thing
Project A is GPL
 
MIT/BSD/MPL are all GPL-compatible licenses Tom
 
B is not
then what's the problem
GPL can link with non-GPL code so long as the licenses are compatible
it appears you have created a non-issue
 
2:41 PM
yes, under the condition that, your whole work then becomes licensed under GPL
(That's in GPL's TOS)
 
Your work is not GPL
 
I've read it a hundred times, wondering if I read it wrong, or if FSF lost its mind
 
on it's own it is not GPL
when it is linked ot GPL code
that is the case you mention
 
@TomJNowell of course. But my project on the whole is. That's the point
Which means, I lose the goodies I got with MPL. Isn't it?
Okay, let me give you a simple example.
 
no because I would be able to take the work, extract your project, and use it with a nonGPL piece of code
so long as it was compatible with your license
 
2:43 PM
hmm...
 
if I take your code
and wordpress
and do something the GPL forbids, it would be a violation
not because your code has magically become GPL
but because it would violate the GPL license of WordPress
 
oh... hmm
 
"it's effectively" does not mean the same as "it is"
 
makes sense now
 
else a lot of libraries used in GPL code in linux would have issues when the libraries are then reused in other applications that are GPL incompatible
e.g. public domain code that found its way into visual studio, perfectly legal
I copy paste it into a GPL program, hey presto, Visual Studio is now illegal
makes no sense?
 
2:47 PM
does, does
 
of note, your images etc can be non-GPL compatible if you wish
 
because GPL only covers software, right?
 
it's code that links to GPL code that the copyleft applies to.
 
right
 
the output of GPL code is also free of this
as are programs that are distributed with GPL code but do not actually link to it
 
2:48 PM
Thanks for clarifying Tom.
:)
 
so if I put Dreamweaver and Wordpress together and sold it as a new product called "Dreampress" it would not violate GPL
it would piss off Adobe to no end mind
 
lol
 
if you have a library that you want to be usable in non GPL stuff, there's the LGPL license
 
@TomJNowell Adobe Dreamweaver + WordPress = Dopeweaver
 
and if you want the GPL copy left to deem network traffic is linking, aka the server and client must both be GPL, then use the AGPL license
@kaiser don't tut at me for how I get my highs
also IIRC, BSD is not GPL compat, but modified BSD is, you'll have to check that though
 
2:53 PM
@TomJNowell yes. 3-clause BSD (aka modified BSD) is GPL compatible
BSD v1 is not
 
in that case you're not creating code that links with GPL code
you're outright duplicating code that already has a GPL license
 
Lots of talk on the WPUK mailing list on the EU cookie law. Who wants to join in :)
 
that cookie law is an unenforceable disaster waiting to happen
even UK government has google analytics running on their sites
stupid laws made by people who get secretaries to read out emails or print them off so they dont have to use a comptuer
 
09:00 - 15:0015:00 - 22:00

« first day (552 days earlier)      last day (4392 days later) »