Critique my heap debugger

I wrote the following heap debugger in order to demonstrate memory leaks, double deletes and wrong forms of deletes (i.e. trying to delete an array with delete p instead of delete[] p) to...

Convert enum to int in python

I have an enum Nationality: class Nationality: Poland='PL' Germany='DE' France='FR' How can I convert this some enum to int in this or similar way: position_of_enum =...

Countdown Timer in MVC

I am displaying a countdown timer in _Layout.cshtml page using this code. But when I move from one page to another page, the timer is starting again when the new page loads. 1.How to display the...

safe enough 8-character short unique random string

I am trying to compute 8-character short unique random filenames for, let's say, thousands of files without probable name collision. Is this method safe...

Counting Disk Intersections using TreeSet

I'm trying a demo problem of Codility, before I take the real test as part of a job application. One of the demos they have is a problem involving counting the number of disk intersections, for an...

calculate sinus in haskell

Here is my problem: I need a function that calculates sinus of some number... In C++ i wrote this: double msin(double number, int counter = 0, double sum = 0) { // sin(x) = x - (x'3 / 3!) + (x'5...

Write a SQL query to find all numbers that appear at least three times

I'm practicing SQL language and got a question like: Write a SQL query to find all numbers that appear at least three times consecutively. +----+-----+ | Id | Num | +----+-----+ | 1 | 1 | | 2 ...

Count consecutive characters

How would I count consecutive characters in Python to see the number of times each unique digit repeats before the next unique digit? At first, I thought I could do something like: word =...

Issue With Spring: There was an unexpected error (type=Not Found, status=404)

I am going through this book on restful web services with spring. I decided to move away from what they were doing and use java configuration files. For some reason, after switching over to the...

Schema is not configured for mutations

I have the following schema : import { GraphQLSchema, GraphQLObjectType, GraphQLInt, GraphQLString } from 'graphql'; let counter = 100; const schema = new GraphQLSchema({ // Browse:...

Salesforce Lightning: Controller functions interaction within the same component

Do anyone know "how to call a lightning controller function from another function within the same lightning component?" Thanks Aruna ({ doInit: function(component, event, helper){ ...

how to log Spring 5 WebClient call

I'm trying to log a request using Spring 5 WebClient. Do you have any idea how could I achieve that? (I'm using Spring 5 and Spring boot 2) The code looks like this at the moment: try { return...

double clicking .EXE different than using "start" in .bat

I made a .bat file to run CS:GO, using the command: start "" "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo.exe" But when I run it, the game is started in...

Cannot render multiple components in Vue

I'm just starting with Vue and I have defined 2 components, however, I cannot render them in the same 'Vue' instance. Here are my 2 components: Vue.component('mat-example', { data: function ()...

Can a 'for' loop inside of a 'for' loop use the same counter variable name?

Can I use the same counter variable for a for loop inside of a for loop? Or will the variables affect each other? Should the following code use a different variable for the second loop, such as j,...

using UART in VHDL

I'm trying to use UART communication with a Lattice machox3 and a ft232R. I am trying to use the VHDL file I found on eewiki(Here). For some reason I am not being able to get tx to work when I...

Warning: flock() expects parameter 1 to be resource, string given

I have this very simple program in PHP that does not want to work. It returns the same error as topic for unknown reasons to me. $file = 'counter.txt'; $counter =...

How do I screed-record a specific view into a video?

I am using Lottie Animation Library and I want to record that animation view as video but this library does not have any video exporting support so I am trying to find my own solution and, This is...

mariadb.service: Failed with result 'signal'

Since today morning I have a problem with the mariadb.service running on Ubuntu 18.04 with Plesk. It stopped and I can't restart it again. service mysqld start Job for mariadb.service failed...

Is it possible to be better than O(N+M) for Codility lesson MaxCounters using python?

This is the code I am using for the Codility lesson: MaxCounters def solution(N, A): counters = [0] * N max_c = 0 for el in A: if el >= 1 and el <= N: ...

How to unit test whether the ChangeNotifier's notifyListeners was called in Flutter/Dart?

I'm using the provider package in our app and I want to test my ChangeNotifier class individually to have simple unit tests checking the business logic. Apart from the values of ChangeNotifier...

Upstream triggering in Gitlab-CI aka pipeline dependencies

I can't seem to find the most obvious CI feature that one ever needs from such a tool: run a project pipeline after another project's pipeline has finished. You can do it with trigger but only for...

Get-ChildItem : Access to the path „C:\WINDOWS\system32\LogFiles\WMI\RtBackup” is denied

I have a problem when running the script as an administrator. When I run as a regular user the script works but only for my account. Because the script is run as an administrator it will be...

Performance issue with CountDiv (Codility) challenge algorithm

Needing some help with the algorithm i made to solve this codility challenge : Write a function that, given three integers A, B and K, returns the number of integers within the range [A..B] that...

TextFormField Validator: error border is not activated

When I press the button to validate the FormKey, the error border of TextFormField is not activating. I want when I press the button, and if is not validate, show a red border. Button...

C# Manually stopping an asynchronous for-statement (typewriter effect)

I'm making a retro-style game with C# .NET-Framework, and for dialogue I'm using a for-statement, that prints my text letter by letter (like a typewriter-effect): I'm working with different...

Dgraph always shows'Connection lost with alpha: 7080' error

I now use docker-compose to start Dgraph, but it always fails to start. The contents of docker-compose.yml are as follows: # This Docker Compose file can be used to quickly bootup Dgraph Zero #...

How to make my timer more precise in SwiftUI?

I would like to develop an app that includes a timer - everything works fine so far - yet I have the problem that the CircleProgress is not quite at 0 when the counter is. (as you can see in the...

In Blazor, is there a way to undo invalid user input, without changing the state?

In Blazor, how can I undo invalid user input, without changing the state of the component to trigger a re-render? Here is a simple Blazor counter example (try it...

Matrix multiplication in c++ armadillo is very slow

I'm doing some basic multiplication using armadillo but for some reason it takes very long to complete. I'm quite new to c++ so I might be doing something wrong, but I can't see it even in this...