View ci.go
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 main | |
import ( | |
"context" | |
"fmt" | |
"os" | |
"dagger.io/dagger" | |
) |
View payara.java
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
// Here's the network where both containers will join | |
static final Network NET = Network.newNetwork(); | |
// The database container will join the network under the 'mysql' alias | |
@Container | |
static MySQLContainer dbContainer = | |
new MySQLContainer<>(DockerImageName.parse("mysql:8.0")) | |
.withNetwork(NET) | |
.withNetworkAliases("mysql"); |
View FibonacciController.java
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 com.example; | |
import io.micronaut.http.MediaType; | |
import io.micronaut.http.annotation.Controller; | |
import io.micronaut.http.annotation.Get; | |
import java.util.HashMap; | |
import java.util.Map; | |
@Controller("/") | |
public class FibonacciController { |
View FibonacciController.java
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 com.example; | |
import io.micronaut.http.MediaType; | |
import io.micronaut.http.annotation.Controller; | |
import io.micronaut.http.annotation.Get; | |
@Controller("/") | |
public class FibonacciController { | |
private static final StringBuilder LOG = new StringBuilder(); |
View correlate-pseudo.java
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 static double correlate(double[] a, double[] b) { | |
if (a.length != b.length) { | |
return Double.NaN; | |
} | |
double <w,x,y,z> = <0,0,0,0>; | |
int i = 0; | |
for ( ; i + 3 < a.length; i += 4) { | |
<w,x,y,z> += a[<i,i+1,i+2,i+3>] * b[<i,i+1,i+2,i+3>]; | |
} | |
double correlation = w + x + y + z; |
View correlate.java
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 static double correlate(double[] a, double[] b) { | |
if (a.length != b.length) { | |
return Double.NaN; | |
} | |
double partial[] = new double[4]; | |
int i = 0; | |
for ( ; i + 3 < a.length; i += 4) { | |
partial[0] += a[i+0] * b[i+0]; | |
partial[1] += a[i+1] * b[i+1]; | |
partial[2] += a[i+2] * b[i+2]; |
View SignalCorrelation.java
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 SignalCorrelation { | |
/** Approximate {@code sin(i / 1000)}. */ | |
public static double sin(int i) { | |
double x = i / 1000.0; | |
double term3 = (x*x*x) / (3 * 2 * 1); | |
double term5 = (x*x*x*x*x) / (5 * 4 * 3 * 2 * 1); | |
return x - term3 + term5; | |
} | |
View pseudocode.java
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
function lowUsage() { | |
for (i = 0; i < COMPILATION_THRESHOLD; i++) { | |
// Do something | |
} | |
} | |
function highUsage() { | |
for (i = 0; i < 100 * COMPILATION_THRESHOLD; i++) { | |
// Do something | |
} |
View Example.java
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 jdk.jfr.Event; | |
import jdk.jfr.Description; | |
import jdk.jfr.Label; | |
public class Example { | |
@Label("Hello World") | |
@Description("Helps programmer getting started") | |
static class HelloWorld extends Event { | |
@Label("Message") |
View iterm-profile.json
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
{ | |
"Badge Text" : "", | |
"Custom Directory" : "No", | |
"Working Directory" : "\/Users\/shelajev", | |
"Prompt Before Closing 2" : 0, | |
"Selected Text Color" : { | |
"Green Component" : 0.94760049999999996, | |
"Red Component" : 0.94760049999999996, | |
"Blue Component" : 0.94760049999999996 | |
}, |
NewerOlder