« first day (1769 days earlier)      last day (3405 days later) » 

09:06
@Sherif how long did you play? Long enough to get the ability to make both blue and yellow portals or just few minutes?
@Ocramius so ... how're the new monitors holding up? i.imgur.com/8T1zv7k.png
Yes people! 1 and a half day to go and I will go @tereško for two weeks \o/
only two weeks?
Yeah... Two clients signed off on new projects, so I cannot slack too long
I'm happy with it either way. Cannot remember the last time I had 2 weeks
And I can finally work on my personal project
Anonymous
@PeeHaa whatcha doin?
@PeeHaa you will be just dicking around for two weeks and will open some code editor only on friday of the second week
09:13
@tereško Yeah that may happen. I hope not though
@Jay Every time somebody asks me that the plans for the project have grown bigger :P In short; a self hosted git platform / project communication / code quality thing (which will eventually also run on rpi's)
@tereško wish I was using them. Currently in the UK :-\
Because I'm a terrorist on the paperwork, and terrorists can only work on-location
Morning @HamZa
fuck bootstrap
lol
@tereško what's your alternative?
09:18
@tereško Dude. That's my only fucking option! :P
> Dropping support for IE8 means we can take advantage of the best parts of CSS without being held back with CSS hacks or fallbacks.
Heh
@HamZa alternative for what exactly? Mostly "education".
@HamZa foundation?
@tereško Ya, not long
I get bored rather easily in case you haven't noticed
@tereško alternative as in do you use any other front end framework?
09:20
@Sherif well, you got bored by the tutorial.
@PeeHaa I used skeleton for a simple project and quite liked it.
@HamZa no. I mostly assemble parts from microjs.com via jspm. And use SCSS.
@tereško interesting
Anonymous
@PeeHaa Communication / code quality thing? :P
@tereško Sounds like learning an arbitrary stream of new tools every time
09:24
@Sherif I do exactly the same as in PHP with composer.
@Jay Think: github + travis + scrutinizer in one project with ampchat integration
Surely there are a set of composer packages that you work and are comfortable with on a regular basis though. I doubt you just have something assemble a set of packages for you at random.
well, neither I pick random shit using jspm
Doesn't sound like a very smart idea; is what I'm saying.
new tools usually means new unfamiliar problems, which is never good, especially if you're starting a new project.
Anonymous
@PeeHaa Sounds awesome!
09:28
Sounds complex and best left for front end experts
@Sherif so, you are saying that we shouldn't use composer and instead stick with laravel ... is that your argument?
@tereško If that were my argument I would have made it. It certainly isn't.
@PeeHaa add appear.in integration for meetings :D
then I dont understand what you are talking about
how exactly using jspm-based packages is different from using composer-based packages?
@Jay Yeah I think it's a cool project :)
@Patrick Is it self hosted?
09:29
I was actually referring specifically to microjs.com
@PeeHaa Sadly not. Then find someone to code a clone... :P
There's nothing wrong with using a package manager. There is something wrong with having a tool create a hodgepodge list of packages for you, however.
@Sherif microjs is like thephpleague.com .. only it actually contains stuff and isn't shit. It's where you go for a quick lookup of possible recommendations.
@Patrick BTW I totally assume now you just volunteered ;-)
09:32
Doing something like that was actually on my todo list until I stumbled onto appear.in
It's good enough for me :)
Btw, still going to mysteryland?
@Patrick Yeah. That reminds me I still need to book a hotel
@tereško Never heard of that or used it before, but that still sounds equally bad. There's a difference between using something like composer to install a package you know you need and are, perhaps, familiar with and having some tool assemble a list of meritorious hodgepodge packages for you based on some highly generic criteria. That's all I'm saying. It might work for one-off throw-away project, perhaps, but probably not a good long-term approach in general.
do you know what jspm is?
have you hear of it before?
@PeeHaa me too. Who thought it was a smart idea to close the festival camping on sunday evening... ugh
Meh. I'm too spoiled for a camping either way :P
09:36
@Sherif it sounds like you are implying that I am a fucking retard, who just randomly pick set of 12 items from microjs and hopes it will work. Please stop that.
Although you will probably still find me there totally wasted :P
@tereško Not sure why you're so focused on jspm here. I have nothing against package managers. I was specifically referring to notion of grabbing a list of packages based on some generic need.
@tereško Wow, chillax. Nobody implied any such thing.
> I was specifically referring to notion of grabbing a list of packages based on some generic need.
this IS what you are saying
that I pick random shit just because it is there
I said nothing about what you do specifically. I merely stated that I think the approach of doing so is a bad idea. Whether you do it or not isn't relevant to what I said.
Why does everyone take everything so personally on the Internet?
heh
21 mins ago, by HamZa
@tereško what's your alternative?
09:40
@tereško sorry :P
The question was specifically about what I use, @Patrick.
and, for some stupid reason, you decided to fixate on a "highlight site", of which you had never heard before
> If you need IE8 support, keep using Bootstrap 3.
<3
@tereško wrong Patrick maybe? :D
sorry, wrong number
@tereško I'm not sure why you're taking such an offensive approach to this conversation, but it's probably not going to get any more constructive from here. I got the question and your answer to his question. I merely tried pointing out an observation that there is comfort in reusing a familiar tool by contrast. Nothing I'm saying is to be taken as an ultimatum of which is the superior route to take.
09:47
guys
vote: should we use get / post or request?
@Demorus it depends
I have been told $_REQUEST is better
lol
@Demorus Depends on whether or not you care about the request method.
better is a relative term
since it is an array that contains get, post and cookies
09:48
Which is retarded
@Demorus probably you should ignore advice from that person (the $_REQUEST superglobal is rarely a trustworthy option)
Even more so when yo realize the order may differ
@Demorus Which makes sense if you don't care about the request method used to send the data.
But it doesn't make any sense if you do.
So again, it depends on your intention.
Well I do like control. I replaced the post with request.
so I guess turning it back is better
$teresko do we even use request during development purposes together with get?
09:50
Again, better is a relative term. Think about what I just said and ask yourself "Do I care if the user sends this as POST or GET?" If the answer is yes, then you need to use $_POST or $_GET. If the answer is no, which it likely shouldn't be, then you can continue to use $_REQUEST.
@Demorus , please learn to ping people
setting cookie from a.example.com on www.example.com should work?
@Srle Depends on how to cookie is created
@sherif im thinking it might be a security concern if I dont explicitly call post or get
@Srle Only if you put .example.com in the cookie domain.
09:51
it is created like: domain: .example.com
@Demorus Not necessarily, no.
@Demorus Using $_REQUEST might become one
@PeeHaa so $_REQUEST is like the devil lol. Better prevent using it. Even more if it might become deprecated
I didn't say "the devil". My exact word was retarded ;)
It definitely won't be deprecated.
09:53
$PeeHaa haha ya
It's one of those typical php things which is just stupid
@Sherif we might get a different SAPI in php8
Besides, you don't stop using stuff until they become deprecated, not because there's a chance they might.
That's the entire point of deprecation.
$PeeHaa well there is a huge sea of information and it seems there are rarely up to date books or tutorials out there
@Demorus , please learn to ping people
09:54
@tereško Sure, but we might also get quantum computers before there is a php8. On the off chance that happens we should stop using PHP now?
-.-
@teresko sure thing. I keep using the dollar sign. Comes as a symptom from writing too much code
The logical thing to do is to stop using something that has been deprecated because there's a good chance it will be removed soon.
well .. the finished Duke Nukem Forever
Not, stop using things you believe may or may not be removed at whim.
09:55
@Sherif You stop using things because they are bad.
Bad things sometimes get deprecated.
@NikiC Sure, that too. It wasn't an exclusive OR ;)
Deprecated things sometimes get removed.
But the only part you should care about is the first.
Well, back to the BIG picture, there is nothing inherently bad about $_REQUEST when you know exactly what you're using it for.
You can say that about virtually anything
@Demorus I recommend a HTTP request / response abstraction that's already unit tested for edge cases and well-used in the open source community so you have good support too. Then you don't care about superglobals, you care about a Request and a Response.
09:57
It may be rare that you'll ever use it, but that's besides the point.
@Demorus the $_REQUEST is a problem, because it may introduce defects from sources beyond your control. On it's own it will not cause a vulnerability (just like on it's own, concatenating SQL queries do not always cause SQL injections), but it can become a compounding factor. What goes in $_REQUEST is governed by server's configuration. Which you usually won't have access to.
@Sherif Well for a user posting his login info so he can log in
If you know exactly what you're doing, everything has valid applications
That doesn't change the fact that, as a rule of thumb, you ought not use $_REQUEST
Just like you ought not use goto
@NikiC well I get this info a lot lately
While I do think that Nikita should change his name to $NikiC ... its @, not $ @Demorus
09:58
lol
"Any respectable PHP developer nowadays uses a decent framework, and there are many. It's pretty easy to discern who's legit and who's not by whether or not they use/understand these frameworks." hackernews turning into reddit? :(
Im really getting too used with the dollar sign and variables in php
@NikiC It's only a rule of thumb because you typically have an expectation of the request method in a RESTful world. I find it's better to explain that bit than to throw out blanket statements like "whoever told you to use $_REQUEST is an idiot". That person may have said so for a specific case where it was desirable.
Just sayin'
@Patrick it's because we understand them that we don't use them ...
@Patrick it has been this way for a year or so :(
10:00
@Sherif This has very little to do with REST for me
$Sherif well im testing right now. Its not a live site or anything. It makes testing easier as I use "get" and "request"
@Patrick What bell-end wrote that?
@NikiC How's that? Being RESTful implies that you are being explicit.
$_REQUEST implies that you are implicit.
REST has a lot more implications than HTTP
@Demorus , please learn to ping people
10:02
@Demorus Just as long as you understand that they aren't interchangeable. There is a variable request order, which means request gets overwritten by GPC. It is configurable, but you ought to know why you're using one and not the other.
@Sherif Because distinguishing between GET and POST parameters is something you do even without writing fancy REST APIs
@tereško jsfiddle.net/7mtsm94s do you see anything wrong here? 4 lines of code since im learning how to use prepared statements
@NikiC Not talking about fancy or APIs. When I say RESTful I actually just mean "the web", but I guess that's pretty lost in general context. But sure, it's rare that you don't care which to use :)
$Sherif I think on a live site I will definately go explicitly for get or post
@Demorus in general it is ok, but there is a style problem: you are mixing the procedural and object oriented API for MySQLi
10:04
@Demorus what kind of keyboard are you using? It's irritating (for me) to see the dollar sign used inappropriately.
@Sherif When writing websites (as opposed to APIs) I don't think that most people care about REST outside of making a GET/POST distinction
@teresko you are right. Now that I think back, only msqli with OOP supports prepared statements right?
@NikiC those people usually also thin that "RESTful" means "has pretty url"
@NikiC And you'd be right.
@Demorus both API version support the same set of features
10:05
18:45
@JaakKütt are you in north korea?
@teresko according to the manual only mysqli supports prepared statements
I would probably say that I almost never find a reason to use $_REQUEST, but that's my point. If you don't explicitly know why you're using $_REQUEST over $_POST/$_GET then you're probably doing it wrong.
I think that's what most people are trying to say anyway.
relevant:
19 hours ago, by rdlowrey
Yeah, I know what @Danack is doing there. The problem is that there are gray areas -- it's best to say "never pass an injector into anything" in the same way we make blanket statements like "never use goto" ... and these are valuable axioms. But there are times when wizards know what they're doing to and rules can be broken.
@Sherif I agree but it would make testing easier right?
10:07
@Demorus your statement was:
> Now that I think back, only msqli with OOP supports prepared statements right?
@Demorus Not sure why you think so. It could actually make testing harder. e.g. you get inconsistent bugs.
Because you're in the global space.
So state is affected.
That's definitely not the reason to chose $_REQUEST over $_POST/$_GET.
@Demorus there is ext/mysql (whcih is deprecated), then there is MySQLi (which has both procedural and object oriented API) and then there is PDO (with only an object oriented API)
so, what the hell are you talking about ?!
A valid reason would be that you are willing to accept the data in either method. Not that you want to test it in either method but plan to only respect POST or GET in production. That would be a bad test.
@teresko from a website "Fortunately, it is possible to use prepared statements with MySQL and PHP using MySQLi extension"
@FlorianMargaine was that a reference for "Sword of Truth"?
@Demorus from *WHAT website?
The website is Google?
pontikis
wikipedia
today everything makes me angry
Copying and pasting what @FlorianMargaine just put, read it
5 mins ago, by Florian Margaine
19 hours ago, by rdlowrey
Yeah, I know what @Danack is doing there. The problem is that there are gray areas -- it's best to say "never pass an injector into anything" in the same way we make blanket statements like "never use goto" ... and these are valuable axioms. But there are times when wizards know what they're doing to and rules can be broken.
10:12
please don't use wikipedia to learn php
@tereško nah, in Estonia :D (and honestly I do not remember writing "18:45" in this chat :|)
Don't try and be that 'senior guy' who talks about all the edge cases
@JaakKütt you mean that west-russia province? meh
@tereško close enough :D
@Jimbo Who are you talking to?
10:14
@Sherif You and everyone else
@Jimbo Ah, OK :)
@FlorianMargaine It's actually very sound advice.
Personally, I prefer to help teach people how to think rather than teach them what to think. It doesn't always come off as helpful, however. A lot of people just want the canned answer and be on their merry way.
Which I totally get.
Need help solving a problem with my php add to cart button
please do view this link given below for details about my query:
http://stackoverflow.com/q/32095942/4791856
http://stackoverflow.com/questions/32115561/how-to-use-image-magick-‌​in-codeigniter
@HardikSisodia Where are you making the comparison of color and size to the product? All I see is if($_SESSION['cart'][$id][$color][$size]) which merely checks that the variable is truthy.
Good night guys.
10:28
o/
You would have to actually compare the $color and $size from the database result set to the corresponding item in your $_SESSION.
\o
@PraveenKumar it's ok. Both answers are unneeded because OP needs to rather research what he is doing instead of being spoon fed by the community. The difference between both answers is that one is answered by somebody with 48k rep who should know better. — PeeHaa 2 mins ago
@PeeHaa Ah... Stop discriminating me with THAT part please! — Praveen Kumar 53 secs ago
Yeah that's discrimination...
@HardikSisodia Also, take a step into 2015. mysql was removed from PHP and has been deprecated for years. Please chose from one of the newer DB APIs and use prepared statements as your code is vulnerable to SQLi.
Anonymous
@PeeHaa Pure racism as far as I can tell.
10:32
:P
Every body with more than 30k rep is onyl allowed in the back of the bus!
Anonymous
xD
hello
@Sherif I am currently trying to get truly familiar with procedural coding before I start to code in OOP, even though I know the basics of the latter. Anyways, what I noticed in PHP in general is that variables outside a function are not automatically global like in javascript.
This means that I need to add the same variable with the keyword "global" in every new function I create if I want to access it. Is there no better, non repetitive way? I know there is the : defined() way or writing variables. Would that make it truly global?
@Demorus Yes, pass the variable to the function.
@Sherif I have edited my question please do have a look now it is still not working.
http://stackoverflow.com/q/32095942/4791856
10:36
Globals are bad.
mmmmkay
@Sherif I am in an apprenticeship and I have been told its ok
@HardikSisodia Still not working is not a useful metric to help you debug your problem. What errors are you getting? What is it doing that you didn't expect it to do?
Yeah it's still not okay -_-
@Demorus You were lied to
10:38
Ok then what about defined()?
Whoever is telling you that it's OK is basically telling you it's OK to pick up bad habits now that you will likely find very difficult to get rid of in the future. Which likely means htey are in the habit of picking up bad habits.
@Demorus Depends on what you use it for
I read somewhere that "defined" is global
Not someone you want to take advice from.
defined is for constants. Why are we talking about constants when your question is about variables?
@Sherif After I added a comparison it adds one particular product only once doesn't add +1 quantity if added again and apart from this it doesn't add any other size too of the same product
10:40
@NikiC well basically when I do procedural work I wrap everything in functions. In order to access certain global keywords such as my mysqli connection I need to put my connection variable inside every function
@HardikSisodia Try inspecting the $_SESSION by using var_dump()
See what's going on.
Code review fail
@Sherif Well basically I have a variable which stores my mysqli database connection. It needs to be global though
10:41
@NikiC HAH!
+ use of debugger fail ...
I remember that happened at a certain company once that shall remain nameless and it went out into production.
@Demorus Does it?
@Demorus In that case you should pass the connection to all functions that use it
I posit that it can be passed in to the local scope all the same.
@NikiC here is the problematic part. In order to do so I need to add the variable that stores my connection inside every present and future function with the "global" keyword
unless I maybe treat it as a constant and put it inside defined()
10:43
@Demorus You should pass it as an argument. And only pass it if the function actually needs it
Whether or not it needs to be global is solely predicated upon the fact that the global scope is the caller.
Having to pass it around as an argument will also help you to isolate the places that actually need the connection and those that don't (because you'll be too lazy to pass it everywhere)
@NikiC I already passed it in places like mysqli_stmt_prepare($connection, SELECT.....) inside my function. So now you say, instead of creating globals I just do myfunction($connection)
yep!
10:46
@NikiC so there is no actual way to say: ok php I want that variable to be used for all future functions I create
nope
@Demorus It's called dependency injection.
@Sherif eh
Not the "make this global everywhere" bit. The "how you do it correctly" bit.
@Sherif I see. You guys sure seem to have a lot of experience
10:50
posted on August 20, 2015 by kelunik

- Fix bug preventing UvReactor::tick() from returning when no events are ready for a single active IO watcher.

Think of it like using global is basically the function asking "where is the database" and you handing the function the database object as the caller telling the function "here is the database you should use". That way in the event you decide to change the variable name, or hand one function a different database object over another (e.g. unit testing with a mock), you don't run into a wall.
posted on August 20, 2015 by kelunik

- Fix PHP7 issue in which top-level Throwables weren't caught in certain coroutine contexts. - Remove error suppression operater on optionally null option assignment to avoid spurious E_NOTICE output when custom error handlers are used.

posted on August 20, 2015 by kelunik

- Fix issue in NativeReactor capable of causing keep alive counter corruption when a watcher was cancelled inside its own callback. - Fix issue in UvReactor with libuv >= 1.1.0 causing busy loop with immediates present, but no watchers bein...

Er, you're allowed to fix more than one thing per release @kelunik...
Anonymous
@PeeHaa Do you feel bad yet? stackoverflow.com/questions/32115662/…
Anonymous
:P
10:52
ow wait, that's just the announcements that are bunched up.
@Danack I actually just added the release notes to all those tags, oops.
@Danack Interesting, that didn't ping me.
@Sherif makes sense. There is a sea of missinformation so its nice to read infos from such knowledgeablen individuals as yourself.
@Feeds @kelunik why is that posted by you? … oh release notes added.
maybe it's the dots - I usually leave a space...
bleah, I'm not knowledgeable. I'm an idiot.
You should read my book "The ramblings of an idiot"
10:53
@bwoebi Because adding release notes seems to add it as actual release, stupid GitHub.
Do anybody of you use PHPStorm? Just had windows 10 craching.. Now I boot up again and I see that the content of file is missing.. Just an ampty file.. I was working on that file with PHPStorm before the crash.. Do PHPstorm has some history to get the last file fersion from?
I dont know, I can just say what your level of knowledge conveys to me since I am novice.
version*
windows 10 loves privacy
@Paulius blog.jetbrains.com/idea/2008/01/… I suspect it won't work though, and you'll need to get the file from source control again.
10:55
by the way, is it worth it getting into learning how salt encryption works? Should I even worry to learn security mechanisms when learning how to code logins and stuff like that?
I have version of the file in the git, but finding latest version in the PHPStorm would save me few hours of work..
@Danack Thanks for the link. Reading it now.
@Demorus learn how it works but don't implement it yourself. Use php.net/manual/en/ref.password.php instead
You need to understand all the attack vectors so that you can secure your site against them. This is a good starting point owasp.org/index.php/Top_10_2013-Top_10

« first day (1769 days earlier)      last day (3405 days later) »