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
#!/bin/python3 | |
''' | |
Given the element [86, 74, 8, 74, 92, 44, 24] for the first pass, we find the element to the left of 86, which is empty, so we add 0 (-1 + 1 = 0) as the index to the left stack. | |
Given the element [86, 74, 8, 74, 92, 44, 24] for the second pass, we find the closest element to the left of 74, which is greater than 74, so we push index 1 with a value of 86 (0 + 1 = 1) to the left stack. | |
Given the element [86, 74, 8, 74, 92, 44, 24] for the third pass, we find the closest element to the left of 8, which is greater than 8, so we push index 2 (1 + 1 = 2) with value 74 as the index to the left stack. | |
Given the element [86, 74, 8, 74, 92, 44, 24] for the fourth pass, we find the closest element to the left of 74, which is greater than 74, so we push the index 0 with a value of 86 (0 + 1 =1) to the left stack. |
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
import java.math.*; | |
import java.util.concurrent.atomic.*; | |
import java.util.*; | |
interface Combiner<T> {T combine(T x, T y); } | |
interface UnaryFunction<R,T> {R function(T x);} | |
interface Collector<T> extends UnaryFunction<T,T> { | |
T result(); //extract result of collecting parameter | |
} |
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
def convert_pdf_to_text(filename): | |
count = 0 | |
text = "" | |
pdfFileObj = open(filename,'rb') | |
pdfReader = PyPDF2.PdfFileReader(pdfFileObj) | |
num_pages = pdfReader.numPages | |
while count < num_pages: | |
pageObj = pdfReader.getPage(count) | |
count +=1 | |
text += pageObj.extractText() |
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
sudo apt install python3.6 | |
sudo apt-get install ipython3 | |
whereis python | |
which python | |
python3 | |
ipython3 | |
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
import {Component, h} from 'preact'; // eslint-disable-line no-unused-vars | |
import React from 'react'; | |
import Select from 'react-select'; | |
import { CompactPicker } from 'react-color'; | |
import {AlphaPicker} from 'react-color'; | |
import reactCSS from 'reactcss'; | |
import Style from './Style'; | |
class MyTestColorPicker extends React.Component { |