startup

VSCode集成TypeScript编译

﹥>﹥吖頭↗ 提交于 2019-11-27 23:56:13
先安装 github客户端 和 nodeJS客户端 吧,直接去官网下载,nodeJS客户端安装完就集成了npm; 查看是否成功: git version node -v npm-v 安装TypeScript: npm install -g typescript 更新版本 npm update -g typescript 其他的参考 https://code.visualstudio.com/docs/editor/tasks#vscode 新建一个文件夹,cmd命令下进入该文件夹 mytask ,分别输入以下命令 mkdir mytask cd mytask tsc --init code . 之后会在该文件夹下自动生成一个 tsconfig.json   里面新建一个 Hello.ts class Startup { public static main(): number { console.log('Hello World'); return 0; } } Startup.main();    按 Ctrl+Shift+B去build生成js文件 js文件如下: "use strict"; var Startup = /** @class */ (function () { function Startup() { } Startup.main = function () {

ASP.NET Core Web API 集成测试

感情迁移 提交于 2019-11-27 23:55:01
本文需要您了解ASP.NET Core Web API 和 xUnit的相关知识. 这里有xUnit的介绍: https://www.cnblogs.com/cgzl/p/9178672.html#test ASP.NET Core集成测试官方文档: https://docs.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-2.1 集成测试 vs 单元测试 测试金字塔, 但它只是一个指导性的概念. 如果所单元测试是对一个组件进行隔离测试的话, 那么集成测试则是测试多个组件共同协作产生出期待的结果. 单元测试通常很快. 而集成测试则慢的多, 因为它需要很多配置, 并且可能依赖于外部的组件, 例如数据库, 网络, 文件等. 通常在一个项目里单元测试要比集成测试多很多. 单元测试通常依赖于mock的组件, 而集成测试则使用可运行的组件. 注意: 如果一个行为可以通过单元测试或集成测试来测试的话, 那么应该使用单元测试 . 如何进行集成测试 如果我想测试一个API Controller的Action, 我可能需要把这个项目运行起来, 等它跑起来, 发送请求并检验结果. 但这样做的话需要很多的配置工作, 并且很麻烦. 幸好ASP.NET Core 提供了一个 Microsoft.AspNetCore

Powershell run job at startup with admin rights using ScheduledJob

南笙酒味 提交于 2019-11-27 23:32:04
To ease some of my work I have created a powershell script which needs to : Run at startup. Run with admin rights as it has to write in c:\program files folder. I created the startup service using powershell like this : function MakeStartupService { Write-Host "Adding script as a startup service" $trigger = New-JobTrigger -AtStartup -RandomDelay 00:00:15 Try { Register-ScheduledJob -Trigger $trigger -FilePath "absolute_path" -Name "Job-name" -EA Stop } Catch [system.exception] { Write-Host "Looks like an existing startup service exists for the same. Overwriting existing job" Unregister

Auto-Loading a module on IPython startup

依然范特西╮ 提交于 2019-11-27 23:00:31
I'm trying to to auto load the division module from __future__ on startup, i've currently got a simple script in the IPython startup libray with the line: from __future__ import division which works fine when run directly from the shell, however, the module does not appear to load when the line is run from the script, i made sure that the startup script is loaded by adding some arbitrary variable assignments to it: from __future__import division x=1 y=2 and the variables were preassigned when IPython was launched (as expected). I've tried looking at some solutions here and here but got nowhere

How can I make a Click-once deployed app run at startup?

只愿长相守 提交于 2019-11-27 18:48:30
How can I make a Click-once deployed app run a startup? The best option I found by searching was to set the Publisher on the app to Startup, so the Start menu shortcut would be placed in the Startup folder, but that seems like a huge hack and I would like there to be a Start menu icon people can find. What options do I have? Don Scott I feel that adding your application to the startup folder is unprofessional. I strongly recommend using a startup registry key to launch your application. Contrary to what a lot of the material on this topic says, it is extremely simple to setup a key to launch a

How to roll the log file on startup in logback

大憨熊 提交于 2019-11-27 18:19:31
I would like to configure logback to do the following. Log to a file Roll the file when it reaches 50MB Only keep 7 days worth of logs On startup always generate a new file (do a roll) I have it all working except for the last item, startup roll. Does anyone know how to achieve that? Here's the config... <appender name="File" class="ch.qos.logback.core.rolling.RollingFileAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg \(%file:%line\)%n</Pattern> </layout> <File>server.log</File> <rollingPolicy class="ch.qos

Speed up Spring Boot startup time

偶尔善良 提交于 2019-11-27 16:53:34
I have a Spring Boot application. I've added a lot of dependencies (unfortunately, looks I need all of them) and the startup time went up quite a lot. Just doing a SpringApplication.run(source, args) takes 10 seconds. While that might not be much compared to what are "used" to, I'm unhappy that it takes that much, mostly because it breaks the development flow. The application itself is rather small at this point, so I assume most of the time is related to the added dependencies, not the app classes themselves. I assume the issue is classpath scanning, but I am not sure how to: Confirm that is

XCode : why launchOptions in didFinishLaunchingWithOptions always nil?

北战南征 提交于 2019-11-27 16:09:14
问题 I want my app to do specific things when the app is launched by a click on a notification. I want to do these specific things when the app is already running into background BUT ALSO when the app is started FROM SCRATCH (not running into background) by a click on the notification. When the app is started from background by a click on the notification, I get the notification via: - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification =>

What handles dynamics:// URLs?

坚强是说给别人听的谎言 提交于 2019-11-27 15:18:30
I'm trying to create my own custom drilldown functionality, where a URL dynamics://0?myfunction_123456 will launch my own code. In C\SysStartupCmd\construct , this base code: case 'viewalert': sysStartupCmd = new SysStartUpCmdViewAlert(s,parm); break; case 'drilldown': sysStartupCmd = new SysStartUpCmdDrillDown(s,parm); break; case 'viewalertrule': sysStartupCmd = new SysStartUpCmdViewAlertRule(s,parm); break; I've tested and these all get fired with these URLs: dynamics://0/?DrillDown_382576 dynamics://0/?ViewAlert_382576 dynamics://0/?ViewAlertRule_382576 However, if I add my own case,

How to customize startup of WPF application?

穿精又带淫゛_ 提交于 2019-11-27 14:26:28
问题 When a new WPF Application project is created, MainWindow.xaml , App.xaml and their corresponding code behind classes are automatically generated. In the App.xaml there is an attribute that defines which window is going to be run initially and by the default it's StartupUri="MainWindow.xaml" I have created a new Dispatcher class in the same project. At startup, I want the instance of that class Dispatcher to be constructed and then one of its method to run. That method would actually create