This file contains hidden or 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.Collections.Generic; | |
using System.Text; | |
using System.Diagnostics; | |
namespace ExceptionTest | |
{ | |
class DataLayer | |
{ | |
public static int DoSomething() |
This file contains hidden or 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 static int DoSomething() | |
{ | |
try | |
{ | |
return BusinessLayer.DoSomething(); | |
} | |
catch (Exception ex) | |
{ | |
Log.LogException(ex, "Something crashed...", EventLogEntryType.Error); | |
throw ex; |
This file contains hidden or 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.Text; | |
using System.Reflection; | |
using System.Collections.Generic; | |
namespace ReflectionTest | |
{ | |
public class BaseEntity : ICloneable | |
{ | |
public object Clone() |
This file contains hidden or 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
var recentPhrases = ['', '', '']; | |
// We re-throw Gears exceptions to make them play nice with certain tools. | |
// This will be unnecessary in a future version of Gears. | |
try | |
{ | |
// Get the 3 most recent entries. Delete any others. | |
var rs = db.execute('select * from Demo order by Timestamp desc'); | |
var index = 0; | |
while (rs.isValidRow()) |
This file contains hidden or 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 knows what you mean, even if you | |
# want to do math on an entire Array | |
cities = %w[ London Oslo Paris | |
Amsterdam Berlin ] | |
visited = %w[Berlin Oslo] | |
puts "I still need to visit the following cities:", | |
cities - visited |
This file contains hidden or 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
//Create a list of persons | |
List<Person> persons = new List<Person>(); | |
persons.Add(new Person("Jonas", "Follesø")); | |
persons.Add(new Person("Hege", "Røkenes")); | |
persons.Add(new Person("Håvard", "Sørbø")); | |
persons.Add(new Person("Gøran", "Hansen")); | |
//... more persons go here .../ | |
//C# 2.0 - Using an anonomous method to filter persons that starts with "J" | |
List<Person> jPersons = persons.FindAll(delegate(Person p) { return p.Name.StartsWith("J"); }); |
This file contains hidden or 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
#region Licence agreement | |
// Copyright (c) 2007, Jonas Follesø | |
// All rights reserved. | |
// | |
// Redistribution and use in source and binary forms, with or without | |
// modification, are permitted provided that the following conditions are met: | |
// * Redistributions of source code must retain the above copyright | |
// notice, this list of conditions and the following disclaimer. | |
// * Redistributions in binary form must reproduce the above copyright | |
// notice, this list of conditions and the following disclaimer in the |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8" ?> | |
<gadget> | |
<name>GratisSMS</name> | |
<version>1.0.0.3</version> | |
<url>http://gallery.live.com/liveItemDetail.aspx?li=62c42ea0-7b5a-48da-822b-235cdacb5d51</url> | |
<comment>Ung1881 har endret på HTML-koden sin. Viktig oppdatering!</comment> | |
</gadget> |
This file contains hidden or 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
/////////////////////////////////////////////////////////////// | |
// | |
// Function checking if there is a new version available. | |
// | |
/////////////////////////////////////////////////////////////// | |
function isUpdateAvailable() | |
{ | |
//Show progress | |
imgProgress.style.visibility = "visible"; | |
This file contains hidden or 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
/////////////////////////////////////////////////////////////// | |
// | |
// Load contacts from the Vista address book. | |
// | |
/////////////////////////////////////////////////////////////// | |
function loadContacts() | |
{ | |
var contactMgr = System.ContactManager; | |
var contacts = contactMgr.Contacts; | |
var contact = null; |