Tutorials
Rails Migrations, Primary key is not allowed in a has_and_belongs_to_many join table
I was working like a fiend on a project, and forgot to add :id => false to a join table migration. For completeness, here’s the migration as it is supposed to look: class CreateEmployeesRoles < ActiveRecord::Migration def self.up create_table :employees_roles, :id => false do |t| t.references :employee t.references :role end end def self.down drop_table :employees_roles [...]
Tags: RoR, Ruby, Ruby on Rails
Posted in: Ruby on Rails, Ruby on Rails, Ruby on Rails, Topics, Tutorials | No Comments »
Rails Application Config
I saw this railscast on application wide configs and I liked it alot, however, I am not big on typing APP_CONFIG[:value][:subvalue] so I have made a small tweak to that, and placed it as a model, which is where I like it to be, as it is a model of the applications configuration, where the [...]
Tags: RoR, Ruby, Ruby on Rails
Posted in: Ruby on Rails, Ruby on Rails, Topics, Web Design | 1 Comment »
Qt C++ Screen Capture using BitBlt
So I got to thinking I wanted to be able to take abitrary screen captures based on some startx/starty -> endx/endy input. I found various sites showing how to do this, but most of them were pretty confusing. I thought I would post the final working code here. void RSystem::snap(int startx, int starty,int endx,int endy) [...]
Tags: C++, GUI, Programming, QT
Posted in: c/C++, C/C++ Programming, Tips and Tricks, Topics, Tutorials | No Comments »
HowTo JavaScript/jQuery place divs in a circle, calculate a cirlce etc.
So, I was working with my father, a physicist and mathematician, who wants to have a little math example done in javascript. We haven’t finished the meat and potatoes of the project, but one hurdle was the necessity to place 8 divs in a circle on the page. This is a variation on the Tirgrams [...]
Tags: Design, HowTo, Javascript, jQuery
Posted in: Javascript Tutorials, jQuery/JavaScript, Tips and Tricks, Topics | 2 Comments »
Tip: Flex/AS3 keyboardEvent listener
If you are writing a flex app, you might get this error TypeError: Error #1009: Cannot access a property or method of a null object reference. if you do, it simply means that you are trying to do something with an object that hasn’t yet been created. If that object is the stage, then you [...]
Posted in: ActionScript 3 Tutorials, Computer Science, Flex/AIR Tutorials, Tips and Tricks | No Comments »
HowTo Knock it off with crazy MYSQL queries and the qTranslate plugin unistall
We’ve all done it. Either we learn some tricks in MYSQL, or read a cool post about some obscure programming trick you can do with SQL and decide to try it in a pinch on a live database. Just don’t do it. 9 times out of 10 you have access to SSH, and PHP, and [...]
Posted in: Computer Science, MySQL, PHP Tutorials, PHP/MySQL, Tips and Tricks, Topics | No Comments »
Google Chrome Proxy Settings
Wow, google really fell down on the job with this one, using the basic windows/IE connection settings for the internet, I know it’s easier that way, but that’s an inconvenience I don’t need. Chrome is faster, but lacking such a basic feature really makes me not want to use it. It’s almost the principal of [...]
Tags: Rant, Tech Reviews
Posted in: Computer Science, General Computing, Information News, Topics | No Comments »
HowTo html input find/replace regex
Whenever I make a form, it’s a bit of a hassle to add in the php support. That is, if the page gets reloaded of sent back, we want to insure that all the valid data that was entered before is maintained. And easy way to do this is: Here is an easy way, tested [...]
Tags: HowTo
Posted in: PHP, PHP Tutorials, PHP/MySQL | No Comments »
Qt C++ application framework evangelism
I am normally not much of an evangelist, but after working with Qt C++ on a few different apps, (my first experience was back when it was still trolltech and I was running KDE on Mandrake Linux, ahh the good ol days.) and all I can say is: This is C++? Qt is the C++ [...]
Tags: C/C++, Programming, QT
Posted in: c/C++, Qt, Topics, Tutorials | No Comments »
RubyGems 1.2+ Index not found, gems fail to install/update slow/sluggish
I had this problem while running sudo gem install anything, like sudo gem install sqlite3-ruby or what not, albeit while running Ubuntu in VirtualBox. The fix that worked for me was editing /etc/resolv.conf and using google’s public dns nameservers of 8.8.8.8 and 8.8.4.4 Now it works fine… Go figure. Related Posts:HowTo set hostname/domainname on linuxWhere [...]
Tags: Command Line Commando, Errors, Linux, Ruby, RubyGems
Posted in: Computer Science, General Computing, Information News, Topics, Tutorials | No Comments »
