Export a table into csv format

Here is an example to export data from MySQL into CSV File Format.

SELECT * INTO OUTFILE ‘/tmp/file_name.csv’ FIELDS TERMINATED BY ‘,’ OPTIONALLY ENCLOSED BY ‘”‘ LINES TERMINATED BY ‘n’ FROM table_name;

Permanent link to this article: https://blog.openshell.in/2010/12/export-a-table-into-csv-format/

Fields Other than the PK Need to be Indexed

The Table Primary Key (PK) is automatically an index.

Indexes should be used whenever a relationship needs to be established between two tables using a field other than the PK E.g. both fields included in the ON table1.field1=table2.field3 clause. Making both fields indexes allows MySQL to JOIN the two tables much more efficiently and much faster.

The working of an index is hidden from the user but involves MySQL setting up lookup pointers.

Permanent link to this article: https://blog.openshell.in/2010/12/fields-other-than-the-pk-need-to-be-indexed/

ETL Concepts

Extraction, Transformation and Loading (ETL) SAP NetWeaver BI offers flexible means for integrating data from various sources. Depending on the data warehousing strategy for your application scenario, you can extract the data from the source and load it into the SAP NetWeaver BI system or directly access the data in the source without storing it physically in the Enterprise Data Warehouse. In this case the data is integrated virtually in the Enterprise Data Warehouse. Sources for the Enterprise Data Warehouse can be operational, relational datasets (for example in SAP systems), files or older systems. Multidimensional sources, such as data from other BI systems, are also possible. Transformations permit you to perform a technical cleanup and to consolidate the data from a business point of view. Extraction and Loading Extraction and transfer processes in the initial layer of SAP NetWeaver BI as well as direct access to data are possible using various interfaces, depending on the origin and format of the data. In this way SAP NetWeaver BI allows the integration of relational and multidimensional data as well as of SAP and non-SAP data. ● BI Service API (BI Service Application Programming Interface) The BI service API permits the extraction and direct access to data from SAP systems in standardized form. This can be SAP application systems or SAP NetWeaver BI systems. The data request is controlled from the SAP NetWeaver BI system. ● File Interface The file interface permits the extraction from and direct access to files, such as csv files. The data request is controlled from the SAP NetWeaver BI system. ● Web Services Web services permit you to send data to the SAP NetWeaver BI system under external control. ● UD Connect (Universal Data Connect) UD Connect permits the extraction from and direct access to both relational and multidimensional data. The data request is controlled from the SAP NetWeaver BI system. ● DB Connect (Database Connect) DB Connect permits the extraction from and direct access to data lying in tables or views of a database management system. The data request is controlled from the SAP NetWeaver BI system. ● Staging BAPIs (Staging Business Application Programming Interfaces) Staging BAPIs are open interfaces from which third party tools can extract data from older systems. The data transfer can be triggered by a request from the SAP NetWeaver BI system or by a third party tool. Transformation With transformations, data loaded within the SAP NetWeaver BI system from the specified interfaces is transferred from a source format to a target format in the data warehouse layers. The transformation permits you to consolidate, clean up and integrate the data and thus to synchronize it technically and semantically, permitting it to be evaluated. This is done using rules that permit any degree of complexity when transforming the data. The functionality includes a 1:1 assignment of the data, the use of complex functions in formulas, as well as the custom programming of transformation rules. For example, you can define formulas that use the functions of the transformation library for the transformation. Basic functions (such as and, if, less than, greater than), different functions for character chains (such as displaying values in uppercase), date functions (such as computing the quarter from the date), mathematical functions (such as division, exponential functions) are offered for defining formulas. Availability Requirements for Data in SAP NetWeaver BI For different business problems, the data might need to be more or less up-to-date. For example, if you want to check the sales strategy for a product group each month, you need the sales data for this time span. Historic, aggregated data is taken into consideration. The scheduler is an SAP NetWeaver BI tool that loads the data at regular intervals, for example every night, using a job that is scheduled in the background. In this way no additional load is put on the operational system. We recommend that you use standard data acquisition, that is schedule regular data transfers, to support your strategic decision-making procedure. If you need data for the tactical decision-making procedure, data that is quite up-to-date and granular is usually taken into consideration, for example, if you analyze error quotas in production in order to optimally configure the production machines. The data can be staged in the SAP NetWeaver BI system based on its availability and loaded in intervals of minutes. A permanently active job of SAP background processing is used here; this job is controlled by a special process, a daemon. This procedure of data staging is called real-time data acquisition. By loading the data in a data warehouse, the performance of the source system is not affected during the data analysis. The load processes, however, require an administrative overhead. If you need data that is very up-to-date and the users only need to access a small dataset sporadically or only a few users run queries on the dataset at the same time, you can read the data directly from the source during analysis and reporting. In this case the data is not archived in the SAP NetWeaver BI system. Data staging is virtual. You use the VirtualProvider here. This procedure is called direct access.

Permanent link to this article: https://blog.openshell.in/2010/12/etl-concepts/

Integration, Storage and Management of Data

Comprehensive, meaningful data analyses are only possible if the datasets are bundled into a business query and integrated. These datasets can have different formats and sources. The data warehouse is therefore the basis for a business intelligence solution.

Enterprise data is collected centrally in the Enterprise Data Warehouse of SAP NetWeaver BI. The data is usually extracted from different sources and loaded into SAP NetWeaver BI. SAP NetWeaver BI supports all kinds of sources – relational and multidimensional, SAP and non-SAP. Technical cleanup steps are then performed and business rules are applied in order to consolidate the data for evaluations. The consolidated data is stored in the Enterprise Data Warehouse. This entire process is called extraction, transformation and loading (ETL).

Data can be stored in different layers of the data warehouse architecture with different granularities, depending on your requirements.  The data flow describes the path taken by the data through the data warehouse layers until it is ready for evaluation.

Data administration in the Enterprise Data Warehouse includes control of the processes that transfer the data to the Enterprise Data Warehouse and broadcast the data within the Enterprise Data Warehouse as well as convert strategies for optimal data retention and history keeping (limiting the data volume. This is also called Information Lifecycle Management.

With extraction to downstream systems, you can make the data consolidated in the Enterprise Data Warehouse available to further BI systems or further applications in your system landscape.

A metadata concept permits you to document the data in SAP NetWeaver BI using definitions or information in structured and unstructured form.

The Data Warehousing Workbench is the central work environment that provides the tools for performing the tasks in the SAP NetWeaver BI Enterprise Data Warehouse.

 >>>>>TOMMOROW’S CHAPTER  – ETL CONCEPTS

Permanent link to this article: https://blog.openshell.in/2010/12/integration-storage-and-management-of-data/

Tips for using jQuery

Find if something is hidden:

We use .hide(), .show() methods in jquery to change the visibility of an element. Use following code to check the whether an element is visible or not.

if($(element).is(“:visible”) == “true”) {
//The element is Visible
}

Center an element on the Screen:

To make align the element to center.

jQuery.fn.center = function () {
this.css(“position”,”absolute”);
this.css(“top”, ( $(window).height() – this.height() ) / 2+$(window).scrollTop() + “px”);
this.css(“left”, ( $(window).width() – this.width() ) / 2+$(window).scrollLeft() + “px”);
return this;
}

//Use the above function as:
$(element).center();

Disable right-click contextual menu:

There’s many Javascript snippets available to disable right-click contextual menu, but JQuery makes things a lot easier:

$(document).ready(function(){
$(document).bind(“contextmenu”,function(e){
return false;
});
});

Get mouse cursor x and y axis:

This script will display the x and y value – the coordinate of the mouse pointer.

$().mousemove(function(e){
//display the x and y axis values inside the P element
$(‘p’).html(“X Axis : ” + e.pageX + ” | Y Axis ” + e.pageY);
});
<p></p>

Font resizing:

Font Resizing is a very common feature in many modern websites. Here’s how to do it with JQuery.

$(document).ready(function(){
// Reset Font Size
var originalFontSize = $(‘html’).css(‘font-size’);
$(“.resetFont”).click(function(){
$(‘html’).css(‘font-size’, originalFontSize);
});
// Increase Font Size
$(“.increaseFont”).click(function(){
var currentFontSize = $(‘html’).css(‘font-size’);
var currentFontSizeNum = parseFloat(currentFontSize, 10);
var newFontSize = currentFontSizeNum*1.2;
$(‘html’).css(‘font-size’, newFontSize);
return false;
});
// Decrease Font Size
$(“.decreaseFont”).click(function(){
var currentFontSize = $(‘html’).css(‘font-size’);
var currentFontSizeNum = parseFloat(currentFontSize, 10);
var newFontSize = currentFontSizeNum*0.8;
$(‘html’).css(‘font-size’, newFontSize);
return false;
});
});

Preloading images:

When you’re using images in Javascript, a good thing is to preload it before you have to use it. This code will do the job:

jQuery.preloadImages = function()
{
for(var i = 0; i”).attr(“src”, arguments[i]);
}
};

// Usage
$.preloadImages(“image1.gif”, “/path/to/image2.png”, “some/image3.jpg”);

Permanent link to this article: https://blog.openshell.in/2010/12/tips-for-using-jquery/

MNP–Mobile Number Portability

INTRODUCTION

Mobile Number portability (MNP) enables mobile subscribers to change their service providers or their location without having to change their existing phone numbers. If the subscribers are not satisfied with the services of their service provider, they can change their service provider while retaining the existing phone number. This infuses competition among service providers and forces them to improve their service standards to check subscriber churn. Many countries have made number portability mandatory to liberalize competition. Many others are in the process of implementing it. A significant technical aspect of implementing number portability is related to the routing of calls or mobile messages (SMS, MMS) to a number once it is ported to some other network. This paper discusses:. types of number portability. various call routing schemes for service provider number portability. comparisons among various routing schemes. challenges of implementing number portability. best solution in terms of complexity of implementation, use of network resources, and scalability

TYPES OF NUMBER PORTABILITY

The various types of number portability are:.

Service Provider Number Portability: Subscribers can change the service provider while retaining the same phone number. It is also called operator portability.

Location Number Portability: Subscribers can change their service location while keeping the same telephone number.

Service Portability: Subscribers can change the subscribed services while retaining the same telephone number. Service portability allows the subscribers to enjoy the subscribed services in the same way when they roam outside their home networks

Permanent link to this article: https://blog.openshell.in/2010/12/mnp-mobile-number-portability/

How do I find out If Running Kernel Is 32 Or 64 Bit?

Target Audience: Beginners of Linux/Unix Users

Many beginners of Linux/Unix users might struggle or uncertain when they download softwares for Linux/Unix to choose correct software according to its kernel ie. 32 bit or 64 bit.

The uname command gives you the solution. Execute the following command in terminal:


$ uname -a

If the result contains x86_64, its 64 bit kernel.

If the result contains i386 or i486 or i586 or i686, its 32 bit kernel.

Permanent link to this article: https://blog.openshell.in/2010/12/how-do-i-find-out-if-running-kernel-is-32-or-64-bit/

Using find command in linux

Using find command in linux

find is a powerful command in linux. If u understand it then u can do most thing using it. but in this post i am not going to teach the full power of  it but some basic usage.

This is a simple one finding any .txt file in the home directory of vallu with exact size of 100kb


$find /home/vallu -name "*.txt" -size 100k

here this is a simple one finding any .txt file in the home directory of vallu with size greater than 100kb

$find /home/vallu -name "*.txt" -size +100k

here this is a simple one finding any .txt file in the home directory of vallu with size lesser than 100kb

$find /home/vallu/ -name "*.txt" -size -100k

this is also a simple command which finds any picture with .jpg extenstion which was accesed in past 5 mins


$find /home/vallu/ -name "*.jpg" -amin -5

this command finds any text file which are modified in last one min


$find /home/vallu -name "*.txt" -mmin -1

this command finds any text file which are created in last one day(24 hrs)

$find /home/vallu -name "*.txt" -ctime -1

Permanent link to this article: https://blog.openshell.in/2010/12/using-find-command-in-linux/

5 CSS tricks you may not know

  1. Using multiple classes together
  2. Usually attributes are assigned just one class, but this doesn’t mean that that’s all you’re allowed. You can actually assign as many classes as you like.

    For example:

    <div class=”class1 class2″></div>

    The class names are separates by a space. So that means “class1” and “class2” calls up the rules assigned to the div. If any rules overlap

    between the two classes then the class which is below the other in the CSS document will take precedence.

  3. !important ignored by IE
  4. Normally in CSS whichever rule is specified last takes precedence. However if you use !important after a command then this CSS command will take precedence regardless of what appears after it. This is true for all browsers except IE.

    For example:

    margin-top: 3.5em !important; margin-top: 2em;

    So, the top margin will be set to 3.5em for all browsers except IE, which will have a top margin of 2em.

  5. Centre aligning a block element
  6. If you wanted to fixed a width website of layout, and the content floated in the middle of the screen.

    For example:

    #content
    {
    width: 750px;
    margin: 0 auto;
    }

  7. Changing Cursor
  8. The cursor property specifies the type of cursor to be displayed when pointing on an element.

    For example:

    #wrapper a:hover
    {
    cursor: pointer;    /*crosshair*/
    }

  9. Transparency
  10. This makes any element transparent.

    For example:

    .transparent_class {
    filter:alpha(opacity=50);
    -moz-opacity:0.5;
    -khtml-opacity: 0.5;
    opacity: 0.5;
    }

    This code makes the element 50% transparent- you can adjust the levels accordingly. Transparency is a bit weird because each browser reads it differently, so you need to make separate statements.

    opacity: This will work in most versions of Firefox, Safari, and Opera. This would be all you need if all browsers supported current standards.

    filter: This one you need for IE.

    -moz-opacity: You need this one to support way old school versions of the Mozilla browsers like Netscape Navigator.

    -khtml-opacity: This is for way old versions of Safari (1.x) when the rendering engine.

Permanent link to this article: https://blog.openshell.in/2010/12/5-css-tricks-you-may-not-know/

Get your free personal cloud -Ubuntu One

Introduction to Ubuntu One:

Ubuntu One is a personal cloud for everyone. It’s just like syncing files, notes and contacts. You can access your contacts, notes or bookmarks from any computer or the web.
The mind blowing thing in it is you can enjoy accessing your favorite music or stuff from a your iPhone and Android phones. Though this seems to be a small thing it is just not small

now i want to tell the secret that it is not just like syncing files, notes and contacts, its like hosting your personal cloud. woooooo… thats great right. it means you can have your pc where ever and you can share it and if u want u can remove it. ubuntu one gives all cool stuff to monitor the pc, tablets, and what ever u are connected with it.

what u can get with it? ofcrs no need to fly to home if u have all ur stuffs there. what ever u want to do is to sync your folder with ubuntu one.

right now comes with these cool things specified below for free of cost with 2gb of space and if u want more then u can buy some more.

Automatic sync to keep all of your important data the same across all of your computers and your personal cloud.Unlimited computers you can use and there’s no limit to the number of Ubuntu and Windows (beta) computers that you can sync.

Anytime, anywhere access everything from your desktop while offline or via a web browser when online

if u are still struck with your virus filled OS. don’t worry ubuntu one can be accessed via your OS too. dont think that i am talking about MS platform. i m not gona talk about it anyway. wana try just go to https://one.ubuntu.com/ and enjoy

i have my own cloud with ubuntu one and i have lot n lot of data which i always want to use. guz what its my GF’s pics. luv u honey…. ummmmmaaaaaaa…..

Permanent link to this article: https://blog.openshell.in/2010/12/get-your-free-personal-cloud-ubuntu-one/