Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- GitHub



  First steps with Scala, say goodbye to bash scripts…

Those who know me are aware that I’ve been following play framework, and actively taking part of it’s community, for a couple of years. Playframework 2.0 is right around the corner, and it’s core is programmed in Scala, so it’s a wonderful opportunity to give this object-oriented / functional hybrid beast a try… Like many others, I will pick a very simple script to give my first steps… Finding an excuse to give Scala a try With a couple of friends we are ...

   Scala,Functional programming,Bash script,Replacement     2012-01-12 06:45:16

  Here is what XcodeGhost author says

The first compiler malware in iOS was disclosed by Chinese iOS developers on Wednesday(Beijing time). The name of this malware is XcodeGhost as described by Alibaba researchers who released the analysis of this malware.  The malicious code is located in a Mach-O object file that was repackaged into some versions of Xcode installers. These malicious installers were then uploaded to Baidu’s cloud file sharing service for used by Chinese iOS/OS X developers. Xcode is Apple’s offic...

   IOS,SECURITY,XCODEGHOST,APP STORE,APPLE     2015-09-18 20:51:38

  Format JSON data on Ubuntu

JSON now becomes a very popular data format because of its simplicity and light-weight. Nowadays many RESTful APIs will offer a choice of exchanging JSON data between the server and client. Sometimes the data may not be formatted and it cannot be easily read by human beings. It's frequently desired that the unformatted JSON data should be formatted before read. Today we will show a few ways to format JSON data on Ubuntu. Assume we have a json file test.json with below content. { "title": "Test"...

   RUBY,PYTHON,NODEJS,JSON,JQ,PERL,LINUX,UBUNTU,YAJL     2016-08-17 11:05:09

  Ruby net-scp cannot scp multiple files with asterisk(*)

net-ssh/net-scp is a Ruby gem which can be used to scp files between different *nix machines. It's similar to how the *nix scp command. It can be used to scp a file or a directory. However, it seems it has some problem to scp multiple files using pattern *. For example, below script is supposed to download all files from remote directory to local directory: require 'net/scp' host = 'testmachine' login = 'testaccount' password = "testpassword" remote_path = '/tmp/remote...

   NET-SCP,RUBY,ASTERISK,MULTIPLE FILES     2016-10-20 03:00:13

  Mock Solutions for GoLang Unit Test

In Go development, Unit Test is inevitable. And it is essential to use Mock when writing Unit Tests. Mock can help test isolate the business logic it depends on, enabling it to compile, link, and run independently. Mock needs Stub. Stub function replaces the real business logic function, returns the required result, and assists the test. I involved the related test code for Controllers while writing Kubernetes Operator recently, and there would be mocks for GRPC and HT...

   UNIT TEST,TESTIFY,GOSTUB,GOMOCK     2020-10-31 21:59:15

  Different types of font icons

A website with just text belongs to the pre Web 2.0 era. A modern site will have different icons appearing on different places on the site. This will give the visitor a better visual feeling. But to have a set of consistent and well crafted icons is not an easy task. It may even require a dedicated icon designer to design them. Fortunately, we now can use font icons provided by many people around the web. Today we will introduce some of them. Font Awesome Font Awesome is an open source font ico...

   font icon, web design, font awesome     2015-07-19 06:22:48

  5 good anti SOPA designs

The Stop Online Piracy Act (SOPA) is a United States bill to expand the ability of U.S. law enforcement to combat online copyright infringement and online trafficking in counterfeit goods. Its goal is to protect the intellectual-property market and corresponding industry, jobs and revenue. However since its proposal, many organizations protest against it as they believed it would threaten free speech and innovation, and enable law enforcement to block access to entire internet domains due t...

   SOPA,PIPA,design     2013-12-24 03:26:31

  A strange behavior of printing struct with nested struct in GoLang

Normally when trying to print a struct , we would use %v to show all data of the struct. It will print the default format for each field in the struct. %v the value in a default format when printing structs, the plus flag (%+v) adds field names But recently we observed a strange behavior when printing a struct with nested struct which has a String() string implemented, the %v format prints an 'unexpected' output per our understanding.   Let's see the example snippet first. pa...

   PROGRAMMING,GOLANG     2018-10-29 09:59:49

  Why Data Structures Matter

Our experience on Day 0 of JPR11 yielded a nice example of the need to choose an appropriate implementation of an abstract concept. As I mentioned in the previous post, we experimented with Michael Barker’s Scala implementation of Guy Steele’s parallelizable word-splitting algorithm (slides 51-67). Here’s the core of the issue. Given a type-compatible associative operator and sequence of values, we can fold the operator over the sequence to obtain a single accumulated v...

   Data structure,JPR,Importance     2012-01-08 10:13:56

  Why exception would be thrown when deleting element while looping through HashMap in Java

HashMap and other Collection types are frequently used in Java application programming. This post will explain why exception would be thrown when deleting element with Map.remove() while looping through a Map using Iterator. This issue would also occur to other Collection types such as Set, List. Below is a sample code snippet demonstrating the exception thrown. Map<String,String> map = Collections.synchronizedMap(new TreeMap<String,String>()); map.put("key1","value1"); map.put("ke...

   JAVA,HASHMAP,CONCURRENTMODIFICATIONEXCEPTION     2018-06-30 12:49:09