Puran
Today I Learned ArcGIS Earth Photos Reading Search Stats
  • 2024-12-04 TIL

    2024-12-04 TIL: P/Invoke, C# Iterators, Cross-Platform WPF, and ‘Dulce Domum’

    đŸ’»

    P/Invoke

    Ever needed to call native functions from a DLL in your .NET app? P/Invoke (Platform Invoke) bridges the gap between managed and unmanaged code.

    • Managed Code: Runs under the control of the .NET runtime (e.g., C#).
    • Unmanaged Code: Runs outside the .NET runtime (e.g., C/C++ native libraries).

    Key Ingredients for P/Invoke:

    1. DllImport Attribute: Declares the external method and specifies the DLL.
    2. Marshaling: Automatically converts between managed (C#) and unmanaged (native) types.
    3. System.Runtime.InteropServices: Provides tools for defining P/Invoke signatures and managing interop behavior.

    yield

    In C#, the yield keyword simplifies the creation of iterators, enabling methods to return elements of a collection one at a time without the overhead of creating temporary collections or implementing complex iterator logic.

    • Deferred Execution: Using yield return, a method can produce each element only when it’s needed during iteration.
    • State Preservation: The method retains its execution state between yield return calls, allowing it to resume from where it left off in subsequent iterations.

    LINQPad

    The Ultimate Scratchpad for C#

    • LINQPad comes with an integrated tutorial/reference, comprising interactive sample queries.

    Avalonia XPF

    A cross-platform WPF that enables you to reuse your code and extend your app’s reach.

    • Avalonia XPF enables WPF apps to run on macOS and Linux with Avalonia’s Fork of WPF, which allows Avalonia to maintain both API and binary compatibility with WPF. Avalonia XPF replaces the low-level WPF code (MilCore) with Avalonia.
    • Avalonia XPF is based on WPF shipped with .NET 6.0 SDK. Currently, unsupported WPF features include Visual3D, Viewport3D, InkCanvas, Win32 interop, and custom Window chromes.

    đŸŒ±

    è¶ż

    tā, walk in slippers.

    • è¶żæ‹‰ïŒšæŠŠéž‹ćŽćžźèž©ćœšè„šćŽè·Ÿäž‹
    • è¶żæ‹‰æżć„żïŒšwooden slippers

    Dulce Domum

    Dulce Domum (lit. Sweetly Homeward) is a tune composed by Robert Ambrose in 1876. This phrase is used as the title of chapter 5 of the 1908 novel The Wind in the Willows.

    • lit. is an abbreviation for “literal” or “literally”.
    → 11:58 PM, Dec 4
    Also on Bluesky
  • 2024-12-04

    This morning, Hamer woke up before the alarm, got ready on her own, and we admired a beautiful sunrise as we headed to school. On my way back, I stopped to buy a fried dough stick for my mother-in-law, and we enjoyed a long breakfast, talking about family and her past.

    I spent the day fixing bugs and learning about P/Invoke, yield, and LINQPad. Xiaoyan shared a photo of her birthday noodles, which inspired me to cook her something similar.

    In the evening, Hamer helped serve dinner from Hema, and we stayed within budget. Later, we enjoyed watching baseball highlights of Chinese Taipei’s games in the 2024 WBSC Premier 12 baseball tournament.

    Xiaoyan's birthday seafood noodles—a dish that was both lavish and beautiful
    → 11:02 PM, Dec 4
    Also on Bluesky
  • 2024-12-03 TIL

    2024-12-03 TIL: NMEA Insights, SQL Tips, and Whimsical Observations: From Pac-Man to The Wind in the Willows

    đŸ’»

    NMEA Sentences

    • Four Common Types: $GPGGA, $GPRMC, $GPGSA, and $GPGSV.
      • $GPGGA and $GPRMC contain location and time-related data.
      • $GPGSA and $GPGSV provide satellite-related information.
    • Examples:
      • $GPRMC,194000.000,A,3401.8431,N,11711.4761,W,24.43,145.27,061020,,,D*4F
      • $GPGGA,194000.000,3401.8431,N,11711.4761,W,2,10,1.0,478.9,M,-32.5,M,2.0,0000*4D
    • Time and Date Formats:
      • $GPGGA: Time in HHMMSS.SSS format.
      • $GPRMC: Time (HHMMSS.SSS) + Date (DDMMYY), e.g., 194000.000 (UTC 19:40:00.000) and 061020 (6th October 2020).
    • Checksum: Ensures data integrity. Calculated by XOR-ing all characters between $ and *. Example: 4D.

    SQL for ArcGIS

    • Use TIMESTAMP with the format: yyyy-mm-dd hh24:mi:ss (24-hour clock, no AM/PM).

    đŸŒ±

    Figure Skating

    • A type of skating that involves circular patterns and often includes jumps.
    • /ˈfÉȘÉĄ.jɚ/

    Incisor

    • One of the sharp teeth at the front of the mouth that cut food when you bite into it. (ćˆ‡ç‰™ă€é—šéœż)
    • /ÉȘnˈsaÉȘ.zɚ/

    Pac-Man

    • Pac-Man, a classic arcade game by Namco. Named “éŁŸéŹŒ” in Hong Kong, “氏çČŸç”” in Taiwan, “ćƒè±†äșș” in Mianland China.
    • Ghost Characters: Blinky (red), Pinky (pink), Inky (light blue), Clyde (orange).

    XJBC (ć€ć­Łć…«ć†Č)

    • A humorous “coffee brewing technique” requiring:
      • No bean selection, no sifting, no stickers, no blooming, no temperature control, no timing, no circular stirring, no cup warming.

    Reading Notes from The Wind in the Willows

    1. On Laziness:
      • Finding joy in being the only idle one among busy citizens.
      • The essence of a good holiday is not resting but watching others work.
    2. On Fear:
      • A terrifying entity feared by all the small animals in the fields and hedges—the “horror of the Wild Wood.”

    Musical Skiers

    • Icelandic photographer Haukur Sigurdsson captured this aerial image of Nordic skiers looking like musical notes on a staff.
    → 11:39 PM, Dec 3
    Also on Bluesky
  • puran's post

    Message image
    Oh, by the way, Hamer lost her third tooth today—the upper right lateral incisor. It fell out during her PE class at school.
    → 10:14 PM, Dec 3
    Also on Bluesky
  • 2024-12-03

    This morning, Hamer woke up on her own, surprising me as she called from the bathroom. I admired her for waking up early three days in a row. The sunrise on our way to school was beautiful, and I felt grateful not to have to nag her to get ready.

    Xiaoyan left for a business trip. I rushed to a meeting, then spent the day fixing bugs, including a tricky NMEA data issue.

    In the evening, I enjoyed playing badminton with colleagues. Later, my mother-in-law visited, and we had a meaningful chat about health and family.

    the morning sun painted the blue sky with shades of red, and a plane passed by high above the tall chimneys
    → 9:47 PM, Dec 3
    Also on Bluesky
  • 2024-12-02 TIL

    2024-12-02 TIL: Flock, Location Properties, and Language Nuances

    đŸ’»

    • The PointsCount is distinct from Count in a Part.
    • Location has an AdditionalSourceProperties property, useful for storing extra attributes for a location, such as customized node types like start node, end node, and vertex.
    • Flock: Flutter by the community, for the community. Flock is Flutter+.

    đŸŒ±

    • 珩 (hĂ©ng) is the top gem of the pendants.
    • The phrase ‘handled it’ could be pronounced as /ˈhan·dldÉȘt/.
    • The phrase ‘the exhibit instead’ should be pronounced as /ði ÉȘɥˈzÉȘbÉȘt ÉȘnˈstɛd/.
    → 11:28 PM, Dec 2
    Also on Bluesky
  • 2024-12-02

    Last night, strong winds made it colder this morning. Hamer woke up early, got ready, and arrived at school by 7:25. After dropping her off, I stopped by the supermarket for fruit and corn.

    At home, I made breakfast and then practiced English. I spent the morning working on a playback issue and discussed the solution with my colleagues. In the afternoon, I fixed the issue. In the evening, Hamer and I watched baseball and figure skating.

    During lunch, I reflected on how I could be kinder to my mother-in-law and reduce Hamer’s material possessions to help her develop independence.

    I am wearing my newly bought helmet on my way home.
    → 9:23 PM, Dec 2
    Also on Bluesky
  • 2024-12-01

    I didn’t realize it’s already December before writing this journal—time has flown by.

    Hamer woke up early wanting to exercise, but I was too tired, having not slept well. She watched her iPad until I got up around nine, and we decided to go play basketball. We planned for only thirty minutes since we needed to catch a special effects movie at the Science Center. However, we stayed longer, and things got rushed. At home, I reminded Hamer repeatedly that we were late, but she was slow getting ready, and I ended up being stern. We weren’t in the best mood as we left, but talked it out on the way.

    We missed the movie but accepted it calmly. Hamer enjoyed learning about the scientists' names and their birthdates. Afterward, we explored the main exhibit, which was interesting, and ate McDonald’s outside under the sun, like a picnic. Hamer was thrilled with her burger, fries, and Sprite.

    In the afternoon, Hamer played at the children’s area while I napped. Afterward, we strolled around and caught a stunning sunset, with half the sky in dark hues and the other side glowing red. Back home, we cooked noodles, and Hamer put on a face mask, curious why kids have them.

    A child peeks out from red curtains in a retro-themed photo booth set with old-fashioned items and decorations.
    → 9:22 PM, Dec 1
    Also on Bluesky
  • 2024-11-04

    On Monday morning, Hamer climbed into our bed early to keep sleeping. Both she and Xiaoyan were too tired to get up since yesterday had been exhausting. It was pretty cold when we left home, and Hamer mentioned that she’d wear her fleece-lined school uniform from now on.

    While waiting at home before work, I happened to hear a song by The Carpenters. Xiaoyan said to me, “I taught you how to sing this song, remember?” She asked if I could still recall it. I replied, “Of course I do—it was at the track.” Xiaoyan was really surprised, thinking I wouldn’t remember that detail, and she was delighted. She taught me this song line by line when we were still in school, during one of our first walks on the track after we started dating.

    I got to work a bit late today, and after a morning meeting, I didn’t get much done until the afternoon when I finally made some progress.

    Later, during a chat with Hamer, she said the happiest part of her day was going to school. That was a big surprise but also made me really happy. School used to be something she dreaded and avoided. I asked her what made her most nervous, and her answer was also school—she still feels tense in class, but it seems she’s getting used to it.

    Xiaoyan is kissing Hamer while she is doing her homework
    → 9:12 PM, Dec 1
    Also on Bluesky
  • 2024-11-07

    Today was Sprint day, and in the morning, the team reviewed the list of issues needing resolution—most of which came from the external testing team. Though the list was quite long, it felt manageable. My main focus was on handling the mutual exclusivity between G and other functionalities.

    As the workday was ending, I started tackling a S123 issue. While discussing with the PE, I realized that a logic error had been made. By 11 p.m., I thought I was close to untangling the issue, but the more I looked into it, the more complex it became. I knew I wouldn’t be able to solve it tonight. I let my colleague go home and decided to stay back and continue working on it until around 1:30 a.m., trying to get as far as I could before calling it a day.

    → 8:59 PM, Dec 1
    Also on Bluesky
  • 2024-11-08

    I got home after 10 p.m. tonight, feeling quite satisfied. Most of the G features are complete, and the device connection issues, which had worried me, were mostly resolved thanks to a colleague’s help.

    Throughout the morning, my biggest headache was the S123 reading and editing permissions issue. I kept experimenting with my idea of using the REST API to check edit permissions. By 10:30 a.m., I finally got the update and delete logic working, and took a break to relax. Later, I ran into another issue when editing geometry. Adding different layers created permission management problems, which made me anxious. I discussed it with the S123 team and kept thinking about it through lunch. By the afternoon, I managed to solve it, then quickly moved on to address the UI problems I had missed earlier, and finished off the G recording and data display. Without noticing, it was already night, and I worked until 10 p.m.

    When I got home, Xiaoyan and Hamer were finishing a dance workout. Around 11 p.m., they went to get ready for bed, while I scrolled my phone aimlessly until I finally went to sleep at 1 a.m.

    coworkers are discussing the G features
    → 8:52 PM, Dec 1
    Also on Bluesky
  • 2024-11-09

    This morning, I looked for places near home where we could exercise and found some community centers and soccer fields. We got up late and rode to brunch, enjoying bagels, pasta, and fries. During brunch, I saw an open tennis court for the evening and booked it. Afterward, we picked up a tennis racket for Hamer, and she went to her dance class.

    While she danced, I explored a nearby community center. The basement gym felt eerie, but once I got familiar with the place, it was better. I ended up in the library and read Scarcity Brain until it was time to get Hamer, who was eager to check out the gym.

    Afterward, Hamer did some homework, knowing we planned to hike tomorrow and play tennis later. We struggled a bit with tennis, using an automatic launcher, but Hamer enjoyed using cones to catch the balls. Compared to badminton, tennis felt more challenging, and I considered getting a coach eventually.

    After tennis, we went out for dinner, and when we got home, Hamer finished more homework. She then did a dance workout with Xiaoyan while I, exhausted, went to bed early.

    Hamer's first time playing tennis at the court, with an automatic ball launcher.
    → 8:34 PM, Dec 1
    Also on Bluesky
  • 2024-11-14

    Last night, I dreamt about Mr. Zheng. He invited me to join him for dinner.

    This morning, as we were heading out, Hamer asked, “Are we late?” It was already 7:45, and she was worried about being scolded by her teacher. She also asked about not eating lunch at school anymore. At the gate, she started crying, saying she didn’t want to arrive that late again.

    At lunch, I went out for some testing, taking a walk around the office building. I found several issues and potential improvements. In the afternoon, I revised my work and did more testing on the way home, uncovering even more problems. Testing always seems to reveal something new.

    on field testing with PC
    → 8:28 PM, Dec 1
    Also on Bluesky
  • 2024-11-15

    I woke up around 5 a.m., eager to solve the device connection monitoring issue. After searching, I found a useful reference in an old sample, which got me excited to try it out. This issue had been on my mind since my testing yesterday showed I couldn’t properly handle device connections, making the G feature frustrating.

    Once at work, instead of diving into the issue, I focused on drafting my 1-on-1 notes for an afternoon meeting with my boss. I ended up writing too much detail, even though I knew it would have been better to just list key points. This slowed me down and kept me locked into a rigid structure. The meeting didn’t go well—I felt like my explanations fell flat. Luckily, my boss was patient and provided feedback, mainly on AI, people, overtime, and leadership.

    Afterward, I returned to device management but kept running into issues. Debugging became impossible as the app wouldn’t start, citing a .NET version problem. Despite troubleshooting until the end of the day, I couldn’t solve it. Later, I picked up Hamer, met Xiaoyan at the mall, and treated ourselves to a nice dinner out.

    After our meal, Hamer is playing at the playground, a hill
    → 8:17 PM, Dec 1
    Also on Bluesky
  • 2024-11-16

    This morning, I took Hamer to try out our new tennis rebound trainer. We changed plans to go to a spacious park near her old kindergarten instead. After warming up with badminton, we started practicing tennis, but the rebound ball was too heavy for her. Switching to a softer ball, Hamer struggled at first to dribble or bounce it. So we decided to use our hands and worked on getting comfortable with the ball and racket, eventually managing to make it fun. By the end, Hamer could bounce the ball five or six times!

    On the way back, we ran into Xiaoyan, who was heading out for a facial. Hamer couldn’t decide whether to join her, even as we got home, which made me impatient. She ended up crying, and we called Xiaoyan to pick her up.

    Back at home, I got engrossed in the Korean drama “18 Again,” watching until they returned for lunch. In the afternoon, I took Hamer to her dance class, where she handled everything herself—changing clothes and packing up afterward. Later, Xiaoyan and Hamer went out for dinner with a coworker leaving Beijing, while I stayed home, watching the Korean drama.

    Hamer hanging on like a sloth
    → 8:11 PM, Dec 1
    Also on Bluesky
  • 2024-11-17

    Our family finally went on a hike today, choosing Baiwang Mountain over the Fragrant Hills, where Hamer and me had gone the previous week. We left around 9 a.m., taking the subway. The hike began with a quick ascent to the top before noon, leaving me initially disappointed by the lack of challenge. However, the day grew more interesting as we descended the northern slope.

    There were lots of fun moments: Hamer and Xiaoyan held hands down long stairs, the three of us ran around like kids in an open field, and Hamer attempted a steep slope but got scared midway. We also visited a small pond where Xiaoyan reluctantly fed fish with dropped bread and explored a canyon full of gravel. We even stumbled across a group filming a cheesy but amusing skit.

    After the hike, we ate a meal, where I surprisingly ended up eating the most despite snacking all day. Exhausted, we took a cab home, and everyone dozed off. Hamer completed her homework and went to bed, while I lounged on the couch, watching “18 Again” until I fell asleep, eventually deciding to stay there for the night.

    I took a selfie for our family on the top of Baiwang mountain
    → 8:04 PM, Dec 1
    Also on Bluesky
  • Sunset in Beijing.

    → 6:48 PM, Dec 1
    Also on Bluesky
  • 2024-11-30

    Today started early with Hamer waking up and making a simple but satisfying breakfast for us. After breakfast, we exercised together, running and playing agility games until noon. On our way back, we bought ingredients for noodles, and Hamer proudly cooked her own lunch, enjoying every bite.

    In the afternoon, Hamer resisted going to her dance class. After some persuasion—both gentle and stern—she reluctantly agreed. After her class, Xiaoyan picked her up, and we went to the mall as promised. There was a small argument over where to eat, but eventually, we settled on an American restaurant. The relaxed atmosphere, a good meal, and arcade games helped everyone recover their good spirits. Hamer declared, “Today was such a happy day!” which made all the small struggles worth it.

    By evening, Hamer was exhausted, falling asleep in the scooter on the way home. I, too, felt tired, but as I recalled the day’s small yet warm moments, a sense of contentment filled me.

     Home-cooked is the best!
    → 11:02 PM, Nov 30
    Also on Bluesky
  • puran's post

    Message image
    When foreigners sing Chinese songs, it often feels like they’re singing in English.
    → 6:50 PM, Nov 30
    Also on Bluesky
  • 2024-11-29

    This morning, Hamer woke up early, climbed into my bed, and asked if she could start getting ready. I encouraged her to decide, and she got ready efficiently, finishing by 7:20. We enjoyed a beautiful sunrise on our way to school, arriving at 7:25, likely the earliest.

    After dropping her off, I practiced English, focusing on connected speech. During my commute, I listened to Circle Around’s A World of Music podcast, which lifted my mood, and I even joined in making sounds along with the music.

    Work was focused on the G feature playback. In the morning, I worked on reflecting recorded data accurately, and in the afternoon, tackled pause issues. We devised two solutions, including a simplified version of my initial idea, but by 9 PM, I still had unresolved issues and decided to continue next week.

    At home, Hamer was calm and relaxed. She had experimented with flour and makeup, washed dishes, and used the gas stove. We trimmed her nails, shared a snack, and read until she fell asleep.

    Xiaoyan has had early flights for three days in a row and will be back tomorrow. I hope she can rest well.

    the morning sky was painted with a beautiful sunrise
    → 11:52 PM, Nov 29
    Also on Bluesky
  • 2024-11-28

    Xiaoyan woke up early, and I went back to sleep, not getting up until Siri reminded me at 7 AM. Xiaoyan had already left by then.

    Hamer woke up later, worried about being late for school, but after a quick time check, she felt reassured and we arrived at 7:39.

    After dropping Hamer off, I read a chapter of Positive Discipline and practiced English. Over breakfast, I listened to All Songs Considered’s Thanksgiving special, which set a warm mood all the way to work.

    At home, I treated myself to a chicken leg as a Thanksgiving treat. Hamer had already eaten out with Grandma, so I made instant noodles and helped her with her homework.

    I spent the day optimizing the G feature, addressing small issues with icons, crashes, and unit tests. A colleague and I resolved a serious playback issue and agreed to fix it before the final RC.

    During lunch, I did a five-part workout: dumbbell incline press, incline curls, RFESS, pull-ups, and crunches with leg raises. I felt exhausted but refreshed afterward, ready for the afternoon.

    With my coffee cup in hand, I headed into the gym and tackled a five-part workout.
    → 10:31 PM, Nov 28
    Also on Bluesky
  • 2024-11-27

    In the morning, Hamer got ready mostly on her own, and we arrived at school before the gates opened. Her independence filled me with pride.

    After breakfast, I resumed my English practice. On the way to work, I listened to two podcasts: one on parents' emotions affecting kids, and another about a girl practicing violin, reminding me of Xiaoyan’s wish to learn it.

    At work, I addressed issues with the G feature, adding a DispatcherTimer for smoother transitions and adjusting path recording. The results were good, but my time management needs work.

    I got home late, and Hamer called about our shopping plans. She and Grandma argued about her riding her bike. I encouraged her to work it out, but she wanted me to help. When she saw Xiaoyan, she burst into tears, but was soon comforted.

    On the way to Hema, Hamer was upset about not riding her bike, but Xiaoyan suggested a shared bike, which cheered her up. We took turns holding it steady as she pedaled.

    At Hema, we stuck to our shopping rules: no chips and staying under 150 yuan. We ended up at 151 yuan, a small “splurge”, and went home happy.

    Xiaoyan steadied the bike to help Hamer concentrated on pedaling
    → 10:09 PM, Nov 27
    Also on Bluesky
  • 2024-11-26

    Beijing has been freezing lately. Riding my scooter felt like the wind was slashing at my face. After badminton, the cold cut straight to the bone. I considered buying a helmet but couldn’t decide between a scooter helmet or a motorcycle one, so I chose to sleep on it. That night, the first snow of the season quietly fell over Beijing.

    Work focused on code review and addressing feedback. The PM flagged some serious issues with a detailed video showing real-world scenarios. I spent the day reproducing and resolving the problems. Although time-consuming, the process was rewarding.

    In the morning, Xiaoyan took Hamer to school—we’ve been alternating this task these two weeks. After getting up, I made breakfast, tidied up, and read a few pages of a book. Xiaoyan teased me, “Pretending to be literary?” We laughed as she did her makeup. When she heard a Korean song playing, she said, “We should visit Korea since you’re so into K-culture!” Later, she noticed Hamer’s dirty socks still lying on the mat. I had picked them up earlier but absent-mindedly put them back down. She stared at them, wide-eyed, then burst into laughter, saying, “So it’s true—when people are speechless, they really do laugh!”

    At noon, I read Positive Discipline and reflected on its sections about “natural consequences” and “logical consequences.” It explained the value of letting children experience the outcomes of their actions or collaboratively developing solutions instead of using punishment. This gave me new insight into how I could guide Hamer more effectively. I had planned to read this section with her, but we both ended up busy.

    the first snow of winter quietly began to fall over Beijing
    → 11:07 PM, Nov 26
    Also on Bluesky
  • puran's post

    Message image
    It’s been extremely cold in Beijing these past two days.
    → 9:07 AM, Nov 26
    Also on Bluesky
  • 2024-11-25

    This morning, Hamer snuggled into bed, and I enjoyed the peaceful warmth. After dropping her off, I felt calm, a feeling that lingered from finishing my journal last night.

    Reflecting on how to guide Hamer, I picked up Positive Discipline. Xiaoyan and I had discussed her unkind behavior toward friends. I considered punishment but felt uneasy, so I decided on a positive conversation instead.

    That evening, we talked. I shared my thoughts, and she listened. We agreed on key ideas: respect others, take space when needed, and repair relationships with actions like a note or hug. Afterwards, Hamer eagerly wrote an apology letter, decorated it, and seemed at ease.

    Work was light today. I addressed feedback on the G feature and summarized key points on System.IO.Pipelines. Xiaoyan took the day off and picked up Hamer. I also decided to keep my journal concise for privacy and sustainability.

    Xiaoyan guided Hamer on how to use a needle to stitch her namecloth onto her dancing bouncing belt.
    → 10:34 PM, Nov 25
    Also on Bluesky
← Newer Posts Page 14 of 37 Older Posts →
  • RSS
  • JSON Feed
  • Lucky
  • Archive
  • About