Sunday, 15 September 2013

excel vba - Visual basic delete duplicates keep unique -


Prior to placing rows with

is trying to delete rows with duplicate cell materials and unique values ​​.:

  R1A2AR3BR4CR5C  

In this scenario, only B is unique, both A and C are not unique Because they are more than once. (Most search solutions duplicative incorrectly found by thus creating unique values ​​& amp ;. b)

This is not a good place to ask for codes only. If you display your efforts, then someone will probably show you how to solve your problem. Finding code that is almost identical to the code you need here without trying to optimize the code that does not count as an attempt for most people.

You need to consider how the code you have designed your solution to consider the slots There are several ways for a good design in that design, but I usually recommend asking people by asking myself: "How do I manually do this?"

In your example list, the rows are sorted on the target column. Is this true about actual figures or can you sort the actual data through the target column?

The problem may be more difficult so that the data are not sorted and can not be sorted, although not impossible in this situation, I Sujaunga:

  1. Find an empty column on the right side of your data.
  2. Fill that column with row numbers.
  3. Sort by target column.
  4. Shown below.
  5. Delete the columns of the row number sorted by the row number
  6. . Delete the duplicate as

The algorithms assume that the rows are sorted.

If you were to delete rows, you will probably start at the top would mean that every time you need to include all the rows in each row of the cleared a few lines, then you Will decide later on. It's fast to start from below. I suggest you do something like this:

  Set the Stop Line Number RowCront & gt; 1 If RowCrnt The goal of the column column is equal to the target RowCrnt -1 then got 'is set to delete the bottom row of a block RowBlockBottom = RowCrnt RowCrnt = RowCrnt - 1 Do While RowCrnt column is equal RowBlockBottom column RowCrnt to target = RowCrnt - 1 loop RowCrnt + 1 RowBlockBottom Delete 'RowCrnt points rows in the front row or RowCrnt = RowCrnt be matched up against the line - one end of the loop  

Try "Run" on the above pseudo code on paper Think of Code Look for any deliberate or accidental errors It's an easy-to-use design that works for the most simple problems. If you can master this technique then you will be prepared to deal with many problems in future without the need of help.

I hope that the code you got will be included in the statements that will do everything in the above pseudo code. Try to create the necessary macros by changing the pseudo code with relevant statements Do not forget to save a copy of your data before the macro trial.

If the code does not work as you require and why you can not see it, post it here together it does what it does and you want to do it Interpretation of separation between Someone will help.

Good luck.


I want Text Editor in asp.net MVC? -


I have a project in which I will read the MS-Word file and retrieve the text from the file and then this feature will allow user text To edit and then save it, I have read the file and have to successfully remove the text using Open XML. My question is how can I put some text in some editors (some editors are required) and when the user edits or does anything, how can I get the text from the text editor and save it .

I have used TinyMCE in ASP.NET with the best answer: try it here:

In addition to this, you can also use it:

Both will allow you to submit text with the same format, the word is in the document.


asp.net - Modification of the language dates on a website -


I am currently developing a website with ASP.NET where I need to display dates.

Website hosting is in Windows when I test my website in local (on my personal computer with blue emulator), the dates are displayed in French (and this is what I want). But, when I publish and test on Azer, the dates are displayed in English. It is a recent problem, it was working a few days back.

I have not worked on the dates myself, but some packages have been updated on computers configured in English (by nuget package manager) I do not know that this could have an effect.

You need to set your current culture thread. This is the default for you locally for French, but when it's in blue, then default is N-US

How to set culture, or just an example to override the date format See for


c - Make a file availabe on all nodes -


I am writing an MPI application that takes a filename as a logic and from a file using regular C functions Tries to read I run this application on several nodes of cluster using qsub , which in turn uses mpiexec .

This application runs fine on the local node where I have to file directly to mpiexec :

  mpiexec -n 4 ~ / My_app ~ / input_file.txt  

But when I submit it to qsub to run on other nodes of the cluster, the part of reading the file fails . Errors of the application on the fopen call - this file can not open (likely because it does not exist).

The question is, how can I make the file available to all the nodes? I looked at the qsub manpage and did not fix anything.

I think the vanilla gorilla does not need any more answers? However, let's consider the case of a pathological system, which does not have any parallel file system and the file system available only on one node. To achieve its goal there is a way in ROMIO (a very common MPI-IO implementation):


iOS Swift :How to port the following Objective C method to Swift? -


I am learning swift and trying to know all the loops and know about it.

This objective is trying to port the code into Swift.

  NSInteger sort (id num1, id num2, void * context) {int v1 = [num1 intValue]; Int v2 = [num2 intValue]; If sending (v1 and lieutenant; v2) NSordadding; Else if NSOrderedDescending (v1> v2); Others will return NSOrdered; }  

This is what I have not yet done.

  Function type (num1: AnyObject, num2: AnyObject, context: zero) - & gt; NSInteger {var v1: Int = num1.integerValue var v2: Int = num2.integerValue if (v1 and lt; v2) {return nsord ordering} and if (v1> v2) {return NSOrderedDescending} else {return NSOrderedSame}}  

There is a problem with this method NSOrderedAscending is not in existence and I believe that I have the legal name all wrong. Any tips or suggestions are appreciated.

There are issues that do not despise a straightforward harbor.

For one thing, the object-C code says the intValue method on the object. This indicates that the object to be passed to the function is expected to be the NSString example, so the swift function should actually take the NSString argument, not AnyObject argument (unless the function actually can not take any type of object, see the note below in that case). Also, the reference argument is not being used at all, so it is not really necessary. Also, the type of return is actually nscimpression result , and not NSInteger . Given this, the Swift version will look something like this:

  Fun sort (num1: NSString, num2: NSString) -> NSComparisonResult {v1 = num1.intValue v2 = num2.intValue if v1 & lt; V2 {return NSComparisonResult.OrderedAscending} and if v1 == v2 {NSComparisonResult.Same} and {NSComparisonResult.OrderedDescending}}  

If SWIFT version actually does Need to work on any type of object, it would be better to use conditional artists:

  Joy sort (num1: AnyObject, num2: AnyObject) -> ; NSComparisonResult {if let's n1 = num1? NSString {if let's say n2 = num2? NSString {let v1 = n1.intValue v2 = n2.intValue if v1 & lt; V2 {return NSComparisonResult.OrderedAscending} and if v1 & gt; V2 {return NSComparisonResult.OrderedDescending}}} NSComparisonResult.Same}  

ruby - Passing success and failure handlers to an ActiveJob -


I have an ActiveJob which is to load a piece of data from external system from HTTP. When that work is done, I want to do another task which does postprocessing and then submits the data to a different external system.

I do not want the first job to know about other jobs, because

  • reusable
  • none of this first job business Not even, basically
  • Similarly, if I fail to load the data - maybe the user be notified, then maybe we will have to Try, maybe we log in it and throw your hands - still it is different depending on it It is possible. There is no need to include the explanation of the exception, and the logic for the job, which connects with other systems to handle it.

    In Java (where I have most experience), I can use some like guava to add success and failure callback after the fact:

      MyDataLoader loader = New MyDataLoader (someDataSource) ListenableFuture & lt; Data & gt; Future = executor submit (loader); Futures.ADClack (Future, New Future Callback  () {Public Results at Zero (Data Result) {Process Data (Results);} Public Zero (Throwable) {handleFailure (t);} at zero; });  

    However active job does not provide this type of external callback mechanism - the best I can do in "active work default", after_perform and rescue_from are only for calls from within the job class and after_peform is not to distinguish between success and failure.

    So the best I have been able to come up with (and I am not claiming this very good) is to pass some commodity into the job's display method , As follows:

      class MyRecordLoader & lt; ActiveJob :: Base # The cost of the load data (hopefully on the background queue) and #define the result, or any exception to the appropriate Lambda near # # @PRAMData_Source [String] url # @PRAM to load data from ONSUVE [- & gt; (String)] A lambda which will be recorded # data, if it has been successfully loaded # @Only on_failure [-> (Exception)] A lambda that will be passed to any # exception, if a DRF display (data_source, on_suse, on_fileer) starts, then result = load_data_expensively_from data_source on_success.call (result) rescue = & gt; Exception on_failure.call (end)  

    (Side note: I do not know what yardoc syntax is to declare lambda as a parameter. Is it true, Or,

      MyRecordLoader.perform_later (some_data_source, method (: process_data), method (: handle_failure)) 

    < P> Code>

    This is not the least awesome on the calling side, but it seems to be clunky, and I can not help but suspect it for There is a similar pattern I just do not search And I am worried that, as a Ruby / Rail novice, I am only bending to active Job, which was not meant to be done in the first place. All the active examples are getting me 'fire and mistake' - asynchronous form The result of "returning" does not appear in the case of an ActiveJob use.

    In addition to this, it is not clear to me that

    What's the Ruby Way?


    Update: As the dre-hh, ActiveJob did not get the right tool here. It was also unbelievable, and more and more for the situation. I switch in return, which improves the case of use, and the work that is mostly IO-bound, is also fast enough on MRI.

    ActiveWeb does not have an async library like a future or promise.

    This is the only interface to work in the background. The current thread / process does not get any results from this operation.

    For example, when the Sidekick is used as the Active Job Queue, it will serialize the parameters of the display method in the Radius Store. Another demon process running in the context of your Rail app will be looking at the queue queue and will prompt your workers to start with serialized data.

    Therefore the callback pass may be fine, however, why should they take it as another category. On passing the callback, it will understand whether they are moving (turning on different invitations) However, as you have implemented them on the calling class, consider moving those methods to your job worker class only. Please.


    html - Using model attributes in a th:href link -


    Is there a way to refer to a model attribute in the th: href link? For example

      & lt; A th: text = "$ {currentUser}" th: href = "@ {/ user / {currentUser}}" & gt; & Lt; / A & gt;  

    Here, currentUser is a model variable specified in a controller. It can be seen in the th: text tag. However, th: href thymeleaf parsing fails If there is a way to refer to a model feature like this, in th: href ? For reference, this is a Spring MVC (bootstrap) application with Thiamelfl support. Model Variables in th: href You can call it $ { ...} to be included with the indicator, you can add the pipe easily by adding:

      & lt; A th: text = "$ {currentUser}" th: href = "@ {| / user / $ {currentUser} |}" & gt; & Lt; / A & gt;  

    Official document on url syntax.