|
Good morning Bill. Thanks for posting this code - it's great to see people sharing code like this. I have a couple of comments that I'd like to address.
The code sample here has a lot of shorthand in it so things like GetGPath have to be interpreted. Is there a reason why this isn't called GetGraphicsPath or just GetPath ? On that note, why have you chosen to implement Get methods over property getters? I'm just curious as to your reasoning here.
The Shp properties all feel like they should be in a separate class. Again, it feels to me like these are metadata items, rather than being intrinsic parts of the base interface. I would probably move these out into a separate metadata class and drop the Shp parts of the name.
The Union and Intersection methods also appear to be wrong, unless you are looking to determine whether this shape intersects with more than one shape - the first parameter of these methods is probably going to be the current instance so why pass it in? I would expect to see a method that looks more like this
IShape Union(IShape shape);
|
|
|
|
|
Hi Pete, i'm delighted to have feedback like this ! I'll study it carefully, and respond in more detail later.
current version calculating equally spaced points points on an ellipse: [^]
Context: currently this is very much in initial development, and, "final polishing" may address your concerns about my use of short aliases instead of longer, more mnemonic, names. For unknown reasons, my memory, at age 78, handles such short aliases without cognitive effort (just don't ask me where i left my house keys) ... and, it saves typing time
Quote: The Shp properties all feel like they should be in a separate class. Again, it feels to me like these are metadata items, rather than being intrinsic parts of the base interface. I would probably move these out into a separate metadata class and drop the Shp parts of the name. Excellent points ! As the design progresses, i may "break out" the IShape interface into component interfaces like IIdentity for ShpName, ShpComment, ShpTimeStamp (those i would call "metadata"). Right now, things like SwPoint, CenterF seem essential.
"Shp" as prefix: I often "go Hungarian" simply because when i view an object's contents at run-time when a breakpoint is hit, they appear grouped together in the alpha-ordered inspector dropdown, Same idea with public Properties i want exposed in a design-time PropertyGrid.
'Get methods instead of Property getters: somewhere along the line years ago (influenced by Richter ?), i decided to never do extensive calculations, or call external methods, in Properties (except for OnPropertyChanged). That "feels right," and, i believe that contributes to maintainability in the long run ... perhaps i should reevaluate that "habit/decision" ? Quote: The Union and Intersection methods also appear to be wrong, unless you are looking to determine whether this shape intersects with more than one shape - the first parameter of these methods is probably going to be the current instance so why pass it in? As of now, i have not implemented any "current ..." state/object facility. That is something I really like ever since my little career led me into specializing in PostScript.
My intent is to take two shape instances as input, and return a new shape which is the intersection/union of the two inputs: that syntax doesn't reflect that ?
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
I find that "super" controls that you can morph at run time (color, scale, content) are more manageable than trying to build things from lots of primitives.
You need a "focus"; e.g. military units already have many predefined shapes and derivatives. In architecture, there are door, window, etc. "patterns".
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Hey there,
My first time posting on this forum.
I've written and reformed this database a lot over the years. It was called metastrings, but that's a dumb name, and I've boiled it down to four operations, so 4db made more sense:
GitHub - michaelsballoni/4db: Simple database for high productivity and ease of use
To see how it works, check out the carsdb sample:
4db/carsdb · GitHub
I'd like to get some feedback on the general premise and the implementation. And I'm interested in contributions to make it more useful.
Thanks, -Michael
|
|
|
|
|
|
i respectfully disagree with you on the appropriateness of this post in this forum: see my comments to Michael on this thread.
cheers, Bill
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
Well Bill, I respectfully disagree with your disagreement. This forum is for questions on C#, not reviews of people's projects. And there is a perfectly adequate Database forum further down, which is still fairly active at times.
|
|
|
|
|
@chrismaunder
i do see your POV !
for me, the salient questions are:
1) if (your words) "This forum is for questions on C#" ... how does that make it any different from the C# QA forum ? why have two fora ?
2) if there's all kinds of questions that appear here that could just as well be appropriate on the C# QA forum, and that's okay, then why not tolerate other types of posts that do have some C# related content, like Michael's ?
ideally ... for me ... this would be a forum for serious discussions of C# language issues: new features; work-arounds, optimal techniques, and yes, code reviews. Questions/problems ? Yes: but, hopefully those that invite in-depth discussions and debate. Kevin Marois might have to use QA to get his code written for him
But, as i said to Honey,,,Witch on the Insider News forum recently: "i can't afford 'ideals' at my age; i have to get by living off 'values'."
And, speaking of "values:" allow me to propose that when we respond to a post like Michael's that may, indeed, be an "edge case" for content on this forum, based on perceptions that he's smart, that he's written some CP articles, that with encouragement/recognition (who doesn't want that ?) he may bring more of his knowledge and experience to CP ... that's valuable.
i call that value "collegialty."
cheers, past-his-use-by date-Bill
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
1. The two are different, and you have to go back a few years to when QA was introduced to understand why it was introduced.
2. I did not see anything related to C# in the original question.
Michael Balloni wrote: My first time posting on this forum. So why say that when he has been, as you pointed out, a contributor of many years standing? And that was why I suggested he was in the wrong place.
|
|
|
|
|
Richard MacCutchan wrote: go back a few years to when QA was introduced to understand why it was introduced. If you have time, i'd appreciate knowing your perceptions/memories of "why."Richard MacCutchan wrote: 2. I did not see anything related to C# in the original question. i interpreted this more narrowly: as meaning he had not posted in this forum before. But, i agree that his database article should have been mentioned, and that might have made the post less "ambiguous."
cheers, Bill
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
BillWoodruff wrote: perceptions/memories of "why. IIRC the idea was to attract 'quick' questions. That is to say ones that could be answered fairly easily without long discussion threads as tend to exist in the forums.
|
|
|
|
|
Hi, i'm not trying to go "legal" on you, and i am getting all i ever hoped for, and more , from CP; but, in your opinion, is it optimum to have (what i perceive as) the kind of overlap we have now ?
If i am the only one beating the gong, i'll just adjust my attitude and perceptions.
cheers, Bill
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
Well it is what Chris and the team wanted, and in some ways it works well for both questioner and responder. But the problem with an open forum is getting all the users (myself included) to follow the rules correctly.
|
|
|
|
|
... understood ... thanks !
i've been told i have a real gift for thinking up things other people should change
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
BillWoodruff wrote: a real gift for thinking up things other people should change
I think we can all do that. 
|
|
|
|
|
Hi Michael, i'm surprised you didn't mention your 2021 CP article: [^] to which i and other people responded.
imho, your GitHub site has no Wiki; the intro (.md file) is a single statement that does not effectively "advertise" what the project is about, and motivate the viewer to explore it. i suggest adding much more information for the visitor. And, aren't there ways to promote a GitHub site ?
i have no quibble with your posting this here; over the years, this forum has mutated from being a place for C# language issue discussion to being a QA forum, and tolerating whatever else walks through the door.
There is a (relatively inactive) DB forum here: [^] ... why not post there, also ?
imho, code-review and concept-review, to any real depth, are rara avis in this section of the zoo (code-monkey-house ?) That's not a complaint ! Perhaps StackExchange's Code Review forum [^] might be fertile ground for you ?
Wish I had the database experience and depth (and youth !) to evaluate your implementation, and ask intelligent questions.
cheers, Bill
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
modified 17-Oct-21 5:44am.
|
|
|
|
|
Hey Bill,
Thanks for taking the time. Sorry this is so late, I don't know why CP wasn't emailing me with y'all's responses. Just got a comment here about the general premise, tried to speak to that. Yeah, I haven't fleshed out the GitHub "sites" at all yet, was hoping to get some direction based on my question as to how this tool might best be used, and a code review is always much appreciated. I posted to the Database group, no response there. I'm porting it to C++ for fun, that's been a blast, should make for another fun article.
Cheers, -Michael
|
|
|
|
|
Hi Michael,Michael Sydney Balloni wrote: was hoping to get some direction based on my question as to how this tool might best be used i think that without more of an overview of the project, and summary details of its architecture, api's, and work-flow, its features, its limitations, etc., you may not get the responses that would be useful.
imho, JSchell's reaction, posted here, probably reflects the naturally skeptic attitude people with significant db experience will take tom such innovation.
People like me, without pro-level db experience, may compare what you are doing with Mehdi Gholam's RaptorDB here on CP: [^] a major project developed over years, with extensive performance testing/timing.
If your project has a limited range of functionality ... and, i understand what that is ... and, performance in its range of use-cases is faster, more efficient, easier to use ... that's fine with me !
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
|
Michael Sydney Balloni wrote: general premise
"A simple, easy to use, highly productive,"
My feedback is that I doubt that statement.
Mainstream databases have massive amounts of resources available to them. Productivity for the persisted data is often limited by the complexity of the requirements and how to fit that complexity into the generalities of the common persisted data solutions. However that complexity is what one allows one to craft solutions in the first place without doing a deep dive into how persisted data might solve be used to solve that.
Every 'new' persisted data store solution that I have seen introduced in the past 10 years or so has been done so to support a very specific type of data driven need and none of them are actually anything that could not at least be implemented by traditional mainstream persisted solutions (naturally one might suppose there are speed/cost differences.)
Certainly nothing in the above suggests what is the exact need that you think your solution will address? Does it attempt to replace enterprise Oracle installs? Or is it just another way to manage configuration information for a single app? Maybe it is supposed to compete with Elasticsearch because it is faster? Or something completely new that has only been identified recently by changing user driven needs?
|
|
|
|
|
Thanks for having a look, I really appreciate it.
Taking apart the premise...
- File-based is simpler than server-based.
- Four operations are easier to use than dozens.
- And something simpler and easier to use is more productive.
4db.net builds on SQLite, and provides the database functionality needed for basic applications. It's not fast, it's not sophisticated or robust, but if you only need those four statements, 4db.net is the way to go. To see what I'm talking about, check out this small cars-based sample:
4db.net/Program.cs at main · michaelsballoni/4db.net · GitHub
Imagine how much SQLite code that would take, let alone the server setup for MySQL or some other RDBMS.
Sometimes you need a yacht. But sometimes you just need a canoe. What do you think?
|
|
|
|
|
Michael Sydney Balloni wrote: Sometimes you need a yacht. But sometimes you just need a canoe. and, some people may need to understand what a paddle is, and why a canoe is a good design for a boat
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
Michael Sydney Balloni wrote: Imagine how much SQLite code that would take, let alone the server setup for MySQL or some other RDBMS.
Not sure you really understood my point though.
I work on large applications. So the amount of code and even management of the persisted store data systems is not significant because the applications are going to be large regardless.
And even midsize solutions usually have aspirations to be bigger and will likely need more functionality than provided.
So based on the requirements presented here this only works for very small systems. And for those systems any solution is probably going to be adequate.
So as I suggested before without a specifically identified niche I don't see the need for what you are suggesting.
|
|
|
|
|
Point taken. In .NET, coding directly against SQLite is easy and you get great functionality. No brainer there.
So I ported the .NET metastrings / 4db stuff to C++, where coding against the C SQLite library is a pain.
I wrote this:
4db: A Dynamic File-based NoSQL Database for C++
For a C++ programmer wanting basic record persistence and not much else, this is a good alternative to fprintf or hacking SQLite by hand. In that article, in its code, there are a couple wrapper classes for SQLite. Those might have more valuable than 4db. It's been a wild ride...
|
|
|
|
|
I have some folders having files, its count like 40Lac, 70Lac, 1Cr, 1.5cr. And filetype like .png, .xlsx, .txt, .msg, .ico, .jpg, .bmp etc...
Now i want to insert this filename into my database table with its size, but when i implement it take too much time to scanning the folder, and then after it throws memory exception.
can anyone please help me out here, how can i implement this scenario in a better manner.
how can insert faster in table ?
I am using C#.net with PostgreSQL database.
Ankur B. Patel
|
|
|
|
|