我想在颤振中将Filea转换为一个ByteData对象。像这样的东西:
import 'dart:io';
File file = getSomeCorrectFile(); //This file is correct
ByteData bytes = ByteData(file.readAsBytesSync()); //Doesnt compile
return bytes;
Run Code Online (Sandbox Code Playgroud)
我知道ByteData构造函数接收字节数的长度并将它们初始化为 0,所以我可以做类似的事情,ByteData(file.readAsBytesStync().length);但是我该如何填充它们?我错过了什么?
我想知道,如何在序列图上表示“ if cond1 else if cond2”语句?
if (condition1) {
// Do something
} else if(condition2)
{
// Do something else if
}
Run Code Online (Sandbox Code Playgroud)
我不确定是否带有两个独立的“ Opt”子句
如果可能,创建解决方案的图像表示。
我是rails的新手,我目前正在使用Cloud9中的rails教程.
我做了一个简单的端点来测试我Hello World在默认情况下的可爱ApplicationController.这是我的控制器:
ApplicationController的
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
def hello
render html: "hello, world"
end
end
Run Code Online (Sandbox Code Playgroud)
但是当我在Heroku中部署项目时,它会返回 method not allowed.
任何想法我做错了什么?这是我拥有的其他重要文件
的Gemfile
source 'https://rubygems.org'
gem 'rails', '5.1.2'
gem 'puma', '3.9.1'
gem 'sass-rails', '5.0.6'
gem 'uglifier', '3.2.0'
gem 'coffee-rails', '4.2.2'
gem 'jquery-rails', '4.3.1'
gem 'turbolinks', '5.0.1'
gem 'jbuilder', '2.7.0'
group :development, :test do
gem 'sqlite3', '1.3.13'
gem 'byebug', '9.0.6', platform: :mri
end
group :development do
gem 'web-console', '3.5.1'
gem 'listen', '3.0.8'
gem 'spring', …Run Code Online (Sandbox Code Playgroud)