« first day (1507 days earlier)      last day (3423 days later) » 

9:08 PM
:-)
 
Hmm - tough choice in the pub just now. Do I want a burger for £11 or do I want a burger and a pint for £10.
 
a burger for 11 pounds o_O
Why so expensive...
 
it's not...
@Danack a burger and a pint for 13
 
It's a decent non mass produced burger.
 
Why does composer generate such an ugly name for the autoloader. Example: ComposerAutoloaderInit9a37eed01fa9079e40f1cc7ad0c2498d
 
9:14 PM
@ziGi seems like md5 at the end...
 
exactly
I was just wondering why the class name has some md5 at the end
 
9:32 PM
@ziGi to ensure it's unique?
 
I suspected that, but why?
 
one guess: to not collide with another composer autoloaders you might have
 
hehe, good guess from me
@FlorianMargaine how exactly did you find it?
 
I'm good
 
9:38 PM
you are )
cannot think of efficient way of doing that right in github
locally it would be blame, but online...
 
oh, there is a blame button
@FlorianMargaine tell the truth how you did that
 
I googled "composer autoload md5"
 
:-S
 
so I had the commit hash
just went on the right url on github
 
gitgossip.com <-- interesting
 
@FlorianMargaine I don't see in github.com/nikic/FastRoute/tree/master/src any simpleDispatcher
the code that Patrick suggests
 
@ziGi uh... why are you pinging me?
 
sorry, because I know you recommend the tutorial a lot
so I thought you might take a look if you have time
 
cool, I'm #335 all time on stack overflow for rep, and #317 all time on github for follows.
 
9:43 PM
pretty cool
 
@ircmaxell it's nice to be you
 
#335 on SO with 80k rep?
I thought it'd be more...
 
did you expect higher
 
9:44 PM
@FlorianMargaine the more rep points - the faster it grows
111k and #204
 
heh... let me see where dystroy is
114
not bad
 
I have seen some people use current to get the first element of an array over [0] is it in a way a better coding stiyle?
 
10 rep away from an even 80k... /me hunts for a question to answer
 
meh, be ready to screenshot, will upvote some answer
there we go
 
@ziGi it's for php < 5.4 (in case an array is returned by an expression)
 
9:49 PM
yay!
 
f5 again
:-D
 
ZEND_API void zend_bigint_long_subtract(zend_bigint *out, zend_long op1, const zend_bigint *op2) /* {{{ */
{
        /* b - a is just -(a - b) */
        zend_bigint_subtract_long(out, op2, op1);
        mp_neg(&out->mp, &out->mp);
}
I feel prouder of that than I ought to ^^
 
is it?
is (b - a) always the same as - (a - b)
 
In this context, yes.
 
should be
 
9:51 PM
if they are numbers
 
In normal C arithmetic, not necessarily.
 
@zerkms +0 and -0 are technically different while both are still numbers, so :-P
 
@ircmaxell they are different in IEEE 754
 
@ircmaxell nit +0. -0.
 
(a - b) is (+a -b), (b - a) is (-a +b), -(+a -b) is (-a +b)
 
9:52 PM
@NikiC I was speaking in math terms, not programming terms. but yes, with floats, yes
 
@NikiC What if one's complement :p
 
@ircmaxell In math terms +0 and -0 are usually not different ^^
 
and in math it's only when you deal with limits, not arithmetics
 
+EPSILON and -EPSILON? :p
 
@NikiC usually, sure. but sometimes, especially in statistics, there may be
 
9:55 PM
@NikiC I am currently using your FastRoute and I was wondering about something. Why is simpleDispatcher a function in the functions file but not a method in a class?
 
@AndreaFaulds aren't zend_bigint_long_subtract and zend_bigint_subtract_long confusing?
 
@zerkms I don't think they are. The API has a consistent pattern
Bigint parameters are implicit. Non-bigint parameters are explicit.
 
@AndreaFaulds okay. I'm not familiar with it but on first glance it would be consistent if the order of types in name matched order of arguments
 
@ircmaxell where is this used in statistics?
 
zend_bigint_ is a prefix
zend_bigint_add is (bigint, bigint), zend_bigint_long_add is (long, bigint), zend_bigint_add_long is (bigint, long), zend_bigint_long_add_long is (long, long)
 
9:57 PM
@NikiC at this point, I'm just going off of en.wikipedia.org/wiki/Signed_zero#Scientific_uses
 
ah, statistical mechanics, not statistics
 
yeah, read it too quickly :-P
 
-0 for a value that was rounded to zero is what floats do :D
 
user3949359
I'm in my localhost PHPMyAdmin and I cannot find the auto_increment option, even in "operations". Where should I look for it?
 
@nosille what do you want to do?
 
user3949359
10:06 PM
@zerkms Just enable the AUTO_INCREMENT so that every time I insert a value, it gets incremented.
 
23
A: Auto increment in phpmyadmin

AmitKBThere is steps to make auto incriment for a column. I guess the phpMyAdmin version is 3.5.5 but not sure. Click on Table > Structure tab > Under Action click on Change on the ppoup window scroll left and check A_I. Also make sure you have selected None for Default

@nosille would this link be helpful?
 
user3949359
@zerkms Yet to find out. Thank you
 
Btw, it's a first result for "phpmyadmin set auto increment" in google
 
user3949359
@zerkms The reason I'm bothering chat members here is because localhost phpmyadmin is not the same (or at least mine) as the ones on remotes.
 
user3949359
mine doesn't look like the one in the link
 
10:13 PM
your is newer/older presumably
 
user3949359
yes
 
@JoeWatkins call phil :P
 
What are we calling him?
 
Ugh, there is one thing that is bothering me with the Auryn injector that PHPStorm is complaining that it can't find the methods of the objects. Is there a way to remedy this?
 
probably with annotations... dunno
 
10:28 PM
I can't typecast to the type
 
@ziGi can you show a screenshot?
 
@var type $variable ?
/** @var \Http\HttpRequest $request */
 
is it possible if they are outside of a class?
yeah
 
Yep, it's a hint for a variable
 
10:32 PM
yes, it works
thank you
 
@ziGi out of curiocity: why doesn't your dispatch() method accept a request+response instead?
and why it returns a "route info" :-S
 
well actually it is dispatched that way
well this is just the no-framework tutorial
that Patrick has created
I am just testing it out
 
it looks strange
 
zerkms looks abit like the default example of FastRoute (github.com/nikic/FastRoute)
 
well the injector calls the class with request+response
public function __construct(Request $request, Response $response) {
    $this->request = $request;
    $this->response = $response;
}
I am not sure how to use the dispatcher almost at all
I just saw the example
 
10:36 PM
This implementation looks strange because then you cannot implement an application specific 404
 
ok, go one step back please
what do you mean by returns a "route info"
which line?
 
49
I would expect some router class to route a request
 
well
 
it's router that accepts a request and splits it into parts or reports it's not possible to do so (4xx)
 
well in Routes.php there are routes in the form of an array
so as oyu can see the simpleDispatcher gets all the routes
on line 45
but you are right
the routes are kind of static right now
return [
    ['GET', '/', ['Zii\Controllers\Homepage', 'show']],
];
basically that is what is added as a route on line 45
I am opened to suggestions how to make it better
Since I am a noob with it
 
11:00 PM
I'm not sure why people want more static method/class features in PHP.
Can anyone explain this to me?
 
@zerkms What's an "application specific 404"?
 
yeah
that too
@LeviMorrison for example?
 
@ziGi marc.info/?t=141744244600004&r=1&w=2 (start at bottom of the list)
 
@LeviMorrison Because a lot of PHP developers think that static is the holy grail of "object-oriented" programming.
 
@LeviMorrison because functions suck, so they turn to statics
it's an x/y problem
make functions autoload, and a lot of that will disappear
 
11:02 PM
@NikiC github.com/TazeTSchnitzel/php-src/blob/bigint-libtommath/Zend/… <-- this is what I was moaning about earlier ^^
 
why don't we just return to functional PHP with file inclusion without namespacing
it is so much easier
 
I think programmers in general reach for "object-oriented" programming too quickly, but in PHP people seem to especially rely on it because of autoloading.
 
@AndreaFaulds eek
 
Autoloading is some kind of excuse to not properly design dependencies and loading them.
 
@NikiC yep
 
11:04 PM
@LeviMorrison yet never really get to OO, they land on class-oriented
 
I'll be honest: most PHP apps or websites I have seen regurgitate database information.
 
@LeviMorrison haha in what sense
 
I can see using object oriented programming for accessing the data via a gateway, but aside from that? Not really.
 
My idea of an API result: return $statement->fetchAll(PDO::FETCH_ASSOC); ;)
 
@LeviMorrison I'm debating writing a mini post about a comment someone made for MVC
 
11:06 PM
@AndreaFaulds Better than some poorly over-engineered piece of code.
^^
 
@LeviMorrison Possibly.
 
@ziGi
// instead of
$className = $routeInfo[1][0];
$method = $routeInfo[1][1];
$vars = $routeInfo[2];
// you can write
list(, list($className, $method), $vars) = $routeInfo;
 
@LeviMorrison s/PHP apps or websites/applications in general/
 
@NikiC good point
 
Using interfaces for data boundaries like a database access is good… but sadly ORM seems popular.
 
I like using list() for things like that, imho clearer than assigning all vars individually
 
you are right
 
Ideally, your business logic should be in stored procedures. I never learned how to use those, though.
 
> For some applications, that IS enough. Any other parts of the application can be squeezed in without too much cognitive dissonance. If all you're doing is CRUD on blogs and an index page, then you're fine.
 
Btw why did you make the simpleDispatcher a function in the functions file instead of a class?
 
11:08 PM
@AndreaFaulds Ugh, you make me sick.
 
@AndreaFaulds procedures in PHP?
 
^^ That's true. However, if that's all you're doing, why the hell are you writing it from scratch (even using a framework) instead of using something like Wordpress or Drupal
 
@LeviMorrison Is it really such a bad idea? :p
 
No, it's not really that bad :P
 
@ircmaxell I'd wager a combination of reinventing the wheel is fun, and I don't want to buy a car when I just need a wheel.
 
11:09 PM
@DanLugg in both cases, if you're a professional, then you're not doing your job if you're making decisions based on "fun". And if you think you only need a wheel, you're likely lying to yourself.
 
@AndreaFaulds It's bad though; here's a start for reading if you are interested: blog.codinghorror.com/who-needs-stored-procedures-anyways
 
@ziGi It didn't seem to benefit from having a class wrapper.
 
@ircmaxell Well, the second point is fair. The first I can't agree with, you have to have some fun.
Professional or not. I don't want to drag my ass through a WP config if time isn't of the essence, and I know that it's going to bring much more (probably problems) to the table than I actually have requirements for.
 
@DanLugg not when it costs a company tens or hundreds of thousands of dollars in development costs
 
@ircmaxell No, that's a different story, but tens of thousands of dollars and railsey-blog don't really match up either.
 
11:12 PM
@ircmaxell I would bookmark it, but experience tells me you'll publish before I get around to reading it ^^
 
@LeviMorrison this one is going to take a while
I'm no where near done, and no where near happy with it. I may split it into 3 or 4 posts (or turn it into a book)
 
@ircmaxell A volume of a series :-)
 
@NikiC is METHOD_NOT_ALLOWED used when the user doesn't have access?
 
Anyone know a good english translation of the odyssey? And by "good" I mean that the author doesn't do too much archaic english + poetry masturbation.
 
OR is it more the fact that if you define a route with a GET then if someone makes a POST it would return 405?
 
11:15 PM
@NikiC Is this for personal enjoyment or University stuff?
 
@LeviMorrison Fair enough.
 
@ziGi yep, that's it
 
@NikiC oh, woot. I didn't know that one can nest list() statements…
 
k
 
@bwoebi You can?
 
11:16 PM
@LeviMorrison Personal. Figured it should be read.
 
list(list($a, $b), $c) = [[1, 2], 3]
 
@DanLugg In Nikitas example at least…
 
@NikiC Then I'll send an email to someone I know who should definitely know the answer to that ^^
 
> archaic english + poetry masturbation
^^ eloquently profane.
 
Cloud Atlas springs to mind when I think of that kind of wording.
 
11:18 PM
I've yet to see that, actually. And have been meaning to.
 
I needed a dictionary to read that book.
 
See/read, apparently. Does the movie do the book justice?
 
I tried watching it too, but I struggled to pay attention.
 
What is the most appropriate thing to do if a user doesn't have access to some resource. For example he can see posts that are only created by him so if he makes a GET request for an id that is not his what should be the result? Redirection or 403 Forbidden?
 
@bwoebi Whoa. I am disappoint.
 
11:20 PM
@NikiC it's something frendlier than 404 - Page not found text on a blank page
 
TIL, though, I'd still be happier with [$a] = [1]
 
list(list($a, $b), $c) = [[1, 2], 3]; --- php meets haskell
 
@NikiC there's just a tiny example in the manual… nothing more which indicates that this works…
 
so?
 
11:22 PM
so no wonder I didn't know that.
 
Is there any overwhelming reason to no support [] as a syntactic alias for list()?
 
@NikiC You could just watch O Brother, Where Art Thou?
Basically same story, but with george clooney.
 
@Danack That, is a good movie.
 
@Danack seen it ^^
 
> We're in a tight spot!
 
11:24 PM
Real tight spot!
 
> Well, I suppose this place is just a geographical anomaly, huh? Two weeks away from everywhere.
Possible paraphrase, haven't seen in awhile
 
how do you peeps deal with the access control?
any recommendations for a good plugin
 
@ziGi I tell my users to play nice.
 
any good RBACs?
haha
yes, behave!
 
Or don't, so they don't feel inclined to misbehave.
 
11:28 PM
@LeviMorrison Thanks :)
 
^^ No problem.
 
night
 
enjoy
thanks for the info
 
this is a short one
(also that goes for others)
 
Languages wherein the variables (not the values pointed to) are typed are: strong/static?
I suppose, arguably both?
 
11:40 PM
strong typing == types don't change
strict typing == types are declared/required everywhere
 
So, strong would be the correct answer here, as the variable's type cannot change.
strict == static? No...
 
@ircmaxell First half looks good; on a phone call
Can't finish atm.
 
cool
 
@ircmaxell Does this sound right?
> This is contrary to strongly typed languages, wherein typically the variable is locked to a type, regardless of whether the value is a null reference.
^^ With regard to PHP's value-oriented-types vs variable-oriented-types.
 
I would avoid statements like that
because every language's type system is slightly different
 
11:44 PM
Fair enough, I'm just trying to exemplify the situation that a variable assigned null in PHP will fail an instanceof check, whereas in some other languages (as I understand now, strongly typed ones typically) an "instanceof" check will pass whether it's a null ref or not.
 
@ircmaxell just a question. I don't use a CMS, because it's boring. I don't want to only have customizing the CSS. So, yes, I really should use a CMS, I fully agree. But I still rather invent the wheel because it's fun. I think it's not about choosing the best tool, but about assigning the right dev type to the right task…
 
values are typed, not variables. Null is the lack of a type
 
@ircmaxell I guess that's pretty succinct.
Thanks :-)
 
@bwoebi as long as you're not charging someone else (in a professional context), then there's absolutely nothing wrong with that.
 
@ircmaxell I think I do it a bit wrong still. It's wasted time for more interesting things.
 
11:48 PM
well, but as long as you either 1) have fun, 2) learn 3) both, then awesome
 
There are things which are more fun and I can learn more by doing them…
 
well then ;-)
 
I really absolutely hate boring things, so I rather make them a bit more interesting and waste a lot of time instead of doing the boring thing quickly and do the really interesting things then.
That's my problem…
 
@bwoebi Task automation :-P
 
I'm out, laterz
 
11:51 PM
Later @ircmaxell
 
@DanLugg It's not as bad, but that pretty much resumes it.
 
^^ Much better. I relate because bureaucracy 9 to 5.
 
@ircmaxell hm, no^^
 
@ircmaxell I know you're afk, but I was asking about typing because stackoverflow.com/a/8091175/409279, I was tacking on the end.
 

« first day (1507 days earlier)      last day (3423 days later) »