我必须放弃Visio 2013中的遗留ERD图吗?(Must I abandon legacy ERD diagrams in Visio 2013?)
我有几个ERD图,我一直在Visio中维护几个版本。 它们并不是真正的大,但如果我不得不从头开始重新创建,它们将比我想投入更多的努力。 制作拼写错误的可能性非常高。
Visio 2013不支持编辑这些文档。 有没有办法将Visio 2010版本的ERD转换为Visio 2013允许我编辑的内容?
I have several ERD diagrams that I have been maintaining in Visio for several versions. They are not real big but would represent more effort than I want to invest if I had to recreate them from scratch. The potential of making typos is pretty high.
Visio 2013 doesn't support editing these documents. Is there a way I can convert the Visio 2010 version of the ERD to something that Visio 2013 will allow me to edit?
原文:https://stackoverflow.com/questions/19082412
最满意答案
为您的要求做
if (InSet(value)(GetValue1(), GetValue2(), GetValue3())) { // Do something here... }
尝试这个:
template <typename T> class InSetHelper { const T &Value; void operator=(const InSetHelper &); public: InSetHelper(const T &value) : Value(value) {} template<class Other, class Another> bool operator()(const Other &value1, const Another &value2) const { return Value == value1 || Value == value2; } template<class Other, class Another, class AThird> bool operator()(const Other &value1, const Another &value2, const AThird &value3) const { return Value == value1 || Value == value2 || Value == value3; } }; template <typename T> InSetHelper<T> InSet(const T &value) { return InSetHelper<T>(value); }
不过这个语法可能更清晰:
if (MakeSet(GetValue1(), GetValue2(), GetValue3()).Contains(value)) { // Do something here... } template <typename T, typename U, typename V> class Set3 { const T& V1; const U& V2; const V& V3; void operator=(const Set3 &); public: Set3(const T &v1, const U &v2, const V &v3) : V1(v1), V2(v2), V3(v3) {} template <typename W> bool Contains(const W ∓v) const { return V1 == v || V2 == v || V3 == v; } }; template <typename T, typename U> class Set2 { // as above }; template <typename T, typename U, typename V> Set3<T, U, V> MakeSet(const T &v1, const U &v2, const V &v3) { return Set3<T, U, V>(v1, v2, v3); } template <typename T, typename U> Set3<T, U> MakeSet(const T &v1, const U &v23) { return Set3<T, U, V>(v1, v2); }
如果这些值真的是树或链表的一部分,那么你已经有了你的集合/容器,而你最好的选择就是使用一些递归:
parent.ThisOrDescendantHasValue(value);
您只需将它添加到属于父类和子类的任何类别中:
class Node { public: Value GetValue(); Node *GetChild(); bool ThisOrDescendantHasValue(const Value &value) { return GetValue() == value || (GetChild() && GetChild->ThisOrDescendantHasValue(value)); } };
For your request to do
if (InSet(value)(GetValue1(), GetValue2(), GetValue3())) { // Do something here... }
Try this:
template <typename T> class InSetHelper { const T &Value; void operator=(const InSetHelper &); public: InSetHelper(const T &value) : Value(value) {} template<class Other, class Another> bool operator()(const Other &value1, const Another &value2) const { return Value == value1 || Value == value2; } template<class Other, class Another, class AThird> bool operator()(const Other &value1, const Another &value2, const AThird &value3) const { return Value == value1 || Value == value2 || Value == value3; } }; template <typename T> InSetHelper<T> InSet(const T &value) { return InSetHelper<T>(value); }
This syntax might be more clear though:
if (MakeSet(GetValue1(), GetValue2(), GetValue3()).Contains(value)) { // Do something here... } template <typename T, typename U, typename V> class Set3 { const T& V1; const U& V2; const V& V3; void operator=(const Set3 &); public: Set3(const T &v1, const U &v2, const V &v3) : V1(v1), V2(v2), V3(v3) {} template <typename W> bool Contains(const W &v) const { return V1 == v || V2 == v || V3 == v; } }; template <typename T, typename U> class Set2 { // as above }; template <typename T, typename U, typename V> Set3<T, U, V> MakeSet(const T &v1, const U &v2, const V &v3) { return Set3<T, U, V>(v1, v2, v3); } template <typename T, typename U> Set3<T, U> MakeSet(const T &v1, const U &v23) { return Set3<T, U, V>(v1, v2); }
If those values are really part of a tree or a linked list, then you have your set/container already, and your best bet is to just use some recursion:
parent.ThisOrDescendantHasValue(value);
You'd just add this to whatever class parent and child belong to:
class Node { public: Value GetValue(); Node *GetChild(); bool ThisOrDescendantHasValue(const Value &value) { return GetValue() == value || (GetChild() && GetChild->ThisOrDescendantHasValue(value)); } };
相关问答
更多-
TCP/IP模型是一个________。[2023-05-19]
a -
假设student::name是一个char数组或一个指向char的指针,如下表达式 sName==Student.name 将char char[28] sName衰减到char*之后比较指向char指针。 鉴于你想比较这些数组中的字符串容器,一个简单的选择是将名称读入std::string并使用bool operator== : #include
// for std::string std::string sName; .... if (sName==Student.name) ... -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
比较C#中的double值(Comparing double values in C#)[2022-08-25]
这是一个标准问题,因为计算机如何存储浮点值。 在这里搜索“浮点问题”,你会发现大量的信息。 简而言之,浮点/双精度不能精确地存储0.1。 它永远是一点点。 您可以尝试使用以十进制格式存储数字的decimal类型。 因此,0.1将精确表示。 你想知道原因: 浮动/双倍存储为二进制分数,而不是十进制分数。 为了显示: 12.34十进制格式(我们用的)是指1 * 10 1 + 2 * 10 0 + 3 * 10 -1 + 4 * 10 -2 。 计算机以相同的方式存储浮点数,除了使用基数2:10.01表示1 * ... -
比较C#中的数组值(Comparing values of arrays in C#)[2023-09-02]
不是100%肯定你的代码,但可能: var equal = responses.SequenceEqual(Person.PersonDetails.Select(PD => PD.correct); Not 100% sure of your code, but maybe: var equal = responses.SequenceEqual(Person.PersonDetails.Select(PD => PD.correct); -
比较DataGridView值(Comparing DataGridView values)[2022-05-09]
使用RowEnter事件: private void DataGridView1_RowEnter(object sender,DataGridViewCellEventArgs e) { btnUpdate.Enabled=!DataGridView1.Rows[e.RowIndex].Cells[10].Value.ToString().Equals("Completed") ; } 也许,在填充gridview之后需要以下内容(我不记得在初始化时是否引发了RowEnter事件)。 btnUp ... -
如何在c ++ / java中生成一组遵循某种分布的值?(How to generate a set of values that follow certain distribution in c++/java?)[2022-10-27]
我不直接从pdf知道,但你可以将pdf转换为cdf(通过积分),然后使用逆变换采样 。 这假设您有一种技术可以在[0, 1]生成随机数u (例如Java中的Math.random() )。 一旦你生成了这样的u ,找到一个x使得cdf(x) = u 。 那个x是你想要的值。 I don't know about directly from a pdf, but you can convert a pdf to a cdf (by integrating) and then use inverse trans ... -
可以尝试DataRelation类。 它在DataSet中的两个DataTable之间创建外键/连接。 using System.Data; using System.Text; public int GetMatches(DataTable table1, DataTable table2) { DataSet set = new DataSet(); //wrap the tables in a DataSet. set.Tables.Add(table1); set ...
-
比较C中的double值(comparing double values in C)[2021-10-05]
不,这不行。 类型转换运算符的优先级高于乘法运算符。 这意味着A[i]和B[i]在被乘以1e7之前将被转换为整数(并被截断)。 2.25和2.5将最终等于你的代码。 你可以通过将乘法放在圆括号中来解决这个问题: (int)(A[i]*k) 此外,由于您依赖截断而不是四舍五入,最终可能会得到不正确的结果(取决于您的期望)。 1.0e-7和1.9e-7将相等( 1 == 1 ),而1.9e-7和2.1e-7不会( 1 != 2 )。 我建议找到一个功能,可以根据您的行为进行适当的调整。 此外,您的比较不处理有效 ... -
为您的要求做 if (InSet(value)(GetValue1(), GetValue2(), GetValue3())) { // Do something here... } 尝试这个: template
class InSetHelper { const T &Value; void operator=(const InSetHelper &); public: InSetHelper(const T &value) : Value( ...