脚本

IE9 HTTPS security is compromised by my Greasemonkey script?

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I’ve got a Greasemonkey-for-IE script in IE9 that’s importing jQuery. But on secure pages it doesn’t work. I’m getting: SEC7111: HTTPS security is compromised by http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js The code that fails is: var script = document.createElement("script"); script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"); How can I make this work? The script doesn’t cause a problem in Firefox. 回答1: Presumably: Use https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min

How to run 'cd' in shell script and stay there after script finishes?

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I used 'change directory' in my shell script (bash) #!/bin/bash alias mycd = 'cd some_place' mycd pwd pwd prints some_place correctly, but after the script finished my current working directory doesn't change. Is it possible to change my path by script? 回答1: You need to source the file as: . myfile . sh or source myfile . sh Without sourcing the changes will happen in the sub-shell and not in the parent shell which is invoking the script. But when you source a file the lines in the file are executed as if they were typed at the

Update By Query in Elasticsearch using Java

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I’m currently using Elasticsearch V2.3.1. I want to use the following Elasticsearch query in Java. POST /twitter/_update_by_query { "script": { "inline": "ctx._source.List = [‘Item 1’,’Item 2’]” }, "query": { "term": { "user": "kimchy" } } } The above query searches for “user” named “kimchy” and updates the “List” field with given values. This query updates multiple documents at the same time. I read about the Update API for Java here https://www.elastic.co/guide/en/elasticsearch/client/java-api/2.3/java-docs-update.html but couldn’t find

Creating a .DMG

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I want to create a dmg file for my Mac project. Can someone please tell me how to do this? This being my first Mac project, I do not have any idea how to proceed. I also want to give the user an option of running the app on start-up. How do I do this? Thanks. P.S. I also want to add a custom license agreement. 回答1: To do this manually: Method 1: Make a folder with the files your DMG will contain. Open Disk Utility (It's in /Applications/Utilities/ ) Go to File > New > New Image from Folder ( Cmd + Shift + N ) Choose the folder

Call REST API from PowerShell Script

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: How can I call a rest based API from a PowerShell script and process the Json answer? 回答1: What you want is PowerShell 3 and its Invoke-RestMethod , ConvertTo-Json , and ConvertFrom-Json cmdlets. Your code will end up looking like: $stuff = Invoke - RestMethod - Uri $url - Method Get ; and there shouldn't even be a need to invoke ConvertFrom-Json on the resulting $stuff => it's already in a usable non-string format. See http://technet.microsoft.com/en-us/Library/hh849971.aspx for details. 回答2: I created this Get-Http function to

AngularJS script tag JSON-LD

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How do you create an application/ld+json script tag with a dynamically built JSON object in AngularJS . This is what I need the script tag to look like I have tried the following code but I cant get it to work: HTML {{jsonId|json}} Controller var myApp = angular.module('application', []); myApp.controller('TestController', ['$scope', function($scope) { $scope.jsonId = { "@context": "http://schema.org", "@type": "Place", "geo": { "@type": "GeoCoordinates", "latitude": "40.75", "longitude": "73.98" }, "name": "Empire State Building" }; }]);

Using curl in a bash script and getting curl: (3) Illegal characters found in URL

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: So I have a very simple bash script that is curl'ing to an auth server for a header. The header url is written to a var and then used in the next curl call. When using the var set in the first curl call I am getting "curl: (3) Illegal characters found in URL". I am able to echo the var and all looks good, I am even able to reset the var (in my example below) and it works. The Bash script URL=$(curl -i -X GET -H "X-Auth-User: MyUserna,e" -H "X-Auth-Key: MyAPIKey" "https://urlToAuthServer.tld/auth/v1.0/" | grep "X-Storage-Url:" | awk '{print

Convert Latex/MathML to SVG or Image with mathjax or similar?

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm building a library that only allows objects render's functionality to to return DOM elements of the representation of themselves, one of those is math, so , or will do it, I'll prefer svg. Mathjax is known for being very good at this, but I need something more like: Mathjax.Latex('\frac{2}{1}').toSVG(); //svg DOM node or string Mathjax.Latex('\frac{2}{1}').toImage(); //Image, img node, or base64 I know it's possible with mathjax-node, but is it with mathjax client side? https://github.com/mathjax/MathJax-node 回答1: There is not built-in

SSIS: script task (vs15) not work when deploy on sql server 2014

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The error: There was an exception while loading Script Task from XML: System.Exception: The Script Task uses version 14.0 script that is not supported in this release of Integration Services. To run the package, use the Script Task to create a new VSTA script. In most cases, scripts are converted automatically to use a supported version, when you open a SQL Server Integration Services package in %SQL_PRODUCT_SHORT_NAME% Integration Services. at Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptTask.LoadFromXML(XmlElement elemProj,

How do I automatically export a WAR after Java build in Eclipse?

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a J2EE project in Eclipse 3.2 and at the end of every build I want to automatically create and deploy a WAR file. At the moment I have to do this by hand which is 5 or 6 mouse-cliks and it would be nice to automate it. I know I can do this with a custom build script using ANT but I am hoping for an Eclipse native solution. I have the J2EE standard tools (JST) and Web Standard Tools (WST) plug-ins installed in my Eclipse environment. 回答1: If you can implement it as an Ant script, then you can have Eclipse invoke that Ant script on each