Skip to content

Instantly share code, notes, and snippets.

View limelier's full-sized avatar

limelier

View GitHub Profile
function sum(a) {
/**
* Return the sum of the elements in an array
*
* @param {number[]} a the array of elements to be summed
* @returns {number} the sum of the elements
*/
// return a.sum();
return a.reduce((acc, crt) => acc + crt);
function sum(a) {
/**
* Return the sum of the elements in an array
*
* @param {number[]} a the array of elements to be summed
* @returns {number} the sum of the elements
*/
// return a.sum();
return a.reduce((acc, crt) => acc + crt);
-- Journal begins at Sat 2020-09-26 18:18:44 EEST, ends at Sun 2020-12-06 13:39:19 EET. --
Dec 06 11:23:07 lenovoarch kernel: microcode: microcode updated early to revision 0xd6, date = 2020-04-27
Dec 06 11:23:07 lenovoarch kernel: Linux version 5.9.11-arch2-1 (linux@archlinux) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP PREEMPT Sat, 28 Nov 2020 02:07:22 +0000
Dec 06 11:23:07 lenovoarch kernel: Command line: initrd=\intel-ucode.img initrd=\initramfs-linux.img root="LABEL=linux_root" rw rcutree.rcu_idle_gp_delay=1
Dec 06 11:23:07 lenovoarch kernel: KERNEL supported cpus:
Dec 06 11:23:07 lenovoarch kernel: Intel GenuineIntel
Dec 06 11:23:07 lenovoarch kernel: AMD AuthenticAMD
Dec 06 11:23:07 lenovoarch kernel: Hygon HygonGenuine
Dec 06 11:23:07 lenovoarch kernel: Centaur CentaurHauls
Dec 06 11:23:07 lenovoarch kernel: zhaoxin Shanghai
audit-2.8.5-9
avahi-0.8+15+ge8a3dd0-3
blender-17:2.91.0-4
bluedevil-1:5.20.4-1 bolt-0.9.1-1
boost-libs-1.72.0-4
botan-2.17.2-2
breeze-5.20.4-1
breeze-gtk-5.20.4-1
brotli-1.0.9-4
btrfs-progs-5.9-3
[ 5.237] (--) Log file renamed from "/var/log/Xorg.pid-466.log" to "/var/log/Xorg.0.log"
[ 5.242]
X.Org X Server 1.20.10
X Protocol Version 11, Revision 0
[ 5.243] Build Operating System: Linux Arch Linux
[ 5.243] Current Operating System: Linux lenovoarch 5.9.11-arch2-1 #1 SMP PREEMPT Sat, 28 Nov 2020 02:07:22 +0000 x86_64
[ 5.243] Kernel command line: initrd=\intel-ucode.img initrd=\initramfs-linux.img root="LABEL=linux_root" rw
[ 5.243] Build Date: 01 December 2020 07:51:57PM
[ 5.243]
[ 5.243] Current version of pixman: 0.40.0
@limelier
limelier / filtertouppercase2.c
Created April 15, 2019 21:39
An improved version of filtertouppercase.c
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
char* source;
char* destination;
@limelier
limelier / filtertouppercase.c
Created April 15, 2019 20:46
A small C Unix program.
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
char* source;
char* destination;
#include <fstream>
#include <queue>
using namespace std;
ifstream fin("BFS.in");
ofstream fout("BFS.out");
int main() {
bool graph[101][101] = {}, visited[101] = {};
int node_num, edge_num, st_node, crt_node;
#include <fstream>
#include <queue>
using namespace std;
ifstream fin("BFS.in");
ofstream fout("BFS.out");
int main() {
bool graph[101][101] = {}, visited[101] = {};
int node_num, edge_num, st_node, crt_node;
#include <fstream>
#define INF 1000000
using namespace std;
ifstream fin("prim.in");
ofstream fout("prim.out");
//
// Prim's algorithm