« first day (991 days earlier)      last day (3972 days later) » 

10:00 PM
the get its used to get something from the url in this case you want to get the value after view="here is the value that $_GET wil put for you"
 
@PeeHaa I'm quickly losing the will to live but I've started so I now need to finish or it will bug me forever
 
example.com/index.php?view=4 .. so now $_GET['view'] will get you the number (4)
 
I got it @AlmoullimDev. and I have this code to ($_GET['erase']);
is erase comming from url??
 
@DaveRandom Ow daaaaaaamn. finally shit is happening
yay!
 
cant tell you that if i dont know what your code is !!
 
10:03 PM
@PeeHaa Oh yeh man, complete, from scratch rewrite in the 2.0 branch, I'm quite please with it. I just have to finish creating all the record definitions, write a shitload of tests and set up travis (that last part is mostly for shits and giggles) and it's done
 
@PeeHaa @AlmoullimDev. I wish if I can get a link tutorial explaining this messages.php?view=$view' in details
 
@DaveRandom I am so going to run it once it is solid
@Sparrow I just linked the official php manual. All there is to know is right there
 
Actually before I write any tests I have to fix my XDebug so I can make PHPUnit work again :-S
 
And if it isn't just complain @Gordon
@DaveRandom You don't need xdebug for phpunit
 
you mean this http://php.net/manual/en/language.variables.superglobals.php
@PeeHaa
 
10:05 PM
Unless you want shiny codecoverage
 
I want shiny code coverage!
Basically I've sort of f*cked up my dev server by doing a really half-assed job of updating to 5.5
 
@Sparrow Yes that is the first page containing links which you could possible click to find out more about specific super globals
 
I might just roll it back until I can be bothered doing it properly
 
@DaveRandom Does xdebug even work with 5.5?
Ah wait, I have code coverage with 5.5 code, so presumably it does
 
10:07 PM
@AlmoullimDev. @PeeHaa sorry but in both links I did not find what I really need I have read that before
 
@DaveRandom lol. I updated on my server for opcache (mostly) only to find out it went bonkers and installed everything but opcache for some stupid reason :P
 
I have no idea. I like I said, my upgrade was really half assed, I just updated the core and bundled extensions, no PECL or anything
 
who uses pecl?
or are you on linux?
that's a dumb question. If you are using pecl you must be on linux
 
A CentOS that badly needs nuking and rebuilding from scratch, I've had no time to do it for ages though :-(
tbh I'm lazy and I use yum a lot but I was impatient
 
btw mad men is fucking AWESOME!
 
10:14 PM
Not seen it, I have a huge list of catch up before I start anything new
I just saw the 2009 star trek last night, that's how far behind I am
 
dose MySQL syntax for PHP 5.3 is the same syntax for PHP 5.4
 
I think yes @AlmoullimDev.
is mysql older than mysqli
 
i made a CMS script it worked just fine with 5.3 but its shows me mysql syntax error when i use 5.4
yes mysql is older than mysqli
mysqli is the improved one
still cant figure out how to use it
:P
 
what you cant use @AlmoullimDev. you mean mysqli
 
not icant use
and yes mysqli
i still dont know how to use it
 
10:26 PM
I think it is so easy just like mysql
 
well im just lazy to learn how to
 
I will tell you how briefly
 
You would be much better of using PDO imho. It has a much saner api
 
just set the whole connection to variable
example : $con=mysqli_connect($dbhost,$dbuser,$dbpass,$dbname);
 
i think the diffrence betwen mysqli and pdo is just the supported things more than mysqli
and i just need my script to use mysql
 
10:29 PM
then use the variable with DML comands I think
example: mysqli_query($con,"INSERT INTO rnmessages VALUES(NULL,
'$user', '$view', '$pm', $time, '$text')");
 
@AlmoullimDev. no pdo doesn't support more (engine specific) things.
 
it dose !!
 
ok it dose
 
@PeeHaa why PDO and not mysqli
 
@Sparrow The syntax is sooooooo much nicer
 
10:30 PM
really
 
And after that the syntax is so much nicer
And after that nicer syntax
 
and simpler?? @PeeHaa
 
And after that multiple engines support
@Sparrow Both aren't really hard
@Sparrow Named bound parameters, decent binding etc
 
I really want to learn PDO everybody here are talking about it
 
its just like mysqli
 
10:32 PM
@PeeHaa but the official website is making it a loooot
 
no much diff
 
is there any OOP in it ??
 
@Sparrow @tereško normally would step in now with a decent tutorial but he is gone I think. lemme see where it is
 
so should i change to mysqli or stick to mysql
i think mysql will be removed or something if im not wrong
 
@Sparrow pdo only has an OOP api
 
10:34 PM
@AlmoullimDev. maybe PDO is the best we should learn it
does it takes a long time from me to understant it @PeeHaa
 
@Sparrow If you read that tutorial you should be able to understand it
 
@PeeHaa thanks I will
 
np
 
and does it so secured from sql injuctions??
 
1712
A: How to prevent SQL injection in PHP?

TheoUse prepared statements and parameterized queries. These are SQL statements that are sent to and parsed by the database server separately from any parameters. This way it is impossible for an attacker to inject malicious SQL. You basically have two options to achieve this: Using PDO: $stmt = ...

 
10:38 PM
should pdo be used over mysqli?
 
@PeeHaa my condolences
 
@marabutt In most situations I would scream yes!
 
@PeeHaa what is the main reason
 
so dose PDO supported in php 5.2 and 5.3 ?
 
10:41 PM
@PeeHaa thanks API supports client-side .Prepared Statements seems the main one
 
@marabutt noooooooooooooooooooooooo
:)
That part is really sucky
 
and support for multiple dbs
 
Now that I think about it. @ircmaxell wouldn't it be a good time to bring up the emulated prepared statements again?
@marabutt yes
 
i have always used sprintf.... I have much to learn
 
nice answer you gave @PeeHaa I think I am in love with PDO now
and like you said PDO syntax looks shorter and better
@PeeHaa
 
10:52 PM
:-)
 
as im trying to learn at the moment its look more harder than the old mysql syntax
 
@AlmoullimDev. help me reading this :D
http://wiki.hashphp.org/PDO_Tutorial_for_MySQL_Developers
this is mysql
<?php
$link = mysql_connect('localhost', 'user', 'pass');
mysql_select_db('testdb', $link);
mysql_set_charset('UTF-8', $link);
 
actually im reading it right now
 
this is PDO
<?php
$db = new PDO('mysql:host=localhost;dbname=testdb;charset=utf8', 'username', 'password');
 
and so far i manged to connect to the database and its correct that its easier and shorter to use :D
 
11:02 PM
 
I think same idea with cleaner code
 
but will stil hard till i get used to it
 
@DaveRandom You really thougth hoped that would have worked?
 
we need to practice it cuz mysql got too old
 
11:03 PM
There's no real reason why it shouldn't. It's still a constant expression.
 
and i think it will be removed in future as i have been reading in some articles
 
@DaveRandom Still waaaay too fancy
 
Also :-( for the same reason
 
and i think it will be removed in future as i have been reading in some articles
 
@AlmoullimDev. yeah me too
 
11:04 PM
(as long as you don't use use())
 
@DaveRandom Hey if you rfc and patch that shit you wouldn't hear me complain
:-)
 
I doubt I'm capable, I imagine it's waaaaay more complex than I think it is or it would already work
 
the error handling kind of longer than the old one
with mysql_error()
 
Certainly the bitmask thing
 
maybe @AlmoullimDev.
@AlmoullimDev. are you arabic or asian??
 
11:07 PM
Arabic
 
yes I saw your picture
so do I brother :)
 
:D
nice
 
@AlmoullimDev. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 
where you from
 
11:08 PM
bahrain
@DaveRandom what you mean
and you @Sparrow ?
 
aha nice to meat you I am from Yemen @AlmoullimDev.
 
nice to meet you too :D
 
Anonymous
@Sparrow Yemen? hmm.. you know, Eritrea is just a couple of minutes away
 
Anonymous
with a speed boat, that is
 
@AlmoullimDev. If you are using PDO, always do that when you create the connection. This accomplishes 2 things: firstly it make error handling a lot cleaner and easier to cope with, because you just wrap the code that might cause an error (and this can be a block of several statements) in try { /* do something with the database */ } catch(\PDOException $e) { /* handle an error */ }
 
11:10 PM
idk why this should mean something :D
lol
 
@phpNoOBఠ_ఠ are you Ertirean :D ??
 
Anonymous
@Sparrow yea
 
...and secondly it means your code will always blow up when something goes wrong, which makes debugging a) unavoidable and b) easier
And yes, point a) is a good thing
 
@DaveRandom thank you
 
np :-)
 
11:12 PM
but i still didnt understand how the error handling works
and the try { }
idk why should i use it
 
@phpNoOBఠ_ఠ WOW maybe I can take my lunch tomorrow in your house :D
 
@PeeHaa Given that I am defining a huge format datastructure in a class and I can't assign expressions if I do it at class level (i.e. at compile time) what would you recommend? I could put it in a method called by the constructor but it feels a bit wrong somehow...
 
@phpNoOBఠ_ఠ
http://geology.com/world/eritrea-map.gif
 
Anonymous
@Sparrow I do live in Switzerland now. But, I am going back hopefully, by the end of this year.
 
@DaveRandom when i do catch() should it be outside or inside the try {}
if outside can i use for all the errors will popup in the code by putting it down the code
 
11:15 PM
@phpNoOBఠ_ఠ I have a friend left yemen and went to Switzerland with his famely
 
if outside can i use for all the errors will popup in the code by putting it down the code
 
Anonymous
@Sparrow There are people here from all places. It's a nice place work/learn
 
try {
    // ...and do something
} catch(\Exception $e) {
    // ...and do something with the exception, an object which is held in $e
} finally { // only in 5.5.0+
    // ...do something regardless of whether an error was thrown or not
}
 
@phpNoOBఠ_ఠ any where is better than yemen it is going worse and worse
 
@DaveRandom ok i got this , can you explain the try { } for me
 
11:18 PM
If an exception occurs, the rest of the try block won't be executed, so this:
try {
    echo "1";
    throw new \Exception('Ohs noes! It's went rong');
    echo "2";
} catch(\Exception $e) {
    echo "3";
}
 
@AlmoullimDev. try is doing the action that has no errors and if any error the compiler goes to catch block
 
...will output 13
Whereas this:
try {
    echo "1";
    echo "2";
} catch(\Exception $e) {
    echo "3";
}
...will output 12
You can also handle different types of exceptions differently, like:
try {
    // ...and do something
} catch(MyFunkyException $e) {
    // ...some known error that needs handling
} catch(\Exception $e) {
    // ...any unrecognised exceptions end up here
}
You can throw anything you like, as long as it extends from Exception
 
also mathematical errors like dividing by 0 @DaveRandom @AlmoullimDev.
 
it is the same like c++ and java
 
11:23 PM
@Sparrow Well, actually, a division by 0 emits an E_WARNING, not an exception, you need to register an error handler if you want to convert it to an exception
 
Anonymous
@Sparrow Not better than Eritrea
 
You can convert errors to exceptions with set_error_handler(), it's actually (like many elements of PHP) a pretty sucky mess
 
@DaveRandom are you sure about that because we studied that in OOP java class
 
@Sparrow 100% certain. Java doesn't have the concept of "errors" like PHP does, in Java every error is an exception. But PHP also has "errors" which are a completely separate mechanism
@Sparrow 3v4l.org/caoXv
 
aha like when we try to write to a file using java it the file does not exists throw exception
@DaveRandom
@phpNoOBఠ_ఠ Ethiopia is much better I guess with electricity and wars
 
11:29 PM
@Sparrow Since PHP 5.3 you can do that: 3v4l.org/8QrSR
But it's a nasty hacky workaround, and you lose exception typing unless you make that error handler function really complex
You basically end up writing your error handling code split across two places - the error handler and the catch() block
So in reality you don't do that, you just live with a single exception type for converted errors
 
Anonymous
@Sparrow hm.. one thing Ethiopians and Yemenis have in common is chaat
 
But Java's exception class system is a mess as well, ExceptionNameFarTooLongToProduceReadableCodeException
 
@DaveRandom sounds good I need to read more about that but we do not use error handling a lot ,what do you think??
 
@DaveRandom Sounds like you are trying to do work at construction time?
 
@phpNoOBఠ_ఠ we do not here a lot about Ethiopians even we are neighbors
 
11:35 PM
0
Q: What is the meaning of FWIW?

Cody GuldnerI checked Stack Exchange Glossary - Dictionary of Commonly-Used Terms, but it wasn't included in the long list of terms. So it should be included there, and put as an answer here, so it is easier to find.

:|
 
Anonymous
@Sparrow Because, we are cutting your off. They are concocting plans, to take the RedSea from us. Anyway, I am sure you have many Ethiopians women working as maids
 
@phpNoOBఠ_ఠ you own the AJAX chat room??
 
Anonymous
Yea
 
Anonymous
I would own AJAX itself, too. If I could :)
 
what about the red sea @phpNoOBఠ_ఠ
 
11:36 PM
@PeeHaa Not really, it's a rigid format definition (all the expressions are constant). But in order to make the definition readable I'd like to bitmask stuff from enums, and the formats can carry a callable for a custom __toString() implementation. I can not bother with the __toString() and leave that to the user (which is what I currently do) but certainly with the masks/flags I'd like to use names instead of numbers in case I change the numbers at some point
 
@phpNoOBఠ_ఠ I wish if I can learn more ajax
I think I will need you soon on to help me on my prject @phpNoOBఠ_ఠ
 
@Sparrow In general, in dev turn error reporting up to max, fix all the errors that you get in dev, then turn error reporting off in production. I rarely use error->exception conversion, it's just too messy
 
Anonymous
@Sparrow You should go for something more advanced. Like Node.js or websockets
 
Anonymous
I am no expert too.
 
user895378
@PeeHaa Then he answered it! Even worse!
 
11:38 PM
hehe
 
@DaveRandom I never used exception handlers inside php LOL
 
Anonymous
@DaveRandom Do you have any experience with Silex?
 
Nope, I plan to try it out at some point but I've not had a use case yet
I'm sure I could invent one but I have enough to do already :-P
 
@phpNoOBఠ_ఠ how did you owned AJAX chat room while you are not expert XD are you fooling me
 
Anonymous
@Sparrow Owning a room is a matter of thinking a name for it first, before somebody else does.
 
11:41 PM
@phpNoOBఠ_ఠ Please fix the room description, it's bugging me :-P
> If you like AJAX, you're welcome
 
LOL that means I can own ASSEMPLY chat room while I do not know anything about it @phpNoOBఠ_ఠ
 
Trust me, you don't want to start that room.
 
@DaveRandom come on I loved it it sonds friendl
y*
@DaveRandom LOL why ??
 
Anonymous
@DaveRandom think of a description for it
 
11:44 PM
@Sparrow It'll make you want to JMP in front of a train, or PUSH others in front of trains, one of the two
 
@phpNoOBఠ_ఠ @DaveRandom if you do not like ajax you are not welcomed -_-
 
@DaveRandom I can't really think of something sane atm :( I will give it some more thought tomorrow
 
@phpNoOBఠ_ఠ I've no problem with the description itself, only the typo :-P
 
@PeeHaa good question?
 
11:45 PM
@DaveRandom LOL assembly what is it for :D
 
Anonymous

AJAX

If you hate jQuery & like AJAX, You are welcome :)
 
@phpNoOBఠ_ఠ If you hate jQuery & like AJAX, You are welcome :)
actully I love jQuary :P @phpNoOBఠ_ఠ
 
@PeeHaa No worries. I'm thinking the "assign in constructor" approach is the only possible one actually - it's not really logic in a constuctor, it's just a property assignment. It will never be variable in any way, it simply gains the ability to evaluate expressions (which are still comprised entirely of constants). It is a little opaque to hide it in a method but I just can't see any other way apart from hardcoding the numerics, which I really don't want to do
 
Anonymous
@Sparrow I have nothing against jQuary, I hate only jQuery :)
 
Anonymous
@Sparrow So, what do you do btw? r u Web designer
 
11:49 PM
@phpNoOBఠ_ఠ but it is simple and lovely and makes great effects
 
@DaveRandom I was thinking about valueobjects maybe, but I'[m not sure
 
@rdlowrey Any thoughts on this actually? Essentially what I want to do is 3v4l.org/Lm3cQ, and I want to declare it as a mask of constants rather than as the numeric end result, but PHP won't let me do it at compile time at the class level
 
Anonymous
jQuery is bad for your potentials
 
@phpNoOBఠ_ఠ I am IT student and I am taking this semester web programming course and it I loved it the most
 
@PeeHaa I'm not sure how that would solve it. The structure still has to be defined somewhere in order to create them
 
11:51 PM
@phpNoOBఠ_ఠ can you imagine that is is only one course and we take almost everything on it
 
yeah true
 
Anonymous
@Sparrow What are you learning?
 
Anonymous
Which langs?
 
user895378
@DaveRandom I've been frustrated by that before as well. I haven't personally found a good way to work around the problem.
 
@phpNoOBఠ_ఠ HTML CSS PHP JAVASCRIPT XML all that in two months and a half :3
@phpNoOBఠ_ఠ I fucking hate XML useless
 
Anonymous
11:54 PM
Same here. XML sucks. I hate it. I try learn JSON / YAML
 
Anonymous
Actually, there isn't much to learn about yaml
 
I think XML is less relevent than when I was at uni
 
I think databases is more than enough
 
Anonymous
^ same here.
 
Fack it, I'm just going to put it in a method and call it in the constructor. If anyone thinks of a better way I'll gladly listen
 
11:56 PM
@Sparrow design rather than implemtation
 
user895378
@DaveRandom I've considered doing something like this but always ended up avoiding it in the end for one reason or another:
 
user895378
<?php
const B = 1;
const C = 2;

abstract class A {
    private static $var;
    static final function getVal() {
        return isset(self::$var) ?: (self::$var = B | C);
    }
}
 
@marabutt XML is not for design it is for holding data
 
Anonymous
@DaveRandom give me 4 years.
 
@Sparrow databases not xml
 
11:57 PM
So I'm setting up a PHP class to use the Google Closure Compiler API and the docs say this developers.google.com/closure/compiler/docs/… If the hash in the URL is static, how are they preventing name collisions?
 
@marabutt both are for holding data
@marabutt do you mean XHTML
 
@rdlowrey that will always return bool(true) after the first call ;-)
 
user895378
@DaveRandom woops, bad logic, but you know what I mean :)
 
@Sparrow no i mean it is more im[portant to learn how databases work
 
:-P
Right, with that slightly depressing decision I'm bailing
nite @all
 
user895378
11:58 PM
later dude
 
@marabutt I learned a lot about that
 
what db are you taught
 
Anonymous
wait... @Sparrow You still have not learned about 1 database at-least?
 

« first day (991 days earlier)      last day (3972 days later) »