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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
int reverse(void * array, const size_t offset, const size_t length, const size_t size) { | |
void * temp = malloc(size); | |
if (temp == NULL) { | |
return EXIT_FAILURE; | |
} |
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
#include <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
#define swapa(type, a, b) { type t = a; a = b; b = t; } | |
#define swapb(type, a, b) { type t = *a; *a = *b; *b = t; } |
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 ArrOffLen<T> { | |
public boolean isValid() { | |
if (arr == null) { | |
return false; | |
} | |
if (off < 0) { | |
return false; | |
} | |
if (len < 0) { |
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 class CodeSnippetsInJavadoc { | |
/** | |
* Prints {@code hello, world\n} to {@code stdout}. | |
* | |
* <blockquote><pre>{@code | |
* public static void main(final String[] args) { | |
* System.out.printf("hello, world\n"); | |
* } | |
* }</pre></blockquote> |
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
$file = "setup-x86_64.exe" | |
Invoke-WebRequest -OutFile $file https://www.cygwin.com/$file | |
Invoke-Expression .\$file |
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
<?xml version="1.0" encoding="utf-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>test</groupId> | |
<artifactId>enforcer-dependency-convergence-test</artifactId> | |
<version>0.1-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<dependencies> |
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.nio.ByteBuffer; | |
import java.util.Arrays; | |
import static java.util.concurrent.ThreadLocalRandom.current; | |
public class ArrayWrappingByteBufferTest { | |
public static void main(final String[] args) { | |
final byte[] array = new byte[] {1, 1, 1, 1, 1, 1, 1, 1}; | |
System.out.println("array: " + Arrays.toString(array)); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/beans_1_1.xsd"> | |
</beans> |
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.util.logging.Logger; | |
public enum EnumWithLogger { | |
//private static Logger logger; // can't place here | |
NONE { | |
void world() { | |
slogger.info("world"); |
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 class FloatIntBits { | |
private static void printIntBits(float value) { | |
System.out.println("-------------------------------------"); | |
System.out.printf(" value: %f\n", value); | |
final int intBits = Float.floatToIntBits(value); | |
final int rawIntBits = Float.floatToRawIntBits(value); | |
System.out.printf(" toIntBits: 0x%08x %f\n", intBits, Float.intBitsToFloat(intBits)); | |
System.out.printf("toRawIntBits: 0x%08x %f\n", rawIntBits, Float.intBitsToFloat(rawIntBits)); | |
} |