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
# Ruby-RSpec klasse brugt til at beskrive MultiSet-java klassen med | |
# | |
# For at køre: | |
# make spec | |
# | |
# Kræver: | |
# jruby (http://jruby.org) | |
# rspec (gem install rspec) | |
# |
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
<% content_for :nav do %> | |
<ul> | |
<% | |
items = ["Forside", "Rediger quiz", "Kategorier", "Spilrunder"] | |
descriptions = ["Gå til forsiden", "Rediger en quiz", "Opsæt kategorier", "Vælg spilrunder"] | |
items.each_index do |key| | |
item = items[key] | |
item_description = descriptions[key] | |
if !is_active_page?(:key) |
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 Shared Function GenerateNewUniqueID() As String | |
Dim returnString As String = Guid.NewGuid.ToString() | |
Dim unique As Boolean = False | |
Using conn As New SqlConnection(My.Settings.onlinePDFConnectionString) | |
conn.Open() | |
Dim commString As String = "SELECT Count(*) FROM Books WHERE UniqueID = '{0}%'" |
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
Pruning tables. | |
Executing: DELETE FROM Branches; | |
Nil result | |
Executing: DELETE FROM Accounts; | |
Nil result | |
Executing: DELETE FROM Customers; | |
Nil result | |
Executing: DELETE FROM Transactions; | |
Nil result | |
Inserting branch |
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 void Add<TEntity>(TEntity t) where TEntity : class | |
{ | |
var properties = (from p in GetType().GetProperties() | |
select p.GetGetMethod(true)); | |
var genericProperties = (from property in GetType().GetProperties() | |
let returntype = property.GetGetMethod(true).ReturnType | |
where returntype.IsGenericType | |
where returntype.GetGenericArguments().Length == 1 | |
let argumenttype = returntype.GetGenericArguments().First() | |
where argumenttype == typeof (TEntity) |
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
mat | |
|> Array.iteri (fun m i -> Array.iter (fun n -> printfn "%d" mat.[m].[n]) mat.[m]) | |
// vs | |
mat | |
|> Array.iteri (fun m i -> mat.[m] | |
|> (fun n -> printfn "%d" mat.[m].[n])) | |
// vs |
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
let printMatrixRec2((mat : int[][])) = | |
let rec iterate r c = | |
match r, c with | |
| m,n when n = mat.[m].Length-1 && m = mat.Length-1 -> printf " %d" mat.[m].[n]; () // Base case, last entry: Stop recursion when r,c are at bounds of Mat int[][] array | |
| m,n when n = mat.[m].Length-1 -> printf " %d\n" mat.[m].[n]; iterate (m+1) 0 // Special case: last column of row m, print special and iterate next row | |
| m,n when n=0 -> printf "%d " mat.[m].[n]; iterate m (n+1) // Special case: first column of m | |
| m,n -> printf " %d " mat.[m].[n]; iterate m (n+1) // Normal case: entry m,n | |
iterate 0 0 |
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
using System; | |
using System.Security.Permissions; | |
using System.Threading; | |
class ThreadInterrupt | |
{ | |
static void Main() | |
{ | |
StayAwake stayAwake = new StayAwake(); | |
Thread newThread = |
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 override void CreateNewOutputRows() | |
{ | |
string strCurrency; | |
string flRate; | |
XmlDocument xm = new XmlDocument(); | |
xm.Load(Variables.ECBRL.ToString()); | |
XmlNodeList xnode = xm.GetElementsByTagName("Cube"); | |
DateTime date = DateTime.Parse(xm.GetAttribute("time")); | |
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
(** Additions to weedingast.ml, bottom **) | |
let type_decl_members td = match td.type_decl with | |
| Class d -> d.class_members | |
| Interface i -> i.interface_members | |
let decl_name decl = match decl.decl with | |
| Field f -> f.field_name.Ast.identifier | |
| Method m -> m.method_name.Ast.identifier | |
| Constructor c -> c.constructor_name.Ast.identifier |
OlderNewer