17 April 2014

The Ruby Reflector

Topic

Comma-Separated Values

  Source Favicon
Email

blocks updates to MyISAM, MEMORY, CSV and ARCHIVE tables;

blocks DDL against any tables;

does not block updates to temporary and log tables.

Unlike FTWRL , the LOCK TABLES FOR BACKUP statement:

does not invalidate the Query Cache;

never waits for SELECT queries to complete regardless of the storage engines involved;

never blocks SELECT s, or updates to InnoDB, Blackhole and Federated tables.

In other words, it does exactly what backup utilities need: block non-transactional …

mysqlperformanceblog.com Read
  Source Favicon
By Kurtz of Viget.com Blogs 1 month ago.
Email

You define your seeds in the formats you love: YML, JSON, and CSV are supported out of the box.

Step 2:

db/seeds/development.rb include Sprig :: Helpers sprig User

You tell Sprig which classes should be seeded for the current environment. Sprig finds your lovely seed files and does the rest.

Step 3:

No wait... That's it.

Relational Seeding for Relational Data

All real-world applications contain relationships between models. Sprig allows seeds to reference one another …

viget.com Read
  Source Favicon
By Jaime Sicam of MySQL Performance Blog 2 months ago.
Email

CSV output

You can also opt to generate CSV output and use LOAD DATA INFILE to import the CSV data to your table. Under the EXPORT TYPES section, select the CSV tab. Inside the Generate frame, select "Prompt to download" and click the "Generate" button.

Upload the CSV file under the /tmp directory of your MySQL server and import it via the MySQL console: # mysql test LOAD DATA INFILE '/tmp/dataDec-11-2013.csv' INTO TABLE employees FIELDS TERMINATED …

mysqlperformanceblog.com Read
  Source Favicon
By John Resig of John Resig 5 months ago.
Email

Download Encoded, Gzipped, CSV and Convert to HTML

This is the big one:

Select HTTP Get Request and http://nodestreams.com/input/people.csv.gz .

Select Un-Gzip (note that some of the characters are encoded incorrectly, we need to fix this!).

Select Change Encoding (even though it comes out as a buffer, this is correct, as we'll see in a moment).

Select Parse CSV as Object .

Select Convert Object w/ Handlebars (with the default table row HTML …

ejohn.org Read
  Source Favicon
Email

The hotel data comes from POIplaza and comes formatted in CSV. We are going to read from the disk, parse the data, and build a quad tree from it.

The code to build the quad tree will reside in TBCoordinateQuadTreeController typedef struct TBHotelInfo { char* hotelName; char* hotelPhoneNumber; } TBHotelInfo;

TBQuadTreeNodeData TBDataFromLine(NSString *line) { // Example line: // -80.26262, 25.81015, Everglades Motel, USA-United States, +1 305-888-8797 …

robots.thoughtbot.com Read
  Source Favicon
Email

…regular expressions or read each line and split(',') , but there are many nuances to the CSV format. Ruby's stdlib includes CSV support to help us realize this dream with minimal hassle.

The documentation is unclear on the differences between methods of opening a CSV, nor does it help realize this Ruby data structure easily. We'll be walking through the discovery of this from the documentation, but if you want the final solution jump down to the last code …

technicalpickles.com Read
  Source Favicon
By Shanley of Heroku 8 months ago.
Email

…platform activity - a pattern that can indicate spam operations. We use the JSON or CSV version of the dataclip to bring this data into abuse prevention apps for closer scanning. The lets our security team work better and faster - we don't have to hardcode complicated queries into our apps, there is no need to redeploy if we want to change a query, and we don't have to give our security apps full access to the underlying databases - just to the behavior patterns we've identified. …

blog.heroku.com Read
  Source Favicon
On igvita.com 10 months ago.
Email

…satisfy your curiousity, all you need to do is download and import ~400GB of raw SQL/ CSV data. Easy, right? Yeah, not really. Instead, wouldn't it be nice if we had the full dataset of all the HTTP Archive data to query on demand, and with ad-hoc questions?

Google BigQuery + HTTP Archive

Well, good news, now you can satisfy your curiosity in minutes (or seconds, even). The full HTTP Archive dataset is now available on BigQuery! To get started, signup for BigQuery and …

igvita.com Read
  Source Favicon
By Patrick of Kalzumeus Software 1 year ago.
Email

…data which is available in the public domain, and transform it from GBs of opaque CSV files into predictions like "The factory which makes the widget that you're running low on has a high probability of closure three days from now as a result of this hurricane", which lets the user take consequential actions like "Put in a rush order at our alternate supplier so our main production line doesn't block on lack of input 6 days from now." When factory lines go down …

kalzumeus.com Read
  Source Favicon
By Paul Ingles of pingles 1 year ago.
Email

Our results were captured in a CSV file and looked a little like this:

A,0.25,0.15 A,0.2,0.19 B,0.19,0.25

Each line contains the item's actual class, the predicted probability for membership of class A, and the predicted probability for membership of class B. Using ggplot2 we produce the following:

Items have been classified into 2 groups- A and B. The axis show the log probability (we're using Naive Bayes to classify items) that the item belongs to the specified class. We …

oobaloo.co.uk Read