Code snippet to render a graphic using clutter and detect user click on the image, also demonstrates using the clutter library in a functional style and OO style. Source
Simple Clutter example showing how to create a label. Source
This code snippet shows how to group actors so that animations will effect them all uniformly. Source
Testing in Android has been a pain from the beginning and there is no standard architecture setup to execute the frictionless test. As you know there is no silver bullet […]
[ Originally published at https://mahendranv.github.io/posts/android-gradle-deps-kit ] Starting an android project will bring in a new set of challenges 👀 aka adding tons of Gradle dependencies. Even though you use these […]
We can use the array at method to fetch the items from the last element of an array.
You can alternatively already provide the searchKey in lowercase. If you want it as a function: If the key can’t be found, then it’ll return undefined, just like normal. If you […]
If you want the unique values as a list (or dataframe) then just replace the nunique with unique Source
Object destructuring assigns the properties of an object to variables with the same names by default. Here are a few examples. Source
Let’s assume you are passing a few values from the command line when you are running a node command. These values can be read inside your code using process.argv. All […]
Let’s say I would like to flatten an irregular list of lists. First approach is by using collections.Iterable where x is the irregular list of lists. Second approach is a […]
Let’s take a list of lists. To merge this lists to a flat list you can use the following ways. itertools.chain() functools.reduce() list.extend()
I have an array of country objects. In this array I would like to replace the key name with country. We can use map function to manipulate the array easily.
Python strings are immutable and they cannot be changed during the course of Python program execution. In Python, strings cannot be modified. You need to create a new string based […]
When creating a list in the UI from an array with JSX, you might get this error. To fix this we should add a key prop to each child and to any […]
To kill all processes running on the port 8080:
In this example, the counter is updated every time the user clicks on the Update Counter button, the page is refreshed and the updated counter value is shown. The refresh happens instantly […]
This is a simple approach to generate random string with either numbers or letters using a predefined set.
TypeError: Router.use() requires a middleware function but got a Object – How to fix this Express/Node.js error?
TypeError: Router.use() requires a middleware function but got a Object – How to fix this Express/Node.js error? You would typically face this error when you define a new router and […]
Syntax Examples An example from Github.
The first line contains N, the number of elements. The next line contains N space-separated integers.