Skip to content

Instantly share code, notes, and snippets.

View engleek's full-sized avatar

Christopher Humphries engleek

View GitHub Profile
((?:udp|smtp|pop3|ssh|telnet|https?|s?ftp|imap|git|cvs|svn)://(?:[a-z0-9-]+\.)*[a-z0-9]+\.(?:aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|co\.uk|gouv\.fr|[a-z]{2})(?:\:[0-9]{1,6})?(?:/[a-z0-9-\.]+)*(?:\?[a-z0-9]+=[a-z0-9]+(?:&[a-z0-9]+=[a-z0-9]+)*)?(?:#[a-z0-9]+)?)
var selection = false;
if(window.getSelection){
selection = window.getSelection();
}else if(document.getSelection){
selection = document.getSelection();
}else if(document.selection){
selection = document.selection.createRange().text;
}
var pageTitle = document.title;
We couldn’t find that file to show.
@engleek
engleek / gist:299808
Created February 9, 2010 23:14
Base 62 String Decode
byte[] strValDecode(String s)
{
final String alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
BigInteger b = BigInteger.ZERO;
BigInteger b62 = new BigInteger("62");
for (int i=0; i<s.length(); i++) {
int idx = alphabet.indexOf(s.codePointAt(i));
b = b.multiply(b62).add(new BigInteger(Integer.toString(idx)));
int evaluate_position(int color){
int result = 0;
if ((get_horizontal_lines(4, color * (-1)) || (get_vertical_lines(4, color * (-1)) || get_diagonal_lines(4, color * (-1))))) {
return (-1) * VALUE_QUAD;
}
if ((get_horizontal_lines(4, color) || (get_vertical_lines(4, color) || get_diagonal_lines(4, color)))) {
return VALUE_QUAD;
}
SubDir HAIKU_TOP src add-ons media plugins dvd ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders media ;
SubDirHdrs [ FDirName $(SUBDIR) libdvdvm ] ;
SubDirHdrs [ FDirName $(SUBDIR) libdvdnav ] ;
SubDirHdrs [ FDirName $(SUBDIR) libdvdread ] ;
Welcome to the Haiku shell.
~> /system/demos/Cortex
BMediaRoster::InstantiateDormantNode: addon-id 4, flavor_id 0, flags 0x0
### BMediaRosterEx::LoadNodeConfiguration should load addon-id 4, flavor-id 0 config NOW!
DVDDiskNode::LoadDisk()
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Encrypted DVD support unavailable.
libdvdnav: DVD Title: IMMORTEL
libdvdnav: DVD Serial Number: bf14112e
KERN: scsi_cd: ioctl(op = 7)
KERN: scsi_cd: update_capacity()
KERN: scsi_cd: cd_set_capacity(info = 0x82354930, capacity = 3713600, blockSize = 2048)
KERN: scsi_cd: scsi_disk: get_geometry(): 2048, 1, 3713600, 1, 5, 1, 1, 0
KERN: scsi_cd: close()
KERN: scsi_cd: free()
KERN: runtime_loader: Cannot open file libdvdcss.so.2: No such file or directory
KERN: scsi_cd: close()
KERN: scsi_cd: free()
KERN: scsi_cd: ioctl(op = 15)
ssize_t
DVDDiskNode::ReadAt(off_t pos, void *buffer, size_t size)
{
printf("DVD::ReadAt(%i, %lu)\n", (int)pos, (unsigned long)size);
int blockCount = ceil(size / DVD_VIDEO_LB_LEN);
uint8_t *buf = (uint8_t *) buffer;
buf = new uint8_t[blockCount * DVD_VIDEO_LB_LEN];
<!DOCTYPE html>
<html>
<head>
<title>${title}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="shortcut icon" type="image/png" href="/public/images/favicon.png" />
<link rel="stylesheet" href="http://yui.yahooapis.com/2.8.1/build/reset-fonts-grids/reset-fonts-grids.css" />