我想向某人演示一些基本的Linux shell(bash)命令.我不想完成在我的系统上安装Linux VM的整个例程,只是为了能够做到这一点.我只是想知道是否有一些我能做到的在线网页?像在线尝试MongoDB之类的东西.
如有任何指示,将不胜感激.谢谢!
在我的C#程序中,我有几个我自己的接口,我想保持我的程序集内部.
internal interface Doable {
void DoSomething ();
}
internal interface Informable {
void SomethingHappened (Doable obj);
}
Run Code Online (Sandbox Code Playgroud)
我有一个抽象类,它不能是内部的,它抽象地实现了两个接口,就像这样.
public abstract class MyAbstractClass : Doable, Informable {
internal abstract void DoSomething ();
internal abstract void SomethingHappened (Doable obj);
// Other methods
}
Run Code Online (Sandbox Code Playgroud)
但是,当我这样做时,我得到一个MyAbstractClass
没有实现的错误Doable.DoSomething()
(以及SomethingHappened(Doable obj)
同样).
我可以将抽象实现的访问修饰符更改DoSomething()
为public(然而,我首先不想这样做),但后来SomethingHappened(Doable obj)
是另一回事:它抱怨(正确地说)接口Doable
是内部的(因此这是方法可能没有public
访问修饰符).
我处于两难境地.我基本上希望将两个接口及其所有具体实现的方法保持在内部程序集中的所有类中,外部调用者不知道它们的存在.
想知道怎么回事?
我有一个具有双值的元组列表:
List<Tuple<string, string>> Descriptions;
Run Code Online (Sandbox Code Playgroud)
我一直在为此添加内容,如下所示:
Descriptions.Add (new Tuple<string, string> ("max", "some description"));
Descriptions.Add (new Tuple<string, string> ("joe", "some description"));
Descriptions.Add (new Tuple<string, string> ("jane", "some description"));
Descriptions.Add (new Tuple<string, string> ("max", "some other description"));
Run Code Online (Sandbox Code Playgroud)
我想使用Linq检索一个列表,其中Item1
元组是一个特定的值,比如说"max"
.我可以使用这段代码:
var s = Descriptions.Where (x => x.Item1 == "max");
Run Code Online (Sandbox Code Playgroud)
但是这将分配小号元组,这是我不希望的列表.我只想要一个描述字符串的列表,也就是说,它应该返回一个list<string>
包含与Item1
字符串相关的所有描述"max"
.