« first day (1255 days earlier)      last day (3918 days later) » 

20:00
This one will work for two-levels but fails if it's nested further.
@AmalMurali What are you trying to accomplish?
@AmalMurali usually you do that recursively
@AmalMurali probably like regex101.com/r/gX1mT1
I'd think about the problem for longer, but am distracted by the doggy above.
There is no problem here. You're too distracted.
@NikiC: I have to confess, I don't actually grasp the concept really
20:04
Regex should be a solution, not a problem itself.
@webarto Regex is always a solution!
Especially when working with HTML!
I have a confession to make, I parsed the XML with regex because the crap freaked me out.
It was some sort of enterprise XML.
@webarto: This problem comes from a comment on one of my answers. I was wondering if that's even possible with a regex :D
@webarto you look like someone who has worked with font awesome
halp! ?
@webarto: Did that XML look like:
<!DOCTYPE x [ <!ENTITY y "a]>b"> ]>
<x>
    <a b="&y;>" />
    <![CDATA[[a>b <a>b <a]]>
    <?x <a> <!-- <b> ?> c --> d
</x>
?
:P
20:07
@AmalMurali What I mean is: Practically, you usually want to do a preg_replace_callback on that, in which case you will recursively invoke preg_replace_callback in the callback ^^ However, if you're really just interested in the matches themselves, then @salathe's approach seems highly elegant.
Gawd, not that bad.
@SecondRikudo less IE users, less people to kill?
  do
  {
    $str = preg_replace_callback('#\{([^{}]*)\}#', function($matches)
    {
      return explode('|', $matches[1])[mt_rand(0, substr_count($matches[1], '|'))];
    }, $str, -1, $count);
  } while ($count !== 0);
What @NikiC said, sort of, kind of.
Stupid SO chat
20:08
use http
SO sucks regarding ssl
Noob!
yey lots of big images!
14
Q: Stackoverflow link using https does not create a onebox

reikyoushinWhen you post a link from stackoverflow into the chatbox using https, the link does not become a onebox, making it http does the trick.. so, shouldn't the https links be oneboxed too? (see screenshot below, I am hovering on the https link). Is this a bug?

.. and nothing happened. :P
7
Q: XKCD oneboxing over https

PeeHaaWhen posting a xkcd in chat it doesn't get oneboxed when using the https version of the URI: http://xkcd.com/660/ vs https://xkcd.com/660/ The first one gets oneboxed, but the latter just displays the link.

I know ;)
If only this place was open sourced!
And not written in some MS tech!
:)
20:11
hai everyone..!
PHP room written with PHP, wow. (But that would suck too :P)
hola @Thiru
@PeeHaa and not written in Meth?
WHAAAAAAT!
You should totally drop and try jQuery instead!!!11
If I would be on meth I would completely rewrite SO in a night or so. And it would be blazing fast
20:12
can somebody help me for creating and running cron in linux server

if am getting the stepwise procedure means I'll be happy..!
@PeeHaa fast for someone under meth?
Thanks in advance
@PeeHaa heh, blazing
@Thiru: If you tell us what you've tried so far, we'll be happy, too ;)
^ this and what linux OS flavor
20:13
@salathe meh ;)
@PeeHaa meth*
i'm trying cron.. which periodically perform operations..!
I'm trying to periodically sent mail..!
@Thiru If that is the only thing you are trying to do just drop your emailaddress in random places on the web
The mails will come automagically without a cron
No..!
I want to know
How to create a cron..
In what extension it can be stored
what are the elaments it should contain
20:16
Not to sound rude, but have you tried asking Google that?
@PeeHaa >:)
I googled but I'm not getting a clear view about that..!
*randomly shakes fist at @ircmaxell*
Oh gawd. I'm not in the mood today to squeeze information out of people. /me is off to bed
@AmalMurali
K I'll tell what I'm trying to do..!
If u can means help me..!
20:19
Okay... Maybe someone else might help. :)
randomly throws a wet trout at @salathe
Night everyone!
I have stored mail addresses in my database..!
I want to sent mail to the addresses everyday at 9'o clock without manually running the script..!
K thank you @AmalMurali
@ircmaxell We'll be eating tonight children!
20:20
rotfl
oooh i love the auto-linker. :)
@reikyoushin: google "what"
No autolinker for me?
@salathe whoops, missed those 2...
can someeone here good PHP?
7
20:21
@AmalMurali github.com/Room-11/chat-linkifier (it's on the add-ons pinned on the right)
I have a big problem
@reikyoushin How do you make it link to a Google search term?
Oh. Let me RTFM.
20:23
for people that's interesting
for help
@AmalMurali Google "How do you make it link to a Google search term"
:P
@salathe: Google "what"
Sigh. This extension is a lie. It doesn't work :(
6 hours ago, by Alma Do
StackOverflow: the automated free online debugger
@AmalMurali you need to restart chrome i think..
20:25
Oooh.
@averroken Stop using dutch names for things in your code for one
@PeeHaa E_TOO_DUTCH ?
Where's the chatroom for testing stuff?
20:27
@AmalMurali i don't think it works on other rooms though.. just delete it after..
@salathe E_TOO_MUCH_POT
@averroken as for your question. Please try to debug and isolate the problem part of your code.
@PeeHaa it no work, all code problem
@NikiC see what you've done!
20:31
@reikyoushin: learn to google "stuff"
An extension for linking to PHP manual in comments would've been great. Or does something like that already exist?
For example, to link to array_unique() docs I have to type: [array_unique()](http://array_unique) which is so much work.
@AmalMurali It already does that ;)
Ow comments
a little bit isolatedµ
but have anyone an solution for my problem?
Sorry, we're closed for the day.
and why open?
20:52
hahahhahahah nice one
ROTFL
God bless the internet.
LOL
21:00
DAFUQ
@AmalMurali array_unique() (i only typed "array_unique()")
@PeeHaa that's the main purpose of the linkifier, lol.. the google "me" is just a plus :P
@reikyoushin I misread @AmalMurali's post...
user2286243
Does anybody remember URL of a site that tells about programming habit of a github user and also tell about similar users. I have forgotten its url and google is not helping.
You mean the open source report card?
user2286243
@PeeHaa Yes, that's it. Thanks
user2286243
I googled a lot for this some days ago
"Pieter Hordijk is a trend setting PHP coder…" peehahahaha
21:17
^^
21:29
anybody here fancy giving me 5 minutes of their time to answer a question or two about the correct way to pre-populate a form on a webpage?
the amount of PHP runtimes is starting to compete with 2048 versions http://hippyvm.com/
Unfortunately the amount of good PHP runtimes is significantly smaller.
Or zero?
I KEED, I KEED!
@LeviMorrison btw as I said earlier, I think the getReturnTypeHint does need to return a class, even if it's really not going to contain very much info/methods, not only because it's the right choice now, to support checking whether the return value is null but also for future possibilities.
I don't think it's appropriate for your current RFC, but I absolutely love being able to use dyamic return type-hinting
21:49
You mean duck typing?
No, it looks at what the variables being passed in, and then lets you say that the return type of the function will be one of those variables e.g.
$obj2 = $injector->make('SomeNamespace\MyClass');
$obj2 is typehinted to be 'SomeNamespace\MyClass'
So the type of your output is based on the type of your input?
Yep.
Personally I have little to no use for such a feature.
So after the "what is the best PHP framework" trend, now the trend is "what is the best interpreter/engine for PHP"? ...how nice!
21:58
When doing responsive designs do you people prefer mobile first or desktop?
HHVM's parity with Zend is getting pretty good, but until recently very few codebases could run on anything other than Zend.
@David they say mobile first, i'd say try planning from both sides.. :)
user895378
@Danack lol
@reikyoushin I've done 3 designs going from big to small. I am now doing one and doing it small to big. I'm starting to think the small to big is better. For me anyway
It seems to be cleaner or something. It is early days yet though
22:03
@reikyoushin Watching now
@David that's from @ircmaxell's blog :)
anyway i'm out
bye!
22:25
@averroken Oh I know it's hard for some people but please use English when naming variables/tables etc...
22:44
Confession: nginx is sometimes a PITA to configure.
^ confirmed
Hmm, does any of the folks here share the pain of symfony forms? Am I missing something or is sorting some checkboxes so complicated that it is almost impossible?
@Ocramius Probably, I've quit the mothefucker, I don't see any benefit in using Symfony as a framework.
Coming from a Zend guy that is pretty scary @Ocramius
@webarto kinda my same feeling at this point. I'm doing callbacks, and callbacks, and callbacks, and some internal effing optimization is still screwing up the sorting
it's a frikken mess.
Symfony\Component\Form\PainInterface is the current state :(
22:50
Symfony is invented so you can bill more hours.
@PeeHaa I don't use Zend\Form either. Forms are an SRP killer
@webarto if it wasn't that I'm billing them to a friend, I'd be happy with this :\
Good day. I wonder if anybody can point me to a resource to read for the following question I have to answer... I know nothing about PHP, so I can't answer this, and clearly don't have time to learn an entire language just to answer this question:

The process of variable type checking may not be the same in different programming languages. Discuss about handling this task in two programming languages: Java and PHP, in terms of program security. Bring an example to show how the program security will be at risk because of the type of handling this task in one of those two languages.
I know Java very well, but I don't know the differences between Java and PHP to be able to offer insight.
@Ocramius Man up :(
Sounds like homework to me @agent154
@PeeHaa It is. I'm not asking for an answer, I'm asking for what to read up on
22:53
You need to define program security.
Did someone just put it there randomly?
@agent154 PHP is dynamically typed so you should be able to think of some stuff you can screw up :)
@PeeHaa such as var i = 1?
Yes, you can probably cause something to misbehave if it's not well written, and applies just about anywhere.
@webarto "Program Security" could mean many things. This course is all about Security and Privacy, and the chapter talks about things like classic buffer overflows, etc. Type checking is just one of the many topics in this section.
@agent154 Yes exactly
Point in case 3v4l.org/mYWjD
22:56
That's a feature.
It is depending on whether you know what you are doing either from the dev side or the attacker side ;)
Programmer is the weakest link in any case.
True dat
@PeeHaa So what exactly is going on there? $password is a string, I'm assuming. And what is the == operator doing that makes it return true?
@agent154 I'd definitely mention that Java is not type-safe
22:58
@NikiC What is "type safe" then? I always thought Java was type-safe
@agent154 Look into loose comparison
I mean, you have generics, everything is an object...
There is some nice info for you in our manual about stuff like this which should give you an idea what is possible
@agent154 Java uses type erasure, so not really
23:02
#yayPHP
$psw = 'test';
if(strcasecmp($_GET['password'], $psw) == 0){
	echo 'success';
}
Call it with script.php?password[0]=array
@PeeHaa Thanks for the tip. "Loose vs Strict Comparisson" is exactly what I need to give an example of potential problems.
@DaveRandom Niki already explained, something to something conversion :P
23:11
@NikiC Would it be proper then to say that Java is strongly typed, whereas PHP and Python, and many others are weakly typed?
@agent154 More appropriate terms would be statically typed and dynamically typed
Which basically means that in Java types are known at compile time, while in PHP/Python they are only known at runtime
The strongly/weakly typed distinction is not particularly well defined (the terms are used in a lot of different meanings)
@reikyoushin it's not me though
@agent154 An example of why Java doesn't really have strong types (at least easily) - blog.jessitron.com/2012/03/strong-typing-in-java-religious.html
@Danack I'll definitely look at that. Thanks for the input.
23:23
@CSᵠ nice post, unfortunately the link to mongodb slides is dead :(
Confessions: freecsstemplates.org has better free templates than some paid on themeforest.net.
user2286243
23:38
Hey guys! What to do if there is a flame war against PHP and PHP fans are less in number.
Well most likely they are saying PHP sucks and they are right sooooo....
user2286243
join them
I have a MySQL table. There is no numeric ID (we're using GUIDs). What's a suitable way to return a random row?
Assume ORDER BY RAND() LIMIT 1; is too slow
26
A: Doing a while / loop to get 10 random results

tereškoPlease, stop using ORDER BY RAND(). Just stop. This operation has complexity of n*log2(n), which means that the time spent on query would grow " entries | time units ------------------------- 10 | 1 /* if this takes 0.001s */ 1'000 | 300 1'000'000 | ...

23:48
Both of those assume a numeric ID :(
@SuhosinPony Add a non-primary, auto-incrementing column?
Any way to retrieve random rows from a DB quickly is going to need a way to step through the rows efficiently.
Ahhh, new avatar niceness!
will take some time to propegate :-)
user895378
@ircmaxell ctrl+f5 FTW \o/
Hellooo... PHPeople !!

« first day (1255 days earlier)      last day (3918 days later) »