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
// Run with: | |
// java -jar compiler.jar --language_in=ECMASCRIPT6_STRICT -O ADVANCED --warning_level VERBOSE functions.js | |
/** | |
* @param {function(*)} f1 ERROR | |
* @param {function(*):*} f2 ERROR | |
* @param {function(?):*} f3 | |
* @param {function(*):?} f4 ERROR | |
* @param {function(?):?} f5 | |
* @param {function()} f6 ERROR |
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
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../paper-tabs/paper-tabs.html"> | |
<link rel="import" href="../paper-tabs/paper-tab.html"> | |
<link rel="import" href="../chart-js/chart-js.html"> | |
<link rel="import" href="../ace-element/ace-element.html"> | |
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> |
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 registerOnLoad(fn) { | |
var prev = window.onload; | |
window.onload = !prev ? fn : function() { | |
var prevResult = prev(); | |
return prevResult instanceof Promise ? prevResult.then(fn) : fn(); | |
}; | |
} | |
if (!this['Proxy']) { | |
var PolyfillProxy = function(target, handlers) { |
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
// Run with dart: | |
// dart async_example.dart | |
import 'dart:async'; | |
f(g) async { | |
try { | |
final value = await g(); | |
return 'Result: ' + (value + 1); | |
} catch (e) { | |
if (e == 'rethrow me') throw e; | |
return 'Caught: ' + e; |
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
<!-- | |
Widget build() { | |
return new Scaffold( | |
toolbar: buildToolBar(), | |
body: buildBody() | |
); | |
} | |
}--> | |
<paper-scaffold> | |
<paper-header-panel> |
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
/** | |
* Gets a property descriptor for a target instance, skipping its class | |
* and walking up the super-classes hierarchy. | |
* | |
* @private | |
* @param {!Object} target | |
* @param {!string} name | |
* @return {!Object.<ObjectPropertyDescriptor>|undefined} | |
*/ | |
$jscomp.getSuperPropertyDescriptor_ = function(target, name) { |
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
<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/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.nativelibs4java</groupId> | |
<artifactId>javacl-tutorial</artifactId> | |
<name>JavaCL Tutorial</name> | |
<url>http://code.google.com/p/javacl/</url> | |
<version>1.0-beta-6</version> | |
<packaging>jar</packaging> |
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
// Enable double-precision floating point numbers support. | |
// Not all platforms / devices support this, so you may have to switch to floats. | |
#pragma OPENCL EXTENSION cl_khr_fp64 : enable | |
__kernel void dft( | |
__global const double2 *in, // complex values input | |
__global double2 *out, // complex values output | |
int length, // number of input and output values | |
int sign) // sign modifier in the exponential : | |
// 1 for forward transform, -1 for backward. |
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
void dft( | |
const double *in, // complex values input (packed real and imaginary) | |
double *out, // complex values output | |
int length, // number of input and output values | |
int sign) // sign modifier in the exponential : | |
// 1 for forward transform, -1 for backward. | |
{ | |
for (int i = 0; i < length; i++) | |
{ | |
// Initialize sum and inner arguments |
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 tutorial; | |
import com.nativelibs4java.opencl.*; | |
import java.io.IOException; | |
/// Auto-generated wrapper around the OpenCL program DiscreteFourierTransformProgram.cl | |
public class DiscreteFourierTransformProgram extends CLAbstractUserProgram { | |
public DiscreteFourierTransformProgram(CLContext context) throws IOException { | |
super(context, readRawSourceForClass(DiscreteFourierTransformProgram.class)); | |
} | |
public DiscreteFourierTransformProgram(CLProgram program) throws IOException { |
OlderNewer