|
fedecarg
|
|
codepad
|
|
|
fedecarg
|
Saved pastes by fedecarg:
<?php
class Project_Entity_Address extends Zf_Domain_Entity
{
public $id;
public $userId;
|
| view (47 lines) |
Zend_Rest_Client dependencies
-----------------------------
require_once 'Zend/Service/Abstract.php';
require_once 'Zend/Rest/Client/Result.php';
|
| view (16 lines) |
try {
$frontController = Zend_Controller_Front::getInstance();
if (@strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false) {
ob_start();
$frontController->dispatch();
|
| view (19 lines) |
/*
When using Zend_Session_SaveHandler_DbTable, it's important to
create a connection to the database after creating
an instance of the adapter class. Otherwise, if there's a problem with the
connection, you get a Fatal error: Exception thrown without a stack frame
|
| view (33 lines) |
<?php
class DateIntervalFormat
{
/**
* Format an interval value with the requested granularity.
|
| view (42 lines, 1 line of output) |
<?php
class DateIntervalFormat
{
/**
* Format an interval value with the requested granularity.
|
| view (42 lines, 1 line of output) |
"""
A list of class objects to mimic a C type array of structures
"""
class Person(object):
|
| view (52 lines, 20 lines of output) |
"""
Example of a small movie database using a list of class instances load, save,
add, list, search, edit and delete similar to the previous movie database but
I added edit and check movie ids for uniqueness. By Ene Uran.
"""
|
| view (233 lines, 16 lines of output) |
#!/usr/bin/env python
"""
Provides immediate logging to a text file (using module logging)
Usage:
|
| view (46 lines) |
'''
Decompressing various archive types with this python script
'''
#!/usr/bin/env python
#
|
| view (31 lines) |
'''
Using Google Talk as a distributed Twitter client
A distributed Twitter client in the spirit of:
http://blog.labnotes.org/2008/05/05/distributed-twitter-client-in-20-lines-of-code/
'''
|
| view (89 lines, 4 lines of output) |
'''
Compare jpg image files using histogram
Use progressively more costly method to see if two jpg files are different
'''
#!/usr/bin/python
|
| view (88 lines) |
'''
Change Python (.py) files to use 4-space indents and no hard tab characters.
Also trim excess spaces and tabs from ends of lines, and remove empty lines
at the end of files. Also ensure the last line ends with a newline.
'''
|
| view (294 lines) |
'''
Clean .pyc files
I use Subversion for version control and I don't version the .pyc
files. Before I issue the status command to see what has changed to my
source, I issue this script to delete all the .pyc files.
|
| view (20 lines, 4 lines of output) |
'''
Twitter Snnipet
Find out who are you following that's not following you back
http://blog.davidziegler.net/
|
| view (22 lines) |
'''
Find out who are you following that's not following you back
http://blog.davidziegler.net/
Dependencies python-twitter >= 0.6
'''
|
| view (19 lines) |
from __future__ import division
import math
longitude = float(-2.708077)
latitude = float(53.754842)
|
| view (14 lines, 2 lines of output) |
import csv
# Batch Processing CSV Files
for Agents in range(1,2):
for UAVs in range(1,6):
|
| view (17 lines, 5 lines of output) |
import os, sys
def pyc_clean(dir):
findcmd = 'find %s -name "*.pyc" -print' % dir
count = 0
for f in os.popen(findcmd).readlines():
|
| view (11 lines, 1 line of output) |
<?php
class Zend_Service_Digg extends Zend_Rest_Client
{
protected $_uri = 'http://services.digg.com/';
protected $_params = array();
|
| view (92 lines) |
<?php
class Zend_Service_Digg extends Zend_Rest_Client
{
protected $_uri = 'http://services.digg.com/';
protected $_params = array();
|
| view (89 lines) |
set @latitude=53.754842;
set @longitude=-2.708077;
set @radius=20;
set @lng_min = @longitude - @radius/abs(cos(radians(@latitude))*69);
|
| view (12 lines) |
from __future__ import division
import math
longitude = float(-2.708077)
latitude = float(53.754842)
|
| view (14 lines, 2 lines of output) |
from __future__ import division
import math
longitude = float(-2.708077)
latitude = float(53.754842)
|
| view (14 lines, 2 lines of output) |
<?php
$longitude = (float) -2.708077;
$latitude = (float) 53.754842;
$radius = 20; // in miles
|
| view (12 lines, 2 lines of output) |
<?php
$longitude = (float) -2.708077;
$latitude = (float) 53.754842;
$radius = 20; // in miles
|
| view (23 lines, 2 lines of output) |
<?php
require_once APPLICATION_PATH . '/controllers/ExampleController.php';
class ExampleControllerTest extends ExampleController
{
|
| view (55 lines) |
<?php
/* Start output buffering */
ob_start();
/* Report all errors directly to the screen for simple diagnostics in the dev environment */
|
| view (39 lines, 2 comments) |
<?php
require_once dirname(__FILE__) . '/ExampleControllerTest.php';
class ControllersAllTests
{
|
| view (17 lines) |
<?php
require_once dirname(__FILE__) . '/bootstrap.php';
require_once dirname(__FILE__) . '/controllers/AllTests.php';
class AllTests
|
| view (22 lines) |
<?php
/* Start output buffering */
ob_start();
/* Report all errors directly to the screen for simple diagnostics in the dev environment */
|
| view (38 lines) |
<?php
class My_View_Helper_RouteUrl extends Zend_View_Helper_Abstract
{
public function routeUrl($route, array $urlOptions = array(), $name = null, $reset = false, $encode = true)
{
|
| view (12 lines) |
<?php
class My_View_Helper_RouteURL extends Zend_View_Helper_Abstract
{
public function routeUrl($route, array $urlOptions = array(), $name = null, $reset = false, $encode = true)
{
|
| view (12 lines) |
<?php
class My_Controller_Router_Rewrite extends Zend_Controller_Router_Rewrite
{
/**
* Routes directory
|
| view (89 lines) |
*** FileSyncTask.php 2008-08-28 15:48:07.000000000 -0400
--- FileSyncTask.php.mine 2008-08-28 15:45:26.000000000 -0400
*************** require_once "phing/Task.php";
*** 39,44 ****
--- 39,45 ----
|
| view (68 lines) |