Posts

Showing posts from January, 2015

java - Wildcard in Digester XML rules -

java - Wildcard in Digester XML rules - i've seen different threads discuss kind of issue have. here few: http://www.mailinglistarchive.com/commons-user@jakarta.apache.org/msg05061.html, http://stackoverflow.com/questions/2165168/digester-extracting-node-name). yet, still can't find solution issue. here xml data: <rows> <row> <firstname>paul</firstname> <lastname>moris</lastname> </row> <row> <firstname>john</firstname> <lastname>aiyer</lastname> <age>35</age> </row> </rows> what want define xml rules allow me map each row map. can't map elements referring names because not possible elements known upfront. i hoping allow me this: <digester-rules> <pattern value="rows/row"> <object-create-rule classname="address"/> <set-next-rule methodname="ad...

ruby on rails - String concatination for dynamically adding classes in View -

ruby on rails - String concatination for dynamically adding classes in View - i listing used shipping addresses user select. i`m dynamically adding classes <div class="row"> <% @shipping_addresses.each |address| %> <ul class=<%= "shipping_address_#{address.id}" %> > <li><%= address['name'] %> </li> <li><%= address['street'] %> </li> <li><%= address['city'] %></li> <li><%= address['country'] %></li> <li><%= address['zip'] %></li> <li><%= address['phone'] %> </li> </ul> <% end %> </div> <!-- row --> problem is, trying add together col-lg-3 bootstrap class ul`s, , doesn`t work when write this: <ul class=<%= "shipping_address_#{address.id} col-lg-3" %> > i outp...

Azure Mobile Services authentication not working with Windows Phone 8.1 Universal app -

Azure Mobile Services authentication not working with Windows Phone 8.1 Universal app - i'm adding azure mobile services authentication universal windows project. it's set , working on server , in windows store version of app, can't work windows phone 8.1 version of app. have 2 different apps i've been working on same problem, created test app based strictly on steps outlined in this article. sample app has 1 button on ui effort authenticate user twitter when pressed. the flow seeing ui is: press button screen goes black moment screen displays "resuming..." spinner invalidoperationexception gets caught the exception details: system.invalidoperationexception caught hresult=-2146233079 message=authentication cancelled user. source=mscorlib stacktrace: @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotifi...

java - GlassFish and Angular long-poll notification service stops responding -

java - GlassFish and Angular long-poll notification service stops responding - i'm trying write simple way angular application able receive notifications application deployed on glassfish 4 container. this angularjs service, utilize $http phone call api notification resource, linkedblockingqueue block until there notification return. angular.module('notification',['config','login']) .factory('notificationservice',function($window,$http,$resource,$q,http_host){ var canceller = $q.defer(); var count = 0; var notify = function(canceller){ $http.get(http_host+'/app/notification', {timeout: canceller.promise}) .success(function(data){ console.log(data); notify(canceller); }) .error(function(data,status,headers,config){ console.log("stopped" + headers + status) if(status > 0){ notify(ca...

android - How to reply Hangouts programmetically -

android - How to reply Hangouts programmetically - i have used next code reply fixed text sms programmatically , working fine. want reply fixed text hangout programmatically without user interaction smsmanager.getdefault().getdefault().sendtextmessage(phonenumber, null, msg, null, null); thanks sunil kumar sahoo you can reply hangout sms not ping. hangout doesn't expose email address of contacts in notification, , has no api exposed till reply hangout ping. 3rd party application there no way. android hangout

javascript - Consuming Java Spring REST service with angular.js issue -

javascript - Consuming Java Spring REST service with angular.js issue - i have issue related cors. i'm writing client-server app using angular , spring. when want send http request, browser shows there "cross-origin request blocked: same origin policy disallows reading remote resource @ http://localhost:8080/..." error. i've deployed rest on localhost using tomcat, , seek consume response using angular, deployed "npm" server, can't because of cors issue. doing wrong? here code snippets: server side: @requestmapping(value="/dummy", consumes="application/json", method=requestmethod.get) public @responsebody string dummy() { homecoming "lol"; } client side: var authorizationapp = angular.module("authorizationapp", ['pagecontroller','ngroute']); authorizationapp.config(function($httpprovider) { $httpprovider.defaults.usexdomain = true; delete $httpprovider.defaults.headers...

php - How to get all rows data in single row in codeigniter -

php - How to get all rows data in single row in codeigniter - i having mysql table "users" 2 fields 1. id 2. name i fetching records in codeigniter like, id name 1. jhon 2. martina 3. rob but want results in single row like, "john,martina,rob" try this: $this->db->select('group_concat("name") all_names', false)->from('table')->get()->row_array(); php mysql codeigniter

jquery - Rails 4 and AJAX: How to have AJAX change the URL, so reloading still keeps the same js.erb file and user can properly use back/forward buttons -

jquery - Rails 4 and AJAX: How to have AJAX change the URL, so reloading still keeps the same js.erb file and user can properly use back/forward buttons - in rails 4 app, how can utilize ajax page result changes user sees without reloading (normal ajax stuff), , (i) if reload url see same result , (ii) can nail button go previous page, and, there, forwards button come ajax created page. basically, page appears deed "normally" loaded page? i have reviewed stuff railscasts 136, 240, , 246, , stack overflow pushstate rails ajax, build next simple code ajax loading post: config/routes.rb .... resources :posts views/posts/index.html.erb: <h2> posts </h2> <div id="all-posts"> <% @posts.each |post| %> <div id="show-single-post"><%=link_to post.title, remote: true %></div> <% end %> </div> views/posts/show.js.erb: $('#all-posts').hide().after('<%= j render(...

Android: radio group in list view not working -

Android: radio group in list view not working - when click radio grouping first item corresponding items should selected when check box checked if check box not checked corresponding items radio button should not checked. if click in between first item radio button should deselect else if click unchecked radio button check box should checked , radio button checked. want accomplish in this. my problem below code when click first item items getting selected if click item in between first item getting deselected , button clicked re positioned teacherassessmentfragmentchild.java package com.example.playit; import java.util.arraylist; import android.annotation.suppresslint; import android.content.context; import android.os.bundle; import android.support.v4.app.fragment; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.adapterview; import android.widget.adapterview.onitemclicklistener; import andro...

scala - ScalaFX: How to convert an Image object to a byte array -

scala - ScalaFX: How to convert an Image object to a byte array - here below code generate qr-code scalafx , zxing: import java.util.{hashmap => javahashmap} import org.apache.commons.codec.binary.base64 import scalafx.scene.image.{image, pixelformat, writableimage} import scalafx.scene.paint.color import com.google.zxing.common.bitmatrix import com.google.zxing.qrcode.qrcodewriter import com.google.zxing.qrcode.decoder.errorcorrectionlevel import com.google.zxing.{barcodeformat, encodehinttype} object qrcode { private val hints = new javahashmap[encodehinttype, any]() { put(encodehinttype.error_correction, errorcorrectionlevel.l) } def encode(text: string, size: int): string = { val bitmatrix = new qrcodewriter().encode(text, barcodeformat.qr_code, size, size, hints) val image = towritableimage(bitmatrix) val bytes = // how convert image byte array? base64.encodebase64string(bytes) } private def towritableimage(bitmatrix: bitmatrix): writ...

elasticsearch - Get the operation count added in Nest.BulkDescriptor according to type of bulk operations -

elasticsearch - Get the operation count added in Nest.BulkDescriptor according to type of bulk operations - i require operation count within bulkdescriptor object created mass operation in nest. correctly no alternative same information. e.g bulkdescriptor bulkdescriptor = new bulkdescriptor(); bulkdescriptor.index<my_objects>(op => op.document(pobj).index(elasticsearchindexname).type("my_objects_document")); after addding document indexed need count of indexed operation before phone call nest.elasticclient elasclient = new nest.elasticclient(elasticconn); ibulkresponse ibulkresp = elasclient.bulk(bulkdescriptor); thanks, amal you can count of operations this: var count = (bulkdescriptor ibulkrequest).operations.count; elasticsearch nest

c - Count the times of a linux kernel thread when it's executed on the CPU -

c - Count the times of a linux kernel thread when it's executed on the CPU - if don't modify linux kernel , recomplie kernel, can times of linux kernel thread 1 time it's executed on cpu on period of time? i can thread's pid, how count times? module programming can solve problem? what static variable.i think update itself. c linux-kernel pthreads

multithreading - Do java threads get deleted when they finish -

multithreading - Do java threads get deleted when they finish - say spawn thread every couple seconds using method below , every thread takes sec complete. finished threads deleted? new thread (new myrunnableclass()).start(); the native, os-level thread released thread finishes (circa when run() finishes), thread object lives, other object, until becomes unreachable , garbage collector feels running. edit: might interesting know thread (in sun's oracle's implementation, anywho) has private method called vm when thread exits, aggressively nulls several fields, including 1 referring runnable set thread(runnable) constructor. if retain reference thread , things doesn't need after finishing execution released, regardless. java multithreading concurrency

java - How to find out the type of an array? -

java - How to find out the type of an array? - suppose have method public static void amethod(t[] items) . how find out if items of type string or int or double? used instanceof im not sure of. public static void amethod(t[] items) { for(int = 0; < items.length; i++) { if(items[i] instanceof string) { } } } generally class class has methods may help, example: object ob = new bigdecimal("30"); system.out.println(ob.getclass().getcanonicalname()); result: java.math.bigdecimal java

database - mySQL Merge Part of Table with New Table Based on Column Name, Default Value Otherwise -

database - mySQL Merge Part of Table with New Table Based on Column Name, Default Value Otherwise - i've read ton of questions can't figure out exact solution this. i have 2 tables different structures, below: insert `forums` (`id`, `topics`, `posts`, `last_post`, `last_poster_id`, `last_poster_name`, `name`, `description`, `position`, `use_ibc`, `use_html`, `status`, `start_perms`, `reply_perms`, `read_perms`, `password`, `category`, `last_title`, `last_id`, `sort_key`, `sort_order`, `prune`, `show_rules`, `upload_perms`, `preview_posts`, `allow_poll`, `allow_pollbump`, `inc_postcount`, `skin_id`, `parent_id`, `subwrap`, `sub_can_post`, `quick_reply`, `redirect_url`, `redirect_on`, `redirect_hits`, `redirect_loc`, `rules_title`, `rules_text`, `has_mod_posts`, `topic_mm_id`, `notify_modq_emails`) values insert `forums` (`id`, `topics`, `posts`, `last_post`, `last_poster_id`, `last_poster_name`, `name`, `description`, `position`, `use_ibc`, `use_html`, `password`, `pa...

Share data between activity and service android -

Share data between activity and service android - i doing android application , want info activity service , service wil create notification , send datat activity , user can see result in activity ? please hep me write in activity want send data:(msg info want send) intent myintent = new intent("package name of class want send"); myintent.putextra("message", msg); myintent.addflags(intent.flag_activity_new_task);//you might need getapplicationcontext().sendbroadcast(myintent); in oncreate() of receiver activity : add together :(anywhere after setting content view) getapplicationcontext().registerreceiver(broadcastreceiver, new intentfilter("package name of current class i.e receiver")); add in class : private broadcastreceiver broadcastreceiver = new broadcastreceiver() { @override public void onreceive(context context, intent intent) { log.d(tag, "data received : " + i...

ios - javascript replaceChild is not showing result in UIWebview -

ios - javascript replaceChild is not showing result in UIWebview - i trying replace tag in html tag using this if (tmp.tagname === 'meter') { var newmin = tmp.getattribute('min'); var newmax = tmp.getattribute('max'); var newval = tmp.getattribute('value'); var style = "color:green;background:white"; var newnode = document.createelement('progress'); newnode.setattribute('min', newmin); newnode.setattribute('max', newmax); newnode.setattribute('value', newval); newnode.setattribute('style', style); tmp.parentnode.replacechild(newnode, tmp); } it replacing tag able see replaced tag in safari debugger in app view tag not rendering. idea? javascript ios uiwebview

class - C++ Friend Function Does Not Have Access To Private Member -

class - C++ Friend Function Does Not Have Access To Private Member - friend function unable access private fellow member of class in declared i trying recreate sample programme reading in book demonstrating utilize of friend function. getting error in ever annoying "intellisense" visual studio frankly can't stand, saying defined friend function not have access private fellow member in declaration of friend function exists. code in different files follows: main.cpp: #include "stdafx.h" #include <iostream> #include "budget.h" using namespace std; int main() { homecoming 0; } budget.h #pragma 1 time #include "auxi.h" class budget { public: budget() { divisionbudget = 0; } double getdivisionbudget() const { homecoming divisionbudget; } void addbudget(int n) { divisionbudget += n; corporatebudget += n; } double getcorporatebudget() { homecomi...

c# - Use OWIN authentication in SignalR -

c# - Use OWIN authentication in SignalR - im new in using owin , signalr. have application using owin auth , want add together chat functionality using signalr. problem getting empty values in context.user.identity . here's startup class public void configuration(iappbuilder app) { httpconfiguration config = new httpconfiguration(); configureoauth(app); webapiconfig.register(config); app.usecors(microsoft.owin.cors.corsoptions.allowall); app.usewebapi(config); app.mapsignalr(); } c# asp.net signalr owin

metatrader4 - mql5 how do i automatically delete un-triggered pending orders before placing new orders -

metatrader4 - mql5 how do i automatically delete un-triggered pending orders before placing new orders - i working on project requires me place purchase stop , sell stop orders , on next bar if orders not triggered, delete them , place fresh ones. here code if(logic == true && orderstotal() == 0) {bool res = ordersend(....);} if(orderstotal() != 0) { if(ordertype == op_buy || ordertype == op_sell) { bool del = orderdelete(....); } } this code placing orders , deleting them when testing. when ea active on live server, not open orders because platform has orders of other instruments open. i'm sure there quite easy way around since novice, i'm not able figure out. ideas?? help. it not clear whether utilize magic number , symbol check. should check sth like int _orderstotal = orderstotal(); (int = _orderstotal; >= 0; i--){ if (ordersymbol() != symbol() && ordermagicnumber() != magic) continue; .... } in di...

php - Mamp: Error with DB Charset in line 31 -

php - Mamp: Error with DB Charset in line 31 - i have real problem setting wordpress. have no thought of coding , html, figure out issue lies in line 31. mamp showed me error: [10-apr-2015 21:14:38 europe/berlin] php parse error: syntax error, unexpected 'db_charset' (t_string) in /applications/mamp/htdocs/wordpress/wp-config.php on line 31 i googled mistake, nobody had problem line 31. know has utf8, , in configuration file written this, can't find mistake. has answer? thank much help. /** mysql database username */ define('db_user', ‘root’); /** mysql database password */ define('db_password', ‘root’); /** mysql hostname */ define('db_host', 'localhost’); /** database charset utilize in creating database tables. */ define('db_charset', ‘utf8’); i know, it's syntax error, other post syntax errors couldn't help me. can give me reply specific case. at end of 'localhost’ have wro...

PHP PDF code not working -

PHP PDF code not working - i have section can download work related pdfs. code works in localhost not on live site. ideas happened? <div id="resources"> <h1>pilot auto resources</h1> <table style="width:400px" id="resourcestable"> <tr> <td>kansas handbook</td> <td><a href="?file=kansashandbook.pdf">download pdf file</a></td> </tr> <tr> <td>ga amber lite application</td> <td><a href="?file=georgiaamberlightapplication.pdf">download pdf file</a></td> </tr> </table> </div> and php <?php if (isset($_get["file"]) && !empty($_get["file"])) { $file = $_get["file"]; $path = "/resources/"; $getfile = $path . $file; if (file_exists($getfile)) { header('content-description: file transfer'); ...

javascript - Equal width and height with a fixed height set -

javascript - Equal width and height with a fixed height set - i'm creating tiles , fits onto 1 page, each tile has fixed height. in illustration i'm wanting create grid of 3 rows, height of each row 33%, , each square take 33% decide height. say: height: 33%; width: height; i've been looking around , i've seen few ways @ doing using width, haven't seen anywhere have fixed height. any ideas? update: http://jsfiddle.net/wl68jwxc/ here fiddle showing current code. so, after help below, create sure these 2 squares on same row...so if alter width of screen, remain squares , on same row regardless of screen size. realise quite different title, logic of question remains same. you can viewport units. div { width: 33.33333vh; height: 33.33333vh; float: left; border: 1px solid grey; } class="snippet-code-css lang-css prettyprint-override"> * { box-sizing: border-box; margin: 0; padding: 0; } div { wid...

java - How to manipulate Data Transfer Object if sql join 2 tables? -

java - How to manipulate Data Transfer Object if sql join 2 tables? - i have query in data access object daocomments joins users table , comments table , store result data transfer object dtocomments: private static final string sql_find_with_username = "select u.username, comments.* users u bring together comments on u.id = comments.id order created_date desc limit 10;"; however, dtocomments not have property "username" since property of dtousers. option 1 so decided utilize map<string, dtocomments> in case map has username key, dtocomments value. but approach fails, because care order of result , that's why query returns result in descending order. if iterate map on jsp page, order not consistent, jsp page output comment in random order. (even if order doesn't matter, don't know if jstl can display map's key. know displaying value though) option 2 i set query result arraylist<dtocomments> but don't s...

How can i use Scons to build SWIG lua example? -

How can i use Scons to build SWIG lua example? - i trying write scons script build lua/embed3 illustration distributed swig. build instructions makefile follows: swig -c++ -lua -external-runtime swigluarun.h swig -c++ -lua -module illustration -o example_wrap.cpp example.i g++ -o embed3 embed3.cpp example_wrap.cpp example.cpp \ -llua5.1 -i/usr/include/lua5.1 in scons wiki, it's said scons has builtin swig support. adding '.i' file among sources should job, unable find detailed description how can script can implemented. following script builds lua/simple project under swig examples. however, unable find how execute first swig directive given in question. reply. env = environment() env.append( swigflags = '-lua' ) env.append( cpppath = '/usr/include/lua5.1' ) env.append( libs = 'lua5.1' ) env.sharedlibrary( target = 'example.so', source = ['example.c', 'example.i' ], shlibprefix='...

osx - Mac OS System 1.0 Programming Language -

osx - Mac OS System 1.0 Programming Language - i started days programming in macintosh 128k (i 10) , don't quite remember programming languages used. 1 does? i know different programming languages available @ time platform. thanks development carried on lisa, using pascal , assembler. time later native development environments started appear mac, e.g. tms pascal, macpascal, microsoft basic, mds, , later, mpw, think c, think pascal, codewarrior, etc. pascal original language mac os programming, , documentation , apis used pascal, there gradual migration towards c through 1980s. osx programming-languages history

remove duplicate in mysql table from two fields with different values -

remove duplicate in mysql table from two fields with different values - i have table emails next fields: id|email |bounced|groupid ---------------------------------------- 1 |**email1@domain.com**|0 |1 2 |**email1@domain.com**|1 |2 3 |email2@domain.com |0 |1 what want accomplish delete duplicates table email_table i.e. remove both have id 1 , 2 , similar in table. i found mysql code didn't job: alter ignore table email_table add together unique index(email,bounced); how accomplish this? i trying remove bounced emails interspire in whichever contact list exist; same email exists in 2 groups. this unique question not remove duplicate 1 field...i need remove duplicate in 1 field having available in many other groups status has bounced value give thanks you if want delete rows same email bounced @ to the lowest degree once: delete t1, t2 email_table t1 inner bring together email_table t2 using (email) t1.bounced =...

android - Application unfortunately gets stopped -

android - Application unfortunately gets stopped - i trying send sms on mobile number shows gets unfortunately stopped the total lgcat errors: 04-05 06:31:19.682: e/androidruntime(2231): fatal exception: main 04-05 06:31:19.682: e/androidruntime(2231): java.lang.securityexception: sending sms message: uid 10042 not have android.permission.send_sms. 04-05 06:31:19.682: e/androidruntime(2231): @ android.os.parcel.readexception(parcel.java:1425) 04-05 06:31:19.682: e/androidruntime(2231): @ android.os.parcel.readexception(parcel.java:1379) 04-05 06:31:19.682: e/androidruntime(2231): @ com.android.internal.telephony.isms$stub$proxy.sendtext(isms.java:434) 04-05 06:31:19.682: e/androidruntime(2231): @ android.telephony.smsmanager.sendtextmessage(smsmanager.java:87) 04-05 06:31:19.682: e/androidruntime(2231): @ android.telephony.gsm.smsmanager.sendtextmessage(smsmanager.java:79) 04-05 06:31:19.682: e/androidruntime(2231): @ com.example.validation.sms...

AngularJS - Unit Test Directive with jquery function -

AngularJS - Unit Test Directive with jquery function - i have directive looks this: angular.directive('newdirective', ['$compile', function($compile){ homecoming { link: function(scope, element, attr, controller) { console.log("newdirective content:"+$("#sub").html()); } }; }]); i tried unit test this: describe('newdirective test',function(){ beforeeach(module('app')); it('temporary test jquery function', inject(function($compile,$rootscope) { var element = $compile('<div new-directive><div id="sub">abc</div></div>')($rootscope); })); }); when run directive normally, output newdirective content:abc . when run unit test, log output newdirective content:undefined . how can jquery function work in unit test? i suggest (if have control) don't utilize jquery html within <div id="sub">...

for loop - C: Filling a matrix -

for loop - C: Filling a matrix - i'm trying fill matrix loop, i'm coming problem 2 coordinates x_0 , y_0 interchangeable. emphasize problem i've simplified downwards basic example: i'm filling next 2x2 matrix , having print value @ 1,2 (or [0][1] within array): int matrix[1][1]; for(j=0; j<2; j++){ for(i=0; i<2; ++i){ scanf("%d", &matrix[j][i]); } } printf("%d \n", matrix[0][1]); however returns value entered third, or [1][0]. thought might have messed loop, printing matrix[1][0] returns same (although here appropriate value). thank help edit: added declaration. it appears confisuing indexing allocation, int matrix[1][1] allocates 1×1 matrix, and int matrix[2][2] allocates 2×2 matrix matrix[1][1] actual m2,2 element of matrix, because index of first-row,first-column 0,0. c for-loop matrix

node.js - passport-oauth accessing remote url -

node.js - passport-oauth accessing remote url - i seek implement oauth solution in nodejs. used passport-oauth generating acccess tokens , refresh tokens working. var passport = require('passport'), oauth = require('oauth').oauth, url = require('url'), arenanet = require('passport-oauth').oauth2strategy, config = require('../config'), users = require('../../app/controllers/users.server.controller'); module.exports = function() { passport.use('arenanet', new arenanet({ authorizationurl: config.arenanet.authorizationurl, tokenurl: config.arenanet.tokenurl, clientid: config.arenanet.clientid, clientsecret: config.arenanet.clientsecret, callbackurl: config.arenanet.callbackurl, response_type: "code", scope: "offline account" }, function(accesstoken, refreshtoken, code, profile, done) { console.log(accesstoke...

java - Notify a Fragment of onPostExecute from MainActivity -

java - Notify a Fragment of onPostExecute from MainActivity - in android, i'm having problem figuring out how, when asynctask complete, notify fragment listening. seems usual java stuff, propertychangelistener not available. in onpostexecute , want fire event , have otherfragment see that. how do this? public class mainactivity extends fragmentactivity { <stuff> private class consumewebservice extends asynctask <string, // type of parameters sent task upon execution - doinbackground() integer, // type of progress units published during background computation -onprogressupdate() string> { public consumewebservice(somekindoflistener listener){ this.mylistener = listener; } protected string doinbackground(string... urls) { < json info restful service> < create , populate sqlit...

lazy evaluation - Ansible raw module: compare local time with target nodes time -

lazy evaluation - Ansible raw module: compare local time with target nodes time - all target machine android , not have python so wanna know each machine's time compared local time. ansible -m raw -a "echo $(date +%s); date +%s" does not work, since $(date +%s) evaluated since origin of execution, , there many nodes executes much later. is there way delay evaluation? imho using simple ssh easier ansible purpose. if want go on using ansible check out the --forks|-f option if have 100 androids talk then: ansible -f 100 -m raw -a "echo $(date +%s); date +%s" or old ssh: for h in `ansible -i inventory.ini --list-hosts`; d=`date +%s`; ssh $h "echo \$hostname - $(date +%s) - $d" & done time lazy-evaluation ansible delayed-execution

c# - Form login information -

c# - Form login information - i trying form place login info login pupil business relationship using id , password database code how add together studentid , password form , execute? here database : student class: class pupil : person { private int id; private string password; private string email; private double gpa; private string message; public student() : base() { this.id = 0; this.password = ""; this.email = ""; this.gpa = 0; } public student(int i, string pa, string em, int gp) : base() { this.id = i; this.password = pa; this.email = em; this.gpa = gp; insertdb(); } public student(int id) { selectdb(id); } //++++++++++++++++ database info elements +++++++++++++++++ public system....

javascript - Error in script '/api/register.js'. Error: Error loading the api -

javascript - Error in script '/api/register.js'. Error: Error loading the api - i have followed this tutorial in custom authentication using azure mobile services. service , running while started implementing client side info repository now. so while testing ios client custom api register.js couldn't create work logs appearing next error. i don't since register.js in place. utilize git source command edit custom api files remotely sometimes. my xamarin client code following. public async task<string> registeruser (string email, string password) { seek { jobject registerjobject = new jobject(); registerjobject.add("email", email); registerjobject.add("password", password); jtoken response = await mobileservice.invokeapiasync("register", registerjobject, httpmethod.post, null); string status = re...

python - Object is not getting saved in yawd-elfinder django application admin -

python - Object is not getting saved in yawd-elfinder django application admin - i using yawd-elfinder django application file management. i created model from elfinder.fields import elfinderfield class simplearticle(models.model): name = models.charfield(max_length=100) content = models.textfield() anyfile = elfinderfield(start_path='files/',null=true,blank=true) def __unicode__(self): homecoming self.name registered in admin admin.site.register(simplearticle) but when trying create object in admin getting created anyfile field not getting value associated it. able create set set not getting associated anyfile field. dont know wrong doing. please help me this. yawd-elfinder and if not module utilize file management please suggest me other 3rd party apps use. give thanks you. python django file-management file-manager

What differences in c/c++ language in arm and x86 architectures -

What differences in c/c++ language in arm and x86 architectures - i'm trying port code written x86 architecture arm. https://github.com/sdlash3d originally developed msvc/win32 , has many bugs in code, there may ub. code working on x86 when compiled gcc, on arm has different behaviour. seems lose info in arrays , weapon switch not work. affected both server , client libraries. application single-threaded, not synchronization problem. char unsigned default on arm, add together -fsigned-char compiler flags, didn't solved problem. other differences there between arm , x86 c code? i tried compile code on arm gcc , clang , there no differences, not compiler bug. p.s compiled code x86 gcc-4.9 (instead of 4.8) , got same behaviour. after combined 2 compilers , found problem in net_encode.c. by time, sebastien chevalier found that ivalue /= pfield->multiplier; ivalue *= pfield->multiplier; when ivalue integer , pfield->multiplier==1.0f changes int...

RegExp replace a specific XML/HTML TAG in PHP -

RegExp replace a specific XML/HTML TAG in PHP - i have little script replace text, come xml file, example: <b>hello world,</b> <include file="dynamiccontent.php" /> <img src="world.png" /> lot of <i>stuff</i> obviosly string much more longer, replace <include file="*" /> content of script in filename, @ time utilize explode find <include file=" but think there improve method solve it. code: $arrcontent = explode("<include ", $this->objcontent->content); foreach ($contenuto $piece) { // parsing array find include $startposinclude = stripos($piece, "file=\""); // taking position of string file=" if ($startposinclude !== false) { // there 1 $endposinclude = stripos($piece, "\"", 6); $file = substr($piece, $startposinclude+6, $endposinclude-6); $include_file = $file; ...

Querystring in REST Resource url -

Querystring in REST Resource url - i had give-and-take colleague today around using querystring in rest urls. take these 2 examples 1. http://localhost/findbyproductcode/4xxheua 2. http://localhost/findbyproductcode?productcode=4xxheua my stance urls should designed in illustration 1. cleaner , think right within rest. in eyes right homecoming 404 error illustration 1 if product code did not exist illustration 2 returning 404 wrong page should exist. stance didnt matter , both same thing. as neither of able find concrete evidence (admitably search not extensive) know other people's opinions on this. kind regards colin g in typical rest api's, illustration #1 more correct. resources represented uri , #1 more. returning 404 when product code not found absolutely right behavior. having said that, modify #1 little more expressive this: http://localhost/products/code/4xheaua look @ other well-designed rest apis - example, @ stackoverflow. have:...

java - The filename, directory name or volume label syntax is incorrect -

java - The filename, directory name or volume label syntax is incorrect - while running eclipse received error. when run project executed in internal browser. not executed in default scheme web browser. 1 reply this. in advance answer you may alter browser setting eclipse - window->web browser-> select browser java eclipse java-ee

python - Storing Huge Data; Database, XML or Plain text? -

python - Storing Huge Data; Database, XML or Plain text? - i want help friend analyze posts on social networks (facebook, twitter, linkdin , etc.) several weblogs , websites. when comes storing data, have no experience in huge data. 1 best bunch of one thousand post, tweet , article per day: database, xml file, plain text? if database, one? p.s. language going start programming python. that depends on way want work data. if have structured data, , want exchange between different programs, xml might choice. if mass processing, plain text might choice. if want filter data, database might choice. python mysql xml database

Spring batch output force CR-LF as line seperator -

Spring batch output force CR-LF as line seperator - i trying forcefulness spring batch write file cr-lf[edit] line seperator irrespective of underlying system. i trying utilize setlineseperator of flatfileitemwriter <bean id="myfilewriter" class="org.springframework.batch.item.file.flatfileitemwriter"> <property name="lineseparator"> <value>\r\n</value> </property> </bean> but generates file "\r\n" string. not sure how unescape this. looked @ source code of flatfileitemwriter, there appending line seperator. using system.getproperty("line.seperator") getting default value. i sure missing pretty simple. thanks. it work with <property name="lineseparator" value="&#13;&#10;" /> to insert cr xml, need utilize character entity &#13; , crlf need &#13;&#10; got stackoverflow answer for more background ,...

Calling a method inside listview item click in android -

Calling a method inside listview item click in android - i need phone call method within item click of listview. app stops responding when running. i'm trying run method called getsubvitals within class getsubvitals(another class). how phone call such method? help appreciated. public class vitallistactivity extends actionbaractivity { getsubvitals getsub; fragmentmanager fm = getsupportfragmentmanager(); public static list<string> vitallist = new arraylist<>(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_vital_list); intent intent = getintent(); string status = intent.getstringextra(loginactivity.extra_message); if(status.equals("true")){ new getparentvitalname().execute(); //log.d("check list",vitallist.get(0)); log.d("tag", "execute complet...