我正在尝试使用Visual Studio 2010 Express版本来设置使用SqlExpress + Entity Framework作为数据访问的ASP.NET MVC 2 Web应用程序.我安装了"C#Edition"和"Web Developer Edition".
如果我尝试使用"C#edition"添加数据源,我将缺少"Microsoft SQL Server"数据源类型.
Visual Studio 2010 Express截图http://dl.dropbox.com/u/4163528/images/StackOverflow/2010Express.png
但Visual Studio 2008 Professional拥有它.
正如另一个StackOverflow问题所指出的那样,"Web Developer Edition"就是这样.但是,Web Developer Edition不支持实体框架项: EntityFramework http://dl.dropbox.com/u/4163528/images/StackOverflow/2010EF.png.
我只想坚持使用Express Editions.微软忘记了我的用例吗?我在这里可以使用SqlExpress + MVC 2 + Entity Framework吗?
谢谢!
-麦克风
有没有办法创建转储/导出/保存临时MySQL表到磁盘上的文件(.sql文件,类似于mysqldump创建的文件)?
我正在用vim编写一个LaTeX文档,并且我用80个字符进行硬包装以使阅读更容易.但是,这会导致跟踪版本控制中的更改时出现问题.例如,在本文开头插入"Lorem ipsum":
1 Dolor sit amet, consectetur adipiscing elit. Phasellus bibendum lobortis lectus 2 quis porta. Aenean vestibulum magna vel purus laoreet at molestie massa 3 suscipit. Vestibulum vestibulum, mauris nec convallis ultrices, tellus sapien 4 ullamcorper elit, dignissim consectetur justo tellus et nunc.
结果是:
1 Lorum ipsum dolor sit amet, consectetur adipiscing elit. Phasellus bibendum 2 lobortis lectus quis porta. Aenean vestibulum magna vel purus laoreet at 3 molestie massa suscipit. Vestibulum vestibulum, mauris nec convallis ultrices, 4 tellus …
我有这个XML代码生成一个按钮,一个textview和另一个按钮,如何让按钮出现在最左边,中心的textview和最右边的最后一个按钮?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<Button android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel">
</Button>
<TextView android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Place">
</TextView>
<Button android:id="@+id/Button03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Save">
</Button>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud) 当调用控制器中的操作时,我可以从该操作调用另一个操作吗?
如果两个动作都有一些模板要呈现会发生什么?
我有一些代码需要花费几分钟来处理,它必须连接到web中的长数组中的每个字符串,每个字符串都是一个url.我希望这样做,以便每次连接时,都应该刷新jtextarea,这样用户就不会盯着看起来冻结20分钟的空白页面.或者需要多长时间.这是我尝试过的东西的一个例子:
try {
ArrayList<String> myLinks = LinkParser.getmyLinksArray(jTextArea1.getText());
for (String s : myLinks) {
jTextArea2.append(LinkChecker.checkFileStatus(s) + "\n");
}
} catch (IOException ex) {
JOptionPane.showMessageDialog(jTextArea1, "Parsing Error", "Parsing Error", JOptionPane.ERROR_MESSAGE);
Logger.getLogger(MYView.class.getName()).log(Level.SEVERE, null, ex);
}
Run Code Online (Sandbox Code Playgroud) 说我有一个n个元素的列表,我知道有n个!订购这些元素的可能方式.生成此列表的所有可能排序的算法是什么?例如,我有列表[a,b,c].该算法将返回[[a,b,c],[a,c,b,],[b,a,c],[b,c,a],[c,a,b],[c,b , 一个]].
我在这里阅读 http://en.wikipedia.org/wiki/Permutation#Algorithms_to_generate_permutations
但维基百科从未擅长解释.我不太了解它.
如何使用Ninject处理带静态方法的类?
也就是说,在C#中,一个接口中不能有静态方法,而Ninject在使用接口的基础上工作?
我的用例是一个类,我希望它有一个静态方法来创建一个未填充的自身实例.
编辑1
只是在TopologyImp类中添加一个示例,在GetRootNodes()方法中,如何创建一些要返回的iNode类?我会用正常的代码练习构建这些或者我会以某种方式使用Ninject吗?但是,如果我使用容器创建那么我没有给IOC这个库知识呢?
public interface ITopology
{
List<INode> GetRootNodes();
}
public class TopologyImp : ITopology
{
public List<INode> GetRootNodes()
{
List<INode> result = new List<INode>();
// Need code here to create some instances, but how to without knowledge of the container?
// e.g. want to create a few INode instances and add them to the list and then return the list
}
}
public interface INode
{
// Parameters
long Id { get; set; }
string Name { …Run Code Online (Sandbox Code Playgroud) 我正在创建一个Ruby on Rails应用程序,我正在尝试创建/ login/logout用户.
这是以下架构Users:
create_table "users", :force => true do |t|
t.string "first_name"
t.string "last_name"
t.text "reputation"
t.integer "questions_asked"
t.integer "answers_given"
t.string "request"
t.datetime "created_at"
t.datetime "updated_at"
t.string "email_hash"
t.string "username"
t.string "hashed_password"
t.string "salt"
end
Run Code Online (Sandbox Code Playgroud)
用户的个人信息(用户名,名字/姓氏,电子邮件)通过POST填充.其他的东西,如questions_asked,reputation等都是由应用程序设置,所以当我们创建新的用户应该初始化.现在,我只是在create方法中手动设置每个UsersController:
def create
@user = User.new(params[:user])
@user.reputation = 0
@user.questions_asked = 0
@user.answers_given = 0
@user.request = nil
...
end
Run Code Online (Sandbox Code Playgroud)
这样做有更优雅/更有效的方法吗?
每次我向 Django 项目添加一些字符串时,我都会运行“django-admin.py makemessages -all”来为所有语言环境生成 .PO 文件。
问题是即使我只添加了 5 个新闻字符串,makemessages 命令也会将 .PO 文件中的 50 个字符串标记为模糊,这为我们的语言环境维护人员带来了很多额外的工作。
这也使得整个 i18n 在他们手动修改那些模糊字符串之前无法使用。