Skip to content

Instantly share code, notes, and snippets.

View swaroopjcse's full-sized avatar

Swaroop Joshi swaroopjcse

View GitHub Profile
@swaroopjcse
swaroopjcse / activity_main.xml
Created September 9, 2021 06:11
Starter code for the Units app for teaching Testing in Android
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_c_f"
<rss version="2.0">
<channel>
<title>Title goes here</title>
<link>Link goes here</link>
<description>Description goes here</description>
<item>
<title>Optional title goes here</title>
<description>Optional description goes here</description>
<link>Optional link goes here</link>
<pubDate>Optional publication date goes here</pubDate>
@swaroopjcse
swaroopjcse / keybase.md
Created July 23, 2017 03:58
My keybase proof

Keybase proof

I hereby claim:

  • I am swaroopjcse on github.
  • I am swaroop (https://keybase.io/swaroop) on keybase.
  • I have a public key ASAYlr8MAb1fB8o-3sJCTdPLXDujw0bEH5LdlU7Hz5S3owo

To claim this, I am signing this object:

@swaroopjcse
swaroopjcse / extractlabs.py
Last active November 20, 2022 14:52
A simple python script to extract the files from a recursive zip archive.
#!/usr/bin/python
"""
A simple python script to extract the files from a recursive zip archive.
This script is developed for a specific use of extracting student submissions from a submitted zip bundle,
but can be modified to suit some other requirements too.
Assumed zip structure is:
main_archive.zip
@swaroopjcse
swaroopjcse / Swift RegEx Match
Created September 18, 2015 00:04
Nice shorthand to match RegEx in Swift; courtesy http://www.benscheirman.com/2014/06/regex-in-swift/
if let _ = password.rangeOfString("(some-regex)", options: .RegularExpressionSearch) {
// RegEx matches
} else {
// RegEx does not match
}
@swaroopjcse
swaroopjcse / tex-subfigure
Created May 23, 2015 19:14
Placing figures side-by-side without using any fancy packages. Code based on Sec.1 of http://ftp.math.purdue.edu/mirrors/ctan.org/obsolete/macros/latex/contrib/subfigure/subfigure.pdf
\begin{figure}
\centering
\parbox{.4\textwidth}{%
\includegraphics{img/SE-Discussion}
\caption{First.}%
\label{fig:2figsA}
}%
\qquad
\begin{minipage}{.4\textwidth}%
\includegraphics{img/SE-Discussion2}
@swaroopjcse
swaroopjcse / latex-tikz-utils
Last active August 29, 2015 14:21
Useful tikz commands
%\usepackage{tikz}
%\usetikzlibrary{shapes.geometric, arrows}
\tikzstyle{stage} = [rectangle, rounded corners, minimum height=2cm,text centered, text width=15cm, draw=black, fill=orange!30]
\tikzstyle{label} = [rectangle, text width=15cm, minimum height=1cm, text centered, font=\small]
\tikzstyle{arr} = [draw, -latex', very thick, rounded corners=15mm]
\tikzstyle{line} = [draw, very thick, rounded corners=15mm]
\begin{tikzpicture}[node distance=4cm]
@swaroopjcse
swaroopjcse / unix-utils
Last active March 27, 2017 01:13
Some Unix utilities I use from time to time.
##################################################################
# Author: Swaroop Joshi #
# Last modified: 2017-03-26 #
# These commands work on the fish shell on my Mac OS X Yosemite. #
# Other shells/versions may require some modification #
##################################################################
# Upper to lower
tr '[:upper:]' '[:lower:]'
@swaroopjcse
swaroopjcse / latex-main
Created May 13, 2015 00:19
Main root file for a latex project
\documentclass[a4paper,11pt]{article}
\usepackage{graphicx}
\usepackage{ifpdf}
\ifpdf
% put here packages only for the PDF:
\DeclareGraphicsExtensions{.pdf,.png,.jpg,.mps}
\usepackage{hyperref}
\usepackage{todonotes}
\else
% put here packages only for the DVI:
@swaroopjcse
swaroopjcse / .gitignore
Last active August 29, 2015 14:21 — forked from rbochet/.gitignore
Mac OS X .gitignore file for latex and tex-to-html
# Latex files
*.aux
*.glo
*.idx
*.log
*.toc
*.ist
*.acn
*.acr