Posts

java - Spring not giving current session without marking @Transactional -

java - Spring not giving current session without marking @Transactional - using spring sessionfactory injection. @suppresswarnings("unchecked") public void getdata() { system.out.println("%%%% hibernate fetching info %%%% "); session session = factory.getcurrentsession(); /* * seek { thread.sleep(10000); } grab (interruptedexception e) { // todo * auto-generated grab block e.printstacktrace(); } */ list<address> addresses = session.createquery("from address").list(); system.out.println("total connectins = " + factory.getstatistics().getconnectcount()); (address address : addresses) { system.out.println(address); } } above code giving exception org.hibernate.hibernateexception: no session found current thread but when method marked @transactional it's working fine. don't want transaction enabled...

ip - Why do we need IPSec VPN rather than SSL? -

ip - Why do we need IPSec VPN rather than SSL? - ipsec vpn security provided @ network layer next facilities: authentication info integrity confidentiality anti-replay but making set more costlier using ssl @ application layer . for example: http uses ssl talk web server so, why people utilize vpn? you pretty much gave reply yourself: encryption on network layer provides security all traffic goes through it, instead of each application having implement own security model. vpns used in different scenarios typical http request. typically utilize vpns bring together intranet outside , utilize network internal services. doing via vpn means need expose 1 network entry point outside world. otherwise you'd have expose every single service outside world, and implement individual security models each. ssl ip vpn

c - Strange CreateFile behaviour -

c - Strange CreateFile behaviour - strange createfile behaviour. tiring open file handle hfile = createfile(l"e:\\temp\\1.txt", generic_read, file_share_write, null, open_always, file_attribute_normal, null); if (hfile == invalid_handle_value) { printf("could not createfile\n"); return; } file opened no error (don't know target file).. reason in directory application running empty file "e"(wiout extention) created during createfile call. wrong here? get rid of l prefix of filename string. calling narrow version of createfile ( createfilea ) , passing in wide string. alternatively, can set vs build app using unicode. in either case, should utilize _t() macro set appropriate string type. i.e. handle hfile = createfile(_t("e:\\temp\\1.txt"), c winapi

Why do I see so much C code that omits a return type for main? Why does it work? -

Why do I see so much C code that omits a return type for main? Why does it work? - i went website compiles c online , saw main function declared without homecoming type. i'm aware of questions concerning topic here, didn't find omitting homecoming type. tried compile code using gcc , worked. does mean if don't set homecoming type on main , assume int (or other type)? the c89 standard, preserve compatibility original k&r version of c did not have function prototypes know them, allowed functions implicitly homecoming int . function declared without explicit homecoming type (i.e., void , float , etc.) assumed compiler homecoming int . thus, when main function declared without homecoming type, assumed homecoming type int . , good, since main supposed homecoming int , according standard. however, changed in c99. default/implicit int rule removed language specification. functions without explicit homecoming type no longer assumed homecoming...

java - Traverse JDateChooser with Enter Key -

java - Traverse JDateChooser with Enter Key - i input validation when come in key pressed in jdatechooser . know in jtextfield elements possible add together actionlistener whereby come in key fires action. however, when add together actionlistener , press come in in date chooser, action not received. in below example, pressing come in key when programme first starts fires action in jdatechooser , focus traverses next component expected. however, in subsequent traversals, have come in character before action fired. action fired in 2 jtextfield elements expected. can explain why come in key not behave same when adding actionlistener editor of jdatechooser ? import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.emptyborder; import com.toedter.calendar.jdatechooser; public class dateexample extends jframe implements actionlistener { private static final long serialversionuid = 1l; private jpanel contentpane; p...

ios 8 Photos framework - replace photos not working -

ios 8 Photos framework - replace photos not working - i'm playing around new ios 8 photos framework, trying edit existing photo in library replacing it's not replaced, if can see success log messages i've set. here's code : uiimage *output = [self.imageview.image appenddatewithlabel:label]; self.imageview.image = output; // self.info retrieve uiimagepickercontroller delegate method nsurl *asseturl = self.info[uiimagepickercontrollerreferenceurl]; phfetchresult *result = [phasset fetchassetswithalasseturls:@[asseturl] options:nil]; phasset *asset = result.firstobject; if ([asset canperformeditoperation:phasseteditoperationcontent]) { [asset requestcontenteditinginputwithoptions:nil completionhandler:^(phcontenteditinginput *contenteditinginput, nsdictionary *info) { phcontenteditingoutput *contenteditingoutput = [[phcontenteditingoutput alloc] initwithcontenteditinginput:contenteditinginput]; nsdata *outputdata = uiimagepngrepresentation(o...

php - html form-- need help having new input area populate if radio button is clicked -

php - html form-- need help having new input area populate if radio button is clicked - i making basic new client database mysql , php. when people click on radio button"different mailing address" couple of input fields appear mailing address. im not quite sure how handle inputs , not variables. there way if statement here html form code below <form method="post" action="insert.php"> <fieldset> <legend>new client data</legend> <label>complete below</label> <div class="controls controls-row"> <input class="span4" name="firstname" type="text" placeholder="first name"> <input class="span3" name="lastname" type="text" placeholder="last name"> <input class="span3" name="phone" type="text" placeholder="phone"> </div> <div class=...