Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Documents created by PTC staff don't allow for comments - so this is an attempt to comment on a recent document posted.
The file recently posted by Brent Edmonds (http://communities.ptc.com/docs/DOC-4875) contains two routines, gen_cplusplus() and WRITEFILE().
The first one takes a matrix consisting of numbers (no error checking) and creates a vector of strings similar to what you would type if you define and initialize an array in C(++). And this routine has some flaws in my opinion.
The second routine is, as is also stated in the enclosed word doc, the real gem. Its courtesy by Magnus Eklund from PTC and writes a matrix with arbitrary elements to a file and if a matrix element is a string it is written without the double quotes. Its sure a valuable utility routine for the collection.
Nevertheless some comments to this second routine first:
Concerning the gen_cplusplus() routine, its a fairly basic one and somewhat long with a lot of if's for its purpose
Find attached as simpler and bit more complete replacement for gen_cplusplus(), I called it mat2CPP() (also without error checking).
But as the goal is just the creation of the file an all-in-one routine like the attached WriteCPP() should do the job pretty well.
P.S.: @ptc: Does it really makes sense to make a single document with just one small, very special utility? Wouldn't it make more sense to create a collection of 20 or more of such small routines in one file. Looks to me like pretending the existence of lot of content and that shouldn't be necessary.
Werner,
I did not export the array declaration thinking this would make it easy to go to JAVA and not too big a stretch for FORTRAN. I need to use str2vec more, thanks for your example.
Regarding your comment "looks like pretending the exisitence of a lot of content". .. well we have come to expect these comments from you. We will continue to post utilities customers find useful and just expect to hear from you.
John
John T. Sheehan wrote:
. .. well we have come to expect these comments from you.
John
This attack is unprofessional and uncalled for.
It was not meant as an attack Fred. Simply a statement of our readiness and our plans to continue to post
John T. Sheehan wrote:
It was not meant as an attack
Glad to hear. But then, you could have commented on the question about the comma to point replacement or the bug(?) with the usage of an undefined variable. You decided to pick my concerns about the inflationary posting of single 10-liners in the same manner as multi-page complex utility calculation sheets (and I won't ramble about the sloppily converted old tutorial sheets again).
Let me say and be assured that at no time I seriously thought that PTC would alter its marketing strategy just because of my concerns.
This attack is unprofessional and uncalled for.
Well Fred, I live long enough to have made the experience that not all people are alike. Not all are well eductaed, well mannered and able to deal with criticism. But I agree that showing bad manners if one appears as representative of a company, thats not professional.
John had shown his rough manners already in the past - at least thats what I feel about, when a customers concerns are shirtsleeved dismissed as "rubbish" (http://communities.ptc.com/message/219983#219983)
But after all, as John wrote, it wasn't an attack at all.
Easy, folks, easy. This is beginning to have a faint odor of escalation, and that never ends well for either party.
I don't think anyone (even PTC, with the exception of their marketing department) would dispute that there are many long term users of Mathcad that are very frustrated with the slow progression of Prime (which includes, but is not limited to, the inadequacies of Prime itself, destruction of much of the old forum content, the destruction of the Mathsoft library, and the rewriting of Mathcad's history on Wikipedia). I could claim that I'm not one of them, but then I would have a nose about 400ft long . But I suspect some old Mathsoft employees perhaps are also frustrated, and some comments on the forum just rub it in. I'm not saying I know that, just that I suspect it. Unlike us, any such employee is not in a position to vent publicly, unless they want to be "sent to greener pastures". As a number already have
Well spoken. I'm not interested in a flame war anyway 😉
The beauty of Wikipedia - it's all there, recorded in the history.
It's too bad when there is a fundamental conflict for direction in a company, especially when due to acquisition. Often the aquiring company has little clue or interest in what the core of the acquired company valued and made it worth buying in the first place.
Time Warner bought Atari because of the sharp increase in home video games, then ignored the core of the company who pointed out that the trend was not limitless. They left to develop the Amiga computer, a multitasking OS with an integrated GPU. Soon after, the video game market collapsed leaving TW with little. Commodore eventually bought Amiga to get an advantage and promptly did everything wrong that Amiga had done right. Dead Amiga. Dead Commodore.
Schlumberger bought Applicon (CAD) and MDSI (an NC company) and forced them to integrate. Both gone.
I recall a Schlumberger/Applicon tech rep becoming really unhappy at a meeting. He wanted to know what features I was interested in and I mentioned I liked the recently announced Pro/Engineer. He came unglued. The sales rep calmly held him back and mentioned that this was a common request.
Yup. It's a bad sign when the tech reps get angry with users. Too bad it's usually someone who really cares for the product and are prevented from making it better or are forced to make it worse.
Thanks for this routine! I wasn't aware we could use this combination of str2vec and WRITEBIN to get rid of the double quotes.
As an asisde, I also consider John's remark on a rather constructive posting as absolutely out of place, unnecessary and inapprehensible.
Leopold Turek wrote:
Thanks for this routine! I wasn't aware we could use this combination of str2vec and WRITEBIN to get rid of the double quotes.
Not my baby - the idea of doing it that way is from the WRITEFILE() routine in the referenced file posted by Brent Edmonds. The routine was said to be courtesy of PTC staff member Magnus Eklund.