A curated list of Rust libraries, tools, projects, etc.
The actual language.
Rust is located at rust-lang/rust.
| #include <cstdlib> | |
| #include <iostream> | |
| using namespace std; | |
| int triplet(int m, int n) | |
| { | |
| int a = (m * m) - (n * n); | |
| int b = 2 * m * n; | |
| int c = (m * m) + (n * n); | |
| int triplet[3] = {a,b,c}; |
| #include <cstdlib> | |
| #include <iostream> | |
| #include <string> | |
| using namespace std; | |
| #define POPULATION_DENSITY 10 | |
| #define GAME_LENGTH 10 | |
| class village | |
| { |
| #include <iostream> | |
| #include <vector> | |
| #include <string> | |
| #include <sstream> | |
| #include <fstream> | |
| std::vector<std::string> tokenise_csv_line(std::istream& str) | |
| { | |
| std::vector<std::string> result; | |
| std::string line; |
| from bs4 import BeautifulSoup | |
| import urllib2 | |
| def get_headlines(): | |
| url = "http://www.bloomberg.com/quickview" | |
| html = urllib2.urlopen(url).read() | |
| soup = BeautifulSoup(html) | |
| headlines = {} | |
| for link in soup.find_all('a', class_="q story_link black"): |
| #include <iostream> | |
| #include <vector> | |
| // https://upload.wikimedia.org/wikipedia/en/7/76/Busy_Beaver_1.JPG | |
| class Turing | |
| { | |
| public: | |
| std::vector<bool> tape; // our tape, with an alphabet of {0,1} | |
| int state; // the machine's current state |
| #include <iostream> | |
| unsigned int A(unsigned int m, unsigned int n) | |
| { | |
| // std::cout << "A(" << m << "," << n << ")" << std::endl; | |
| if(m == 0) | |
| { | |
| return n + 1; | |
| } |
A curated list of Rust libraries, tools, projects, etc.
The actual language.
Rust is located at rust-lang/rust.
| #include <iostream> | |
| int main(void) | |
| { | |
| int i = 37; | |
| float f = i; | |
| float g = *(float*)&i; | |
| int* j = &i; | |
| int* k = j; | |
| int l = *j; |
| require 'rubygems' | |
| require 'json' | |
| require 'open-uri' | |
| API_KEY = "INSERT_API_KEY_HERE" | |
| #API_ROOT = "https://oce.api.pvp.net/api/lol/oce/v1.3/" | |
| def pull(id, type) | |
| if id != nil | |
| case type |
| from bs4 import BeautifulSoup | |
| import urllib2 | |
| from StringIO import StringIO | |
| import gzip | |
| import time | |
| url = "http://rt.com/news/line/"+time.strftime("%Y-%m-%d") | |
| html_doc = urllib2.urlopen(url).read() | |
| # Thanks to https://stackoverflow.com/questions/22004093/python-beautifulsoup-picking-webpages-same-codes-working-on-and-off#answer-22004440 |