Posts

Showing posts from April, 2015

javascript - How do I delete local row data and maintain pagination with jqGrid? -

i have multi-page table using jqgrid. use $obj.jqgrid('delrowdata',id) delete rows on first page (the function called every row selected). however, end result empty first page second in mind should become first page left untouched. there else need call consolidate pages in grid?

c - What does this program do? (Self calling main function + getchar) -

can me explain question past exam paper? when compile it, never satisfied input. also, reason self calling main function? what following program do? justify answer. #include <stdio.h> int main ( void ) { int c; if (( c = getchar() ) != eof) { main(); printf("%c", c); } return 0; } the program is satisfied, eof returned getchar() , achieved entering ctrl^z (windows console) or ctrl-d (linux). program continue recurse until happens (unless stack breaks). after getting eof drops out of recursion printing inputs in reverse order (including character representing eof ). note eof typed must first keystroke after enter key.

Python: Using the same function as both a generator and a regular function -

is possible use function both regular function (that stuff , returns) , generator function? suppose have following code: def __init__(self): self.make_generator = false def foo(self): gen = (x x in my_list) x in gen: # stuff if self.make_generator: yield # return raise stopiteration return the idea here if self.make_generator false, don't want foo yield; want not generator can call like: foo() and if wanted yield between iterations, i'd make generator so: def __init__(self): self.make_generator = true self.foo_gen = self.foo() def run(self): while true: self.foo_gen.next() but seems not possible. want keep code dry not sure how can control when foo generator , when executes regular function. thanks!

c# - Reload LongListSelector with updated data from local database - Windows Phone 8 -

i having issue longlistselector on windows phone 8 application. after selecting , editing record longlistselector , submitting changes local database, longlistselector doesn't show updated name,unless close , reopen application. data being updated, not showing. there way have list select while app still open? xaml list: <!--contentpanel - place additional content here--> <grid x:name="contentpanel" grid.row="1" margin="12,0,12,0"> <phone:longlistselector x:name="llsmodules" margin="0,0,-12,0" itemssource="{binding modules}" selectionchanged="llsmodules_selectionchanged"> <phone:longlistselector.itemtemplate> <datatemplate> <stackpanel margin="0,0,0,17"> <stackpanel orientation="

bitmap - Android: Generated QR code using Zxing has margins (is not fit to the area) -

Image
i'm using in app zxing library generating qr code. want generated qr code should fits width of screen (maybe small padding). if set width of screen width size of qr code smaller qr code. @ screenshot (it's 320x240 resolution). want qr code fit black area. why qr code in red small? how stretch black area? my code: display display = getwindowmanager().getdefaultdisplay(); point size = new point(); display.getsize(size); int width = size.x; bitmap bm = encodeasbitmap(mgeneratedurl, barcodeformat.qr_code, width, width); qrcodeimage.setimagebitmap(bm); generating qr code: private bitmap encodeasbitmap(string contents, barcodeformat format, int img_width, int img_height) throws writerexception { string contentstoencode = contents; if (contentstoencode == null) { return null; } map<encodehinttype, object> hints = null; string encoding = guessappropriateencoding(contentstoencode); if (encoding != null) { hints = new enum

excel - Maximum of Multiple Named Ranges -

i having lot of trouble one. want replicate value in vba: =max(max(named_range1),max(named_range2),max(named_range3)) i having impossible time trying done. if 3 ranges in same sheet then: sub maxmax() dim r range set r = union(range(named_range1), range(named_range2), range(named_range3)) msgbox application.worksheetfunction.max(r) end sub

store - Save increment in C -

i need little i'm writing c. so have this: int a; int 1 = 4; int 2 = 3; printf("if have done write '1', if have done write '2' "); scanf("%d" ,&a); if (a=1) { 1 = one+1; } else if (a=2) { 2 = two+1 } so thing want save increment next time open program, values of int 1 , 2 change based on last usage of program. how do ? use fopen/fread/fclose when start application (before write checks if file handle correctly created) use fopen/fwrite/fclose when exit application. how access file? basic functionalities, read this: http://www.thegeekstuff.com/2012/07/c-file-handling/

Java Swing Animation without Thread.sleep -

i'm making game want animate piece being dropped on board, cannot use thread.sleep() interrupt game. how can code below pauses amount of time between painting oval again bit further down. for(int counter = 0 ; counter < getmousex(); counter++) { g.filloval(x*70+10, y, 50, 50); //code wait 'x' seconds here } also, there way disable mouse clicks while process going on? one way use swing timer. set timer fire x timers per second, perform animation there. it might this: final timer t = new timer(10, new actionlistener(){ public void actionperformed(actionevent e){ //do updating of variables here repaint(); counter++; if(counter >= mousex){ t.stop(); } } }); t.start(); more info can found in timer tutorial here . might consider googling "java swing animation".

twitter bootstrap 3 - Bootstrap3 - ensuring data grouped correctly in responsive grid -

i trying achieve following layout in bootstrap 3, converting old table based layout bootstrap's responsive grid: label1a: value1a label2: value2 label1b: value1b label3: value3 label1c: value1c label4: value4 with 1a through c being related data needs grouped together, in case address data, e.g. address1: [data1] contact: joe bloggs town: [data2] position: developer etc. problem have @ smaller viewports want address data remain displayed in single section rather interspersed other data, i.e. address1: [data1] town: [data2] contact: joe bloggs position: developer but coming out address1: [data1] contact: joe bloggs town: [data2] position: developer this not surprising given code: <div class="row"> <label for="address" class="control-label col-sm-2">address:</label> <div class="

javascript - How can i get Nivo.slider controls to work properly? -

i moved website new web host , noticed nivo.slider nav's not working correctly. rather let user cycle through images in slider, sends user 1 of pages. happens in browsers other ie. not sure why doing below js code slider. , appreciated. code 60,000 characters long posts, have stuck in dropbox. link below. thank you! javascript: https://www.dropbox.com/s/jbpvihwi8fer4fs/jquery.nivo.slider.js?dl=0

mysql - I need to find results that occurred in the past week? -

this question has answer here: how find results occurred in past week? 3 answers i have attendance table punchin_date column. i'd see results of attendance punchin_date occurred in past week. any thoughts? tried doing date math, postgres wasn't happy attempt. my query: select * final_table punchin_date between current_date - 7 , current_date - 1 this possible duplicate of how find results occurred in past week? lots of answers there.

css - Using a Sass variable mapped to an hsl value doesn't work when trying to use it with hsla -

i have sass variable mapped hsl value. when try use hsla add little transparency, doesn't work. i'm doing this: $white:hsl(100, 100%, 100%); .thing{ color:hsla($white,.9); } using gulp-sass build css, error: "required parameter $lightness missing in call function hsla on line {line number} in {file's path}" if replace hsla rgba works fine and, yes, can that, i'd keep colors in hsl. there workaround or sass issue? it's not issue sass, functionality doesn't exist. if @ documentation , there 2 versions of rgba(), 1 accepts of parameters separately , 1 accepts color object. rgba($red, $green, $blue, $alpha) rgba($color, $alpha) if @ documentation hsla(), accepts values separately. hsla($hue, $saturation, $lightness, $alpha) to achieve goal, this: $white:hsl(100, 100%, 100%); .thing{ color: hsla(hue($white), saturation($white), lightness($white), .9); } or... if want pass color object, can create own function since can

java - Deleting Nodes found with XPath -

i'm trying remove entry (music track) xml document after has been selected , deleted jtable user. xml file looks , has multiple tags same name track identified tag integer in before track data: <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple computer//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>tracks</key> <dict> <key>203</key> <dict> <key>track id</key><integer>203</integer> <key>name</key><string>winter</string> <key>artist</key><string>daughter</string> <!-- etc --> <key>play count</key><integer>2</integer> <key>skip count</key><integer>1</integer> <

javascript - Bind ng-options value and label to ng-model -

i'm using ng-options generate select tag options locations. labels location names, , values location id (in database). i've bound value (location id) ng-model attribute, i'd bind label (location name) different ng-model attribute. (i need separate id field since posted server expects particular attribute.) what's best way in angular? my code: <div ng-app="app"><div ng-controller="edit"> <select ng-model="purchase.pickuplocationid" ng-options="loc.id loc.name loc in purchase.availablelocations"></select> <!-- model not yet bound: --> <p>you have selected {{ purchase.pickuplocationname }}</p> </div></div> var app = angular.module('app', []); app.controller('edit', ['$scope', function($scope) { $scope.purchase = { pickuplocationid: 30, availablelocations: [ {id: 20, name: "charleston, sc"}

how to retrieve parameter from jquery post -

i'm retrieving parameters url jquery. there may more 1 parameter retrieve. take parameters , feed them 1 one $.post procedure. how retrieve parameter inside post code? var spageurl = window.location.search.substring(1); var surlvariables = spageurl.split('&'); (var = 0; < surlvariables.length; i++) { $.post('php/get_victim.php', {name:surlvariables[i]}, function(output){ //i want "name" variable inside here }); } you can use closure , retain variable being looped over: for (var = 0; < surlvariables.length; i++) { (function(name) { $.post('php/get_victim.php', {name:name}, function(output) { //i want "name" variable inside here console.log(name); //name above }); })(surlvariables[i]) }

caching - https over http - Does it mean downloading more MBs? -

when page static image files downloaded via https/ssl protocol, browser caches them in encrypted form. when browser starts next session server, ssl encryption key changes , browser can no longer decrypt cached resource in next key. mean https , static resources downloaded either cdn or remote web server. particulary, cases when http-headers expires/cache-control have been set? the data in cache not encrypted, , can reused between sessions. see example http://blogs.msdn.com/b/ieinternals/archive/2010/04/21/internet-explorer-may-bypass-cache-for-cross-domain-https-content.aspx explicitly says closing browser , contacting same page again result in cache hits.

python - How to get a list of numbers as input and calculate the sum? -

mylist = int(raw_input('enter list: ')) total = 0 number in mylist: total += number print "the sum of numbers is:", total correct way of doing same is: separator = " " #define separator separating input integers. # 1,2,3,4 => separator = "," # 1, 2, 3, 4 => separator = ", " # 1 2 3 4 => separator = " " mylist = map(int, raw_input("enter list : ").split(separator)) print "the sum of numbers is: "+str(sum(mylist)) to find sum need convert space separated characters int individually done above using map function.

c++ - An algorithm for iterating over a rectangular area inside a 1 dimensional array (bitmapping) -

Image
this odd question had tough time writing title for. i'm working pixels (bitmaps, more specifically) , can't figure out (simple) maths pragmatically accessing each array cell. my canvas [n16 x 16] pixels, n 1 or greater. here's photo of basic n = 2 canvas: http://i.imgur.com/mabwqfj.png what want magical algorithm run 0 495 without touching lighter grey area go 16 512 (which cell 511, bad) without touching dark grey area. so, 0 15, skip 16 31 followed 32 47, etc. and n = 3: http://i.imgur.com/tqjmwl6.png in case 0-735 skipping lighter grey areas, 16-751 skipping areas on each side , 32-767 skipping darker grey areas. what tried: here's extract code, it's useful , shows tried already. it's part figures out value 'idxpos'. // let's length = 3 now. (int character = 0; character < length; ++character) { // in case you're wondering, grabs 16x16 characters ascii spritesheet charpos = (string[character] - '

How to get notepad++ editor and shell to work together in python? -

i'm learning python using book "learn python hard way", i'm stuck in beginning. how can windows shell , notepad++ work together? when run python on terminal, doesn't show file saved on notepad++ editor. as earlier user noted, notepad++ editor, run code shell. if want integrated solution, can use ide idle (which comes python) or eclipse pydev. if want use notepad++, first thing after opening shell connect working directory. i.e., if you're saving code in c:\temp , cd c:\temp . next, dir command , should see files. here, can execute scripts shell.

PHP: public static array with multiple keys -

at moment define public static variable below: public static $closed = array( 'nl' => 'gesloten', 'fr' => 'fermer', 'en' => 'closed', ); is there way put array formatted below in public static without nesting? $days['nl']['mon'] = 'monday'; $days['fr']['tue'] = 'tuesday'; $days['en']['wed'] = 'wednesday'; there many ways build arrays (like have done) information have presented above there isn't better or more compact way. from see, looks doing translations, highly recommend using gettext that. arrays add translations, arrays larger , larger , take more memory. a basic example of how gettext works following: echo __('monday'); anything passed __() function gets sent through gettext. earlier on in script tell gettext locale want use. end having locale files (.mo) easier handle.

How to choose a perfect color for a simple personal portfolio? -

i wanted make simple portfolio website. don't > understand color. color can used? tried make > black , white color combination don't understand others > color combination the colors on site's homepage can have profound impact on visitor, if know how use them. color combinations use design portfolio page depend on kind of industry working in? for instance, there reason why logos , sites of fast food makers (from macdonalds pizza-hut) have liberal usage of yellow , red colors. see, red , yellow being warm colors, have stimulating effect subconsciously. research has shown yellow known affect hunger/appetite. similarly, banks, insurance , legal services make use of white, blue , green colors. these cold colors , have exact opposite effect of calming down. so, keeping color psychology in mind, have choose primary color, secondary color contrast it, , accent color. keep in shoes of site's audience, , should have no problems selecting them!

javascript - Is there any way other than caching to avoid the second request of the app manifest? -

when taking page offline, browser (glossing on details) download page, manifest, , resources, , when done re-request manifest (step 24 here ), , if gets doesn't match first 1 got, caching fails. according spec, browser should schedule attempt after "short delay" (step 25). sadly, far can tell, neither chrome nor firefox last part; instead, fail cache (or update) page , don't retry it. so in order pages reliably cached/updated, need make sure second copy of manifest byte-for-byte copy of first 1 few moments before. if data page has kind of built-in version can use in manifest, great, if not seems options are: generate kind of synthetic version , remember on server can return same version 2 requests. allow browser cache manifest short time (say, 2 minutes) in normal cache; way, second request satisfied browser's normal cache, , byte-for-byte. of course, means can't update page within 2 minutes. i'm not seeing in spec, there way avoid second

c++ - WSDLPull using complex type inputs -

i'm trying call web service method using wsdlpull , pretty simple until 1 service method accepts parameter array of complextypes, in case takes 1 parameter unbounded number of types containing 2 members - array of name/value pairs. <s:complextype name="senddetails"> <s:sequence> <s:element minoccurs="0" maxoccurs="unbounded" name="detail" type="tns:detail"/> </s:sequence> </s:complextype> <s:complextype name="detail"> <s:sequence> <s:element minoccurs="0" maxoccurs="1" name="name" type="s:string"/> <s:element minoccurs="0" maxoccurs="1" name="value" type="s:string"/> </s:sequence> </s:complextype> and have no clue how go setting these parameters wsdlpull. does have example code or snippet me started before rewrite using different tool? it s

javascript - Too much duplication of code -

the problem encountering, have many duplicates. trying show 1/11 tables bottom clicked (list_row[1-11]), when show instance table 2, must hide other tables. i believe can shortened loop or else, because if have 100 tables must copy , paste, not smart. keep in mind code below showing table 1 table 3. how can prevent these duplicates? // hide tables default when page loads $('#table1').hide(); $('#table2').hide(); $('#table3').hide(); $('#table4').hide(); $('#table5').hide(); $('#table6').hide(); $('#table7').hide(); $('#table8').hide(); $('#table9').hide(); $('#table10').hide(); $('#table11').hide(); // show exhaust temperature diagram $('#list_row1').on('click',function(){ $('#table1').show(); $('#table2').hide(); $('#table3').hide(); $('#table4').hide();

c# - Using XPath to select attributes with wildcards -

i got html need parse, , i'm using c# , html agility pack library selection of nodes. html either: <input data-translate-atrr-placeholder="forgot_password.form.email"> or : <h1 data-translate="forgot_password.form.email"></h1> where data-translate-attr-**** new pattern of attributes need find i use : //[contains(@??,'data-translate-attr')] but unfortunately, search value inside attribute. how attribute itself, wildcard? update : @mathias muller htmlagilitypack.htmldocument htmldoc // old code (returns nodes) var nodes = htmldoc.documentnode.selectnodes("//@data-translate"); // these suggestions return no nodes using same data var nodes = htmldoc.documentnode.selectnodes("//@*[contains(name(),'data-translate')]"); var nodes = htmldoc.documentnode.selectnodes("//@*[starts-with(name(),'data-translate')]"); update 2 this appears html agility pack issue more

libGDX interfaces for native android code -

i use native android code in project of interface. androidlauncher: public int getnetworkstate() { int a; connectivitymanager connmanager = (connectivitymanager) getsystemservice(context.connectivity_service); networkinfo mwifi = connmanager.getnetworkinfo(connectivitymanager.type_wifi); if (mwifi.isconnected()) { a=1; } else { a=0; } return a; } core: public interface networkstate { public int getnetworkstate(); } how can exact integer value in core project? this solved doing following: put platform specific code in class implements interface , have game class accept interface parameter in constructor. so in core project , have game class; public class gameinstance extends game { private networkstate networkstate; public gameinstance(networkstate networkstate) { this.networkstate = networkstate; } // override methods go below ... } also, put networkstate interface in core:

r - Caret error using GBM, but not without caret -

i've been using gbm through caret without problems, when removing variables dataframe started fail. i've tried both github , cran versions of mentioned packages. this error: > fitrf = train(my_data[trainindex,vars_for_clust], clusterassignment[trainindex], method = "gbm", verbose=t) wrong; accuracy metric values missing: accuracy kappa min. : na min. : na 1st qu.: na 1st qu.: na median : na median : na mean :nan mean :nan 3rd qu.: na 3rd qu.: na max. : na max. : na na's :9 na's :9 error in train.default(my_data[trainindex, vars_for_clust], clusterassignment[trainindex], : stopping in addition: there 50 or more warnings (use warnings() see first 50) > warnings() warning messages: 1: in eval(expr, envir, enclos) : model fit failed resample01: shrinkage=0.1, interaction.depth=1, n.minobsinnode=10, n.trees=150 error in gbm.fit(x = structure(list(relatedness_cottle = c(0, 0,

ios - Match clicked TableView row (string) to find corresponding unique ID -

i stuck on how best find , pass id of clicked table view row. i'd know best practice might accomplish this. in iphone storyboard want create tableview . this tableview should populated json web server response. this json object contain around 10 items , name and address plus unique id. in tableview i'd have in each tableview row 1 name , address don't want have unique id displayed. now here comes my question : if don't have unique id displayed how find id again based on row has been clicked? there way of assigning hidden fields? i'd send unique id via post web server. the directions i've been investigating in far are... ...parse json object nsdictionary , match clicked tableview row id. ...put json object sqllite database , match clicked row against database id. ...don't of above , send string of name , address (instead of id) web server matching against database take place. what think best in terms of getting corresponding id

python - Get .pfx Cert File Expiration with pyOpenSSL -

i'm trying use pyopenssl check expiration of .pfx file client need use application. issue cert client, , expires every 2 years. know using openssl in command line works, converting .pem , running '-noout -enddate' on resulting .pem file. there chance client not have openssl installed, i'd use library if possible. how check .pfx expiration date? i've gotten cert loaded, have no idea how a) convert .pem file (if need to) , b) check expiration on .pem file (or encoded string). thanks! so far: import openssl openssl.crypto import * cert_path = 'c:\\clients\\omega\\bos.omegaadv.gtssloader.pfx' p12 = load_pkcs12(open(cert_path, 'rb').read(), 'globallink') x = p12.get_certificate() print(openssl.crypto.dump_certificate(filetype_pem, p12.get_certificate())) code here

c++ - How to create a compile time constant instance of a structure in C++11 -

in current project trying create compile time const static instance of structure c++11. code compiles , works fine in clang (apple llvm version 6.1.0) not work g++ (gcc) 4.8.3. gcc throws error parameter not declared 'constexpr'. there way make work in gcc? //parameter.h struct par { const int uniqid; const char *name; const char *description; constexpr par(int uid,const char * n,const char * d) :uniqid(uid), name(n),description(d){} }; class parameters { const static par param_a; ... const static par param_z; printparameters(std::vector<par> parameters); }; //parameter.cpp constexpr par parameters::param_a={0,"-a","bla a"}; ... constexpr par parameters::param_z={0,"-z","bla z"}; void parameters::printparameters(std::vector<par> parameters){ (size_t = 0; < parameters.size(); i++) { switch (parameters[i].uniqid) { case param_a.uniqid:

windows - SMTP localhost unable to send emails to local domain but send to external domains works? -

we have set smtp server using iis manager 6. website managed through iis7. send emails external email address, emails our own domain never leave queue! verified able perform nslookup of our own domain box, , can. has ever seen problem before? appreciated. just anyone's knowledge: ended being messed-up mx record set long time ago.

javascript - Gulp browser-sync only works once -

i'm trying out gulp on 1 of projects , wanted run used grunt watch. meaning, has watch less files , js files, lint, merge, compile , refresh browser once done. i managed make work gulp-browser-sync reason works once. change .less file , browser reloads. then, second change, compile no reload happens. here's log: [bs] serving files from: ./ [09:47:26] starting 'css-clean'... [09:47:26] finished 'css-clean' after 16 ms [09:47:26] starting 'styles'... [bs] 1 file changed (styles.min.css) [09:47:27] finished 'styles' after 624 ms [09:47:27] starting 'styles-watch'... [bs] reloading browsers... and when hit save second time: [09:47:31] starting 'css-clean'... [09:47:31] finished 'css-clean' after 3.39 ms [09:47:31] starting 'styles'... [bs] 1 file changed (styles.min.css) [09:47:32] finished 'styles' after 362 ms as js, works time. no issues whatsoever, after styles task done, js changes still tr

javascript - Content Experiment error - variation should be chosen before hit is sent to ga -

i'm trying set ga content experiment , see error in chrome console reads "variations should chosen before hit sent ga". error appears first time load page before cookies set. if clear cookies , reload, appears it doesn't seem cause problems curious means. posted in google forums no 1 has explained it. here have ideas? here's code <script src="http://www.google-analytics.com/cx/api.js?experiment=lyhtgjicstgh0peyfma30w"></script> <script> var chosenvariation = cxapi.choosevariation(); var pagevariations = [ function() { $("#pdp_promo2").append($("#taginebanner")); $('#taginebanner').show(); }, function() { $("#banner").attr('src', '/wcsstore/cvweb/images/home/bnr_tagineb.jpg') $("#pdp_promo2").append($("#taginebanner")); $('taginebanner').show(); } ]; $(document).ready( pagevariations[chose

c# - WCF REST Service with Windows Authentication and SSL -

i have wcf rest service being consumed android, ios , asp.net web application. endpoint methods return json format use webhttpbinding. problems started when secured service activating windows authentication(disabled anonymous before that). when try add service reference asp.net web application receive following error: the http request unauthorized client authentication scheme 'anonymous'. authentication header received server 'negotiate,ntlm'. remote server returned error: (401) unauthorized. when call endpoints in browser windows dialog being showed username , pass , works fine, when try add reference receive error. i'm using ssl , service has https address. web.config wcf rest service: <system.web> <compilation debug="true" targetframework="4.5" /> <httpruntime targetframework="4.5" executiontimeout="90" maxrequestlength="20000" usefullyqualifiedredirecturl="false" reques

git - Uncompressing zlib file in command line -

this question has answer here: deflate command line tool 16 answers when git stores snapshot of file, stores object called blob. this compressed using zlib..see http://nfarina.com/post/9868516270/git-is-simpler ; either blind or doesn't explain how file blob uncompressed in fist place (while else explained if noob) how extract , view contents of blob ? of results googling applied uncompressing within scripts/programs, not manual/cl: deflate command line tool , https://unix.stackexchange.com/q/22834 i looking single one-line command line way on single file. thanks in advance! (even if question sounds duplicate, barrage of answers in other link no way accurate 1 here. think thread should kept alive or answer posted there others non-convoluted way deflate) use git cat-file -p sha1 view file content of blob. the content of file this: blob xxx

SQL Adapter Invocation failure in IBM MobileFirst -

i'm trying insert data database using sql adapter in ibm mobilefirst platform, code reaches failure function... main.js: function insertdata(){ alert("function insertdata called"); var fname = document.forms["form1"]["fname"].value.tostring(); var lname = document.forms["form1"]["lname"].value.tostring(); var email = document.forms["form1"]["email"].value.tostring(); var pwd = document.forms["form1"]["pwd"].value.tostring(); // alert("fname"+fname); var invocationdata = { adapter: 'sqldemo', procedure: 'procedure4', parameters:[fname,lname,email,pwd] }; var options = { onsuccess : insertdatasuccess, onfailure : insertdatafailed, timeout : 30000 }; wl.client.invokeprocedure(invocationdata, options); } function insertdatasuccess(result){ alert("success"); wl.logger.debug("retrieve success"

java - IBM MQ publish/subscribe send message to one subscriber -

i want build publish/subscribe program compute matrix manipulation on cluster. when publisher send message topic, message copies subscribers. i want copy of message send 1 subscriber , message deletes , not send other subscribers. there 2 ways this. make administrative subscription , have subscribers read messages off queue subscription points. use mq v8.0, new jms 2.0 interface, , shared subscription feature. note in both of these cases, subscribers connected same queue manager. although pub/sub creates single logical message, when broadcast other queue managers becomes multiple physical messages , consumption subscribers not coordinated across network.

.net - C# OpenFileDialog for getting a user-selected output path for a Windows form? -

good morning, i'm trying figure out how use openfiledialog function in c# allow user select desired output folder. right have button , textbox on windows form. user hit button, , open dialog gui @ run-time allow user navigate the output location, hit ok. should have confirmation of selection having path displayed in textbox. the code have right follows: private void button1_click_3(object sender, eventargs e) { openfiledialog outputfilepath = new openfiledialog(); string outputstring = outputfilepath.filename; filepathbox.text = outputstring; } it compiles fine, when hit button, doesn't bring file dialog box. i'm sure it's simple i'm not seeing? thanks in advance! ~andrew you need show dialog , check dialogresult because user can click cancel openfiledialog outputfilepath = new openfiledialog(); var res = outputfilepath.showdialog(); if (res == dialogresult.ok) { string outputstring = outputfil

inconsistent variable values in C# multithreading -

this question has answer here: captured variable in loop in c# 6 answers i trying learn how use multithreading in c#. working this tutorial , explains using lambda expressions pass arguments. built toy program test this, confused output. here code: using system; using system.threading; namespace multithreadingapplication { class threadcreationprogram { public static void calltochildthread(int id) { console.writeline(string.format("child thread {0} starts", id)); } static void main(string[] args) { (int i=0; i<10; i++) { console.writeline(string.format("i: {0}", i)); thread childthread = new thread( () => calltochildthread (i) ); childthread.start(); } } } } and here output: i: 0 i: 1 child thread 1 starts i: 2 child th

java - Maven Jar file read external images -

hello changed javafx8 project maven works except loading files lying next jar. worked before not more. folder structure: icons load located in /target/icons jar file located in /target my code read files following: string applicationdir = (new file(".")).getabsolutepath(); string iconsdir = applicationdir+"/target/icons/"; file[] files = new file(iconsdir).listfiles(); (file file : files) { if (file.getname().endswith(".png")) { system.out.println(file.getabsolutepath()); image img = new image(file.getabsolutepath()); iconlibrary.put(file.getname().split("\\.")[0].touppercase(), img); } } it enters loop , findes files, crashes when new image(file.getabsolutepath()) called invalid url: invalid url or resource not found exception. i tried kind of stuff toexternalform() , on nothing helped, still exception no matter do. i lost , maybe can give me hint do

Excel, VBA and moving rows -

i rookie re: vba , macros (creating or running). need assistance code me copy row 1 spreadsheet another, leaving in original sheet , marking somehow (i think), or otherwise ensuring it's not copied again in future. found few posts moving rows, relied on date entry, not work purpose. sheet has column (h) drop down data validation - entry cell drop down identify row 1 copy next sheet. however, there column follows (j), data entry optional, , don't want row copied before giving user opportunity enter column, it's contents copy (or maybe that's set of separate code?). rows copied new spreadsheet should inserted next available row. thank assistance & instructions can offer. okay - info. have gathered posts, have following: sub copyrows() dim xrow integer, xcol integer, lastcol integer dim datavalidation range, rowtocopy integer, copyrange range, destrange range dim copywsrow integer, jcolvalue string dim origws worksheet, copyws worksheet set origws =

javascript - How to push values from a dropdown to an array and add the array to a table? -

this javascript. select has id of ' counties '. the table inserted div called ' up_bottom '. var leaguearray = []; function addteams() { var county=document.getelementbyid("counties"); var val = county.options[county.selectedindex].value; leaguearray.push(val); function display() { var table = document.createelement("table"); (var i=0; i<leaguearray.length; i++) { var row = table.insertrow(); (var j=0; j<leaguearray[i].length; j++) { var cell = row.insertcell(); cell.appendchild(document.createtextnode(leaguearray[i])); } } var tablediv = document.getelementbyid("up_bottom"); tablediv.appendchild(table); } display(); } please following steps get selected value dropdown put selected value array create string of tr element , append table before first tr element

jquery - Handling 500 Internal server error using Selenium2Library in Robot -

i using robot framework selenium2library automate web application , while executing smoke suite experienced frequent error says "error! requested url returned 500 - internal server error" when test script performing below actions: when script clicks links disableuser, reset password etc open confirmation dialog box. when script selects option drop down opens dialogbox when script clicks on exportlink open dialog box save file etc.. the script throws 'unexpectedalertpresentexception' these above scenarios when pop appears internal server error... when cross verified same scenario manually i.e. clicked on same link launch dialog box disable user account , got internal server error popup on top of disable user dialog box , when cicked ok on error popup, disable user dialog box still spinning , fields not displayed on dialog. i know if there way handle internal server alert popup , proceed further because rest of test cases fail because of not handling ale

security - How secure is PHP object serialization and is it safe to pass across pages? (Using phpXMLrpc) -

basically doing: im using phpxmlrpc communicate odoo. in essence communicate every request need send on needs follow structure: //the database wish connect $msg->addparam(new xmlrpcval($this->dbname, "string")); //the logged in user id $msg->addparam(new xmlrpcval($this->userid, "int")); //the logged in users password $msg->addparam(new xmlrpcval($this->password, "string")); //the model $msg->addparam(new xmlrpcval("project.project", "string")); //the method im requesting call $msg->addparam(new xmlrpcval("read", "string")); //query parameters $msg->addparam(new xmlrpcval($id_list, "array")); $msg->addparam(new xmlrpcval($field_list, "array")); now have written class in constructor sets instance variables of values passed constructor i.e class phpclient{ private $username; private $password; private $dbname; private $server_url; pr

css - need to change dropdown menu to full length -

i need dropdown run full length of menu, there easy way without restructuring menu? thanks. example - jsfiddle #menu { list-style:none; width:940px; margin:30px auto 0px auto; height:43px; padding:0px 20px 0px 20px; } #menu li { float:left; display:block; text-align:center; position:relative; padding: 4px 10px 4px 10px; margin-right:30px; margin-top:7px; border:none; } i'm not sure if it's "easy" method, i've modified jsfiddle purpose - no html mods needed. html: <ul id="menu"> <li><a href="#" class="drop">home</a><!-- begin home item --> <div class="dropdown_2columns"><!-- begin 2 columns container --> <div class="col_2"> <h2>welcome !</h2> </div> <div class="col_2"> <p&