This file contains hidden or 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 "c_lib.h" | |
#include <stdio.h> | |
/** | |
* @brief func_ptr_ | |
*/ | |
static c_lib_func_ptr func_ptr_; |
This file contains hidden or 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
#!/usr/bin/python | |
# Desc: Demostrate the usage of __str__ and __repr__ magic methods | |
""" Demostrate the usage of __str__ and __repr__ magic methods | |
""" | |
# class TestClass(object): | |
class TestClass(): | |
# 定义对象的初始化行为 | |
def __init__(self): |
This file contains hidden or 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> | |
#include <mutex> | |
#include <thread> | |
namespace | |
{ | |
std::once_flag init_once_flag; | |
} | |
class singleton |
This file contains hidden or 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 <QLineEdit> | |
#include <QStyledItemDelegate> | |
/* | |
// Sample | |
auto delegate = new HexItemDelegate; | |
ui->tableInfo->setItemDelegateForColumn(1, delegate); | |
ui->tableInfo->setItemDelegateForRow(1, delegate); | |
ui->tableInfo->setItemDelegate(delegate); | |
*/ |
This file contains hidden or 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> | |
#include <iterator> | |
#include <algorithm> | |
#include <sstream> | |
#include <unordered_set> | |
namespace | |
{ | |
void to_lower(std::string& str) |
This file contains hidden or 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
#!/bin/bash | |
############################################################################## | |
# Print information to stdout in bold green style | |
# Globals: | |
# None | |
# Arguments: | |
# None | |
# Outputs: | |
# Writes information to stdout |
This file contains hidden or 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
#pragma once | |
#include <iostream> | |
template <typename T> | |
class linked_list | |
{ | |
public: | |
static const size_t k_invalid_pos = 0xFFFF; | |
This file contains hidden or 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> | |
#include <vector> | |
#include <map> | |
using namespace std; | |
class Solution { | |
public: | |
vector<int> twoSum(vector<int>& nums, int target) { |
NewerOlder