Posts

Showing posts from February, 2013

charts - HighCharts gauge big figure and congested percentage issues -

Image
i having follow issues in highchart gauges: sales revenue gauges not start ranges have assigned check sales/revenue block, ranges provide gauge is: 511721.61 604761.90 604761.91 744322.34 744322.35 1116483.52 another issue in profit percentage block, ranges closely bound. not good, ranges are, 40.01 41.87 41.88 44.19 44.20 46.52 third issue if dialer figure exceeding range values, needle circles on dialer again , stops on wrong figure, want if needle should not recircle , stop on end of green end. https://jsfiddle.net/9mcw95bf/1/ [https://jsfiddle.net/9mcw95bf/1/][2]

html - Why is my footer at the top of my page? -

firstly, used #copyright { position: fixed; bottom: 0; left: 0; right: 0; height: 50px } footer { position: fixed; bottom: 50px; left: 0; right: 0; } which worked fine until tested site on smaller screen , realised footers overlapping content. tried setting html , body height 100% , setting wrapper min height 100% , placing footer underneath, in hopes of more relative footer. stuck @ top, causing ? #wrapper { display: block; position: fixed; text-align: center; min-height: 100%; width: 100%; top: 0; bottom: 0; left: 0; right: 0; } #header p { font-size: 2em; margin: 0; } #header ul { list-style-type: none; } #header ul li { display: inline; padding: 20px 20px; font-size: 1.5em; margin: 0 30px; } #copyright { position: relative; height: 50px; width: 100%; text-align: center; font-size: 0.8em; } #footer { position: relative; margin-top: 15px; height: 50px; width: 100%; text-ali

jquery - Using 3rd party json data in django -

i have live monitoring data tool called prtg via api want build django site brings in real time reporting along other dashboards have created. i'm stuck @ first step of bring in api data display on page. the api data this: {"prtg-version": "14.1.8.1371", "treesize": 381, "sensors": [ { "objid": 1001, "probe": "newname", "group": "newname", "device": "br-s-log", "sensor": "system health", "status": "up", "status_raw": 3, "message": "<div class=\"status\">ok<div class=\"moreicon\"></div></div>", "message_raw": "ok", "lastvalue": "100 %", "lastvalue_raw": 100.0000, "priority": 5 }, { "objid": 1002, "probe": "newname", "group"

How to convert an array into an array object in javascript? -

my scenario upload text file contain data this a1,b1,,c1,d1, a2,b2,,c2,d2, from data, able read , split ("\n") , result is array=[array[0]:[a1,b1,,c1,d1] array[1]:[a2,b2,,c2,d2]] how can populate array above array object? sample output: newarray=[[name="a1",age:"b2",address="",contact="c1",gender="d1"], [name="a2",age:"b2",address="",contact="c2",gender="d2"]] as position of each attribute in array seems fixed, create function fixed assignment. this: var str = "a1,b1,,c1,d1,\na2,b2,,c2,d2,"; var objects = parsestring(str); console.log(objects); function parsestring(strin){ var objectlist = []; var splitresult = strin.split("\n"); for(var i=0;i<splitresult.length;i++){ var valuearray = splitresult[0].split(","); objectlist.push(maptoobject(valuearray)); } return objec

jquery - How to align a rotating wheel to stop in center position not random position using javascripts? -

i trying create wheel on wordpress using javascript. have done making wheel , it's spinning randomly after click , stopping on random position. i edit wheel function, stop on center position of each part of wheel. also, wheel not stop , repeat section again. in each click spin wheel stop in new section. , stop in center position of wheel. possible? here have used spin wheel on wordpress <img src="elevatingpolitics.com/wp-content/uploads/2016/10/ep-wheel.png" alt="" usemap="#linkwheel" width="500" height="auto" style=""> var img = document.queryselector('img'); img.addeventlistener('click', onclick, false); function onclick() { this.removeattribute('style'); var deg = 1500 + math.round(math.random() * 1500); var css = '-webkit-transform: rotate(' + deg + 'deg);'; this.setattribute( 'style', css ); } here wheel image section

typescript - Angular 2: Observable not returning the object (nested) from service -

i have angular service returns user object. user object has own attributes plus array of walls. service returns observable calling component. in service, able create user object json returned http service. however, when subscribe service in component, object returned null. doing wrong here? // user.ts import { wall } './wall'; export class user { id: number; entrytype: number; usertype: number; subscriptiontype: number; iscoach: boolean; username: string; email: string; name: string; password: string; created: string; memberwalls: wall[]; } //wall.ts export class wall { title: string; viewitem_id: number; } //authentication.service.ts authenticate(authrequest: login): observable<user> { let url: string = this.apiurl + appsettings.login_service; let headers = new headers({ 'content-type': appsettings.content_type_header, //'; charset=utf-8', 'client-

vue.js - How to use eslint autofix in .vue? -

i want use autofix in .vue file, eslint show errors, no autofix. how configure .eslintrc make work? it not work. had same issue , asked question here (surprised haven't found it). asked them on github , answer still not came solution use fix plugins (vue-loader). eslint , vuejs files. throwing errors not fixing them here thread on github of eslint: https://github.com/eslint/eslint/issues/7456#issuecomment-256757117 hope helps.

css - Keep 'id' in snappysnippet -

i found google chrome extension tool 'snappysnippet'. can export html/css finely except 'id', changed in general name 'div_1'. somehow want keep 'id's, though, how can that? ('class' can preserved turning off 'format , clean html' option) or there other alternative tools? thank help.

javascript - How to fillStyle all circles in different color in canvas: red, yellow, blue and green? -

i looking way fillstyle of circles in 4 colors: #00ce66 , #e3bf37 , #cc5543 , #a1b7c2 . want circles show in way: 25% of circles red, 25% circles yellow… etc. on canvas while page loaded. when added math.random() , put inside colors, circles black. please :-) (function() { var width, height, largeheader, canvas, ctx, circles, target, animateheader = true; // main initheader(); addlisteners(); function initheader() { width = window.innerwidth; height = window.innerheight; target = {x: 0, y: height}; largeheader = document.getelementbyid('large-header'); largeheader.style.height = height+'px'; canvas = document.getelementbyid('canvas'); canvas.width = width; canvas.height = height; ctx = canvas.getcontext('2d'); // create particles circles = []; for(var x = 0; x < width*0.2; x++) { var c = new circle();

android - SurfaceView blinking when i try to hide it -

i use surfaceview draw coordinate grid , outlines future custom views. when done drawing outlines, hide surfaceview ( mysurfaceview.setvisibility(view.gone) ) , screen splashes black on moment. how resolve problem? sample project mysurfaceview public class mysurfaceview extends surfaceview implements surfaceholder.callback { float[] gridlines; canvas canvas; pointf oldpos = new pointf(); surfaceholder holder; final int mstep = 15; private paint paint = new paint(paint.anti_alias_flag); public mysurfaceview(context context, attributeset attrs) { super(context, attrs); getholder().addcallback(this); paint.setstyle(paint.style.stroke); paint.setstrokewidth(3); paint.setcolor(context.getresources().getcolor(r.color.coloraccent)); } @override public boolean ontouchevent(motionevent event) { pointf newpos = new pointf(); float top; float left; float bottom;

Mirth Connect Solution.For multiple user Access info with what they Done with there name and date -

my mirth connect uses 10 people simultaneously ex . 1 reprocoss hl7 message , user remove message. so want user process time , date , ip address plz suggestion important the commercial version of mirth connect supports advanced user management , advanced alerting, sounds need. from mirth site : advanced alerting advanced alerting provides metric, exception, , state-based monitoring of channels , connectors. additional features include automatic escalation , de-escalation, scheduling, , notification throttling. using advanced alerts, dynamically send different alert messages different user groups based on current escalation level, time, , day. new alert dashboard provides view of alert statistics , logs. user authorization user authorization provides role-based access control aspects of mirth connect administrator. create new roles specific permissions areas such channel management or message browsing. assign number of roles users. use manage access sensitive c

Xamarin.Forms IOS Wont build -

i getting following error in visual studio: severity code description project file line suppression state error 2016-11-10 08:12:21.588 ibtoold[1725:9661] [mt] dvtassertions: warning in /library/caches/com.apple.xbs/sources/ideinterfacebuilder/ideinterfacebuilder-11542/interfacebuilderkit/utilities/ibabstractinterfacebuilderplatformtoolmanager.m:254 details: failed attach interface builder cocoa touch tool error: error domain=com.apple.interfacebuilder code=-1 "encountered error communicating interface builder cocoa touch tool." userinfo={nsunderlyingerror=0x7f8f53b7e450 {error domain=nsposixerrordomain code=22 "invalid argument" userinfo={nsunderlyingerror=0x7f8f53c086a0 {error domain=nsposixerrordomain code=22 "invalid argument"}, nslocalizedfailurereason=failed spawn interface builder cocoa touch tool on simdevice : ibsimdevicetypeipad2x (4f7af09b-a326-4a75-8657-3269c0ef6ae9) : state={ shutdown } devicetype={ simdevicetype : com.apple.dt.xc

javascript - Display table row data as Modal with ng-repeat -

i need displaying row data using modal when row clicked. @ moment displays on next row. has display same data modal. need on return list, how can use uri/url or rather point json file in there , avoid hard-coded data. attached piece of code explains have. thanks! <body> <table ng-controller="usersctrl" class="table table-striped"> <thead> <tr> <th>name</th> <th>age</th> </tr> </thead> <tbody> <tr ng-repeat-start="user in users" ng-click="seluser(user)"> <td>{{user.name}}</td> <td>{{user.age}}</td> </tr> <tr ng-repeat-end ng-if="isselected(user)"> <td colspan="2">{{user.desc}}{{user.name}}{{user.age}}</td> <!-- display row details using modal --> </tr> <

java - Fork/Join Framework implementation in Stream API -

official oracle documentation says: another implementation of fork/join framework used methods in java.util.streams package the public classes have found there abstracttask , abstractshortcircuittask , abstract. and haven't found , forkjoinpool implemenentation. question : mean don't have manual access fork/join process in stream api , cannot not use implementation directly?

javascript - Safari webpage reload error -

the name of error "a problem occurred web page reloaded". on ios devices in safari browser . appears when capture picture camera ("take photo" option) upload form. if take existing photo library works good.the error message pops after submitting form , redirecting page. help.

python - Manhatten distance between rectangles -

Image
i have set of rectangles , need calculate manhatten distance between them. tried implement it, code blow , did not work well. maybe me smart (and efficient) formulas used calculate distance between 2 rectangles? examples: the distance between a , b length of line 1 . distance between a , c length of line 2 . etc. i use python implement everything. if function exists (e.g. in scipy) , knows it, great. thank you i suggest, work central points of rectangles , rectangle widths compute distances. have figure out corners (edges) of rectangles use computation. else simple. quick example: class rect: def __init__(self,cpt,w,h): self.x = cpt[0] self.y = cpt[1] self.w = w self.h = h def dist(self,other): #overlaps in x or y: if abs(self.x - other.x) <= (self.w + other.w): dx = 0; else: dx = abs(self.x - other.x) - (self.w + other.w) # if abs(self.y - other.y)

c# - How to hash file (MD5, SHA..v.v..) in UWP -

i'm coding universal app, how can hash file md5 or sha algorithm ? i searched, found this: system.security.cryptography , it's not available in project. i'm using visual studio 2015. in uwp, windows.security.cryptography namespace , windows.security.cryptography.core namespace . in cryptographicbuffer class there sample showing how use class. here demo getting md5 hash: private string stralgnameused; public string getmd5hash(string strmsg) { string stralgname = hashalgorithmnames.md5; ibuffer buffutf8msg = cryptographicbuffer.convertstringtobinary(strmsg, binarystringencoding.utf8); hashalgorithmprovider objalgprov = hashalgorithmprovider.openalgorithm(stralgname); stralgnameused = objalgprov.algorithmname; ibuffer buffhash = objalgprov.hashdata(buffutf8msg); if (buffhash.length != objalgprov.hashlength) { throw new exception("there error creating hash"); } string hex = cryptographicbuffer

Serenity+Cucumber: Reading testdata from Excel -

i running automation test cases @runwith(cucumberwithserenity.class) . want expose , maintain testdata separately in excel sheets instead of placing in feature files. the template excel testdata looks like: |scenario |username |password|name |address|city |pincode| |testcase1|testuser1|pass1 |testuser1|us |jersy |12345 | |testcase1|testuser2|pass1 |testuser1|us |virginia|78955 | we have chose use primary key 'scenario' present in both feature file , excel sheet , based on read specific row excel , refer specific row data testdata particular scenario. questions: is there way scenario name @ run time feature file when test running, can excel sheet extract data excel sheets? is there default way/method available in above mentioned use case, can use above use case? cucumber doesn't support external sources design (it collaboration tool, not test automation tool). in serenity, can build parameterised junit test gets data csv file

Why isn't the KryoSerializer enabled by default in SPARK? -

all blogs have read state kryoserializer better default java serializer. so, why isn't enabled default? ok, after watching talks on these default settings, appears many default settings in spark chosen give best out of box experience typical 1st user trying run on laptop feel spark is. when people go trouble of worrying performance , deploying real clusters, people have decided invest time seeing can problem space. then, can spend time deciding if kyro them, given code required register classes etc.

linux - executable jar made by STS errors out -

i made java-batch on sts in windows, , transfer jar(made maven install) , property files centos(ver,7). when executed, error occurred. logs below: note bbbb01 program name. can me..! yyyy-mm-dd 13:49:33,413 error commandlinejobrunner - job terminated in error: error creating bean name 'bbbb01configuration': injection of autowired dependencies failed; nested exception org.springframework.beans.factory.beancreationexception: not autowire field: private org.springframework.batch.core.repository.jobrepository com.batch.xxxxx.bbbb01configuration.jobrepository; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'jobrepository': invocation of init method failed; nested exception org.springframework.jdbc.support.metadataaccessexception: not connection extracting meta data; nested exception org.springframework.jdbc.cannotgetjdbcconnectionexception: not jdbc connection; nested exception org.apache.commons.dbcp.sqlnestedexce

unityscript - Zoom in/out clicked area in Unity3D -

i new game development , new unity. need zoom , move camera clicked position of object. have imported object sub prefabs , of prefabs has 0,0,0 position not performing. please advice me. thanks from described in question, here can suggest: you can calculate point @ distance think camera should body part object (for example x , y can same body part z can have offset of 5). , use movetowards on camera move point. after can apply lookat (bodypartobjecttransform). hope helps

sql - UPDATE query vs. Table FILTER yields different rows count (MS ACCESS) -

Image
i have problem count of updated rows through update query. when run update query: update t002vyk inner join tzemnyplyn on t002vyk.bmsid = tzemnyplyn.[id budovy] set t002vyk.iszemnyplynhistoricky = yes; it says, 2916 rows updated. i run update query. (i tried different queries well, same results). when filter table t002vyk on field iszemnyplynhistoricky = yes , 2701 rows. just provide info, here design view of field iszemnyplynhistoricky : (i tried using number data type, 0/1 values, no luck) my questions why different results in filtered table, in update query? how solve problem? solution: in tzemnyplyn table, there duplicate id's [id budovy] , counted more once time in update query results. after creating unique list of [id budovy] update query showed 2701 rows table did. thanks tim biegeleisen's comment, getting me on track.

c# - Android application throwing: Java.Lang.IllegalStateException, with message: Can not perform this action after onSaveInstanceState -

to shorten problem : developing android application requires users log in, , since multiple users logged in @ same time, want cycle between authenticated users using nfc touch cards. works fine except after using zxing.mobile bar-code scanner, when code returns scanning bar-code, , tries push page model, particular exception being thrown java.lang.illegalstateexception: can not perform action after onsaveinstancestate . please note using xamarin.forms, freshmvvm, zxing.mobile, , of course c#. fragments of code used: androidmanifest.xml: <activity android:name="com.name.splashactivity"> <intent-filter> <category android:name="android.intent.category.launcher" /> <action android:name="android.intent.action.main" /> </intent-filter> <intent-filter> <action android:name="android.nfc.action.ndef_discovered" /> <category android:name="android.int

Font Awesome stacked images in html list -

i'm trying use font awesome stacked images in list described in example page http://fontawesome.io/examples/ list: <ul class="fa-ul"> <li><i class="fa-li fa fa-check-square"></i>list icons</li> </ul> stacked images: <span class="fa-stack fa-lg"> <i class="fa fa-camera fa-stack-1x"></i> <i class="fa fa-ban fa-stack-2x text-danger"></i> </span> i can't images aligned correctly, can see in fiddle: https://jsfiddle.net/uql4alyj/ does know how aligned correctly? thank in advance max this happening because .fa-stack class applies height , width , line-height of 2em stacked set of icons. quick way ensure non-stacked icons aligned stacked icons treat non-stacked icons one-icon stack themselves. you can achieve changing current markup of: <li> <i class="fa fa-camera-retro"></i> text </li&

ruby - How to decompose an integer into a array of integers -

lets have number of "things", instance 7 . but can store "things" in groups of maximum "2" units. need this: 7 ----> [2, 2, 2, 1] the obvious method if make loop through it def decompose(qty, group_max) ret = [] while qty > 0 if qty < group_max ret.push qty qty = 0 else ret.push group_max qty -= group_max end end ret end decompose 7, 2 while works... not ellegant . wondering if maybe there method in integer or array structure can use improve code. i find cleaner things like myarray.map {|x| ... } and wondering if there similar might me this. you can as: qty = 15 # group_size = 2 count_of_groups = qty / group_size result = [group_size] * count_of_groups remaining = qty % group_size result += [remaining] if remaining != 0 result # [2, 2, 2, 2, 2, 2, 2, 1]

prestashop - How to block presta for unregistered users? -

how can disable access presta unregistered users (b2b solution)? after registration want user account must accepted administrator? how can make this? you can check if visitors logged in or not , redirect authentication page. able accept new registrations, can use hook triggers after new account creation , disable account accept later backoffice.

php - Delete WordPress posts with no traffic and 301 redirect -

i have site in wordpress many posts. have excel file url of posts has had traffic in site since last year. we need delete every post not in list. there easy way find urls delete? also, every deleted post should redirected towards other posts. i have searched plugins not find per requirement.

php - Unable to display product images in magento frontend -

i wrote small module filter custom products , display on frontend. i'm getting success in displaying products magento unable load our product images. when refresh page success getting few images. here url consideration: https://bombaytrooper.com/magic-search?design=+hungry+gym+gaming&gender=63 here code product attributes $collection = mage::getmodel('catalog/product')->getcollection(); $collection->addattributetoselect('image'); $collection->addattributetoselect('small_image'); $collection->addattributetoselect('thumbnail'); $collection->addattributetoselect('product_url'); $collection->addattributetoselect('id'); $collection->addattributetoselect('name'); $collection->addattributetoselect('pricehtml'); $collection->addattributetoselect('short_description'); $collection->addattributetosele

php - Symfony - BinaryFileResponse returns a ResponseHeader, but no file -

currently trying serve static pdf file not within web directory ($reasons). i applied $filepath = $this->gettargetfile($level, $name); $response = new binaryfileresponse($filepath); $response->headers->set('content-type', 'application/pdf'); $response->setcontentdisposition( responseheaderbag::disposition_inline, $filename ); return $response; and profiler shows there response correct headers, there no document view , no download prompt whatsoever. there missing? /** target file */ public function gettargetfile($level, $name) { return $this->kernel->locateresource($staticpath . $level . '/' . $name); } some nerves spent, but: i created form via javascript , submitted needed parameters new window ( thanks this ), made job. if has "cleaner" solution, i'm open suggestions :)

child process - Electron's app.relaunch() loose stdio -

using chokidar.watch(mainfile).on('change', () => { app.relaunch(); app.exit(0); }); i can have electron app auto-reload on source change. since main process killed, loose terminal output necessary debugging. there way use app.relaunch() retaining stdio of parent process?

javascript - Formatting Date/Time in Typescript -

i've been having trouble trying date object in typescript format way want to. i have class module defined as: export class module { constructor(public id: number, public name: string, public description: string, public lastupdated: date, public owner: string) { } getnicelastupdatedtime(): string { let options: intl.datetimeformatoptions = { day: "numeric", month: "numeric", year: "numeric", hour: "2-digit", minute: "2-digit" }; return this.lastupdated.tolocaledatestring("en-gb", options) + " " + this.lastupdated.tolocaletimestring("en-gb", options); } } when call method following code: let date = new date(1478708162000); // 09/11/2016 16:16pm (gmt) let module = new module(1, "test", "description", date, "test owner"); console.log(module.getnicelastupdatedtime()); i

javascript - svg rotation, scale and translate with mouse -

trying apply rotation, move , resize using mouse on svg element. here can test this. currently worked on south control, center control , rotate control. rotation works fine, can rotate, stop , again rotate. after move element dragging center point, rotation flickers first time , rotation starting point different. belive because center position changed after translate. tried recalculating center position did not work. and scaling moving element instead of increasing size. please me on this. missing adjustments here. note: first have draw path mouse controls on it. var svg = document.queryselector('.container'); var svgns = 'http://www.w3.org/2000/svg'; var path = document.createelementns(svgns, 'path'); svg.appendchild(path); var points = []; var resizer_instance = null; var boundingbox = svg.getboundingclientrect(); var tosvgpath = function(points) { var svgpath = ''; (var = 0; < points.length; i++) { va

sql server - Building SQL Query with NULL check -

this question has answer here: apply conditional filtering in clause 2 answers i writing stored procedure in sql server 2014 , given below create procedure [dbo].[getusers] @role int select firstname, lastname users firstname = 'something' if nullif(@role, '') not null begin , role = @role end end with throwing syntax error @ and i want build query dynamically , exclude null , '' values you can't build dynamic query that. can use boolean logic select firstname, lastname users firstname = 'something' , (@role null or @role = '' or role = @role)

javascript - Wait for async .done() in every iteration of loop -

so, have function locks this: function getmaindata() { var dfd = $.deferred(); $.getjson('my string pass', function(result) { if (result !== undefined) { dfd.resolve(result); } }) return dfd.promise() } function getspecificdata() { var dfd = $.deferred(); var myarray = []; (var = 0; < 5; i++) { getmaindata().done(function(result) { myarray.push(result) dfd.resolve(myarray) //this lost. }) } return dfd.promise() } getspecificdata().done(function(result) { console.log(result); }) i think know how promises work if chain them can not make for-loop wait async call finish before next iteration. can please me? a loop has no means of delaying next iteration wait asynchronous code. you can solve using function called recursively instead function getmaindata() { return $.getjson('my string pass'); } function ge

twitter - Tweetinvi keep stream alive -

i run web app using amazon ec2 servers , use tweetinvi maintain user , filtered twitter stream. need streams running 24/7. i using streamstopped event keep stream running continuously described here: how keep streaming continuously - tweetinvi i starting stream in startup class using hangfire ( http://hangfire.io/ ) maintain stream connection in background happy other way. my application kept alive 24/7 if no users connect. however, after while, no exception raised, streams stop. is there better way maintain , keep alive stream? my keep-alive function wasn't working 100% , application died during night when no users connected hence streamstopped event wasn't called. use uptime robot hit site every minute keeping alive.

Meteor App is not running on android emulator -

i have installed jdk , created avd. after running command meteor run android --verbose, saying no emulator specified defaulting nexus_5. after running command : emulator -avd emulator-5584 getting - home defined not find emulator-5584.ini file in $home/.android/avd (note: avd searched in order of $android_avd_home,$android_sdk_home/.android/avd , $home/.android/avd) thanks in advance

.net - Form locks up on close when background thread accesses textbox -

a background thread needs update label on form. generates event. event handler looks this void showresults(object sender,eventargs e) { .... settext( results.tostring() ); } delegate void settextcallback(string text); private void settext(string text) { if (this.resultslabel.invokerequired) { settextcallback d = new settextcallback(settext); this.invoke(d, new object[] { text }); } else { this.resultslabel.text = text; } } the label being updated , seems working. problem when close form ui locks up. if comment out statement settext( results.tostring() ); then form closes correctly. how close down properly?

Android ANR on registerReceiver -

my app crashes on line: localbroadcastmanager.getinstance(context.getapplicationcontext()). registerreceiver(handler, new intentfilter("data_update")); in traces.txt found out, registerreiceiver blocked thread, broadcast send. schedstat=( 0 0 0 ) utm=141 stm=2 core=0 @ android.support.v4.content.localbroadcastmanager.sendbroadcast(localbroadcastmanager.java:~240) how can avoid situation?

java - Why the constructor function didn't executed? -

why constructor function registerproxy() didn't executed when called " r response = proxy.callapisync(request);" ? public class soacaller { private static registerproxy proxy = new registerproxy(); ; public static <t, r> r callapisyn(t request){ r response = proxy.callapisync(request); return response; } } public class registerproxy { private static hashmap<string, basesoaimplement> cache = new hashmap<>(); public registerproxy(){ try { cache.put(gethotelstaticinforequesttype.class.getname(), new gethotelstaticinfoimpl()); } catch (exception ex){ exceptionutils.getstacktrace(ex)); } } new registerproxy(); only ran first time classloader encounters class soacaller . that far earlier calling of callapisyn

C - Get two closest int numbers in an array -

i have array asked user enter. (i asked number of numbers in array , asked numbers). question how compare numbers , find 2 closest ones ? so, example if user enters 4 numbers like: 3, 5, 8, 9. program should see 8 , 9 closest ones ? after need subtract 2 closest numbers. this code far: int main() { int n; int c; scanf("%d", &n); (c = 0; c < n; c++) scanf("%d", &array[c]); sort array first. take 3 temp variables n1=0, n2=0, diff=0. iterate sorted array assign n1, n2 a[i], a[i+1], a[] array , iterator. if absolute(a[i]-a[i+1]) < diff diff = absolute(a[i]-a[i+1]); n1 = a[i]; n2 = a[i+1]; when iteration completes have closest elements in n1 , n2. n.b. please take care of array out of bound a[i+1], have given approach.

linux - Filter lines with the other set of lines in Bash -

i have lines on standard input $printf "c\nb\na\n" c b and want filter out lines (or substrings or regexps - whatever easier) appear on other standard input: $printf "b\na\n" b i expect c when entries filtered. i've tried $printf "c\nb\na\n" | grep -v `printf "b\na\n"` but i'm getting grep: a: no such file or directory how can perform filtering of standard input lines returned other command? you can use grep 's -f option: matching control -f file, --file=file obtain patterns file, 1 per line. [...] and use <(command) syntax using command's output content used: $ printf "c\nb\na\na\nc\nb" | grep -vf <(printf "a\nb\n") c c

r - Rserve with java. Eval fail error 127 -

i got error , dont know , couldnt find other solution on site. run rserve in background on computer , connect local host. cant frame popup. here code: package rservedemo; /** * * @author carl */ import java.awt.*; import java.awt.event.*; import org.rosuda.rengine.*; import org.rosuda.rengine.rserve.*; public class plotdemo extends canvas { public static void main(string[] args) { try { string device = "jpeg"; rconnection c = new rconnection ((args.length>0)?args[0]:"127.0.0.1"); if (c.parseandeval("supresswarnings(require('cairo',quietly=true))").asinteger()>0) device="cariojpeg"; else system.out.println("(consider installing cairo package better bitmap output)"); rexp xp = c.parseandeval("try("+device+"('test.jpg,quality=90))"); if (xp.inherits("try error")) { system.err.println("can't open &q

node.js - Why Aws s3 Bucket creating 0 bytes file while uploading file with creating new folder dynamically? -

Image
i pretty new aws s3 bucket,i trying upload files different folders creation dynamically.even though script working.my s3 bucket creating 0 bytes file,and name equal folder last uploaded. this server.js import express 'express'; import path 'path'; import webpack 'webpack'; import webpackmiddleware 'webpack-dev-middleware' import webpackhotmidleware 'webpack-hot-middleware'; import bodyparser 'body-parser'; import aws 'aws-sdk'; import open 'open'; import uuid 'uuid' import webpackconfig './webpack.config'; // create s3 client aws.config.loadfrompath('c.json'); var s3 = new aws.s3(); // create bucket , upload let app = express(); app.use(bodyparser.json({limit:"50mb"})); app.use(express.static('public')); const compiler = webpack(webpackconfig) app.use(webpackmiddleware(compiler,{ hot:true, publicpath:webpackconfig.output.publicpath, noinfo:true })

asp.net - Create crystal report in webservice method -

ok have soap web service used mobile application, want add new webmethod creates report through crystal report , save in folder. don't want use reports published webservices, want report created directly webmethod. how be? nb: using visual studio 2010 , vb.net language. you need download cr_for_vs package , use reportdocument class export folder edit: code you need reference crystal libraries in project use reportdocument class. code below should give start. reportdocument rep = new reportdocument(); rep.load(server.mappath("~/report/quote.rpt")); rep.setdatabaselogon(global.sqlusername, global.sqlpassword, global.sqlserver, global.sqldatabase); foreach (reportdocument subrep in rep.subreports) { subrep.setdatabaselogon(global.sqlusername, global.sqlpassword, global.sqlserver, global.sqldatabase); } rep.setparametervalue("quoteid", sessionstore.current.currentquoteid); re

angularjs - ng-include loading partial partial only once -

ng-include driving me nuts , hope can help. have html code on master page <div id="subviewpartial"> <ng-include class="col-md-8 col-md-offset-2" src="currentpartial"> </ng-include> </div> and in angularjs have following functions $scope.createunit = function (link) { $rootscope.action = 0; $rootscope.id = 0; $scope.currentpartial = window.location.origin + link; settimeout(subviewservice.showsubview(), 500); }; $scope.createuser = function (link) { //////console.log(link); $scope.currentpartial = window.location.origin + link; settimeout(subviewservice.showsubview(), 500); }; now, if fire createuser once, , execute createunit serveral times, subview rotate between createuser , createunit though not calling createuser. here subviewservice well baapp.service('subviewservice', function () { this.showsubview = function () { var subview

php - echo selected in chosen select -

i using chosen select drop down show auto complete drop down. want set selected value edit. tried following code works normal select option not working chosen select <select class="chosen-select" > <option value=""></option> <?php if(!empty($list)) { foreach($list $d) { ?> <option value="<?php echo $d->id; ?><?php if($d->id == 2) { echo "selected"; } ?>"><?php echo $d->name; ?></option> <?php } } ?> </select> you putting selected inside value attribute, need write after : <select class="chosen-select" > <option value=""></option> <?php if(!empty($list)) { foreach($list $d) { ?> <option value="<?php echo $d->id; ?>"<?php if($d->id =