我在存储库中有一个具有非常复杂的业务逻辑的方法.我刚刚读到存储库中应该没有业务逻辑.
从这种方法中删除业务逻辑将要求我在两个其他存储库之间分配逻辑(因为它涉及另外两个实体).
然后我的问题是 - 我应该用什么模式来实现这个复杂的逻辑?它需要使用这三个存储库,但我不能将它放在控制器中,因为我需要重用它.谢谢您的帮助.
我在NSView子类中有以下代码:
- (id)forwardingTargetForSelector:(SEL)aSelector
{
if ([super respondsToSelector:@selector(forwardingTargetForSelector:)]) {
// cast to (id) to avoid "may not respond to selector" warning
return [(id)super forwardingTargetForSelector:aSelector];
} else {
[self doesNotRecognizeSelector:aSelector];
return nil;
}
}
Run Code Online (Sandbox Code Playgroud)
在第一行中,return [(id)super ...转换super为id因为在GCC编译器下,这抑制了超类(NSView)可能不响应的警告,如此答案中forwardingTargetForSelector:所建议的那样.
但是,当我切换到LLVM编译器时,这会导致"无法强制转换"错误.是否有正确的方法来修改我的代码,以便在LLVM和GCC下既没有警告也没有错误?
我有一些ul和li的问题...
我想创建一个3 li的无序列表,每个li都有一个不同的列表样式图像...
我写了这个代码,但图像不是'出现......
你能帮助我吗?谢谢!
编辑:发布更新HTML代码;)
<div id="right_main">
<ul id="mainFeatures">
<li id="wishlist">Some text here...</li>
<li id="sharing">Some text here...</li>
<li id="linking">Some text here...</li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
#right_main ul#mainFeatures {
height:250px;
width:350px;
overflow:hidden;
margin-left:25px;
}
#mainFeatures li {
font-weight:bold;
font-size:22px;
font-family:"Myriad Pro", sans-serif;
padding:5px;
}
#mainFeatures li#wishlist {
list-style-image:url(images/wishListImage.png);
list-style-position:outside;
}
#mainFeatures li#sharing {
list-style-image:url(images/sharingListImage.png);
list-style-position:outside;
}
#mainFeatures li#linking {
list-style-image:url(images/linkingListImage.png);
list-style-position:outside;
}Run Code Online (Sandbox Code Playgroud) 示例我有100个表单字段.每个字段都有错误会话.当表单成功提交时,我想要取消设置任何单词开头的会话$_SESSION['submit_']
首先,我可以这样做
unset($_SESSION['submit_first_name'],
$_SESSION['submit_last_name'],
$_SESSION['submit_status'],
$_SESSION['submit_mobile'],
$_SESSION['submit_category']);
Run Code Online (Sandbox Code Playgroud)
但是太久了.
如果我喜欢
session_destroy();
Run Code Online (Sandbox Code Playgroud)
然后会杀死我的登录会话
可以取消设置会话单词开头[submit_']?
让我知道 :)
当扩展与doLayout你只能有一个子模板,但可以include不止一个.
有什么区别,最佳做法是什么?
我怎样才能以编程方式解决这个谜题?有人可以用一些伪代码帮我吗?
九点9分
结合9个9与任意数量的经营者+, - ,*,/,(,),有什么是不能表示最小的正整数?
提示:
答案不是零.你可以像这样表达零:(9 - 9)*(9 + 9 + 9 + 9 + 9 + 9 + 9).此外,零不是正整数.
答案不是一个.你可以这样表达:9 - (9*9 - 9)/ 9 + 9 - 9 + 9 - 9
这不是一个技巧问题.
务必正确处理括号.
笔记:
这实际上是一个着名的谜题,可能有很多解决方案在互联网上徘徊.我不确定他们中的任何一个是否正确.有没有人有一个解释良好的解决方案?
我有这篇文章教我关于pdb文件和StackTrace.
这是代码.
using System;
// https://stackoverflow.com/questions/4474259/c-exception-handling-with-a-string-given-to-a-constructor
class WeekdayException : Exception {
public WeekdayException(String wday) : base("Illegal weekday: " + wday) {}
}
class TryCatchFinally
{
public static void Main()
{
try
{
throw new WeekdayException("thrown by try");
}
catch(WeekdayException weekdayException) {
Console.WriteLine(weekdayException.Message);
Console.WriteLine(weekdayException.StackTrace);
}
}
}
Run Code Online (Sandbox Code Playgroud)
单声道,我跑
dmcs /debug error.cs
mono error.exe
Run Code Online (Sandbox Code Playgroud)
当我删除/ debug选项时,我得到的信息是一样的.
Illegal weekday: thrown by try
at TryCatchFinally.Main () [0x00000] in <filename unknown>:0
Run Code Online (Sandbox Code Playgroud)
使用Visual Studio 2010,我运行
csc /debug error.cs
error
Run Code Online (Sandbox Code Playgroud)
按预期获取包含行号的此消息.
Illegal weekday: thrown by …Run Code Online (Sandbox Code Playgroud) 是否有任何示例演示使用Java和Jersey执行客户端< - >服务器通信?比如相互发送XML数据?
我正在寻找一些帮助来开发我认为应该是一个简单的程序.
我想要类似于Emacs tags-search命令的东西,但我想将所有搜索结果收集到缓冲区中.(我希望看到M-的所有结果,)
我认为这个python样式伪代码应该可以工作,但我不知道如何在emacs lisp中执行此操作?任何帮助将不胜感激.
def myTagsGrep(searchValue):
for aFile in the tag list:
result = grep aFile seachValue
if len(result) > 0:
print aFile # to the buffer
print result # to the buffer
Run Code Online (Sandbox Code Playgroud)
我希望能够浏览具有相同功能标签的缓冲区 - apropos.
请注意,之前已经提出过类似的问题: 有没有办法让emacs tag-search命令将所有结果输出到缓冲区?
我写了一些控制台"Hello world"的应用程序.并且已经跟着c#cywgwin mono mkbundle windows 7 - 无法编译文件的答案.但我得到了:
$ mkbundle -o Fur Furries.exe --deps -z
OS is: Windows
Sources: 1 Auto-dependencies: True
embedding: C:\Monotest\Furries.exe
compression ratio: 40.43%
embedding: C:\Soft\Mono\lib\mono\4.0\mscorlib.dll
compression ratio: 34.68%
Compiling:
as -o temp.o temp.s
gcc -mno-cygwin -g -o Fur -Wall temp.c `pkg-config --cflags --libs mono-2|dos2un
ix` -lz temp.o
temp.c: In function `main':
temp.c:173: warning: implicit declaration of function `g_utf16_to_utf8'
temp.c:173: warning: assignment makes pointer from integer without a cast
temp.c:188: warning: assignment makes pointer from …Run Code Online (Sandbox Code Playgroud)