Traditionally, functions and data were separate entities. For example
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
/** \brief FStream-like handle for Wide API support. | |
* | |
* Although the C standard makes no guarantees a C FILE descriptor will | |
* be used internally, both GCC and Clang do so, with GCC providing | |
* an extension to create a basic_filebuf from an existing C FILE or | |
* POSIX file descriptor[1]. As basic_fstream is merely a wrapper around | |
* basic_iostream with a basic_filebuf, this provides a full API | |
* that should have native performance. | |
* | |
* By using a GNU extension to solve a GNU-specific problem, or std::fstream |
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 <curl/curl.h> | |
#include <iostream> | |
int main(void) | |
{ | |
CURL *curl; | |
CURLcode res; | |
curl_global_init(CURL_GLOBAL_ALL); |
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
// :copyright: (c) 2016 The Regents of the University of California. | |
// :license: MIT, see LICENSE.md for more details. | |
/** | |
* \addtogroup Example | |
* \brief Simple asynchronous GET requests. | |
*/ | |
#include "lattice.hpp" | |
#include <iostream> |
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/env python | |
# -*- coding: utf-8 -*- | |
""" | |
This script will delete all of the tweets in the specified account. | |
You may need to hit the "more" button on the bottom of your twitter profile | |
page every now and then as the script runs, this is due to a bug in twitter. | |
You will need to get a consumer key and consumer secret token to use this | |
script, you can do so by registering a twitter application at https://dev.twitter.com/apps |
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
/** Example using the COM interface without AutoCOM. The entire | |
* file can be automated with AutoCOM in under 15-lines of code. | |
* | |
* #include "autocom.hpp" | |
* int main(int argc, char *argv[]) | |
* { | |
* com::Bstr text; | |
* com::Dispatch dispatch("VBScript.RegExp"); | |
* dispatch.put("Pattern", L"\\w+"); | |
* for (auto match: dispatch.iter("Execute", L"A(b) c35 d_[x] yyy")) { |
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 <utility> | |
class A | |
{ | |
friend bool operator<(const A &lhs, const A &rhs) | |
{ | |
return false; | |
} |
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
// :copyright: (c) 2017 Alex Huszagh. | |
// :license: MIT. | |
/** | |
* Cartesian product algorithm. | |
* | |
* Lazily calculates the cartesian product from a container of containers, | |
* of either linear (array, vector, set, unordered_set) or associative | |
* (map, unordered_map, multimap, unordered_multimap) containers. | |
* | |
* The code can be used as follows: |
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
from collections import namedtuple | |
from bs4 import BeautifulSoup | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import requests | |
Representative = namedtuple("Representative", "member party state trump_score trump_margin predicted_score trump_plus_minus") | |