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 "Settings.h" | |
@interface MainMenuScreen : MenuScreen { | |
@private | |
/* | |
Usage in code: | |
drButton * button = ...; | |
button.position = ui.menuButtons; | |
*/ | |
class MainMenuUI { |
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 <Foundation/Foundation.h> | |
#import <iostream> | |
#import <string> | |
#import <list> | |
#import <fstream> | |
#import <tr1/unordered_map> | |
#import <Cocoa/Cocoa.h> | |
#import <AppKit/AppKit.h> | |
#import <vector> |
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
// | |
// Viewport.h | |
// | |
// Created by Benjamin Broll on 21.01.10. | |
// Copyright 2010 NEXT Munich. All rights reserved. | |
// | |
#import "cocos2d.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
#include <iostream> | |
#include <string> | |
#include <string.h> | |
using namespace std; | |
int main(int, char **) { | |
const size_t memory_buffer_size = 30000; | |
unsigned char memory[memory_buffer_size]; |
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
using namespace std; | |
struct node { | |
node * next; | |
int value; | |
}; | |
int main() | |
{ | |
node * root = new node; |
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
// Compile: | |
// sudo g++ ./RomipLoad.cpp ./pugixml.cpp | |
#include "pugixml.hpp" | |
using namespace std; | |
struct imhonet { | |
string score; | |
string content_id; | |
string element_id; |
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
uint64_t str_hash1(std::string str) { | |
uint64_t result = 0; | |
uint64_t base = 53; | |
uint64_t base_pow = 1; | |
for_each(str.begin(), str.end(), [&](char c) { | |
result += (c - 'a' + 1) * base_pow; base_pow *= base; | |
}); | |
return result; | |
} |
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
int main() | |
{ | |
std::string str; | |
std::string substr; | |
cin >> str; | |
cin >> substr; | |
if (str.length() < substr.length()) { | |
return 0; |
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
std::vector<unsigned> trivial_prefix_function(std::vector<unsigned> & prefix, std::string s) { | |
prefix.resize(s.length()); | |
for (int i = 0; i < s.length(); ++i) | |
for (int j = 0; j <= i; ++j) | |
if (s.substr(0, j) == s.substr(i - j + 1, j)) | |
prefix[i] = j; | |
return prefix; | |
} |
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
std::vector<unsigned> kmp_prefix_function(std::string s) { | |
size_t n = s.size(); | |
std::vector<unsigned> result(n); | |
for (int i = 1; i < n; i++) { | |
int j = result[i-1]; | |
while (j > 0 && s[i] != s[j]) | |
j = result[j-1]; | |
OlderNewer