Skip to content

Instantly share code, notes, and snippets.

View eklitzke's full-sized avatar

Evan Klitzke eklitzke

View GitHub Profile
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
class Solution {
public:
void moveZeroes(vector<int>& nums) {
auto end = nums.end();
for (auto pos = std::remove(nums.begin(), nums.end(), 0); pos != end; ++pos) {
*pos = 0;
}
}
};
def docme(f):
f.__doc__ = "lol"
return f
@docme
def foo():
pass
# now it's like as if i had put "lol" as the docstring of f
_muldi3.o:
0000000000000000 T __multi3
_negdi2.o:
0000000000000000 T __negti2
_lshrdi3.o:
0000000000000000 T __lshrti3
_ashldi3.o:
%%{
machine Lexer;
main := |*
'(' => {
CAPTURE_TOKEN_TYPE(Open);
fbreak;
};
#include <gtest/gtest.h>
#include "lisp/lexer.h"
// Assert that the next token has the given type (with no value).
#define TOKTYPE(t) \
ASSERT_EQ(lexer.NextToken(), lisp::Token(lisp::TokenType::t));
// Assert that the next token has the given type and value.
#define TOKVAL(t, val) \
size_t dirlen = strlen (dir);
char *name = malloc (dirlen + sizeof id_name);
if (unlikely (name == NULL))
break;
memcpy (mempcpy (name, dir, dirlen), id_name, sizeof id_name);
#pragma once
#include "solution.h"
using namespace advent;
namespace advent2019 {
class Solution3 : public Solution {
public:
using Point = std::pair<int, int>;
---------------------
deltarpm suite V3.4
---------------------
A) Programs
makedeltarpm [-V version] [-s seqfile] oldrpm newrpm deltarpm
Extracts the usable files (i.e. no config files) from oldrpm and
// A sample standard C++20 program that prints
// the first N Pythagorean triples.
#include <iostream>
#include <optional>
#include <ranges> // New header!
using namespace std;
// maybe_view defines a view over zero or one
// objects.