Posts

Showing posts from January, 2013

csv - PowerShell Shares ACL List -

i have script goes each file of 1 shared drive , lists acls, don't want go far because there millions of files , never finish (ran on day , got csv file on 6 gb). i tried using get-childitem *** doesn't seem work. appreciated. ideally, 2 levels deep nice. thx $erroractionpreference = "continue" $strcomputer = $env:computername $coldrives = get-psdrive -psprovider filesystem #if ($driveletter -eq "n:\") $startpath = "n:" get-childitem $startpath\*\*\ -recurse | foreach { $fullpath = get-item -literalpath (get-item -literalpath $_.pspath) (get-item -literalpath $fullpath).getaccesscontrol() | select * -expand access | select @{n='server name';e={$strcomputer}}, @{n='full path';e={$fullpath}}, @{n='type';e={if($fullpath.psiscontainer -eq $true) {'d'} else {'f'}}}, @{n='owner';e={$_.owner}}, @{n=

android - Why do I need to add the configuration file to my project to setup gcm correctly? -

https://developers.google.com/cloud-messaging/android/client i've read article. , says need download , add configuration file project. not explain, why should this? won't work without adding configuration file? i working on multiple gcm-projects still using eclipse, eclipse-adt-plugin , old project structure , did not include config-file projects. confused @ beginning , hence tried in android-studio project using gradle config file not necessary either. so rémond´s answer might make sense me working fine (including generating instanceid-token , topic-messaging working). so in fact, should work without adding file , not need file anyway.

java - Run my integration tests with a different *.properties file using Spring 4.0.6.RELEASE -

i using spring 4.0.6.release , have following spring configuration file: @configuration @propertysource({"classpath:config.properties"}) public class myserviceconfig { ... i wondering if there way run integration tests component-annotated-classes different properties file (let's test-config.properties ) in order give different values value , autowired annotated properties , methods. note: know spring 4.1.x comes @testpropertysource helps achieve it. upgrading spring later versions not option. yes. specify "profile" integration tests. @configuration @propertysource({"classpath:test-config.properties"}) @profile("integration-test") public class myservicetestconfig { ... in order use profile when testing repository use @activeprofiles annotation @activeprofiles("integration-test") @runwith(springjunit4classrunner.class) public class myrepositorytest { ...

azure - Where is located the ServiceDefinition.csdef file? -

i'm following tutorial https://msdn.microsoft.com/en-us/library/azure/gg433110.aspx configure web role multiple web sites, in tutorial should open servicedefinition.csdef file, not know file located, route find file? use visual studio create file (and other necessary files project) prior configure web role: 1) install sdk chosen language. http://azure.microsoft.com/pt-br/downloads/ 2) in visual studo, create new cloud project 3) add roles want use, ie. website, add web role. if don't want use visual studio, can create standard cloud service project using powershell cmdlet. layer goes above web project. new-azureserviceproject https://msdn.microsoft.com/en-us/library/azure/dn495188.aspx

hadoop - Clean AWS EMR to allow reuse -

i have several task i'm preforming on aws emrs don't share data , use same emr perform them 1 after another. there way clean running emr initial state (remove hive tables, clean hdfs files etc.) avoid collision of data? i want reuse emr several reasons: creation of new emr can take 5-10 minutes. my task relative shorts, 20-25 minutes. once emr created paying full hour. we didn't find "quick , clean" api achieve behaviour. instead consolidate simple work methodology promise can clean data. we work on specific db instead of default one. we put our internal data files under specific location in hdfs. so every time task started, first delete specific db if exists , recreate , recursively delete data under specific location in hdfs.

javascript - How to inject $dialog into existing angularjs page controller -

i want create simple pop-up dialog in angularjs using bootstrap-ui's $dialog directive. i $dialog undefined, when try inject controller. can provide hint on "how inject $dialog" following design , invoke create pop-up dialog? thanks in advance index.js: angular.module('myapp', ['myapp.core','myapp.templates','ui.router', 'ui.bootstrap', 'angularchart', 'angularjs-dropdown-multiselect', 'smart-table', 'angularmodalservice']); page controller: (function() { 'use strict'; angular.module('myapp').controller('page3controller', page3controller); function page3controller( $scope, $dialog, // undefined page3service, utility) { as accepted answer of this post says, $dialog service refactored $modal version 0.6.0 of ui-bootstrap . functionality $dialog should still available, through $modal instead. inject $modal service within mo

Route all traffic with iptables to external proxy -

i route http/https/other ports traffic coming pc1 pc2, pc2 should route external proxy able set @ pc2. my current config is: pc1 (eth0 / 192.168.0.1, gateway: 192.168.0.2) -> pc2 (eth0 / 192.168.0.2) pc2 has nics, eth0 , eth1. eth1 wan connection. in summary, eth1 @pc2 should able route incoming traffic eth0 proxy server. what i've tried: sysctl -w net.ipv4.conf.all.forwarding=1 -a forward -i eth0 -o eth1 -j accept -a forward -i eth1 -o eth0 -j accept iptables -t nat -a output -p tcp -o eth1 --dport 80 -j dnat --to proxy:3128 i'm able ping pc2, unfortunately already. i'm new iptables, help. there guide s etting transparent proxy squid seems might have useful information. seems have different methods adapted solve problem. most os distributions have guides , tutorials using iptables , routing particular semantics os of choice. have used guides ubuntu help , centos in past , helpful when first learning use iptables.

AngularJS ui-select: option not added when typed fully -

i using angular ui-select , want allow user select option using auto-complete, allow them type in custom options. i've configured control tagging enabled , no tagging labels follows: <ui-select multiple tagging tagging-label="false" ng-model="colors" theme="bootstrap" style="width: 300px;" title="choose color"> <ui-select-match placeholder="select colors...">{{$item}}</ui-select-match> <ui-select-choices repeat="color in availablecolors | filter:$select.search"> {{color}} </ui-select-choices> </ui-select> here's example plunkr: http://plnkr.co/edit/yw7wlozcds1xios6usns?p=preview the problem when type in word exists in available colors , press enter, option not become selected. in plunkr, can see if type blue , press enter. where going wrong? this appears known bug related using tagging-label="false" . works correctly when re

javascript - Change table's column color through depending on select -

i have table 3 columns , want change it's color green depending on select on checklist (form). i want change in green column depending on city choose. example if choose new york, column new york become green. ideas? html - table: <table id="mytable"> <tr class="head"> <th></th> <th>new york</th> <th>chicago</th> <th>san francisco</th> </tr> <tr> <th>a poetic perspective</th> <td>sat, 4 feb 2012<br />11am - 2pm</td> <td>sat, 3 mar 2012<br />11am - 2pm</td> <td>sat, 17 mar 2012<br />11am - 2pm</td> </tr> <tr class="even"> <th>walt whitman @ war</th> <td>sat, 7 apr 2012<br />11am - 1pm</td> <td>sat, 5 may 2012<br />11am - 1pm</td> <t

Omnet++/INET framework: how to set and use UDP simulated applications -

in our simulation trying simulate lisp mobile protocol inet framework 1 mobile node , 1 fixed node (a correspondent node not mobile) exchanging udp packets. that's why decided use udpbasicapp simulated application , gave both nodes. the problem see no udp packet generated , initialize() method inside udpbasicapp called more once. this because addresses array inside class empty , returns without scheduling new events. the problem how know ip addresses of nodes can write them inside .ini file. know how? it totally ok use module names in destaddress parameter (instead of ip adresses). inet can resolve domain names resolved in real life. if want configure hosta send data hostb, use: *.hosta.udpapp[0].destaddresses = "hostb"

radgrid - telerik GridEditCommandColumn + pass row index to another page -

i have web form, mypage.aspx , use radgrid bind data entity data model using linq entities query. in radgrid have 2 columns data entities model , "edit" column ( telerik:grideditcommandcolumn ). when click on edit want pass id specific record in new page, mydetailspage.aspx . in page want edit specific row , save record. want pass id query string mypage.aspx mydetailspage.aspx . need pass id in linq entities query in mydetailspage.aspx in order retrieve data. in mydetailspage.aspx page have 2 textbox web server controls need bind values columns "systemname" , "title" mypage.aspx . thanks <mastertableview editmode="editforms" allowfilteringbycolumn="false" allowsorting="false" datakeynames="id" autogeneratecolumns="false"> <columns> <telerik:gridboundcolumn datafield="systemname"

python: Convert from PNG to JPG without saving file to disk using PIL -

in program need convert .png file .jpg file don't want save file disk. use >>> pil import imag >>> ima=image.open("img.png") >>> ima.save("ima.jpg") but saves file disk. dont want save disk have converted .jpg object. how can it? you can trying using bytesio io: from io import bytesio def converttojpeg(im): bytesio() f: im.save(f, format='jpeg') return f.getvalue()

java - How and when is a JCO connection closed in version 3.xx? -

in older versions of jco (2.xx), connections handled directly: developer needed create connection , close it. intuititve. with newer versions there's no closing connection method, getdestination methods. i wondering: how , when established connection closed? scn: http://scn.sap.com/thread/3770683

javascript - Order of execution of functions in functional programming -

since past 6 months, started learn concepts of functional programming. while reading many sources, 1 of things found in functional programming, order of execution undefined! don't understand this. from other stack overflow answer: https://stackoverflow.com/a/23290/1276021 , "a functional language" (ideally) allows write "mathematical function". but, in mathematical functions, f(g(x)) !== g(f(x)) - meaning, order of execution matter. it seems wrong in understanding concept "order of execution undefined". wrong? f(g(x)) !== g(f(x)) - meaning, order of execution matter. no, different expressions/programs, not different order of execution. it seems wrong in understanding concept "order of execution undefined" the correct, more verbose statement " the order of evaluation of parts of expression irrelevant " (and lead same result). means such functional language has no side effects , referential transp

osx - Mac Access Issues over VPN -

i can access sites when using browser, when inside mac application "operation timed out" over vpn . is companies firewall issue or local dns settings issue? have been going , forth our admin team on this. same firewall roles windows users able run things smoothly. few examples.. mac terminal himalay$ git clone https://github.com/spring-guides/gs-consuming-rest.git cloning 'gs-consuming-rest'... fatal: unable access 'https://github.com/spring-guides/gs-consuming-rest.git/': failed connect github.com port 443: operation timed out ide/intellij/sts caused by: org.springframework.web.client.resourceaccessexception: i/o error on request "http://gturnquist-quoters.cfapps.io/api/random":operation timed out; nested exception java.net.connectexception: operation timed out @ sun.net.www.http.httpclient.<init>(httpclient.java:211) @ org.springframework.web.client.resttemplate.doexecute(resttemplate.java:580) @ org.springframewo

python - sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 2754 supplied -

this question has answer here: sqlite3.programmingerror: incorrect number of bindings supplied. current statement uses 1, , there 74 supplied 1 answer table c.execute("create table project ( id integer primary key autoincrement, content text, postdate timestamp not null default current_timestamp) ") te = "testing" c.execute("insert project (content) values (?)", (te)) error sqlite3.programmingerror: incorrect number of bindings supplied. current statement uses 1, , there 7 supplied. try change into: c.execute("insert project (content) values (?)", (te,)) (with comma after te). because (te) without comma not tuple, , have pass parameters in tuple. if have 1 element, have tell python tuple inserting final comma.

java - HSQLDB with multiple backing csv files -

i need bind group of csv file in format "yyyy-mm-dd hh:mm:ss.csv" present in same folder unique table contains data present in files. i found how bind 1 file not how bind multiple files, example reading here or here couldn't find multiple backing files. you cannot bind multiple files 1 table. options text tables documented here: http://hsqldb.org/doc/2.0/guide/texttables-chapt.html you can use separate tables. file names can change, can write java code periodically list files in directory , link text tables more recent files. see set table t source ... statement.

Scala - proper way to print a string to file -

what proper way print string - , string - file? when try standard way known me, i.e: def printtofile(o:object,n:string) = try{ val pathtooutput = "..\\some\\parent\\directory\\" val path = paths.get(pathtooutput + n) val b = new bytearrayoutputstream() val os = new objectoutputstream(b) os.writeobject(o) files.write(path, b.tobytearray, standardopenoption.create, standardopenoption.truncate_existing) }catch{ case _:exception => println("failed write") } it seems prepend ¬Ã­ nul enqtstxt where part after enqt seems vary. (doesn't matter if declare o an object or string.) this annoying because want print couple of .dot-strings (graphviz) in order batch-process resulting .dot-files .pdf-files. prepended nonsense, however, forces me open each .dot-file , remove manually - kind of defeats purpose of batch-processing them. this has nothing scala specifically, it's way java standard library works. when writeobj

vaadin7 - CheckBox caption position in FormLayout (Vaadin 7.5.0) -

i have problem formlayout , checkbox component. want use formlayout generate form user. means want have options in form ( textinput, numberinput, options... ) aligned formlayout caption left , input right. this works other components not checkbox . places caption right of box, breaks visual order of form. in vaadin, implementation of component can decide if renders caption or if parent, component container, renders it. of components let parent render caption. checkbox component renders caption itself. to fix problem, wrap checkbox inside layout ( csslayout example) , set caption layout, or use addon: formcheckbox .

angularjs - angular js flexslider with one row of thumbnails -

i using flexslider angularjs, examples form website jquery not helpful. have implemented slider: html <div> <flex-slider flex-slide="image in product.imagepaths track $index" animation="slide" control-nav="thumbnails"> <li data-thumb="{{imagesurl}}{{image.thumbnail}}"> <img ng-src="{{imagesurl}}{{image.custom}}"> </li> </flex-slider> </div> in js array of objects consist of 3 strings each(paths original, custom size , thumb) and have overwritten css size: .flexslider { width: 400px; height: 400px; } .flexslider .slides img { width: 400px; height: 400px; } .flex-direction-nav { line-height: 40px; } i have 12 thumbnails, clicking them works fine, supposed do; problem visible, shown on 3 rows. have added requested classes: <link rel="stylesheet" href=&qu

git - Safe way to 'reshape' a branch's history -

often, when using git, make mistake of rebasing or merging didn't want. example, have 3 commits don't want show in history, , 1 do, a-b-c-d , d commit want. run git rebase -i head~4 and squash a , b , , c . then, later, decide wanted have 2 commits, because a totally unrelated other 3 , history make more sense if on own. is, git reflog | grep 'rebase -i' which spit out list ends <somehash> head@{<num>}: rebase -i (start): checkout head~4 and run git checkout head@{<num>+1} git br -d <branchiwasworkingon> git checkout -b <branchiwasworkingon> git rebase -i head~4 and same thing did before, pick ing commit a time. cumbersome, , requires deleting branches, makes me nervous workflow isn't particularly safe. question is, there more secure way rewrite history reflog & branch deletion method? my favorite way split commits if necessary git reset --soft head~1 bring changes of last commit, in case 4

how to Print a function without printing the Return type in Python? -

i want print this: current hand: e i n r t a e i n r t , output of following function no return type: def abcd(hand): letter in hand: print letter print i use print "current hand:",abcd(hand) following op: current hand: e i n r t none can ? if want output letters should return them string. def abcd(hand): return ' '.join(hand) >>> print("current hand:",abcd('aeiinrt')) current hand: e i n r t >>> abcd('aeiinrt') 'a e i n r t' read join() here in docs , quick tutorial on how use here

javascript - Using HighChart JS files locally -

Image
i'm trying use highchats js files locally in code. when use official link below working <script src="http://code.highcharts.com/highcharts.js"></script> <script src="http://code.highcharts.com/highcharts-more.js"></script> <script src="http://code.highcharts.com/modules/exporting.js"></script> <div id="container" style="height: 400px; min-width: 310px; max-width: 600px; margin: 0 auto"></div> when tried same local imported file below not working <script src="${pagecontext.servletcontext.contextpath}/resources/js/exporting.js"></script> <script src="${pagecontext.servletcontext.contextpath}/resources/js/highcharts-more.js"></script> <script src="${pagecontext.servletcontext.contextpath}/resources/js/highcharts.js"></script> the below error i'm facing is possible use locally or if keep files in server

scala - Get resource file from dependency in sbt -

i have sbt-web project webjar , common jar dependencies. want resource file 1 of jar dependency , use in concatenation task. don't know how refer resource inside dependent jar in build.sbt. i find solution this docs. main idea find right jar in classpath dependencies, unzip temprorary folder , need files. in case copy target directory , use in concatenation task. i end code: def copyresourcefromjar(classpathentry: attributed[file], jarname: string, resourcename: string) = { classpathentry.get(artifact.key) match { case some(entryartifact) => { // searching artifact if (entryartifact.name.startswith(jarname)) { // unpack artifact's jar tmp directory val jarfile = classpathentry.data io.withtemporarydirectory { tmpdir => io.unzip(jarfile, tmpdir) // copy project's target directory // instead of copying can other stuff here io.copyfile( tmpdir / resourcename

android - Converting ARGB to RGB in java -

i'm trying algorithms write method remove alpha value color , give identical rgb values seems test failing. belive called alpha blending? i'm not sure. algorithm use converting. public static int removealpha(int foreground, int background) { int redforeground = color.red(foreground); int redbackground = color.red(background); int greenforeground = color.green(foreground); int greenbackground = color.green(background); int blueforeground = color.blue(foreground); int bluebackground = color.blue(background); int alphaforeground = color.alpha(foreground); int rednew = (redforeground * alphaforeground) + (redbackground * (1 - alphaforeground)); int greennew = (greenforeground * alphaforeground) + (greenbackground * (1 - alphaforeground)); int bluenew = (blueforeground * alphaforeground) + (bluebackground * (1 - alphaforeground)); return color.rgb(rednew, greennew, bluenew); } and tes

Creating a table of species traits weighted by abundance in R -

i've table of species traits (>400 species, scores each of 50 traits) . wish weight abundance of species recorded @ number of sites (150 sites) , creating table of summed scores of each individual trait in each site. can manually (see below), not sure how code more efficiently. t1 <- c(0,1,0); t2 <- c(0,0,0.5); t3 <- c(1,0,0.5); t4 <- c(1,0,0.5); t5 <- c(0,1,0.5); df.trt <- data.frame(t1,t2,t3,t4,t5) rownames(df.trt) <- c("species.a", "species.b", "species.c") rm(t1,t2,t3,t4,t5) site.1 <- c(10,0,1); site.2 <- c(0,3,7); site.3 <- c(2,4,100) df.abund <- data.frame(site.1,site.2,site.3) rownames(df.abund) <- c("species.a", "species.b", "species.c") rm(site.1,site.2,site.3) ### table of species traits df.trt ### table of species abundance df.abund ###generating weighted table manually site.1 <- c(sum(df.trt[,1]*df.abund[,1]), sum(df.trt[,2]*df.abund[,1]), sum(df.

web services - Repeating message part in WSDL message? -

i consuming web service parts of wsdl looks this: <wsdl:message name='fooresponse'> <wsdl:part name='parameters' element='tjsr:fooresponse' /> </wsdl:message> the fooreponse type defined in separate xsd: <xs:complextype name="fooresponse"> <xs:sequence> <xs:element name="foobaz" type="core:foobaz" minoccurs="0" maxoccurs="unbounded"/> </xs:sequence> </xs:complextype> does response contain 1 fooresponse, or can message contain 0 or multiple fooresponse? (yes, understand fooresponse can contain number of foobaz)

Xamarin Android Mvvmcross app crashed on MvxBootstrapRunner -

sometimes (1/7) app crashes on android 4.0.4 on splash screen sigsegv error in mvxbootstraprunner class in stacktrace, , can start after 'force stop' only. if application crashed once endless splash screen displayed every next time (before force stop). mvvmcross version 3.5.1 i/mvx(15933): 0.50 setup: mvvmcross settings start i/mono-stdout(15933): mvx:diagnostic: 0.50 setup: mvvmcross settings start i/mvx(15933): 0.50 setup: singleton cache start i/mono-stdout(15933): mvx:diagnostic: 0.50 setup: singleton cache start i/mvx(15933): 0.52 setup: bootstrap actions i/mono-stdout(15933): mvx:diagnostic: 0.52 setup: bootstrap actions i/mvx(15933): 0.54 no view model type finder available - assuming looking splash screen - returning null i/mono-stdout(15933): mvx:diagnostic: 0.54 no view model type finder available - assuming looking splash screen - returning null e/mono-rt(15933): stacktrace: e/mono-rt(15933): @ <unknown> <0xffffffff> e/mono-rt(15933

jquery - slide toggle div code which close when clicked again -

i'm still relatively new jquery, i'm using below code, , works want: show multiple content in same container have 1 active @ time , hides rest. however want so: if click same button again content that's active, closes content again content hidden. can't work. <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="buttons"> <a href="#" class="links" data-showdiv="content1" id="button1">button 1</a> <a href="#" class="links" data-showdiv="content2" id="button2">button 2</a> <a href="#" class="links" data-showdiv="content3" id="button3">button 3</a> </div> <div id="container"> <div class="divs" id="content1" style="display:none"> test content 1 <

regex - What's the use of "?!" in this RewriteCond? -

this question has answer here: reference - regex mean? 1 answer i see ?! combination in rewritecond given in .htaccess files, this: rewritecond %{request_uri} ^(?!/slim_demo/index\.php).*$ to understanding, directive checks if /slim_demo/index.php isn't part of request_uri . odd; use of ? @ front, when has no preceding character match. documentation says ? " makes match optional ", thing preceding ? grouping bracket. mean ? making grouping optional? makes sense! what mystery? negative lookahead after match: \d+(?!\d| dollars) sample match: 100 in 100 pesos explanation: \d+ matches 100, negative lookahead (?! dollars) asserts @ position in string, follows neither digit nor characters " dollars"

function - C++ Error on void type parameters -

i've got header: class jmmvasync { public: static void run(lpctstr msg); }; and .cpp void jmmvasync::run(lpctstr msg){ messagebox(null, msg, null, null); } and i'm calling function: lptcstr file = "file"; thread t(jmmvasync::run(file), 0); thread function has structure: thread::thread(void (*afunction)(void *), void * aarg) why getting wrong types when calling "thread"? error code: compile : error c2664: 'tthread::thread::thread(void (__cdecl *)(void *),void *)' : cannot make conversion of parameter 1 type 'void' 'void (__cdecl *)(void *)' thread function expects paramater 1 void (__cdecl *)(void *) , function void . don't know how make function named run same type requested. as mentioned in comments (but maybe in unclear fashion), code tries pass return value of function, instead of pointer function. this constructor thread::thread(void (*afunction)(void *), void * aarg) expects p

java - Scale libgdx UI for mobile? -

Image
at moment desktop version of application fine, buttons scaled quite nice when deploy android they're tiny , barely usable. desktoplauncher .. public class desktoplauncher { public static void main (string[] arg) { lwjglapplicationconfiguration config = new lwjglapplicationconfiguration(); config.title = "color catchin"; config.width = 800; config.height = 480; new lwjglapplication(new colorcatch(), config); } } androidlauncher .. public class androidlauncher extends androidapplication { @override protected void oncreate (bundle savedinstancestate) { super.oncreate(savedinstancestate); androidapplicationconfiguration config = new androidapplicationconfiguration(); config.useaccelerometer = false; config.usecompass = false; initialize(new colorcatch(), config); } } core code .. public class mainmenu implements screen { skin skin = new skin(gdx.files.

datepicker - How to convert a string Date & Time to NSDate in iOS? -

this question has answer here: how convert string date format in ios? 2 answers i facing issue last 2 days. requirement this. i have start date string. : start_date == 15-07-15 and end date string. : end_date == 16-07-15 and time like: start time == 16:28, end time == 18:28 i combine 2 string , convert nsdate . nsstring *strt_date = [nsstring stringwithformat:@"%@ %@",start_date, start_time]; nsdateformatter *dateformat = [[nsdateformatter alloc] init]; [dateformat settimezone:[nstimezone timezonewithname:@"gmt"]]; [dateformat setdateformat:@"dd-mm-yy hh:mm"]; nsdate *date = [dateformat datefromstring:strt_date]; output : date == 2015-07-15 11:01:00 +0000 then fire notification : [self schedulenotificationfordate:date]; - (void)schedulenotificationfordate:(nsdate *)date { // here cancel scheduled notifi

soa - Service locator - why not use DNS? -

there lot of applications can take role of service locator in distributed environment aka soa. example, zookeeper , consul. why not use dns instead? standard, well-known, stable distributed, fault-tolerant can assign multiple ips same name load balancing in homogeneous clusters can serve additional metadata so... why not? sure can use dns. many times should. but, if needs greater dns offers , need build custom on top of it, can check existing tools zookeeper, consul, etcd, eureka , others. you might decide use them if have problem can solve. for example, might want detect when service goes down or loses connectivity - , remove affected endpoints list of services. of mentioned tools offer out of box. there nice writeup spotify relevant topic: https://labs.spotify.com/2013/02/25/in-praise-of-boring-technology

mongodb - How to extract total count for values not in array type fields -

i storing complete message thread (with messages) single document. array field participants holds participants user ids. every message has array field read_by user ids read message. example data: db.threads_test.insert( { "subject" : "subject 1", "participants" : ["u1", "u2"], "messages" : [ {"message_id" : "m1", "message" : "msg 1", "read_by" : ["u1"]}, {"message_id" : "m2", "message" : "msg 2", "read_by" : ["u2"]} ]}); db.threads_test.insert( { "subject" : "subject 2", "participants" : ["u1", "u2"], "messages" : [ {"message_id" : "m3", "message" : "msg 3", "read_by" : ["u1"]}, {"message_id" : "m4", "message" : "msg 4", "read_by"

Rails serves old css file in production -

in application scss had: .red { background-color: #f48585 !important; } then deleted these styling. deployed app heroku, did git add -a git commit -m "message" git push heroku master heroku run bundle heroku run rake db:setup my app deployed, styles foundation framework etc work. still have .red class styles defined. , new styles ignored, seems rails server old css file. of style assets precompiled 1 file application.scss. you forgot 1 step: git add -a git commit -m "message" git push origin your-git-branch git push heroku master after last command heroku automatically run bundle install , setup project/app running in production mode.

amazon web services - Does AWS RDS Multi AZ in conjuction with read replicas have less replication lag than just read replicas? -

quoting aws docs: "you can use multi-az deployments , read replicas in conjunction enjoy complementary benefits of each. can specify given multi-az deployment source db instance read replicas." does multi-az read replica have less replication lag ordinary read replicas? ask because multi-az states: "it synchronously replicates data". also: "multi-az deployments utilize synchronous replication, making database writes concurrently on both primary , standby standby up-to-date in event failover occurs. while our technological implementation multi-az db instances maximizes data durability in failure scenarios, precludes standby being accessed directly or used read operations. fault tolerance offered multi-az deployments make them natural fit production environments; learn more multi-az deployments, please visit faq section." multi-az rds establishes secondary replica of db in different az , replicated synchronously. can accessed when promo

twitter bootstrap - Bootstrap3 Datetimepicker issues: missing icon, how to use Date() function? -

i'm using bootstrap3 datetimepicker packaged meteor on site: https://github.com/tsega/meteor-bootstrap3-datetimepicker i have 2 problems. 1) there no calendar icon on button click open calendar. 2) date() function fails error: "exception in template helper: typeerror: $(...).datetimepicker(...).date not function". here's included via command line: meteor add jquery meteor add mrt:moment meteor add twbs:bootstrap meteor add tsega:bootstrap3-datetimepicker it possible these weren't right packages, did working... i've followed example on author's page. here's javascript: if (meteor.isclient) { template.say_when.onrendered(function() { this.$('.datetimepicker').datetimepicker({ }).on('dp.change', function(e){ session.set("selected", e.date.format()); }); }); template.say_when.helpers({ // works show_date: function(){ return session.get("selected"); },

vba - Excel Files and Visual Basic -

i have never used visual basic before pointer on begin. i have 750 excel spreadsheets contains various amounts of data of different types. columns same, number of data rows vary per spreadsheet. need extract data , put 2 new spreadsheets. obviously 750 times manually nightmare. want run script can me , thought of visual basic although i've never used before. my specific questions are: what type of command should research allow me copy data row number start @ varies (as data above varies in no of rows). there title before new data - how can search title , choose row below? would spreadsheets have in 1 folder script goes through them all, or can have kind of folder structure in folder too? anyone recommend resources me grips visual basic , grasp need do? thanks tom so compilation task got easier introduction of ms powerquery. if using ms excel 2013, have this. if no, you should download , use extension ms . the following guide outlines how using pow

javascript - AngularJS: trigger event after nested ng-repeat with filter is complete -

i have big json in controller fetched mongodb database. here's structure (haven't added irrelevant keys): $scope.keyword; //ignore explained below $scope.data = [ {"key" : [ {"nested_key": //some value}, {"nested_key": //some value} //so on ] }, {"key" : [ {"nested_key": //some value}, {"nested_key": //some value} ] }, {"key" : [ {"nested_key": //some value}, {"nested_key": //some value} ] } ] here's html template displaying json: <div ng-repeat="outer in data"> <div ng-repeat="inner in outer.key | keywordfilter: keyword"> //print inner values </div> </div> here, 'keyword' holds values used filter inner ng-repeat loop. here's filter : ap

android - How to center two sibling TextView in RelativeLayout? -

i have layout below. need b , c centered below a . simplify view need one relativelayout if possible. <relativelayout android:layout_gravity="center_horizontal" android:layout_width="wrap_content" android:layout_height="60dp"> <textview android:id="@+id/a" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="test 1" android:paddingtop="3dp" /> <textview android:id="@+id/b" android:layout_below="@id/a" android:paddingright="5dp" android:textcolor="#000" android:text="test 2" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <textview android:id="@+id/c" android:layout_torightof="@id/b" an

html - Converting more than one SVG element to PNG in Javascript -

i have simple chart uses 3 d3.js svg elements display different stuff. want convert png. found solution on here: function saveimage(){ var html = d3.selectall("svg") .attr("version", 1.1) .attr("xmlns", "http://www.w3.org/2000/svg") .node().parentnode.innerhtml; var imgsrc = 'data:image/svg+xml;base64,'+ btoa(html); var img = '<img src="'+imgsrc+'"/>'; d3.select("#svgdataurl").html(img); console.log(html); }; now works fine, if use 1 svg element, if try this, error: this page contains following errors: error on line 1 @ column 419: content @ end of document column 419 is, of course directly between first closing < /svg> tag , next opening < svg> tag. is possible convert 3 elements 1 picture using javascript? i'm not familiar d3.js , before that, have know that, code working single svg? got error on multiple svg used right? if is, try follo

Tracking Chromeless Flash Video Player Events using Adobe DTM -

we have brightcove chromeless video player newly created in flash tracked. got reference of tracking jw player video events using adobe dtm don't see documentation on brightcove chromeless video player (flash) dtm. idea please share. here steps. , here documentation. typically, need following steps: step 1: report suite configuration- configure report suite track the milestones in appropriate variables. step 2: configuring brightcove player- configure player script access. step 3: add parameters video object. step 4: add brightcove plugin in plug-ins section of s_code file step 5: add media module in module section of s_code file.

android - sort json response on click and display accordingly in titanium -

hi have json response looks this. { "id": "7", "issue_title": "apr - may 2015", "issue_no": "issue 1.4", "cover_image_url": "http://www.link.org/apr--may-2015-7.jpg", "synopsis_pdf_url": "", "advertisers_pdf_url": "", "issue_date": "01-04-2015", "issue_year": "2015" }, { "id": "3", "issue_title": "feb-mar 2015", "issue_no": "issue 1.3", "cover_image_url": "http://www.link.org/febmar-2015-3.jpg", "synopsis_pdf_url": "http://www.link.org/febmar-2015-3.pdf", "advertisers_pdf_url": "http://www.link.org/febmar-2015-3.pdf", "issue_date": "01-02-2015", "issue_year": "2015" }, { "id": "2", "issue_title": "dec 2014 - jan 2015", "

audio - Action when sound stops? Android Studio -

i'm making first app in android studio. got activity, plays sound mediaplayer, , supposed return main activity, either button (works fine) or when sound stops(what i'm missing). there easy way check if sound has stopped playing, , let trigger action? here code far: import android.content.intent; import android.media.mediaplayer; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.view.menu; import android.view.menuitem; import android.view.view; import android.widget.imagebutton; public class image_button_2 extends actionbaractivity implements view.onclicklistener { imagebutton imagebutton6; mediaplayer mysound; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_image_button_2); imagebutton6 = (imagebutton) findviewbyid(r.id.imagebutton6); imagebutton6.setonclicklistener(this); mysound = mediaplayer.create(this, r.raw.hb); my

coldfusion - Google Calendar API V3 Refresh Token Confusion -

i using cfc google calendar v3 api billeatman. have integrated in pages, go login , authenticate , start working. trouble starts when authentication expires, when session still active in website. i tried storing structure returned google api along access_token , refresh_token in database table. after storing, confused. how call it? above git code says this: <cfset application.oauth2.refreshtoken() /> the function has following code: <cffunction name="refreshtoken" access="public" output="false" hint="i take refresh_token authorization procedure , new access token."> <cfset var strurl = base_auth_endpoint & "token"> <cfhttp url="#strurl#" method="post"> <cfhttpparam name="client_id" type="formfield" value="#variables.client_id#"> <cfhttpparam name="client_secret" type="formfield" value="#var

geocoding - postgis vs sphinx geodist -

i have table 16 mln rows. cities, streets, houses coordinates. how best search objects, knowing coordinates? postgis or sphinx geodist function? now using sphinx, there question relevance of data update of index takes more 4 hours, , indexing delta following merge main takes 10 minutes. mainly depends on other features require. example if using text query functionality of sphinx, stick it. but if not using anyway, , can benefit of other features of postgis, change that. indexing delta following merge main why merge? skip merge, , query both indexes.

android - Use RAW Bitmap via ImageView.setImageUri() -

i trying write content provider in order send image process via imageview.setimageuri() call, bitmap want send in memory and, due performance reasons, prefer avoiding saving on disk , encoding because might take 2/3 seconds encode in png , wouldn't make sense since other end decoding it. so, able send image in png correctly using pipehelper cannot send "raw" (so android bitmap bytearray directly memory), there option that? passing wrong mime type? why setimagebitmap() works raw bitmaps while setimageuri() doesn't? i know use parcelable bitmap want overcome parcelable size constraints. finally, there encoding faster png supports alpha if ending size not issue?

css - Can this selector be shortened? -

i've been using less css little while - basics. i have scenario - i've tried shorten not found solution yet, feels should possible. ideas? .grid-container { & > h1, & > h2, & > h3, & > h4, & > h5, & > h6 { &:extend(.grid); } } i want apply extend children of .grid-container , headers. know can remove ampersand, there short code route? i'm thinking (which doesn't work): & > h1,h2,h3,h4,h5,h6 {} the selector short , don't think need shorten further. if wish whatever reasons, try below: h1, h2, h3, h4, h5, h6 { .grid-container > &:extend(.grid){}; } here, & means every selector in parent selector group , properties of .grid extended headings under .grid-container . compiled css .grid, .grid-continer > h1, .grid-continer > h2, .grid-continer > h3, .grid-continer > h4, .grid-continer > h5, .grid-continer > h6 { /* rules */ } or, mor