Skip to content

Commit 41396e3

Browse files
committed
Merge pull request #3 from aterrel/sc13
[WIP] Reorg and adding SC13 content
2 parents b9a0331 + eac61aa commit 41396e3

File tree

75 files changed

+4955
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+4955
-6
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*~
2+
*.pyc
3+
node_modules/*

Gruntfile.js

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
/* global module:false */
2+
module.exports = function(grunt) {
3+
4+
// Project configuration
5+
grunt.initConfig({
6+
pkg: grunt.file.readJSON('package.json'),
7+
meta: {
8+
banner:
9+
'/*!\n' +
10+
' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' +
11+
' * http://lab.hakim.se/reveal-js\n' +
12+
' * MIT licensed\n' +
13+
' *\n' +
14+
' * Copyright (C) 2013 Hakim El Hattab, http://hakim.se\n' +
15+
' */'
16+
},
17+
18+
// Tests will be added soon
19+
qunit: {
20+
files: [ 'test/**/*.html' ]
21+
},
22+
23+
uglify: {
24+
options: {
25+
banner: '<%= meta.banner %>\n'
26+
},
27+
build: {
28+
src: 'js/reveal.js',
29+
dest: 'js/reveal.min.js'
30+
}
31+
},
32+
33+
cssmin: {
34+
compress: {
35+
files: {
36+
'css/reveal.min.css': [ 'css/reveal.css' ]
37+
}
38+
}
39+
},
40+
41+
sass: {
42+
main: {
43+
files: {
44+
'css/theme/default.css': 'css/theme/source/default.scss',
45+
'css/theme/beige.css': 'css/theme/source/beige.scss',
46+
'css/theme/night.css': 'css/theme/source/night.scss',
47+
'css/theme/serif.css': 'css/theme/source/serif.scss',
48+
'css/theme/simple.css': 'css/theme/source/simple.scss',
49+
'css/theme/sky.css': 'css/theme/source/sky.scss',
50+
'css/theme/moon.css': 'css/theme/source/moon.scss',
51+
'css/theme/solarized.css': 'css/theme/source/solarized.scss'
52+
}
53+
}
54+
},
55+
56+
jshint: {
57+
options: {
58+
curly: false,
59+
eqeqeq: true,
60+
immed: true,
61+
latedef: true,
62+
newcap: true,
63+
noarg: true,
64+
sub: true,
65+
undef: true,
66+
eqnull: true,
67+
browser: true,
68+
expr: true,
69+
globals: {
70+
head: false,
71+
module: false,
72+
console: false
73+
}
74+
},
75+
files: [ 'Gruntfile.js', 'js/reveal.js' ]
76+
},
77+
78+
connect: {
79+
server: {
80+
options: {
81+
port: 8000,
82+
base: '.'
83+
}
84+
}
85+
},
86+
87+
zip: {
88+
'reveal-js-presentation.zip': [
89+
'index.html',
90+
'css/**',
91+
'js/**',
92+
'lib/**',
93+
'images/**',
94+
'plugin/**'
95+
]
96+
},
97+
98+
watch: {
99+
main: {
100+
files: [ 'Gruntfile.js', 'js/reveal.js', 'css/reveal.css' ],
101+
tasks: 'default'
102+
},
103+
theme: {
104+
files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ],
105+
tasks: 'themes'
106+
}
107+
}
108+
109+
});
110+
111+
// Dependencies
112+
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
113+
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
114+
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
115+
grunt.loadNpmTasks( 'grunt-contrib-watch' );
116+
grunt.loadNpmTasks( 'grunt-contrib-sass' );
117+
grunt.loadNpmTasks( 'grunt-contrib-connect' );
118+
grunt.loadNpmTasks( 'grunt-zip' );
119+
120+
// Default task
121+
grunt.registerTask( 'default', [ 'jshint', 'cssmin', 'uglify' ] );
122+
123+
// Theme task
124+
grunt.registerTask( 'themes', [ 'sass' ] );
125+
126+
// Package presentation to archive
127+
grunt.registerTask( 'package', [ 'default', 'zip' ] );
128+
129+
// Serve presentation locally
130+
grunt.registerTask( 'serve', [ 'connect', 'watch' ] );
131+
132+
};

data/numbers

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/data/numbers

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
1 2
2+
3 4
3+
5 6
4+
7 8
5+
9 10
File renamed without changes.

examples/intro/01_hello_world.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env python
2+
3+
import math
4+
r = math.pi / 2.0
5+
s = math.sin(r)
6+
print "Hello world, sin(%f)=%f" % (r,s)

examples/intro/02_write_numbers.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env python
2+
3+
import math
4+
import os
5+
6+
data_dir = os.path.join(os.path.dirname(__file__), "..", "data")
7+
infile = os.path.join(data_dir, "numbers")
8+
outfile = os.path.join(data_dir, "f_numbers")
9+
10+
f = open(infile, 'r')
11+
g = open(outfile, 'w')
12+
13+
def func(y):
14+
if y >= 0.0:
15+
return y**5.0*math.exp(-y)
16+
else:
17+
return 0.0
18+
19+
20+
print "Read from", infile
21+
22+
for line in f:
23+
line = line.split()
24+
x, y = float(line[0]), float(line[1])
25+
g.write("%g %12.5e\n" % (x,func(y)))
26+
27+
print "Wrote to", outfile
28+
f.close(); g.close()
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env python
2+
3+
import sys
4+
import os
5+
6+
cmd = 'date'
7+
output = os.popen(cmd)
8+
lines = output.readlines()
9+
fail = output.close()
10+
11+
if fail: print 'You do not have the date command'; sys.exit()
12+
13+
for line in lines:
14+
line = line.split()
15+
print "The current time is %s on %s %s, %s" % (line[3],line[2],line[1],line[-1])
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env python
2+
3+
import os
4+
import re
5+
6+
data_dir = os.path.join(os.path.dirname(__file__), "..", "data")
7+
infile = os.path.join(data_dir, "python.bib")
8+
9+
pattern1 = "@Book{(.*),"
10+
pattern2 = "\s+title\s+=\s+{(.*)},"
11+
12+
print "Reading from", infile
13+
for line in file(infile):
14+
match = re.search(pattern1, line)
15+
if match:
16+
print "Found a book with the tag '%s'" % match.group(1)
17+
18+
match = re.search(pattern2, line)
19+
if match:
20+
print "The title is '%s'" % match.group(1)

examples/intro/05_debug.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
l = range(10)
2+
3+
l[10] = 5

0 commit comments

Comments
 (0)