I hereby claim:
- I am ebello on github.
- I am ern (https://keybase.io/ern) on keybase.
- I have a public key whose fingerprint is 4BD6 4F60 24EE CBA5 C81B 30DA 26A0 E6CF C65A 7DF5
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
public T RandomItem() | |
{ | |
int randomRI = 0; | |
Random random = new Random(); | |
lock (random) | |
{ | |
randomRI = random.Next(0, this.Count - 1); | |
} | |
return this[randomRI]; | |
} |
string[] ids = this.Parameters["OrderByRank"].Split(','); | |
for (int x = 0; x < ids.Length; x++) | |
{ | |
Event foundevent = ec.Find(delegate(Event e) | |
{ | |
return e.ViewID == ids[x]; | |
}); | |
if (foundevent != null) | |
foundevent.Order = -1000 + x; // start at -1000 because the default order is 0 | |
} |
public delegate BaseGenericList<T> MethodExecution<T>(); | |
public static BaseGenericList<T> GetCachedList<T>(string key, object[] argsKey, MethodExecution<T> method) | |
{ | |
BaseGenericList<T> list = new BaseGenericList<T>(); | |
T[] listarray = (T[])CacheConfig.DeCache(key, argsKey); | |
if (listarray == null) | |
{ | |
list = method(); | |
CacheConfig.EnCache(key, list.ToArray(), argsKey); | |
} |
public static List<T> LoadLookup<T, U>(IDataReader reader) where T : ILookup<U>, new() | |
{ | |
List<T> list = new List<T>(); | |
try | |
{ | |
while (reader.Read()) | |
{ | |
T lookup = new T(); | |
lookup.ID = (U)reader["ID"]; | |
lookup.Name = (string)reader["Name"]; |
namespace Mofo.Framework.Components | |
{ | |
public class Lookup<T> | |
{ | |
public T ID { get; set; } | |
public string Name { get; set; } | |
} | |
} | |
namespace Mofo.Framework.Components |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
ALTER PROCEDURE [dbo].[Tombstones_SearchTombstones] | |
@industry_id smallint = null, | |
@region_id_list varchar(8000) = null, | |
@inbound_region_id_list varchar(8000) = null, | |
@outbound_region_id_list varchar(8000) = null | |
AS |
public static string ToIDList<T, U>(List<U> lookuplist) where U : ILookup<T> where T : struct | |
{ | |
List<U> lookupidlist = lookuplist.FindAll(delegate(U lookup) | |
{ | |
return lookup.ID.HasValue; | |
}); | |
string idlist = String.Empty; | |
if (lookupidlist != null) | |
{ | |
string[] ids = new string[lookupidlist.Count]; |
public delegate T MethodExecution<T>(IDataReader reader); | |
public static List<T> LoadList<T>(IDataReader reader, MethodExecution<T> method) | |
{ | |
return LoadList<T>(reader, true, method); | |
} | |
public static List<T> LoadList<T>(IDataReader reader, bool close_reader, MethodExecution<T> method) | |
{ | |
List<T> list = new List<T>(); | |
try | |
{ |
' VB.Net 2.0 | |
' a class for videos is what I was using my original code for | |
Public Class Video | |
Private _id As Integer | |
Public Property Id() As Integer | |
Get | |
Return _id | |
End Get | |
Set(ByVal value As Integer) |