<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener("load", function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <iframe src="http://www.blogger.com/navbar.g?targetBlogID=8334277&amp;blogName=Sriram&#39;s+Blog&amp;publishMode=PUBLISH_MODE_BLOGSPOT&amp;navbarType=BLUE&amp;layoutType=CLASSIC&amp;searchRoot=http://metallicatony.blogspot.com/search&amp;blogLocale=en_US&amp;homepageUrl=http://metallicatony.blogspot.com/&amp;vt=-8718433808682107797" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" height="30px" width="100%" id="navbar-iframe" allowtransparency="true" title="Blogger Navigation and Search"></iframe> <div></div>

Thursday, December 22, 2011

The Secret by Rhonda Byrne

My 28th birthday anniversary was marked with lots of joy, happiness, gifts and surprises. Of all the gifts, the best one was a Harmonica from my fiancé. This post is not about that harmonica but rather about a nice gift from my uncle. It’s a book called “The Secret by Rhonda Byrne”.
First of all, I never have or had the habit of reading books. So to a person like me, if you ask something about spiritual books, I would scream a big NO. I’m just a null pointer having /dev/zero opinions about spirituality”. I always presume that books of that sort are never going to tickle any of my numb nerves. After reading this book, I should say that I didn’t feel anything great about it. But i would accept the fact that the author had made many good points. Sometimes while reading, I felt a bit bored because the author was trying to stress the same point over and over. But on another note, whatever statements the author was trying to emphasize were good. To speak from the heart, after reading this book, I was able to realize and understand the mistakes that i’m doing in my day-to-day life. I can easily consent with anyone that I need to fundamentally shift the way I see and face things in life. I felt its good to bullet out the most important points presented in this book so that it might be useful for others too.
  • Humans are like a transmission tower emitting a wave of a specific frequency whenever they think. Their thoughts could be a good one or a bad one. In either case, a wave is transmitted. Thoughts are basically magnetic and according to the universal law of attraction - That single thought of yours in turn attracts more and more of similar thoughts and swamps your mind. The final state of your mind and body are determined by those thoughts that you received. Good and healthy thoughts are going to provide you a happy state of mind while the negative or unhealthy thoughts lead you to a bad state of mind. And that’s why its always important to think good and positively in life.
  • Given a situation in life, its impossible to completely avoid thinking negatively. Negative thoughts might come but don’t drown yourself completely with those. Don’t even try to think too much about “what is wrong or what you should not do”. Rather try to think only about “what is good and what you have to do”. The author quotes an example that Mother Teresa once said that she will never participate in an anti-war rally but she said she will be ready to join if it’s a "peace rally". Don’t let the negative thoughts dominate you and make the law of attraction send you more of negative thoughts. If you want to stop the negative thoughts try to meditate for few minutes or try to do some secret shifters like listening to your favorite music, thinking about some pleasant memories. In short, take control of your mind and think only the good ones.
  • When you want to reach a goal or when you want to become something in life, always firmly believe that you will reach it and you will get it. Visualize and dream that you are already there and you have already become what you want to. Start loving it. Start visioning it. Start seeing them with your own eyes. A shortcut to manifesting your desires is to see what you want as real. Actions will automatically follow those thoughts and will drive you to success.
  • Be thankful for what you are and never complain about your current position. If you complain, remember you are talking about a negative thing, you are thinking a negative thought and you are calling the law of attraction to bring in more complaints about yourself into you. Learn to be happy with what you are. Try to help others in need. Always remember to show your gratitude to others.
  • If you don't know anything that your colleagues and friends are discussing about, be ready to accept the fact. Its always nice to be open and accept the not-known things as you don’t know.. instead of trying to put a fake-show. Its better not to speak up if you don't know 100% about the topic in discussion or question. Exhibiting this character reflects a positive opinion about you and makes everyone feel good about you.
  • Don’t be over-confident about yourself for everything. But at the same time when you think about yourself, try to feel good and treat yourself with respect and love. If you do so, the law of attraction will show you great things about yourself. Focus on what you appreciate about your friends, colleagues and partner. Learn to love them instead of blaming and complaining. Appreciate and talk only about the goods and strengths. Don’t let your mind to even think about the DON'Ts, When you think good thoughts, talk good things, radiate good energy and reflect good feelings, you become a good person.
The secret behind anything in life is “The law of attraction”. When you understand the behavior of this law and take control of your mind and body, you win your life.

Labels:

Thursday, July 28, 2011

OS X Lion

OS X Lion ImageAmid all the hype and expectations, OS X Lion was released on July 20th 2011. Though Apple website dropped the "Mac" branding from the OS name starting from this version, I was still able to see the "Mac" word inside the downloaded dmg package under /Applications folder. Even during installation, I could see the word "Mac" everywhere alongside "OS X". Hopefully Apple will take a clear stance in the next versions.

As Apple is not providing any optical media installation source from this version but provides only digital download, i had to burn the installation DMG to a DVD. I agree that this is not needed because even in case your computer crashes, Apple provides recovery mode and Internet recovery modes to fix your dead computer. No need of using optical media to recover from a crash. So i would say, burning install disk is really not needed. But curious minds, don't stop yourself :)

On another note, there were a couple of computer concepts that happily lived with us right from the dawn of personal computing age until the release of Lion. Apple reworked on some of the concepts and sent a bold statement to the computing world "We were all wrong. This is how it should be!!".

And before getting into the details, please note that this post will not talk about all the new features that were introduced in Lion. This just briefs about the changes that I noticed and the ones that I liked or disliked. By doing this task, it provided me an opportunity to explore the applications that i commonly use and to know more about what has changed. Hopefully this might be useful to one or two in internet.

Air Drop
[Bluetooth is dead]

Air Drop is a new feature using which users can send and receive files to other Macs that are in the same WiFi network. No special settings are needed to configure. It just works right out of the box. Apple calls this as "Send it via Air". Gone are the days of Bluetooth. Gone are the days where all communications in a WiFi network has to route via the wireless access point or Hotspot or Wireless Router. This is the age of WiFi Direct where in any two devices that have soft AP can directly communicate between themselves instead going via the wireless access point. Sounds interesting? This is the same technology that is used to perform wireless printing from your iPad.

The cool thing about AirDrop is - it appears in the side bar of finder and when you click it, finder automatically shows all the computers that are WiFi Direct capable. I dragged and dropped a file over another device that showed up in AirDrop. Instantly, i received a popup in the other device that a file is being sent. Once accepted, the transfer happened immediately. Transfer was quick and instant.

Network Sharing
I tried out Network sharing between Macs (using AFP) and it worked like a charm. Apple provides multiple file sharing services using different types of protocols like Apple Filing Protocol (AFP), Server Message Block (SMB) and Network File System (NFS).

Finder
  • Finder is the default file manager in OS X. There were a couple of improvements that were done in finder. It now includes a new option called “All My files” in Favorites side bar. “All My files” groups & lists all files in your computer based on the file type. It organizes & presents all your files as flow covers which was fantastic and appealing. By default, Finder opens “All my files” which was sort of annoying to me. Instead, I configured Finder preferences to Open “Macintosh HD” (root folder) by default. I had to also enable Status bar and Path bar which were disabled by default.
  • I wanted to add Pictures and Downloads folder to the favorites side bar as I use them frequently. Adding to side bar is as easy as dragging and dropping the folders to the sidebar.
  • One more important point to note is: Finder will not show “Library” folder (under your home directory) by default. As you know, Library folder is where all user selected settings live. To temporarily navigate to the "hidden" Library folder, press Option key and the GO menu from the menu bar. Instead if you want to permanently show the library folder, run chflags nohidden ~/Library in Terminal.
  • If you drag and drop a file with a file name that already exists in the directory where you are dropping, then Finder provides you with an option of merge alongside Replace.
FaceTime
[If i'm ok to just receive calls, why do i need to login in a chat app?]

FaceTime is Apple’s video calling software application that first appeared in iOS4 and then it was inherited into OS X 10.6.6. I did not try out the FaceTime version in 10.6.6 but had a chance to use it in Lion. Before getting into the marvels of FaceTime, I would like to remind that the web camera which comes with MacBook Pro is a 720p camera. By that I mean, it has a resolution of 1024x720 which is 0.92 M pixels. Opening FaceTime will start the webcam as well. It will also recognize your Apple ID and will pull all your contacts from the Address Book application. FaceTime can make calls to other iOS users (who have FaceTime feature) if their phone numbers are present in your Address Book. If the called party doesn’t have a phone number but uses a Mac and you know their Apple ID, then too you can call them using FaceTime. To accomplish this, Apple ties all your Apple device IDs with your Apple IDs and stores in their servers. When you make a call through FaceTime, the request goes to the Apple Servers and from there it is redirected to the called party’s device. The beauty is that the called person need not have their FaceTime application opened in their Mac. The calling request automatically opens the FaceTime application in the called party's Mac and provides the option of Accepting or Ignoring the call.

I wonder why the desktop versions of Skype, Yahoo or GTalk services never got this idea!!

Auto-Correction
OS X Lion imported the text auto-correction feature from iOS. And yes, auto-correction is terrible. It has to be improved, actually has to be improved a lot.

Full Screen Apps
Full Screen Application is a nice feature introduced in OS X Lion. Combined with “Places” (virtual desktop), full screen apps becomes an excellent feature. You can have multiple virtual desktops and have your frequently used apps placed in every desktops. You can even loop around the desktops easily with finger gestures. But at present, only very few number of apps support this full screen app feature. And the shortcut keys to toggle to full screen mode are not the same in all apps. For example, Option Shift F is the shortcut in Chrome, Option Command f in Terminal and Control Command f in Safari. Its different for every application which is kind of frustrating to me!

But, one thing is sure - You know what? I love working in the Terminal app switching it to full-screen mode. It reminds me of the shell consoles seen widely in Linux and Unix systems.

Mission Control
Mission Control & Launch Pad apps are present in the dock and they can also be invoked using gestures. Swiping all four fingers up opens mission control. Mission Control shows dashboard and all the virtual desktops that you are using. Swiping Left and Right using all four fingers iterates through the virtual desktops. You can push any running application to any of the virtual desktops and organize for better working. There is no “Send to Desktop” feature for applications. Had it been, things would have been much easier to organize the applications into the desktops rather than dragging and dropping. This “Send to Desktop” is commonly seen in GNOME desktops.

Launchpad
[No more start menus. Just Pinch & Launch]

Launchpad is the new application launcher in Lion. It displays iOS like icon grid of all installed apps. It has multiple pages and can group apps into folders like in iOS. You can open Launchpad if you pinch with your thumb and three fingers. I don't normally use Launchpad. Instead I open spotlight (Command + SpaceBar) and type the app name that i need to open.

Aqua, Scrolling & Gestures
[Rebirth of Scrolling, Death of Keyboard Shortcuts]

  • The famous Aqua color was removed and the menu selections are now in dark blue color. Bulged aqua scroll bars are replaced with overlay scroll bar as seen in iOS. The concept of scrolling is now reversed. This took a while for me to adapt but it surely brings me even closer to the screen and content. The bold move of reversing the scroll concept made me to give a deep thought about the concept of scrolling that existed with us all these days. What does the user want? He wants to scroll the content up so that he can look at the content in the bottom of the app window. To do that, he deviated from the content and focused on pulling down the scroll bar which in turn moved the content up. So the old scrolling concept aimed on moving the scroll bar instead of the content. Why didn't we keep it simple? And here comes Apple.. It re-thought about this scrolling action and redesigned it to show "this is how it should be". In Lion, you just need to pull the scroll bar down to move the content down and push the scroll bar up, to move the content up. The presence of overlay scroll bar indicates to the user that there are more contents in the page that can be seen by scrolling. Yes, this type of scrolling is already there in iOS and it was spawned to Lion from there
  • As like iOS, now all windows have rubber band scrolling enabled. If you move the scroll bar to the top of window and still try to scroll up further, the content of the window is pulled down a bit like pulling a rubber band. Another new feature to notice is to make a fast scrolling action and take your fingers off the track pad. This will scroll the active window for a while and then it slowly decelerates to finally come to a stop.
  • If there are multiple windows (e.g. window1 and window2 - can belong to different apps) opened and placed one over another. If you move your trackpad pointer over the active window (window1) and scroll, it scrolls the content of window1. That's expected. But, without making window2 as active (or bringing to the front) just move the pointer over window2 and try to scroll again. Hurrah! It scrolls the content of window2!!
  • The old three finger left and right swiping was replaced by 2 finger left and right swiping. The 2 finger swipe is not supported by Chrome browser and so i had to fall back to 3 finger action in System Preferences. Until the gestures were introduced in Macs, I always felt that Keyboard shortcuts are the quickest way to perform an action. But after gestures were introduced, my usage of keyboard shortcuts has reduced a lot but i strongly feel, they will still co-exist.

Phew! Lots of new features and lots of changes to know! The performance of old Snow Leopard was good enough to a low end user like me. Even after adding a number of new features in Lion, I did not notice any degrade in the operating system performance. It is quick and glitch-less.

And at last, this long post comes to an end. I will keep updating here if i'm wow-ed with any other features!!

Labels:

Saturday, March 26, 2011

iPhone Code Samples

I decided to host all my sample iPhone code somewhere in the web. I believe by doing this way i wont lose them and they might also be helpful to other developers. Tried out a couple of project hosting sites and finally boiled down to either Google Code (svn) or GitHub (git). After getting a feel of both, i decided to go for GitHub. Currently this project " iPhoneCodeSamples " contains a handful of programs that can be used to learn about views, view controllers, basic interactions, events, actions, controls, ActionSheets, Alerts, screen orientation using autosizing and autorotation. There are also programs that use content views, multiview architecture, picker components, tab bars, navigation controllers and tableviews. I have decided to keep adding more sample code to this project as and when i write something useful. This project can be downloaded for your use or you can even browse code snippets using GitHub's inline viewer too. Feel free to modify and use at your own ease and risk :)

Project repository can be accessed from iPhoneCodeSamples - GitHub.


LRButtonClick
LRButtonClick is the simplest of all examples. It presents two buttons and a label. Based on the button that was tapped by the user, it changes the text in the label.

MultiControlExample
This example introduces various controls like buttons, segments, switch, sliders and passive controls like labels, image views and static controls like text fields. It pops with a number or alphabetic keyboard according to the type of text field and resigns the keyboard when the user taps anywhere else. The slider control changes the number value as per the slided control. This example also hides the unneeded controls and is capable of detecting which segment was tapped. It makes use of Action sheets, alerts and demonstrates how to use a custom image for a button and to switch the image based on the state of the button that changes again based on the user action.

Autorotate
This example shows how to make use of the autorotation feature. The screen size of iPhone is 320x480 (widthxheight) in which 20 pixels will be taken by top status bar. So effectively it is 320x460 (in portrait mode) and becomes 480x300 (in landscape mode) when the phone is tilted by 90 degrees. Accordingly the view of your app should be rearranged to present the contents better. There are various ways to do this task but this example takes the route of having two pre-constructed views - one for portrait mode and the other for landscape mode. It shows how to detect the rotation and animate the view rotation accordingly.

SwitchView
SwitchView has a Root Controller with two different view nibs and a controller for each of those views. It shows how to make use of the root controller and switch the views determining the tap action if performed by the user on the button provided in the app. While doing so it animates the view transition with a flip and curl up effect. This is accomplished by using animation blocks and view transition effects. Switching is done by detecting whether they are already associated with their superview, inserting if not and removing the previous view from the view hierarchy. The views also have a center button that when tapped, pops up with an alert (yes, the same type of alert that pops when your battery is low).

Single Component Picker
This sample program dictates how to make use of a picker component and tie it up with a datasource and delegate. The datasource will be needed by the picker to show the information to the user and the delegate will be used to draw the title and to respond to the actions performed by the user as well.

Dependent Component Picker
This sample takes us to the next level of showing how to use a dependent picker. By that i mean, when the user has to select a date, say we can show 3 pickers - one each for Year, month and date or when the user has to choose zip code, we can show 3 pickers state, city, zip. These pickers are called dependent pickers because the data that needs to be shown in any of the child pickers is dependent on the selection of data in the parent pickers. The source of data is a plist file and a set of array and dictionary data structures are used to accomplish this.

Custom Picker
Custom picker can be visualized something similar to a slot machine that is commonly found in casinos. It dictates how to create a picker component and use image views on it. It also uses a "spin" button with which you can make the picker wheels to rotate randomly. If the images in the picker wheels become the same after you spin the wheels, then it displays that you won a jackpot! Not really though :) But to speak technically, the spin method involves looping through all the components in the picker, generate a random number and then selecting a row in the component based on the generated random number. Sounds tricky?! huh?

Simple TableView
Tableviews (UITableView) and tableview controllers (UITableViewController) are some of the most important concepts. Almost every app in your mobile uses them. This example code incorporates a simple tableview and demonstrates the usage of UITableViewDelegate and UITableViewDataSource protocols to tie the tableview with the data structures (model) using the controller. It takes advantage of dequeued cells and thereby handles memory efficiently. It explores the different elements (Image, TextLabel and Detail Text Label) that are available in every table view cell and shows how to use them.

Section
Tableviews come in two flavors - Plain & Grouped. While the above example shows how to create a plain tableview, this example depicts how to create a grouped tableview. Grouped tableview (similar to settings in every app) can be created by configuring the datasource methods that correspond to sections - like number of sections, number of rows and title name for every section. We can retain the same configuration and switch back the tableview mode to plain style to get an indexed tableview with sections (similar to contacts app).

Nav
Nav sample is all about navigation controller. Without navigation controller, things would have been much more difficult in the app world. This sample comprises a rootview controller and a number of sub controllers. The root controller is the parent controller that presents with a broad level of categories for the user to select. Based on the selection of the tableview cell, the root controller dynamically creates and pushes the corresponding subcontroller to the navigation stack! Again the sub controllers or first level controllers have subcontrollers or second level controllers. All the views for the child controllers are managed dynamically based on the user selection.

This sample shows the categories using the rootview controller.
If the movies cell is selected, the movielistcontroller is pushed onto the navigation controller stack. The movie list controller has an accessory button for every cell. If the accessory button was pressed, that in turn pushes the moviedetail controller to stack.
If the directors cell is selected, the DirectorsCheckList controller is pushed from the rootview controller. This tableview is unique in the way that the user can enable only one of the check marks from the list of cells that are provided. It remembers the cell's indexpath of old selection and the cell's index path of the new selection to accomplish this.

Labels: , , ,