.net tips #1

need to use Linq on your Unit Test?

using System.Linq;

Inheriting from a POCO entity to reuse ? [NotMapped] class ….

goto-blog:

#Programming in movies vs. programming in real life

(via lifeandcode)

jtoprocessing:

ColorScheme version 0.0.2 ! !

I added a new feature to the ColorScheme processing library I made.
Now you can pass image files to the constructor like:

ColorScheme colorScheme = new ColorScheme("image.jpg", this);

It will generate a color scheme based on the most common colors in the image
(with a bit of randomness in there to give you some accents).

Source code

Awesome.

The Frightening Future of Digital Maps: Monica Stephens

Social networks, GIS, cartographic visualizations, and the gendered dimensions of Volunteered Geographic Information (VGI). 

keckclip:

A decision tree to choose a Machine Learning algorithm

keckclip:

A decision tree to choose a Machine Learning algorithm

"The most dangerous thought you can have as a creative person is to think you know what you’re doing."

Up, up and Away!

Everyday I have this feeling that the things in my screen, inside the chips, traveling in the clouds are looking for a better placement and we keep looking for a better approach.

(via lifeandcode)

json string dynamic read

  just to keep usual things noted.
with dummy object: string myJson = "[{id: 10, typeID: 4},{id: 100, typeID: 3}]"; var dummyObject = new[] { new { id = 0, typeID = 0 } }; var myObjects = JsonConvert.DeserializeAnonymousType(myJson, dummyObject); Console.WriteLine(myObjects[0].id);

from http://wblo.gs/cZK.


without dummy object:
using System.Collections.Generic;
...
 JavaScriptSerializer js = new JavaScriptSerializer();
 dynamic jsonResponse = js.DeserializeObject(myJson);
 Console.WriteLine(jsonResponse[0]["id"]);

un-finished

first option:

foreach (PropertyInfo prop in props) { if (typeof(DbGeometry).IsAssignableFrom(prop.PropertyType)) { object propValue = prop.GetValue(obj, null); geometry = GeometryFromDbGeometry((DbGeometry)propValue); } }

second option:

object geomPropValue = props.Where(p => typeof(DbGeometry).IsAssignableFrom(p.PropertyType)).SingleOrDefault().GetValue(obj, null);