May 11
Who Uses Ruby on Rails?
When it comes to infrastructure, Ruby on Rails is all over it. From start-ups to non-profits for venture projects of businesses, Rails can handle it. It is the best tool for almost whichever kind of web application (software collaboration, community, e-commerce, content management, statistics, management, etc). Shopify, Yellow Pages , Backpack, Github and Twitter are only some of web sites that uses Ruby on Rails. These web sites have trusted Ruby on Rails do manage their web applications that is made easy to use for people browsing, customers and people in need of the information provided by the web site.
No commentsMay 10
Ruby on Rails Essentials
Because of its success, popularity and functionality, Ruby on Rails performs with an extensive variety of web servers and databases. Recommended for web servers would have to be Apache, lighttpd or nginx in place of Mongrel or it can be by means of FastCGI. Meanwhile, for database, the following have been suggested to be utilized: MySQL, PostgreSQL, SQLite, Oracle, SQL Server, DB2 and a lot more of servers that Ruby on Rails support and work well with. There is no limitation or strictly recommended on which operating system to use, but the best to make use of is a ‘nix-based one for deployment.
No commentsMay 6
Codes, codes, codes… There has been a reason why the 1-2 code ages ago were put away, how can you read a message out of only two numbers, 1 and 2? Thanks to technology’s non-stop improvisation and development, everything is made easier and produces solutions to problems, faster. This is Rails goal: write less code, get done more in less time. Little framework does much more. And why not opt for Rails? It is integrated with AJAX functions and object-oriented database handling. Most companies trust Rails which means, it is something you can really rely on. So that’s why not.
No commentsMay 2
What Can Be Gained with Ruby on Rails?
Since you are just starting, and you are curious, you can gain a lot from Ruby on Rails. You can basically inscribe your individual cookie-cutter Web 2.0 application a lot vigorously and you can do it in no time compared to other languages or network. Codes and the like really takes up a lot of time, and simple mistakes can make you go crazy. But using Ruby on Rails is actually no pain at all. It is easy to use and saves a lot of time. It will just make you feel so blessed you live in this century, people decades ago would have died for Ruby on Rails.
No commentsApr 29
Regular Expressions and Blocks (Continued)
The caret “^” and the “&” operators are used for matching the beginning of a string, and also for the end of a string shown below:
matching =/[a-e]$/
The script would look for similar letters between “a” and “e” respectively including the end of the string. To search for a letter inside a string:
[A-Z] all uppercase letters
[a-z] all lowercase letters
[0-9] all digits(numbers)
To restrict the range, say to look for only the letters between “a” and “e”, you write it as [a-e] combined with the caret operator shown below:
[^A-Z] all other characters except uppercase letters
[^a-z] all other characters except lowercase letters
[^A-Za-z] no letters, whether upper or lower case
Apr 25
Regular Expression and Blocks
Ruby expressions would be shocking for the uninitiated or those who are shifting form other programming languages. If you have experience with Perl or Python, then you’re in luck for they won’t send you packing up and running in fear. The term “regular expression” is used to have a program check if it looks like something else in terms of similar characters or spacing, length or a myriad of other things that you may think of. The table form Ruby.org summarizes all the Ruby expressions and elements. Regular expressions are used for matching certain patterns such that if you’d want to check for a digit you use the \d expression or to match a space character, you use the \s expression to match a space character.
No commentsApr 21
Unless
Unless is another control structure similar to “if..else’ that is for conditional processing and it is used as follows:
unless condition
instruction1
else
instruction2
end
Again, it uses the “end” statement to terminate the control structure. The “case”, control is more of a screening process that allows say the element of an array or hash to be evaluated to meet a specific set of conditions. It is used as follows:
case variable
when condition1
instruction1
when condition2
instruction2
……
……
when conditionX
instructionX
else instructionA
end
Apr 17
Sample “if…elseif….else”
if condition1 (is true)
instruction a
instruction b
.
.
instructionX
elseif condition2 (if the condtition 1 returns false evaluate with condition2)
instruction c
instruction d
.
.
instructionX
else (if the result is false for both levels then the following code is executed)
instruction e
instruction f
.
.
instructionX
end
The control structure evaluates the necessary ‘contition1′, if it returns true if executes instructions that follow the if statement. If it is false, it proceeds to the elseif using ‘condition2′ to evaluate it, if it satisfies condition2, then it executes code that immediately follows the elseif control. If both evaluations return false, it then proceeds to execute the instructions after the else control.
No commentsApr 13
Control structures
Control structures are blocks of code that result in either a true or false and are more commonly called loops. Loops are dependent on the satisfaction of certain conditions like in the sample program below that uses the “if..else control(loop):
if condition1 (if condition 1 is true)
instruction 1
instruction 2
.
.
instructionX
else (if condition 1 is false)
instruction 3
instruction 4
.
.
instructionX
end
As you can see, the simplicity of Ruby has it working without the need for the curly braces as with C++. Ruby simply uses the “end” keyword to signify the end of the “if..else” control structure. Another way of doing the same thing but with more conditional procesing is with the the “if..elseif..else” control structure. Syntax is shown in the following post.
No commentsApr 9
Functions and Built-in Functions
A function is a way of shortening repetitive parts or blocks of code that are called again and again. Their use benefits the user by first of course, shortening the amount of code lines for having the same block of code appearing again and again wastes time and effort. It also allows the same block of code to be accessed by more than one program. It allows the programmer to break up complex tasks into smaller applications that are easily understood, and last, it allows the programmer to create and hide critical functions such as password and username encryption and decryption routines. Functions are mostly user defined but there are a couple of dozen or so that have been pre-defined and are included in the standard Ruby distribution package. Being open sourced, there are a whole range of functions that have been created and shared by the many ruby programmers out there that is shared across the whole globe.
No comments







