Is Ruby pass by reference or by value?

Is Ruby pass by reference or by value?

@user.update_languages(params[:language][:language1], params[:language][:language2], params[:language][:language3])lang_errors = @user.errorslogger.debug "--------------------LANG_ERRORS--------

Methods in ES6 objects: using arrow functions

Methods in ES6 objects: using arrow functions

In ES6, both of these are legal:var chopper = { owner: 'Zed', getOwner: function() { return this.owner; }};and, as shorthand:var chopper = { owner: 'Zed', getOwner() { return this.owner; }}Is it possible to use the new arrow fun

Best way to remove an event handler in jQuery?

Best way to remove an event handler in jQuery?

I have an input type="image". This acts like the cell notes in Microsoft Excel. If someone enters a number into the text box that this input-image is paired with, I setup an event handler for the input-image. Then when the user clicks the i

How do I get current datetime on the Windows command line, in a suitable format for using in a filen

How do I get current datetime on the Windows command line, in a suitable format for using in a filen

Update: Now that it's 2016 I'd use PowerShell for this unless there's a really compelling backwards-compatible reason for it, particularly because of the regional settings issue with using date. See @npocmaka's https://stackoverflow.com/a/1

How to modify existing, unpushed commits?

How to modify existing, unpushed commits?

I wrote the wrong thing in a commit message. Alternatively, I've forgotten to include some files.How can I change the commit message/files? The commit has not been pushed yet. 1:Amending the most recent commit messagegit commit --amendwi

Remove double quotes from string

Remove double quotes from string

I'm trying to grab data from a MySQL database and use Ruby to reformat it into a flat text file. Some of my MySQL data contains double quotes like so: Matthew "Matt" Perryand I need to remove those quotes and replace them with something el

Using XPath wildcards in attributes in Selenium WebDriver

Using XPath wildcards in attributes in Selenium WebDriver

I want to use Wildcards in my attributes. For example, this is my regular XPath: //input[@id='activation:j_idt84:voId:1']`I want to replace the j_idt number with a wildcard because the number is dynamic. I'm looking for something like this:

How to repeat string “n” times in java? [duplicate]

How to repeat string “n” times in java? [duplicate]

This question already has an answer here: Simple way to repeat a String in java 29 answers I want to be able to repeat a string of text "n" times:Somet

Any workaround for ignoring unexpected elements in Apache Axis 1.4?

Any workaround for ignoring unexpected elements in Apache Axis 1.4?

The problem was asked before "Apache AXIS Ignore/Skip additional element while parsing" in 2012 for Apache Axis 2. Is there no workaround yet for Axis 1.4?Problem DefinitionFor instance;1- We have a soap response definition('ResponseGetCust

CSS - Internet Explorer and the  tag background

CSS - Internet Explorer and the tag background

I have a pretty simple layout which renders fine in both Firefox and Chrome, but Internet Explorer (version 11) seems to be unable to render any kind of background color for the element.I have the element as a child of the element and ne

Does Java 8 have cached support for suppliers?

Does Java 8 have cached support for suppliers?

The guava library has it's own Supplier which does not extend Java 8 Supplier. Also guava provides a cache for suppliers - Suppliers#memoize.Is there something similar, but for Java 8 Suppliers? 1:The simplest solution would bepublic sta

Missing makecert.exe

Missing makecert.exe

For some reason I am missing makecert.exe on my system. I searched the whole hard drive and it's not there. In particular, it's not in C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin where I believe it's supposed to be. I haven't found an

Android: How to fill RelativeLayout to full width of screen?

Android: How to fill RelativeLayout to full width of screen?

I am creating an Android app which has a main RelativeLayout and some LinearLayout within it.Now i have this problem. When dragging items to the editor, e.g. a LinearLayout, it doesn't fit to the full width of the screen. How can I make thi

The “X” property on “Y” could not be set to a 'null' value. You must set this property to

The “X” property on “Y” could not be set to a 'null' value. You must set this property to

When I run my application and I click a specific button I get the error:"The "X" property on "Y" could not be set to a 'null' value. You must set this property to a non-null value of type 'Int32'."Cool so I go to my Entity project, go to Y

remove whitespace in std::string [duplicate]

remove whitespace in std::string [duplicate]

This question already has an answer here: Remove spaces from std::string in C++ 12 answers In C++, what's an easy way to turn:This std::string\t\tHELLO

How to avoid error “aggregate functions are not allowed in WHERE”

How to avoid error “aggregate functions are not allowed in WHERE”

This sql code throws an aggregate functions are not allowed in WHERESELECT o.ID , count(p.CAT)FROM Orders oINNER JOIN Products p ON o.P_ID = p.P_ID WHERE count(p.CAT) > 3GROUP BY o.ID;How can I avoid this error? 1:Replace WHERE clause

Is there a “String.Format” that can accept named input parameters instead of index placeholders? [du

Is there a “String.Format” that can accept named input parameters instead of index placeholders? [du

This question already has an answer here: C# variables in strings 4 answers Whats a good way of doing string templating in .NET?

using CKEditor with jQuery validation plugin not working

using CKEditor with jQuery validation plugin not working

I'm using CKeditor and the jQuery validation plugin from basistance. My textarea (with the CKEditor on it) is being validated by jQuery, but that only works after the second click on my submit button.In short:the first time I submit the for

Google Spell check URI not working

Google Spell check URI not working

http://www.google.com/tbproxy/spell?lang=encan any one help me finding google spell check API Url 1:Check this link and replace test with your suggested word - www.google.com/complete/search?output=toolbar&q=test 2:From searching arou

iPhone What happens to previous data when app is upgraded to new version

iPhone What happens to previous data when app is upgraded to new version

I have a query regarding What happens to previous data when app is upgraded to new version .I have a current application having a local database.The user can modify the database.Now If I upgrade the application to next version with some new

Best way to safely read query string parameters?

Best way to safely read query string parameters?

We have a project that generates a code snippet that can be used on various other projects. The purpose of the code is to read two parameters from the query string and assign them to the "src" attribute of an iframe.For example, the page at

T/F: Using IF statements in a procedure produces multiple plans

T/F: Using IF statements in a procedure produces multiple plans

In responses to this question, KM said if you are on or above SQL Server 2005, you can use IFs to have multiple queries in the same procedure and each will have an query plan saved for it (equiv to a procedure for each on older versions),

Getting raw text content of HTML element with HTML uninterpreted

Getting raw text content of HTML element with HTML uninterpreted

I have Googled my brains out and can't figure out how to make this work. Here is what I'm trying to do:HTML:"Hi, my name is.."Javascript:var div = document.getElementById('derp');alert(div.innerHTML);alert(div.innerText);alert(div.textConte

how to rename a project without killing solution

how to rename a project without killing solution

When I rename a project within a solution, and then try and build that project, I get the error: "The project file "xyz.csproj" was not found. Where xyz is the old project file name!The annoying thing is that I can search my project & solu

Navigate from one fragment to another on click of a button

Navigate from one fragment to another on click of a button

I want to navigate from a fragment to another on click of a button and i also want to pass the data. What i should do for that ? 1:here's an example to help you out: your_button.setOnClickListener(new View.OnClickListener() { public