List of Primes:
primes = sieve [2..]
where sieve (p:xs) = p : sieve [x | x <- xs, x mod
p /= 0]
List of Primes:
primes = sieve [2..]
where sieve (p:xs) = p : sieve [x | x <- xs, x mod
p /= 0]
import socket | |
#SETTINGS: | |
settings_server = "" | |
settings_port = 6667 | |
settings_channel = "" | |
settings_botnick = "" | |
settings_botpass = "" | |
settings_owner = "" | |
settings_commandprefix = "!" |
# Tint2 config file | |
# Generated by tintwizard (http://code.google.com/p/tintwizard/) | |
# For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure | |
# Background definitions | |
# ID 1 | |
rounded = 0 | |
border_width = 0 | |
background_color = #000000 100 | |
border_color = #000000 100 |
def rgb2xyz(r, g, b): | |
var_r = r * 1.0 / 255 | |
var_g = g * 1.0 / 255 | |
var_b = b * 1.0 / 255 | |
if var_r > 0.04045: | |
var_r = ((var_r + 0.055) / 1.055) ** 2.4 | |
else: | |
var_r = var_r / 12.92 |
#include <ncurses.h> | |
#include <time.h> | |
#include <stdlib.h> | |
#include <signal.h> | |
void print_block(WINDOW *win, int x, int y); | |
void print_block_color(WINDOW *win, int x, int y, int color); | |
void print_board(WINDOW *win); | |
static sig_atomic_t resize; |
https://bbs.archlinux.org/viewtopic.php?id=162098
Although manual building and installation of libraries needed for correct use of Infinality patches does not seem to be extremely difficult, I have realized that it is still confusing for many users as to what should be installed (and where) in order to make fonts render as expected. That is why, in order to simplify the process as much as possible, I decided to create a custom infinality-bundle repository, containing three obligatory packages (x86_64, i686 & multilib) that together should make your screens look way closer to mine.
In order to use the repository, please add the following to your pacman.conf:
[infinality-bundle]
Server = http://bohoomil.com/repo/$arch
/* I was searching for an algorithm that gave you the next integer (counting | |
* upwards) that has the same hamming weight as the current number, and I | |
* couldn't find anything. So here's a function that does that for you. If | |
* there is no 'next number' (i.e. this is the largest number that has this | |
* hamming weight), it simply returns the same number again. | |
* | |
* This can probably be optimized; I whipped it up pretty quickly. Relatedly, I | |
* only tested a few edge cases I could think of, so if you use this, be sure | |
* to test it more thoroughly. | |
* |
#[macro_use] extern crate vst2; | |
use vst2::buffer::AudioBuffer; | |
use vst2::plugin::{Category, Plugin, Info, CanDo}; | |
use vst2::event::Event; | |
use vst2::api::{Supported, Events}; | |
use std::f64::consts::PI; | |
/// Convert the midi note's pitch into the equivalent frequency. |
// NOTE: This is the main.rs for the vst PLUGIN | |
#[macro_use] extern crate vst2; | |
use vst2::plugin::{Plugin, Info, Category}; | |
use vst2::buffer::AudioBuffer; | |
struct HighFrequencyToneControl { | |
parameter: f32, | |
last_sample_left: f32, |
#include <iostream> | |
#include <functional> | |
using namespace std::placeholders; | |
bool ReplaceNumber(int a, int mod, std::string replacement) { | |
if (a%mod == 0) { | |
std::cout << replacement; | |
return true; | |
} |