Posts

Showing posts from January, 2015

excel - Copy consolidated row data from multiple worksheets where a specific column is populated -

i'm looking copy range of data multiple worksheets single summary sheet based upon specific column being populated. i'm using code found on link : https://msdn.microsoft.com/en-us/library/cc793964(v=office.12).aspx under section entitled 'copying data except column headers multiple worksheets' it works although i've been trying modify code instead of copying whole sheet, copies rows in column 'n' populated. i disabled line of code sets copyrng whole sheet , introduced loop check n column - got program return values present inside column n across sheets need return entire rows of these instances. here modified code section in question : ' if source worksheet not empty , if last ' row >= startrow, copy range. if shlast > 0 , shlast >= startrow 'set range want copy 'set copyrng = sh.range(sh.rows(startrow), sh.rows(shlast)) each cell in sh.range("n4:n...

32bit 64bit - 32 bit vs 64 bit MATLAB executable applications -

i have 64 bit matlab installed on computer. not allowed install 32 bit matlab on machine. wrote code , converted executable using application compiler. employees 32 bit operating systems can not run executable. the question is: there way create 32 bit application using 64 bit matlab? (again, not allowed install 32 bit matlab on machine)

cordova - How to get navigator.getUserMedia working using PhoneGap -

i show camera live video using phonegap application. have created code base on example - http://www.html5rocks.com/en/tutorials/getusermedia/intro/ . i created html object <video autoplay></video> and created code: var errorcallback = function(e) { console.log('reeeejected!', e); }; navigator.getusermedia = navigator.getusermedia || navigator.webkitgetusermedia || navigator.mozgetusermedia || navigator.msgetusermedia; var video = document.queryselector('video'); if (navigator.getusermedia) { navigator.getusermedia({audio: true, video: true}, function(stream) { video.src = window.url.createobjecturl(stream); }, errorcallback); } else { cosnole.log("no media available"); } the application throws no exception, video object created, can hear audio, video presented black region - no live stream displayed. knows, what's wrong? i have be...

angularjs - url rerouting gives blank page in ionic framework -

this code ...when running program getting blank page checked url routing dont know mistake. plese find mistake , tell me. this main page. index.html <!doctype html> <html ng-app="starter"> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> <title></title> <link href="lib/ionic/css/ionic.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <link rel="stylesheet" href="css/bootstrap.css"> <script src="js/jquery.js"></script> <script src="js/bootstrap.js"></script> <script src="lib/ionic/js/ionic.bundle.js"></script> <script src="cordova.js"></script...

Error while changing collation on an existing SQL Server database -

i have instance of express 2014 running on machine can examine customer db's , run basic queries against them. today received 1 uses sp's of queries , ran this: cannot resolve collation conflict between “sql_latin1_general_cp1_ci_as” , “latin1_general_ci_as” in equal operation the obvious solution these sorts of problems change collation of database . however, produced long stream of these: the object 'f_tenantfreerentvalue_getall' dependent on database collation. database collation cannot changed if schema-bound object depends on it. remove dependencies on database collation , retry operation. i understand happening here, come on... there lightweight solution these sorts of problems? script runs on every object not definition of "light", there way reset of on restore or that?

python - cron job on Ubuntu instance doesn't work (Google Cloud Platform) -

i have been monitoring functioning of python (2.7) program downloads text files ftp server, parses required information files , uploads on google cloud datastore. this program runs every 10 minutes using cron job on ubuntu 14.04 lts instance created on google compute engine. have added cron job root user. (also created swap space of 1gb). instance configuration: machine type: n1-standard-1 (1vcpu, 3.75gb) cpu platform: intel sandy bridge disk size: 50gb (standard persistent disk, mode: boot, read/write) firewalls: enabled allowing http traffic & disabled allowing https traffic however, after 36 hours, program able download (& parse) files, while skipping other files. i have test run program multiple number of times (runs fine) , have referenced other queries on stackoverflow still facing same issues. i have been trying long time unable make progress on part. can please me figure out if need make changes in system configuration or missing. thank you.

unity3d - Vuforia-Unity, How To Move Animated Objects When Marker is Outside Camera View? -

we move our animated object independently frame marker or target image not visible camera; after initial setup. however when run our application, our model appears on target image or frame marker marker or target out of camera; animated image disappears too. how can keep our model animating or moving around when frame marker or image target outside camera view? note: using unity 3d. all objects not under rendering camera automatically deactivated in vuforia logic. have override property , make them active can continue animation , movement. hope helps.

c# - Manage prerequisites version in bootstrapper -

i want create bootstrapper application c# visualstrudio 2015. want set prerequisite sharedmanagementobject (from microsoft, downloaded that direct link ). followed instructions on the microsoft website . there product.xml: <?xml version="1.0" encoding="utf-8" ?> <product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" productcode="custom.bootstrapper.sharedmanagementobjects2014x86"> <relatedproducts> <dependsonproduct code="custom.bootstrapper.sqlsysclrtypes2014x86" /> </relatedproducts> <packagefiles> <packagefile name="sharedmanagementobjects2014x86.msi"/> </packagefiles> <installchecks> <msiproductcheck product="ismsiinstalled" property="{4e6202de-b996-4736-a64b-09ee2a8469e6}"/> </installchecks> <commands> <command packagefile="sharedmanagementobjects20...

PowerShell HelpMessage displayed by default in parameters -

is possible have powershell display messages default when parameters not specified in command line without user having input "!?" help? should not use param , manualy instead read-host if want script interactive? param ( [parameter(mandatory=$true,helpmessage="enter desired password.")][string]$desired_password, [parameter(mandatory=$true,helpmessage="please input target hostnames.")][string[]]$target_hosts ) what best approach in such case? if want text displayed if not specify [string] parameter, yes, have write yourself. example: param( [string] $testparameter ) if ( -not $testparameter ) { write-host "this -testparameter." while ( -not $testparameter ) { $testparameter = read-host "enter value" } } "argument -testparameter: $testparameter"

php - Creating an array for each month after today -

i cant find way create array each month after current one. <?php $month = 07; $year = 2016; $end = date('y'); for($i=0;$i<=$end-$year;$i++){ $from = 1; if($i==0) $from = $month; for($y=$from;$y<=12;$y++){ if($year==date('y') && $y > date('m')) break; $a = $year+$i.'-'.$y; $months[$a] = $a; } } krsort($months); ?> <?php echo html::dropdownlist('month_year',$month_year,$months,array('class'=>'form-control'));?> i want dropdownlist looks this 2016-09 2016-08 2016-07 for each month comes. starting date should 2016-07. , top value should current month. ...

android - animatorset not animating views sequentially -

i have list of relativelayouts in fragment. wish animate these views sequentially animatorset using playsequentially(). create objectanimator on each of relativelayout's in loop. want layouts animate bottom of fragment 1 after other. @ minute first relativelayout animating , iam not sure why? rest of layout remain still. below code. animatorset myanimset; list<animator> animlist = new list<animator>(); (int = 0; < count; i++) { //resources drawables in list animatedviews[i].setbackgroundresource(resources[i]); //animatedviews list of relativelayouts objectanimator animator = objectanimator.offloat(animatedviews[i], "translationy", 800f, 0f); animator.setduration(2000); animator.repeatmode = valueanimatorrepeatmode.restart; animator.repeatcount = valueanimator.infinite; animlist.add(animator); } ...

ruby - File to import not found or unreadable: normalize-rails/normalize. Administrate gem -

i using administrate gem , noticed there dependency issue, required gem sass-rails thoughtbot/administrate #134 . have gem installed , gemfile.lock has sass-rails (5.0.1) . error highlights <%= javascript_include_tag 'application' %> tag in application.html.erb . cannot find further issue, shed light on how resolve?

mongodb - setting up config server setup for mongo query router -

i using mongo v3.2 - have config replica set 2 shard replica sets running. when try launch mongos (query router) test config file setting below, error copied below - ideas on how fix this? sharding: configdb: config-set0/127.0.0.1:27019,127.0.0.1:27020,127.0.0.1:27021 error unrecognized option: sharding.configdb i can see setting in mongodb docs @ url below: https://docs.mongodb.com/manual/tutorial/deploy-shard-cluster/ ensure process being launched mongos , not mongod if intent run process query router (and not config server or shard).

javascript - Angular does not run on an IIS server after removing the # symbol from the URL -

i developing web platform using angular js client side framework , .net server side framework creating rest webservices. now, goal remove # symbol. have followed these steps: configure $locationprovider , set html5mode true . add base tag index.html file ( <base href="/"> ). configure iis server rewrite mode. after completing these steps, # removed url , able navigate between routes angular not run correctly (for example: ng-show , ng-disabled directives , app's controllers not working). i have tried add angular-csp.css index.html file , add ng-csp directive body tag problem persists. is problem related client side configuration (some angular configs) or server side configuration ( iis server configs) , how solve it? edit the project runs correctly on local node http server . have tested functionalities locally , no errors in browser's console. so weird! solved problem , don't know how , why. have tried place...

c - OpenGL issue: 'incompatible' vs 'cannot find' -

i'm trying a program blender deformation. laptop amd64 , able support i386. faye@fish:/usr/bin$ dpkg --print-foreign-architectures i386 faye@fish:/usr/bin$ dpkg --print-architecture amd64 i have no experience makefile script. according google search info, made 2 line code additions in makefile.mk. # -i option compiler finding headers cflags += $(addprefix -i, $(include_path)) cc=gcc -m32 here issue: when run template opengl code with: gcc test.c -lm -lpthread -lglut -lgl -lglu -o test it seems code , libs work correctly. however, if same makefile.mk(cc=gcc), gives many errors in following form: /usr/bin/ld: i386 architecture of input file `../external/lib/libxxxxxxxx.a(xxxxxxxx.o)' incompatible i386:x86-64 output if use (cc = gcc -m32), error switch to: /usr/bin/ld: cannot find -lglut /usr/bin/ld: cannot find -lgl /usr/bin/ld: cannot find -lglu i guess maybe there wrong in 64 bit os running 32 bit application , libs linking? -m32 , when use...

android - How to access a specific Button in a View in Drawer ListView -

Image
i have navigation drawer now want access test button inside listitem 1 tried inside drawerlayout.onitemclicklistener() not working. i have drawerlistener() actionbartoggle object. how can access button? help needed. :) i have found solution. made class implementing onclicklistener , set onclick method of button inside getview of listview.

There is no ado.net entity data model in visual studio when i created a Asp.net core project -

after installed visual studio 2015 , create new asp.net core project : visual studio doesn't have ado.net entity data model when click on add->new item-> why? it's not supported in asp.net core. use entityframework core instead

javascript - Dealing with href when selecting multiple options -

i trying give users option select multiple years in webpage, used checkbox type. currently, struggling @ redirecting pages when user select multiple years. in html <h4> brands </h4> <div class="dropdown"> <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">dropdown <span class="caret"></span></button> <ul class="dropdown-menu"> <li><a href="#" class="brands" name = "nike">nike</a></li> <li><a href="#" class="brands" name = "adidas">adidas</a></li> <li><a href="#" class="brands" name = "vans">vans</a></li> </ul> </div> <h4> years </h4> <div class="mutliselect"> <ul> <li> ...

centos - How to check that the Matlab Compiler Runtime (MCR) is correctly working on my pc? -

i tried install matlab compiler runtime (mcr) r2013a v81 on pc using centos linux release 7.2.1511. now know if installed properly: how check this? thanks you can list installed versions of mcr mcrversion function: [major, minor] = mcrversion if managed compile binary mcr, try run on target machine; application either work or crash , in case system complain missing dependencies.

One to one and many to many representation of entites in mongodb -

Image
so use sqlserver through entity framework , got email saying azure raised prices on azure sql elastic db's, again!. way going mongodb , need translating fluent api mongo document? public coursemappings() { hasmany<user>(s => s.student) .withmany(c => c.course); } public addressmappings() { hasrequired(c => c.student) .withrequireddependent(u => u.address); } public studentmapping() { hasrequired(c => c.address) .withrequiredprincipal(u => u.student); } got 3 tables, student, address , courses, how model in mongodb?i know address embedded in student 1:1 relationship have figured out. question can done in 1 document(an example) or courses separate document studentid many many relationship students? the data model in mongodb dependent on "query acc...

Start ratpack.groovy from Java -

i´m trying use ratpack groovy framework java, cannot find way init java. any idea how start ratpack.groovy script java? this ratpack script ratpack { def tokens=[:] serverconfig { port 9000 } handlers { get("identity/:token") { def token= pathtokens["token"] render tokens[token] } } } regards. based on groovyratpackmain , can start groovy app java this: import ratpack.server.ratpackserver; ratpackserver.start(groovy.script.appwithargs(args)); if need use non-default script file or perform other customization, groovy.script has methods support that.

docker container using the same volume even after running new container image -

i have f.e. 2 containers in docker compose.yml version: '2' services: nginx: image: local-nginx:0.3 ports: - "81:81" volumes_from: - webapp webapp: image: local-webapp:0.65 webapp dockerfile from node:4.3.0 ... volume /www cmd npm run some_script so, what's happening, webapp container shares folder /www nginx, , static files serving nginx container. i'm starting app command docker-compose -f compose.yml everything working fine, good. when want example run application version of webapp local-webapp:0.66 change version 0.66 in compose.yml, stop current containers , run again docker-compose -f compose.yml but, still see same version of webapp. when go inside nginx container still see same files previous 0.65 . see correct files, must remove containers, , again docker-compose -f compose.yml up. so, question. how possible configure compose.yml file update volume without removing containers? this bec...

mysql - What's wrong with my SQL trigger -

i need sql trigger following: when insert row in table user want 2 primary keys (id, year) following: 1 - 2016 2 - 2016 3 - 2016 1 - 2017 2 - 2017 so want autoincrement reset new year id column int(3) unsigned auto_increment field year column year field type the trigger tried is create trigger reset before insert on user each row -- trigger creation begin select max(year) @x user; -- selecting max year table compare if @x <> year(curdate()) -- if max table differs current alter table user auto_increment=1; -- reset auto increment 1 end if; end; but keeps saying there's error in sql syntax

rest - Java – multiple call on DAO causes exception (wildly, jboss) -

i building java rest application. therefor using jboss on wildfly 8 server. the following code causes exception: jbas011469: transaction required perform operation (either use transaction or extended persistence context) @path("/users") @stateless public class usersendpoint { @post @produces(mediatype.application_json) @consumes(mediatype.application_json) public response create(user user) { try { this.checkusername(user.getusername()); this.checkemail(user.getemail()); return response.ok(userdao.create(user)).build();; } catch (ioexception e) { return response.status(response.status.not_acceptable) .entity(e.getmessage()) .build(); } catch (exception e) { return response.status(response.status.not_acceptable) .entity(e.getmessage()) .build(); } } ...

python 2.7 - %matplotlib inline ValueError -

when use %matplotlib inline in program, valueerror. error mean, , how can resolve it? here error: traceback (most recent call last): file "main.py", line 40, in <module> ct.iloc[:-1,:-1].plot(kind='bar',stacked=true,color=['red','blue'],grid='false') file "/usr/lib/python2.7/dist-packages/pandas/tools/plotting.py", line 1735, in plot_frame plot_obj.generate() file "/usr/lib/python2.7/dist-packages/pandas/tools/plotting.py", line 907, in generate self._adorn_subplots() file "/usr/lib/python2.7/dist-packages/pandas/tools/plotting.py", line 1012, in _adorn_subplots ax.grid(self.grid) file "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 2176, in grid b = _string_to_bool(b) file "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 54, in _string_to_bool raise valueerror("string argument must either 'on' or 'off'") valueerror: string argument must e...

swift - "Ambiguous reference to member 'scheduledTimerWithTimeInterval( _:invocation:repeats:)'" -

i'm trying set timer run event periodically, described here . hashtag parameter has been deprecated, tried rewrite starttimer code accordingly: func starttimer() { let theinterval: nstimeinterval = 5.0 self.timer = nstimer.scheduledtimerwithtimeinterval ( interval: theinterval, target: self, selector: selector("timertick:"), userinfo: "hello!", repeats: true ) } problem is, keep getting error: "ambiguous reference member 'scheduledtimerwithtimeinterval( _:invocation:repeats:)'". i'm not trying run scheduledtimerwithtimeinterval( _:invocation:repeats:), i'm trying run scheduledtimerwithinterval:target:selector:userinfo:repeats. i'd think obvious parameters i'm passing. what need differently? there 2 problems: it confused newline , whitespace between scheduledtimerwithtimeinterval , open parentheses. you should not supply first parameter label. so,...

javascript - gulp main.js does not include all js files -

i'm trying add build tool-gulp angularjs project think i'm doing wrong config b/c keep getting errors like require not defined angular not defined or app not defined ( var app = angular.module("app",[]); ) i have multiple js files 1 service/factories, controllers, , modules. want build scripts when main.js has modules defined not have other js files. not sure if suppose copy html files dist folder. have tried both ways keep getting errors service undefined or app undefined, etc. know doing wrong. this code resides in gulp.js: var gulp=require('gulp'); var connect = require('gulp-connect'); var browserify=require('browserify'); var source=require('vinyl-source-stream'); var jshint=require("gulp-jshint"); var concat=require('gulp-concat'); var del = require('del'); gulp.task('browserify', function(){ return browserify('./app/app.js').bundle().pipe(source("main.js")...

vagrant - Check if NFS is available from within Vagrantfile -

i have vagrantfile , default option mounting on non windows machines nfs. if vagrant::util::platform.windows? == false config.vm.synced_folder ".", "/vagrant", id: "core", :nfs => true, :mount_options => ['nolock,vers=3,udp'] end however have developer didn't have nfs installed on 'nix box , took awhile figure out problem. is there way check if host machine has nfs installed in similar approach within vagrantfile? you can read https://www.vagrantup.com/docs/plugins/host-capabilities.html definition , implementation of host capabilities identical guest capabilities.

android - How to make hide/show toolbar when our list scrolling to the top -

how make hide/show toolbar when our list scrolling top, knowing toolbar view described inside activity_main.xml recyclerview described in fragmet nomed fragment_main.xml sorry english :) since activity has toolbar within content view starting fragment, can hold of fragment. mainactivity mainactivity = (mainactivity)getactivity(); i recommend doing method in mainactivity: public void showtoolbar(boolean show) { // if have toolbar private member of mainactivity toolbar.setvisiblity(show ? view.visible : view.gone); // can if (show) { getsupportactionbar().show(); } else { getsupportactionbar().hide(); } } and when want hide fragment, call it: ((mainactivity)getactivity()).showtoolbar(false); to make ui change more smooth, recommend translating instead of instantly hiding it. take @ top answer here inspiration: android lollipop toolbar: how hide/show toolbar while scrolling? if don't know how take care of whe...

java - integer wont send over a socket and is received as a String by client -

i'm trying create client/server chat room program , each client gui needs display list of active users sent server. need send number of users in list client. when try sent int on socket throws type mismatch error. more point if try , send string , parse int random alphanumeric string appears out of nowhere. know variable sending integer number though don't understand what's going on. i've left in different solutions comments too. server: public void updateclientuserlist() { //int userlistsize = userlist.size(); output.print((int)userlist.size()); for(int = 0; < userlist.size(); ++i) { string user; user = userlist.get(i).getusername(); output.println(user); } chatlog.add("new user(s) has joined chatroom"); } client: public static void updateuserlist() { string users = ""; //string numinput ...

javascript - How to make navigation bar disappear when a link is clicked on -

i have menu navigation covers whole page. how can make disappear when link clicked on? my code below: html code <div class="button_container" id="toggle"> <span class="top"></span> <span class="middle"></span> <span class="bottom"></span> <p>menu</p> </div> <div class="overlay" id="overlay"> <nav class="overlay-menu" id ="overlay-menu" > <ul> <li ><a href="#home" >home</a></li> <li><a href="#about" data-toggle="collapse" data-target=".overlay" >about us</a></li> <li><a href="services">services</a></li> <li><a href="#portfolio" >portfolio</a></li> <li><a href="#">enquiry form</a>...

machine learning - Tensorflow: graph building dependent on evaluation -

i writing tensorflow graph of following format: def process_label(label): return some_operation(label.eval()) input: x, label output,state = nn_layers() processed_output = process_data(output) processed_label = process_label(processed_output, label) loss = cross_entropy(processed_output, processed_label) optimize = gradientdescentoptimizer.minimize(loss) session.run(optimize, feed_dict{x:input, label:label}) the problem model need values of output in order process label way want can calculate loss. if try use output.eval(session) here, not work, because session execute whole graph , therefore can call in end. i wonder if there s way can break graph apart in 2 , still have gradient descent work through network, or if there s other way this. there may flaw in these, here 2 ideas start with: 1) easy vs. 2) efficient: 1) put in 1 graph, though have labels want. execute once outputs (only feeding placeholders required outputs, tensorflow won't require labels p...

r - Problems with Gamma Regression Model after doing PCA decomposition -

i unfamiliar pca's , implementing them in r. have data , want apply pca decomposition way deal co-linearity. after applying pca analysis, want use gamma regression model, not sure how fix error keep getting. post code , results below: library(cosmophotoz) totaldata<-merge(phat0test, phat0train, all=true) summary(totaldata) #gamma regression without pca done on phat0train, included in cosmophotoz gamma1<-glm(redshift~., family=gamma(link="log"), data=phat0train) summary(gamma1) #works fine #new subset of data set.seed(0508) sample<-sample(1:nrow(totaldata), 0.90*nrow(totaldata)) test<-totaldata[sample,] train<-totaldata[-sample,] #pca on subsets mytest<-subset(test, select=-c(redshift)) pcatest <- princomp(mytest,cor=t) summary(pcatest, loadings=t) mytrain<-subset(train, select=-c(redshift)) pcatrain <- princomp(mytrain,cor=t) summary(pcatrain, loadings=t) #formula based on pca loadings k...

javascript - Set opacity to all tiles except for the one selected -

i noticed there couple questions similar one, not same exactly. using ng-repeat show of uploaded images have. can click on 1 , become default picture. want image clicked normal while others have overlay . tried setting $('overlay').hide() in selectimage function, remove overlay html on first image. ideas on how can this? html <!-- photos --> <div class="uploads-section" style="width: 100%;"> <md-grid-list md-cols="3" md-row-height="1:1" md-gutter="8px" style="padding-top: 10px;"> <md-grid-tile md-rowspan="1" md-colspan="1"> <div style="background-color: #3f454b; padding: 30px; cursor: pointer; height: 100%; width: 100%;" class="upload-tile no-outline" layout="column" layout-align="center start" ng-click="uploadimage('photo')"> <md-icon style=...

android - Google API identify toolkit returning configuration_not_found -

while trying login firebase account using custom token, error shows. cause of error? 07-25 15:04:16.523 2357 811 e volley : [448] basicnetwork.performrequest: unexpected response code 400 https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifycustomtoken?key={token_code} 07-25 15:04:16.524 2357 2530 authchimeraservice: error description received server: { 07-25 15:04:16.524 2357 2530 authchimeraservice: "error": { 07-25 15:04:16.524 2357 2530 authchimeraservice: "errors": [ 07-25 15:04:16.524 2357 2530 authchimeraservice: { 07-25 15:04:16.524 2357 2530 authchimeraservice: "domain": "global", 07-25 15:04:16.524 2357 2530 authchimeraservice: "reason": "invalid", 07-25 15:04:16.524 2357 2530 authchimeraservice: "message": "configuration_not_found" 07-25 15:04:16.524 2357 2530 authchimeraservice: } 07-25 15:04:16.524 2357 2530 authchimeraservice: ], ...

typescript - Angular 2 router not working properly -

the app working fine old angular 2 router, when switched the"3.0.0-beta.2",the application doesn't load. part of application believe problem lies: files: app.component.ts import { component} '@angular/core'; import {navcomponent} "./nav.component"; import { router_directives } '@angular/router'; @component({ selector: 'my-app', template: `<my-nav></my-nav> <router-outlet></router-outlet>`, directives:[navcomponent,router_directives] }) export class appcomponent{ } app.routes.ts import {aboutcomponent} "./about.component"; import {taskscomponent} "./tasks.component"; import {walleycomponent} "./walley.component"; import {dashboardcomponent} "./dash-board.component"; import {pagenotfoundcomponent} "./404.component"; import { providerouter, routerconfig } '@angular/router'; export const routes: routerconfig = [ {path: '...

Displaying links in XML to HTML XSL transform -

i'm working on transforming xml html via xsl , having trouble displaying links. xml looks this: <c02 level="file"> <did> <container type="box">1</container> <container type="folder">2</container> <unittitle>folder a, </unittitle> <unitdate>2001</unitdate> <daogrp> <daoloc label="image" href="www.test.com" role="image/jpeg"> <daodesc><p>document</p> </daodesc> </daoloc> </daogrp> </did> <scopecontent> <p>1 page</p> </scopecontent> </c02> my expected html this: <tr> <td valign="top">1</td> <td valign="top">2</td> <td vali...

python - django cannot import name 'Item' -

after running successful runserver, create super user in django project, updated admin.py in app directory from django.contrib import admin .models import item admin.site.register(item) by running following $: python manage.py createsuperuser; getting below error errorlog pastebin i newbie django , python, read in other post circular import couldn't figure out error. i have taken tutorial python , django youtube . you have identified problem in comment: models.py : django.db import models item not comes django. need define model named item yourself. guess ahve missed pretty important step in tutorial (or tutorial wrong/missing step). app running in meantime add models.py: from django.db import models class item(models.model): pass this should allow create superuser. aware model doesn't anything. either have find missing step of tutorial or figure out supposed doing.

Uncaught TypeError: Cannot read property 'add' of undefined :: javascript :: bing maps -

so having problems displayinfobox function. looking bing maps v8 api trying link events infobox. following bing , storing event handlers in infobox object. im getting read property 'add' error. in in stacktrace, taking me either line adding event handler, or when im checking if infobox has events attached it. i trying follow script here https://blueric.wordpress.com/2011/03/10/creating-hover-style-info-boxes-on-the-bing-maps-ajax-v7-0-control/ . given quite old, assume things might work in similar ways. edited: it seems has addhandler im confused on. function displayinfobox(e) { stopinfoboxtimer(e); console.log("after infobox timer"); if (_displayinfotype != "infobox") return; var replacecontent = infoboxtemplate; var ticket = e.target.ticket; var contenthead = "<ul>"; var contentend = "</ul>"; var content = ""; content += "<li><b>:</b...

javascript - Cannot dynamically create select with its options -

i tried dynamically create div select input inside turns out there empty div noting. as can see, $edurow div used container. trying solve in many ways still not working(always came empty div). i have clicking button dynamically create these select stuff after click. here function that's written inside document ready function. $("#addmoreedu").on('click', function() { var $edurow = $("#edu-row"); var select = $('<select />', { 'class': 'selectoption' }); $(select).append($('<option value="" disabled selected>degree option</option>')); $(select).append($('<option value="1">high school</option>')) $(select).append($('<option value="2">college</option>')) $(select).append($('<option value="3">bachelors degree</option>')) var div = $('<div />', { 'class...

ffmpeg - Experiences on building a video recorder for RTSP/RTP streams? -

i have store continuous video streams many ip cameras, video encoded in h.264 , audio in aac or mp3. recorded videos played on mobile devices on browsers. what best strategy build scalable recorder service ? what best storage format? mp4 ? should convert video directly mp4 ? or better store raw rtp ? whats best way ensure best reliability , less frame loses , avoid lost of sync between audio , video ? i want hear similar experiences thanks! what best strategy build scalable recorder service ? globally, 1 physical device (pc i.e) running main controller dameon, spawning 1 dedicated recorder camera. performance, in mono-device case, seems quite common me. what best storage format? mp4 ? resolution, compression, quality complex question can partially reducted simple maths : writing capacity = number or hard drive * hdd write bandwith - number of camera * encoded video bandwith. one other way of taking storage limit : storage limit = number or har...

validation - How to validate register page android -

edit: instance, if this: boolean thiscreateserror = false; if (thiscreateserror == true) { mlistener.register(username, password); } else{} 07-25 20:24:25.552 2385-2529/com.example.hoofdgebruiker.winkelskortrijk w/system: classloader referenced unknown path: /data/data/com.example.hoofdgebruiker.winkelskortrijk/lib 07-25 20:24:25.574 2385-2555/com.example.hoofdgebruiker.winkelskortrijk e/surface: getslotfrombufferlocked: unknown buffer: 0xb4017ef0 07-25 20:24:27.559 2385-2555/com.example.hoofdgebruiker.winkelskortrijk e/surface: getslotfrombufferlocked: unknown buffer: 0xaa1e6d10 edit2: i'm sorry. seem getting error every time try relaunch app after registering. maybe problem lies somewhere else? my database: public class mydbhandler extends sqliteopenhelper { private static final int database_version = 1; private static final string database_name = "winkelskortrijk.db"; private static final str...

identityserver3 - Using implicit flow to get Cookies -

using idserver3, owin, angular2, webapi, etc. i have 2 clients setup within idsrv, 1 mvc , 1 js/angular , i'm trying achieve sso. sso works if login through mvc app (hybrid flow) since set cookies in browser , picked when navigate login via implicit flow. if first attempt login via js app (implicit flow) no cookie set, , therefore no sso achieved. how can configure idsrv set cookies when login via implicit flow hybrid flow? edit: in other words, possible use bearer token auth webapi , cookie auth mvc , still acheive sso between two. edit 2: since answer confirmed understanding, rephrase question once more. using implicit flow in js (angular 2) client, how can token , cookie when authenticating via auth end point in idsrv? token returned. yes - because authentication session not maintained between idsrv , apps - between idsrv , browser. each app must set own session - mvc via cookie. in js typically using session storage. to go through scenario: open mvc a...

c# - Adding drop down list to mvc page -

this question has answer here: the viewdata item has key 'xxx' of type 'system.int32' must of type 'ienumerable<selectlistitem>' 1 answer this giving me hard time implement. i've generated controller , view handle updating model. however in create.cshtml need add drop down database users (using db.users.tolist()) populate dropdown. <div class="form-group"> @html.labelfor(model => model.userid, htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> // @html.editorfor(model => model.userid, new { htmlattributes = new { @class = "form-control" } }) @html.dropdownlistfor(model => model.userid, viewdata["u"] ienumerable<selectlistitem>) </div> </div> so i've taken @html.editorfor() , r...

c - Is a repeated macro invocation via token concatenation unspecified behavior? -

the c11 standard admits vagueness regard @ least 1 situation can arise in macro expansion, when function macro expands unenvoked name, , invoked next preprocessing token. example given in standard this. #define f(a) a*g #define g(a) f(a) // may produce either 2*f(9) or 2*9*g f(2)(9) that example not clarify happens when macro, m, expanded, , or part of result contributes via token concatenation second preprocessing token, m, invoked. question: such invocation blocked? here example of such invocation. issue tends come when using complicated set of macros, example contrived sake of simplicity. // arity gives arity of args decimal integer (good 4 args) #define arity(...) arity_help(__va_args__,4,3,2,1,) #define arity_help(_1,_2,_3,_4,_5,...) _5 // define 'test' mimic 'arity' calling twice #define test(...) test_help_a( arity(__va_args__) ) #define test_help_a(k) test_help_b(k) #define test_help_b(k) test_help_##k #define test_help_1 arity(1) #define test_he...

android - Multiaction not working -

i trying zoom using python-client of appium on android . default method zoom not work stating has not been implemented yet. tried multiaction . loc = self.element.location print loc xx, yy = loc["x"], loc["y"] xx=700 action1 = touchaction(self.driver) action1.long_press(x=xx, y=yy).move_to(x=0, y=1000).release() action2 = touchaction(self.driver) action2.long_press(x=xx, y=yy).move_to(x=0, y=-1000).release() m_action = multiaction(self.driver) m_action.add(action1, action2) m_action.perform() but again not perform zoom.instead scrolls down list.does have idea what's wrong here. appium logs [androidbootstrap] [bootstrap log] [debug] got data client: {"cmd":"action","action":"element:getlocation","params":{"elementid":"83"}} [androidbootstrap] [bootstrap log] [debug] got command of type action [androidbootstrap] [bootstrap log] [debug] ...

sql server - Return first row within CASE statement -

i have case statement within select returning many values, want first value since i'm doing count. select distinct atm.ticketid ,count(case when ((atm.priorityid='e' or atm.priorityid='u') , max(atq.questionid) 1 end)) [a] ..... for each 'e' , 'u' value, there many questionid's (joined table). need 1 questionid each e or u. i'm having difficulty nested aggregates. move priorityid clause select atm.ticketid, atm.priorityid, max(atq.questionid) atm inner join atq on {some criteria} atm.priorityid = 'e'or atm.priorityid = 'u' group atm.ticketid, atm.priorityid

javascript - Stumped on how to make local variables (colorSelect1, colorSelect2) global so that I can execute the logic statement -

i'm having difficulty determining why fails execute. when consoloe.log colorselect variables, return correct value. however, believe disconnect variables created within function , therefore not recognized global negates logic statement. suggestions on how circumvent issue? var colorselect1 = null; var colorselect2 = null; //selecting first color $(function() { $(".color1").click(function() { $(".color1").removeclass('active'); $(this).addclass('active'); var colorselect1 = $(this).css("background-color"); console.log(colorselect1); return colorselect1; }); }) //selecting second color $(function() { $(".color2").click(function() { $(".color2").removeclass('active'); $(this).addclass('active'); var colorselect2 = $(this).css("background-color"); console.log(colorselect2); return colorselect2; })...