Happy Christmas/[enter your festivity here] everyone!
perl -e '$a="How does stAckoverflow PeoPle implement \"happY Holiday\" prOgrams in Language of theIr choice toDAY, chriStmas eve?"; $a=~ tr/[A-Z]//cd; print $a;'
Happy Christmas/[enter your festivity here] everyone!
perl -e '$a="How does stAckoverflow PeoPle implement \"happY Holiday\" prOgrams in Language of theIr choice toDAY, chriStmas eve?"; $a=~ tr/[A-Z]//cd; print $a;'
Delphi:
const
cMyHoliday = 'XMas';
type
EHappy = class (Exception);
procedure TMyMainWindow.OnActivate;
begin
raise EHappy.CreateFmt('Happy %s', [cMyHoliday]);
end;
C#
for(int i=0; i<3; i++)
{
if(i!=0) Console.Write(", ");
Console.Write("ho");
}
Console.WriteLine("!");
C++
# include<iostream>
using namespace std;
int main()
{
cout<<"Wish you Merry Xmas and Happy New year";
return 0;
}
public enum Holiday
{
Easter,
Xmas
}
public enum WishType
{
Happy,
Merry,
Crappy
}
public string Wish(Holiday holiday, WishType wishType)
{
Console.WriteLine("{0} {1}!", wishType.ToString(), holiday.ToString());
RealLife.GetDrunk();
}
public class RealLife
{
public static void GetDrunk()
{
System.Threading.Thread.CurrentThread.Suspend();
}
}
Edit: forgot formatting :)
Lua
local l = { ' ', 'a', 'd', 'H', 'i', 'l', 'o', 'p', 's', 'y' }
local p = { 4, 2, 8, 8, 10, 1, 4, 7, 6, 5, 3, 2, 10, 9 }
local s= {}
for i, v in ipairs(p) do
s[#s + 1] = l[v]
end
print(table.concat(s))
Python:
list = ['Naughty', 'Nice', "Can't decide"]
for i in ['once', 'twice']:
for behavior in list:
assert(behavior is not None)
("He's making a list, and checking it twice")
Less verbose:
all([b is not None for b in ['Naughty', 'Nice', "Can't decide"]] * 2)
Function for SOAP Web Service in VDF.
{ Published = True }
{ Description = "Is it xmas day ma?" }
Function isItXmasDay Returns Boolean
String sTmp
Sysdate sTmp
If (Left(sTmp,5)) eq "25/12" Function_Return (True)
Else Function_Return (False)
End_Function
C++ & Boost
of course you use:
boost::xmas<boost::xmas::policy::merry> merryXmas;
merryXmas << "ho! ho! ho!";
PHP, with as much evil as I can fit in:
<?
@mysql_connect('db', 'user', 'pass');
$sql = "SELECT text FROM messages WHERE text LIKE '%$message%'";
$query = @mysql_query($sql);
$row = @mysql_fetch_array($sql);
@echo $row[text];
?>
<form action="<?=$PHP_SELF ?>">
<input type=hidden name=message value="Merry Xmas!">
<input type=submit>
</form>
I'd write one in the D Programming Language, but I'm not sure if I should use std.xmas
or tango.Christmas.Merry
… ;)
XSLT for checking the list (twice):
<xsl:template match="/">
<xsl:call-template name="check"/>
<xsl:call-template name="check"/>
</xsl:template>
<xsl:template name="check">
<xsl:apply-templates select="children/child"/>
</xsl:template>
<xsl:template match="child[@good='true']>
<xsl:value-of select="@name"/>: present
</xsl:template>
<xsl:template match="child[not(@good='true')]>
<xsl:value-of select="@name"/>: coal
</xsl:template>
(several languages in the Java-like family)
World.joy();
and
public abstract class Earth {
public Object peace();
}
f#
let printMessage m =
match m with
|"holiday" -> printfn "%A" "Happy holidays"
|"xmas" -> printfn "%A" "Happy Xmas"
| _ -> printfn "%A" "Nothing to celebrate"
printMessage "holiday"
F#
let concat (x : string) y = x + y;;
printfn "%s" concat "Happy, " "Holidays!";;
echo 'qw{39 4 17 17 24 26 29 7 17 8 18 19 12 0 18 };' |
perl -E'local*~=sub{[a..z," ",A..Z]->[$_]};print&~()for eval<>;say'
To figure out what to have for the echo:
echo Merry Christmas |
perl -E'$h{$_}=$c++for(a..z," ",A..Z);push@a,$h{$_}for(split"",<>);say"qw{@a};";'
#include <iostream>
typedef unsigned a;a s[]={0,0xab29de8f,0x731b3bb3,0xd3726395,0x6b9874bd,0xb531ccea,0xb27532d4,0x659b3b25,
0x6531ccca,0x9994ca66,0xab294dc9,0x99999c93,0x7a96a5a9,0x67a4be4c,0x1cccea71,0x4ca66653,0xd6c97c9d,
0xc733a9bd,0x3299994c,0x98e5f275,0x725eeafb,0x99d4def7,0xa94a53a9,0x2a4bb999,0xccf49893,0xa6653294,
0xc94ecccc,0xcea6f6e4,0x531ccccc,0xbb224a37,0xea653335,0xb3a994cc,0x6a7cee51,0xa6675312,0xa9994cce,
0x6b93251b,0xd91cea5d,0x772ab4f4,0xcb64d5be,0xd2cd71b9,0x6d6c972c,0x7b75b25f,0x129f93b2};
a g(a&d,a*&c,a b){a v=0;for(a i=0;i<b;++i,d<<=1){if(!d)d=1,++c;if(*c&d)v|= 1<<i;}return v;}
int main(){char p=32;for(a i=0,*t=s,m=0,s=0;i<1760;++i,--s,std::cout<<p)if(!s)p^=3,s=g(m,t,g(m,t,3));}
Skizz