Posts

Showing posts from April, 2013

hortonworks data platform - Ambari api POST complaining CSRF protection -

i trying set hbase property through ambari api using following command curl -u "admin:admin" -i -x post -d '{"type": "hbase-site", "tag": "version3", "properties" : {"hbase.regionserver.global.memstore.size" : "0.6"}}' https://abct.net/api/v1/clusters/xyz/configurations but keep getting following error http/1.1 400 bad request content-length: 107 content-type: text/plain expires: thu, 01 jan 1970 00:00:00 gmt server: microsoft-iis/8.5 x-ms-hdi-active: 10.8.18.29 x-frame-options: deny x-xss-protection: 1; mode=block user: admin x-powered-by: arr/3.0 set-cookie: ambarisessionid=2e8ortl32j1p7zdjatigdgvg;path=/;httponly; path=/; secure x-powered-by: asp.net date: mon, 12 sep 2016 18:19:38 gmt { "status" : 400, "message" : "csrf protection turned on. x-requested-by http header required." } what missing here ? turns out have add request header requ

How can I annotate a Django queryset with a count in a way that's conditional to some property of each item in the queryset? -

sorry title, think pseudo-code clarify question: class image(model): user = foreignkey(user) class group(model): members = foreignkey(user) images = foreignkey(image) autosubmission = booleanfield() as can see, have group , consisting of members , images . if group autosubmission members don't submit images manually it, images belonging member automatically show in group. if group not autosubmission members need submit images manually, , end in images foreignkey . now, want have queryset that's annotated number of images the group. group.objects.all().annotate(num_images = count('images')) obviously, code above works groups not autosubmission , i.e. images in images relation. so how can annotate queryset works both groups autosubmission , groups not? thanks!

mongoose - Reducing an interface in TypeScript -

i have mongoose model interface declaring such: export interface iuserdocument extends mongoose.document { surname: string; lastname: string; } export interface iusermodel extends mongoose.model<iuserdocument> { mystaticmethodgoeshere(signature: string): void; } and corresponding mongoose schema: const userschema = new mongoose.schema({ surname: {type: string, required: true}, lastname: {type: string, required: true}, }) now have define how user structured 2 times (mongoose schema , typescript interface), isn't dry , inconvenient. unfortunately, if want use mongoose's lean method, have define yet interface: export interface ileanuserdocument { _id: mongoose.types.objectid; __v: number; surname: string; lastname: string; } this inconvenient , error prone. there way lean interface extend (i don't know verb use here) iuserdocument interface remove stuff it? extends not way of adding properties interface. believe can work typ

cocoapods - Xcode 8 Warning: no rule to process file of type net.daringfireball.markdown for architecture x86_64 -

i above warning in xcode 8 changelog.md file in cocoapod source. how clear it? select project navigator select project select target select build phases move files (in case, changlelog.md) don't want compiler process compile sources copy bundle resources

dynamic - How to make ng-click dynamically added into table from a modal to work? AngularJS -

i received project contains angularjs in it, need someting , don´t doing wrong since i'm noob in angularjs matters. the context: this part of whole project, angular files in project configured gulp. have html page(page1.html) has button , table, html controlled ng-controller(controller.js), in html have button ng-click function. function opens $uibmodal has own controller , templateurl. templateurl in html file inside <script></script> tag. controller of modal(controller2) in same file main controller(controller1) when modal opens see 1 text input, enter text press add button, modal closes , in main html page 1 row of table added entered text in text input. the problem: the table on each row next text has 2 buttons ng-click functions, 1 delete 1 edit, when rows added beginning of compilation work fine, when rows dynamically added modal don't anything. have read questions similar problems $compile service work, not know how apply on case. any enormo

ios - Convert NSString to NSData and keep escaped "&" -

i need convert nsstring or nsmutablestring nsdata , keep escaped character it. im escaping character "&" %26 in post field, since im using not rich-full nsmutablerequest im able set httpbody nsdata. nsmutabledata *body = [nsmutabledata new]; [body setdata:[part1 datausingencoding:nsutf8stringencoding]]; [body appenddata:[escapedstringfield ?]; [body appenddata:[part2 datausingencoding:nsutf8stringencoding]]; request works correctly fails "&", idea proper solution without implementing 3rd party library networking? update: not necessary paste here. part1 , part2 works fine. there problem value passed in ' escapedstringfield '. part1 ends "&password=" for exmaple while request being made &password=gryurrh%267444&7444 but value password equal to gryurrh%267444 at same time which corrupt request i have resolved issue myself. answer nsdata+gzip ps. 2 down votes - reasonable down-votes of course. love p

android - Using different screen layouts -

i have app different versions screens (small, normal, largue, , extralargue xml files) each xml designed each type, found huawei phone screen 3.5" hvga 320x480. my question is, should not ui of android use small configuration screen? app when running on phone uses normal configuration if nexus4 4.7" 768x1280 change that? i tried create various types of screen (create other) multiple configurations without optimal result. assuming 3.5" measurement on diagonal, works out 165 dpi falls mdpi (or normal screen size) bucket according android's supporting multiple screens guide. dpi = sqrt(w^2 + h^2) / d w width of display in pixels h height of display in pixels d physical diagonal measurement of display in inches

diawi - What's the correct way in making an iOS 9 app backward compatible with iOS 6? -

i trying create simple webview. person wants run on devices starting ios 6. i've set ios deployment target @ 6.1 , base sdk 9.3. have code-signed, provisions, etc. i used program called deploymate check if conflicts exist across ios versions. passed. i uploaded ipa diawi. however, crashes on device (ios 9) , says "could not installed @ time". simulator had no problems. is there anyway diagnose problem or have skipped step? i've seen other questions, pertain ios 7.

netbeans - Possible to create text box in Java Console? -

i'd output line of text box in java console can't find code able so. i familiar println() , not trying create ui joptionpane. any great, thanks. if mean making box within console, need use special character , use loops. need provide values rows , columns somehow before this. example: for(m=1;m<=rows;m++){ for(c=1;c<=rows;c++){ system.out.print("*"); } system.out.println(); here used "*", _ ,-, etc. can work well. if mean dialog box use joptionpane, other can't help.

javascript - Trying to create a pattern out of circles? -

i trying imitate a pattern found on internet, weird lines in middle , when trying connect set of circles on top. also, when try fill, becomes black. console.log("grid"); var canvas = document.getelementbyid("canvas"); var image_b = document.getelementbyid("brown"); var image_g = document.getelementbyid("grey"); canvas.width = window.innerwidth; canvas.height = window.innerheight; var ctx = canvas.getcontext("2d"); var side = 160; var side2 = 150; ctx.strokestyle = 'black'; ctx.fillstyle = 'white'; function draw() { canvas.width = window.innerwidth; canvas.height = window.innerheight; ctx.clearrect(0, 0, window.innerwidth, window.innerheight); var widthnbr = math.ceil(window.innerwidth / side) + 1; var heightnbr = math.ceil(window.innerheight / side) + 1; var counter = 0; (var = 0; < widthnbr; i++) { (var j = 0; j < heightnbr; j++) {

c++11 - C++ - Send IOCTL command to WBF to get sensor attributes on Windows -

i'm trying understand how can retrieve winbio_sensor_attributes buffer using wbf apis. found link: https://msdn.microsoft.com/en-us/library/windows/hardware/ff536431 it mentions sending ioctl command, however, i'm not able understand how can invoke c++ code , receive sensor attributes structure. can help? or point me sample code similar stuff? first take @ deviceiocontrol - function must supply ioctl_biometric_get_attributes value second parameter obtain biometric data (the link included describes how handle size ouf output buffer - first supply dword sized buffer actual size of output , allocate sized buffer , retrieve actual data). need valid device handle (first parameter of deviceiocontrol ). handle should obtained calling createfile , passing device name of driver. if not know pdo either can try looking in device manager if shows under "details" tab or have use setupdi* family functions enumerate biometrics device class , name there.

javascript - Adding legends to selfmade barchart -

Image
i know wondering self-made barchart? why not existing library? hate use files 20000 lines of code while 500 necessary. oh , it's fun :) main objective i'll using script app i'll making using phonegap. lower size, better. so idea achieve following: i've been able to draw bars, make sure of equal width , have height dependent on height of parent container. you'll see in code below added font-size options. chart expand around 300px of height (which using default 16px example). , 50px font-size of 12 or less. reduced bar chartcontainer 3 x fontsize (+ rest) make sure there enough space top (amounts) & bottom (legends + title) now i'm not entirely sure how add , center amounts. tried searching existing chart libraries check on how has been rendered, unfortunately use canvasses or svg containers. suggestions? /* dataset ------------------ add legends add result / amount add bottom-border: 8px both sides? add chart name

linux - How to make an overlay which capture no events -

i draw sort of window on top of other windows. example, display debugging infos (like conky) or things timer. the main thing able continue using other windows while using (the events go through transparently). i've tried doing pygtk , pyqt , others can't find way make real overlay no event capture. is there low-level x11 solution? i think composite-extension-approach not work when compositing manager running (and composite's overlay window used). since explicitly mention "no event capture": the shape extension allows set different shapes window. version 1.1 of extension added "input" shape. setting empty region should pretty want. some concrete example of think ask can found in conky's source code: http://sources.debian.net/src/conky/1.10.3-1/src/x11.cc/?hl=769#l764-l781 edit: since said didn't find in gtk (well, pygtk), here function need in gtk: https://developer.gnome.org/gdk3/stable/gdk3-windows.html#gdk-window-in

Unable to transform a JSON Object into Array of objects using JOLT JSON library -

input json have transform follows : { "business": [ { "label": "entertainment", "category": "advert", "weight": "", "types": [ "t1", "t2" ] }, { "label": "fmcg", "category": "campaign", "weight": "", "types": [ "t9", "t10" ] } ] } expected output : { "business": [ { "label": "entertainment", "category": "advert", "weight": "", "types": "t1" }, { "label": "entertainment", "category": "advert", "weight": "", "types": "t2" }, { "label&q

OpenCV detect color Automatically -

is there possible way make color blob detection automatically detect specified color without pressing ? ex i'll specify range of color want automatically detect color same range. you need use cv::inrange , define range of colors (r1,g1,b1) (r2,g2,b2). e.g.: cv::inrange(input, cv::scalar(0,140,0), cv::scalar(160,255, 160), output);

objective c - When analyzing a binary compiled from Swift, is it possible to figure out the Swift method name for a function that has no symbol? -

i'm new disassembling , reverse engineering binaries, forgive me if question nonsensical or impossible. in past when i've tried reverse engineering macos binaries, analyzing ones written in objective-c yielded lot of useful information, because of objective-c classes , method names retrievable, making lot easier figure out particular method did. i'm trying analyze binary written in swift (technically combination of swift , objective-c), , of functions have no symbol. there objective-c methods can retrieve usual, , few functions have swift-style mangled name, of rest have no symbol. know lot of have swift methods. is there anyway figure out binary's swift classes , associated methods can objective-c? using tool hopper disassembler reveals mangled names of swift classes (usually symbol _ttc4something25somethingelse ) , can list of instance variable names , offsets, no method names. note: binary in question x64 macos binary, not ios binary. usually r

php - How does Codeigniter receive the ajax post data in controller -

i'm trying use codeigniter develop front-end client of project. but ajax ci make me confused. here ajax: $.ajax({ url : "welcome/login" type : "post", datatype : "json", data : {"account" : account, "passwd" : passwd}, success : function(data) { // }, error : function(data) { // } }); and controller: public function login() { $data = $this->input->post(); // can account , passwd array index $account = $data["account"]; $passwd = $data["passwd"]; } now can account , password array index, how can convert received data object can property like: $data->account thx! change ajax this: $.ajax({ url : "<?php echo base_url(); ?>welcome/login" type : "post", datatype : "json", data : {"account" : account, "passwd" : passwd}, suc

Can I mix MySQL APIs in PHP? -

i have searched net , far have seen can use mysql_ , mysqli_ meaning: <?php $con=mysqli_connect("localhost", "root" ,"" ,"mysql"); if( mysqli_connect_errno( $con ) ) { echo "failed connect"; }else{ echo "connected"; } mysql_close($con); echo "done"; ?> or <?php $con=mysql_connect("localhost", "root" ,"" ,"mysql"); if( mysqli_connect_errno( $con ) ) { echo "failed connect"; }else{ echo "connected"; } mysqli_close($con); echo "done"; ?> are valid when use code is: connected warning: mysql_close() expects parameter 1 resource, object given in d:\************.php on line 9 done for first , same except mysqli_close() . second one. what problem? can't use mysql_ , mysqli together? or normal? way can check if connections valid @ all? (the if(mysq...) ) no, can't use mysql , mysqli toget

c++ - Input Validating functions -

i'm new c++ , coding in general. currently, struggling create "mad lib" program asks user inputs (2 different nouns , 2 different adjectives) , uses inputs generate lines " . looks ." when user runs program, supposed asked "do want play game? enter y yes , n no". if user responds y, madlib function should run , should give inputs. once story finished , returned user, should prompted again whether or not want continue playing (again, y yes , n no). should able play game many times want until answer 'n'. far, last part has been biggest struggle. know how create program within 1 main function, goal make sort of input validation n , y function can called main function. ideas? here's have far: #include <iostream> using namespace std; int madlib(){ string noun, adjective, noun1, adjective1; cout << "enter noun" << endl; cin >> noun; cout << "enter adjective" << endl

information retrieval - Using Jaccard Coefficient for measuring string similarity -

i got test , training dataset should used string similarity measurement. here have given few lines of dataset, brandon bass ||| hell brandon bass thinking ||| brandon bass has 5 personal fouls ||| false sac ||| congrats sac kings fans ||| why yall forcing kings stay in sac town smh ||| false stella ||| hello stella can follow me please ||| stella u hate me ||| false data file has 50 entries of form topic ||| tweet_sent_1 ||| tweet_sent_2 ||| have_similar_meaning topic – twitter topic tweet_sent_1 – tweet sentence 1 tweet_sent_2 – tweet sentence 2 have_similar_meaning – binary label (true – 2 sentences similar, false – 2 sentences not similar) assigned human annotator we need divide data set two: training set (35 samples) , test set (15 samples) , have use training set parameter tuning of algorithms. , test test set using best tuned parameter. if algorithm jaccard coefficient how can perform task? can please let me know approach can use. jaccard similarity me

MySQL Get counts in subquery without grouping -

i've been trying find solution having count appear each entry there duplicate. every query i've tried either groups entries 1 row or 1 count incorrect. here table without count: ------------------------------------------------------ | id | last_name | last_4_ssn | type | complete_date | ------------------------------------------------------ | 1 | test | 1234 | cc | null | | 2 | test | 1234 | cc | null | | 3 | test | 1234 | cc | 2016-09-11 | | 4 | test | 1234 | cc | 2016-09-06 | | 5 | test | 1234 | cc | null | | 6 | test | 1234 | fe | 2016-08-30 | | 7 | test | 1234 | fe | 2016-09-01 | | 8 | test | 1234 | fe | 2016-09-02 | ------------------------------------------------------ i'm trying count checks 'last_name', 'last_4_ssn' , 'type' complete_date not null. i resulting table this: ----

node.js - How to pass param using query or route through a form? -

form(action='/allusers', method="post") input(id='name', placeholder='first name / last name') button(type='submit') launch spacecraft this html(jade) redirects allusers page page takes user name input cant pass 'name' allusers router.post('/allusers', function(req, res, next) { var name = req.query.name; console.log(name); res.render('allusers', { title: 'all users' }); }); not mention, have tired using req.param.name seems work req.body.name want know how use req.param and\or req.query because cant change url form submit extract information it edit1: kind of solve issue in defining form , suppose input(type='',name='', placeholder='') , using req.body.name still dont know how play url yet edit: didn't noticed sing id attribute instead of name right 1 defining form field names. id identifying (not inputs) dom elemnts in dom context. field na

artificial intelligence - Android Bot Application using AIML -

i developing android bot application take input user, check matching string in aiml file , give corresponding output. i know android programming , have aiml files ready. problem facing fetch output aiml files. i have gone through answers not figure out solution. happy if explain in detail. i using android studio development. i used this tutorial me started basic application accepts input, scans aiml files, , gives corresponding response. the issue tutorial accept input, scan aiml file , search matching text in <pattern> tag , respond whatever present in corresponding <template> tag. if have <oob> tags in aiml files perform special tasks opening applications, searching on internet etc., have write own code following tasks: scan bot's response presence of <oob> tag. remove <oob> tag , contents between <oob> , <\oob> tags. perform whatever task mentioned in tags.

How can we access type and subtypes of enum in java? -

i need implement following using enum . import java.util.*; /** * * @author mukesh */ public class mytest { private list<subtypes> subtypes = new arraylist<subtypes>(); enum types { percentarea, stackedarea, chartsubtype3; } enum subtypes { persentarea1(types.percentarea), persentarea2(types.percentarea), persentarea3(types.percentarea), stackarea1(types.stackedarea), stackarea2(types.stackedarea), stackarea3(types.stackedarea); types t; private subtypes(types t) { this.t = t; } } public list<subtypes> getsubtypes() { return collections.unmodifiablelist(subtypes); } public static void main(string[] args) { /* how can subtypes based on base type ??? */ }} example : suppose in 1 combo have types - percentarea , stackedarea , chartsubtype3 etc. , if

angular - Angular2 system.js app on ec2 how to deploy - node-pre-gyp ERR -

i developed anuglar2 app using official startpack usijng system.js on mac. uploaded ec2 - how start fixing below? npm install > fsevents@1.0.14 install /var/qta-angular2/node_modules/fsevents > node-pre-gyp install --fallback-to-build node-pre-gyp err! tried download: https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.14/fse-v1.0.14-node-v46-linux-x64.tar.gz node-pre-gyp err! pre-built binaries not found fsevents@1.0.14 , node@4.5.0 (node-v46 abi) (falling source compile node-gyp) gyp err! clean error gyp err! stack error: eacces: permission denied, rmdir 'build' gyp err! stack @ error (native) gyp err! system linux 3.13.0-87-generic gyp err! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "clean" gyp err! cwd /var/qta-angular2/node_modules/fsevents gyp err! node -v v4.5.0 gyp err! node-gyp -v v3.4.0 gyp err! not ok node-pre-gyp err! build error node-pre-gyp err! stack error

javascript - Creating HTML table from json data -

i trying display json data on browser in tabular form dynamically. have 2 json data. {"status": "success", "jpgname": "/home/demo/ui/public/upload/imgname.jpg", "actual": "normal", "filename": "filename.txt"} and second json data file : {"age": 33, "sex": "male"} i want combine both json data single table. problem both json data output of python script. python script take n number of text files input , produces json output. facing problem is, table cells getting updated fields of first json data, example 5 text files have loaded, 5 first json data file , 5 second json file. table getting updated fields of first json data file first , going second json file. can body me, how parse json data , update table cells json field values. want both first , second json data there in same row. second row second set of json files. <table>

tfs2010 - How to publish Code coverage result back to TFS 2013 -

Image
scenario: we're trying enable code coverage in our tfs , far build summary result displaying code blocks covered shown in picture below problem every time click coverage results link (arrow down in picture) doesn't shown details of has been covered , display error in browser test results in/out folder have code coverage file in build server. setup: mstest settings (local.testsetting) test run build definition test results build summary: after clicking coverage results: question : why tfs 2013 project collection coverage results link (red arrow down) in build summary doesn't display code coverage details of has been covered code coverage file generated in build server tfs 2010? missed in settings make possible? you need to 1). open build definition, go process -> 3.test -> automated test -> on add/edit test run dialog, set options " enable code coverage ". 2). select .testsettings file in build definition

javascript - WebSocket Error on Android Device, Works in IE -

i have issue websocket client. it seems work fine in ie , edge. server responds message , client receives , displays message, when android device runs code, error handler gets fired off , connection closed immediately. the error handler gives me message: "undefined" here client: <!doctype html> <html> <head> <title>html5 touch tracing </title> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css"> <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> <script type='text/javascript'> function opensocket(){ if ("websocket" in window) { alert("websocket supported browser!");

javascript - this is undefined while trying to inherit prototype -

i trying add prototype dynamically reason keyword return undefined when try inherit prototype . when run same code on browser console works fine. why not working node.js? i have included full code @ end of question. my main issue happens here: let postobj = function(){ this.data = post; this.originalindex = i; }; //postobj.prototype = postproto; // have same result postobj.prototype = object.create(postproto); //postobj.data = post; _self.posts.push(new postobj()); when try access this inside prototype method return undefined. example postproto has method id looks this.data._id . can see have set constructors postobj , why not being passed prototype? please tell me whats wrong here. full code: const postprototype = { id: (){ return this.data._id; }, title: (){ return this.data.title; } } function fetchposts(){ this.posts = []; this.rawposts = [ {_id: '1', title: 'in sit amet lorem velit, in dictum lorem'}, {_id:

iphone - How to manage state in ios objective c -

i’m new in ios development. question is, i’ve 2 view controllers. viewcontroller - viewcontroller - b now, if killed app viewcontroller - , relaunch app. app must open viewcontroller - a. , if killed app viewcontroller - b , relaunch app. app must open viewcontroller - b. can me, i’ve done rnd can not find proper solution. thanks make shareddelegate in appdelegate.m file +(appdelegate *)shareddelegate { return (appdelegate *) [uiapplication sharedapplication].delegate; } in appdelgate.h +(appdelegate *)shareddelegate; @property (nonatomic,strong) nsstring *currentviewcontoller; when push anycontoller set appdelegates currentviewcontoller new vc viewcontroller *vc=[[viewcontroller alloc]init]; [self.navigationcontroller pushviewcontroller:vc animated:yes]; [appdelegate shareddelegate].currentviewcontoller=nsstringfromclass([viewcontroller class]); now when app terminated (void)applicationwillterminate:(uiapplication *)application { // ca

javascript - How to access the data's(search,objects) returned by the getInputMethod on Map Method of Map Reduce Script in Netsuite -

in getinputdata() of map reduce script , created search on invoice record , created search on custom record called contract , stored results in 1 object , have created search on custom record called formula , stored results in 1 object returning invoice search results, contract object , formula object. i data's returned on getinputdata method accessed on map method using context object. i'm getting data of invoice search results on map method using json.parse(context.value); how data of contract object , formula object on map method. code: var contractrecords = {}; var formulas = {}; define(['n/error', 'n/record', 'n/search', 'n/log', 'n/task', 'n/runtime', 'n/email'], function(error, record, search, log, task, runtime, email) { function getinputdata() { try{ log.debug("get input", "initiated"); //invoice search var invo

Ruby - Understanding Winning Method -

i have ruby code here has 2 series of hashes , there method. valid_choices = { 'r' => 'rock', 'p' => 'paper', 'sc' => 'scissors', 'l' => 'lizard', 'sp' => 'spock' } winning_combo = { 'r' => ['sc', 'l'], 'p' => ['r', 'sp'], 'sc' => ['p', 'l'], 'l' => ['sp', 'p'], 'sp' => ['sc', 'r'] } def win?(first, second) winning_combo[first].include?(second) end any 1 out there can explain me win? method does? , similar this? def win?(first, second) (first == 'sc' && second == 'p') || (first == 'p' && second == 'r') || (first == 'r' && second == 'l') || (first == 'l' && second == 'sp') || (first == 'sp' && second

android - how to set the context of another class from different class? -

Image
i have main activity , settings activity. settings activity class fired via intent when clicked on menu item settings. now, want make sure default values set in preferences inside oncreate mainactivity call following code. error mainactivity context not taken setdefaultvalues method. think needs context of settings activity. how can pass in correct context mainactivity. in other words should put instead of main activity oncreate method. preferencemanager.setdefaultvalues(this, r.xml.preferences, false); update: my main activity looks follows: here important part setdefaultvalues getting error on part. "this" not acceptable there. when set default values inside settingsfragment or settingsactivity class works fine looks need pass context of settingsactivity , not mainactivity. please help! thanks! public class mainactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate)

firebase - Fetch events data into Google Analytics -

we have 2 apps ios , android on firebase. i linked firebase analytics google analytics. can see logged events in both firebase , google analytics consoles, can't events through google analytics api. how can fetch events data collected firebase analytics google analytics? firebase analytics , google analytics separated products. linking them toghether allows see firebase reports in google analytics ui, data , reports still different , separated. the google analytics api won't allow query of data in firebase analytics. there's no api query data firebase analytics programatically. your option query data programmatically link firebase analytics bigquery . allow firebase analytics data exported bigquery in turn can query using different bigquery tools.

d3.js - Convert Javascript object to array of numbers -

i have object has set of numbers > var size = d3.values(data[0]); >size output: ["0", "14.71", "50.0", "35.29"] >typeof(size); output: "object" i want sum width , output below: [0, 14.71, 64.71, 100] but output got below: >var width = [size[0], size[0]+size[1], size[0]+size[1]+size[2], size[0]+size[1]+size[2]+size[3]]; >width output: ["0", "014.71", "014.7150.0", "014.7150.035.29"] please me fix this. in advance... you use array#map , thisargs , implicit casting number element. var data = ["0", "14.71", "50.0", "35.29"], width = data.map(function (a) { return this.count += +a; }, { count: 0}); console.log(width); es6 without use of thisarg ( this not work arrow function ), closure of count . var data = ["

objective c - Use Legacy Swift Language Version -

Image
i using swift libraries in objective-c project cocoapods. i tried running them in released xcode 8 gm , getting following error: i tried solutions in below link , other answers nothing seems work. http://www.ios-blog.co.uk/tutorials/xcode/quick-tip-fix-use-legacy-swift-issue-in-xcode-8-beta-3/ libraries using charts , xlpagerstrip. you need update "pods" project. each pod, choose target , set use legacy compiler. note if "pod install" later, workspace gets generated overwrite legacy compiler settings, have redo them.

java - No mapping found for HTTP request with URI [/Spring_mvc_sep13/WEB-INF/Asset.jsp] in DispatcherServlet -

Image
please me solve issue. request going controller class , getting view name failing display jsp error. i getting following warning on console when url ' http://localhost:8080/spring_mvc_sep13/assetcontroller ' typed in browser. org.springframework.web.servlet.pagenotfound nohandlerfound warning: no mapping found http request uri [/spring_mvc_sep13/web-inf/asset.jsp] in dispatcherservlet name 'disp' the web.xml follows <servlet> <servlet-name>disp</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <init-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/dispatcher-beans.xml</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>disp</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> the dispatcher-beans.xml file fol

bundle - Angular 2: SystemJS builder says "no metadata found" -

i'm trying create bundle file using systemjs-builder. this gulp task: gulp.task('bundle', function() { var builder = new systemjsbuilder('', './app/configs/systemjs.config.js'); return builder.buildstatic('./app/**/*.js', './production/bundle.js', { minify: true, sourcemaps: true, encodenames: false }) .then(function() { console.log('build complete'); }) .catch(function(err) { console.log('build error'); console.log(err); }); }); it creates production/bundle.js fine, , can see modules in there. when replace following: <script> system.import('app').catch(function(err){ console.error(err); }); </script> with: <script src="production/bundle.js"></script> inside "index.html" file, get: core.umd.js:5995 exception: uncaught (in promise): error: no ngmodule metadata fou

python - MATLAB ind2sub and Numpy unravel_index inconsistency -

based on following answer : using octave, get: >> [x, y, z] = ind2sub([27, 5, 58], 3766) x = 13 y = 5 z = 28 using numpy, get: >>> import numpy np >>> np.unravel_index(3765, (27, 5, 58)) (12, 4, 53) why, in numpy, z component 58, when should 27 according octave? well matlab follows column-major indexing, (x,y,z) elements stored @ x , y , z . numpy (x,y,z) because of row-major indexing, it's other way - z , y , x . so, replicate same behavior in numpy, need flip grid shape use np.unravel_index , flip output indices, - np.unravel_index(3765, (58, 5, 27))[::-1] sample run - in [18]: np.unravel_index(3765, (58, 5, 27))[::-1] out[18]: (12, 4, 27)