High CPU usage

Been constantly receiving email from Linode recently about the high CPU usage of my server. Kudos to Linode, even with 100% CPU usage and >20 load average the server was still pretty solid. Though the service response time was definitely slow.

The high CPU usage was from Java so a thread dump was in order, and identifying the busy (maybe too busy) thread followed suit.

I think every Java Dev can do or find out how to do a thread dump. I was surprised that I actually needed more than a few minutes to accomplish that. I want to share a few tips here:

  • Kill -3” works (Google for the command), but if you run Java VM with a designated user, like “tomcat”, make sure run “sudo user …”. Otherwise some error like this will prevent generating the thread dump: “Unable to open socket file: target process not responding or HotSpot VM not loaded”.
  • To use jstack, you’ll have to install openjdk-devel package. openjdk only gives you a JRE installation.
  • top -H” give you the actual thread in each process. Use the thread Id to match the thread in the thread dump result. Make sure convert the decimal value to hexadecimal.

In my case, the culprit was this:

“Thread-12552” #18161 daemon prio=5 os_prio=0 tid=0x00007fdf68117000 nid=0x3c31 runnable [0x00007fdf39d18000]
java.lang.Thread.State: RUNNABLE
    at java.lang.String.indexOf(String.java:1769)
    at java.lang.String.indexOf(String.java:1718)
    at org.apache.commons.lang3.StringUtils.replaceEach(StringUtils.java:4811)
at org.apache.commons.lang3.StringUtils.replaceEachRepeatedly(StringUtils.java:4657)
at com.nexuspad.data….

When dealing with large String my process seems to choke on the search replace operation.

I did come up a quick fix but it’s interesting and a little surprising to me where the problem is. I probably need to come up with a better algorithm instead of relying on “StringUtils.replaceEachRepeatedly”. This is definitely one of the area that Java, by design, hard to over perform C, or PHP.

cpu usage

Evernote’s CEO on Evernote

I think he hit the nail on the head on this comment in this Verge article:

(http://www.theverge.com/2016/5/4/11584764/evernote-ceo-chris-oneill-interview)

…is that it isn’t just information overload — it’s collaboration overload. It’s good that we’re working across borders and functions, and silos are coming down. The bad part is that it’s crowding out to time to actually think, and do what some people call “deep work” — the ability to focus on a task for more than 15, 20 minutes at a time.

There are many useful tools out there that one can try and create a workflow around. However, I think while we are jumping from one tool after another, we are missing the real point of being a knowledge worker. It is that we should learn/train to have the capability to stay focus and come up the most personalized way on dealing with information, scheduling and collaboration, from within ourselves, not by relying on a specific tool or software. Some people can keep everything in his head, which is an absolute blessing; most need some kind of aid to help stay on track, but as far as which hammer can hit your nail better, it’s all up to the individuals, and moreover, it’s secondary.

Evernote is a great tool. I like its hand writing recognition feature and the search functionality works amazingly great. However I use NexusPad for the obvious bias. Everybody sees brilliance in different ways and it makes no difference on selecting one’s favorite productivity tool. The point, however, is that the drive should come from the mindset within, not from a particular tool.

NexusPad for real estate agents

My wife is a full-time stay-home mom and part-time real estate agent. So besides taking care of the kids she helps family and friends on real estate transactions and manage a few rental properties. NexusPad is her favorite tool to help put everything together for her business.

Maintain contacts or leads

A main job of real estate agent is to deal with people and maintain relationship. Clients, contractors and trade associates are all important people to keep in touch so she needs a tool to keep their contacts, and sometimes notes, to help remember them. NexusPad Contact essentially replaced her Rolodex. With folder and tagging, she can group the contacts in different ways so she can easily find the them.

Keep a handy reminder and appointment schedule

She also needs a calendar to keep the dates. This is where NexusPad Calendar comes in. Rent due dates, appointments are stored in the calendar so she stays up to date.

Backup documents

With many paperwork going digital an agent has files to be stored. She has been using NexusPad Doc for backing up her documents.

Save property photos

With the devices so handy today we get a lot of photos for properties. She uploads all the photos to NexusPad by the property address so she can easily locate any photo. It’s pretty fun to check out some “before and after” photos.

There is always things need to be bookmarked

Like many other businesses that have gone online in recent years real estate is no exception. The standard practice these days is to lookup a property online first and then filter out the ones for showing. With many sites available for property detailed information, NexusPad Bookmark is perfect for storing the links to the other sites.

The biggest strength of NexusPad is that everything is together so she doesn’t have to jump over or open several tools to access the different kind of information that she needs. And best of all, she keeps the business information separate from her personal documents so it won’t be accidentally shared on places like Google docs.

If you are a real estate agent that uses NexusPad, please let me know if you have any comments or feedback. I would love to here them!

A roundup on the fantastic opensource Javascript libraries on NexusPad

The UI functionality of NexusPad is both complex and hard to maintain, if done incorrectly. And that is what I used to do. Although I have tried my best to create “home-grown” solutions it was both time and labor consuming.

Now the development landscape is vastly different from years ago. There are more and more mature open-source solutions out there for us to use. With the API Centric Architecture the UI is essentially an aggregation of open source modules. It can be as simple as a small AngularJs directive that just does one thing, or as complex as UI Bootstrap, serving as  the foundation of the UX and UI elements.

However it does not mean we can simply load the libs and call it the day. There is still a significant amount of code to be written. The new challenge on the design is how to write the code that supports modular components – whether it’s open-source or homegrown – and make it easy to integrate, switch and upgrade.

There are so many smart developers doing some fantastic work and I think we owe each other a pad on the back. Below are the goodness that has helped me tremendously.

UI Bootstrap

I love UI Bootstrap. It make things easy. It’s not trying to be everything and it compliments with framework like AngularJS perfectly.

FullCalendar

Fantastic calendar plugin and saved me loads of time to try to come up different kind of views for monthly, weekly or daily events. I used to do that, and only able to come up with some css or styles that is not even close to decent calendar.

Angular Loading Bar

This simple plugin is so easy and unintrusive. A few lines of code adds the functionality globally to the app.

ng file uploader

I used to have some html5 uploader code and ever since I found this directive I haven’t looked back. This uploader simply works great. Pairing with Bootstrap’s progress bar it couldn’t serve me any better.

angular – date range picker

Implementing date picking is hard. The interface needs to handle many little things from blocking selection to localization. This date picker plugin made my life a lot easier.

phone number input (jQuery plugin)  international phone number (angularjs wrapper)

It’s a wonderful plugin for phone number input. With the various kind of phone number format, this is an elegant library for inputting phone number.

ckeditor

It’s truly the best web text editor for everyone. With the powerful and ever improving basic rich text editor and plenty plugins available to download, the ckeditor is the go to editor for NexusPad Doc module.

That’s it for now but the list will go on in the future. If you know something that I should take a look, please drop me a line!

Tax help from NexusPad

The tax season is almost over and this post is not about how NexusPad can help to meet the deadline. I simply want to share some personal tips on using the tool to track your expenditures. If you start doing this, it’ll probably easier to file your taxes next year.

I use Turbo Tax to file my tax every year. It’s an easy tool to use if you are a good record keeper. Since I use itemized deduction I need to provide the spending in the past year for my deductions, in order to do this accurately I use NexusPad Calendar to keep track of my spending. Basically I create a calendar where I enter the item with amount and some purchase details. Since they are dated event, it’s quite easy to find out all the dollar amount I had in the previous year and enter them into the tax software.

With the sharing capability, my wife can also access the calendar and help prepare the tax document.

Although it does require a bit of work to enter the data when the purchase occurs the effort pays off when it’s time to use it.

In the future I do plan to make it even easier to bookkeeping. For instance, using the Dropbox to capture all the receipts and automatically save them to the calendar. Another good enhancement is to be able to export the data into an excel sheet. In this way, the data can be crunched and augmented more easily.

 

How private is your data

I have been asked a few times with this question, which is probably on most people’s mind: just how private is my data?

To be honest I don’t know. In the web we live today it’s hard to define privacy. I think one should give a careful thought on every online service that she is using, with the fact that your data is stored somewhere on the Internet, in a storage at an unknown location, and guarded by developers or engineers who know a few things about technology more than you do.

One thing I do know is that I have absolutely no interest in whatever you save in your NexusPad account. I only care about my own data, and try everything I can to secure it. And I’m well aware that the web can be a dangerous place if we are not diligent and stringent guarding our data.

Also I want to share another point. My vision on NexusPad is not about being an online storage. There are many places with huge amount of space (for free) where you can store your files, photos or any other digital content. Instead, it’s about creating a tool to deal with the influx of information coming to our way. It’s about having a nice habit and a productive workflow to turn information to knowledge, in this digital age.

 

Help me translate

Due to my limited language skill NexusPad only has the English version at this point. If you are interested in helping translate the site, you can go to this page after logging in:

https://nexuspad.com/cms.htm

You can select your language from the drop down at the top right corner of the page. If you don’t see the language that you want to translate, please email me or leave a comment below.

The text on the left of each row is the English copy, and you can click on the text with the dotted line on the right and enter the translation.

That’s it. One all the text are translated I’ll import them to the site.

I wish you can help me!

Sharing with family, friend or team

Sharing information or data online is easier than ever. In fact, sometimes I need to try pretty hard just not to share something – different subject, I digress.

For NexusPad, sharing is also an important feature, with a different kind of philosophy behind it. For most part, NexusPad is a place where you gather information for yourself, which is an effort with an outcome that’s worth to share, maybe. I want to make it an easy task to do, but I don’t want it to be an automatic thing that becomes intrusive.

So one can share any folder/calendar across all modules by opening the folder share and enter the email address. You can also make a folder either readable or writable to the person you want to share to.

How to share a folder

In my household, I share use this feature to share my expenses. So my wife won’t get freaked out when she sees some charges on the credit card that she had no idea about.

There can be many other use cases too. Whether it’s a bunch of interesting bookmarks, notes, or contact Rolodex, sharing can be both handy and valuable among family or friend.

Browser extension update

One user suggested this and I think it makes a lot of sense.

Often times we prefer to clip some content from an online article, instead of bookmarking the whole URL. I have updated the browser extension to make this just a little bit easier.

Basically after highlighting the text, you can right click and select the NexusPad menu to save it into your Doc directly. Just recently get to know about Nietzsche? A little clipping of his profoundness in your NexusPad note is great start.

NexusPad extension for web clipping

Hopefully this little convenience adds a bit more pleasure to your experience.

How I use bookmarking for my guitar lessons online

I have been learning guitar for a while now. I mostly learn using the online tutorials. With the vast amount of information online it’s hard to not find the material for any kind of learning to be honest.

I discovered justinguitar.com when I first started learning. Justin is a greater teacher and guitarist. His website is highly organized and it offers some great online courses for different level of students, for free. And there are also many others teachers. They all have different styles of teaching and I seriously want to go through all their courses if I have the time.

When there are options there is also decisions to be made. None of us has unlimited time to spend on guitar lessons. When it comes to practice, it is important to have a goal and focus on improving the skills that need to be worked on. While checking out different lessens, one has to pick the most suitable one based on interest and online playing, and not to be lost in a sea of information on the internet.

My solution is to bookmark all the videos or courses as I stumbled upon them, and as I made progress, check them out at a later date. And in fact, a lot of them are worth to be reviewed multiple times.

guitar tutorial bookmarking

The bookmarks should be tagged. It gives me an instant idea on what this video is about so I don’t have to waste time figuring out what a particular lesson is for. And it should be prioritized, so that at any give time I can pick the right class to learn or review.

Internet is such a vast space and great resource for learning. As a self-learner, to take advantage of these many options, we need to filter, categorize and constantly consolidate so that we can always get the most suitable content at our disposal. And NexusPad is the perfect tool to help us achieve that.