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

Typescript: How to sort complex strings by comparing the date inside

I have a list of 2 strings with date inside them, how can I sort it to let earlier one always comes to the first? The date is always after the second comma. For example, const example = ["AAA,5,2020-09-17T21:14:09.0545516Z", "AAA,0,2020-09-03T20:38:08.3946643Z"] sortStrings(example: string[]) { // how to sort to let earlier date come first }

Categories
Mastering Development

jQuery RegEx pattern match to validate user input

I want to check if an input is a valid bra measurement. In the US, bra sizes are written with an even number 28-48 and a letter A-I, AAA, AA, DD, DDD, HH or HHH. The EU, Japan and Australia use different numbers and patterns, ex. 90C C90 and DD6. -I want to split the […]

Categories
Mastering Development

Given an input string word, split the string into exactly 3 palindromic substrings

Problem Description = Given an input string word, split the string into exactly 3 palindromic substrings. Working from left to right, choose the smallest split for the first substring that still allows the remaining word to be split into 2 palindromes. Similarly, choose the smallest second palindromic substring that leaves a third palindromic substring. If […]

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 […]

Categories
Database Development

Select most recent record per day based on 3 columns

I have a table that looks like this: CREATE TABLE tbl_AppUsage( ID int IDENTITY(1,1) NOT NULL, UserName nchar(250) NULL, UPN nchar(250) NULL, AppDisplayName nchar(250) NULL, AppId nchar(250) NULL, CreatedDateTime nchar(250) NULL); INSERT INTO tbl_AppUsage (UserName, UPN, AppDisplayName, AppId, CreatedDateTime) VALUES (‘aaa’, ‘aaa@mail.com’, ‘Adobe DC’, ‘1234fdr234′, ’07/10/2020 08:39:14’), (‘aaa’, ‘aaa@mail.com’, ‘Adobe DC’, ‘1234fdr234′, ’07/10/2020 08:51:14’), (‘aaa’, […]

Categories
Mastering Development

How can I align every word from this list?

I have a list of lists in a file: [ [ ‘aaaaa’, ‘bbb’,’ccccccccc’ ], [ ‘aaaaa’, ‘bbbbbb’,’cccccc’ ], [ ‘aaa’, ‘bbb’,’ccccccccc’ ] ] aaaaa bbb ccccccccc aaaaa bbbbbb cccccc aaa bbb ccccccccc I use it for some analysis but because of the lengths of the words, it is hard to read, I want to format […]

Categories
Linux Mastering Development

Corrected version: Keeping only certain columns of a line of csv file taking into a condition of the line from above [closed]

Sorry, there was an error in the data source, which are corrected in new version. I wish to keep only certain columns of a line of CSV file, but taking into account a condition of the line from above. On line one, some fields are empty.Enmpty fields is dynamic, here can be 3 or 10 […]