<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Guowei Lv</title>
    <link>https://www.lvguowei.me/</link>
    <description>Recent content on Guowei Lv</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 04 May 2026 11:53:34 +0300</lastBuildDate><atom:link href="https://www.lvguowei.me/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Flow exception handling (Part 1)</title>
      <link>https://www.lvguowei.me/post/kotlin-flow-exception/</link>
      <pubDate>Mon, 04 May 2026 11:53:34 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/kotlin-flow-exception/</guid>
      <description>You may have heard that &amp;ldquo;No try/catch inside Flow&amp;rdquo; or &amp;ldquo;Only use catch() operator&amp;rdquo;. But why? Let&amp;rsquo;s explore from the beginning.
Here is a very simple setup:
fun main() = runBlocking { val worker = Worker() val scope = CoroutineScope(EmptyCoroutineContext) val flow = flow { emit(1) emit(2) emit(3) } scope.launch { try { flow.collect { println(worker.doWork(it)) } } catch (e: Exception) { println(&amp;#34;Error in collect: ${e.message}&amp;#34;) } } delay(10000) } class Worker { fun doWork(n: Int): String = if (Random.</description>
    </item>
    
    <item>
      <title>What is a Coroutine?</title>
      <link>https://www.lvguowei.me/post/kotlin-coroutine-1/</link>
      <pubDate>Tue, 17 Jun 2025 11:53:34 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/kotlin-coroutine-1/</guid>
      <description>The first question we should ask when learning Kotlin Coroutine is: what is a Coroutine after all?
Let&amp;rsquo;s go back to the Thread world and ask the same question, what is a Thread? Here is code that will create a simple Thread and start it:
val thread = thread { } So the answer seems obvious, a Thread is just the Thread object returned.
Easy.
Can we say the same in the Coroutine world?</description>
    </item>
    
    <item>
      <title>Pointfree Ep2 Side Effects</title>
      <link>https://www.lvguowei.me/post/pointfree-ep2-side-effects/</link>
      <pubDate>Mon, 08 Jul 2024 15:38:31 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/pointfree-ep2-side-effects/</guid>
      <description>The title of this episode is called &amp;ldquo;Side effects&amp;rdquo;, but in my opinion, it&amp;rsquo;s all about how to move side-effects out of the function and make the function composable.
Side effects in the body of the function If there is some side-effects in the body of the function, we can move the side-effect into the return of the function, and let the caller deal with it.
func computeWithEffect(_ x: Int) -&amp;gt; Int { let computation = x * x + 1 print(&amp;#34;Computed \(computation)&amp;#34;) return computation } We can move the stuff to print into the return type.</description>
    </item>
    
    <item>
      <title>Monthly Favourite Songs</title>
      <link>https://www.lvguowei.me/post/fav-songs-6/</link>
      <pubDate>Fri, 05 Jul 2024 22:25:27 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/fav-songs-6/</guid>
      <description>When I was very young, like in primary school, I got a cassette of anime songs, I was so shocked and immediately fallen in love with. It&amp;rsquo;s a collection of songs from Macross 7. To this day, I have never watched that anime, but the songs are so touching I have to post it here.
I found this amazing live concert that contains all the familiar melodies:</description>
    </item>
    
    <item>
      <title>Pointfree Ep1 Functions</title>
      <link>https://www.lvguowei.me/post/pointfree-ep1-functions/</link>
      <pubDate>Fri, 05 Jul 2024 21:56:51 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/pointfree-ep1-functions/</guid>
      <description>I&amp;rsquo;m starting a new series, mostly just me taking notes while I go through the PointFree videos.
The pipe operator The |&amp;gt; operator is defined as:
precedencegroup ForwardApplication { associativity: left } infix operator |&amp;gt;: ForwardApplication func |&amp;gt; &amp;lt;A, B&amp;gt;(x: A, f: (A) -&amp;gt; B) -&amp;gt; B { return f(x) } It can be used as::
func incr(_ x: Int) -&amp;gt; Int { return x + 1 } func square(_ x: Int) -&amp;gt; Int { return x * x } 2 |&amp;gt; incr |&amp;gt; square Function composition operator This operator is defined as: precedencegroup ForwardComposition { higherThan: ForwardApplication associativity: left } infix operator &amp;gt;&amp;gt;&amp;gt;: ForwardComposition func &amp;gt;&amp;gt;&amp;gt; &amp;lt;A, B, C&amp;gt;(_ f: @escaping (A) -&amp;gt; B, _ g: @escaping (B) -&amp;gt; C) -&amp;gt; ((A) -&amp;gt; C) { return { a in g(f(a)) } }</description>
    </item>
    
    <item>
      <title>Bites of Compose 16</title>
      <link>https://www.lvguowei.me/post/bites-of-compose-16/</link>
      <pubDate>Fri, 24 Nov 2023 21:24:41 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/bites-of-compose-16/</guid>
      <description>In previous post we talked about how to do animation in Compose using animateXXXAsState() function. And also see that though easy to use, it has limited customization capabilities.
Now, let&amp;rsquo;s take a look at a lower level(and more powerful) way: Animatable.
@Composable fun AnimatableDemo() { val coroutineScope = rememberCoroutineScope() val anim = remember { Animatable(48.dp, Dp.VectorConverter) } Box( modifier = Modifier .size(anim.value) .background(Color.Green) .clickable { coroutineScope.launch { val current = anim.</description>
    </item>
    
    <item>
      <title>Bites of Compose 15</title>
      <link>https://www.lvguowei.me/post/bites-of-compose-15/</link>
      <pubDate>Thu, 23 Nov 2023 10:52:09 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/bites-of-compose-15/</guid>
      <description>Let&amp;rsquo;s take a look at the simplest way to implement animation in Compose, which is using animateXXXAsState() set of functions.
Let&amp;rsquo;s say we want to increase the size of a Box by 10.dp every time we click on it.
We already know how to do it without animation:
@Preview @Composable fun AnimationDemo() { var target by remember { mutableStateOf(48.dp) } Box( modifier = Modifier .size(target) .background(Color.Green) .clickable { target += 10.</description>
    </item>
    
    <item>
      <title>Bites of Compose 14</title>
      <link>https://www.lvguowei.me/post/bites-of-compose-14/</link>
      <pubDate>Mon, 20 Nov 2023 20:33:01 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/bites-of-compose-14/</guid>
      <description>In previous post, we discussed the mental model of multiple LayoutModifiers. Now let&amp;rsquo;s talk about the mental model of the combination of LayoutModifier and DrawModifier.
First of all, we need to know that everything on screen is drawn using some DrawModifier: Text, Image, Background, etc.
Let me give you the mental model directly.
Given the following code: Modifier.drawModifier1().drawModifier2().drawModifier3().layoutModifier1() .drawModifier4().drawModifier5().layoutModifier2() .drawModifier6().layoutModifier3()
The model is: Notice that the modifiers are always attached to its nearest LayoutModifier on the right.</description>
    </item>
    
    <item>
      <title>Bites of Compose 13</title>
      <link>https://www.lvguowei.me/post/bites-of-compose-13/</link>
      <pubDate>Tue, 07 Nov 2023 12:43:25 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/bites-of-compose-13/</guid>
      <description>When we have multiple LayoutModifiers, how do we think about them?
In this post, I will introduce a useful mental model.
First we need to understand that LayoutModifier determines size and position of a component.
The model is simple, let&amp;rsquo;s say we have the following code:
Text( text = &amp;#34;Hello&amp;#34;, modifier = Modifier .padding(20.dp) .background(Color.Green) // ignore this for now, only for understanding purpose .size(50.dp) ) We can think of this as:</description>
    </item>
    
    <item>
      <title>Bites of Compose 12</title>
      <link>https://www.lvguowei.me/post/bites-of-compose-12/</link>
      <pubDate>Fri, 03 Nov 2023 21:56:21 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/bites-of-compose-12/</guid>
      <description>LayoutModifier is a very important type of Modifier in Compose. It can decorate its component&amp;rsquo;s layout. So let&amp;rsquo;s get an idea of what this means by implementing padding using it.
Let&amp;rsquo;s try to add a 10dp padding around a Text.
class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { LayoutModifierPadding() } } } @Composable fun LayoutModifierPadding() { Box( modifier = Modifier .size(100.dp) .background(Color.LightGray) ) { Text( &amp;#34;Hello!</description>
    </item>
    
    <item>
      <title>Bites of Compose 11</title>
      <link>https://www.lvguowei.me/post/bites-of-compose-11/</link>
      <pubDate>Fri, 06 Oct 2023 12:59:22 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/bites-of-compose-11/</guid>
      <description>Let&amp;rsquo;s see an example of how to use LookAheadLayout to implement shared view transition animation.
Here is the code:
@Composable fun Avatar(modifier: Modifier = Modifier) { Box( modifier = modifier .size(100.dp) .background(Color.Green) ) } @OptIn(ExperimentalComposeUiApi::class) @Composable fun CustomLookAheadLayout3() { var flag by remember { mutableStateOf(false) } var lookaheadOffset by remember { mutableStateOf(Offset.Zero) } val lookaheadOffsetAnim by animateOffsetAsState( targetValue = lookaheadOffset, animationSpec = TweenSpec(durationMillis = 500), label = &amp;#34;&amp;#34; ) val sharedView = remember { movableContentOf { Avatar( modifier = Modifier .</description>
    </item>
    
    <item>
      <title>Bites of Compose 10</title>
      <link>https://www.lvguowei.me/post/bites-of-compose-10/</link>
      <pubDate>Thu, 24 Aug 2023 14:51:21 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/bites-of-compose-10/</guid>
      <description>Let&amp;rsquo;s see an example of how to do custom layout in compose using Layout().
@Composable fun CustomLayout(modifier: Modifier = Modifier, content: @Composable () -&amp;gt; Unit) { Layout(modifier = modifier, content = content) { measurables, constraints -&amp;gt; var width = 0 var height = 0 val offset = 10.dp.toPx().roundToInt() val placeables = measurables.map { measurable -&amp;gt; measurable.measure(constraints).also { placeable -&amp;gt; width = max(placeable.width, width) height += placeable.height } } layout(width = width + offset * placeables.</description>
    </item>
    
    <item>
      <title>Bites of Compose 9</title>
      <link>https://www.lvguowei.me/post/bites-of-compose-9/</link>
      <pubDate>Tue, 22 Aug 2023 13:13:13 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/bites-of-compose-9/</guid>
      <description>Let&amp;rsquo;s see an example of using the Android&amp;rsquo;s native Canvas in Compose.
One of the things that is impossible to do in Compose is doing 3D rotation.
Let&amp;rsquo;s see how to get hold of the native Canvas and do it the old way.
@Composable fun MyView() { val image = ImageBitmap.imageResource(R.drawable.avatar) val paint by remember { mutableStateOf(Paint()) } val animatable = remember { Animatable(0f) } val camera by remember { mutableStateOf(Camera()) } LaunchedEffect(Unit) { animatable.</description>
    </item>
    
    <item>
      <title>Bites of Compose 8</title>
      <link>https://www.lvguowei.me/post/bites-of-compose-8/</link>
      <pubDate>Wed, 16 Aug 2023 09:35:52 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/bites-of-compose-8/</guid>
      <description>Today&amp;rsquo;s topic is rememberCoroutineScope.
Situation 1 How to launch a Coroutine in Compose?
Can we &amp;ldquo;just do it&amp;rdquo; ?
class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { lifecycleScope.launch { } } } } Answer Apparently, no. Android studio gives an error saying
&amp;ldquo;Calls to launch should happen inside a LaunchedEffect and not composition&amp;rdquo;.
OK, now we know that we shouldn&amp;rsquo;t do it and how to fix it by using LaunchedEffect.</description>
    </item>
    
    <item>
      <title>Bites of Compose 7</title>
      <link>https://www.lvguowei.me/post/bites-of-compose-7/</link>
      <pubDate>Wed, 02 Aug 2023 18:24:39 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/bites-of-compose-7/</guid>
      <description>Let&amp;rsquo;s talk about side effects in Compose.
Situation 1 What will happen when the button is clicked?
@Composable fun Test() { var flag by remember { mutableStateOf(false) } Column { Button(onClick = { flag = !flag }) { Text(&amp;#34;change&amp;#34;) } Text(flag.toString()) Log.d(&amp;#34;test&amp;#34;, &amp;#34;flag is $flag&amp;#34;) } } Answer The Text on the screen will change, also there will be a log entry in logcat.
This logging behaviour is something called a side-effect in compose world.</description>
    </item>
    
    <item>
      <title>Bites of Compose 6</title>
      <link>https://www.lvguowei.me/post/bites-of-compose-6/</link>
      <pubDate>Mon, 15 May 2023 21:58:15 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/bites-of-compose-6/</guid>
      <description>In previous post we talked about the companion object Modifier and how it&amp;rsquo;s implementing the interface Modifier. Now it is time to go deeper and see Modifier&amp;rsquo;s internals.
Situation 1 What is Modifier after all?
Answer Well, what if I tell you Modifier is just a binary tree data structure.
Let&amp;rsquo;s dive into the source code to prove this.
First let&amp;rsquo;s take a look at the class hierachy, we have 3 pieces: Modifier(interface), Element and CombinedModifier.</description>
    </item>
    
    <item>
      <title>Bites of Compose 5</title>
      <link>https://www.lvguowei.me/post/bites-of-compose-5/</link>
      <pubDate>Fri, 03 Mar 2023 20:19:56 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/bites-of-compose-5/</guid>
      <description>Let&amp;rsquo;s talk about Modifier.
Situation 1 What is the simplest Modifier?
Answer Modifier What is it? a class? an object?
It is a companion object, which implements the Modifier interface.
companion object : Modifier { override fun &amp;lt;R&amp;gt; foldIn(initial: R, operation: (R, Element) -&amp;gt; R): R = initial override fun &amp;lt;R&amp;gt; foldOut(initial: R, operation: (Element, R) -&amp;gt; R): R = initial override fun any(predicate: (Element) -&amp;gt; Boolean): Boolean = false override fun all(predicate: (Element) -&amp;gt; Boolean): Boolean = true override infix fun then(other: Modifier): Modifier = other override fun toString() = &amp;#34;Modifier&amp;#34; } The formal version is Modifier.</description>
    </item>
    
    <item>
      <title>Bites of Compose 4</title>
      <link>https://www.lvguowei.me/post/bites-of-compose-4/</link>
      <pubDate>Wed, 01 Feb 2023 21:21:32 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/bites-of-compose-4/</guid>
      <description>This time we are focusing on derivedStateOf and how it is different from remember.
Let&amp;rsquo;s look at this simple example:
Situation 1 What will happen when user clicks on the Text?
@Composable private fun Situation1() { var name by remember { mutableStateOf(&amp;#34;guowei&amp;#34;) } val uppercase by remember { derivedStateOf { name.uppercase() } } Text(uppercase, modifier = Modifier.clickable { name = &amp;#34;hello&amp;#34; }) } Answer The text will change from &amp;ldquo;GUOWEI&amp;rdquo; to &amp;ldquo;HELLO&amp;rdquo;.</description>
    </item>
    
    <item>
      <title>Bites of Compose 3</title>
      <link>https://www.lvguowei.me/post/bites-of-compose-3/</link>
      <pubDate>Fri, 27 Jan 2023 22:42:03 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/bites-of-compose-3/</guid>
      <description>Let&amp;rsquo;s do a bit of recap first. (I highly suggest you go through previous post if not already done so)
Situation 1 Will clicking the button trigger the recompose of UserPage?
data class User(var name: String) class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val user1 = User(&amp;#34;Guowei Lv&amp;#34;) val user2 = User(&amp;#34;Guowei Lv&amp;#34;) var user = user1 setContent { var flag by remember { mutableStateOf(true) } Column { Text(text = &amp;#34;Flag is $flag&amp;#34;) UserPage(user = user) Button(onClick = { flag = !</description>
    </item>
    
    <item>
      <title>Bites of Compose 2</title>
      <link>https://www.lvguowei.me/post/bites-of-compose-2/</link>
      <pubDate>Tue, 24 Jan 2023 21:34:24 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/bites-of-compose-2/</guid>
      <description>Situation 1 Take a look at the Composable below, what will happen if the button is clicked?
@Composable fun Situation1() { val names by remember { mutableStateOf(mutableListOf(&amp;#34;Bob&amp;#34;, &amp;#34;Tom&amp;#34;)) } Column { names.forEach { Text(it) } Button(onClick = { names.add(&amp;#34;Jane&amp;#34;) }) { Text(&amp;#34;Add Jane!&amp;#34;) } } } Answer The list will still consist of Bob and Tom. Jane will not be added. The reason is that for mutable states, only the assignment operation is &amp;ldquo;observed&amp;rdquo;.</description>
    </item>
    
    <item>
      <title>Bites of Compose 1</title>
      <link>https://www.lvguowei.me/post/bites-of-compose-1/</link>
      <pubDate>Thu, 05 Jan 2023 22:26:54 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/bites-of-compose-1/</guid>
      <description>I&amp;rsquo;m planning to write a series of short articles about Android&amp;rsquo;s Jetpack Compose UI framework. You can use it to test your understanding or maybe learn a few things along the way.
Situation 1 Take a look at the Composable below, what will happen if the button is clicked?
@Composable fun Situation1() { var name = &amp;#34;Guowei&amp;#34; Column { Text(name) Button(onClick = { name = &amp;#34;Hello&amp;#34; }) { Text(&amp;#34;Change name!&amp;#34;) } } } Answer Nothing.</description>
    </item>
    
    <item>
      <title>Demystify RxJava (2)</title>
      <link>https://www.lvguowei.me/post/rxjava-interenals-2/</link>
      <pubDate>Tue, 19 Jul 2022 21:21:01 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/rxjava-interenals-2/</guid>
      <description>In this article, we focus on how the dispose system works in RxJava.
First, let&amp;rsquo;s take a look at the Disposable interface.
public interface Disposable { void dispose(); boolean isDisposed(); } Not much going on here, basically it says a Disposable can be disposed.
First example we are going to examine is:
Observable.interval(1, TimeUnit.SECONDS) If you click through the code, the implementation is actually this class ObservableInterval.
First let&amp;rsquo;s look at the constructor of this class:</description>
    </item>
    
    <item>
      <title>Demystify RxJava (1)</title>
      <link>https://www.lvguowei.me/post/rxjava-internals/</link>
      <pubDate>Thu, 30 Jun 2022 21:23:02 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/rxjava-internals/</guid>
      <description>Let&amp;rsquo;s see what makes RxJava tick.
RxJava is complex, so I will have to (overly) simplify things at places. All of this is just trying to help you to get a better picture of how RxJava is implemented.
Let&amp;rsquo;s go.
Let&amp;rsquo;s start with the Single, it&amp;rsquo;s just an interface with one method:
public interface Single&amp;lt;T&amp;gt; { void subscribe(SingleObserver&amp;lt;T&amp;gt; observer); } So a Single is just a thing that can be subscribed.</description>
    </item>
    
    <item>
      <title>I wrote a game again - 24!</title>
      <link>https://www.lvguowei.me/post/24-game/</link>
      <pubDate>Wed, 15 Jun 2022 12:39:41 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/24-game/</guid>
      <description>It all started from a message sent by my cousin in our family group chat one day.
He posted some of those harder 24 problems, and I couldn&amp;rsquo;t solve any of them.
(If you don&amp;rsquo;t know what is this 24 game is all about, here you can read it https://en.wikipedia.org/wiki/24_game)
So, I decided to write a program to help me. And that program turned into a mobile game eventually.
You can find it on Play Store.</description>
    </item>
    
    <item>
      <title>Separating Program Evaluation From Description</title>
      <link>https://www.lvguowei.me/post/separate-program-evaluation-from-description/</link>
      <pubDate>Tue, 03 May 2022 20:18:32 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/separate-program-evaluation-from-description/</guid>
      <description>5.3 Separating program evaluation from description
This is the title of Chapter 5.3 from the book Functional Programming in Kotlin.
Everyone knows that a program is a list of instructions that will be executed/evaluated in the order they are written in.
fun exec() { doThis() doThat() doMore() } So the description decides the evaluation. What does it mean to separate them? I mean, can they be different?
Let&amp;rsquo;s define a lazy Stream:</description>
    </item>
    
    <item>
      <title>Handmade NestedScrollView</title>
      <link>https://www.lvguowei.me/post/handmade-nested-scrollview/</link>
      <pubDate>Tue, 12 Apr 2022 20:57:33 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/handmade-nested-scrollview/</guid>
      <description>I&amp;rsquo;m learning how the nested scrolling machanism works on Android, but couldn&amp;rsquo;t really find any in-depth material. So I turned into the Chinese community, and found this incredible article. It is very long and detailed to death, I don&amp;rsquo;t really have time to go through it all. I find the first half, a handmade SimpleNestedScrollView to be quite interesting, let me put that part in English here.
Understand the problem If you have a ScrollView inside another ScrollView(same scrolling direction, both vertical or horizontal), then what to expect of the scrolling behaviour?</description>
    </item>
    
    <item>
      <title>Understand Android View&#39;s Touch Events</title>
      <link>https://www.lvguowei.me/post/understand-touch-event-android/</link>
      <pubDate>Mon, 24 Jan 2022 20:52:47 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/understand-touch-event-android/</guid>
      <description>How the view system in Android handles touch events? Let&amp;rsquo;s try to understand it by designing it from scratch ourselves!
(This is not my original but a summary of this https://juejin.cn/post/6844903761052188679)
Let&amp;rsquo;s do this by coming up a series of requirements (from naive to sophisticated) and see how we can design the logic to fulfill them.
Requirement 1 In a nested view hierachy, only the most inner view can handle events.</description>
    </item>
    
    <item>
      <title>WTF Livedata?! (or Kotlin)</title>
      <link>https://www.lvguowei.me/post/wtf-livedata/</link>
      <pubDate>Sat, 22 Jan 2022 20:31:24 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/wtf-livedata/</guid>
      <description>LiveData is convenient, powerful and super easy to use. But, there are still some quirks that could possibly leads to some heads banging against walls.
How many times can I observe? In theory, we can observe livedata with multiple observers, just like the good old pub-sub pattern, right? Well, let&amp;rsquo;s test this out.
Let&amp;rsquo;s create a super simple livedata.
class MainViewModel : ViewModel() { private val _data = MutableLiveData&amp;lt;Int&amp;gt;() val data: LiveData&amp;lt;Int&amp;gt; = _data fun update(count: Int) { _data.</description>
    </item>
    
    <item>
      <title>Fun Facts About OnMeasure() and OnLayout()</title>
      <link>https://www.lvguowei.me/post/fun-facts-about-onmeasure-and-onlayout/</link>
      <pubDate>Mon, 03 Jan 2022 21:48:45 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/fun-facts-about-onmeasure-and-onlayout/</guid>
      <description>Let&amp;rsquo;s understand more about Android view&amp;rsquo;s measure and layout process, and have some fun along the way.
Let&amp;rsquo;s say we have this:
&amp;lt;LinearLayout xmlns:android=&amp;#34;http://schemas.android.com/apk/res/android&amp;#34; xmlns:app=&amp;#34;http://schemas.android.com/apk/res-auto&amp;#34; xmlns:tools=&amp;#34;http://schemas.android.com/tools&amp;#34; android:layout_width=&amp;#34;match_parent&amp;#34; android:layout_height=&amp;#34;match_parent&amp;#34; tools:context=&amp;#34;.MainActivity&amp;#34;&amp;gt; &amp;lt;com.example.stubornview.StubbornView android:layout_width=&amp;#34;match_parent&amp;#34; android:layout_height=&amp;#34;match_parent&amp;#34; android:background=&amp;#34;@color/design_default_color_primary&amp;#34; /&amp;gt; &amp;lt;/LinearLayout&amp;gt; class StubbornView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : View(context, attrs, defStyleAttr) { /** * 1. Parent LinearLayout combines developer&amp;#39;s requirements * and the available space of itself into MeasureSpecs and * pass them here.</description>
    </item>
    
    <item>
      <title>How to Really Understand ViewModel in Android</title>
      <link>https://www.lvguowei.me/post/how-to-understand-viewmodel/</link>
      <pubDate>Sat, 18 Dec 2021 10:50:35 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/how-to-understand-viewmodel/</guid>
      <description>Yes, there is documentation and tons of sample apps out there. But they are all in a top down approach, meaning they give you the final result of how to use it first, and never tells you why and what is behind the scenes.
I will fix that in this article, and present a bottom up approach which leads to much better and deeper understanding.
First, at the bottom of things, we need to define what is ViewModel.</description>
    </item>
    
    <item>
      <title>How to implement an ExpandableLayout</title>
      <link>https://www.lvguowei.me/post/expandable-layout/</link>
      <pubDate>Fri, 17 Dec 2021 21:15:42 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/expandable-layout/</guid>
      <description>It is quite common in Android that we need some expandable widget to show and hide information. This is my first attempt, note that this is only a &amp;ldquo;sketch&amp;rdquo;, and I intentionally leave some room for improvement.
One interesting detail worth mentioning is how the animation is done. I used the reverse() function to play animation backwards in order to achieve a smooth and continuous feel.
Here is the code:</description>
    </item>
    
    <item>
      <title>How by Lazy Works</title>
      <link>https://www.lvguowei.me/post/how-by-lazy-works/</link>
      <pubDate>Fri, 10 Dec 2021 06:49:43 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/how-by-lazy-works/</guid>
      <description>by lazy is implemented by using the &amp;ldquo;property delegation&amp;rdquo; in Kotlin. But if you look into the source code and trying to understand what is going on, it can be confusing, because it is full of locks and generics and where&amp;rsquo;s the `getValue()`` function they say that the delegation must implement??
In the handmade spirit (best way to learn is by doing it yourself), let&amp;rsquo;s do a stripped down version ourselves.</description>
    </item>
    
    <item>
      <title>Kotlin Noinline and Crossinline</title>
      <link>https://www.lvguowei.me/post/kotlin-noinline-crossinline/</link>
      <pubDate>Fri, 26 Nov 2021 20:06:16 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/kotlin-noinline-crossinline/</guid>
      <description>Compile time constant const val NAME = &amp;#34;Guowei&amp;#34; fun main() { tv.text = NAME } After compile it will (almost) look like this:
// Imaginary code fun main() { tv.text = &amp;#34;Guowei&amp;#34; } inline function We can do similar things to functions, by adding keyword inline.
inline fun hello() { println(&amp;#34;hello&amp;#34;) } fun main() { hello() } So at compile time, the hello() function will be copied to the calling place:</description>
    </item>
    
    <item>
      <title>View Binding Internals</title>
      <link>https://www.lvguowei.me/post/view-binding-internals/</link>
      <pubDate>Wed, 10 Nov 2021 21:25:50 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/view-binding-internals/</guid>
      <description>I was bored at night so decided to peek into the guts of how Android&amp;rsquo;s View Binding works. To my suprise the generated code is extremely simple.
Imagine you have a list_item.xml file and it looks like this:
&amp;lt;LinearLayout&amp;gt; &amp;lt;ImageView android:id=&amp;#34;@+id/icon&amp;#34; /&amp;gt; &amp;lt;TextView android:id=&amp;#34;@+id/name&amp;#34; /&amp;gt; &amp;lt;/LinearLayout&amp;gt; Then the generated class will be like this:
public final class ListItemBinding implements ViewBinding { private final LinearLayout rootView; public final ImageView icon; public final TextView name; // Notice: private constructor private ListItemBinding(LinearLayout rootView, ImageView icon, TextView name) { this.</description>
    </item>
    
    <item>
      <title>Next Job Oriented Programming</title>
      <link>https://www.lvguowei.me/post/next-job-oriented-programming/</link>
      <pubDate>Mon, 08 Nov 2021 09:05:52 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/next-job-oriented-programming/</guid>
      <description>Rant alert
I&amp;rsquo;ve been having this idea for a while, and when having dinner with my other programmer friend yesterday, I jokingly said that &amp;ldquo;Have you noticed there is a very popular programming paradigm that&amp;rsquo;s been adopted everywhere but no one is aware of it?&amp;rdquo; Yes, it is what I call Next Job Oriented Programming(NJOP).
Don&amp;rsquo;t get me wrong, I&amp;rsquo;m not against adopting new tech by any means, it&amp;rsquo;s good and healthy to keep our tech stack up to date.</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part 19)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-19/</link>
      <pubDate>Fri, 20 Aug 2021 14:06:14 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-19/</guid>
      <description>In this post let&amp;rsquo;s take a deeper look at some of the more advanced uses of ObjectAnimator.
KeyFrame First example is the usage of KeyFrames. Here is the final result:
Let&amp;rsquo;s look at the code
val imageView = findViewById&amp;lt;ImageView&amp;gt;(R.id.imageView) /** In total we want to move 300dp. 0% of time passed, it has moved 0dp. 30% of time passed, it has moved 100dp. 60% of time passed, it has moved 120dp.</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part 18)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-18/</link>
      <pubDate>Tue, 17 Aug 2021 21:54:36 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-18/</guid>
      <description>In this post let&amp;rsquo;s look at how to do this cool animation using ObjectAnimator.
This is built on top of previous post
class CameraView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : View(context, attrs, defStyleAttr) { private val paint = Paint(Paint.ANTI_ALIAS_FLAG) private val imageSize = dp2px(200) private val leftPadding = dp2px(100) private val topPadding = dp2px(100) private val image = getAvatar(imageSize) private val camera = Camera() private var cameraRotationUpper = 0.</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part 17)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-17/</link>
      <pubDate>Tue, 17 Aug 2021 12:59:09 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-17/</guid>
      <description>Let&amp;rsquo;s look at how to use camera in canvas transformation.
First this is what we want to implement:
The trick is to draw the upper and lower part separately. And we are using this &amp;ldquo;reverse drawing&amp;rdquo; technique.
Upper part override fun onDraw(canvas: Canvas) { super.onDraw(canvas) canvas.save() canvas.drawBitmap(image, leftPadding, topPadding, paint) canvas.restore() } override fun onDraw(canvas: Canvas) { super.onDraw(canvas) canvas.save() canvas.translate(-(leftPadding + imageSize / 2), -(topPadding + imageSize / 2)) canvas.drawBitmap(image, leftPadding, topPadding, paint) canvas.</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part 16)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-16/</link>
      <pubDate>Fri, 13 Aug 2021 10:34:35 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-16/</guid>
      <description>In this post I want to go into details on canvas transformations, especially if we want to combine them.
Let&amp;rsquo;s take the simple example of translation + rotation. The end result is like this:
We can easily see that the image has been translated to (300, 200) and then rotated 45 degrees.
class TransformView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : View(context, attrs, defStyleAttr) { private val paint = Paint(Paint.</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part 15)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-15/</link>
      <pubDate>Fri, 06 Aug 2021 14:14:33 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-15/</guid>
      <description>Let&amp;rsquo;s use Xfermode to draw a circled avatar.
The original avatar image is this:
We will implement a custom view that clips it into a circle.
class Avatar @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : View(context, attrs, defStyleAttr) { private val WIDTH = dp2px(300) private val PADDING = dp2px(50) val paint = Paint(Paint.ANTI_ALIAS_FLAG) val bitmap = getAvatar(WIDTH.toInt()) val xfermode = PorterDuffXfermode(PorterDuff.Mode.SRC_IN) val savedArea = RectF() override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { super.</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part 14)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-14/</link>
      <pubDate>Fri, 06 Aug 2021 12:30:31 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-14/</guid>
      <description>In this tutorial let&amp;rsquo;s see how to draw a piechart.
class PieChart @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : View(context, attrs, defStyleAttr) { val paint: Paint = Paint(Paint.ANTI_ALIAS_FLAG) val bounds: RectF = RectF() val RADIUS = dp2px(150) val OFFSET = dp2px(50) var offsetIndex = 2 val angles = arrayOf(60.0f, 120.0f, 30.0f, 150.0f) val colors = arrayOf(&amp;#34;#07004d&amp;#34;, &amp;#34;#2d82b7&amp;#34;, &amp;#34;#42e2b8&amp;#34;, &amp;#34;#f3dfbf&amp;#34;) override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { super.</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part 13)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-13/</link>
      <pubDate>Thu, 05 Aug 2021 21:30:48 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-13/</guid>
      <description>Today let&amp;rsquo;s draw a dashboard meter.
I have drawn the blueprint this time:
Here is the code:
class Dashboard @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : View(context, attrs, defStyleAttr) { private val BOTTOM_ANGLE = 120 private val RADIUS = dp2px(150) private val ARM_LENGTH = dp2px(120) private val DASH_WIDTH = dp2px(2) private val DASH_LENGTH = dp2px(10) private val DASH_NUM = 12 private val paint = Paint(Paint.</description>
    </item>
    
    <item>
      <title>SICP Goodness - The Y Combinator</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-y-combinator/</link>
      <pubDate>Wed, 04 Aug 2021 15:03:26 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-y-combinator/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
I rewatched the Lecture 7A again and found that I never really understand the second half.</description>
    </item>
    
    <item>
      <title>Back to Basics - App Bar</title>
      <link>https://www.lvguowei.me/post/b2b_app_bar/</link>
      <pubDate>Sun, 27 Jun 2021 22:20:27 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/b2b_app_bar/</guid>
      <description>We often hear 3 words: app bar, action bar and tool bar. Let&amp;rsquo;s make clear of them first:
app bar: the name of the UI element/bar at the top of the app. action bar: the previous implementation of app bar, comes with some themes by default. But should not really be used anymore. tool bar: the current implementation of app bar. Should be used in replacement of action bar. Let&amp;rsquo;s create an empty project and see what it looks like by default:</description>
    </item>
    
    <item>
      <title>Dependency Injection in Android With Dagger2 (14)</title>
      <link>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-14/</link>
      <pubDate>Sun, 16 May 2021 08:59:40 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-14/</guid>
      <description>Here is one clean solution of how to combine Dagger + ViewModel + SavedStateHandle.
The only difference now is that inside our ViewModel has access to SavedStateHandle. We capture this through a abstract class:
abstract class SavedStateViewModel: ViewModel() { abstract fun init(savedStateHandle: SavedStateHandle) } And the ViewModel now looks like this:
class MyViewModel @Inject constructor( private val fetchQuestionsUseCase: FetchQuestionsUseCase ) : SavedStateViewModel() { private lateinit var _questions: MutableLiveData&amp;lt;List&amp;lt;Question&amp;gt;&amp;gt; val questions: LiveData&amp;lt;List&amp;lt;Question&amp;gt;&amp;gt; get() = _questions override fun init(savedStateHandle: SavedStateHandle) { _questions = savedStateHandle.</description>
    </item>
    
    <item>
      <title>Dependency Injection in Android With Dagger2 (13)</title>
      <link>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-13/</link>
      <pubDate>Sun, 16 May 2021 07:53:38 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-13/</guid>
      <description>Previously, we created a centralized ViewModelFactory which can create all ViewModels in the app:
class ViewModelFactory @Inject constructor( private val myViewModelProvider: Provider&amp;lt;MyViewModel&amp;gt;, private val myViewModel2Provider: Provider&amp;lt;MyViewModel2&amp;gt; ): ViewModelProvider.Factory { override fun &amp;lt;T : ViewModel?&amp;gt; create(modelClass: Class&amp;lt;T&amp;gt;): T { return when(modelClass) { MyViewModel::class.java -&amp;gt; myViewModelProvider.get() as T MyViewModel2::class.java -&amp;gt; myViewModel2Provider.get() as T else -&amp;gt; throw RuntimeException(&amp;#34;unsupported ViewModel type: $modelClass&amp;#34;) } } } But with more and more ViewModels being added to our app, this class will grow quickly, is there a way to mitigate this?</description>
    </item>
    
    <item>
      <title>Dependency Injection in Android With Dagger2 (12)</title>
      <link>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-12/</link>
      <pubDate>Sat, 15 May 2021 18:45:09 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-12/</guid>
      <description>It is a bit cumbersome to create a Factory for each ViewModel we have. Actually, we can just create one Factory that is responsible for creating all ViewModels in the app.
The Factory is very straightforward:
class ViewModelFactory @Inject constructor( private val myViewModelProvider: Provider&amp;lt;MyViewModel&amp;gt;, private val myViewModel2Provider: Provider&amp;lt;MyViewModel2&amp;gt; ): ViewModelProvider.Factory { override fun &amp;lt;T : ViewModel?&amp;gt; create(modelClass: Class&amp;lt;T&amp;gt;): T { return when(modelClass) { MyViewModel::class.java -&amp;gt; myViewModelProvider.get() as T MyViewModel2::class.java -&amp;gt; myViewModel2Provider.</description>
    </item>
    
    <item>
      <title>Dependency Injection in Android With Dagger2 (11)</title>
      <link>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-11/</link>
      <pubDate>Sat, 15 May 2021 08:56:32 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-11/</guid>
      <description>The main advantage of using ViewModel is: it can survive configuration change. That means if you associate a ViewModel with an Activity, then after configuration change, the activity will get the same instance of that ViewModel.
Of course that comes with some setup work to do on developers side. But it is not that bad, basically the activity gets its ViewModel through ViewModelProvider.
If your ViewModel has empty constructor, then you can simply use:</description>
    </item>
    
    <item>
      <title>Dependency Injection in Android With Dagger2 (10)</title>
      <link>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-10/</link>
      <pubDate>Sun, 09 May 2021 22:53:22 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-10/</guid>
      <description>Let&amp;rsquo;s take a look at the ViewMvcFactory:
class ViewMvcFactory @Inject constructor( private val layoutInflaterProvider: LayoutInflater, private val imageLoaderProvider: ImageLoader ) One thing worth paying attention is that this is a factory. Factory is used to create objects. So this means that its dependencies: LayoutInflater and ImageLoader will be reused to create objects everytime.
We know that ImageLoader has no state so that it can be reused, but what if it can&amp;rsquo;t?</description>
    </item>
    
    <item>
      <title>Dependency Injection in Android With Dagger2 (9)</title>
      <link>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-9/</link>
      <pubDate>Sun, 09 May 2021 22:06:54 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-9/</guid>
      <description>This is a simple one. No more explanation, just paste the code here.
@UiThread @Module class AppModule { @Provides @AppScope @Retrofit1 fun retrofit1(urlProvider: UrlProvider): Retrofit { return Retrofit.Builder() .baseUrl(urlProvider.baseUrl1()) .addConverterFactory(GsonConverterFactory.create()) .build() } @Provides @AppScope @Retrofit2 fun retrofit2(): Retrofit { return Retrofit.Builder() .baseUrl(urlProvider().baseUrl2()) .addConverterFactory(GsonConverterFactory.create()) .build() } @Provides @AppScope fun stackOverflowApi(@Retrofit1 retrofit: Retrofit): StackoverflowApi = retrofit.create(StackoverflowApi::class.java) @Provides @AppScope fun urlProvider(): UrlProvider = UrlProvider() } @Qualifier annotation class Retrofit1() @Qualifier annotation class Retrofit2() </description>
    </item>
    
    <item>
      <title>Dependency Injection in Android With Dagger2 (8)</title>
      <link>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-8/</link>
      <pubDate>Sun, 09 May 2021 14:56:26 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-8/</guid>
      <description>Let&amp;rsquo;s create a ScreensNavigator interface:
interface ScreensNavigator { fun navigateBack() fun toQuestionDetails(questionId: String) } And ScreensNavigatorImpl implements it:
class ScreensNavigatorImpl @Inject constructor(private val activity: AppCompatActivity) : ScreensNavigator { override fun navigateBack() { activity.onBackPressed() } override fun toQuestionDetails(questionId: String) { QuestionDetailsActivity.start(activity, questionId) } } Now we have a problem that in activities and fragments we want to inject the interface type:
@Inject lateinit var screensNavigator: ScreensNavigator But Dagger only knows how to create ScreensNavigatorImpl.</description>
    </item>
    
    <item>
      <title>Dependency Injection in Android With Dagger2 (7)</title>
      <link>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-7/</link>
      <pubDate>Fri, 07 May 2021 23:31:25 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-7/</guid>
      <description>One fact: it is more performant to make the all provider methods inside Modules static.
But for Modules that have bootstrap dependencies, this is impossible. Let&amp;rsquo;s take ActivityModule as example.
@Module class ActivityModule(private val activity: AppCompatActivity) { @Provides fun activity(): AppCompatActivity = activity @Provides fun layoutInflater(activity: AppCompatActivity): LayoutInflater = LayoutInflater.from(activity) @Provides fun fragmentManager(activity: AppCompatActivity) = activity.supportFragmentManager @Provides @ActivityScope fun screensNavigator(activity: AppCompatActivity) = ScreensNavigator(activity) } We can easily make fun layoutInflater(), fragmentManager() and screensNavigator static methods.</description>
    </item>
    
    <item>
      <title>Dependency Injection in Android With Dagger2 (6)</title>
      <link>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-6/</link>
      <pubDate>Mon, 03 May 2021 13:20:50 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-6/</guid>
      <description>Components can have multiple Modules. So if you have huge Modules that provide tons of services, it is good to split it up.
Let&amp;rsquo;s create a UseCaseModule to hanle all the UseCases.
@Module class UseCasesModule { @Provides fun fetchQuestionsUseCase(stackOverflowApi: StackoverflowApi) = FetchQuestionsUseCase(stackOverflowApi) @Provides fun fetchQuestionDetailsUseCase(stackOverflowApi: StackoverflowApi) = FetchQuestionDetailsUseCase(stackOverflowApi) } Some dagger conventions:
Components can use more than 1 module. Modules of the same Component share the same object-graph. Dagger automatically instantiate modules with no argument constructor.</description>
    </item>
    
    <item>
      <title>Dependency Injection in Android With Dagger2 (5)</title>
      <link>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-5/</link>
      <pubDate>Mon, 03 May 2021 06:54:09 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-5/</guid>
      <description>In previous post, we introduced the component dependencies. But there is one interesting subtlety: If Component B depends on Component A, B has access to all A&amp;rsquo;s exposed objects. Note that there is a difference between what a component exposes and what it provides.
Let&amp;rsquo;s look at PresentationComponent and ActivityComponent.
@PresentationScope @Component(dependencies = [ActivityComponent::class], modules = [PresentationModule::class]) interface PresentationComponent { fun inject(fragment: QuestionsListFragment) fun inject(questionDetailsActivity: QuestionDetailsActivity) } Here in PresentationComponent, even though it provides all the objects that QuestionsListFragment and QuestionDetailsActivity need, it exposes nothing.</description>
    </item>
    
    <item>
      <title>Dependency Injection in Android With Dagger2 (4)</title>
      <link>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-4/</link>
      <pubDate>Sun, 02 May 2021 22:53:45 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-4/</guid>
      <description>Let&amp;rsquo;s look at the PresentationComponent more closely.
One strange thing is that PresentationModule has ActivityComponent as its dependency, and it @Provide all the objects provided by ActivityComponent already.
This is rather ugly, can we do something about it?
The answer is Component Dependencies.
The idea is that we can make PresentationComponent depends on ActivityComponent. That way, PresentationComponent automatically gets access to all the objects exposed by ActivityComponent.
After this change, it looks like this:</description>
    </item>
    
    <item>
      <title>Dependency Injection in Android With Dagger2 (3)</title>
      <link>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-3/</link>
      <pubDate>Sun, 02 May 2021 14:56:51 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-3/</guid>
      <description>In previous post, we replaced our Pure Dependency Injection with Dagger2. But, the conversion is without too much thoughts.
One improvement we can do is to follow Dagger&amp;rsquo;s convention of using Component as Injector.
We can make the following mental models:
Dagger&amp;rsquo;s @Module is for creating objects. Dagger&amp;rsquo;s @Component is for injecting objects into application classes. </description>
    </item>
    
    <item>
      <title>Dependency Injection in Android With Dagger2 (2)</title>
      <link>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-2/</link>
      <pubDate>Sun, 02 May 2021 09:00:51 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-2/</guid>
      <description>Previous post we set up the so called Pure Dependency Injection. Now let&amp;rsquo;s replace that with Dagger2 balantly.
Convert the composition roots into dagger&amp;rsquo;s @Modules.
Create @Component to hold each @Module.
Create @Scopes and use it to scope the objects we want only 1 instance in the component.
Now it looks like this:</description>
    </item>
    
    <item>
      <title>Dependency Injection in Android With Dagger2 (1)</title>
      <link>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-1/</link>
      <pubDate>Fri, 30 Apr 2021 15:12:56 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dependency-injection-in-android-with-dagger2-1/</guid>
      <description>This series of posts are my summary notes from the online course Dependency Injection in Android with Dagger 2 and Hilt.
I do believe if you have any doubts about Dagger2 in Android, run to get that course and watch it 3 times, I bet you will be better than 90% of the android developers on the market on this topic.
The first 1/3 of the course introduces the so called Pure Dependency Injection, which means not using any library like Dagger.</description>
    </item>
    
    <item>
      <title>Kotlin Time Dsl</title>
      <link>https://www.lvguowei.me/post/kotlin-time-constant-dsl/</link>
      <pubDate>Sun, 25 Apr 2021 15:04:14 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/kotlin-time-constant-dsl/</guid>
      <description>Often in project we want to declare some time constants, like
companion object { const val INTERVAL = 5 * 60 // 5 minutes } This is fine, but can we do better in Kotlin? What I want is this 5 minutes in seconds or 8 days in hours, and it is not hard to achieve it actually.
infix fun Number.daysIn(unit: TimeUnit): Long = daysFn(this, unit) infix fun Number.hoursIn(unit: TimeUnit) = hoursFn(this, unit) infix fun Number.</description>
    </item>
    
    <item>
      <title>Learning C64 Programming 1</title>
      <link>https://www.lvguowei.me/post/learning-c64-programming-1/</link>
      <pubDate>Sat, 06 Mar 2021 22:14:18 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/learning-c64-programming-1/</guid>
      <description>The old is the new new.
I really love 8-bit games, why not try to learn how to develop them? The best time to do this is when I was 10 years old after I got my first NES console, the second best time is now. So here we are, I&amp;rsquo;m documenting all the learning along the way in this blog.
First, let&amp;rsquo;s setup the dev environment.
Machine Here is the machine that I&amp;rsquo;m using for this, my newly acquired ThinkPad T60, with Zorin 32bit version installed.</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part 12)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-12/</link>
      <pubDate>Thu, 04 Feb 2021 21:28:51 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-12/</guid>
      <description>Let&amp;rsquo;s build a sliding menu from scratch by hand.
First a glimpse of what the final result looks like.
Step 1: Horizontal Scroll View The secret is that this is just a customized HorizontalScrollView:
class SlidingMenu @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : HorizontalScrollView(context, attrs, defStyleAttr) { ... } The view can be divided into 2 parts: menu view and content view, and they are just put next to each other.</description>
    </item>
    
    <item>
      <title>Elementary Pascal</title>
      <link>https://www.lvguowei.me/post/elementary_pascal/</link>
      <pubDate>Sun, 17 Jan 2021 21:20:26 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/elementary_pascal/</guid>
      <description>I got this book a while ago.
I want to get 2 things out of this book:
Learn some basic Pascal in order to read the Algorithms Plus Data Structures Equals Programs by Niklaus Wirth. Find some entry level programming teaching material that I can use to teach my kid to program. Code</description>
    </item>
    
    <item>
      <title>Monthly Favourite Songs</title>
      <link>https://www.lvguowei.me/post/fav-songs-5/</link>
      <pubDate>Fri, 18 Dec 2020 22:07:06 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/fav-songs-5/</guid>
      <description>佐井好子 Can&amp;rsquo;t believe these albums are from the 70s, ten years before I was born and sounds much better than 99% of todays music.</description>
    </item>
    
    <item>
      <title>Monthly Favourite Songs</title>
      <link>https://www.lvguowei.me/post/fav-songs-4/</link>
      <pubDate>Sun, 22 Nov 2020 22:18:48 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/fav-songs-4/</guid>
      <description>Deva Premal &amp;amp; Miten I&amp;rsquo;m naturally attracted to the religious music since I was very young, maybe under 10 years old.
Deva Premal is one of the best that I can find in this genre that is also easy to be enjoyed by a normal person.
And when I traveled to Malaga in Spain, I listened to her songs all the time, and since it is a place near the Arab world, somehow it fit perfectly.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Try-out the meta-circular evaluator from the lecture</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-metacircular-evaluator-lecture/</link>
      <pubDate>Fri, 20 Nov 2020 22:19:03 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-metacircular-evaluator-lecture/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
In Lecture 7A: Metacircular Evaluator, Part 1, Mr Sussman said that he was going to fit the whole evaluator on the blackboard.</description>
    </item>
    
    <item>
      <title>Deeply Mediocre</title>
      <link>https://www.lvguowei.me/post/deeply-mediocre/</link>
      <pubDate>Mon, 16 Nov 2020 21:28:18 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/deeply-mediocre/</guid>
      <description>I&amp;rsquo;ve been following Jonathan Blow for some time now, and this talk is gold.
One phrase scared me the most: deeply mediocre. I realized that I&amp;rsquo;ve been trying all I can to avoid that.</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part 11)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-11/</link>
      <pubDate>Mon, 05 Oct 2020 21:40:37 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-11/</guid>
      <description>It is interesting how Android view&amp;rsquo;s touch events are dispatched. Let&amp;rsquo;s explore it.
Firstly, write a custom view and override its onTouchEvent() method.
class TouchView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : View(context, attrs, defStyleAttr) { override fun onTouchEvent(event: MotionEvent): Boolean { Log.d(&amp;#34;TAG&amp;#34;, &amp;#34;TouchView - onTouchEvent - ${event.action}&amp;#34;) return super.onTouchEvent(event) } } Then, in MainActivity, on the view, call setOnTouchListener() and setOnClickListener().
class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?</description>
    </item>
    
    <item>
      <title>SICP Goodness - Metacircular Evaluator</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-metacircular-evaluator/</link>
      <pubDate>Sat, 26 Sep 2020 20:18:45 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-metacircular-evaluator/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
At the beginning of Chapter 4, we will implement an evaluator.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Metalinguistic Abstraction</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-evaluator-scan/</link>
      <pubDate>Fri, 11 Sep 2020 18:40:42 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-evaluator-scan/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Do you have the following questions?
What programming languages should I learn?</description>
    </item>
    
    <item>
      <title>Best Programming Music</title>
      <link>https://www.lvguowei.me/post/best-programming-music/</link>
      <pubDate>Mon, 17 Aug 2020 23:05:00 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/best-programming-music/</guid>
      <description>I present you the best music to listen to when programming.
Katsumi Horii Project
To name a few.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Orgmode &#43; Racket &#43; SICP = 💕</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-setup-racket-org/</link>
      <pubDate>Thu, 06 Aug 2020 23:10:10 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-setup-racket-org/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Recently, I started to write down study notes in one org file.</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part 10)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-10/</link>
      <pubDate>Sun, 02 Aug 2020 22:31:41 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-10/</guid>
      <description>Just finished writing a custom layout to display tags and alike views. Not super polished but can be used as a reference.
Source Code</description>
    </item>
    
    <item>
      <title>Monthly Favourite Songs</title>
      <link>https://www.lvguowei.me/post/fav-songs-3/</link>
      <pubDate>Sun, 02 Aug 2020 22:16:55 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/fav-songs-3/</guid>
      <description>One Night Only (Disco Edition) Countdown </description>
    </item>
    
    <item>
      <title>Setup CLISP Environment for Land of Lisp</title>
      <link>https://www.lvguowei.me/post/install-clisp-spacemacs-archlinux/</link>
      <pubDate>Sat, 11 Jul 2020 22:39:47 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/install-clisp-spacemacs-archlinux/</guid>
      <description>The famous Land of Lisp uses CLISP. This is a tutorial to help you setup everything up.
I use Spacemacs + Common Lisp Layer + CLISP + Manjaro Linux.
After install the Common Lisp Layer in Spacemacs, when start up Slime, I got an error saying: could not load ASDF.
Here is the fix that worked for me:
Install asdf separately: yay asdf
After it is successfully installed, it prints: To load ASDF every time you start Lisp, copy the lines from /etc/default/asdf to your ~/sbclrc or ~/.</description>
    </item>
    
    <item>
      <title>Collapsing Toolbar With Motion Layout</title>
      <link>https://www.lvguowei.me/post/collapsing-toolbar-with-motion-layout/</link>
      <pubDate>Sun, 21 Jun 2020 23:27:09 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/collapsing-toolbar-with-motion-layout/</guid>
      <description>Source code</description>
    </item>
    
    <item>
      <title>Simple Toolbar Example</title>
      <link>https://www.lvguowei.me/post/toolbar-example/</link>
      <pubDate>Fri, 19 Jun 2020 23:15:00 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/toolbar-example/</guid>
      <description>Use NoActionBar theme &amp;lt;resources&amp;gt; &amp;lt;style name=&amp;#34;AppTheme&amp;#34; parent=&amp;#34;Theme.AppCompat.Light.NoActionBar&amp;#34;&amp;gt; &amp;lt;item name=&amp;#34;colorPrimary&amp;#34;&amp;gt;@color/colorPrimary&amp;lt;/item&amp;gt; &amp;lt;item name=&amp;#34;colorPrimaryDark&amp;#34;&amp;gt;@color/colorPrimaryDark&amp;lt;/item&amp;gt; &amp;lt;item name=&amp;#34;colorAccent&amp;#34;&amp;gt;@color/colorAccent&amp;lt;/item&amp;gt; &amp;lt;/style&amp;gt; &amp;lt;/resources&amp;gt; Create toolbar layout &amp;lt;?xml version=&amp;#34;1.0&amp;#34; encoding=&amp;#34;utf-8&amp;#34;?&amp;gt; &amp;lt;androidx.appcompat.widget.Toolbar xmlns:android=&amp;#34;http://schemas.android.com/apk/res/android&amp;#34; android:layout_width=&amp;#34;match_parent&amp;#34; android:layout_height=&amp;#34;wrap_content&amp;#34; xmlns:app=&amp;#34;http://schemas.android.com/apk/res-auto&amp;#34; android:background=&amp;#34;@color/colorPrimary&amp;#34; android:theme=&amp;#34;@style/ThemeOverlay.AppCompat.Dark.ActionBar&amp;#34; app:popupTheme=&amp;#34;@style/ThemeOverlay.AppCompat.Light&amp;#34;&amp;gt; &amp;lt;/androidx.appcompat.widget.Toolbar&amp;gt; Setting the layout_height to wrap_content will make it the correct default height.
Since our app has a light theme, the texts color in toolbar will be black. To change it to white, we need to set the theme of the toolbar to ThemeOverlay.</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part 9)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-9/</link>
      <pubDate>Tue, 02 Jun 2020 23:27:07 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-9/</guid>
      <description>There is nothing new here, just another exercise.
Two things to be careful with:
Try to call validate() as fewer times as possible, it is expensive. If you want to handle the touch events in this manner, remember to return true from onTouchEvent(). Otherwise, only the first event will be triggered(most likely DOWN in this case) and not the succeeding ones (like the MOVES). Source Code</description>
    </item>
    
    <item>
      <title>Emacs Orgmode Minted Setup</title>
      <link>https://www.lvguowei.me/post/emacs-orgmode-minted-setup/</link>
      <pubDate>Thu, 28 May 2020 23:58:25 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/emacs-orgmode-minted-setup/</guid>
      <description>Install minted package https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages
Install Pygments https://pygments.org/
Configure Emacs (setq org-latex-listings &amp;#39;minted org-latex-packages-alist &amp;#39;((&amp;#34;&amp;#34; &amp;#34;minted&amp;#34;)) org-latex-pdf-process &amp;#39;(&amp;#34;pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f&amp;#34; &amp;#34;pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f&amp;#34; &amp;#34;pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f&amp;#34;)) Remove cached minted* dirs This is the step that unblocked me.
Prevent src block line too long (setq org-latex-minted-options &amp;#39;((&amp;#34;breaklines&amp;#34; &amp;#34;true&amp;#34;) (&amp;#34;breakanywhere&amp;#34; &amp;#34;true&amp;#34;))) </description>
    </item>
    
    <item>
      <title>Writing Hugo Blog in Org</title>
      <link>https://www.lvguowei.me/post/writing-blog-in-org/</link>
      <pubDate>Sun, 17 May 2020 16:53:45 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/writing-blog-in-org/</guid>
      <description>Hello World First item Second item this is some code This is a subheading private static void main() {} LaTeX formatted equation: \( E = -J \sum_{i=1}^N s_i s_{i+1} \)
\begin{equation} \label{eq:1} C = W\log_{2} (1+\mathrm{SNR}) \end{equation}</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part 8)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-8/</link>
      <pubDate>Tue, 12 May 2020 22:21:03 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-8/</guid>
      <description>Let&amp;rsquo;s take a look at what we are going to build.
The secret is to clip canvas before drawing the text!
private fun drawText(canvas: Canvas, paint: Paint, start: Int, end: Int) { canvas.save() rect.set(start, 0, end, height) canvas.clipRect(rect) val textString = text.toString() paint.getTextBounds(textString, 0, textString.length, bounds) val x = width / 2 - bounds.width() / 2 val fontMetrics = changePaint.fontMetrics val dy = (fontMetrics.bottom - fontMetrics.top) / 2 - fontMetrics.bottom val baseline = height / 2 + dy canvas.</description>
    </item>
    
    <item>
      <title>My Fav Wallpapers</title>
      <link>https://www.lvguowei.me/post/wallpapers/</link>
      <pubDate>Mon, 11 May 2020 23:54:57 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/wallpapers/</guid>
      <description> </description>
    </item>
    
    <item>
      <title>Monthly Favourite Songs</title>
      <link>https://www.lvguowei.me/post/fav-songs-2/</link>
      <pubDate>Mon, 11 May 2020 23:14:40 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/fav-songs-2/</guid>
      <description>One of the best anime ever!!!
Touch OST </description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part 7)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-7/</link>
      <pubDate>Sun, 10 May 2020 12:47:01 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-7/</guid>
      <description>Drawing text can be tricky at times, let&amp;rsquo;s look at some examples.
First, let&amp;rsquo;s look at some terminologies used here.
Some most important keywords are:
baseline: the line where the text &amp;ldquo;sits on&amp;rdquo; ascent: The recommended distance above the baseline for singled spaced text descent: The recommended distance below the baseline for singled spaced text top: The maximum distance above the baseline for the tallest glyph in the font at a given text size bottom: The maximum distance below the baseline for the lowest glyph in the font at a given text size A picture is worth 1000 words:</description>
    </item>
    
    <item>
      <title>What is PECS</title>
      <link>https://www.lvguowei.me/post/pecs/</link>
      <pubDate>Wed, 06 May 2020 21:50:04 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/pecs/</guid>
      <description>You: Master, I heard this PECS in the JAVA world. But I&amp;rsquo;m deeply puzzled by it.
Master: Do you know what it stands for?
You: Producer Extends Consumer Super?
Master: In order to understand it, you shall stop thinking about what these words mean, it&amp;rsquo;s not helpful at all. Just follow my questions.
You: Yes, Master. Please start.
Master: There are plants, then there are fruits, then there are apples and pears.</description>
    </item>
    
    <item>
      <title>Realm Guide: From Zero to Give Up</title>
      <link>https://www.lvguowei.me/post/realm-learning-resources/</link>
      <pubDate>Sat, 25 Apr 2020 17:23:40 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/realm-learning-resources/</guid>
      <description>You know nothing about realm, then watch this video first -&amp;gt;
Now you should know the basic basics, then take a look at the official doc.
You think you know it all until you try to combine with RxJava.
Now you are super puzzled, look at some examples with full source code.
Finally you realize that you have to do all this in clean architecture and decided to give up by turning Realm into a NoSQL version SQLite.</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part 6)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-6/</link>
      <pubDate>Sun, 19 Apr 2020 07:47:47 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-6/</guid>
      <description>In this article we talk about drawing text.
Let&amp;rsquo;s see how to implement a view which simply displays some text. Let&amp;rsquo;s call it MyTextView.
This is how it will look like:
&amp;lt;!-- Omitted constraintlayout related stuff--&amp;gt; &amp;lt;com.example.MyTextView.MyTextView android:layout_width=&amp;#34;wrap_content&amp;#34; android:layout_height=&amp;#34;wrap_content&amp;#34; android:padding=&amp;#34;10dp&amp;#34; android:background=&amp;#34;@color/colorAccent&amp;#34; app:myTextColor=&amp;#34;#000000&amp;#34; app:myText=&amp;#34;Hello World! My love!&amp;#34; app:myTextSize=&amp;#34;24sp&amp;#34; /&amp;gt; Let&amp;rsquo;s first define the custom attributes of the view, in values/attrs.xml
&amp;lt;resources&amp;gt; &amp;lt;declare-styleable name=&amp;#34;MyTextView&amp;#34;&amp;gt; &amp;lt;attr format=&amp;#34;string&amp;#34; name=&amp;#34;myText&amp;#34; /&amp;gt; &amp;lt;attr format=&amp;#34;color&amp;#34; name=&amp;#34;myTextColor&amp;#34; /&amp;gt; &amp;lt;attr format=&amp;#34;dimension&amp;#34; name=&amp;#34;myTextSize&amp;#34; /&amp;gt; &amp;lt;/declare-styleable&amp;gt; &amp;lt;/resources&amp;gt; Then in the MyTextView.</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part 5)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-5/</link>
      <pubDate>Sun, 12 Apr 2020 14:02:16 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-5/</guid>
      <description>In this article we talk about animation, specifically property animation.
ViewPropertyAnimator View has many properties, like position on screen, color and size. Property animation is the type of animation that animate on those properties.
In other words, the animator&amp;rsquo;s job is to set a specific set of properties of the view to different values many many times in a short period of time.
For example, the following code will move the view&amp;rsquo;s position 500px to the right:</description>
    </item>
    
    <item>
      <title>Dagger Android Tutorial 4</title>
      <link>https://www.lvguowei.me/post/dagger-android-4/</link>
      <pubDate>Sun, 29 Mar 2020 15:18:19 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dagger-android-4/</guid>
      <description>Convert RxJava stream into LiveData stream When we use Rxjava for handling api requests, it will return a RxJava Stream. But in the presentation layer we are using LiveData, this article shows you how to make them work together.
The tool we are using here is LiveDataReactiveStreams.
It is an adapter from LiveData to ReactiveStream and vice versa.
This is how we do it in AuthViewModel.
public class AuthViewModel extends ViewModel { private static final String TAG = &amp;#34;AuthViewModel&amp;#34;; private final AuthApi authApi; // 1.</description>
    </item>
    
    <item>
      <title>Dagger Android Tutorial 3</title>
      <link>https://www.lvguowei.me/post/dagger-android-3/</link>
      <pubDate>Sun, 29 Mar 2020 09:58:23 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/dagger-android-3/</guid>
      <description>Inject Retrofit @Singleton The Retrofit instance should be a singleton in the scope of AppComponent.
Provide the Retrofit instance in AppModule.
@Singleton @Provides static Retrofit provideRetrofitInstance() { return new Retrofit.Builder().baseUrl(Constants.BASE_URL) .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .addConverterFactory(GsonConverterFactory.create()).build(); } Under AuthActivity subcomponent, create a module called AuthModule, in it, provides the AuthApi instance.
@Module public class AuthModule { @Provides static AuthApi provideAuthApi(Retrofit retrofit) { return retrofit.create(AuthApi.class); } } public interface AuthApi { @GET(&amp;#34;/users/{id}&amp;#34;) Flowable&amp;lt;User&amp;gt; getUser(@Path(&amp;#34;id&amp;#34;) int id); } @ContributesAndroidInjector(modules = {AuthModule.</description>
    </item>
    
    <item>
      <title>Dagger Android Tutorial 2</title>
      <link>https://www.lvguowei.me/post/dagger-android-2/</link>
      <pubDate>Sat, 28 Mar 2020 17:48:48 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/dagger-android-2/</guid>
      <description>In this article we show how to inject into ViewModels.
Note that we will not dive too deep into the inner workings of things, since they are extremely complex. If you want to get some level of insight into the topic read this article. But I try to give the clean solution and how you can put it in your head.
First a few words about the ViewModel in android MVVM architecture.</description>
    </item>
    
    <item>
      <title>Dagger Android Tutorial 1</title>
      <link>https://www.lvguowei.me/post/dagger-android-1/</link>
      <pubDate>Sat, 28 Mar 2020 07:52:09 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/dagger-android-1/</guid>
      <description>Warning: Google thinks you should avoid dagger-android for new projects. Watch Here
But, if you are using it now, here are some notes on how to approach it.
This is basically a text version of these videos
Application Component Pretty much every app will have an application component, whose scope will be the lifetime of the application.
First, create the AppComponent
//1. Include this &amp;#39;AndroidSupportInjectionModule&amp;#39;, this is required @Component(modules = {AndroidSupportInjectionModule.</description>
    </item>
    
    <item>
      <title>How to Fix Thinkpad X1 Carbon Headphone Clipping Noise</title>
      <link>https://www.lvguowei.me/post/how-to-fix-thinkpad-x1-carbon-headphone-clipping-noise/</link>
      <pubDate>Sat, 21 Mar 2020 00:22:17 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/how-to-fix-thinkpad-x1-carbon-headphone-clipping-noise/</guid>
      <description>Just got the Thinkpad X1 Carbon Gen 7 as work laptop. Installed manjaro and noticed that there is a clipping noise when using the headphone jack.
How to fix:
Install alsa-tools
Create a script in /usr/bin #!/bin/bash hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x67 hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x3000
Create a new file in /etc/systemd/system/
[Unit] Description=Scriptssh-keygen -t rsa -b 4096 -C &amp;#34;your_email@example.com&amp;#34; [Service] ExecStart=/usr/bin/script [Install] WantedBy=multi-user.target Run and auto start the service sudo chmod 755 /usr/bin/script sudo systemctl enable script.</description>
    </item>
    
    <item>
      <title>Family Trip to Costa Del Sol</title>
      <link>https://www.lvguowei.me/post/trip-to-costa-del-sol/</link>
      <pubDate>Mon, 16 Mar 2020 22:43:38 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/trip-to-costa-del-sol/</guid>
      <description>We went to Costa Del Sol just before the corona virus outbreak in Spain.</description>
    </item>
    
    <item>
      <title>Some Christmas themed writings</title>
      <link>https://www.lvguowei.me/post/calligraphy/</link>
      <pubDate>Mon, 16 Mar 2020 22:25:27 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/calligraphy/</guid>
      <description> </description>
    </item>
    
    <item>
      <title>SICP Goodness - Stream(11)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-stream-11/</link>
      <pubDate>Fri, 06 Mar 2020 20:53:21 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-stream-11/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
In last article we talked about the integral procedure. In this article, we talk about how to use it to solve differential equations.</description>
    </item>
    
    <item>
      <title>BetterWorldBooks Book Haul</title>
      <link>https://www.lvguowei.me/post/book-haul/</link>
      <pubDate>Fri, 06 Mar 2020 15:31:57 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/book-haul/</guid>
      <description>I&amp;rsquo;ve been browsing BetterWorldBooks a lot recently, and here are what I got.
Linear Algebra and Its Applications Essential LISP LISP Ship it! The ZEN of Programming Alice In Puzzle Land The Riddle of Scheherazade The TAO Is Silent What Is the Name of This Book </description>
    </item>
    
    <item>
      <title>Monthly Favourite Songs</title>
      <link>https://www.lvguowei.me/post/fav-songs/</link>
      <pubDate>Wed, 04 Mar 2020 21:14:57 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/fav-songs/</guid>
      <description>河合奈保子　ハーフムーン・セレナーデ 銀の龍の背に乗って 秋桜 </description>
    </item>
    
    <item>
      <title>SICP Goodness - Stream (10)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-stream-10/</link>
      <pubDate>Wed, 26 Feb 2020 13:14:23 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-stream-10/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Let&amp;rsquo;s talk about the integral example in the book.</description>
    </item>
    
    <item>
      <title>Machine Learning Resources</title>
      <link>https://www.lvguowei.me/post/machine-learning-resources/</link>
      <pubDate>Mon, 17 Feb 2020 13:56:17 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/machine-learning-resources/</guid>
      <description>I have a master degree in Machine Learning from Helsinki University. Unfortunately I&amp;rsquo;m not working in that field. But I want to revisit it. I have limited time so I hand picked very carefully a list of best resources. And recommendations are welcome!
Linear Algebra [Course] Gilbert Strang lectures on Linear Algebra
[Book] Linear Algebra and its Applications
Statistics [Book] An Introduction to Statistical Learning: With Applications in R
[Course] An Introduction to Statistical Learning: With Applications in R</description>
    </item>
    
    <item>
      <title>SICP Goodness - Stream (9)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-stream-9/</link>
      <pubDate>Fri, 14 Feb 2020 14:02:02 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-stream-9/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
I&amp;rsquo;ve been quite busy with work related stuff recently and not had enough time for this series.</description>
    </item>
    
    <item>
      <title>Programming books recommended by experts</title>
      <link>https://www.lvguowei.me/post/expert-recommendations/</link>
      <pubDate>Sat, 01 Feb 2020 21:48:38 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/expert-recommendations/</guid>
      <description>I&amp;rsquo;m so terribly bored at seeing people recommending Clean Code, Code Complete and such classic computer science books. Not that they are not good, they are very good and definitely worth reading. BUT, I want more! The old ones, weird ones, funny ones.
I happen to know two famous people who seem to enjoy writing stuff like this.
Fogus.
He is the author of The Joy of Clojure
Catonmat
He has 100 books to recommend.</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part 4)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-4/</link>
      <pubDate>Sun, 12 Jan 2020 21:50:24 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-4/</guid>
      <description>In this post we talk about the drawing order in custom view.
After super.onDraw() What we have done in the previous episodes is to override the onDraw() method of the View class.
A lot of times we do not need to create our own custom view from scratch. We can simply extends an existing view, e.g. ImageView. If we want to draw something on top of the image, we can write that after the super.</description>
    </item>
    
    <item>
      <title>Instance Initialization Block in Android</title>
      <link>https://www.lvguowei.me/post/java-iib/</link>
      <pubDate>Thu, 09 Jan 2020 21:22:02 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/java-iib/</guid>
      <description>This will be a short and sweet post.
The usage of Instance Initialization Block of Java in custom android views.
First of all, I have a confession to make. After almost 10 years of Java programming, I do not really know what is IIB and why it exists.
Pretty obviously, the purpose of IIB is to initialize instance variables of a class.
But you may ask isn&amp;rsquo;t that the job of constructors?</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part III)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-3/</link>
      <pubDate>Tue, 07 Jan 2020 12:13:36 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-3/</guid>
      <description>In this post, we will be focusing on what canvas can do.
To demonstrate the effects, I simply created custom view that draws an image. The original verion is like this:
Clip Clipping is easy to understand, it&amp;rsquo;s like cut the view in a certain way so that only part of it is shown.
There are 2 methods: clipRect() and clipPath().
clipRect() This method will clip the view using a rectangle.</description>
    </item>
    
    <item>
      <title>Toy Factory Simulation Using core.async (6)</title>
      <link>https://www.lvguowei.me/post/core-async-factory-6/</link>
      <pubDate>Sun, 15 Dec 2019 21:11:41 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/core-async-factory-6/</guid>
      <description>Let&amp;rsquo;s take another look at the assembly line diagram now.
If you pay close attention at each of the workers and observe how they work, you will probably find the 3 workers at the beginning of the assembly line to be a bit &amp;hellip; not that smart. All of them only one type of part, either wheels or bodies. If the body worker takes a wheel, he will just abandon it and keep taking new parts until he gets a body.</description>
    </item>
    
    <item>
      <title>Toy Factory Simulation Using core.async (5)</title>
      <link>https://www.lvguowei.me/post/core-async-factory-5/</link>
      <pubDate>Wed, 11 Dec 2019 20:55:42 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/core-async-factory-5/</guid>
      <description>We need a way to stop the whole assembly line after 10 toy cars have been put in the truck.
But before that, we need to understand more about chan.
Channels are created open Close a channel with close! You can call close! to close a channel. Once a channel is closed, it can never be reopened. Put (&amp;gt;!) on a closed channel returns false. Get (&amp;lt;!) from a closed channel returns nil.</description>
    </item>
    
    <item>
      <title>Toy Factory Simulation Using core.async (4)</title>
      <link>https://www.lvguowei.me/post/core-async-factory-4/</link>
      <pubDate>Tue, 10 Dec 2019 20:49:02 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/core-async-factory-4/</guid>
      <description>Let&amp;rsquo;s take the assembly-line function and refactor it to make things a bit more clear, and also as a recap.
(defn go-body [body-chan] (go (while true (let [body (loop [] (let [part (take-part)] (if (body? part) part (recur))))] (prn &amp;#34;Got body&amp;#34;) (&amp;gt;! body-chan body)))) ) (defn go-wheel1 [wheel1-chan] (go (while true (let [wheel1 (loop [] (let [part (take-part)] (if (wheel? part) part (recur))))] (prn &amp;#34;Got first wheel&amp;#34;) (&amp;gt;! wheel1-chan wheel1))))) (defn go-wheel2 [wheel2-chan] (go (while true (let [wheel2 (loop [] (let [part (take-part)] (if (wheel?</description>
    </item>
    
    <item>
      <title>Toy Factory Simulation Using core.async (3)</title>
      <link>https://www.lvguowei.me/post/core-async-factory-3/</link>
      <pubDate>Mon, 09 Dec 2019 09:28:11 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/core-async-factory-3/</guid>
      <description>One way to boost productivity in traditional factories is to use assembly line.
From Wikipedia:
An assembly line is a manufacturing process (often called a progressive assembly) in which parts (usually interchangeable parts) are added as the semi-finished assembly moves from workstation to workstation where the parts are added in sequence until the final assembly is produced. By mechanically moving the parts to the assembly work and moving the semi-finished assembly from work station to work station, a finished product can be assembled faster and with less labor than by having workers carry parts to a stationary piece for assembly.</description>
    </item>
    
    <item>
      <title>Toy Factory Simulation Using core.async (2)</title>
      <link>https://www.lvguowei.me/post/core-async-factory-2/</link>
      <pubDate>Sun, 08 Dec 2019 21:08:14 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/core-async-factory-2/</guid>
      <description>In Part 1 we have already defined the process of building toy cars, by one worker. Here is the code again for easy reference.
(defn build-car [n] (prn n &amp;#34;Starting build&amp;#34;) (let [body (loop [] (let [part (take-part)] (if (body? part) part (recur)))) _ (prn n &amp;#34;Got body&amp;#34;) wheel1 (loop [] (let [part (take-part)] (if (wheel? part) part (recur)))) _ (prn n &amp;#34;Got wheel1&amp;#34;) wheel2 (loop [] (let [part (take-part)] (if (wheel?</description>
    </item>
    
    <item>
      <title>Toy Factory Simulation Using core.async (1)</title>
      <link>https://www.lvguowei.me/post/core-async-factory/</link>
      <pubDate>Sun, 01 Dec 2019 22:48:10 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/core-async-factory/</guid>
      <description>After learning the core.async library in Clojure, I was craving for a real-world example. Now I found one from purelyfunctional.tv.
The original code can be found here.
The Toy Car Factory Let&amp;rsquo;s describe how a worker builds a toy car.
Take a car body from the part box. Take a wheel from the part box. Take another wheel from the part box. Attach the first wheel to the body. Attach the second wheel to the body.</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part II)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-2/</link>
      <pubDate>Tue, 24 Sep 2019 13:28:35 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-2/</guid>
      <description>In this post, we will be focusing on the Paint.
Color The color in Paint has 3 parts: basic color, color filter and xfermode.
Basic color There are 2 ways to set color in Paint: use setColor() and use Shader.
Set color directly Two methods can be used:
paint.setColor(Color.parseColor(&amp;#34;#B90E83&amp;#34;); paint.setARGB(100, 255, 0, 0); There is no difference, pick whichever you like.
Set color using Shader There are different types of Shader, let&amp;rsquo;s look them one by one.</description>
    </item>
    
    <item>
      <title>Android Custom View 102 (Part I)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-102-1/</link>
      <pubDate>Sat, 21 Sep 2019 22:33:51 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-102-1/</guid>
      <description>If 101 is like a crash course, then this 102 will provide much more detail.
In this 1st part, we focus on only one thing: how to draw things.
Draw Color Draw the entire view with one color.
public class DrawColorView extends View { ... @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawColor(Color.YELLOW); } } Draw Circle Draw a circle on the view.
Pay attention that all drawXXX() functions use pixel as unit.</description>
    </item>
    
    <item>
      <title>How to use CSS Line-Height</title>
      <link>https://www.lvguowei.me/post/how-to-css-line-height/</link>
      <pubDate>Thu, 15 Aug 2019 20:44:18 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/how-to-css-line-height/</guid>
      <description>There are 4 ways to specify line height in CSS:
/* The number way*/ line-height: 1.5; /* The em way*/ line-height: 1.5em; /* The percentage way*/ line-height: 150%; /* The pixel way*/ line-height: 24px; In simple settings, they are pretty much interchangable. For example:
&amp;lt;!doctype html&amp;gt; &amp;lt;html lang=&amp;#34;en&amp;#34;&amp;gt; &amp;lt;head&amp;gt; &amp;lt;meta charset=&amp;#34;UTF-8&amp;#34;/&amp;gt; &amp;lt;title&amp;gt;Document&amp;lt;/title&amp;gt; &amp;lt;style&amp;gt; p { font-size: 16px; line-height: 1.5; } &amp;lt;/style&amp;gt; &amp;lt;/head&amp;gt; &amp;lt;body&amp;gt; &amp;lt;p&amp;gt;I&amp;#39;m a paragraph.&amp;lt;/p&amp;gt; &amp;lt;/body&amp;gt; &amp;lt;/html&amp;gt; Here p can use all 4 ways and there would be no difference.</description>
    </item>
    
    <item>
      <title>Parenthesis in JavaScript</title>
      <link>https://www.lvguowei.me/post/arrow-function-return-object-literal/</link>
      <pubDate>Fri, 09 Aug 2019 09:58:15 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/arrow-function-return-object-literal/</guid>
      <description>For JavaScript beginners (I envy all of you because your brains are not damaged by this yet), () can be a huge confusion.
Example 1 const createPerson = name =&amp;gt; {firstname: name}; console.log(createPerson(&amp;#34;Guowei&amp;#34;)); Of course it logs undefined. Let&amp;rsquo;s ask JavaScript what was it thinking when it executed the code.
Me: Hi, JavaScript.
JavaScript: Hi!
Me: What the heck has happened? Where is my returned object?
JavaScript: Wait. What return? What object?</description>
    </item>
    
    <item>
      <title>How Scanf Works</title>
      <link>https://www.lvguowei.me/post/how-scanf-works/</link>
      <pubDate>Thu, 08 Aug 2019 20:36:01 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/how-scanf-works/</guid>
      <description>scanf is essentially a &amp;ldquo;pattern matching&amp;rdquo; function that tries to match up groups of input characters with conversion specifications.
An Example No blah blah blah, let&amp;rsquo;s see an example.
int i, j; float x, y; scanf(&amp;#34;%d%d%f%f&amp;#34;, &amp;amp;i, &amp;amp;j, &amp;amp;x, &amp;amp;y); // input // &amp;lt;space&amp;gt;&amp;lt;space&amp;gt;1-20.3-4.0e3&amp;lt;ret&amp;gt; Here is how scanf would process the new input:
Skips the leading 2 spaces. Conversion specification: %d. The first nonblank input character is 1; since integers can begin with 1, scanf then reads the next character, -.</description>
    </item>
    
    <item>
      <title>Making Sense of React&#39;s Render Props</title>
      <link>https://www.lvguowei.me/post/render-props/</link>
      <pubDate>Fri, 02 Aug 2019 09:51:30 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/render-props/</guid>
      <description>I came across render props when checking out Apollo GraphQL&amp;rsquo;s tutorial. Now I think I finally figured it out, I try my best to explain it as easy as possible here in my own words. The highlight is in the last part where I shed a FP light onto it. So stay tuned!
First, stop trying to understand the name render props. Instead, look at the following example.
I want to build a React Component which has 2 buttons cat and dog.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Stream (8)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-stream-8/</link>
      <pubDate>Fri, 05 Jul 2019 22:37:09 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-stream-8/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
One more example from the book and one related exercise.</description>
    </item>
    
    <item>
      <title>Peopleware Book Review</title>
      <link>https://www.lvguowei.me/post/peopleware-review/</link>
      <pubDate>Tue, 18 Jun 2019 22:26:39 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/peopleware-review/</guid>
      <description>I got this book from a secondhand book store online. And it is the 1st edition published in 1987, the year I was born.
I have only 2 things to say about this book.
It teachs you how to tell a great manager from a not so great one. Almost always peopleware wins over software. I highly recommend this book to anyone who want to peek into the world of managers.</description>
    </item>
    
    <item>
      <title>On Reading</title>
      <link>https://www.lvguowei.me/post/on-reading/</link>
      <pubDate>Fri, 31 May 2019 21:59:08 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/on-reading/</guid>
      <description>I found these wonderful talks about language learning / reading and how they will change your kid&amp;rsquo;s life. I mark them here for later reference.
One by Jim Trelease:
The other one by professor Stephen Krashen</description>
    </item>
    
    <item>
      <title>A Little Java a Few Patterns</title>
      <link>https://www.lvguowei.me/post/a-little-java-a-few-patterns/</link>
      <pubDate>Sat, 04 May 2019 21:51:09 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/a-little-java-a-few-patterns/</guid>
      <description>I got the book A Little Java, A Few Patterns not long ago and have been reading it since.
The teaching style of the book is refreshing. I do highly recommend this book if you want to learn about design patterns with a functional programming taste. Or if you simply love pizza.
The first half of the book is kind of easy for me since I already know Java and a few design patterns.</description>
    </item>
    
    <item>
      <title>I discovered James Coplien</title>
      <link>https://www.lvguowei.me/post/james-coplien/</link>
      <pubDate>Wed, 01 May 2019 20:52:19 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/james-coplien/</guid>
      <description>I do not remember how I find this guy on Youtube but BOY, my world is not the same.
I just link two of his talks here from Youtube. You can certainly find more.
I&amp;rsquo;m also interested in what books he would recommend to programmers. Here is the list of books he named in the interview with Developers On Fire.
I then go on to find what books he wrote. But in general they are not very well received.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Stream (7)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-stream-7/</link>
      <pubDate>Sat, 13 Apr 2019 20:39:53 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-stream-7/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Let&amp;rsquo;s examine some examples from the book and furthur explore the stream paradigm.</description>
    </item>
    
    <item>
      <title>BetterWorldBooks is Great!</title>
      <link>https://www.lvguowei.me/post/betterworld-orders/</link>
      <pubDate>Thu, 11 Apr 2019 20:30:07 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/betterworld-orders/</guid>
      <description>I just discovered this online book shop BetterWorldBooks. They have a pretty good computer books selection, and some of them are dirt cheap. So I made two orders today.
No shipping fee, plus I also caught the last day of Spring discount. :&amp;gt;
Highly recommended!</description>
    </item>
    
    <item>
      <title>SICP Goodness - Stream (6)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-stream-6/</link>
      <pubDate>Sat, 06 Apr 2019 20:31:46 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-stream-6/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Let&amp;rsquo;s do some exercises.
Exercise 3.53: Without running the program, describe the elements of the stream defined by (define s (cons-stream 1 (add-streams s s)))</description>
    </item>
    
    <item>
      <title>JavaScript the Definitive Guide Distilled</title>
      <link>https://www.lvguowei.me/post/javascript-the-definitive-guide-distilled/</link>
      <pubDate>Fri, 05 Apr 2019 10:19:52 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/javascript-the-definitive-guide-distilled/</guid>
      <description>null and undefined null is a language keyword and undefined is a predefined global object.
undefined represents a system level, unexpected or error-like absence of value.
nullrepresents program-level, normal or expected absence of value.
When writing programs yourself always use null.
global object When the JavaScript interpreter starts, it creates a new global object and gives it an initial set of properties.
In client-side JavaScript, the window object serves as the global object.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Stream (5)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-stream-5/</link>
      <pubDate>Tue, 19 Mar 2019 21:05:53 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-stream-5/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Streams can also be infinite, let&amp;rsquo;s look at some examples.</description>
    </item>
    
    <item>
      <title>Dracula Vocabulary</title>
      <link>https://www.lvguowei.me/post/dracula-vocabulary/</link>
      <pubDate>Sat, 16 Mar 2019 20:59:53 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/dracula-vocabulary/</guid>
      <description>Chapter 1 All day long we seemed to dawdle through a country which was full of beauty of every kind.
dawdle: to do something or go somewhere very slowly, taking more time than is necessary.
Stop dawdling! You&amp;rsquo;ll be late for school!
They are picturesque, but do not look prepossessing.
prepossessing: interesting, attractive, or impressive:
He wasn&amp;rsquo;t a very prepossessing sort of person. The box didn&amp;rsquo;t look very prepossessing, but the necklace inside was beautiful.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Stream (4)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-stream-4/</link>
      <pubDate>Thu, 14 Mar 2019 20:49:46 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-stream-4/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Let&amp;rsquo;s do one more exercise.
Exercise 3.51: In order to take a closer look at delayed evaluation, we will use the following procedure, which simply returns its argument after printing it: (define (show x) (display-line x) x)</description>
    </item>
    
    <item>
      <title>SICP Goodness - Stream (3)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-stream-3/</link>
      <pubDate>Wed, 13 Mar 2019 14:55:47 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-stream-3/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
To test our knowledge, let&amp;rsquo;s do some exercises from the book.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Stream (2)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-stream-2/</link>
      <pubDate>Sun, 10 Mar 2019 13:37:47 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-stream-2/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
In previous article, we implemented the very basics of stream: cons-stream, stream-car and stream-cdr, now we can implement some util functions based on those.</description>
    </item>
    
    <item>
      <title>C Programming - A Modern Approach</title>
      <link>https://www.lvguowei.me/post/c-programming-a-modern-approach-recommend/</link>
      <pubDate>Sat, 09 Mar 2019 22:33:07 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/c-programming-a-modern-approach-recommend/</guid>
      <description>I&amp;rsquo;m brushing up my C now using the book C Programming - A Modern Approach by K.N.King.
I have the classic K&amp;amp;R book, I do not recommend it. I just find it very hard to read, no matter if you are a novice or a veteran.
After some googling on people&amp;rsquo;s recommendations, I got the K.N.King book. I&amp;rsquo;m glad that I did. Very easy to read, has a good set of exercises and programming projects.</description>
    </item>
    
    <item>
      <title>Thoughts on Classic OOP Mindset</title>
      <link>https://www.lvguowei.me/post/thoughts-on-classic-oop/</link>
      <pubDate>Wed, 06 Mar 2019 22:16:33 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/thoughts-on-classic-oop/</guid>
      <description>OOP is still dominating in today&amp;rsquo;s software shops, especially in mobile/web development. Design patterns, SOLID principles and TDD etc. are the mainstream mindset to develop OOP software.
I still remembered my first programming job. Huge codebase, don&amp;rsquo;t know where to start. I even took notes of the code in my notebook and drew graphs of it. But still didn&amp;rsquo;t have a clue after years gone by. My desk was by the window, I used to look outside the window while standing beside it a lot.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Stream (1)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-stream-1/</link>
      <pubDate>Thu, 14 Feb 2019 21:36:32 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-stream-1/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Finally, we arrived at one the epic topics in the SICP book, stream.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Functional v.s. Object Oriented Programming?</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-functional-vs-oo/</link>
      <pubDate>Sun, 13 Jan 2019 20:52:15 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-functional-vs-oo/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Functional Programming is coming back in recent years, so people who have been doing Java or C++ for their entire career will want to know what is the difference.</description>
    </item>
    
    <item>
      <title>How Nested Function Can Help</title>
      <link>https://www.lvguowei.me/post/nested-function/</link>
      <pubDate>Fri, 11 Jan 2019 19:52:58 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/nested-function/</guid>
      <description>I have been exposed to a lot of Jonathan Blow&amp;rsquo;s ranting videos recently. One of his rant is that he does not like to break long functions into smaller ones. Main reason being those small functions may mislead the reader that they are reusable while actually they are normally not.
First of all, this is kind of the opposite of what uncle bob is saying. He talks a lot in his book and video lectures about how he loves to break up big functions into smaller ones.</description>
    </item>
    
    <item>
      <title>SICP Goodness - A Simulator for Digital Circuits (III)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-digital-circuits-sim-3/</link>
      <pubDate>Tue, 25 Dec 2018 20:24:09 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-digital-circuits-sim-3/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
In part 3 we can finally start talking about the digital circuits.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Peter Norvig Book Review</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-peter-norvig-review/</link>
      <pubDate>Sat, 15 Dec 2018 12:35:51 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-peter-norvig-review/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Today I found the book review from Peter Norvig, and it is such a pleasure to read, enjoy.</description>
    </item>
    
    <item>
      <title>SICP Goodness - A Simulator for Digital Circuits (II)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-digital-circuits-sim-2/</link>
      <pubDate>Sat, 15 Dec 2018 12:26:36 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-digital-circuits-sim-2/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Agenda Agenda is a data structure, that contains a schedule of things to do.</description>
    </item>
    
    <item>
      <title>SICP Goodness - A Simulator for Digital Circuits (I)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-digital-circuits-sim/</link>
      <pubDate>Fri, 14 Dec 2018 20:45:49 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-digital-circuits-sim/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
We are building a simulator program for digital circuits, using the Object Oriented view of the world, in Scheme Lisp.</description>
    </item>
    
    <item>
      <title>Hand Made Hero Day 1</title>
      <link>https://www.lvguowei.me/post/hand-made-hero-day-1/</link>
      <pubDate>Thu, 06 Dec 2018 12:20:41 -0800</pubDate>
      
      <guid>https://www.lvguowei.me/post/hand-made-hero-day-1/</guid>
      <description>Project Setup Use the command subst to create an alias to the working directory:
subst w: C:\Users\lv\work
Our project is actually created inside the work directory like this: \work\handmadehero.
Inside handmadehero, create two folders misc and code.
Inside code, create file win32_handmade.cpp.
Windows Entry Point All windows program has a entry point as follows, just put it in our code.
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { return 0; } How to Build We build our project from command line.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Data Directed Programming (III)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-data-directed-programming-and-message-passing-3/</link>
      <pubDate>Fri, 16 Nov 2018 20:29:13 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-data-directed-programming-and-message-passing-3/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
A Table to the Rescue In previous article, we see that it becomes quite annoying that each and every one of the generic selectors of the complex number has to do a cond on the types.</description>
    </item>
    
    <item>
      <title>Where to Put observeOn in Rxjava2</title>
      <link>https://www.lvguowei.me/post/where-to-put-observeon-rxjava2/</link>
      <pubDate>Thu, 08 Nov 2018 20:56:01 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/where-to-put-observeon-rxjava2/</guid>
      <description>Me: Why I have put the observeOn(AndroidSchedulars.mainThread()) but still onNext() is NOT called in android main thread?!
Rx Master: Show me your code.
Me: Here you are my master. I just want to wait for 5 seconds then call an api:
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) fun networkObservable(): Observable&amp;lt;String&amp;gt; { return Observable.just(&amp;#34;test&amp;#34;).subscribeOn(Schedulers.io()) } Observable.timer(5, TimeUnit.SECONDS) .observeOn(AndroidSchedulers.mainThread()) .flatMap { _ -&amp;gt; networkObservable() } .subscribe(Consumer { Log.d(&amp;#34;testtest&amp;#34;, it) Log.d(&amp;#34;testtest&amp;#34;, Thread.currentThread().name) }) } } Rx Master: &amp;hellip; Read the Doc of observeOn:</description>
    </item>
    
    <item>
      <title>SICP Goodness - Data Directed Programming (II)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-data-directed-programming-and-message-passing-2/</link>
      <pubDate>Fri, 02 Nov 2018 20:33:51 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-data-directed-programming-and-message-passing-2/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Tagged Data At the end of previous post, we identified one problem of our current complex number system, which is given a complex number, there is no way to tell whether it is implemented in rectangular form or polar form.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Data Directed Programming (I)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-data-directed-programming-and-message-passing/</link>
      <pubDate>Sun, 28 Oct 2018 20:17:15 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-data-directed-programming-and-message-passing/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
When I first read about data directed programming in the book, I was surprised.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Mutable Data (II)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-mutable-data-2/</link>
      <pubDate>Fri, 26 Oct 2018 19:55:26 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-mutable-data-2/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Representing Tables We can build a table data structure by just using pairs.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Mutable Data (I)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-mutable-data-1/</link>
      <pubDate>Mon, 22 Oct 2018 22:26:22 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-mutable-data-1/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Mutable List Structure We introduce 2 operations to change a list: set-car!</description>
    </item>
    
    <item>
      <title>SICP Goodness - The Environment Model</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-environment-model/</link>
      <pubDate>Mon, 08 Oct 2018 19:53:20 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-environment-model/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Before introducing assignment operation set!, we can use the substitution model of evaluation.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Message Passing</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-message-passing/</link>
      <pubDate>Sun, 30 Sep 2018 13:40:07 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-message-passing/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
In this article, we will see how to construct an object that has internal states by using message passing.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Why Assignment Is Still Useful in Functional Programming</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-why-assignment-is-still-useful/</link>
      <pubDate>Fri, 14 Sep 2018 21:53:35 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-why-assignment-is-still-useful/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
In FP world people bash assignment. They say it is the root of all evils.</description>
    </item>
    
    <item>
      <title>A Plea for Lean Software</title>
      <link>https://www.lvguowei.me/post/a-plea-for-lean-software/</link>
      <pubDate>Tue, 11 Sep 2018 20:54:06 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/a-plea-for-lean-software/</guid>
      <description>I recently watched the talk A Guide for the Perplexed given by Joe Armstrong.
He recommended two papers. One is A Plea for Lean Software by Niklaus Wirth, who is the creator of the Pascal language.
After I read the paper I found that the this man is brilliant! He had found some of the deep problems in the industry and offered solutions decades ago. Unfortunately no one listened to him.</description>
    </item>
    
    <item>
      <title>SICP Goodness - The Essence of Computer Science</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-the-essence-of-computer-science/</link>
      <pubDate>Sun, 09 Sep 2018 19:40:17 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-the-essence-of-computer-science/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
The following text is from the preface to the first edition of SICP.</description>
    </item>
    
    <item>
      <title>SICP Goodness - From Pair to Flatmap (II)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-from-pair-to-flatmap-2/</link>
      <pubDate>Sat, 01 Sep 2018 10:12:11 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-from-pair-to-flatmap-2/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Part I of this series can be found here.</description>
    </item>
    
    <item>
      <title>SICP Goodness - From Pair to Flatmap (I)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-from-pair-to-flatmap/</link>
      <pubDate>Sat, 25 Aug 2018 22:07:55 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-from-pair-to-flatmap/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Sequence is an important data structure in any programming language, especially in Lisp.</description>
    </item>
    
    <item>
      <title>Singleton Pattern Inside and Out</title>
      <link>https://www.lvguowei.me/post/singleton/</link>
      <pubDate>Mon, 20 Aug 2018 21:38:04 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/singleton/</guid>
      <description>Singleton Pattern is so popular that if you know only one design pattern it will probably be it. But do you know it inside out?
There are different flavors of this pattern, let&amp;rsquo;s examine them one by one.
Dummy Singleton This is the simplest implementation of Singleton Pattern. Just use a static final field in the class to store an instance of the class, and make all constructors private. See the example below:</description>
    </item>
    
    <item>
      <title>Using Interface for Code Organization</title>
      <link>https://www.lvguowei.me/post/using-interface-for-organization/</link>
      <pubDate>Sun, 19 Aug 2018 22:13:05 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/using-interface-for-organization/</guid>
      <description>Another gem found in the book Thinking In Java.
Interface in Java can actually be used as a container for closly related concepts.
Using Interface and Enum for Subcategorization This can be best explained using an example.
Say we have enums for different types of Foods. But we also want to mark that they are all Food. The code is like:
public interface Food { enum Appetizer implements Food { SALAD, SOUP, SPRING_ROLLS; } enum MainCourse implements Food { LASAGNE, BURRITO, PAD_THAI, LENTILS, HUMMOUS, VINDALOO; } enum Dessert implements Food { TIRAMISU, GELATO, BLACK_FOREST_CAKE, FRUIT, CREME_CARAMEL; } enum Coffee implements Food { BLACK_COFFEE, DECAF_COFFEE, ESPRESSO, LATTE, CAPPUCCINO, TEA, HERB_TEA; } } Since all enum classes inherit from the built-in java.</description>
    </item>
    
    <item>
      <title>Android Design Pattern - Build a SOLID Image Loader</title>
      <link>https://www.lvguowei.me/post/android-design-pattern-imageloader/</link>
      <pubDate>Thu, 16 Aug 2018 12:29:18 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-design-pattern-imageloader/</guid>
      <description>SOLID Principles and Design Patterns play an important role in Android development.
Lets take a look at how to design and implement an image loader step by step. This example comes from the book Android Source Code Design Patterns - Analysis and Practice. I also rewrote all the code from Java to Kotlin and made some bug fixes.
Step 1: Make it work Requirement: Our first version of image loader will just use in-memory cache to cache images loaded from the Internet, we will ignore cache validation for now.</description>
    </item>
    
    <item>
      <title>Practical C - Stack</title>
      <link>https://www.lvguowei.me/post/practical-c-stack/</link>
      <pubDate>Sat, 11 Aug 2018 20:42:34 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/practical-c-stack/</guid>
      <description>In this blog post, let&amp;rsquo;s implement a generic stack in C.
We will do this by several iterations, from simple version to the full blown version step by step.
An Integer Version Let&amp;rsquo;s start with implementing an integer stack.
#include &amp;lt;assert.h&amp;gt; #include &amp;lt;stdio.h&amp;gt; #include &amp;lt;stdlib.h&amp;gt; typedef struct { // int array to store elements of the stack int *elems; // the actual length of the stack int logicalLen; // the allocated length of the array int allocLen; } stack; // Initialize a stack void StackNew(stack *s); // Dispose a stack void StackDispose(stack *s); // Push an element onto the stack void StackPush(stack *s, int value); // Pop an element from the stack int StackPop(stack *s); void StackNew(stack *s) { // allocate 4 elements for the array s-&amp;gt;elems = (int *)malloc(4 * sizeof(int)); s-&amp;gt;allocLen = 4; s-&amp;gt;logicalLen = 0; } void StackDispose(stack *s) { free(s-&amp;gt;elems); } void StackPush(stack *s, int value) { if (s-&amp;gt;logicalLen == s-&amp;gt;allocLen) { // double the size of the array if there is no free space in it s-&amp;gt;elems = (int *)realloc(s-&amp;gt;elems, 2 * s-&amp;gt;allocLen * sizeof(int)); s-&amp;gt;allocLen *= 2; } s-&amp;gt;elems[s-&amp;gt;logicalLen] = value; s-&amp;gt;logicalLen++; } int StackPop(stack *s) { assert(s-&amp;gt;logicalLen !</description>
    </item>
    
    <item>
      <title>Practical C - Linear Search</title>
      <link>https://www.lvguowei.me/post/lsearch-in-c/</link>
      <pubDate>Sun, 05 Aug 2018 23:06:09 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/lsearch-in-c/</guid>
      <description>I start this blog series to show some of the trickier parts of C programming.
In the first post, let&amp;rsquo;s implement the linear search in C.
Integer Version Let&amp;rsquo;s imagine that we search on an integer array.
Two things to notice here:
The function needs the array size n as a separate parameter. Only the array&amp;rsquo;s address is passed in the function. Generic Basic Version Let&amp;rsquo;s write a more generic version that does not specify type.</description>
    </item>
    
    <item>
      <title>OOP considered harmful ?</title>
      <link>https://www.lvguowei.me/post/anti-oop/</link>
      <pubDate>Wed, 01 Aug 2018 22:19:58 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/anti-oop/</guid>
      <description>I have no intention to start flame war here.
Just over the years of exploring, I have collected some materials that are not supporting the mainstream OOP paradigm. I just list them here, in no particular order.
Stop Writing Classes This is a great talk, I think people will agree most of what&amp;rsquo;s in this video.
The Third Million Line Problem This is slightly off topic, but interesing to watch.</description>
    </item>
    
    <item>
      <title>Clear Azure CosmosDB Documents</title>
      <link>https://www.lvguowei.me/post/azure-cosmosdb-clear/</link>
      <pubDate>Thu, 26 Jul 2018 11:02:46 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/azure-cosmosdb-clear/</guid>
      <description>It suprised me that one cannot clear all documents in a CosmosDB collection from the web portal.
The only solution for now is to use its SDK, so I wrote a simple Node script.
It now can list all the documents and delete them, it can be easily modified to suit your need.
var docdb = require(&amp;#34;documentdb&amp;#34;); var async = require(&amp;#34;async&amp;#34;); var config = { host: &amp;#34;https://xxxx.documents.azure.com:443/&amp;#34;, auth: { masterKey: &amp;#34;xxxx&amp;#34; } }; var client = new docdb.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Continued Fraction</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-cont-frac/</link>
      <pubDate>Tue, 24 Jul 2018 22:39:43 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-cont-frac/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Writing recursive functions is not an easy task, often requires a different way of thinking.</description>
    </item>
    
    <item>
      <title>SICP Goodness - What is Meant by Data? (II)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-data-2/</link>
      <pubDate>Sun, 15 Jul 2018 20:58:31 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-data-2/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
This is the second part of a two part series, you can find the first part here.</description>
    </item>
    
    <item>
      <title>Interesting Finds</title>
      <link>https://www.lvguowei.me/post/interesting-finds/</link>
      <pubDate>Sun, 15 Jul 2018 10:04:53 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/interesting-finds/</guid>
      <description>I need a place to save the interesting/useful stuff that I find for later use.
MIT Course Programming for the Puzzled
A book recently published that seems to be much better than clean code A Philosophy of Software Design
MIT Course Computational Science and Engineering
A book by Niklaus Wirth Algorithms + Data Structures = Programms, and one that has similar content but without compiler implementation and uses Modular-2 Algorithms&amp;amp;Data Structures</description>
    </item>
    
    <item>
      <title>SICP Goodness - What is Meant by Data? (I)</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-data/</link>
      <pubDate>Tue, 10 Jul 2018 21:36:11 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-data/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Let&amp;rsquo;s begin by asking the question: What is data? You may say that data is numbers, characters, strings, pairs, lists, maps, sets and so on.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Fibonacci numbers</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-fib/</link>
      <pubDate>Fri, 06 Jul 2018 20:35:43 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-fib/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Every programmer at some point has studied fibonacci numbers, mostly likely as an interview question.</description>
    </item>
    
    <item>
      <title>SICP Goodness - The Opening Music of SICP MIT Course</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-music/</link>
      <pubDate>Mon, 02 Jul 2018 20:49:50 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-music/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
The music in the beginning of each lecture is beautiful.</description>
    </item>
    
    <item>
      <title>SICP Goodness - A deep dive into square root procedure</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-sqrt/</link>
      <pubDate>Fri, 29 Jun 2018 20:52:11 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-sqrt/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
There are several epic example problems in the book, the first one of them is of how to calculate the square root of a number.</description>
    </item>
    
    <item>
      <title>SICP Goodness - A guess of why was the name &#39;let&#39; chosen for block-scoped variable declarations in JavaScript</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-let/</link>
      <pubDate>Thu, 28 Jun 2018 21:59:58 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-let/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
In this post I give my guess of where the new let keyword in JavaScript comes from.</description>
    </item>
    
    <item>
      <title>SICP Goodness - Why you don&#39;t need looping constructs</title>
      <link>https://www.lvguowei.me/post/sicp-goodness-looping/</link>
      <pubDate>Sat, 16 Jun 2018 21:07:45 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness-looping/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
I was quite shocked when I first read the following text from the book:</description>
    </item>
    
    <item>
      <title>SICP Goodness - Applicative Order v.s. Normal Order</title>
      <link>https://www.lvguowei.me/post/sicp-goodness/</link>
      <pubDate>Wed, 13 Jun 2018 22:30:04 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-goodness/</guid>
      <description>Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
This is the first post of this SICP Goodness series, in which I discuss some of my own findings from reading the book SICP.</description>
    </item>
    
    <item>
      <title>How to Setup ESLint and Prettier in VSCode For React Project</title>
      <link>https://www.lvguowei.me/post/vscode-eslint-prettier/</link>
      <pubDate>Sun, 10 Jun 2018 21:42:40 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/vscode-eslint-prettier/</guid>
      <description>Create a React App: npx create-react-app my-app
Install ESLint and Prettier in VSCode.
In the project directory, run npm i prettier eslint-config-prettier eslint-plugin-prettier -D
In User Settings (ctrl + ,), put in the following:
{ &amp;#34;editor.formatOnSave&amp;#34;: true, &amp;#34;[javascript]&amp;#34;: { &amp;#34;editor.formatOnSave&amp;#34;: false }, &amp;#34;eslint.autoFixOnSave&amp;#34;: true, &amp;#34;eslint.alwaysShowStatus&amp;#34;: true, &amp;#34;prettier.disableLanguages&amp;#34;: [ &amp;#34;js&amp;#34; ], &amp;#34;files.autoSave&amp;#34;: &amp;#34;onFocusChange&amp;#34; } Create an .eslintrc file: { &amp;#34;extends&amp;#34;: [&amp;#34;react-app&amp;#34;, &amp;#34;plugin:prettier/recommended&amp;#34;] } If your project is not under git, run git init.</description>
    </item>
    
    <item>
      <title>Building a JavaScript Development Environment</title>
      <link>https://www.lvguowei.me/post/building-js-dev-env/</link>
      <pubDate>Mon, 04 Jun 2018 14:44:51 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/building-js-dev-env/</guid>
      <description>This blog post is a summary of the excellent Pluralsight Course by Cory House.
Editor and Configuration First of all, editor of choice here is surprise surprise VS Code. I&amp;rsquo;m actually happly surprised that Erich Gamma is behind this.
Use EditorConfig to manage, well, editor configurations. Tabs VS spaces, etc. Note that VS Code need to install a plugin for it to work.
The example .editorconfig file:
root = true [*] indent_style = space indent_size = 2 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true charset = utf-8 [*.</description>
    </item>
    
    <item>
      <title>Python Class Development Toolkit</title>
      <link>https://www.lvguowei.me/post/python-class-toolkit/</link>
      <pubDate>Sun, 03 Jun 2018 09:48:55 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/python-class-toolkit/</guid>
      <description>Raymond Hettinger is a python core developer. I recently find that his python teaching videos are of very high quality and amusing at the same time. They are usually packed with tips and wisdoms here and there, so I think some written version of his videos might be helpful as references.
Here is the one about new style python class.
Code in the video:</description>
    </item>
    
    <item>
      <title>GOOS Book Distilled Part 12</title>
      <link>https://www.lvguowei.me/post/goos-18/</link>
      <pubDate>Thu, 17 May 2018 21:11:36 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-18/</guid>
      <description>This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.
This post covers Chapter 19 Handling Failure, which is also the last chapter in the book related to this project.</description>
    </item>
    
    <item>
      <title>JavaScript and Prototype Design Pattern</title>
      <link>https://www.lvguowei.me/post/javascript-and-prototype-design-pattern/</link>
      <pubDate>Thu, 03 May 2018 21:32:16 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/javascript-and-prototype-design-pattern/</guid>
      <description>Javascript has prototypal inheritance.
For example let&amp;rsquo;s create a constructor function:
function Person(firstname, lastname) { this.firstname = firstname; this.lastname = lastname; } Person.prototype = { fullname: function() { return this.firstname + &amp;#39; &amp;#39; + this.lastname; } }; var bob = new Person(&amp;#34;Bob&amp;#34;, &amp;#34;Doe&amp;#34;); console.log(bob.fullname()); This is very similar to the Prototype Pattern. Whenever we want a new object, we always create it out of some prototype object.
I find that it is easier to understand the JS&amp;rsquo;s prototype inheritance when comparing it with the Prototype Pattern.</description>
    </item>
    
    <item>
      <title>JavaScript the Weird Parts Distilled</title>
      <link>https://www.lvguowei.me/post/javascript-the-weird-part/</link>
      <pubDate>Thu, 03 May 2018 16:19:13 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/javascript-the-weird-part/</guid>
      <description>Javascript: Understanding the Weird Parts is a great course. Highly recommended if you are getting into JS from other programming languages. Much better than the book Javascript: the Good Parts in my opinion.
Here I distilled all the source code with comments from the videos, for the impatients.</description>
    </item>
    
    <item>
      <title>How to AssertThat Two Objects Are Equal</title>
      <link>https://www.lvguowei.me/post/how-to-assertthat-two-objects-are-equal/</link>
      <pubDate>Wed, 25 Apr 2018 21:50:47 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/how-to-assertthat-two-objects-are-equal/</guid>
      <description>The answer to this question is easy:
assertThat(a, is(b))
Done.
Wait, before closing this web page, let me ask you a few questions.
First, let&amp;rsquo;s make a concrete class Student.
public class Student { public final String name; public final int age; public final String id; public Student(String name, int age, String id) { this.name = name; this.age = age; this.id = id; } } Very simple data class. Now let&amp;rsquo;s try the solution in the beginning of the article.</description>
    </item>
    
    <item>
      <title>My Experience with First Day of JavaScript30</title>
      <link>https://www.lvguowei.me/post/my-experience-with-js30/</link>
      <pubDate>Tue, 17 Apr 2018 15:51:02 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/my-experience-with-js30/</guid>
      <description>It&amp;rsquo;s nice weather today, so I decided to give JS another chance.
For thoes who don&amp;rsquo;t know yet(really, if you want to do JS you should know already, haven&amp;rsquo;t you been reading everything in JS weekly every week?). There is a free course called JavaScript30 offered by Wes Bos, in which you build 30 small project using vanilla JS. Since it is perceived pretty well in JS community, I decided to start from there.</description>
    </item>
    
    <item>
      <title>How to run, let, also, apply in Kotlin</title>
      <link>https://www.lvguowei.me/post/kotlin-run-let-also-apply/</link>
      <pubDate>Mon, 16 Apr 2018 14:41:25 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/kotlin-run-let-also-apply/</guid>
      <description>If you decide to write Kotlin code, eventually you will see a lot of usage of the following 4 functions from standard library: run, let, also and apply.
After doing a lot of research, I show simple examples of how to use them here.
First, a helper class Student.
class Student(name: String, age: Int, stuNum: String) { var name = name private set var age = age private set var stuNum = stuNum private set fun increaseAge() { age++ } fun nameToUpperCase() { name = name.</description>
    </item>
    
    <item>
      <title>Punk Rock Languages</title>
      <link>https://www.lvguowei.me/post/punk-rock-languages/</link>
      <pubDate>Thu, 12 Apr 2018 20:15:46 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/punk-rock-languages/</guid>
      <description>It&amp;rsquo;s rare that in one article the author praises C and JavaScript at the same time. After I read this one, I fear that it may vanish any time soon, so I decided to repost it here.
That C has won the end-user practicality battle is obvious to everyone except developers.
The year is 1978, and the first wave of punk rock is reaching its nihilistic peak with infamous U.K. band the Sex Pistols touring the United States and promptly breaking up by the time they reach the West Coast.</description>
    </item>
    
    <item>
      <title>GOOS Book Distilled Part 14</title>
      <link>https://www.lvguowei.me/post/goos-16/</link>
      <pubDate>Fri, 06 Apr 2018 21:34:52 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-16/</guid>
      <description>This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.
This post covers Chapter 17 of the book: Teasing Apart Main.</description>
    </item>
    
    <item>
      <title>Some explanation of the Announcer</title>
      <link>https://www.lvguowei.me/post/goos-15/</link>
      <pubDate>Fri, 30 Mar 2018 09:48:48 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-15/</guid>
      <description>This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.
In the GOOS book, the author at some point mentioned that a Announcer class from JMock is used.</description>
    </item>
    
    <item>
      <title>GOOS Book Distilled Part 13</title>
      <link>https://www.lvguowei.me/post/goos-14/</link>
      <pubDate>Sat, 24 Mar 2018 09:48:48 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-14/</guid>
      <description>This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.
Adding Items through the User Interface A Simpler Design Now the UI designer finally catches up and provides a sketch of the new user interface, with one text field and a Join Auction button.</description>
    </item>
    
    <item>
      <title>GOOS Book Distilled Part 12</title>
      <link>https://www.lvguowei.me/post/goos-13/</link>
      <pubDate>Sat, 17 Mar 2018 21:42:01 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-13/</guid>
      <description>This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.
In this post, we start Chapter 16 Sniping for Multiple Items.</description>
    </item>
    
    <item>
      <title>GOOS Book Distilled Part 11</title>
      <link>https://www.lvguowei.me/post/goos-12/</link>
      <pubDate>Tue, 06 Mar 2018 20:37:40 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-12/</guid>
      <description>This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.
Simplifying Sniper Events Listening to the Mood Music Let&amp;rsquo;s take a closer look at how AuctionSniper notifies its SniperListener.</description>
    </item>
    
    <item>
      <title>GOOS Book Distilled Part 10</title>
      <link>https://www.lvguowei.me/post/goos-11/</link>
      <pubDate>Mon, 26 Feb 2018 20:14:34 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-11/</guid>
      <description>This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.
This post is the beginning of Chapter 15 Towards a Real User Interface.</description>
    </item>
    
    <item>
      <title>GOOS Book Distilled Part 9</title>
      <link>https://www.lvguowei.me/post/goos-10/</link>
      <pubDate>Sun, 25 Feb 2018 19:52:11 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-10/</guid>
      <description>This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.
This post will cover the whole Chapter 14.</description>
    </item>
    
    <item>
      <title>GOOS Book Distilled Part 8</title>
      <link>https://www.lvguowei.me/post/goos-9/</link>
      <pubDate>Fri, 23 Feb 2018 20:18:12 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-9/</guid>
      <description>This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.
It&amp;rsquo;s all about refactoring this time!
1. Extracting XMPPAuction In Main, we see some places chat sends messages.</description>
    </item>
    
    <item>
      <title>GOOS Book Distilled Part 7</title>
      <link>https://www.lvguowei.me/post/goos-8/</link>
      <pubDate>Mon, 19 Feb 2018 21:16:50 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-8/</guid>
      <description>This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.
Let&amp;rsquo;s start off by taking a closer look at our AuctionSniper.</description>
    </item>
    
    <item>
      <title>GOOS Book Distilled Part 6</title>
      <link>https://www.lvguowei.me/post/goos-7/</link>
      <pubDate>Sat, 17 Feb 2018 21:40:22 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-7/</guid>
      <description>This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.
This is the beginning of Chapter 13 in the book.</description>
    </item>
    
    <item>
      <title>GOOS Book Distilled Part 5</title>
      <link>https://www.lvguowei.me/post/goos-6/</link>
      <pubDate>Sat, 17 Feb 2018 09:06:27 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-6/</guid>
      <description>This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.
In previous post, we wrote our first unit test on the AuctionMessageTranslator on how to handle CLOSE message.</description>
    </item>
    
    <item>
      <title>GOOS Book Distilled Part 4</title>
      <link>https://www.lvguowei.me/post/goos-5/</link>
      <pubDate>Tue, 13 Feb 2018 20:35:44 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-5/</guid>
      <description>This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.
Let&amp;rsquo;s recap what our sniper can do by now, which is not much.</description>
    </item>
    
    <item>
      <title>GOOS Book Distilled Part 3</title>
      <link>https://www.lvguowei.me/post/goos-4/</link>
      <pubDate>Sun, 11 Feb 2018 12:47:26 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-4/</guid>
      <description>This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.
In this post, we start our second acceptance test.</description>
    </item>
    
    <item>
      <title>GOOS Book Distilled Part 2</title>
      <link>https://www.lvguowei.me/post/goos-3/</link>
      <pubDate>Wed, 07 Feb 2018 21:05:34 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-3/</guid>
      <description>This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.
The goal in this post is to make the first acceptance test pass.</description>
    </item>
    
    <item>
      <title>GOOS Book  Distilled Part 1</title>
      <link>https://www.lvguowei.me/post/goos-2/</link>
      <pubDate>Mon, 05 Feb 2018 19:51:42 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-2/</guid>
      <description>This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.
Now it&amp;rsquo;s about time to write our first acceptance test.</description>
    </item>
    
    <item>
      <title>GOOS Book Distilled Part 0</title>
      <link>https://www.lvguowei.me/post/goos-1/</link>
      <pubDate>Sun, 04 Feb 2018 21:08:43 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/goos-1/</guid>
      <description>I decided to start this new series of blog posts to mark my progress of re-reading the classic book Growing Object-Oriented Software, Guided By Tests.
I read this book a couple of months ago (mostly on the train to work), I remembered it is a good book, but since I have no code out of it, the understanding must not be good.
So this time, I&amp;rsquo;m gonna do it the hard way.</description>
    </item>
    
    <item>
      <title>Completed Programming Paradigms Course</title>
      <link>https://www.lvguowei.me/post/completed-programming-paradigms/</link>
      <pubDate>Sat, 27 Jan 2018 21:48:33 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/completed-programming-paradigms/</guid>
      <description>Finally I finished the 27th video on the famous Programming Paradigms course by Stanford. It&amp;rsquo;s excellent!
It basically covers:
C programming. Functional programming (using Scheme). Jerry is an excellent teacher! Thank you for putting up the material online. Highly recommended for anyone!</description>
    </item>
    
    <item>
      <title>Icecream Shop Simulation</title>
      <link>https://www.lvguowei.me/post/icecream-shop-simulation/</link>
      <pubDate>Fri, 19 Jan 2018 21:08:08 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/icecream-shop-simulation/</guid>
      <description>I have been watching the good old Stanford CS course Programming Paradigms. The first half of the course deals with C and serves as great material for learning C. Then the course introduced threads, and concurrent programming in C with some homebrew library. The most complicated example given is this program that simulated the icecream shop. Here are the description of the problem:
This program simulates the daily activity in an ice cream store.</description>
    </item>
    
    <item>
      <title>You Think You Know If Else?</title>
      <link>https://www.lvguowei.me/post/you-think-you-know-if-else/</link>
      <pubDate>Sun, 14 Jan 2018 21:26:23 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/you-think-you-know-if-else/</guid>
      <description>I was shocked during this fantastic video by Kevlin Henney
not because all the programming history that he talked about, but by one simple example of if-else statement. Here is the leap year function he gave as an example in the talk:
def isLeapYear(year) { if (year % 400 == 0) return true if (year % 100 == 0) return false if (year % 4 == 0) return true return false } def isLeapYear(year) { if (year % 400 == 0) return true else if (year % 100 == 0) return false else if (year % 4 == 0) return true else return false } Which one do you think is better?</description>
    </item>
    
    <item>
      <title>Dynamically Load Windows Function by Yourself</title>
      <link>https://www.lvguowei.me/post/dynamically-load-win-function-by-yourself/</link>
      <pubDate>Sun, 07 Jan 2018 21:01:21 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/dynamically-load-win-function-by-yourself/</guid>
      <description>In HandMadeHero Day6, Casey showed a neat way to load a Windows function by yourself. The senario is as follows:
In order to get game pad input working, we need the function XInputGetState, but it is in different dll files on different Windows versions, if we link directly to Xinput.lib, then we have the risk of the program won&amp;rsquo;t start if somehow the dll is not found in the system. We don&amp;rsquo;t want that to happen considering that the user may not even use a game pad.</description>
    </item>
    
    <item>
      <title>Hand Made Hero Day 5</title>
      <link>https://www.lvguowei.me/post/handmakehero-day-5/</link>
      <pubDate>Wed, 03 Jan 2018 21:56:54 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/handmakehero-day-5/</guid>
      <description>I started to follow Hand Made Hero again, here is the source code from Day 5. I also formatted it with clang.
win32_handmade.cpp
#include &amp;lt;stdint.h&amp;gt; #include &amp;lt;windows.h&amp;gt; #define internal static #define local_persist static #define global_variable static typedef int8_t int8; typedef int16_t int16; typedef int32_t int32; typedef int64_t int64; typedef uint8_t uint8; // 1 byte typedef uint16_t uint16; // 2 bytes typedef uint32_t uint32; // 3 bytes typedef uint64_t uint64; // 4 bytes struct win32_offscreen_buffer { // Pixels are alwasy 32-bits wide, Memory Order BB GG RR XX BITMAPINFO Info; void *Memory; int Width; int Height; int Pitch; }; struct win32_window_dimension { int Width; int Height; }; global_variable bool GlobalRunning; global_variable win32_offscreen_buffer GlobalBackbuffer; win32_window_dimension Win32GetWindowDimension(HWND Window) { win32_window_dimension Result; RECT ClientRect; GetClientRect(Window, &amp;amp;ClientRect); Result.</description>
    </item>
    
    <item>
      <title>Linus Talk at Aalto University</title>
      <link>https://www.lvguowei.me/post/linus-talk-aalto/</link>
      <pubDate>Fri, 29 Dec 2017 21:43:40 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/linus-talk-aalto/</guid>
      <description>This whole video is in Q&amp;amp;A form, which is quite enjoyable to watch.
I strongly agree with Linus in the following thoughts:
Passion, hard work and attention to details are extremely important. Whether you have vision or not is totally another story. People who easily get offended, should be offended. </description>
    </item>
    
    <item>
      <title>Generic Programming in C</title>
      <link>https://www.lvguowei.me/post/generic-programming-in-c/</link>
      <pubDate>Wed, 27 Dec 2017 21:43:47 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/generic-programming-in-c/</guid>
      <description>Generic programming is an important idea in programming. In languages like Java and C++, it can be done easily. In this post, I show how to do it in plain old C.
We use the classic stack implementation. First, we implement an int version.
This is stack.h:
typedef struct { int *elems; int logLength; int allocLengh; } stack; void StackNew(stack *s); void StackDispose(stack *s); void StackPush(stack *s, int value); int StackPop(stack *s); This is stack.</description>
    </item>
    
    <item>
      <title>What the FlatMap?</title>
      <link>https://www.lvguowei.me/post/what-the-flatmap/</link>
      <pubDate>Sun, 17 Dec 2017 20:04:29 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/what-the-flatmap/</guid>
      <description>The operator flatmap in RxJava is a tough topic if you are not familiar with functional style.
After reading all the articles and tutorials and even worked with RxJava for almost a year, I&amp;rsquo;m still not quite confident about it. I sure know how to and when to use it, but the understanding seems always shallow.
Until I read the flatmap in the Structure and Interpretation of Computer Programs.
The key is to understand the word flat.</description>
    </item>
    
    <item>
      <title>Is a College Education Required for a Career in Game Design?</title>
      <link>https://www.lvguowei.me/post/is_college_education_required_for_game/</link>
      <pubDate>Wed, 06 Dec 2017 11:09:15 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/is_college_education_required_for_game/</guid>
      <description>Want to Be a Video Game Designer? You MUST Read This First Wouldn’t it be great to turn your lifelong love of video games into a career? That’s the dream of almost every gamer. Consequently, jobs are incredibly competitive. What qualifications do you need to get a leg up on the competition? Here is some information to get you started.
What Is the Job and Salary Outlook? The average yearly salaries for workers in the video game industry ranged from $49K for quality assurance testers to $107K for executives according to stats from the United States Bureau of Labor Statistics.</description>
    </item>
    
    <item>
      <title>SICP Quote</title>
      <link>https://www.lvguowei.me/post/sicp-quote/</link>
      <pubDate>Fri, 06 Oct 2017 20:05:49 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/sicp-quote/</guid>
      <description>Since I have to take a long bus trip to work everyday, I decided to use the time to read the SICP (Structure and Interpretation of Computer Programs). And blog along the way to mark the progress.
I have read Chapter 1 and watched the video lectures. But I still feel I get planty new things from going through it again. The best part of this book I think is that it spends minimal time and effort in teaching the programming language, the main focus is the thinking and ideas about programming.</description>
    </item>
    
    <item>
      <title>How to write maintainable RecyclerView</title>
      <link>https://www.lvguowei.me/post/maintainable-recyclerview/</link>
      <pubDate>Sun, 17 Sep 2017 18:39:39 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/maintainable-recyclerview/</guid>
      <description>Google is famous for making complicated things. RecyclerView is not an exception. It is more flexible than the previous ListView I understand, but that also means that us developers need to understand more and do more work. I have seen gigantic adapters that have very complicated logic especially when there are multiple types that the RecyclerView is trying to handle. I think I happen to know one way to organize things a bit better so one can easily find what he/she is looking for.</description>
    </item>
    
    <item>
      <title>Use Enumset to Replace Bit Flag</title>
      <link>https://www.lvguowei.me/post/enumset-replace-bit-flag/</link>
      <pubDate>Sun, 10 Sep 2017 19:50:32 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/enumset-replace-bit-flag/</guid>
      <description>I was reorganizing my bookshelf today and found my Thinking in Java lying there so I decided to skim through it. I was quite surprised how much basic stuff in Java I overlooked or forgot. So I decided to re-read the book and write short blog posts of the things that I think are useful but not too many people are talking about nowadays. Here is the first one.
What is bit flag?</description>
    </item>
    
    <item>
      <title>The Ultimate List of Youtube Programming Channels</title>
      <link>https://www.lvguowei.me/post/ultimate-list-of-youtube-programming-channels/</link>
      <pubDate>Sat, 02 Sep 2017 20:20:06 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/ultimate-list-of-youtube-programming-channels/</guid>
      <description>Here are the Youtube channels I subscribe and recommend. They are in no particular order.
Computer History Museum I&amp;rsquo;m an old school programmer and this fits my taste perfectly well. Especially check out the Oral Histories section where they have in-depth interviews with the industry legends from top IT companies.
Confreaks Mainly about Ruby conference videos recordings, even though I don&amp;rsquo;t know Ruby I still find some of their videos extremely helpful.</description>
    </item>
    
    <item>
      <title>The Evolution of Command Pattern (III)</title>
      <link>https://www.lvguowei.me/post/the-evolution-of-command-pattern-3/</link>
      <pubDate>Sat, 02 Sep 2017 11:10:27 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/the-evolution-of-command-pattern-3/</guid>
      <description>In this final part of the Command Pattern series, we will talk about yet another improvement on top of the Command Processor Pattern. It is described in the paper Command Revisited. From now on, we will just refer to it as the Command Revisited Pattern.
The paper is short and sweet but you might not find it to be to the point after the first glimpse.
The most beautiful part of the Command Revisited Pattern is that it provides a new perspective on the general Command Pattern.</description>
    </item>
    
    <item>
      <title>The Evolution of Command Pattern (II)</title>
      <link>https://www.lvguowei.me/post/the-evolution-of-command-pattern-2/</link>
      <pubDate>Sun, 27 Aug 2017 10:41:19 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/the-evolution-of-command-pattern-2/</guid>
      <description>In Part I, we discussed the original Command Pattern from the GoF Design Patterns book. In Part II, let&amp;rsquo;s talk about the improved version from another less known book: Pattern-Oriented Software Architecture Vol.1 (POSA in short).
In this book, there is a Command Processor pattern, which is based on the Command Pattern in GoF book. The most important difference is the newly introduced CommandProcessor.
In the original Command Pattern, it defines how to create Commands, and each Command has an execute and undo methods.</description>
    </item>
    
    <item>
      <title>The Evolution of Command Pattern (I)</title>
      <link>https://www.lvguowei.me/post/the-evolution-of-command-pattern/</link>
      <pubDate>Sat, 26 Aug 2017 09:52:18 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/the-evolution-of-command-pattern/</guid>
      <description>The Command Pattern is one of my favourite design patterns. It is also a good example that design patterns do change over time. In part I, we talk about the original version from the Design Patterns book.
This pattern first appears in the famous GoF book, described as follows: Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.</description>
    </item>
    
    <item>
      <title>Customize Android Seekbar Color</title>
      <link>https://www.lvguowei.me/post/customize-android-seekbar-color/</link>
      <pubDate>Wed, 23 Aug 2017 20:50:44 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/customize-android-seekbar-color/</guid>
      <description>I was tasked to create a simple media player app for a shop demo, and I&amp;rsquo;m using the built-in SeekBar for the volume control. All goes well, until I want to change the color of it. The design has it like the thumb of the SeekBar is white, and first half is green and rest half is grey. It took me almost a whole day to find a satisfying anwser, come on Android!</description>
    </item>
    
    <item>
      <title>My Keyboard Collection</title>
      <link>https://www.lvguowei.me/post/keyboard-collection/</link>
      <pubDate>Mon, 21 Aug 2017 21:10:38 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/keyboard-collection/</guid>
      <description>I have been collecting various keyboard over the years. Now I&amp;rsquo;m quite proud of my small collection, so I think I will share it here.
The One And Only True Keyboard Yes, this is the famous IBM Model M. Typing on it is like playing piano, the sound and feel is so crisp.
The IBM Model M2 I got this from a Finnish second hand website, it is much like a modern keyboard, except that the switches are still the same as original Model M.</description>
    </item>
    
    <item>
      <title>The Most Beautiful Program Ever Written</title>
      <link>https://www.lvguowei.me/post/the-most-beautiful-program-ever-written/</link>
      <pubDate>Thu, 17 Aug 2017 21:42:47 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/the-most-beautiful-program-ever-written/</guid>
      <description>It&amp;rsquo;s my 5th time trying to follow this video and things finally start to click in my head. So I think if I write down what is talked in the video, then I can just read my blog post for another 15 times instead of going through the video, that would be convenient.
OK, here is a gist of it. This guy is writing an Scheme interpreter in Scheme.
Let&amp;rsquo;s start from setting up the environment first so we can type along afterwards.</description>
    </item>
    
    <item>
      <title>Magit Tutorial - Bisect</title>
      <link>https://www.lvguowei.me/post/magit-tutorial-bisect/</link>
      <pubDate>Sat, 12 Aug 2017 08:07:00 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/magit-tutorial-bisect/</guid>
      <description>It&amp;rsquo;s 5 o&amp;rsquo;clock on a sunny Friday afternoon, you are thinking where to have dinner with friends and such. The only thing you have to finish before you can go is to pull your colleage&amp;rsquo;s latest changes and make a demo build to customer. You pull, there are 20 commits all nicely structured, you are now giving yourself a pat on the back for teaching him to use rebase yesterday (by pointing him to these 2 wonderful articles 1 and 2).</description>
    </item>
    
    <item>
      <title>Magit tutorial - Rebase (Part II)</title>
      <link>https://www.lvguowei.me/post/magit-rebase-2/</link>
      <pubDate>Sun, 06 Aug 2017 09:30:26 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/magit-rebase-2/</guid>
      <description>In part I we went through how to use git rebase to modify commit history, things like reword a commit, squash multiple commits, split commit. In this part, we will talk about another common use case of rebase: rebase before merging branches.
Let&amp;rsquo;s first create a new repo and add one file.txt as the first commit.
apple pear peach cat dog snake Now we create a feature branch from master branch.</description>
    </item>
    
    <item>
      <title>Magit tutorial - Rebase (Part I)</title>
      <link>https://www.lvguowei.me/post/magit-rebase/</link>
      <pubDate>Sat, 05 Aug 2017 15:25:20 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/magit-rebase/</guid>
      <description>Magit is arguably the best Git tool out there and also my favorite. It is a package in Emacs, and it is text based. In this tutorial, we will explore how to use it to tackle one of the more elusive topics in Git: Rebase.
In the beginning there was darkness Let&amp;rsquo;s create an empty repository and add one empty file to it.
git init touch file.txt git add . git commit -m &amp;#39;first commit&amp;#39; Rewording commit Now let&amp;rsquo;s add some fruits in the file.</description>
    </item>
    
    <item>
      <title>Tree Vs Iterative Fibbonacci Numbers</title>
      <link>https://www.lvguowei.me/post/tree-vs-iterative-fib/</link>
      <pubDate>Sun, 30 Jul 2017 20:46:36 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/tree-vs-iterative-fib/</guid>
      <description>Being a programmer, you should be very familiar with Fibbonacci numbers. It is often being introduced when teaching recursion.
Tree Recursion Most likely the implementation of a function that calculate fib number is as follows:
(defn fib-tree [n] (cond (= n 0) 0 (= n 1) 1 :else (+ (fib-tree (- n 1)) (fib-tree (- n 2))))) This is just a direct translation from the Fibonacci number definition. Since it is straightforward and easy to understand, most textbooks use it as an typical example for illustrating recursive function.</description>
    </item>
    
    <item>
      <title>How (Not) To Store Password</title>
      <link>https://www.lvguowei.me/post/how-not-to-store-password/</link>
      <pubDate>Fri, 28 Jul 2017 21:07:55 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/how-not-to-store-password/</guid>
      <description>If you are a programmer, especially backend programmer, sooner or later you will face the problem of storing users&amp;rsquo; passwords. Even though at first sight this seems like an entry level problem that we should hand over to an intern, it is really not.
If you ask me how to do it. My first answer would be DON&amp;rsquo;T DO IT! I&amp;rsquo;m serious, try to avoid it as much as you can, just use Google or Facebook signin and your life goes on.</description>
    </item>
    
    <item>
      <title>About Me</title>
      <link>https://www.lvguowei.me/about/</link>
      <pubDate>Tue, 25 Jul 2017 00:00:00 +0000</pubDate>
      
      <guid>https://www.lvguowei.me/about/</guid>
      <description>My name is Guowei Lv. I&amp;rsquo;m a polyglot programmer. I mostly speak Java and Kotlin when I&amp;rsquo;m doing Android development and Clojure and ClojureScript when I&amp;rsquo;m doing web development. I will use C if I have time for making games :D
Programming is hard enough to often make people lose their minds. Calm down and think, be practical and sane.
Feel free to drop me a message about anything!</description>
    </item>
    
    <item>
      <title>All You Need To Know About Android Espresso Testing (Part IV)</title>
      <link>https://www.lvguowei.me/post/all-you-need-to-know-about-android-espresso-testing-4/</link>
      <pubDate>Fri, 21 Jul 2017 18:19:35 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/all-you-need-to-know-about-android-espresso-testing-4/</guid>
      <description>In previous article, we talked about how to scroll to a certain position in RecyclerView in the test. In this article, we further discuss how to write a custom matcher and use it to scroll the RecyclerView.
Let&amp;rsquo;s say that we want to scroll to certain item in RecyclerView, but we don&amp;rsquo;t know the position. We can then create a custom Matcher, and use the matcher to determine which item to scroll to.</description>
    </item>
    
    <item>
      <title>All You Need To Know About Android Espresso Testing (Part III)</title>
      <link>https://www.lvguowei.me/post/all-you-need-to-know-about-android-espresso-testing-3/</link>
      <pubDate>Fri, 21 Jul 2017 16:44:41 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/all-you-need-to-know-about-android-espresso-testing-3/</guid>
      <description>In part II, we wrote a test case to verify that the app can create a task and the task will be seen on the screen. In this part III, we will demonstrate one technique on writing tests that involves a RecyclerView.
First we repeatly add some tasks, and then we verify that the last added task is on display. Note that since we are using a RecyclerView, the last item might not be seen, so we need to scroll the RecyclerView before checking.</description>
    </item>
    
    <item>
      <title>All You Need To Know About Android Espresso Testing (Part II)</title>
      <link>https://www.lvguowei.me/post/all-you-need-to-know-about-android-espresso-testing-2/</link>
      <pubDate>Fri, 21 Jul 2017 11:48:08 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/all-you-need-to-know-about-android-espresso-testing-2/</guid>
      <description>In Part I we talked about how to setup Espresso testing framework, what is the activity testing rule and how to use uiautomatorviewer to help us find id of the view quickly.
In this Part II, we will write some tests against a simple TODO list application. Lets get started.
About the App under test This is a very simple app with basically 2 screens. One to display a list of tasks:</description>
    </item>
    
    <item>
      <title>How To Follow Hand Made Hero On Linux</title>
      <link>https://www.lvguowei.me/post/how-to-follow-hand-made-hero-on-linux/</link>
      <pubDate>Thu, 20 Jul 2017 09:06:31 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/how-to-follow-hand-made-hero-on-linux/</guid>
      <description>If you are a Linux person and you want to follow the awesome Hand Made Hero, here are how I am doing it(on Arch Linux).
Install VirtualBox. Create a Windows virtual machine(at least Win7 + SP1, you can download a ISO image from here), pay attention to the hard drive size, 25G is too small, increase it to like 50G at least. In order to make the full scren mode work, we have to install something called Guest Addition.</description>
    </item>
    
    <item>
      <title>All You Need To Know About Android Espresso Testing (Part I)</title>
      <link>https://www.lvguowei.me/post/all-you-need-to-know-about-android-espresso-testing/</link>
      <pubDate>Thu, 13 Jul 2017 13:03:12 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/all-you-need-to-know-about-android-espresso-testing/</guid>
      <description>The Espresso testing framework really makes it easy to write UI tests for Android. In this first installment, I will go through how to set it up and write our first test case.
Let&amp;rsquo;s get started.
Set up Espresso Add the following dependencies to your gradle build file.
dependencies { // Other dependencies ... androidTestCompile &amp;#39;com.android.support.test.espresso:espresso-core:2.2.2&amp;#39; } Understand the Rules in JUnit Why do they exist? We all know that in JUnit there is a setup method(annotated as @Before) and a teardown method(annotated as @After).</description>
    </item>
    
    <item>
      <title>Android Emulator Problem In Arch Linux</title>
      <link>https://www.lvguowei.me/post/android-emulator-problem-in-arch-linux/</link>
      <pubDate>Wed, 12 Jul 2017 14:13:07 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-emulator-problem-in-arch-linux/</guid>
      <description>I don&amp;rsquo;t remember since when, but now whenever I upgrade Android Studio from pacman, I cannot open my emulator, with some libGL error: unable to load driver: i965_dri.so error.
I tried to follow the solution online but found none of them is working out of the box, because Android Sdk changed some paths. Here is what actualy works now:
cd ANDROID_SDK_PATH/emulator/lib64/libstdc++/ mv libstdc++.so.6 libstdc++.so.6.bak ln -s /usr/lib64/libstdc++.so.6 libstdc++.so.6 </description>
    </item>
    
    <item>
      <title>Rxjava fromCallable() Vs defer()</title>
      <link>https://www.lvguowei.me/post/rxjava-fromcallable-vs-defer/</link>
      <pubDate>Tue, 11 Jul 2017 17:13:32 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/rxjava-fromcallable-vs-defer/</guid>
      <description>In this post we talk about how to use Observable.fromCallable() and Observable.defer() to convert exising functionality into the Rx.
Imagine that you have a UserService class, in it there is a getUserFromDb() function. This function is developed before RxJava and cannot be changed. But somehow you need a function which returns a Observable&amp;lt;User&amp;gt;. What could you do?
The UserService Example public class UserService { /** * Gets User from database, this should not be run in UI thread.</description>
    </item>
    
    <item>
      <title>Android Custom View 101 (Part V)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-101-5/</link>
      <pubDate>Sun, 09 Jul 2017 19:26:15 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-101-5/</guid>
      <description>In this post, we will discuss how to implement a custom view group by extending an existing one, like a FrameLayout.
Let&amp;rsquo;s assume that we are building a layout for displaying user&amp;rsquo;s avatar. The requirement is if a user has an avatar, show the avatar picture, if not, show their initials as text.
So it would be good if we have some kind of AvatarView and Avatar data class (which contains name and avatar picture).</description>
    </item>
    
    <item>
      <title>Android Custom Views 101 (Part IV)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-101-4/</link>
      <pubDate>Sun, 09 Jul 2017 16:41:23 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-101-4/</guid>
      <description>In this installment, we talk about how to implement custom view group.
Custom View VS Custom ViewGroup When we think about a view, it is usually very simple and self contained. View represents, draws and handles interaction for a part of the screen.
Whereas ViewGroup is more about a binding relationship between views. ViewGroup is a specialized View that contains other Views. It has children.
As discussed before, in order for custom view to work correctly, it has to implement two methods: onDraw() and onMeasure(), and there is no need to implement onLayout() cause there is no children to layout.</description>
    </item>
    
    <item>
      <title>Android Custom Views 101 (Part III)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-101-3/</link>
      <pubDate>Sat, 08 Jul 2017 14:47:36 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-101-3/</guid>
      <description>In this post, we finally gonna take a look at how to implement onMeasure() properly.
When implementing a custom view, we should always consider its lower and upper size limit. In this case since the format of the time is fixed (hh:mm:ss). So we just need to get the width and height of it.
Suppose we set the MAX_TIME = &amp;quot;00:00:00&amp;quot;, then to get its width in pixel we can do:</description>
    </item>
    
    <item>
      <title>Android Custom Views 101 (Part II)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-101-2/</link>
      <pubDate>Sat, 08 Jul 2017 09:55:03 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-101-2/</guid>
      <description>In Part I, we talked about how to create a simple custom view. But we don&amp;rsquo;t really implement the onMeasure(). In this post, we will analyze what problems we will have if we omit the onMeasure().
You can think of how the measurements are made as a conversation between the child and parent views.
The child tells its parent how it wants to be laid out by using LayoutParams. This can either be set in xml file or programatically.</description>
    </item>
    
    <item>
      <title>The Pleasure Of Hand Made Programs</title>
      <link>https://www.lvguowei.me/post/the-pleasure-of-hand-made-programs/</link>
      <pubDate>Wed, 05 Jul 2017 21:42:18 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/the-pleasure-of-hand-made-programs/</guid>
      <description>Some time ago I read this article about Why Mit Stopped Teaching SICP. Gerry Sussman said that nowadays people do not often need to build something from scratch again, there exists massive and huge library code for nearly everything. So today&amp;rsquo;s programming work is more like poking around other people&amp;rsquo;s code until it works.
I&amp;rsquo;ve beening doing Android dev for some time now, and I have to say that I sadly agree with him.</description>
    </item>
    
    <item>
      <title>Android Custom Views 101 (Part I)</title>
      <link>https://www.lvguowei.me/post/android-custom-view-101/</link>
      <pubDate>Wed, 05 Jul 2017 15:20:25 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-custom-view-101/</guid>
      <description>Creating your own custom android views can be useful and daunting at the same time. For a long time there is nobody really talks about it in a approachable way, until this lady Huyen Tue Dao. Let&amp;rsquo;s try to follow her approach and create some custom view!
In this part, we will create a very simple timer view that takes up the whole screen and display the current time.
So let&amp;rsquo;s get started.</description>
    </item>
    
    <item>
      <title>Strategy Pattern And Lambda</title>
      <link>https://www.lvguowei.me/post/strategy-pattern-and-lambda/</link>
      <pubDate>Mon, 03 Jul 2017 12:01:35 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/strategy-pattern-and-lambda/</guid>
      <description>While reading Effective Java Item 21: Use function objects to represent strategies, something hit my mind and now I&amp;rsquo;m writing it down.
All these new lambda thing is really what is called the Strategy pattern in the OOP world, or would it be more appropriate to say that the Strategy Pattern in Design patterns is really what lambda is.
The essence of all these, can be boiled down to one simple idea, pass functionalities around.</description>
    </item>
    
    <item>
      <title>Why Synchronize?</title>
      <link>https://www.lvguowei.me/post/why-synchronize/</link>
      <pubDate>Sat, 01 Jul 2017 14:16:31 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/why-synchronize/</guid>
      <description>We are going to write a program, a bit program, lots of stuff happening here and there, ok, big program. Now, lots of threads of course, loads and loads of them, we have to synchronize, yes we do, I think so, yeah, synchronize very important stuff, good idea, but, why?
Remember what we have been taught in school? That mutex thing? Mutual Exclusive? That 2 threads are trying to read and write some mutual value at the same time and create a big mess?</description>
    </item>
    
    <item>
      <title>Why we stopped using dagger</title>
      <link>https://www.lvguowei.me/post/why-remove-dagger/</link>
      <pubDate>Tue, 27 Jun 2017 20:40:41 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/why-remove-dagger/</guid>
      <description>I decided to stop using Dagger2 in our company&amp;rsquo;s android project. Why?
Don&amp;rsquo;t get me wrong, Dagger2 is still great. But though it is great, it is complex. Lots of concepts to wrap our heads around. What is a component, what is a module, what is the difference between subcomponent and dependency component, etc. In order to use it properly, we need to anwser all that questions, even you think you understand it, you still run into suprises now and then.</description>
    </item>
    
    <item>
      <title>Hand Made Hero is AWESOME!</title>
      <link>https://www.lvguowei.me/post/hand-made-hero/</link>
      <pubDate>Sun, 18 Jun 2017 18:02:02 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/hand-made-hero/</guid>
      <description>I purchased the pre-order Hand Made Hero game. I think it&amp;rsquo;s great value for learning, there is this super awesome guy who has tons of experience talking to you at least 1 hour per day for over a year. And it cost only $15. I must have lost my mind if I missed this.
Two interesting observations:
This guy is against OOP This guy prefers C to C++ This kind of &amp;ldquo;against C++ and OOP and all kind of complex nonsense shit&amp;rdquo; thing (this and this) hit me several times and I really like to know about their argument.</description>
    </item>
    
    <item>
      <title>An Android version of the iMessage voice note recorder</title>
      <link>https://www.lvguowei.me/post/imessage-recorder-android-clone/</link>
      <pubDate>Mon, 12 Jun 2017 12:22:15 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/imessage-recorder-android-clone/</guid>
      <description>I created a copy of the voice recorder in the iMessage app for android and made a library out of it. Check it out here!</description>
    </item>
    
    <item>
      <title>Understand Clojure Transducers 1</title>
      <link>https://www.lvguowei.me/post/understand-clojure-transducers/</link>
      <pubDate>Sun, 02 Apr 2017 08:35:01 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/understand-clojure-transducers/</guid>
      <description>In this post, we will define what is a transducer.
First, let&amp;rsquo;s take a closer look at map.
(map inc [1 2 3]) A straightforward way to explain what has happened is this: Increment each item by one in a list.
At first thought, this sounds like one step operation.
Now let&amp;rsquo;s change the requirement a bit. We want to increment each element by one and then sum them together.</description>
    </item>
    
    <item>
      <title>Android Kata View Property Animator</title>
      <link>https://www.lvguowei.me/post/android-kata-view-property-animator/</link>
      <pubDate>Tue, 28 Mar 2017 20:49:08 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/android-kata-view-property-animator/</guid>
      <description>Since I have been doing programming kata, why not adopt the same kata concept in Android programming?
Over the years I have accumulated some useful tools / tricks that I can show in kata form.
The goal is to keep it simple and easy to grasp and to the point.
This is the first one, which shows how to use ViewPropertyAnimator to animate show and hide of the FAB button.</description>
    </item>
    
    <item>
      <title>Mock Objects Demystified</title>
      <link>https://www.lvguowei.me/post/mock-objects-dimistified/</link>
      <pubDate>Mon, 20 Mar 2017 20:27:39 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/mock-objects-dimistified/</guid>
      <description>If you have ever tried writing any non trivial tests, mocks should not be a stranger to you. But what about some other &amp;ldquo;mock&amp;rdquo; like objects like stubs, spies and such? How are they different from each other? In this blog post, I will explain it as simple and easy to remember as possible.
Everything is a test double. Test double is just a general name for all mock like objects.</description>
    </item>
    
    <item>
      <title>Programming Kata Day 13</title>
      <link>https://www.lvguowei.me/post/programming-kata-day-13/</link>
      <pubDate>Mon, 06 Mar 2017 21:02:55 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/programming-kata-day-13/</guid>
      <description>Problem The elevator can be on first floor or second floor The elevator can be either openned or closed. The elevator can go up or down. But when it goes up or down, the door has to be closed. The door can open or close, but it cannot open when it is already openned or close when it is already closed.
Write a function that takes a list of actions with :done indicating the end, and return if this sequence is legal or not.</description>
    </item>
    
    <item>
      <title>Clojure Tail Recursion By Example</title>
      <link>https://www.lvguowei.me/post/clojure-tail-recursion/</link>
      <pubDate>Mon, 27 Feb 2017 20:15:18 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/clojure-tail-recursion/</guid>
      <description>What this recur and tail calls optimization is all about in Clojure? This blog post is trying to give a short yet easy to remember explanation.
Before explaining anything, let&amp;rsquo;s look at how we can implement + using recursion.
This is actually an interesting task, implement our +, since most of the time + is a built-in function. So to make things a bit more clear, let&amp;rsquo;s assume that our computer is drunk and forgets about how to do +, but it still remembers how to increment and decrement by 1.</description>
    </item>
    
    <item>
      <title>programming kata day 12</title>
      <link>https://www.lvguowei.me/post/programming-kata-day-12/</link>
      <pubDate>Sun, 26 Feb 2017 16:38:38 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/programming-kata-day-12/</guid>
      <description>Problem Implement a unit converter that uses the given the following metric
(def metric {:meter 1 :km 1000 :cm 1/100 :mm [1/10 :cm]}) The converter should anwser questions like:
How many meters are there in 10 km and 20 cm?
Solution (defn convert [context descriptor] (reduce (fn [result [mag unit]] (let [val (metric unit)] (if (vector? val) (+ result (* mag (convert context val))) (+ result (* mag val))))) 0 (partition 2 descriptor))) (convert metric [1 :meter]) (convert metric [3 :km 10 :meter]) </description>
    </item>
    
    <item>
      <title>programming kata day 11</title>
      <link>https://www.lvguowei.me/post/programming-kata-day-11/</link>
      <pubDate>Sat, 25 Feb 2017 21:30:56 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/programming-kata-day-11/</guid>
      <description>Problem This coding adventure comes from Advend Of Code Day 2
Solution Github</description>
    </item>
    
    <item>
      <title>Named Arguments In Clojure</title>
      <link>https://www.lvguowei.me/post/named-arguments-in-clojure/</link>
      <pubDate>Fri, 24 Feb 2017 22:24:05 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/named-arguments-in-clojure/</guid>
      <description>Sometimes I miss the named arguments feature in Python, for example:
def slope(p1=(0,0), p2=(1,1)) return (float(p2[1] - p1[1])) / (p2[0] - p1[0]) =&amp;gt; slope((1,2), (4,5)) =&amp;gt; slope(p2=(2, 1)) The equivalent in clojure can be done using destructuring:
(defn slope [&amp;amp; {:keys [p1 p2] :or {p1 [0 0] p2 [1 1]}}] (float (/ (- p2 1) (p1 1)) (- p2 0) (p1 0))) =&amp;gt; (slope :p1 [1 2] :p2 [3 4]) =&amp;gt; (slope :p2 [3 4]) =&amp;gt; (slope) </description>
    </item>
    
    <item>
      <title>programming kata day 10</title>
      <link>https://www.lvguowei.me/post/programming-kata-day-10/</link>
      <pubDate>Thu, 23 Feb 2017 20:36:33 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/programming-kata-day-10/</guid>
      <description>Problem Here is a list of students&amp;rsquo; exam scores. Write a function to sort them based on given criteria. Like Math first, then Physics and then chemistry and then English.
(def exam-scores [{:math 78 :physics 80 :english 97 :chemistry 65} {:math 78 :physics 80 :english 66 :chemistry 65} {:math 78 :physics 54 :english 97 :chemistry 65} {:math 78 :physics 80 :english 97 :chemistry 61} {:math 100 :physics 89 :english 47 :chemistry 85} {:math 98 :physics 80 :english 79 :chemistry 65}]) Solution (defn rank [scores &amp;amp; criteria] (reverse (sort-by (fn [score] (mapv score criteria)) scores))) Note The sort-by in Clojure is very powerful, the idea is to reduce each row into one value that we know how to sort, like numbers, strings or lists.</description>
    </item>
    
    <item>
      <title>Programming Kata Day 9</title>
      <link>https://www.lvguowei.me/post/programming-kata-day-9/</link>
      <pubDate>Mon, 20 Feb 2017 20:05:17 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/programming-kata-day-9/</guid>
      <description>Problem This coding adventure comes from Advend Of Code Day 1
Solution Github</description>
    </item>
    
    <item>
      <title>Programming Kata Day 8</title>
      <link>https://www.lvguowei.me/post/programming-kata-day-8/</link>
      <pubDate>Sat, 18 Feb 2017 13:54:42 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/programming-kata-day-8/</guid>
      <description>Problem Write a function steps, that takes a sequence and makes a deeply nested structure from it:
(steps [1 2 3 4]) ;=&amp;gt; [1 [2 [3 [4 []]]]] Solution 1 (defn steps [s] (if (seq s) [(first s) (steps (rest s))] [])) Solution 2 Lazy version:
(defn lz-steps [s] (lazy-seq (if (seq s) [(first s) (lz-steps (rest s))] []))) Note To see the difference, call the function like this:
(take 1 (steps (range 10000000))) (take 1 (lz-steps (range 10000000))) </description>
    </item>
    
    <item>
      <title>Programming Kata Day 7</title>
      <link>https://www.lvguowei.me/post/programming-kata-day-7/</link>
      <pubDate>Fri, 17 Feb 2017 20:32:20 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/programming-kata-day-7/</guid>
      <description>Problem Suppose a binary tree structure looks like this:
{:val value :L &amp;lt;left-node&amp;gt; :R &amp;lt;right-node&amp;gt;} Write a function to balance insert node into the tree.
Solution (defn insert [tree x] (cond (nil? tree) {:val x :L nil :R nil} (&amp;lt; x (:val tree)) (assoc tree :L (insert (:L tree) x)) :else (assoc tree :R (insert (:R tree) x)))) Note Here is the function to traverse the tree:
(defn traverse [tree] (when tree (concat (traverse (:L tree)) [(:val tree)] (traverse (:R tree))))) Here is a helper function to create a tree.</description>
    </item>
    
    <item>
      <title>Programming Kata Day 6</title>
      <link>https://www.lvguowei.me/post/programming-kata-day-6/</link>
      <pubDate>Wed, 15 Feb 2017 20:16:33 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/programming-kata-day-6/</guid>
      <description>Problem Write a function to determine if a vector contains a set of items.
Solution (defn containsv [v &amp;amp; items] (some (set items) v)) Note Using a set as the predicate supplied to some allows you to check whether any of the truthy values in the set are contained within the given sequence. This is a frequently used Clojure idiom for searching for containment within a sequence.</description>
    </item>
    
    <item>
      <title>programming kata day 5</title>
      <link>https://www.lvguowei.me/post/programming-kata-day-5/</link>
      <pubDate>Mon, 13 Feb 2017 21:34:13 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/programming-kata-day-5/</guid>
      <description>Problem Write a function to determine if a number is a triangular number.
Solutions Solution 1 (defn nth-triangle [n] (apply + (range (inc n)))) (defn is-triangle-number [n] (loop [i 0] (cond (&amp;gt; n (nth-triangle i)) (recur (inc i)) (= n (nth-triangle i)) true :else false))) Solution 2 (defn is-triangle-number [n] (loop [tri 0 i 1] (cond (&amp;gt; n tri) (recur (+ tri i) (inc i)) (= n tri) true :else false))) Note Solution 1 is the first that came to my mind, but it has a typical problem: redundant calculation.</description>
    </item>
    
    <item>
      <title>Perfume Shop Puzzle</title>
      <link>https://www.lvguowei.me/post/perfume-shop-puzzle/</link>
      <pubDate>Sun, 12 Feb 2017 16:06:17 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/perfume-shop-puzzle/</guid>
      <description>Solving hard puzzle programming challenges with logic programming is real fun. I solved one puzzle called &amp;ldquo;Perfume Shop Puzzle&amp;rdquo; by using the core.logic in Clojure. Check it out here: [github] (https://github.com/lvguowei/perfume-shop).</description>
    </item>
    
    <item>
      <title>Programming Kata Day 4</title>
      <link>https://www.lvguowei.me/post/programming-kata-day-4/</link>
      <pubDate>Sun, 12 Feb 2017 11:08:14 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/programming-kata-day-4/</guid>
      <description>Problem Implement take-nth.
Solutions Solution 1 (defn my-take-nth [n col] (loop [i 0 result []] (if (= i (count col)) result (if (= 0 (mod i n)) (recur (inc i) (conj result (nth col i))) (recur (inc i) result))))) solution 2 (defn my-take-nth2 [n col] (-&amp;gt;&amp;gt; col (map-indexed (fn [i x] [i x])) (filter (fn [[i x]] (= 0 (mod i 2)))) (mapv (fn [[i x]] x)))) </description>
    </item>
    
    <item>
      <title>programming kata day 3</title>
      <link>https://www.lvguowei.me/post/programming-kata-day-3/</link>
      <pubDate>Fri, 10 Feb 2017 20:31:01 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/programming-kata-day-3/</guid>
      <description>Problem Trolls are attacking your comment section!
A common way to deal with this situation is to remove all of the vowels from the trolls&amp;rsquo; comments, neutralizing the threat.
Your task is to write a function that takes a string and return a new string with all vowels removed.
For example, the string &amp;ldquo;This website is for losers LOL!&amp;rdquo; would become &amp;ldquo;Ths wbst s fr lsrs LL!&amp;rdquo;.
Solution Solution 1 (defn disemvowel [string] (reduce (fn [result next] (if (#{\A \E \I \O \U \a \e \i \o \u} next) result (str result next))) &amp;#34;&amp;#34; string)) Solution 2 (defn disemvowel [string] (apply str (remove (set &amp;#34;AEIOUaeiou&amp;#34;) string))) </description>
    </item>
    
    <item>
      <title>Programming Kata Day 2</title>
      <link>https://www.lvguowei.me/post/programming-kata-day-2/</link>
      <pubDate>Tue, 07 Feb 2017 19:34:17 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/programming-kata-day-2/</guid>
      <description>Problem: Write a function to calculate fibonacci number in constant space complexity.
(defn fib [n] (loop [a 0 b 1 i n] (if (= 0 i) a (recur b (+ a b) (dec i))))) </description>
    </item>
    
    <item>
      <title>Programming Kata Day 1</title>
      <link>https://www.lvguowei.me/post/programming-kata-day-1/</link>
      <pubDate>Mon, 06 Feb 2017 20:42:29 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/programming-kata-day-1/</guid>
      <description>From today, I will practice one programming kata per day and post the content here.
Here goes the first one:
My friend John likes to go to the cinema. He can choose between system A and system B.
System A : buy a ticket (15 dollars) every time
System B : buy a card (500 dollars) and every time buy a ticket the price of which is 0.90 times the price he paid for the previous one.</description>
    </item>
    
    <item>
      <title>Nested For Loops in Clojure</title>
      <link>https://www.lvguowei.me/post/nested-for-loops-in-clojure/</link>
      <pubDate>Fri, 03 Feb 2017 20:36:18 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/nested-for-loops-in-clojure/</guid>
      <description>One awkwardness I haven&amp;rsquo;t really get rid of when using Clojure is for loops. Especially nested for loops that modifies some global variables. I find some solutions online where people use nested recursion or atoms, but can we just use one level of recursion? Let&amp;rsquo;s try out with a coding kata.
Problem: Given an array of numbers, find the biggest sum of any two numbers. The same item in array cannot be used twice.</description>
    </item>
    
    <item>
      <title>Why component dependency cycle is bad</title>
      <link>https://www.lvguowei.me/post/why-component-dependency-cycle-is-bad/</link>
      <pubDate>Sun, 01 Jan 2017 13:51:26 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/why-component-dependency-cycle-is-bad/</guid>
      <description>I have been working on some Clojure project at work for several months now, one little thing bothers me now and then is that it doesn&amp;rsquo;t allow dependency cycle in project. For example if a.clj requires b.clj, b.clj requires c.clj, then c.clj cannot require a.clj, in other words, c.clj cannot use anything inside a.clj.
At first, I thought this is a bit odd, java doesn&amp;rsquo;t have that. And once in a while we have to solve such problems by creating a new namespace and move the common function into it.</description>
    </item>
    
    <item>
      <title>My Second Android Library</title>
      <link>https://www.lvguowei.me/post/second-android-lib/</link>
      <pubDate>Mon, 26 Dec 2016 10:23:15 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/second-android-lib/</guid>
      <description>I published my second android library project, a date and time picker dialog that mimic the one in Google Map app.
Go check it out here!</description>
    </item>
    
    <item>
      <title>Custom ProgresBar that spins anything</title>
      <link>https://www.lvguowei.me/post/first-android-lib/</link>
      <pubDate>Fri, 23 Dec 2016 12:25:51 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/first-android-lib/</guid>
      <description>I published my first android library for creating customized progressbar.
Basically it spins any image you give it.
Happy spinning!
Github!</description>
    </item>
    
    <item>
      <title>Are Stubs and Mocks Harmful?</title>
      <link>https://www.lvguowei.me/post/stub-and-mock-harmful/</link>
      <pubDate>Sun, 18 Dec 2016 19:53:45 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/stub-and-mock-harmful/</guid>
      <description>I stumbled upon this video, and boy it is so amazing! (if you ignore the annoying audience asking non-stop some annoying questions). This is clearly one of the most inspiring videos I have ever watched. So I must take some notes down and spread the idea as well.
I deeply believe that it is actually easy to make things complicated, on the contrary, it is hard to make things simple and elegant.</description>
    </item>
    
    <item>
      <title>Coffee Maker - An OOD case study</title>
      <link>https://www.lvguowei.me/post/coffee-maker/</link>
      <pubDate>Sun, 18 Dec 2016 09:54:57 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/coffee-maker/</guid>
      <description>One of uncle bob&amp;rsquo;s videos talks about how to design a coffee maker, I think he nailed it.
The problem is to implement a software component that controls a coffee maker.
Requirement The Mark IV Special makes up to 12 cups of coffee at a time. The user places a filter in the filter holder, fills the filter with coffee grounds, and slides the filter holder into its receptacle. The user then pours up to 12 cups of water into the water strainer and presses the Brew button.</description>
    </item>
    
    <item>
      <title>Use Interface Segregation Principle to Implement an Android Logger</title>
      <link>https://www.lvguowei.me/post/interface-segregation-principle-android-logger/</link>
      <pubDate>Thu, 08 Dec 2016 21:34:15 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/interface-segregation-principle-android-logger/</guid>
      <description>Recently at work we has been talking about implementing some kind of Analytic interface for all the analytic libraries we are using, like Localytics and Firebase and so on. Basically it is just a fat interface with a long list of event logging functions, like logSignIn(), logSignOut(), logSellProduct(), logOpenMap() and so on. There are about 40 such methods in that interface. So this is how we implemented it in the first place.</description>
    </item>
    
    <item>
      <title>Expense Report Case Study</title>
      <link>https://www.lvguowei.me/post/expense-report-case-study/</link>
      <pubDate>Tue, 06 Dec 2016 12:16:53 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/expense-report-case-study/</guid>
      <description>One day, I was watching another Uncle Bob&amp;rsquo;s video (yes, they are addictive), when I see one example he gave when talking about open closed principle, it ringed a bell in my head. This looked familiar! The type in some data classes, some switchs or ifs, some &amp;amp;&amp;amp;s and ||s all dancing around in the class. I can almost hear them teasing: &amp;ldquo;Come and catch me! Come and catch me!&amp;rdquo;.</description>
    </item>
    
    <item>
      <title>Moomin</title>
      <link>https://www.lvguowei.me/post/painting-mumin/</link>
      <pubDate>Mon, 05 Dec 2016 18:50:50 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/painting-mumin/</guid>
      <description>Moomin ~</description>
    </item>
    
    <item>
      <title>Xpp</title>
      <link>https://www.lvguowei.me/post/painting-xpp/</link>
      <pubDate>Mon, 05 Dec 2016 18:40:50 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/painting-xpp/</guid>
      <description>My wife ~</description>
    </item>
    
    <item>
      <title>Ayumi Hamasaki Portrait</title>
      <link>https://www.lvguowei.me/post/painting-ayumi/</link>
      <pubDate>Mon, 05 Dec 2016 18:30:50 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/painting-ayumi/</guid>
      <description>Ayumi Hamasaki, painted by Krita ~</description>
    </item>
    
    <item>
      <title>Master Mind in TDD</title>
      <link>https://www.lvguowei.me/post/master-mind-tdd/</link>
      <pubDate>Mon, 21 Nov 2016 21:29:52 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/master-mind-tdd/</guid>
      <description>In one of Uncle Bob&amp;rsquo;s video, he talked about this game called &amp;ldquo;Master Mind&amp;rdquo; when he was teaching Single Responsibility Principle(SRP). After googled the game, turns out that it is actually a quite famous board game. For more information about the game, please look here -&amp;gt; wiki.
The game can be played by two people. One comes up with a code, the other one tries to guess. The one who comes up with the code has to score the guesser&amp;rsquo;s guess based on some rules.</description>
    </item>
    
    <item>
      <title>Payroll Case Study</title>
      <link>https://www.lvguowei.me/post/payroll-case-study/</link>
      <pubDate>Sun, 20 Nov 2016 14:51:39 +0200</pubDate>
      
      <guid>https://www.lvguowei.me/post/payroll-case-study/</guid>
      <description>I was watching some Uncle Bob video some day which talked about how to design the architecture of a system. In that video, he gave a case study of a payroll system, I found the souce code and it is actually implemented in C++, so I ported a Java version.
This is a very good example because it feels more realistic than most dummy demos out there. It also shows how to use POJO classes to layout the foundation without going too much into peripheral details like database.</description>
    </item>
    
    <item>
      <title>Finnish learning diary 10</title>
      <link>https://www.lvguowei.me/post/finnish-learning-diary-10/</link>
      <pubDate>Sun, 16 Oct 2016 14:11:16 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/finnish-learning-diary-10/</guid>
      <description> </description>
    </item>
    
    <item>
      <title>Finnish learning diary 9</title>
      <link>https://www.lvguowei.me/post/finnish-learning-diary-9/</link>
      <pubDate>Sun, 16 Oct 2016 09:34:04 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/finnish-learning-diary-9/</guid>
      <description> </description>
    </item>
    
    <item>
      <title>Replace Nested Conditional With Guard Clauses</title>
      <link>https://www.lvguowei.me/post/replace-nested-conditional-with-guard-clauses/</link>
      <pubDate>Sat, 15 Oct 2016 19:38:57 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/replace-nested-conditional-with-guard-clauses/</guid>
      <description>I couldn&amp;rsquo;t remember who said that one of his favorite refactoring techniques is Replace Nested Conditional with Guard Clauses. When I looked into it, it did put a smile on my face despite its simplicity.
This is NOT about coding aesthetics, this is all about clarity.
A method has conditional behavior that does not make clear the normal path of execution.
Use guard clauses for all the special cases.
double getPayAmount() { double result; if (isDead) { result = deadAmount(); } else if (isSeparated) { result = separatedAmount(); } else if (isRetired) { result = retiredAmount(); } else { result = normalPayment(); } } double getPayAmount() { if (isDead) return deadAmount(); if (isSeparated) return separatedAmount(); if (isRetired) return retiredAmount(); return normalPayment(); } So much better!</description>
    </item>
    
    <item>
      <title>Unidirectional to Bidirectional</title>
      <link>https://www.lvguowei.me/post/unidirectional-to-bidirectional/</link>
      <pubDate>Sat, 15 Oct 2016 09:40:46 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/unidirectional-to-bidirectional/</guid>
      <description>It is very common in relational database that we have the following structure: A customer table has columns: customer-id, name. And an order table has columns: order-id, customer-id, order-date.
See that there is a customer-id in the order table, so that we can use it to get orders belongs to a certain customer. But there is no knowledge about the orders in customer table.
This is fine with database, but if we try to map this directly to java classes, we may end up with something like this:</description>
    </item>
    
    <item>
      <title>Duplicate Observed Data</title>
      <link>https://www.lvguowei.me/post/duplicate-observed-data/</link>
      <pubDate>Sat, 15 Oct 2016 05:35:31 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/duplicate-observed-data/</guid>
      <description>This is from the famous Refactoring book by Martin Fowler. When I was reading it, it feels very similar to the very popular MVP or MVVM.
The key idea is that in system that has user interface, the business logic should be separated from the user interface.
One example I can think of is the registration form, where there are input fields like username, email, phone number and password. We can have some logic that disable the Register button until all fields are filled and the phone number and email valid.</description>
    </item>
    
    <item>
      <title>Choco Musk by Al Rehab</title>
      <link>https://www.lvguowei.me/post/choco-musk-review/</link>
      <pubDate>Sun, 09 Oct 2016 21:23:38 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/choco-musk-review/</guid>
      <description>This is my first perfume oil/attar, I have to say I am quite impressed by it.
I adore oriental culture. I prefer sophiscation over simplicity.
I like dark, dense, rich scent, which shows marks of history. And I am very bored with the western happy and fresh mall scents, yet not satisfied by the so call &amp;ldquo;oriental accord&amp;rdquo; interpreted by western perfumery. So I went online and searched &amp;ldquo;middle east perfume&amp;rdquo;, and what I found truely suprised me.</description>
    </item>
    
    <item>
      <title>Finnish learning diary 8</title>
      <link>https://www.lvguowei.me/post/finnish-learning-diary-8/</link>
      <pubDate>Sun, 09 Oct 2016 20:55:47 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/finnish-learning-diary-8/</guid>
      <description> </description>
    </item>
    
    <item>
      <title>Finnish learning diary 7</title>
      <link>https://www.lvguowei.me/post/finnish-learning-diary-7/</link>
      <pubDate>Sat, 08 Oct 2016 20:10:44 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/finnish-learning-diary-7/</guid>
      <description> </description>
    </item>
    
    <item>
      <title>Finnish learning diary 6</title>
      <link>https://www.lvguowei.me/post/finnish-learning-diary-6/</link>
      <pubDate>Sat, 08 Oct 2016 20:09:44 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/finnish-learning-diary-6/</guid>
      <description>I am into improving my handwriting recently and have been practicing on cursive style quite a bit.
So I think maybe I can combine it with Finnish learning.
Now instead typing I write things down by hand.</description>
    </item>
    
    <item>
      <title>Do you have a good taste of what you are doing?</title>
      <link>https://www.lvguowei.me/post/good-taste/</link>
      <pubDate>Sat, 08 Oct 2016 14:17:40 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/good-taste/</guid>
      <description>There is this stereotype impression about technology industry, that it is a cruel game only for energetic and ambitious young men, when you get old, you will be kicked out mercilessly.
This doesn&amp;rsquo;t bother me so much since I was still young a few years ago, but since now I am getting older it starts to act as a background noise that grabbed me more and more attention.
Is this the truth?</description>
    </item>
    
    <item>
      <title>matrix concentric shift</title>
      <link>https://www.lvguowei.me/post/matrix-concentric-shift/</link>
      <pubDate>Thu, 06 Oct 2016 19:46:09 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/matrix-concentric-shift/</guid>
      <description>I suck at algorithms, even though I have a Machine Learning and Algorithms master degree. It makes me frown everytime in coding interviews. So I decided to practice more often, hope that I can get better at it. At least not afraid of it. Now this is the first one.
Problem Rotate a square matrix clockwise concentrically by 1. For example:
1 2 3 4 5 6 7 8 9 will become</description>
    </item>
    
    <item>
      <title>Percy Jackson Series</title>
      <link>https://www.lvguowei.me/post/percy-jackson/</link>
      <pubDate>Sat, 09 Jul 2016 19:22:34 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/percy-jackson/</guid>
      <description>断断续续的看这个 Percy Jackson 系列已经有很长时间了，第一本和第二本都是在电子书上看完的，最近看到书店在打折，正好有全套在卖，就买了，现在正在看第四本。虽然封面是丑了一点，但是半价的话也就忍了先。 典型的少年读物，情节紧凑，到处都是怪物和神啊什么的，小孩看了应该很激动。不过练习英语还不错，生词量不多。这个是9岁+读物啊。。。</description>
    </item>
    
    <item>
      <title>Time and Space of Recursion</title>
      <link>https://www.lvguowei.me/post/time-and-space-of-recursion/</link>
      <pubDate>Sun, 29 May 2016 21:32:14 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/time-and-space-of-recursion/</guid>
      <description>今天通过一个例子，来谈一谈第归的时间和空间效应。
例子很简单，计算 a 的 n 次方。
我们来对比一下两种第归算法的时间和空间的消耗。
第一个方法很直接。思想就是要计算 a 的 n 次方， 只要计算 a 的 (n - 1) 次方， 然后结果在乘以 a 。如下：
(define (expt a n) (if (= n 0) 1 (* a (expt a (- n 1))))) 为了更直观的理解这个算法，我们来计算一个例子， 2 的 3 次方。
(expt 2 3) (* 2 (expt 2 2)) (* 2 (* 2 (expt 2 1))) (* 2 (* 2 (* 2 (expt 2 0)))) (* 2 (* 2 (* 2 1))) (* 2 (* 2 2)) (* 2 4) 8 我们能能明显看到这个算法的“形状”是一个三角形。每一行代表一次计算，也可以理解成时间的消耗。而每一列则代表计算机需要记住的内容，比如说一共要乘以几个2，也可以理解成空间的消耗。我们可以看到，随着 n 的增大， 这个算法的时间和空间消耗也随之增大。而且增大的速度都是线性的。时间的消耗随着 n 的增大而增大很好理解， n 大了， 计算花的时间也相应长了。但是空间消耗可不可以不增大呢？下面我们就来看另一种算法。</description>
    </item>
    
    <item>
      <title>Simple example of recursion</title>
      <link>https://www.lvguowei.me/post/recursion-example/</link>
      <pubDate>Thu, 05 May 2016 15:33:59 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/recursion-example/</guid>
      <description>今天读到SICP里的一个介绍recursion的例子，用牛顿猜想来计算平方根。
首先，介绍了计算机程序和数学方程的区别。数学方程大多用的是描述法（declarative）。比如说这个平方根，数学上只需要说：
如果x的平方等于y，而且x大于0，那么x就是y的平方根。
这是一种很高层次的描述，通过描述，来限制答案的域。如果能直接用到计算机里，问题就简单了。大概写出来的程序就是这个样子：
func sqrt(x): @ * @ = x; @ &amp;gt; 0; return @; 让计算机去处理计算细节。这当然是一种理想的情况，如果都能这样写程序，那就完事大吉了。这就叫描述性编程(Declarative Programming)。
当然现在还做不到这么绝对，所以我们只能自己写如何进行细节的计算来得到我们的结果。这就叫做命令式变成(Imperative Programming)。
总体来说，描述性编程比命令式编程要容易理解的多，因为不用自己下达命令给计算机，只需要对问题进行描述，计算机自己会找到答案。典型的例子就是xml配置文件，人们把对系统的需求和配置写在一个单独的xml文件里面，然后让计算机自己去执行相应的命令。
好了，现在进入正题。牛顿猜想的原理如下：
要计算x的平方根，先猜想一个答案y，然后用
(y + x / y) / 2
来得到新的优化过猜想。反复进行，知道得到满意的猜想。
首先，我们先来定义一些辅助方程。
(define (abs x) (if (&amp;lt; x 0) (- x) x)) (define (square x) (* x x)) (define (average x y) (/ (+ x y) 2)) 接下来我们来写主程序。
(define (sqrt-iter guess x) (if (good-enough? guess x) guess (sqrt-iter (improve guess x) x))) 这个程序用第归的方法实现了牛顿猜想。</description>
    </item>
    
    <item>
      <title>keep it fun</title>
      <link>https://www.lvguowei.me/post/keep-it-fun/</link>
      <pubDate>Wed, 04 May 2016 20:13:51 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/keep-it-fun/</guid>
      <description>最近因为工作的原因在学clojure，其实我一直都想学一个LISP语言，现在终于有人付钱让我学啦，呵呵。
最早接触到LISP是因为Emacs。当年在研究生时给大学的自然语言研究组帮忙的时候，教授就是Emacs的资深（20年+）用户，我也就开始一点一点的接触了，后来经过一段时间的压迫性的苦练，终于入门了。有一天无意中发现了Emacs Lisp Intro，就开始学习emacs lisp，可惜半途而废了。
因为clojure还比较新，所以没有什么太多资料。我就买了一些关于LISP的经典书籍，比如这个 《Structure and Interpretation of Computer Programs》。但由于本人的拖延症的病情，所以打算从今天开始读第一章了（第二遍尝试）。。。
在开篇有一段引言如下：
``I think that it&amp;rsquo;s extraordinarily important that we in computer science keep fun in computing. When it started out, it was an awful lot of fun. Of course, the paying customers got shafted every now and then, and after a while we began to take their complaints seriously. We began to feel as if we really were responsible for the successful, error-free perfect use of these machines.</description>
    </item>
    
    <item>
      <title>Finnish learning diary 5</title>
      <link>https://www.lvguowei.me/post/finnish-learning-diary-5/</link>
      <pubDate>Sat, 30 Apr 2016 18:21:42 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/finnish-learning-diary-5/</guid>
      <description> Conversation E: Tule jo!
H: Odota vähän, puen vain takin.
E: Jussi, anna tuo kirja.
J: Ole hyvä.
E: Kiitos.
J: Älä unohda huhelinta.
Vocabulary Sample sentences </description>
    </item>
    
    <item>
      <title>Finnish learning diary 4</title>
      <link>https://www.lvguowei.me/post/finnish-learning-diary-4/</link>
      <pubDate>Sat, 30 Apr 2016 18:20:32 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/finnish-learning-diary-4/</guid>
      <description> Conversation E: Mitä sinä harrastat?
H: Soitan kitaraa ja uin. Entä sinä?
E: Minä pelaan sählya. Minä myös luen paljon.
H: Muuten, vieläkö luet tuota kirjaa?
E: En, luin sen jo.
Vocabulary Sample sentances </description>
    </item>
    
    <item>
      <title>Finnish learning diary 3</title>
      <link>https://www.lvguowei.me/post/finnish-learning-diary-3/</link>
      <pubDate>Sat, 30 Apr 2016 18:19:04 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/finnish-learning-diary-3/</guid>
      <description> Conversation H: Millainen sää tänään on?
J: En tiedä. Hetki, katson ennustetta.
H: Tarvitsenko sateenvarjoa?
J: Et tarvitse. Tänään ei sada.
H: Hyvä. En kaipaa sadetta.
Vocabulary Sample sentences </description>
    </item>
    
    <item>
      <title>Finnish learning diary 2</title>
      <link>https://www.lvguowei.me/post/finnish-learning-diary-2/</link>
      <pubDate>Sat, 30 Apr 2016 18:15:04 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/finnish-learning-diary-2/</guid>
      <description> Conversation E: Maiju, tässä on Helen.
M: Hei!
E: Hei! Minä olen australialainen.
M: Oletko vaihto-oppilas?
H: Kyllä. Käyn suomalaista koulua.
M: Onko suomi vaikeaa?
H: Se on kovin erilaista kuin englanti.
Vocabulary Sample sentences </description>
    </item>
    
    <item>
      <title>Finnish learning diary 1</title>
      <link>https://www.lvguowei.me/post/finnish-learning-diary-1/</link>
      <pubDate>Sat, 30 Apr 2016 09:57:12 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/finnish-learning-diary-1/</guid>
      <description>Conversation H: Kuka tämä on?
E: Se on isoäiti. Isoäidin vieressä on isän veli.
H: Kuka tuo on?
E: Se on isän sisko.
H: Entä tuo?
E: Se on Lauri, isän siskon poika.
Vocabulary Sample sentences Vocabulary phrase usage …n vieressä (&amp;ldquo;next to…&amp;rdquo;) isoäiti and other family terms Grammar Genitive cases k-p-t cases -kk, -pp, -tt becomes -k, -p, and -t
-t becomes -d For example:
Jussin muki on astiankuivauskaapissa.</description>
    </item>
    
  </channel>
</rss>
