Search Results

Search found 741 results on 30 pages for 'merging'.

Page 8/30 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Merging arrays, adding array as dimension to existing array

    - by JohnDoe
    Lets say i have 2 arrays Array1 array($info) $info['id'] => some id $info['text'] => some text etc lets say i have a function that returns another array called images Array 2 array($images) $images[0] => some link 1 $images[1] => some link 2 etc How do i add $images to the $info array as a new dimension, as such $info['image'][0] => some link 1 $info['image'][1] => some link 2

    Read the article

  • Merging Brach into Trunk...

    - by jimbo
    Now I know this has been asked a few times, but i'm still not getting it... I use Versions which is doing a great job, I am also using beansalk and they are working nicely together. However, I have been working on a branch of the trunk (sandbox) which I now want to merge back into the trunk. Versions can't do this, so it's into Terminal. Sandbox is reversion 256 and the Trunk (because of a few other amends) is 255. Any help on this would be great, and read a few bits, but still a little lost...

    Read the article

  • Merging getComputedStyle and evaluate in Greasemonkey

    - by Keheliya Gallaba
    I need to get all the text nodes with a certain font-face in a page to an array. I tried.. textnodes = document.evaluate("//* [@style='font-family: foo;']//text()[" + "not(ancestor::script) and not(ancestor::style)]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); and textnodes = document.evaluate("//* [@face='foo']//text()[" + "not(ancestor::script) and not(ancestor::style)]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); But these does not work with pages that is styled by external CSS files. Seems getComputedStyle() is the way to go. I think what I need is something like.. var tags = document.getElementsByTagName('*'); for (var i in tags) { var style = getComputedStyle(tags[i], ''); if (style.fontFamily.match(/foo/i)) { textnodes.push(tags[i]); } } But text nodes were not returned in this method. Is there anyway I can use a hybrid of xpath evaluate() and getComputedStyle() or any other way to achieve this?

    Read the article

  • Merging two arrays in PHP

    - by Industrial
    Hi everyone, I am trying to create a new array from two current arrays. Tried array_merge, but it will not give me what I want. $array1 is a list of keys that I pass to a function. $array2 holds the results from that function, but doesn't contain any non-available resuls for keys. So, I want to make sure that all requested keys comes out with 'null':ed values, as according to the shown $result array. It goes a little something like this: $array1 = array('item1', 'item2', 'item3', 'item4'); $array2 = array( 'item1' => 'value1', 'item2' => 'value2', 'item3' => 'value3' ); Here's the result I want: $result = array( 'item1' => 'value1', 'item2' => 'value2', 'item3' => 'value3', 'item4' => '' ); It can be done this way, but I don't think that it's a good solution - I really don't like to take the easy way out and suppress PHP errors by adding @:s in the code. This sample would obviously throw errors since 'item4' is not in $array2, based on the example. foreach ($keys as $k => $v){ @$array[$v] = $items[$v]; } So, what's the fastest (performance-wise) way to accomplish the same result?

    Read the article

  • merging two tables, while applying aggregates on the duplicates (max,min and sum)

    - by cloudraven
    I have a table (let's call it log) with a few millions of records. Among the fields I have Id, Count, FirstHit, LastHit. Id - The record id Count - number of times this Id has been reported FirstHit - earliest timestamp with which this Id was reported LastHit - latest timestamp with which this Id was reported This table only has one record for any given Id Everyday I get into another table (let's call it feed) with around half a million records with these fields among many others: Id Timestamp - Entry date and time. This table can have many records for the same id What I want to do is to update log in the following way. Count - log count value, plus the count() of records for that id found in feed FirstHit - the earliest of the current value in log or the minimum value in feed for that id LastHit - the latest of the current value in log or the maximum value in feed for that id. It should be noticed that many of the ids in feed are already in log. The simple thing that worked is to create a temporary table and insert into it the union of both as in Select Id, Min(Timestamp) As FirstHit, MAX(Timestamp) as LastHit, Count(*) as Count FROM feed GROUP BY Id UNION ALL Select Id, FirstHit,LastHit,Count FROM log; From that temporary table I do a select that aggregates Min(firsthit), max(lasthit) and sum(Count) Select Id, Min(FirstHit),Max(LastHit),Sum(Count) FROM @temp GROUP BY Id; and that gives me the end result. I could then delete everything from log and replace it with everything with temp, or craft an update for the common records and insert the new ones. However, I think both are highly inefficient. Is there a more efficient way of doing this. Perhaps doing the update in place in the log table?

    Read the article

  • Merging Two Matrixes... in LISP

    - by abidikgubidik
    (defun merge-matrix (matrix-1 matrix-2) (if (not (or (eql (matrix-rows matrix-1) (matrix-rows matrix-2)) (null matrix-1) (null matrix-2))) (error "Invalid dimensions.")) (cond ((null matrix-1) (copy-tree matrix-2)) ((null matrix-2) (copy-tree matrix-1)) (t (let ((result (copy-tree matrix-1))) (dotimes (i (matrix-rows matrix-1)) (setf (nth i result) (nconc (nth i result) (nth i matrix-2)))) result)))) (merge-matrix '((3 1) (1 3)) '((4 2) (1 1))) * - EVAL: variable NULL has no value I receive an error like that how I can fix the problem, thanks

    Read the article

  • Java, merging two arrays evenly

    - by user2435044
    What would be the best way to merge two arrays of different lengths together so they are evenly distributed in the new array? Say I have the following arrays String[] array1 = new String[7]; String[] array2 = new String[2]; String[] mergedArray = new String[array1.length + array2.length]; I would want mergedArray to have the following elements array1 array1 array1 array2 array1 array1 array1 array2 array1 but if I were to change the size of the arrays to String[] array1 = new String[5]; String[] array2 = new String[3]; String[] mergedArray = new String[array1.length + array2.length]; then I would want it to be array1 array2 array1 array2 array1 array2 array1 array1 basically if it can be helped each array2 element shouldn't be touching each other; exception if array2 has a size larger than array1.

    Read the article

  • Merging and splitting overlapping rectangles to produce non-overlapping ones

    - by uj
    I am looking for an algorithm as follows: Given a set of possibly overlapping rectangles (All of which are "not rotated", can be uniformly represented as (left,top,right,bottom) tuplets, etc...), it returns a minimal set of (non-rotated) non-overlapping rectangles, that occupy the same area. It seems simple enough at first glance, but prooves to be tricky (at least to be done efficiently). Are there some known methods for this/ideas/pointers? Methods for not necessarily minimal, but heuristicly small, sets, are interesting as well, so are methods that produce any valid output set at all.

    Read the article

  • What am I doing wrong with SVN merging?

    - by randomusername
    When SVN with merge tracking works, it's really nice, I love it. But it keeps getting twisted up. We are using TortoiseSVN. We continuously get the following message: Error: Reintegrate can only be used if revisions 1234 through 2345 were previously merged from /Trunk to the reintegrate source, but this is not the case For reference, this is the method we are using: Create a Branch Develop in the branch Occasionally Merge a range of revisions from the Trunk to the Branch When branch is stable, Reintegrate a branch from the branch to the trunk Delete the branch I Merge a range of revisions from the trunk to the branch (leaving the range blank, so it should be all revisions) just prior to the reintegrate operation, so the branch should be properly synced with the trunk. Right now, the Trunk has multiple SVN merge tracking properties associated with it. Should it? Or should a Reintegrate not add any merge tracking info? Is there something wrong with our process? This is making SVN unusable - 1 out of every 3 reintegrates forces me to dive in and hack at the merge tracking info.

    Read the article

  • Github without merging

    - by tfmoraes
    I have the following situation: A software hosted at github. 4 developers, each have her own fork in github. Each developer creates and develops using branches in her own fork. Given that we use branches to develop, we want to merge our branches (in our forks) to the upstream repo. How do I merge in github without using pull request? Is it possible to merge to upstream from my own fork? Thanks in advance.

    Read the article

  • merging 3 source versioned trees into 1

    - by user309779
    This is probably an easy question... I have 4 source versions of the same software in 4 different directories. I have just started using git for version control. To date, I have just been snapping a desperate copy rolling forward. I want to merge all versions (1.0.0.1, 1.0.0.2, 1.0.0.3, 1.0.1.0) together so that I will have a reference history. Opposed to just starting out with 1.0.1.0 as the initial version. I want to get this sort of thing right form the start. Can someone outline the basic steps to accomplish this? Thanks much, XO

    Read the article

  • merging indexed array in Python

    - by leon
    Suppose that I have two numpy arrays of the form x = [[1,2] [2,4] [3,6] [4,NaN] [5,10]] y = [[0,-5] [1,0] [2,5] [5,20] [6,25]] is there an efficient way to merge them such that I have xmy = [[0, NaN, -5 ] [1, 2, 0 ] [2, 4, 5 ] [3, 6, NaN] [4, NaN, NaN] [5, 10, 20 ] [6, NaN, 25 ] I can implement a simple function using search to find the index but this is not elegant and potentially inefficient for a lot of arrays and large dimensions. Any pointer is appreciated.

    Read the article

  • Mercurial Merging only certain changesets

    - by PostMan
    Ok, so we recently converted from SVN to Mercurial. We are using TortoiseHG normally. In our one repository we have all of our projects, C++ / .NET / ASP. We have about 100 projects, all using common library projects. So it would be quite difficult task to create multiple repo's for each project. Now, we have the default branch, and let's say branchA. I'm working on BranchA and adding my uber changes to it, and I change a common library, let's say an extension method I want to commit this to branchA and default, how would I go about this? However, I don't want all my changes from branchA to be merged into default, and I don't want all the other changes from default Hopefully this is sufficient information!

    Read the article

  • Merging hashes into one hash in perl

    - by Nick
    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 = { '999' => { '993' => [] } }; $VAR1 = { '999' => { '997' => [ '986', '987', '990', '984', '989', '988' ] } }; $VAR1 = { '995' => { '101' => [] } }; $VAR1 = { '995' => { '102' => [] } }; $VAR1 = { '995' => { '103' => [] } }; $VAR1 = { '995' => { '104' => [] } }; $VAR1 = { '995' => { '105' => [] } }; $VAR1 = { '995' => { '106' => [] } }; $VAR1 = { '995' => { '107' => [] } }; $VAR1 = { '994' => { '910' => [] } }; $VAR1 = { '993' => { '909' => [] } }; $VAR1 = { '993' => { '904' => [] } }; $VAR1 = { '994' => { '985' => [] } }; $VAR1 = { '994' => { '983' => [] } }; $VAR1 = { '993' => { '902' => [] } }; $VAR1 = { '999' => { '992' => [ '905' ] } }; to this: $VAR1 = { '999:' => [ { '992' => [ '905' ] }, { '993' => [ { '909' => [] }, { '904' => [] }, { '902' => [] } ] }, { '994' => [ { '910' => [] }, { '985' => [] }, { '983' => [] } ] }, { '995' => [ { '101' => [] }, { '102' => [] }, { '103' => [] }, { '104' => [] }, { '105' => [] }, { '106' => [] }, { '107' => [] } ] }, { '996' => [] }, { '997' => [ '986', '987', '990', '984', '989', '988' ] }, { '998' => [ '908', '906', '0', '998', '907' ] }, { '991' => [ '913', '920', '918', '998', '916', '919', '917', '915', '912', '914' ] } ]}; in Perl?

    Read the article

  • merging in python

    - by Abruzzo Forte e Gentile
    Hi all I have the following 4 arrays ( grouped in 2 groups ) that I would like to merge in ascending order by the keys array. I can use also dictionaries as structure if it is easier. Has python any command or something to make this quickly possible? Regards MN # group 1 [7, 2, 3, 5] #keys [10,11,12,26] #values [0, 4] #keys [20, 33] #values # I would like to have [ 0, 2, 3, 4, 5, 7 ] # ordered keys [20, 11,12,33,26,33] # associated values

    Read the article

  • Merging Three or More Images -- PHP

    - by bballer13sn
    Before I ask my question, I'd like to thank you all in advance for helping me with this. So here's the question: So, for my website, I've been trying to make it so people's characters (which are currently composed of several pictures that are moved by CSS) are merged into one image as to make my life easier. The chunk of code that currently doesn't work is as follows: $template = $charRow['template']; $gender = $charRow['gender']; $shirt = $charRow['shirt']; $pants = $charRow['pants']; $hat = $charRow['hat']; $templatePic = imagecreatefrompng("Templates/".$template); if (!empty($shirt)) { $shirtPic = imagecreatefrompng($shirt); imagecopy($templatePic,$shirtPic,0,0,0,0,imagesx($templatePic),imagesy($templatePic)); } if (!empty($pants)) { $pantsPic = imagecreatefrompng($pants); imagecopy($templatePic,$pantsPic,0,0,0,0,imagesx($templatePic),imagesy($templatePic)); } if (!empty($hat)) { $hatPic = imagecreatefrompng($hat); imagecopy($templatePic,$hatPic,0,0,0,0,imagesx($templatePic),imagesy($templatePic)); } imagePNG($templatePic, 'Images/'); //Problem line... This is the error PHP is giving me: Warning: imagepng() [function.imagepng]: Unable to open 'Images/' for writing: Is a directory in PathToParentFolderOfFollowingFile/testFile.php on line 139 What exactly does this error mean and how can it be fixed? NOTE: $charRow is not the problem. The query to get that is just not being displayed to all of you.

    Read the article

  • Merging multiple docx files to one

    - by coding
    I am developing a desktop application in C#. I have coded a function to merge multiple docx files but it does not work as expected. I don't get the content exactly as how it was in the source files. A few blank lines are added in between. The content extends to the next pages, header and footer information is lost, page margins gets changed, etc.. How can I concatenate docs as it is without and change in it.Any suggestions will be helpful. This is my code. public bool CombineDocx(string[] filesToMerge, string destFilepath) { Application wordApp = null; Document wordDoc = null; object outputFile = destFilepath; object missing = Type.Missing; object pageBreak = WdBreakType.wdPageBreak; try { wordApp = new Application { DisplayAlerts = WdAlertLevel.wdAlertsNone, Visible = false }; wordDoc = wordApp.Documents.Add(ref missing, ref missing, ref missing, ref missing); Selection selection = wordApp.Selection; foreach (string file in filesToMerge) { selection.InsertFile(file, ref missing, ref missing, ref missing, ref missing); selection.InsertBreak(ref pageBreak); } wordDoc.SaveAs( ref outputFile, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); return true; } catch (Exception ex) { Msg.Log(ex); return false; } finally { if (wordDoc != null) { wordDoc.Close(); } if (wordApp != null) { wordApp.DisplayAlerts = WdAlertLevel.wdAlertsAll; wordApp.Quit(); Marshal.FinalReleaseComObject(wordApp); } } }

    Read the article

  • Merging $.get and $.ready

    - by cwolves
    Put simply I have an ajax call that sometimes completes before the page is loaded, so I tried wrapping the callback in $( fn ), but the callback doesn't fire if the page is loaded... Anyone have a good solution to this? $.get( '/foo.json', function( data ){ $( function(){ // won't get here if page ready beats the ajax call // process data $( '.someDiv' ).append( someData ); } ); } ); And yes, I know that if I flipped the order of those it would always work, but then my ajax calls would be needlessly deferred until the document is ready.

    Read the article

  • Merging XMLTextReaders in C#

    - by smithchelluk
    I have a website that needs to pull information from two diffferent XML data sources. Originally I only need to get the data from one source so I was building a URL in the backend that went and retrieved the data from the XML site and then parsed and rendered it in the front end of the website. Now I have to use a 2nd data source and merge the result sets (which are identically structured XML) into one result set. Here is the code I am currently using to get one XML feed. sUrl = sbUrl.ToString(); //The URL for the XML feed XmlDocument xDoc = new XmlDocument(); StringBuilder oBuilder = new StringBuilder(); //The parsed HTML output XmlTextReader oXmlReader = new XmlTextReader(sUrl); oXmlReader.Read(); xDoc.Load(oXmlReader); XmlNodeList List = xDoc.GetElementsByTagName("result"); foreach (XmlNode node in List) { XmlElement key = (XmlElement)node; //BUILD THE OUTPUT HERE } Thanks in advance for your help.

    Read the article

  • Merging some columns of two mysql tables where id = fileid

    - by garg
    There are two tables TableA filedata_id | user_id | filename 1 | 1 | file.txt 2 | 1 | file2.txt TableB a_id | date | filedataid | counter | state | cat_id | subcat_id | med_id 99 | 1242144 | 1 | 2 | v | 55 | 56 | 90 100 | 1231232 | 2 | 3 | i | 44 | 55 | 110 I want to move columns cat_id, subcat_id, med_id to TableA where tableA.filedata_id = TableB.filedataid The result should be: TableA filedata_id | user_id | filename | cat_id | subcat_id | med_id 1 | 1 | file.txt | 55 | 56 | 90 2 | 1 | file2.txt | 44 | 55 | 110 and so on. Is there a way to do this easily?

    Read the article

  • Merging elements in a scala list

    - by scompt.com
    I'm trying to port the following Java snippet to Scala. It takes a list of MyColor objects and merges all of the ones that are within a delta of each other. It seems like a problem that could be solved elegantly using some of Scala's functional bits. Any tips? List<MyColor> mergedColors = ...; MyColor lastColor = null; for(Color aColor : lotsOfColors) { if(lastColor != null) { if(lastColor.diff(aColor) < delta) { lastColor.merge(aColor); continue; } } lastColor = aColor; mergedColors.add(aColor); }

    Read the article

  • Merging DataTable(s) Column by Column.

    - by Omky
    Hello All, I want to merge two or more DataTables Colum by Column. I am developing C# Windows Application. My use case is below: I have empty data grid in my application. user will drag and drop one column from available column list box into data grid. The data grid will start displaying data for that column. Now, I will drag another column into data grid and now grid should get populated data of two columns. This will repeat till user feels that he has dropped all necessary columns. What is best way to do this? Is there any performance hits with large number of rows typically 1 million? Please help. Thanks, Omky

    Read the article

  • tf14087 Cannot undelete [file] because not all of the deletion is being undeleted

    - by Kaius
    We are getting this error when we try to merge from a development branch (Dev) back to its parent branch (Main). Main did have some changesets rolled back a few weeks ago which included the deletion of some folders which exist in Dev. We believe this is the source of the problem. What is the best way to resolve this. Main should pretty much match up with Dev but currently it is missing some sub folders. How can I get these folders / files to move from Dev to Main? We are trying to manually resolve the changes but it is a bit of a mess. It hard to believe that TFS makes things this hard to resolve.

    Read the article

  • Analyzing data from same tables in diferent db instances.

    - by Oscar Reyes
    Short version: How can I map two columns from table A and B if they both have a common identifier which in turn may have two values in column C Lets say: A --- 1 , 2 B --- ? , 3 C ----- 45, 2 45, 3 Using table C I know that id 2 and 3 belong to the same item ( 45 ) and thus "?" in table B should be 1. What query could do something like that? EDIT Long version ommited. It was really boring/confusing EDIT I'm posting some output here. From this query: select distinct( rolein) , activityin from taskperformance@dm_prod where activityin in ( select activityin from activities@dm_prod where activityid in ( select activityid from activities@dm_prod where activityin in ( select distinct( activityin ) from taskperformance where rolein = 0 ) ) ) I have the following parts: select distinct( activityin ) from taskperformance where rolein = 0 Output: http://question1337216.pastebin.com/f5039557 select activityin from activities@dm_prod where activityid in ( select activityid from activities@dm_prod where activityin in ( select distinct( activityin ) from taskperformance where rolein = 0 ) ) Output: http://question1337216.pastebin.com/f6cef9393 And finally: select distinct( rolein) , activityin from taskperformance@dm_prod where activityin in ( select activityin from activities@dm_prod where activityid in ( select activityid from activities@dm_prod where activityin in ( select distinct( activityin ) from taskperformance where rolein = 0 ) ) ) Output: http://question1337216.pastebin.com/f346057bd Take for instace activityin 335 from first query ( from taskperformance B) . It is present in actvities from A. But is not in taskperformace in A ( but a the related activities: 92, 208, 335, 595 ) Are present in the result. The corresponding role in is: 1

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >