Cool MapMap implementation
concatenative mapdashery
Generates and consumes source maps
Basic cache object for storing key-value pairs.
Generates and consumes source maps
Map `visit` over an array of objects.
Fixes stack traces for files with source maps
Store information about any JS value in a side channel, using a Map
A thing that is a lot like ES6 `Map`, but without iterators, for use in environments where `for..of` syntax and `Map` are not available.
Is this value a JS Map? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
Fixes stack traces for files with source maps
No description provided.
Merge old source map and new source map in multi-transform flow
Fast line to line SourceMap generator.
A JavaScript (JS) Map or Similar object polyfill if Map is not available.
ECMAScript6 WeakMap polyfill
construct pipes of streams of events
Persistent ordered mapping from strings
Map over promises concurrently
Converts a source-map from/to different formats and allows adding/changing properties.
ECMAScript6 Map polyfill
[Experimental] - 🚇 File crawling, watching and mapping for Metro
extracts inlined source map and offers it to webpack
Faster, node.js focused alternative to JavaScript's native array map.
Determine the mappings between 2 sets of data
1.to_proc returns {|x| x}. COOL!!
The Mmap class implement memory-mapped file objects for Ruby 2.x
Sparse Array - map from integers (0..2**32-1) to objects
Easily generate Great Circle maps between 2 or more airports. The gem provides an API for constructing the image URLs, the maps themselves are pulled from gcmap.com.
google-map-static-image-generator is a Ruby wrapper around the Google Maps Static API that generates PNG map images on the fly — no JavaScript required. Features: - Add custom markers at any coordinates - Draw paths with custom weight and colour - Apply map styles (hide labels, change colours, etc.) - Set center + zoom for marker-free maps - Choose map type: roadmap, satellite, terrain, or hybrid - Default 1024x1024 at scale 2 (retina-friendly) - Raises GoogleMapStaticImage::ApiError on non-200 responses (invalid key, quota exceeded, etc.) Useful for generating map thumbnails in emails, PDFs, admin dashboards, and anywhere an interactive JavaScript map is not practical.
Gridmap makes tile based maps easy. It offers 2 new classes - a gridmap and a tile. It takes care of drawing tiles with connected textures (e.g. walls).
Parses OFX 1.x and 2.x files into typed domain objects with a fluent API and configurable field mappings.
This gem implements: 1.) a logistic map function (#logistic_map), which is a discrete, non-linear, dynamic equation which can show - with proper parameters - chaotic behaviour with super-sensitivity to the initial parameters. Very small changes to initial parameters cause huge changes in the result (can be used as a PRNG as iterated over and over); 2.) A tent-map version of the logistic map (#logistic_points) which returns an array of Nth iterated values of several logistic maps with their initial X0 parameter ranging from 0 to 1 by user defined steps, showing curve-like properties when plotted.
== 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)
Version 1.0.1 Update Notes: -Updated README "HOW TO RUN" -I'm not sure how to format this so it looks good on the gems website so please just see the README file. USE CASES: 1. Your friends bully you because your imaginary role playing worlds are predictable and boring. 2. You like seeing chars printed in nifty patterns. HOW TO RUN: 1. Run `super_simple_world_builder` 2. Follow the prompts EXAMPLE INPUT: Guten Tag! Welcome to Super Simple World Builder. Enter 1 to build a random world Enter 2 to build a custom world Please enter your selection (1, 2, or exit): 2 Enter the name of your world: Community-Town Enter the minimum width of the world: 15 Enter the minimum height of the world: 15 What character do you want to fill the background of your world with? (i.e. any character or single space) How many lake features do you want? 3 How many mountain features do you want? 2 How many town features do you want? 3 How many forest features do you want? 4 OUTPUT: 1. Console print out of the world map 2. A text file of the world map ACHTUNG: 1. Don't worry if the width or height entered is too small. The world will automatically enlarge to fit all features. 2. World maps look better when you enter a <space> as the character to fill the background. 3. This is a quick-and-dirty project so yolo with the specs. I added comments as a consolation prize. 4. See `feature_set.rb` to tweak the features that can be added to the world map. 5. Interestingly, menu prompts may not show up in the git bash terminal. But they do show up in Windows command prompt, so lmao. 6. Feel free to tweak the code however you like. I plan to refactor in the future to dry up some sections.
# Procer **NOTE: Experimental. Use it to experience what a default `to_proc` could have been. For production code, I recommend an explicit transformation, like the one provided by the gem `jgomo3-func`**. A reasonable good default `to_proc` method for all objects. Install with: ``` gem install procer ``` When you require Procer, all objects will have a default `to_proc` method which will try to call one of the following methods, in the given order: - `call` - `[]` - `===` Many methods which receive a block, can benefit greatly from this because you can now pass an object to perform the block role. Think of the Enumerable module and all its methods. Many objects define `===`, but not `to_proc`. So they will be nicely usable in a `case/when` expression, but not in other contexts. This is the case of classes and ranges, which you can use in `case/when` expressions, but they don't define `to_proc`. Now they do define `to_proc` so they are useful in those contexts. Examples: ```ruby require 'procer' [1, 2, '3', '4', 5, 6].filter(&Numeric) # => [1, 2, 5, 6] [-10, 100, -2, 3, 20, -33].filter(&(0..50)) # => [3, 20] ``` Also, Hashes already implement `to_proc` and that is useful with Enumerator. We can use it as a transformation table with `map`: ```ruby table = { 1 => 'one', 2 => 'two', 3 => 'three' } [3, 1, 2].map(&table) # => ['three, 'one, 'two'] ``` Sadly, Arrays, even when they have the same interface as hashes as a function of indices, don't implement `to_proc` and so they can't be used in the same way. Until now. ```ruby table = ['zero', 'one', 'two'] [2, 0, 1].map(&table) # => ['two', 'zero', 'one'] ``` Alternatively, you could have used `values_at`: ```ruby table.values_at([3, 1, 2]) # In the Hash example table.values_at([2, 0, 1]) # In the Array example ``` But the map solution is more generic and `table` can be anything that implements `to_proc` and not something that necessarily implements `values_at`. Notice that if the object implements `[]` that will triumph over `===`. It was unexpected when I tried to use Integers as the object, as they implement `[]` as a way to access their binary form: ```ruby 5 # b101 [5[2], 5[1], 5[0]] # [1, 0, 1] ``` So the proc will work like that: ```ruby [2, 4, 5].map(&5) # Actual => [1, 0, 0] # I was expecting => [false, false, true] ```
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.