This file contains hidden or 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
(go (while true | |
(let [x (* 100 (<! acc)) | |
T (sel1 :#T) | |
bredde (.-width T)] | |
(dommy/set-style! T :width (str (- bredde x)"px")) | |
(set! (.-innerText (sel1 :#acceleration)) x)))) |
This file contains hidden or 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
# Gjør om sekunder til år, dager, timer, minutter og sekunder | |
# Les inn antall sekunder og gjør om til et heltall | |
# Programmet kommer til å kræsje om du skriver noe annet | |
sekunder = int(input("Skriv inn antall sekunder: ")) | |
minutter, sekunderTilOvers = divmod(sekunder, 60) | |
timer, minutterTilOvers = divmod(minutter, 60) | |
dager, timerTilOvers = divmod(timer, 24) | |
år, dagerTilOvers = divmod(dager, 365) # Skuddår? Aldri hørt om. |
This file contains hidden or 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
# Sekunder til minutter og sekunder | |
# Heltallsdivisjon kan vi gjøre i Python med divmod | |
# Prøv for eksempel divmod(15,4), eller 15/4. | |
# divmod(8,4), eller 8/4. | |
# divmod(9,4), eller 9/4. | |
# divmod(10,4), eller 10/4. | |
# divmod(11,4), eller 10/4. | |
# divmod(12,4), eller 10/4. |
This file contains hidden or 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
from turtle import * | |
black = set() | |
speed(11) | |
while(True): | |
x,y = position() | |
pos = (round(x),round(y)) | |
if (pos in black): | |
black.remove(pos) | |
right(90) | |
else: |
This file contains hidden or 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
public class FastController : ApiController | |
{ | |
[Route("")] | |
public HttpResponseMessage GetResult() | |
{ | |
var fs = new FileStream(Path.Combine(HttpRuntime.AppDomainAppPath, "medline13n0701.xml.gz"), FileMode.Open); | |
var response = new HttpResponseMessage(HttpStatusCode.OK) | |
{ | |
Content = new StreamContent(fs) | |
}; |
This file contains hidden or 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
var http = require('http'); | |
var fs = require('fs'); | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'application/xml', | |
'Content-Encoding':'gzip'}); | |
fs.createReadStream('medline13n0701.xml.gz').pipe(res); | |
}).listen(1337, '127.0.0.1'); |
This file contains hidden or 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
[Route("")] | |
public HttpResponseMessage GetResult() | |
{ | |
var result = File.ReadAllText(@"C:\data\SwissProt.xml"); | |
var response = new HttpResponseMessage(HttpStatusCode.OK) | |
{ | |
Content = new StringContent(result) | |
}; | |
response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/xml"); | |
return response; |
This file contains hidden or 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
[Route("")] | |
public HttpResponseMessage GetResult() | |
{ | |
var fs = new FileStream(@"C:\data\medline13n0701.xml.gz"), FileMode.Open); | |
var response = new HttpResponseMessage(HttpStatusCode.OK) | |
{ | |
Content = new StreamContent(fs) | |
}; | |
response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/xml"); | |
response.Content.Headers.ContentEncoding.Add("gzip"); |
This file contains hidden or 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
from turtle import * | |
shape("turtle") | |
for count in range(4): | |
forward(100) | |
right(90) |
This file contains hidden or 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
[Route("")] | |
public HttpResponseMessage GetResult() | |
{ | |
var fs = new FileStream(@"C:\data\medline13n0701.xml"), FileMode.Open); | |
var response = new HttpResponseMessage(HttpStatusCode.OK) | |
{ | |
Content = new StreamContent(fs) | |
}; | |
response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/xml"); | |
return response; |