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/env python | |
| from modulebase import ModuleBase,ModuleHook | |
| # import random | |
| import yaml | |
| import os | |
| import time | |
| from threading import Timer | |
| from operator import itemgetter | |
| from random import choice |
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
| try{ | |
| BufferedReader reader = new BufferedReader(new FileReader("fileName.txt")); | |
| String line = ""; | |
| while ((line = reader.readLine())!=null){ | |
| //Do something with the line, say store it in an array | |
| } | |
| reader.close(); | |
| } | |
| catch (FileNotFoundException e){ | |
| e.printStackTrace(); |
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 String percentEncode(String s){ | |
| String result = ""; | |
| for (int i=0; i<s.length(); i++){ | |
| char check = s.charAt(i); | |
| if (Character.isLetter(check) || Character.isDigit(check) || check == '-' || check=='.' || check=='_' || check == '~' ){ | |
| result+=check; | |
| } | |
| else{ | |
| result+=("%"+Integer.toHexString(check)); | |
| } |
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
| Bitmap profileBitmap = BitmapFactory.decodeStream(connection.getInputStream()); | |
| Bitmap finalBitmap = Bitmap.createBitmap(profileBitmap.getWidth(),profileBitmap.getHeight(),Bitmap.Config.ARGB_8888); | |
| Canvas canvas = new Canvas(finalBitmap); | |
| Path p = new Path(); | |
| p.addCircle(profileBitmap.getHeight()/2,profileBitmap.getHeight()/2,profileBitmap.getWidth()/2,Path.Direction.CCW); | |
| canvas.clipPath(p);; | |
| canvas.drawBitmap(profileBitmap,new Rect(0,0,profileBitmap.getHeight(),profileBitmap.getWidth()),new Rect(0,0,profileBitmap.getHeight(),profileBitmap.getWidth()),null); |
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
| function timeStringtoTime(s){ | |
| if (s.indexOf('ms')!=-1){ | |
| var result = s.replace('ms',''); | |
| console.log(result); | |
| return parseInt(result); | |
| } | |
| else{ | |
| var result = s.replace('s',''); | |
| return parseFloat(result)*1000; | |
| } |
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
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <unistd.h> | |
| #include <sys/wait.h> | |
| #include <sys/types.h> | |
| void forkAndCalculate(int num); | |
| int main(int argc, char **argv){ | |
| if (argc!=2 || argv[1]<0){ |
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
| public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle savedInstanceState){ | |
| final View view = inflater.inflate(R.layout.fragment_timeline,viewGroup,false); | |
| final SwipeRefreshLayout refreshLayout = (SwipeRefreshLayout)view.findViewById(R.id.refresh); | |
| ListView timelineView = (ListView) view.findViewById(R.id.timelineList); | |
| //... | |
| return view | |
| } |
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 random | |
| import time | |
| from termcolor import cprint | |
| colors = ["grey", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] | |
| while True: | |
| tempColors = list(colors) | |
| foreground = random.choice(tempColors) | |
| tempColors.remove(foreground) |
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
| // ---- | |
| // libsass (v3.2.5) | |
| // ---- | |
| $black-color: #191919; | |
| $highlight-color: #469FB3; | |
| html, body { | |
| width: 100%; | |
| height: 100%; | |
| } |
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
| // ---- | |
| // libsass (v3.2.5) | |
| // ---- | |
| $black-color: #191919; | |
| $highlight-color: #469FB3; | |
| html, body { | |
| width: 100%; | |
| height: 100%; | |
| } |
OlderNewer