嘿伙计们,我在Github克隆一个回购:https://github.com/huacnlee/homeland/tree/
当我运行服务器时,我收到此错误:
Agro:homeland Zhulin$ rails s
DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from <top (required)> at /Users/Zhulin/Desktop/RailsApps/homeland/config/application.rb:9)
/usr/local/lib/ruby/1.9.1/syck.rb:145:in `initialize': No such file or directory - /Users/Zhulin/Desktop/RailsApps/homeland/config/config.yml (Errno::ENOENT)
from /usr/local/lib/ruby/1.9.1/syck.rb:145:in `open'
from /usr/local/lib/ruby/1.9.1/syck.rb:145:in `load_file'
from /Users/Zhulin/Desktop/RailsApps/homeland/config/application.rb:48:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands.rb:28:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands.rb:28:in `block in <top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands.rb:27:in `tap'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Run Code Online (Sandbox Code Playgroud)
我该怎么办?BTW哪里可以找到更简单的Rails代码来学习Ruby和Rails,谢谢
我注意到有时Haskell纯函数以某种方式被缓存:如果我用相同的参数调用函数两次,第二次立即计算结果.
根据评论的要求,这是我在网上找到的一个例子:
isPrime a = isPrimeHelper a primes
isPrimeHelper a (p:ps)
| p*p > a = True
| a `mod` p == 0 = False
| otherwise = isPrimeHelper a ps
primes = 2 : filter isPrime [3,5..]
Run Code Online (Sandbox Code Playgroud)
在运行它之前,我期望它非常慢,因为它一直在访问元素而primes没有显式地缓存它们(因此,除非这些值在某处缓存,否则它们需要重新计算很多次).但是我错了.
如果我设置+sGHCI(在每次评估后打印时间/内存统计数据)并评估表达式primes!!10000两次,这就是我得到的:
*Main> :set +s
*Main> primes!!10000
104743
(2.10 secs, 169800904 bytes)
*Main> primes!!10000
104743
(0.00 secs, 0 bytes)
Run Code Online (Sandbox Code Playgroud)
这意味着必须缓存至少primes !! 10000(或更好:整个primes列表,因为也primes!!9999不会花费时间).
MS VS x86编译器对以下定义没有任何问题,但GCC(ARM)抱怨.GCC是哑的还是MSVS_x86太聪明了?
bool checkPointInside(const CIwVec2& globalPoint) {
return checkPointIn(globalPoint, CIwVec2());
}; /// error: no matching function for call to 'Fair::Sprite::checkPointIn(const CIwVec2&, CIwVec2)'
bool checkPointIn(const CIwVec2& globalPoint, CIwVec2& localPoint) {
return false;
};
Run Code Online (Sandbox Code Playgroud) 我想用我IsGPUBasedAttribute的enum成员这样:
public enum EffectType
{
[IsGPUBased(true)]
PixelShader,
[IsGPUBased(false)]
Blur
}
Run Code Online (Sandbox Code Playgroud)
但编译器不允许我使用:
[AttributeUsage (AttributeTargets.Enum, AllowMultiple = false)]
Run Code Online (Sandbox Code Playgroud)
AttributeTarget限制enum成员使用的正确价值是什么?
我使用assetUrl从iPod库中读取歌曲(在代码中命名为audioUrl)我可以用很多方式播放,我可以剪掉它,我可以用它来做一些但是......我真的不明白我要用这个做什么CMSampleBufferRef获取绘制波形的数据!我需要有关峰值的信息,我怎么能得到这个(也许是另一种)方式?
AVAssetTrack * songTrack = [audioUrl.tracks objectAtIndex:0];
AVAssetReaderTrackOutput * output = [[AVAssetReaderTrackOutput alloc] initWithTrack:songTrack outputSettings:nil];
[reader addOutput:output];
[output release];
NSMutableData * fullSongData = [[NSMutableData alloc] init];
[reader startReading];
while (reader.status == AVAssetReaderStatusReading){
AVAssetReaderTrackOutput * trackOutput =
(AVAssetReaderTrackOutput *)[reader.outputs objectAtIndex:0];
CMSampleBufferRef sampleBufferRef = [trackOutput copyNextSampleBuffer];
if (sampleBufferRef){/* what I gonna do with this? */}
Run Code Online (Sandbox Code Playgroud)
请帮我!
这是代码:
static class AsyncFinally
{
static async Task<int> Func( int n )
{
try
{
Console.WriteLine( " Func: Begin #{0}", n );
await TaskEx.Delay( 100 );
Console.WriteLine( " Func: End #{0}", n );
return 0;
}
finally
{
Console.WriteLine( " Func: Finally #{0}", n );
}
}
static async Task Consumer()
{
for ( int i = 1; i <= 2; i++ )
{
Console.WriteLine( "Consumer: before await #{0}", i );
int u = await Func( i );
Console.WriteLine( "Consumer: …Run Code Online (Sandbox Code Playgroud) 我将一个变量值从一个http url发送到另一个cfm页面,但我不知道如何在另一个页面上获取该值.在php中我们使用$_GET['variable']; 我不确定ColdFusion中的等价物是什么.
我的应用程序中有多个存储库.我应该把ObjectContext放在哪里?现在,我ObjectContext ctx;在每个存储库中都有一个引用.什么是最聪明,最安全的方法?
c# entity-framework repository repository-pattern objectcontext
我的Android应用程序以几种不同的方式显示文本,并且它们之间存在一些恼人的差异,我希望人们可以提供帮助.
当我使用可能被称为"自动"的显示方法时,文本显示得非常好.通过自动方法,我指的是工具,比如Toasts和Button小部件,我只提供文本,操作系统(或"环境"或其他)为我显示它.这些字母曲线很好,看起来很舒服,而且很容易辨认.
但是,在我处理文本显示的代码中(Canvas.drawText()在Surface Runner视图中使用),文本质量很差.该文本仍然清晰可辨,但它看起来像素化.这些信件看起来并不是最好的.
我尝试过Paint.setTypeface()使用Typeface.SANS_SERIF作为示例,但是当我的代码总是很差时显示的质量.可行,但很差.
有没有人经历过这个?任何人都有解决方案吗?
有谁知道为什么tab(\ t)不能与JOptionPane.showMessageDialog一起使用?
我的代码如下:
String addText = "NAME\t\tADDRESS\t\tTEL.No\tEMAIL\n";
for (int i = 0; i < addressBookSize; i++) {
addText = addText+entry[i].viewAllInfo();
}
System.out.print(addText);
JOptionPane.showMessageDialog(null, addText);
Run Code Online (Sandbox Code Playgroud)
还有其他方法可以在JOptionPane中对齐文本吗?
c# ×3
.net ×2
android ×1
async-ctp ×1
c#-4.0 ×1
c++ ×1
caching ×1
canvas ×1
coldfusion ×1
coldfusion-9 ×1
core-audio ×1
enums ×1
function ×1
gcc ×1
haskell ×1
iphone ×1
ipod ×1
java ×1
joptionpane ×1
objective-c ×1
php ×1
repository ×1
ruby ×1
text ×1
visual-c++ ×1
waveform ×1