我最近开始在工作中将一些项目导入Subversion存储库,在接下来的几周内,我期望团队中的每个人都对自己的源代码管理负责.
我选择SVN而不是GIT的原因是我希望团队中的每个人,包括设计师,前端人员,集成商......负责他们自己的SCM,所以我希望如果他们使用GUI管理他们的工作,事情会更快地发生(用于Mac的Cornerstone和用于Windows的Tortoise SVN).我知道有一些GIT GUI,SmartGit在一分钟看起来最吸引人,但似乎没有像他们的SVN同行那样有能力.此外,我觉得通过不使用命令行来处理DVCS,我们会在翻译中丢失一些东西(而我使用GUI来管理SVN中的项目非常高兴).
问题是分布式解决方案正在快速超越集中式解决方案,所以我想知道现在是否真的值得花费额外的投资,而不是必须在6个月后将所有内容迁移到DVCS中并投入时间?另一种看待它的方式是SVN在此期间将是一个相对无痛的步骤,如果我们以后决定迁移到DVCS,这将为我们做更充分的准备.
感谢您的想法和经验.
*旁白:由于多种原因,我更喜欢每个SVN存储库的多个项目.然而,这意味着Atlassian的Fisheye的统计数据不那么有意义,而且更加混乱.如果我们决定使用GIT,那么每个项目将有1个存储库.
我正在尝试设置hadoop和nutch来运行EC2.首先,我遵循了优秀的NutchHadoopTutorial.除了我无法访问任何Web界面(例如JobTracker)之外,大多数一切都按预期工作.JobTracker启动没有错误,我可以点击nutch-master:50030,但是我得到看起来像jetty的默认servlet,它返回到webapps目录的链接,然后从那里返回一个作业目录,然后链接到nutch-master:50030/webapps/job/jobtracker.jsp- 然后返回404 RequestURI=/webapps/job/jobtracker.jsp.我已经检查了类路径,并且应该存在的所有内容实际上都可用:
/usr/lib/jvm/java-6-openjdk/bin/java -Xmx1000m -Dhadoop.log.dir=/nutch/search/logs -Dhadoop.log.file=hadoop-nutch-jobtracker-nutch-master.log -Dhadoop.home.dir=/nutch/search -Dhadoop.id.str=nutch -Dhadoop.root.logger=INFO,DRFA -Djava.library.path=/nutch/search/lib/native/Linux-i386-32 -Dhadoop.policy.file=hadoop-policy.xml -classpath /nutch/search/bin/../conf:/usr/lib/jvm/java-6-openjdk/lib/tools.jar:/nutch/search/hadoop-0.20.2-core.jar:/nutch/search/lib/apache-solr-core-1.4.0.jar:/nutch/search/lib/apache-solr-solrj-1.4.0.jar:/nutch/search/lib/commons-beanutils-1.8.0.jar:/nutch/search/lib/commons-cli-1.2.jar:/nutch/search/lib/commons-codec-1.3.jar:/nutch/search/lib/commons-collections-3.2.1.jar:/nutch/search/lib/commons-el-1.0.jar:/nutch/search/lib/commons-httpclient-3.1.jar:/nutch/search/lib/commons-io-1.4.jar:/nutch/search/lib/commons-lang-2.1.jar:/nutch/search/lib/commons-logging-1.0.4.jar:/nutch/search/lib/commons-logging-api-1.0.4.jar:/nutch/search/lib/commons-net-1.4.1.jar:/nutch/search/lib/core-3.1.1.jar:/nutch/search/lib/geronimo-stax-api_1.0_spec-1.0.1.jar:/nutch/search/lib/hadoop-0.20.2-core.jar:/nutch/search/lib/hadoop-0.20.2-tools.jar:/nutch/search/lib/hsqldb-1.8.0.10.jar:/nutch/search/lib/icu4j-4_0_1.jar:/nutch/search/lib/jakarta-oro-2.0.8.jar:/nutch/search/lib/jasper-compiler-5.5.12.jar:/nutch/search/lib/jasper-runtime-5.5.12.jar:/nutch/search/lib/jcl-over-slf4j-1.5.5.jar:/nutch/search/lib/jets3t-0.6.1.jar:/nutch/search/lib/jetty-6.1.14.jar:/nutch/search/lib/jetty-util-6.1.14.jar:/nutch/search/lib/junit-3.8.1.jar:/nutch/search/lib/kfs-0.2.2.jar:/nutch/search/lib/log4j-1.2.15.jar:/nutch/search/lib/lucene-core-3.0.1.jar:/nutch/search/lib/lucene-misc-3.0.1.jar:/nutch/search/lib/oro-2.0.8.jar:/nutch/search/lib/resolver.jar:/nutch/search/lib/serializer.jar:/nutch/search/lib/servlet-api-2.5-6.1.14.jar:/nutch/search/lib/slf4j-api-1.5.5.jar:/nutch/search/lib/slf4j-log4j12-1.4.3.jar:/nutch/search/lib/taglibs-i18n.jar:/nutch/search/lib/tika-core-0.7.jar:/nutch/search/lib/wstx-asl-3.2.7.jar:/nutch/search/lib/xercesImpl.jar:/nutch/search/lib/xml-apis.jar:/nutch/search/lib/xmlenc-0.52.jar:/nutch/search/lib/jsp-2.1/jsp-2.1.jar:/nutch/search/lib/jsp-2.1/jsp-api-2.1.jar org.apache.hadoop.mapred.JobTracker
Run Code Online (Sandbox Code Playgroud)
我现在一直在谷歌搜索和尝试不同的东西大约8个小时,我只是完全被困在可能出错的地方.我敢肯定,我忽视了一些令人痛苦的事情.有谁有想法吗?
更多细节:这是EC2上的三节点集群,我可以在每个节点之间输出密码,节点似乎正在通过w/out问题进行通信(即日志中没有例外).它们都是ubuntu 10.04服务器.Hadoop 0.20.2.
提前致谢.
我需要用户能够成为其他用户的粉丝.我该如何设计/设置?
我需要能够查看用户粉丝的详细信息.
例如.我有用户:Foo.Foo有3位粉丝.我希望能够找到Foo粉丝的名字.因此:
foo = User.first
foo.name (returns 'Foo')
foo.fans.first.user.name (should return 'bar', since 'bar' is a fan of 'foo')
Run Code Online (Sandbox Code Playgroud)
这就是我现在设置的方式:
User model:
embeds_many :fans
references_many :fans
Fan model:
embedded_in :user, :inverse_of => :fans
referenced_in :user
In console, I do:
User.first.fans.create!(:user => User.first)
Run Code Online (Sandbox Code Playgroud)
我得到: Mongoid :: Errors :: InvalidCollection:不允许访问Fan的集合,因为它是一个嵌入式文档,请从根文档访问一个集合.我认为问题是,因为风扇模型嵌入在用户模型中,该模型也可以自我引用用户模型....
你的想法将不胜感激.
我有一个AutoScroll设置为的面板true.在其中,我以编程方式添加ComboBox控件.如果我添加足够的控件以超过面板的可视大小,则会出现一个滚动条(到目前为止一直很好).但是,如果我打开可视区域底部附近的一个组合框,则组合列表未正确显示,并且可滚动区域似乎已展开.这导致所有控件被"拉"到面板的新底部,顶部有一些新的空白区域.如果我继续点击面板底部的下拉菜单,可滚动区域将继续无限扩展.我将控件固定在左侧,右侧和顶部,因此我认为不会涉及锚定.是否有明显可能导致这种情况的事情?
更新:看起来问题在于将控件固定到右侧.如果我没有向右锚,那么我就不会有这种奇怪的行为.但是,如果没有右侧锚定,控制将被滚动条切断.
这是我构建的简化测试用例,显示了该问题:
public Form1()
{
InitializeComponent();
Panel panel = new Panel();
panel.Size = new Size(80, 200);
panel.AutoScroll = true;
for (int i = 0; i < 10; ++i)
{
ComboBox cb = new ComboBox();
cb.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
cb.Items.Add("Option 1");
cb.Items.Add("Option 2");
cb.Items.Add("Option 3");
cb.Items.Add("Option 4");
cb.Location = new Point(0, i * 24);
panel.Controls.Add(cb);
}
Controls.Add(panel);
}
Run Code Online (Sandbox Code Playgroud)
如果您滚动面板底部并点击底部附近的组合框,您会发现奇怪的行为.
为什么以下代码会产生错误?
不支持查询运算符"ElementAtOrDefault"
Dim Im = (From view In Db.Views Where _
view.Pass = txtCode.Text _
Select New With {.Id = view.UniqueID.ToString}_
).Distinct
Response.Redirect("~/test.aspx?x=" & Im(0).Id)
Run Code Online (Sandbox Code Playgroud)
有没有办法在不使用FirstOrDefault选项的情况下修复它?
更新:这是StackTrace
at System.Data.Linq.SqlClient.QueryConverter.VisitSequenceOperatorCall(MethodCallExpression mc)
at System.Data.Linq.SqlClient.QueryConverter.VisitMethodCall(MethodCallExpression mc)
at System.Data.Linq.SqlClient.QueryConverter.VisitInner(Expression node)
at System.Data.Linq.SqlClient.QueryConverter.ConvertOuter(Expression node)
at System.Data.Linq.SqlClient.SqlProvider.BuildQuery(Expression query, SqlNodeAnnotations annotations)
at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
at System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute[S](Expression expression)
at System.Linq.Queryable.ElementAtOrDefault[TSource](IQueryable`1 source, Int32 index)
at Login.btnLogin_Click(Object sender, EventArgs e) in D:\Projects\Memoria\Login.aspx.vb:line 14
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection …Run Code Online (Sandbox Code Playgroud) 我有一个多站点Sitecore项目.我知道如何通过webconfig的ErrorPage,ItemNotFoundUrl,LayoutNotFoundUrl,LinkItemNotFoundUrl为一个站点处理错误页面.
但是,我想为每个站点显示不同的错误页面.我怎么能做到这一点?
我是否必须在java中制定我的所有字符串,如"一些静态字"+变量+"一些更静态的字".或者有没有办法像ruby允许你评估字符串中的一个部分那样:"一些带有#{dynamic_value}的静态单词插入到语句中."
我没有找到太多的谷歌搜索方式,这将真正加快格式化字符串,使它们更加可见.
我的Windows服务中有一个方法如下:
System.IO.File.Copy(path, ConfigurationManager.AppSettings["BulkInsertGiftRegisterCreatorDirectory"] + System.IO.Path.GetFileName(path));
Loyalty.Entity.Base.FileInfo file = new Loyalty.Entity.Base.FileInfo();
file.FileName = path;
request.Object = file;
ResponseBase response = new ResponseBase(request);
RequestConnection connection = new RequestConnection("cn");
FileManager fileManager = new FileManager(request, connection);
response = fileManager.OfflineGiftRegisterBulkInsert();
System.IO.File.Delete(ConfigurationManager.AppSettings["BulkInsertGiftRegisterCreatorDirectory"] + System.IO.Path.GetFileName(path));
// here is the part of stored procedure that uses file
SELECT @SCRIPT= 'BULK INSERT GIFT_CARD.GIFT_TEMP'
+' FROM '''
+ @FILE_PATH
+''' WITH ('
+'FIELDTERMINATOR = '','','
+ 'KEEPNULLS'
+');'
Run Code Online (Sandbox Code Playgroud)
我可以手动从文件系统中删除该文件,但是这段代码告诉我"Ooops!System.IO.IOException:进程无法访问文件'filename',因为它正由另一个进程使用."
我在stackoverflow和其他地方搜索了类似的问题.但我找不到任何可以帮助我的东西.复制或删除方法返回void,我的代码中没有要处理的流.
我该如何解决?
提前致谢.
我有以下Rails模型:
class CreateFoo < ActiveRecord::Migration
def self.up
create_table :foo do |t|
t.string :a
t.string :b
t.string :c
t.timestamps
end
end
def self.down
drop_table :foo
end
end
Run Code Online (Sandbox Code Playgroud)
如果我尝试使用其他不存在的属性创建新记录,则会产生错误:
Foo.create(a: 'some', b: 'string', c: 'foo', d: 'bar')
ActiveRecord::UnknownAttributeError: unknown attribute: d
Run Code Online (Sandbox Code Playgroud)
有没有办法让create()忽略模型中不存在的属性?或者,在创建新记录之前删除不存在的属性的最佳方法是什么?
非常感谢