Change Photo
Samir Runolfsdottir

Questions by Samir Runolfsdottir

How to get “Data” field from xhr.responseText??

I have XMLHttpRequest() function given below var searchFriendRequests = function (userid) { var xhr = new XMLHt...

How to check if a variable is not null??

I know that below are the two ways in JavaScript to check whether a variable is not null, but I’m confused which i...

Best Practice: Try vs Rescue?

What is a best practice? To use try or use rescue? user.try(:email) VS user.email rescue nil post.try(:comme...

How to get the filename without the extension from a path in Python??

How to get the filename without the extension from a path in Python? For instance, if I had "/path/to/some/file.txt"...

Visual studio equivalent of java System.out?

What do I use in Visual Studio (C#) to perform the equivalent of Java's System.out.println( /*stuff*/ ) ? Does the ...

How to convert string to integer in PowerShell?

I have a list of directories with numbers. I have to find the highest number and and increment it by 1 and create a ...

addAttr not working in jquery??

I have a sample code : <input type="text" name="color" id="color" value="" /> And jquery $('#color').chang...

How can I delete multiple lines in vi??

I have tried to follow the following: How to delete selected text in VI editor but 5dd gives E492: Not an e...

ggplot2 draw dashed lines of same colour as solid lines belonging to different groups?

I am trying to plot 2 solid lines in 2 different colours for each group, but also add dashed lines of the same colou...

Replace a value in a data frame based on a conditional (`if`) statement?

In the R data frame coded for below, I would like to replace all of the times that B appears with b. junk <- ...

What's the use of ob_start() in php??

Is ob_start() used for output buffering so that the headers are buffered and not sent to the browser? Am I making se...

Creating a timer using Lua?

I would like to create a timer using Lua, in a way that I could specify a callback function to be triggered after X ...