Posts

Showing posts from January, 2011

Java Errors in Android App -

i'm trying to implement addproximityalert when info window clicked googlemap.setoninfowindowclicklistener( new oninfowindowclicklistener(){ public void oninfowindowclick(marker marker) { public void addproximityalert(double latitude, double longitude){ latlng clickedmarkerlatlng = marker.getposition(); double lat = clickedmarkerlatlng.latitude; double long1 = clickedmarkerlatlng.longitude; log.e("hello", "output=" + lat + long1); locationmanager lm; // double lat=123,long1=34; //defining latitude & longitude float radius=30; //defining radius intent intent = new intent(prox_alert_intent); pendingintent proximityintent = pendingintent.getbroadcast(this, 0, intent, 0); locationmanager.addproximityalert( lat, // latitud

javascript - Embed only used scripts and styles in HTML file -

does know of tool can @ webpage styles , scripts , images, , create html file has styles , scripts , images embedded, only ones used page? i have typical "this site offline maintenance" page, entire website in own right, based on bootstrap 3. want reduce whole website single file images, css , js required display page. update using typical browser save file functionality not achieve want, firstly not embed css/js resources in page, saves them in subfolder , references them there; , secondly, not appear strip out styles , scripts not directly referenced page, rather saving files in entirety. i believe snappysnippet help. extracts html & css element , sends e.g. jsfiddle review. you'd extract html element, should work. regrettably, doesn't js, maintenance page should work fine. some details creator on so , here on youtube .

c# - Is there any way to share code between UWP apps and WPF apps? -

to clear, follow mvvm pattern, , want structure project such can share model code between uwp app , standard wpf app. code want share has no ui. don't relish thought of finding new tools replace ones i've been using years take care of tasks logging, connecting document oriented database, etc. i attempted start writing uwp wrapper around code have , reference model project directly. visual studio refused let happen, showing me error message says "unable add reference project 'ack.model'". same thing happened when attempted put model in universal library , reference wpf app. i'm not trying share wpf code. model layer has no reference ui libraries. this scary proposition, because means if want substantial have choose either jump 100% uwp or stay 100% wpf. newtonsoft.json might have universal distribution (asp.net mvc), elasticsearch.net, , other tools needed make important apps? i found "portable class library" project type hiding

jquery - Random Pick from Array without duplicate -

i need pick element array 10 different times without picking duplicates in process: function raffle(){ question_pool = array(a,b,c,d,e,f,g,h,i,j,k,l,m); question = question_pool[math.floor(math.random()*question_pool.length)]; } this function raflle(), when execute it, may result twice. here approach: question_pool = array(a,b,c,d,e,f,g,h,i,j,k,l,m); maximum = 10; minimum = 0; question_stack = math.floor(math.random() * question_pool.length - minimum); minimum = math.min(minimum + 1, maximum); question = question_pool.splice(question_stack,1); question_pool.push(question); use splice remove selected questions question pool. once questions have been drawn continue. var question_pool = array("a","b","c","d","e","f","g","h","i","j","k","l","m"); do{ var id = math.floor(math.random() * question_pool.length);; var question = quest

Can one make Shopify payment gateway module using Shopify API -

can 1 create payment module using shopify api https://docs.shopify.com/api ? can "shopify app" payment gateway module? i understand shopify develop , host payment gateway module themself, seems 1 create own module? but these hosted modules shopify not updated. so why can't third party payment gateway provider can create own payment module shopify app. possible using shopify api? i think answer question question. if coded working payment gateway not supported shopify, using active merchant (which supported), shopify accept it, , thereafter merchants able choose it? that tough one. can try! might succeed even. working gateways in shopify did not there exclusively shopify.

ruby on rails - Searching multiple models with pg_search -

i trying implement full text search in rails app. using postgresql database, therefore, using postgresql's full text search capabilities. have 2 models users , scoreboards , want search through both models against specific columns pull out records. i using pg_search gem full text search, read multisearch documentation , implemented successfully. have created pg_search_documents table. code given below. scoreboard model include pgsearch multisearchable :against => [:name_of_organization, :name_of_activity, :name_of_scoreboard] user model include pgsearch multisearchable :against => :name controller code def index @pg_search_documents = pgsearch.multisearch(params[:search]) end the search works when run code <%= pg_search.searchable %> in view. returns both user , scoreboard objects when each 1 of them searched. view code <% @pg_search_documents.each |pg_search| %> <%= pg_search.searchable.name %> <%= pg_se

python - Django Model Subclass - no fields declared in subclass creating indentation error -

class value_list: name = models.charfield(max_length=50) description = models.textfield(max_length=140) class meta: abstract = true class meter(value_list): class contributionrole(value_list): class attributioncertainty(value_list): the subclasses don't need own fields declared (value_list option lists of various sorts). this causing indentation error @ class meter(value_list) , because there no indented block beneath it. like shmee said, need "pass" avoid indentation error class meter(value_list): pass

java - does it make sense to serialize and object -

i trying store data in mysql. columns 'ingredients' of type varchar, 'recipe' of type text , 'menu_id' of type tinyint. 'ingredients' , 'recipe' should viewed , adjusted , saved jtextarea. each object reference have different menu_id used call methods on. methods readcard(int menu_id) or public void adjustcard(){ try{ string sset; sset= "update eatingcard " + "set menu_id = '"+ this.menu_id + "'," + "ingredients='" + this.ingredients + "'," + "recipe='" + this.recipe+ "' "+ "where eatingcard.menu_id = " + this.menu_id; }catch{ statement.executeupdate(sset); }catch(exception e){ e.printstacktrace(); system.out.println("did not update"); } does make sense serialize object, if want change it's ingredients , recipe

vba - Getting My Script To Run Across All Worksheets (Excel) -

this code works on 1 sheet and trying work across multiple sheets, avoiding first 2 sheets ("aa" , "word frequency") . original code here (see @jeeped's answer) link worksheet here was trying adapt code related threads found (reference 1 , 2 ) not know how (and whether) apply ws.name , ws.range objects existing code. it seems code activates sheet1 using with worksheets("sheet1") , trying replace following method: create for looped function bygroupcounter() identify how many worksheets there are, , run across existing worksheets. each worksheet incremented variable "i" for loop in bygroupcounter() calls on function bygroup(i) run original code on selected worksheet (ie. worksheet " i ") the bygroup() function runs it's process across worksheet i . part believe i'm getting error: replacing with worksheets("sheet1") code with ws , ws = worksheets(sheet_index) , sheet_index equal i , def

Information about MySQL Cron jobs -

i've 1 small question cron job, have insert data plain text in here? mysql --user=[myuser] --password=[mypassword] --database=[mydbname] --execute="query here" i've seen 1 topic saying not put password plaintext in there use -ppassword. i'm not sure how not plaintext if going put password after -p anyway? information appreciated :) in advance

java - StackOverflow Error when running -

my code compiles when run it, weird error message pops up. the error message says "java.lang.stackoverflowerror:null(in sun.awt.win32graphicsconfig). what it's supposed print out panel 4x10 of button array button list stored info far. buttons don't right that's fine because care actual graphic now. there class goes array list can put in comments if needed. here code: import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.scanner; import java.util.arraylist; import java.util.*; import java.io.file; import java.io.printwriter; public class culminatingprojectgui extends jframe implements actionlistener { private static jbutton[][] jbtnumbuttons = new jbutton[10][4]; private static jbutton jbtlist = new jbutton("list"); arraylist<culminating> seats = new arraylist<culminating>(); public culminatingprojectgui() { //construct jfame object container other objects jframe frame = ne

ios - How to check a framework contains full bitcode? -

from xcode7, framework built app should have bitcode if want enable bitcode support app. i'd know way check whether framework project has bitcode or not. there similar question here ( how check if framework bitcode supported xcode7 ), answers there checking bitcode of static libary file of .a or .o extention. i want check existence of bitcode inside .framework package, , have been wondering there should way check on .swiftmodule files inside .framework package. (one of reasons want know i'm trying support bitcode in own framework project, have never succeeded in doing since got missing-bitcode error when exported framework package app project , built app. thought it's nice have tool check directly rather knowing after embedding app project , building app.) otool -l binary_name | grep __bitcode you see 1 or more segname __bitcode entries if have bitcode or empty output if not.

java - How to set jvm heap size in shell script -

in korn shell script have this. #!/bin/ksh . /xxxxxx/classpath.sh export javahome=/usr/java5 export path=$javahome/bin:$path export path export classpath export _java_options="-xmx1g" java ....... getting below error. tried java options above. but, still getting same error?? please need this. thanks. jvmdump006i processing dump event "systhrow", detail "java/lang/outofmemoryerror" - please wait. jvmdump032i jvm requested snap dump using '......trc' in response event keep variable jvm_args , prog_args , place vm_args , prog_args @ appropriate positions below java <jvm_args> com.test.main <prog_args> example:- export classpath=${classpath}:${config_dir}; jvm_args="-dprocess.name=mainprocess -xmx1024m -xms256m " prog_args="/home/saravana/files" $java_home/bin/java $jvm_args com.test.main $prog_args add dependent lib in classpath variable, add jvm_args starting & max heap, process n

html - Bootstrap nav pills active class bug when scrolling with jQuery -

Image
when scroll section of webpage, specific nav pill section light up, shown: it works expected when scroll home , resume. however, when click on, let's resume, , scroll - observe happens when scroll down contact: now both resume , contact highlighted. when take piece of code away, works expected. first part smooth transition scrolling (when clicked), , second part scrolling, both written in jquery. //smooth transition scroll when nav pill clicked //when take code out, works fine var anchor = $('html, body'); $('a').click(function(){ $(anchor).animate({ scrolltop: $($(this).attr('href')).offset().top }, 500); return false; }); //change active class when scrolling $(window).scroll(function() { var position = $(document).scrolltop(); if (position <= home.top) { $('.home-class').removeclass('active'); $('.resume-class').removeclass('active'); $('.contact-clas

shell - How can I compile all files in all subdirectories using find? -

i have lots of c++ programs unrelated each other , each 1 being in 1 file. directory structure looks this: dir1 program1.cpp program1.h program2.cpp program2.h dir2 program3.cpp program3.h program4.cpp program4.h dir3 program5.cpp program5.h program6.cpp program6.h .. i'm trying come shell script compile them , give executables different names. have been trying find so: find . -type f -name *.cpp -exec g++ -llibname '{}' \; this compiles files produces a.out each file end 1 executable in end. how can strip file extension , give executable name? (e.g. program1.cpp need g++ program1.cpp -o program1 ) you this: find . -type f -name '*.cpp' -exec sh -c 'g++ {} -o $(basename {} .cpp)' \; this put executables in directory launch command from. if you'd rather keep them in same directory source files, should it: find . -type f -name '*.cpp' -exec sh -c 'g++ {} -o $(dirname

c++ - Toggling a QPushButton -

i have simple gui: a qpushbutton, when clicked, number (say 11) shall shown (i use qlcdnumber this). when clicked again number shall shown (say 10). my aim use qabstractbutton::toggled ( bool checked ) feature this. as learned, proper signal-slot-connection this: connect(ui.startstopbutton, signal(toggled(bool)), thread, slot(start())); (i additionally use threads they're not problem) my question: how can differ between "the button toggled" (checked = true) , "the button not toggled" (ckecked = false) in signal-slot-statement? i used variations signal(toggled(bool = true)) , signal(toggled(bool checked = true)) or signal(toggled(true)) neither working. allways debugger message: object::connect: no such signal qpushbutton::toggled(bool = true) in testthread.cpp:15 object::connect: (sender name: 'startstopbutton') i have enabled setcheckable of button. the signal toggled(bool) , receiving end has bool parameter too:

servletcontextlistener - Get servlet init params in servlet context listener -

<listener> <listener-class>config</listener-class> </listener> <servlet> <servlet-name>processreg</servlet-name> <servlet-class>processreg</servlet-class> <init-param> <param-name>text</param-name> <param-value>helloworld1</param-value> </init-param> public class config implements servletcontextlistener { @override public void contextinitialized(servletcontextevent event) { servletcontext servletcontext = event.getservletcontext(); string text1 = servletcontext.getinitparameter("text"); in method contextinitialized(servletcontextevent event) , if there 2 servlets , example , let's name of second servlet servlet2 , let's has has init - param called text value helloworld2 . how listener know take processreg servlet ? how param servlet2 ?? you need distinguish between servlet initialization parameters , context initia

visual studio - c# ClickOnce test if updating my application works local -

i finished c# application , i'am able publish it, problem want test update function local, 1 problem: can't give in folder path , can't update folder on local pc. need upload application server(website), there way test if update function working local on pc? or can give me link tutorial testing local? thanks!

javascript - How to transfer data from one page to another using angular js and Java servlets -

i have created 1 login page in angular js , written servlet login action. trying login username , password. able redirect dashboard page after successful login using $window want show user data on page. how in angularjs , servlets? use httpservletrequest remote user. in dashboard controller, fetch remote user via ajax (for example). , set fetched user $rootscope. as dashboard page loads, first ajax call should fetch user , set fetched user $rootscope.

r - Sending Rstudio view() content to different pane -

using rstudio, attempting display dataframe using view() command. command automatically sends output 'source' quadrant. is there way send instead either "workspace" quandrant or "files,plots..." quadrant? here code: qrows <- data.frame( rowquery = character(0), "backtest p&l" = character(0), stringsasfactors=false) qrows[nrow(qrows) + 1, ] <- c("@sp500(vwpc) | rsi(30) | qcume", "12%") view(qrows) to display data frame in "files,plots..." quadrant (viewer) use dt package: if (!require("dt")) devtools::install_github("rstudio/dt") datatable(qrows) all commands open in separate window: new window can edit data; whet open can't code in console , run code code editor; after closing window info table displayed console edit(qrows) like in point 1, without displaying info console after closing window invisible(edit(qrows)) or data.entry(qrows)

Convert this for loop to an apply function R -

i have vector of data such following: data <- c(1, 3, 4, 7) and apply function every pair of elements in vector such return upper triangle matrix following does: mat <- matrix(data = na, nrow = length(data), ncol = length(data)) (i in 1:(length(data) - 1)) { (j in (i+1):length(data)) { mat[i, j] <- "-"(data[j], data[i]) } } but apply type function instead of loop. i unsure how so. suggestions? thanks! we can use combn mat[lower.tri(mat, diag=false)] <- combn(data, 2, fun= function(x) x[2]-x[1]) t(mat) # [,1] [,2] [,3] [,4] #[1,] na 2 3 6 #[2,] na na 1 4 #[3,] na na na 3 #[4,] na na na na data mat <- matrix(data = na, nrow = length(data), ncol = length(data))

How this line is executed in java? -

i trying compare character ascii values using bellow code.it works fine have doubt.how bellow line executed. didn't convert s.charat(i) int how compared ascii value. code 1: if(s.charat(i)>='a' && s.charat(i)<='z'){ } code 2: if((int)s.charat(i)>='a' && (int)s.charat(i)<='z'){ } in above 2 codes working same.i need know difference between code1 , code2. can 1 me know this? the comparison operators work on numerical operands -- or, more specifically, on operands can converted numerical operands ( jls 15.20.1 ). in "code 1" example, 4 chars (two s.charat(i) , , 2 literals) automatically promoted int purposes of comparison. the first step of comparison use "binary numeric conversion" both operands of same type ( jls 5.6.2 ). basically, they're widened narrowest type can accommodate both types, in case of char int . once that's done, it's straightforward, signed compari

c# - How to run SelectCommand in <asp:SqlDataSource> tag -

i making querystring parameter ,so have 2 .aspx forms. 1 form default.aspx contains 3 fields sid, firstname, lastname. when submit values, values saved in database.now want show data on grid particular sid on default2.aspx . grid takes data through sqldatasource.so want call sqldatasource on button click , grid should show data particular sid on default2.aspx . default.aspx : <body> <form id="form1" runat="server"> <div> </div> <table cellpadding="2" cellspacing="5"> <tr> <td> <asp:label id="lblid" runat="server" text="sid"></asp:label> </td> <td> <asp:textbox id="tbid" runat="server"></asp:textbox> </td> </tr> <tr> <td> <asp:label id="lblname" runat="server" text="

java - Simple guessing game. "Your first guess is...." -

i creating simple guessing game 3 tries, need adding code can display "first guess" followed integer user puts in, "second guess", etc... have "enter guess" first try. need do? i'm confused on how go doing this. sorry if question confusing. import java.util.scanner; public class guess { public static void main(string[] args) { int randomn = (int) (math.random() * 10) + 1; scanner input = new scanner(system.in); int guess; system.out.println("enter number between 1 , 10."); system.out.println(); int attempts = 0; { attempts++; system.out.print("enter guess: "); guess = input.nextint(); if (guess == randomn) { system.out.println("you won!"); } else if (guess < 1 || guess > 10) { system.out.println("out of range"); attempts = +1; } else if (guess > randomn) { system.out.pr

xml - which soap Api is used to make reservation for multiple passenger in Sabre -

i using sabre soap api, response bargain max finder soap. now want make reservation number of searched passengers. soap api used make reservation multiple passenger in sabre. secondly there soap api pass passenger information in request. you can use combination of 2 apis in order book air itinerary , submit passenger information, complete pnr: enhancedairbook: https://developer.sabre.com/docs/read/soap_apis/air/book/orchestrated_air_booking passengerdetails: https://developer.sabre.com/docs/read/soap_apis/management/itinerary/passenger_details

java - After making actionbar smaller, navigation drawer toggle doesn't work -

i had action bar toggle worked, reason every time changed color of action bar, color of entire page changed. figured out because action bar taking entire screen. made fixes (moved action bar larger linear layout instead of keeping in drawer layout itself), since taking care of that, toggle no longer works, , related, when drag navigation drawer out, hangs second, , have pull there. in advance help. mainactivity.java package me.paxana.alerta; import android.app.activity; import android.graphics.color; import android.support.v4.app.fragmentactivity; import android.support.v4.app.fragmenttransaction; import android.support.v4.app.fragmentmanager; import android.support.v7.app.actionbar; import android.support.v7.app.actionbardrawertoggle; import android.app.fragment; import android.content.intent; import android.support.v4.widget.drawerlayout; import android.support.v7.app.actionbaractivity; import android.support.v7.app.appcompatactivity; import android.os.bundle; import andr

sql server - SQL query when result is empty -

i have table this user itemnumber datebought (yyyymmdd) 1 20160101 b 2 20160202 c 3 20160903 d 4 20160101 now have show total number of items bought each user after date 20160202 (2 february 2016) i used select user, count(itemnumber)<br/> table<br/> datebought >= 20160202<br/> group user<br> it gives me results b 1 c 1 but want this a 0 b 1 c 1 d 0 please tell me quick method / efficient method ? try this, declare @table table ( [user] varchar(1), itemnumber int, datebought date ) insert @table values ('a',1,'20160101'), ('b',2,'20160202'), ('b',2,'20160202'), ('b',2,'20160202'), ('c',3,'20160903'), ('d',4,'20160101') select * @table select [user], sum(case

java - SHA-1 key generation ... Access Denied -

Image
i having problems generating sha-1 key needed register google api... closest have come to, entering: keytool -list -v -keystore "c:\users\rakeeb\.android\debug.keystore".keystore -storepass android -keypass android which gives error of access denied other formats lead error invalid format. easiest ways ever: update added android studio v 2.2 in last step there 2 ways this. 1. faster way : open android studio open project click on gradle (from right side panel, see gradle bar ) click on refresh (click on refresh gradle bar , see list gradle scripts of project) click on project (your project name form list (root)) click on tasks click on android double click on signingreport (you sha1 , md5 in run bar ) select app module module selection dropdown run or debug application check screenshot below: 2. work google maps activity : open android studio open project click on file menu -> select new -> click on google -> s

How do I add image to drawable in android studio? -

i want add button icon in drawable resource folder. tried add png icon image asset when choose action bar , tab icon asset type dropdown list find image not clear , if returned luncher icon option image becomes clear. there has solution? action bar , tab icon (option) luncher icon (option) but when choose action bar , tab icon asset type dropdown list find image not clear , if returned luncher icon option image becomes clear. as clear, can use launcher icon choosing application launcher.which means, can use default color mean, available launcher icon only. and since using action bar , tab icon options can used 2 colors.like dark theme , white. the best option use button is, goto imageasset -> launcher icon -> check clipart enabled , can use image colors want. or can use: android drawable importer

How do I create url preview in android? -

Image
this question has answer here: preview url in android, way facebook before post link (link preview) [closed] 1 answer i want show preview of url in android when share (like shown in facebook or whatsapp). preview must contain image webpage , small description of link. thought of picking information metadata , favicon, favicon small in size , metadata not present (for example, in quora u don't information question in metadata). sorry bad english , lack of clearity. checkout android link preview library same seeking for. you can import library using gradle : simply add repository build.gradle file: repositories { jcenter() maven { url 'https://github.com/leonardocardoso/mvn-repo/raw/master/maven-deploy' } } and can use artifacts this: dependencies { compile 'org.jsoup:jsoup:1.8.3' // required compile 'com.l

get unique values as well as the empty string in excel vba -

how can modify code give empty strings in range sub getuniqueandcount() dim d object, c range, k, tmp string set d = createobject("scripting.dictionary") each c in selection tmp = trim(c.value) if len(tmp) > 0 d(tmp) = d(tmp) + 1 next c each k in d.keys debug.print k, d(k) next k end sub just remove test length of tmp , should it: sub getuniqueandcount() dim d object, c range, k, tmp string set d = createobject("scripting.dictionary") each c in selection tmp = trim(c.value) d(tmp) = d(tmp) + 1 next c each k in d.keys debug.print k, d(k) next k end sub

javascript - How to check for an empty Telerik Kendo editor content -

i have simple form couple of dropdowns multi-select , editor. dropdowns both have initial item has text value of please select , value of ''. on submission have following bit of javascript/jquery checks have values in dropdowns, multi-select , editor. var validflag = true; var dropdownlist = $("#addnew_dteam").data("kendodropdownlist"); if (dropdownlist.value() == "") { validflag = false; errormsg = "<li>select team</li>" } dropdownlist = $("#addnew_dtype").data("kendodropdownlist"); if (dropdownlist.value() == "") { validflag = false; errormsg += "<li>select entry type</li>" } var multiselect = $("#msservers").data("kendomultiselect"); if (multiselect.value() == "") { validflag = false; errormsg += "<li>add @ least 1 server or select n/a</l

install chrome extension outside the chrome extension market -

as know can install extension outside market without expected limitations, example, autoupdate. need in develop mode. you can read thread understand problem: install chrome extension external extensions the think is, know way install extension in chrome (internal use in company o class). think can sign extension shared certificate or that. , send extension users. google no longer allows it. protecting chrome users malicious extensions continuing protect chrome users malicious extensions there 4 types of extension install still available: direct installation webstore or inline install website, hosted on web store. indirect installation through registry manipulation (e.g. companion extension native app), still must hosted in webstore. local development installs; nag on every chrome restart , no autoupdate mechanism. for enterprise only, policy-based installs . note on windows requires computers joined domain. in case there no restrictions on extension hosted

python - Using einsum without explicit replication -

i have matrix of shape (n, n) , matrix b of shape (p, n). need matrix c such c[i] = (a * b[i, np.newaxis, :]) * b[i, :, np.newaxis] i'm doing doing np.matlib.repmat(a) , using np.einsum follows a1 = np.matlib.repmat(a, p, 1).reshape(p, n, n) c = np.einsum('ijk, ij..., ik... -> ijk', a1, b, b) but can see creating a1 waste of resources it's using same values on , over. there anyway can without creating intermediate matrix a1? use np.einsum - np.einsum('ij,kij,kij->kij',a,b[:,none,:],b[...,none])

xslt - Function that can be use to omit duplicate value on a string -

i ask if there function can use to remove duplicate value inside string separated | simplest possible way. have below example of string 1111-1|1111-1|1111-3|1111-4|1111-5|1111-3 the output i'm expecting is: 1111-1|1111-3|1111-4|1111-5 thanks in advance. all presented xslt 1.0 solutions far produce wrong result : 1111-1|1111-4|1111-5|1111-3 whereas wanted, correct result is : 1111-1|1111-3|1111-4|1111-5 now, following transformation (no extensions, pure xslt 1.0): <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="text"/> <xsl:template match="text()" name="distinctsubstrings"> <xsl:param name="ptext" select="."/> <xsl:param name="poutdelim"/> <xsl:param name="pfounddistinctsubs" select="'|'"/> <xsl:param name="pcountdistinct" s

javascript - Making a scrollable tooltip in d3 pie chart -

i using d3pie d3.js. when hover on pie see tooltip data rest of data cut off/ hidden because data way long. i want show scrollable list of gateways when clicked on pie tooltip. here code. var pie = new d3pie("gateway-datasources-status-chart", { size: { canvasheight: 300, canvaswidth: 300 }, data: { content: [ { label: "online", value: online_gateway, lists: online_gateway_datasources }, { label: "offline", value: offline_gateway, lists: offline_gateway_datasources } ] }, "tooltips": { "enabled": true, "type": "placeholder", "string": "{label}: {lists}", "styles": { "backgroundcolor": "#040404", "borderradius": 5 } }, callb

json - 50053 incomplete dimension binding -

hello guys have problem displaying pie chart, when try add more data pie chart error occurs, need expertise on matter this controller code. , here link error image oninit: function() { this._setupselectionlist(); // 2.create json model , set data var omodel = new sap.ui.model.json.jsonmodel("http://lssinh000.sin3.sap.corp:8000/sap_le/lionexpress/volunteer/services/request.xsjs"); var ovizframe = this.getview().byid("idpiechart"); // 3. create viz dataset feed data graph var odataset = new sap.viz.ui5.data.flatteneddataset({ dimensions : [{ name : 'status', value : "{status}", name : 'startdate', value : '{startdate}' }], measures : [{ name : 'reqid', va

Python struct.unpack equivalent in C -

what have in python string lenght = 4 , can unpack values. is there equivalent of function on python, in c? in c, there no concept of "packing" this. whenever have char buffer such char buf[128]; whether treat string or complex data structure you. simplest way define struct , copy data , forth array. struct mystruct{ int data1; int data2; }; char buf[sizeof(struct mystruct)]; struct mystruct mystruct; mystruct.data1 = 1; mystruct.data2 = 2; memcpy(buf, &mystruct, sizeof(struct mystruct)); please note there packing/padding may happen here. example, if have short in struct, compiler may use 4 bytes anyway. fails when have use pointers, such char* strings in structure.

Changing Android packagename in AndroidManifest.xml without actually changing folder package paths -

i have template app can reskinned changing config params according client's brand. when comes publishing on google play, need change packagename on androidmanifest.xml . my question is: possible without changing folder names, don't need mess whole project structure? it's totally possible. in androidmanifest.xml should change package name according need, activities , services should target full path of classes. for instance if application package name should com.mybrand.myapp , old java package name com.myoldbrand.myoldapp manifest should : <application android:allowbackup="true" android:icon="@mipmap/common_app_icon" android:label="@string/common_app_name" android:supportsrtl="true"> <activity android:name="com.myoldbrand.myoldapp.myactivity"> <intent-filter> <action android:name="android.intent.action.main" />

Offline Install of R on RedHat -

i trying install r on redhat server no connectivity internet. (sigh) initially, tried r meta package epel ( http://fedoraproject.org/wiki/epel ). due dependency requirements, downloaded dependancies rcore ,librmath, etc... each time prompts dependency, download, transfer , install. takes time , manual effort. is there cleaner way manual download, transfer , install of every single dependency? note: server has no internet connection, yam not helpful. have thought of compiling r source? that, , relatively painless. the thing when ./configure step should list of librarires need before issue make. it might less of hazzle redhat install doing.

c# - VS2015 don't kill IIS process when debug is stopped -

after migration vs2013(ultimate) vs2015(enterprise) have problem while debugging. when stop debug, change code , run again message " unable copy *.dll". becouse iis express process still working, have kill process , can rerun code. annoying. how can force vs2015 kill iss process when want stop debugging? try uncheck option tools>options>debugging->edit , continue , check option tools>options>intellitrace>general>enable intellitrace , select intellitrace events only option

django model on_delete pass self to models.SET() -

for example, have book model, each book has author , tag. def get_authors_first_tag(book): try: tag = book.author.tags.first() except: return none else: return tag.id class author(models.model): name = models.charfield(max_length=50) tags = models.manytomanyfield('tag') class book(models.model): name = models.charfield(max_length=50) author = models.foreignkey(author) tag = models.foreignkey('tag', null=true, on_delete=models.set(get_authors_first_tag)) i want, when deleting tag item, book's tag set author's first tag. how this? thanks. doc page - https://docs.djangoproject.com/en/1.9/ref/models/fields/#django.db.models.set update. signals didn't help from django.db.models.signals import post_delete django.dispatch import receiver class book(models.model): # temporaryly set null on delete, # becouse neds cannot use default behavior (models.cascade) tag = models.foreignkey('tag'

ansible - Include multiple classes from other files in Python-scripts used by playbooks -

rookie here when comes ansible. writing python scripts executed playbooks. found on ansibles documentation pages: "modules must self-contained in 1 file auto-transferred ansible." does mean can't include libraries , have use 1 file only? generates awful lot of redundancy, know if there workaround.

swift - Fail to imply _Reflectable protocol -

i reading mirrortype @ nshipster,and trying adopt it's code swift 2.1. works fine until when tried custom _mirrortype with : extension wwdcsession : _reflectable { func _getmirror() -> _mirrortype { return wwdcsessionmirror(self) } } an error occured : error: playground execution aborted: execution interrupted, reason: exc_bad_access (code=2, address=0x7fff58273e87). and found out it's because init method in wwdcsessionmirror being called infinite times. struct wwdcsessionmirror: _mirrortype { private let _value: wwdcsession init(_ value: wwdcsession) { _value = value } var value: { return _value } var valuetype: any.type { return wwdcsession.self } var objectidentifier: objectidentifier? { return nil } var disposition: _mirrordisposition { return .struct } var count: int { return 4 } subscript(index: int) -> (string, _mirrortype) { switch index { case 0: return ("number", _reflect(_value.number))

javascript - Template.destroyed() not called -

i'm displaying timer showing elapsed time since collection item created. however, when navigate between items (switch routes/url) timer doesn't destroyed , end having bunch of leaked timers. i keep reference timer , kill in router prefer cleaner way , handle in template. ideas? <template name="itemdetails"> {{elapsedtime}} </template> template.itemdetails.onrendered = function() { var starttime = template.currentdata().starttime; this.timeelapsed = new reactivevar; this.tasktimer = meteor.setinterval(function() { var timeelapsedinms = date.now() - starttime; var date = new date(timeelapsedinms); var hours = (date.getutchours() < 10 ? '0' :'') + date.getutchours(); var minutes = (date.getutcminutes() < 10 ? '0' :'') + date.getutcminutes(); var seconds = (date.getutcseconds() < 10 ? '0' :'') + date.getutcseconds(); var timee

parsing - How to check for duplicate records in .csv using java -

i have csv file: 10;name1;id1 20;name2;id2 10;name3;id3 row row push data method called forward: forward(nr, name, id); how can check whole csv if "nr" duplicate? in above example is: 10. my code now: while ((line = reader.readline()) != null) { scanner = new scanner(line); scanner.usedelimiter(";"); while (scanner.hasnext()) { string data = scanner.next(); if (index == 0) nr = integer.parseint(data); else if (index == 1) name = data; else if (index == 2) id = data; else system.out.println("invalid data::" + data); index++; } index = 0; forward(nr, name, id); } if duplicate found, want print on screen. use map<long, string> . each time before forward output can check if map contains key (the number) already. map<long, string> entrymap = new hashmap<long, string>(); [...] if (!entrymap.c

javascript - Keep waiting for loop increment until not getting function response -

i have loop , inside calling 1 function. before function response loop variable incremented 1. want wait until response has come, increment var 1. here code: for(var i=0;i<$scope.latitude.length;i++) { console.log("inside :",$scope.latitude[i]); console.log("i after for:" ,i); console.log("count before if:" ,count); if($scope.latitude[i]!=1) { console.log("inside if count :",count); console.log("i inside if:" ,i); var lat =$scope.latitude[i]; var lng=$scope.longitude[i]; console.log("lat going",lat); console.log("lng going",lng); $scope.getdistance(lat,lng).then(function(response,flag){ console.log("flag is"