merge

How can I modify/merge Jinja2 dictionaries?

I have a Jinja2 dictionary and I want a single expression that modifies it - either by changing its content, or merging with another dictionary. >>> import jinja2 >>> e = jinja2.Environment() Modify a dict: Fails. >>> e.from_string("{{ x[4]=5 }}").render({'x':{1:2,2:3}}) Traceback (most recent call last): File "<stdin>", line 1, in...

Merging k sorted linked lists - analysis

Hi! I am thinking about different solutions for one problem. Assume we have K sorted linked lists and we are merging them into one. All these lists together have N elements. The well known solution is to use priority queue and pop / push first elements from every lists and I can understand why it takes O(N log K) time. But let's take ...

PHP to Mesh 2 PDF'S Together or not?

I have an already pre-designed PDF, and I would like to fill the PDF with some database information. So I'm curious if I should save the PDF into JPG's and render them out with the data on top of the image and re-create a PDF. Or is there a way to use the PDF already, and print data into the PDF that is already made? I am trying to fi...

How do I accept all changes from a remote?

I'm doing a pull origin some_branch and can see there are a lot of changes. Eventually I don't mind if their erase all mine. How can I accept them all instead or using mergetool and merge files one by one? ...

Intelligent Merge of two Arrays (3-way-kindof)

I have two Arrays, each represents a list of Stories. Two users can concurrently modify the order, add or remove Stories, and I want those changes merged. An example should make this clearer Original 1,2,3,4,5 UserA (mine) 3,1,2,4,5 (moved story 3 to start) UserB (theirs) 1,2,3,5,4 (moved story 5 forward) The result of the ab...

DataTable does not merge user defined objects

I got a problem with a DataTable handling an object defined by myself (Position). The object stores some data and overwrites ToString, Equals and GetHashCode. Further it provides the static operators for == and !=. The DataTable works fine as long the column storing this object is not a key column. Setting it as a PrimaryKey and merge a...

In terminal, merging multiple folders into one.

I have a backup directory created by WDBackup (western digital external HD backup util) that contains a directory for each day that it backed up and the incremental contents of just what was backed up. So the hierarchy looks like this: 20100101 My Documents Letter1.doc My Music Best Songs Every First Songs.mp3 My...

What is the correct way to merge/transform a dev branch into a stable branch in Mercurial?

I work for a web development company that uses Mercurial as its DVCS of choice. We're currently in the process of creating a new version of a site that is already in production. Both a stable and a development branch of the site exist in the same repository. The production site runs off the stable branch, and developers obviously code a...

How to merge data using php.

Currently my MySQL data stored like below product | total ------------------------------------------ puma,adidas | 100.00,125.00 puma | 80.00 reebok,adidas,puma | 70.00,100.00,125.00 adidas,umbro | 125.00,56.00 How to combine, explode, merge and total it like this in php? puma ...

Should I merge .pbxproj files with git using merge=union?

I'm wondering whether the merge=union option in .gitattributes makes sense for .pbxproj files. The manpage states for this option: Run 3-way file level merge for text files, but take lines from both versions, instead of leaving conflict markers. This tends to leave the added lines in the resulting file in random order and the user shoul...

Merge entries in CakePHP

Let's say I have a Model, for example User, and I want to merge two instances of this Model, say merge User2 into User1. Explicitly this is what I mean: If a field is already filled in User1, it should remain the same If a field is missing in User1 but is present in User2, it should be copied If SomeModel BelongsTo User, every instance...

Simple example of <merge> and <include> usage in Android XML-layouts.

I'm curious about the <merge> and <include> tags in Android XML-layouts. I've read two tutorials, but haven't yet found a simple example usage. Would be happy if someone could provide such an example or give a pointer to one. ...

Merging multiple array then sorting by array value count

Hi, Please help me, i need to merge multiple arrays then sorting it by array value count. Below is the problem: $array1 = array("abc", "def", "ghi", "jkl", "mno"); $array2 = array("mno", "jkl", "mno", "ghi", "pqr", "stu"); $array3 = array_merge($array1, $array2); $array4 = ??? print_r($array4); I want the returns of $array4 like thi...

How do you get subversion diff summary to ignore mergeinfo properties?

I have subversion 1.6.5 client and 1.5.4 server. And I mostly only care about diffs on fully repository paths, not working copies. When diffing branches, ones that have been merged already show up as identical except for the mergeinfo properties. This is a touch annoying for a human who has to then look through the changes looking for ...

how can I "force" a branch upon the trunk, in the case I can't "reintegrate"?

We created a branch from the trunk on which a major refactoring was done. Meanwhile, the trunk advanced a few revisions with some fixes. We don't want these changes on the branch, so we don't want to "catch-up" merge the trunk to the branch, because we don't want to mix the old and new code. But without this I can't reintegrate the branc...

SVN Merge returns nothing...

Here is the scenario: Windows Vista environment. SVN version 1.6.11. I'm on my branch directory. I want to update my branch with a particular change from my trunk. Using command line (using SlikSVN) I enter the following and it returns nothing (returns a blank line and no merge occurs): svn merge -r 11846:11891 http://trunk//AppConstan...

ASP.NET MVC Membership DB must be merged with site DB?

I am planning to use ASP.NET MVC2 implemented membership system to manage users. Database that uses application should have tables that are related with these users. Is it possible to use two different databases and make relationships (foreign keys) between them or I will have to merge these two databases into one? Thanks, Ile ...

FileMerge: This file type cannot be merged.

FileMerge.app fails with an odd message: This file type cannot be merged. when I try to save successfully merged text files, which definitely can be merged. (I invoke FileMerge from git using opendiff tool on OS X 10.6.3, but problem happens even when I select files to merge manually) Why is it happening? How can I avoid this pr...

How can I merge several hashes into one hash in Perl?

In Perl, how do I get this: $VAR1 = { '999' => { '998' => [ '908', '906', '0', '998', '907' ] } }; $VAR1 = { '999' => { '991' => [ '913', '920', '918', '998', '916', '919', '917', '915', '912', '914' ] } }; $VAR1 = { '999' => { '996' => [] } }; $VAR1 = { '999' => { '995' => [] } }; $VAR1 = { '999' => { '994' => [] } }; $VAR1 = { '9...

Problem merging similar XML files with XSL

I have two documents that I need to merge, that happen in a way that I don't seem to be able to find covered in other examples. Namely, that it needs to match not only on a node's attribute at one level, but also on the value of an attribute a node level below that, to get that node's value. I'm trying to take this sample: <?xml vers...