The best solution for store global settings in Rails applications. This gem will managing a table of а global key, value pairs easy. Think of it like a global Hash stored in your database, that uses simple ActiveRecord like methods for manipulation. Keep track of any global setting that you dont want to hard code into your rails app. You can store any kind of object. Strings, numbers, arrays, or any object.
This gem adds support for the postgres hstore type. It is the _just right_ alternative for storing hashes instead of using seralization or dynamic tables.
Tokyo Cabinet is a library of routines for managing a database. The database is a simple data file containing records, each is a pair of a key and a value. Every key and value is serial bytes with variable length. Both binary data and character string can be used as a key and a value. There is neither concept of data tables nor data types. Records are organized in hash table, B+ tree, or fixed-length array.
Open local or remote XLSX, XLS, ODS, CSV (comma separated), TSV (tab separated), other delimited, fixed-width files, and Google Docs. Returns an enumerator of Arrays or Hashes, depending on whether there are headers.
ROMA is one of the data storing systems for distributed key-value stores. It is a completely decentralized distributed system that consists of multiple processes, called nodes, on several machines. It is based on pure P2P architecture like a distributed hash table, thus it provides high availability and scalability.
Oedipus Lex is a lexer generator in the same family as Rexical and Rex. Oedipus Lex is my independent lexer fork of Rexical. Rexical was in turn a fork of Rex. We've been unable to contact the author of rex in order to take it over, fix it up, extend it, and relicense it to MIT. So, Oedipus was written clean-room in order to bypass licensing constraints (and because bootstrapping is fun). Oedipus brings a lot of extras to the table and at this point is only historically related to rexical. The syntax has changed enough that any rexical lexer will have to be tweaked to work inside of oedipus. At the very least, you need to add slashes to all your regexps. Oedipus, like rexical, is based primarily on generating code much like you would a hand-written lexer. It is _not_ a table or hash driven lexer. It uses StrScanner within a multi-level case statement. As such, Oedipus matches on the _first_ match, not the longest (like lex and its ilk). This documentation is not meant to bypass any prerequisite knowledge on lexing or parsing. If you'd like to study the subject in further detail, please try [TIN321] or the [LLVM Tutorial] or some other good resource for CS learning. Books... books are good. I like books.
Kyoto Cabinet is a library of routines for managing a database. The database is a simple data file containing records, each is a pair of a key and a value. Every key and value is serial bytes with variable length. Both binary data and character string can be used as a key and a value. Each key must be unique within a database. There is neither concept of data tables nor data types. Records are organized in hash table or B+ tree.
Make consistent hashcodes from flat Hashes, regardless of key ordering. Useful for hashing rows in a table.
data-table is a simple gem that provides a DSL for turning an array of hashes or ActiveRecord objects into an HTML table.
A nice way of parsing text tables into Ararys or Hashes for clearer code. Great for tests & permissions matrixes!
Provides `hashed` method to ActiveRecord dataset, that return hash where keys is value of some attribute of object (default – primary key of used table).
== FEATURES: * Input your data as an array of hashes * Input a report layout, built using a Ruby DSL * Outputs ASCII pivot tables suitable for fast reports * Pretty fast: takes less than a second to process 1,000 records of data by a report with 100 rows and 10 columns. == SYNOPSIS: require 'rubygems' require 'crosstab' data = [{:gender => "M", :age => 1}, {:gender => "F", :age => 2}, {:gender => "M", :age => 3}] my_crosstab = crosstab data do table do title "Q.A Age:" group "18 - 54" do row "18 - 34", :age => 1 row "35 - 54", :age => 2 end row "55 or older", :age => 3 end banner do column "Total" group "Gender" do column "Male", :gender => "M" column "Female", :gender => "F" end end end puts my_crosstab.to_s # => ... Table 1 Q.A Age: Gender ---------------- Total Male Female (A) (B) (C) ------- ------- ------- (BASE) 3 2 1 18 - 54 2 1 1 ----------------------------- 67% 50% 100% 18 - 34 1 1 -- 33% 50% 35 - 54 1 -- 1 33% 100% 55 or older 1 1 -- 33% 50% == JUST THE BEGINNING: * I hope to add in later releases: * New export formats: html, pdf, csv, excel. * More stats than just frequency and percentage: mean, median, std. deviation, std. error, and significance testing * Optional row and table suppression for low frequencies * Optional table rows populating from the data * Optional table ranking -- automatically reorder rows based in descending order based on frequencies observed == REQUIREMENTS: * None
Provides a DSL and helpers to convert hashes into html tables. Allows you to create overviews with selected fields, define keys whose values link to a url and so on.
Creates a table and stores and retrieves de data on the hash. It can guess the best field type.
Settings is a plugin that makes managing a table of global key, value pairs easy. Think of it like a global Hash stored in you database, that uses simple ActiveRecord like methods for manipulation. Keep track of any global setting that you dont want to hard code into your rails app. You can store any kind of object. Strings, numbers, arrays, or any object.
YARD-Heuristics YARD-Heuristics heuristically determines types of parameters and return values for YARD documentation that doesn’t explicitly document it. This allows you to write documentation that isn’t adorned with “obvious” types, but still get that information into the output. It also lets you nice-looking references to parameters and have them be marked up appropriately in HTML output. § Heuristics The following sections list the various heuristics that YARD-Heuristics apply for determining types of parameters and return values. Note that for all heuristics, a type will only be added if none already exists. § Parameter Named “other” A parameter named “other” has the same type as the receiver. This turns class Point def ==(other) into class Point # @param [Point] other def ==(other) § Parameter Types Derived by Parameter Name Parameters to a method with names in the following table has the type listed on the same row. | Name | Type | |--------+-----------| | index | [Integer] | | object | [Object] | | range | [Range] | | string | [String] | Thus class Point def x_inside?(range) becomes class Point # @param [Range] range def x_inside?(range) § Block Parameters If the last parameter to a method’s name begins with ‘&’ it has the type [Proc]. class Method def initialize(&block) becomes class Method # @param [Block] block def initialize(&block) § Return Types by Method Name For the return type of a method with less than two ‹@return› tags, the method name is lookup up in the following table and has the type listed on the same row. For the “type” “self or type”, if a ‹@param› tag exists with the name “other”, the type of the receiver is used, otherwise “self” is used. For the “type” “type”, the type of the receiver is used. | Name | Type | |-----------------+----------------| | ‹<<› | self or type | | ‹>>› | self or type | | ‹==› | [Boolean] | | ‹===› | [Boolean] | | ‹=~› | [Boolean] | | ‹<=>› | [Integer, nil] | | ‹+› | type | | ‹-› | type | | ‹*› | type | | ‹/› | type | | each | [self] | | each_with_index | [self] | | hash | [Integer] | | inspect | [String] | | length | [Integer] | | size | [Integer] | | to_s | [String] | | to_str | [String] | Thus class Point def <<(other) becomes class Point # @return [Point] def <<(other) but class List def <<(item) becomes class List # @return [self] def <<(item) § Emphasizing Parameter Names When producing HTML output, any words in all uppercase, with a possible “th” suffix, that is also the name of a parameter, an ‹@option›, or a ‹@yieldparam›, will be downcased and emphasized with a class of “parameter”. In the following example, “OTHER” will be turned into ‹<em class="parameter">other</em>›: class Point # @return True if the receiver’s class and {#x} and {#y} `#==` those of # OTHER def ==(other) § Usage Add ‹--plugin yard-heuristics-1.0› to your YARD command line. If you’re using Inventory-Rake-Tasks-YARD¹, add the following to your Rakefile: Inventory::Rake::Tasks::YARD.new do |t| t.options += %w'--plugin yard-heuristics-1.0' end ¹ See http://disu.se/software/inventory-rake-tasks-yard/ § API There’s really not very much to the YARD-Heuristics API. What you can do is add (or modify) the types of parameters and return types of methods by adding (or modifying) entries in the Hash tables ‹YARDHeuristics::ParamTypes› and ‹YARDHeuristics::ReturnTypes› respectively. That’s about it. § Financing Currently, most of my time is spent at my day job and in my rather busy private life. Please motivate me to spend time on this piece of software by donating some of your money to this project. Yeah, I realize that requesting money to develop software is a bit, well, capitalistic of me. But please realize that I live in a capitalistic society and I need money to have other people give me the things that I need to continue living under the rules of said society. So, if you feel that this piece of software has helped you out enough to warrant a reward, please PayPal a donation to now@disu.se¹. Thanks! Your support won’t go unnoticed! ¹ Send a donation: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=now@disu.se&item_name=YARD-Heuristics § Reporting Bugs Please report any bugs that you encounter to the {issue tracker}¹. ¹ See https://github.com/now/yard-heuristics/issues § Authors Nikolai Weibull wrote the code, the tests, and this README. § Licensing YARD-Heuristics is free software: you may redistribute it and/or modify it under the terms of the {GNU Lesser General Public License, version 3}¹ or later², as published by the {Free Software Foundation}³. ¹ See http://disu.se/licenses/lgpl-3.0/ ² See http://gnu.org/licenses/ ³ See http://fsf.org/
Provides an easy way to authenticate and grab content from a Redmine project. A specific use-case was to deserialize HTML tables from the wiki into an Array of Hashes with key/value pairs of "table heading" -> "column value" in order to simplify collection of a seed data from domain experts.
Hash intended for using as lookup table only for simple checking of existency of some item (key) inside.
Given a file (or a string) containing a container, along with options, it will return a hash of those values. Great for importing poorly formatted CSV files.
Methodic : provide Hash table options arguments manager (specifications and validations
Ruby Gem that makes managing a table of key/value pairs easy. Think of it like a Hash stored in you database, that uses simple ActiveRecord-like methods for manipulation. ENV-backed for Heroku ease.
Kyoto Cabinet is a library of routines for managing a database. The database is a simple data file containing records, each is a pair of a key and a value. Every key and value is serial bytes with variable length. Both binary data and character string can be used as a key and a value. Each key must be unique within a database. There is neither concept of data tables nor data types. Records are organized in hash table or B+ tree.
A usable hash (and some methods to boot) of the Periodic table of elements
NTable provides a convenient data structure for storing n-dimensional tabular data. It works with zero-dimensional scalar values, arrays, tables, and any arbitrary-dimensional hypertables. Each dimension is described by an axis object. The "rows" in that dimension might be identified by numbers or names. You can perform slice operations across any dimension, as well as reductions and dimensional decomposition. Finally, serialization is provided via a custom JSON schema, as well as a simple "hash of hashes" or "array of arrays" approach.
We can handle data specialized for table display, storage of values can be handled like Struct corresponding to multiple layers.
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.
Monkey patch for AWS ruby SDK HashModel to support model backed by DynamoDB tables with hash-range keys. It also provides some convenience methods to define your model in a more expressive rails style.
Kyoto Cabinet is a library of routines for managing a database. The database is a simple data file containing records, each is a pair of a key and a value. Every key and value is serial bytes with variable length. Both binary data and character string can be used as a key and a value. Each key must be unique within a database. There is neither concept of data tables nor data types. Records are organized in hash table or B+ tree.
Use Ruby hashes to group database table rows through ActiveRecord.
Kyoto Cabinet is a library of routines for managing a database. The database is a simple data file containing records, each is a pair of a key and a value. Every key and value is serial bytes with variable length. Both binary data and character string can be used as a key and a value. Each key must be unique within a database. There is neither concept of data tables nor data types. Records are organized in hash table or B+ tree.
Tablinate is a ruby gem that takes arrays of hashes, ActiveRecord::Relation objects, or a JSON array of hashes, and converts them into html tables. It is intended for use in small projects or applications whose schemas are closely related to what a table's output should be.
Hanny is a Hash-based Approximate Nearest Neighbor (ANN) search library in Ruby. Hash-based ANN converts vector data into binary codes and builds a hash table by using the binary codes as hash keys. To build the hash table, Hanny uses Locality Sensitive Hashing (LSH) of approximating cosine similarity. It is known that if the code length is sufficiently long (ex. greater than 128-bit), LSH can obtain high search performance. In the experiment, Hanny achieved about twenty times faster search speed than the brute-force search by Euclidean distance.
Converts a hash or ActiveRecord object into an html string (table).
Parses the NCBI genetic code table, generating hash maps of each species' name, start codons, stop codons and codon table. The output of CodonTableParser can be customized easily and used to update the respective constants of BioRuby's CodonTable class whenever the original data has changed.
A ruby gem that parses codon table from http://www.kazusa.or.jp/codon and turn it to hash or JSON
Settings is a plugin that makes managing a table of global key, value pairs easy. Think of it like a global Hash stored in you database, that uses simple ActiveRecord like methods for manipulation. Keep track of any global setting that you dont want to hard code into your rails app. You can store any kind of object. Strings, numbers, arrays, or any object. Ported to Rails 3!
Provides a simple modification to existing hashes to provide key lookup by value in addition to value lookup by key. For example: TABLE = { :key => 1 }.extend(WithReverseLookup) TABLE[:key] #=> 1 TABLE[1] #=> :key This is mostly useful for lookup tables.
Ever found yourself trying to find the right way to use Ruby's CSV library? Confused about all those CSV.parse and CSV.open, and when to use each of them? The purpose of CsvObject gem is to create convenient interface to work with CSV files and data in Ruby. Whatever you have: string with filename, CSV data itself, Pathname, CSV::Table, array of hashes, or even Paperclip::Attachment, just throw it into CsvObject.new(your_stuff)
Array of hashes matcher.
convert table of content hash into <li>
An efficient MD5 hash lookup based on one of the biggest rainbow lookup tables available.
Flattens a hash table in order to only have a hash table with key/values where each value is not a hash.
This tool takes a list of paths and checks them for git repositories. It writes to a sqlite database a table of repositories found, indexed by both the first and the second commit hashes on the repository. The rationale is that these first couple of commits are unlikely to ever change as the result of a rebase, and thus make a fairly reliable fingerprint of the identity of the repository. The motivation behind this tool is for use with Serf and the serf-hander gem to power a slick, simple deployment manger utiizing a git repo and deploy hooks at the underlying source and trigger.
Lite3::DBM is an object that behaves like a Ruby Hash but stores its data in a SQLite3 database table. It is a drop-in replacement for DBM. Values are optionally serialized with YAML or Marshal, allowing (almost) any Ruby type to be stored. In addition, there is rudimentary support for transactions with emphasis on simplicity and safety.
Efficient conversion of a Ruby Array to a lookup table-like Hash written in Rubex via a C extension.
This tool transform from array or hash data to table data.
use database table as a hash table
Monkey patch terminal-table to generate table from array of hashes
Format to the ascii table format for Hash
Use an ActiveRecord Hash column as backend for dynamic attributes. Dynamic attributes will act like table columns. Just include the HashAttributes module in your ActiveRecord::Base class.