Setting up an android project

Before setting up our first android project, we have to setup android SDK.

For setting up an android SDK in eclipse following steps are provided: 

1. Select Windows > Preferences.
Select android option and browse Android SDK for windows or any other OS. It will display all available SDK versions, select SDK version as per your requirement and click on Apply button and thereafter click on Ok Button.


               
2. Select File > Android Project.
Give Project Name in my tutorial Project Name..For example, Hello World. You can also create a new project from existing source.
After that you have to select build target (Android API Level or platform) in my project Android 2.2 platform and API Level 8.



3. Now set up an Application Name which is displayed to the user. It will be our android application name.

4. Now set up a Package Name.
Basically it would be a unique name because while you upload your application in Google Play Store (Android Application Market), if any application is found having same Package Name as yours you wouldn't be allowed to upload your application. Package Name must be a java namespace with at least two components. For example, In my application Package Name is com.codesmeister.helloWorld.



5. Now Create Activity.
Activity is a class to start emulator and it launches the application.

6. Now click on Finish button for completion of your android project.

Wordpress Plugin Development Beginner's Information

Wordpress basic functionality is provide a blogging platform. But now a days it is not a just blogging platform but it use into many other scripts such as web forums, classic web page, CMS (Content Management System) etc.

We can extend wordpress capabilities by theme, plugin or page template.In this tutorial we learn the basic information about the wordpress plugin development.

 

Naming Conventions

When write your plugin code, it is best practice to follow regulations set up by wordpress.

Always choose function name unique and related to plugin name. so it doesn’t create ambiguity with other plugin.

Put comment wherever and whenever needed in code.

 

Plugin folder

Plugins directory you will find inside wp-content directory. Wordpress allow you to place the plug-in sigle php file directly into the wp-content/plugins directory. But it’s good practice to create a sub directory name with plugin name inside the wp-content directory. Inside you can put JS, CSS, PHP, HTML & readme.txt etc.

 

Understanding Actions and Filters

add_action() and add_filter() are heart of a wordpress plugins. Both functions also called as a wordpress hooks. It is very important to know the difference between both function before start wordpress plugins development.

 

add_action($tag,$fun) :

used to call functions in your plugin at specific time. Wordpress offers various action list.

 

add_filter($tag,$fun) :

used to modify different types data before any action like adding it to the database or sending it to the browser screen.More about the wordpress hooks.

 

Standard Plugin information

The first line of every plugin must be comment information for parsing wordpress engine. This comment line known as standard Plugin information header. Below is an example of header format.

   1:  <?php
   2:  /*
   3:  Plugin Name: Name Of The Plugin
   4:  Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
   5:  Description: A brief description of the Plugin.
   6:  Version: The Plugin's Version Number, e.g.: 1.0
   7:  Author: Name Of The Plugin Author
   8:  Author URI: http://URI_Of_The_Plugin_Author
   9:  License: A "Slug" license name e.g. GPL2
  10:  */
  11:  ?>




This header part parse by the wordpress engine and add it to the plugins screen so it can be activated, load it, and run it’s function. Without header information plugin never run.


Plugin Name line must be present in header part, without it can not work. Order of the lines is not important.

Display only posts from one category

Wordpress provide query_post() function for alter the default query for display post. query_post() display post based on specified category and other display option like post per page etc.

Following is the code for display only one category post with pagination.
<?php
query_posts('category_name=category1&showposts=50'.'&paged='.$paged);
while ( have_posts() ) : the_post();
 echo '<li>';
 the_title();
 echo '</li>';
endwhile;
?>


Accessing VDU memory using C Language

C language provide built in function for print information on the screen. Like printf(), puts() etc. But if we want to print information on the screen without using any built in function so we have to use VDU (Visual Display Unit) memory. The microprocessor doesn’t have the ability to produce image or text directly on the screen. It writes the information on the VDU memory. VDU memory present in the display adapter.

VDU memory has a one base address. The bas address of VDU memory changes from different display adapter. E.g. for VGA/EGA/CGA adapter base address is 0XB8000000 (hex), and for MA adapter base address is 0XB0000000 (hex).

For store single character in to VDU memory needs 2 bytes. First byte for the ASCII (American Standard Code for Information Interchange) value and second byte for the color attributes.

In color attributes first 4 bits for the foreground color, 3 bits for the background color and last one for the blinking.

In console application default screen is arranged as 80 characters (columns) by 25 lines (rows). We can also set default screen arrangement using C language for that read this article.

In below example I write one function for print 0 to 9 using VDU memory.
#include<stdio.h>
#include<conio.h>
char far *vdmem = (char far*)0xB8000000;
void printchar(int,int,char,int);
void main()
{
 int i;
 clrscr();
 for(i=48;i<58;i++)
  printchar(0,i-48,i,112);
 getch();
}
void printchar(int r,int c,char ch,int clr)
{
 char far *v;
 v = vdmem + r * 160 + c * 2; //Calculate Address
 *v = ch; //Store Character on VDU Memory
 v++;
 *v = clr;//Set color attribute
}

printchar() function definition we can say that gotoxy(c,r) is equal to vdmem + r * 160 + c * 2, a represent each character need two bytes, so multiples of 2 with c (column) and one row contains 80 character, so multiples of 160 with r (row).

How to add custom welcome tab in your facebook fan page

Facebook fan page become popular as a blog or website for a celebrity, brand or business. It enables facebook user to join and be updated about any brand. This is great way to build up a community on facebook.

Facebook fan page come with various tab like wall, photo, info etc. you can also create a custom tab. In this article we will learn to create welcome tab. It will visible / displayed to the non-member visitors to the page, asking them to join the page.

Adding a custom tab to the Facebook Fan page :

This is done with Static HTML: iframe tabs.  You can add advance functionality to your fan page using this application. This application will add a box to your Page in which you can render HTML or FBML(Facebook Markup Language) for Page customization. This application is only available for facebook fan page not for profile or groups.

How to add Static HTML : iframe tabs to your fan page :
  1. 1.       The first and most important, you need to be the administrator of the page. 
  2. 2.       Search for Static HTML : iframe tabs in the search box and reach the application 
  3. 3.       Select page to which you want to add the new tab.


Setting up Static HTML : iframe tabs as a tab :

  1. 1.       Click on Edit Page Button. 
  2. 2.       Now click on Apps tab 
  3. 3.       Make sure that the tab setting is added. 
  4. 4.       You can also change the tab name

Adding content to the Static HTML : iframe tabs Tab :
  1. 1.       Click on View Page Button 
  2. 2.       Select your tab. 
  3. 3.       And use HTML tags to add the any content. 
  4. 4.       You can also use FBML (Facebook Markup Language) tags.

 Make this tab default landing tab (Welcome Tab) :
  1. 1.       Click on Edit Page Button. 
  2. 2.       Click on Manage Permissions tab 
  3. 3.       Select default landing tab.


Once you have done this, go to your page and view the tab...

How to make Homepage (Front Page) in wordpress ?


This tutorial teaches you how to display the default homepage of showing you the latest blogs & set it to a homepage.
First you will need to make homepage. so sing in to your wordpress.

Add new page
1.   in your wordpress control panel select Page tab
2.   click on Add New Option
3.   Give your page title & add content.
4.   Click on Publish Button 

Set your page as the Homepage (Front Page)
1.   Click On Setting tab
2.   Click on Reading option


3.   At the top of Reading Option show Front Page Displays option
4.   By default Your latest posts is selected.
5.   to set your page as a Homepage Select A static page option.


6.   Select your page from the Front page drop down menu
7.   You can also select post as a Home page (Front Page)
8.   Click on save changes

How to change screen display mode using Turbo C

The ROM BIOS (Basic Input Output System) provides device control for the PC's major devices (disk, video, keyboard, serial port, printer), allowing a programmer to communicate with these devices without needing detailed knowledge of their operation. The ROM routines are accessed via the Intel 8088/86 software generated interrupts(Number). 
The ROM BIOS supports many ROM BIOS INTERRUPT(Number) ROUTINES
 ROM BIOS INTERRUPT(Number) ROUTINES
 10      Video routines
 11      Equipment Check
 12      Memory Size Determination
 13      Diskette routines
 14      Communications routines
 15      Cassette
 16      Keyboard routines
 17      Printer
 18      Cassette BASIC
 19      Bootstrap loader
 1A     Time of Day
 we can use this interrupt(Number) routins by setting register value. C language has already beed created, and resides in header file dos.h. it is a union type REGS, which has two parts.
One structure contains the eight bit registers (accessed by .h.), the other structure contains the 16 bit registers (accessed by .x.). To generate the desired interrupt, a special function call has been provided. This function accepts the interrupt number, and pointers for the Input and output register values. The following program demonstrates the use of these concepts to set the display mode to 40x25 color.
#include <dos.h>
union REGS regs;
main()
{
regs.h.ah = 0;
regs.h.al = 1;
int86( 0x10, &regs, &regs );
printf("Fourty by Twenty-Five color mode.");
}
VIDEO ROM BIOS CALLS
The ROM BIOS supports many routines for accessing the video display. The following table illustrates the use of software interrupt 0x10(16). SCREEN DISPLAY MODE FUNCTION CALL (regs.h.ah = 0)
regs.h.al Screen Mode
 0      40.25 BW 
 1      40.25 CO
 2      80.25 BW
 3      80.25 CO
 4      320.200 CO
 5      320.200 BW
 6      640.200 BW
 7      Mono-chrome
 8      160.200 16col PCjr
 9      320.200 16col PCjr
 A     640.200 4col PCjr
 D     320.200 16col EGA
 E      640.200 16col EGA
 F      640.350 mono EGA
 10    640.350 16col EGA