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"?> | |
| <beans xmlns="http://www.springframework.org/schema/beans" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xmlns:lang="http://www.springframework.org/schema/lang" | |
| xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd | |
| http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.0.xsd"> | |
| <bean id="myPrototypeBean" scope="prototype" class="net.ceilingfish.Session"> | |
| <property name="register"> | |
| <!-- This class is a prototype, i.e. a new one will be requested every time you read this from the ApplicationContext --> |
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
| class Mash < Hash | |
| def method_missing(method_name, *args, &block) | |
| self[method_name] | |
| end | |
| end | |
| module Configuration | |
| def self.attributes |
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
| # subsect an array into a fixed length subsections | |
| # Eg. [1,2,3,4,5].chunk(2) => [[1,2],[3,4],[5]] | |
| class Array | |
| def chunk(size=2) | |
| pieces = (self.length / size) | |
| chunks = [] | |
| 0.upto(pieces) do |i| | |
| start = i * size | |
| finish = start + size | |
| chunks << self[start..finish] || [] |
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.Collections.Generic; | |
| using System.Linq; | |
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| using System.Diagnostics; | |
| using System.Collections.Concurrent; | |
| namespace DotNetTesting | |
| { |
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 void Start() | |
| { | |
| Thread listenerThread = new Thread(ListenForConnections); | |
| listenerThread.IsBackground = true; | |
| listenerThread.Start(); | |
| } | |
| private void ListenForConnections() | |
| { | |
| TcpListener listener = new TcpListener(IPAddress.Any, ServerPort); |
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
| try | |
| { | |
| throw new Exception("an error"); | |
| } | |
| catch | |
| { | |
| //do something with e | |
| throw; | |
| } | |
| finally |
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
| { | |
| fieldLabel: 'The Field label', | |
| xtype: 'box', | |
| autoEl: { | |
| tag: 'a' | |
| href: 'test.php', | |
| html: 'This is a link that can be placed inside a form.', | |
| target: '_blank' | |
| } | |
| } |
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
| async Task Main() | |
| { | |
| var connectionString = "Endpoint=sb://my-namespace.servicebus.windows.net/;SharedAccessKeyName=ReadEvents;SharedAccessKey=MySecretKey;EntityPath=hub"; | |
| Console.WriteLine("Rewinding event hub..."); | |
| var eventProcessorHost = new EventProcessorHost( | |
| "reporting", | |
| PartitionReceiver.DefaultConsumerGroupName, | |
| connectionString, | |
| "UseDevelopmentStorage=true", |
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
| <Query Kind="Program" /> | |
| void Main() | |
| { | |
| var input = @"5 5 | |
| 1 2 N | |
| LMLMLMLMM | |
| 3 3 E | |
| MMRMMRMRRM"; |
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
| <div class="ee_dropzone"><table cellpadding="0" cellspacing="0" width="100%" class="ee_customedit ee_couponcode ee_element" ee-type="container" data-title="Coupon code"><tbody><tr><td valign="top" class="ee_couponcodecontent element-pad element-bord col-font-reset root-element-pad"></td></tr></tbody></table> |