commit stringlengths 40 40 | old_file stringlengths 4 264 | new_file stringlengths 4 264 | old_contents stringlengths 0 4.24k | new_contents stringlengths 1 5.44k | subject stringlengths 14 778 | message stringlengths 15 9.92k | lang stringclasses 277
values | license stringclasses 13
values | repos stringlengths 5 127k |
|---|---|---|---|---|---|---|---|---|---|
ede51d29e908f124e5c89a297f706784755f44d7 | data/haxademic/shaders/filters/mirror-quad.glsl | data/haxademic/shaders/filters/mirror-quad.glsl | // by cacheflowe
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
#define PROCESSING_TEXTURE_SHADER
uniform sampler2D texture;
uniform sampler2D textureDupe; // uv multiplication gets weird and buggy on original texture
varying vec4 vertColor;
varying vec4 vertTexCoord;
uniform float ... | // by cacheflowe
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
#define PROCESSING_TEXTURE_SHADER
uniform sampler2D texture;
uniform sampler2D textureDupe; // uv multiplication gets weird and buggy on original texture
varying vec4 vertColor;
varying vec4 vertTexCoord;
uniform float ... | Fix mirror quad filter offset | Fix mirror quad filter offset | GLSL | mit | cacheflowe/haxademic,cacheflowe/haxademic,cacheflowe/haxademic,cacheflowe/haxademic,cacheflowe/haxademic,cacheflowe/haxademic |
c3cb2134971873248971644b447c7ff8e2ac3d98 | src/main/resources/shader/camera.frag | src/main/resources/shader/camera.frag | #version 330
varying vec2 texCoord;
uniform sampler2D texture;
void main() {
gl_FragColor = texture(texture, texCoord);
}
| #version 330
varying vec2 texCoord;
uniform sampler2D texture;
void main() {
gl_FragColor = texture2D(texture, texCoord);
}
| Fix fragment shader on AMD/NVIDIA cards | Fix fragment shader on AMD/NVIDIA cards
| GLSL | mit | caseif/Cubic |
37944572389464400a1d67d993157ddfe9826c3c | UIFXKit/effects/ripple/ripple_shader.frag | UIFXKit/effects/ripple/ripple_shader.frag | uniform sampler2D uTexture;
varying highp vec3 vFragPosition;
varying mediump vec2 vFragTextureCoords;
uniform highp vec3 uRippleOrigin;
uniform highp float uRippleRadius;
#define kFrequency .05
#define kMaxAmplitude .02
mediump vec2 modulateUVAlongAxis(in mediump vec2 uv, in highp vec2 axis, in highp float modula... | uniform sampler2D uTexture;
varying highp vec3 vFragPosition;
varying mediump vec2 vFragTextureCoords;
uniform highp vec3 uRippleOrigin;
uniform highp float uRippleRadius;
#define kFrequency .05
#define kMaxAmplitude .02
mediump vec2 modulateUVAlongAxis(in mediump vec2 uv, in highp vec2 axis, in highp float modula... | Make ripple emanate from the ripple origin | Make ripple emanate from the ripple origin
Fragments outside the ripple radius are unmodulated, fragments inside
are modulated like a wave.
| GLSL | mit | Tylerc230/UIFXKit |
fe3107487736de495c0261ebbac0067c957a0496 | Plugins/AO/Shader/ALCHEMY.kernel.glsl | Plugins/AO/Shader/ALCHEMY.kernel.glsl |
/*
ALCHEMY AO
Projects random points to screen space, and uses the average unoccluded vector
to approximate AO.
*/
const int num_samples = GET_SETTING(AO, alchemy_num_samples);
float max_dist = GET_SETTING(AO, alchemy_max_distance) ;
float accum = 0.0;
float accum_count = 0;
for (int i = 0; i < num_samples; ++i)... |
/*
ALCHEMY AO
Projects random points to screen space, and uses the average unoccluded vector
to approximate AO.
*/
const int num_samples = GET_SETTING(AO, alchemy_num_samples);
float max_dist = GET_SETTING(AO, alchemy_max_distance) ;
float accum = 0.0;
float accum_count = 0;
for (int i = 0; i < num_samples; ++i)... | Add missing divide to the alchemy AO | Add missing divide to the alchemy AO
| GLSL | mit | croxis/SpaceDrive,croxis/SpaceDrive,croxis/SpaceDrive |
728b4d8c5f5fb296b38c9def7336ca558b7ece50 | assets/shaders/Filtering/ToneMapping.glsl | assets/shaders/Filtering/ToneMapping.glsl |
/*
* This file contains functions related to tone mapping.
*/
#ifndef _TONE_MAPPING_GLSL
#define _TONE_MAPPING_GLSL
vec3 simpleReinhardToneMap(in vec3 hdrColor)
{
return (hdrColor / (hdrColor + vec3(1.0)));
}
vec3 uncharted2_ToneMap(in vec3 hdrColor)
{
const float A = 0.15;
const float B = 0.50;
const floa... |
/*
* This file contains functions related to tone mapping.
*/
#ifndef _TONE_MAPPING_GLSL
#define _TONE_MAPPING_GLSL
vec3 simpleReinhardToneMap(in vec3 hdrColor)
{
return (hdrColor / (hdrColor + vec3(1.0)));
}
vec3 uncharted2_ToneMap(in vec3 hdrColor)
{
const float A = 0.15;
const float B = 0.50;
const float C... | Increase the exposure so that it's not so dark | Increase the exposure so that it's not so dark
| GLSL | mit | Shimmen/Rendeer |
a705d65ccd1e204cc0b667df2678cc6921cbd9f5 | tests/function-03.glsl | tests/function-03.glsl | /* PASS */
vec4 foo(float x, float y, float z, float w)
{
vec4 v;
v.x = x;
v.y = y;
v.z = z;
v.w = w;
return v;
}
void main()
{
gl_Position = foo(1.0, 1.0, 1.0, 0.0);
}
| /* PASS */
vec4 foo(in float x, in float y, float z, float w)
{
vec4 v;
v.x = x;
v.y = y;
v.z = z;
v.w = w;
return v;
}
void main()
{
gl_Position = foo(1.0, 1.0, 1.0, 0.0);
}
| Add 'in' to some parameters of the function | Add 'in' to some parameters of the function
This goes along with the qualifier-?? tests.
| GLSL | mit | wolf96/glsl-optimizer,mapbox/glsl-optimizer,djreep81/glsl-optimizer,metora/MesaGLSLCompiler,zz85/glsl-optimizer,mapbox/glsl-optimizer,zeux/glsl-optimizer,djreep81/glsl-optimizer,benaadams/glsl-optimizer,djreep81/glsl-optimizer,jbarczak/glsl-optimizer,bkaradzic/glsl-optimizer,bkaradzic/glsl-optimizer,mapbox/glsl-optimiz... |
230687593a09848d1802b08d3d4d173f2acea28a | Shaders/LightingShader.glsl | Shaders/LightingShader.glsl | uniform vec4 color;
uniform vec2 center;
uniform float radiusNear;
uniform float radiusFar;
uniform sampler2D texture;
void main() {
vec2 pos = gl_TexCoord[0].xy;
vec4 originalColor = texture2D(texture, pos);
float dist = distance(vec2(gl_FragCoord), center);
if (dist > radiusFar) {
gl_FragColor = vec4(or... | uniform vec4 color;
uniform vec2 center;
uniform float radiusNear;
uniform float radiusFar;
uniform sampler2D texture;
void main() {
vec2 pos = gl_TexCoord[0].xy;
vec4 originalColor = texture2D(texture, pos);
float dist = distance(vec2(gl_FragCoord), center);
if (dist > radiusFar) {
gl_FragColor = vec4(or... | Fix lighting shader on Linux (or VMware hosting Linux) | Fix lighting shader on Linux (or VMware hosting Linux)
| GLSL | mit | soulweaver91/project-carrot,soulweaver91/project-carrot |
7cc7c8ee241cbf7c9458927dd94adfa939ab4770 | src/shader/clearHABuffer.frag | src/shader/clearHABuffer.frag | #version 440
#extension GL_NV_gpu_shader5 : enable
coherent uniform
uint64_t *u_Records; // all fragment records (<depth|pointer> pairs)
coherent uniform uint32_t *u_Counts; // auxiliary counters
uniform uint u_NumRecords;
uniform uint u_ScreenSz;
uniform uint u_HashSz;
in vec4 u_Pos;
out vec4 o_Pi... | #version 440
#extension GL_NV_gpu_shader5 : enable
coherent uniform
uint64_t *u_Records; // all fragment records (<depth|pointer> pairs)
coherent uniform uint32_t *u_Counts; // auxiliary counters
uniform uint u_NumRecords;
uniform uint u_ScreenSz;
in vec4 u_Pos;
out vec4 o_PixColor;
void main()
... | Remove unused uniform from clear shader. | Remove unused uniform from clear shader.
| GLSL | mit | Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller |
7af99cd405b117dfe612155364c60ca3c57c7107 | share/glsl/fbrush.glsl | share/glsl/fbrush.glsl | uniform sampler2D tex, pallet;
varying float fwidth, fprogress;
uniform float decay, noise;
void main() {
float dist_from_centre = 2.0f * abs(gl_TexCoord[0].s - 0.5f) / fwidth;
float progress = fprogress*fprogress;
progress -= 0.8f;
progress *= 5.0f;
progress = max(0.0f, progress);
float val = texture2D(t... | uniform sampler2D tex, pallet;
varying float fwidth, fprogress;
uniform float decay, noise;
void main() {
float dist_from_centre = 2.0f * abs(gl_TexCoord[0].s - 0.5f) / fwidth;
float progress = fprogress*fprogress;
progress -= 0.5f;
progress *= 2.0f;
progress = max(0.0f, progress);
float val = texture2D(t... | Remove glbrush colour dependence on dist_from_centre. | Remove glbrush colour dependence on dist_from_centre.
Just caused the pallet to grade out across the brush; we only want that
property to control the "holes" along the side.
| GLSL | bsd-3-clause | AltSysrq/mantigraphia,AltSysrq/mantigraphia |
462b2bf7871d394b1dba7b604853d2cb12fe42a6 | share/glsl/vmanifold.glsl | share/glsl/vmanifold.glsl | /* #include "perspective.glsl" */
uniform float noise_amplitude;
uniform vec2 noise_freq;
varying float scaled_noise_amplitude;
void main() {
vec4 proj;
vec2 texc;
proj = perspective_proj(gl_Vertex);
gl_Position = gl_ModelViewProjectionMatrix * proj;
texc = gl_Vertex.xy / METRE / 4.0f;
texc.s += gl_Vert... | /* #include "perspective.glsl" */
uniform float noise_amplitude;
uniform vec2 noise_freq;
varying float scaled_noise_amplitude;
void main() {
vec4 proj;
vec2 texc;
proj = perspective_proj(gl_Vertex);
gl_Position = gl_ModelViewProjectionMatrix * proj;
texc = gl_Vertex.xy / METRE / 4.0f;
texc.s += gl_Vert... | Improve manifold texture coordinate generation. | Improve manifold texture coordinate generation.
| GLSL | bsd-3-clause | AltSysrq/mantigraphia,AltSysrq/mantigraphia |
e74985c527b2582403e70341ff81e42d30fc97c5 | shaders/light_pass.frag | shaders/light_pass.frag | #version 330
uniform sampler2D positionMap;
uniform sampler2D colorMap;
uniform sampler2D normalMap;
uniform sampler2D depthMap;
uniform vec2 screenSize;
uniform vec3 lightDirection;
out vec4 fragColour;
void main()
{
vec2 TexCoord = gl_FragCoord.xy / screenSize;
vec3 pos = texture(positionMap, TexCoord).xy... | #version 330
uniform sampler2D positionMap;
uniform sampler2D colorMap;
uniform sampler2D normalMap;
uniform sampler2D depthMap;
uniform vec2 screenSize;
uniform vec3 lightDirection;
out vec4 fragColour;
void main()
{
vec2 uv = gl_FragCoord.xy / screenSize;
float depth = texture(depthMap, uv).r;
if(dept... | Discard fragments in the light pass that are not hit in the geometry pass. | Discard fragments in the light pass that are not hit in the geometry pass.
| GLSL | mit | asny/GLEngine |
5f4442262df7e9474beec815f6256940b4aa6101 | Source/Shaders/ModelExperimental/ModelSilhouetteStageFS.glsl | Source/Shaders/ModelExperimental/ModelSilhouetteStageFS.glsl | void silhouetteStage(out vec4 color) {
if(model_silhouettePass) {
color = czm_gammaCorrect(model_silhouetteColor);
}
} | void silhouetteStage(inout vec4 color) {
if(model_silhouettePass) {
color = czm_gammaCorrect(model_silhouetteColor);
}
} | Fix rendering bug on Linux | Fix rendering bug on Linux
| GLSL | apache-2.0 | CesiumGS/cesium,CesiumGS/cesium,CesiumGS/cesium,CesiumGS/cesium,CesiumGS/cesium |
a0af522f9ec233f1a4e2ed6dd025e71b57a31e87 | qt/shaders/texture.fsh | qt/shaders/texture.fsh | uniform sampler2D texture_diff;
uniform sampler2D texture_nrm;
uniform highp vec3 lightDir;
varying highp vec2 texCoord;
varying highp mat3 N;
void main() {
vec3 normal = N * (texture2D(texture_nrm, texCoord).rgb * 2.0 - 1.0);
float light = max(dot(lightDir, normal), 0.0) + 0.2;
gl_FragColor = vec4(ve... | uniform sampler2D texture_diff;
uniform sampler2D texture_nrm;
uniform highp vec3 lightDir;
varying highp vec2 texCoord;
varying highp mat3 N;
void main() {
vec3 normal = N * (texture2D(texture_nrm, texCoord).rgb * 2.0 - 1.0);
float light = max(dot(lightDir, normal), 0.0) + 0.1 + max(0.2 - normal.z * 0.2, ... | Add slight highlight around edges of planets. | Qt: Add slight highlight around edges of planets.
| GLSL | mit | chipgw/planets-3d,chipgw/planets-3d,chipgw/planets-3d,chipgw/planets-3d |
64c01939629c7f8a64f338b6b599c28b5fbaac2b | indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl | indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl | /**
* @file objectSkinV.glsl
*
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
* $License$
*/
#version 120
attribute vec4 object_weight;
uniform mat4 matrixPalette[64];
mat4 getObjectSkinnedTransform()
{
int i;
vec4 w = fract(object_weight);
vec4 index = floor(object_weight);
float scale ... | /**
* @file objectSkinV.glsl
*
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
* $License$
*/
#version 120
attribute vec4 object_weight;
uniform mat4 matrixPalette[32];
mat4 getObjectSkinnedTransform()
{
int i;
vec4 w = fract(object_weight);
vec4 index = floor(object_weight);
float scale ... | Reduce number of potential joints in a rigged mesh to 32 for backwards compatibility with ATI X1950 | Reduce number of potential joints in a rigged mesh to 32 for backwards compatibility with ATI X1950
| GLSL | lgpl-2.1 | gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm |
8ecd00ea3790424bd8018b1e08cc4c76027eab2f | FlexEngine/resources/shaders/vk_sprite.vert | FlexEngine/resources/shaders/vk_sprite.vert | #version 450
layout (push_constant) uniform PushConstants
{
layout (offset = 0) mat4 view;
layout (offset = 64) mat4 proj;
} pushConstants;
layout (binding = 0) uniform UBODynamic
{
mat4 model;
vec4 colorMultiplier;
bool enableAlbedoSampler;
} uboDynamic;
layout (location = 0) in vec3 in_Position;
layout (locat... | #version 450
layout (push_constant) uniform PushConstants
{
layout (offset = 0) mat4 view;
layout (offset = 64) mat4 proj;
} pushConstants;
layout (binding = 0) uniform UBODynamic
{
mat4 model;
vec4 colorMultiplier;
bool enableAlbedoSampler;
} uboDynamic;
layout (location = 0) in vec3 in_Position;
layout (locat... | Fix sprite transformation issue in Vulkan | Fix sprite transformation issue in Vulkan
| GLSL | mit | ajweeks/FlexEngine,ajweeks/FlexEngine,ajweeks/FlexEngine |
b54477036d16d3e1b23934d7953cf0171fd9bc26 | renderdoc/data/glsl/trisize.frag | renderdoc/data/glsl/trisize.frag | /******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2015-2018 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* ... | /******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2015-2018 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* ... | Fix fragment shader compile error | Fix fragment shader compile error
OpenGL ES does not allow swizzles on scalar expressions. It causes error when replaying OpenGL ES desktop application.
| GLSL | mit | baldurk/renderdoc,googlestadia/renderdoc,googlestadia/renderdoc,Zorro666/renderdoc,TurtleRockStudios/renderdoc_public,Zorro666/renderdoc,Zorro666/renderdoc,Zorro666/renderdoc,Zorro666/renderdoc,TurtleRockStudios/renderdoc_public,googlestadia/renderdoc,googlestadia/renderdoc,TurtleRockStudios/renderdoc_public,googlestad... |
321175bfeb68ba881cf5483853f71300e179e118 | Source/Shaders/OctahedralProjectionFS.glsl | Source/Shaders/OctahedralProjectionFS.glsl | varying vec3 v_cubeMapCoordinates;
uniform samplerCube cubeMap;
void main()
{
vec4 rgbm = textureCube(cubeMap, v_cubeMapCoordinates);
float m = rgbm.a * 49.0;
vec3 r = rgbm.rgb * m;
gl_FragColor = vec4(r, 1.0);
}
| varying vec3 v_cubeMapCoordinates;
uniform samplerCube cubeMap;
void main()
{
vec4 rgbm = textureCube(cubeMap, v_cubeMapCoordinates);
float m = rgbm.a * 16.0;
vec3 r = rgbm.rgb * m;
gl_FragColor = vec4(r * r, 1.0);
}
| Fix decoding for RGBM textures which is different for the tool used than the paper. | Fix decoding for RGBM textures which is different for the tool used than the paper.
| GLSL | apache-2.0 | AnalyticalGraphicsInc/cesium,progsung/cesium,CesiumGS/cesium,josh-bernstein/cesium,josh-bernstein/cesium,YonatanKra/cesium,likangning93/cesium,hodbauer/cesium,soceur/cesium,likangning93/cesium,AnalyticalGraphicsInc/cesium,geoscan/cesium,hodbauer/cesium,CesiumGS/cesium,likangning93/cesium,YonatanKra/cesium,likangning93/... |
72edb25bae75de5c2397c709485422d3d35a60c0 | Source/Shaders/BillboardCollectionFS.glsl | Source/Shaders/BillboardCollectionFS.glsl | uniform sampler2D u_atlas;
varying vec2 v_textureCoordinates;
#ifdef RENDER_FOR_PICK
varying vec4 v_pickColor;
#else
varying vec4 v_color;
#endif
void main()
{
#ifdef RENDER_FOR_PICK
gl_FragColor = v_pickColor;
#else
gl_FragColor = texture2D(u_atlas, v_textureCoordinates) * v_color;
#endif
} | uniform sampler2D u_atlas;
varying vec2 v_textureCoordinates;
#ifdef RENDER_FOR_PICK
varying vec4 v_pickColor;
#else
varying vec4 v_color;
#endif
void main()
{
#ifdef RENDER_FOR_PICK
vec4 vertexColor = vec4(1.0, 1.0, 1.0, 1.0);
#else
vec4 vertexColor = v_color;
#endif
vec4 color = texture2D(u_atlas,... | Discard fragments with an alpha of 0. | Discard fragments with an alpha of 0.
| GLSL | apache-2.0 | jason-crow/cesium,esraerik/cesium,kiselev-dv/cesium,AnalyticalGraphicsInc/cesium,jasonbeverage/cesium,soceur/cesium,YonatanKra/cesium,wallw-bits/cesium,esraerik/cesium,denverpierce/cesium,emackey/cesium,likangning93/cesium,jason-crow/cesium,denverpierce/cesium,AnimatedRNG/cesium,CesiumGS/cesium,ggetz/cesium,oterral/ces... |
7150cdc025b468b08d8c972a924bf142482191a3 | src/filters/noise/noise.frag | src/filters/noise/noise.frag | precision mediump float;
varying vec2 vTextureCoord;
varying vec4 vColor;
uniform float noise;
uniform sampler2D uSampler;
float rand(vec2 co)
{
return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);
}
void main()
{
vec4 color = texture2D(uSampler, vTextureCoord);
float diff = (rand(vTextur... | precision highp float;
varying vec2 vTextureCoord;
varying vec4 vColor;
uniform float noise;
uniform sampler2D uSampler;
float rand(vec2 co)
{
return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);
}
void main()
{
vec4 color = texture2D(uSampler, vTextureCoord);
float diff = (rand(vTextureC... | Fix a display bug on iOS | Fix a display bug on iOS
| GLSL | mit | leonardo-silva/pixi.js,Boycce/pixi.js,endel/pixi.js,englercj/pixi.js,lucap86/pixi.js,drkibitz/pixi.js,Cristy94/pixi.js,out-of-band/pixi.js,themoonrat/pixi.js,SpringRoll/pixi.js,themoonrat/pixi.js,lucap86/pixi.js,wayfu/pixi.js,out-of-band/pixi.js,curtiszimmerman/pixi.js,tobireif/pixi.js,curtiszimmerman/pixi.js,sokeroner... |
99a89ab8447490d4e147115e9906c067d65fb0bd | indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl | indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl | /**
* @file fullbrightF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
#extension GL_ARB_texture_rectangle : enable
vec3 fullbrightAtmosTransport(vec3 light);
vec3 fullbrightScaleSoftClip(vec3 light);
void main()
{
float shadow = 1.0;
vec4 color = diffuseLookup(gl_TexCoord... | /**
* @file fullbrightF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
#extension GL_ARB_texture_rectangle : enable
vec3 fullbrightAtmosTransport(vec3 light);
vec3 fullbrightScaleSoftClip(vec3 light);
void main()
{
float shadow = 1.0;
vec4 color = diffuseLookup(gl_TexCoord... | Fix for accidental checkin of hot pink fullbright. | Fix for accidental checkin of hot pink fullbright.
| GLSL | lgpl-2.1 | gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm,gabeharms/firestorm |
c941c6b67d383835d2eabccbc59b5838e47ef371 | Assets/Shaders/Blit.shader | Assets/Shaders/Blit.shader | Shader "Hidden/MRT Blit"
{
Properties
{
}
CGINCLUDE
struct Input
{
float4 vertex : POSITION;
};
struct Varyings
{
float4 vertex : SV_POSITION;
float2 uv : TEXCOORD0;
};
struct Output
{
float4 first : SV_Target0;
float4 second : S... | Shader "Hidden/MRT Blit"
{
Properties
{
}
CGINCLUDE
struct Input
{
float4 vertex : POSITION;
};
struct Varyings
{
float4 vertex : SV_POSITION;
float2 uv : TEXCOORD0;
};
struct Output
{
float4 first : SV_Target0;
float4 second : S... | Handle flipped UVs in MRT blit | Handle flipped UVs in MRT blit
| GLSL | mit | gokselgoktas/temporal-anti-aliasing |
d51466340c521eddbe8faa51556373682004724d | res/quad.fs.glsl | res/quad.fs.glsl | #ifdef GL_ES
precision mediump float;
#endif
uniform sampler2D sDiffuse;
uniform sampler2D sMask;
varying vec2 vColorTexCoord;
varying vec2 vMaskTexCoord;
varying vec4 vColor;
void main(void)
{
vec4 diffuse = texture2D(sDiffuse, vColorTexCoord);
vec4 mask = vec4(1.0, 1.0, 1.0, texture2D(sMask, vMaskTexCoord).r... | #ifdef GL_ES
precision mediump float;
#endif
uniform sampler2D sDiffuse;
uniform sampler2D sMask;
varying vec2 vColorTexCoord;
varying vec2 vMaskTexCoord;
varying vec4 vColor;
void main(void)
{
vec4 diffuse = texture2D(sDiffuse, vColorTexCoord);
#ifdef PLATFORM_ANDROID
vec4 mask = vec4(1.0, 1.0, 1.0, textur... | Fix alpha mask on android | Fix alpha mask on android
| GLSL | mpl-2.0 | servo/webrender,servo/webrender,servo/webrender,servo/webrender,alanamramjit/webrender,servo/webrender,servo/webrender,alanamramjit/webrender |
75b16520ffd627588748b43fae20195597bc9d7b | data/shader/color.inc.glsl | data/shader/color.inc.glsl | // Common FS routines for evaluating terrain color.
//uniform sampler2DArray t_Height;
// This texture has a layer per terrain type. First row is `lightCLR`, second in `palCLR`.
uniform sampler2DArray t_Table;
// corresponds to SDL palette
uniform sampler1D t_Palette;
const float c_HorFactor = 0.5; //H_CORRECTION
ve... | // Common FS routines for evaluating terrain color.
//TODO: provide only minimum information to
// reconstruct the lighting model in shader code.
//uniform sampler2DArray t_Height;
// This texture has a layer per terrain type. First row is `lightCLR`, second in `palCLR`.
uniform sampler2DArray t_Table;
// corresponds... | Fix color table level selector | Fix color table level selector
| GLSL | apache-2.0 | kvark/vange-rs |
31d51e0bc371f58ff31fa6e232026cfaac6e813d | webrender/res/ps_text_run.fs.glsl | webrender/res/ps_text_run.fs.glsl | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
void main(void) {
float a = texture(sDiffuse, vUv).a;
oFragColor = vec4(vColor.rgb, vColor.a * a);
}
| /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
void main(void) {
float a = texture(sDiffuse, vUv).a;
#ifdef WR_FEATURE_TRANSFORM
float alpha = 0.0;
i... | Add proper transform support for text run shader. | Add proper transform support for text run shader.
| GLSL | mpl-2.0 | servo/webrender,servo/webrender,servo/webrender,servo/webrender,servo/webrender,servo/webrender |
ff8ad64f68fb7fcad26ddd26d1ded05fe75a3c83 | Assets/Materials/Model/Gradient.shader | Assets/Materials/Model/Gradient.shader | Shader "Custom/Gradient"
{
Properties {
_Palette ("Texture", 2D) = "white" { }
}
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
sampler2D _Palette;
struct vertInput {
float4 pos : POSIT... | Shader "Custom/Gradient"
{
Properties {
_Palette ("Texture", 2D) = "white" { }
}
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
sampler2D _Palette;
struct vertInput {
float4 pos : POSIT... | Fix gradient material projection issues | Fix gradient material projection issues
| GLSL | mit | tigrouind/AITD-roomviewer |
017208f3d1d4effc4ccba539dc7f212f135ffab4 | src/renderers/shaders/ShaderLib/cube_frag.glsl | src/renderers/shaders/ShaderLib/cube_frag.glsl | uniform samplerCube tCube;
uniform float tFlip;
uniform float opacity;
varying vec3 vWorldDirection;
void main() {
gl_FragColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
gl_FragColor.a *= opacity;
}
| uniform samplerCube tCube;
uniform float tFlip;
uniform float opacity;
varying vec3 vWorldDirection;
void main() {
vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
gl_FragColor = envMapTexelToLinear( texColor );
gl_FragColor.a *= opacity;
#include <tonemapping_fragme... | Support decoding, tonemapping, and output encoding | Support decoding, tonemapping, and output encoding
| GLSL | mit | cadenasgmbh/three.js,jpweeks/three.js,hsimpson/three.js,looeee/three.js,WestLangley/three.js,Amritesh/three.js,framelab/three.js,Samsy/three.js,cadenasgmbh/three.js,framelab/three.js,Itee/three.js,fernandojsg/three.js,aardgoose/three.js,aardgoose/three.js,06wj/three.js,Samsy/three.js,greggman/three.js,QingchaoHu/three.... |
ad260431ee6c0c7aafac1e4f3f9e220f10dd347b | glsl/color.frag | glsl/color.frag | precision mediump float;
varying vec2 coord;
uniform vec2 verts[%%MAX%%];
uniform vec3 colors[%%MAX%%];
uniform vec2 size;
void main() {
float dist = 1e20, color = 0.0;
vec3 color = vec3(1.0, 0.0, 0.0);
for (int i = 0; i < %%MAX%%; i++) {
float newdist = distance(verts[i] * size, coord * size);
... | precision mediump float;
varying vec2 coord;
uniform vec2 verts[%%MAX%%];
uniform vec3 colors[%%MAX%%];
uniform vec2 size;
void main() {
float dist = 1e10;
vec3 color = vec3(1.0, 0.0, 0.0);
for (int i = 0; i < %%MAX%%; i++) {
float newdist = distance(verts[i] * size, coord * size);
if (ne... | Reduce "infinity" size to work around Radeon bug. | Reduce "infinity" size to work around Radeon bug.
| GLSL | unlicense | skeeto/voronoi-toy,skeeto/voronoi-toy,skeeto/voronoi-toy,skeeto/voronoi-toy |
f60f375b374dd2f12b6b65565a3bd1eea55f4ddf | GVRf/Framework/framework/src/main/res/raw/yuv_nv21_to_rgb.fsh | GVRf/Framework/framework/src/main/res/raw/yuv_nv21_to_rgb.fsh | precision highp float;
in vec2 diffuse_coord;
#ifdef VULKAN
layout (set = 0, binding = 0)
#endif
uniform sampler2D y_texture;
#ifdef VULKAN
layout (set = 0, binding = 1)
#endif
uniform sampler2D uv_texture;
out vec4 fragColor;
void main (void) {
float r, g, b, y, u, v;
y = texture(y_texture, v_texCoord).r;
vec... | precision highp float;
in vec2 diffuse_coord;
#ifdef VULKAN
layout (set = 0, binding = 4)
#endif
uniform sampler2D y_texture;
#ifdef VULKAN
layout (set = 0, binding = 5)
#endif
uniform sampler2D uv_texture;
out vec4 fragColor;
void main (void) {
float r, g, b, y, u, v;
y = texture(y_texture, v_texCoord).r;
vec... | Adjust bindings: start counting from 4 | Adjust bindings: start counting from 4
| GLSL | apache-2.0 | thomasflynn/GearVRf,NolaDonato/GearVRf,Samsung/GearVRf,xcaostagit/GearVRf,Samsung/GearVRf,xcaostagit/GearVRf,thomasflynn/GearVRf,Samsung/GearVRf,NolaDonato/GearVRf,Samsung/GearVRf,xcaostagit/GearVRf,roshanch/GearVRf,thomasflynn/GearVRf,thomasflynn/GearVRf,NolaDonato/GearVRf,roshanch/GearVRf,thomasflynn/GearVRf,roshanch... |
c794aa44b58f7398be8de58c6051a20722318e90 | source/FAST/Visualization/SegmentationPyramidRenderer/SegmentationPyramidRenderer.frag | source/FAST/Visualization/SegmentationPyramidRenderer/SegmentationPyramidRenderer.frag | #version 330 core
layout (std140) uniform Colors {
vec4 color[256];
};
out vec4 FragColor;
in vec2 TexCoord;
uniform usampler2D ourTexture;
uniform float opacity;
void main()
{
uint in_label = texture(ourTexture, vec2(TexCoord.x, 1.0 - TexCoord.y)).r;
FragColor = in_label < uint(256) && in_label > uint(0... | #version 330 core
layout (std140) uniform Colors {
vec4 color[256];
};
out vec4 FragColor;
in vec2 TexCoord;
uniform usampler2D ourTexture;
uniform float opacity;
void main()
{
uint in_label = texture(ourTexture, vec2(TexCoord.x, TexCoord.y)).r;
FragColor = in_label < uint(256) && in_label > uint(0) ? co... | Fix bug segmentation pyramid renderer drawing segmentation incorrectly | Fix bug segmentation pyramid renderer drawing segmentation incorrectly
| GLSL | bsd-2-clause | smistad/FAST,smistad/FAST,smistad/FAST |
b587114cccdbf502e2760da0a301dffcaa160acd | src/fragment.glsl | src/fragment.glsl | precision highp float;
// a.xy = resolution
// a.z = time
// a.w = fade
uniform vec4 a;
// b.x = 1
// b.y = kick drum volume
// b.z = t>>19
uniform vec4 b;
void main() {
// ray marcher temp result
vec3 e = b.xxx,
cu = -e + sin(a.z + b.z),
// ray direction
rd = (gl_FragCoord.xyz - a.xyz) * a.z / a.x + cu;
... | precision highp float;
// a.xy = resolution
// a.z = time
// a.w = fade
uniform vec4 a;
// b.x = 1
// b.y = kick drum volume
// b.z = t>>19
uniform vec4 b;
void main() {
// ray marcher temp result
vec3 e = b.xxx,
cu = -e + sin(a.z + b.z),
// ray direction
rd = (gl_FragCoord.xyz - a.xyz) * a.z / a.x + cu;
... | Adjust alpha according to hit distance | Adjust alpha according to hit distance
| GLSL | mit | FruitieX/1k-webgl,FruitieX/1k-webgl,FruitieX/1k-webgl |
15f6e471bb263768bb08a44c3dbf4ea2b6a99edd | src/quick/scenegraph/shaders/visualization.vert | src/quick/scenegraph/shaders/visualization.vert | attribute highp vec4 v;
uniform highp mat4 matrix;
uniform highp mat4 rotation;
// w -> apply 3d rotation and projection
uniform lowp vec4 tweak;
varying mediump vec2 pos;
void main()
{
vec4 p = matrix * v;
if (tweak.w > 0.0) {
vec4 proj = rotation * p;
gl_Position = vec4(proj.x, proj.y, 0, ... | attribute highp vec4 v;
uniform highp mat4 matrix;
uniform highp mat4 rotation;
// w -> apply 3d rotation and projection
uniform mediump vec4 tweak;
varying mediump vec2 pos;
void main()
{
vec4 p = matrix * v;
if (tweak.w > 0.0) {
vec4 proj = rotation * p;
gl_Position = vec4(proj.x, proj.y, ... | Use the correct precision specifier in visualizer GLSL. | Use the correct precision specifier in visualizer GLSL.
Task-number: QTBUG-39119
Change-Id: I0ec4909167f5694ce4229df8202c89742be21d0a
Reviewed-by: Laszlo Agocs <00c05606d635b5d8e1450a8536e4e2809abe4e80@digia.com>
Reviewed-by: Andrew Knight <ccebd4d9fbda4a2105d17b207d80666fa00da2e1@digia.com>
| GLSL | lgpl-2.1 | matthewvogt/qtdeclarative,matthewvogt/qtdeclarative,matthewvogt/qtdeclarative,matthewvogt/qtdeclarative,matthewvogt/qtdeclarative,matthewvogt/qtdeclarative,matthewvogt/qtdeclarative,matthewvogt/qtdeclarative |
935279329515c9d9919b8a99774153b9d840dcd9 | dev-resources/SimpleShader.glsl | dev-resources/SimpleShader.glsl | uniform vec4 ambient_color;
uniform float ambient_intensity;
void main(void)
{
gl_FragColor = ambient_color * ambient_intensity/2.0;
} | #ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
#define PROCESSING_TEXTURE_SHADER
uniform sampler2D texture;
uniform vec2 texOffset;
varying vec4 vertColor;
varying vec4 vertTexCoord;
const vec4 lumcoeff = vec4(0.299, 0.587, 0.114, 0);
void main() {
vec2 tc0 = vertTexCoord.st + vec2(-texOffse... | Update shader for tests to make obvious when it works. It's edge-detection shader and should draw borders around edges. | Update shader for tests to make obvious when it works. It's edge-detection shader and should draw borders around edges.
| GLSL | epl-1.0 | quil/quil |
f9190b50facf283faeb25fb77798ceb60b4b5ae8 | src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl | src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl | PhysicalMaterial material;
#ifdef STANDARD_SG
material.diffuseColor = diffuseColor.rgb;
material.specularRoughness = clamp( 1.0 - glossinessFactor, 0.04, 1.0 );
material.specularColor = specular2Factor.rgb;
#else
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
material.specularRoughness = cl... | PhysicalMaterial material;
#ifdef STANDARD_SG
material.diffuseColor = diffuseColor.rgb * ( 1.0 - max( max( specular2Factor.r, specular2Factor.g ), specular2Factor.b ) );
material.specularRoughness = clamp( 1.0 - glossinessFactor, 0.04, 1.0 );
material.specularColor = specular2Factor.rgb;
#else
material.diffuseColo... | Revert "Fix diffuse shader code of Specular-Glossiness" | Revert "Fix diffuse shader code of Specular-Glossiness"
This reverts commit 8360b532643264f817e9d648b72e43c20f111ba5.
| GLSL | mit | Mugen87/three.js,SpinVR/three.js,sherousee/three.js,cadenasgmbh/three.js,matgr1/three.js,spite/three.js,Samsy/three.js,framelab/three.js,Hectate/three.js,ndebeiss/three.js,jpweeks/three.js,opensim-org/three.js,ndebeiss/three.js,WestLangley/three.js,rfm1201/rfm.three.js,brianchirls/three.js,carlosanunes/three.js,sttz/th... |
0fcf8c53fcc48dd1c081b7d9a211770322aa84e2 | Source/Shaders/Appearances/PerInstanceColorAppearanceFS.glsl | Source/Shaders/Appearances/PerInstanceColorAppearanceFS.glsl | varying vec3 v_positionEC;
varying vec3 v_normalEC;
varying vec4 v_color;
void main()
{
vec3 positionToEyeEC = -v_positionEC;
vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif
czm_materialInput materialInput;
materi... | varying vec3 v_positionEC;
varying vec3 v_normalEC;
varying vec4 v_color;
void main()
{
vec3 positionToEyeEC = -v_positionEC;
vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif
czm_materialInput materialInput;
materi... | Fix gamma correction for PerInstanceColorAppearance. | Fix gamma correction for PerInstanceColorAppearance.
| GLSL | apache-2.0 | josh-bernstein/cesium,josh-bernstein/cesium,CesiumGS/cesium,likangning93/cesium,CesiumGS/cesium,CesiumGS/cesium,kaktus40/cesium,hodbauer/cesium,likangning93/cesium,progsung/cesium,soceur/cesium,YonatanKra/cesium,jasonbeverage/cesium,CesiumGS/cesium,geoscan/cesium,YonatanKra/cesium,soceur/cesium,hodbauer/cesium,jasonbev... |
f8eae8dd8ca89374c2e2756d03188cda4eca4114 | src/shader/clearHABuffer.frag | src/shader/clearHABuffer.frag | #version 440
#extension GL_NV_gpu_shader5 : enable
coherent uniform
uint64_t *records; // all fragment records (<depth|pointer> pairs)
coherent uniform uint32_t *counters; // auxiliary counters
uniform uint tableElementCount;
uniform uint screenSize;
void main()
{
// Ignore helper pixels
if (g... | #version 440
#extension GL_NV_gpu_shader5 : enable
coherent uniform
uint64_t *records; // all fragment records (<depth|pointer> pairs)
coherent uniform uint32_t *counters; // auxiliary counters
uniform uint tableElementCount;
uniform uint screenSize;
void main()
{
uvec2 ij = uvec2(gl_FragCoord.xy... | Remove gl_SamleMaskIn useage in clear shader. | Remove gl_SamleMaskIn useage in clear shader.
| GLSL | mit | Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller |
a25dd2f69496c85f2514498bf714697c9a9c2ce6 | EVSL_1.0/TESTS/Landos/testerG.gnuplot | EVSL_1.0/TESTS/Landos/testerG.gnuplot | set term post enh # enhanced PostScript, essentially PostScript
# with bounding boxes
set out 'testerG.eps' # output file
set title "LanDos Test -- comparison with exact histogram"
set xlabel '{/Symbol l}'
set ylabel 'Spectral Density (DOS)'
set xrange[0:.05]
set yrange[0:300]
set parametric
... | set term post enh # enhanced PostScript, essentially PostScript
# with bounding boxes
set out 'testerG.eps' # output file
set title "LanDos Test -- comparison with exact histogram"
set xlabel '{/Symbol l}'
set ylabel 'Spectral Density (DOS)'
set parametric
plot 'OUT/myydosG.txt' lt rgb "red"... | Allow gnuplot to set axis in Landos tests | Allow gnuplot to set axis in Landos tests
| Gnuplot | lgpl-2.1 | eigs/EVSL,eigs/EVSL,eigs/EVSL |
e2d9b0afe334933e756670bfe1d37e3cdcd2f460 | rust-showcase/plots/brightness.gp | rust-showcase/plots/brightness.gp | set datafile separator ','
set key top left
set terminal pngcairo size 750,560
set output "../assets/brightness.png"
plot [2905:2985] "../assets/brightness.csv" using 1:2 title "Background", "../assets/brightness.csv" using 1:3 title "No background" | set datafile separator ','
set key top left
set terminal pngcairo size 750,560
bg_color = "dark-violet"
nobg_color = "forest-green"
set output "../assets/brightness-both.png"
plot [2905:2985] "../assets/brightness.csv" using 1:2 title "Background" linecolor bg_color, "../assets/brightness.csv" using 1:3 title "No bac... | Create multiple plots in one script | Create multiple plots in one script
| Gnuplot | mit | fifth-postulate/finding-the-planets,fifth-postulate/finding-the-planets,fifth-postulate/finding-the-planets |
f1e7b50f16196861a3af3ba7380a120eb0039c1a | analysis/graph.plt | analysis/graph.plt | #Expects data to be in data.csv
# Unfortunately, we can't read from the pipe becuase we need to read from the file twice :-(
set datafile separator ","
#0 is a special column that starts from 0 and increments by 1 for each row.
plot 'data.csv' using 0:3 title "Markov Difficulties" with boxes, \
'data.csv' using 0:2 ti... | #Expects data to be in data.csv
# Unfortunately, we can't read from the pipe becuase we need to read from the file twice :-(
set datafile separator ","
set logscale y
#0 is a special column that starts from 0 and increments by 1 for each row.
plot 'data.csv' using 0:3title "Markov Difficulties" with boxes, \
'data.cs... | Use a logscale for the markov difficulties, to correct for their natural exponential nature. | Use a logscale for the markov difficulties, to correct for their natural exponential nature.
| Gnuplot | apache-2.0 | jkomoros/sudoku,jkomoros/sudoku,jkomoros/sudoku |
4ea03b4e12f9af083b8fc20f1b77f1b23989df31 | NightlyTest.gnuplot | NightlyTest.gnuplot | set terminal png
##------- Plot small Date vs LOC ----
set output "running_loc.png"
set xlabel "Date" "TimesRoman,24"
set ylabel "Lines of Code" "TimesRoman,24"
set xdata time
set timefmt "%Y-%m-%d:"
set format x "%b %m, %Y"
## Various labels for the graph
set label "Removed\ndummy\nfunction" at "2003-07-30:", 150000... | set terminal png
##------- Plot small Date vs LOC ----
set output "running_loc.png"
set xlabel "Date" "TimesRoman,24"
set ylabel "Lines of Code" "TimesRoman,24"
set xdata time
set timefmt "%Y-%m-%d:"
set format x "%b %d, %Y"
## Various labels for the graph
set label "Removed\ndummy\nfunction" at "2003-07-30:", 150000... | Fix bug where we printed the month number instead of the day number *blush* | Fix bug where we printed the month number instead of the day number *blush*
git-svn-id: a4a6f32337ebd29ad4763b423022f00f68d1c7b7@7980 91177308-0d34-0410-b5e6-96231b3b80d8
| Gnuplot | bsd-3-clause | lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx |
4a7815b889fd3cf11cc423871571f205914310b1 | EVSL_1.0/TESTS/Landos/testerG.gnuplot | EVSL_1.0/TESTS/Landos/testerG.gnuplot | set term post enh # enhanced PostScript, essentially PostScript
# with bounding boxes
set out 'testerG.eps' # output file
set title "LanDos Test -- comparison with exact histogram"
set xlabel '{/Symbol l}'
set ylabel 'Spectral Density (DOS)'
set parametric
plot 'OUT/myydosG.txt' lt rgb "red"... | set term post enhanced color landscape # enhanced PostScript, essentially PostScript
# with bounding boxes
set out 'testerG.eps' # output file
set title "LanDos Test -- comparison with exact histogram"
set xlabel '{/Symbol l}'
set ylabel 'Spectral Density (DOS)'
set parametric
plot 'OUT/myyd... | Improve gnuplot for the general problem | Improve gnuplot for the general problem
| Gnuplot | lgpl-2.1 | eigs/EVSL,eigs/EVSL,eigs/EVSL |
d230fb302716123c7c98be487820814d9bedcb4f | averages.gnuplot | averages.gnuplot | set terminal 'pngcairo' size 1920, 1080
set output 'averages.png'
set datafile separator ','
set title 'Average response time versus concurrency level'
set xlabel 'Concurrency level (number of simultaneous users)'
set ylabel 'Average response time (ms.)'
set style line 1 lc rgb '#0060ad' lt 1 lw 2 pt 7 pi -1 ps 1.5
set... | set terminal 'pngcairo' size 1920, 1080
set output 'averages.png'
set datafile separator ','
set title 'Average response time versus concurrency level'
set xlabel 'Concurrency level (number of simultaneous users)'
set ylabel 'Average response time (ms.)'
set style line 1 lc rgb '#0060ad' lt 1 lw 2 pt 7 pi -1 ps 1.5
set... | Mark graph with lines at 60 and 120 concurrent. | [FEATURE] Mark graph with lines at 60 and 120 concurrent.
| Gnuplot | bsd-3-clause | bvdwiel/loadtest,bvdwiel/loadtest |
7e634a57c62d380cc5f5e28264a101ca6dd4b8ba | test/scripts/runtime.gp | test/scripts/runtime.gp | reset
set ylabel 'time(sec)'
set style fill solid
set title 'perfomance comparison'
set term png enhanced font 'Verdana,10'
set output 'runtime.png'
plot [:][:80]'output.txt' using 2:xtic(1) with histogram title 'original', \
'' using ($0-0.2):($2+4):2 with labels title ' ', \
'' using 3:xtic(1) with histogram title '... | reset
set ylabel 'time(sec)'
set style fill solid
set title 'perfomance comparison'
set term png enhanced font 'Verdana,10'
set output 'runtime1.png'
plot [:][:0.0005]'output.txt' using 2:xtic(1) with histogram title 'original', \
'' using 3:xtic(1) with histogram title 'optimized' , \
'' using 4:xtic(1) with histogr... | Modify gnuplot script, rearrange scales and text color | Modify gnuplot script, rearrange scales and text color
| Gnuplot | mit | sysprog-Concurrent-BTree/bplus-tree,sysprog-Concurrent-BTree/bplus-tree,sysprog-Concurrent-BTree/bplus-tree |
fdaac9e23e71cc9713536a94bbd1ddd7a989e91d | utils/NightlyTest.gnuplot | utils/NightlyTest.gnuplot | set terminal png
##------- Plot small Date vs LOC ----
set output "running_loc.png"
set xlabel "Date" "TimesRoman,24"
set ylabel "Lines of Code" "TimesRoman,24"
set xdata time
set timefmt "%Y-%m-%d:"
set format x "%b %m, %Y"
## Various labels for the graph
set label "Removed\ndummy\nfunction" at "2003-07-30:", 150000... | set terminal png
##------- Plot small Date vs LOC ----
set output "running_loc.png"
set xlabel "Date" "TimesRoman,24"
set ylabel "Lines of Code" "TimesRoman,24"
set xdata time
set timefmt "%Y-%m-%d:"
set format x "%b %d, %Y"
## Various labels for the graph
set label "Removed\ndummy\nfunction" at "2003-07-30:", 150000... | Fix bug where we printed the month number instead of the day number *blush* | Fix bug where we printed the month number instead of the day number *blush*
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@7980 91177308-0d34-0410-b5e6-96231b3b80d8
| Gnuplot | bsd-2-clause | dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-m... |
9e917a7c9e5f26cade48da4aa161b2c64992a4de | tests/http_request_benchmark/plot_results.gnu | tests/http_request_benchmark/plot_results.gnu | #! /usr/bin/env gnuplot
set terminal svg
set style line 1 lc rgb '#dd181f' lt 1 lw 0.1 pt 5 ps 0.2 # --- red
set style line 2 lc rgb '#0060ad' lt 1 lw 0.1 pt 7 ps 0.2 # --- blue
set xlabel 'Index of HTTP request'
set ylabel 'Time required for completion in nanoseconds'
set yrange [0:300000]
cd 'results'
result... | #! /usr/bin/env gnuplot
set terminal svg
set style line 1 lc rgb '#dd181f' lt 1 lw 0.1 pt 5 ps 0.2 # --- red
set style line 2 lc rgb '#0060ad' lt 1 lw 0.1 pt 7 ps 0.2 # --- blue
set xlabel 'Index of HTTP request'
set ylabel 'Time required for completion in nanoseconds'
set yrange [0:300000]
cd 'results'
result... | Update gnuplot file for platform folders | Update gnuplot file for platform folders
| Gnuplot | mit | etcimon/libasync |
5070fde57f5375a96e363480ce1267ff3d2e21e6 | figures/gnuplot/line.gp | figures/gnuplot/line.gp | set output "line.png"
load "settings.gp"
f(x) = 4.0*x + 42
x1 = -17
x2 = -16
plot \
f(x) axes x1y1 not with lines linestyle 102, \
'+' using ($0 == 0 ? x1 : NaN):(f(x1)):(sprintf('P1')) \
with labels offset char -1.5,1 left textcolor rgb 'blue' \
point linestyle 1 notitle, \
'+' using ($0 == 0 ? x2... | set output "line.png"
load "settings.gp"
set xrange [-20:-14]
f(x) = 4.0*x + 42
x1 = -17
x2 = -16
plot \
f(x) axes x1y1 not with lines linestyle 102, \
'+' using ($0 == 0 ? x1 : NaN):(f(x1)):(sprintf('P1')) \
with labels offset char -1.5,1 left textcolor rgb 'blue' \
point linestyle 1 notitle, \
'+... | Add xrange back where it belongs. | Add xrange back where it belongs.
| Gnuplot | mit | eigenholser/TALK-Shamir_Secret_Sharing,eigenholser/TALK-Shamir_Secret_Sharing,eigenholser/TALK-Shamir_Secret_Sharing |
2c4890533c3fd2a8e2606fce541e6784d0af5020 | profile/plot/lexer/big_xml.gnuplot | profile/plot/lexer/big_xml.gnuplot | #!/usr/bin/env gnuplot
set title "Lexing 10MB of XML"
set xlabel "Sample"
set ylabel "Memory (MB)"
set yrange [0:*]
set term qt persist
set grid
set style line 1 lc rgb "#0060ad" lt 1 lw 2 pt 7 ps 1
plot "profile/samples/lexer/big_xml.txt" \
using 0:($1 / 1024 ** 2) \
with linespoints ls 1 \
title "Me... | #!/usr/bin/env gnuplot
set title "Lexing 10MB of XML"
set xlabel "Sample"
set ylabel "Memory (MB)"
set yrange [0:*]
set term qt persist size 900,600
set grid
set style line 1 lc rgb "#0060ad" lt 1 lw 2 pt 7 ps 1
plot "profile/samples/lexer/big_xml.txt" \
using 0:($1 / 1024 ** 2) \
with linespoints ls 1 \
... | Set initial size for the lexer graph. | Set initial size for the lexer graph.
| Gnuplot | mpl-2.0 | dfockler/oga,dfockler/oga,ttasanen/oga,dfockler/oga,YorickPeterse/oga,YorickPeterse/oga,dfockler/oga,jeffreybaird/oga,ttasanen/oga,jeffreybaird/oga,ttasanen/oga,jeffreybaird/oga,jeffreybaird/oga,altmetric/oga,ttasanen/oga,altmetric/oga,altmetric/oga,jeffreybaird/oga,YorickPeterse/oga,ttasanen/oga,altmetric/oga,altmetri... |
c57f69776103121107ad70d86a7b0efbc2553daa | lib/math/ancillary/ulp.gp | lib/math/ancillary/ulp.gp | /*
I always end up need this for debugging
*/
{ ulp32(a) = my(aa, q);
aa = abs(a);
if(aa < 2^(-150),return(2^(-126 - 23)),);
q = floor(log(aa)/log(2));
if(q < -126,q=-126,);
return(2^(q-23));
}
{ ulp64(a) = my(aa, q);
aa = abs(a);
if(aa < 2^(-2000),return(2^(... | Add macros for relative error to lib/math/ancillary. | Add macros for relative error to lib/math/ancillary.
| Gnuplot | mit | oridb/mc,oridb/mc,oridb/mc,oridb/mc | |
bc2505cd9bd6250717406f13572fffb8d5c7a3b4 | Gnuplot/epslatex.plt | Gnuplot/epslatex.plt | #!/usr/bin/env gnuplot
set encoding utf8
set terminal epslatex
set output '<+filebase+>.eps'
set output '<+FILEBASE+>.tex'
<+CURSOR+>
| Add a template of gnuplot | Add a template of gnuplot
| Gnuplot | mit | koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate | |
0011afb8a6b923e428457c7fbb6d43310df45ede | benchmarks/Threaded.gnuplot | benchmarks/Threaded.gnuplot | set xrange [0:100]
plot "JustPingC.data" u 2:(1./100000.) smooth cumulative title "C", \
"JustPingHaskellNT.data" u 2:(1./100000.) smooth cumulative title "Haskell", \
"JustPingHaskell.data" u 2:(1./100000.) smooth cumulative title "Haskell -threaded"
set terminal postscript color
set output "Thread... | Add script to generate the -threaded CDF | Add script to generate the -threaded CDF
| Gnuplot | bsd-3-clause | hackern/network-transport-tcp,aycanirican/network-transport-tcp,tweag/network-transport-tcp,haskell-distributed/network-transport-tcp | |
0b34927b26a7c57096601e94266de2672fd5afde | PLOT_DENSITY.plt | PLOT_DENSITY.plt | #!/usr/bin/gnuplot -c
set terminal png font arial 14 size 800,600
set border 3
unset title
unset key
unset xtics
unset ytics
set grid
set xrange [0:]
set yrange [0:]
set cbrange [ 0.00000 : ]
set output ARG2
plot ARG1 matrix with image
| Add gnuplot script for densitySlice output | Add gnuplot script for densitySlice output
| Gnuplot | bsd-2-clause | sgshulman/DGEM,sgshulman/DGEM | |
8230b2645eaec8c6df6ab87c22d380cc2fcdd9aa | bin/neuron-fit.gp | bin/neuron-fit.gp | set terminal pngcairo mono font '/usr/share/fonts/X11/Type1/lmbx10.pfb'
set termoption dash
set output outfile
set key inside left top box linetype -1 linewidth 1.000
set samples 50
set title "40-bit one max, 120 pop, roulette, fitness, full replacement"
set xlabel "Generation"
set ylabel "Fitness"
S = 1
plot infile u ... | Add in neuron fitness printer. | Add in neuron fitness printer.
| Gnuplot | epl-1.0 | hyPiRion/genetica,hyPiRion/genetica | |
d90bcfae8a3b92275aa2fe64732f64fde50db32a | plots/scatter_cluster/scatter_cluster.gnu | plots/scatter_cluster/scatter_cluster.gnu | # circle_inout.inp
#
# Draw 500 points, some inside, and some outside, the unit circle.
#
# Choose the output device.
#
set term png medium
#
# Name the output file.
#
set output "circle_inout.png"
#
# Set the plot title.
#
set title "Random Points in/out of Circle"
#
# Get grid lines.
#
set grid
#
# Set axis la... | Fix a scatter plot script | Fix a scatter plot script
| Gnuplot | apache-2.0 | cyliustack/sofa,cyliustack/sofa,cyliustack/sofa,cyliustack/sofa,cyliustack/sofa | |
6b7b2316b534087ffe16f53d26bcbd7aca7bd909 | functional-tests/core/ft_api_v2_simulation_schema_test.go | functional-tests/core/ft_api_v2_simulation_schema_test.go | package hoverfly_test
import (
"bytes"
"encoding/json"
"io/ioutil"
"github.com/SpectoLabs/hoverfly/functional-tests"
"github.com/dghubble/sling"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("/api/v2/simulation/schema", func() {
var (
hoverfly *functional_tests.Hoverfly
)
Bef... | package hoverfly_test
import (
"bytes"
"encoding/json"
"io/ioutil"
"github.com/SpectoLabs/hoverfly/functional-tests"
"github.com/dghubble/sling"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("/api/v2/simulation/schema", func() {
var (
hoverfly *functional_tests.Hoverfly
)
Bef... | Update functional test to error correctly if a needed file is missing | Update functional test to error correctly if a needed file is missing
| Go | apache-2.0 | SpectoLabs/hoverfly,SpectoLabs/hoverfly |
200075926154dd2b7948961008ccb841401423b5 | hack/imports.go | hack/imports.go | /*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | /*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | Move the package comments above package | Move the package comments above package | Go | apache-2.0 | kubernetes-retired/cluster-registry,kubernetes-retired/cluster-registry |
1836d32c638b5630267d5a1181ffeb4fcd806e1c | bowling_test.go | bowling_test.go | package bowling
import "testing"
func TestGutterGame(t *testing.T) {
game := new(Game)
for i := 0; i < 20; i++ {
game.Roll(0)
}
score := game.Score()
if score != 0 {
t.Error("Gutter game:", "Expected", 0, "was", score)
}
}
func TestAllOnes(t *testing.T) {
game := new(Game)
for i := 0; i < 20; i++ {... | package bowling
import "testing"
func (g *Game) RollMany(runs int, pins int) {
for i := 0; i < runs; i++ {
g.Roll(pins)
}
}
func TestGutterGame(t *testing.T) {
game := new(Game)
game.RollMany(20, 0)
score := game.Score()
if score != 0 {
t.Error("Gutter game:", "Expected", 0, "was", score)
}
}
func TestA... | Refactor test to provide `RollMany` function | Refactor test to provide `RollMany` function
| Go | mit | jehrhardt/bowling-game-go |
1ad4f4db8f65ab38416858f6f5f904b338c3be0a | example_test.go | example_test.go | package hostpool
import (
"github.com/bitly/go-hostpool"
)
func ExampleNewEpsilonGreedy() {
hp := hostpool.NewEpsilonGreedy([]string{"a", "b"}, 0, &hostpool.LinearEpsilonValueCalculator{})
hostResponse := hp.Get()
hostname := hostResponse.Host()
err := nil // (make a request with hostname)
hostResponse.Mark(err... | package hostpool_test
import (
"github.com/bitly/go-hostpool"
)
func ExampleNewEpsilonGreedy() {
hp := hostpool.NewEpsilonGreedy([]string{"a", "b"}, 0, &hostpool.LinearEpsilonValueCalculator{})
hostResponse := hp.Get()
_ = hostResponse.Host()
hostResponse.Mark(nil)
}
| Fix import cycle and build error | Fix import cycle and build error
Importing the current package from it's external source creates an import cycle; changing the package name for this test breaks the cycle. Also, "err := nil" is ambiguous and causes a compile-time failure. | Go | mit | bitly/go-hostpool |
8395d1b1d3047459e1c4dd5e1be54d646d7a9006 | example_test.go | example_test.go | package refmt_test
import (
"bytes"
"fmt"
"github.com/polydawn/refmt"
"github.com/polydawn/refmt/obj/atlas"
)
func ExampleJsonEncodeDefaults() {
type MyType struct {
X string
Y int
}
MyType_AtlasEntry := atlas.BuildEntry(MyType{}).
StructMap().Autogenerate().
Complete()
atl := atlas.MustBuild(
My... | package refmt_test
import (
"bytes"
"fmt"
"github.com/polydawn/refmt"
"github.com/polydawn/refmt/obj/atlas"
)
func ExampleJsonEncodeAtlasDefaults() {
type MyType struct {
X string
Y int
}
MyType_AtlasEntry := atlas.BuildEntry(MyType{}).
StructMap().Autogenerate().
Complete()
atl := atlas.MustBuild(... | Add example of building your own struct mapping atlas, with details. | Add example of building your own struct mapping atlas, with details.
Signed-off-by: Eric Myhre <2346ad27d7568ba9896f1b7da6b5991251debdf2@exultant.us>
| Go | mit | polydawn/refmt,polydawn/go-xlate,polydawn/refmt,polydawn/go-xlate |
e63845e3ce999aad47ffe235605b2414ea853a2a | prometheus/timer.go | prometheus/timer.go | // Copyright 2016 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to... | // Copyright 2016 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to... | Add observerFunc to observe with a Gauge | Add observerFunc to observe with a Gauge
| Go | apache-2.0 | prometheus/client_golang,m3db/prometheus_client_golang |
d6b06458fa84f245464f98de315f2c511b141de4 | src/cf-metrics/events.go | src/cf-metrics/events.go | package main
import (
"fmt"
"time"
"net/url"
"code.cloudfoundry.org/cli/cf/api/resources"
"code.cloudfoundry.org/cli/cf/configuration/coreconfig"
"code.cloudfoundry.org/cli/cf/models"
"code.cloudfoundry.org/cli/cf/net"
)
type EventRepo struct {
config coreconfig.Reader
gateway net.Gateway
}
func NewEvent... | package main
import (
"fmt"
"time"
"net/url"
"code.cloudfoundry.org/cli/cf/api/resources"
"code.cloudfoundry.org/cli/cf/configuration/coreconfig"
"code.cloudfoundry.org/cli/cf/models"
"code.cloudfoundry.org/cli/cf/net"
)
type EventRepo struct {
config coreconfig.Reader
gateway net.Gateway
}
func NewEvent... | Fix string formatting in URL path | Fix string formatting in URL path
`go vet` message:
```
src/cf-metrics/events.go:29: arg url.QueryEscape(since.Format(time.RFC3339)) for printf verb %E of wrong type: string
```
I suspect that this wasn’t doing quite what I thought it was, due to
string formatting and URL encoding collisions.
| Go | mit | jabley/cf-metrics |
394ffc062d6d43234d3cac89ca728d96dfc230b1 | pkg/charts/detect.go | pkg/charts/detect.go | package charts
import "bytes"
type ChartType string
const (
UnknownChart ChartType = "UnknownChart"
SimpleBar ChartType = "SimpleBar"
SimpleLine ChartType = "SimpleLine"
)
type DataType string
type DataTypes []DataType
const (
UnknownType DataType = "UnknownType"
Text DataType = "Text"
Number ... | package charts
import "bytes"
type ChartType int
const (
UnknownChart ChartType = iota
SimpleBar
SimpleLine
)
type DataType int
type DataTypes []DataType
const (
UnknownType DataType = iota
Text
Number
Time
)
var charts map[string]ChartType
func sequence(types DataTypes) string {
var seq bytes.Buffer
... | Revert "Use string as underlining data type" | Revert "Use string as underlining data type"
This reverts commit 286b63f64eb31716c766891614ae38a4af7f3100.
| Go | mit | lucapette/deloominator,lucapette/deloominator,lucapette/deloominator |
47ff444d91f46b89f40edf730bd8e5dcafebc4b3 | go-statusbar.go | go-statusbar.go | package main
import (
"github.com/cburkert/go-statusbar/reporters/battery"
"github.com/cburkert/go-statusbar/reporters/volume"
)
func main() {
statusBar := NewStatusBar(" | ")
statusBar.AddReporter(volume.NewVolumeReporter())
statusBar.AddReporter(battery.NewPowerReporter("/sys/class/power_supply/"))
statusBar.... | package main
import (
"github.com/cburkert/go-statusbar/reporters/battery"
"github.com/cburkert/go-statusbar/reporters/volume"
)
func main() {
statusBar := NewStatusBar(" | ")
statusBar.AddReporter(volume.NewVolumeReporter())
statusBar.AddReporter(battery.NewPowerReporter("/sys/class/power_supply/"))
statusBar.... | Use creator function for DateReporter | Use creator function for DateReporter
| Go | bsd-3-clause | cburkert/go-statusbar,cburkert/go-statusbar |
9712d06b3674f5e5cd5aeef6a4be1610a393f65f | hugolib/hugo.go | hugolib/hugo.go | package hugolib
const Version = "0.13-DEV"
var (
CommitHash string
BuildDate string
)
var hugoInfo *HugoInfo
// HugoInfo contains information about the current Hugo environment
type HugoInfo struct {
Version string
Generator string
CommitHash string
BuildDate string
}
func init() {
hugoInfo = &HugoInf... | package hugolib
import (
"html/template"
)
const Version = "0.13-DEV"
var (
CommitHash string
BuildDate string
)
var hugoInfo *HugoInfo
// HugoInfo contains information about the current Hugo environment
type HugoInfo struct {
Version string
Generator template.HTML
CommitHash string
BuildDate string
}... | Fix the Hugo.Generator tag so it can be used | Fix the Hugo.Generator tag so it can be used
| Go | apache-2.0 | ryanclarke/hugo,mdhender/hugo,gohugoio/hugo,bramp/hugo,halostatue/hugo,ifraixedes/hugo,gohugoio/hugo,tjyang/hugo,jygastaud/hugo,mayah/hugo,kujohn/hugo,jygastaud/hugo,tischda/hugo,fedelibre/hugo,mdhender/hugo,mayah/hugo,sprig/hugo,sprig/hugo,badoet/hugo,ffrizzo/hugo,MarkDBlackwell/hugo,fhergomez/hugo,tatsushid/hugo,Mark... |
2cc1fc5e7c6e559c184f918513de3a6e22fdf6f3 | generation/testdata/listing/main.go | generation/testdata/listing/main.go | // Package main is used for testing of generated 'views' listing.
// There is no way to include a new import dynamically, thus
// we are running this test from generate_test.go
// as a new command using exec package.
package main
import (
"../assets/views"
"github.com/anonx/sunplate/log"
)
func main() {
if l := l... | // Package main is used for testing of generated 'views' listing.
// There is no way to include a new import dynamically, thus
// we are running this test from generate_test.go
// as a new command using exec package.
package main
import (
"../assets/views"
"github.com/anonx/sunplate/log"
)
func main() {
if l := l... | Update expected results of generated liting | Update expected results of generated liting
| Go | bsd-2-clause | goaltools/goal,anonx/sunplate,anonx/sunplate,goaltools/goal,goaltools/goal,anonx/sunplate |
9fdf576f310d92d9465e8681ecec628628feb3ce | crawl.go | crawl.go | package wally
import (
"io/ioutil"
"net/http"
rdb "github.com/dancannon/gorethink"
"github.com/nylar/odlaw"
)
func GrabUrl(url string) ([]byte, error) {
resp, err := http.Get(url)
if err != nil {
return []byte{}, err
}
data, err := ioutil.ReadAll(resp.Body)
defer resp.Body.Close()
if err != nil {
retu... | package wally
import (
"io/ioutil"
"net/http"
rdb "github.com/dancannon/gorethink"
"github.com/nylar/odlaw"
)
func GrabUrl(url string) ([]byte, error) {
resp, err := http.Get(url)
if err != nil {
return []byte{}, err
}
data, _ := ioutil.ReadAll(resp.Body)
defer resp.Body.Close()
return data, nil
}
fun... | Remove error from ioutil.ReadAll because it's very hard to make it fail | Remove error from ioutil.ReadAll because it's very hard to make it fail
| Go | unlicense | nylar/wally |
c635ad51c2c6a3cb4bc769255e266696d99e1a18 | dance.go | dance.go | package goDLX
// Matrix is the fundamental unit in the Algorithm X implementation
// as described in [Knuth, Donald (2000). "Dancing Links". _Millenial Perspectives in Computer Science_. P159 *187*.
// Name and size only apply to columns
type Matrix struct {
L, R, U, D, C *Matrix
Name string
size ... | package goDLX
// Matrix is the fundamental unit in the Algorithm X implementation
// as described in [Knuth, Donald (2000). "Dancing Links". _Millenial Perspectives in Computer Science_. P159 *187*.
// Name and size only apply to columns
type Matrix struct {
L, R, U, D, C *Matrix
Name string
size ... | Refactor `New()` for naming convention | Refactor `New()` for naming convention
Using `r` instead of `n` to represent the new Matrix root element.
| Go | bsd-2-clause | jessecarl/goDLX |
aa71c88daffcf29c4a3f0038e4767508b795cc93 | run_test.go | run_test.go | package main
import (
. "github.com/franela/goblin"
"errors"
"testing"
)
func Test(t *testing.T) {
g := Goblin(t)
g.Describe("Run", func() {
extensionError := errors.New("run could not determine how to run this file because it does not have a known extension")
g.Describe(".command_for_file", func... | package main
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"errors"
"testing"
)
func Test(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Run")
}
var _ = Describe("Run", func() {
extensionError := errors.New("run could not determine how to run this file because it does not have... | Switch from goblin to ginkgo for testing | Switch from goblin to ginkgo for testing
| Go | mit | nicolasmccurdy/run |
2261c0618492499077c0c8840901362710d5fd10 | resource/resourceadapters/deploy.go | resource/resourceadapters/deploy.go | // Copyright 2016 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package resourceadapters
import (
"github.com/juju/errors"
charmresource "gopkg.in/juju/charm.v6-unstable/resource"
"github.com/juju/juju/api"
"github.com/juju/juju/resource/cmd"
)
// DeployResources uploads the bytes f... | // Copyright 2016 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package resourceadapters
import (
"github.com/juju/errors"
"gopkg.in/juju/charm.v6-unstable"
charmresource "gopkg.in/juju/charm.v6-unstable/resource"
"github.com/juju/juju/api"
"github.com/juju/juju/resource/cmd"
)
// ... | Fix the DeployResources() call args. | Fix the DeployResources() call args.
| Go | agpl-3.0 | perrito666/juju,makyo/juju,gabriel-samfira/juju,ericsnowcurrently/juju,dimitern/juju,bac/juju,macgreagoir/juju,waigani/juju,bz2/juju,anastasiamac/juju,kat-co/juju,howbazaar/juju,reedobrien/juju,macgreagoir/juju,macgreagoir/juju,ericsnowcurrently/juju,howbazaar/juju,dooferlad/juju,dimitern/juju,anastasiamac/juju,makyo/j... |
9a433c26e0d515474ebf88d0d4cf49c17a0f3a7e | gopanic_test.go | gopanic_test.go | package main
import (
"fmt"
"io/ioutil"
"os"
"testing"
. "github.com/VonC/godbg"
. "github.com/smartystreets/goconvey/convey"
)
func TestGoPanic(t *testing.T) {
Convey("Test main", t, func() {
fmt.Println("test main")
files, err := ioutil.ReadDir("./tests")
if err != nil {
Pdbgf("Unable to access tes... | package main
import (
"fmt"
"io/ioutil"
"os"
"testing"
. "github.com/VonC/godbg"
. "github.com/smartystreets/goconvey/convey"
)
func TestGoPanic(t *testing.T) {
Convey("Test main", t, func() {
fmt.Println("test main")
files, err := ioutil.ReadDir("./tests")
if err != nil {
Pdbgf("Unable to access tes... | Introduce focusing on specific test file | Introduce focusing on specific test file
| Go | mit | VonC/gopanic |
a558b299a1b3a9ffdbc8d9d5160ef23963a843b7 | api/api_test.go | api/api_test.go | package api
import (
"testing"
)
func TestValidateConfig(t *testing.T) {
if New().validateConfig().Error() != "Modulepath must be set before starting the API server" {
t.Error("validateConfig should return an error when the modulepath hasn't been set")
}
subject := New()
subject.Config["modulepath"] = "stub ... | package api
import (
"testing"
)
func TestValidateConfig(t *testing.T) {
if New().validateConfig().Error() != "Modulepath must be set before starting the API server" {
t.Error("validateConfig should return an error when the modulepath hasn't been set")
}
subject1 := New()
subject1.Config["modulepath"] = "stu... | Add test for fileurl input validation | Add test for fileurl input validation
| Go | apache-2.0 | jolshevski/chester |
837fe23ceac180bd7c61482ed2c570e89b821cda | examples/clock/main.go | examples/clock/main.go | package main
import (
"fmt"
"github.com/voxelbrain/pixelpixel/pixelutils"
"time"
)
func main() {
wall, _ := pixelutils.PixelPusher()
pixel := pixelutils.NewPixel()
bigPixel := pixelutils.DimensionChanger(pixel, 5*4, 18)
textPixel := pixelutils.NewImageWriter(bigPixel, pixelutils.Green)
colon := ":"
for {
... | package main
import (
"fmt"
"github.com/voxelbrain/pixelpixel/pixelutils"
"time"
)
func colonGenerator() <-chan string {
c := make(chan string)
go func() {
for {
c <- ":"
c <- " "
}
}()
return c
}
func main() {
wall, _ := pixelutils.PixelPusher()
pixel := pixelutils.NewPixel()
bigPixel := pixelut... | Use generator for clock example | Use generator for clock example
| Go | mit | voxelbrain/pixelpixel,voxelbrain/pixelpixel,voxelbrain/pixelpixel,voxelbrain/pixelpixel,voxelbrain/pixelpixel,voxelbrain/pixelpixel |
311fc9f6a227748c2607e33994106643b6e6649c | appui/stream.go | appui/stream.go | package appui
import (
"io"
"github.com/moncho/dry/ui"
"github.com/nsf/termbox-go"
)
//Stream shows the content of the given stream on screen
func Stream(screen *ui.Screen, stream io.ReadCloser, keyboardQueue chan termbox.Event, closeView chan<- struct{}) {
defer func() {
closeView <- struct{}{}
}()
screen.C... | package appui
import (
"io"
"github.com/docker/docker/pkg/stdcopy"
"github.com/moncho/dry/ui"
"github.com/nsf/termbox-go"
)
//Stream shows the content of the given stream on screen
func Stream(screen *ui.Screen, stream io.ReadCloser, keyboardQueue chan termbox.Event, closeView chan<- struct{}) {
defer func() {
... | Use StdCopy to write logs to buffer | Use StdCopy to write logs to buffer
| Go | mit | moncho/dry,moncho/dry |
67f376ff9d2597d618b697d9e45b7ce48cf96dbb | index/bindex.go | index/bindex.go | package index
type Index struct {
br *blob_reader
Docs map[uint32][]byte
Attrs map[string][]IbDoc
}
func Open(name string) (*Index, error) {
var in Index
var err error
in.br, err = open_blob_reader(name)
if err != nil {
return nil, err
}
in.Docs = make(map[uint32][]byte)
for _, d := range in.br.get_... | package index
import (
"bconf"
)
type Index struct {
br *blob_reader
Docs map[uint32][]byte
Attrs map[string][]IbDoc
Meta bconf.Bconf
header string
}
func Open(name string) (*Index, error) {
var in Index
var err error
in.br, err = open_blob_reader(name)
if err != nil {
return nil, err
}
in.Docs =... | Implement meta by using the bconf package (separate repository). | Implement meta by using the bconf package (separate repository).
| Go | isc | art4711/bsearch |
100bc8f314d4bb8ee1d3a30ba91e57a840879183 | server/response/state_change.go | server/response/state_change.go | package response
import (
"warcluster/entities"
)
type StateChange struct {
baseResponse
Missions map[string]*entities.Mission `json:",omitempty"`
RawPlanets map[string]*entities.Planet `json:"-"`
Planets map[string]*entities.PlanetPacket `json:",omitempty"`
Suns map[string]*entities.Sun ... | package response
import (
"warcluster/entities"
)
type StateChange struct {
baseResponse
Missions map[string]*entities.Mission `json:",omitempty"`
RawPlanets map[string]*entities.Planet `json:"-"`
Planets map[string]*entities.PlanetPacket `json:",omitempty"`
Suns map[string]*entities.Sun ... | Initialize all maps in the StateChange when created | Initialize all maps in the StateChange when created
| Go | mit | WarCluster/warcluster-server,WarCluster/warcluster-server |
5fa06a623981c6f9282fbca80ce767fc8c1e9b67 | indexing/index_test.go | indexing/index_test.go | package indexing
import (
"bytes"
"testing"
)
var testWrites = []struct {
docs []Document
out string
}{
{[]Document{},
// Header | End of Docs
"searchme\x00\x00"}, // terminator + doc terminator
{[]Document{{"path", "content"}},
// Header | Doc paths + Terminator | term + terminator + doc id (... | package indexing
import (
"bytes"
"testing"
)
var testWrites = []struct {
docs []Document
out string
}{
{[]Document{},
// Header | End of Docs
"searchme\x00\x00"}, // terminator + doc terminator
{[]Document{{"path", "content"}},
// Header | Doc paths + Terminator | term + terminator + doc id (... | Add test number to assertion | Add test number to assertion
| Go | mit | kevinclark/indexer |
e50ae48c2dc089faf3fb666b99ce8d0e6ea42c4b | findurls_test.go | findurls_test.go | package main
import(
"testing"
)
func TestFindURLs(t *testing.T) {
if len(FindURLs("Wie sieht es aus wenn man http://starship-factory.ch/blah?foo=bar http://foo?baz=quux sagt?")) == 0 {
t.Error("no urls found")
}
if len(FindURLs("Wie sieht es aus wenn man http://starshi... | package main
import(
"testing"
)
func TestFindURLs(t *testing.T) {
var res []string
var teststrings = map[string][]string{
"Wie sieht es aus wenn man http://starship-factory.ch/blah?foo=bar sagt?":[]string{"http://starship-factory.ch/blah?foo=bar"},
"Wie sieht e... | Make it easier to add new test cases. | Make it easier to add new test cases.
| Go | bsd-3-clause | julianec/justanotherircbot |
6fd5dd323c15928c945ad2de1c37cb6e4303a181 | console.go | console.go | package godless
import (
"errors"
"fmt"
)
func TerminalConsole(addr string) error {
fmt.Printf("The console should send user commands to '%v'.\n", addr)
fmt.Println("Data found in the APIResponse should be formatted in a human readable manner.")
fmt.Println("")
fmt.Println("Some functions that will help:")
fmt... | package godless
import (
"errors"
"fmt"
)
func TerminalConsole(addr string) error {
fmt.Printf("The console should send user commands to '%v'.\n", addr)
fmt.Println("Data found in the APIResponse should be formatted in a human readable manner.")
fmt.Println("")
fmt.Println("Some functions that will help:")
fmt... | Fix a Gavin hint :) | Fix a Gavin hint :)
| Go | mit | johnny-morrice/godless |
c54349985f0d3bbe56108179554d2c9a775f2036 | context.go | context.go | package chuper
import (
"net/url"
"github.com/PuerkitoBio/fetchbot"
"github.com/Sirupsen/logrus"
)
type Context interface {
Cache() Cache
Queue() Enqueuer
Log(fields map[string]interface{}) *logrus.Entry
URL() *url.URL
SourceURL() *url.URL
}
type Ctx struct {
*fetchbot.Context
C Cache
L *logrus.Logger
}
... | package chuper
import (
"net/url"
"github.com/PuerkitoBio/fetchbot"
"github.com/Sirupsen/logrus"
)
type Context interface {
Cache() Cache
Queue() Enqueuer
Log(fields map[string]interface{}) *logrus.Entry
URL() *url.URL
Method() string
SourceURL() *url.URL
}
type Ctx struct {
*fetchbot.Context
C Cache
L ... | Add Method to Context interface | Add Method to Context interface
| Go | bsd-3-clause | sluceno/chuper,oli-g/chuper |
7b025499c8ed3e22019d652267c2837a1ce97a62 | link_darwin.go | link_darwin.go | // 13 december 2015
package ui
// #cgo LDFLAGS: -L${SRCDIR} -lui -framework CoreFoundation -lpthread
// #include <CoreFoundation/CoreFoundation.h>
// #include <pthread.h>
// extern void _CFRunLoopSetCurrent(CFRunLoopRef);
// extern pthread_t _CFMainPThread;
import "C"
// OS X cares very deeply if we don't run on the... | // 13 december 2015
package ui
// #cgo LDFLAGS: -L${SRCDIR} -lui -framework CoreFoundation -lpthread -rpath @executable_path
// /* (thanks to http://jorgen.tjer.no/post/2014/05/20/dt-rpath-ld-and-at-rpath-dyld/ for the @executable_path clarifiaction */
// #include <CoreFoundation/CoreFoundation.h>
// #include <pthrea... | Set up rpath properly on OS X. | Set up rpath properly on OS X.
| Go | mit | robbiev/ui,ProtonMail/ui,robbiev/ui,ProtonMail/ui,robbiev/ui,ProtonMail/ui |
7fab5138699731421e7bfa7585344ec34b3828ae | golint/golint.go | golint/golint.go | // Copyright (c) 2013 The Go Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd.
// golint lints the Go source files named on its command line.
package main
import (
"f... | // Copyright (c) 2013 The Go Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd.
// golint lints the Go source files named on its command line.
package main
import (
"f... | Include filename in reading/parsing errors. | Include filename in reading/parsing errors.
Fixes issue #2.
| Go | bsd-3-clause | golang/lint,hellosuper/gohint,elgris/hint,darkliquid/lintci,zimmski/lint,JekaMas/hint,gorcz/lint,tmc/lint,NichoZhang/lint,kovetskiy/lint,lutzky/lint |
efce94709ca5cce17d45f384208040ae5626b256 | native_linbsd.go | native_linbsd.go | //+build linux freebsd
package glfw3
//#define GLFW_EXPOSE_NATIVE_X11
//#define GLFW_EXPOSE_NATIVE_GLX
//#include <X11/extensions/Xrandr.h>
//#include "glfw/include/GLFW/glfw3.h"
//#include "glfw/include/GLFW/glfw3native.h"
import "C"
func (w *Window) GetX11Window() (C.Window, error) {
return C.glfwGetX11Window(w.d... | // +build linux freebsd
package glfw3
//#define GLFW_EXPOSE_NATIVE_X11
//#define GLFW_EXPOSE_NATIVE_GLX
//#include <X11/extensions/Xrandr.h>
//#include "glfw/include/GLFW/glfw3.h"
//#include "glfw/include/GLFW/glfw3native.h"
import "C"
func (w *Window) GetX11Window() (C.Window, error) {
return C.glfwGetX11Window(w.... | Use idiomatic form for build constraints. | Use idiomatic form for build constraints.
See http://golang.org/pkg/go/build/#hdr-Build_Constraints.
| Go | bsd-3-clause | go-gl/glfw,go-gl/glfw,jonbuckley33/glfw3,jonbuckley33/glfw3,james4k/glfw,james4k/glfw,gonutz/glfw,gonutz/glfw,go-gl/glfw |
537b5ce1016a38570e9c191134de5b59ac295117 | v1/v1.go | v1/v1.go | package v1
import (
"net/http"
"time"
"github.com/codegangsta/martini"
"github.com/coopernurse/gorp"
"github.com/hackedu/backend/v1/model"
"github.com/hackedu/backend/v1/route"
"github.com/martini-contrib/binding"
"github.com/zachlatta/cors"
)
func Setup(m *martini.ClassicMartini) {
// TODO: Only apply midd... | package v1
import (
"net/http"
"time"
"github.com/codegangsta/martini"
"github.com/coopernurse/gorp"
"github.com/hackedu/backend/v1/model"
"github.com/hackedu/backend/v1/route"
"github.com/martini-contrib/binding"
"github.com/martini-contrib/cors"
)
func Setup(m *martini.ClassicMartini) {
// TODO: Only appl... | Use github.com/martini-contrib/cors instead of github.com/zachlatta/cors. | Use github.com/martini-contrib/cors instead of github.com/zachlatta/cors.
| Go | mit | hackedu/website,zachlatta/website,zachlatta/website,hackedu/website,zachlatta/website,hackedu/website |
82f02e27af822ceac64d47a4fb4ecbab42716098 | run_test.go | run_test.go | package main
import (
"testing"
. "github.com/franela/goblin"
)
func Test(t *testing.T) {
g := Goblin(t)
g.Describe("Run", func() {
g.Describe(".command_for_file", func() {
g.Describe("when a filename is given with a known extension", func() {
g.It("should be a valid command", func() {
... | package main
import (
"errors"
"testing"
. "github.com/franela/goblin"
)
func Test(t *testing.T) {
g := Goblin(t)
g.Describe("Run", func() {
g.Describe(".command_for_file", func() {
g.Describe("when a filename is given with a known extension", func() {
g.It("should be a valid command", fu... | Update tests so they pass | Update tests so they pass
| Go | mit | nicolasmccurdy/run |
8f0576a2c63d7ef11bbf2161c00182233deee9ba | phrase_scan.go | phrase_scan.go | package main
// scanning an HTTP response for phrases
import (
"http"
"mahonia.googlecode.com/hg"
)
// phrasesInResponse scans the content of an http.Response for phrases,
// and returns a map of phrases and counts.
func phrasesInResponse(res *http.Response) map[string]int {
defer res.Body.Close()
wr := newWordR... | package main
// scanning an HTTP response for phrases
import (
"http"
"mahonia.googlecode.com/hg"
"strings"
)
// phrasesInResponse scans the content of an http.Response for phrases,
// and returns a map of phrases and counts.
func phrasesInResponse(res *http.Response) map[string]int {
defer res.Body.Close()
co... | Use charset from Content-Type header instead of assuming all pages are UTF-8. | Use charset from Content-Type header instead of assuming all pages are UTF-8.
| Go | bsd-2-clause | andybalholm/redwood,yinheli/redwood-filter,vishnuvaradaraj/redwood,vishnuvaradaraj/redwood,yinheli/redwood-filter,vishnuvaradaraj/redwood,yinheli/redwood-filter,andybalholm/redwood,unixabg/redwood,unixabg/redwood |
00ed6923f7c80857ccd4a21f9044290062a4fc12 | sys/dumpstack.go | sys/dumpstack.go | package sys
import "runtime"
func DumpStack() string {
buf := make([]byte, 1024)
for runtime.Stack(buf, true) == cap(buf) {
buf = make([]byte, cap(buf)*2)
}
return string(buf)
}
| package sys
import "runtime"
const dumpStackBufSizeInit = 4096
func DumpStack() string {
buf := make([]byte, dumpStackBufSizeInit)
for {
n := runtime.Stack(buf, true)
if n < cap(buf) {
return string(buf[:n])
}
buf = make([]byte, cap(buf)*2)
}
}
| Fix DumpStack to return the correct part of the buffer. | sys: Fix DumpStack to return the correct part of the buffer.
| Go | bsd-2-clause | elves/elvish,elves/elvish,elves/elvish,elves/elvish,elves/elvish |
8423dcea8dbfcee6a54850a4920bb1c5361f848d | prompt/survey.go | prompt/survey.go | package prompt
import (
"github.com/AlecAivazis/survey/v2"
"log"
)
type Prompt interface {
Confirm(string) bool
}
func NewPrompt() Prompt {
return prompt{}
}
type prompt struct{}
func NewPromptContext(interactive bool, prompt Prompt) PromptContext{
return PromptContext{
Interactive: interactive,
Prompt: p... | package prompt
//go:generate mockgen -destination ../internal/mock/prompt/survey.go -package mock -source survey.go
import (
"github.com/AlecAivazis/survey/v2"
"log"
)
type Prompt interface {
Confirm(string) bool
}
func NewPrompt() Prompt {
return prompt{}
}
type prompt struct{}
func NewPromptContext(interact... | Add go:generate comment to generate mock of prompt | [Ninan] Add go:generate comment to generate mock of prompt
| Go | mit | thoughtworks/talisman,thoughtworks/talisman |
0cdad7e1e28ac667836d6ce6a864ac35bf1cb204 | markdown_test.go | markdown_test.go | package markdown
import (
"io/ioutil"
"path"
"strings"
"testing"
)
func TestParse(t *testing.T) {
m := new(Markdown)
files, _ := ioutil.ReadDir("./data")
for _, f := range files {
fileName := f.Name()
filePath := path.Join("./data/", fileName)
fileExt := path.Ext(filePath)
if ".md" != fileExt {
cont... | package markdown
import (
"io/ioutil"
"path"
"strings"
"testing"
)
func TestParse(t *testing.T) {
files, _ := ioutil.ReadDir("./data")
for _, f := range files {
fileName := f.Name()
filePath := path.Join("./data/", fileName)
fileExt := path.Ext(filePath)
if ".md" != fileExt {
continue
}
markdown,... | Replace method of struct with function. | Replace method of struct with function.
| Go | mit | jaceju/go-md |
1c8957275019664aa87bde09c4231e72bcf53099 | values/sm_test.go | values/sm_test.go | package values_test
import (
"testing"
"github.com/xgfone/go-tools/values"
)
func TestSlice(t *testing.T) {
ms := []interface{}{"test"}
ss := []interface{}{11, "aa", values.SMap{"abcd": 11, "ok": false, "slice": values.Slice(ms)}, true}
s := values.Slice(ss)
if _, ok := s.Int(0); !ok {
t.Fail()
}
if _, o... | package values_test
import (
"testing"
"github.com/xgfone/go-tools/values"
)
func TestSlice(t *testing.T) {
ms := []interface{}{"test"}
ss := []interface{}{11, "aa", values.SMap{"abcd": 11, "ok": false, "slice": values.Slice(ms)}, true}
s := values.Slice(ss)
if v, ok := s.Int(0); !ok || v != 11 {
t.Fail()
... | Enhance the test of values | Enhance the test of values
| Go | apache-2.0 | xgfone/go-tools |
f69a42dc0b14b91d12fc6beeb02e2b234d91719b | message.go | message.go | package campfire
import (
"fmt"
)
type Message struct {
conn *Connection
Id int `json:"id,omitempty"`
Type string `json:"type"`
UserId int `json:"user_id,omitempty"`
RoomId int `json:"room_id,omitempty"`
Body string `json:"body"`
Starred bool `json:... | package campfire
import (
"fmt"
)
type Message struct {
conn *Connection
Id int `json:"id,omitempty"`
Type string `json:"type"`
UserId int `json:"user_id,omitempty"`
RoomId int `json:"room_id,omitempty"`
Body string `json:"body"`
Starred bool `json:... | Add an accessor for the connection | Add an accessor for the connection
| Go | mit | brettbuddin/campfire |
ebbbfa1ea17c5fb71934713ccd1694df9c6bd5a9 | routerparams.go | routerparams.go | package neko
import (
"github.com/julienschmidt/httprouter"
"mime/multipart"
"net/http"
)
type routerParams struct {
req *http.Request
params httprouter.Params
}
func (c *routerParams) ByGet(name string) string {
val := c.params.ByName(name)
if val == "" {
val = c.req.URL.Query().Get(name)
}
return val... | package neko
import (
"encoding/json"
"github.com/julienschmidt/httprouter"
"mime/multipart"
"net/http"
"io/ioutil"
)
type routerParams struct {
req *http.Request
params httprouter.Params
}
func (c *routerParams) ByGet(name string) string {
val := c.params.ByName(name)
if val == "" {
val = c.req.URL.Qu... | Add parameter to get json data | Add parameter to get json data
| Go | mit | rocwong/neko |
e626d100ea82a5034a2f0da20781deb543ff9319 | utility/util.go | utility/util.go | package utility
import (
"encoding/json"
"github.com/bitspill/bitsig-go"
"github.com/btcsuite/btcutil"
)
var utilIsTestnet bool = false
func SetTestnet(testnet bool) {
utilIsTestnet = testnet
}
func Testnet() bool {
return utilIsTestnet
}
func CheckAddress(address string) bool {
var err error
if utilIsTestn... | package utility
import (
"encoding/json"
"github.com/bitspill/bitsig-go"
"github.com/btcsuite/btcutil"
)
var utilIsTestnet bool = false
func SetTestnet(testnet bool) {
utilIsTestnet = testnet
}
func Testnet() bool {
return utilIsTestnet
}
func CheckAddress(address string) bool {
var err error
if utilIsTestn... | Revert to v0.10 method of signature generation | Revert to v0.10 method of signature generation
| Go | mit | oipwg/media-protocol,dloa/media-protocol |
4660d2287cc2124d87c3f71ff1c6c17908e2fb04 | exampleclient_test.go | exampleclient_test.go | package turnpike_test
import (
"code.google.com/p/go.net/websocket"
"github.com/jcelliott/turnpike"
"net/http"
)
func ExampleClient_NewClient() {
c := turnpike.NewClient()
err := c.Connect("ws://127.0.0.1:8080/ws", "http://localhost/")
if err != nil {
fmt.Println("Error connecting:", err)
return
}
c.Call... | package turnpike_test
import (
"github.com/jcelliott/turnpike"
)
func ExampleClient_NewClient() {
c := turnpike.NewClient()
err := c.Connect("ws://127.0.0.1:8080/ws", "http://localhost/")
if err != nil {
panic("Error connecting:" + err.Error())
}
c.Call("rpc:test")
}
| Simplify and fix client example | Simplify and fix client example
| Go | mit | SpirentOrion/turnpike,DaniloMoura1/turnpike,mattbaird/turnpike,mourad/turnpike,dcarbone/turnpike,cornelk/turnpike,DevTable/turnpike,AnimationMentor/turnpike,awakenetworks/turnpike,DaniloMoura1/turnpike,digitallumens/turnpike,jmptrader/turnpike,jcelliott/turnpike,digitallumens/turnpike,digitallumens/turnpike,jmptrader/t... |
112d086ebd58c6e5e340820e97fdc4c4789a6bd1 | proto/proto.go | proto/proto.go | /*
package proto defines a set of structures used to negotiate an update between an
an application (the client) and an equinox update service.
*/
package proto
import "time"
type PatchKind string
const (
PatchRaw PatchKind = "none"
PatchBSDIFF PatchKind = "bsdiff"
)
type Request struct {
AppID string ... | /*
package proto defines a set of structures used to negotiate an update between an
an application (the client) and an equinox update service.
*/
package proto
import "time"
type PatchKind string
const (
PatchRaw PatchKind = "none"
PatchBSDIFF PatchKind = "bsdiff"
)
type Request struct {
AppID string ... | Make sure JSON scheme is a string | HACK: Make sure JSON scheme is a string
| Go | mit | equinox-io/equinox |
b9fdd25a588f963759a971f1e2c4aaff80316760 | executor/dispatch/dispatch.go | executor/dispatch/dispatch.go | package executordispatch
import (
"path/filepath"
"polydawn.net/repeatr/def"
"polydawn.net/repeatr/executor"
"polydawn.net/repeatr/executor/chroot"
"polydawn.net/repeatr/executor/nsinit"
"polydawn.net/repeatr/executor/null"
)
// TODO: This should not require a global string -> class map :|
// Should attempt to... | package executordispatch
import (
"path/filepath"
"polydawn.net/repeatr/def"
"polydawn.net/repeatr/executor"
"polydawn.net/repeatr/executor/chroot"
"polydawn.net/repeatr/executor/nsinit"
"polydawn.net/repeatr/executor/null"
"polydawn.net/repeatr/executor/runc"
)
// TODO: This should not require a global strin... | Add runc to usable executor options! | Add runc to usable executor options!
Signed-off-by: Eric Myhre <2346ad27d7568ba9896f1b7da6b5991251debdf2@exultant.us>
| Go | apache-2.0 | polydawn/repeatr,subuser-security/repeatr,subuser-security/repeatr,polydawn/repeatr |
06a0ac8188c10700e9c8448bed9f4a41efb7ff63 | types/result.go | types/result.go | package types
import (
"fmt"
)
type Result struct {
Code CodeType
Data []byte
Log string // Can be non-deterministic
}
func NewResult(code CodeType, data []byte, log string) Result {
return Result{
Code: code,
Data: data,
Log: log,
}
}
func (res Result) IsOK() bool {
return res.Code == CodeType_OK
}
... | package types
import (
"fmt"
)
type Result struct {
Code CodeType
Data []byte
Log string // Can be non-deterministic
}
func NewResult(code CodeType, data []byte, log string) Result {
return Result{
Code: code,
Data: data,
Log: log,
}
}
func (res Result) IsOK() bool {
return res.Code == CodeType_OK
}
... | Add NewError -> Result with no data | Add NewError -> Result with no data
| Go | apache-2.0 | tendermint/tmsp,tendermint/tendermint,kidinamoto01/abci,kidinamoto01/abci,tendermint/tmsp,kidinamoto01/abci,tendermint/tendermint,tendermint/tendermint,tendermint/tmsp,tendermint/tendermint |
86aa9b4cb02e3055d502d4b8f5cd1fc19782a8a6 | cmd/shell.go | cmd/shell.go | package cmd
import (
"os"
"github.com/gsamokovarov/jump/cli"
"github.com/gsamokovarov/jump/config"
"github.com/gsamokovarov/jump/shell"
)
func shellCmd(args cli.Args, _ *config.Config) {
hint := args.CommandName()
if len(hint) == 0 {
hint = os.Getenv("SHELL")
}
sh := shell.Guess(hint)
cli.Outf("%s", sh.... | package cmd
import (
"os"
"github.com/gsamokovarov/jump/cli"
"github.com/gsamokovarov/jump/config"
"github.com/gsamokovarov/jump/shell"
)
func shellCmd(args cli.Args, _ *config.Config) {
hint := args.CommandName()
if len(hint) == 0 {
hint = os.Getenv("SHELL")
}
sh := shell.Guess(hint)
shortcut := args.Ge... | Make the shortcut configurable so @luhova can replace z | Make the shortcut configurable so @luhova can replace z
| Go | mit | gsamokovarov/jump |
72f1ed5dda4f4d2f05f5dd7725b52e8cfa87ab1b | src/main/main.go | src/main/main.go | package main
import "trace"
const (
imageW = 640
imageH = 480
)
func createRandomImage() [][]trace.Color {
image := make([][]trace.Color, imageH)
for i := range image {
image[i] = make([]trace.Color, imageW)
for j := range image[i] {
image[i][j].R = float64(i) / float64(imageH)
image[i][j].G = float64(... | package main
import "trace"
const (
imageW = 640
imageH = 480
)
func main() {
c := trace.NewContext(imageW, imageH)
o2w := trace.NewM44()
o2w.Translate(trace.NewV3(-2, 0, -5))/*.scale(trace.NewV3(1.0, 2.0, 1.0))*/
c.AddPrimitive(trace.NewSphere(o2w))
o2w = trace.NewM44()
o2w.Translate(trace.NewV3(0, 0, -5)... | Add scaled sphere to check that works | Add scaled sphere to check that works
| Go | apache-2.0 | dominichamon/gotrace,dominichamon/gotrace |
04fa26e6078fbc41213760ca18b953a70cb8b066 | generate-reference.go | generate-reference.go | // Generates reference files for a given language
// +build !release
package main
import "ldss/lib"
type generateReference struct {
appinfo
}
func init() {
addApp("generate-reference", &generateReference{})
}
func (app *generateReference) run() {
lang, err := lib.LookupLanguage(app.args[0])
if err != nil {
... | // Generates reference files for a given language
// +build !release
package main
import (
"ldss/lib"
)
type generateReference struct {
appinfo
}
func init() {
addApp("generate-reference", &generateReference{})
}
func (app *generateReference) run() {
langId := app.args[1]
app.efmt.Println(langId)
lang, err ... | Work on generated reference files | Work on generated reference files
| Go | mit | duckbrain/ldss,duckbrain/ldss |
8fd5942722b0287026049d3e6547532ff553d262 | bencode/bytes.go | bencode/bytes.go | package bencode
type Bytes []byte
var (
_ Unmarshaler = &Bytes{}
_ Marshaler = &Bytes{}
)
func (me *Bytes) UnmarshalBencode(b []byte) error {
*me = append([]byte(nil), b...)
return nil
}
func (me *Bytes) MarshalBencode() ([]byte, error) {
return *me, nil
}
| package bencode
type Bytes []byte
var (
_ Unmarshaler = &Bytes{}
_ Marshaler = &Bytes{}
_ Marshaler = Bytes{}
)
func (me *Bytes) UnmarshalBencode(b []byte) error {
*me = append([]byte(nil), b...)
return nil
}
func (me Bytes) MarshalBencode() ([]byte, error) {
return me, nil
}
| Make bencode.Bytes work with pointer and nonpointer receivers | Make bencode.Bytes work with pointer and nonpointer receivers
| Go | mpl-2.0 | anacrolix/torrent,anacrolix/torrent |
c9904c17dcf2fada0667fc190f61064c95050c65 | lib/stringutil/api.go | lib/stringutil/api.go | package stringutil
import "sync"
type StringDeduplicator struct {
lock bool
mutex sync.Mutex
mapping map[string]string
statistics StringDuplicationStatistics
}
type StringDuplicationStatistics struct {
DuplicateBytes uint64
DuplicateStrings uint64
UniqueBytes uint64
UniqueStrings uint... | package stringutil
import "sync"
type StringDeduplicator struct {
lock bool
mutex sync.Mutex
mapping map[string]string
statistics StringDuplicationStatistics
}
type StringDuplicationStatistics struct {
DuplicateBytes uint64
DuplicateStrings uint64
UniqueBytes uint64
UniqueStrings uint... | Add basic documentation for lib/stringutil package. | Add basic documentation for lib/stringutil package.
| Go | apache-2.0 | Symantec/Dominator,keep94/Dominator,Symantec/Dominator,rgooch/Dominator,keep94/Dominator,keep94/Dominator,Symantec/Dominator,rgooch/Dominator,rgooch/Dominator |
29f4679907773c1119629d89f08d91f4ad0a004b | time_js.go | time_js.go | // +build js
package ninchat
import (
"github.com/gopherjs/gopherjs/js"
)
type duration int64
const (
second duration = 1000
millisecond = 1
)
type timeTime int64
func timeNow() timeTime {
return timeTime(js.Global.Get("Date").New().Call("getTime").Int64())
}
func timeAdd(t timeTime, d duration... | // +build js
package ninchat
import (
"github.com/gopherjs/gopherjs/js"
)
type duration int64
const (
second duration = 1000
millisecond = 1
)
type timeTime int64
func timeNow() timeTime {
return timeTime(js.Global.Get("Date").New().Call("getTime").Int64())
}
func timeAdd(t timeTime, d duration... | Fix JavaScript timer to never leak resources | Fix JavaScript timer to never leak resources
Stop() might have leaked the firing goroutine.
| Go | bsd-2-clause | ninchat/ninchat-go,ninchat/ninchat-go,ninchat/ninchat-go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.