Skip to content

Instantly share code, notes, and snippets.

Jim Regan jimregan

Block or report user

Report or block jimregan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View linked-list-print-middle.c
/* print middle element of list; second if even */
/* http://practice.geeksforgeeks.org/problems/finding-middle-element-in-a-linked-list/1 */
/* tl;dr - two pointers, one incrementing by two */
#include <stdio.h>
#include <stdlib.h>
struct Node {
int data;
struct Node* next;
View ffs.java
private static String dropSpaces(String s) {
String out = "";
for(char c : s.toCharArray()) {
if(c != ' ') {
out += c;
}
}
return out;
}
public static String stringDropsString(String haystack, String needle) {
View cheap-eid.pl
#!/usr/bin/perl
# Copyright (c) 2015-2016 Trinity College, Dublin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
View longest_suffix.pl
#!/usr/bin/perl
my @in = qw(asfalt asfaltu asfalcie);
sub longest_suffix {
my $list = shift;
my $first = shift(@{$list});
for my $second(@in) {
my @a = split(//, $first);
View phon-collisions.pl
#!/usr/bin/perl
use warnings;
use strict;
use utf8;
open(IN, "<", "$ARGV[0]");
binmode(IN, ":encoding(latin-1)");
#open(OUT, ">", "collisions.txt");
#binmode(OUT, ":utf8");
View pronfixfg.pl
#!/usr/bin/perl
use warnings;
use strict;
use utf8;
binmode(STDIN, ":utf8");
my %tweak = (
'áit éigin' => '',
View unfada.pl
#!/usr/bin/perl
use warnings;
use strict;
use utf8;
binmode(STDIN, ":utf8");
binmode(STDOUT, ":utf8");
sub unfada {
View aev-aev_FONIPA.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE supplementalData SYSTEM "../../common/dtd/ldmlSupplemental.dtd">
<!--
Copyright © 1991-2013 Unicode, Inc.
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
For terms of use, see http://www.unicode.org/copyright.html
-->
<supplementalData>
<version number="$Revision$"/>
<transforms>
View fp-phon-collisions.pl
#!/usr/bin/perl
use warnings;
use strict;
use utf8;
open(IN, "<", "$ARGV[0]");
binmode(IN, ":encoding(latin-1)");
#open(OUT, ">", "collisions.txt");
#binmode(OUT, ":utf8");
View cng-cat.pl
#!/usr/bin/perl
use warnings;
use strict;
use utf8;
binmode(STDIN, ":encoding(UTF-16LE)");
binmode(STDOUT, ":utf8");
binmode(STDERR, ":utf8");
You can’t perform that action at this time.