Posts

Upload Image Directly From Browser Using AngularJS Amazon S3 -

i trying upload images browser amazon s3 directly, getting error of aws not being defined: public/modules/users/controllers/settings.client.controller.js 16 | var bucket = new aws.s3({ ^ 'aws' not defined. 18 | credentials: new aws.credentials($scope.creds.access_key, $scope.creds.secret_key) ^ 'aws' not defined. below code: 'use strict'; angular.module('users').controller('settingscontroller', ['$scope', '$http', '$location', 'users', 'authentication', function($scope, $http, $location, users, authentication) { $scope.user = authentication.user; $scope.profpic = ''; $scope.creds = { bucket: 'bucket_name', access_key: '', secret_key: '' }; $scope.upload = function() { // configure s3 object var bucket = n...

javascript - Click button to highlight a Map Marker (Gmaps) - how? -

on page need "get directions," button highlight 1 of 3 points/map markers on map. far, have following wrapped around button/img.... <a href="https://maps.googleapis.com/maps/api/staticmap?center=" + 37.7029 + "," + -121.9335 + "&zoom=13&size=300x300&sensor=false"><img src="images/get-directions.jpg" alt="get directions"></a><br> though code not working. idea, went wrong code or know better way? it looks using static map url have embed map ? https://www.google.com/maps/embed/v1/directions ?key=api_key &origin= &destination=

python - Matplotlib Pick Event Functionality -

i'm having weird issue pick event fired if "scroll" while mouse cursor placed on artist object of interest. expected behaviour? clarify, i'm using macbook, , scroll mean 2 finger swipe (or 1 finger on magic mouse). the functionality i'm trying achieve have tooltips on axvspan segments (polygon artist objects), , pick event works if click, if scroll while mouse on 1 of segments of interest, multiple pick events fired. i couldn't find online people faced same issue, , doc isn't clear on firing of pick event either (it says: "fired when user picks location on canvas sufficiently close artist"). constitutes "pick"? edit: example of doing (these functions part of wxpython panel sub-class) def plot(self): in range(len(starttimes)): self.axs.axvspan(starttimes[i], endtimes[i], color='blue', alpha=0.3, picker=true)) self.figure.canvas.mpl_connect('pick_event', self.onpick3) def onpick3(se...

Trying to change statement so create_radio function is only called once (PHP) -

i have function creates radio button in php: // function creates radio button. // function takes 2 arguments: value , name. // function makes button "sticky". function create_radio($value, $name = 'gallon_price') { // start element: echo '<input type="radio" name="' . $name .'" value="' . $value . '"'; // check stickiness: if (isset($_post[$name]) && ($_post[$name] == $value)) { echo ' checked="checked"'; } // complete element: echo " /> $value "; } // end of create_radio() function. i leave php form create html form , call function 3 times values represent 3 different gas prices. <span class="input"> <?php create_radio('3.00'); create_radio('3.50'); create_radio('4.00'); ?> </span> i wondering how chan...

high availability - Whats the best way to migrate a zookeeper ensemble of 3? -

i have zk ensemble of 3 nodes. i need move each different server. whats best way achieve while achieving 0 downtime? an approach temporary requires increasing ensemble size work too. achieving 0 downtime main goal. have @ gist: https://gist.github.com/miketheman/6057930 add 2 more nodes on new servers let them sync, add them existing configs restart followers kill remaining master , deploy 3. zk on new server kill 2 zk on wrong servers

ios - Obscure Xcode build error: "The file “myapp-SBPartialInfo.plist” couldn’t be opened because there is no such file." -

i'm getting following error toward end of build: error: not read data '/users/myname/library/developer/xcode/deriveddata/myapp-ftieubjjfkuwyrhhleghfevbhxuu/build/intermediates/myapp.build/debug-iphoneos/myapp.build/myapp-sbpartialinfo.plist': file “myapp-sbpartialinfo.plist” couldn’t opened because there no such file. the thing can think of is result of having aborted build hour or ago. i have cleaned, quit xcode, rebooted computer - none of easy fixes working. i've checked other build directories (debug-iphonesimulator , release-iphoneos), , neither of directories contain file either. both simulator , archive building correctly. xcode bugs worst. i heard apple support. something wrong 1 of generated files. here steps fix it: 1) quit xcode. 2) open finder , select go > go folder... 3) delete deriveddata folder 4) open xcode. 5) clean project 6) build

java - How to change the imagebutton over another activity? -

i have onclick method , when click on onclick change imagebutton in mainactivitiy.class this onclick: public void onclick8 (view view) { //here should go command change imagebutton in mainactivity.class intent myintent = new intent(view.getcontext(), mainactivity.class); startactivity(myintent); finish(); mediaplayer mediaplayer = mediaplayer.create(zem13.this, r.raw.song); mediaplayer.start(); } if can please show code set in mainactivity.class , other activity. use string references , set string activity , when came activity can change image if