Posts

Showing posts from June, 2011

javascript - How to get selective data from multiple json files? -

let suppose have 5 json files in data stored. have 5 different logins(different users), , each different login, seperate json data should loaded. so, how can implement this? can implement without getjson() ?? want store 5 different js files data variables in it. ideas? i mean, want variable particular json file ( same variable used in json files ) of course can. mention, users should logged in. each user can attached specified attribute containing associated him js file data. or simplier. js file can named user login. after login can loaded withot troubles.

javascript - What event is fired by Safari when the bottom sidebar disappears? -

in safari (ios7, ios8) bottom bar present @ loading off page. once scroll down, disappear, switching viewport greater height. is there event fired browser can catch , use execute code (to take advantage of greater space created) ? you can use the resize event : window.addeventlistener('resize', function(){ ... note works on other browsers , other devices every time top or bottom bar appears or disappears.

ios - Error in Xcode 6 - view controller does not have an outlet named (subview) -

Image
i got error in 1 of apps, , after checking other apps same error happening. none of iboutlets , ibactions connected anymore. when recreate outlet control-dragging .h file, outlet still displays error in connections inspector > outlets , saying (view controller) not have outlet named (subview). before today didn't have problem, xcode 6? view controller referencing correct class under identity inspector > custom class . have deleted derived data folder, removed reference .h file, cleaned project, , cleaned build folder. none of has worked , can't progress development until issue fixed. update: reopened project after couple of days , outlets no longer have exclamation mark next them, , 'easylabel' outlet disconnected has reappeared. didn't change anything, guess it's bug in xcode 6-6.1. update 2: error came back. exclamation marks next every outlet. if delete them can't re-add them. can't create new outlets. can't give view controll...

ruby on rails - Angularjs + RubyonRails + Google Maps Error: [$injector:unpr] Unknown provider: tProvider <- t -

iam creating app angulajs , rubyon rails.i want show google maps user partiular latituts , longitude gettig kind of error here code. angularjs directive code app.directive('map', function() { return { restrict: "a", template: "<div id='areamap'></div>", scope: { area: "=", zoom: "=" }, controller: function ($scope) { var mapoptions; var map; var marker; var initialize = function () { mapoptions = { zoom: $scope.zoom, //center: new google.maps.latlng(40.0000, -98.0000), maptypeid: google.maps.maptypeid.terrain }; map = new google.maps.map(document.getelementbyid('areamap'), mapoptions); }; var createmarker = function (area) { var position = new google.maps.latlng(area.latitu...

Python unit tests multiple threads -

i'm testing web application , i've written tests using unittest. there necessary steps authorization, exchanging data being tested , on. want test if works fine more 1 client. i'd call same test every client in seperate thread, gather return codes , print result. question how create such threads in python? (my ad hoc solution in bash spawns multiple python processes) let's consider example: import unittest class test(unittest.testcase): def setup(self): pass def teardown(self): pass def testname(self): pass if __name__ == "__main__": unittest.main() thread.start_new_thread(unittest.main) #something not work google around, there number of precanned options. nose seems common one. otherwise 1 of projects, worked in python 3.3 if __name__ == "__main__": multiprocessing import process procs=[] procs.append(process(target=unittest.main, kwargs={'verbosity':2})) p...

apache - Directory Redirect to sub-folder with same name -

i trying redirect directory (.htaccess) subdirectory same name. getting redirection loop error. redirectmatch 301 /abc http://www.example.com/lite/abc/ you must delimit pattern otherwise match abc everytime. with redirectmatch redirectmatch 301 ^/abc.*$ http://www.example.com/lite/abc/ or mod_rewrite rewriteengine on rewriterule ^abc.*$ /lite/abc/ [r=301,l] note: you'll need clear browser's cache before trying code. actually, old rule in cache.

Highcharts: how to group data points and display the total accordingly? -

i new highcharts. need display line chart. here categories: ["9/7/14", "9/8/14", "9/9/14", "9/10/14", "9/11/14", "9/12/14", "9/13/14", "9/14/14", "9/15/14", "9/16/14", "9/17/14", "9/18/14", "9/19/14", "9/20/14", ...] here data series: [1, 4, 0, 2, 1, 1, 1, 5, 3, 1, 0, 0, 6, 8, ... ] what hope achieve group every 3 dates , total , display accordingly. this: ["9/7/14", "9/10/14", ...] [5, 4, ... ] is highcharts can out-of-box , how if yes? thanks , regards. it's not possible when using categories. when using categories, need calculate on own. in highstock, feature called datagrouping - however, doesn't work categories.

javascript - Why doesn't Angular update the ng-show status when I use an expression? -

Image
i have no problem getting ng-show work when use scoped variable: (excerpt html file:) <li ng-show="hasbattery"> <span>battery</span> <dl> <dt>type</dt> <dd>{{phone.battery.type}}</dd> </dl> </li> using following controller code, works fine: phonecatcontrollers.controller('phonedetailctrl', ['$scope', '$routeparams', '$http', function($scope, $routeparams, $http) { function loaddata() { // fyi, ?date nonsense below avoid browser cacheing of json file $http.get('phones/' + $routeparams.phoneid + '.json' + '?' + new date().gettime()).success(function(data) { $scope.phone = data; $scope.hasbattery = !$scope.isempty($scope.phone.battery.type); // should call form of $scope.$apply() here? when do, // digest in progress error. ng-show seems // update fine without...

testing - Do I need Facebook approval for 'publish_stream ' for test users in Development mode? -

facebook's documentation around exact details of development mode seem sparse: https://developers.facebook.com/docs/applicationsecurity i have new application. able facebook-login through new application, want start work on posting stories user's timelines. when set permission scope 'publish_stream, email, user_about_me, user_birthday, user_website' not receive error message warning me need approval other actions, facebook login breaks. i'm trying figure out why, , in order narrow down possibilities, great know development mode entails. do need facebook approve app while in development mode? i making grand assumption while in development mode, can ask permission of test users (or developer users, or admin users), , granted. is assumption correct? if so, documentation explicitly , states this? publish_stream deprecated since long time. publish_actions may need, , not need approval permission if use people role in app (admin, developer, ...

javascript - Speed up Response Time - Isotope with 200+ products on one html page -

i have webpage more 8000 lines of html render. i'm using jquery-isotope in combination imglazyload product images. that means "filterable" content on 1 page. using this (function() { var $container = $("#isotopecontainer"); $container.imagesloaded(function() { $container.isotope({ itemselector: ".span3", layoutmode: "fitrows", onlayout: function() { $container.trigger("scroll"); }, getsortdata: { price: function($elm) { return $elm.data("price"); }, name: function($elm) { return $elm.find(".isotope--title").text(); }, popularity: function($elm) { return $elm.data("popularity"); } } }); // jquery ui slider var pre...

javascript - JQuery Rotate isn't working correctly in winforms WebBrowser control -

Image
i have small web page dynamic timer on made using jquery rotate. it works great in chrome, firefox, , ie. problem is, wrote work inside of webbrowser control of winforms app. when viewed through winforms app, z-layering doesn't work correctly, , spinning images seem resize spin causing them change position under overlays. i'm trying come way still control in win-forms without resorting making bunch of images , removing sections "animate" it. has have dynamic timing, can't make gif. <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jqueryrotatecompressed.js"></script> <script type="text/jav...

visual studio 2013 - VB.NET Build Events isn't there -

not can tell you, build events button in properties > compile physically isn't there. per comment using express version, msdn documentation: visual basic express not support entry of build events. supported in full visual studio product. msdn visual studio 13 documentation build events just added note, might able edit project file manually , add build events. msbuild might still use them. i'm not sure point, however.

Sort a PHP Array table by date -

Image
i have multi-columns html table generated php array, taking data table in database contains list of entries. 1 of 5 columns datestamp. the html table sorted by timestamp , without code sorts id (column0). here code have sort: $table .= "<tr><td>" . $column0[$i][0] ."</td><td>" . $column1[$i][1] . "</td><td>" . $column2[$i][2] . "</td><td>" . $column3[$i][3] . "</td><td>" . $column4[$i][4] . "</td><td>" . $column5[$i][5] . "</td></tr>"; $column5[$i][5] 1 containing datestamp. i've tried sort(), asort(), array_multisort()... without luck. here sql table structure: column0: id column1: number1 column2: text1 column3: number2 column4: text2 column5: date (format: y-m-d h:m:s) and here example of content, need sort column date: id.....number1.....text1.....number2.....text2................date 1........75...........

android - getCount() of baseAdapter called many times -

i have class extends baseadapter use insert icon , textview each row of listview inside drawer public class navrightdrawerlistadapter extends baseadapter { private context context; linkedlist<string> usernameusedforlistview; map<string, bitmap> urluserimage; public navrightdrawerlistadapter(context context, linkedlist<string> usernameusedforlistview, map<string, bitmap> returnbitmapfromurl) { this.context = context; this.usernameusedforlistview = usernameusedforlistview; this.urluserimage = returnbitmapfromurl; } @override public view getview(int position, view convertview, viewgroup parent) { int count = 0; if (convertview == null) { layoutinflater minflater = (layoutinflater) context.getsystemservice(activity.layout_inflater_service); convertview = minflater.inflate(r.layout.drawer_list_of_action, null); } imageview imgicon = (imageview) convertview.findviewbyid(r.id.icon); textview txttitle = (textvi...

c# - WPF and Workflow foundation don't work together -

i have strange problem. i've created wpf project in 2012 or 2013 vs doesn't matter. use .net 4.5. i add new activity (workflow class) project. name customactivity. then add new class has got attached property, example below: public class attachedobject : dependencyobject { public static readonly dependencyproperty nameproperty = dependencyproperty.registerattached( "name", typeof(string), typeof(attachedobject), new frameworkpropertymetadata( string.empty,frameworkpropertymetadataoptions.affectsrender)); public static void setname(contentcontrol element, string value) { element.setvalue(nameproperty, value); } public static string getname(contentcontrol element) { return (string)element.getvalue(nameproperty); } } the last step change mainwindow class way: public mainwindow() { initializecomponent(); var activity = new customactivity(); } <window x:class="wpfapplication1...

r - Setting an S4 slot to function and representing a neural network layer -

i attempting write classes in r. here start of neural network layer class. generating warnings , errors don't know how correct. # slot definitions setclass( class="neuralnetworklayer", representation=representation( input = "vector", linearoutput = "vector", squashedoutput = "vector", hasbias = "logical", bias = "vector", weights = "vector", gains = "matrix", squashfcn = "closure", squashfcnderivative = "closure" ) ) # constructors neuralnetworklayer <- function(ninput,noutput,hasbias=true,squashfcn,squashfcnderivative) { nc = list( input = c(rep(na,ninput)), linearoutput = c(rep(na,noutput)), squashedoutput = c(rep(na,noutput)), hasbias = hasbias, bias = c(rep(na,noutput)), weights = c(rep(na,noutput)), gain = matrix(data=weights, nrow = ninput, ncol = noutput), squashfcn = squashfcn, # source of warning ...

gcc - What does if((x=0)) mean in C? -

so apparently, in gcc/c, compiler compiles when if ((x=0)){ code } is used, while when if (x=0){ code } is used, compiler refuses compile. what differences between two? as note, know difference between x==0 , x=0 . exploring how c behaves when met weird codes. there no difference, code-wise. all that's happening saying x=0 instead of x==0 such common mistake compilers emit warning (or error, in case) when see it. set of parentheses common trick shut compiler --- equivalent of saying 'yes, meant this'.

objective c - Remove shadow of UIButton when using setBackgroundImage on iOS -

Image
i creating custom iphone keyboard, there problem uibutton i using code create gradient button let gradient = cagradientlayer() gradient.frame = self.bounds let gradientcolors: [anyobject] = [uicolor(red: 253.0/255, green: 253.0/255, blue: 253.0/255, alpha: 1.0).cgcolor, uicolor(red: 253.0/255, green: 153.0/255, blue: 53.0/255, alpha: 1.0).cgcolor] gradient.colors = gradientcolors self.setbackgroundimage(gradient.uiimagefromcalayer(), forstate: uicontrolstate.normal) it works great there glitch. create gradient add thin shadow on right , bottom of button. i tried not gradient, , added solid color, same shadow there. finally used code change background color self.backgroundcolor = uicolor(red: 253.0/255, green: 253.0/255, blue: 253.0/255, alpha: 1.0) it worked , shadow wasn't there anymore. coused problem. button not change color on highlighted stat of uibutton. is there way rid of shadow, or makes uibutton color change on highlighted sta...

javascript - MRAID 2 architecture and data flow -

i trying create mraid (v2) compliant sdk android, if integrated android app display rich media ads. also, @ backend there platform let advertisers create mraid compliant ads/creatives, can served sdk display purpose. have gone through spec document , still not totally clear functioning , flow of entire system new digital ads industry. so great if can explain me how entire mraid ads works - data flow (who raises initial request ads, how request travels , fetches ads, etc.) , components required create entire platform - sdk, ad creation platform etc. thanks!! mraid (v2) compliant sdk architecture contains following components 1. native component :- responsible executing network calls (http ad request) reading device information reading gps info parsing ad request response creating html string (contains ad data, mraid.js, bridge.js ) 2. web view component :- webview loads html created native component. 3. native java script bridge:- handle communication between...

Is there built-in data structure in clojure supporting both duplicated elements and O(1) removing? -

recently, need implement special set in clojure may have duplicated elements (i.e. multiset), like #{1 2 3 4 1 2} what's more, removing arbitrary element equal assigned value in o(1) time needed well. example, when type (my-remove #{1 1 2 2 3 4} 2) it should return #{1 1 2 3 4} without loop through whole set(or vector). my question is, there built-in data structure in clojure satisfying these 2 properties. if not, there proper alternative solution implement this? thanks! a map of values "count" ? (removing value decreasing counter ?)

android - How to see the actual HttpPost request being sent -

there bugs in code , can't figure out it's happening exactly. my code looks this... data.add(firstname); data.add(lastname); data.add(email); data.add(country); data.add(currency); data.add(phone); string result; // results of http execution try { urlencodedformentity entity = new urlencodedformentity(data); httppost.setentity(entity); httpresponse response = httpclient.execute(httppost); the request not getting response expect (i.e. 1 when use curl. i'd see exact request httpclient making. there way this? you can print request details follows: httppost post = new httppost(); post.getallheaders(); post.getmethod(); // post or request post.getparams(); // returns params post.geturi(); // current uri called once response, response.getallheaders(); httpresponse.getstatusline().getstatuscode(); // response status

batch file - Call a function by an external application without opening a new instance of Matlab -

is there way call matlab functions outside, in particular windows cmd (but linux terminal, lua-scripts, etc...), without opening new instance of matlab each time? for example in cmd : matlab -sd mycurrentdirectory -r "function(parameters)" -nodesktop -nosplash -nojvm opens new instance of matlab relatively fast , executes function. opening , closing of reduced matlab prompt takes 2 seconds (without computations) - hence 4000 executions more 2 hours. i'd avoid this, called function located in same workspace. can done in same instance always? i did research , found possibility of matlab com automation server , seems quite complicated me , don't see essential steps make work case. advices that? i'm not familiar c/c++/c# i'm thinking use of python (but in worst case). based on not-working, thought, idea of @ilya kobelevskiy here final workaround: function pipeconnection(numiterations,inputfile) i=1:numiterations while(exist('in...

jquery - Detect when orientation change has ended -

is there way detect when user has finished changing orientation of mobile device, i'm using event detect when orientation changes, i'd detect when orientation change has ended. thanks $( window ).on( "orientationchange", function( event ) { ... from orientationchange docs, emphasis mine the orientationchange event fired when orientation of device changed .

c++ - how to rotate all objects by their own centers and then translate them to the real position (it isn't working) -

what way make objects not aligned origin center (vector3(0.0f,0.0f,0.0f)) , rotate own central axis? the problem in pseudo code: vector3 vector3 objectcenter = (10,5,0); // current object center vector3 vector3 objectposition = (40,5,0); // place translate object vector3 objectrotation; = 45.0f; matrix.loadidentity (); matrix.translate (objectcenter); //apply transformations matrix.rotatex (objectrotation); matrix.translate (-objectcenter); //itÅ› work correctly until here //when try translate object real position, rotation incorrect. matrix.translate (objectposition); i use c++, glm (to matrix manage) , opengl. if want rotate object locally own coordinate system this: m=inverse(inverse(m)*rotation_matrix); m object transform matrix rotation_matrix rotation (glrotate()) inverse function computes inverse matrix you can use mine inverse matrix computation or rotation around lcs x (lrotx) implementation in c++ (at bottom of a...

excel - Compare 2 Sheets of Data (Macro) -

i trying macro takes 2 sheets workbook , compare 2 different columns of data. find number in 'price variances'!d2:d999999 , try match 'finance all'!e2:e999999 if match, take corresponding data 'finance all'!g2:g999999 , paste corresponding rows in 'price variances'!u2:u999999. clarification i want @ value in cell in 'price variances', column 'd', row '2', see if there match in 'finance all' column 'e' (look through entire column match). if there is, want paste data corresponding row of match 'finance all', column 'g' 'price variances', column 'u', row '2' (this same row of original cell searching match from). this need process every row there after in 'price variances', column 'd'. below have far - please tweak & correct necessary. sub price_variation_finance_match() dim comparerange variant, x variant, y variant ' set comparera...

.net - Does Castle Windsor keep a reference of resolved object with lifestyle transient? -

if castle keep reference object, can access that? there list of reference somewhere inside container? i'm using castle windsor 3.3.0 if castle keep reference object, can access that? it has reference manage object's life. don't need reference , shouldn't manage references created encapsulated code (this object-oriented programming encapsulation , abstraction principles!). you need release manually resolved component if transient in order let castle windsor discard reference , garbage collector free memory. check following statement taken official documentation: some people, used other containers in past, forget windsor may track transient components. resolve instances, , never release them. ensure proper components lifecycle management windsor may track components. means unless release them, garbage collector not able reclaim them, , you'll end de-facto memory leak. remember useful rule of thumb: remember release explicitl...

java - How to log Spring Data JPA repository method execution time? -

i have simple spring data jpa repository. public interface userrepository extends jparepository<userentity, serializable>{ … } is there way monitor execution time methods generated spring (for example findone(…) )? the easiest way use customizabletraceinterceptor follows: @configuration @enableaspectjautoproxy public class springdataexecutionloggingconfiguration { @bean public customizabletraceinterceptor customizabletraceinterceptor() { customizabletraceinterceptor customizabletraceinterceptor = new customizabletraceinterceptor(); customizabletraceinterceptor.setusedynamiclogger(true); customizabletraceinterceptor.setexitmessage("executed $[methodname] in $[invocationtime]"); return customizabletraceinterceptor; } @bean public advisor advisor() { aspectjexpressionpointcut pointcut = new aspectjexpressionpointcut(); pointcut.setexpression("execution(public * org.springframework.data.jpa.repository.crudreposi...

vhdl - Directly indexing a bit of an arithmetic result -

for issue, consider have following signals , using synopsis packages std_logic_unsigned , std_logic_arith . signal o : std_logic; signal : std_logic_vector(parameter downto 0); constant c : integer := 5; i wish set o signal leftmost bit of result of (i-c) . inside of process have like: o <= (i-c)(i'left); which not compile in simulator. i know can solve introducing intermediary variable, there syntactic construct directly? you trying assign o indexed name value result of expression. a indexed name prefix can either name or function call. indexed_name ::= prefix ( expression { , expression } ) prefix ::= name | function_call functions expressions predefined attributes, e.g. i'length or i'left . a function call has specific format: function_call ::= function_name [ ( actual_parameter_part ) ] actual_parameter_part ::= parameter_association_list keeping in mind using package numeric_std (in case without nume...

Would like to have app access from a timed trigger function -

for sample code below able set label 'statmsg' different value(time or counter or status) once every minute. not have 'app' access testtrigger(): //trigger every minute function createtriggerinvite() { scriptapp.newtrigger('testtrigger') .timebased() .everyminutes(1) .create(); } function testtrigger(){ //not working var app=uiapp.getactiveapplication(); app.getelementbyid('statmsg').settext('time'); return app; } function doget(e) { var dbgtime=true; dbgtime=false; //var dbg=true; createtriggerinvite(); if (dbg==true)log('doget','starting'); var app = uiapp.createapplication(); var stat=app.createlabel('status...').setwidth(50) .setstyleattribute('color', 'white') .sethorizontalalignment(uiapp.horizontalalignment.left) .setid('statmsg')); app.add(stat); return app; } uiapp widgets can't updated else ...

c# - Generate xml message to send over tcp -

i have classes generated xsd use create xml send on wire. want create document in memory, convert string/byte[] , send it. under impression once classes populated, tostring() , return entire document out. doesn't seem case... doing wrong here? @event myevent = new @event(); myevent.name = "addprogram"; myevent.version = 8.0m; datetime mydatetime = new datetime(); mydatetime = datetime.now; myevent.time = mydatetime; detail mydetail = new detail(); mydetail.name = "program1" myevent.detail = mydetail; controller controller = new controller(); controller.actionspecified = true; controller.action = controlleraction.create; mydetail.controller = controller; string xmlstring = myevent.tostring(); //this expect string. all out of is: "event" i not sure got information tostring() give xml representation of class not true. should refer article xml serialization. http://msdn.microsoft.com/en-us/library/58a18dwa(v=vs.110).aspx i...

ios - Is there a way for the App to change notifications into silent notifications (not server) for push notifications -

i wondering if possible app turn push notification isn't silent(plays sound) silent push notification (doesn't play sound)? research seems server can change non silent notifications silent push notifications. it's unfortunatly impossible. the advantage of push notification can presented user event if app not running. the drawback application not told push notification receiption. thus, cannot modify in app. another solution use background fetch ask server notifications, , programm uilocalnotification with/without sound. but doing this, notifications would't work while app not running

HtmlUnit Get Title of HtmlAnchor -

i don't see method in documentation, http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/html/htmlanchor.html is there way title attribute htmlanchor? i found wanted shortly after posting question (through trial , error): anchor.getattribute("title")

sql - MySQL query all outcome from a table where the field's values all exist in another table -

for example, merchant(m_id), bill(b_id, m_id, payer_name) how can payer buy every merchant? used group by , compare count, bill can occur times same payer , same merchant. think need function like where m_id in (select m_id merchant) . there couple ways of doing this. here's 1 using subquery: select payer_name bill group payer_name having count(distinct m_id) = (select count(*) merchant) sql fiddle demo

windows phone 8 - WP How to resume background location-tracking -

i have question, implemented background location-tracking in wp8. code like: http://msdn.microsoft.com/en-us/library/windows/apps/jj662935(v=vs.105).aspx work well, according wp policy, if users don't interact app on few hours app terminated system until user restart app. so, implemented background agent task, task auto launched under 30 minutes. code like: http://msdn.microsoft.com/library/windows/apps/hh202941(v=vs.105).aspx my question is: can things in background agent task resume background location-tracking ? if system terminate background location-tracking, background agent task auto restart again. thanks.

nonblocking - How are ioctl() and/or fcntl() used for writing a non-blocking socket? -

i trying learn how write non-blocking socket. can please explain roles ioctl() , fcntl() play in (i.e. roles of file descriptors in creating non-blocking socket. code snippet example explanation appreciated. you use 1 or other set o_nonblock . surely discovered that?

python - how to access variable and lambda defined inside a function(which is not defined in any class)? -

i have basic question. reason i'm not able recall how it. how access variables defined in function not declared in class. how access y variable ? , how pass value lambda ? , how value of c defined inside lambda ? def fun (): y = 100 x = lambda c,s,y : c*s*y also how pass values lambda function ? if want use y in lambda don't specify argument lambda: def fun(): y = 5 x = lambda c, s: c*s*y return x(2, 3) >>> fun() 30

ruby - Create an array from equal values between hash's keys and an array -

i need create new array equal values between hash's keys , array example, have this: my_array = [1,2,3,4,5,6,7,8,9,10] my_hash = { 2 => "two", 5 => "five", 7 => "seven", 10 => "ten" } and then, need new array contains equivalent values. in example, it’ll be: equal_value = [2,5,7,10] how that? equal_value = my_array.select{|e| my_hash.key?(e)} or (perhaps slower) equal_value = my_array & my_hash.keys

sql - how to query mysql on the current week? -

this query current day: select count(*) blog_posts poststatus = "pending" , date(date_accepted) = curdate() now how if want query week? in advance.. use yearweek() function where yearweek(date_accepted) = yearweek(now()) don't use week() because match weeks different years.

java - How to write xml in asset folder -

this question has answer here: special characters not allow in xml file in asset folder in android 2 answers i want write below text in xml tag. have tried says xml not in formated . <questions>public class xyz { public static void main(string args[]) { for(int = 0; < 2; i++) { for(int j = 2; j>= 0; j--) { if(i == j) break; system.out.println("i=" + + " j="+j); } } } }</questions> you need add cdata tags make xml valid. <questions> <![cdata[ public class xyz { public static void main(string args[]) { for(int = 0; < 2; i++) { for(int j = 2; j>= 0; j--) { if(i == j) break; system.out.println("i=" + + " j="+j); } } } } ]]> </questions>

javascript - How to plot decimal values in JQPlot Bar graphs? -

i using jqplots generate bar graphs . able generate exact graphs whole numbers. not able generate graph values having decimal points. below code have used : <script type="text/javascript"> $(document).ready(function(){ $.jqplot.config.enableplugins = true; var s1 = ['1.5','3.0', '0.0', '0.0', '0.0', '3.0', '0.0']; var ticks = ['new mould', 'raw material', 'color/size', 'imported/catalogue' , 'printing' , 'plating' , 'other']; plot1 = $.jqplot('chart1', [s1], { // animate if we're not using excanvas (not in ie 7 or ie 8).. animate: !$.jqplot.use_excanvas, seriesdefaults:{ renderer:$.jqplot.barrenderer, pointlabels: { show: true } }, axes: { xaxis: { renderer: $.jqplot.categoryaxisrenderer, ticks: ticks }, yaxis: { tickoptions: { formatstring: '%.2f...

ios - Delete facebook application -

i have iphone application uses facebook sdk connect. want check if user installed app, , if user installed app, , disconnects app, want know if possible delete application. found can make [[fbrequest requestwithgraphpath:@"me/permissions" parameters:parameters httpmethod:@"delete"] , but don't know how use it. parameters have use? can me?

html - bootstrap responsive fluid layout -

Image
i have started create website design bootstrap , need help. got 6 containers need arrange (and scale) different screen sizes cant work. i want different designs screen (in pixels): 992px , beyond 768px 991px 480px-766px smaller 439px i want arrange page components following image: how can this? need create 4 different layouts , use hidden- classes determent layout show? seems lot of work when updating content. or can bootstrap black magic? what bootstrap using? ill anyway. assuming using 3.2.0... http://www.bootply.com/krobf8p83o <div class="container-fluid"> <div class="row"> <div class="col-lg-12 col-md-8 col-sm-12 col-xs-12"> <div class="row"> <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12"></div> <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12"></div> <div class="col-lg-3 col-md-6 col-sm-6 ...

JMeter how to build a reliable load/stress test -

Image
i’ve been looking resource gave idea of how create reliable load / stress test, haven’t been able find anything. let’s want test application used sell books. it has been proved day highest sales christmas eve (december 24th) maximum peak of 21 sales per minute. taking closer these results, determined there maximum peak of 2 sales per second it’s shown in image below. so taking account results mentioned above, i've tried far: load test: number of threads: 2 ramp-up period: 1 second loop count: forever duration: 3600 seconds (1 hour) stress test: number of threads: 4 (an increase of 100%) ramp-up period: 1 second loop count: forever duration: 3600 seconds (1 hour) now know i've tried, want ask questions: how create load , stress test they’re reliable? things consider? is correct increase number of threads, keep ramp-up period invariable? do think it’s ok use duration of hour? for stress test, increased number of thread in 100%, thin...

android - how to display json object in textview -

this activity .. plss .. doesn't appear on textview ..what i'm trying here displaying profile of admin upon clicking profile option in navigation drawer .. in advance .. please kindly comment suggestion on how solve .. public class profile extends fragment{ int success; view profile; jsonparser jsonparser = new jsonparser(); jsonobject json; textview tvname,tvnumber,tvemail,tvusername,tvpass,tvaddress; string adminname, adminnumber,adminemail,adminusername,adminpassword,adminaddress; private static final string profile_url = "http://jcasim.5gbfree.com/project/jcasim_api/profile.php"; private static final string tag_success = "success"; // private static final string tag_id = "id"; public profile (){} @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // todo auto-generated method stub view profile = inflater.inflate(r.layout.profile, container,false); ...

c++ - Server Socket Compilation Error -

i having trouble debugging following code, throwing typecast error: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <cstring> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <unistd.h> #include <netdb.h> int main(int argc , char *argv[]) { int socket_desc , new_socket , c; struct sockaddr_in server ,client; char *message; //create socket; socket_desc = socket(af_inet , sock_stream , 0); if (socket_desc == -1) { printf("could not create socket"); } //prepare sock addr structure server.sin_family = af_inet; server.sin_addr.s_addr = inaddr_any; server.sin_port = htons( 8888 ); //bind if(bind(socket_desc, (struct sockaddr *)&server , sizeof(&server)) < 0) { printf("bind failed"); } printf("bind done"); //listen listen(socket_desc , ...

c# - When to ditch LINQ? -

linq seems generate horrendously optimised sql (in general). can write way more efficient t-sql myself. do huge websites thousands of daily visitors use linq? or should linq @ point ditched? , if so, what? , when? do huge websites thousands of daily visitors use linq? yes. why not? sql trivial , can fall stored procedure matters. and point. let linq handlethe easy 80% , focus on more complex. and ther rest handle not talking database - caching not hard plan for.

javascript - Grunt 'No Express Targets Found' With load-grunt-config -

when grunt module load-grunt-config express configuration, no "express" targets found. . clarified grunt load-grunt-config --config-debug finding correctly. doing wrong? debug: one@node ~/github/simple-load-balancer-service/lbs $ grunt load-grunt-config --config-debug { "express": { "prod": { "options": { "port": 9000, "script": "app.js" } } }, "package": { "name": "app", "description": "simple-angular", "version": "0.0.1", "dependencies": { "express": "4.x", "express-multi-proxy-router": "*", "body-parser": "*" }, "devdependencies": { "grunt": "latest", "testem": "latest", "jasmine": "latest", ...

html - Horizontal align of floating elements within a responsive div -

i have element structure in this fiddle , in action it's responsive. width different , faced difficulty center lis when ul smaller default. here's code: [html]: <ul> <li>some nice text</li> <li>some nice text</li> <li>some nice text</li> <li>some nice text</li> <li>some nice text</li> <li>some nice text</li> <li>some nice text</li> <li>some nice text</li> </ul> [css]: ul { width: 400px; /* <-- try change - li won't centered :(*/ overflow-x: hidden; overflow-y: auto; padding: 0 16px; border: 1px solid black; } li { border-radius: 5px; box-shadow: 0 0 15px #aaaaaa; float: left; height: 150px; display: inline-block; list-style: none; margin: 15px; padding: 10px; text-align: center; width: 100px; } the clear question is: how align horizontally floating elements in bloc...

javascript - Reversing SVG text on bottom of a radial? -

http://jsfiddle.net/ttr85xuj/ text past degree should mirrored...i'm positive it's translate attribute, think may have redo way i'm appending text & textpath, maybe svg:path before it. when apply translate doesn't seem relative anything. path.append("text") .style("font-size", "15px") .attr("dy", function(d) { return 20 - (d.value / 2) // return (d.value * 15) - (d.value * 2); }) .attr('transform', function(d) { var angle = (d.x + d.dx / 2) * 180 / math.pi - 90; if (math.floor(angle) == 119) { return "" } else { return "" } // return 'scale(-1 1)' }) .append("textpath") .attr("textlength", function(d, i) { return 120 - * 4; }) .attr("xlink:href", fu...

javascript - How to upload a user profile photo with Angularjs to the mongodb database (user model) (mean stack)? -

i want able upload single photo user object profile photo. i've uploaded photos in past multiparty, i'm new angularjs , trying figure out how done. here's how i've used multiparty in past: model: user.prototype.save = function(fields, files, cb){ var properties = object.keys(fields), self = this; properties.foreach(function(property){ self[property] = fields[property][0]; }); var oldphotos = this.photos, newphotos = movefiles(files, oldphotos.length, '/img/' + this._id); this.photos = oldphotos.concat(newphotos); this.location = {name:this.loc, lat:this.lat, lng:this.lng}; this.isvisible = (this.isvisible === 'true') ? true : false; user.collection.save(this, cb); }; module.exports = user; function movefiles(files, count, reldir){ var basedir = __dirname + '/../static', absdir = basedir + reldir; if(!fs.existssync(absdir)){fs.mkdirsync(absdir);} var tmpphotos = files.photos.map(fu...

java - How to find the saddlePoint in IntMatrix -

this question has answer here: how find saddle point of matrix using java? [closed] 2 answers this program in finding saddle point of matrix (intmatrix). please me make method intmatrix m, parameters inside saddlepoints method? public class saddlepoint{ public void saddlepoints(intmatrix m, int[] rows, int[] cols) { int rows = m.length; int cols = m[0].length; boolean[][] flagarr = new boolean[rows][cols]; for(int i=0; i<rows; i++){ for(int j=0; j<cols; j++){ if(m[i][j]==0){ flagarr[i][j]=true; } } } for(int i=0; i<rows; i++){ for(int j=0; j<cols; j++){ if(flagarr[i][j]==true){ /*for rows*/ for(int k=0; k<rows; k++){ m[k][j]=0; ...