learned/learning/to learn RSS 2.0
# Wednesday, 27 May 2009

Feature 1 - Face recognition: Though this feature was released on 9/02/2008, I noticed it only recently. Worth trying it!

 

How to use it?

  • Log into Picasa Web Album, go to Settings (top right corner) page, you will be able to find a section ‘Name Tags’, and right below it there should be a button ‘Turn name tags ON’, click it. After few seconds Picasa will start auto face recognition, you should be able to see the progress on the right side of your picasa home page.
  • Once it is done, you can click a photo (your photo or any of your friend’s photos) from any of your albums, picasa will show a rectangle around the face of the person in the photo, you can add a name tag.
  • Now, go to ‘People’ tab and add more name tags. See below video for more info.



 

Feature 2 – Email Upload: You can upload photos to your album by forwarding emails addressed to your picasa emailid. You will be able to add a picasa emailid on Settings page, under ‘Upload Photos by Email’ section.

 

Feature 3 – Meta tag info: I think this was there since picasa was introduced, but I came to know this only recently from one of my friends. I added few web albums and sent the links to my friend; he was able to tell the camera that was used to take the photographs, apertures, focal length etc. Picasa reads the meta tag info of the photo and displays on the right hand side of the photo under ‘Photo Information’, click link more info.

Wednesday, 27 May 2009 18:42:08 (GMT Daylight Time, UTC+01:00)  #    Comments [0] -
Miscellaneous | Softwares
# Tuesday, 12 May 2009

I'll usually set my font-sizes in units of 'pt', but this gave me weird results when I increased my monitor's DPI from 96 to 120 (as all the fonts were too small in my HD wide-screen monitor, I increased it). I was doing some research on this and I came across this article, this article clearly explains the right unit to use while developing websites. Though this article says percent (%) is the best, I have used 'px', as it gave me consistent results in IE, Mozilla and Chrome.

Click here to see the article.

You can use the below chart for conversion:

Points Pixels Ems Percent
6pt 8px 0.5em 50%
7pt 9px 0.55em 55%
7.5pt 10px 0.625em 62.5%
8pt 11px 0.7em 70%
9pt 12px 0.75em 75%
10pt 13px 0.8em 80%
10.5pt 14px 0.875em 87.5%
11pt 15px 0.95em 95%
12pt 16px 1em 100%
13pt 17px 1.05em 105%
13.5pt 18px 1.125em 112.5%
14pt 19px 1.2em 120%
14.5pt 20px 1.25em 125%
15pt 21px 1.3em 130%
16pt 22px 1.4em 140%
17pt 23px 1.45em 145%
18pt 24px 1.5em 150%
20pt 26px 1.6em 160%
22pt 29px 1.8em 180%
24pt 32px 2em 200%
26pt 35px 2.2em 220%
27pt 36px 2.25em 225%
28pt 37px 2.3em 230%
29pt 38px 2.35em 235%
30pt 40px 2.45em 245%
32pt 42px 2.55em 255%
34pt 45px 2.75em 275%
36pt 48px 3em 300%

Tuesday, 12 May 2009 18:40:36 (GMT Daylight Time, UTC+01:00)  #    Comments [0] -
HTML
# Tuesday, 05 May 2009

One of my friends forwarded this article to me sometime in 2007, as it was too lengthy, I didn’t read at that time, and few months back I got a chance to read this; only then I realized I should have read this in 2007 itself, because this article had changed my life in many ways since I read this … hope it will change yours too!

 

Author: Stephen Covey

Discover the 90/10 Principle. It will change your life (at least the way you react to situations).

 

What is this principle? 10% of life is made up of what happens to you. 90% of life is decided by how you react.

 

What does this mean? We really have no control over 10% of what happens to us. We cannot stop the car from breaking down. The plane will be late arriving, which throws our whole schedule off. A driver may cut us off in traffic.

 

We have no control over this 10%. The other 90% is different. You determine the other 90%. How? ……….By your reaction. You cannot control a red light. but you can control your reaction. Don't let people fool you; YOU can control how you react.

 

Let's use an example.

You are eating breakfast with your family. Your daughter knocks over a cup of coffee onto your business shirt. You have no control over what just happened. What happens next will be determined by how you react. You curse. You harshly scold your daughter for knocking the cup over. She breaks down in tears. After scolding her, you turn to your spouse and criticize her for placing the cup too close to the edge of the table. A short verbal battle follows. You storm upstairs and change your shirt. Back downstairs, you find your daughter has been too busy crying to finish breakfast and get ready for school. She misses the bus. Your spouse must leave immediately for work. You rush to the car and drive your daughter to school. Because you are late, you drive 40 miles an hour in a 30 mph speed limit. After a 15-minute delay and throwing $60 traffic fine away, you arrive at school. Your daughter runs into the building without saying goodbye. After arriving at the office 20 minutes late, you find you forgot your briefcase. Your day has started terrible. As it continues, it seems to get worse and worse. You look forward to coming home. When you arrive home, you find small wedge in your relationship with your spouse and daughter. Why? …. Because of how you reacted in the morning.

 

Why did you have a bad day?

A) Did the coffee cause it?

B) Did your daughter cause it?

C) Did the policeman cause it?

D) Did you cause it?

 

The answer is “D".

You had no control over what happened with the coffee. How you reacted in those 5 seconds is what caused your bad day.

 

Here is what could have and should have happened. Coffee splashes over you. Your daughter is about to cry. You gently say, "Its ok honey, you just need to be more careful next time". Grabbing a towel you rush upstairs. After grabbing a new shirt and your briefcase, you come back down in time to look through the window and see your child getting on the bus. She turns and waves. You arrive 5 minutes early and cheerfully greet the staff. Your boss comments on how good the day you are having. Notice the difference? Two different scenarios. Both started the same. Both ended different. Why? Because of how you REACTED. You really do not have any control over 10% of what happens. The other 90% was determined by your reaction.

 

Here are some ways to apply the 90/10 principle. If someone says something negative about you, don't be a sponge. Let the attack roll off like water on glass. You don't have to let the negative comment affect you! React properly and it will not ruin your day. A wrong reaction could result in losing a friend, being fired, getting stressed out etc. How do you react if someone cuts you off in traffic? Do you lose your temper? Pound on the steering wheel? A friend of mine had the steering wheel fall off) Do you curse? Does your blood pressure skyrocket? Do you try and bump them? WHO CARES if you arrive ten seconds later at work? Why let the cars ruin your drive? Remember the 90/10 principle, and do not worry about it. You are told you lost your job. Why lose sleep and get irritated? It will work out. Use your worrying energy and time into finding another job. The plane is late; it is going to mangle your schedule for the day. Why take outpour frustration on the flight attendant? She has no control over what is going on. Use your time to study, get to know the other passenger. Why get stressed out? It will just make things worse.

 

Now you know the 90-10 principle. Apply it and you will be amazed at the results. You will lose nothing if you try it. The 90-10 principle is incredible. Very few know and apply this principle. The result? Millions of people are suffering from undeserved stress, trials, problems and heartache. We all must understand and apply the 90/10 principle.

 

It CAN change your life!!!

Enjoy….

Tuesday, 05 May 2009 18:38:40 (GMT Daylight Time, UTC+01:00)  #    Comments [0] -
Miscellaneous
# Friday, 01 May 2009

This works in Oracle, hope there is something similar to this in Sql Server too! There might be some other good way to do this, if so, please let me know.

SELECT * FROM TABLE1 WHERE COLUMN1 IN (‘ABC’,’XYZ’,’PQR’) 

Say suppose the strings ‘ABC’,’XYZ’ and ’PQR’ need to be grouped as a single string in the frontend and to be passed as a parameter.  How can we do it? We cannot write like this –

SELECT * FROM TABLE1 WHERE COLUMN1 IN (IN_PARAMTER)

There are many ways to do it:

  1. We can write an inline query.
  2. We can split the strings and group it as a table type.
  3. We can write dynamic sql.

There is one more way to do it and found it to be easy, so thought of sharing.

Here it is:

SELECT * FROM TABLE1 WHERE COLUMN1 IN
(          
 SELECT  REGEXP_SUBSTR(In_Parameter ,'[^,]+',1,LEVEL)        
 FROM    DUAL
 CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (In_Parameter, '[^,]')) + 1
)
 

It is enough if we pass the parameter as ‘ABC,XYZ,PQR’ instead of “‘ABC’,’XYZ’,’PQR’”.

More about Oracle Regular Expressions - http://download-west.oracle.com/docs/cd/B13789_01/server.101/b10759/functions116.htm

Friday, 01 May 2009 18:33:29 (GMT Daylight Time, UTC+01:00)  #    Comments [0] -
Oracle
# Thursday, 16 April 2009

Select or Insert or Update or Delete rows in Excel using .NET. i.e., CRUD operations in EXCEL using .NET. We can literally use the excel sheet as a database, just the connection string matters. Note: 1. This code cannot be used for password protected excel sheets. 2. Delete does not work. See below for explanations. There might be some other good way to do this, if so, let me know.

 

Insert a row in an excel sheet

 

protected void btn_create_Click(object sender, EventArgs e)

{

    OleDbConnection objConnection;

    OleDbCommand objCommand;

    OleDbParameter objParameter;

 

    // Here HDR= YES represents that header is present

    // If the excelsheet you are dealing with does not have header, you can mention HDR = NO,

    // and while fetching columns you have to mention F1, F2 rather than the column names

    objConnection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\Excel\CRUD_EXCEL.xls;

                                                                                                            Extended Properties=""Excel 8.0;HDR=YES;""");

    objCommand = new OleDbCommand();

 

    objCommand.Connection = objConnection;

    objCommand.CommandType = CommandType.Text;

 

    // The sheet name should be followed by $ sign

    objCommand.CommandText = "INSERT INTO [SHEETNAME$](COLUMN_INT, COLUMN_VARCHAR) VALUES(@COLUMN_INT, @COLUMN_VARCHAR)";

 

    objParameter = new OleDbParameter("@COLUMN_INT", OleDbType.Integer);

    objParameter.Value = 3;

    objCommand.Parameters.Add(objParameter);

 

    objParameter = new OleDbParameter("@COLUMN_VARCHAR", OleDbType.VarChar);

    objParameter.Value = "testing";

    objCommand.Parameters.Add(objParameter);

 

    objConnection.Open();

    objCommand.ExecuteNonQuery();

    objConnection.Close();

}

 

Select rows in an Excel sheet

 

protected void btn_read_Click(object sender, EventArgs e)

{

    OleDbConnection objConnection;

    OleDbCommand objCommand;

    OleDbParameter objParameter;

 

    // Here HDR= YES represents that header is present

    // If the excelsheet you are dealing with does not have header, you can mention HDR = NO,

    //and while fetching columns you have to mention F1, F2 rather than the column names

    objConnection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\Excel\CRUD_EXCEL.xls;

                                                                                                                Extended Properties=""Excel 8.0;HDR=YES;""");

    objCommand = new OleDbCommand();

 

    objCommand.Connection = objConnection;

    objCommand.CommandType = CommandType.Text;

 

    // If the excel sheet you are dealing with does not have header, your query will be SELECT F1, F2 FROM [SHEETNAME$]

    objCommand.CommandText = "SELECT COLUMN_INT as COLUMN1, COLUMN_VARCHAR AS COLUMN2 FROM [SHEETNAME$]";

 

    objDataAdapter = new OleDbDataAdapter();

    objDataSet = new DataSet();

    objDataAdapter.SelectCommand = objCommand;

 

    objConnection.Open();

    objDataAdapter.Fill(objDataSet);

    objConnection.Close();

}

 

Update a row in an excel sheet

 

protected void btn_update_Click(object sender, EventArgs e)

{

    OleDbConnection objConnection;

    OleDbCommand objCommand;

    OleDbParameter objParameter;

 

    // Here HDR= YES represents that header is present

    // If the excelsheet you are dealing with does not have header, you can mention HDR = NO,

    // and while fetching columns you have to mention F1, F2 rather than the column names

    objConnection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\Excel\CRUD_EXCEL.xls;

                                                                                                            Extended Properties=""Excel 8.0;HDR=YES;""");

    objCommand = new OleDbCommand();

 

    objCommand.Connection = objConnection;

    objCommand.CommandType = CommandType.Text;

 

    objCommand.CommandText = "UPDATE [SHEETNAME$] SET COLUMN_VARCHAR =  @COLUMN_VARCHAR WHERE COLUMN_INT = @COLUMN_INT";

 

    objParameter = new OleDbParameter("@COLUMN_VARCHAR", OleDbType.VarChar);

    objParameter.Value = "PQR";

    objCommand.Parameters.Add(objParameter);

 

    objParameter = new OleDbParameter("@COLUMN_INT", OleDbType.Integer);

    objParameter.Value = 3;

    objCommand.Parameters.Add(objParameter);

 

    objConnection.Open();

    objCommand.ExecuteNonQuery();

    objConnection.Close();

}

 

Delete

 

protected void btn_delete_Click(object sender, EventArgs e)

{

        As far as I know ADO does not support Excel row delete

 

        You are more restricted in deleting Excel data than data from a relational data source.

        In a relational database, "row" has no meaning or existence apart from "record";

        in an Excel worksheet, this is not true. You can delete values in fields (cells). However, you cannot:

 

        1. Delete an entire record at once or you receive the following error message:

            Deleting data in a linked table is not supported by this ISAM.

            You can only delete a record by blanking out the contents of each individual field.

        2. Delete the value in a cell containing an Excel formula or you receive the following error message:

            Operation is not allowed in this context.

        3. You cannot delete the empty spreadsheet row(s) in which the deleted data was located,

            and your recordset will continue to display empty records corresponding to these empty rows.

}

 

Thursday, 16 April 2009 18:10:39 (GMT Daylight Time, UTC+01:00)  #    Comments [0] -
.NET

Here is a method to import/send XML to Oracle and thus we need not call the database repeatedly for mass insert, update etc. DBMS_XMLSTORE has been used here. There might be some other good way to do this, if so, please let me know. 

 

Here you go:

 

1. Importing Excel from .NET interface to Oracle. Just to get some xml, I have used an excel sheet here, you can replace it with your xml data. 

 

COL1

COL2

COL3

1

Aaa

abc

2

Bbb

pqr

3

Aaa

Abcdef

4

ddd

pqrst

 

 

.NET Code

 

 string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\Excel\\excel.xls;Extended Properties=Excel 8.0;";

 OleDbDataAdapter daImportExcel = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", strConn);

 

 DataSet dsExcelData = new DataSet();

 daImportExcel.Fill(dsExcelData, "TABLE_NAME");

 

OracleParameter parameter = new OracleParameter();

parameter = new OracleParameter("XML_CLOB", OracleDbType.Clob);

parameter.Direction = ParameterDirection.Input;

parameter.Value = dsExcelData.GetXml();

 

OracleCommand objCommandImport = new OracleCommand();

objCommandImport.Connection = objConnection;

objCommandImport.CommandType = CommandType.StoredProcedure;

objCommandImport.CommandText = "BIMS.XML_PARSER";

 

objCommandImport.Parameters.Add(parameter);

objCommandImport.ExecuteNonQuery();

 

 

Note: I am passing XML as CLOB.

Oracle Procedure

 

I am inserting the dataset, I mean the XML into table XML_TESTING. Here COL1 is integer and other 2 columns are varchar.

 

CREATE OR REPLACE PROCEDURE XML_PARSER

(

    XML_CLOB    IN CLOB

)

AS

 

INSERT_CONTEXT  DBMS_XMLSTORE.CTXTYPE;

ROW_COUNT       NUMBER;

 

 

BEGIN

 

 

    INSERT_CONTEXT := DBMS_XMLSTORE.NEWCONTEXT('XML_TESTING');

    DBMS_XMLSTORE.SETROWTAG(INSERT_CONTEXT, 'TABLE_NAME');

    DBMS_XMLSTORE.CLEARUPDATECOLUMNLIST(INSERT_CONTEXT); 

    DBMS_XMLSTORE.SETUPDATECOLUMN(INSERT_CONTEXT,'COL1');

    DBMS_XMLSTORE.SETUPDATECOLUMN(INSERT_CONTEXT,'COL2');

    DBMS_XMLSTORE.SETUPDATECOLUMN(INSERT_CONTEXT,'COL3'); 

    ROW_COUNT := DBMS_XMLSTORE.INSERTXML(INSERT_CONTEXT, XML_CLOB);

   

    DBMS_XMLSTORE.CLOSECONTEXT(INSERT_CONTEXT);   

 

END XML_PARSER;

 

Note:

Names of the columns that are inserted and of the underlying database table should be same. By default, XML documents are expected to identify rows with the <ROW> tag. This is the same default used by DBMS_XMLGEN when generating XML. This may be overridden by calling the setRowTag function. Here ‘TABLE_NAME'’ has been set as rowtag as it is our table name.

 

Drawback:

.NET is not allowing to use GetXml in huge datasets. If somebody has a solution for it, please let me know.

 

You can understand better about DBMS_XMLSTORE from this article - http://www.stanford.edu/dept/itss/docs/oracle/10g/appdev.101/b10790/xdb_dbmstore.htm#CACEJGEH

Thursday, 16 April 2009 18:08:18 (GMT Daylight Time, UTC+01:00)  #    Comments [0] -
.NET | Oracle
# Wednesday, 11 March 2009

After logging in, be sure to visit all the options under Configuration in the Admin Menu Bar above. There are 26 themes to choose from, and you can also create your own.

 

Wednesday, 11 March 2009 07:00:00 (GMT Standard Time, UTC+00:00)  #    Comments [0] -

Navigation
Archive
<2009 May>
SunMonTueWedThuFriSat
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2017
Gokulnath
Sign In
Statistics
Total Posts: 41
This Year: 0
This Month: 0
This Week: 0
Comments: 47
Themes
Pick a theme:
All Content © 2017, Gokulnath
DasBlog theme 'Business' created by Christoph De Baene (delarou)

The bulk of humans who will end up affairs Artya's expensive, bound assembly articles are small. These are mostly flush collectors who accept omega replica an aberrant yield on activity and are annihilation but amateur watch lovers. After a lifetime of affairs or seeing bourgeois timepieces, for abounding it can be abundantly auspicious to rolex replica don something weird, wild, or just apparent controversial. We feel that it is our role as a watch media destination not alone to acquaint with those alcove buyers who abide our breitling replica admired readership forth with anybody else, but aswell to bell ross replica accumulate humans abreast of what is new and potentially discussion-worthy in the archival world.