Monogame - Key 'Pressed' instead of 'Hold' to Jump
Vote count: 0 Will keep this short and simple: I have a 2D game with a movable character, and I have written some code to allow my player to jump, like so: if (Keyboard.GetState().IsKeyDown(Keys.Space) && hasJumped == false) { sound.Play(volume, pitch, pan); // plays jumping sound position.Y -= 5f; ...
Run multiple threads when other threads not executing?
Vote count: 0 Is there a way to make it so I can have n threads run a certain function when other threads are not locking other functions? I want to achieve something like: pthread_t threadID[10]; pthread_mutex_t blocking; pthread_mutex_init(&blocking, NULL); pthread_cond_t go; pthread_cond_init(&go...
Connecting logical layer and GUI in java
Vote count: 0 I'm begi er in java-swing. I try to make some desk game. I got 2 packages (one representing game[with classes Game, Players] and the other representing [with classes Board, BoardField, BorderField and Disk] ... there are some interfaces yet, which is not important for my question. What...
Delphi TIdTCPClient slow on connect
Vote count: 0 I have a delphi code that co ects to a server using TIdTCPClient. The server is an advanced ARM microcontroler, the network is a local network (with one switch). When the software runs under delphi, TIdTCPClient.Co ect runs fast, but when the software runs as a standalone EXE, the co e...
Confused with self and none
Vote count: 0 In a colleague's code, I saw him defining the function (the term is equivalent to method, right?) like this: def ReadUserInput(self): but calling it like: ReadUserInput(None) Why? I read a lot through the site, but I am still confused. Should I also implement my functions like this? I ...
VHDL error: type of identifier does not agree with its usage
Vote count: 0 I am attempting to create a 24 hour clock for output on a seven segment display but I get these error when I try to compile: Error (10381): VHDL Type Mismatch error at clocker.vhd(42): indexed name retu s a value whose type does not match "std_logic_vector", the type of the target expr...
Parameter pack expansion for static variables
Vote count: 0 I am thinking about following problem. Let us have a merging function for merge arrays defined in following way: // input is (const void*, size_t, const void*, size_t,...) template<typename...ARGS> MyArray Concatenation(ARGS...args) And let us have couple of structs with static propert...
What is sector slipping?
Vote count: 0 I've looked over the Wikipedia article but I'm not quite getting what sector slipping is. I know it's used to handle disk failures, but I don't know what it means for a sector to be slipped. What is sector slipping? How is it different from sector sparing? What is involved in implement...
Vertical and horizontal headers for HTML table for JSON data
Vote count: 0 I need to implement a table like this: I'm hoping to add more functionality to the table like editing etc., so I'd like to use something like Angular UI Grid. The data for the table cells and headers comes in the form of a JSON from an API endpoint. [{verticalHeader: "vertical", horizo...
Saving boolean change in rails 4
Vote count: 0 I'm trying to update my :completed field in rails 4 from the dashboard#home rather than the todos#edit. I have tried both PATCH and POST - none save, but with POST I don't get a 404 error when I click the checkbox, and with PATCH I do 'PATCH http://localhost:3000/dashboard 404 (Not Fou...
Calling fflush inside multithreaded signal handler?
Vote count: 2 I have a basic sketch of implementing a multithreaded web proxy: FILE *proxy_log_file; static void SIGUSR1_handler(int sig) { (void)sig; fflush(proxy_log_file); } int main(int argc, char **argv) { proxy_log_file = fopen("proxy.log", "a"); Signal(SIGUSR1, SIGUSR1_handler); } The idea is...
Capstone Disassemble from Binary File in Python
Vote count: 0 first of all am very at this and sorry for my bad english. I need for a project in university to disasemble binary files. Therefore i should use capstone. I tried weeks with java but it didnt work so since yesterday i teached myself a little Python. To read the Binary i tried file = op...
Having trouble appending dictionary values to list in python
Vote count: -1 So in python I have a dictionary that is composed of a name for the key and a class object associated with the name as the object. I need to append these objects to a list one by one from the dictionary, however when I attempt to use a for loop to do so it only appends the same object...
Where should I put Database.EnsureCreated?
Vote count: 0 I have an Entity Framework Core + ASP.NET Core application and when my application starts up I want to ensure that the database is created, and eventually (once I have migrations) I want to ensure that those are also run. Initially I put Database.EnsureCreated() into the constructor of...