Yet another javascript fuzzy matching library
Yet another javascript fuzzy matching library
Tiny, fast fuzzy ⚡️earch for React applications
Map over promises serially
Measure the churn/complexity score. Higher values mean hotspots where refactorings should happen.
Raises the popularity score on your package through nefarious means.
Fast and tiny fuzzy-search utility
Measures patterns of attribute values associated with features. Reveals whether similar values tend to occur near each other, or whether high or low values are interspersed
Type safe SQL query builder
Fuzzy filtering and string similarity scoring - compatible with fuzzaldrin
Perseus score
Logic for prioritizing MIME types
A CLI and library which tests helps score how vulnerable a regex pattern is to ReDoS attacks. Supported in the browser, Node and Deno.
Istanbul V0 used by solidity-coverage for its report-api
A JavaScript string-scoring and fuzzy-matching library based on the Quicksilver algorithm, designed for smart auto-complete.
No description provided.
Get the contrast ratio and WCAG score between common CSS color types.
An ember-cli addon to test against multiple dependencies, such as ember and ember-data.
Tests if ES6 Symbol is supported.
Scores RDF/JS terms inside a dataset
TypeScript definitions for wcag-contrast
Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
Pretrained pose detection model
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
score a cribbage hand from the command line
A game that generates random scores for players. Type 'studio_game' in command line to run.
A command line interface to quickly check table standings, scores, and upcoming matches for the World Cup
Given an ESPN Gamecast match ID, Score Watch will scrape the Gamecast Page for updates and broadcast them on the command line and also via GrowlNotify.
Start this command line tool, enter your home and visitor team, then start taking scores to see which team wins.
DH Movie Manager finds local movie files, queries IMDB, and stores the data in a sqlite3 database that you can use to run commands. Search for specific actors, directors, and genres. Filter results by audience score. Update your filenames to reflect the correct title. Feeling indecisive? use the 'play unseen [genre]' command to play a random movie that suits your mood.
studio_game is a command-line game built through instruction by The Pragmatic Studio. Through user input, the game is named and then run through a number of designated rounds. Random play is introduced to assign treasure (points) and increase or decrease a player's health. At the conclusion of the game (as determined by the user) a .txt file is saved with the high scores.
This a simple game where virtual players compete to find treasures. Health of the players is importatnt. The players may get blammed or get w00ted. - To start the game on command line: studiogame.rb <csv file, containing a list of players> if the optional csv file is not provided, the game will use the default file called 'players.csv'. - Example of csv list of players (name & health): Alvin,100 Simon,60 Theo,125 - The game will ask, how many game rounds to play. Enter the number of rounds or enter 'quit' or 'exit' to stop the game. - The game, at the end, will print out the game statistics and high scores. It will also create a file containing the high scores.
A simple text-based game that you can run from the command line. Runs a list of players (either those provided, or that you can provide via a '.csv' file that you then name as a command line argument when loading the program), through a series of 'rounds', the number of which you can choose as the game runs. Each player is 'w00ted', 'blammed', or 'skipped' and receives a treasure. High-scores are printed out to the console upon exiting the game. They are also saved to a file ('high_scores.txt') in the top-level folder of the application. Created while doing the Ruby Programming course from Pragmatic Studio.
README ====== This is a simple API to evaluate information retrieval results. It allows you to load ranked and unranked query results and calculate various evaluation metrics (precision, recall, MAP, kappa) against a previously loaded gold standard. Start this program from the command line with: retreval -l <gold-standard-file> -q <query-results> -f <format> -o <output-prefix> The options are outlined when you pass no arguments and just call retreval You will find further information in the RDOC documentation and the HOWTO section below. If you want to see an example, use this command: retreval -l example/gold_standard.yml -q example/query_results.yml -f yaml -v INSTALLATION ============ If you have RubyGems, just run gem install retreval You can manually download the sources and build the Gem from there by `cd`ing to the folder where this README is saved and calling gem build retreval.gemspec This will create a gem file called which you just have to install with `gem install <file>` and you're done. HOWTO ===== This API supports the following evaluation tasks: - Loading a Gold Standard that takes a set of documents, queries and corresponding judgements of relevancy (i.e. "Is this document relevant for this query?") - Calculation of the _kappa measure_ for the given gold standard - Loading ranked or unranked query results for a certain query - Calculation of _precision_ and _recall_ for each result - Calculation of the _F-measure_ for weighing precision and recall - Calculation of _mean average precision_ for multiple query results - Calculation of the _11-point precision_ and _average precision_ for ranked query results - Printing of summary tables and results Typically, you will want to use this Gem either standalone or within another application's context. Standalone Usage ================ Call parameters --------------- After installing the Gem (see INSTALLATION), you can always call `retreval` from the commandline. The typical call is: retreval -l <gold-standard-file> -q <query-results> -f <format> -o <output-prefix> Where you have to define the following options: - `gold-standard-file` is a file in a specified format that includes all the judgements - `query-results` is a file in a specified format that includes all the query results in a single file - `format` is the format that the files will use (either "yaml" or "plain") - `output-prefix` is the prefix of output files that will be created Formats ------- Right now, we focus on the formats you can use to load data into the API. Currently, we support YAML files that must adhere to a special syntax. So, in order to load a gold standard, we need a file in the following format: * "query" denotes the query * "documents" these are the documents judged for this query * "id" the ID of the document (e.g. its filename, etc.) * "judgements" an array of judgements, each one with: * "relevant" a boolean value of the judgment (relevant or not) * "user" an optional identifier of the user Example file, with one query, two documents, and one judgement: - query: 12th air force germany 1957 documents: - id: g5701s.ict21311 judgements: [] - id: g5701s.ict21313 judgements: - relevant: false user: 2 So, when calling the program, specify the format as `yaml`. For the query results, a similar format is used. Note that it is necessary to specify whether the result sets are ranked or not, as this will heavily influence the calculations. You can specify the score for a document. By "score" we mean the score that your retrieval algorithm has given the document. But this is not necessary. The documents will always be ranked in the order of their appearance, regardless of their score. Thus in the following example, the document with "07" at the end is the first and "25" is the last, regardless of the score. --- query: 12th air force germany 1957 ranked: true documents: - score: 0.44034874 document: g5701s.ict21307 - score: 0.44034874 document: g5701s.ict21309 - score: 0.44034874 document: g5701s.ict21311 - score: 0.44034874 document: g5701s.ict21313 - score: 0.44034874 document: g5701s.ict21315 - score: 0.44034874 document: g5701s.ict21317 - score: 0.44034874 document: g5701s.ict21319 - score: 0.44034874 document: g5701s.ict21321 - score: 0.44034874 document: g5701s.ict21323 - score: 0.44034874 document: g5701s.ict21325 --- query: 1612 ranked: true documents: - score: 1.0174774 document: g3290.np000144 - score: 0.763108 document: g3201b.ct000726 - score: 0.763108 document: g3400.ct000886 - score: 0.6359234 document: g3201s.ct000130 --- **Note**: You can also use the `plain` format, which will load the gold standard in a different way (but not the results): my_query my_document_1 false my_query my_document_2 true See that every query/document/relevancy pair is separated by a tabulator? You can also add the user's ID in the fourth column if necessary. Running the evaluation ----------------------- After you have specified the input files and the format, you can run the program. If needed, the `-v` switch will turn on verbose messages, such as information on how many judgements, documents and users there are, but this shouldn't be necessary. The program will first load the gold standard and then calculate the statistics for each result set. The output files are automatically created and contain a YAML representation of the results. Calculations may take a while depending on the amount of judgements and documents. If there are a thousand judgements, always consider a few seconds for each result set. Interpreting the output files ------------------------------ Two output files will be created: - `output_avg_precision.yml` - `output_statistics.yml` The first lists the average precision for each query in the query result file. The second file lists all supported statistics for each query in the query results file. For example, for a ranked evaluation, the first two entries of such a query result statistic look like this: --- 12th air force germany 1957: - :precision: 0.0 :recall: 0.0 :false_negatives: 1 :false_positives: 1 :true_negatives: 2516 :true_positives: 0 :document: g5701s.ict21313 :relevant: false - :precision: 0.0 :recall: 0.0 :false_negatives: 1 :false_positives: 2 :true_negatives: 2515 :true_positives: 0 :document: g5701s.ict21317 :relevant: false You can see the precision and recall for that specific point and also the number of documents for the contingency table (true/false positives/negatives). Also, the document identifier is given. API Usage ========= Using this API in another ruby application is probably the more common use case. All you have to do is include the Gem in your Ruby or Ruby on Rails application. For details about available methods, please refer to the API documentation generated by RDoc. **Important**: For this implementation, we use the document ID, the query and the user ID as the primary keys for matching objects. This means that your documents and queries are identified by a string and thus the strings should be sanitized first. Loading the Gold Standard ------------------------- Once you have loaded the Gem, you will probably start by creating a new gold standard. gold_standard = GoldStandard.new Then, you can load judgements into this standard, either from a file, or manually: gold_standard.load_from_yaml_file "my-file.yml" gold_standard.add_judgement :document => doc_id, :query => query_string, :relevant => boolean, :user => John There is a nice shortcut for the `add_judgement` method. Both lines are essentially the same: gold_standard.add_judgement :document => doc_id, :query => query_string, :relevant => boolean, :user => John gold_standard << :document => doc_id, :query => query_string, :relevant => boolean, :user => John Note the usage of typical Rails hashes for better readability (also, this Gem was developed to be used in a Rails webapp). Now that you have loaded the gold standard, you can do things like: gold_standard.contains_judgement? :document => "a document", :query => "the query" gold_standard.relevant? :document => "a document", :query => "the query" Loading the Query Results ------------------------- Now we want to create a new `QueryResultSet`. A query result set can contain more than one result, which is what we normally want. It is important that you specify the gold standard it belongs to. query_result_set = QueryResultSet.new :gold_standard => gold_standard Just like the Gold Standard, you can read a query result set from a file: query_result_set.load_from_yaml_file "my-results-file.yml" Alternatively, you can load the query results one by one. To do this, you have to create the results (either ranked or unranked) and then add documents: my_result = RankedQueryResult.new :query => "the query" my_result.add_document :document => "test_document 1", :score => 13 my_result.add_document :document => "test_document 2", :score => 11 my_result.add_document :document => "test_document 3", :score => 3 This result would be ranked, obviously, and contain three documents. Documents can have a score, but this is optional. You can also create an Array of documents first and add them altogether: documents = Array.new documents << ResultDocument.new :id => "test_document 1", :score => 20 documents << ResultDocument.new :id => "test_document 2", :score => 21 my_result = RankedQueryResult.new :query => "the query", :documents => documents The same applies to `UnrankedQueryResult`s, obviously. The order of ranked documents is the same as the order in which they were added to the result. The `QueryResultSet` will now contain all the results. They are stored in an array called `query_results`, which you can access. So, to iterate over each result, you might want to use the following code: query_result_set.query_results.each_with_index do |result, index| # ... end Or, more simply: for result in query_result_set.query_results # ... end Calculating statistics ---------------------- Now to the interesting part: Calculating statistics. As mentioned before, there is a conceptual difference between ranked and unranked results. Unranked results are much easier to calculate and thus take less CPU time. No matter if unranked or ranked, you can get the most important statistics by just calling the `statistics` method. statistics = my_result.statistics In the simple case of an unranked result, you will receive a hash with the following information: * `precision` - the precision of the results * `recall` - the recall of the results * `false_negatives` - number of not retrieved but relevant items * `false_positives` - number of retrieved but nonrelevant * `true_negatives` - number of not retrieved and nonrelevantv items * `true_positives` - number of retrieved and relevant items In case of a ranked result, you will receive an Array that consists of _n_ such Hashes, depending on the number of documents. Each Hash will give you the information at a certain rank, e.g. the following to lines return the recall at the fourth rank. statistics = my_ranked_result.statistics statistics[3][:recall] In addition to the information mentioned above, you can also get for each rank: * `document` - the ID of the document that was returned at this rank * `relevant` - whether the document was relevant or not Calculating statistics with missing judgements ---------------------------------------------- Sometimes, you don't have judgements for all document/query pairs in the gold standard. If this happens, the results will be cleaned up first. This means that every document in the results that doesn't appear to have a judgement will be removed temporarily. As an example, take the following results: * A * B * C * D Our gold standard only contains judgements for A and C. The results will be cleaned up first, thus leading to: * A * C With this approach, we can still provide meaningful results (for precision and recall). Other statistics ---------------- There are several other statistics that can be calculated, for example the **F measure**. The F measure weighs precision and recall and has one parameter, either "alpha" or "beta". Get the F measure like so: my_result.f_measure :beta => 1 If you don't specify either alpha or beta, we will assume that beta = 1. Another interesting measure is **Cohen's Kappa**, which tells us about the inter-agreement of assessors. Get the kappa statistic like this: gold_standard.kappa This will calculate the average kappa for each pairwise combination of users in the gold standard. For ranked results one might also want to calculate an **11-point precision**. Just call the following: my_ranked_result.eleven_point_precision This will return a Hash that has indices at the 11 recall levels from 0 to 1 (with steps of 0.1) and the corresponding precision at that recall level.
This is a fun treasure game written in the Ruby programming language. ## Getting Started 1. Install gem: $ gem install treasure_adventure_game 2. At the command prompt: $ treasure_game ## Playing the game Enter a number for the number of game rounds you'd like to play. Enter `quit` to exit and see a listing of the high scores. The program will also write output to a `high_scores.txt` file. ## Upload your own players You have the option to load your own players into the game by passing a `csv` file as an argument: $ treasure_game my_players.csv Your `csv` file should be formatted with player names and initial health numbers. For example: Bob,100 George,60 Sally,125
## Studio Game Demo App I made this app following along with The Pragmatic Studio's Ruby course found here: https://pragmaticstudio.com/courses/ruby. ## Install the gem I published the gem for this app on RubyGems.org. In order to install it, run `gem install studio_game_dylan_attal-1.0.0.gem` ## Run the app In order to run the app run the following command `studio_game` ## Summary This is a console app that simulates a game. Players are loaded from the `players.csv` file be default. Each player has a name and a starting health value, i.e.: `Larry,100` If the user wants, they can provide a different CSV file to load the players. For example, I've provided a file `my_favorite_players.csv` as an alternate list of players. The user should provide the file like so `studio_game bin/my_favorite_players.csv` Before the game is played, the user gets to decide how many rounds to play. At this point, the user can also terminate the program by typing in `quit` or `exit`: `How many game rounds? ('quit to exit')` Once the user provides the number of rounds, the game is played automatically. The user then sees 1. Which players are involved ``` There are 5 players in Knuckleheads: I'm Boba with a health = 100, points = 0, and score = 100. I'm Jango with a health = 90, points = 0, and score = 90. I'm Din with a health = 80, points = 0, and score = 80. I'm Klutz with a health = 105, points = 0, and score = 105. I'm Berserker with a health = 50, points = 0, and score = 50. ``` 2. Which treasures there are to find ``` There are 6 treasures to be found: A pie is worth 5 A bottle is worth 25 A hammer is worth 50 A skillet is worth 100 A broomstick is worth 200 A crowbar is worth 400 ``` 3. The results of each round ``` Round 1 Rolled a 3 (StudioGame::Die) Rolled a 4 (StudioGame::Die) Boba has been skipped Boba found a skillet worth 100 points. Boba's treasures: {:skillet=>100} I'm Boba with a health = 100, points = 100, and score = 200. Rolled a 3 (StudioGame::Die) Rolled a 2 (StudioGame::Die) Jango got blammed! Jango found a bottle worth 25 points. Jango's treasures: {:bottle=>25} I'm Jango with a health = 80, points = 25, and score = 105. Rolled a 1 (StudioGame::Die) Rolled a 6 (StudioGame::Die) Din got w00ted! Din found a crowbar worth 400 points. Din's treasures: {:crowbar=>400} I'm Din with a health = 95, points = 400, and score = 495. Rolled a 1 (StudioGame::Die) Rolled a 4 (StudioGame::Die) Klutz has been skipped Klutz found a bottle worth 12.5 points. Klutz's treasures: {:bottle=>12.5} I'm Klutz with a health = 105, points = 12.5, and score = 117.5. Rolled a 1 (StudioGame::Die) Rolled a 4 (StudioGame::Die) Berserker has been skipped Berserker found a hammer worth 50 points. Berserker's treasures: {:hammer=>50} I'm Berserker with a health = 50, points = 50, and score = 100. ``` Once the user quits, they see the final results of all the rounds: ``` How many game rounds? ('quit to exit') quit Knuckleheads Statistics: 2 strong players: Boba (115) Klutz (120) 3 wimpy players: Jango (85) Din (75) Berserker (40) Berserker........... 690 Boba................ 620 Din................. 575 Jango............... 235 Klutz............... 207.5 Boba's point totals: 100 total skillet points 5 total pie points 400 total crowbar points 505 grand total points Jango's point totals: 50 total bottle points 100 total skillet points 150 grand total points Din's point totals: 400 total crowbar points 100 total hammer points 500 grand total points Klutz's point totals: 12.5 total bottle points 25.0 total hammer points 50.0 total skillet points 87.5 grand total points Berserker's point totals: 50 total hammer points 200 total broomstick points 400 total crowbar points 650 grand total points ``` ## Rules of the game Each round, each player rolls the die. If a player rolls between 1 and 2, then they are `blammed`, meaning they lose `10 health`. If a player rolls between 3 and 4, then they are `skipped`, meaning they do not gain or lose points that turn. If a player rolls between 5 and 6, then they are `w00ted`, meaning they gain `15 health`. Each round, players can find treasure worth different points. Treasures are found randomly. Every game, there are two special players added: 1. `ClumsyPlayer`: this player's treasure points are cut in half. 2. `BerserkPlayer`: once this player is `w00ted` five times, it cannot be `blammed` in that game anymore—if this player rolls between 1 and 2, they are `w00ted` instead of `blammed`.
No description provided.
No description provided.