Posts

Showing posts from June, 2015

typescript - Unable to set img src from cordova file in Ionic -

i'm using cordova-plugin-file-transfer , cordova-plugin-file download user avatars , display them locally in app. i'm fetching images , storing them in file.datadirectory according to: https://ionicframework.com/docs/native/file-transfer/ . when check file in directory says exists...however when try set absolute path of file <img> tag see nothing. i'm pulling in path dynamically when hardcode it...nothing. code saving, loading avatars: saveavatar() { var downloadurl = this.user.avatar + "?type=small&sz=75"; console.log("downloading avatar from: " + downloadurl); console.log("storing file to: " + this.file.datadirectory + this.user.id + '/avatar.jpg'); this.filetransfer.download(downloadurl, this.file.datadirectory + this.user.id + '/avatar.jpg') .then((entry) => { console.log('~~~~~ download complete: ' + entry.tourl()); }, (error) => { console.log(&

dplyr - making custom bins in dataframe inside function in R -

i create bins variable numbers per category name inside function. having difficulties related using category name provided parameter inside function. in dplyr approach, each observation gets bin in new column. pass colgroup parameter inside mutate instead of writing name of column directly, , establish bin lower , upper limits each group (colgroup) in pseudocode. maybe data.table approach better. set.seed(10) b<-(rnorm(10, sd=1,mean=10)) y<-runif(3) pr<-y/sum(y) names<-unlist(lapply(mapply(rep, letters[1:3], 1:3), function (x) paste0(x, collapse = "") ) ) x <- sample(names, 10, replace=true, prob=pr) df<-data.frame(name=x,numbers=b) df #working without bin limits per category (not desired) #and using "numbers" in cut (not desired) binfunction1 <- function(df, colgroup1, varcount,binsize) { new<-df %>% group_by_(colgroup1) %>% mutate(bin = cut(numbers, breaks <- c(seq(7, 15, = binsize)), # limits colgroup not imp

What happens when declaring an additional index on the primary key in Oracle SQL? -

i have multi-part question: my journey began when trying figure out if can have descending/ascending primary keys in oracle sql. there doesn't seem syntax along lines of create table mytab (id int primary key desc); or create table mytab (id int, constraint pk primary key(id desc)); later learned oracle implicitly creates index primary key enforce constraints. figured create index it, , make index descending. create index myind on mytab (id desc); this worked, when did query see indices existed got this: > select index_name user_indexes table_name = 'mytab'; index_name ------------------------------ sys_c0011939 myind i see implicitly created index there own index... tried see if rid of implicitly created index creating index primary key during table create: create table mytab (id int primary key using index (create index myind on mytab (id asc))); this worked: > select index_name user_indexes table_name = 'mytab'; index_name ----

javascript - dynamically adding markers to google map - angular2 -

so have 2 components, first of them form use adding latitude , longitude service markers. main component map want add markers. first problem initialize map , data in ngoninit() can't dynamically add new data because component doesn't reload , oninit don't run again. second problem don't know how add new markers when initialize map in ngoninit. that main component: export class appcomponent implements oninit { parties: party[] = []; party_location: location[] = []; constructor(private partyservice: partyservice) { } ngoninit() { map = new google.maps.map(document.getelementbyid('map'), { center: { lat: -25.363, lng: 131.044 }, scrollwheel: true, zoom: 16 }); this.parties = this.partyservice.getdata(); //get data (let item of this.parties) { //try add markers let marker = new google.maps.marker({ map: map, position: { lat: item.lan1, lng: item.lan2 }, title: item.title }); } if (navi

arduino - How often can a Center 'notify' a Peripheral in BLE -

i have rc car built using arduino, bluetooth usb dongle, , ps3 controller. car has several functions (lights, sounds) along driving around. i want replace bluetooth dongle , ps3 controller ble module (i have hm-10) , want use web bluetooth. controller virtual 1 served secure website. my question is: setup possible current version of web bluetooth? and: how can center (my computer/website) notify peripheral (the rc car) start/stop/turn/play sound/etc... ? in general, limitations (if any...i'm sure there or wouldn't posting this) run setup vs simple bluetooth dongle/ps3 controller. i hate general being new tech, other comments/insights/pitfalls welcome! yes, possible. examples: rc car dev board web bluetooth sphero controlled web bluetooth you keep dual shock 3 optional input device using gamepad api . regarding notification frequency, neither chrome nor web bluetooth api impose artificial limitation on ble activity @ level. however, that's no

wxwidgets - Assert in call to wxDataViewListCtrl::EditItem in a second wxDataViewListCtrl -

i'm getting following assert when wxdataviewlistctrl::edititem called second time. ../../src/wxwidgets/src/gtk/dataview.cpp(221): assert "gtk_tree_selection_get_select_function(m_selection) == func" failed in checkcurrentselectionfunc(): selection function has changed unexpectedly, review code! see code @ https://pastebin.com/tetk5c7s to reproduce: choose menu, show dialog. in dialog choose add , close. again choose menu, show dialog , in dialog choose add. ubuntu 17.04 x64, tested master, wx_3_0_branch , wx_3_0_3_branch configured --enable-debug --enable-unicode --disable-universal default config gtk2-unicode-3.0 edit: after further testing found assert occurs in call edititem in second wxdataviewlistctrl. this bug in wxwidgets, reporting it. fixed in both master , 3.0 branch , work in 3.0.4 , 3.1.1 when they're released.

iframe - Primefaces - Dialog framework, auto resize not working -

primefaces 6.0 - dialog framework my dialog has p:calendar component , when user clicks put date, calendar open , doesn't fit inside of dialog iframe , vertical scroll appears. if resize dialog, iframe don't resize. if open dialog options.put("contentheight", "100%"); the resize works, initial height of dialog comes wrong, components hidden. want initial height continue auto. any help?

apache poi - How to reduce time in a Java execution program? -

i'm kind of new in theme, want reduce time in program execution, can not post of code politics client, try detailed can. i have program on java , uses next libraries: pdfbox 1.8.2 poi 3.7 and common ones, java util, io, regex, , swing. the inputs are: 1. "mom pdf" file 2. excel original file the outputs: childs pdf files an output excel information this program takes information pdf file , put excel file. pdf file have hundreds of pages. program read "mom pdf" file search "the word" , if word in page creates "child pdf" file page, extracts information required, open excel file write down information extracted page, close excel file , close "child pdf" . action repeats numbers of times regex finds "the word" in "mom pdf" .the program structured in 3 blocks. the setting block . when prepare file directions , initialize them the extraction block . when program reads pdf file , sear

bluetooth - Xamarin iOS External Accessory: check whether hands free device (car) is available -

i want app detect hands-free built in car. don't need communicate device, need check if available. ex: want send notification when hands-free available on vehicle. i got working corebluetooth works bt4/ble. need use eaaccessorymanager old bluetooth devices (version 2.0)? how can implement this? did try code below not work: var _accessorylist = eaaccessorymanager.sharedaccessorymanager.connectedaccessories; foreach (eaaccessory acc in _accessorylist) { // devices } the list _accessorylist empty. the info.plist contains background mode external accessory communication , key uisupportedexternalaccessoryprotocols not sure should value put in. any help? missing? thanks

php - Error writing dockerrun.aws.json v2 file -

i using file deploy multicontainer nginx php-fpm application in aws. i run eb local run , shows me error. holdbusinessnginx_1 | nginx: [emerg] host not found in upstream "php:9000" in /etc/nginx/conf.d/upstream.conf:1 elasticbeanstalk_holdbusinessnginx_1 exited code 1 it because nginx running before php-fpm. in docker-compose.yml file there directive called depends-on. is there way use in dockerrun.aws.json file? just use directive of "links": [ "php" ], where php name of other container defined in same dockerrun.aws.json file. eb kinda guessing dependencies on links, volumes etc. forcing nginx container link php you're saying eb php should before nignx . in shortcut. :-)

php - Select * From table Order by TRIM(ALL [:nonalphnum:] FROM `title`) -

what thought simple query turning major headache. i want order trimming non-alphanum characters in title. as in... sort results alphanumerically ignore non-alphanum characters... not removing them database, assume not there. i believe trim doesn't work character classes. , case poster example regular expression replace function ... mysql doesn't provide afaik. what is: create column write title alphanum - php - , (created when inserted or once existing rows) , sort on that.

c# - SetActive GameObject to true not working in Unity 5 -

well work unity 5. i'm create dialogue interaction other object. when player near of object press return key interaction. the panel dialogue start disabled setactive(false). in method update when player near other object , press return key , panel setactive(true) , panel not enabled , don't know why. please help. thanks... using unityengine; using system.collections; using unityengine.ui; [requirecomponent(typeof(text))] public class dialogue : monobehaviour { private text _textcomponent; public string[] dialoguestrings; public float secondsbetweencharacters = 0.15f; public float characterratemultiplier = 0.5f; public keycode dialogueinput = keycode.return; private bool _isstringbeingrevealed = false; private bool _isdialogueplaying = false; private bool _isendofdialogue = false; public gameobject continueicon; public gameobject stopicon; public gameobject panel; //vector3 thirdpers

javascript - How do I make these triangles have no fill and only borders? -

i've tried following instructions various sources haven't had success. i'm new webgl , opengl. provided code , have been making tweaks every since. if has resources share can answer own question, appreciated! here html: <!doctype html> <html> <head> </head> <body> <!--include a/s webgl support libraries--> <script type="text/javascript" src="../common/webgl-utils.js"></script> <script type="text/javascript" src="../common/initshaders.js"></script> <script type="text/javascript" src="../common/mv.js"></script> <script type="text/javascript" src="../common/webgl-debug.js"></script> <script type="text/javascript" src="assignment1.js"></script> <script id="vertex-shader" type="x-shader/x-vertex"> // glsl vertex shade

dbGetQuery in R truncates really long the SQL query (of length 10564 characters) -

i have been trying execute long sql query , result data frame in r. following line throws error , displays partial query in console (truncates it) my_dataframe <- dbgetquery(conn, my_large_query) the length of query 10564 characters use lot of ctes. have removed string truncation via options menu in r studio wonder if there character limitation in dbgetquery function in r? any suggestions? rdmbs: db2 (on ibm as400), r package: dbi (library - rjdbc) you mentioned changing 'string truncation', how warning.length ? options("warning.length"={integer}) i'd suggest test query out first in whatever gui available database. when verify there's no problem query, run in r. when dbgetquery (assuming dbi package) throws sql/database error, actual content of error won't shown until after full text of query. in other words, if query text being truncated in r error output, database error code/text coming not visible @ all. issue may ext

html - Vertically center align a text on the right side of an image in a div -

i have bunch of image , text side side, both inside div float:right . this how looks now . need vertically center align text beside image (for example text answer ). how do that? please suggest. <div id="content">content here</div> <div id="navbar"> <br> <div id ="quesbuildertext">question builder</div> <br> <div id = "textimage"> <img id="textimg"/></div> <div id = "texttext"> text answers </div> <br> <br> <br> <div id = "multiplechoiceimage"> <img id="multiplechoiceimg"/></div> <div id = "multiplechoicetext"> multiple choice </div> <br> <br> <br> <div id = "dropdownimage"> <img id="dropdownimg"/></div> <div

angular - routerLink with outlet redirects to 404 error page -

i have angular 4 application , not able set working routerlink navigation. request gets redirected 404 error page. here code: the relevant part of route-config in ngmodule : { path: 'transactions', component: transactionindexcomponent, children: [ { path: 'add', outlet: "next", component: transactionaddcomponent, children: [ { path: "addperson", component: personsaddcomponent, outlet: "next" } ] }, ] }, the relevant part of transactionsindexcomponent template: <a routerlink="[{ outlets: { next: 'add' } } ]" class="tile">add</a> <router-outlet name="next"></router-outlet> the relevant part of transactionaddcomponent template: <a routerlink="[{ outlets: { next: 'addperson' } } ]" class="tile">add person</a> <router-outlet name="nex

r - How to compute row similarity in a data-frame with non uniform similarity between the categories of an attribute? -

i compute row similarity in data frame via gower similarity metric following, in general. library(cluster) mydf <- data.frame(x1 = 1:10, x2 = c(rep("a", 4), rep("b", 3), rep("c", 3)), x3 = c(rep("a", 2), rep("b", 2), "c", "d", rep("e", 4))) similarity <- 1 - daisy(mydf, metric = "gower", weights = c(1, 1, 1)) above assumed differences between categories in categorical attributes (2nd , 3rd columns) same. but, if s non uniform dissimilarity matrix between 5 categories of 3rd attribute (a, b, c, d, e): s <- matrix(c(0.00, 0.09, 0.12, 0.10, 0.12, 0.09, 0.00, 0.05, 0.13, 0.16, 0.12, 0.05, 0.00, 0.17, 0.20, 0.10, 0.13, 0.17, 0.00, 0.09, 0.12, 0.16, 0.20, 0.09, 0.00),5) what best way incorporate piece of information

How to print a program's return in Python -

this question has answer here: python - output functions? 3 answers i new python. i have simple program finds greatest common denominator (gcd) of 2 numbers. goes this def gcd(a, b): if == b: return else: if > b: return gcd(a-b, b) else: return gcd(a, b-a) this text in notepad document titled gcd.py on desktop. can see program doesn't print returns greatest common denominator. i need print results doing following print(gcd(25,10)) . don't know can put line results need. tried inputting windows command line doing python print(gcd(25,10)) . doesn't work. neither print(gcd(25,10)) in python interpreter. i think supposed put in python interpreter, interpreter has set correct directory of desktop (where gcd file found)but cant seem that. tried o.chdir , when print(cwd) prints correct directory still doesn'

c++ - If std::greater<>, then why std::less (and not std::lesser<>)? -

this apparently looks grammatical (and funny?) question. hope not. i wonder why have std::greater<> if don't have std::lesser<> ? doesn't make sense have either greater , lesser or great , less ? ask question because pretty mess every single time , need google it. is there naming convention standard follows?

python 2.7 - raise TesseractError(status, errors) pyocr.error.TesseractError: (-1073741819, '') -

i got following error when use pyocr: traceback (most recent call last): file "f:/workspace/work/project/image/imageword_extract/test_pyocr.py", line 32, in print tools[0].image_to_string(enhance_image(image_path+'\timg1.jpg'),lang='chi_sim') file "d:\anaconda2\lib\site-packages\pyocr\tesseract.py", line 358, in image_to_string raise tesseracterror(status, errors) pyocr.error.tesseracterror: (-1073741819, '') there no problem identify english, when identify chinese reported above error can please check if have "chi_sim.traineddata" training file in tessdata directory, if not please place file , give try. luck! training file available @ below link: https://github.com/tesseract-ocr/tessdata/raw/4.00/chi_sim.traineddata

java - what is actual and formal argument lists differ in length and how to fix it in my code -

so keep getting error when try run program problem dont know in driver. thats part of assignment. line of code believe giving me issue. public votingmachine(int d, int r, int i) { dvotes = d; rvotes = r; ivotes = i; } and error keep getting. /tmp/codecheck/17091202408150120863985811601/submission/votingsimulation.java:9 error: constructor votingmachine in class votingmachine cannot applied given types; votingmachine vm = new votingmachine(); ^ required: int,int,int found: no arguments reason: actual , formal argument lists differ in length i have no idea why doing please if need more info let me know or other lines of code. in java, if provide constructor arguments, must explicitly provide no-arg constructor; not there implicitly. i.e. add no-arg constructor class

vue.js - VueJS slots with v-for loop do not display proper elements -

i'm trying create component displays subset of items passed it. so far have 'sublist' component named slots follows: ... data: () => ({ startitem : 0 }) ... <template> <div> <slot v-for="ctr in maxitems" :name="'s-' + (ctr + startitem - 1)"></slot> </div> </template> in parent following: <sublist :max-items="5"> <div v-for="(i,index) in items" :slot="'s-'+index"> {{index}} </div> </sublist> when loads, renders fine: 0 1 2 3 4 however when increment startitem in sublist component, output becomes: 5 1 2 3 4 so removes 0th slot , stuffs slot 5 in place. proper way replace slots or make them "dynamic"? i'm using vuejs 2.4.2 thanks @steveholgado found answer: had add :key attribute in parent v-for , wrap each slot in child in own div: <template> <div&g

generics - Subclassing typing.GenericMeta in Python -

so want have (abstract) base class behaves sort of generic (i.e. subscripting typevar s generates type-annotated base class can inherit make new generic classes), added features best defined in metaclass. trying out, , looking @ source code of typing module, there doesn't seem easy way want without understanding , copying of logic , code of module. is there better way? if it's not clear, here's want: class mymeta(genericmeta): # own added behaviors/features ... class mygenericbase(metaclass=mymeta): ... t = typevar("t") class mygeneric(mygenericbase[t]): ... x : mygeneric[int] = mygeneric(1) as is, doing this: t = typevar("t") class mybase(metaclass=genericmeta): pass mybase[t] throws exception mybase not being generic class.

corruption - Images cut off on mass import -

i'm importing a lot of images, >50,000, neto website , they're not importing correctly; @ bottom of images, horizontal grey bars rendered instead of rest of image. since affects bottom , seemingly in sequence best guess it's timing; server cuts connection because it's timing out, cms accepts , processes image though it's incomplete. example here. let me know if thoughts! :)

git merge - Convince git blame that one branch is more relevant to history than another -

i use git blame secondary form of documentation. it's useful check why commit made, , when , whom. but history of particular line gets lost. situations might happen: a change made, reverted. someone re-indents file , commits it. later standard indentation restored , committed. someone copies files new branch/repo no history. still have original history in branch, want merge new branch. in these cases git blame show latest changes file, not useful. e.g. "restore indentation" or "revert commit #123" or "initial commit: files". is there way hint git blame more interested in older history new one? here situation: ... - - b - c commit has annotations lines in file. commit b reindented entire file. commit c (possibly revert) restores file how in commit a. i wondering if perform magical git merge priority parent: .-------. / \ ... - - b - c - d commit d tells git priority history git blame follow.

android - RecyclerView - Reverse Order -

i new android. using recycler view in reverse order display chat history . if there 1 message in chat, display message in bottom (like telegram). need display top. stuck in day. can please give me suggestion display message top in recyclerview reverse order (like whatsapp). i faced same problem day's ago. whatever solve way. <android.support.v7.widget.recyclerview android:id="@+id/reyclerview_message_list" android:layout_width="match_parent" android:layout_height="wrap_content" android:scrollbars="vertical" app:stackfromend="true" app:reverselayout="true"/>

javascript - How do I split a table column into a new column at the nth delimiter -

Image
i managed create code splits, @ slash delimiter, third column new columns. what did not manage make split @ nth (i.e. 2nd) occurrence. not find similar question on internet, that's why post here. the desired outcome should follows: all welcome! function split() { var delimiter = "/"; var arr = []; var highest = 0; var columnindex = ""; $('#tbl td:nth-child(3)').each(function() { columnindex = $(this).index(); var string = $(this).text(); var array = string.split(delimiter); var nbrcharacter = (string.split(delimiter).length - 1) //count occurences of character var temp = (nbrcharacter > highest) ? highest++ : highest = highest; arr.push(string.split(delimiter)); }); (i = 0; < highest; i++) { //add empty columns $('#tbl').find('tr').each(function() { $(this).find('td').eq(columnindex

javascript - Vue non reactive data available on instance -

i want store object in vue, should available entire instance , not reactive. (with reactive) use 'data' this: new vue({ data: myobject }) but in fact myobject don't need change think making reactive bad. there method this? you can use vue instance properties. there may data/utilities you’d use in many components, don’t want pollute global scope. in these cases, can make them available each vue instance defining them on prototype: vue.prototype.$appname = 'my app' now $appname available on vue instances, before creation. if run: new vue({ beforecreate: function () { console.log(this.$appname) } }) reference: link or you can use vuex state data property , define mutations if want change value.

reactjs - Unit Test d3v4 zoom behavior in React with Chai -

using d3v4, react , chai (chai-enzyme, chai-jquery) unit testing. so have zoom behavior attached graph. const zoom = d3 .zoom() .scaleextent([1, infinity]) .on('zoom', () => { this.zoomed() }) and zoom behavior attached svg element. const svg = d3 .select(this.node) .select('svg') .attr('preserveaspectratio', 'xminymin meet') .attr('viewbox', `0 0 ${svgwidth} ${svgheight}`) .classed('svg-content-responsive', true) .select('g') .attr('transform', `translate(${margin.left},${margin.top})`) .attr('height', height + margin.top + margin.bottom) .attr('width', width + margin.left + margin.right) .call(zoom) the on('zoom') callback defined as zoomed () { const {gxaxis, plotplantext, plotzones, width, xaxis, xscale} = this.graphobjects const transform = d3.event.transform // xmin , xmax in viewable world const [xmin, xmax] = xscale.domain().map(d =>

Magento 1.9: Get product id from wishlist remove item event -

when remove item wishlist, need product id of item. please me on this. see code below: config.xml <wishlist_item_save_after> <observers> <data_wishlist_delete> <class>data/observer</class> <method>deletefromwishlist</method> </data_wishlist_delete> </observers> </wishlist_item_save_after> observer.php public function deletefromwishlist() { $item = mage::app()->getrequest()->getparam('item'); $action = mage::app()->getrequest()->getactionname(); if (($action == 'remove') && !empty($item)) { $resource = mage::getsingleton('core/resource'); $readconnection = $resource->getconnection('core_read'); $query = 'select product_id wishlist_item wishlist_item_id = ' . $item . &#

android - how to add menu items dynamically to navigation drawer? -

i have 3 types of users each user has different menu options in navigation drawer.that menu options getting server.i have single login screen 3 users.according user login, menu delivered server.i want add menu item navigation drawer.i got code during search.but want know, how design navigation drawer accept dynamic menu items navigationview navview = (navigationview) findviewbyid(r.id.your_nav_view_id); menu m = navview.getmenu(); submenu menugroup = m.addsubmenu("my menu group"); menugroup .add("name"); menugroup .add("address"); you can add recycler view in navigation layout , set adapter , set data received server.

android - What is making my widget's infinite loop stop working? -

my widget blank background switches between 2 colors 333ms delay between each switch. works fine @ first, after 158 switches, stops switching colors. thing is, don't rely on onupdate. everything's in infinite while-loop first called when put widget on home screen. causing stop switching after 158 switches? changing background color costly, , os disables widget? colorswitchwidget.java: public class colorswitchwidget extends appwidgetprovider { static void updateappwidget(context context, appwidgetmanager appwidgetmanager, int appwidgetid) { remoteviews views = new remoteviews(context.getpackagename(), r.layout.color_switch_widget); boolean lighton = true; while(true){ try{ thread.sleep(333); } catch(interruptedexception e){ } if (lighton) { views.setint(r.id.relativelayout1, "setbackgroundcolor", color.argb(150, 255, 248, 231)); //color 1

Google sheets API - add banding ("zebra coloring") from apps script -

i'm looking example code how add new banded range (addbanding request) google sheet. have tried modify of examples available in v4 api doc, keep getting "invalid json payload" errors. code: function addbanding() { var request = { 'addbanding': { 'bandedrangeid': 1, 'range': { 'sheetid': 0, 'startrowindex': 0, 'endrowindex': 15, 'startcolumnindex': 0, 'endcolumnindex': 4, }, 'rowproperties': { 'headercolor': { 'red': 1, 'green': 0, 'blue': 1, 'alpha': 1, }, 'firstbandcolor': { 'red': 1, 'green': 0, 'blue': 0, 'alpha': 0, }, 'secondbandcolor': { 'red': 0, 'green': 1, 'blue': 0, 'alpha': 0, } },

wordpress - Error: Option 'ajax' is not allowed for Select2 when attached to a element - After version upgrade to 3.1.2 -

Image
recently have updated wocommerce version 3.1.2. fetching problem when going add variable product or editing variable product. showing " uncaught error: option 'ajax' not allowed select2 when attached element. " js error when selecting product attribute or variation. uncaught error: option 'ajax' not allowed select2 when attached <select> element. @ string.<anonymous> (ultimate-woocomposer-backend.min.js:1) @ function.each (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-menu,wp-a11y,jquery-ui-autocomplete,underscore,backbone,wp-util,wp-backbone,media-models,plupload,jquery-ui-tooltip&ver=4.8.1:2) @ d.prepareopts (ultimate-woocomposer-backend.min.js:1) @ d.prepareopts (ultimate-woocomposer-backend.min.js:2) @ d.init (ultimate-woocomposer-backend.min.js:1) @ htmlselectelement.<anonymous>

python - Not able to decode slack's response to my request URL on button press, ValueError in json.loads -

i working slack's api , sent message user { "text": "would play game?", "attachments": [ { "text": "choose game play", "fallback": "you unable choose game", "callback_id": "wopr_game", "color": "#3aa3e3", "attachment_type": "default", "actions": [ { "name": "game", "text": "chess", "type": "button", "value": "chess" }, { "name": "game", "text": "falken's maze", "type": "button", "value": "maze" }, { "name": "gam

Not able to Sign In Google Plus in Android Application -

i have implemented 2 functionalities in android app. first, firebase notifications , other google sign in. have registered app on firebase , google-services.json file not enabled google sign in. , google sign in,i using developer.google.com guide sign in g+ g+ sign in not working in live app. working fine in testing app. now question is, need have google sign in using firebase console or can use developer.google.com. please help.

asynchronous - Angular *ngFor bound to observable with async pipe - whats happening? -

i have started angular4 , have came against conceptual problem. async pipe (used in combination *ngfor in case) meant subscribe observable , away manual subscriptions. looking @ examples on web: case 1: binding observable contains single items such observable<user> case 2: binding observable contains arrays of items such observable<user[]> case 3: variations of 1 , 2 subject, promise or behavioursubject (example of case 1 single item: http://briantroncone.com/?p=623 ) (example of case 2 array: http://www.concretepage.com/angular-2/angular-2-async-pipe-example ) conceptually ngfor iterates on enumerable , i'm assuming enumerable item emitted observable , not observable itself. so *ngfor="let user of users" going work on observable<user[]> , not observable<user> ? the *ngfor triggered each item arrives observable? if case how can bind observable of item , not item[] , how ngfor iterate on item when not enumerable? thank

c++ - MapViewOfFile returns different adresses with same handle -

im trying implement ipc school assignment sharing memory. made class called sharedmemorybuffer deal creating file mappings , views. my init() function looks this: byte * sharedmemorybuffer::init(const wchar_t * name, size_t buffersize) { filemaphandle = openfilemapping( file_map_all_access, // read/write access false, // not inherit name name); // name of mapping object if (filemaphandle == null) { filemaphandle = createfilemapping(invalid_handle_value, null, page_readwrite, 0, buffersize, name); pbuf = (byte*)mapviewoffile(filemaphandle, // handle map object file_map_all_access, // read/write permission 0, 0, buffersize); } else { pbuf = (byte*)mapviewoffile( filemaphandle, file_map_all_access, 0

angular - Ionic slides - dynamically add slides before and after -

hi i'm using ngfor create set of 3 slides while starting in middle i'm guaranteed able slide left or right on start. when slide right can simple listen reachedend , push slide array i'm looping. but have problem adding slide beginning. if same above , use e.g. array.unshift() or spread add item beginning, view think it's on position 0 , snaps view new slide. the code below work animates slide change index 1. slide = [0,1,2] //example loop slidechanged(event) { if(this.slides.isbeginning()){ this.slide = [this.slide[0]-1, ...this.slide]; this.slides.update(); this.slides.slideto(1) } } <ion-slides [initialslide]="1" (ionslidedidchange)="slidechanged($event)"> <ion-slide *ngfor="let item of slide"> <h1>slide {{item}}</h1> </ion-slide> </ion-slides> any appreciated! you can using ionslidenextend , ionslideprevend events slides . please

c++ - Ubuntu 14.04 compile caffe : ld cannot find library -

i'm trying compile caffe , following errors: /usr/bin/ld: cannot find -lps collect2: error: ld returned 1 exit status make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] error 1 what lps ? why ld can't find these libraries? thanks.

Cordova iOS app memory getting cleared -

my cordova ios app works on emulator crashes on device. device has many apps installed. app crashes because finds object undefined. object getting undefined in device , not on emulator. leads me believe device clearing objects out memory. how diagnose correctly? intuition correct?

python - SciPy Stack installation confusion between Python2 and Python3 -

i have installed scipy stack using pip. however, installed python 2.7, , unable import numpy program in python 3.6 idle. now installing using pip3, should install stack python 3.6. how uninstall or delete stack python 2.7? update: after using pip3, unable import bumpy or other library in python 3.6. why not? from documentation : pip uninstall [options] <package> ... pip uninstall [options] -r <requirements file> ...

How to get the value of a specific nested XML node in PHP? -

i need value of every "custom_field" named "zip" out of following xml-file using php. when parse it, either values of projects or empty array? can help? <?xml version="1.0" encoding="utf-8"?> <projects total_count="237" offset="0" limit="100" type="array"> <project> <id>239</id> <name>abc</name> <identifier></identifier> <description></description> <status>1</status> <is_public>false</is_public> <custom_fields type="array"> <custom_field id="18" name="name affix"> <value></value> </custom_field> <custom_field id="20" name="zip"> <value>x1111</value> </custom_field> </custom_fields> <created_on>2017-06-05t16:3

cookies - from where http or https got selected in Magento 2 -

i have send unsecure request secure 1 making site url https in magento new , not able figure out how magento frontend. can me? login magento2 admin navigate store--> configuration --> web there change base url https .

python - FAILED_PRECONDITION: Error: SavedModel directory gs://mybucket1/ is expected contain exactly one of [saved_model.pb, saved_model.pbtxt] -

i'm trying use google cloud platform deploy model support prediction. i train model (locally) following instruction ~/$ gcloud ml-engine local train --module-name trainer.task --package-path trainer and works fine (...): info:tensorflow:restoring parameters gs://my-bucket1/test2/model.ckpt-45000 info:tensorflow:saving checkpoints 45001 gs://my-bucket1/test2/model.ckpt. info:tensorflow:loss = 17471.6, step = 45001 [...] loss: 144278.046875 average_loss: 1453.68 global_step: 50000 loss: 144278.0 info:tensorflow:restoring parameters gs://my-bucket1/test2/model.ckpt-50000 mean square error of test set = 593.1018482 but, when run following command create version, gcloud ml-engine versions create mo1 --model mod1 --origin gs://my-bucket1/test2/ --runtime-version 1.3 then following error. error: (gcloud.ml-engine.versions.create) failed_precondition: field: version.deployment_uri error: savedmodel directory gs:/

How to save word online file anywhere in Sharepoint documents with "save as" function? -

my work uses office 365. need able use custom word templates , save them new files in new folders in our sharepoint documents, without having move them after saved, each time. as of now, when try save word document, gives option save in folder working in. is there way of saving word online document anywhere in sharepoint?

php - How to save your database(mysql) as xlsx(box/spout) -

i'm sorry bad english how save database(mysql) xlsx(box/spout) ? using phpexcel , big files causing problems hear box/spout fast. i'm looking examples not find complete narrative for example, (phpexcel) $objworksheet-> setcellvalue('a1', 'hello'); sorry again

python - parameter passing to python3.x script from commandline -

i new python. write script if didn't pass value argument, should ask value argument. if passed, should pick value , continue.passing these values command line. tried below code , python throwing error saying variable not initialized. if (filename == none) filename == "c:\\filename" print(filename) command line call executing script:- script.py "c:\filename" stack trace :- if(no_error == none) ^ syntaxerror: invalid syntax sys module provides lots of options play command line arguments. below example might helpful you. import sys #storing argument in string st=" ".join(sys.argv) #splitting list file name , storing in list var=st.split('=') if len(sys.argv)<2: print "enter argument\n" else: print 'argument found' print var[1]

c++ - Stopping the debugger when a NaN floating point number is produced without a code change -

i read this , this . quintessence 1 can throw sigfpe if nan produced including fenv.h , enabling floating point exceptions fe_inexact feenableexcept(fe_all_except & ~fe_inexact); thus, code changes form int main () { double dirty = 0.0; double nanvalue = 0.0/dirty; return 0; } to #include <fenv.h> int main () { feenableexcept(fe_all_except & ~fe_inexact); // enable floating point exceptions fe_inexact double dirty = 0.0; double nanvalue = 0.0/dirty; return 0; } this works fine, have change code. have problem, in huge c , c++ code base, somewhere nan produced , don't know where. not option apply above change hunderts of files , track error. is there way enable floating point exceptions, without code change? there compile option not aware of? we use intel icc version 15.0.3 compiler. no matter how many files code spans, need add feenableexcept(fe_all_except & ~fe_inexact) once only, @ first line of

ios - PHP script execution in Firebase? -

here's scenario: have 10 ios apps subscription in app purchases. need 1 subscription purchase valid accross 10 apps. require server-side receipt validation. flow this: when customer pays subscription, receipt sent firebase db , there, require php script takes in receipt data . input , sends 'post' request app store. app store validate receipt , return json object back. overwrite old receipt latest copy. also, whenever user logs in of apps, repeat process , update receipt make sure subscription of user still valid. question is, firebase capable of dynamic script handling , http requests? thanks :) help. firebase hosting cannot execute php scripts. static hosting service (so serving uninterpreted html, javascript, css, etc). recently firebase added ability connect cloud functions firebase hosting . still doesn't allow run php code on firebase hosting.

Kibana Sentinel Watchers query -

Image
kibana sentinel watchers send mail when marked location reaches 20% in picture. { "title": "watcher_title", "disable": false, "report": false, "trigger": { "schedule": { "later": "every 5 minutes" } }, "input": { "search": { "request": { "index": [], "body": { ??? } } } },

multithreading - Queue Python threading (Segmentation fault: 11) -

i have queue set this. want run through items in db query , pass them downloader class. db connection keeps going away , program dies because think many threads open? i error: segmentation fault: 11 there 100k+ items. how can fix process few items @ time , speed process? class downloader(threading.thread): """threaded file downloader""" def __init__(self, queue, db): threading.thread.__init__(self) self.queue = queue self.db = db def remove_unicode(self, title): try: return unicodedata.normalize('nfkd', title).encode('ascii','ignore') except: return title def run(self): while true: # gets url queue row = self.queue.get() title = row[0] etc... def main(urls): queue = queue.queue() # create thread pool , give them queue in range(5): t = downloader(queue, d

ruby on rails - Download a zip file from eBay using rest-client -

i want download zip file ebay. using downloadfile api. response = restclient.post(url,xml,headers) this call return content of zip file not exractable in xml think. want download zip file ebay. my code is: headers = { "x-ebay-soa-operation-name"=>"downloadfile", "x-ebay-soa-security-token" => access_token_lister, "x-ebay-api-siteid"=>"0", "content-type"=>"application/zip" } url = 'https://storage.ebay.com/filetransferservice' xml = '<?xml version="1.0" encoding="utf-8"?> <downloadfilerequest xmlns="ebay.com/marketplace/services">; <filereferenceid>6637191637</filereferenceid> <taskreferenceid>6474385857</taskreferenceid> </downloadfilerequest>' the documentation api used above can found here : http://developer.ebay.com/devzone/file-transfer/callref/downloadfile.html you have pass content

how to fix not upating version in liferay? -

i using liferay framwork, message showing "not updating demo *** because version 6.2.5 newer version 6.2.0.1" when try deploy.plz me.how fix , update version? you have add line: module-version=6.2.0.5 under module-incremental-version=1 in liferay-plugin-package.properties file. , work. thing bothered me long time too, looked source code , works charm. can experiment module-version number. example liferay-plugin-package.properties : name=demo module-group-id=liferay module-incremental-version=1 module-version=6.2.0.5 tags= short-description= long-description= change-log= page-url=http://www.liferay.com author=liferay, inc. licenses=lgpl liferay-versions=6.2.0+ portal-dependency-jars=\ groovy.jar,\ asm.jar,\ antlr3-runtime.jar,\ antlr2.jar,\ antlr3.jar

php - Pre-populating a multi stage form -

i have form split on 4 separate screens, user presented screen 1, fill out fields , click continue, presented screen 2, fill out fields , click continue, etc.. when fill out whole form, details have entered written mysql database. they allowed go through form @ time , change details....this have question. when navigate screen 1, read previous details database , pre-fill form values. so far, good. when click continue, form submitted , load screen 2. @ point, have read database again values entered on screen 2. i should mention here i'm using mvc pattern each screen separate request. being able split each screen in separate request keeps html , controller logic nice , clean, i'm starting wonder if it's best way create multi stage form! what best way handle need retrieve data @ each screen? thing can think of read data @ screen 1, , store in session variable, gaining doing that? should bothered having keep re-reading same data? it's not going massive pe

How to parse google map api in iOS -

i have college assignment parse google map api data , find value of lat , lng i.e latitude , longitude. url :- https://maps.googleapis.com/maps/api/directions/json?origin=chicago,il&destination=los+angeles,ca&waypoints=joplin,mo|oklahoma+city,ok&key=your_api_key your_api_key :- aizasyaalniia3sux9qwahmku6bbwg5fxd7zrpu

Haskell :: The Use of Brackets in Recursion -

i'm wondering, recursion example: squaresrec :: [double] -> [double] squaresrec [] = [] squaresrec (x:xs) = x*x : squaresrec xs why on recursive case, there no bracket? shouldn't suppose this: squaresrec :: [double] -> [double] squaresrec [] = [] squaresrec [x:xs] = x*x : squaresrec xs i know not work. wondering explanation behind it. [] matches empty list. [1] matches list containing 1 element, , must number equal one. note [1] syntactic sugar (1:[]) , i.e. matches is: list beginning number 1 , followed list empty... complicated way of saying “a list containing single element 1 ”. (x:xs) matches list begins x , followed xs (and may contain number of elements, possibly zero). i.e. pattern matches list at least 1 element. [x:xs] matches again list contains exactly 1 element, , element should match pattern (x:xs) . (which doesn't make sense type-wise, because lists contain double -num