Results for "Category: String Manipulation"
Grab hold of your snow boards folks - Rd's stable non-recursive quicksort algorithm the Avalanche just got even faster ... This is the latest and final version of my non-recursive quicksort based algorithm that has been written from the ground up as a stable alternative to the blindingly fast quicksort ... It is not quite as fast as the outright fastest non-stable quicksort, but is still very fast as it uses buffers and copymemory and is beaten by none of my other string sorting algorithms except my fastest non-stable quicksort ... A standard quicksort only moves items that need swapping, while this stable algorithm manipulates all items on every iteration to keep them all in relative positions to one another. This algorithm I have dubbed the Avalanche ... See included html page in 21k zip for details ... Also included is an Avalanche based pre-sorter and the latest version of my insert/binary hybrid Twister algorithm which utilizes the pre-sorter ... Obscure Bug Fix 7 March 09. I documented it 'can sort sub-sets of the array data' but with the indexed version if you do an error *could* occur without this very small change ... This is definitely the final version of this unique algorithm, I have very much enjoyed developing it. I hope you like it. Happy coding from Rd :)
This is a simple string pointer caching technique that speeds up the testing of algorithms that manipulate string array pointers such are string sorting routines ... I found the most time consuming part of sort testing was the resetting of the test array before every test ... This is a solution that removes the need to re-assign strings into a test array before every test is started ... This module contains two sub-routines named CacheArrayPtrs and ResetArrayPtrs ... You call CacheArrayPtrs whenever the array is loaded with new items ... You call ResetArrayPtrs before every test and instantly be ready to test the original cached array ... Update 16 Oct 09 to correct an error in the documentation only ... Usage code included in 3kb zip.
This function searches the passed string for occurences of the specified sub-string. It has the ability to make case-sensitive or case-insensitive searches. It can also perform whole-word-only matching ... This SubStrCount implementation offers extended functionality which allows it to be used in a similar way to other token style functions ... SubStrCount will return the number of matches or zero if none.
This is an improvement on the MultiInStr function that appears in other peoples code now and again ... I don't know who the original author was, so I hope who-ever you are you don't mind ... The original code would search through a string looking for occurences of single characters, while this pair of functions search for single-or-multi character terms within the given string ... Included are MultiInStr and MultiInStrR functions ... Hope someone finds them useful ... Update 25 May - improved versions added thanks to contributions from Kenneth Buckmaster ... Update 7 Nov - Reset string len bug fix in Ken's MultiInStr ... Happy coding
Demonstrates how simple functions written in pure VB can be faster than many of VB's built in functions. For example, the super short and simple Split function is 30% faster than VB's. The Replace function with no API optimizations is 2 times faster than VB's, and over 3 times faster on large strings ... All functions are written in pure VB. Also declares the GetLocaleInfo API for use with the First Day Of The Week related functions, and for default system settings for the Formatting functions ... This would be a great learning tool for newbies. Of course, it would also be a great resourse for anyone using VB5, just plug this module into any project to enable all the VB6 functions it uses.
This VB5 program can parse large text files reading in a chunk at a time and will replace UNIX Lf chars with Windows CrLf's, or vice-versa. It uses API to boost performance and is very fast. Demonstrates finding and replacing text that crosses over the chunk boundaries - and is further complicated by the need to access the previous char to avoid replacing a Lf with CrLf if already preceded by a Cr. Uses no VB6 only functions and is just 32k compiled with no compiler optimizations. Includes word list to parse - a tiny file really at 4.5 MB but parses in a blink even in the IDE. Hope someone finds it interesting, or even useful! Happy coding, Rd :)
Extremely Fast Case-Insensitive Unicode String Array Sorting Class (Revision II) *********************************************** This string sorting class is extremely fast at case-insensitive sorting operations due to the combination of a highly optimized Blizzard quicksort algorithm, extremely fast in-place unicode comparison thanks to Ralph Eastwood, and a unique textual compare lookup table that is built only once at initialization in just over one hundredth of a second thanks to LukeH, and stored in a long array which is accessed in-line to minimize the case-conversion impact on this supremely fast comparison algorithm. Its performance on case-insensitive operations is only slightly slower than its case-sensitive binary compare operations, and is well over two times faster than StrComp's textual compare mode when used within the very same algorithm. Turning off strict compatibility with VB's StrComp function will improve performance on case-insensitive operations even further. *********************************************** Special thanks to the following for their generous contribution to this sorting class: ***************************** QuickSort Origins ~ C.A.R. Hoare ******************** String Comparison ~ Ralph Eastwood (tcm) ************* LowerCase Conversion ~ LukeH (selftaught) ************ SafeArray Substitution ~ Luke, Ralph, & Rd *********************************************** Blizzard quicksort algorithm and in-line lookup table by Rd :) *********************************************** Revision I - Fixed potential bug! Added demo project. *********************************************** Revision II - Fixed null-string descending bug!
Learn ADO.NET basics in shortest time possible. Contains 2 tutorials: Bound manually by code and bound by build-in Databinding. Shows you how to connect to an Access database, populate the controls with data, add new record, edit existing record, delete record, and save to the database. Well commented. Ideal to VB.NET beginners as well.
phpReportGenerator is a PHP class which generates customizable report on any given MySQL query. You need to just pass the query as a resource id and then change the various look-n-feel parameter of your table like text color, header color, table border, size and many more. then finally call Generate Report. Thats all. This class will be very handy for rapid application development where you need not to point out details of writting table generation script, positioning and parsing. The class will do everything for you by default. Very Handy snippet. Hope you will vote for me. A usage.php file is included to demonstrate how to use this class.
This Code Is a Best simple Sample for Tech Converting Strings and Allow users to learn about Persian Unicode Rage,And Allow Users To use Persian(farsi) With Out Arabic Language.
a simple demonstration for time computation
Shows you how to use Regular Expressions to parse data from a string. You can find more information on Regular Expressions at http://msdn.microsoft.com/en-us/library/1400241x(VS.85).aspx This is the best way I could figure out how to say parse proxies from a website. If you like it please vote.
I think this is the first Jaro-Winkler Algorithm here on PSC. Description: The Jaro–Winkler distance (Winkler, 1990) is a measure of similarity between two strings. It is a variant of the Jaro distance metric (Jaro, 1989, 1995) and mainly used in the area of record linkage (duplicate detection). The higher the Jaro–Winkler distance for two strings is, the more similar the strings are. The Jaro–Winkler distance metric is designed and best suited for short strings such as person names. The score is normalized such that 0 equates to no similarity and 1 is an exact match. References: http://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance lingpipe http://lingpipe-blog.com/2006/12/13/code-spelunking-jaro-winkler-string-comparison/
Example Code to illustrate class/object using php. Example for database conectivity class.
This is an example of 'Find Function' for TextBoxes.It can perform MachCase,WholeWordOnly search and easy to use.Now updated.I want your 'FeedBack'and never forget to -Rate- this code.Thanks to Rde:-),you strikes once again.
This is a sample 'FindOnGrid Function For FlexGrid' . This code is made on a request from PSC. This function can search your 'FlexGrid' and will setfocus the cell which containing the text. It can Perform 'WhorlWordOnly', 'MatchCase' search. The additional option , ie searching with the 'cell Backcolor' is also included , which was in the request. I uploaded this code , to get useful to somebody else too. Your comments are welcomed. Good Luck!
This code show you a simple cashier application, which include user login, add to datagrid and manipulate it, OleDbDataAdapter, DataSet, OleDbDataReader and insert to Access with OleDbCommand
This is an example of a method for developing a serial based registration/activation for your software. It develops a 25 digit using the hard disk serial number of the user, and a ProductID which you supply. The user is provided with a request code, which is sent to you, and you send back the serial based on the request code. I've found it to work pretty well. Though I would share it with everyone else. There is negligible commenting in the code, however use the note and help utility to see how the code works, and how each process takes place. Easy to manipulate to meet your need. Hope it's of some use to someone... **UPDATED - Version 1.2** Added new features such as digit swapping and label previews. Also changed certain routines. **UPDATED AGAIN - Version 1.5** Added sample registration form. Good example of how to allow users to paste the whole key into one textbox, and have the program split it to fill up all 5 appropriately...
Easy trick to allow only text and converts it to upper-case. (Backspace is optional)
Garment Payroll System