Categories
Mastering Development

Creating custom/more distance of ticks x axis in ggplot R

Please find my code below: packages <- c("ggplot2", "dplyr", "quantreg", "officer","tidyverse","here","glue","rvg","viridis","scales") install.packages(setdiff(packages, rownames(installed.packages()))) lapply(packages, require, character.only = TRUE) data <- read.csv(file=’Spiderplot_data.csv’, header=TRUE) Progressed <- as.factor(data$Progression) Response <- as.factor(data$X) Response <- factor(data$X, levels = c("Progressive Disease", "Stable Disease", "Partial Response", "Complete Response")) highlight_df <- filter(data, Progression == 1) p <- ggplot() + geom_line( data, mapping = […]

Categories
Mastering Development

How can I retrieve programmatically from command line my SO rep and number of badges?

Orignal question My initial attempt was to run curl https://stackoverflow.com/users/5825294/enlico and pipe the result into sed/awk. However, as I’ve frequently read, sed and awk are not the best tools to parse HTML code. Furthermore, the above URL changes if I change my user name. Oh, this is my quick attempt with sed, written on multiple […]

Categories
Mastering Development

Syntax Error: ‘return’ outside function: my indentations seem to be correct

So first of all im writing a program that will total up all of the values in a list / array and heres what i got so far def go( ann ): total = 0 for i in range(0,len(ann)): total = total+ann[i] return total print ( go( [-99,1,2,3,4,5,6,7,8,9,10,12345] ) ) print ( go( [10,9,8,7,6,5,4,3,2,1,-99] ) […]

Categories
Mastering Development

How to get key from the value of dictionary

I have the following set of rules for grading system if 25 < score <= 30, grade = A. if 20 < score <= 25, grade = B. if 15 < score <= 20, grade = C. if 10 < score <= 15, grade = D. if 5 < score <= 10, grade = E. […]

Categories
Mastering Development

How do I block certain websites which have XYZ in their URL?

I wanted to write some code which limits the usage of some websites such as Instagram completely blocks porn sites by blocking every site with words such as "porn" or "xxx" in the URL switches the computer off automatically at some times It all works out, except for the blocking websites part. I tried to […]

Categories
Mastering Development

Compare two lists in Pandas Dataframe with different length

I have two dataframes with lists which I need to compare in order to know if one row is the same than the other and then add it. The two datasets are: Dataset 1 sex age zip_code 0 F 46 08204 [6, 40, 9, 44, 30] 1 F 40 08205 [33, 41, 48, 50, 30] […]

Categories
Ask Geographic Information System (GIS)

Column value as index in function

This comes from the solution of another question. I have a network of polylines representing a river network, where I am working to make a calculation at each point on the polyline, based on some of some information from the downstream segments. In the example here, I have 5 river segments, segments 1-5. Each segment […]

Categories
Ask Geographic Information System (GIS)

Dynamic style using variable substitution

I need to use an array of values to define a style of the WMS dynamically. I understood that I must use the Variable substitution SLD. I’m be able to use env variable to change fill and stroke of a polygons layer and set one unique color to all the features. Problems comes when I […]

Categories
Arduino Ask Engineering

6 buttons useless box

i want to make a useless box with 6 buttons MY CODE // steppmm*moveX=240 #include <Stepper.h> int BUTTON_PIN[7] = {26, 27, 22, 23, 24, 25, 10}; int lastState = LOW; int currentState; float Stepmm = 250 ; float A = 0; float B = 0; int S1[0]; const int stepsPerRevolution = 200 ; int switchPos[9] […]

Categories
Mastering Development

Need to generate output in the following format year, q1,q2,q3,q4 in the MS SQL server for below data

CREATE TABLE acquisition ( id INT PRIMARY KEY IDENTITY, company_name VARCHAR(100), cost_amount INT NOT NULL, acquired_at DATE NOT NULL ); INSERT INTO acquisition(company_name, cost_amount, acquired_at) VALUES (1,’HOFA’, 6850, ‘2010-01-17′), (2,’POGA’, 9256, ‘2019-09-04′), (3,’CUPU’, 9329, ‘2012-08-21′), (4,’BULO’, 5162, ‘2020-11-21′), (5,’GICE’, 5301, ‘2012-10-04′), (6,’TOSE’, 1790, ‘2018-09-30′), (7,’POWU’, 7183, ‘2019-05-21′), (8,’YEJO’, 1491, ‘2010-12-12′), (9,’XAMO’, 5974, ‘2010-03-23′), (10,’TEFA’, 9456, […]