Posts

Showing posts from May, 2013

jquery - How can be send additional info on a form with several buttons on Symfony2? -

i started use several buttons on form, taking advantage of isclicked () method , validation groups specified each button. working fine until needed ask additional info @ time user pressed specific button. the thing is: whenever in jquery on click event of button or submit event of form, somewhow prevents symfony of knowing button wich pressed, says clickedbutton null. for example, when do: $form->getclickedbutton()->getname() error: "error: call member function getname() on non-object" even if this: $("form").submit( function() { $("button[type='submit']").attr("disabled", true); }); the puzzling thing me have seen here advises of doing kind of thing: $(this).append('<button />').attr('type', 'hidden').attr('name', "something").attr('value', "something"); on submit event, when it, dont seem find information on request in controller. how ca

c# - Unable to click button in popup using webdriver -

i trying click button using selenium webdriver. working fine following xpath driver.findelement(by.xpath("html/body/div[36]/div[3]/div/button[1]")).click(); it clicks button fine if try find using class wont click it driver.findelement(by.xpath("//div[@class='ui-dialog-buttonset']/button[1]")).click(); any idea doing wrong. actual source code follows:- <div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"> ::before <div class="ui-dialog-buttonset"> <button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="button" role="button" aria-disabled="false"> <span class="ui-button-text"></span> </button> <button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="button" role="button" aria-disabled="false&

Android Studio 1.1.0 IDE showing false errors (in red) -

Image
i have attached screen shot clear picture. i have reinstalled android studio problem still there. ide compiles , runs program. errors not errors otherwise ide not compile , run app. strangely showing false errors in red color. the problem resolved after install. installation options.

php - How To Generate An SQL Insert Query From A List Of Values? -

i have long list of values , want insert them database using sql query, writing statement taking long. there way in php, give me ready use insert query list of values provided? i hereby providing (incomplete)sql query : insert `aichiwj2_reesk`.`me_skills` (`id`, `skill_name`, `skill_type`, `timestamp`) values (null, 'able listen', 'it', current_timestamp), (null, 'accept feedback', 'it', current_timestamp);` .....and continues.... hereby providing list of values (i using <li> view values 1 after other or else, viewing together): able listen accept feedback adaptable artistic sense assertive attentive business storytelling business trend awareness collaborating communication competitive confidant conflict resolution cooperative courteous crisis management critical observer critical thinker customer service deal making deal difficult situations deal office politics deals difficult people decision making dedicated delegation dependa

javascript - Opening 500+ nodes at once in d3.js -

currently trying expand d3.js tree contains on 100,000 nodes. many leafs exist under multiple parents, fit multiple sections/items/regions. searches performed user results in tree opening leafs node id. can result in graph trying open up, on rare occasions, 2000 leaf nodes @ once. currently, have found way without crashing chrome use following setinterval code. var timeout = setinterval(function(){ for(var j = i; j < + 10 ; j++){ makeel(d[j]); search.rules += (j+1) + ") " + graph.findnode(d[j]) + "<br><br>"; highlightpathto(d[j].id); if(j >= d.length - 1){ //when of elements have been itterated through. clearinterval(timeout); highlight.selected = d; $('#highlights').removeclass('empty'); break; } } i+=10; }, 500); however, takes minutes , laggy. there other way accomplish opening number of nodes in 1 go result

Upload File - Android to Google App Engine (PHP) -

from android app google app engine, i'm posting zip file; i'm posting string. when google app engine php script runs, dump value of $_files log by... ob_start(); var_dump($_files); $result = ob_get_clean(); syslog(log_debug, "var dump\n" . $result . "\n"); i log value of string. log has string output doesn't have $_files dumped output. read this link , seems pertain web. android code post file follows... private void postexamplesziptodrive(file file_zip){ requestparams request_params = new requestparams(); request_params.put("test", "came thru"); // try{ request_params.put("file_zip", file_zip); } catch(filenotfoundexception e){ log.e("postexamplesziptodrive", "file not found"); toast.maketext(this, "unable upload.", toast.length_short).show(); return; } asynchttpclient async_http_client = new asynchttpclient(); async_http_cl

Working with arrays of android fragments -

i'm trying dissect , work bit example of android fragments. excuse me posting links, code bit , i'm not sure should post here. http://pastebin.com/xkul0rvz http://pastebin.com/xw6v2xmg the layout pretty straight-forward : <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent"> <fragment class="conti.fragments.fragmentlayout$titlesfragment" android:id="@+id/titles" android:layout_weight="1" android:layout_width="0px" android:layout_height="match_parent" /> <framelayout android:id="@+id/details" android:layout_weight="1" android:layout_width="0px" android:layout_height="match_parent" android:background="?android:attr/detailselementbac

css3 - What is the right combination of prefixes for CSS transitions and transforms? -

what right way prefix css in order cover widest range of browsers , versions? version 1: -webkit-transition: -webkit-transform .3s ease-in-out; -moz-transition: -moz-transform .3s ease-in-out; -ms-transition: -ms-transform .3s ease-in-out; -o-transition: -o-transform .3s ease-in-out; transition: transform .3s ease-in-out; -webkit-transform: rotatex(-30deg); -moz-transform: rotatex(-30deg); -ms-transform: rotatex(-30deg); -o-transform: rotatex(-30deg); transform: rotatex(-30deg); or version 2: -webkit-transition: transform .3s ease-in-out; -moz-transition: transform .3s ease-in-out; -ms-transition: transform .3s ease-in-out; -o-transition: transform .3s ease-in-out; transition transform .3s ease-in-out; -webkit-transform: rotatex(-30deg); -moz-transform: rotatex(-30deg); -ms-transform: rotatex(-30deg); -o-transform: rotatex(-30deg); transform: rotatex(-30deg); i

Javascript: Split File into an Array -

i have list of english words in text file . create array file separated words: var dictionarywords = ["apple","orange","banana","strawberry"] how can use in javascript? , please try explain in beginner terms since i'm still new this! thanks! if have file contents in variable, use split() method split array: var dictionary = file_contents.split("\n"); \n newline character. you can use ajax read file server javascript variable. there many ajax tutorials on web, i'm not going try teach here.

android - RelativeLayout with two textviews on one horizontal line with ellipsis support -

i trying setup relativelayout 2 textview shown on 1 line. first textview should aligned left. second textview should aligned right. if second textview text expand overlap first textview want ellipsize text in middle. don't want ellipsize first textview. this have come with. problem second textview directly right of first textview instead of being aligned far right. seems cannot use alignparentright , torightof @ same time. <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <textview android:id="@+id/left" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:layout_alignparentleft="true" android:t

asp.net - RegisterStartupScript not working with UpdatePanel and Google Visualization charts -

on asp.net page using google visualization charts inside of asp:updatepanel. user selects chart want see 2 asp:dropdownlists , c# code generates javascript , call scriptmanager.registerstartipscript(...). when page first loads first default chart (i.e. first call registerstartupscript) works , can view javascript view source. on postbacks blank chart , when go view source page didn't receive new javascript , still has old default javascript first page load. here weird behavior. if use exact same code replace google chart code alert(...); alert() fires every time , when view source script there. i've tried may different things , followed such answers here . below code , appreciated, i've had other people @ , stumped. fyi: if remove updatepanels , related items (scriptmanager , updateprogress) , use clientscript.registerstartupscript() works fine , new javascript code on page , new chart appears should. <asp:scriptmanager id="scriptmgr" runat="server&q

ipython - The random number generator in numpy -

i using numpy.random.randn and numpy.random.rand to generate random numbers. confusing difference between random.randn , random.rand ? the main difference between 2 mentioned in docs . links doc rand , doc randn for numpy.rand , random values generated uniform distribution within 0 - 1 but numpy.randn random values generated normal distribution, with mean 0 , variance 1. just small example. >>> import numpy np >>> np.random.rand(10) array([ 0.63067838, 0.61371053, 0.62025104, 0.42751699, 0.22862483, 0.75287427, 0.90339087, 0.06643259, 0.17352284, 0.58213108]) >>> np.random.randn(10) array([ 0.19972981, -0.35193746, -0.62164336, 2.22596365, 0.88984545, -0.28463902, 1.00123501, 1.76429108, -2.5511792 , 0.09671888]) >>> as can see rand gives me values within 0-1 , whereas randn gives me values mean == 0 , variance == 1 to explain further, let me generate large enough sample: >>> =

oracle - Why am I getting invalid identifier when executing this SQL? -

why getting invalid identifier when executing sql? i'm stumped. wrong simple code. error is ora-00904: : invalid identifier create table themepark ( apples number(10) primary key, bananas varchar2(20), not null, cherries varchar2(10), not null, eggs varchar2(10) not null ); i'm using oracle db ones using sql fiddle . on flip side, code below works. create table ticket ( red1 varchar2(15) primary key, orange number(10) not null, yellow number(4,2) not null, green varchar2(2) not null, blue varchar2(15) not null ); what makes 1st code (that doesn't work), different 2nd code does? you have commas in script. create table themepark ( apples number(10) primary key, bananas varchar2(20) not null, cherries varchar2(10) not null, eggs varchar2(10) not null );

.net - ssh.net library - client.RunCommand() is not working -

the program hangs @ .runcommand(). missing basic? seems same code works other people , know command correct. if comment out .runcommand() program executes without error. static void main(string[] args) { privatekeyfile key = new privatekeyfile("private"); using (var client = new sshclient("host", "user", key)) { client.connect(); client.runcommand("command"); client.disconnect(); } } i appreciate in advanced. it helpful know you're trying connect to. also, may want checking errors in code. don't seem have in place validating you've connected... start there. change username , password should fail , see if see error. i've tried number of different ssh libraries, perl, python, .net, name automating changes networking devices. common thing came across connecting work, logins worked fine, attempting pass command either time out or fail.

Passing a function_pointer as a comparator in a stl make_heap c++ -

i'm developing program run dijkstra's algorithm heap implementation , want versatile can i'm using function pointer in order avoid code repetition. error pops. i'm using stl make_heap "type must use '.*' or '->*' call pointer-to-member function in '__comp (...)', e.g. '(... ->* __comp) (...)' "heap.h c/c++ problem here dijkstra's algorithm: void graph::dijkstraalg(vertex* ini, vertex* fin, void(graph::*weight_filler)(void), bool(graph::*pq_order)(const vertex* &, const vertex* &)){ for(unsigned int = 0; < vertexs.size(); i++) { vertexs[i]->path = null; vertexs[i]->holder = max_int_value; vertexs[i]->processing=false; } (this->*weight_filler)(); vertex* v=ini; v->holder = 0; v->processing = true; vector<vertex*> pq; pq.push_back(v); make_heap(pq.begin(),pq.end(),pq_order); while(!pq.empty()){ v=pq.front(); pop_heap(pq.begin(),pq.end()); pq.po

ruby - Rakefile for delayed_job with Sinatra -

i want use delayed_job sinatra application, i'm having trouble getting rake file set correctly. when run rake jobs:work, this: rake aborted! don't know how build task 'jobs:work' i suspect need add definition rakefile specify means jobs:work, can't find documentation on how that. looks delayed_job used rails, , rails seems generate appropriate rake definitions you. how can set rakefile able run jobs:work? yes, guessed, have setup rakefile , little that. can find gist here on same. hope solves problem.

android studio - Could not find or load main class org.gradle.wrapper.GradleWrapperMain -

i cleaned whole project deleting local directories ~/.gradle , ~/.m2 ~./android , ~/workspace/project/.gradle , chosing file -> invalidate caches / restart... in android studio. execution of command ./gradlew leads following output: usr$ ./gradlew tasks error: not find or load main class org.gradle.wrapper.gradlewrappermain needless say, deleted much, question how can repaired again? have ideas how fix this? gradlew gradle wrapper executable - batch script on windows , shell script elsewhere. if include following lines in build.gradle , task wrapper(type: wrapper) { gradleversion = '2.0' } a gradle wrapper script added source folders. wrapper script when invoked, downloads defined gradle version, , executes it. distributing wrapper project, can work without needing install gradle beforehand. better, users of build guaranteed use version of gradle build designed work with. in deletions, deleted gradlew depends upon. can either pull gradlew fil

javascript - Two image slider -

Image
i'm working on creating carousel. need make have 2 images side side. when click on right arrow switch them, need right image go left, , new 1 take place of right image. when click left go backwards. don't need animations or anything. below concept image. (the carousel 100% width of page, each displayed image needs 50% wide.) here have coded far.. in project i'm using bootstrap , wordpress well. <div class="wrapper"> <ul class="dual-slider"> <li><a href="#"><img src="http://placehold.it/350x150" /></a></li> <li><a href="#"><img src="http://placehold.it/350x150" /></a></li> <li><a href="#"><img src="http://placehold.it/350x150" /></a></li> <li><a href="#"><img src="http://placehold.it/350x150" /></a></li> <li&

ruby - Regex for Git commit message -

i'm trying come regex enforcing git commit messages match format. i've been banging head against keyboard modifying semi-working version have, can't work want. here's have now: /^([a-z]{2,4}-[\d]{2,5}[, \n]{1,2})+\n{1}^[\w\n\s\*\-\.\:\'\,]+/i here's text i'm trying enforce: ab-1432, abc-435, abcd-42 here multiline description, following blank line after jira issue ids - maybe bullet points, either dashes * or asterisks currently, matches that, match if there's no blank line after issue ids, , if there's multiple blank lines after. is there anyway enforce that, or have live it? it's pretty ugly, i'm sure there's more succinct way write out. thanks. your regex allows \n 1 of possible characters after required newline, that's why matches when there multiple. here's cleaned regex: /^([a-z]{2,4}-\d{2,5}(?=[, \n]),? ?\n?)+^\n([-\w\s*.:',]+\n)+/i notes: this requires @ least 1 [-\w\s*.:',]

android - Data wipes out automatically in SQLlite -

i'm new android development , i'm pretty confused issue. have activity gets inputs user , inserts them sqllite database. here's code insert data table. @override public void onclick(view v) { switch (v.getid()) { case r.id.savebtn: maincalander.db = this.openorcreatedatabase(maincalander.dbname, mode_private, null); system.out.println("db opened!!"); //set duplicate flag normal duplicateflag=false; //retrieve text edit text boxes string t1 = title.gettext().tostring(); string t2 = desc.gettext().tostring(); //make date string string datestring = maincalander.selectedyear + '-' + maincalander.selectedmonth + '-' + maincalander.selectedday; system.out.println(datestring); //time string string timestring = time.gettext().tostring(); cursor c1 = maincalander.db.rawquery("select * " + maincalander.tablename, null);

sonarqube - Sonar Analysis takes too long -

i running sonar analysis legacy application in sonar v3.7.4 profile setup in server sonar way findbugs size of java application: lines of code - 5.7 million classes - 20k packages - 200 issues - 2 million (post sonar run) since codebase integrated sonar first time there several thousand issues reported sonar code quality rules. each run in server, takes close 10 hours in server. looking option in sonar analysis, analysis run in server changes made in codebase . way, can integrate , report overall issues application central server on daily basis without running several hours complete unchanged codebase, whenever build kicked off the following profiling extract when sonar run: sensors execution time - 480 mins decorators execution time - 70 mins post job execution time - 25 mins persisters execution time - 20 mins save measures execution time - 15 mins the breakup of sensors execution time: findbugs sensors - 200 min pmd sensors - 160 mins javasquid sensor -

ruby on rails - Unicorn workers timeout after "zero downtime" deploy with capistrano -

Image
i'm running rails 3.2.21 app , deploy ubuntu 12.04.5 box using capistrano (nginx , unicorn). i have app set zero-downtime deploy (at least thought ), config files looking more or less these . here's problem: when deploy done , restarts unicorn, when watch unicorn.log see fire new workers, reap old ones... app hangs 2-3 minutes. request app @ point hits timeout window (which set 40 seconds) , returns app's 500 error page. here first part of output unicorn.log unicorn restarting (i have 5 unicorn workers): i, [2015-04-21t23:06:57.022492 #14347] info -- : master process ready i, [2015-04-21t23:06:57.844273 #15378] info -- : worker=0 ready i, [2015-04-21t23:06:57.944080 #15381] info -- : worker=1 ready i, [2015-04-21t23:06:58.089655 #15390] info -- : worker=2 ready i, [2015-04-21t23:06:58.230554 #14541] info -- : reaped #<process::status: pid 15551 exit 0> worker=4 i, [2015-04-21t23:06:58.231455 #14541] info -- : reaped #<process::status: pid 3644 e

c# - Calling Runspace.Open() inside a TransactionScope changes Transaction.Current and throws exception -

if system.management.automation.runspaces.runspace.open() happens inside system.transactions.transactionscope apparently changes transaction.current in turns causes 'system.invalidoperationexception' @ transaction's dispose time. so this: using (var scope = new transactionscope()) { using (var runspace = runspacefactory.createrunspace()) { runspace.open(); } scope.complete(); } throws: "transaction.current has changed inside of transactionscope." i wondering if missing crucial parameter in transaction or runspace or has power-shell/msdtc/etc configurations? had same issue myself. runspace buried within several nested transactionscope layers. upon executing runspace.open() , transaction.current changed , exception throw per op's question. the solution me wrap code inside transactionscope , time transactionscopeoption.suppress parameter. using (var transactionscope = new transactionscope(transactionscopeo

angularjs - Jump to anchor in another page -

i want able jump anchor in page(page b). in page b, have list of items below. <div ng-repeat='item in items'>{{item}}</div> i want anchor in 1 of items. how do it? use code : <div ng-repeat='item in items'> <a href="#/pageb">{{item}}</a> </div> where pageb route attach page b.

nfc - ACR122 - Android / How to extract the UID -

i try integrate acr122 android app. i'm using android library ( http://www.acs.com.hk/en/products/3/acr122u-usb-nfc-reader/ ) available acs. everything work, can detect presence of card want extract uid/id of card. know function that? do have example of type of integration? in case of mifare card need send apdu byte array card: (byte) 0xff, (byte) 0xca, (byte) 0x00, (byte) 0x00, (byte) 0x00 . i'm not sure acr122 api need wrap apdu specific api method transmit() update sample code: byte[] command = { (byte) 0xff, (byte) 0xca, (byte) 0x00, (byte) 0x00, (byte) 0x00 }; byte[] response = new byte[300]; int responselength; responselength = reader.transmit(slotnum, command, command.length, response,response.length); system.out.println(new string(response)); reader com.acs.smartcard.reader object , slotnum slot number. i’m not sure how find because don’t have acr test. if told able establish basic communication reader know slotnum.

R log-transformation on dataframe -

i have dataframe (df) values (v) of different stocks @ different dates (t). new df profitability each time period. profitability is: ln(vi_t / vi_t-1) where: ln natural logarithm vi_t value of stock @ date t vi_t-1 value of same stock @ date before this output of df[1:3, 1:10] date smi bond abb addeco credit holcim nestle novartis roche 1 01/08/88 1507.5 3.63 4.98 159.20 15.62 14.64 4.01 4.59 11.33 2 01/09/88 1467.4 3.69 4.97 161.55 15.69 14.40 4.06 4.87 11.05 3 01/10/88 1538.0 3.27 5.47 173.72 16.02 14.72 4.14 5.05 11.94 specifically, instead of 1467.4 @ [2, "smi"] want profitability ln(1467.4/1507.5) , same rest of values in dataframe. new r stuck. thinking of using mapply, , create transformation function myself. highly appreciated. this compute profitabilities (assuming data in data.frame call d ): (d2<- log(embed(as.matrix(d[,-1]), 2) / d[-dim(d)[1], -1])) # smi bond abb addeco

android - How do I package .so files into my .aar archive? -

i wondering if it's possible package native .so files .aar file? if so, .so files go , there references can read in regards this? if put manually, should placed underneath jni/<platform>/libexample.so where platform target cpu platform "armeabi", "x86" etc. typically have so-files multiple platforms there. if build source code using gradle put native source code src/main/jni/ and build plugin rest. resulting so-files built automatically , placed belong to. regarding references, i've seen been mentioned somewhere on site dedicated android build plugin gradle. since wasn't able find page again. can check out plugin's source code more details.

jquery - ajax error in wordpress plugin -

i'm writing plugin wordpress. plugin has widget contains button , textbox. button has onclick event. when event occurs need post textbox data php file using ajax ajax code doesn't return error, php doesn't data. here's js file function f() { var x=document.getelementbyid('last').value; jquery.ajax({ type: "post", url: 'http://localhost/wordpress/wp-content/plugins/hovo/scripts/vote.php', data: x, success: function() { alert('sends successfully'); }, error: function(jqxhr, textstatus, errorthrown) { alert(errorthrown); } }); } here's php file <?php if(isset($_post["anun"])) { echo $_post['anun']; } else { echo "error"; } ?> please fix problem in php $_post expecting key / value pair

php - Error while submitting password-reset form -

Image
i have password-reset form within yii-framework site. when user submits form these error messages: i have set forgot password option my controller function: public function actionemail_for_reset() { if (isset($_post['members'])) { $email = $_post['members']['email']; $criteria = new cdbcriteria; $criteria->condition = 'email=:email'; $criteria->params = array(':email' => $email); $user = members::model()->find($criteria); if (!$user) { $errormsg = yii::t('passwordreset', 'email ini tidak terdaftar. silahkan coba lagi.'); yii::app()->user->setflash('error', $errormsg); $this->refresh(); } $key = md5(mt_rand() . mt_rand() . mt_rand()); $user->confirmation_code = $key; $reset_url = $this->createabsoluteurl('site/password_reset', array('key' => $key, &

javascript - for/while loop for reading user input -

i'm kinda new programming , got question in quiz. need write javascript program read 10 positive values user, , sum multiples of 3 , 5. i couldn't finish code. help? var x = new array (); var total; x.push(parsefloat(window.prompt("enter value",""),)); (x.length<=10; i=0; i<10; i++) { total += x[i] } else{ document.write(total); } you need put prompt function inside loop , add check if number multiply 3 or 5. var total; (var i=0; i<10; i++) { var num = parsefloat(window.prompt("enter value","")); if (num % 3 == 0 || num % 5 == 0) { total += num; } } document.write(total); update : var total; var = 0; while (i<10) { var num = parsefloat(window.prompt("enter value","")); if (num >= 0 && (num % 3 == 0 || num % 5 == 0)) { total += num; i++; } } document.write(total);

Compile OpenVPN or SoftEther as DLL for use in C# WPF -

i trying make front end friends vpn server hosting company. have made of application wpf , working standalone product. downloads server list website json , populates selection contents, ping tests, , on. now @ stage need make - options seem openvpn or softether. i have tried build openvpn recommend vs2010, , softether 2008 professional. struggling working build out of either, when websites should work if dependancys met. my understanding here need build client either of these 2 options dll, can use lib c# application , call public facing connect functions , pass in username , password entered in gui. am on right chain of thought? has out there integrated openvpn or softether own products? i should mention totally lost openvpn, softether builds part installer half empty , drivers wont install virtual adapter either. of course can install them using prebuilt binarys on respective websites.

LM hash, hashing a pasword longer then 14 characters -

if there password longer 14 characters, how lm hash characters after 14th , how combine hashing first 14 characters? thank in advance note: lm hash compromised , should not used anymore. lm hash does not support strings longer 14 characters . if going use algorithm internally , not need compatibility other systems, example compute separate hashes each 14 byte block , xor them together.

ios - SKMapsVersioningDelegate Manage update with local maps.json file -

i'm writing app use skmaps , after question/answer : skobbler can cache json data? i have passed local maps.json file, instead direct download each time app starts. i'm trying manage update process of map skmapsversioningdelegate. -my first question is, mean update maps? delegation methods in standard implementation overwrite maps.json file new version if become available during use of app or delegation will'not update json file in app , update packages of map have downloaded offline use? -if delegation works on or replace maps.json file , there's way simulate map update? in resource folder have json map file version set 20140910. anyway if log actual version : skversioninformation *latestversion = availableversions[0]; nslog(@"actual version %@",latestversion.version); i retrive version number 20141230. during process skmapsversioningdelegate never been called. skversioninformation search information? please check 2.5 map update dem

ruby on rails - serve ssl webpage via nginx, ssl_error_rx_record_too_long -

please me: there wrong in virtual.conf nginx conf file means when viewing site, error ssl_error_rx_record_too_long rather being able view site. using aws, nginx serve rails apps - working yesterday, crashed entire server , frantically trying fix @ 2am, ready production @ 9:30am. ssl_certificate /etc/ssl/star_my_site.pem; ssl_certificate_key /etc/ssl/star_my_site.key; # ------------------ # rails app 1 # ------------------ upstream my_app { server unix:///var/run/puma/my_app.sock; } server { listen 80; # server_name rails_app_one.my_site.com.au www.rails_app_one.my_site.com.au; server_name _ localhost; return 301 https://rails_app_one.my_site.com.au; } server { listen 443; server_name _ localhost; location / { proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_set_header x-forwarded-proto https; proxy_set_header host $http_host; proxy_redirect off; proxy_pass http://my_app; } location ~

Cant run rails commands. Your Ruby version is 2.2.1, but your Gemfile specified 2.1.4 -

i not able run surver rails s or cant make controllers etc. should ? terminal showing following error: your ruby version 2.2.1, gemfile specified 2.1.4 run ruby -v see you've installed ruby 2.2.1, first line in gemfile specifies use ruby 2.1.4 . change first line in gemfile specify ruby 2.2.1 or install ruby 2.1.4 if want use previous version ruby 2.1.4. first check if installed or not using rvm list command. if there need run rvm use ruby-2.1.4 command , if not there use rvm install ruby-2.1.4 rvm use ruby-2.1.4

android - Storing booleans in Preferences -

im struggling grasp how store/read booleans preferences in libgdx. im using them if user have bought item, boolean should turn true , stored true until different boolean turned true , first 1 turned false. hope im exlpaining myself in understandable way. this i´ve done: screen make purchase , presses button make change: purcscreen implements screen { changestone1.addlistener(new changelistener() { @override public void changed(changeevent event, actor actor) { ss.prefs.getboolean("stone1", true); game.setscreen(ss); } }); and screen object have purchased should drawn depending on wether or not boolean true/false: mainscreen implements screen { public boolean stone1, stone2 public mainscreen { stone1 = prefs.getboolean("stone1"); stone2 = prefs.getboolean("stone2"); if(stone1){ setstone1(); } if(stone2){ setstone2(); } show() { if(stone1) { setstone2();

solr difference between qf=text^1 and qf=content^1 -

what differences between qf=text^1 and qf=content^1 i've got solr qf setup as: <str name="qf">title^15.0 description^9.0 categorynames^3.0 authorname^1.0 content^1.0</str> just wanted know if there's big differences between text , content. schema def: <field name="content" type="text_en_splitting" indexed="true" stored="true" multivalued="true"/> <field name="text" type="text_en_splitting" indexed="true" stored="false" multivalued="true"/> the main difference between these 2 fields fact content field not stored while text field is. to see means, can see this post explains difference between stored field , indexed field. you can take on solr's wiki .

Salesforce Org to Org Object migration -

i have developer edition, new salesforce started moving objects org org , i'm not sure best way have read few sites not , have downloaded eclipse , force.ide any pointers or guidance? use ant migration tool. http://www.salesforce.com/us/developer/docs/daas/salesforce_migration_guide.pdf i'm not huge fan of salesforce's documentation, think 1 covers need know.

ruby on rails - How do I document Rake tasks with YARD? -

i include information on rake tasks in our rails app. use yard documentation, , @ moment pages lib/tasks/development.rake show default unformatted text. i can make them render ruby source code using # @markup ruby from yard documentation . however, renders comments inline, if include yard directives # @!method foo . means the yard documentation on tagging dsls doesn’t seem applicable. am missing something? how can yard recognise code vs documentation in .rake files? n.b. happy solution ignores actual code , generates documentation copy, source documentation copy must .rake file – not want documentation live in separate .markdown file (or whatever) there’s chance of getting out of sync. more info - yard command: i using .yardopts file containing following: --asset graphs 'app/**/*.rb' 'lib/**/*.rb' - readme info/* to yard read rake tasks can add 'lib/tasks/*.rake' after hyphen (i.e. add rake files yard ‘files’ list), noted above n

git - How to make local repo to local remote? -

this question has answer here: pull/push multiple remote locations 12 answers i have 2 computers; 1 @ work , other 1 @ home. have 2 local repos on each of them connecting central repo. possible have remote between 2 local repos without interfering central repo? central repo belongs company , dont want push until feature done according atlasin git tutorial . should doable if understand correctly, need 2 or more repos, use git-remote . there's a question here , may find more info there.

java - Why i dont show positiveButton -

i made alertdialog "positive button" in emulator doesn't show up. what's problem? protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); button btndersekle = (button) findviewbyid(r.id.btndersekle); etders = new edittext(mainactivity.this); layoutders = (linearlayout) findviewbyid(r.id.layoutders); alertdialog.builder alertders = new alertdialog.builder(mainactivity.this); alertders.settitle("ders adi giriniz"); alertders.setview(etders); final alertdialog alert = alertders.create(); alertders.setpositivebutton("tamam", new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { tvders = new textview(mainactivity.this); tvders.settext(etders.gettext().tostring()); lay

xslt - Explanation on why certain nodes show up -

all- new xslt. use understand basic. the xml <root> <article> <bullettext>10,00 </bullettext> <bullettext>8,00 </bullettext> </article> <article> <something>some text</something> </article> <article> <corpsdetexte>bulgaria</corpsdetexte> <bullettext>15,0 </bullettext> <bullettext>10,0 </bullettext> </article> <article> <corpsdetexte>somaialia</corpsdetexte> <bunk>test</bunk> <bullettext>15,1</bullettext> <bullettext>10,2</bullettext> <bullettext>20,3</bullettext> <bullettext>25,4</bullettext> <bullettext>30,5 </bullettext> </article> </root> xslt 1 <

oop - Javascript: Assigning a Private Method to Private Variable -

so i'm having javascript issues. i'm not pro, , don't understand why not work. trying assign private variable return value of private function. if set var xxx=function name() execute function when reference xxx. here code. note - var username=getsessionuser(); below. //namespace var sessioncontrols=sessioncontrols || {}; sessioncontrols.app=sessioncontrols.app || {}; sessioncontrols.app.user = (function () { // defined within local scope //private variable var username=getsessionuser(); //privatemethod var getsessionuser=function(){var mname='my name'; return mname;} //private property & method example var privatemethod1 = function () { alert("private method 1"); } var privatemethod2 = function () { alert("private method 2");} var privateproperty1 = 'foobar'; return { //public method & nested namespace examples //public methods publicmethod1: privatemethod1, //nested namespace public prop