Top 10 Government Sites Powered By WordPress

Many are choosing wordpress as the base platform for their project. In fact, toady you will find many .gov and .org sites are based on wordpress. Here, I have collected Top 10 Government Sites Powered By WordPress.

I love wordpress and didn’t realize America.gov and other important government websites were running wordpress too.

Top 10 Government Sites Powered By WordPress.

Advertisements

code snippets

Creating a boolean radio button set while trying to build upon the source code samples in Beginning Rails book, but was having trouble with the radio buttons: selecting second one didn’t do anything, the first one would automatically get re-selected. Realized what the problem was: the label tags were messing me up. I needed to wrap each option (belonging to the radio group) in its own label tags. Duh!

 'create' do %>
Course ID:

User ID:

Rating:

 Yes! 
 No!

Comments:




Configuring my workspace

Ok, so trying to get back into the (programming) swing of things, been spending my day re-configuring my laptop to become a lean, mean, programming platform. Of course my life would be easier with Mac OSX, but I’m stuck with my ThinkPad X60s laptop for now. (When is Apple going to come out with a truly lightweight ultraportable??

My setup so far

  • cygwin – for Linux-like interface (making sure to install bash, screen, xrvt, vim, X11, etc.)
  • vim – my favorite text editor (using gvim.exe Win32 edition for use out of cygwin)
  • ruby – downloaded a Win32 edition (can also use InstantRails as a “shortcut”); also installed rails
  • mysql – everyone’s favorite (free) database, right? (postgresql is cool too)
  • apache – installed it, but haven’t had time to configure that one (correctly) yet

Why screen?

Screen will allow me to have a few vim sessions open, plus a ruby console, and mysql console, and yeah, mongrel running from a command line all within one (or more) terminal window. I can toggle between screens with a simple key-command. Plus, I can “detach” the screen, close the terminal window and the sessions will persist in the background. Once I’m done with “other work” I can tell screen to “reattach” and all my files and applications will still be there.

Yeah, there are other IDEs out there I could use (such as Eclipse, etc.), but since I hardly have time to learn ruby as it is, I’m sticking to what I learned “back in the old days”, which was not that long ago anyway 😉 I’m a big fan of learning how to program on UNIX using command line environments. It may not be “user-friendly” but learning to operate in a lean environment like that comes in handy later on. Plus, I haven’t seen any text editor that truly rivals vim or emacs. 😉

Some early challenges

So, I had some trouble running ruby scripts within cygwin’s bash shell. Something about bad file extensions, missing ruby gems, and other random crap. Given I have ruby installed in both “regular” Win32 version and in cygwin, and can’t get rails installed in cygwin, I probably shot myself in the foot. It works perfectly fine using windows xp’s dos shell (cmd.exe), so i’m calling cmd within a bash shell and running ruby from there. Not pretty _at_all_ but it gets the job done, and with Duo Core + 1.5GB in RAM, I have plenty of memory and CPU to spare.

Also, couldn’t get screen to work correctly in cygwin’s bash. Seems like a bug, but thanks to this site, I found a work around using xrvt: when reattaching to a screen, need to use screen -D -RR and it works.

Here’s my shortcut for C:cygwinbinrxvt.exe -fn “Lucida Console-14” -geometry 160×60 -sr -sl 1000 -e /bin/bash –login -i

Resources

I found this site after working through this, wish I had found it earlier: http://infrablue.tripod.com/cygwin.html

I agree with the author, quoting him,

For many, including myself, the shell environment is the most critical part of a system and graphical applications and utilities are often superfluous, distracting, wasteful of resources, and even dangerous. Most of the command GNU command-line utilities are practically universal and can be used on everything from supercomputers to small handheld devices.

Learning Ruby on Rails

I have heard a lot about the Ruby on Rails web application development framework and decided to give it a try. I feel like I’m getting “back to my roots” by taking on a programming project. It’s been a few years since I code, so I’m ready for a challenge. I picked up APress‘s Beginning Ruby (by Cooper), Beginning Rails (by Hardy and Carneiro), and Ruby On Rails E-Commerce (by Hellstane and Laine) from Barnes and Nobles and have been trying to through it. You don’t hear this often about programming books, but I must say the Beginning Ruby book is quite a good read. I’m trying to get through the beginning rails book as quickly as possible to get to the E-Commerce book, which steps you building an entire online bookstore application.

Rails reminds me of a computer science project my classmates and I worked on as undergrads — creating a model-view-controller (MVC) framework (though I don’t remember using that acronym back then) — and so far the framework is very intuitive. I couldn’t get the scaffolding stuff to work as in the book, however, so I gave up on that (for now) and am moving on. After some web research, seems like the version of rails has changed scaffolding around and now my book is slightly out of date. Oh well. I’ve included some links below in case other people are running into the same problem.

Google group discussion thread on scaffolding issue

Rails 2.0 blog post

Ruby Forum post on scaffolding issue (very useful)

Cool blog I just found: http://iwiwdsmi.blogspot.com/ “This site contains my (Sofeng’s) notes as I learn VxWorks/ Tornado, Emacs, Eclipse, Cygwin, Python, and Django on Windows XP and Ubuntu Linux. Feedback or referrals to similar content are welcomed.”