Search Results

Search found 2185 results on 88 pages for 'n way merge'.

Page 50/88 | < Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >

  • Most efficient algorithm for merging sorted IEnumerable<T>

    - by franck
    Hello, I have several huge sorted enumerable sequences that I want to merge. Theses lists are manipulated as IEnumerable but are already sorted. Since input lists are sorted, it should be possible to merge them in one trip, without re-sorting anything. I would like to keep the defered execution behavior. I tried to write a naive algorithm which do that (see below). However, it looks pretty ugly and I'm sure it can be optimized. It may exist a more academical algorithm... IEnumerable<T> MergeOrderedLists<T, TOrder>(IEnumerable<IEnumerable<T>> orderedlists, Func<T, TOrder> orderBy) { var enumerators = orderedlists.ToDictionary(l => l.GetEnumerator(), l => default(T)); IEnumerator<T> tag = null; var firstRun = true; while (true) { var toRemove = new List<IEnumerator<T>>(); var toAdd = new List<KeyValuePair<IEnumerator<T>, T>>(); foreach (var pair in enumerators.Where(pair => firstRun || tag == pair.Key)) { if (pair.Key.MoveNext()) toAdd.Add(pair); else toRemove.Add(pair.Key); } foreach (var enumerator in toRemove) enumerators.Remove(enumerator); foreach (var pair in toAdd) enumerators[pair.Key] = pair.Key.Current; if (enumerators.Count == 0) yield break; var min = enumerators.OrderBy(t => orderBy(t.Value)).FirstOrDefault(); tag = min.Key; yield return min.Value; firstRun = false; } } The method can be used like that: // Person lists are already sorted by age MergeOrderedLists(orderedList, p => p.Age); assuming the following Person class exists somewhere: public class Person { public int Age { get; set; } } Duplicates should be conserved, we don't care about their order in the new sequence. Do you see any obvious optimization I could use?

    Read the article

  • Linux/OpenSSL:Send find output to openssl

    - by Starsky
    I am trying to send the output from the find command to OpenSSL in order to find out when certificates expire. This finds the files find . -name \*.pem -type f This generates the cert info I want openssl x509 -in certname.pem -noout -enddate Can I merge these two? Thanks for your help.

    Read the article

  • MS Access group development

    - by Hubidubi
    We are planning to redesign quite a huge MS Access application. Is there any way to work concurently on the same application or is it possible to merge two seperate instance of the same file (not the data, but the forms and code). Now Access contains the data, but in the future version MySQL will host the data and Access will be only the frontend (via ODBC)

    Read the article

  • Performance using T-SQL PIVOT vs SSIS PIVOT Transformation Component.

    - by Nev_Rahd
    Hi I am in process of building Dimension from EDW (source), wherein I need to pivot columns of source to load Dimension. Currently most of the pivoting stuff am doing is by using T-SQL PIVOT which further get used in my SSIS package to merge with Dim table This pivoting can also be achieved by SSIS PIVOT Transformation component. In regards to Performance which approach would be the best? Thanks

    Read the article

  • java and rtf editing

    - by Dainius
    Hi, I have rtf file in with I need replace some field values (with word I can do it with mail merge, but I need do this with java). I found iText (2.1.7) source code with can parse rtf files, but I can find hove to manipulate the content of file. Or maybe there is some better solution for editing rtf?

    Read the article

  • Offline product catalog

    - by Ben
    I am looking for a way to automate the production of an offline product catalog using product data contained in an SQL Server database. I have thought about using both Crystal Reports and SQL Server Reporting Services for this but there may be something better suited for the job. There is a requirement to display product images also (currently stored in the database). I thought about perhaps doing a simple Word Mail Merge for this but am not sure how I will handle images. Suggestions appreciated Thanks Ben

    Read the article

  • Git already up to date unless I reset

    - by Chris
    I have a cloned repo I use for the live site and I have it pull from a bare repo. For some reason every time I execute "git pull" I get the already up to date message. But it's not up to date and not updated. If I do a git reset --hard HEAD^ and then git pull again, the changes come in. What's the problem here and how do I fix it so that git pull will pull and merge changes in without needing a hard reset?

    Read the article

  • Iterating with CakePhp

    - by Michael
    Hi all, What do you all recommend for iterative development in cakePhp? Create a separate project and port it over once a week? Basically, what's the best way to keep a live site from a working site, and the best way to merge them automatically? Thanks!

    Read the article

  • question about sorting

    - by skydoor
    Bubble sort is O(n) at best, O(n^2) at worst, and its memory usage is O(1) . Merge sort is always O(n log n), but its memory usage is O(n). Which algorithm we would use to implement a function that takes an array of integers and returns the max integer in the collection, assuming that the length of the array is less than 1000. What if the array length is greater than 1000?

    Read the article

  • Mergesort : Revision

    - by stan
    Does merge sort work by; taking a list of values splitting it in to two take the first element of each list, the lowest value one goes in to a new list(and i guess removed from the original). comare the next two numbers - do this until one list is empty, then place the rest of the other list at the end ofthe nw list? Also, what are the ramifications of doing this on a linked list? Thanks

    Read the article

  • Pyjamas + Django: project without any external libraries

    - by gruszczy
    I would like to create small project using django and pyjamas. I tried googling for some solution on how to merge those two, but I found only projects using some external libraries using json services. Could anyone give me some advice on how to build such project so I wouldn't have to use them? I would like to use django auth system, but I don't know how to build it all without django templates and rendering.

    Read the article

  • Merging two ASF files

    - by sijith
    I have an ASF file which contain 8 audios and 1 video. Now i want to merge this file with other of same ASF type. Is it possible to do with windows media SDK. My language is VC++ Please give some help

    Read the article

  • Referencing Entity from external data model - Core Data

    - by Ben Reeves
    I have a external library which includes a core data model, I would like to add a new entity to this model which has a relationship with one of the entities from the library. I know I could modify the original, but is there a way to without needing to pollute the library? I tried just creating a new model with an entity named the same, but that doesn't work: * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't merge models with two different entities named 'Host''

    Read the article

  • Reloading of persisted entity

    - by Udi
    I'm using OpenJPA in my application as a JPA vendor. The question is theoretical or conceptual: Is there any way to tell an entity manager to load an entity from the DB rather than from it's cache? The problematic scenario: EM1.persist(Entity1) EM2.merge(Entity1) EM1.find(Entity1) <--- Entity1 is the cached version rather than the merged one.. Any elegant way to do it? I really don't want to call em.refresh(entity).

    Read the article

  • Zend_Paginator - Increase querys

    - by poru
    Hello, I started using Zend_Paginator, it works everything fine but I noticed that there is one more query which slows the load time down. The additional query: SELECT COUNT(1) AS `zend_paginator_row_count` FROM `content` The normal query: SELECT `content`.`id`, `content`.`name` FROM `content` LIMIT 2 PHP: $adapter = new Zend_Paginator_Adapter_DbSelect($table->select()->from($table, array('id', 'name'))); $paginator = new Zend_Paginator($adapter); Could I merge the two querys into one (for better performance)?

    Read the article

  • Best format to submit an autocomplete?

    - by Keyo
    I'm seeking advice on best practice when submitting a varying amount of POST variables. Do I use JSON or some character separated list to merge all the values into one field or use a sequence of fields like 'autocomplete1', 'autocomplete2' and so on. Thanks in advance, Ben

    Read the article

  • Algorithm for max integer in an array of integers

    - by gagneet
    Explain which algorithm you would use to implement a function that takes an array of integers and returns the maximum integer in the collection, assuming that the length of the array is less than 1000. Would you use Bubble Sort or Merge Sort and Why? Also, what happens to the above algorithm choice, if the array length is greater than 1000?

    Read the article

  • ASP.NET/Vb.net: How to create a frame after an image is uploaded ?

    - by stighy
    Hi guys, i would like to create a fixed size frame for user photos uploaded. I've tought: i, can create a fixed sized image (200 width x 600 height for example), with my personal frame (top, left, bottom, right element graphics) , and in the center a transparency. Ok, but i don't know how to merge the photo into the frame and save the new photo format. Does anybody have some piece of code to help me ? Thank you!

    Read the article

  • build single file application

    - by Neir0
    Hello. I am trying to merge two files. One of them is .net3.5 wpf application and other is WPF notify icon dll i use the following command: IlMerge /target:winexe /out:PS.exe "PlayerSearcher.exe" "Hardcodet.Wpf.TaskbarNotification.dll" But when i launch result assebmly my application is crashed with this error EventType : clr20r3 P1 : ps.exe P2 : 1.0.0.0 P3 : 4c0ee52f P4 : presentationframework P5 : 3.0.0.0 P6 : 4938d608 P7 : 9a1 P8 : 46 P9 : system.io.ioexception Why? And how i can to build a single file application?

    Read the article

  • Find contacts created after a particular time-stamp

    - by frieza
    Hi, is it possible to know the time at which a contact was created. Actually I want to find all contacts created after a particular time (say 12:00 pm 29th march 2010). I thought that the contact ids were assigned in an increasing order and just noting the largest id at that point would suffice. But with Android 2.0, the internal sync may merge a contact with an existing one and hence assign an older id to it. I hope I have made my question clear

    Read the article

  • Revision control for writing programming lessons

    - by Dietrich Epp
    I'd like to write a series programming lessons that guide programmers to build a certain kind of program. After each lesson, I'd like to provide sample code that implements what that lesson covered, and the next lesson would use that code as a starting point. Right now I'm using Git to keep track of the code from lesson to lesson. Each lesson has its own branch. lesson1: A--B--C \ lesson2: D--E--F \ lesson3: G--H--I However, suppose that now I want to make it easier on the Windows programmers using my lessons, so I add a Visual Studio project to lesson 1 and then merge it into lessons 2 and 3. lesson1: A--B--C--------------J \ \ lesson2: D--E--F--------K \ \ lesson3: G--H--I--L And then someone points out a bug in lesson 2 that causes crashes on certain systems. (This diagram is where I am right now, and I'm having doubts about continuing along this path.) lesson1: A--B--C--------------J \ \ lesson2: D--E--F--------K--M \ \ \ lesson3: G--H--I--L--N Here are the problems I imagine having: If I had many lessons, and I fix something in lesson 1, am I going to have to spend fifteen minutes or more just merging that one simple change? I know I'll probably have to test all of those lessons again, but I can put that off. When I make a bunch of changes to various lessons on one computer, how do I pull all of the branches at the same time? If I decide to publish these lessons, I'd like a way to tag all of the branches to correspond with what I publish. I figure I'll just need to tag each branch separately, but it would be nice if there were a better way. When I look at the history, I imagine becoming terribly confused about what I've done. Compare the above diagram to a hypothetical diagram below, where I use rebase instead of merge (and rebase has its own problems): lesson1: A--B--C--J \ lesson2: D2--E2--F2--M \ lesson3: G2--H2--I2 Do any of you have experience working with a project like this? Should I consider using a different VCS, such as Darcs? (Note: it would be a real pain to use centralized VCS, so don't suggest one of those unless the benefits are clear.) Should I consider writing plugins or extra tools for a VCS (such as a "meta tag" which tags several branches)?

    Read the article

  • Large Image in .net

    - by Modir
    I want to create large image by C#. (i have some photos with large size (4800 * 4800). i want to merge these photos.) I use Bitmap but don't support. (Error : Invalid Parameter)

    Read the article

< Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >