Skip to content

Instantly share code, notes, and snippets.

Avatar
💬
icio is typing...

Paul Scott icio

💬
icio is typing...
View GitHub Profile
View gist:573794
!ENTRY org.eclipse.ui 4 4 2010-09-10 15:43:00.865
!MESSAGE Exception in org.eclipse.ui.internal.PageLayout.addView: org.eclipse.ui.PartInitException: Could not create view: net.refractions.udig.project.ui.layerManager
!STACK 1
org.eclipse.ui.PartInitException: Could not create view: net.refractions.udig.project.ui.layerManager
at org.eclipse.ui.internal.ViewFactory.createView(ViewFactory.java:158)
at org.eclipse.ui.internal.LayoutHelper.createView(LayoutHelper.java:162)
at org.eclipse.ui.internal.PageLayout.createView(PageLayout.java:543)
at org.eclipse.ui.internal.PageLayout.addView(PageLayout.java:416)
at org.eclipse.ui.internal.PageLayout.addView(PageLayout.java:390)
at uk.co.terinea.agrimark.Perspective.createInitialLayout(Perspective.java:14)
View gist:720026
function spanChars(e)
{
if (!e) e = document.body;
// Replace the text node with a span for each letter it consists of
if (e.nodeType == document.TEXT_NODE)
{
var text = e.nodeValue;
for (var c = 0; c < text.length; c++)
@icio
icio / gist:729309
Created Dec 5, 2010
largest_prime_factor
View gist:729309
<?php
test();
/**
* The largest prime factor
*
* The provided number is not considered a factor of itself.
*
* @param int $n The number we wish to find a factor of
@icio
icio / gist:766327
Created Jan 5, 2011
include_subdirectories_in_path
View gist:766327
<?php
/**
* Add each directory within ./application to the include path so that each file
* is easily accessible.
*/
function include_subdirectories_in_path()
{
global $paths;
$paths = array('application');
View gist:802351
function bad (foo) {
if ( ! (foo instanceof Bar) ) {
throw new TypeError("This is an annoying restriction!");
}
return foo.baz(foo.quux(10));
}
function good (foo) {
if ( !foo.baz || !foo.quux ) {
throw new TypeError("We need foo to have baz and quux methods.");
@icio
icio / gist:826934
Created Feb 15, 2011
Raphael.el.wave
View gist:826934
/*
- Example usage of Raphael.el.wave
- Produces: http://i.imgur.com/qAcDJ.png
*/
var paper;
/**
* ENTRY POINT.
*/
View gist:834328
package
{
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
public class Main extends Sprite
@icio
icio / gist:848120
Created Feb 28, 2011
Newton-Raphson in R
View gist:848120
#| Using the Newton-Raphson Method, find the root of
#| the function f (with derivative fdx) near the
#| point x (with tolerance e [solution x has abs f(x) < e]
#| and within a limit of 1000 steps)
newtonRaphson <- function(x, f, fdx, e = 0.001, maxSteps = 1000)
{
step = 0;
while (abs(x) > e && step < maxSteps)
{
@icio
icio / manifest.json
Created Mar 17, 2011
Chrome extension to list all tab locations and copy them to the clipboard
View manifest.json
{
"name": "Open URL Collector",
"version": "1.0",
"description": "Creates a list of the URLs of open tabs.",
"browser_action": {
"default_icon": "famfamfam_silk_cut_tab.png",
"popup": "popup.html"
},
"permissions": ["tabs"]
}
@icio
icio / get_prime.php
Created Mar 22, 2011
N-th Prime Numbers
View get_prime.php
<?php
/**
* A method for finding n-th prime numbers. Usage example follows at the end.
* @author Paul Scott <paul.scotto@gmail.com>
*/
/**
* Calculate the n-th prime number(s).
*
You can’t perform that action at this time.