« first day (714 days earlier)      last day (4220 days later) » 

6:04 PM
Sup dawgs
 
jo DavyDave!
 
Howz it hangin y'all?
 
@DaveRandom Nutting much yo know.
 
Well, I've just spend basically the whole day in hospital sitting around. You know it's nothing serious when they're basically ignoring you.
 
@DaveRandom :P
And what was / is the problem?
You're getting old? ;)
 
6:10 PM
Well it would appear my son has somehow figured out how to climb out of his cot, and managed to fall about 2ft off a bed.
He has basically stopped crying by the time I even got into the room, but still have to go check it out, y'know.
 
@DaveRandom Luckily they are flexible when young
 
I know, he regularly bites his toe nails. I can't get my foot within a foot (ha!) of my mouth. And yes, I tried when I saw him doing it, out of interest. You know you would all do it.
 
:D
 
Right I'm going to get a beer and possibly a sandwich, then I'm going to track this bug down with edited cv requests if it is the last thing I ever do.
 
I have returned.
dun dun dunnnnn
 
6:13 PM
It's alive!! mwahahahaha
 
@rlemon I just don't get it. When I pass window as param for .call() it still throws the same error. WTF
 
foo.call(window);
is the same as foo(window)
foo.apply(window)
 
@rlemon Huh? You sure about that? According to MDN both are the same except apply takes params as array instead of separate.
ps also tried with apply to be sure ^^
 
hrmm. that is strange.
apparently my understanding of those two functions were bs from the getgo
:( fail
 
:)
Sad thing about this is that you had to hear it from me. World just turned upside down ±P
 
6:19 PM
call_user_func() vs call_user_func_array()? Also, if
4 mins ago, by rlemon
foo.call(window);
is the same as foo(window)
why does it even exist?
 
I just don't fucking get it all hits on SO also say do either .call() or .apply() and it should work. But it doesn't. Some feeling creeps up now that I have screwed up somewhere.
 
6:31 PM
@PeeHaa What are you trying to do?
 
@MadaraUchiha Trying to implement .getUsermedia() and failing: jsfiddle.net/4esnr
 
mmmmm
beer
 
@tereško Now that's a good idea
 
with some blue cheese
 
6:47 PM
aaaahrg damn you javascript
 
@PeeHaa What are you expecting that code to do if it works?
 
@DaveRandom Don't spit out the error Uncaught TypeError: Illegal invocation :)
 
@PeeHaa OK well I got it to spit out NOT_SUPPORTED_ERR: DOM Exception 9 instead if that helps
 
@DaveRandom fiddle or didn't happen
 
If what I have done is the answer you will severly kick yourself as well
 
6:53 PM
31 mins ago, by PeeHaa
I just don't fucking get it all hits on SO also say do either .call() or .apply() and it should work. But it doesn't. Some feeling creeps up now that I have screwed up somewhere.
 
Useful or no? Can't find any meaningful docs for webkitGetUserMedia so it was basically a complete stab in the dark
 
@DaveRandom Nopez. I'm afraid that's not it. Nice to see another error though :). this.userMediaObject contains navigator.webkitGetUserMedia() which is a native function. I.e. part of window so as far as my JS skills don't fail me it should contain window. Might just be a lack of JS skills though.
Hmmmm. Although it is throwing another error. Suspicious...
Wait a minute
 
> fiddle.jsshell.net wants to use your microphone
You might facepalm
 
easily done :-P
 
7:03 PM
Where did the NOT_SUPPORTED_ERR error go?
 
@PeeHaa Does seem to be required that you invoke in the context of navigator as well though, doesn't work with window. I'd guess NOT_SUPPORTED_ERR came because you were effectively passing two lots of undefined and either is casts to false and borks at the fact you asked it to do nothing, or doesn't type cast and just generally throws up
 
I still don't get it? What did you change besides the passing navigator to .call()?
 
Look very carefully at the the object literal argument
> you were effectively passing two lots of undefined
 
Like I said, easily done
 
7:08 PM
can someone help me with getting pear_auth to work?
 
Thanks @DaveRandom!!!!!11111levenoneoneoneone
 
@PeeHaa Megalolz
 
@JohnBernal Error message?
BTW you know it isn't updated for a long time right?
 
oh uh...
 
I have a page, where I initialize a singleton, add some test info to the instance, but when I reload page, instance resets, can someone help?
 
7:10 PM
any recommendations then?
for a better auth library?
 
> 1.6.4 (stable) was released on 2010-10-25 (Changelog)
:)
 
I am making an application that will contain a lot of questions. The application will possible contain many different question from different domains. Would you create a separate database for each domain, or associate a "domain" to each question? Such as questions about cats, dogs, football and so on...
 
@JohnBernal What do you actually want to do? (and don't say "auth", be more specific :-P)
 
@test1604 , sure .. learn OOP
 
@Dude Not sure with the information provided, but at first glance I would say same database
 
7:12 PM
right, so I have finished making a webpage where the user can register with all information and I insert all that information into my table. Now the last thing I have left to do is have the user be able to login into his/her account, manage his/her account (change passwords, upload files, etc). I want to display one page when the user isn't logged in and another when they are
 
@test1604 I suspect you are suffering from the same misconception that many seem to some how glean from (not reading?) the docs - static does not mean that the variable will persist between page loads
I really don't understand where people get that idea from
 
It's been a while:
Aug 6 at 12:58, by hakre
user image
It haz superior scope man
 
I can haz $tatic?
 
@DaveRandom But I need an object, which can be shared between users, how to realize it in patterns?
 
@PeeHaa so any library/framework recommendations based on the things I need it to do?
 
7:16 PM
@JohnBernal OK, and you are not happy with HTTP auth for this?
 
@PeeHaa I am creating a web application. The application will gather questions (and answers etc) that will belong to different domains in the real world. Question about cars, cats, boats and so on. The administrator will be able to create these domains and the user can submit questions to those domains. Would you create a new database for each domain or would you associate each question with a domaintype table?
 
@JohnBernal For what you are trying to do I would not use any 3rd party tools, but write my own
 
@DaveRandom i..didn't even know that existed...will be able to do all the things I need: user has to be able to login into his/her account, manage his/her account (change passwords, upload files, etc)
will it be able to do all the things i need? ***
@PeeHaa T.T I'm a newbie...where do I even start?
 
@Dude How will the domains be administered? E.g. are there people responsible for all domains?
 
@test1604 , what sort of object
 
7:19 PM
@JohnBernal Doing anything with user credentials without knowing what you are doing is as dangerous as doing yourself as relying on 3rd party code.
 
@JohnBernal I highly recommend, since you are obviously new to auth, that you start simple. Digest auth is quite secure and quite simple to implement in PHP (hell, the manual section I linked basically gives you the code). The main reason you won't be happy with it is that logout handling is a PITA and cosmetically it's not that nice. But it is easy.
 
@PeeHaa The administrator will be able to create the domains and the user will choose from a dropdown box when submitting the question which domain it should be posted in.
 
Unless somebody created a foolproof API (and even then...) @JohnBernal
 
$foo = new SomeClass;

$user = new User( $foo );
$post = new Post( $foo );
@test1604 , the $foo object is now shared between two classes ... we call it : object oriented programming
 
@Dude And the design of all the domains will be the same? E.g. same table structure a=etc?
 
7:21 PM
@DaveRandom hmm, okay. There's no way to change the look?
 
@JohnBernal I'd suggest you start with the easy stuff so you can evaluate what it is about the easy stuff you don't like. You will learn quite a bit along the way, and you'll have a much better grounding when you come to replace it with something more complex. IMHO.
 
@PeeHaa Yes, the classes and tables (SQL) will be the same
 
@Dude Use the same database in that case
 
@PeeHaa Ok, thanks. That what was I thought
 
Will be easier to maintain :)
 
7:22 PM
@DaveRandom okay will give it a try. Start here: php.net/manual/en/features.http-auth.php, right?
 
@tereško which can be accessible to the other users, I want to realize a long polling chat, and do not check every new message in database, because it'll waste connections, so I need a class to detect if new message was sent
 
@JohnBernal Semi related question: how are you storing the passwords?
@test1604 caching is your friend in that case
 
salting + encrypting
 
@test1604 this usually is the point when i recommend hiring a developer
 
question about that, should I have a salt column where I store the salts?
 
7:24 PM
@JohnBernal I would start there yes. I would also suggest that you start with Basic auth and work your way up to Digest (which is what you should use in production if you are going to use HTTP auth). I would also join here: en.wikipedia.org/wiki/Basic_access_authentication
@PeeHaa Bloody good point my good man. I'll let you take over from here as I have to go eat something before I expire.
 
@JohnBernal The thing I really wanted to know is how you are hashing your passwords?
@DaveRandom enjoy
 
@tereško I'm the developer, but my main programming language is Java
 
well .. PHP has "share nothing" architecture
 
Bcrypt
 
7:26 PM
there is no VM where you can keep a connection hanging
 
@JohnBernal WAAAAAAAAAT?!?!?!?
That is good though :)
 
what would you use?
 
you either cache the data ( using APC or some 3rd party solution ) or , if you need to keep so number around , you put it int session stirafe
 
@JohnBernal bcrypt
 
@test1604 , just keep in mind that sessions are not for caching
 
7:28 PM
@JohnBernal Normally people start by screwing that part up so I was kinda flabbergasted
What PHP version do you use? @JohnBernal
 
also , @test1604 , php would really suck for implementing a socket-based chat ... you would be better off with javacsript ( node.js ) for the serverside code
 
@JohnBernal 5.what.what?
 
@PeeHaa Just a quick note to throw in here: hashed password storage on the server is incompatible with Digest auth because you have to be able to hash the raw password to compare with the string the client send.
 
5.4.7
 
7:30 PM
every user has his own session, but how to realize an application scope shared memory?
 
You have to encrypt for Digest, not hash
 
@DaveRandom eeew
 
I know, but it's better than basic
 
True that
@JohnBernal You could use @ircmaxell's password compat lib to make it easy to hash and verify the passwords. That way you only have to check the username yourself in the query which should be pretty easy to do.
Just don't know whether it is already production ready. @ircmaxell?
@JohnBernal You know how to query the database right?
 
uh
kind of
i'm just learning along the way
 
7:37 PM
@JohnBernal How are you accessing the database? mysql_* functions, mysqli_* functions or PDO or some other driver?
 
pdo
 
@JohnBernal Where do you get all your information from? It seems to be pretty much spot on up till now.
 
posted a lot of questions :P. I basically dove head first into this whole webpage programming without any prior knowledge whatsoever. For something that should have taken a week (tops), I've spent 3 developing a user registration page T.T
 
@JohnBernal Well if you just started out that's ok. You did not only develop a user registration for but at the same time also picked up some good practices. Which is something that is pretty rare with all the stupidity one find on the internet.
 
I just want to practice good coding techniques, don't really like using outdated stuff. But then again i really don't know what is outdated (was about to start using pear)
 
7:44 PM
If only there were more people like this guy, there would be much less rage in the world. Certainly in this room.
@JohnBernal PEAR itself is not outdated, although a lot of the packages on there are and still more of them are fundamentally terrible.
 
I heard that pear was being phased out or something like that. Is there a new repository for php extensions/applications
are they moving to git or something?
 
@JohnBernal A quick look at the blog tells me that yes, they are shifting the codebase to github - but it doesn't look like they are altering the stupid framework - tbh I don't pay much attention to PEAR because there is so much bad stuff on it and I've been burned a couple of times. Also the whole design of the PEAR framework is flawed.
(IMHO)
 
ah i see. What's the new place these days? Where do you go?
 
pce
@JohnBernal PEAR moved to github and is under Test/CI.
 
@JohnBernal The login part of you application should be pretty easy if you now how to hash and how to query, Just query the databse to get the user based on the username and verify the hashed password against the inputted password by the user
 
7:53 PM
@JohnBernal I write most of my own code :-P Just about the only third party library I ever use is SwiftMailer, obviously I pinch bits and pieces off blogs and the like, but it is very very rare I use someone else's code unmodified. I wouldn't discourage you from using PEAR completely, but I would suggest that you know what every single line of code in <insert third party library here> does before you even consider using it.
 
@DaveRandom ah i see, should probably start writing my own code from scratch rather than depend on someone else's
can you tell me if this query statement to check username and password is correct: "SELECT Username, Password
FROM table
WHERE Username = $un AND Password = $pwd
LIMIT 1"
 
@JohnBernal PREPARED STATEMENTS!!!!!
:-P
 
the full code is: $test = $link->prepare("SELECT Username, Password
FROM table
WHERE Username = $un AND Password = $pwd
LIMIT 1");
i just only wanted to verify that the query was correct
 
Nonononononono
$stmt = $link->prepare("SELECT Username, Password
FROM table
WHERE Username = :un AND Password = :pwd
LIMIT 1");
 
7:58 PM
Right..forgot the :un, and then bindparam
 
$stmt->execute(array('un' => $un, 'pwd' => $pwd));
 
But you cannot select on password
Because it is hashed right ;)
 
Well you can if you prepare it and you pre-hash the input
 
@DaveRandom No you can't because you don't know the salt :)
 
Oh yeh, duuuhhhh
 
7:59 PM
^^
@JohnBernal You should run the query @DaveRandom gave you without the AND .... After that you got the hashed password and can verify it with the password
 
@PeeHaa Well you need to SELECT Salt, Password don't you? There's certainly no point in selecting the username column
 
@DaveRandom The username can be useful, because what I would query qould look like:
SELECT lower(Username), Password FROM table WHERE Username = :un
 
@PeeHaa Well yeh but you already have :un so what's the point in selecting it again?
 
See my edit :)
I always make my usernames case insensitive on login
 
utf8_general_ci FTW!
 
8:04 PM
@DaveRandom True that. Although PostgreSQL FTW! ;)
@DaveRandom But you would stay have to get the correct cased one to display it if you want
or to put it in the session
 
Yeh I'm slightly ashamed to admit I've never used it ever. I saw some people discussing some pretty neat sounding features in here the other day (you may have been one of them) and "check out PGSQL" is on my list of things to do.
 
hmm, anywhere I can post code from multiple files to show you guys. For some reason my authentication is not working properly
 
@DaveRandom Might have been @tereško. He's with me on this :)
 
@JohnBernal If you have a github account make a gist. Otherwise use pastie or something like that
 
8:07 PM
@JohnBernal Also, before you go to that trouble, define "not working properly"
 
@PeeHaa yes , i do agree. PgSQL is superior to MySQL
 
@tereško Imho postgres doesn't get the attention it deserves
@DaveRandom Just found out I could have also simply overridden the global thing `navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia || navigator.msGetUserMedia;`, but that looks fucking wrong :)
 
@PeeHaa If you do that don't forget to add || null to the end in case none of them exist ;-)
(and check for it, obviously)
 
@DaveRandom Not going to use it, but good point nonetheless
Overriding native stuff just feels dirty
 
8:13 PM
On another topic, is there a good reason for pluginSettings being that complex, seems like an object map of the settings and their default values would be more maintainable, but I don't want to do it if there's a good reason not to.
 
@DaveRandom No good reason at all. Started out small and easy and just became a beast at some point and is long overdue for a refactoring.
 
Good good
 
i should make something ...
any suggesting ?
i have been thinking of rewriting fpdf in a a less sucky form .. not sure if it is worth it
 
@tereško A cake. No, two cakes, and send one of them to me.
Although big +1 for a usable PDF lib
 
@tereško Fracture is on hold?
 
8:18 PM
no , it's sort of done , but needs an overhaul
problem is that i cannot separate the framework from application i form that i would be satisfied with
when i get around putting more time in that project, it might morph into something more like a MVC tutorial , then a framework
 
@tereško Nice.
 
not nice
 
Why not?
 
it's not useful , and you cannot put it on github as a project
 
The web needs good resources on the topic
@tereško You can still put the result on github
And I would like a decent pdf thingy btw ;)
 
8:22 PM
oh .. and i still havent figured out a good way to structure the views
what i have now seems highly questionable
 
hello?
@PeeHaa @DaveRandom here's my code, finally got it on github. github.com/ramhanuman/User-Authentication
 
@Richard What does it return from the database?
 
@Richard Is that JohnBernal? Why do you have two accounts? :S
 
@JohnBernal @Richard Two accounts?
 
8:37 PM
Fullscreen vs FullScreen?
 
@Richard , why do you mix HTML, PHP and CSS ?
 
I've said it before and I'm sure I will end up saying it again: If you want to add functionality to PDO, extend it, don't wrap it.
 
@tereško cuz i'm a newbie
@DaveRandom not sure what that means.....
should "location: Front.php" be changed to "location: /Front.php" since front is outside of the folder where membership.php is
 
hang on
 
@Richard , if usernames are unique , why do you query for both usernames and passwords ?
@Richard , why do you use simple MD5 for hashing passwords ?
 
8:40 PM
20 hours ago, by DaveRandom
class myPDO extends PDO {
  public function __construct($dsn, $user, $pass) {
    parent::__construct($dsn, $user, $pass);
    $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $this->setAttribute(PDO::ATTR_EMULATE_PREPARES, FALSE); // always set me for MySQL!
  }
}
 
@DaveRandom Depends on what you want to add though
 
@tereško usernames are not unique, probably should make them. will change to bcrypt latter
 
@NikiC Anything that falls outside the scope of extending PDO should have the PDO instance injected into it (IMHO)
 
@Richard When redirecting you should always use absolute paths
 
8:43 PM
@DaveRandom Sure. (I have no idea what you people are talking about right now. Just wanted to point out that extending isn't always the solution; I'd even say that most people who try to extend PDO actually want to wrap it.)
Oh, and did you hear? Python 3.3 released :)
 
@NikiC For the most part, agreed. It just pains me to see a constructor for a class with new PDO in it
 
@DaveRandom certainly
 
@NikiC Does this mean people will finally get around to using 3.x instead of 2 ;')
 
doubtful
 
@PeeHaa They added support for explicit unicode literals to improve BC with the 2 series
But no, don't think so
 
8:46 PM
force of habit
 
Maybe people will move once Django becomes compatible with 3
And the NumPy/SciPy stack
 
Javascript: console.log(typeof null); // "object" - WTF?
 
@PeeHaa lol, never seen that before
 
@DaveRandom Nice one. I think even PHP couldn't that any better :D
 
9:11 PM
looked at FPDF source ... seems like euthanasia would be the humane solution
 
Got another good one: isNaN(null); // false
 
@DaveRandom That actually makes a lot of sense
isNaN presumable checks for a NaN, at least the name would make me assume that
 
Ohhhh yeh, NaN is an actual thing in JS isn't it, forgot that
 
It's an actual thing in every single language
 
@DaveRandom it's actually a number that is not a number.
Probably something comparable to INF
 
9:13 PM
At least every language that supports standard floating point numbers
 
@NikiC , that's what we call "bold statement"
 
@NikiC JS numbers are odd though, being that they are all "number"s and not int/float
 
@tereško Not really. I might have replaced "standard" with "IEEE 754" though, to be more precise.
 
I wonder that @tereško didn't smell that already. (scratching the back of the head)
 
what did i do or didn't do now ?
 
9:19 PM
NikiC's reference to the floating point implementation.
 
10:05 PM
blogging anyone?
0
A: CRX_ZREO_SIGNTURE_LENGTH failure in .crx file

hakraYour question as-is does not leave any sign what exactly goes wrong. However I can see that there is not much error checking. I suggest - as it is common for well written code - that you add some tests for return values first. Also you might need to enable error reporting and track the error log...

@PeeHaa: That signing might be interesting for you, too.
 
Mother of posts
 
totally stumped
 
You should do $link->rowCount()
Ow wait btw
 
10:21 PM
i don't know if i should do bindparam, execute, rowcount on link or usr_check
 
You are running a select right?
> If the last SQL statement executed by the associated PDOStatement was a SELECT statement, some databases may return the number of rows returned by that statement. However, this behaviour is not guaranteed for all databases and should not be relied on for portable applications.
 
how do i know if i'm running select or not?
 
SELECT * FROM Conferenc...
 
soooo i don't understand why you asked if i'm running select O.o
 
Was too lazy to double check
 
10:25 PM
OMG the fucking cat is getting right on my tits. She just walked right across the keyboard.
 
@PeeHaa yah so it didn't output the desired result, it should have said username already taken. I inputted user and there is already a user in the database
 
5 mins ago, by PeeHaa
> If the last SQL statement executed by the associated PDOStatement was a SELECT statement, some databases may return the number of rows returned by that statement. However, this behaviour is not guaranteed for all databases and should not be relied on for portable applications.
 
pce
@JohnBernal same results if you fetch? like this:
$result = $statement->fetch(\PDO::FETCH_ASSOC);
if ($result) {
if (empty($result['user_id'])) {
return true;
}
}
return false;
 
hi @pce!
 
pce
s/return/echo/
hi!
whats new?
 
10:30 PM
@pce so this is what i put: pastie.org/4867807
 
if that's correct then it is not doing the desired operation which is to output an error message if the username already exists
 
pce
@hakra you know DI, i saw a circular refernce, recently. A Logger depends on DB, and the DB Class uses Logger to log queries (which uses the DB ... ). Is that ok?
 
@pce Well if you're fan of endless loops in case an error to connect to the database needs to be logged (which could then happen maybe), why not? ;)
 
pce
i'm a fan of endless loops :)
 
10:34 PM
You normally should log to syslog and done.
In case you need that into a database, take a syslog server.
So actually I do not see a real reason why the logger should depend on the database.
Imagine a programmer is clever and always wants to log when queries are slow. Good idea, to put more traffic and load into the database, right?
 
pce
Because the Logger writes failed queries into the database.
 
@hakra updated post
 
pce
@JohnBernal if you are on firefox, you could check the response in the network tab, there you should see your var_dump.
 
@pce can i not do that in chrome with the inspector tool? It also has a network tab
 
pce
you can. chrome is fine, too :)
 
10:40 PM
Oh wow
okay
it's sending the request to Available.php
500 Internal Server Error
but it says
 
does any one here use wordpress?
 
@pce What does the logger do if the database does not work? I mean logging is probably more important than the database, right?
@TheWebs sure.
@JohnBernal It's likely you have a fatal error in your script. Let me guess, probably something like you treat some variable as an object (e.g. you call a method on that variable) but it ain't one.
 
pce
@hakra it's something like a FailedQueryLogger only for devs.
But syslog server is a good point.
 
@hakra an error in available.php? But you saw the entire file, did you see any fatal errors like that?
 
10:48 PM
@JohnBernal Well, it's just that I assume one because of "500 Internal Server Error". You actually must first look into the error log of your webserver for more information. 500 server errors are logged by your webserver. However I smell this is an error in your PHP file then. But sure, first look in the webservers error log and do not trust me.
 
@hakra right that's what i'm wondering though, do you mean there's an error in Available.php or an error in main page where the validator calls Available?
 
Using github.com/webtechnick/CakePHP-Facebook-Plugin to connect #Facebook with #CakePHP but the requirement is that it uses no Javascript for this process... anyone knows how to handle this?
 
@JohnBernal No idea. But you could create yourself some simple test-files that include your php-called-by-ajax scripts, setting $_POST vars upfront and then you could easily test. Also you can enable error display for these specific tests, so you would get actual error messages. That might make everything more visible to you and helps you debugging things.
@mmoscosa Change the requirements?
 
@hakra hahahaha tried but the client doesn't want to..
 
@mmoscosa Yes, I want to have three new Mercedes next too my two Porsches in the garage, but there is not enough room :/
 
10:57 PM
@John
Oops, ha! Chat noob here...
 
@SimonGermain: Please create a dedicated chatroom for that specific troubleshooting. Thanks!
 
@JohnBernal, where is your stuff hosted?
Alright
 
user379888
Hi all. A little offtopic question but does anyone remember the trick to avoid making the properties of parent div move to the child. Thanks
 
pce
@StartupCrazy lmgtfy.com/…
 
user379888
@pce: Thanks. I actually did not know the keywords to search for it.
 
pce
11:09 PM
@StartupCrazy youre welcome, i even didn't know youre question is about DOM or CSS? :)
 
user379888
Oh my
 
@pce, if you've got a minute please gimme a call.
 
aaand ... what's up
did i miss anything interesting ? i see few gentoo links
/s/few/one
 
user379888
@pce: The most interesting part of your link is that the first result is the question that I had just asked ;)
 

« first day (714 days earlier)      last day (4220 days later) »