我想分析一下图片的颜色.是否可以将OpenCV库与F#(我熟悉的唯一语言)一起使用.如果是的话,你知道我在哪里可以找到关于这个主题的教程/书籍(OpenCV 2 Computer Vision看起来很棒但是是为C++用户编写的).
我想用C#中的字符串空格替换字符.但是在编写函数时我遇到了一个问题:
myString.Replace("""," ")
Run Code Online (Sandbox Code Playgroud)
第一个论点似乎是一个问题.任何的想法
我编写了一个代码来使用F#执行一些基本的矩阵计算.我想知道这段代码是否有一些可能的改进,以减少计算时间.实际上,所执行的操作是非常基本的(主要是2个矩阵的乘法和转置),但是矩阵的大小很高(大约10000 * 100000)导致巨大的计算持续时间(几个小时).
我的问题/评论如下:
这是算法:
// I use the #time function to calculate the calculation duration of the algorithm
#time
#r "Microsoft.Office.Interop.Excel"
#r "FSharp.PowerPack.dll"
open System
open System.IO
open Microsoft.FSharp.Math
open System.Collections.Generic
// Algorithm
let matrixCalculation (matA : matrix) (matB : matrix) (matC : matrix) =
// First step : Renamed the matrix A and B size to initialize the matrix "matrixCalcul"
let nbrOfElementsA = matA.NumRows
let nbrOfElementsB = matB.NumRows
let nbrOfCaracteristicsA = matA.NumCols
let nbrOfCaracteristicsB …Run Code Online (Sandbox Code Playgroud) 您想知道如何使f#编译器自动打开命名空间.
我有
namespace XXX
I have to add something here do(AutoOpen("XXX.YYY")) or something like that to make the XXX.YYY module to be opened when referencing the library from external projects.
[<AutoOpen>]
module YYY =
....
Run Code Online (Sandbox Code Playgroud)
谢谢
我想将一个SQL表(比如i.2列:一个包含用户ID,一个包含用户年龄和ii.n行)转移到F#矩阵(相同维度)中.我设法使用以下F#代码,但我确信这不是最有效的方法.
实际上,我发现维度化F#矩阵的唯一方法是使用MySQL创建2个具有单个值(行数和列数)的表,并将这些值传输到F#中.
是否可以使用F#代码将mySQL表导入F#矩阵,该代码"识别"矩阵的维度.基本上我想要一个以表地址作为参数并返回矩阵的函数.
这是我的代码:
#r "FSharp.PowerPack.dll"
#r "Microsoft.Office.Interop.Excel"
open System
open System.Data
open System.Data.SqlClient
open Microsoft.Office.Interop
open Microsoft.FSharp.Math
open System.Collections.Generic
//Need of three types : User, number of rows and number of columns
type user = {
ID : int;
Age : int;}
type nbrRows = {NbreL : int ;}
type nbrCol = {NbreC : int ;}
// I. Import the SQL data into F#
// I.1. Import the number of rows of the table into F#
let NbrRows = …Run Code Online (Sandbox Code Playgroud) 我想将大量数据从F#传输到SQL表.基本上我的F#代码创建了一个包含三列(UserID, ProductID and price)和N行的矩阵.我想"复制/掌握它"到数据库中我尝试了几个选项,但最后,从F#传输数据真的很慢(10000行左右大约一小时).
感谢前一个问题的答案如何在F#中包含存储过程,解决此问题的一个有趣方法是使用SqlBulkCopy.
SqlBulkCopy需要一个数据库类型的WritetoServer方法,但我没有找到任何现有的代码或简单的方法将矩阵转换为数据库.你有什么建议或想法吗?
我已经下载了一个excel文件,其中特定的法语字符如é出现?(其他特定字符是可管理的).当我使用excel替换功能替换?使用é,我文件中的所有字符都变为é.?是通用的,匹配所有字符.
无论如何我都没有发现这样做.你有什么主意吗?
f# ×6
matrix ×2
c# ×1
excel ×1
module ×1
mysql ×1
namespaces ×1
opencv ×1
sql ×1
sqlbulkcopy ×1