« first day (1737 days earlier)      last day (3208 days later) » 

12:50 AM
I just realized that phpdbg_parser.y has no %expect 0 … too tired to deal with bison now :s
 
nice :-)
 
Are you guys still out @Jimbo? We just caught the last train back. No guards too so free journey \o/
Would have loved to have stayed though
 
user4639281
1:34 AM
I know this question is off-topic for Stack Overflow, but the guys on Internet Security scoffed when I asked whether it was on-topic there or not. Does anyone have any input on This WIP question?
 
Denial of Service
 
user4639281
@ircmaxell I didn't think of that. So limit on the amount of queries a user can submit within a certain time-period?
 
that won't even work
because someone could send a really complex query
 
user4639281
1:49 AM
So I should find a way to limit the amount of time the server can spend thinking about the query before it times out?
 
2:33 AM
does anyone know if there's a way to set the amount of time your servver attempts to send the mail() in?
 
 
2 hours later…
4:27 AM
how can I detect that a user (not logged) voted to a post. (I know IP and Cookies, there is anything else ?)
 
4:55 AM
NTMK
 
@php_purest you answered my question ?
 
not to my knowledge
@Sajad don't ping me like that
 
@php_purest ok :-P
 
oh, you forgot session
 
I use of session for what ?
 
5:01 AM
remaining logged in
 
no no, I want to detect someone that voted and thy are not member
 
if they're logged out they vote that way
 
[if they're logged out they vote that way], what way ?
 
-1
Q: Trying to hash a password, but every time it just hashes to *0

xcdemon05I'm learning how to hash passwords using PHP for obvious security reasons. I have the two following functions for setting and checking hashes: function password_encrypt($password) { $hash_format = "$2y$10$"; //blowfish $salt_length = 22; $unique_random_string = md5(uniqid(mt_rand(),...

does anyone else remember /dev/sigh?
 
5:19 AM
TIL @Danack is Robert Baratheon
 
what is "throw new Exception" in php ?
 
you create a new exception object
wwait
no, my syntax is right
you create a new Exception() object, then you throw it :P
 
@ScottArciszewski whan that is useful ?
 
it interrupts whatever your script is doing until it reaches the appropriate error handler
even if it's 5 function calls ago
and if it doesn't find one
it kills script termination
it's a great way to stop your application from processing an invalid result
 
@ScottArciszewski I see , thanks
 
5:52 AM
@ScottArciszewski "throw new Exception" is something like die; or exit() ?
 
Hey guys, need opinion. I'm storing user uploaded images in folder "thumbnail","medium","large", should I also separate those into years and months? Large volume of images uploaded, on a dedicated server, planning on moving over to the cloud at some point.
pros and cons to it?
 
@Darius folders with lot of contents can cause problem. for example ftp LIST may limit the number of returned files
you could use a directory structure like /images/2015/07/19/small/#ID#
 
6:09 AM
Agreed, just read about that cap and how normal tools start giving issues. Seems like I'll have to incorporate something that counts number of files in a folder and create a new folder if 1000 files have been reached to avoid issues.
 
if you think you'll get more than say, 500 uploads each day, you could add another dir too
 
Yeah, I do believe that'll be the case.
I had 600 last night.
usually around 100 though
thanks!
 
/images/2015/07/19/1to100/small/#ID#
/images/2015/07/19/101to200/small/#ID#
/images/2015/07/19/201to300/small/#ID#
so a folder will contain max 100 files
or if you use an hash as filename, you can use, say, the first 3 characters as folder name
 
Got it. What do you think the logic behind a folder structure like this is? img04.deviantart.net/605f/i/2015/199/3/3/…
danggit, truncated.
I see the year in there, the rest looks like random stuff.
 
/images/2015/07/19/a1d/small/a1ddi92masf01okdf29sdfl.jpg
605f is probably part of an hash string
substr(md5("filename.jpg"), 0, 4)
 
6:14 AM
the 199 is probably the day of the year
 
interesting, never knew of hash directories, reading into it now.
and 199 as a day makes sense
gets rid of useless month separation
 
random hash values are probably used just so to help thwart phishing tools from guessing urls and scraping images.
 
@Orangepill also to avoid having a "path" column in databases
 
That was another concern of mine, having to deal with putting the path in each database row.
 
6:19 AM
or may denote what cdn bucket the file is in to dodge a lookup.
 
So hashing might be what I'm looking for
That would mean, I have to run a function every time on my image file name when served via <img src=""> to find out what directory it is in. right?
 
another good thing about deriving the file path from the content hash is that it will eliminate storage for duplicate uploads..
 
also true ^
 
@darius maybe... depends on what strategy is used.. for simple stuff it could be just split the hash using substring to insert path separators.
 
$path = "/" . $this->year . "/" . $this->month . "/" . $this->day . "/" . substr(md5($this->attachmentID), 0, 3) . "/" . md5($this->attachmentID);
something like this, perhaps?
 
6:23 AM
God this idea excited me. Thank you so much guys.
 
morning
 
@NullPoiиteя o/
 
morning
 
@RonaldUlyssesSwanson whats up ?
@Orangepill o/
 
6:27 AM
@NullPoiиteя thought of you when i watched this acidcow.com/video/72581-war_freestyle.html :D
 
he is damn good, though i have bamboo flute which doesnt produce sound like this :)
 
Any good room 11 approved psr-7 middleware dispatchers?
 
7:12 AM
I wrote a thing: paragonie.com/blog/2015/07/… -- anyone know of any use cases I missed? :)
 
moin
@ScottArciszewski cs array_shuffle :s
I don't want to sound ignorant, again ... but why ?
 
pick a card, any card
 
I don't get it
 
you're not into online gambling, eh? :P
 
oh oh I see
clever ...
I'd mention that ...
 
7:19 AM
ok done :)
 
 
3 hours later…
9:52 AM
Dave's asleep on my sofa. He hasn't had a lot of sleep the last few days :P
 
@Fabor wake him! (not really.)
 
10:06 AM
@Fabor mornin'
Good to see you guys yesterday :-)
 
@ircmaxell Okay, that just means I need to spend more time in here ;-)
 
10:23 AM
@SebastianBergmann yes, yes it does
 
@bwoebi he is a pretty heavy sleeper :p probably due to kids.
You too @Jimbo. You guys stay out much later?
 
@Fabor Nah only until about half 12 then everyone kind of splintered off and that was it really
 
10:41 AM
Hi how can i use switch in blade (laravel)
 
Should've stayed at the first venue I guess.
 
@ELOISSIFIAhmed By committing to remain a junior for the rest of your career :-) #trololol
 
@Ji
@Jimbo thank u
 
@ELOISSIFIAhmed Tbh you won't likely find much Laravel help here - I suggest making a question on the main StackOverflow site - you'll likely help others in the future as well that way
 
10:58 AM
mornin
 
@JoeWatkins morning man, got back okay then
 
yeah missed ferry by one minute, so had to wait at port for an hour and fifteen minutes, but there was sausage rolls and cake, so it's all good ...
 
11:52 AM
Such incompetence shown here. They printed the same seat for two passengers. And are getting confused as to who belong swhere. Because someone swapped seats (in same resercation). It would be funny if we weren't already nearly an hour late...
 
@JoeWatkins Ah sucks man, at least you got there eventually
I'm moving between starbucks until 5pm - that's when my train is
 
12:33 PM
Sigh. Why does this have to be hard?
Yay, finally pushing back...
 
12:52 PM
If I have a ValidatorComposite, which is effectively an aggregation of validators, and you call registerValidator(Validator $validator) to add them to the composite's validators class member, and finally you can call validate() on the composite to iterate around the validators calling validate on each one... Is that effectively an implementation of the observer pattern?
As in, you're adding a subject to be observed, so that when ValidatorComposite::validate is called (the observer), it iterates around it's subjects...
 
user895378
1:03 PM
morning
 
@rdlowrey good morning
 
mornin'
 
user1804599
1:23 PM
@ircmaxell where are you going?
 
1:39 PM
mornig
 
user895378
I still think it would be helpful to allow userland access to an obect's internal ID ... this would give me built-in access to a reusable pool of identifiers for non-cryptographic purposes without having to worry about collisions in the same thread space.
 
@rdlowrey … like an explicit int cast should give you the id?
 
user895378
@bwoebi yeah, it would be really helpful for me in a few places.
 
user895378
e.g. for amp watcher IDs (instead of incrementing strings)
 
we're doing it for resources, and I don't really see the why not
especially as spl_object_hash doesn't seem to be always reliable
 
user895378
1:52 PM
I can't see how it would break BC either
 
user895378
currently (int) $obj just always casts to 1
 
user895378
So the only thing the current behavior is useful for is bool comparisons (which would still work because you can't have an object ID of zero)
 
@rdlowrey But but but what about the futur __toInt()? :)
 
user895378
Couldn't that just override the default casting behavior if specified?
 
Yeah guess so. Or the other way around. Have a way of toInt to return the internal id
 
1:57 PM
@PeeHaa no. no. no. never.
:-P
 
user895378
Also: I like the performance characteristics of a cast so I don't need an fcall to access this information. Otherwise I could just use spl_object_hash()
 
@rightfold Phoenix
 
@rdlowrey sneak it in for 7.0 (!!!)
(well, seriously…)
 
user895378
I don't need it badly enough to annoy folks with a last-second change.
 
@bwoebi What's wrong with it?
 
2:03 PM
mh
@kelunik different objects may reuse it, I thought? (when the original object was freed, no?
 
user895378
@bwoebi that's the same thing as object IDs
 
user895378
They're reusable once an object is garbage collected
 
user895378
I assume the hash is based in part on the internal ID
 
@bwoebi At least the documentation states so, yes, but I think that will always be the case, otherwise you'll run into problems with really long running scripts.
 
hmm, handles are only uint32_t. yeah…
 
2:09 PM
@rdlowrey it's entirely the internal id
 
user895378
I suppose I can just eat the spl_object_hash() fcall overhead in that case
 
user895378
Airplane bored is somehow worse than regular bored.
 
yup
as much as I love to travel, I hate to fly
 
user895378
Maybe it's the added element of claustrophobia.
 
2:19 PM
no, I'm not really claustrophobic. I think it's really just the lack of control
hmmm, need to decide if I want to see a show in Vegas while I'm there
or what to do in general (besides eat, drink, gamble and pool that is)
 
user895378
Ohhh I love Las Vegas.
 
My second time, and first staying on-strip
 
user895378
But only for like two days. Vegas and Mardi Gras in New Orleans are the two places where about two days is enough for me. Anything more than that and I start feeling like a bad person lol.
 
what do you reocmmend?
 
user895378
I just love blackjack and drinking. I'm not really a show person. I like Broadway things in New York but I've never been big on the Vegas-type shows.
 
2:26 PM
/me is going for 2 nights, about 1.5 days (getting in about 5 tongiht, then leaving 8am on Tuesdays
@rdlowrey me as well, but I'm not going to spend 24+ hours at the poker tables. I'm not that good and my wallets aren't that deep
 
user895378
My vegas routine is: arrive in the afternoon, sit at the pool for a couple of hours, do some gambling until I get enough free drinks that I need to stop gambling -or- lose enough that I need to stop gambling. Then continue drinking. Sleep in the next day. Repeat.
 
@ircmaxell get married and divorced in one night
 
user895378
@Gordon this is actually a great idea. I need to do this once in my life.
 
@Gordon lol
@rdlowrey That's my Atlantic City pattern. Not really looking to do that this time tho. Perhaps tonight, but tomorrow I'd like to do something
 
user895378
But honestly I just love walking around the strip drunk and seeing all the crazy eye-candy. Things like walking inside the Venetian with the fake sky ceiling are really trippy when you're just the right amount of intoxicated.
 
2:31 PM
@DaveRandom just increased my broadband download speed by 90%. It's amazing!
 
user895378
@Fabor windows registry settings?
 
@rdlowrey /me is staying in the Venetian
 
No. Manual stuff. He was sorting out all the wiring in my sockets.
 
user895378
@Fabor There's a joke to be made about someone's mother there but I'll leave it to your imagination.
 
He said he has never seen such a performance boost for disconnecting excess wires.
 
2:33 PM
@Fabor Everything else in your house is dead now, but at least you have decent internet!
 
Daniel, lol yeah. Writing it felt a little like one of those adverts. "Telecom engineers hate him! Improve your bandwidth by 90% with these 5 easy steps from expert DaveRandom".
 
LOL
 
user895378
@ircmaxell It's kind of cheesy but one thing I really enjoyed doing was listening to Clair de Lune with headphones and watching the Bellagio fountain at night (ripped straight from Ocean's Eleven).
 
user895378
I just set it to play on loop and sat there with headphones for like half an hour.
 
@PeeHaa Yeh I wired the cat into the circuit, seemed to help
 
2:40 PM
hi guys, is there a separate room for drupal discussions?
 
@DaveRandom :P
 
user895378
@mad_programmer Not that I'm aware of. You'll likely have better results asking your question on the main site, unfortunately. I don't think there are many (if any) folks here who use Drupal on a regular basis.
 
thanks for the info. @rdlowrey
 
user895378
@mad_programmer but if you have specific questions about php code people can help here.
 
@rdlowrey LOL
I think I'm going to go to the sign museum
 
2:47 PM
@rdlowrey no its more about the api related question which I had.
 
@mad_programmer ask away, just keep in mind if you don't get any answers why it may be (though it never hurts to ask)
 
:)
Ok, well there is a hook_field_display_node_alter() function in drupal to alter the field when the node is getting displayed, how could I use the content parameter in that?
 
3:15 PM
blah
part of me wants to write code, but every time I open the editor I blank and can't get "inspired"
 
@ircmaxell Have you tried booze. That seems to always help me get inspired
Well actually that or pot. But I don't do pot anymore
 
on a plane at 11:30 in the morning. Why didn't I think of booze...
 
3:30 PM
Idunno? :P
 
blah blah blah
need to find a bank to go get a cash advance from
forgot to pull out money yesterday
can't go to Las Vegas with $100 in your pocket
 
:)
 
What do you guys think about naming an object the Default one. Planning on interfacing something but the interface name would just be the same name as the concrete :/
So EventNameTransformer ---> DefaultEventNameTransformer
 
I don't like Default as name in general
 
:-(
 
3:42 PM
@Jimbo my question, if you can't think of a separate interface name, why are you extracting an interface?
 
As in it doesn't tell me anything
 
as in, that's a sign that you may not need an interface
 
@ircmaxell Because the implementation could change. Effectively it's an object with the responsibility of changing github's pull_request event name to PullRequest (my internal event object). So it's kinda mapping it, I guess.
But what if Github changes that to pull-request in the future
or even more complex
 
well, if GitHub changes it, the class changes
you don't need an interface for that
 
Hmm, apart from over-engineering, is there absolutely no reason to interface that, then?
 
3:43 PM
what you would need an interface for though is if you wanted to support BitBucket "pull requests"
 
Ah, okay, so I don't want to couple us to Github..
:-)
 
I won't say absolutely no reason, but if you can't think of a reason to split it ;-)
 
So I guess I could call it a GithubEventNameTransformer
 
@Jimbo in that case, name the interface the generic concept (something like ChangeRequest) and then GithubChangeRequest is your concrete
@Jimbo or that
 
Thanks for helping me think that through
 
3:45 PM
really depends on what you're doing, but yeah, that's the idea
any time
I like that thought excercize (why would i need another implementation)
 
This is cool, now in my config file I have the name of the Github class that, in the future if we add a bitbucket class, you just change that one line in the config file and it'll use that instead (Y)
 
nice :-)
and by config file, you mean php file, right?
 
 
lol that was to be expected :P
 
Bad news everyone: PHPStorm 9 is a crock
i'm failing to get what was actually changed lol
 
3:52 PM
honestly, those sorts of config files I make as PHP bootstrap files:
 
@RonaldUlyssesSwanson For some people performance has been fixed for other it has been made worse
 
@ircmaxell hm, shall we remove that xor there? I see no reason why we should have it…
 
but they probably added support for Yii! yay! .... wait, nope.
 
function makeChaneRequestMapper() {
    return new GithubChangeRequestMapper();
}
 
@ircmaxell s/Those sort/Almost any sort
 
3:53 PM
@bwoebi it fuzzes the id. So it's not directly a memory address (which is likely a good thing)
 
@PeeHaa that's ok
 
@ircmaxell especially as you can easily get the random variable, by knowing that two consecutively created objects have consecutive ids…
 
I personally never understood the usefulness of custom formats in config files. It reminds me a bit of those templating engines people use
 
and you easily can get the relative offset by looking at the code …
 
@ircmaxell So a factory?
 
3:55 PM
@bwoebi that's fair
@bwoebi actually, that's a very good point
 
so, what's the point in the random at all?
 
@Jimbo right But a very simple one.
 
@PeeHaa i believe most of people uses stuff like twig, mustaches, because they don't want the front end designer to touch any php (...and break things)
 
@bwoebi precisely, go forth an remove it!
 
@RonaldUlyssesSwanson So instead people have to learn a whole new thing in which they can just as easily break stuff?
I mean. The syntax used by the engines often are even worse than just php
 
3:57 PM
@ircmaxell and at that point… any idea why the handlers pointer is there?
 
so I'm trying to enable the error_log attribute in php.ini file. But the problem is that my directories are equipped with 755 permissions instead of 777. Is there any risks changing permissions to 777 ?
 
@bwoebi This might be related, but Phil Sturgeon gave a talk yesterday on not using auto increment for that reason - easy to guess
 
@PeeHaa at least they wont be able to run "DELETE FROM allthethings"
 
@bwoebi to add fuzzing on object re-use. Actually, I would replace the handle pointer with the ce pointer...
 
@ircmaxell agree
 
3:58 PM
Well, the talk wasn't on that, but it was included. Funny story about someone who had delete endpoints available over GET - Google spider crawled the endpoints, deleted all the things :D
 
@RonaldUlyssesSwanson They won't be able to do that either way, because that is not something you do from a template be it vanilla or twig
 
@Jimbo if guessability of your IDs is a security issue, you've fucked something up in the design of your application
 
@Jimbo Unauthenticated delete endpoints FTW!
 
@PeeHaa "wont be able" or "wont do"?
 
wont be able
 
4:00 PM
you have no idea how many times i've seen new PDO; in a wordpress template @PeeHaa
 
anyone have a solution?
 
@Olli solution of what ?
 
to my question :)
 
@ircmaxell It was more along the lines that someone created an application to make money, it indexed a lot of stuff, but someone else wrote a script that just went through all the ids in the URL, scraped everything, then made a copy of the site and put them out of business. He suggested using unique ids for entities
 
(even in templates that they sell -__-)
 
4:01 PM
@RonaldUlyssesSwanson If a frontend dev goes that far and actually can create a db connection there is no reason for him/her to use twig in the first place
 
@Olli well if you give everyone read write and execute than surely there is risk
 
@Jimbo incrementing ids had nothing to do with that
 
@NullPoi ok... i just did a google search and come across to this simplemachines.org/community/index.php?topic=2987.0
do you think that's correct?
 
@PeeHaa you can't run php from within twig, this is my sole point
 
@ircmaxell Sure it does, it means that if you use those incremented IDs in the URL for your REST api, it's easy to script something to /$id++/ and yank everything from their site, right?
 
4:02 PM
if you have access to the twig directory which can't run .php files but only contains .tpl or whatever, you arent' allowed to do nasty stuff
 
And I am saying if dev X can setup a database connection there is no reason to use twig
Fix the dev who does that not introduce another syntax when the problem is the dev
 
or @NullPoi if there is any other solution, I'd be happy to hear that
:)
 
@Jimbo it's just as easy for someone to read the links to discover more content on the site (those links come from somewhere, right)
@Jimbo if that's a problem, that's a rate-limiting problem (and/or authentication)
 
@PeeHaa with dev you mean the frontend developer?
 
Yeah :)
The other dev is a grumpy old guy that cannot be fixed anymore :P
 
4:06 PM
does anyone else have solution to this?
@Peehaa for example
 
@Jimbo I'm not saying to always use incrementing ids nor that not using for that is a problem
 
what if it's two persons. the backend dev is a sensible person that writes decent php and doesn't want the frontend to write junk php in the template?
 
For example, private gist/pastebin. If it's predictable it's not going to be private. With enough entropy in the random you can keep links from being shown
 
@RonaldUlyssesSwanson Again. It is a people problem. Not a technology problem
 
@RonaldUlyssesSwanson jetbrains.com/phpstorm/whatsnew
 
4:08 PM
of course, people is always the problem
@Gordon i imagine developing such tools not being easy, but frankly these features are all smoke
 
@RonaldUlyssesSwanson the inline debugging is actually pretty neat
 
Clamato... I want to meet the first person to taste some tomato juice and think "You know what this needs? Fish". FlounderApple anyone?
 
Hey, no one really knows the answer here? :(
 
that's actually cool @Gordon but it's more cool than useful
 
4:19 PM
@Olli why not just read about what 777 means and you will know yourself :)
 
@RonaldUlyssesSwanson What scares me more is developing over ftp :)
 
@RonaldUlyssesSwanson the only people using FTP Upload are those still using Smarty
 
4:22 PM
@PeeHaa great minds think alike. Fools rarely differ...
 
:-)
 
i use ftp O_O :D i suck
 
@RonaldUlyssesSwanson Remote edit: I don't always test my code, but when I do ... I do it in production.
 
4:25 PM
lol!
 
lol
 
I found it funny that it was apparently one of their most requested features ... and one I will never use.
 
4:29 PM
@ircmaxell actually, the handlers pointer is not predictable … so, by removing the random here, we'd effectively leak the adress though, I think; which is a bad thing?
@ircmaxell I don't get that meme…
 
@bwoebi no, because two objects of the same type share the same handlers
 
@bwoebi Since apparently an empty string should be cast to an array... which I don't agree with.
 
so as long as there are different handlers, you can at least partially decode the pointer
@bwoebi that's the point
 
@ircmaxell but we leak in what address region we are.
 
@bwoebi and the object handle doesn't?
 
4:31 PM
@ircmaxell the handle is an incremental id?
 
it's a pointer
 
no.
it's an uint32_t
 
nevermind
 
yeah, see it now
honestly, I liked the way hhvm did that
 
4:34 PM
not sure what hhvm did
 
I think the thing that gets me most about that meme, is that you see Buzz explaining "I don't always test my code" to Woody, and you see Woody's "my god what am I getting myself into" look....
@bwoebi IIRC, just a random number generated on first hash of the object
 
you mean a random number seeded with the object pointer?
 
nevermind, they use the pointer: github.com/facebook/hhvm/blob/…
 
sketch logo for my "strict php" framework sketchtoy.com/65522254 (cc @PeeHaa)
nicknamed "Phel" (apparently it's a gaelic name, but stands for Php elephant)
 
@ircmaxell they use just the object id. hmm.
 
4:38 PM
@RonaldUlyssesSwanson you take your inspiration from LOTR I see
 
nope, never read or watched LOTR :P i tried to watch the movies, but i fell asleep
 
war elephants existed before lotr! :D
 
of course
 
@RonaldUlyssesSwanson WHAT
 
4:43 PM
@Jimbo same thing for harry potter or star wars :P
 
@RonaldUlyssesSwanson I'm feel so bad for you right now man, these are life changing things!
 
What did I miss? Who is doing PHP Mûmakils?
 
actually, i watched star wars, but i consider it the most overrated movie in history. i guess watching it at 23 changed things :P
 
@RonaldUlyssesSwanson ok, I'll give you this one chance to regain your geek cred by telling us that was all a joke
2
:-P
 
Any exceptions to the violation of LoD rule, if I'm passing in a Request object to pull out the ip address and check it? Is that 'dirty'?
Yes, I'm getting a lot done today :P
 
4:52 PM
no, because the Request Object is a value container
 
So effectively I'm using it as a value locator (like a service locator). It's okay, I just thought - I'll use an IPAddress value object
 
@ircmaxell it wasn't a joke, but i'm a huge star trek fan :D
i guess that's nerdy enough :D
 
@RonaldUlyssesSwanson I'm messing with you
/me is off. About to land. Catch ya all later
 
Catch you later :-)
 
4:53 PM
@SebastianBergmann I'd totally back a kickstarter project
 
@SebastianBergmann Woolly mammoth got $30k CAD o.O
 
@SebastianBergmann do you per chance know what exactly the dead code inspection option in phpunit coverage is needed for?
 
@Jimbo I backed that, too
 

« first day (1737 days earlier)      last day (3208 days later) »