Pretty good, from YouTube, channel "veridiz"
MacroRodent's Blog
perjantai 7. maaliskuuta 2025
tiistai 30. huhtikuuta 2024
Google Project Zero
Fascinating site, should follow more.
https://googleprojectzero.blogspot.com/2024/04/the-windows-registry-adventure-1.html
https://googleprojectzero.blogspot.com/2024/04/the-windows-registry-adventure-2.html
perjantai 16. kesäkuuta 2023
perjantai 17. toukokuuta 2019
lauantai 20. huhtikuuta 2019
How the Boeing 737 Max Disaster Looks to a Software Developer
How the Boeing 737 Max Disaster Looks to a Software Developer: Design shortcuts meant to make a new plane seem like an old, familiar one are to blame
lauantai 6. huhtikuuta 2019
One timewasting sieve more: The Go version
Studied Go (or Golang) for work, and of course wanted to gauge its performance. Here is a port of the sieve benchmark.
// Sieve benchmark in Go, based on the Java code at
// http://rsb.info.nih.gov/nih-image/java/benchmarks/Sieve.java
package main
import (
"time"
"math"
"strconv"
)
func main () {
const SIZE = 8190
// For "similarness" with other versions, allocate dynamically
var flags []bool = make([]bool, SIZE+1)
var i, prime, k, count int
var iterations int = 0
var seconds float64
var score int = 0
var startTime time.Time
var elapsedTime time.Duration = 0
var tenSeconds time.Duration
tenSeconds, _ = time.ParseDuration("10s")
startTime = time.Now();
for elapsedTime < tenSeconds {
count=0;
for i=0; i<=SIZE; i++ {
flags[i]=true;
}
for i=0; i<=SIZE; i++ {
if flags[i] {
prime=i+i+3
for k=i+prime; k<=SIZE; k+=prime {
flags[k]=false
}
count++
}
}
iterations++
elapsedTime = time.Now().Sub(startTime)
}
seconds = elapsedTime.Seconds()
score = int(math.Round(float64(iterations) / seconds))
println(strconv.Itoa(iterations) + " iterations in " +
strconv.FormatFloat(seconds, 'g', -1, 64) + " seconds")
if count != 1899 {
println("Error: count <> 1899")
} else {
println("Sieve score = " + strconv.Itoa(score))
}
}
// Sieve benchmark in Go, based on the Java code at
// http://rsb.info.nih.gov/nih-image/java/benchmarks/Sieve.java
package main
import (
"time"
"math"
"strconv"
)
func main () {
const SIZE = 8190
// For "similarness" with other versions, allocate dynamically
var flags []bool = make([]bool, SIZE+1)
var i, prime, k, count int
var iterations int = 0
var seconds float64
var score int = 0
var startTime time.Time
var elapsedTime time.Duration = 0
var tenSeconds time.Duration
tenSeconds, _ = time.ParseDuration("10s")
startTime = time.Now();
for elapsedTime < tenSeconds {
count=0;
for i=0; i<=SIZE; i++ {
flags[i]=true;
}
for i=0; i<=SIZE; i++ {
if flags[i] {
prime=i+i+3
for k=i+prime; k<=SIZE; k+=prime {
flags[k]=false
}
count++
}
}
iterations++
elapsedTime = time.Now().Sub(startTime)
}
seconds = elapsedTime.Seconds()
score = int(math.Round(float64(iterations) / seconds))
println(strconv.Itoa(iterations) + " iterations in " +
strconv.FormatFloat(seconds, 'g', -1, 64) + " seconds")
if count != 1899 {
println("Error: count <> 1899")
} else {
println("Sieve score = " + strconv.Itoa(score))
}
}
keskiviikko 28. kesäkuuta 2017
curses
Fascinating, Ubuntu requires me to install libncurses5-dev to compile a curses-using program (Nethack). I wonder why so un-intuitive name.
Tilaa:
Blogitekstit (Atom)