@TobiasTernent

GitHub: Tobias-Ternent

Sunday, 7 January 2018

ASUS Transformer 3 Pro

Last year I bought a new convertible 2-in-1 laptop, the ASUS Transformer 3 Pro T303UA to replace an old laptop form long ago. I chose this particular make and model because I was wanting something affordable, small, portable, with a stylus pen for note-taking. The Microsoft Surface Pro was the best-marketed style of laptop but I felt it was too expensive (keyboard extra, stylus extra). The same goes for the iPad Pro which doesn't offer a full OS experience (iOS not macOS).

After using my device for a few months now, which is the i5, 4 GB RAM, 256 GB SSD variant, here are my pros/cons.

Pros:
  • Good price.
  • Great connectivity:
    • USB 3 port.
    • USB C 3.1 thunderbolt port (charges via this port too).
    • HDMI out.
    • SD card reader.
  • Included keyboard and stylus.
  • Stylus works great.
  • Good screen resolution and brightness (though average with glare due to it being glossy).
  • Fast to boot and launch applications.
  • Great for reading technical books, watching media, browsing, etc.
  • Not too heavy for what it is.
  • Linux (Ubuntu) works well.
  • 4 GB RAM is good enough for basically all tasks including programming through an IDE.
  • Easy infra-red camera facial login.
  • Good web cam position, good enough for web chats.
  • Rear camera. Although poor, at least you have one.
  • Decent stereo speakers.
  • Good kickstand.
  • Audio jack (I know, right?)
Cons:
  • Poor battery life (2-4 hours of use in battery-saver mode).
  • The metal back and sides scratch ridiculously easily.
  • Since it's not popular, basically no silicone or rubber cases are available.
  • The touch-pad isn't good (I don't think any are).
  • Limited to SATA SSD speeds (not NVMe).
  • Zero options to upgrade (i.e. impossible to upgrade RAM, battery).
Of the cons, the only thing that really bothers me is the poor battery life. That means if I'm being mobile say in a coffee shop, I really need to plug-in even if I'm just browsing. Otherwise if I forget, then my battery will go right down. It's a hassle more than anything, and a fact of life that you just need to accept - this isn't an Apple product with fantastic battery performance.

I would love to have the functionality to add more RAM in, which I can't because it's soldered, or perhaps swap-out for a higher-capacity battery, but those options are impossible. The metal backing being easy to scratch isn't helpful at all, but I honestly don't care what the back looks like since I'm looking at the screen when using it which is what the device is all about.

All-in-all I'm very happy with the device I went for. I don't regret going for the 4 GB RAM version over the 8 GB which was £400 more - it's simply not worthwhile for a +80% cost for an almost 0 gain in performance for most tasks.

There is a newer refresh of this laptop, the Transformer Pro 3 T304UA which is the 2017 model. It's the same thing as what I bought, except it's a year newer with the next generation Intel processor inside instead...and no more thunderbolt on the USB C, which also means now you have a separate charger...and the screen is smaller...and less bright...and lower-resolution...and they took out the infra-red camera sensor replace it with a fingerprint sensor. It feels like it's 1 step forward, and 2 steps back.

For me, the perfect 2-in-1 laptop would be something like my Transformer Proi 3 T303UA, which has decent connectivity (USB C), screen, etc, but with upgradeable RAM, up upgradeable SSD, and have great battery life. That would be fantastic. Unfortunately, the way the market is, no convertible laptop lets you upgrade the RAM (or anything at all), and virtually no regular laptop for that matter. This is why all these mobile computers will either become obsolete in the near future, or are impossible to fix if a component fails, which is in-line with the whole planned obsolescence all tech companies are wanting to force you to upgrade every 12-24 months. And that's why I don't think it's wise splashing a lot of money on one of these things, you're always going to have to repeat the process.

It doesn't help that market leaders like Microsoft can't even put a USB C port on their Surface Pro because they're so short-sighted, and that their cheapest option is still too expensive. Or that Apple doesn't make a proper 2-in-1 like this to increase proper competition.


Sunday, 23 July 2017

Surveying web service technologies

For a future web service I'm planning to do for the side-project I'm working on, I'm considering the technology stacks available. It will be rather straight forward, to serve public information so it can be queried upon programmatically.

My default would be to use Spring Boot (Java) because that's what I'm most familiar with and can knock something out without much trouble. Other technologies I'm considering would be Django (Python), Express (Node) JS, Go (Golang), and .NET. I'm planning to read more about them in more detail at some point.

I came across company's blog that attempted to survey and review different web service technologies: http://optimalbi.com/blog/2016/09/28/whats-the-best-restful-web-api-framework-part-6/ 'great', I thought, but after reading in more detail they sort of just summarize and skip over things. For example, Spring (Java) was just skipped over because it seems that the authors just don't like Java for basically no real reason. They didn't review or consider Golang...again for no reason other than they couldn't be bothered. One comment from an author lead me to another blog post about Kotlin, of which they seem to be fond of: http://optimalbi.com/blog/2016/05/20/kotlin-dragging-java-into-the-modern-world/
The opening paragraph reaches too much, I think:
Java has a lot to offer for the modern cloud-driven world, but writing good, maintainable and human readable code has never been part of a Java developers life.
This is where Kotlin comes into things. Kotlin is a statically typed language that runs on the JVM (Java Virtual Machine) which is designed to write better and safer Java-like applications that also have a certain level of human readability.
I'm sorry, but to being able to write good, maintainable and human readable code is absolutely possible as a Java developer in their life. The same goes for a Kotlin developer, Python developer, etc. Kotlin being better, safer, more readable code than Java...well that's maybe true. Perhaps even likely. But that's difficult to quantify, because it's quite subjective. I'm pretty sure it's possible to write bad Kotlin code, like it's possible to write bad <insert language of choice> code. Bad code comes from bad developers/teams/culture. Good code comes from good developers/teams/culture. All modern programming languages, Java included, all have fantastic modern features or frameworks over the past to make the life of a developer easier and write great code.Yes, other modern languages may have new features before Java decides to adopt them, but that's a great benefit of Java - it's dependable, got the backing of a huge corporation, used throughout the world, etc. In my organization There's not enough room in any office to swing a cat without hitting someone who knows lots about Java. What about Kotlin? You must be joking.

So with this in mind, it makes perfect sense now why the end-result from their tech survey was "we love Express JS because we love Node JS". And that's perfectly fine. But there's no say benchmarking of performance from one language or framework to the next. Their result came down to how they felt about using the technology, experience, interest, etc, and Express ticked all their boxes. And that's perfectly fine. It's just that I came into reading the articles thinking it would be a certain way, and it was actually in a different light. I think my take-home message is to always keep an open mind when reading anything, especially online in a blog, because people will have different opinions, thoughts, and feelings, which may or may not have apparent basis, and that's OK.

Going back to the main topic, I think I'll make an initial implementation in Spring Boot and then move onto seeing how it could be done instead in Express. I'll keep an open mind.

NHS HackDay Manchester 2017 write-up

Last weekend I went to the NHS HackDay 'hackathon' in Manchester http://nhshackday.com/previous/events/2017/05/manchester/ In the end I couldn't stay for the 2nd day, so I can only comment on the one (Saturday).

The event was held in the Co-op 'Federation' building, on the top floor which looks to be like an incubator for internal 'agile' ideas, to get improvements off the ground and try new things out. Very much open-plan, plenty of space for people to break off into small groups and collaborate. Although I've been to hackathon events before, this was my first NHS Hackday, so I didn't really know what to expect apart from the general outlined schedule.

After the initial sign-in period, and introduction, people pitches their ideas to the group to get interest and help get potential projects off the ground. Then people were encouraged to find a project you're interested in, and get going. I picked the "NHS public data" project to join because that sounded very interesting to me, and something I could sink my teeth into. The pitch was to get openly available NHS stats data from CSV files into a more accessible format. There was quite an interest in this, with more than a dozen people interested from technical and non-technical backgrounds. So we split into 2 sub-groups, technical and non-technical to try to achieve something.

Of course I was part of the technical sub-group, and we started talking about the problem, and what we could potentially achieve over the weekend. These discussions the rest of the morning really, and from speaking with people from other teams they had a 'similar' problem with communication - conversations get dominated by one or two people. And I don't mean it's from the one person who pitched the idea, it's from others, who realize it or not, are simply constantly talking, and not letting others give their opinion. Then if your opinion is given, it's generally disregarded and considered as if you were interrupting. I think this is a big problem, and steps need to be taken to ensure everyone is included in a project. It should be the responsibility of everyone to ensure everyone else has an opportunity to give their thoughts and input. I realized this was happening, with many people just not speaking at all, so I would actively try to get people to speak up so everyone around would be included equally.

I also think another problem with communication is that since the event was NHS-related, clinicians can be whelming in their conversation, and are very poor in letting other speaks and seeking the opinion of others. For them, it seems whoever keeps talking or talks the loudest is the most important, and nobody else matters. This might fly in a hospital or clinical practice, is a very bad attitude to have, especially with new people who are volunteering, trying to understand, discuss, and work together for the 1st time in a new environment.

I'm going off-topic hear a little, but I feel strongly about correcting poor team communication. A team cannot perform well or produce good results who are unable to properly communicate effectively.

Regardless, for the project I get involved with, we managed to break down the technical tasks needed doing, and I encourages people to pick the area they want to work on so we might be able to show something by the end of it.

I picked the part of loading the data into a database, for which we chose MongoDB because it seemed to fit our needs (loose data schemas). Plus, we could get a freely hosted database through Mongo, one of the sponsors of the event. A normal SQL database would be fine, I'm sure, but since we essentially had a Mongo DBA on-call giving us cloud infrastructure for free, then why not? Otherwise I'd need to pay for my own hosting, for have a limited allowance, total number of queries, limited performance, etc.

I worked on loading some data into Mongo for the rest of the day, and I got somewhere, at least with local developmental testing. Our MongoDB was ready right at the end of the day, but regrettably I couldn't attend the 2nd day. I aim to work on this as a side-project in the coming weeks to properly explain this project, and see where I can get with it.

There was plenty of tea/coffee on-demand, but I forgot to bring power extender cables with me, so I know now for next time, if there is a next time, I should bring such niceties to make it even better. Well, I could even bring my own desktop and monitor with me next time if I want! Could be overkill, but there's nothing stopping me in all honesty.

All in all I had a lot of fun talking to new people, hearing about ideas about "how to make NHS IT less bad", and starting work on a side-project. For me, this is all very exciting and I really want to make progress into getting open NHS data more accessible. CSV or XLS files really aren't good enough, and maybe in the near future I'll be able to show something off.

I also have a couple ideas of my own that I might want to work on next as side-projects, or pitch them at future hack days.

The Feynman Technique

This blog post clearly explains the 'Feynman Technique' very well about how to learn new concepts better.

Essentially it consists of writing down the new concept in your own words as if you're explaining it to a new reader. Then if there are any gaps in your knowledge, or to check if what you've written is correct, refer to the source material and try again. And then repeat this process if there's anything complex that can be broken down further.

I think this is a very powerful technique because it "forces" you to properly understand material yourself first. In computing terms, it's absolutely apt - if you cannot break down something complex into something less complex so that others can understand, then you don't really understand the complexity yourself in the first place.

Saturday, 10 June 2017

Marty Lobdell - Study Less Study Smart

Recently I came across this lecture by Marty Lobdell, called 'Study Less Study Smart'. I believe it's a fantastic overview about the pitfalls and fallacies about studying, and how, as a student learning new material, you can actively make a difference to study better.

From my perspective, it's easy to feel inundated with having to learn new technologies because there are so many options available, and new options are always being improved upon and evolving, or outright being invented. And then when learning an area, either completely new or in more detail regardless, it can feel like a chore instead of being 'fun', or there's a lack of productivity for gaining new knowledge and abilities.

This lecture, through many stories, anecdotes, and accepted results, explains how people can get the process of learning wrong, and how to get it right. It's an hour long, and well worth your time.

Thursday, 21 July 2016

How assign bean's property an Enum value in Spring config file?

Had this exact problem today of having to assign a bean's property with an Enum in a Spring XML configuration file. Seems that the answer is easier than expected! You just type in the enum's name directly for the value e.g.
<bean:property name="searchType" value="PRIVATE"/>

http://stackoverflow.com/a/516899

Tuesday, 28 June 2016

Preparing Your Code for JDK 9

Preparing Your Code for JDK 9: Erik Costlow discusses what to consider when upgrading to Java 9, where to find early access releases and how to analyze library dependencies for unintentional reliance internal APIs.

Thursday, 23 June 2016

Scrum and Kanban

The DevOps paradigm can be implemented through many different methodologies. The 2 most popular are: Scrum and Kanban. 

Scrum 
In essence, this is Scrum:


Everything that needs to be done is part of a product backlog. These tasks are then put into the Spring Backlog, and a spring is like a month long. Then anything blocking is reviewed daily for a "stand-up" meeting, and everything should be delivered incrementally with a view to the end of the spring. Then this process starts over again. 

You're supposed to have certain roles to ensure this runs effectively: a product master to manage the product/spring backlog, a sprint master so that the Scrum is being followed. Then the sprint backlogs are supposed to be estimated, people are supposed to take ownership of tasks, nothing is supposed to interrupt the sprint, stand-ups are supposed to be useful, multiple people are working on the same project, and tasks are done throughout the sprint so that "burn-down" and "velocity" can be shown in a chart. 

In reality from my experiences nothing like that ever happens, there is a great potential for misuse of Scrum mandates, which are arguably out-of-date in today's world. Especially for a small project I would recommend implementing a Scrum-ban (hybrid, or Kanban methodology which is less restrictive, and has a greater allowance for testing in order to help ensure high code quality, instead of having such an importance of deliverables at the end of a sprint. In theory sprints are supposed to be a way for developers to be protected from immediate changes to requirements, but with the flexibility to make changes to your plans as you go along. But in reality a lot of time that doesn't happen that way, and development get interrupted, and medium/long-term vision of projects are not as highly regarded as they should be. 

Kanban 
Simply put, this is Kanban:



It's a method for continuous improvement, that is you add things you want done to the "To Do" list, and prioritize them. Then when you're free, take a couple things to the "Doing" list. Set a conservative limit on how much work you can do at any one time. When they're done, but them across to another "Testing/Waiting" or "Done" list. When you've freed up a slot on the Done list, then pull something from the To Do list. If something bounces back into Doing from Testing, Waiting, or Done, then either move something back to To Do, repiroritise, or just carry on and deal with it, and only pull something new from To Do when you're free and back to a normal workflow. So it's supposed to be a way for "pulling" work instead of "pushing" work, e.g. work being pushed onto you constantly. Rather, you constantly pulling work onto yourself when you have the capacity to is much better. This way if things are taking too long, or if they are problems in the chain from To Do -> Done, then it should be quickly realised where bottlenecks are, and how to overcome them. This is something that Scrum normally fails at doing, what with its Sprints, Velocity, Poker Chips estimation, etc.

Build/Package/Test/Release/Deploy

To build/package/test/release/deploy, there are many software options out there in order to help streamline and automate the processes. There are tools available from Atlassian, AWS, and many others. Some of the most popular choices are listed below.

Atlassian 
Bamboo - for both automated code deployment and continuous integration.  ($10 for 5 users, one-time payment, self-hosted, or $10/month hosted). 
SourceTree - standalone tool for visualising Git repos (free). 
FishEye - search/monitor Git repos.  ($10 for 5 users, one-time payment, self-hosted). 
Crucible - for code reviews ($10 for 5 users, one-time payment, self-hosted). 

AWS 
CodeDeploy - for automated code deployment. There is no additional charge for code deployments to Amazon EC2 instances through AWS CodeDeploy.
CodePipeline - for continuous integration. One active pipeline for free each month. 


Others
Jenkins - for both automated code deployment and continuous integration, free self-hosted.  
TeamCity - free for up to 20 build configurations, self-hosted, for continuous integration. 
 otherwise expensive.

AWS storage

AWS offers 3 main ways for data storage:

S3 
Simple Storage Service (S3) - data is held in the cloud, in a "bucket". Inside a bucket, files and sub-directories can be created. The point of this type of storage is to write once, read may times perhaps from different services (EC2 instance, the Internet, etc). They can also be deleted easily. Data are automatically backed up and have a 99.9% uptime.

EBS 
Elastic Block Storage (EBS) - these are volumes that can be added onto EC2 servers, think of them like hard drives. They can be scaled up/down, added, removed, backed-up as needed per instance. 

Glacier 
The Glacier is for remote "off-site" backups. Write once, read (almost) never. This should be for long-term archival of data, e.g. that was present in S3 for a long time, and will never normally be used again, save for restoration of backup data. Glacier prices are cheaper than S3 for storage, but have retrieval costs.

API deployment

There are build automation tools for programming languages, which can be integrated into IDEs, e.g. Maven for Java, and any other JVM-based language (Clojure, Groovy, Scala, Ivy). Maven also has excellent dependency management from the Maven Central repository (and any private repositories). For Python, there's PyPI. Perl has CPAN. Node.js has NPM. 

Source Code Repositories

In ye olden days of yore, source code repositories were either CVS (Code Verification Store) or SVN (Subversion). Both were horrible at everything: usability, collaboration, stability, merging, committing, branching. Literally everything it was supposed to do. Then along came new technology that did it all properly: Git and Mercurial. Git has officially taken off throughout the world after everyone and their dog has realised how much it works amazingly well. I've used it a lot, and I'm more than happy with it. Git is open source and free, but again like anything, private repos would need to be paid-for hosted or self-hosted. Off-site hosting would be the best, that way you don't have to worry about the cost, time and effort of physical hardware or its administration. 

The most common Git hosted options are: 

GitHub 
GitHub is the world's most popular hosted Git site. It is for a reason: works really well, has a great browser interface and offers an in-built wiki to explain the source code, and issues to track, organizations, user groups, profiles, etc. There is unlimited free allowance for public open-source repositories, so it's great for the scientific community. The main downside is that it's expensive for private use. You're looking at $25/month for a maximum of 10 private repositories (libraries). Eek. 

BitBucket 
BitBucket is the next most popular Git site. Much less so than GitHub, but it's still quite popular. Why? It works just as well as GitHub, but you can create an unlimited number of both public and private repositories. There is a free allowance for up to 5 users on a single private repository. After 5, then you have to pay. On the plus side, if you have an academic email address, if you add it to your BitBucket account (not even as your primary email address) then you automatically get upgraded to the academic features for unlimited everything (not for private Groups though, that should be implemented at the institute-level). This is a perk Atlassian offer in order to encourage, attract and benefit students and faculty. So that's right, BitBucket is made by good ol' Atlassian so it has its own issue tracker, wiki and integrates with the rest of the Atlassian world, i.e. JIRA and Confluence. 

BitBucket can be self-hosted, again with a $10 one-off payment for 10 users. 

CodeCommit 
AWS's Git offering is CodeCommit. Someone else wrote up his review and I couldn't put it better myself: 
Although I’m a fan of CodeCommits simplicity and automation support there are a few negatives to consider before migrating everything to it. There is a cost, albeit a small one, to using it. You’re charged by number of users accessing your repos and the number of git operations. I’m assuming I’m not going to hit the operations limit often but I will immediately be paying for an extra user or two. I’ll have my own AWS CodeCommit user for normal read/write repo access and I’ll need additional, locked down, users for my CI services. Access control is handled using IAM, this is both a positive and a negative depending on how much you like the JSON based policy language. There’s currently no concept of a public CodeCommit repo so you can’t start a code base off in private and then promote it to public view as you can with GitHub or BitBucket. The dashboard UI lacks the familiar collaboration features, there’s no pull requests, issue tracking or wiki built in. If you’re working in a team you’ll need a separate way to handle those. These current limitations means GitHub doesn’t need to be worried just yet, the lack of collaboration features alone will prevent most people from considering CodeCommit as an option even for private only repos. 
Basically, it's just not worth it in a world where you have BitBucket and GitHub.