脚本

Creating an image of difference of adjacent pixels with digitalmicrograph (DM) script

匿名 (未验证) 提交于 2019-12-03 10:09:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: The following digitalmicrograph function tries to create an image by taking difference of neighboring pixel in a sub-row of a row of the image. The first pixel is replaced with a mean of the difference result of the sub-row thus created. E.g. If the input image is 8 pixels wide and 1 rows tall and the sub-row size is 4 - In_img = {8,9,2,4,9,8,7,5} Then the output image will be - Out_img = {mean(8,9,2,4)=5.75,9-8=1,2-9=-7,4-2=2,mean(9,8,7,5)=7.25,8-9=-1,7-8=-1,5-7=-2} When I run this script, the first pixel of the first row is

How to run python script in HTML?

匿名 (未验证) 提交于 2019-12-03 10:09:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Currently I'm having some python files which connects to sqlite database for user inputs and then performs some calculations which sets the output of the program. I'm new to python web programming and I want to know what is the best method to use python on web? Ex: I want to run my python files when the user clicks a button on the web page. Is it possible? I started with Django. But it needs some time for the learning. And I also saw something called CgiScripts. Which option should I use? Please advice. 回答1: It probably would

博客园添加看板娘

≡放荡痞女 提交于 2019-12-03 10:01:53
一、把下载的压缩包解压 链接: https://pan.baidu.com/s/1xkC9jO6xXhz0d8OJEw1XzQ 提取码:5j68 二、把所有的文件上传到博客园管理当中的文件当中 三、把以下代码复制到博客侧边栏公告区域,需要申请开通 (支持JS代码) <html xmlns=" http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Live2D</title> <link rel="stylesheet" type="text/css" href=" https://blog-static.cnblogs.com/files/reasonzzy/flat-ui.min.css"/> <link rel="stylesheet" type="text/css" href=" https://blog-static.cnblogs.com/files/reasonzzy/waifu.css"/> <script src=" https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> <script src=" https://blog

Run script with udev after USB plugged in on RPi

匿名 (未验证) 提交于 2019-12-03 09:52:54
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to run a script from a udev rule after any USB drive has been plugged in. When I run the script manually, after the USB is mounted normally, it will run fine. The script calls a python program to run and the python program uses a file on the USB drive. No issues there. If I make the script to simply log the date in a file, that works just fine. So I know my UDEV rule and my script work fine, each on their own. The issue seems to come up when udev calls the script, then script calling the python program and the python

Run elisp program without Emacs?

匿名 (未验证) 提交于 2019-12-03 09:52:54
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: elisp is a good language, I find it can handle all kind of jobs, but can I use it like a shell script? i.e. execute some *.el files from the console, without launching Emacs. Or launch Emacs, but don't enter interactive mode. 回答1: You can most definitely run elisp scripts in Emacs without starting the editor interface. Here are the notes I've made/copied from a few extremely useful Q&As on the subject here at S.O. (and the following two in particular). Emacs shell scripts - how to put initial options into the script? Idomatic batch

Is there an option to allow script or embed code in PageDown editor?

匿名 (未验证) 提交于 2019-12-03 09:52:54
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm creating a blog using node.js and I'm still debating whether I'm going to use PageDown or stick to whatever I have at the moment. The current Markdown editor that I have its allow the user to enter any code they want without any restriction and some people think that it is a bad idea to do so, but having that option enabled by default for my blog it is okay because its a single author blog, and the owner obviously would be the advance users. I have come across an awesome editor like PageDown and now I really want to know if I

How to use Excel VBA to run WinSCP Script?

匿名 (未验证) 提交于 2019-12-03 09:52:54
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I wrote a WinSCP script that upload a local file to a SFTP site. The script is saved into .txt: WinSCP.com open sftp://username:password@address cd /export/home/Desktop/Temp put C:\Users\Dekstop\JPMC\a.xlsx close exit Then I look at this post and write this code into Excel VBA: Sub RunWinScp() Call Shell("C:\Program Files (x86)\WinSCP\WinSCP.com /ini=nul/script=C:\Users\Desktop\WinSCPGetNew.txt") End Sub But when I try to run it, nothing happens. There is no error, but the file is not transferred correctly neither. Could someone please help?

javaScript 之 蚁人<微任务>

醉酒当歌 提交于 2019-12-03 09:48:09
本文转载于: 猿2048 网站➯ https://www.mk2048.com/blog/blog.php?id=ia1ja2c00j 每次我在写技术类文章的时候都喜欢用引用一个神话故事或者一位超级英雄。没错,因为我的中二病很严重,写代码的时候都幻想自己有一对机械手臂帮我在那啪啪啪的调试bug,别想歪了不是那种啪啪啪。 这次我要说的就是 蚁人 好吧,为什么要说蚁人那。如果你看过漫威(虽然我是DC粉)的超级英雄电影你应该知道蚁人的能力。 变小 🐜 --- 变小 🐜 --- 变小 🐜 --- 变小 🐜 --- 变小 🐜 变大 🐜 --- 变大 🐜 --- 变大 🐜 --- 变大 🐜 --- 变大 🐜 牛叉吹完,开始正题 蚁人的变大我认为就是宏任务 蚁人的变小我认为就是微任务 为什么这么说那?因为你想在<美队3>里蚁人内战之中变得很大,但是问题就来了,变大之后虽然力量有了加成,但是速度变得很慢,我现在不说你应该猜出宏任务的缺点了吧? 同理,蚁人变小之后灵巧了不少,可以跟很多蚂蚁沟通,这些蚂蚁井然有序帮助蚁人,是不是这些小🐜很像微任务,那么微任务的好处你也猜到了吧? 我们来引入谷歌的一位大神 Jake 的文章作为说明,原文标题:《Tasks, microtasks, queues and schedules》原文地址: Tasks, microtasks, queues and

游戏开发中的人工智能(八):描述式 AI 及描述引擎

空扰寡人 提交于 2019-12-03 09:32:50
接上文 游戏开发中的人工智能(七):A* 路径寻找算法 本文内容 :程序员通常只写描述引擎,而由设计者使用工具创建内容和定义 AI。本章探讨一些开发人员把描述系统应用在游戏中的技巧,以及他们所得到的益处。 描述式 AI 及描述引擎 本章讨论某些技巧,让你把描述系统应用到游戏软件 AI 的问题上,以及这样做以后所能获得的好处。 从最基本的层次上来看,你 可以把描述机制想象成非常简单的程序语言,专门为与游戏问题相关的特定工作而量身打造 。描述机制可以说是游戏开发过程中,不可缺少的一部分,因为这可以让游戏设计师,而不是游戏程序员,撰写出游戏,并予以精细化。玩家也可以利用描述语言,建立或修改其所处的游戏世界或登记。再进一步的话,你可以在超大型多人在线角色扮演游戏(MMORG)中使用描述系统,当人们实际在玩游戏时,就能改变游戏的行为。 实现描述系统时,可以采用好几种手段 。例如,精致的描述系统,可以让实际所用的游戏引擎和现有的描述语言(例如 Lua 或 Python)衔接起来。有些游戏会建立专用的描述语言,专门设计处理个别游戏的需求。虽然有时候利用这些方法比较方便,但是,让游戏分析包含描述命令的标准文字文件,会比较简单。如果采用这种手段,你就可以用任何标准的文字编辑器,建立脚本。在实际游戏中,当游戏开始时或者在某些特定时刻,可以读取脚本,并予以分析。例如,当玩家实际进入城堡时

Using “konsole” command to run python script

匿名 (未验证) 提交于 2019-12-03 09:21:58
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to, from a command line, open an instance of konsole and run a python script. I'm trying: konsole -hold -e 'python -i hello.py' The behaviour I'm getting is that a persistent konsole opens, and I am dropped into python, but the script does not run. Python 2.7.2+ (default, Oct 4 2011, 20:03:08) [GCC 4.6.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> What do I need to do to get the python script to run in the konsole window? 回答1: jsbueno's solution is the correct one. However, as described