Skip to content

Instantly share code, notes, and snippets.

View ashgti's full-sized avatar

John Harrison ashgti

View GitHub Profile
[5] => PMC 'PAST;Op' {
<name> => ""
<source> => \past
<pos> => 153
<pasttype> => "call"
<invocant_holder> => \past
[0] => PMC 'PAST;Op' {
<inline> => " %r = descalarref %0"
[0] => PMC 'PAST;Var' {
<sigil> => "$"
From 6cb500344a9e51c7c80a0c037c36b3edf7dd00d6 Mon Sep 17 00:00:00 2001
From: John Harrison <[email protected]>
Date: Wed, 19 Aug 2009 13:32:39 -0500
Subject: [PATCH 9/9] Updated direct calling for parent methods.
---
src/builtins/guts.pir | 3 +++
src/parser/actions.pm | 29 ++++++++++++++++++++++++++---
2 files changed, 29 insertions(+), 3 deletions(-)
From 6cb500344a9e51c7c80a0c037c36b3edf7dd00d6 Mon Sep 17 00:00:00 2001
From: John Harrison <[email protected]>
Date: Wed, 19 Aug 2009 13:32:39 -0500
Subject: [PATCH 1/1] Updated direct calling for parent methods.
---
src/builtins/guts.pir | 3 +++
src/parser/actions.pm | 29 ++++++++++++++++++++++++++---
2 files changed, 29 insertions(+), 3 deletions(-)
// I found this on a forum, thought it was awesome, I take no credit for this code
#include <ncurses.h>
#include <inttypes.h>
#define GG(T,C) attrset(A_BOLD*!(T)|COLOR_PAIR(C%2+1));
#define AGG A&2?KEY_UP:KEY_DOWN:A&1?KEY_RIGHT:KEY_LEFT
#define AC(G) init_pair(G/2,G,nodelay(stdscr,G/3));
#define TCT(A,G,C) mvaddch(A+CTT*6+4,CGA*12+G,C)
#define ATG srand(time(0)); initscr(); cbreak(); \
noecho(); start_color(); keypad(stdscr,1);
#define CAT mvprintw(2,40,"%d",TC)
#!perl6
class A {
if 1 == 1 {
method a {
'a'
}
}
else {
SELECT
c.*,
sub.count AS children_count
FROM
categories AS c,
(
SELECT COUNT(node.categories_id) as count
FROM categories AS node
WHERE node.parent_id = 24
) AS sub
/* LLVMWrapper.pmc
* Copyright (C) 2009, Parrot Foundation.
* SVN Info
* $Id$
* Overview:
* These are the vtable functions for the LLVMWrapper base class
* Data Structure and Algorithms:
* History:
* Notes:
* Please remove unneeded entries.
'''
Created for HW2
Baselined: September 17, 2009
Modified: September 20, 2009
@author: John Harrison
'''
import copy
import re
import inspect
from part import Part
import SimpleXMLRPCServer
class RemoteServer(SimpleXMLRPCServer.SimpleXMLRPCServer):
def _dispatch(self, method, params):
try:
# We are forcing the 'export_' prefix on methods that are
# callable through XML-RPC to prevent potential security
# problems
func = getattr(self, 'export_' + method)
except AttributeError:
john@Strudel ~/Projects/parrot $ ./parrot examples/benchmarks/freeze.pasm
constr.time 0.052929162979126
freeze time 0.150116920471191
thaw time 0.0793290138244629
Image len 3200064
ResizablePMCArray 100000
john@Strudel ~/Projects/parrot $ ./parrot examples/benchmarks/freeze.pasm
constr.time 0.051023006439209
freeze time 0.146944046020508
thaw time 0.144075155258179