Tutorial by Examples

Redis supplies the SISMEMBER command to test if a particular item is already a member of a set. Using the SISMEMBER command I can test and see if apple is already a member of my fruit set. If I construct my fruit set from the previous example, I can check and see if it contains apple using the fol...
Redis provides the ZADD command to add items to a sorted set. The basic form of the ZADD command is to specify the set, the item to add and it's score. For example, if I wanted to construct an ordered set of my favorite food (from least to most), I could use either of: zadd favs 1 apple zadd fav...
You can enhance your kernel by adding new I/O schedulers if needed. Globally, governors and schedulers are the same; they both provide a way how the system should work. However, for the schedulers it is all about the input/output datastream except for the CPU settings. I/O schedulers decide how an u...
The size of a Redis list can be deterimed using the LLEN command. If I have a four element list stored at the key my_list, I can get the size using: LLEN my_list which will return 4. If a user specifies a key that doesn't exist to LLEN, it will return a zero, but if a key is used that points t...
Redis provides seven different operations for working with scripts: Eval operations (EVAL, EVALSHA) SCRIPT operations (DEBUG, EXISTS, FLUSH, KILL, LOAD) The EVAL command evaluates a script provided as a string argument to the server. Scripts can access the specified Redis keys named as argum...
/** * Resizes an image using a Graphics2D object backed by a BufferedImage. * @param srcImg - source image to scale * @param w - desired width * @param h - desired height * @return - the new resized image */ private BufferedImage getScaledImage(Image srcImg, int w, int h){ //Cre...
The simpler way to use Bash in Windows is to install Git for Windows. It's shipped with Git Bash which is a real Bash. You can access it with shortcut in : Start > All Programs > Git > Git Bash Commands like grep, ls, find, sed, vi etc is working.
Be aware that the WebBrowser control is not sympathetic to your XAML definition, and renders itself over the top of other things. For example, if you put it inside a BusyIndicator that has been marked as being busy, it will still render itself over the top of that control. The solution is to bind th...
Insertion sort is one of the more basic algorithms in computer science. The insertion sort ranks elements by iterating through a collection and positions elements based on their value. The set is divided into sorted and unsorted halves and repeats until all elements are sorted. Insertion sort has c...
Bubble Sort This is a simple sorting algorithm that repeatedly steps through the list to be sorted, compares each pair of adjacent items and swaps them if they are in the wrong order. The pass through the list is repeated until no swaps are needed. Although the algorithm is simple, it is too slow ...
Selection sort is noted for its simplicity. It starts with the first element in the array, saving it's value as a minimum value (or maximum, depending on sorting order). It then itterates through the array, and replaces the min value with any other value lesser then min it finds on the way. That min...
Since we have many different algorithms to choose from, when we want to sort an array, we need to know which one will do it's job. So we need some method of measuring algoritm's speed and reliability. That's where Asymptotic analysis kicks in. Asymptotic analysis is the process of describing the ef...
Quicksort is one of the advanced algorithms. It features a time complexity of O(n log n) and applies a divide & conquer strategy. This combination results in advanced algorithmic performance. Quicksort first divides a large array into two smaller sub-arrays: the low elements and the high element...
g + geom_bar(aes(x = cut, fill = color), position = "fill") + guides(fill = guide_legend(title = NULL))
g + geom_bar(mapping = aes(x = cut, fill = clarity), position = "dodge") + theme(axis.text = element_text(colour = "red", size = 12))
g + geom_histogram(aes(price, fill = cut), binwidth = 500) + labs(x = "Price", y = "Number of diamonds", title = "Distribution of prices \n across Cuts") + theme(plot.title = element_text(colour = "red", face = "italic"), ...
let messageBox:MessageBox = MessageBox() // set messageBox.setObject("TestObject1", forKey:"TestKey1") // get // but don't remove it, keep it stored, so that it can still be retrieved later let someObject:String = messageBox.getObject(forKey:"TestKey1", remov...
// init mUIPheonix = UIPheonix(with:myCollectionView) mUIPheonix = UIPheonix(with:myTableView) // connect model-view mUIPheonix.setModelViewRelationships([MyModel.nameOfClass:MyView.nameOfClass]) // add models for the UI models.append(SimpleButtonModel(id:1, title:"Hello World!")...
We show a plot similar to the showed at Linear regression on the mtcars dataset. First with defaults and the with some customization of the parameters. #help("mtcars") fit <- lm(mpg ~ wt, data = mtcars) bs <- round(coef(fit), 3) lmlab <- paste0("mpg = ", bs[1], ...

Page 1146 of 1336