Spiced Coffee

Boom = Coffee + Cinnamon + Nutmeg

This post is really short, that is because I have lost three different drafts of it. Because every time I sat down to write it, I couldn’t finish it. The I would loose my changes, and start over. Not wanting to chance that again, I will just make it a few line and post.

If you drink coffee and don’t hate cinnamon or nutmeg, then get them together. I have been doing this recently and loving it. Wondering just why I haven’t been doing this before, considering how much I love both nutmeg and cinnamon. What kicked my now over the top excitement of cinnamon and nutmeg in my coffee, was this story on NPR.

My first cup of coffee is usually taken at home. I have been making coffee for years now at home. I might get another cup later in the day, but at home I always have fresh nutmeg and cinnamon. After that story, I tried it without letting my wife knew. She called me up to say something was different about the coffee, but she loved it. If you are gonna try, I suggest using fresh nutmeg. Just get an whole nutmeg, and grate some into your coffee. Don’t hold back with just a few sprinkle of either, go big on the cinnamon and nutmeg.

Dedicated and Designated

I started a new job about eight months ago. Yikes, time really does fly when you are having fun or just busy learning. I still describe myself as being new to the role and even new to the company. In the eight months since I have been there, we have been hiring about twenty to forty people or month. To someone starting last week, I am like an old timer there.

Well, lots more to learn and do. So no time to be bored anytime soon.

One of the titles I carry there is a DSE. Well, I really only have one title the company pays me for. But within the team, we have some more specific titles. My official title is Customer Operations Engineer (COE). Some time people would say Customer Support Engineer, but never call us CSE.

While must of us are in the support organization, and employed as COEs. We do specialize. Some COE are Subject Matter Expert (SME). They get to focus on a very limited set of even just one technology and get good at it. Some others are Back Line Engineer, sort of our second their of support. Finally, there is my even smaller sub-team of Dedicated/Designated Support Engineer (DSE). So why isn’t it settled, dedicated vs. designated. In this case, it really doesn’t matter, it is not really an official title anyway.

DSEs are assigned to specific customers. So instead of taking cases for any customer as the other COEs would do, except BLE and SME who are usually not customer facing. DSE only work on cases for the customer they are assigned to. And they are only assigned to one customer, because that customer pays for that service.

I have been visiting my customer on a weekly basis, usually once a week and sometimes more. But going onsite more than once a week is far in between. After my visits, I would write up a minutes reports of what happened etc. Just so I can remember the engagement and others on the team can follow. Besides, if I am not available, someone can step in or step up and have some idea of what had been discussed.

I usually get home late on the day(s) I visit the customer, so the report is not written that day. Then I may not get to write it for a few days, but need to write it before my next visit. So sometimes, the day before my next visit is when I am trying to write it, so I am not accumulating a backlog. By two days after my visit, I would start forgetting little details.

This week, I decided to do something different. First, I took notes during the day. Just a sentence or two here or there. Then I pushed myself to write the report last night, after getting in. So even though I was still technically working a lot longer, it was easier to write. Since I had notes and it was all very fresh. Previously, I would jot down some notes, but that was usually the next day for later. But then as I started losing details a few days after, the notes would only be so skinny.

The one drawback to writing the report on the same day? Since you remember quite a bit more detail. The report end up being longer.

jHipster, My New Super-Friend

I mess with a lot of things. Well, a lot of programming languages, libraries, apps, etc. Basically, if it something to do with computer, I will try to or eventually try to play with it. Since I don’t have a lot of time, with a day job and trying to fool around with some may things, I do have to pick my battles. Sometimes, I am lucky, and other times not.

Recently, I landed on JHipster. It is a tool, specifically an opinionated stack of applications for creating Single-Page-Applications (SPA) web applications using AngularJS for the client-side and Spring boot (and friends) for the backend.

Nothing in the stack is really new to me. The entire things is bundled up in a nice Yeoman generator called ‘jhipster’. And it uses Node, NPM, Gulp on Node, and of course AngualrJS and Spring to name a few. All of these I have used in my own pet projects and even launch an AngularJS take over at my last job. We had a web app to re-write and there was noway I was going to do it again without some kind of framework. I like AngularJS personally, and people are free to disagree or bicker about the choice. But we need something to help organize the code.

Anyway, back to my new friend. Well, a new friend with all the familiar attributes and characteristics I liked in some other friends. I should really call this jHipster my super-friend.

jHipster take a lot of the tedium you would have to do in any decent modern web app with a db (either SQL or NoSQL) backend, security, monitoring, etc. Really, when you want to write an app, you have your billion dollar idea. You can either spend time doing what you have done before or everyone else have done, the drudge work. Or you can pick up jHipster or something like it, and get to solving your problem.

Now, jHipster is no silver bullet. You will still have to spend some time to learn it. Fortunately, if you read the documentation on their website, you should be through it in about an hour or two and be good to go. Again, depending on your level of familiarity with some of the other technologies in the stack. The you know about the other pieces in the stack, the easier it is to put the jHipster image together.

I have played with many such app stack, like MeteorJS, Deployd, Hapi, Express, and MEAN. I might even have forgotten a stack or two there too. Either way, they all have their strengths and weaknesses.  jHipster is fairly new to the scene, so it is benefiting from fresh smell and fixing a few pain points with some of the earlier ones. But I am sure it is not the last or will it fix everything. The trajectory so far however, is looking really good. It really just what you would have done had you had to write a decent web app using AngularJS and Spring technologies.

Point Not Across

I mentioned recently how a friend proposed that we do some data import by scraping a website. I tried to explain, that that was very difficult, time consuming, and error prone. Well, I didn’t do such a good job of getting the point across. So let me try here, not, again. Hopefully, this should be understandable by both techies and non-techies.

The best way I informed, was to be able to import the data directly from one computer storage to another. For people in computer technology, they would understand this as computer interchange or exchange format. It is best, if data will be produce by one computer for the consumption by another computer, that the data be in a binary or otherwise encoded form. There really isn’t any reason to move data from one computer to another in a human readable format. UNLESS we want to ensure that at some future date, we can still use it.

So writing a program to scrape data off a website. Sure, that is doable, but what would be a lot easier is to just have the data exported. Even if we go for some intermediate format like CSV, JSON, or XML.

As an example, here are three ways of passing the same information between computer:

Example 1: HTML

<html>

<head>

</head>

<body>

<div>

<person>

<name><b>John Smith</b></name>

<age><i>33</i></age>

<ssn><i>011-11-1234</i></ssn>

<dob><i>1982-03-04</i></dob>

</person>

</div>

</body>

</html>

All we really wanted to send was John’s information. Notice all the extra stuff like how it presented, name bolded and the other bit italicized. Yet, quite a bit was stripped out that would usually be there. So if you had to get this data from one computer to the other, why put in all that extra?

Now here is example two, slightly better, using JSON and CSV

Example 2: CSV

name,age,ssn,dob

John Smith,33,011-11-1234,1982-03-04

Example 2: JSON

{“name”:”John Smith”, “age”:33, “ssn”:”011-11-1234″, “dob”:”1982-03-04″}

NOTE: Even if JSON was spread out over several lines, it is still more compact than HMTL.

Finally, here is the same data, encoded in “some” binary form. I won’t go into the details of it. But let’s assume that both sending and receiving computers knew they were exchanging data about a person. Example 3: Binary

 

0a4a6f686e20536d69746801210b3031312d31312d313233340a313938322d30332d3034

It is basically [length:data] repeated. So for example, the number 33 takes up 1 type and is ’21’ in hexadecimal. So you see 0121 some where that run of characters. The name “John Smith”, is 10 chars long, and turning each char into a byte and then their hex value, you ‘0a’ followed by the ‘4a6f686e20536d697468’.

This is certainly harder for a human to read. But it wasn’t meant for a human, not yet anyway. We wanted the most efficient way of passing some data between computers to be processed by computers. And since the binary form only have [length:data] repeated, without the ‘:’ by the way. We only send what we need and save a ton of space and time. Not to mention less opportunity for error in try to parse the data on the other end.

And that is why it is so clear to me that we should be doing things either using Example 2 or 3, but not 1.

More Scripting

Recently, I tried to write a script to parse the output of the log file created by Cloudera Manager. Unfortunately, I had to abandon the script after a week and and quite a number of hours invested. Parsing text is hard. It is not that CM created bad log entries or anything like that. It is just what you might expect in a log, might now be there to make the decisions you want. That was the case for me, the answer I wanted couldn’t be derived easily from the logs.

Fast forward a few days later. My buddy calls me and ask me about scraping website for product info. My first question was, “is this the only option”. If we can engage with the website owner, we can get them to give us access to the products and related tables. Especially, since the project was contracted by the owner of the website.

He said consider, that this is our only option. That getting access to the actual data would mean talking to different teams, and the teams haven’t been responsive so far. I laid out for him, the details of why getting data from the primary source is preferable than trying to parse web pages.

When people look at a web page, they see structure and something that is easy to digest. But they are not seeing what the code looks like. A web page is coded so a browser can render it for the consumption by human, not by machine or another programming language. When developers want data to be consumed by machine or another programming language, it is much more efficient to use binary or some other format. Even if you want it to be human ready. Even JSON, XML, or CSV is not meant to be the presentation format for humans, it just means that it is more open.

What he was asking, wasn’t about even some text interchange format like JSON/XML, etc. but parsing a number of pages for product details. That would be such a nightmare of a project. So here to hoping that we really don’t have to do that.

Looking Up

I really don’t have anything great happened between yesterday and today. But yet, I feel great. May be it is because I laughed so much today.

My colleague was telling me about his life, and I am not going to repeat. But as he talk I was just laughing. It wasn’t anything particularly funny or terrible either. It was just about life and things that could happened to any of us.

Oh well. Here is to keep smiling.

In a Rut

I feel like I am stuck in a rut. I won’t get into details to possibly bore my other self who will read this one day. But right now, things could be very stressful and you didn’t know how to laugh.

Trying to get a house in NC. Dealing with the builder haven’t been the hard part. Getting the loan has been trying, to put it mildly. With my income, credit history, and never had a late payment on my rent, etc. I am almost the perfect person for credit. Taking into account that moving from Cali to NC would reduce just about everything we have to pay for. So again, we will have even more cash available.

Why is the loan process not being managed by humans? Well, it doesn’t feel like it is humans who are making the decisions. We are having so many issues to get a loan. I feel like I am stuck, in a rut so to speak.

Awk Script Dead End

Almost a week to the day, I had to admit to myself that my Awk script won’t take me where I wanted. I had worked on it on an over the week, may be a total of forty hours. I spend just over four hours today before I realized what should have been obvious a few days or hours into the project.

I had a question to answer, and the answer seems to lie in one or more log files. These log file can run into the hundred of thousands of line or even one million. So how to have my question answered without having to looking with my Vim editor and a number of repeated regular expressions?

Enter the idea of a script. A script that would look for a few tell tail patterns. At the end of which, I can say these things happened so this must be the conclusion. Or these things didn’t happen, so something else. It was suppose to be that simple.

I started with a shell script. Found that that with the number of lines I had to read, I would essentially need some way to loop over the files and etc line. Why do that when Sed and Awk already does that. Fortunately, Awk is a lot more flexible than Sed. I guess I could have written it in Perl too. I wanted something powerful, but didn’t want to go down the road of Python or Groovy.

Perl, I dismissed because I had written a lot of Perl code years ago and didn’t want to go back there. It was fun then, but I haven’t had use for Perl since and didn’t want to revisit using it.

I also wanted something I can give to another person to user without much headache. So while most systems have Python, I am not as deft in Python, so it would have taken a bit more time. Oh, I didn’t have much time either. So Awk was going to be it, after I didn’t get more than fifteen minutes into writing in Bash.

It turned out that Awk wasn’t the problem. It was just processing a lot of text and what you might expect to find, may not be there. Since your script is not as flexible as a full fledge language might give you. You really are just looking for a bunch of patterns and reacting. So when something isn’t there that you expect. Well…it all goes South very quickly.

Some of my early testing showed a particular setting of lines. I deduced that if I found those, then I can draw a conclusion or not. When I tested on a later data set. Many of the patterns I had coded for, weren’t even there. Plus my design hinged on finding a start pattern as a marker between distinct events. That was nowhere to be found in some actual logs. Even though, they were there in the test logs I used.

And that is what should have been clear to me early on. That log files don’t always contain what you are looking or what you want. And even when something happened and you thing that everything will be logged so you can go back and tell a story. Sometimes, you just can’t. So now I will just have to go back to using Vim, tail, head, grep/ack, less, and friends. Because writing script to part logs is a non-trivial task, especially in limited scripting language.

A Taste of C

The C programming language was one of the first computer language I learnt. As a matter of fact, it was precisely the send language. My high school offered Pascal programming, and I was taking that. When my my physics teacher at the time, suggested my friend and I learn C. Our teacher was doing his master at the time and said that C is more useful and the future. I am glad I did.

C programming opened a lot of doors for me. Even though I was an electrical engineering student, I still programmed a lot in C. Then I graduated from collected and my first job was as a software engineer. C was a large part of most of the things I did in those early eight years.

I eventually added other languages too, C++, Assembly, Perl, shell scripting, Tcl/tk, Basic and others I don’t remember at different times. C was my constant companion. It has been years now since I wrote any C code. Going on to a solid 3 years without any need to write C. The desire was there, but no work or project.

Until today. A buddy called me and asked if I would explain how functions worked to his daughter. She was in college and taking C. Well, that is surprising, because I thought they stopped teaching C in colleges. Opting mostly for Java and Python. Well, I slipped into coding again like wearing your old favorite pants.

I loved every minute of it. I was having so much fun. That I think I started helping too much on the assign. I eventually got kicked off when my buddy told me that he only wanted me to work on one, and that go out anyway. 🙁 I was having so much fun.

Don’t Know

My company is growing quickly and looking for great talent to do so. I have been helping out with interviews. Two things stood out recently that I don’t like. The two things stems from one thing. Not knowing.

Don’t Know – Looking It Up

I have people who didn’t know how to answer questions on the phone interview, look it up or tried to at lease. I can hear them in the background furiously typing as they either silently stalled for words or use fillers as they search. If a person knew something, but forgot, it is very clear from their response. Versus someone who doesn’t know, but is trying to look it up. When they find what they are looking for, they try to regurgitate what they just, and it doesn’t make sense to them nor you. And they soon figure that out and just give up.

Don’t Know – Let Me Interrupt

The other kind of person is the most annoying to me. The first type try to trick you, but if they can’t figure out or find he answer, they will eventually come clean. The one tells you up front they don’t know. But soon as you start explaining. Suddenly they know, and must interrupt you. Of course, they still don’t know, but insist on interrupting. Then goes of an tangent. Instead of staying quiet to hear what you have to say and then ask questions or make suggestions as in any normal conversation. They don’t do that. They feel the need to jump ahead of your conclusion. Always interrupting to finish your sentences.

I just don’t get either of these people. If you don’t know, you don’t know. No one knows everything. I guess it irks me because I don’t know why it isn’t apparent that they are not fooling anyone.