Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
-- NOTE Problem with this is that because of the way reocurring events are handled they aren't captured by this script | |
-- See this thread for some workarounds to project reocurring events: https://macscripter.net/viewtopic.php?id=29516 | |
on format24h(provided_date) | |
try | |
set oldDelims to AppleScript's text item delimiters | |
set the_time to time string of provided_date -- something like "4:20:56 PM" | |
set am_pm to characters -2 thru -1 of the_time as string -- is it AM or PM | |
set AppleScript's text item delimiters to ":" | |
set the_hour to text item 1 of the_time as string -- in this example, "4" |
MY_JSON='[{"name": "Banana", "type": "Fruit"},{"name": "Carrot", "type": "Vegetable"},{"name": "Intentionally Blank Type", "type": ""},{"name": "Bread", "type": "Grain"}]' | |
for row in $(jq -r '.[] | @base64' <<< "${MY_JSON}"); do | |
_jq() { | |
base64 --decode <<< "${row}" | jq -r ${1} | |
} | |
NAME=$(_jq '.name') | |
TYPE=$(_jq '.type') | |
echo "${NAME} is a ${TYPE}" |
#!/usr/bin/osascript | |
on convertListToString(theList, theDelimiter) | |
set AppleScript's text item delimiters to theDelimiter | |
set theString to theList as string | |
set AppleScript's text item delimiters to "" | |
return theString | |
end convertListToString | |
on get_participants() |
tell application "Microsoft Outlook" | |
activate | |
set selectedMessages to selected objects | |
if selectedMessages is {} then | |
display notification "Please select a message in Outlook before running the script!" | |
else | |
set folderChoices to {"Inbox", "2 - Action", "3 - Waiting For", "4 - Reference", "5 - Archive"} | |
set selectedFolders to choose from list folderChoices with prompt "Select folder to move to:" default items "5 - Archive" | |
set selectedFolder to item 1 of selectedFolders | |
set destFolder to mail folder selectedFolder |
from lxml import html | |
import requests | |
import unicodecsv as csv | |
import argparse | |
def parse(zipcode,page=0,filter=None): | |
if filter=="newest": | |
url = "https://www.zillow.com/homes/for_sale/{0}/{1}_p/0_singlestory/days_sort".format(zipcode, page) | |
elif filter == "cheapest": |
# The following will split a CSV (file.csv) into multiple parts of 1 million lines each | |
# with each part having its own header. | |
# | |
# PREFIX denotes the filename to use for the parts. A number will be added to the end. | |
tail -n +2 file.csv | | |
split -d -l 1000000 - --filter='sh -c "{ head -n1 file.csv; cat; } > $FILE"' PREFIX |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
import lombok.extern.slf4j.Slf4j; | |
import lombok.val; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.http.MediaType; | |
import org.springframework.web.filter.OncePerRequestFilter; | |
import org.springframework.web.util.ContentCachingRequestWrapper; | |
import org.springframework.web.util.ContentCachingResponseWrapper; | |
import javax.servlet.FilterChain; | |
import javax.servlet.ServletException; |
So from what I can tell from the docs [https://docs.spring.io/spring-batch/trunk/reference/html/readersAndWriters.html#database]
Cursor based item readers use a DB single connection load the entire ResultSet into app memory by default then the application iterates over the ResultSet with a cursor (So not a DB cursor) mapping one row and writing it out at a time so previous rows can be garbage collected.
Although you can set the maxRows to limit the amount of rows in the ResultSet at one time, then when the ResultSet needs more rows it will (using the same connection) fetch more (amount depends on the value of fetchSize). This continues until all rows from the query are loaded into the ResultSet and read.
Page based item readers make multiple queries each returning a different "page" of the results (size configurable with setPageSize method)
I assume cursor based item readers probably use more memory (unless configured appropriately) and be faster, where as the page based would typically consume less memo
javascript: (function() { | |
/* | |
Adds download links to gifs on Giphy for easier mass download | |
jQuery if not already loaded. | |
*/ | |
if ('undefined'==typeof jQuery) { | |
script = document.createElement( 'script' ); | |
script.src = 'https://code.jquery.com/jquery-3.1.1.min.js'; | |
script.onload=getServers; | |
document.body.appendChild(script); |