« first day (596 days earlier)      last day (4343 days later) » 
00:00 - 19:0019:00 - 00:00

12:06 AM
@tereško cool, didn't know about HTML5.
 
they basically made that valid , because everyone was doing it anyway
 
i see .. was not fun enough , so you decided to keep an eye on too
 
@tereško :)
 
ok .. now i am really off
 
12:14 AM
me too
too late.
gn8
 
later both
 
have fun
 
can any one help me with this problem please stackoverflow.com/questions/10865906/… I am getting an error
 
1:05 AM
anyone lurking ?
i have a question about PDO
 
What's the question?
 
    im wondering if this is how u tell it to update a field:

    		$stmt = $pdo->prepare("UPDATE users SET class=? WHERE uid= ? AND class= ?");
    		try {
    			$stmt->execute(array($array[0],$_SESSION['player'],0));
    		} catch (PDOException $e) {
    			echo $e -> getMessage();
    		}
wasn't sure if execute follows the ? in UPDATE clause or only the WHERE clause
 
@Dave Looks right to me
 
okay :) so as long as they follow the correct order they replace the "?"
 
yup. Or you could use named parameters:
$stmt = $pdo->prepare("UPDATE users SET class=:newclass WHERE uid= :uid AND class= :oldclass");
$stmt->execute(array(':newclass'=>$array[0], ':uid'=>$_SESSION['player'], ':oldclass'=>0));
 
1:10 AM
nah too much typing :P
 
its already enough to type the try catch all the time
 
You don't need to catch exception every time you do a query
You can catch them at a higher level
 
where would the best place be to put it
 
depends on your setup
 
1:17 AM
	try {
		$pdo = new PDO($dsn, $user, $password);

	} catch (PDOException $e) {
		echo 'Connection failed: ' . $e->getMessage();
		exit;
	}

	$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
thats my connect script
and well u saw my query style other than that - nothing
 
catch them at the top level
whereever your app says "things have gone terrible wrong, display some error page"
 
where would the top level be :S ?
 
at that level you catch the pdo exceptions ;)
 
but surely id of had to have set my prepared statement first
 
what do you mean?
 
1:24 AM
my php error reporting is on the same page as the connect script
but in order to try catch a query the query has to be prepared first ? so if i put it in the same place as my php error reporter -- itll say statement don't exist yet
 
no, it doesn't have to be prepared first
you should read up a bit on exceptions (de2.php.net/exceptions)
 
well "prepared" is bit misleading of a word then :P
 
The prepare prepares the query, not the exceptoin
Actually putting the try / catch after the prepare won't capture exceptions thrown during preparing ^^
 
damn it >.<
 
2:14 AM
@NikiC @RepWhoringPeeHaa are named parameters a must for insert queries
because this seems to fail:

		$stmt = $pdo->prepare("INSERT INTO users (uid,name) VALUES (?,?)");
		try {
			$stmt->execute(array($_SESSION['player'],$result[1]));
		} catch (PDOException $e) {
			echo $e -> getMessage();
		}
 
looks right to me
if it doesn't throw an exception then your data is probably wrong ;)
but in any case, it's 4 am in the morning, I'm off to bed ;)
 
well i get this..
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''6'' at line 1
they really need to improve SQL error's there so unhelpful
ah wait its not that query
ok fixed it :)
makes sense now i realised it wasn't that query causing the error
 
 
4 hours later…
hola
 
6:56 AM
happy new day everybody!
 
7:25 AM
Hey
 
Good morning
 
7:57 AM
hey ;)
There's a good coffee in a good morning ;)
 
Sam
Morning guys
 
 
1 hour later…
10:09 AM
hi @Gordon
 
@hakre hi
@hakre will you be at Froscon?
 
morning
 
@tereško its noon :)
 
its just 1 in the sunday morning
 
@tereško am or pm?
 
10:20 AM
@Gordon I hope so.
 
@hakre say hello then when you meet me :)
 
I also should think about doing some talk, but not have managed it yet.
@Gordon sure ;)
 
@hakre the cfp is closed already though iirc
 
@Gordon I feared that :/. There is phpunconf HH one week later, so that has no CFP ;)
 
@Gordon , i can never remember .. the one that includes having sun
 
10:23 AM
he @tereško, you are from europe but non-british.
 
@hakre yes, its the week before though, isnt it?
 
yes , that is true for most of europeans
 
@tereško probably pm then. didnt know you live in GMT+2
@hakre ihope I dont miss the ticket sale. tickets are gone awfully fast
 
@Gordon me too. otherwise I need to become a sponsor^^
 
@tereško wut ?
on a cv campaign ?
 
night of noobs
 
yeah seems like it
 
12:27 PM
@Dave nopez you don't need to use named parameters
morning all
 
gods below ... it has began : stackoverflow.com/questions/10868781/…
 $sql = "INSERT INTO sitecontent (ID, postnaam, post_inhoud, pagina, publiceren)
        VALUES  ( '" . $_POST['id'] .  "',  '" .mysql_real_escape_string($_POST[naam]) ."', '" .mysql_real_escape_string($_POST[content]) . "' , '" .mysql_real_escape_string($_POST[pagina]). "' , '" .  $_POST['publiceren'].  "' )";
        $query = $con->exec($sql);
 
woah @tereško. Looks like I've got some work to do
 
> I'm using PDO PHP :)
@RepWhoringPeeHaa , thats from night's backlog
 
geez christ, stop using mysql_*, use PDO or mysqli
 
@hakre tnx
 
@tereško Thx for sharing.
 
=P
 
This is imho useless and should be deprecated.
 
@tereško Some reward for you: stackoverflow.com/questions/5863870/…
 
Using PDO like this is like buying a car, just so you can take the wheels off and put them on your bicycle. — Bracketworks 49 secs ago
 
1:06 PM
@Donut why do you think so?
 
Have you ever used it?
 
ticks, yes. encoding, no.
 
@hakre , which means that i will have to fix that old answer
 
1:22 PM
@tereško ;)
 
hmm .. this user might be a good additions to the php chat room
though i suspect that he/she might be multiple people
 
1:52 PM
4
Q: Is this question off-topic

RepWhoringPeeHaaI've just stumbled upon this question, which is IMHO off-topic on SO. But OP doesn't seem to agree: @JosephtheDreamer - I don't see the relevance. I did Google for it and didn't find it. I could ask this on uploadify forum, but I generally prefer to ask programming-related questions on SO and...

 
lucky you :D
 
3:38 PM
hi, what's a quick solution for obtaining a list of all sub-directories & sub-directory handles of a given directory?
 
ls -R ?
 
I am using $dirs = glob('*', GLOB_ONLYDIR); for obtaining my sub directories. Bu tI wish to also obtain the handle name of each.
@webarto Not linux, but PHP
 
public static function find_files($path, $pattern, &$result)
{
    $path = rtrim(str_replace("\\", "/", $path), '/') . '/*';
    $found = array();
    foreach (glob ($path) as $fullname)
    {
        if (is_dir($fullname))
        {
            self::find_files($fullname, $pattern, $result);
        }
        else if (preg_match($pattern, $fullname))
        {
            $result[] = $fullname;
        }
    }
}
enter '.' as pattern, or '*', dunno... should work, I've made that for file search (couldn't use shell)... actually, you'll want to remove preg_match part
 
yeah idk if that's what i'm wanting here
maybe it is but i don't understand this block.
i think im going to just loop through all directory paths obtained with glob. explode them by "/" and pop the last element off each array for the handle.
probably not the most efficient, but it works
 
@MichaelEcklund pokit.org/get/img/3b8182b1cba97907c9f3e594e8b41b55.png you want output similar to this?
you want all files from directory and all its subdirectories?
if your server has "find" command, you can make that it 2 lines
 
3:54 PM
@MichaelEcklund Use a recursive directory iterator and tell the depth you want to traverse. Job done. You can also filter for directories only if you like.
or exec find, lol, yeah.
 
exec is disabled
but this is what i'm trying to accomplish here
array(
'handle' => 'some-sub-directory',
'path' => '/some-path/some-sub-directory'
)
that would be returned results, based off the glob of a parent directory
 
@hakre and @webarto I figured it out. Just used glob for the parent file path. Retrieved all the the sub directory file paths. Looped through each of the sub directory file paths, exploded by "/" and array_popped the last element for the sub directory handle. Then returned both the path and the handle in the same array for each sub directory.
 
@MichaelEcklund take it easy: $handle = basename($path); no need to explode or such
 
4:07 PM
really?
i thought that only worked on filenames.
 
a directory is a file.
 
interesting
 
and a file a directory
or so
A path, the general form of a filename or of a directory name, specifies a unique location in a file system. A path points to a file system location by following the directory tree hierarchy expressed in a string of characters in which path components, separated by a delimiting character, represent each directory. The delimiting character is most commonly the slash ("/"), the backslash character ("\"), or colon (":"), though some operating systems may use a different delimiter. Paths are used extensively in computer science to represent the directory/file relationships common in modern op...
 
Learn something useful & new every day. Thanks man. Appreciate it.
 
NP. Found it in the PHP manual under filesystem
works even on URLs.
 
4:10 PM
Nifty! Well I just created a mental note. Will not forget. (:
 
Can you tell glob to skip over an array directories or files?
 
Sam
You guys think there is anything i can do to improve this question? I haven't got any answers or votes in 18 hours :(

http://stackoverflow.com/questions/10866098/google-maps-infobubble-pixeloffset
 
@Sam Add some bounty maybe someone will spend some love. Looks like a fiddle-question, so to solve your problem. A bounty might give some motivation. ;)
 
Sam
Good idea, ill need to wait until tomorrow to add some bounty unfortuntely. I was thinking it could have been too little information or something
 
4:25 PM
@Sam Well if you can create a test-case that can be easily opened in jsfiddle, that would be helpful as well.
Then I'd say it's a pretty perfect question.
 
Sam
Ok will do, cheers
 
user895378
@Sam You can also edit the question (in a meaningful way) which will bump it to the top of the "active" tab for its tags.
 
user895378
Which will make it more visible for a bit
 
user895378
Though with a very localized question for a random JS lib like "infoBubble" most people don't have any experience and can't be bothered to fiddle with code that you didn't write to make it fit your specific need :)
 
Sam
Yeh i understand it is quite a hard question to answer, perhaps a bounty will help as hakre suggested
 
4:29 PM
We can all upvote your question so it looks more important gg
 
Sam
Only upvote if you think it is a useful question, but if you do, thanks :)
I'm going to put together a test case online, as i need to load in a few JavaScript files
 
user895378
@Sam Without knowing anything about it, and just with one look, are you sure about the following line:
 
user895378
pixelOffset: new google.maps.Size(130, 120),
 
@Sam upvoted :D
 
user895378
are you sure that a new google.maps.Size object is going to be evaluated as a numerical value?
 
Sam
4:35 PM
@rdlowrey I am relatively sure. Using the normal google maps infowindow class it requires it in that format
 
user895378
Because I would expect pixelOffset to need an integer value ...
 
Sam
@Nick Thanks a bunch :D
 
user895378
okay, just making sure. You might try replacing that object with an integer to be sure that's not the problem.
 
Sam
@rdlowrey Ill try that whilst making the test case
 
posted on June 03, 2012 by Ilia Alshanetsky

For our database connections we PDO at work and we've extended the class with PHP to offer some other convenience functionality and wrappers. One of the things I wanted to do recently is allow the constructor of the PDO class to fail-over to our backup database connection pool in the event the primary was not available. The idea was to do something along the lines of: PHP: <?php cl

posted on June 03, 2012 by till

Here are some updates on my chef resource for composer: It started off with a PR where I was asked to include code that would download (and install) a composer.phar if none existed. Not a bad idea in general, but also not something I want to impose on anyone, so I decided to create a new action (or in chef-lingo goal) instead. setup Up until now, my php_composer resource supported :instal

 
user895378
4:42 PM
@Feeds This PDO feed is pointless. It would make way more sense to wrap calls to PDO ::__construct inside a ConnectionManager class in a try/catch block instead of extending PDO and hacking your own constant to change how the built-in PDO behaves.
 
@rdlowrey That's what happens when core devs have a problem that they don't know how to solve: They simply patch PHP :)
 
user895378
Then you could not only have a fallback connection, but also a ready-made solution for round-robin selection of database connections for a replication environment
 
user895378
@NikiC hehe
 
As some of you might know, I'm working on an ide (based in PHP :D)
Now, I've had a bit of an issue
Assuming my idea will be suggesting code (code autocompletion), I will have to parse various languages into a format I could easily use for autocompletion.
Say, a list of AutoComplete items with properties: $name, $type, $description, $link, $is_deprecated
 
Sam
I have updated with a test case for my question, cheers for the up-votes guys :)
 
4:52 PM
    as an example:

    name     type desc
    <script> ???? A tag used to add functionality to a website, either inline or through an external fie.
    color   ???? Sets the text color.
    red     ???? Another value for #FF0000.
In short, I'm not really sure how it should look like.
For example, should I have CSS 'red' as a separate item, or should it be the value of an existing item?
How can I get a reliable list of $type's across different languages (eg: a property in PHP would be similar to an attribute in XML)? Or should I distinguish the types by language type (php_property vs xml_attr)?
 
THE VICTORY IS OURS!
 
@NikiC , "Feeds" should be renamed to "Stream of disappointment"
 
@Christian, I suggest you look at the dtd's browsers use to parse html. You define types, elements and attributes there.
 
@NikiC It would be nice to see @tereško's canonical comment there :)
@NikiC isn't that the foundation of php?
 
5:30 PM
@NikiC O.o They just threw a warning on the first method?
@Truth I did already, but a "property" in a language apparently isn't the same thing in another.
 
@Christian the same warning will be added to all mysql_* functions soon.
With the suggested alternatives differing per function, obviously.
We already have them as "notes" lower in the page, but having a Big Red Box™ at the top will hopefully help encourage people away from them.
 
5:50 PM
@NikiC very cool. that's great if you don't know the new names, you can just go there and explore the changes! thank you ;)
@salathe if users come from SO and you see it in the referrer, please make it pop-out in some lightbox style ^^
 
like that? :)
 
@salathe Perfect
 
@hakre don't thank @NikiC, he did nothing. :P
 
@salathe that would be just fine :-)
With the side note that it would set your cat on fire
 
@salathe I announced it in the chatroom!!! :P
 
6:04 PM
 
Hahaha
 
lolwut
 
Phew, at least the chat is still alive.
 
SO went tits-up
 
Did Hancock break SO?!
 
6:07 PM
SO has tits?
 
@Bracketworks SO has man-boobs.
 
anybody else has this on SO? Server Error in '/' Application.
 
Uh oh, spaghetti-O's
 
yes , Jeff broke the StackOverflow .. keep calm
 
6:10 PM
broken broken broken
 
hakre +1
 
I didn't know SO was on aspx?!
 
Hopefully folks don't flood here to ask their questions.
 
well .. you cannot get to the chat .. and i doubt you can log in
 
6:11 PM
@tereško ? it works fine for me
 
stackoverflow.com dosen't load and shows the below message

Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory
 
because you know that there is chat.stackoverflow.com
 
(except the logging in part obviously)
 
@Truth truth hurts :P
 
Really? Wow that... Makes me kinda sad...
 
6:13 PM
yes, we all see the error message .. stop asking about it
 
Disaster averted, it's back up again. :D
 
Anyone got some suggestions to my issue?
 
ok but now site is open
 
@Truth highscalability.com/blog/2009/8/5/… SO is always quoted in ASP.NET vs X rants
 
@tereško Same, reddit always breaks
 
6:17 PM
@webarto Actually, SO uses PHP. But they're masquerading as ASP to thwart hackers into using IIS/ASP 'sploits when it's all PHP and Apache.
:D (hey, someone might quote me on that)
 
@Christian , int, float, string .. thats about it. PHP's "array" is actually closer to "hashmap"
 
Someone should invent and name a burger "int64". 64 bits' worth of burger.
 
00:00 - 19:0019:00 - 00:00

« first day (596 days earlier)      last day (4343 days later) »