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
(define (sumLargeSquare a b c) | |
(cond ((and (< a b) (< a c)) (+ (* b b) (* c c))) | |
((and (< b a) (< b c)) (+ (* a a) (* c c))) | |
(else (+ (* a a) (* b b)))) | |
) |
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
public class BaseClass{ | |
public function modifyProperty(property:String, value:Object):void{ | |
this[property] = value; | |
} | |
} | |
public class SubClass extends SubClass{ | |
protected var count:int; | |
} |
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
from django import template | |
register = template.Library() | |
MOMENT = 120 # duration in seconds within which the time difference | |
# will be rendered as 'a moment ago' | |
@register.filter | |
def naturalTimeDifference(value): | |
""" |
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
#enable rewriting | |
RewriteEngine on | |
RewriteRule /(.*)\.js /$1-min.js | |
RewriteRule /(.*)\.css /$1-min.css |
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
#!/bin/bash | |
# | |
# glassfish: Startup script for Glassfish Application Server. | |
# | |
# chkconfig: 3 80 05 | |
# description: Startup script for domain1 of Glassfish Application Server. | |
GLASSFISH_HOME=/home/glassfish/glassfish; | |
export GLASSFISH_HOME |
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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
</head> | |
<body> | |
<object type="application/x-shockwave-flash" data="foo.swf" width="300" height="300"> | |
<param name="movie" value="foo.swf"> | |
<param name="quality" value="high"> | |
<param name="scale" value="noscale"> | |
<param name="salign" value="LT"> |
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
# Finding the second best player in a knockout tournament | |
defeatedListMap = {} | |
def fillMap(x,y): | |
if x in defeatedListMap: | |
defeatedListMap[x].add(y) | |
else: | |
defeatedListMap[x] = set([y]) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans | |
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> | |
<bean id="wordCatcher" class="test.s4.WordReceiverPE"> | |
<property name="dispatcher" ref="dispatcher"/> | |
<property name="keys"> |
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
.role_admin, .role_user, .role_guest{ | |
display:none; | |
} |
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
$(document).ready(function() { | |
// convert all a/href to a#href | |
$("body").delegate("a", "click", function(){ | |
var href = $(this).attr("href"); // modify the selector here to change the scope of intercpetion | |
// Push this URL "state" onto the history hash. | |
$.bbq.pushState(href,2); | |
// Prevent the default click behavior. |
OlderNewer