<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Word up, son!</title>
	<atom:link href="http://orlandodefrias.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://orlandodefrias.com</link>
	<description>Thoughts on the absurdity of everything, plus neat-o web development tips.</description>
	<pubDate>Sat, 16 Aug 2008 07:59:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Quick tip to fight email form spam</title>
		<link>http://orlandodefrias.com/2008/08/16/quick-tip-to-fight-email-form-spam/</link>
		<comments>http://orlandodefrias.com/2008/08/16/quick-tip-to-fight-email-form-spam/#comments</comments>
		<pubDate>Sat, 16 Aug 2008 07:54:26 +0000</pubDate>
		<dc:creator>Orlando</dc:creator>
		
		<category><![CDATA[Quick posts]]></category>

		<category><![CDATA[Scripting]]></category>

		<category><![CDATA[forms]]></category>

		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://orlandodefrias.com/?p=7</guid>
		<description><![CDATA[I discovered this a couple of days ago, but the simplicity and &#8220;oh wow, I should&#8217;ve thought of this years ago&#8221;-ness of it makes me believe I&#8217;m not the first to think of this.
A few months ago I began receiving spam from the form over at my XHTML slicing site at http://designerschopshop.com . The form itself [...]]]></description>
			<content:encoded><![CDATA[<p>I discovered this a couple of days ago, but the simplicity and &#8220;oh wow, I should&#8217;ve thought of this years ago&#8221;-ness of it makes me believe I&#8217;m not the first to think of this.</p>
<p>A few months ago I began receiving spam from the form over at my XHTML slicing site at <a title="Designer's Chop Shop" href="http://designerschopshop.com">http://designerschopshop.com</a> . The form itself is actually a slightly modified version of <a title="Dustin Diaz's web site" href="http://dustindiaz.com">Dustin Diaz&#8217;s</a> AJAX contact form, but for this tip you can use any form at your disposal. Lately though, I&#8217;ve been receiving 6-8 spam messages per diem. That&#8217;s just unacceptable. Wait, I take that back, ALL spam is unacceptable. Especially that super annoying kind that seems to be along the lines of:</p>
<blockquote><p>Oedipus conflagration is among pacifists with trepidation annihilating mesomorphs http://cheappillsforyourdick.ru/pills/cialis &#8220;Hear ye!&#8221; behooves cornerstones of Tbilisi yearning for exhilaration http://hotbabes.anddickpills.com/buy/12387/pills dignified constitution</p></blockquote>
<p>Ugh. Those emails make me want to have a sex-change operation so I can hit on a raging homophobic bodybuilder that&#8217;ll beat my ass after I tell him my truthful gender, just so the pain will be great enough to hopefully make me forget about the bastards that send that type of spam. It&#8217;s that intense.</p>
<p>Anyway, back to the topic at hand.</p>
<p>I didn&#8217;t want to go the Captcha route and wanted to keep it simple. What I did is create two input boxes for email. I gave one the id and name attribute of &#8220;email&#8221;, and the other &#8220;emailFalse&#8221;. I placed &#8220;emailFalse&#8221; before email, but I did this:</p>
<pre><code>&lt;label style="display: none;" for="emailFalse"&gt;E-mail address: (required)&lt;/label&gt;
&lt;input id="emailFalse" class="text" style="display: none;" name="emailFalse" size="25" type="text" /&gt;

&lt;label for="email"&gt;E-mail address: (required)&lt;/label&gt;
&lt;input id="email" class="text" name="email" size="25" type="text" /&gt;</code></pre>
<p>Then, in my validation Javascript (and in the PHP, just in case), I added something along the lines of this:</p>
<pre><code>...
else if ( emailFalse.value != "" ) {
		alert("Not gonna work this time, bud.");
	}
...</code></pre>
<p>In other words, you create an extra text box with an id/name attribute that contains &#8220;email&#8221; (I&#8217;m under the assumption that spammers in this case use a regular expression to know which field is which), hide it from normal users via a quick &#8220;display: none;&#8221;, and add a validation check that looks to see whether or not that field has been filled out. If the field isn&#8217;t left blank, it&#8217;s spam, so don&#8217;t send it. I&#8217;ve gone from 6-8 spam emails every single day to 0 in the last 4 days. Obviously, the only thing that keeps this solution working is spammers not knowing about it (yet) and coding around it (so far.) Even so, right now it&#8217;s working brilliantly, and that makes me happy.</p>
<p>Neat, eh?</p>
]]></content:encoded>
			<wfw:commentRss>http://orlandodefrias.com/2008/08/16/quick-tip-to-fight-email-form-spam/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Creating an image-based menu with CSS</title>
		<link>http://orlandodefrias.com/2008/07/10/image-based-menu-with-css/</link>
		<comments>http://orlandodefrias.com/2008/07/10/image-based-menu-with-css/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 19:36:02 +0000</pubDate>
		<dc:creator>Orlando</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[css menu]]></category>

		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://orlandodefrias.com/?p=6</guid>
		<description><![CDATA[The year is 2008 and I come upon a new site on a daily basis using the Javascript method of creating an image-based menu with rollover effects. I&#8217;m not talking flashy rollover effects like the types given to you by various JS libraries such as MooTools and script.aculo.us, I&#8217;m talking a simple image replacement effect. [...]]]></description>
			<content:encoded><![CDATA[<p>The year is 2008 and I come upon a new site on a daily basis using the Javascript method of creating an image-based menu with rollover effects. I&#8217;m not talking flashy rollover effects like the types given to you by various <abbr title="Javascript">JS</abbr> libraries such as <a href="http://mootools.net">MooTools</a> and <a href="http://http://script.aculo.us/">script.aculo.us</a>, I&#8217;m talking a simple image replacement effect. Invoking JS for this sort of thing is bulky and unnecessary when it can be done oh-so-easily with some straightforward CSS.</p>
<p>One highly used method, which I&#8217;ll cover another time, allows you to place browser-rendered text in that menu. That&#8217;s useful for many reasons, but sometimes you don&#8217;t WANT browser-rendered text because you&#8217;d like to use a non-web standard font but wish to maintain the text in place for screen readers and SEO. In this case we want to create a menu using the &#8220;Cooper Std&#8221; font. So let&#8217;s get started.</p>
<p>First, the markup:</p>
<pre><code>&lt;ul id="menu"&gt;
	&lt;li class="home"&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
	&lt;li class="locations"&gt;&lt;a href="#"&gt;Locations&lt;/a&gt;&lt;/li&gt;
	&lt;li class="about"&gt;&lt;a href="#"&gt;About Us&lt;/a&gt;&lt;/li&gt;
	&lt;li class="contact"&gt;&lt;a href="#"&gt;Contact Us&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</code></pre>
<p>That&#8217;s all. It&#8217;s very short and semantically relevant.</p>
<p>For this sort of method it&#8217;s best to create your images as sprites (or one big sprite, up to you.) What I mean by that is to take the image for the normal state and the image for the hover state and place them on one image, like so:</p>
<p><img src="/examples/image-based-menu/step2/images/menu_home.png" alt="Menu image sprite" /></p>
<p>Then rather than calling a different image for the hover action, you just call the same image with an altered background position. You&#8217;ll see what I mean in the code. This helps stop the flicker you would get when the browser tries loading the new image when hovering, and it also lowers the amount of requests made to the web server. It would be even better to place all of the images into one big sprite map, but for the sake of this tutorial we&#8217;ll just create one sprite per menu item.</p>
<p>This, without styling, will produce <a href="/examples/image-based-menu/step1/index.html">the following results</a>, so anyone in a text browser will still be able to see your links. So let&#8217;s start adding some styles.</p>
<pre><code>body {
	margin: 0;
	padding: 10px;
	font-family: Arial;
	background-color: #303136;
	font-size: .75em;
	color: #333;
}
ul#menu {
	list-style: none;
	margin: 0;
	padding: 0;
	height: 25px;
	width: 520px;
}
ul#menu li {
	float: left;
	display: inline;
	height: 25px;
	margin: 0 10px;
}</code></pre>
<p>This will give your menu a bit more structure. What you&#8217;re doing here is creating the menu as an unordered list with static height/width dimensions. With text-based menus you generally want to stay away from hard-coded height properties to account for users who wish to increase or decrease their font sizes and not allow that to break your design, but in this case that&#8217;s not necessary since these are images.</p>
<p>We&#8217;re floating the list items to the left to create a &#8220;seemingly inline&#8221; list out of what are block elements. The &#8220;display: inline&#8221; property is there <a href="http://www.positioniseverything.net/explorer/floatIndent.html">as a fix for IE6</a> adding a random margin.</p>
<p>Next thing we want to do is add the images to each class along with their corresponding width properties:</p>
<pre><code>ul#menu li.home a {
	background: url(images/menu_home.png) 0 0 no-repeat;
	width: 67px;
}
ul#menu li.locations a {
	background: url(images/menu_locations.png) 0 0 no-repeat;
	width: 119px;
}
ul#menu li.about a {
	background: url(images/menu_about.png) 0 0 no-repeat;
	width: 115px;
}
ul#menu li.contact a {
	background: url(images/menu_contact.png) 0 0 no-repeat;
	width: 136px;
}</code></pre>
<p>Note the background position, &#8220;0 0&#8243;, which is the same as &#8220;left top.&#8221; This will show the image in its normal state. However, we&#8217;ve got a little problem here. The browser-rendered text is showing up, and the menu image only spans as high and wide as the text itself. We can fix that pretty easily with the following snippet:</p>
<pre><code>ul#menu li a {
	display: block;
	height: 25px;
	text-indent: -999em;
}</code></pre>
<p>Setting the inline anchor element to a block element allows us to specify its height and width explicitly. The text-indent will move the text completely out of view. Google frowns upon using &#8220;black hat&#8221; tactics such as hidden text for SEO purposes, but when you&#8217;re doing this to a few words in a menu in which the images you&#8217;re replacing the words with say the same thing, I&#8217;ve never heard of them having a problem with that. It&#8217;s when you start hiding paragraphs of key words out of view that Google decides you&#8217;re no good.</p>
<p>The only thing left to do is the hover state. This will do the trick:</p>
<pre><code>ul#menu li.home a:hover, ul#menu li.locations a:hover,
ul#menu li.about a:hover, ul#menu li.contact a:hover {
	background-position: bottom left;
}</code></pre>
<p>See that? All you&#8217;re doing is moving the background&#8217;s position to the bottom left rather than the top left. It&#8217;s the same image, but it gives the illusion of loading a new one. No flicker.</p>
<p><a href="/examples/image-based-menu/step2/index.html">View the menu</a></p>
<h4>Final touches</h4>
<p>If you&#8217;re using Firefox, when clicking a menu item you&#8217;ll see an ugly dotted line border around the element going all the way to the left edge of the screen. This is something the browser adds itself. There&#8217;s a way to get rid of it though, just add a hidden overflow property:</p>
<pre><code>ul#menu li {
	float: left;
	display: inline;
	height: 25px;
	margin: 0 10px;
	overflow: hidden;
}</code></pre>
<p>Also, if you want to specify a selected state for a menu item, just add an ID attribute called &#8220;selected&#8221; and add this CSS:</p>
<pre><code>ul#menu li#selected a {background-position: bottom left;}</code></pre>
<p><a href="/examples/image-based-menu/step3/index.html">View the final menu with selected item</a></p>
]]></content:encoded>
			<wfw:commentRss>http://orlandodefrias.com/2008/07/10/image-based-menu-with-css/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to stereotype</title>
		<link>http://orlandodefrias.com/2008/07/10/how-to-stereotype/</link>
		<comments>http://orlandodefrias.com/2008/07/10/how-to-stereotype/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 15:54:58 +0000</pubDate>
		<dc:creator>Orlando</dc:creator>
		
		<category><![CDATA[Historic Entries]]></category>

		<guid isPermaLink="false">http://orlandodefrias.com/?p=5</guid>
		<description><![CDATA[Stereotypes.

Well all know what a stereotype is. It is, by definition, a widely held but fixed and oversimplified image or idea of a particular type of person or thing. Few, if any, know the root of the word...]]></description>
			<content:encoded><![CDATA[<p class="note">This is an entry brought over from my old MySpace blog archive.</p>
<p>Stereotypes.</p>
<p>Well all know what a stereotype is. It is, by definition, a widely held but fixed and oversimplified image or idea of a particular type of person or thing. Few, if any, know the root of the word. I believe it&#8217;s</p>
<blockquote><p>[17th century] <strong><em>Latin</em></strong> I don&#8217;t fucking know.</p></blockquote>
<p>However I&#8217;ve been wrong on occasion.</p>
<p>Personally, I like stereotypes. Not only are they hilarious, but it&#8217;s the perfect way to live your life and avoid a dragged out confrontation whenever possible. Let&#8217;s look at a few real-world scenarios and how to handle them in case you&#8217;re ever stuck in a similar situation, using stereotypes as our ever-definitive guide to problem solving:</p>
<div class="post-body entry-content">
<ul>
<li><strong>Scenario A</strong> - You accidentally step on a black man&#8217;s shoes while waiting in line at the ATM. Immediately, you apologize to him by saying &#8220;my bad, G, didn&#8217;t mean to dis the Jordans.&#8221; Note the use of &#8220;my bad&#8221; in place of &#8220;I apologize.&#8221; Black people, like hispanics, do not take kindly to large words, as it is a sign of aggression. At that point he will proceed to telling you a humorous anecdote. No matter what he says, you must laugh&#8230; loudly. All blacks are funny, therefore it is customary to pay your respect, or &#8220;props&#8221;, to the gentleman. If all else fails, always carry watermelon flavored Jolly Ranchers. That, or give him all the money you take out of the ATM, since he was probably in line to rob you anyway.</li>
<li><strong>Scenario B</strong> - Your Middle Eastern cab driver takes a wrong turn on his way to taking you to the airport. In a stern &#8212; but not aggressive &#8212; voice, say &#8220;hey Ahmed, you missed the turn.&#8221; His name may not be Ahmed, however he will not take offense because it shows your attempt at understanding his language and culture. If he does not respond, there may be a problem. At this point you must say, &#8220;yo, Mohinder, do you speak English?&#8221; Notice how you now went from calling him by an Arabic name to an Indian name? That&#8217;s because there was the possibility that you mistook him for one or the other, since it&#8217;s a documented scientific fact that they all look alike. If this does not yield the wanted response, you must exit the cab immediately. The man is clearly a terrorist, say you&#8217;re Canadian and call the authorities once you are far enough away from him.</li>
<li><strong>Scenario C</strong> - After work one day, you decide you will head to a bar with one of your co-workers. Your co-worker, more than likely by choice, happens to be white. While at the bar, you two get to talking about religion and politics. All of the correct responses to his questions should be: A) Republican B) Protestant C) Pro-Bush D) Anti-immigration E) Anti-abortion. Yes, I know this goes against all logic and ethics, but you must make the white man feel at home and in control. If you do not, he will do one of various things white men with a power trip do, which is ruin your credit, arrest you, eat you, wear your skin, etc.</li>
<li><strong>Scenario D</strong> - One night while out at a club, you are approached by an obviously gay fellow. You know he&#8217;s gay, because he has this catty look in his eyes, plus he&#8217;s very well kept, clean shaven, fit, and an immoral heretic child of Satan with impure thoughts. The first assumption you should make is that he wants to have sex with you. It doesn&#8217;t matter that you&#8217;re the &#8216;83 Corolla of the dating scene and your beer gut sticks out longer than your erect penis, he clearly wants to buttsex you. The proper thing to do in this situation is raise your voice at him, in a very authoritative fashion to let him know who the man is. <span style="color: #ff0000;"><strong>Caution</strong></span>: Some gays are quite attracted to this. If you feel you are receiving more approval than disdain, quickly raise your shirt to show him the brown belt you&#8217;re wearing with black shoes. That&#8217;s like kryptonite.</li>
<li><strong>Scenario E</strong> - While eating at your favorite restaurant, the hispanic &#8212; let&#8217;s call him Mexican &#8212; busboy accidentally drops a dirty fork on your table. This angers you, because he took that job away from a 17-year old spoiled rich kid from Wasp KK. Kay Preparatory School who would have taken pot breaks while dry-humping your daughter in the alley. In order to settle this problem, simply threaten to call immigration. For effect, randomly throw in the name &#8220;Elian Gonzalez.&#8221; He&#8217;ll get the message loud and clear, as long as you say &#8220;comprede&#8221;, because hispanics don&#8217;t speak any English.</li>
<li><strong>Scenario F</strong> - You are cut off by an Asian driver, which is extremely common since they can&#8217;t see your car with their tiny, unnatural eyes. You both happen to stop at the same market, and when he gets out of his car you come within 3 feet of each other and lock eyes. The correct course of action is to ignore the situation and walk away. He knows karate.</li>
</ul>
<p>There you have it. If any of the above methods don&#8217;t work, you probably did something wrong. They should <em>always</em> work, no matter the circumstance.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://orlandodefrias.com/2008/07/10/how-to-stereotype/feed/</wfw:commentRss>
		</item>
		<item>
		<title>First post EVER.</title>
		<link>http://orlandodefrias.com/2008/07/09/first-post-ever/</link>
		<comments>http://orlandodefrias.com/2008/07/09/first-post-ever/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 02:06:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://orlandodefrias.com/?p=3</guid>
		<description><![CDATA[I&#8217;ll be redesigning this soon. I&#8217;d like to actually keep a personal blog full of ridiculous entries with special appearances by my old, old MySpace blogs.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll be redesigning this soon. I&#8217;d like to actually keep a personal blog full of ridiculous entries with special appearances by my old, old MySpace blogs.</p>
]]></content:encoded>
			<wfw:commentRss>http://orlandodefrias.com/2008/07/09/first-post-ever/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
