Wishing everyone Happy Valentine Day with delicious fudge cupcakes. Today we bake some fudge cupcakes from King Arthur Flour’s recipe and get it ready for tomorrow celebration.
- Categories
- Buddies & Links
Something Personal Yet Public
Wishing everyone Happy Valentine Day with delicious fudge cupcakes. Today we bake some fudge cupcakes from King Arthur Flour’s recipe and get it ready for tomorrow celebration.
Oh. We know the dish does not looked like gnocchi. It is our first time to make them. We spent around two hours to make both pesto and gnocchi. We made the pesto first. We believed we were overdosing the cheese making the pesto very think to blend in our low power food processor. It made us put more olive oil. At last, it turned out taste good. Next is gnocchi. Since we are so hungry, we simply cut the pasta into big square shape. After boiling, it turned even bigger. In the end, it was a good experience. The recipe was from our favourite food blog, King Arthur Flour – Baking Banter. Our mouth still full of garlic smell, even after cleaning our teeth and mouth washing with mouth rinse. We were still deciding whether we should go out after this. We don’t want to scary away people with our garlic smell. We guess tonight is not a good night to make this dish.
For track 2 on week 2, I basically need to read chapter 4 and 5 on Eloquent JavaScript.
split and join are not precisely each other’s inverse. string.split(x).join(x) always produces the original value, but array.join(x).split(x) does not. Can you give an example of an array where .join(" ").split(" ") produces a different value?catNames that takes a paragraph as an argument and returns an array of names? Strings have an indexOf method that can be used to find the (first) position of a character or sub-string within that string. Also, when slice is given only one argument, it will return the part of the string from the given position all the way to the end. It can be helpful to use the console to ‘explore’ functions. For example, type "foo: bar".indexOf(":") and see what you get."died 27/04/2006: Black Leclère", is always in the exact same place of a paragraph. How convenient. Write a function extractDate that takes such a paragraph as its argument, extracts the date, and returns it as a date object.between("born 15/11/2003 (mother Spot): White Fang", "(mother ", ")") gives "Spot". between("bu ] boo [ bah ] gzz", "[ ", " ]") returns "bah". To make that second test work, it can be useful to know that indexOf can be given a second, optional parameter that specifies at which point it should start searching.formatDate function used by catInfo does not add a zero before the month and the day part when these are only one digit long. Write a new version that does this.oldestCat which, given an object containing cats as its argument, returns the name of the oldest living cat.range function from exercise 4.2 to take a second, optional argument. If only one argument is given, it behaves as earlier and produces a range from 0 to the given number. If two arguments are given, the first indicates the start of the range, the second the end.print(sum(range(1, 10))); We have range now. All we need to make this line work is a sum function. This function takes an array of numbers, and returns their sum. Write it, it should be easy.On track 1 week 2, we are continuing understanding JavaScript through Douglas Crockford’ video as below and chapter 3 on functions, from Eloquent Javascript.
Douglas Crockford: “The JavaScript Programming Language”/2 of 4 @ Yahoo! Video
show() provided in Eloquent Javascript a pure function? According to the book, the defining properties of pure functions are that they always return the same value when given the same arguments, and never have side effects. They take some arguments, return a value based on these arguments, and do not monkey around with anything else. The function show() is not a pure function as it is not self-sufficient.object(o) function. The other key is function. The object(o) function makes a new empty object with a link to object to. Refer to the Douglas Crockford for more classical inheritance in JavaScript.myobject[name] = value;array inherits from object. The indexes are converted to strings and used as names for retrieving values. Arrays, unlike objects, have a special length member. Arrays allows use of the traditional for statement. Only use for..in for objects and not arrays. The dot notation also should only use for objects and not arrays. Use objects when the names are arbitrary strings. On the other hands, use arrays when the names are sequential integers. We can’t use arrays as prototypes as the objects produced this way does not have array nature. It will inherit the array’s values and methods, but not its length. We can augment an individual array by assigning a method to it. This works as arrays are objects. We also can augment all arrays by assigning the methods to Array.prototype.absolute, which returns the absolute value of the number it is given as its argument. The absolute value of a negative number is the positive version of that same number, and the absolute value of a positive number (or zero) is that number itself. greaterThan, which takes one argument, a number, and returns a function that represents a test. When this returned function is called with a single number as argument, it returns a boolean: true if the given number is greater than the number that was used to create the test function, and false otherwise.This post is a reply for the Javascript: 101 Week 1 Track 1. Mainly answering questions for reflection and homework.
parseInt("08") == 0.115 * 4 - 4 + 88 / 2 = 500 as multiplication and division are calculating first before addition and subtraction. After multiplication and division, the equation will be 460 - 4 + 44.typeof 4.5 is to returning the type of 4.5 in string format, which is number in this case. On the other hand, typeof (typeof 4.5) will return string because typeof function is returning string type. There is not special type of data type in JavaScript.Answer for exercises 2.1 – 2.6 from chapter 2 of Eloquent Javascript, please refer to Javascript: 101 Week 1 Track 2.
Example that shows a valid use of the ‘guard’ and ‘default’ operators in JavaScript.
This post is a reply for the Javascript: 101 Week 1 Track 2. Mainly answering questions for reflection and homework.
115 * 4 - 4 + 88 / 2 = 500 as multiplication and division are calculating first before addition and subtraction. After multiplication and division, the equation will be 460 - 4 + 44.typeof 4.5 is to returning the type of 4.5 in string format, which is number in this case. On the other hand, typeof (typeof 4.5) will return string because typeof function is returning string type. There is not special type of data type in JavaScript.document and window.Exercises 2.1
It is true. As (false || true) && !(false && true).
Exercises 2.2
Write a program that calculates and shows the value of 210 (2 to the 10th power).
Exercises 2.3
With some slight modifications, the solution to the previous exercise can be made to draw a triangle.
Exercises 2.4
Rewrite the solutions of the previous two exercises to use for instead of while.
Exercises 2.5
Write a program to ask yourself, using prompt, what the value of 2 + 2 is. If the answer is “4″, use alert to say something praising. If it is “3″ or “5″, say “Almost!”. In other cases, say something mean.
Exercises 2.6
Add a while and optionally a break to your solution for the previous exercise, so that it keeps repeating the question until a correct answer is given.
Exercises 3.1
Write a function called absolute, which returns the absolute value of the number it is given as its argument. The absolute value of a negative number is the positive version of that same number, and the absolute value of a positive number (or zero) is that number itself.
Exercises 3.2
Write a function greaterThan, which takes one argument, a number, and returns a function that represents a test. When this returned function is called with a single number as argument, it returns a boolean: true if the given number is greater than the number that was used to create the test function, and false otherwise.
Writing this post after watching the video below is the first task of signing up JavaScript 101. I knew about this video long time ago. Only today, I really pay 100% attention on what Yahoo! JavaScript Architect Douglas Crockford say in this video.
This post is mainly about what I learned from this video. Here there are in point form:
The second task is writing a simple JavaScript program which will print the sum of 2+2 and display the result in an alert window in the browser. I have to create an HTML page and put the JavaScript code within that page, so it executes when the page loads.
Baking cake is one of the things I do during holiday season. Today we want to try out a basic cake from a very old cooking book in Australia. Luckily it turned out well and tasted not bad too. Yummy. Tonight dessert will be chocolate cake with vanilla ice cream.
Tonight we cooked rice pudding. It is different from what I know. Rice does not have to be savoury. It can be cook as dessert too. We used lemon and orange rinds with cinnamon sticks as the pudding favours. Rice pudding main ingredients are rice, milk and sugar. We garnished it with sultanas, butter and nutmeg.
Last weekend, we decide to take Sydney ferries, Rivercat, to Parramatta. It was last minute decision.
The main purpose was Rivercat experience. It allowed me to see the different side of Sydney, river view from Sydney to Parramatta. Unfortunately, it was low tide on that day. The last stop is Rydalmere, the stop before Parramatta. After that, they will provide the bus service to Parramatta. It wasn’t a good weather for outing as well. Very cloud. Rain was drizzling most of the trip. On the trip, we grab a new book that we recently bought, Food Shopping Guide. It tells us where can we find specific ingredients in Sydney and near by suburbs. During the way to Parramatta, we quickly browsed through the book and decided to visit two Indian stores, Himalaya Spice Centre and India Bazaar Parramatta, in Harris Park, next suburbs of Parramatta and one Polish food store, Tatra Delicatessen, in Parramatta. Surprisingly, we founds lots of India restaurants, video shop and clothing in Harris Park. Next time, we know where to go for exotic India spices and ingredients. After having north Indian food as late lunch, we continued our journey to Parramatta. Unfortunately, it almost evening. Most of the shops, included the Polish food store, were closed. Lastly, we visited the Parramatta Westfield before catching the trains back to town.
It was a pleasant to visit other city beside Sydney. I definitely want to do more in next future.