The Artistic Way of Programming

12 years back, when I started my formal classes in computer science, the first thing I learnt was “data” means “information”. A few days after that, we started conventional programming, where code and data were treated separately. For example, only data can be passed as the functional arguments. It was difficult for me to digest that “code, which is also information, is not treated as data”. I strongly felt that this will increase complexity of softwares in the long run.

A system does three things – read, transform (processing data), write. In other words – the mathematics (the transform part), and the effect of that in real life (the read/write part). The data transformation is indeed a mathematical concept, and with the help of read and write we make the mathematics (the transform part) useful to the real world. Bringing the “transform” part fully inside mathematical domain has its own benefit of using mathematics without fear (possible errors) for the analysis of the system, making the system more tractable mathematically. The catch is to treat both the elements of transformations, data and functions, equally.

Initially, code used to be bigger than the data, so sending data over the wire was feasible. But with time, data becoming huge, sending code to systems over the wire becomes the need, resting the data on the systems intact. With big data, the need of the hour is to treat the code as data, so that the code can be taken as argument to another meta function on a system having huge data which expects an algorithm for transformations.

Roughly speaking, codes are algorithms, algorithms are mathematical functions, functions are in turn actually look-up tables, i.e. data. Hence with this principle, all codes or functions are data.This is exactly the cornerstone of the functional paradigm. The functional programming is programming with functions, they treat functions and data likewise. Another principle I love, to control complexity, rules should not be complex itself.

Thumb rules rewritten for the functional paradigm:

Read-write and transformations(algorithms) should be separate.
Use immutable variables. Discourage use of reassignment statements.
Discourage side-effects (input/output or changing any variable in-place), every function should ONLY return its expected result.
Use referentially transparent functions (sometimes it is called pure functions) with no side effects, i.e. if x = y, f(x) and f(y) should be same forever.
Unit testing is a must for each function.
One of the main design patterns should be followed is to use expressions instead of instructions, i.e. it should be declarative in nature. Discourage use of loops like for/while – use recursive statements as shown above to calculate sum. Tell computers what needs to be done, not how to do it – it reduces error, especially edge cases.
With the need to control the complexity of the system and the advance design, the design pattern for the functional composition can be made to follow some basic algebraic structures, which in turn becomes more robust.

Posted in Uncategorized | Comments Off on The Artistic Way of Programming

Unlike Last Season, Early Schedule Will Challenge Cubs In 2017

The celebration has ended, the 108 year drought is over, and baseball on Chicago’s North Side should return to normal. In other words, fans of the Cubs can go back to worrying.

Several big concerns face them as they look toward the 2017 season, in addition to the nearly impossible task of topping the World Series Championship they earned in October. No team has won the Fall Classic back to back in this century, although a much shorter span than the Cubs endured between titles.

That trip to the World Series was made easier by the early schedule, an arrangement the Cubs will not enjoy next April. Chicago did not play a winning team until April 18 against the Cardinals, which was their fifth series of the season. The Cubs did not play another winning team until May 2, when they played the Pirates. Spending the first month against the likes of Cincinnati, Arizona, Atlanta, and Milwaukee would provide nearly any team with the confidence needed to carry them through the most important stretch of the season. To emphasize just how important a hot start is, examine the National League from last season.

All four of the teams who reached the Division Series posted winning percentages over.700 during the first week of 2016, led by the Cubs and Nationals winning eight of their first nine games. The Giants were victorious in six of their first eight, and the Dodgers won seven of their first ten.

The advantage of opening against non-contenders will not be available to the Cubs in 2017, when the early part of their schedule features matchups against the only two teams that had winning records against Chicago last year. They open in St. Louis on April 2nd, a Sunday night game between the two rivals that will be broadcast on national television.

What could make that initial series even more troubling for the Cubs is the strong possibility that one of their most exciting players from last year will be playing for the opposing team. Center fielder Dexter Fowler, Chicago’s spark plug at the top of the batting order, is a free agent. Many baseball writers have projected St. Louis as the most likely team to sign Fowler. After the series in St. Louis, the Cubs must play the team that nearly eliminated them in the NLCS. The Dodgers, who won both of their regular season series against the Cubs in 2016, have the opportunity to avenge their playoff loss on the opening weekend in April.

The hot start Chicago used to build momentum for their World Series run last year is far less likely to befall them in 2017, simply because of the competition. Instead of opening against last place clubs like San Diego and Cincinnati, the Cubs will be tested right out of the chute by teams expecting to be contenders.

Posted in Uncategorized | Comments Off on Unlike Last Season, Early Schedule Will Challenge Cubs In 2017

Economic Cycles, Stock Market Crashes and the Scary Scenarios

Here we are ready to inaugurate a new president in 2017 and our stock markets are at all-time highs after a huge ‘Trump Bounce’ after the election. Many that study stock market history admit that we are in a need for a pull back as the DOW is almost ready to break 20,000 pts. What does all this mean?

Well, many analysts are suggesting it is very possible we could get a market correction in mid to late 2017 and that it could be 10-20% by the time it is done, the longer this nonsense goes on, and the bigger the bubble builds then the bigger the drop, we are over bought, almost everywhere. Then all that money printed that ended up inflating emerging markets will look for safe haven, coming back here in the short term. As those go one-by-one, that money flies out, because the money is looking for the nicest looking house (for now) in a majorly bad neighborhood, look at the EU, Japan, Middle East, India, and who knows what the hell China’s real numbers are, they have one thing going for them, they own our debt – but that might not be worth much if things go on. All that money coming back to safe haven in the US will cause inflation here, but at what cost?

Cheap loans, another bubble burst and look at the Student Loan issues 35% in default (past 90-days) and cheap car loans is only producing higher repo rates which are hidden by increased sales figures. It’s all lipstick on a big pig, socialism doesn’t work and you can’t have utopia unless you build it, and that takes capitalism which we are crushing into next week for the falsehood of cronyism. But I digress.

If we don’t get a back pedal on the stock market soon, it will all come at once, and 2008 was 8-years ago remember? That wasn’t a recovery that I’d be bragging about – basically we’ve increased regulations, size of government, and cut our military – all very stupid things to do in the present period. We are digging a hole, and I assume when if it starts to fall apart the left will blame capitalism and get their people back into power – and they will just make things worse – this seems to be a repeating problem with humanity doesn’t it? That is what socialists always attempt to do, but it all collapses anyway – Venezuela, Argentina, Greece, Spain, Italy, Portugal, Zimbabwe, hell, how about that Arab Spring a few years ago, still in shambles – Libya, Egypt, Tunisia, Syria, Yemen, who’s next? Jordan, Turkey, Saudi Arabia? Civil unrest, food shortages, people will demand what was promised and take down their governments to get what’s left. Beware the socialist mobs. But I keep digressing.

Posted in Uncategorized | Comments Off on Economic Cycles, Stock Market Crashes and the Scary Scenarios

Five Former All-Stars Who Need To Have Comeback Years in 2017

St. Louis did to Chicago what the Cubs did to the Cardinals during last year’s off season, signing a valuable part of their outfield to a free agent contract. In 2015 Jason Heyward went from the Cardinals to the Cubs, where he received a World Series ring.

This year, the Cardinals returned the favor, signing Dexter Fowler to a free agent deal. Fowler served as a spark at the lead off spot for the Cubs, as well as providing near Gold Glove defense in center field.

St. Louis hopes the overall season turns out as well as 2016 did for Heyward and the Cubs, who won their first Fall Classic in over one hundred years. In order for that to happen, the Cardinals will have to get better individual results from Fowler than the Cubs did from Heyward. Although he remained a top notch defensive right fielder, Heyward’s offensive numbers were disappointing. He struggled so much that manager Joe Madden did not even start him in several World Series games against the Indians.

The Cubs are hoping Heyward has a comeback season in 2017, as are a dozen or so other players. Several of them were mentioned in an article by David Schoenfield at ESPN.com on December 6,2016, a list including Arizona pitcher Zack Greinke, Boston infielder Pablo Sandoval, and Washington first baseman Ryan Zimmerman.

Omitted from that list are five other players who are hoping to bounce back after a down year, or in some cases, back to back down years. Here are five other prominent players who need to have comeback years in 2017.

Joe Mauer of the Minnesota Twins

The former American League Most Valuable Player has had two sub par years in a row, even though he still leads the Twins in quality at bats. Mauer’s batting averages in 2015 and 2016 were both more than thirty under his career .319 mark.

Bryce Harper of the Washington Nationals

After earning the National League M.V. P. honors the season before, Harper hit just .243 and his 24 home runs were barely half of the total he hit in 2015. The outfielder is also hoping to improve his numbers considerably, since he is eligible for free agency after the season.

Andrew McCutcheon of the Pittsburgh Pirates

Trade talk regarding the former N.L. M.V.P. has been frequent throughout the winter, so his comeback may have to occur while he is wearing the uniform of a club other than the Pirates. Ben Revere of the Washington Nationals

After hitting.317 with the Toronto Blue Jays in 2015, Revere’s average plummeted to .214 when he went to Washington. He really needs a comeback year for, like his teammate Harper, he will become a free agent at the end of the season.

Alex Gordon of the Kansas City Royals

His home run totals went up four from 2015, but his batting average dropped fifty one points to .221. Kansas City, which missed out on the playoffs after winning two straight pennants, needs Gordon to bounce back if they want to return to the postseason.

Posted in Uncategorized | Comments Off on Five Former All-Stars Who Need To Have Comeback Years in 2017

5 New Year’s Resolutions for Busy Families

It somehow seems that modern life is busier than it has ever been. As well as our work and family commitments, there are now so many ways to spend our leisure time; it often feels like 24 hours is simply not long enough to get everything you wanted done in the day.

The problem of being busy all of the time (even though it is a good problem to have) hits those of us who have time-consuming jobs and are also raising a family the hardest. If you fall into this category, you may find it helpful to read the following list of five potential New Year’s resolutions you could make to ensure your 2017 is less stressful than this year may have been!

1) Leave the office on time – Even if it’s only on one or two days a week, it is important that you sometimes put your foot down and leave your place of work as soon as your day is meant to finish. You’ll find that you get much more done in the evenings!

2) Invest in a 2017 calendar – It may sound like a simple step, but that’s sort of the point. Having your work and leisure commitments mapped out for the weeks and months ahead in an easy to view format will allow you to see at a glance just how busy you are and whether you are taking on too much.

3) Spend 10 minutes doing nothing – Again, this is more productive than it sounds! Set your alarm ten minutes earlier every day so that, before you get up, you can spend this extra time in completely undisturbed silence, thinking about what your priorities should be for the day to come.

4) What are your two most important tasks? – Speaking of priorities, it is also a good idea to take a step back from time to time and decide which the two most important jobs are that you wish to accomplish on any given day. This is a great way of clearing your head when you feel overwhelmed.

5) Consider hiring household staff – You may have thought that hiring a nanny or other household staff might be the ‘easy way out’, but this is not the case. Those who have invested in professional assistance of this kind know that hiring a caring and responsible person to help run your busy home is a fantastic way of relieving domestic pressures.