Photography

Learning about Exposure – The Exposure Triangle

There are three elements:
- ISO
- Aperture
- Shutter speed

Things to consider when taking a photo:

ISO:

- Check what the ISO level is set to. Remember smaller ISO values are good for taking finer pictures (as opposed to a grainier image). However, you have to increase the ISO level when you are taking pictures where light is limited or when the object is moving.

- Higher ISO settings are generally used in darker situations to get faster shutter speeds (for example an indoor sports event when you want to freeze the action in lower light) – however the cost is noisier shots.

- 100 ISO is generally accepted as ‘normal’ and will give you lovely crisp shots (little noise/grain).

- Most people tend to keep their digital cameras in ‘Auto Mode’ where the camera selects the appropriate ISO setting depending upon the conditions you’re shooting in (it will try to keep it as low as possible) but most cameras also give you the opportunity to select your own ISO also.

- When you do override your camera and choose a specific ISO you’ll notice that it impacts the aperture and shutter speed needed for a well exposed shot. For example – if you bumped your ISO up from 100 to 400 you’ll notice that you can shoot at higher shutter speeds and/or smaller apertures.

- When choosing the ISO setting I generally ask myself the following four questions:

Light – Is the subject well lit?
Grain – Do I want a grainy shot or one without noise?
Tripod – Am I using a tripod?
Moving Subject – Is my subject moving or stationary?

- If there is plenty of light, I want little grain, I’m using a tripod and my subject is stationary I will generally use a pretty low ISO rating.
However if it’s dark, I purposely want grain, I don’t have a tripod and/or my subject is moving I might consider increasing the ISO as it will enable me to shoot with a faster shutter speed and still expose the shot well.

- Of course the trade off of this increase in ISO will be noisier shots.

- Situations where you might need to push ISO to higher settings include:

– Indoor Sports Events – where your subject is moving fast yet you may have limited light available.
– Concerts – also low in light and often ‘no-flash’ zones
– Art Galleries, Churches etc- many galleries have rules against using a flash and of course being indoors are not well lit.
– Birthday Parties – blowing out the candles in a dark room can give you a nice moody shot which would be ruined by a bright flash. Increasing the ISO can help capture the scene.

Published in: on July 17, 2011 at 12:17 am  Leave a Comment  

JDBC

Data or information is at the heart of most business applications, and JDBC deals with data stored and manipulated in relational database systems.

This book takes an example based approach to describing the features and functionalities available in JDBC. Whether you are a new or an experienced database/JDBC developer, you should find the examples and accompanying text a valuable and accessible knowledge base for creating your own database solutions.

In this book, I will use some basic Java/JDBC utility classes (such as the DatabaseUtil class), which are available for download from the book’s website. The DatabaseUtil class provides methods for closing JDBC objects (such as Connection, ResultSet, Statement and PreparedStatement).

So What is JDBC ?

JDBC is a set of programming APIs that allows easy connection to a wide range of databases (esp relational databases) through Java programs.

In today’s programming world, JDBC is the standard for communication between a Java application and a relational database. JDBC is simple and powerful because it is a database-independent way of manipulating data from any relational database.

In a nutshell, JDBC is a database-independent API for accessing a relational database. You pass SQL to Java methods in the JDBC classes (the packages java.sql and javax.sql ) and get back JDBC objects (such as ResultSet) that represent the results of your query. JDBC is designed in a simple way, so most database programmers need to learn only a few methods to do most of what database programmers need to do to accomplish database programming tasks.

In this section, I presented the basic outline of the JDBC architecture. JDBC’s DriverManager class provides the basic service for managing a set of JDBC drivers. I will talk about these classes and interfaces again.

What is JDBC’s High-Level Architecture ?

Your Java programs interact with only the JDBC API. The sole purpose of JDBC is to read data from databases and to write data back to the databases. With JDBC, though, you can do more than reading/writing records.

You can even read the metadata about tables, views, and other useful objects in databases. For example, using JDBC’s DatabaseMetadata, you can find out the name and number of columns for a given table and their associated data types. This information is useful in developing GUI applications.

According to Sun, the JDBC API contains two major sets of interfaces:

- the first is the JDBC API for application writers.

- the second is the lower-level JDBC driver API for driver writers.

This book focuses on the JDBC API for application writers.

The JDBC API does most of the things through the DriverManager class (java.sql.DriverManager).

What is DriverManager ?

It is a connection factory class. In fact, DriverManager is the only class that can create database connections. (Each database connection is represented by an instance of a java.sql.Connection) The DriverManager uses drivers to create connections. Each vendor (such as Oracle, MySQL, and Sybase) provides a set of drivers.

Refer to the JDBC detailed architecture:

- Java code calls a JDBC library (using the java.sql and javax.sql packages)

- JDBC loads a driver, for example, an Oracle driver is loaded using the following code snippet:

Class.forName(“oracle.jdbc.driver.OracleDriver”)

- Calling Class.forName() automatically creates an instance of the driver and registers the driver with the DriverManager class.

- The driver talks to a particular database such as Oracle or MySQL

WHO PROVIDES THESE JDBC DRIVERS ?

Usually, a database vendor (such as MySQL, Oracle, Sybase, and so on) writes a JDBC driver ( a specific software for a specific database), which is a set of classes/interfaces that implements these interfaces for a particular database system.

Following the JDBC architecture,  a Java database application uses the DriverManager class to get the java.sql.Connection object, which represents a database connection. Then using the Connection object, you can create Statement/PreparedStatement/ CallableStatement, which can execute SQL queries and stored procedures and return results as ResultSet objects.

ResultSet is a table of data representing a database result set, which is usually generated by executing a statement that queries the database.

The JDBC API is comprised of two Java packages: java.sql and javax.sql. The following are core JDBC classes, interfaces and exceptions in the java.sql package:

DriverManager: This class loads JDBC drivers in memory. You can also use it to create java.sql.Connection objects to data sources (such as Oracle, MySQL and so on).

Connection: This interface represents a connection with a data source. You can use the Connection object for creating Statement, PreparedStatement, and CallableStatement objects.

Statement: This interface represents a static SQL statement. You can use it to retrieve ResultSet objects.

PreparedStatement: This interface extends Statement and represents a precompiled SQL statement. You can use it to retrieve ResultSet objects.

CallableStatement: This interface represents a database stored procedure.

Published in: on February 12, 2011 at 1:05 am  Leave a Comment  

Java Enterprise Edition

API’s such as:

JNDI

The servlet API

The security API

and the suite of API’s collectively known as the Java Enterprise APIs – JDBC, RMI and Java IDL – together make Java a formidable force on the server. The leap from a good server development language to being a powerful enterprise development platform, however, is still far.

Before you get into the heart of Java enterprise’s capabilities, you should first understand what the term “enterprise” means in the context of enterprise software.

THE ENTERPISE:

Buried within the term “enterpise” is the idea of a business taken wholistically. An enterpise solution identifies common problem domains within a business and provides a shared infrastructure for solving those problems. If your business is running a bank, your individual branches may have different business cultures, but those cultures do not alter the fact that they all deal with customers and accounts.

Looking at this business from an enterpise perspective means abstracting away from irrelevant differences in the way the individual branches do things, and instead approaching the business from their common ground.

Java is an object-oriented language with database access and distributed computing at its core.

The Java platform specification has since grown to encompass many other APIs. The following is an abridged list of some of the Java APIs:

Java Enterpise:

Java Enterprise actually consists of three separate libraries that provide access to an organization’s resources and applications.  The Java Database Connectivity API or JDBC, provides database connectivity. Using JDBC, an application can perform database access independent of the actual database engine being used for data storage. The same application can be written once, compiled once, and run against any database engine with a JDBC driver.

The Interface Definition Language (IDL) enables Java applications to provide a language-neutral interface between Java objects and objects located across the network. It follows the Object Management Group (OMG) IDL specification.

Remote Method Invocation (RMI) is a java specific API that lets objects call methods in objects located across the network. Unlike IDL, RMI is a Java-only solution. Instead of writing complex communication protocols using sockets, an application can communicate with remote objects through simple Java method calls.

 

Published in: on February 11, 2011 at 10:22 pm  Leave a Comment  

Character is what you are in the dark

This quote was on our dressing table mirror for 10 years, until we renovated our house. I always read it as “Character is what, you are in the dark” . Which I understood as, if you do not know what character is, then you are in the dark.

For some reason, I thought of that quote again today. And typed it in google to see who the author was. While typing it, I read it as “Character is, what you are in the dark”. Which I understand it as, what you do when no one is watching you or when you are in difficult times, is what character is all about.

I guess one has to extract their own meaning from this wise saying. But to me, understanding it in a different way after so many years, is a bit amusing. Funny how time can make you see/think/read things differently.

Published in: on October 28, 2010 at 3:18 am  Leave a Comment  

Showing Up for Life

If I have to take one page out of the book, “Showing up for life” by Sr.Bill Gates, it is this:

Life is the ultimate teacher, but it is usually through experience and not scientific research that we discover its deeper lessons. We are all here for a single purpose: to grow in wisdom and learn to love. We can do this through losing as well as through winning, by having and by not having, by succeeding or by failing. All we need to do is to show up openhearted for class …. So fulfilling life’s purpose may depend more on how we play than what we are dealt. You have to be present to win.

 

Published in: on October 25, 2010 at 3:14 am  Leave a Comment  

7 Things Your Boss Should Never Say to You – Yahoo! Finance

7 Things Your Boss Should Never Say to You – Yahoo! Finance.

Published in: on March 26, 2010 at 2:28 pm  Leave a Comment  

How to Swim ?

I will focus on Freestyle.  Before taking swim lessons, I was able to swim but without proper technique. Swimming can be a lot of fun, once you master the three fundamentals:

1.) Learn how to kick your legs: I know everyone knows this. I used to kick my legs vigorously without paying attention to keeping my legs straight.  Your toes should be pointed, like ballerina, and kick using your thigh muscles. No bending the knees.  Train yourself to kick hard with your thigh muscles, its the key.

2.) Learn how to use your hands: Its important to get your hands as high and forward as possible and then pull yourselves forward. Your hands should go all the way forward and enter the water at a 45 degree angle. Fingers together. Pull with your shoulder muscles.

3.) Knowing how and when to breathe: Probably the most difficult one.  Your head should be underwater most of the time. One mistake I used to make was keep my head above all the time. No that’s not the right way to do it. You should learn to take a breath and release air from the mouth. At no point should you try to breathe when under water.  Some people breathe every 3-5 strokes, whichever is convenient.

Swimming is all about getting these three right at once. So you have to train your mind to focus on these three aspects.

First, work on them individually and then combine them to become an expert swimmer.

Published in: on January 20, 2010 at 6:47 pm  Leave a Comment  

Attaching Source Code (when you press f3)

The src.zip file is present inside your jdk folder.

Eclipse J

Published in: on January 18, 2010 at 12:49 am  Leave a Comment  

JDK 6 Documentation

JDK 6 Documentation.

Published in: on January 18, 2010 at 12:22 am  Leave a Comment  

Health Tips

General tips:

Long periods of starvation lower your metabolism.

Fat helps the body absorb fat-soluble vitamins, such as vitamins A, D, E, K and carotenoids (whatever that is).

Almonds are high in protein, monounsaturated (“good”) fat, rich in calcium, magnesium and phosphorus, and a good source of vitamin E. ( Not all fat is harmful like that monounsat…. )

Select fish rich in omega-3 fatty acids, such as salmon, trout, and herring.

Germs that make food go bad can grow if you don’t keep food at the right temperature.

Diets rich in potassium may help to maintain healthy blood pressure. Milk products, especially yogurt and fluid milk, provide potassium.

Your body produces vitamin D when it is exposed to sunlight. So make sure to get your 10-15 minutes of sunshine a few times a week.

Meat, fish, poultry, and milk are the best sources of carnitine, In general, the redder the meat, the higher its carnitine content.

Recent data from clinical trials on humans finds that soy may improve brain function.

Processed meats such as hams, sausages, frankfurters, and luncheon or deli meats have added sodium.

If you cut down fatty foods and eat more fruit, vegetables, grain and protein, you will automatically cut calories and lose weight.

Saturated fat is found in high-fat dairy products, ready-to-eat meats, the skin and fat of chicken and turkey, lard, palm oil, and coconut oil.

Workout tips:

When you work out, your need for several vitamins and minerals increases. So be sure to take a multivitamin to replace what’s lost during exercise.

Jumping rope is a good cardiovascular exercise and calorie-burner.

Mental health benefits have been found in people who do aerobic or a combination of aerobic and muscle-strengthening activities.

A warm-up is a low-intensity cardiovascular exercise performed for 5-10 minutes until prespiration begins.

Strength-training workouts, and not just cardiovascular exercise, should be preceded by a warm-up.

Working out with weights improves your strength and muscle tone and helps you lose weight by improving your metabolism.

Stretching all parts of the body is crucial before any workout.

To get the most from your abdominal crunches, your lower back should stay pressed against the floor throughout the crunch.

An effective cardio exercise will increase your heart rate,which burns more calories while strengthening your cardiovascular system.

By doing too much aerobic work, you run the risk of overtraining and severely limiting your body’s ability to recover and get stronger.

Published in: on January 16, 2010 at 11:42 pm  Leave a Comment  
Follow

Get every new post delivered to your Inbox.