runtime

.NET Core 3.0正式版发布

こ雲淡風輕ζ 提交于 2019-11-30 13:08:58
是的,.NET Core 3.0正式版发布了,令人兴奋。 WPF 其实,.NET Core 2.1开始已经是个很完善的版本,3.0又带来了什么呢?我站在我的使用角度来看,最最令人振奋的就是:能用WPF了!能用WPF了!能用WPF了! 那Linux能不能用WPF?——嗯……还是不行,虽然能够用.NET Core SDK开发WPF程序,但它依赖于.NET Core Desktop Runtime,这个运行时目前只有Windows版本,所以别的平台暂时还不能用WPF。可你不觉得这已经是巨大的进步了吗?这样一来,我就可以跟.NET Framework说bye bye了,全面进入.NET Core时代。同时,WinForm也是被支持的,吼啊! 我立马升级了Visual Studio 2019至16.3.1,直接支持创建WPF(.NET Core)项目,开发体验和之前开发WPF没什么差别,完美! 另外,现在的dotnet程序可以直接编译成可执行文件了,而不再需要“dotnet app.dll”这种命令带参数的方式来运行。 系统要求及兼容性 现在我可以根据客户的需求编写一些桌面应用发给用户了,但要是客户的操作系统不支持.NET Core 3.0那就白干了,所幸的是.NET Core 3.0对操作系统的要求并不算很过分: Windows 7 SP1+,Windows 8.1+,Windows 10

Changing dataset connection string at runtime

孤街浪徒 提交于 2019-11-30 12:54:03
I have a c# generated dataset. How can I change the connection string so I can use the dataset with another (identically structured yet differently populated) database? This has to occur at runtime as I do not know the server or database name at compile time. I am using c# 2.0. You can modify a single instance of the table adapter. _myAdapter.Connection.ConnectionString = connectionString; Based on the link above, I did it this way: partial class QueriesTableAdapter { public QueriesTableAdapter(string connectionString) { Properties.Settings.Default["connectionString"] = connectionString; } }

聊聊动态链接和dl_runtime_resolve

情到浓时终转凉″ 提交于 2019-11-30 12:21:42
写在前面 linux下的动态链接相关结构,重新回顾_dl_runtime_resolve的流程以及利用方法 动态链接相关结构 为了高效率的利用内存,多个进程可以共享代码段、程序模块化方便更新维护等,动态链接技术自然就出现了。不详细介绍位置无关代码和位置无关可执行程序这些基本知识,这里着重记录一下ELF实现运行时重定位为了提高效率做的各种工作和用到的结构。 动态链接的可执行文件装载过程和静态链接基本一样,OS读取可执行文件的头部信息,检查文件合法性后从Program Header中读取每一个Segment的虚拟地址、文件地址和属性,然后把他们映射到进程虚拟空间的相对位置。但是OS接下来不能把控制权交给可执行文件,因为动态链接中还有很多依赖于共享对象的无效地址,需要进一步处理。映射完成后,OS会启动一个动态链接器(Dynamic Linker)——linux下就是ld.so。这个动态链接器实际上也是一个共享对象,OS也会通过映射的方式把它载入进程的地址空间中。然后OS就会把控制权交给DL的入口地址,它会进行一系列初始化操作,根据当前环境参数对可执行文件进行动态链接工作。完成之后再把控制权转交给可执行文件。 pwn常见的so hell 动态链接器并非由系统配置或者环境参数决定,而是由ELF可执行文件自己决定!动态链接的ELF可执行文件中,有一个专门的段叫做.interp

Funfile 功能介绍

柔情痞子 提交于 2019-11-30 12:18:38
前言 首先介绍下在本文出现的几个比较重要的概念: 函数计算(Function Compute) : 函数计算是一个事件驱动的服务,通过函数计算,用户无需管理服务器等运行情况,只需编写代码并上传。函数计算准备计算资源,并以弹性伸缩的方式运行用户代码,而用户只需根据实际代码运行所消耗的资源进行付费。函数计算更多信息 参考 。 Fun : Fun 是一个用于支持 Serverless 应用部署的工具,能帮助您便捷地管理函数计算、API 网关、日志服务等资源。它通过一个资源配置文件(template.yml),协助您进行开发、构建、部署操作。Fun 的更多文档 参考 。 备注: 本文介绍的技巧需要 Fun 版本大于等于 3.0.0+。 Funfile 是什么 就如同 Dockerfile 用于构造 docker 镜像,Funfile 可以用于构造函数计算的交付产物。 Funfile 中包含了一系列的命令,这些命令相当于构造函数计算交付产物一个个“步骤”,Fun 会忠实地执行这些步骤,最终产出“交付产物”。 初始化 Funfile 文件 Funfile 文件可以通过执行 fun install init 完成初始化创建。执行 fun install init,会让选择函数运行时: $fun install init ? Select a runtime nodejs6 nodejs8

Java -- 在Java程序中调用Python

那年仲夏 提交于 2019-11-30 11:58:51
  在项目中遇到通过Java来调用python脚本,训练模型的场景,我对python没有什么过多的了解,就看过一点python脚本,和在windows中安装了下python环境和一个IDE。于是搜索一番记录一下。 第一步就是安装python环境,这个就直接百度吧。。。和一个python脚本,这里要注意python脚本和环境的版本应该一致,因为python2.x和python3.x兼容性不是很好。 java中调用python,一般有两种方式: 1. Jython   Jython是一门语言,并非是Java 或者Python的解释器.用它可以实现,java和python代码的互相访问。使用时需要在pom中引入Jython的依赖,然后就可以在Java代码中直接使用python语法了。但是这种不是我需要的方式,而且经常不错,所以放弃了这种方式。 2. java.lang.Runtime   直接使用java自带的Runtime,这种方式不需要引入外部依赖,而且很好用。直接使用Runtime.getRuntime().exec(args),然后采用输出流的方式用来获取参数就可以了。   如果不需要向python中传递参数,则python脚本和java代码如下( 值得注意的是,执行py命令时,前面要加 python! ): package com . caxs . warn ; import

How to get Javascript Function Calls/Trace at Runtime

ぃ、小莉子 提交于 2019-11-30 10:46:16
问题 As I interact with my AJAX based application at RUNTIME I'd like the console to spit out all the functions it's calling. (so no stack trace, or breakpoints, or profiling or anything) So for example, let's say I pressed a button on the page. I'd like for it to return all the functions it went through when that happened: So I'd see in the console something like (when I pressed a button): 1. button1Clicked(); 2. calculating(); 3. printingResults(); Which basically means that button1Clicked()

Why is it so slow iterating over a big std::list?

南楼画角 提交于 2019-11-30 10:37:05
As title suggests, I had problems with a program of mine where I used a std::list as a stack and also to iterate over all elements of the list. The program was taking way too long when the lists became very big. Does anyone have a good explanation for this? Is it some stack/cache behavior? (Solved the problem by changing the lists to std::vector and std::deque (an amazing data structure by the way) and everything suddenly went so much faster) EDIT: I'm not a fool and I don't access elements in the middle of the lists. The only thing I did with the lists was to remove/add elements at the end

Create a class at runtime - Why do NSClassFromString AND objc_getclass return nil?

荒凉一梦 提交于 2019-11-30 10:32:01
I've tried using both: NSClassFromString and objc_getclass to return a class, so I can create it at runtime, but both functions return nil for some classes, for example "TestClass". Note that NSClassFromString works for me for 99% of classes. If I add [TestClass class]; before I call NSStringFromClass or objc_getclass it, it works. and if I try to just create the class using a class reference, i.e.: [TestClass alloc]; it works too. So how can I force the class to load at runtime so NSClassFromString or objc_getclass will not return nil? I ran into this same problem. In my case I had code which

What is the run time complexity O(?) for JavaScript to access an object property? [duplicate]

帅比萌擦擦* 提交于 2019-11-30 09:41:43
问题 This question already has an answer here : Is there anything that guarantees constant time for accessing a property of an object in JavaScript? (1 answer) Closed 3 years ago . var obj = {}; obj["A"] = true; obj["B"] = true; obj["C"] = true; console.log(obj["D"]); The above code will print "undefined". What is the runtime complexity when javascript is trying to access obj["D"] ? I guess it will be the same as it is trying to access obj["A"]? The reason why I am asking this is because I am

Getting fortran runtime error: end of file

戏子无情 提交于 2019-11-30 09:15:06
问题 I have recently learned how to work with basic files in Fortran and I assumed it was as simple as: open(unit=10,file="data.dat") read(10,*) some_variable, somevar2 close(10) So I can't understand why this function I wrote is not working. It compiles fine but when I run it it prints: fortran runtime error:end of file Code: Function Load_Names() character(len=30) :: Staff_Name(65) integer :: i = 1 open(unit=10, file="Staff_Names.txt") do while(i < 65) read(10,*) Staff_Name(i) print*, Staff_Name