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
public class TestLinkedListImplementation { | |
public static void main(String args[]) { | |
LinkedList ll = new LinkedList(); | |
ll.addValue(1); | |
ll.addValue(2); | |
ll.addValue(3); | |
ll.addValue(4); | |
ll.addValue(5); | |
ll.addValue(6); |
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
import React, { useState, useEffect } from "react"; | |
class Counter extends React.Component { | |
state = { | |
count: 0, | |
}; | |
increment = () => this.setState({ count: this.state.count + 1 }); | |
decrement = () => this.setState({ count: this.state.count - 1 }); | |
reset = () => this.setState({ count: this.state.count }); | |
// line matters |
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
const createStore = (reducer) => { | |
let state; | |
let listeners = []; | |
const getState = () => state; | |
const dispatch = (action) => { | |
state = reducer(state, action); | |
listeners.forEach((listener) => listener()); | |
}; |
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 <iostream> | |
using namespace std; | |
using ull = unsigned long long; | |
int main() | |
{ | |
int n; | |
cin >> n; | |
ull dp[n + 1][2]; // dp[i][0] i-th stripe ends with white | |
dp[1][0] = dp[1][1] = dp[2][0] = dp[2][1] = 1; |
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
#define KBUILD_MODNAME "foo" | |
#include <uapi/linux/bpf.h> | |
#include <linux/bpf.h> | |
#include <linux/icmp.h> | |
#include <linux/if_ether.h> | |
#include <linux/if_vlan.h> | |
#include <linux/in.h> | |
#include <linux/ip.h> | |
#include <linux/tcp.h> | |
#include <linux/udp.h> |
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
gcc libwebsockets-websocket.c -L/usr/local/lib -lwebsockets |