mono

Directory.GetCurrentDirectory() not working on linux?

拜拜、爱过 提交于 2021-02-07 12:32:06
问题 So I'm trying to create an application that requires the reading of scripts in a sub-folder called "scripts". My code I'm having issues with: string script = Console.ReadLine(); string path = Directory.GetCurrentDirectory(); string sciptpath = path + "/scripts/" + script; This works fine on Windows. But on Linux (running using Mono Runtime) it goes to the current users home Directory...not the directory of the executable. Is this a bug? And can someone suggest a workaround? 回答1: It's not that

Problems with recursive generic type in c#

这一生的挚爱 提交于 2021-02-06 15:24:10
问题 I've got some C# code that compiles fine under both mono and the Microsoft's .net compilers, but only runs on mono. The error message is (newlines added by me) Unhandled Exception: System.TypeLoadException: Could not load type 'Hasse.Groups.Heavy.Product.PowerGroup`1' from assembly 'Hasse, Version=1.0.x.y, Culture=neutral, PublicKeyToken=null' because it has recursive generic definition. The type actually has a recursive generic definition, so my question is: why does it work with mono? [The

Problems with recursive generic type in c#

纵饮孤独 提交于 2021-02-06 15:21:10
问题 I've got some C# code that compiles fine under both mono and the Microsoft's .net compilers, but only runs on mono. The error message is (newlines added by me) Unhandled Exception: System.TypeLoadException: Could not load type 'Hasse.Groups.Heavy.Product.PowerGroup`1' from assembly 'Hasse, Version=1.0.x.y, Culture=neutral, PublicKeyToken=null' because it has recursive generic definition. The type actually has a recursive generic definition, so my question is: why does it work with mono? [The

100万“音乐难民”陪伴虾米到最后一刻

落爺英雄遲暮 提交于 2021-02-06 10:32:49
来源|刺猬公社 编辑| 语境 可一 欧阳 为孤独的灵魂建造一个乌托邦,然后让他们“无家可归”。 2月5日零点,是虾米音乐原定停止服务的时间。 微信群“拥抱虾米”的公告栏提前发布了活动公告,约定从晚上8点在虾米音乐直播间“趴间”开趴“虾米星球的最后一夜”, 邀请虾米用户共同相聚取暖,在下沉的世界里做最后狂欢。 零点过后,他们准备带上话题标签“陪伴虾米直到最后一刻”,分享自己在虾米听的最多一首音乐,这是他们能为虾米做的最后“追悼”。 “陪伴虾米直到最后一刻” 是票选出来的话题,这项投票结果远远领先于“与虾米最后的告别”“以此作别虾米”等其他选项。 虾米存放了虾米用户的无数青春记忆,陪伴这群音乐发烧友走过十余载;尽管所有人都希望“虾米,不要走”,但大家都默默选择用自己的方式,陪伴虾米走到终点。 关停来的不那么准时,零点过后,趴间的人数不降反升,除了“地球最后的夜晚”,其他趴间也有越来越多的虾米用户涌入,“你们还有声音吗”“我还能听”,大家互相确认着虾米App的“生命体征”。 ▲2月5日零点前后的虾米音乐趴间 “断网还能播放歌曲”“不要关掉App就还能用”......虾米用户想方设法延续与虾米共处的可能,再多一分多一秒都好。 彼时,有人已经确认,从虾米App分享的歌曲链接,点进去后界面已经变成了音螺,虾米渐渐变得空白。 ▲网页端音螺平台(即数字音乐新场景) 1个小时后,趴间的音乐早已停止

spring boot gateway自定义限流

无人久伴 提交于 2021-01-30 08:34:35
参考: https://blog.csdn.net/ErickPang/article/details/84680132 采用自带默认网关请参照 微服务架构spring cloud - gateway网关限流 ,参数与其唯一的区别是header中多了参数userLevel,值为A或者B 此处实现按传入参数取到不同配置 userLvl.A.replenishRate: 10 userLvl.A.burstCapacity: 100 userLvl.B.replenishRate: 20 userLvl .B.burstCapacity: 1000 自定义限流器 package com.gatewayaop.filter; import com.iot.crm.gatewayaop.common.config.UserLevelRateLimiterConf; import org.springframework.beans.BeansException; import org.springframework.cloud.gateway.filter.ratelimit.AbstractRateLimiter; import org.springframework.cloud.gateway.filter.ratelimit.RateLimiter; import org

How to execute Linux command line in C# Mono

泄露秘密 提交于 2021-01-29 02:10:25
问题 I want to execute this command : iconv -f unicode -t utf8 input.txt > output.txt But I got this error : /usr/bin/iconv: cannot open input file `>': No such file or directory ProcessStartInfo psi = new ProcessStartInfo(); psi.FileName = "/usr/bin/iconv"; psi.UseShellExecute = false; psi.Arguments = "-f unicode -t utf8 /tmp/test.txt > Desktop/output.txt"; Process p = Process.Start(psi); p.WaitForExit(); p.Close(); 回答1: You can only use the < , > and | operators inside a shell. The shell (such

Running VB.NET script with mono on a raspberry pi

吃可爱长大的小学妹 提交于 2021-01-28 14:30:09
问题 I am trying to run a vb.net script using mono on the latest version of raspbian. The script was originally written in visual studio and i just downloaded the entire folder on to my raspberry pi 3 from dropbox and tried to run the .exe file. mono /home/pi/Downloads/ctof/bin/Debug/ctof.exe And got met with: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of

Delegate System.Action<dynamic,int> does not take `1' arguments

爷,独闯天下 提交于 2021-01-28 12:20:18
问题 I am trying to build the PostgreSqlGeneration code from this repository on Mono. Unfortunately I get an error I do not understand. In the PostgreSqlMigrationSqlGenerator class the following method gives the build error "delegate System.Action does not take `1' arguments": private void GenerateStatements(IEnumerable<MigrationOperation> migrationOperations) { Check.NotNull(migrationOperations, "migrationOperations"); DetectHistoryRebuild(migrationOperations).Each<dynamic>(o => Generate(o)); //

Cake on OSX fails with “error: the assembly name is invalid”

久未见 提交于 2021-01-28 11:33:37
问题 I tried to use cake for the first time today and got the error above. I was initially using the cake package from homebrew, but to simplify the problem I downloaded the cake example project (https://github.com/cake-build/example), but all of the following commands give the same error output: ./build.sh cake mono tools/Cake/Cake.exe I have tried using MONO_LOG_LEVEL=debug MONO_LOG_MASK=dll to output more detailed logging but nothing seems obviously relevant. 回答1: It seems that this is caused

[转载]delphi实现音频捕捉与播放

拜拜、爱过 提交于 2021-01-28 04:02:00
delphi实现音频捕捉与播放 unit unit1; interface uses SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, Forms, Dialogs, mmsystem, StdCtrls; const memBlockLength = 500; type Tmemblock = array[0..memblocklength] of byte; PmemBlock = ^TmemBlock; TForm1 = class(TForm) procedure FormCreate(Sender: TObject); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); private { Private declarations } HwaveIn : PHWaveIn ; HWaveOut: PHWaveOut ; close_invoked, close_complete : boolean ; in_count, out_count : integer ; procedure MMOutDone(var msg:Tmessage);message MM_WOM_DONE; procedure