15 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for Reverend Jim

##vbScript - A Multi-column Sort With Minimal Coding Please see my post [vbScript - The Basics](https://www.daniweb.com/programming/threads/516400/vbscript-the-basics) for more details on vbScript. A previous post dealt with sorting. The code easily handles sorting simple things like lists of words, lines of text - cases where you only had to compare two …

0
857
Member Avatar for vegaseat

Part 2 of exploring/tasting the Swift language takes a look at dictionaries; process flow controls like loops, if/else and switch/case; functions and sorting. I hope I can follow this up with part 3, a closer look at class operations.

Member Avatar for Lardmeister
2
508
Member Avatar for vegaseat

The bubble sort is slow and I thought it would be interesting to visualize the progress as it sorts an array of integers.

Member Avatar for David_50
5
728
Member Avatar for vegaseat

A little experiment with custom sorting the result of a word frequency count using Google's Go language.

Member Avatar for vegaseat
2
3K
Member Avatar for vegaseat

Use Google's modern Go language (aka. golang) to convert a denary number (base 10) to a roman numeral. Just a good exercise to explore Go's map, slice, sort and for loop features. Note that in Go the **:=** is shorthand for assigning a type (by inference) and a value to …

2
577
Member Avatar for vegaseat

A Python sort with a helper function to allow for mixed order sort like age descending and weight ascending.

3
490
Member Avatar for vegaseat

This short snippet shows you how to preprocess a text to remove punctuation marks, then do a word frequency count using Counter() from the Python module collections. Finally, two sorts are applied to display words with matching frequency in alphabetical order.

2
655
Member Avatar for Reverend Jim

This is a short bit of code that shows how to implement sorting on columns in a details-mode ListView. Suggestions for improvement are always welcome. One possible improvement would be to modify the column headers to indicate which column is being sorted and in which direction.

0
2K
Member Avatar for Reverend Jim

Sometimes sorting data can be easy and sometimes it can be difficult. If you have data in a listview you can spend a great deal of time writing ICompare functions. This is appropriate for non-trivial applications but can be a little intimidating for inexperienced programmers. Also, it is a problem …

Member Avatar for Reverend Jim
1
884
Member Avatar for Morten Brendefu

There are many places on internet for great help regarding many things. Proper implementation of really fast routines for sorting data however is not common. I am not claiming these routines to be the fastest around, but their ease of implementation and use may make them welcome. As a thank …

0
244
Member Avatar for TrustyTony

By coding algorithm and using some liberal prints with small set of data, you can learn to understand the basic algorithms better than just reading about them. Here simple selection sort.

Member Avatar for TrustyTony
0
208
Member Avatar for TrustyTony

This does not look very efficient with transponation, sort and transponation back, so I am happy to hear about better alternatives.

Member Avatar for TrustyTony
0
327
Member Avatar for TrustyTony

I did this code to compare to Delphi code in Delphi forum [URL="http://www.daniweb.com/software-development/pascal-and-delphi/threads/357771"]TListBox and sorting[/URL] which ran in my computer compiled in free Lazarus environment at time 7,235 s for generate and insert to listbox, 13,265 s sorting the listbox.

0
575
Member Avatar for Momerath

The past few days I've posted some sorting routines customized to the tasks they were required to solve. Since I have a bunch of different sorting routines already coded, I decided to post them. Please note that some of these sorts are fast, but not a single one is as …

Member Avatar for Momerath
3
820
Member Avatar for seanbp

The End.