5 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
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

This time just a simple example of grading scores (0 - 100) with letters (A - F). Two approaches are presented, one using switch/case in an "on the fly" function, and the other uses the score as an index to a string of letters F through A.

Member Avatar for vegaseat
1
798
Member Avatar for pritaeas

The `ReplaceStrings` function replaces all strings in `APatterns` found in `ASubject` with the value in `AReplacement`. As an example, I added the `RemoveStrings` function which replaces everthing with an empty string, thus deleting all strings found. Usage examples are in the XMLDoc comments. A good test will be to rewrite …

Member Avatar for pritaeas
0
263
Member Avatar for Gribouillis

This snippet defines a function [icode]a2bits[/icode] which converts a characters string to a string of 0's and 1's showing its bitwise representation.

Member Avatar for Gribouillis
0
2K
Member Avatar for Beat_Slayer

Two litle functions to help on text slice and spliting. The code comments say it all. [CODE]# Slicer takes as arguments a tuple containing the string before, # the string after and the string to truncate. It returns the string # between the two given strings Slicer = lambda((b, a, …

Member Avatar for Beat_Slayer
1
563

The End.