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
struct replace : public binary_function | |
{ | |
boost::regex motif; | |
std::string by; | |
replace(std::string& m, std::string& b) | |
: motif(m),by(b) {} | |
operator()(std::string& s) | |
{ | |
s = boost::regex_replace(s, motif, by); | |
} |
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
umask 022 | |
#export CLICOLOR=1 | |
export LSCOLORS=dxfxcxdxbxegedabagacad | |
alias ls="ls -G" | |
alias ll="ls -lG" | |
alias g++46="x86_64-apple-darwin10.7.0-g++-4.6.0 -std=c++0x" |
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 <memory> | |
#include <vector> | |
using namespace std; | |
class Stuff | |
{ | |
int val; | |
public: |
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 lang="fr"> | |
<head> | |
<meta charset="utf-8"> | |
<title>???</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!-- Le styles --> | |
<link href="bootstrap/css/bootstrap.css" rel="stylesheet"> | |
<style type="text/css"> |
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
public static class Extensions | |
{ | |
public static bool In<T>(this T obj, params T[] others) where T : IEquatable<T> | |
{ | |
bool res = false; | |
for (int i = 0; i < others.Length; i++) | |
{ | |
if (obj.Equals(others[i])) | |
{ |
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
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>RelayCommand</Title> | |
<Author></Author> | |
<Description></Description> | |
<HelpUrl></HelpUrl> | |
<SnippetTypes /> | |
<Keywords /> |
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
XDocument xdoc = | |
new XDocument( | |
new XElement("format", | |
new XElement("separateur", separateur), // simple tag | |
new XElement("delimiteur", delimiteur), | |
new XElement("skip", skipEntete ? "1" : "0"), | |
new XElement("colones", // foreach items in list 'choix' : return a tag with some attributes | |
choix.Select(ci => new XElement("col", new XAttribute("ordre", choix.IndexOf(ci)), new XAttribute("champ", ci.Identifiant))) | |
) | |
) |
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
/// <summary> | |
/// C# one-liner for a parallel approximation of Pi. | |
/// </summary> | |
/// <param name="iter">Number of iteration (the bigger it is, the better the approxiamtion will be)</param> | |
/// <returns>Pi !</returns> | |
static double ParallelPi(int iter) | |
{ | |
return Enumerable.Range(0, iter).AsParallel().Select(i => (4*Math.Pow(-1, i))/(2*i + 1)).Sum(); | |
} |
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 System; | |
using System.Collections.Generic; | |
using System.Reactive.Linq; | |
using System.Windows; | |
using System.Windows.Controls; | |
namespace waving_progressbars | |
{ | |
public partial class MainWindow | |
{ |
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
Traceback (most recent call last): | |
File "setup.py", line 18, in <module> | |
long_description=open('README.rst').read(), | |
File "C:\Python33\lib\encodings\cp1252.py", line 23, in decode | |
return codecs.charmap_decode(input,self.errors,decoding_table)[0] | |
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 2017: character maps to <undefined> |
OlderNewer