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);
}
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");
}
}
}
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.
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.....
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