[racket-users] DrRacket debugger error

2016-05-10 Thread copycat
I get the following error: 

module: cannot use identifier tainted by macro transformation in: module

when i try to debug a multi-file program with both untyped and typed scripts in 
it. If it's just untyped scripts it will work fine.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] slow rendering for 1000+ lines/arcs

2016-02-23 Thread copycat
On Tuesday, February 23, 2016 at 9:42:27 PM UTC+8, Matthew Flatt wrote:
> I see drawing times of around 60ms for "KCF new FIPG .. .dxf" on my
> machine. I could reduce the time a little by calling `(get-dc)` just
> once and passing it through all the drawing functions, but it looks
> like a lot of the remaining time is spent crossing into and out of the
> drawing layer at `draw-line`, draw-arc`, etc., besides actually
> plotting the pixels.
> 
> You might be able to get more significant improvement by accumulating
> drawing commands into a `dc-path%`, and then using `draw-path`. That
> strategy only works for parts to be drawn with the same pen, though.
> 
> Another common strategy is to render the drawing into a bitmap and copy
> the bitmap the screen for panning but that may not be so easy to
> implement with zooming.
> 
> At Mon, 22 Feb 2016 18:17:10 -0800 (PST), copycat wrote:
> > My program shows slow rendering when i am dealing with hundreds of 
> > lines/arcs 
> > to draw. Panning even when the canvas is zoomed in a particular point seems 
> > to 
> > be laggy. Using (time ..) to snoop around, it looks like draw-objects in 
> > "canvas.rkt" is to blame. Is there a way i can fix this?
> > 
> > https://github.com/xtrntr/DXF-Converter
> > 
> > You run the program from "main-window.rkt", then drag dxf files in the DXF 
> > folder into the fram and interact with the 2d drawing as follows:
> > 
> > ctrl drag to select elements
> > esc to unselect elements
> > click and drag to pan about
> > scroll up and down to zoom in/out
> > 
> > "KCF new FIPG .. .dxf" in the folder DXF has ~1200 elements
> > "1. DFX .. .dxf" in the same folder has ~500 elements
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.

Dear Matthew,

The first strategy sounds promising. I'll try it first thing in the morning. If 
the problem is somehow related to going in and out of the drawing layer, is it 
possible to batch the updates without using dc-path% and draw-path%?

The second strategy doesn't seem like it'll fit in with the rest of my 
application because i need to select and interact with the lines and arcs.

Thanks for the quick reply.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] slow rendering for 1000+ lines/arcs

2016-02-22 Thread copycat
My program shows slow rendering when i am dealing with hundreds of lines/arcs 
to draw. Panning even when the canvas is zoomed in a particular point seems to 
be laggy. Using (time ..) to snoop around, it looks like draw-objects in 
"canvas.rkt" is to blame. Is there a way i can fix this?

https://github.com/xtrntr/DXF-Converter

You run the program from "main-window.rkt", then drag dxf files in the DXF 
folder into the fram and interact with the 2d drawing as follows:

ctrl drag to select elements
esc to unselect elements
click and drag to pan about
scroll up and down to zoom in/out

"KCF new FIPG .. .dxf" in the folder DXF has ~1200 elements
"1. DFX .. .dxf" in the same folder has ~500 elements

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: Extending list-box functionality

2015-07-23 Thread copycat
On Thursday, July 23, 2015 at 2:50:37 PM UTC+8, copycat wrote:
 With a list box, i can select multiple items by holding onto my mouse and 
 dragging. I'll like to add on other features to the list box like being able 
 to drag the rows to reorder them, or to change the list-box values directly 
 by clicking and editing. How can i do this? I'm not sure where in the code i 
 can change the behavior of on-subwindow-event to include this feature. 
 
 (define/augment on-subwindow-event receiver event) also doesn't work.

After looking a bit i found this:

https://developer.gnome.org/gtk2/stable/gtk2-GtkTreeView-drag-and-drop.html

I am willing to try my hand at it. Would it be possible for me to edit
 
`mred/private/wx/win32/list-box`,
`mred/private/wx/gtk/list-box`,

to support this functionality? (And if so how long would it take)

-- 
You received this message because you are subscribed to the Google Groups 
Racket Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] saving a BMP in racket

2015-07-23 Thread copycat
Yes, i can and will try with the old imagemagick bindings.

On Thursday, July 23, 2015 at 6:28:00 AM UTC+8, johnbclements wrote:
  On Jul 20, 2015, at 4:11 AM, copycat kangren.c...@gmail.com wrote:
  
  Hi, not sure if this is considered a bug?
  
  (send model save-file model1.bmp 'bmp)
  
  save-file in bitmap%: kind saving not yet implemented: 'bmp
  
  I found this link, and it's been 2 years since. Is it an update that will 
  take a long time?
  
  http://stackoverflow.com/questions/14987784/how-can-i-save-a-bmp-in-racket
 
 My guess is that no one is currently working on this. I just took a quick 
 1-minute look at the respective wikipedia pages for PNGs and BMPs, and it 
 appears that although in principle BMP can support things that PNG cannot 
 (e.g., arbitrary bit-depth color channels), a PNG is not likely to lose any 
 of the information associated with a racket bitmap%, meaning that generating 
 a PNG and then converting it to a BMP using an external utility should 
 produce the same result as directly creating a BMP. Granted, it’s not as 
 convenient.
 
 Given this, would you consider this issue resolved if the word “yet” was 
 simply removed from the error message?
 
 Best,
 
 John Clements
 
 
  
  -- 
  You received this message because you are subscribed to the Google Groups 
  Racket Users group.
  To unsubscribe from this group and stop receiving emails from it, send an 
  email to racket-users+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
Racket Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Extending list-box functionality

2015-07-23 Thread copycat
With a list box, i can select multiple items by holding onto my mouse and 
dragging. I'll like to add on other features to the list box like being able to 
drag the rows to reorder them, or to change the list-box values directly by 
clicking and editing. How can i do this? I'm not sure where in the code i can 
change the behavior of on-subwindow-event to include this feature. 

(define/augment on-subwindow-event receiver event) also doesn't work.

-- 
You received this message because you are subscribed to the Google Groups 
Racket Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] saving a BMP in racket

2015-07-20 Thread copycat
Hi, not sure if this is considered a bug?

(send model save-file model1.bmp 'bmp)

save-file in bitmap%: kind saving not yet implemented: 'bmp

I found this link, and it's been 2 years since. Is it an update that will take 
a long time?

http://stackoverflow.com/questions/14987784/how-can-i-save-a-bmp-in-racket

-- 
You received this message because you are subscribed to the Google Groups 
Racket Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: could i get some feedback and help on a graphical editor project?

2015-07-08 Thread copycat
What i meant to say was implementing a -interactive- canvas showing a giant 
high resolution image.

-- 
You received this message because you are subscribed to the Google Groups 
Racket Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] could i get some feedback and help on a graphical editor project?

2015-07-08 Thread copycat
Hello all,

  feedback is most appreciated. I had a lot of fun writing this small program 
(see bottom for details and repository link), and i want to improve my skills 
so i can write idiomatic Scheme/Racket code one day. Particularly helpful would 
be suggestions as to where i can use macros to reduce the amount of code the 
program has. There is also some seriously verbose stuff in lst-utils.rkt 
(find-entity-with-starting-node, find-entities-from-node ...) that i'm not sure 
how to refactor at the moment now.

  Also, I am a new programmer and have only seriously programmed in VB.NET and 
Racket and am thinking about building on this program to develop a GUI for a 
gantry robot teaching interface. But i am worried about any roadblocks that i 
may encounter on the way in using Racket. Please help me clear my doubts.



WARNING: bottom is a long description which is as much for me as it for you. 
Skip to the below for a TL;DR.

  The first part of the GUI will be displaying a large image of a printed 
circuit board (PCB) consisting of stitched high-resolution images taken with an 
area-scan camera. The idea is to let the user draw on this background image 
the order of movements (commands) of the gantry robot. More detailed control of 
the robot movements has to be specified in a spreadsheet/display list of some 
sort. There will also be some commands involving machine vision for checking 
position markers (fiducials), and various sort of vision inspections. These 
commands are then saved as a program to be executed in the second part of the 
GUI.

 Those are the very basics, more fancy features that i can think of might 
include identifying components on the PCB, so as to facilitate easier teaching 
of motion commands, recognizing the PCB image so as to snap preloaded DXF/CAD 
files on top of it.

  The second part of the GUI will be the production run of the machine. The 
start-up involves downloading the program instructions to the motion controller 
that will read and execute the movements. The interface for communication may 
be an ActiveX interface or an C API depending on the choice of motion 
controller. Processes running during production run are:

1) statistical process control (SPC) logging
2) displaying the real-time camera
3) waiting on images of fiducials; on receiving it will process it and send the 
compensation values to the motion controller. This has to be done quickly as 
the motion controller will change its movement on the fly, so if the 
compensation values are received late, it is possible the new position is 
behind the gantry and force it to backtrack, which will do bad things to 
machine cycle times.

  It is also possible that the fiducial processing will be done in a smart 
camera instead of having to be done on the host environment.

TL;DR:
My biggest worry is about Racket performance or unexpected bugs when 
interfacing C libraries that come with the hardware with Racket code. Reading 
things like FFI overhead in the mailing list scares me a little also. I'm 
also a little fuzzy on the performance/details of implementing a canvas showing 
a giant high resolution image.

My understanding that Racket should be fine as a high level prototyping 
language and where performance is needed, we can drop down to C. And the 
biggest performance bottleneck in the whole application is the image processing 
speed in the library, which will come down to the image processing libraries. 
Is there anything i might have overlooked?



Current program functionality:

 You drag dxf files in the DXF folder into the main window and interact with 
the 2d drawing as follows:

ctrl drag to select elements
esc to unselect elements
click and drag to pan about
scroll up and down to zoom in/out

most other features are data processing stuff and not that interesting.

https://github.com/xtrntr/DXF-Converter/tree/one-main-window

-- 
You received this message because you are subscribed to the Google Groups 
Racket Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.