Search Results

Search found 174 results on 7 pages for 'reorder'.

Page 2/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • capture text, including tags from string, and then reorder tags with text

    - by Brian
    I have the following text: abcdef<CONVERSION>abcabcabcabc<2007-01-12><name1><2007-01-12>abcabcabcabc<name2><2007-01-11>abcabcabcabc<name3><2007-02-12>abcabcabcabc<name4>abcabcabcabc<2007-03-12><name5><date>abcabcabcabc<name6> I need to use regular expressions in order to clean the above text: The basic extraction rule is: <2007-01-12>abcabcabcabc<name2> I have no problem extracting this pattern. My issue is that within th text I have malformed sequences: If the text doesn't start with a date, and end with a name my extraction fails. For example, the text above may have several mal formed sequences, such as: abcabcabcabc<2007-01-12><name1> Should be: <2007-01-12>abcabcabcabc<name1> Is it possible to have a regular expression that would clean the above, prior to extracting my consistent pattern. In short, i need to find all mal formed patterns, and then take the date tag and put it in front of it, as provided in the example above. Thanks.

    Read the article

  • NSTableView won't begin dragging rows if the mouseDown happens within the rect of an NSButtonCell.

    - by Joel Day
    I currently have an odd case where I need to be able to reorder rows in an NSTableView, but the only column happens to be an NSButtonCell. I'm trying to see how I can override NSButtonCell's mouse tracking in order to get it to behave in a way so that the NSTableView will begin dragging the row, but am not having much luck. Additional info that might affect the behavior: With this NSTableView, I am not allowing any rows to be selected, but I have forced mouse tracking to always occur for all cells. This is so that the button can still be clicked even though its row can never be selected. Thanks!

    Read the article

  • Looking for solution to persist rows sequence in a database table that allow efficient reordering at

    - by Chau Chee Yang
    I have a database table. There is a field name "Sequence" that indicate sequence when user presents the rows in report or grid visually. When the rows are retrieved and presented in a grid, there are few UI gadget that allow user to reorder the rows arbitrary. The new sequence will be persist in database table when user commit the changes. Here are some UI operations: Move to first Move to last Move up 1 row Move down 1 row multi-select rows and move up or down multi-select rows and drag to new position For operation like "Move to first" or "Move to Last", it usually involve many rows and the sequence those rows would need to be updated accordingly. This may not be efficient enough at runtime. It is a common practice to use INTEGER as sequence's data type. Other solution is using "DOUBLE" or "FLOAT" that could overcome the mass update of row sequence but we will face problem if we reach the limit of precision.

    Read the article

  • What does reorder() function do in Joomla? See description..

    - by Parth
    What does reorder() function do in Joomla? I have a statement for a function of menu "copy" in administrator code for menu as: $curr->reorder( 'menutype = '.$this->_db->Quote($curr->menutype).' AND parent = '.(int) $curr->parent ); as i Have executed this code it has reordered my id to any other position.. I just need to know is this reorder() function a inbuilt function of joomla? If yes, WHat and how does it do what he has done it to my ids ? :( I am Newbie to Joomla PLs help EDIT How can i get the the reordered output just after calling the function?

    Read the article

  • How to stop UITableView moveRowAtIndexPath from leaving blank rows upon reordering

    - by coneybeare
    I am having an issue where in reordering my UITableViewCells, the tableView is not scrolling with the cell. Only a blank row appears and any subsequent scrolling gets an Array out of bounds error without any of my code in the Stack Trace. Here is a quick video of the problem. Here is the relevant code: - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { return indexPath.section == 1; } - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { BOOL ret = indexPath.section == 1 && indexPath.row < self.count; DebugLog(@"canMoveRowAtIndexPath: %d:%d %@", indexPath.section, indexPath.row, (ret ? @"YES" : @"NO")); return ret; } - (void)delayedUpdateCellBackgroundPositionsForTableView:(UITableView *)tableView { [self performSelectorOnMainThread:@selector(updateCellBackgroundPositionsForTableView:) withObject:tableView waitUntilDone:NO]; } - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { if (fromIndexPath.row == toIndexPath.row) return; DebugLog(@"Moved audio from %d:%d to %d:%d", fromIndexPath.section, fromIndexPath.row, toIndexPath.section, toIndexPath.row); NSMutableArray *audio = [self.items objectAtIndex:fromIndexPath.section]; [audio exchangeObjectAtIndex:fromIndexPath.row withObjectAtIndex:toIndexPath.row]; [self performSelector:@selector(delayedUpdateCellBackgroundPositionsForTableView:) withObject:tableView afterDelay:kDefaultAnimationDuration/3]; } And here is the generated Stack Trace of the crash: Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000002, 0x0000000000000000 Crashed Thread: 0 Dispatch queue: com.apple.main-thread Application Specific Information: iPhone Simulator 3.2 (193.3), iPhone OS 3.0 (7A341) *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray removeObjectsInRange:]: index (6) beyond bounds (6)' Thread 0 Crashed: Dispatch queue: com.apple.main-thread 0 CoreFoundation 0x302ac924 ___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___ + 4 1 libobjc.A.dylib 0x93cb2509 objc_exception_throw + 56 2 CoreFoundation 0x3028e5fb +[NSException raise:format:arguments:] + 155 3 CoreFoundation 0x3028e55a +[NSException raise:format:] + 58 4 Foundation 0x305684e9 _NSArrayRaiseBoundException + 121 5 Foundation 0x30553a6e -[NSCFArray removeObjectsInRange:] + 142 6 UIKit 0x30950105 -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow] + 862 7 UIKit 0x30947715 -[UITableView layoutSubviews] + 250 8 QuartzCore 0x0090bd94 -[CALayer layoutSublayers] + 78 9 QuartzCore 0x0090bb55 CALayerLayoutIfNeeded + 229 10 QuartzCore 0x0090b3ae CA::Context::commit_transaction(CA::Transaction*) + 302 11 QuartzCore 0x0090b022 CA::Transaction::commit() + 292 12 QuartzCore 0x009132e0 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 84 13 CoreFoundation 0x30245c32 __CFRunLoopDoObservers + 594 14 CoreFoundation 0x3024503f CFRunLoopRunSpecific + 2575 15 CoreFoundation 0x30244628 CFRunLoopRunInMode + 88 16 GraphicsServices 0x32044c31 GSEventRunModal + 217 17 GraphicsServices 0x32044cf6 GSEventRun + 115 18 UIKit 0x309021ee UIApplicationMain + 1157 19 XXXXXXXX 0x0000278a main + 104 (main.m:12) 20 XXXXXXXX 0x000026f6 start + 54 NOte that the array out of bounds length is not the length of my elements (I have 9), but always something smaller. I have been trying to solve this for many hours days without avail… any ideas? UPDATE: More code as requested In my delegate: - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { return UITableViewCellEditingStyleNone; } - (NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath { int count = [(UAPlaylistEditDataSource *)self.dataSource count]; if (proposedDestinationIndexPath.section == 0) { return [NSIndexPath indexPathForRow:0 inSection:sourceIndexPath.section]; }else if (proposedDestinationIndexPath.row >= count) { return [NSIndexPath indexPathForRow:count-1 inSection:sourceIndexPath.section]; } return proposedDestinationIndexPath; } …thats about it. I am using the three20 framework and I have not had any issues with reordering till now. The problem is also not in the updateCellBackgroundPositionsForTableView: method as it still crashes when this is commented out.

    Read the article

  • Bringing specific results to the front using one MySQL query.

    - by animuson
    I'm setting up my geolocation feature which lists out all the countries in order of name. However, most websites have it set up where the popular countries (such as United States, United Kingdom, Canada, Australia) are at the front of the list (are shown first rather than in their assigned places). Is it possible to achieve this using the same MySQL query that I am already running to select them? SELECT * FROM `global_flags` ORDER BY `country` Is there a better alternative somewhere? Perhaps something that can reorganize the results after the database has already been queried? I don't want to exclude those results and then manually type them at the beginning because that would waste more space in the file.

    Read the article

  • ReorderListView in WPF

    - by Philipp Schmid
    I love the controls from the Bag-Of-Tricks. I am interested in modifying the ReorderListBox control to get a ReorderListView control. However, simply changing the base class from ListBox to ListView is not working. When I try to add a ReorderListView to XAML like this: <lib:ReorderListView Grid.Row="1"> <ReorderListView.View> <GridView> <GridViewColumn Header="Data1" /> </GridView> </ReorderListView.View> </lib:ReorderListView> I get an error ("The tag 'ReorderListView.View' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'.) How do I modify the ReorderListBox example to get this to work? Has anyone already succeeded in doing this?

    Read the article

  • Standard term for a thread I/O reorder buffer?

    - by Crashworks
    I have a case where many threads all concurrently generate data that is ultimately written to one long, serial file. I need to somehow serialize these writes so that the file gets written in the right order. ie, I have an input queue of 2048 jobs j0..jn, each of which produces a chunk of data oi. The jobs run in parallel on, say, eight threads, but the output blocks have to appear in the file in the same order as the corresponding input blocks — the output file has to be in the order o0o1o2... The solution to this is pretty self evident: I need some kind of buffer that accumulates and writes the output blocks in the correct order, similar to a CPU reorder buffer in Tomasulo's algorithm, or to the way that TCP reassembles out-of-order packets before passing them to the application layer. Before I go code it, I'd like to do a quick literature search to see if there are any papers that have solved this problem in a particularly clever or efficient way, since I have severe realtime and memory constraints. I can't seem to find any papers describing this though; a Scholar search on every permutation of [threads, concurrent, reorder buffer, reassembly, io, serialize] hasn't yielded anything useful. I feel like I must just not be searching the right terms. Is there a common academic name or keyword for this kind of pattern that I can search on?

    Read the article

  • How do I arbitrarily reorder lines in a text file using a Unix shell?

    - by Tim Bellis
    I've got a text file with an arbitrary number of lines, e.g.: one line some other line an additional line one more here I'd like to write a script to reorder those lines based on a given order. e.g. An input of 2 1 3 4 would swap the first and second lines. An input of 3 1 2 4 would put the 3rd line first, the 1st line second, the 2nd line third and keep the 4th line fourth. I could hack something together, but I'm wondering if there's an elegant solution? I can use either bash or ksh.

    Read the article

  • Possible to exclude or reorder a column from `*` ?

    - by Earlz
    Is it possible to exclude a column from a select * from table statement with SQL Server? I have a need for this and this is my only option other than parsing a raw SQL string to get out the required field names (I really don't want to do that). Just to be bold. When the query is made I do not have access to the list of fields needed from the table but I do know which field I do not need. This is part of a complex multi-part query. Surely there must be some way even if it's "hackish" such as using table variables or views My other option is to reorder the columns. My problem is with ExecuteScalar SQL functions which get the first row and first column.

    Read the article

  • How do I reorder the playlist items in the VLC playlist window?

    - by alex
    In the VLC playlist window, I can't seem to drag the items around to change their order. Is that normal? In every other media player I've used before, this is possible. At the moment I'm resorting to clicking the title to sort the list in an order which is what I want, but I can't guarantee I'll always have the titles so correct! UPDATE No one? I'd have though this would be a staple feature...

    Read the article

  • Code refactoring with Visual Studio 2010-Part 3

    - by Jalpesh P. Vadgama
    I have been writing few post about Code refactoring features of visual studio 2010 and This blog post is also one of them. In this post I am going to show you reorder parameters features in visual studio 2010. As a developer you might need to reorder parameter of a method or procedure in code for better readability of the the code and if you do this task manually then it is tedious job to do. But Visual Studio Reorder Parameter code refactoring feature can do this stuff within a minute. So let’s see how its works. For this I have created a simple console application which I have used earlier posts . Following is a code for that. using System; namespace CodeRefractoring { class Program { static void Main(string[] args) { string firstName = "Jalpesh"; string lastName = "Vadgama"; PrintMyName(firstName, lastName); } private static void PrintMyName(string firstName, string lastName) { Console.WriteLine(string.Format("FirstName:{0}", firstName)); Console.WriteLine(string.Format("LastName:{0}", lastName)); Console.ReadLine(); } } } Above code is very simple. It just print a firstname and lastname via PrintMyName method. Now I want to reorder the firstname and lastname parameter of PrintMyName. So for that first I have to select method and then click Refactor Menu-> Reorder parameters like following. Once you click a dialog box appears like following where it will give options to move parameter with arrow navigation like following. Now I am moving lastname parameter as first parameter like following. Once you click OK it will show a preview option where I can see the effects of changes like following. Once I clicked Apply my code will be changed like following. using System; namespace CodeRefractoring { class Program { static void Main(string[] args) { string firstName = "Jalpesh"; string lastName = "Vadgama"; PrintMyName(lastName, firstName); } private static void PrintMyName(string lastName, string firstName) { Console.WriteLine(string.Format("FirstName:{0}", firstName)); Console.WriteLine(string.Format("LastName:{0}", lastName)); Console.ReadLine(); } } } As you can see its very easy to use this feature. Hoped you liked it.. Stay tuned for more.. Till that happy programming.

    Read the article

  • How do I reorder vector data using ARM Neon intrinsics?

    - by goldenmean
    This is specifically related to ARM Neon SIMD coding. I am using ARM Neon instrinsics for certain module in a video decoder. I have a vectorized data as follows: There are four 32 bit elements in a Neon register - say, Q0 - which is of size 128 bit. 3B 3A 1B 1A There are another four, 32 bit elements in other Neon register say Q1 which is of size 128 bit. 3D 3C 1D 1C I want the final data to be in order as shown below: 1D 1C 1B 1A 3D 3C 3D 3A What Neon instrinsics can achieve the desired data order?

    Read the article

  • Simple way to reorder methods of a Java class in IntelliJ?

    - by Péter Török
    Is there a simpler way of reordering methods within a class source file in IntelliJ than cutting and pasting the code manually? Nowadays I often need this while refactoring legacy code, e.g. to move related methods close to each other in the source code. In Eclipse AFAIK there is a view similar to the Structure view of IntelliJ, where I can drag and drop methods around. However, this does not work in IntelliJ and I couldn't find any hints from its help either. I am using IntelliJ 9.0.2 to be specific.

    Read the article

  • "jpeglib.h: No such file or directory" ghostscript port in OPENBSD

    - by holms
    Hello I have a problem with compiling a ghostscript from ports in openbsd 4.7. SO i have jpeg-7 installed, I have latest port tree for obsd4.7. ===> Building for ghostscript-8.63p11 mkdir -p /usr/ports/pobj/ghostscript-8.63p11/ghostscript-8.63/obj gmake LDFLAGS='-L/usr/local/lib -shared' GS_XE=./obj/../obj/libgs.so.11.0 STDIO_IMPLEMENTATION=c DISPLAY_DEV=./obj/../obj/display.dev BINDIR=./obj/../obj GLGENDIR=./obj/../obj GLOBJDIR=./obj/../obj PSGENDIR=./obj/../obj PSOBJDIR=./obj/../obj CFLAGS='-O2 -fno-reorder-blocks -fno-reorder-functions -fomit-frame-pointer -march=i386 -fPIC -Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -fno-builtin -fno-common -DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\"/usr/local/lib/ghostscript/8.63\"' prefix=/usr/local ./obj/../obj/gsc gmake[1]: Entering directory `/usr/ports/pobj/ghostscript-8.63p11/ghostscript-8.63' cc -I./obj/../obj -I./src -DHAVE_MKSTEMP -O2 -fno-reorder-blocks -fno-reorder-functions -fomit-frame-pointer -march=i386 -fPIC -Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -fno-builtin -fno-common -DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\"/usr/local/lib/ghostscript/8.63\" -DGX_COLOR_INDEX_TYPE='unsigned long long' -o ./obj/../obj/sdctc.o -c ./src/sdctc.c In file included from src/sdctc.c:17: obj/jpeglib_.h:1:21: jpeglib.h: No such file or directory In file included from src/sdctc.c:19: src/sdct.h:58: error: field `err' has incomplete type src/sdct.h:70: error: field `err' has incomplete type src/sdct.h:72: error: field `cinfo' has incomplete type src/sdct.h:73: error: field `destination' has incomplete type src/sdct.h:84: error: field `err' has incomplete type src/sdct.h:87: error: field `dinfo' has incomplete type src/sdct.h:88: error: field `source' has incomplete type gmake[1]: *** [obj/../obj/sdctc.o] Error 1 gmake[1]: Leaving directory `/usr/ports/pobj/ghostscript-8.63p11/ghostscript-8.63' gmake: *** [so] Error 2 *** Error code 2 Stop in /usr/ports/print/ghostscript/gnu (line 2225 of /usr/ports/infrastructure/mk/bsd.port.mk). I tried to place one more param in CFLAGS in Makefile with value "-I/usr/local" but no luck =( People in irc [freenode server, #openbsd channel] refuses give any help for ports at all, and even more - because this is 4.7 unstable version. I have my reasons to use this version and ports believe me =) CFLAGS+= -DSYS_TYPES_HAS_STDINT_TYPES \ -I${LOCALBASE}/include \ -I${LOCALBASE}/include/ijs \ -I${LOCALBASE}/include/libpng \

    Read the article

  • "volatile" qualifier and compiler reorderings

    - by Checkers
    A compiler cannot eliminate or reorder reads/writes to a volatile-qualified variables. But what about the cases where other variables are present, which may or may not be volatile-qualified? Scenario 1 volatile int a; volatile int b; a = 1; b = 2; a = 3; b = 4; Can the compiler reorder first and the second, or third and the fourth assignments? Scenario 2 volatile int a; int b, c; b = 1; a = 1; c = b; a = 3; Same question, can the compiler reorder first and the second, or third and the fourth assignments?

    Read the article

  • [R] multiple functions in one R script

    - by Philipp
    Hi, I guess it's a stupid question, but I don't get it :-( I wrote an R script, which creates heatmaps out of xls files. I am calling this R script with a Perl system call and pass over all the arguments. This all works fine. Now I wanted to make the R script less confusing by writing different functions in the R script, for example: args <- commandArgs(TRUE) parsexls <- function(filepath) { data <- read.xls(...) assign("data", data, globalenv()) } reorder <- function(var) { data <- data[order...] assign("data", data, globalenv()) } When I want to call the functions with parsexls(args[1]) reorder(args[2]) nothing happens. But when I place the parsexls(args[1]) in the script between the two functions shown above, the file is parsed correctly! The reorder(args[2]) seems never to be read. Any ideas what I am doing wrong? Phil

    Read the article

  • best way to add route under resource in Laravel 4

    - by passingby
    I would like know if there is a better way to add additional route aside from the default of resource in Laravel 4. I have this code below which is no problem with regard to the functionality, it's just that it seems to be long: <?php Route::group(array('before' => 'auth'), function() { # API Route::group(array('prefix' => 'api'), function() { Route::resource('projects', 'ProjectsController'); Route::resource('projects.groups', 'GroupsController'); Route::post('/projects/{projects}/groups/{groups}/reorder', 'GroupsController@reorder'); }); }); If in Rails Rails.application.routes.draw do # API namespace :api, defaults: { format: 'json' } do scope module: :v1 do resources :projects do resources :groups do member do post :reorder end end end end end end

    Read the article

  • JQGrid with Column Reordering

    - by bruno
    Hey guys, I have a jqgrid and I can reorder my columns with this option in my JQGrid jQuery("#list").jqGrid({ sortable: true, ... }); This functionality let me reorder ALL my columns. But I want that some columns must be on fixed places. Is there a way to solve this..? Thanks in advance! Bruno

    Read the article

  • The gestures of Windows 8 (Consumer preview): part 2, More about Search

    - by Laurent Bugnion
    This is part 2 of a multipart blog post about the gestures and shortcuts in Windows 8 consumer preview. Part 1 can be found here! More about the Search charm In the first installment of this series, we talked about the charms and mentioned a few gestures to display the Search charm. Search is a very central and powerful feature in Windows 8, and allows you to search in Apps, Settings, Files and within Metro applications that support the Search contract. There are a few cool features around the Search, and especially the applications associated to it. I already mentioned the keyboard shortcuts you can use: Win-C shows the Charms bar (same as swiping from the right bevel towards the center of the screen). Win-Q open the Search fly out with Apps preselected. Win-W open the Search fly out with Settings preselected. Win-F open the Search fly out with Files preselected. Searching in Metro apps In addition to these three search domains, you can also search a Metro app, as long as it supports the Search contract (check this Build video to learn more about the Search contract). These apps show up in the Search flyout as shown here: Notice the list of apps below the Files button? That’s what we are talking about. First of all, the list order changes when you search in some applications. For instance, in the image above, I had used the Store with the Search charm. This is why the store shows up as the first app. I am not 100% what algorithm is used here (sorting according to number of searches is my guess), but try it out and try to figure it out Applications that have never been searched are sorted alphabetically. Does it mean we will see cool app names like ___AAA_MyCoolApp? I certainly hope not!! Pinning You can also pin often used apps to the Search flyout. To pin an app with the mouse, right click on it in the Search flyout and select Pin from the context menu. With the keyboard, use the arrow keys to go down to the selected app, and then open the context menu. With the finger, simply tap and hold until you see a semi transparent rectangle indicating that the context menu will be shown, then release. The context menu opens up and you can select Pin. Pin context menu Pinned apps Unpinning, Hiding Using the same technique as for pinning here above, you can also unpin a pinned application. Finally, you can also choose to hide an app from the Search flyout altogether. This is a convenient way to clean up and make it easy to find stuff. Note: At this point, I am not sure how to re-add a hidden app to the Search flyout. If anyone knows, please mention it in the comments, thanks! Reordering You can also reorder pinned apps. To do this, with the finger, tap, hold and pull the app to the side, then pull it vertically to reorder it. You can also reorder with the mouse, simply by clicking on an app and pulling it vertically to the place you want to put it. I don’t think there is a way to do that with the keyboard though. That’s it for now More gestures will follow in a next installment! Have fun with Windows 8   Laurent Bugnion (GalaSoft) Subscribe | Twitter | Facebook | Flickr | LinkedIn

    Read the article

  • C#/LINQ: How to define generically a keySelector for a templated class before calling OrderBy

    - by PierrOz
    Hi Folks, I have the following class defined in C# class myClass<T,U> { public T PropertyOne { get; set; } public U PropertyTwo { get; set; } } I need to write a function that reorder a list of myClass objects and takes two other parameters which define how I do this reorder: does my reordering depend on PropertyOne or PropertyTwo and is it ascending or descending. Let's say this two parameters are boolean. With my current knowledge in LINQ, I would write: public IList<myClass<T,U>> ReOrder(IList<myClass<T,U>> myList, bool usePropertyOne, bool ascending) { if (usePropertyOne) { if (ascending) { return myList.OrderBy(o => o.PropertyOne).ToList(); } else { return myList.OrderByDescending(o => o.PropertyOne).ToList(); } } else { if (ascending) { return myList.OrderBy(o => o.PropertyTwo).ToList(); } else { return myList.OrderByDescending(o => o.PropertyTwo).ToList(); } } } What could be a more efficient/elegant way to do that ? How can I declare the Func,TResult keySelector object to reuse when I call either OrderBy or OrderByDescending? I'm interesting in the answer since in my real life, I can have more than two properties.

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >