Difference between \\n and \\r?

Difference between \\n and \\r?

What’s the difference between \n (newline) and \r (carriage return)?In particular, are there any practical differences between \n and \r? Are there places where one should be used instead of the other? 1:In terms of ascii code, it's 3 --

Listening for variable changes in JavaScript

Listening for variable changes in JavaScript

Is it possible to have an event in JS that fires when the value of a certain variable changes? JQuery is accepted. 1:Yes, object.watch (it's non-standard though). Here's my implementation that works in every current major browser. 2:Y

Parsing CSV files in C#, with header

Parsing CSV files in C#, with header

Is there a default/official/recommended way to parse CSV files in C#? I don't want to roll my own parser.Also, I've seen instances of people using ODBC/OLE DB to read CSV via the Text driver, and a lot of people discourage this due to its "

Capturing stdout when calling Runtime.exec

Capturing stdout when calling Runtime.exec

When experiencing networking problems on client machines, I'd like to be able to run a few command lines and email the results of them to myself.I've found Runtime.exec will allow me to execute arbitrary commands, but Collecting the results

Remove duplicates from an array of objects in JavaScript

Remove duplicates from an array of objects in JavaScript

I have an object that contains an array of objects.things = new Object();things.thing = new Array();things.thing.push({place:"here",name:"stuff"});things.thing.push({place:"there",name:"morestuff"});things.thing.push({place:"there",name:"mo

How to read a local text file?

How to read a local text file?

I’m trying to write a simple text file reader by creating a function that takes in the file’s path and converts each line of text into a char array, but it’s not working.function readTextFile() { var rawFile = new XMLHttpRequest(); rawFil

Run Command Prompt Commands

Run Command Prompt Commands

Is there any way to run command prompt commands from within a C# application? If so how would I do the following:copy /b Image1.jpg + Archive.rar Image2.jpgThis basically embeds an RAR file within JPG image. I was just wondering if there

How can I merge properties of two JavaScript objects dynamically?

How can I merge properties of two JavaScript objects dynamically?

I need to be able to merge two (very simple) JavaScript objects at runtime. For example I'd like to:var obj1 = { food: 'pizza', car: 'ford' }var obj2 = { animal: 'dog' }obj1.merge(obj2);//obj1 now has three properties: food, car, and anima

How to debug rxjs5?

How to debug rxjs5?

On RxJS - Goals I read that their goal is better debuggability: Goals Provide more debuggable call stacks than preceding versions of RxJSI have just started to use redux-observable which is quite easier for me to understand comparing i

Installing a specific version of angular with angular cli

Installing a specific version of angular with angular cli

I searched through google and angular cli doc but couldn't find any way to install a specific version of angular using angular cli. is it even possible? 1:You can just have package.json with specific version and do npm install and it wil

How to load a custom library in Zend Framework 2?

How to load a custom library in Zend Framework 2?

I've been following this guide (http://socialsemanticweb.blogspot.com.au/2012/11/zend-framework-2-create-custom-library.html) but I can't get Zend to see my library (error message below).Any ideas what could be wrong? thanksmy folder struct

Get Each Image Natural Height With jQuery

Get Each Image Natural Height With jQuery

I have to read each images' natural height and I should make calculations. However I have some problem with read to natural height.$('div.imgkirp img').each(function(){ console.log($(this).naturalHeight);});It gets : (images number) unde

Validation failed Class must exist

Validation failed Class must exist

I have been (hours) trouble with associations in Rails. I found a lot of similar problems, but I couldn't apply for my case:City's class:class City User's class:class User Users Controller:def create Rails.logger.debug user_params.inspec

What is the optional argument in C# interpolated string for?

What is the optional argument in C# interpolated string for?

Interpolated strings is one of the new features of C# 6.0. According to MSDN, the syntax of the embedded C# expressions can contain an optional, comma-separated value, deemed as in the documentation.Unfortunately I didn't find what this fi

How to unbox from object to type it contains, not knowing that type at compile time?

How to unbox from object to type it contains, not knowing that type at compile time?

At the run-time I get boxed instance of some type. How to unbox it to underlying type?Object obj;String variable = "Some text";obj = variable // boxing;// explicit unboxing, because we know the type of variable at compile time.var x = (Stri

How to determine a 404 response status when using the HttpClient.GetAsync()

How to determine a 404 response status when using the HttpClient.GetAsync()

I am trying to determine the response returned by HttpClient's GetAsync method in the case of 404 errors using C# and .NET 4.5.At present I can only tell that an error has occurred rather than the error's status such as 404 or timeout.Curre

Print all variables available in a Smarty template

Print all variables available in a Smarty template

How do you print all variables available in the context of a Smarty template? Something like the Django debug trace that lists everything being passed.Thanks 1:Use {debug} From the manual: {debug} dumps the debug console to the page. T

TortoiseGit-git did not exit cleanly (exit code 1)

TortoiseGit-git did not exit cleanly (exit code 1)

I got this message when i tried to create repository by using Git clone.git did not exit cleanly (exit code 1)How to fix this? 1:Try these two commands in git bash:1) git gc --force2) git fetch -p 2:Sometimes it happens because of inc

window.onerror not working in chrome

window.onerror not working in chrome

I am trying to add an onerror event to my website.window.onerror = function() { alert("an error");}But all I receive is:notThere();ReferenceError: notThere is not definedWhat am I missing?Browser: Chrome 26.0.1410.64 mSteps to reproduce:

How to open SBT Tool Window in Intellij?

How to open SBT Tool Window in Intellij?

This question may sound silly for you, but I have been searching the Internet for a while and couldn't find the answer. How can I open SBT Tool Window in Intellij (scala and SBT plugins obviously installed)? 1:In Menu: View -> Tool Windo

Running the same mocha test multiple times with different data

Running the same mocha test multiple times with different data

ProblemI have several tests that do the same thing in mocha. This for me, it's duplication, and is the worst thing to do when you want your system to be maintenable.var exerciseIsPetitionActive = function (expected, dateNow) { var actual

Cast Flask form value to int

Cast Flask form value to int

I'm trying to get the post data in flask @app.route('/getpersonbyid', methods = ['POST']) def getPersonById(): personId = (int)(request.form['personId']) print personIdI'm sending the data "personId" via POST in RESTClie

How to consume third party https wsdl web service in c#

How to consume third party https wsdl web service in c#

In SoapUI tool I've configured .Jks file with Outgoing WS-Security Configurations Signature is BinarySecurityToken and algorithm is CanonicalizationMethod and SignatureMethod it is working perfectly.Now I try to consume from C# code as belo

Meteor collectionfs insert server side

Meteor collectionfs insert server side

hi everyone i using collectionfs + gridfs + cfs filesystem,on collectionfs documentation i find how to insert file on client side like this : Template.myForm.events({ 'change .myFileInput': function(event, template) { FS.Utility.eachFil

How to make text be “typed out” in console application?

How to make text be “typed out” in console application?

Just like the way the computer does it in War Games. I've started, but I don't know where to go from here.static void TypeLine(string line){ string output = null; char[] characters = line.ToCharArray(); for (int i = 0; i My idea wa