Categories
Development

Get error when running web2py “image blog” example

I’m a beginner with web2py and I’m trying to make an example of it with pictures and blogs but I have a mistake on the line: image = db.image(request.args(0,cast=int)) or redirect(URL(‘index’)) when I want to look at my view he puts me “404 not found” Do you know the reason and the solution to this […]

Categories
API Development HTTP MVC React

Getting “reactor.netty.http.client.PrematureCloseException: Connection prematurely closed BEFORE response” while mocking a third part API

My Spring boot API is consuming a third part API using WebClient DemoAPIController @RestController public class DemoAPIController { @Autowired DemoService demoService; @GetMapping(“/mytest”) public Mono<UserType> getUserType() { return demoService.getUserType(); } } DemoService.java @Component public class DemoService { @Value(“${base.url}”) private String baseUrl; public Mono<UserType> getUserType() { System.out.println(“baseUrl:” + baseUrl); WebClient webClient = WebClient.builder().baseUrl(baseUrl) .defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) .defaultHeader(“apikey”, “test”).build(); […]

Categories
Development XML

How to use AddDigitalSignatureOriginPart (DocumentFormat.OpenXml library) to secure an Excel file?

Need to create a digital signed excel file and then validate the signature when uploaded in C#.

Categories
Development Linux Ubuntu

Stop monitor from going to sleep in ubuntu 19.10

I’m searching for a new solution to stop monitor going to sleep in ubuntu 19.10 desktop when I lock screen. This solution with gscreen doesn’t work anymore: https://askubuntu.com/a/788456/1020896. On the energy settings I also configured turn off display: Never.

Categories
Cache Development Linux Ubuntu

No X11 RandR providers in wayland

After upgrade to 19.10 there’s no RandR providers in my wayland session (Ubuntu on Wayland). In X11 session everything is fine. $ xrandr –listproviders Providers: number : 0 Here’s some info about my system: $ gnome-shell –version GNOME Shell 3.34.1 $ apt-cache show xwayland | grep ^Version: Version: 2:1.20.5+git20191008-0ubuntu1 $ xrandr Screen 0: minimum 16 […]

Categories
Development Linux Ubuntu

how to get a list of folders and number files in each folder side by side, in the current directory?

I am at the directory: /home/john/my_test_files/ and under the directory there are 100 folders: folder1 folder2 folder3 … folder100 what command would I use to print the list of folders and the each one’s file count side by side. Something like this: folder1 25 folder2 78 folder3 34 … folder100 88 where folder1 has 25 […]