Wednesday, March 23, 2022

about:flags

This is a quick "how-to" on forced dark mode and how to enable it in the Edge browser. 

Do you ever look at a website that's completely white and it's almost blinding... just to pull a random example:



After you look at that all day long, your eyes can begin to hurt, so for a lot of websites I have dark mode enabled-- take MSDN docs for example that I look at most of the day:



So much better. But some sites simply don't have a dark mode. Meet "about:flags" in Edge-




The main feature we want to hone in on is "Auto Dark Mode for Web Contents", which we'll enable.
Now look at my bing search for "Yahoo":





Very much YMMV but a welcome sight for sore eyes. 

--Jeff


Tuesday, March 15, 2022

Weight loss

    When I graduated high school, I weighed 510 lbs and was 6'4". Well, honestly, the scale at our house capped at 510 lbs and I hit that number and wasn't sure how much over it I actually went. A bit of a back story- when I was a young kid I was fairly active but still had a weight problem. As I grew, that problem only exasperated itself due to the fact that I could eat, boy could I eat. I rode my bike everywhere and played basketball constantly but was still obese. It came down to basic thermodynamics, I was eating more calories than I was burning. 

    When I was about 15 years old, I decided that I was going to lose weight. My parents bought me a stationary bike for Christmas and I set the thing up and started doing cardio. I also just kind of started not drinking soda and eating less food and no desserts. Amazingly over the course of about 6 months, I lost ~50 lbs and went back to 10th grade weighing about 230 lbs. That year, in November, I was starting driver's ed and remember sitting on the sidelines during an optional PE day. Towards the end of class, I decided I wanted to play indoor soccer, so I ran down and started playing and I jumped to hit a ball off my chest and landed on one leg, someone came from the side and hit my knee and completely blew it out. I ended up having to have a few ligaments repaired. I also had a complete lateral release done, which to this day leaves a divot on the outside of my left knee.

    That knee injury is where my true struggle with obesity took over. After I had the surgery on my knee, I laid in bed and my family helped me hand and foot with everything I needed which included food. In the few months I was recovering from my knee surgery I gained an easy 100+ lbs, which led us to the day I graduated high school, well over 500 lbs. 

    After I graduated and was just working and trying to figure out what to do with my life, I decided that I wanted to change. And change I did. Over the course of roughly two and a half years, I went from 510 lbs all the way down to 235 lbs. This was in the early 2000's and even then a lot of the mainstream was incredibly skewed and we didn't understand near as much as we do today. The belief then was that you had to eat 6+ meals a day to "stoke the metabolic fire"; you had to eat breakfast, lunch, and dinner-- with a snack in between each meal or it was impossible to lose weight. So, for two years, I didn't see the inside of a restaurant. I didn't eat a single meal anyone cooked beside myself. I controlled every single gram that entered my mouth. I didn't drink a single soda. It was at this time I started weight training and doing cardio 5-6 days a week and it worked!

    I wish I had pictures from when I was 510 lbs to compare, but after that entire 2.5 years was said and done, I had lost the weight and felt good about myself. I realize now that I typically refused to take full body pictures- but for reference:

    It was around this time that I started dating Leslie and we eventually got married. Obviously, the steps that I had taken to lose the weight were not sustainable for any long amount of time. I could easily do what I did for a short spurt and get the weight off, but when I went back to normal life and started trying to enjoy holidays or go out to eat with family or friends, I couldn't control every gram I ate. In the 9 months Leslie and I were dating before we got married, I went from 235 lbs all the way back up to 285. 

    I kept training 5-6 days a week but went back to normal habits of eating. As life moved on, after we got married, it didn't help that we didn't make that much money so it was easier for me to justify eating cheaper foods vs buying higher priced foods that could help me to sustain a diet. Suffice to say, over the course of 8 years or so, I would gain 40 lbs, lose 30 lbs, gain 40 lbs, lose 30 lbs, etc etc until I found myself almost tipping the scales at 400 lbs again. 

    To add insult to injury, I justified the weight gain. At the time, I was still training constantly and consistently and getting quite strong, at least in my mind. At my now heaviest again (385 lbs) I was benching ~335x3, squatting 465x3, and deadlifting around 505x5. Not going to be on WSM stage anytime soon, but I was happy with those numbers. I started working at Microsoft in 2016 and after I got settled in and was working in this new role, I told myself I wanted to lose weight again, and for real this time. Sometime in 2017 I told myself that if I got down to 300 lbs again, I would start training Brazilian Jiu-Jitsu-- something that I had been interested in for years, so I got to it. But this time, I went about it in a bit of a different manner (maybe I'll do a longer post on this specifically in the future.)

    Instead of trying a crash diet, I wanted to sustainably lose the weight and keep it off. I did a ton of research and landed on the fact that I would start tracking macros again, but be more lenient in what I ate. If I wanted to have some ice cream, I'd have it, I'd just track it and make sure I stayed under my calorie goals for the day. Your body requires a certain amount of energy (calories) to just live and be sustained. 1 lb of fat is roughly equivalent to 3500 calories. The traditional math is such that, if you want to lose 1lb/week you will cut 3500 calories from your diet a week, which conveniently comes out to 500 calories a day. I'm a bit larger, so I went with 1000 calories/day or 2lbs/week as my weight loss goal. Over the course of 2.5 years, I ended up going from 385->235 again. But, I looked quite a bit different than I did when Leslie and I got together because I had been consistently training that entire time. I had built a decent physique:



    And that leads me to today; I've sustained the weight loss this time around, and for good. I am confident in my ability to keep it off because I made small changes and implemented them in such a way that it didn't completely turn my world upside down. I quit drinking normal sodas (artificial sweeteners don't give you cancer.) I prepare and eat 80-90% whole foods. I go out to eat once a week and just enjoy food. This is a big passion of mine and I'm always happy to answer questions around it. I'm willing to help anyone at any stage to lose weight, with one big caveat- they have to be ready to help themselves. I cannot, and will not, sugar coat any of the tips or details that I provide around dieting and nutrition. Best of luck in your goals and hit me up if you have any comments/questions!

-- Jeff


Saturday, March 12, 2022

Software design as a daily practice

Note: I plan to probably make this a twice-a-week type cadence for the blog depending on workload/etc. Probably one on the weekend, one during the week.

I watched a talk at Google yesterday by Professor John Ousterhout titled "A Philosophy of Software Design." The overarching principle of the talk was around techniques on writing extensible, modular code and taking it slow at the start before your entire code base turns into spaghetti. I don't claim to be an expert here, but I'm just providing my thoughts around what I learned from the talk. Let's jump in.

There were several points that he talked about that made me question a lot of what I was taught and learned over the years. First was that classes should be deep. What he meant by that was the interface should have very little overhead and a lot of functionality built into each class. Java seems to suffer from what he called "classitis." This comes from the common thought process that classes and methods should be as small as possible. An example:

FileInputStream fileStream = 

    new FileInputStream(fileName);

BufferedInputStream bufferedStream =

    new BufferedInputStream(fileStream);

ObjectInputStream objectStream =

    new ObjectInputStream(bufferedStream);

Why require all of these different instantiations when all you want to create is a buffered stream? I don't claim to know the answer to that question but I know that this is definitely what I was taught all throughout the classes I took in high school and college. "Keep your methods as small as possible and do as little as you can with each individual method." This part of the talk alone made me question what I had learned over the years. 

Another point he brought up was around errors and exception handling. The common line we hold is to detect and throw as many errors as possible (and throw them as far as we can away from us.) In the Windows world, you can't delete a file if it's open. This seems to make sense. If you try to delete a file and another process has a handle to it.. you shouldn't be able to delete it. John made me ask the question why though? Unix handles this differently. If you delete a file that's open by another process, it will delete it, and remove it from the file system but the system that still has open access to that file still has what it needs and continues it's work. When it inevitably finishes, and runs cleanup, then and only then, is the file really deleted. 

Another area that I don't fully understand but am still wrestling with it but he stated that the overall goal should be to "minimize the number of places where exceptions must be handled." Exceptions are a huge source of complexity in any code, if you throw an exception back to the caller, that caller might then fall into another exception, and before you know it you have a nest of exceptions and might never untie it. Although we all hate to see it, sometimes a crash might be a better answer. If some application has a memory leak, it might be better to just let it leak and then eventually crash vs. the alternative of trying to exception handle the complicated process that is memory handling. The underlying goal here is semantics around what your interface does. If you aren't so narrow in your definition of what your code does, you might not need as many exceptions. 

The last point I'll discuss in this post was related to his thought that there are two different styles of programming. Tactical programming vs strategic programming. With tactical programming, the initial goal is noble, your boss says "we need x feature working by y date" and you set off and work to get that working ASAP. You don't like it, but you accept that you'll take a few shortcuts here and there because once the feature is working, well then you'll have time to go back and fix it. But then the next feature is requested and you accept that last shortcut is no longer a shortcut and you get into the mess of spaghetti I mentioned earlier. This results in badly designed (and probably highly complex) products. The sad part, he brought up, is that people who fall into this category are typically rewarded. The boss sees them as the people who can get work done and so their poor programming practices are rewarded and it further perpetuates the problem (he aptly calls these people tactical tornadoes.)

The idea though, is that simply working code isn't enough. That's where, John argues, strategic programming comes into play. The goal here is to produce a great design, minimize complexity, and in turn, simplify your future development. To do this, you have to fret about the small stuff. The shortcut that you are intending to take is a mistake when viewing it through the lens of strategic programming. 

                                              source: https://www.youtube.com/watch?v=bmSAYlu0NcY

It's an investment. If you take the extra time today it will pay off in the long term in terms of your design and the progress that you and your team make. 

Professor Ousterhout wrote a book about all of this titled "A Philosophy of Software Design" and his big hope and goal is to teach software design to the masses. This is an area of learning for me, so I plan to grab the book and dig in because as I (re)learn to code, I want to go about it the right way, even if it's just for a pet project. 

What are your thoughts about John's approach to programming? Is he wrong? Am I wrong? Let me know!

--Jeff

Tuesday, March 8, 2022

System.Console.WriteLine("Hello World!");

I'm not super keen on how to start a new blog so I figured I would steal from the development world and say Hello, world! 

I'm currently working at Microsoft supporting the Defender for Endpoint product as a EEE (Embedded Escalation Engineer.) I work directly with the product group and site reliability engineers to identify and work on bugs and support the engineers to enable them to help our customers. I'm new to this role but have an extensive background in IT where I started in a support role, then I did a bit of web development for a few years. After that, I worked as a system administrator before moving to my dream of working at Microsoft. I worked in windows (supporting devices and deployment) for several years before recently moving into security.

In my free time, I love playing PC games and am a (not so) scratch golfer. I'm always trying to improve on that front and have a goal to finally break 90 at some point this year. I'll probably talk about that a bit on this blog.

I have no specific or explicit plans for this blog, currently, aside from getting some of my thoughts/learnings out to the world as I work through (re)learning writing c# as I've gotten into just reading it in my day to day and mainly just deepening my knowledge. I will probably talk a bit about golf, a bit about what I'm currently reading, but (hopefully) mainly technology. 

Feel free to hit me up with any thoughts/questions here or on social media (jeffbroseh on instagram or just my name anywhere else- FB or Linkedin.)

I'll leave you today with this quote I read this morning in 12 Rules For Life by Jordan B. Peterson:

"Here's something to consider: If you have a friend whose friendship you wouldn't recommend to your sister, or your father, or your son, why would you have such a friend for yourself? You might say: out of loyalty. Well, loyalty is not identical to stupidity. Loyalty must be negotiated, fairly and honestly. Friendship is a reciprocal arrangement. You are not morally obliged to support someone who is making the world a worse place. Quite the opposite. You should choose people who want things to be better, not worse. It's a good thing, not a selfish thing, to choose people who are good for you. It's appropriate and praiseworthy to associate with people whose lives would be improved if they saw your life improve.

If you surround yourself with people who support your upward aim, they will not tolerate your cynicism and destructiveness. They will instead encourage you when you do good for yourself and others and punish you carefully when you do not." - Jordan Peterson 

--Jeff

about:flags

This is a quick "how-to" on forced dark mode and how to enable it in the Edge browser.  Do you ever look at a website that's c...