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
#define _USE_MATH_DEFINES | |
#include <math.h> | |
#include <iostream> | |
#include <iomanip> | |
/** | |
* Estimate PI using Leibiniz series | |
* 1 - (1/3) + (1/5) - (1/7) + (1/9) .... = (pi / 4) | |
*/ |
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> | |
int main() ??< | |
int x<:1:> = <%??-(1??'(??-1)) ??!??! ??/ | |
??-(0??'0)%>; | |
std::cout << x<:0:>; | |
??> | |
/** Golfed | |
??=include<iostream> |
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 <algorithm> | |
#include <fstream> | |
#include <vector> | |
#include <map> | |
#include <math.h> | |
/* Example format for ymd_temp_readings.txt | |
START |
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
<?php | |
if(isset($_POST['txt'])) { | |
$value = $_POST['txt']; | |
} | |
$newtxt = preg_replace('#\*{2}(.*?)\*{2}#', '<b>$1</b>', $value); //bold **something** | |
$newtxt = preg_replace('#\_{2}(.*?)\_{2}#', '<i>$1</i>', $newtxt); //italics __something__ | |
$newtxt = preg_replace('#\`{2}(.*?)\`{2}#', '<img src = "$1">', $newtxt); //image ``something.jpg/png`` | |
$newtxt = preg_replace('#\-{2}(.*?)\-{2}#', '<br>', $newtxt); //break line ---- |
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
<?php | |
$str =' | |
/** | |
* @param integer $int An integer | |
* @return boolean | |
* @postParams [display_name, username, about, email, gender, password, confirm_password] | |
*/ | |
'; | |
if (preg_match_all('/@(\w+)\s+(.*)\r?\n/m', $str, $matches)){ |