Blog



Languages

February 1st, 2010 (Web)

Lately, I’ve been on a kick of wanting to experience a broader set of languages, frameworks and programming techniques. I listened to an (epic?) episode of FLOSS Weekly with Kent Beck on Extreme Programming and have been thinking about going back to some of my textbook learning in college and applying it to real projects.

First off, I’m going through a Python book as I figure it is not too huge of a leap syntax-wise from PHP. Aside from a little bit of syntax difference, there are a few nuances conceptually (everything is an object, different data structures like tuples, etc…), but for the most part, it seems to be pretty straightforward so far coming from a PHP background.

However, I’ve been hearing a few rumblings lately about PHP gaining a little more traction as a respected language – Facebook after all uses it. In fact, an employee at Facebook has even been rewriting PHP from the ground up for speed. It sounds like it may finally be a compiled language which could help with performance issues.

Other platforms I would like to dive into include Ruby (and RoR) as well as going a little deeper with Javascript frameworks and some of the nuances between the toolkits/frameworks. I also like the idea of accountability that is a part of Kent Beck’s “Extreme Programming” style.

For now, I’m picking Python to use for my next personal project. Once I pick a project, I need you to keep me accountable to finish it.

  • Digg
  • del.icio.us
  • Facebook
  • Twitter
  • Slashdot

4 Comments »



HTML and CSS Starter Templates

January 5th, 2010 (Web)

Out of laziness, when building a website, I’ve often just started with one of the Dreamweaver basic template layouts – I’ll go in and delete a bunch of stuff and rework it to the way I wanted. This included copying and pasting code from websites I have built previously and rewriting the same sections of code with each new site. I was also using Dreamweaver as a code editor just because I started there. Dreamweaver is quite bloated however and if you are not using the WYSIWYG features, it is completely unnecessary. There are much better text editors out there already. I’ve currently switched to Notepad++ on the Windows side (what I use at work) and so far it has been working out quite nicely. I have put together a base CSS (2.1 and 3 valid) and HTML (5 spec valid and backwards compatible) template file with the structure I typically use for building a site. There are a few items in the CSS (like the comment block at the top) that are geared towards Wordpress users, but those can be ignored or removed as necessary. Now, let’s see the code. First the HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Website Title</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
</head>

<body>

<!-- the header -->
<div id="header">
	<div class="container">
		<div id="menu">
			<ul>
				<li>Item 1</li>
				<li>Item 2</li>
				<li>Item 3</li>
			</ul>
		</div>
	</div>
</div>

<!-- main content of the page -->
<div id="content">
	<div class="container">

	</div>
</div>

<!-- footer -->
<div id="footer">
	<div class="container">
		<p>Copyright &copy; yyyy Website Name
	</div>
</div>

</body>
</html>

Pretty basic, right? The only thing that might throw you off is the DOCTYPE. This is the way HTML5 does it – much simpler. Also, there is some Javascript included for backwards compatibility with IE.

Now, on to the CSS

/*
Theme Name:
Theme URI:
Description:
Version: 1.0
Author:
Author URI:
*/

/* reset styles */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var, b, u, i, center,
dl, dt, dd, ol, ul, li, fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
	margin: 0; padding: 0;  border: 0; outline: 0; font-size: 100%;
	vertical-align: baseline; background: transparent;
}
body { line-height: 1; }
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; }
:focus { outline: 0; }
ins { text-decoration: none; }
del { text-decoration: line-through; }
table { border-collapse: collapse; border-spacing: 0; }

body {
	font-size: 62.5%;
	text-align: center;
	color: #000000;
}

/* container - place inside each section or around the entire page depending on your layout */
.container {
	width: 960px;
	margin: 0 auto;
	text-align: left;
	position: relative;
}

/* for clearing any floats <br class="clearfloat" /> */
.clearfloat {
    clear:both;
    height:0;
    font-size: 1px;
    line-height: 0px;
}

/*--- header section - put whatever you want here ---*/
#header {
}

/*--- horizontal "block" menu ---*/
#menu {
	float: left;
}
#menu li {
	display: block;
	float: left;
}
#menu li a {
	display: block;
	text-decoration: none;
	height: 50px;
	width: 125px;
	padding: 5px 10px 5px 10px;
}
/* wordpress specific menu stylings */
#menu li.current_page_item a {
}
#menu li.first a {
}
#menu li.last a {
}

/*--- content section - put whatever you want here ---*/
#content {
	font: 1.2em Verdana, Arial, Helvetica, sans-serif;
}

/*--- footer section - put whatever you want here ---*/
#footer {
}

A few things of note in the CSS. One is that at the top, I’m using a modified version of Eric Meyer’s CSS reset. I changed some of the spacing and indentation to make it a little more compact. I also removed the ‘content: none;’ from the ‘blockquote’ and ‘q’ resets so the stylesheet would validate with CSS3. A final modification I made was to the font size (from 100% to 62.5%). This resets the font base to 10px for easy em calculations (i.e. 1.4em is a 14pt font). The rest of the stylesheet should be mostly self explanatory.

So, what do you use as a starting point when building websites? What do you like about my templates? What don’t you like? What would you do differently?

Finally, last but not least, here is the zip file if you want an easy download: SZ’s Barebones HTML and CSS.

Update: I made some minor changes to the font placement in the CSS file. It didn’t quite work properly before. I’m now setting the font size to 62.5% in the body rather than in the reset. Font size can be defined in em’s in individual classes or ids.

  • Digg
  • del.icio.us
  • Facebook
  • Twitter
  • Slashdot

5 Comments »



Veridian Dynamics…Predicting the Future

December 18th, 2009 (Life, Tech)

Veridian Dynamics

So, you know that ABC show, Better off Ted? It’s based around a company, Veridian Dynamics, that makes cool products based on research in their labs. I’ve found this strange phenomenon happening where I watch an episode of Better off Ted and then a few days later find that the product they created has actually just been created in RL (real life).

OK, so maybe this doesn’t happen with every episode, but I’ll give you two examples:

  1. Season 1 Episode 2 – Phil and Lem (Veridian’s top two scientists) grow beef in the lab. The day after I watched this (not the day after the episode was released), I saw this article titled Scientists ‘grow’ meat in laboratory. Creepy.
  2. Season 1 Episode 13 – Veridian Dynamics introduces a face-scanning Internet search program. On Dec. 7th, 2009, Google introduced Google Goggles. While this software is initially intended for identifying places, it will also, once privacy concerns are worked out, identify faces in the near future and perform and Internet search on the person.

So, how is Better off Ted predicting the future? Do they have insider information in science and tech industries? I don’t know the answer, but if I see another scenario like the two above, I will have to believe that it is more than just coincidence.

  • Digg
  • del.icio.us
  • Facebook
  • Twitter
  • Slashdot

2 Comments »



The Tenants of Google

November 26th, 2009 (Web)

On This Week in Google: Episode 17, Leo suggested that Google may have a set of rules that they follow when building each of their products. Matt Cutts responded with a few of the fundamental tenants of Google. I have listed these below.

  1. Don’t be evil
  2. Organize the world’s data to make it useful
  3. Don’t trap user data – Eric Schmidt, Web 2.0, 2006
    • Be an advocate for users
    • Compete on merit (don’t give yourself an advantage – no proprietary APIs, etc…)
  4. Regarding products…
    • Go for a great product first, then figure out how to monetize
    • Don’t launch a “me-too” product – add some innovation to your product

I know a lot of people are very wary about Google especially as they grow into a larger and larger corporation. While they do seem to be reaching into more technology spaces, it is interesting to see how carefully they make their approach.

What is your take on Google and their level of “evil-ness” in the marketplace? How well do you think they follow the tenants outlined above? Are there more that should be added to this list?

  • Digg
  • del.icio.us
  • Facebook
  • Twitter
  • Slashdot

3 Comments »



Why host my own?

August 26th, 2009 (Tech)

twitalytic

Social websites open the door for anyone to easily place their content online. This is great as it eases the barrier to entry, but think with me for a few minutes about the implications.

What if it goes down?

We have all seen Twitter’s growing pains over the past couple of years. As people are beginning to rely on Twitter more and more as a source of news, this becomes a bigger issue. It was interesting to watch a few weeks ago when one user’s (Cyxymu) Facebook, LiveJournal, Twitter and YouTube accounts were DDOSed and to see the effects on the various services. Twitter could not handle the load and was down the better part of the day. Facebook had some issues, but handled things better than Twitter (they isolated the attacks) while Google’s services didn’t take much of a hit at all (they have tons of servers and a nice redundant/self-healing network). A year ago, hardly anyone would have cared that Twitter was down, but now it is almost as if CNN went down.

Who owns my content?

That is a good question. Who owns your content when it is stored on a server that you don’t own. What would happen if Facebook went out of business tomorrow? Or Gmail? What would happen to all of your messages…all of your email? Sure, they may say that you own the content, but ultimately the control of it is in the hands of owners of the server where that content resides.

Finally….security

Of course, security is an issue that must be consider whether you are administering a server or somebody else is. MySpace is a great example of a network with very little concern for security. Accounts on that network were being compromised left and right. By the same token, Twitter can distribute a virus just as quickly as it can dispense the news. Security is always a concern when you have the control, but when you don’t, it is an even riskier issue.

Conclusion

There must be an answer to all of this madness. Well, I don’t think there is one elegant solution, but there certainly are options if you are comfortable with a *nix server.

  • Twitalytic – Gina Trapani of Lifehacker is working on a tool to keep a local copy of your tweets (and related tweets from your friends) and do interesting things with them. Things like statistics, matching responses with the original tweets, etc… I’m trying it out on my server at the moment, and while it is definitely still an “alpha” product, it looks very promising. I think the end goal of it is to eventually be a federated Twitter network….when Twitter goes down, the Twitalytic nodes can still communicate amongst themselves (using pubsubhubbub of course).
  • Fever – Fever is a feed reader that you run from your own server. Not only does it help you take control of the feeds you read, it also helps you read them more efficiently. I have not tried this yet as it is not free, but looks like an interesting option.

So, there you have it. My little rant on why you should host your own stuff. I don’t always follow my own advice, but it is something I have at least been thinking about lately. What are your thoughts or solutions to this problem? What apps do you use now to help you out until an ultimate solution is discovered?

  • Digg
  • del.icio.us
  • Facebook
  • Twitter
  • Slashdot

1 Comment »