All Questions

824
votes
12answers
630975 views

How to join (merge) data frames (inner, outer, left, right)?

Given two data frames: df1 = data.frame(CustomerId = c(1:6), Product = c(rep("Toaster", 3), rep("Radio", 3))) df2 = data.frame(CustomerId = c(2, 4, 6), State = c(rep("Alabama", 2), rep("Ohio", 1))) ...
150
votes
7answers
100569 views

Simultaneously merge multiple data.frames in a list

I have a list of many data.frames that I want to merge. The issue here is that each data.frame differs in terms of the number of rows and columns, but they all share the key variables (which I've call...
871
votes
55answers
634923 views

How to merge two arrays in JavaScript and de-duplicate items

I have two JavaScript arrays: var array1 = ["Vijendra","Singh"]; var array2 = ["Singh", "Shakya"]; I want the output to be: var array3 = ["Vijendra","Singh","Shakya"]; The output array should ha...
1101
votes
19answers
322444 views

How do you merge two Git repositories?

Consider the following scenario: I have developed a small experimental project A in its own Git repo. It has now matured, and I'd like A to be part of larger project B, which has its own big reposito...
434
votes
19answers
256042 views

Embedding DLLs in a compiled executable

You know, I haven't seen a good answer for this anywhere. Is it possible to embed a pre-existing DLL into a compiled C# executable (so that you only have one file to distribute)? If it is possible, ho...
54
votes
2answers
19426 views

Using merge..output to get mapping between source.id and target.id

Very simplified, I have two tables Source and Target. declare @Source table (SourceID int identity(1,2), SourceName varchar(50)) declare @Target table (TargetID int identity(2,2), TargetName varchar(...
29
votes
3answers
3833 views

roll join with start/end window

Consider the following data.tables. The first defines a set of regions with start and end positions for each group library(data.table) d1 <- data.table(x=letters[1:5], start=c(1,5,19,30, 7), end=...
729
votes
3answers
501151 views

How to merge a specific commit in Git

I have forked a branch from a repository in GitHub and committed something specific to me. Now I found the original repository had a good feature which was at HEAD. I want to merge it only without pr...
805
votes
14answers
485843 views

JPA EntityManager: Why use persist() over merge()?

EntityManager.merge() can insert new objects and update existing ones. Why would one want to use persist() (which can only create new objects)?
235
votes
12answers
318988 views

Oracle: how to UPSERT (update or insert into a table?)

The UPSERT operation either updates or inserts a row in a table, depending if the table already has a row that matches the data: if table t has a row exists that has key X: update t set mystuff.....

Previous Next