Posts

Showing posts from May, 2010

android - TextInputLayout not showing when View added programmatically -

Image
i noticed strange behaviour of textinputlayout : when add following layout: <android.support.design.widget.textinputlayout android:layout_width="match_parent" android:layout_height="wrap_content"> <edittext android:id="@+id/txtfirstname" style="@style/edittextstyle" android:layout_width="match_parent" android:layout_height="match_parent" android:hint="in layout" android:singleline="true" /> </android.support.design.widget.textinputlayout> everything works expected. when inflate similar layout like: view v = layoutinflater.from(this).inflate(r.layout.edittext_w_surrounding_textinputlayout, null); edittext edittext = (edittext) v.findviewbyid(r.id.edittext); edittext.sethint("added programmatically"); viewgroup root = (viewgroup) findviewbyid(r.id....

asp.net - Installing NuGet package Owin, get reference error -

i'm trying install nuget package owin , nuget gives me error: already referencing newer version of 'microsoft.jquery.unobtrusive.validation'.. this wierd, , has come somewhere else, because owin doesn't have dependecies. turns out, happens other packages well. this asp.net mvc 5 project uses episerver cms do know is? edit: turns out, error in vs 2015 rc package manager console host version 3.0.0.0. i'll report bug. edit 2: posting error message nuget: install-package : referencing newer version of 'microsoft.jquery.unobtrusive.validation'.. @ line:1 char:1 + install-package owin + ~~~~~~~~~~~~~~~~~~~~ + categoryinfo : notspecified: (:) [install-package], exception + fullyqualifiederrorid : nugetcmdletunhandledexception,nuget.packagemanagement.powershellcmdlets.installpackagecommand i'm not sure how of useful answer is; solved using visual studio 2012 , package manager console host version 2.8.50126.400. have u...

Updating fields from two tables of Sql CE in C#? -

i have 2 tables in stock.sdf database called: product (pid, pname, unitprice) sales (pid, qty, totalprice) i want add totalprice sales table using update query. because want store data permanently, whenever new sales added. sales.totalprice = (sales.qty * product.unitprice sales.pid = product.pid); i have tried follows , got parsing error. possible solution try { stockdbconnection dbcon = new stockdbconnection(); sqlceconnection conn = new sqlceconnection(dbcon.returnconnection("connstring")); conn.open(); sqlcecommand command = new sqlcecommand("update set a.tprice=@qty * b.uprice sales join product b on @pid=b.pid", conn); command.parameters.add("@qty", txtqty.text); command.parameters.add("@pid", cmbpid.text); command.executenonquery(); messagebox.show("data upated successfully.")...

HTML form not updating mySQL through PHP file [SOLVED] -

i'm not quite sure what's going on because i'm following same concept of implementation on page several other pages on site. reason, page not update database. throws no errors or anything, doesn't update user information. the html shows text box , radio buttons @ top admin user can type name , select whether promote, demote, activate, or deactivate account entered text box. once submitted, code doesn't yell @ me instead nothing. i've tried several different ways of doing no matter it's not updating database. here html file (shortened): <?php include_once ($_server['document_root'] . '/public_html/templates/areadmin.php'); if(isset($_post['user'])) { checkfunc(); } else { ?> <!-- contents of page--> <div class="container2"> <div align="center"><br/><br/> <div id="box1"><br/><br/><br/> ...

javascript - How writing text onto specific place [Opal] -

i need write static web page simple data. in form have data user , in tag <div id="prog"> output how using opal writing string specyfic place? <div id="prog"> </div><script type="text/javascript"> <div id="prog"> </div> </script> pp = document.getelementbyid("prog").innerhtml = opal.main() </script> ok, based on sample code, need make opal.main() return string def main # logic return str end but think want use opal-jquery or opal-browser, don't have experience later, here's simple example of opal-jquery (of understood asking) document.ready? element["form"].on(:submit) element["#prog].text = element["#input-id"].value end end

My code fails at a certain point. Java File IO -

i new java. programmed in c++. trying work files code fails when try create file, is, when program tests if file exists, fails, have created file. public schedule(string name, string event) { string filename= name+event+".txt"; file timetable=new file(filename); if (timetable.exists()&&timetable.isfile()){ writetofile(timetable,name,event,filename); system.out.println("in constructor"); }//fails here } i have created file if following line reason saying this, you're wrong. file timetable=new file(filename); this making abstract representation of file/directory pathnames not make file if doesn't exist. file timetable=new file(filename); timetable.createnewfile(); the createnewfile method make physical file if doesn't exist.

haskell - To and From JSON for custom data types -

i have following classes: type id = uuid data mysubclass1 = mysubclass1 { svar1 :: utctime , svar2 :: utctime } data mymainclass = mymainclass { var1 :: id , var2 :: mysubclass1 , var3 :: (int, string) , var4 :: maybe string } and here's json itself: { "var1" : ..., "var2_1": ..., "var2_2": ..., "var3_1": ..., "var3_2": ..., "var4": ..., "svar1": ..., "svar2": ... } and need create instances of json them: --ok instance fromjson mysubclass1 parsejson (object v) = mysubclass1 <$> v .: "svar1" <*> v .: "svar2" --ok instance tojson mysubclass1 tojson (mysubclass1 svar1 svar2) = object ["svar1" .= svar1 , "svar2" .= svar2 ] and here's have difficulty instance fromjson mymainclass parsejson (object v) = mymainclass <$> v .: "var1...

java - How to write to an already completed PDF file, using iText -

Image
i have pdf file add text or numbers specific positions. pdf has boxes , want put text in specific boxes. use itext , java. i this, have hard-code x , y of text. want know how find position of paragrafs put text under there. lpdfcontentbyte content = pdfstamper.getundercontent(1); columntext ct = new columntext( content ); ct.setsimplecolumn(200,549,500,10); ct.settext(new phrase("4")); ct.go(); under month days in pdf image, want write something, numbers or text. it great if tell me how that. now have 1 solution. can save existing pdf document , add text it, existing pdf 2 pages long , can "scan" first page. how can "scan" both pages of original pdf document? here code package pdfmodifier; import com.itextpdf.text.document; import com.itextpdf.text.documentexception; import com.itextpdf.text.element; import com.itextpdf.text.image; import com.itextpdf.text.pagesize; import com.itextpdf.text.paragraph; import com.itextpdf.t...

php - codeigniter 3.0 pagination with get parameter -

i have use codeigniter pagination, add parameter url. problem when change next page of parameter disappear example url+ parameters: http://localhost/test/index.php/search/product/?sort_by=price&order=asc when click page 2 next page, url become this: http://localhost/test/index.php/search/product/5 i want url become this: http://localhost/portofolio2/index.php/search/product/5?sort_by=price&order=asc =========================================================================== update << i add $config['suffix'] $config array, when go next page parameter didn't dissapear. there new problem, when navigate first page parameter dissapear again. this $config pagination looks like 'base_url' => base_url() . 'index.php/search/product/', 'suffix' => '?sort_by=' . $sort_by . '&order=' . $order, 'use_global_url_suffix' => true, 'reuse_qu...

javascript - Custom tooltip data for specific points on highchart -

i display warning, or explanation, in tooltip, when hover on specific 1 or 2 points. these warnings unique point can't repeated. i've put custom text 'warning' , 'warning 2' within series data, can't seem call data once per tooltip contains it. my series data looks this: series: [{ color: '#333', name: 'pre-tax profits', data: [{y: 811, custom: 'warning'}, 881, 465, -137, 491, 567, 284, 35, 675] }, { color: '#00adef', name: 'revenues', data: [2663, 2300, 1851, 1782, { y: 2103, custom: 'warning 2'}, 2154, 1665, 1666, 2149] }] the 'y' seems superfluous error without it. here how i've called far in tooltip formatter... formatter: function () { var s = '<b>' + this.x + '</b>'; $.each(this.points, function () { s += '<br/>' + this.series.name + ...

jquery - How to add caption data in videojs-caption plugin -

i using videojs-caption plugin have read documentation don't understand should give data. // initialize video.js var player = videojs('video-id'); //load caption plugin player.caption({ data: captiondata }); i have srt , vtt subtitles file on server how can give file data can load subtitles in player. i searching , working on 8 hours ago want run plugin can use more functionality forward subtitles , change styling of captions you'll have convert srt or webvtt file json format. custom format plugin. the creator state similar sami: https://github.com/spchuang/videojs-caption/blob/master/readme.md use starting point.

Implicit Wait in selenium waits for the page to get loaded or all the elements to get loaded -

implicit wait in selenium waits page loaded or elements loaded. suppose there web page, page loaded while of web elements still loading. in scenario if use selenium implicit wait, wait page loading or elements loaded. please confusion. actually none of them ;) you can think implicit wait similar "timeout" aplied every element want interact (using findelement() ) before throwing exception, page completly loaded or not. have official doc .

Selenium Browser Absolute Location -

i want absolute location of browser top left location. in fact, webelement.getx() can relative location browser. so, 1 know how browser's top left location, i.e. beginning point of getx() method selenium? what this? driver.manage().window().getposition()

php - Vcard file can get a data from a link? -

question example in normaly vcard file directory "vcard2.vcf" vcard file can link "www.egg/vcard3.vcf." ? you can fetch url well: file_get_contents(' http://url-to-your-vcard-file.vcf ')

ios - Reactive Cocoa: trouble with switchToLatest in chain of operations -

i'm having trouble disposing of 1 of operations in chained list of operations. i'm trying use reactive cocoa provide stream of locations while user logged in , has granted access location services. i'm still pretty new world of reactive cocoa , functional reactive programming in general, here's i've got far: @weakify(self); // signal of bool racsignal *loggedinsignal = [[self loggedinsignal] distinctuntilchanged]; // signal of clauthorizationstatus racsignal *currentstatesignal = [[self currentauthorizationsignal] distinctuntilchanged]; // defer creation of location stream signal until subscribed racsignal *locationsignal = [racsignal defer:^racsignal * { @strongify(self); // uninterrupted stream of locations, retry stream if error occurs return [[self locationssignal] retry]; }]; racsignal *locationservicesdisabledsignal = [racsignal createsignal:^racdisposable *(id<racsubscriber> subscriber) { @strongify(self); [self locations...

android - why I load long text in textView does not show me?¿ -

i use new thread method called oncreate(). info textview(). new thread(new runnable() { public void run() { info.post(new runnable(){ public void run() { info.settext(panel.getinfo()); } }); } }).start(); if info.settext(panel.getinfo()); call without creating thread take 3-4 seconds being blocked application showing it, then how can show text without being blocked app¿? new thread(new runnable() { public void run() { string text = panel.getinfo(); info.post(new runnable(){ public void run() { info.settext(text); } }); } }).start(); actually taking long panel.getinfo() call. , making call in info.post, you're doing in ui thread.

java - Generating ECDSA public key at host side from W parameter -

i want send public key of private-public key pair (ecdsa) generated in applet host application/terminal. in rsa send modulus , exponent , generate public key @ host side. in ecdsa read link can same if take w parameter bytes outside card click here: stackoverflow answer: encode public key on java i have w bytes card now. can suggest how create public key this? i wrote method convert ec public key java.security.interfaces.ecpublickey key object. use bouncy castle provider ( bcprov-ext-jdk16-1.46.jar ). can download latest version here . /** * method converts ec public key (ecpublickey#getw()) ecpublickey * @param cardpublickey w * @param curvename (for example "p-224") * @return java.security.interfaces.ecpublickey */ public ecpublickey ucpublickeytopublickey(byte[] cardpublickey, string curvename) { //for example curvename = "p-224"; java.security.interfaces.ecpublickey ecpublickey = null; // java.security.interfaces.ecpublickey ...

web - Set up phabricator with LDAP authentication on Debian Jessie -

on server running debian 8, how can set phabricator users authenticated using local ldap server? (choosing ldap because same accounts should used other web applications on same server later) replace occurrences of ***** secure passwords , store them safely. replace occurrences of example.com sensible. use ssh x11 tunneling jxplorer application if have no local x. apt-get install emacs aptitude dbconfig-common debconf fonts-font-awesome jq \ php5-fpm libjs-raphael php5-cli php5-curl mysql-server php5-mysql \ php5-ldap po-debconf ucf nginx php5-apcu php5-gd npm python mc git \ default-jdk jxplorer slapd xauth new password mysql root user: ***** admin password ldap: ***** mysql -u root -p mysql> grant privileges on `phabricator\_%`.* 'phabricator'@localhost identified '*****'; mysql> exit dpkg-reconfigure slapd enter domain: users.example.com, company name: example everywhere else, accept defaults start jxplo...

linux - Append one line at the top of huge gzip file -

i have huge gzip file (~400mb). want append 1 line of text @ beginning of file. i thinking of creating gzip file header line , using zcat combine header file , log file. wanted check if there better/elegant/efficient way it. two gzipped files concatenated single file valid gz file. try it. gzip first, single line want prepend, cat 2 third. print "my newline" | gzip -c > /tmp/smallzip.gz cat /tmp/smallzip.gz mybigfile.gz > newbigfile.gz that save time , cpu of unzipping big gz file, prepending line , rezipping, be: ( echo "my newline" zcat bigfile.gz ) | gzip -c > newbifile.gz

javascript - angularjs accessing ng-model from outside the $scope -

here code: <div class="row"> <div class="col-md-3 col-sm-4"> <checked-input pholder="{{'publications-customdomain' | translate}}" class="add-publisher-input" ng-model="customdomain" icon="glyphicon-globe" type="publicationcustomdomain" page="publications"> </checked-input> </div> <div class="col-md-3 col-sm-4"> <button class="add-domain btn btn-primary disabled-btn" ng-model="adddomainbtn" ng-click="vm.adduserpublisher(currenttab)"> <span class="glyphicon glyphicon-plus"></span>{{'publications-adddomain' | translate}} </button> </div> </div> inside file directives.ts , have structure goes...

vba - Reference to be add -

which reference add use recordset object in excel vba? i tried adding microsoft dao 3.6 object library reference still it's not working. try "microsoft access 12.0 (or higher) object library". sure set dao library lower priority or dereference it.

if statement - Sum up values only if there is no NA in R -

i want sum values 3 columns only, if no column @ position [i,j] has na value. i tried if clause, won't work: if(stat1[i,]!=na&&stat2[i,]!=na&&stat3[i,]!=na) is syntax possible in r? best regards jochen there’s function complete.cases that: cols_of_interest = df[, c('stat1', 'stat2', 'stat3')] sum(cols_of_interest[complete.cases(cols_of_interest), ]) the same can equivalently written na.omit as sum(na.omit(cols_of_interest)) however, complete.cases implemented native c function, whereas na.omit uses quite inefficient r implementation.

php - comparing a string, and, a string with only numbers -

i new php , have been trying no success comparison working: i have variable 'productcode' might hold case 1: value of 'choose'. case 2: later variable can take string (with numbers in it) 102,103 i need know in variable productcode? still 'choose' or '102' (like string numbers) what comparison operator should use? is having value 'choose'? should true if productcode set 'choose' , false if other string (with numbers in 102,103..) i tried if(strcmp($productcode,'choose')){ }//tried double quotes if(($productcode=='choose')){ }//tried double quotes if(($productcode==='choose')){ }//tried double quotes i stumbled @ this.. '102' compared 'choose' passing if statement... can please me correct method of checking mixed case.. edit 1: related code (after incorporating === 0 suggesion rizier123 : $productcode11=$_post['productcode11']; $productcode12=$_post[...

angularjs - How to `switch` the content by condition -

in ng-repeat , require dom switched, according active status. i tried this, not working me: <ul> <li ng-click="activate(item)" ng-repeat="item in items" ng-class="{active : active == item}"> <span ng-if="item==active"> <span>{{item}}</span><!-- when active nested under span --> </span> <!-- else without nesting span --> <span ng-if="item== !active">{{item}}</span> //this not working </li> </ul> live demo replace last ng-if statement (you've made syntax error): <span ng-if="item !== active">{{item}}</span> your active variable isn't boolean, can't toggle in statement.

regex - checking whether a data is base64 encoded or not in nodejs -

i have check if string base 64 encoded or not below code var base64rejex =new regexp(/([a-za-z0-9+\/]{4})*([a-za-z0-9+\/]{4}|[a-za-z0-9+\/]{3}=|[a-za-z0-9+\/]{2}==$)/); var base64data="rules"; var isbase64valid = base64rejex.test(base64data); // base64data base64 string if (isbase64valid) { // true if base64 formate console.log('it base64'); var data=new buffer(base64data, 'base64').tostring('ascii') console.log("this is "+data) } else { // false if not in base64 formate console.log('it not in base64'); } even though above string not base 64 encoded,the output i'm receiving denoting base64 string. there thing need modify in regex? kindly help.

python 3.x - PyQt Keeping QLabel Size Aspect Ratio -

i have qlabel displays image. currently, have image set keep it's aspect ratio, , grow big can within qlabel. is there way can set qlabel maintain image's aspect ratio? not want have "blank" qlabel space either side of image when label wider image. i have been looking sort of qlabel property allow me set aspect ratio of label, have not managed wanted do. all answers have seen relate keeping aspect ratio of resized qpixmap image, not of qlabel containing it. any great! cheers fp i seem have cracked it, incase else wondering how this: i took tmoreau's solution , modified slightly. work, need set qlabel's maximum size image's new size prior paint event. afterwards, need set maximum size qlabel large, otherwise, not able enlarge image @ have specified maximum size of current image. def paintevent(self, event): size = self.size() painter = qtgui.qpainter(self) point = qtcore.qpoint(0,0) scaledpix = se...

android - SplashScene not centered -

Image
i trying out andengine , cannot work out why splashscreen not centered in device - see image below. have set default size device (800, 480) , placed splash @ camera.getwidth() / 2 . seems corner of splash hits center pretty spot on want center of splash centered - makes sense? mainactivity: package com.example.caspe.getmeout; import org.andengine.engine.engine; import org.andengine.engine.limitedfpsengine; import org.andengine.engine.camera.camera; import org.andengine.engine.handler.timer.itimercallback; import org.andengine.engine.handler.timer.timerhandler; import org.andengine.engine.options.screenorientation; import org.andengine.engine.options.wakelockoptions; import org.andengine.engine.options.resolutionpolicy.ratioresolutionpolicy; import org.andengine.engine.options.engineoptions; import org.andengine.entity.scene.scene; import java.io.ioexception; public class mainactivity extends basegameactivity { private resourcesmanager resourcesmanager; private...

java - Detect If User coming from another WebSite after login -

i working on spring mvc web application user has log-in access confidential data. far done stuck @ 1 point. consider following scenario: what happening now : user has logged in , has been redirected homepage . user clicks on address bar , type www.stackoverflow.com , once opened user hits back button of browser, since user's session active , hence allowed access data. what should happen : when logged in user goes website , comes must login again. i have done r&d on handling browser history browser doesn't allow play history. i have tried handling in interceptor. i have tried using http referrer, doesn't tell me if user coming website browser uses same request used when user redirected after successful login , hence referrer returns me context/login referrer when user website. now, out of ideas, please guide me achieve this. thanks. purpose of such odd requirement user can whatever wants do, trying make sure if user forgets logout , somehow mov...

maven - Multiple SLF4J Spring Boot Error -

i create project using jhipster , try create war using mvn install command. war created, when try run war using java -jar command, got error multiple slf4j. whereas, project run in eclipse. slf4j: class path contains multiple slf4j bindings. slf4j: found binding in [jar:file:/volumes/permanent/workspace/sample-app/target/sample-app-0.0.1-snapshot.war!/web-inf/lib/log4j-slf4j-impl-2.1.jar!/org/slf4j/impl/staticloggerbinder.class] slf4j: found binding in [jar:file:/volumes/permanent/workspace/sample-app/target/sample-app-0.0.1-snapshot.war!/web-inf/lib/logback-classic-1.1.2.jar!/org/slf4j/impl/staticloggerbinder.class] slf4j: see http://www.slf4j.org/codes.html#multiple_bindings explanation. slf4j: actual binding of type [org.apache.logging.slf4j.log4jloggerfactory] error statuslogger no log4j2 configuration file found. using default configuration: logging errors console. java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) ...

javascript - Adding delete button for each image thumbnail preview -

i want put next each thumbnail little cross able remove them 1 one. able remove image click on have seperate button "x" remove it. fileinput.addeventlistener("change", function (e) { var filesvar = this.files; showthumbnail(filesvar); }, false); function showthumbnail(files) { var file = files[0] var image = document.createelement("img"); var thumbnail = document.getelementbyid("thumbnail"); image.file = file; image.setattribute('class', 'imgklik5'); thumbnail.appendchild(image) var reader = new filereader() reader.onload = (function (aimg) { return function (e) { aimg.src = e.target.result; }; }(image)) var ret = reader.readasdataurl(file); var canvas = document.createelement("canvas"); ctx = canvas.getcontext("2d"); image.onload ...

algorithm - Sorting given pairwise orderings -

i have n variables ( var 1 ... var n ) , not know exact values. n choose 2 pairwise ordering between these n variables known. instance, known var 5 <= var 9 , var 9 <= var 10 , on pairs. further, known these pairwise orderings consistent , not lead degenerate case of equality throughout. is, in above example inequality var 10 <= var 5 not present. what efficient sorting algorithm such problems gives sorting of variables? the question not how sort (use standard sort of language) how feed sort criterion sorting algorithm. in languages need provide int comparison (t a, t b) t type of elements, returns -1, 0 or 1 depending on larger. so need fast access data structure storing (all) pairwise orderings, given pair of elements. so question not var 10 <= var 5 present (inconsistent) more var 5 <= var 10 ensured present ? if case, can test presence of constraint in o(1) hash set of pairs of elements, otherwise, need find transitive relationship betwee...

php - Access "data" folder from another OpenShift application -

i have existing php app working on openshift application saving files "data" directory. now migrate same code nodejs , putting on openshift application (in same openshift account , domain). what achieve have php application writing files "data" dir of nodejs application keep existing , working php code running , creating files, consuming files nodejs app. in future can plan migrate existing , missing php code nodejs well. thank you! best regards, camillo this isn't going possible. data directory local openshift gear. can't share data directory between multiple gears of single scaled application. better off switching distributed file system such amazon s3 or dropbox both applications access.

sd card - Enumerate mounted volumes on iOS -

following code works fine on macos, return empty list on ios sandisk «sandisk ixpand» flash drive: nsarray *keys = [nsarray arraywithobjects:nsurlvolumenamekey, nsurlvolumeisremovablekey, nil]; nsarray *urls = [[nsfilemanager defaultmanager] mountedvolumeurlsincludingresourcevaluesforkeys:keys options:0]; nslog(@«%@», urls); // print «null» (nsurl *url in urls) { nserror *error; nsnumber *isremovable; nsstring *volumename; [url getresourcevalue:&isremovable forkey:nsurlvolumeisremovablekey error:&error]; if ([isremovable boolvalue]) { [url getresourcevalue:&volumename forkey:nsurlvolumenamekey error:&error]; nslog(@"%@", volumename); } } is there way list of mounted volumes on ios? ios doesn't support mounting volumes or accessing them, why not getting list of mounted volumes. the ixpand device accessed through sandisk app.

c# - Sequence of data inside dataset not maintained while inserting to table -

i selecting data excel sheet , inserting table.when read data excel dataset sequence of data same excel sheet.i inserting data row row using foreach loop in table follows foreach (datarow drow in dset.tables["table1"].rows) { //passing row , inserting data using procedure } foreach loop selecting rows randomly?? .all data inserted sequence of rows changed.because of wrong sequence getting wrong results in app . why so?not able understand why sequence changes automatically. please help. stuck.

php - .htaccess mapping subdomain to a directory having codeignitor framework -

i know there millons of solution available redirect subdomain directory. still facing problem. i want map subdomain in following manner demo1.example.com demo1 dir demo2.example.com demo2 dir i using following code <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewritecond %{http_host} ^demo1\.example\.com$ #rewritecond %{request_uri} !^/demo1/ rewriterule (.*) /demo1/$1 [l] rewritecond %{http_host} ^demo2\.example\.com$ rewritecond %{request_uri} !^/demo2/ rewriterule (.*) /demo2/$1 [l] </ifmodule> this working fine but getting dir name in url demo1.example.com/demo1/ have used following rewrite rule rewriterule ^demo1/(.*)$ /$1 [l,nc,r] but unable remove demo1 url have codeigniter framework in demo1 dir having following htaccess <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php?/$1 [l,qsa] </i...

Bower : install fork of Bootstrap -

i have git repo fork of bootstrap. it has been modified , can push on other repo official one. still possible pull bootstrap (to updates). my problem here is, when enter bower install http://my_custom_url.git bower download official bootstrap repo , not mine. i can't figure out why , unfortunately cannot share real url of repo (it's locked company). any appreciated, ! unless specify otherwise bower downloads latest release repo. if haven't created new release, appear bower downloading original github branch. latest release on forked repo same of original. one option create new release forked repo , should work expected. or, use bower install http://my_custom_url.git#commit commit name of latest commit edits bootstrap code. you use branchname instead of commit risk having code change without realizing it.

Deploy ruby on rails via Capistrano -

i have deployed ruby on rails application ubuntu 14.04 virtual machine in digital ocean . used apache2 , passenger same. now want deploy same using capistrano . using mac machine in developer environment. have installed capistrano 3.4. ssh connection has been set local machine , server server , mercurial version control system in bitbucket. how can deploy via capistrano. tried many tutorials. many outdated , not close. have deployed in server in uat environment , source code checked out , kept in desktop of server. have set user sudo privileges.mysql2 database in same server.please me out . you can see gist here, there 4 files deploy.rb production.rb capfile gemfile // capistrano required gem snippet but i've configured using nginx , passenger.

OpenAM 10, Fedlet App, how to check if user is already logged in -

i have fedlet j2ee application working openam 10. know how can check if user logged openam server. goal make check identity attributes without showing again openam login screen. knows how can check if user logged in j2ee fedlet application? in advance the saml specification allows doing this, ispassive flag in saml authnrequest achieve want.

apache poi - How to get an Excel Blank Cell As NULL -

i have value excel using apache poi. have 2 cases have exact value excel cell the null value should return while value for first case have using new dataformatter().formatcellvalue(row.getcell(index)) method return value excel. if cell has empty value didn't return value null. i tried new dataformatter().formatcellvalue(row.getcell(index, hssfrow.return_blank_as_null)) please refer attached screen shot! here have description value null excel null values the point of datformatter give non-null string looks excel have displayed given cell. empty cell, null or blank, that's empty string. that's explained in javadocs formatcellvalue method : when passed null or blank cell, method return empty string ("") if want have null value empty cells, should tweak code be: // 1 per workbook fine, save re-creating each time dataformatter formatter = new dataformatter(); // per cell cell c = row.getcell(index, row.return_blank_as_null); if (c...

javascript - Why doesn't this give me the factorial? -

function firstfactorial(num) { for(var = num - 1; > 0; i--) { return num * i; } }; console.log(firstfactorial(8)) i want know writing code doesn't print factorial? instead 56, 8 * 7. thought if use loop keep going? using: for(var = num - 1; > 0; i--) { return num * i; } it return num*(num-1) value. since return value in first iteration. instead use: using recursion: function firstfactorial(num) { if(num==1) return num; else return num*(firstfactorial(num-1)) } or: fact=num; for(var = num - 1; > 0; i--) { fact*=i; } return fact; edit: on demand of op explain how return work in recursion method. regarding recursion: return num*firstfactorial(num-1) actually first multiplies num return value of firstfactorial(num-1) (n-1)! . hence happen is: firstfactorial(num-1) called. (firstfactorial function called parameter num-1 . the return value of firstfactorial(nu...

linux - Executing a bash script from a Perl program -

i'm trying write perl program execute bash script. perl script looks this #!/usr/bin/perl use diagnostics; use warnings; require 'userlib.pl'; use cgi qw(:standard); readparse(); $q = new cgi; $dir = $q->param('x'); $s = $q->param('y'); ui_print_header(undef, $text{'edit_title'}.$dir, ""); print $dir."<br>"; print $s."<br>"; print "under construction <br>"; use cwd; $pwd = cwd(); $directory = "/logs/".$dir."/logmanager/".$s; $command = $pwd."/script ".$directory."/".$s.".tar"; print $command."<br>"; print $pwd."<br>"; chdir($directory); $pwd1 = cwd(); print $pwd1."<br>"; system($command, $directory) or die "cannot open dir: $!"; the script fail following error: can't exec "/usr/libexec/webmin/foobar/script /path/filename.tar": no such file...

matlab - Change from one cartesian 3D co-ordinate system to another by translation and rotation -

Image
there 2 reasons me ask question: i want know if understanding on issue correct. to clarify doubt have. i want change co-ordinate system of set of points (old cartesian coordinates system new cartesian co-ordinate system). transformation involve translation rotation. plan do: with respect image have set of points in xyz coordinate system (red). want change respect axes uvw (purple). in order so, have understood there 2 steps involved: translation , rotation. when translate, change origin. (say, want uvw origin @ (5,6,7). then, points in data, x co-ordinates subtracted 5, y 6 , z 7. doing so. set of translated data.) now have apply rotation transform (on translated data). rotation matrix shown in image. values ux, uy , uz co-ordinates of point on u axis has unit distance origin. similarly, values vx, vy , vz coordinates of point on v axis has unit distance origin. (i want know if right here.) wx, wy, wz calculated ((normalized u) x (normalised v)) (also, if serves pu...

python - Cannot save animation in matplotlib: Windows permission denied -

i've been trying day long sort out, checking similar threads no success. stretch's cannot save matplotlib animation ffmpeg helped previous errors (i had ffmpeg path wrong), kept getting access denied after fixing it. my ffmpeg binary on c:\ffmpeg\bin a nice alternative able export gif files, keep getting ascii error imagemagick. think both problems related, wanted sort out ffmpeg first. i think problem might have fact i'm working canopy (in windows 8 64bit), pretty hegemonized path variable , broke things along way (e.g. can't open idle since installed canopy, didn't tried fix yet). fixed things along way found @ least 3 distinct path variables, of updated: windows advanced settings path (set manually), windows console path (set via console setx), , sys.path (set or checked @ runtime), adding ";c:\ffmpeg\bin" , ffmpeg is. regardless sort out problem or not, learn of these environment variables relevant what, find confusing. the code following...