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

Accumulate sliding windows relative to origin

I have an array A with the shape (3,3) which can be thought of as the sliding window view of an unkown array with the shape (5,). I want to compute the inverse of windowing the array with the shape (5,). The adjoint operation of this will be summation. What I mean is that I […]

Categories
Mastering Development

indexing rows and columns in numpy

a = np.array(list(range(16).reshape((4,4)) array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11], [12, 13, 14, 15]]) Say I want the middle square. It’d seem reasonable to do this: a[[1,2],[1,2]] but I get this: array([5, 10]) This works, but seems inelegant: a[[1,2],:][:,[1,2]] array([[5, 6], [9, 10]]) So my questions are: […]

Categories
Mastering Development

How do you create a long number from a List

How do you create a long number from a List<Integer> ? From: List<Integer> ints = Arrays.asList(1,2,3,4,5,6,7,8,9) TO: long = 1234567489 Thanks

Categories
Mastering Development

How to add limited hints when programming a quiz?

I am making a trivia quiz that allows users to solve 10 trivia questions and get a score. I am planning to provide the users 3 hints and print out Sorry! You used all the hints. when the user uses all 3 hints. How do I do that? I know I would need to use […]

Categories
Mastering Development

Rewriting a loop with Rccp

I am a novice Rcpp user. I want to fasten my for loop which uses several entities from r environment, and updates two vectors through iterations. The problem is that this is my first time facing c or c++ so I do not understand how to write rcpp with inline packages. Here is the reproducible […]

Categories
Mastering Development

How to get parallel GPU pixel rendering? For voxel ray tracing

I made a voxel raycaster in Unity using a compute shader and a texture. But at 1080p, it is limited to a view distance of only 100 at 30 fps. With no light bounces yet or anything, I am quite disappointed with this performance. I tried learning Vulkan and the best tutorials are based on […]

Categories
Mastering Development

manage an event for the entry widget and a date

on an exercise asking to enter a date, to check its format, this works. I stumble upon a difficulty to impose two bind events of type and on the Entry widget. Only the event works. If I enter a date and then click directly in the Entry KM_Counter, I get this error: print("addData – Date […]

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

Numpy.NET Getting Values

I’m trying to "convert" the Keras notebooks made by F. Chollet to C# / .NET applications. You can find them here. I am specifically working on "3.5 – Movie Reviews" as of right now. The problem is, I can’t convert my NDarrays to C# arrays to use the values. I tried this method (in README […]