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
<!-- The "content" is the amount of time (in seconds) between the refresh(es?) --> | |
<meta http-equiv="refresh" content="1" > |
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 <fstream> | |
#include <unordered_set> | |
#include <set> | |
#include <chrono> | |
using namespace std; | |
int main() | |
{ |
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
#ifndef MP_BASIC_USER_INPUT | |
#define MP_BASIC_USER_INPUT | |
namespace mp { | |
template< typename T > | |
bool validateInput( std::istream& is, T& value ) { | |
std::istream::sentry isOk(is); | |
if( isOk ) { | |
is >> value; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title> | |
Dev | |
</title> | |
<script type="text/javascript" src="jquery-1.9.0.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
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
#on terminal 1 | |
mkfifo fifo | |
while true; do read line < fifo; $line; done | |
#on terminal 2 | |
cat > fifo |
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 <istream> | |
#include <cctype> | |
void eatSpaces( std::istream& in ) { | |
char c; | |
while( in.good() ) { | |
c = in.peek(); | |
if( !isspace(c) ) | |
break; | |
in.get(); |
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 <stdexcept> | |
/// @warning The parameter is also the return value. | |
/// @return true if the escape sequence was valid, false otherwise | |
bool escapeChar( char& c ) { | |
switch( c ) { | |
case 't': | |
c = '\t'; | |
break; | |
case 'n': |
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
///@return true if int, false if float | |
bool readIntOrNotFloat( std::istream& in, int& i, float& f ) { | |
in >> i; | |
if( in.good() ) { | |
char c = in.peek(); | |
if( c == '.' ) { | |
in >> f; | |
f += i; | |
return false; | |
} |
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::string getExtension( const std::string& filename ) { | |
size_t pos = filename.find_last_of('.'); | |
return pos == std::string::npos? "" : filename.substr(pos); | |
} |
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 i = 0; | |
//FILE* in = stdin; | |
char c = getc(in); | |
while( c >= '0' && c <= '9' ) { | |
//i = i*10 + (c - '0'); //Equivalent to the line below | |
i = (i<<3)+(i<<1)+c-'0'; | |
c = getchar(); | |
} |
OlderNewer