This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Microsoft.Extensions.Hosting; | |
namespace BackgroundUpdate | |
{ | |
public class UpdateRunner<T>: IHostedService, IDisposable where T: IUpdate | |
{ | |
private readonly T _inner; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH deals AS ( | |
WITH deals_shortlist AS ( | |
WITH departure_goods AS ( | |
WITH search_options AS ( | |
WITH input AS ( | |
select | |
10 as dep_airport_distance, -- distance to other airports to include in departure airport search | |
500 as arr_airport_distance, -- distance to arrival airports from center | |
'CAT11' as career_name, -- your NeoFly career name | |
'DOG22' as tail_number, -- this plane will be used as center. bu you can also modify the code bellow to set a specific airport |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- renders map from 3x3 data pixels | |
local resolutionY = params.mapSizeY / (3 - 1) | |
local resolutionX = params.mapSizeX / (3 - 1) | |
self.layers:Data(outputLayer, { | |
size = {3, 3}, | |
data = {1, 1, 1, 1, 0, 1, 1, 1, 1}, | |
delta = {resolutionX, resolutionY} }, | |
"BICUBIC") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local halfX = params.mapSizeX / 2 | |
local halfY = params.mapSizeY / 2 | |
result.layers:Constant(result.heightmapLayer, -10) | |
local pi = 3.1415923 | |
local mapEdge = 10 | |
local p = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error[E0277]: the trait bound `futures::sync::mpsc::SendError<{integer}>: std::convert::From<{integer}>` is not satisfied | |
--> lib.rs:102:34 | |
| | |
102 | tx.send_all(input_values.from_err()).wait().expect("send fail"); | |
| ^^^^^^^^ the trait `std::convert::From<{integer}>` is not implemented for `futures::sync::mpsc::SendError<{integer}>` | |
error[E0277]: the trait bound `futures::sync::mpsc::SendError<{integer}>: std::convert::From<{integer}>` is not satisfied | |
--> lib.rs:102:12 | |
| | |
102 | tx.send_all(input_values.from_err()).wait().expect("send fail"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let mut window = Window::new(WindowOptions { | |
gl_version: GLVersion::Core((4, 1)), | |
title: "Startup Incubator".to_string(), | |
initial_size: (1024, 720), | |
vsync: true, | |
}); | |
let mut renderer = renderer_gl::renderloop::Loop::new(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn all_coords<'r>(&'r self) -> impl Iterator<Item=(usize, usize)> + 'r { | |
(0..self.items.len()).map(move |i: usize| (i % self.w, i / self.w)) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::mem; | |
use std::intrinsics::TypeId; | |
// Val | |
struct Val { | |
value: i32 | |
} | |
impl Val { |