Posts

Showing posts from June, 2014

imagemagick - add image to transparent section -

Image
i have image couple of transparent boxes. need insert specific images in transparent boxes. tried several convert commands couldn't end solution. i using windows 10 , imagemagick working on cli no issues. hope can point me right direction. let's 500x400 image starting image , has transparent holes in @ 10,10 , 250,250. now, let's have 2 mr beans, bean1.jpg , bean2.jpg this: let's lay out on red background can see going on. we'll resize bean1.jpg , place him in area of top-left transparent hole, we'll set bean2.jpg bottom-right transparent hole: convert -size 500x400 xc:red \ \( bean1.jpg -resize 101x101! -geometry +10+10 \) -composite \ \( bean2.jpg -resize 131x131! -geometry +250+250 \) -composite \ result.png now let's again, time, overlay original image beans peek through it: convert -size 500x400 xc:red \ \( bean1.jpg -resize 101x101! -geometry +10+10 \) -composite \ \( bean2.jpg -resize 131x131! ...

heatmap - Convolve a sector along a trajectory to make a heat map in python -

i have built vr arena fly. inside vr world, fly flies has objects in it. vr world built using panda 3d game engine. record trajectory of fly. obtain position (x,y) , heading (theta) function of time. briefly, trying is, heatmap of fly saw flew. heatmap representation of world intensities corresponding how visible fly. more fly stared @ particular place flying towards it, hotter regions get. trajectory plot explains path if fly point. doesn't convey fly saw flew. fly sees virtual world based on vr camera parameters. has field of view (fov), max draw distance , orientation (heading). traverses through world, sees sector (pie shaped wedge) of entire world. what want implement method keep count of how many frames each point on map came inside camera's fov (the sector). this naively results in sector traversing along trajectory , incrementing counter @ points inside sector. after entire traversal, need plot matrix heatmap. think fair representation of fly saw in it's t...

c# - Update dynamically column header within Repeater -

i want update text of column header based on type of object. let's have objecta , objectb; if objecta want appear in second column "a version". if not objecta (meaning objectb) update same column " b version" text. i have in .aspx file: <asp:repeater runat="server" id="rptbillheaders" onitemdatabound="rptbillheaders_itemdatabound"> <headertemplate> <table width="98%" align="center" class="grid" cellpadding="0" cellspacing="0" style="border:solid 1px #000000; border-top:none 0px #ffffff;"> <tr class="gridheaderrow"> <th>&nbsp</th> <th><asp:label runat="server" id="billversionlabel" ></asp:label></th> <th>action type</th> <th>doc # </th> ...

opengl es - Selecting GLES version in Google Cardboard Android SDK -

how cardboardview class in google cardboard sdk select opengl es version use? hoping literally inherited glsurfaceview use seteglcontextclientversion described here , looks that's not case. my goal select opengl es 3.0 -- of existing rendering code implemented on native side , depends on version. the cardboard sdk uses opengl es 2.0 compatible client. though doesn't seem officially supported, experience gl es 3.0/3.1 can used such context, provided phone supports es 3.x. can checked call: string version = javax.microedition.khronos.opengles.gl10.glgetstring( gl10.gl_version); more detail @ http://developer.android.com/guide/topics/graphics/opengl.html#version-check that said, looks should add proper support using es 3.x sdk, flagging this.

c# - How do I project models into viewmodels in XAML? -

given following classes: public class neighborhood { public ienumerable<house> houses { get; set; } } public class house { public address address { get; set; } public ienumerable<room> rooms { get; set; } } public class room { public ienumerable<furniture> furniture { get; set; } } i want views this: <!-- want datacontext neighborhoodviewmodel, not neighborhood --> <neighborhoodview> <listbox itemssource={binding houses}/> <button content="add house"/> <button content="remove house"/> </neighborhoodview> <!-- want datacontext houseviewmodel, not house--> <houseview> <textbox text={binding address}/> <listbox itemssource={binding rooms}/> <button content="add room"/> <button content="remove room"/> </houseview> <!-- want datacontext roomviewmodel, not room --> <roomview> <list...

python - How to deduct the current time from a set time -

so trying create 'planner' or diary. trying create code advises how time have left in day before go bed or before have activity have planned. late = timedelta(hours=23) current_time = now.hour,now.minute time_left = (late - current_time).minutes print 'so if time %s:%s, means have %s minutes left' % (now.hour,now.minute,time_left) from looking @ other threads approach have tried several other methods like late = datetime(datetime.day,datetime.month,datetime.year,23,00) again saw on other threads. have tried many methods have begun confuse myself how solve it. thanks again in advance edit: when using late = datetime(datetime.day,datetime,month,datetime.year,23,00) i got valuerror 'day out of range month' and current code late = timedelta(23,00) i got typeerror 'unsupported operand type(s) -: 'datetime.timedelta' , 'tuple' in example. i want code output time difference between 11:00pm (or 23:00) , current time in...

Autohotkey Open Folder of Current Application or Process -

in code no open current application folder because filepath variable include exe file name f11:: pid = 0 winget, hwnd,, dllcall("getwindowthreadprocessid", "uint", hwnd, "uint *", pid) hprocess := dllcall("openprocess", "uint", 0x400 | 0x10, "int", false , "uint", pid) pathlength = 260*2 varsetcapacity(filepath, pathlength, 0) dllcall("psapi.dll\getmodulefilenameexw", "uint", hprocess, "int", 0, "str", filepath, "uint", pathlength) dllcall("closehandle", "uint", hprocess) run, explorer %filepath% thanks in advance assistance. f11:: winget, path, processpath, splitpath, path, name, dir run, explorer.exe %dir% return or: f11:: winget, path, processpath, run, % "explorer.exe /select," . path return

Android Bitmap causing memory leak? -

i have tried solutions find , none of them help. of them talk recycling bitmap isn't option me. app doing image processing in separate thread ui , use paint draw solid circle @ location image processing algorithm returns. here code - private runnable runnetwork = new runnable() { public void run() { if(!destroyflag) { bprocessing = true; start = systemclock.elapsedrealtime(); locations = calltorch(torchstate, previewsizewidth, previewsizeheight, framedata,networkloop); stop = systemclock.elapsedrealtime(); wholeloop = (float) ((stop-start)*0.001); fps = 1/wholeloop; start = systemclock.elapsedrealtime(); if(locations[0] != 0) { bitmap.erasecolor(0); for(int = 0; < locations.length; i+=4) { if(locations[i+2] != 0) { ...

python - Is there a way to stop a command in a docker container -

i have docker container running command. in dockerfile last line cmd ["python", "myprogram.py"] . runs flask server. there scenarios when update myprogram.py , need kill command, transfer updated myprogram.py file container, , execute python myprogram.py again. imagine common scenario. however, haven't found way this. since command in dockerfile...i can't seem kill it. containers terminal when run ps -aux can see python myprogram.py assigned pid of 1. when try kill kill -9 1 doesn't seem work. is there workaround accomplish this? goal able change myprogram.py on host machine, transfer updated myprogram.py container, , execute python myprogram.py again. you use volumes mount myprogram.py source code on container, , docker stop , docker restart container. to make volume : add volume directive in dockerfile , rebuild image : volume /path/to/mountpoint and use -v option when running image. docker run -d -v /path/to...

c# - Linq query to select distinct record and count number of distinct record -

i have table tblvisitor stores visitors location details. has below structure. vregion nvarchar (100) null, vtimezone nvarchar (100) null, vlat nvarchar (max) null, //latitude vlong nvarchar (max) null, //longitude now, storage depends on each session , when session expires same location details might stored again. trying display in map , getting latitude , longitude details in model class. model class below: public class visitormapviewmodel { public int count { get; set;} public geocoordinate coords { get; set; } } am trying fill model below, no luck. list<visitormapviewmodel> model = new list<visitormapviewmodel>(); var data = _db.tblvisitors.distinct().tolist().select(v => new visitormapviewmodel() { coords = new system.device.location.geocoordinate(convert.todouble(v.vlat), convert.todouble(v.vlong)), count = _db.tblvisitors.groupby(m => new { m.vlat,m.vlong}).select(m=>...

ruby on rails - Issues using treetop parser library -

i trying create simple text parser in ruby using treetop. although have followed steps mentioned in blog , not being able run program. fails error message: user1-mbp15:source user1$ ruby myparser.rb (eval):28:in `_nt_expression': undefined local variable or method `_nt_space' #<sexpparser:0x007fad9b92b210> (nameerror) /usr/local/lib/ruby/gems/2.3.0/gems/treetop-1.6.5/lib/treetop/runtime/compiled_parser.rb:18:in `parse' myparser.rb:19:in `parse' myparser.rb:31:in `<main>' i not find lot of resources on web on treetop, glad help. following code: user1-mbp15:source user1$ ls myparser.rb node_extensions.rb sexp_extensions.rb sexp_parser.treetop -- myparser.rb -- # in file myparser.rb require 'treetop' # find out our base path $base_path = file.expand_path(file.dirname(__file__)) # load our custom syntax node classes parser can use them require file.join($base_path, 'node_extensions.rb') class parser # ...

dynamic - Having two dynamically selectInput in R shiny -

i'm trying create interface allows user choose how many columns focus on, , choose unique value in each column. the code have not match column value column name. work when pick 1 column. however, no work when there >1 column. 'choose attribute values' resorts first 'choose attribute'. want them compatible. library(shiny) ui<-shinyui(fluidpage(fluidrow(column(width = 4, numericinput("assets", label = "choose how many attributes produce in map:", value="1"), uioutput("variants"), uioutput("variants2") ) ))) server <-shinyserver( function(input, output, session) { df<-read.csv("diff_block.csv", stringsasfactors=false, colclasses="character") df$x<-null output$variants <- renderui({ numassets <- as.integer(input$assets) lapply(1:(numassets), function(i) { list(selectinput ("choose_columns", ...

mysql - Php PDO, Insert a changable varible -

test website: csgodice.co.uk i've been looking pdo, confuses me, 14 , im not knowledge mysql in php know use pdo , parts of databases, wondering how insert changable value, such balance, here information want insert table rows $conn->prepare("insert users (64id, balance, amountbet) values (?, ?, ?)"); $stmt->bind_param("sss", $64id, $balance, $amountbet ); // set parameters , execute $_64id = "$steamprofile['steamid']"; $balance = ""; $amountbet = ""; $stmt->execute(); i have connected mysql done, need know how insert rows? know there documentation topics on there differ trying do? take php documentation http://php.net/manual/en/pdostatement.bindparam.php <?php /* execute prepared statement binding php variables */ $calories = 150; $colour = 'red'; $sth = $dbh->prepare('select name, colour, calories fruit calories < :calories , colour = :colour'); $sth...

SSIS- OleDb Fast Load vs. Bulk Insert Task -

i have done research including threads on forum cant seem find answer. i loading text files 40 columns. no transformation @ time. there 8 files ~25mb total of 1,400,000 rows. using bulk insert task load completes in 3 minutes. using oledb destination , flat file input connection manager load completes in 30 minutes. from have read, ssis should using bulk inserts behind oledb connection. if so, why there such dramatic difference? must doing wrong, ideas? using defaults connection. table or view fast load. blank rows per batch , max commit size 2,147,483,674. using sql2016 have had similar results testing sql2014. you might not setting properties of data flow task such defaultbuffersize , defaultbuffermaxrows.

How to get the status of a subcommand in a bash script that is invoked with -e? -

i want write bash script -e option stops on error, want allow specific line return error code different 0 , use in logic: #/bin/bash -e do_something_and_return_errcode if [ $? -eq 2 ]; specific_stuff fi the script end in do_something_and_return_errcode . avoid doing do_something_and_return_errcode || true but make $? return 0 , cannot use $pipestatus because not pipeline. first, using set -e highly error-prone , , not universally agreed on practice. that said, consider: err=0 do_something_and_return_errcode || err=$? another option temporarily disable flag: set +e ## disable effect of bash -e / set -e do_something_and_return_errcode; err=$? set -e ## ...and reenable flag after

jquery - HTML anh Javascript ADD -

i have following code stat **javascript** var acc = document.getelementsbyclassname("item-wrapper"); var i; (i = 0; < acc.length; i++) { acc[i].onclick = function(){ this.classlist.toggle("selected"); this.nextelementsibling.classlist.toggle("show"); } } }); css .accordion-menu{ list-style: none;margin: 0;padding: 0; } .accordion-menu { text-decoration: none; background: none; font-family: arial; } .accordion-menu a:hover, .accordion-menu a:visited, .accordion-menu a:active, .accordion-menu a:focus{ background: none; } .accordion-menu li { cursor: pointer; background: none ; } ul.accordion-menu>li>.item-wrapper,li.item-wrapper { background: url("../images/bullet-1.png") no-repeat scroll 12px 14px , #242729 repeat-x 0 0; height: 45px; line-height: 44px; padding: 0px 35px; margin: 0; border-bottom: 1px solid #181818; border-top: 1px solid #454545; position: r...

javascript - Bookshelf registry plugin and node cirrcular dependency errors -

i tried use bookshelf got stuck undefined models errors. tried use "registry" plugin described in bookshelf registry wiki . actualy got error mentioned in github issue . there reference registry plugin , node circular dependency managment issuesmay cause it. tied replicate example in wiki. my code: db.js var client = require("knex"); var knex = client({ client: 'pg', connection: { host: '127.0.0.1', user: 'postgres', password: 'postgres', database: 'hapi-todo' }, pool: { min: 2, max: 10 }, debug: true }); var bookshelf = require('bookshelf')(knex); bookshelf.plugin('registry'); module.exports = bookshelf; user.js var db = require("../models/db"); require("../todos/todo"); var user = db.model.extend({ tablename: "users", todos: function () { return this.hasmany('todo', ...

angularjs - GET request format using mongoose and angular -

in regard getrooms function, expected console.log, on partial page load (/rooms) , array of objects containing roomname, moderator, , description outlined mongoose model (room) , data in db, render of information page. instead console logging appears index.html code response on client side , server never reached. post , put requests working, , although rudimentary, seems not understanding how go making request. if inform me how done properly, appreciate it. //roomcontroller.js angular.module('chatapp').controller('roomcontroller', ['$scope','$http','$location', '$cookies', function($scope, $http, $location, $cookies){ // $scope.rooms = [ // {'name': 'biology', 'description': 'discuss wonders of bio'}, // {'name': 'literature', 'description': 'from steinbeck shakespeare'}, // {'name': 'dark souls 3', 'description': ...

Angular 2: Import static json file? -

how import various json resource files component *.ts classes? need expose json files using "export"? unfortunately can't directly load json file need eather load file using http request or place json variables directly in component

c++ - I want to print the most visited sites/urls in the browser -

below code have written in c++ , printing wrong result 2nd , 3rd output line. not able figure out why happening. below code have written , functional code on visual studio. code expects 1 input file named urlmgr.txt content should urls. below sample urls using it. web.whatsapp.com web.whatsapp.com cplusplus.com/reference/algorithm/find_if stackoverflow.com/questions/760221/breaking-in-stdfor-each-loop mail.google.com/mail/u/0/#inbox http://stackoverflow.com/questions/18085331/recursive-lambda-functions-in-c14 mail.google.com/mail/u/0/#inbox en.cppreference.com/w/cpp/language/lambda https://www.google.co.in/?ion=1&espv=2#q=invariant%20meaning mail.google.com/mail/u/0/#inbox http://stackoverflow.com/questions/11699083/where-can-i-find-all-the-exception-guarantees-for-the-standard-containers-and-al https://www.google.co.in/?ion=1&espv=2#q=array+of+references:quora&start=10 mail.google.com/mail/u/0/#inbox web.whatsapp.com quora.co...

java - Sort a List of Objects by Date -

i have list of objects have retrieved webservice call. on other end, list of objects looks this: ({ead=3/11/2016, qty=8}, {ead=4/22/2016, qty=46}, {ead=10/26/2016, qty=34}) however, once list gets pulled salesforce, comes in format: ({ead=10/26/2016, qty=34}, {ead=3/11/2016, qty=8}, {ead=4/22/2016, qty=46}). i need keep first format. how do this? since list of objects can sort date using collections.sort ... example: public static void main(string[] args) { list<customsalesobject> mylist = new arraylist<customsalesobject>(); collections.sort(mylist, new comparator<customsalesobject>() { @override public int compare(customsalesobject o1, customsalesobject o2) { // todo auto-generated method stub return o1.getdate().compareto(o2.getdate()); } }); }

mysql - Having problems with getting a count in a select statement -

i have 5 tables follows: files tags profiles j_file_tags j_profile_tags so files can have tags, profiles give access tags. i put 2 queries following: get list of files specific profile has access (the profile must have access tags file might have) get list of tags profile has access , there @ least file in tag. what need query 2 count of how many files in tag. here's table structure , sample data: create table `files` ( `id` int(4) not null auto_increment , `filename` varchar(255) character set utf8 collate utf8_general_ci not null , `empid` int(4) not null , primary key (`id`) ) engine=innodb default character set=utf8 collate=utf8_general_ci row_format=dynamic; create table `j_file_tags` ( `id` int(4) not null auto_increment , `fileid` int(4) null default null , `tagid` int(4) null default null , primary key (`id`) ) engine=innodb default character set=utf8 collate=utf8_general_ci row_format=dynamic; create table `j_profile_tags` ( `id` int(4) ...

c# - Binding for Localization -

i'm working on solution localization problem. isn't normal language localisation. <label content="{binding mydictionary[a test], fallbackvalue=a test}"/> in practice above code calls dictionary in view model, declared as public dictionary<string, string> mydictionary the problem have define string "a test" twice in label. once in index in binding, , again in fallbackvalue. what end looks this... <label content="{binding mydictionary[a test]}"/> at moment happens when xaml designer in visual studio can't resolve mydictionary (as won't know datacontext can't hook viewmodel it's defined) means label display blank, won't make visual design harder. i've looked calling static method mydictionary function properly, needs instantiated in view model. is there way of having either index value "a test" show in designer without having use fallback value? the goal able have content ref...

javascript - Using Web API JSON Response from AngularJS - Error: expected and array but got an object -

i have web api returning response in json, in format: { "email": "john@google.com", "password": null, "accesslevel": 2 } i trying access accesslevel field within response, getting angular error: error in resource configuration action `query`. expected response contain array got object (request: http://localhost:51608/api/userrole?email=john@google.com...) this angular resource code (below), added isarray false attempt solve issue: function userroleresource($resource, appsettings) { return $resource(appsettings.serverpath + "/api/userrole?email=:email", { email: '@email' }, { get: { method: 'get', isarray: false } }); } and how attempting use data: userroleresource.query({ email: vm.userdata.email }, function (data) { vm.userdata.accesslevel = data.accesslevel; }); you're specifying 'get' function not array, you'r...

python - Open a video file with the default application in OS X -

i'm trying use python play video file stored locally on computer. more specifically, format .h264 , want open vlc media player. however, have tried far hasn't worked. i've tried using webbrowser.open(path_to_video_file)' didn't seem anything. i tried using subprocess.call('applications/vlc.app', path_to_video_file) , resulted in either [errno 13] (permission denied) if had slash in front of applications, or [errno 2] (file not found) if didn't have slash in front of applications. is there way open video file default player? thank you

android - Neo4j OGM Library Driver configuration -

i'm trying use neo4j ogm library 2.0.1 in android application. this builde.gradle file: dependencies { compile filetree(dir: 'libs', include: ['*.jar']) testcompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.3.0' compile 'org.neo4j:neo4j-ogm-core:2.0.1' compile 'org.neo4j:neo4j-ogm-http-driver:2.0.1' } then in oncreate() method inside main activity: configuration configuration = components.configuration(); configuration.driverconfiguration() .setdriverclassname("org.neo4j.ogm.drivers.http.driver.httpdriver") .seturi("http://socialphonebook:a24mwont0eapsi2ct679@socialphonebook.sb09.stations.graphenedb.com:24789/db/data/"); sessionfactory sessionfactory = new sessionfactory("it.lucaspuerari.entities"); sessionfactory.opensession(); i got error: e: fatal exception: main java.lang.nosuchmethoderror: no static m...

javascript - tab into a disabled field - set a delay? -

i new angularjs developer , have been stuck on bit. have input updates on blur so: <input ng-model="vin.value" ng-blur="onvinchange()" maxlength="22"> another select (custom built directive) relies on result onvinchange enabled or not. here other select: <auto-complete disabled="customer.selected.id === null || entryalreadyinsystem || customer.selected === ''"></auto-complete> the problem when auto-complete directive disabled previous attempt, if go input, change entry, , try tab in autocomplete again, onvinchange fires, autocomplete still disabled scrolls me way bottom of page , cursor doesn't move in autocomplete. angularjs way solve problem? when user tabs either allowed in input if it's enabled, or there's no scrolling action, perhaps allowed input, disabled. there anyway solve without setting delay on disabled attribute?

hadoop - Why does this example result in NaN? -

Image
i'm looking @ documentation statistics.corr in pyspark: https://spark.apache.org/docs/1.1.0/api/python/pyspark.mllib.stat.statistics-class.html#corr . why correlation here result in nan ? >>> rdd = sc.parallelize([vectors.dense([1, 0, 0, -2]), vectors.dense([4, 5, 0, 3]), ... vectors.dense([6, 7, 0, 8]), vectors.dense([9, 0, 0, 1])]) >>> pearsoncorr = statistics.corr(rdd) >>> print str(pearsoncorr).replace('nan', 'nan') [[ 1. 0.05564149 nan 0.40047142] [ 0.05564149 1. nan 0.91359586] [ nan nan 1. nan] [ 0.40047142 0.91359586 nan 1. ]] it pretty simple.pearson correlation coefficient defined follows: since standard deviation second column ( [0, 0, 0, 0] ) equal 0, whole equation results in nan.

OAuth2 to connect to a 3rd party API with Meteor, separate from user accounts -

i'm building integration greenhouse.io's ingestion api authenticates via oauth 2.0. in database, have collection both users , companies multiple users belong 1 company. want allow user associated company authenticate via oauth greenhouse api, allowing any user across company access api. my assumption need somehow authenticate oauth , store keys in customer document opposed user document. how go doing meteor 1.3? i'm using meteor 1.3 blaze / spacebars frontend. thanks :-) it's strange me there isn't obvious way in meteor. found discussion here links various projects achieve functionality: https://github.com/meteor/meteor/pull/1133

angular - use marked in Angular2 -

i'm trying make simple markdown inline editor angular2. tryed several approaches none seems work. installed marked npm , visible in projects node_modules directory. can import , recognized netbeans. when ever use nothing works , if open firefox debuger find localhost:3000/marked not found. i put markdown converter in service. looks following: import { injectable } 'angular2/core'; import * marked 'marked'; interface imarkdownconfig { sanitize?: boolean, gfm?: boolean, breaks?: boolean, smartypants?: boolean } @injectable() export class markdownservice { //private md: markedstatic; constructor() { //this.md = marked.setoptions({}); } setconfig(config: imarkdownconfig) { // this.md = marked.setoptions(config); } convert(markdown: string): string { if(!markdown) { return ''; } return markdown; //return this.md.parse(markdown); } } used works fine, except markdown not translated. if uncomment l...

c++ - Explosion of memory using std::map -

i have problem using std::map in c++ vs10. when run simple code std::map<int,int>mymap; for(size_t i=0;i<1000000;i++){ mymap[i]=i; } my memory explodes 256mo seems strange me. , if use std::vector<int>myvector(1000000); i obtain 4mo predicted. if can explain phenomena. std::map implemented red-black tree means following fields, assuming x64: red or black (1 boolean, 4 bytes due padding) parent (8 byte pointer) left child, right child (two 8 byte pointers) root object (8 byte pointer) data key (4 bytes int) data value (4 bytes int) this gets 44 bytes per item or 44 megabytes of memory. unlike in std::vector case each of these independently object adds 24 bytes of additional data. brings 68 megabytes. still quarter of seeing @ least can see why there huge difference in sizes.

elasticsearch - Error using Object Initializer syntax to create MultiMatchQuery -

i'm using nest 2.2.0 , trying build multimatch query follows: var searchquery = new multimatchquery() { fields = field<product>(p=>p.skuname, 2), query = "hello world" }; when run however, returns: the non-generic type 'nest.field' cannot used type arguments. i don't understand why i'm getting error, since i've more or less taken query straight documentation found @ https://www.elastic.co/guide/en/elasticsearch/client/net-api/2.x/multi-match-usage.html#_object_initializer_syntax_example_35 . in case matters, i've defined product follows: [elasticsearchtype(name="product", idproperty="id")] public class product { [nest.number(store = true)] public int id {get;set;} [string(name="name", store = true, index=fieldindexoption.analyzed)] public string skuname { get; set; } } is able help? the field type you're looking nest.infer.field var searchquery = ...

html - How to use repeated image as border with gaps -

Image
how can achieve dashed horizontal line image , control gaps between each in html/css? think javascript overkill this. im facing problem @ yellow marker, need dynamic. maybe has idea. try border-image property (used few years ago, worked need remember images scale under different independent-pixels resolutions (short version: different android devices can render scaled up/down), maybe case of proper scale unit - creating different image sizes that): https://developer.mozilla.org/en-us/docs/web/css/border-image

Typescript array of key value pairs declaration -

confused following declaration: constructor(controls: {[key: string]: abstractcontrol}, optionals?: {[key: string]: boolean}, validator?: validatorfn, asyncvalidator?: asyncvalidatorfn) what type of controls (first parameter)? object array of key value pairs key string , value abstractcontrol? thanks! yes, guessed, it's js object key string , abstractcontrol values. example: { "control1": new control(), "control2": new control() } edit you can declare variable of type in 2 ways: let controls: { [key: string]: abstractcontrol }; or interface controlsmap { [key: string]: abstractcontrol; } let controls: controlsmap; or better: interface controlsmap<t extends abstractcontrol> { [key: string]: t; } let controls1: controlsmap<abstractcontrol>; let controls2: controlsmap<mycontrol>;

javascript - Show password checkbox in ASP.NET MVC 4 -

how show or hide password on click of checkbox? model class- public partial class user { [required] public string username { get; set; } [required] [datatype(datatype.password)] public string password { get; set; } } and in view have done - @html.editorfor(model => model.password, new { htmlattributes = new { @class = "form-control" } }) so want add checkbox show , hide password. i searched can done of javascript in webform changing 'type' 'password' 'text' on click of checkbox here in mvc have mentioned datatype in model class. there way can change text using jquery or javascript? you can same thing in asp.net mvc since client side javascript. razor uses attributes render input elements. once rendered browser, can on rendered output client side javascript. assuming have checkbox id showpass @html.editorfor(model => model.password, new { @class = "form-control" } ) <input type=...

parameters - Does minpts=4 is the best setting for any dataset using DBSCAN algorithm for clustering? -

the article on dbscan " https://www.aaai.org/papers/kdd/1996/kdd96-037.pdf " explains minpts value must 4 datasets on dbscan being used clustering data points. gives best results eps value?? in later work, authors suggest use minpts = 2 * dim default. j. sander, m. ester, h.-p. kriegel, , x. xu. 1998. density-based clustering in spatial databases: algorithm gdbscan , applications. data mining , knowledge discovery 2, 2 (1998), 169–194. http://dx.doi.org/10.1023/a:1009745219419 if have duplicates, use larger value: " our experiments indicate value works databases d each point occurs once, i.e., if d set of points. " smaller values more computationally efficient. thus, keep minpts small not small. always study result. never use without double checking.

c# - Why does my list display with each object being "System.Collections.Generic.List`1[System.DateTime]" -

i want list starts 5 days before today , ends 10 days after today. in list want generate each day bullet point. i seem getting correct number of bullet points each 1 has value of system.collections.generic.list`1[system.datetime] my code below: @{ var dates = new list<datetime>(); var start = datetime.now; var end = start.adddays(10); (var dt = start; dt <= end; dt = dt.adddays(1)) { <li>@dates</li> dates.add(dt); } } displays: system.collections.generic.list`1[system.datetime] system.collections.generic.list`1[system.datetime] system.collections.generic.list`1[system.datetime] system.collections.generic.list`1[system.datetime] system.collections.generic.list`1[system.datetime] system.collections.generic.list`1[system.datetime] system.collections.generic.list`1[system.datetime] system.collections.generic.list`1[system.datetime] system.collections.generic.list`1[system.datetime] system.collections.generic.list`1...

ruby - Which version of gem is used when there is no Gemfile -

there similar question here. ruby: rails: version of gem used? but it's when gemfile used. i want know if there no gemfile, version of gem used. for example have 4 versions of selenium-webdriver in system. % gem list | grep selenium selenium-webdriver (2.53.0, 2.48.1, 2.46.2, 2.45.0) and use pry , require 'selenium-webdriver . how can know version used? latest selected? you have more 1 gem because each project gemfile in machine have 1 different version of it. when using gem via require or command line without specifying version last 1 - greater version - automatically used. by convention, in part of cases, can print version doing following: require 'some_gem' puts somegem::version # => "3.0.3"

unity3d - Sharing screenshot on windows phone in unity -

is there way share screenshot on unity windows phone using sharemediatask class in windows phone? dont want have app authentication want open share task . save screenshot in unity using texture2d.readpixels() then texture2d.encodetopng() , save file in local storage create event implemented on native side (visual studio) , invoke in unity build unity project generate visual studio project , implement event there - access stored png file , share it. source: unity interaction windows phone

node.js - Unexpected token ILLEGAL using node javascript -

i trying execute command using node javascript, getting "uncaught syntaxerror: unexpected token illegal" in javascript.its on line 1. var express = require('express'); var mongodb = require('mongodb'); var app = express(); var mongoclient = require('mongodb').mongoclient; var db; var port = process.env.port || 8080; mongoclient.connect(mongo_host, function(err, database) { if(err) throw err; db = database; app.listen(port, function () { console.log('listening port' + port); }); }); app.get('/', function (req, res) { res.json({ message: 'bienvenue azure!' }); }); app.get('/plante', function (req, res) { db.collection("plante").find().toarray(function(err, users) { res.send(users); }); }); nb: mongo_host git repository url connect azure then showing following error: syntaxerror: unexpected token illegal @ exports....

Comparing 2 lists/Tables in Javascript using Jquery -

i have 2 tables, table 1 , table 2. table 1 has 2 columns: col b | col c row 11 | row 12 row 21 | row 22 row 31 | row 32 table 2 has 2 columns: col b | col c row 21 | row 22 row 21 | row 01 row 11 | row 12 i want compare table 1 table 2 , few things; compare both tables , make sure missing values of table 1 added table 2 in same order. expected result col b | col c row 11 | row 12 row 21 | row 22 row 31 | row 32 row 21 | row 01 i tried implementing using foreach loop on both tables, assuming tables json structure i'm not sure if i'm doing right. best way achieve above results? thanks sample list: { "defaultvalue": [{ "cellvalues": [{ "defaultvalue": "row 11" }, { "defaultvalue": "row 12" }] }, { "cellvalues": [{ "defaultvalue": "row 21" }, { ...

How to export dependencies to different locations with Gradle? -

i wanted avoid creating different configurations because have many different behaviors associated dependencies, not one. so 'ext' properties able associate own data dependencies: runtime 'org.apache.logging.log4j:log4j-api:2.5' runtime 'org.apache.lucene:lucene-core:5.4.1' runtime('hsqldb:hsqldb:1.8.0.10') { ext.exportto = 'jdbc' } now want exploit copy dependencies 'libs/' default, , 'libs/${exportto}/' if exportto specified. task copyruntimelibs(type: copy) { "build/dependencies" configurations.runtime } so i'm trying create dynamically created configuration special dependencies, , dynamically created task job, link main task 'copyruntimelibs': configurations.runtime.alldependencies.withtype(externalmoduledependency).each { d -> if (d.hasproperty("exportto")) { def key = "${d.group}:${d.name}:${d.version}" def configname = "config-${key}" d...

java - Time out after waiting for visibility of element -

i'm having trouble consistently selecting flight return date travel search site. works, of time doesn't , i'm pretty stumped @ point. error i'm receiving is: exception in thread "main" org.openqa.selenium.timeoutexception: timed out after 20 seconds waiting visibility of element located by.id: ui-datepicker-div i've set few wait statements date elements i'm clicking against, i'm still receiving error. i'm trying find solution can avoid using thread.sleep. appreciated! here script: public class datepickertest { private static webdriver driver = new firefoxdriver(); static webdriverwait wait = new webdriverwait(driver, 20); public static void main(string[] args) { driver.get("http://lowfares.com"); selectdepartdate(2016, 5, 18); selectreturndate(2016, 5, 21); } public static void selectdepartdate(int year, int month, int day) { month--; // replacing 0 based index ...

javascript - While loop crashes with certain mathematical functions in jquery -

getting array php using ajax. in ajax, want break down array put parts divs. made code here selects parts fit , put them there: while (array[x] != null) { y = 0; if (2 < x) { if (x == 3) { x = 0; y = x; } else { y = x / 2 } } settimeout(function() { if (y == 0 || x % 3 === 0) { var namestring = array[y]; var namestring = array[y].replace('[', ''); var namestring = namestring.replace('[', ''); var namestring = namestring.replace('"', ''); var namestring = namestring.replace('"', ''); } if (y % 2 != 0 || y % 3 != 0 && x > 0) { alert(y); var date = array[y] var date = date.replace('"', ''); var date = date.replace('"', ''); } if (x % 2 == 0 && x > 0) { var text = array[y]; var text = text.replace('"', '...