TPP

See the first post in The Pragmatic Programmer 20th Anniversary Edition series for an introduction. The first two challenges recommend some (excellent) books to the reader, however do not provide a specific challenge for me to write about here. I shall, therefore, begin with the third challenge. Challenge 3 In the first exercise that follows we look at sorting arrays of long integers. What is the impact if the keys are more complex, and the overhead of key comparison is high?

Read more…

See the first post in The Pragmatic Programmer 20th Anniversary Edition series for an introduction. Exercise 25 A data feed from a vendor gives you an array of tuples representing key-value pairs. The key of DepositAccount will hold a string of the account number in the corresponding value: [ ... {:DepositAccount, "564-904-143-00"} ... ] It worked perfectly in test on the 4-core developer laptops and on the 12-core build machine, but on the production servers running in containers, you keep getting the wrong account numbers.

Read more…

See the first post in The Pragmatic Programmer 20th Anniversary Edition series for an introduction. Exercise 24 Would a blackboard-style system be appropriate for the following applications? Why, or why not? Image processing. You’d like to have a number of parallel processes grab chunks of an image, process them, and put the completed chunk back. Group calendaring. You’ve got people scattered across the globe, in different time zones, and speaking different languages, trying to schedule a meeting.

Read more…

See the first post in The Pragmatic Programmer 20th Anniversary Edition series for an introduction. Exercise 21 Can you express the following requirements as a top-level transformation? That is, for each, identify the input and the output. Shipping and sales tax are added to an order Your application loads configuration information from a named file Someone logs in to a web application initial_order -> final_order initial_order represents the unprocessed data of an order - e.

Read more…

See the first post in The Pragmatic Programmer 20th Anniversary Edition series for an introduction. Exercise 19 In the FSM section we mentioned that you could move the generic state machine implementation into its own class. That class would probably be initialized by passing in a table of transitions and an initial state. Try implementing the string extractor that way. The generic part of the event/strings_fsm.rb example in the book is the logic to determine the appropriate state transition given an occurrence of some event .

Read more…