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 java.awt.Toolkit; | |
import java.awt.datatransfer.Clipboard; | |
import java.awt.datatransfer.StringSelection; | |
import java.security.SecureRandom; | |
public final class SaltShaker { | |
public static void main(String[] args) { | |
final byte[] data = new byte[20]; |
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
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 19 | |
buildToolsVersion "21.1.2" | |
defaultConfig { | |
applicationId "com.example.package.app" | |
minSdkVersion 16 | |
targetSdkVersion 19 |
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.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using System.Globalization; | |
using System.Collections.Generic; | |
namespace ReverseString | |
{ | |
[TestClass] | |
public class ReverseStringTests |
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 spock.lang.* | |
@Unroll | |
class ExampleSpockSpec extends Specification { | |
def "max of #a and #b is #c"() { | |
expect: | |
Math.max(a, b) == c | |
where: |
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
/* | |
============================================================================ | |
Name : SinCosProject.c | |
Author : | |
Version : | |
Copyright : Your copyright notice | |
Description : Hello World in C, Ansi-style | |
============================================================================ | |
*/ |
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
/* | |
============================================================================ | |
Name : SinCosProject.c | |
Author : | |
Version : | |
Copyright : Your copyright notice | |
Description : Hello World in C, Ansi-style | |
============================================================================ | |
*/ |
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.Linq; | |
using System.Reflection; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace ImmutableTests | |
{ | |
[TestClass] | |
public class AssertImmutableTests | |
{ |
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 readonly object Spec = "Public spec field" | |
.Assert(() => Assert.Pass("It works!")); | |
private object Spec2 = "Private spec field" | |
.Assert(() => Assert.Pass("It works!")); | |
private object Spec3 = new[] | |
{ | |
"Collection spec field" | |
.Assert(() => Assert.Pass("It works!")), |
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
// add this to the general build.gradle, not in the subproject's build.gradle | |
// improved version of Xavier's tip http://tools.android.com/tech-docs/new-build-system/tips#TOC-Improving-Build-Server-performance. | |
// usage example default, preDex will be enabled: gradle clean build | |
// usage example disabling preDex: gradle clean build -PpreDexEnable=false | |
// preDexEnable parameter's value can be set as property of Continuous Integration build config | |
// this is the main difference from Xavier's workaround where he doing only hasProperty check | |
project.ext { | |
if (project.hasProperty('preDexEnable')) { |
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 Newtonsoft.Json; | |
using Newtonsoft.Json.Serialization; | |
using NUnit.Framework; | |
namespace AddToJsonPoco | |
{ | |
[TestFixture] | |
public class AddPropertyToJsonOnSerialize |
OlderNewer