Posts

Java: establishing socket connection pool -

I have a client-server application using Java sockets. So far, it works in the following way: Customer opens a socket connection on the server. The socket handler thread of the server puts a new socket on a LinkedBlockingQueue. A worker takes a socket from the thread queue and reads an object from the stream (the client sends the object on the server) and writes back an answer to the client and closes the socket. But now I want to create a connection pool so that the connections can be kept open but I still want LinkedBlockingQueud. My idea is that each new connection is placed in a queue, call it openSocketQueue, and then sockethandler thread (or some other thread) runs on open sourceQueE and checks whether New data is available (without reading data). If the data is available, then it removes the socket from the queue and puts it on the linking block. The socket is not closed after the worker has finished but put it back on the open source code. Is it fair? How does a soc...

java - Open link in a new window using MenuBar.Command -

Text after " I have a menu bar in my VAADIN application, in this menubar I have a link for my wiki: wiki = new link (); Wiki.setCaption ("wiki"); Wiki.setStyleName ("mypicto"); Wiki.setImmediate (true); Wiki.setSizeUndefined (); Wiki.setIcon (iconWiki); with command :. MenuBar.Command wikiLink = new MenuBar.Command () {public void menuSelected (MenuItem SelectedItem) {getUI () getPage () .Open ( "url_to_wiki", "_ blank"); }}; Then I add links and commands to my menu menu bar = new menubar (); MenuBar.addItem ("wiki", iconic, wiki link); The problem is, I can not open the link in a new tab, it is only open in a pop-up, which is blocked by default in almost all web browsers. > Is there any way to open my link in other links rather than pop-ups in my menubar? itemprop = "text"> I think this might be what you want ... this addon me Allows to open a page in a new tab. I tested it out using V...

javascript - AngularJS - select with track by doesn't set list object in ng-model -

मेरे पास एक चयन है: & lt; नाम चुनें = "data_source" वर्ग = "फॉर्म-कंट्रोल" एनजी-मॉडल = "डेटाडेटा एसोसोर्स" एनजी-ऑप्शंस = "सी.आई.डी. के द्वारा ट्रैक किए गए डेटा_सॉर्स के लिए सी.नाम" & gt; & lt; / select & gt; मेरे data_sources सरणी में डेटा_सॉर ऑब्जेक्ट {id: "myid", नाम: "mydatasourcename", ...} init data.data_source में एक ऑब्जेक्ट शामिल है जिसे मैं डीबी {id: "myid"} से प्राप्त करता हूं सही मान को चुनने में प्रदर्शित किया जाता है लेकिन मेरे एनजी-मॉडल में मेरे पास केवल 'आईडी' विशेषता के साथ मेरे मूल डेटा_सोर्स ऑब्जेक्ट हैं I मैं यहाँ क्या होता है वह ऑब्जेक्ट है जो डेटा के सभी स्रोतों (नाम और अन्य) के साथ array_sources array से आ रहा है। क्या ऐसा करने का एक तरीका है? हालांकि ड्रॉप-डाउन अपने एनजी मॉडल को स्वचालित रूप से बदलने पर सभी गुणों के साथ अद्यतन किया जा Init पर आप अपने data_source को नीचे तरीके से अद्यतन कर सकते हैं data.data_source = dataFor data_sources = da...

java - Set bit values in Byte -

I need to set bits for some Bluetooth features listed under Java: HeaderValue: BluetoothFeature, Tag ID: 0x10, length: 4 bytes, Possible values: bit 0 = A, bit1 = b, bit2 = c, bit3 = d, bit4 = e .... so many bits 31. 1 to set the seventh bit: B = (byte) (b | (1 ; 6)); To set the sixth bit to zero: b = (byte) (b & amp; nbsp; (1 & lt; (The bit position is 0-based, effectively, so the map "seventh bit" 1 = Source:

c# - How to implement a ServerCertificateValidationCallback in ASP.NET MVC? -

I would like to add client authentication through X509 certificates, so I have my server IIS SSL and client certificates I want to set up with the requirement. . (As told here :) But once the client selects the credentials, the answer to the server is always an HTTP 403. Therefore, to optimize the validity of the client certificate, I Global.asax: Protected Zero application_Start () {........ ServicePoint Manager. Server Certification Validity Callback + = New Remote Certificate Certification Callback (Valid Certification Certificate); Private static bool valid server certificate (Object Sender, X509 Certificate Certificate, X509 Chen Chain, SSL Policy Errors SSL Policy Errors) {// ... Check Returns Correct; }} But apparently my function is never called and server response is still 403 denied with permission (certificate unsafe justice). Do you have any suggestions?

sql - how to pass another database in stored procedure as a parameter in java -

I want to pass the stored procedure in Java to another database like call Sel_RptDaywiseProduction (?) How to make DIERP database in this SP Pass in Callable Statement Thank you in Java. Edit: code from the comment callable location cs = con.prepareCall ("call {Sel_RptDaywiseProduction (?)}"); Cs.setString (1, "DIERP"); Results set rs1 = cs.executeQuery (); While (rs1.next ()) {System.out.println ("mat_code ="); }

javascript - Row click event within jquery click function is not working only for last row -

I am creating a dynamic table in the form shown below. I need user clickable rows To another page It works just fine till the last but one line. Clickable row functionality does not exist in the last line. $ (window) .load (Function () {$ .get ("http: // localhost: 8080 / music player / getsloglist", function (data) {console.log (data) ; Var library = data; var table = $ ("# table"); Var line; library. Songs.for every (work (song) {line = $ ("& lt; tr & gt; & lt; / tr & Gt; "); $ (" & lt; td />").addClass("Song-select ") .append ($ (" & lt; input />").attr({type:"checkbox " , Class: "checkbox" | value: song.title})). AppendTo (row); $ ("& lt; Td" "+ song.title +" & lt; / td & gt; "). Attachments (Line); $ ("& lt; td>" + song.album.albumName + "& lt; / td & gt;"). Attachment (line); $ ("& lt;...