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
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 | |
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
#!/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
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 { |
OlderNewer