Posts

Showing posts from August, 2013

Get current RotationAngle while Animation is running on Android -

i'm rotating imageview using animation defined xml file. <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareinterpolator="false" > <rotate android:interpolator="@android:anim/linear_interpolator" android:pivotx="50%" android:pivoty="50%" android:fromdegrees="0" android:todegrees="90" android:fillafter="true" /> </set> although imageview has getrotation() method , returns first value has been set image object. is there anyway current rotation degrees using xml animation ? if not, should best way go it? public class customimageview extends imageview { private objectanimator rotationanimator; public customimageview(context context) { super(context); } public customimageview(context con

javascript - Can I use a ternary operator with angularjs outside of the class attribute? -

i'm looping through json object angularjs, , having trouble dealing nulls. i'm new angular. <a href="#" data-mycustom="{{product.related}}">...</a> in event of related being null: { "related":null } i want put "-1" in place: <a href="#" data-mycustom="-1">...</a> tried ternary operator isn't evaluating... it's displaying plain text. simply use ng-attr add custom attribute after evaluation of {{}} interpolation directive markup <a href="#" ng-attr-data-mycustom="{{product.related || '-1' }}">...</a>

NetSuite Email - Payments -

does know if possible email link receive credit card payment though netsuite? scenario: when email of invoice sent, link netsuite form client pay invoice sent. without having login, client can click link , make payment (or send cc info process with). thanks in advance, alexis i think can externally available suitelet. can customize link in email include internal id of invoice. when customer clicks on link, suitelet create form can enter payment information. script internal id of invoice url parameter , save info provided customer.

wpf - How to make new Applacation Settings in code -

i'm learning how save values applacation setting on vb.net wpf app. easy way create new settings in code. not change old ones, create new ones. i'm making note taking program employer guy take lots of notes every day. need save notes somwhere. maybe xml file isn't idea let me know. thanks if requirement store notes, easier use microsoft onenote comes ms office. has free version hotmail, live, msn, outlook accounts. if can store 15gb of data. can use device, windows, ipad, android etc.

Is the a way to force Spark Aggregate / Reduce to "bubble-up"? -

i tried both aggregate , reduce in spark produce large datasets. noticed part of reduction executed in driver . according mllib blog, have managed implement bubbling , ie. once workers have reduced each task / partition move reduction phase subset of workers until delegated driver. in use case, have 580 partitions don't have many entries in common, ie. each partition size 2gb partitions aggregated 2gbs. driver delegating reduction of partitions driver oome. have missed api call can or best way force behaviours applying incremental repartitioning ? tnx i think looking rdd.treeaggregate applies reducer in multi-leveled way, reducing amount of data passed driver final reduction. it has been moved mllib spark core on spark 1.3.0. see spark-5430

java - Threaded quicksort -

hello i've never tried using threads before, first attempt doesn't stop, normal verion works. if remove awaittermination looks works need method finish when it's sorted out(pun intended xd). can tell me did wrong? thank you. public class sorting { private sorting() {}; private static random r = new random(); private static int cores = runtime.getruntime().availableprocessors(); private static executorservice executor = executors.newfixedthreadpool(cores); public static void qsortp(int[] a) { qsortparallelo(a, 0, a.length - 1); } private static void qsortparallelo(int[] a, int first, int last) { while (first < last) { int p = first + r.nextint(last - first + 1); int px = a[p]; int = first, j = last; { while (a[i] < px) i++; while (a[j] > px) j--; if (i <= j) { scambia(a, i++, j--); } } while (i <= j); executor.submit(new qsortthread

linux - Git push to master repo then send the dist folder to a specific path(/www/site/v0.0.1)? -

so goal push project core repo, development files live, backup purposes. then want send dist folder directory www/site.com/v0.0.1 , demonstration purposes, no development files needed, cause bloat because have multiple directories. so have right .gitignore ignores pretty dist . i ran git rm -r --cache , pushing dist , pitfall cant core repo, in case local environment destroyed, have compiled code, , not reverse engineering that. #!/bin/sh currentversion=git describe --abbrev=0 mkdir /var/www/example.com/public_html/projects/$currentversion git --work-tree=/var/www/example.com/public_html/projects/$currentversion --git-dir=/var/repo/cool.git checkout -f i can think of 2 situations two remote repos (core.git, demos.git), git add remote <ssh-repo/core.git & demos.git> , pitfall .gitignore how supposed specify repo uses ignores? 2 repos kind of sucks. inside bash script write enables me ignore files, add worktree, or possibly use linux command take dist

ios - NSSecureCoding in Swift (Facebook SDK) -

i trying translate objective-c piece of code swift code. objective-c: #import "sucacheitem.h" #define sucacheitem_token_key @"token" #define sucacheitem_profile_key @"profile" @implementation sucacheitem + (bool)supportssecurecoding { return yes; } - (id)initwithcoder:(nscoder *)adecoder { sucacheitem *item = [[sucacheitem alloc] init]; item.profile = [adecoder decodeobjectofclass:[fbsdkprofile class] forkey:sucacheitem_profile_key]; item.token = [adecoder decodeobjectofclass:[fbsdkaccesstoken class] forkey:sucacheitem_token_key]; return item; } - (void)encodewithcoder:(nscoder *)acoder { [acoder encodeobject:self.profile forkey:sucacheitem_profile_key]; [acoder encodeobject:self.token forkey:sucacheitem_token_key]; } @end i translated piece of code this: class cacheitem: nsobject, nssecurecoding { let cacheitem_token_key = "token" let cacheitem_profile_key = "profile" var profile: anyobject var token: anyobject fu

swift - User Class Design -

i new design patterns, in need of determining way of designing specific part of ios app working on. i have user object, represents user logged in. simple, , looks this: class user { var firstname: string var lastname: string var photo: string //must stored string filename. var listofjoinedopportunities = [opportunity]() var listofjoinedopportunitieskeys = [string]() var listoffriendsontheapp: nsarray var bio: string var email: string var userid: string //a unique id used persist data user database (firebase). init(firstname: string, lastname: string, photo: string, email:string, userid: string, joinedevents: [opportunity],joinedstrings: [string]){ self.firstname = firstname self.lastname = lastname self.photo = photo self.listofjoinedopportunities = joinedevents self.listoffriendsontheapp = [] self.listofjoinedopportunitieskeys = [] self.bio = "" self.email = email self.userid = userid }

javascript - jQuery .each() won't iterate independently -

i'm using following piece of jquery apply span styles currency symbol , decimals of bunch of monetary values. $('td.pricebox').each(function() { $(this).html('<span class="price_currency price_element">' + $(this).html().substr(0, 1) // styles currency unit + "</span>" + $(this).html().substr(1, $(this).html().length-3) // leaves rounded value + '<span class="price_cents price_element">' + $(this).html().substr(-2) + "</span>") // styles decimals }); this code works first value on page, e.g. "$180.65," copies value , replaces every value on page "$180.65". what doing wrong? how can iterate independently each td.pricebox ? note: contents of td.pricebox generated dynamically , don't have access them. cannot write spans inline. edit: had script designed remove decimal $('.bannercontent td').html($('.bannercontent td').html

Logging in Java, file not create -

i want perform logging. created class, class not create file. this class logging: public class log { private static file logfile = new file("log.txt"); public log() { if (!logfile.exists()) { try { logfile.createnewfile(); } catch (ioexception e) { e.printstacktrace(); } } } public static void write(string msg) { writeinfile(createstring(msg)); } private static string createstring(string msg) { stringbuilder sb = new stringbuilder(100); sb.append(mydate.currentdate()).append("\t| ").append(msg); return sb.append('\n').tostring(); } private static void writeinfile(string msg) { try (bufferedwriter out = new bufferedwriter(new filewriter(logfile, true))) { out.write(msg); out.flush(); } catch (ioexception e) { e.printstacktrace(); } } static class mydate { public static string currentdate() { dateformat formatter = new

android - Read XML from R.xml and not as an XMLPullParser -

i want pass xmls r.xml directory simple library deserialization. the library accepts readers , inputsreams , such. but r.xml xmlpullparser . how can reader or inputstream instead? if save xml fine inside res/raw instead of res/xml , should able use openrawresource getresources().openrawresource(r.raw.xml_name) which returns inputstream

apache - hard links between php files in different directories, what should be the expected behaviour of __FILE__ -

i have 2 websites identical in structure. index.php file needs generate different content depending on domain page being served from. using apache 2.2 , created 2 virtual hosts using 2 different folders under /var/www (/var/www/site.domain.com , /var/www/site.domain.ca) i using file obtain full path of executing index.php , depending on path output correct content. since files same, wanted use links make editing file easier, instead of editing 1 of index.php, copying other directory, wanted editing either of files update other. i used cp -al command copy hard links: cp -al /var/www/site.domain.com /var/www/site.domain.ca the problem when access index.php file in 1 site vs. other, file variable not reflect path of index.php file executing. depending on domain visit first, file reflect path of domain. i try using getcwd see if works, can explain why happening. shouldn't file reflect current script that's executing. these hard links, not soft links. is apac

python - importing parent dir issues -

i created virtualenv foo project , i've problem importing file module in test_file.py this project directory foo/ ├── app │   ├── __init__.py │   ├── testfile.py │   ├── tests │   │   ├── __init__.py │   │   └── test_gram.py │   ├── util │   │   ├── file.py │   │   ├── gram.py │   │   ├── __init__.py └── notes test_gram.py: from app.util.file import loaddatafrompickle listofdict = loaddatafrompickle(".....") = 0 item in listofdict[:50]: print(item) if run test_gram, getting importerror: traceback (most recent call last): file "test_gram.py", line 1, in <module> app.util.file import loaddatafrompickle importerror: no module named 'app what doing wrong? need change virtualenv-path foo/app instead of foo? if test_gram.py in tests folder, import line should be: from ..util.file import loaddatafrompickle$ another option use imp module, suggested instead of appending sys.path ( source here , including python 3 ver

Collate output in Python logging MemoryHandler with SMTPHandler -

i have logging module memoryhandler set queue debug , error messages smtphandler target. want email sent when process errors contains debug statements point (one per line). instead separate email every debug message. this seems should trivial, , part of logging package, can't find it, no examples, nothing on google. log = logging.getlogger() log.setlevel(logging.debug) debug_format = logging.formatter("%(levelname)s @ %(asctime)s in %(filename)s (line %(lineno)d):: %(message)s") # write errors email error_mail_subject = "error: script error in %s on %s" % (sys.argv[0], os.uname()[1]) error_mail_handler = logging.handlers.smtphandler(smtp_host, 'errors@'+os.uname()[1], [log_email], error_mail_subject) error_mail_handler.setlevel(logging.error) #error_mail_handler.setlevel(logging.debug) error_mail_handler.setformatter(debug_format) # buffer debug messages can sent error emails memory_handler = logging.handlers.memoryhandler(1024*10, logging.erro

linux - Emacs: scaling down shrinks faces, not line height -

when downsize text in emacs 24.3.1 (ubuntu) e.g. via c-x c--, lines shrink modeline height, while text behaves wanted. makes minimap unusable because number of lines per screen stays constant, adding white space. problem? thank you!

jquery - Javascript DataSet -

function fetchjobs() { var seq_id = 2; var dataset = [{"seq_id":"1","counter":"20"},{"seq_id":"2","counter":21"}] } may ask how value 21 if seq_id 2 , if seq id 1, want value 20, counter value how value of counter: based on value of seq_id: i can think of 3 options: a traditional loop on dataset collection. check each element loop , break once find value. use array.findindex if available, or use polyfill mdn's documentation. try linq javascript (definitely overkill if need for).

Parsing through PHP, echo not working -

i'm trying parse html php document upload web host. when try (with last echo in there see if works): <?php //a url want retrieve $my_url = 'http://pointstreak.com/prostats/standings.html?leagueid=49&seasonid=12983'; $html = file_get_contents($my_url); $dom = new domdocument(); $dom->loadhtml($html); $xpath = new domxpath($dom); //put xpath query here $my_xpath_query = "//div[@id='statscontainer']/table/tr/td/table[@class='tablelines']/tr/td"; $result_rows = $xpath->query($my_xpath_query); // create array hold content of nodes $standingsarray = array(); //here loop through our results (a domdocument object) foreach ($result_rows $result_object){ $standingsarray[] = $result_object->childnodes->item(0)->nodevalue; } // remove first 12 observations $standingsarray (table headers) ($i = 0; $i < 12; $i++) { unset($standingsarray[0]); $standingsarray = array_values($results_rows); } // remove 12 observations

mysql - PHP - Constructing a class with PDO - Warning: Missing argument -

i have following select statement constructing user object: $stmt = $conn->prepare("select user.user_id, user.user_name user"); $stmt->execute(); $stmt->setfetchmode(pdo::fetch_class| pdo::fetch_props_late,'user'); i have following class in separate file, included - require "user.php": class user { private $user_id; private $user_name; public function __construct($user_id, $user_name) { $this->user_id = $user_id; $this->user_name =$user_name; } i following warnings , notices - warning: missing argument 1 user::__construct() notice: undefined variable: user_id it works fine turned on warnings etc tidying code. i have looked @ other questions on here solutions don't seem , thought fresh pair of eyes help. thought had should have been passing array in setfetchmode() documentation states still seems cause issues. what correct way create class in pdo? if use arguments user constructor,

jquery - Displaying input character limit inside of the input? -

Image
i have set character limit function displays how many more characters input accept. move output within input , floated right, seen below. best way accomplish this? example: <input name="name" placeholder="name" maxlength="120" /> <div class="remaining"></div> function characterlimit() { var remaining = 120 - $('input').val().length; $('.remaining').text(remaining); } characterlimit(); $('input').keyup(function() { characterlimit(); }); fiddle it's done killing original borders on input , make fake border(wrapper div) surrounds input , number. here example comment http://jsfiddle.net/9q319a4c/2/ <div class="input"> <input name="name" placeholder="name" /> <span class="remaining"></span> </div> css input { border: none; } .input { border: 1px solid #ccc; float: left; }

c# - Forestall duplicated columns when add TypeDescriptor Provider's -

Image
i'm trying add typedescriptor provider class use how datasource in datagridview, code: private void frmtarifadovariantes_load(object sender, eventargs e) { system.componentmodel.typedescriptor.addprovider((new mytypedescriptionprovider<tarifadovariantebe>()), typeof(tarifadobloquesbe)); system.componentmodel.typedescriptor.addprovider((new mytypedescriptionprovider<bloqueprendabe>()), typeof(tarifadobloquesbe)); } question 1: first time good, when closed form , open again, data provider descriptor twice columns , tried remove first providers , add again, doesn't work. there mytypedescriptionprovider, found searching on web: public class mytypedescriptionprovider<t> : typedescriptionprovider { private icustomtypedescriptor td; public mytypedescriptionprovider() : this(typedescriptor.getprovider(typeof(tarifadobloquesbe))) { } public mytypedescriptionprovider(typedescriptionprovider parent)

indentation - Disable autoindent in vim -

i use vim since 20 years , told me usage of = key indenting block of code. try new vim key stop using because isn't doing want or don't need feature. in case find nice feature. so downloaded vim script 1120 (php-correct-indenting) , installed it. .vimrc contains: filetype indent on set smartindent now can use = indent visually marked code block. but not want vim automatically indent code while typing. irritating me doing indentation myself , used ... so how can stop vim automatically indenting code while typing can still continue use = indenting visually marked block of text. ps: use hjkl moving around in vim. make 1.5 times faster :) my complete vimrc: syntax on set tabstop=3 set shiftwidth=3 execute pathogen#infect() filetype indent on set smartindent commenting last 2 lines stops autoindenting using "=" not use mentioned vim script anymore the plugin sets 'indentexpr' , controls both explicit reindenting via = indenting-a

c# 4.0 - Async calls in c# -

when execute code developed call async method of linq2twitter, getting system.aggregate exception, code below: static async task<list<mytwitterstatus>> getretweets(ulong tweetid, twittercontext twitterctx) { list<mytwitterstatus> retweets = new list<mytwitterstatus>(); var publictweets = await (from tweet in twitterctx.status tweet.type == statustype.retweets && tweet.id == tweetid select tweet) .tolistasync(); if (publictweets != null) publictweets.foreach(tweet => { if (tweet != null && tweet.user != null) { mytwitterstatus tempstatus = new mytwitterstatus(); tempstatus.country = tweet.place.country; tempstatus.createdat = tweet.createdat; tempstatus.favoritecount = long.parse(tweet.favoritecount.tostring()); tempstatus.id = tweet.id;

jsf - How to obtain the Date value from a p:calendar component in JavaScript? -

i don't know how obtain date value of <p:calendar> in primefaces component using javascript this component <p:calendar id="calendarinicio" widgetvar="horainiciospin" value="#{hbean.horainicial}" timeonly="true" pattern="hh:mm" required="true"/> i need obtain hour value of component because i'm gonna send value other <p:calendar> component, using javascript . can give me idea? in advance... primefaces provides powerful client side api. make use of it! add widgetname calendar. way way easier handle component on client side <p:calendar widgetvar="mycalendar" ... /> write custom js, using primefaces client side api <h:form> <p:calendar widgetvar="mycal1" timeonly="true" /> <p:calendar widgetvar="mycal2" timeonly="true" /> <p:commandbutton on

python - not all arguments converted during string formatting for select -

i can not select database have error: not arguments converted during string formatting my script is: bo=str(mac) cur.execute("""select * devices mac= %s """,bo) you need add % in front of bo, this: bo=str(mac) cur.execute("""select * devices mac= %s """, %bo)

automation - Export links, defects and test results from Excel to QC -

i have question hpqc. have excel add-in doesn't seem can export links between defects , test cases. there way export links between defects , test cases excel? also, know if can export pass/fail status of test cases using add in? if not, i'm not coder colleague. possible bypass add-in , load data code instead? excel add-in not support uploading test results qc excel. excel add-in can used upload tests, requirement , defects. you have write own code using open test architecture (ota) api's upload test results qc. can bypass add-in if have own code upload test results. ota api documentation available in qc documentation library.

To update or not to update Tango tablet -

i running in corporate environment without wifi, don't ota updates unless bring device home. after reading problems onframeavailable() callbacks in past month became skeptical of doing updating time being. have @ least 1 update available, have declined. device running: project tango core: 1.10:2015.03.27-kalman-release-0... build number: kot49h.150309 image frame format: rgba so question is, should update? or should bury head in sand while , wait? a related question (that maybe should posted separately) is, how many more times image format change? should code though format change every new release? format listed in release notes? (it new leibniz, yuv420sp. wasn't either jacobi or kelvin when switched rgba.) you should able update safely l or m, though have change yuv420sp (nv21) if using rgb before. there issue k release resulted in image buffer not being filled out properly. that's source of concern you've seen on internet. however, i'm s

ubuntu - Deja Dup: Backup folder from the network -

i know it's possible save backups on remote location, can backup remote location? have server data , pc, keep backups, on same network. can mount data server on pc, using sshfs , backup mounted folder. want make backups daily , keep backups @ least month. question is, happen if server stops or connection lost? deja dup make backup of empty folder , on next day, when files reachable, make incremental backup, backup of again? server has 300gb of data, has backed up. on first day, 300gb backup made. incremental backups small, 50-80mb day, if connection gets lost there empty backup , on next day 300gb incremental backup. if connection gets lost 5 times month, means there 1.5tb of useless incremental backups. deja-dup based on duplicity in turn encrypted backup of local files/folders local or remote storages. so, no, cannot. however, has been reported duplicity worked flawlessly fuse based or similar ways mount remote file systems locally, local software can access "

javascript - iFrame not loading in Chrome unless window is resized -

i have web page below has invoice numbers on left side , when user clicks on it, details loaded in iframe(id='invoiceframe') works fine in ie in chrome iframe not loaded unless window resized google chrome version 42.0.2311.90 (official build) m (32-bit) <script type="text/javascript"> function geturlparameter(url, param){ var paramtokens = url.slice(url.indexof('?') + 1).split('&'); (var = 0; < paramtokens.length; i++) { var urlparams = paramtokens[i].split('='); if (urlparams[0].endswith(param)) { return urlparams[1]; } } } string.prototype.endswith = function(pattern) { var d = this.length - pattern.length; return d >= 0 && this.lastindexof(pattern) === d; }; function resizeiframe(obj) { obj.style.height = obj.contentwindow.document.body.scrollheight + 'px'; } jquery(document).ready(function () { jquery("#mainframe&quo

input - haskell hGetLines implementation -

does know can find the hgetline :: handle -> io text function implementation? have implement http server in haskell has multiple subtasks. first 1 write implementation of hgetlines :: handle -> io [text] function reads io channel until first empty line , lines returned list of text. you don't need know how hgetline implemented this: hgetlines :: handle -> io [text] hgetlines h = line <- hgetline h if null line return [] else lines <- hgetlines h return (line:lines)

java - How to use <foreach> statement in @SelectProvider class with MyBatis3 -

i trying use @selectprovider create dynamic sql including use of tag foreach in clause. know how use using @select annotation mapper. the problem when translate sql sqlprovider seem use of tag directly not processed proxy invoke sqlprovider method sql. here code example using @select : // imports... public interface mymapper { @select({"<script>", "select col_1, col_2", "from table_1", "where col_3 in", "<foreach item='item' index='index' collection='items'", "open='(' separator=',' close=')'>", "#{item}", "</foreach>", "</script>"}) hashmap<string, object> select(@param("items") string[] items); } the code above works, when try use @selectprovider doesn't works. this code when use @selectpro

php - curl_exec return an XMLFault from Paypal REST Api -

i'm using paypal rest api mobile app. here's code : $paymentdatas = array( "intent" => "sale", "redirect_urls" => array( "return_url" => "http://example.com/your_redirect_url/", "cancel_url" => "http://example.com/your_cancel_url/" ), "payer" => array("payment_method" => "paypal"), "transactions" => array( "transactions" => array( "total" => ".99", "currency" => "usd" ) ) ); $paymenturl = 'https://api.sandbox.paypal.com/v1/payments/payment'; $initcurl = curl_init(); curl_setopt_array( $initcurl, array( curlopt_url => $paymenturl, curlopt_timeout => $timeout, curlopt_returntransfer => true, curlopt_ssl_verifypeer => false, //todo: testing purpose, need tp r

how to decode android xml or reverse Engineering of XML -

here problem loss android projects.i have apk in mobile. have got java files not xml files. when extract apk resource , layouts files layouts files encrypted utf-8. tell me how decode android xml files. <?xml version="1.0" encoding="utf-8"?> <gridview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gridview1" android:numcolumns="2" android:gravity="center" android:verticalspacing="5dp" android:horizontalspacing="5dp" android:layout_width="wrap_content" android:layout_height="wrap_content"> </gridview> solution androidguard . get apk, extract content. you'll xmls, unreadable. then use androaxml.py decode them original xmls (some styles , references lost but hey that's better nothing guess ). use unreadable xml input.

node.js - Starting KeystoneJS fail -

i try set first project using keystonejs when try use "node keystone" receive following error. can explain me why that? mongo error: [error: failed connect [localhost:27017]] /users/marius/desktop/doner/node_modules/keystone/lib/core/mount.js:606 throw new error('keystonejs (' + keystone.get('name') + ') failed start' ^ error: keystonejs (doner) failed start @ nativeconnection.<anonymous> (/users/marius/desktop/doner/node_modules/keystone/lib/core/mount.js:606:10) @ nativeconnection.emit (events.js:107:17) @ nativeconnection.connection.error (/users/marius/desktop/doner/node_modules/keystone/node_modules/mongoose/lib/connection.js:389:8) @ /users/marius/desktop/doner/node_modules/keystone/node_modules/mongoose/lib/connection.js:416:14 @ /users/marius/desktop/doner/node_modules/keystone/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js:57:21 @ /users/marius/desktop/done

java - How to version my API with Spring MVC? -

for now, urls of api example: /api/users with spring mvc: @requestmapping("/api/users") i version api: /api-v1.0/users the best able use spel in @requestmapping annotation, it unfortunately not possible : @requestmapping("/api-#{appprops['version']}/users") what other options then? @requestmapping resolves property place holder values. define propertysourcesplaceholderconfigurer below. <context:property-placeholder location="classpath*:*.properties"/> then use syntax below. @requestmapping("/api-${version}/users")

javascript - Downloading file to "/public" directory using Meteor/Cordova iOS -

i'm building ios app similar lynda.com app allows download videos device offline viewing. i can't seem figure out how download , access files public directory. i'm using org.cordova.apache.file , org.cordova.apache.file-system download files device, meteor cannot access them. thought maybe if these files download "/public" directory, i'd have more luck. the problem i'm having whenever meteor run ios-device the "version" property of object meteor.connection._mongo_livedata_collections.meteor_autoupdate_clientversions._docs._map['version-cordova'].version gets updated. i need property append directory path when console.log cordova.file.datadirectory. property shows undefined when try use in variable. can see when console.log can't use in var. is meteor.connection._mongo_livedata_collections.meteor_autoupdate_clientversions._docs._map['version-cordova'].version a private/protected variable? how can a

osx - Set umask when mounting USB on Mac -

i have aegis secure key want mount on mac specific umask (077). on linux add line in /etc/fstab: /dev/disk/by-id/usb-apricorn_secure_ke /media/securekey vfat uid=foo,gid=bar,rw,user,noauto,umask=0077 0 0 this doesn't appear work on mac. suggestions? thanks! finally figured out. first had use disk utility figure out uuid (select device, click on info). added line /etc/fstab (using vifs edit fstab): uuid=fee416ce-8fb7-30dc-b80e-88138d42ead9 /users/foo/mounts/key msdos noauto,-m=700

PHP: Remove empty values from array, then convert that to a string -

i know how each of these things separately (remove empty values, , convert array comma-separated string) can't them work in combination, , haven't yet been able find way so. know can use print_r display results of filter, that's not helpful because need send resulting string database (that's day). appreciated! i have: $array = array('item1', 'item2', '', 'item4'); //this should filter out empty values (index 3) $filter = array(array_filter($array)); //this should take filtered array , convert comma-separated string $comma_separated = implode(",", $filter); echo $comma_separated; every time try output just: array try way,no need push after filtering array & $orderarray ? $array = array('item1', 'item2', '', 'item4'); $filter=array_filter($array); // see here, didn't add array() $comma_separated = implode(",", $filter); echo $comma_separated; edit: shorter

ios - How do I track failed app downloads from iTunes store -

how track failed app downloads itunes store. there way know user initiated install, failed install app. no. although can't has programming or development tools. it's better ask in apple forum.

How to check if cell is the last one in an Excel column -

this question has answer here: error in finding last used cell in vba 10 answers i populating sheets database results. don't know how many rows result have. want have sheet variable number of rows has like: if(this last row?, sum of previous cells, value) is there formula determining row last one? looking excel formula not vba code. maybe similar lookup or index or offset not aware of. you can try udf: function islastcellinrow(mycell range) boolean if isempty(mycell) exit function if mycell.end(xldown).row = mycell.entirecolumn.rows.count islastcellinrow = true end if end function the function checks if there non-empty cells below given cells , return true of false. you can use udf this: =if(islastcellinrow(sheet1!a1),sum(sheet1!a:a), "whatever")

Makefile variable not set from grep output -

i trying set variable cogline output of grep line (which searching config.json file regexthe "cogs"). when execute grep line correctly outputs proper line number, when echo variable comes blank. cogline = $(grep -n \"cogs\" ~/desktop/repos/pronghorn/config.json | cut -f1 -d:) all: grep -n \"cogs\" ~/desktop/repos/pronghorn/config.json | cut -f1 -d: echo $(cogline) here output: glennmbp:test glenn$ make grep -n \"cogs\" ~/desktop/repos/pronghorn/config.json | cut -f1 -d: 2 echo you can see line number found "2", variable comes blank if not set. doing wrong? grep not make function. cogline = line make assignment. you either need use cogline := $(shell grep -n \"cogs\" ~/desktop/repos/pronghorn/config.json | cut -f1 -d:) if want run @ make parse time , want in make variable. or all: cogline=$$(grep -n \"cogs\" ~/desktop/repos/pronghorn/config.json | cut -f1 -d:); \

Display user ID in the metrics of application Insight -

this page http://azure.microsoft.com/en-us/documentation/articles/app-insights-web-track-usage-custom-events-metrics/#authenticated-users show how have login information in section "authenticated users". but how can see information in application insight after that i not see user anywhere in custom event properties events, seems internal field that's collected not directly exposed in view because of time "auto-collected" user auto-generated guid.... you can take @ users summary on "usage analytics/users" view in metric explorer (just select metrics app users "user accounts"...) you should able search user in diagnostic search if specify user name looking in search - you'll events/traces , on particular user. also, can try submit authenticated user custom property on event instead of (in addition to) embedded property, in case should see if part of properties in ui leads duplication of value inside event (internal +

html - JQuery, scroll to element in different divs -

i know if there anyway in jquery scroll elements inside different divs. example, if go example.com/programme#event-2, div on left should scroll element id="event-2", , div on right should scroll element id="event-2". here's html: <div id="events"> <div id="event-list"> <div class="content"> <h2>vendredi 17 octobre</h2> <ul id="event-1" class="event-title"> list items </ul> <h2>vendredi 21 octobre</h2> <ul id="event-2" class="event-title"> list-items </ul> </div> </div> <div id="event-details"> <div class="content"> <section id="event-1" class="details"> stuff </section>

algorithm - Given an amount of sets with numbers, find a set of numbers not including any of the given -

given amount of sets numbers (0-20 e.g) , asked find maximum set of numbers 0-20 doesn't include of given sets(it can include numbers set,but not whole set) example :setting max number 8 , given sets {1,2} {2,3} {7} {3,4} {5,6,4}, one maximum solution set {1, 3, 5, 6, 8}. thinking of representing graph , inducting max independent set problem, seems work if sets consisted pairs,which doesn't stand.any idea?thanks in advance. use bit map each set, setting appropriate bit. if there less 32 members, can use uint32_t. full set inclusion can computed masking out members (i.e. union of sets) specific bit map, , using xor specific bit map. result 0's if subset, otherwise result member max independent set.

jquery - Adjust Image Path based on Device Retina Ratio -

i'm creating site photographer , i'm creating gallery @ moment. save me lot of code i've automated much, including file name, path, width, lightbox class, etc. in html have write <a> title , jquery takes care of rest. html <a alt="all-my-loving"></a> jquery $(function () { $('.imagescontainer a').each(function () { var $link = $(this), title = $link.attr('alt'), thumb = 'images/portfolio/thumbs/' + title + '.jpg'; $link.attr('data-target', 'flare'); // gallery plugin $link.attr('data-flare-scale', 'fitmax'); // gallery plugin $link.attr('data-flare-thumb', thumb); // gallery plugin $link.attr('data-flare-gallery', 'main'); // gallery plugin $link.addclass('item'); // isotope/packery/masonry $link.attr('href', 'images/por

colors - Is it possible to have a level of indirection in css? -

what have ties placeholder name color can substitute entire color palette without having change css individual elements. there many placeholders same color level of indirection when want try palette or individual color have change master, i.e. placeholders not have change when palette changes. // pseudocode example of level of indirection: // master color pallet blue: dodgerblue /* actual css element placeholder color */ .openbutton { background: blue; /* displays dodgerblue */ } // changing palette blue: skyblue .openbutton { background: blue; /* displays skyblue */ } i should mention i'm doing following requires color treated class not quite indirection i'm looking for. .blue{ color:dodgerblue; } that's not possible css (check out less). i recomend @ start of project, specially if big, have css sheet (as call it) common properties. 1 of common properties add in sheet are, among others, colors (for text , background) going used

android - cocoonjs fail to add webview plus -

i have problem setting cocoon according manual at: http://support.ludei.com/hc/en-us/articles/202568973-first-steps-with-cocoonjs-cli when try do: cocoonjs plugin add com.ludei.webview.plus i error: [cocoonjs] executing command 'plugin add com.ludei.webview.plus' [cocoonjs] installing webview+ in cordova project. [cocoonjs] command `android` failed. add platform-tools/ tools/ directory path environment variable. but have in path: android_home=/home/gerard/adt-bundle-linux-x8664-20140702/sdk path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/gerard/gcc-arm-none-eabi-48-2014q3/bin:$android_home/platform-tools:$android_home/tools this configuration working phonegap, trying switch cocoonjs seems go wrong. can tell me can wrong else path problem?

c# - Console Application Persistent Error does not contain static main method suitable for entry point -

firstly have read on similar questions , have tried everything. @ total loss @ stage. error message follows: error 1 program 'c:\users\epm\desktop\c# work\projects\consoleapplication10\consoleapplication10\obj\x86\debug\consoleapplication10.exe' not contain static 'main' method suitable entry point then notice pops after try run despite build error says: visual studio cannot start debugging because debug target 'c:\users\epm\desktop\c#work\projects\consoleapplication10\consoleapplication10\bin\debug\consoleapplication10.exe' missing. please build project , retry, or set outputpath , assemblyname properties appropriately point @ correct location target assembly. i've spent many hours trying every solution find on internet , grateful if me out. thank you. using system; using system.collections.generic; using system.linq; using system.text; namespace consoleapplication10 { class program { static void main() {

c# - asp.net gridview set null to datasource -

asp.net html: <asp:gridview id="grddynamic" runat="server" allowpaging="true" gridlines="none" pagesize="20" cellspacing="0" alternatingitemstyle-cssclass="rowb renklisatir" cssclass="tumislerimtable" allowsorting="true" autogeneratecolumns="false"> <headerstyle cssclass="rowa" /> </asp:gridview> <asp:imagebutton id="search" runat="server" alternatetext="search" imageurl="../images/search.gif" onclick="search_click"> </asp:imagebutton> if click search button below method works search_click method protected void search_click(object sender, imageclickeventargs e) { datatable nulldatatable = new datatable(); nulldatatable = null; grddynamic.datasource = nulldatatable; // i'm trying clear gridview datasource not worki

java - How to slow down my transition. TransitionManager.beginDelayedTransition(myLayout) is too fast. -

i have method below moves imageview top left corner. works perfectly, going fast. slow down. read on , saw transitionmanager.begindelayedtransition(mylayout) should use slow transition. still extremely fast.how can slow down?? private void moveicon() { view moveableicon = findviewbyid(r.id.imageicon); transitionmanager.begindelayedtransition(mylayout); // change position of icon relativelayout.layoutparams positionrule = new relativelayout.layoutparams( relativelayout.layoutparams.wrap_content , relativelayout.layoutparams.wrap_content); positionrule.addrule(relativelayout.align_parent_top , relativelayout.true); positionrule.addrule(relativelayout.align_parent_left , relativelayout.true); moveableicon.setlayoutparams(positionrule); // change size of button viewgroup.layoutparams sizerules = moveableicon.getlayoutparams(); sizerules.width = 70; sizerules.height = 70; moveableicon.setlayoutparams

java - Using QR and NFC technology together in an Android app -

i developing android app consisting of 2 activites far. first activity (mainactivity) started when app launched or when qr code scanned. mainactivity starts second activity (nfcactivity) when user presses button. nfcactivity waits user tap nfc token, reads out data token, , returns read data mainactivity. this works fine if app started manually. if app started scanning qr code, taping nfc tag not invoke nfcactivity's onnewintent() method exepcted, instead creates new instance of nfcactivity on top of displayed one. the enableforegrounddispatch() method called , flag_activity_single_top should set. relevant source code of minimal example provided below. highly appreciated! mainactivity: public class mainactivity extends activity { private edittext dataread; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_start); dataread = (edittext) findviewbyid(r.i