How to upload media files from a server use gRPC

I’m trying to build a post microservice that allows a user to be able to create a new post with text content and media files. This service is using gRPC and written by pyhon. When a user creates a new post, I want to save the media files in firebase storage and the text content … Read more

display a huge JSON data with react-json-view

I work on some vite + react + typeScript + swc client side project for a company The client side I build for them needs to be as generic as possible. It’s means, that with some adjustments they will combine my client side in something like 10 different projects. In that project there is a … Read more

How do I generate all permutations of a list?

How do I generate all the permutations of a list? For example: permutations([]) [] permutations([1]) [1] permutations([1, 2]) [1, 2] [2, 1] permutations([1, 2, 3]) [1, 2, 3] [1, 3, 2] [2, 1, 3] [2, 3, 1] [3, 1, 2] [3, 2, 1] For Python 2.6 onwards: import itertools itertools.permutations([1, 2, 3]) This returns as … Read more

Services don’t get injected when using OpenAPI generated interface

When using an openApi generated interface, services don’t get injected in MockMvc tests. Let me show you. Controller @RestController @Slf4j @RequiredArgsConstructor public class MyController implements MyApi { private final CodeService codeService; @Override @PutMapping(“/path”) public ResponseEntity<Void> putStuff(@RequestBody @Valid final Stuff stuff) { // do stuff return ResponseEntity.ok().build(); } @ExceptionHandler(MethodArgumentNotValidException.class) private ResponseEntity<ResponseWithError> handleException(final MethodArgumentNotValidException e, HttpServletRequest request) … Read more

Unit Testing on SQL scripts

We have a postgreSQL data source. Just like we write JUnit tests for Java files.We want to implement unit testing for SQL queries(unit tests on JOINS , DATATYPE..etc) we write related to Stored Procedures on our DB. We want to run these unit tests on a in-memory DB so that it will feasible to run … Read more

Running Custom Jobs in parallet/distributed manner in Apache Spark

I have a function and list of dictionaries. Each dictionary represent some configuration. Function takes one configuration and processes it. I wanted to distribute tasks/jobs (each task consists of function and a configuration) over, say n servers and was wondering if this can be done using Apache Spark. I googled resources but they were mostly … Read more