Categories
Mastering Development

Passing multiple values into variable

I’m trying to pass a value from a table into a variable which I can then use in a query. The problem is that I need the variable to have multiple values, which I’ve never done before. Below is an example of what I’m trying to do. CompanyID has multiple values for control number. How […]

Categories
Mastering Development

Unexpected results in Java multi threads despite locks

I’m struggling with some exercise code that should calculate sum of squares using threads. For some reason I get inconsistent results despite the use of locks, also made sure I am locking on objects and not local items / variables etc. When I add logging to understand the behavior, the code runs much slower and […]

Categories
Development

SQL – Columns will not sum

New to coding SQL and have just been Googling my way to write Queries that work for me but I am having a hard time with the one I am currently working on. The goal of the query is to sum the AHT and ACW columns based on the week number. I got it to […]

Categories
Development

Two-Way Repeated Measures ANOVA: Error in lm.fit()… 0 non-na cases (rstatix)

I am trying to run a Two-Way Repeated Measures ANOVA using the R Statix package based on the description from here however I am running into the subject error with my dataset. The data consist of 10 replicate biomass measurements recorded at each of 8 Locations across 5 months (10 reps x 8 locations x […]

Categories
Development

How do you write multiple rasters in [r]?

I am using lapply() to load 144 rasters as in my previous post: How do you load multiple rasters in [r] using a for loop? library(raster) rastlist <- list.files(path=path, pattern=’tif$’, full.names=TRUE) allrasters <- lapply(rastlist, raster) allrasters ends up being a large list with 144 elements, of which ‘name’ looks like one of the attributes, I […]

Categories
Development

load dataset in tensorflow 2.0 having a dictionary

trying to make an input pipeline in tensorflow but i am unable to load dataset using tf.data.experimental.CsvDataset due to a dictionary containing integers in it in the fourth column a = [[i for i in [1]*5] for j in range(5)] a = pd.DataFrame(a) a[4] =[{132,345,657,89},{123,213,1245,6576,1},{22344,32},{213,233},{}] a.head() type(a.iloc[4,4]) a.to_csv(‘float.csv’,index = False,header = False,float_format = ‘int32’) # […]

Categories
Development

Calculate the textbox value based on the value of combobox ? ( wpf )

I have a small program, because I’m new, my program is to bring data from sql sever to textbox via combobox option and use the value shown in that textbox to calculate the + I have made it to the step of putting up the data, now thanks to you to help me with the […]

Categories
Development

How to minimize the sum of the elements in the final array after performing k number of operation

This question is asked in my interview coding and there were 12 test cases and i am only able to pass 8 of them. minSum(List values, int k) method need to complete. Example : nums = [10,20,7] and k=4 ans answer for this array is 5+5+4=14. Each operation consists of removing element from the array, […]

Categories
Development Linux

Make a script from awk

I run a command to reformat my textfile: awk -F, ‘{if ($6<0) print $1$2,” “$3$4,$5$6; else print $1$2,” “$3$4$5,$6;}’ filename.txt > seqXXX.txt how can i make a script, so i don’t have to type a command every time ? I read some articles how to do it, but got more confused

Categories
Development Python

Parsing a .pdb file in Python and creating a dictionary for specific record types

First, let me start by saying that I’m doing this as a Python exercise and I’m not allowed to use Biopython. I am writing a script that will help me parse any .pdb file generated from a trajectory. I am trying to create a dictionary that would link the chain variable with the resNumber variable. […]