Posts

Showing posts from May, 2014

How to track the GPS coordinates as user walks, from xamarin.forms for ios platform -

i went through link to track gps co-ordinates of current location user walks xamarin.forms app (ios platforms) but not find how it, born new xamarin.forms, can in xamarin.forms or should create xamarin ios project? any links/tutorials track user location through xamarin.forms ios platfomrs appreciated, in advance. we used xamarin-forms-labs this. works perfect xamarin.forms on platforms. for more information: geolocator

c - How to find memory leaks with Clang -

i have installed clang in machine (ubuntu) in order find memory leaks in c code. wrote sample code in order check working of follows: /* file: hello.c leak detection */ #include <stdio.h> #include <stdlib.h> void *x; int main() { x = malloc(2); x = 0; // memory leak return 0; } i found options in internet compile like $ scan-build clang --analyze hello.c and $ scan-build clang -fsanitize=address hello.c but none of them showing signs of memory leak. scan-build: using '/usr/bin/clang' static analysis scan-build: removing directory '/tmp/scan-build-2015-07-02-122717-16928-1' because contains no reports. scan-build: no bugs found. can kindly tell how correctly use clang memory leak detection. interestingly, clang static analyzer finds memory leak if declare void *x inside main : int main() { void *x = malloc(2); x = 0; // memory leak return 0; } analyzing code running: scan-build clang -g hello.c giv

javascript - Hidden Field Value Not Getting Filled JQuery -

i have html table append using jquery follows fires on button click $("#listadd").click(function() { if (validatelistadd()) { var mcode = $("#mcodehidden").val(); if(checkitemduplicates(mcode)) { var mname = $("#mnamehidden").val(); var sellprice = $("#sellprice").val(); var cost = $("#cost").val(); var qty = $("#qty").val(); var remark = $("#remark").val(); var subtotal = sellprice * qty; alert(qty); $("#productlist tbody").append('<tr class="sumrow"><td><input id="hdqty" type="hidden" name="tblqty[]" value="' + qty + '"><input id="hdsubtotal" type="hidden" name="tblsubtotal[]" value="' + subtotal + '"><input type="hidden" name="tb

travis ci - Why could curl and wget timeout every now and then -

every , (<5%) travis builds stall because wget calling php page times out. example: https://travis-ci.org/marcelstoer/nodemcu-custom-build/builds/69239694 using curl first several weeks tried wget because of issue. curl curl -m 60 url wget wget -qo- url &> /dev/null the server serves php page doesn't report errors , in apache access log request php page reported returning http 200. what further analyze?

sql - How to select values as a list in PostgreSQL and Oracle Database? -

i have table values given below: name app_pgm_apply status p1 ap p3 dn p5 ap b p2 pe b p3 ap c p1 ap d p2 dn i want select user applied program list. a {p1,p3,p5} b {p2,p3} c {p1} d {p2} can tell me how retrieve values list? i saw in sql here . didn't how use postgresql postgres has array_agg function: select name, array_agg(app_pgm_apply) mytable group name oracle, on other hand, has listagg function: select name, listagg(app_pgm_apply, ',') within group (order app_pgm_apply) mytable group name

java - Declare dependency to war file in Gradle -

based on gradle docs , define external jars means adding build.gradle following snippet (considering have {project_root}/libs/foo.jar) in place: dependencies { runtime files('libs/foo.jar') } however, using same dependency declaration *.war files doesn't work. possible? project i'm trying depend on builds war file. since war layout different jar file standard layout, it's not possible declare war dependency file java project. possible ideas: clone project , define dependency (very stupid idea, i'm ashamed suggest sth that) contact author , ask him/her if can copy class need use. if can copy class along credits. contact author , ask him/her if make sense make codec open source (i know right now) , release standalone jar library (maybe along other classes used in project).

sql server - search for a matching string using part of the string in SQL -

i current have 1 table whereby unique index of 'col_0' have same set of data 2 different indexes. problem copy function in application automatically cuts of description , adds "copied @ end". example col_0 description annoying application problem b annoy (copied column a) i wanted search , update b matches i've tried join part of description. so far i've tried charindex can't quite right. i read request thus: "copied column a)" means copied description of record col_0 = 'a'. , want update "copied .." descriptions original description. in order find "copied .." records using like. extract col_0 value string using string functions (mainly reverse + charindex find last occurrence of blank , substring extraction). update mytable upd set description = ( select description mytable orig orig.col_0 = substring(upd.description, len(upd.description) - char

asp.net mvc - Could not load file or assembly 'System.Net.Http.Primitives, Version=1.5.0.0 -

i developing web application uploading file on google drive. whenever execute connect method throw error. i have tried like. http://wordpress.kjetil-hartveit.com/2014/06/04/google-api-nightmare-how-i-fixed-the-could-not-load-file-or-assembly-system-net-http-primitives-version1-5-0-0-exception/ error showing in downloaded dll powershell cmdlet missing assembly google api but still nothing working. <!-- snippet web.config --> <dependentassembly> <assemblyidentity name="system.threading.tasks" publickeytoken="b03f5f7f11d50a3a" culture="neutral" /> <bindingredirect oldversion="0.0.0.0-2.6.9.0" newversion="2.6.9.0" /> </dependentassembly> <dependentassembly> <assemblyidentity name="system.net.http" publickeytoken="b03f5f7f11d50a3a" culture="neutral" /> <bindingredirect oldversion="0.0.0.0-2.2.22.0" newversion="2.2.22.0"

html - PHP MySQL Options using JOIN -

i have table... table: forums for_id for_name for_des for_mem 1 forum 1 description 1 mem1@email.com, mem2@email.com 2 forum 2 description 2 null 3 forum 3 description 3 mem1@email.com then have table: members mem_id mem_name mem_email ... 1 jane mem1@email.com 2 jack mem2@email.com 3 smith mem3@email.com i trying create html options list. multi select list display columns in members , select in forums when editing information. example: editing for_id = 1 should display users , select users in for_id=1 's for_mem currently using: <? $data = explode(',',$row[for_mem]); ?> <div class="col-md-9"> <select name="for_mem" id="" multiple class="form-control"> <?php foreach($data $key => $value){?> <option value="<?php echo $value; ?>"><?php echo $value;

node.js - How to write a post request test in mocha with data to test if response matches? -

question: how write post request test in mocha tests if response matches? the response url string redirect 3rd party service. working example payload: curl -h "content-type: application/json" -x post -d '{"participant":{"nuid":"98asdf988sdf89sdf89989sdf9898"}}' http://localhost:9000/api/members member.controller.js // post method // creates new member in db. exports.create = function(req, res) { member.findbyidandupdate(req.body.participant.nuid, { "$setoninsert": { "_id": req.body.participant.nuid } }, { "upsert": true }, function(err,doc) { if (err) throw err; res.send({ 'redirecturl': req.protocol + '://' + req.get('host') + '/registration/' + req.body.participant.nuid }) } ); }; expected res.send {"redirecturl":"http://localhost:9000/registration/98asdf988sdf89sdf89989sdf9898"}

azure - Can't login to Linux VM created by custom image -

i have created custom image of debian 7.0 following blog post: http://blogs.technet.com/b/dcaro/archive/2014/12/03/create-your-azure-image-with-debian-7-0.aspx in management portal vm status running. can't log vm using ssh. what's possible cause , how solve it? i intend create vm image of freebsd 8.3 in azure. 1 has tried before? maybe iptables setting , try disable iptables.

linux - How can i execute commands inside containers during host provision -

i using vagrant build docker host , have shell script install required packages host , script build , run containers vagrant file config.vm.provision :shell, :inline => "sudo /vagrant/bootstrap.sh" inside run containers like docker run -d . .bla bla .. . this works fine have ssh container , run make deploy install stuff. is there way can run make deploy within bootsrap.sh . the 1 way make entry point every run, i want when provision host command should run inside container , show me output vagarnt shows host use docker exec see doc http://docs.docker.com/reference/commandline/exec/ for example docker exec -it container_id make deploy or docker exec -it container_id bash and make deploy inside container

html - perl look_down tag index -

i'm trying text in second li. how going in look_down. in advance :) <ul class="threads"> <li>one</li> <li>two</li> <li>three</li> </ul> <ul class="threads"> <li>one</li> <li>two</li> <li>three</li> </ul> <ul class="threads"> <li>one</li> <li>two</li> <li>three</li> </ul> use html::treebuilder; $tree = html::treebuilder->new; $tree->parse($url); foreach $ul ($tree->look_down(_tag => 'ul', class => 'threads')){ foreach $li ($ul->look_down(_tag => 'li')){ print $li->as_text. "\n"; } } its easy https://metacpan.org/pod/html::treebuilder::xpath #!/usr/bin/perl -- use strict; use warnings; use html::treebuilder::xpath; $html = q{<ul class="threads"> <li>one</li>

java - Jersey 2.x File Upload NPE -

hi all, after fiddling whole day , finding solutions internet still not able resolve problem. need brilliant brains out there in universe me out. :-) trying upload file server using jersey restful services. while trying getting null pointer exception. pointers highly appreciated. following environment configurations: jdk 1.8 tomcat 8.0 jersey jars: jersey-media-multipart-2.12.jar mimepull-1.9.3.jar jersey-media-moxy-2.13.jar jersey-media-jaxb.jar jersey-client-2.13.jar jersey-server-2.13.jar jersey-client.jar javax.servlet-api-3.0.1.jar below web.xml has url pattern restful services. <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="webapp_id" version="3.0"> <dis

bc utility in java, fails for some cases -

i trying write simple bc utility in java. program works fine cases failing expression 4+4*3-3-2-1/3. consecutive - operators. not sure if covered edge cases. suggestions make better helpful. thanks //enum operations allowed. private enum operators { add (1, "+"), subtract (1, "-"), multiply (2, "*"), divide (2, "/"); string operator; // operator priority int weight; operators(int w, string o) { this.operator = o; this.weight = w; } public string getoperator() { return operator; } public int getweight() { return weight; } } // stack , queue convert expression postfix linkedlist<string> resultqueue = new linkedlist<string>(); stack<operators> operatorstack = new stack<operators>(); //stack evaluate postfix expression stack<integer> evalstack = new stack<integer>(); public int eval(string exp) { cha

c++ - CUDA Thrust - How can I write a function using multiple device vectors with different sizes? -

i've been trying figure out how perform simple entropy calculation using 4 thrust device vectors. i have 4 device vectors, representing 2 key-value pairs. first pair of vectors contains keys , number of times key appears. second pair contains keys paired bins calculating entropy. in second vector pair, keys appear multiple times, each instance representing different bin. it looks this: device vector pair 1 keyval 6 8 9 counts 1 3 2 device vector pair 2 keyval 6 8 8 9 9 binval 1 1 2 1 1 result vector (contains calculated entropy results) keyval 8 entropy 0.602 what i'm planning on doing use first vector pair check if key appears enough times calculate entropy. if count large enough, second vector pair used calculate entropy bin values key. need use of bin values particular key. example, if wanted calculate entropy keys have appeared @ least 3 times, find in first vector pair keyval 8 ready. then, search second pair instances of keyval 8, ,

java - @Valid annotation is not working in spring boot -

here scenario, controller annotated @restcontroller , put method @requestbody argument needs validated. use @valid annotation on argument , @notnull , @min annotations on bean fields, not working. code here: the bean: public class purchasewrapper { @decimalmin(value = "0.00",message = "discount must positive") @notnull private bigdecimal discount; @notnull private long merchandiseid; @notnull private long addressid; @min(1) @notnull private integer count; } the controller @restcontroller @requestmapping("merchandises") public class merchandisecontroller { @requestmapping(value = "purchase",method = requestmethod.put) public responseentity<restentity> purchase(@valid @validated @requestbody purchasewrapper purchasewrapper, @requestparam string token){ return new responseentity<>(merchandiseservice.purchase(purchasewrapper,token),httpstatus.ok); } @au

python - import module within loop -

i have 1 file, let's call foo.py. couple of things, including sending data on serial port , emailing response comes back. i have file, looks this: iteration = 0 while true: iteration += 1 // stuff here every time if iteration%5 == 0: import foo time.sleep (100) i'm aware there broader problems here elegance (or lack thereof) of independent counter, putting aside - serial transmission / email works first time it's triggered. subsequent loops @ multiple of 5 (which trigger modulo 5 == 0) nothing. does imported version of foo.py cached, , avoid triggering on subsequent runs? if yes, how else can call code repeatedly within looping script? should include inline? thanks tips! if have access foo.py , should wrap whatever want run in foo.py in function. then, import foo once , call function foo.func() in loop. see this explanation of why repeated imports not run code in file.

php - YAML and symfony2 -

i have noticed in config.yml file of symfony2, import feature used below imports: - { resource: security.yml } - { resource: services.yml } i using yaml file in own bundle init read entities. however, jam-packed in 1 single yaml file. using symfony\component\yaml\parser; component read file. however, if try copy nice feature of import , parser reads , doesn't interpret import nor resource keyword. imports: - { resource: test.yml } that var_dump node tree without interpretation. test not loaded. how can use same feature in config.yml file ? well suggested anthon, created own implementation using symfony components, here class people interested ( it's basic implementation, whatever want it) use symfony\component\yaml\parser; use symfony\component\filesystem\filesystem; class myymlparser { protected $parser; protected $finder; protected $currentdir; protected $ymlpath; protected $data; public function __construct($rootdir) { $this->rootdir = $

c++ - Problems with lazy initialization of singleton -

i want make singleton class has behavior below. my program has limited resources, don't want make singleton instance until need it. (lazy initialization) singleton class huge initialization takes long time. response time important in program.(like games) but know, 1 & 2 & 3 conflict each other. in conditions, have choose 1 of them (memory or performance) is there solutions program can meet memory & performance requirement? "is there solutions program can meet memory & performance requirement?" these requirements need satisfied regardless. ensure lazy instantiation of singleton class, recommend using scott meyer's singleton implementation guarantee lazy/thread safe initialization mentioned here : class singleton { public: static singleton& instance() { static singleton theinstance; return theinstance; } delete singleton(const singleton&); delete singleton& operator=(cons

What is my syntax error in this c code? -

i have written c code checking checkmate (in chess), can't understand what's wrong syntax, compile error: main.c:2:30: error: expected ';', ',' or ')' before 'board' int is_check(const char[][8] board,int i,int j){ ^ main.c:117:27: error: expected ';', ',' or ')' before 'board' int check(const char[][8] board) and code: #include <stdio.h> int is_check(const char[][8] board,int i,int j){ int row = i; int clmn = j; //check clmn , do{ i--; } while(board[i][j] == 'z'); if(i>=0){ if(board[i][j] == 'h'){ return 1; } } = row;//init //check clmn , down do{ i++; } while(board[i][j] == 'z'); if(i<8){ if(board[i][j] == 'h'){ r

benchmarking - TPC-DS BenchMark on Hadoop - Why use star schema -

i trying run tpc-ds benchmark sparksql. in document talk having star schema , number of tables. from understanding of hadoop , better have denormalized data, , can format paraquet in compression. (use partitions parallelism) i found document sas -> https://support.sas.com/resources/papers/data-modeling-hadoop.pdf which talks in same term. no dataware house expert, request , me understand how model data dataware house in hadoop

java - SpringMVC Jackson Polymorphic Deserialisation with HTML Forms -

hi i'm using jackson polymorphic deserialization @jsontypeinfo , @jsonsubtypes annotations this: @jsontypeinfo(use=jsontypeinfo.id.name,include=jsontypeinfo.as.property,property="type") @jsonsubtypes({ @type(value = customerfilecontent.class, name="filecontent"), @type(value = customercontactcontent.class, name="contactcontent"), @type(value = customertextcontent.class, name="textcontent"), @type(value = customerwebcontent.class, name="webcontent") }) public class customercontent { private int categoryid_; private int contentid_; private string contentname_; private string contenttype_; private int contentorder_; private double contentversion_; private int contentstatus_; private int moveoldval_; private int movenewval_; protected finarappdatasource datasource; @jsontypename("filecontent") public class customerfilecontent extends customerconte

python - Is it possible to add a new node to an existing edge using Networkx -

i trying implement game of sprouts using python , networkx library. idea of game start 2 vertices. player draws edge 1 vertex another. new node placed on newly created edge. rest of game's details aren't necessary placed link @ bottom further explain it. currently, first create node, add edge starting node new node. next, add edge new node terminating node. question is, there easier way of accomplishing this? instance, drawing edge first , placing new node on edge. http://nrich.maths.org/2413 it seems can use add_path() function. example: >>> g = nx.graph() >>> g.add_nodes_from( [0,1] ) >>> g.nodes() [0, 1] # have 2 nodes, 0 edges. # user clicks 2 vertices, 0 , 1. # add 1 more node first. >>> g.add_node(2) # add new edges >>> g.add_path([0,2,1]) >>> g.nodes() [0, 1, 2] >>> g.edges() [(0, 2), (1, 2)]

jquery - For loop runs once, 2/3 of the way (javascript) -

function clearobjects() { var co = document.getelementsbyclassname("clearable"); var i; alert("function runs"); (i = 0; < co.length; i++) { alert("for loop runs 1/3"); alert("for loop runs 2/3, time erase"); co[i].style.backgroundcolor = "#ffffff"; alert("for loop runs 1, erased 1"); }; }; clearobjects(); this function has here suppose change color of divs class of clearable background color of white, "erased." function runs inside of other code, issue loop stops running when gets to: co[i].style.backgroundcolor = "#ffffff"; i put alerts in there see parts of function run, , final alert "for loop runs 1, erased 1" not alert, , loop not run again. have looked , not find problem similar mine. know doing wrong? post of code if neccessary. thanks! i fixed problem setting visibility hidden instead of background white, , setting c

javascript - ThreeJS camera facing point -

in threejs, if camera rotated @ given angle, how can determine coordinate of point 1 unit in direction camera facing. if unfamiliar threejs camera rotation angles, rotations very weird. for example, if of rotation variable 0, function return (0, 0, -1). if rotation x pi / 2 (90 degrees), function return (1, 0, 0) how create function this? don't need everything, math. you want world position of point 1 unit in front of camera. one way add object in front of, , child of, camera. need query world position of object. by default, when camera's rotation ( 0, 0, 0 ), camera looking down negative z-axis. here pattern follow: var object = new three.object3d(); object.position.set( 0, 0, - 1 ); scene.add( camera ); // required when camera has children camera.add( object ); now, can point need so: var worldpos = new three.vector3(); // create once , reuse ... camera.updatematrixworld(); // called in render loop, may not have call again. experiment. world

plsql - Assigning a string value to a variable of type NUMBER in pl/sql procedure not throwing any error -

i have started working on pl/sql recently. still not clear concepts. writing stored procedure has input values. using thses input values keys,i create cursor. after iterate through cursor output , , call insert statement each row fetched. before calling insert, doing few data manipulations. splitting string '4564:0:75556' considering : delimiter. using substr , instr functions my actual question starts here. output of substr string value. assigning value variable of type number declared in proc. i expecting error while compiling proc or atleast when test it. strangely didnt error, proc works fine. is expected behaviour? can assign string value variable of type number? in proc assignin output of substr variables d_c1_subscr_no, d_c1_account_no, d_c1_subscr_no_resets number my stored proc: create or replace procedure p4_update_bill_period_bulk(oldperiod in varchar, newperiod in varchar,

Peterson's Algorithm with some modifications -

would peterson's algorithm work after flipping turn , flag orders; ex: p0: turn = 1; flag[0] = true; while (flag[1] && turn == 1) { // busy wait } // critical section ... // end of critical section flag[0] = false; ================= p1: turn = 0; flag[1] = true; while (flag[0] && turn == 0) { // busy wait } // critical section ... // end of critical section flag[1] = false; no, doesn't work if flip orders, because allows both processes enter critical section simultaneously. for example, suppose initial state flag[0] = false, flag[1] = false, turn = 0 : process 0 runs: turn = 1; // flag[0] = false, flag[1] = false, turn = 1 then context switch process 1: turn = 0; flag[1] = true; // flag[0] = false, flag[1] = true, turn = 0 while (flag[0] && turn == 0) {} // evalua

python - How can I use rest serializer.ValidationError in django forms? -

i new django , rest_framework. have password complexity rules script 'new user' page. if complexity requirements satisfy needs, return true. else raises serialiser.validationerror . i duplicated django's forget password mechanism apply password rules. when raises error, application crashes below. exception type: validationerror exception value: [u"the 2 password fields didn't match."] is possible use serializer errors form errors {{ form.new_password1.errors }} ? it's possible write own custom exception handler return error in preferred format. the official documentation , @ bottom of page, says: the validationerror class should used serializer , field validation, , validator classes. raised when calling serializer.is_valid raise_exception keyword argument: generic views use raise_exception=true flag, means can override style of validation error responses globally in api. so, use custom exception handler, described a

python - Better debugging: expected a character buffer object -

i trying pass string section the python function below uncertain why seeing error. understanding of is not getting string, expected. have tried casting, not working either. how can solve or more debug info? section = str('[log]') some_var = 'filename =' edit_ini('./bench_config.ini', section, some_var, 'logs/ops_log_1') the function causing error def edit_ini(filename, section, some_var, value): section = false flist = open(filename, 'r').readlines() f = open(filename+'test', 'w') line in flist: line = str(line) print line if line.startswith(section): section = true if( section == true ): if( line.startswith(some_var) ): modified = "%s = $s", variable, value print >> f, modified sect

c++ - How to construct a std::vector or a boost::array from a C array without copying? -

given pointer array of char, possible construct std::vector or boost::array it, , avoiding memory copying? thanks in advance! because vectors own own allocators , storage alike, there no way (for non primitive elements construction move_iterator s bit). so assuming goal true std::vector<char>& existing storage, you'll never succeed, not custom allocators¹. if want string, can use boost::string_ref (in utility/string_ref.hpp ). otherwise, use 1-dimensional multi_array_ref (from boost multi array) 1. using string_ref this easiest: live on coliru #include <boost/utility/string_ref.hpp> #include <iostream> using boost::string_ref; int main() { char some_arr[] = "hello world"; string_ref no_copy(some_arr); std::cout << no_copy; } 2. multi_array_ref this more versatile, , works "better" if not geared towards string interface. live on coliru #include <boost/multi_array/multi_array

Upper Case in Oracle sql -

i trying create view majors , minors w/ upper case, oracle keeps giving me error. doing wrong? create view a5t4 as select studentid, major1, major2, minor from a5 where upper(major1, major2, minor) order studentid; the error is: error report - sql error: ora-00909: invalid number of arguments 00909. 00000 - "invalid number of arguments" *cause: *action: the error in clause. if want fields upper case, use function in select clause, not in clause. try : create view a5t4 select upper(studentid) "studentid", upper(major1) "major1", upper(major2) "major2", upper(minor) "minor" a5 order upper(studentid);

java - My application stops when I try to save a file -

when try save file message: application has stopped. know works fine until save. appreciate help. package no.hjemme.christian.myapplication; import android.os.environment; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.view.*; import android.location.*; import android.content.*; import java.io.file; import java.io.filewriter; import java.io.ioexception; import java.lang.*; import android.widget.*; public class mainactivity extends actionbaractivity implements android.location.locationlistener { arrayadapter<charsequence> adapterkum; arrayadapter<charsequence> adapterstatus; arrayadapter<charsequence> adaptermerket; arrayadapter<charsequence> adaptertype; private locationmanager locationmanager; double latitude; double longitude; double lati; double longi; spinner kum; spinner status; spinner merket; spinner type; string kum; string status; string

python - installing gcovr on ubuntu using pip -

i trying intall gcovr on ubuntu using pip install gcovr but gives error command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_mymachine/gcovr/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-uqjidg-record/install-record.txt --single-version-externally-managed --compile failed error code 1 in /tmp/pip_build_mymachin/gcovr storing debug log failure in /home/mymachin/.pip/pip.log any ideas? thanks i had no problems installing way: sudo pip install gcovr no errors. if you're on ubuntu 14.04, may need upgrade pip. curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" sudo python get-pip.py

Creating JSON format data through data frames in R -

i want create json data of form {"recipe name": "abc", "main ingredient": "xyz", "ingredients": {type:"a" id:"1"}, {type:"b" id:"2"}, {type:"b" id:"3"} "servings": 3,} i have data frame of type: recipe, recipe id ,ingredients,ingredients id,servings ,main ingredient,main ingredient id "abc" , 2 , {"a","b","c"} , {1,2,3,} , 5 , "f" ,7 "bcf" , 3 , {"d","e","f"} , {4,5,7} , 4 ,"g" ,8 .... i have tried usign rjson package got character(0) output .can me please ? i did find 1 method though >library(rjsonio) >tojson(dataframe) here output: [1] "{\n \"factor1\": [ \"115g\", \"1\", null, null

javascript - Knockout Observable not updating when given a new value -

this seems basic part of using knockout, , i'm not sure why isn't working, reason , 2 of 5 knockout observables holding onto new values. in setup of model: self.cprovideridentifier = ko.observable(); self.referringprovideridentifier = ko.observable(); self.billablecareprovideridentifier = ko.observable(); self.servicelocationidentifier = ko.observable(); self.practicelocationidentifier = ko.observable(); inside of ajax call returns number of items inside of json object, extract relevant pieces of information, , put them correct observable: visitmodel.cprovideridentifier(data.careprovideridentifier); visitmodel.referringprovideridentifier((data.referringprovideridentifier == null || data.referringprovideridentifier == "undefined") ? 0 : data.referringprovideridentifier); visitmodel.billablecareprovideridentifier(data.billablecareprovideridentifier); visitmodel.practicelocationidentifier(data.practicelocationidentifier); visitmodel.servicelocationidentifie

SyncAdapters.requestSync and Android SyncManager -

i'm trying understand workings of syncadapters. looked @ code when receive gcm notification broadcast receiver. want force syncadapter sync calling requestsync gcm telling app there new data available fetch. i got code below link: https://software.intel.com/en-us/articles/handling-offline-capability-and-data-sync-in-an-android-app-part-2 public class gcmbroadcastreceiver extends broadcastreceiver { private static final string tag = gcmbroadcastreceiver.class.getsimplename(); public gcmbroadcastreceiver() { } @override public void onreceive(context context, intent intent) { googlecloudmessaging gcm = googlecloudmessaging.getinstance(context); if (googlecloudmessaging.message_type_message.equals(gcm.getmessagetype(intent)) && intent.getextras().containskey("com.example.restaurant.sync_req")) { log.d(tag, "gcm sync notification! requesting db sync server dbversion " + intent.getstringe

javascript - Adding Multiple value setAttribute on pop up onclick in an input -

i stack in problem solving javascript , need ask advice regarding project. have input called subject , level, in level want add multiple values seperated via comma, i created function function selectedlvl($levels){ lvl1.setattribute("value", $levels); } in pop have code user click , updated input. working 1 value. how can add multiple keys seprated in comma, example if clcik each vallue append levels, kindergarten, primary school , on.. <ul> <li><a href="#" onclick="selectedlvl('all levels')">all levels</a></li> <li><a href="#" onclick="selectedlvl('kindergarten')">kindergarten</a></li> <li><a href="#" onclick="selectedlvl('primary school')">primary school</a></li> <li><a href="#" onclick="selectedlvl('school years 7,8,9')&q

gdk - GTK: Check for KeyEvent including shift key -

in application, check gtk key_press event key combination <ctrl><shift><#> . code: (in case, python, problem language-independent, guess) def on_key_press(self, widget, event): if ((event.keyval == gdk.key_numbersign) \ # problem , (event.state & gdk.modifiertype.shift_mask) \ , (event.state & gdk.modifiertype.control_mask)): dosomethingamazing() the way gtk handles keypresses, actual key (for example "a") , shift key combined uppercase a. numbersign keys replaced apostrophe key on qwertz layout when shift key pressed. event.keyval combination 39 (apostrophe), not 35 (numbersign). so, <ctrl><shift><#> need check uppercase equivalent of numbersign, instead of numbersign, might different on different keyboard layouts, cannot hard-code it. the problem following: >>> gdk.keyval_to_upper(35) # 35 key value numbersign 35 >>> gdk.keyval_is_upper(35) true >>> gdk.keyval_is_lo

ios - Meaning of each Cocoapods build target -

Image
what purpose of each target in cocoapods workspace? when created new cocoapods library via "pod lib create foo", expected 2 targets: 1 build library, , 1 build example. but resulting xcworkspace has total of 4 targets: project foo target foo_tests project pods target pods-foo_tests target pods-foo_tests-foo target pods-foo_tests-foo-foo what's meaning of these targets? (i chose no demo application, view-based testing, or testing frameworks.) there 2 project in workspace 1 yours , other cocoapods, , cocoapods adds new target each pod add in podfile. example, let's podfile : platform :ios, '7.0' pod 'afnetworking', '~> 2.5.4' pod 'bpxluuidhandler' you should see in pod project's target list : but mean? targets cocoapods manage each pod. example if choose afnwtworking target in pod project, must see : but example how cocoapods know add "link binary libraries" frameworks a