Aug 25

iPhone Libraries

There are many a folk who want to bring apps built upon Rails into the realm of the ever increasingly popular iPhone yet not too many tools may be available for use on the said platform. One that caught developer’s eyes is the rails-iphone-helper library that generates iPhone specific html tags that would allow you to go and tinker around with your iPhone.
The library download available here can be used free but apps must conform to widely accepted standards (whether from the community or Apple) for them to work properly. iPhones have captivated the world and with Apple seemingly trying their best to open their doors to the world they may have done so with the release of some secrets that have allowed the development of these extensions.

No comments

May 25

Cross site Issues

Developers should be aware of the most common forms of cross site problems that can weaken an apps security namely CSRF(Cross-Site Request Forgery) and XSS(Cross-Site Scripting) both of which can lead to infiltration or even hijacking of sessions by unauthorized people or programs that are designed to do just that. SQL injection is another way by which malware enters sites to hijack them, injecting code and doing stuff such as obtaining user information for use later. Robust security is key and should be taken seriously.

The internet is a very wide place to move through but that very movement poses serious threat to users and developers alike who aim to secure data from those who aim to use it for no good.

No comments

Mar 25

App Security Installment

Category: Information

Ever gone through your code and discover stray or strange SQL code? Then you have been infiltrated by malware, injecting it with code that is meant to do anything they wish. Security can be improved by preventing such SQL injections, Executable files, users modifying parameters and unsecured stored passwords, all of these make for bad code and eventually failed security
One way is to prevent executable files from being uploaded for execution. Parameters that are sensitive should be filtered properly ensuring only legit ones are accepted. Ant attribute that you think can make or break down security, make it un-editable by using proper parameters.

No comments

Jan 25

How to Ensure Security in Ruby Apps

Security is the first priority when it comes to ruby apps for without it, however robust and well thought of a program is, it’s bound to fail. Many developers have had recommendations on how to get about this but here are some of the most important points to consider when building and deploying Ruby Apps.

Authorization is two things, one is to allow people to get into the site/app and the other is to let people do things within the said app. Such is a case such as in WP which has different user levels, admin allowing you to do almost anything. Users can log-in and modify their profiles but other than that they are given no other rights. More tips in upcoming posts so do check back for more.

No comments

Dec 10

Comments (Part 1)

Category: Basics,Set-Up

Their use seems elementary but ask any well-seasoned programmer and they too use them. It allows you to understand complex functions or to explain the operation you’re going to do or just about what ever you would want to include in your programs as long as they are treated as comments. They also make great tools when troubleshooting/debugging programs for sometimes, the long days and nights do translate into a lot of code, some of which look almost all the same. Ruby reminds me of a documentation program we had included with previous programming languages such as C and even Cobol which has an add-on or function with the compiler which dissects the program and documents everything.

Comments are off for this post

Nov 10

Converting Classes in Ruby

Category: Basics

The two basic numeric data types in ruby floats and integers are treated in several classes or methods so we have to be very clear on which is which and how methods work on them. As discussed the standard mathematical operators treat numbers differently depending on the method they were presented a sample of which is shown below:

String#to_i : This method/operation converts String to Integer
String#to_f : This method/operation converts String to Float
Float#to_i : This method/operation converts Float to Integer
Float#to_s : This method/operation converts Float to String
Integer#to_f: This method/operation converts Integer to Float
Integer#to_s: This method/operation converts Integer to String

Comments are off for this post

Oct 10

Ruby Mathematics

Category: Basics

The language supports the two number types, integers (whole numbers) and floating point numbers(fractions). For integers, there are instances of Class Fixnum and Bignum and floating point numbers there are instances of class float.
RoR as any programming languages can perform all forms of mathematical operations. It gives reflects integers when two integers are added and vice versa with floating point numbers which will give a floating point number when a fraction is divided by an integer. These operations are treated as intact methods along witht he various mathematical processes are also treated as methods just the same which gives them the properties of an operator of sorts. Narray as the name suggests, is a package that functions to handle arrays of large sizes. Other ruby libraries such as Vector and matrix are very strong extensions of C which can handle statistical information.

Comments are off for this post

Sep 10

Yield statement Continued

Category: Basics,Sample Code

The previous post using the yield statement gives us the following output which shows the ease of using blocks in programs which can be used to pass on parameters to the other parts of the same statement.

The code from the previous post gives the output:
Hi There
Hi There
Hi There

The code between the curly braces is associated to the method three times and within that yield command is called three times in succession, each time calling the code contained within the block giving the three output code in the form of the greeting. We will discuss the concepts behind the ‘yield’ statement in the next posts as we continue to build-up up our skills while aiming to use more of the simplified methods used in ruby to further shorten the code making it easier to implement and use..

Comments are off for this post

Aug 10

Using the ‘yield’ statement

Category: Basics,Sample Code

It might be almost similar but relatively different in a big way for blocks may appear only in the source adjacent to a method call which means it should be written on the same line as the method’s last parameter and it is not implemented once it is encountered but, Ruby rather remembers the context by which the block of code appears then enters the method. Within the method itself, the block of code may be called as if it were a block in itself by using the ‘yield’ statement. After the block of code has been executed, control returns immediately right after the call to the yield statement. Sample use of ‘yield’:

def threeTimes
yield
yield
yield
end
threeTimes {puts “Hi There”}

Comments are off for this post

Jul 10

Simplifying the previous program with modifiers

Category: Basics,Sample Code

As said in the past post, there is an easier way of doing the stuff we did in the last program which would be very helpful when coding thousands of line of code when you do end up building your own programs is ruby.

class BookList
def [](key)
if key.kind_of?(integer)
result = @Books[key]
else
result = @Books.find { |aBooks| key == sBooks.name}
end
return result
end
end

Simplifying the code further by using the ‘if’ statement as a modifier it becomes a shorter easier to attain the same results as with the first program:

class Booklist
def [](key)
return @Books[key] if key.kind_of?(Integer)
return @Books.find { |aBooks| aBooks.name == key }
end
end

The use of the ‘find’ command in Ruby is simply a call to a function that is executed and it can be compared to a block call in many other languages such as Perl, C++ or Java.

Comments are off for this post

Next Page »