Posts

Showing posts from June, 2010

formatting - VBA Dateadd Format - Need In Total Minutes -

i have userform in microsoft excel want use stopwatch. format of "hh:mm" not allow go above 23:59 goes 00:00 private sub spinbutton2_spinup() if insertevent.textbox1 = vbnullstring insertevent.textbox1 = "00:00" else insertevent.textbox1.value = format(dateadd("n", 1, insertevent.textbox1.value), "hh:mm") 'insertevent.textbox1.value = timevalue("mm:ss") 'insertevent.textbox1.value = format(insertevent.textbox1.value, "hh:mm") end if end sub is there anyway format can work clock of total minutes? ideally need go 125 minutes or (125:00) doesn't matter if unlimited. you can't use built in date/time functions want representation not date/time. assuming want read spinner value textbox: private sub spinbutton2_spinup() dim minutes integer: minutes = val(insertevent.spinbutton2.value) dim hh integer: hh = minutes \ 60 dim mm integer: mm = minutes - (hh * 60)

linux - CURL error hostname was not found in DNS cache -

im trying connect webservice via curl in production server , gives me an: curl http://xxxx.xxxx.xxxx.xxxx:8182/rest/ --verbose * hostname not found in dns cache * trying xxxx.xxxx.xxxx.xxxx... if in computer or other server works fine. any ideas? this might due hostname not getting resolved. running prod server inside docker? if check on https://docs.docker.com/engine/userguide/networking/configure-dns/ options fixing host/alias,..etc. hope might helpful.

adding different child lists for each parent in ExpandableListView for Android? -

i have expandable list view parent list showing store names. child element should first line of address, 1 on each. code sets parent element correctly every parent element contains of child elements rather 1 relating it. any ideas? private void preparelistdata() { listdataheader = new arraylist<string>(); listdatachild = new hashmap<string, list<string>>(); //system.out.println(debugname.get(i)); list<string> top250 = new arraylist<string>(); (int = 0; < debugname.size(); i++) { storename = debugname.get(i); listdataheader.add(storename); listdatachild.put(listdataheader.get(0), top250); //store name prints so: store 1, store 2, store 3 etc. 1 each parent element. } (int = 0; < address1.size(); i++) { storeaddress = address1.get(i); system.out.println(storeaddress); //store address prints address store 1, 2, 3 under each parent top250.add(storeaddress); listd

authentication - Keycloak Angular 2 - Check authenticated status Keycloak object -

Image
i'm implementing keycloak authentication service in angular 2 project. use service logging in, logging out etc. authenticating user , logging out seems work. i'm trying protect routes. have working authguard. check if user logged in (in authguard), have isauthenticated() method in service. service: import { injectable } '@angular/core'; declare let keycloak: any; @injectable() export class keycloakservice { private keycloak = new keycloak('app/keycloak/keycloak.json'); constructor() { this.keycloak.init({onload: 'check-sso'}); console.log(this.keycloak); } public login() { this.keycloak.login(); } public logout() { this.keycloak.logout(); } public isauthenticated() { return this.keycloak.authenticated; } } flow: user logs in, user tries reach protected route, authguard checks if user logged in via isauthenticated(). note: don't want authenticate user complete angular app. routes. problem

php - SQL "Where" Statement Only working for on Database Column -

my statement works fine until add "where" stops. using same "where" statement used date column worked fine. little baffled way not work other column in database. have tried other suggestions provided in other questions regarding "where" statements nothing working. appropriated. // create connection $conn = new mysqli($servername, $username, $password, $dbname); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } $sql = "select website, url, dropdown, description basic dropdown = social media"; $result = $conn->query($sql); if ($result->num_rows > 0) { echo "<table><tr><th>website</th><th>url</th><th>dropdown</th><th>description</th></tr>"; // output data of each row while($row = $result->fetch_assoc()) { echo "<tr><td><a href='".

editor - What are these weird blanks in Visual Studio Code? -

Image
i installed visual studio code on mac. there weird blanks on editor. screenshot below here. how can fix it? not sure understand question - empty spaces look expected given how few lines of code have , how short each line is. nevertheless, perhaps looking option : // controls if editor scroll beyond last line "editor.scrollbeyondlastline": true, you can set false in user or workplace settings if wish see less empty space @ end of files (you able continue scrolling beyond end of file default setting).

java - After I edited my nginx's nginx.conf,and execute test command, an command not found error appeared -

today executed /use/local/nginx/conf/nginx.conf -t nginx , showed following error: [root@ddqcsapp ~]# /usr/local/nginx/conf/nginx.conf -t /usr/local/nginx/conf/nginx.conf: line 3: worker_processes: command not found /usr/local/nginx/conf/nginx.conf: line 9: pid: command not found /usr/local/nginx/conf/nginx.conf: line 12: events: command not found /usr/local/nginx/conf/nginx.conf: line 13: worker_connections: command not found /usr/local/nginx/conf/nginx.conf: line 14: syntax error near unexpected token }' /usr/local/nginx/conf/nginx.conf: line 14: }' the last time remembered can executed success. have gone wrong? this not java related. trying use nginx config-checking option, using wrong. you should call nginx -t (the nginx command) test config, not trying run actual config file. :)

adsense - Not receiving verification letter ADMOB -

i have made admob account in september 2016 , have set currency aed (united arab emirates dirhams) after 1 month address verification notification starts appearing , showing me wait 3-4 weeks receive verification letter on mailing address after waiting 1 month have not received letter have requested verification pin again on 18 nov 2016 told me verification pin sent when pass payment threshold showing aed 350 in currency, today on 02/01/2017 have passed payment threshold, getting notification adding payment method, question have wait 3-4 weeks receive verification pin or should request new pin ? reply appreciated you have choice..either wait 2-4 weeks or request new pin admob.google admob provides 3 pin requests maximum after if have'nt received pin ask upload id verify address.after verified in 24 hours..

reactjs - Error parsing Es6 jsx to js React -

i trying work react. have next code : index.js var btn = require('./components/btn.jsx'); var app = { // application constructor initialize: function() { console.log("here me"); reactdom.render(<btn>, document.getelementbyid('app')) }, ondeviceready: function() { this.receivedevent('deviceready'); }, }; app.initialize(); i have next node_modules instaled: babel babel-plugin-transform-react-jsx babel-preset-env babel-cli babel-preset-env babel-preset-es2017 babel-preset-react mi .babelrc { "presets": ["env"] } when run comand whath , compile jsx js have next $ babel --presets env js/src --watch --out-dir js/dist syntaxerror: js/src/index.js: unexpected token (10:24) 8 | initialize: function() { 9 | console.log("here me"); > 10 | reactdom.render(<btn/&g

wordpress - Illegal String offset capabilities -

i continue error when trying login wordpress admin area: warning: illegal string offset 'capabilities' in /home/content/p3pnexwpnas16_data03/95/3712595/html/wp-includes/class-wp-roles.php on line 127 warning: illegal string offset 'name' in /home/content/p3pnexwpnas16_data03/95/3712595/html/wp-includes/class-wp-roles.php on line 128 i done extensive site: http://lihouston.org your appreciated. have splash page setup displays if not logged in. @ total loss of or wrong. have been unable login ftp well. working fine , this....

javascript - How to get clicked item index in jQuery collection? Not by index() -

i want index of clicked element var $inputs = $("input"); $inputs.click(function() { console.log($(this).index()) }); it works following structure div>(input+input+input) but need case div>input div>input div>input inputs not siblings , same index each element. simplest way index? check index within jquery element collection providing element argument , apply index() method on element collection. var $inputs = $("input"); $inputs.click(function() { console.log($inputs.index(this)); }); var $inputs = $("input"); $inputs.click(function() { console.log($inputs.index(this)); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div> <input> <div> <input> </div> </div> <div> <input> </div> <div> <input> </div> <div> <input> <

javascript - Draw More Arc Canvas -

Image
hello people i'd know how draw more arc inside canvas, need draw circles: so write responsive code make canvas responsive: var mycanvas = document.getelementbyid('mycanvas'); var ctx = mycanvas.getcontext('2d'); var centerx = mycanvas.width / 2; var centery = mycanvas.height / 2; var borderwidth = 20; var bordercolor = '#2dc36a'; var radius = (mycanvas.width / 2) - (borderwidth / 2); // days arc canvas background ctx.beginpath(); ctx.arc(centerx, centery, radius, 0, 2 * math.pi, false); ctx.linewidth = borderwidth; ctx.strokestyle = bordercolor; ctx.stroke(); ctx.closepath(); // make canvas responsive function makeresponsive() { var containerwidth = $('.progress-nested').width(); $('.progress-nested').height(containerwidth); var canvaselements = ['#mycanvas']; $('#mycanvas').width(containerwidth

c++ - Calling subproject binary with system() function 4 times faster than linking subproject -

i need call subproject main project , implemented 2 ways of doing that. turns out, second way factor 4 slower first. can explain me? the subproject looks this: #include "fancyproject.h" int main (int argc, char *argv[]) { std::string controlfile = argv[1]; return runfancyproject(controlfile); } first way: call binary of subproject in main project via system() function: std::string command = "fancyproject controlfile.dat"; int result = system(command.c_str()); second way: create library subproject, link library main project , call specific function: #include "fancyproject.h" std::string controlfile = "controlfile.dat"; int result = runfancyproject(controlfile); in meantime, created minimal example . however, behaves expected: system() function slower call of linked function. thus, error has somewhere else in project. nevertheless thank time, dsboger. further investigations in direction.

ios - UICollectionView inside a UITableViewCell gets populated with data only after swiping -

i'm using this method of displaying uicollectionview inside uitableviewcell. it's being populated data api, using json. problem is, when view loads, contains no data (just blank labels etc). populates whenever swipe collection view. can suggest potential solution? 1 found reload data inside viewdidload, doesn't work in case.

c# - WCF Works As Svc Host But Not As Windows Service -

i have wcf service works correctly when hosted in wcfsvchost; when host windows service following error: an unhandled exception of type 'system.invalidoperationexception' occurred in system.servicemodel.dll. additional information: httpgetenabled property of servicemetadatabehavior set true , httpgeturl property relative address, there no http base address. either supply http base address or set httpgeturl absolute address. below config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedruntime version="v4.0" sku=".netframework,version=v4.5" /> </startup> <system.servicemodel> <services> <service name="filebetservice.service"> <endpoint address="" binding="basichttpbinding" bindingconfiguration="largemessagebinding" contract="filebetservic

How to convert "or" to SPARC assembly? -

i'm trying convert following line sparc assembly (using negative logic): if (i < || > b) {...} but i've stuck on how convert "or" bitwise or in sparc. , couldn't find helpful documentations convert this. can help? thank you. (suppose i in $l0 , a in $l1 , , b in $l2 ) edit: here have tried: cmp %l0, %l1 ! compare bge end_if ! negative logic test end if statement nop cmp %l0, %l2 ! compare b ble end_if ! negative logic test end if statement nop if: /*do something*/ end_if: /*statements*/ the more specific question how use "or" between 2 cmp instructions? getting confusing me when using negative logic. your code: cmp %l0, %l1 ! compare bge end_if ! negative logic test end if statement nop cmp %l0, %l2 ! compare b ble end_if ! negative logic test end if statement nop if: /*do something*/ end_if: /*statements*/ is and. both sub-conditions must fulfilled, reach "do somethin

r - Remove axis text from one facet -

Image
i'm trying display 3 time series using facet_grid() , in order save space, i'm reducing panel spacing between them. problem vertical axis overlap want move right on plot in middle. since seem impossible in ggplot2, i'm trying render every axis , remove editing gtable far not successful. this minimal example: library(ggplot2) set.seed(123) df <- data.frame(expand.grid(x = 1:150, type = letters[1:3])) df$y <- df$x*0.016 + rnorm(150, sd = .5) ggplot(df, aes(x, y)) + geom_line() + facet_grid(type~.) + theme(panel.spacing.y = unit(-3, "lines"), strip.text = element_blank()) + scale_y_continuous(sec.axis = dup_axis(name = ""), name = "y") which produces this: and want delete each axis text this: thanks! the solution assign nullgrob() relevant elements of gtable. gt <- ggplotgrob(g) t <- gt[["grobs"]][[8]][["children"]][[2]] # found grobs looking around table. gt[["gr

Display date parameter as a calendar Control in Tableau -

is possible display date parameter in tableau calendar? thanks it looks can . it looks there bit of process doing this : drop date dimension filter, select "range of dates", , hit "next>". then select "load domain", , select apply/ok. (i left the, "show:" "all values in database".) then add quick filter. this should achieve looking for. note that post linked same link above, did not direct correct page. had use web archive work.

php - Check ulr before redirect -

im trying fix site issue on friend's site. let's call "www.original.com". has domain; "www.alias.com". used alias www.original.com. so here's situation: claims logo used different if entered site www.alias.com. currently, www.alias.com , www.original.com sites identical. the code has following function: function check_domain($d){ $domain = filter_input(input_server, 'http_host', filter_sanitize_string); return substr_count($domain, $d); } and in header makes following check: <?php if (check_domain('original')): ?> <a href="<?php bloginfo('url'); ?>" id="logo"><img src="images/logo.png" alt="<?php bloginfo('name'); ?>"></a> <?php elseif (check_domaine('alias')): ?> <a href="<?php bloginfo('url'); ?>" id="logo-x"><img src="images/logo_x.png" alt="&l

html - JAVASCRIPT log-in redirect with local storage -

i doing project on javascript , can't figure out 1 thing , how log-in , re direct user specific version of website. example, if not logged in can't use option on shopping website buy goods. when logged in option becomes available. task using local storage log-in. can use javascript on appreciated! function store() { var name = document.getelementbyid('name'); var pw = document.getelementbyid('pw'); var telefon = document.getelementbyid('telefon') var email = document.getelementbyid('email') var adresa = document.getelementbyid('adresa') var drzava = document.getelementbyid('drzava') var mrod = document.getelementbyid('mrod') var zrod = document.getelementbyid('zrod') localstorage.setitem('name', name.value); localstorage.setitem('pw', pw.value); localstorage.setitem('telefon', telefon.value); localstorage.setitem('e

python - How to split up a string using 2 split parameters? -

example: r="\\%4l\\%(wit.*wit\\)\\|\\%8l\\%(rood.*rood\\)\\|\\%12l\\%(blauw.*blauw\\)\\|\\%13l\\%(wit.*wit\\)\\|\\%14l\\%(blauw.*blauw\\)\\|\\%15l\\%(wit.*wit\\)\\|\\%16l\\%(wit.*wit\\)\\|\\%17l\\%(rood.*rood\\)\\|\\%19l\\%(wit.*wit\\)\\|\\%21l\\%(blauw.*blauw\\)" i want split string list, not using 1 parameter 2 parameters. first want capture number before l\\%( second want capture text between \\%( , \\)\\| or in case of end of string between \\%( , \\)$ output: [[4, "wit.*wit"], [8, "rood.*rood"], [12, "blauw.*blauw"], [13, "wit.*wit"], [14, "blauw.*blauw"], [15, "wit.*wit"], [16,"wit.*wit"], [17, "rood.*rood"], [19, "wit.*wit"], [21, "blauw.*blauw"]] what tried split string @ \\| , substituting every undesired character "" . is there better way in python? one way approach use re.findall() 2 capturing groups find desired pairs:

javascript - How to get ObjectID from ArcGIS FeatureLayer on click function? -

i'm trying work arcgis javascript api. i'm using this featurelayer example , try make popup, display different data based on objectid click on. see on example. the problem can't access objectid outside variable template. inside variable template set title title: "id of object {objectid}". works good. have data stored in mysql database want objectid stored variable when click , possibly send through ajax route. in controller find matched object, data database , send popup template , display it. that's idea how possibly work, need objectid first, don't know how access. if have idea how solved or know better way how put additional data database popuptemplate, let me know please. thanks. edit: require([ "esri/map", "esri/views/mapview", "esri/layers/featurelayer", "dojo/on", "dojo/domready!" ], function(map, mapview, featurelayer, on) { var featur

python - Why is copying a shuffled list much slower? -

copying shuffled range(10**6) list ten times takes me 0.18 seconds: (these 5 runs) 0.175597017661 0.173731403198 0.178601711594 0.180330912952 0.180811964451 copying unshuffled list ten times takes me 0.05 seconds: 0.058402235973 0.0505464636856 0.0509734306934 0.0526022752744 0.0513324916184 here's testing code: from timeit import timeit import random = range(10**6) random.shuffle(a) # remove second test. = list(a) # attempt "normalize" list. _ in range(5): print timeit(lambda: list(a), number=10) i tried copying a[:] , results similar (i.e., big speed difference) why big speed difference? know , understand speed difference in famous why faster process sorted array unsorted array? example, here processing has no decisions. it's blindly copying references inside list, no? i'm using python 2.7.12 on windows 10. edit: tried python 3.5.2 now, results same (shuffled consistently around 0.17 seconds, unshuffled consistently aro

Difference between Java Interfaces and Python Mixin? -

i have been reading python-mixin , come know adds features (methods) class. similarly, java-interfaces provide methods class. only difference, see java-interfaces abstract methods , python-mixin carry implementation. any other differences ? well, 'abstract methods' part quite important. java typed. specifying interfaces in type definition, use them construct signature of new type. after type definition, have promised new type (or sub-class) implement functions defined in various interfaces specified. therefore, interface not add methods class, since doesn't provide method implementation. adds signature/promise of class. python, however, not typed. 'signature' of type doesn't matter, since checks @ run time whether method wish call present. therefore, in python mixin indeed adding methods , functionality class. not @ concerned type signature. in summary: java interfaces -> functions not added, signature extended. python mix

java - How to properly convert String to byte[] on text encryption/decryption in android? (Errors - WRONG_FINAL_BLOCK_LENGTH and IllegalBlockSizeException) -

hello looking answers in stack overflow. of dont work. please me. i'd encryption , decryption text in android. id simple can. firstly wrote code in java eclipse. work fine if transfer android studio there couple of errors. i must transfer bytes[] string because use firebase , not support storing class object bytes[] i try work this hint , , many others have failure. generatekey() private static secretkey generatekey() throws exception { secretkey key = new secretkeyspec(org.apache.commons.codec.binary.hex.decodehex(klucz.tochararray()), "aes"); return key; } encrypt(msg) public string encrypt(string messagetext) { try { byte[] data = messagetext.getbytes("utf-8"); ivparameterspec iv = new ivparameterspec(iv_.getbytes("utf-8")); secretkeyspec key = (secretkeyspec) generatekey(); cipher cipher = cipher.getinstance("aes/cbc/pkcs5padding"); ci

c# - The Include path expression must refer to a navigation property defined on the type. -

public int gethighestmarks(int classid, int examid, int subjectid) { list<examresult> examresultlist = null; int highestmarks = 0; try { basedatarepository<examresult> db = new basedatarepository<examresult>(); examresultlist = db.getlist(s => s.classid.equals(classid), e => e.examid.equals(examid), s => s.subjectid.equals(subjectid)).tolist(); if (examresultlist.count > 0) { var markslistconsolidated = examresultlist .groupby(e => e.subjectid) .select(g => g.orderbydescending(e => e.marks).lastordefault()) .select(e => new { e.marks,

Is there a way to remove the ga cookie id parameters after a ? mark in a page URL from Google Analtyics Reporting -

we have instance of cross-domain tracking within google analytics single sign-on between sites. sites on gtm. single sign-on generates google analytics id such (?_ga=1.18339449.1954186898.1485354375) appended end of page url's. our preference id's not appear within page level reporting ga treats each page unique in turn increases chances of sampling. we've been unable use "exclude url query parameters" feature found within view settings remove parameters page level reporting. i not find blog or stack overflow posts stating how remove id parameters within google analytics reporting. is there suggested alternative prevent id parameters being appended sites page url's? if aren't able use exclude url query parameters option strip parameter url...that stinks. might want let google know feature isn't working expected. another option use advanced filter regex strip parameter page. can following settings: field a: request uri pattern:

python - gaussian filter on irregularly spaced (x,y) series? -

is there easy way in python apply gaussian filter set of points (x,y), or more (x,f(x)) not regularly spaced along x-axis? in response request clarification on mean, maybe better way describe i'm looking "gaussian-weighted average", f gwa (x j ), of series of points (x i ,f(x i )) each point in provided series (x i ,f(x i )) sum taken on provided points such that f gwa (x j )    =    Ïƒ i [ e -[(x j -x i )/σ]^2 * f(x i ) ]    /    Ïƒ i [ exp -[(x j -x i )/σ]^2 ] (note - if points in (x i ,f(x i )) happen evenly spaced, believe end result of above definition same "scipy.ndimage.filters.gaussian_filter1d" does). there nice, already-optimized, numpy or scipy way this? this looks nadaraya-watson kernel regression , , 1 available python implementation in statsmodels package . you can similar kernel smoothing operation pandas rolling window .

android - Issue running react native project -

i have cloned react native project git. when run npm install inside project directory, following error occurs e:\react_native_projects\rctwebrtcdemo>npm install npm warn addremotegit error: command failed: git -c core.longpaths=true config - -get remote.origin.url npm warn addremotegit npm warn addremotegit @ childprocess.exithandler (child_process.js:204:12) npm warn addremotegit @ emittwo (events.js:106:13) npm warn addremotegit @ childprocess.emit (events.js:191:7) npm warn addremotegit @ maybeclose (internal/child_process.js:891:16) npm warn addremotegit @ process.childprocess._handle.onexit (internal/child _process.js:226:5) npm warn addremotegit git+https://git@github.com/oney/react-native-webrtc.git r esetting remote c:\users\sonu android\appdata\roaming\npm-cache\_git-remotes\git -https-git-github-com-oney-react-native-webrtc-git-9630a7d4 because of error: { error: command failed: git -c core.longpaths=true config --get remote.origin.url npm warn

node.js - Main Bower files -

in angularjs app, try concat bower file because have many lib. make task concat file, here code var filter = require('gulp-filter'); var mainbowerfiles = require('gulp-main-bower-files'); var dest = 'dist/scripts'; gulp.task('main-bower-files', function() { return gulp.src('./bower.json') .pipe(mainbowerfiles([[filter, ]options][, callback])) .pipe(gulp.dest('dist/scripts')); }); after call task in nodejs cmd, error in chrome console .pipe(mainbowerfiles([[filter, ]options][, callback])) this error in node cmd .pipe(mainbowerfiles([[filter, ]options][, callback])) ^^^^^^^ syntaxerror: unexpected identifier @ exports.runinthiscontext (vm.js:53:16) @ module._compile (module.js:373:25) @ object.module._extensions..js (module.js:416:10) @ module.load (module.js:343:32) @ function.module._load (module.js:300:12) @ module.require (module.js:353:17) @ require (internal/module.js:12:17) @ li

java - Sending ByteArrays and Bytes from the same TCP connection -

in application i'm create socket communication between client , server. there 2 types of messages passing differ in-terms of length of data. 1 message type has 1 byte, while other 1 of variable length. trying use single tcp connection handle both situations, far failed. please tell me ideal approach this. using 2 connections different port numbers best approach? note impossible use socket.io in project due external constraints. here's reading code i'm using: socket socket = new socket( dstaddress, dstport ); inputstream inputstream = socket.getinputstream(); try( bytearrayoutputstream bytearrayoutputstream = new bytearrayoutputstream( 1024 ) ) { byte[] buffer = new byte[1024]; int bytesread; while( ( bytesread = inputstream.read( buffer ) ) != -1 ) { bytearrayoutputstream.write( buffer, 0, bytesread ); } } catch( exception e ) {

Wrap TypeScript interface in Observable -

i have interface like: interface mystate { userstate: userstate; notificationsstate: notificationsstate; datastate: datastate; } and based on i'd generate interface like: interface rxmystate { userstate: observable<userstate>; notificationsstate: observable<notificationsstate>; datastate: observable<datastate>; } but don't want create , update second interface hand every time add/remove in storestate interface. there way can tell typescript wrap items in storestate interface observable<state> ?

html - is it possible to reference a css property from another element? -

i introducing myself in css, it's structure of javascript object, somehow in code want use class of .blm height property on keyframes' border-bottom-width property, code , demo .blm { display: inline-block; background-color: pink; border: solid black 1px; height: 300px; width: 100px; animation: kk 3s linear 0s 2 normal; box-sizing: border-box; } @keyframes kk { 0% { border-bottom-color: red; border-bottom-width: 0px; } 100% { border-bottom-color: red; border-bottom-width: 300px;/* want reference on .blm height property , maybe use percentage in it*/ } } .blm2 { border: sold black 1px; width: 100px; height: 100px;/* here, if isn't child element */ background: green; } <div class="blm"> blm </div> <div class="blm2"> blm2 </div> the way this, currently, use css variables (which not supported in ie or edge): :root { --shared-

javascript - How and where to implement REST API with Firebase -

after research tutorial implementing rest apis firebase, find code snippets curl (or other libs) method calls. not find basics have call methods, how connect different things etc.. what need for: i'm programming webapp ionic framework, html5 , javascript , needed store data in backend, choosed firebase since reviews pretty good. what want do: i need query (already existing) data in firebase variable have calculated in js file , return result same js file further calculations. preferably use python lib https://github.com/thisbejim/pyrebase recommended on firebase rest api tutorial page https://firebase.google.com/docs/database/rest/start since i've got pre-knowledge there. my question: where implement rest api python script ? have create .py file, include index.html, write methods in there , somehow call in js file ? literally have no idea that. any kind of highly appreciated ! best regards, jule if need have javascript read , write data firebase d

javascript - current number of slide using bootstrap carousel in reactJS -

i creating bootstrap carousel(image-gallery) in reactjs facing problem in showing exact index number(it's showing last index value of current slide. for example: if on 4th slide coming 1st-2nd-3rd slide slide number 3(i.e. index 2) , click on previous button current slide number 3rd myindex value 4(instead of 3) or index of image 3 instead of 2) of active slide. var photoalbum= react.createclass({ getinitialstate: function(){ return({ myindex : 1 }) }, componentwillreceiveprops: function() { var currentindex = $('div.active').index() + 1; console.log(currentindex) this.setstate({ myindex: currentindex }) }, render: function(){ console.log(this.state.myindex, "index number"); return( <div> <div classname="modal-body pd_0"> <h4 classname="text-center"><b>{this.state.myindex}/{photos.length}</b></h4> <

hardware - Why is R slower on my (stronger) Desktop than on my (weaker) laptop? -

i'm using dell latitude e7440 laptop windows 7 enterprise os, 8gb ram , 64-bit os, intel(r) core(tm) i7-4600u cpu @ 2.10ghz processor, 2701 mhz, 2 cores, 4 logical processors (that's 4 cores). i'm using dell precision tower 7810 desktop windows 7 enterprise os, 32gb ram , 64-bit os, intel(r) xeon(r) cpu e5-2620 v3 @ 2.40ghz 2 processors, 2401 mhz, 6 cores, 12 logical processors (that's 24 cores). a demonstration of use of r running binary classification using gbm in rstudio on 100k-sized data ~300 features. whatever on laptop r version (all other software closed, no use of parallelization), considerably faster on desktop r version. how can be? need find out? laptop: > sum <- 0; system.time(for (i in 1:1000000) sum <- sum + i) user system elapsed 0.36 0.00 0.36 > memory.limit() [1] 8097 > sessioninfo() r version 3.3.1 (2016-06-21) platform: x86_64-w64-mingw32/x64 (64-bit) running under: windows 7 x64 (build 7601) service pac

laravel - php - composer update returns certificate verify failed -

when try composer install or composer update error message says ssl certificate cannot verified. [composer\downloader\transportexception] "https://packagist.org/packages.json" file not downloaded: ssl operation failed code 1. openssl error messages: error:14090086:ssl routines:ssl3_get_server_certificate:certificate ver ify failed failed enable crypto failed open stream: operation failed has idea how can solve problem? i haven't encountered myself, after doing quick search, found potential solution (if you're using php 5.6): # update ports tree (software list) $ sudo port -v selfupdate # install php (shortcut compiling php our required libs) $ sudo port install php56 # install mcrypt library php $ sudo port install php56-mcrypt # install curl library php $ sudo port in

statistics - How to define a factor as being above or below its median in R? -

so need create factor defines 'alt' variable (altitude) being above or below median. i know should follow basic shape of creating new: conservation$alt.factor <- conservation$alt (..????...) but i'm struggling last bit. there must simple command out there! use ifelse() : conservation$alt.factor <- factor( ifelse(conservation$alt < median(conservation$alt, na.rm = true), 1, ifelse(conservation$alt > median(conservation$alt, na.rm = true), 2, na)), 1:2, labels = c("below", "above")) beware, setup sets rows conservation$alt == median(conservation$alt) na . if not wanted, change last parameter in ifelse -statement else.

1.3.7.RELEASE -> 1.4.1.RELEASE | java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.showBanner -

if switch new version of springboot, above error message when starting application. why that? best wishes steven pom.xml <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>de.xyz.microservice</groupid> <artifactid>spring-boot-test</artifactid> <version>1.0-snapshot</version> <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <!--version>1.3.7.release</version--> <version>1.4.1.release</version> </parent> <dependencies> <dependency> <groupid>org.springframework.boot&l

java - Add image on SurfaceView in Android -

i have implement function in android app allow me insert "marker" on surfaceview. what need simple: when touch on screen, function capture coordinates (x,y) of touch, in moment need show marker in position. the marker can removed later doing tap on marker (and eliminate through menu) what best way ? is possible create programmatically imageview on surfaceview or better draw bitmap canvas? you can try use tileview, link tileview does asking

bazel - OSX Tensorflow + Opencv: Symbol Not Found, expected in Flat Namespace -

i use osx10.12, try use opencv in tensorflow, use first method mentioned in question . i build code there questions following when execute it: dyld: lazy symbol binding failed: symbol not found: __zn2cv6string8allocateem referenced from: /users/philokey/practice/github/tensorflow/./bazel-bin/tensorflow/examples/test_cv/test_cv expected in: flat namespace the build file following: cc_binary( name = "test_cv", srcs = [ "test_cv.cc", ], deps = [ "@opencv//:opencv", ], ) how can solve problem? you need make sure updated following files under tensorflow directory, correctly: in workspace - (./tensorflow/tensorflow/workspace) add following: new_local_repository( name = "opencv", path = "/usr/local/", build_file = "opencv.build", ) opencv.build - (./tensorflow/tensorflow/opencv.build) add following: cc_library( name = "opencv", srcs = glob(["lib/*.dylib*"]),

php - PHPMailer : how to set Content-Type to multipart/alternative -

i'm sending e-mails phpmailer messages comes content-type: text/html in header. how can change multipart/alternative? it should $mail-> my config is: $mail = new phpmailer(); $mail->setfrom('mail@mail.com', 'name'); $mail->ishtml(true); $mail->charset = "iso-8859-1"; $mail->xmailer = ' '; phpmailer deals automatically. phpmailer doesn't allow building arbitrary mime structures, has whole bunch of presets covering common scenarios. example, build dual-format html & plain text message, this: $mail->ishtml(); $mail->body = "<strong>html content</strong>"; $mail->altbody = "plain text content"; that produce message multipart/alternative mime structure.

javascript - How to upload with 2 dropzone in one form with submit button -

Image
anyone know, how upload 2 dropzone in 1 form have form this <form> <button id="dropzone1" type="button">upload photo</button> <button id="dropzone2" type="button">upload cv</button> <button onclick="on_save" type="button">upload</button> </form> and javascript this $('#dropzone1').dropzone({ url: 'vacancy/save', maxfiles: 1, autoqueue: false, clickable: '#dropzone1', acceptedfiles: 'image/*', }); $('#dropzone2').dropzone({ url: 'vacancy/save', maxfiles: 1, autoqueue: false, clickable: '#dropzone2', acceptedfiles: '.pdf,.doc,.docx,.odt', }); function on_save(){ mydropzone.enqueuefiles(mydropzone.getfileswithstatus(dropzone.added)); } and when proccess upload, url same url, want data saved in different column, , different location, possible? maybe array, my code submit, 1 of file, second file not

c++ - Solving "locally defined symbol imported" errorrs in VC++ 2015 -

i have small command line program uses maxim's onewire public domain api , winusb. builds absolutely fine on laptop using win7/vs2013. i'm trying move win8.1/vs2015 on new desktop pc, , can't build. here errors reported: 1>------ build started: project: readtemp5, configuration: debug win32 ------ 1>presshum.obj : warning lnk4217: locally defined symbol _printf imported in function _print_array 1>readtemp.obj : warning lnk4049: locally defined symbol _printf imported 1>presshum.obj : warning lnk4217: locally defined symbol _sprintf_s imported in function _readpresshum 1>readtemp.obj : warning lnk4049: locally defined symbol _sprintf_s imported 1>temp10.obj : warning lnk4049: locally defined symbol _sprintf_s imported 1>presshum.obj : warning lnk4217: locally defined symbol _sprintf imported in function _readpresshum 1>temp10.obj : warning lnk4049: locally defined symbol _sprintf imported 1>readtemp.obj : warning lnk4217: locally defined symb

jquery - Open sub and sub-submenu on click -

my javascript working submenu, not sub-submenu: should hidden until click "season", opens (slides down) under parent item. html & javascript: $('#main-menu > ul > li:has(.dropdown-menu)').addclass('sub').on('click', function(event) { if ($(event.target).parents('ul.dropdown-menu').length > 0) { event.stoppropagation(); } else { event.preventdefault(); } $(this).find('ul').slidetoggle(); }); $('#main-menu > ul > ul > li:has(.dropdown-menu-2)').addclass('sub').on('click', function(event) { if ($(event.target).parents('ul.dropdown-menu-2').length > 0) { event.stoppropagation(); } else { event.preventdefault(); } $(this).find('ul').slidetoggle(); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <div id="main-menu"> <ul>

android - java.lang.RuntimeException: Failed to load native library -

your healthcare app builds , works (connection establishes without problems) fine. then took classes , layouts , other settings healthcare app , put them own project. project compiles , builds without errors. but! when try start conversation app crashes in skypecall.java error message: " caused by: java.lang.runtimeexception: failed load native library @ com.microsoft.office.sfb.appsdk.application.loadnativelibrary(application.java:98) @ com.microsoft.office.sfb.appsdk.application.initialize(application.java:63) @ com.microsoft.office.sfb.appsdk.application.getinstance(application.java:112) @ kz.altyn.portalmobile.skype.skypecall.oncreate(skypecall.java:68) " at part of code " 68: mconversation = starttojoinmeeting(); 69: mconversation.addonpropertychangedcallback(new conversationpropertychangelistener()); " without knowing exact layout of project, suspect have copied information over, may have missed libraries used app sdk. if @ github sampl

jquery - Listen to localstorage change event -

is there way add change event listener browser localstorage items. i have standalone app makes changes localstorage want backbone view listen , accordingly perform actions. i couldn't find on internet except way in jquery: $(window).bind('storage', function (e) { console.log(e.originalevent.key, e.originalevent.newvalue); }); jquery can bind storage event (in exact way wrote), there few things must note: you must run code behind real ip/domain (you can read more my explanation here ) the storage event fire on every open tab except current tab (which mean - if have 1 open tab, , make change local-storage in tab - will not fire). more information here . regarding backbone - try this: var someview = backbone.view.extend({ initialize:function() { $(window).on("storage", this.handlelocalstoragechange) } });

android - SKOBBLER SDK 2.5 play Street name with Audio advice -

hi using skobbler sdk 2.5 (android). how can play street name audio instructions while navigation in progress, of plays distance left , turn left/right. thanks the general_tts.adv file defines rules creating audio/text instructions text-to-speech support. tts engines can pronounce street names, can include information in advice via $nameorref (which return street’s name of reference, giving priority name tag) name, corresponds whatever value of “name” tag (i.e. “tri-state tollway”, reference corresponding whatever value of “ref” tag (i.e. “i 294”). bundled $nameorref parameter have $hasnameorref conditional – if particular road has name or ref value text following conditional used, otherwise instruction stop for documentation please follow links: http://sdkblog.skobbler.com/advisor-support-text-to-speech-scout-audio/ http://sdkblog.skobbler.com/advisor-support-text-to-speech-faq/

How to upload an image from android to php using asynctask -

everyone. stuck on project working on. want able upload image android gallery, encode image base64 string , send php web service, variable, decode image other end , wish. so far able select image, gallery , encode base64 string , storing in android preference. the problem is, think not string being sent php service (some truncated). why think so? log.d showed me different strings when dumped @ different locations. the code gets image , encodes is:- private void galleryintent() { intent intent = new intent(); intent.settype("image/*"); intent.setaction(intent.action_get_content); startactivityforresult(intent.createchooser(intent, "please select file"),1); } private string onselectfromgalleryresult (intent data) { if (data != null) { try { bitmap = mediastore.images.media.getbitmap(getcontext().getcontentresolver() , data.getdata()) ; } catch (ioexception e) { e.printstacktrace(); }