Skip to content

Instantly share code, notes, and snippets.

View stepancheg's full-sized avatar

Stepan Koltsov stepancheg

View GitHub Profile
use std::thread;
use std::time::Duration;
use bevy::app::App;
use bevy::prelude::*;
use rand::Rng;
#[derive(Resource, Default)]
struct MyRes;
use std::hint;
use bevy::prelude::*;
#[derive(Component, Copy, Clone)]
struct Transform(Mat4);
#[derive(Component, Copy, Clone)]
struct Position(Vec3);
#[derive(Component, Copy, Clone)]
use std::collections::HashMap;
use std::ops::Deref;
use std::ops::DerefMut;
use bevy::app::App;
use bevy::ecs::schedule::InternedScheduleLabel;
use bevy::ecs::schedule::ScheduleLabel;
use bevy::prelude::{IntoSystem, IntoSystemConfigs};
use crate::bevy_util::auto_deps::res::{read_in_system, write_out_system};
#[tokio::main]
async fn main() {
let futs = (0..1000).map(|i| tokio::task::spawn(async move { i }));
for fut in futs {
# remove unconstraint, and it will block
let i = futures::executor::block_on(tokio::task::unconstrained(fut)).unwrap();
eprintln!("{}", i);
}
}

Obsidian is a note-taking app

Obsidian is a gem.

It is the app I always wanted.

A long time ago I used Evernote

Evernote was great, but it degraded over time: they had a nice and fast note-taking app and added hundreds of functions I don't need. It became slow and the interface became overloaded in the last version I used many years ago.

I recall a dream from childhood
Wave of magic delight (it is actually some gibberish)
Ded Moroz (Russian version of Santa Claus) will come to me
And will bring his bag
Childhood went into fog
Youth went far away
But at Chistmas night
I see the tale again and again
#![feature(test)]
extern crate test;
use std::fs::File;
use std::io::{BufReader, BufRead};
#[bench]
fn scan_for_generated(bencher: &mut test::Bencher) {
let mut large_file = String::new();

The problem

Idris termination detection on values to be structurally smaller when calling function recursively. For example in this case the compiler understands that xs is smaller than x :: xs:

foo : List a -> ()
foo (x :: xs) = foo xs
foo [] = ()
@stepancheg
stepancheg / bt
Last active January 6, 2020 02:08
(lldb) bt all
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
//! A simple utility to count the number of allocated objects per type:
//! declared a field of type `ObjectCounter<T>` inside your type `T`,
//! and then `ObjectCounter::<T>::count()` will return the number of
//! allocated objects.
//!
//! This could be used for example a quick and dirty way to count
//! domain-specific objects e. g. sockets, connections, buffers,
//! requests etc.
#![feature(alloc_static)]