How do I replace a character at a particular index in JavaScript?

How do I replace a character at a particular index in JavaScript?

I have a string, let's say Hello world and I need to replace the char at index 3. How can I replace a char by specifying a index?var str = "hello world";I need something likestr.replaceAt(0,"h"); 1:In JavaScript, strings are immutable, w

Update Eclipse with Android development tools v. 23

Update Eclipse with Android development tools v. 23

I updated Eclipse with the new SDK tools (rev. 23), but now when Eclipse starts I receive the error: This Android SDK requires Android Developer Toolkit version 23.0.0 or above. Current version is 22.6.3.v201404151837-1123206. Please updat

Git strategy to backport bugfixes into older branches (cherry-pick vs. merge)

Git strategy to backport bugfixes into older branches (cherry-pick vs. merge)

We work as follows in our team:we have only a master branch in our GitHub repo, it's not stable - thinks get pushed there each day; for stable releases we use tags (for development, we use private forks on GitHub)we release a new minor vers

Does it make sense to build pure JavaScript based web applications (both client and server side)?

Does it make sense to build pure JavaScript based web applications (both client and server side)?

I've always considered JavaScript as a great addition (or rather, for the last couple of years, as a must have) to the client side of any web application. Even when I started to use Mootools, which takes a big step away from DOM manipulatio

Jasmine toEqual for complex objects (mixed with functions)

Jasmine toEqual for complex objects (mixed with functions)

Currently, I have a function that sometimes return an object with some functions inside. When using expect(...).toEqual({...}) it doesn't seem to match those complex objects. Objects having functions or the File class (from input type file)

C++11 lambdas can access my private members. Why?

C++11 lambdas can access my private members. Why?

Consider this piece of code:class shy {private: int dont_touch; // Private memberpublic: static const shy object;};const shy shy::object = []{ shy obj; obj.dont_touch = 42; // Accessing a private member; compiles; WHY? r

How to view complete commits when tracking history of a single file in Git?

How to view complete commits when tracking history of a single file in Git?

I have a Git repository with about a two years of history in it. I have single file in it, for which I wish to find all the commits, and for each commit: all the other files that were committed in it. Let's assume this file is named file.tx

Intellij “Make project automatically” woes

Intellij “Make project automatically” woes

Back in december I switched from Eclipse to IntelliJ but within a couple of days I switched back.Today I tried IntelliJ again and basically I have only one issue left.The issue is I want to compile Java classes on saving. The reason is I'm

“too many automatic redirections were attempted” error message when using a httpWebRequest in .NET

“too many automatic redirections were attempted” error message when using a httpWebRequest in .NET

I am attempting to request a page like "http://www.google.com/?q=random" using the webrequest class in vb.net.we are behind a firewall, so we have to authenticate our requests.I have gotten past the authentication part by adding my credenti

Laravel - Model Class not found

Laravel - Model Class not found

When starting to work with models I got the following error Class Post not found`. All I did:- Created a Model with the command php artisan make:model- Tried to get all entries from table posts with echo Post::all() I used the followin

debug_backtrace() from registered shutdown function in PHP

debug_backtrace() from registered shutdown function in PHP

While tinkering for an answer to this question, I found that debug_backtrace() doesn't trace beyond the function registered to register_shutdown_function(), when called from within it.This was mentioned in this comment for register_shutdown

Cleanest way to get the next sibling in jQuery

Cleanest way to get the next sibling in jQuery

http://jsfiddle.net/mplungjan/H9Raz/After quite some tests with next('a') and such, I finally found one that worked.I just wonder why next('a') did not, or closest or similar. Are there cleaner ways to get at the href of the link after the

C# vs VB.NET - Handling of null Structures

C# vs VB.NET - Handling of null Structures

I ran across this and was wondering if someone could explain why this works in VB.NET when I would expect it should fail, just like it does in C#//The C# Versionstruct Person { public string name;}...Person someone = null; //Nope! Can't

Save a html canvas image

Save a html canvas image

I know there is probably an answer already to this question but I haven't been able to find it yet and there is a deadline on my project.So I have made an html5 canvas and I would like to be able to do two things with one(or more) buttons.I

Create an Iframe from a Drupal Website

Create an Iframe from a Drupal Website

I have a drupal website. I want to generate an Iframe with content from my drupal site, that other sites can embed.How I think this can be achieved:Method 1: Create a php script that is autonomous from the drupal engine. Import the configur

how to ignore blank lines and comment lines using awk

how to ignore blank lines and comment lines using awk

i am writing this code:awk -F'=' '!/^$/{arr[$1]=$2}END{for (x in arr) {print x"="arr[x]}}' 1.txt 2.txtthis code ignore blank lines, but i also want to ignore line starting with # (comments).Any idea how to add multiple patterns? 1:Change

Generate a uniformly random point within an annulus (ring) [duplicate]

Generate a uniformly random point within an annulus (ring) [duplicate]

Possible Duplicate: Create random number within an annulus I would like to obtain a uniformly obtained random point within an annulus, that is, the area that lies inside a circle of radius R1, but outside a circle of radius R2, where R1 >

Request authorization to Media Library programmatically fails

Request authorization to Media Library programmatically fails

iOS 10 now requires the user's permission to access the Media Library. We check if we have access to the Media Library before we use it, and if not we then use [MPMediaLibrary requestAuthorization: to request authorization again from the us

How to find a pixel-positon of a cursor in UITextView?

How to find a pixel-positon of a cursor in UITextView?

I'm developing a simple writing app for iPad.I'm trying to compute the pixel-position of the cursor in UITextView. I spend a few weeks to design this, but I still couldn't figure out to do it.In stackoverflow, Tony wrote one good algorithm

How can I show .git folder in Netbeans

How can I show .git folder in Netbeans

I have a project which I check out remotely from my VM.Now it checks out all files except the one that he doesn't see.Which happens to be the .git folder...I already removed the regex from theoptions->miscellenous->filesFrom ^(CVS|SCCS|vssv

How can I do a batch insert into an Oracle database using Python?

How can I do a batch insert into an Oracle database using Python?

I have some monthly weather data that I want to insert into an Oracle database table but I want to insert the corresponding records in a batch in order to be more efficient. Can anyone advise as to how I'd go about doing this in Python?For

When designing a JS library should I make it RequireJS/AMD compatible or not?

When designing a JS library should I make it RequireJS/AMD compatible or not?

If I'm making a JavaScript library for general use, how should I handle RequireJS support?As far as I can tell, making your code compliant with RequireJS more or less makes it impossible to use without RequireJS. So why would I do that?How

How to avoid implicit character conversion when using apply on dataframe

How to avoid implicit character conversion when using apply on dataframe

When using apply on a data.frame, the arguments are (implicitly) converted to character. An example:df but: apply(df, 1, function(y) class(y["t2"])) ## [1] "character" "character" "character" "character" "character" "character" ## [7] "char

Fast serialization/deserialization of structs

Fast serialization/deserialization of structs

I have huge amont of geographic data represented in simple object structure consisting only structs. All of my fields are of value type.public struct Child{ readonly float X; readonly float Y; readonly int myField;}public struct Paren

What are the characteristics of spaghetti code?

What are the characteristics of spaghetti code?

Somebody said that when your PHP code and application use global variables then it must be spaghetti code (I assume this). I use WordPress a lot. As far as I know, it's the best thing near great PHP software. And it uses many global variab