Publications by tomaztsql
Little useless-useful R functions – R Solution with O(n) Time and O(n) Space complexity for CanSum() problem
CanSum problem is a problem where a given array of integers (nums) and a target integer (target), return boolean (TRUE \ FALSE) indicating, that the target integer can be calculated using two or more numbers in array nums. You may assume that each integer from the array can be used multiple times. You can also assume, that any integer (in nums ...
2659 sym R (1203 sym/5 pcs) 4 img
Little useless-useful R functions – Greedy Salesman
Travelling Salesman Problem is an NP-complete problem and an old mathematical problem. For this useless function, we will look for the nearest city from the previous city (or starting point) and repeat until we visit all cities. The greedy solution is fairly simplified but one disadvantage; it might not give you the best path (optimal solution) a...
1465 sym R (1934 sym/3 pcs) 6 img
Little useless-useful R functions – Drawing randomly generated @Github contribution graph
Github is collecting various images on their Instagram and Twitter that looks like a contribution graph. Well, why not create one in R with randomly generated data and the use of the ggplot library. Run the function by yourself: library(ggplot2) # introduce Github colours colours <- c("#ebedf0", "#9be9a8", "#40c463","#309b4c","#216e39") # colour...
936 sym R (1592 sym/2 pcs) 6 img
Retrieving list of users for all workspaces in your PowerBI tenant using Powershell
From previous blogpost(s): Deleting Power BI datasets using Powershell Longterm-storage of Power BI activity logs and statistics using Powershell Determining and checking who has access to a particular workspace in your organisation can be time consuming task. You can always retrieve the list of workspaces and access the list of all users with...
1508 sym R (1625 sym/3 pcs) 4 img
Python and R have matrix and simple loops. What can you use in T-SQL?
Many of you have already used any programming or scripting language. And you can tell that, there are some functionalities that are intuitive (for loops, enumerations, collections, …), data types and also short-hands. One of these data types is a matrix. Commonly used in a programming language, yet fairly unknown in T-SQL. You can say, that ma...
3682 sym Python (1750 sym/8 pcs) 10 img
Simple R merge method and how to compare it with T-SQL
Merge statement in R language is a powerful, simple, straightforward method for joining data frames. Nevertheless, it also serves with some neat features that give R users fast data wrangling. I will be comparing this feature with T-SQL language, to show the simplicity of the merge method. Creating data.frames and tables We will create two tables...
3955 sym R (2798 sym/15 pcs) 14 img
Little useless-useful R functions – Animating datasets
I firmly believe that animation and transition between different data states can give end-users much better insights and understanding of the data, than a single table with data points or correlation metrics. With help of ggplot, gganimate, you can quickly create an animation based on your needs. This is a simple IRIS dataset example. Animation ...
1003 sym R (388 sym/1 pcs) 2 img
Little useless-useful R functions – Finding total sum of all sub-arrays and sum of maximums
When it comes to O(N log(N)) time complexity functions, this is the right section. Given an array of natural numbers (later, you will see, it can be real, or any other less complex system (rational, irrational)) and you create a tree of all permutations preserving conjugation order. array = c(1,2,3,4) #sub-array with sum in [] brackets 1. c(1) [...
1002 sym R (1163 sym/3 pcs) 2 img
Comparing performances of CSV to RDS, Parquet, and Feather file formats in R
From the previous blogpost:– CSV or alternatives? Exporting data from SQL Server data to ORC, AVRO, Parquet, Feather files and store them into Azure data lake we have created Azure blob storage, connected secure connection using Python and started uploading files to blob store from SQL Server. Alongside, we compared the performance of differ...
3418 sym R (3566 sym/4 pcs) 4 img
Little useless-useful R functions – Plotting the decimal and binary conversion
How does the conversion between decimal to binary or from binary to decimal behave? With another useless function, I have plotted the points (x = decimal number, y = converted binary number) on a scatter plot. Just to find out that the graph shows the binomial distribution function. First we create a useless function to convert from decimal to ...
1928 sym R (900 sym/3 pcs) 6 img