combine

How to combine several C/C++ libraries into one?

I'm tired of adding ten link libraries into my project, or requiring eight of them to use my own. I'd like to take existing libraries like libpng.a, libz.a, libjpeg.a, and combine them into one single .a library. Is that possible? How about combining .lib libraries? ...

Asp.net path compaction

I have an asp.net url path which is being generated in a web form, and is coming out something like "/foo/bar/../bar/path.aspx", and is coming out in the generated html like this too. It should be shortened to "/foo/bar/path.aspx". Path.Combine didn't fix it. Is there a function to clean this path up? ...

How to combine requests for multiple javascript files into one http request?

This concept is a new one for me -- I first came across it at the YUI dependency configurator. Basically, instead of having multiple requests for many files, the files are chained into one http request to cut down on page load time. Anyone know how to implement this on a LAMP stack? (I saw a similar question was asked already, but it se...

Merging dictionaries in C#

What's the best way to merge 2 or more dictionaries (Dictionary<T1,T2>) in C#? (3.0 features like LINQ are fine). I'm thinking of a method signature along the lines of: public static Dictionary<TKey,TValue> Merge<TKey,TValue>(Dictionary<TKey,TValue>[] dictionaries); or public static Dictionary<TKey,TValue> ...

Merge WAV files in C#

Hi, I have 2 wav files that I want to make/combine/merge into one file with the two sound tracks. Is there any api for that task or some built inn commands in .NET that can I can use in som genius way to make this task possible? Many thanks for the help. :) ...

Good algorithm for combining items from N lists into one with balanced distribution?

Let's say I have the three following lists A1 A2 A3 B1 B2 C1 C2 C3 C4 C5 I'd like to combine them into a single list, with the items from each list as evenly distributed as possible sorta like this: C1 A1 C2 B1 C3 A2 C4 B2 A3 C5 I'm using .NET 3.5/C# but I'm looking more for how to approach it then specific code. EDIT: I need ...

How do I get ASP.Net CompositeScript to cache in the browser?

I have been trying to improve the performance of a web page that references several separate javascript files. I found the new CompositeScript feature in .Net 3.5 SP1 that allows you to combine scripts at runtime through the ScriptManager and it works great to reduce the number of hits on our server at page load. But the problem is tha...

Algorithm for 'Syncing' 2 Arrays

Array 1 | Array 2 ================= 1 | 2 2 | 3 3 | 4 5 | 5 | 6 What is a good algorithm to 'sync' or combine Array 2 into Array 1? The following needs to happen: Integers in Array 2 but not in Array 1 should be added to Array 1. Integers in both Arrays can be left alone. Integers in Array 1 ...

Best way to combine 2 or more byte arrays in C#

I have 3 byte arrays in C# that I need to combine into one. What would be the most efficient method to complete this task? ...

Generate combinations ordered by an attribute

Hi, I'm looking for a way to generate combinations of objects ordered by a single attribute. I don't think lexicographical order is what I'm looking for... I'll try to give an example. Let's say I have a list of objects A,B,C,D with the attribute values I want to order by being 3,3,2,1. This gives A3, B3, C2, D1 objects. Now I want to g...

Python - How to calculate equal parts of two dictionaries?

I have a problem with combining or calculating common/equal part of these two dictionaries. In my dictionaries, values are lists: d1 = {0:['11','18','25','38'], 1:['11','18','25','38'], 2:['11','18','25','38'], 3:['11','18','25','38']} d2 = {0:['05','08','11','13','16','25','34','38','40', '43'], 1:['05', '...

Create a UIImage from two other UIImages on the iPhone

Hi, I'm trying to write an animation on the iPhone, without much success, getting crashes and nothing seems to work. What I wanna do appears simple, create a UIImage, and draw part of another UIImage into it, I got a bit confused with the context and layers and stuff. Could someone please explain how to write something like that (effi...

Help merge 2 arrays and sort by key

I am having some trouble with a basic php issue and want to know if anyone can help me out. Basically I need to combine the results of 2 queries, and merge the arrays based on the key, while retaining the 1 key to 1 value that is present in both queries. For example: "select * from table 1, table 2 where table1.id = table2.id"... ma...

Theory of storing a number and text in same SQL field

I have a three tables Results: TestID TestCode Value Tests: TestID TestType SysCodeID SystemCodes SysCodeID ParentSysCodeID Description The question I have is for when the user is entering data into the results table. The formatting code when the row gets the focus changes the value field to a dropdown combobox if the testCode is of...

MySql query, combine tables

I have two MySql tables, one containing food and one containing recipes (groups of foods). The recipe-table have a title and then has a item-table containing all food in that recipe. That table is linked to the food-table. Now I need to combine these tables and list them togheter. Food-table: foodid | title | calories 1 banana...

Unable to combine English words from letters by Ruby

I need to find all English words which can be formed from the letters in a string sentence="Ziegler's Giant Bar" I can make an array of letters by sentence.split(//) How can I make more than 4500 English words from the sentence in Ruby? [edit] It may be best to split the problem into parts: to make only an array of words with...

How to combine 2 LINQ into one

I am trying to populate a treeview control with some info and for that I am using 2 separate LINQ as follows; Dim a = From i In CustomerTable _ Group By ShipToCustName = i.Item(6), BillToCustName = i.Item(4) Into Details = Group, Count() _ Order By ShipToCustName Dim b = From x In a _ Group...

How to combine two mono-color images?

I need to write an anaglyph images program. Let say I have two mono-color images: red color one and cyan color one. How can I combines them into one to make an anaglyph image? Please give me an advice. Thank you. P/s: I'm using C# program language. ...

Java appending XML docs to existing docs.

I have two XML docs that I've created and I want to combine these two inside of a new envelope. So I have <alert-set> <warning>National Weather Service...</warning> <start-date>5/19/2009</start-date> <end-date>5/19/2009</end-date> </alert-set> and <weather-set> <chance-of-rain type="percent">31</chance-of-rain> <conditi...

Combine two images with one being transparent

I have two bitmap images. One contains a picture taken with a usb camera. The other will contain a shape, like a rectagle, but it can also be a trapezoid, or lets say, a random shape with only one color in it. The rest of the image is white right now. The two images aren't of the same size but scaling algorithms aren't the most difficul...