Categories
Development

How to convert a list of str to the list of ints?

I want to convert a given input to the list of ints. I can’t use : for, while, sum, map, reduce, filter, import, eval, sort, exec, compile and single. Here is what I wrote: def convert_int(my_line): i = len(my_line) – 1 if i == 0: return int(my_line[0]) else: return [int(my_line[i]), convert_int(my_line[:i])] line = input().split() print(convert_int(line)) […]

Categories
Development

Could not find function “CreateSinglerObject”

I am trying to get the function CreateSinglerObject from the SingleR package to work according to this guide here: http://comphealth.ucsf.edu/SingleR/SingleR_create.html Unfortunately I receive the error ‘Could not find’. Below is my input and output. Version is R-3.6.1. I appreciate any help you can give me. Thank you! I/O > library(Seurat) Warning message: In readRDS(path) : […]

Categories
Development Docker

how to enter running docker container and check machine learning training result?

I run machine learning model in docker container. The model will go through train , eval , test and interactive 4 process. I use following ways to start docker: sudo docker run –runtime=nvidia –name tensorflow_bert_dst -it -p 8888:8888 tensorflow/tensorflow:1.13.2-gpu-py3-jupyter The process of training is so long that I close the terminal and let docker running […]

Categories
Development

A simple reproducible example to pass arguments to data.table in a self-defined function in R

I have been googling this answer for a few hours. A lot of people have asked similar questions, but I did not find either a simple enough question or a straightforward answer. Here is my approach: Assume that I want to do a simple group by in data.table: library(data.table) mtcars = data.table(mtcars) mtcars[,sum(mpg), gear] # […]

Categories
Development

Why am I able use Kernel singleton methods like `puts`?

In Ruby, the method puts is a singleton method of the Kernel module. Normally, when a module is included or extended by another module, the module (but not its singleton class) is added to the inheritance tree. That effectively makes the instance methods of the module available to either the module or its singleton class […]

Categories
Development

Why am I able use Kernel singleton methods like `puts`?

In Ruby, the method puts is a singleton method of the Kernel module. Normally, when a module is included or extended by another module, the module (but not its singleton class) is added to the inheritance tree. That effectively makes the instance methods of the module available to either the module or its singleton class […]