Categories
Mastering Development

Excel VBA Creates a Folder, Sub Folders and further sub folders

I have a question that is very similar to some others i have seen on here, but they dont quite answer what i need, or when i have tried them it has caused an error that i dont know how to solve. Only being level 5 i can’t comment to ask a question. In excel […]

Categories
Mastering Development

VBSCRIPT REPLACE not removing spaces from Decrypted fields

Got quite a head-scratcher…. I’m using the VBScript function REPLACE to replace spaces in a decrypted field from a MSSQL DB with “/”. But the REPLACE function isn’t “seeing” the spaces. For example, if I run any one of the following, where the decrypted value of the field “ITF_U_ClientName_Denc” is “Johnny Carson”: REPLACE(ITF_U_Ledger.Fields(“ITF_U_ClientName_Denc”),” “,”/”) REPLACE(ITF_U_Ledger.Fields(“ITF_U_ClientName_Denc”),” ”,”/”) […]

Categories
Mastering Development

Golang Base64 signature verification VS CryptoJS

I am trying to convert a Node.js script to Golang. However, I always get the error “error: illegal base64 data at input byte 40” while decoding Base64. May someone help me, already debug and read documentation for few hours… Help is needed! // Node.js exampe (code copied from Facebook Instant game SDK example) const CryptoJS […]

Categories
Mastering Development

Removing all special characters from an entire dataframe but keeping factor level definitions

‘m trying to remove special characters e.g. “-“,”/”,”)”,”(” etc entirely from my dataframe. However my dataframe only contains one observation as it’s feeding into a model that will be used in production. I’ve defined the factor levels explicitly for the data frame. I’ve tried the following: sanitize_string <- function(string){ gsub(‘\\s+’, “_”, string) %>% gsub(“[(]”, “_”, […]

Categories
Development

Create AWS Athena View Problematically via Terraform

I am trying to create Athena Views using SQL. And to be fair, I have used the following thread to achieve this – almost. Create AWS Athena view programmatically The code I have (below), does create the views as required. The ‘Create’ sql code itself being provided by file://${each.value} However, in the destroy section, I […]

Categories
Development

Debug jumping lines after file dialog code

Is this a known bug, or something specific to me (I’m using Excel 365). When I skip to the next line (F8) of code after a file dialog show call (selecting a folder or cancelling) it seems to turn off single stepping and runs all the code to either the next breakpoint or resumes if […]

Categories
Development

Missing required potential argument in function call Python

I’m just starting to learn Python, and was writing a calculator program with two different files to get the concept of calling classes and functions down. The file with the mathmatical operations in a class looks as such: class standardOpperations: def __init__(self, primaryNumber, secondaryNumber): primaryNumber.self = primaryNumber secondaryNumber.self = secondaryNumber def addition(self, primaryNumber, secondaryNumber): print(primaryNumber, […]

Categories
Development

Spring Security oauth2 “authorization request not found”

I have Spring Security (5.2.1) configured to use Oauth2 with Google. The application works fine locally. When deployed on Azure App Service, I get the following exception whenever I attempt the Oauth2 login flow. I am forwarded to /login?error#. I cannot find much information on this exception and not sure how to troubleshoot. 2020-01-25 22:13:47.882 […]

Categories
Development

Python 2.x: How to mock subprocess.Popen if stdin=PIPE

I am trying to mock below function def run_query(): sql_cmd = “Some Query” process = Popen([“sqlplus”, “-S”, “/”, “as”, “sysdba”], stdin=PIPE, stdout=PIPE, stderr=PIPE) process.stdin.write(sql_cmd) (process_stdout, process_stderr) = process.communicate() Below is the test function I wrote: @patch(‘subprocess.Popen’) def test_run_query(Popen): Popen.return_value.communicate.return_value = (2, 1) However, I am getting below error Error occured while running sql command Error […]

Categories
CMS Development Wordpress

404 error page after hiding product-category slug

after i used this code: add_filter(‘request’, function( $vars ) { global $wpdb; if(isset($vars[‘error’])){ $lastVar = basename($_SERVER[‘REQUEST_URI’]); $vars[‘attachment’] = $lastVar; } if( ! empty( $vars[‘pagename’] ) || ! empty( $vars[‘category_name’] ) || ! empty( $vars[‘name’] ) || ! empty( $vars[‘attachment’] ) ) { $slug = ! empty( $vars[‘pagename’] ) ? $vars[‘pagename’] : ( ! empty( $vars[‘name’] […]