Code Red > .NET

AttSync for .Net

<< < (2/6) > >>

Andrey:
I have deleted all nested objects of transactions (to find an error) from the method code.
Now the object of transaction is transferred through method parameter.

Andrey:
About everything, the code it is possible to test the item of the item further - all found out bugs are corrected. In the code source I have commented out problem lines and have specified, they caused which problems:

--- Quote ---Lines 90, 94 128 and 132 Forced down positioning of attribute GGG
Lines 100 and 138 Caused collapse AutoCAD at pushing Ctrl + Z
--- End quote ---

Andrey:
2 kaefer
I have just now understood yours F#-code about alignment assignment. :) I have made the correction to the source code. Now alignment too correctly works.

Thank you!

kaefer:
I couldn't stop playing with this little toy. Thank you, Andrey!

Attached you will a version based most faithfully on yours, demonstrating
1) attributes with non-unique tags,
2) property transfer via Reflection, and
3) Keywords to allow selection of boolean command options.

One additional minor change in an area where the original ATTSYNC may fail too is checking for erased ObjectIds when collecting the definitions.

Using KeyValuePair as a poor man's Tuple, I tried to harness the full power of Linq's Join() method:

--- Code: ---        // Extension for set intersection based on unique keys
        static IEnumerable<KeyValuePair<S, T>> IntersectByKey<S, T>(this IEnumerable<KVP<S>> s, IEnumerable<KVP<T>> other)
        {
            return s.Join(other, x => x.Key, x => x.Key, (x, y) => new KeyValuePair<S, T>(x.Value, y.Value));
        }
        // Extension for set difference based on unique keys
        static IEnumerable<S> DifferenceByKey<S, T>(this IEnumerable<KVP<S>> s, IEnumerable<KVP<T>> other)
        {
            return s.Where(ik => !other.Any(jk => jk.Key.Equals(ik.Key))).Select(ik => ik.Value);
        }
        ...
    }
    struct KVP<T>
    {
        public KeyValuePair<int, string> Key;
        public T Value;
    }

--- End code ---

Zip is attached.

Andrey:

--- Quote from: kaefer on October 12, 2011, 02:03:45 am ---I couldn't stop playing with this little toy. Thank you, Andrey!

Attached you will a version based most faithfully on yours, demonstrating
1) attributes with non-unique tags,
2) property transfer via Reflection, and
3) Keywords to allow selection of boolean command options.

One additional minor change in an area where the original ATTSYNC may fail too is checking for erased ObjectIds when collecting the definitions.

Using KeyValuePair as a poor man's Tuple, I tried to harness the full power of Linq's Join() method:

--- Code: ---        // Extension for set intersection based on unique keys
        static IEnumerable<KeyValuePair<S, T>> IntersectByKey<S, T>(this IEnumerable<KVP<S>> s, IEnumerable<KVP<T>> other)
        {
            return s.Join(other, x => x.Key, x => x.Key, (x, y) => new KeyValuePair<S, T>(x.Value, y.Value));
        }
        // Extension for set difference based on unique keys
        static IEnumerable<S> DifferenceByKey<S, T>(this IEnumerable<KVP<S>> s, IEnumerable<KVP<T>> other)
        {
            return s.Where(ik => !other.Any(jk => jk.Key.Equals(ik.Key))).Select(ik => ik.Value);
        }
        ...
    }
    struct KVP<T>
    {
        public KeyValuePair<int, string> Key;
        public T Value;
    }

--- End code ---

Zip is attached.

--- End quote ---
Reflection usage negatively influences speed of operation. If the volume of the processed information a bycicle - productivity falling is notable.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version