如何实现以下内容:
我知道如何:
1.找到lat/long的地址
2.绘制多边形
因此,要完成任务,我需要从地址获取构建的多边形坐标.如何?
我通过Reflection调查了2个接口和2个类:
对我来说奇怪的是,当我通过对IChild类型的反思时,我找不到IParent方法.
应用于Child类型的相同代码按预期工作 - 反射显示Parent方法.
interface IParent
{
void ParentMethod();
}
interface IChild : IParent
{
void ChildMethod();
}
class Parent
{
public void ParentMethod(){}
}
class Child : Parent
{
public void ChildMethod(){}
}
void Main()
{
//investigate derived interface
Type t = typeof(IChild);
var info = t.GetMethod("ChildMethod");//ok
Console.WriteLine(info);
info = t.GetMethod("ParentMethod");//returns null!
Console.WriteLine(info);
//investigate derived class
t = typeof(Child);
info = t.GetMethod("ChildMethod");//ok
Console.WriteLine(info);
info = t.GetMethod("ParentMethod");//ok
Console.WriteLine(info);
}
Run Code Online (Sandbox Code Playgroud)
请解释一下这种行为?
是否有任何解决方法可以从派生接口的类型中反映基接口的方法?
我想在我们的生产环境中使用kafka.我想知道最新版本的客户端是否没有bug用于生产启动.它是否与消费者群体合作?我想每秒传递10000条记录,是否适合它?
最近我一直在分析我的并行计算如何实际加速16核处理器.我得出的一般公式 - 你得到的每个核心速度越慢的线程就越让我感到尴尬.以下是我的CPU负载和处理速度的图表:

因此,您可以看到处理器负载增加,但速度增加得慢得多.我想知道为什么会发生这样的影响,以及如何得到不可伸缩行为的原因.我已确保使用服务器GC模式.我已经确保,只要代码不做任何事情,我就会并行化适当的代码
我仔细分析了我的应用程序并发现没有瓶颈 - 看起来随着线程数量的增加,每个操作变慢.
我被困住了,我的情景出了什么问题?
我使用.Net 4任务并行库.
c# ×2
.net ×1
apache-kafka ×1
geocoding ×1
geolocation ×1
google-maps ×1
inheritance ×1
interface ×1
reflection ×1
scalability ×1