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
OracleParameter paramString = new OracleParameter(); | |
paramString.Value = OracleString.Null; | |
var sizeStr = paramString.Size; //barf | |
OracleParameter paramBinary = new OracleParameter(); | |
paramBinary.Value = OracleBinary.Null; | |
var sizeBin = paramBinary.Size; //barf |
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
```java | |
@AfterMethod(alwaysRun = true) | |
public void shutDownDriver(ITestResult result) throws IOException { | |
}@AfterMethod(alwaysRun = true) | |
public void shutDownDriver(ITestResult result) throws IOException { | |
// Update SauceLabs result | |
if(testbed.equals("saucelab")) { | |
String jobID = ((RemoteWebDriver)driver).getSessionId().toString(); | |
SauceREST client = new SauceREST("username", "key"); |
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
@AfterMethod(alwaysRun = true) | |
public void shutDownDriver(ITestResult result) throws IOException { | |
}@AfterMethod(alwaysRun = true) | |
public void shutDownDriver(ITestResult result) throws IOException { | |
// Update SauceLabs result | |
if(testbed.equals("saucelab")) { | |
String jobID = ((RemoteWebDriver)driver).getSessionId().toString(); | |
SauceREST client = new SauceREST("username", "key"); | |
Map<String, Object>sauceJob = new HashMap<String, Object>(); |
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
'Make sure this import is at the top of the file: | |
Imports System.Globalization | |
'And the actual code: | |
Public Function ParseDateTime(ByVal dateTimeString As String) As DateTime? | |
Dim dt As DateTime | |
'Try to parse the date time... | |
If DateTime.TryParseExact(dateTimeString, New String() {"yyyyMMdd", "yyyy-MM-dd"}, CultureInfo.CurrentCulture, DateTimeStyles.None, dt) Then |
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 class IFoo | |
{ | |
public object Current { get; set; } | |
public bool MoveNext() | |
{ | |
return whatever; | |
} | |
} | |
public class Bar |
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 async Task<string> Foo | |
{ | |
set | |
{ | |
} | |
get | |
{ | |
} | |
} |
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
Imports System | |
Imports EnvDTE | |
Imports EnvDTE80 | |
Imports EnvDTE90 | |
Imports EnvDTE90a | |
Imports EnvDTE100 | |
Imports System.Diagnostics | |
Imports System.Text | |
Public Module EditorMacro |
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
[STAThread] | |
static void Main() | |
{ | |
var size = Screen.AllScreens.Aggregate(Size.Empty, (sz, screen) => | |
{ | |
var boundHeight = screen.Bounds.Y + screen.Bounds.Height; | |
var boundWidth = screen.Bounds.X + screen.Bounds.Width; | |
return new Size(boundWidth > sz.Width? boundWidth : sz.Width, boundHeight > sz.Height? boundHeight : sz.Height); | |
}); | |
using (var bitmap = new Bitmap(size.Width, size.Height)) |
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
[Test] | |
public void ShouldHandleAspNet4Rendering() | |
{ | |
var text = string.Format("Hello World"); | |
multiline.Text = text; | |
doPostBack.Click(); | |
Assert.AreEqual(text, multiline.Text); | |
} |
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
//Don't Want | |
Func<bool, bool> someFunc = null; | |
someFunc = b => someFunc(b); | |
//Want (Mono C# compiler can do this) | |
Func<bool, bool> someFunc = b => someFunc(b); |