Skip to content

Instantly share code, notes, and snippets.

View hoganlong's full-sized avatar

Hogan Long hoganlong

View GitHub Profile
with mat1 as
(
SELECT DISTINCT
matl1.SubPartNo,
STUFF((
SELECT ', ' + matl2.PartNo
FROM Materials as matl2
WHERE matl2.SubPartNo = matl1.SubPartNo
FOR XML PATH('')
),1,1,'') as WhereUsed
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>Freed From The Real podcast</title>
<description>A podcast for and about Magic Online</description>
<link>http://puremtgo.com/articles/recent?uid=&amp;title=freed+from+the+real</link>
<ttl>1800</ttl>
<item>
<title>Freed from the Real 414: Command Lowers Your Life Expectancy</title>
SELECT *
FROM tableNm
WHERE circleNm IN ('test1', 'test2', 'test3')
-- is the same as
SELECT *
FROM tableNm
JOIN (
VALUES(
void Main()
{
var myPets = new List<petInfo>();
var yourpets = new List<petInfo>();
myPets.Add(new petInfo("me", "dog","Rex"));
myPets.Add(new petInfo("me", "fish","Goldy"));
myPets.Add(new petInfo("me", "iguana","Spikey"));
yourpets.Add(new petInfo("you", "dog","Spot"));
WITH XX_SQDC_LINES_REF (Line, Name, Site) AS
(
VALUES
(1 , 'Table ',1),
(2 , 'Lamp ',1),
(3 , 'Screen ',2),
(4 , 'Forcep ',2),
(5 , 'Brush ',2),
(6 , 'Camera2',2),
(7 , 'Screen2',2),
+-------+
| |
| |
| |
char * (*arr ) [ 2 ]
| | | |
| | | |
| +-+ |
+---------+
@hoganlong
hoganlong / test.cs
Last active December 18, 2015 20:39
For stackoverflow question at http://stackoverflow.com/questions/17242522/linq-not-trivial-group-by To run use linqpad and set it to C# program
void Main()
{
Person p1 = new Person();
p1.Groups = new List<Group>();
p1.Groups.Add(new Group { GroupType = GroupTypesEnum.a });
p1.Groups.Add(new Group { GroupType = GroupTypesEnum.b });
Message m1 = new Message();
m1.Recipient = p1;
Person p2 = new Person();
@hoganlong
hoganlong / solution.cs
Last active December 18, 2015 17:39
For stackoverflow question at http://stackoverflow.com/questions/17204123/linq-retrieve-non-repeated-values#17204179 To run use linqpad and set it to C# program
void Main()
{
List<Event_Day> Days = new List<Event_Day>();
Days.Add(new Event_Day(420,120,1,new DateTime(2013,6,20)));
Days.Add(new Event_Day(421,120,2,new DateTime(2013,6,21)));
Days.Add(new Event_Day(422,120,3,new DateTime(2013,6,22)));
List<Event_Session> Sessions = new List<Event_Session>();
Sessions.Add(new Event_Session(170,120,420));
Sessions.Add(new Event_Session(171,120,420));
void Main()
{
Dictionary<int,int> skillList = new Dictionary<int,int>();
skillList.Add(1,1);
skillList.Add(2,2);
skillList.Add(3,1);
skillList.Add(4,1);
#first install the compiler
yum install gcc gcc-c++ autoconf automake
#install zlib-devel as it's a dependency
yum install zlib-devel
#then get and build git from source
cd /usr/lib
wget "https://git-core.googlecode.com/files/git-1.8.2.2.tar.gz"
tar xzvf git-1.8.2.2.tar.gz