Skip to content

Instantly share code, notes, and snippets.

function main() {
SC.page.awake() ;
Todos.server.listFor(Todos.Task, {
order: 'position, title',
onSuccess: function(transport, cacheCode, tasks, count) {
Todos.tasksController.set('content', tasks) ;
}
}) ;
/ SPROUTCORE DEFAULT INDEX TEMPLATE
/ This template provide provides a basic wrapper for a SproutCore client.
/ Most of the time, it will be sufficient for your own needs. However, if
/ you need to create your own template, you can do so by copying this file
/ into your client, naming it 'index.rhtml' and then adding the options
/ :index => 'index' to your client declaration in routes.rb.
!!! Strict
%html
%head
// haml style:
- view :workspace_container1, :class => 'workspace_container', :top => 40, :left => 0 do
- split_view :workspace1, :class => 'sc-app-workspace', :splitter => :thick, :direction => :vertical do
- scroll_view :top_view1, :class => 'list_view', :height => 100 do
- view :list_view1 do
<p>This view can be collapsed. It has no min or max thickness.</p>
= content
= split_divider_view :divider1, :top => 100
- scroll_view :bottom_view1, :class => 'details_view', :top => 109 do
- view :greeting do
%div
whatever you want
.some-style WOW
this is easy
mysql> desc doctors
-> ;
+------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| first_name | varchar(50) | YES | | NULL | |
| last_name | varchar(50) | YES | | NULL | |
+------------+-------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)
Basically 8 times this:
8)
NoMethodError in 'DataMapper::Associations::OneToMany::Proxy#slice! with a range not within the Collection should return nil'
undefined method `key' for nil:NilClass
/Users/copa/project/merb/dm/specs/dm-core/lib/dm-core/collection.rb:579:in `destroy!'
/Users/copa/project/merb/dm/specs/dm-core/lib/dm-core/collection.rb:576:in `destroy!'
/Users/copa/project/merb/dm/specs/dm-core/spec/public/associations/one_to_many_spec.rb:51:
Wed, 29 Oct 2008 04:25:11 GMT ~ debug ~ DROP TABLE IF EXISTS "articles"
Wed, 29 Oct 2008 04:25:11 GMT ~ debug ~ PRAGMA table_info('articles')
Wed, 29 Oct 2008 04:25:11 GMT ~ debug ~ SELECT sqlite_version(*)
Wed, 29 Oct 2008 04:25:11 GMT ~ debug ~ CREATE TABLE "articles" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "title" VARCHAR(50))
Wed, 29 Oct 2008 04:25:11 GMT ~ debug ~ INSERT INTO "articles" ("title") VALUES ('Sample Article')
Wed, 29 Oct 2008 04:25:11 GMT ~ debug ~ INSERT INTO "articles" ("title") VALUES ('Other Article')
Wed, 29 Oct 2008 04:25:11 GMT ~ debug ~ SELECT "id", "title" FROM "articles" WHERE ("title" = 'Sample Article') ORDER BY "id"
1 articles
@return = nil
Wed, 29 Oct 2008 04:25:11 GMT ~ debug ~ DELETE FROM "articles" WHERE ("title" = 'Sample Article') AND ("id" IN (1))
MysqlError: Duplicate entry '9-1' for key 1 (mysql_error_code=0001)
from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.7/lib/dm-core/adapters/data_objects_adapter.rb:92:in `execute_non_query'
from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.7/lib/dm-core/adapters/data_objects_adapter.rb:92:in `execute'
from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.7/lib/dm-core/adapters/data_objects_adapter.rb:171:in `with_connection'
from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.7/lib/dm-core/adapters/data_objects_adapter.rb:90:in `execute'
from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.7/lib/dm-core/adapters/data_objects_adapter.rb:26:in `create'
from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.7/lib/dm-core/adapters/data_objects_adapter.rb:15:in `each'
from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.7/lib/dm-core/adapters/data_objects_adapter.rb:15:in `create'
from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.7/lib/dm-core/reposit
# Consider:
def parse(*options)
if options[0].is_a?(Symbol)
if options[0] == :foo
"foo!"
elsif options[0] == :bar
"bar!"
elsif options[0] == :force
if options[1] == "foo"
loop1() ->
receive
Other ->
io:format("Received ~p~n", [Other]),
loop1()
end.
loop2() -> receive Other -> io:format("Received ~p~n", [Other]), loop2() end.
test() ->