Posts

Featured post

swift - How to change text of a button with a segmented controller? -

i have button links view control. trying change text of button segmented control. using jared davidson tutorial on segmented controls changing text of labels . how change text of button? also, when attempted japanese characters, got error on line: "invalid character in source file". thank you! you can change button title japanese characters way: yourbutton.settitle("ボタンのタイトル", forstate: uicontrolstate.normal)

node.js - Mongoose installation failed on Mac -

Image
this got in terminal. have mongodb , node.js installed already.. if can me i'll appreciate lot! thank you... from see in terminal, think installation mongoose successful. , staring application using nodemon think not installed getting error nodemon: command not found . first need install nodemon using, npm install -g nodemon

c# - Redirect returns "Object moved to" -

i have problem. when try redirect user non-http url mvc action, returns: object moved here. full response (from fiddler): http/1.1 301 moved permanently cache-control: private content-type: text/html; charset=utf-8 location: mygame-app://test.somespecificdata server: microsoft-iis/8.0 x-aspnetmvc-version: 4.0 x-aspnet-version: 4.0.30319 x-sourcefiles: =?utf-8?b?qzpcvxnlcnncuglvdhjcrgvza3rvcfxuywtlc0nhcmvcvgfrzxndyxjlxervy3rvcnncrwrvy3rvclxdb25zdwx0yxrpb25cmtkx?= x-powered-by: asp.net date: thu, 18 jun 2015 18:19:35 gmt content-length: 457 <html><head><title>object moved</title></head><body> <h2>object moved <a href="mygame-app%3a%2f%2ftestprotocol.somespecificdata">here</a>.</h2> <!-- visual studio browser link --> <script type="application/json" id="__browserlink_initializationdata"> {"appname":"firefox"} </script> <script type="te...

android - How Can I put a error msg if there is a blank field on Java? -

i trying make unit converter , seems working need give them error if don't put number on first field , other error if put number on second field (so cant convert backwards) public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); final edittext editcentimeters = (edittext) findviewbyid(r.id.editcentimeters); final edittext editinches = (edittext) findviewbyid(r.id.editinches); button buttonconvert = (button)findviewbyid(r.id.buttonconvert); buttonconvert.setonclicklistener(new onclicklistener() { @override public void onclick(view arg0) { double centimeters = double.valueof( editcentimeters.gettext().tostring()); double inches = centimeters * 0.393700787 ; editinches.settext(string.valueof(inches)); } ...

javascript - Generate html table using angular -

i want generate html table using angular.i have json object , used ng-repeat add multiple rows. table structure different. want generate table structure this: <table> <tr> <td >id</td> <td>sub</td> </tr> <tr> <td rowspan="3">1</td> <td>s1</td> </tr> <tr> <td>s2</td> </tr> <tr> <td>s3</td> </tr> </table> -------------- id | subjects -------------- | s1 -------- 1 | s2 -------- | s3 -------------- | s4 -------- 2 | s5 -------- | s6 -------------- user:[ {id:1 , subjects:[ {id:1 , name:"eng"} {id:2 , name:"phy"} ] }, { id:2 , subjects:[ {id:1 , name:"eng"} {id:3 , name:"math"} ] } ] my ...

angularjs - loopback angular sdk get all users with a certain role -

i'm stuck on getting users role, example admin users, in 1 angular sdk controller. according docs of strongloop. did was: user.find({ filter: { include: [{'relation':'roles', 'scope': { where:{ name:'admin', }} }], }, }, function(list) { console.log(list); }); but list got users, non-admin users included too. on server side default codes, didn't change them. { "name": "user", "plural": "users", "base": "user", "properties": { }, "relations": { "roles": { "type": "belongsto", "model": "rolemapping", "foreignkey": "principalid" } }, "acls": [], "methods": [] } could tell me made wrong? don't want loop through "list" query , filter admin users, because huge list of users, admin...

java - Multithreading for List of Objects -

i have list of 800 customer objects , each customer object in loop needs fetch additional data database, single thread operation taking lot of time. my approach split initial list in multiple lists of 4 , execute each list in parallel each other. can 1 come demo code skeleton problem statement. i confused whether should write db queries , business logic inside run() method of class implementing runnable interface or better approach there? 800 not large number of rows bring back. what's killing loop, you're performing separate query each of these rows. called n + 1 selects antipattern . using multiple threads not improve anything, network round trips problem before , adding threads doesn't make better. instead write 1 query join customer whatever needs, bringing data in 1 resultset. minimizes number of trips across network data.