diff options
Diffstat (limited to 'posts/programming')
6 files changed, 0 insertions, 986 deletions
diff --git a/posts/programming/2020-07-11-why-computer-science-at-w-m.html b/posts/programming/2020-07-11-why-computer-science-at-w-m.html deleted file mode 100644 index 8933bcf..0000000 --- a/posts/programming/2020-07-11-why-computer-science-at-w-m.html +++ /dev/null @@ -1,249 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <link rel="stylesheet" href="/includes/stylesheet.css" /> - <meta charset="utf-8" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta - property="og:description" - content="The World Wide Web pages of Adam Carpenter" - /> - <meta property="og:image" content="https://nextcloud.53hor.net/index.php/s/Nx9e7iHbw4t99wo/preview" /> - <meta property="og:site_name" content="53hor.net" /> - <meta - property="og:title" - content="Why Computer Science at William and Mary" - /> - <meta property="og:type" content="website" /> - <meta property="og:url" content="https://www.53hor.net" /> - <title>53hornet ➙ Why Computer Science at William and Mary</title> - </head> - - <body> - <nav> - <ul> - <li> - <a href="/"> - <img src="/includes/icons/home-roof.svg" /> - Home - </a> - </li> - <li> - <a href="/info.html"> - <img src="/includes/icons/information-variant.svg" /> - Info - </a> - </li> - <li> - <a href="https://git.53hor.net"> - <img src="/includes/icons/git.svg" /> - Repos - </a> - </li> - <li> - <a href="/hosted.html"> - <img src="/includes/icons/desktop-tower.svg" /> - Hosted - </a> - </li> - <li> - <a type="application/rss+xml" href="/rss.xml"> - <img src="/includes/icons/rss.svg" /> - RSS - </a> - </li> - </ul> - </nav> - - <article> - <h1>Why Computer Science at William and Mary</h1> - - <p class="description"> - Recently a rising high-school senior asked for input on what going to - the College of William and Mary was like for a Computer Science degree. - They were asking about the program itself as well as what it's like on - and off campus. Here's what I sent to them. - </p> - - <h2>Quick Intro</h2> - - <p> - I graduated with a Bachelor's in Computer Science from W&M in 2018. - I'm a couple years in the workforce now but can still remember my - experiences well enough to hopefully add my honest opinion on my time - there as well as how it prepared me for my career. I will also add a - little bit about my time on campus in a dorm and off-campus in Colonial - Williamsburg. - </p> - - <h2>Courses and Curriculum</h2> - - <p> - I felt very positively about the array of courses that were offered - while I was a student. I took a variety of core prerequisites, just like - everyone else, and a good mix of electives. The courses I took include - Data Structures and Algorithms, Software Development/Engineering, - Computer Organization/Architecture, UNIX Systems Programming, Computer - Graphics/Animation, and Computer and Network Security. This list is not - exhaustive and I'm sure they aren't all offered anymore. I was also - required to take a few math classes (Calc I, II, Discrete Math, Linear - Algebra, and Finite Automata). - </p> - - <p> - It is true that the courses listed at <code>cs.wm.edu</code> aren't all - offered at the same time. And it is also true that the higher-level - electives pretty much all required my core prerequisites to be - completed. The result is that the electives all came in my final two - years. My understanding is the curriculum is designed to give someone - the best possible background in computing as a whole. A lot of the - topics may seem like they would never be useful in the "real world" but - I have found the opposite is true. I am an application developer at a - three-letter company. My day-to-day work is building and debugging web - apps, but there's been a lot more to it than that. My first assignment - on the job was scraping bytes off a remote shell and writing a parser to - sift through them. The level of understanding I gathered from my core - classes helped more than I expected they would. I think as a whole they - give me an edge at work and help me teach my colleagues about - algorithms, performance, and systems administration. - </p> - - <p> - That being said, course registration was always nightmarish. It was very - difficult to get into the limited seats in the classes I was most - interested in. Eventually the heads of the department had to pass around - a sign up sheet and organize every student into courses, classrooms, and - professors so that seniors would graduate on time and we could all get - <em>something</em> on our schedules. I hope the shortage of teachers has - caught up since I graduated. I learned from a long-time faculty member - that this is largely a result of the exponential growth of incoming CS - degree-seekers. The program has grown very popular in the last ten years - and I like to think grads are catching on to that. - </p> - - <h2>Teaching</h2> - - <p> - CS@W&M had neutral to good instructors for me. Some were far worse - than others, as with all subjects. When I was there, lots of the older - faculty were retiring and quickly being replaced with younger, newer - instructors, which added to the growing pains of the program. The most - important thing again was making sure there were enough teachers to - teach all of the students. - </p> - - <p> - I know a few of my peers were very upset about what they described as a - lack of communication or availability from their professors. Some have - also mentioned they didn't like having to learn material on their own - and wanted more to come from instruction. I don't deny that the material - itself was difficult and there was a lot of hard work I had to do on my - own to understand very involved concepts in intense, fast-paced courses. - I think that hard work has paid off. I don't think there's realistically - anywhere someone can learn about computing where they won't do any - learning on their own. I am also a very visual, and hands-on learner so - I suppose your mileage may vary. - </p> - - <p> - The most important takeaway from this for me was the ability to pick up - new concepts and technologies quickly and apply them productively. The - majority of professors had project-driven courses. Lots of due dates - meant learning how to transform what I read or learned in class into - practical applications in short amounts of time. This has become, - according to those I work with, one of my greater assets. I am - constantly learning new things in my career and I don't have a lecturer - to explain things to me. It's very powerful to have that and I am - thankful for it. It also helps me teach that knowledge to my colleagues - so we can move faster as a team. - </p> - - <h2>Campus</h2> - - <p> - I agree with my peers about the conditions of classrooms and buildings - on campus. Some are old. I guess that comes with an old university but - there are a choice few that haven't been kept up as best they could. - Since CS is growing so fast it's also long outgrown its own offices. - Classrooms are scattered throughout every academic building on campus - and I probably had a CS course in at least 80% of them. That meant - jumping from one side of campus to another and back again in between - periods. - </p> - - <p> - The College itself isn't too sprawling. I am long-legged and I found I - could get from one end of campus to another in fifteen minutes on foot. - I rode bike a lot to get to classes where I only had ten minutes to do - it. It's also pretty marshy and woodsy in a lot of areas, so during the - rainy season some walking paths got muddy or flooded. Good boots - required. I have never been in as good shape as when I had to do all - that walking but I definitely got soaked and winded making those - transitions. - </p> - - <p> - I appreciate history and architecture and was drawn in by the look and - feel of William and Mary as a result. Without getting too romantic, it's - definitely a beautiful place to attend classes. The ancient Wren - building still holds classes and it's a monument to the College's - tradition. However, I really appreciated the modern academic buildings - on the other side of campus where all of the new construction was taking - place. Modern lab equipment and the library lived there. - </p> - - <p> - The dorms were nothing to write home about. Lots of them were nested in - the woods and built ages ago so they were a little tired and even dingy. - Others are brand new and well maintained; ask around and get opinions on - which ones to go for first chance you get. I made do with what I got for - the first couple of years by keeping it clean and decorated. My last two - years I lived in a couple of off-campus apartments. It was well worth - the switch. Depending on where you are on campus you may need at least a - bike to access local restaurants, shops, and the grocery store. A bike - is a good idea anyway but it's not necessary for every dorm. - </p> - - <h2>Colonial Williamsburg</h2> - - <p> - Lots of my peers didn't appreciate CW as a "college town" but I enjoyed - my time there. I can't speak about parties or clubbing, I was boring and - didn't do any of that. I made a great group of friends and we would walk - into town to get ice cream, see historical attractions (most of which - are free as a student, IIRC), and see movies or plays when we weren't - studying or playing video games in the dorm. There are some good, - sort-of-affordable restaurants but they're kind of driving distance. - </p> - - <p> - The best part about living there was meeting my wife. We would go on - long walks to get away from studying and wound up seeing - horse-and-carriages and the Governor's Palace and things like that. We - would also escape with her car to go to some of the surrounding towns to - get away to nice grocery stores and fun places to eat and explore on the - weekends. I also have family in the area so it was easy for me to stop - by home and say hi, although I know lots of students wanted to get as - far away from home as possible. - </p> - - <h2>Parting Words</h2> - - <p> - I don't consider myself a gung ho alumnus. There are lots of things I - think could be improved, both in CS and at W&M as a whole but I do - not regret my going there. There is no such thing as "everything is - great" or "everything is terrible". It's not so definitive. I had my - fair share of gripes and at times it strained me. There were pros and - cons but I think I have a lot to be thankful for (I landed my job - through W&M recruiting and the career center as well, which are - fantastic resources). I cannot say "do this instead of that." I haven't - gone to any other colleges and don't know enough about them to recommend - them as better or worse. What I can recommend is the same path I took - for folks who want to pursue a degree in Computer Science. I think - you'll come away from it all the more knowledgable, resourceful, and - dedicated. - </p> - </article> - </body> -</html> diff --git a/posts/programming/2020-11-24-i-like-hyper-more-than-actix.html b/posts/programming/2020-11-24-i-like-hyper-more-than-actix.html deleted file mode 100644 index 33c5d9e..0000000 --- a/posts/programming/2020-11-24-i-like-hyper-more-than-actix.html +++ /dev/null @@ -1,23 +0,0 @@ -<h1> - I Like <a href="https://hyper.rs">hyper</a> more than - <a href="https://actix.rs">Actix Web</a> -</h1> - -<article> - <p> - I've been using Actix Web as the HTTP service layer for some web - applications for a while now. I've written several APIs for work and - personal projects on top of Actix and always thought it was pretty spiffy - for what it does: listen for HTTP requests and respond to them with code - I've written. I was always a little bummed about how large the dependency - tree was with the project though, and how long it took to compile. - </p> - - <p> - Recently I've been trying to write or depend on as little code as is - possible to get the job done, so I've been trying to take a look at whether - or not I - <em>need</em> what I've written or imported or even though of implementing - before I've written anything. - </p> -</article> diff --git a/posts/programming/2020-12-01-the-guides.html b/posts/programming/2020-12-01-the-guides.html deleted file mode 100644 index 48e2d79..0000000 --- a/posts/programming/2020-12-01-the-guides.html +++ /dev/null @@ -1,117 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <link rel="stylesheet" href="/includes/stylesheet.css" /> - <meta charset="utf-8" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta - property="og:description" - content="The World Wide Web pages of Adam Carpenter" - /> - <meta property="og:image" content="https://nextcloud.53hor.net/index.php/s/Nx9e7iHbw4t99wo/preview" /> - <meta property="og:site_name" content="53hor.net" /> - <meta property="og:title" content="[The Guides]" /> - <meta property="og:type" content="website" /> - <meta property="og:url" content="https://www.53hor.net" /> - <title>53hornet ➙ [The Guides]</title> - </head> - - <body> - <nav> - <ul> - <li> - <a href="/"> - <img src="/includes/icons/home-roof.svg" /> - Home - </a> - </li> - <li> - <a href="/info.html"> - <img src="/includes/icons/information-variant.svg" /> - Info - </a> - </li> - <li> - <a href="https://git.53hor.net"> - <img src="/includes/icons/git.svg" /> - Repos - </a> - </li> - <li> - <a href="/hosted.html"> - <img src="/includes/icons/desktop-tower.svg" /> - Hosted - </a> - </li> - <li> - <a type="application/rss+xml" href="/rss.xml"> - <img src="/includes/icons/rss.svg" /> - RSS - </a> - </li> - </ul> - </nav> - - <article> - <h1>𝔗𝔥𝔢 𝔊𝔲𝔦𝔡𝔢𝔰</h1> - - <p class="description"> - This is partly satirical and purposefully strange to be humorous. These - are my personal rules for software development (and other projects where - I get carried away easily). - </p> - - <p><em>The Guides.</em> The Guiding Principles.</p> - - <p> - They guide you. They will not lead you astray. Obey <em>The Guides</em>. - </p> - - <p> - You've heard them go by different names. YAGNI. KISS. These are not - falsehoods, but they are not <em>The Guides</em>. Seek the wisdom of the - guides. - </p> - - <blockquote> - 𝔗𝔥𝔬𝔲 𝔰𝔥𝔞𝔩𝔱 𝔴𝔯𝔦𝔱𝔢 𝔞𝔰 𝔩𝔦𝔱𝔱𝔩𝔢 𝔠𝔬𝔡𝔢 𝔞𝔰 𝔭𝔬𝔰𝔰𝔦𝔟𝔩𝔢 𝔱𝔬 𝔤𝔢𝔱 𝔱𝔥𝔢 𝔧𝔬𝔟 𝔡𝔬𝔫𝔢 𝔯𝔦𝔤𝔥𝔱. - </blockquote> - - <blockquote> - O Guides, may I please just add this one extra feature? It won't take me - long and it will be so nice to have later. - </blockquote> - - <blockquote> - 𝔗𝔥𝔬𝔲 𝔰𝔥𝔞𝔩𝔱 𝔴𝔯𝔦𝔱𝔢 𝖔𝖓𝖑𝖞 𝖙𝖍𝖊 𝖈𝖔𝖉𝖊 𝖓𝖊𝖈𝖊𝖘𝖘𝖆𝖗𝖞 𝔱𝔬 𝔤𝔢𝔱 𝔱𝔥𝔢 𝔧𝔬𝔟 𝔡𝔬𝔫𝔢 𝔯𝔦𝔤𝔥𝔱. - </blockquote> - - <blockquote> - O Guides, this can't be correct code. I haven't used proper software - development patterns, processes, or practices. - </blockquote> - - <blockquote> - 𝔓𝔞𝔱𝔱𝔢𝔯𝔫𝔰 𝔣𝔬𝔯 𝔱𝔥𝔢 𝔰𝔞𝔨𝔢 𝔬𝔣 𝔭𝔞𝔱𝔱𝔢𝔯𝔫𝔰 𝔞𝔯𝔢 𝔞𝔫𝔱𝔦-𝔭𝔞𝔱𝔱𝔢𝔯𝔫𝔰. - </blockquote> - - <blockquote> - O Guides, how may I approach this project pragmatically? - </blockquote> - - <blockquote>ℌ𝔢𝔢𝔡 𝔱𝔥𝔢𝔰𝔢 𝔯𝔲𝔩𝔢𝔰:</blockquote> - - <ol> - <li> - You may only write code directly related to the task at hand. Don't - get distracted. - </li> - <li> - Once you have working code, make it correct. Once it is correct, make - it secure. Once it is secure, make it small. Once it is small, stop. - </li> - <li>The enemy of good is better.</li> - </ol> - </article> - </body> -</html> diff --git a/posts/programming/2020-12-04-aoc-2020-day-1-in-cbm-basic.html b/posts/programming/2020-12-04-aoc-2020-day-1-in-cbm-basic.html deleted file mode 100644 index c59a893..0000000 --- a/posts/programming/2020-12-04-aoc-2020-day-1-in-cbm-basic.html +++ /dev/null @@ -1,231 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <link rel="stylesheet" href="/includes/stylesheet.css" /> - <meta charset="utf-8" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta - property="og:description" - content="The World Wide Web pages of Adam Carpenter" - /> - <meta property="og:image" content="https://nextcloud.53hor.net/index.php/s/Nx9e7iHbw4t99wo/preview" /> - <meta property="og:site_name" content="53hor.net" /> - <meta property="og:title" content="AOC 2020 Day 1 in CBM Basic" /> - <meta property="og:type" content="website" /> - <meta property="og:url" content="https://www.53hor.net" /> - <title>53hornet ➙ AOC 2020 Day 1 in CBM Basic</title> - </head> - - <body> - <nav> - <ul> - <li> - <a href="/"> - <img src="/includes/icons/home-roof.svg" /> - Home - </a> - </li> - <li> - <a href="/info.html"> - <img src="/includes/icons/information-variant.svg" /> - Info - </a> - </li> - <li> - <a href="https://git.53hor.net"> - <img src="/includes/icons/git.svg" /> - Repos - </a> - </li> - <li> - <a href="/hosted.html"> - <img src="/includes/icons/desktop-tower.svg" /> - Hosted - </a> - </li> - <li> - <a type="application/rss+xml" href="/rss.xml"> - <img src="/includes/icons/rss.svg" /> - RSS - </a> - </li> - </ul> - </nav> - - <article> - <h1>AOC 2020 Day 1 in CBM Basic</h1> - - <p class="description"> - I implemented the - <a href="https://adventofcode.com/2020">Advent of Code 2020</a> Day 1 - challenge in CBM BASIC on a real Commodore 64. I haven't done anything - in Basic in a long time, and probably never did anything actually - meaningful with it. Part 1 of the challenge was to take a list of - numbers, find the two that summed to 2020, and then multiply those two - numbers together. Part two was to perform part 1 but with three numbers - instead of two. - </p> - <p> - Now I wanted to actually write the code on the Commodore 64 itself, but - I gave myself some leniency. Instead of manually typing in all 200 - entries of input data (and inevitably making a breaking mistake) I used - Vim on my PC to format the <code>DATA</code> entries at the start of the - code. I then dropped that onto a 1541 disk image, plopped it on an SD - card, and used my SD2IEC to mount the SD card's image on the Commodore. - The rest of the programming was done on the Commodore itself. - </p> - - <p>Here is my solution for Day 1 Part 1:</p> - <pre> - <code> -10 DATA 1686, 1983, 1801, 1890, 1910, 1722, 1571, 1952, 1602, 1551, 1144 -11 DATA 1208, 1335, 1914, 1656, 1515, 1600, 1520, 1683, 1679, 1800, 1889 -12 DATA 1717, 1592, 1617, 1756, 1646, 1596, 1874, 1595, 1660, 1748, 1946 -13 DATA 1734, 1852, 2006, 1685, 1668, 1607, 1677, 403 , 1312, 1828, 1627 -14 DATA 1925, 1657, 1536, 1522, 1557, 1636, 1586, 1654, 1541, 1363, 1844 -15 DATA 1951, 1765, 1872, 696, 1764, 1718, 1540, 1493, 1947, 1786, 1548 -16 DATA 1981, 1861, 1589, 1707, 1915, 1755, 1906, 1911, 1628, 1980, 1986 -17 DATA 1780, 1645, 741 , 1727, 524 , 1690, 1732, 1956, 1523, 1534, 1498 -18 DATA 1510, 372 , 1777, 1585, 1614, 1712, 1650, 702 , 1773, 1713, 1797 -19 DATA 1691, 1758, 1973, 1560, 1615, 1933, 1281, 1899, 1845, 1752, 1542 -20 DATA 1694, 1950, 1879, 1684, 1809, 1988, 1978, 1843, 1730, 1377, 1507 -21 DATA 1506, 1566, 935 , 1851, 1995, 1796, 1900, 896 , 171, 1728, 1635 -22 DATA 1810, 2003, 1580, 1789, 1709, 2007, 1639, 1726, 1537, 1976, 1538 -23 DATA 1544, 1626, 1876, 1840, 1953, 1710, 1661, 1563, 1836, 1358, 1550 -24 DATA 1112, 1832, 1555, 1394, 1912, 1884, 1524, 1689, 1775, 1724, 1366 -25 DATA 1966, 1549, 1931, 1975, 1500, 1667, 1674, 1771, 1631, 1662, 1902 -26 DATA 1970, 1864, 2004, 2010, 504 , 1714, 1917, 1907, 1704, 1501, 1812 -27 DATA 1349, 1577, 1638, 1886, 1157, 1761, 1676, 1731, 2001, 1261, 1154 -28 DATA 1769, 1529 -100 DIM A(200) -110 FOR I=0TO199 -120 READ A(I) -140 NEXT -150 FOR I=0TO199 -160 B=A(I) -170 FOR J=0TO199 -180 IF I=J THEN 210 -190 C=A(J) -200 IF B+C=2020 THEN PRINT "!",B,C,B*C:STOP -210 NEXT J -220 NEXT I - </code></pre> - - <p> - I basically put all 200 numbers into data fields, and then defined an - array large enough to read them into with <code>DIM</code>. Then I - iterated over the array twice, checking each element against each other - element to see if they summed to 2020. If they did, I printed them both - and the product of the two found numbers and stopped further execution. - </p> - <p> - There weren't really any special tricks to this implementation except - remembering that I shouldn't be checking whether a number could sum to - 2020 with itself. - </p> - - <p> - Then I got to move onto Part 2, and this is where things got - interesting. Comparing any three numbers from the data meant the - cognitively easiest way to solve the problem was a triple loop. This of - course meant <code>O(n^3)</code> time, which the Commodore struggled - with. I waited about an hour before I decided I could optimize just a - little bit to speed up the search. - </p> - - <p> - I figured that for three numbers to sum to 2020, they all had to be - pretty small. Most likely they were most (if not all) three digits - instead of four. So I figured I could sort the entry data to make the - search finish probably near the start of the first layer of iteration. - Keep in mind I didn't want to pre-sort the data, I wanted the Commodore - to work with the same exact input set it had for Part 1. So I turned to - the simplest sorting algorithm I could remember: - <a href="https://en.wikipedia.org/wiki/Bubble_sort">bubble sort</a>. - </p> - - <p>Here is my solution for Day 1 Part 2:</p> - - <pre> - <code> -10 DATA 1686, 1983, 1801, 1890, 1910, 1722, 1571, 1952, 1602, 1551, 1144 -11 DATA 1208, 1335, 1914, 1656, 1515, 1600, 1520, 1683, 1679, 1800, 1889 -12 DATA 1717, 1592, 1617, 1756, 1646, 1596, 1874, 1595, 1660, 1748, 1946 -13 DATA 1734, 1852, 2006, 1685, 1668, 1607, 1677, 403 , 1312, 1828, 1627 -14 DATA 1925, 1657, 1536, 1522, 1557, 1636, 1586, 1654, 1541, 1363, 1844 -15 DATA 1951, 1765, 1872, 696, 1764, 1718, 1540, 1493, 1947, 1786, 1548 -16 DATA 1981, 1861, 1589, 1707, 1915, 1755, 1906, 1911, 1628, 1980, 1986 -17 DATA 1780, 1645, 741 , 1727, 524 , 1690, 1732, 1956, 1523, 1534, 1498 -18 DATA 1510, 372 , 1777, 1585, 1614, 1712, 1650, 702 , 1773, 1713, 1797 -19 DATA 1691, 1758, 1973, 1560, 1615, 1933, 1281, 1899, 1845, 1752, 1542 -20 DATA 1694, 1950, 1879, 1684, 1809, 1988, 1978, 1843, 1730, 1377, 1507 -21 DATA 1506, 1566, 935 , 1851, 1995, 1796, 1900, 896 , 171, 1728, 1635 -22 DATA 1810, 2003, 1580, 1789, 1709, 2007, 1639, 1726, 1537, 1976, 1538 -23 DATA 1544, 1626, 1876, 1840, 1953, 1710, 1661, 1563, 1836, 1358, 1550 -24 DATA 1112, 1832, 1555, 1394, 1912, 1884, 1524, 1689, 1775, 1724, 1366 -25 DATA 1966, 1549, 1931, 1975, 1500, 1667, 1674, 1771, 1631, 1662, 1902 -26 DATA 1970, 1864, 2004, 2010, 504 , 1714, 1917, 1907, 1704, 1501, 1812 -27 DATA 1349, 1577, 1638, 1886, 1157, 1761, 1676, 1731, 2001, 1261, 1154 -28 DATA 1769, 1529 -100 DIM A(200) -110 FOR I=0TO199 -120 READ A(I) -140 NEXT -141 GOSUB 300 -150 FOR I=0TO199 -160 B=A(I) -170 FOR J=0TO199 -180 IF J=I THEN 250 -190 C=A(J) -200 FOR K=0TO199 -210 IF K=I OR K=J THEN 240 -220 D=A(K) -230 IF B+C+D=2020 THEN PRINT "!",B,C,D,B*C*D:STOP -240 NEXT K -250 NEXT J -260 NEXT I -300 REM BUBBLE SORT -301 X=200 -310 N=200 -320 FOR I=0TON-2 -330 FOR J=0TON-I-2 -340 X=A(J):Y=A(J+1) -350 IF X>Y THEN A(J)=Y:A(J+1)=X -360 NEXT : NEXT -370 RETURN - </code> - </pre> - - <p> - I added a subroutine starting on line 300 to perform a basic bubble sort - on top of the original array of data. Now bubble sort isn't fast by any - means, but the Commodore was able to finish it in a couple of minutes. - And the results were worth it because the subsequent triple - <code>FOR</code>-loop completed in another few minutes. My instinct was - right and two of the solution numbers were triple-digit. - </p> - - <p> - So there you have it, Advent of Code 2020 Day 1 in Commodore 64 Basic - V2. You can run these samples on real hardware of course, or in an - emulator. You can also run them with the - <a href="https://github.com/mist64/cbmbasic"><code>cbmbasic</code></a> - interpreter, which is a neat native C64 Basic interpreter for modern - architectures. (Oh and I tested my samples on <code>cbmbasic</code> and - they finished instantaneously. It helps to have a - thousands-of-times-faster processor.) - </p> - - <p> - I was going to keep going with the challenge and finish them all in CBM - basic for fun, but the Day 2 input data set was 1000 entries. No - problem, I can just read them from a <code>SEQ</code> file. The only - blocker I realized was the challenge requires string character counting, - which I don't think there's a function for in CBM basic. Maybe I have to - do a few <code>PEEK</code>s and <code>POKE</code>s to check memory - locations for ASCII/PETSCII character codes. Or I could just put it off - til next year :) - </p> - </article> - </body> -</html> diff --git a/posts/programming/2020-12-08-useful-sprint-planning-from-a-certified-scrum-master.html b/posts/programming/2020-12-08-useful-sprint-planning-from-a-certified-scrum-master.html deleted file mode 100644 index 0d5fffe..0000000 --- a/posts/programming/2020-12-08-useful-sprint-planning-from-a-certified-scrum-master.html +++ /dev/null @@ -1,203 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <link rel="stylesheet" href="/includes/stylesheet.css" /> - <meta charset="utf-8" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta - property="og:description" - content="The World Wide Web pages of Adam Carpenter" - /> - <meta property="og:image" content="https://nextcloud.53hor.net/index.php/s/Nx9e7iHbw4t99wo/preview" /> - <meta property="og:site_name" content="53hor.net" /> - <meta - property="og:title" - content="Useful Sprint Planning from a Certified Scrum Master" - /> - <meta property="og:type" content="website" /> - <meta property="og:url" content="https://www.53hor.net" /> - <title> - 53hornet ➙ Useful Sprint Planning from a Certified Scrum Master - </title> - </head> - - <body> - <nav> - <ul> - <li> - <a href="/"> - <img src="/includes/icons/home-roof.svg" /> - Home - </a> - </li> - <li> - <a href="/info.html"> - <img src="/includes/icons/information-variant.svg" /> - Info - </a> - </li> - <li> - <a href="https://git.53hor.net"> - <img src="/includes/icons/git.svg" /> - Repos - </a> - </li> - <li> - <a href="/hosted.html"> - <img src="/includes/icons/desktop-tower.svg" /> - Hosted - </a> - </li> - <li> - <a type="application/rss+xml" href="/rss.xml"> - <img src="/includes/icons/rss.svg" /> - RSS - </a> - </li> - </ul> - </nav> - - <article> - <h1>Useful Sprint Planning from a Certified Scrum Master</h1> - - <p class="description"> - This is a small collection of sprint planning/story points allocation - tips and tricks that I use at work. They pretty much all come from our - in-house certified "Scrum Master". He's got much better experience than - I do with building a real working backlog of stories and planning - sprints based on those stories. That being said, any opinions here are - my own and I don't speak on his behalf. - </p> - - <h2>Points as a Measure of Work</h2> - - <p> - In my understanding, points are approximate measures of the amount of - work required to complete a given story or task. I do not think points - correlate to an exact measure of time. I use them to determine the size - of a task in relation to another task. For example, a simple-looking - task may be allocated 1 point. In reality this 1 point may take 1 minute - or 1 hour to complete. The time it takes is less important than the - ratio of time it takes in comparison to a second given task. Say the - second task appears to take twice as much time as the first (however - much time that may be). The second task would therefore get 2 points. - </p> - - <p> - Some teams have a special system for incrementing points. Our team uses - the - <a href="https://en.wikipedia.org/wiki/Fibonacci#Fibonacci_sequence" - >Fibonacci sequence of numbers</a - >. So the smallest amount that can be allocated to a story is 1. Then it - goes 2, 3, 5, 8, and so on and so forth. If a single story is going to - use up 8 points, you should probably take a look at breaking it up into - smaller tasks. A single story shouldn't take up almost half of your - allocated work for a sprint. - </p> - - <h2>How Much is Enough?</h2> - <p> - Our team aims for 10 points per 2-week per sprint. Simple enough for me, - but the hard part is determining how many points to allocate to a given - task. - </p> - - <p> - One thing I could never figure out is what the recommended starting - position for 1 point looks like. I'm sure this is something that comes - from experience, and our Scrum Master helped us out with that. - </p> - - <ul> - <li> - 1 point: Small or basic text change. Updating configuration, fixing a - typo or cognitively simple bug. - </li> - <li> - 2 points: Task with light complexity. Some portions of code have to - change, be debugged, tested. - </li> - <li> - 3 points: Some complexity, will take time to implement. Potentially a - few days' worth of work. May require front- and back-end work, or - back-end and database work. - </li> - <li> - 5 points: Half a sprint's worth of more complicated work. Full-on - feature implementation for example. - </li> - </ul> - - <h2>Prioritizing Work</h2> - - <p> - I do not see points as indicative of the importance or priority of a - task or story. Just because one task will take longer to complete than - another does not mean it's more or less important to me. There should be - another method of gauging which stories should be taken off the backlog - first. For example, one story might depend on another. One might relate - to core functionality that a stakeholder has asked for. Another task - might be required to make code build because it solves some major - problem! - </p> - - <p> - To communicate how "important" a task is, every story we have is - prioritized something like this: - </p> - <ol> - <li>Critical</li> - <li>Blocker</li> - <li>Highest</li> - <li>High</li> - <li>Medium</li> - <li>Low</li> - <li>Lowest</li> - </ol> - - <p> - Tasks that align with some long-term project that management is waiting - on are tagged "Highest". Stories that prevent lots of other stories from - being completed may be labeled "Blocker". - </p> - - <h2>Sprint Planning/Backlog Refinement</h2> - - <p> - With all that in mind, at the start of the sprint I now take about 10 - points worth of priority work off of the backlog. I'll work through it - the whole sprint through and then, ideally, it'll all be complete by the - end of the sprint. If I bit off more than I could chew and the sprint - ends before I'm finished, the incomplete work rolls over to the next - sprint and is the first to be completed. If I find I've finished - everything I had to work on and there are still a couple of days left in - the sprint, I'll take one or two small items off the backlog and work on - those. - </p> - - <h2>Tools to Get the Job Done</h2> - - <p> - Our team uses Jira at work, and I know some folks love it so much - they've paid for a personal license. It's a bit overkill for my personal - projects, so I've been using Nextcloud's Deck plugin. This is an okay - solution but it doesn't integrate very well with source code - repositories (although it can tie into a Nextcloud "project", or a - collection of related files open to a team). I'm spinning up a Gitea - server to replace my <code>git-web</code> server soon and this is one of - the reasons for that. Gitea has a GitHub-style issue tracker where you - can create issues of various kinds, assign them to users, reference - commits to the source, and create a Kanban-style board of issues that - are on the backlog, to-do, in-progress, or done. - </p> - - <p> - I'm still learning how to keep to a Scrum-like process of some kind, - because I do see the benefit of using such a system, especially in a - team. I'm definitely not an expert though so some of what I've got here - may change over time. Right now it's working well and that's good enough - for me. - </p> - </article> - </body> -</html> diff --git a/posts/programming/2021-01-28-undefined-javasript-is-undefined-.html b/posts/programming/2021-01-28-undefined-javasript-is-undefined-.html deleted file mode 100644 index e12203b..0000000 --- a/posts/programming/2021-01-28-undefined-javasript-is-undefined-.html +++ /dev/null @@ -1,163 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <link rel="stylesheet" href="/includes/stylesheet.css" /> - <meta charset="utf-8" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta - property="og:description" - content="The World Wide Web pages of Adam Carpenter" - /> - <meta - property="og:image" - content="https://nextcloud.53hor.net/index.php/s/Nx9e7iHbw4t99wo/preview" - /> - <meta property="og:site_name" content="53hor.net" /> - <meta property="og:title" content="Undefined? JavaSript Is Undefined." /> - <meta property="og:type" content="website" /> - <meta property="og:url" content="https://www.53hor.net" /> - <title>53hornet ➙ Undefined? JavaSript Is Undefined.</title> - </head> - - <body> - <nav> - <ul> - <li> - <a href="/"> - <img src="/includes/icons/home-roof.svg" /> - Home - </a> - </li> - <li> - <a href="/info.html"> - <img src="/includes/icons/information-variant.svg" /> - Info - </a> - </li> - <li> - <a href="https://git.53hor.net"> - <img src="/includes/icons/git.svg" /> - Repos - </a> - </li> - <li> - <a href="/hosted.html"> - <img src="/includes/icons/desktop-tower.svg" /> - Hosted - </a> - </li> - <li> - <a type="application/rss+xml" href="/rss.xml"> - <img src="/includes/icons/rss.svg" /> - RSS - </a> - </li> - </ul> - </nav> - - <article> - <h1>Undefined? JavaSript Is Undefined.</h1> - - <p class="description"> - So I've been working on a web app for my mom. Nothing too fancy, but - it's a store front for her glass art. It's an easy way for her to keep - track of inventory, update photos of her products, and for people to - shop and search and sort and browse through it. This backend is an HTTP - service written in Rust. The frontend is a Vue.js app. I've used Vue and - JavaScript many times before but I recently ran into an incredibly - strange bug. One that I would have hoped JavaScript would have some - guard against. But JavaScript is an undefined language. - </p> - - <p> - I have a small component that uses a file input to collect an image from - the user. Then I append that file to a FormData and set that FormData as - a Fetch API request body. So I've got fetch API sending - multipart/form-data across the network to my backend. Awesome! The - backend is supposed to take each field of the request, turn the chunks - into a single stream of binary data, and write them out to an image. - Everything on the front seems like it's working great, it fires off the - request and throws no errors. But then the backend only sees a few bytes - of this multi-megabyte image. Not awesome! short chunks on the back-end. - The array of data in the API is less than ten bytes long, when this is a - many-kilobyte file I'm trying to upload. - </p> - - <p> - At this point I'm relentlessly debugging, trying to find out what's - wrong with the API. Why is it truncating the request down to a few - bytes, where's the rest of the data? It took me forever to actually - inspect what those few bytes are and, lo and behold they're ASCII for - <code>undefined</code> The request happily stringified an - <code>undefined</code> object, instead of maybe throwing a null - reference or undefined error during request creation because that's just - what JavaScript does. <em>The linter didn't even catch it.</em> - </p> - - <p> - You can see what the debugging logs looked like on the backend below. - Note that the <code>&data</code> is the field that spells out - "undefined". Also note that the file picker/FormData was constructed - alright because the key for the image name is correct. - </p> - - <pre> - <code> -[src/handlers.rs:114] &field = -Field: application/octet-stream - boundary: ---------------------------175314640631070190963311652907 - headers: - "content-disposition": "form-data; name=\"clu.jpg\"" - -[src/handlers.rs:119] &chunk = Ok( - b"undefined", -) -[src/handlers.rs:123] &data = [ - 117, - 110, - 100, - 101, - 102, - 105, - 110, - 101, - 100, -] -ImageWrite("The image format could not be determined") - </code> - </pre> - - <p> - The <em>working</em> JS is here (it was late at night and I was so - donion rings I just fixed it and pushed it without saving the errors for - posterity): - </p> - - <pre> - <code> -let file = event.target.files[0]; -if (!file) { - return; -} - -const fd = new FormData(); -fd.append(file.name, file); - -const response = await fetch("http://localhost:8000/photos", { - method: "POST", - body: fd -}); - -console.log(response); - </code> - </pre> - <p> - I've gotten frustrated by JS before but not like this. I don't know if - TypeScript would have solved this issue but writing in a language that - gets transpiled back into the language I'm trying to avoid doesn't seem - like the way forward. I'm looking forward to Web Assembly as a way of - using more type-safe languages in the browser. - </p> - </article> - </body> -</html> |