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

SEARCH KEYWORD -- Remove item



  Permutation algorithm with JavaScript

In secondary school, we have learned permutation. Basically, for n numbers, the number of permutations for these n numbers can be calculated to n! which is called 'n factorial'. But to display all the permutations on the screen, we need to use a recursive function. The problem is how to write this function.  Next I write a program to display the permutations for n numbers with JavaScript. First, we need to understand that from these n numbers, we can first take any one number from it, and t...

   JavaScript,Permutation,Algorithm,Impleme     2011-09-21 12:02:35

  Remove duplicated elements in JavaScript array

During interviews, one frequent question asked would be something like how to remove duplicated elements in a JavaScript array and how many different ways you can think of. The interviewee would also be asked to write the code down. In real applications, normally front end would not need to handle this case since normally it would be done by backend, but still it's necessary for front end developers to know different ways of doing this. This post will share some of the common ways to remove dupl...

   JAVASCRIPT,ARRAY,DUPLICATED ELEMENT     2018-09-21 22:32:10

  A simple tutorial about CSS flex property

CSS Flexbox is a layout module that makes it easier to create flexible and responsive layouts in CSS. It provides a simple and powerful way to align elements within a container and distribute space between them. To use flexbox, you need to set the display property of an element to "flex". You can do this by adding the following rule to your CSS: .container { display: flex; } The flex container will now have two main axes: the main axis and the cross axis. By default, the main axis runs horizo...

   JUSTIFY-CONTENT,FLEX,CSS     2022-12-25 06:44:34

  Add ContextMenu to a customized View in Android

In Android, we may sometimes need to add ContextMenu to a View, it's not so easy to add ContextMenu to a customized View. Here we explain how to add ContextMenu to a customized View. First, we may need to create View.OnCreateContextMenuListener so that the customized view can register for it. Here is the class definition: public class GraphView extends View {     private View.OnCreateContextMenuListener vC = new View.OnCreateContextMenuListener() {       &...

   Android, ContextMenu,Customized view     2012-11-04 07:10:40

  Convert HTML to DOM elements using JavaScript

In some cases, one would want to convert a HTML string to the DOM elements so that JavaScript can handle them easily. This is frequently used when one get some data from third party APIs where the data is in HTML format. In JavaScript, there are a couple of ways one can use to convert HTML to DOM elements. DOMParser document.createElement DOMParser DOMParser can parse XML or HTML source stored in a string into a DOM Document. After the conversion, the normal JavaScript call of h...

   JAVASCRIPT,DOMPARSER,DOCUMENT.CREATEELEMENT,HTML,DOM     2017-08-18 22:51:46

  JavaScript delete specific item from array

Deleting an item from an array is easy using JavaScript’s built-in method splice(). However, if you are somewhat new to scripting, simply knowing about splice does not help you remove a certain item from an array. This article will solidly state the solution to this dilemma.If you want to remove a specific item from your array, you will simply use a basic loop and a conditional check with the splice()method.Here is a breakdown of what we will do in 3 easy steps, so tha...

   JavaScript,Array,Remove item,Splice,Dele     2011-09-16 16:38:52

  3 ways to remove duplicates in List

Frequently, we may have an ArrayList which stores many values, and we need to process the ArrayList and get what are the distinct values in the list, or we may want to count occurrence of each value in the ArrayList. We can remove the duplicates in a few ways. Here we propose 3 methods :     public static void main(String[] args){        //SuperClass sub=new SubClass();                String[...

   Java,List,Duplicate,Clear     2012-09-03 09:44:32

  A simple way to remove the small arrow on on desktop application shortcut

Maybe many of us will see a small arrow on desktop application shortcut after we install the application on Windows. Some may like it but some people may think it doesn't look beautiful enough. We may need to remove these small arrows somehow the desktop can be clean. So how? Many people may use a third party software to remove the small arrows, then they must go to download the software and install them. But do we necessary do this in order to remove the small arrow?The answer is no. Here I ...

   Small Arrow,Shortcut,Desktop,Application,Windows     2014-10-25 08:39:58

  3 meanings of Stack

We may frequently see stack when we read programming books. But many times we may be confused about the different meanings of it. This term actually has three common meanings. Here we explain the three different meanings of Stack in programming. 1. Data structure The first meaning of Stack defines a method for storing data. Its feature is LIFO9Last In First Out). In this data structure, data are accumulated level by level. The data last put in is added at the top of the stack. When using the dat...

   Stack,Memory,Data structure     2014-02-24 04:56:46

  Go channel explained

In Go, a channel is a type of concurrent data structure that allows two or more goroutines (Go's term for lightweight threads) to communicate with each other. Channels provide a way for goroutines to send and receive values, and they are an essential part of Go's concurrency model. Here's a simple example that demonstrates how to use channels in Go: package main import ( "fmt" ) func main() { // Create a new channel with the `make` function ch := make(chan int) // Start a new ...

   GOLANG,CHANNEL     2022-12-10 22:24:26