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
| #!/usr/bin/python | |
| import sys | |
| cur_word = None | |
| cur_cnt = 0 | |
| word = None | |
| for line in sys.stdin: | |
| line = line.strip() |
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
| #!/usr/bin/python | |
| import sys | |
| checkwords = ('for','is','and') | |
| if len(sys.argv)>1: | |
| checkwords = tuple(sys.argv) | |
| checkwords = [ lo.lower() for lo in checkwords ] |
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 java.io.File; | |
| import java.io.FileNotFoundException; | |
| import java.util.Scanner; | |
| public class RowDelimitedFileExample { | |
| private static final String INPUT_FILE = "C:/workspace/Sample.csv"; | |
| private static final String ROW_DELIMITED_BY = "\n"; | |
| private static final String FIELD_DELIMITED_BY = ","; |
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
| #How to write conditions in python without repeating words | |
| #Python 2.x | |
| avariable = 1 | |
| q_list = [1,2,3] | |
| q_set = {1,2,3} | |
| q_tuple = (1,2,3) | |
| # Searching for the avariable in a LIST of possible elements; will search for all elements even repeats. |
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 sree.utils; | |
| import java.time.Duration; | |
| import java.time.LocalDateTime; | |
| public class ProgressMonitor { | |
| private static final long tickerInterval = 2*1000; // 2 seconds | |
| private Thread innerThread; |
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
| private static final String readSQLQueryFromFile() { | |
| try (Scanner sc = new Scanner( | |
| MyClass.class.getResourceAsStream(MyClass.class | |
| .getSimpleName() + ".sql"))) { | |
| sc.useDelimiter("\\Z"); | |
| return sc.next(); | |
| } catch (Exception e) { | |
| throw e; | |
| } | |
| } |