Skip to content

Instantly share code, notes, and snippets.

View Whizboy-Arnold's full-sized avatar

Whizboy-Arnold

View GitHub Profile
@Whizboy-Arnold
Whizboy-Arnold / getTextInRect.js
Created February 28, 2024 09:26 — forked from imesut/getTextInRect.js
Get text in selected area by pdf.js with text layer rendering
// This method works only when pdf is rendered with Text Layer
// It compares particular text/word element coordinates with
// the rectangle's coordinates. If text/word coordinates is in
// the rectangle, text has got. And successing texts are similar.
// Check out text layer rendering option at the article below.
// https://www.sitepoint.com/custom-pdf-rendering/
function getTextInRect(pageNumber, Xi, Yi, Xl, Yl) { // modify pageNumber if required
// Get the page if page render method works like (page-1, page-2, ...)
// If not, modify according to
@Whizboy-Arnold
Whizboy-Arnold / scientificToDecimal.js
Created January 18, 2021 15:20 — forked from jiggzson/scientificToDecimal.js
Converts a javascript number from scientific notation to a decimal string
var scientificToDecimal = function (num) {
var nsign = Math.sign(num);
//remove the sign
num = Math.abs(num);
//if the number is in scientific notation remove it
if (/\d+\.?\d*e[\+\-]*\d+/i.test(num)) {
var zero = '0',
parts = String(num).toLowerCase().split('e'), //split into coeff and exponent
e = parts.pop(), //store the exponential part
l = Math.abs(e), //get the number of zeros
@Whizboy-Arnold
Whizboy-Arnold / mysql_store_use_result_stmt_cursor.c
Created November 25, 2020 08:00 — forked from hoterran/mysql_store_use_result_stmt_cursor.c
mysql api example, include store_result, use_result, stmt, server cursor , fetch row setting
#include <stdio.h>
#include <mysql.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
int main (int argc, char *argv[]) {
MYSQL *mysql;
MYSQL_RES *result;
@Whizboy-Arnold
Whizboy-Arnold / mysql_store_use_result_stmt_cursor.c
Created November 25, 2020 08:00 — forked from hoterran/mysql_store_use_result_stmt_cursor.c
mysql api example, include store_result, use_result, stmt, server cursor , fetch row setting
#include <stdio.h>
#include <mysql.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
int main (int argc, char *argv[]) {
MYSQL *mysql;
MYSQL_RES *result;
@Whizboy-Arnold
Whizboy-Arnold / mysql_store_use_result_stmt_cursor.c
Created November 25, 2020 08:00 — forked from hoterran/mysql_store_use_result_stmt_cursor.c
mysql api example, include store_result, use_result, stmt, server cursor , fetch row setting
#include <stdio.h>
#include <mysql.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
int main (int argc, char *argv[]) {
MYSQL *mysql;
MYSQL_RES *result;