GCC(/Clang): Merging functions with identical instructions (COMDAT folding)

Neither GCC nor Clang is a linker, and ICF needs to be done by the linker, or at least with cooperation with the linker. Edit: They don’t do ICF, so yes, distinct instantiations produce distinct code. The GNU gold linker supports ICF with the –icf option, which needs the GCC option -ffunction-sections to be used. … Read more

How to use dom-repeat with objects instead of arrays in Polymer 1.0?

Here is a complete implementation: <test-element obj='{“a”: 1, “b”: 2, “c”: 3}’></test-element> <dom-module id=”test-element”> <template> <template is=”dom-repeat” items=”{{_toArray(obj)}}”> name: <span>{{item.name}}</span> <br> value: <span>{{item.value}}</span> <br> <hr> </template> </template> <script> Polymer({ properties: { obj: Object }, _toArray: function(obj) { return Object.keys(obj).map(function(key) { return { name: key, value: obj[key] }; }); } }); </script> </dom-module>

Razor views as email templates

You can use http://razorengine.codeplex.com/ to achieve this. It allows you to use razor outside of mvc. string Email = “Hello @Model.Name! Welcome to Razor!”; string EmailBody = Razor.Parse(Email, new { Name = “World” }); It’s simple to implement and it’s available on http://nuget.codeplex.com/ for easy integration into your projects.