Tylenol is the best medicine to a bad head ache, so I had one last nite and it put me to sound sleep...Woke up to a fresh feeling this morning and having my sprits high, once again I felt passionate enough to tackle ACCESS problems at hand.
I am kind of person.. who loves to get things going.. and I really cant get stuck at one point and be there for long.. it stresses me out.
Coming into office this morning, I am thiniking.. isnt it what I like the most abt my job..IT is a challenging career, learning new technologies and have something different to work on in life.. I really cant do the same thing for more than a month okay may be 2 mo's.. I belive variety is the spice of life. So I shudnt complain but get along and accept challenges. So first thing I did is to write all my issues on a paper and come up with a plan to take one thing at a time. To my delight, it all worked out well and by 3.PM I have an answer to my issues...well not all of them.. but I am happy with my progress....focused enough that I forgot to have my lunch.
So lesson learnt: dont sweat small stuff and have a plan to deal with ur things. Life is not always fair. :D. And yes sometimes resting enough helps.
-Sunny
Friday, March 28, 2008
Thursday, March 27, 2008
So Totally Tired
Do I have to work on Access Database..? Yes
Do I want to..? NO
I am killing myself trying work on someting which I totally hate.
Like eveytime I had to write some new logic..the voice in my head says you dont have to..its not gonna add up to your skill set.
I dont have an option but meet my dead line.. (GRRRR).. Honestly its really depressing for a java pro(yeah tats me ;)) to work on something really boring as access db.
I dont know.. I always seem to get the patch up works in the proj..Not because I am free.. I hv tonns of coding to do in my other module.. still ppl are confident that I'll be able to do both. God gimme a break..
I am so totally tired today.. stretching myself to meet a requirement and the deadline..So I am screaming (inside) Is it weekend yet..? Pls say a prayer for me that I'll start liking what I am doing atleast until its rolled out on Apr. 4
btw totally un-realated, my hubby booked a bus trip for 2 to Washington DC, for sometime in late May. U know how much did it cost him..??? 50 cents.. yes 50 cents..!!!! hes such a good deal hunter..and we found it irresistible....so we are going..just for the heck of it :D Hope we'll hv fun.
PS: AFter reading the title of my post don't say SO..? like Cheney said to a reporter.. ;)
-Sunny
Do I want to..? NO
I am killing myself trying work on someting which I totally hate.
Like eveytime I had to write some new logic..the voice in my head says you dont have to..its not gonna add up to your skill set.
I dont have an option but meet my dead line.. (GRRRR).. Honestly its really depressing for a java pro(yeah tats me ;)) to work on something really boring as access db.
I dont know.. I always seem to get the patch up works in the proj..Not because I am free.. I hv tonns of coding to do in my other module.. still ppl are confident that I'll be able to do both. God gimme a break..
I am so totally tired today.. stretching myself to meet a requirement and the deadline..So I am screaming (inside) Is it weekend yet..? Pls say a prayer for me that I'll start liking what I am doing atleast until its rolled out on Apr. 4
btw totally un-realated, my hubby booked a bus trip for 2 to Washington DC, for sometime in late May. U know how much did it cost him..??? 50 cents.. yes 50 cents..!!!! hes such a good deal hunter..and we found it irresistible....so we are going..just for the heck of it :D Hope we'll hv fun.
PS: AFter reading the title of my post don't say SO..? like Cheney said to a reporter.. ;)
-Sunny
Thursday, March 20, 2008
Accessing Java code in JSP
Y'day I suddenly forgot (amnesia..??? naaa..:D).. and I was totally balnk abt some of the basic things we do every day.. like accessing java code in JSP.. so to persist.. I write it here in my blog. ;) I think I got so much carried away with the merger of Bear and the current market conditions.. so back to coding action.
but before we move on some smiles to persist from daily cartoons:Obama 1
{%
String showResetMsg = (String)request.getAttribute(Constants.SHOW_RESET_ACTION_MESSAGE_STD);
DetailsForm detailsForm = (DetailsForm)session.getAttribute("detailsForm");
String resetMsgInForm =detailsForm .getShowResetActionMsg();
if(null!=showResetMsg && showResetMsg.equals(Constants.YES))
{
detailsForm .setShowResetActionMsg("yes");
}
else
{
detailsForm .setShowResetActionMsg("no");
}
%}
Java Script Function executed on page load:
Lets say.. you are executing an action and if there is an exception, which you want to handle gracefully and show an alert message to the user. You can do so using a simple Java Script function. Which gets called always on page load. This fn, basically checks for the form variable and if its not null or empty always shows the alert msg.
{script='JavaScript'}
showErrMsgOnPgLoad(); //method is always called on page load. Carefully set and clear the form variable document.forms[0].errMsg.value
function showErrMsgOnPgLoad(){
var errmsg=document.forms[0].errMsg.value;
if(errmsg!=null && errmsg!=''){
alert(errmsg);
document.forms[0].errMsg.value='';
}
but before we move on some smiles to persist from daily cartoons:Obama 1
{%
String showResetMsg = (String)request.getAttribute(Constants.SHOW_RESET_ACTION_MESSAGE_STD);
DetailsForm detailsForm = (DetailsForm)session.getAttribute("detailsForm");
String resetMsgInForm =detailsForm .getShowResetActionMsg();
if(null!=showResetMsg && showResetMsg.equals(Constants.YES))
{
detailsForm .setShowResetActionMsg("yes");
}
else
{
detailsForm .setShowResetActionMsg("no");
}
%}
Java Script Function executed on page load:
Lets say.. you are executing an action and if there is an exception, which you want to handle gracefully and show an alert message to the user. You can do so using a simple Java Script function. Which gets called always on page load. This fn, basically checks for the form variable and if its not null or empty always shows the alert msg.
{script='JavaScript'}
showErrMsgOnPgLoad(); //method is always called on page load. Carefully set and clear the form variable document.forms[0].errMsg.value
function showErrMsgOnPgLoad(){
var errmsg=document.forms[0].errMsg.value;
if(errmsg!=null && errmsg!=''){
alert(errmsg);
document.forms[0].errMsg.value='';
}
Tuesday, March 18, 2008
Fall of Bear -- JP Morgan's Jaw Dropping Deal
On Sunday, Mar 16th JP Morgan acquired Bear Sterns, to save it from the brink of Bankruptcy. It was the deal so quick, it stunned Wall Street.
All the credit goes to our CEO, Jamie Dimon who emerged as the most powerful financier of our times.
Here is the exerpts of the artile in New York Times
High in a Park Avenue skyscraper (Building opp. to where I work..proud to be morganite.. :D), within a maze of soft rugs and wood-paneled walls, James Dimon sits just footsteps from the mahogany roll-top desk of J.Pierpont Morgan, the feared lord of the House of Morgan and the most powerful financier of his time.
Mr. Dimon’s race to cut a deal for Bear began around 6 p.m. last Thursday, when Alan D. Schwartz, Bear’s chief executive, called with startling news: Bear had been driven to the brink of bankruptcy by what amounted to a bank run.
Mr. Dimon quickly dispatched his investment banking co-heads, Steven D. Black and William Winters, to assemble a team for a possible takeover. By Friday, JPMorgan was plotting how to assess Bear, particularly the risky mortgage-related assets that had led to crippling losses.
“Jamie was driving the process. It was an extraordinary thing to watch,” said a senior executive involved in the deal.
By 8 a.m. Saturday, about 40 bankers were huddled in the boardroom of the eighth-floor executive suite at JPMorgan’s headquarters, which served as a makeshift war room. Under the command of Mr. Black and Mr. Winters, the group divided into teams, each charged with assessing an aspect of Bear, and began heading across the street to Bear’s headquarters to scour the books. More than 200 bankers ultimately joined in this task.
By Saturday evening, the JPMorgan bankers believed they were so close to a deal that they began drawing up a presentation to investors. The expected price per share was in the double digits, roughly half Bear Stearns’s closing price of $30 on Friday.
But the bankers could not agree on how to value Bear’s holdings of complex mortgage securities. Back on the eighth floor at JPMorgan, Mr. Dimon and his lieutenants paced from room to room, trying to keep up with the latest information.
With so much uncertainty hanging over Bear’s portfolio, the JPMorgan bankers decided to ask federal officials to explore ways to limit the bank’s risk. Among the options was having the Fed guarantee billions of dollars’ worth of Bear securities — an unprecedented step for the central bank.
On Sunday morning, JPMorgan threatened to walk away from the deal because executives felt they would be taking on too much risk. Mr. Dimon and his team wanted to give federal officials time to explore other options, according to a person close to the deal. “You have to have a margin for error so if you are wrong, you are not jeopardizing the company,” Mr. Dimon said.
A Bush administration official said the government was not concerned about the fate of a single bank but about the stability of the financial markets. Indeed, this official said, Bear Stearns was “anything but too big to fail.” But its failure would have had huge repercussions for the stability of the broader markets, and that was why the Fed acted with administration support.
Soon the bankers and policy makers were racing to strike a deal before markets in Asia opened for trading on Monday, fearing markets might plunge if Bear failed to find a buyer. But by 3 p.m., there was still no agreement, but they were heading toward a federal guarantee.
With hope that a deal would be reached, JPMorgan executives began briefing credit ratings companies and Mr. Dimon talked to his board. Just after 7 p.m., with less than an hour to go before Asian markets opened, the two sides reached an agreement.
Mr. Dimon was quick to dispense credit to his top bankers, as well as to Mr. Paulson and Mr. Geithner. “Same with the team at Bear Stearns,” he added. “God knows what pressure they had to be under.”
“This is the first time someone has stepped up and offered to solve a problem, even if it will cost Bear Stearns dearly. And making a few bucks on the leadership is in the Morgan tradition as well.”
Mr. Dimon, for his part, said on Monday that he was looking forward to getting some rest.
“There are two types of not getting sleep,” he said. “There is not getting sleep because there is a lot of work. The other is because you can’t sleep. I had a little of both.”
NY Times Article
Wall Street Journal
"Proud to be a Morganite"
All the credit goes to our CEO, Jamie Dimon who emerged as the most powerful financier of our times.
Here is the exerpts of the artile in New York Times
High in a Park Avenue skyscraper (Building opp. to where I work..proud to be morganite.. :D), within a maze of soft rugs and wood-paneled walls, James Dimon sits just footsteps from the mahogany roll-top desk of J.Pierpont Morgan, the feared lord of the House of Morgan and the most powerful financier of his time.
Mr. Dimon’s race to cut a deal for Bear began around 6 p.m. last Thursday, when Alan D. Schwartz, Bear’s chief executive, called with startling news: Bear had been driven to the brink of bankruptcy by what amounted to a bank run.
Mr. Dimon quickly dispatched his investment banking co-heads, Steven D. Black and William Winters, to assemble a team for a possible takeover. By Friday, JPMorgan was plotting how to assess Bear, particularly the risky mortgage-related assets that had led to crippling losses.
“Jamie was driving the process. It was an extraordinary thing to watch,” said a senior executive involved in the deal.
By 8 a.m. Saturday, about 40 bankers were huddled in the boardroom of the eighth-floor executive suite at JPMorgan’s headquarters, which served as a makeshift war room. Under the command of Mr. Black and Mr. Winters, the group divided into teams, each charged with assessing an aspect of Bear, and began heading across the street to Bear’s headquarters to scour the books. More than 200 bankers ultimately joined in this task.
By Saturday evening, the JPMorgan bankers believed they were so close to a deal that they began drawing up a presentation to investors. The expected price per share was in the double digits, roughly half Bear Stearns’s closing price of $30 on Friday.
But the bankers could not agree on how to value Bear’s holdings of complex mortgage securities. Back on the eighth floor at JPMorgan, Mr. Dimon and his lieutenants paced from room to room, trying to keep up with the latest information.
With so much uncertainty hanging over Bear’s portfolio, the JPMorgan bankers decided to ask federal officials to explore ways to limit the bank’s risk. Among the options was having the Fed guarantee billions of dollars’ worth of Bear securities — an unprecedented step for the central bank.
On Sunday morning, JPMorgan threatened to walk away from the deal because executives felt they would be taking on too much risk. Mr. Dimon and his team wanted to give federal officials time to explore other options, according to a person close to the deal. “You have to have a margin for error so if you are wrong, you are not jeopardizing the company,” Mr. Dimon said.
A Bush administration official said the government was not concerned about the fate of a single bank but about the stability of the financial markets. Indeed, this official said, Bear Stearns was “anything but too big to fail.” But its failure would have had huge repercussions for the stability of the broader markets, and that was why the Fed acted with administration support.
Soon the bankers and policy makers were racing to strike a deal before markets in Asia opened for trading on Monday, fearing markets might plunge if Bear failed to find a buyer. But by 3 p.m., there was still no agreement, but they were heading toward a federal guarantee.
With hope that a deal would be reached, JPMorgan executives began briefing credit ratings companies and Mr. Dimon talked to his board. Just after 7 p.m., with less than an hour to go before Asian markets opened, the two sides reached an agreement.
Mr. Dimon was quick to dispense credit to his top bankers, as well as to Mr. Paulson and Mr. Geithner. “Same with the team at Bear Stearns,” he added. “God knows what pressure they had to be under.”
“This is the first time someone has stepped up and offered to solve a problem, even if it will cost Bear Stearns dearly. And making a few bucks on the leadership is in the Morgan tradition as well.”
Mr. Dimon, for his part, said on Monday that he was looking forward to getting some rest.
“There are two types of not getting sleep,” he said. “There is not getting sleep because there is a lot of work. The other is because you can’t sleep. I had a little of both.”
NY Times Article
Wall Street Journal
"Proud to be a Morganite"
Thursday, March 13, 2008
Spring AOP Simplified
Spring AOP (Aspect Oriented Programming) Simplified:
Here is my exploration os spring aop. An interceptor which logs the method name
and the time taken for each method being invoked in the path of executing a request.
Back to Basics:
What is AOP:
AOP is a philosophy that is related to style of programming.
It addresses issues that can be solved in other approaches, but in a more elegant way.
To understand the spirit of AOP, you must understand the following issues
1) Things like logging, When you enter and exit methods and time take to execute are common across
the application (Caution: logging to debug ur app is different). It need not necessarily interfere with ur code.
2) Transaction management
3) Entitlements etc
Here is an example of how to implement AOP in spring
Lets try to see when user performs any action, see if session is active and throw
and error if its not.
public class SessionInterceptor implements MethodInterceptor {
public Object invoke(MethodInvocation methodInvocation) throws Throwable {
System.out.println("Suneetha in Sarc session Interceptor");
logger.info("calling... >>" + methodInvocation.getThis() + ">> "+ methodInvocation.getMethod().getName());
System.out.println("calling... >>" + methodInvocation.getThis() + ">> "+ methodInvocation.getMethod().getName());
HttpSession session = request.getSession(false);
if (session != null) {
System.out.println("Session is healthy");
}else{
System.out.println("Session expired");
throw new SessionTimeoutException("session expired");
}
//Make sure you always have these lines of code
try {
Object retVal = methodInvocation.proceed();
return retVal;
} catch (Exception e) {
logger.error(Constants.EVENT_TYPE_DIAGNOSIS + " "
+ Constants.BUSINESS_PROCESS_NAME + " "
+ this.getClass().getName() + " ", e);
throw e;
}
}
}
So now the wiring:
In your application context.xml you shud define the above bean and
also wire the aspect to it.
As always define the bean:
bean id="sessionInterceptor" class="com.jpmchase.srgtarc.interceptor.SessionInterceptor"
property name="sarcUserService"
ref bean="sarcUserService"/
/property
/bean
Now define the Aspect bean
bean name="logAutoProxy" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"
property name="beanNames"
value /actions/smarc*,/actions/sMArc*,/actions/saMArc* /value
/property
property name="interceptorNames"
list
value sessionInterceptor /value
/list
/property
/bean
So the above aspect will be executed for all kinds of actions starting with
smarc or sMArc or saMArc etc
Other Killer AOP examples:
AOP thoroughly explained
spring wiki doc. Simple but profound
yes Knowledge is Power
Here is my exploration os spring aop. An interceptor which logs the method name
and the time taken for each method being invoked in the path of executing a request.
Back to Basics:
What is AOP:
AOP is a philosophy that is related to style of programming.
It addresses issues that can be solved in other approaches, but in a more elegant way.
To understand the spirit of AOP, you must understand the following issues
1) Things like logging, When you enter and exit methods and time take to execute are common across
the application (Caution: logging to debug ur app is different). It need not necessarily interfere with ur code.
2) Transaction management
3) Entitlements etc
Here is an example of how to implement AOP in spring
Lets try to see when user performs any action, see if session is active and throw
and error if its not.
public class SessionInterceptor implements MethodInterceptor {
public Object invoke(MethodInvocation methodInvocation) throws Throwable {
System.out.println("Suneetha in Sarc session Interceptor");
logger.info("calling... >>" + methodInvocation.getThis() + ">> "+ methodInvocation.getMethod().getName());
System.out.println("calling... >>" + methodInvocation.getThis() + ">> "+ methodInvocation.getMethod().getName());
HttpSession session = request.getSession(false);
if (session != null) {
System.out.println("Session is healthy");
}else{
System.out.println("Session expired");
throw new SessionTimeoutException("session expired");
}
//Make sure you always have these lines of code
try {
Object retVal = methodInvocation.proceed();
return retVal;
} catch (Exception e) {
logger.error(Constants.EVENT_TYPE_DIAGNOSIS + " "
+ Constants.BUSINESS_PROCESS_NAME + " "
+ this.getClass().getName() + " ", e);
throw e;
}
}
}
So now the wiring:
In your application context.xml you shud define the above bean and
also wire the aspect to it.
As always define the bean:
bean id="sessionInterceptor" class="com.jpmchase.srgtarc.interceptor.SessionInterceptor"
property name="sarcUserService"
ref bean="sarcUserService"/
/property
/bean
Now define the Aspect bean
bean name="logAutoProxy" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"
property name="beanNames"
value /actions/smarc*,/actions/sMArc*,/actions/saMArc* /value
/property
property name="interceptorNames"
list
value sessionInterceptor /value
/list
/property
/bean
So the above aspect will be executed for all kinds of actions starting with
smarc or sMArc or saMArc etc
Other Killer AOP examples:
AOP thoroughly explained
spring wiki doc. Simple but profound
yes Knowledge is Power
Monday, March 10, 2008
Wearable Motherboard or "Smart Shirt"
Here is my 100th post.. and I am proud to be writing about the Inidan Scientist Sundaresan Jayaraman. Inventor of the Smart Shirt. Here is the highlights of his interview.. in 2006.. though I am a little late.. I am glad I discovered it atleast now. :D. Thanks to Science Channel, program on it called "2057" enlightened me. ;)
The basic product is what we call the wearable motherboard popularly known as the smart shirt. It started back in the Spring of 1996, and the U.S. Department of Defense, they put out what is called a broad agency announcement saying that they wanted a system for use by soldiers in battle that would do two things. One, be able to tell when a soldier has been hurt, and simultaneously to be able to say how badly he was wounded. So, I submitted a white paper conceptualizing the design of the system itself, and then sent the white paper to DARPA, the U.S. Navy, and they approved the white paper and they gave me the funding to start the research, which we did in October of '96, myself and two of my research associates.
One, we achieved the goal that the Department of Defense set out in terms of having a system to help soldiers in battle, so that when they put the shirt on it will identify where the soldier has been shot, simultaneously give vital signs, such as heart rate, body temperature, respiration rate, electrocardiogram, and the person could also talk into the shirt. So, in other words, the shirt had the capability of doing all these things, and most importantly, in the design of the technology, we focused on not just a functionality offered, but also the form, okay? So that, at the end of the design process, when the product is developed, we wanted a piece of technology that would not only serve its functional purpose, but it would be easy to use, okay? read more here
-Thanks for Reading.
The basic product is what we call the wearable motherboard popularly known as the smart shirt. It started back in the Spring of 1996, and the U.S. Department of Defense, they put out what is called a broad agency announcement saying that they wanted a system for use by soldiers in battle that would do two things. One, be able to tell when a soldier has been hurt, and simultaneously to be able to say how badly he was wounded. So, I submitted a white paper conceptualizing the design of the system itself, and then sent the white paper to DARPA, the U.S. Navy, and they approved the white paper and they gave me the funding to start the research, which we did in October of '96, myself and two of my research associates.
One, we achieved the goal that the Department of Defense set out in terms of having a system to help soldiers in battle, so that when they put the shirt on it will identify where the soldier has been shot, simultaneously give vital signs, such as heart rate, body temperature, respiration rate, electrocardiogram, and the person could also talk into the shirt. So, in other words, the shirt had the capability of doing all these things, and most importantly, in the design of the technology, we focused on not just a functionality offered, but also the form, okay? So that, at the end of the design process, when the product is developed, we wanted a piece of technology that would not only serve its functional purpose, but it would be easy to use, okay? read more here
-Thanks for Reading.
Friday, March 7, 2008
Why are Indian Railways so profitable..?
Ever wondered how Indian railways turned so profitable..? is the magic of Lalu.. or is it a myth..? Whats the root ... they predicted bankruptcy for IR in just 2001..? how did it turnaround..? curious to know why..???....here is what I found. Fascinating analysis of an IIM-A grad.
here
-Happy Reading.
here
-Happy Reading.
Subscribe to:
Posts (Atom)