Categories
Mastering Development

struggle when creating a block table with Matlab

I am trying to create a function that can create a block table that contains their Handle, FullName, BlockType, Parent by using struct. However, each time I get to enter a model name, it said Error using struct Field names must be non-empty character vectors or a string scalars. Error in createBlockTable (line 10) tableStruct […]

Categories
Mastering Development

Do you know how to emulate holding down a keystroke for any period of time, then releasing it later?

I’m trying to emulate pushing the keyboard V key down while using BASS library to automate Voice Activation push to talk. I’ve got the BASS library working, just can’t get the keyboard to simulate holding down a Key for any length of time! (Delphi 10.4.1 / Target Windows 32-bit) Here’s my current source code: unit […]

Categories
Mastering Development System & Network

What is the best configuration of a VM for reading large csv files?

I am working with a database with more than 11 GB. I used a sample from the original data to write my code, but now I need to implement the program on the whole data. On my local computer I can’t perform this operation, so I made a Google Cloud account and set up a […]

Categories
CMS Mastering Development Wordpress

CSP nonces with Cloudflare Workers

Like this blog, I use Cloudflare Workers to inject CSP (Content Security Policy) nonce in headers : https://scotthelme.co.uk/csp-nonces-the-easy-way-with-cloudflare-workers/ This is functional. Next, I need to inject the nonce into all script tags. I use this script (in functions.php) : add_filter( ‘script_loader_tag’, ‘add_nonce_to_script’, 10, 3 ); function add_nonce_to_script( $tag, $handle, $source ) { $search = "type=’text/javascript’"; […]

Categories
CMS Mastering Development Wordpress

CSP nonces with Cloudflare Workers

Like this blog, I use Cloudflare Workers to inject CSP (Content Security Policy) nonce in headers : https://scotthelme.co.uk/csp-nonces-the-easy-way-with-cloudflare-workers/ This is functional. Next, I need to inject the nonce into all script tags. I use this script (in functions.php) : add_filter( ‘script_loader_tag’, ‘add_nonce_to_script’, 10, 3 ); function add_nonce_to_script( $tag, $handle, $source ) { $search = "type=’text/javascript’"; […]

Categories
Mastering Development

Tensorflow with batch size and wrong dimesion

Here are my code: # Model parameters: W and b # tf.reset_default_graph() W = tf.get_variable("weight",shape = [784, 10], dtype=tf.float32) b = tf.get_variable("b", shape=(784,10), dtype= tf.float32) input_X = tf.placeholder(‘float32’, shape = (None,10)) input_y = tf.placeholder(‘float32’, [784, 10]) ogits = W*input_X + b probas = tf.nn.softmax(logits) classes = tf.argmax(probas) loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels = input_y, logits = logits)) […]

Categories
CMS Mastering Development Wordpress

How can I load a javascript file that is type=”module” the WordPress way?

Typically, when I am going to load javascript files I load them from my functions.php file using this code: wp_deregister_script(‘site-js’); wp_register_script(‘site-js’, get_stylesheet_directory_uri().’/js/site.js’, array(‘jquery’), ‘0.0.3’, true); wp_enqueue_script(‘site-js’); The other day I had downloaded axios and tried to load it into my wordpress theme. In another javascript file, I was trying import axios like this: import axio […]

Categories
Mastering Development

How to show the prediction values while the neural-network training is on going

I am training a model to classify the video clips out of the two labels, while the model loss keep the same, so I am wondering the prediction values when traning is going on, I do some trying, then comes the error: Cannot assign a device for operation ‘replica_1_5/model_12/activation_7/Softmax’: Could not satisfy explicit device specification […]

Categories
Mastering Development

How to allow keras model predict function in multiple thread algorithm?

I’m trying to train a reinforcement learning(RL) agent on a custom environment. My RL agent is the stable baseline implementation of the DDPG algorithm. It uses multiple threads for training. One of the arguments for this agent is an environment, which is implemented according to Open AI gym custom environment interface. My environment needs to […]

Categories
Mastering Development

This client-server minigame won’t restart itself

A friend and I have completed a client-server minigame in the C language for an exam on Unix advanced programming. We are setting an alarm() and when this guy finishes, we capture it with signal() and we’ve made a function to read such signal and restart the server. But what happens all the time is […]