Regarding voting:
I had the plan to create another entry for the AM contest, but since I am busy with my client and real life I am releasing my notes about this into the public domain. Planned to do this in Python...
It's a bit pointless since I understand that NXT itself will have a voting feature, but I think it would be a nice test run for the NXT core implementation.
Take what you think might be usefull.
AM VOTING
*********
-Create a voting
Send a message from address A to A
With the Text: "voting:<ID>:<VOTING_TYPE>:<TIMESTAMP_START>:<TIMESTAMP_END>:<OPTION1=<OPTION1DESC>>:<OPTION2=><OPTION2DESC>:<VOTING_DESCRIPTION>"
VOTING_TYPE=ACCOUNTS or NXT (one account, one vote or one NXT in voters account, one vote)
<OPTION1DESC>
Client would need to make sure that <ID> is not already in use
-Vote
Send message to address A with the text "vote:<ID>:OPTION<1..x>"
-Counting
Go through all messages between <TIMESTAMP_START>:<TIMESTAMP_END> that start with "vote:<ID>:" in transaction time ascending order
Keep a lookup list sender account number->OPTION<..x> (Option voted) and replace existing values in the list (accounts can vote more than once and overrule their previous vote
If <VOTING_TYPE> is ACCOUNT, simple count the number of accounts for each option
If <VOTING_TYPE> is NXT, lookup the account balance as of <TIMESTAMP_START> and make the sum of all account balances by voted option
-Voting interface:
User enters account number where voting takes place
Client finds all votes on this address (active/passive)
User can select a voting on this address by ID and can vote
if multiple messages with the same voting:?id=<ID>: exist, then only the oldest is used (you can't change a voting setup, but need to create a new one with a different id)
-Result interface
User enters account number where voting takes place
Client find all votes on this address (active/passive)
if multiple messages with the same voting:?id=<ID>: exist, then only the oldest is used (you can't change a voting setup, but need to create a new one with a different id)
User enters ID of votes he would like to see the results for
Client sums up (intermediate) results for the vote and shows them
Better format:
Format like magnet links "magnet:?xt=urn:sha1:YNCKHTQCWBTRNJIV4WNAE52SJUQCZO5C "
voting:?id=<ID>:vt=<VOTING_TYPE>:ts=<TIMESTAMP_START>:te=<TIMESTAMP_END>
.1=<OPTIONDESC>
.2=<OPTIONDESC>:d=<VOTING_DESCRIPTION>"
vote:?id=<ID>:1