I don’t have the exact errors to post because I deleted my compile log, but they are the same errors you get if you don’t have the bzip2 development libraries installed, which of course I do in /www
[snip]
Then someone helpful asks for more information.
Please recompile so that you can tell us te exact errors.
Derick
And then, GOLD:
The php developer who added/maintains bzip2 support will know what I am talking about. I am not going to compile when I know this! It would be a waste of my time.
Wow.
Now, not to worry; a few minutes later the submitter saw the error of his ways, compiled his code, posted the exact error message and got help.
Learning how to ask questions is a skill. Mastering this skill can only help, because everyone (even the Super-cool techno guru) has to ask for help at some point, so why not be as effective as possible?
I recently ran across the anti-pattern of what I see as a common problem amongst designers and developers: coupled presentation and content. I’ve found that decoupling the presentation from the content makes things much easier to write, maintain and expand.
Take a look at what is going on here: we’re adding a 10px margin to the top of the div. DON’T DO THIS. You want your class names to be contextual, not descriptive of the style.
Rule of thumb
To change the layout, you should only have to edit the CSS, not the HTML.
Here’s where our anti-pattern falls down and will cause grief.
You decide to adjust the positioning of the section. You can:
Edit the CSS, changing the class’s margin value and breaking every other element that uses that class.
Edit the HTML create a new class, then edit its CSS class definition. If you have to experiment with different margin values, you’ll need a LOT of classes. “Will 14px work or 15px? What about .25em? Argh!”
You can’t have too many attributes in each class, because they will have unintended consequences for the other elements that are using them. Add a red border to one class because you need a border for a specific element, now you have red borders on ALL the elements that share that class. So, you’ll have to have many single- (or few-) attribute values, and include all of the necessary ones on the required HTML elements.
<div style="margin:5px;border:3px blue outset;float:left;width:75%" ...
for no good reason.
The Cure
Think about the element in terms of content or a functional space. What is it and what does it do? In our example above, let’s assume it is the lede section of an article. Then we would do:
By decoupling the content (div) from the presentation (style-dependent class), we are free to adjust the style of that element by making whatever changes to the CSS and leaving the HTML alone.
“But,” you shriek, “I have common elements for everything! Rounded corners! Gradients! (except IE…) Et cetera!”
For this, we will turn to our trusty companions Less and/or Sass in a future post.
Remember when flash introduction pages were all the rage? They were ‘cool’ from the web designer‘s standpoint, but utterly annoying and off-putting to the visitor. Fortunately, most people figured out that people visited their site for the content, not the snappy graphics (unless it was a gallery site), and certainly not for the mandatory intro pages.
Yet, some people still haven’t gotten the clue that the 80s called and they want their flash intros back.
xkcd: the seventies called
For those who remember with revulsion, here’s the old SkipIntro parody. The site is long gone, but it would be a shame to let it fade away!
SkipIntro
If you haven’t clicked on it, do it now! Relive the pain of the never-ending flash intro to the sound of weird Indian music and gunfire!
The OG SWF
For those who somehow can still play flash file (via a plugin or whatever), here is the original SWF:
Recently, at a client, I had the opportunity to review their security implementation on their website. I realized that it is very important to never try to design one’s own security, because of the Dunning Kruger effect. In a nutshell, folks who don’t know very much about security think they know “enough,” and folks who are very knowledgable (e.g., Bruce Schneier) realize they don’t know all that much.
So what does this mean? It means simply this:
Not so secure now, is it?
If you design your own security system, you’re going to get it wrong.
Here are some examples of how to get things wrong.
Storing passwords in plaintext so you can send the person the password if they forget.
When (not if) someone breaks into your database, they instantly own every single account. They can log in, view your user’s details and change them. Since most people reuse the same password for multiple systems, the attacker can try those passwords on other popular services, such as Facebook, GMail, LinkedIn, Twitter, etc.
Relying on application-level security to protect your data.
This is dangerous because it is hard to ensure 100% coverage. EVERY access point—of many—to your data must be secure. Failing to cover one point leaves the system wide open. A better solution is to apply security at the data-store level. Typically, this is done using triggers and stored procedures. Your RDBMS doesn’t support those (or weakly supports them)? Find another RDBMS.
Using the same salt for every password in the system.
Assuming by keeping the details of your implementation secret, you will be secure.
This is dangerous because you think you’re secure. In fact, you are less secure. Kerckhoffs’s Principle is always a good starting point for security implementation: if an attacker could see all of my code and had a copy of my database, could she/he break into my system?
Getting it right
The first step is admitting that you don’t know what you’re doing.
Now go find someone who does: there are plenty of security libraries out there for every language. Find one that is mature and widely used and implement it. Keep up to date on the library’s mailing list so you will receive alerts, and update whenever there’s a new version.
Security is hard to do. It is extremely hard to do correctly. Don’t fall into the trap of thinking you can get it right without years and years of study and experience.
I’m always on the lookout for a new technique or Better Mousetrap. I admit I don’t know all that much, so I’m happy to learn.
I was playing around with Wikify @ appointment.net (a nifty tool that goes through a block of text and ‘wikifies’ it–that is, links all the words it can find to relavant Wikipedia articles) when I noticed the behavior seemed rather…odd. I could see it go through the word list as it created links, and every time it linked up a word, every duplicate word was linked.
Let’s take some example text (from the now-defunct Dilbert Mission Statement Generator) and run it through the site:
For example, the additional instances of “leverage,” “problems,” and “business” were quickly linked, once the first one was completed. Poking around their code, I noticed all the action takes place in wikify.js. There are a few gems in there. For example, the function call to reduce an array to only unique values:
function array_unique( array ) {
// http://kevin.vanzonneveld.net
// + original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com)
// + input by: duncan
// + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + bugfixed by: Nate
// + input by: Brett Zamir (http://brettz9.blogspot.com)
// + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + improved by: Michael Grier
// % note 1: the second argument, sort_flags is not implemented
// * example 1: array_unique(['Kevin','Kevin','van','Zonneveld','Kevin']);
// * returns 1: ['Kevin','van','Zonneveld']
// * example 2: array_unique({'a': 'green', 0: 'red', 'b': 'green', 1: 'blue', 2: 'red'});
// * returns 2: {'a': 'green', 0: 'red', 1: 'blue'}
var key = '', tmp_arr1 = {}, tmp_arr2 = [];
var val = '';
tmp_arr1 = array;
var __array_search = function (needle, haystack) {
var fkey = '';
for (fkey in haystack) {
if ((haystack[fkey] + '') === (needle + '')) {
return fkey;
}
}
return false;
};
for (key in tmp_arr1) {
val = tmp_arr1[key];
if (false === __array_search(val, tmp_arr2)) {
tmp_arr2[key] = val;
}
delete tmp_arr1[key];
}
return tmp_arr2;
}
Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.
I found the following on Stackprinter (deleted Stackoverflow questions) by “ysth”; probably the best example of wicked-cool code obsfucation, ever.