There is a wall of size 4xN. You have infinite supply of bricks of size 4x1 and 1x4 in the house. How many ways are there to fill out a wall of size 4xN?
This can be addressed by dynamic programming. The characteristics of optimal substructure, recursive nature, and bottom-up approach were mentioned in this post.
Let's say, number of ways to fill out a wall of size 4xN with infinite supply of 4x1 and 1x4 bricks is said to be f(N). Per common sense, we know:
f(1) = 1
f(2) = 1
f(3) = 1
f(4) = 2
Also, when you think about it when filling out 4xN with f(N) ways of doing it, you can break f(N), when N >= 4, down to 2 substructures as below. Given the fact that one 4x1 can goes either horizontally or vertically. When it goes horizontally, there's only one way as shown in f(N-1). But when it goes vertically, all other 3 bricks may need to go vertically as well as seen in f(N-4) below.
Other than remote login, there's various useful things you can do with ssh, like running a remote command, multiplexing connections to save on server resource, setting up ssh aliases to save you some keystrokes, and so forth.
Recently, when my partner logged on a recently created CentOS server hosted at Digital Ocean, he saw the following messages:
Last failed login: Tue Jul 29 16:27:31 EDT 2014 from stuff2share.net on ssh:notty
Clearly that wasn't us trying to log in. Obviously, there was some malicious user(s) likely trying to enter our server with brute-force attacks. We were under a ssh brute force attack. Such malicious scan is not uncommon these days. It came just a couple days after our new server was up.
I learned a few good ways to prevent this:
Looking for a hosting service? For about 55 seconds, Digital Ocean said that's how long it'll take them to provision a server. That sounds effective, and the cost is relatively low compared to others, making it a cost-effective option.
Create A Virtual Server
I signed up at Digital Ocean, requested a server with CentOS, and chose Singapore region for hosting the image since that location in Asia is closer to one of my projects' target audience. It took 58 seconds wait time for creating the image. It lives up to the promise. Immediately, in my email box I received the IP and the root password so I can access the virtual host remotely via SSH.
Scrum is a flexible agile development practice / method / framework built around some agile principles and on top of BDD. Scrum is one of many agile methods. Each SCRUM team is recommended to be not too big. In Scrum practice, features of products are written from the perspectives of end users. Features are known as user stories. The collection of user stories are called product backlog, which is a wish list to make end product great.
Queue and Stack are basic data structure. This post is about implementing Breadth First Search (BFS) & Depth First Search (DFS) using concept of Queue and Stack.
FB released Graph API 2.0 on 4/30/2014 at f8. FB has changed a lot over time and it's hard to keep up. New Facebook App developers may feel frustrating and confusing. If so, you're not along. To develop an app using FB API, before you read FB Developer Quickstart, ready this post first which is supposed to help you get prepared quickly with less confusion.
Assuming we have a set of values (see left). If you write these values down on a a piece of paper, from the top element you can branch downward into either left or right element each has its value. You can get a set of values with triangular look as shown.
The question is, going from the value at the top to the bottom by choosing to go down the path of either left or right, what is the maximum sum among all possible paths?
Not every senior software developer understand good design principles. Good object-oriented design is not common. It's all about knowing the 'why' then devote to learning to design with good OOD concepts and OOP principles in programming. It takes disciplines and years of experiences.
In object-oriented design, classes are great to achieve Separation of Concerns that is modular, flexible, and reusable software. In addition, there are three good primary OOD concepts I'd like to fall back on, and 5 OOP principles that I initially forced myself practice coding Java, then I gradually became natural doing so.
In CQ, ResourceResolver class can be used for resolving a Request into a Sling Resource. However, given a random URL served by a CQ instance, how do you figure out the corresponding Sling Resource of the given URL as a result of Resource Mapping definition?
Let's assume we have some Resource Mapping rules (mapping definition) set up on our Author node via /etc/map so that a sample request to,
In CQ, let's say we want to expose some sort of REST API for our internal clients, but don't want these API's accessible by the public. For example, say we'd like the said JSP to be available internally (inside firewall), and to be invoked via the web. The API's responsibility is to clear Dispatcher cache via curl command behind the scene.