In early March, a Twitter message from the U.S. Surgeon General went viral: “STOP BUYING MASKS,” he said, “They are not effective in preventing the general public from catching coronavirus,” because “if healthcare providers cannot get them to care for sick patients, it puts them and our communities at risk!” Around the same time, the Center for Disease Control, in its guideline for coronavirus protection for the public, said “if you are not sick, you do not need to wear a facemask,” because “facemasks may be in short supply and they should be saved for caregivers.”
This message came when…
Once in a while, one wants to put several github repositories together for various use cases:
One inevitably came upon two git tools when looking for solutions to the above: Subtree and Submodule. They both seem to be able…
I used pentaho Data Integration extensively for ETL in data warehousing on a PC before, but want to use it in a Mac now. I followed this instruction to install pentaho 9.0 on a Macbook pro today.
I used these two articles as references but had to adjust in two issues. One is the java runtime environment must be version 8, the other is a privilege issue.
Here are the steps I followed:
Pentaho so far only works with jdk 7 or jdk8. …
Here are some infographics made by D3.
One needs to be mindful of possible conflicts integrating D3 in React app:
People have different philosophy to handle the conflict between the two. Below example give the control to the component — only after the component is mounted, the drawChart method is called.
To create a new rails application, one does:
rails new my_app
This one-line command installs 106 items at total size 315MB in a my_app directory, and lays out the framework for a basic web app.
Many things are installed in this folder, including Rack, ActiveRecord, ActiveModel, ActiveView — the major components of Rails framework, and other components of the rails framework.
Inside this project folder, one has access to rails command line tools, including: rails generate, rails console, rails server, rails dbconsole, etc. To see a complete list of rail command line tools, do:
As obvious as it is…
This method connecting an existing database with an rail project. It basically hijacked Rails’ “generate model” functionality to connect an existing database to Active Record.
A initial “generate model” creates a migration file, which we will use db:migrate to create the schema.rb for ActiveRecord .
To prepare for this to happen, first configure the source of database for ActiveRecord in config file.
For rails, configure db/database.yml
For simple active record project, configure in enviroment.rb
STEP 1. rails new projectname
This will initiate a new project, with rails framework file structure.
STEP 2. config/database.yml
Enter your pre-existing database name in database.yml…