Posts

Showing posts from January, 2014

influxdb - Difference between time series database and streaming analytics engine like spark streaming -

can time series database streaming analytics system (like spark streaming / flink / kinesis analytics) can? does 1 subsume other? not looking 1 better. understanding different use cases support. time series database: based on batch time limit data consume database. spark streaming : based on micro batch time data consume. spark streaming micro batch streaming system:

curl succeeds with oath2 but fails with node.js request -

the following curl request works properly, returning authentication token should curl post -s -d "grant_type=password&username=someusername&password=somepassword&client_id=someid&client_secret=somesecret&response_type=token" "someurl" when equivalent request in node.js fails let url = someurl var datastring = 'grant_type=password&username=somename&password=somepassword&client_id=someid&client_secret=somesecret&response_type=token'; var options = { url: url, method: 'post', body: datastring, allow_redirects : true }; function callback(error, response, body) { if (!error && response.statuscode == 200) { console.log(body); } console.log(error) console.log(body) } request(options, callback); the error is {"error":"unauthorized","error_description":"an authentication object not found in securitycontext"} which

javascript - One form by row (fields for every column) with buttons for each: how to manage the dirty state? -

i handle dirty state every single row have in table. unfortunately, adding form around break table, , can't create inside since have field every different column. last column each row contains buttons: delete , update. update appears if 1 of field of row has been made dirty. somehow, works checking each .pristine every field on row ( #name="ngmodel" ). rows created through *ngfor="let row of rows" . believe better check .dirty or .pristine on form rather on every single element. also, if update, there no way can remove .dirty status (i tried replacing data row removing array , re-adding still dirty). is there technique go around that? you use ngmodelgroup around each of rows. can check dirty flag group.

c++ - Is better to think of the '=' operator as morphing? -

this trivial question. i have minimal background in c++ , if remember correctly have been told think of operator way: int x = 1,y = 2; x = y; //put whatever in y x; but after reading lvalues , rvalues, think more suitable think of way: morph (change) whatever in x whatever in y. reason think because object referenced x semantically still same object right? not sure if makes difference data type int whether view replacement of it's value "put whatever in x y" or "morphing". anyway, online c++ standard draft concerning assignment operator describes process follows: 5.17 (2) in simple assignment (=), value of expression replaces of object referred left operand. not sure if answers question, taking formulation 1 "the value of object replaced, object remains same".

Updating WebPack 1 to WebPack 3 -

Image
i concept behind this boilerplate of separating frontend backend. trying update whole boilerplate starting webpack. version included in boilerplate webpack 1. tried upgrading version 3. apparently need upgrade version 2 since upgrading version 3 smooth , done through command line via updating webpack only. followed official guide , other separate ressources of course try modify webpack.config.js file. ended followong webpack.config.js file: still when run npm start fron client side following error: this debug file npm. var sgrid = require('s-grid'); var rupture = require('rupture'); var autoprefixer = require('autoprefixer'); var path = require('path'); var webpack = require('webpack'); var htmlwebpackplugin = require('html-webpack-plugin'); module.exports = { devtool: 'eval', entry: [ 'webpack-dev-server/client?http://localhost:3000', 'webpack/hot/only-dev-server',

java - Does Spring Security require the use of Spring Session? -

we looking externalize our sessions in memcached, various reasons specific our architecture, spring session not choice us. do, however, want utilize spring security secure application. do security-related features in spring security require spring session? features concurrent session control or csrf protection come mind features might require spring session. or, spring session not required @ all? no , spring security not depend on spring session library. have used spring security in several projects , never seen requirement of spring session. per default spring security uses standard httpsession in servlet api. framework highly customizable say, without have tested it, part switched out custom code stores state.

amazon web services - Output of sqoop verbose cannot be seen when run as a step in AWS EMR -

when run sqoop command script directly on cluster , redirect output file, files show proper , full content of sqoop logs. for example : sqoop import -libjars ...entire command &> sqooptest.log when open sqooptest.log shows entire map reduce log , how many records did , sqoop out. whereas when run command step in emr, sqooptest.log has first 4 lines , no mapreduce logs. please set $accumulo_home root of accumulo installation. slf4j: class path contains multiple slf4j bindings. slf4j: found binding in [jar:file:/usr/lib/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/staticloggerbinder.class] slf4j: found binding in [jar:file:/usr/lib/hive/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/staticloggerbinder.class] slf4j: see http://www.slf4j.org/codes.html#multiple_bindings explanation. slf4j: actual binding of type [org.slf4j.impl.log4jloggerfactory] note: /tmp/sqoop-hadoop/compile/f4ce67a476aa74d3d1a3e754a52582f2/queryresult.java uses or overrides deprecated api.

Replaceing Component in OpenMDAO Group -

in openmdao 0.x there 'replace' method let swap components, not clear can in 1.x. have problem outer loop algorithm has run multiple times, , in cases want swap computationally expensive custom mda component out metamodel component has same i/o. there quick , dirty way @ runtime? i define custom group class takes argument telling 1 use. rather use replace suggest re-instantiating whole problem , calling setup again. if, reason don't want call setup more once (maybe big model , setup slow), suggest create 2 problem instances. 1 have mmda , other have meta-model. in outer loop can call whichever 1 appropriate.

python - Cx_freeze excluding unwanted libs -

i trying exluce few libs not need in build when added list still shown in build log. this code build. from cx_freeze import setup, executable build_exe_options = {"excludes": ["tkinter", "pil"], "include_files": ['bin'], "optimize": 2} setup( author="secret", name="app", options={"build_exe": build_exe_options}, version="1.0", description="something", executables=[executable("app.py", base="console")]) what missing?

JavaScript Cross platform emojis in iOS and android -

Image
what best way obtain normal emoji (the yellow one, first in image) in android. if emojis come different colors (ios emojis). reason android doesn't have colored emojis. all emojis in android less first 1 shows '?' symbol. i need parse emojis in javascript didn't find library. maybe there replace function solves this. emojis first let's understand emoji is. emoji combination of many characters implemented in unicode. example, "light skin tone male shrug emoji" following 5 characters combined: 0x1f937 0x1f3fb 0x200d 0x2642 0xfe0f - 0x1f937: person shrugging - 0x1f3fb: light skin tone - 0x200d: 0 width joiner (used combine 2 characters, in case light skin tone person shrugging , male sign.) - 0x2642: male sign - 0xfe0f: variation selector-16 (used indicate emoji) unicode in javascript good news is, can remove 0x1f3fb version without skin tone. bad news however,

xml - JAXB XmlSeeAlso tag not working spring ws -

i consuming web service third party vendor, running strange issue.. jaxb unmarshaller trying instantiate abstract class (aparent) instead of subclass class child2 abstract parent class @xmlaccessortype(xmlaccesstype.field) @xmltype(name = "aparent") @xmlseealso({ child1.class }) public abstract class aparent extends anotherparent { @xmlattribute(name = "atoken") protected string atoken; .... } abstract child 1 class @xmlaccessortype(xmlaccesstype.field) @xmltype(name = "child1") @xmlseealso({ child2.class }) public abstract class child1 extends aparent { .... get/set } concrete - child 2 class @xmlaccessortype(xmlaccesstype.field) @xmltype(name = "child2") public class child2 extends child1 { .... get/set } org.springframework.oxm.unmarshallingfailureexception: jaxb unmarshalling exception; nested exception javax.xml.bind.unmarshalexception: unable create instance of chil

elixir - Autogenerate Ecto Schema from Postgres Database or DDL, SQL -

i considering try elixir next project. have been working postgresql sqlalchemy in python , has paid off of have autogeneration tool generates model code database directly. there equivalent sqlacodegen in elixir/ecto? you can try take @ library plsm have not been using rely on awesome phoenix generator commands instead.

reactjs - Shadow DOM retargeting and Radium :hover -

i ran issue while using react inside shadow dom. i've been using setup similar handle event retargeting. https://github.com/lukasbombach/react-shadow-dom-retarget-events/blob/master/index.js radium ':hover' doesn't work when wrapping react components the issue radium uses onmouseenter , onmouseleave. because of way bubbling works these events won't see these events firing when interacting elements inside shadow dom. solution jeff dolle , worked out dispatch onmouseenter events when onmouseover events firing target element , onmouseleave events when onmouseout events firing.

testing - how to use test selector plugin of jenkins in windows? -

this plugin can used in ubuntu environment,now want use in windows7,but there problem of "file doesn't exist or jenkins doesn't have permission file." of course file path correct because in setting step,jenkins can fetch properities file , above problem shown in building step.

android - How verify the order of mock methods in JUnit -

i have class these structure , need test behaviour of onrequestlistoflunchsfinished interface @override public void getlistoflunchs(final onrequestlistoflunchsfinished callback) { zip().onerrorresumenext(new function<throwable, observablesource<? extends lunchserviceresponse>>() { @override public observablesource<? extends lunchserviceresponse> apply(@nonnull throwable throwable) throws exception { callback.onerror(new runtimeexception(throwable)); callback.onend(); return observable.empty(); } }).subscribe(new consumer<lunchserviceresponse>() { @override public void accept(lunchserviceresponse response) throws exception { list<lunch> result = new arraylist<>(); list<ingredientresponsevo> ingredients = response.getingredients(); map<integer, ingredient> hash = new hashmap<integer, ingredient>();

scala - How can I convert an arbitrary number of columns in a Spark dataframe from Timestamps to Longs? -

i'm writing in scala , using spark 1.6, , don't have option switch newer version. i'm attempting merge 2 dataframes, 1 pulled in avro files on hadoop cluster , 1 pulled in teradata db. can read them both in fine, , both guaranteed have same column names in same order, when try merge them using data1.unionall(data2) i hit error because avro converts timestamps longs, datatypes of 2 don't match fields. process repeated several times , know there @ least 1 timestamp field in tables, there can possibly more , not know names, i'm attempting make general method convert arbitrary number of columns timestamp longs. have far: def transformtimestamps(df: dataframe): dataframe = { val convert_timestamp_udf = udf((time:timestamp) => time.gettime()) df.dtypes.foreach { f => val fname = f._1 val ftype = f._2 if (ftype == "timestamptype:) { println("found timestamp col: " + fname) df.withcolum

javascript - Pivot data using lodash -

i need convert the init array final array preferably using lodash. initarray = [ { "date":"2017-08-15", "data":[ { "color":"orange", "count":100 }, { "color":"green", "count":101 } ] }, { "date":"2017-08-14", "data":[ { "color":"orange", "count":102 }, { "color":"green", "count":103 } ] } ] finalarray = [ { "color":"orange", "data":[ 100, 102 ] }, { "color":"green", "data":[ 101, 103 ] } ] this way seems lodash calls make sense me. //

java - How to write a 'get/set method' for an array of type class? -

i'm having trouble in implementation of get/set method array autores[] of type autor class same package. doesn't work in same way other variables of class :( class autor { private string nombre; private string adscripcion; autor(string nombre,string adscripcion) { this.nombre=nombre; this.adscripcion=adscripcion; } autor(){} string getnombre() { return nombre; } string getadscripcion() { return adscripcion; } void setnombre(string nombre) { this.nombre=nombre; } void setadscripcion(string adscripcion) { this.adscripcion=adscripcion; } } public class articulo { private string nombreart; private autor autores[]=new autor[2]; private string fechapublicacion; articulo(string nombreart,string fechapublicacion, string nombre,string adscripcion) { this.nombreart=nombreart; this.fechapublicacion=fechapublicacion; autores[0]=new autor(nombre,adscripcion); autores[1]=new autor(nombre,adscripcion); } string getnombreart() {

javascript - Screeps - Unable to access Creep Memory -

Image
i'm relatively new screeps, , i've been working towards building own basic ai system. however, i've run snag in initial testing. have script determines jobs do, , creeps request available jobs. i've been able store job object creep's memory, cannot recall later. i can confirm in memory tab of information there, , stored correctly, when try access it, ever undefined . i create jobs using template function: jobfactory: function() { // generates blank job template var job = { 'id': null, // id of job double id of target (ie. energy source id) 'type': null, // used classify job tickets extent 'spots': 0, // total # of creeps can assigned 'workers': [] // current # , ids of creeps assigned }; return job; }, then i'm able store fine with: creep.memory.job = job; how i'm trying acce

google maps - Android - How to show nearby user markers? -

Image
i have android app users can register , when logged in location visible markers on map shown in image. want show nearby marker within 100 meters. please me exact coding section , object initialization. here code fetching user markers(lat,lng) database: private void getnearbymarkers(){ geofireref.addvalueeventlistener(new valueeventlistener() { @override public void ondatachange(datasnapshot datasnapshot) { (datasnapshot locationsnapshot : datasnapshot.getchildren()){ locationdata locations = locationsnapshot.getvalue(locationdata.class); final double templat = double.parsedouble(locations.getlatitude()); final double templng = double.parsedouble(locations.getlongitude()); final string uid = locations.getuid(); databasereference3.addvalueeventlistener(new valueeventlistener() { @override public void ondatachange(datasnaps

wpf custom combobox with datagrid but after popup dorpdown the first item is not selected -

i have customed wpf combobox datagrid in it. after click toggle button of combobox, open dropdown popup , show datagrid image below. cilck toggle buttom show whole result now question why first item in datagrid in dropdown popup not selected?and if after press down arrow key, select second(like image below press down arrow key right after dropdown shows ) item makes me fell first item somehow selected highlight background not shown. focus or else? no idea here , in advance.

ruby on rails - Net::SMTPAuthenticationError (535 5.7.3 Authentication unsuccessful while sending email using Action Mailer and office 365 email -

i have code on production.rb , development.rb. config.active_record.dump_schema_after_migration = false config.action_mailer.perform_deliveries = true config.action_mailer.default_url_options = { host: 'mydomain.com' } config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { address: 'smtp.office365.com', port: '587', authentication: 'login', domain: 'mydomain.com', user_name: "username@mydomain.com", password: "password", enable_starttls_auto: true, openssl_verify_mode: 'none' } i trying send mail office 365 mail account using action mailer. sends mail fine on localhost. raises following error during production. using digitalocean server. app 7718 stdout: [7bd99d32-f3c4-49c3-abfd-ff19fa7ddb8a] completed 500 internal server error in 8800ms (activerecord: 1.6ms) app 7718 stdout: [7bd99d32-f3c4-49c3-abfd-ff19fa7ddb8a] a

How do I declare a variable in PHP without displaying its value in my html? -

i working in wordpress website , need pass url of page argument of function. in case using bloginfo('url'); to retrieve base url of site. so code is <?php $portfolio_link = bloginfo('url'); if ( ! function_exists( 'ow_nav' ) ) { function ow_nav( $nav_position ) { ?> <nav id="ow-nav-<?php echo $nav_position; ?>" class="ow-nav clearfix ow-nav-<?php echo $nav_position; ?>"> <ul class="ow-nav-list"> <?php ow_nav_item( '#home', 'home' ); ?> <?php ow_nav_item( '#about', 'about' ); ?> <?php ow_nav_item( '#criteria', 'investment criteria' ); ?> <?php ow_nav_item( '#approach', 'approach' ); ?> <?php ow_nav_item( '#team',

node.js - No such file or directory when piping from request in Node -

i need request .zip file url pass contents admzip when attempting pipe output of request library: const zipfilepath = path.join(batchpath, this.zipfile.filename); const out = fs.createwritestream(zipfilepath); const req = request.get(this.zipfile.url); req.pipe(out); req.on('end', function() { console.log("i should here, i'm not"); }); i receive: error: enoent: no such file or directory, open 'c:\users\brandon\work\keystone4-projects\html-email\batch-content\5996588a3bc30010502bfa9e\test.zip' what doing wrong? edit: i added: if (!fs.existssync(batchpath)) { fs.mkdirsync(batchpath); } before attempting pipe output , function completed successfully. typically when receive error when writing file, means path leading file being written not exist.

javascript - Creating a big Object that has two methods, one of which creates a particular instance of the big Object -

i learning javascript , trying make following: create "complexnum" represents structure of complex numbers. want object have 2 methods, first 1 called "newcomplex" function needs 2 inputs: real part , imaginary parts, , returns new object complex number specified real , imaginary parts) , 1 method: norm, calculates norm. the second method "sum" , needs 2 inputs: 2 complex numbers (as defined newcomplex), , returns object, complex number, sum of 2 previous complex numbers. this solution: var complexnum= { newcomplex: function(real,img){ var z ={ partreal: real, partimg: img, norm: function(){ var norm= math.sqrt(this.partimg*this.partimg + this.partreal*this.partreal ); return norm; } } return z; }, sum: function(a,b){ var real = a.partreal + b.partreal; var img = a.partimg + b.partimg;

Comparison method violates its general contract while comparing java.util.Date -

i getting error below: caused by: javax.faces.el.evaluationexception: java.lang.illegalargumentexception: comparison method violates general contract! @ javax.faces.component.methodbindingmethodexpressionadapter.invoke(methodbindingmethodexpressionadapter.java:101) [jboss-jsf-api_2.1_spec-2.1.28.sp1-redhat-1.jar:2.1.28.sp1-redhat-1] @ com.sun.faces.application.actionlistenerimpl.processaction(actionlistenerimpl.java:101) [jsf-impl-2.1.28.redhat-10.jar:2.1.28.redhat-10] @ javax.faces.component.uicommand.broadcast(uicommand.java:315) [jboss-jsf-api_2.1_spec-2.1.28.sp1-redhat-1.jar:2.1.28.sp1-redhat-1] @ javax.faces.component.uiviewroot.broadcastevents(uiviewroot.java:786) [jboss-jsf-api_2.1_spec-2.1.28.sp1-redhat-1.jar:2.1.28.sp1-redhat-1] @ javax.faces.component.uiviewroot.processapplication(uiviewroot.java:1251) [jboss-jsf-api_2.1_spec-2.1.28.sp1-redhat-1.jar:2.1.28.sp1-redhat-1] @ com.sun.faces.lifecycle.invokeapplicationphase.execute(invokeapplicationpha

node.js - Sending script from client to server to client on a web game -

there's simple smartfoxserver based web game im trying send scripts client<->server isn't quite working, appreciated! when try run nothing happens , makes me run again. var net = require('net'); var express = require('express'); var ajconnection; var io = require ('socket.io') var app = express(); app.use(express.static('c:\\users\\tyree\\desktop\\animaljamwip')); var server = net.createserver(function(c) { //'connection' listener flashconnection = c; console.log('flash connected, connecting aj'); // connect aj when flash connects node ajconnection = net.connect(443, '52.42.109.183', function () { console.log('aj connected'); io.sockets.on("connection",function(socket) { var message_to_client = { data: "connection server established" } socket.send(json.stringify(message_to_client)); c

ios - How can I disable landscape orientation universally? -

Image
i'm trying disable landscape mode app , turned off settings here this turns off landscape iphone not ipad, went info.plist , tried removing last 2 when submitted build itunes connect said need there... don't know if there's way disable horizontal mode ipad? want portrait mode thing on iphone , ipad. this error get. thanks! hope can help! try check requires full screen , think opt app out of multitasking , wont prompt error anymore when compile

internet explorer - Why meta tag in IE11 behaving differently -

whenever there 2 consecutive calls hit ie 11 browser, throws exception whereas not case lower ie versions. it happening in ie 11 because code has 1 meta tag (<meta http-equiv="x-ua-compatible" content="ie=edge"/> ) pointing edge. upon changing lower version not seeing issue. so, need support understand why ie 11 throwing exception when receives 2 consecutive calls didn’t clue on googling this.

html - IONIC 2 radio button inside Virtual scrolling ,multiple option getting selected automatically if I select any one of the option -

here code virtual scrolling <ion-list [virtualscroll]="options" *ngif="options.length>99" radio-group style="opacity: 0.9;"> <ion-item *virtualitem="let option"> <ion-label style="font-size: 12pt" text-wrap>{{ option.optiontext }} </ion-label> <ion-radio value='{{ option.optionid }}' (ionselect)="setselectedoption(option)"></ion-radio> </ion-item> </ion-list> any appreciated thanks edit-i found out issue has been raised on github still if me workaround helpful ok you're looking workaround. if @ docs <ion-radio> , there option called checked , normal radio button. mean this: <ion-radio value='{{ option.optionid }}' (ionselect)="setselectedoption(option)" [checked]="ischecked(option.optionid)"></ion-radio> ts options: = []; selectedoptions: number[] = []; const

linux - Remote access development -

i'm semi-retired person doing application development intellij and/or eclipse. "getting on in years" laptop still serves me pretty slow development. don't want splash out on new laptop @ point. i tried using wife's newer i7 computer windows 10 home , vnc remote access development stability disaster. performance boost wasn't enough justify considering pro upgrade. i'm thinking getting 1 of compact computers development. more recent, faster cpu, more ram , smallish ssd should lot cheaper flashy new laptop grunt development. (1) i'd happy hear comments has experience doing development remote access (on local lan) intellij and/or eclipse. practical? i have plenty of experience using microsoft's remote desktop (rdp) , found stable on years. (2) if put linux on new pc, save windows pro cost, there good, stable remote access protocol/tool windows 10 linux. x-server seems candidate. windows clients? make stable remote access development envir

webpack dev server restart does not reflect in browser -

i'm trying write tool gradually builds list of webpack entry points user things. uses webpack dev server. it's on latest webpack (v3) , webpack dev server. every time user takes action, code runs. function restartwebpack(newconfig){ server.close(); let compiler = webpack(newconfig); server = new webpackdevserver(compiler, { stats: { colors: true } }); server.listen(port); } the problem when go browser , try hit new entry point, 404 dev server. the weird part if open incognito window, new entry point works. have open new incognito window add third new entry point. note have no issues when curl dev server terminal. i tried clearing cookies , cache data, nothing let me open new entry points short of opening new browser window. is there option can enable or can new entry points load immediately?

Spring Boot + Spring Security does not work with Google App Engine -

i trying build rest api spring boot , spring security. i able perform curd operation google sql cloud on google app engine when have integrated spring security @ time application working on local google compute engine when pushed google app engine @ time give me error when try access application browser the server encountered temporary error , not complete request. please try again in 30 seconds. i have check google logging give me error 2017-08-18t04:11:08.114213z 96112 [note] aborted connection 96112 db: 'grails' user: 'root' host: 'cloudsqlproxy~35.188.174.233' (got error reading communication packets) can tell me problem?

swift - How to repeat and end repeat local notification is iOS 10? -

the system app 'reminder' can set repeat , end repeat, ios 10 usernotification.framework not support function. using uncalendarnotificationtrigger push local notification. how can implement repeat , end repeat function? thanks. let datec = calendar.current.datecomponents([.day, .hour, .minute], from: startdate!) let trigger = uncalendarnotificationtrigger(datematching: datec, repeats: true) let content = unmutablenotificationcontent() content.title = "title" content.body = "body" let request = unnotificationrequest(identifier: testidentifier, content: content, trigger: trigger) center.add(request) { (error) in if let error = error { print(error) return } print("scheduled") }

c# - Execute a cmd file from IIS8 -

i have piece of code generates excel inbuilt functions string xmlfilepath = "c:\\test\\standard_xml.xml"; string script = "c:\\test\\script.vbs"; string template = "template"; string cmdfilepath = @"c:\\test\\executable.cmd"; if (file.exists(cmdfilepath)) { file.delete(cmdfilepath); } using (filestream fs = file.create(cmdfilepath)) { byte[] info = new utf8encoding(true).getbytes("\"" + script + "\"" + " " + "\"" + template + "\"" + " \"" + xmlfilepath + "\""); fs.write(info, 0, info.length); } var process = process.start(cmdfilepath); process.waitforexit(); this codes generates excel , required operations. this works pretty fine when testing in visual studio, when run on iis8 never works. have tried various solutions mentioned on web nothing worked. any appreciated. without knowing

angular - Map Firebase snapshot data to Typescript class -

im stuck mapping firebase data(in json string) simple typescript class this json string : { "-krgnlvkqpvwuyfxbco9":{ "category_icon":"https://firebasestorage.googleapis.com/v0/b/app_name.appspot.com/o/category%2fscreenshot%20(12).png?alt=media&token=6ef40a19-0ef8-440c-80ec-b12b3faa2d1e", "category_name":"sunglasses", "date_added":"23456789" }, "-krgnppcnk2mzdea2mc-":{ "category_icon":"https://firebasestorage.googleapis.com/v0/b/app_name.appspot.com/o/category%2fscreenshot%20(12).png?alt=media&token=802e2b07-aeda-47db-81f1-48fffbc76f27", "category_name":"eyelenses", "date_added":"23456789" } } this typescript class : export class category { category_name: string; category_icon: string; date_added: string; } im using http request : //this in

mongodb - Select documents where doc.arr[i]>n -

i have collection elements this: { name: "smith", fields: [10, 20, 30] } is there way select documents second value of fields array ( fields[1]) > 15 ? one solution is: //create multikey index on field db.test.createindex({"fields.1" : 1}) db.test.find({"fields.1" : {$gt : 15}})

ios - scroll along with page when touch on I frame. (in apple device it is not working) -

when touch frame , scroll scroll along page need scroll contain can (scrolling on apple device not working in android device, working charmingly). according apple ios mantra, should possible scroll contents of iframe dragging 2 fingers. i-frame code /// video url split var url = result[i].image_url; if(url.indexof('?v=') > -1) { var split = result[i].image_url.split('?v='); var code = split[1].split('&'); url = "http://www.youtube.com/embed/" + code[0]; } else if(url.indexof('/v/') > -1) { var split = result[i].image_url.split('/v/'); // var code = split[0] + '/embed/' + split[1]; url = "http://www.youtube.com/embed/" + split[1]; } html += "<iframe width='100%' height='500' src='"+ url +"' allowfullscreen='' frameborder='0'></iframe>"; html += "</div>" // html += "</div><div

java - Latest method for getting "Sister Database" in mongodb -

i've been using com.mongodb.db in previous projects upto now. since, getdb() method deprecated , use getdatabase() instead. need change db class mongodatabase class work(i guess?). problem i'm facing class is, there no getsisterdabatase() method found in class. know how access "sibling database" using mongodatabse class? in advance! have checked db.getsiblingdb(name) ? please specify mongodb version, jdk version , driver. using driver mongodb driver 3+ , has getsisterdb(name).

Why encoding a string in php and in java is different from each other? -

php function encrypt($string) { $key_para = "aibl_#0#0!0!@"; $result = ''; $test = ""; for($i=0; $i<strlen($string); $i++) { $char = substr($string, $i, 1); $a = ($i % strlen($key_para))-1; $keychar = substr($key_para, $a, 1); $inte = ord($char)+ord($keychar); echo $i.'='; echo $inte; echo '</br>'; $char = chr($inte); $result.=$char; } echo '</br>'; echo $result; $base64t = base64_encode($result); $res = urlencode($base64t); $f_data = str_replace("%", "_", $res); return $f_data; } java public static string encrypt(string str) throws unsupportedencodingexception { string key_para= "aibl_#0#0!0!@"; string result =""; for(int i=0; < str.l

php - Call other Domain/Server to get a cookies value -

we have 2 domains( xxx-source.com , xxx-client.com ) in xxx-source.com , have cookies save there. in xxx-client.com , need check if cookies exist on xxx-source.com . i tried several methods no success. ========= method 1 ========= : xxx-client.com: file_get_contents( 'http://xxx-source.com/checkcokie.php' ); xxx-source.com/checkcokie.php: if ( isset( $_cookie["some-name"] ) ) { echo $_cookie["some-name"]; } else { echo "not cookie found"; } i'm getting "not cookie found". kinda understand why getting since getting file server , no users browser factor. ========= method 2 ========= : i found here in on similar post not solved proble, /* step 1. let’s create cookie file */ $ckfile = tempnam ("/tmp", "curlcookie"); /* step 2. visit homepage set cookie */ $ch = curl_init ("http://somedomain.com/"); curl_setopt ($ch, curlopt_cookiejar, $ckfile); curl_setopt ($ch, curlop

msbuild - Setting of BaseIntermediateOutputPath prevents running .targets from Nuget -

i have msvs 2017 (15.3) , following problem. project references system.data.sqlite contains targets file copies native dlls output folder. works correctly (dlls appear in correct place) until specify value baseintermediateoutputpath parameter in props file. after setting parameter build successful dlls missing. project file: <project sdk="microsoft.net.sdk"> <propertygroup> <outputtype>exe</outputtype> <targetframework>net452</targetframework> </propertygroup> <import project="common.net.props" /> <itemgroup> <packagereference include="system.data.sqlite" version="1.0.105.2" /> </itemgroup> imported props has following content <project> <propertygroup> <solutiondir>$(msbuildthisfiledirectory)</solutiondir> <configuration condition="$(configuration) == ''">debug</configuration> &

css - Bootstrap carousel different height images cause bouncing -

i've been using bootstrap 3.3.7v's carousel class , has been straightforward far, 1 problem i've had images of different heights cause divs under bounce , images overflowing out carousel. have googled , followed of answers in stackoverflow, not solved problem. request briefly explain issue. <div class="col-md-6" style="padding:0px;"> <div id="carousel-example-generic" class="carousel slide" data- ride="carousel"> <!-- indicators --> <ol class="carousel-indicators"> <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> <li data-target="#carousel-example-generic" data-slide-to="1"></li> <li data-target="#carousel-example-generic" data-slide-to="2"></li> </ol> <!-- wrapper slides --> <div class="c

amazon web services - How to associate existing autoscaling group to elastic beanstalk environment? -

i have python web application need deploy on aws. when try create environment beanstalk wizard tries create new security group, launch configuration , autoscaling group. problem don't have rights create new security group , provided pre configured security groups, autoscaling groups , launch configuration else. launch configuration created copying launch configuration created beanstalk wizard if beanstalk wizard allowed create security groups , all. have bootstrapping code. how create beanstalk environment use existing autoscaling , security groups ? don't see option on ui wizard. couldn't find if possible achieve .ebextensions. elastic beanstalk uses aws cloudformation manage resources uses. cloudformation cannot use existing resources. the auto scaling group, security groups, etc. must created elastic beanstalk. you need go team (that provided resources) , work permission issues out. or don't use eb.

jsf - Datatable Row expansion not working with filter -

i have datatable both row toggle expansion , filter option. on expanding, datatable comes , gets populated different table in db. when not filtering value, expansion works fine , other datatable getting populated. when filtering , clicking on expand button, it's showing no records found in second datatable. xhtml code <p:datatable var="data" value="#{list.trackinglist}" rows="10" paginator="true" paginatortemplate="{currentpagereport} {firstpagelink} {previouspagelink} {pagelinks} {nextpagelink} {lastpagelink} {rowsperpagedropdown}" rowsperpagetemplate="5,10,15" widgetvar="tracktable" emptymessage="no entries found given criteria"> <f:facet name="header"> summary </f:facet> <p:column

Android studio's adb is ignored for running the android emulator -

i have react native project using expo. can run ios simulator using, works fine npm run ios i have installed android studio , has required sdks , other stuff required in react native documentation. also, have installed genymotion android emulator , changed adb section custom directory android studio's director sdk is, located in ( /users/robin/library/android/sdk ). however, can't run android simulator. if run command: npm run android i error: error running adb: no android device found. please connect device , follow instructions here enable usb debugging: https://developer.android.com/studio/run/device.html#developer-device-options . if using genymotion go settings -> adb, select "use custom android sdk tools", , point @ android sdk directory. so checked adb running from: $ adb /usr/local/bin/adb however, adb of android studio located in /users/robin/library/android/sdk/platform-tools/adb i think android studio's adb not runnin

How to prevent WPF+win32 app taskbar icon from changing to Citrix default icon when run in Citrix? -

i have wpf application lots of native code , win32 windows. program's application's icon defined in vs2015 project ..\gui\rc\myapp.ico. when start program in xenapp citrix: splash appears wpf login window appears correct app icon in taskbar after login splash appears again , taskbar icon disappear next win32 window appears taskbar icon. while loading large amount of data, taskbar icon citrix-icon, when ready correct app icon switched back after closing win32 dialog mainwindow appears citrix-icon in taskbar. the win32-dialog (steps 4-5) before mainwindow can skipped resulting mainwindow opened after splash citrix taskbar icon. steps above because while dialog loading taskbar icon citrix. myapp.ico 160x160 pixels 32 bit depth. when mainwindow created during initialization showintaskbar set false. when ready set true. done because want show other window(s) before mainwindow unfinished mainwindow somewhere outside screen(s) , don't want accessible taskbar.

javascript - Prevent closing of sub-menu in kendo context menu until user hovers on another menu item or clicks outside/another menu item -

Image
please refer sample : https://dojo.telerik.com/eqali since sub-items quite small in length on hovering on menu, sub-menu closes loses focus. requirement once sub-menu opened, should not close until user hover on menu item or clicks on item. should remain opened if mouse focus leaves sub-menu works in explorer context menu shown in image below: i have made more changes , have achieved desired results can seen in following sample: https://dojo.telerik.com/eqali/2 here issue if hover on menu-item not have children, opened sub-menu item not closed until hoverdelay fired. any suggestions on how can achieved ? kendo has changed it's contextmenu options: can add 'openonclick' option 'submenuitems' , 'rootmenuitems': openonclick: { submenuitems: true, rootmenuitems: true } http://docs.telerik.com/kendo-ui/api/javascript/ui/menu#configuration-openonclick maybe helps you!

How to iterate through classes in jQuery? -

the problem cards same color, each card given 1 of 5 colors @ random when page loads. here code trying use: $( document ).ready(function() { onetofive = math.floor((math.random() * 5) + 1); switch (onetofive) { case 1: randcolor = "rgba(255, 255, 255, 0.25)"; break; case 2: randcolor = "rgba(0, 0, 255, 0.25)"; break; case 3: randcolor = "rgba(0, 0, 0, 0.25)"; break; case 4: randcolor = "rgba(255, 0, 0, 0.25)"; break; case 5: randcolor = "rgba(0, 255, 0, 0.25)"; break; default: randcolor = "rgba(122, 122, 122, 0.25)"; break; } $(".card-color").each(function(){ $(".card-color").css("background-color", randcolor); }); }); the main issue logic generate randcolor once

switch case multiple range in C -

switch (mark / 10) { case 10: case 9: case 8: printf("the grade a.\n"); break; case 7: printf("the grade b.\n"); } } } mark >= 75 gives grade a. may know how edit case 7 can detect 75 , above grade a. thank you! if plan use gcc can use switch ranges: https://gcc.gnu.org/onlinedocs/gcc/case-ranges.html switch (mark) { case 75 ... 100: printf("the grade a.\n"); break; case 70 ... 74: printf("the grade b.\n"); break /*....*/ }

java - URISyntaxException on Mac but not Windows -

i've been having issue when use url.tostring() on windows exception saying: illegal char <:> @ index 4: file:\c:_workspace... and whenever use url.touri() i'm getting: urisyntaxexception: illegal character in path @ index 36: file:/users/test/library/application support/archi4... this code problem occuring: public static file getbundleentryasfile(string filepath) { try { filepath = filepath.replace("/", file.separator); url fileurl = filelocator.tofileurl(getbundleentry(filepath)); return new file(filelocator.resolve(fileurl).tostring()); } catch (ioexception /*| urisyntaxexception*/ e) { throw new illegalstateexception("error while locating bundle file [" + filepath + "]", e); } } in return statement swap tostring() touri() . question if there better way of doing , making work on both macos , windows. feel i'm missing obvious. welcome!

c# - Argument order for '==' with Nullable<T> -

the following 2 c# functions differ in swapping left/right order of arguments equals operator, == . (the type of isinitialized bool ). using c# 7.1 , .net 4.7 . static void a(isupportinitialize x) { if ((x isupportinitializenotification)?.isinitialized == true) throw null; } static void b(isupportinitialize x) { if (true == (x isupportinitializenotification)?.isinitialized) throw null; } but il code second 1 seems more complex. example, b is: 36 bytes longer (il code); calls additional functions including newobj , initobj ; declares 4 locals versus one. il function 'a'… [0] bool flag nop ldarg.0 isinst [system]isupportinitializenotification dup brtrue.s l_000e pop ldc.i4.0 br.s l_0013 l_000e: callvirt instance bool [system]isupportinitializenotification::get_isinitialized() l_0013: stloc.0 ldloc.0 brfalse.s l_0019 ldnull throw l_00

sql - Creating an index after dropping gives message index already exist -

Image
i having issue dropping , creating index in sql server 2008 r2. when create index after dropping says index exists. if search index table dont see exist get following error message msg 1913, level 16, state 1, line 40 operation failed because index or statistics name 'ix_partiesipodata_companyid' exists on table 'corereferencestaging.dbo.partiesipodata'. tried following if exists(select * sys.indexes ind inner join sys.index_columns ic on ind.object_id = ic.object_id , ind.index_id = ic.index_id ind.name = 'ix_partiesipodata_companyid') drop index ix_partiesipodata_companyid on partiesipodata create nonclustered index ix_partiesipodata_companyid on corereferencestaging.dbo.partiesipodata(companyid) and this if exists(select * sys.indexes name='ix_partiesipodata_companyid' , object_id = object_id('corereferencestaging.dbo.partiesipodata')) drop index ix_partiesipodata_companyid on partiesipodata create nonc

cloudera cdh - Installing Spark 2 on CDH 5.* with RPM? -

i have cloudera cdh 5.11 cluster installed rpm packages (we don't want use cloudera manager or parcels). has found/built spark 2 rpm packages cdh? seems cloudera ships spark 2 parcels. you won't. now, doc "spark 2 known issues" states: package install not supported the cloudera distribution of apache spark 2 installable parcel. https://www.cloudera.com/documentation/spark2/latest/topics/spark2_known_issues.html#ki_package_install

android - Error while running my application in two different mobile devices -

i created application in android studio , ran in samsung mobile device , application had no problem in running.but next time when tried running application in different mobile device,it had problem installing files.i got following error message.please me this.thank you. "installation failed message failed establish session. possible issue resolved uninstalling existing version of apk if present, , re-installing. warning: uninstalling remove application data! do want uninstall existing application?"