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

Cleveland Has A Better Chance Than Chicago To Return To The World Series

The youth of the Cubs, epitomized by the selection of Kris Bryant as the National League Most Valuable Player, has many people discussing a return to the World Series next year and beyond for the team from Chicago’s North Side. In actuality, it seems that their opponents in this past Fall Classic are more likely than the Cubs to reach it again in 2017.

Several key members of the Cubs are facing free agency, most notably closer Aroldis Chapman and leadoff hitter Dexter Fowler. Postseason pitching hero Jon Lester will return, but veteran battery mate David Ross has retired. The loss of his personal long time catcher, who was brought over from Boston to Chicago primarily at Lester’s request, may cause the left hander to be less effective in 2017.

Cleveland, on the other hand, will be adding a star player to a lineup that managed to somehow win the pennant without him. Outfielder Michael Brantley, the team’s M.V.P. in 2015, will return after missing nearly all of last season due to injury. They will also get back catcher Yan Gomes, who missed much of the season as well. The path to the playoffs promises to be easier for Cleveland next season. Two of the perennial powers that rival the Indians in the American League Central division, Detroit and Chicago, are going to be considerably weaker as they enter rebuilding mode. The Tigers are looking to trade veterans such as Julio Iglesias and Ian Kinsler in hopes of getting top prospects, and the White Sox are marketing ace left hander Chris Sale and center fielder Adam Eaton.

Also weaker are the teams the Indians breezed through in the playoffs, which saw Cleveland win seven of the eight games in the two rounds. Boston, who was swept in three games by Cleveland, will very likely miss the presence of “Big Papi” David Ortiz. The perennial All-star and likely Hall of Fame designated hitter retired after the season.

Toronto, who was dispatched by Cleveland in five games in the Championship Series, will be losing at least one of its key sluggers Edwin Encarnacion and Jose Bautista. Both All-Stars are free agents this winter, and each will command contracts so large that it would be impossible for the Blue Jays to sign the duo.

On the other hand, the Cubs’ most probable playoff opponents are likely going to be stronger. Washington, which finished behind Chicago for most victories last season, is seeking to acquire Sale from the White Sox. That acquisition would strengthen an already formidable starting rotation, anchored by Cy Young Award winner Max Scherzer. The Nationals are also on target to sign Fowler away from Chicago. The Dodgers, who came just two games from wresting the pennant from the Cubs, are actively pursuing several power hitters that could push them over Chicago in the playoffs. Milwaukee outfielder and former National League M.V.P Ryan Braun continues to be linked in possible trades with Los Angeles.

While there is no doubt that the Cubs will be the favorites to win the pennant again in 2017, Cleveland might be an even better bet to repeat. After all, they won it last year without two of its best players, both of whom should be healthy in the spring.

Posted in Uncategorized | Comments Off on Cleveland Has A Better Chance Than Chicago To Return To The World Series

The Last Chance for Gold

Growing up in my corner of Florida, there used to be an old gas station on the edge of the Everglades. The proprietor did a lot of business with his oversized, hand-painted warning sign:

Last Chance for Gas.

Beyond the fuel pumps were a thin two-lane ribbon of asphalt and 90 miles of swampy wilderness. No smartphones. No “emergency call boxes.” And, in most places along the highway, no guardrails either.

You were on your own – much like the economic wilderness we’re all forced to navigate today.

Which is why the sharp decline in gold prices and mining stocks is much like that warning sign… and a monetary gift…

In short, if you were waiting on the sidelines after this year’s monster rally, this is your second chance – and, in my view, your last chance – to buy gold at these prices. And it comes at just the right time. Typical Moves for Gold

Gold’s done a full round trip in buyer sentiment during the past 12 months: from being the world’s “most hated commodity” at its lows near $1,050 an ounce 12 months ago to “gotta buy it” status at $1,350 an ounce this summer.

With gold now fallen from those lofty heights, an investor is more likely to ask: “Gold, what have you done for me lately?”

In all, gold’s given back about 60% of its 2017 rally. Yet such sharp declines followed by a resumption of a broader trend higher is a typical early bull market move for this volatile metal. Most famous of these pullbacks was gold’s run to all-time highs in the 1970s.

Starting out at $35 an ounce in the early ’70s, as gold became legal for Americans to own once again, bullion prices soared to almost $190 an ounce in 1975. That’s quite a run all on its own. During the next 18 months, gold prices dropped back nearly 60%, falling to $100 before running to a then-record $800 an ounce in the next three and a half years.

The Song Remains the Same

Most important, when it comes to the companies that dig this stuff out of the ground… nothing has changed.

As I have pointed out in past months, gold mining firms have done a great job getting their costs down and making money to boot.

We noted as early as February that the elite companies in this group were making an average of $215 for every ounce of gold they were digging out of the ground and said, in no uncertain terms, to anyone who’d listen: “Stop panic selling gold mining stocks. Likewise, after cutting dividends in 2014 and 2015 as gold prices plummeted, many of the same companies have not only reinstituted payouts, they’ve started raising them again. In the meantime, mining firms have cleared away much of their old cost structures. That’s why Newmont Mining, as one example, has been able to drop its “AISC” – all-in sustaining costs – from $1,170 in 2012 to $910 so far in 2016.

The point is that there are many reasons to own gold: for speculative profits, as discussed above; for insurance; and for wealth preservation. But you can’t benefit from any of those strategies without taking advantage of the gift that is low gold prices and low expectations put on our table by Wall Street’s hair-trigger traders.

Posted in Uncategorized | Comments Off on The Last Chance for Gold

How Can I Set Up An Online Business?

If you’ve been considering setting up an online business you’ve most likely been motivated by sheer volume of buying and selling that is now taking place on the internet.

More and more people are buying products and services online. And if you set up your own online business you can claim your cut of this expanding marketplace. Here are the 5 steps to follow to set up an online business.

1. Pick Your Market

If you’re going to set up an online business your first task is to determine what type of business it’s going to be. Are you going to sell products or services? You can sell your own products or you can sell products produced by other businesses who will pay you commissions on your sales. Or you may choose to set up a membership website or offer teaching and coaching services online.

Getting a website online isn’t as complicated as you may think. Initially you’ll need to purchase a name for your website (known as a domain name). Next you need to ‘rent’ some space on the internet (known as website hosting). Lastly you’ll need a software package that will make it possible for you to put written text, images, videos etc onto your website. There are many website building programs available that make this whole procedure very easy.

3. Get Visitors To Your Website

When you website is online you have to get potential customers to visit it. There are two main ways to do this. You can use free website traffic techniques or paid website traffic techniques. Both have their pros and cons and the most effective traffic tactic to use a mixture of both.

4. Develop A Customer List

It’s doubtful that your website visitors will want to buy anything from you on their first visit to your website. They may visit your website and never return. But obtain a visitor’s email address with a special email capture form, you can remain contact with them via email. Your emails can keep them informed about your business and encourage them to return to your website. If you offer something of value for free in return for someone’s email address they are more likely to give you their email address. This can be something as straightforward as a free report or eBook that is relevant to your industry.

5. Provide Value

The content material on your website and in your emails, articles or blog posts has to be more than continuously trying to sell. When you provide high quality, useful information to your target audience will come to know, like and trust you. Your prospective customers will then be more willing to buy from you and continue to be as loyal customers for many years.

Posted in Uncategorized | Comments Off on How Can I Set Up An Online Business?

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.

Posted in Uncategorized | Comments Off on 5 New Year’s Resolutions for Busy Families