Posts

Showing posts from March, 2011

java - Get jar library names used by app -

Image
how can jars name used application? based on bellow image, array contains jar file names, this: myarray = ["log4j-1.2.17.jar","commons-io-2.4.jar","zip4j_1.3.2.jar"] i have read this question , , try this: string classpath = system.getproperty("java.class.path"); log.info(classpath); list<string> entries = arrays.aslist(classpath.split(system.getproperty("path.separator"))); log.info("entries " + entries); but when run jar, got in log file: 2015-07-10 17:41:23 info updater:104 - c:\prod\lib\updater.jar 2015-07-10 17:41:23 info updater:106 - entries [c:\prod\lib\updater.jar] bellow same question, 1 of answers says use manifest class, how do this? you can work manifest entries this: enumeration<url> resources = getclass().getclassloader() .getresources("meta-inf/manifest.mf"); while (resources.hasmoreelements()) { try { manifest manifest = new manif

c# - How do I register decorators with AutoFixture? -

the decorator pattern demonstrates how can extend behaviour of component without modifying underlying implementation. means have 2 components implement same interface. there way register these in autofixture can still refer component polymorphically interface? a code example my meaning. let's assume want decorate icomponent loggingcomponent interface icomponent { void dostuff(); } class component : icomponent { public void dostuff() { // amazing! } } class loggingcomponent : icomponent { private readonly icomponent _component; public loggingcomponent(icomponent component) { _component = component; } public void dostuff() { console.writeline("calling dostuff()"); _component.dostuff(); } } how go both registering loggingcomponent icomponent , creating loggingcomponent without circular dependency? what's alternative registering loggingcomponent way: _fixture.register<

css - Changing text color -

i have managed change color of other text in woocommerce shop using simple custom css plugin wordpress. there 1 text section not change. when go shop , click on skincare , soaps , click cupcake soap says "6 in stock" yellow. want change black. site http://84f.6c5.myftpupload.com/ , css .woocommerce .stock in-stock { color: #000000; } this has got stumped others changed not one. linda your css wrong. in-stock class you're identifying tag. also, in-stock not defined within stock . correct implementation be .woocommerce .stock.in-stock { color: #000000; }

mysql - using sql variable in sum() like this--sum(@wokao) cause unpredicted result -

query 1) select * test; ----------- |no1|no2| ----+------ |1 | 1 | |2 | 2 | |3 | 3 | |4 | 4 | |5 | 5 | ----+------ query 2) select @wokao:= (no1 + no2), @wokao test group no1; 2 2 4 4 6 6 8 8 10 10 query 3) select @wokao:= (no1 + no2), sum(@wokao) test group no1; 2 null 4 2 6 4 8 6 10 8 the result of last sql query confusing. why doesn't output second query result? i ask question because searched keyword of "sum() sql variable" in google , stackoverflow , got nothing. , got problem when wrote sql query @ work query transaction information using sql variable in sum() , lot of subquery. i appreciate explain question. as per mysql documentation as general rule, other in set statements, should never assign value user variable , read value within same statement.for other statements, such select, might results expect, not guaranteed. in following statement, might think mysql evaluate @a first , assignment

java - What does the points stand for? -

this question has answer here: what 3 dots (…) indicate when used part of parameters during method definition? [duplicate] 3 answers when write constructor in java this: import java.io.ioexception; import java.io.outputstream; public class multioutputstream extends outputstream{ outputstream[] ostream; public multioutputstream(outputstream ostream) { this.ostream = ostream; // todo auto-generated constructor stub } @override public void write(int arg0) throws ioexception { // todo auto-generated method stub } } eclipse says: type mismatch: cannot convert outputstream outputstream[] . eclipse corrected constructor this: import java.io.ioexception; import java.io.outputstream; public class multioutputstream extends outputstream{ outputstream[] ostream; public multioutputstream(outputstream... ostrea

c++ - Open a device by name using libftdi or libusb -

i using libftdi multiple ftdi devices program running on ubuntu 14.04. have udev rule detects devices based on custom manufacturer string , gives them symlink in dev directory. similar /dev/my-device . use libftdi open device using string instead of pid/vid/serial number. i did not see capability available in libftdi checked libusb , didn't see functionality either. you try this: static int usbgetdescriptorstring(usb_dev_handle *dev, int index, int langid, char *buf, int buflen) { char buffer[256]; int rval, i; // make standard request get_descriptor, type string , given index // (e.g. dev->iproduct) rval = usb_control_msg(dev, usb_type_standard | usb_recip_device | usb_endpoint_in, usb_req_get_descriptor, (usb_dt_string << 8) + index, langid, buffer, sizeof(buffer), 1000); if (rval < 0) // error return rval; // rval should bytes read, buffer[0] contains actual response size if ((unsign

Android parcelable for android objects like mediaplayer -

i have searched today how make parcelable share objects between activities through intent . examples found custom objects basic data int / string / arraylists etc. there way make parcelable of mediaplayer object ? far have this: public class mpparcelable implements parcelable { private mediaplayer mp; public int describecontents() { return 0; } public void writetoparcel(parcel out, int flags) { out.writevalue(mp); } public static final parcelable.creator<mpparcelable> creator = new parcelable.creator<mpparcelable>() { public mpparcelable createfromparcel(parcel in) { return new mpparcelable(in); } public mpparcelable[] newarray(int size) { return new mpparcelable[size]; } }; private mpparcelable(parcel in) { mp = in.readvalue(); } } the part don't know todo on setter if can that: mp = in.readvalue(); don't know how read me

asp.net - Adding bracket border to asp Gridview cell with different rowspan values (vertically merged cells) -

i using visual studio 2010. have datalist contains gridview. gridview has merged cells in specific columns. these merged cells, display left bracket created via css or similar. when run code via css, height of bracket same merged cells. can me add left bracket merged cells, height of height of merged cell minus couple pxs? so if merged cell has 7 rows in it, bracket image should higher merged cell has 2 rows in it... if can solve left, please detail how right bracket added (for future work). in advance! ps: solution doesnt have in css.

ms access - Combine 2 queries with sum involved -

i have 2 similar queries both table being switched treatment patient in second query: select treatment.phys_id phys_id, physician.fname, physician.lname, sum(treatment.charge) totcharge physician inner join treatment on physician.phys_id = treatment.phys_id group treatment.phys_id, physician.fname, physician.lname; the output of both is: phys_id___fname___lname____totcharge when combined, need add 2 queries' columns of totcharge actual totcharge. however, when union these 2 queries tables stack on top of each other , union rearanges both tables identical phys_ids next each other. how can make 2 queries' totcharges add up? you can use subqueries add charges @ physician level: select physician.phys_id phys_id, physician.fname, physician.lname, (select nz(sum(treatment.charge)) treatment treatment.phys_id = physician.phys_id) + (select nz(sum(patient.charge)) patient patient.phys_id = physician.phys_id) total charge physician; alternativel

Referring to a CSS file in a HTML Email -

i have project on thymeleaf + spring mvc, , trying use thymeleaf send html emails. i under impression thing had create template file, , pass parameters i've been doing regular pages. looks wrong. when that, doesn't apply css. (as matter of fact doesn't refer css file.) don't know whether google 1 removing css file or mail clients do. it looks google encode class , ids of html elements, option using inline css or there way reference css file in html email? <img src="some_url" class="ctowud"> above img tag looks on gmail. should though: <img src="some_url" class="topimage" /> thanks in advance unfortunately, linking external stylesheets in html email poorly supported. also, gmail strips style tags both head , body , need push of styles inline before send, make sure gmail doesn't remove them. campaign monitor has great css support guide outlines can , can't use across email clients

py2exe and Tableau Python API -

Image
first of all, please excuse me if i'm using of terminology incorrectly (accountant trade ...) i'm writing piece of code planning pack .exe product. i've included number of standard libraries (xlrd, csv, math, operator, os, shutil, time, datetime, , xlwings). unfortunately, when i've added 'dataextract' library program stopped working. dataextract api written software called tableau (one of leading bi solutions on market). tableau website says not provide maintenance support @ moment. i've tested on basic setup: from xlwings import workbook, sheet, range workbook.set_mock_caller(r'x:\jac reporting\tables\pawel\development\_devxl\test1.xlsx') f = workbook.caller() s = raw_input('type in anything: ') range(1, (2, 1)).value = s this works fine. after adding: import dataextract tde the console (black box) flash on screen , nothing happens. questions: does library (in case 'dataextract') has meet criteria compatib

C++ compiler questions regarding increment operators -

why considered bad practice use prefix increment operator versus postfix operator old compilers? understanding modern compilers optimize old ones not. there particular reason 1 slower other, , reason left optimized in compiled code? if provide other details regarding operators , compilers i'd grateful, thanks, by "old" must mean old. the reason was, in days before real optimization, main system c/unix development pdp-11 , later vax-11. pdp , vax have pre-decrement , post increment addressing modes. movl r0, -(r1) ; decrements r1 4 , move value of r0 location. movl (r1)+, r2 ; move value @ r1 r2 add 4 r1. these c equivalent of *(--a) = b ; b = *(a++) ; in days of little optimization, these mapped underlying assembly instructions. at same time these addressing modes did not exist opposite: movl (r0)-, r1 movl +(r0), r1 therefore, there no hardware mapping *(++a) = b ; b = *(a--) ; the -(rx) , (rx)+ addressing modes made easy im

java - Spring security error occured processing XML -

i have error : error occured processing xml org.springframework.beans.factory.support.beandefinitionbuilder.setsource(ljava/lang/object;)lorg/springframework/beans/factory/support/beandefinitionbuilder;'. see error log more details this security.xm l: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:security="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd"> <!-- déclaration du propertyplaceholderconfigurer --> <!-- déclaration de la datasource --> <bean id="datasource" class="org.spring

javascript - Socket.io specifying heartbeat -

i can't seem find out how set heartbeat options socket.io? i'd love able specify happens when "timemout" happens, , when server hasn't gotten response client time. for reason disconnect event isn't firing, though has passed on hour without client not being connected. happens standalone java socket.io client socket.io uses engine.io, allows specify ping interval , ping timeout , so: var app = require('express')(); var http = require('http').server(app); var io = require('socket.io')(http, {'pinginterval': 2000, 'pingtimeout': 5000}); (2 second interval , 5 second timeout example. way frequent , inefficient)

java - Grails - Implement Debounce Algorithm for AutoComplete Request in Controller -

in grails, have following code snippet. class autocompletecontroller { def getautocompletedata() { // open db connection , data // , other long , heavy computation jsonstring(data: result) } } i want implement debounce algorithm incoming request if comes the same user, same request data, , same user's ip address . i have been looking @ implementing debounce in java however, don't have idea how integrating grails controller. please me how implement in grails? looking implementation java annotation this: class autocompletecontroller { @debounce(delay = 1000) // ------------>>>>>> how implement annotation? def getautocompletedata() { // heavy logic jsonstring(data: result) } } put last request data hash session , compare actual data. simplest approach be: def getautocompletedata() { int hash = hashtherelevantparams() if( null == session.cache ) session.cache = [:] def result =

Brunch watch does not process files on subsequent changes while running in Vagrant/Virtualbox -

i'm working vagrant/virtualbox development environment. web project django/angularjs project front-end development scaffolding done brunch. brunch works fine when use brunch build command, when use brunch watch command javascript files not processed brunch when make changes project on host machine. i've tried using nfs folder syncing config.vm.synced_folder folder["map"], folder["to"], type: folder["type"] ||= "nfs" , default virtualbox folder syncing neither seems work brunch watch . the following brunch-config.js file: exports.config = { paths: { watched: [ 'app', 'assets', 'styles', 'vendor', ] }, files: { javascripts: { jointo: { 'javascript/app.js': /^app/, 'javascript/vendor.js': /^(vendor|bower_components)/, } }, stylesheets: { jointo: { 'styles/app.css': /^styles/,

selenium - Can you use automated end-to-end testing frameworks to perform data entry tasks? -

i'm working in places legacy enterprise architecture requires staff have several browser windows open different systems in order manually move data on or check fields in unconnected systems. occurred me perhaps automated e2e testing framework used same task. has heard of approaching automated data-entry in way? what looking not e2e framework, web driver programmatically control browser (e2e frameworks commonly built on top of such drivers). selenium job , can control , major browser since ie 6 , has libs major languages. i have done it, great success. quick , universal way transfer data en bulk (i can't think prevent doing it, since using ui), dirty , can't left unattended (you still have oversee process, because driver won't pay attention errors shown, unless teach it). before though, can't interface system in question via direst http requests? can use tool telerik fiddler intercept calls , analyse them (or work page browser last 3-5 year, offer

php - HTTP Response Header is being overwritten. Where all can HTTP Response headers be set in apache? -

i have php application conditionally set access-control-allow-origin header. see change reflected on local setup , on dev environment, on live site, header set else. other headers set along keep values, leads me believe access-control-allow-origin header being overwritten somewhere else. i've checked .htaccess files in project , apache virtual host configuration file possible places header overwritten. being set in virtual host config file, commented out , restarted apache, header still being overwritten. is there other place can check see if header being overwritten? thanks in advance help! here requested php code snippet: $origin=$front->getrequest()->getheader('origin'); if($origin && (preg_match('/http[s]{0,1}:\/\/' . $front->getrequest()->gethttphost() . '$/', $origin))){ $front->getresponse()->setheader('access-control-allow-origin', $origin); $front->getresponse()->setheader

Spring 4 with Java Config and no xml -

i'm working on spring 4 based java application. application being deployed apache tomcat. application runs @ url of http://localhost:8080/test . can't get method defined in controller class run. i'm pretty sure it's configure issue. see doing wrong? work when run app @ root url of http://localhost:8080/ , not option me. first class involved: import org.springframework.web.servlet.support.abstractannotationconfigdispatcherservletinitializer; public class testwebinitializer extends abstractannotationconfigdispatcherservletinitializer { @override protected string[] getservletmappings() { return new string[] { "/test" }; } @override protected class<?>[] getrootconfigclasses() { return new class<?>[] { rootconfig.class }; } @override protected class<?>[] getservletconfigclasses() { return new class<?>[] { webconfig.class }; } } 2nd class involved: impor

google compute engine - Docker swarm-manager displays old container information -

i using docker-machine google compute engine(gce) run a docker swarm cluster. created swarm 2 nodes ( swnd-01 & swnd-02 ) in cluster. created daemon container this in swarm-manager environment: docker run -d ubuntu /bin/bash docker ps shows container running on swnd-01 . when tried executing command on container using docker exec the error container not running while docker ps shows otherwise. ssh 'ed swnd-01 via docker-machine come know container exited created. tried docker run command inside the swnd-01 still exits. don't understand behavior. any suggestions thankfully received. the reason exits /bin/bash command completes , docker container runs long main process (if run such container -it flags process keep running while terminal attached). as why swarm manager thought container still running, i'm not sure. guess there short delay while swarm updates status of everything.

javascript - VideoJs Ads Referenced Error on Basic Setup -

hey guys want ask if can see problem, not sure if tired or getting dumber , dumber day day: <body> <video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="264" poster="http://video-js.zencoder.com/oceans-clip.png" data-setup="{}"> <source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4'/> <source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm'/> <source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg'/> </video> <link rel="stylesheet" href="../../videojs-contrib-ads-master/src/videojs.ads.css"> <!-- video.js must in <head> older ies work. --> <script src="../../videojs-contrib-ads-master/video.dev.js"></script> &

vertical alignment - Vertically centering header and paragraph in html -

i still new @ this, i'm starting learn. seems there many ways vertically center content, can't figure out how apply code have , both header , paragraph. h2 header , .why_text vertically centered. what's best way this? here have far. (note have 5 sections odd/even) <style><!-- p.large { line-height:30px; font-size:16px; } .why_section {margin-bottom: 80px;} .why_section:nth-child(odd) h2 {display: block; width: 64%; margin-left: 5%; float: right;} .why_section:nth-child(odd) .why_image { width: 30%; margin-right:1%; float: left;} .why_section:nth-child(odd) .why_text {width: 64%; margin-left: 1%; float: right;} .why_section:nth-child(even) h2 {display: block; width: 64%; margin-left: 0%; float: left;} .why_section:nth-child(even) .why_image { width: 30%; margin-left:1%; float: right;} .why_section:nth-child(even) .why_text {width: 64%; margin-right: 5%; float: left;} .why_section .why_image img{ width: 10

bash - How can I separate a file with columns 1-7 of data into ONE column with all the data in order? -

for example, have of data want organized in way such output file purely numbers, rows 1-7 corresponding columns 1-7, rows 8-14 corresponding columns 1-7 on second row, , etc. can using awk? also example of data: total 31.6459262.4011 31.6463 31.6463 0.0006 0.0006 0.0007 total 0.0007 0.0007 0.0007 0.0007 0.0007 0.0008 0.0008 total 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 total 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 total 0.0008 0.0007 0.0007 0.0007 0.0006 0.0006 0.0006 total 0.0005 0.0005 0.0004 0.0003 0.0003 0.0002 0.0001 total 0.0001 0.0000 -0.0001 -0.0002 -0.0002 -0.0003 -0.0004 total -0.0005 -0.0006 -0.0007 -0.0008 -0.0009 -0.0010 -0.0011 total -0.0011 -0.0012 -0.0013 -0.0014 -0.0015 -0.0015 -0.0016 total -0.0016 -0.0017 -0.0018 -0.0018 -0.0018 -0.0019 -0.0019 total -0.0019 -0.0019 -0.0020 -0.0020 -0.0020 -0.0020 -0.0020 total -0.0019 -0.0019 -0.0019 -0.0019 -0.0018 -0.0018 -0.0

angularjs - How to trigger the enter event for typeahead -

how trigger event in typeahead. have code below using typeahead , when user selects username in drop-down box of typeahead want fill user.full_name in text box below. have suggestion event should in use in typeahead input. suggestion <div class="row"> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> <div class="form-group has-feedback" ng-class="showerror(userform.username)"> <label class="col-sm-4 control-label">{{'user.username' | translate}}:</label> <div class="col-sm-8"> <input type="text" name="username" ng-model="user.username" required ng-init="settimeout($element.focus(), 500)" typeahead="user user.username user in users | filter:$viewvalue | limitto:8" typeahead-on-select="select($model)"

c++ - Can CUDA kernels be virtual functions? -

the question quite straighforward, let me give overview of framework. have abstract class abstractscheme representing type of computation (a kind of discretization equation, not important). each implementation has provide method return name of scheme , has implement protected function cuda kernel. base abstract class provides public method calls cuda kernel , returns how long took kernel completed. class abstractscheme { public: /** * @return name of scheme returned */ virtual std::string name() const =0; /** * copies input device, * computes number of blocks , threads, * launches kernel, * copies output host, * , measures time of this. * * @return number of milliseconds perform whole operation * returned */ double docomputation(const float* input, float* output, int nelements) { // lot of things , calls this->kernel(). } protected: /** * cuda kernel computation. * m

MonoDevelop C# - build Errors -

Image
i following errors(not warnings) when build: i'm pretty sure i'm either missing plugin or did not import something. how fix this? from left pane in default view right click on project invoke context menu. select options. on project options dialog under build->general @ top of property page target framework, combo box, different version of .net framework can selected. add run parameters select run->general property page, in same dialog. second field parameters. enter them space separated on command line.

windows - Bottom of LCD screen flickering on certain graphics -

Image
looks lower portion of lcd trying readjust height. this doesn't show if record screen. seems appear when displaying kinds of graphics... dark uis of blender , adobe illustrator. shows if play video of these troublesome guis in fullscreen! what causing this? edit: fixed moving image when problem occurs. it looks monitor adjusting screen fit being shown. configuration problem. should set "just scan" or whichever equivalent on monitor.

cURL Recaptcha not working PHP -

what have : $data = array( 'secret' => "my-app-secret", 'response' => "the-response" ); $verify = curl_init(); curl_setopt($verify, curlopt_url, "https://www.google.com/recaptcha/api/siteverify"); curl_setopt($verify, curlopt_post, true); curl_setopt($verify, curlopt_postfields, http_build_query($data)); curl_setopt($verify, curlopt_returntransfer, true); $response = curl_exec($verify); var_dump($response); what got : bool(false) (which means curl_exec() failed) what expect : json object response please help. thanks. because you're attempting connect via ssl, need adjust curl options handle it. quick fix work if add curl_setopt($verify, curlopt_ssl_verifypeer, false); setting curlopt_ssl_verifypeer false make accepts certificate given rather verifying them. <?php $data = array( 'secret' => "my-secret", 'response'

Print auto-increment strings from Perl map -

this perl script prints output this value value value value my $tree = html::treebuilder::xpath->new_from_content( $content ); @myvalue = $tree->findvalues('//html/body/center[1]/table/tbody/tr[4]/td[1]/following-sibling::td'); @myvalue = map {/^(\d+)/; $1} @myvalue; print join(' ', @myvalue); instead need print this foostring1:value foostring2:value foostring3:value foostringn:value how prefix values integer-auto-incremented string? the auto-increment operator you. necessary my @values = qw/ value value value value /; $key = 1; join ' ', map { 'foostring' . $key++ . ":$_" } @values; output foostring1:value foostring2:value foostring3:value foostring4:value

matlab - Searching a matrix by row and column -

lets have matrix dataset = [400,300,200,100,200,300,400; 1, 2, 3, 4, 5, 6, 7] this give me 2x7 array larger numbers on row 1 , smaller on row 2. lets given number 200 , asked find numbers below 200 are. answer 3 , 5, because both correspond 200, how can code script? >> dataset(2,dataset(1,:) == 200) ans = 3 5

android - Values are not Populating in Listview -

this question has answer here: custom adapter getview() method not called 5 answers i trying develop android application can display values multiple tables. i have used base adapter display values since need display queried values in list. when try display values in list view blank. i not sure have done wrong. i using below method query data database display required values. public cursor getassetinstore() { sqlitedatabase db_database = getreadabledatabase(); cursor c = db_database.rawquery("select asset_name,warrenty,assetimage,asset_status `assets`,`aseetissued` assets.assetid = aseetissued.assetissuedid , asset_status =?" , new string [] {"in storage"}, null); return c; } the below methods used populate values onto list view. private void populateassetlistview() { cu

javascript - Meteor-Angular2 HTML Templates not updating on code change -

i'm working on a project running meteor 1.1.0.2 using following packages: meteor-platform angular:angular2 netanelgilad:angular2-typescript i've run frustrating issue. when create template: /sometemplate.ng.html <h1>hello world</h1> <!-- displays: hello world --> it run. on subsequent changes template, won't update. /sometemplate.ng.html <h1>hello somebody</h1> <!-- displays: hello world --> this wasn't case, i'm unsure if or change may have caused issue. it seems templates being cached , don't update. can imagine, makes frustrating dev experience. same named templates cached across different apps. if start new project, pointing same template name, fetches old template. /sometemplate.ng.html <h1>new meteor project</h1> <!-- displays: hello world --> any ideas whether issue package specific or meteor related. has else experienced same problem? quick/hard fixes? ctrl +

Using roles with spring boot actuator -

i'm trying configure "health" actuator endpoint provide details if authenticated user has admin role. management.security.role: admin management.security.enabled: true endpoints: health: id: health sensitive: true enabled: true time-to-live: 1000 the behaviour i'm seeing details provided regardless of whether authenticated user has admin role or not, long it's authenticated. this seems in line healthmvcendpoint implementation checks principal not null , not anonymous. can please provide clarifications on how i'm supposed use roles actuator? (i want restrict access sensitive details not entire endpoint). spring boot version: 1.2.4.release spring framework: 4.1.6.release thank you.

Creating Azure App Service Plans in an App Service Environments using Azure Powershell -

i'm attempting use azure app service environments (ase) , i'm having difficulty creating app service plans (asp) within ase using powershell. i've attempted using new-azureresource , new-azureresourcegroupdeployment cmdlets , both fail in unhelpful ways. need able create these programmatically our ci provisioning , deployment process (using teamcity). i created ase manually since take 3+ hours spin (sidenote: why, microsoft, why take 3+ hours ase?), , defined worker pool 1 two-node p1 pool. then judicious use of http://resources.azure.com tool able extract properties defining asp. so created simple template new asp: { "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymenttemplate.json#", "contentversion": "1.0.0.0", "resources": [ { "apiversion": "2015-06-01", "name": "rg-ase-dev-asp-wp1-2", "

android - How to hide the whole RecyclerView? -

i trying hide recyclerview until user passes valid information. not happening. weird things happen when try doesn't show error. here's code: mainactivity.java public class mainactivity extends appcompatactivity { private toolbar toolbar; private linearlayout recyclerrow; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); paper.init(getapplicationcontext()); toolbar = (toolbar) findviewbyid(r.id.app_bar); setsupportactionbar(toolbar); getsupportactionbar().setdisplayshowhomeenabled(true); navigationdrawerfragment drawerfragment = (navigationdrawerfragment) getsupportfragmentmanager().findfragmentbyid(r.id.fragment_navigation_drawer); drawerfragment.setup(r.id.fragment_navigation_drawer, (drawerlayout) findviewbyid(r.id.drawer_layout), (toolbar) findviewbyid(r.id.app_bar)); recyclerview re

Implement a user comment in Rails -

since i'm new in ruby on rails i'm kinda confused syntaxes on making user comments under users posts, associations are: class user < activerecord::base has_many :comments has_many :posts end class post < activerecord::base has_many :comments belongs_to :user end class comments < activerecord::base belongs_to :post belongs_to :user end im able make users post using @post = current_user.posts.build(postparams) i have user_id in comments db. i'am confuse on how make comment belongs_to user comments_controller def create @comment = @post.comments.create(comment_params) redirect_to post_path(@post) end if run above code makes comment under post doesn't belong user. if schema right, should work in comments_controller: def comment_params params.require(:comment).permit(:name, :body) .merge(user_id: current_user.id) end simply merge current user id in comment params, , not need hack user_id in f

java - Error:Could not find or load main -

it gives me error when launch, class name aqueueclass help? package `com.thekyle.hi;` class qdemo { // queue class characters char q[]; // array holds queue int putloc, getloc; // put , indices qdemo(int size) { q = new char[size + 1]; putloc = getloc = 0; }// put character queue void put(char ch) { if (putloc == q.length - 1) { system.out.println(" - queue full silly- "); return; } putloc++; q[putloc] = ch; } char get() {// gets character queue if (getloc == putloc) { system.out.println(" queue empty"); return (char) 0; } getloc++; return q[getloc]; } } class aqueueclass { public static void main(string args[]) { qdemo bigq = new qdemo(100);

javascript - Meteor / Iron Router Prevent iFrame re-render -

i'm trying use meteor / iron router make pretty simple app 2-3 pages 1 of pages requiring iframe embed contents. the embedded content, http://trycelery.com , added quite facebook comments, div data attributes , js initialization. when navigating away page , route embedded content, page rerendered , doesn't fire second time around. imagine because ahve sitting inside of {{> yield}} expected. i've tried couple things i've seen scatered across stack like: using pathfor link instead of actual absolute path i found "constant"'s might have been promising no longer available tried hacky work template.templatename.rendered couldn't figure out any solution aside keeping outside of {{>yield}} , show/hiding navigation? edit: showing/hiding css following prefer move template if possible. <div id="thepage" class="{{ispage}}"> template.applayout.helpers({ ispage: function() { if ( router.current().route

vb.net - Key detection does not work while in-game -

i making cheat, can used in game. have problem. using detect when did user press hotkey: private declare function getasynckeystate lib "user32" (byval vkey integer) short in combination with: if (getasynckeystate(convert.toint32(bind))) it works while in windows, turns out when start game, not detect key presses @ all. how fix that?

javascript - Meteor Restivus - POST body (JSON) to mongoDB -

my code looks this. post action in restivus. 'subs' mongodb collection. post: { authrequired: false, action: function () { var tmp = subs.insert(this.bodyparams); if(tmp){ return tmp; } return { statuscode: 400, body: {status: 'fail', message: 'unable create subscriber!'} }; } } when send json data in body, example: { _id: 1, name: "john", lastname: "smith" } in mongodb new document created, random (default notation) string , without data sent. guess data not parsed right. does know why happens? should function format json before passing mongodb body? try ... insert {status: 'success', data: tmp}; . post: { authrequired: false, action: function () { var tmp = subs.insert(this.bodyparams); if(tmp){ return {status: 'success', data: tmp}; } return { statuscode: 400, body: {stat

Cannot load Ruby Model under a namespace -

i have namespaced post controller below class admin::blog::postscontroller < admin::basecontroller end and namespaced model follows. class blog::post < activerecord::base end but when try access model inside index action of post controller below def index @posts = blog::post.where(:foo_id => params[:id]).paginate(:page => params[:page], :per_page => 20) end i following error loaderror @ /admin/blog/posts expected/app/models/blog/post.rb define post but when move model admin::blog::post namespace blog::post works. i'm bit confused , not able going on this. required controller , model should present in same namespace ? following snippet routes.rb namespace :admin namespace :blog resources :posts resources :categories end end blog module snippet module blog def self.table_name_prefix 'blog_' end end preloading controllers , models config.autoload_paths += dir["#{rails.root}/app/models/

C# mysql beginners questions -

i want make program enables user logon , see files stored on pc. have built small program mechanic , he's asking if fancy making service invoice system stores invoices on pc, , customers can download software filter out invoices. so need able connect pc pc , mysql suggested. i have never used mysql before , have no idea how meant start project. could through website instead of software? idea... anyways, or pointers beginners tuts on web helpful, thanks. mysql works best , safely when mysql server on same local-area network , behind same firewalls client software using it. this means local windows desktop client (in c# have done) work well. but if mechanic have server in office (or in cloud: in commercial server farm someplace), , offer desktop software customers, means mysql connection customers server have traverse firewalls. that's going make desktop software hard install , hard troubleshoot. it's going make mysql server insecure: have able acc

C++ - OpenGL - glBufferData with std::vector -

this question has answer here: vbos std::vector 2 answers i want use function glbufferdata fill indices/vertices. have arrays in std::vector , glbufferdata allows char*. glbufferdata(gl_element_array_buffer, sizeof(m_indicesebo), m_indicesebo, gl_static_draw); how can use std::vector here? you can way, assuming m_indicesebo std::vector. glbufferdata(gl_element_array_buffer, m_indicesebo.size() * sizeof(<data type>), &m_indicesebo[0], gl_static_draw);

Eclipse Android missing getSupportedFragmentManager and getChildFragmentManager -

hi tried using android supported lib v4 v13 instead of android app lib eclipse still cannot recognize getsupportedfragmentmanager , getchildfragmentmanager functions. there steps need take in order fro eclipse recognize both functions? using eclipse luna latest android sdk, targeting api 17 platform. i need either function see why app crashes no view found id ?? when using viewpager inside dialogfragment. thanks in advance. i found reason why eclipse cant recognize both functions , because while getsupportfragmentmanager available in supported lib v13 both function available in support lib v4 weird considering v13 higher , v4 included. perhaps removed getchildfragmentmanager function in v13 reason. discovered when using software provided here jd.benow.ca search function on class reside , viola, v13 don't have getchildfragmentmanager in of classes available , it's existed in v4, now, if getchildfragmentmanager needed use support lib v4 or find way use both supp

r - Error loading ggplot2 in RStudio -

i saw version of question posted, still did not see answer. trying use ggplot2 following errors error in loadnamespace(i, c(lib.loc, .libpaths()), versioncheck = vi[[i]]) : there no package called ‘stringi’ error: package or namespace load failed ‘ggplot2’ i installed stringi - leading error there binary version available source version later: binary source needs_compilation stringi 0.5-2 0.5-5 true binaries installed trying url 'http://cran.rstudio.com/bin/windows/contrib/3.2/stringi_0.5-2.zip' warning in install.packages : cannot open: http status '404 not found' error in download.file(url, destfile, method, mode = "wb", ...) : cannot open url 'http://cran.rstudio.com/bin/windows/contrib/3.2/stringi_0.5-2.zip' warning in install.packages : download of package ‘stringi’ failed then read question - package 'stringi' not work after updating r3.2.1 . , followed suggestion of using option , getting

How to publish a c# Windows Application that has a MySQL server connection -

i have been trying find way publish c# windows application involves database connection (mysql). want able send friends or let others use it. my problem have no idea how publish app connection. ive searched everywhere. please help!

dataframe - Reshape the Columns of Data Frame in R -

i have data frame (for example) week bags 4 5 6 3 10 5 13 7 18 5 23 1 30 9 31 9 32 4 33 7 35 1 38 2 42 2 47 2 'week' column denotes week number in year , 'bags' denotes number of bags used small firm. want data frame in form of week bags 1 0 2 0 3 0 4 5 5 0 6 3 7 0 8 0 9 0 10 5 , on, in order plot weekly changes in number of bags. sure silly question not find way. please in direction. you can create dataset df2 <- data.frame(week= 1:max(df1$week)) and merge first dataset res<- merge(df1, df2, all=true) res$bags[is.na(res$bags)] <- 0 head(res,10) # week bags #1 1 0 #2 2 0 #3 3 0 #4 4 5 #5 5 0 #6 6 3 #7 7 0 #8 8 0 #9 9 0 #10 10 5 or using data.table library(data.table) res1 <- setdt(df1, key='week')[j(week = 1:max(week))][is.na(bags), bags:=0][]

html - Echoing a URL in Batch -

edit: variable wasn't defined properly. have no idea why have found workaround this: there 6 pages needed. have created 7th page instantly return page 1. , %htmlnxtpg% variable not needed anymore. i trying create batch file spit out html file user won't need understanding of html make site. the site needs "live" have iframes redirecting each other using <body onload="timer=settimeout(function(){ window.location='file:///c:/users/myuser/dropbox/pagemdb/sources/page/page_%htmlnxtpg%.html';}, %htmllen%)" style="background:#408cbd"> (this url temporary run locally now) and there variable mentioned in url named %htmlnxtpg% echo command ignoring it. not outputting there leading browser having 404. defining htmlnxtpg variable using delayedexpansion on during defining of variable , off when using it. edit: code horribly made , has been fixed comment , answer (@stephan , @mofi) if htmlpgnr==1 set /a htmlnxtpg=2 if htm

What is $.each doing in this function, and how can I rewrite it to work without using jQuery -

i learning javascript, , encountered function on website. seems use jquery, don't have experience with. understand function except lines $.each . can me rewrite function without $.each ? don't understand means, after reading jquery documentation. referring to, , how can rewrite function work without jquery ? arraysort = function(array, sortfunc){ var tmp = []; var asorted=[]; var osorted={}; (var k in array) { if (array.hasownproperty(k)) tmp.push({key: k, value: array[k]}); } tmp.sort(function(o1, o2) { return sortfunc(o1.value, o2.value); }); if(object.prototype.tostring.call(array) === '[object array]'){ $.each(tmp, function(index, value){ asorted.push(value.value); }); return asorted;

Function return pointer to another type of function - C++ -

bool (__fastcall fun)(float par1, float par2) { return (par1 == par2) ? true : false; } bool (__fastcall *newfun())(std::string str) { //... return fun; } i have error: error return value type not match function type. what wrong? will help: bool (__fastcall fun)(float par1, float par2) { return (par1 == par2) ? true : false; } bool (__fastcall *newfun(std::string str))(float par1, float par2) { //... return fun; } int main() { auto p = newfun("somestring"); cout << p(1.0, 1.0) << endl; cout << p(1.0, 1.1) << endl; return 0; } maybe want read how function pointers in c work? i think quite discussion of function pointers.

c# - How to read a xml file stored in a application local folder in windows phone 8.1 app development -

i new in windows application development.i looking code me read content of xml file stored in application local folder. description : in application once user clicks on submit button,i have stored user status "true" in xml file using below code : // windows.storage.storagefolder localfolder = windows.storage.applicationdata.current.localfolder; var stream = await localfolder.createfileasync(filename, creationcollisionoption.replaceexisting); usercontent +=signup_username.text; usercontent += signup_number.text; usercontent += signup_email.text; usercontent += signup_password.password; usercontent += "\n loginstatus : " + true + ""; await fileio.writetextasync(stream, usercontent); but once user again enter in application want check user status whether true or false reading above created file content. offline process check logged in status in local mobile. platform - windows phone 8.1 xaml , c# can please me implement functionality.

graph - Finding Nodes with lots of relations pointing to it in neo4j using cypher -

Image
i have neo4j database nodes following structure [a:article_id] -[r:about_place]-> [l:location] now want find article_id,location pairs location has lots of incoming relationships (say > 4) match ()-[r:about_place]->(n) n,count(r) rel_cnt rel_cnt > 4 return n.name,rel_cnt; this works, list of locations need. but want incomings articles relation also, 5 article ids china has pointing are. something this, match (a)-[r:about_place]->(n) a,n,count(r) rel_cnt rel_cnt > 4 return a.title,n.name,rel_cnt; but returns 0 rows. im guessing because (a,n) combo used in group clause makes count(r) 1 in each row. saw in talk way count(*) clause works default. i think solution chain these results , make new query life of me cant figure out how. ideas or links too. i'm not sure if there's better way this: match ()-[r:about_place]->(n) n, count(r) rel_cnt rel_cnt > 4 match (a)-[r:about_place]->(n) return a.title,n.name,rel_cnt; als