« first day (1281 days earlier)      last day (3658 days later) » 
00:00 - 17:0017:00 - 23:00

12:06 AM
Should $_POST, itself be safe? @TOOTSKI
 
I have no idea.
I just came here to party.
 
lol
 
Best kfVsfOSbJY0 ever!!!
Kidding, truth is that I've spent Friday night scrubbing toilet.
 
Its kind of a serious question...
 
Kitchen, bathroom, hallway...
Tomorrow I have to clean the windows.
I'm serious too.
 
12:11 AM
About which part?
 
About the toilet.
 
Well can you please tell me if it would be safe?
 
No.
 
Should i use mysql_real_escape_string?
 
No.
 
12:13 AM
How would you do it?
 
Depends on where will $_POST end up.
 
Well I'm trying to do a form. I'm doing $name=$_POST['name'];
 
I've had enough of today ...
nite chaps ...
 
Then you're probably looking for htmlspecialchars if you're going to output it as HTML.
@JoeWatkins Farewell, Sir. Night.
 
Could I do it via PDO?
Night @JoeWatkins
 
12:15 AM
Yes.
 
Do you know what that would look like?
 
I have no idea to be honest.
 
So using htmlspecialchars should be good enough for a form?
 
@Colourity If you're outputting data to an HTML context and want it to render as plain text, escape it with htmlspecialchars
 
12:45 AM
Couldn't I just use mysqli_real_escape_string?
 
@Colourity escaping is all about contexts
 
So $name = htmlspecialchars($_POST['name']); should be good?
 
your text is a mere sequence of characters, the context is what gives those characters special meaning
Outputting arbitrary data to a HTML page should be escaped with htmlspecialchars, concatenating arbitrary data into a mysql query should be escaped with real_escape_string (or use prepared statements)
Each context has a proper escaping method
 
So when sending to my database I should use real_escape_string?
 
yes, though prepared statements are easier to write and maintain, the escaping is handled automatically when using prepared statements properly
 
12:50 AM
Well when I use PDO for my database connection I get Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, object given in /Users/idrisk/Colourity/s/r.php on line 4
This is line 4 $name = mysqli_real_escape_string($con,$_POST['name']);
 
Yeah, don't mix up different db driver extensions
 
So what would my post look like then?
 
if you're using PDO, you can prepare a query then execute it or bindParam, sec
 
$name = pdo_real_escape_string($con,$_POST['name']);?
 
you won't need to manually escape it if you pass the $_POST['name'] into ->execute(array($_POST['name'])) or bindValue/bindParam
 
12:53 AM
So $_POST['name'] into ->execute(array($_POST['name']) should be good enough?
 
yeah, remember to prepare the statement first and you should be good to go
the joy of prepared statements is not having to escape things manually =]
 
aha
Parse error: syntax error, unexpected 'into' (T_STRING) in /Users/idrisk/Colourity/s/r.php on line 4
Line 4: $name = $_POST['name'] into ->execute(array($_POST['name']);
 
erm man
read the step by step guide stackoverflow.com/tags/pdo/info lol
 
Good point. Clicked on the link and still have it in my tab.
 
you need to instantiate a PDO connection and use it to prepare a statement, then you can call the execute method on the prepared statement
the first two code blocks in that page should illustrate it
 
12:56 AM
My connection is good
Still don't see how PDO makes sense....
 
$pdo = new PDO(....); instantiates a connection
 
Well I have my connection to the database. I just don't see how my form would work. Is there supposed to be $_POST in PDO?
 
$stmt = $pdo->prepare('SELECT * FROM tbl WHERE name = ?'); returns a prepared statement
$stmt->execute(array($_POST['name'])); executes the statement passing the array values into the prepared statement's placeholders
then you can fetch results with $stmt->fetch() or fetchAll
I can't really explain it better than the page I've linked though
 
Alright, thanks
 
1:31 AM
Greetings
I'm getting some errors with PDO
Like "call to a member function by a non object"
 
@FabrícioMatté Give up :)
 
JK guys
Sorry, fixed it
 
@TOOTSKI well yeah, the other guy already left apparently
 
Haven't seen you before here. Welcome.
 
Oh, I popup here once in a blue moon
thanks anyway =]
 
1:40 AM
I see, I suck at deciphering these chat stats.
 
Same, I have no "frequent rooms" in my profile
probably because I haven't used the chat in a month or two
procrastinated the whole day, guess I should finish writing this style guide
 
 
3 hours later…
4:20 AM
anyone here
I am trying to write a xml file, for the registration. I done this, but I cant able to add more users, its just overwrite the existing datas in XML.


My php file is. (register.php)

$users [] = array(
	'name' => $post_name
);

$doc = new DOMDocument();
$doc->formatOutput = true;

$r = $doc->createElement("users");
$doc->appendChild($r);
foreach($users as $user)
{
	$b = $doc->createElement("user");
	$name = $doc->createElement("name");
	$name->appendChild(
		$doc->createTextNode($user['name'])
	);
 
4:40 AM
Oi.
I am so drunk.
 
@DanLugg why?
 
Because I accidentally consumed a great quantity of alcohol on purpose.
5
 
Good. Me 2.
 
lolwhe3eeee
 
ss
 
 
1 hour later…
6:11 AM
morning @all
 
nice weekend everyone!
 
6:44 AM
Write something :/ I want to read
 
7:14 AM
@ircmaxell I know how we can do runtime traits ...
 
7:33 AM
morenzinhn
 
8:16 AM
@JoeWatkins even if we can - why?
 
 
1 hour later…
10:30 AM
Morning
 
don't star randomly. please
morning, @Fabien
 
mornign
 
10:47 AM
hi everyone.... happy weekend. good morning
I am trying to write XML file. But I troubled with the alignment. I tried it using stackoverflow.com/questions/8615422/…
but no change, I am getting same as the unaligned XML
any1 can help me pls?
 
12:06 PM
@AmalMurali LOL, kinda.
Morning btw
 
Hi
Could anyone recommend any good and easy to use asset component? Maybe from some existing frameworks?
 
Hi, can anyone tell me, how to convert my php project to .exe file???????
 
@AbdUlAziz Some classes seem to ancient. :)
 
Also, CI.
 
12:20 PM
@Leri which classes ?
 
@Illaya Yes. Press F2 and replace .php with .exe
 
lol
 
@Leri are you joking?
 
@Illaya rewrite it in C, then compile
 
12:22 PM
@Illaya Yes!
 
-_-
 
@CSᵠ this is a big project, then how??
 
@Fabien :Ь
 
@Illaya slow and steady, is the only way...
 
@Illaya What are you trying to do?
 
12:24 PM
Don't create big project in language you don't need
 
btw, nothing's big, it just looks that way
 
@Leri nice joke. but I can't smile
 
Ever?
 
@Leri am trying a game. I just want it as .exe file
@Fabien yeah
 
it must be that disease..
 
12:25 PM
@Illaya You can't turn a php file in to an exe
 
@Illaya wut?
 
Möbius syndrome (also spelled Moebius) is an extremely rare congenital neurological disorder which is characterized by facial paralysis and the inability to move the eyes from side to side. Most people with Möbius syndrome are born with complete facial paralysis and cannot close their eyes or form facial expressions. Limb and chest wall abnormalities sometimes occur with the syndrome. People with Möbius syndrome have normal intelligence, although their lack of facial expression is sometimes incorrectly taken to be due to dullness or unfriendliness. It is named for Paul Julius Möbius, a neu...
 
@Fabien just try this exeoutput.com
 
@CSᵠ this is one extreme poker face
 
@Eugene oooh yeah!
@Illaya you're joking right?
wth is exeoutput ????
 
12:28 PM
@CSᵠ using this software I got an exe file
 
> From their perspective, they're running a web browser that displays your PHP pages, as if these pages were hosted on a remote server.
:)
 
afaik HHVM is the only thing that could so something like that..
@Illaya just make an exe file that's a sortcut to a browser running in kiosk mode... and opens up your 'webpage'
 
@CSᵠ ok
 
HipHop for PHP (shortened as HipHop) describes a series of PHP execution engines and improvements created by Facebook. The original motivation of HipHop was to save resources on Facebook servers, given the large PHP codebase of facebook.com. As development of HipHop progressed, it was realised that HipHop could substantially increase the speed of PHP applications in general. Increases in web page generation throughput by factors of up to 6 have been observed over Zend PHP. A stated goal of HipHop is to provide a high level of compatibility for Zend PHP, where most Zend-based PHP programs r...
 
@Illaya Seriously, this is the closest thing you want. However, I would not recommend using it for real-world.
 
12:36 PM
you can turn php code into an executable file on unix and windows
the embed sapi is kinda for that, well, it's to embed an interpreter into an application, then it's just a matter of injecting php code into the resource section of the executable - they all have this ... then you have your self contained executable php script with embedded runtime ...
it's rarely useful, so tooling isn't great ... if someone came up with a good use case, I'd write it ... again ...
 
-.-
 
also, I'll assume you're on windows, gtk is dead, theres another project named winbinder, it is also dead, however it is much much simpler and works with modern php ... and you can multithread applications with wb+pthreads ... but this is like black magic stuff, there's like me and one other guy that even bothers with this sort of thing so there's no help out there at all ... as you can see ^
@Illaya all of that ^
 
@JoeWatkins Do you really believe that one day someone will be programming windows/linux/android/etc. application with php? It would be great but... php is not designed for that.
 
Wooho, formatted PC
Windows installed, Ubuntu 14.04 once Windows finishes the initial batch of updates
 
Nothing like a nice clean format
 
12:47 PM
Yup
 
@Fabien And the feeling that you've lost important files next day :D
 
Although I'm sure I forgot to back up at least 5 different things
 
nope ... it's monkey on a bike stuff; cool to watch for about 5 minutes, then you feel sorry for the monkey ...
 
Remembered to back everything up? :D
 
But meh.
 
12:47 PM
@Leri lol yes. I'e lost a fair few to formats :P
tbh I store all my web files in My Butt these days. Important files on my 1TB. I have two SSDs, one with windows one with Ubuntu. So I only really lose applications these days.
 
@Leri note that java was never designed to do all those things, and is used for all those things and more today, php is what we make it ... just like java is ... when java wasn't suitable for android they just changed the executor, I see no problem with us doing that, it's what we have been doing since the language intended to make writing guest lists easier was invented ...
 
Heh, needs to reinstall the cv-pls plugin
 
Hey guys, why this url /css/reset.css not working, doesn't the first forward slash mean start from root?
 
@Almis Root of the URL, yes.
This resolves to
example.com/css/reset.css
Not to the physical /css/reset.css on the server
 
Oh I think my problem is that my url is like this localhost/myproject/css/reset.css I must change document root
 
12:53 PM
@Almis So you want /myproject/css/reset.css
Or create a subdomain (like myproject.localhost) by configuring your hosts file + the web server.
 
@SecondRikudo I liked the idea with subdomain, thank you
 
@Almis yw :)
114 out of 141 updates :|
And I'm pretty sure it hasn't done any of the service pack crap yet :\
 
@JoeWatkins Fair enough. And indeed, I'd love to see php on many platforms but... is php community ready for that? Are those wordpress developers (who barely understand what they do) able to write multithreaded mobile-apps?
 
@SecondRikudo 7 or 8?
 
@Fabien 7
I'm not going to use it that much, and I don't want the extra learning curve.
@JoeWatkins You're misunderstanding the mainstream usage of PHP.
 
12:57 PM
@Leri 1: Maybe; 2: No.
 
41 mins ago, by Eugene
Could anyone recommend any good and easy to use asset component? Maybe from some existing frameworks?
 
@SecondRikudo I find myself switching oddly between. I only boot Ubuntu for when I plan on doing work. Everything else is Windows.
Web browsing and all
 
@Eugene What's an "asset component"?
 
@CSᵠ Exactly! Will those try to do that? I guess, they will.
 
@Fabien I'm the exact opposite.
I use Ubuntu for practically anything, and Windows only for gaming/photoshop
 
12:59 PM
And that would result in mess... That would make language's reputation even worse.
 
Web browsing feels a bit stiffer on Ubuntu for me.
 
@Fabien "Stiffer"?
 
@SecondRikudo that's the best usecase (and browsing is safer on *nix)
 
Like the scroll is not as smooth. Things like that.
Switching windows on my tri-monitors is a bit wanky too. but maybe there's a gui I am missing.
 
1:00 PM
@Fabien Maybe your graphic driver isn't installed properly.
Because I like browsing in Ubuntu better than I do Windows.
 
Maybe. I'll take a look when I next boot it back up
 
@Fabien sometimes confs can be trickier with that setup... but you can have it safely
 
I have a GTX 580
 
@SecondRikudo some (i.e. framework) component, that handles assets? Assets in projects are usually images, css files, javascript files and stuff like that.
 
btw @SecondRikudo I started watching 'Space Brothers'. I like it.
 
1:03 PM
@Fabien Don't have much time or brainpower to start a new anime XD
What's it about though?
 
Two brothers becoming astronauts.
 
1:13 PM
@SecondRikudo everything working, thank you again :)
 
1:25 PM
@SecondRikudo read what I wrote before that sentence ...
39 mins ago, by Joe Watkins
nope ... it's monkey on a bike stuff; cool to watch for about 5 minutes, then you feel sorry for the monkey ...
 
136 out of 141...
 
@PeeHaa, first of all, what do you mean by "halp is not working". And second, people like you are disgusting! Not constructive, and get a hard-on for nitpicking. Get a life! — Brain 16 mins ago
 
@PeeHaa He has a point you know... Instead of posting a cynical remark and leave, you could have advised him how to improve his question.
 
@SecondRikudo I pointed him in the right direction me thinks
 
public function isXHR() {
    return (!empty($this->getRequestedWith())) && $this->getRequestedWith() == "xmlhttprequest";
}
Excepted: Variable
Is phpStorm trolling me lol
 
is there anyone who had experience with developing realtime systems ?
 
I believe @PeeHaa - he wrote a chat server in PHP
 
@user3123545 Okay
@p
@PeeHaa Are you there ?
 
yo what's up @Gopi
 
i have a question for you ?, shall i shoot now ?
 
Sure
 
-_-
 
i just want to know the architecture behind sites like scorespro.com
how they will collect and broadcast scores
in realtime
 
2:29 PM
It's just an ajax script called every minute
look in the network waterfall
 
@Gopi That's not really realtime ;)
 
@Fabien i think you misunderstood my question
 
I don't think so.
 
@Gopi Basically what @Fabien said. They just poll every x seconds requestable.pieterhordijk.com/8cCuvc
 
Unless you're talking about the act of scraping the scores and not how they update the site without refreshing.
 
2:32 PM
@PeeHaa Just want to know how they will update the scores immediately
 
If you really want realtime you should look into using websockets
 
-_-
 
@Gopi They don't
 
@PeeHaa i agree with you, i'm asking about how they will get the data and feed into their system
@PeeHaa i will show you an example
 
k
 
@Fabien i'm asking about how they will collect the data
@PeeHaa Check this one litzscore.com
 
Why not email and ask them? They either have someone manually enter it. use another service for it or scrape it from some sites.
 
@Fabien You mean like watching the sport on TV and manually entering it into the system ?
 
I am agree with @Fabien. Where they get their data from is impossible to tell without insider info
 
Potentially
scorespro.com/about is probably the closest you'll come to finding out without asking them.
 
2:39 PM
@PeeHaa I know this may seem stupid, is there any algorithm out there for these type of systems.
 
No there is not.
If there was an algo for that people would have been rich by betting on games ;)
 
@PeeHaa Okay Thanks
@PeeHaa Another question
 
Shoot
 
Have you developed any systems with SOLID patterns ?
 
All of them
 
2:43 PM
i mean SOLID principles
 
Yeah it's somewhat a rule of thumb
 
And with design patterns
I just learned these stuffs, but i don't know how put these into use
 
When you understand them you'll know when to use them. It just takes some time and experience.
 
The aim should never be to use pattern x
The aim should be solving problems
If you thought you solved a problem and it bites you in the ass later you have chosen the wrong solution :)
 
@Fabien My problem is i don't know when to use.
 
2:46 PM
Imho it's a matter of seeing a problem and knowing by experience how to likely solve it @Gopi
 
Lets say for example a simple CMS with auth and articles with comments
what do you think the best approach.
 
That is not one single problem to be solved. That will be multiple "problems"
Also it depends on the requirements of said cms
 
i often limit myself with factories and singleton
 
Hnnnng
 
I limit myself when using singletons too. I limit myself to exactly 0.
 
2:50 PM
lol
 
lol nice 1 @LeviMorrison
 
lol
 
Do you do unit tests and have you worked on any system remotely larger? @Gopi
 
Hello every one!
I am developing an application for a client. He has a college, in which there are many classes. Now the question is, what should I chose the name of the entity `class` (this being reserved by php, can't be used)! Any suggestions, what should I name the `class`?
 
No i never adopted that in my workflow
 
2:53 PM
I was thinking of `klass` or `Clas` or `Classs` but that would seem a bit odd!! :-?
Any suggestions would be highly appreciated :D
 
:P
 
You use PHPUnit ?
 
@Gopi naah!
 
Only thing that pops up is Group but that's also lame
@Gopi yes
 
@PeeHaa yeah it is..
 
2:59 PM
@PeeHaa Would please suggest good practices and principles that need to followed while developing a larger system
@PeeHaa Learning Resource would be better
 
@Gopi My best suggestion would be to start unit testing your code. Most issues will become painfully visible once you start doing that
Have you seen these yet? @Gopi
 
@PeeHaa i spent most of the life in customizing stuff Magento, Joomla etc...
 
I'm sorry for you :)
 
@PeeHaa No didn't
@PeeHaa these things really sucks i don't want to do that anymore
 
I can imagine that
 
3:04 PM
@PeeHaa You know how to document a system ?
 
/me hates his job Everybody has holidays but my company. -.-
I don't even mention that I have to work on Saturday.
 
You're UK no?
 
No. I.e. we do outsource from UK but not in UK
This is my current company but technical support is in Georgia.
Okay, I'll break whole build and see you later.
 
3:37 PM
@Leri I even not sure if I should troll you about your Saturday working day :\
 
3:54 PM
@AlmaDo Don't even dare. :Ь
BTW, did you pass your exam?
 
@Gopi What do you mean by document?
 
@PeeHaa stuffs like UML etc...
 
e'nin
 
@Gopi I am in the situation lately with a lot of changing requirements. So that's not really useful for me :D
@JoeWatkins Evening mr Watkins!
 
@AlmaDo re: why would we want that ... chat.stackoverflow.com/transcript/message/15862706#15862706
apparently, it's a standard part of traits that we don't have ...
 
4:01 PM
Hey Joe
 
yo @Fab, @PeeHaa, all
 
@Gopi Learning from you. what is your git workflow i'm asking about the branching stuff
 
It seems working with this is more harder than writing peo queries i think In ZEND
// Build this query:
//   SELECT *
//   FROM "table1"
//   JOIN "table2"
//   ON "table1".column1 = "table2".column1
//   WHERE column2 = 'foo'

$select = $db->select()
             ->from('table1')
             ->joinUsing('table2', 'column1')
             ->where('column2 = ?', 'foo');
 
@PeeHaa Learning from you. what is your git workflow i'm asking about the branching stuff
 
Depends on the project. On larger live projects I mostly work on a feature branch
 
4:03 PM
anybody have an answer for my question ?
 
@Leri so! you're looser since working at Saturday :D
@JoeWatkins oh, it seems I misunderstood original dialog :p
 
@PeeHaa You mean like master -> feature1 , feature2 etc... and then merge the feature to master ?
 
@Gopi yeah exactly. That way I don't get in the way of releases when I'm not finished with feature x
 
@AlmaDo Guess what I want to do right now. -.-
 
@Leri you want to work tomorrow?
 
4:07 PM
@AlmaDo If that means sleeping until midday and getting prepared for interview at another company to get started in normal environment, then yes!
 
@PeeHaa You also use CI tool, which you think is the best ?, i myself tried jenkins not so cool
 
@Gopi For open source projects @ github I use scrutinizer. At the job we use jenkins
scrutinizer is pretty awesome
 
@PeeHaa For deployment capistrano or something else
 
@Gopi I try to stay away from anything ruby :)
I use just some shell scipts
 
@PeeHaa Capistrano is nice i never tried to code the deployment script on my own.
 
4:19 PM
@daverandom ^ your new project
 
His list is pretty big too
Winamp is discontinued now too :(. It really whipped the llamas ass.
 
4:34 PM
Where do you guys generally put your /www folder in a local environment (linux)?
 
On my own machines I put it in /srv
 
/var
but I have no reason for this
 
en.wikipedia.org/wiki/Unix_filesystem -> reason for /var is there ...
 
@Leri how your job search goes?
 
/srv makes sense
 
4:44 PM
So... centOs doesn't officially support php 5.5 yet
 
@SecondRikudo usually to /var mount (i.e. same partition as /var)
 
their latest 'stable' release is 5.4.something
 
@CSᵠ I use Slackware. Thus, it supports everything that I want to compile :p
 
@CSᵠ If you want something newer use remi's repo
 
@PeeHaa i can install it, but it's not listed as stable
had a nice talk with the sysadmin :)
@AlmaDo for servers?
 
4:47 PM
@CSᵠ well, no. Debian for servers. Some staging servers are in Slackware, but there you need in general to maintain all soft manually - so Debian for me is better for servers. However, new versions of distro support all auto-upgrades/installs (i.e. packages) - but it's not so popular, that's why sometimes it's neede to create packages - again, manually :\
here's great storage - slackbuilds.org - but yet again, it's possible to create packages from .rpm for example
 
@AlmaDo debian would be a good choice, but centos is more widespread for servers
 
@AlmaDo Nothing that worth applying locally. On careers I've applied booking.com's vacancy. I hope I won't be ignored.
 
at lease for VPS
 
I don't know. I just always used Slackware - so it's a habit. For local server it's best choice, I think - because you must control everything if you want it working well :p
@Leri good luck with that (:
 
i use ubuntu for dev pc and dev local server, easiest...
 
4:51 PM
@AlmaDo Thanks. ;)
 
only Slackware, only hardcore :p (Gentoo is from same opera :p )
 
hehe
still kinda true :)
 
working with it since 8.0 version. Now it's 14.x Btw, GUI network control appeared only in 14.x (:
but still route + ifconfig + iptables is unbeatable
 
What's the difference between php5-fpm and php5?
 
00:00 - 17:0017:00 - 23:00

« first day (1281 days earlier)      last day (3658 days later) »