Skip to content

Instantly share code, notes, and snippets.

@VenkataRaju
VenkataRaju / Create a wifi hotspot in Ubuntu 16.04 laptop.txt
Last active February 27, 2020 09:10
Create a wifi hotspot in Ubuntu 16.04 laptop
1. Click on Network Icon on top panel
🡪 Edit Connections
🡪 click on "Wifi" in the pop-up
🡪 click on "Add" button in the pop-up
2. In the popup, choose Hardware > Wi-Fi 🡪 click on "Create"
3. In the next pop-up
a. Give connection a name. e.g. laptop-wifi-hotspot
b. In "General" tab
1. Uncheck 'Automatically connect to this network when it is available'
Note: Otherwise, since the hotspot is always active, you won't see the menu entries to connect to other Wi-Fi networks in the network manager
@VenkataRaju
VenkataRaju / AccessCountingCharSequence.java
Last active January 20, 2020 08:03
Access Counting CharSequence
public final class AccessCountingCharSequence implements CharSequence
{
private final CharSequence str;
private final List<Integer> accessCounts = new ArrayList<>();
private final List<Integer> unmodifiableAccessCounts = Collections.unmodifiableList(accessCounts);
private int accessCount = 0;
public AccessCountingCharSequence(CharSequence str)
{
@VenkataRaju
VenkataRaju / CodePointReader.java
Created August 26, 2019 11:08
Java Unicode CodePoint Reader
public final class CodePointReader implements AutoCloseable
{
private final Reader reader;
public CodePointReader(Reader reader)
{
this.reader = reader;
}
public int read()
@VenkataRaju
VenkataRaju / AndroidApps.md
Last active June 21, 2020 13:48
Android Apps

. Call Recorder - ACR from 'NLL' (nllapps.com)

. Code Viewer from Pavel Gudkov

. Evernote- Organizer, Planner for Notes & Memos from 'Evernote Corporation'

. IP Webcam from 'Pavel Khlebovich'

. Lock Screen from olalab

@VenkataRaju
VenkataRaju / Java Unicode Notes.txt
Last active August 11, 2020 12:34
Java Unicode Notes
U+FFFF (Uniicode repesentation) is same as 0xFFFF (Hexa decimal)
To convert "U+FFFF" to code point
int codepoint=Integer.parseInt(str.substring(2), 16);
Basic Multilingual Pane (BMP) = U+00000 ( 0) to U+FFFF ( 65535) (1111111111111111 (16 1s) in Binary)
Supplementary chars = U+10000 (65536) to U+10FFFF (1114111)
All unicode characters = U+00000 ( 0) to U+10FFFF (1114111)
An unicode character in Java represented by two UTF-16 characters
@VenkataRaju
VenkataRaju / Stats.java
Last active April 6, 2019 15:03
Java File Related Statistics
public final Stats
{
public static void topJavaFilesByLoc() throws Exception
{
try (ZipFile zipFile = new ZipFile("/usr/lib/jvm/java-11.0.1-openjdk-amd64/lib/src.zip"))
{
Map<Long, Set<String>> fileNamesByNumberOfLines = zipFile.stream()
.map(zipEntry ->
{
if (zipEntry.isDirectory())
@VenkataRaju
VenkataRaju / JavaFX Annoyances.txt
Created November 3, 2018 06:18
JavaFX Annoyances
1) No Systemtray support
2) Can't selected multiple folders in file browser
@VenkataRaju
VenkataRaju / Find Invalid Special Characters In Password.html
Created August 21, 2018 05:10
Finds Invalid Special Characters In Password
<!-- 21 Aug 2018 -->
<html>
<head lang='en-US' >
<meta charset='UTF-8' />
<meta content='text/html; charset=UTF-8' http-equiv='content-type' />
<title>Find Invalid Special Characters In Password</title>
<script>
function $(id) { return document.getElementById(id); }
function init()
{
@VenkataRaju
VenkataRaju / SneakyThrow.java
Created March 16, 2018 22:04
Throw checked exception without declaring and create useful Stream friendly functional interfaces which throws Exception
public class SneakyThrow
{
public static RuntimeException uncheckedThrow(Throwable t)
{
throw uncheckedThrow0(t);
}
@SuppressWarnings("unchecked")
private static <X extends Throwable> RuntimeException uncheckedThrow0(Throwable t) throws X
{
@VenkataRaju
VenkataRaju / CustomProgressbar.html
Created March 2, 2018 11:21
Custom Progressbar
<!DOCTYPE html>
<html>
<head lang="en-US">
<meta charset="UTF-8">
<title>Custom Progressbar</title>
<script>
let progress, progressText, currentProgress = 0, delay = 25;
function init()
{
[progress, progressText] = ['progress', 'progress-text'].map(id => document.getElementById(id));