我正在使用 EF --> Repositories/UnitOfWork --> Services --> MVC 3 分层方法,我只是想知道使用单独的程序集或组合程序集中的某些逻辑层的优点/缺点是什么。
基本上我要问的是,如果您对合同(接口)而不是实现进行编程,您可以在单个程序集中完成它,对吗?
我正在使用两种商业字体 FrenchScriptStd和FuturaStd-Light (我已经单独购买它们然后用它们来创建一个网页)
这是我使用这种商业字体的第一页(我试过googlefonts但是他们没有这些字体)...
@font-face {
font-family: 'FrenchScriptStd';
font-style: normal;
font-weight: 400;
src: local('FrenchScriptStd'), url('css/FrenchScriptStd.ttf') format('ttf');
}
@font-face {
font-family: 'FuturaStd-Light';
font-style: normal;
font-weight: 400;
src: local('FuturaStd-Light'), url('css/FuturaStd-Light.ttf') format('ttf');
}
#fontface1{font-family : Font1; }
h1{font-family : Font1; }
#fontface2{font-family : Font2; }
#nav a {font-family : Font2;}
Run Code Online (Sandbox Code Playgroud)
所以当使用#nav a时,我想在使用h1和futura字体时显示法语字体
/* Typography
=============================================================== */
h1 { color:#cc6602; font-size:36px; font-family:FrenchScriptStd, arial, serif; font-weight:normal; padding-bottom:14px; }
#nav a {font-family:FuturaStd-Light, arial, serif; text-decoration:none; color:#a8241b; font-size:20px; text-shadow:0 1px #fff; …Run Code Online (Sandbox Code Playgroud) 我有一个第三方.dll文件及其源代码(用C#编写).我可以创建一个新项目并添加此.dll文件的引用以使用其方法.但是当我调试时,我想介入.dll文件中定义的方法(就像我们在java中有.jar文件及其源代码时那样).
我如何在Visual Studio Express中执行此操作(我有VS 2012).
有一个窗口,我想在其中放置一个按钮,然后在其下面绘制整个区域.换句话说,按钮应该覆盖一块画.
import java.awt.*;
import javax.swing.*;
class Window
{
private JFrame frame;
private JButton launchButton;
private JPanel pnllaunchButton;
private JPanel paintingPanel;
//width and height of client area
private Rectangle dim;
//w,h - width and height of the whole window
public Window(String title,int w,int h)
{
frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLocation(0,0);
frame.setMinimumSize( new Dimension(110,110));
frame.setSize(w, h);
frame.setVisible(true);
frame.setTitle(title);
frame.setResizable(false);
addLaunchButton();
}
private void addLaunchButton()
{
pnllaunchButton = new JPanel();
launchButton = new JButton("Plot!");
dim = new Rectangle();
frame.getContentPane().getBounds(dim);
pnllaunchButton.setBounds(dim.width-100,dim.height-25,100,25);
launchButton.setBounds(dim.width-100,dim.height-25,100,25);
pnllaunchButton.setLayout(null); …Run Code Online (Sandbox Code Playgroud) 这是我现在的版权:
<i>Example.com</i> © 2013 - <?php echo date('Y'); ?>
明年这没关系,因为它会读到:
Example.com ©2013 - 2014
但今年它说: © 2013-2013
如何制作© 2013并自动切换到© 2013-2014明年,而不必回来并手动更换?
我正在构建一个可视化编程工具,并且想知道你是否可以建议一个库,或者甚至向我提出一些关于我可以自己构建的工具的想法,它将伪代码转换为PHP,JAVA等具体语言.例如,像这样的伪代码:
do i = 1 to 100
print "Hello World !!!";
newline;
end do
Run Code Online (Sandbox Code Playgroud)
我想得到类似的东西:
在PHP中:
for ($i = 1; $x <= 100; $x++) {
echo "Hello World !!!";
echo PHP_EOL;
}
Run Code Online (Sandbox Code Playgroud)
在Java中:
for(int i = 1; x <= 100; x++) {
System.out.print("Hello World !!!");
System.out.print("\n");
}
Run Code Online (Sandbox Code Playgroud)
我不只是想要一个从PHP到Java的翻译,反之亦然.我想我的问题是:在指定一些基本的语言结构规则和编写伪代码之后,我是否能够生成各种语言的代码?我想用一种具体的语言打破伪代码和代码之间的差距所以我不需要手动翻译代码.此外,通过在伪代码中编写算法一次,我将以我想要的任何语言生成代码.
感谢您的反馈意见!
编辑:确定,那么不是"伪"代码,定义一种将作为中间体的语言.有没有人有一个我可以研究的建议库?
我们在MVC 4应用程序中使用EF6,因此我们为Business Objects创建了一个抽象类
所以,我们有一个通用的抽象类如下:
public abstract class Repository<TEntity, TIdentifier> : IRepository<TEntity, TIdentifier> where TEntity : class { ... }
Run Code Online (Sandbox Code Playgroud)
在我们的应用程序中,BusinessLayer我们有几个类(每个实体一个类)实现上面的类.
例如:如下
//Authorization is an entity here
public class AuthorizationBusinessObject : MD.EntityFramework.Repository.Repository<Authorization, int>
{
...
}
Run Code Online (Sandbox Code Playgroud)
我们需要BaseBusinessObject上面的课程.
现在,我的问题在这里; 我们如何为BaseBusinessObject上课提供课程?
编辑:
嗯,Repository<>是基类BusinessObjects,不是吗?
实际上,我们需要一个非通用的基类来BusinessObjects
为什么?
我们在MVC 4应用程序中使用Web API服务.在每个web api控制器中,我们必须具有与以下相同的操作,只是BusinessObject不同.因此,如果我们可以拥有基本业务对象,我们可以在基本web api控制器中实现以下操作.
// Setting is an Entity
private readonly SettingBusinessObject _settingBusinessObject;
public SettingController()
{
_settingBusinessObject = new SettingBusinessObject(Entities);
}
public Setting Get(int …Run Code Online (Sandbox Code Playgroud) 我刚刚开始学习Java,我从C++和VB中注意到的一个差异是Java没有goto语句,我在编程时往往会使用很多.
有什么方法可以使用另一个语句在行之间跳转吗?我试图使用break并继续但无济于事(我可能做错了什么).
这是带有goto语句的代码以及我希望它如何操作:
public class HelloWorld {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args)
{
jump1:
System.out.print("What do you want to calculate? ");
String method = sc.nextLine();
if (method.equals("tax")) tax();
else {
System.out.print("Please input a valid method. \n\n");
goto jump1;
}
}
Run Code Online (Sandbox Code Playgroud)
什么是goto命令的良好替代品?
class Box
{
// Instance Variables
double length ,ipsos ;
double width ,mikos ;
double height ,platos;
// Constructors
public Box ( double side )
{
width = side ;
height = side ;
length = side ;
}
public Box ( double x , double y , double z)
{
platos = y ;
ipsos = z;
mikos = x ;
}
// Methods
double calculate(double praksi)
{
return 2 * ( width * height +
width * length …Run Code Online (Sandbox Code Playgroud) 我正在一个网站上工作,该网站具有高分辨率的背景图像.使用以下CSS设置背景图像
#intro {
background: url(https://s3.amazonaws.com/ooomf-com-files/XIBPemROQ9iJdUMOOBmG_IMG_1863.jpg) no-repeat 50% 50% fixed;
-moz-background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-repeat: no-repeat;
}
Run Code Online (Sandbox Code Playgroud)
在我的桌面上查看它工作正常.

在Firefox的响应式视图中查看时,它按预期工作.

但是,当我在装有iOS 7的iPhone 5上查看时,它会产生这个效果.

设置时出现问题
background-size: cover;
但我似乎无法弄明白.我已经在互联网上搜索过了.
站点本身,在开发环境中:
http://websites.terarion.com/ehlen/
我得到背景的地方:
java ×4
c# ×2
css ×2
php ×2
architecture ×1
asp.net-mvc ×1
c++ ×1
debugging ×1
dll ×1
dynamic ×1
fonts ×1
footer ×1
generics ×1
goto ×1
if-statement ×1
ios ×1
iphone ×1
pseudocode ×1
swing ×1