Posts

ios - Horizontally scroll UITextField in a UITableViewCell if text overflows -

Image
how able horizontally scroll uitextfield in uitableviewcell if text overflows? want user can scroll text see of it, should not interfere swipe left delete gesture in uitableview. there way this? this should happening automatically, hit regions small. lead user confusion since 2 gestures in small areas 2 different things. are sure that's uitextfield you're using in cell? looks it's uilabel because of truncation.

mysql - SQL query for total unique hits -

i'm struggling write correct sql statement yield desired result normalized tables. i have: table: sites id, url 1, google.com 2, facebook.com table: hits id, site_id 1, 1 2, 1 3, 1 4, 2 i'd write sql statement produce following: site_id, total_hits 1, 3 2, 1 this show count of how many times each url has been hit. appreciated! select s.site_id, count(*) totalhits sites s join hits h on s.site_id = h.site_id group s.site_id sql fiddle: http://sqlfiddle.com/#!9/a5809/1 you should group by on site id , count number of hits.

go - multilevel slices with string indexes -

i have code looks this: var c [][]string c = append(c, d) c = append(c, l) assuming both d , l []strings. works, return this: [["0241025570","0241025571","1102182000"],["0241025570","0241025571","1102182000"]] how possible structure this: ["d": ["0241025570","0241025571","1102182000"], "l":["0241025570","0241025571","1102182000"]] what have no longer slice, map of slices. can desired results using following code: c := make(map[string][]string) c["d"] = d c["l"] = l depending on usage, may want make copies of d , l , instead of using them directly in map: c := make(map[string][]string) c["d"] = make([]string, len(d)) c["l"] = make([]string, len(l)) copy(c["d"], d) copy(c["l"], l)

javascript - $http in Ionic app not catching errors -

Image
i'm running ionic android app under genymotion emulator. i'm having problem $http. when request successful it's fine. when request return 401/403/404 code, exception thrown in ionic framework: ionic.bundle.js line 17288: "cannot read property 'data' of undefined", response undefined. it seems ionic intercepts responses, , 401/403/404 errors still tries trigger .success() callback. see attached excerpt ionic.bundle.js : ionic version: 1.0.0-rc.0 the issue caused because had http interceptor in app.js. seemed harmless commenting out solved problem. seem below got commented out: // .config(['$httpprovider', function($httpprovider) { // $httpprovider.interceptors.push(function() { // return { // 'responseerror': function(rejection) { // var message = "http error " + rejection.statustext + "(" + rejection.status + ") on " + rejection.config.method + " ...

matlab - Rotating a Plot About the Y Axis -

Image
i have vector of values want plot brightness on circle through radius of (i.e. if 0 3 1 5 i'd want circle dark @ centre, bright ring around it, darker ring, brighter ring). to i've attempted rotate radial vector (e) around y axis, such [x,y,z] = cylinder(e); h = surf(x,y,z), however i'm not doing right, appears rotating curve around x axis. i've tried swapping x , y, still rotates around x axis. appreciated. one way rotate vector , create surface . z data of surface (your rotated vector) color coded according colormap choose, if display surface top circles @ different brightness. if interested "top view" of surface, no need create full surface, simple pcolor job. example: %% // input data (and assumptions) e=[0 3 1 5 2 7]; nbrightness = 10 ; %// number of brightness levels r = (0:numel(e)) ; %// radius step=1 default consecutive circles ...

javascript - Problems with jquery form validation : not working for one or two empty input fields -

i have 7 input fields in form , using jquery validation plugin validating each field. validation working fine if input fields empty. not working if 1 or 2 input field empty , others have value. want show error message if 1 field empty. here form: <form role="form" class="form-inline" enctype="multipart/form-data" method="post" action="insert.php" id="frmform"> <label >audit type</label> <select name="type" > <option value="0">select type </option> <option value="typ1"> type 1</option> <option value="typ2"> type 2</option> </select> <label> site</label> <select name="site" > <option value="0">select site </option> <option value="site1"> site 1</option> <option value=...

continuous integration - Configuring Windows slaves in Jenkins -

i in process of learning continuous integration using jenkins. tried configuring windows machine slave node vm linux box, , pretty straight forward. there 1 windows machine in picture, master (linux) can identify , map slave node when try launch slave browser (using launch slave agent via java web start option). my doubt is, in reality, if have configure multiple slaves, of windows, configuration similar windows nodes except when specifying remote fs directory (which can coincide few nodes), unlike linux slaves, specify ip address , credentials able ssh particular linux node. i can configure 2 nodes called windows_slave1, windows_slave2. can hit url of 1 of these 2 nodes of these machines , click on launch. if remote fs directory has same name, master can launch of these nodes. if want connect specific windows slave, then, how master distinguish among these windows slaves? each salve unique , referred name. job can tied slave restricting run on slave only. did read fo...