Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dave Griffiths
mongoose-2000
Commits
654d6baf
Commit
654d6baf
authored
Nov 26, 2013
by
Dave Griffiths
Browse files
raspberry pi server semapore sync
parent
864e89a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
android/assets/eavdb.scm
View file @
654d6baf
...
...
@@ -273,7 +273,8 @@
" as a on a.entity_id = e.entity_id "
"join "
table
"_value_"
(
ktv-type
ktv2
)
" as b on b.entity_id = e.entity_id "
"where e.entity_type = ? and a.attribute_id = ? and b.attribute_id =? and a.value = ? and b.value > DateTime(?) "
)
"where e.entity_type = ? and a.attribute_id = ? "
"and b.attribute_id = ? and a.value = ? and b.value > DateTime(?) "
)
type
(
ktv-key
ktv
)
(
ktv-key
ktv2
)
(
ktv-value
ktv
)
(
ktv-value
ktv2
))))
(
msg
(
db-status
db
))
(
if
(
null?
s
)
...
...
android/src/foam/mongoose/StarwispBuilder.java
View file @
654d6baf
...
...
@@ -963,10 +963,8 @@ public class StarwispBuilder
}
if
(
type
.
equals
(
"button-grid"
))
{
Log
.
i
(
"starwisp"
,
"button-grid update"
);
LinearLayout
horiz
=
(
LinearLayout
)
vv
;
if
(
token
.
equals
(
"grid-buttons"
))
{
Log
.
i
(
"starwisp"
,
"button-grid contents"
);
horiz
.
removeAllViews
();
JSONArray
params
=
arr
.
getJSONArray
(
3
);
...
...
web/scripts/eavdb.ss
View file @
654d6baf
...
...
@@ -127,33 +127,31 @@
(
insert-entity-wholesale
db
table
entity-type
uid
1
0
ktvlist
)
uid
))
(
define
sema
(
make-semaphore
1
))
;; all the parameters - for syncing purposes
(
define
(
insert-entity-wholesale
db
table
entity-type
unique-id
dirty
version
ktvlist
)
(
msg
"1"
(
db-status
db
))
(
semaphore-wait
sema
)
(
db-exec
db
"begin transaction"
)
(
let
((
id
(
db-insert
db
(
string-append
"insert into "
table
"_entity values (null, ?, ?, ?, ?)"
)
entity-type
unique-id
dirty
version
)))
;; create the attributes if they are new, and validate them if they exist
; (db-exec db "begin transaction")
(
for-each
(
lambda
(
ktv
)
(
find/add-attribute-type
db
table
entity-type
(
ktv-key
ktv
)
(
ktv-type
ktv
)))
ktvlist
)
(
msg
"4"
(
db-status
db
))
;; add all the keys
(
for-each
(
lambda
(
ktv
)
(
insert-value
db
table
id
ktv
))
ktvlist
)
(
msg
"5"
(
db-status
db
))
;
(db-exec db "end transaction")
(
msg
"6"
(
db-status
db
)
)
(
db-exec
db
"end transaction"
)
(
semaphore-post
sema
)
id
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment