« first day (920 days earlier)      last day (4253 days later) » 

00:00
@Eugene because it's strange you get null from file_get_contents()
@kaᵠ yes it is
@kaᵠ yes that is strange. an error condition (like you suspect) would be FALSE, however this is NULL
we should take this finding and look into PHP sources now.
What does NULL mean? An error that is not caught withing that function?
maybe something like a memory limit?
null is the default return
@kaᵠ not for a function that has a return.
The only possible way to get null is for the parameter to be bad: lxr.php.net/xref/PHP_5_4/ext/standard/file.c#528
00:01
528? like 42 ^ x? - k thx
@Eugene Note the difference between that line, and the var_dump line...
@ircmaxell I see the diff.
@hakre maybe it is really post size limit
@hakre let me check
@Eugene postsize limit means $_FILES not filled. ;)
no
if you get a literal null, the input to the function is bad
meaning that it's not a path-like string
@kaᵠ: Mix is a bit with rough edges but I like it anyway
00:04
@ircmaxell but why it works fine with text files?
try: file_get_contents($_FILES['attachments']['tmp_name'][0]);
@Eugene what?
@hakre parameter parsing error is the only possible way
@hakre it's good background music. you're a good DJ :p
@ircmaxell we are currently discussing, that when I upload text file it works fine and there is no null. When I upload image and try file_get_contents($_FILES['attachments']['tmp_name'][0]), I get null
@ircmaxell Eugene noticed that it's only with image files, not with txt files (e.g. here: chat.stackoverflow.com/transcript/message/9003152#9003152).
this is really interesting
00:06
@ircmaxell sokay, let me re-read, maybe I get it.
@ircmaxell wait what? What happened here. Your suggestion worked fine var_dump( file_get_contents( $_FILES['attachments']['tmp_name'][0] ) ); exit;
This "p|br!ll"smells like a magic number. Must be some DSL at least. ^^ ^
@Eugene and I am trying to tell you that such a change is quite literally not possible, if $_FILES['attachments']['tmp_name'][0] is defined and valid, it's not possible to get null
Unless there is a flaw with this DSL thingy.
@Eugene you forgot the [0] at the end initially?
00:08
@Eugene because you missed the ['attachments']
or that ^
@hakre codepad.viper-7.com/gu3qjb - maybe further optimised by creating a lookup table for $matches[5]
@ircmaxell nope. I didn't
@kaᵠ No.
@ircmaxell Let me show
MD5 your passwords: because life is too short to bcrypt #YOLO
@Eugene the code you pasted here shows it
@ircmaxell wait
00:10
@DaveRandom really cool. but XOR-ing with spaces inverts caps so, if the string comes in uppercase that would lowercase it
@DaveRandom damn, I need to "bookmark" this as gist.
@kaᵠ read the capture groups and the elseif tree again ;-)
@kaᵠ and screw up a ton of other characters
yea, rad
@ircmaxell true, @DaveRandom chking...
Have to apologize. Works fine. Probably a human factor :D
00:13
;-)
E_PEBKAC
@DaveRandom +1k, no matter the /x regex is still a hard b!tch to follow
okay, there was a bug in google. window got closed. sorry. no exploit avail.
Yeh it looked prettier in my editor. viper7 throws up about tabs, in the end I gave up trying to make it look nice
haha, use spaces! gordon's gonna ki(ll|ck) you :))
I generally do. I was screwing around with the indentation settings in editpad the other day, big mistake. It now converts blocks of 4 spaces to tabs and I can't work out how to stop it from doing it :-(
00:18
@DaveRandom another optimization, generate the table for characters that need encoding to get rid of the ord() function call
just got a license for 7 though so gonna nuke my very broken 6 install when I can be arsed
@DaveRandom np. and also my browser crashed wtf in the moment you need it ;)
10 mins ago, by DaveRandom
@hakre http://codepad.viper-7.com/gu3qjb - maybe further optimised by creating a lookup table for $matches[5]
;-)
lol
@DaveRandom k:)
@DaveRandom you want a screencast? on windows I'm editplus user here.
00:19
lost in the wonderful code
so are you okay I fork this on my gist?
I mean I need to copy the code.
viper crashnes from time to time and all code is lost.
@hakre Nah it's all good, I just got a license for the new EPP, I'm busy tweaking my config on my work machine and when I've done it I'm going to nuke this install and pull the config file in for the new version
viper was really cool but somehow missed the principle to keep copies of text AKA backup.
00:21
@hakre no worries
@hakre JSFiddle suffers the same problem
@DaveRandom idiots! get less for nothing. (what should I say?)
take it with torvalds: linux kernel is backuped all over the world.
or the short version: three copies is better than two copies. [more -- is --> more (directed graph)]
It's kinda weird, but I guess when you run a free site that gets a lot of traffic like that you cut corners to save costs. Neither of them even take donations (that I'm aware of), let alone carry ads
@DaveRandom yes, it's just get it going. it's also not what I dislike, It's exactly that: If you keep submissions from others, care (a little) about it. It's worth ;)
I'd totally donate to keep both of them alive, especially if viper7 would get a little more reliable...
isn't the code OS ?
00:25
sure. codepad viper was (is) one of the greatest PHP codepads.
fork and open up a new site
@PeeHaa埽 is perpetually threatening to try and set up viper7 on his server, afaik he keeps getting distracted by RL though
I would also offer to fake online free cloud storage to backup everything thrice - automated.
@DaveRandom RL never distracts. That's not well said.
00:27
@kaᵠ If you can make that work you are a better man than both myself and @PeeHaa埽 - I would dearly love for you to be that better man though
lol :)
In RL we're limited. In INET we strive for heroIne ;)
I don't do no stinking striving.
> Do, or do not. There is no try. - Yoda
@DaveRandom Try is sadness -- hakre
(play is good)
I guess Yoda wasn't into handling exceptions
00:32
@DaveRandom The said story about Yoda actually is about getting bought by Disney Inc. and got dropped after sales.
I think it's time we should release some kind of manifest about maintenance.
Something along the lines if ten years have passed, you should have at least done one code-review across the whole code base - even if driven by tools.
(if you've been exploited in the wild more than thrice you have already done much earlier)
I dunno, my personal rate is probably closer to 10 minutes
@DaveRandom yeah, just leaving some room you know - for the generalization.
but ten is a great number,
luckily our finger-computer is able to handle it.
If you're writing PHP it's probably 2 minor versions (in reality)
I love fingers.
@hakre Yeh I was thinking this to myself the other day - I really cannot begin to fathom how the imperial system came in to being
Just look at distances - 12 -> 3 -> 22 -> 10 -> 8
00:41
lol
@DaveRandom Imperial? You are British, right?
And then you have volumes, when not only does it make no sense whatsoever in terms of the increments, but the US actually decided that the original definitions were wrong and made another illogical definition
@hakre Yes, that doesn't mean I like the imperial system though. It makes no sense.
@DaveRandom history ;) Like you know how money was invented? There's reason, and there is Marx explaining a whole lot of modern times ;) (lived in London as well)
@DaveRandom you'll enjoy this:
Even our money, almost within my lifetime, wasn't decimal.
00:44
@kaᵠ that guy, whenever I see him on video it's like porn I wanna kiss him.
loooooooooooooooooool
@hakre He drank in pub not far from my house (apparently, there's a plaque on the wall, not sure why he was in manchester)
@DaveRandom oh Manchester, cool.
@hakre you can feel his passion
@kaᵠ not "only" passion, he knows a lot.
00:45
yup, and explains very well
one of the better of the popular Youtube channels.
also the 666 explanation is very insightful
@kaᵠ so much knowledge about language. that is just plain great.
I was positively enchanted seeing @tereško posting the link today or yesterday.
@hakre math?
yup, fun talk
@kaᵠ math is great. but why you ask math?
00:48
@hakre didn't get what 'language' you're talking about
@kaᵠ which line?
1 min ago, by hakre
@kaᵠ so much knowledge about language. that is just plain great.
@kaᵠ ah okay, the 666 video has many analogies to language history.
meaning of words and numbers.
yeah
liked the most the part about some languages not having 'digits' but using the alphabet to create numbers
@kaᵠ every language has digits. and that's the interesting part. search them.
and btw 10 is a cool number. just your fingers. ruling the world ;)
@DaveRandom which kind of pence is not decimal?
00:53
£sd (sometimes pronounced, and occasionally written, L.s.d.) is the popular name for the pre-decimal currencies (sterling) used in the Kingdom of England, later the United Kingdom, and ultimately in much of the British Empire until 1971. This abbreviation means "pounds, shillings and pence", and is usually pronounced that way, having originated from the Latin words "librae, solidi, denarii". Under this system, there were 12 pence in a shilling and 20 shillings, or 240 pence, in a pound. A penny was subdivided into four farthings until 31 December 1960 (when they ceased to be legal tender)...
> ... 'forward slash' subscribe...
what's wrong with plain slash?
solidus ftw
Back to Marx now. There is one of the greatest quotes probably that exist; In English language you've got the thought terms where-as in German (probably Germanic) those terms are not thought (or thoughtful). There is much truth with[/in] this.
01:07
@DaveRandom "The weight and value of the silver penny steadily declined from 1300 onwards." (same wikipedia)
Not this was any news.
@hakre Yeh it's a really weird subject. I still have a few old-money coins knocking around
You could use them after decimalisation (some of them), there were still 2 shilling coins in circulation when I was a kid
(they were worth 10p though)
It's not that weird in the end.
They where seriously large weighty things as well, an old 50p coin could have been used as a weapon
See thiis (one of the better Wikipedia articles after all) -> Other uses -> first entry in: en.wikipedia.org/wiki/LSD_(disambiguation)
Debasement is the practice of lowering the value of currency. It is particularly used in connection with commodity money such as gold or silver coins. A coin is said to be debased if the quantity of gold, silver, copper or nickel is reduced. Examples For example, the value of the denarius in Roman currency gradually decreased over time as the Roman government altered both the size and the silver content of the coin. Originally, the silver used was nearly pure, weighing about 4.5 grams. From time to time, this was reduced. During the Julio-Claudian dynasty, the Denarius contained app...
Shit I've just noticed the time, I need to bail
supposed to be in work early tomorrow, that aint gonna happen
nite @all
01:15
lol , ttyl @DaveRandom
sorry for keeping you ak-wake & gn8
@hakre nah, Jessica Fletcher was doing that :-P
Now I really am going, laterz
who the hell is Jessica Flecther?
Do I miss (pop) cultural references again?
noooooo not at all ;)
01:18
a
@hakre ?
which timezone are you in and are you young?
EST, nope, @hakre and why?
@Jocelyn you're always finding those dupy dupes dude.
01:22
@Jocelyn just push into the PHP chat at least it is PHP related (I would say).
@kaᵠ EST edited from GMT?! And why? Why not??!!
I mean young and in a timezone close is always an opportunity ;)
@hakre just realized there are specific timezone names :P
all the questions I here are tagged
I started cleaning up ones, full of gimme the codez
@kaᵠ yes, regex are hard to explain (if the OP always was looking for explain if not just get work done).
@Jocelyn always post them all in. always appreciated. All I've reviewed by you (and not a little amount) looked realy worthy to consider for being closed w/o making much words.
@hakre I got a system, point them to the awesome regex101 site and that explains it for me :P
that guy also deserves lot more than a beer
@hakre Thanks. I'll continue posting them whenever I have time.
Error "no ending delimiter" (contains many duplicate questions)
@kaᵠ which site is regex101 in your eyes?
01:37
@Jocelyn I always like your efforts.
@hakre regex101.com ???
@kaᵠ that site is so lame. running a computer program?! my computer can as well.
@hakre lame ? do you have a better one/option?
@hakre when I look at the size of the CV queue (over 50K questions now), I feel it is a lost battle :-S
@kaᵠ sure there are (at least) two better sites.
01:39
@hakre please share
the one is PCRE man pages. and that is a generalization only.
the other one is the tutorial site about regular expressions, called like the same dot info.
if you want to dig deeper, take a look at perl.
it is very well at dealing with strings.
ok, but for testing/composing/explaining a regex there's that and it's the best IMO
I don't know what your timezone is...mine says it is almost 4am now. Have a good day!
@kaᵠ I do not want to say "NOPE" but there is more to explain and no short solution is ready.
@Jocelyn oh yeah, here , too. gn8!
@hakre not sure i got that
morning @Jocelyn :D
01:43
:)
@kaᵠ you are young... :D
@hakre maybe :P what did you mean by 'no short solution is ready' ?
@kaᵠ 101regex is sort of nice, but it is not explaining anything. explanation is crucial. w/o it says nothing. where is the online help of regex101 about expressions?
@hakre regex101.com/r/mE8fV1 <-- it does sort of explain the regex, you will need more to understand it but does a pretty good job, you need more... read the book/enroll in CS
@Jocelyn oh cool over 50k now. Yeah. That is at least a number prooving many arguments wrong (at least when talking back next time about that number, but your smell does not stink that wrong).
@kaᵠ CS is short for?
01:52
Computer Science
@kaᵠ it dos not explain nothing and the usage of the term "community" desveres an instant hack of this guys server with eradicating all backups of all source code and the wish that guy comes online never again ;)
either that guy shares his&her code otherwise admittes to violate ZEND + (and) PHP license and admits that copyright has been violate by that same person (mea culpa) to get the website running).
@hakre wow, he's trying to help and you're really gonna take some 'technicality' so serious?
@kaᵠ no, just licensing.
yeah.. wanted to see the code too
PHP and ZEND licensing comes with a price.
NO not anything about the code. Just attribution. UPFRONT.
01:58
@hakre you mean php code should be available???
a
@kaᵠ no, just saying that this is PHP. where to donwload it. Of which engine it constists of. Making this publicly visible.
Free software itself is not so much concerned.
Just ZEND
i remember it does that somewhere
where?
bottom line, bold, first page:
sure.
ven three or so. ;)
sure.
even three or so. ;)
02:00
> Note that this website uses PHPs implementation of PCRE! Read more here.
@kaᵠ no, that is wrong kind of attribution.
How do you express in XPath that the next sibling node must be of a certain type?
that guy must have misread PCRE and PHP sources, violating copyright and leaving himself and users at risk ;)
@hakre in the about page (liked by that 'here') it says: 'The site is built in PHP (5.4.8), which implements the PCRE (8.12) extension.' with links
that's clearly ok
@Jack prdicate / (slash!) next predicate.
@kaᵠ no, not at all. Does it show you the licensing terms of PCRE?
02:03
@hakre Isn't the / used for child of x?
Does it even conform to them? - (rethorical, it does NOT no, not at all.)
@Jack sure. if not "child" just appemd mext predicate w/o the slash.
@hakre i really don't give to many fucks on that, i feel it's helpful and if you think he violates shit, email him, it's the humain thing to do
@Jack: It's as good as "and" (inside the former predicate)
@kaᵠ I'm perfetly assured, that guy gives a shit and the thinks he is doing a great job. Right at this very moment I won't stop him at thinking that.
Partly because it's his job to give a shit, partly because I just do not F (ef) CK (Cee K'ing) care (take care).
@hakre I see ... hmm, I saw a question about removing an excess of consecutive <br> and I just couldn't get it right with xp =/ the problem is that I can select a node that has a <br> sibling but I couldn't express that the next node must be <br>, i.e. if there's a text node in between it should not match.
@Jack please share the question. I might give you a quick hint to answer your questions marks (which also might help you to formulate a sane answer)
02:09
0
Q: Allowing up to 2 consecutive line breaks in HTML

ColeFor example: StackOverflow<br> <br> <br> <br> <br> is <br> <br> <br> <br> a <br> community. To: StackOverflow <br> <br> is <br> <br> a <br> community. If there are more than 2 <br> in a string, it should delete all the <br> and keep only two. Code so far: $txt_unclean = trim(nl2br($_POST['...

@Jack not sure if it's worth bothering if it's a new question, saw some dupes for it a while ago
I already have an answer and OP already accepted another, but it's the challenge more than the rep that counts here :)
@kaᵠ Irrelevant at this point :)
Unless you already know the answer =D
got it now ^
i'd do it with preg_ in a heartbeat
My answer uses the wonderful world of regex hoohoo
But only because I couldn't get an easy xpath expression together.
i see now :)))
this is a perfect example where regex is better
i think i might have given one answer like that, must ding thru my answers
02:12
Yeah, I would probably agree :)
i kinda feel like throwing up when thinking about solving that some other way than regex
but yes.. the challenge
That's what I have now ... which is ... a pretty obese piece of code to do something seemingly easy.
@hakre Short open tags? o_0"
(if you thought git was bad)
Lol
02:28
@Jack short open tags? WTF since when?
I mean who eva has used those?
I must admit I did, but that is a sad story of my own (even if you demand I will share source-code with you)
@igorw git has very good CLI interface. and Web interface. Maybe apacjhe hadooop has not.
Like "News
27 December, 2011: release 1.0.0 available"
(which is latest "news" on their website.
I added my answer to the 'replacing newlines' question
Sorry did I took wrong website? No, sorry, did I tool not.
@uınbɐɥs which one?
@uınbɐɥs Saw it :) nice ... I've added a suggestion to your regex :)
I think you mean short open tags,. Short open tags on their end won't be [^>]*> alone, so this comes close. But you also might fail well with this. A HTML parser would be a straight forward solution and if not, this still needs parsing. So not possible with a singular expression. — hakre 11 mins ago
@hakre that ^^
How is that short open tags? afaik they're known as self closing (or empty) tags.
@hakre I thought Git Koans was quite a good description of confusing inconsistencies.
@igorw lol !
02:38
g'night.
night
@igorw oha, one of the first lessons you learn that there is no pull.
@Jack nice huge code :D
fetch and merge. Now repeat the mantra ; + gn8
02:45
@igorw but well written!
LOL, just got a badge for:
5
A: htaccess on heroku for django app

hakreI was able to use .htaccess files on heroku with the cedar stack. Procfile needs to specify a script for the web nodes: web: sh www/conf/web-boot.sh The conf/web-boot.sh slipstreams the include of a apache configuration file, e.g.: A conf/httpd/default.conf then can allow override, as you ...

Pardon my obscenity, but what the actual fuck. XSLT doesn't have generic expression based loops.
I wonder how configuration questions rock the house oh so often.
@uınbɐɥs (\r?\n){2,} even better ;)
damn, i'm reading jack's comment now :P
@kaᵠ Yep :)
a, here it is: replace('#(<br\s*+/?+>\s*){2,}#i', '<br><br>') slight mod from here: stackoverflow.com/a/15917524/731947 (knew i did that before, but different question @Jack)
02:59
@kaᵠ \s*+ ....rly?
@Jack really ! think about it, only whitespace is allowed there
@kaᵠ Sure, but why is there a + after a * ?
your method of an inverted character class would allow anything except the char in that class, which is not w3c compliant for <br
@kaᵠ whatevs
@Jack nicely explained in my answer
03:01
@kaᵠ I think you meant optional whitespace.
@hakre indeed, optional whitespace \s*+ does that
@kaᵠ The + is superfluous, if not wrong.
Only one multiplier should be used for each expression.
yes i know it's really not important or even needed for this little case, but anyway
@Jack sorry, the plus there is not a quantifier
well actually it is, anyway ^
Hey everyone!
Interesting, I've been using greedy quantifiers as if they're possessive then :)
03:11
@Jack this is why using negated char classes is wrong in that example: regex101.com/r/jW2yO9
@Jack any quantifier followed by a + becomes possessive, and followed by a ? becomes lazy (when engine is in greedy mode, or the other way round)
Hmm what example?
You mean my expression? But you know that they're created by nl2br() =p
@Jack yes I saw that, but your example could be followed by someone with a similar request that does not use nl2br() and it's not the best approach, just does the job
3
A: Get The Number of Sepecific String Inside String

Barmarecho "There are " . substr_count($string, 'K') . " K's in the string";

Funny, Barmar votes to close the answer but still adds one anyway
@Jack this example regex101.com/r/jW2yO9
@kaᵠ Well, fwiw, I've "fixed" it :)
03:21
@Jack gave you the +1 now, but also consider replacing with <br><br> as the capture group saves the spaces also
@kaᵠ Considered, but spaces in HTML don't matter :)
yea.. just cleaner
wonder what's gonna be @crypticツ's Entry #2
Wanna see something funny? Look at this question :)
@hakre short open tags <? and <?= for PHP, in XHTML empty tags selfclose with />
mysql_real_escape_string (md5 ($_POST['verificarepassword']));
03:28
lol
> Irony : you need to escape all hash before inserting to database
tl;dr; but thanx @NullPointer,, and morning
@NullPointer because... MD5 is EVIL !!!!
2
@kaᵠ welcome .... morning ..
OMG he listed his website there
@kaᵠ dont hurt newb :P
03:31
i kinda feel very sorry for him
and now i don't, eww
sounds fair ....
and.. it's a shopping website, these people are not thinking...
yupp ... a bad designed website from both server and client side
i think i can design too .. when i saw those ridiculous design
ahaha
@NullPointer
03:43
@Hiroto they hate godaddy :P
well it was a useless tag anyway
+1 @Hiroto
> FreshPrinceOfSO
I giggled
i wonder why my two meta questions seem to have significantly more downvotes than i'm used to, lol
meta is all about downvoting :P
03:49
though then again they are both blunt and saying "it's broken, fix it with a hammer"
lol
@Hiroto don't down-vote, close instead, more efficient and then delete, even more
@kaᵠ ensure the functionality of your project in the future version of php (>=5.5). ?
7
A: How should we handle ext/mysql deprecation in PHP questions (older included)?

ka ᵠHigh-impact version Less rude, more friendly: There is no more support for mysql_* functions, they are officially deprecated, no longer maintained and will be removed in the future. You should update your code with PDO or MySQLi to ensure the functionality of your project in the future. C...

hello, i've got a question about desiging an application(espacially the routing), can someone review my 4-5 lines of code and comment about my aproach please? Here are codes:
@NullPointer it's a play with words, the simple phrase doesn't need knowledge about versioning, what basically does is to embed 'mysql_ is bad. period.' in newb's head
& ty
@kaᵠ My thoughts exactly :)
03:55
//creating some objects like database,session, loader etc here.

//loading routes
$route = new Lib\Route(ROOT_PATH . DIRECTORY_SEPARATOR . 'routes.php');

//matching current route
//mapping to a class, and a method to run
$route->digRoutes();

$class = $route->getClass();

//creating user, i will need this whole app
$user = new App\User($session, $db, $validator);

if (class_exists($class)) {

    if ($route->getResponde() === 'html') {
        $template = new Lib\Template('Temp');
        $app = new $class($user, new App\News($db), $template);
agreed
@Jack just to clarify as i saw there was a bit of confision
@kaᵠ imo you should ask for delv once you have cast one yourself :)
which 4-5 lines of that code @draconis ?
@Jack i asked for cv before reaching the limit, some questions are just bad, same goes for delv.. some are just horrible, anyway it's gonna be reviewed by 5 people (as i can't cast to be only 4)
@Jack sorry about your answer, but you haven't received any +1 on it and the question is... (i don't have a word for it :P) also who can that help?
and who's gonna read all that to get what?

« first day (920 days earlier)      last day (4253 days later) »