Tesla Model 3 pre orders have begun in Australia

Tesla’s Model 3 is here!

According to several articles (here is one)  I see on Reddit, Tesla is now taking pre-orders for its new car, Model 3. This made me think.

Around 40 years ago people in the soviet bloc were given the chance to own this really cool new car, the Trabant. The trabant was nothing particularly mind-blowing as far as engineering or design goes, but in a world where owning a brand new car was a big deal people still lined up to reserve a new Trabant. All you had to do was to wait before the store, put down some money, and wait for your new car. Sometimes over a year.

Around 40 years after the first Trabant came out Tesla announced a new line to its prestigious cars, the Model 3. The Model 3 is geared towards those who can’t really afford to spend $100K on the original Tesla cars. No one really knows the specs of the Model 3, and it won’t be available until end of 2017. And yet, people lining up starting today. All they have to do is to wait before the store, put down some money, and wait for their new car. Likely over a year.

My point being…

Curious how history repeats itself, is it? Sometimes my Social Science background kicks in and I can’t help but draw analogies between two occurrences, like Trabant and Tesla. The Western worlds have always spoken with such low opinion of the Soviet-era, they completely miss to draw a parallel between our current world and what it was just 40 years ago. 40 years! Don’t get me wrong, I don’t advocate for communism. Those who consider themselves experts of Social Science and History agree that so far none of the socio-economic models were deemed successful over the course of humanity’s history. Communism, socialism, capitalism – these are mere attempts at organizing the world’s economy. And as you can see, at the end of the day it doesn’t even matter what we call them – they are quite the same after all.

Syrian refugees in Hungary

I’m reposting an  article from the New York Times, because I am truly ashamed with my country of birth’s behavior.

The American mass media and social media seems to largely ignore the issue, aside from a few paragraphs here and there on Reddit. This is just not a top concern in the States right now, but in European media is is THE TOPIC. I’ve been seeing discussions on Facebook between my Hungarian friends. I’ve been reading the news on Hungarian portals for quite a few weeks now, too, sometimes with some addition from the Guardian or the German media. The stories from refugees, the pictures are overwhelming, I would silently cry reading them, tears running down my cheeks. My mom was crying too, when I spoke with her over the phone. ‘I went for coffee in the morning, when I saw them, marching down the highway,’ she says, her voice would then break and she would stay silent, trying to regain control over her feelings.

I feel pride and shame. These people have been walking through a half a continent for a better life. Nothing could stop them, their behavior sets an example for all of us. We pity them, but in fact they are better than us. I feel immense pride just thinking about their bravery.

And I feel shame for Hungary for what I have been reading in the media.

The below are excerpts from NY Times’ memoirs from a reporter who has been following the Syrians. The quotes are found under the September 5th entry, titled Why Migrants don’t want to stay in Hungary?

When asked, the migrants now stuck at a train station in Budapest say that they put Hungary in much the same category as Macedonia and Serbia, the Balkan countries they passed through on their journey. They see Hungary as having a thin veneer of prosperity, but being fundamentally relatively poor and still developing. And Greece, though developed, is in economic crisis.

Like many Syrians, they maintained a sense of decorum by removing their shoes before sitting on their blanket. […] They said they resented being called eyesores and being blamed for trash. This was not their true nature, they said.

“We’ve been through all these countries, this one is definitely the worst,” Mr. Darwish said, sounding like a lawyer. “It is supposed to be an E.U. country, but it has broken every single tenet they had. Greece is such a poor country, and it treated us better.”

And meanwhile, on the border between Hungary and Serbia, from the entry titled Hungarian Police Spray Family Trying to Cross Border:

Once again, the group walked into the ditch before the barbed wire. A woman in a straw-colored bonnet and carrying an 18-month-old infant led the way.
She was only a few inches from one of the police officers when he sprayed something at the group. A fine mist glittered in the light above the woman’s head. For a moment only the child’s cry could be heard before the scene devolved into chaos. Those in the ditch scrabbled back up to the Serbian side, screaming in apparent pain as they coughed and gagged.
The Hungarian officers remained quiet. A few minutes later, they climbed into the car and drove off.

 

Setting database to trustworthy will let you deploy assemblies in unsafe mode

The title says it all, but let me expand on this a little bit.

I have an assembly that I wanted to emulate in SQL server. The first, obvious choice is to use safe mode, which results in the following message:

Msg 6212, Level 16, State 1, Line 2
CREATE ASSEMBLY failed because method ‘x’ on type ‘x.x’ in safe assembly ‘x’ is storing to a static field. Storing to a static field is not allowed in safe assemblies.

Be quiet my racing heart. Sassy SQL Server be sassy. So evidently I’d go ahead and deploy it in unsafe mode, just so that we can run into another error message:

Msg 10327, Level 14, State 1, Line 2
CREATE ASSEMBLY for assembly ‘CTXCRMEncryption’ failed because assembly ‘CTXCRMEncryption’ is not authorized for PERMISSION_SET = UNSAFE. The assembly is authorized when either of the following is true: the database owner (DBO) has UNSAFE ASSEMBLY permission and the database has the TRUSTWORTHY database property on; or the assembly is signed with a certificate or an asymmetric key that has a corresponding login with UNSAFE ASSEMBLY permission.

SQL Server is actually trying to help in her quite, sassy way here, so let’s give her what she wants.

ALTER DATABASE databasename SET TRUSTWORTHY ON;

And now we can emulate the assembly in unsafe mode. I wish I had known that sooner.
I wish I had known that

SSIS – SQL Server data type

This blog post here on BI Developer Network contains a nice list on data conversion between SSIS and SQL server, something that gets my blood pressure going due to SSIS’s ‘check your metadata’ error message. Good cheat sheet that list the data types.

 

SSIS Data Type

SSIS Expression

SQL Server

single-byte signed integer

(DT_I1)

 

two-byte signed integer

(DT_I2)

smallint

four-byte signed integer

(DT_I4)

int

eight-byte signed integer

(DT_I8)

bigint

single-byte unsigned integer

(DT_UI1)

tinyint

two-byte unsigned integer

(DT_UI2)

 

four-byte unsigned integer

(DT_UI4)

 

eight-byte unsigned integer

(DT_UI8)

 

float

(DT_R4)

real

double-precision float

(DT_R8)

float

string

(DT_STR, «length», «code_page»)

char, varchar

Unicode text stream

(DT_WSTR, «length»)

nchar, nvarchar, sql_variant, xml

date

(DT_DATE)

date

Boolean

(DT_BOOL)

bit

numeric

(DT_NUMERIC, «precision», «scale»)

decimal, numeric

decimal

(DT_DECIMAL, «scale»)

decimal

currency

(DT_CY)

smallmoney, money

unique identifier

(DT_GUID)

uniqueidentifier

byte stream

(DT_BYTES, «length»)

binary, varbinary, timestamp

database date

(DT_DBDATE)

date

database time

(DT_DBTIME)

 

database time with precision

(DT_DBTIME2, «scale»)

time(p)

database timestamp

(DT_DBTIMESTAMP)

datetime, smalldatetime

database timestamp with precision

(DT_DBTIMESTAMP2, «scale»)

datetime2

database timestamp with timezone

(DT_DBTIMESTAMPOFFSET, «scale»)

datetimeoffset(p)

file timestamp

(DT_FILETIME)

 

image

(DT_IMAGE)

image

text stream

(DT_TEXT, «code_page»)

text

Unicode string

(DT_NTEXT)

ntext

 

Credit goes to their user, DevinKnight.

 

DBCC DBReindex

I ran into some ‘Message 823’ issues on my development DB, and upon running DBCC CheckDB() I saw that my indexes were the ones throwing the errors.
I got this handy cursor from SQL Server Performance, and decided to save it here for me, and for you, so that I don’t have to search for it over and over again. The script by the way is from the talented Brad McGehee, and I suggest checking out the article because it has more information and more cursors for failing indexes.

Without further ado:
USE DatabaseName –Enter the name of the database you want to reindex

DECLARE @TableName varchar(255)

DECLARE TableCursor CURSOR FOR
SELECT table_name FROM information_schema.tables
WHERE table_type = ‘base table’

OPEN TableCursor

FETCH NEXT FROM TableCursor INTO @TableName
WHILE @@FETCH_STATUS = 0
BEGIN
DBCC DBREINDEX(@TableName,’ ‘,90)
FETCH NEXT FROM TableCursor INTO @TableName
END

CLOSE TableCursor

DEALLOCATE TableCursor


Conclusion: you, too, can fix your indexes with a cursor now.

Ebola

I have quite a few friends living in Liberia. They have been posting about Ebola for two months now.
Today a patient died in a hospital in Texas and the US is losing their shit. Mind you, in the meantime more than 2K people died in Liberia.

Fox News, of course, is creating the hype already. That Ebola could be smuggled from Mexico and be used as a bio weapon. That dead bodies are lying around on the streets of Sierra Leone. That it’s Obama’s fault. Or not Obama’s fault, I don’t fucking know, okay?

While you can prevent the whole outbreak if you wash your hands and stop getting into contact with those having Ebola. You will recognize them from the blood coming out of their… you know. Everywhere.

So, let me copy here what my Liberian friend said today, and maybe all of us can STFU for a second and be happy that we’re alive.

If it is not in their shoes, they don’t care.
People in the affected coutries die like animals. It is scary. U live like the next day u will be dead.

It is like a horror movie.

Baltimore Ravens, you piece of shit team

Ray Rice knocks out her fiancee in the elevator, and this is what the Ravens have to say in their official statement:

Then the video got leaked, and their first reaction was to decline seeing it before. Really, ravens, really?!

Then people started to voice their opinion, and the story blew up in the Ravens’ face. If you want to read some beautiful tweets (they really made my little heart beat faster), proceed to the Washington Post’s article here.

And then, finally, the Ravens reacted:

Ravens, you fucking piece of shit team, I pity you. You are a disgusting entity, and I have no respect left for you. If you were a person, I would go out of my way to find you in a dark alley.