Posts

Showing posts from August, 2013

hp uft - UFT/QTP=Is it possible to get 'Transaction' time from result viewer? -

Image
i using 'transaction' feature find out exact loading time. getting transaction time in 'result viewer'. possible transaction time in excel or possible store transaction time in variable? please find attached screen shot more details thanks use following functions, call these @ appropriate places. if want use once remove function syntax. function starttimer itimerstart = timer() end function function stoptimer itimerstop = timer() datatable("timetaken", dtlocalsheet) = itimerstop - itimerstart end function

android - use finger print sensor as bio metric -

i new android bio-metric integration. is possible use android devices screen or fingerprint sensor biometric device users can login app without having use email or password. this , this , this references. is using external fingerprint scanner or biometric option or there alternative solution ? this code i've used reference. please have @ , let me know how can users fingerprint. mainactivity extends appcompatactivity { private fingerprintmanager fingerprintmanager; private keyguardmanager keyguardmanager; private keystore keystore; private keygenerator keygenerator; private static final string key_name = "example_key"; private cipher cipher; private fingerprintmanager.cryptoobject cryptoobject; @targetapi(build.version_codes.m) @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); keyguardmanager = (keyguardmanager) getsystemservice(keyguard_serv...

intellij idea - ruby-debug-ide failed to build gem native extention in Windows -

i have installed debase, when try gem install ruby-debug-ide, still failed build gem native extention: error: error installing ruby-debug-ide-0.6.1.beta2.gem: error: failed build gem native extension. c:/ruby22-x64/bin/ruby.exe mkrf_conf.rb installing base gem unable resolve dependency: user requested 'debase (> 0)' c:/ruby22-x64/lib/ruby/2.2.0/rubygems/resolver.rb:439:in `resolve_for_zero' c:/ruby22-x64/lib/ruby/2.2.0/rubygems/resolver.rb:350:in `resolve_for' c:/ruby22-x64/lib/ruby/2.2.0/rubygems/resolver.rb:196:in `resolve' c:/ruby22-x64/lib/ruby/2.2.0/rubygems/request_set.rb:358:in `resolve' c:/ruby22-x64/lib/ruby/2.2.0/rubygems/dependency_installer.rb:473:in `resolve_dependencies' c:/ruby22-x64/lib/ruby/2.2.0/rubygems/dependency_installer.rb:373:in `install' mkrf_conf.rb:35:in `rescue in <main>' mkrf_conf.rb:28:in `<main>' rake failed, exit code 1 gem files remain installed in c:/ruby22-x64/lib/ruby/gems/2...

java - Retrieve cookies from browser in stand alone app -

i want access cookies browser (for example firefox) in java stand alone app. can access cookie database or bad approach? there api might solving problem? cookies stored browser in it's own, proprietary form, i.e. each browser can store in different way. format change between releases of same browser. there no public apis available ask browser it's cookie-db. therefore doesn't make sense try build generic solution tries access browser's cookie db. if want create application , want use firefox cookies db, not problem , should work. firefox open source , can see how stores it's cookies in db. more recent versions use sqlite db, , file stored here https://superuser.com/questions/387372/where-does-firefox-keep-cookies

Passing numerical string with leading zero from asp.net razor to javascript - stange behavior -

i'm using javascript plug in highlight text on web page. the funktion simple: $("p").highlight("abc", true); this working perfect , highlights every occurence of 'abc' in every 'p' tag. when call fkd way in razor: @{ string marktext = "abc"; } <script> $("p").highlight(@marktext, true); </script> it works fine. but when set numerical string leading 0 e.g.: @{ string marktext = "0123"; } the javascript gets "83". by way found out 123 octal = 83 decimal. so question how can pass string "0123" straight forward javascript without transform? best regards gertr

python - How can I apply decorator to a superclass method in a subclass? -

say, have following situation, class a(): def something(): ... ... ... class b(a): def use_something(): ... ... # now, @ point want something() decorated # decorator. but, since defined in base class, # not getting how decorate here, in subclass. self.something() ... ... now, in class b, want use something() class a, want apply decorator it. cannot decorate in class a, since there different decorators want apply @ different places. say, class c(a) , want use something() here well, different decorator. so, coming original question; how can apply decorator superclass's method in subclass? any particular reason why can't override something() ? class a(): def something(self): ... class b(a): def use_something(self): ... self.something() ... def something(self): # "decorator" stuff super().so...

php - Adding content via wordpress admin -

i'm developing wordpress theme have set of custom pages , each page has it's own content! example, there custom page content done using html need able change content of single paragraph using wordpress admin panel. how do using wordpress framework? there special way of adding custom editable fields specific content locations in page? just add meta box , values post meta show in html you can generate metabox site without programing skills https://jeremyhixon.com/tool/wordpress-meta-box-generator/ and meta field value below code get_post_meta(get_the_id(), 'meta_key', true);

sql server - SQL add a variable to a query -

how create variables specified once , used in queries later in script? these variables may used multiple times in query, , in multiple queries in script. use @x such variable in examples below. what want like: declare @query nvarchar(1000) declare @x nvarchar(40) set @x = 'test' set @query = 'select [name] , ' + @x + ' [testcase] mytable' exec (@query) -- returns "invalid column name 'test'" which returns error mentioned above. achieve equivalent of: declare @query nvarchar(1000) declare @x nvarchar(40) set @x = 'test' set @query = 'select [name] , ''test'' [testcase] mytable' exec (@query) -- returns e.g. -- name testcase -- alice test -- bob test i note following doesn't work , returns same error first: declare @query nvarchar(1000) declare @x nvarchar(40) set @x = 'test' set @query = 'select [nam...

javascript - OpenLayers-2.13.1 + Cordova not panning well in WP10 or WP8.1 -

i have used html { -ms-touch-action: none; touch-action: none; } in styles and this.cordovaview.disablebouncyscrolling = true; on .cs file of cordova mainpage.xaml.cs file. with these fixes can advance much: before state: map bounces on every touch, no pan possible after state: no bounce anymore, pan freezes in 1 minute of usage. how map functioning pan events map not freeze, stop working after swipes there , here? why map "remembers" touch event outside map , zoom happens 1 finger only. my sources: [1] https://github.com/vilic/cordova-plugin-fix-wp-bouncing [2] prevent scrolling out of cordovaview in cordova windows phone 8 [3] https://github.com/openlayers/ol2/issues/1290 catcha! i limited screen size map fit in 1 screen without scroll , style thing mentioned in question making bounce go away. i limited style page dynamically adding class html , limiting fix class: js function applyclass(name,element,doremove){ ...

angularjs - How to insert array to mongodb using node.js -

i have array [ 570dec75cf30bf4c09679deb, 56fe44836ce2226431f5388f ] . want insert new collection named notifications { "_id": objectid("57bd39c9734ff3602a312b33"), "userid": objectid("570dec75cf30bf4c09679deb") } , { "_id": objectid("57bd39c8734ff3602a312b32"), "userid": objectid("56fe44836ce2226431f5388f ") } i have written query in node.js insert inserting last element of array 2 times this { "_id": objectid("57bd39c9734ff3602a312b33"), "userid": objectid("56fe44836ce2226431f5388f ") } , { "_id": objectid("57bd39c8734ff3602a312b32"), "userid": objectid("56fe44836ce2226431f5388f ") } the query have written this app.js router.post('/creatlist', function(req,res){ console.log(req.body.email); var emails = req.body.email; if(req.body.wdata.wishlisttype == 'shared...

java - Establishing JDBC through SID -

i connecting oracle 11g db trough java program. using service name , not sid. addr = jdbc:oracle:thin:@hostip:1521:servicename class.forname("oracle.jdbc.oracledriver"); connection con = drivermanager.getconnection(addr,un,pw); statement stat = con.createstatement(); resultset rs = stat.executequery(select * table); this works great. able connect db , retrieve data. however, if pass service id instead of service name, code doesn't work! exception. tried solution mentioned here - java jdbc - how connect oracle using service name instead of sid . still see same exception.

php - Regional subdomains -

i want make regional subdomains of current site.com - city1.site.com , city2.site.com , don't want copy files original domain subdomain. possible show on subdomain city1.site.com same info on site.com set 1 variable, $city = 123 ? variable on city1.site.com can show more specific contacts , products city. i'm new subdomain please help, site on php & mysql. thank you! if have few regions, can manually create subdomains each region , point domains same folder main site. in script grab host , match regions , assign desired value variable. <?php if($_server['http_host'] === 'city1.site.com') { $city = 123; } else if($_server['http_host'] === 'city2.site.com') { $city = 223; } if have many regions , want dynamic match, can match subdomain main site path , inside script can use method subdomain , search in database. example: <?php $subdomain = strstr($_server["http_host"], '.', true); $city =...

How to pass javascript variable to a PHP file in Laravel 5.1? -

i need know need passing javascript variable php file. all have done till created form inputs values alongside have javascript variable need pass same location of form. so how achieve in laravel 5.1? try jquery ajax method, in can pass js variable , use in php on other server side scripting language. ajax documentation syntax: $.ajax({ url: 'process.php', method: 'post', data: { variable1 : value1, // can use these variable in process.php file variable2 : value2 }, success: function(response) { } });

Android Studio Warning: Missing density variation folders in 'src\main\res': drawable-xxxhdpi -

in android studio, after using analyze >> inspect code... , got following warning: missing density variation folders in 'src\main\res': drawable-xxxhdpi but default, there no such folder after creating empty project. how fix it? you have warning not because folder missing, because recommended create density-specific graphics in projects. in case, don't have graphics xxxhdpi density, , android studio reminds of that. create folder manually inside res folder, regular drawable folder is. more on density specific graphics in supporting multiple screens .

javascript - Mouseenter and Mousemove is not triggered in Desktop (touch display ) in Ionic Framework -

i have run tooltip sample using ionic framework in google chrome. in desktop mode, when hover element, tooltip shown when tap(touch dispaly) element, tooltip not triggered. in tooltip source, have bound mouseenter , mouseleave event non-touched device in responsive mode, when tap/hover target element, tooltip shown. in tooltip source, have bound tap , mouseleave event touch device. my question is, when tap focus target element in desktop(touch display), why mouseenter , mouseleave not triggered. i not find these mouse events documented in ionic docs. however, gestures documented here http://ionicframework.com/docs/components/#gestures might able use (tap) , work.

c - How does the system knew that an address being accessed is constant or not -

writing constant variable using pointer giving run time error. const int i; int *p; void main() { p = (int*)&i; *p = 10; // causes runtime error } but in windows system running ram itself. when printed address of const variables , normal variables, can see in different offsets. how system know address being accessed pointer const one? strictly speaking, code yields undefined behavior according c-language standard. in practice, linker has placed variable i in ro section of executable image. so write-operation *p = 10 resulted in memory-access violation (aka segmentation fault ).

how to match database day with calendar day in asp.net -

sqlconnection con = new sqlconnection(strconnstring); con.open(); sqldataadapter sda = new sqldataadapter("select availability doc_availabledays dname='" + label2.text + "'", con); dataset dss = new dataset(); sda.fill(dss, "doc_availabledays"); datarow drr = dss.tables[0].rows[0]; drr["availability"].tostring(); if (!e.day.isothermonth) { foreach (datarow dr in dss.tables[0].rows) { if ((dr["availability"].tostring().equals(dayofweek.monday))||(dr["availability"].tostring().equals(dayofweek.tuesday))||(dr["availability"].tostring().equals(dayofweek.wednesday))) { e.cell.backcolor = color.palevioletred; } } } i think it's better use safe casting. string [] data = { "monday", "thursday", "wednesday", "tuesday" }; dayofweek d; var dt = datetime.now; foreach (var st in dat...

c# - Sorting Using Linq Where list contains alphabets and Numerics -

imagine have string list or custom list in 1 of string field contains following data a 5 d 3 1 b 2 4 c how sort list output a b c d 1 2 3 4 5 where orderby gives following answer 1 2 3 4 5 b c d much simpler method: string inputstring = "a5d31b24c"; var output = inputstring.orderby(x => char.isdigit(x)).thenby(x=>x).tolist(); the first orderby sort list : abcd53124 , because orderby evaluate boolean values in order of false true . following thenby give expected result abcd12345

data structures - Complexity of the algorithm that represnts the expression (n*(n-1)/2) -

for equation : (n(n-1))/2 if write algorithm represent equation, complexity of such algorithm? (n*(n-1))/2 can represented (1 + 2 + ... + (n-1)) . finding sum using expanded expression have o(n) time complexity , o(1) space complexity. if don't expand (n*(n-1))/2 sum-expression, takes o(1) time complexity (n*(n-1))/2 . why o(n) expanded(sum) expression? since going addition considering (n-1) elements 1 one. o(n) considered same o(n-1) .

visual studio - "Recently Visited Sites" Application in C# -

let me clear air first: yes, classwork. no, don't want answer. stuck , looking assistance. i'll specific can. think best way can post prompt book gives: create project named recentlyvisitedsites contains form list of 3 linklabels link 3 web sites choose. when user clicks linklabel, link site. when user's mouse hovers on linklabel, display brief message explains site's purpose. after user clicks link, move selected link top of list, , move other 2 links down, making sure retain correct explanation each link. my main problem can't find way make "list" of linklabels both allows me use linklabels in first place and lets me rearrange items in list-fashion. here best go @ it: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; namespace recentlyvisitedsites { publi...

php - Checking to see if a conversation already exists Laravel -

hey guys i'm building eloquent query see conversation array of participants exists. reason can't have same conversation same participants created more once. here's eloquent query: $convos = conversation::wherehas('participant', function ($query) use ($participantids) { $query->wherein('user_id', $participantids) ->groupby('convo_id') ->havingraw('count(convo_id)='.count($participantids)); })->get(); $participantids equal [1, 2] or [1, 2, 3] example. how check if conversation exists id's in $participantids? above query return conversation has any of participants in array so if have conversation john (2) , matt (4) try make conversation me , john query show have conversation john already

Unable to receive share image - Android 6.0 -

i using code provided afilechooser able shared image inside application. images gallery work ok if use image inside google chrome , try share it, gives me npe imagepath null. string imagepath = getpath(getactivity(), imageuri); my uri identified mediastore (and) general code: else if ("content".equalsignorecase(uri.getscheme())) { if (isgooglephotosuri(uri)) return uri.getlastpathsegment(); return getdatacolumn(context, uri, null, null); } however inside getdatacolumn() cursor dump follows: 08-24 12:00:58.196 13186 13256 receivephotos d cursor is: >>>>> dumping cursor android.content.contentresolver$cursorwrapperinner@e110803 08-24 12:00:58.196 13186 13256 receivephotos d 0 { 08-24 12:00:58.196 13186 13256 receivephotos d _data=null 08-24 12:00:58.196 13186 13256 receivephotos d } 08-24 12:00:58.196 13186 13256 receivephotos d <<<<< 08-24 12:00:58.196...

eclipse - android - heap size error -

i developed android game using eclipse, have many resources , images in it, using sdp size unit sizing images , fine in devices: https://github.com/intuit/sdp also picasso library load images on imageviews, the main problem in devices out of heap size memory error. question that, have declare different images different sizes in subfolders ldpi, mdpi , so... if using sdp , picasso? android when loading large background or lot of pictures, leading memory overflow (out of memory error), based on experience have dealt these issues , other developer experience, finishing solution follows (parts of code , text source can not verified) : option one, calling attention method of reading image, appropriate compression try not use or setimageresource setimagebitmap bitmapfactory.decoderesource or set large image, because these functions after completion of decode, createbitmap java layer complete, need consume more memory. instead, use first method bitmapfactory.decodestrea...

asp.net mvc - Fluent Validation doesn't validate the entire form the first time -

so i'm using fluent validation on form. when click submit , have nothing entered, validation error date of birth. if enter dob, validation first name. why happening? can't figure out wired wrong. my form: @using (html.beginform()) { @html.antiforgerytoken() @html.hiddenfor(customer => customer.customerincomeinfo.customeremploymentinfomodel.employermodel.id) <!-- basic customer info --> <fieldset> <legend>customer info</legend> @html.validationsummary(false, "please correct errors , try again", new { @class = "text-danger" }) <div class="row"> <div class="col-md-6"> <dl class="dl-horizontal"> <dt>@html.labelfor(model => model.firstname)</dt> <dd>@html.editorfor(model => model.firstname, new {@...

javascript - THREE JS computeVertexNormals() performance -

i have large buffer geometry, around 4 million vertexes, needs have small area of shading updated. randomly update vertexnormals, causes lag. have tried using updaterange.offset of geometry( how update large buffergeometry? ) looking source code dont think effects vertexnormals() function. loop me 1,000 times: grid.geometry.attributes.position.array[ (array_position + 2) ] = _position[2] - webglztranslate ; grid.geometry.attributes.color.array[ (array_position) + 0 ] = color.r; grid.geometry.attributes.color.array[ (array_position) + 1 ] = color.g; grid.geometry.attributes.color.array[ (array_position) + 2 ] = color.b; then set update: if(minarrayposition < infinity){ grid.geometry.attributes.position.updaterange = {}; grid.geometry.attributes.position.offset = minarrayposition; grid.geometry.attributes.position.count = maxarrayposition - minarrayposition; grid.geometry.attributes.position.needsupdate = true; grid.geometry.verticesneedupdate = t...

r - Melt data.table according to nested list -

i had data.table this: library(data.table) dt <- data.table(a = c(rep("a", 3), rep("b", 3)), b = c(1, 3, 5, 2, 4, 6)) i needed perform operation (forecast) on values each a , decided put them in list, this: dt <- dt[, x := .(list(b)), = a][, .sd[1,], = a, .sdcols = "x"] now wanted "melt" (that's thing comes mind) dt original form. i few levels of a this: dt2 <- rbind(expand.grid(dt[1, a], dt[1, x[[1]]]), expand.grid(dt[2, a], dt[2, x[[1]]])) but of course, solution impractical more levels of a . i've tried dt2 <- dt[, expand.grid(a, x[[1]]), = a] which results in dt2 ## var1 var2 ## 1: 1 ## 2: 3 ## 3: 5 ## 4: b 2 ## 5: b 4 ## 6: b 6 it's interesting notice var1 doesn't follow "a - b" pattern expected (but @ least a remains). is there better approach achieve this? edits expected output result of dt2[, .(a, var2)] corrected ...

css - Bootstrap Navbar Unexpected Bottom Spacing -

Image
this has been asked several times. i've checked several different answers, , found no resolution in of them. i've set margin-bottom: 0 navbar. i'm not using fixed-top navbar. html tags closed. none of resolution in questions i've seen have helped. the mcve super simple. feel answer must well, first experience bootstrap, , don't see it. here's bootply . completeness, i'll copy material here. html <!-- navigation bar --> <nav class="navbar navbar-default"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#">brand</a> </div> <ul class="nav navbar-nav"> <li onclick="navigatetosettings()" id="settingsheaderitem"><a href="#">settings</a></li> <li><a href="#">page 1</a></li> ...

Can't upgrade cocoapods from 1.0.0 to 1.0.1 -

$ gem update cocoapods updating installed gems nothing update $ pod --version 1.0.0 ========================================== $ gem install cocoapods successfully installed cocoapods-1.0.1 parsing documentation cocoapods-1.0.1 done installing documentation cocoapods after 3 seconds 1 gem installed $ pod --version 1.0.0 how can upgrade 1.0.1? ======= i think problem installed 2 cocoapods via sudo gem install cocoapods , gem install cocoapods remove of them , install again, version correct now. you can upgrade cocoapods run following cmd: upgrade latest version running gem update cocoapods upgrade spec version running gem install cocoapods -v 1.0.1

javascript - How do you setup processingJS on html? -

how run processingjs script on html page? send me test .html , auxiliary code files me idea? let's wanted run rectangle: rect(50,50,50,50); everything want know on page: javascript quick start | processing.js but basically, need create html file loads processing.js library, write processing.js code , load .pde file canvas tag on page. looks this: <!doctype html> <html> <head> <title>hello web - processing.js test</title> <script src="processing-1.3.6.min.js"></script> </head> <body> <h1>processing.js test</h1> <p>this first processing.js web-based sketch:</p> <canvas data-processing-sources="hello-web.pde"></canvas> </body> </html> the easiest way use javascript mode processing editor (you might have use version 2.2.1), click run. can view files created editor (go view > sketch folder) better idea of what's going o...

unix - HTTP 400 - URL - -

i have mvc site controller couple of methods partner post to. can post web server local machine, across wan successfully. my partner tries post unix server , results in http 400 - url. i know url good, , know response because can post multiple different network, posting windows. he posting: post domain.com/controllername/action http/1.0 content-type: application/x-www-form-urlencoded content-length: 136 (content-length off because changed request body data security purposes) parm1=value1%0d%0aparm2=value2%0d%0aparam2=value3%0d%0a i can take data , post windows machine server fine. we looking @ http 1.0 value (this can't changed side) , if perhaps iis 8.5 on server 2012 r2 having issue it. has had experience this? if so, have information on how can resolve issue? in event else has issue this, post solution. the code partner's unix machine opening connection domain.com when posted posting domain.com/controller/action. however, after careful res...

php - Laravel 5.2 Register while logged -

i need access register form while i'm logged, im starting use laravel 5.2 , guess auth not let me being able register , logged @ same time, how do? here code. routes route::auth(); route::get('/home', 'homecontroller@index'); homecontroller class homecontroller extends controller { /** * create new controller instance. * * @return void */ public function __construct() { $this->middleware('auth'); } /** * show application dashboard. * * @return \illuminate\http\response */ public function index() { return view('home'); } } dont matey! attached group middleware "guest" route governed middleware useless. need remove "guest" middleware specific route. your authcontroller should like; <?php namespace app\http\controllers\auth; use app\http\controllers\controller; use illuminate\foundation\auth\throttleslog...

c# - How to write a wrapper for AreaRegistration -

i writing wrapper arearegistration constrain patterns different areas. code looks below: public abstract class wrappedarearegistration : arearegistration { public abstract override string areaname { get; } public override void registerarea(arearegistrationcontext context) { var uri = string.format("wrapper/{0}/{{controller}}", areaname); context.maproute( string.format("{0}_default", areaname), uri, new { action = "index" }); } } in area a, there class called public class : wrappedarearegistration { public override string areaname{ get{ return "a"; } } and have area b same code above. public class b : wrappedarearegistration { public override string areaname{ get{ return "b"; } } the outcome of runtime is: area can routed area b hit 404 error. however, when traditional way,...

javascript - PokeAPI + Angular: How to get pokemon's evolution chain -

i angular novice , learning little trying pull evolution chain each pokemon using pokeapi having difficult time because of deep nesting. a typical response object returned this: { "baby_trigger_item": null, "id": 2, "chain": { "evolution_details": [], "evolves_to": [ { "evolution_details": [ { "min_level": 16, "min_beauty": null, "time_of_day": "", "gender": null, "relative_physical_stats": null, "needs_overworld_rain": false, "turn_upside_down": false, "item": null, "trigger": { "url": "http://pokeapi.co/api/v2/evolution-trigger/1/", "name": "level-up" }, "known_move_type": nu...

angularjs - cucumber shows step-def to be implemented even when it is implemented -

i using cucumberjs , protractor framework test angular website. have question regarding cucumber- everytime run single feature using cucumber (example cucumber "feature/abc.feature") gives me set of step-definitions need implemented feature.and gives me same after have implemented step-def also. is usual behavior of cucumber? why doesn't evaluate step-def have been implemented or not? cheers

java - hbm2ddl update is giving error in spring boot -

i using spring boot application entity manager persist data in oracle database. application.properties follows hibernate.dialect: org.hibernate.dialect.oracle9idialect hibernate.show_sql: true hibernate.hbm2ddl.auto: update entitymanager.packagestoscan: com.abc.xyz my configuration file contains bean follows @bean public localcontainerentitymanagerfactorybean entitymanagerfactory() { localcontainerentitymanagerfactorybean entitymanagerfactory = new localcontainerentitymanagerfactorybean(); entitymanagerfactory.setdatasource(datasource); entitymanagerfactory.setpackagestoscan(env.getproperty("entitymanager.packagestoscan")); hibernatejpavendoradapter vendoradapter = new hibernatejpavendoradapter(); entitymanagerfactory.setjpavendoradapter(vendoradapter); properties additionalproperties = new properties(); additionalproperties.put("hibernate.dialect", env.getproperty("hibernate.dialect")); additionalproper...

vim - Are there any auto-indent tools for device tree source (.dts, .dtsi) files? -

does know of tools can indenting .dts/dtsi files? vim not seem have 1 , emacs has dts-mode not handle c-style multi-line comments in way prefer. there other source code indentation or formatting tools known work device tree files? anyway, since there doesn't appear any, i've started working on vim-dts-indent . it's not yet works okay on reasonably-sized blocks. my main goals fall cindent when in middle of c-style comment avoid lots of work , integrate un-indentation of c preprocessor directives.

wampserver - Use Ghostscript with WAMP -

after downloaded ghostscript windows , installed it, wonder how can make wamp recognize can use shell_exec ? i specify added ghostscript directory in system path , when run command line, works fine. i have wampserver 2.5 , windows 7.

java - Where does @serverendpoint path get mapped (Websockets) -

Image
i have following @serverendpoint path websocket using spring framework: @serverendpoint(value="/serverendpoint", configurator = springconfigurator.class) my first question have website url www.example.com . serverendpoint path serverendpoint mapped? can access serverendpoint @ wss://example.com:$port/currentpage.html/serverendpoint ? or wrong way. i have wildfly 10 server running. based on question , told use following uri: var wsuri = "wss://" + document.location.hostname + ":8443" + document.location.pathname + "/../serverendpoint"; . however, when so, in google chrome, receive following error: websocket in closing or closed state. my console.log prints websocket has been connected, above error. doing wrong? as per wildfly server log, know serverendpoint mapped: [io.undertow.websockets.jsr] (serverservice thread pool -- 78) ut026003: adding annotated server endpoint class com.voice2.spring.web.controller.serverendpoint path /...

How to check Zookeeper connection in HBase? -

i want quick connection check zookeeper after creating configurations , before establishing connection hbase master java code. hbase api method checking zookeeper connection status in cluster? try following code configuration config = hbaseconfiguration.create(); config.set("hbase.zookeeper.quorum", "hbase"); config.set("hbase.zookeeper.property.clientport","2181"); after configured connection, can test it, using hbaseadmin.checkhbaseavailable(config); it test connection database, if zookeeper doesn't work error printed saying there problem zookeeper.

mysql - cannot open table after copying database -

i copied database folder old backups new mysql install today. can see database available after restarted mysql cannot connect of tables. following error. checked link cannot ideas fix issue. there step missed after copied database folder? > 2016-08-23t21:31:06.754512z 10 [warning] innodb: cannot open table dbtorontotrader/rawdatas internal data dictionary of innodb though .frm file table exists. please refer http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html how resolve issue. 2016-08-23t21:31:26.125763z 8 [warning] innodb: cannot open table dbtorontotrader/amibrokerscans internal data dictionary of innodb though .frm file table exists. please refer http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html how resolve issue. update: have data files old db mysql5.5 , copying them new mysql db mysql 5.7 ran mysqlcheck , can see errors. how can fix them? c:\program files\mysql\mysql server 5.7\bin>mysqlcheck -u root -p --auto-repair --check --a...

mysql - Error 1064 (42000) Stumped on my create table -

Image
create table chgtaxes ( po_no char(8) not null, change smallint not null, line_no smallint not null, stax_rate decimal(6,5) not null, utax_rate decimal(6,5) not null ); create unique index chgtax_1 on chgtaxes (po_no, change, line_no); i'm not sure issue in statement. seems popping on other tables , feel problems related. please! edit: here actual error: found there stark difference in number of reserved words last time built database. able resolve issues.

java - Why ReentrantLock with Conditions can be acquired by two threads in ArrayBlockingQueue -

it might stupid question can't understand why single reentrantlock can taken 2 different threads in class (it's simplified solution of arrayblockingqueue used play threads , locks): class samplethreadsafequeue { private reentrantlock lock = new reentrantlock(); private list<integer> list = new arraylist<>(); private condition notempty; private condition notfull; private volatile int count; public samplethreadsafequeue() { notempty = lock.newcondition(); notfull = lock.newcondition(); } public int take() { try { lock.lock(); system.out.println(thread.currentthread().getname() +": acquired lock in take()"); while (count == 0) { notempty.await(); } return extract(); } catch (exception e) { e.printstacktrace(); ...

How to convert Badgerfish style JSON to a .NET object or XML in C#? -

.net prefers newtonsoft json serializer/deserializer when using rest api. the d&b direct rest implementation uses badgerfish approach (which exist in java world (jettison namespace) json minor variations: d&b badgerfish . i map d&b badgerfish json responses .net classes. there github project https://github.com/bramstein/xsltjson/ enables conversion xml json (supporting badgerfish), how do opposite mentioned below: xsltjson supports several different json output formats, compact output format support badgerfish convention, allows round-trips between xml , json. for example, imagine d&b backend rest service converting xml: <salesrevenueamount currencyisoalpha3code="usd”>1000000</salesrevenueamount> <salesrevenueamount currencyisoalpha3code="cad”>1040000</salesrevenueamount> .. into: "salesrevenueamount": [ { "@currencyisoalpha3code": "usd", "$": 1000000 }, { ...

java - How to count the number of collisions with collidesWith() in JavaME? -

i'm developing game javame , need count number of collisions in game. i'm using collideswith() method, , i'm doing this: private void checkcollision() { if (spboy.collideswith(spball, true)) { this.collides++; if (this.collides == 3) { //here show game on image. } } } as can see, if number of collisions 3, game over, can't count number of collisions, because when increment this.collides , automatically have 3 collisions in 1 time. i'm assuming you're calling checkcollision() inside main loop. means gets called 30-60 times per second. if 2 sprites doesn't move @ during second, there 30-60 collisions - because it's true in each cycle. wanna add timer spboy sprite can't hurt. int safetimer = 0; int timesincelastloop; // add calculation loop private void checkcollision() { safetimer-= timesincelastloop; if (spboy.collideswith(spball, true) ...

android - How can I install debug build of AOSP? -

how can install debug build of android 5.0 aosp on nexus device? debug build? tried googling still can't find step-by-step instructions download , install debug build. you need pull down aosp in source form , build desired nexus target (assuming supported). start here: http://source.android.com/source/requirements.html once setup, details of building specific device, found here: http://source.android.com/source/running.html note if load device custom image you'll voiding warranty, etc. also, don't want full debug build, large , not loadable on device. you'll want "eng" build, has reasonable amount of debug capability in place, system processes , frameworks. good luck!

react native how to pass props through navigator to another Activity/View -

it seems simple solution (as intuitively me), couldn't find working solution. here navigator - render method code: render() { return ( <navigator initialroute={{title:'games', component:games}} configurescene={() => { return navigator.sceneconfigs.floatfromright; }} renderscene={(route, navigator) => { if (route.component) { return react.createelement(route.component, {navigator}); } } } /> ); } here how i'm passing props: this.props.navigator.push({title: 'mainactivity', component:mainactivity, gamekey:key, passprops:{title:'bla'}}); here mainactivity want props. i've tried: this.props.route.gamekey, this.route.gamekey, this.props.gamekey neither worked, understand may should pass props through renderscene, other way. may passing route through createelement? please help. the problem more serious...