This file contains hidden or 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 base64 | |
| import time | |
| import math | |
| import hmac | |
| import hashlib | |
| def print_bytes(bytes): | |
| print(",".join([str(byt) for byt in bytes])) | |
| def base32_decode(encoded_str): |
This file contains hidden or 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
| # Problem 2 | |
| def answer(): | |
| input_array = list(map(int, input("Enter nums in space separated list:- "). strip(). split())) | |
| temp_array = [] | |
| for elm in input_array: | |
| if elm in temp_array: | |
| temp_array.remove(elm) | |
| else: | |
| temp_array.append(elm) | |
| # check if there were more than one single integer input |
This file contains hidden or 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
| var Appbase = require('appbase-js') | |
| var appbaseRef =new Appbase({ | |
| url: 'https://*********:********-143c-412d-88a1-f539c7795f57@scalr.api.appbase.io', | |
| appname: 'kbasharfirstapp' | |
| }) | |
| var jsonObject = { | |
| "department_name":"Books", | |
| "department_name_analyzed":"Books", |
This file contains hidden or 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
| package com.kbashar.pdfboxtry; | |
| import org.apache.pdfbox.encoding.Encoding; | |
| import org.apache.pdfbox.pdmodel.PDDocument; | |
| import org.apache.pdfbox.pdmodel.PDPage; | |
| import org.apache.pdfbox.pdmodel.PDResources; | |
| import org.apache.pdfbox.pdmodel.font.PDFont; | |
| import org.apache.pdfbox.pdmodel.font.PDTrueTypeFont; | |
| import org.apache.pdfbox.pdmodel.font.PDType0Font; |
This file contains hidden or 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
| package org.apache.pdfbox; | |
| import org.apache.pdfbox.cos.*; | |
| import org.apache.pdfbox.pdfviewer.ArrayEntry; | |
| import org.apache.pdfbox.pdfviewer.MapEntry; | |
| import org.apache.pdfbox.pdfviewer.PDFTreeCellRenderer; | |
| import org.apache.pdfbox.pdfviewer.PDFTreeModel; | |
| import org.apache.pdfbox.pdmodel.PDDocument; | |
| import org.apache.pdfbox.util.ExtensionFileFilter; |
This file contains hidden or 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
| package com.kbashar.pdfboxtry; | |
| import org.apache.pdfbox.cos.COSBase; | |
| import org.apache.pdfbox.cos.COSObject; | |
| import org.apache.pdfbox.cos.COSStream; | |
| import org.apache.pdfbox.pdfparser.PDFParser; | |
| import org.apache.pdfbox.pdmodel.PDDocument; | |
| import sun.misc.IOUtils; | |
| import java.io.*; |
This file contains hidden or 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
| package com.kbashar.pdfboxtry; | |
| import org.apache.pdfbox.encoding.Encoding; | |
| import org.apache.pdfbox.pdmodel.PDDocument; | |
| import org.apache.pdfbox.pdmodel.PDPage; | |
| import org.apache.pdfbox.pdmodel.PDResources; | |
| import org.apache.pdfbox.pdmodel.font.PDFont; | |
| import java.io.IOException; | |
| import java.util.List; |
This file contains hidden or 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
| package com.kbashar.pdfboxtry; | |
| import org.apache.pdfbox.cos.COSArray; | |
| import org.apache.pdfbox.cos.COSStream; | |
| import org.apache.pdfbox.cos.COSString; | |
| import org.apache.pdfbox.pdmodel.PDDocument; | |
| import org.apache.pdfbox.pdmodel.PDPage; | |
| import org.apache.pdfbox.util.PDFOperator; | |
| import java.io.IOException; |
This file contains hidden or 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
| package com.kbashar.pdfboxtryout; | |
| import org.apache.pdfbox.cos.COSBase; | |
| import org.apache.pdfbox.cos.COSName; | |
| import org.apache.pdfbox.pdmodel.PDDocument; | |
| import org.apache.pdfbox.pdmodel.PDPage; | |
| import org.apache.pdfbox.pdmodel.graphics.xobject.PDJpeg; | |
| import org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap; | |
| import org.apache.pdfbox.pdmodel.graphics.xobject.PDXObject; | |
| import org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage; |
This file contains hidden or 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
| Find an Array | |
| Implement a method that given two arrays as parameters will find the starting index where the second parameter occurs as a sub-array in the array given as the first parameter. | |
| Your implementations should return -1 if the sub-array cannot be found. | |
| Your implementation must implement the FindArray interface given bellow: | |
| public interface FindArray { | |
| int findArray(int[] array, int[] subArray); | |
| } | |
| Sample Input: | |
| [4,9,3,7,8] and [3,7] should return 2. | |
| [1,3,5] and [1] should return 0. |