Categories
Development

copy a table to another and add a column that is the tablename of the source

I want to copy some tables who all have the same prefix into one table. The destination table should have on column more then the source, that is the name of the source table. I tried this : INSERT INTO `tbl_dest` (`nr`,`n1`,`n2`,`n3`,`n4`,`n5`,`table`) SELECT `a`.`nr`, `a`.`n1`, `a`.`n2`, `a`.`n3`, `a`.`n4`, `a`.`n5`, `b`.`table` FROM `tbl_src` `a`, `INFORMATION_SCHEMA.TABLES`.`TABLE_NAME` `b` […]

Categories
CSS Development

How can i set textbox value using css class name when document load

I want embed arcgis map here as an example to my asp page for search to search employees cubicle, the map has a text box for search. I want the search to be automatic based on emplyee number or cubicle number. i will like to display the map on the employee detail information page /Details/Index/7. […]

Categories
Development Google

Inconsistent results in Google Sheets macros?

I have the following spreadsheet (and this is it’s ideal beginning state): The yellow field takes a numeric input, used in calculating the two numeric values to the right. For example, when I enter “1” in the year, I get those two purple values ($156,892 and $125,125). I’ve recorded a macro that, one by one, […]

Categories
Development

Constantly Check Through a List of Times and Current Time and Display Notification

I’m currently working on a python to-do application. All user created events are stored in a dictionary called toDoEvents, with title, due_time, remind_time, and description. Right now I’m working on a notification system using toast. I need to constantly check the list of remind_dates for every event and if it matches the current time, calls […]

Categories
Development

How do I fix my Pig Latin encryption code?

I’m trying to fix the ‘ if w[0] not in vowel: ‘ portion of my code (for handling words that start with consonants. BUT the return values are not what they should be and I don’t know why! def encrypt(w): ”’ encrypt to pig latin ”’ Lstw = list(w) y = 0 if w[0:2] == […]

Categories
Development

ValueError: Ciphertext with incorrect length

I have a problem that reads: “Suppose your RSA public-key factors are p = 6323 and q = 2833, and the public exponent e is 31. Suppose you were sent the Ciphertext 6627708. Write a program that takes the above parameters as input and implements the RSA Decryption function to recover the plaintext.” When trying […]

Categories
Development Ruby

Encrypt private key with passphrase using openssl ruby

In order to encrypt my private key and provide the passphrase. Currently, I am using bash cmd to get my encrypted key user_enc.pem ( openssl rsa -in user.pem -pubout && openssl rsa -in user.pem -aes256 ) > user_enc.pem It would be helpful if someone can have a look and help me out to achieve this […]

Categories
ASP.NET Development Programming & Design

When using ASP.NET core Identity, it is better to extend the User class or write separate entities that relate to it [on hold]

I want to use the Identity system provided by ASP.NET core. Most tutorials I read extend the User class by adding custom properties like the following: public class ApplicationUser : IdentityUser { public string FirstName { get; set; } public string LastName { get; set; } // etc… } This seems fine when you only […]

Categories
Development SQL

Do PostgreSQL subscriber servers lock when synchronizing to an update to the publisher server?

If I have 3 databases Db1: only for writes, publisher Db2: only for reads, subscriber to Db1 Db3: only for reads, subscriber to Db1 Just to clarify that “only for reads” means that my application won’t try to modify that database. The inverse applies to “only for writes”. I’m not talking about a feature of […]

Categories
Development Wordpress

Advice on using wordpress contact form 7 hook

I have written the following codes: // define the wpcf7_mail_sent callback function action_wpcf7_mail_sent( $contact_form ) { $temp1246 = get_post_meta( 1246, $key = ‘ID’, TRUE); $temp1246 = intval($temp1246) + 1; update_post_meta( 1246, ‘ID’, $temp1246 ); }; // add the action add_action( ‘wpcf7_mail_sent’, ‘action_wpcf7_mail_sent’, 10, 1 ); What the code does is that it will increment a […]