Posts

Showing posts from March, 2015

java - CriteriaBuilder haven't got a method createCriteriaUpdate -

i need bulk update entities using jpa 2.1. here: http://wiki.eclipse.org/eclipselink/release/2.5/jpa21#update_example found example how it. if wrtite: criteriaupdate<orderrecordentity> orderrecordentity it's ok. when write: criteriabuilder.createcriteriaupdate(orderrecordentity.class); then see, criteriabuilder don't have method createcriteriaupdate. does know how resolve problem? you might have both jpa 2.0 , jpa 2.1 persistence jars on classpath. if 2.0 jar picked first on classpath, still see new jpa 2.1 criteriaupdate classes, have access 2.0 methods on classes exist in 2.0 persistence.jar.

scala - Error while accessing List[String] in play framework -

i trying access list[string] in controller write code: view is @(path:list[string]) ... <button type=submit id=imgbutton><a href="@routes.application.confirmdelete(path)">delete</a></button> my routes is /confirmdelete/:path controllers.application.confirmdelete(path:list[string]) my controller is: def confirmdelete(path:list[string])=action{ ok("deleted "+path); } but gives me error as no url path binder found type list[string]. try implement implicit pathbindable type. the error here absolute clear. play not have idea how serialize list[string] , uri. can implement implicit pathbindable conversion list[string] or submit list coma separated string , build list[string] on controllers side string parameter. documentation pathbindable - http://www.playframework.com/documentation/api/2.1.x/scala/index.html#play.api.mvc.pathbindable also may check here second solution - play fr...

How can I use priority queue in SWI-Prolog? -

i trying implement a* algorithm in swi-prolog. have graph each state consists of following values (cost_so_far,heuristic,"doesn't matter","doesn't matter","doesn't matter") , want insert state priority queue according heuristic integer. how can this? one easy way use key-value pair list, has form: [1-state(cost_so_far, ...), 2-state(...), 3-state(...)] your integer value heuristic key, functor state (of whatever arity need) value. note conventional way of keeping list of pairs. can use matching them out, example, state @ head of queue be: [heuristic-state(a, b, c)|queuerest] you should use built-in keysort/2 sorting (very efficiently) every time have added new states @ top of queue.

multithreading - C# serial For --> parallel For: results are jumbled -

this may basic question (and have admit, i'm not experienced parallel programming). i've written single threaded c# program during array p of parameters created, each parameter p[i] evaluated function f , , pair ( p[i], f( p[i] ) ) of each evaluation placed heap (which gets sorted function value). roughly, looks this: class agent { private double[] parameter; private double value; public agent( double[] par, double val ) { this.parameter = par; this.val = value; } } class work { public void optimise() { // return array of parameters, each 1 of double array double[][] parameter = getparameters(); agent[] results = new agent[ parameter.length ]; ( int idx = 0; idx < parameter.length; idx++ ) results[ idx ] = new agent( parameter[idx], cost_function( parameter[ idx ] ) ); } private double cost_function( double[] par ) { // evaluate par, result return result; } } since evaluation of cost_function rather length...

megamenu - Mega Menu Prestashop -

i've tried solution can't seem find anywhere. i'm looking stylise drop down sub > sub category. hierarchy - root > sub category > sub category > sub category at moment works until root > sub category > sub category beyond lists sub category under without recognising there's category head above it. many thanks! can because of this? private function getcmsmenuitems($parent, $depth = 1, $id_lang = false) { $id_lang = $id_lang ? (int)$id_lang : (int)context::getcontext()->language->id; if ($depth > 3) return; in file modules/blocktopmenu/blocktopmenu.php my 2 cents, pascal

Flex - Customize scrollbar used inside component with CSS -

what i'm trying customize of scrollbar when displayed inside particular component. don't want change of other scrollbars of application. i have panel, inside panel there's vbox , scrollbar appears inside vbox, , want stylize scrollbar using css. i tried adding in component (a test remove , down arrows of scroller): <fx:style> @namespace s "library://ns.adobe.com/flex/spark"; s|scroller { up-arrow-skin: classreference("undefined"); down-arrow-skin: classreference("undefined"); } </fx:style> the result warning says: css type selectors not supported in components: 'spark.components.scroller' i searched , found out should use class selectors instead of type selectors inside component, don't want create custom scrollbars (how should use that?). edit: i'm adding example of code test of css class selector: <fx:style> @namespace s "library://ns.adobe.com/flex/spar...

android - How to retrieve images from cache memory in picasso? -

i using picasso library loading images .in default picasso, uses internal cache memory loading images.but per app configuration ,i have use external cache memory(cache on disk). used code cache on disk file httpcachedir = new file(getapplicationcontext().getexternalcachedir(),"http"); long httpcachesize = 10 * 1024 * 1024; // 10 mib httpresponsecache.install(httpcachedir, httpcachesize);} picasso flexible. caches images in external sd card.. the caches stored in sdcard/android/data/packagename/cache/http caches stored in ".1" ,".0". formats opened them , changes ".1" ".jpg".it gives exact images need. how in programatically? picasso caches memory in app loading image imageview.but have save them sdcard directly images/set bitmap wallpaper in offline mode? you can supply own cache implementation when building picasso instance. way can provide methods can call retrieve...

java - How do native methods on Android interact with the power management lifecycle? -

will android potentially enter deep sleep (cpu sleeping) while native method running? if so, can native method acquire wake lock using c calls? will phone wake automatically when there data available native method blocking on socket read? will phone wake automatically when there data available native method blocking on select or epoll? if android not consider sleeping during native method invocation, how can ensure phone can go sleep until 1 of sockets created in native code has data ready receive? some background: the android site's jni tips suggests "android not suspend threads executing native code. if garbage collection in progress, or debugger has issued suspend request, android pause thread next time makes jni call." - appears reference suspension of individual threads rather putting phone suspend/sleep mode. other that, couldn't find specific comments suspend/sleep behavior. to find more information android powermanagement natively ...

algorithm - Which audio codec G.722 or G.726 offer improved stability and lower delays? -

i have choose between g.722 , g.726 audio codecs. assume, that: purpose use audio codec voip on sip calls and not consider bandwidth of internet connection (it's high) i need high audio quality , lower delays , higher stability . which 1 of them provides better? according wikipedia : audio quality: 722 : 16 khz, 64 kb/s, 14 bits/sample 726 : 8 khz, <=40 kb/s, 13 bits/sample latency: 722 : 4000 us 726 : 125 us so depends on want more. 722 has better quality, @ higher latency. latency isn't bad, though, compared other formats. note 722 uses sub-band encoding, handy voip application. if you're encoding yourself, can tweak typical "voice" band use more bits others, , possibly reduce file size. i'm not entirely sure mean "stability". voip i'd use low-bandwidth codec provide stability, state that's not issue.

c - what value will be passed when i press the key a -

when press ctrl+c sigint passed signal() . value pass system call signal() when press key ? no signal raised. the purpose of signals inform special condition outside normal program flow. processing input, letter a, part of normal program flow. these 2 separate, , have different goals. if you're on unix, type man signal on console.

search - Google Shopping API - Replacements? -

i have app uses google shopping api unfortunately being pulled shortly. i having real difficulties finding replacement give me varied product search results image, price , supplier. have explored semantics3 seems relatively alternative doesn't produce many uk results. ideally looking produce both uk & results.. i interested in alternatives others looking at...? thanks :-) in our app, use 3 search engines: google shopping api, google custom search api, , shopping.com search api (owned ebay). i'm in wait-and-see if google terminate shopping api on 16 sep; not. you can try shopping.com api, both , uk markets . api using xml. http://developer.shopping.com/docs/read/api_use_cases#22

How Would I Add A Second Google Map Marker Using This Script? -

this code below. can't figure out how add second marker, i've been toying awhile i'm terrible javascript , can't figure out! $(document).ready(function() { initializegooglemap(); }); // call function when page has been loaded function initializegooglemap() { var mylatlng = new google.maps.latlng(45.93986,-85.65181); var myoptions = { zoom: 12, center: mylatlng, maptypeid: google.maps.maptypeid.roadmap }; var map = new google.maps.map(document.getelementbyid("google-map-location"), myoptions); var marker = new google.maps.marker({ position: mylatlng, map: map }); } var mylatlng2 = new google.maps.latlng(45.9,-85.6); var marker2 = new google.maps.marker({ position: mylatlng2, map: map }); or var marker2 = new google.maps.marker({ position: new google.maps.latlng(45.9,-85.6), map: map });

c# - File uploading in MVC -

i have form it's creating script in jquery plugin this. elem.inserthtml('<form method="post" action="home/contactus" enctype="mutlipart/form-data"><input type="file" name="file" id="fileupload"></form></div>') i must upload file, , save in folder. when choose file, , submit form, on form subbmiting calling contactus action.there contactus action home controller. public actionresult contactus(httppostedfilebase file, contactformmodel model) { //other code } but httppostedfilebase file null, , havn't got notions why. can me, please? when create form usin html.beginform, works correctly, script there problem. you can use 'file' method uploading file , retrieve them. create folder in project likes 'fileuploads' , upload file in there. give link can see full implementation :- upload,save , retrieve image database using id in code first method ...

php - Phonegap (jQuery mobile, JS) : get several xml files in a folder -

i can ajax 1 specific file : $.ajax({ async: false, url: url, datatype:"xml", success: function(data) { } }); but i'd xml files in folder. it's impossible list filenames in folder javascript. read, after, php can open xml files , wrap these files in json object. i'll have getjson mobile app. information, xml files have same structure. anyone php help. tried create exemple : <?php for($var=5; $var<10; $var++){ $myarray[]=$var; } echo json_encode($myarray); ?> but can't array :/

android - OCR (tesseract), intelligent rotation for Image -

i'm developing android app uses tesseract ocr recognize text, have problem on different smartphones image gets rotate in different way, on 1 in landscape mode right away , on other in portrait mode. want intelligently rotate image tesseract can recognize text. in 1 of 2 options possible, might in either, due user taking picture. don't want user have take picture in same format everytime, want rotate fits need, if possible without of performance loss. the tesseract lib autorotate not seem work me in way. idea how solve problem. thanks if question still relevant you: maybe can extract exif data of image, orientation? otherwise paper maybe can you: combined orientation , script detection using tesseract ocr engine .

Windows cmd file not executing call anymore -

i have cmd file working whole time during testing , 1 minute other doesn't execute call batch file anymore. the command not working anymore is: call myfile.bat now thing happens @ line error: "the provided program can not executed" i don't know if it's exact english version system in german, should or similar. anyone has idea why it's not executing batch file anymore? virus infection hard disk crash insufficient permission lock administration memory leak unstable power supply processor overheating flash of lightning general failure unknown reason

angularjs - PhantomJS and Karma, Selector [ng\:model="query.name"] did not match any elements -

when executing karma runner using phantomjs browser following error produced: *selector [ng\:model="query.name"] did not match elements*. when executing chrome working expected. here's line should matched: `<input size='' style='width:3em;' ng-model="query.name" ng-change=changequery() ng-focus=focus($index) ng-blur=losefocus($index)>` karma.conf: module.exports = function(config) { config.set({ basepath: '../..', frameworks: ['ng-scenario'], plugins : [ 'karma-ng-scenario', 'karma-chrome-launcher', 'karma-phantomjs-launcher', 'karma-junit-reporter' ], files: [ 'test/webapp/app/e2e/*.js' ], exclude: [ ], proxies : { '/': 'http://localhost:19880' }, reporters: ['progress', 'junit'], port: 9876, colors: true, loglevel: config.l...

google chrome devtools - Error 'jquery-2.0.2.min.map not found' -

Image
i'm getting error in google chrome developer tools: jquery-2.0.2.min.map not found i found way rid of removing line jquery-2.0.2.min.js : //@ sourcemappingurl=jquery-2.0.2.min.map however, don't believe idea, since may temporary fix may problem in future. since don't understand nature of error , goofy solution: what's causing error , there better fix it? apparently, not question related jquery 2.0.2 only. similar stack overflow question great explanation jquery's jquery-1.10.2.min.map triggering 404 (not found) . hope shed light on situation. 1. download map file , uncompressed version of jquery. put them minified version. 2. include minified version html 3. check in chrome 4. read introduction javascript source maps 5. familiar debugging javascript

PHP Couchbase Client operation timed out -

i've installed couchbase 2.1.1 enterprise edition on server a, php couchbase::client on servers b , c. servers b , c setup identically on rhel 5.8 , php 5.3.3. i'm facing issue on server c wherein, i'm able establish couchbase connection subsequent read , write throws following error. failed value server: operation timed out failed store value server: operation timed out same script works on server b without issues. kindly me resolve issue i'm facing. make sure there no firewalls , don't use admin credentials

osmdroid - How to get the city name by latitude and longitude using openstreetmap in android -

in app using osm rather google map.i have latitude , longitude.so here how query city name osm database..plz me.i using osmdroid-android-3.0.8.is there library have download this? this can done through reverse geocoding , convert latitude/longitude point human readable address. typically, reverse geocoding done web-request. in case, open street maps has reverse geocoding api can make requests web service , consume xml/json response city name. making reverse geocode request osm web service this: http://nominatim.openstreetmap.org/reverse?format=xml&lat=[latitude]&lon=[longitude]&zoom=18&addressdetails=1 where: [latitude] latitude point reverse geocoded. [longitude] longitude point reverse geocoded. this give result looks so: <reversegeocode timestamp="fri, 06 nov 09 16:33:54 +0000" querystring="..."> <result place_id="1620612" osm_type="node" osm_id="452010817"> 135, pilk...

java - How to freeze the last frame of an animation in a SurfaceView? -

i'm drawing on surfaceview using thread has following calssic run() method: @override public void run() { while (mrun) { canvas canvas = null; synchronized (msurfaceholder) { try { canvas = msurfaceholder.lockcanvas(); update(); dodraw(canvas); } { if (canvas != null) { msurfaceholder.unlockcanvasandpost(canvas); } } } } } i wanted save work if next frames drawn moment on, same previous one, skipped ondraw, got flickering issues due double buffering mechanism . went on , did this: @override public void run() { while (mrun) { canvas canvas = null; synchronized (msurfaceholder) { if (misanimating) { // <---- ma! flag!!! try { canvas = msurfaceholder.lockcanvas(); update(); ...

php - How can I protect my site from SQL injection? -

Image
this question has answer here: php protection of parameters 3 answers how can prevent sql injection in php? 28 answers as can see have error in site: and alrady put @: $q = @$_get['q']; if $q used in sql query need handle properly. but display in-page echo or equivalent use htmlentities($q) 1 part.

c# - How to improve search speed in data grid view -

i have datagridview contain student details (first name, last name, gender, degree , burn date) i write code perform "keyboard search" (for example "load" data locally): public class studentdetails { public string firstname; public string lastname; public string gender; public string degree; public datetime burndate; }; public list<studentdetails> studentsearchlist = new list<studentdetails>(); // contain dgv searches private void form1_load(object sender, eventargs e) { refreshdatagridview(); } private void refreshdatagridview() { (int = 0; < 1000; i++) { studentdetails sd = new studentdetails(); sd.firstname = getrandomfirstname(); sd.lastname = getrandomlastname(); sd.gender = getrandomgender(); sd.degree = getrandomdegree(); sd.burndate = getrandomburndate(); ...

php - Jquery Modal load while Rdirecting the page -

i have modal on place...and button in need 2 things in 1 time,... when button save clicked, there php function called , executed, while need show modal, if background php function executed, how do that? <button class="btn id="save">save</button> this php controller php function.. if(isset($_post['ac'])){ if($_post['ac']=='cancel'){ $class->no($id); } if($_post['act']=='save'){ $class->yes($id); } } as see above code, call yes function php-side work, in function @ end have redirect php method redirect other page, and have following jquery code... $('#save').click(function(){ $('#modsave').modal(); }) in general, problem when click button comes modal, because of redirect method in php, when goes other page modal disappear. one thing, php redirect same page parameter passed pages default page. how preven...

RFT-how to get the title of the webpage in RFT -

i trying automate web application using rft.the web application written in java. my test case,the moment,i navigate particular page,i want title of webpage example:- go www.google.com , click on 'news'. page title "google news". i want title. like in selenium,i aware gettitle() used give me title of page please help! thanks! getting tile depends on type of application is( mean if html/win/.net/java etc) , type of object have in object map it. information looking can use testobjectinspector in rft. using testobjectinspector(and setting "show properties" ) can check property 1 shows title , on object can call getproperty("propertyname"); java application (as mentioned application based on) might use .captiontext or if have htmlbrowser in object map can find htmldocument (htmlbrowser's child) , call getproperty(".title").

iphone - UIScrollView with IUViewController dropping objects -

i have weird issue uiscrollview , added uiviewcontrollers. looks when uiviewcontrollers added uiscrollview paging, uiviewcontroller drops added objects. in project have storyboard 2 views , connected correctly corresponding code. i know code doesn't move added uiviewcontroller correct x, in test im adding 1 uiviewcontroller doesnt matter. this scroll code .h: #import <uikit/uikit.h> #import "testviewcontroller.h" @interface viewcontroller : uiviewcontroller @property (weak, nonatomic) iboutlet uiscrollview *scrollview; @property (weak, nonatomic) iboutlet uipagecontrol *pagecontrol; @property (strong, nonatomic) nsmutablearray *scrollcontroller; @end this scroll code .m: #import "viewcontroller.h" @interface viewcontroller () @end @implementation viewcontroller - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. self.scrollcontroller = [[nsmutablearray alloc] init]; } - (void)viewdidapp...

oracle - How should i get the following output in SQL? -

Image
i have 2 tables employee , grade,want output third table (i.e output table) ? if possible how ? you can try this select e.name , g.grade employeetable e, gradetable g e.salary >= g.min , e.salary <= g.max

oracle adf - Stretched layout vs flowing layout -

i reading on oracle adf faces documentation guidelines regarding layouts. @ higher level mentions these best practices creating robust layouts works consistently across browsers: create stretchable outer frame create flowing islands what difference between stretching layouts , flowing/scrolling layouts? can 1 can provide appropriate example. a seminar topic here: http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/layouts/layouts.html stretch layout adjusts fill browser regardless of browser window size adding scrollbars needed. flow layout don't stretch , kept fixed.

hadoop - Unstructured data into structured data using Pig -

i'm trying structure un-structured data using pig doing processing. here's sample of data: nov 1 18:23:34 dev_id=03 user_id=000 int_ip=198.0.13.24 ext_ip=68.67.0.14 src_port=99 dest_port=213 response_code=5 expected output: nov 1 18:23:34, 03 , 000, 198.0.13.24, 68.67.0.14, 99, 213, 5 as can see data not separated (like tab or comma), tried load data using '\t' , dumped on terminal. a = load '----' using pigstorage('\t') (mnth: chararray, day: int, --------); dump a; store '\root\output'; output: dump output: (nov,1,18:23:34,dev_id=03,user_id=000,int_ip=198.0.13.24,ext_ip=68.67.0.14,src_port=99,dest_port=213,response_code=5) store oputut: results stored same input, not dump(comma separated). nov 1 18:23:34 dev_id=03 user_id=000 int_ip=198.0.13.24 ext_ip=68.67.0.14 src_port=99 dest_port=213 response_code=5 alternative: tried load data using datastorage() (value: varchar) , performed tokenize al...

c++ - Making a sequential list of files -

i have been stuck on problem while , can't seem find answer. i'm trying create multiple files same name different number @ end each time, have attempted @ first using int seq_number = 1; while (seq_number < 10) { ofstream fsave; fsave.open("filename" + seq_number + ".txt"); fsave << "blablabla"; fsave.close(); seq_number = seq_number + 1; } but gives me strange result letters jumbled up, i'm not sure how works know doesn't. i've looked online , found stringstream or sstream, , tried that, keeps giving me errors too, string filename; filename = "character"; ostringstream s; s << filename << seq_number; filename(s.str()); fsave.open(filename + ".txt"); fsave << "blabla" fsave.close(;) but keep getting error: no match call `(std::string) (std::basic_string, std::allocator >)' i'm not sure how string stream works im working off of instinct, appreciate way ...

jquery - javascript to call new HTMLpage -

i have problem calling html page via javascript. might simple, learning.hope can help. <label value="login" id="lbl1" ontouchstart="mousedown1()" ontouchend="mouseup1()">login</label> javascript function mouseup1() { var styles = { "background": "url(img/b_long_off.png)", "background-size": "100% 100%", "height": "36px", "width": "93%", "position": "absolute", "text-align": "center", "padding-top": "18px", "left": "3.5%", "top": "208px", "font-family": "arial, helvetica, sans-serif", "font-size": "16px", "color": "white" }; $("#lbl1").css(styles); $.mobile.changepage(...

ruby - Why isn't my class method recognized? -

i trying understand why class method not recognized. below code: wiki_patch.rb require_dependency 'wiki_content' module wikirecipientpatch def self.included(base) base.send(:include, instancemethods) base.class_eval alias_method_chain :recipients, :send_wiki_mail end end end module instancemethods def self.set_mail_checker(mail) @mail_checker = mail end end rails.configuration.to_prepare wikicontent.send(:include, wikirecipientpatch) end controller.rb wikicontent.set_mail_checker(params[:mail_checker_wiki]) i getting error: nomethoderror (undefined method `set_mail_checker' #<class:0x4876560>): any idea why happens , solution is? you got idiom wrong. classmethods / instancemethods modules supposed nested in "main" module ( wikirecipientpatch in case). you including instance methods, expecting class methods somehow arise this? surely meant extend classmethods , didn't y...

jquery - Fullcalendar: Correct JSON feed not beeing displayed after update -

i´m having problems updating fullcalendar version 1.4.7 1.6.3: the events aren´t being loaded anymore. i´m using sql-server database via json feed. here´s example string: [{id: '1',title: 'nfhnjzd',start: 1376344800,end: 1376344800,allday:true,description: ''}] the string above worked out fullcalendar 1.4.7. , being loaded correctly via get, event not displayed in calendar. steps took based on working version: updated fullcalendar.css 1.4.7 1.6.3 updated fullcalendar.min.js 1.4.7 1.6.3 updated jquery-1.3.2.min.js jquery-1.10.2.min.js i´ve been looking answers in web ages , can´t find solution. can´t json string, can it? if create new event written database, if reload page, event disappears again eventhough it´s in database. no errors displayed in firebug. thing can see statement correctly filled json feed, works if hardcode in working version. can help? ok, i´ve solved now. after receiving error json.parse: expected property n...

activex - C++ reading file created in ProgramData with "run as Admin" -

i have activex deploys application on host. files placed in programdata deployment on win7 uac enabled browser started "run administrator". part of deployment creates log file. late,on machines, when same activex tries read log file (this time ie executed without elevation user admin) - file contains first line. don't "access denied" , on. if start ie admin - i'm getting full information file. please note - initial write file , later read file happens under same user admin. i understand uac visualization happens - issue reproduced on machines. may related specific setting in uac ? please help zaky

How to change date format in rails -

is normal rails put : datetime.now = 2013-07-28t16:21:13+02:00 why t between date , time ? how can remove it. in i18n have default: default: ! '%a, %d %b %y %h:%m:%s %z' in irb console, if call puts variable , make implicit call method to_s on variable object: 1.9.3 > datetime.now # => wed, 28 aug 2013 10:39:30 -0400 1.9.3 > puts datetime.now 2013-08-28t10:39:33-04:00 # => nil 1.9.3 > datetime.now.to_s # => "2013-08-28t10:39:37-04:00" this why see "t" in output, .to_s 's fault!

javascript - String escape, reading from text file -

i have text file content: lorem ipsum dolor sit amet i trying read simple content php , put div using javascript. everyting okay if add break line text, doesn't work. lorem ipsum dolor sit amet this files uploaded server users, not written app. $.ajax({ type: "post", url: "read.php", data: '', success: function(response) { $("div#content").html(response); } }); if contains special chars, doesn't work again. lorem ipsum 'dolor sit amet' on php: echo json_encode($your_string); that should take care of escaping newlines you.

Using FOR loop in VHDL with a variable -

is there possible way create loop in form: for in 0 some_var loop // blah,blah end loop; if not, there alternative way create same loop? since while loops allows use variable limit, not synthesizeable in project. thanks in advance, bojan matovski the variable works fine testbench applications. for synthesis can same effect using static range , exit condition. set range maximum need. for in 0 max_value loop exit when = some_var ; // blah,blah end loop; if synthesis tool chokes on this, file bug report. both 1076.6-1999 , 1076.6-2004 (vhdl rtl synthesis standards) indicate exit conditions supported "for" loops static range. may find support issues respect using loop label (1076.6-1999) indicates not supported. if find bug (or lack of support) , not report it, vendor think feature don't care about, , hence, not invest in changing tool.

ServiceStack.Redis: Unable to Connect: sPort: 50071 -

i'm using servicestack redis client , hoping clarification on might cause following error ... "unable connect: sport: 50071"? i'm using "pooledredisclientmanager" object connections. assistance. if using self hosted redis server , using service stack redis client then buyer beware as of 9/23/2015 service stack license validation in client code (rather server). if ripping through lot of messages 6000+ hour get. resulting error unable connect: sport: however, not handling custom licenseexpection , exposing error correctly. error this: the free-quota limit on '6000 redis requests per hour' has been reached. please see https://servicestack.net upgrade commercial license or visit https://github.com/servicestackv3/servicestackv3 revert free servicestack v3. i doubt have imposed such limit on server :-)

java - InputStream reader blocking thread -

i wrote inputstream reader listen socket. code in while(!stop) loop inside run method of thread. reader blocks thread, , not print message. int read = 0; byte[] buf = new byte[512]; int index = 0; try { while (!stop && (read = in.read()) != -1) { system.out.println("read loop"); buf[index++] = (byte) read; } } catch (ioexception e) { e.printstacktrace(); } the read indeed blocks thread running if no data available. what want read byte timeout ? look answer in is possible read inputstream timeout?

Java SWT StyledText, changing the starting line number -

Image
i using styledtext widget display "excerpt" of actual code, such method definition within java file. my problem line number shown in styledtext start 1, different actual line number in original file. example, if original source looks like: 1: package something; 2: 3: public class myclass { 4: public void foo() { 5: // something... 6: } 7: } then, when foo() method shown in styledtext widget, want show line numbers starting 4, not 1. is there way achieve this? read through javadoc, not figure out way. just change linestyleevent.bulletindex in linestylelistener : final styledtext text = new styledtext(shell, swt.none); text.settext("lalala\n\nlalala\n\nlalala\n\nlalala\n\nlalala\n\nlalala\n\n"); text.addlinestylelistener(new linestylelistener() { @override public void linegetstyle(linestyleevent e) { // set line number e.bulletindex = text.getlineatoffset(e.lineoffset); // set st...

sql server - Combo google chart with php from mssql -

Image
i'm requiring advices on project i'm trying feed "combo" google chart 1 php ms sql server database. i have built following view provides me relevant data. i'll have later create serie of these charts each project (identified via 'projectuniqueid'). from documentation got far, understand have programmatically build following datatable var data = google.visualization.arraytodatatable([ ['week', 'hrs vse', 'hrs pii', 'hrs vdg', 'hrs pia', 'hrs tcis', 'forecast' ], ['2013-w20', 165, 938, 522, 998, 450, 614.6], ['2013-w21', 135, 1120, 599, 1268, 288, 682], ['2013-w22', 157, 1167, 587, 807, 397, 1200], ['2013-w23', 139, 1110, 615, 968, 215, 2000], ['2013-w24...

html - Trying to keep image contained within another image -

i using jquery change size of image after click. how can keep close button contained within upper right corner no matter size of image becomes after click. jsfiddle my css #full_image { width: 0px; height: 0px; left: 0px; position: relative; opacity: 1; z-index: 9; } #full_image img { background: url("zoom-on.png") no-repeat; background-position: 5px 5px; left: 0px; width: 339px; height: 211px; position: relative; overflow: hidden; } #full_image .full_close{ background: url("zoom-on.png") no-repeat; top: 10px; cursor: pointer; height: 29px; opacity: 1; position: absolute; width: 29px; z-index: 999; right: 0px; } my html <div id="full_image"><img src=""/> <span> <a href="#" class="full_close"></a></span> </div> the thing can keep image contained within #full_image need contained within #full_image img try css: #full_image { position: relative; ...

database design - Will junction table contain the foreign keys or the primary keys of the individual tables -

in link here they explain how use junction tables around many-many relationship problem in relational database design. this line if there no association class, junction table (sometimes called join table or linking table) contain fk attributes each side of association. from example seems junction table containing not fk primary keys of individual tables. cust id, order date form composite primary key of orders , upc primary key of products . correct. 'junction' table or 'association' table contain pk values of tables on either end of m2m relationship. times these 2 columns in association/junction table , can/usually form pk of association/junction table.

nginx - Assigning vhosts to Docker ports -

i have wildcard dns set web requests custom domain (*.foo) map ip address of docker host. if have multiple containers running apache (or nginx) instances, each container maps apache port (80) external inbound port. what make request container-1.foo, mapped correct ip address (of docker host) via custom dns server, proxy default port 80 request correct docker external port such correct apache instance specified container able respond based on custom domain. likewise, container-2.foo proxy second container's apache, , on. is there pre-built solution this, best bet run nginx proxy on docker host, or should write node.js proxy potential manage docker containers (start/stop/reuild via web), or...? options have make using docker containers more natural event , not extraneous ports , container juggling? this answer might bit late, take @ jason wilder's nginx-proxy docker image . when running docker container of image, nginx server set reverse proxy other containers...

html - how to collapse width of parent element to total width of child elements -

my parent width takes whole 100% width of parent element. instead, want parent width collapse total width of child elements. jsfiddle : http://jsfiddle.net/z9unk/232/ notice how red-bordered parent width greater total width of green-colore child elements. want collapse parent width. please advise necessary changes. html <div class="item1"> <div class="item2"> item2 </div> <div class="item2"> item2 </div> </div> css: .item1 { position:relative; white-space: nowrap; width:auto; overflow: hidden; border:2px solid red; } .item2 { position:relative; display:inline-block; background-color: green; width : 255px; height : 205px; margin-right:6px; border:1px solid blue; } .item1 block-level element takes 100% of width of parent default. you change type of display of .item1 element table or inline-block : .item1 { /* other css declarations */ ...

Emulating Android JB on QEMU -

i've been trying build , run android jellybean on qemu. have kernel built target machine type (arm versatile express - cortex a15) i have been trying build qemu image output of android build end errors such as qemu-system-arm -serial stdio -m vexpress-a15 -m 128m -kernel zimage -append "root=/dev/sda1 earlyprintk" android_jb.img <3>vfs: unable mount root fs via nfs, trying floppy. vfs: cannot open root device "/" or unknown-block(2,0) please append correct "root=" boot option; here available partitions: <0>kernel panic - not syncing: vfs: unable mount root fs on unknown-block(2,0) this happens if don't specify -initrd option qemu. when specify initrd option qemu-system-arm -serial stdio -m vexpress-a15 -m 128m -kernel zimage -append "root=/dev/sda1 earlyprintk" -initrd ramdisk.img android_jb.img (generated android build process), following errors <3>init: cannot find '/system/bin/servicemanag...

c# - ASP.NET authentication to external server with client credentials -

i have site (asp.net) , intranet site. users connect , able upload , edit images , image saved sharepoint library username creator. right now, looks can't use user credentials connect sharepoint, , uses service account, isn't allowed library, , kicks 401 error. without having have user put credentials on page, can authenticate using integrated windows credentials?

Finding sum based on the condition in Sql Server 2008 -

i have these columns in table person agent unit bsp discount 578 0 000023 32689525 0.1 578 1 000025 17589656 1 579 0 000021 32689525 0.1 579 0 000020 17589656 1 581 0 000022 32689525 0.1 583 0 000024 17589656 1 578 11 000023q 32689525 0 578 12 000025a 17589656 0 actually have calculate incentive person . in case of above 578. since has booked total 4 units out 3 brokers , 1 individual. broker part incentive 2500 inr per unit 3*2500 = 7500. comes discount part. see points below: conditions: if no discount has been given, 1% of bsp allocated incentive sales person. if discount given booking between .1% 1%, .75% of bsp allocated incentive sales person. if discount given booking between 1 .1% 2%, .50% of bsp allocated incentive sales person. i...

PHP LDAP bind intermittent issue -

i developing application company requires users log in. automate log in process have tried integrate ldap id , password authentication app. below code have written integration. have checked online , not find 1 facing issue. i have code -> function isauthenticated($u,$p) { $ldap_host = 'my_host'; $ldap = ldap_connect($ldap_host); ldap_set_option(null, ldap_opt_debug_level, 7); if($ldap) { if($bind = ldap_bind($ldap,$u,$p)) { ldap_unbind($ldap); return 'authenticated'; } else { return 'invalid credentials'; } } else { return 'not able connect'; } } $username = 'preventanonymouslogin'; $password = 'preventanonymouslogin'; if(isset($_request['uname'])) { $username = $_request['uname']; } if(isset($_reques...

python - Continuously capture mouse events with pygame -

i'm using pygame build simple game , have following main loop, mouse() function capture , process mouse events , keyboard() keyboard events: def mainloop(): pygame.event.pump() keyboard(pygame.key.get_pressed()) events = pygame.event.get() mouse(events) event in events: if event.type == pygame.quit: pygame.quit() return false return true when player clicks on tile have following function called mouse() : def objreach(obj, pos): try: path = obj.reach(pos, move=false) # a* (path-finding algorithm) step in path: sleep(1.0/obj.speed) objmove(obj, step) except exception e: sendmsg(str(e)) the problem is, while object walking path (while for loop running) mouse events don't captured, if player clicks on tile in middle of way, nothing happens. want player able change paths. i tried using mainloop inside for loop, partially effective - captures m...

api - Shortest possible definition for someone who doesn't know programming -

can think of shortest possible definition api, doesn't know programming? i'm using in essay , footnote definition readers might not understand meaning or context of app programming interface without tripping myself , flow of work. from wikipedia disambiguation page: api, advanced programming interface more commonly known near-synonym, application programming interface, defined inter-program interface. "any defined inter-program interface" nice, maybe little broad purposes. it's lot of things (see wikipedia ). think of collection of tools , documentation allow user interact external library or base of information. howstuffworks has definition: an application-programming interface (api) set of programming instructions , standards accessing web-based software application or web tool. i don't think api implies application must web-based, otherwise definition.

html - remove message select printer and automatically print the document with javascript -

i'm working in process of printing documents , found alternative using javascript. the code is: <html> <head> <script type="text/javascript"> function printpage() { window.print(); window.close(); } </script> </head> <body onload="printpage()"> <embed src="pdfhere.pdf"/> </body> </html> if create html page , open internet explorer, sent message select printer , print document. what want automatically print document without displaying message help. you can't skip browser print dialog. provided browser/os. window.print() best can do.

c# - Move label right to avoid over lap -

i have 2 labels next each other. values of these labels changed @ run time. if text of first label long overlaps second label. what want second label shift right avoid overlaping. is possible? here code: // // labelname // this.labelname.autosize = true; this.labelname.backcolor = system.drawing.color.transparent; this.labelname.font = new system.drawing.font("tahoma", 9.75f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, ((byte)(0))); this.labelname.forecolor = system.drawing.color.white; this.labelname.location = new system.drawing.point(6, 1); this.labelname.name = "labelname"; this.labelname.size = new system.drawing.size(93, 16); this.labelname.tabindex = 55; this.labelname.tag = "useheaderimage core"; this.labelname.text = "name"; // // labelsharesize // this.labelsharesize.autos...

c# - jqGrid is loading JSON but not displaying it -

i have been reading wide variety of posts , documentation issue, , have tried have read , can think of - still stumped. i'm trying load json data server jqgrid in dot net nuke website. using dnn not choice, there no option not use it. being said, i've set standard dnn website , added c# class library project (named apilibrary) it. in it, there 2 classes: routemapper.cs using dotnetnuke.web.api; namespace apilibrary { public class routemapper : iserviceroutemapper { public void registerroutes(imaproute maproutemanager) { maproutemanager.maphttproute("apilibrary", "default", "{controller}/{action}", new[] { "apilibrary" }); } } } and welcomecontroller.cs contains ajax functions. 1 using jqgrid following: [webinvoke(method = "post", responseformat = webmessageformat.json, requestformat = webmessageformat.json)] public string getmydata(string sidx, string sord...

java - Can't compare sheetname with string value -

Image
what need compare or search string in sheet name.. i mean, excel file might have more 1 sheet, sheets specific string let said only sheets named "formato sive 04" going processed... i'm debugging crazy , i'm getting confused... code it's this workbook eworkbook = workbookfactory.create(archivo); int totalsheet = eworkbook.getnumberofsheets(); system.out.println("fuerawhile"+totalsheet); sheetname=new string[totalsheet]; //string nombrehoja = eworkbook.getsheetname(0).tostring(); //system.out.println(nombrehoja); sheet sheet = null; while(i<totalsheet){ sheetname[i] = eworkbook.getsheetname(i); system.out.println("antes if :" + sheetname[i]); formato = sheetname[i]; if(formato == "formato sive 04"){ flag = true; ...

vb.net - Checking if index is null and providing an error? -

i have following code: private sub button1_click(sender object, e eventargs) handles button1.click ' calculate button if string.isnullorempty(textbox1.text) msgbox("please enter value convert!") end if if currentindex = vbnull msgbox("please select conversion!") end if select case currentindex case 1 label2.text = textbox1.text & " celsius = " & math.round(((textbox1.text * 1.8) + 32), 2) & " fahrenheit" case 2 label2.text = textbox1.text & " fahrenheit = " & math.round(((textbox1.text - 32) / 1.8), 2) & " celsius" case 3 label2.text = textbox1.text & " kelvin = " & math.round((textbox1.text - 273.15), 2) & " celsius" case 4 label2.text = textbox1.text & " celius = " & math.round((textbox1.text + 273.15), 2) & " kelvin...