Tuesday, 8 April 2014

Can't get jquey ajax to work on a empty attempted EVERY post and still nothing

this is a formula that isnt operative $( window
).bind("beforeunload",function () { $.ajax({
type: 'POST', async: false, url: "dir",
data: {REMID: ""} }).done(function(msg){alert(msg)});
$.ajax({ type: 'POST', async:
false, url: "dir", data: {REMID: ""}
}); });the "done" duty on a finish of a initial ajax doesnt
arrangement adult and im not certain where the going wrong

Friday, 4 April 2014

Cannot insert information into a list in db controlling jdbc

I have a problem to insert a new quarrel of information into a list we
combined around JDBC. It throws SQLException after a ExecuteUpdate()
line.Below we yield a formula that combined a DB and a Table in this DB.
The second partial has a formula that is ostensible to insert values into
quarrel in a PatientsData table.public category DbSetUp {private
stationary Connection con;private stationary String mySqlString = "CREATE
TABLE PatientsData" + "(id INTEGER PRIMARY KEY," + "fname
VARCHAR(30) NOT NULL," + "lname VARCHAR(30) NOT NULL," +
"sex VARCHAR(1) NOT NULL," + "insurance VARCHAR(1) NOT NULL," +
"profession VARCHAR(30) NOT NULL)";//private boolean end;private
stationary String strTemp = "CREATE TABLE PatientsTemp" + "(id
INTEGER PRIMARY KEY," + "name VARCHAR(256) NOT NULL," +
"date DATE NOT NULL," + "temp NUMERIC NOT NULL)";public stationary
vacant main(String[] args) { try {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); } locate
(ClassNotFoundException e) { System.out.println("Driver not
found"); e.printStackTrace(); } try { rapist =
DriverManager.getConnection("jdbc:derby:PatientDb;create=true"); }
locate (SQLException e) { System.out.println("Db not found");
e.printStackTrace(); } Statement matter = null; try{
matter = con.createStatement(); statement.execute(mySqlString);
statement.execute(strTemp); } catch(SQLException ex){
ex.printStackTrace(); }}The above formula works glorious throwing no
exceptions. we assume that both tables have been combined and a DB
exists:)Not a partial that is ostensible to insert data:public Patient
createNewPatient(int id, String fname, String lname, String sex,
String insurance, String profession) { try {
DriverManager.registerDriver(new org.apache.derby.jdbc.EmbeddedDriver());
} locate (SQLException e1) { System.out.println("to na
poczatku"); e1.printStackTrace(); } try{ rapist =
DriverManager.getConnection("jdbc:derby:PatientDb");
PreparedStatement ps = con.prepareStatement("INSERT INTO PatientsData
VALUES(?,?,?,?,?,?)"); System.out.println("Prepared Statement");
ps.setInt(1, id); System.out.println("set int id");
ps.setString(2, fname); ps.setString(3,lname);
ps.setString(4,sex); ps.setString(5, insurance);
ps.setString(6,profession); System.out.println("set twine
profession"); outcome = ps.executeUpdate();
System.out.println(result); relapse new
Patient(id,fname,lname,sex,insurance,profession);
//System.out.println("set twine profession"); } catch(SQLException e){
System.out.println("SQL exception"); relapse null; }}The
line: outcome = ps.executeUpdate(); throws SQLException, we have no
thought where is a mistake. we have total derby.jar into my build path.

Tuesday, 1 April 2014

event callback does not get executed in tradition gtk3 widget

Currently perplexing to emanate a tradition widget that is formed directly
on GtkWidget, outlines it as drawable and draws calm with cairo. So many
for a context.As shortly as we try to hoop events (so we can exercise
zoom) - generally a confine eventuality - only does not work and we am not
certain as of why.The callback does get executed on focus-in/focus out
(good aged imitation matter proves that), though we do never ever get any
confine circle activity detected by that callback (button clicks are
pivotal press/release do not work either).I attempted to offshoot adult to
a eventuality fasten byusing a duty pointer and assigning callback duty
(which we cruise is a right thing to do)using g_signal_connect (mywidget,
"event",..) from foo_new or foo_initNeither did work.The Foo init:foo_init
(Foo *self){ GtkWidget *widget = GTK_WIDGET (self);
gtk_widget_set_has_window (widget, FALSE); self->priv = FOO_GET_PRIVATE
(self); gtk_widget_add_events (widget, GDK_ALL_EVENTS_MASK);
g_assert ((gtk_widget_get_events (widget) & GDK_SCROLL_MASK) != 0); //just
glorious /* total some things we also attempted though did not work */
gtk_widget_set_sensitive (widget, TRUE); gtk_widget_set_can_focus
(widget, TRUE); gtk_widget_grab_focus (widget); ...How can we get
all a events of my widget?Assigning widget_class->key_press_event =
my_handler_callback; indeed works as approaching and we get a keys we
press, though a unequivocally same widget_class->button_press_event =
my_handler_callback; or widget_class->scroll_event = my_handler_callback;
assignments do not work!widget_class->key_press_event =
my_handler_callback; // workswidget_class->key_release_event =
my_handler_callback; // workswidget_class->button_press_event =
my_handler_callback; // NOTwidget_class->button_release_event =
my_handler_callback; // NOTwidget_class->scroll_event =
my_handler_callback; // NOTThis finished me suspicious. To accept this
signal, a GdkWindow compared to a widget needs to assent a
GDK_BUTTON_PRESS_MASK mask.Is it required to comprehend a widget before
gtk_widget_add_events "works"...?Update: Tried to call
gtk_widget_add_events after gtk_widget_show_all. No change.Update:
example#ifndef __FOO_H__#define __FOO_H__#include G_BEGIN_DECLS#define
FOO_TYPE (foo_get_type ())#define FOO(obj)
(G_TYPE_CHECK_INSTANCE_CAST ((obj), FOO_TYPE, Foo))#define FOO_CONST(obj)
(G_TYPE_CHECK_INSTANCE_CAST ((obj), FOO_TYPE, Foo const))#define
FOO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOO_TYPE,
FooClass))#define FOO_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
FOO_TYPE))#define FOO_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),
FOO_TYPE))#define FOO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),
FOO_TYPE, FooClass))typedef struct _Foo Foo;typedef struct
_FooClass FooClass;typedef struct _FooPrivate FooPrivate;struct _Foo{
GObject parent; FooPrivate *priv;};struct _FooClass{ GObjectClass
parent_class;};GType foo_get_type (void) G_GNUC_CONST;Foo *foo_new
(void);G_END_DECLS