topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 7:02 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: VPR, visual people randomizer!  (Read 17198 times)

Chessnia

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 53
    • View Profile
    • CHESSNIA
    • Donate to Member
IDEA: VPR, visual people randomizer!
« on: June 29, 2010, 10:34 PM »
Hi there! :)


I spend a fair bit of time coaching kids in the classroom and I try to make my lessons as much fun as possible.
I normally use a VGA projector or a smartboard. At some point, I begin to ask questions and what I'd love to see to give the kids a bit more motivation.
(ok, that part has been copied and pasted from my clickometer request, but everything stands for this one!).

Often, I have to pick students from a list. Not always, but normally, it's a random process.

To make this simple process more interesting, I thought it would be interesting for the kids and me to have a little program which would pick a name from the list at random, but the process would be visually attractive: a bit like a roulette kind of effect, the names on the list would be highlighted at high speed (one by one) for a couple of seconds, then it slows down and stops at 1. That's the name that has been picked!

More features:

- Optional: if a name has been picked, it can't be picked again.
- A name which has been picked appears in a different colour.
- Ability to choose colours.
- Ability to enter names.
- Ability to set the amount of time that goes by before the randomizer stops / perhaps speed.
- Ability to change the color of a name on the list  by simply clicking on it.
- like gmail, ability to add different stars (icons), by clicking on it (maybe for version 2)

Here's a very simple image showing more or less what I'm thinking about:



Anyway, I think other teachers might find it useful also... lessons can be boring, let's make them a little more fun for everyone! (it could be useful to many other people too...)
Btw, I use windows 7, so compatibility with it would be much appreciated if someone takes this up. :)

Finally, I don't know if I'm supposed to say this here, but I'm willing to donate at least 50$ for this. I know it's not much, but we've gotta start somewhere. :)

Cheers.

scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #1 on: June 29, 2010, 10:40 PM »
Are you looking for something that would run full-screen, or as a small sidebar, or as a normal window?
How many names should it support?

Chessnia

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 53
    • View Profile
    • CHESSNIA
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #2 on: June 29, 2010, 10:45 PM »
I don't really know the difference between "sidebar" or "normal window". If it helps, it would be like the clickometer that I requested.
Number of names: 80 at most.

Oh, another feature: ability to import a list from a text list.

Cheers.

scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #3 on: June 30, 2010, 12:19 AM »
I'm gonna torture my less favourite designer/flash coder tomorrow to see what 'visually impressive' animation he can come up with.

Also UI teaser time:
UI.png

Chessnia

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 53
    • View Profile
    • CHESSNIA
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #4 on: June 30, 2010, 03:25 AM »
Thanks scancode! :)

Just one thing, is that the screen where you add the names and so on? because it is important that the main screen has like table cells so that they can be coloured and you can see the visual effect.
Anyway, it's looking smart!

vixay

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 140
  • ViXaY
    • View Profile
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #5 on: June 30, 2010, 07:22 AM »
since you are already using excel... here's a simple module for it, i've tested it and it works well enough.

just put your active cell within your table and run the macro StartRandomizer()

'Module by Vixay for DonationCoder
Option Explicit
'API for windows sleep
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Sub StartRandomizer()
'Moves a shape along the cells, and changes color of the final cell
' No exclusivity for now
'30 ms = fast
'100 ms = slow
'150 ms = stop
Dim shpActive As Shape
Dim rCell As Range
Dim lSpeed As Long
Dim lSpeedMax As Long
Dim lWinner As Long
Dim lCount As Long

lSpeed = 30
lSpeedMax = 150
Randomize
lWinner = SelectWinner()
Debug.Print "to be winner:" & lWinner
'get the shape we will use ( must exist or will cause an error )
If ActiveSheet.Shapes.Count > 1 Then
    Set shpActive = ActiveSheet.Shapes(1)
Else
    Set shpActive = ActiveSheet.Shapes.AddShape(msoShapeRoundedRectangle, 10, 10, 10, 10)
    shpActive.Fill.Transparency = 0.8
End If

For lSpeed = 30 To lSpeedMax Step 20
    lCount = 0
    For Each rCell In ListArea.Cells
        lCount = lCount + 1
        AlignShapeTo shpActive, rCell
        'Debug.Print rCell.Address
        DoEvents
        'Application.ScreenUpdating = True
        Sleep lSpeed
        'slow down speed randomly with a low probability
        ' i.e. continue through all cells most of the time at the current speed
        ' except no random slowdowns on the last stage
        If Rnd >= 0.95 And lSpeed < 130 Then
        'can tweak the number here to change how often we randomly switch speeds
            lSpeed = lSpeed + 20
            Debug.Print "random speed slowdown:" & lSpeed
        End If
        'if at winner cell, and at final slowdown stage
        If lSpeed >= lSpeedMax And lCount = lWinner Then
            Debug.Print "Found our winner"
            rCell.Interior.Color = vbRed
            Exit For 'stop here
        End If
        'Debug.Print lSpeed
    Next rCell
    Debug.Print "next slowdown:" & lSpeed
Next lSpeed

End Sub

Sub AlignShapeTo(ByRef shpObj As Shape, rCell As Range)
shpObj.Top = rCell.Top
shpObj.Left = rCell.Left
shpObj.Height = rCell.Height
shpObj.Width = rCell.Width
End Sub

Function ListArea() As Range
'Change this function to suit your needs or just make sure your
' active cell is within your table range
Set ListArea = ActiveCell.CurrentRegion
'Set ListArea = Selection
End Function

Function SelectWinner() As Long
'Randomly choose a cell amongst all the cells
Dim lCellCount As Long
lCellCount = ListArea.Count
Randomize
SelectWinner = Rnd * lCellCount + 1
Debug.Print SelectWinner & " / " & lCellCount
End Function

Sub ClearBackgrounds()
ActiveCell.CurrentRegion.Interior.ColorIndex = xlColorIndexNone
End Sub

Let me know what you think.
Should be easy for you to customize colors and all.
"Drunk on the Nectar of Life!" -me

Chessnia

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 53
    • View Profile
    • CHESSNIA
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #6 on: June 30, 2010, 07:34 AM »
Er... wow, thanks a lot for your time.  :Thmbsup:

I don't have excel. I only use  Open office. Would it work for open office also?

But still, I'm not sure I'm looking for an excel macro, it seems to me that I want to be able to add different features which would be impossible to add to a macro:

run the program in a tiny window,
add features like the gmail thing (you click and you get a star),
getting the coloured cell to move around till it stops on one name on the list and the ability to make sure that that name is not repeated again, 
Perhaps add sound to the next version
etc.

In other words, I think I need a stand alone program.

vixay

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 140
  • ViXaY
    • View Profile
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #7 on: July 01, 2010, 12:49 AM »
sorry, my bad. I assumed the screenshot was excel. No as far as i know it shouldn't  work in openoffice, but hmm that gives me an opportunity to try macros in open office :)
As for stand alone... I don't have enough time for that, though I do have one flash application lying about which did something similar. I'll see if i can find it.
"Drunk on the Nectar of Life!" -me

steeladept

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,061
    • View Profile
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #8 on: July 02, 2010, 10:26 AM »
May be opening a can of worms here, but if you don't use the screen at that time for anything else (like showing a question to the class, for example), maybe you could take the kid's picture and have it rotate through the pictures?  The program logic would be the same, just the data would show up differently (like flipping through a photo album at high speed looping through and stopping at a random picture).  Just a thought if you are making it "visual".

scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #9 on: July 02, 2010, 12:40 PM »
May be opening a can of worms here, but if you don't use the screen at that time for anything else (like showing a question to the class, for example), maybe you could take the kid's picture and have it rotate through the pictures?  The program logic would be the same, just the data would show up differently (like flipping through a photo album at high speed looping through and stopping at a random picture).  Just a thought if you are making it "visual".

When I first heard about this snack, I thought about something like this.


daddydave

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 867
  • test
    • View Profile
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #10 on: July 02, 2010, 03:17 PM »
May be opening a can of worms here, but if you don't use the screen at that time for anything else (like showing a question to the class, for example), maybe you could take the kid's picture and have it rotate through the pictures?  The program logic would be the same, just the data would show up differently (like flipping through a photo album at high speed looping through and stopping at a random picture).  Just a thought if you are making it "visual".

When I first heard about this snack, I thought about something like this.

(Mockup in previous post)

I thought of something similar except I pictured a wall of photos and there is a red LED over the nose of each student that flashes when it's their turn, like in "Wallace and Grommit: The Curse of the Were-Rabbit" when they get an incoming call.
« Last Edit: July 02, 2010, 05:21 PM by daddydave »

SingingBoyo

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 38
  • Java is awesome... C++ needs more libraries
    • View Profile
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #11 on: July 10, 2010, 06:06 PM »
Wow, thought someone would have picked this up by now  :huh:

I'll see what I can throw together for you.  Using names, not pictures.

EDIT: I did end up picking this up, so here's a link to the current release!
So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)
« Last Edit: September 27, 2010, 12:05 AM by SingingBoyo »

SingingBoyo

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 38
  • Java is awesome... C++ needs more libraries
    • View Profile
    • Donate to Member
VPR 0.1 (not 1.0, 0.1)
« Reply #12 on: July 13, 2010, 06:37 PM »
Alright, here's a simple teaser.  Apologies for taking a few days - it was a debugging nightmare.  Ended up hitting dead-lock at one point...  Anyway, its not configurable, but given the number of settings there would be, I've decided to attempt working with XML config and save files, so bear with me as I work on it.  There are also quite a few quirks in the spin when you've got multiple one's going at once, and the lists are fixed, but I am working on it.

My screenies, from the final (and successful... sort of) test... are attached.  Someone tell me how to display attachments inline, and I'll edit this post.  First one is regular winXP theme, second one is my usual dark theme.  (mainly cause it looks cool to me :P)

All suggestions welcome ;)  Have fun with it!

P.S.  The program is the jar file in the zip file...  can't attach jar files to posts here.

EDIT: Another link to the current release, since this post is so much more visible.   :D
So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)
« Last Edit: September 27, 2010, 12:05 AM by SingingBoyo »

SingingBoyo

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 38
  • Java is awesome... C++ needs more libraries
    • View Profile
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #13 on: July 13, 2010, 07:46 PM »
Forgot to put this in the other post...

Mouser, please let me know if I can use this as a NANY app :)  Would give me even more reasons to enjoy this little project!
So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)

Chessnia

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 53
    • View Profile
    • CHESSNIA
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #14 on: September 17, 2010, 06:42 PM »
Oh, this is terrible, I hadn't even seen this, my appologies!!
I thought I was getting an email whenever there was a new reply to this, but I must have done something wrong.  :-[
I'm gonna check this out right now!
« Last Edit: September 17, 2010, 06:54 PM by Chessnia »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #15 on: September 17, 2010, 06:49 PM »
SingingBoyo, sure you could use this as a NANY.

Chessnia

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 53
    • View Profile
    • CHESSNIA
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #16 on: September 17, 2010, 08:57 PM »
I've just tested it.
That's so cool!  :Thmbsup: singingboyo!

I love the idea of being able to display more than one list at a time.Very nice.

Ok, I know this is pretty hard, but here are some features that I'd like to see.

- Sound effects
- Ability to open/save lists with all the data (number of selections, etc.)
- Ability to import or paste a text list.
- Ability to set size for display window (when the list is too large, you don't get to see who gets picked)
- Ability to definer colours: chosen name, background or text changes to #dafaff (whatever)
- Define colours per selection: 1 selecion = green, 2 red, 3 blue (whatever) etc.
- Ability to choose a name manually (clicking on it?)
- Add table column with extra data. The cells on this column behave like this: number goes up every time you click on it. (program's width doesn't need to change, the selections column and this one can be thinner)
- Randomizer effect mode: a) straight line, goes down like now  b) unpredictable (it hops from list name 1 to 7, then 9, then 3, then 24, then 2, then it stops)
- Randomizer safe mode: prevent names on the list from being picked more than once until al the other have been picked. (In fact, maybe the selections column is unnecessary if the text of a name on the list changes colours once is has been picked once, twice, etc.).

Anyway, that's all I can think of right now.

It looks very nice. Nice job singingBoyo!

My apologies again, since nobody replied to this post, I thought nobody was interested and apparently I did not have the notify option activated.



Scancode: that would be awesome indeed, great concept! :)

SingingBoyo

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 38
  • Java is awesome... C++ needs more libraries
    • View Profile
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #17 on: September 20, 2010, 06:22 PM »
It's a good thing I read the DC newsletter when I did.  Apparently I wasn't being notified either, and it brought me back to the site...

Anyways, I'll see what I can do. Sound effects will certainly be a while, but I'll try to get that in eventually.

A couple of questions:  Are you looking for any specific actions available when you select a name?  (Edit the name, delete it, etc?)  Also, I need a bit of clarification on that extra column you want.

EDIT:  The original post referred to a NANY release.  Not actually going to do one though, so I had to edit.

So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)
« Last Edit: September 21, 2010, 11:27 PM by SingingBoyo »

Chessnia

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 53
    • View Profile
    • CHESSNIA
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #18 on: September 21, 2010, 01:53 AM »
Regarding the specific actions, it would be nice if that could be added (maybe a future version) but I think it might be a lot of work for you right now? But yes, that would be most useful indeed.
Regarding the extra column: I am looking for specific actions here. It's basically going to be used like a scoring system. But editing the numbers manually is kind of painful, so I was thinking of just being able to click on each one of the cells on this column and the number would go up (or right button, number goes down). You know, making it easy to keep a score. And then if the whole thing can be exported / imported onto the program, that'd be cool. (I'm thinking of using it in a classrooms, and I go from one classroom to another, different schools. I have to load/save the data all the time).

Cheers! :)

SingingBoyo

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 38
  • Java is awesome... C++ needs more libraries
    • View Profile
    • Donate to Member
First real release!!
« Reply #19 on: September 24, 2010, 11:55 PM »
   Alright, here's the first one I'd really call a release.  Saves/loads, has popup options to select/downselect names, add/delete, etc.  Colors are customizable, and the dialogs are calling the lists spinners now :P

You can also load lists of names, because the save files are really just lists of names.  There are a couple of quirks:
   A: The first line of the file is considered the name of the list.
   B: With all names of people, if there is an "===" after it, it expects a number after it with the number of selections.  So, don't use === in names.

   Unfortunately, the whole program is very list-name oriented - saving, color setting, and closing all need a name to be selected.  That's the price of not using a panel with tabs I guess.

A few things for the next version that I'll have:
   A: Move list/spinner to a new frame (helps with the name thing)
   B: Save colors.
   C: Clean up the file loader - right now it won't read lines with spaces after the ===
   D: Double-click to 'select' a name. (Increment the selections count)
   E: Even selections (don't select names until everyone has the same number of selections)
   F: Random selections
Bit of a long list, but most of these will take max 15 minutes, so I expect to have it done within a couple of days (bit busy for tomorrow...)

Let me know if there's anything else that you think it needs.
So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)

Chessnia

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 53
    • View Profile
    • CHESSNIA
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #20 on: September 25, 2010, 12:46 AM »
Just had a quick look and it's looking very nice (color selector and all!).  :Thmbsup:
I think the list for the first release is fine. Perhaps the "3rd column" which I mentioned...

SingingBoyo

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 38
  • Java is awesome... C++ needs more libraries
    • View Profile
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #21 on: September 25, 2010, 01:25 AM »
A 3rd column should be fairly easy to do, I just forgot about it as I wrote the list.  For now, if you need to, you could clone the spinner by saving and loading it as a new one, then use the popup menu for scoring (in the cloned spinner).  I'll see if I can finish a third column along with double clicks and the better file loader tomorrow, then I'll work on the rest of the features.
So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)

SingingBoyo

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 38
  • Java is awesome... C++ needs more libraries
    • View Profile
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #22 on: September 26, 2010, 11:59 PM »
Alright, version 2.0 is done!  (was going to say it was 1.1, but the save files are totally incompatible, so...)

Features:
     1. Scoring column enabled by checkbox
     2. Color saving
     3. Fixed the ugly save dialog (that was a bit of an oversight...  :-[)
     4. Double clicks now increment or decrement selections or score
     5. Load simple lists of names as just that - a list of names with no name for the list (defaulting to N/A for list name)

(left click to increment, right click to decrement, double-click on name or # of selections for selections, on the score to inc/dec selections)

With the new save files comes a few quirks in writing them, and because of those quirks for adding special data (color, name of the list) comes the ability to load lists of names.  Just open the example.vrs file in the zip for an example - it's self-explanatory through comments. 

One thing that was unintentional but could be a useful quirk with java graphics - if you write something like
Code: HTML [Select]
  1. <html><i>Italic</i><b> Bold <u>With</u></b><u> Underline</u></b></html>
it will show up as Italic Bold With Underline[/b].  So, names can include html markup.  It's a bit strange to think about, but it could come in useful. 

The html doesn't need to be well-formed. i.e.
Code: HTML [Select]
  1. <html><i>NAME
will still italicize the value NAME.

Apologies for the code boxes - couldn't make it ignore the html tags in the post, and using special variables (&lt;) doesn't seem to work
So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)

Chessnia

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 53
    • View Profile
    • CHESSNIA
    • Donate to Member
Re: IDEA: VPR, visual people randomizer!
« Reply #23 on: September 29, 2010, 03:11 AM »
Wow, it's looking pretty sleak!  :)

Ok, here are some of the things which I think need improving:

- Score column: most of the time, when I click on it, the number doesn't go up. Sometimes I have to click several times for the number to go up. (Same thing with right click, number doesn't go down unless I click on it several times).

- If the list is longer the the height of the names column, you don't get to see who's been chosen unless you scroll down, which is a bit annoying.

- The ramdom routine is not so effective if you get a very long list (i.e. more than 25 people), as the highlight doesn't reach the end sometimes. (maybe add ability to choose speed of the rouitine + how long it lasts?)

Other than that, great work!  :Thmbsup: