2018 Best Laptop for Startup’s Technical Founder

I have an analytical mindset; which is a blessing and a curse.  Am having great time working on my startup sectormap.net but then spend way too much time on trying to decide what to buy (laptop in this case).

Spoiler: clear winner in my case was HP Envy x360 15 inch
p.s. that was a surprise; since HP wasn’t even on my list

Must Have Features

  • fast
    • Kaby Lake Refresh CPU i5 or better
    • PCIE NVME ssd drive
  • long battery life (6+ hours)
  • 4K external display capability (60 hz)
    • hdmi 2.0 or DisplayPort or Thunderbolt
    • hard criteria to satisfy (surprisingly)
  • upgradability (ram, hdd)
    • upgradable ram is rarity; significantly narrow downs options (also preferably 2 slots for faster speed via dual channel capability

 

Nice to Have Features

  • 2-in-1 convertible: for doing client demos
  • usb-c charging function
  • nice design
  • small ~13.3
  • not heavy (under 2 kg)
  • mate screen

 

List of laptops that satisfy my criteria is surprisingly short.

HP Envy x360 15 inch has exceeded my expectations; love the design; 2-in-1 functionality; satisfied all of the must have features; and many of the nice to have

Dell XPS 15: nice but pricey ~1,500$

Lenovo: Thinkpad E480 (least expensive candidate), T480/S, L380, X1; IdeaPad 920S
super slow delivery ~1 month; couldn’t wait that long; and by that time something better might be around so would have remorse about that …

 

 

keywords: programming development laptop ultrabook

 

 

Posted in Uncategorized | Leave a comment

Startup: registering / running corporation in Hong Kong (Banking, etc.)

Summary

  • free, simple & fast bank account opening with Neat (don’t need to visit HK)
  • $200 UD (setup), and $1,200 USD for annual running costs; by using Kams  (accounting, audit, office services; in simple case; government fees are excluded)

Details

As a startup, in most jurisdictions you have to spend a lot of time/money proving the obvious – that your startup is either losing money or is barely profitable (most income being redirected towards growth); so that you don’t get taxed even though you are not making any profit yet.

I did a fair amount of research * and Hong Kong was the only jurisdiction that I’ve found that had a combination of very little paperwork and is inexpensive for setup, operations/running (and is not in shady offshore locations).

In Hong Kong it is easy to register and operate your startup (even if you are not physically located in HK).  I hope information bellow helps somebody to start pursuing their startup dreams; and at least makes the operations part easier.  Good Luck !!!

Banking

Neat Business is a lifesaver; it takes care of all of your banking needs; gets you a bank account number and everything you need to run your startup (accepting payments via stripe, etc.); and you don’t even need to visit Hong Kong to open the bank account.  It took me less than a week to get an account and a corporate mastercard debit card (thanks a lot Neat).

Here is why I have so much appreciation for Neat.  Over the past years it has become ridiculously hard to open a bank account in HK; e.g. winner of startup competition at a local university wasn’t able to open account (ref), troubles of another startup (ref) .  p.s. many of the HK banks had to pay 100 of millions of “fines” to US; and now naturally don’t want to open accounts to companies that don’t have verifiable history and operations; which unfortunately includes many of the startups 🙁

p.s. I have account at traditional banks in HK; but will be shifting most things to Neat.

Company Setup / Operations

Kams is the company that I use and highly recommend for all of the corporate operations/running needs (setup, company secretary, registered address, accounting, audit, etc.).  They do everything professionally and expediently; and at a very good price; my operations are simple and per year for all of the services I am paying less than 1,200 $US (could be different in your case; but still probably very reasonable).

 

Notes

* Estonia (used to be good; but now it’s almost impossible to open bank account).  Initially I was planning just to setup company locally in either Canada, Japan, US (via Stripe Atlas); all of which would require significant paperwork for operations.  Time is something that many of the startups do not have a surplus of.

 

keywords: corporation startup hk hong kong bank account company setup running audit  dbs hsbc bank of china  … bank account

 

Posted in Uncategorized | Leave a comment

Play Json with Scala Trait

To be able to use trait with Play Json; you need to provide un/apply methods for the trait; and define a case class that could be instantiated.

(there might be a better approach)

 

import play.api.libs.json.Json
trait PaginatedTrait {
  def total: Int
  def per_page:Int
  def page: Int
  def last_page: Int
}

object PaginatedTrait  {

  def apply(
             total: Int,
             page: Int,
             per_page: Int,
             last_page: Int
           ): PaginatedTrait = new PaginatedRec(total, page, per_page, last_page)


  def unapply(x: PaginatedTrait): Option[(Int, Int, Int, Int)] = Some(x.total, x.page, x.per_page, x.last_page)

  implicit val formatPaginatedTrait = Json.format[PaginatedTrait]
  implicit val writesPaginatedTrait = Json.writes[PaginatedTrait]
  implicit val readsPaginatedTrait = Json.reads[PaginatedTrait]

}

import play.api.libs.json.Json

case class PaginatedRec(
                         override val total: Int,
                         override val page: Int,
                         override val per_page: Int,
                         override val last_page: Int
                       ) extends PaginatedTrait
{
}


// This might not be required
object PaginatedRec{
  implicit val paginatedTraitRecFmt = Json.format[PaginatedRec]
  implicit val paginatedTraitRecWrites = Json.writes[PaginatedRec]
  implicit val paginatedTraitRecReads = Json.reads[PaginatedRec]
}

 

 

 

 

keywords:

scala unapply method for trait in companion object

scala apply method for trait in companion object

scala apply method in object

scala No apply function found for trait json

scala No apply function found for trait

play json No apply function found for trait

 

 

Posted in Uncategorized | Leave a comment

Using Lambda with multiple handlers in AWS Step Functions

Problem

Using lambda function with multiple handlers is non-trivial in AWS Step Functions

Solution

Lambda is great; however one of the limitations is that only a single handler function is used.  Maintaining multiple lambda functions gets cumbersome quickly.

One common approach is to have a meta  handler that then routes to one of the sub-handlers; typically this is done by passing a name/reference to a handler to be used.

Now the problem arises when one wants to use meta-handlers  with AWS Step Functions.  In particular, it is not possible to edit the message (input/out) that is passed around states.

While editing message is not possible; one can alter it by moving different parts of it around.  It is a little bit tricky since one would have to use a combination of InputPath , ResultPath and OutputPath .  Currently a way to achieve is as following.

{
  "handlers": {
    "h1": {
      "name": "h1"
    },
    "h2": {
      "name": "h2"
    }
  },
  "handler": {
    "name": "doMyThing"
  },
  "details": {
    "path": "yourPath"
  }
}

In your request include handlers that lists the ones that you are planning to use.

Then you you can add a pass state in the AWS Step Function’s State machine to select which of the handlers should be used; here is an example (selecting h1 to be used as a handler for the next state)

{
 "StartAt": "test",
 "States": {
 "test": {
 "Type": "Pass",
 "InputPath": "$.handlers.h1", 
 "ResultPath": "$.handler", 
 "OutputPath": "$",
 "End": true
 }
 }
}

 

 

 

Posted in Uncategorized | Leave a comment

Ordering Business Cards in Japan (Tokyo)

I spent about an hour (probably too much) looking at various options for ordering business cards in Japan.  Hopefully this post will save somebody a little bit of time.

There are quite a few companies that offer business card printing.  But after looking at variety of options; here are my (and in a way other bloggers) top choices.

Raksul

Price: Very competitive price: 480 Y for 100 full colored cards (+ 200 Y for shipping) 1 week for delivery; I went for the 1 day option which was 1,500 Y (also quite reasonable) – (submitted data file at 11PM; cards were printed at noon of the next day; and delivered the on the next morning).

Great Interface: You can double check that the card looks fine through a very nice interface (p.s. I’ve used InkScape to design the card; and then uploaded pdf); you can easily track you submission etc.

Quality: Good

 

Graphic.jp

Choice for: For the best quality (offset printing) and numerous paper types.

Price: Reasonable (higher due to offset printing process)

 

Other Companies

I also looked at VistaPrint.jp but didn’t like the submission interface; and overall the site wasn’t quite as easy to parse; besides I wanted to support local Japanese companies and I think VistaPrint is not one of them.

 

Other Reviews

These business card printer’s reviews were also quite useful

【画質は?】ラクスルで名刺を印刷しました。比較/レビュー/評判

 

名刺の印刷価格を比較してみた(プリントパック・WAVE・ラクスル・東京カラー印刷)

 

 

 

 

 

 

 

 

Posted in Uncategorized | Leave a comment

Food Delivery: Amazon Fresh in Japan

Typically Amazon enters market with a strong offering; however in the case of Amazon Fresh (recently launched in Japan) to me (as analyst and consumer) it is not clear what advantage Amazon Fresh provides in comparison with existing and mature Japanese companies (e.g. Pal System (web only store), Ito Yokado (regular store that also delivers) ).  Bellow is a very brief comparison (if you’d like a more detailed one; please get in touch with me).

Amazon Fresh :
monthly fee: $5
shipping fee: $5 for orders < $60
selection: probably wide; but is not quite clear yet

Ito Yokado (regular grocery store that also delivers)
monthly fee: free
shipping fee: $3 for orders < $20
selection: wide (many traditional Japanese grocery brands are available)

Pal System (web only store)
monthly fee: free
shipping fee: $2
selection: narrow (but focuses on organic and local food)

Amazon seems to have rather inferior offering (with the potential exception of the number of products available).  It is doubtful to me that the current offering will be successful; it will be interesting to see how it evolves.

Bellow is a very brief comparison (if you’d like a more detailed one; please get in touch with me).

 

Posted in Uncategorized | Leave a comment

Online SaaS Peer Assessment / Grading / Polling

Have spent several hours looking for a web-based tool that allows students to vote for each others presentations; by the best free solution was https://www.poll-maker.com/

(p.s. last year spent half a day counting students votes; so decided to automate it this year).

Posted in Uncategorized | Leave a comment

java.lang.NoSuchMethodError: com.amazonaws.transform.JsonErrorUnmarshaller: method (Ljava/lang/Class;)V not found

Problem

An exception or error caused a run to abort: com.amazonaws.transform.JsonErrorUnmarshaller

java.lang.NoSuchMethodError: com.amazonaws.transform.JsonErrorUnmarshaller: method <init>(Ljava/lang/Class;)V not found

Solution

AWS had some strangely maintained libraries for lambda

"com.amazonaws" % "aws-lambda-java-core" % AWSLambdaLibsVersion,
"com.amazonaws" % "aws-lambda-java-events" % AWSLambdaLibsVersion,
"1.1.0" // https://github.com/aws/aws-lambda-java-libs

The error was fixed by replacing above with:

"com.amazonaws" % "aws-java-sdk-lambda" % "1.11.109",

 

Posted in Uncategorized | Leave a comment

No compatible version found: @types/react-dom@15.4.2

Solution

Was puzzled by the

No compatible version found: @types/react-dom@15.4.2

In the end chaning all of the react related vers to

"^15.4.1",

did the trick

also had an error (2nd one bellow); but that was due to a server already running on the same port

Problem

npm install
▌ ╢░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
▀ ╢░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
npm ERR! Linux 4.4.0-59-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2

npm ERR! No compatible version found: @types/react-dom@15.4.2
npm ERR! Valid install targets:
npm ERR! 0.14.21, 0.14.20, 0.14.19, 0.14.18, 0.14.17, 0.14.16, 0.14.15, 0.14.14, 0.14.13, 0.14.12-alpha, 0.14.11-alpha, 0.14.10-alpha, 0.14.9-alpha, 0.14.8-alpha, 0.14.7-alpha, 0.14.2-alpha, 0.14.1-alpha
npm ERR! 
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR! /home/neil/MEGA/MEGAsync/docs/projects/patentBot/code/patentBotUI/npm-debug.log

 

npm start

> mobx-react-typescript-boilerplate@1.0.0 start /home/neil/MEGA/MEGAsync/docs/projects/patentBot/code/patentBotUI
> node server.js

events.js:141
 throw er; // Unhandled 'error' event
 ^

Error: listen EADDRINUSE 127.0.0.1:3000
 at Object.exports._errnoException (util.js:870:11)
 at exports._exceptionWithHostPort (util.js:893:20)
 at Server._listen2 (net.js:1237:14)
 at listen (net.js:1273:10)
 at net.js:1382:9
 at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:63:16)
 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:82:10)

npm ERR! Linux 4.4.0-59-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! mobx-react-typescript-boilerplate@1.0.0 start: `node server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the mobx-react-typescript-boilerplate@1.0.0 start script 'node server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the mobx-react-typescript-boilerplate package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs mobx-react-typescript-boilerplate
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls mobx-react-typescript-boilerplate
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/neil/MEGA/MEGAsync/docs/projects/patentBot/code/patentBotUI/npm-debug.log

 

 

 

 

Posted in Uncategorized | Leave a comment

React (TypeScript): infinite scroll

Recently I had to use an infinite scroll (lazy loading).  It took me a while to find a solution that worked well for my very simple case (lazy loading items in an infinite scroll fashion).  Hopefully this will save somebody time.

https://github.com/joshwnj/react-visibility-sensor ended up being by far the best solution that worked flawlessly  (and is extremely easy to use).  Just add it to the end of your scrollable list and lazy load once it becomes visible (p.s. you can move its position slightly upward to lazy load in a more eager manner):

<VisibilitySensor
    onChange={(isVisible) => isVisible ? this.loadMoreData() : console.log("debug: became invisible")}
/>

p.s. make sure to use arrow functions otherwise you might have some problem with this binding etc.; more details: https://github.com/Microsoft/TypeScript/wiki/’this’-in-TypeScript#fixes

to avoid small amount of polling; you might also wan to set the `active` property to false; when your component is no longer visible.

Finally react-visibility-sensor could be used for other purposes other than infinite scroll – that requires to know whether your component is visible or not.

 

Other Libraries

Most of the problems with other libraries were due them estimating weather the component is visible or not based on the position of the scroll bar.  Some did by requiring you to specify the height of each of the component.  In part this was motivated by many of the infinite scroll packages aiming at the case were the number of items would be very large 10K+ (and would only keep a small portion of visible items; to improve memory usage).  In my case I had under 1,000 items (with images etc); so these types of solutions were not necessary.  None of the libraries bellow worked well for me (the firing events were not reliable).

 

https://github.com/brigade/react-waypoint

https://brigade.engineering/to-infinity-and-beyond-with-react-waypoint-cb5ba46a9150#.faad1tmuk

Problem: didn’t update its position; so was stuck in the middle after more elements were added.

“`js

<Waypoint
onEnter={() => console.log(“waypoint: on enter” )}
onLeave={() => console.log(“waypoint: on leave”)}
onPositionChange={() => console.log(“waypoint: on onPositionChange”)}
/>
“`

https://github.com/CassetteRocks/react-infinite-scroller

PROBLEM: `loadMore` often doesn’t fire 🙁

needed to `useWindow={false}` in order to get `loadMore` to fire

`NodeView.tsx`

“`tsx
<InfiniteScroll
pageStart={0}
loadMore={() => console.log(“requested: loadMore ………………”)}
hasMore={true}
loader={<div className=”loader”>Loading …</div>}
useWindow={false}
>
{this.props.items.map(
(data) =>
<Item data={data} />
)}
</InfiniteScroll>
“`

Other Notes

list for react:
https://github.com/brillout/awesome-react-components#infinite-scroll

Many of the infinite scroll libraries are aimed at efficiently rendering 1K+ results; that is not the case for me; since I mostly just need paging/on-demand fetching; so don’t need to add virualization managing (which complicates things).


https://github.com/orgsync/react-list

a newer fork: https://github.com/CassetteRocks/react-infinite-scroller
original (not updated for 3 years) https://github.com/guillaumervls/react-infinite-scroll

https://github.com/jasonslyvia/react-lazyload

keywords: react simple non virtualized infinite scroll with page fetching loading lazy load

 

 

Other Notes

unrelated issue that I’ve experienced with http://www.material-ui.com/#/components/drawer is that having a property

height: window.innerHeight

would make the other component unresponsive/loose focus; removing that property fixed it.

 

 

 

Posted in Uncategorized | Leave a comment