Code Monkey home page Code Monkey logo

seansoutbox's Issues

Aconcagua: Allow unit creation from derived units

Problem

When creating a chain of derived units, things can get sloppy. With milliseconds as the BaseUnit, we have:
Derived Factor
second 1000
minute 60 * 1000
hour 60 * 60 * 1000
day 24 * 60 * 60 * 1000

Solution

Allow proportional units to be constructed from either a BaseUnit, or another proportional unit with the same base unit as the new unit. Now we can think more intuitively:
Unit Factor
millisecond
second 1000
minute 60
hour 60
day 24

NB:

  • the same objects are created in both scenarios; now some of the complication is simply hidden, offloaded to the constructor
  • #baseUnit:conversionFactor:nameForOne:nameForMany:sign: is now a bit misleading, but since it's so central to the API I didn't want to change it
  • it might be extendable to non-proportional units too, but I've never used them

Ghost: Import Marea Proxies

From http://forum.world.st/Proxies-Subclassing-nil-tp4816443p4816618.html:
something that would be super super cool is to take the proxies I implemented for Marea and adapt them as custom Ghost proxies. Because the idea of Ghost was mostly the design, not the code itself. The code was very very little. So in Marea proxies you can see how I:

  1. Created a few different proxies for different purposes. For example, I created special proxies for classes and metaclasses. And each of them implements custom messages to avoid unnecessary interception (for example, MARMetaclassProxy implements #isMeta answering true. Both, proxy for Class and Metaclass implement:
isKindOf: aClass
    ^ (aClass == Class) 
        ifTrue: [ true ]
        ifFalse: [ super isKindOf: aClass  ] "would be intercepted"

and so on....

So basically....you are able to implement custom proxies and implement custom messages so that you avoid intercepting them.

  1. In Marea, I have multiple proxies that store the information differently. So for example, Marea proxies needed a graph id and a "position" (an integer). If both were small enough, I was doing a bitShift and storing them in a super compact proxy class that would have only one small integer.

So....what I want to say is that while ghost code is OK, the most interesting usage and development of those proxies is in Marea, in the category 'Marea-Proxies'.

Magritte: Revisit design

The dual Morphic/Seaside rendering seems to be the exact use case for multiple visitors, but instead we have two totally separate class hierarchies, making 3 classes per description type.

Magritte: Live Updating

Default to NullUpdatingStrategy, and how about #announcerClass: sets AnnouncementStrategy?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.