public void testRefreshDoesNothingIfClipBoardContentsNotChanged() {
queue = mockClipBoardQueue(false, "Any thing");
insertDummyValuesIntoQueue(2);
assertFalse(queue.refresh());
assertEquals(2, queue.getQueue().size());
}
Tag Archive for code
Another sample SVN code
Some new Rails Title
public void testRefreshDoesNotAddContentIfAlreadyExists(){
queue = mockClipBoardQueue(true,"1");
insertDummyValuesIntoQueue(3);
assertFalse(queue.refresh());
assertEquals(3, queue.getQueue().size());
}
Some sample post code
public void testClipBoardContentsAreNotChangedWhenQueuIsNotEmptyBlankContentProvided() {
insertDummyValuesIntoQueue(2);
assertTrue(queue.isClipBoardContentsChanged(ClipBoardQueue.BLANK_CLIP_BOARD));
}
Generate XHTML on the command line with XML::API::XHTML
perl -e "use XML::API::XHTML; my $d = new XML::API::XHTML(); $d->head_open(); $d->title('hello world!'); $d->script({type => 'text/javascript'}, '/* hello scripts! */'); $d->head_close(); $d->body_open(); $d->h1({style => 'color:red'}, 'Hi nerd!'); print $d;" | tidy -q -o temp.html
Category: Uncategorized |
Tags: automation, code, commandline, cpan, cygwin, engine, generator, howto, html, markup, module, one-liners, oo, perl, template, tidy, w3, xhtml
Validate XHTML with Tidy and/or OpenJade, just like the FF extension
tidy -eq temp.html onsgmls -E0 -s c:sgml-libxml.dcl temp.html lwp-request <a href="http://onemorebug.com" >http://onemorebug.com</a> | onsgmls -E0 -s /Applications/validator-0.8.2/htdocs/sgml-lib/ISO-HTML/15445.dcl -
Category: Uncategorized |
Tags: Bash, code, commandline, cygwin, html, onsgmls, openjade, processor, qa, textonly, tidy, validation, w3, xml
Invisible Xanga Code
<p><a href="http://www.createblog.com/layouts/index.php?layout=xanga_layouts" title="Grab Xanga Layouts and Xanga Codes"><img src="http://www.createblog.com/images/link1.gif" border="0" alt="Xanga Layouts" style="position:absolute;top:0px;left:0px;width:10px;height:27px;" /></a></p><!--Invisible-->
<script type='text/javascript'>
document.title = ('I N V I S I B L E'); </script>
<div align=left style="position: static; margin-top:-10px; margin-left:-8px"><img src="http://cbimg6.com/layouts/07/05/28/18043aa.png">
<style type="text/css">
body
{background: #a0a0a0;
background-image: url("http://cbimg6.com/layouts/07/05/28/18043ab.png");
background-position: 0px;
background-repeat: repeat-y;
scrollbar-3dlight-color: #4e1231;
scrollbar-arrow-color: #8c8c8c;
scrollbar-darkshadow-color: #4e1231;
scrollbar-face-color: #4e1231;
scrollbar-highlight-color: #4e1231;
scrollbar-shadow-color: #4e1231;
scrollbar-track-color: #4e1231;}
.left, .blogbody, table.footer, .standard, .leftmodulefontcolor, td, p
{font: normal 10px Arial;
color: #c3c3c3;
text-align: justify;}
.blogbody b, .standard b, p b, strong
{font-weight: normal;
color: #fff;}
i, em
{font-weight: italic;
color: #c3c3c3;}
u
{font-weight: normal;
color: #fff;
letter-spacing: 0px;
text-decoration: underline;
text-transform: normal;
border-bottom: 1px solid;
border-bottom-color: #c3c3c3;}
table.footer TD
{display: none;
padding: 0px;
width:0px;}
div.blogheader
{background-color: #4e1231;
border-left: 1px solid #4e1231;
border-right: 1px solid #4e1231;
border-top: 1px solid #4e1231;
color: #c3c3c3;
font-family: georgia;
font-size: 10px;
font-weight: normal;
line-height: 9px;
letter-spacing: 2px;
text-align: center;
text-transform: uppercase;
padding: 0px;
width: 400px;}
.?Header
{background-color: #5F1207;
background-image:url("");
border: 1px solid #5F1207;
color: #480E06;
font-family: Arial;
font-size: 10px;
font-weight: normal;
line-height: 9px;
letter-spacing: 2px;
text-align: center;
text-transform: uppercase;
padding: 0px;
width: 152px;}
.Modules
{background-color: #4e1231;
border-bottom: 1px solid #4e1231;
border-left: 1px solid #4e1231;
border-right: 1px solid #54e1231;
color: #c3c3c3;
font-family: Arial;
font-size: 10px;
font-weight: normal;
line-height: 15px;
letter-spacing: 0px;
text-align: center;
text-transform: none;
padding: 0px;
width: 140px;}
.link a
{background-color: #transparent;
border-top: 0px solid #4e1231;
font-color: #fff;
font: normal 10px Arial;
height: 0px;
letter-spacing: 0px;
padding: 0px;
text-align: left;
text-decoration: none;
text-transform: none;
width: 150px;}
.link a:hover
{background-color: #4e1231;
border-top: 0px solid #4e1231;
font-color: #c3c3c3;
font: normal 10px Arial;
height: 0px;
letter-spacing: 0px;
text-align: left;
text-decoration: none;
text-transform: none;
width: 150px;}
a:link, .footernav.link, a.footernav:link, a.footernav:active
{color: #c3c3c3;
font: normal 10px Arial;}
a:visited, a.footernav:visited,
{color: #c3c3c3;
font: normal 10px Arial;}
a:hover
{color: #4e1231;
font: normal 10px Arial;}
input, select, textarea, .textfield, .button
{background: #transparent;
border: 1px solid #4e1231;
color: #c3c3c3;
font: normal 10px Arial;
letter-spacing: 0px;}
table.left
{display: none;
padding: 0px;
width: 0px;}
table.blogbody
{background-color: #4e1231;
border: 1px solid #4e1231;
font-family: Arial;
font-size: 10px;
font-weight: normal;
text-transform: none;
width: 400px;}
table.left th
{/* on your menu module, this edits the title part of it */}
table.left TD
{display: none;
padding: 0px;
width: 0px;}
table.search TD, table.announcements TH
{/* this should be left alone */
/* unless you know what to do */}
table.footer
{display: none;}
.mainleft
{padding: 1px;
width: 0px;}
hr
{border: 1px solid #5F1207;}
#pnlEnabled table, #htmleditor, #lblTimeZone, #pnlEprops, #rblEprops
{width: auto !important;}
table.blogbody tr td
{padding: 0px;
width:0px;}
table.left, td.mainleft, table.navigation, table.search, #SearchBar1_pnlYouAreHere {display: none;}
table.blogbody div.smalltext
{text-align: center;}
</style>
<div style="margin-left: 590px; margin-top:-120px; width: 125px; height: 2000px; overflow: visible;">
<div class="?Header"></div>
<div class="Modules"><p>
<br>Yeah, so...I never know what to write in these stupid things...Basically, I'm Miriam, I'm 16, I go to BHS and will soon be a junior, and my life consists of writing, reading, marching band, taking pictures, and friends. And guys. More friends than guys, thank god. This xanga is pretty much my repository for things that I think about, so it gets written on quite a bit. Leave a comment or two or three if you want, even if I don't even know you and you're just passing by.
<p>Other than that...the only really interesting thing about me is that I'm Israeli/Russian/or whatever, which pretty much everyone knows anyway.
<p>And also, as I may have mentioned, I'm an aspiring writer, which means that I carry a notebook and pen everywhere I go, and you'll see me writing no matter where I am. School, restaurants, the mall, the park, the pool, my friends' houses, band trips, you name it.
<p>Oh yeah, and watch what you say and do around me, because you can bet that if I'm listening to you talk and watching what you do, you'll end up in something I write.
<p>And finally, I talk weird and I dress weird and I act weird, and weirdness defines me. Try and make me change that, and you lose my respect.
<p>Simple as that.
<p>~Mimzy
<br>
</div><br>
<div class="?Header"></div>
<div class="Modules"><p>
<div class="link">
<center>
<br><a href="http://xanga.com/home.aspx?user=sondosia">Home</a>
<br><a href="http://xanga.com/private/">Private</a>
<br><a href="http://xanga.com/private/SubscribeTo.aspx?user=sondosia">Subscribe</a>
<br><a href="http://xanga.com/private/Subs.aspx">Subscriptions</a>
<br><a href="http://xanga.com/CLAF/default.asp">Look & Feel</A>
<br><a href="http://xanga.com/guestbook.asp?user=sondosia">GuestBook</a>
<br><a href="http://xanga.com/signin.asp">Sign In</a>
<br><a href="http://xanga.com/logout.asp">Sign Out</a>
</center></div></div><br>
</div>
<DIV style="
background-color: transparent;
border: 0px solid #000000;
height: 100%;
margin-left: 150px;
margin-top: -2050px;
position:static;
width: 300px;">
<!-- start code provided by createblog.com -->
<script language="JavaScript"><!--
//script made by hoogli modified by Paul D
tips = new Array(1);
tips[0]="http://sondosia.tripod.com/stillalright.mp3";
index=Math.floor(Math.random() * tips.length);
document.write("<embed src="+tips[index]+" showcontrols=0 height=0 width=0></embed>")
//--></script>
<!-- end code provided by createblog.com -->
Crazy Prolog Code
output(X,Y) :- my_output(X,Y)!. my_output(X,Y) :- my_output_(X,Y); my_output_(X,Y) :- my_output__(X,Y); my_output__(X,Y) :- my_output___(X,Y); my_output___(X,Y) :- write([X | [is | [Y | []]]]), my_________(). my_________() :- my________(). my________() :- my_______(). my_______() :- my______(). my______() :- my_____(). my_____() :- my____(). my____() :- my___(). my___() :- my__(). my__() :- my_(). my_() :- my(). my() :- !.
Crazy Perl Code
$_ = shift;
s////g;
print;
################
while(<>) {
/^(w+)/;
print $_.',';
}
#############
if(($_ = 5)==5) {print;}
##############
$x = 7;
if (($x <=> 0)==($x=$x)) {print 'true';}
else{print 'false';}
#######################
print "Hello World" or die "trying";
######################
print eval qw(qw(qw()));
Crazy C++ Code
char *s = "DEHLORW";
char *d = "2133464530";
for(i=0; d[i]; i++)
cout << s[d[i]-'0'];
///////////////////////////
i = 1<<1;
i |= 1;
cout << (i<<2) << ":" << (i>>2) << (i==2);
/////////////
x = 0;
cout << (x==0) << (x=0) << (0);
////////////////////////////
class c{
c(int i=0);
public: int a;
};
c::c(int i): a(i) {}
Disablig deprecated HTML code
font,basefont {
color:inherit; /* Standard browsers */
color:expression(this.parentNode.currentStyle['color']); /* IE */
font:inherit; /* Standard browsers. Font instead of font-size for Opera */
font-family:expression(this.parentNode.currentStyle['fontFamily']); /* IE */
font-size:100%; /* All browsers. Sizes are inherited */
}
center {
text-align:inherit; /* Standard browsers */
text-align:expression(this.parentNode.currentStyle['textAlign']); /* IE */
}
s,strike,u {
text-decoration:inherit; /* Standard browsers */
text-decoration:expression(this.parentNode.currentStyle['textDecoration']); /* IE */
}
*[align] { text-align:inherit; } /* Standard browsers */
* { text-align:expression(this.align ? this.parentNode.currentStyle['textAlign'] : ''); } /* IE */
img { margin:0; border:none; } /* All browsers. Borders & margins are not inherited */
ol { list-style-type:decimal; } /* All browsers. Removes the type attribute */
body { background-color:transparent; /* All browsers */ }
table,tr,th,td {
width:auto; /* All browsers */
height:auto; /* All browsers */
background-color:transparent; /* All browsers */
vertical-align:inherit; /* All browsers (works in IE) */
border:none; /* All browsers. Borders are not inherited */
}