Skip to content

Instantly share code, notes, and snippets.

View ionoy's full-sized avatar

Mihhail Maslakov ionoy

  • Estonia
View GitHub Profile
[seadistus]
laskurid=1
relvid=1
saba=1
kustutasabalasul=1
[kalibreerimine]
punktivahe=0.02
nullX=50
static IObservable<FileInfo> GetFiles(DirectoryInfo root,
Func<FileInfo, bool> fileFilter,
Func<DirectoryInfo, bool> directoryFilter,
IScheduler scheduler = null)
{
scheduler = scheduler ?? Scheduler.Default;
return Observable.Create<FileInfo>(obs => {
Action<DirectoryInfo, Action<DirectoryInfo>> iterator = (dir, self) => {
foreach (var file in dir.GetFiles().Where(fileFilter))
private GetTypeDependencies(typePath : list[string]) : IEnumerable[string]
{
//This is to avoid recursive dependencies
match(typePath)
{
| typeName :: _ =>
mutable lst;
if(_dependencyMap.TryGetValue(typeName, out lst))
lst.Concat(lst.Where(d => typePath.All(p => d != p))
.SelectMany(d => GetTypeDependencies(d :: typePath)))
*CapsLock::
BlockInput On
CoordMode, Caret, Screen
IsMouseDown = 0
while GetKeyState("CapsLock", "P") ; While the F1 key is being held down physically.
{
Sleep, 1
public IObservable<bool> IsConnected
{
get
{
return _connectionSubject.Select(isConnected => {
if (isConnected)
return Telemetry.Buffer(TimeSpan.FromSeconds(2)).Select(l => l.Count > 0);
return Observable.Return(false);
}).Switch();
}
public class MainViewModel : ReactiveObject
{
public MainViewModel()
{
LoadTweetsCommand = new ReactiveCommand();
LoadTweetsCommand.RegisterAsync(_ => {
throw new Exception("AA");
return LoadTweets();
}).Subscribe(x => TheTweets = x);
using System;
using System.Linq;
using System.Reflection;
using System.ServiceModel;
using LinFu.DynamicProxy;
namespace UAV.Communication
{
public static class CommunicationHelpers
{
class Program
{
static void Main(string[] args)
{
using (var host = CommunicationHelpers.CreateHost<UAVControl>(hostSuffix: args.Length > 0 ? args[0] : "")) {
host.Open();
Console.WriteLine("Service is available. Press <ENTER> to exit.");
Console.ReadLine();
public static UAVAsyncControl Connect(string endpointPostfix = "")
{
return new UAVAsyncControl(CommunicationHelpers.CreateClient(endpointPostfix));
}
public const int WaitOutRange = 367;
public const int SkipInRange = 368;
public const int SkipOutRange = 369;
public const int WaitHdgInRange = 370;
public const int WaitHdgOutRange = 371;
public const int SkipHdgInRange = 372;
public const int SkipHdgOutRange = 373;
public const int RotateRelativeWaypoint = 374;
private static readonly Dictionary<int, string> Translations;