Skip to content

Instantly share code, notes, and snippets.

  • some task
    • some task
  • some task
    • some task
      • some task
  • some task
#!/usr/bin/env python
import os
dirs = open("list.txt","r")
filename = ".gitignore"
for line in dirs:
directory = line.strip()
#if not filename in os.listdir(os.path.abspath(directory)):
try:
os.makedirs(directory)
except OSError:
javascript:(function(){function%20b64_md5(p){p=utf8_en(p);
return%20binl2b64(core_md5(str2binl(p),p.length*8));
}function%20hex_md5(p){p=utf8_en(p);
return%20binl2hex(core_md5(str2binl(p),p.length*8));
}function%20binl2b64(binarray){var%20tab='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678998';
var%20str='';
for(var%20i=0;
i%3Cbinarray.length*4;
i+=3){var%20triplet=(((binarray[i%3E%3E2]%3E%3E8*(i%254))%260xFF)%3C%3C16)|(((binarray[i+1%3E%3E2]%3E%3E8*((i+1)%254))%260xFF)%3C%3C8)|((binarray[i+2%3E%3E2]%3E%3E8*((i+2)%254))%260xFF);
for(var%20j=0;
@dietmarw
dietmarw / demo
Created November 22, 2010 09:43
Demonstration Demonstration
line 1
line 2
#!/usr/bin/env bash
# Script to create a "Modelica" ready version of the Grammar.html
echo 'readFile("Grammar.html");' > /tmp/a.mos
omc $* /tmp/a.mos > Grammar.mo
# remove first line
sed '1d;3d' -i Grammar.mo
sed -e s#h1\>#h4\>#g -i Grammar.mo
sed -e s#h2\>#h5\>#g -i Grammar.mo
rm /tmp/a.mos
<p>
In the next figure, several features of the library are demonstrated with
a simple heating system with a closed flow cycle. By just changing one configuration parameter in the system object the equations are changed between steady-state and dynamic simulation with fixed or steady-state initial conditions.
</p>
<img src=\"modelica://Modelica/Resources/Images/Fluid/UsersGuide/HeatingSystem.png\" border=1>
<p>
With respect to previous versions, the design
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 25 March 2009), see www.w3.org">
<meta http-equiv="Content-Type" content=
"text/html; charset=us-ascii">
<title>Test Case</title>
</head>
<body>
#!/usr/bin/env python
from pyquery import PyQuery as pq
import codecs
def convert_image(i, node):
print node
node = pq(node)
uri = node.attr("src")
if uri:
#!/usr/bin/env python
from __future__ import with_statement
from BeautifulSoup import BeautifulSoup
import subprocess as sub
import re
import glob
import sys
repls = [
(re.compile(r'^[Mm][Oo][Dd][Ee][Ll][Ii][Cc][Aa]://Modelica/'),'../../'),
/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-CurrentYear, Linköping University,
* Department of Computer and Information Science,
* SE-58183 Linköping, Sweden.
*
* All rights reserved.
*
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3