Understanding socket and port in TCP

Issue #287

When digging into the world of TCP, I get many terminologies I don’t know any misconceptions. But with the help of those geeks on SO, the problems were demystified. Now it’s time to sum up and share with others :D

What defines a unique connection ?

There are 5 elements that identify a connection. They call them 5-tuple

  1. Protocol. This is often omitted as it is understood that we are talking about TCP, which leaves 4.

  2. Source IP address.

  3. Source port.

  4. Target P address.

  5. Target port.

Does TCP listen on one port and talk on another port ?

No. This is a common misconception. TCP listens on 1 port and talk on that same port. If clients make multiple TCP connection to server. It’s the client OS that must generate different random source ports, so that server can see them as unique connections

What is the maximum number of concurrent TCP connections that a server can handle, in theory ?

A single listening port can accept more than one connection simultaneously.There is a ‘64K’ limit that is often cited, but that is per client per server port, and needs clarifying.

If a client has many connections to the same port on the same destination, then three of those fields will be the same — only source_port varies to differentiate the different connections. Ports are 16-bit numbers, therefore the maximum number of connections any given client can have to any given host port is 64K.

However, multiple clients can each have up to 64K connections to some server’s port, and if the server has multiple ports or either is multi-homed then you can multiply that further

So the real limit is file descriptors. Each individual socket connection is given a file descriptor, so the limit is really the number of file descriptors that the system has been configured to allow and resources to handle. The maximum limit is typically up over 300K, but is configurable e.g. with sysctl

Concurrent connection request vs Concurrent open connection

When clients want to make TCP connection with server, this request will be queued in server ‘s backlog queue. This backlog queue size is small (about 5–10), and this size limits the number of concurrent connection requests. However, server quickly pick connection request from that queue and accept it. Connection request which is accepted are called open connection. The number of concurrent open connections is limited by server ‘s resources allocated for file descriptor.

Why connection is rejected after successful TCP handshake ?

It’s normal. When server receive connection request from client (by receiving SYN), it will then response with SYN, ACK, hence cause successful TCP handshake. But this request are stills in backlog queue.

But, if the application process exceeds the limit of max file descriptors it can use, then when server calls accept, then it realizes that there are no file descriptors available to be the allocated for the socket and fails the accept call and the TCP connection sending a FIN to other side

What are active and passive socket ?

Sockets come in two primary flavors. An active socket is con­nect­ed to a remote active socket via an open data con­nec­tion… A passive socket is not con­nect­ed, but rather awaits an in­com­ing con­nec­tion, which will spawn a new active socket once a con­nec­tion is es­tab­lished

Each port can have a single passive socket binded to it, await­ing in­com­ing con­nec­tions, and mul­ti­ple active sockets, each cor­re­spond­ing to an open con­nec­tion on the port. It’s as if the factory worker is waiting for new mes­sages to arrive (he rep­re­sents the passive socket), and when one message arrives from a new sender, he ini­ti­ates a cor­re­spon­dence (a con­nec­tion) with them by del­e­gat­ing someone else (an active socket) to ac­tu­al­ly read the packet and respond back to the sender if nec­es­sary. This permits the factory worker to be free to receive new packets

Where to go from here

Here are some more links to help you explore further

How to deal with CSS responsiveness in Wordpress

Issue #283

Original post https://medium.com/fantageek/dealing-with-css-responsiveness-in-wordpress-5ad24b088b8b


During the alpha test of LearnTalks, some of my friends reported that the screen is completely blank in search page, and this happened in mobile only. This article is how I identify the problem and found a workaround for the issue, it may not be the solution, but at least the screen does not appear blank anymore.

As someone who likes to keep up with tech via watching conference videos, I thought it might be a good idea to collect all of these to better search and explore later. So I built a web app with React and Firebase, it is a work in progress for now. Due to time constraints, I decided to go first with Wordpress to quickly play with the idea. So there is LearnTalks.

The theme Marinate that I used didn’t want to render the search page correctly. So I head over to Chrome Dev Tool for Responsive Viewport Mode and Safari for Web Inspector

The tests showed that the problem only happened on certain screen resolutions. This must be due to CSS @media query which display different layouts for different screen sizes. And somehow it didn’t work for some sizes.

[@media](http://twitter.com/media) screen and (max-width: 800px) {
 #site-header {
 display: none;
 }
}

A bit about the rules

The @media rule is used in media queries to apply different styles for different media types/devices.

Media queries can be used to check many things, such as:

  • width and height of the viewport

  • width and height of the device

  • orientation (is the tablet/phone in landscape or portrait mode?)

  • resolution

Using media queries are a popular technique for delivering a tailored style sheet (responsive web design) to desktops, laptops, tablets, and mobile phones.

So I go to Wordpress Dashboard -> Appearance -> Editor to examine CSS files. Unsurprisingly, there are a bunch of media queries

[@media](http://twitter.com/media) (min-width: 600px) and (max-width: 767px) {
 .main-navigation {
 padding: 0;
 }
 .site-header .pushmenu {
 margin-top:0px; 
 } 
 .social-networks li a {
 line-height:2.1em !Important; 
 } 
 .search {
 display: none !important;
 }
 .customer blockquote {
 padding: 10px;
 text-align: justify;
 }
}

The .search selector is suspicious display: none !important;

The important directive is, well, quite important

It means, essentially, what it says; that ‘this is important, ignore subsequent rules, and any usual specificity issues, apply this rule!’
In normal use a rule defined in an external stylesheet is overruled by a style defined in the head of the document, which, in turn, is overruled by an in-line style within the element itself (assuming equal specificity of the selectors). Defining a rule with the !important ‘attribute’ (?) discards the normal concerns as regards the ‘later’ rule overriding the ‘earlier’ ones.

Luckily, this theme allows the ability to Edit CSS , so I can override that to a block attribute to always show search page

How to use One Dark theme and Fira Code font for IDEs

Issue #281

Original post https://medium.com/fantageek/one-dark-theme-and-fira-code-font-for-ides-d67bbe2ac8cb


A good theme and font can increase your development happiness a lot. Ever since using Atom, I liked its One Dark theme. The background and text colors are just elegant and pleasant to the eyes.

One Dark

Original designed for Atom, one-dark-ui that claims to adapt to most syntax themes, used together with Fira Mono font from mozilla.

There is also Dracula which is popular, but the contrast seem too high for my eyes.

Fira

I like FiraCode font the most, it is just beautiful and supports ligatures.

Alternatively, you can browse ProgrammingFonts or other ligature fonts like Hasklig to see which font suits you.

Theme and font are completely personal taste, but if you like me, please give One Dark and Fira a try, here is how to do that in Xcode, Android Studio and Visual Studio Code, which are editors that I use daily.

Xcode

Firstly, you need to install the latest compiled font of FiraCode

I used to have my own replication of One Dark, called DarkSide, this was how I learned how to make Xcode theme. For now, I find xcode-one-dark good enough. Xcode theme is just xml file with .xccolortheme extension and is placed into ~/Library/Developer/Xcode/UserData/FontAndColorThemes

After installing the theme, you should be able to select it from Preferences -> Fonts & Colors

And it looks like below.

Android Studio

Android Studio defaults to have only Default and Dracula theme. Let’s choose Darcula for now. I hope there will be One Dark support.

Also, Android Studio can preferably selects Fira Code, which we should have already installed. Remember to select Enable font ligatures to stay cool

It looks like this

Visual Studio Code

Installing theme in VSCode is easy with extensions. There is this One Dark Pro that we can install directly from Extensions panel in VS Code. Alternatively, you can also choose Atom One Dark Theme

Then go to Preferences -> Settings to specify Fira Code . Remember to check for Font Ligatures

The result should look like this

20 recommended utility apps for macOS

Issue #274

Original post https://hackernoon.com/20-recommended-utility-apps-for-macos-in-2018-ea494b4db72b


Depending on the need, we have different apps on the mac. As someone who worked mostly with development, below are my indispensable apps. They are like suits to Tony Stark. Since I love open source apps, they have higher priority in the list.

Open source apps

iTerm 2 https://www.iterm2.com/

iTerm2 is a replacement for Terminal and the successor to iTerm. It works on Macs with macOS 10.10 or newer. iTerm2 brings the terminal into the modern age with features you never knew you always wanted.

iTerm2 has good integration with tmux and supports Split Panes

Term2 allows you to divide a tab into many rectangular “panes”, each of which is a different terminal session. The shortcuts cmd-d and cmd-shift-d divide an existing session vertically or horizontally, respectively. You can navigate among split panes with cmd-opt-arrow or cmd-[ and cmd-]. You can “maximize” the current pane — hiding all others in that tab — with cmd-shift-enter. Pressing the shortcut again restores the hidden panes.

There’s the_silver_searcher with ag command to quickly search for files

oh-my-zsh https://github.com/robbyrussell/oh-my-zsh

A delightful community-driven (with 1,200+ contributors) framework for managing your zsh configuration. Includes 200+ optional plugins (rails, git, OSX, hub, capistrano, brew, ant, php, python, etc), over 140 themes to spice up your morning, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.

I use z shell with oh-my-zsh plugins. I also use zsh-autocompletions to have autocompletion like fish shell and z to track and quickly navigate to the most used directories.

spectacle https://github.com/eczarny/spectacle

Spectacle allows you to organize your windows without using a mouse.

With spectable, I can organise windows easily with just Cmd+Option+F or Cmd+Option+Left

insomnia https://github.com/getinsomnia/insomnia

Insomnia is a cross-platform REST client, built on top of Electron.

Regardless if you like electron.js apps or not. This is a great tool for testing REST requets

Visual Studio Code https://github.com/Microsoft/vscode

VS Code is a new type of tool that combines the simplicity of a code editor with what developers need for their core edit-build-debug cycle. Code provides comprehensive editing and debugging support, an extensibility model, and lightweight integration with existing tools.

This seems to be the most popular for front end development, and many other things. There’s bunch of extensions that make the experience to a new level.

IconGenerator https://github.com/onmyway133/IconGenerator

Built by me. When developing iOS, Android and macOS applications, I need a quick way to generate icons in different sizes. You can simply drag the generated asset into Xcode and that’s it.

vmd https://github.com/yoshuawuyts/vmd

Preview markdown files in a separate window. Markdown is formatted exactly the same as on GitHub.

colorpicker https://github.com/Toinane/colorpicker

A mininal but complete colorpicker desktop app

I used to use Sip but I often get the problem of losing focus.

GifCapture https://github.com/onmyway133/GifCapture

I built this as a native macOS app to capture screen and save to gif file. It works like Licecap but open source. There’s also an open source tool called kap that is slick.

Itsycal https://github.com/sfsam/Itsycal

Itsycal is a tiny calendar for your Mac’s menu bar.

The app is minimal and works very well. It can shows calendar for integrated accounts in the mac.

PushNotifications https://github.com/onmyway133/PushNotifications

I often need to test push notification to iOS and Android apps. And I want to support both certificate and key p8 authentication for Apple Push Notification service, so I built this tool.

Lyrics https://github.com/onmyway133/Lyrics

A menu bar app to show the lyric of the playing Spotify song

When I listen to some songs in Spotify, I want to see the lyrics too. The lyrics is fetched from https://genius.com/ and displayed in a wonderful UI.

gitify https://github.com/manosim/gitify

GitHub Notifications on your desktop.

I use this to get real time notification for issues and pull requests for projects on GitHub. I hope there is support for Bitbucket soon.

FinderGo https://github.com/onmyway133/FinderGo

FinderGo is both a native macOS app and a Finder extension. It has toolbar button that opens terminal right within Finder in the current directory. You can configure it to open either Terminal, iTerm2 or Hyper

Atom one dark theme

This is about theme. There is the very popular dracular themes, but I find it too strong for the eyes. I don’t use Atom, but I love its one dark UI. I used to maintain my own theme for Xcode called DarkSide but now I use xcode-one-dark for Xcode and Atom One Dark Theme for Visual Studio Code.

I also use Fira Code font in Xcode, Visual Studio Code and Android Studio, which has beautiful ligatures.

Chrome extensions

I use Chrome for its speed and wonderful support for extensions. The extensions I made are github-chat to enable chat within GitHub and github-extended to see more pinned repositories.

There are also refined github, github-repo-size and octotree that are indispensable for me.

caprine https://github.com/sindresorhus/caprine

Caprine is an unofficial and privacy focused Facebook Messenger app with many useful features.

Close source and commercial apps

Sublime Text https://www.sublimetext.com/

Sublime Text is a sophisticated text editor for code, markup and prose. You’ll love the slick user interface, extraordinary features and amazing performance.

Sublime Text is simply fast and the editing experience is very good. I’ve used Atom but it is too slow.

Sublime Merge https://www.sublimemerge.com/

Meet a new Git client, from the makers of Sublime Text

Sublime Merge never lets me down. The source control app is simply very quick. I used SourceTree in the past, but it is very slow and had problem with authentication to Bitbucket and GitHub, and it halts very often for React Native apps, which has lots of node modules committed.

1 Password https://1password.com/

1Password remembers them all for you. Save your passwords and log in to sites with a single click. It’s that simple.

Everyone need strong and unique passwords these day. This tool is indispensable

Monosnap https://monosnap.com/welcome

Make screenshots. Draw on it. Shoot video and share your files. It’s fast, easy and free.

I haven’t found a good open source alternative, this is good in capturing screen or portion of the screen.

VLC https://www.videolan.org/index.nb.html

iTunes or Quick Time has problem with some video codecs. This app VLC can play all kinds of video types.

Xcode https://developer.apple.com/xcode/

Xcode is the go to editor for iOS developer. The current version is Xcode 10. From Xcode 8, plugins are not supported. The way to go is Xcode extensions.

I have developed XcodeColorSense2 to easily recognise hex colors, and XcodeWay to easily navigate to many places right from Xcode

Sketch https://www.sketchapp.com/

Sketch is a design toolkit built to help you create your best work — from your earliest ideas, through to final artwork.

Sketch is the most favorite design tool these days. There are many cool plugins for it. I use Sketch-Action and User Flows

Where to go from here

I hope you find some new tools to try. If you know other awesome tools, feel free to make a comment. Here are some more links to discover further

Introducing Learn Talks — Awesome conference and meetup talks

Issue #269

Original post https://medium.com/swlh/introducing-learn-talks-awesome-conference-and-meetup-talks-e97c8cf7e0f

Product Hunt https://www.producthunt.com/posts/learn-talks


Hi, it’s Khoa here. I’m so glad to finally launch LearnTalks, in order to help others and myself to catch up with new conference and meetup talks.

Being one who is extremely passionate about making things and writing , I also love to learn about every new thing in tech. Tech moves so fast, what we learn today may be deprecated very soon, and only continuous learning can keep us move forward. Tech conference and meetup are best places to learn about new things and tips, although there are some rises and falls …, they are still growing and provides valuable resources for lots of people. There are lots of conferences and meetups that one can’t go to all, this can give fear of missing out feeling.

Fortunately people are kind enough to always publish videos publicly so others can learn from. I have been for a long time curating a list… to keep track of all cool videos, but it get out of hand very quickly.

That’s why I make LearnTalks.com as a convenient place to search and explore new tech talks. The features include

  • Easy search for talk, author and event
  • See upcoming events
  • Explore tags of topics and technologies
  • Mobile friendly

Firstly, thanks to all the people who helped me alpha test the website and provided valuable feedback. I addressed and fixed many issues.
And thanks a lot to many conference organisers who gave me a yes, support and encouragement promptly after I sent emails. Thanks a lot for spending your free time organising cool events and sharing the videos to the community. I really appreciate.

This website is just a curation to videos, it does not repost or claim copyright of any of the videos. And there are links back to conference and meetup pages. It is free to use and has no commercial purpose.

Hope you find the website useful as I do. There are of course many things needed to improve, I’m looking forward to receiving feedbacks and support from you ❤️ If there are any issues or copyright violations, please feel free to drop me a message.

Jitter buffer in VoIP

Issue #157

This post was from long time ago when I did pjsip


A jitter buffer temporarily stores arriving packets in order to minimize delay variations. If packets arrive too late then they are discarded. A jitter buffer may be mis-configured and be either too large or too small.

Impact

If a jitter buffer is too small then an excessive number of packets may be discarded, which can lead to call quality degradation.

Lower settings cause less delay in the meeting, but meetings with lower settings are more susceptible to jitter effects caused by network congestion. Less data is buffered, increasing the likelihood that delayed or lost packets will produce a jitter effect in the media stream.

If a jitter buffer is too large then the additional delay can lead to conversational difficulty.

Higher settings are more effective at reducing jitter effects. With higher settings, more data is buffered, which allows more time for delayed packets to arrive at the client. However, higher settings also result in more delay (or latency) in the meeting. A user who is speaking will not be heard immediately by the other meeting participants. The delay in the meeting increases with the amount of time that data is held in the buffer.

Resolution

A typical jitter buffer configuration is 30mS to 50mS in size. In the case of an adaptive jitter buffer then the maximum size may be set to 100-200mS. Note that if the jitter buffer size exceeds 100mS then the additional delay introduced can lead to conversational difficulty.

Reference

  1. lib.boulder.ibm.com/infocenter/sametime

  2. http://www.voiptroubleshooter.com

How to calculate packet size in VoIP

Issue #155

As you have probably observed in your studies, there is a determined method for calculating VoIP packet sizes. The packet size depends on many different variables, so there is no great answer for an “average” packet size – average depends on the environment. Just as an example, if you currently have VoIP running within a LAN and want to provision a new WAN so you can use VoIP to another site, knowing how big your VoIP packets are on the LAN won’t help. See below for a VoIP packet size calculation for a typical LAN, which will get you started.

Packet size

The general formula for VoIP packet size is this

1
Frame overhead + Encapsulation overhead + IP overhead + Voice payload.

Let’s say the packet is going across our LAN, so right now the frame overhead is 18 Bytes, for Ethernet II. (This size would change later if the packet crosses a trunk with 802.1Q tagging or ISL encapsulation, or is destined for the WAN, where a different link layer framing will probably be in use.)

Encapsulation

Encapsulation overhead would include things like IPSec tunnels for security. Suppose we are not encapsulating this voice packet, so there is no overhead here.

“IP overhead” has overhead occurring at layer 3 and above, so for SIP phones this means IP (20 Bytes), UDP (8 Bytes), and RTP (12 Bytes). This is a total of 40 Bytes of IP overhead.

Lastly, you must calculate the size of the actual voice payload. Suppose we use the G.711 codec, which gives us a codec bandwidth of 64kbps. Also suppose our phones have a packetisation period of 20ms (meaning 20ms worth of voice goes into every packet). With these two numbers, we can figure out the size of the voice payload. Since one second of voice contains 64 kilobits of data (“64 kbps”), it is easy to calculate how many bits

Find the amount of Bytes per payload:

1
2
64000 bits * .02 seconds = 1280 bits of voice per payload  
1280 bits / 8 bits per byte = 160 Bytes of voice per payload

The total overhead is 58 Bytes (18 + 40)
The total VoIP packet size is 218 Bytes (160 + 58 )

In the interest of full disclosure, it is easy to get a bit rate per second from here; just convert 218 Bytes into bits and multiply by the packetization rate (which is the inverse of your packetization period, in this case 50 packets per second). The bit rate for ONE stream of this voice is 87.2kbps… we hope the user isn’t just talking to himself, so double that for an actual phone conversation.

There are lots of other little things, like VAD and various header compressions, that you may need to factor into these calculations as well. As you can see, any one of these many things being off will give you a different answer, so knowing how to go about the entire process is important.

Reference

  1. www.techexams.net

Netcut and ARP

Issue #153

Bad people can use Netcut to limit other ‘s internet access in same network

How does Netcut work

Netcut uses attacking technique called ARP Spoofing.

ARP (Address Resolution Protocol) is a link layer procotol, it is used for resolving network layer address (IP) into link layer address (MAC).

When we want to send IP packet to another host (a computer in the same LAN, or the Gateway), we must know the destination IP address. In order for the packet to reach the destination, the destination IP address must be converted to the corresponding MAC address, so the transmission can be processed in the data link layer. To setup this mapping IP-MAC in the ARP table, we must first send ARP request as broadcast one to the LAN. In the happy case, the one with the IP in the ARP request will reply us with his MAC address.

Unfortunately, ARP is a stateless protocol. This means we continue to accept ARP replies and overwrite the old ones, even they have not expired yet. Worse, ARP does not define any authentication method to check whether the replies come from the trusted one (the one we want to receive the replies). These offer chances for the attacker to perform ARP Spoofing.

The theory behind ARP Spoofing

From the machine in the LAN, the attacker associate his MAC address and IP address of the target host (usually the Gateway), so that any traffic sent to that target host will come to the attacker. Here the attacker can decide whether to modify the packet, send or not.

There are 3 types of ARP Spoofing

  1. Spoof the host computer
  2. Spoof the Gateway
  3. Spoof both the host computer and the Gateway

To see the ARP table

Open Command line (Windows) or Terminal (Mac OSX), and type

1
arp -a

This will list the MAC address associated with a specific IP. Note that some mappings maybe wrong due to ARP Spoofing

How to prevent against this ?

To prevent spoofing our computer, we can use softwares (search for Anti Netcut, Anti ARP spoofing, …) or set the static ARP ourselves. In fact, those softwares are based on setting static ARP. This way we set the static mapping IP-MAC for a specific host (computer or Gateway), and the OS definitely ignores all ARP replies for that IP.

Example of static ARP mapping associated with the Gateway, performed on the computer host

1
192.168.1.1 B4-B3-62-7C-CE-55

Here 192.168.1.1 and B4-B3-62-7C-CE-55 are the Gateway’s IP and MAC address

To prevent spoofing the Gateway, we must set static ARP on that Gateway. Go to the Gateway/Router interface, in its ARP setting, fill in the mapping IP-MAC for a specific host

Look for that Gateway manual or the related guide on how to perform this. This is devices dependent-method, but the theory remains the same.

Example of static ARP mapping associated with the computer host, performed on the Gateway

1
192.168.1.2 64-70-02-B2-9B-E1

Here 192.168.1.2 and 64-70-02-B2-9B-E1 are the machine host ‘s IP and MAC address. The machine host can be any computer in the LAN

How to set static ARP

Proposed that

192.168.1.1 The destination host ‘s IP

B4-B3-62-7C-CE-55 The destination host ‘s MAC

Local Area Connection Our network interface name

Open Terminal (Mac OSX)

To delete specific mapping

1
sudo arp -d 192.168.1.1

To set specific mapping

1
sudo arp -s 192.168.1.1 B4-B3-62-7C-CE-55

Reference

  1. http://en.wikipedia.org/wiki/ARP_spoofing

Case sensitivity in HTTP

Issue #115

Is URL case sensitive ?

According to HTML and URLs

URLs in general are case-sensitive (with the exception of machine names). There may be URLs, or parts of URLs, where case doesn’t matter, but identifying these may not be easy. Users should always consider that URLs are case-sensitive.

Is header case sensitive?

According to RFC 7230

Each header field consists of a case-insensitive field name followed by a colon (“:”), optional leading whitespace, the field value, and optional trailing whitespace.

Is method case sensitive?

Using URLSession, mostly we will get 200 with request.httpMethod = "GET" and 400 with request.httpMethod = "get". Generally speaking, you should use some popular wrappers Alamofire or Malibu as they are mature enough. Spend your precious time solving more important problems instead.

According to RFC 7231

The method token is case-sensitive because it might be used as a gateway to object-based systems with case-sensitive method names.

Using assembly

Issue #112

I’m very fascinated when people use assembly to perform investigation, that’s just mind blowing 💥 . Here are some of the favorite use cases

Please reconsidering your choice of libraries

Issue #105

Are you willing to take vaccines you don’t know about?

I like open source. I ‘ve made some and contributed to some. I also use other people ‘s open source libraries and learn a lot from them 😇

Open source can help us build better, faster and maybe more performant software by basing on other people ‘s hard work. We can also collaborate and make it better. But it’s also a double edges sword if you’re not judging carefully.

Putting a little bit more dedication

You can skip this post if your project is just for fun, and you don’t care about future maintenance. If you’re making client or product projects, you should care and put a little more dedication into it. The company and your teammates trust you to do the good work.

I’ve admitted that I ‘ve done node.js and electron.js. The choice is because it’s just a utility that I want to make quickly, and there ‘s many node.js packages that I can use immediately. I have little experience in node.js, so I accept the risk do get the work done. But if you’re experienced developer in your platform, and it’s your important project, then it’s a different story 💥

I’m kind of experimental person, so I always want to try new things. But I also learn the hard way to not over engineer, and to live as close to the system as possible. I just read Much ado about iOS app architecture and I agree with most of the points, that we shouldn’t fight the SDK and replace system frameworks.

To me, using 3rd libraries is like giving your life to someone else ‘s hands, that you can’t make any decision for your future. Please don’t just pod install and consider it done 🙏

What about the stars

People tend to follow those that have lots of followers, and to star a project with lots of stars. Don’t trust the stars. It means nearly nothing. The star is just the result of some marketing effort. Being featured or not in a newsletter can make 1k stars difference. Just because it was featured in a newsletter does not necessarily mean that it is good 😬

You should judge it yourself by checking how good the source code is, how many documentation are available, and whether there is unit tests or not. The author is just human, so he can’t help maintain the library forever. You’re taking a big risk if you don’t have good picture of the library.

The system, especially iOS, changes very often. There are some libraries that try to “replicate” system APIs or perform type checking for every possible types. It can be that the author pick the most common use cases, or just trying to provide a cleaner APIs to the user. But if things change, will that author be willing to fix that? Will you be stuck there and making another issue asking for help? We’re making life better, not traps for everyone to fall into 🙀

Here I don’t try to blame anyone, “you is not your work”. I just say that you should check it more thoroughly. You can consult your colleagues and discuss if it’s good to integrate. Most of the time, pulling a huge library just for some tiny syntactic sugar does not worth it

I just put some random links here and you can determine if you like or not

Please

Would you take a very big risk for so little return ? Always implement and imagine that you will be the next maintainer for the project, then you will act differently.

So the next time, please reconsider your choice of libraries. Take 1 step back and analyse a bit ❤️

Fixing login hanging in macOS High Sierra

Issue #86

Today I met a strange problem. After I enter my password, the progress bar runs to the end, and it is stuck there forever. No matter how many times I try to restart.

I finally need to go to Recovery mode by pressing Cmd+R at start up. I then select Get Help Online to open Safari. Strangely enough I wasn’t connected to Internet

After select the wifi icon on the status bar to connect internet, I then restart and can login again. It seems that macOS is checking for something before allowing user to login

Dear SDK developers

Issue #84

Dear SDK developers,

  • Please don’t do swizzling. Give us instructions on where to call your APIs instead of doing unnecessary swizzling. You’re making it for developers to use, and they know how to write code. Most of the time, you don’t know how to do swizzling right ⚠️
  • Please don’t use configuration file. If possible, please consider configuration via pure code, instead of the plist file that is more exposable in the app bundle.
  • Please don’t make assumption about the app. Your assumptions about the app the SDK is going to be integrated are not always correct. Every app has its own use case and view hierarchy.
  • Please provide proper releases. Tag and make releases for new changes in the SDK. If there are major changes, there should be migration guide and affect of that to older apps. Also, please write proper change logs, either in release notes or change log file.
  • Please don’t leave us with a dump header file. Please add documentations to all the functions.
  • Please improve the README. To avoid all the guessing, please improve the README with detail instructions.
  • Please include a sample demo project. When making a demo project, you possible have chances to deal with potential problems. And developers have a clue on which steps they might be missing.
  • Please open source it. You’re selling your service, not the code. By open sourcing it, the code is clear to everybody, and they might help you with bug fixing and suggestion.

To be honest, I was very scared when asked to integrate the SDK with poor documentation and closed source. It’s like playing the guessing and praying game.

If the service is not important to you, and you’re doing it for fun, then you can ignore these requests. But if you’re serious about it, then please consider doing. We know you can do better 💪

Thanks ❤️

Reading list

Issue #78

These are my favorite books, screencasts, languages, tech and services that I have been exploring

Books

Programming

Java

Javascript

iOS

Haskell

Life

Screencasts

Blog

Language

  • C
  • C++
  • Objective C
  • Swift
  • C#
  • Java
  • Kotlin
  • Javascript
  • Applescript
  • Dart
  • Go
  • Haskell

Tech & Service

  • iOS, macOS
  • tvOS, watchOS
  • react.js
  • electron.js
  • Android
  • Flutter
  • React Native
  • Chrome extension
  • Sketch plugin
  • Xcode extension
  • Slack bot
  • Windows Phone
  • Windows Mobile 6
  • Symbian
  • J2ME
  • Windows Metro
  • ASP.NET
  • XNA
  • Unity
  • node.js
  • Docker
  • Kubernetes
  • Heroku
  • Google Cloud
  • Firebase
  • TravisCI, CircleCI, Bitrise, BuddyBuild, Jenkins
  • GitHub, Bitbucket
  • JIRA, Pivotal, Trello
  • Sketch
  • GRPC
  • Protobuf