What is a good Object-Oriented design for geometry objects when building libraries dealing with geometry operations?

I am trying to design an object-oriented library to handle geometric calculations. However, I am trying to exaggerate on being “tightly” object-oriented and applying relevant “best practices”. I know that there is no reason to be dogmatic about patterns, I am just trying to squeeze out every bit of possibility that I have not found out any different way for what I am about to ask.

Consider trying to design a path, composed of segments. I consider having a common interface for segments, which offers a method to calculate points of intersection with another segment. In short, the tentative signature of such a method might look like:

abstract class Segment {     ...      Point[] Intersection(Segment other);      ... } 

However, when implementing such a method, it might be necessary to check what actual implementation lies behind the “other” Segment. This can be done through run-time type checks, given that the language supports it, otherwise, I have to use some kind of enum to differentiate between segments and, potentially, cast the object to call corresponding methods. In any case, I cannot “extract” some common interface for this kind of design.

I have considered “forcingly” establishing a base-assumption that all path segments boil down to sequences of points, and unify the algorithmic intersection process as being always a line-to-line intersection between all sub-segments, but this will rob the design of a very significant (in my opinion) optimization possibility. Considering the ubiquity and “temporal density” of geometry-based operations the library will be built to support, it is very important, in terms of performance, to take advantage of special shapes having “closed forms” to calculate intersections between them (such as a circular arc with a line), instead of testing a multitude of small line-segment pairs to identify intersection points.

Apart from that, if I make the simplifying assumption of paths consisting of path sequences, I will have to make another relatively pervasive (for such a library) design choice, that of point density, to trace, for example, the various segment types. This would be, in my opinion, a reasonably architecturally-relevant parameter when considering an end result of drawing, e.g. on-screen, in order to achieve a given level of smoothness, for example. However, I feel this is, conceptually” an unsuitable abstraction for the geometric operations between pure geometric abstractions. A circle is not a series of line segments and should not need 5,10 or 100 coordinate pairs to be represented. It is just a center and a radius.

My question is, is there any other way to be object-oriented when dealing with base classes for geometry entities, or the “usual” way of doing things is with an enumeration and implementations checking segment type and exploiting specific geometric relations to potentially optimize the procedures?

The reason I am giving so much thought on this is that I might find myself having to implement special segment types, such as, for example, parametric curves, in the future, or simply allow extension of the API outside of the API itself. If I use the enum-based, type-checked everything-with-everything intersection tests (and do so also for other spatial operations between segments besides intersection), “outsider” extensions of the API will have to “register” themselves in the segment-types enumeration, which would necessitate either changing and rebuilding the original API, or providing a mechanism for external registrations. Or simply make a true global capture of all possible segment geometric forms to account for everything.

To make it simple, assume that I implement this only with segments, and then I add a new implementation of a circular arc. I can “teach” the circular arc how to intersect itself with straight line segments (by checking the segment type for “line”, for example), but I can not “teach” the line segment how to intersect itself with arcs without going back to change the original library.

I understand that there are methods or techniques to provide all this flexibility (I could make segments register special “injected” intersection methods for specific identifiers, which would be determined by the external API extension objects, so that lines will first check whether the object they intersect with is such a “special” type, or simply make intersection methods virtual, so that the developer trying to extend my API will be able to manually “teach” all existing segment implementations how to intersect themselves with my original objects). All I am asking is, is there any other elegant way to tackle this situation?

The top-voted answer to this question suggests excluding the method entirely and delegating it to a different class. This does sound somewhat counter-intuitive, given that segments do know their geometries. However, segments do not know other segments’ geometries, so it appears to be reasonable design decision to “outsource” the intersection method, one that still necessitates knowing the segment type at run-time, however. Since I am trying to represent segments as interfaces “ignorant” of the underlying type (as in “I want to support the use of the segment interface as being ignorant of the underlying implementation”). Apart from that, I would not resort to empty marker interfaces to differentiate between classes. An external “intersector”-like class would look interesting, though I would avoid making it static, in order to allow for extensions and potential changes of strategy (different implementations, optimizing for speed, employing snapping, etc).

Content Type column shared between libraries, meta missing when document is transfered

Sorry if this is a little long winded.

So I have two Document Libraries. A “Drop Off” (Not the one from the Content Organizer Site feature, just a lib called “Drop Off”) and “Resting” library.

The site has a Content Type that is inherited from the Content Type hub. This Content Type is then extended on the site to add an additional Lookup column “Employee” this Extended Content Type is then shared between the libraries mentioned above.

In the “Drop Off”, I plug the meta data in, I.E. the “Employee” col, and once that is complete I have a 2013 Workflow that moves the document to the “Resting” library.

Now, on other sites this works just fine, no issue. On this one site I have, all the other meta data is stable across the library, but the “Employee” field does not come over.

If I manually move the file back to the Drop Off, the data is there, then if I move it back to Resting, it’s missing again. Almost as if they were really two separate columns. But I don’t think this is the case as when I pull up the Site Setting Columns in parallel, the “Employee” col indicates that it is a part of the Content Type shared betwix the libraries.

Has anyone seen this before? Advice? Questions?

Thanks in advance!

Not understanding how to include libraries in the source code [on hold]

I’m working on a music visualizer script in python. I’m using an audio library called aubio. If I upload my code on a website like Github how can I make the script available for everyone? Do I have to include the library in the code? Do I have just to explain in the readme that the library is required or adding directly the source code would be a solution? I’m really sorry for the trivial question but I’ve only worked on personal project and I don’t know the best way to make my code available to the public

Managing Pictures inside our modern team site, should we use Document libraries OR Picture libraries? and why?

we have a modern team site collection, and we want to add a library to store our company pictures such as event pictures, social pictures, etc.

now inside our modern team site, we have 2 main templates we can use:-

  1. Document library

  2. Picture Library

enter image description here

now based on my search i found that both offer these similar functionalities:-

  1. allow us to have minor/major & approval.

  2. both offer these list views rendering:-

enter image description here

  1. both templates will work with these modern web parts:-

    • document library web part

enter image description here

  • Image Gallery web part:-

enter image description here

  1. both will show a slider if we click on an image

but i found the following main differences.

Document library

  1. it is been more widely used, for example when we create a new modern team or modern communication site we will get all the built-in libraries as document libraries

enter image description here

  1. inside communication modern sites,we do not have the option to add Picture library. so can i say Picture library is somehow obsolete (at-least compared to document libraries)

Picture library

  1. the main features are that it provide some content types and columns which are beneficial for pictures such as the “Picture Size”, “Height” and “Width” , which will show the dimension of the pictures:-

enter image description here

so not sure for us should we use Picture or Document library? based on my research Picture libraries provides a ready-made content types for pictures, but document libraries seem to be more widely used, keeping in mind that modern communication sites does not provide (by default) the option to add Picture libraries. finally i want to avoid adding a document library and add the picture content types to them. i am trying to compare the built-in Picture and Document libraries.

Thanks in advance for any help.

Merge multiple document libraries into one

I need some help to solve a problem. I do not know how to move forward from here.

We have about 15-20 different document libraries where different departments submit their projects/files. Then we have a management team who wants to see the progress of all projects/files without having to go into each department.

Is there any good solution to merge all libraries into a single librarie? Or somehow present the data.

one workflow for all libraries in a site

I have requirement, in which I have to make workflow to Shot an email and change rights of document based on a master list exist in the site itself.

Now the concern is I have to build a mechanism that whenever a new document library got added in the that site and any document added or updated with in it or any existing library. The workflow should trigger as per the process stated in the master list.

I have no experience with workflow but I am thinking to add Document Library named column in that master list and then read the master list on the trigger of workflow and then workflow will act accordingly

Now I have three queries here

  1. Is it the right approach !!

  2. How to trigger the workflow on add/update of document in any existing and new document library in the site

  3. Can SharePoint Designer workflow change the right/permission of the document with the sub folders (any level) of a document library

FYI.. it on SharePoint Online

siesta: error while loading shared libraries: libnetcdff.so.6: cannot open shared object file: No such file or directory in centos 7

Finally i successfully compliled the 4.1.b4 version of siesta .when i run siesta , the error occurred and the information was shown as follows

siesta: error while loading shared libraries: libnetcdff.so.6: cannot open shared object file: No such file or directory

i have attatched my arch.make file and wish someone can help me

thanks a lot Pooja

arch.make file Copyright (C) 1996-2016 The SIESTA group

This file is distributed under the terms of the

GNU General Public License: see COPYING in the top directory

or http://www.gnu.org/copyleft/gpl.txt.

See Docs/Contributors.txt for a list of contributors.



arch.make file for gfortran compiler.

To use this arch.make file you should rename it to


or make a sym-link.

For an explanation of the flags see DOCUMENTED-TEMPLATE.make

.SUFFIXES: .SUFFIXES: .f .F .o .c .a .f90 .F90

SIESTA_ARCH = unknown

CC = gcc FPP = $ (FC) -E -P -x c FC = gfortran FC_SERIAL = gfortran

FFLAGS = -O2 -fPIC -ftree-vectorize

AR = ar RANLIB = ranlib

SYS = nag



COMP_LIBS = libsiestaLAPACK.a libsiestaBLAS.a



Dependency rules ———

FFLAGS_DEBUG = -g -O1 # your appropriate flags here…

The atom.f code is very vulnerable. Particularly the Intel compiler

will make an erroneous compilation of atom.f with high optimization


atom.o: atom.F $ (FC) -c $ (FFLAGS_DEBUG) $ (INCFLAGS) $ (FPPFLAGS) $ (FPPFLAGS_fixed_F) $ <

.c.o: $ (CC) -c $ (CFLAGS) $ (INCFLAGS) $ (CPPFLAGS) $ < .F.o: $ (FC) -c $ (FFLAGS) $ (INCFLAGS) $ (FPPFLAGS) $ (FPPFLAGS_fixed_F) $ < .F90.o: $ (FC) -c $ (FFLAGS) $ (INCFLAGS) $ (FPPFLAGS) $ (FPPFLAGS_free_F90) $ < .f.o: $ (FC) -c $ (FFLAGS) $ (INCFLAGS) $ (FCFLAGS_fixed_f) $ < .f90.o: $ (FC) -c $ (FFLAGS) $ (INCFLAGS) $ (FCFLAGS_free_f90) $ <

Extract list of SharePoint lists and libraries

i am using below code the extract all lists and libraries under a site collection . However i need to get the lists and libraries URL too. all other properties return coorect information except URL, its just empty!! Can you please help?

(get-spsite -identity http://uatsp11/sites/harristest).allwebs.lists | select title, URL , LastItemModifiedDate, itemcount | Expo-Csv -Path C:\temp.csv