Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
9908dee
Add more options to server
cmontella Jul 30, 2017
d561cd4
Get rid of old watcher file
cmontella Jul 30, 2017
0a0ae0a
Watchers self-report their name
cmontella Jul 30, 2017
28436ad
make watchers self-report their name
cmontella Jul 30, 2017
97fa1de
new options for main exe
cmontella Jul 30, 2017
b2b8749
Print a message when a watcher is attached
cmontella Jul 30, 2017
5f7e587
Merge remote-tracking branch 'refs/remotes/origin/master' into featur…
cmontella Jul 31, 2017
f65b0cd
add ability to set name on watcher
cmontella Jul 31, 2017
ac9e3a5
add watcher skeleton
cmontella Jul 31, 2017
587c9b9
Merge remote-tracking branch 'refs/remotes/origin/master' into featur…
cmontella Jul 31, 2017
1f61855
Fix loading watcher in main
cmontella Jul 31, 2017
9a4690a
rename print diff to match TS version
cmontella Jul 31, 2017
d90b930
fix spelling, remove println
cmontella Jul 31, 2017
bbb140f
Merge remote-tracking branch 'refs/remotes/origin/master' into featur…
cmontella Jul 31, 2017
c646ba2
Merge remote-tracking branch 'refs/remotes/origin/master' into featur…
cmontella Aug 1, 2017
acf015c
Merge remote-tracking branch 'refs/remotes/origin/feature/more-server…
cmontella Aug 1, 2017
8081023
Json deserialize
cmontella Aug 1, 2017
d2cbada
update json decoding
cmontella Aug 1, 2017
c9fa39a
Merge remote-tracking branch 'refs/remotes/origin/master' into featur…
cmontella Aug 1, 2017
2f14f6f
Serialize records
cmontella Aug 2, 2017
f628b67
Merge remote-tracking branch 'refs/remotes/origin/master' into featur…
cmontella Aug 2, 2017
6b959ae
Try nested records again
cmontella Aug 3, 2017
dd094c3
commit tests
cmontella Aug 3, 2017
55505d2
Merge remote-tracking branch 'refs/remotes/origin/master' into featur…
cmontella Aug 7, 2017
274f4de
add hyper dep
cmontella Aug 7, 2017
ff41684
test http send
cmontella Aug 7, 2017
6a4c845
add http watcher
cmontella Aug 7, 2017
102ed36
Merge remote-tracking branch 'refs/remotes/origin/master' into featur…
cmontella Aug 7, 2017
da3e34b
Merge remote-tracking branch 'refs/remotes/origin/master' into featur…
cmontella Aug 9, 2017
63e4cd9
fix watcher import
cmontella Aug 9, 2017
bb5a021
inject response into eve
cmontella Aug 9, 2017
15d155b
test HTTP request
cmontella Aug 9, 2017
a8858b7
Merge remote-tracking branch 'refs/remotes/origin/master' into featur…
cmontella Aug 9, 2017
da76889
Merge remote-tracking branch 'refs/remotes/origin/master' into featur…
cmontella Aug 9, 2017
4752d2e
Merge remote-tracking branch 'refs/remotes/origin/master' into featur…
cmontella Aug 9, 2017
d85ab5b
Fix up deser
cmontella Aug 10, 2017
371bd8f
json encoding
cmontella Aug 10, 2017
548e44a
tests
cmontella Aug 10, 2017
45874e5
Merge remote-tracking branch 'refs/remotes/origin/master' into featur…
cmontella Aug 10, 2017
bf70661
Merge remote-tracking branch 'refs/remotes/origin/master' into featur…
cmontella Aug 10, 2017
14432b9
test if we are in the process of decoding
cmontella Aug 10, 2017
3db35b5
Merge remote-tracking branch 'refs/remotes/origin/feature/json-watche…
cmontella Aug 10, 2017
523a0e8
add http to main
cmontella Aug 10, 2017
0f21740
add from_str method for internables
cmontella Aug 10, 2017
20d08bd
rename some things in JSON watcher
cmontella Aug 10, 2017
a568b6b
update http requests
cmontella Aug 10, 2017
39a448c
update example
cmontella Aug 10, 2017
0e246e7
stub in http server
cmontella Aug 10, 2017
c0c921f
Stub in http error
cmontella Aug 10, 2017
aefe11b
Add https support
cmontella Aug 11, 2017
fffa212
Decode into a string, implement https on sender
cmontella Aug 11, 2017
2d63257
do some cleanup
cmontella Aug 11, 2017
4691364
remove println
cmontella Aug 11, 2017
9ea340f
update test
cmontella Aug 11, 2017
87a629d
Start an http server in Eve
cmontella Aug 12, 2017
20db817
Merge branch 'master' into feature/http
cmontella Aug 14, 2017
c0a7af8
Merge branch 'master' into feature/http
cmontella Aug 15, 2017
62d3d37
add redirect
cmontella Aug 15, 2017
ed9a760
Add url-change event
cmontella Aug 16, 2017
4dd0834
Add page-show event
cmontella Aug 16, 2017
9040857
decode URL queries
cmontella Aug 16, 2017
a414907
handle multiple reuquests at once
cmontella Aug 17, 2017
bcb6191
Plumb in errors
cmontella Aug 17, 2017
4d668c7
Merge branch 'master' into feature/http
cmontella Aug 17, 2017
5f3a423
clean up some things
cmontella Aug 17, 2017
b209b4c
Add string/url-encode and string/encode
cmontella Aug 18, 2017
8db57fa
Property intern ints
cmontella Aug 18, 2017
d219c37
default body
cmontella Aug 18, 2017
acd6d55
add tag to url query
cmontella Aug 18, 2017
b8c7809
ignore vscode file
cmontella Aug 18, 2017
0639979
Parse kvs in hash string
cmontella Aug 20, 2017
089d7d0
parse bools in json
cmontella Aug 22, 2017
7a64f61
implement a stream watcher
cmontella Aug 22, 2017
20e9202
handle multiple chunks
cmontella Aug 23, 2017
48b80ee
more edits to setlist app
cmontella Aug 23, 2017
e0639d3
update json from http watcher
cmontella Aug 23, 2017
73e391f
Merge branch 'master' into feature/json-watcher
cmontella Aug 23, 2017
dc532a5
don't include json file
cmontella Aug 23, 2017
b62233b
Merge branch 'master' into feature/http
cmontella Aug 24, 2017
dff2b5f
Merge branch 'master' into feature/http
cmontella Aug 24, 2017
aca663e
fix merge conflicts
cmontella Aug 24, 2017
b887143
properly sort chunks
cmontella Aug 24, 2017
74ffb12
Lay groundwork for putting HTTP requests into Eve
cmontella Aug 25, 2017
416fb33
put body in response, mark requests as finished
cmontella Aug 25, 2017
b3e3ae3
save progress on setlist app
cmontella Aug 26, 2017
d75235e
updates to setlist app
cmontella Aug 29, 2017
3ff52d5
updates to groove and setlist
cmontella Aug 30, 2017
43f0579
save state for update
cmontella Aug 30, 2017
61ac1b7
Merge branch 'master' into feature/json-watcher
cmontella Aug 30, 2017
b051e0a
Fix some json bugs
cmontella Aug 31, 2017
c288c27
Do encoding in Eve
cmontella Sep 1, 2017
bdf44a2
undo accidental commit
cmontella Sep 1, 2017
38a15c4
Merge branch 'master' into feature/json-watcher
cmontella Sep 1, 2017
d85779a
update markdown in json
cmontella Sep 1, 2017
692a058
remove println
cmontella Sep 1, 2017
c26bca7
fix warnings
cmontella Sep 1, 2017
529e3ae
remove test file
cmontella Sep 1, 2017
3538e0f
Merge branch 'feature/http' into feature/json-watcher
cmontella Sep 1, 2017
f3271bb
Merge pull request #43 from Kodowa/feature/json-watcher
cmontella Sep 1, 2017
3b9a660
done define json twice
cmontella Sep 1, 2017
2ddb1d9
done use json twice
cmontella Sep 1, 2017
54fe789
fix error in package
cmontella Sep 1, 2017
026e54b
Update http intro
cmontella Sep 1, 2017
20bb24c
Merge branch 'fix/escape-chars' into feature/json-watcher
cmontella Sep 2, 2017
b66c058
fix some merge errors, use " instead of '
cmontella Sep 2, 2017
ab69895
remove test
cmontella Sep 2, 2017
5fa8057
Merge branch 'master' into feature/http
cmontella Sep 3, 2017
f95d7cf
App skeletons and UI
cmontella Sep 5, 2017
a7cb593
fix sliders
cmontella Sep 5, 2017
c013f40
resizeable spinner and tabbed box
cmontella Sep 5, 2017
5e9c99e
fix tabbed box displaying extra content
cmontella Sep 5, 2017
f37c3b3
draw a fancy slider
cmontella Sep 6, 2017
dcec730
Merge branch 'feature/http' into feature/json-watcher
cmontella Sep 6, 2017
605ba9c
delete accidental file
cmontella Sep 6, 2017
2752fc5
fix includes
cmontella Sep 6, 2017
04df1c2
remove setlist app from this branch
cmontella Sep 6, 2017
de547ae
remove unnecessary pipes
cmontella Sep 6, 2017
608cc7e
don't parse query strings and hash strings automatically
cmontella Sep 6, 2017
22a6ba8
cut hls from this PR
cmontella Sep 6, 2017
0e14036
remove response when we've got a handle on it
cmontella Sep 6, 2017
7853169
add a response/change event
cmontella Sep 6, 2017
f7668c2
fix typo
cmontella Sep 6, 2017
fbadded
pass through numbers
cmontella Sep 6, 2017
b255048
try to update this diff
cmontella Sep 6, 2017
7b16ca3
Merge branch 'feature/default-ui' into demo/setlist-aggregator
cmontella Sep 6, 2017
4ea7ab2
bring in the setlist aggregator
cmontella Sep 6, 2017
fc38edf
fix namespacing
cmontella Sep 6, 2017
e35fa07
parse query strings automatically
cmontella Sep 6, 2017
a9af524
Merge branch 'feature/json-watcher' into demo/setlist-aggregator
cmontella Sep 6, 2017
ea7d5fb
merge
cmontella Sep 16, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ build/
dist/
.vscode/tasks.json
examples/test.eve
*.log
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,11 @@ unicode-segmentation = "1.1.0"
iron = "0.5"
staticfile = "*"
mount = "*"
hyper = "0.11.2"
hyper-tls = "0.1.2"
futures = "0.1.14"
tokio-core = "0.1.9"
data-encoding = "1.2.0"
urlencoding = "1.0.0"
natord = "1.0.9"
notify = "4.0.0"
10 changes: 5 additions & 5 deletions examples/bouncing-balls.eve
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ commit
end

search
order = math/range[from:1 to:200]
order = math/range[from:1 to:1]
rand = random/number[seed: order]
rand2 = random/number[seed: order * order]
x = rand * 500
Expand All @@ -20,17 +20,17 @@ commit
end

search
boid = [#boid x > 490]
boid = [#boid x > 500]
boid.vx > 0
commit
boid.vx := boid.vx * -0.9
end

search
boid = [#boid y > 490]
boid = [#boid y > 500]
boid.vy > 0
commit
boid.vy := boid.vy * -0.9
boid.vy := boid.vy * -0.7
end

search
Expand All @@ -53,7 +53,7 @@ search
commit
boid.x := x + vx
boid.y := y + vy
boid.vy := vy + 0.07
boid.vy := vy + 0.16
end

search
Expand Down
168 changes: 168 additions & 0 deletions examples/card-validation.eve
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# Credit Card Validation

commit
[#credit-card number: "438857601841070"]
end

## Rules for Valid cards

- Be between 13 and 16 digits

- Must start with:
- 4 for Visa cards
- 5 for Master cards
- 37 for American Express cards
- 6 for Discover cards

- Each number goes through a transformation, then is checked whether or not the
result is divisible by 10. If divisible, then the number is valid. If not,
then it is not.
- The transformation can be described below:
1. Double every second digit from right to left. If doubling of a digit results
in a two-digit number, add up the two digits to get a single-digit number.
2. Now add all single-digit numbers from Step 1.
3. Add all digits in the odd places from right to left in the card number
4. Sum the results from Step 2 and Step 3.
5. The result is the number transformed

## Identify Bank

search
cc = [#credit-card number]
first-digits = string/substring[text: number from: 1 to: 3]
bind
cc.first-digits += first-digits
end

search
cc = [#credit-card first-digits]
bank = if "4" = string/substring[text: first-digits from: 1 to: 2] then "Visa"
if "5" = string/substring[text: first-digits from: 1 to: 2] then "Mastercard"
if "37" = first-digits then "American Express"
if "6" = string/substring[text: first-digits from: 1 to: 2] then "Discover"
bind
cc.bank += bank
end

## Transform the cc number

Index every digit in each number

search
cc = [#credit-card number]
(token,index) = string/split[text: number by: ""]
index - 1 > 0
index - 1 < 17
numerical-digit = eve/parse-value[value: token]
bind
[#digits cc index: index - 1 digit: numerical-digit]
end

search
digits = [#digits cc index digit]
number-length = string/length[text: cc.number]
reverse-index = -1 * (index - number-length) + 1
bind

digits.reverse-index += reverse-index
end

### Step 1.

Double every second digit from the right. We'll tag these digits as `#even-index`

search
digits = [#digits cc reverse-index digit]
0 = math/mod[value: reverse-index, by: 2]
bind
digits += #even-index
end

If a doubled digit is >= 10, sum the digits of that doubled digit. Othewise
just double the digit

search
digi = [#digits #even-index]
doubled = if digi.digit < 5 then digi.digit * 2
else if digi.digit = 5 then 1
else if digi.digit = 6 then 3
else if digi.digit = 7 then 5
else if digi.digit = 8 then 7
else if digi.digit = 9 then 9
bind
digi.doubled += doubled
end

### Step 2

Sum all of the doubled digits in Step 1 together

search
digi = [#digits #even-index cc reverse-index doubled]
doubled-sum = gather/sum[value: doubled for: (doubled,reverse-index) per: cc]
bind
cc.step-two-sum += doubled-sum
end

### Step 3

Sum the odd digits starting from the right

search
digits = [#digits cc reverse-index]
1 = math/mod[value: reverse-index, by: 2]
bind
digits += #odd-index
end

search
digits = [#digits #odd-index cc reverse-index]
step-three-sum = gather/sum[value: digits.digit for: reverse-index per: cc]
bind
cc.step-three-sum += step-three-sum
end

### Step 4

Sum the results from step 2 and 3

search
cc = [#credit-card step-two-sum step-three-sum]
transformed-number = step-two-sum + step-three-sum
bind
cc.transformed-number += transformed-number
end

## Test Validity

A number is valid if it is between 13 and 16 digits and the transformation
is divisible by 10

search
cc = [#credit-card number transformed-number]
number-length = string/length[text: number]
number-length >= 13
number-length <= 16
0 = math/mod[value: transformed-number by: 10]
bind
cc += #valid
end


## Some Output for Testing

search
digi = [#digits cc index reverse-index digit]
doubled = if digi.doubled then digi.doubled
else ""
valid = if cc = [#valid] then "valid"
else "invalid"
bind
[#html/div #container cc | children:
[#html/div sort: -1 text: cc.number]
[#html/div sort: -2 text: cc.bank]
[#html/div sort: -2 text: valid]]
end



34 changes: 34 additions & 0 deletions examples/gui.eve
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Gui Editor

This is a drag and drop editor for interfaces in Eve

commit
[#app/settings name: "GUI Builder"]
showlist = [#app/page #default name: "Editor" icon: "ios-list-outline" sort: 1]
[#app/ui]
end


search
page.name = "Editor"
[#app/ui page]
bind
page <- [#html/div #html/listener/context-menu #main-area | children:
[#html/div text: "Hello world"]]
end


search
[#html/event/mouse-up button: "right" target: container page-x page-y]
//canvas = [#main-area]
commit
//container.children += [#container page-x page-y]
container.children += [#container text: "{{page-x}}{{page-y}}" x: page-x y: page-y]
end


search
container = [#container x y]
bind
container <- [#html/div #html/listener/context-menu style: [min-width: "100px" min-height: "100px" padding: "10px" border: "1px solid black"]]
end
Loading