脚本

Reload .profile in bash shell script (in unix)?

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm new to bash shell scripting, and have come across a challenge. I know I can reload my ".profile" file by just doing: . .profile but I'm trying to execute the same in a bash script I'm writing and it is just not working. Any ideas? Anything else I can provide to clarify? Thanks 回答1: Try this to reload your current shell: source ~/.profile 回答2: Try this: cd source .bash_profile 回答3: The bash script runs in a separate subshell. In order to make this work you will need to source this other script as well. 回答4: A couple of issues arise when

How to use App script to run a google big query and save it as a new table which can we reused?

匿名 (未验证) 提交于 2019-12-03 02:43:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How to use app script to run a google big query and save the results in a new table in the same project folder on google big query 回答1: It will look like this: function saveQueryToTable() { var projectId = 'your project'; var datasetId = 'your dataset'; var tableId = 'your table'; var job = { configuration: { query: { query: 'SELECT TOP(word, 300) AS word, COUNT(*) AS word_count' + 'FROM publicdata:samples.shakespeare' + 'WHERE LENGTH(word) > 10;', destinationTable: { projectId: projectId, datasetId: datasetId, tableId: tableId } } } }; var

sqoop job shell script execute parallel in oozie

匿名 (未验证) 提交于 2019-12-03 02:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a shell script which executes sqoop job . The script is below. ! #/bin/bash table = $1 sqoop job -- exec $ { table } Now when I pass the table name in the workflow I get the sqoop job to be executed successfully. The workflow is below. <workflow-app name = "Shell_script" xmlns = "uri:oozie:workflow:0.5" > <start to = "shell" /> <kill name = "Kill" > <message> Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}] </message> </kill> <action name = "shell_script" > <shell xmlns = "uri:oozie:shell-action:0.1" >

asp.net script in task scheduler

匿名 (未验证) 提交于 2019-12-03 02:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I got small asp.net script what could be executed as web page http://localhost/myscript.aspx and I need this script to be run every 30 seconds. I am working on windows server 2003 with IIS 6.0 I got task scheduler available, however launching iexplorer.exe http://localhost/myscript.aspx open browser even putting JavaScript windows.close () inside page, so in a few min I will have too many browsers open how to run it similar to Unix Lynx http://localhost/myscript.aspx > null 回答1: Install PowerShell then you can create a task that runs the

Is it possible to read webcam frames in parallel?

匿名 (未验证) 提交于 2019-12-03 02:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a simple Python script that captures a webcam using OpenCV . My webcam has the potential to stream 30 FPS, but since my Raspberry Pi isn't powerful enough, I can only read ~ 20 FPS. When running the script, one core of my CPU is maxed to 100%, but the the rest of the cores are untouched, so I am trying to split up the reading into the most threads I can in order to use my CPU to it's maximum potential and easily reach 30 FPS. So is it possible to read webcam frames in parallel? This is my attempt: import numpy as np import

JavaScript Load Order

匿名 (未验证) 提交于 2019-12-03 02:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working with both amq.js (ActiveMQ) and Google Maps . I load my scripts in this order AMQ & Maps Demo However in my application.js it loads Maps fine but I get an error when trying to subscribe to a Topic with AMQ. AMQ depends on prototype which the error console in Firefox says object is not defined. I think I have a problem with using the amq object before the script is finished loading. Is there a way to make sure both scripts load before I use them in my application.js? Google has this nice function call google.setOnLoadCallback

How to upsert or partial updates with script documents in ElasticSearch with Spark?

匿名 (未验证) 提交于 2019-12-03 02:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a pseudocode in python that reads from a Kafka stream and upsert documents in Elasticsearch (incrementing a counter view if the document exists already. for message in consumer : msg = json . loads ( message . value ) print ( msg ) index = INDEX_NAME es_id = msg [ "id" ] script = { "script" : "ctx._source.view+=1" , "upsert" : msg } es . update ( index = index , doc_type = "test" , id = es_id , body = script ) Since I want to use it in a distributed environment, I am using Spark Structured Streaming df . writeStream \ .

youtube API playVideo, pauseVideo and stopVideo not working

匿名 (未验证) 提交于 2019-12-03 02:39:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm attempting to use the YouTube API to control a set of players in a slideshow. I want to be able to stop and play videos depending on which frame the slideshow is on. So I'm pushing the players into an array based on the id of the frame. When a fame changes I call stop on the current one and start on the new one. However even in the most basic case I'm getting this error: Uncaught TypeError: Object #<S> has no method 'playVideo' here is the code for the simple test <!-- WIDGET YOUTUBE VIDEO --> <div class="widget_youtube_video" id="wyv_1

How to handle script dependencies in angular 2 module published to npm

匿名 (未验证) 提交于 2019-12-03 02:39:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have published an angular 2 library to npm recently.I have listed all the dependency scripts in the libraries package.json file. when I run npm install my-library all the dependency scripts are not installed.So, my question is how to install the dependency scripts while installing the library. 转载请标明出处: How to handle script dependencies in angular 2 module published to npm 文章来源: How to handle script dependencies in angular 2 module published to npm

awk script- extract text between parenthesis

匿名 (未验证) 提交于 2019-12-03 02:39:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am tring to extract text between the first and its matching closing bracket in a file. Input CREATE MULTISET TABLE ABCD . EFGH , NO FALLBACK , NO BEFORE JOURNAL , NO AFTER JOURNAL , CHECKSUM = Default ( ABCK_SK INTEGER NOT NULL , PRQ VARCHAR ( 1024 ) NOT NULL , RST DECIMAL ( 12 , 4 ) NOT NULL , LMN CHAR ( 1 ) NOT NULL , OPQ DATE NOT NULL , PQRS DATE NOT NULL , TUV INTEGER NOT NULL , WXY INTEGER NOT NULL ) UNIQUE PRIMARY INDEX ABCK_PI ( ABCK_SK ) ; Expected Output ABCK_SK INTEGER NOT NULL , PRQ VARCHAR ( 1024 ) NOT NULL , RST