我正在尝试在我的win32 D1-Tango设置上安装DMDScript-tango.我使用的版本是0.99.9 Kai包.
当我尝试构建它时,我得到以下错误(以及其他)
C:\DMD\sources\dmdscript>dsss build
Creating imports for dmdscript_tango
dmdscript_tango => dmdscript_tango
dmdscript_tango\script.d(24): module ctype cannot read file 'std\ctype.d'
Command c:\dmd\dsss\bin\rebuild.exe returned with code 1, aborting.
Error: Command failed, aborting.
C:\DMD\sources\dmdscript>
Run Code Online (Sandbox Code Playgroud)
它看起来仍然取决于一些phobos代码 - 但由于DMDScript源提到tangobos,我想我必须安装它才能使DMDScript工作.
从我所看到的情况来看,Tangobos这些日子似乎与探戈捆绑在一起,但我似乎无法让它发挥作用.我将不得不假设页面已经过时,而tangobos实际上并没有提供0.99.9的捆绑.
所以,我想我会从svn.dsource.org获取最新的tangobos,但是当我尝试构建它时,我收到了这个错误:
C:\DMD\sources\tangobos>dsss build
Creating imports for crc32
Creating imports for tangobos
Creating imports for tangobos-etc
crc32.d => crc32
Error: no object files to link
Command c:\dmd\dsss\bin\rebuild.exe returned with code 1, aborting.
Error: Command failed, aborting.
C:\DMD\sources\tangobos>
Run Code Online (Sandbox Code Playgroud)
我对这些链接器错误很无能为力.所以我无法弄清楚如何解决这个问题.你可以在这里看到dsss.conf …
我有一个HashMap,我需要通过整数值获取一个项目.我注意到有一个containsValue()函数,但看起来我仍然需要迭代遍历地图才能找到正确的索引.
我的问题是; 如果我之后需要遍历它,为什么要使用containsValue()?
另外,我完全错过了这一点吗?;-)
我正在尝试使用同步请求读取文本文件.它不起作用,但我也没有错误或警告.
有人能告诉我我做错了吗?
NSString *url = @"http://pappons.com/test.txt" ;
NSLog(@"getHTTPData: %@" , url ) ;
NSURLResponse* response = nil;
NSURLRequest* urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];
NSData* data = [NSURLConnection sendSynchronousRequest:urlRequest returningResponse:&response error:nil] ;
NSString *myString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog( @"data: %@" , myString ) ;
Run Code Online (Sandbox Code Playgroud)
输出:
2012-06-15 11:33:42.209 FrederikTest[1365:707] getHTTPData: http://pappons.com/test.txt
2012-06-15 11:33:42.306 FrederikTest[1365:707] data:
Run Code Online (Sandbox Code Playgroud) 我似乎在我的一个类中重载opIndexAssign时遇到了一些麻烦.
我上课了; JSObject的定义如下:
alias char[] String;
Run Code Online (Sandbox Code Playgroud)
...
class JSObject : Dobject
{
/*****************************************************************
* Constructors
******************************************************************/
this( Dobject dobj )
{
super( dobj ) ;
}
this()
{
super( null ) ;
}
this( AssociativeArray data )
{
// initiate
super( null ) ;
// then populate
foreach( k, v ; data )
{
this[ k ] = v ;
}
}
public void opIndexAssign( String key , String val )
{
Value* v = new Value() ;
v.putVstring( val …Run Code Online (Sandbox Code Playgroud) 我想使用索引调色板将 24 位 RGB 图像(每个通道 8 位)转换为 8 位。
我最初的想法是创建一个数组并简单地计算每种颜色在图像中出现的次数,但我认为如果有大面积的颜色略有变化而占用了所有调色板空间,那将是浪费较小但可能更重要的颜色组。
完成调色板的构建后,我的想法是将每种 RGB 颜色视为 3 维矩阵,并将其点积与调色板中的每个条目进行比较。
...
正如您可能看到的,我并不完全了解这些术语,但我希望您明白我的意思:)
我的问题是;有谁能够分享关于如何解决这个问题的见解,或者也许能让我找到在线阅读材料的正确方向?
谢谢!