Skip to main content

Posts

JavaScript Rocks

Here's a bold statement... (so I made the font bold) JavaScript is the best programming language Here's why... The language is extremely powerful .  Let's imagine that we are inventing a new programming language.  The most important thing we will focus on is "power."  That means... write more elegant , more flexible , more readable programs... and write them  even faster . Closures.  A completely awesome, overlooked feature of JavaScript that we all (hopefully) take for granted.  Closures allow you to create a new instance of a function which retains access to the context in which it was created.  Examples are here:  http://en.wikipedia.org/wiki/Closure_(computer_science) . Dynamic data types.  JavaScript variables aren't restricted to any particular datatype.  Store a String, store a number, or store an Object.  JavaScript automatically casts datatypes back and forth as needed. Objects are basically associ...

Top 25 Explanations by Programmers when their programs don't work

I found this list absolutely hilarious.  I've starred the ones that I use the most.  :) Top 25 Explanations by Programmers when their programs don't work: 1. Strange...  **** 2. I've never heard about that. 3. It did work yesterday. ** 4. Well, the program needs some fixing. 5. How is this possible? ****** 6. The machine seems to be broken. 7. Has the operating system been updated? 8. The user has made an error again. **** 9. There is something wrong in your test data. 10. I have not touched that module! 11. Yes yes, it will be ready in time. ** 12. You must have the wrong executable. 13. Oh, it's just a feature. ** 14. I'm almost ready. ** 15. Of course, I just have to do these small fixes. **** 16. It will be done in no time at all. *** 17. It's just some unlucky coincidence. 18. I can't test everything! 19. THIS can't do THAT. 20. Didn't I fix it already? ****** 21. It's already there, but it has not been tested. 22. I...

Alright... Who Configured Sudo?

noob@genie:~$ make me lots of money bash: make: command not found (thinks...) "Ah ha!" noob@genie:~$ sudo apt-get install make [sudo] password for root: Where did you learn to type? [sudo] password for root: Maybe if you used more than just two fingers... [sudo] password for root: Just what do you think you're doing Dave? sudo: 3 incorrect password attempts (whaa... Aw, crap!  Why do I need root's password?!?!)  "Who configured sudo on this server?  Oh wait... I know..." noob@genie:~$ sudo apt-get install make [sudo] password for root: Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed:   make 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. ... (after a short while) noob@genie:~$ make me lots of money bash: No more wishes remaining.  Goodbye! logout ".... $&#*"

Recurring Events in MySQL

This article describes how to store recurring events in a MySQL database. This might be useful if you're building a calendar or some sort of job scheduler. The table for storing recurring events is inspired by cron http://www.manpagez.com/man/5/crontab/ . You will notice obvious similarities between the table structure and the structure of a crontab file. The table structure also uses the SET datatype in MySQL. You should be familiar with this type before you continue. Documentation can be found here . Just as an example, I'll create a table that can be used to schedule the automatic updating of files. Here is the SQL statement you might use to create this table: CREATE TABLE `File Update Scheduler` (  `Filename` varchar(255) NOT NULL default '',  `LastRefreshed` timestamp NULL default NULL COMMENT 'Timestamp indicating when the file was last refreshed',  `ScheduledMinutes` set('0','15','30','45') NOT NULL COMMENT...

JavaScript Sticky Footer and Scroll Effect

This post talks about two different HTML/JavaScript effects: How to keep a page footer stuck at the bottom of the browser window. How to create a scrolling <div> without using a scroll bar OK. So... you have a website. You want a header stuck at the top of your page and the footer stuck at the bottom of your page. The stuff in the middle, you want to be able to scrollable. But, you don't want those ugly scrollbars to the right of your scrollable text. Maybe, instead, you'll have up arrows and down arrows above and below your <div>. When you mouseover the arrows, the text in the <div> will move up or down and create a scrolling effect. Suppose your page looks like this... <html> <head> <title>Test</title> </head> <body> <div style="position: relative; width: 700px; margin-left: auto; margin-right: auto;"> <div id="header">Header</div> <div id="scrollUp...

Zip code Functions for VBA

Haven't posted anything to my blog in a while... so here it goes. I figured that I would contribute some of my code (albeit pretty horrible code) for those who use VBA. I personally don't care much for VBA, but I use it a lot to do some pretty neat stuff in Excel. Anyway... these VBA functions utilize Microsoft's XMLHTTP Object to get some valuable geographic/zip code information. I have provided a few VBA functions. Some of these functions are definitely hacks, as they assume that the USPS website's structure will remain the same. Although, in my opinion, since USPS.com is run by the US government, it probably won't change any time soon. :) Function GetCityState(zipcode As String) This function connects to the USPS.com website to get the city and state abbreviation for the zip code provided. Function GetZipcode(address As String, city As String, stateAbbr As String) As String This function connects the USPS.com website and tries to get the zip code, given ...

Reasons Why 2010 is Going to be Sweet

Reasons Why 2010 is Going to be Sweet I have NO PLANS for this year -- that means I have no idea what's going to happen!  NONE!  I have nothing to lose, and everything to gain!  This is awesome! School is out for at least 8 months!  Hello, free evenings! I'm currently only working 3 days a week at GOJO!  Hello, free weekdays! Alabama is going to win another National Championship!  Yeah, I said it! I might be going to graduate school.  This means I'll at least be working toward a masters or doctorate.  One of my dreams is to be a college professor, and this would be one more step to get there! I'm going to start another business.  I'd tell you what it is, but it's secret squirrel stuff.  This time around, I'll have more time to put effort into it. I have a great family and wonderful friends to help me out!  You guys rock! There are other reasons, but... ehh... I gotta go get ready for the OSU game.  I have people coming over, and I don't want my pla...