« first day (1265 days earlier)      last day (3908 days later) » 

00:03
Evening, first day allowed in here.
@mAsT3RpEE Maybe start here w3.org/TR/html5 ? I think you might also read this perl regex, didn't read it all but it seems good
@BarbulaM1 Morning and welcome !
!<(?P<tagname>[A-Za-z][\w]*)(P?<attributes>[^">]+(?:"[^"]+"))*[^>]*)>!
what i have so far.
@mAsT3RpEE Ping me tomorrow or this weekend if this isn't urgent. I need some sleep now ...
No your pearl link is what i was looking 4. just need to edit a few things. thanks.
@mAsT3RpEE A real quick fiddle regex101.com/r/eE2tU2 not sure if it's good, but it has some improvements with enough time. Cyaa
00:43
gnight all.

@HamZa
$attribute = '[^\x22>]+(?:\x22[^\x22]*\x22)?[^\x22>]*';
$name      = '[A-Za-z\p{L}][a-zA-Z0-9:_\p{L}-]*';
$Regex     = "!<\s*(?<namespace>$name:)?(?P<tagname>$name)(?P<attribute>$attribute)*>!";
 
4 hours later…
05:02
morning everyone
user924016
morning
05:23
G'night folks.
05:38
Morning by the way.
Off to army soon :/
@BenjaminGruenbaum I just want the codes, not a 300 page book :( — Lennert Leers 2 mins ago
user924016
lol
you cant use openssl on windows. it results in the script executing until maximum execution time is reached(or it did last time i checked). — r3wt 2 mins ago
ahahaha
Oh my, almost all answers in this question are pretty shabby.
0
A: PHP random string generator

JackFirst, you define the alphabet you want to use: $alphanum = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; $special = '~!@#$%^&*(){}[],./?'; $alphabet = $alphanum . $special; Then, use openssl_random_pseudo_bytes() to generate proper random data: $len = 12; // length of pa...

There :)
06:19
:vikash
good morning
I've been running into a type issue lately. wondering if someone has some insight. it seems like pulling integer values out of mysql will be seen as strings by php. does anyone know if this is correct? or if there's a way to force them to be treated as integers
$number = +$string;
is that supposed to cast it? why would i just say (int) $string then?
Sure. Either way is fine.
so i guess my question is then, does mysqli or pdo or whatever you use only return "strings"?
06:33
yo
@AndrewBrown If you want to be fancy you can use ->bindParam() to specify the type.
@JoeWatkins Good moaning Joe
php7.ca wtf is that ...
It's pretty bizarre hehe
good morning
You know, the point that was raised about no books on PHP 7 would be available by the time it was launched ... if history would repeat itself, there would be books on it :)
06:40
hmm.. ok. it's a project with codeigniter so everything just gets returned as an array. (apparently of strings). good to know. the value (uniqueId) from the DB is being passed to the constructor of a class. when I do some conditionals later on I was using ===, and I was wondering why 7 !== 7. now I know. thanks much
got books on versions that will never exist ... goes nicely with the functions you should never use and patterns we promote that are horrible and features we implement that are terrible ... so php ...
I heard that some PHP6 books are actually about what we know as 5.2 ;-)
yeah they are when 6 was abandoned some of the features were put into 5.3 ... I think it was 5.3
Ahh
Proof that PHP 6 never existed; there's no PHP-6 branch on Github =D
who said that PHP 6 should exist on github?
06:50
Morning
what is php 6?
Cs let it just go
YACF?
yet another c framework :PP
Its not a real thing
monring :)
06:52
Yupp :)
MORNING
07:15
Aha, yes :)
moarings
Your name says it all dude. `Wordpress developer´. Don't take this advice. — Rob Quist Feb 19 at 23:23
lolz
mormorngitht
Morning
07:24
why do I always have this urge to return domain objects to the view
because nothing is perfect
@PeeHaa Even accepted answer with 252 up votes is quite.. not so good...
@Leri Yeah agreed. Should we just nuke the entire thing?
is there a cannonical replacement ?
doubt
07:27
@PeeHaa It'd be better if some of regulars from here write a descent answer. There're lots of bad examples of string generation. 1 more, 1 less won't matter.
@tereško man the cannons!!!
@Gordon today i don care about spelling
@tereško tahts oke wit me
i have a shit-ton to do and not enough time to do it
07:29
BTW gratz @HamZa!
@tereško and how is that different from every day?
every day sh*t work is the thing that can be called canonical
user2286243
Is there any PHP IDE/Debugger that allows you to add/remove code and also set next statement during the debugging session
modifying code while you're debugging it ? ehhh
that's something new
user2286243
07:36
@Jack yes
user2286243
@AlmaDo Visual Studio (atleast VB6 support this)
I knew that no matter how many ways of doing sh*t you'll learn - there always be the way which will overcome everything that you can even imagine
Maybe PHP6 will support it too ;-)
user2286243
phpEd debugger supports "set next statement"
07:38
@VarunAgw You could try phpdbg :D
user2286243
But there is no IDE I found so far that I allows to add/remove statements to a running PHP script (in debugging mode)
@VarunAgw Try PhpStorm, it integrates with XDebug.
user2286243
@Jack Does it support the above two feature?
Sure, why not.
/me retries to compile php-src under windows /me hopes to succeed this time
07:45
Guys, please review my cw answer and vote up for great justice :D
Wow, never tried that before heh
@tereško automation
@Jack well.. question is poor at least
@Jack What about multi-byte chars?
@Leri Eh?
@AlmaDo It's still quite a popular question.
160k times viewed.
You have passwords with Chinese chars in them? :)
@Jack popular != good :\
07:48
@PeeHaa RandomLib
@Jack not Chinese, but national alphabets (so, utf) - why not?
@webarto Ah, that's a nice one :)
@AlmaDo No reason not to have them as your own password, but for generated passwords it might be a stretch to assume your users can handle Unicode ;-)
07:55
@Jack In post-USSR countries users are pretty weird, so they may require from generated password to have multi-byte chars. :D
Hehe really?
Come on, it's not like Cyrillic is a problem :)
yeah. only hardcore
> Катю́ша
@webarto you'll know how painful it is when you'll use blasted win-1251 :D
07:56
Bet this is is the most used password.
@AlmaDo Oh noes!
@webarto oh yeah!
lush.co.uk A 2.5 Million dollar Drupal website.
@Fabien LOL, is the website worth that much or a business?
It looks like every f* website these days.
Lush is a fairly prominent business, but no drupal website should be that much
Kudos to the team who built and quoted that
That's a lie, they brought up their price.
It's called Marketing.
08:00
Imagine if you built it, got yourself a designer and paid him £10,000 for designs. A Front-end guy, pay him £50k. Keep the rest yourself.
Though I think there's a big security element. Apparently the previous one was hacked.
And you're positive this one can't be just because they've paid 2.5M? :)
I'm not saying it's not quoted that much I but for a website like this... dude.
@webarto Yes
Let's nuke it.
I love the smell of nukes in the morning.
@webarto apparently they did. Someone here at work brought it up
I would still assign that to rumors. Maybe they've signed 2.5M contract for 10 years of service etc. :)
08:06
Even at that price it's far too much
I've recently worked on apps that were funded by corps with 2 or 3 letter domain names (just to emphasize that they have money to blow), and it was like 10% of that for 2-3 years project.
totally had to pinch your family guy joke @webarto hehe
I'm still waiting to use this one :P
08:10
@webarto Updated my answer with RandomLib :D
Didn't realize you need two libs for that, actually :)
I have no idea, but I upvoted :D
haha
Interesting .. once you have upvoted a comment you can no longer flag it :)
Let's just nuke the question? :)
The force is strong in crappiest answer.
Erm, correct.
Yeah, nuke it and then ask the same question and answer it.
morning
hi
08:20
@PeeHaa mucho gracias :)
morning
@Fabien hehehehehe
> mucho muchas gracias
@mAsT3RpEE You might use the x modifier instead of using inline variables
@webarto hmm, not sure about this one ... i think it's a top hit with google.
08:22
@Leri ah thanks, but how do you pronounce it ?
@HamZa muchas grasias
anyone got any info on how to make a concurrency manager? i have a fixed process that can be iterated, so i need to make a manager to distribute the load over multiple nodes, and monitor their performance.
@Leri thanks
@Petah Gearman would be one possible solution in this domain
08:24
@HamZa no problem. ;) /me needs to get back to learning Spanish but has no time. sigh
Wow, using YT to learn OOP ... nice!
What is YT?
I dunno.
hmm, yes gearman looks good
Yo quero taco bell!
08:27
YouTube?
I should continue Japanese too, but I will never really use it :(
that's why you'll not succeed in it :\
@Fabien Solution: marry a Japanese woman.
I really regret that there was no reason for me to use Arabic - because 2 years of learning it was completely wasted
@Jack My wife wouldn't be too happy with that solution.
08:29
Meh ;-)
Lover then
@Fabien who said it'll be easy? Are you a man or not? :D
Aren't you supposed to have 4 wives anyways? :P
@AlmaDo I don't have difficulty in learning. Just difficulty in using.
@Fabien I think - you should use the language often. May be several hours per day - to know it good. And, even more, writing, reading, listening and speaking is very, very different things. I can write or read - well.. not so bad in English. And I can understand speech (or view videos as a sample) - but talking is difficult for me :\
@AlmaDo Aye, the only Japanese thing I do is watch anime.
08:31
that's because I have practice in reading, writing and listening - but not in speaking
hi, @Jimbo
@AlmaDo Just because you don't talk to anyone (and not in that ENV), that's it. I often have bad English day when talking and sometimes it's really good.
@AlmaDo Just remember, say "AH HERRO" and they'll understand you
@webarto yes, I know. No speaking practice at all
You need to "break tongue". I just cannot ditch Ruskey accent, but a friend was in US and A for a year and really hidden it.
that's because @Fabien need to practice in reading, writing, listening and speaking - to know language well
@webarto hm.. not sure. The fun thing is that I have no such "barrier". It's just about my pronounce and because speech should be fast enough
Yeah, English is probably easiest language anyways.
It's so widely spoken you get more chance for using it too
@webarto actually, they say that Spanish is one of the easiest
also, the most popular language in the world is "broken english"
that's the one which my project managers use
when they are writing something in skype to foreign clients, I contantly have to fight the urge to take their keyboards away and slap them with 'em
08:45
@tereško I've learned Italian (should be similar to Spanish) for 2-3 months and basics are easy to get but again not as easy as English (IMHO).
Haha, I really can't understand why they don't learn it properly with all of the resources.
I watched cartoons, helped a lot.
My kids will watch cartoons on English in the morning, and German in the evening.
mornings
morning sunshine
mon
09:14
n
Well, that de-escalated quickly.
Hmm guys if you have a query with a Count(*) AS test how would you foreach out the word "test" because if good when you do something like echo result->test; You get an integer.
@DavidH You are allowed to use punctuation marks in sentences as well. :)
@Leri My bad! You were talking about the sentence itself right?
Yes. ^
09:28
Will make sure of it next time! Do you know the answer to my question perhaps?
Hey guys, anyone know why variadic functions in php are bad practice? My gut and general consensus is that they are but I'm unable to find anything definitive as to why.
how on earth could they be bad practice already ... they're not even a practice yet ...
your gut is wrong anyway, it's perfectly normal to really need to be able to accept a variable number of arguments ... (s)printf and family, query functions and that kind of thing are best implemented variadic or with named params ...
Well they are available in other languages. Every time I mention them people say "No no no"
'people' - can you be more specific as to whom?
those people are wrong ... normal ...
09:38
It depends xD
Haha, colleagues, users on stackoverflow
If your variadic function accepts parameters of the same domain, I'd say it is fine
If you start mixing them...
Yes seong, that makes sense.
Also you shouldn't operate on the parameters of course
As long as you know what you are doing, everything is fine.
Except goto and eval... Oh, wait, if you use them you have no idea what you are doing definitely. :)
09:40
except using a potato peeler to shave balls ... not fine ... just sayin' ...
So what about passing parameters in an array - is that not achieving the same as a variadic function?
Is not that ugly? ^
@AJReading Yes, but it makes for a cleaner API if you don't use an array.
Thanks @Second
09:43
and wasteful, + sizeof(HashTable) on every call ..
@JoeWatkins I thought variadics are converted to arrays internally anyway?
it might be that the advice you're reading or getting was concerning php before it had support for proper variadics ... when func_get_args was the only game it town it was quite horrible and should be avoided, now that we support it, no point ...
@SecondRikudo that's packing/unpacking, by default they are not ...
/me out ... lata
I see, thanks for the information
So does anyone know the answer to my question?
09:49
What's the question?
Can you share the question?
27 mins ago, by David H
Hmm guys if you have a query with a Count(*) AS test how would you foreach out the word "test" because if good when you do something like echo result->test; You get an integer.
Well, that makes no sense whatsoever
fetch an object
You understood that?
09:51
@SecondRikudo Thank you! Also Masashi Clichemoto(Due to current chapter).
php.net/manual/en/pdostatement.fetchobject.php
Is that for me? @seong
@DavidH yes
@DavidH and please don't use mysql_* functions if you are ;) they are deprecated
@DavidH : or if you are using mysqli pattern, use in1.php.net/manual/en/mysqli-result.fetch-array.php
@seong Will look into it now and I won't! Actually I can't thanks to WP..
09:53
@DavidH var_dump(get_class_vars(get_class($result)));
@NishuTayal I have to strictly do it in PHP itself
Yay, mega-chaining! ^
yup, its in php only
@Leri Wow what is this o.O array(0) { }
09:55
@DavidH : How are you querying data from db, using PDO statements or mysqli extensions?
@NishuTayal Using WP i'm forced to use Foreach's that are linked to queries.
@DavidH Oh, $result instanceof stdClass === true. In that case: foreach ($result as $propName => $value) echo $propName;
And, seriously, that is ugly. ^
@Leri I don't care, thank you so much it worked as a charm!
It's basically how I have to do everything in WP to echo out query results...
@DavidH WP?! I feel sorry for you. :)
09:57
Didn't think of the =>$value though!
Yes T_T i'm an intern and HAVE to use it wether I like it or not
I'm basically turning a mysqli based site into a wp one..
guys I'm getting a Parse Error: unexpected '}' from php -l
in this block... :
any advice please, I don't see anything;
@Leri I noticed you didn't use brackets in the code you just showed, how come?
It seems to work correctly but..
<?php

if (isset($_REQUEST['search'])) {
$filter=$_REQUEST['search'];
$keyword[]=$filter;
require_once "lib/Searchresult.php";

//echo print_r($_POST).'<br />';

$Searchresult=new Searchresult($_dbh,$_eh);
$searchhistory=new Searchhistory($_dbh,$_eh);
reset($keyword);
$searches=$searchhistory->get_most_popular_for_keywords($keyword,$num_per_page);
$_eh->show();
?>
<tr><td colspan=2>
<a href="javascript:select_all();">select all</a>
&nbsp;|&nbsp;
<a href="javascript:remove_all();">remove all</a>
aah! found it: was an opening tag without php; '<? ' thanx anyways
@DavidH You should use. I was just writing oneliner. Anyway, if you omit brackets after for, foreach, while, if, etc. only the first statement after that will be executed.
10:06
@Leri Thanks for the explanation!
@DavidH You're welcome. ;)
any opensource good tool like phpgrid.org which allows update on joins?
10:21
Any good resource to find templates for personal website (want to add one to my CV)?
@Leri freecsstemplates.org? :)
@webarto Thanks. You have saved me from intensive googling. ;)
@Leri I think you need this: webs.com
.. because crappy stock site will be the highlight of your CV
Gawd, I hate Java ...
Of course you have to alias the hostname to 127.0.0.1 ...
Who is putting you through horror of working with it? :)
10:28
@Leri html5up
@SecondRikudo so it is ... not that familiar, haven't actually used them yet ...
@tereško I could not find template I'd like to see in my personal website. Otherwise, looks good option.. Also one more problem is that I don't have much to show off. I have not done too much open source and at work I am mostly doing libs that are commercial and closed for public, of course.
@webarto part of the job i'm afraid, the cool stuff is all written in php of course :)
10:53
Guys how can mysql_num_rows complain about a Query that does Select from where id
The result cant even be a boolean
I don't get it
@DavidH what's the error message?
Warning: mysql_num_fields() expects parameter 1 to be resource, array given in
@Leri in your place I would either find some time to make a custom page or just link to a github page
@DavidH also, you really shouldn't use mysql_* functions. even if you are on wordpress: use mysqli

« first day (1265 days earlier)      last day (3908 days later) »