Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.
CS183: Startup—Notes Essay—The Challenge of the Future
Purpose and Preamble
Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.
CS183: Startup—Notes Essay—The Challenge of the Future
Purpose and Preamble
| import java.io.ByteArrayOutputStream; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.util.List; | |
| import java.util.Map; | |
| import java.util.Properties; | |
| import org.apache.avro.io.BinaryDecoder; | |
| import org.apache.avro.io.BinaryEncoder; | |
| import org.apache.avro.io.DecoderFactory; |
| ;; | |
| ;; NS CHEATSHEET | |
| ;; | |
| ;; * :require makes functions available with a namespace prefix. | |
| ;; | |
| ;; * :use makes functions available without a namespace prefix | |
| ;; (i.e., refers functions to the current namespace). | |
| ;; | |
| ;; * :import refers Java classes to the current namespace. | |
| ;; |
| 1) stopping all running solr processes | |
| 2) removing the solr folder BUT keep a copy of it accessible in case you need some of the old config, synonyms and such. | |
| 3) gem uninstall all related gems | |
| > for i in `gem list --no-versions`; do gem uninstall -aIx $i; done | |
| 4) bundle install | |
| 5) rails generate sunspot_rails:install |
| var express = require('express'); | |
| var app = express.createServer(); | |
| require('./settings').boot(app); | |
| app.dynamicHelpers({ | |
| base: function(){ | |
| // return the app's mount-point | |
| // so that urls can adjust. For example | |
| // if you run this example /post/add works |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
| import java.io.ByteArrayOutputStream; | |
| import java.io.FileOutputStream; | |
| import java.util.ArrayList; | |
| import java.util.LinkedHashMap; | |
| import java.util.List; | |
| import java.util.Map; | |
| import com.itextpdf.text.Chapter; | |
| import com.itextpdf.text.Chunk; | |
| import com.itextpdf.text.Document; |
| # Index | |
| --------------------------------------------------------------------- | |
| curl -XPUT http://localhost:9200/pictures/ -d ' | |
| { | |
| "settings": { | |
| "analysis": { | |
| "analyzer": { | |
| "index_analyzer": { | |
| "tokenizer": "standard", |