-
- Easy Flash Debugging on OSX.
-
I recently took on some contract development for another AS3 project and because I wasn’t particularly happy with the way I debugged my flash work in the past I decided to come up with a better solution. Not many traditional flash coders realize that they can view the output from their trace statements on a live compiled SWF. The way you do that is fairly straightforward.
-
- I’m Working on a Product.
-
Earlier this month I started working on a product. It’s nothing new. It’s pretty basic. It’s going to be really cheap. But I think it will be pretty cool. I’ll post screencasts once I finish more of the javascript. Until then, announcing this is just a tease and motivating factor. I’ve said it; now I need to go forward and finish the first version.
-
- Using Presenters in Rails
-
Sitting thrugh my first tutorials session at RailsConf we’ve come across an interesting discussion about the philosophy of using the ‘Presenter Pattern’ to refactor code in your applications controller.
-
- Blogging is not Technology.
-
Last week I was invited to speak at a local NetSquared meeting out in Tempe. Presenting on the topic of blogging forced me to take a step back to look at what I’ve been doing over the past seven years. I realized all of the technological connotations associated to blogging are irrelevant. Blogging is not about the web, rss feeds, or technology. That is just a means to an end. Blogging is about people, it’s about voices, blogging is all about you. Blogging is a medium for distributing both fact and opinion. It’s about discussion and connecting people in a relevant context. The technology just helps run the show.
-
- Less Markup Is Better Markup.
-
There is a lot of ambiguity when it comes to writing semantic markup in HTML: to what extent should we markup data? How semantically detailed do we need to be? While there is no specific rule of thumb, I will say that the less the better. When writing markup, be as clean as possible without losing meaning. Much like how The Elements of Style emphasizes brevity in writing - a sentence should use as few words as possible without losing it’s meaning - an html document should use as little markup as possible without breaking the context of it’s content.
-
- Write HTML That Means Something
-
HTML is often overlooked in development projects. Rendering errors and other visual debacles tend to shift a developer’s focus away from HTML’s actual purpose: semantics. It’s been said before but I feel we still need to emphasize the fact that HTML has nothing to do with the visual presentation of the layout we are attempting to create whether it be for the web or any other medium.
-
- Utilizing Regular Expressions in AS3
-
Regular Expressions are a powerful tool that you can utilize in many different programming languages. After throwing together the little twitter widget at the top of this page - I was informed by Brian Shaler of a major bug that causing it to crash. So while reworking the code to fix it I figured I’d add some much needed functionality as well. You see, just grabbing the feed from twitter does not generate html links for you. You have to parse your feed and wrap any ‘@username’ responses, or ‘http://addresses’ into actual hyperlinks yourself. Here’s how I did it.
-
- Simple AJAX Links With Prototype.js
-
Getting my head wrapped around Prototype.js has been a difficult process. But today I was faced with the simple challenge of creating links that could load external files into divs embedded onto the page. Nothing fancy but useful nonetheless. Here’s how I did it:
-
- Ruby: Tax Estimator
-
I got bored a couple of weeks ago and wanted to figure out how much I’d be paying in taxes depending on how much I made. I wrote this little script in Ruby to give me a basic estimate of how much I’d owe. You can use it at your own risk or make it better and share it with me!
Here is the source:
# -------------------------------------------------------------------- # Amounts to analyze taxes for. # -------------------------------------------------------------------- amounts = [40000, 50000, 60000] pto = 80 # Specify amount of hours as integer # -------------------------------------------------------------------- # Tax schedule for 2006 supplied by IRS # (http://www.irs.gov/formspubs/article/0,,id=150856,00.html) # # Arizona tax information obtained from # (http://dab.nfc.usda.gov/pubs/docs/taxformulas/formulas/statecitycounty/taxaz/taxaz.html) # -------------------------------------------------------------------- tax_rates = [0.1, 0.15, 0.25, 0.28, 0.33, 0.35] cutoff_levels = [0, 7550, 30650, 74200, 154800, 336550] pre_tax_balances = [0, 755, 4220, 15107.5, 37675.5, 97653] az_tax_rates = [0.1,0.19] az_cutoff = 10000 work_hours = 52*40-pto # -------------------------------------------------------------------- # Extend the numeric clas to accomodate formatting. # -------------------------------------------------------------------- class Numeric def to_currency sprintf("$%0.2f", self) end def to_percent sprintf("%d%", self*100) end end # -------------------------------------------------------------------- # Calculate the amounts. # -------------------------------------------------------------------- for amount in amounts # Determine the federal witholding bracket index = 0 for cutoff in cutoff_levels if amount > cutoff then bracket = index end index += 1 end # Determine the state tax withholding percentage (amount < az_cutoff) ? az_index = 0 : az_index = 1 # Calculate withholding amounts and remaining income tax = (amount-cutoff_levels[bracket])*tax_rates[bracket] + pre_tax_balances[bracket] az_tax = tax * az_tax_rates[az_index] income = amount - tax - az_tax # Print out the results puts "---------------------------------------------------------------" puts "Income Analyses for #{amount.to_currency} w/ #{pto} hours of paid time off " puts "---------------------------------------------------------------" puts "This level of income would put you in the level #{bracket+1} tax bracket which charges #{tax_rates[bracket].to_percent}." puts "In addition this income qualifies for the #{az_tax_rates[az_index]} state income tax level." puts "Total income: #{income.to_currency} after #{tax.to_currency} in federal tax expenses and #{az_tax.to_currency} in state tax expenses.." puts "------------------------------\nPost Tax Income\n------------------------------" puts "Monthly income: #{(income/12).to_currency}" puts "Bi-Weekly income: #{(income/24).to_currency}" puts "------------------------------\nHourly Income\n------------------------------" puts "You are going to work #{work_hours} hours this year." puts "That will make up #{(work_hours.to_f/(365*12)).to_percent} percent of your active time." puts "Before tax your hourly income is #{(amount / work_hours).to_currency} taking paid time off into account." puts "After tax your hourly income is #{(income / work_hours).to_currency} taking paid time off into account." puts "\n\n" end
-
- Blogging Software
-
I am growing very VERY VERY tired of wordpress comment spam! Becuase it’s so standardized and widespread it’s an open target to these attacks. Here’s an analogy.. using wordpress instead of a homebaked or less popular blogging system is like using a PC instead of a mac when it comes to viruses! Geez. Oh well this is not meant to be a rant, rather I want suggestions. What do you guys suggest I switch to?
Presently, I’m considering Mephisto. I don’t like wordpress becuase I think it’s too feature rich andheavy weight. I want something lightweight that’s easy for me to hack into and add my own code on. I truly dislike the notion of upgrading. Once I setup a blog the code is hacked apart by myself so much that upgrading just isn’t an option. So what are your thoughts? What do you recommend? Should I just build my own blogging software? Should I try out Mephisto? Are there any other decent CMS systems that are preferabbly Rails based?