Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Arun Lakshman R arunlakshman

🏠
Working from home
View GitHub Profile
@arunlakshman
arunlakshman / mincore.c
Created Feb 9, 2018
File Occupancy in Buffer Cache
View mincore.c
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
View problem_08.rs
struct Window {
number_str: String,
window_size: i32,
current: i32,
}
impl Iterator for Window {
type Item = u64;
fn next(&mut self) -> Option<u64> {
View problem_02.rs
struct Fibonacci {
current: u64,
next: u64,
}
impl Iterator for Fibonacci {
type Item = u64;
fn next(&mut self) -> Option<u64> {
let t = self.current + self.next;
View problem_01.rs
fn main() {
let range = 1..1000;
let result: i32 = range.filter(|num| num % 3 == 0 || num % 5 ==0).sum();
println!("{}",result)
}
View VolatileTest.java
public class VolatileTest {
private static final int MAX_TASK_COUNT = 5;
private static volatile int tasks = 0;
public static void main(String[] args) {
new Employee().start();
new Manager().start();
}