« first day (1740 days earlier)      last day (3214 days later) » 

11:00 AM
@mAyUrDeVmUrArI then read up on them. If you don't know how the attack works you won't be able to prevent it
If the thing was written by your average bad developer, it will probably be vulnerable to multiple of them
 
@mAyUrDeVmUrArI my gut feeling is a persistent xss is what is affecting your site atm
 
Anonymous
Stuck :/ - Any idea why this only creates a zip with the image from the first key of $files array? Instead of all keys? pastebin.com/HaCC2Che I think i'm being stupid. I expected the foreach to go through the whole array and as such add each URL from each key to the zip file?
 
SLY
Hey guys
 
@Jay your creating variable variables and not array keys. use [] instead of {} on line 10 and check your script again.
 
@chozilla Actually, {} is a valid way to access arrays
Although for that particular operation you should probably just use array_slice()
 
11:12 AM
@DaveRandom Doesn't it create variable variables?
 
No.
 
${'var'} === $var, but $arr{$key} is array access
 
@DaveRandom Yea, that's not a variable variable either.
Variable variables are like $$var
 
It would be if it wasn't a constant expression :-P
 
@DaveRandom It would be a variable variable if it was a variable variable?
 
11:15 AM
why can you access arrays with [] and with {} ? that is so new to me O_o
 
I'm pretty sure you're right.
;)
@chozilla It's been that way for over 13 years.
 
@Sherif Well, yeh, the point is that the ${$expr} syntax is valid :-P
 
@DaveRandom Who said it wasn't?
 
I thought {$value} would use the value but ${$value} uses the value. - my bad.
i am not using such constructs since 13 years ;)
 
2 mins ago, by Sherif
@DaveRandom Yea, that's not a variable variable either.
 
11:17 AM
but.... never used {} to access arrays... i always search for the bracket key >_<
 
I know what you meant, just clarifying it for observers who might not have
 
@DaveRandom Yes, I said ${'var'} isn't a variable variable. I never said it wasn't valid syntax.
 
Anonymous
Yep.. I was being stupid. all of the basenames are the same -.-
 
nor did i see {} been used in any "professional" framework or project I ever worked on >_<
 
@chozilla Curly braces are pretty much interchangeable with square brackets in the context of dereferencing in PHP.
 
11:18 AM
well i never worked on professional projekts anyway :P
 
$str = "foo"; echo $str{1}; // gives you 'o'
Doesn't just work on arrays either.
 
who would have thought that i learn something that basic after thinking i know php very well >_<
but yea, not knowing that did not keep me away from doing everything possible with arrays... i did not miss the syntax
 
> Note:
> Both square brackets and curly braces can be used interchangeably for accessing array elements (e.g. $array[42] and $array{42} will both do the same thing in the example above).
 
Yea but the output, the examples, everything uses square brackets.
 
@chozilla It's an obsolete legacy syntax
 
11:22 AM
maybe I am just ignorant to "other ways of doing stuff"
 
It's supported, but you should not use it
 
@NikiC which one is legacy and which is to use?
 
@chozilla {} is legacy, [] should be used
 
thanks
 
Lots of things in PHP you shouldn't use.
 
11:26 AM
I am sure i don't use php how it is intended. I violate Liskov substitution all the time >_<
 
@chozilla slap.
Can you not make jokes like that please.
 
@Danack better?
 
Yes, way less rapey.
 
@Danack Are there any pics of the PHPSC conf you know about?
 
@Jimbo there's a few at flickr.com/photos/akrabat
don't know others.
 
11:38 AM
There was one guy who was taking loads all day, looking for that :P Let me know if you find any more anyway
 
Jul 18 at 20:08, by Jimbo
user image
 
:D
 
rock n roll
 
I think companies want to hire (programming) rock stars all the time.
You might as well get the look right.
 
@Jimbo Akrabat has a small gallery somewhere
 
11:45 AM
@Danack Can we get that face in the band picture?
 
I don't have the skills for that....
 
@DaveRandom I formatted and things have been fine so far but will see more as I use it.
 
why did i ever write this....
 
hello guys
i have a question about codeigniter
 
switch(false) {
	case (mb_strlen($input) > 0) :
		$this->refuseInput(self::ERROR_EMPTY);
		break;
	case (mb_strlen($input) > 1) :
		$this->refuseInput(self::ERROR_SHORT);
		break;
	case (mb_strlen($input) < 9000) :
		$this->refuseInput(self::ERROR_LONG);
		break;
	default:
		$this->acceptInput($input);
		break;
}
I dont even know how to format code >_<
 
11:54 AM
should i ask that here?
 
@chozilla arrow up -> ctrl+k
 
can i?
ok
codeigniter shows white page
 
You can always ask, but if it is CI specific you are shit out of luck
226
Q: How to get useful error messages in PHP?

CandidasaI find programming in PHP quite frustrating. Quite often I will try and run the script and just get a blank screen back. No error message, just empty screen. The cause might have been a simple syntax error (wrong bracket, missing semicolon), or a failed function call, or something else entirely. ...

 
without logging and showing any error!
i have tested all these answers
but it seems there isn't any error!
 
In that case you are not outputting anything
 
11:56 AM
Research time. I need a method for comparing two strings for similarity. Also allowing weighting of the score from a given array of values that may or may not exist in the strings being compared
 
You want fries with that?
 
no
 
Yes
 
i am using
$this->load->view()
 
Doubt by any chance anyone is familiar with some library that could assist me in my task?
 
11:58 AM
@Fabor I was looking, but it is kinda hard to find something as specific as what you want :P
 
@Fabor not a library but a phrase - en.wikipedia.org/wiki/Levenshtein_distance
 
i think the problem is about view loader
 
@Danack Does that also do custom weight thingies?
 
I've never used the built in one.
 
11:59 AM
@Fabor i am using firePHP to output on every step thou the programflow
 
Using levensthein currently but I need to also weight in certain words to emphasize less similarity
 
@PeeHaa levenshtein is just an edit distance, number of edits to make string A become string B, how do you want to do the weighting?
 
ok
i will ask a question
 
So broop720 vs broop1080 would score higher due to my weighting emphasizing differences if the strings contain ['720', '1080']. Where as broop721 vs broop1081 would be a straight forward comparison
 
12:01 PM
@JoeriSebrechts Not my requirements ;)
 
something very naive would be multiplying the result of levenshtein with a factor when one of the array words is found in the string
@PeeHaa yeah, sorry, noticed after posting i was replying to the wrong person
 
:-)
 
oh, apparently that story is rubbish.
 
@Patrick thanks bro.
 
Sort of similar to how lucene searching supports weighted words.. foo^0.1
 
12:03 PM
@RonniSkansing thanks you ...
 
i wrote a "google-like" (customer's description of the feature) search implementation that used multiplication with scale factors to weight different comparison factors into a total, and the result was surprisingly good
 
@Fabor Import the pages in lucene and query it?
 
@JoeriSebrechts That's the route I am potentially heading, looking at the string and figuring a sensible equation to score it after levenshtein.
@PeeHaa lol
 
Bitches love document databases
2
:)
 
@RonniSkansing there is no .XSS file in my project
 
12:07 PM
posted on July 22, 2015 by kbironneau

/* by MonsieurLeMarquis */

 
£5 to the man, woman (or @PeeHaa) who invents something to stop yogurt curdling to the top of the pot/lid before I open it.
 
i found an in strange thing!
 
@Fabor lol
 
this code works:
`echo $this->load->view('account/authentication/header.tpl.php', "", true);
die();`
but this on shows white page:
$this->load->view('account/authentication/header.tpl.php');
 
12:09 PM
@mojtaba Please use a debugger rather than just trying stuff at random:
 
Serious @mojtaba setup error reporting proper and the actual issue will become clear
 
Or error reporting is also good.
Using the Force.....not so much.
 
@Danack it is enabled
 
@mojtaba Then why are you trying shit at random?
 
because there isnt any error!
but still it shows white page
log file:
DEBUG - 2015-07-22 16:36:40 --> UTF-8 Support Enabled
DEBUG - 2015-07-22 16:36:40 --> Global POST, GET and COOKIE data sanitized
DEBUG - 2015-07-22 16:36:40 --> Session class already loaded. Second attempt ignored.
DEBUG - 2015-07-22 16:36:40 --> Config file loaded: C:\wamp\www\farda\application\config/flexi_auth.php
 
12:11 PM
@Fabor direct levenshtein doesn't scale though when you're comparing against lots of possible keywords. chapter 2 of programming collective intelligence describes how to build a scalable weighted similarity algorithm. though at that point, it may indeed be better just to throw it into lucene :)
 
Sounds like a gap in the string comparison PHP market that should be filled by @DaveRandom. Or @AlmaDo he loves that math stuff.
 
levenshteini()
Just what we needed!
 
@Danack is it possible?
 
Testing php7dev... is it intended that (function () { stuff })() is valid but not (function foo () { stuff })()?
 
one does not just immediately invoke a named function
(yes)
 
12:15 PM
In JS you do :( and it is nice :/
ok
 
@AwalGarg o/
 
@PeeHaa \o
Can we deprecate call_user_func now? :P
 
Anonymous
@PeeHaa can you answer my question, I would like your opinion.
 
Anonymous
I can't paste it here sadly.
 
@AwalGarg Why? It's basically the JS way? :P
 
12:17 PM
@PeeHaa yes! and it looks nicer TBH :D
 
@AwalGarg we can turn it into an opcode first, so that it doesn't matter anymore ...
 
@JoeWatkins ah, makes sense
 
@samaYo Where? On main?
 
@JoeWatkins … we are doing that?
 
BTW Just finished doing the famous JS module revealing pattern with PHP7's new IIFEs and anon classes. So. Much. Better.
 
well, "fixed" IIFEs :/
 
@JoeWatkins yea, that's what I meant.
 
oh right, I was finding a link ...
 
@AwalGarg Yeah, but PHP has sane scoping by default though ;)
 
Anonymous
@PeeHaa yes.
 
12:19 PM
exactly
 
Anonymous
About domain object ..
 
I think I agree with @Orangepill although to be perfectly honest I kinda dropped the concepts of DO's in my latest projects
 
Where do you deal with calculations of your data etc?
 
Anonymous
@PeeHaa shame because I liked your previous projects, anyway what are you going to use instead?
 
Basically arrays :P
The layers on top of laters on top of an abstraction on top of layers got in the way at some point and I decided to just write code ™
^ thanks @DaveRandom :P
 
12:27 PM
I can see a middle-ground. I build it initially without but refactor them in after it mostly works.
Like tidy-up
 
@NikiC Is it really supposed to throw Exception(1)? AFAIK, we're just overwriting the original exception, and then catching it. It very much looks like the behavior we have with multiple return in finally too.
 
@bwoebi It's supposed at least in that it's what we do normally
Drop one try/finally nesting level and it will throw Exception(1)
Whether that behavior is right ... we should check Java
 
@Fabor yes, levenshtein is not scaling, it's ay caramba
 
@AlmaDo heh. TBH we don't do huuuge comparisons. So it's not a bottleneck for us. It's the lack of weighting words that sucks.
 
@Fabor I lost context, sorry :\
 
12:33 PM
@NikiC Are we supposed to have the exactly same Exception mechanism than java?
 
@bwoebi Java throws Exception(1)
@bwoebi Our finally handling matches Java very closely
 
Basically I'm after something more like stringCompare($a, $b, array $weight) {}

stringCompare('foo123', 'foo456', []); // Returns 8
stringCompare('foo123', 'foo456', ['123', '456']); // Returns 13
 
hmm
 
@Fabor why first returns 8 ?
 
Standard levenshtein(). Made up score but 1 is exact presumably.
 
12:36 PM
@NikiC yes, then the fix probably is to have a separate FAST_CALL chain here.
 
@Fabor then it's
$ php -r 'var_dump(levenshtein("foo123", "foo456"));'
int(3)
 
I just put 8 as an example. Just demo'ing the type of function I am after.
 
and I didn't get the meaning of those $weight
 
The array $weight is values that if contained in the comparative strings make the comparison harsher. Hence why score goes up to 13.
 
then if you'll specify '123' in weight array, what will happen to foo12 against foo23 ?
i.s. substrings matter or ..?
 
12:40 PM
Unsure. The key goal is to simply use those keywords to spot more sensitive string match needs.
 
Also @NikiC compare:
try {
        throw new Exception(1);
} catch (Exception $e) {
        throw new Exception(2);
} finally {
        throw new Exception(3);
}
try {
        throw new Exception(1);
} catch (Exception $e) {
        try {
                throw new Exception(2);
        } finally {
                throw new Exception(3);
        }
} finally {
        throw new Exception(4);
}
 
also, lack of definition for "harsher". If I will have ['123', '456', '789'] - what are results for foo123, foo456 or foo789, foo123 - like, what is defining that "difficulty"
It sounds like you're seeking a very ingenious way to shoot yourself into you leg
 
@NikiC the first one properly chains the exceptions, while the latter one only throws the Exception(4) without previous exception set
 
I could just up the cost of the levenshtein calculation if one of those strings is found.
 
@bwoebi yes. though personally not convinced we should be chaining anything at all
 
12:44 PM
@Fabor what's the underlying feature here? you're making me curious
 
@NikiC good question… well, ultimately the chaining just is there to show more exact origins to the dev?
 
Array of strings that belong in groups. In order to decide groups it's based on similarity.
 
@NikiC well, the good thing about that is that we'll end up with a rock solid test suite around finally, haha :-D
 
@bwoebi you wish...
We already have lots of finally tests
But there's ever more issues ...
 
@Fabor well I have an idea..
 
12:54 PM
@NikiC we have a lot of try/catch/finally tests, but none of them nest try/catch/finally into catch or finally blocks.
 
@AlmaDo I can do it with levensthein() and strpos() searching the compared strings. If found I increase the cost of the comparison.
 
@Fabor so simple approach is like:
function l($string1, $string2, array $weight = [], $m = 2)
{
        if (empty($weight)) {
                return levenshtein($string1, $string2);
        }
        $pattern = sprintf('/%s/', join('|', array_filter($weight)));
        preg_match_all($pattern, $string1, $matcher1);
        preg_match_all($pattern, $string2, $matcher2);
        return levenshtein(preg_replace($pattern, '', $string1), preg_replace($pattern, '', $string2))
                + levenshtein(join('|', current($matcher1)), join('|', current($matcher2)), $m, $m, $m);
 
could some of you please review my question & answer at:

http://stackoverflow.com/questions/31521121/how-to-use-the-symfony2-validator-component-in-a-legacy-php-project

and tell me why it is getting downvoted? is it out of scope? did I made the intent not clear enough?

I am a bit confused as to why the downvotes are happening on this one.
 
you can also remove joining with delimiter from weight-based comparison if chunks distinction is not needed
 
@AlmaDo Yeah that's a nice way of writing it out cheers. Will use that.
 
1:04 PM
or else, add that to comparison of non-weighted part (so to add more strict way of comparing that part)
 
@Fabor You should probably add preg_quote to escape the values in $weight.
 
^ that's also true
 
Righto
 
I would just like to say, that DateTimeImmutable::createFromMutable() is an incredibly worthless method, because it expects a DateTime. If it were, DateTimeImmutable::makeImmutable(DateTimeInterface $dt), it would serve a purpose beyond frustration.
 
it's rough proof of concept..
 
1:06 PM
The DateTime library needs to go away.
 
it may result in odd stuff when dealing with 'foo123' against 'sdjfhsdjfsd123'
and it is levenshtein on top of regex, so don't expect it to handle production data sizes..
 
@AlmaDo Any reason why you used preg_match_all and current instead of preg_match?
 
yes
$ php -r 'preg_match("/123|456/", "foo123bar456", $m); var_dump($m);'
array(1) {
  [0]=>
  string(3) "123"
}
$ php -r 'preg_match_all("/123|456/", "foo123bar456", $m); var_dump($m);'
array(1) {
  [0]=>
  array(2) {
    [0]=>
    string(3) "123"
    [1]=>
    string(3) "456"
  }
}
it's not just "be aware if it's there".. it's about to fulfill complete check against all chunks
 
user895378
morning
 
hey, @rdlowrey
 
1:10 PM
@rdlowrey morning
 
user895378
o/
 
Anonymous
\o
 
@rdlowrey how's HTTP/2 going in Aerys?
 
user895378
@kelunik We basically laid the groundwork for it. We just have to implement the actual protocol now. amp/1.0 will be tagged sometime this week or Monday at the latest. The filesystem lib will be 0.1 soon after that and I'll jump back on the aerys train.
 
user4706838
hello every one
 
user4706838
1:15 PM
can anybody help me with this problem
 
@rdlowrey First stable release of any of your libraries. \o/
 
@kelunik naive :p
 
user4706838
1
Q: call to udefined function form_open()?

OptimmusThis is very common question but my problem is that i am using phpstorm and i am getting errors on CI's common function. i have Done every thing like $autoload['helpers'] = array('form','myhelper'); Previously i am using Dreamvieweaver and not getting those messages there now i have to work...

 
user895378
@kelunik almost -- auryn became 1.0 last week :)
 
Amazing DJ mix. And if you wanna FF to my favorite part, it's here.
 
user895378
1:22 PM
@JoeWatkins I am super into the beard man. Nice work.
 
It finally happened Joe. You've hit on @rdlowrey enough that he's reciprocating.
5
 
user895378
@Fabor In the pickup artist community we call that, "mirroring"
 
heh
 
error_reporting(E_GAY | E_RDLOWREY);
 
@rdlowrey /me blushes
 
1:28 PM
This question pains me. And I am fairly sure the responses will hurt aswell, but here we go: Does anyone know of a coughwordpresscoughplugincougn that syncs wordpress' upload directory with the wordpress media library?...
 
ha! wordpus!
 
the shame
 
:P
@DamienOvereem Isn't the upload directory basically the media libary btw?
 
I am praying for some magical out of the box solution.. since otherwise I will actually have to dive in the bloody wordpress jungle to mash something together myself..
almost yes.. but wordpress does not look at the upload folder
it only uses it's database
and it does not have a method to scan the folder for missing entries in said database
 
What are you trying to do. When manually uploading something into the upload directory it should end up in the libary?
 
1:30 PM
That is basically it yes
The wordpress installation is in svn
including the images.. and have been released to the production database (With a different database)
so the "source" contains images that are not present in the production database
stuff still works.. since the images can be located by their uri's, but they can not be maintained in wp
 
yeh did run into both of them. They dont seem to do what I need exactly, but I guess i'll tinker with them
ow media from ftp actually does seem promising
 
Wasn't there an awesome "uninstall" plugin?
 
I love wordpress.. keeps marketeers off my back
i just hate it when i actually have to do work on it
 
user895378
@Ocramius Yeah lol ... rm -rf ./wordpress
 
1:35 PM
@Ocramius Yeah by the great @RonniSkansing
 
don't be mean!
 
@DamienOvereem Sometimes euthanasia isn't mean but necessary. RIP WP.
 
> Remember to upvote and click "Works" so everyone can feel safe uninstalling..
 
Well.. i knew asking that question here would hurt me :)
 
1:38 PM
heh.
 
> This solved my needs perfectly By jose.sg, June 23, 2014 for WP 3.9.1
When we realized that we had WordPress running, it had to go ASAP. This plugin served it's purpose quite well. My only regret is that it deleted itself in the process.

A++ would uninstall again!
 
LOL
 
Hey :)
I have a question about bash_profile and setting the PHP path
 
Quacker became who Ronnie in this room?
 
@PeeHaa thanks!
 
1:41 PM
I execute nano ~/.bash_profile and make edits. to change my PHP location . When I save it close the terminal or make use of 'source' I can let my changes work. All good all fine.
 
user895378
@Fabor yeah
 
@Ocramius Anytime :)
 
When I close my terminal and restart it... it's not working anymore.
which step am I missing?
 
user895378
@DamienOvereem sorry man ... it's just that no one here uses wordpress so a domain-specific question isn't likely to net you any useful assistance.
 
@Fabor excuse me, Sir, but that's ßullshit :-D
 
1:43 PM
No worries @rdlowrey. I've been around here long enough to know what to expect when asking such a question :)
 
anyone have an idea how best I can clean up (except deleting the whole app) an application that has htaccess with this format total of about 82 lines
 
You can already get rid of a ton of R"ewriteEngine on
RewriteBase /"'s ;p
 
Remove it all and use FallbackResource /index.php
 
Github. I create a branch, make a change in the branch, make a PR and merge into master. Then my branch says I'm 1 commit behind master. Wtf?
Am I missing something simple?
 
What is @AlmaDo? :P
 
1:45 PM
@Jimbo The merge commit?
 
@PeeHaa they don't all point to the same file
 
Well they should :P
 
@PeeHaa What's the next step, merge from master into the branch? Wouldn't that create a merge commit again?
 
@Fabor He clearly stated, it's Ssullshit
 
@Jimbo no, that'd be a fast-forward merge then.
 
1:46 PM
lol, idd.
 
I'm in trouble... The fellow who wrote this will burn in a lake of fire.
 
@iroegbu who wrote what?
 
@bwoebi So how do I get rid of the little 'X commits behind master', or do you just generally not
 
Had to Google idd... Apparently I'm not down with the kids
 
@Jimbo just pull from master.
 
1:47 PM
3 mins ago, by iroegbu
anyone have an idea how best I can clean up (except deleting the whole app) an application that has htaccess with this format total of about 82 lines
 
@iroegbu lol, just in case mod_rewrite turned itself off between rules...
 
@bwoebi I'm on Github, not using CLI or anything :-)
 
@Jimbo then no chance.
CLI all the things.
 
user895378
$ git checkout master
$ merge -s ours non-master-branch
 
user895378
^ uses the "ours" merge strategy to merge non-master-branch into master and retain everything that's in the current master branch.
 
1:50 PM
@rdlowrey that's a merge^^ he wants a fast-forward on the github UI.
 
@bwoebi Yes, ff in the GitHub UI would be nice.
 
user895378
oh, yeah then ... CLI all of the things. Using the github web UI only ever causes me problems.
 
user895378
Best just to become proficient on the command line with git IMO.
 
^++
CLI never really changes.
 
@DaveRandom this idd?
 
1:59 PM
who would have thought that creating a message board in php could be that frustrating of a task?
 

« first day (1740 days earlier)      last day (3214 days later) »