Categories
Mastering Development System & Network

WordPress multisite subdomain resolution

I have a WordPress multisite (I am using Apache 2.4 on an Ubuntu 20.04 server on AWS). The structure is a main site — say mainsite.com — and three subdomains: aaa.mainsite.com bbb.mainsite.com ccc.mainsite.com Everything works, except for one problem: aaa, bbb, and ccc.mainsite.com do not resolve to their respective home pages, resolving to the mainsite.com […]

Categories
Mastering Development System & Network

WordPress multisite subdomain resolution

I have a WordPress multisite (I am using Apache 2.4 on an Ubuntu 20.04 server on AWS). The structure is a main site — say mainsite.com — and three subdomains: aaa.mainsite.com bbb.mainsite.com ccc.mainsite.com Everything works, except for one problem: aaa, bbb, and ccc.mainsite.com do not resolve to their respective home pages, resolving to the mainsite.com […]

Categories
User Help

OneDrive Screw Up (How to Repair)

Long, weird, story. We ordered a laptop. It has a short: shocks us, completely crashes, and reboots. We’re sending it back. We ordered an AIO as a replacement. Works fine. Wife had stuff on the laptop. She hand moved most of it to the AIO. OneDrive synced everything it had from the problem laptop to […]

Categories
CMS Mastering Development Wordpress

code is working properly in Core PHP but writing coding in WordPress

function generate_pdf($array) { header(‘Content-Type: text/csv’); header(‘Content-Disposition: attachment; filename="sample.csv"’); $fp = fopen(‘php://output’, ‘wb’); foreach ( $array as $line ) { $val = explode(",", $line); fputcsv($fp, $val); } fclose($fp); } $array = array( ‘aaa,bbb,ccc,dddd’, ‘123,456,789’, ‘"aaa","bbb"’ ); generate_pdf($array); Here’s my code generating correct csv file, But When I’m implementing this in my Custom Plugin It’s generating Coding […]

Categories
Mastering Development

String Split with comma and newline

I have a string which looks like ‘"aaa","bbb","ccc","ddd","eee"\n"1","2","3","4","5"\n"6","7","8","9","10"’ I want to split by comma and newline and convert it into a dataframe and get the output as aaa bbb ccc ddd eee 1 2 3 4 5 6 7 8 9 10 Is there any way to do it in R?

Categories
Mastering Development

Delete lines that contain the same letter more than 3 times

I have this code which deletes lines if they contain the same letter 3 times. I need it to delete the line if the letter is repeated more than 3 times (separated). 3 times (separated) I mean for example this line BAABAAG. Notice this line contains the letter A four times but my code did […]

Categories
Mastering Development

How to write a function that connects each previous word to the next word by the shared letters

Return the resulting string (removing duplicate characters in the overlap) and the minimum number of shared letters across all pairs of strings. Examples join(["oven", "envier", "erase", "serious"]) ➞ ["ovenvieraserious", 2] join(["move", "over", "very"]) ➞ ["movery", 3] join(["to", "ops", "psy", "syllable"]) ➞ ["topsyllable", 1] # "to" and "ops" share "o" (1) # "ops" and "psy" share […]

Categories
Mastering Development

Can Shiny pass parameters list whose element is vector to Rmd

Another Shiny connected to reporter problem bothers me! I wonder if when shiny pass parameters list to R-reporter , one element of list is vector,like this: params <- list(n = c(‘img1’,’img2)) rmarkdown::render(tempReport, output_file = file, params = params, envir = new.env(parent = globalenv()) I want to do this,because I have code below: suppressPackageStartupMessages(library(shiny)) suppressPackageStartupMessages(library(readxl)) suppressPackageStartupMessages(library(ggplot2)) […]

Categories
Mastering Development

How to use a dictionary to speed up the task of look up and counting?

Consider the following snippet: data = {"col1":["aaa","bbb","ccc","aaa","ddd","bbb"], "col2":["fff","aaa","ggg","eee","ccc","ttt"]} df = pd.DataFrame(data,columns=["col1","col2"]) # my actual dataframe has # 20,00,000 such rows list_a = ["ccc","aaa","mmm","nnn","ccc"] list_b = ["ggg","fff","eee","ooo","ddd"] # After doing a combination of 2 elements between the 2 lists in both orders, # we get a list that resembles something like this: new_list = ["ccc-ggg", "ggg-ccc", […]

Categories
Linux Mastering Development

Split csv file on multiple csv files based on several columns headers

I have a large csv file that i tried to split into several csv files based on certain columns in the header. The objective is to generate each file in relation to the columns of the country. For example: –>input file: file.csv ,,fr,fr,fr,ca,ca,ca,be,be,be id,dateContact,name,date1,date2,name,date1,date2,name,date1,date2 100,2019-03-19,AA,2019-03-20,2019-03-22,AAA,2019-02-19,2019-02-22,AAAA,2019-02-19,2019-02-22 101,2019-08-15,BB,2019-08-16,2019-08-17,BBB,2019-07-16,2019-07-17,BBBB,2019-07-16,2019-07-17 102,2020-01-19,CC,2020-01-21,2020-01-21,CCC,2020-01-21,2020-01-21,CCCC,2020-01-21,2020-01-21 -Desired output files: –>output_fr.csv: id,dateContact,name,date1,date2 100,2019-03-19 ,AA ,2019-03-20,2019-03-22 […]