Calling PL/SQL procedures via JAVA  

Posted by Sourabh in ,

try {

con = DriverManager.getConnection("jdbc:odbc:dsn", "system", "hr");

cs=con.prepareCall("{call newteacherid(?,?,?)}");

cs.setString(1,teacherid.getText());
cs.setString(2,teacherid.getText());
cs.setInt(3,1);

cs.execute();
System.out.println("dfasfgasrg");
}
catch (SQLException ex) {
JOptionPane.showMessageDialog(null,"Invalid teacher ID","Error",JOptionPane.ERROR_MESSAGE );
Logger.getLogger(Administrator.class.getName()).log(Level.SEVERE, null, ex);
}

Full Screen Code in JAVA  

Posted by Sourabh in ,

import java.awt.*;

class ScreenRes {
public static void main(String args[]) {
new ScreenRes().doit();
}

public void doit() {
Frame frame = new Frame();
GraphicsDevice device;
device =
GraphicsEnvironment.
getLocalGraphicsEnvironment().
getDefaultScreenDevice();
if ( device.isFullScreenSupported() ) {
device.setFullScreenWindow(frame);
if (device.isDisplayChangeSupported()) {
device.setDisplayMode(
new DisplayMode( 0,0,
8, // bitDepth - 8 bits 256 colors
DisplayMode.REFRESH_RATE_UNKNOWN ));

}
else {
System.err.println("Change display mode not supported");
}
}
else {
System.err.println("Full screen not supported");
}
}
}

My Hederabad Interbship Summer 2008  

Posted by Unknown

Picasa SlideshowPicasa Web AlbumsFullscreen

Sementica @ Pecfest 5  

Posted by Unknown in ,

As I said in one of the previous posts, Pecfest was not standardized. And this came out eminent this time. We came there for a programming contest after a standard prelim( Same old C++ trick questions, with some new lessons to learn, like printf("%%%%%"); a=(1,2,3,4,5); intellient use of i=050; j=0x50; with <<,>>,|,&, operators, recursive main and all). The expectations had risen for an intensive programming contest. We had been second in the prelims with a lots of mistakes, and a local 4th yr. team coming first, par again chalta hai. What came up is much different to expectations, not really bad but missed us a chance to have had another rivetting programming contest just the next day to the ICPC online.
Questions:
1. Syntax of printf: The return type was the trick.
2. Declare an array of pointers to function, that return a pointer to function returning a pointer to character.... Confused, that's ABC of code obfuscation. Mr. Vishnu, one of my seniors had taught this to us, though we had not taken it seriously as it seemed out of scope.
3. To find the sizeof() of int without the sizeof() operator: same old use of pointer++ or array elements, typecast to int and subtract.
4. We were to compart two function declarations, int func(int *arr[]); and int func(int *arr[3]);. we never expected a difference as nothing like this mattered in the protype and the pointer to be passed was to be the same type and rest depend on what we passed. I don't know ehether I was correct but what I tried and just said, seem to work.
5. Analog clock via Turbo C graphics--- who does it now- no one attempted this question, though the organizer was disappointed with that.
5. Given the width and length, egenrate a box of 0s and 1s and count maximum the number of 0s in the biggets rectangle you code make up- one proper coding question, but time had it on all teams as we managed the generator correct.


We ended up as the winners(I and Sourabh) just like th Google Doodle. Unlike google Doodle this efvent had a cash prize of Rs. 500, though that could just meet up our TA, food and all.

Google Doodle @ Pecfest 5  

Posted by Unknown in

I am writing about it for I won it. The event was not for techies, but I think sort of a time pass. We had 20-25 ques. and 10 minutes with google to answer them. Unluckily for the quizzers, this free certificate was not well publicized enough and so a clever web user could have come out better. Google operators were not useful, but one thing else was. The net was too slow to be true. So you need to get it through to the search in the first go. We had wikipedia open to save us a click. Efficient use of the History, and blocking of images really speeded up work and surprisingly, we don't have intelligent web surfers around. WEhy don't people understand how to use web when it is slow. Alas the event had no prize just one trophy for two of us and a certificate.

Pecfest 5  

Posted by Unknown in

We are a roaming group, just attended PecFest 5 yesterday. So here is how the events webt:
1. Organization: organizers were helpful(tech), but like the non tech ones, too few in number and in major non tech or mass events the mismanagement was visible- There seemed to be no distinction on the number of VIPs as the VIP passes seemed to be more with the students. Students were not stopped as they jumped over the barricade into the VIP region. But we shud say chalta hai. Techs we atleast well organized. Organizers were serious,knew what they were giving and we can say, good enough.Events were heavily delayed, and at many instances cut short..............-7/10.
2. Prizes: They seemed to be missing from the events. Most of them had just a trophy for the winners and the certificates, no cash or kind. The kind where present was of no use to the winners. Though we should appreciate timely distribution just after the completion of the contest. There was no mention of the prize amount in many of the posters and the website. The organizers were themselves not sure. They seemed to be doing a hard job working but wel, I think they had only that much in hand, chalo by the 5th attempt I think they realized that people cannot be attracted for thr contests in a palace like Chandigarh, so better use the nights.At least whatever they spoke by the end of it(just before the end) was given............3/10.
3. Publicity: Started late, website was good looking but the content seemed to be missing and really late to come up. People were unaware of what all is taking place. It seemed that even the organizers were not coordinated between the events. No one knew of the other people's events. Difficulty to manage the schedule was emminent even through the event. Maybe all the cared was about the nights or the administration was not supportive enough, but still the hands on publicity and the on spot one could have been managed........--3/10
4. Hospitality: The hospitality was arranged nice enough. The place did not fall short of accomodation. The organizers were helpful enough and attended phone calls as everywhere................9/10.
5. Events: As I said the events on focus seemed to be non technical and so for no prize don't expect too much quality----average i could say. The organizers were enthusiastic and helpful but maybe they don't expect technical people coming ad that was seeming emminent somewhere. Non standardization in th eevents, rules being made as we went through it, and so on marked some of them. Others where there were prizes were good enough. Atleast they had some sort of pre-planning..............6/10.



Finally I shud say that if you want a time pass or are looking for some easy events amidst so much around that that can be more interesting, it'll come out well. But if you are techie and want good event and heavy prizes, stay away.....

Wasim Mujahideen Poster  

Posted by Unknown in

I made another poster, a simple one for Wasim Mujahideen, a movie by my friends, where I helped in a little bit of formatting.
Technicalities:

  1. A background,
  2. some text.
  3. A snapshot.
  4. use magnetic lasso + eraser tool for cutting.
  5. That is it

ShauryaGaata 08 poster  

Posted by Unknown in ,

Getting poster made becomes all that easy. Just take a abstract wallpaper, superimpose images and write text you are done.For the techies:

  1. Took an abstract background.
  2. Pasted images
  3. Used eraser tool with soft bush to merge corners.
  4. typed text.
  5. Applied blending options for the text looks.
  6. And u are done.

C++ int to string  

Posted by Unknown in

I took this from: http://notfaq.wordpress.com/2006/08/30/c-convert-int-to-string/.
But this a great method to convert anything to string:
int i = 5;
std::string s;
std::stringstream out;
out << s =" out.str();" style="font-weight: bold;">

do not forget to include sstream