Alice Community  

Go Back   Alice Community > Alice 2 > Works-In-Progress

Reply
 
Thread Tools Display Modes
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 577
Join Date: Nov 2008
Location: In the interwebs
Default 10-23-2010, 08:37 AM

Right now, my FREE HOST is having problems. It will be down for a bit.


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
Old
DensetsuNoKaboom
Senior Member
 
DensetsuNoKaboom's Avatar
 
Status: Offline
Posts: 1,188
Join Date: May 2010
Location: e4eaf2
Default 10-23-2010, 10:17 AM

Do you think you can make it so that when you type in your password, it shows up as asterisks, like they do with real passwords?


Thank you for taking the time to read this signature. This signature loves you.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 10-23-2010, 11:18 AM

Quote:
Originally Posted by DensetsuNoKaboom View Post
Do you think you can make it so that when you type in your password, it shows up as asterisks, like they do with real passwords?
He can't do it using Alice's coding, but maybe it is possible with python.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
jython password input
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Arrow jython password input - 10-23-2010, 01:18 PM

here, a jython password input for you zone:

Code:
import threading, string

def passwordDialog():
    class MyThread(threading.Thread):
        def run(self):
            world.speedMultiplier = 0.0
            jpf = javax.swing.JPasswordField()
            jop = javax.swing.JOptionPane(jpf, javax.swing.JOptionPane.QUESTION_MESSAGE, javax.swing.JOptionPane.OK_CANCEL_OPTION)
            dialog = jop.createDialog("Password:")
            dialog.setVisible(true)
            result = jop.getValue()
            dialog.dispose()
            password = None
            if(result == javax.swing.JOptionPane.OK_OPTION):
                 password = jpf.getPassword()
                world.password = ''.join(password)
            world.speedMultiplier = 1.0
    MyThread().start()
It puts bullet points (or circles?) in instead of letters.
2 slght issues are - the input box is not automatically focused (not that much of a problem, just click on it) and you cant have a message saying "enter your password" as using a list just results in letters instead of form items, but its in the title and its quite obvious.


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [¬º-°]¬

Last edited by arty-fishL; 10-23-2010 at 01:25 PM.
   
Reply With Quote
Old
room14
Senior Member
 
room14's Avatar
 
Status: Offline
Posts: 549
Join Date: Nov 2009
Location: Auckland New Zealand
Default 10-24-2010, 12:17 AM

I just wanted to know, how does this thing work?


:D
   
Reply With Quote
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 577
Join Date: Nov 2008
Location: In the interwebs
Default 10-24-2010, 10:01 AM

Quote:
Originally Posted by room14 View Post
I just wanted to know, how does this thing work?
No idea which thing you're talking about, so I'll cover both:

The program:
It is pretty much entirely python. once the user credentials are entered, python spawns a thread that immediately hides the password and tries to connect to the host. The host returns a series of codes that can be interpreted by the program. When a login succeeds, the program gets a session token, that is used to connect for the remainder of the session. When the program requests posts, the server-side script returns a pickles object containing all posts for the user since it last queried the server. This allows the server to give the program multiple messages at once in case it missed one.

The server:
TO keep the program secure, I'm not going to reveal how it functions. Arty is the only one that knows because he knows a bunch about AJYTHON. (Alice Java Python)

The dialog script:
This script uses a standard dialog convention that Arty and I built a few months back. It spawns a thread to run, stops the world, waits for input, and then sets a world variable. I forgot about this for a bit and will probably implement it in the next version of chat. (Considering it could easily be put at the beginning of the check-thread. In fact, the new version will probably be built from scratch to take advantage of all the server updates I'm making.

P.S. My FREE HOST is back up, so post away!


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 577
Join Date: Nov 2008
Location: In the interwebs
Default 10-24-2010, 10:06 AM

Also, I'm planning on making a new website called aliceonline. The hope is that by making an account there, you will be able to access all of my future networked things.


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 577
Join Date: Nov 2008
Location: In the interwebs
Default 10-24-2010, 10:08 AM

Quote:
Originally Posted by arty-fishL View Post
here, a jython password input for you zone:

Code:
import threading, string

def passwordDialog():
    class MyThread(threading.Thread):
        def run(self):
            world.speedMultiplier = 0.0
            jpf = javax.swing.JPasswordField()
            jop = javax.swing.JOptionPane(jpf, javax.swing.JOptionPane.QUESTION_MESSAGE, javax.swing.JOptionPane.OK_CANCEL_OPTION)
            dialog = jop.createDialog("Password:")
            dialog.setVisible(true)
            result = jop.getValue()
            dialog.dispose()
            password = None
            if(result == javax.swing.JOptionPane.OK_OPTION):
                 password = jpf.getPassword()
                world.password = ''.join(password)
            world.speedMultiplier = 1.0
    MyThread().start()
It puts bullet points (or circles?) in instead of letters.
2 slght issues are - the input box is not automatically focused (not that much of a problem, just click on it) and you cant have a message saying "enter your password" as using a list just results in letters instead of form items, but its in the title and its quite obvious.
Woah, man! I didn't take time to look at the code, but this uses javax! Does the javax module work on Alice? I had too many problems to count when I used it, but that's probably because I spawned the thread before the world started.


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
Old
dubastot
Senior Member
 
dubastot's Avatar
 
Status: Offline
Posts: 661
Join Date: Apr 2009
Location: Two Steps From Hell
Default 10-24-2010, 10:11 AM

I have plenty of space to store your coding as well as plenty of space for data transfer on my site. If you wanted, I am sure I could give you access to the site and you could post your files there.

I could even create a sub domain: aliceonline.uperduper.com


I'm a web developer/ designer now.
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Arrow 10-24-2010, 11:52 AM

uper duper is a neat website.

and yes that uses javax, javax works fine, also no need for import. When run properly the password dialogue should run correctly.

here's a new mini version:
Code:
import threading, string

def password():
    class MyThread ( threading.Thread ):
        def run ( self ):
            world.speedMultiplier = 0.0
            jpf = javax.swing.JPasswordField()
            javax.swing.JOptionPane.showConfirmDialog(None, jpf, "Password:", javax.swing.JOptionPane.OK_CANCEL_OPTION)
            world.password = ''.join(jpf.getPassword())
            world.speedMultiplier = 1.0
    MyThread().start()
this version works the same except its smaller code and it uses a dialog box instead of a java frame and therefore does not spawn a new window (so "Password:" is no longer visible on the task bar and under applications in task manager)

hey, look, ive learnt to thread!!! (from that website you suggested a while back)


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [¬º-°]¬

Last edited by arty-fishL; 10-24-2010 at 11:56 AM.
   
Reply With Quote
Reply

Tags
cool beans, zone iz da bone

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.