Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Add grunt task to log long paths in built app | path = require 'path'
module.exports = (grunt) ->
grunt.registerTask 'output-long-paths', 'Log long paths in the built application', ->
shellAppDir = grunt.config.get('atom.shellAppDir')
longPaths = []
grunt.file.recurse shellAppDir, (absolutePath, rootPath, relativePath, fileName) ->
fullPath = ... | |
Add other example a ^Cuntdown sensor | HubotSensor = require('../sensor')
class CountDownSensor extends HubotSensor
constructor: (@robot) ->
super(60 * 1000, false)
@_init()
check: () ->
--@minutes
@minutes == 0
fire: () ->
@notify "Countdown is over!"
@_init()
info: () ->
return "A countdown sensor fired each #{@minu... | |
Set up env for tests | #= require jquery
#= require jquery_ujs
#
#= require ember
#= require ember-data
#
#= require_self
#= require ember_cart/ember/app
jQuery ->
jQuery("#konacha").append('<div id="ember-cart"></div>')
| |
Add publisher script for Nu.nl | ###
// ==UserScript==
// @name Factlink Publisher Pluging for Nu.nl
// @description Enable Factlink on Nu.nl
// @include http*://*.nu.nl/*
// @version 0.0.1
// @grant unsafeWindow
// ==/UserScript==
###
# Compile this file using: coffee -c <filename>
# Drag the compiled file (<name>.user.js) to chrome://extensions to... | |
Add script to control Spot. | # Description:
# Control Spot from campfire. https://github.com/minton/spot
#
# Dependencies:
# None
#
# Configuration:
# HUBOT_SPOT_URL
#
# Commands:
# hubot play - Plays current playlist or song.
# hubot pause - Pause the music.
# hubot play next - Plays the next song.
# hubot play back - Plays the prev... | |
Set left as number without px suffix | {View} = require 'space-pen'
$ = require 'jquery'
_ = require 'underscore'
module.exports =
class WrapGuideView extends View
@activate: ->
rootView.eachEditor (editor) =>
@appendToEditorPane(rootView, editor) if editor.attached
@appendToEditorPane: (rootView, editor) ->
if underlayer = editor.find('... | {View} = require 'space-pen'
$ = require 'jquery'
_ = require 'underscore'
module.exports =
class WrapGuideView extends View
@activate: ->
rootView.eachEditor (editor) =>
@appendToEditorPane(rootView, editor) if editor.attached
@appendToEditorPane: (rootView, editor) ->
if underlayer = editor.find('... |
Add onScroll hide effect Coffeescript | window.lesson = {}
window.lesson.applyScrollEffect = (classList, options) ->
@prevST = 0
@scrollTimer = null
@onScroll = =>
currentST = $(window).scrollTop()
# Update classList elements if scroll change > 50px
if Math.abs(currentST - @prevST) > 50
if currentST > @prevS... | |
Use PeerServer :cloud: instead of EC2 | Peer = require './peer'
Guid = require 'guid'
module.exports =
createPeer: ->
id = Guid.create().toString()
new Peer(id, host: 'ec2-54-218-51-127.us-west-2.compute.amazonaws.com', port: 8080)
connectDocument: (doc, connection) ->
nextOutputEventId = 1
outputListener = (event) ->
event.id = n... | Peer = require './peer'
Guid = require 'guid'
module.exports =
createPeer: ->
id = Guid.create().toString()
new Peer(id, key: '0njqmaln320dlsor')
connectDocument: (doc, connection) ->
nextOutputEventId = 1
outputListener = (event) ->
event.id = nextOutputEventId++
console.log 'sending ... |
Add migration to set channel 'GENERAL' with default: true | Meteor.startup ->
Migrations.add
version: 11
up: ->
###
# Set GENERAL room to be default
###
ChatRoom.update({_id: 'GENERAL'}, {$set: {default: true}})
console.log "Set GENERAL room to be default" | |
Revert "S53434 - Changed Roadmap Planning App to use new base model" | Ext = window.Ext4 || window.Ext
describe 'Rally.apps.roadmapplanningboard.BaseModel', ->
beforeEach ->
@model = Ext.create 'Rally.apps.roadmapplanningboard.BaseModel'
it 'should return false from hasValue when model does not have field', ->
expect(@model.hasValue 'not real').toBe(false)
it 'should retu... | |
Clear deprecations after mapping over them | {userAgent, taskPath} = process.env
handler = null
setupGlobals = ->
global.attachEvent = ->
console =
warn: -> emit 'task:warn', arguments...
log: -> emit 'task:log', arguments...
error: -> emit 'task:error', arguments...
trace: ->
global.__defineGetter__ 'console', -> console
global.document... | {userAgent, taskPath} = process.env
handler = null
setupGlobals = ->
global.attachEvent = ->
console =
warn: -> emit 'task:warn', arguments...
log: -> emit 'task:log', arguments...
error: -> emit 'task:error', arguments...
trace: ->
global.__defineGetter__ 'console', -> console
global.document... |
Add initial spec to highlight deprecations | describe "incompatible packages view", ->
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage('incompatible-packages')
it "opens a pane item when incompatible-packages:view is dispatched", ->
atom.commands.dispatch(atom.views.getView(atom.workspace), 'incompatible-packages:view')
wait... | |
Add deep copy to Range | Point = require 'point'
module.exports =
class Range
constructor: (pointA, pointB) ->
pointA = Point.fromObject(pointA)
pointB = Point.fromObject(pointB)
if pointA.compare(pointB) <= 0
@start = pointA
@end = pointB
else
@start = pointB
@end = pointA
toString: ->
"[#{@s... | Point = require 'point'
_ = require 'underscore'
module.exports =
class Range
constructor: (pointA, pointB) ->
pointA = Point.fromObject(pointA)
pointB = Point.fromObject(pointB)
if pointA.compare(pointB) <= 0
@start = pointA
@end = pointB
else
@start = pointB
@end = pointA
... |
Add tests for preparing and executing SQL. | Connection = require('../../src/connection')
Request = require('../../src/request')
fs = require('fs')
TYPES = require('../../src/data-type').typeByName
getConfig = ->
config = JSON.parse(fs.readFileSync(process.env.HOME + '/.tedious/test-connection.json', 'utf8')).config
config.options.debug =
packet: true
... | |
Add a fix for the weird facebook hash | if window.location.hash == '#_=_'
if history.replaceState
history.replaceState(null, null, window.location.href.split('#')[0])
else
window.location.hash = ''
| |
Make edit link on issuable sidebar works | #= require jquery.waitforimages
class @IssuableContext
constructor: ->
new UsersSelect()
$('select.select2').select2({width: 'resolve', dropdownAutoWidth: true})
$(".context .inline-update").on "change", "select", ->
$(this).submit()
$(".context .inline-update").on "change", ".js-assignee", ->... | #= require jquery.waitforimages
class @IssuableContext
constructor: ->
new UsersSelect()
$('select.select2').select2({width: 'resolve', dropdownAutoWidth: true})
$(".issuable-sidebar .inline-update").on "change", "select", ->
$(this).submit()
$(".issuable-sidebar .inline-update").on "change", ... |
Use key name by default, full otherwise | _ = require 'lodash'
direction = require './direction'
bindings = require '../key-bindings.json'
module.exports = exports = (game) ->
game.on 'key.*', (ch, key) ->
action = bindings[key.full]
if action?
parts = action.split('.')
if parts[0] is 'direction'
parts[1] = direction.normalize parts[1], 1
... | _ = require 'lodash'
direction = require './direction'
bindings = require '../key-bindings.json'
module.exports = exports = (game) ->
game.on 'key.*', (ch, key) ->
action = bindings[key.name ? key.full]
if action?
parts = action.split('.')
if parts[0] is 'direction'
parts[1] = direction.normalize par... |
Add test cases for signal handling | vows = require 'vows'
child_process = require 'child_process'
exec = child_process.exec
spawn = child_process.spawn
assert = require 'assert'
describe = (name, bat) -> vows.describe(name).addBatch(bat).export(module)
t = (fn) ->
->
fn.apply this, arguments
return
program = "var phantom = require('./')... | |
Add first simple tests (not working yet). | ProductTypeGenerator = require('../lib/producttypegenerator').ProductTypeGenerator
describe 'ProductTypeGenerator', ->
beforeEach ->
@generator = new ProductTypeGenerator('foo')
it 'should initialize', ->
expect(@generator).toBeDefined()
it 'should initialize with options', ->
expect(@generator._op... | |
Stop app specs from running. | App = require 'app'
fs = require 'fs'
describe "App", ->
app = null
beforeEach ->
app = new App()
afterEach ->
window.close() for window in app.windows()
waitsFor ->
app.windows().length == 0
describe "open", ->
describe "when opening a filePath", ->
it "displays it in a new wind... | App = require 'app'
fs = require 'fs'
xdescribe "App", ->
app = null
beforeEach ->
app = new App()
afterEach ->
window.close() for window in app.windows()
waitsFor ->
app.windows().length == 0
describe "open", ->
describe "when opening a filePath", ->
it "displays it in a new win... |
Swap parameter order for Document.deserialize() | require 'atom'
require 'window'
$ = require 'jquery'
{$$} = require 'space-pen'
{createPeer, connectDocument} = require './session-utils'
{createSite, Document} = require 'telepath'
window.setDimensions(width: 350, height: 100)
window.setUpEnvironment('editor')
{sessionId} = atom.getLoadSettings()
loadingView = $$ ->... | require 'atom'
require 'window'
$ = require 'jquery'
{$$} = require 'space-pen'
{createPeer, connectDocument} = require './session-utils'
{createSite, Document} = require 'telepath'
window.setDimensions(width: 350, height: 100)
window.setUpEnvironment('editor')
{sessionId} = atom.getLoadSettings()
loadingView = $$ ->... |
Add the custom exception classes. | # Exception class
class CustomException
constructor:(@name, @message,@options)->
log:->
console.log("name", @name, "message", @message, "options", @options)
# Exception for a not implemented method.
class NotImplementedException extends CustomException
constructor:(message, options)->
super("NotImplemente... | |
Add JavaScript State Machine downloader. | handle = require 'knit-common'
user = 'jakesgordon'
repo = 'javascript-state-machine'
filename = if knit.min then 'state-machine.min.js' else 'state-machine.js'
ref = knit.args.shift()
if not ref or knit.help or knit.h
console.log "Knit resource file for downloading the JavaScript State Machine library."
console... | |
Disable hiding the off-canvas upon window resize. | # Extend the "offCanvasWrap" directive in "angular-foundation" to disable hiding of the off-canvas
# upon window resize.
#
# In some browsers for mobile devices, the address bar is automatically hidden when scrolling down
# the page. This is not workable if the height of the contents of the off-canvas exceeds the heigh... | |
Add Facebook generator meta tags. | React = require 'react'
pkg = require '../package.json'
module.exports = [
<meta property='op:generator:application' content='marquee' />
<meta property='op:generator:application:version' content=pkg.version />
] | |
Convert script: implement basic version. | #!/usr/bin/env _coffee
#
# Converts content that we have in our database but haven't converted yet.
#
# See these issues:
#
# https://github.com/zoomhub/zoomhub/issues/89
# https://github.com/zoomhub/zoomhub/issues/91
#
# Usage:
#
# </path/to/this/script> <id>
#
assert = require 'assert'
Content = require '../lib/cont... | |
Add log to main Alchemy class | class Alchemy
constructor: (@conf) ->
@version = "0.1.0"
@layout = {}
@interactions = {}
@utils = {}
@visControls = {}
@styles = {}
@drawing = {}
graph_elem = $('#graph')
igraph_search = $('#igraph-search')
allTags = {}
allCaptions = {}
currentNodeTypes =... | class Alchemy
constructor: (@conf) ->
@version = "0.1.0"
@layout = {}
@interactions = {}
@utils = {}
@visControls = {}
@styles = {}
@drawing = {}
@log = {}
graph_elem = $('#graph')
igraph_search = $('#igraph-search')
allTags = {}
allCaptions = {}
... |
Add A to Z lib | _ = require 'underscore'
# Lifted from:
# https://raw.githubusercontent.com/artsy/artsy-backbone-mixins/master/lib/a_to_z.coffee
module.exports =
#
# Collection models must specify what to sort by through an `alphaSortKey` method
# Sample output:
# {
# '0-9': [ model_instance, model_instance, model_instan... | |
Add jasmine tests to check measure calculation (in progress) | #= require map_editor
beforeEach ->
@map = new L.Map(document.createElement('div')).setView [0, 0], 15
describe 'L.Draw.Polyline.ReactiveMeasure', ->
beforeEach ->
@geod = GeographicLib.Geodesic.WGS84
@drawnItems = new L.FeatureGroup().addTo(@map)
@edit = new L.EditToolbar.Edit @map,
featureGroup... | |
Add typedump(), typecheck() for assertions. |
typedump = (key, value, indent='') ->
if isNumber value
console.log indent + "#{key}: T.num"
else if isString value
console.log indent + "#{key}: T.str"
else if isBoolean value
console.log indent + "#{key}: T.bool"
else if isFunction value
console.log indent + "#{key}: T.func"
else if isError... | |
Use recursinve frame reading (instead of time interval) from video feed to try and hit max frames per second. | cv = require 'opencv'
# First we create a new VideoCapture object to get
# video from the camera (0 for default camera)
camera = new cv.VideoCapture(1)
# we create a window to display the Video frames
namedWindow = new cv.NamedWindow('Video', 0)
color = [255,0,0]
frameRead = () ->
# camera.read allows us to retrie... | |
Use spawn instead of execFile for squirrel events | app = require 'app'
ChildProcess = require 'child_process'
path = require 'path'
updateDotExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe')
exeName = path.basename(process.execPath)
createShortcut = ->
ChildProcess.execFile updateDotExe, ['--createShortcut', exeName], ->
app.quit()
removeS... | app = require 'app'
ChildProcess = require 'child_process'
path = require 'path'
spawnUpdateAndQuit = (option) ->
updateDotExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe')
exeName = path.basename(process.execPath)
updateProcess = ChildProcess.spawn(updateDotExe, ["--#{option}", exeName])
... |
Add initial Settings View menu | 'menu': [
{
'label': 'Packages'
'submenu': [
'label': 'Settings View'
'submenu': [
{ 'label': 'Change Themes', 'command': 'settings-view:change-themes' }
{ 'label': 'Install Themes', 'command': 'settings-view:install-themes' }
{ 'label': 'Install Packages', 'command': 'sett... | |
Kill all atom.exe before signing | path = require 'path'
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
grunt.registerTask 'codesign', 'Codesign the app', ->
done = @async()
if process.platform is 'darwin' and process.env.XCODE_KEYCHAIN
unlockKeychain (error) ->
if error?
done(error)
... | path = require 'path'
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
grunt.registerTask 'codesign', 'Codesign the app', ->
done = @async()
if process.platform is 'darwin' and process.env.XCODE_KEYCHAIN
unlockKeychain (error) ->
if error?
done(error)
... |
Add tool to generate a square polygon | # Teaspoon includes some support files, but you can use anything from your own support path too.
# require support/jasmine-jquery-1.7.0
# require support/jasmine-jquery-2.0.0
# require support/jasmine-jquery-2.1.0
# require support/sinon
# require support/your-support-file
#
# PhantomJS (Teaspoons default driver) doesn... | |
Use quotes for inserted text | # Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing `snip` and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#... | # Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#... |
Remove disableEngineCheck override for release. | <cfscript>
// Use this file to set variables for the Application.cfc's "this" scope.
// Examples:
// this.name = "MyAppName";
// this.sessionTimeout = CreateTimeSpan(0,0,5,0);
// Just to make our test suite pass for now.
this.disableEngineCheck = true;
</cfscript>
| <cfscript>
// Use this file to set variables for the Application.cfc's "this" scope.
// Examples:
// this.name = "MyAppName";
// this.sessionTimeout = CreateTimeSpan(0,0,5,0);
</cfscript>
|
Fix basket total on resume basket | <cftry>
<cfloop collection="#session.epos_archive#" item="key">
<cfset ref = StructFind(session.epos_archive, key)>
<cfset frame = StructCopy(ref)>
<cfset StructDelete(session, "basket")>
<cfset StructInsert(session, "basket", frame)>
<cfset StructDelete(session.epos_archive, key)>
</cfloop>
<cfcatch type="any">... | <cftry>
<cfloop collection="#session.epos_archive#" item="key">
<cfset ref = StructFind(session.epos_archive, key)>
<cfset frame = StructCopy(ref)>
<cfset StructDelete(session, "basket")>
<cfset StructInsert(session, "basket", frame)>
<cfset StructDelete(session.epos_archive, key)>
</cfloop>
<cfset sessio... |
Hide breadcrumbs on home page. | <!---
Xindi - http://www.getxindi.com/
Copyright (c) 2012, Simon Bingham
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 t... | <!---
Xindi - http://www.getxindi.com/
Copyright (c) 2012, Simon Bingham
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 t... |
Add a cfscript include statement to the test template | <cfimport prefix="mp" taglib="../extensions/customtags/" />
<cfimport prefix="common" taglib="../../extensions/customtags/common" />
<cfif structkeyexists(url,"topcat_name_urlsafe")>
<cfif variables.topcat.recordcount>
<mp:nav>
<mpx:foobar />
</mp:nav_new>
<cfelse>
<cfinclude template="missing.cfm" />
</cf... | <cfimport prefix="mp" taglib="../extensions/customtags/" />
<cfimport prefix="common" taglib="../../extensions/customtags/common" />
<cfif structkeyexists(url,"topcat_name_urlsafe")>
<cfif variables.topcat.recordcount>
<mp:nav>
<mpx:foobar />
</mp:nav_new>
<cfelse>
<cfinclude template="missing.cfm" />
</cf... |
Fix for stack overflow error when injecting plugin methods. | <cfscript>
loc.iList = StructKeyList(application.wheels.plugins);
loc.iEnd = ListLen(loc.iList);
for (loc.i=1; loc.i <= loc.iEnd; loc.i++)
{
loc.iItem = ListGetAt(loc.iList, loc.i);
loc.jList = StructKeyList(application.wheels.plugins[loc.iItem]);
loc.jEnd = ListLen(loc.jList);
for (loc.j=1; loc.j <... | <cfscript>
loc.iList = StructKeyList(application.wheels.plugins);
loc.iEnd = ListLen(loc.iList);
for (loc.i=1; loc.i <= loc.iEnd; loc.i++)
{
loc.iItem = ListGetAt(loc.iList, loc.i);
loc.jList = StructKeyList(application.wheels.plugins[loc.iItem]);
loc.jEnd = ListLen(loc.jList);
for (loc.j=1; loc.j <... |
Use new datasource to try and connect | <cfquery datasource="testing">
CREATE TABLE pet (name VARCHAR(20), owner VARCHAR(20),
species VARCHAR(20), sex CHAR(1), birth DATE, death DATE);
</cfquery>
<cfscript>
dump(getTimeZoneInfo());
abort;
o = getBeanFactory().getBean('commonService');
results = o.getURL(sURL = request.sPHPURL & '/results/nfl');
... | <cfquery datasource="test2">
CREATE TABLE pet (name VARCHAR(20), owner VARCHAR(20),
species VARCHAR(20), sex CHAR(1), birth DATE, death DATE);
</cfquery>
<cfscript>
dump(getTimeZoneInfo());
abort;
o = getBeanFactory().getBean('commonService');
results = o.getURL(sURL = request.sPHPURL & '/results/nfl');
w... |
Update Entry.cfm for bootstrap layout and styles | <cfoutput>
<h2>ContentBox Google Code Prettify</h2>
<div>
<p>Paste your code so we can magically prettify it on your site.</p>
#html.startForm(name="codeForm")#
#html.textarea(name="code", label="Code: ", class="textfield", required="true", rows="10")#
<!--- Show Line Numbers --->
#html.label(field="lin... | <cfoutput>
<div class="modal-dialog modal-lg" role="document" >
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4><i class="fa fa-comments"></i>ContentBox Google Code Prettify</h4>
... |
Add back the temporary disableEngineCheck so our test suite can run. | <cfscript>
// Use this file to set variables for the Application.cfc's "this" scope.
// Examples:
// this.name = "MyAppName";
// this.sessionTimeout = CreateTimeSpan(0,0,5,0);
</cfscript>
| <cfscript>
// Use this file to set variables for the Application.cfc's "this" scope.
// Examples:
// this.name = "MyAppName";
// this.sessionTimeout = CreateTimeSpan(0,0,5,0);
// Just to make our test suite pass for now.
this.disableEngineCheck = true;
</cfscript>
|
Add Back Disable Engine Check | <cfscript>
// Use this file to set variables for the Application.cfc's "this" scope.
// Examples:
// this.name = "MyAppName";
// this.sessionTimeout = CreateTimeSpan(0,0,5,0);
</cfscript>
| <cfscript>
// Use this file to set variables for the Application.cfc's "this" scope.
// Examples:
// this.name = "MyAppName";
// this.sessionTimeout = CreateTimeSpan(0,0,5,0);
// Just to make our test suite pass for now.
this.disableEngineCheck = true;
</cfscript>
|
Check for authors table instead of just any table to check whether to populate the test database. | component extends="wheels.Test" {
/*
* Executes once before the test suite runs.
* Populates the test database on reload or if there are no tables in the database.
*/
function beforeAll() {
local.tables = $dbinfo(datasource=application.wheels.dataSourceName, type="tables");
if ((StructKeyExists(url, "reloa... | component extends="wheels.Test" {
/*
* Executes once before the test suite runs.
* Populates the test database on reload or if the authors table does not exist.
*/
function beforeAll() {
local.tables = $dbinfo(datasource=application.wheels.dataSourceName, type="tables");
local.tableList = ValueList(local.t... |
Reset application scope after core tests | component extends="wheels.Test" {
/*
* Executes once before the test suite runs.
* Populates the test database on reload or if the authors table does not exist.
*/
function beforeAll() {
local.tables = $dbinfo(datasource = application.wheels.dataSourceName, type = "tables");
local.tableList = ValueList(loc... | component extends="wheels.Test" {
/*
* Executes once before the test suite runs.
* Populates the test database on reload or if the authors table does not exist.
*/
function beforeAll() {
application.$$$wheels = duplicate(application.wheels);
local.tables = $dbinfo(datasource = application.wheels.dataSource... |
Add custom messages to test expects | component extends="testbox.system.BaseSpec" {
function run(testResults, testBox) {
dataDir = ExpandPath("../data/en");
files = directoryList(dataDir, false, "array");
filesWithErrors = [];
describe("JSON Format Tests", function() {
it("should be valid isJSON==true", function() {
for (filePath in files... | component extends="testbox.system.BaseSpec" {
function run(testResults, testBox) {
dataDir = ExpandPath("../data/en");
files = directoryList(dataDir, false, "array");
describe("JSON Format Tests", function() {
it("should be valid isJSON==true", function() {
for (filePath in files) {
var json = fil... |
Fix for OpenBD ExpandPath() issue with trailing slashes in mappings | <cfcomponent output="false">
<cfscript>
this.name = "cfstatictests_" & hash(GetCurrenttemplatepath());
root = GetDirectoryFromPath(GetCurrentTemplatePath());
this.mappings['/mxunit'] = '#root#../mxunit';
this.mappings['/org/cfstatic'] = '#root#../org/cfstatic';
this.mappings['/tests'] = ... | <cfcomponent output="false">
<cfscript>
this.name = "cfstatictests_" & hash(GetCurrenttemplatepath());
root = GetDirectoryFromPath(GetCurrentTemplatePath());
this.mappings['/mxunit'] = '#root#../mxunit';
this.mappings['/org/cfstatic'] = '#root#../org/cfstatic';
this.mappings['/tests'] = Lef... |
Use directory mapping to add helpers to Wirebox | component {
this.title = "SendGrid Web API v3";
this.author = "Matthew J. Clemente";
this.webURL = "https://github.com/mjclemente/sendgrid.cfc";
this.description = "A wrapper for the SendGrid Web API v3";
function configure(){
settings = {
apiKey = '', // Required
baseUrl = 'https://api.sendgrid.com/v3',... | component {
this.title = "SendGrid Web API v3";
this.author = "Matthew J. Clemente";
this.webURL = "https://github.com/mjclemente/sendgrid.cfc";
this.description = "A wrapper for the SendGrid Web API v3";
function configure(){
settings = {
apiKey = '', // Required
baseUrl = 'https://api.sendgrid.com/v3',... |
Add `this.name` to the admin application. | component {
function onRequestStart(){
location(url="../index.cfm/admin:main", addtoken="false");
}
}
| component {
// ------------------------ APPLICATION SETTINGS ------------------------ //
this.applicationroot = getDirectoryFromPath(getCurrentTemplatePath());
this.name = ListLast(this.applicationroot, "\/") & "_" & Hash(this.applicationroot);
// ------------------------ CALLED WHEN PAGE REQUEST STARTS --------... |
Use standard Java client instead of NOAXIS | component {
function get(required string class) {
return createObject("java", arguments.class, [expandpath("/cashbox/lib/vindicia_NOAXIS.jar")]);
}
function getClassVersion() {
if (isnull(variables.classVersion)) {
var ClientConstants = get("com.vindicia.client.ClientConstants");
variables.classVersion =... | component {
function get(required string class) {
return createObject("java", arguments.class, [expandpath("/cashbox/lib/vindicia.jar")]);
}
function getClassVersion() {
if (isnull(variables.classVersion)) {
var ClientConstants = get("com.vindicia.client.ClientConstants");
variables.classVersion = "v#rep... |
Fix mapping on Adobe CF | component {
this.name = "ColdBoxTestingSuite" & hash(getCurrentTemplatePath());
this.sessionManagement = true;
this.setClientCookies = true;
this.sessionTimeout = createTimeSpan( 0, 0, 15, 0 );
this.applicationTimeout = createTimeSpan( 0, 0, 15, 0 );
testsPath = getDirectoryFromPath( ge... | component {
this.name = "ColdBoxTestingSuite" & hash(getCurrentTemplatePath());
this.sessionManagement = true;
this.setClientCookies = true;
this.sessionTimeout = createTimeSpan( 0, 0, 15, 0 );
this.applicationTimeout = createTimeSpan( 0, 0, 15, 0 );
testsPath = getDirectoryFromPath( ge... |
Replace {botfly} with correct datasource | component extends="coldbox.system.Coldbox" output="false"{
setting enablecfoutputonly="yes";
this.name = hash(getCurrentTemplatePath());
this.sessionManagement = true;
this.sessionTimeout = createTimeSpan(0,0,30,0);
this.setClientCookies = true;
COLDBOX_APP_ROOT_PATH = getDirectoryFromPath(getCurrentTemplatePat... | component extends="coldbox.system.Coldbox" output="false"{
setting enablecfoutputonly="yes";
this.name = hash(getCurrentTemplatePath());
this.sessionManagement = true;
this.sessionTimeout = createTimeSpan(0,0,30,0);
this.setClientCookies = true;
COLDBOX_APP_ROOT_PATH = getDirectoryFromPath(getCurrentTemplatePat... |
Remove leading slash for modulemapping | component {
this.title = "SendGrid Web API v3";
this.author = "Matthew J. Clemente";
this.webURL = "https://github.com/mjclemente/sendgrid.cfc";
this.description = "A wrapper for the SendGrid Web API v3";
function configure(){
settings = {
apiKey = '', // Required
baseUrl = 'https://api.sendgrid.com/v3',... | component {
this.title = "SendGrid Web API v3";
this.author = "Matthew J. Clemente";
this.webURL = "https://github.com/mjclemente/sendgrid.cfc";
this.description = "A wrapper for the SendGrid Web API v3";
function configure(){
settings = {
apiKey = '', // Required
baseUrl = 'https://api.sendgrid.com/v3',... |
Rename the test suite iterations | component extends="org.lucee.cfml.test.LuceeTestCase"{
function run( testResults , testBox ) {
describe( title="Test suite for LDEV-1467", body=function() {
it(title="Checking REMatch() is not support with line breaks ", body = function( currentSpec ) {
REMatchTest = ArrayLen( REMatch( '.', Chr( 10 ) ) );
... | component extends="org.lucee.cfml.test.LuceeTestCase"{
function run( testResults , testBox ) {
describe( title="Test suite for LDEV-1467", body=function() {
it(title="Checking REMatch() with line breaks ", body = function( currentSpec ) {
REMatchTest = ArrayLen( REMatch( '.', Chr( 10 ) ) );
expect(REMatch... |
Convert to BDD style tests | component displayName="Leap Tests" extends="testbox.system.BaseSpec" {
// executes before all tests
function beforeTests(){
leapObj = createObject("leap");
}
function testLeapYear() {
$assert.isTrue(leapObj.isLeapYear(1996));
}
function testNonLeapYear() {
$assert.isFalse(leapObj.... | component extends="testbox.system.BaseSpec" {
function beforeAll(){
leapObj = createObject( 'leap' );
}
function run(){
describe( "My Leap year calculator", function(){
it( "should detect a leap year", function(){
expect( leapObj.isLeapYear( 1996 ) ).toBeTrue();
});
it( "should det... |
Simplify onLoad(), eliminating need for private method | component {
this.title = "SendGrid Web API v3";
this.author = "Matthew J. Clemente";
this.webURL = "https://github.com/mjclemente/sendgrid.cfc";
this.description = "A wrapper for the SendGrid Web API v3";
function configure(){
settings = {
apiKey = '', // Required
baseUrl = 'https://api.sendgrid.com/v3',... | component {
this.title = "SendGrid Web API v3";
this.author = "Matthew J. Clemente";
this.webURL = "https://github.com/mjclemente/sendgrid.cfc";
this.description = "A wrapper for the SendGrid Web API v3";
function configure(){
settings = {
apiKey = '', // Required
baseUrl = 'https://api.sendgrid.com/v3',... |
Use test config file instead of production | <cfcomponent>
<cfset this.name = "idealcfcexample" />
<cffunction name="onApplicationStart">
<cfset application.ideal = createObject( "lib/cfc/ideal" ).init( config = expandPath( "./config/production.cfm" )) />
</cffunction>
<cffunction name="onRequestStart">
<cfif not structKeyExists( applica... | <cfcomponent>
<cfset this.name = "idealcfcexample" />
<cffunction name="onApplicationStart">
<cfif structKeyExists( application, "ideal" )>
<cfset structDelete( application, "ideal" ) />
</cfif>
<cfset application.ideal = createObject( "lib/cfc/ideal" ).init( config = expandPath( "./conf... |
Update module config default to match component for include raw param | component {
this.title = "SendGrid Web API v3";
this.author = "Matthew J. Clemente";
this.webURL = "https://github.com/mjclemente/sendgrid.cfc";
this.description = "A wrapper for the SendGrid Web API v3";
function configure(){
settings = {
apiKey = '', // Required
emailValidationApiKey = '', // Opt... | component {
this.title = "SendGrid Web API v3";
this.author = "Matthew J. Clemente";
this.webURL = "https://github.com/mjclemente/sendgrid.cfc";
this.description = "A wrapper for the SendGrid Web API v3";
function configure(){
settings = {
apiKey = '', // Required
emailValidationApiKey = '', // Opt... |
Use number instead of int for Oracle. | component extends="Model" {
function config() {
hasMany(name="galleries");
hasOne(name="combikey");
hasOne(name="author", foreignKey="firstName", joinKey="firstName");
hasMany(name="authors", foreignKey="firstName", joinKey="firstName");
hasMany(name="combikeys");
hasMany(name="outerjoinphotogalleries", m... | component extends="Model" {
function config() {
hasMany(name="galleries");
hasOne(name="combikey");
hasOne(name="author", foreignKey="firstName", joinKey="firstName");
hasMany(name="authors", foreignKey="firstName", joinKey="firstName");
hasMany(name="combikeys");
hasMany(name="outerjoinphotogalleries", m... |
Update the testcase to check datasource credentials available or not | component {
pgSQL = getCredentials();
this.name = "test3426";
this.datasources["LDEV_3426"] = pgSQL;
this.datasource = "LDEV_3426"
public function onRequestStart(){
query{
echo("DROP TABLE IF EXISTS LDEV3426_Primary");
}
query{
echo("DROP TABLE IF EXISTS LDEV3426_test");
}
query{
... | component {
pgSQL = getCredentials();
this.name = "test3426";
this.datasources["LDEV_3426"] = pgSQL;
this.datasource = "LDEV_3426"
public function onRequestStart(){
if( StructIsEmpty(pgSQL) ){
writeoutput("Datasource credentials was not available"); // Datasource credentials was ... |
Add test case for LDEV-1167 | component extends="org.lucee.cfml.test.LuceeTestCase"{
function run( testResults , testBox ) {
describe( "Test suite for LDEV-1167", function() {
it(title="checking WDDX tag, with action = 'wddx2cfml' when the struct empty ", body = function( currentSpec ) {
var myWDDX = "<wddxPacket version='1.0'><header/><d... | |
Use explicit package marker with IN-PACKAGE. | (in-package #:sicl-global-environment)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Macro DEFINE-COMPILER-MACRO.
(defmacro define-compiler-macro (name lambda-list &body body)
`(eval-when (:compile-toplevel :load-toplevel :execute)
(setf (compiler-macro-function ',name)
,(c... | (cl:in-package #:sicl-global-environment)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Macro DEFINE-COMPILER-MACRO.
(defmacro define-compiler-macro (name lambda-list &body body)
`(eval-when (:compile-toplevel :load-toplevel :execute)
(setf (compiler-macro-function ',name)
... |
Define subclasses of 2-3 tree classes for testing purposes. | (cl:in-package #:clump-test)
| (cl:in-package #:clump-test)
(defclass size-mixin ()
((%size :initarg :size :reader size)))
(defclass leaf-size (size-mixin clump-2-3-tree:leaf)
()
(:default-initargs :size 1))
(defclass 2-node-size (size-mixin clump-2-3-tree:2-node)
())
(defclass 3-node-size (size-mixin clump-2-3-tree:3-node)
())
(defcl... |
Use the normal CL package. | (cl:in-package #:common-lisp-user)
(defpackage #:sicl-common-lisp
(:nicknames #:sicl-cl #:scl)
(:export
. #.(loop for symbol being each external-symbol of '#:common-lisp
collect (symbol-name symbol))))
(defpackage #:sicl-cons
(:use #:sicl-common-lisp)
(:export
;; The symbols LOAD-CAR, LOAD-CDR, S... | (cl:in-package #:common-lisp-user)
(defpackage #:sicl-cons
(:use #:common-lisp)
(:export
;; The symbols LOAD-CAR, LOAD-CDR, STORE-CAR, and STORE-CDR name
;; special operators. The operators LOAD-CAR and LOAD-CDR are
;; similar to the functions CAR and CDR, except that they require
;; that the argument... |
Define ASDF system in package ASDF-USER. | (cl:in-package #:common-lisp-user)
(asdf:defsystem :cleavir-liveness
:depends-on (:cleavir-utilities)
:components
((:file "packages")
(:file "liveness" :depends-on ("packages"))))
| (cl:in-package #:asdf-user)
(defsystem :cleavir-liveness
:depends-on (:cleavir-utilities)
:components
((:file "packages")
(:file "liveness" :depends-on ("packages"))))
|
Convert EQL to STRING== on literal string arguments. | (defun eql (x y)
(| x (setq x nil))
(| y (setq y nil))
(| (eq x y)
(?
(& (number? x)
(number? y)) (== x y)
(& (string? x)
(string? y)) (string== x y)
(& (character? x)
(character? y)) (character== x y))))
| (defun eql (a b)
(| a (setq a nil))
(| b (setq b nil))
(| (eq a b)
(?
(& (number? a)
(number? b)) (== a b)
(& (string? a)
(string? b)) (string== a b)
(& (character? a)
(character? b)) (character== a b))))
(defmacro eql (a b)
(? (| (string? a)
... |
Put load-url into a function | (defpackage lispkit
(:use :gtk :gdk :gdk-pixbuf :gobject
:drakma :cl-webkit
:glib :gio :pango :cairo :common-lisp)
(:export #:main))
(in-package :lispkit)
(defparameter *current-tab* nil)
(defun handle-key (window event)
(declare (ignore window))
(print event)
nil)
(defun main (&rest args)... | (defpackage lispkit
(:use :gtk :gdk :gdk-pixbuf :gobject
:drakma :cl-webkit
:glib :gio :pango :cairo :common-lisp)
(:export #:main))
(in-package :lispkit)
(defparameter *current-tab* nil)
(defun load-url (url &optional view)
(webkit.foreign:webkit-web-view-load-uri
(or view *current-tab*) ur... |
Add correct key for email on ASDF definition | ;; Common Lisp Script
;; Manoel Vilela
(asdf/defsystem:defsystem :lisp-chat
:author "Manoel Vilela"
:description "An experimental chat irc-like"
:version "0.1"
:license "MIT"
:depends-on ("usocket")
:components ((:file "config")
(:file "client" :depends-on ("config"))
(:file ... | ;; Common Lisp Script
;; Manoel Vilela
(asdf/defsystem:defsystem :lisp-chat
:author "Manoel Vilela"
:description "An experimental chat irc-like"
:version "0.1"
:mailto "manoel_vilela@engineer.com"
:license "MIT"
:depends-on ("usocket")
:components ((:file "config")
(:file "client" :depend... |
Remove method specialized to SET-SYMBOL-VALUE-INSTRUCTION. | (cl:in-package #:cleavir-remove-useless-instructions)
(defgeneric instruction-may-be-removed-p (instruction))
(defmethod instruction-may-be-removed-p (instruction)
(and (= (length (cleavir-ir:successors instruction)) 1)
(loop for output in (cleavir-ir:outputs instruction)
always (null (cleavir-ir:using... | (cl:in-package #:cleavir-remove-useless-instructions)
(defgeneric instruction-may-be-removed-p (instruction))
(defmethod instruction-may-be-removed-p (instruction)
(and (= (length (cleavir-ir:successors instruction)) 1)
(loop for output in (cleavir-ir:outputs instruction)
always (null (cleavir-ir:using... |
Change §-F (switch case) to follow 0 to n-1 index convention. | ;; Pegexel is a little exercises generator, using common-lisp.
;; Copyright (C) 2012 Yves Combe <yves@ycombe.net>
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU Affero General Public License as published by
;; the Free Software Foundation, e... | ;; Pegexel is a little exercises generator, using common-lisp.
;; Copyright (C) 2012 Yves Combe <yves@ycombe.net>
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU Affero General Public License as published by
;; the Free Software Foundation, e... |
Use asdf:defsystem instead of just defsystem. | (defsystem #:unicode
:name "unicode"
:licence "TODO"
:author "Thomas Bakketun <thomas.bakketun@copyleft.no>"
:description "Unicode support for Common Lisp."
:depends-on ()
:serial t
:components ((:file "package")
(:file "features")
(:file "unicode-text")
(:file... | (asdf:defsystem #:unicode
:name "unicode"
:licence "TODO"
:author "Thomas Bakketun <thomas.bakketun@copyleft.no>"
:description "Unicode support for Common Lisp."
:depends-on ()
:serial t
:components ((:file "package")
(:file "features")
(:file "unicode-text")
(... |
Add an OVERWRITE restart in PUT-TO-S3-URL. | ;;;; s3.lisp
(in-package #:quicklisp-client-uploader)
(defun s3-components (url)
(setf url (url url))
(values (hostname url)
(string-left-trim "/" (path url))))
(defun s3-object-exists (bucket key)
(let ((http-status (nth-value 1 (zs3:head :bucket bucket :key key))))
(<= 200 http-status 299)))
(... | ;;;; s3.lisp
(in-package #:quicklisp-client-uploader)
(defun s3-components (url)
(setf url (url url))
(values (hostname url)
(string-left-trim "/" (path url))))
(defun s3-object-exists (bucket key)
(let ((http-status (nth-value 1 (zs3:head :bucket bucket :key key))))
(<= 200 http-status 299)))
(... |
Load the definition of (SETF CL:FDEFINITION). | (cl:in-package #:sicl-extrinsic-hir-compiler)
(defun rp (filename)
(asdf:system-relative-pathname :sicl-extrinsic-hir-compiler filename))
(load (rp "../../Evaluation-and-compilation/lambda.lisp"))
(load (rp "../../Environment/multiple-value-bind.lisp"))
(load (rp "../../Data-and-control-flow/setf.lisp"))
(load (rp ... | (cl:in-package #:sicl-extrinsic-hir-compiler)
(defun rp (filename)
(asdf:system-relative-pathname :sicl-extrinsic-hir-compiler filename))
(load (rp "../../Evaluation-and-compilation/lambda.lisp"))
(load (rp "../../Environment/multiple-value-bind.lisp"))
(load (rp "../../Data-and-control-flow/setf.lisp"))
(load (rp ... |
Fix license in system definition | (asdf:defsystem #:birch
:serial t
:description "A simple Common Lisp IRC client library"
:author "Joram Schrijver <i@joram.io>"
:license "LLGPL"
:depends-on (#:split-sequence #:usocket #:flexi-streams)
:components ((:file "package")
(:file "replies")
(:file "parse")
(:file "ctcp")
... | (asdf:defsystem #:birch
:serial t
:description "A simple Common Lisp IRC client library"
:author "Joram Schrijver <i@joram.io>"
:license "MIT"
:depends-on (#:split-sequence #:usocket #:flexi-streams)
:components ((:file "package")
(:file "replies")
(:file "parse")
(:file "ctcp")
... |
Modify according to new way of transmitting the dynamic environment. | (cl:in-package #:sicl-extrinsic-environment)
(defun find-variable-entry (symbol env)
(loop for entry in (dynamic-environment env)
do (when (and (typep entry 'variable-binding)
(eq (symbol entry) symbol))
(return entry))))
(defun symbol-value (symbol env)
(let ((entry (find-variable-entry symbol env... | (cl:in-package #:sicl-extrinsic-environment)
(defun find-variable-entry (symbol dynamic-environment)
(loop for entry in dynamic-environment
do (when (and (typep entry 'variable-binding)
(eq (symbol entry) symbol))
(return entry))))
(defun symbol-value (symbol env)
(let* ((dynamic-environment *dynam... |
Convert lambda expressions. Fix DEFPACKAGE. | ; tré – Copyright (c) 2014 Sven Michael Klose <pixel@copei.de>
(defun cl-packages ()
`((defpackage :tre-core
(:export :nil :t :setq :labels
,@(make-keywords (+ (carlist +cl-renamed-imports+)
*cl-builtins*))))
(defpackage :tre
(:use :tre-core))))
(d... | ; tré – Copyright (c) 2014 Sven Michael Klose <pixel@copei.de>
(defun cl-packages ()
`((defpackage :tre-core
(:export :nil :t :setq :labels
,@(make-keywords (+ +cl-direct-imports+
(carlist +cl-renamed-imports+)
*cl-builtins... |
Add back (include "stdlib.h") to fix compilation on FreeBSD. | ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
;;;
;;; --- Wrappers for socket-related C macros.
;;;
(in-package :net.sockets)
(c "#if defined(__linux__)")
(define "_XOPEN_SOURCE" 600)
(define "_LARGEFILE_SOURCE")
(define "_LARGEFILE64_SOURCE")
(define "_FILE_OFFSET_BITS" 64)
(c "#endif")
(... | ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
;;;
;;; --- Wrappers for socket-related C macros.
;;;
(in-package :net.sockets)
(c "#if defined(__linux__)")
(define "_XOPEN_SOURCE" 600)
(define "_LARGEFILE_SOURCE")
(define "_LARGEFILE64_SOURCE")
(define "_FILE_OFFSET_BITS" 64)
(c "#endif")
(... |
Add support for constant tests in `(case)` | (import base (defun defmacro progn for while if when unless and or
get-idx set-idx! format print! pretty error! empty-struct gensym
== ~= < <= > >= + - * % ^ .. !))
(import binders ())
(import list ())
(import types ())
(import partial ())
(import table ())
(defun fail (msg) (error! msg 0)... | (import base (defun defmacro progn for while if when unless and or
get-idx set-idx! format print! pretty error! empty-struct gensym
== ~= < <= > >= + - * % ^ .. !))
(import binders ())
(import list ())
(import types ())
(import partial ())
(import table ())
(defun fail (msg) (error! msg 0)... |
Define ASDF system in the package ASDF-USER. | (cl:in-package #:common-lisp-user)
(asdf:defsystem :sicl-data-and-control-flow
:depends-on (:sicl-environment
:cleavir-internationalization)
:serial t
:components
((:file "packages")
(:file "conditions")
(:file "condition-reporters-english")))
| (cl:in-package #:asdf-user)
(defsystem :sicl-data-and-control-flow
:depends-on (:sicl-environment
:cleavir-internationalization)
:serial t
:components
((:file "packages")
(:file "conditions")
(:file "condition-reporters-english")))
|
Define method on REPLACE specialized to 3-NODE. | (cl:in-package #:clump-2-3-tree)
;;; This generic function can be used only on an empty tree.
(defgeneric insert (object tree))
(defmethod insert :before (object (tree tree))
(unless (null (contents tree))
(error "Do this error message better.")))
(defmethod insert (object (tree tree))
(setf (contents tree)
... | (cl:in-package #:clump-2-3-tree)
;;; This generic function can be used only on an empty tree.
(defgeneric insert (object tree))
(defmethod insert :before (object (tree tree))
(unless (null (contents tree))
(error "Do this error message better.")))
(defmethod insert (object (tree tree))
(setf (contents tree)
... |
Allow applications to specify the name of the session id cookie. This allows multiple cookie session UCW applications on a single hostname without stomping the sessions. | ;; See the file LICENCE for licence information.
(in-package :ucw-standard)
;;;; *** Cookie session
(defvar +ucw-session-cookie-name+ "ucw-session-id"
"Name of the cookie used when storing the session id.")
(defclass cookie-session-application-mixin ()
()
(:documentation "Class for applications which use cooki... | ;; See the file LICENCE for licence information.
(in-package :ucw-standard)
;;;; *** Cookie session
(defvar +ucw-session-cookie-name+ "ucw-session-id"
"Name of the cookie used when storing the session id.")
(defclass cookie-session-application-mixin ()
((ucw-session-cookie-name :accessor ucw-session-cookie-name ... |
Use SYMBOL-FUNCTION instead of EVAL. | ;;;;; tré – Copyright (C) 2005-2009,2011–2012 Sven Michael Klose <pixel@copei.de>
(defun %=-function? (x)
(function? (eval `(function ,x))))
| ;;;;; tré – Copyright (C) 2005-2009,2011–2012 Sven Michael Klose <pixel@copei.de>
(defun %=-function? (x)
(function? (symbol-function x)))
|
Define function LD for loading files. | (cl:in-package #:sicl-boot-phase1)
(defun fill-environment (linkage-environment)
(declare (ignore linkage-environment))
nil)
| (cl:in-package #:sicl-boot-phase1)
(defun ld (filename environment)
(format *trace-output* "Loading file ~a~%" filename)
(finish-output *trace-output*)
(sicl-extrinsic-environment:load-source-with-environments
filename (compilation-environment environment) environment))
(defun fill-environment (environment)
... |
Load file containing definitions of methods on ENSURE-GENERIC-FUNCTION-USING-CLASS. | (cl:in-package #:sicl-boot-phase1)
(defun ld (filename environment)
(format *trace-output* "Loading file ~a~%" filename)
(finish-output *trace-output*)
(sicl-extrinsic-environment:load-source-with-environments
filename (compilation-environment environment) environment))
(defun fill-environment (environment)
... | (cl:in-package #:sicl-boot-phase1)
(defun ld (filename environment)
(format *trace-output* "Loading file ~a~%" filename)
(finish-output *trace-output*)
(sicl-extrinsic-environment:load-source-with-environments
filename (compilation-environment environment) environment))
(defun fill-environment (environment)
... |
Make Clouseau's system definition inter-file dependencies explicit, just for good measure. | ;;; -*- Mode: Lisp; Package: INSPECTOR -*-
;;; (c) copyright 2005 by
;;; Robert Strandh (strandh@labri.fr)
;;; This library is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU Library General Public
;;; License as published by the Free Software Foundation; either
;;; v... | ;;; -*- Mode: Lisp; Package: INSPECTOR -*-
;;; (c) copyright 2005 by
;;; Robert Strandh (strandh@labri.fr)
;;; This library is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU Library General Public
;;; License as published by the Free Software Foundation; either
;;; v... |
Fix names of days, broken because of timezone change | (in-package #:roo-site)
(defvar *day-names*
'("Maandag" "Dinsdag" "Woensdag" "Donderdag" "Vrijdag" "Zaterdag" "Zondag"))
(defgeneric name-of-day (date))
(defmethod name-of-day ((date local-time:timestamp))
(nth (local-time:timestamp-day-of-week date)
*day-names*))
(defmethod name-of-day (date)
(name-of... | (in-package #:roo-site)
(defvar *day-names*
'("Maandag" "Dinsdag" "Woensdag" "Donderdag" "Vrijdag" "Zaterdag" "Zondag"))
(defgeneric name-of-day (date))
(defmethod name-of-day ((date local-time:timestamp))
(nth (1- (local-time:timestamp-day-of-week date))
*day-names*))
(defmethod name-of-day (date)
(na... |
Fix horrible bug that skipped the first assignment after accumulating functions. | ;;;;; TRE environment
;;;;; Copyright (c) 2005-2011 Sven Klose <pixel@copei.de>
(defun copy-while (pred x)
(when (and x (funcall pred (car x)))
(cons (car x)
(copy-while pred (cdr x)))))
(define-test "COPY-WHILE"
((copy-while #'number? '(1 2 3 a)))
'(1 2 3))
(defun collect (pred x)
(values (copy-while p... | ;;;;; tré - Copyright (c) 2005-2011 Sven Klose <pixel@copei.de>
(defun copy-while (pred x)
(when (and x (funcall pred (car x)))
(cons (car x)
(copy-while pred (cdr x)))))
(define-test "COPY-WHILE"
((copy-while #'number? '(1 2 3 a)))
'(1 2 3))
(defun separate (pred x)
(values (copy-while pred x)
(rem... |
Replace segregation only by complete processing of captured variables. | (cl:in-package #:cleavir-hir-transformations)
(defun hir-transformations (initial-instruction implementation processor os)
(type-inference initial-instruction)
(eliminate-typeq initial-instruction)
(introduce-immediates initial-instruction implementation processor os)
(segregate-lexicals initial-instruction))
| (cl:in-package #:cleavir-hir-transformations)
(defun hir-transformations (initial-instruction implementation processor os)
(type-inference initial-instruction)
(eliminate-typeq initial-instruction)
(introduce-immediates initial-instruction implementation processor os)
(process-captured-variables initial-instru... |
Fix startup by blocking threads. | (in-package #:laap)
(defvar *thread-pool* nil)
(defvar *loop* nil)
(defmacro with-event-loop (&body body)
`(let* ((*thread-pool* (make-instance 'thread-pool))
(*loop* (make-instance 'event-loop))
(bt:*default-special-bindings* `((*thread-pool* . ,*thread-pool*)
(*loop* . ,*loop*))))
(add-reporter... | (in-package #:laap)
(defvar *thread-pool* nil)
(defvar *loop* nil)
(defmacro with-event-loop (&body body)
(let ((err (gensym))
(res (gensym)))
`(let* ((*thread-pool* (make-instance 'thread-pool))
(*loop* (make-instance 'event-loop))
(bt:*default-special-bindings* `((*thread-pool* . ,*thread-pool*)
... |
Define ASDF system in package ASDF-USER. | (in-package #:cl-user)
;;;; Copyright (c) 2008 - 2013
;;;;
;;;; Robert Strandh (robert.strandh@gmail.com)
;;;;
;;;; all rights reserved.
;;;;
;;;; Permission is hereby granted to use this software for any
;;;; purpose, including using, modifying, and redistributing it.
;;;;
;;;; The software is provided "as-is" ... | (in-package #:asdf-user)
;;;; Copyright (c) 2008 - 2013
;;;;
;;;; Robert Strandh (robert.strandh@gmail.com)
;;;;
;;;; all rights reserved.
;;;;
;;;; Permission is hereby granted to use this software for any
;;;; purpose, including using, modifying, and redistributing it.
;;;;
;;;; The software is provided "as-is... |
Check for losing state not undecided state | ; find the minimax analysis of a game of nim
; nim is a game where players take turns dividing a pile of discrete size
; where the player that makes an even division loses
; assume that min starts
; hence an odd number of piles mean it is min's turn
(defun play (piles)
(when (lostp piles) ; is losing state
(if (... | ; find the minimax analysis of a game of nim
; nim is a game where players take turns dividing a pile of discrete size
; where the player that makes an even division loses
; assume that min starts
; hence an odd number of piles mean it is min's turn
(defun play (piles)
(when (lostp piles) ; is losing state
(if (... |
Move byte regions accepts integer. | (in-package :toolbox)
(annot:enable-annot-syntax)
@export
(defun map-positive-byte-regions (value)
(declare (type integer value))
(iterate
(for i from 0 below (integer-length value))
(for current-bit = (ldb (byte 1 i) value))
(for prev-bit previous current-bit initially 0)
(with start = 0)
(co... | (in-package :toolbox)
(annot:enable-annot-syntax)
@export
(defun map-positive-byte-regions (value)
(declare (type integer value))
(iterate
(for i from 0 below (integer-length value))
(for current-bit = (ldb (byte 1 i) value))
(for prev-bit previous current-bit initially 0)
(with start = 0)
(co... |
Add initial-setup wrapper function to simplify configuration and syncing | ;;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RSN-MTG; Base: 10 -*- file: rsn-mtg.lisp
;;;; Copyright (c) 2013 "the Phoeron" Colin J.E. Lupton <//thephoeron.com>
;;;; See LICENSE for additional information.
(in-package :rsn-mtg)
;; EOF
| ;;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RSN-MTG; Base: 10 -*- file: rsn-mtg.lisp
;;;; Copyright (c) 2013 "the Phoeron" Colin J.E. Lupton <//thephoeron.com>
;;;; See LICENSE for additional information.
(in-package :rsn-mtg)
(defun initial-setup (&key (db *default-database-connection*) (verbose nil))
"Per... |
Use accessor rather than separate reader and writer. | (cl:in-package #:sicl-clos)
(defclass class (specializer)
((%unique-number
;; FIXME: the unique numbers should be assigned during class
;; finalization, and not here.
:initform (prog1 *class-unique-number* (incf *class-unique-number*))
:reader unique-number)
(%name
:initform nil
:initarg... | (cl:in-package #:sicl-clos)
(defclass class (specializer)
((%unique-number
;; FIXME: the unique numbers should be assigned during class
;; finalization, and not here.
:initform (prog1 *class-unique-number* (incf *class-unique-number*))
:reader unique-number)
(%name
:initform nil
:initarg... |
Load a file containing the definition of STANDARD-SLOT-DEFINITION. | (cl:in-package #:sicl-boot)
(defun create-bridge-classes (boot)
(let ((c (c1 boot))
(r (r2 boot)))
(ld "../CLOS/t-defclass.lisp" c r)
(ld "../CLOS/standard-object-defclass.lisp" c r)
(ld "../CLOS/metaobject-defclass.lisp" c r)
(ld "../CLOS/method-combination-defclass.lisp" c r)
(ld "../CLOS/slot... | (cl:in-package #:sicl-boot)
(defun create-bridge-classes (boot)
(let ((c (c1 boot))
(r (r2 boot)))
(ld "../CLOS/t-defclass.lisp" c r)
(ld "../CLOS/standard-object-defclass.lisp" c r)
(ld "../CLOS/metaobject-defclass.lisp" c r)
(ld "../CLOS/method-combination-defclass.lisp" c r)
(ld "../CLOS/slot... |
Add CLUMP-2-3-TREE as a dependency for system CLUMP. | (cl:in-package #:asdf-user)
(defsystem clump
:description "Library for operations on different kinds of trees"
:author "Robert Strandh <robert.strandh@gmail.com>"
:license "FreeBSD, see file LICENSE.text"
:depends-on (:clump-binary-tree))
| (cl:in-package #:asdf-user)
(defsystem clump
:description "Library for operations on different kinds of trees"
:author "Robert Strandh <robert.strandh@gmail.com>"
:license "FreeBSD, see file LICENSE.text"
:depends-on (:clump-binary-tree :clump-2-3-tree))
|
Define a custom version of DEFGENERIC in compilation environment C1. | (cl:in-package #:sicl-boot)
(defun customize-c1 (boot)
(message "Customizing compilation environment C1~%")
(message "Finished customizing compilation environment C1~%"))
| (cl:in-package #:sicl-boot)
(defun define-defgeneric-c1 (boot)
(setf (sicl-genv:macro-function 'defgeneric (c1 boot))
(lambda (form environment)
(declare (ignore environment))
`(progn (sicl-genv:fmakunbound ',(car form) ,(r1 boot))
(ensure-generic-function
',(car form)
:name ',(car form)
:l... |
Add :license to system file | ;;;; zcdb.asd
(asdf:defsystem #:zcdb
:serial t
:version "1.0.3"
:description "Read and write cdb files, as specified in
http://cr.yp.to/cdb.html"
:author "Zach Beane <xach@xach.com>"
:components ((:file "package")
(:file "cdb")
(:file "reading")
... | ;;;; zcdb.asd
(asdf:defsystem #:zcdb
:serial t
:version "1.0.3"
:description "Read and write cdb files, as specified in
http://cr.yp.to/cdb.html"
:author "Zach Beane <xach@xach.com>"
:license "MIT"
:components ((:file "package")
(:file "cdb")
(:file "reading")
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.