Sunday, October 28, 2012

Cisco VPN Client 5 Connection issue on Windows 8

After installing Windows 8, I was setting up the new OS for work, play and development. Almost everything went without any issues, except - when I tried connecting through Cisco VPN, I got an error message :


"Reason 442 : Failed to enable Virtual Adapter"


Following are steps I took to solve the issue, and hope it works for you as well.


Warning: The solution involves editing windows 8 registry. Done the wrong way, editing the registry may cause your Win-8 to become unstable, and you may need to re-install windows. Proceed with caution, and only if you know what you are doing.


1) On the "Run" dialog (Windows Key + R), type "regedit".



2) Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CVirtA


3) Double Click on "Display Name" string to edit it, and change it to "Cisco Systems VPN Adapter for 64-bit Windows"



4) Exit Regedit; Start Cisco VPN, and try to connect. It should work now!.


Good Luck!


References:


http://www.bidn.com/blogs/BradSchacht/ssis/3103/cisco-vpn-client-5-on-windows-8

Sunday, September 09, 2012

Joomla 2.5–Documenting the Basics!

 

Note: I'm trying out dictation to create blog posts. There may be errors in the post as I progress.

Joomla! is a powerful content management system (CMS), with backend technology as PHP. Joomla! can be utilized to create impressive websites and can be used to enable multiple people to collaborate and share information without having much knowledge of web development. Joomla! also features a powerful user access features enabling a website to have a public and private areas.

The initial learning curve for Joomla! is on the steep side, but once we get the hang of it, it becomes relatively straightforward.

Joomla! is backed by a number of third-party modules, plug-ins, and templates. These can be used to define the functionality of our website with little coding. At the same time, if there is a functionality that requires development, we can create our own plug-ins or modules as well. Custom user interface can be achieved by creating your own templates.

Before getting started with a Joomla! website, the first step is to plan the website properly. We should have an idea of how the website is going to be organized, what the menu structure would be, what kind of content is going to be displayed and what the target audience is.

The reason why we need this planning is because when creating content in Joomla!, we follow the “CAM” approach. The CAM stands for Category, Article, Menu. Content in Joomla! should be created strictly in this order. This is because an article should always be assigned to a category, and a menu to an article or a category.

image

 

Creating a new category using category manager

After logging in as admin,click on the category manager icon.On the top left,click on the new icon to open category editor.

image

Provide a category title, and select a parent category. It is the top-level category, and select parent as “No parent”. We will later and articles to this category.

Note that the alias will be auto created based on the title. Of course, we have the option of creating our own alias as well by typing in an alias.

Using Joomla!’s UAC (user access control), we can control the access permissions of this category. Basically the access permissions of a category gets applied to all articles assigned to this category. This can be overridden in an individual article.

image

Once all the information about a category has been entered, click on the save button at the top left hand corner.

 

Creating a new article and assigning it to a category

After logging in as admin, click on “Add New Article” button from the Control Panel. We can also use the menu path “Content –> Article Manager –> Add New Article”.

Give a title, and choose a category for this article. The importance of preplanning of site starts becoming apparent here. Without prior planning, the categories may not be in place and there will be confusion assigning articles to appropriate categories. Additionally, planning helps set access levels for the site users.

Use editor at the bottom of the page to create the page contents including graphics, links, page breaks …etc.

Click on the save button ones editing is complete.

image

 

Creating site menus

Till now whatever work was done on the site, that is, creation of categories and articles did not change anything on the site. This is because for the site to display content, it should be linked to a menu.

After logging in as admin, to create a new menu click on the menu manager button. Alternatively use the following menu path: “Menu –> Menu Manager”.

By default, a menu named “Main Menu” is already created and assigned to the site.

Click on “Main Menu” to open the menu for editing. Use the “new” button on top left to add a menu item.

To create a new menu, we have to specify the “Menu Item Type”. A menu can have multiple functionalities based on the chosen menu type. It can be linked to an individual article, an entire category, news feeds, contacts, and many more. The most basic menu is the link to an article. To do this, choose single article from the pop-up options after clicking on the select button.

image

Give a menu title, and in the required settings on right hand side, select an article to be displayed and clicking on the menu item.

Monday, September 03, 2012

Dividing and formatting long articles in Joomla!

Sometimes when creating Joomla! site there may be articles or pages with long content. However, we may be able to separate them into logical sections.

In Joomla!, we utilize page breaks between such logical sections, and we can configure the page break plug-in to modify its appearance and functionality.

Here are the steps to insert multiple page breaks into an article and modify the presentation of these page breaks.
1) To insert a page break inside an article, press the page break button at the bottom of the editor.
2) Repeat insertion of page breaks in the article where required, as shown in the below screenshot.
image
In the above screenshot, each of the horizontal line represents a page break I inserted in the article.
3) Next, go to Extensions –> Plug-in manager, and select the plug-in “Content – Pagebreak”, as shown below.
image
4) Within the page break plug-in, we can modify the basic options to fine tune the page break functionality and appearance. One of the options is the presentation style, and setting the presentation style to “Sliders” can give the following effect.

Experiment with other options on the page and see its effects on your Joomla! site.

Saturday, August 25, 2012

Shortcut to insert multiple rows in Microsoft Excel

Sometimes, when working with Excel we will need to insert multiple rows or columns within a worksheet. There are no obvious shortcuts for achieving this. Here are a set of key combinations that can be used to speed up multiple insertions of rows or columns.

  • To insert a row, press Alt + i , and then “r” key.
  • To insert a column, press ALT + i, and then “c” key.
  • To repeat the last action, press F4 key. Keep pressing F4 key until the desired number of rows or columns are inserted.

 

Thursday, January 12, 2012

Learning Objective C - Part 2

Topics Covered

In this post, I will be making notes/pointers on following topics

  • How to add a UI element to Interface Builder.
  • How to declare controller variables of type IBOutlet, and IBAction
  • @property and @synthesize

 

Here is a link to first part of this post : Learning Objective C - Part 1

 

Once we create an iOS project in Xcode, we will be presented with couple of files, as shown in the following screen shot.

 

FileList

The files which end with ".storyboard" file names form the UI components of the application. (Atleast, that is my understanding as of now… will change this post if I find otherwise).  As the name indicates, the one with _iPhone will be the iPhone UI, and the one with _iPad will be the iPad UI. At this time, I think we will have to create separate UI for these different devices, but we can link these UI elements to the same code/objects that we create in our application. This gives us the flexibility of tailoring our UI to different device sizes, which will result in a better app experience for the end user.

It is now time to add several UI elements into the application. You can select UI elements from object library, and adjust their properties. Here is an example of an iPhone Screen.

NewImage

In the above example, I have added a text box, and a button. There is also a label, which is invisible here.

The text box, and the label forms the outlets here. We will handle the button through actions.

 

Declare Controller variable types for IBOutlet and IBAction

Because we are following MVC architecture, we will be going through the controller to perform something in the application from the UI layer (View). Inorder to achieve this, following steps have to be done

  • Declare appropriate variables in Controller object to hold reference of these UI elements
  • Create "Getters" and "Setters" for these variables in controller. This will allow the UI layer (View) to access these objects.
  • Link the actual UI Objects to these variables.

Below is the code which does all the above.

#import <UIKit/UIKit.h>

 

@interface BasicViewController : UIViewController

{

IBOutlet UITextField *txtName;

IBOutlet UILabel *lblMessage;

}

 

@property(nonatomic, retain) IBOutlet UITextField *txtName;

@property(nonatomic, retain) IBOutlet UILabel *lblMessage;

 

-(IBAction) doSomething;

-(IBAction)makeKeyboardGoAway;

 

@end

 

In the above code, we declare the text and label objects using IBOutlet. Remember that we have not linked them to the UI yet.

The @property declaration indicates to the compiler that the attributes txtName and lblMessage needs to be treated as properties, and we will need to generate "Getters" and "Setters" to access these. Later, we will use "@synthesize" in the ".m" file to generate these properties.

@implementation BasicViewController

 

@synthesize txtName;

@synthesize lblMessage;

 

-(IBAction)makeKeyboardGoAway

{

[txtName resignFirstResponder];

}

 

 

-(IBAction)doSomething

{

[txtName resignFirstResponder];

NSString *msg = [[NSString alloc] initWithFormat:@"Hello %@",txtName.text];

 

lblMessage.text = msg;

 

 

}

 

The method declarations indicate actions that can be linked to different events.

Once these outlets and actions are in place, it will show up in the popup .

Xcode

Sunday, January 08, 2012

Switching between UI design mode, and Source Code mode in XCode 4.2.1

The Problem

While learning iOS programming, at one point, I was working on adding some UI elements into the iPhone storyboard in Xcode 4.1. However, I clicked something by mistake, and now, the storyboard, instead of UI, was all XML code. I had no idea how to switch back to UI mode to drag and drop UI elements.

 

The Solution

To switch between code-mode, and UI mode, right -click on the .storyboard file, and choose "Open As…". There, select "Source Code" to view the file as code, and select "Interface Builder - IOS Storyboard" to get back to UI format.

NewImage

Tuesday, January 03, 2012

Android List View–Part 1 Basics

List views are an important part of many android applications because of a number of reasons. Most importantly, is the ability to display large number of data pieces, in limited space provided by a mobile device like an android phone.

In this tutorial, we will be looking into the basics of Android List views. I will also provide a link to completed project at the end of this post.

Overview of steps to make a ListView work

  1. Declare the data source. This can be for example, a String array, ArrayList, Database Cursor..etc.
  2. Declare and instantiate an adapter.
    • As part of instantiation, link the adapter to data source.
    • Specify the UI resource for each line of ListView.
  3. Attach the adapter to ListView User Interface
  4. Perform data modification operations on the underlying data source.
  5. Notify the adapter of any data change. This will result in the ListView being updated with latest data.

 

2. Declare and Instantiate an Adapter

The first step in making a ListView work is to instantiate an adapter. In this post (Part 1), I am keeping things pretty simple. We will look into complex List views (eg: a ListView with Images, text..etc) in Part 2.

If you look at the source code, the line of code which initialize the adapter is as follows:

//Initialize array adapter to be attached with list
adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,arrData);

Here, we are using an ArrayAdapter object, as the adapter, because we are working with an ArrayList Object. (look at data type of arrData).

  • The first parameter(this) we pass is the context.
  • The second parameter (android.R.layout.simple_list_item_1) is a view/UI resource that is packaged with Android. This is simply a textView. For now, we will be using this. But, in part 2, we will be using our own view/UI to define how each item in the list view looks.
  • The third parameter (arrData) is the ArrayList object. This is where all our data is stored, for the sample application. More often than not, we will be using database cursors with ListViews. If this is the case for you, then use CursorAdapter instead of ArrayAdapter.

 

3. Attach the adapter to ListView User Interface Object

Once we instantiate the adapter, and link it to our data source, it is time to link the ListView UI object to the adapter. To do this, first we will have to get a reference to the UI object within our application. Following line of code does exactly that.

ListView     lstData = (ListView) findViewById(R.id.lstData);

The object lstData refers to the UI element that we added to main.xml (refer to the code). Once we have a reference to the UI element, following line of code attaches the adapter to the UI.

//Attach the adapter to list view.
lstData.setAdapter(adapter);

This completes all the steps needed to make the ListView work with a set of data.

4. Perform Data modification on underlying data source

However, there still is an issue of data being modified by the application. If/When the underlying data is modified, we have to let the adapter know that there is a change. Unless we do this, the changes will not be reflected in the UI.

Probably you are thinking “Why should I do this notification when data is changed? Cant android just keep track of the data, and detect the changes?”. I will let you ponder on that, and do leave your thoughts as comments.

 

5. Notify the adapter of any data change. This will result in the ListView being updated with latest data.

One important point to note here is that, we are notifying the adapter, that the data has changed. We are not directly communicating with the LIstView UI object. Once the adapter knows about data change, it is then responsible for modification of UI. More about this in Part 2, which will be about custom adapters, and more complex ListView.

Following line of code lets the adapter know that underlying data has changed

adapter.notifyDataSetChanged();

That’s it for simple ListView documentation. We will talk more about ListViews in part 2.

 

References

Base Adapter
http://developer.android.com/reference/android/widget/BaseAdapter.html

 

Source Code

https://github.com/gopalnair/SimpleListView/tree/master/SimpleListView