« first day (999 days earlier)      last day (4174 days later) » 

user1596138
20:00
Exactly what is happening here?
user1596138
foreach ($_POST as $a => $b) {
    if (isset($_REQUEST[$a]) && !empty($_REQUEST[$a]))
        $body .= sprintf("%s: %s\n\n", $a, $b);
}
user1596138
I'm having trouble understanding how $a and $b come into play.
@Jhawinsss It iterates through the $_POST variables.
$a is the key, $b is the value
So if you have $_POST["hello"] = "world", $a is "hello" and $b is "world".
user1596138
Ah. Thanks.
@LeviMorrison People tend to like Helvetica more. But I really like the Source Sans Pro.
20:03
@MadaraUchiha It's been about 50/50 so far.
Well Helvetica is more of a mainstream these days.
I see loads of English sites with Helvetica it's really getting kinda boring.
What font is the PHP logo?
@LeviMorrison If I am part of one of those 50% you can scratch my vote, because I have node idea what I am doing (especially regarding design stuff)
@MadaraUchiha It's mostly ITC Handel Gothic.
We're really not sure what happened to the beta one. The one I'm using is just a modification to php-logo.svg from wikipedia.
@LeviMorrison Huh
And I'm guessing the type there is defined by paths?
Look at prototype.php.net (beta enabled)
20:06
@LeviMorrison that's kinda funny, using wikipedia as a distribution platform that way :P
That logo is of unknown origin.
It's not Handel Gothic either.
Since it is also an incredibly blurry rendering, I decided to work on it a bit.
So I downloaded php-logo.svg and modified it a bit.
Yeah, obviously a path
It still needs some love.
It doesn't really look like ITC Handel Gothic though
Oh, my bad, lower caps
Yeah that's the one
@Levi Is the SourceSansPro font file available on the server?
20:10
@Danack Not on a php.net server yet, no.
It's available via Google Fonts API
yep and from adobe also.
@LeviMorrison Helvetica
Is glob result cached with use of accelerators?
20:26
Can I ask everyone's opinion on the best webserver to use with PHP? And please don't say apache :)
@EduardLuca nginx is my favorite.
I heard about it that it's good for static content, but is it good for PHP? I mean I used it too, and with cache enabled, it was faster, but is it ok memory-wise?
@EduardLuca There is no best, but I like nginx
@LeviMorrison The text is darker now on prototype.php.net ? It makes the SourceSans much more legible or my laptop just renders it differently to your earlier screenshots.
With php-fpm
20:30
@EduardLuca I still haven't had the pleasure of working with it on a production server. But it works very well on my developement environment.
user895378
I think the prevailing opinion these days is nginx + php-fpm.
@Danack I'm also on a MacBook Pro with Retina - my screenshots may not do it justice when viewed on something else.
I see... I'm trying to figure out what to use on the next version of my website, so I guess I'll give nginx a shot :) Thanks guys / gals
How will you do it with a php regex? — Jf Rondeau 49 secs ago
There are the kinds of people that really really test my patience.
@Levi No retina here - (battery life ftw) The font definitely looks lighter on your screenshots when shown at a reduced size compared to the colour at full resolution. Although I said I couldn't read the SourceSans earlier, I think that was lack of contrast rather than the font itself.
20:36
Color hasn't changed :)
Color perception then. :)
Just to clarify, you are hitting my dev server, right? leviathon.homenet.org
@LeviMorrison Won't let me switch into beta :\
Just be firm with it. I'm not sure what exactly, but eventually it switches
Be sure to hard-refresh from time to time.
@MadaraUchiha Also try hitting up /my.php and changing the setting there.
@LeviMorrison I wasn't - was talking about the screenshots you linked eariler.
but same is still true. leviathon.homenet.org appears much darker (and more legible) on my laptop than your earlier screenshots suggested.
@MadaraUchiha You get into beta mode?
@LeviMorrison Yeah, hard refresh ftw
You like?
It certainly looks cleaner than the current beta on php.net
@LeviMorrison I think it does need a part where you introduce PHP, but not sure where to put it
20:52
Just do the twitter bootstrap thing and make it on top of the rest of the content.
Make it full-page or something.
I dunno.
Have I noticed that I never used twitter bootstrap?
It's been a while since I was on the front end. I need to catch up :X
I don't use twitter bootstrap, I honestly don't see what it gives me
Me too.
It's not like writing CSS takes that much time.
I mean, HTML5 boilerplate I can understand
PHP frameworks I can understand
It's about quickly setting up a site so you can code again like you should
But a CSS framework?
@PeeHaa I almost always code 70% of HTML first, then begin thinking with CSS.
CSS should fit the HTML, not the other way around
20:55
@MadaraUchiha I don't want to be bothered by either html or css :P
And I've seen twitter bootstrap classnames like span1, that's when I stopped reading.
All grid systems will have something like that
No, not really.
Not really?
Not fishing for upvotes, but curious about opinions on what I've said here:
0
A: C#-like extension methods in PHP?

BracketworksMoving away from the issue of non-object primitives in PHP, when dealing with actual classes in PHP, if your environment is sane, chances are you can decorate a given class to emulate extension methods. Given an interface and implementation: interface FooInterface { function sayHello(); ...

20:57
I don't need bootstrap, it doesn't really give me anything. CSS and HTML is really easy compared to most development. Setting up a layout is quick, and the hard parts about it are not positioning - it's design.
I also don't really care about design. I will screw it up either way so meh :P
It consumes a very small portion of my time anyway, adding additional libraries seems silly. All modern browsers and even some bad ones like IE8 do positioning good enough.
I think I've made my point 5 posts ago.
i use bootstrap only when i need umpteen alert colors ... and even then i just pull out the form elements
@BenjaminGruenbaum Shitty design is really easy compared to most development. But so is shitty development compared to good development.
20:58
@Bracketworks The whole point of extension methods is that syntactic sugar, it's what makes it so nice - the 'correct' way to implement it in PHP is a macro, it just compiles to a static method.
@BenjaminGruenbaum No Er, yes; but the intent of my answer was to point out other options of extensibility, which could emulate extension methods as per C#
or if someone says "hey, can you make me a copy of twitter?"
I think that was the question :)
then it comes in really handy
(sorry, no more pinging)
21:01
@Bracketworks Extension methods are really good in some way but are also really bad in others. The way to do them in PHP would be statics. PHP has way to many functions just lying around for no reason anyway.
array->sort makes a lot more sense than sort(array) unless sort is polymorphic over a general interface (think Ord in Haskell, or how it works in Python), even then, having stuff like mysqli_connect just 'lying around' is just plain silly.
Oh, I totally agree. They are syntactic sugar around static calls, but despite this, they do allow you to problem-solve differently.
Not being to implement them in the same fashion 1-to-1 in PHP is probably annoying for those coming from C# (not to say that they're necessary or anything, just very nice to use)
@Bracketworks I think people really want LINQ in other languages. Not trying to insult or anything - I don't think PHP is good enough to handle expressions as well as C# does, the way LINQ works with IQueryables is really impressive, and useful.
@BenjaminGruenbaum Agreed. I'm working in C# right now (and for the last, 9 months?) on several ongoing projects.
@Bracketworks People using C# then coming to php expecting everything to work like C# are idiots. More generally, anyone using language X and expecting language Y which is completely different to act like it is pretty much an idiot :P
LINQ is fucking very awesome.
Yea, but that's where design patterns come in ;)
21:06
You need design patterns in C# just as much as you need them in PHP.
Being a C# programmer doesn't make you any better than a PHP programmer automatically :) There are plenty of really really really bad C# programmers.
hey im tryint to parse html with regex, just want to understand
<input.+?([^\/]>)
I mean that design patterns can often solve the problem of a "language deficiency"; from the perspective of coming to language X from language Y, where Y had feature Z.
why it cpture extra symbol alongside with >
@Kuraiinazuma don't
example <input id="1" class="hello"> it should only take >
but it takes ">
im etsting it here
yes it should only capture inputs with no closing />
Nevermind, misread
i saw this question on stackowerflow and wanted to see how it could be made
@Kuraiinazuma While @PeeHaa is correct with simply "don't", why don't you iteratively break the problem down: first match <input[^>]*?> to grab the whole start/end tag, and apply subsequent patterns against the results?
Oh shit, Zalgo found me.
hehe
21:13
@Bracketworks but with this it will also take
<input id="1" class="hello"/>
it should be excluded
@Kuraiinazuma On what grounds? What should be excluded?
well it should take all
<input id="1" class="hello"> and add /> at the end
@Bracketworks solved it ^^
@Kuraiinazuma It does exactly what you are telling it to do. Let me put your regex in natural language: "match something that begins with <input, any number of chacracters, and then a chacracter that is not a slash (for which it finds ") followed by >"
<input.+?[^\/](>)
@Jasper i undertand now, thanks
well not really solved, but i understand concept beter
@Kuraiinazuma Also, take a look at this: <input /><p></p> which is some html your regex will do the wrong thing on all together. It's problems like that together with the fact that html may be malformed that leads to the opinion that you shouldn't do things like parsing html with a regex.
21:21
@Jasper i know <input.+?[^\>]> only way i found and then you just perform another replace operation
who made that?
On that input, it will match <input /><p> which I guess is not what you want...
$selfClosing = ['br', 'hr', 'input'];
$value = preg_replace_callback(sprintf('#<(?:%s)[^>]*?>#i', implode('|', $selfClosing)), function ($match) {
    return preg_replace('#(?<!/)>$#', ' />', $match[0]);
}, $input);
@Jasper you right
@Bracketworks That's a lot of why people dislike JavaScript. They try to apply design patterns instead of doing a paradigm shift.
@Bracketworks thanks for the code, im gonna study it
21:25
@BenjaminGruenbaum Don't get me wrong, I believe that one needs to adapt their strategy to the environment (that's sort of applicable to.. well everything) because there isn't a god-language, or a god-strategy, yadda yadda...
But on that note we all strive for reusability, whether its of raw literal code or of strategy; being able to port a strategy from one language to another is huge.
Trying to port literal code on the other hand... well, lets just say the project I revamped on is the reverse of the problem of C# to PHP... I was looking at a dirty home-brew Wordpress written in C#.
Literally, there was PHP code commented out, followed by blocks of ArrayList and other shit.
Working on new homepage design. What do you guys think? @PeeHaa @MadaraUchiha
Obviously the Download PHP bit could use some work; this is just an idea.
21:29
@Bracketworks I had a guy downvote one of my answers on programmers for telling him code should not be similar across languages, and that using advanced language features when appropriate is cool.
@BenjaminGruenbaum In my personal case, I have to deal with many programming languages at the same time on a daily basis, so code readability is kind of great deal for me. For an expert on a specific programming language it is always very easy to write code that newcomers will have a hard time understanding, even if they are experienced developers. Bottom line, telling someone who is experienced "You should not lower the skill of your code" is something that I would not do in general, since it will probably reduce readability of his/her code. — yms Jul 4 at 19:32
Although, he did come off as a pretty nice guy.
@Simon_eQ Why?
@LeviMorrison I think the download php buttons are the important aspect
how it'll look depends a lot on how much space those buttons will take up
I remember the days when I laughed at readability: code clever not clean! Ternary operators? Nest them! Nest them deeply! Short circuit evaluation? My whole application is one statement!
@NikiC We're going to ditch the arrows, though. I hate those things.
@LeviMorrison I think search width and the width of those boxes on the right should match
generally I think that the search field needs a bit of polish :)
@NikiC Agreed.
21:40
maybe I'm just missing a clickable button next to it ^^
@Bracketworks Haha, when you think short code is clever :)
@NikiC That will require some trickery. I will attempt
@BenjaminGruenbaum Code golf in production FTW.
Will this command work? I'm new at joins with Inserts.. (mysql)
INSERT INTO views T
JOIN members T2
ON T2.username = $username
(ITEM_ID, ITEM_TYPE, USER_ID, USER_TYPE) VALUES('$itemview', '$type', T2.id, '$usertype')
Anonymous
@BenjaminGruenbaum it is very helpful for people who want to make PHP libraries.
Anonymous
21:47
18 mins ago, by Simon _eQ
http://stackoverflow.com/questions/17190068/creating-a-php-extension-in-c
@Bracketworks hey thanks againg for code, discover many new things
How does that ^ look, searchbar Nazi's? @Bracketworks @NikiC
@LeviMorrison A work of art. Balance defined ;)
@Kuraiinazuma That's what I meant by iteratively reducing the problem; preg_replace_callback is awesome for that.
You capture larger blocks, and progressively break them down in nested callbacks.
@Bracketworks i never used that in php, only in javascript, also spintf thingy was quite amaising too
@Bracketworks never thought you can use it like that in preg_replace
@Bracketworks someday im gonna master regex ^^
@Kuraiinazuma Perhaps right after you've mastered selective pinging.
22:25
When repeating an expression until it returns false, with no body necessary, is it bad form to while ($expr); return; or should I while ($expr) { } return;?
@Leigh the top 200 was sorted by stars. so the reason for the top 200 are the number of stars.
Damn it I hate this laptop
@hakre There were some "really NSFW" ones in there :P
@DaveRandom: would love to help with backlog, but im stuck on being able to get the rep :(
You could whore yourself out to a thousand fat chicks jQuery questions for 50 bucks rep a piece?
Anyway the only point of that re-pin was because I just moved the chat linkifier into its own organisation because we're looking at giving it an bit of an overhaul which will require at least one more repo, so they may as well live together
Also it's an organisation for stuff specific to this room
22:46
@cspray I always knew the internet was mostly cats and boobs, but that was exemplary.
Ta-daa! New homepage. Thoughts? @DaveRandom @NikiC @rdlowrey @PeeHaa @hakre
@Bracketworks :D
@LeviMorrison hmm, not convinced by the sparks O_o
otherwise really good work :)
@LeviMorrison I like how the slimmer header and black portion (not sure what you call that) pulls the content up compared to current beta. I don't know about the icon on the download button
Sparks? That is clearly a unicode symbol we use all the time.
Like, seriously. Actually it was one of the few unicode arrows that pointed downward.
22:50
/shrug when I saw it it reminded me of Harry Potter
Did you intentionally take out the "Begin Tutorial" link or am I missing it in screenshot?
@LeviMorrison I like it, the only thing I'd say is that the dark bar looks like a notification (or something) that would removable/collapsible, I think because of the level of contrast with the top nav. I'm not sure whether that's an issue or not and I certainly don't know what to do about it if it is.
@cspray It's been MIA for a while. That tutorial is garbage. Someone else will have to put it in if we want it.
@LeviMorrison Fair enough
A shame that the tutorial on the main site isn't suitable for linking though =\
A collection of links to (properly vetted) external tutorials would be better, IMO
@DaveRandom For some reason that doesn't sound like it would go over very well on the internals mailing list...granted, I haven't been reading it that long but I could only imagine
22:55
It's not really an issue for internals
@DaveRandom Who would vet it then?
Besides which, I sometimes wonder whether internals cares about PHP's users
They don't ever seem to listen to what people actually want
Besides the Harry Potter symbol, any objections and suggestions?
Well, I agree with @DaveRandom about the black area appearing to be collapsible and that seems kinda funky. But also like he said I don't know what to do about it
I tried having it separate from the header and it just looked odd, no matter what I did.
22:58
Yea, I could see that
@cspray Maybe docs? I didn't think that far ahead
@DaveRandom /shrug, I admittedly don't know enough about the internal management and politics
Not sure that I wanna know that much really....
@LeviMorrison Yeh I wouldn't worry about it. The only thing I can think of would be to reduce the contrast between that and the top nav (make it lighter or the top nav darker) but I'm not sure about that at all. Just throw it out there and see what the wider community thinks.
@LeviMorrison I personally liked the downvote arrows and don't like the current "scars", so I'm not a fan of that. Other than that, I really like the new design. The bars on the right, though, feel like they could use a little more content. Perhaps 2-3 "headlines" (hottest tips, upcoming conferences) and a "and more" item.
Not too sure about that suggestion, really, but they do feel like they want more content
@DaveRandom So yeah, reduced the contrast and umm... not going to happen.
23:04
@LeviMorrison I like it. As for the icon, Bootstrap's isnt bad: twitter.github.io/bootstrap/base-css.html#icons specifically "icon-download-alt"
I was hoping to avoid dependencies like that for 1 icon >.<
@LeviMorrison lol; base64 encode it as a data URI
@LeviMorrison No worries. It's a minor issue anyway, it's not like it really detracts from the design, it's just not intuitive to my brain, but my brain is a dark place where nothing makes any sense anyway.
lol, my office uses .. well, Office for everything. Since Excel can't support (to my understanding) binary data in cells, we base64 encode all sorts of shit.
Well, I'm going home.
Underwear and pizza time.
Night folks.
@Bracketworks It's doable with OLE. But ffs don't.
23:14
@DaveRandom Yea, that's why I didn't ;)
Ok, super serial, I'm out.
@LeviMorrison I think I preferred the buttons
@LeviMorrison What are you using there?
@Jack For what?
Font
23:32
Hey everybody. Using PDO/MySQL, and I was wondering if there was a way to get it to return the native types (MySQL column types) instead of strings. Any thoughts?
@RyanKinal Have you tried PDOStatement::getColumnMeta()?
Hmmm. I have not. I'll look into it.
0
Q: MySql PHP Insert with join

bushdiverI can't get the following Insert to work although the syntax seems correct.. INSERT INTO views T JOIN members T2 ON '$username' = T2.username (ITEM_ID, ITEM_TYPE, USER_ID, USER_TYPE) VALUES('$itemview', '$type', T2.id, '$usertype') All the variables are predefined of course.. W...

@LeviMorrison Taking the two side by side, the two differences I see is the download buttons being replaced by text in a larger block and less vertical whitespace between the header and the first article. I'm not a fan of either. (I think the buttons might well work in that larger block, though.)
(Tell me if I should stop giving uninvited feedback, I don't want to be annoying)
@LeviMorrison spaced out buttons look nicer imo :)
@bushdiver What are you trying to do there?
23:46
I'm trying to Insert into a table using a bit of data from another table in the process
@Jack and you asked how to join when a record hasnt created yet.. idk :p i thought it would work
I've added an answer @bushdiver
@Jack I dont have the USER_ID, yet in your answer
@Jack I'm getting the USER_ID, in the select ( id ) - how to use that in the Insert?
@bushdiver Yeah, that's in my answer; you see the , id, in there right?
@hakre ping
Or indeed anyone who feels like a bit of DOM action
Yeah, DOM on DOM action!
23:54
I'm trying to do some screwing around with the docbook sources and I've fallen at the first hurdle: I can't work out how to define entities before DOMDocument::load()
Actually I can't work out where these entities are even defined, I suspect they aren't though and it doesn't really matter either way
Entities such as &my_great_entity;?
More or less
(I have a local clone of the repo)
1
Q: How to load DocBook XML files with PHP's DomDocument having named entities defined in other file?

hakreI'm trying to load XML files from the PHP repository of the online documentation. It's by the DocBook standard. However, when I load an XML file I get errors like: Warning: DOMDocument::load(): Entity 'reftitle.intro' not defined I somewhat understand that error, but I'm having problems to...

That basically?
@Jack ah! Yes my syntax was wrong, that worked perfectly, thanks! =]
yes, minus the "defined in other file"
23:57
So you just have to create the other file first? hehe
If they are defined I can't find them, I suspect they are dynamically generated during the build process
=O
It's PHP. What did you expect?
Surely this is easy with Java ... hmm
Oh wait, I might be being stupid
Damn it I really don't want to have to setup svn
23:59
Be sure to share your stupidity for the gains of the room :)

« first day (999 days earlier)      last day (4174 days later) »