Categories
Linux Mastering Development

Output from Bonnie++ doesn’t match up

I just ran bonnie++ ten times to test the performance of a file server. After removing the verbose output this is what remains: format_version,bonnie_version,name,concurrency,seed,file_size,io_chunk_size,putc,putc_cpu,put_block,put_block_cpu,rewrite,rewrite_cpu,getc,getc_cpu,get_block,get_block_cpu,seeks,seeks_cpu,num_files,max_size,min_size,num_dirs,file_chunk_size,seq_create,seq_create_cpu,seq_stat,seq_stat_cpu,seq_del,seq_del_cpu,ran_create,ran_create_cpu,ran_stat,ran_stat_cpu,ran_del,ran_del_cpu,putc_latency,put_block_latency,rewrite_latency,getc_latency,get_block_latency,seeks_latency,seq_create_latency,seq_stat_latency,seq_del_latency,ran_create_latency,ran_stat_latency,ran_del_latency 1.98,1.98,15.local,1,1602631781,8G,,8192,5,901,93,45205,13,23092,10,1162,90,66262,8,369.7,16,1,,,,100,18,1,360,4,21,0,18,1,542,4,20,0,12295us,665ms,1903ms,48384us,1944ms,5397ms,1652ms,13917us,2866ms,507ms,4953us,803ms 1.98,1.98,15.local,1,1602631781,8G,,8192,5,891,93,46620,14,23701,10,1177,90,66461,8,674.0,15,1,,,,100,18,1,406,4,22,0,18,1,559,4,23,0,12010us,1415ms,1264ms,52618us,496ms,69643us,1267ms,10064us,515ms,958ms,4650us,829ms 1.98,1.98,15.local,1,1602631781,8G,,8192,5,909,93,47824,14,21431,9,1147,88,67050,8,754.3,17,1,,,,100,20,1,400,4,19,0,14,1,530,3,20,0,11888us,1177ms,2710ms,45197us,1021ms,127ms,398ms,4562us,2874ms,1317ms,4810us,1006ms 1.98,1.98,15.local,1,1602631781,8G,,8192,5,890,91,37540,12,21765,9,1183,90,66822,8,1419,22,1,,,,100,19,1,461,3,23,0,19,1,547,3,19,0,11992us,548ms,864ms,46664us,480ms,25566us,760ms,44844us,1036ms,704ms,4778us,6449ms 1.98,1.98,15.local,1,1602631781,8G,,8192,5,795,83,43425,13,23066,10,1218,93,938042,27,1282,17,1,,,,100,19,1,406,4,21,0,18,1,560,4,23,0,53141us,14308ms,2786ms,39855us,71572us,6216ms,1761ms,6592us,1224ms,511ms,4654us,504ms 1.98,1.98,15.local,1,1602631781,8G,,8192,5,870,91,37339,11,21559,9,1187,91,924835,26,1499,19,1,,,,100,20,1,401,5,25,1,19,1,545,4,20,0,11615us,907ms,1870ms,44530us,352ms,1694us,626ms,4660us,359ms,659ms,5166us,972ms 1.98,1.98,15.local,1,1602631781,8G,,8192,5,881,93,37399,11,22194,9,1199,92,66756,8,1341,21,1,,,,100,17,1,409,4,20,0,17,1,557,4,23,0,11831us,1334ms,1113ms,45929us,579ms,29992us,4185ms,4348us,985ms,521ms,4889us,442ms 1.98,1.98,15.local,1,1602631781,8G,,8192,5,879,92,37592,12,21603,9,1208,93,4320730,99,1485,18,1,,,,100,17,1,403,4,22,0,16,1,570,3,19,0,11683us,665ms,1118ms,23421us,158us,5495ms,1623ms,4401us,592ms,863ms,10107us,1072ms 1.98,1.98,15.local,1,1602631781,8G,,8192,5,879,92,37386,11,21728,9,1168,90,554500,18,1516,19,1,,,,100,19,1,410,4,25,1,18,1,553,3,27,1,11325us,1617ms,1546ms,42335us,476ms,1812us,681ms,4294us,357ms,870ms,4776us,261ms 1.98,1.98,15.local,1,1602631781,8G,,8192,5,850,92,37915,11,21600,9,1159,88,141678,10,1513,20,1,,,,100,20,1,403,5,22,0,16,1,604,3,22,0,12674us,1461ms,1496ms,62742us,382ms,123ms,786ms,5874us,690ms,956ms,5011us,795ms but pasting this into a spread sheet results in missing columns (there are two header columns fewer than there are data […]

Categories
Mastering Development

Window created with WINAPI is not drawing objects. What’s the problem?

I have my window file (Window.h): LRESULT CALLBACK MessageHandler(HWND, UINT, WPARAM, LPARAM); class Window { private: HWND hWnd; HINSTANCE hInstance; bool running = true; const char* ID = "WINAPI_JVM64"; public: Window() { init(); } virtual void draw(Gdiplus::Graphics*) = 0; void init() { hInstance = (HINSTANCE)GetModuleHandle(NULL); WNDCLASS wc; wc = {}; wc.style = CS_HREDRAW | CS_VREDRAW; […]

Categories
Mastering Development

Digital signatures invalid when I use the iTextSharp

This is my Form – Following are the code – private void btnSign_Click(object sender, EventArgs e) { string sbase64 = richTextBox2.Text; byte[] bytes = System.Convert.FromBase64String(sbase64); PdfReader reader = new PdfReader("F:\\test1.pdf"); FileStream os = new FileStream("F:\\output.pdf", FileMode.Create); IExternalSignatureContainer external1 = new MyExternalSignatureContainer(bytes); MakeSignature.SignDeferred(reader, "Signature1", os, external1); reader.Close(); os.Close(); } private class MyExternalSignatureContainer : IExternalSignatureContainer { protected […]

Categories
Mastering Development

How to make bootstrap 4 carousel work with grapejs?

I’ve successfully built a little drag and drop builder with [grapejs][1]. Works great. The problem I’m facing is when dragging a bootstrap carousel inside the builder. The carousel works as expected on a regular page. But when inside the framework, only the first image shows up and I’m unable to use the controls to switch […]

Categories
Linux Mastering Development

Merging two CSVs based on matching first column (with header)

I have two CSV files. One of which contains a lot of data: main.csv Order No.,invoiceNumber,invoiceAmount,invoiceAmountNet 20001,20010,500,5 20002,20011,400,4 20003,20012,300,3 20004,20013,200,2 20005,20014,200,1 While my other CSV file has less information: october-2020.csv Order No.,Timestamp,ID 20001,2020-10-01 12:00:00,123456 20002,2020-10-02 13:00:00,123457 And my goal is to create a new CSV file based on october-2020.csv and adding information from main.csv. The […]

Categories
Mastering Development

How to calculate movement of pendulum?

I am trying to make a simple simulation of pendulum using Runge–Kutta fourth-order method. I am using p5.js. Usually it calculates the angles properly but sometimes it just starts spinning randomly etc. I have no idea how to resolve this issue it seems to be a problem with my implementation of said algorithm I think? […]

Categories
Mastering Development

Data frame with multiple colums, from a group of same values in one column select the maximum in the other column

I have the following data frame: DF <- data.frame(A=c(0.1,0.1,0.1,0.1,0.2,0.2,0.2,0.3,0.4,0.4 ), B=c(1,2,1,5,10,2,3,1,6,2), B=c(1000,50,400,6,300,2000,20,30,40,50)) and I want to filter DF for each group of equal values in A select the Maximum in B. For example for 0.1 in A the maximum in B is 5. Ending with the new data frame: A B C 0.1 5 6 […]

Categories
CMS Mastering Development Wordpress

hardcrop images in gutenberg “latest posts” block

I like the gutenberg "latest posts" block. The problem I have with it is that it doesn’t hardcrop images that users upload to the posts. Is there a way to choose a hard-cropped or custom size that I have created through the add_image_size() function? I don’t really have any code, but I think this question […]

Categories
CMS Drupal Mastering Development

Override Google Font inclusion in child-teme

i’m using Drupal 8.9.6 and create mytheme as child-theme of Hawell. In hawell.libraries.yml i have global-styling: version: VERSION css: theme: css/bootstrap.min.css: {} //fonts.googleapis.com/css?family=Lato:300,400,700%7COpen+Sans:400,300,700: { type: external } in mytheme.libraries.yml global: css: theme: //fonts.googleapis.com/css?family=Lato:300,400,700%7COpen+Sans:400,300,700&display=swap: { type: external, minified: true In mytheme.info.yml libraries: – mytheme/global As result have two different inclusion of Google Font, it’s possible override […]

Categories
Mastering Development

detect rows with different ID’s but duplicate values pandas

I have a dataframe which collects readings from device. Sometimes there are multiple readings for same sample, and thats stored as seperate ID in my dataframe. Is there a way for me to detect the duplicated ID’s by using the columns that have same value? Sample dataframe: test_df = {‘ID’: [1,2,3,4,5,6], ‘Age’: [18,18,19,19,20,21], ‘Sex’:[‘Male’,’Male’,’Female’,’Female’,’Male’,’Female’], ‘Values’:[1200,200, […]