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.
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.
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.
Det kanske är dags för en uppgradering:
http://tinkerbin.com/KK0vUmdc (Välj HAML, respektive Coffeescript innan du trycker på Run)
I have made a population growth model, with the following rules:
Starting with one single boy being born in the year of 2000, we get the result below.
Explanation:
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
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
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
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
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.
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.
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
Theme: Rubric. Blog at WordPress.com.