This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let jspdf = document.createElement("script"); | |
jspdf.onload = function () { | |
let pdf = new jsPDF(); | |
let elements = document.getElementsByTagName("img"); | |
for (let i in elements) { | |
let img = elements[i]; | |
console.log("add img ", img); | |
if (!/^blob:/.test(img.src)) { | |
console.log("invalid src"); | |
continue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quick sort in C | |
#include <stdio.h> | |
// function to swap elements | |
void swap(int *a, int *b) { | |
int t = *a; | |
*a = *b; | |
*b = t; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quick sort in Java | |
import java.util.Arrays; | |
class Quicksort { | |
// method to find the partition position | |
static int partition(int array[], int low, int high) { | |
// choose the rightmost element as pivot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Quick sort in Python | |
# function to find the partition position | |
def partition(array, low, high): | |
# choose the rightmost element as pivot | |
pivot = array[high] | |
# pointer for greater element | |
i = low - 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\\\ sum of main diagonal | |
/// sum of sub diagonal | |
#include <stdio.h> | |
void main () | |
{ | |
static int array[10][10]; | |
int i, j, m, n, a = 0, sum = 0; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ALGORITHM: | |
STEP 1: START | |
STEP 2: INITIALIZE arr[] = {1, 2, 3, 4, 5} | |
STEP 3: length= sizeof(arr)/sizeof(arr[0]) | |
STEP 4: PRINT "Original Array:" | |
STEP 5: REPEAT STEP 6 and STEP 7 UNTIL i<length | |
STEP 6: PRINT arr[i] | |
STEP 7: i=i+1 | |
STEP 8: PRINT new line. | |
STEP 9: PRINT "Array in reverse order" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* C Program to Print Negative Numbers in an Array */ | |
#include<stdio.h> | |
int main() | |
{ | |
int Size, i, a[10]; | |
Size = 10; | |
printf("\n Please Enter the Array Elements : "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
num is static -> no need to initialize (=0) | |
(int)'d' = ascii value of 'd' (=100) | |
*/ | |
public class Program | |
{ | |
static int num; | |
public static void main(String[] args) { | |
while(num < (int)'d'){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Add to bookmark | |
* Several tests are necessary in order for this "simple" action to work in most of the browsers | |
* | |
*/ | |
// First, we define the element where the "Add to bookmark" action will trigger | |
var triggerBookmark = $(".js-bookmark"); // It must be an `a` tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A basic code for matrix input from user | |
R = int(input("Enter the number of rows:")) | |
C = int(input("Enter the number of columns:")) | |
# Initialize matrix | |
matrix = [] | |
print("Enter the entries rowwise:") | |
# For user input |
NewerOlder