TryRepy

# Try Repy!

Standard Output | Session Log | Insert Files | Special Characters | Code Snippets | Editor Options | Read Me

for count in range (0, 10): log( str(count) + '. Hello Repy' )

### Standard Output

    (here comes the output)

### Session Log

(here comes the log)

### Insert Files

#### Insertion Position

Insert at begin Insert at cursor

#### File Delimitiation Style

| multiple '#' + 'filenames' |  | 'filenames' |  | none

#### File Insertion

### Special Characters

(click'n'input)

[ | ~ | ^
] | ; | =
{ | ! | %
} | ` | $
/ | ' | +
| | ´ | '''
\ | # | """

### Repy Code Snippets

(click'n'input)

    # To loop over two or more sequences at the same time,
    # the entries can be paired with the zip() function.

    names = ['John', 'Mary', 'Paul']
    answers = ['yellow', 'pink', 'blue']

    for name, color in zip(names, answers):
      log( name + ' likes ' + color)
    # UDP Listener
    #
    # This snippet listens for UDP messages. In order to receive
    # messages, who have to run a sender program e.g. the succeeding snippet
    # in another sandbox (Browser)

    def process(remoteIP, remoteport, message, commhandle):
        log("Receiving: " + message)

    if callfunc == 'initialize':
        port = 12345
        ip = getmyip()
        log ("Registering UDP listener... ")
        log ("Listening on " + ip + ":" + str(port) + " for 15 seconds ... ")
        listener = recvmess(getmyip(), 12345, process)
        sleep(15)
        log ("Deregistering UDP listerner.")
        stopcomm(listener)
        log ("Good Bye!")
    # UDP Sender
    #
    # This snippet sends UDP messages. You can run the preceeding snippet
    # in another sandbox (Browser), which will receive there here send
    # messages.

    if callfunc == 'initialize':
        log("Starting to send 10 UDP messages... ")
        for x in range(0, 10):
            sleep(0.5)
            log("Sending: " + str(x) + ". Hello Repy (UDP)")
            sendmess(getmyip(), 12345, str(x) + ". Hello Repy (UDP)")
        log("Good Bye!")
    # TCP Listener
    # Listens for a TCP connection for 8 Seconds. Try it together
    # with succeeding Snippet.

    def process(remip, remport, so, thishandle, listenhandle):
        log("Conncection established.")
        log("Receiving: " + so.recv(512) )
        log("Closing connection...")

    if callfunc == 'initialize':
        log ("Registering TCP listener... ")
        log ("Listening on " + getmyip() + ":12345 for 8 seconds ... ")
        listenhandle = waitforconn(getmyip(), 12345, process)
        sleep(8)
        log("Closing listener...")
        stopcomm(listenhandle)
        log("Good Bye!")
    # TCP Sender
    #
    # This snippet establishes a TCP connection and sends messages.
    # To establish the connection someone has to listen for it.
    # You can start the preceeding snippet in another sandbox (Browser),
    # to listen for the connection and the according bytestream.

    if callfunc == 'initialize':
        log ("Establishing TCP connection with " + getmyip() + ":12345")
        so = openconn(getmyip(), 12345)
        log("Sending: Hello Repy (TCP)" )
        so.send("Hello Repy (TCP)")
        log("Good Bye!")

### Editor Options

Theme
Font Size
Show Invisibles
Persistent HScroll
Highlight selected word
Use Soft Tab
Show Gutter

### Read Me

Try Repy is a web-based software development and execution environment for Repy, which was implemented in the course of a bachelor seminar in the year 2011 at the research group of Future Communication at the University of Vienna.

#### Description

##### Editor

The editor is always displayed on the left side. You can write Repy code to it and evaluate it on the server. To submit the code press cmd + return (mac), ctrl + return (win), or the submit button beneath the editor window. Until the code has been evaluated, code submission is locked.

##### Callargs

You can append space separated callarguments in the input line beneath the editor window, when submitting code.

##### Standard Output

This displays the output of the program. It gives "real time" feedback.

##### Session Log

This retrieves and displays the entire log for every submitted and evaluated code of a session

##### Insert Files

Insert files to the editor window, whether at cursor position or at the top of the editor window.

##### Special Characters

Insert special characters at cursor position.

##### Code Snippets

Insert code snippets at cursor position.

##### Editor Options

Options to customize the editor window.

#### Known Issues

- Print does not work, use log() instead.
- Infinity Loops can only be stopped by shutting down the entire server.
- exitall() does not work.
- Thread Exceptions
  A thread exception in one thread does not exit the entire evaluation in a Virutal Namespace. So far exceptions in a thread are caught and logged but the execution of other healthy threads continues.
- TCP/UDP listeners are not isolated. A listener registered on one IP:PORT will override another listener, previously registered on this IP:PORT.

#### Links

Seattle Wiki
Repy Programming
Repy API