Frederik Handberg's avatar
Frederik Handberg
npub1nj0c...2gqz
23 🇩🇰 Studying for a degree in Software Engineering while building fun projects and working freelance as a News Photographer 📷 I share my software projects, photos and videos from my work as a news photographer, and progress updates as I learn to sew garments. Basically, I just write about my hobbies. frederikhandberg.com
I want to get better at being bored. A lot of people have this thing where the second they feel bored, they grab their phone and scroll through social media. I’m definitely guilty of this too, and I really want to stop with this habit. It’s okay to be bored and it’s probably healthy as well, especially in terms of having a good attention span. Luckily, my attention span is not bad. I don’t have an issue with being focused for hours, but I do think my attention span could still be improved. Also, boredom seems to really improve creativity. I guess it’s because when we are bored, our mind gets a chance to just drift away and think without constant noise.
Haven’t had WIFI these past few days, so had to rely on mobile data. It’s so slow and unreliable compared to WIFI. Also, I dont live in a city, so that only makes it worse…
Saw a baby seal on our walk today. Never seen one of those before 😀
Elderly man dies in drowning accident in his own garden. #press
There’s some kind of rescue operation going on in the forest. I’m just not sure where they are… #press
Legend cars are cool and cute at the same time. I always wanted to try one. #racing image
Trying to implement WebSocket in Spring Boot. Only time I’ve used WebSocket before, was in a SignalR server. Going to use it for a chat app I am working on. It’s just a portfolio project that I’m doing to learn. The Spring Boot project includes REST endpoints to fetch the chat history between two users, but of course, I want real-time communication as well. Users should be able to receive messages immediately without having to refresh the page. For this, I will be using WebSocket. I finally got the connection working. Now users can send messages to each other and receive in real-time, but I’m having some trouble with including all the necessary information in the STOMP, such as who sent the message. So right now, it just shows ‘unknown’ as the sender… #dev #WebSocket
Found this little fella on my walk with the dog. It’s breathing. Hopefully the family is nearby 🙏 I’m gonna go check later today, if it’s still there. #animal #nature image
I’ve finally implemented a long awaited feature on my personal website’s blog page. Now, I am able to embed quoted notes in my Nostr notes, that I show on my blog page in a timeline. I think it looks pretty nice. But after implementing this new feature, I am experiencing glitches with images embedded in notes. The images are disappearing and showing again instantly. This happens multiple times. The glitches seem to stop when all notes are loaded. But it does not happen for all images. Only some images are glitching and it seems to be completely random when I reload the page. Pretty annoying… #dev #NextJS image
**Switching to Observation framework worked** I’m surprised to say it, but converting my code from using ObservableObject to the newer Observation framework that Apple released fixed the problem I had with the view rerendering. I did read that the Observation framework had improvements made to rerendering, as it will only rerender the views that actually need to be rerendered, but I didn’t know it would work just immediately without making any significant changes to the codebase. So now, the rotation animation for the chevron is working and it looks great. It would be nice to have an animation where the contents of a folder will slide down when expanding the folder. And likewise, when collapsing a folder, the contents should slide up. #dev #swift View quoted note →
Fire in mini excavator at large solar project in Juelsminde. #press
**SwiftUI rerendering issue** I thought that my implementation of the ‘Files’ view in the sidebar of my Swift app was pretty solid. It does work, but it is rerendering the view each time I collapse and expand folders. This means, I cannot add an animation for the chevron when it rotates. Even though it’s a small detail, I still find it pretty annoying. Looking into how can implement the functionality in a way where Swift does not rerender the view like it’s doing now. I will try to use the Observation framework instead of ObservableObject. Let's see if that gives me a better result. #dev #Swift #macOS
The collapsing and uncollapsing folder functionality is now working. Next, I should implement the functionality to create new notes and folders. Also, I should work on figuring out how I can add functionality to drag-and-drop files and folders, allowing users to relocate content to other directories. #dev #swift
**Code backend before coding frontend** When I start working on a new app idea I have, I always begin by designing the UI in Figma. It’s a good way for me to brainstorm things like which features the app should include and get an idea of how I want the UI to look. After the brainstorming and getting a rough idea of the UI, I start building the frontend. This is the part that I really want to change when I start a new software project. I have this tendency to immediately begin working on the frontend. I think it’s because it comes easily to me. You know, to design and build a pretty UI. But I think it would be beneficial to change, so that instead of starting with the frontend, I should begin with the backend once the brainstorming is done. That way, I can quickly find out which features are tough to implement. That’s valuable information, because there’s no reason to build the UI for a feature that turns out to be too time-consuming to implement. This is something I experienced when I was working on a macOS app that was supposed to control volume per application (exactly like how the Windows volume-mixer works). I had designed and built the UI, and personally, I think it was looking really good. But when it came time to actually implement the features, things started going downhill. Turns out, that the necessary APIs are closed source, and getting it to work required a lot of low-level C++ code. I barely have any experience with C outside of the 'Embedded Software' course I am doing this semester, so it was way out of my league.
I think I have screwed up with my state management in my Swift notes app. I can’t get a view to update immediately. Every time a change happens, the user must go back and forth between views before the change is reflected in the UI. Done some research, and it seems like my problem is a classic Swift problem known as “the nested Observable Objects issue”. #swift #dev