我正在寻找关于制作动态对话框的好解释 - 在bash中使用菜单框.我正在尝试从具有以下结构的文件中加载用户列表:
------ user ------
/rw412 0.2 /rx511 23.1 /sgo23 9.2
/fs352 1.4 /...
------ another_user ------
/rw412 0.3 / and so on...
Run Code Online (Sandbox Code Playgroud)
当然用户名之间------
我真的不知道如何在对话框中使用循环.我也试图避免创建其他文件.
请帮忙
我用图形和更多细节更新了问题.感谢marapet,没有黑客,我无法生成所需的图像结果.
为什么这段代码产生了这个图?
digraph {
rankdir = TB;
1 -> 2 -> 3 -> 1;
}
Run Code Online (Sandbox Code Playgroud)

如何让graphviz/dot产生这样的顺时针方向?

更新
这是我想要生成的最终图表(afaik逻辑上正确的这种方式)
digraph {
rankdir = TB
start -> 1
1 -> 2 -> 3 -> 1
3 -> end
3 -> increment
end -> product
{rank = same; 2; 3; increment}
{rank = same; end; product}
}
Run Code Online (Sandbox Code Playgroud)
这产生了这个结果

虽然我想要这个

谢谢
我有一个名为"file1"的文本文件,其中包含以下数据:
apple
appLe
app^e
app\^e
Run Code Online (Sandbox Code Playgroud)
现在给出的命令是:
1.)grep app[\^lL]e file1
2.)grep "app[\^lL]e" file1
3.)grep "app[l\^L]e" file1
4.)grep app[l\^L]e file1
output in 1st case : app^e
output in 2nd case :
apple
appLe
app^e
output in 3rd case :
apple
appLe
app^e
output in 4th case :
apple
appLe
app^e
Run Code Online (Sandbox Code Playgroud)
为什么这样..?
请帮忙..!
我正在尝试在.NET MVC网站中实现自定义主体和自定义标识.我创建了一个自定义主体类,它继承自IPrincipal和继承自IIdentity的自定义标识.
当用户登录时,我将Thread.CurrentPrincipal和HttpContext.Current.User都设置为我的自定义主体.当我通过调试器查看时,使用所有属性设置值.
但是,一旦请求完成,我尝试并请求任何其他页面,Thread.CurrentPrincipal和HttpContext.Current.User的类型为System.Security.Principal.GenericPrincipal,而不是我的自定义主体.
我是否需要做任何"额外"操作才能将我的自定义主体从线程或HttpContext中取出?
谢谢
我喜欢在为C#和F#开发代码时使用LINQpad和FSI.对于haskell,我使用过拥抱.当然,脚本语言几乎总是带有REPL.几乎每个现代浏览器都带有相当花哨的javascript repl/ide.
C++ 0x有类似的东西吗?
整洁的功能将是:
我主要使用Windows,但是如果Linux上有一个很棒的工具,在每个新的发行版上都不需要1337个小时的配置(即不是大多数emacs配置),我也有兴趣听到这些.
相关: C++解释器/控制台/代码片段编译器(两年前,专注于Linux)
编辑:一个不完全不相关的注释是我想用它来感受C++ 0x和其他东西 - 尽可能多的C++ 0x支持 - 至少对于auto和lambdas - 会很好.我不是在寻找一个快速开发环境的声明式语句.
我收到以下错误:
ClassName.PropertyName无法实现IClassType.PropertyName,因为它没有匹配的返回类型IBasePropertyType
现在,代码:
public class ClassName : IClassType
{
public IChildPropertyType PropertyName { get; set; }
}
public interface IClassType
{
public IBasePropertyType PropertyName { get; set; }
}
public interface IBasePropertyType
{
// some methods
}
public interface IChildPropertyType : IBasePropertyType
{
// some methods
}
Run Code Online (Sandbox Code Playgroud)
有没有办法做我正在尝试的事情?我知道问题在于共同/逆转,但我似乎无法弄清楚如何做到这一点.
请考虑以下情形.
文档 - >部分 - >正文 - >项目
文档有部分,一个部分包含一个正文.正文包含一些文本和项目列表.这些项目就是问题所在.有时这些项是字符串的基本列表,但有时这些项包含自定义数据类型的列表.
所以:
public class Document
{
public Section[] Sections{get;set;}
}
public class Section
{
public SectionType Type{get;set;}
public Body {get;set;}
}
public class Body
{
//I want the items to be depending on the section type.
//If e.g. the sectiontype is experience, I want the Items to be created with type //Experience. If sectiontype is default I want the Items to be created with type string
public Items<T> Items {get;set;}
}
public …Run Code Online (Sandbox Code Playgroud) 我最近写了以下Scala:
val f: File = ... // pretend this file came from somewhere
val foo = toFoo(io.Source.fromFile(f).mkString)
Run Code Online (Sandbox Code Playgroud)
我真的不喜欢这种流动的方式.要了解发生了什么,你必须从f中间开始,向左fromFile阅读,向右mkString阅读,再向左阅读toFoo.啊.
特别是在习惯了序列的功能转换之后,这很难理解.我的下一次尝试看起来像这样:
val foo = Some(f)
.map(io.Source.fromFile)
.map(_.mkString)
.map(toFoo)
.get
Run Code Online (Sandbox Code Playgroud)
我喜欢这个更好的流程.你可以看到会发生什么这是一个很好的使用Option课程?还是我在滥用它?有没有更好的模式可以用来实现相同的流程?
我目前正在研究为在我们的基于Web的应用程序中创建的任何新代码创建自动单元测试的方法.我们运行JSF 2.0,Richfaces 3.3并使用JRE1.6.
我有兴趣听取人们使用和建议的意见吗?优点缺点?难以实施?社区支持和文档?等等.
我看过JSFUnit并且看起来很压缩,但是在我开始使用它之前想得到意见.
谢谢
我从数据库中抓取条目并将其显示在我的网页上,如下所示:
$query = mysql_query("SELECT * FROM posts order by id desc") or die(mysql_error());
if (!$query) {
die('MySQL error');
} else {
while($row = mysql_fetch_array($query)):
// HTML stuff with <?php echo $row['title']; ?>
endwhile; }
Run Code Online (Sandbox Code Playgroud)
如果没有条目可以,我怎么能写一个if语句来回显"Nothing Found"?所以基本上,如果查询做了什么并且什么都没发现,我怎么能回应某种"错误信息"呢?
c# ×2
asp.net ×1
asp.net-mvc ×1
bash ×1
c++ ×1
c++11 ×1
covariance ×1
dot ×1
generics ×1
graphviz ×1
grep ×1
interactive ×1
interface ×1
iprincipal ×1
jsf ×1
jsfunit ×1
mysql ×1
php ×1
polymorphism ×1
richfaces ×1
scala ×1
security ×1
unit-testing ×1
unix ×1