我正在研究MATLAB中一些简单的面向对象的代码.我试图调用我的类方法之一,其定义中没有输入或输出参数.
功能定义:
function roll_dice
功能调用:
obj.roll_dice;
执行此操作时,MATLAB说:
??? Error using ==> roll_dice
Too many input arguments.
Error in ==> DiceSet>Diceset.Diceset at 11
obj.roll_dice;
(etc...)
Run Code Online (Sandbox Code Playgroud)
任何人有什么想法可能导致它?有没有秘密的自动参数我不知道我在路过?
启动基本的Sinatra应用程序.它似乎没有使用我的布局模板.如果我在layout.haml中放入垃圾,我会收到有关它的Sinatra 500错误页面,而不是正确形成的haml文件.运行Ruby 1.9.2.在Windows上,今天晚上安装了Sinatra,Haml和Rack的宝石.
应用代码:
require 'rubygems'
require 'sinatra'
require 'haml'
set :haml, :format => :html5
get '/' do
"Hello world, it's #{Time.now} at the server!"
end
Run Code Online (Sandbox Code Playgroud)
App的位置/ views/layout.haml
%html
%body
= yield
Run Code Online (Sandbox Code Playgroud)
生成的源"http:// localhost:4567 /"页面
Hello world, it's 2011-11-05 02:25:48 -0400 at the server!
Run Code Online (Sandbox Code Playgroud)
^注意我的布局不足.