Feeds:
Posts
Comments

Posts Tagged ‘programming’

This is helpful to have the single login for multiple level domains. Edit your environment configuration and add something like this; (E.g in environment.rb or production.rb) config.action_controller.session = {:domain => “.arthurneil.com”, :key => ‘_arthurs_session_id’, :secret => ’4gfsdf234jmfv35ksdf23m44m4m4neserf345′} Likewise, to target the cookies based on particular domain, try; (E.g) cookies[:my_test_cookie] = {:value => “test”, :expires => [...]

Read Full Post »

Static and Dynamic Libraries

Static Libraries Historically, libraries could only be static. A static library, also known as an archive, consists of a set of routines which are copied into a target application by the compiler, linker, or binder, producing object files and a stand-alone executable file. This process, and the stand-alone executable file, are known as a static [...]

Read Full Post »

Compiler and Interpreter

Compiler A compiler is a computer program (or set of programs) that transforms source code written in a computer language (the source language) into another computer language (the target language, often having a binary form known as object code). The most common reason for wanting to transform source code is to create an executable program. [...]

Read Full Post »

Migration column type… Converts to MySQL field type… Available options :binary TINYBLOB, BLOB, MEDIUMBLOB, or LONGBLOB2 :limit => 1 to 4294967296 (default = 65536)2 :boolean TINYINT(1) – :date DATE – :datetime DATETIME – :decimal DECIMAL :precision => 1 to 63 (default = 10) :scale => 0 to 30 (default = 0)3 :float FLOAT – :integer [...]

Read Full Post »

The first thing is, we can have something like inline exception handlers. rescue_from ActiveRecord::RecordNotFound do render :file => ‘/bad_record’, :status => 404 end Block can even take have an argument for exception object. rescue_from ActiveRecord::RecordInvalid do |exception| render :action => (exception.record.new_record? ? ‘new’ : ‘edit’) end The above method will be helpful if we use [...]

Read Full Post »

Rails comes with a script/runner script that can be used to run the code in your Rails app. There’re many ways to organize your code to let this runner script execute it, but one obvious way is to write the code as a model’s action. Here are quick steps for doing this: 1. Insert the [...]

Read Full Post »

Read Full Post »

function inspect_object( obj ) { var str = ”; for( var memb in obj ) str += memb + ‘ = ‘ + obj[memb] + ‘n’; alert(str); return str; }

Read Full Post »