SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
teaching:labs:xp:2008b:clipboard [2008/09/18 08:59]
saskia.koenig
teaching:labs:xp:2008b:clipboard [2018/05/09 01:59] (current)
Line 1: Line 1:
 +====== Clipboard ======
  
 +**Please don't place any confidential information in this clipbard (like iPhone code snippets etc.). Use the [[.:​confidential:​clipboard]] instead.**
 +
 +
 +====== Managing the Database ======
 +
 +==== Emergency DB Drop ====
 +
 +  - Login into tztz.org
 +  - cd in the project folder (/​home/​agile/​.cruise/​projects/​scotty2go/​work)
 +  - enter:
 +
 +  export RAILS_ENV=<​scope>​ ; rake db:drop
 +
 +and replace <​scope>​ with either ''​test'',​ ''​development'',​ or ''​production''​ resp. depending on the DB you want to drop.
 +
 +
 +==== Emergency DB Create ====
 +
 +  - Login into tztz.org
 +  - cd in the project folder (/​home/​agile/​.cruise/​projects/​scotty2go/​work)
 +  - enter:
 +
 +  export RAILS_ENV=<​scope>​ ; rake db:create
 +
 +and replace <​scope>​ with either ''​test'',​ ''​development'',​ or ''​production''​ resp. depending on the DB you want to create.
 +
 +==== DB rollback (delete tables) ====
 +
 +  - Login into tztz.org
 +  - cd in the project folder (/​home/​agile/​.cruise/​projects/​scotty2go/​work)
 +  - enter:
 +
 +  export RAILS_ENV=<​scope>​ ; rake db:migrate VERSION=0
 +
 +and replace <​scope>​ with either ''​test'',​ ''​development'',​ or ''​production''​ resp. depending on the DB you want to rollback.
 +
 +==== DB migration (create tables) ====
 +
 +  - Login into tztz.org
 +  - cd in the project folder (/​home/​agile/​.cruise/​projects/​scotty2go/​work)
 +  - enter:
 +
 +  export RAILS_ENV=<​scope>​ ; rake db:migrate
 +
 +and replace <​scope>​ with either ''​test'',​ ''​development'',​ or ''​production''​ resp. depending on the DB you want to migrate.
 +
 +====== Cocoa stuff ======
 +
 +==== Cocoa related links ====
 +
 +* [[http://​www.cocoadevcentral.com/​]],​ especially "Learn Objective-C",​ "​Objective-C Style",​ "C Tutorial for Cocoa" and "Learn Cocoa"​.
 +
 +
 +
 + 
 +
 +====== Rails stuff ======
 +
 +==== controller ====
 +
 +
 +  def put_via_get_verb
 +    puts params[:id]
 +    puts params[:​note]
 +    ​
 +    @note = Note.find(params[:​id])
 +    @note.update_attributes(params[:​note])
 +    ​
 +    render :text => '​OK'​
 +  end
 +
 +  def show
 +    ...
 +    ​
 +    format.html { render :text => @note.content }
 +    ​
 +    ...
 +  end
 +
 +
 +==== routes.rb ====
 +
 +  map.resources :notes, :collection => { :​put_via_get_verb => :get }
 +
 +==== GET a note from the Rails server into the iPhone ====
 +
 +  http://​rails.tztz.org/​pascal_mark_fdc/​notes/​2
 +
 +==== PUT a note from the iPhone to the Rails server ====
 +
 +  http://​rails.tztz.org/​pascal_mark_fdc/​notes/​put_via_get_verb?​id=2&​note[content]='​Hello World!'​
teaching/labs/xp/2008b/clipboard.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019