« first day (454 days earlier)      last day (4501 days later) » 

6:04 PM
How of you is using "PHP as Template language" ?
 
if i have a directory path do I necessarily need regex to split it up?
 
cloud app means you are generating data and that data instead of being downloaded and stored locally, its stored on the providers servers so you can access it from anywhere.
 
@HowdyMcGee explode(DIRECTORY_SERPARATOR, $path); might do it
 
@edorian I'm not :P
 
@edorian it puts the whole path into an array :S
as in $path[0] = entire directory
:/ path_separator does the same
 
6:09 PM
thats because DIRECTORY_SERPARATOR is mispelled
DIRECTORY_SEPARATOR
 
I figured it might be but it will throw a E_NOTICE so I just assumed he figure it out :)
 
:P
 
yeah even spelled right it does the same thing
oh lol it starts at [1]
 
>.>
 
@edorian gotta love those serparators...
 
6:21 PM
Who of you is using "PHP as Template language" ? (To ask that again :P )
 
@edorian :P
 
@edorian I am
 
How do you do html escaping? (Usage in the template)
 
anyone else having 502 issues with codepad? codepad.viper-7.com/uPsVZG
@edorian I write a closure that wraps html_special_chars, and pass that to the templates: $escape($variable)...
 
So you extract($params); include $template; and you have some special variables/functions that can't be variable names?
 
6:28 PM
basically...
I define them after the extract though
 
Why the dots? :)
 
public function render($params) {
    extract($params);
    $e = $this->getEscapeFunction();
    $t = $this->getTranslateFunction();
    ob_start();
    include $this->template;
    return ob_get_clean();
}
something like that
 
All right. Looking quite slim. Have you considered auto escaping wrappers at some point?
 
i use it as a template
here's mine:
$path = &config::$config['app_path'];

$header = $path."includes/html/header.php";
$page = $path."includes/html/".$page.".php";
$footer = $path."includes/html/footer.php";
ob_start();
include $header;
include $page;
include $footer;
$render = ob_get_clean();
echo $render;
 
And I'm back.
 
6:31 PM
@ddubs And how do you do escaping in the template?
 
that way I can define different escape functions and translators for each template (depending on context, what type of template it is - html, javascript, xml, etc)...
 
i dont
i just wrap php code into <?php ?> tags
and ob_start executes the php code and keeps the HTML
 
I posted up a bit ago; recursive (may not need to be) function for imploding/exploding strings/arrays pastebin.com/dKigx1TU
Should take either a string or array argument and return a 1 dimensional array of the exploded values based on the separator -- all nested arrays/strings need to be exploded too.. Anyone know if I can optimize this a bit? Profiled it, but I can't tell if its production friendly
 
@ddubs and you write <?php echo htmlspecialchars($var, ENT_QUOTES, 'CHARSET); ?> for every variable?
 
and the cool thing is that __toString() is mapped to render($this->defaultParams) (which are bound to the template). So you can pass other templates as params and do a recursive rendering just by doing <?php echo $otherTemplate; ?> and it'll render that one for you...
 
6:33 PM
no
<table border="1">
<?php
if (is_array($content)) {
foreach ($content as $key => $value) {
echo "<tr><td>" . $key . "</td><td>" . $value . "</td></tr>\n";
}
}
?>
</table>
<pre>
<?php
print_r($content);
?>
 
So you don't do any XSS protection at all?
 
ob_start and ob_get_clean()
well this just ripped from my MVC i was writing
 
Thats not XSS protection but thanks
 
so this would be part of the view logic so anything that its displaying should already be sane
 
@ircmaxell I can see that. Quite nice (Repeats the auto escaping question)
 
6:37 PM
@edorian I do use twig now for most things, and have used smarty (only when work dictated that I must)...
Actually, I did write a templating engine a few years ago that used only XSLT and XML namespaces to manipulate the rendered template. It worked REALLY well, but was rather slow... In fact, it was really secure as well, since no PHP was allowed at all (ever), and since it operated on a dom model behind the scenes, everything had to be added as dom nodes or document fragments. So you had to actually go out of your way to directly render content...
 
Yeah I remember you talking about that a while ago
 
One problem was it was overly verbose...
 
I'm just looking for the "classic" approaches as I'm drafting around some implementations
 
<h1>
    <a:print var="foo" />
</h1>
<a:foreach var="bar" val="baz">
    <a:print var="baz"/>
</a:foreach>
@edorian Yeah, I like the recursive rendering through __toString approach. Makes it trivial to include sub-templates and sub-content...
 
I really like XSL powered templates. Since I already have a server that supplies any data in XML or JSON, I just have to request XML and apply XSL and BAM, there I go. . .
Companies don't like it because it seems to limit their potential hiring options.
I would argue that any good web developer should be intimately familiar with XML and XSL.
 
6:43 PM
Yeah, I had once seen a demo of a full CMS built using XSL. It was rediculous. Very hard to work with, but rediculiously elegant and powerful
 
Maybe I'm wrong.
But that's what I like to think.
 
the whole CMS was like 500 lines of PHP code, and it was a fully functional CMS...
 
Any links for that @ircmaxell ?
 
No, this was 4 or 5 years ago, and it was propriatary code...
 
Oh ok; nifty idea though
 
6:50 PM
@Bracketworks If you like the XSL idea, check out symphony-cms.com I looked at them a few years ago, but I have no idea what's happened since then.
 
@edo How would you implement autoescape in php based templates?
@edorian I can't imagine any sane implementation.
 
@NikiC I let you know if I do find one
 
@LeviMorrison Uh, yeah, sure ... I think a more realistic goal would be for people to know what XSL is at all :D
 
@NikiC lol
It's one of the better developed technologies, actually.
 
@edorian I don't think there is one. (At least for general case. You could obvious autoescape vars)
 
6:52 PM
Wrapping all literal variables and proxying all object calls I guess.. but you said sane so well.. No
 
It even works well on IE 6. IE 6. And IE 5.5 had decent support.
Say that about any other web technology. . .
 
@edorian But what about <?= $name . '<' . $email . '>' ?> and there goes the autoescape ... ^^
 
$email->raw(); or $email->escapeMail(); or something
 
@LeviMorrison I think the <b> tag also had support in IE 6. But that's all I can think of ;)
@edorian No, I meant it more like: If you are outputting an expression it doesn't suffice to just escape the vars. You'd have to escape the < and > in the above example too
 
@NikiC Well, you could use a preprocessor to change any output to be wrapped in a function to escape it...
 
6:54 PM
@ircmaxell Yeah, in which case I wouldn't call it PHP-based anymore ^^ Then it's just a (very) lightweight version of Twig ^^
 
@NikiC Well but thats the same with every other templating system too. If you write raw strings you will get raw strings
 
well, it's still PHP can can be 100% run via regular PHP without the preprocessor layer at all... So I would call it PHP based...
 
@edorian Hm, not sure about that one right now. I was sure that {{ '<' }} would yield &lt; but now I'm not sure anymore.
 
Yeah because you wrap it in an expression
"$this" would still be there in the template context to call all the escaping functions directly if one needs too... i guess
so $this->escapeHtml('<'); or $this->wrap('<')->escapeJavascript(); or something..
Twig with $x->raw(); instead of {{ $x|raw }}
:) Edit win
 
@edorian Yep ^^
 
I'm looking for some insights for how I can better profile my PHP code and/or the server response...
For this particular request, a very small query is made, but it takes a painfully long time waiting. I'm not able to find what causing the waiting.
I'm just curious what things I should be looking for/at.
 
@Incognito XDebug?
 
You've mentioned that before but I'm not really using an IDE, I like sticking to vim.
 
Well, you can just use it to generate a cachegrind file, which you don't need an IDE to do...
 
@Incognito +1 for vim.
 
7:08 PM
Actually, I think i've found something, it looks like it's a really slow index.
@ircmaxell I haven't heard of cachegrind, is this php specific or something else?
 
no, it's a generic file format for debug files
 
yup
 
So, I'm working as a front-end developer part-time for a company. They use ASP.net, which I don't touch. However, they are looking at CMS/framework options. Does anyone here have a good suggestion? I don't want to ask the ASP channel just yet. I'd like to ask them more narrow questions.
 
Excellent I'll take a look into it, thanks @ircmaxell .
 
7:13 PM
@Incognito not valgrind, kCacheGrind
 
> they are looking at CMS/framework options
What are your requirements?
 
Btw. pretty much all xDebug features works nicely from vim (just as a sidenote)
The debugger is a lot nicer than using it from an IDE too (If you really into vim that is)
 
@edorian Oh. Looks like I had a misconception about it.
 
@edorian Valgrind is the tool that created the file format
 
@Incognito We serve quite a bit of static content, but also have application style stuff.
Several forms.
 
7:15 PM
@LeviMorrison Sounds like you just want to go for a small framework that does templates.
 
@ircmaxell But you can't put a xDebug.profile into valgrind and get pretty pictures can you?
(And I thought this was what the discussion was about? finding bottlenecks?)
 
yes
 
I don't really care about the pictures, I just want to see something like, "that sql call, or that sort function over there, that is the one that's killing you."
 
I'm not sure about putting it into valgrind, I thought valgrind just generated...
 
7:17 PM
I used to work with z/OS, and I wish the gopher:// protocol was around. Pretty pictures aren't up my alley.
 
The bigger the more time it took. One of the 3-4 views kCacheGrind offers to find bottlenecks
Of course you also get a lit of stuff sorted by runtime :)
 
Neat.
 
But this and the callgraph (with runtime %) are what I call "pretty pictures"
 
So, there's kcachegrind, and xdebug. I have no experience with these, is there any real reasons to chose one over the other, given that I prefer CLI environments?
 
I love XDebug...
 
7:19 PM
xDebug generates a file that you put into kCacheGrind
They work together. xDebug collects information into the valgrid profiling format. kCacheGrind generates human readable output from that "binary dump"
 
interactive debugging with Netbeans works so well...
 
Is there a way to know whether the last PDO query actually inserted anything? Then I can have more understandable output of PDO's lastInsertId method.
 
I'm not aware of any really solid CLI tools to extract good data from xDebug.profiles. The tools that exist are linked on the xDebug site but they all only go so far
 
@edorian So I should use xdebug and output to valgrind format and pipe to kcachegrind so I can see performance?
 
$dir = in_array($directory[0], array('/', '\\')) ? DIRECTORY_SEPARATOR : '';
 
7:21 PM
php -d xdebug.profiler_enable=1 -d xdebug.outputFileLookUpTheDocs=out.profile yourPHPScript.php && kcachegrind outputFile.profile
 
fastest numerically indexed array append -- array_merge()?
 
@Bracketworks why does it need to be fast?
 
hello all
 
@ircmaxell used recursively; small arrays (typically) are being merged into a progressively larger one, the target will not often be larger than 10 elements at result
 
Write what you think is easiest to read...
 
7:26 PM
@ircmaxell and why do you use that?
 
@LeviMorrison because I'm building a recursive mkdir (which will create parent directories if needed), and I need to account for relative vs absolute paths...
 
@ircmaxell I know; I just didn't know if by-and-large foreach(){ $target[] = ... } may be better
 
@ircmaxell So, $directory is a string, yes?
 
@LeviMorrison yup
 
You should feel dirty.
 
Although, why are you using \ and \\? On windows, I don't think \ is a viable root, is it? Keep in mind I don't use windows AT ALL. Haven't in over 5 years.
 
it's not, but on windows there's C:\foo, so it should be treated as relative anyway (with respect to this algorithm)
 
So, you are writing a mkdir in PHP that is compatible on all known file-systems?
 
mkdir is compat with all known filesystems. I'm just making a PHP equivilant to mkdir -p
 
@ircmaxell I asked because it sounded like you were reinventing the wheel, lol.
 
7:33 PM
    protected function createDir($directory) {
        if (!$directory || is_dir($directory)) return true;

        $parts = preg_split('((/|\\\\))', $directory, null, PREG_SPLIT_NO_EMPTY);
        $dir = in_array($directory[0], array('/', '\\')) ? DIRECTORY_SEPARATOR : '';
        foreach ($parts as $part) {
            $dir .= $part . DIRECTORY_SEPARATOR;
            if (!is_dir($dir) && !mkdir($dir)) {
                return false;
            }
        }
        return true;
    }
 
So, this part-time job as a front-end developer as a bit odd.
I'm rebuilding their HTML from scratch.
That's fine but
 
@LeviMorrison you would be complained to death, twice over!
 
@salathe lol
I was tempted just to do it and deal with the consequence.
But then I thought: I want to be on their happy side.
I have a huge data-structures project I need to get approved at some point.
 
:-P
 
@ircmaxell Question about that mkdir
 
7:40 PM
sure
 
@ircmaxell Isn't mkdir($dir, 0777, true); the equivalent of mkdir -p
 
sigh...
good call
and that's why I posted it here
thanks @edorian
 
:)
 
7:54 PM
@edorian > kcachegrind: cannot connect to X server
 
@Incognito You are on your own with that one, sorry :)
sudo $package-manager install kcachegrind && works ; # Pretty much all the experience I have with it
 
@edorian Alright, looks like there's some tutorials online I can check out too. Thanks for the help.
 
I forgot how long it takes to clean up bad HTML.
 
:-( no more activity on the answer since my major edit. Feels like a waste of time...
3
A: Update old stored md5 passwords in PHP to increase security

ircmaxellOk, let's go over a few points here What you have in $salt is not a salt. It's deterministic (meaning that there is no randomness in there at all). If you want a salt, use either mcrypt_create_iv($size, MCRYPT_DEV_URANDOM) or some other source of actual random entropy. The point is that it s...

 
@ircmaxell Your post was duly noted :P
 
:-D
 
Despite this, I've resolved that foreach($x as $y){ $z[] = $y; } is in fact faster than array_merge()`
 
I highly doubt that
without listing significant assumptions
 
depends on the array size I'd say
 
8:20 PM
and contents
 
Very small arrays, the overhead of the function call (so far as my "lying" profiler claims) may be making it more expensive than foreach
Numerically indexed, values are strings often less than 10 characters
Basically, I take an array. In that array, I have strings, and possibly more arrays, arbitrarily deeply nested. The strings are delimited lists themselves such as "a|b|c"
The (desired) end result; a 1-dimensional array, of all the exploded values from all dimensions of the array
I've got it working, but since this function is called very often for mapping keys, I wanted to get it as fast as possible
 
@Bracketworks: see this answer:
23
A: Is micro-optimization worth the time?

ircmaxellWell, for a trivially small array, $array === (array) $array is significantly faster than is_array($array). On the order of over 7 times faster. But each call is only on the order of 1.0 x 10 ^ -6 seconds (0.000001 seconds). So unless you're calling it literally thousands of times, it's not go...

 
im being dumb... how do you reference a parallel folder? im trying to do a file upload to a folder that is in the folder above the directory the php file is in
 
@JMRboosties ../
 
so im in /php/files/upload.php, want to reference /php/images/
so ../images/?
 
8:32 PM
@JMRboosties I'm not 100% sure whether it is relative to the directory the php file is in or the document root. If it doesn't work you can get the current path (the location of the php file) using realpath(dirname(FILE))
realpath(dirname(__FILE__))
 
@PeeHaa yea the ../ didnt work
it gave me this:
fopen(../images/4f1094f3c034d.mp3) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Permission denied in <b>/home/virtual/site246/fst/var/www/html/php/files/upload.php</b> on line <b>30</b>
does that mean its looking for a directory ../images/ IN the php file?
 
@JMRboosties well... do you have permission?
and by you I mean apache user
 
@JMRboosties It means the user doesn't have permission to open the file. Also weird that you'd be storing an mp3 in images ;)
 
@CharlesSprayberry lol, im just using some generics right now for testing
@PeeHaa i should have permission to go up one directory, im the admin
 
@JMRboosties But do you have permission to that file?
 
8:45 PM
i should...
ive done this before, im just doing a different implementation
ah screw it
in my old implementation did this: mkdir($uploadBase, 0777);
if the directory $uploadBase did not exist
i suppose i could try again but that doesnt make the most sense tbh
 
can't you just check to see what the permission are?
ls -la
in console
assuming linux
 
h/o
 
@JMRboosties ?
history of?
hold on?
:P
think the latter :D
 
hold on indeed
yea i was being an idiot, i need to set the folder to have write permissions
im doing through via an android app so things get tricky sometimes
 
@JMRboosties Now bow your head in shame ;)
 
8:51 PM
yea pretty much lol
it was driving me nuts i was like
"i KNEW i did this before"
ok, it works fine now.
 
@JMRboosties great
 
now i have this super frustrating problem to tackle
@PeeHaa would you do this differently? right now im using $incomingData = file_get_contents('php://input'); then fopen and fwrite to get this file into the directory
it doesnt seem very secure, but i dont know how else i can do it
 
@JMRboosties Super frustrating problems keep you sharp. It's fun solving them (eventually).
@JMRboosties What does php://input contain?
 
in this case, the mp3 file i was uploading
it just takes a file that i send over via the android app
and then dumps it in the right directory, thats the whole point of the php page. it also writes the pertinent info about the uploaded file (uploader, time, etc) into a sql db
 
@ircmaxell Based you your supplied reading, I began to realize that perhaps my optimizations were needless, perhaps even foolish. Then I tried implementing some and gained 9 milliseconds of speed (down to less than 1 now) on each call using real-world arguments. Considering the call can be made in excess of 100 times in a given request, that's reasonably good for gains.
:P
 
9:00 PM
the script works perfectly right now, i just know that im bound to be doing it in a less than ideal way due to my inexperience
 
@Bracketworks Well, the point is that 90% of the runtime is likely in 10% of the code. I'd rather spend my time on the 10% than on trivial optimizations. And I can't know what the 10% will be unitl complete...
 
So I found the source of my slow-causing-code.
Basically, I log all actions in the system, but I do it before the action takes place.
Can I defer logging in some way that doesn't make it block the script?
 
@JMRboosties I don't get the file_get_contents() if you want to upload something. Looks more like a download to me. Also check out: stackoverflow.com/questions/4295417/…
 
In essence, this what I've got going:
    $this->Log();
    if ($this->Validate($this->appID, $this->method)) {
        $this->Success();
    } else {
        $this->Failure();
    }
 
9:06 PM
@PeeHaa its an upload, taking a file from the client (in this case a phone) and putting it into a directory
 
@Incognito buffer, and write the buffer using a shutdown function?
 
@ircmaxell I understand, it's just that I'm working on something very integral to data storage/retrieval used throughout the application. Bottlenecks are likely to appear elsewhere, perhaps as a greater threat to the application's performance, however I foresee this (with reasonable thought) to be a potential problem unless otherwise stifled.
Thanks for the various links :)
 
Well, you understand my opinion on that... :-D So no need to say anything else!
(not meant in a negative way)
 
To be honest, I've abandoned the recursion, in favor simply of \explode($separator, \implode($separator, (Array) $key))
As far as my application should be concerned, if you're using nested arrays for this feature, you're doing it wrong :)
I just figured I'd try to make a "catch-all" for future-use
So, at about 16 times faster, screw recursion
 
9:34 PM
I have a URL - http://www.youtube.com/watch?v=dA32G3zEv_g&feature=g-all-bul&context=G2e0c5cbFAAAAAAAAAAA

I want to extract the value of the 'v' variable so I only have 'dA32G3zEv_g' left. what regex should I apply?
but sometimes, the url is smaller - youtube.com/watch?v=whatever
 
so I'm kinda stuck. is there a function that can just extract the value for me? like I'd do with $_GET['v'] if it were a URL on my website?
 
9:56 PM
Goddamnit, I just spent a few hours building NTLM password generation bits for @ircmaxell's CryptLib only to remember the app I'm writing this code for doesn't run under 5.3
Oh gods, I bet that it doesn't even have mcrypt installed..
I hate our environment...
 
@Charles wow that just sucks :P
 
Oh, it gets worse.
PHP 5.0.4 (cli) (built: Nov  8 2005 08:27:12)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies
And worse.
[...@... ~]$ cat /etc/redhat-release
Fedora Core release 4 (Stentz)
Live, production server at a company that does eight figures of business a year.
 
@Charles Can't they bring up a development server that has all the updates and port stuff? If they do 8 figures, they can afford it . . .
 
The main issue is that the code wasn't developed with warnings or notices turned on.
We made an install on 5.3 and turned everything on so we could start fixing things.
It was ... overwhelming.
Spent the past year or so fixing things bit by bit
We're almost to the point where we can actually switch to a different machine.
 
Fun.
I assume TDD is not the standard there?
 
10:03 PM
The last bits were in the wacky-ass shelling out to gpg and the printing routines.
About 10% of the codebase has automated tests.
The rest of the code is unfriendly to being tested because it was built by people that had no idea what they were doing.
 
The next time I take a job, if they don't use version control and don't have automated tests, I'm not taking it unless they allow me a large time-frame to fix everything.
I hate writing new code that integrates with shoddy legacy code.
Something about putting new wine into old bottles comes to mind.
 
Yeah, we're in the middle of a rebuild of the worst bits.
 
10:16 PM
@LeviMorrison Joel test and revised joel test
@LeviMorrison My new employer has 9 points and there are working on 10 & 11
 
@edorian Most employers that are hiring around here are around 8/9.
 
classic joel or new joel?
 
@edorian Classic.
 
Because from the original joel test some of the points are just "I don't want to work with those people" points
> No scm, no issue process, no requirements from buiness, no code during interviews
At least those for are "score doesn't matter, to fubar" for me
 
@edorian No code during interviews is fine for the first round of applicants, I say.
 
10:22 PM
@edorian what are the classic and new tests?
 
First round, yes. Whole process: no go
bbl. :)
 
@edorian I like this one a lot:
> 11. Do new candidates review code during their interview?
Where I work, if people reviewed code more often, code quality would increase dramatically. I'd hire a new guy who can spot design flaws and know how to fix them in a heartbeat.
 
@edorian +1 for <strike>write</strike> review code.
 
@Charles LOL. Want to submit what you have anyway?
 
hi guys
since there is no one in css room, i guess i will have to write the problem and ask for solution here :)
 
10:34 PM
@user1079641 Hello, again.
 
so i have three divs which have borders that overlap each other
this shows up right in chrome
with one border showing up
but in IE, it messes up and shows the borders side by side making the border look thick
anyway to fix it so it looks same in all browsers
?
 
Which IE version?
 
I have Windows 7 and it has IE 8
 
Ah, can't help you there, mate. I only have IE9 available, and I'm lucky to have that.
 
@ircmaxell Yeah, I just need to get the "release an OSS thing" signoff from my boss next week.
 
10:36 PM
Awesome!
 
even compatibility view fails
 
Though I'm not sure you'd want to integrate it, LM hashes are insecure as hell, NT hashes aren't much better, and the LDAP hashes aren't generally even salted.
 
any help from anyone :D ??
 
@ircmaxell Indeed, but I had to implement new creation here.
 
10:38 PM
yes but the thing is the website I am creating, I can't restrict it chrome or one single browser
 
The purpose is setting samba credentials as stored in LDAP
 
it will be used on all kinds of browsers like any other popular site and that means I will need to fix it for each browser
And IE is number one on that list since most people use IE
 
@Charles fair enough
 
@user1079641 Can you throw your whole code onto gist or pastebin?
 
Bam ZF certified beyootch
 
10:42 PM
Announcement: After spending hours and hours and hours on the home page of my client, I have eliminated all inline styles and deprecated elements. Ho-ray!
 
You know.. I think there are already free tools online to extract inline styles
Though that would be a good interview question.
 
@Anfurny It's not as simple as removing them. I need to cleanup the whole page.
 
@LeviMorrison And that was just the homepage :(
:P
 
@PeeHaa Yep.
 
Well as long as you didn't do that a million times by hand
 
10:44 PM
I'd just run it through tidy if I wanted to shift the styles to classes.
I started to build it from scratch, but I realized that it was so complicated I was better off trying to slim it down first.
Once I can actually see what is there for code structure, I can manipulate it as I please.
 
actually never mind
I just want to know is it possible to stretch a div to the bottom?
 
@user1079641 Don't use <br> tags for structure. I spied one in there.
 
height:100% doesn't work
 
@user1079641 Yes, thankfully!
@user1079641 Yes it does, you just don't understand the box-model.
 
10:50 PM
@user1079641 why don't you just drop all the left-borders?
 
here:
don't focus on the margin-left that is there
I just have one question, is it possible to fix each of the three div's height to 100% of "contentContainer" parent div in such a way that if
 
And which columns do you want to have 100% height?
 
that parent div's hieght increases, all the three div's height increases that much
so basically a fixed 100% height for each of the three divs
"links" "news" "userStats"
 
So, there are several ways.
 
the overall idea is that the three column divs should always be equal to 100% height and increase as the parent div increases
 
10:55 PM
@user1079641 Yes, and go use one of the hundred (probably more than that) resources out there.
This lists a bunch of them with varying properties: css-discuss.incutio.com/wiki/Three_Column_Layouts
Most of them explain why the technique works. That should be valuable to you because it will help in other areas of design.
 
Can someone help me with this? stackoverflow.com/questions/8855872/…
 

« first day (454 days earlier)      last day (4501 days later) »