-
Write down the questions!
Writing down the questions you're supposed to answer is a great way to increase the sentence count. there are usually 3-4 of them so if you write them down you're almost a third of the way there.
-
Did you miss a semicolon somewhere?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function areaOfCylinder($r,$h) { | |
$areaOfCircle = pi()*pow($r,2); | |
$areaOfCircles = $areaOfCircle*2; | |
$areaAround = $h*(2*(pi()*$r)); | |
$totalArea = $areaOfCircles+$areaAround; | |
return $totalArea; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<q1dataclean.txt sed -n 's/(.*\/\([A-Z][a-z]\{2\}[0-9]\{4\}AD\)[0-9A-Z].*>\([A-Z][a-z]\{2\}[0-9]\{4\}AD\))/({2012AD\21944AD\1})/p;s/(.*>\([A-Z][a-z]\{2\}[0-9]\{4\}AD\))/({2012AD\11944AD})/p;s/(.*\/\([A-Z][a-z]\{2\}[0-9]\{4\}AD\)[0-9A-Z].*)/({2012AD1944AD\1})/p;s/(\/.*)/({2012AD1944AD})/p' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1a <q1dataclean.txt sed -n 's/(.*\/\([A-Z][a-z]\{2\}[0-9]\{4\}AD\)[0-9A-Z].*>\([A-Z][a-z]\{2\}[0-9]\{4\}AD\))/({2012AD\21944AD\1})/p;s/(.*>\([A-Z][a-z]\{2\}[0-9]\{4\}AD\))/({2012AD\11944AD})/p;s/(.*\/\([A-Z][a-z]\{2\}[0-9]\{4\}AD\)[0-9A-Z].*)/({2012AD1944AD\1})/p;s/(\/.*)/({2012AD1944AD})/p' | |
1b I prayed to the sed gods to enlighten me, and so it was. The sed MASTER was born. Or maybe i just watched a 40m youtube tutorial to learn sed and then spend 3h ripping my hair out followed by another 2h of experimenting with regex, backreferencing, nagging at the teacher and then some comparing my result with the proper hits file. | |
2a < q2dataclean.txt sed -n 's/^\(0x[a-z0-9]\{3\}\)\([1-9][0-9]\{0,1\}:[0-9]\{1,2\}[amp]\{2\}\).*/<([Jane|Alice|\2|Mary|\1])>/p ; s/^\(0x[a-z0-9]\{3\}\)[^1-9].*/<([Jane|Alice||Mary|\1])>/p' | |
2b I spent aproximately 20-30 minutes identifying the replace pattern and then aproximately 1-2h constructing a pattern that i thougth would match. it turned out i had written some of my numerical charact |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function child() | |
{ | |
while true; do | |
filename='currentip.txt' | |
oldIp=`cat $filename` | |
currentIp=`curl http://bot.whatismyipaddress.com/` | |
if [ $oldIp != $currentIp ] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: | |
var highlightedText = window.getSelection().toString(); | |
highlightedText = highlightedText.replace("?","."); | |
highlightedText = highlightedText.replace("!","."); | |
highlightedText = highlightedText.replace(/\.\.*/g,"."); | |
var sentances = highlightedText.split("."); | |
var sentanceCount = (highlightedText.match(/\.\s/g) != null) ? highlightedText.match(/\.\s/g).length : 0; | |
sentanceCount += (highlightedText.slice(-1) == ".") ? 1:0; | |
var wordCount = highlightedText.split(" ").length; | |
var avgWordsPerSentance = (wordCount/sentanceCount).toFixed(2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
appendToQueryString = function (param, val) { | |
var queryString = window.location.search.replace("?", ""); | |
var parameterListRaw = queryString === "" ? [] : queryString.split("&"); | |
var parameterList = {}; | |
var newQueryString = "?"; | |
for (var i = 0; i < parameterListRaw.length; i++) { | |
var parameter = parameterListRaw[i].split("="); | |
parameterList[parameter[0]] = parameter[1]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import datetime | |
import socket | |
# import urllib2 | |
def hasInternet(host="8.8.8.8", port=53, timeout=3): | |
""" | |
Host: 8.8.8.8 (google-public-dns-a.google.com) | |
OpenPort: 53/tcp | |
Service: domain (DNS/TCP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Ticketeer Timesheet Integration Dev | |
// @namespace my.Home | |
// @version 1.0 | |
// @description Makes your life better one friday at a time | |
// @author Tommy Svenningsson | |
// @grant none | |
// @match https://ter.istone.com/cgi-bin/Maconomy/* | |
// @require https://code.jquery.com/jquery-3.1.1.min.js | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tArgs = {...} | |
local rows = tonumber(tArgs[1]) | |
local columns = tonumber(tArgs[2]) | |
local enderchest_index = tonumber(tArgs[3] or -1) | |
y = 0 | |
print(string.format("Filling %s by %s area with refill chest on index %s", rows, columns, enderchest_index)) | |
function refillFromEnderchest() | |
turtle.select(enderchest_index) |
OlderNewer