Posts

Showing posts from February, 2013

node.js - nodejs amazon s3 upload filee timeout -

i'm using amazon s3 photos storage & getting error "requesttimeout: socket connection server not read or written within timeout period. idle connections closed." here code: function(source, name, callback) { var awsutils = this; fs.stat(source, function(err, file_info) { console.log(file_info); var bodystream = fs.createreadstream(source); var params = { key : name, contentlength : file_info.size, body : bodystream }; awsutils.s3bucket.putobject(params, function (err, data) { if(err) { console.error('awsdriverutils-unable upload: ' + err); callback(false); } else { console.log('awsdriverutils-upload success:', data); callback(true); } }); }); } the upload image file small, 44.0 kb only. research, have found says "amazon s3 send error response after 20 seconds of inactivity. error indica

elasticsearch - Cronjob for curator -

i have installed elk , latest curator 4.0. made regularly run cronjob in linux. i have installed .curator @ linux home, i.e. cd~ . i have typed crontab -e . i input following statement * * * * * /.curator curator action.yml is setting right? how should check if running or not? 1 - curator installation checkout: https://www.elastic.co/guide/en/elasticsearch/client/curator/current/installation.html 2 - can edit crontab entries that. thats ok. 3 - if install curator correctly can run: * * * * * curator /path/to/action/file/action.yml that run curator every minute specified action.yml file. for crontab log checkout: https://askubuntu.com/questions/56683/where-is-the-cron-crontab-log

java - How to replace ¦ (broken bar) from a string? -

i getting json response this: lorem ipsum ¦dolor sit amet what want replace broken bars (¦). i have tried .replaceall("\u00a6", ""); , won't work. i think you're not assigning result, , that's why you're not getting desired output. note replace , replaceall returns new string, doesn't modify string in-place. it should work. if have problems, keep in mind can use directly: string str = "sdfsdf¦sdfsdf" system.out.println(str.replaceall("¦", "")); // output: sdfsdfsdfsdf also there's no need replaceall , can use replace instead (that doesn't accept regex).

javascript - Elessar - get the values from bar which are fixed and selected and insert values to the db -

Image
i'm using elessar library ( https://github.com/quarterto/elessar ) create blocks. i'm trying select blocks blue , subtract yellow ones, example code should insert value database 3 hour (bw 10am-12am= 2 hour , 13:00-14:00= 1 hour total= 3 hours). please me code? $(function () { $('body').prepend(rangebar({ min: moment().startof('day').format('llll'), max: moment().startof('day').add(1, 'day').format('llll'), valueformat: function(ts) { return moment(ts).format('hh:mm'); }, valueparse: function(date) { return moment(date).valueof(); }, values: [ [ moment().startof('day').add(5.0, 'hours').format('llll'), moment().startof('day').add(6.0, 'hours').format('llll') ], [ moment().startof('day').add(12.0, 'hours').format('llll')

android - trying to change background of imageButton in List item -

objective i want play sound on click of list item imagebutton (initially hidden, visible on click) showing play pause (2 images) resource. imagebutton show state of sound user. problem when scroll list, imagebutton again gone. code baseadapter private class listadapter extends baseadapter { private context mcontext; private layoutinflater minflater; viewholder holder; listadapter(context context) { mcontext = context; this.minflater = layoutinflater.from(mcontext); } @override public int getcount() { return indextitles.size(); } @override public object getitem(int position) { return indextitles.get(position); } @override public long getitemid(int position) { return 0; } @override public view getview(int position, view convertview, viewgroup parent) { viewholder holder; if (convertview == null) { holder = new viewholder();

php - What is wrong with this code because the submit button is not working? -

here code. wordpress pages created.both pages in same folder. sending data leadgen.php page-success.php jquery.ajax({ url: "http://localhost/success-page", type: "post", data: 'name=' +name+'&email='+email+'&phone='+phone+'&content='+'&city='city+'&date='+date+'&event_type='+event_type+'&service='+service+'&guests='+guests+'&budget='+budget+'&locality='+locality+'&food_type='+food_type+'&venue_type='+venue_type+'&photography_type='+photography_type; success:function(data){ document.location.href = 'http://localhost/success-page/'; }, error:function (){} }); }); post data this, not use query string. jquery.ajax({ url: "http://localhost/success-page", type: "post", data: { name: name, email: email // m

unity3d - Revmob differentiate video or static interstitial in AdDidReceive -

how differentiate whether or not cached video static interstitial fullscreen or video ad in addidreceive delegate method??? public void addidreceive (string revmobadtype) { if( revmobadtype == ?? ) {} //video or static interstitial } the interstitial ad can receive static images or videos (you can configure behaviour if go media -> click media -> ad units -> click on "fullscreen" ad unit "edit" button -> check if accepts video). the possible values revmobadtype may be: "link", "banner" , "fullscreen", i'd recommend doing like: switch (revmobadtype) { case "link": break; case "fullscreen": break; case "banner": break; default: break; } to check video or rewardedvideo, use: public void videoloaded () { debug.log("videoloaded."); } public void rewardedvideoloaded () { debug.log("rewardedvideoloade

user interface - How to create a frame/window in C++ with GUI? -

Image
i want basiically create window c++. should have control panel structure, option toggle button. button's image should bitmap, 1 on , other off. it should have array of such individual control buttons, control panel. should able toggle on/off. i've build tiny application using c++. kindly guide me on start , proceed? you should have on these: qt gtk+ wxwidgets and choose depending on need , preferencies. edit: if on windows, can use winapi. loose portability of code among oss.

matlab: get multiple mouse coordinates displayed on one screen -

i have 2 mouse pointers displayed om screen (currently using teamplayer application), , know if there way in matlab can identify , read mouse coordinates of each pointer. i know how coordinates of single pointer on screen using: get(0,'pointerlocation');

angular - Angular2 typescript POST request -

i'm testing sample: http://plnkr.co/edit/wtu5g9db3p4pkzs0wvw6?p=preview . this code, implements login form name, mail, profile. on clicking submit button, alert appears on display name , email fields. saveuser() { if (this.userform.dirty && this.userform.valid) { alert(`name: ${this.userform.value.name} email: ${this.userform.value.email}`); } } on above, saveuser function in app.component.ts . executes alert on clicking button. on saveuser function, invoke post request. how can it? you can save users calling service( using post request) in below sample . var headers = new headers(); headers.append('content-type', 'application/json'); this.http.post('http://www.syntaxsuccess.com/poc-post/', json.stringify({firstname:'joe',lastname:'smith'}), {headers:headers}) .map((res: response) => res.json()) .subscribe((res:person) => this.postresponse = res

ios - iTunes Connect access issue -

when tried uploading app app store xcode 7.3.1, getting following error "no accounts itunes connect access. itunes connect access "apna" required. add account in account preference pane". fyi: apple id account been added admin user development team not in associated itunes connect. i think apple id should added 1 of users itunes connect upload build itunes connect. if yes, should user role on itunes connect?. can developer/admin enough push build app store once build approved. can please clarify me on issue?

regex - R - extract all strings matching pattern and create relational table -

i looking shorter , more pretty solution (possibly in tidyverse) following problem. have data.frame "data": id string 1 1.001 xxx 123.123 2 b 23,45 lorem ipsum 3 c donald trump 4 d ssss 134, 1,45 what wanted extract numbers (no matter if delimiter "." or "," -> in case assume string "134, 1,45" can extracted 2 numbers: 134 , 1.45) , create data.frame "output" looking similar this: id string 1 1.001 2 123.123 3 b 23.45 4 c <na> 5 d 134 6 d 1.45 i managed (code below) solution pretty ugly me not efficient (two for-loops). suggest better way do (preferably using dplyr) # data data <- data.frame(id = c("a", "b", "c", "d"), string = c("1.001 xxx 123.123", "23,45 lorem ipsum", "donald trump", &

php - Cannot insert new values in the database -

i'm new programming , i'm trying work on something. code i've used html php. when run on server , put values, refreshes page. there need change on code for connecting: <?php $servername = "localhost"; $username = "root"; $password = "1234"; $database = "finance_payments"; //connection error $conn_error = "could not connect."; // create connection $conn = mysql_connect($servername, $username, $password); $db_select = mysql_select_db($database); // check connection , database selection if(!mysql_connect($servername, $username, $password) || !mysql_select_db($database)){ die($conn_error); } ?> and page: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>payments register</title> <link rel="stylesheet" type="text/css" href="styles/registration_stylesheet.css"> </head> <body> <

css3 - CSS animation moving and changing color -

i not familiar css animations. client want achieve the following result when hovering contact button: so clear: the square's move left right , vice versa when square moves, line underneath changes color the top image start state, middle during effect (50%) , bottom image end stage. is achievable css or need js well? how approach this? i created quick , dirty jsfiddle here: https://jsfiddle.net/x0b397pb/ as can see, possible css. in example used pseudo elements ( ::before , ::after ) create of elements. you mentioned "im not familiar css animations". for used transitions. transition: left 1000ms, right 1000ms, box-shadow 1000ms; each comma separated element value transition between 2 points. transition happens on change of div, can on hover, when applying div (through js). to created effect of lines gradually shifting in color used element slides on top of original 2 lines. new lines have 0 width, on hover gain 100% width. transition t

function - Passing a [ref] parameter in a remote session in Powershell -

i have powershell question. i trying value function variable, calling function reference variable. example: $var = new.object system.object; example-function -outobject ([ref]$var); where example-function defined this: function example-function { [cmdletbinding()] param ( [parameter(mandatory=$true)] [ref] $outobject ) $somevalue = ... #write output #do something... $outobject.value = $somevalue; } this working ok. $var variable gets it's value function ($somevalue). but, not working when example-function imported remote session, example: $creds = new-object system.management.automation.pscredential('user','pass') $session = new-pssession -computername 'examplecomputer' -credential $creds -authentication credssp import-pssession -session $session -commandname 'example-function' -allowclobber $var = new.object system.object; example-function -outobject ([ref]$var); this cod

amazon web services - aws efs connection timeout at mount -

i following this tutorial mount efs on aws ec2 instance when iam executing mount command sudo mount -t nfs4 -o vers=4.1 $(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone).[efs-id].efs.[region].amazonaws.com:/ efs i getting connection time out every time. mount.nfs4: connection timed out what may problem here? thanks in advance! the connection timed out on efs happens due not adding security group port 22 open public ec2 instance on mounting efs. adding sec grp make issue go. edit: along opening port 22 need add vpc's default security group efs connect ec2 instance. mentioned in tutorial this ensures instance member of security group amazon efs file system mount target authorize connection in step 2: create amazon efs file system. p.s.: forgot add default security group instance thats why getting connection timeout error.

linux - Yum and RPM show that the number of installed packages is different -

[root@study ~]# rpm -qa | wc -l 777 [root@study ~]# yum list installed | wc -l 1054 i want know why different,shoud correct number of installed packages? example, centos 7 : $ rpm -qa | wc -l 1733 $ yum list installed | wc -l 1757 reason : wc count 24 "extra yum lines" ... please check : $ yum list installed >> yum-list-installed.txt $ rpm -qa >> list__rpm-qa.txt ... , watch result in text files : use editor line numbers enabled. note : above commands unprivileged user commands. no reason use root .

sql server - Find DISTINCT Missing SQL Dependencies -

i have script returns invalid dependencies in database. script returns many duplicates. want see distinct results. /* modified version of script http://michaeljswart.com/2009/12/find-missing-sql-dependencies/ added columns object types &amp; generated refresh module command... filter out user-define types: http://stackoverflow.com/questions/2330521/find-broken-objects-in-sql-server */ select top (100) percent quotename(object_schema_name(referencing_id)) + '.' + quotename(object_name(referencing_id)) [this object...], o.type_desc, isnull(quotename(referenced_server_name) + '.', '') + isnull(quotename(referenced_database_name) + '.', '') + isnull(quotename(referenced_schema_name) + '.', '') + quotename(referenced_entity_name) [... depends on missing entity name] ,sed.referenced_class_desc ,case when o.type_desc in( 'sql_stored_procedure' ,'sql_scalar_function' ,

c# - Calling stored procedure from Entity Framework that uses BCP -

my company decided move asp.net mvc bells , whistles. 1 of technologies use entity framework. i need call stored procedure runs few selects , writes data flat file using bcp. when execute stored procedure using ssms, works fine, when let execute through entity framework, bcp command doing export hangs until connection times out. i have started sql server profiler , managed grab call stored procedure being sent through, works when ran thru ssms. if open task manager , end bcp process, stored procedure continues processing else without hassles. what causing , how can stored procedure run using entity framework?

javascript - Detect if overlay is in view -

how can detect if overlay element visible / not visible? i think there possibility information on bounding boxes of dom-elements, doesn't seem solution me. is there way find out using openlayers api? you can check if ol.overlay position inside ol.view extent with: var overlay_position = overlay.getposition(); var view_extent = map.getview().calculateextent(map.getsize()); console.info(ol.extent.containscoordinate(view_extent, overlay_position));

php - Input text type error with autocomplete -

i have input element doesn't accept text autocomplete recommendation dropdown (values have sometime entered). code simple gets: <input name="name" placeholder="name" type="text" value="" required> input holder paints yellow , when process form, script isn't executed correctly. don't seem error in console either. using google chrome. there simple solution this? its work. when name stored presses submit <form> <input name="name" placeholder="name" type="text" value="" required autocomplite="on"> <input type="submit"> </form>

match - Get and Increase cell address in Excel formula -

i got following problem. i have 2 excel sheets in same workbook. both contain lists, usernames, email addresses , colum called "profile". now need find username of list 1 in list 2, , write contents of cell of row username found of column "profile" of list 2 list 1. , should use formulas macro not wanted here... i thought going this: get colum-address of usernamecell on list 2 matches username in colum formula in in list 1. get value of "profile" colum of row username found in list 2. the formula should display value of list 2 in list 1. i have searched around, , didn't find useful. i thought doing (in pseudo-formula): indirect(address(match(a$2;'list2'!a:a);match(a$2;'list2'!a:a)+2)) so getting value, of address thing found +2 colums, username in , "profile" in c. the problem here also, address gives me eg. "$a$7" not 'list2'!. can't have "pointer" other sheet in fo

scala - Installing SBT with OJDK Java version 9 -

when try run sbt update , following in log-file. warn: [failed ] org.scala-sbt#main;0.13.12!main.jar: sun.security.validator.validatorexception: no trusted certificate found (1139ms) and following error message: error during sbt execution: error retrieving required libraries (see /home/brett/.sbt/boot/update.log complete log) error: not retrieve sbt 0.13.12 java version: openjdk version "9-internal" openjdk runtime environment (build 9-internal+0-2016-04-14-195246.buildd.src) openjdk 64-bit server vm (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode) scala version welcome scala version 2.11.7 (openjdk 64-bit server vm, java 1.8.0_91). how can fix issue. don't see way around on web.

asp.net web api - AngularJS - get length of array from a webApi call on first call only -

i trying display text 'showing x of y attractions' x number showing , y total number stored in database. i can x using {{attractions.length}} - i'm stuck on best way y? currently obtaining data through service call, doing $http web api controller of data initially, can filtered. $scope.attractions = dataservice.getallattractions(); i like: $scope.totalattractions = dataservice.getallattractions().length; so question best way totalattractions in scenario? edit, getallattractions dataservice function: function getallattractions() { $http.get("/api/v1/attractions") .then(function (response) { // success angular.copy(response.data, attractions); }, function () { // failure }); return attractions; } you trying return undefined attractions getallattractions() . $http.get service asynchronous , returns promise. should return promise in

javascript - Backbone - Merge 2 Collections together? -

suppose there 2 collections, representing respectively /api/page/1 , /api/page/2 ; there anyway (through underscore, example) merge these 2 collections new, single collection? option 1 if haven't fetched collection yet, can fetch first one, fetch second 1 {add : true} flag , second 1 merged first one: collection.fetch({data : {page : 2}); => [{id: 1, article : "..."}, {id: 2, article : "..."}]; collection.fetch({data : {page : 2}, add : true }); => [{id: 1, article : "..."}, {id: 2, article : "..."}, {id: 3, article : "..."}]; option 2 if you've fetched collections , have them stored in 2 variables, can add contents of second collection first one: collection1.add(collection2.tojson()); this options suffers fact first collection fire "add" event when second collection added it. if has side effects such undesired ui re-renders due event, can suppress adding {silent : true} flag collecti

logging - Winston logger - Is it possible to log the shut down of an application -

in winston logger node js, possible log shut down of node application? example, if node app run in docker, , docker container killed, possible log winston? or need log through docker? you can capture signal events in node.js , run any code on signal , in case logging. sigterm - graceful shutdown in nodejs a docker stop send sigterm signal, , that's standard 'close files , connections , stop program' signal sent *nix process. want handle sigint in same way (a ctrl-c sends this). process.on('sigterm', function() { winston.log('got sigterm, exiting'); process.exit(1); }); sigkill - not graceful kill a docker kill or timeout on docker stop send sigkill . can't capture sigkill node.js kernels "kill , don't ask questions" last resort rid of process. capture logs kill need @ dockers logs, or other external monitoring/logging kills can come anywhere (for example kill -9 command or out of memory manager in kernel

unix - what is meaning of /bin/chown -Rf ownername:groupname path -

i checking configuration , found this. can 1 me in explaining meaning of /bin/chown -rf ownername:groupname folderpath ? ex; sample files , folder; user@user:/tmp/1$ ls -arlt -rw-rw-r-- 1 user user 0 tem 28 14:29 test1 -rw-rw-r-- 1 user user 0 tem 28 14:29 test2 drwxrwxr-x 2 user user 4096 tem 28 14:30 folder user@user:/tmp/1$ ls -arlt folder/ ---------- 1 user user 0 tem 28 14:30 test1 without parameter; error messages show below; user@user:/tmp/1$ find . -type f -name "*" | xargs chown bin.bin chown: changing ownership of ‘./folder/test1’: operation not permitted chown: changing ownership of ‘./test2’: operation not permitted chown: changing ownership of ‘./test1’: operation not permitted -f suppressing mesage, and -r change test1 file in folder. user@user:/tmp/1$ find . -type f -name "*" | xargs sudo chown -rf bin.bin [sudo] password user: user@user:/tmp/1$ ls -lart total 80 -rw-rw-r-- 1 bin bin 0 tem 28 14:

azure service fabric - Is removing all actor state eventually the same as deleting the actor? -

i'm wondering whether there stored/managed in service fabric non-activated actor without persistent state? let's actor instance has following life cycle: actor activated first time. actor save state (persistent , replicated). actor remove saved state. actor deactivated (gc). is there left now? have deleted instead? if call iactorservice.getactorsasync still actor in list, yes, (a marker value) left in storage provider. if statepersistence not set persisted , other state may lost if turn off machines, example.

mysql - Why do logins usually can contain only latin symbols and digits? -

is user experience thing? or it's historically? mean, here no difference characters store in database. , special characters encoded anyways. what's matter? it's artifact of history: holdover olden days of unix usernames. used limited 8 characters too; fortunately don't still cling particular tradition. if you're creating web site today, can define username column utf8mb4 or utf8 character set. users' names can include sorts of characters worldwide languages, , emojis, , other glyphs. please think through requirements case sensitivity in these enhanced usernames, , set collation username column appropriately.

java - JSON Url returns something else? -

i trying access json file : http://www.cloudpricingcalculator.appspot.com/static/data/pricelist.json java. but when read it, gives me json string (that's ok) , gives me else , json.simple.parser throw unexpected character(<) @ position 0 . based on read on stackoverflow, may returns xml instead of json. url "json", how possible ? here code i'm using : string baseurl = "http://www.cloudpricingcalculator.appspot.com/static/data/pricelist.json"; ... url url = new url(this.baseurl); bufferedreader in = new bufferedreader(new inputstreamreader(url.openstream())); string l; string json = ""; system.out.println(url); while((l=in.readline()) != null){ system.out.println(l); json+=l; } jsonparser parser = new jsonparser(); jsonobject jsonobject = (jsonobject) parser.parse(json); and log < followed lot of squares , unknown characters ÿÕ[s›Ãˆ , error unexpected character () @ position 0. you not taking account compression , enco

maven - Is it possible to pass property file value to testng.xml as parameter value? -

is possible pass property file value testng.xml parameter value? example: test.properties: browser = firefox testng.xml: parameter name = "browser" value = "${test.browser}" yes, possible filtering testng.xml test resource. inside pom, need declare filter poiting properties files , override <testresources> filter testng.xml resource. <build> <filters> <filter>path/to/test.properties</filter> <!-- relative location of pom --> </filters> <testresources> <testresource> <directory>src/test/resources</directory> <includes> <include>testng.xml</include> </includes> <filtering>true</filtering> </testresource> <testresource> <directory>src/test/resources</directory> <excludes> <exclude>testng.xml</exclude> </excludes&

javascript - Passing multiple objects to angularjs $resource.save() -

i have operation contract on server looks this: [operationcontract] [webinvoke(method = "post", uritemplate = "/registerorganization", requestformat = webmessageformat.json, responseformat = webmessageformat.json, bodystyle = webmessagebodystyle.bare)] void registerorganization(organization organization, user admin); now on client-side have following resource: var registerorganization = $resource(baseurlservice.getbaseurl() + 'rest/organization.svc/registerorganization'); my question how can pass 2 objects parameters this: registerorganization.save(organization,admin) i 500 server error doing this, ideas how can achieve this? don't know server side call save method of $resource first accepts query string parameters sent query string like: rest/organization.svc/registerorganization?organizationname=stackoverflow&site= while 2nd parameter sent json. , server side call accepts data json. consider change: var data = angul

r - How should one pass columns as variables or indexes to tidyr::separate -

getting errors while trying pass columnames indexes or variables tidyr::separate . setting libraries & data: library(tidyr) library(dplyr) x <- data.frame(col1 = 1:4, col2 = c("a,b,c","d,e,f","g,h,i","j,k,l")) sep <- "," colnamevar <- "col2" these work (in dplyr): x %>% select(col2) %>% names # [1] "col2" x %>% select(colnamevar %>% as.name %>% eval) %>% names # [1] "col2" x %>% select(2) %>% names # [1] "col2" as (with separate): x %>% separate(col2, paste("col2",1:3,sep="."), sep = sep) %>% names # [1] "col1" "col2.1" "col2.2" "col2.3" but fails: x %>% separate(colnamevar %>% as.name %>% eval, paste("col2",1:3,sep="."), sep = sep) %>% names error: invalid column specification as this: x %>% separate(2, pa

javascript - Programmatic relative links with react-router -

did manage find way how programmatically navigate relative link react-router? i've used react-router-relative-links declarative links, can't find way programmatically. i know done manually resolve-pathname , router.push(…) , require access location , available on route handler components. component deep down tree, therefore i'd avoid wiring top. is window.location.pathname right way location , use router.push available through withrouter ? currently i'm using utility function: import resolvepathname 'resolve-pathname'; function getpathnamefromrelativelocation(relativelocation) { let {pathname} = window.location; let basepath = pathname.endswith('/') ? pathname : pathname + '/'; return resolvepathname(relativelocation, basepath); } and in event handler of react component: // current path `/books/123` let path = getpathnamefromrelativelocation('write-review'); this.props.router.push(path); // current path `/book

ios - CGColor not defined for the UIColor UIDeviceRGBColorSpace 1 1 0 1 -

application crash , have error in xcode console: nsinvalidargumentexception', reason: '*** -cicolor not defined uicolor uidevicergbcolorspace 1 1 0 1; need first convert colorspace. when try display value of rgb color : var color:uicolor print("color \(color.cicolor.red) \(color.cicolor.green) \(color.cicolor.blue)") from cicolor doc: var cicolor: cicolor { } the core image color associated receiver. (read-only) property throws exception if color object not initialized core image color. use getred method rgb: var color = uicolor.redcolor() var fred: cgfloat = 0 var fgreen: cgfloat = 0 var fblue: cgfloat = 0 var falpha: cgfloat = 0 if color.getred(&fred, green: &fgreen, blue: &fblue, alpha: &falpha) { print("color \(fred) \(fgreen) \(fblue)") } else { print("error: color not converted") }

ios - UIImageView which is subview of UICollectionCell will hide when Interactive transition -

gif issue i implemented uiviewcontrolleranimatedtransitioning, when interactive transition , uiimageview not show.

objective c - How to design a structure of UIView Controller for dynamic contains -

Image
how design screen structure light weight loading , easy scroll ??? here current design structure. i using table structure set dynamic data. main table sub table. working fine when scroll table not smoothly scrolling. is there other way set type of dynamic data ?? (note: in main table no. of cell dynamic not fixed , each sub table have variable no of cell not fixed)

ios - removeFromSuperview() not working -

i wanted blur background when touch id asked , once authorization successfull, viewcontroller needs visible.but not happening.the viewcontroller still blurred if authorization successfull.can me on how solve this? import uikit import localauthentication class tabbarviewcontroller: uitabbarcontroller { @iboutlet weak var notetabbar: uitabbar! override func viewdidload() { super.viewdidload() self.authenticateuser() self.tabbar.hidden = false self.view.addgesturerecognizer(self.revealviewcontroller().pangesturerecognizer()) let userdefaults = nsuserdefaults.standarduserdefaults() userdefaults.setobject(false, forkey: "sendmodetoggle") userdefaults.setobject("avenir-medium", forkey: "font") userdefaults.setobject(13, forkey:"fontsize") // additional setup after loading view. } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. }

ruby - Error running script on Mac OS but runs ok after ssh -

i have .sh script on mac os machine generate ipa file using phonegap. if log in machine via ssh, , run script, runs successfully. if try execute remotely, doing ssh , calling script below: ~$ ssh -i ~/.ssh/mykey admin@ip_address 'cd /users/admin/scripts && ./build.sh' then error: /system/library/frameworks/ruby.framework/versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- xcodeproj (loaderror) /system/library/frameworks/ruby.framework/versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require' generate_scheme.rb:2:in `<main>' i have on beginning of .sh file: #!/bin/bash path=$path:/bin:/usr/bin:users/admin/.rvm/gems/ruby-2.2.4/bin:/users/admin/.rvm/gems/ruby-2.2.4@global/bin:/users/admin/.rvm/rubies/ruby-2.2.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/users/admin/.rvm/bin:/users/admin/.rvm/rubies/ruby-2.2.4/bin/xcodeproj:/users/admin/.rvm/ru

foreach - PHP Loop to list all items in array, not just last -

i have bit of php code gets information csv file, stores in array, displays data in html table. code uses series of loops display both table headers (keys) , table contents (steps). problem having cannot work out how code loop through , list each array of information, @ moment shows last 1 (amount display specified $x variable in each loop. if me more 1 single value using foreach loop in table appriciated, code follows: <?php // deals potential mac line endings ini_set("auto_detect_line_endings", true); // define function read info .csv function readcsv($csvfile) { $file_handle = fopen($csvfile, 'r'); while (!feof($file_handle) ) { $line_of_text[] = fgetcsv($file_handle, 1024); } fclose($file_handle); return $line_of_text; } // locate .csv read $csvfile = '500.csv'; $csv = readcsv($csvfile); // uses first line of .csv keys $keys = $csv[0]; // loop set how many arrays print ($x=1; $x <=2; $x++) {

Android - Add deep link for my website home page -

i implemented before many deep links website pages in android app, product page, category page, , okay. <activity android:name=".activities.categoryactivity" android:screenorientation="portrait"> <intent-filter> <action android:name="android.intent.action.view" /> <data android:host="www.mywebsite.com" android:pathprefix="/category/" android:scheme="http" /> <category android:name="android.intent.category.default" /> <category android:name="android.intent.category.browsable" /> </intent-filter> </activity> but want add deep link website home page in android app , tried many things this: <activity android:name=".activities.homeactivity" android:screenorientation="portrait"> &l

How to uninstall a Haskell package installed with stack? -

how can uninstall haskell package installed globally stack tool? stack --help shows uninstall command deprecated. uninstall deprecated: command performs no actions, , present documentation as stack --help says, uninstall doesn't anything. can read on stack github feature requested, ended being closed without desire add behavior stack, various reasons. so, officially, there no way use stack uninstall package. to remove package stack installed, need manually so. entails using ghc-pkg unregister , finding location of package on system , removing via tool or rm . example, stack install <package name> # remove package ghc-pkg unregister <pkg-id> cd /path/to/stack/packages # ~/.local/bin, configuration dependent rm <package name>

How do I stop Android ListView from resetting values after scrolling? -

i have listview custom adapter, , each row contains seekbar user can set. each seekbar has seekbarchangelistener set in adapter, , when user changes value of seekbar in listview, adapter's arraylist updated. i've got in getview() of adapter: @override public view getview(final int position, view convertview, final viewgroup parent) { final viewholder viewholder; view v = convertview; if(v == null){ v = inflater.inflate(r.layout.row, null); viewholder = new viewholder(); viewholder.contentview = (textview) v.findviewbyid(r.id.pref_content); viewholder.sliderview = (seekbar) v.findviewbyid(r.id.pref_slider); v.settag(viewholder); }else{ viewholder = (viewholder) v.gettag(); } // initial values prompt p = promptlist.get(position); string content = p.getcontent(); int sliderlevel = p.sliderlevel(); // set views initial values viewholder.contentview.settext(content); viewholder

objective c - How to set pan in IOS Audio Unit Framework -

hello stack overflow users, i want change pan position using uislided in ios application. i upgrading whole app using audiostreamer of matt gallagher to change pan value in in audiostreamer used below code. audioqueueref audioqueue; // defined in audiostreamer.h file - (void)changepan:(float)newpan { osstatus panerr = audioqueuesetparameter( audioqueue, kaudioqueueparam_pan, newpan); nslog(@" setting pan: %ld", panerr); if( panerr ) nslog(@"error setting pan: %ld", panerr); } i replacing audiostreamer streamingkit use audiounit if make thing done using streamingkit or audiounit appreciate that. p.s let me know if needs more info. thanks using audiounit api, can set kmultichannelmixerparam_pan property of audio mixer unit set stereo pan: audiounitparametervalue panvalue = 0.9; // panned dead-right. possible values between -1 , 1 int result = audiounitsetparameter(mixerunit, kmultichannelmixerparam_pan, kaudio

Setting input layer in CAFFE with C++ -

i'm writing c++ code using caffe predict single (for now) image. image has been preprocessed , in .png format. have created net object , read in trained model. now, need use .png image input layer , call net.forward() - can me figure out how set input layer? i found few examples on web, none of them work, , of them use deprecated functionality. according to: berkeley's net api , using "forwardprefilled" deprecated, , using "forward(vector, float*)" deprecated. api indicates 1 should "set input blobs, use forward() instead". makes sense, "set input blobs" part not expanded on, , can't find c++ example on how that. i'm not sure if using caffe::datum right way go or not, i've been playing this: float lossval = 0.0; caffe::datum datum; caffe::readimagetodatum("myimg.png", 1, imgdims[0], imgdims[1], &datum); caffe::blob< float > *imgblob = new caffe::blob< float >(1, datum.channels(), datu

charts - Fill area in Incanter -

is possible create filled area in chart using incanter (clojure)? cannot find in manual. for instance, have following function create simple scatter plot: (defn daycurve-test [] (doto (scatter-plot (range 0 20) (range 0 20)) (add-polygon [[0 0] [0 10] [10 10] [10 0]]) view)) this draw scatter plot , black rectangle on screen. there way fill rectangle using e.g. red?

How to eval spark.ml model without DataFrames/SparkContext? -

with spark mllib, i'd build model (like randomforest ), , possible eval outside of spark loading model , using predict on passing vector of features. it seems spark ml, predict called transform , acts on dataframe . is there way build dataframe outside of spark since seems 1 needs sparkcontext build dataframe? am missing something? re: is there way build dataframe outside of spark? it not possible. dataframes live inside sqlcontext living in sparkcontext. perhaps work around somehow , whole story connection between dataframes , sparkcontext design.

html - thymeleaf pattern dd/MM/yyyy -

i try validate input date have format dd/mm/yyyy : <input type="date" th:pattern="${date_format}" th:field="*{subscriptiondate}"/> in controller, add attribute model : model.addattribute("date_format", "dd/mm/yyyy"); but when submit form have message input tag : please respect format i solve problem updating model attribute : model.addattribute("date_format", "\d{1,2}/\d{1,2}/\d{4}");

Android Studio - how do I change the size of icons? -

i'm building app android studio, , 1 of activities (which lets user draw on canvas) has 'toolbar', things 'clear', 'undo', 'redo' etc. i'm using built-in icons - ie go 'drawables' folder, right-click, go 'add vector asset' , select appropriate icon. i've figured out can change size of icon gets added, can't figure out how use that. so, on phone screen, i'd use standard 24dp icons. however, on tablet screen, i'd icon bigger, they're bit lost on bigger screen. i can't figure out how this, though, , i'm not sure whether i'm using right approach. know can create different drawables sub-folders different densities, it's not density matters actual screen size. what's best way go this? thanks! you should increase toolbar height, icon fit container automatically. in case, if want change size of icon, double-click xml file of icon , change width , height inside. not touch v

sql - Select minimum value from column A where column B is not in an array -

i'm trying select accesses patients d11.xblood minimum value grouped d11.xpid - , d11.xcaccess_type not 288, 289, or 292. ( d11.xblood chronological index of accesses.) d11.xpid : patient id (int) d11.xblood : unique chronological index of patients' accesses (int) d11.xcaccess_type : unique identifier accesses (int) i want report 1 row each d11.xpid d11.xblood minimum (initial access) respective d11.xpid . moreover, want exclude row if initial access d11.xpid has d11.xcaccess_type value of 288, 289 or 292. i have tried several variations of in select expert: {d11.xblood} = minimum({d11.xblood},{d11.xpid}) , not ({d11.xcaccess_type} in [288, 289, 292]) this correctly selects rows initial access eliminates rows current access not in array. want eliminate rows initial access not in array. how can accomplish this? sample table: xpid xblood xcaccess_type ---- ------ ------------- 1 98 400 1 49 300 1 152 288

database - SQLite3: Delete record without overwriting it with nullbytes -

according explanation[1] how possible recover deleted records sqlite-database, 2 things happen when delete record: area containing deleted record added free list (as free block) , "header" in content area overwritten. the content not (or few bytes) overwritten, e.g. opening database file hex editor can still see parts of deleted record. so check whether true or not, here’s minimal example: sqlite3 example.db sqlite> create table 'test'(acolumn varchar(25)); sqlite> insert test values('aaaaaaaaaa'); sqlite> insert test values('bbbbbbbbbb'); sqlite> insert test values('cccccccccc'); sqlite> delete test acolumn = 'bbbbbbbbbb'; what i’m expecting – opening file hex editor – between cccc… , aaaa… there still bs (but bytes before bs or first few bs should have been overwritten). happens whole area bs has been overwritten nullbytes. this happens larger databases, too. content area cleaned nullbytes , because of

inheritance - How to check object instance is inherited from Abstract Class in PHP -

i have below abstract class abstract class abstractperson{ ...... } i have inherited abstractperson account class account extends abstractperson{ ...... } now going make object of class $account= new account() i wondering how check $account object extended abstractperson class? well, need reflection , , 2 methods getparentclass() & isabstract(). here's working example of need. $accountreflection = new reflectionclass('account'); $parentreflection = new reflectionclass($accountreflection->getparentclass()->getname()); $isabstract = $parentreflection->isabstract(); // return true of false

xcode - How to initialize array with object in c++ by user input? -

i have code below, credit , load saves object code , title takes first letter of string. tried course[noofcourses_].setcode(code) @ first, gives me error: cannot initialize parameter type char lvalue char[7] . another problem input skips input prompt title , goes directly credit prompt. void addcourse() { course*course=new course[max_no_recs]; char code[max_coursecode_len]; char title[20]; int credit; int load; cout << "course code: "; cin.clear(); cin >> code; cin.clear(); course[noofcourses_].setcode(code[0]); cin.clear(); cout << "course title: "; cin.getline(title, 20); cin.clear(); course[noofcourses_].settitle(title[0]); cin.clear(); cout << "credits: "; cin >> credit; course[noofcourses_].setcredits(credit); cout << "study load: "; cin >> load; course[noofcourses_].setload(load); noofcourses_++;

loopbackjs - Pass context in 'persist' to 'after save' -

i need pass context operation hook (persist) (after save), know existence of ctx.hookstate not working. zz.observe('persist', (ctx, next) => { ctx.hookstate = "pass this"; next(); }).catch(err => next(err)); }); zz.observe('after save', (ctx, next) => { console.log(ctx.hookstate); next() }); i don't in console.log(ctx.hookstate) . i'm doing wrong? thanks. you shouldn't overwrite hookstate you can : zz.observe('persist', (ctx, next) => { ctx.hookstate.foo = "pass this"; next(); }); zz.observe('after save', (ctx, next) => { console.log(ctx.hookstate.foo); next() });

compare - Excel Help! 2 worksheets and multiple formulas for comparing data -

i have worksheet 1 need upload database. have worksheet 2 has possible updated information worksheet 1. want compare on worksheet 1 worksheet 2 , if there differences update worksheet 1 info in worksheet 2 , change column in row "update". example have id number in b2 in worksheet 1. want see if matches id number in worksheet 2 anywhere in column b. if want check address in worksheet 1 s2 , compare same id address in worksheet 2 in column s. if match nothing, if different update worksheet 1 (s2) address in worksheet 2 , change worksheet a2 "update". now first step if can me might able figure out rest. i need check other columns make sure match , if not same stuff mention above. if show me how combine multiple checks same formula great. example check address , county name (worksheet 1 x2, worksheet 2 x:x) , check age (worksheet 1 af2, worksheet 2 af:af) i have been working on week , have made no progress. appreciated. thanks!

Issue in adding/displaying multi-dimensional char array in C -

i having difficulty in adding , displaying values in multi-dimensional char array. accepting number of days , various expense amount user , wish add them in char array.. daywise[day_1][total_expense_on_that_day]; here code wrote, kindly tell me went wrong. char daywise[days_count][opening_bal_bk][15]; // multidimensional array printf("\nnumber of days: %d\n", days_count); for(i = 1; <= days_count; i++) { printf("\n\t"); printf("\nopening balance day %d is: %d", i, opening_bal_bk); printf("\n\t"); printf("day %d \n\t", i); printf("---------------"); printf("\n\tfood: "); food_amount = num_valid(); while(food_amount > opening_bal_bk) { printf("food amount exceeding balance,enter again!"); printf("\n\tfood: "); food_amount = num_valid(); } opening_bal_bk -= food_amount; printf("\n\ttravel: "); trave

ms access - Change a tab's caption from the subform which sits on it -

i have form (frmcampaigndetails) tabcontrol on it. it's campaign scheduling tool marketing company. tab control called tabjobs , has 5 pages, pgeemail, pgedisplay, pgekeywords, pgetextlinks , pgesms. on each 1 subform, frmemailjobs, frmdisplayjobs, etc. lists different jobs part of campaign. when each 1 load, checks how many records in each recordset , puts value in text box control (for example if there 3 emails listed return '3' in variable intcount , insert box). the next step need rename caption of tab it's on, pgeemail has caption 'email(3)'. i've been round houses using code like frmcampaigndetails!tabjobs.pages("pgeemail").caption = "email (" & intcount & ")" but can't find tabcontrol refer - 'object required' error messages. know of way? your syntax valid, except missing initial forms! reference. forms!frmcampaigndetails!tabjobs.pages("pgeemail").caption = "email

python - What am I doing wrong here? IF and Else statement -

my goal here read through bunch of rows in records. if second column of record (row[1]) equal 133 in example prints out first , second column. i running issue though: line 11 - else: issue import sqlite3 conn = sqlite3.connect('db.sqlite') print "opened database successfully"; cur = conn.execute("select * sightings") row = cur.fetchone() while row not none: if row[1] == 133: print row[0], row[1] else: row = cur.fetchone(): cur.close() conn.close() you have colon @ end of statement not need if row[1] == 133: print row[0], row[1] else: row = cur.fetchone(): <---- should be.. if row[1] == 133: print row[0], row[1] else: row = cur.fetchone()

oracle - PL/SQL --next date based on Frequency -

i looking oracle function or procedure calculate next date based on input date , frequency(yearly,half yearly, quarterly ) . for example input date frequency next occurrence date 1-jan-2016 quarterly 1-apr-2016 1-jan-2016 yearly 1-jan-2017 look @ oracle function add_months( date, number_months ) monthly, quarterly, yearly results. for example, next quarter 3 months. if input date first quarter use: add_months( 01-jan-2016, 3 ) to next quarter. example sql: select to_date('01-jan-2016', 'dd-mon-yyyy') "input date", 'quarterly' "frequency", add_months(to_date('01-jan-2016', 'dd-mon-yyyy'), 3) "next occurrence date" dual union select to_date('01-jan-2016', 'dd-mon-yyyy') "input date", 'yearly' "frequency", add_months(to_date('01-jan-2016', 'dd-mon-yyyy'), 12) "next occurr

formatting - Conditionally coloring a cell in htmlTable for R -

Image
i'm using excellent htmltable package printing results in rmarkdown. 1 of tables shows values between 0 1. have generated vector of 100 colors interpolated between white (#ffffff) , red (#ff5555) i'd match each cell's background depending on it's value. the logical part clear me (multiply cell's value 100, round , extract color corresponding index of color vector). what i'm not sure is, having matched color each cell, how make htmltable paint it? thanks! i think can using rgb colors like: paste0("background-color:rgb(255, ",value*255," , ",value*255 ," )" where value cell value 0 1 example( 0 red,1 white) df = as.data.frame(matrix(round(runif(15, 0, 1), 1),ncol = 3 )) htmltable::htmltable(df,css.cell=apply(df,c(1,2),function(i)paste0("background-color:rgb(255, ",round(i*255,0)," , ",round(i*255,0) ," )")))