This file contains 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
#include <stdio.h> | |
#include <string.h> | |
#include <signal.h> | |
#include <cstdlib> | |
#include <cxxabi.h> | |
#include <backtrace.h> | |
static void error_callback(void* data, const char* message, int error_number) { | |
if (error_number == -1) { | |
fprintf(stderr, "If you want backtraces, you have to compile with -g\n\n"); |
This file contains 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::io::Result; | |
use std::io::Write; | |
use std::time::Instant; | |
fn write_varint<W: Write>(mut writer: W, mut value: u32) -> Result<u32> { | |
let mut count = 0; | |
loop { | |
let mut temp = (value & 0b01111111) as u8; | |
value >>= 7; | |
if value != 0 { |
This file contains 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
#include <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <setjmp.h> | |
#include <stdint.h> | |
#pragma warning(disable : 4731) | |
enum { false, true }; | |
typedef _Bool bool; |
This file contains 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
#include <cstring> | |
#include "MyString.hpp" | |
MyString::MyString() { | |
Sir = nullptr; | |
Size = 0; | |
Capacity = 0; | |
Reserve(16); | |
} |
This file contains 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.IO; | |
namespace fsc | |
{ | |
class Program | |
{ | |
const int sectorSize = 4096; | |
static int getEmptySectors(string path) |