Amy Stahlman | 10 Sep 20:40 2014
Picon

(no subject)

I've been working on a program that uses "init-auto-scrollbars" and I noticed that when the window is resized it actually changes the size of the virtual canvas along with the literal canvas instead of just resizing the scrollbar and changing the size of the literal canvas.

Here's an example that shows this:

(require racket/gui)

(define frame (new frame%
                  [label "Example"]
                  [width 300]
                  [height 300]))
(define canv (new canvas% [parent frame]
    [style '(vscroll hscroll)]

            [paint-callback
             (lambda (canvas dc)
(send dc draw-ellipse 0 0 500 500))]))
(send frame show #t)
(send canv init-auto-scrollbars 500 500 0.0 0.0)

Resize the window, making it large enough to show the entire ellipse; notice how the scrollbar's relative size doesn't change, and there is blank space at the bottom.
Is this by design or some kind of bug?
____________________
  Racket Users list:
  http://lists.racket-lang.org/users
Alexander D. Knauth | 18 Sep 22:37 2014

filters and the type of partition

Is there any way for a predicate-ish thing to do something like this:
#lang typed/racket
(: vectorof-real? : [(U Number (Vectorof Real))
                     -> Boolean :
                     #:+ (Vectorof Real)
                     #:- Number])
(define (vectorof-real? x)
  (vector? x))

Because this works:
(let ([x : (U Number (Vectorof Real)) #(1 2 3)])
  (if (vector? x)
      (ann x (Vectorof Real))
      (ann x Number)))

And also I noticed the types for the functions filter and partition are:
 > filter
 - : (All (a b)
        (case->
        (-> (-> a Any : #:+ b) (Listof a) (Listof b))
        (-> (-> a Any) (Listof a) (Listof a))))
 #<procedure:filter>
 > partition
 - : (All (a b)
       (case->
        (-> (-> a Any) (Listof a) (values (Listof a) (Listof a)))
        (-> (-> Any Boolean : a) (Listof b) (values (Listof a) (Listof b)))))
 #<procedure:partition>

For the filter function, the predicate only has to accept the type a for both cases and can return Any for both
cases.  Is there any reason why the second case of partition doesn’t do that?  And is there a reason why it
doesn’t use #:+ for the filter?  

The current type for partition wouldn’t allow me to use my vectorof-real? as the predicate even if it did
work, right?  But filter would?  

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Dmitry Pavlov | 18 Sep 17:22 2014
Picon

slider initial value is unexpectedly zero when min-value = max-value

Hello,

The title says it all, but here is also a code snip:

(require racket/gui)

(define frame (new frame% (label "test")))

(define slider
   (new slider%
        (label "")
        (parent frame)
        (min-value 1)
        (max-value 1)))

(display (send slider get-value))

It prints "0", and this is a sign of violation
of the invariant min-value <= init-value <= max-value.
Passing (init-value 1) does not help.

Best regards,

Dmitry
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

David Van Horn | 17 Sep 22:41 2014
Picon

frtime

This program is less flashy than it used to be:

   #lang frtime
   seconds

Is FrTime still supported?  Is there a way to get the old behavior of
being, well, reactive?

David
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Roman Klochkov | 17 Sep 18:59 2014
Picon

Exception decorator. is it possible?

I'm writeing a parser.
So I want to see in parser exception what happend and when (not only where).

(define (parse-item item)
   (with-handlers ([exn? (lambda (e) (raise (struct-copy exn e [message (format "At item ~a\n~a" item (exn-message e))])))])
         ....))

But this way I lose all exception types. Is there a way to change exception message, saving its type, except long copy/paste like
(with-handlers ([exn:fail:contract:arity? (raise (struct-copy exn:fail:contract:arity ...))]
                         [exn:fil:contract? (raise (struct-copy exn:fail:contract ...))]
                         ...)
   ...)

?

--
Roman Klochkov
____________________
  Racket Users list:
  http://lists.racket-lang.org/users
mukesh tiwari | 17 Sep 08:04 2014
Picon

Racket guide

Dear Racket Users,
I am learning racket and I found little bit misleading statement on guide [1]. It says that "Both the my-length and my-map functions run in O(n) time for a list of length n.". Technically this statement is correct but when I read below

"For a list with n elements, evaluation will stack up n (+ 1 ...) additions, and then finally add them up when the list is exhausted.

You can avoid piling up additions by adding along the way. To accumulate a length this way, we need a function that takes both a list and the length of the list seen so far; the code below uses a local function iter that accumulates the length in an argument len".

so just curious, shouldn't it be "Both the my-length and my-map functions run in O(n) space for a list of length n." ?


-Mukesh Tiwari



[1]http://docs.racket-lang.org/guide/Lists__Iteration__and_Recursion.html#%28part._tail-recursion%29
____________________
  Racket Users list:
  http://lists.racket-lang.org/users
Neil Van Dyke | 17 Sep 05:31 2014
Picon

new Jr. Racket Developer job

I'm helping a colleague hire a smart junior-level Racket developer.

The job spec is still being ironed-out, but a top candidate would be 
someone smart and responsible, and who has some experience with all of 
Racket, Java, and Python.

More important than any particular languages/tools is the demonstrated 
capacity to grasp more than one programming paradigm. So, if you've done 
idiomatic programming in each of, say, Racket, SIMULA, and ALGOL, you'd 
still be a good candidate.  Already knowing some Racket really helps you 
stand out, though.

This is for a real full-time salaried job, with the usual benefits. 
Telecommuting is possible, and the office is in the Eastern NY state 
area (not NYC area).

The company is not a startup nor a dotcom, and it is not all 
Google-exciting (no snack rooms, no plastic ball pools, no concierges).  
This is an established, stable, small-to-mid company, in a group that 
works on sober things like safety-critical process improvement.

An official job posting will be made later, once details are figured 
out.  But I'm testing the waters initially just on this Racket email 
list.  So, if you're still reading this post to this Racket email list, 
and you're interested in this junior-level Racket developer position, 
then please feel free to email your resume to me now (in PDF or ASCII 
format), and I'll pass it along.

BTW, the job is "junior" only in terms of professional Racket 
development experience, and in the challenge level of work needed right 
now.  It's very much open to all ages, and diversity is also welcome in 
general at the company.

Please *don't* re-post this elsewhere at this time; my email beep thanks 
you.

Neil V.

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

dpavlov | 16 Sep 23:12 2014
Picon

Spreadsheet editor

Hello,

I have made a reusable version of my spreadsheet editor.
Its capabilities are limited to the needs of my app, so
not much:

- Fixed number of columns with arbitrary labels, which
   can be changed while running. The number of columns
   does not scale well: 1000 is OK, while 100 000 is not.
   The width of the column is adjusted dynamically so that
   the column label is visible and all the visible cells
   are not cut. Otherwise, column width is not changeable.

- Arbitrary number of rows with arbitrary labels.
   As many rows as you want. Rows can be added or removed
   while running.

- Clickable buttons for columns and rows with arbitrary
   callbacks.

- Editable (text-only, one-line) cells with arbitrary
   callbacks for displaying the cells or updating their
   contents.

- Scrolling bars (well, sliders), also arrow keys and
   PgUp/PgDn should work.

Here is the editor along with a demo:

https://github.com/kugelblitz/spreadsheet-editor

I see two issues currently:

* During editing, text snip creates a white plate that
   extends outside the supposed borders of the snip.
   See [1] for details.

* Racket GUI does not provide scroll bars that one can
   use independently from canvas or panel. I currently
   use sliders instead of scroll bars, but with slider,
   it is impossible to go up/down by exactly one point.
   Also, it is not possible to update the limits of the
   slider, so I have to re-create it when I add or remove
   a row from the table.

I would love to hear any comments regarding those issues,
or any other issues, or anything that draws your
attention in the source code.

[1] 
http://lists.racket-lang.org/users/archive/2014-September/064137.html
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Robby Findler | 16 Sep 15:55 2014

OOPSLA/SPLASH early registration deadline approaching

This is a reminder that the SPLASH Early Registration closes this week
on Friday 19 September.

http://2014.splashcon.org/attending/registration

Also please don’t forget to reserve your hotel room at the Portland
Marriott Waterfront. [1]

  ACM Conference on
  Systems, Programming, Languages, and Applications:
  Software for Humanity (SPLASH'14)
  Portland, Oregon, USA

  20-24 October, 2014
  http://www.splashcon.org
  http://twitter.com/splashcon
  http://www.facebook.com/SPLASHCon

  Sponsored by ACM SIGPLAN
  In cooperation with ACM SIGAda

The ACM SIGPLAN conference on Systems, Programming, Languages and
Applications: Software for Humanity (SPLASH) embraces all aspects
of software construction and delivery to make it the premier
conference at the intersection of programming, languages, and
software engineering.

[1] Why stay at the conference hotel?
http://2014.splashcon.org/attending/accommodation

____________________
  Racket Users list:
  http://lists.racket-lang.org/users
Geoffrey S. Knauth | 16 Sep 15:22 2014

pregexp to detect Japanese characters

I'm writing a function to detect Japanese characters in a string. I found this page:
 
 
So, for example, the example Perl regexp [\x{3041}-\x{3096}] would detect Hiragana characters (as would \p{Hiragana}).  How do I express such a Unicode range with Racket regexps?
 
I looked at the docs below and it wasn't obvious to me how to do it.  In other languages there might be, for example, a \xnnnn or \uxxxx construct.
 
 
--
Geoffrey S. Knauth | http://knauth.org/gsk
 
____________________
  Racket Users list:
  http://lists.racket-lang.org/users
Michael Sperber | 16 Sep 10:01 2014
Picon

BOB 2015 - 2nd Call for Contributions (Deadline Sep 30)


Submissions on/using/reporting on Racket welcome!

                         BOB Conference 2015
                               Berlin
                             23.1.2015
                       http://bobkonf.de/2015/
                       CALL FOR CONTRIBUTIONS
               English: http://bobkonf.de/2015/cfp.html
                German: http://bobkonf.de/2015/cfp.html
                    Deadline: September 30, 2014

You drive advanced software engineering methods, implement ambitious
architectures and are open to cutting-edge innovation? Attend this
conference, meet people that share your goals, and get to know the
best software tools and technologies available today. We strive to
offer you a day full of new experiences and impressions that you can
use to immediately improve your daily life as a software developer.

If you share our vision and want to contribute, submit a proposal for 
a talk or tutorial!

We are looking for talks about best-of-breed software technology,
e.g.:

- functional programming
- reactive programming
- micro-service architectures
- persistent data structures and databases
- …  everything really that isn’t mainstream, but you think should 
  be.

Presenters should provide the audience with information that is
practically useful for software developers.  This could take the form of
e.g.:

- experience reports
- introductory talks on technical background
- demos and how-tos

We accept proposals for presentations of 45 minutes (40 minutes talk 
+ 5 minutes questions), as well as 90 minute tutorials for beginners.
The language of presentation should be either English or German.
It should include (in your presentation language of choice):

- an abstract of max. 1500 characters.
- a short bio/cv
- contact information (including at least email)
- a list of 3-5 concrete ideas of how your work can be applied in a developer's daily life
- additional material (websites, blogs, slides, videos of past
  presentations, …)

You can submit your proposal using the following form:

https://docs.google.com/spreadsheet/viewform?formkey=dHJ0TjR1cEhUWmdBZFVITGVRVWN5VEE6MA

- direct questions to bobkonf at active minus group dot de
- proposal deadline: September 30, 2014
- notification: October 15, 2014
- program: October 2014, 2014

NOTE: The conference fee will be waived for presenters, but travel 
expenses will not be covered.

Program Committee
- Matthias Fischmann, zerobuzz UG
- Matthias Neubauer, SICK AG
- Michael Sperber, Active Group
- Stefan Wehr, factis research

Wissenschaftlicher Beirat
- Annette Bieniusa, TU Kaiserslautern
- Torsten Grust, Uni Tübingen
- Peter Thiemann, Uni Freiburg

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Gmane