Services in Android

Services are seprate entity which is being run in background of the app. It have no effect on the front end of the app activity(functionality).

• A facility for the application to tell the system about something it wants to be doing in the background (even when the user is not directly interacting with the application).  This corresponds to calls to Context.startService(), which ask the system to schedule work for the service, to be run until the service or someone else explicitly stop it.
• A facility for an application to expose some of its functionality to other applications. This corresponds to calls to Context.bindService(), which allows a long-standing  connection to be made to the service in order to interact with it.

Here we implement LocalService for calling some sync task which is being required for particular app. Service class is created by extends Service. Override method of Services is as : onBind(Intent i), onCreate(), onDestroy() and onStart(Intent intent, int startid).


import java.util.Timer;
import java.util.TimerTask;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
import android.widget.Toast;
import com.ylog.backGroundServices.SyncTableUsers;
import com.ylog.backGroundServices.SyncVehicleLog;
import com.ylog.misc.ApplicationClass;


public class LocalService extends Service {
private static Boolean flag = false;
private ApplicationClass app;

Below method is used to bind with any particular intent.

@Override
public IBinder onBind(Intent intent) {
Log.i("TAG ", intent.getAction());
return null;
}

Below method is used to Create the service. As it is part of Service life cycle.

@Override
public void onCreate() {
Log.i("info", "onCreate");
Toast.makeText(this, "My Service Created", Toast.LENGTH_LONG).show();
flag = true;
}
Below method is used to Destroy or stop the service. As it is part of Service life cycle.

@Override
public void onDestroy() {
Log.i("info", "onDestroy");
flag = false;
Toast.makeText(this, "My Service Stopped", Toast.LENGTH_LONG).show();
}

Below method is used to Start service. Here we implement the task which we want to be run it on the app background.
Here we use 3 timer for calling particular function after every fixed duration of time.

@SuppressWarnings("deprecation")
@Override
public void onStart(Intent intent, int startid) {
app = (ApplicationClass) intent.getSerializableExtra("app");
Toast.makeText(this, "My Service Started", Toast.LENGTH_LONG).show();
Timer timer = new Timer();
final SyncTableUsers syncUserObj = new SyncTableUsers(LocalService.this);
final SyncVehicleLog vLogObj = new SyncVehicleLog(LocalService.this);

Below method will execute after 10 millisecond as service is started, and call after every 1.30 minute.

TimerTask timerTask = new TimerTask() {

@Override
public void run() {
if (flag) {
syncUserObj.syncUserData();
}
}
};
timer.scheduleAtFixedRate(timerTask, 10, 1800000); // call after
// every 1.30 minute

Below method will execute after 10 millisecond as service is started, and call after every 10 second.


if (app.getType_name().equalsIgnoreCase("DRIVER")) {
TimerTask timerTask1 = new TimerTask() {

@Override
public void run() {
if (flag) {
int logId = vLogObj.insertInTblVehicleLog();
}
}
};
timer.scheduleAtFixedRate(timerTask1, 10, 10000); // call
// after 10 sec
}

Below method will execute after 10 second as service is started, and call after every 1minute.


if (app.getType_name().equalsIgnoreCase("DRIVER")) {
TimerTask timerTask2 = new TimerTask() {

@Override
public void run() {
if (flag) {
vLogObj.syncVehicleLog();
}
}
};
timer.scheduleAtFixedRate(timerTask2, 10000, 60000); // call after 1 minute
}
super.onStart(intent, startid);
}
}

For start service we call it as:
Intent i = new Intent(Context, LocalService.class);
startService(i);
For using service it require a enry in Android mainfeat file
// Below android:name is package name where service class is created
< service
android:name="com.webservice.LocalService" android:enabled="true" >
< /service>

Running and Configuring VNC Server on Linux

VNC stands for Virtual Network Computing. It is, in essence, a remote display system which allows you to view a computing 'desktop' environment not only on the machine where it is running, but from anywhere on the Internet and from a wide variety of machine architectures.

The VNC system allows you to access the same desktop from a wide variety of platforms.

Oracle Enterprise Linux ships with a VNC Server. If you find it is not installed, you can deploy the package thats part of the install CD/DVD. Just cd to the "Server" directory and run yum install vnc-server*

• To run VNC on different port other than default vncport edit /usr/bin/vncserver file.


[root@sanjay ~]# vim /usr/bin/vncserver
vncport=
for ex. vncport=5902

$vncPort = 5902;
$desktopLog = "$vncUserDir/$host:$displayNumber.log";
unlink($desktopLog);

• Starting VNC service on new defined port
#vncserver :5902
• Set the password by using vncpasswd command

[root@sanjay ~]# vncpasswd
Password:
Verify:

• Edit the /root/.vnc/xstartup file,
Uncomment the following two lines for normal desktop.
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

• Perform the following steps



Now, you can confirm the VNC server is up again by executing netstat command:


[root@sanjay ~]# netstat -tulpan | grep vnc

Parsing XML Files in iOS

Reading XML files is one of the common tasks we perform in our application, In this tutorial let's see how we can use NSXMLParser to parse XML in our iPhone app.

Introduction

NSXMLParser is a forward only reader or an event driven parser. What it means is, an event is raised whenever the parser comes across a start of an element, value, CDATA and so on. The delegate of NSXMLParser can then implement these events to capture XML data. Some of the events are raised multiple times like the start of an element, value of an element and so on. Since NSXMLParser is known as an event driven parser, we can only read data at the present node and cannot go back. The iPhone only supports NSXMLParser and not NSXMLDocument , which loads the whole XML tree in memory.

Books Application


To understand how to use an instance of NSXMLParser, let's create a simple navigation based application where we will list
the title of the book in the table view and upon selecting a title, display the detail information in a detail view.Create
a new application inXCode by selecting Navigation-Based Application, I have named my app XML. Since the NSXMLParser is a
forward only parser or an event driven parser, we need to store the data locally, which can be used later. To store this data,
we will create a class which replicates the elements and attributes in the XML file. An instance of this class represents one
single Book element in the XML file. I have named this class "Book" and its source code is listed below

//Book.h
#import

@interface Book : NSObject {

NSInteger bookID;
NSString *title; //Same name as the Entity Name.
NSString *author; //Same name as the Entity Name.
NSString *summary; //Same name as the Entity Name.
}

@property (nonatomic, readwrite) NSInteger bookID;
@property (nonatomic, retain) NSString *title;
@property (nonatomic, retain) NSString *author;
@property (nonatomic, retain) NSString *summary;
@end

//Book.m
#import "Book.h"
@implementation Book
@synthesize title, author, summary, bookID;

- (void) dealloc {
[summary release];
[author release];
[title release];
[super dealloc];
}

@end

Notice that the name of the property is the same as the element name in the XML file. Since the XML file has n number of Book elements, we need an array to hold all the books we read, so we declare an array in the application delegate and this is how the source code changes


//XMLAppDelegate.h
#import
@interface XMLAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
UINavigationController *navigationController;
NSMutableArray *books;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
@property (nonatomic, retain) NSMutableArray *books;

@end

Reading XML files is one of the common tasks we perform in our application, In this tutorial let's see how we can use NSXMLParser to parse XML in our iPhone app.

Introduction

NSXMLParser is a forward only reader or an event driven parser. What it means is, an event is raised whenever the parser comes across a start of an element, value, CDATA and so on. The delegate of NSXMLParser can then implement these events to capture XML data. Some of the events are raised multiple times like the start of an element, value of an element and so on. Since NSXMLParser is known as an event driven parser, we can only read data at the present node and cannot go back. The iPhone only supports NSXMLParser and not NSXMLDocument, which loads the whole XML tree in memory.

Books Application


To understand how to use an instance of NSXMLParser, let's create a simple navigation based application where we will list the
title of the book in the table view and upon selecting a title, display the detail information in a detail view.

Create a new application in XCode by selecting Navigation-Based Application, I have named my app XML. Since the NSXMLParser is
a forward only parser or an event driven parser, we need to store the data locally, which can be used later. To store this data,
we will create a class which replicates the elements and attributes in the XML file. An instance of this class represents one
single Book element in the XML file. I have named this class "Book" and its source code is listed below

//Book.h
#import

@interface Book : NSObject {
NSInteger bookID;
NSString *title; //Same name as the Entity Name.
NSString *author; //Same name as the Entity Name.
NSString *summary; //Same name as the Entity Name.
}

@property (nonatomic, readwrite) NSInteger bookID;
@property (nonatomic, retain) NSString *title;
@property (nonatomic, retain) NSString *author;
@property (nonatomic, retain) NSString *summary;

@end

//Book.m
#import "Book.h"
@implementation Book
@synthesize title, author, summary, bookID;

- (void) dealloc {
[summary release];
[author release];
[title release];
[super dealloc];
}
@end

Notice that the name of the property is the same as the element name in the XML file. Since the XML file has n number of Book elements, we need an array to hold all the books we read, so we declare an array in the application delegate and this is how the source code changes


//XMLAppDelegate.h
#import

@interface XMLAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
UINavigationController *navigationController;
NSMutableArray *books;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
@property (nonatomic, retain) NSMutableArray *books;
@end

This is how the data looks like in the table view and the detail view controller.



The data is then shown in a UITableView with a detail view, the complete code is not shown here but you can download the source code and to get a better understanding UITableView, you can follow my suggested readings below.

Oracle Startup

Starting oracle database
Starting up Oracle database requires some important detail to note. Failure to follow the proper
steps would end up to failed database startup.
Remember that we need to login as a user with SYSDBA privileges to startup an Oracle database which would enable us to for example do a – SQL>connect / as sysdba.
Here is an example of a DBA connecting to his database and starting the instance:

In the above example the database was shutdown so when we logged as sysdba, we are then connected to idle instance. When we executed the startup query the database was opened after going through different startup stages as shown in example and discussed below:
* Startup (nomount)
* Mount
* Open
Let's look at these stages in a bit more detail.

The Startup (nomount) Stage

When you issue the startup command, the first thing the database will do is enter the nomount stage. During the nomount stage, Oracle first opens and reads the initialization parameter file (init.ora) to see how the database is configured. For example, the sizes of all of the memory areas in Oracle are defined within the parameter file.
After the parameter file is accessed, the memory areas associated with the database instance are allocated. Also, during the nomount stage, the Oracle background processes are started. Together, we call these processes and the associated allocated memory the Oracle instance. Once the instance has started successfully, the database is considered to be in the nomount stage. If you issue the startup command, then Oracle will automatically move onto the next stage of the startup, the mount stage.

Starting the Oracle Instance (Nomount Stage)


There are some types of Oracle recovery operations that require the database to be in
nomount stage. When this is the case, you need to issue a special startup command: startup
nomount, as seen in this example:

SQL> startup nomount

The Mount Stage

When the startup command enters the mount stage, it opens and reads the control file. The control file is a binary file that tracks important database information, such as the location of the database datafiles.
In the mount stage, Oracle determines the location of the datafiles, but does not yet open them. Once the datafile locations have been identified, the database is ready to be opened.

Mounting the Database

Some forms of recovery require that the database be opened in mount stage. To put the database in mount stage, use the startup mount command as seen here:

SQL> startup mount

If you have already started the database instance with the startup nomount command, you might change it from the nomount to mount startup stage using the alter database command:

SQL> alter database mount;

The Open Oracle startup Stage

The last startup step for an Oracle database is the open stage. When Oracle opens the database, it accesses all of the datafiles associated with the database.
Once it has accessed the database datafiles, Oracle makes sure that all of the database datafiles are consistent.

Opening the Oracle Database


To open the database, you can just use the startup command as seen in this example

SQL> startup

If the database is mounted, you can open it with the alter database open command as seen in
this example:

SQL> alter database open;

Opening the Database in Restricted Mode

You can also start the database in restricted mode. Restricted mode will only allow users with special privileges (we will discuss user privileges in a later chapter) to access the database (typically DBA's), even though the database is technically open. We use the startup restrict command to open the database in restricted mode as seen in this example.

SQL> startup restrict

You can take the database in and out of restricted mode with the alter database command as seen in this example:
-- Put the database in restricted session mode.
SQL> alter system enable restricted session;
-- Take the database out of restricted session mode.
SQL> alter system disable restricted session;

Note: Any users connected to the Oracle instance when going into restricted mode will remain connected; they must be manually disconnected from the database by exiting gracefully or by the DBA with the "alter system kill session 'sid,serial#'" command.

Drag and drop marker on google map

I have markers. I would like to move the marker with a drag and drop-function, and then check the location where we drop that marker.
1.) In this show google map tiles show on screen and zoom at given level.

MainActivity.java


@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);


MapView map = (MapView) findViewById(R.id.map);

map.getController().setCenter(
getPoint(40.70686417491799, -74.01572942733765));
map.getController().setZoom(17);
map.setBuiltInZoomControls(true);
}

2.) I was doing some precise measurements with markers on my map, and I wanted my marker to be exactly on the spot I touched and lifted my finger so the measurement was exactly precise.

MainActivity.java


ImageView dragImage=(ImageView) findViewById(R.id.drag);
Drawable marker = getResources().getDrawable(R.drawable.marker);

marker.setBounds(0, 0, marker.getIntrinsicWidth(),
marker.getIntrinsicHeight());

map.getOverlays().add(new SitesOverlay(marker, dragImage, map));

3.) If you touch "near" the marker, the marker does not go to that exact point, but moves along with your finger's movement. I needed the marker to appear just below my finger on the ACTION_DOWN, ACTION_MOVE and ACTION_UP.

SiteOverLay.java


package com.example.draganddropbasic;
import java.util.ArrayList;
import java.util.List;
import android.graphics.Canvas;
import android.graphics.Point;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.MapView;
import com.google.android.maps.OverlayItem;

public class SitesOverlay extends ItemizedOverlay {
private List items = new ArrayList();
private Drawable marker = null;
private OverlayItem inDrag = null;
private ImageView dragImage = null;
private int xDragImageOffset = 0;
private int yDragImageOffset = 0;
private int xDragTouchOffset = 0;
private int yDragTouchOffset = 0;
MapView map;

public SitesOverlay(Drawable marker, ImageView dragImage, MapView map) {
super(marker);
this.marker = marker;
this.map = map;
this.dragImage = dragImage;

xDragImageOffset = dragImage.getDrawable().getIntrinsicWidth() / 2;
yDragImageOffset = dragImage.getDrawable().getIntrinsicHeight();

items.add(new OverlayItem(getPoint(40.748963847316034,
-73.96807193756104), "UN", "United Nations"));
items.add(new OverlayItem(getPoint(40.76866299974387,
-73.98268461227417), "Lincoln Center",
"Home of Jazz at Lincoln Center"));
items.add(new OverlayItem(getPoint(40.765136435316755,
-73.97989511489868), "Carnegie Hall",
"Where you go with practice, practice, practice"));
items.add(new OverlayItem(getPoint(40.70686417491799,
-74.01572942733765), "The Downtown Club",
"Original home of the Heisman Trophy"));

populate();
}

private GeoPoint getPoint(double lat, double lon) {
return (new GeoPoint((int) (lat * 1000000.0), (int) (lon * 1000000.0)));
}

@Override
protected OverlayItem createItem(int i) {
return (items.get(i));
}

@Override
public void draw(Canvas canvas, MapView mapView, boolean shadow) {
super.draw(canvas, mapView, shadow);

boundCenterBottom(marker);
}

@Override
public int size() {
return (items.size());
}

@Override
public boolean onTouchEvent(MotionEvent event, MapView mapView) {
final int action = event.getAction();
final int x = (int) event.getX();
final int y = (int) event.getY();
boolean result = false;

if (action == MotionEvent.ACTION_DOWN) {
for (OverlayItem item : items) {
Point p = new Point(0, 0);

map.getProjection().toPixels(item.getPoint(), p);

if (hitTest(item, marker, x - p.x, y - p.y)) {
result = true;
inDrag = item;
items.remove(inDrag);
populate();

xDragTouchOffset = 0;
yDragTouchOffset = 0;

setDragImagePosition(p.x, p.y);
dragImage.setVisibility(View.VISIBLE);

xDragTouchOffset = x - p.x;
yDragTouchOffset = y - p.y;

break;
}
}
} else if (action == MotionEvent.ACTION_MOVE && inDrag != null) {
setDragImagePosition(x, y);
result = true;
} else if (action == MotionEvent.ACTION_UP && inDrag != null) {
dragImage.setVisibility(View.GONE);

GeoPoint pt = map.getProjection().fromPixels(x - xDragTouchOffset,
y - yDragTouchOffset);
OverlayItem toDrop = new OverlayItem(pt, inDrag.getTitle(),
inDrag.getSnippet());
Log.i("info",
"get lat:" + pt.getLatitudeE6() + " lang:"
+ pt.getLongitudeE6());
items.add(toDrop);
populate();

inDrag = null;
result = true;
}

return (result || super.onTouchEvent(event, mapView));
}

private void setDragImagePosition(int x, int y) {
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) dragImage
.getLayoutParams();

lp.setMargins(x - xDragImageOffset - xDragTouchOffset, y
- yDragImageOffset - yDragTouchOffset, 0, 0);
dragImage.setLayoutParams(lp);
}
}

4.) MainActivity.java


package com.example.draganddropbasic;

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.KeyEvent;
import android.widget.ImageView;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import com.google.android.maps.MyLocationOverlay;

public class MainActivity extends MapActivity {
private MapView map = null;
private MyLocationOverlay me = null;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);


map = (MapView) findViewById(R.id.map);

map.getController().setCenter(
getPoint(40.70686417491799, -74.01572942733765));
map.getController().setZoom(17);
map.setBuiltInZoomControls(true);

ImageView dragImage = (ImageView) findViewById(R.id.drag);
Drawable marker = getResources().getDrawable(R.drawable.marker);

marker.setBounds(0, 0, marker.getIntrinsicWidth(),
marker.getIntrinsicHeight());

map.getOverlays().add(new SitesOverlay(marker, dragImage, map));

me = new MyLocationOverlay(this, map);
map.getOverlays().add(me);
}

@Override
public void onResume() {
super.onResume();

me.enableCompass();
}

@Override
public void onPause() {
super.onPause();

me.disableCompass();
}

@Override
protected boolean isRouteDisplayed() {
return (false);
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_S) {
map.setSatellite(!map.isSatellite());
return (true);
} else if (keyCode == KeyEvent.KEYCODE_Z) {
map.displayZoomControls(true);
return (true);
}

return (super.onKeyDown(keyCode, event));
}

private GeoPoint getPoint(double lat, double lon) {
return (new GeoPoint((int) (lat * 1000000.0), (int) (lon * 1000000.0)));
}

}

5.) activity_main.xml


< ?xml version="1.0" encoding="utf-8"?>
< RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

< com.google.android.maps.MapView
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:apiKey="0mjl6OufrY-tHs6WFurtL7rsYyEMpdEqBCbyjXg"
android:clickable="true" />

< ImageView
android:id="@+id/drag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/marker"
android:visibility="gone" />

< /RelativeLayout>

6.) Now run this and you get the desired result.

Google launched Zopfli to compress data for making webpages load faster

Google launched Zopfli Compression Algorithm, a new open sourced general purpose data compression library.

It is a new deflate compatible compressor that was inspired by compression improvements developed originally for the lossless mode of WebP image compression. Being compatible with deflate makes Zopfli's output compatible with zlib. It uses a different and more effective algorithm to compress data that can compress web content about 3-8% smaller compared to zlib at maximum compression.

Due to the amount of CPU time required — 2 to 3 orders of magnitude more than zlib at maximum quality — Zopfli is best suited for applications where data is compressed once and sent over a network many times, for example, static content for the web. By open sourcing Zopfli, thus allowing webmasters to better optimize the size of frequently accessed static content, hope to make the Internet a bit faster for all of us. Most internet browsers support deflate decompression, and it has a wide range of other applications. Because Zopfli is compatible with the decompression algorithms that are already part of all modern web browsers, using Google's new algorithm and library on a server could lead to faster data transmission speeds and lower web page latencies, which would ultimately make the web a little bit faster.

Zopfli is written in C. It is bit-stream compatible with compression used in gzip, Zip, PNG, HTTP requests and others.

Table Sorting in HTML by Javascript

This JavaScript code can be used to convert tables in ordinary HTML into sort table ones by associating each title column with an onClick event to automatically sort the data rows. No additional coding is necessary. All you need to do is give your table an ID field, include the sorttable.js file in jsp page and call init in your document's onLoad method.

JSP Page Code


< %@page contentType="text/html" pageEncoding="UTF-8"%>
< !DOCTYPE html>
< html>
< head>
< meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
< script language="javascript" src="js/sort.js">< /script>
< title>JSP Page< /title>
< style type="text/css">
#tablebox th {
background: none repeat scroll 0 0 #7da35a;
border-bottom: 1px dotted #666;
border-left: 1px dotted #666;
color: #FFFFFF;
line-height: 25px;
padding: 4px;
white-space: nowrap;
}

#tablebox td{
border-bottom: 1px dotted #666666;
border-left: 1px dotted #666666;
line-height: 12px;
padding:4px;
line-height: 20px;
white-space: nowrap;
}

#tablebox tr:hover{
background:#9cba73;
}
#tablebox thead tr {
position: relative;
}
table.sortable td {
text-align: left;
padding: 2px 4px 2px 4px;
/* width: 100px;*/
border-style: solid;
border-color: #444;
}
table.sortable tr:hover{
background:#9cba73;
}
< /style>
< /head>
< body>
< table class="sortable" id="tablebox" border="1">
< thead>
< tr>< th>MAR-2013< /th>< th>FEB-2013< /th>< th>JAN-2013< /th>< th>DEC-2012< /th>< th>NOV-2012< /th>
< th>OCT-2012< /th>< th>SEP-2012< /th>< th>AUG-2012< /th>< th>JUL-2012< /th>< th>JUN-2012< /th>
< th>MAY-2012< /th>< th>APR-2012< /th>< th>TOTAL< /th>< /tr>
< /thead>
< tbody>
< tr>< td>2146< /td>< td>1853< /td>< td>1718< /td>< td>2297< /td>< td>1909< /td>< td>1562< /td>< td>1500< /td>
< td>1555< /td>< td>1456< /td>< td>1554< /td>< td>1475< /td>< td>1582< /td>< td>20607< /td>< /tr>
< tr>< td>2389< /td>< td>1958< /td>< td>1947< /td>< td>2652< /td>< td>2129< /td>< td>1763< /td>< td>1778< /td>
< td>1788< /td>< td>1645< /td>< td>1822< /td>< td>1738< /td>< td>1841< /td>< td>23450< /td>< /tr>
< tr>< td>2616< /td>< td>2278< /td>< td>3392< /td>< td>2941< /td>< td>2226< /td>< td>2134< /td>< td>2115< /td>
< td>2328< /td>< td>2165< /td>< td>2186< /td>< td>2068< /td>< td>2134< /td>< td>28583< /td>< /tr>
< /tbody>
< /table>
< script type="text/javascript">
sorttable.init('Start');
< /script>
< /body>
< /html>

Download Sort.JS

Screenshots

Table

Table

After Sorting

After Shorting

Setting up Password less or Passphrase less SSH/SCP

SSH uses a public key cryptosystem. That means that, among other things, it can present a secret signed with your secret key, which anyone can decrypt with your public key, in order to verify that you are really who you say you are, assuming no one has stolen your private key.

There are two main ways of setting up ssh authentication in such a way that you do not have to enter a password or passphrase to log into machines, but without sacrificing security overmuch. You can set up ssh keys without a passphrase, or you can set up ssh keys with a passphrase and then use ssh agent to enter your passphrase automatically. What we're doing below, is generating a public+privatekeypair, and then adding the public key to a file that lists public keys that are allowed to ssh into the account the key is added to.

1. srchost> cd .ssh
2. srchost>ssh-keygen –t rsa



# Note: this step is not necessary if ~/.ssh/id_rsa.pub already exists

Example:


Setting up Password

3. srchost> # when ssh-keygen asks for a passphrase, just hit enter.

Example:


Setting up password

4. srchost>scp id_rsa.pub remote:/tmp/id_rsa.pub


Setting up password

5. dsthost> cd .ssh

6. dsthost> cat id_rsa.pub >authorized_keys

Scheduling shell Script to check memory usage & automated email notification

1)Create a .sh file


[root@ystbckp ~]# vim script_memory.sh

2)Write a the following script in the script_memory.sh file


Schedulng a shell

3)Change the permission to the script_memory.sh file


[root@ystbckp ~]# chmod 744 script_memory.sh

4)Scheduling the file to execute on a particular time


[root@ystbckp ~]# crontab -e

Each entry in a crontab file consists of six fields, specified in the following order

Minute hour day month weekday command
05 * * * * sh /root/script_memory.sh

When an asterisk (*) is displayed, it means all possible values for the field. For example, an asterisk in the hour time field would be equivalent to "every hour"

Browse existing image or capture new image in android

In this we will learn about how to select exist image in gallery . And In this we will learn about how to capture image from the android device and save into internal memory of android device. In this we do not need external memory or sdcard for capture image.


1.) Intent browsePicture = new Intent();
browsePicture.setType("image/*");
browsePicture.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(browsePicture, "Select Picture"),SELECT_PICTURE);

by calling this intent it opens options to the user to select existing image from gallery and etc.

2.) Intent takePicture = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

by calling this intent it opens camera of android devices.


3.) FileOutputStream fos =openFileOutput("demo.jpg",Context.MODE_WORLD_WRITEABLE);
fos.close();
File f = new File(getFilesDir() + File.separator + "demo.jpg");

Intent takePicture = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
takePicture.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f));
startActivityForResult(takePicture, CAPTURE_PICTURE);

In this we write captured images into internal memory in android devices.


4.) String[] projection = { MediaStore.Images.Media.DATA };
Cursor cursor = getContentResolver().query(uri, projection, null, null,
null);
if (cursor != null) {
// HERE YOU WILL GET A NULLPOINTER IF CURSOR IS NULL
// THIS CAN BE, IF YOU USED OI FILE MANAGER FOR PICKING THE MEDIA
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
} else
return null;

In this we get the path of saved capture image.

Google Visualisation Table Implementation

Google visualisation table provides us such table in which we can easily sort, format table data and make pages in list view. Table cells can be formatted using its different pattern format. Table header row remain fixed and you can easily sort data by click on specific cell of header row. Visualisation table show boolean value in check or uncheck mark and numeric data in format with right aligned.
To apply google visualisation table, we have to use following steps:
Step 1: Include following jsapi file.

< script type="text/javascript" src="http://www.google.com/jsapi">< /script>

Step 2: After include jsapi, we generate global option and load package for table.


< script type="text/javascript">
var options = {'showRowNumber': true,
'page':'enable',
'pageSize':15,
'pagingSymbols':{prev: 'prev', next: 'next'},
'pagingButtonsConfiguration':'auto',
'allowHtml': true};
var visualization;
var data;
var oldtab = null;
google.load('visualization', '1', {packages: ['table']});
< /script>
• showRowNumber : This boolean value used for showing auto generated row number.
• page : This boolean property used for using paging or not.
• pageSize : This property declare number of rows display on one page.
• pagingSymbols : This property define symbols for page navigation.
• pagingButtonsConfiguration : This boolean property used for paging button.
• allowHtml : This property used to allow html content to be display.

Step 3: Now we define function in which we get data to display and apply into visualisation table.


< script type="text/javascript">
function listView(source,th,callfun,search){
var x_search;
showLoading("loader");
if(!Boolean(search) || search=="" || search=="Business Name" || search=="Member Name" || search=="Event Name")
x_search="";
else
x_search=search;
document.getElementById ("detailDiv").style.display="none";
document.getElementById ("homeTabDiv").style.display="block";
if(oldtab) oldtab.className ="";
th.className ="active";
oldtab = th;
var url="adminDetails.do?x_ACTION="+source+"&x_SEARCH="+x_search;
var req;
if (window.XMLHttpRequest)
req = new XMLHttpRequest();
else if (window.ActiveXObject)
req = new ActiveXObject("Microsoft.XMLHTTP");
req.onreadystatechange = function(){
if (req.readyState==4 && req.status==200){
alert("Function Called.."+req.responseText);
drawBusinessList (req.responseText);
}};
url+=((url.indexOf("?") == -1)?'?':'&')+'q1112='+Math.random();
if(sync == undefined) sync = true;
if(parameters){
req.open("POST", url, sync);
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
req.send(parameters);
}else{
req.open("GET",url,sync);
req.send(null);
}
visualization = new google.visualization.Table(document.getElementById('listDiv'));
}

function drawBusinessList(localReq){
data = google.visualization.arrayToDataTable(eval(localReq));
var view = new google.visualization.DataView(data);
var formatter = new google.visualization.TablePatternFormat('{1}');
formatter.format(data,[0,1],1);
view.hideColumns([0]);
visualization.draw(view, options);
hideDiv("loader");
}
< /script>

After complete these steps we will get display like following screen.

Google Visulization

PPT Macro for Formatting multiple slides


Dear All,

Many times we come across situation in which we need to format 100's of slides withing specified amount of time, and doing it manually is really not a smart way thats where macro comes in picture.

Below is sample macro I have written for formatting active slides :

I hope you know how to run macros ;) else you can always take help from Google!!!!!!


Dim myvar As Slide
Dim myvar1 As Shape


For Each myvar In ActivePresentation.Slides
For Each myvar1 In myvar.Shapes


With myvar1
.Left = 50
.Top = 71
.LockAspectRatio = msoFalse
.Height = 410
.Width = 624
.Line.Visible = msoTrue
.Line.ForeColor.RGB = RGB(255, 0, 0)
.Line.Weight = 0.5

 
End With

Next
Next


Above macro will simple change formatting for all active slides ;)

Hope you enjoyed!!

Best Regards,
Girish

Dynamic Column width in BI Publisher

Dynamic Column width in BI Publisher

This has been a complex task to assign width of column dynamically in BI Publisher. This means number of columns is not fixed and they will come dynamically from XML and we want width of the columns to be distributed equally or in some ratio. Combined width of all columns assigned dynamically will be taken up from the width that we assign to that particular column. If there is only single column coming from XML then it will take up all width. If there are multiple columns then the width will be equally distributed or we can define in which ratio it should be distributed.

How it is done ?

Here is an example of how it can be done in BI Publisher.

1. Load Below XML:


< ?xml version="1.0" encoding="utf-8"?>
< TestScoreTable>
< LIST_COLUMNS>
< LIST_COLUMN>
< LIST_COLUMN_HEADING>Current Terms< /LIST_COLUMN_HEADING>
< /LIST_COLUMN>
< LIST_COLUMN>
< LIST_COLUMN_HEADING>2 - 30 Days< /LIST_COLUMN_HEADING>
< /LIST_COLUMN>
< LIST_COLUMN>
< LIST_COLUMN_HEADING>31 - 60 Days< /LIST_COLUMN_HEADING>
< /LIST_COLUMN>
< LIST_COLUMN>
< LIST_COLUMN_HEADING>61 - 90 Days< /LIST_COLUMN_HEADING>
< /LIST_COLUMN>
< LIST_COLUMN>
< LIST_COLUMN_HEADING>91 - Plus Days< /LIST_COLUMN_HEADING>
< /LIST_COLUMN>
< /LIST_COLUMNS>
< TestScores>
< TestCategory>Mathematics< /TestCategory>
< TestScore width ="15">
< TestScoreRange>0-20< /TestScoreRange>
< NumofStudents>30< /NumofStudents>
< /TestScore>
< TestScore width ="10">
< TestScoreRange>21-40< /TestScoreRange>
< NumofStudents>45< /NumofStudents>
< /TestScore>
< TestScore width ="15">
< TestScoreRange>41-60< /TestScoreRange>
< NumofStudents>50< /NumofStudents>
< /TestScore>
< TestScore width ="10">
< TestScoreRange>61-80< /TestScoreRange>
< NumofStudents>102< /NumofStudents>
< /TestScore>
< TestScore width ="15">
< TestScoreRange>81-100< /TestScoreRange>
< NumofStudents>22< /NumofStudents>
< /TestScore>
< /TestScores>
< /TestScoreTable>

2. create below template in BIP.

template in BIP

3. Modify code in template according to below table as shown in image below:

    Text To Display        Code    
  Group:TestScore    < ?for-each:TestScores?>  
  < ?TestCategory?>    < ?TestCategory?>  
  Column Header and Splitting    < ?split-column-header:TestScore?>< ?split-column-width:@width?>< ?TestScoreRange?>  
  Content and Splitting    < ?split-column-data:TestScore?> < ?NumofStudents?>  
  End:TestScore    < ?end for-each?>  


BI Publisher

4. Hit Pdf under BI Publisher and your pdf will be like shown below:


BI Publisher
Here you can see that we have defined width of each column in XML like .
If we remove one or two columns and see output then we will see that width of these columns has been distributed in others.

BI Publisher

Sending mail with attachment in JAVA

Sending mail with attachment in JAVA

The JavaMail API is a set of abstract APIs that model a mail system. The API provides a platform independent and protocol independent framework to build Java technology based email client applications. The JavaMail API provides facilities for reading and sending email. The package defines classes that are specific to mail systems based on internet standards such as MIME, SMTP, POP3, and IMAP.
Jar files required:

1. mail.jar that you can download here

Java Source code Sending Mail


package mail;

import java.util.Properties;
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.activation.FileDataSource;
import javax.mail.Message;
import javax.mail.Multipart;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.PasswordAuthentication;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;


public class sendMail {


static String username = "abcdefgh"; //replace this with a valid username
static String password = "password"; //replace this with a valid password

public static void main(String[] args)throws Exception{

try{


String host = "mail.xyz.com"; //replace this with a valid host
int smtpPort = 000; //replace this with a valid port
String from = "testmail@mail.com"; //replace this with a valid email id
String to = "findmail@mail.com"; //replace this with a valid email id
String fileAttachment1 = "D://file1.txt"; // file to attach
String fileAttachment2 = "D://file2.pdf"; // file to attach

Properties props = System.getProperties();
props.put("mail.smtp.host", host); // Setup mail server
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", smtpPort);
Session session = Session.getDefaultInstance(props); // Get session
MimeMessage message = new MimeMessage(session); // Define message
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setSubject("Find Attachment"); // create the subject
MimeBodyPart messageBodyPart = new MimeBodyPart(); //fill message
messageBodyPart.setText("Welcome to JAVA Family"); // create the message part
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBodyPart); // Part two is attachment

messageBodyPart = new MimeBodyPart();
DataSource source1 = new FileDataSource(fileAttachment1);
messageBodyPart.setDataHandler(new DataHandler(source1));
messageBodyPart.setFileName(fileAttachment1.substring(4, fileAttachment1.length()));
multipart.addBodyPart(messageBodyPart);

messageBodyPart = new MimeBodyPart();
DataSource source2 = new FileDataSource(fileAttachment2);
messageBodyPart.setDataHandler(new DataHandler(source2));
messageBodyPart.setFileName(fileAttachment2.substring(4, fileAttachment2.length()));
multipart.addBodyPart(messageBodyPart);
message.setContent(multipart);
Transport.send(message);
}
catch(Exception ex){
System.out.println(ex.getMessage());
}
}
}

How to take ScreenShot in iOS ?

How to take ScreenShot in iOS ?

Sometimes requirement arises in iPhone/iPad app that how we get screenshot of a particular UI part. So this captured screenshot can be sent as attachment to authorities via mail or can be written on to photo library.

MyImage Subclass of UIImage

We have to make subclass of UIImage that is MyImage and we are going to implement some extra methods inside it to get screen shot of a particular UI part. so customized MyImage Class code is given below.

MyImage.h File


@interface UIImage (MyImage)
+ (UIImage*)imageFromView:(UIView*)view;
+ (UIImage*)imageFromView:(UIView*)view scaledToSize:(CGSize)newSize;
+ (UIImage*)imageWithImage:(UIImage*)image scaledToSize:(CGSize)newSize;
@end

MyImage.m File


#import < QuartzCore/QuartzCore.h>
#import "MyImage.h"
@implementation UIImage (MyImage)
+ (void)beginImageContextWithSize:(CGSize)size
{
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
if ([[UIScreen mainScreen] scale] == 2.0) {
UIGraphicsBeginImageContextWithOptions(size, YES, 2.0);
} else {
UIGraphicsBeginImageContext(size);
}
} else {
UIGraphicsBeginImageContext(size);
}
}

+ (void)endImageContext
{
UIGraphicsEndImageContext();
}

+ (UIImage*)imageFromView:(UIView*)view
{
[self beginImageContextWithSize:[view bounds].size];
BOOL hidden = [view isHidden];
[view setHidden:NO];
[[view layer] renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
[self endImageContext];
[view setHidden:hidden];
return image;
}

+ (UIImage*)imageFromView:(UIView*)view scaledToSize:(CGSize)newSize
{
UIImage *image = [self imageFromView:view];
if ([view bounds].size.width != newSize.width ||
[view bounds].size.height != newSize.height) {
image = [self imageWithImage:image scaledToSize:newSize];
}
return image;
}

+ (UIImage*)imageWithImage:(UIImage*)image scaledToSize:(CGSize)newSize
{
[self beginImageContextWithSize:newSize];
[image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
[self endImageContext];
return newImage;
}
@end

TakeScreenShot Method

This is method, put inside your class where-ever you need to take screenshot Here
1) filePath is Document Directory path where your screenshot will be stored finally.
2) customizedView is your View , whose screenshot you want to capture.


-(void)takeScreenShot{
NSArray *arrPaths =
NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory,
NSUserDomainMask,
YES);
NSString *strDocumentPath = [arrPaths objectAtIndex:0];
NSString *filePath = [strDocumentPath stringByAppendingPathComponent:@"screenshot.png"];

UIImage *img = [UIImage imageFromView:customizedView];
//imgSignature.image = img;
NSData *imgData = UIImageJPEGRepresentation(img, 0.0);
[imgData writeToFile:filePath atomically:YES];
}

screen shot method

Send Email on Startup and Shutdown Process on Linux Server

Send Email on Startup and Shutdown Process on Linux Server

It is always nice to have notification when a server reboots, especially when you are on vacation, away from the office, or just hanging around! In order to send an email on reboot, we can easily create a cron job to run on reboot. This means for a single reboot the Administrator will receive two emails. This solution will not send out an email if the system loses power, however an email will still be sent on reboot. This should indicate to the Administrator that something went wrong with the shutdown. The tips below are for a RedHat based system but should be similar in other architectures.
First thing we need is to create a new script "NotifyEmail"
Paste the following code into that document .


#!/bin/sh
EMAIL="example@example.com"
RESTARTSUBJECT="["`hostname`"] - System Startup"
SHUTDOWNSUBJECT="["`hostname`"] - System Shutdown"
RESTARTBODY="This is an automated message to notify you that "`hostname`" started successfully.
Start up Date and Time: "`date`
SHUTDOWNBODY="This is an automated message to notify you that "`hostname`" is shutting down.
Shutdown Date and Time: "`date`
LOCKFILE=/var/lock/subsys/NotifyEmail
RETVAL=0

# Source function library.
. /etc/init.d/functions

stop()
{
echo -n $"Sending Shutdown Email: "
echo "${SHUTDOWNBODY}" | mutt -s "${SHUTDOWNSUBJECT}" ${EMAIL}
RETVAL=$?
if [ ${RETVAL} -eq 0 ]; then
rm -f ${LOCKFILE}
success
else
failure
fi
echo
return ${RETVAL}
}
start()
{
echo -n $"Sending Startup Email: "
echo "${RESTARTBODY}" | mutt -s "${RESTARTSUBJECT}" ${EMAIL}
RETVAL=$?
if [ ${RETVAL} -eq 0 ]; then
touch ${LOCKFILE}
success
else
failure
fi
echo
return ${RETVAL}
}
case $1 in
stop)
stop
;;
start)
start
;;
*)
esac
exit ${RETVAL}

Save the document by CTRL+O (To Write) and then press CTRL+X (To exit the Editor)
First, we need to make it executable:


chmod u+x NotifyEmail

Now we want to set this up to run at start up and shut down. Copy the script from your home directory to the init.d directory.


cp NotifyEmail /etc/init.d/

Last thing we do is set this up to run automatically by configuring it via chkconfig.


chkconfig --levels 3 NotifyEmail on

The code goes into a file under /etc/init.d
Then you go into /etc/rc.d folder and edit rc.local file. There you add:
Code:


/etc/init.d/NotifyEmail start

Also make a file called rc.local_shutdown in /etc/rc.d/ folder. In that file you add:
Code:


/etc/init.d/NotifyEmail stop

Now using these steps you will receive two mails during startup and shutdown process

Alternative Simple Way for Email Alert on Reboot:

Edit your crontab:


crontab –e

Add the following:


@reboot echo "Server has restarted "`hostname` | mail -s "System Restart" your@email.address

Now using these simple steps you will receive mail whileserver reboot.

Control File in DBMS

Control File in DBMS

The Control File of the database is a binary file that contains database information such as the database name, data about the database log files and data files, timestamp of database creation, tablespace name, checkpoint information and backup information. Database can't open without a Control file.
Getting information of current control file in use:


SQL>SHOW PARAMETER control_files;
SQL>SELECT * FROM v$controlfile;
SQL>SELECT * FROM v$controlfile_record_section;

MULTIPLEXING THE CONTROL FILE USING SPFILE

Let we had two control file control01 and control02 in our database. We are going to multiplex control03 in our database.


SQL>ALTER SYSTEM SET CONTROL_FILES='$HOME/ORADATA/U01/control01.ctl'
'$HOME/ORADATA/U01/control02.ctl','$HOME/ORADATA/U01/control03.ctl' SCOPE=spfile;
SQL>shutdown immediate;

Copy the existing control file with new name control03.ctl on defined path of spfile parameter so that it is available on the os level.

$cp $HOME/ORADATA/U01/control01.ctl $HOME/ORADATA/U01/control03.ctl

Control files can be multiplexed up to eight times. The Oracle server maintains all files listed in spfile parameter when instance is started.

SQL>startup

MULTIPLEXING THE CONTROL FILE USING PFILE

SQL>create pfile from spfile;
SQL>shutdown immediate;

Copy the existing control file with new name control03.ctl

$cp $HOME/ORADATA/U01/control01.ctl $HOME/ORADATA/U01/control03.ctl

Open the pfile and add a new control file control03.ctl and its path in CONTROL_FILES parameter.

SQL>startup;

CONTROL FILE BACKUP

Because the control file records the physical structure of the database so it's an important part of oracle database. It's important to make a backup of control file.

SQL>ALTER DATABASE BACKUP CONTROLFILE TO '/tmp/control_file.bkp';

We can also make backup of control file to a trace file. This trace can contains a script to recreate a control file. Trace file created in UDUMP directory.


SQL>ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/tmp/create_control_file.sql'

Moving ORADATADirectory to another location in Oracle DataBase

Moving ORADATADirectory to another location in Oracle DataBase

Database files are stored in ORACLE_BASE\oradata\DB_NAME\ If you want to move the oradata directory to another location or directory then the minimum required steps are as follow

Step 1:


Creation of tracecopy of the Control file

SQL>ALTER DATABASE BACKUP CONTROLFILE TO TRACE;

The Default location of tracecopy is USER DUMP destination. If you want to find the USER DUMP Destination then use
the following statement

SQL> SHOW PARAMETER USER_DUMP_DEST;

Step 2:

SQL>CREATE PFILE FROM SPFILE;

Step 3:

SQL>SHUTDOWN IMMEDIATE;

Step 4:

Move the ORADATA directory to another location or to the new drive.

Step 5:

SQL>SHUTDOWN IMMEDIATE;

Step 6:

Find the pfile (Default name is initSID.ora).Open the pfile and change the value of CONTROL_FILE parameter to the new location of oradata directory.

Step 7:

SQL>CREATE SPFILE FROM PFILE;

Step 8:

SQL>sqlplus / as sysdba SQL>stratupnomount;

Step 9:

Edit the trace copy of control file created in Step 1 and change the location of data files and Redo log files. Use this script in mount state to create new control file


CREATE CONTROLFILE REUSE DATABASE "SID_NAME" RESETLOGS FORCE LOGGING ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/u02/oradata/SID_NAME/redo01.log' SIZE 50M BLOCKSIZE 512,
GROUP 2 '/u02/oradata/SID_NAME/redo02.log' SIZE 50M BLOCKSIZE 512,
GROUP 3 '/u02/oradata/SID_NAME/redo03.log' SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
'/u02/oradata/SID_NAME/system01.dbf',
'/u02/oradata/SID_NAME/sysaux01.dbf',
'/u02/oradata/SID_NAME/undotbs01.dbf',
'/u02/oradata/SID_NAME/users01.dbf',
'/u02/oradata/SID_NAME/example01.dbf',
CHARACTER SET WE8MSWIN1252
;

Step 10:

Open the Database
SQL>ALTER DATABASE OPEN;

Virtualization

virtualization:

In computing, virtualization means to create a virtual version of a device or resource, such as a server, storage device, network or even an operating system where the framework divides the resource into one or more execution environments. Even something as simple as partitioning a hard drive is considered virtualization because you take one drive and partition it to create two separate hard drives. Devices, applications and human users are able to interact with the virtual resource as if it were a real single logical resource. The term virtualization has become somewhat of a buzzword, and as a result the term is now associated with a number of computing technologies including the following:


• Storage virtualization: The amalgamation of multiple network storage devices into what appears to be a single storage unit.
• Server virtualization: The partitioning a physical server into smaller virtual servers.
• Operating system-level virtualization: A type of server virtualization technology which works at the operating system
(kernel)layer.
• Network virtualization: Using network resources through a logical segmentation of a single physical network.
• Application virtualization: Also called application service virtualization. Application virtualization is layered on
top of other virtualization technologies, such as storage virtualization or machine virtualization to allow computing
resources to be distributed dynamically in real time.
• Virtualization Software : VMware, Oracle Virtual Box Etc.

ORACLE VIRTUAL Box:

Virtual Box is a cross-platform virtualization application. What does that mean? For one thing, it installs on your existing Intel or AMD-based computers, whether they are running Windows, Mac, Linux or Solaris operating systems. Secondly, it extends the capabilities of your existing computer so that it can run multiple operating systems (inside multiple virtual machines) at the same time. So, for example, you can run Windows and Linux on your Mac, run Windows Server 2008 on your Linux server, run Linux on your Windows PC, and so on, all alongside your existing applications. You can install and run as many virtual machines as you like -- the only practical limits are disk space and memory. VirtualBox is deceptively simple yet also very powerful. It can run everywhere from small embedded systems or desktop class machines all the way up to datacenter deployments and even Cloud environments.

How To Convert PSD To HTML And CSS For Your Websites

Most designers have the ability to create a professional websites in software’s like Photoshop, but are not able to convert a PSD files to a W3C valid HTML and CSS code that could be optimized for search engines. In order to learn these you can follow PSD to HTML tutorials that are found easily on the internet. By following these you can bring the theory directly into practice. But it seems to be difficult to understand for the beginners. This roadmap will help the beginners to complete the PSD to HTML tutorials successfully.
  • Visit the W3Schools website. All elements of HTML and CSS are explained there very precisely. You can also view that how these things are put into practice. If you read the theories from the book than you can buy a book explaining the principles of HTML and CSS. Be sure that you buy the book that contains exercises, so you can try it yourself through which you can learn more, rather than from the theories alone.
  • Go through the category pages i.e. ‘HTML tutorial’ and ‘CSS tutorial’. You can find the basic tutorials on HTML and CSS. The theories that you have read on the W3Schools website, you can put into practice here. Most of these contain video tutorials, which gives you the opportunity to practice a lot. Reading alone is not enough if you want to learn HTML and CSS! You have to be able to put it in into practice. You should make familiar yourself with all the HTML and CSS elements and properties so that you are always aware of the opportunities that you have. You must practice as many HTML and CSS tutorials as possible until you become a master of your own.
  • When you believe to have mastered HTML and CSS well, it is the time for you for more advanced tutorials. For this you can go through the website at Net.tutsplus.com. A lot of advanced tutorials can be found here very easily, which will help you to get the perfect knowledge on this regard.
  • If you have become a master with HTML and CSS than you can go on finding for the tutorials related with slicing psd files. Be aware that many of these tutorials are out of date. In these tutorials only the slice tool is used, which creates unnecessary images. If you use more images your site will load slowly. You must make sure that you slice the text on your website as little as possible. This will make it possible to minimize the images and to place them next to each other for a number of times.

Hope these above points will help you to convert PSD to HTML and CSS in a more effective manner in no time.

Ask Siri to Buy Movie Tickets in iOS 6.1

Ask Siri to Buy Movie Tickets in iOS 6.1

Apple has released Software update -iOS 6.1-which gives you the ability to purchase movie tickets through Fandango using Siri.As for Siri, Apple relentlessly continues to make progress in this technology from the future.In the recent iOS 6.1 release, Apple has empowered Siri with the ability to interface with Fandango.The result is that we are now able to have our faithful assistant find movies, help us purchase our tickets, and take advantage of the convenience Passbook gives us.

In iOS 6.1, Passbook now includes a friendlier, easy-to-understand help page with a button that links to an App Store list of downloadable apps that support Passbook. Incidentally, the Fandango app was one of the very first to support Passbook.When you purchase a movie ticket, either via the app or by way of the Fandango.com website, you are clearly presented with several options for electronic admission to the movie. One option is to have a Passbook ticket sent to you. Your movie ticket can be sent to Passbook directly via the Fandango app or via a link in Fandango's purchase confirmation email or SMS message.


20130201-01-PassbookSiri.jpg
With iOS 6.1, Siri, Fandango and Passbook collaborate to help you quickly find and purchase tickets to your movie.

Here are steps to get movie ticket :-

  1. You need to ask Siri "Where is the movie < Movie Name > playing".
  2. Siri responds by briefly showing you a list of nearby theaters playing < Movie Name > , and then shows the closest Theater and Show time. At the same time, Siri announces exactly how far away the Theater is and in what direction.

  3. 20130201-02-PassbookSiri.jpg
    Siri presents you with nearby theaters featuring your's requested movie.

  4. Siri then asks if you want to have her call the Theater, show the Directions to the theater, or skip to the next Theater featuring XYZ.
  5. By Tapping, you can select the theater. This allows to go on to purchase the ticket for the desired show time.
  6. Siri transfers you out to the Fandango app where u can complete your's purchase.

Finally, via the Fandango app confirmation page or Fandango's confirmation email or SMS, You can choose to have the movie ticket installed into your's Passbook for later use when you arrive at the theater.


20130201-03-PassbookSiri.jpg
Once the transaction is complete, your's movie ticket is ready to be scanned at the theater.

What is customer relationship management (CRM) system?



Looking into the increasing need of competition in the industry, a unique technology is required. With customer relationship management or CRM, you would be able to manage your business proceedings in a proper manner. As industries are cropping up in every part, use of this CRM system will help you in having a cutting edge to your business. With the use of this CRM system, you would be able to cater to all the needs and requirements of your customers in a hassle free manner. You can even save a lot on the expenses, which you may require to incur on maintaining the records of your business.

As customization is available with this software, you can customize it according to your needs and requisition. If you were willing to augment your customer service, then this software would be perfect for use. With use of CRM system, you would be able to process the appointments with accuracy. Record of every client availing your services can be kept in a proper and organized manner with use of CRM system. With this software, you would be able to maintain the records of your satisfied customers and improve on the quality and services taking use of the tips given by the customers.

Keeping a track of the engagements would be easy and convenient and you can even send your customers a reminder about the appointments, which they are having with you. This software would help you in managing your clients in a better manner.