This file contains 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
protected synchronized Class<?> loadClass(String name, boolean resolve) | |
throws ClassNotFoundException | |
{ | |
// First, check if the class has already been loaded | |
Class c = findLoadedClass(name); | |
if (c == null) { | |
try { | |
if (parent != null) { | |
c = parent.loadClass(name, false); | |
} else { |
This file contains 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
#!/opt/local/bin/gprolog --consult-file | |
segment([H1,H2],[H1,H2]):-!. | |
segment([H1,H2],[H1,H2|_]):-!. | |
segment([H1,H2],[_,H4|T2]) :- segment([H1,H2],[H4|T2]). | |
adjacent([H1,H2],L1,L2) :- segment([H1,H2],L1),!;segment([H2,H1],L2),!. | |
valid_set([],_,_). | |
valid_set([H|T],Y,AL):- member(H,Y), \+(member(H,AL)), valid_set(T,Y,[H|AL]). |
This file contains 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
#!/opt/local/bin/gprolog --consult-file | |
valid_queen(Col) :- | |
member(Col,[1,2,3,4,5,6,7,8]). | |
valid_board([]). | |
valid_board([H|T]):- valid_queen(H),valid_board(T). | |
diags1(_,[],[]). | |
diags1(Row,[Col|QT],[D|DT]) :- |
This file contains 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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading; | |
namespace TimerDeferredEval | |
{ | |
class JobScheduler : IDisposable | |
{ | |
private static readonly TimeSpan DueTime = new TimeSpan(0, 0, 0, 5); |
This file contains 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
#!/opt/local/bin/gprolog --consult-file | |
rev([X],[X]). | |
rev([H|T],RL) :- rev(T,RT), append(RT,[H],RL). |
This file contains 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
#!/opt/local/bin/gprolog --consult-file | |
book('Seven langauges in seven days','Bruce tate'). | |
book('Beyond Java','Bruce tate'). | |
book('Bitter Java','Bruce tate'). | |
book('Spring Developer Note Book','Bruce tate'). | |
book('C programming language','Ritchie','Kernighan'). | |
book('Practice Of Programming','Kernighan','Pike'). | |
book('Unix Programming Environment','Pike','Kernighan'). |
This file contains 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
#!/usr/bin/env io | |
OperatorTable addAssignOperator(":", "genAttribute") | |
Builder := Object clone | |
Builder genAttribute := method(k,v, | |
k = k asMutable removePrefix("\"") removeSuffix("\"") | |
write(" "..(k)..("=\"")..(v).."\"") ) | |
Builder curlyBrackets := method( |
This file contains 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
list( list(2,3) list(3,4,5) list(6)) flatten sum |
This file contains 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
#!/usr/bin/env io | |
Vehicle := Object clone | |
Vehicle desc := "Moving Object" | |
Car := Vehicle clone | |
Car drive := method ("Vrooom..." println) | |
ferrari := Car clone | |
Car drive | |
Car slotNames println |
This file contains 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
module ActsAsCsv | |
def self.included(base) | |
base.extend ClassMethods | |
base.act_as_csv | |
end | |
module ClassMethods | |
def act_as_csv | |
include InstanceMethods |
NewerOlder