The Minimizer

2011-10-10

Bloggbyte!

Filed under: Uncategorized — theminimizer @ 10:46

Jag försöker fokusera på Googles produkter och flyttar därför bloggen till http://tribonacci.blogspot.com/. Det handlar också om att teknologin som WordPress tillhandahåller inte känns helt up to date.

 

 

2011-10-09

Framstående judar

Filed under: Uncategorized — theminimizer @ 12:53

 

 

http://www.jinfo.org/index.html

 

 

Förslag till uppgradering av nybörjarkurs i programmering på KTH

Filed under: Uncategorized — theminimizer @ 10:53

Den här kursen från KTH verkar vara en riktig klassiker.  http://www.ict.kth.se/courses/ID120V/files/L1/index.htm

Här får den entusiastiske studenten en rejäl chans chans att bli avskräckt från programmering för all framtid.

  • JSP - Jackson Structured Programming (1975)
  • C – språket (Bell Labs 1973)
  • Kommandoprompt - ej fönsterbaserat (Microsoft 1985, Apple 1984)
  • Övningen går ut på att bygga en komplex kalkylator. Olämpligt eftersom många inte ens vet vad komplexa tal innebär.
  • Hälften av övningstexten diskuterar parameteröverföring i C. Borde ersättas med immutable objects.
  • Ingen enhetlig utvecklingsmiljö.

Det kanske är dags för en uppgradering:

  • CoffeeScript (2010), ett modernt Ruby-liknande språk som kompileras till JavaScript (1995)
  • Objektorientering, (1960-talet)
  • Testbaserad utveckling (2003)
  • HAML - strukturerad HTML  (2010)
  • jQuery, koppling mellan Javascript och HTML. (2006)
  • TinkerBin (2011), En online utvecklingsmiljö, mycket lämplig för utbildning. Samma för alla studenter, oavsett dator.
  • Chrome, innehåller bra debugger för Javascript. (2008)

http://tinkerbin.com/KK0vUmdc (Välj HAML, respektive Coffeescript innan du trycker på Run)

Skum sajt

Filed under: Uncategorized — theminimizer @ 10:45

http://redbey.com/

Den här framstående IT-personen från UAE verkar vara oerhört produktiv:
http://redbey.com/index.php/10-web-based-sandbox-tools-for-testing-your-code-snippets/
Tyvärr är artikeln inkopierad från den här sajten, med kommentarer och allt:
http://sixrevisions.com/tools/sandbox-testing-code-snippets/
vilket han iofs inte döljer.
Jag blir också misstänksam när texten inte går att selektera på teckennivå, utan bara ordnivå.
Inte sökbar alltså. Han har något att dölja.
Denne muslim verkar vara modern och duktig, men som så ofta är det bara en tom fasad, byggd på stöld.
Jämför med denne israel:
Här har vi 100% egenskapat material, tung teknik.
Man förstår varför nobelprisen hamnar där de hamnar.

2011-10-02

About population growth

Filed under: Uncategorized — theminimizer @ 19:43

I have made a population growth model, with the following rules:

  • Each man marries exactly four wives.
  • The man marries his wives at the age of 18, 20, 22 and 24.
  • The wives are all 18 years old when they marry.
  • Each woman gives birth to exactly eight children.
  • The children are born at their mother’s age 19, 21, 23, 25, 27, 29, 31 and 33.
  • All new partners are imported from abroad.

Starting with one single boy being born in the year of 2000, we get the result below.

Explanation:

  • Each line contains year, persons added during the year and accumulation since 2000.
  • In 2000 the boy is born
  • In 2018 he marries his first wife
  • In 2019 their first child is born
  • In 2020 he marries his second wife
  • In 2021 both his wifes delivers one child each
  • In 2038 at the age of 38 he will become grandfather
  • In total he will have 32 children and 1024 grandchildren
After 100 years, this single man has imported and given birth to 74118 persons.
Considering an average life span of 80 years, four of these are dead at he end of the century, leaving 74114 persons alive at the turn of the century.
The growth per year is around 12%. This is a very high number, considering a population going double in twenty years, equals a yearly growth at only 3.5%.
This process is starting to happen in some parts of Europe. If there is a mastermind or not behind this process is not important, the result is the same.
BBC
Snaphanen
Daily Mail
Fertility Rates by Country
2000 1 1
2018 1 2
2019 1 3
2020 1 4
2021 2 6
2022 1 7
2023 3 10
2024 1 11
2025 4 15
2027 4 19
2029 4 23
2031 4 27
2033 4 31
2035 3 34
2037 3 37
2038 1 38
2039 4 42
2040 3 45
2041 6 51
2042 8 59
2043 10 69
2044 16 85
2045 13 98
2046 27 125
2047 15 140
2048 40 180
2049 16 196
2050 54 250
2051 16 266
2052 68 334
2053 15 349
2054 80 429
2055 13 442
2056 91 533
2057 11 544
2058 98 642
2059 10 652
2060 104 756
2061 17 773
2062 112 885
2063 37 922
2064 126 1048
2065 80 1128
2066 149 1277
2067 154 1431
2068 181 1612
2069 268 1880
2070 220 2100
2071 426 2526
2072 261 2787
2073 630 3417
2074 302 3719
2075 877 4596
2076 337 4933
2077 1156 6089
2078 362 6451
2079 1457 7908
2080 381 8289
2081 1764 10053
2082 407 10460
2083 2072 12532
2084 480 13012
2085 2381 15393
2086 661 16054
2087 2710 18764
2088 1047 19811
2089 3081 22892
2090 1753 24645
2091 3522 28167
2092 2925 31092
2093 4056 35148
2094 4709 39857
2095 4692 44549
2096 7248 51797
2097 5427 57224
2098 10653 67877
2099 6241 74118

2011-09-12

Ladies and Coffeescript

Filed under: Uncategorized — theminimizer @ 10:49

I’ve made a Google search for “Coffeescript” and checked the sex of the found persons. I got 100 persons, of these 97 are male, 2 female and 1 transsexual. The girls are from the Philippines and India, by the way. It’s a pity all the western girls are busy getting their exams in gender theory and other luxury educations, instead of making this list fifty-fifty.

Aaron Russell
Aaron Weinberger aw9994@cs.ship.edu
Adam DeGizmo
Addy Osmani
Alessandro Dal Grande
Alex MacCaw
Alex Young
Amir Salihefendic
Andrew Chalkley
Andrew Luetgers
Arbo von Monkiewitsch
Autotelicum
Axel Rauschmayer
Ben Newman
Ben Nolan
Bill Dawson
Bodil Stokke
Brendan Eich
Charles Maxwood
Dan Hulton
Daniel Moore
Darcy Laycock
David Brady ratgeyser@gmail.com
David Eisinger
David Guttman
David Heinemeier Hansen
David Moulton dave@themoultons.net
David Padbury
Dmitry Soshnikov
Eifion Bedford
Erik Allam
Erwin van der Koogh
Geoffrey Grosenbach
Geza Kovacs
Ivan Towlson
Jack DEmpsey
Jai-Gouk Kim
James C. Holder coffeescriptcookbook.com@thirdtruck.org
Jamie Gaskins jgaskins@gmail.com
Jamis Buck
Jan Van Ryswyck
Jason Giedymin jasong@apache.org
Jason Porritt
Jason Seifer
Jeremy Ashekenas
Joel McCracken
John Ford jwford@gmail.com
Jon Galloway
Jonas Arnklint
Jonas Elfström
Josh Timonen
Joshua Peek
João Moreno coffeecb @joaomoreno .com
Justin Bozonier
Justin Reidy
Katherine G. Pe www.blog.bridgeutopiaweb.com
Khaled alHabache
Klint Finley
Kris Jordan
Liam McLennan
Luke Morton
Mark Bates
Mark Essel
Mattias Petter Johansson
Maurice Machado
Michael Hunger
Michael Ross
Michael van Rooijen
Mick Koch
Mike Moore mike@blowmage.com
Mikhail Nasyrov
Nic Williams
Nick Perkins
Patrick Schless
Peter Cooper
Peter Hellberg peter@c7.se
Peter Hoffmann
Phil Cohen github@phlippers.net
Ricardo Tomasi
Rico Sta. Cruz
Rod Vagg
Ryan Bates
Ryan McGeary
Ryan Singer
Sam Stephenson
Schalk
Scott Davis
Scott Hanselman
Sebastian Slomski sebastian@simple-systems.org
Shreya Bhatia
Siddharth
Stefan Buhrmester
Stephan Sokolow
Steven Reid steven @ reidnorthwest . com
Thomas Reynolds
Tim Lossen
Travis Swicegood
Trevor Burnham
Wynn Netherland
Yevgeniy Brikman

2011-09-06

International Coffeescript

Filed under: Uncategorized — theminimizer @ 21:37

I’ve compared the number of hits for different countries searching for the word “coffeescript”

Japan 949000

USA 875000

India 4410

Sweden 2280

Finland 546

Denmark 519

Norway 329

Indonesia 295

Iran 73

Malaysia 72

Turkey 9

Saud Arabia 4

Pakistan 3

Afghanistan 1

Egypt 0

Iraq 0

Jordan 0

Kuwait 0

North Korea 0

Yemen 0

Zimbabwe 0

2011-08-20

CoffeeScript

Filed under: Programming — theminimizer @ 12:41

Måste nämna ett språk som jag tror kommer att påverka/ersätta Javascript i en nära framtid. Språket har inspirerats av Ruby, Python och Haskell bland annat. Det är implementerat med hjälp av en Transpiler skriven i språket självt av Jeremy Ashkenas. Jag är en stor vän av indenterade språk och Coffeescript är ett sådant, precis som Python och Cobra. Skönt att slippa curly brackets och begin .. end. Javascript går att köra både i klienter och på servern och det samma gäller Coffeescript. Javascript är en mycket bra plattform men har nackdelen att syntaxen är onödigt stökig. CoffeeScript har nu löst detta problem!

Ett smakprov:

CoffeeScript:

class StopWatch
  constructor: -> @start = new Date()
  read: -> new Date() - @start

Genererad Javascript:

StopWatch = (function() {
  function StopWatch() {
    this.start = new Date();
  }
  StopWatch.prototype.read = function() {
    return new Date() - this.start;
  };
  return StopWatch;
})();

Några länkar:
Översikt, exempel på hur olika språkelement översätts till Javascript: http://jashkenas.github.com/coffee-script/

Provkör CoffeeScript interaktivt (Basic Graphics), se skapad html och resultatet, doc ej Javascript:  http://shpaml.webfactional.com/misc/PipeDent/demo.htm#

En liten online bok om CoffeeScript: http://arcturo.github.com/library/coffeescript/

Presentation av CoffeeScript på Javascript Conference 2011: http://blip.tv/jsconf/jsconf2011-jeremy-ashkenas-5258082

Video på 74 minuter producerad av PeepCode (12 USD): http://peepcode.com/products/coffeescript

Exempel på CoffeeScript i verkliga applikationer: https://github.com/jashkenas/coffee-script/wiki/In-The-Wild

Bok: http://pragprog.com/book/tbcoffee/coffeescript

Hela Transpilern (600 kodrader): http://jashkenas.github.com/coffee-script/documentation/docs/grammar.html

2008-11-02

How to store a GPS coordinate in one byte or less.

Filed under: Geography,Programming — theminimizer @ 10:07

The market is flooded with GPS gadgets storing GPS coordinates in a very wasteful manner.

Below is an example of how one GPS coordinate is stored using 96 bytes, in the popular gpx format:

<trkpt lat=’59.271327′ lon=’17.846174′>
 <ele>1.375</ele>
 <time>2008-10-14T16:24:35Z</time>
</trkpt>

What a waste, thanks to XML!

Let’s make an example. The sample gpx file contains 2269 gps points. The size of this file is 223132 bytes.
The zipped file size is 30579 bytes. But, there is a lot of redundancy left.

Now we are going to see how it is possible to make a 94-fold reduction in size.

  • Skip all time stamps except the first one.
  • Use UTM instead of WGS84. Let’s use one meter precision.
  • Skip the elevation, it has bad precision anyway.
  • Compute the first difference between the points. This gives us the speed in m/s.
  • Compute the second difference. This gives us the acceleration in m/s².
  • Skip the XML. Use binary storage instead.

If the vehicle is moving straight at a constant speed, the acceleration will be zero (0,0).
Store accelerations between -7 and 8 m/s² in one byte (16×16=256).
Reserve one of these as a prefix for double byte acceleration covering -127 to 128 m/s² (256×256=65536).

This way 2269 points can be compressed into 4 + 8 + 8 + 2362 = 2382 bytes.

It is possible to save even more space using Huffman coding as some accelerations will be more common.
Huffman coding brings the numbers down from about 8.4 to 4.4 bits per gps position.

Using decimeter instead of meter precision approximately doubles the storage needed.

Note: Acceleration and retardation for a car is approx 1g = 10 m/s².
      Acceleration of the Space Shuttle or Jumbo Jet: 3g = 30 m/s².
      Turning acceleration for military aircraft: 9g = 90 m/s².
     
Constant recording during one year can be stored in 365 x 24 x 60 x 60 = 32 megabytes.
The gpx format will store only four days in the same amount of memory.

2008-05-18

Kilimanjaro extremast.

Filed under: Geography — theminimizer @ 12:19

Om man tar hänsyn till att jorden inte är rund, så befinner sig Kilimanjaros topp längst bort från jordens medelpunkt. Jordens ekvatorsradie, R = 6378.137 km, medan jordens polarradie, r = 6356.752 km. Detta innebär att avståndet till jordens centrum ökar med 237.6 meter per grad (eller 3.96 meter per distansminut), då man rör sig från en av polerna mot ekvatorn. Mount Everest med höjden 8848 meter ligger på 28:e latituden, Kilimanjaro har höjden 5895 meter och ligger på tredje latituden. Detta innebär att Kilimanjaros topp ligger cirka 2947 meter längre bort från jordens medelpunkt än Mount Everest. Det finns med andra ord ingen anledning att utsätta sig för risken att dö (8.6%) genom att bestiga Mount Everest.

assert (R-r)/90 == 237.6 meter
assert (R-r)/(90*60) == 3.96 meter
assert (8848-5895) - 24.91 * 237.6 == 2947 meter

Next Page »

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.