Coder Social home page Coder Social logo

Comments (3)

pschmied avatar pschmied commented on August 27, 2024

Just as a thought exercise, imagine a zone system where zones all have
names: ["curly", "moe", "larry"]. The index itself would be a simple
relation:
[("curly", 0),
("moe", 1),
("larry", 2)]

In our 3x3 example, mat["curly"]["larry"] would return the value at
position (0,2). This seems good.

Now, this is where things start to break down. Imagine an index where the
"name" is a integer:
[(1,0),
(2,1),
(3,2)]

mat[0,0] == out of bounds. Ouch.
mat[3,1] == position (2,0). Double ouch.

So, on the one hand, not being prescriptive about zone names seems good. On
the other hand, the temptation for users to name their zones in a patently
confusing off-by-one sort of way seems... bad.

Other thoughts?

On Wed, Jul 31, 2013 at 12:04 PM, Billy Charlton
[email protected]:

Cube, Transcad, and Emme all use zone numbers that are 1-based, which is a
huge pain in the ass.

How do we want to deal with this? A flag? Ignore it and leave it to the
user?

β€”
Reply to this email directly or view it on GitHubhttps://github.com//issues/4
.

from omx.

pschmied avatar pschmied commented on August 27, 2024

Oops, that last example is wrong. Should have written mat[0][0]. Y'all knew
what I meant :-)

On Wed, Jul 31, 2013 at 12:22 PM, Peter Schmiedeskamp <[email protected]

wrote:

Just as a thought exercise, imagine a zone system where zones all have
names: ["curly", "moe", "larry"]. The index itself would be a simple
relation:
[("curly", 0),
("moe", 1),
("larry", 2)]

In our 3x3 example, mat["curly"]["larry"] would return the value at
position (0,2). This seems good.

Now, this is where things start to break down. Imagine an index where the
"name" is a integer:
[(1,0),
(2,1),
(3,2)]

mat[0,0] == out of bounds. Ouch.
mat[3,1] == position (2,0). Double ouch.

So, on the one hand, not being prescriptive about zone names seems good.
On the other hand, the temptation for users to name their zones in a
patently confusing off-by-one sort of way seems... bad.

Other thoughts?

On Wed, Jul 31, 2013 at 12:04 PM, Billy Charlton <[email protected]

wrote:

Cube, Transcad, and Emme all use zone numbers that are 1-based, which is
a huge pain in the ass.

How do we want to deal with this? A flag? Ignore it and leave it to the
user?

β€”
Reply to this email directly or view it on GitHubhttps://github.com//issues/4
.

from omx.

billyc avatar billyc commented on August 27, 2024

The new Mapping API handles the case where you have an equivalency list which maps row/column offsets to an index value (e.g. zone number).

I've also hacked ViTables to show the mapping as the row/column header, if one and only one mapping exists.

So maybe this covers the most basic cases.

from omx.

Related Issues (20)

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.