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
class GitHistory | |
attr_reader :test_lines_of_code, :production_lines_of_code, :current_commit_id, :previous_commit_id, :diff, :has_java_or_test_code | |
def initialize(commit_id = nil) | |
@commit_id= commit_id unless commit_id.nil? | |
if commit_id.nil?: | |
getLatestCommit | |
end | |
@has_java_or_test_code = false |
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.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace LINQSum | |
{ | |
public class SumNumbers | |
{ | |
private int[] numberList = {1, 2, 4, 8, 16, 32}; |
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
import re, collections | |
def words(text): return re.findall('[a-z]+', text.lower()) | |
def train(features): | |
model = collections.defaultdict(lambda: 1) | |
for f in features: | |
model[f] += 1 | |
return model |
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.Text; | |
using System.IO; | |
namespace FolderWatcher { | |
class Watcher { | |
static void Main(string[] args) { | |
FileSystemWatcher watcher = new FileSystemWatcher(@"D:\test"); | |
watcher.IncludeSubdirectories = true; | |
watcher.Filter = ""; |
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
//locale information | |
CultureInfo provider = CultureInfo.InvariantCulture; | |
//The timestamp from the external file | |
string dateString = "Dec 07 01:32:25 2009"; | |
//the new format | |
string format = "MMM dd HH':'mm':'ss yyyy"; | |
//Convert the time string into a legitimate DateTime object |
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
<system.net> | |
<mailSettings> | |
<smtp> | |
<network defaultCredentials="false" | |
host="mail.yourdomain.com" port="25" | |
userName="name-to-send-email@yourdomain.com" | |
password="*****"/> | |
</smtp> | |
</mailSettings> | |
</system.net> |
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.Net.Mail; */ | |
MailMessage newMail = new MailMessage(); | |
newMail.To.Add(toAddress); | |
newMail.Subject = subject; | |
newMail.Body = body; | |
newMail.From = new MailAddress(fromAddress, name); | |
newMail.IsBodyHtml = true; | |
SmtpClient SmtpSender = new SmtpClient(); | |
SmtpSender.Port = 25; //or, whatever port your SMTP server operates on |
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.Diagnostics; */ | |
[Conditional("DEBUG")] | |
public void printDebug() { | |
Console.WriteLine("Debug Information"); | |
} |
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
package RandomRoll; | |
import java.util.Random; | |
public class RandomRoll extends Thread { | |
private boolean running = true; | |
public RandomRoll() { | |
super("RandomRoll thread"); |
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
Manifest-Version: 1.0 | |
Bundle-Name: RandomRoll | |
Bundle-Description: Roll a die every second | |
Bundle-Activator: RandomRoll.Activator | |
Import-Package: org.osgi.framework | |
Bundle-Vendor: Tutorial | |
Bundle-ManifestVersion: 2 | |
Bundle-SymbolicName: RandomRoll | |
Bundle-Version: 1.0.0 |