Tuesday, September 18, 2012

Wednesday, April 25, 2012

Difference Between a Method and a Function

Simple Answer is to this question is function is just a part of code that executes code and can return something. A method is, in Object Oriented Programming, a function that is bound to a class. As in C# there are no stand-alone functions, every function in C# is a method just like in Java.

Let's start with properties. Properties are characteristics of an object. Examples of objects? JFrame, JButton in Java are objects. Objects can also be defined through class definitions and are instantiated when called upon and used in a program.

Methods are tasks that are tied directly to an object. They occur when an action takes place upon that object. They do not exist without the presence of that object.

Sub Routines (otherwise known as Independent Sub Functions) are functions that are completely INDEPENDENT of OBJECTS. That means that they can be called from anywhere in the program. They do not have a "return value," though they can return information to the calling function via parameter passing by reference.

Functions are code blocks thay create change on some variable or object. They are not necessarily tied to an object (though all methods are functions) and usually have a "return value" that is caught and used somehow in the calling function. Most often, this return value is stored in a variable, though the function call itself can be used in a subsequent function call (example: Dim sum as Integer = Add(getnumber() + 2) )

Thursday, March 8, 2012

Ten disappointments with iOS 5.1



While the focus of Wednesday's Apple event was primarily on "the new iPad" and the perpetual hobby that is the Apple TV, we would be remiss to forget iOS 5.1. Past point releases of the OS included notable improvements like Game Center in iOS 4.1, and the Nitro JavaScript engine, better Home Sharing, and Personal Hotspots in iOS 4.3. While Apple updated apps, and released the stunning iPhoto for iOS, how is iOS 5.1 itself likely to be compared to past releases? To some, it will be a little disappointing. 
With the help of Ars's Macintosh Achaia to refine the points for this article, here are ten annoyances that will remain with us as part of iOS—at least until the next iOS release rolls around.

System Requirements

Ever type an URL in Safari and see a short pause on the second or third letter as browsing history is searched? These senior Safari moments and other performance complaints on older hardware will not cease with iOS 5.1. Any additional snappiness or better battery life will be, at best, subjective.

File Management

There will be no iDisk replacement because buying Dropbox was both Plan A and Plan B, that is unless Plan A is the end of discrete file management in Apple’s vision of personal computing. That would also explain the current OS X Finder.

Syncing

Syncing will still not really be syncing. Delete a contact or calendar event on an iOS device and it rightly disappears everywhere. Delete content like podcasts or movies and everything reappears when synced unless deleted from the computer running iTunes. We're still waiting for post-PC equality.

Mail

Mail needs work. There's still no junk mail filtering on iOS devices, and if filtering is too CPU intensive or battery draining, how hard would it be to allow marking junk mail for the server side of things? Signatures by mail account is another simple improvement, too. Collapsable folders and sub-folders would be another.

Notification Center

Notification Center also remains unfinished. Little annoyances, like "Clear" buttons so small they appear designed for Homo floresiensis, will remain tiny. All notifications will remain from all calendars, as well, even though Calendar itself allows hiding calendars from view. Don’t expect Notification Center on the iPad to actually use the larger display any time soon, either.

Messages

Messages still continues to treat the same person sending a text from different sources as different people, despite Contacts understanding that people have more than one phone number or e-mail address.

Photo Stream

While Photo Stream finally allows for the deletion of indiscriminate pictures, does it matter if Photo Stream can’t really be shared? You can pay $4.99 for iPhoto, and most will, but why isn't there a Photo Stream website for all to see whether or not that’s an iPhone in your pocket?

App Store

Imagine going to the grocery store and being forced to buy one item and leave before coming back for something else. Welcome to the App Store, which kicks you entirely out of the app after every purchase.

Mute

There will probably never be a visual indicator for the menu bar showing the iPhone is muted. You can just stare at the side of the iPhone instead of the display, or put hand in pocket and finger the switch to see if it vibrates.

Default Apps

You will continue to be unable to delete applications like Weather or Stocks on your iOS device. Yep. Still.

What else?

One could go on, and some will no doubt disagree on the validity of some choices, but there’s another point to be made. Apple will easily sell 100 million iOS devices this year, perhaps as many as 200 million. Those buying will very likely continue to report the highest level of satisfaction with Apple’s handhelds and tablets. It’s hard to find disappointment in that.
References 

Thursday, March 1, 2012

Note Taking Apps on iPad

Last week I decided to replace my notepad and ballpoint pen with a iPad and a stylus. I was hoping this would make my life much easier without having to look for missing papers and notebooks. With this decision, it came the quest to find a good note taking app for iPad. As usual I wanted this app to Sync everything I note down across all my devices.

First I found this app called Penultimate.

This is a pretty nifty app for AUD .099 and works pretty great. It also has wrist protection and so you can take notes as you were using a paper note pad. There are custom paper designs built in and you can buy more designs if you want to.This app allows you to create and manage 100s of notebooks. Also it has a very handy feature to backup to a directory on Dropbox. Also you can backup to a note book in Evernote if you want to. (we'll talk about this next). I've been using this app for over a week now and I'm getting use it very well. I might be better off with a good Stylus rather than the cheap one I have right now, but for now they seems to make a pretty good combination.

Evernote

This is a document management tool. You can get a iPhone and iPad version from Apple App Store as well as a Mac version from Mac App Store. For those of you using Linux or Windows, you can use the web interface, which is very similar to Mac application. This tool allows you to organize your text notes, PDF docs, Images and even voice notes into directories and store them in a central location. These data gets sync between all your devices where you have Evernote app installed. However those of you who don't would have to use the web interface, which is really easy to mater. 

Right now, I do all my handwritten notes using Penultimate and then transfer them to Evernote, so no matter where I go, I'd always have all my notes with me.

Till next time...

Thursday, January 5, 2012

Feature of Buxfer

I've been a Buxfer user since early 2009. After doing lots of research over the internet I chose Buxfer to be my personal money managing software. There are lots reasons I like Buxfer. First of all I had the freedom to add my own manual accounts and transactions. Also it allowed me to do transfers between my accounts. I wasn't forced to enter my online banking log in information to download transactions. It was a great piece of software. Also mobile version of the website is very user friendly and I could enter my transactions on the go. This is why I'd choose a cloud finance software over a desktop one any day for personal use.

However since early 2011, Buxfer seems to be loosing it's quality. Site went down for 4 days in January 2011 and they lost a moth worth of my transactions. This is not acceptable for a finance software. It makes you seriously wonder about their back up procedures and security of very confidential information.

Again December 2011, there seems to be few bugs such as balances wasn't updating properly and scheduled transactions were massed up. I emailed the owners of the company and it took them days to fix these issues. I still have a issue with my tags which hasn't been fixed for months now. That is when I started to look for a alternative tool to Buxfer, but my search for a new finance tool has not been successful so far.

However I found 2 alternative services that are free and almost meet my requirements. 

1. GNU Cash - www.gnucash.org

GNU cash is a free open sourced accounting software. It does everything Buxfer does for you. One of the problems I faced is this is a desktop application. So I need to have access to a PC that this software is installed. However this software runs on Mac, Linux and Windows which is very flexible. You can save your data file on a file sharing service such as Dropbox and have access to that file from multiple locations. However what puts me off is not having access to my data on my iPhone.

2. Clearcheckbook - https://www.clearcheckbook.com

This is a service very similar to Buxfer. You can have almost all the features you'd get with Buxfer. There's a basic free membership and a paid premium membership. Premium membership allows you to upload data files such as CSV. Also it can predict your financial feature based on your current and scheduled transactions. But there is a one problem. You don't get the fancy smooth user interface that Buxfer gives you. Also if you add a new tag or a transaction, you'd need to refresh the page for it to appear on your widgets. However they have a quite fancy iPhone app, it's lot better than Buxfer's mobile web app. 

Anyways I've decided to stick with Buxfer for a little bit longer and backup my transactions every month. If they decided to shut Buxfer down in the near feature, I'd sadly have to switch to one of the above solutions. I'm hoping insted of shutting Buxfer down, the owners would open source it or sell it. So one my favorite service can remain on the internet... 

SSH login without password

Your aim

You want to use Linux and OpenSSH to automize your tasks. Therefore you need an automatic login from host A / user a to Host B / user b. You don't want to enter any passwords, because you want to call ssh from a within a shell script.

How to do it

First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:

a@A:~> ssh-keygen -t rsa 
Generating public/private rsa key pair. 
Enter file in which to save the key (/home/a/.ssh/id_rsa): 
Created directory '/home/a/.ssh'. 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/a/.ssh/id_rsa. 
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is: 3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A


Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine):

a@A:~> ssh b@B mkdir -p .ssh 
b@B's password:

Finally append a's new public key to b@B:.ssh/authorized_keys and enter b's password one last time:

a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys' 
b@B's password:

From now on you can log into B as b from A as a without password:

a@A:~> ssh b@B hostname B


A note from one of our readers: Depending on your version of SSH you might also have to do the following changes:
Put the public key in .ssh/authorized_keys2
Change the permissions of .ssh to 700
Change the permissions of .ssh/authorized_keys2 to 640

Reference