Posts

node.js - dynamodb get item call using aws sdk -

node.js - dynamodb get item call using aws sdk - i using next code node.js item dynamodb var params = { attributestoget: [ "password" ], tablename : 'foo', key : { "username" : { "s" : "bar" }, } } db.getitem(params, function(err, data) { if (err) { console.log(err); // error occurred } else { console.log(data); // successful response res.send(data); } homecoming next(); }); but there cases not know key value fetching items. want know whether can fetch items based on attribute values. next : var params = { attributestoget: [ "password" ], tablename : 'foo', attribute : { "userlocation" : { "s" : "europe" }, } } you can create global secondary indexes on additional attributes want query. http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/gsi.html node.js amazon-web-services amazon-dynamodb

javascript - Why variable in $scope does not update? -

javascript - Why variable in $scope does not update? - code in plunker. have 2 controllers. in first controller have handler button in view $scope.click = function () { $location.url("/some"); console.log("clicked"); } in handler alter url. configured $routeprovider. var app = angular.module('plunker', []).config( function ($routeprovider) { $routeprovider.when('/some', {template: " counter {{n}}</br> <button ng-click='click()'>click load new url still \"loading cntl\"</button>", controller: "loading"}) .when("/second",{controller: "loading"}); }); here have 2 different routes have same controller - loading controller after url changed /some new button appears in view. have handler button in loading controller. app.controller("loading", function ($scope,$location) { $scope.n= $scope.n || 0; console.log("at begining n "...

explode - Convert string of months with data into a two dimensional array -

explode - Convert string of months with data into a two dimensional array - good morning! i have string number of various months each month followed series of numbers. need break string 2 dimensional array: months in first column columns of numbers after them. i've worked out solutions using strtok, explode , month lookup table. solutions seem cumbersome. appreciate elegant, simple solution real coding experience use. string , hoped 2d array result below. thank expertise , time! dec 14 1938.50 1964.50 1935.75 1959.75 21.75 1960.25 1551405 2751445 mar 15 1931.00 1956.2 1928.0 1952.0 21.75 1952.50 2244 5495 jun 15 1920.25 1949.0 1920.25 1945.0 22.00 1945.50 88 350 sep 15 1925.00 1937.7 1925.00 1937.7 21.75 1938.75 6 204 dec 15 1935.75 1935.75 1935.75 1935.75 22.00 1932.75 1 212 ends being: dec 14 1938.50 1964.50 1935.75 1959.75 21.75 1960.25 1551405 2751445 mar 15 1931.00 1956.2 1928.0 1952.0 21.75 1952.50 2244 5495 etc... the next should trick: class=...

Undefined first element in array javascript -

Undefined first element in array javascript - i new javascript / ajax if obvious please don't harsh. as far know(i may wrong) have javascript reads xml file , extracts between time tags. problem is, no matter how code first list item output undefined. able explain why happening , possible solution please ? if else massively wrong please allow me know i have tried if(x[0] !== 'undefined'){txt=txt + "<li class=\"result\">" + x[i].firstchild.nodevalue + "</li>";} if(x !== 'undefined'){txt=txt + "<li class=\"result\">" + x[i].firstchild.nodevalue + "</li>";} if(x[0].firstchild.nodevalue !== 'undefined'){txt=txt + "<li class=\"result\">" + x[i].firstchild.nodevalue + "</li>";} if(x[i].firstchild.nodevalue !== 'undefined'){txt=txt + "<li class=\"result\">" + x[i].firstchild.nodevalue + "...

java - The constructor (constructor name) is undefined -

java - The constructor (constructor name) is undefined - i'm trying create code able calculate area , perimeter of rectangles dimensions user input. of when seek phone call rectangle class create new rectangle, compiler says rectangle constructor undefined. import java.util.scanner; public class rectangles { public class rectangle { public rectangle() {} public int length; public int width; public rectangle(int len, int wid) { length = len; width = wid; } } public void runner() { scanner scanner = new scanner(system.in); string input1 = scanner.nextline(); string input2 = scanner.nextline(); rectangle first = new rectangle(input1, input2); //error here system.out.println(first); scanner.close(); } public static void main(string[] args) {} } the error "the constructor rectangles.rectangle(java.lang.string, java.lang.string) undefined" the error compiler has stated - have declared ...

objective c - Load a custom XIB for expanded cell in tableView iOS? -

objective c - Load a custom XIB for expanded cell in tableView iOS? - i trying load expanded cell xib uitableviewcell when selected.the content of normal cell , expanded cell same except space populate views in expanded cell.now differentiate between normal cell , expanded cell have changed uilabel colors within expanded cells different color.i able load expanded cell xib on clicking cell however problem every cell getting replaced expanded cell xib .the difference height of clicked cell more others .and when click expanded cell, normal cell xib 's loaded again.how can load expanded cell xib clicked cell? or there improve way accomplish thing? here's how expanding cell. -(void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath{ if ([self.expandedcells containsobject:indexpath]) { [self.expandedcells removeallobjects]; isexpanded = no; [self.bustableview beginupdates]; [self.bustableview reloaddata]; [self.b...

xcode - ionic Failed to load webpage with error: Could not connect to the server -

xcode - ionic Failed to load webpage with error: Could not connect to the server - i'm having issue ionic projects after updating xcode 6 , ios 8. when trying run projects next error in xcode: failed load webpage error: not connect server. the total log is: 2014-10-11 14:08:29.468 test[23293:109668] apache cordova native platform version 3.6.3 starting. 2014-10-11 14:08:29.469 test[23293:109668] multi-tasking -> device: yes, app: yes 2014-10-11 14:08:29.495 test[23293:109668] unlimited access network resources 2014-10-11 14:08:29.866 test[23293:109668] [cdvtimer][keyboard] 0.079989ms 2014-10-11 14:08:29.866 test[23293:109668] [cdvtimer][totalpluginstartup] 0.284970ms 2014-10-11 14:08:30.721 test[23293:109668] resetting plugins due page load. 2014-10-11 14:08:30.764 test[23293:109668] failed load webpage error: not connect server. even when trying update ionic , cordova , starting new project error keeps popping up. i couldn't find threads particular er...