Posts

Showing posts from May, 2012

image - Sprite PNG is appearing distorted -

we using png/8 sprite on client's website. reporting image appearing distorted him , on other computers on company. here's how should look: http://i.imgur.com/wfv7rer.jpg and here print screen client sent us: http://i.imgur.com/swkdyku.jpg i have tried donloading , exporting again, uploading again. problem is: on our computers looks fine, it's hard test it. our client viewing in ie: 11 , google chrome: 41.0.272.118. has seen type of error before? it may device-pixel-ratio better 160dpi; that'd throw off css used spriting. if shows "1" , different value them, i'd dig farther on one. test hitting site iphone or newer android device; have >1.0 pixel ratios. http://www.devicepixelratio.com/ edit: show across-browsers on end, it's tied hardware, , not ie11.

android - $cordovaMedia stop working -

i trying create musical instrument consisting of 8 notes, these notes represented image divided 8 areas. whenever press area plays note, if press repeatedly several areas after while app stops producing sounds. how can avoid happening? now post code... working ionic framework. in app.js angular.module('starter', ['ionic', 'ngcordova', 'starter.controllers']) and on... interested part of app.js callback of 'ngcordova' angular.module now on controllers.js ` angular.module('starter.controllers', []) .controller('soundctrl', function($scope, $cordovamedia) { //play media $scope.play = function(src) { var media = new media(src, null, null); $cordovamedia.play(media); }; }) ` finally on file html this ` <img src="img/image.png" style="margin-top:10%;width:100%;height:auto;" usemap="#hangdrum"> <map name="hangdrum">

ggplot2 - Changing discrete axis tick marks in ggplot, R -

Image
i creating plot shows confidence intervals of 2 models each factor. if factors 'a', 'b', 'c', have 6 confidence intervals ci1.a, ci2.a, ci1.b, ci2.b, ci1.c, ci2.c. using simple forest plot want y-axis labels a, b, c, in middle of ci1.a , ci2.a. how can rearrange tick marks make them appear in middle of 2 factors? here toy example. have 49 factors need way able read of labels. factors <- c('a1', 'a2', 'b1', 'b2', 'c1', 'c2') y <- c(1:6) yhi <- y + .5 ylo <- y - .5 df <- data.frame(factors = factors, y = y, yhi =yhi, ylo = ylo) ggplot(df, aes(x=factors, y=y, ymin=ylo, ymax=yhi)) + geom_linerange() + coord_flip() i think best bet change data frame factor , model separate columns. that way, ticks automatically come out way want them. default, geom_linerange() position lineranges 2 different models on top of each other, can change position=position_dodge(width=&l

machine learning - How to find dynamically the depth of a network in Convolutional Neural Network -

i looking automatic way decide how many layers should apply network depends on data , computer configuration. searched in web, not find anything. maybe keywords or looking ways wrong. do have idea? the number of layers, or depth, of neural network 1 of hyperparameters . this means quantity can not learned data, should choose before trying fit dataset. according bengio , we define hyper- parameter learning algorithm variable set prior actual application of data, 1 not directly selected learning algo- rithm itself. there 3 main approaches find out optimal value hyperparameter. first 2 explained in paper linked. manual search. using well-known black magic, researcher choose optimal value through try-and-error. automatic search. researcher relies on automated routine in order speed search. bayesian optimization . more specifically, adding more layers deep neural network improve performance (reduce generalization error), number when overfits trainin

Batch if statement issue -

i trying figure out why batch script doesn't work properly. calling wmic see server model , deploy set of drivers specific model number. the 'wmic csproduct name' outputs: c:\>wmic csproduct name name proliant dl360p gen8 the command outputs: c:\>for /f "tokens=3" %a in ('wmic csproduct name') ( echo %a) c:\>(echo gen8 ) gen8 here script: echo !time! - determining if hp gen 8 or 9 server... >> !logfile! wmic csproduct name | find /i "gen" >nul if %errorlevel% equ 1 ( set %errorlevel%=0 echo !time! - host doesnt appear hp gen 8 or 9 server...skipping install >> !logfile! echo !time! - exitcode !errorlevel! >> !logfile! if defined username (exit /b !errorlevel!) else exit !errorlevel! ) /f "tokens=3" %%a in ('wmic csproduct name') ( if %%a equ gen9 ( echo !time! - installing software , drivers hp gen 9>> !logfile! echo !time! - installing hp proliant gen9 chipset identifier win

java - Choppy audio when decoding audio/video with xuggler -

so i'm writing audio decoder pre-existing video decoder works in libgdx. problem is, when audio code wasn't threaded, audio , video choppy. audio play chunk, , video play chunk. my solution multithreading, , let video stuff it's work (because libgdx render threads not threadsafe, , messing them causes bad things without fail). natural choice use threading stuff audio. this fixes video choppiness, not audio still choppy, it's got artifacts on place. this first ever stab @ serious audio programming, keep in mind might not know basic.the executor service singlethreadexecutor, idea audio need decoded , written out in-order. here's update method: public boolean update(float dtseconds) { if(playstate != playstate.playing) return false; long dtmilliseconds = (long)(dtseconds * 1000); playtimemilliseconds += dtmilliseconds; sleeptimeoutmilliseconds = (long) math.max(0, sleeptimeoutmilliseconds - dtmilliseconds); if(sleeptimeoutmillisecond

javascript - Is it possible to add this line "as is" in HTML markup? -

is possible add javascript , json expressions "as is" in html markup? contrate > 50 && salinc <= 50 || retage >= 50 { "contrate": 0, "salinc": 0, "marstatus": "single", "spousedob": "1970-01-01" } so can load xmldocument .net object? it (html tag attribute, html tag content...), have part of html , xml-valid. you can stash text inside <script> tags explicitly marked not being javascript: <script id="expression" type="text/not-javascript"> contrate > 50 && salinc <= 50 || retage >= 50 </script> <script id="stash" type="text/not-javascript"> { "contrate": 0, "salinc": 0, "marstatus": "single", "spousedob": "1970-01-01" } </script> you can find <script> element id , use innerhtml extract contents. the browser won't pay

null - The concept of `Nil` in C++ -

you remember undergrad lectures in algorithms it's handy have concept of nil , can assigned or compared with. (by way never did undergrad in computer science.) in python can use none ; in scala there nothing (which subobject of if i'm understanding correctly). question is, how can have nil in c++? below thoughts. we define singleton object using singleton design pattern , current impression of wince @ thought of that. or define global or static. my problem in either of these cases, can't think of way of being able assign variable of type nil , or being able compare object of type nil . python's none useful because python dynamically typed; scala's nothing (not confused scala nil , means empty list) solves elegantly because nothing subobject of everything. there elegant way of having nil in c++? no, there no such thing universal nil value in c++. verbatim, c++ types unrelated , not share common values. you can achieve some form of shareab

qt - Linux UI framework to framebuffer with custom RGB manipulation -

i have device developing processes cpu output (over hdmi) in propietary, non rgb, 24 bit, format. device vendor providing me method convert rgb format. with said, use ui framework supports writing framebuffer, allow me intercept rgb data before sent framebuffer. i know qt supports framebuffer, allow me intercept output before adding framebuffer? maybe gaming library (java? python?) allows me this?

go - Golang with Martini: Mock testing example -

i have put piece of code on route. test using mocking. go , test noob, tips appreciated. my generate routes.go generates routes current url. snippet: func (h *stateroute) generateroutes (router *martini.router) *martini.router { r := *router /** * states * */ r.get("/state", func( enc app.encoder, db abstract.mongodb, reqcontext abstract.requestcontext, res http.responsewriter, req *http.request) (int, string) { states := []models.state{} searchquery := bson.m{} var q *mgo.query = db.getdb().c("states").find(searchquery) query, currentpage, limit, total := abstract.paginate(req, q) query.all(&states) str, err := enc.encodewithpagination(currentpage, limit, total, states) return http.statusok, app.wrapresponse(str, err) }) } and being called in server.go such: var configuration = app.loadconfiguration(os.geten

In Acrobat, is there a way to limit page turns to clicking hyperlinks only in Full Screen View? -

i want users click hyperlinks advance next page need disable other methods users advance pages. (i'm creating interactive prototype, branching logic not work if users can advance pages clicking anywhere on page). the closest thing can find edit/preferences/full screen , unclicking "left click go forward 1 page", works inside of acrobat , not work after save file , open in acrobat reader. i'm trying use full screen because timing slide transitions work in full screen. you can control click advance property using javascript. not tested, app.fs.clickadvances = false ; in document-level script, or in pageopen script of page @ document opens, should it. and if should prevent navigation except via links, you'd split document in single pages , open/close single-page documents.

javascript - Google maps full height style angularjs -

i struggling full-height google map displayed on site. <section data-ng-controller="locationscontroller" data-ng-init="find()"> <map center="41.454161, 13.18461" zoom="6"> <span data-ng-repeat="location in locations"> <marker position="{{location.latitude}},{{location.longitude}}" title="{{location.name}}"></marker> </span> </map> </section> i forced pass style-attribute height on element, otherwise framework ngmaps output default height of 300px element inline style . things tried overwrite style-attribute jquery .css() defining outer divs 100% in width , height, neither worked or style set ngmaps not overwritten or map disappeared completely. if want achieve display map on 100% height, else can make work? pass default-style="false" map directive remove 300px inline style: <map center="41.454161, 13.1

Adding events in Shopify? -

say want add "events(event name, event date, event location)" shopify page, best way of doing that? blog post not have options events. i thinking of adding through settings.html. work, except don't know how add option remove event. there way? what think? here answer question. in shopify theme, trying add list of social events page. way add new fieldset in settings.html. in fieldset, can create tables hold form elements inputs , labels. eg. <fieldset> <legend>add event</legend> <table> <tr> <td colspan="3"> <h3 class="heading">event</h3> </td> </tr> <tr> <td><label for="event_name">event name</label></td> <td><input type="text" name="event_name" /></td> </tr> <tr> <td><label for="eve

.net - System.InvalidOperationException: Compiler executable file csc.exe cannot be found -

i have application in .net 4.0 framework. this application running fine on server .net framework 4.0 installed on (also previous versions (3.5 sp1, 3.0, 2.0) installed on machine). reason have move application server has .net framework 4.5.2 installed on it. after moving application new server when access it, having error message: compiler executable file csc.exe cannot found. exception details: system.invalidoperationexception: compiler executable file csc.exe cannot found. i not able determine what's causing problem. please suggest. here complete stack trace: [invalidoperationexception: compiler executable file csc.exe cannot found.] system.codedom.compiler.redistversioninfo.getcompilerpath(idictionary`2 provoptions, string compilerexecutable) +8338603 microsoft.csharp.csharpcodegenerator.fromfilebatch(compilerparameters options, string[] filenames) +739 microsoft.csharp.csharpcodegenerator.system.codedom.compiler.icodecompiler.compileassemblyfrom

arrays - Matlab: A user-defined accumulator for a matrix -

let's assume have special function this: function [sum] = e_add(v1, v2) and function implement this: acc = 0; ri = 1 : size(f,1) ci = 1:size(f,2) acc = e_add(acc,f(ri,ci)); end end is there optimized way without loop, using arrayfun ? i'm little rusty on matlab, looking sum()? http://www.mathworks.com/help/matlab/ref/sum.html

message - Rebus implementation -

i have create poc demonstrate rebus work scenario - multiple subscribers listening event(s) , handling them accordingly. how can configure using builtincontainer , config? need have multiple queues , multiple endpoints configured , single instance of container or multiple? i suggest take @ the pub/sub sample demonstrates scenario 3 separate applications, 1 publisher , 2 subscribers. in scenarios recommend create 1 container each endpoint, implies 1 queue per endpoint.

Getting the percentage of values in an array (Java) -

for assignment, user enter in 8 scores home team, , 8 opponent team. park of assignment requires output display number of games home team 1 , winning percentage of entire season home team. code follows: btw there lot more steps , methods required assignment, working perfectly, step/ method not. public static void main (string [] args){ final int tgame = 8; final int ogame = 8; int [] texansscore; int [] opponentsscore;; texansscore = new int [8]; opponentsscore = new int [8]; scanner sc = new scanner(system.in); (int t = 0; t < 8; t++){ system.out.println("score game " + (t + 1) + ": "); system.out.println(" please enter in houston texans'score: "); texansscore [t] = sc.nextint(); system.out.println(" please enter in opponents' score: "); opponentsscore [t] = sc.nextint(); } dterminepercent(texansscore, opponentsscore); } public static doub

spring mvc - Basic auth must be preemptive with protobuf converter -

as explained in this blog post can use protobufhttpmessageconverter serialize/deserialize protobuf messages. when using basic authentication, if choose json media type protobuf message converter can use preemptive auth or not, doesn't matter. however, if choose protobuf media type must use preemptive authentication otherwise not work, i.e., server returns unauthorized response expected basic auth response not seem processed. when switch on preemptive authentication, i.e., basic auth response sent right away, works expected. nonetheless, seems rather strange me. know why? you'll find below sample code reproduces issue. access web service using rest client instance. @springbootapplication public class demoapplication { public static void main(string[] args) { springapplication.run(demoapplication.class, args); } @bean protobufhttpmessageconverter protobufhttpmessageconverter() { return new protobufhttpmessageconverter(); } } @con

XML Post with PHP form works, jQuery .ajax does not -

i have simple php form posts xml data url, responds more xml. here is: form action="[...]" method="post"> <textarea name="xml" rows="30" cols="100"> <rrequest version = '2.13'> <request> <command>update</command> <pd> <rid>1</rid> <extid>111111111</extid> </pd> </request> </rrequest> </textarea> <br> <input value="submit request" type="submit"> </form> this works beautifully. attempting implement same thing, using jquery. here code: <script> $(document).ready(function() { $("#submit").click(function(){ var xml_data = $("#xml"

Julia performance compared to Python+Numba LLVM/JIT-compiled code -

the performance benchmarks julia have seen far, such @ http://julialang.org/ , compare julia pure python or python+numpy. unlike numpy, scipy uses blas , lapack libraries, optimum multi-threaded simd implementation. if assume julia , python performance same when calling blas , lapack functions (under hood), how julia performance compare cpython when using numba or numbapro code doesn't call blas or lapack functions? one thing notice julia using llvm v3.3, while numba uses llvmlite, built on llvm v3.5. julia's old llvm prevent optimum simd implementation on newer architectures, such intel haswell (avx2 instructions)? i interested in performance comparisons both spaghetti code , small dsp loops handle large vectors. latter more efficiently handled cpu gpu me due overhead of moving data in , out of gpu device memory. interested in performance on single intel core-i7 cpu, cluster performance not important me. of particular interest me ease , success creating paralleli

java - Access getExternalCacheDir() in a Fragment -

i need pass external cache directory post request, i've been unable find away call getexternalcachedir() method within fragment, can call in activity. is possible use method in fragment, or there solution? call getactivity().getexternalcachedir() .

python - How 'with' statement works in Flask (jinja2)? -

in pure python code use with statement ( source ): class controlled_execution: def __enter__(self): # set things return thing def __exit__(self, type, value, traceback): # tear things down controlled_execution() thing: # code in flask/jinja2 standard procedure using flash messages following ( source ): {% messages = get_flashed_messages() %} {% if messages %} {% message in messages %} <!-- stuff `message` --> {% endfor %} {% endif %} {% endwith %} i'd know how {% messages = get_flashed_messages() %} works in terms of syntax. i failed recreate in pure python: with messages = get_flashed_messages(): pass raises syntaxerror with get_flashed_messages() messages: pass raises attributeerror: __exit__ (i've imported get_flashed_messages flask in both cases). the with statement in flask not same with statement in python. within python equivalent this: messages = get_flashed_m

arrays - GetUpperBound vs UBound for speed -

which faster? i've tried googling , couldn't find remotely helpful settle on own. best got simple dotnetfiddle: https://dotnetfiddle.net/i6yx6r ubound calls array.getupperbound internally, implementation near identical: public function ubound(byval array system.array, optional byval rank integer = 1) integer if (array nothing) throw vbmakeexception(new argumentnullexception(getresourcestring(resid.argument_invalidnullvalue1, "array")), vberrors.outofbounds) elseif (rank < 1) orelse (rank > array.rank) throw new rankexception(getresourcestring(resid.argument_invalidrank1, "rank")) end if return array.getupperbound(rank - 1) end function this obtained microsoft's reference source . the difference between 2 sure immeasurable, suspect ubound ever slow since bounds checking, first. in reality, because actual implementations same, use whichever more comfortable using

java - How can I pass request parameters along with pay key in pay pal adaptive embedded payments? -

i using light browser embedded application. have form has action set " https://www.sandbox.paypal.com/webapps/adaptivepayment/flow/pay ". i have java script triggers pay pal pay button. <script type="text/javascript" charset="utf-8"> var embeddedppflow = new paypal.apps.dgflow({trigger: 'submitbtn'}); </script> now inside form have pay button , input parameters set shown below. have input parameters "exptype", "paykey" , "custom". <input type="image" id="submitbtn" value="pay paypal" src="https://www.paypalobjects.com/en_us/i/btn/btn_paynowcc_lg.gif"> <input id="type" type="hidden" name="exptype" value="light"> <input id="paykey" type="hidden" name="paykey" value='<%=request.getattribute("paykey")%>'> <input id="custom" type="

asp.net mvc - data-bind not working in kendo.template -

i'm having troubles trying implement custom remove button in kendo grid. code have: view: <div id="gridadditionallines"> javascript: var datasourcegrid = new kendo.data.datasource({ data: mydata, --> it's type of kendo.observable schema: { model: { id: "id", fields: { id: { editable: false, nullable: true }, column1: { editable: false, nullable: true }, description: { validation: { required: true} }, value: { validation: { required: true} } } } } }); $("#mygrid").kendogrid({ datasource: datasourcegrid, editable: true, navigatable: true, toolbar: ["create"], columns: [ { field: "description&qu

excel - Reducing Lines of Code in VBA -

i repeatedly performing action on multiple columns, , eliminate redundant code. posting code first 2 columns believe enough demonstrate doing, code repeated total of 16 columns (column e - column t). oldplayerrosterlocation offset "vba vlookup" old player find on sheet proper row stats modified needed. works, reduce redundant code. 'below determines weeks old player has played. 'first part replaces team win/loss week value instead of 'formula second part not ruin sheet. if range("e61") = "1" 'wk#1 range("e42").value = range("e62") range("e43").value = range("e63") 'second part clears weekly results new player each weeks 'old player has played. range(oldplayerrosterlocation).offset(0, 3).clearcontents range(oldplayerrosterlocation).offset(1, 3).clearcontents range(oldplayerrosterlocation).offset(2, 3).clearcontents end if if range("f61") = "1" 'wk#2 range(&quo

php - In PHPLint, what does "guessed signature of the function" mean? -

i'm using sublime text 3 sublimelinter-php plugin, uses phplint. if supply simple bit of code, says "error: guessed signature of function foo() void()": <?php function foo() { echo( 'bar' ); } foo(); ?> what mean? googling turns references error, can't find explanations or instructions on fixing it. should change code avoid error, or should ignore it?

sql - jpql select returns null in eclipselink -

Image
i have simple statement bothers me , returns null eventhough record saved in database !! i have "administrateur" , "exploitant" entities inherit "utilisateur" entity (user in english xd) follows : ====================== entity administrateur =============== @entity @discriminatorvalue("a") @table(name="administrateur") public class administrateur extends utilisateur{ public administrateur(){ } } ====================== entity utilisateur =============== @entity @inheritance(strategy=inheritancetype.joined) @discriminatorcolumn(name="type_utilisateur") @table(name="utilisateur") @id @generatedvalue(strategy=generationtype.auto, generator="utilisateur_seq_gen") @sequencegenerator(name="utilisateur_seq_gen", sequencename="utilisateur_seq", allocationsize = 1, initialvalue = 1) protected long id_utilisateur; @column(name="nom") p

android - Update ListView when updated list has got from server -

how dynamically update content of listview? app gets list server , shows it. app caches list showing user without delay. somewhere in future app updated list (update small: 2 items added, 1 deleted). how detect changes , update these items in listview? there complete solution? if using arrayadapter, can use .add(), .addall(), .remove() change data of adapter. , call .notifydatasetchanged() refresh view in gui.

selenium - Error on file size when uploading the image -

i trying upload file using following script. script uploads file via browse button, when click on upload button, gives error //error on file size. fyi - manually upload same file successful my script: driver.findelement(by.xpath(".//*[@id='fileuploadinput']/div/div[2]/input[2]")).sendkeys(file_upload); driver.findelement(by.id("btncreativehostingfileupload")).click(); html: <tr id="fileoas" style="display: table-row;"> <td align="left" style="height:25px;">file name</td> <td nowrap="" align="left" style="height:40px;"> <input type="hidden" style="width:250px" name="uploadfilename" id="videouploadfilename" value="tag.png"> <div onclick="setactiveuploadforuploadall();" style="height:40px;"> <!--

objective c - TouchXML elementsForName Not Working -

i have div element in touchxml, , know fact contains a element need access. element, declared cxmlelement *element in for-in loop <div id="song_html" class="show3"> <div class="left"> <!-- info mp3 here --> 128 kbps<br/>2:35<br/>2.36 mb </div> <div id="right_song"> <div style="font-size:15px;"><b>the doors - crystal ship mp3</b></div> <div style="clear:both;"/> <div style="float:left;"> <div style="float:left; height:27px; font-size:13px; padding-top:2px;"> <div style="float:left;"><a href="http://member.jinbo.net/renegade/music/the doors-03.the crystal ship.mp3" rel="nofollow" target="_blank" style="color:green;">download</a></div> <div style="margin-left:8px; float:left; width:27px; text-align:center;">

python - Why is "if not (a and b)" faster than "if not a or not b"? -

on whim, tested these 2 methods timeit , see evaluation method faster: import timeit """test method returns true if either argument falsey, else false.""" def and_chk((a, b)): if not (a , b): return true return false def not_or_chk((a, b)): if not or not b: return true return false ...and got these results: values a,b -> 0,0 0,1 1,0 1,1 method and_chk(a,b) 0.95559 0.98646 0.95138 0.98788 not_or_chk(a,b) 0.96804 1.07323 0.96015 1.05874 ...seconds per 1,111,111 cycles. the difference in efficiency between 1 , 9 percent, in favour of if not (a , b) , opposite of might expect since understand if not or not b evaluate terms ( if not a , if not b ) in order, running if block once encounters true expression (and there no and clauses). in contrast, and_chk method needs evaluate both clauses bef

c# - Good .NET MVC Framework for Creating PDF Reports including Crosstab Reports -

i'm looking framework creating nice looking reports in .net ( mvc ) . leaning away crystal , dev express , telerik / kendo - there "stuff" in frameworks , i'm sick of things breaking. i need crosstab reports. using sql server express 2012 - can sort of thing microsoft reporting services .. or quite basic? thanks in advance :-) we use ssrs, , crosstab reports possible. there web api can use deploy new reports, render existing reports parameters. if report takes parameters, can craft proper http query link directly current mvc page.

nginx - Make rails url_helpers use https in production -

i use rails url_helpers build resources urls in app. example of url in development http://localhost:3000/resource/1 , generated resource_url(resource) url_helper . i use nginx in production proxy_pass requests rails app. nginx listens on port 433 https , redirects rails app on port 5000 http: server { listen 443 ssl; server_name api.staging.zup.me; ssl_certificate /etc/ssl/certs/cert.crt; ssl_certificate_key /etc/ssl/certs/cert.key; location / { proxy_redirect off; proxy_set_header x-real-ip $remote_addr; proxy_set_header host $host:$server_port; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_pass http://localhost:5000; } } because request rails app receives nginx proxy http , generating urls like, http://example.com/resource/1 , in production want urls use https , example, https://example.com/resource/1 . what best way make rails generate urls https protocol in production? you can use redirect in

ssas - MDX where clause in subquery does not slice cube - how to understand? -

Image
this query gives me sales of 1 store: select [measures].[sales] on 0 [mycube] [store].[store].[042] however, if move slicer inside of subquery, gives me sales of stores. select [measures].[sales] on 0 (select [mycube] [store].[store].[042] ) how understand mechanisms behind difference? noted in this article , without explanation. ----edit----: i tried various things , read around while. i'd add question: there scenario in clause in sub-select filter result? this query gives me sales of stores in state mi (store [042] belongs mi): select [measures].[sales] on 0 (select [store].[state].[mi] on 0 [mycube] [store].[store].[042] ) thinking of 'inner query filters if filtered dimension returned on axis', theory proved wrong if this: select [measures].[sales] on 0 (select [store].[state].members on 0 [mycube] [store].[store].[042] ) the sub-select still returns 1 state mi, outer query returns sales of stores (of states). ----edit 4/13---

twitter bootstrap - jQuery - file upload -

up front, question have purpose of: data-provides="fileinput" data-trigger="fileinput" data-dismiss="fileinput" does fileinput need unique? want have 3 or 4 different photo uploads on 1 page, should of these different, fileinput1 , fileinput2 , etc? and data-provides/trigger/dismiss mean? how work? for more context: using jasny bootstrap image uploading; see http://jasny.github.io/bootstrap/javascript/#fileinput using example, have used code: <div class="s-item fileinput fileinput-new s-photo" data-provides="fileinput"> <div class="s-photo-explain">upload photo</div> <div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;"></div> <div> <span class="btn btn-default btn-file"> <span class="fileinput-new">new photo</span>

netcdf - How to get value of one variable based on another variable in r? -

for netcdf file while includes precipitation values @ many grid cells. grid cells represented latitude , longitude. how precipitation value @ specific grid, say, latitude , longitude? thanks. example, used code open file: library('ncdf4') precip.nc = nc_open('obs.pr.nc') when typed precip.nc, shows 3 variables: float longitude_bnds float latitude_bnds float pr how open pr @ specific longitude_bnds , latitude_bnds? help.

powershell - Determine if a .pfx file needs a password before calling Add-AzureCertificate -

i using following code install .pfx file on azure cloud service: add-azurecertificate -servicename $cloudservicename -certtodeploy $pfxfile.fullname -erroraction 'stop' -password $applicationcertspassword i think it's throwing exception because of .pfx file not require password. how can determine before hand whether or not .pfx file requires password? edit: i'd determine before hand if .pfx file has password or not can avoid running commandlet again without password argument in catch block. you put in try{} , same command without password in catch{} , that's kind of dirty scripting. try{ add-azurecertificate -servicename $cloudservicename -certtodeploy $pfxfile.fullname -erroraction 'stop' -password $applicationcertspassword } catch{ add-azurecertificate -servicename $cloudservicename -certtodeploy $pfxfile.fullname -erroraction 'stop' } what think instead attempt load certificate object no password, , if fails i