Posts

Tiny F# EDSL for creating system / hardware IDs on Windows using WMI classes

SystemID EDSL Module: module  SystemID =      open  System      open  System.Management      type  ClassName     = string      type  PropertyKey   = string      type  PropertyValue = obj      type  IDComponent   = ClassName *  PropertyKey                 []      type  IDQueryResult = ClassName * (PropertyKey * PropertyValue)[][]      let   internal  qs (t:ClassName) (ps:PropertyKey[]) =          try   use  mos =  new  ManagementObjectSearcher( "Select "  + String.Join( "," , ps) +  " From "  + t)              let  col = mos.Get()              let  arr = Seq.toArray             seq {  for  o  in  col  do                      yield  seq {  for  p  in  o.Properties  do   yield  p.Name, p.Value } |> arr } |> arr          with  _  ->  [|[||]|]      let   internal  gs s = s|>Array.map (Array.filter ( fun  e  ->   match  e  with  k, null   ->   false  |_ ->true ))      let   internal  vs (t, ns) = t,qs t ns |> gs      let  query

Corsis Research

Image
2011 - Logo Solidity, growth, and new dimensions!

WCF 4.0 routing with MetadataExchange using System.ServiceModel.Routing.RoutingService in F#

I posted a simple question on stackoverflow.com: I have service with working MEX at: net.tcp://remotehost:4508 What is the shortest C#/F# code (hard time understanding XML configuration files ^_^") I could write to create a router to it at?: net.tcp://localhost:4508 MEX should also be routed properly so that clients can use the router svcutil net.tcp://localhost:4508 to discover service methods. and as has been usual with its users no one has been able to answer my question before I could come up with my own answer. Here's how to use F# and WCF 4.0 to route a service with NetTcp and MexTcp endpoints no XML involved, pure code: namespace CORSISmodule Application =    open System    open System.ServiceModel    open System.ServiceModel.Routing    open System.ServiceModel.Dispatcher    open System.ServiceModel.Description    let createSimpleRouter createBinding (routerAddress : string) serviceAddress =         let routerType = typeof<IReq

Words that are Hard to Say - Reverse Video Search with Mathematica and TinEye

Image
It all started with this link:  http://www.facebook.com/video/video.php?v=150827548298158 . My brother wrote to me saying he had seen this movie trailer and would like to watch it but the only link he had was of this facebook video which had no names mentioned. I had a simple idea: extract a given number of frame images use TinEye to look for pages using similar images I used Mathematica to extract the frames. Then, using TinEye, we performed a reverse image search on certain frames we picked manually. http://www.tineye.com/search/5728ec915156cc8f0568d27d5109bd9b9c79cbf9/ http://www.tineye.com/search/6a97500eef0bc33220555e02a8bd1f5500157a6e/  (here we actually got the result!! but overlooked it) http://www.tineye.com/search/b2ecfa195ca5bc2883dcc63e53e2b307d3b739a2/ http://www.tineye.com/search/02b352b008c9ff144695745a630e0c3a30d492e3/ http://www.tineye.com/search/0f748c782fc992ddd8ac5cd8b5bfec323a933048/ http://www.tineye.com/search/18c255ad6a07e6a1a3f128d2ef942393a47ae3cb/  (

Oh Dear Photoshop CS5: "Content-Aware Fill Me that Big ** Whale!"

Image
Having some fun with my new CS 5 ... it's beautiful. Bring on the next Christmas party good god! We have got kids to turn into pirates and ninja and what not ... Posted via email from CORSIS

XML Key/Value Cache Optimizations

Image
For a read-only XML file server with a simple path-based addressing scheme, I initially used ConcurrentDictionary<string, XElement> as a key/value cache. This generated and kept constantly in memory a lot of unnecessary XAttribute and XElement instances which contributed nothing to raw data transfers across the wire. Considering the fact that resident XAttribute or XElement instances in the file server process were totally useless because we do indexing and serve result paths via our query server, I switched to using path-indexed string buffers with path-to-segment dictionaries as the new key/value cache. Memory footprint for hundred documents, before/after See and download the full gallery on posterous My question on Stackoverflow.com with some code http://stackoverflow.com/questions/3613713/how-to-get-stream-positions-of-xml-elements-in-net Full working environment screenshots ^__^ See and download the full gallery on posterous Posted via email from CORSIS

ELIT Private Alpha

Image
Launching ELIT Client for private alpha testing of political and social scientists from Heidelberg and Mannheim. Posted via email from CORSIS