有没有人成功使用waf 来构建java应用程序?最好是在Jython上?也许与常春藤整合?
我想创建一个定义新代码模板的插件(比如这篇博文).如何将参数传递到模板中?喜欢${name:param}?
支持我们有一个n*m表,两个玩家玩这个游戏.他们依次排除细胞.玩家可以选择一个单元格(i,j)并排除从(i,j)到(n,m)的所有单元格,以及排除最后一个单元格丢失游戏的人.
例如,在3*5板上,播放器1排除小区(3,3)到(3,5),播放器2排除(2,5)到(3,5),当前板是这样的: (O表示不排除单元格,x表示排除单元格)
3 O O x x x
2 O O O O x
1 O O O O O
1 2 3 4 5
Run Code Online (Sandbox Code Playgroud)
在玩家1排除从(2,1)到(3,5)的单元格后,棋盘变为
3 x x x x x
2 x x x x x
1 O O O O O
1 2 3 4 5
Run Code Online (Sandbox Code Playgroud)
现在,玩家2排除了从(1,2)到(3,5)的单元格,只留下了(1,1)清洁:
3 x x x x x
2 x x x x x
1 O x x x x
1 2 3 4 5
Run Code Online (Sandbox Code Playgroud)
因此,玩家1必须排除唯一的(1,1)单元格,因为一个玩家必须在一个回合中排除至少一个单元格,并且他输掉游戏.
很明显,在n*n,1*n和2*n(n> …
我注意到这种功能存在于颠覆中,并且它的工作非常好.我想知道SourceGear Vault是否有这样的东西.
我正在使用php 5.2.6.我有一个策略模式,策略有一个静态方法.在实际实现其中一个策略的类中,它获取要实例化的策略类的名称.但是,我想在实例化之前调用其中一个静态方法,如下所示:
$strNameOfStrategyClass::staticMethod();
Run Code Online (Sandbox Code Playgroud)
但它给了T_PAAMAYIM_NEKUDOTAYIM.
$> cat test.php
<?
interface strategyInterface {
public function execute();
public function getLog();
public static function getFormatString();
}
class strategyA implements strategyInterface {
public function execute() {}
public function getLog() {}
public static function getFormatString() {}
}
class strategyB implements strategyInterface {
public function execute() {}
public function getLog() {}
public static function getFormatString() {}
}
class implementation {
public function __construct( strategyInterface $strategy ) {
$strFormat = $strategy::getFormatString();
}
}
$objImplementation = & …Run Code Online (Sandbox Code Playgroud) 我面临着领导两个(目前)不同开发策略的独立.NET开发组的挑战.一个小组正在开发.NET Framework 2.0(在3.5上可能有一些应用程序).另一组立即采用任何新的框架,并开始用它编写任何新的应用程序(它们运行2.0-4.0应用程序).对于最后一个组,使用早于最新框架的版本编写的应用程序不会升级.
当涉及何时采用新框架的公司开发Web应用程序以及是否将基于先前版本构建的应用程序迁移到最新框架时,当前的思想流派是什么?多年前,人们一直认为技术会成为主流技术 - 但现在似乎并不适用于.NET.
我需要处理从服务返回的记录列表.
然而,记录的处理算法完全基于记录上的某个字段而改变.
为了实现这一点,我已经定义了一个只有一个方法的IProcessor接口:
public interface IProcessor
{
ICollection<OutputEntity> Process(ICollection<InputEntity>> entities);
}
Run Code Online (Sandbox Code Playgroud)
我有两种IProcessor不同类型处理的具体实现.
问题是我需要同时使用所有实现IProcessor..所以我如何注入IProcessor我的Engine类来驱动整个事情:
public class Engine
{
public void ProcessRecords(IService service)
{
var records = service.GetRecords();
var type1Records = records.Where(x => x.SomeField== "Type1").ToList();
var type2Records = records.Where(x => x.SomeField== "Type2").ToList();
IProcessor processor1 = new Type1Processor();
processor.Process(type1Records);
IProcessor processor2 = new Type2Processor();
processor.Process(type2Records);
}
}
Run Code Online (Sandbox Code Playgroud)
这就是我目前正在做的事情......它看起来并不好看.
关于如何改进这种设计的任何想法......或许使用IoC?
我只是为Heroku设置我的备份策略,并且我正在了解我需要保护的更多信息.
显然,我需要确保通过自己的错误或恶意攻击等来备份以保护数据丢失,但是我是否还需要防止Heroku搞砸并丢失/破坏我的数据?
IE我可以依靠heroku为硬件故障等提供足够的冗余,或者我是否需要防止这种情况.
我看过很多例子似乎都解决了这个简单的案例.我要解析的字符串是:
"2012-06-01 16:45:34 EDT"
我试图local_time_input_facet用folloiwng 创建一个:
"%Y-%m-%d %H:%M:%S %Z"
local_date_time始终未设置对象的区域指针.阅读文档令人困惑:
%Z*!全时区名称(仅限输出).将time_facet与ptime一起使用时,将忽略此标志.
"EDT"//东部夏令时
有没有人这样做过?
更新:我已更新代码以更好地说明问题:
using namespace std;
using namespace boost::local_time;
int main()
{
stringstream ss;
// Set up the input datetime format.
local_time_input_facet *input_facet
= new local_time_input_facet("%Y-%m-%d %H:%M:%S %ZP");
ss.imbue(std::locale(ss.getloc(), input_facet));
local_date_time ldt(not_a_date_time),ldt1(not_a_date_time);
// Read a time into ldt
ss.str("2012-06-01 17:45:34 EDT");
ss >> ldt;
ss.str("2012-06-01 17:45:34 CDT");
ss >> ldt1;
std::cerr << (ldt - ldt1).total_seconds() << std::endl;
// Write the time to stdout.
cout << "Full …Run Code Online (Sandbox Code Playgroud) 假设有一个CString变量存储文件的完整路径.现在我只能从if中找到文件名.如何在vc ++中完成它.
CString FileName = "c:\Users\Acer\Desktop\FolderName\abc.dll";
Run Code Online (Sandbox Code Playgroud)
现在我只想要abc.dll.