-
getAllLinks.js
-
getAllLinks(element) - returns array of all UrlLinks in Document
-
findAndReplaceLinks(searchPattern,replacement) - changes all matching links in Document
-
changeCase.js - Document add-in, provides case-change operations in the add-in Menu.
-
onOpen - installs "Change Case" menu
-
_changeCase - worker function to locate selected text and change text case. Case conversion is managed via callback to a function that accepts a string as a parameter and returns the converted string.
-
helper functions for five cases
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
use hyperon::metta::*; | |
use hyperon::metta::interpreter::*; | |
fn main() { | |
let space = metta_space(" | |
(= (if True $a) $a) | |
(= (if False $a) nop) | |
(= (and True True) True) | |
(= (and True False) False) | |
(= (and False True) False) |
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
// Term registration whether it is an operation or not | |
(= (isop opleft) True) | |
(= (isop opright) True) | |
(= (isop opnop) True) | |
(= (isop ballleft) False) | |
(= (isop ballhit) False) | |
(= (isop ballright) False) | |
// induce implications from event stream | |
(= (induce $Memory Nil) $Memory) |
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
:- use_module(library(pairs)). | |
:- use_module(library(reif)). | |
not_in_list(K, L) :- | |
if_((L = []), | |
true, | |
([X | More] = L, | |
dif(K, X), | |
not_in_list(K, More))). |
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
?- use_module(library(semweb/sparql_client)). | |
true. | |
?- sparql_query('CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o } LIMIT 1', | |
Row, | |
[ host('localhost'), | |
path('/w/index.php/Special:SPARQLEndpoint'), | |
port(8080) ]). | |
ERROR: Domain error: `sparql_result_document' expected, found `'application/xml'' (<?xml version="1.0" encoding="UTF-8"?> | |
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> |
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
;; This buffer is for notes you don't want to save, and for Lisp evaluation. | |
;; If you want to create a file, first visit that file with C-x C-f, | |
;; then enter the text in that file's own buffer. | |
;; (load "cynd/cb-prolog.lisp") | |
#+Allegro | |
(sl::cpushnew :CYC-COMMON-LISP *features*) | |
#+Allegro | |
(use-package :CYC) |
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
/* | |
Answer Sources in Prolog (SWI) - Preview | |
Answer Sources: Extensions | |
Copyright (c) 2015 Julio P. Di Egidio | |
http://julio.diegidio.name/ | |
All rights reserved. | |
Answer Sources: Extensions | |
-------------------------- |
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
/* | |
How few candies does the teacher need? | |
-------------------------------------- | |
Problem: | |
Alice is a teacher of kindergarten. She wants to give some candies to | |
the children in her class. All the children sit in a line and each of | |
them has a rating score according to his or her usual performance. |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
function makeContext() { return { choices:[], trail:[], halted:false }; } | |
// Push a new choice point onto the stack | |
function pushChoice( ctx, choiceThunk ) { | |
ctx.choices.unshift( { thunk:choiceThunk, trailIndex:ctx.trail.length } ); | |
} |
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
:- dynamic asserted_a/1, asserted_z/1. | |
:- b_setval(global_variable, []). | |
count(1_000_000). | |
my_asserta(N) :- asserta(asserted_a(N)). | |
my_assertz(N) :- assertz(asserted_z(N)). | |
my_recorda(N) :- recorda(recorded_a, N). | |
my_recordz(N) :- recordz(recorded_z, N). | |
my_flag(N) :- flag(some_flag, _, N). |
NewerOlder