« first day (620 days earlier)      last day (4325 days later) » 

12:00 PM
@ircmaxell Code-freeze?
 
beta
 
Wait, there's PHP 5.5?! :D
 
not yet
 
Any scheduled features?
 
yes, look at trunk
 
Sem
12:05 PM
@ircmaxell Any plugins you recommend for Netbeans?
 
@Christian many, but only scheduled ^^
 
@NikiC Hope there's one on the lines of "make PHP suck less"
 
-3
A: is there any difference between these two ways of outputing html content with php performance wise?

Eoghanexiting and entering php constantly is both bad practice, and does indeed detract from efficiency - I would recommend avoiding it where possible. Having php echo back HTML is far better than entering and leaving php interpretation mode.

 
I'd love the ability to overwrite named functions. Or, having global scope less rigid, so we could even clear it if we wanted to.
 
@ircmaxell Nope, don't know
I hope it's still a bit away
@Christian huh?
 
12:09 PM
@PeeHaa Fail. :D
@NikiC Well, in JS, it would be: window = {}; // muhahaha
 
@Christian Yes and people love JS for that /sarcasm
 
Right now, if you throw something in global scope (or especially someone else), you can't change anything. You're stuck with that state.
 
@Christian So, why do you think everyone tells you to stop using globals?
Could it be because globals are evil?
Probably not. People just say that cause they have nothing to do!
 
@NikiC Tell that to wordpress. Or uhm, pretty much 99% of software written in PHP.
 
12:12 PM
@Christian Don't forget that 99% is what the amount of bad developers is usually estimated at
 
@NikiC That's not the point.
The point is, if they allowed a stupid feature (global scope) in the first place; it would make sense to at least provide a way to get around the mess.
 
how would that look?
 
unset(the_title); // wp crap
 
and how would you prevent something silly like: function overloads crypt($password, $hash) { return $hash; }
 
Sem
@NikiC I prefer the word messy over bad there.
 
12:15 PM
@Sem I'm not a fan of euphemisms.
 
lol, we both ping Pierre within minutes of each other
 
@ircmaxell Prevent? Why do you want to prevent it? How do you prevent die(); // unintentional blank page?
 
no, it's more about malicious uses (whether the though was sound or not). There are functions and classes that exist that are expected to work one way if defined. Now, it's possible to overwrite them with completely different functionality? That's not good
 
Sem
@nikiC I'm not trying to be subtle but more precise. You're a bad programmer when you don't know how to organize your code.
 
@ircmaxell OK, I get it. I'm not sure I should be really concerned though.
 
12:19 PM
@Christian Runkit
 
kill the global scope!
 
@Leigh It doesn't work.
 
Now go break your app
 
@Leigh :D
 
@ircmaxell yeah ^^
 
12:20 PM
@Christian I can give you some code to change the names of internal functions that does work if you want. My first experiment developing PHP modules was "rename_function" (before I even knew runkit existed)
 
@Sem No, you're a bad programmer if you are bad at being a programmer. Code organization is just one (and I'd say rather unimportant) aspect of it.
 
can you guys recommend me a lightweight, solid mini framework for php?
 
no
 
@DanLee I quite like debian/nginx/php-fpm.. I find its lightweight and solid, a perfect framework for PHP
 
for reverse engineering purposes
i laughed
 
12:23 PM
poor you :(
 
smells like #php
 
Sem
@NikiC In my opinion it's easier to create something than maintenance.
 
@Sem Sure
 
Back to work. Cya later guys.
 
Sem
@NikiC No sirously, 99% of all programmers are bad programmers because they're bad at being a programmer. Nothing else?
 
12:28 PM
i think that's probably an inflated number because a lot of experienced programmers forget their roots.. example: you wouldn't call a new born bad at life because they're unable to feed and take care of themselves. they're inexperienced :]
 
Anyone know of a static blog generator in php? sorry let me correct myself, a good one.
 
@ircmaxell: Wasn't salsa 20/8 recently removed?
 
@CarrieKendall That's fair on the surface. But a professional developer with 5+ years of experience still programming like that is definitely experienced enough to know better. And if their not, that's because they are bad at it
@Leigh salsa 20 was. Salsa 20/8 was never there
 
doesn't even have to be finished... I just like a reference point
 
@Sem , most of people who identify themselves as "programmers" are not
 
12:31 PM
Whats a good and small php framework?
Really small
single page website
 
pure php
 
PHP <--
@ircmaxell fair enough
 
you dont need a framework, to make a simple single-page website
 
If you use a framework, it wont be single page will it
;D
 
But i need some templates and routing too.. Cause even if its single page i will still support url both for non js users and Google
 
12:32 PM
@designer . frameworks are not some magic dust that you can sprinkle on top of code tho "make it better"
 
so download a template engine and write a router
 
uh, you know that's completely possibly without a framework?
 
Sem
@tereško some people just want to type $this->generatePageWithSprinkles();
 
if there is a single page , what is the point of routing ?
@designer , as for templating, read this : codeangel.org/articles/simple-php-template-engine.html
 
@tereško cause i will need some better SEO than a single page with only hash allows me to do
so i load it together with JS if its allowed
 
12:34 PM
@ircmaxell when you reference 'professional developer' do you mean getting paid or specified as such by some merit?
 
@designer i think you have either strange definition of "simple" or "single"
.. i am not sure which
 
Sem
@tereško What do you think seperates programmers from non-programmers?
 
@Sem , ability to solve problems independently
 
@CarrieKendall either getting paid, or contributing significantly to a major open source project
 
@ROOM I was helping @designer in the js room yesterday. His single page site will not allow google et al to index his named anchor "pages" so he is splitting them out into other pages.
 
Sem
12:36 PM
@tereško Without using the internet?
 
@tereško so I want something like this: intuio.at/en however i still want the content to come from different individual pages so i can put it together with JS
 
@designer I don't think you need so much routing but mod_rewrite
 
@rlemon exactly
 
@Sem , without copy-pasting from internet .. there is a significant difference
 
you just want something.com/content/somethingElse.html to look like somthing.com/coolName amiright?
 
12:37 PM
@rlemon hmm I've been thinking about this for a while.. cause i still want a general header and footer? and also, if i get with ajax i don't want the header and footer - which works just fine now in simple php
 
@designer like I said before... ugh you know what give me 10 minutes i'm just going to make you an example while my coffee cools a bit
 
But then i realized i also wanted a index page to get all the content with php - so i still got it all together, and realized everything would be easier with a template engine
 
why is making sense an option :[
 
@rlemon Cool! Just show me something done quickly, so i get a clue and then being able to make the rest
@rlemon thank you once again :)
 
Sem
12:40 PM
@tereško Fair enough. Some frameworks are on the border of that line then.
 
@rlemon , i hope you have read slash7.com/pages/vampires , because this seems like a classic case
 
@tereško not really, I've done quite a lot of thinking my self.. i wanna do this the right way and had a talk with @rlemon yesterday trying to figure out a way (none I could find described before). Both making it SEO friendly and JS nice.
 
Guys, I edited a question to remove links to pirate content, and the OP has edited them back in, is there a way for someone with mod powers to prevent further edits?
Or should I reach for the flag
 
@Leigh try chatting with the OP. I tried it before and then explained why i wanted the links either removed or edited and then he did.
 
12:48 PM
@Leigh Link?
 
1
Q: How does the backend of these types of websites work?

GriffI am building my own torrent site and after doing some research I have noticed that alot of the sites out there including, http://torrentz.eu http://bitsnoop.com Most of the pages are static and are not dynamically generated on the fly (as the pages end in .html). Thinking about it makes sense...

his 2nd set of links go directly to pirate content to download
 
Before learning Php, I am studying on Html. I know some of you are more experienced. For this reason, I want ask the following question "can you recommend me website, tutorial or book which constains hard task ( like project assignment) in order to improve my knowlegde on html ?" Thanks
 
@Leigh Is linking to a site which links to infringing content illegal?
 
@user1428237 i wouldn't recommend books. But thats just me, i love reading about academic stuff but not development stuff. Try giving it a try yourself and read some basic tutorials online. Just try a lot of stuff. Find a webpage you like and try designing it the same way so you get around all those html tags.
 
Sem
12:52 PM
@user1428237 right click -> inspect element.
 
@PeeHaa It links to a page where the sole purpose of that page is to download a torrent for pirated content
 
@Leigh Let's send a DMCA request to SO ;)
 
@PeeHaa I think we need to post more pictures of half-naked wenches on SO so it gets banned in India
6
 
@Leigh hahahaha
But serious that's a fucking great idea
 
I do not have internet at home. Thus, I want hard exercise. Do you know any place where I can download ?
 
12:57 PM
@PeeHaa I guess I'll take the link -> link -> piracy question to meta
@user1428237 Tried a library?
 
@rlemon talk to me :) you should only give me guidance, not 1k lines of finished code
 
it's not 1k
its friggin 9 lines of jQuery
and it's being a biatch
 
But I think I will still have the PHP question after all? :) if its only jQuery you are doing now, but maybe not.. oh you are probably doing the load('page #element')
 
@designer ok so I forgot the bit about changing the active class via js when you 'load' the content in and click the links but you get the idea. rlemon.net63.net/designer
each page is it's own... I simply load them all into the main page
now in the url if you goto foo.html or bar.html directly they have the exact same js code to load the rest of the pages around them
all page then serve with hash navigation
SEO win
UX win
no need to touch php
hehe the worst part about setting that example up was remembering my damn 000webhosts password :P
 
@rlemon thats cool!
@rlemon so #/foo.html will work without JS
 
1:12 PM
@rlemon That twitter bootstrap definitely helps keep things pretty looking.
 
@rlemon and i guess people without JS still will get foo on: foo.html#index.html
@rlemon sorry to annoy you, but how does you actually reuse anything here? i mean, wheres your header and stuff? in every file?
 
@designer disable js and try :)
http://rlemon.net63.net/designer/index.html
http://rlemon.net63.net/designer/foo.html
http://rlemon.net63.net/designer/bar.html
they are all legit pages
> el.load(page + " .content");
really says
 
Sem
@rlemon Nice one man.
 
el.load("index.html .content"); or load the div[s] with the class .content into the element defined as el
and the real links (the html links) point to them
var page = $(this).children('a').attr("href");
		$(this).children('a').attr("href", "#" + page);
 
Sem
@rlemon /foo.html doesn't go to foo directly though.
 
1:19 PM
this code first grabs the href value... then replaces it with "#index.html" then later on I create the div with the id "index.html" and load the contents of the page into it (assuming we're on foo or bar)
 
Yes so everything is within every file. And right now you aren't reusing anything right?
 
@Sem then just write the js code to goto it
like I said it was a quick example of how it could work.
err wrong person :P
hehe
 
Sem
@rlemon np :) still nice though.
 
anyways
 
Its nice, thank you
Possible to download all the files so its easier to play with my self? Or should i just look in your code and try to remake it
@rlemon btw made this almost like you did, however made it with History.js push state in the url which is not really working in IE .. so i wanted to remake that part into yours which seems nicer
 
1:28 PM
@designer its pretty simple, dl the bootstrap and test it for yourself after including the files
follow some of the examples on the bootstrap site
 
Hi all
 
@EventHorizon i was refering to the rest :)
 
@rlemon I'm late but can I have the link once more please?
:)
 
@PeeHaa: Meta says: If the author wants links to pirate content in his question, it's not our (my) place to police it. If a takedown notice is issued by a copyright holder, than action will be taken, but until then I should leave it alone
 
@rlemon: Saw it, but I believe this plugin for WordPress has some interesting features that you might want to try out to incorporate.. wpcolumns.com
 
1:38 PM
@Leigh k
 
this one was done by a friend of mine from Serbia
anyone knows a better way to write this?
<div class="col_2" style="background-color:transparent; width:22%">

<?
$uid =$_SESSION['z_id'];
$container = "contacts_container";
$single = "contact";
$array = array("Contacts");
$id_arr = array("c");
$nid = 1;
$container_html="To list ". strtolower($array[0]) ." in this area, select from the appropriate ". $array[0] ." tree tag\n\nfrom the tree appearing on the tag tree on the left edge\n\nof this page";

foreach ($array as $k=> $value)
{
require "jstree_logic.php";
}
?>

</div>


<div class="col_x" id="<?=$container?>" style="width:52%; border: 8px double#16526E;
I was reusing the array but now is a single element, just want to reference it as one without the $array[0], what can make it smoother?
 
@designer if you just save the three pages to the same folder they will work. No php there and all resources are extern
@JeanPaul what? Idk what your talking about
 
1:57 PM
@rlemon: I'm having the same issue with jstree, as each node links to the node_id number and using load in a custom function to render it, but if the page does not exist on the server it will only show an error in Firebug and that's all. However, I want to make it instead a query to the DB and look for some records and then retrieve them into the container
 
Yes its not my issue i was showing designer an example of the technique
 
@rlemon so basically something like:
#<?=$container?> the id of the container in my case for the tree
.load as the method in jQuery and load_node the URL
correct?
 
You can though... .load(url, function(txt, status) { if ( status !== 200) ......
 
how do I make it to query instead the server? AJAX?
ohhh yeah, that's neat, it is exist on the server
right..
wait if it's not !== 200 call back?
or do if === 200
 
Yes.. load also uses xhr .. and you can check the status to see if failure of success
 
2:02 PM
Hello again
 
The callback fires at the end . Here you can check the status and provide a message if the page does not exist on the server
 
$.ajax({
async : false,
type: 'POST',
url: loadnode,
success :{

} works too?
 
Success only fires of status===200 use complete
 
thanks
and fail?
could I use fail and success let's say if I wan't to load instead a generic page?
 
Anythibg but 200 you can google the http status codes
 
2:05 PM
Oh, I know the status code just was wondering if that will work for querying a DB with the value passed instead :P
thanks
 
@ircmaxell By the way, if the default hash and default options change over time there should also be some mechanism to upgrade existing hashes
 
Well it then depends on how you write your php
Sorry on my phone its hard to write code
 
@NikiC Why?
 
@rlemon Well, you'd like to make old hashes strong too, right?
Probably all it takes is some sort of password_needs_rehash function
But I haven't made up my mind yet
 
Huh? Again this isnt my issue hehe i was trying to help someonebekse
 
2:16 PM
hrm... that's interesting...
 
Sem
A simple question to you all: How long have you been a professional programmer?
 
i289.photobucket.com/albums/ll226/jean82_paul/Clipboard04.png @rlemon: Oh it's my issue as well, so thanks for sharing the advice :P
 
@Sem A month.
 
@Sem Approximately -5 years (as in minus five)
 
Sem
1.5 year here :)
 
2:21 PM
4 yrs
 
What makes you professional? People giving you money for it? Or you doing it as a full time job?
 
Sem
@BOMEz Money.
 
People have been giving me money for it for about 7 years now...
but looking back I would only count myself as a professional for the last 3
 
5 years professionally (as in doing it for a living). 22 years in total
 
Sem
@ircmaxell what happend to the other 17 years?
 
2:26 PM
I was growing up, and included a 6 year break where I didn't want to do it for a living...
 
@BOMEz I don't do it a full time job but per project basis, I don't think that you can just judge it as that. That is subjective to each programmers' decisions and can't be generalized. As soon as your are receiving money for it formally you are providing such technological services so there is no fine line there.. but I would say Money
@BOMEz Exactly so perhaps the question is since when do you feel that you have been supplying such services effectively enough to consider yourself a programmer
 
Sem
@ircmaxell Somehow I have the feeling you have the most experience in programming here, even more than tereško and gordon or hakre.
 
@ ircmaxell woah
 
Eih, experience isn't everything
 
@ircmaxell that's a lot of experience indeed. ;)
@ircmaxell: how's the project moving on?
 
2:31 PM
what project?
 
@ircmaxell the one in which you are using C for the password encryption?
you were mentioning for a few days now, wasn't it you?
 
@ircmaxell Exactly :)
 
@Jean
 
coming good
8
Q: Security Review - password_hash implementation for PHP

ircmaxellI'm currently working on a "helper function" for PHP's core to make password hashing more secure and easier for the majority of developers. Basically, the goal is to make it so easy, that it's harder to invent your own implementation than to use the core secure one. It's also designed to be updat...

 
Sem
2:35 PM
Hehe, go flex your brain muscles you deserve it.
 
hey all
 
Neat. looking closely into it :)
@ircmaxell Thanks for sharing!
 
@Jean Paul I've been doing it since I was a teenager inbetween school and my first job. What made me change to think of myself as a professional was when i started to focus on more than just getting the code up and running, but to think about security and performance and following industry practices
 
@NikiC LOL
 
quick question regarding file uploads... what are the things to guard against when doing file uploads? like what are the usual safety procedures?
 
2:38 PM
@BOMEz: well see that's in your case, in mine is rather I have been doing it the whole time remotely so I started consider myself a programmer when I started to deliver code without any direct supervision from another programmer
 
file type
 
check the file type... size...
 
file size
 
file extensions
 
@JeanPaul no, extensions mean nothing
 
2:39 PM
:P
 
extensions = type right??
 
yeah, didn't see that one there
then I think that's it
 
@JeanPaul I can rename my virus.exe to pony.txt
 
making sure your temporary directory is not accessable... i.e upload php says no... but the file is still in temp
 
k.. :)
 
2:39 PM
or virus.exe.gif
 
@ircmaxell github.com/ircmaxell/php-src/blob/hash_password/ext/standard/… Are you sure those will always be same-length?
 
@PeeHaa and the virus will run?
damn
 
no
 
@ircmaxell Btw, once your implementation is ready I'll review it more closely
 
@PeeHaa lol
 
2:40 PM
if it is an image you can check dimmensions with gd library
that is pretty reliable way to check that is an image
 
@ShyamK It might be able to run at some point. Better prevent it at the gatew
 
permissions on the server would be another thing to check
 
@ShyamK You could also initialiaze an virusscan on upload
 
for that user that is uploading files to an specific folder, right?
 
@Jean Paul good code delivery is a good metric for professional. I cringe in shame to think of some of the hack jobs I did back in high school
 
2:41 PM
@mark.. hmm.. thanks forgot about dimensions..
 
I... cannot.... type
 
@JeanPaul yes.. only to a particular folder
 
if gd library can open it and get dimensions then... its 100% an image.... unless there is a bug in GD :p
 
virus scan @PeeHaa ?? how.. linux server
?
@Mark lol
 
@ShyamK so? You think linux doesn't have virusscanners?
 
2:43 PM
in some badly configured servers you can run php by uploading a file named ~"something.php.jpg" (allowed extension)...
 
it has.. but not as much as windows..
@PeeHaa
 
@PeeHaa There are no viruses on linux...why would you need a virus scanner :P
 
exactly
 
@ShyamK , you can run server on linux , some server are mail servers , and you need to check the mail for viruses
 
@BOMEz You are an (*&&^ idiot
 
2:44 PM
@BOMEz There are viruses in linux.. just not as with windows..
not so common
 
@webarto >-- Yeah when I meant extension was to test if the trimmed string after the dot has three characters lenght
 
jpeg is also valid
 
@PeeHaa @ShyamK I was only joking guys... ":P" means joking
:)
 
@ShyamK , linux viruses are academic experiments , not a problem
 
@tereško Why not filter out the win viruses while you are at it?
 
2:45 PM
or government sponsored attacks
 
@webarto valid point.. 3 chars after the dot can't be always true
@tereško Academic experiments??
 
yeh... you dont want the users (all of whom use windows) downloading a dodgy file
 
@MikeB alive again/
 
@PeeHaa , linux virus scanners ARE filtering windows viruses
 
Does anyone know where the session_id is built in php source? I need to take a look at exactly what variables it's using to come up with the id
 
@tereško yup. That's why I have one on my mailserver
 
but how can you run them server side?
no idea how to.. using php itself?
 
@PeeHaa hiya :)
 
?
 
@ShyamK , viruses have to self propagate , which is almost impossible to do on NIX-like environments
 
2:47 PM
what is this uploader for?
 
you basically have to manually install virus on linux, to get infected
 
I would not worry about virus scanning... unless it is high risk
 
i meant how to start up virus scanners on the server? :)
 
does anyone know how to generate a unique number in range of bigint(mean less than 9223372036854775807) using mysql or php
 
images mostly.. but better to be safe than sorry @Mark
 
2:48 PM
rand()?
 
function randomNumber()
{
    return 4;
}
 
@tereško Chosen by fair dice roll :)
 
wait i want unique number not random number
 
hmmm
 
2:50 PM
hahaha
 
1
Q: Dymanically running ClamAV's clamscan on file uploads with PHP

billmalarkyStack, I want to scan each file that gets uploaded via my php upload script with clam anti-virus's clamscan tool. I think I've got a good script written but I wanted to run it past you guys. So assuming that the file I'm sending to this php upload script is named "uploadedfile" does the follow...

 
@ShyamK all (image) files have headers, you can check by parsing headers... virus scanner is run in terminal e.g. 'vs /var/www/upload/file.jpg' and you then parse the output... or something like that...
 
hmm.. k thanks.. @webarto but this will require a scanner installed on the server.. right.. hmm.. I don't have access :(
 
2:53 PM
@Mark uniqid makes number a string
 
@webarto thanks for the link
 
@PeeHaa Thanks, my C is rusty.. it looks like it's generating the session id with this call: PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC); but I'm having trouble tracing that through
 
@ShyamK yes, it needs to be installed, every virus scanner can be used from command line, for example you've noticed that your favorite web browser scans file after it is being downloaded (via command line).
 
@shyam virustotal.com/documentation or you could use the api at virustotal and pass the md5 of the file
probably easier
 
which sha algorithm is most secure
options available
Sha1(mysql can also implement it)
sha256
sha384
sha512
 
512 obviously
 
@webarto yeah.. always wondered how the hell that happened..
 
@Mark thanks
now i only need a number
 
but is it too secure?
 
2:58 PM
@Somebodyisintrouble 42
 
@Mark API call.. hmm.. md5? will the user still be able to download the file .. or if its an image.. display it??
 
@PeeHaa what is 42
 
@NikiC awesome! Thanks!
 
@Mark cos.. md5 is like one side encoding right? can't be decoded or something
?
 
before you make it publicly available... take the md5 of the file and post it to virus total
 
2:59 PM
twig: suggested or not suggested?
 
@ShyamK md5 is not good
 
why?? @Somebodyisintrouble
 

« first day (620 days earlier)      last day (4325 days later) »