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
for d in *; do | |
if [ -d "$d" ]; then # or: if test -d "$d"; then | |
( cd "$d" && ffmpeg -threads 16 -i video.mp4 -c:v libvpx -b:v 10M -c:a libvorbis video.webm && rm video.mp4) | |
fi | |
done |
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
# Creates imagea.png, imageb.png, imagec.png -> imagea_1.png, imageb_2.png, imagec_3.png, etc. | |
path = '/my/folder/path' | |
files = os.listdir(path) | |
file_noext = file[:-4] | |
extension = '.png' | |
separator = '_' | |
print('Renaming...') |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class AudioFromResources : MonoBehaviour | |
{ | |
static AudioClip audioClipName; | |
public static AudioSource audioSrc; | |
void Start () |
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
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; | |
SET time_zone = "+00:00"; | |
CREATE TABLE `tableName` | |
( | |
`columnName` varchar(40) NOT NULL | |
) | |
ENGINE=MyISAM DEFAULT CHARSET=utf8; |
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
class FloydWarshell | |
{ | |
// Recursive Function to print path of given | |
// vertex u from source vertex v | |
private static void printPath(int[][] path, int v, int u) | |
{ | |
if (path[v][u] == v) | |
return; | |
printPath(path, v, path[v][u]); |
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.util.*; | |
// Data structure to store graph edges | |
class Edge | |
{ | |
int source, dest, weight; | |
public Edge(int source, int dest, int weight) { | |
this.source = source; | |
this.dest = dest; |
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.util.*; | |
// Data structure to store graph edges | |
class Edge | |
{ | |
int src, dest, weight; | |
public Edge(int src, int dest, int weight) { | |
this.src = src; | |
this.dest = dest; |
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.util.*; | |
// class to represent a disjoint set | |
class DisjointSet | |
{ | |
private Map<Integer, Integer> parent = new HashMap(); | |
// stores the depth of trees | |
private Map<Integer, Integer> rank = new HashMap(); |
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.util.*; | |
// Data structure to store graph edges | |
class Edge | |
{ | |
int source, dest; | |
public Edge(int source, int dest) { | |
this.source = source; | |
this.dest = dest; |
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.util.Arrays; | |
// Data structure for Max Heap | |
class HeapSort | |
{ | |
// return left child of A[i] | |
private static int LEFT(int i) { | |
return (2 * i + 1); | |
} |
NewerOlder