« first day (431 days earlier)      last day (4743 days later) » 

00:00
@Levi I assumed as much. Of course as long as the actual project itself is updated on a more regular basis there's nothing to worry about. :P
@CharlesSprayberry thanks but, im still a little clueless as to what that means, I've comeneted on ur answer
@Ezra If your problem is that you aren't catching an exception simply wrap your calling code in a try{} catch{} block
@Daveo silverstripe.com is quite good I hear, or wordpress.
@CharlesSprayberry could you give me some example code? and see the comment I posted on ur answer.
@Ezra I've already looked at the comment to your answer, my last reply in chat was in response to your statement that your newest problem is an uncaught Exception
@Ezra Wordpress doesn't have what I have in mind either. In fact Wordpress pretty much forces developer's into it's mold, which is the complete opposite to my idea of a CMS a user can dictate to rather than the user being dictated to.
00:09
@Ezra php.net/manual/en/language.exceptions.php learn about exceptions in PHP
@Ezra Also, do you not have the 'json' extension installed? It appears that the only way to get the error that you're getting is to be using disqus own JSON unserialize method...
Did I say js_decode? i mean encode opps
@Ezra Check the results of json_encode() before you pass it to your method. It appears from your errors message that there are errors parsing it as JSON
01:02
@CharlesSprayberry hmm, maybe.. I cant check it right now. but if you directly copy paste the example diven in the Disqus documentation linked it throws up a error
Something like expection '(' instead of '{'
I do have json installed, i am testing this on localhost though
definitely do it before passing it. You want to handle errors, not ignore them
Oi
Have any of you used PHP GUIs?
ok
@ElectroNerd as in a PHP IDE? like PHP Designer?
Anyone here ever install PHPUnit with WAMP?
01:12
ok
I'm having issues getting it work from the command line in the WWW directory
Ezra, yes.
see the top right corner of the screen
> Don't ask whether someone is here or can help. Just tell us your problem. If anybody can and wants to help, they will.
@ElectroNerd Ive used PHP Designer a lil mit, but prefered Dreamweaver lol simple
bit*
@ircmaxell Gotcha
01:14
I'm asking if any of you are aware of PHP GUI support. Surely you ask each other whether or not they are aware of something everyday?
Not in a bad way...
How did I ask it in a bad way?
@ElectroNerd gtk.php.net <-- that's the only semi-mature way that I know
@ElectroNerd you didn't, I was continuing my prior conversation
When I try to run PHPUnit from the command line using WAMP I get the following error message: >'phpunit' is not recognized as an internal or external command,
operable program or batch file.
phpunit.bat
additionally, make sure your PEAR directory is inthe system path
01:16
@ircmaxell Notice that I did not ask whether any specific individual could help, but rather if anyone was aware of PHP GUI support. There is a difference.
@ElectroNerd I wasn't targeting that at you, but in general
@ircmaxell Hmm...
Anyhow, I appreciate the help (please note: this was directed to everyone)
@ircmaxell If someone offers a bounty, I my answer receives two upvotes and he answers his own question and selects his own answer as "Best answer," what happens to the bounty?
@ircmaxell PEAR directory is in the system path. Not sure what to do with phpunit.bat. I do have one and the contents do look correct.
@Ozbekov he loses the points either way, but I can't remember the automated system. There's a post on meta
@JohnConde run that instead of phpunit
01:18
@ircmaxell OK, I'll have a look.
@ElectroNerd then again, I might argue that whether or not you should build a gui component in PHP is another story all together
That does exactly what I need. Thank you.
I'm not sure why but I'm having an incredible amount of fun fiddling with jekyll and github pages. Man, I'm such a nerd.
yeah, it's quite interesting
01:34
@ircmaxell Have you looked at the changes I made to github.com/morrisonlevi/PHP-Datastructures ?
@CharlesSprayberry yeah I used the try and catch and got exactly the same error as before 'Caught exception: Missing required argument: forum '
and according to var_dump 'forum' is passed
@Ezra What are you passing to var_dump()? Are you checking for JSON errors?
@CharlesSprayberry im just passing $params to var_dump, how do I check for errors in JSON?
@Ezra Well, of course you're seeing the forum key in $params. Ultimately you need to check the actual JSON object being created by json_encode(). Learn more about JSON errors at php.net/manual/en/function.json-last-error.php
01:50
@LeviMorrison why don't you add a validator function inside ArrayList, you're repeating the code to validate an offset over and over again?
@hakre I know. It's the initial implementation, so no big deal.
The same thing happens in LinkedList.
@CharlesSprayberry even if I dont encode the JSON myself it still brings up an error and im not sure what to do about that
@LeviMorrison: Just asking, there might be a reason why you did this so.
I'm going to ruin so many people's lives with this sendacallfromsanta.com
@hakre Also, I don't like big stack traces.
:)
01:54
@Ezra Are you checking for json_encode() errors? Simply from the documentation you've linked to it appears that the Disqus function you're calling is expecting a JSON object
@CharlesSprayberry I have tested the code in that documentation and it claims 'Syntax error, malformed JSON'
But thats still dosnt really help me, i have no real clue how it would be 'malformed'
@LeviMorrison: Convert those structures into a C extension and you get rid of the big stacktraces ;)
@hakre They will be C extensions when I'm done ;)
@LeviMorrison not significantly...
Do you know how traverseable is implemented in C? Or is that interface a fake?
01:59
@CharlesSprayberry, if i copy the example the disqus docs show exactly I get Parse error: syntax error, unexpected '{', expecting ')'
@hakre Traversable is how you implement that construct in C, I believe.
@CharlesSprayberry I am of course assuming the disqus documentation is not the one in error...
@hakre it's not fake
it's implemented as a C only function getIterator IIRC...
something like that
It would be nice for the linked list (as well as the array list) that I can add and remove items while I iterate over it. So to influence the iterating (but not resetting it). You would need to drop IteratorAggregate then (which I think is a bad idea anyway for such basic types).
@Ezra I have a feeling it is where you are attempting to cast $since to an (int)
02:05
@CharlesSprayberry I have that feeling also, but again thats in the disqus docs.. i dont really understand
@Ezra Take the int type cast out of the array, simply cast it before you assign the array value. Make a new variable holding the return results from json_encode($params)...make sure it isn't null and then pass that to your DisqusAPI function
@LeviMorrison: Another question if you don't mind: Why has the deque interface so much in common with queue?
@hakre Deque is a double-ended queue. It should be obvious why it shares so much with queue :)
@hakre no you wouldn't... You can do that with a regular iterator...
But why doesn't extends it from queue?
to make it look better when you generate class diagrams?
@ircmaxell What do you mean and how should it work if getIterator already created an iterator on a array copy?
02:13
@hakre On a copy? Why would you iterate on a copy?
Because the object's getIterator() function returns the iterator on a copy of the internal array. As the internal array is not otherwise accessible, that's all you get.
So the implementation blocks other sort of use (or you need to write your own iterator class first, which is a bit over the point with a basic data structure).
@hakre Because Queue acts according to FIFO rules, and a Deque can add and remove from either end at any time.
Queue, Deque, and Stack are all very similar, but they aren't the same.
@hakre for IteratorAggregate?
@ircmaxell yes
That's not what it's intended to do
it's meant for if you have a wrapped object/data store, you can return an iterator for that enabling code re-use
02:21
@ircmaxell Well that is the entire point, it's not very useful at that stage.
But that's probably for later and getIteratorI() is handy to implement at first.
/me doesn't get what you're trying to get at
@LeviMorrison But those interfaces could still extend from each other. Probably you want a new set of interfaces for the rules like FIFORule, FILORule etc. ?
how can i see the request headers sent from the browser in firebug ?
@ircmaxell Uhm, well nevermind ircmaxell, I thought you wanted to share something ;)
@Mian_Khurram_Ijaz net tab
I just don't get what you're trying to get at
02:27
@CharlesSprayberry can u give an example of the first part of that?
@ircmaxell What do you mean in specific?
It's about levis SPL extension.
What was your point with the iterators... I don't get what you're suggestion (understand it)
Imagine you traverse a directory try based on a stack.
You init the stack with the current directory.
Then you start a foreach over the stack
@CharlesSprayberry Im no longer getting JSON errors, but still getting Caught exception: Missing required argument: forum
Inside the body of the foreach you just add each subdiretory so you can read those in a future iteration.
If a common stack structure would allow such type of iteration by default, that would be helpful.
02:30
@Ezra Could you please post an example of your code in a pastebin?
@CharlesSprayberry :P you read my mind : pastebin.com/0vkcr76w
thats my current code
got to go, gn8 folks.
@CharlesSprayberry I wasent sure if the disqus API ran the SELECT query itself or if i had to do it myself
what i have figured out the problem for firefox not sending javascript files with .js extention is less headers as compared to Chrome . the Same file upload code runs in Chrome with additional headers i.e. Chrome is sending Content-Length and Content-Type in the header , so how can i add these two missing headers into my code for firefox to send them ?
@hakre asside from queue being the better data structure for that task...
02:37
@Ezra You need to put your check for json errors before you call your disqusAPI methods. Are you sure that $jsonParams is a proper JSON object?
I think the important question should be is iteration destructive on a stack/queue
if so, easy answer. If not, I can see a usecase for either way. Which means configurable. Which means bad...
@ircmaxell: ?
then again, you could always do foreach (clone $data as $file) {
@CharlesSprayberry hmm actually im getting Warning: Invalid argument supplied for foreach() for the JSON error checking
on $jsonParams
@CharlesSprayberry also if you remove $since etc completly form the array in $params, it has no effect on the resulting error
@Ezra Because by the time you call it $jsonParams is a string. To get the json errors simply check the return value of json_last_error()
02:45
@CharlesSprayberry json_last_error returns false
@Ezra It is return false or it is returning 0?
@CharlesSprayberry its returning false
@CharlesSprayberry how n00b am i? ;/
@Ezra It is not returning false. You are var_dump($error === JSON_ERROR_UTF8) That does not mean the value from json_last_error() is false...it simply means that it is not a UTF8 error. Try var_dump($jsonParams, $error)
02:50
opps.. :(
ok, it returns 0
zero
Ok, so your JSON has no errors. You're still getting the exception that missing key 'forum'?
yeah
string '{"forum":"my_forum","limit":100}' (length=42)

int 0

Caught exception: Missing required argument: forum
thats the output of current code
i took since out comepletly for now
@CharlesSprayberry that's my line :-D
@hakre Definitely not. FIFO Combined with LIFO does not make a Deque. Queue, Deque and Stack allow all of them to be built.
what's a deque supposed to be?
02:54
@ircmaxell Indeed it is. You don't have any patents on that do you? ;)
@CharlesSprayberry Nah, it's royalty free :-D
@ircmaxell Double-ended queue. It's a Doubly Linked Linked where you can only access / remove on the ends.
At the moment, I have LinkedList implementing ArrayAccess and Deque as it defines the operations quite nicely.
so it's a cross between a stack and a queue?
Interesting
@ircmaxell In idea, sort of. You can add and remove to the front and to the back. It's useful for building other datastructures, mainly.
02:58
yeah, but what's the difference between it and a DLL? The restriction? IMHO, that's not enough...
@ircmaxell In a DLL you can access things in the middle. You can't in a Deque. I'm surprised you've never ran into one before. I ran into it even before my university training on datastructures.
grrrrrr why is it so hard!!!!!!!
still, it's fundimentally just a DLL... the access restriction may be something to do, fine. But it's not a different concept (which queue/stack are)
@ircmaxell Right. The LinkedList will allow us to make linked versions of Queue and Stack if we want to. Deque is nothing special. What made me actually make it was that I didn't want the deque operations to clutter up the Vector interface.
I'm not arguing making it or not. Just that it's not a core structure, but a derived one...
then again, I guess you could make the same argument about queue and stack (that they are both just a SLL in different directions),,,
03:07
It allows me to keep Vector to ArrayAccess and Collection with no additional methods.
That alone makes me happy.
03:20
nice
@CharlesSprayberry could be a problem with the Disgus PHP Class?
@Ezra I'm not that familiar with Disqus beyond the brief look at the API code you linked in your question
sadface.. thanks for trying anyways
@Ezra I don't personally care for the fact that they are passing around JSON objects in PHP. Just use an array, even in their code they are type casting the argument you pass to an array.
yah, its very weird.. ive never seen that done before
03:51
@Ezra - Unless I'm missing something, and I've come into this conversation a little late, you can't iterate with a foreach on a string: codepad.org/ErbPsm29
@JaredFarrish which foreach are you refering to?
@Ezra - The one on line 43 here: pastebin.com/0vkcr76w
And at least with this check: codepad.org/4FikZhzo It looks like the encode worked with the example (Codepad doesn't have json_last_error()).
$jsonParams has been converted to a JSON string..
In PHP, though, that's a string, not an iterable object/array. Unless in the one newest versions of PHP, a JSON object is first class...
hmm true
04:02
Which if it has, it wouldn't surprise me I suppose. But a JSON is a string in Javascript Object Notation, which traditionally meant it was a string, not an object/array.
hmm, even so.. the main problem is not solved :(
which is the "Caught exception: Missing required argument: forum" error
be back later
@Ezra - Have you tried selecting the forum on connect?
Nevermind, I was looking at the wrong thing.
04:42
@Ezra - Well, I think lines 80 - 84 here: github.com/disqus/disqus-php/blob/master/disqusapi/… is definitely causing your problems (as I think someone mentioned above.).
@Ezra - I would change that function on your local copy to what you find here: codepad.org/1J3IgIHF
@Ezra - Essentially, trap the part causing the error and inspect what you see. I also agree with whomever said the code is a little problematic. I think it's too clever in how it works, and hard to debug because of that.
05:01
morning guys , gals and everyone else
05:12
@tereško Morning mate
 
4 hours later…
08:52
morning
you're late =P
i am :)
09:08
hello, i have a small problem with json_encode it doesnt seem to be returning! or so i think. here is a small part of the php i am using..
$password=md5(strip_tags($_POST['password']));
$repeatpassword=md5(strip_tags($_POST['repeatpassword']));
//register user!
$connect=mysql_connect('localhost','root','');
mysql_select_db("chat");
$queryregister=mysql_query("
INSERT INTO registered_users values ('','$username','$password','$fullname','$date')
");
$data = array("You have been registered");
echo json_encode($data);
to handle php i am using JQuery and the code for JQuery is here
$.ajax({
type:"POST",
url:"register.php",
data:{
'username' : username,
'password' : password,
'repeatpassword' : repeatpassword,
'fullname' : fullname,
'submit':'submit'
},
dataType:"json",
cache:false,
success:function(data)
{ $("#notices").append($("Result : "+data));
//$('div#notices').html($("Something should have been here"));
//$('#notices').html($("You have been registered"));
}

});
the problem is that this line doesnt seem to be working $("#notices").append($("Result : "+data));
the code above executes well because it adds a record to my db but the success message that i want to show doesnt seem to be working
as an alternative i have also tried replacing the "data" in $("#notices").append($("Result : "+data)); by data.data but that doesnt seem to work too. Can any one help me out here?
gods
@Tanmay , if you do not know how to paste code in this channel, then DONT DO IT
@tereško what? that code was too much in one go i know :P :)
yes i know..shall i repost? that was crappy and wrong, sorry
you might be able to edit the existing lines
meaning? the existing chat??!! i dont think i can edit that to reflect code in it
anyway , please dont do it again .. yes , if you were not so slow , you could have edited the text , @Tanmay
09:17
yup sorry
ok ... on a different note , what the hell is doing one in that code snippet
$password=md5(strip_tags($_POST['password']));
$repeatpassword=md5(strip_tags($_POST['repeatpassword']));
why would you do something like this ?
that is coming in from jQuery .ajax()
why are you stripping & hashing both passwords ?
why ?
excuse me , but i fail to see the logic in this
because i saw it on a tutorial :P
ok first of all
pass and repeat pass are checking if both are equal...
strip tags is just there for the heck of it..
and md5 to encrypt it..why is that a problem?
i dont want to store my pass as pure text in the db
@Tanmay md5 might be right, but you should definitely remove strip_tags
strip_tags will break some passwords
09:21
help me , @NikiC , i'm hanging with nails to my politeness
ok point accepted
E.g. if I use HalloIs<ThanBye as a password strip_tags will convert it to HalloIs
chill @tereško i dont know much..have just started learning php..
@NikiC true, i didnt c that. you are correct
and md5'ing passwords before comparing them has no benefit
you can actually create false-positives
that is storing the pass..the query insert
09:23
@tereško unlikely ^^
@Tanmay are you storing the repeated password too ?
ofcourse not
that is just for validation
then why are you doing anything to it ?
ok..i had written everything in php in one file earlier..and so that is why most of the stuff should not be there
i implemented the jquery part later...so there may be some useless code lying there
notice that we are only on first two lines now
09:25
@tereško Keep cool, please :)
it would be nice if you could answer about json_encode !!
@NikiC im trying , cannot you tell
@Tanmay I don't think that jQuery will automatically decode your JSON
i think it does.
you should at first do success:function(data) { console.log(data); }
to see what you actually get
09:28
@Tanmay By the way, your current code (at least the part we can see) has an SQL Injection vulnerability. [This means that people can freely access your database and mess with it.]
jQuery.parseJSON(data)
additionally , why are you using mysql_* functions ? they are in the process of being deprecated and no new code should be written with them
holy shit!!! i have no idea about this!!
@LanceRushing , actually it is JSON.parse(data);
@NikiC since i have just started learning this stuff..SQl injection is something that i have to learn later on when i have done some substantial stuff and know what php is
javascript .. learn it
@Tanmay , if you were using either PDO or MySQLi with properly written prepared statements , then you could care not about injections
@Tanmay I understand that (teresko doesn't :P). The problem is that SQL injections are very serious attacks, which you really wouldn't want to have in your application. Not only can people circumvent your login form (maybe login as an admin?), they can also destroy your database or steal data from it.
@NikiC yes i understand that..that is why i am on localhost :)
anyway my question was totally different!! what about that
@Tanmay Ah, that's okay then ;) Only be sure to fix it before you go online :)
@Tanmay Did you try the jQuery.parseJSON call that @LanceRushing proposed?
what does success:function(data) { console.log(data); } show you ?
09:36
@tereško something comes up for a sec but then it goes away :( i think coz the page refreshes
there is some prob for sure, because it show red color for a brief second, that is all i could get from that
well , then that is cause by something what not in the code you pasted
@NikiC i shall try that
you most likely have a click event going on , without being properly handles
and no matter what you try , you wont get any results before you deal with it
there is a register button that does the submitting!!
show me the code related to the submit event
09:41
Yeah, teresko is probably right. Don't forget to return false; in your submit/click event handler :) Otherwise JS will both do the ajax call and a "real" call.
jQuery.parseJson just wraps JSON.parse (when the browser supports it). Just leaning on jQuery to make life easier. same reason to use jQuery.ajax() versus XMLHttpRequest directly.
ok wait a second.
@NikiC , return false; is not always the solution , especially if you work with event delegation
<input type="submit" value="Register" name="submit" onclick="register()">
HELLOOOOOOOOOOOOOO EVERY ONE
09:42
@LanceRushing , no , learning javascript makes life easier .. if you only "learn" jquery , it makes you a joke
@Tanmay what is inside register() function ?
the .ajax() that i posted earlier
I want to send a mail from my pc (PHP Script) to gmail, What all i need to Do, have already the script file and i have downloaded PHPMAILER
Insults in the morning
I thought i was already on irc for that
then you need to make sure that register() function returns false , @NikiC was right
Early nazi syndrome :)
09:45
@Showket use could use the pear smtp mailer: stackoverflow.com/questions/712392/…
Morning all! How's Christmas going so far? I'm half of my body is freezing while the rest's in the heater.
@ChristianSciberras , stop speaking about SOPA again
@tereško Uhhuh?
so do i just add return false; at the end of my func?
oh .. wait
no
@Tanmay , that wont do anything
emm , where to begin ... do you know what submit button does ?
it submit the form
09:47
@Lance Rushing Thanks a lot for ur response, I already installed Postfix Mail Transport Agent as SMTP Server. But I am not Sure if i have configured it Correctly..
yes
@LanceRushing Give the zetaComponents mail component a look. qafoo.com/blog/011_apache_zeta_components_doing_mail_right.html It's quite nice. (Honestly It's the only mail api i sort of like)
@Tanmay and the form has submit event .. or if you are one of the people who does nor care about SoC , an onsubmit
@Showket are you sending mail just to yourself or other people
this is where your register() function should be attached to
09:49
if you use onsubmit, "return false;" inside the onsubmit to cancel the form, not inside your function.
@edorian I've been using postmarkapp.com
and then , yes , you should only add return false at the end of that function , it will stop the browser from reloading the page
@ChristianSciberras there is no difference
ok, i shall test that and get back to you
If you want the better way, don't use onsubmit and use real event handlers...then do event.preventDefault()
@ChristianSciberras , scroll up to the code he pasted
you seem kinda unaware at what level we are dealing here
09:51
@tereško too many people talking at the same time has got me all confused now
if i get what you are saying
i need to add the function to the onsubmit event
NOT the onclick
@tereško Why's he doing onsubmit handler inside a submit/button?
not "add function" ., but "move it"
@Tanmay Forget the damn onclick. A submit button doesn't click, it submits a form.
now you are parroting
alright so it should do this onsubmit="register()"
09:53
yes , in a <form> tag
@Tanmay But to the form, not the button.
yes i got that
@LanceRushing Link's not working out. But i was just talking about the API in general. Nothing specific to what you guys talked about
<form onsubmit="register()"> and the onclick="register" goes away
@Tanmay Did you know you can submit a form by filling it out and hitting the "Enter" button?
09:55
honestly , if you are just now learning php , you should forget about javascript and jquery and all other frontend stuff , and learn php
@Tanmay Make it onsubmit="return register()"
and inside your register() you have to return false.
@tereško that is probably correct.. i shall test it and let you know in some time..
@ChristianSciberras yes i have done that
or you could do it the easier way:
<form onsubmit="register(); return false;">
i will get back to you in some time in case i have some problem
i need to rush now..will be back in half an hout
/methinks people should stop using oncrap="" and learn to use real events.
/mealsothinks many web browsers and W3C specs should shoot their face and die.
09:57
hour..thanks a lot all of you.. @NikiC and a detailed learning on sql injection is on its way..thanks a lot
@ChristianSciberras no one cares what we thinks :P
catch you all later
@Tanmay , stop trying to do the "ajax magic" and go learn php
10:15
Design is horseshit - On designers in startups. Nicer read than the title suggest
And from personal experience also corps with a 20+ IT staff say "We want an UX expert but he needs to do frontend coding too because UX isn't a real job for a whole person anyways"
Which is quite sad but explained by looking at / trying to use their products
@edorian its not a job. just put your boss in front of the screen. can he use it? good, you got ux.
j/k
> you should try splitting it into (i) a designer who does HTML, CSS (ii) a programmer and (iii) perhaps even a separate Javascript coder.”
That strikes me as very very odd
"We are going to do interaction design. You over there you do all the static stuff and you in the other corner do all the interactions. We'll put that back together when you decide to talk"
For me that doesn't sound right for a startup (or for anyone for that matter)
10:30
hi, can we use distinct with join query
I had used "group by" not "distinct"..
@Urvisha thanks it worked
my pleasure
10:46
afaik , DISTINCT is a really slow directive
 
2 hours later…
12:25
<iframe height='18082563'></iframe> causes a BSoD on win 7 x64 via Safari. Lol!
Good afternoon btw
12:40
I still think that is an elaborate plot to get people to install safari and the apple software annoyance tools
12:53
Who knows.
@Donut Hahahaha
It's one of Windows' "weak spots." Like tickling it :)

« first day (431 days earlier)      last day (4743 days later) »