« first day (1014 days earlier)      last day (4159 days later) » 

20:00
I found it specially useful for newbies as they can learn about the Edit, up/down vote, what a right answer is or means
Even thought not always they mark the right one but just the first that solves their problem.
@Prix yep, guess you are right (that's what I found on meta). I will have to stop flagging those then!
LOL ;P
But I might not be the only one to do it as almost every time they are deleted :)
Have you guys came across any worth reading questions about production development ? more towards about what you should do when developing for production deploying
@cheesemacfly well given the reason you select I found it fair some people may consider it for deletion however I don't think it worth doing in some cases
if every user by default took the tour we would have in my opinion at least less 50% unformatted text, code and questions that makes no sense.
92
A: What is clearfix?

Madara UchihaIt's worth noting that today, the use floated elements for layout is getting more and more discouraged with the use of better alternatives. display: inline-block - Better Flexbox - Best (but limited browser support) Flexbox is supported from Firefox 18, Chrome 21, Opera 12.10, and Internet Ex...

8 moar :P
20:08
I sometimes wonder how you achieve such high scores…
my best was 11…
@bwoebi Being the first result when googling "clearfix" helps.
It's really about answering the right question, at the right time.
You'll get there too, I was thinking exactly the same as you :P
@bwoebi Answer with short, correct answers first, then add comultive edits to improve the answer over time.
See the revision history for stackoverflow.com/a/17877660/871050
@MadaraUchiha yep… that's what I do, but it doesn't help
@bwoebi You'll get there :)
I'm making a web app that interacts with the database a lot. In my layer that deals with back-end functionality (i.e., creates stuff in database, processes commands, makes decisions, validates stuff, etc... basically it does anything that doesn't return info to the template, display the template, or communicate info between user), I'm wondering how I should deal with a database abstraction layer. Do I just pass a pdo handler, or should I create a DB class that all my other classes use?
I don't want to get there in only a few years :o
20:14
Like my DB class would have actions like addUserToGame($gameid, $userid) which would then, in the DB class, go through the sql commands and gadgets/whatnot. Or do I just put the sql commands and gadgets/whatnot within my joinGame() function?
example:
	function join($gameID) {
		if($db->gameIsOpen($gameID)) {
			$db->addUserToGame($gameID, $this->user);
		}
	}
^ Do I do that or just use the db abstraction layer straight in the join() method?
How can I query the Google directly using AJAX ? I mean, its post request has so many parameters. I am confused. :(
Evening all
actually most of parameters in google's search query are completely pointless
m59
m59
browser updates will cause the $_SERVER user agent not to match, right?
the user agent string will change after each update
20:21
Yes.
What what parameter can be neglected ?
https://www.google.com/search?q=test , AFAIK, you definitely need only one parameter
In what format will it return results ? and where ?
@Jeremy , it seems your classes suffer from SRP violations.
with ajax? I think you'll fail because of Same-Origin-Policy maybe? (don't know if google has cors…)
@tereško I tried not to... what'd I do this time (sigh)?
20:25
@silverflash have you finished reading : developers.google.com/web-search/docs
No. I never knew Google provided a search API.
If I am not wrong, we can make a search engine using it that will work with Google in background. Right ?
hey, how to convert "29 Nov 2007" into "2007-11-29" using preg_replace?
preg_repl… crying
@Jeremy well .. i have not seen whole code , but it looks like your $db instance is both aware of games, managing the players in said games and also storing them
m59
m59
I get the impression that ip banning is useless.
What to do if I know someone is trying to fake cookies to login?
20:29
but as i said, all I have seen is single short method .. I might be misinterpreting
m59
m59
Oh cool. I was just about to contact Liam Neeson..
@tereško lol n/m. I know that article. That's the system I use.
Just leave it at that?
If they got the cookie once, won't they just keep getting it?
That system has a built in prevention for faking the cookies
you might have missed that part while reading
m59
m59
No, I have that.
@NokImchen Save kittens, use DateTime
m59
m59
I don't mean fake, I mean steal.
20:32
Evening @all
@DaveRandom Good evening
you cannot detect that the cookie has been stolen
you can detect that t has already been used
m59
m59
ohhhh
nm, I confused myself.
You're right, it's the faking attempts that we know for sure.
m59
m59
when a cookie is hijacked, you can only make a guess at which was the victim and which the hijacker.
20:34
@DaveRandom i didnt get u, my prob is: i want to convert ('mps','27 Nov 2007','192.34') ,('mps','28 Nov 2007','178.97') to ('mps','2007-27-11','192.34') ,('mps','2007-11-28','178.97')
yes , and you ask both to enter password
@tereško This is actually what I was worried about. How would I deal with the database? Do I just use it through an abstraction layer like PDO, or do I create a separate class do deal with the DB?
@NokImchen Ahh OK, you should say that in the first place then ;-)
@DaveRandom m sorry, my communication prob..
@Jeremy you might benefit from exploring data mapper pattern
it's in the PoEAA book
20:36
You need to write a regex that matches you date format, then use preg_replace_callback() to pass the matches to a function, which will use DateTime::createFromFormat() to create a datetime object and then DateTime::format() to convert it to the format you want
well .. just read the whole thing. I get the impression that you have clue enough to understand PoEAA
@tereško Is that everything in here: martinfowler.com/eaaCatalog
@DaveRandom ah, so much procedures will make the code slows, as there are approx 179000 matches
@Jeremy those are just tiny excerpts and definitions.
20:38
For example this in the book takes up whole chapter.
also , if you need it fast, you can get it on torrents
@NokImchen And what, you're expecting to do 179000 replacements quickly? Ain't gonna happen I'm afraid. If speed matters I suggest you're doing it in the wrong place.
Is there a open source meta search engine based on Google ?
m59
m59
@teresko it says that if you don't find that user/identifier combo, ignore it, which makes sense because of the DoS thing... but they could just keep guessing for eternity then. Does that mean we're just counting on them giving up before they get a valid combo?
@tereško okay, thanks
@DaveRandom oh, i dont knw what to do, yes speed matters a lot, please wait, i'll show u the link
20:40
@tereško This looks like the whole thing, right?
@NokImchen If speed matters that suggest you are trying to do this while a page is loading. So what you should do is do it once (when you acquire the data) and then page loads are simple case of serving it up
@Jimbo Definitely not.
@Jimbo no
Instant replies - I take it that was a bad Q?
For the exact same reason that Nginx doesn't do it
user895378
20:41
:10873916 No -- if you want .htaccess put it on an apache server and reverse proxy to it.
@DaveRandom this a one of 100 sample link, i want to replace the date into a format that i can save in mysql table moneycontrol.com/tech_charts/bse/his/sbi.csv
@rdlowrey Okay, cheers :)
@Jimbo .htaccess-style config overrides are a HUGE performance killer
@Jeremy looks that way ... though this one has messed up "Bookmarks" section for that PDF
Like, it's not even funny how bad it is
20:42
I know that it has to search for the .htaccess files on every request
@NokImchen Right, so if you're saving it in a MySQL table, why does speed matter? You only have to do it once, then it's done.
@DaveRandom i can take care of Day and Year, but the prob is with month, dont knw how to convert "Jan" into "01, "Feb" in "02" and so on
@DaveRandom ah, the data changes every single day, and there are 1000s of such data.
@Jimbo Yeh not only that, but it has to search the whole way up the directory tree, which means stat()ing all the way up the tree back to docroot for every request
@m59 , I don't recall the whole article , so my naming might be off .. basically you have one-time identity key, that you used to log in. When you use it you receive key for next login and (maybe) authorized-session key. The old ID key might or might not be stored. Each key is bound to a user and at any time there exist several valid "next login" keys.
stat() is actually a lot more expensive than you might think, which is exactly why PHP caches it
@NokImchen So? It's still only a few seconds...
20:44
@tereško alright, thanks. this looks like the actual book. I'll read it
@m59 each "login key" are tied to a series
m59
m59
@tereško yes, I'm VERY familiar with the system. I have it all implemented and stuff. I just don't feel comfortable allowing people to freely attempt fake cookies that I know are fake (tokens are presented that aren't in the database)
@DaveRandom only few seconds? oh, den il'll give it a shot :) thank u so much :) i'll code and let u knw :)
if user tries to fake a cookie , it will not be in any of the series
you can detect that it is a fake
m59
m59
it would be impossible for someone to have a series identifier that is invalid.
right
but it doesn't seem like there's any way I can respond to it.
I kind of just have to let them keep trying and hope they never guess a good pair (which they probably won't).
20:47
you could lock out the IP for an hour after 5 bad attempts
and notify the user whose account was under attack
m59
m59
Can someone get around the ip thing pretty easily?
that lock of IP can be either a complete block , or only deny creation of new series
m59
m59
I guess it would be like .000000000001 of anyone ever guessing the right combo.
because if they get the right series but wrong token, the series is just going to change.
you need to guess the exact UID (or name) and exact key
it is easier to guess username and password
also , since user has not authenticated with real credentials, he/she would be using limited access account
you should never let people, who authenticated with cookie, to change account passwords, access private information, spend money or perform any destructive actions
Where can I get programmers online to get my work done. I don't have time to post projects and wait for bids .... I want to do it fast
20:53
elance.com ? (that's only one I can remember from top of my head, because I have account there)
elance and freelancer are like dead places
@silverflash Outsource it to india
not sure then
@Jimbo By speed post ?? lol
@silverflash Nah, speed GET
20:55
@Jimbo I want programmers urgent not cheap programmers.
@NokImchen I'd expect the network activity (transferring the data to your server in the first place) to be the bottleneck there, not the replace operation. I could be wrong but doubt it.
@silverflash maybe this: freelanceswitch.com
though , i have never used it
@DaveRandom hey, i got a trick to use STR_TO_DATE(myDate, '%m/%d/%Y')
@DaveRandom but is still not working, but i knw it will work soon :P
@DaveRandom i don tknw y this is not working SELECT STR_TO_DATE('12 Jan 2001', '%b %d %Y')
... and now I will get a bowl of ice cream and gonna put on some hand-gathered blueberries
@DaveRandom it worked!!!! this is the trick STR_TO_DATE('12 Jan 2001', '%d %b %Y')
21:00
@NokImchen debatable whether that will be any faster than doing it in PHP but whatever works for you :-)
like I say, I really doubt speed is actually an issue here
Can any one recommend a web developer to me ?? I need something done very urgently.
@DaveRandom not sure :|
@DaveRandom its still not working :| i'll work more in it and let u knw , ya, speed is necessary but if i can finish its job within 3 seconds, den i'm happy :)
we have few developers here
@tereško we have developers here?
@DaveRandom heheh, m so happy, finally it worked, i dint see the speed yet, cos i'm downloading 76 such csv files using multi_curl and they converting the dates using STR_TO_DATE mysql function. Overall, it takes like 10 seconds. Probably, its b'cos of multi_curl.
21:04
few .. as i said
@tereško Can we chat in private ?
m a developer too :P
not me , i'm on sabbatical
Ok, who is free for work now ?
hmm ... maybe we need to make a "jobs board" for this chat room
m59
m59
21:07
What is the best falsey check in php?
! doesn't work if the var isn't set.
@tereško Yes. Where we can hire developers fast
m59
m59
if (!isset($foo) || !$foo)
that ^?
@m59 isset()
m59
m59
I'm asking falsey....not set.
falsey dernit, lol.
no such thing in php?
21:10
empty() means "is falsey and suppress error if not set"
m59
m59
Ahhhh, good.
So use that rather than !
what is the point of the ! then?
it's just a suck version of empty, lol.
! means "not"
if you aren't sure whether the variable is set, but in general the only place that should ever be true is array members, and even most of the time you should know what your array contains
m59
m59
right, but in js "not" means falsey
It means the exact same thing in PHP
m59
m59
21:12
but not set is falsey
maybe that's the real difference then?
@m59 it's because in JS a parameter that has not been defined has value undefined
undefined is falsey in JS
m59
m59
but in php it just throws an error because it is literally nothing?
It's literally nothing in JS as well, and it will throw errors in JS as well
In any case ! doesn't mean "falsey" it means "the opposite"
(!false) === true
m59
m59
yes, I get that.
21:14
so, basically, you are just bitching
m59
m59
In js, I could have a var I never used anywhere and say if (!thatVar) { //
?
I am?
Somebody needs to learn how to use strict mode.
m59
m59
I'm just trying to learn, lol
Ahh, so it ought to throw an error you mean.
I see.
Just don't use variables without declaring them in the lowest possible scope (in any language)
m59
m59
I don't, but I know what works and what doesn't.
21:15
"If IE is supposed to be inferior to Firefox, what is going wrong?" (from stackoverflow.com/questions/17891110/…) … mh. had to laugh :-D
m59
m59
I didn't realize it was different in strict.
I take that back, I do, but in the case I'm using now...so I guess I should ask then -
In general you don't want use !thatVar to test whether it's defined anyway, you should compare directly with the undefined
m59
m59
I'm adding properties to an array if they are needed. Am I supposed to declare the properties beforehand even if they aren't going to be used?
Depends what kind of array
If you use named keys (assoc array) then yes (IMO)
If it's a proper array then don't worry about it
Dat feel of staying late to finish report that boss is itching for and waving to boss as she leaves before giving report and don't realize what happened until she gone. Dat feel.
m59
m59
21:18
Well, in my circumstance, it's dealing with post data
json_decode(file_get_contents('php://input'));
then you at first so array_key_exists()
@Bracketworks E_GHETTO_SPEAK
m59
m59
object, actually
my bad
I misspoke
@DaveRandom Er. More like E_4CHAN_SPEAK.JPG
Sorta.
@m59 well , you can parse json in an associative array .. that's what second parameter is for in json_decode()
21:19
That's not a defence. That's even worse.
@tereško It's worth doing as well, PHP is kind clumsy with JSON IMO
m59
m59
Either way, I'm later in the code where I have checked the cookie and if that didn't get them logged in, now I want to see if this is a username/pw submission, so I was doing:

if (empty($this->input->user) || empty($this->input->pw)) {

    }
There we go.
looks like bad API
m59
m59
:(
Well tell me how to make it better, lol.
you should have the input abstracted
m59
m59
I'm not sure what you mean.
In my mind, that's what I did when I pulled it into $this->input. I could change it out later or set it based on the type they sent (post and stuff)
I guess that's not what you mean.
21:26
Abstract all the things!
where does the $this->input come from ?
m59
m59
my class's constructor
it's a base class that the login one derives from. All of the child classes need input data and I wanted to be able to change without messing up anything else, so I did it there.
I was thinking of having a function that returned it instead,
not sure.
then I'd have to pass it around all my functions which would kind of suck.
Splargleduffle.
Goodnight folks, have a lovely weekend.
21:43
please don't tell me that you extract data from php://input in the constructor
if 1158 == 70% then 1158 * 1.3 == 100% ?
m59
m59
I did just tell you that. So, it would be better in a function?
@UchihaObito Does 70 * 1.3 = 100?
m59
m59
@UchihaObito almost
(here's a hint: it doesn't)
21:45
@DaveRandom only in Texas
how do i know how much is 100% ?
i suck at math
pls help me
m59
m59
the obvious is the other way around?
php should handle application/json as an encoding type and populate $_POST
@m59 if I were implementing something like that, I would be collecting the user input in some Request class, which then I might inject into something that deals with authentications
Uchiha Obito 1158 / 70 * 100
m59
m59
21:47
@tereško a whole class for what is currently (and likely always going to be) one line of code?
@PaulBailey thx
@UchihaObito If n = x % of t, then n / x = 1% of t, therfore n / x * 100 = t
stupid markdown
m59
m59
Couldn't I just extract it when I see some need? I'd only have to change one line of code..so it's not hurting me in anyway to change it later.
do as you like
m59
m59
21:49
I'm willing to do whatever. I just don't know what you have in mind. I can't really write code that I don't know what it's for, lol.
I'm gonna make some tea and watch Polaris' live
m59
m59
Cool, thanks for the tips.
@m59 the idea is to for Request to abstract all the user input
@tereško Stars don't do much "live"
I wish they did
m59
m59
but...it's just one line of code.
21:50
I wanna see a supernova
that include $_GET, $_POST and the post-without-proper-encoding
There are a couple of candidates in our general area of the galaxy that are likely to go any moment (in astronomical terms), could be a couple of million years yet though :-(
m59
m59
Right, I could, but I don't think I'm going to need it.
I might add it later.
@DaveRandom i'm talking about this
@DaveRandom and technically, it's quite possible that they have already "gone"
21:56
wikipedia not liking the hotlinking?
There it is
I love that image, it's awesome
I particularly like how you can "see" the pulsar in the middle
also , on related note .. something strange that hit me today:
for a thing to experience time , it needs a mass
does that mean that time is something that mass causes .. same way as gravity ?
I think the generally accepted view is that it is energy that "causes" time (so kind of)
The only way to measure the passage of time is by the transfer of energy
That concept is at the core of chaos theory
i thought space caused time
definitely not
22:03
Actually @tereško I guess that's only true if you subscribe to the heat death view of the end of the universe (which I personally do)
@DaveRandom sounds true!
But in, say, the big crunch scenario it's much more centered around what the mass is doing
At the risk of getting everyone confused and being unable to back up my words: "does that mean that time is something that mass causes ."
i) There is not so thing as time, or space, there is only space-time. Everything is moving through this at constant velocity. The faster you are moving through a space dimension the slower you are moving through time, and at the speed of light, all of your velocity in the space-time continuum is through space, and your velocity through time is zero.
ii) Objects without rest mass pretty always travel at the speed of light, so yes for them 'time' does not e
> The dominating point of view among physicists is that it (time) does not progress at all. Instead, the progress an illusion caused by the fact that entropy increases with time.
doesn't cause time, but only objects with rest mass perceive time.
22:07
@Danack actually that makes sense
Which makes the fact that neutrinoes oscillate between their flavours (en.wikipedia.org/wiki/Neutrino_oscillation) means they must have rest mass.
For the record - when I say something dumb about programming, it's because I did Chemistry and Molecular Physics at Uni, so this is my backup career ;)
> Time is an illusion. Lunchtime doubly so. -Douglas Adams
@Danack all of your velocity in the space-time continuum is through space, and your velocity through time is zero. - if that were true the speed of light would be neither finite nor measurably infinite.
To you it would be.
But to an outside observer, no.
So what's c then?
The c Is A Lie!
22:13
c is a constant.... if you are moving faster through space time slows down to keep it so :)
@Danack physics was my fallback solution for if i did not get in computer studies
@Danack and that was proven recently
iirc
Yes - from the observation of the oscillation, I think.
@DaveRandom it actually explains the time dilation that moving things experience
You know I noticed one more thing. While I was reading the article that I mentioned the other day about the billionaires, in it, there was an interview from him in which he said that it took him only a week to make Facebook. He has to be one heck of a programmer. Makes us all (or at least me) look like beginners in web development area.
Anonymous
22:19
php scammed me
yes, I'm just getting sometimes tired of saying that one should use ext/mysqli or PDO… — bwoebi 55 secs ago
makes me a bit sad… why do these tutorials with ext/mysql persist… :'-(
@bwoebi Why sad? It's friday!
@Danack in my timezone it's already saturday
Even betteR?
no, why? (00:22 here)
22:23
Saturday = lie in day.
huh?
Saturday is even better than Friday as you can sleep in on saturday morning?
@Danack I can sleep the whole week: school holidays :-)
Same - unemployed FTW!
haha xD
22:27
1 message moved to Trash can where it belongs
@LeviMorrison thank you :-)
and now move the trash can message moving notices to the trash can :-D
Anonymous
:(
@TheGuyWhoCouldn'tTalkToTheGirl It was much simpler back then and more error prone.
@bwoebi You can't, I do believe.
22:30
@LeviMorrison But you would think that given all the tools available today, it'd be much simpler now.
No - it's working as designed. Moving stuff to trash and then covering up who moved stuff to trash could potentially lead to massive drama. It works fine now.
Anonymous
@Christian hi
Hi, just wanted to have a look
@LeviMorrison I suggested you should do that :o
You I can't*
Anonymous
22:34
@Christian go ahead. its free. dont worry
@LeviMorrison oh, okay…
@Sim
@Simon_eQ have a good night...
Anonymous
thanks
im torn on a design issue. go with a Products, table that stores more or less all information, including price, title, description, status, stock level, image url, everything... or. going with a Products table that stores the product id and title, and having a seperate table called ProductsMeta that stores any, all or none of those things against the product id allowing different types of products at any point by changing only the view
Hello. Does anyone know how to solve my problem in FPDF? stackoverflow.com/questions/17892072/…
22:46
@LeviMorrison Neither can I, not even the one you edited. It doesn't give an error, just nothing happens
@tereško I don't know, I think it's a bit of a cop-out explanation. If that were true then c would not have a finite value.
23:01
Helo?
Anonymous
hello
@Jack I don't see how your answer is any different than mine?
@BenjaminGruenbaum Hi. Can you help me? stackoverflow.com/questions/5454969/…
@banana That's not your question is it?
23:13
@BenjaminGruenbaum It's mine. I just have to show my codes. May you help me?
@banana Sure, I've only got a couple of hours though it's 50$ an hour, is paypal good?
@BenjaminGruenbaum I'm sorry, don't have money. Thought it's free in here.
@BenjaminGruenbaum I don't have the time to learn PDO as I have to pass my code for minutes now.
@banana I'm not telling you what to do. I'm telling you what you are doing is bad, and you should consider not doing it (If PDO seems complicated to you, mysqli_ is a lot closer to mysql_). You can take that advice or leave it, it's completely your own choice to make based on considerations some of whom I'm not aware of.
23:24
@BenjaminGruenbaum Okay.
I liked the old sql tho
@Jono Will you help me? please
no problem
what you trying to do
@Jono Thank you. I'm trying to output an array infpdf. Have a look at my code. stackoverflow.com/questions/5454969/…
Ive never worked with fpdf but have you tried using html strings
23:29
not yet. I think it's just in my query that is something wrong.
does it generate a pdf
Yes, it does. And it only outputs 1 entry I don't know how to store in an array. And output it.
@Jono And I need to output 5 entries.
require('fpdf/fpdf.php'); send me that file
@Jono It's a class. I don't know how to send it here.
lol it converts the whole php to pdf
23:35
@Jono Precisely. I really think it's in my query. I just don't know how.
rebuild a project one line at a time
then play with the arrays
@Jono Already tried that, it's a failure.
Im just going to try the library and a sample gove me a sec
Start by making the indentation sane, then find out what array_shift() actually does
@Jono It's okay. I can wait. :)
23:39
And consider that you cannot add things to something in a loop unless it exists before the loop
Oh, and also whoever told you that every if requires an else even if it's empty is wrong, it's a really messy coding style
But it's actually not a million miles away from what you want
@DaveRandom I'm sorry I'm a newbie. :) Thanks.
<?php
require('fpdf.php');

$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>
try this sample so long
Although I'm guessing that if you just keep adding Cells you'll end up with everything in one long row, you'll probably need to add some rows and add the cells to the rows. I'm actually not too familiar with the inner working of FPDF (or PDF in general) so I'm not certain about that, but it stands to reason if what you want is a table
na what i think whats happening is it converts the php file to a pdf wiping the code
you dont specify an output file
Sql injections aside why do these people not care about what kind of data goes in thier database.
23:46
Oh it's based on a cursor position
PDF is a really weird format, but I guess I just don't think like a printer
Anonymous
@Orangepill I wander about that too
Ok as a suggestion I see what you trying to do use a separate class for the mysql stuff

Then pull it to the pdf

class
Anonymous
On a side note, is it a bad idea to create methods that handle objection in OOP?
Banana you still there bro
@simon_eq objection = exception ?
Anonymous
23:57
@Orangepill Lol sorry. I meant Object. Its too late here. I just had a giant class, that makes a pile of codes, when instantiated. I thought maybe, I could handle some part of the object structure inside a the class itself....

« first day (1014 days earlier)      last day (4159 days later) »