How to marshal multi-dimensional arrays

By this discription about Blittable and Non-Blittable Types in the link below you could try the System.Double in place of float, because they do not require conversion when they are passed between managed and unmanaged code wich means no more special handling by the interop marshaler with a plus in performance: https://msdn.microsoft.com/en-us/library/75dwhxf7%28v=vs.110%29.aspx I did a … Read more

Why does the power operator in F# only work for floating point numbers?

(**) and pown are two different things. When you see (**), you can think of the mathematical formula using logarithms. When you see pown, it’s just a series of multiplications. I understand it can be surprising/confusing at first, because most other languages don’t make such a difference (mainly because integers are often implicitly converted to … Read more

What is the F# language created to accomplish?

What is the F# language created to accomplish? The F# research project sought to create a variant of the OCaml language running on top of the .Net platform. A related project at MSR Cambridge, SML.NET, did the same for Standard ML. (OCaml and Standard ML are both variants of the ML language.) The motivations for … Read more

What are advantages and disadvantages of “point free” style in functional programming?

The point-free style is considered by some author as the ultimate functional programming style. To put things simply, a function of type t1 -> t2 describes a transformation from one element of type t1 into another element of type t2. The idea is that “pointful” functions (written using variables) emphasize elements (when you write \x … Read more

Pattern matching on the beginning of a string in f#

Parameterized active patterns to the rescue! let (|Prefix|_|) (p:string) (s:string) = if s.StartsWith(p) then Some(s.Substring(p.Length)) else None match “Hello world” with | Prefix “The” rest -> printfn “Started with ‘The’, rest is %s” rest | Prefix “Hello” rest -> printfn “Started with ‘Hello’, rest is %s” rest | _ -> printfn “neither”

Does (or will) C# include features for side-effects verification? [closed]

C# the language isn’t, but .NET the framework may be. The Contracts library + the static analysis tools being introduced in .NET 4 might introduce these: Microsoft is using [Immutable] and [Pure] inside .NET 3.5 framework right now. For example, see [Microsoft.Contracts.Immutable] and [Microsoft.Contracts.Pure] inside .NET 3.5, in the System.Core.dll. Unfortunately, they’re internal. However, Microsoft.Contracts.* … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)