Search Results

Search found 2 results on 1 pages for 'dharmatech'.

Page 1/1 | 1 

  • Rewriting UNIX cal(1)

    - by dharmatech
    Hello, Today I was testing out SRFI 19 and wrote a simple version of the UNIX cal(1) command. Here's a version in R6RS Scheme which runs in Ikarus and Ypsilon. A few example runs. Schemers: How would you write it? Use your favorite implementation. Ruby and Python: I'm guessing that y'all have elegant date and time libraries. I'm sure you can put the Schemers to shame. ;-) Let's see what ya got. I'd also like to see Haskell and golfed versions. Is there a Stack Overflow tag for re-implementations of UNIX commands? :-) Ed

    Read the article

  • A rectangle drawn with DrawingContext.DrawRectangle blocks mouse

    - by dharmatech
    The WPF program below puts up a window which looks like this: Mouse-movement outside the black square causes the window title to be updated with the mouse's position. The updating stops when the mouse enters the square. I'd like for MouseMove to continue to trigger even when the mouse is over the square. Is there a way to do this? using System.Windows; using System.Windows.Controls; using System.Windows.Media; namespace Wpf_Particle_Demo { class DrawingVisualElement : FrameworkElement { public DrawingVisual visual; public DrawingVisualElement() { visual = new DrawingVisual(); } protected override int VisualChildrenCount { get { return 1; } } protected override Visual GetVisualChild(int index) { return visual; } } public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); var canvas = new Canvas(); Content = canvas; var element = new DrawingVisualElement(); canvas.Children.Add(element); CompositionTarget.Rendering += (s, e) => { using (var dc = element.visual.RenderOpen()) dc.DrawRectangle(Brushes.Black, null, new Rect(0, 0, 50, 50)); }; MouseMove += (s, e) => Title = e.GetPosition(canvas).ToString(); } } }

    Read the article

1