Categories
Mastering Development

Field ‘id’ expected a number but got ‘Saurav’. ValueError at /recruiter/

I am a newbie to Django. I am trying to populate Candidate table which I earlier created to be used by Admin. But later requirement changed and I have to get it populated by user so I am using form. But I am getting this error , I think because in the table Candidate there […]

Categories
Mastering Development

vsCode setting and switching programming languages

I’ve been using vsCode for coding in python, java, js, and typescript at various times for several years. But it is always a traumatic experience whenever switching a coding language with vsCode. I’ve gotten to the point where I will avoid switching languages because nothing ever works after the switch and it takes loads of […]

Categories
Mastering Development

Multiple Choice questions – check valid answer on JavaScript

I am working on a multiple choice question form. I am using Flask on the back-end and MySQL as a database. The structure of the question table is the following There will be more than 1 end-user. I already made a users table but haven’t work on it yet There are multiple questions but I […]

Categories
Mastering Development

How to check 2 list and rearrange the order in python

I have a parent list [‘Python’, ‘Java’, ‘C#’, ‘Csharp’] if my input list [‘c#’, ‘Java’] From the input list I need to arrange the order as in parent list Expected out is [‘Java’, ‘c#’] If the input list is empty [] then output list [‘Python’] 1 more scenario for testing input >> [‘Python’, ‘Java’, ‘Csharp’, […]

Categories
Game Creation Mastering Development

Rendering a texture with SDL2 causes “Invalid texture” error message

When SDL_RenderCopy() gets called, it fails and SDL_GetError()returns the error "Invalid texture". Here’s my code: main.cpp #include "Game.cpp" #include <iostream> using namespace std; int main(int argc, char* args[]) { try { Game game("Test", 1280, 720, 60); GameObject object("Immagine.bmp"); game.addObject(object); game.run(); } catch(const char* message) { cerr<<message; } return 0; } Game.cpp #include "GameGraphics.cpp" class Game […]

Categories
Mastering Development System & Network

Diff a tarball on stdin against a directory hierarchy?

I have a multi-terabyte filesystem I want to diff against a multi-terabyte tar file. The tar file is only available from stdin – no seeking allowed. I do not have the disk space to write the tar on stdin to disk. "tar –diff" is almost what I want, except: It does not allow comparing mtime’s […]

Categories
Mastering Development System & Network

How to enable DNS over TCP for resolving names on linux

How do I configure linux in general to allow dns over tcp? We discovered today that several different linux servers we use are not able to resolve DNS names with many ip addresses in the response. These response packets would be over 512 bytes, so the server sends back a UDP packet with the truncated […]

Categories
Mastering Development

Create a webservice in java/nodejs/dotnet/python that share a filesystem of images

I want to create a webservice so it will share a filesystem. Example. images/1.jpg images/2.jpg images/test/3.jpg So when I host the web service it will take the entire filesystem and enable to show each of the images with the same path. Example. hosting-url/images/1.jpg will show me the image (and nothing else) no navigation is needed. […]

Categories
Ask Engineering Software Engineering

What approach is better for real time ordering?

The scenario is to have a website/server where users can order food. Then this order should somehow be inserted to the restaurant’s local database. My customer doesn’t want a direct connection between the server and the restaurant’s local db. So, how am I going to handle the orders? I think there are 3 options here […]

Categories
Mastering Development

Converting/transpiling Go source code into C code, with high level structures fairly intact possible? [closed]

What steps I must take in below shown solutions in order to convert/transpile "Go"-based source code into "C", with high-level structures of "Go" are still kept fairly intact/same in "C" as much as possible ? For example, if Go code contains: // "Go" based source-code: var n int type Node struct { left, right *Node […]