« first day (1498 days earlier)      last day (3440 days later) » 
00:00 - 23:0023:00 - 00:00

12:00 AM
thnx @peeHaa
 
np
 
@AndreaFaulds you have way too much free time :P
 
ha! I've found it
I had this edit form with this multiple selection
and I wanted to show what has been already selected.
the answer was that I had to specifically get the object containing what I wanted, convert it into some sort of an array with the corresponding values of 'id' and 'name' as key and value (accordingly) and then refer to it in my blade page
now I can finally go to sleep
 
@ChrisBaker Have the manager of whoever warned them last time. Just keep walking the chain.
 
12:15 AM
@FlorianMargaine I don't have too much free time. I just procrastinate from more important things.
 
ok .. Breaker is one of (if not, "the") best mangas in this decade
also, it's 2AM ... I should be sleeping
 
go sleep ^^
 
@DaveRandom yup, for the good of all tab completers :)
 
@AndreaFaulds try reading it (if you read mangas)
 
12:20 AM
It's... Korean?
 
yeah
 
>martial arts
ehhhhhhhh
 
it's good
 
bugs.php.net/bug.php?id=68475 … I didn't know until now that cuf[a]() accepts "classname::methodname" callables
 
12:44 AM
Mathematics is so much simpler if you just use IEEE754 for everything.
For example, you can easily solve the coastline paradox by simply defining the length of any coastline to be Infinity
Division by zero is simple, that's Infinity
@bwoebi Allowing "classname::methodname" would be pretty cool
 
@AndreaFaulds agree... Then I'd like call_user_func("$this::methodName"); to work too :-D
 
@bwoebi ogodwat
 
no more ugly array syntax :-D
 
Also, I figured out how to do function referencing today!
 
so…?
 
12:48 AM
The problem was syntax. But I realised there's a reserved word I hadn't thought of using before: T_CALLABLE
How does callable($this->foo) or callable(strlen) or callable(Foo::Bar) sound? :D
 
callable($this->foo) … property foo or method foo?
 
@bwoebi Method.
Since you can easily reference properties already with $this->foo, right?
 
@AndreaFaulds obviously…
@AndreaFaulds Actually sounds good
 
@bwoebi It's far better than & because there's no ambiguity. It's not a shift/reduce conflict like function. And it's far better than what Hack has (pseudo-functions, yuck)
 
@AndreaFaulds like I thought… people on internals aren't happy with having both functions (#safecastingrfc)
 
12:54 AM
@bwoebi Yeah :/
 
@AndreaFaulds And I'm neither. I could live with it… I'm ±0 on it. If there just was try_int, I'd +1.
 
Oh, so that's why no AST somehow...
I looked at phpng on lxr, not PHP_TRUNK :/
 
lol
always look at the dates^^
 
 
1 hour later…
2:20 AM
@AndreaFaulds This is very C++ like ^^
 
@LeviMorrison Ew.
How to change my mind on a proposal:
1) Describe it as C++-like
@LeviMorrison How about C-like?
 
@AndreaFaulds No, it's not C-like.
Actually, it might be; it just wouldn't be common.
 
@LeviMorrison It would use & but sadly it can't
 
Yeah, curse references!
 
C function pointers are a good feature, though.
 
2:29 AM
@AndreaFaulds Verified; it is not C like.
 
@LeviMorrison This is C-like:
foo = &bar;
 
Yeah but references :/
 
Or even:
#define callable(x) (&(x))
foo = callable(bar);
It is now officially C-like :p
 
:)
I still don't know about how you resolve the property vs method conflict though.
Unless you just have special rules inside of callable().
 
@LeviMorrison Er, because why would you use this to reference a property?
Basically, callable(<foo>) would reference whatever <foo>() does.
If someone wants a mechanism to convert callables (strings and arrays) to closures, we could just add a constructor to Closure ^^
 
3:08 AM
@AndreaFaulds So you just have special rules inside of callable() ^^
 
3:57 AM
Hello everyone! I have one thing I would like to do, but I'm not sure what approach should I use
I play Tibia, and you can travel by boat in it. The problem is that, to get from one city to another city, you often have to make connections, because there are no direct routes
I want to develop a script that tells the cheapest routes when user select From and To fields
compare tridimensional arrays?
that's the approach I thought =p
right path, somehow? I still have no clue what I'm going to do with this..
$destinations = array(
  array(
		origin => "Ankrahmun",
		destiny1 => "Ab'Dendriel", price1 = "", message1 = "",
		destiny2 => "Ankrahmun", price2 = "", message2 = "",
		destiny3 => "Carlin", price3 = "80", message3 = "",
		destiny4 => "Darashia", price4 = "", message4 = "",
		destiny5 => "Edron", price5 = "70", message5 = "",
		destiny6 => "Liberty Bay", price6 = "", message6 = "",
		destiny7 => "Port Hope", price7 = "", message7 = "",
		destiny8 => "Roshamuul", price8 = "", message8 = "",
		destiny9 => "Oramond", price9 = "", message9 = "",
if price is null, the route doesn't exist
curiously there's a whole wikipedia page destinated to this type of issue: en.wikipedia.org/wiki/Shortest_path_problem
 
 
1 hour later…
5:29 AM
0
Q: How to get name from twitter id with php

Savan PaunI want to get my all follower's list, i uses OAuth. my code is here. by this code i get alll id list with comma like [51] => 378176058 [52] => 565040748 [53] how to get all followr's name with twitter profile link :( <?php require_once('tmhOAuth.php'); require_once('tmhUtilities.php'); $p...

i want to get all profile link or name but how ?
 
 
1 hour later…
6:35 AM
@tereško do you still need an invite to google inbox?
 
7:29 AM
TIL. alarm clocks dont set themselves
 
@tereško IT'S ALREADY MORNING?!
omg O_O it is
 
8:12 AM
@tereško ?
 
 
1 hour later…
9:38 AM
Morning
 
10:18 AM
Please help me configure CakePHP 2.5.5 via TeamViewer.
My Computer ID: 201 337 277
My password: 7800

* I am using Ubuntu 14.10, PHP, MySQL, phpMyAdmain, Apache 2.4
* I put my sites at: /var/www/cakephp-2.5.5
* I insert these line to /etc/apache2/apache2.conf :
<VirtualHost *:80>
DocumentRoot "/var/www/html/cakephp-2.5.5/"
ServerName cake.dev
<Directory "/var/www/html/cakephp-2.5.5/">
Options Indexes FollowSymLinks Includes ExecCGI
Options FollowSymLinks
AllowOverride all
</Directory>
</VirtualHost>
update password: 654321
 
10:54 AM
@SergeyTelshevsky yeah, would be nice to get one
 
Mornings
 
@tereško give me your email then, please
@RonniSkansing good morning
 
martins dot teresko on gmail
 
tnx
 
10:57 AM
3 invitations left if anyone needs them
 
11:17 AM
Good for the phone
 
@rdlowrey github.com/nikic/FastRoute/issues/25 => Looks like the method of matching the route first and checking allowed methods afterwards doesn't really work. Wondering if there's a good way to fix this (in particular if the "allowed methods" list that's provided for not allowed methods needs to be kept)
 
How long do your wisdom teeth usually ache for when coming through? :-/ Google doesn't have many resources to tell you. One said 7-14 days
 
12:22 PM
Is it possible to flag a edit as rep farming?
 
@NikiC I'm wondering if you could eventually put all the routes together, but just in different order depending on the method to be matched?
Means different regexes for each method. That way we eventually could maintain the current speed and fix the issue?
Means e.g. for a GET request: first the GET routes, then the HEAD routes and then the other routes (which are then assigned a method not matched answer)
 
Or add the method to the regex?
 
that doesn't work particularly well with HEAD route fallbacks.
(If you don't want to do two preg_match()es)
 
user1804599
PHP <3
 
@Danack In that case you will not be able to determine the allowed methods
@bwoebi Seems rather wasteful to have all the data for every method
 
12:36 PM
@NikiC well, it's cached anyway?
 
sure, just thinking about the amount of data itself
 
@NikiC well, that's the price to pay. But at least in Aerys it won't make any real difference as it's a compiled regex in memory then. Also for everything else, kernel likely caches that file in memory too.
@NikiC Also, that way we're able to put the routes to expect in front of the regex which possibly makes the regex matching faster.
 
@NikiC you would if you added it as a capturing group to the regex -i.e. adding (HEAD|GET) to the regex and add the method to the start of the URI that is being matched.
 
12:51 PM
hmm
 
Morning
 
Mrnings @PeeHaa - did renewing your certificate fix your SSL thingy?
 
I didn't add my new certificate yet. I broke my mailserver when trying to upgrade :P
 
Guys what routing lib do you recommend?
 
12:59 PM
@BenBeri nikic/FastRoute ... or embedded into a microframework: rdlowrey/Arya
 
aight ty
 
1:18 PM
@bwoebi In any case, I'm not sure I understand what this gives us over checking the method first - reordering the routes won't help with the case where it doesn't match, right? You won't be able to get the allowed methods.
 
@NikiC ehm, how do you currently get the allowed methods?
 
@bwoebi I currently only consider the first matched route (which has a list of methods it supports). But that isn't correct of course ^^
 
@NikiC well, you can still use that mechanism. The ordering just guarantees now that when you first match an invalid route, there's no valid route at all.
… and if it isn't an invalid route it's definitely a valid route.
 
yes. your suggestion makes sure that we match the correct route and detects if there is no route - only the "method not allowed" case is problematic
An advantage to checking the method first is that you may have to match fewer routes (in the "a route exists") case.
 
@NikiC well, you can then still append the invalid routes. But then they're matched last.
 
1:24 PM
For a trailing slash in nikic's FastRoute, I need to implement a regex to make it work right? Or is there a method in the lib to do so? - To make urls work with / ending and without
 
@BenBeri Doesn't it do that automagically?
 
$r->addRoute('GET',  '/user/{name}', 'GET with default placeholder pattern');
$r->addRoute('POST', '/user/{name:[a-z]+}', 'POST with custom placeholder pattern');

# method POST regex should be like ~(?:/user/([a-z]+)|/user/([^/]+))~
@NikiC and if the GET route is matched, your list of methods just contains GET and you can determine that it's invalid method.
 
@BenBeri if you want to support a trailing slash, you can do something like /user/{name:[a-z]+/?} instead of just /user/{name:[a-z]+} (or whatever constraint you want to use)
 
@NikiC Ok thanks
 
@NikiC but that then adds the slash to the name match too and we'd have to manually strip it away…
 
1:32 PM
@bwoebi Oh right, not thinking over here
@BenBeri Forget what I said, you should just remove the trailing slash before matching the route
So like rtrim($url, '/') for example
 
ah good idea, thanks
 
that will handle it for all routes as well, a lot more handy ^^
@bwoebi That's right. But in that case you will only know that you have a GET route that would work but has a different method. You don't know if there might be other methods that would match it as well
 
@NikiC is that important?
allowed-methods header or what?
 
@bwoebi Dunno, it's just functionality it currently provides. Probably for Allow header
 
@NikiC because there's just a CORS Access-Control-Allow-Methods header
 
1:38 PM
NOTE: The HTTP specification requires that a 405 Method Not Allowed response include the Allow: header to detail available methods for the requested resource.
 
oh ok
 
it's what it says in the FastRoute readme, no idea if it's true :D
 
> The origin server MUST generate an
Allow header field in a 405 response containing a list of the target
resource's currently supported methods.
from spec… so yea
 
yeah, just found it as well
 
well, in that case you have no choice but match them all, I think?
instead of just first route
 
1:42 PM
I can only ever determine the first route of a batch though. Which is why the approach of checking the method first appeals to me. Then I can a) check if there's a valid route considering only the relevant methods and if not b) find all allowed methods by checking if a route exists for other methods (and there we only need to know that a route exists, so it's okay that only the first is matched)
 
preg_match_all doesn't work here?
 
nope
preg match all gives you different occurrences of the same regex in a string. Here I'd need more like the reverse ^^
 
@NikiC I'm not sure… but that still means you need to match against every set of methods if it fails?
 
@bwoebi yes
 
1:55 PM
@NikiC then you also could use @Danack approach because then the regex will be reused (faster?).
 
Hello @BastianHofmann
 
2:32 PM
@DamienOvereem phallusphp.github.io
 
3:04 PM
lol
 
hmm .. this trailer kinda made me want to play EVE: youtube.com/watch?v=AdfFnTt2UT0
 
Yeah, saw it on reddit, looks awesome
 
3:24 PM
@salathe What's that?!
 
Any idea how to get solely folders of where the source is located on? e.g /forums/new/ I tried REQUEST_URI, but that includes if I add myurl.com/forums/new/blalbabla
 
3:43 PM
@BenBeri DOCUMENT_ROOT
> 'DOCUMENT_ROOT': The document root directory under which the current script is executing, as defined in the server's configuration file.
 
@BenBeri Huh? REQUEST_URI shouldn't include the host name
 
I think REQUEST_URI should be directly usable unless you are in a subdirectory on the domain (in which case you need to remove the prefix)
 
@NikiC Yes I know, but I didn't talk about including the host name, ignore that. Let's say my source main index.php file is located at /forums/lol/real/ and my request was /forums/lol/real/category/funny - I need to know that my source is located at directory /forums/lol/real/ without getting the input after it (/category/funny)
 
Usually you'd have that path set in a configuration option for your application or something, everything else sucks a bit
That said dirname($_SERVER['SCRIPT_FILENAME']) is probably what you want
but that's a little fragile
 
3:52 PM
@bwoebi I was bored…
 
So the best thing is just let the user set the directory path in installation?
 
@BenBeri It's the least error prone and potentially most efficient way, certainly
 
Aight ill just do that, thanks
 
@salathe entry point script is presumably 8===D.php?
 
4:18 PM
lol
 
4:44 PM
3:7
welp
 
Andrea just got a step closer to ragequitting PHP.
 
ahahaha
Mail.app thinks Lester Caine's email is spam
@bwoebi I wanna get bigints done first :p
If they get voted against, I ragequit
 
@AndreaFaulds well, they might well pass :-)
then I finally could represent unsigned 64 bit bit integers as integer in PHP…
 
@bwoebi Or indeed, any number of bits :)
(help appreciated wink wink nudge nudge cough)
 
5:00 PM
nobody likes writing tests…
 
Yeah :/
 
Writing tests is always harder than the whole implementation. And only because it's soooo boring.
 
dammit python
 
@NikiC ?
@bwoebi Writing tests is easy, only time-consuming.
 
@AndreaFaulds time-consuming isn't a problem. Boring is.
 
5:12 PM
@bwoebi Yes, it's tedious.
 
@AndreaFaulds well, python is not PHP, that's the issue.
 
@bwoebi :p
 
@AndreaFaulds dammit interpreted languages, really. it's very annoying if you have a long-running computation - and then get an exception because you made a typo in the code dumping the result
 
ok I have finally fixed my mailserver, now to start fixing my ssl stuff
 
@NikiC yep
@NikiC or rather, damnit dynamic languages
 
5:16 PM
we need numrust.
so we can ditch numpy and use a real language
 
numpy for Rust?
aha
@NikiC I only ever used numpy because Python lacks proper arrays :p
Er, space-efficient ones anyway.
 
@AndreaFaulds I'm solving some linear equations with coefficient matrixes having a few billion elements :/
 
5:54 PM
Hello
Hows everyone doing?
 
6:15 PM
0
Q: Laravel : Should ALL the classes be injected through constructor?

Kamran AhmedI just read Taylor otwell's article Don't use Facades stating that you should try to avoid Facades. Also, he stated that you should try to inject the classes through the constructor. Now I was wondering, would it be a good idea to inject each and every class that I am using in my controller throu...

 
6:42 PM
3:8
fuck
Damnit @salathe :p
 
Sorry! *blushes*
 
@KamranAhmed always use dependency injection, otherwise someone else (or you in 6 months) looking at the code will have to dig through many files just to find out the dependencies
 
Do you know why you should inject objects instead of using Laravel's facades? — Florian Margaine 2 mins ago
it seems he just read the article and blindly applied the principle...
 
hi is it possible to have a multidimensional array as a parameter in a function, and have default values in that array?
 
6:48 PM
@KamranAhmed Also if possible, avoid extending framework classes like BaseController. Just use plain old php classes whenever possible. Though this is more important in the domain model.
@JacobRaccuia no. but you can have a default array in your class (?) and then merge that with the injected array
 
oooooo thats genius!
@Patrick thanks :)
 
Hey @Patrick thanks. Especially for that link :-)
 
@KamranAhmed If you want to learn more about why you should do those things, this is a good list
 
@KamranAhmed the short answer to your question is yes (getting rid of the static calls)
 
well , the main thing to take away from all this is: Laravel leads to bad practices
 
7:02 PM
@RonniSkansing actually according to http://stackoverflow.com/questions/19193532/laravel-4-facade-vs-di-when-to-use these are not static calls
`This is the PHP syntax for a static methods, but Laravel changes the game and make them non-static behind the scenes, giving you a beautiful, enjoyable and testable way of writing your applications.`
 
@KamranAhmed lol
The cake is a lie
 
@KamranAhmed yea, that is not true. It is still a static call =]
 
Well it seems like one but it's not. #GoingToStickWithIt :3
 
@KamranAhmed What does that mean?
 
@KamranAhmed same was as codeigniter and cakephp users insist that their framework is the literal embodiment of best programming
 
7:14 PM
@RonniSkansing I just tried to look under the hood. Laravel provides View::make(). According to you, it's a static call right? But if you check Illuminate\Support\Facades\View class, there is a single method getFacadeAccessor(). I then checked the Facade class that it extends, and look what I found there __callStatic() magic method that does all the magic i.e. instantiation and stuff.
 
@KamranAhmed I did not quite understand what you said. Coudl you point me to the exact code on github so I do not have to google. While doing that. Consider
"The Scope Resolution Operator (also called Paamayim Nekudotayim) or in simpler terms, the double colon, is a token that allows access to static, constant, and overridden properties or methods of a class."
and "__callStatic() is triggered when invoking inaccessible methods in a static context."
And yes, I consider View::make() to be a static call
btw. "and look what I found there __callStatic()" sounds pretty much like Call Static does it not?
 
7:40 PM
@RonniSkansing have you ever argued with a religious fanatic about evolution ?
 
yes =/
 
@RonniSkansing Something like View::make() does not necessarily have to be a static call, it can also be a scoped instance call on $this. However in Laravels case that is most certainly not the case. There it is obviously a static call.
Also I don't think I have ever seen anyone use scoped instance calls with an explicit class name.
 
you really expect 'em to know difference between :: and -> ?
 
No, of course not.
 
@NikiC =] yea, I see.
@tereško somehow.. yes.. I would.. or I did..
 
8:36 PM
@BenjaminGruenbaum That's not PHP?
 
8:48 PM
I should just quit PHP. Shouldn't I.
 
mb wrong window
 
retarded time is retarded :/
 
9:12 PM
@AndreaFaulds no!
 
9:26 PM
@AndreaFaulds thing is .. what should you choose instead ?
python ?
 
@tereško Good question. I'm not sure, really.
Maybe I'd make a new dynamic language with the best bits of the languages I've used, or something.
 
especially if there is the added condition of "you have to be able to pay bills with it"
 
Yeah, but programming is my hobby... and probably will remain that way for the next 4 years or so.
 
then my recommendation is: erlang
but if you are in a position like me, then the options are: php, c#, java and c++ (those are the ones you can get paid for in LV)
... it's not really even a fair contest
 
9:33 PM
.. oh , technically I also should have added object-c to the list
 
Maybe Swift, now?
 
I know nothing about it
an noone will be using it for year or two
 
@tereško It's a quite nice new language from Apple
That's true
 
good lord I love it when phpstorm is showing me wrong errors -.-.
 
fuck phpstorm
 
9:47 PM
well, right now it fucks with me
 
@Dennis Yeah....I like PHPStorm....but the developers don't seem too concerned about those type of issues.
 
Well after my initial feedback (a long time ago after my testing period) I received a email quite quickly. They where asking about it but in the end you just get the usual crap "not reproducible bug"
*were
 
o/
I'm having some odd curl issues
Trying to use curl to login to a site. Works perfectly when I run it from the command line
But when I try the same thing through php, I get a login error
Any ideas?
 
10:05 PM
@Dennis well, just ignore them…
 
@RaghavSood So you get a response from the host? Or do you get some other errors?
 
I get a response, but the page doesn't login. It tells me there was an auth error
The server connection all works out fine. I think some of the cookie data or headers are getting lost along the way
 
OS? Linux?
 
OpenShift
So RedHat linux
I've made curl requests from this server in the past that worked perfectly
It's just something about logging into a Moodle install that kills things
 
Can you compare the two requests? Console and PHP, just to make sure both send the same data?
 
10:16 PM
All the data seems to be there in both :/
 
oO that's odd.
 
Here's the php function: pastebin.com/LvuBsZQG
And the command line command: pastebin.com/p0CHd2Zx
Everything's the same, as far as I can tell
Here's the ouput from curlinfo: pastebin.com/4ivgajp9
 
hard-coding the session cookie in there is going to lead to hella problems later
you need to configure a cookie jar and let the login page create a real session for you
 
I was going to alter that to get the page for a new cookie everytime it runs later on, once I had it logging in at least
 
CURL can handle all that for you: see php.net/curl_setopt CURLOPT_COOKIEJAR and CURLOPT_COOKIEFILE
 
10:25 PM
So I just set those and remove the cookie header?
 
i believe so
 
My apologies for sounding completely clueless. It's been some 6 years since I worked with PHP
 
let the moodle send your script shiny new cookies just like it would to a browser
eh, PHP's easy; CURL, on the other hand, is PITA :P
emulating logins is often extra-hard because good software has security provisions to stop you hijacking someone else's session
 
I got lucky there
This is my high school's website
 
well, i'm going to have to wish you good $daypart and good luck
happy hacking :)
 
10:32 PM
Thank you!
IMSoP's suggestion doesn't seem to have changed anything
 
reading up on Magento for job... pissing me off >=( !
 
00:00 - 23:0023:00 - 00:00

« first day (1498 days earlier)      last day (3440 days later) »