Skip to content

Commit fd82248

Browse files
committed
First version
0 parents  commit fd82248

File tree

5 files changed

+287
-0
lines changed

5 files changed

+287
-0
lines changed

.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.gitignore

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
#################
2+
## Eclipse
3+
#################
4+
5+
*.pydevproject
6+
.project
7+
.metadata
8+
bin/
9+
tmp/
10+
*.tmp
11+
*.bak
12+
*.swp
13+
*~.nib
14+
local.properties
15+
.classpath
16+
.settings/
17+
.loadpath
18+
19+
# External tool builders
20+
.externalToolBuilders/
21+
22+
# Locally stored "Eclipse launch configurations"
23+
*.launch
24+
25+
# CDT-specific
26+
.cproject
27+
28+
# PDT-specific
29+
.buildpath
30+
31+
32+
#################
33+
## Visual Studio
34+
#################
35+
36+
## Ignore Visual Studio temporary files, build results, and
37+
## files generated by popular Visual Studio add-ons.
38+
39+
# User-specific files
40+
*.suo
41+
*.user
42+
*.sln.docstates
43+
44+
# Build results
45+
[Dd]ebug/
46+
[Rr]elease/
47+
*_i.c
48+
*_p.c
49+
*.ilk
50+
*.meta
51+
*.obj
52+
*.pch
53+
*.pdb
54+
*.pgc
55+
*.pgd
56+
*.rsp
57+
*.sbr
58+
*.tlb
59+
*.tli
60+
*.tlh
61+
*.tmp
62+
*.vspscc
63+
.builds
64+
*.dotCover
65+
66+
## TODO: If you have NuGet Package Restore enabled, uncomment this
67+
#packages/
68+
69+
# Visual C++ cache files
70+
ipch/
71+
*.aps
72+
*.ncb
73+
*.opensdf
74+
*.sdf
75+
76+
# Visual Studio profiler
77+
*.psess
78+
*.vsp
79+
80+
# ReSharper is a .NET coding add-in
81+
_ReSharper*
82+
83+
# Installshield output folder
84+
[Ee]xpress
85+
86+
# DocProject is a documentation generator add-in
87+
DocProject/buildhelp/
88+
DocProject/Help/*.HxT
89+
DocProject/Help/*.HxC
90+
DocProject/Help/*.hhc
91+
DocProject/Help/*.hhk
92+
DocProject/Help/*.hhp
93+
DocProject/Help/Html2
94+
DocProject/Help/html
95+
96+
# Click-Once directory
97+
publish
98+
99+
# Others
100+
[Bb]in
101+
[Oo]bj
102+
sql
103+
TestResults
104+
*.Cache
105+
ClientBin
106+
stylecop.*
107+
~$*
108+
*.dbmdl
109+
Generated_Code #added for RIA/Silverlight projects
110+
111+
# Backup & report files from converting an old project file to a newer
112+
# Visual Studio version. Backup files are not needed, because we have git ;-)
113+
_UpgradeReport_Files/
114+
Backup*/
115+
UpgradeLog*.XML
116+
117+
118+
119+
############
120+
## Windows
121+
############
122+
123+
# Windows image file caches
124+
Thumbs.db
125+
126+
# Folder config file
127+
Desktop.ini
128+
129+
130+
#############
131+
## Python
132+
#############
133+
134+
*.py[co]
135+
136+
# Packages
137+
*.egg
138+
*.egg-info
139+
dist
140+
build
141+
eggs
142+
parts
143+
bin
144+
var
145+
sdist
146+
develop-eggs
147+
.installed.cfg
148+
149+
# Installer logs
150+
pip-log.txt
151+
152+
# Unit test / coverage reports
153+
.coverage
154+
.tox
155+
156+
#Translations
157+
*.mo
158+
159+
#Mr Developer
160+
.mr.developer.cfg
161+
162+
# Mac crap
163+
.DS_Store

clock.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/* Simple Javascript Binary Clock
2+
Copyright (c) 2010 CS Truter
3+
Written by Christoff Truter
4+
5+
*/
6+
7+
function DecToBin(value)
8+
{
9+
var result = '';
10+
while(value != 0)
11+
{
12+
result = (((value % 2) > 0) ? '1' : '0') + result;
13+
value = value >> 1;
14+
}
15+
return result;
16+
}
17+
18+
function binaryClock()
19+
{
20+
var current = new Date();
21+
22+
var units = [['h', DecToBin(current.getHours())],
23+
['m', DecToBin(current.getMinutes())],
24+
['s', DecToBin(current.getSeconds())]];
25+
26+
document.getElementById('hr').innerHTML = current.getHours();
27+
document.getElementById('mr').innerHTML = current.getMinutes();
28+
document.getElementById('sr').innerHTML = current.getSeconds();
29+
30+
for(var i = 0; i < 6; i++)
31+
{
32+
for(var u = 0; u < units.length; u++)
33+
{
34+
var id = units[u][0] + Math.pow(2, i);
35+
var obj = document.getElementById(id);
36+
37+
if (obj != null)
38+
{
39+
obj.className = 'inactive';
40+
obj.innerHTML = '0';
41+
var index = (units[u][1].length - 1) - i;
42+
if (index > -1)
43+
{
44+
if (units[u][1].charAt(index) == '1')
45+
{
46+
obj.className = 'active';
47+
obj.innerHTML = '1';
48+
}
49+
}
50+
}
51+
}
52+
}
53+
setTimeout(binaryClock, 1000);
54+
}

index.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<html>
2+
<head>
3+
<title></title>
4+
<script type="text/javascript" src="clock.js"></script>
5+
<link href="styles.css" type="text/css" rel="stylesheet" />
6+
</head>
7+
8+
<body style="background-color:black;color:Red" onload="binaryClock();">
9+
<table style="width:50%;height:50%">
10+
<tr>
11+
<td class="res">&nbsp;</td>
12+
<td class="res">32</td>
13+
<td class="res">16</td>
14+
<td class="res">8</td>
15+
<td class="res">4</td>
16+
<td class="res">2</td>
17+
<td class="res">1</td>
18+
</tr>
19+
<tr><td class="res" id="hr"></td><td id="h32">&nbsp;</td><td id="h16">&nbsp;</td><td id="h8">&nbsp;</td><td id="h4">&nbsp;</td><td id="h2">&nbsp;</td><td id="h1">&nbsp;</td></tr>
20+
<tr><td class="res" id="mr"></td><td id="m32">&nbsp;</td><td id="m16">&nbsp;</td><td id="m8">&nbsp;</td><td id="m4">&nbsp;</td><td id="m2">&nbsp;</td><td id="m1">&nbsp;</td></tr>
21+
<tr><td class="res" id="sr"></td><td id="s32">&nbsp;</td><td id="s16">&nbsp;</td><td id="s8">&nbsp;</td><td id="s4">&nbsp;</td><td id="s2">&nbsp;</td><td id="s1">&nbsp;</td></tr>
22+
</table>
23+
</body>
24+
</html>

styles.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.inactive
2+
{
3+
background-color:white;
4+
}
5+
6+
.active
7+
{
8+
background-color:red;
9+
}
10+
11+
.inactive, .active, .res
12+
{
13+
border: 1px solid black;
14+
width:14%;
15+
text-align:center;
16+
color: black;
17+
}
18+
19+
.res
20+
{
21+
font-weight:bold;
22+
background-color:black;
23+
color:white;
24+
}

0 commit comments

Comments
 (0)