Split Words

splitstringI have had a stressful week. Glad the weekend arrived. Today I will provide my solution, including the thinking process, to a common and quite popular programming challenge. I have encountered several variations of it. The base problem follows:

“Split a text string into words. Words only contain ASCII letters which for simplicity may be treated as lower (a – z) or upper case (A – Z) characters (developer’s choice)”.

Continue reading “Split Words”

Fraction Recurring Decimal

recurring_decimalsFor the past few months I had been working attempting to solve a challenge per day on HackerRank. I like that site. A couple weeks ago I was introduced to LeetCode. Challenges seem to be more intense and requirements seem to be vaguer. Knowing this, one needs to think and plan the approach / algorithm with greater care and expect to fail unit tests that one would not think off. I just finished a challenge and decided to post in this blog my approach to solving it. Continue reading “Fraction Recurring Decimal”

Bag Algorithm

bag_queue_stackHave to admit it, after a few (will not say how many) years studying Computer Science, architecting and developing systems in multiple programming languages and platforms I had missed the Bag algorithm :o( Gladly I am spending time reading and performing several (do not have time to work on all) exercises and examples in the Algorithms fourth edition book by Robert Sedgewick and Kevin Wayne.

The Bag algorithm is used to implement an object that stores in no particular order items added to it. There is an Application Programming Interface (API) to get the size of the bag and to determine if it is empty. If an Iterator is implemented, then a client is able to iterate in no particular order through the items in a bag. Continue reading “Bag Algorithm”

Generics Implementation

algorithms_fourth_edition_back_coverThis blog entry is based on the example on page 141 of Algorithms fourth edition by Robert Sedgewick and Kevin Wayne. I am reading the book as a refresher and learning experience on computer algorithms. Initially what called my attention was the statement that it contains 50 algorithms that every programmer should know. I want to make sure I have a good handle on those algorithms. After reading the first few chapters which have not cover the algorithms yet, I feel that the way the ground work is presented is very educational, direct to the point and simple to follow. I always like simplicity in code and documentation. Elegant code is very hard to find and write. This book seems that it should help readers achieve such goal. Continue reading “Generics Implementation”

Generics

stackThis blog entry was motivated by the description and implementation of Java Generics in the Algorithms fourth edition book by Robert Sedgewick and Kevin Wayne. The code in this post is based on their implementation. I did some minor changes.

Collections, Generics and Iterators are important concepts in object oriented programming languages. It is central to understand the reasons for them and the associated ideas. If you are interested (and you should if you work with object oriented languages) get a copy of the book and take a look at pages 132 – 141. Continue reading “Generics”

Evaluate Example – Algorithms Fourth Edition

two-stack-algorithmI am reading, experimenting with the examples and working on some (do not have enough time to address them all) exercises using the Algorithms fourth edition book by Robert Sedgewick and Kevin Wayne. I am having a good time refreshing and learning some new things.

This morning I was reading Dijkstra’s Two-Stack Algorithm for Expression Evaluation on page 129. The algorithm is well explained and works. What called my attention is that the actual code does not seem to work on my machine. I already sent a message to professor Sedgewick for clarification. Continue reading “Evaluate Example – Algorithms Fourth Edition”

Algorithms – Chapter 1 and 2

algorithms_fourth_editionI typically write one blog entry per book I read. In this blog, Algorithms Fourth Edition by Robert Sedgewick and Kevin Wayne will be split in comments per one or more chapters.

A few weeks ago I decided to read Algorithms and go over most of the exercises. I wish I would have enough time to tackle them all. This morning I finished reading the first two chapters. So far, so good. Continue reading “Algorithms – Chapter 1 and 2”

Symbolic Links on .NET

word_to_pdfI was talking with a colleague earlier today. A few days ago the requirements for a short project specified a service / application that would monitor an input folder (e.g., c:\temp\DocFolder) for *.doc (Word) files and generate in an output folder (e.g., c:\temp\PDFFolder) a *.pdf (Portable Document Format) version of the files. The application / server was implemented and tested. Continue reading “Symbolic Links on .NET”

Why am I interested in the Pi

raspberry_pi_cardMore than one person has asked me why or have given me the “evil eye” when they find out that I spend time working on a Raspberry Pi. I wish to clarify my interest in this entry.

When I was growing up, my parents always supported and induced me to play and learn electronics and software development. I recall clearly that my mother used to call Computer Science (term non-existent at the time) Cybernetics (a more encompassing term at this day and age). If it was not for that support I might be doing something less interesting. STEM is an important carrier for future generations. It is good for our society and way of life. Now and then I get a chance to promote to a child Computer Science. Using a Raspberry Pi (looks like a toy) is simpler and less intimidating than using a pedestal computer with several monitors and multiple processors and cores. Continue reading “Why am I interested in the Pi”

Fresh Start

acm_logoIt is a relatively cold morning in the Twin Cities of Minneapolis and St. Paul. Woke up earlier and spent time reading the latest issue of Communications of the ACM (10/2016 Volume 59 No 10). A short article titled Fresh Starts by Kate Matsudaira called my attention. Continue reading “Fresh Start”