From 890b34bcc1a6b4073d1e512b1386634f7bc5ea52 Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Wed, 21 Apr 2021 22:57:39 -0400 Subject: unified posts dir, until I can figure out makefile sub-subdirs. makefile auto-generates index --- .../2020-07-11-why-computer-science-at-w-m.html | 249 --------------------- .../2020-11-24-i-like-hyper-more-than-actix.html | 23 -- posts/programming/2020-12-01-the-guides.html | 117 ---------- .../2020-12-04-aoc-2020-day-1-in-cbm-basic.html | 231 ------------------- ...int-planning-from-a-certified-scrum-master.html | 203 ----------------- ...21-01-28-undefined-javasript-is-undefined-.html | 163 -------------- 6 files changed, 986 deletions(-) delete mode 100644 posts/programming/2020-07-11-why-computer-science-at-w-m.html delete mode 100644 posts/programming/2020-11-24-i-like-hyper-more-than-actix.html delete mode 100644 posts/programming/2020-12-01-the-guides.html delete mode 100644 posts/programming/2020-12-04-aoc-2020-day-1-in-cbm-basic.html delete mode 100644 posts/programming/2020-12-08-useful-sprint-planning-from-a-certified-scrum-master.html delete mode 100644 posts/programming/2021-01-28-undefined-javasript-is-undefined-.html (limited to 'posts/programming') 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 @@ - - - - - - - - - - - - - 53hornet ➙ Why Computer Science at William and Mary - - - - - -
-

Why Computer Science at William and Mary

- -

- 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. -

- -

Quick Intro

- -

- 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. -

- -

Courses and Curriculum

- -

- 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). -

- -

- It is true that the courses listed at cs.wm.edu 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. -

- -

- 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 - something 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. -

- -

Teaching

- -

- 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. -

- -

- 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. -

- -

- 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. -

- -

Campus

- -

- 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. -

- -

- 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. -

- -

- 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. -

- -

- 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. -

- -

Colonial Williamsburg

- -

- 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. -

- -

- 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. -

- -

Parting Words

- -

- 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. -

-
- - 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 @@ -

- I Like hyper more than - Actix Web -

- -
-

- 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. -

- -

- 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 - need what I've written or imported or even though of implementing - before I've written anything. -

-
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 @@ - - - - - - - - - - - - - 53hornet ➙ [The Guides] - - - - - -
-

𝔗𝔥𝔢 𝔊𝔲𝔦𝔡𝔢𝔰

- -

- 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). -

- -

The Guides. The Guiding Principles.

- -

- They guide you. They will not lead you astray. Obey The Guides. -

- -

- You've heard them go by different names. YAGNI. KISS. These are not - falsehoods, but they are not The Guides. Seek the wisdom of the - guides. -

- -
- 𝔗𝔥𝔬𝔲 𝔰𝔥𝔞𝔩𝔱 𝔴𝔯𝔦𝔱𝔢 𝔞𝔰 𝔩𝔦𝔱𝔱𝔩𝔢 𝔠𝔬𝔡𝔢 𝔞𝔰 𝔭𝔬𝔰𝔰𝔦𝔟𝔩𝔢 𝔱𝔬 𝔤𝔢𝔱 𝔱𝔥𝔢 𝔧𝔬𝔟 𝔡𝔬𝔫𝔢 𝔯𝔦𝔤𝔥𝔱. -
- -
- 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. -
- -
- 𝔗𝔥𝔬𝔲 𝔰𝔥𝔞𝔩𝔱 𝔴𝔯𝔦𝔱𝔢 𝖔𝖓𝖑𝖞 𝖙𝖍𝖊 𝖈𝖔𝖉𝖊 𝖓𝖊𝖈𝖊𝖘𝖘𝖆𝖗𝖞 𝔱𝔬 𝔤𝔢𝔱 𝔱𝔥𝔢 𝔧𝔬𝔟 𝔡𝔬𝔫𝔢 𝔯𝔦𝔤𝔥𝔱. -
- -
- O Guides, this can't be correct code. I haven't used proper software - development patterns, processes, or practices. -
- -
- 𝔓𝔞𝔱𝔱𝔢𝔯𝔫𝔰 𝔣𝔬𝔯 𝔱𝔥𝔢 𝔰𝔞𝔨𝔢 𝔬𝔣 𝔭𝔞𝔱𝔱𝔢𝔯𝔫𝔰 𝔞𝔯𝔢 𝔞𝔫𝔱𝔦-𝔭𝔞𝔱𝔱𝔢𝔯𝔫𝔰. -
- -
- O Guides, how may I approach this project pragmatically? -
- -
ℌ𝔢𝔢𝔡 𝔱𝔥𝔢𝔰𝔢 𝔯𝔲𝔩𝔢𝔰:
- -
    -
  1. - You may only write code directly related to the task at hand. Don't - get distracted. -
  2. -
  3. - 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. -
  4. -
  5. The enemy of good is better.
  6. -
-
- - 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 @@ - - - - - - - - - - - - - 53hornet ➙ AOC 2020 Day 1 in CBM Basic - - - - - -
-

AOC 2020 Day 1 in CBM Basic

- -

- I implemented the - Advent of Code 2020 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. -

-

- 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 DATA 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. -

- -

Here is my solution for Day 1 Part 1:

-
-	  
-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 
-	  
- -

- I basically put all 200 numbers into data fields, and then defined an - array large enough to read them into with DIM. 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. -

-

- 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. -

- -

- 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 O(n^3) 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. -

- -

- 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: - bubble sort. -

- -

Here is my solution for Day 1 Part 2:

- -
-	  
-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 
-	  
-	  
- -

- 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 - FOR-loop completed in another few minutes. My instinct was - right and two of the solution numbers were triple-digit. -

- -

- 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 - cbmbasic - interpreter, which is a neat native C64 Basic interpreter for modern - architectures. (Oh and I tested my samples on cbmbasic and - they finished instantaneously. It helps to have a - thousands-of-times-faster processor.) -

- -

- 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 SEQ 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 PEEKs and POKEs to check memory - locations for ASCII/PETSCII character codes. Or I could just put it off - til next year :) -

-
- - 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 @@ - - - - - - - - - - - - - - 53hornet ➙ Useful Sprint Planning from a Certified Scrum Master - - - - - - -
-

Useful Sprint Planning from a Certified Scrum Master

- -

- 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. -

- -

Points as a Measure of Work

- -

- 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. -

- -

- Some teams have a special system for incrementing points. Our team uses - the - Fibonacci sequence of numbers. 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. -

- -

How Much is Enough?

-

- 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. -

- -

- 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. -

- - - -

Prioritizing Work

- -

- 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! -

- -

- To communicate how "important" a task is, every story we have is - prioritized something like this: -

-
    -
  1. Critical
  2. -
  3. Blocker
  4. -
  5. Highest
  6. -
  7. High
  8. -
  9. Medium
  10. -
  11. Low
  12. -
  13. Lowest
  14. -
- -

- 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". -

- -

Sprint Planning/Backlog Refinement

- -

- 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. -

- -

Tools to Get the Job Done

- -

- 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 git-web 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. -

- -

- 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. -

-
- - 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 @@ - - - - - - - - - - - - - 53hornet ➙ Undefined? JavaSript Is Undefined. - - - - - -
-

Undefined? JavaSript Is Undefined.

- -

- 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. -

- -

- 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. -

- -

- 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 - undefined The request happily stringified an - undefined object, instead of maybe throwing a null - reference or undefined error during request creation because that's just - what JavaScript does. The linter didn't even catch it. -

- -

- You can see what the debugging logs looked like on the backend below. - Note that the &data 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. -

- -
-		
-[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")
-		
-	
- -

- The working 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): -

- -
-	  
-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);
-	  
-	  
-

- 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. -

-
- - -- cgit v1.2.3