This Will Give You Random Codes From CharCode
Module Federation Error Codes
Constants enumerating the HTTP status codes. Based on the Java Apache HttpStatus API.
Strip ANSI escape codes from a string
The map of HTTP status codes from the builtin http module
Interact with HTTP status code
Check if a string has ANSI escape codes
Utility to lookup HTTP status codes
Regular expression for matching ANSI escape codes
Library to easily style texts with string formatting
Slice a string with ANSI escape codes
Lookup currency codes based on ISO 4217
A tiny and fast text wrap library which takes ANSI escapes into account.
Voice Error Codes
HTTP status utility
QRCode / 2d Barcode api with both server side and client side support using canvas
Safely flatten a nested JavaScript object.
Get a KeyboardEvent.key-style string from an event
Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes
Get the visual width of a string - the number of columns required to display it
ISO639 Codes for JavaScript
MongoDB Shell Errors Package
List of codes per country (languages, calling codes, currency codes, etc) with full TypeScript support.
Wordwrap a string with ANSI escape codes
A Mersenne-Twister random number generator (RNG) packed up as a class. This allows multiple RNG streams to be active at the same time (which Ruby's normal rand/srand does not allow). The Mersenne-Twister is implemented with fast C code for speed.
== DESCRIPTION: Charlie is a library for genetic algorithms (GA) and genetic programming (GP). == FEATURES: - Quickly develop GAs by combining several parts (genotype, selection, crossover, mutation) provided by the library. - Sensible defaults are provided with any genotype, so often you only need to define a fitness function. - Easily replace any of the parts by your own code. - Test different strategies in GA, and generate reports comparing them. Example report: http://charlie.rubyforge.org/example_report.html == INSTALL: * sudo gem install charlie == EXAMPLES: This example solves a TSP problem (also quiz #142): N=5 CITIES = (0...N).map{|i| (0...N).map{|j| [i,j] } }.inject{|a,b|a+b} class TSP < PermutationGenotype(CITIES.size) def fitness d=0 (genes + [genes[0]]).each_cons(2){|a,b| a,b=CITIES[a],CITIES[b] d += Math.sqrt( (a[0]-b[0])**2 + (a[1]-b[1])**2 ) } -d # lower distance -> higher fitness. end use EdgeRecombinationCrossover, InversionMutator end Population.new(TSP,20).evolve_on_console(50) This example finds a polynomial which approximates cos(x) class Cos < TreeGenotype([proc{3*rand-1.5},:x], [:-@], [:+,:*,:-]) def fitness -[0,0.33,0.66,1].map{|x| (eval_genes(:x=>x) - Math.cos(x)).abs }.max end use TournamentSelection(4) end Population.new(Cos).evolve_on_console(500)
GuerrillaRotate ============== This plugin lets you have multiple view pages for the one action, so that you can rotate through different views in order to test which one is the most effective. This is known as A/B testing, split testing or side-by-side testing. It will automatically switch between the different views for different web requests (uses .rand so is pseudo random, not round-robin or anything). The particular view is sticky for a (rails) session, so that once that view has been chosen for that visitor they will see the same, consistent view each time. It integrates automagically into [Rubaidh::GoogleAnalytics](http://github.com/rubaidh/google_analytics) by setting the override_trackpageview to the name of the unique view file (instead of the action-based URL) so you can track it easily in Google Analytics. Without that you'll want to track it by putting different tracking codes in each of your view templates. Example ------- So, in your views you will create some new templates with something (can be anything including nothing) between the template name and the first part of the extension. So you might have the following files for the products/index action: app/views/products/index.html.erb app/views/products/index_alt.html.erb app/views/products/index_new.html.erb Then all you need to do is tell your controller to rotate for that action: ### app/controllers/products_controller.rb class ProductsController < ApplicationController guerrilla_rotate :index, :show # etc.. end NB: guerrilla_rotate is also aliased as guerilla_rotate for the alternative spelling and typos. Copyright © 2009 Jason King, released under the MIT license