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

Private Jet Detailing And Aircraft Cleaning Entrepreneurs Have Good News

The general aviation sector has been in the doldrums for quite a while. Some blame this on increased FAA (Federal Aviation Administration) regulations, much of which occurred after 9-11 to protect airports from potential terrorists, unfortunately these increased security requirements and increased regulations have stifled the general aviation (GA) sector. The economic crashes of 2000 and 2008 didn’t help, although in 2003 the economy was flying high thanks to Bush Tax Cuts and stimulus, then it hit a wall again and didn’t really do well until the run-up just before the 2008 crash.

The GA sector has only slightly recovered since then but not back to its 2003 highs. When Obama got elected he railed against Corporate Jets and Corporate Fat Cats which hurt jet sales and new aircraft sales. Remember when congress went after the Auto Makers for flying their corporate jets to Washington DC to beg for bailouts? Public sentiment against GA was at an all-time low. All of this had hurt aircraft cleaners and jet detailers – it made it tough to make money, but it looks like things are changing and the number of GA Aircraft is increasing. This new Trump Administration is pro-Aviation unlike the Obama Administration. Cutting corporate taxes will also help GA and jet sales. It looks like clear skies ahead for those in the General Aviation services business.

There was a great article in AIN – Aircraft International News – December Edition titled; “UBS Bizjet Index Sees Post-election Surge,” by Chad Trautvetter posted on December 12, 2016 which noted the following facts; The new Trump Administration in the U.S. is widely seen as a positive, with 61 percent of those surveyed expecting the outcome of the U.S. presidential election to ultimately be positive for the business jet market, while 11 percent don’t see a positive impact and 28 percent are uncertain. In fact the article went on to note that there was an increase of between 44-49% increased orders for private jets over last year. Many of those aircraft will be delivered by 2018, and the backlog will increase used aircraft sales and current new inventory. More aircraft certainly means more aircraft to clean and more new aircraft means more corporate detailing customers as well. Meanwhile, along with the fractional jet market, we see jet air-taxi services on the increase as well as Uber style aircraft ride-sharing plans smaller companies can buy into. All of this means the GA sector is ready to take off again and that’s good for business.

Posted in Uncategorized | Comments Off on Private Jet Detailing And Aircraft Cleaning Entrepreneurs Have Good News

The Future of Android Games, Virtual Reality & Augmented Reality

Mobile gaming has come a very long way since the introduction of crude & simple games like Snake and Pong which were available on early Nokia phones. Mobile processors and graphics are now as powerful as desktop computers were just a few years ago. Older generations still remember lugging around a Game Boy or Game gear and begging their parents for another game. New generations literally have access to 100’s of thousands of games on their mobile device.

In short, mobile gaming has exploded in just a few years time. In the month of July 2016 there were 63.1 million arcade games downloaded & games in the “strategy” category generated $195M revenue. In a recent study over 37% of mobile app users with 30 minutes of free time choose to play games over any other activity. We’ve all seen it and we’ve all done it ourselves, whether its waiting for an appointment or sitting at the airport, we pull out our mobile device and jump into a quick game to kill the time.

So what does all of this mean for the future of android gaming? For starters, the massive amounts of revenue and user interest in android gaming has bolstered continuous innovation and fierce competition in the global marketplace. For example, just 12 months ago, top executives were saying they didn’t see any major benefit to augmented reality. With the release of Pokemon Go and estimates citing as much as $500 million in revenue in just 60 days, I think we can all agree augmented reality is here to stay. Virtual reality is another area that has been picking up steam in recent months. You can now buy virtual reality headsets at local gas stations for a mere $30. Or if you’re on a budget you can purchase Google Cardboard for as little as $7.00. There are still only a limited number of VR enabled games but that number is increasing daily. Not only that, as more and more people experience VR we are sure to see a blockbuster release sooner or later.

Let’s take a look at some real life examples of recent game releases. Dawn of Titans which was recently released on Google Play was in development for over 2 years. This is akin to the development cycle of a mid-level PC game release on Steam. The game features mass controlled troops, world building elements and impressive graphics. A few years ago this would be considered a major release for the Android platform. These days this is just another drop in the massive pond. With over 2.4 million apps and games currently listed on Google Play it’s become harder and harder to stand out. This is actually good news for gamers as developers are working harder and faster to create new innovative titles to attract users.

I firmly believe that both Virtual Reality (VR) and Augmented Reality (AR) titles are going to gain more traction in 2017. Major developers who can pump out triple A content can’t be left in the dust while indie developers pump out AR and VR enabled games. They will be forced to port existing titles and come up exciting new ways to interact with the mobile devices.

There are many gimmicky games available that utilize the phones microphone, gyroscope, camera and accelerometer. However, these sensors combined with AR and VR could bring a whole new experience to gamers. Imagine walking through a recreated 3D world that represents your neighbourhood, immersed in full virtual reality, and using your phone as a targeting device to defend against waves of zombies. This is already possible with the technology that is available, it just needs to be packaged in a user friendly way that people can enjoy. Combining meticulous graphics with well thought out virtual reality experiences would be impressive indeed. If you’re familiar with PC based virtual reality demo’s you already know how immersive the experience can be. It’s only a matter of time before these same experiences make their way to our mobile devices en masse. And to think, only 30 years ago we were playing Mario on our beloved Nintendo consoles. Let’s not even mention the Virtual Boy that burned your eyes after 2 minutes of playing tennis. Android games and mobile games in general have come a long ways since then and they will continue to push barriers even further in the near future.

Posted in Uncategorized | Comments Off on The Future of Android Games, Virtual Reality & Augmented Reality

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

Less Than 1,000 Days Until the Next Total Solar Eclipse in the United States

On Monday, August 21, 2017, a total solar eclipse will be visible in some areas of the United States. This is now less than 1,000 days away. The event has been a long time coming. While the last total solar eclipse to be seen in the United States occurred in 1991, that event was limited to Hawaii. Before that, the last solar eclipse visible from the continental United States was on February 26, 1979.

While the 1979 event tracked across Oregon, Washington and Montana, people in 12 states will see the 2017 event. Both eclipses started in Oregon. The earlier one then tracked up into Canada. The 2017 eclipse starts in Oregon, travels across the central United States before finishing far out to sea beyond South Carolina.

A total solar eclipse is a rather rare occurrence. Estimates place the likelihood of any point on Earth experiencing one only every 400 years. This is not absolute, however. Several Oregon locations saw the 1979 eclipse and they will see the 2017 event as well. For them, experiencing two solar eclipses in a little more than 35 years is quite unusual. Closer yet are the cities of Carbondale, Illinois, and Cape Girardeau, Missouri. Residents there will see the 2017 eclipse as well as another in April, 2024. This separation of less than seven years for these two eclipses is very unusual. Of course, it may be hundreds of years before these cities see another.

To be a total eclipse, the moon must completely obscure the sun, for an observer standing on Earth. This can occur monthly, at New Moon. Ordinarily, however, the moon passes either above, or below, the sun’s position, as viewed from Earth. As a result, the moon’s shadow normally sweeps across open space. On rare occasions, as the moon passes directly in front of the sun, a shadow is cast upon the surface of the Earth. If the sun is partially obscured, a partial eclipse results. If the sun is completely obscured, a total solar eclipse occurs. The moon is much smaller than the sun, of course. In fact, the moon is some 400 times smaller. In an astronomical twist, the moon is also 400 times closer to the Earth. This makes the apparent size of the moon very close to the apparent size of the sun. When the moon passes directly in front of the sun, it is able to completely eclipse the sun, for some viewers on Earth.

The shadow cast by the moon, however, is very small. Depending on the distance between the Earth and the moon, which varies somewhat, the moon’s shadow will darken a strip of Earth about 70 miles wide. This strip is called the Zone of Totality. Those people located within this zone will experience a total solar eclipse. Those near, but outside, will see a partial solar eclipse.

On August 21, 2017, the sun is eclipsed for as much as 2 minutes and 40 seconds at the maximum point. Hopkinsville, Kentucky happens to be located at this point. People not located there may see a shorter eclipse duration. Those located outside the zone of totality will only see a partial eclipse. Some cities that will experience totality include Nashville, Tennessee, Kansas City and St. Louis, Missouri. The 2017 eclipse will potentially be seen by millions of people located across the United States.

Each total solar eclipse is unique, but there are similarities. The Earth will darken over time as the moon obscures more and more of the sun. This is the partial eclipse phase. As totality approaches, the amount of sunlight striking the Earth will be greatly diminished. The sky will become similar to twilight. Colors normally seen at sunset will be visible during the day. Birds, animals and insects will be fooled into believing that night is falling. Some will return to their nests or roosts. Nocturnal creatures will begin to emerge. These effects often happen even if a total solar eclipse occurs early in the morning. After totality ends, another partial eclipse phase occurs until the moon passes beyond the sun’s location.

The biggest factor that cannot be predicted with certainty is the weather on August 21, 2017. Cloudy weather could obscure the eclipse for interested observers. As a result, many people examine historical weather patterns in order to determine prime eclipse viewing locations. Since the 2017 event occurs in August, there are some rather promising weather possibilities. In Oregon, the August weather tends to be sunny and dry, perfect eclipse conditions. Morning fog, storms, or clouds, could thwart eclipse viewers, however.

Idaho and Wyoming residents will also experience the 2017 eclipse. The weather in these states could allow a very good eclipse viewing experience. The eclipse occurs fairly early in the day, lessening the possibility of localized thunderstorms.

As the total solar eclipse tracks across more states, from Nebraska to South Carolina, the possibility of inclement weather increases. These locations will experience the eclipse later in the day. Afternoon storms, or hazy weather, could be encountered. Such weather could limit the eclipse experience.

Many US cities have already begun planning for the August 21, 2017 total solar eclipse. The event represents an opportunity to entertain tens of thousands of visitors to cities located within the zone of totality. With proper attention to details, cities can provide a favorable eclipse experience that also highlights the attractions of the local area. Weather permitting, of course.

Bonus Facts:

– the distance from the Earth to the moon increases each year. In less than 1.5 billion years, the moon will not be close enough to produce total solar eclipses. After that, only partial or annular eclipses will occur.

– when the moon eclipses the sun, the sky darkens enough to allow planets and bright stars to be seen in the daytime. On August 21, 2017, the bright star Rigel should be visible low in the south. – Albert Einstein predicted that a total solar eclipse could provide direct proof of the General Theory of Relativity. He postulated that the eclipsed sun would cause light to be bent, for an observer on Earth. This would be proved as stars located behind the sun would appear to be shifted in location. This visual evidence was demonstrated during an eclipse in 1919.

– as the moon passes in front of the sun, it blocks enough sunlight that the solar corona, the super heated atmosphere, becomes visible to people on Earth. The shape of the corona is different during each eclipse as it is influenced by the level of magnetic solar storms, which constantly changes.

– ancient civilizations did not understand the science responsible for total solar eclipses. Eclipses were attributed to supernatural causes and thought to be bad omens.

– the theoretical maximum duration of a total solar eclipse is about 7 minutes. The 2017 eclipse is less than half this duration, at 2 minutes, 40 seconds for those located in Hopkinsville, Kentucky.

– the sun is not safe to view during any portion of the partial eclipse phase. Even if only 1% of the sun is visible, observers risk damage to their eyes through direct observation. At this eclipse stage, the sun appears to be dim enough to view. Unfortunately, the lit portion still transmits full force sunlight to the optic nerve. Because the level of light is so much lower than normal, the observer feels no urge to avert their gaze. Moreover, the optic nerve does not contain pain receptors so victims are unaware that their eyesight is being damaged. Proper eye protection is vital for all observers of the partial solar eclipse phase.

Posted in Uncategorized | Comments Off on Less Than 1,000 Days Until the Next Total Solar Eclipse in the United States