Skip to content

Instantly share code, notes, and snippets.

View avipars's full-sized avatar
🎯
Focusing

Avi avipars

🎯
Focusing
View GitHub Profile
@avipars
avipars / bubblesort.mips.s
Created April 8, 2022 19:11 — forked from manudatta/bubblesort.mips.s
Bubble sort in MIPS assembly.
# Copyright 2002 Manu Datta (gmail.com ID Manu dot Datta)
# All rights reserved
.data
msg1: .asciiz "\nEnter integer values followed by return (-1 terminates input): \n"
msg2: .asciiz ","
msg3: .asciiz "Bubble Sort"
msg4: .asciiz "#########pass#########"
msg5: .asciiz "\n"
msg6: .asciiz "\nNumber list has been sorted\n"
@avipars
avipars / scrapeImages.py
Created November 21, 2017 04:23 — forked from genekogan/scrapeImages.py
scraping full size images from Google Images
from bs4 import BeautifulSoup
import requests
import re
import urllib2
import os
import argparse
import sys
import json
# adapted from http://stackoverflow.com/questions/20716842/python-download-images-from-google-image-search
@avipars
avipars / Dijkstra.java
Created May 11, 2017 17:47 — forked from gennad/Dijkstra.java
Dijkstra algorithm java implementation
import java.util.*;
public class Dijkstra {
// assumes Nodes are numbered 0, 1, ... n and that the source Node is 0
ArrayList<Node> findShortestPath(Node[] nodes, Edge[] edges, Node target) {
int[][] Weight = initializeWeight(nodes, edges);
int[] D = new int[nodes.length];
Node[] P = new Node[nodes.length];
ArrayList<Node> C = new ArrayList<Node>();
@avipars
avipars / DeCryptor.java
Created March 18, 2017 21:29 — forked from JosiasSena/DeCryptor.java
Encryptor and Decryptor for data encryption.decryption using the Android KeyStore.
/**
_____ _____ _
| __ \ / ____| | |
| | | | ___| | _ __ _ _ _ __ | |_ ___ _ __
| | | |/ _ \ | | '__| | | | '_ \| __/ _ \| '__|
| |__| | __/ |____| | | |_| | |_) | || (_) | |
|_____/ \___|\_____|_| \__, | .__/ \__\___/|_|
__/ | |
|___/|_|
*/
@avipars
avipars / LocaleUtils.java
Created March 4, 2017 21:10 — forked from GigigoGreenLabs/LocaleUtils.java
Change the locale language inside the app
import android.app.Application;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.view.ContextThemeWrapper;
import java.util.Locale;
public class LocaleUtils {
@avipars
avipars / PermissionsHelper.java
Created October 25, 2015 17:05 — forked from odedhb/PermissionsHelper.java
A simple class for Android Marshmallow. Showing a list of permissions, and allowing the user to change them. This was created to be implemented in http://wheredatapp.com, android's greatest search engine.
package com.nextstagesearch;
import android.Manifest;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.DialogInterface;
import android.content.pm.PackageManager;