Day in The Life of a Software Engineer (ep. 35)
- November 5, 2023
- Posted by: MainInstructor
- Category: BASIC Go Software Engineering
Video Title: Day in The Life of a Software Engineer (ep. 35)
Good morning guys it’s Sunday now when I’m recording this so I decided to take it easy and think of some fresh new ideas for months now I’ve been trying to think of a way to implement custom layouts for my window manager project and last night out of the blue I had
This idea that I really want to try out today it’s a bit of an unusual idea and I’m not sure if you guys will like it but anyhow let me show you what I came up with so let’s say this is your screen and you have a window covering some portion of
It and now you want to snap a window right next to it hear me out what if you could drag your blue window anywhere in this area and it would expand to fill the available space wouldn’t that just be amazing for people with OCD like me
Right now I have my coffee ready right here and some people ask me so this is my only coffee for today so recently I I refactored most of the logic in the code to enms with Associated values to implement more robust State Management and I’d say this was a really nice W
Right there but now for this new feature I’m adding the position of all windows on the screen to the state so that I can find a rectangle that FS the space under the mouse one of the most useful tools or patterns for me over the years has
Been The Good Old State machine I mean it’s true that once you give somebody a hammer everything looks like a nail but still Hammer fixes a lot of stuff man oh and speaking of hitting things I swear to God I have this washer and dryer machine at home and it makes a most
Obnoxious noise when it’s been running for a while but kick it from the side and it always fixes the problem like how but okay after I added this apply name function get field space snap area from Mouse the part of video where things go according to plan is officially over
So let’s say you’re trying to drop this blue window over here and let’s say the Red Cross is where your mouse is right now my naive idea was to Simply Ray cast from the mouse position in all four directions until I hit an edge of the screen or another window which can work
But there is this Edge case where if you have another window that is technically in the way but is not directly in line with the mouse it will kind of get ignored but I was willing to live with this Edge case for now because I had a
Feeling solving that one is not going to be the biggest problem of today and I was right so I spent some time feeling with a basic for Loop and keeping track of the four points I was trying to raycast and for the most part it was going swimmingly I did get an occasional
Build there but nothing that could be fixed with a bit of brain overclock in the form of caffeine however even though I drank the overclock juice I was still getting all kinds of weird Behavior so I resorted to the one true way of debugging print statement maybe some
Things just never fail but this is where I started to remember some of the quirks of Apple’s absolutely mad coordinate system for Windows and mouse and screens and everything else they have I really think the people who made this should consider another career but regardless I
Still had some coffee left so let me just quickly explain the level of Madness that’s going on here hear me out first you have the screens which have a coordinate system that starts at the bottom left and goes up and to the right which is fine then you
Have the mouse which I’m going to indicate here like so and the mouse also goes from bottom left and to the right which is also fine but then you have the windows and for whatever reason somebody at Apple decided that the windows are going to be in a whole different
Coordinate system that goes from top left and goes to the right and to the Bottom now this is only the start of the madness when you have multiple screens like so the screens live in a coordinate system that is relative to the bottom left corner of the main screen which is
Fine because the coordinate system goes up and to the right but then the coordinate systems of the windows in those screens are actually relative to the top left corner of the main screen which makes the calculations super confusing for everything but what’s most hilarious is that they did this only for
The Y AIS the x-axis is super simple it goes from left to right in all coordinate systems for Windows for screens for the mouse and everything but for the Y AIS they had to do something crazy and my question is why why stop there like why didn’t you guys make the
Windows go from right to left and maybe make them you know relative to the right edge of the screen while you’re there I wonder if this is still on the backlog for Apple to do maybe they just ran out of Sprints or something but it clearly is kind of like halfway there it’s
Either here or it’s there and you know this is just the madness that I always forget whenever I work on the window manager so I’m making this part of the video to sort of immortalize this knowledge and I can come back to it later and explain it to myself all right
Back to the coding I do have a function that converts these coordinate systems but I still don’t understand why such a complicated treatment for an otherwise perfectly simple concept anyhow I settled on converting everything to one of the coordinate systems and redo all my Ray casting logic so let me quickly
Change the wallpaper to a different color so that the snapping preview is more visible and I can show you what I did and by the way if you want to get this wallpaper pack it’s free on my website and thanks to Squarespace who are sponsoring this video I get to work
On my window manager which is also free rather than spend time centering a div I mean it’s so easy to make changes on the website like update my documentation upload the wallpaper packs make these download buttons it’s a few clicks really for me personally though the killer feature is the analytics which
Can also work without a cookie so I don’t have to put up an ugly consent screen for my European viewers but I still get nice insights and data to look at later check out the link in the description guys if you’re looking to Showcase your projects online
Squarespace makes it super easy with all the templates and nice designs that you can customize plus you can save 10% if you use my link but all right here’s what I got so far when you hold the option key and drag one of the windows they will fill the available space as
Planned but then I discovered this super unusual feature with Mac OS and and that is if you option click on a window that is not focused the other windows that were are automatically hidden and this kind of broke the feature that I was working on but then I saw that the Mac
Itself didn’t really refresh the wallpaper fully and this is where I reminded myself that given what I’m working with here I’m doing pretty okay anyhow I changed alt for command and that solved my problem with disappearing windows and at this point I was getting hungry so I decided to get home real
Quick and continue later fall is really in full swing now and the colors of the city are much different nowadays even in the night the vibe is completely different from just a few weeks ago it’s somehow chilly but also cozy with all the lights I really
Like this time of year I had some obligations in the city so I stayed until dark but I was excited to come back and finish the feature so the last thing I worked on was the edge case with the window that’s not directly in line with the mouse
Position I mean it’s a nice algorithm question to solve so I spent a few moments thinking about it but finally let me show you what I got a typical example use case is when you have a window like xcode that has a minimum size so it’s larger than half the screen
And if you want to squeeze in the documentation window side by side you can do it much more easily now and if you want to open let’s say a terminal window below the documentation it’s super easy to snap it right into place so yeah that pretty much concludes the
Coding Vlog guys um I’m going to be testing this a little more but if you enjoy the episode make sure to like And subscribe and I’ll see you in the next One
Video Keywords: Software Engineering, software engineer,coding,side project,devlog,chill,relaxing,day in the life,vlog
-
Sale!
Wireless WIFI Repeater Extender Amplifier Booster 300Mbps
$29.99$14.99 Add to cartWireless WIFI Repeater Extender Amplifier Booster 300Mbps
Categories: Electronics, Wi-Fi Router, Wireless Wi-Fi Extender Tags: 300Mbps, 802.11N, Amplifier, Booster, Extender, mobile wi-fi booster, Remote, WIFI, Wireless, Wireless WIFI, Wireless WIFI Repeater, Wireless WIFI Repeater Extender, Wireless WIFI Repeater Extender Amplifier, Wireless WIFI Repeater Extender Amplifier Booster, Wireless WIFI Repeater Extender Amplifier Booster 300Mbps$29.99$14.99 -
Sale!
Full RGB Light Design Gaming Headset Headphones with Mic
$24.99$14.99 Add to cartFull RGB Light Design Gaming Headset Headphones with Mic
Categories: Electronics, Gaming, Gaming Headsets Tags: Design, Full, Full RGB Light Design Gaming Headset, Full RGB Light Design Gaming Headset Headphones, Full RGB Light Design Gaming Headset Headphones with Mic, Gamer, Gaming, Gaming Headset Headphones, gaming headset wireless, Headphone, Headphones, Headset, Light, Mic, Package, RGB$24.99$14.99 -
Sale!
Wireless BlueTooth Multi-Device Keyboard Mouse Combo
$39.99$19.99 Add to cartWireless BlueTooth Multi-Device Keyboard Mouse Combo
Categories: Electronics, Gaming, Gaming Keyboards, Keyboard Mouse Combos Tags: Combo, Keyboard, keyboard mouse combos, Mouse, MultiDevice, Set, WireKeyboard Mouse Combo, Wireless, Wireless BlueTooth Keyboard Mouse Combo, Wireless BlueTooth Keyboard Mouse Combos, Wireless BlueTooth Multi-Device Keyboard Mouse Combo, Wireless BlueTooth Multi-Device Keyboard Mouse Combos$39.99$19.99 -
Sale!
High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
$199.99$139.99 Add to cartHigh Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
Categories: Gaming, Gaming Chairs Tags: Adjustable, Chair, computer chairs, Desk, Executive, Gaming, Girl, Headrest, High, High Back Leather Executive Adjustable Swivel Gaming Chair, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar, High Back Leather Executive Adjustable Swivel Gaming Chairs, Leather, Lumbar, Office, Racing, Swivel$199.99$139.99 -
Sale!
Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
$29.99$19.99 Select optionsProfessional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
SKU: N/A Categories: Electronics, Gaming, Gaming Headsets Tags: Cancelling, Gaming, Gaming Headphones with Noise Cancelling Microphone, gaming headset, Headphones, Headset, LED, Light, Mic, Microphone, Noise, Professional, Professional LED Light Wired Gaming Headphones, Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone, Wired, Wired Gaming Headphones, Wired Gaming Headphones with Noise Cancelling Microphone$29.99$19.99 -
Sale!
Gaming Desk with LED Lights USB Power Outlets and Charging Ports
$349.99$249.99 Select optionsGaming Desk with LED Lights USB Power Outlets and Charging Ports
SKU: N/A Categories: Computer Desk, Gaming, Gaming Desk Tags: and Charging Ports, Charging, Desk, Desks, Gaming, gaming desk with led lights, Gaming Desks with LED Lights, Home, LED, Lights, Monitor, Office, Outlets, Port, Power, Room, Stand, USB, USB Power Outlets, White, Workstation$349.99$249.99 -
Sale!
Wired Mixed Backlit Anti-Ghosting Gaming Keyboard
$99.99$79.99 Add to cartWired Mixed Backlit Anti-Ghosting Gaming Keyboard
Categories: Electronics, Gaming, Gaming Keyboards Tags: Antighosting, Backlit, Blue, brown, Gaming, Gaming Keyboard, gaming keyboards, gaming keyboards and mouse, Keyboard, Laptop, Switch, Wired, Wired Mixed Backlit Anti-Ghosting Gaming Keyboard, Wired Mixed Backlit Anti-Ghosting Gaming Keyboards, Wired Mixed Backlit Gaming Keyboard$99.99$79.99 -
Sale!
Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
$119.99$59.99 Add to cartWireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
Categories: Electronics, Gaming, Gaming Headsets Tags: 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, ANC, Audio, Bluetooth, Cancellation, Ear, Earphone, gaming headset, Headphones, Headset, Hi-Res Over the Ear Headphones Headset, HiRes, Noise, Wireless, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Headphones, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headsets$119.99$59.99 -
Sale!
Wired Sports Gaming Headset Earbuds with Microphone
$19.99$9.99 Select optionsWired Sports Gaming Headset Earbuds with Microphone
SKU: N/A Categories: Gaming, Gaming Headsets Tags: Accessories, Earbud, Earphone, Earphones, Gaming, gaming headset with microphone, Headphones, Headset, IOS, Microphone, Sports, Wired, Wired Sports Gaming Headset Earbuds, Wired Sports Gaming Headset Earbuds with Microphone, Wired Sports Headset Earbuds$19.99$9.99 -
Sale!
150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
$49.99$29.99 Add to cart150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
Categories: Charging Stations, Electronics Tags: 150W, 150W Charging Station, 150W Universal Multi USB Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Stations, 150W Universal Multi USB MAX Charging Station, 16 Port MAX Charging Station, 3.5A, Charger, Charging, Fast, laptop charging stations, Max, Multi, Port, Stand, Station, Universal, USB$49.99$29.99
Honestly, Apple has really useful APIs and great documentation on some of their software and then there is stuff like the coordinate system that make me question Apple Engineers` intellect… I spent weeks trying to debug a layout problem when I tried to use ARKit and Computer vision stuff…
Heyy Marko what theme on vs code are you using
What Mac do u use?
Can you make a video about the tools you use as a Software Engineer? (like Xcode, …)
Damn, yet again a banger video from you, love what you are doing with the OneMenu!
A small detail that kinda annoyes me sometimes, is that i can't snap the window onto one side of the screen by simply dragging it to the edge of the screen like on windows 🤔
Combined with the feature you are working on in this video and I would gladly pay it😂
why launch on start not working for my mac 🙏🏻
oslo is such a beautiful city
Hi Marko! What's your animated wallpaper on your left monitor?
What is your GitHub?
i'm 25 and i'm working on shifting careers to software engineering. so many doubts and about-to-give-ups along the way but your videos keep me motivated to keep pushing through. thank you so much & keep it up, i'm rooting for you!
Hey Marko, what app do you use for your diagrams?
Hi Marko,
What is the snippet tool you are using?
When you search in the spotlight search.
Does he still work for kahoot?
awesome, your videos make me feel having more promotion in work. wish you have more videos…..
Just a side note: how good Marko speaks? He has a very good command of the english language and his thought process is also deep. Not boring at all to hear him.
I actually love computer programming but i am a lazy boy i say every day i will start from tomorrow
You're inspire!
Unforunatelly, macos is not comfortable for me than windows, and my mac just laying in the table
Hi Marko, from where can i get the left side moving screen background ? @3:40
Hello, Marko! Im learning C++, and can you recommend me something to watch?