我很想知道谁使用JScript.Net以及使用什么类型的应用程序.每当我阅读MSDN .Net文档时,我总会注意到JScript示例,但多年来我一直是C#dev,我从来没有真正知道任何人使用它.
人们使用它的是什么类型的应用程序,以及它在灵活性,功能和一般使用方面如何衡量C#?
[ 编辑:只是为了澄清 - 我不是在问JScript.Net 是什么,我问的是人们实际使用它是什么 - 即有兴趣知道实际的使用场景以及人们如何找到它的工作方式]
有谁知道"C编译器"cl"无法编译简单的测试程序." 手段?
我试图在MSVC 9上使用CMake 编译Wt.
操作系统是Windows XP.
这是完整的日志:
检查工作C编译器:cl检查工作C编译器:cl - 断开CMake错误:I/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:50(MESSAGE):C编译器" cl"无法编译简单的测试程序.
它失败并带有以下输出:
改变目录:I:/ SophisPal/build/CMakeFiles/CMakeTmp
运行Build命令:C:\ PROGRA~1\MICROS~1.0\Common7\IDE\VCExpress.exe CMAKE_TRY_COMPILE.sln/build Debug/project cmTryCompileExec
Microsoft(R)Visual C++ Express Edition版本9.0.30729.1.
版权所有(C)Microsoft Corp 2007.保留所有权利.
1> ------ Build build:项目:cmTryCompileExec,配置:调试Win32 ------
1>正在编译...
1> Microsoft(R)32位C/C++优化编译器版本15.00.30729.01 for 80x86
1>版权所有(C)Microsoft Corporation.版权所有.
1> cl/Od/D"WIN32"/ D"_WINDOWS"/ D"_DEBUG"/ D"CMAKE_INTDIR = \"Debug \""
/D"_MBCS"/ FD/RTCs/MDd /Fo"cmTryCompileExec.dir\Debug \"
/Fd " I:/SophisPal/build/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec.pdb"/ W3/c/Zi/TC/Zm10001>.\ testCCompiler.c
1> testCCompiler.c
1>将清单编译为资源......
1> Microsoft(R)Windows(R)资源编译器版本6.1.6723.1
1>版权所有(C)Microsoft Corporation.版权所有.
1>链接...
1>嵌入清单......
1>项目:错误PRJ0003:错误产生'cmd.exe'.
1>构建日志保存在
"file:// i:\ SophisPal\build\CMakeFiles\CMakeTmp\cmTryCompileExec.dir\Debug\BuildLog.htm"1> cmTryCompileExec - 1个错误,0个警告
==========构建:0成功,1失败,0最新,0跳过========== …
可以告诉我这个代码有什么不对吗?它编译和一切都很好,但输出是固定的零一直下降.所以它不算数字.
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
const char FileName[] = "c:/test.txt";
int main ()
{
string lineBuffer;
ifstream inMyStream (FileName); //open my file stream
if (inMyStream.is_open())
{
//create an array to hold the letter counts
int upperCaseCount[26] = {0};
int lowerCaseCount[26] = {0};
//read the text file
while (!inMyStream.eof() )
{
//get a line of text
getline (inMyStream, lineBuffer);
//read through each letter in the lineBuffer
char oneLetter;
for( int n=0; n < (int)lineBuffer.length(); ++n ) …Run Code Online (Sandbox Code Playgroud) 我将在明年初(2010年)开始使用Rails开展一个大型新项目.有人可以给我建议我应该使用哪个版本的Rails以及为什么?
如果是Default或Empty,我想提供一些值:
string[] str = {string.Empty, "hello", "world" };
var select = str.Select(s => s).DefaultIfEmpty("nodata");
GridView1.DataSource = Select;
GridView1.DataBind();
Run Code Online (Sandbox Code Playgroud)
为什么我的网格没有被填满:
nodata
hello
world
Run Code Online (Sandbox Code Playgroud)
相反,我收到:
hello
world
Run Code Online (Sandbox Code Playgroud) 我想用CSS控制布局.如何<input>使用CSS 调节元素之间的空间(我希望它们在两行上)?
<form name="publish" id="publish" action="publishprocess.php" method="post">
Title:<input type="text" id="title" name="title" size="60" maxlength="110" value="<?php echo $title ?>" <br/>
<div>Contact<input type="text" id="contact" name="contact" size="24" maxlength="30" value="<?php echo $contact ?>" /></div><br/> Task description(You may include task description, requirements on bidders, time requirements,etc):<br/>
<textarea name="detail" id="detail" rows="7" cols="60" style="font-family:Arial, Helvetica, sans-serif"><?php echo $detail ?></textarea>
<br/><br/> price <input type="text" id="price" name="price" size="10" maxlength="20" value="<?php echo $price ?>" /><br/>
<label> Skill or Knowledge Tags</label><br/><input class="tagvalidate" type="text" id="tag" name="tag" size="40" maxlength="60" value="<?php echo $tag …Run Code Online (Sandbox Code Playgroud)我想用一个Integer Mapping创建一个NSMutableDictionary到一个strucuter(struct).例:
int nVar = 1;
typedef struct
{
NSString *pstrName;
}sSampleStruct;
sSampleStruct *sObject = {@"test"};
NSMutableDictioary *pSampleMap = [[NSMutableDictioary allo] init];
[pSampleMap setObject:sObject forKey:[[nsnumber alloc] initwithint:nVar];
Run Code Online (Sandbox Code Playgroud)
这是我想做的事情?但由于结构不是一个对象,它会发出警告吗?无论如何,我可以用strutures创建一个字典.或者以任何其他方式创建具有结构的地图?
请尽快回复.....
谢谢普拉迪普.
这是一个详细说明的示例:
我在我的视图中使用ItemsControl动态创建一个简单的条形图,并将项目绑定到我的BarGraphViewModel中的BarViewModel集合(每个包含一个值的百分比).每个酒吧应该有不同的颜色.颜色应该从一个集合中选择,例如{Color1, Color2, ..}
集合本身是不变的,但条数将取决于具体情况.
一个简单的解决方案是创建一个简单的BarViewModel,如下所示:
public class BarViewModel
{
public int Percentage { get; set; }
public SolidColorBrush Stroke { get; private set; }
public BarGraphViewModel(SolidColorBrush stroke)
{
Stroke = stroke;
}
}
Run Code Online (Sandbox Code Playgroud)
(为了简洁,我省略了属性更改和验证实现)
现在我可以从我的BarGraphViewModel为每个百分比创建一个BarViewModel,并传入从我的Color集合创建的相应ColorBrush.
然后在Xaml中我将创建一个简单的ItemsTemplate,它将绑定到这些属性.
只有现在,因为它包含一个SolidColorBrush类型的属性,我的ViewModel依赖于Presentation框架,如果我想在另一个环境中使用它,它将不得不被更改.
这是否会打破MVVM最佳实践,或者它是否可以接受(你必须在某处绘制线条或者事情变得太复杂)
我只是想看看其他人对此的看法,以及是否有其他解决方案让ViewModel完全不了解Presentation Layer而不会太复杂.我可以想象ValueConverters可以提供帮助吗?
我正在从维基百科API中提取一个最初看起来像这样的字符串:
链接文本.我想剥离所有{{...}} 以及它们之间的所有内容(可以是任何类型的文本).为此,我考虑使用带有" preg_match"," preg_replace" 的递归函数.就像是:
function drop_brax($text)
{
if(preg_match('/{{(.)*}}/',$text))
return drop_brax(preg_replace('/{{(.)*}}/','',$text));
return $text;
}
Run Code Online (Sandbox Code Playgroud)
由于以下情况,此功能无效:
{{我喜欢mocachino {{但我也喜欢香蕉}}和frutis}}
这将剥离{{和}}的第一次出现之间的所有内容(并留出"和frutis}}").我该怎么做呢?(同时保持漂亮的递归形式).