Open Ankh似乎使用Subversion 1.6.2而Tortoise使用Subversion 1.6.0.
用Tortoise创建一个存储库后,我无法看到它.
下载了subversion并执行svn admin -create --pre-1.6-compatible z:\ ......\etc ..现在ankh可以看到它.这是我第一次使用版本控制,也许我不需要乌龟,但Windows资源管理器集成听起来不错.
我正在使用file:///而不是svnserve或apache.
我是否可以沿着ankh使用乌龟或者我是否会继续遇到问题或可能损坏存储库?
SQL查询:
select ApplicationNumber,pri_indicator,count(*) from customer
group by ApplicationNumber,pri_indicator
Run Code Online (Sandbox Code Playgroud)
我如何在LINQ中执行此操作?
我看到使用一个简单的组来计算单个字段的大量结果,但似乎找不到任何或者弄清楚如何做多个字段.
因此,我理解它具有良好的松散耦合,我应该能够在应用程序根目录中使用几行代码替换我的DAL.
我有2个DAL编写,Linq-to-sql和一个JSon文件存储库(用于测试,因为我想试用System.Web.Scripting.JavascriptSerializer).
linq to sql将创建实体而不是我的商业模式.并通过在应用程序根目录中使用构造函数注入的IRepository向上提供它们.
我的JSon层没有任何自动生成的类可以反序列化,所以我迷失了一个简单的方法,让它依赖于接口或抽象类,仍然是函数.
这个问题基于以下假设/理解:
因此,为了满足所有灵活性/敏捷性目标,我需要为每个应用程序域/业务对象提供一个接口,一个业务逻辑可以存在的具体类,以及实现该接口的DAL对象(这意味着不自动生成实体的层)必须是手工编码纯复制).
如何在没有大量重复和DRY损失的情况下使用松耦合?
我正在建立一个资产跟踪数据库。资产因黑莓、个人电脑、服务器、显示器、扬声器、键盘、鼠标、椅子、桌子、小隔间、立方墙、打印机、冰箱、微波炉……各种各样的东西而异。该范围将是我的类别表:
create table AssetManagement.zCategory(
zCategoryId int identity primary key,
CategoryDescription varchar(15) unique not null
)
Run Code Online (Sandbox Code Playgroud)
计算机很容易有一个类别、制造商和型号,但某些资产(椅子或其他)可能只有一个型号。有些可能只有制造商。
我相信使用良好的数据库设计来强制执行以下操作是一个很好的设计:
因此,虽然模型可能有已知的制造商,资产可能有模型或制造商,或两者都有,但它应该始终有一个类别。
到目前为止,这是我想出的,我想过使用触发器来强制执行直接外键不会
create table AssetManagement.zModel(
zModelId int identity primary key,
zModelDescription varchar(15) unique not null,
zAssetCategoryId int not null references AssetManagement.zAssetCategory(zAssetCategoryId)
)
create table AssetManagement.zManufacturer(
zManufacturerId int identity primary key,
zManufacturerDescription varchar(15) unique not null
)
create table AssetManagement.zProduct
(
zProductId int identity primary key,
zProductDescription varchar(35),
zAssetCategoryId int references AssetManagement.zAssetCategory(zAssetCategoryId),
zModelId int references …Run Code Online (Sandbox Code Playgroud) 我正在获取文件列表*.config并将它们复制到目录列表中.这些目录是相对于C:\branches\具有名称的路径,然后是name.UnitTest.
所以副本看起来像没有重构/批处理:
<Target Name="CopyClientConfigs">
<ItemGroup>
<ClientConfigDestinations Include="$(LocalSourcePath)\Module1\Module1.UnitTest\;
$(LocalSourcePath)\Module2\Module2.UnitTest\;
$(LocalSourcePath)\CommonControls\Module3\Module3.UnitTest\;
$(LocalSourcePath)\Administration\Module4\Module4.UnitTest\;
$(LocalSourcePath)\IndividualControls\Configuration\Module5\Module5.UnitTest\" />
<ClientConfigs
Include="$(ClientConfigPath)\*.config"
Exclude="$(ClientConfigPath)\P*.config" >
</ClientConfigs>
</ItemGroup>
<Copy
SourceFiles="@(ClientConfigs)"
DestinationFolder="%(ClientConfigDestinations.FullPath)"
/>
Run Code Online (Sandbox Code Playgroud)
我想要的是能够使用这个ItemGroup
<ItemGroup>
<MyModules Include="$(LocalSourcePath)\Module1;
$(LocalSourcePath)\Module2;
$(LocalSourcePath)\CommonControls\Module3;
$(LocalSourcePath)\Administration\Module4;
$(LocalSourcePath)\IndividualControls\Configuration\Module5"
/>
Run Code Online (Sandbox Code Playgroud)
所以任务就像
Copy
SourceFiles="@(ClientConfigs)"
DestinationFolder="%(ClientConfigDestinations.FullPath)\*.UnitTest\"
/>
Run Code Online (Sandbox Code Playgroud)
或更好
Copy
SourceFiles="@(ClientConfigs)"
DestinationFolder="%(ClientConfigDestinations.FullPath)\%(ClientConfigDestinations.NameOnly).UnitTest\"
/>
Run Code Online (Sandbox Code Playgroud)
如何重构或正确批量操作?
我看到你可以强制使用单个案例区分联合的构造函数,你可以用多案例做同样的事吗?
例如
type MemberId =
| MemberId of int
| MemberGuid of Guid
Run Code Online (Sandbox Code Playgroud)
我现在正在尝试fsi这样的
val create : int -> T option
val create : Guid -> T option
Run Code Online (Sandbox Code Playgroud)
但我猜是像C#,F#将不允许你根据返回类型重载以进行解包:
val value : T -> string
Run Code Online (Sandbox Code Playgroud)
编辑---------------
MemberId.fsi =
module MemberId
open System
type _T
val createId : int -> _T option
val createGuid : Guid -> _T option
val value : _T -> 'a
Run Code Online (Sandbox Code Playgroud)
MemberId.fs =
module MemberId
open System
type _T =
| …Run Code Online (Sandbox Code Playgroud) 我想明白为什么first iteration在循环执行比其他人更快.
Stopwatch sw = new Stopwatch ();
sw.Start ();
for(int i=0; i<10; i++)
{
System.Threading.Thread.Sleep ( 100 );
Console.WriteLine ( "Finished at : {0}", ((double) sw.ElapsedTicks / Stopwatch.Frequency ) * 1e3 );
}
Run Code Online (Sandbox Code Playgroud)
当我执行代码时,我得到以下内容:

最初我认为这可能是由于秒表类的准确性因素,但那为什么它只适用于第一个元素?如果我错过了什么,请纠正我.
我有自己的DateTime变量
7/11/2014
Run Code Online (Sandbox Code Playgroud)
我想将该日期转换为显示为
7th November 2014
Run Code Online (Sandbox Code Playgroud)
我使用什么格式?我试过了,ToLongDateString但它错过了日期的后缀.
特定
// r is a System.Data.IDataRecord
var blob = new byte[(r.GetBytes(0, 0, null, 0, int.MaxValue))];
r.GetBytes(0, 0, blob, 0, blob.Length);
Run Code Online (Sandbox Code Playgroud)
和r.GetBytes(...)回报Int64
由于Array.zeroCreate和Array.init采取Int32如何创建一个空的数组,它是可能大于Int32.MaxValue?
我知道有很多关于NoClassDefFoundError的帖子,他们似乎都在讨论jar文件.虽然我对日食中的java感到很自在,但我很遗憾为什么我能想到的最简单的东西不起作用,除非他们在大学方面打破了这个问题.
public class hello {
public static void main (String args[]) {
System.out.println ("Hello World!");
}
}
Run Code Online (Sandbox Code Playgroud)
这是整个hello.java程序,抛出这个:
Exception in thread "main" java.lang.NoClassDefFoundError: hello/java
Caused by: java.lang.ClassNotFoundException: hello.java
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: hello.java. Program will exit.
Run Code Online (Sandbox Code Playgroud)
$ CLASSPATH = /:在/ usr/JAVA /最新/ lib目录:/家庭/ 41 /名为myusername/bin中
java -verbose hello.class
Run Code Online (Sandbox Code Playgroud)
得到:
[Opened /usr/java/jdk1.6.0_10/jre/lib/rt.jar] [Loaded java.lang.Object from /usr/java/jdk1.6.0_10/jre/lib/rt.jar] [Loaded java.io.Serializable from /usr/java/jdk1.6.0_10/jre/lib/rt.jar] [Loaded java.lang.Comparable from /usr/java/jdk1.6.0_10/jre/lib/rt.jar] …
我是javascript的新手并试图重构一些代码,显然我在javascript中缺少一些我想学习的东西.所有5个列表框都选择了以下内容后,此代码会生成一个值:
function GetTotal() {
//_listSeverity = document.getElementById("_listSeverity");
function ParseListBoxvalue(listBox) {
return parseInt(GetListBoxValue(listBox),10);
}
_listSeverity = document.getElementById("<%= _listSeverity.ID %>");
_listAssociate = document.getElementById("<%= _listAssociateImpact.ID %>");
_listCustomerImpact = document.getElementById("<%= _listCustomerImpact.ID %>");
_listRegulatoryImpact = document.getElementById("<%= _listRegulatoryImpact.ID %>");
_listShareholderImpact = document.getElementById("<%= _listShareholderImpact.ID %>");
_calculatedTotal = (ParseListBoxvalue(_listAssociate) +
ParseListBoxvalue(_listSeverity) + ParseListBoxvalue(_listCustomerImpact)
+ParseListBoxvalue(_listRegulatoryImpact) + ParseListBoxvalue(_listShareholderImpact)
)/ 5;
if (isNaN(_calculatedTotal))
document.getElementById("_total").innerHTML = "Not enough information";
else
document.getElementById("_total").innerHTML = _calculatedTotal;
}
Run Code Online (Sandbox Code Playgroud)
然后我尝试重构为for循环以消除一些代码重复.我尝试了很多方法,if(typeof _calculatedValue !='undefined')我在谷歌上发现,看看是否可以解决它.据我了解,我没有遇到范围问题,因为唯一的实际范围是由function(){}声明限制的.这永远不会产生价值.我意识到/ 5它还没有进入它,但这对我来说似乎并不是因为它总能产生一个NaN.
function GetTotal() {
//_listSeverity = document.getElementById("_listSeverity"); …Run Code Online (Sandbox Code Playgroud) 我在RegistrationController中检查了注册:
public class RegistrationController : Controller
{
private readonly IAmARegistrationRepository _RegistrationRepository;
public RegistrationController(IAmARegistrationRepository registrationRepository)
{
_RegistrationRepository = registrationRepository;
}
public bool IsRegistered(string userName)
{
return _RegistrationRepository.IsRegistered(userName);
}
}
Run Code Online (Sandbox Code Playgroud)
如何从我的HomeController中检查这个?有没有办法访问ControllerBuilder当前打开的控制器(如果有的话)?或者至少能够使用客户控制器工厂生成一个我加载到ControllerBuilder我的Global.asax.cs?
我现在已经工作了大约14个小时.这让我疯狂.
没有引用任何自定义dll我想要走向$dte.Solution.Projects项目或项目项目来检查是否
$SourceControl = get-interface $dte.SourceControl ([EnvDTE.SourceControl])
$SourceControl.IsItemUnderScc()
Run Code Online (Sandbox Code Playgroud)
像解决方案文件夹这样的东西会妨碍你.我已经在C#中做了很好的反复(在F#中),我似乎无法在powershell中做到这一点.我已经完成了(C#)通过Dte.Solution和UIHierarchy
我的C#步行代码在T4 Nuget Package中作为示例,但我目前使用的所有linqpad示例UIHierarchy
以下是来自c#的示例,它似乎在powershell中不起作用:
C# Projects projects = dte.Solution.Projects;
电源外壳 $Projects= [EnvDTE.Projects]$dte.Solution.Projects
失败了 Cannot convert the "System.__ComObject" value of type "System.__ComObject#{e3ec0add-31b3-461f-8303-8a5e6931257a}" to type "EnvDTE.Projects".
asp.net-mvc ×2
c# ×2
f# ×2
loops ×2
.net-3.5 ×1
ankhsvn ×1
arrays ×1
asp.net ×1
bash ×1
c#-to-f# ×1
datetime ×1
dry ×1
envdte ×1
iteration ×1
java ×1
java-6 ×1
javascript ×1
linq ×1
msbuild ×1
powershell ×1
refactoring ×1
schema ×1
sql ×1
svn ×1
tortoisesvn ×1