Thursday, January 30, 2020

Exercise (241) Taking fitness in my youth for granted

While I was starting to do sit-ups again today, I was thinking how difficult it was for me to do just 20. I was still able to do 20 without break and at a reasonable pace, but I was definitely near my limit. While I was at 10, I was just thinking how easy it was to do 100 before high school. I remember thinking how useless this exercise was, and never thought that it could be difficult for others. I thought people were just lazy and find excuses not to do them.

Now even doing a single push-up is a struggle for me. I have always been weaker with push-ups. In my  youth, push-ups were my weakest exercise where there was a limit on the number of push-ups, maybe 50.

7 minute mile was considered kind of slow, now I struggle with a 12 minute mile. I even now notice that my reflexes are slower.

But there is still hope because I still see people easily twice my age run faster and longer. My father can run marathons yearly. So I am slowly changing my lifestyle to be more fit. Life has made it a little difficult lately, but still on my mind.

Today, I had a sudden drop in my weight, 3 pounds. I am not exactly sure why as I had been maintaining 243-244 pounds for the last couple weeks. I think eating less/healthier and evening walks every other night have lowered my weight a little bit, but then I was adding weight by drinking more water at night so I didn't notice my weight loss. Last night, I didn't drink any water. Anyways, I hope this is good news and not something else. I feel physically normal.

Wednesday, January 29, 2020

My Thoughts: Learning Linux is hard (from Microsoft products) but worth the price?

The amount of information that is purely leaking out of my head as I write this article is just ridiculous. I just finished configuring Django/Python, Debian, Apache, MariaDb (after PostgreSQL), Google Cloud, PuTTY, DBeaver, Eclipse, and Git from scratch (no knowledge). That experience was so very tedious.

If I were to do this again, I would have learned Java and MySql first. The rest are fine. The biggest hurdles was reading documentations for MariaDb which some doubles from MySql. This worked for the most part, but in some rarer instances, MariaDb has kind of split from MySql. So, I spent a lot of time following directions that didn't work. Django was an added layer too because I was not sure if it was Django configuration or an Apache configuration. I think by going with Java and MySql, I would have one less layer of technology to figure out where my problem was.

Another hurdle was that I was working of a Windows system while configuring these technologies on Google Cloud. Of course, I also went with Debian without the GUI so I had to learn all the terminal commands. I did not setup a comparable environment on my machine so I had to upload to Google Cloud to test things. This of course meant that I had to figure out how to connect PuTTY and DBeaver to Google Cloud.

Visual Studio may be a good alternative to Eclipse and DBeaver. That I am not sure would have been easier or not. From my experience most people in this tech stack typically use Eclipse. I am not so sure about DB IDE.

Compared to my experience with Microsoft products, this was much much harder than learning MS products. Wizards, tutorials, how-to instructions, etc. were all levels easier to focus on the configurations that needed to be changed. MS definitely got my up, running, and programming within the same day. This took me about 3 weeks only weekends and some nights, so maybe equivalent to 10 days of actual work. Either case, way longer than it took for MS. Maybe this is a sign of my age...

As for pure learning curve goes, MS is way easier and faster.

As for performance, empty shells of a project is already way faster than empty MS projects.

As for price, MS is way too expensive.

In conclusion, there are pros and cons to both. As a person that wants to make decent wage to effort, learning non-MS product is worth the price as they are paid more in general for similar jobs. Good MS developers can still be paid well in higher tiers but there are fewer available openings and more lower quality developers vying for the same role plus managers who cannot recognize good talent.

Friday, January 24, 2020

My Thoughts: MySql or MariaDb for Beginners in 2020

MySql for learning purposes.

Go with MariaDb when you have more experience with MySql. Most things you will need are supported by both DB. Once you have more experience, you can move onto MariaDb if you believe that is a better option.

One of the biggest reasons is that there is more resources available for MySql. Most MariaDb refers to MySql, but it seems to be starting to branch a little. 

Another big reason is the a graphical interface, GUI, or IDE. Most are not free for MariaDb. Although some articles say that you can use MySql, there are also recent articles that state that MariaDb is starting to not work or less stable. From personal experience, I have had no problems with DBeaver with MariaDb.

Wednesday, January 15, 2020

Unknown Knowns: Parsing Names (2010 list by McKenzie)

I have attempted to parse names before, so this was an interesting read. I did kind of know about complexity of input restrictions to names, so I did not spend a lot of time working on that much. I did try to create a program to detect first names, common names, family names, etc. I probably spent an entire day just reading a plethora of articles on different cultures of names. Essentially, I never got around to even starting one. For most systems that I build now, I just use a display name. User enters their own first name and last name which most of my applications don't require but is sometimes required for third parties especially for payments.

https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/

Friday, January 3, 2020

Unknown knowns: Postgres Boolean Column Default Value

I am new to Postgres and I was trying to default a boolean column to true or false. But kept getting an error:

ERROR:  column "ColumnName" is of type bit but default expression is of type boolean 
HINT:  You will need to rewrite or cast the expression.

I tried using values 1, true, TRUE, and 'TRUE'. None of these worked.

Solution

ALTER TABLE public."_TableName" ALTER COLUMN "ColumnName" SET DEFAULT '1';


According to what I can find online, the other values should have also worked. At first, I thought maybe DBeaver was causing the problems but I get the same error when I run the same command to the VM. I do not know why this does not work. Link 1 shows that TRUE should have at least worked.

Reference

1 - https://www.postgresqltutorial.com/postgresql-boolean/


Thursday, January 2, 2020

Unknown knowns: Postgresql (psql) Case Sensitivity Borderline Buggish

I could not find much literature on why POSTGRESQL is case sensitivity is no consistent. Obviously, it can be worked around but not very intuitive to someone new to Postgres but is experienced with other databases.

My "problem" with Postgres in my first hour was creating a table and querying the table. Postgres forces lower-case on the table name when creating if no double-quotes are used. But when you query the table, the syntax is case-sensitive so will not find the table because they are not the same cases.

Most literature I read just explains that this happens. Some argue that this is not a case-sensitivity issue, which I suppose is kind of, maybe technically true. But seriously, if I type in any language:

CREATE TABLE AbcDef

I would most definitely think that, "SELECT * FROM AbcDef", should most definitely work whether the system records the table the same way I named it.

I am just saying even if Postgres lower-cased AbcDef to abcdef, it should also search for table abcdef when I query by AbcDef. And if I really want it to be AbcDef with double-quotes, then I use double-quotes in my query. And this is why I think this is kind of buggish.


If it weren't for me trying to gain some experience with Postgres, I feel this is probably enough for me to start gaining more experience with MySql. Although the object-oriented portion is a bit intriguing.