Categories
Database Development

MySQL using different index when direct index exist on columns

I have following table (stripped off other columns, indexes for simplicity) CREATE TABLE `issues` ( `id` int(11) NOT NULL AUTO_INCREMENT, `book_id` int(11) NOT NULL, `number` int(11) DEFAULT ‘0’, `title` varbinary(1024) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `index_issues_on_book_id_and_number` (`book_id`,`number`), KEY `index_issues_on_book_id_and_updated_at` (`book_id`,`updated_at`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 […]

Categories
Mastering Development

XML parsing with a Class call

I parsed an xml file with xml.etree python module. Its Working well, but now I try to call this code as a module/Class from a main program. I would like to send the xml tree and a filename for the csv writing to the Class. My dummy file to call the file with the Class: […]

Categories
Cryptocurrency Ethereum Mastering Development

Where can I find full ERC 721 example programs?

I am building a program with an ERC 721 token. My code runs without using the standard components provided by Open Zeppelin IERC721. Now I want to adapt it to the ERC 721 standard. Unfortunately the transfer function does not work. I need to see more example codes for ERC721 contracts to understand the logic […]

Categories
Database Development

Join table from values nested deeply in a jsonb field

I am having trouble building the correct SQL query that can join a table from a deeply nested array in a jsonb object with rows from another table. The deeply nested array contains strings and optionally an array of strings. These arrays should be flattened and then used to join in the other table. Here […]

Categories
Mastering Development

Nested routes – rails 5.2.4 – Undefined local variable or method

To register addresses for clients in my application I am using nested routes, however when clicking on the link to register a new address or to edit an existing address the system presents the error: undefined local variable or method `address’ for #<##Class:0x00007fd1c815fa58>:0x00007fd1d05ef598> Did you mean? @address. Can someone with a good heart inform me […]

Categories
Mastering Development

laravel 7 adding radio in register form

i want to add radio in register form. For when someone want to register he need to choice if its man or woman and when i try to register its not work dont save in database Someone can helping me add the radio for choice man or woman. create user table : use Illuminate\Database\Migrations\Migration; use […]

Categories
Mastering Development

rapid prime number test for below 2 ^ 64

// I have developed a method that performs a very fast prime number test using Fermat’s theorem // We can further improve this code and reduce the size of the data using only factors. // http://www.cecm.sfu.ca/Pseudoprimes/index-2-to-64.html public List A001567 = new List(); bool IsPrime(UInt64 number) { bool maybePseudo = BigInteger.ModPow(2, number, number); if(!maybePseudo) { // […]

Categories
Mastering Development

What might cause a property length of null exception when using a Material Data Table?

My issue is similar to the one discussed here, but none of the suggestions there has helped, and my situation is slightly different. I have a parent component assigning an array to a child component’s input property, which then uses that data to create a data source for a mat table. My code is similar […]

Categories
Mastering Development

How can I tell typescript that the last argument in tuple is always a function?

I made a function that uses the spread operator to accept an overload with a various number of parameters. Unfortunately, typescript says that one of the arguments of the function is not callable. Below is an example of what I’m referring to. type Arguments=[{():void}]|[string,{():void}]|[string,number,{():void}]; function overload(…args:Arguments){ //Do stuff depending on number of arguments if(args.length===2)console.log(args[0]); if(args.length===3)console.log(args[0],args[1]); […]

Categories
Mastering Development

How to get JavaScript to ensure no fields are null

Quite a simple one, I’m sure… as you may be able to tell, quite new to this! I need a JavaScript code to ensure that no fields in a form are null, including text, number, email, tel… If there is one field that happens to be null, it should submit an alert. If all fields […]