The financial crisis of 2007-08 was largely a result of legislative changes to the Community Reinvestment Act, namely the Gramm–Leach–Bliley Act. These policy changes essentially made it easy for us to heavily leverage our some of our assets, namely housing. The result was a bubble in home values. What goes up must come down (usually), and the rest is history.
After the 2008 market crash many folks pointed to various stock market cycle theories, demographic theories, various patterns, etc. They began making predictions. Online postcasting prophets appeared out of nowhere, foretelling of certain woes in the years to come.
At this point, it's safe to say that most of them were wrong, since tomorrow is the last market day in 2017 and most predictions I read fell into the range of 2014-2017.
We can all stop worrying, because none of these guys knows what they're talking about. When it comes to the future, only one thing is certain: the market crashes on 08/09/2019.
Cheers.
]]>The Golden Rule, the maxim of the human kind; Do unto others as you would have them do unto you3.
The Golden Rule is a virus that replaces our empathy with the self-centered drive to do that which we see as fit for others. I won't just suggest that Emanuel Kant, Karl Popper, et al potentially had similar opinions. Instead, I'll prove to you, a priori, that the Golden Rule is not very golden at all.
If A wishes to be treated with Y, A should treat B with Y
A wishes to be treated with Y
Therefore, A treats B with Y
Given the above example, was B treated how B wanted to be treated4?
Footnotes:
Perhaps you have a profiles
table with 5-10 really specific columns (e.g., blog_url
, pet_name
, favorite_framework_1
, favorite_framework_2
, etc.) with empty values in half the rows? Or, maybe you're a purist like me and you've just left some features out to avoid bloating your tables.
PostgreSQL 9.4 adds the jsonb
data type[3, 4]. Now you've got one of the great features of Mongo, et al – the natively supported ability to store and efficiently query data in a valid JSON format – and you can attach it right to a table in an ACID compliant database.
Django 1.9 (alpha release is in roughly 1 week) adds support for Postgres's new jsonb
data type via JSONField, and that's a bigger deal than you'd guess based on the quick mention it gets in the release notes.
In fact, it's amazing:
Profile.objects.create(Before
name='Michael Angeletti',
info={
'languages': [
{
'name': 'English',
'level': 'native'
},
{
'name': 'French',
'level': 'un peu'
}
],
'websites': [
'http://orokusaki.posthaven.com',
'http://stackoverflow.com/users/128463/orokusaki'
],
'city': 'Jupiter'
}
)
JSONField
, the above example would require language
and website
tables and a Profile.city
field to be as robust, and the city
field would probably remain empty in most rows anyway. HStoreField
was added in Django 1.8, but hstore
only supports strings (e.g., a list of websites) and you can't nest values. In the above example, HStoreField
covers the Profile.city
case, but not the others.JSONField
to store payment transaction data (e.g., from Stripe), had it been available, but in the shopping cart I probably wouldn't have stored something like an address in this way, since an address is a predictable format. Other things a hosted ecommerce app could use this for are configuring settings for a merchant (e.g., site title, colors, etc.).jsonb
support handles serialization, deserialization and validation for you, the real magic is in the ORM's query support for this new data type:>>> Profile.objects.filter(info__city='Jupiter')]]>
[<Profile: Michael Angeletti>]
>>> Profile.objects.filter(info__websites__contains='http://orokusaki.posthaven.com')
[<Profile: Michael Angeletti>]
>>> Profile.objects.filter(info__languages__contains={'name': 'French', 'level': 'un peu'})
[<Profile: Michael Angeletti>]
>>> Profile.objects.filter(info__languages__contains={'name': 'French', 'level': 'expert'})
[]