Deleting a local branch with Git

Switch to some other branch and delete Test_Branch, as follows: If above command gives you error – The branch ‘Test_Branch’ is not fully merged. If you are sure you want to delete it and still you want to delete it, then you can force delete it using -D instead of -d, as: To delete Test_Branch from remote as well, execute:

Categories Git

mailto link with HTML body

As you can see in RFC 6068, this is not possible at all: The special <hfname> “body” indicates that the associated <hfvalue> is the body of the message. The “body” field value is intended to contain the content for the first text/plain body part of the message. The “body” pseudo header field is primarily intended for the generation of short … Read more

Why do we use $rootScope.$broadcast in AngularJS?

$rootScope basically functions as an event listener and dispatcher. To answer the question of how it is used, it used in conjunction with rootScope.$on; However, it is a bad practice to use $rootScope as your own app’s general event service, since you will quickly end up in a situation where every app depends on $rootScope, and you do not … Read more

How to use shared memory with Linux in C

There are two approaches: shmget and mmap. I’ll talk about mmap, since it’s more modern and flexible, but you can take a look at man shmget (or this tutorial) if you’d rather use the old-style tools. The mmap() function can be used to allocate memory buffers with highly customizable parameters to control access and permissions, and to back them with file-system storage if … Read more

Android scale animation on view

Here is a code snip to do exactly that. The ScaleAnimation constructor used here takes 8 args, 4 related to handling the X-scale which we don’t care about (1f, 1f, … Animation.RELATIVE_TO_SELF, 0f, …). The other 4 args are for the Y-scaling we do care about. startScale, endScale – In your case, you’d use 0f, 0.6f. Animation.RELATIVE_TO_SELF, 1f – … Read more

What’s the best way to dedupe a table?

SELECT DISTINCT <insert all columns but the PK here> FROM foo. Create a temp table using that query (the syntax varies by RDBMS but there’s typically a SELECT … INTO or CREATE TABLE AS pattern available), then blow away the old table and pump the data from the temp table back into it.

hadoop No FileSystem for scheme: file

This is a typical case of the maven-assembly plugin breaking things. Why this happened to us Different JARs (hadoop-commons for LocalFileSystem, hadoop-hdfs for DistributedFileSystem) each contain a different file called org.apache.hadoop.fs.FileSystem in their META-INFO/services directory. This file lists the canonical classnames of the filesystem implementations they want to declare (This is called a Service Provider Interface implemented via java.util.ServiceLoader, see org.apache.hadoop.FileSystem#loadFileSystems). When we use maven-assembly-plugin, it merges all our … Read more