id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
42,700
groupon/robo-remote
UIAutomatorClient/src/main/com/groupon/roboremote/uiautomatorclient/components/UiDevice.java
UiDevice.openNotification
public static boolean openNotification() throws Exception { boolean success = false; // get API level int apiLevel = Client.getInstance().mapField("android.os.Build$VERSION", "SDK_INT").getInt(0); if (apiLevel >= 18) { success = Client.getInstance().map(Constants.UIAUTOMATO...
java
public static boolean openNotification() throws Exception { boolean success = false; // get API level int apiLevel = Client.getInstance().mapField("android.os.Build$VERSION", "SDK_INT").getInt(0); if (apiLevel >= 18) { success = Client.getInstance().map(Constants.UIAUTOMATO...
[ "public", "static", "boolean", "openNotification", "(", ")", "throws", "Exception", "{", "boolean", "success", "=", "false", ";", "// get API level", "int", "apiLevel", "=", "Client", ".", "getInstance", "(", ")", ".", "mapField", "(", "\"android.os.Build$VERSION\...
Open notification shade @return @throws Exception
[ "Open", "notification", "shade" ]
12d242faad50bf90f98657ca9a0c0c3ae1993f07
https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/UIAutomatorClient/src/main/com/groupon/roboremote/uiautomatorclient/components/UiDevice.java#L44-L63
42,701
groupon/robo-remote
UIAutomatorClient/src/main/com/groupon/roboremote/uiautomatorclient/components/UiDevice.java
UiDevice.click
public static boolean click(int x, int y) throws Exception { return Client.getInstance().map(Constants.UIAUTOMATOR_UIDEVICE, "click", x, y).getBoolean(0); }
java
public static boolean click(int x, int y) throws Exception { return Client.getInstance().map(Constants.UIAUTOMATOR_UIDEVICE, "click", x, y).getBoolean(0); }
[ "public", "static", "boolean", "click", "(", "int", "x", ",", "int", "y", ")", "throws", "Exception", "{", "return", "Client", ".", "getInstance", "(", ")", ".", "map", "(", "Constants", ".", "UIAUTOMATOR_UIDEVICE", ",", "\"click\"", ",", "x", ",", "y", ...
Click at x,y position @param x @param y @return @throws Exception
[ "Click", "at", "x", "y", "position" ]
12d242faad50bf90f98657ca9a0c0c3ae1993f07
https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/UIAutomatorClient/src/main/com/groupon/roboremote/uiautomatorclient/components/UiDevice.java#L72-L74
42,702
threerings/nenya
core/src/main/java/com/threerings/media/sprite/FadableImageSprite.java
FadableImageSprite.moveAndFadeIn
public void moveAndFadeIn (Path path, long pathDuration, float fadePortion) { move(path); setAlpha(0.0f); _fadeInDuration = (long)(pathDuration * fadePortion); }
java
public void moveAndFadeIn (Path path, long pathDuration, float fadePortion) { move(path); setAlpha(0.0f); _fadeInDuration = (long)(pathDuration * fadePortion); }
[ "public", "void", "moveAndFadeIn", "(", "Path", "path", ",", "long", "pathDuration", ",", "float", "fadePortion", ")", "{", "move", "(", "path", ")", ";", "setAlpha", "(", "0.0f", ")", ";", "_fadeInDuration", "=", "(", "long", ")", "(", "pathDuration", "...
Puts this sprite on the specified path and fades it in over the specified duration. @param path the path to move along @param fadePortion the portion of time to spend fading in, from 0.0f (no time) to 1.0f (the entire time)
[ "Puts", "this", "sprite", "on", "the", "specified", "path", "and", "fades", "it", "in", "over", "the", "specified", "duration", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/FadableImageSprite.java#L89-L96
42,703
threerings/nenya
core/src/main/java/com/threerings/media/sprite/FadableImageSprite.java
FadableImageSprite.moveAndFadeOut
public void moveAndFadeOut (Path path, long pathDuration, float fadePortion) { move(path); setAlpha(1.0f); _fadeStamp = 0; _pathDuration = pathDuration; _fadeOutDuration = (long)(pathDuration * fadePortion); _fadeDelay = _pathDuration - _fadeOutDuration; }
java
public void moveAndFadeOut (Path path, long pathDuration, float fadePortion) { move(path); setAlpha(1.0f); _fadeStamp = 0; _pathDuration = pathDuration; _fadeOutDuration = (long)(pathDuration * fadePortion); _fadeDelay = _pathDuration - _fadeOutDuration; }
[ "public", "void", "moveAndFadeOut", "(", "Path", "path", ",", "long", "pathDuration", ",", "float", "fadePortion", ")", "{", "move", "(", "path", ")", ";", "setAlpha", "(", "1.0f", ")", ";", "_fadeStamp", "=", "0", ";", "_pathDuration", "=", "pathDuration"...
Puts this sprite on the specified path and fades it out over the specified duration. @param path the path to move along @param pathDuration the duration of the path @param fadePortion the portion of time to spend fading out, from 0.0f (no time) to 1.0f (the entire time)
[ "Puts", "this", "sprite", "on", "the", "specified", "path", "and", "fades", "it", "out", "over", "the", "specified", "duration", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/FadableImageSprite.java#L106-L116
42,704
threerings/nenya
core/src/main/java/com/threerings/media/sprite/FadableImageSprite.java
FadableImageSprite.moveAndFadeInAndOut
public void moveAndFadeInAndOut (Path path, long pathDuration, float fadePortion) { move(path); setAlpha(0.0f); _pathDuration = pathDuration; _fadeInDuration = _fadeOutDuration = (long)(pathDuration * fadePortion); }
java
public void moveAndFadeInAndOut (Path path, long pathDuration, float fadePortion) { move(path); setAlpha(0.0f); _pathDuration = pathDuration; _fadeInDuration = _fadeOutDuration = (long)(pathDuration * fadePortion); }
[ "public", "void", "moveAndFadeInAndOut", "(", "Path", "path", ",", "long", "pathDuration", ",", "float", "fadePortion", ")", "{", "move", "(", "path", ")", ";", "setAlpha", "(", "0.0f", ")", ";", "_pathDuration", "=", "pathDuration", ";", "_fadeInDuration", ...
Puts this sprite on the specified path, fading it in over the specified duration at the beginning and fading it out at the end. @param path the path to move along @param pathDuration the duration of the path @param fadePortion the portion of time to spend fading in/out, from 0.0f (no time) to 1.0f (the entire time)
[ "Puts", "this", "sprite", "on", "the", "specified", "path", "fading", "it", "in", "over", "the", "specified", "duration", "at", "the", "beginning", "and", "fading", "it", "out", "at", "the", "end", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/FadableImageSprite.java#L127-L135
42,705
threerings/nenya
core/src/main/java/com/threerings/media/sprite/FadableImageSprite.java
FadableImageSprite.setAlpha
public void setAlpha (float alpha) { if (alpha < 0.0f) { alpha = 0.0f; } else if (alpha > 1.0f) { alpha = 1.0f; } if (alpha != _alphaComposite.getAlpha()) { _alphaComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha); ...
java
public void setAlpha (float alpha) { if (alpha < 0.0f) { alpha = 0.0f; } else if (alpha > 1.0f) { alpha = 1.0f; } if (alpha != _alphaComposite.getAlpha()) { _alphaComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha); ...
[ "public", "void", "setAlpha", "(", "float", "alpha", ")", "{", "if", "(", "alpha", "<", "0.0f", ")", "{", "alpha", "=", "0.0f", ";", "}", "else", "if", "(", "alpha", ">", "1.0f", ")", "{", "alpha", "=", "1.0f", ";", "}", "if", "(", "alpha", "!=...
Sets the alpha value of this sprite.
[ "Sets", "the", "alpha", "value", "of", "this", "sprite", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/FadableImageSprite.java#L229-L243
42,706
threerings/nenya
core/src/main/java/com/threerings/media/util/PerformanceMonitor.java
PerformanceMonitor.register
public static void register (PerformanceObserver obs, String name, long delta) { // get the observer's action hashtable Map<String, PerformanceAction> actions = _observers.get(obs); if (actions == null) { // create it if it didn't exist _observers.put(obs, actions = M...
java
public static void register (PerformanceObserver obs, String name, long delta) { // get the observer's action hashtable Map<String, PerformanceAction> actions = _observers.get(obs); if (actions == null) { // create it if it didn't exist _observers.put(obs, actions = M...
[ "public", "static", "void", "register", "(", "PerformanceObserver", "obs", ",", "String", "name", ",", "long", "delta", ")", "{", "// get the observer's action hashtable", "Map", "<", "String", ",", "PerformanceAction", ">", "actions", "=", "_observers", ".", "get...
Register a new action with an observer, the action name, and the milliseconds to wait between checkpointing the action's performance. @param obs the action observer. @param name the action name. @param delta the milliseconds between checkpoints.
[ "Register", "a", "new", "action", "with", "an", "observer", "the", "action", "name", "and", "the", "milliseconds", "to", "wait", "between", "checkpointing", "the", "action", "s", "performance", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/PerformanceMonitor.java#L58-L69
42,707
threerings/nenya
core/src/main/java/com/threerings/media/util/PerformanceMonitor.java
PerformanceMonitor.unregister
public static void unregister (PerformanceObserver obs, String name) { // get the observer's action hashtable Map<String, PerformanceAction> actions = _observers.get(obs); if (actions == null) { log.warning("Attempt to unregister by unknown observer " + "[...
java
public static void unregister (PerformanceObserver obs, String name) { // get the observer's action hashtable Map<String, PerformanceAction> actions = _observers.get(obs); if (actions == null) { log.warning("Attempt to unregister by unknown observer " + "[...
[ "public", "static", "void", "unregister", "(", "PerformanceObserver", "obs", ",", "String", "name", ")", "{", "// get the observer's action hashtable", "Map", "<", "String", ",", "PerformanceAction", ">", "actions", "=", "_observers", ".", "get", "(", "obs", ")", ...
Un-register the named action associated with the given observer. @param obs the action observer. @param name the action name.
[ "Un", "-", "register", "the", "named", "action", "associated", "with", "the", "given", "observer", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/PerformanceMonitor.java#L77-L100
42,708
threerings/nenya
core/src/main/java/com/threerings/media/util/PerformanceMonitor.java
PerformanceMonitor.tick
public static void tick (PerformanceObserver obs, String name) { // get the observer's action hashtable Map<String, PerformanceAction> actions = _observers.get(obs); if (actions == null) { log.warning("Attempt to tick by unknown observer " + "[observer=" +...
java
public static void tick (PerformanceObserver obs, String name) { // get the observer's action hashtable Map<String, PerformanceAction> actions = _observers.get(obs); if (actions == null) { log.warning("Attempt to tick by unknown observer " + "[observer=" +...
[ "public", "static", "void", "tick", "(", "PerformanceObserver", "obs", ",", "String", "name", ")", "{", "// get the observer's action hashtable", "Map", "<", "String", ",", "PerformanceAction", ">", "actions", "=", "_observers", ".", "get", "(", "obs", ")", ";",...
Tick the named action associated with the given observer. @param obs the action observer. @param name the action name.
[ "Tick", "the", "named", "action", "associated", "with", "the", "given", "observer", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/PerformanceMonitor.java#L108-L128
42,709
kaazing/java.client
ws/ws/src/main/java/org/kaazing/net/ws/impl/url/WsURLStreamHandlerImpl.java
WsURLStreamHandlerImpl._getSpecURI
private URI _getSpecURI(String spec) { URI specURI = URI.create(spec); if (_scheme.indexOf(':') == -1) { return specURI; } String schemeSpecificPart = specURI.getSchemeSpecificPart(); return URI.create(schemeSpecificPart); }
java
private URI _getSpecURI(String spec) { URI specURI = URI.create(spec); if (_scheme.indexOf(':') == -1) { return specURI; } String schemeSpecificPart = specURI.getSchemeSpecificPart(); return URI.create(schemeSpecificPart); }
[ "private", "URI", "_getSpecURI", "(", "String", "spec", ")", "{", "URI", "specURI", "=", "URI", ".", "create", "(", "spec", ")", ";", "if", "(", "_scheme", ".", "indexOf", "(", "'", "'", ")", "==", "-", "1", ")", "{", "return", "specURI", ";", "}...
the appropriate URI that can be used to retrieve the needed parts.
[ "the", "appropriate", "URI", "that", "can", "be", "used", "to", "retrieve", "the", "needed", "parts", "." ]
25ad2ae5bb24aa9d6b79400fce649b518dcfbe26
https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/net/ws/impl/url/WsURLStreamHandlerImpl.java#L81-L90
42,710
threerings/nenya
core/src/main/java/com/threerings/media/tile/TileSet.java
TileSet.checkTileIndex
protected boolean checkTileIndex (int tileIndex) { int tcount = getTileCount(); if (tileIndex >= 0 && tileIndex < tcount) { return true; } else { log.warning("Requested invalid tile [tset=" + this + ", index=" + tileIndex + "].", new Exception(...
java
protected boolean checkTileIndex (int tileIndex) { int tcount = getTileCount(); if (tileIndex >= 0 && tileIndex < tcount) { return true; } else { log.warning("Requested invalid tile [tset=" + this + ", index=" + tileIndex + "].", new Exception(...
[ "protected", "boolean", "checkTileIndex", "(", "int", "tileIndex", ")", "{", "int", "tcount", "=", "getTileCount", "(", ")", ";", "if", "(", "tileIndex", ">=", "0", "&&", "tileIndex", "<", "tcount", ")", "{", "return", "true", ";", "}", "else", "{", "l...
Used to ensure that the specified tile index is valid.
[ "Used", "to", "ensure", "that", "the", "specified", "tile", "index", "is", "valid", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TileSet.java#L332-L342
42,711
jboss/jboss-jsp-api_spec
src/main/java/javax/servlet/jsp/tagext/TagLibraryInfo.java
TagLibraryInfo.getTag
public TagInfo getTag(String shortname) { TagInfo tags[] = getTags(); if (tags == null || tags.length == 0) { return null; } for (int i=0; i < tags.length; i++) { if (tags[i].getTagName().equals(shortname)) { return tags[i]; } ...
java
public TagInfo getTag(String shortname) { TagInfo tags[] = getTags(); if (tags == null || tags.length == 0) { return null; } for (int i=0; i < tags.length; i++) { if (tags[i].getTagName().equals(shortname)) { return tags[i]; } ...
[ "public", "TagInfo", "getTag", "(", "String", "shortname", ")", "{", "TagInfo", "tags", "[", "]", "=", "getTags", "(", ")", ";", "if", "(", "tags", "==", "null", "||", "tags", ".", "length", "==", "0", ")", "{", "return", "null", ";", "}", "for", ...
Get the TagInfo for a given tag name, looking through all the tags in this tag library. @param shortname The short name (no prefix) of the tag @return the TagInfo for the tag with the specified short name, or null if no such tag is found
[ "Get", "the", "TagInfo", "for", "a", "given", "tag", "name", "looking", "through", "all", "the", "tags", "in", "this", "tag", "library", "." ]
da53166619f33a5134dc3315a3264990cc1f541f
https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/tagext/TagLibraryInfo.java#L185-L198
42,712
jboss/jboss-jsp-api_spec
src/main/java/javax/servlet/jsp/tagext/TagLibraryInfo.java
TagLibraryInfo.getTagFile
public TagFileInfo getTagFile(String shortname) { TagFileInfo tagFiles[] = getTagFiles(); if (tagFiles == null || tagFiles.length == 0) { return null; } for (int i=0; i < tagFiles.length; i++) { if (tagFiles[i].getName().equals(shortname)) { retu...
java
public TagFileInfo getTagFile(String shortname) { TagFileInfo tagFiles[] = getTagFiles(); if (tagFiles == null || tagFiles.length == 0) { return null; } for (int i=0; i < tagFiles.length; i++) { if (tagFiles[i].getName().equals(shortname)) { retu...
[ "public", "TagFileInfo", "getTagFile", "(", "String", "shortname", ")", "{", "TagFileInfo", "tagFiles", "[", "]", "=", "getTagFiles", "(", ")", ";", "if", "(", "tagFiles", "==", "null", "||", "tagFiles", ".", "length", "==", "0", ")", "{", "return", "nul...
Get the TagFileInfo for a given tag name, looking through all the tag files in this tag library. @param shortname The short name (no prefix) of the tag @return the TagFileInfo for the specified Tag file, or null if no Tag file is found @since JSP 2.0
[ "Get", "the", "TagFileInfo", "for", "a", "given", "tag", "name", "looking", "through", "all", "the", "tag", "files", "in", "this", "tag", "library", "." ]
da53166619f33a5134dc3315a3264990cc1f541f
https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/tagext/TagLibraryInfo.java#L209-L222
42,713
jboss/jboss-jsp-api_spec
src/main/java/javax/servlet/jsp/tagext/TagLibraryInfo.java
TagLibraryInfo.getFunction
public FunctionInfo getFunction(String name) { if (functions == null || functions.length == 0) { System.err.println("No functions"); return null; } for (int i=0; i < functions.length; i++) { if (functions[i].getName().equals(name)) { return f...
java
public FunctionInfo getFunction(String name) { if (functions == null || functions.length == 0) { System.err.println("No functions"); return null; } for (int i=0; i < functions.length; i++) { if (functions[i].getName().equals(name)) { return f...
[ "public", "FunctionInfo", "getFunction", "(", "String", "name", ")", "{", "if", "(", "functions", "==", "null", "||", "functions", ".", "length", "==", "0", ")", "{", "System", ".", "err", ".", "println", "(", "\"No functions\"", ")", ";", "return", "nul...
Get the FunctionInfo for a given function name, looking through all the functions in this tag library. @param name The name (no prefix) of the function @return the FunctionInfo for the function with the given name, or null if no such function exists @since JSP 2.0
[ "Get", "the", "FunctionInfo", "for", "a", "given", "function", "name", "looking", "through", "all", "the", "functions", "in", "this", "tag", "library", "." ]
da53166619f33a5134dc3315a3264990cc1f541f
https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/tagext/TagLibraryInfo.java#L245-L258
42,714
threerings/nenya
core/src/main/java/com/threerings/openal/OggStreamDecoder.java
OggStreamDecoder.readSamples
protected int readSamples () throws IOException { int samples; while ((samples = _dsp.synthesis_pcmout(_pcm, _offsets)) <= 0) { if (samples == 0 && !readPacket()) { return 0; } if (_block.synthesis(_packet) == 0) { _dsp.synt...
java
protected int readSamples () throws IOException { int samples; while ((samples = _dsp.synthesis_pcmout(_pcm, _offsets)) <= 0) { if (samples == 0 && !readPacket()) { return 0; } if (_block.synthesis(_packet) == 0) { _dsp.synt...
[ "protected", "int", "readSamples", "(", ")", "throws", "IOException", "{", "int", "samples", ";", "while", "(", "(", "samples", "=", "_dsp", ".", "synthesis_pcmout", "(", "_pcm", ",", "_offsets", ")", ")", "<=", "0", ")", "{", "if", "(", "samples", "==...
Reads a buffer's worth of samples. @return the number of samples read, or zero if we've reached the end of the stream.
[ "Reads", "a", "buffer", "s", "worth", "of", "samples", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/OggStreamDecoder.java#L137-L150
42,715
threerings/nenya
core/src/main/java/com/threerings/openal/OggStreamDecoder.java
OggStreamDecoder.readPacket
protected boolean readPacket () throws IOException { int result; while ((result = _stream.packetout(_packet)) != 1) { if (result == 0 && !readPage()) { return false; } } return true; }
java
protected boolean readPacket () throws IOException { int result; while ((result = _stream.packetout(_packet)) != 1) { if (result == 0 && !readPage()) { return false; } } return true; }
[ "protected", "boolean", "readPacket", "(", ")", "throws", "IOException", "{", "int", "result", ";", "while", "(", "(", "result", "=", "_stream", ".", "packetout", "(", "_packet", ")", ")", "!=", "1", ")", "{", "if", "(", "result", "==", "0", "&&", "!...
Reads a packet. @return true if a packet was read, false if we've reached the end of the stream.
[ "Reads", "a", "packet", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/OggStreamDecoder.java#L157-L167
42,716
threerings/nenya
core/src/main/java/com/threerings/openal/OggStreamDecoder.java
OggStreamDecoder.readPage
protected boolean readPage () throws IOException { int result; while ((result = _sync.pageout(_page)) != 1) { if (result == 0 && !readChunk()) { return false; } } _stream.pagein(_page); return true; }
java
protected boolean readPage () throws IOException { int result; while ((result = _sync.pageout(_page)) != 1) { if (result == 0 && !readChunk()) { return false; } } _stream.pagein(_page); return true; }
[ "protected", "boolean", "readPage", "(", ")", "throws", "IOException", "{", "int", "result", ";", "while", "(", "(", "result", "=", "_sync", ".", "pageout", "(", "_page", ")", ")", "!=", "1", ")", "{", "if", "(", "result", "==", "0", "&&", "!", "re...
Reads in a page. @return true if a page was read, false if we've reached the end of the stream.
[ "Reads", "in", "a", "page", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/OggStreamDecoder.java#L174-L185
42,717
threerings/nenya
core/src/main/java/com/threerings/openal/OggStreamDecoder.java
OggStreamDecoder.readChunk
protected boolean readChunk () throws IOException { int offset = _sync.buffer(BUFFER_SIZE); int bytes = _in.read(_sync.data, offset, BUFFER_SIZE); if (bytes > 0) { _sync.wrote(bytes); return true; } return false; }
java
protected boolean readChunk () throws IOException { int offset = _sync.buffer(BUFFER_SIZE); int bytes = _in.read(_sync.data, offset, BUFFER_SIZE); if (bytes > 0) { _sync.wrote(bytes); return true; } return false; }
[ "protected", "boolean", "readChunk", "(", ")", "throws", "IOException", "{", "int", "offset", "=", "_sync", ".", "buffer", "(", "BUFFER_SIZE", ")", ";", "int", "bytes", "=", "_in", ".", "read", "(", "_sync", ".", "data", ",", "offset", ",", "BUFFER_SIZE"...
Reads in a chunk of data from the underlying input stream. @return true if a chunk was read, false if we've reached the end of the stream.
[ "Reads", "in", "a", "chunk", "of", "data", "from", "the", "underlying", "input", "stream", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/OggStreamDecoder.java#L192-L202
42,718
threerings/nenya
core/src/main/java/com/threerings/media/tile/TrimmedTileSet.java
TrimmedTileSet.trimTileSet
public static TrimmedTileSet trimTileSet (TileSet source, OutputStream destImage) throws IOException { return trimTileSet(source, destImage, FastImageIO.FILE_SUFFIX); }
java
public static TrimmedTileSet trimTileSet (TileSet source, OutputStream destImage) throws IOException { return trimTileSet(source, destImage, FastImageIO.FILE_SUFFIX); }
[ "public", "static", "TrimmedTileSet", "trimTileSet", "(", "TileSet", "source", ",", "OutputStream", "destImage", ")", "throws", "IOException", "{", "return", "trimTileSet", "(", "source", ",", "destImage", ",", "FastImageIO", ".", "FILE_SUFFIX", ")", ";", "}" ]
Convenience function to trim the tile set and save it using FastImageIO.
[ "Convenience", "function", "to", "trim", "the", "tile", "set", "and", "save", "it", "using", "FastImageIO", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TrimmedTileSet.java#L67-L71
42,719
threerings/nenya
core/src/main/java/com/threerings/resource/FileResourceBundle.java
FileResourceBundle.sourceIsReady
public boolean sourceIsReady () { // make a note of our source's last modification time _sourceLastMod = _source.lastModified(); // if we are unpacking files, the time to do so is now if (_unpacked != null && _unpacked.lastModified() != _sourceLastMod) { try { ...
java
public boolean sourceIsReady () { // make a note of our source's last modification time _sourceLastMod = _source.lastModified(); // if we are unpacking files, the time to do so is now if (_unpacked != null && _unpacked.lastModified() != _sourceLastMod) { try { ...
[ "public", "boolean", "sourceIsReady", "(", ")", "{", "// make a note of our source's last modification time", "_sourceLastMod", "=", "_source", ".", "lastModified", "(", ")", ";", "// if we are unpacking files, the time to do so is now", "if", "(", "_unpacked", "!=", "null", ...
Called by the resource manager once it has ensured that our resource jar file is up to date and ready for reading. @return true if we successfully unpacked our resources, false if we encountered errors in doing so.
[ "Called", "by", "the", "resource", "manager", "once", "it", "has", "ensured", "that", "our", "resource", "jar", "file", "is", "up", "to", "date", "and", "ready", "for", "reading", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/FileResourceBundle.java#L124-L172
42,720
threerings/nenya
core/src/main/java/com/threerings/resource/FileResourceBundle.java
FileResourceBundle.wipeBundle
public void wipeBundle (boolean deleteJar) { // clear out our cache directory if (_cache != null) { FileUtil.recursiveClean(_cache); } // delete our unpack stamp file if (_unpacked != null) { _unpacked.delete(); } // clear out any .ja...
java
public void wipeBundle (boolean deleteJar) { // clear out our cache directory if (_cache != null) { FileUtil.recursiveClean(_cache); } // delete our unpack stamp file if (_unpacked != null) { _unpacked.delete(); } // clear out any .ja...
[ "public", "void", "wipeBundle", "(", "boolean", "deleteJar", ")", "{", "// clear out our cache directory", "if", "(", "_cache", "!=", "null", ")", "{", "FileUtil", ".", "recursiveClean", "(", "_cache", ")", ";", "}", "// delete our unpack stamp file", "if", "(", ...
Clears out everything associated with this resource bundle in the hopes that we can download it afresh and everything will work the next time around.
[ "Clears", "out", "everything", "associated", "with", "this", "resource", "bundle", "in", "the", "hopes", "that", "we", "can", "download", "it", "afresh", "and", "everything", "will", "work", "the", "next", "time", "around", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/FileResourceBundle.java#L178-L205
42,721
threerings/nenya
core/src/main/java/com/threerings/resource/FileResourceBundle.java
FileResourceBundle.getResourceFile
public File getResourceFile (String path) throws IOException { if (resolveJarFile()) { return null; } // if we have been unpacked, return our unpacked file if (_cache != null) { File cfile = new File(_cache, path); if (cfile.exists()) { ...
java
public File getResourceFile (String path) throws IOException { if (resolveJarFile()) { return null; } // if we have been unpacked, return our unpacked file if (_cache != null) { File cfile = new File(_cache, path); if (cfile.exists()) { ...
[ "public", "File", "getResourceFile", "(", "String", "path", ")", "throws", "IOException", "{", "if", "(", "resolveJarFile", "(", ")", ")", "{", "return", "null", ";", "}", "// if we have been unpacked, return our unpacked file", "if", "(", "_cache", "!=", "null", ...
Returns a file from which the specified resource can be loaded. This method will unpack the resource into a temporary directory and return a reference to that file. @param path the path to the resource in this jar file. @return a file from which the resource can be loaded or null if no such resource exists.
[ "Returns", "a", "file", "from", "which", "the", "specified", "resource", "can", "be", "loaded", ".", "This", "method", "will", "unpack", "the", "resource", "into", "a", "temporary", "directory", "and", "return", "a", "reference", "to", "that", "file", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/FileResourceBundle.java#L215-L253
42,722
threerings/nenya
core/src/main/java/com/threerings/resource/FileResourceBundle.java
FileResourceBundle.containsResource
public boolean containsResource (String path) { try { if (resolveJarFile()) { return false; } return (_jarSource.getJarEntry(path) != null); } catch (IOException ioe) { return false; } }
java
public boolean containsResource (String path) { try { if (resolveJarFile()) { return false; } return (_jarSource.getJarEntry(path) != null); } catch (IOException ioe) { return false; } }
[ "public", "boolean", "containsResource", "(", "String", "path", ")", "{", "try", "{", "if", "(", "resolveJarFile", "(", ")", ")", "{", "return", "false", ";", "}", "return", "(", "_jarSource", ".", "getJarEntry", "(", "path", ")", "!=", "null", ")", ";...
Returns true if this resource bundle contains the resource with the specified path. This avoids actually loading the resource, in the event that the caller only cares to know that the resource exists.
[ "Returns", "true", "if", "this", "resource", "bundle", "contains", "the", "resource", "with", "the", "specified", "path", ".", "This", "avoids", "actually", "loading", "the", "resource", "in", "the", "event", "that", "the", "caller", "only", "cares", "to", "...
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/FileResourceBundle.java#L260-L270
42,723
threerings/nenya
core/src/main/java/com/threerings/resource/FileResourceBundle.java
FileResourceBundle.resolveJarFile
protected boolean resolveJarFile () throws IOException { // if we don't yet have our resource bundle's last mod time, we // have not yet been notified that it is ready if (_sourceLastMod == -1) { return true; } if (!_source.exists()) { throw n...
java
protected boolean resolveJarFile () throws IOException { // if we don't yet have our resource bundle's last mod time, we // have not yet been notified that it is ready if (_sourceLastMod == -1) { return true; } if (!_source.exists()) { throw n...
[ "protected", "boolean", "resolveJarFile", "(", ")", "throws", "IOException", "{", "// if we don't yet have our resource bundle's last mod time, we", "// have not yet been notified that it is ready", "if", "(", "_sourceLastMod", "==", "-", "1", ")", "{", "return", "true", ";",...
Creates the internal jar file reference if we've not already got it; we do this lazily so as to avoid any jar- or zip-file-related antics until and unless doing so is required, and because the resource manager would like to be able to create bundles before the associated files have been fully downloaded. @return true ...
[ "Creates", "the", "internal", "jar", "file", "reference", "if", "we", "ve", "not", "already", "got", "it", ";", "we", "do", "this", "lazily", "so", "as", "to", "avoid", "any", "jar", "-", "or", "zip", "-", "file", "-", "related", "antics", "until", "...
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/FileResourceBundle.java#L294-L318
42,724
threerings/nenya
core/src/main/java/com/threerings/resource/FileResourceBundle.java
FileResourceBundle.getCacheDir
public static File getCacheDir () { if (_tmpdir == null) { String tmpdir = System.getProperty("java.io.tmpdir"); if (tmpdir == null) { log.info("No system defined temp directory. Faking it."); tmpdir = System.getProperty("user.home"); } ...
java
public static File getCacheDir () { if (_tmpdir == null) { String tmpdir = System.getProperty("java.io.tmpdir"); if (tmpdir == null) { log.info("No system defined temp directory. Faking it."); tmpdir = System.getProperty("user.home"); } ...
[ "public", "static", "File", "getCacheDir", "(", ")", "{", "if", "(", "_tmpdir", "==", "null", ")", "{", "String", "tmpdir", "=", "System", ".", "getProperty", "(", "\"java.io.tmpdir\"", ")", ";", "if", "(", "tmpdir", "==", "null", ")", "{", "log", ".",...
Returns the cache directory used for unpacked resources.
[ "Returns", "the", "cache", "directory", "used", "for", "unpacked", "resources", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/FileResourceBundle.java#L337-L348
42,725
threerings/nenya
core/src/main/java/com/threerings/resource/FileResourceBundle.java
FileResourceBundle.setCacheDir
public static void setCacheDir (File tmpdir) { String rando = Long.toHexString((long)(Math.random() * Long.MAX_VALUE)); _tmpdir = new File(tmpdir, "narcache_" + rando); if (!_tmpdir.exists()) { if (_tmpdir.mkdirs()) { log.debug("Created narya temp cache directory ...
java
public static void setCacheDir (File tmpdir) { String rando = Long.toHexString((long)(Math.random() * Long.MAX_VALUE)); _tmpdir = new File(tmpdir, "narcache_" + rando); if (!_tmpdir.exists()) { if (_tmpdir.mkdirs()) { log.debug("Created narya temp cache directory ...
[ "public", "static", "void", "setCacheDir", "(", "File", "tmpdir", ")", "{", "String", "rando", "=", "Long", ".", "toHexString", "(", "(", "long", ")", "(", "Math", ".", "random", "(", ")", "*", "Long", ".", "MAX_VALUE", ")", ")", ";", "_tmpdir", "=",...
Specifies the directory in which our temporary resource files should be stored.
[ "Specifies", "the", "directory", "in", "which", "our", "temporary", "resource", "files", "should", "be", "stored", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/FileResourceBundle.java#L353-L373
42,726
threerings/nenya
core/src/main/java/com/threerings/resource/FileResourceBundle.java
FileResourceBundle.stripSuffix
protected static String stripSuffix (String path) { if (path.endsWith(".jar")) { return path.substring(0, path.length()-4); } else { // we have to change the path somehow return path + "-cache"; } }
java
protected static String stripSuffix (String path) { if (path.endsWith(".jar")) { return path.substring(0, path.length()-4); } else { // we have to change the path somehow return path + "-cache"; } }
[ "protected", "static", "String", "stripSuffix", "(", "String", "path", ")", "{", "if", "(", "path", ".", "endsWith", "(", "\".jar\"", ")", ")", "{", "return", "path", ".", "substring", "(", "0", ",", "path", ".", "length", "(", ")", "-", "4", ")", ...
Strips the .jar off of jar file paths.
[ "Strips", "the", ".", "jar", "off", "of", "jar", "file", "paths", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/FileResourceBundle.java#L376-L384
42,727
calrissian/mango
mango-core/src/main/java/org/calrissian/mango/collect/CloseableIterators.java
CloseableIterators.distinct
public static <T> CloseableIterator<T> distinct(final CloseableIterator<T> iterator) { return wrap(Iterators2.distinct(iterator), iterator); }
java
public static <T> CloseableIterator<T> distinct(final CloseableIterator<T> iterator) { return wrap(Iterators2.distinct(iterator), iterator); }
[ "public", "static", "<", "T", ">", "CloseableIterator", "<", "T", ">", "distinct", "(", "final", "CloseableIterator", "<", "T", ">", "iterator", ")", "{", "return", "wrap", "(", "Iterators2", ".", "distinct", "(", "iterator", ")", ",", "iterator", ")", "...
If we can assume the closeable iterator is sorted, return the distinct elements. This only works if the data provided is sorted.
[ "If", "we", "can", "assume", "the", "closeable", "iterator", "is", "sorted", "return", "the", "distinct", "elements", ".", "This", "only", "works", "if", "the", "data", "provided", "is", "sorted", "." ]
a95aa5e77af9aa0e629787228d80806560023452
https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/collect/CloseableIterators.java#L91-L93
42,728
groupon/monsoon
intf/src/main/java/com/groupon/lex/metrics/Histogram.java
Histogram.stream
public Stream<RangeWithCount> stream() { return buckets_.stream() .map(bucket -> new RangeWithCount(bucket.getRange(), bucket.getEvents())); }
java
public Stream<RangeWithCount> stream() { return buckets_.stream() .map(bucket -> new RangeWithCount(bucket.getRange(), bucket.getEvents())); }
[ "public", "Stream", "<", "RangeWithCount", ">", "stream", "(", ")", "{", "return", "buckets_", ".", "stream", "(", ")", ".", "map", "(", "bucket", "->", "new", "RangeWithCount", "(", "bucket", ".", "getRange", "(", ")", ",", "bucket", ".", "getEvents", ...
Returns a map of range -&gt; event count. The elements of the stream are a mutable copy of the internal data.
[ "Returns", "a", "map", "of", "range", "-", "&gt", ";", "event", "count", ".", "The", "elements", "of", "the", "stream", "are", "a", "mutable", "copy", "of", "the", "internal", "data", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/Histogram.java#L79-L82
42,729
groupon/monsoon
intf/src/main/java/com/groupon/lex/metrics/Histogram.java
Histogram.avg
public Optional<Double> avg() { if (isEmpty()) return Optional.empty(); return Optional.of(sum() / getEventCount()); }
java
public Optional<Double> avg() { if (isEmpty()) return Optional.empty(); return Optional.of(sum() / getEventCount()); }
[ "public", "Optional", "<", "Double", ">", "avg", "(", ")", "{", "if", "(", "isEmpty", "(", ")", ")", "return", "Optional", ".", "empty", "(", ")", ";", "return", "Optional", ".", "of", "(", "sum", "(", ")", "/", "getEventCount", "(", ")", ")", ";...
Return the average of the histogram.
[ "Return", "the", "average", "of", "the", "histogram", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/Histogram.java#L125-L128
42,730
groupon/monsoon
intf/src/main/java/com/groupon/lex/metrics/Histogram.java
Histogram.sum
public double sum() { return buckets_.stream() .mapToDouble(b -> b.getRange().getMidPoint() * b.getEvents()) .sum(); }
java
public double sum() { return buckets_.stream() .mapToDouble(b -> b.getRange().getMidPoint() * b.getEvents()) .sum(); }
[ "public", "double", "sum", "(", ")", "{", "return", "buckets_", ".", "stream", "(", ")", ".", "mapToDouble", "(", "b", "->", "b", ".", "getRange", "(", ")", ".", "getMidPoint", "(", ")", "*", "b", ".", "getEvents", "(", ")", ")", ".", "sum", "(",...
Return the sum of the histogram.
[ "Return", "the", "sum", "of", "the", "histogram", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/Histogram.java#L133-L137
42,731
groupon/monsoon
intf/src/main/java/com/groupon/lex/metrics/Histogram.java
Histogram.get
public double get(double index) { ListIterator<Bucket> b = buckets_.listIterator(0); ListIterator<Bucket> e = buckets_.listIterator(buckets_.size()); while (b.nextIndex() < e.previousIndex()) { final ListIterator<Bucket> mid = buckets_.listIterator(b.nextIndex() / 2 + e.nextIndex() ...
java
public double get(double index) { ListIterator<Bucket> b = buckets_.listIterator(0); ListIterator<Bucket> e = buckets_.listIterator(buckets_.size()); while (b.nextIndex() < e.previousIndex()) { final ListIterator<Bucket> mid = buckets_.listIterator(b.nextIndex() / 2 + e.nextIndex() ...
[ "public", "double", "get", "(", "double", "index", ")", "{", "ListIterator", "<", "Bucket", ">", "b", "=", "buckets_", ".", "listIterator", "(", "0", ")", ";", "ListIterator", "<", "Bucket", ">", "e", "=", "buckets_", ".", "listIterator", "(", "buckets_"...
Get the value at a given position.
[ "Get", "the", "value", "at", "a", "given", "position", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/Histogram.java#L142-L171
42,732
groupon/monsoon
intf/src/main/java/com/groupon/lex/metrics/Histogram.java
Histogram.modifyEventCounters
public Histogram modifyEventCounters(BiFunction<Range, Double, Double> fn) { return new Histogram(stream() .map(entry -> { entry.setCount(fn.apply(entry.getRange(), entry.getCount())); return entry; })); }
java
public Histogram modifyEventCounters(BiFunction<Range, Double, Double> fn) { return new Histogram(stream() .map(entry -> { entry.setCount(fn.apply(entry.getRange(), entry.getCount())); return entry; })); }
[ "public", "Histogram", "modifyEventCounters", "(", "BiFunction", "<", "Range", ",", "Double", ",", "Double", ">", "fn", ")", "{", "return", "new", "Histogram", "(", "stream", "(", ")", ".", "map", "(", "entry", "->", "{", "entry", ".", "setCount", "(", ...
Create a new histogram, after applying the function on each of the event counters.
[ "Create", "a", "new", "histogram", "after", "applying", "the", "function", "on", "each", "of", "the", "event", "counters", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/Histogram.java#L184-L190
42,733
groupon/monsoon
intf/src/main/java/com/groupon/lex/metrics/Histogram.java
Histogram.add
public static Histogram add(Histogram x, Histogram y) { return new Histogram(Stream.concat(x.stream(), y.stream())); }
java
public static Histogram add(Histogram x, Histogram y) { return new Histogram(Stream.concat(x.stream(), y.stream())); }
[ "public", "static", "Histogram", "add", "(", "Histogram", "x", ",", "Histogram", "y", ")", "{", "return", "new", "Histogram", "(", "Stream", ".", "concat", "(", "x", ".", "stream", "(", ")", ",", "y", ".", "stream", "(", ")", ")", ")", ";", "}" ]
Add two histograms together.
[ "Add", "two", "histograms", "together", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/Histogram.java#L195-L197
42,734
groupon/monsoon
intf/src/main/java/com/groupon/lex/metrics/Histogram.java
Histogram.subtract
public static Histogram subtract(Histogram x, Histogram y) { return new Histogram(Stream.concat( x.stream(), y.stream().map(rwc -> { rwc.setCount(-rwc.getCount()); return rwc; }))); }
java
public static Histogram subtract(Histogram x, Histogram y) { return new Histogram(Stream.concat( x.stream(), y.stream().map(rwc -> { rwc.setCount(-rwc.getCount()); return rwc; }))); }
[ "public", "static", "Histogram", "subtract", "(", "Histogram", "x", ",", "Histogram", "y", ")", "{", "return", "new", "Histogram", "(", "Stream", ".", "concat", "(", "x", ".", "stream", "(", ")", ",", "y", ".", "stream", "(", ")", ".", "map", "(", ...
Subtracts two histograms. @throws IllegalArgumentException If the result contains mixed signs.
[ "Subtracts", "two", "histograms", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/Histogram.java#L211-L218
42,735
groupon/monsoon
intf/src/main/java/com/groupon/lex/metrics/Histogram.java
Histogram.multiply
public static Histogram multiply(Histogram x, double y) { return x.modifyEventCounters((r, d) -> d * y); }
java
public static Histogram multiply(Histogram x, double y) { return x.modifyEventCounters((r, d) -> d * y); }
[ "public", "static", "Histogram", "multiply", "(", "Histogram", "x", ",", "double", "y", ")", "{", "return", "x", ".", "modifyEventCounters", "(", "(", "r", ",", "d", ")", "->", "d", "*", "y", ")", ";", "}" ]
Multiply histogram by scalar.
[ "Multiply", "histogram", "by", "scalar", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/Histogram.java#L223-L225
42,736
groupon/monsoon
intf/src/main/java/com/groupon/lex/metrics/Histogram.java
Histogram.divide
public static Histogram divide(Histogram x, double y) { return x.modifyEventCounters((r, d) -> d / y); }
java
public static Histogram divide(Histogram x, double y) { return x.modifyEventCounters((r, d) -> d / y); }
[ "public", "static", "Histogram", "divide", "(", "Histogram", "x", ",", "double", "y", ")", "{", "return", "x", ".", "modifyEventCounters", "(", "(", "r", ",", "d", ")", "->", "d", "/", "y", ")", ";", "}" ]
Divide histogram by scalar.
[ "Divide", "histogram", "by", "scalar", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/Histogram.java#L230-L232
42,737
groupon/monsoon
intf/src/main/java/com/groupon/lex/metrics/Histogram.java
Histogram.compareTo
@Override public int compareTo(Histogram o) { int cmp = 0; final Iterator<Bucket> iter = buckets_.iterator(), o_iter = o.buckets_.iterator(); while (cmp == 0 && iter.hasNext() && o_iter.hasNext()) { final Bucket next = iter.next(), o_next = o_iter.next(); cmp = Double...
java
@Override public int compareTo(Histogram o) { int cmp = 0; final Iterator<Bucket> iter = buckets_.iterator(), o_iter = o.buckets_.iterator(); while (cmp == 0 && iter.hasNext() && o_iter.hasNext()) { final Bucket next = iter.next(), o_next = o_iter.next(); cmp = Double...
[ "@", "Override", "public", "int", "compareTo", "(", "Histogram", "o", ")", "{", "int", "cmp", "=", "0", ";", "final", "Iterator", "<", "Bucket", ">", "iter", "=", "buckets_", ".", "iterator", "(", ")", ",", "o_iter", "=", "o", ".", "buckets_", ".", ...
Compare two histograms.
[ "Compare", "two", "histograms", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/Histogram.java#L259-L275
42,738
jdillon/gshell
gshell-util/src/main/java/com/planet57/gshell/util/converter/collections/MapConverterSupport.java
MapConverterSupport.convertToObject
@Override protected final Object convertToObject(final String text) throws Exception { Map map = CollectionUtil.toMap(text, keyEditor, valueEditor); if (map == null) { return null; } return createMap(map); }
java
@Override protected final Object convertToObject(final String text) throws Exception { Map map = CollectionUtil.toMap(text, keyEditor, valueEditor); if (map == null) { return null; } return createMap(map); }
[ "@", "Override", "protected", "final", "Object", "convertToObject", "(", "final", "String", "text", ")", "throws", "Exception", "{", "Map", "map", "=", "CollectionUtil", ".", "toMap", "(", "text", ",", "keyEditor", ",", "valueEditor", ")", ";", "if", "(", ...
Treats the text value of this property as an input stream that is converted into a Property bundle. @return a Properties object @throws ConversionException An error occurred creating the Properties object.
[ "Treats", "the", "text", "value", "of", "this", "property", "as", "an", "input", "stream", "that", "is", "converted", "into", "a", "Property", "bundle", "." ]
b587c1a4672d2e4905871462fa3b38a1f7b94e90
https://github.com/jdillon/gshell/blob/b587c1a4672d2e4905871462fa3b38a1f7b94e90/gshell-util/src/main/java/com/planet57/gshell/util/converter/collections/MapConverterSupport.java#L56-L63
42,739
Systemdir/GML-Writer-for-yED
Example/src/com/github/systemdir/gml/examples/example1/ExampleGraphicsProvider.java
ExampleGraphicsProvider.getGroupGraphics
@Nullable @Override public NodeGraphicDefinition getGroupGraphics(Object group, Set<String> groupElements) { return null; }
java
@Nullable @Override public NodeGraphicDefinition getGroupGraphics(Object group, Set<String> groupElements) { return null; }
[ "@", "Nullable", "@", "Override", "public", "NodeGraphicDefinition", "getGroupGraphics", "(", "Object", "group", ",", "Set", "<", "String", ">", "groupElements", ")", "{", "return", "null", ";", "}" ]
we have no groups in this example
[ "we", "have", "no", "groups", "in", "this", "example" ]
353ecf132929889cb15968865283ee511f7c8d87
https://github.com/Systemdir/GML-Writer-for-yED/blob/353ecf132929889cb15968865283ee511f7c8d87/Example/src/com/github/systemdir/gml/examples/example1/ExampleGraphicsProvider.java#L36-L40
42,740
groupon/monsoon
processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java
WavefrontStrings.name
public static final String name(SimpleGroupPath group, MetricName metric) { return name(Stream.concat(group.getPath().stream(), metric.getPath().stream()) .collect(Collectors.joining("."))); }
java
public static final String name(SimpleGroupPath group, MetricName metric) { return name(Stream.concat(group.getPath().stream(), metric.getPath().stream()) .collect(Collectors.joining("."))); }
[ "public", "static", "final", "String", "name", "(", "SimpleGroupPath", "group", ",", "MetricName", "metric", ")", "{", "return", "name", "(", "Stream", ".", "concat", "(", "group", ".", "getPath", "(", ")", ".", "stream", "(", ")", ",", "metric", ".", ...
Convert a group+metric to a wavefront name. Concatenates the paths of a Group and a Metric, separating each path element with a dot ('.'). Example: - group path: [ 'example', 'group', 'path' ] - and metric: [ 'metric', 'name' ] are concatenated into "example.group.path.metric.name". The concatenated name is cleaned ...
[ "Convert", "a", "group", "+", "metric", "to", "a", "wavefront", "name", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java#L80-L83
42,741
groupon/monsoon
processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java
WavefrontStrings.createTagEntry
private static Optional<Map.Entry<String, String>> createTagEntry(Map.Entry<String, MetricValue> tag_entry) { final Optional<String> opt_tag_value = tag_entry.getValue().asString(); return opt_tag_value .map(tag_value -> SimpleMapEntry.create(name(tag_entry.getKey()), escapeTagValue(tag_...
java
private static Optional<Map.Entry<String, String>> createTagEntry(Map.Entry<String, MetricValue> tag_entry) { final Optional<String> opt_tag_value = tag_entry.getValue().asString(); return opt_tag_value .map(tag_value -> SimpleMapEntry.create(name(tag_entry.getKey()), escapeTagValue(tag_...
[ "private", "static", "Optional", "<", "Map", ".", "Entry", "<", "String", ",", "String", ">", ">", "createTagEntry", "(", "Map", ".", "Entry", "<", "String", ",", "MetricValue", ">", "tag_entry", ")", "{", "final", "Optional", "<", "String", ">", "opt_ta...
Transform a tag entry into a wavefront tag. Double quotes in the tag value will be escaped.
[ "Transform", "a", "tag", "entry", "into", "a", "wavefront", "tag", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java#L100-L104
42,742
groupon/monsoon
processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java
WavefrontStrings.maybeTruncateTagEntry
private static Map.Entry<String, String> maybeTruncateTagEntry(Map.Entry<String, String> tag_entry) { String k = tag_entry.getKey(); String v = tag_entry.getValue(); if (k.length() + v.length() <= MAX_TAG_KEY_VAL_CHARS - 2) // 2 chars for the quotes around the value return tag_entry;...
java
private static Map.Entry<String, String> maybeTruncateTagEntry(Map.Entry<String, String> tag_entry) { String k = tag_entry.getKey(); String v = tag_entry.getValue(); if (k.length() + v.length() <= MAX_TAG_KEY_VAL_CHARS - 2) // 2 chars for the quotes around the value return tag_entry;...
[ "private", "static", "Map", ".", "Entry", "<", "String", ",", "String", ">", "maybeTruncateTagEntry", "(", "Map", ".", "Entry", "<", "String", ",", "String", ">", "tag_entry", ")", "{", "String", "k", "=", "tag_entry", ".", "getKey", "(", ")", ";", "St...
Truncate tag keys and values, to prevent them from exceeding the max length of a tag entry.
[ "Truncate", "tag", "keys", "and", "values", "to", "prevent", "them", "from", "exceeding", "the", "max", "length", "of", "a", "tag", "entry", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java#L110-L121
42,743
groupon/monsoon
processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java
WavefrontStrings.tags
public static Map<String, String> tags(Tags tags) { return tags.stream() .map(WavefrontStrings::createTagEntry) .flatMap(opt -> opt.map(Stream::of).orElseGet(Stream::empty)) .map(WavefrontStrings::maybeTruncateTagEntry) .collect(Collectors.toMap(Ma...
java
public static Map<String, String> tags(Tags tags) { return tags.stream() .map(WavefrontStrings::createTagEntry) .flatMap(opt -> opt.map(Stream::of).orElseGet(Stream::empty)) .map(WavefrontStrings::maybeTruncateTagEntry) .collect(Collectors.toMap(Ma...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "tags", "(", "Tags", "tags", ")", "{", "return", "tags", ".", "stream", "(", ")", ".", "map", "(", "WavefrontStrings", "::", "createTagEntry", ")", ".", "flatMap", "(", "opt", "->", "opt", ...
Create a map of tags for wavefront. The tag values are escaped and should be surrounded by double quotes. This function does not put the surrounding quotes around the tag values.
[ "Create", "a", "map", "of", "tags", "for", "wavefront", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java#L129-L135
42,744
groupon/monsoon
processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java
WavefrontStrings.wavefrontValue
public static Optional<String> wavefrontValue(MetricValue mv) { // Omit NaN and Inf. if (mv.isInfiniteOrNaN()) return Optional.empty(); return mv.value().map(Number::toString); }
java
public static Optional<String> wavefrontValue(MetricValue mv) { // Omit NaN and Inf. if (mv.isInfiniteOrNaN()) return Optional.empty(); return mv.value().map(Number::toString); }
[ "public", "static", "Optional", "<", "String", ">", "wavefrontValue", "(", "MetricValue", "mv", ")", "{", "// Omit NaN and Inf.", "if", "(", "mv", ".", "isInfiniteOrNaN", "(", ")", ")", "return", "Optional", ".", "empty", "(", ")", ";", "return", "mv", "."...
Create a wavefront compatible string representation of the metric value. If the metric value is empty or not representable in wavefront, an empty optional will be returned.
[ "Create", "a", "wavefront", "compatible", "string", "representation", "of", "the", "metric", "value", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java#L143-L147
42,745
groupon/monsoon
processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java
WavefrontStrings.extractTagSource
private static String extractTagSource(Map<String, String> tag_map) { return Optional.ofNullable(tag_map.remove("source")) .orElseGet(() -> { return Optional.ofNullable(tag_map.get("cluster")) .map(WavefrontStrings::escapeTagValue) ...
java
private static String extractTagSource(Map<String, String> tag_map) { return Optional.ofNullable(tag_map.remove("source")) .orElseGet(() -> { return Optional.ofNullable(tag_map.get("cluster")) .map(WavefrontStrings::escapeTagValue) ...
[ "private", "static", "String", "extractTagSource", "(", "Map", "<", "String", ",", "String", ">", "tag_map", ")", "{", "return", "Optional", ".", "ofNullable", "(", "tag_map", ".", "remove", "(", "\"source\"", ")", ")", ".", "orElseGet", "(", "(", ")", "...
Extract the 'source' tag from the tag_map. Wavefront requires the 'source' tag to be the first tag on the line, hence the special handling. It also *must* be present, so we can never return null.
[ "Extract", "the", "source", "tag", "from", "the", "tag_map", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java#L164-L171
42,746
groupon/monsoon
processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java
WavefrontStrings.wavefrontLine
private static String wavefrontLine(DateTime ts, SimpleGroupPath group, MetricName metric, String value, String source, Map<String, String> tag_map) { return new StringBuilder() .append(name(group, metric)) .append(' ') .append(value) .append(' ') ...
java
private static String wavefrontLine(DateTime ts, SimpleGroupPath group, MetricName metric, String value, String source, Map<String, String> tag_map) { return new StringBuilder() .append(name(group, metric)) .append(' ') .append(value) .append(' ') ...
[ "private", "static", "String", "wavefrontLine", "(", "DateTime", "ts", ",", "SimpleGroupPath", "group", ",", "MetricName", "metric", ",", "String", "value", ",", "String", "source", ",", "Map", "<", "String", ",", "String", ">", "tag_map", ")", "{", "return"...
Build the wavefront line from its parts.
[ "Build", "the", "wavefront", "line", "from", "its", "parts", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java#L176-L191
42,747
groupon/monsoon
processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java
WavefrontStrings.wavefrontLine
public static Optional<String> wavefrontLine(DateTime ts, GroupName group, MetricName metric, MetricValue metric_value) { return wavefrontValue(metric_value) .map(value -> { final Map<String, String> tag_map = tags(group.getTags()); final String source = e...
java
public static Optional<String> wavefrontLine(DateTime ts, GroupName group, MetricName metric, MetricValue metric_value) { return wavefrontValue(metric_value) .map(value -> { final Map<String, String> tag_map = tags(group.getTags()); final String source = e...
[ "public", "static", "Optional", "<", "String", ">", "wavefrontLine", "(", "DateTime", "ts", ",", "GroupName", "group", ",", "MetricName", "metric", ",", "MetricValue", "metric_value", ")", "{", "return", "wavefrontValue", "(", "metric_value", ")", ".", "map", ...
Convert a metric to a wavefront string. Empty metrics and histograms do not emit a value. Note: the line is not terminated with a newline.
[ "Convert", "a", "metric", "to", "a", "wavefront", "string", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java#L200-L207
42,748
groupon/monsoon
processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java
WavefrontStrings.wavefrontLine
public static Stream<String> wavefrontLine(DateTime ts, TimeSeriesValue tsv) { final GroupName group = tsv.getGroup(); return tsv.getMetrics().entrySet().stream() .flatMap(metricEntry -> wavefrontLineForMetric(ts, group, metricEntry)); }
java
public static Stream<String> wavefrontLine(DateTime ts, TimeSeriesValue tsv) { final GroupName group = tsv.getGroup(); return tsv.getMetrics().entrySet().stream() .flatMap(metricEntry -> wavefrontLineForMetric(ts, group, metricEntry)); }
[ "public", "static", "Stream", "<", "String", ">", "wavefrontLine", "(", "DateTime", "ts", ",", "TimeSeriesValue", "tsv", ")", "{", "final", "GroupName", "group", "=", "tsv", ".", "getGroup", "(", ")", ";", "return", "tsv", ".", "getMetrics", "(", ")", "....
Convert a time series value into the string entries for wavefront. Note: the line is not terminated with a newline.
[ "Convert", "a", "time", "series", "value", "into", "the", "string", "entries", "for", "wavefront", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java#L220-L225
42,749
threerings/nenya
core/src/main/java/com/threerings/media/util/ArcPath.java
ArcPath.getEndPos
public Point getEndPos () { return new Point( (int)(_center.x + Math.round(Math.cos(_sangle + _delta) * _xradius)), (int)(_center.y + Math.round(Math.sin(_sangle + _delta) * _yradius))); }
java
public Point getEndPos () { return new Point( (int)(_center.x + Math.round(Math.cos(_sangle + _delta) * _xradius)), (int)(_center.y + Math.round(Math.sin(_sangle + _delta) * _yradius))); }
[ "public", "Point", "getEndPos", "(", ")", "{", "return", "new", "Point", "(", "(", "int", ")", "(", "_center", ".", "x", "+", "Math", ".", "round", "(", "Math", ".", "cos", "(", "_sangle", "+", "_delta", ")", "*", "_xradius", ")", ")", ",", "(", ...
Returns the position of the end of the path.
[ "Returns", "the", "position", "of", "the", "end", "of", "the", "path", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/ArcPath.java#L114-L119
42,750
threerings/nenya
core/src/main/java/com/threerings/util/CompiledConfig.java
CompiledConfig.loadConfig
public static Serializable loadConfig (InputStream source) throws IOException { try { ObjectInputStream oin = new ObjectInputStream(source); return (Serializable)oin.readObject(); } catch (ClassNotFoundException cnfe) { String errmsg = "Unknown config clas...
java
public static Serializable loadConfig (InputStream source) throws IOException { try { ObjectInputStream oin = new ObjectInputStream(source); return (Serializable)oin.readObject(); } catch (ClassNotFoundException cnfe) { String errmsg = "Unknown config clas...
[ "public", "static", "Serializable", "loadConfig", "(", "InputStream", "source", ")", "throws", "IOException", "{", "try", "{", "ObjectInputStream", "oin", "=", "new", "ObjectInputStream", "(", "source", ")", ";", "return", "(", "Serializable", ")", "oin", ".", ...
Unserializes a configuration object from the supplied input stream.
[ "Unserializes", "a", "configuration", "object", "from", "the", "supplied", "input", "stream", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/util/CompiledConfig.java#L39-L49
42,751
threerings/nenya
core/src/main/java/com/threerings/util/CompiledConfig.java
CompiledConfig.saveConfig
public static void saveConfig (File target, Serializable config) throws IOException { FileOutputStream fout = new FileOutputStream(target); ObjectOutputStream oout = new ObjectOutputStream(fout); oout.writeObject(config); oout.close(); }
java
public static void saveConfig (File target, Serializable config) throws IOException { FileOutputStream fout = new FileOutputStream(target); ObjectOutputStream oout = new ObjectOutputStream(fout); oout.writeObject(config); oout.close(); }
[ "public", "static", "void", "saveConfig", "(", "File", "target", ",", "Serializable", "config", ")", "throws", "IOException", "{", "FileOutputStream", "fout", "=", "new", "FileOutputStream", "(", "target", ")", ";", "ObjectOutputStream", "oout", "=", "new", "Obj...
Serializes the supplied configuration object to the specified file path.
[ "Serializes", "the", "supplied", "configuration", "object", "to", "the", "specified", "file", "path", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/util/CompiledConfig.java#L54-L61
42,752
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.historyUpdated
public void historyUpdated (int adjustment) { if (adjustment != 0) { for (int ii = 0, nn = _showingHistory.size(); ii < nn; ii++) { ChatGlyph cg = _showingHistory.get(ii); cg.histIndex -= adjustment; } // some history entries were deleted, ...
java
public void historyUpdated (int adjustment) { if (adjustment != 0) { for (int ii = 0, nn = _showingHistory.size(); ii < nn; ii++) { ChatGlyph cg = _showingHistory.get(ii); cg.histIndex -= adjustment; } // some history entries were deleted, ...
[ "public", "void", "historyUpdated", "(", "int", "adjustment", ")", "{", "if", "(", "adjustment", "!=", "0", ")", "{", "for", "(", "int", "ii", "=", "0", ",", "nn", "=", "_showingHistory", ".", "size", "(", ")", ";", "ii", "<", "nn", ";", "ii", "+...
from interface HistoryList.Observer
[ "from", "interface", "HistoryList", ".", "Observer" ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L92-L112
42,753
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.displayMessage
public boolean displayMessage (ChatMessage message, boolean alreadyDisplayed) { // nothing doing if we've not been laid out if (!isLaidOut()) { return false; } // possibly display it now Graphics2D gfx = getTargetGraphics(); if (gfx != null) { ...
java
public boolean displayMessage (ChatMessage message, boolean alreadyDisplayed) { // nothing doing if we've not been laid out if (!isLaidOut()) { return false; } // possibly display it now Graphics2D gfx = getTargetGraphics(); if (gfx != null) { ...
[ "public", "boolean", "displayMessage", "(", "ChatMessage", "message", ",", "boolean", "alreadyDisplayed", ")", "{", "// nothing doing if we've not been laid out", "if", "(", "!", "isLaidOut", "(", ")", ")", "{", "return", "false", ";", "}", "// possibly display it now...
documentation inherited from superinterface ChatDisplay
[ "documentation", "inherited", "from", "superinterface", "ChatDisplay" ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L130-L145
42,754
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.updateDimmed
protected void updateDimmed (List<? extends ChatGlyph> glyphs) { for (ChatGlyph glyph : glyphs) { glyph.setDim(_dimmed); } }
java
protected void updateDimmed (List<? extends ChatGlyph> glyphs) { for (ChatGlyph glyph : glyphs) { glyph.setDim(_dimmed); } }
[ "protected", "void", "updateDimmed", "(", "List", "<", "?", "extends", "ChatGlyph", ">", "glyphs", ")", "{", "for", "(", "ChatGlyph", "glyph", ":", "glyphs", ")", "{", "glyph", ".", "setDim", "(", "_dimmed", ")", ";", "}", "}" ]
Update the chat glyphs in the specified list to be set to the current dimmed setting.
[ "Update", "the", "chat", "glyphs", "in", "the", "specified", "list", "to", "be", "set", "to", "the", "current", "dimmed", "setting", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L284-L289
42,755
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.setHistoryEnabled
protected void setHistoryEnabled (boolean historyEnabled) { if (historyEnabled && _historyModel == null) { _historyModel = _scrollbar.getModel(); _historyModel.addChangeListener(this); resetHistoryOffset(); // out with the subtitles, we'll be displaying histo...
java
protected void setHistoryEnabled (boolean historyEnabled) { if (historyEnabled && _historyModel == null) { _historyModel = _scrollbar.getModel(); _historyModel.addChangeListener(this); resetHistoryOffset(); // out with the subtitles, we'll be displaying histo...
[ "protected", "void", "setHistoryEnabled", "(", "boolean", "historyEnabled", ")", "{", "if", "(", "historyEnabled", "&&", "_historyModel", "==", "null", ")", "{", "_historyModel", "=", "_scrollbar", ".", "getModel", "(", ")", ";", "_historyModel", ".", "addChange...
Configures us for display of chat history or not.
[ "Configures", "us", "for", "display", "of", "chat", "history", "or", "not", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L311-L334
42,756
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.viewDidScroll
protected void viewDidScroll (List<? extends ChatGlyph> glyphs, int dx, int dy) { for (ChatGlyph glyph : glyphs) { glyph.viewDidScroll(dx, dy); } }
java
protected void viewDidScroll (List<? extends ChatGlyph> glyphs, int dx, int dy) { for (ChatGlyph glyph : glyphs) { glyph.viewDidScroll(dx, dy); } }
[ "protected", "void", "viewDidScroll", "(", "List", "<", "?", "extends", "ChatGlyph", ">", "glyphs", ",", "int", "dx", ",", "int", "dy", ")", "{", "for", "(", "ChatGlyph", "glyph", ":", "glyphs", ")", "{", "glyph", ".", "viewDidScroll", "(", "dx", ",", ...
Helper function for informing glyphs of the scrolled view.
[ "Helper", "function", "for", "informing", "glyphs", "of", "the", "scrolled", "view", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L339-L344
42,757
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.updateHistBar
protected void updateHistBar (int val) { // we may need to figure out the new history offset amount.. if (!_histOffsetFinal && _history.size() > _histOffset) { Graphics2D gfx = getTargetGraphics(); if (gfx != null) { figureHistoryOffset(gfx); g...
java
protected void updateHistBar (int val) { // we may need to figure out the new history offset amount.. if (!_histOffsetFinal && _history.size() > _histOffset) { Graphics2D gfx = getTargetGraphics(); if (gfx != null) { figureHistoryOffset(gfx); g...
[ "protected", "void", "updateHistBar", "(", "int", "val", ")", "{", "// we may need to figure out the new history offset amount..", "if", "(", "!", "_histOffsetFinal", "&&", "_history", ".", "size", "(", ")", ">", "_histOffset", ")", "{", "Graphics2D", "gfx", "=", ...
Update the history scrollbar with the specified value.
[ "Update", "the", "history", "scrollbar", "with", "the", "specified", "value", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L349-L372
42,758
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.figureHistoryOffset
protected void figureHistoryOffset (Graphics2D gfx) { if (!isLaidOut()) { return; } int hei = _subtitleYSpacing; int hsize = _history.size(); for (int ii = 0; ii < hsize; ii++) { ChatGlyph rec = getHistorySubtitle(ii, gfx); Rectangle r = r...
java
protected void figureHistoryOffset (Graphics2D gfx) { if (!isLaidOut()) { return; } int hei = _subtitleYSpacing; int hsize = _history.size(); for (int ii = 0; ii < hsize; ii++) { ChatGlyph rec = getHistorySubtitle(ii, gfx); Rectangle r = r...
[ "protected", "void", "figureHistoryOffset", "(", "Graphics2D", "gfx", ")", "{", "if", "(", "!", "isLaidOut", "(", ")", ")", "{", "return", ";", "}", "int", "hei", "=", "_subtitleYSpacing", ";", "int", "hsize", "=", "_history", ".", "size", "(", ")", ";...
Figure out how many of the first history elements fit in our bounds such that we can set the bounds on the scrollbar correctly such that the scrolling to the smallest value just barely puts the first element onscreen.
[ "Figure", "out", "how", "many", "of", "the", "first", "history", "elements", "fit", "in", "our", "bounds", "such", "that", "we", "can", "set", "the", "bounds", "on", "the", "scrollbar", "correctly", "such", "that", "the", "scrolling", "to", "the", "smalles...
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L388-L415
42,759
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.figureCurrentHistory
protected void figureCurrentHistory () { int first = _historyModel.getValue(); int count = 0; Graphics2D gfx = null; if (isLaidOut() && !_history.isEmpty()) { gfx = getTargetGraphics(); if (gfx == null) { log.warning("Can't figure current hist...
java
protected void figureCurrentHistory () { int first = _historyModel.getValue(); int count = 0; Graphics2D gfx = null; if (isLaidOut() && !_history.isEmpty()) { gfx = getTargetGraphics(); if (gfx == null) { log.warning("Can't figure current hist...
[ "protected", "void", "figureCurrentHistory", "(", ")", "{", "int", "first", "=", "_historyModel", ".", "getValue", "(", ")", ";", "int", "count", "=", "0", ";", "Graphics2D", "gfx", "=", "null", ";", "if", "(", "isLaidOut", "(", ")", "&&", "!", "_histo...
Figure out which ChatMessages in the history should currently appear in the showing history.
[ "Figure", "out", "which", "ChatMessages", "in", "the", "history", "should", "currently", "appear", "in", "the", "showing", "history", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L420-L479
42,760
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.getHistorySubtitle
protected ChatGlyph getHistorySubtitle (int index, Graphics2D layoutGfx) { // do a brute search (over a small set) for an already-created subtitle for (int ii = 0, nn = _showingHistory.size(); ii < nn; ii++) { ChatGlyph cg = _showingHistory.get(ii); if (cg.histIndex == index)...
java
protected ChatGlyph getHistorySubtitle (int index, Graphics2D layoutGfx) { // do a brute search (over a small set) for an already-created subtitle for (int ii = 0, nn = _showingHistory.size(); ii < nn; ii++) { ChatGlyph cg = _showingHistory.get(ii); if (cg.histIndex == index)...
[ "protected", "ChatGlyph", "getHistorySubtitle", "(", "int", "index", ",", "Graphics2D", "layoutGfx", ")", "{", "// do a brute search (over a small set) for an already-created subtitle", "for", "(", "int", "ii", "=", "0", ",", "nn", "=", "_showingHistory", ".", "size", ...
Get the glyph for the specified history index, creating if necessary.
[ "Get", "the", "glyph", "for", "the", "specified", "history", "index", "creating", "if", "necessary", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L484-L500
42,761
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.createHistorySubtitle
protected ChatGlyph createHistorySubtitle (int index, Graphics2D layoutGfx) { ChatMessage message = _history.get(index); int type = getType(message, true); return createSubtitle(message, type, layoutGfx, false); }
java
protected ChatGlyph createHistorySubtitle (int index, Graphics2D layoutGfx) { ChatMessage message = _history.get(index); int type = getType(message, true); return createSubtitle(message, type, layoutGfx, false); }
[ "protected", "ChatGlyph", "createHistorySubtitle", "(", "int", "index", ",", "Graphics2D", "layoutGfx", ")", "{", "ChatMessage", "message", "=", "_history", ".", "get", "(", "index", ")", ";", "int", "type", "=", "getType", "(", "message", ",", "true", ")", ...
Creates a subtitle for display in the history panel. @param index the index of the message in the history list
[ "Creates", "a", "subtitle", "for", "display", "in", "the", "history", "panel", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L507-L512
42,762
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.getHistorySubtitleSpacing
protected int getHistorySubtitleSpacing (int index) { ChatMessage message = _history.get(index); return _logic.getSubtitleSpacing(getType(message, true)); }
java
protected int getHistorySubtitleSpacing (int index) { ChatMessage message = _history.get(index); return _logic.getSubtitleSpacing(getType(message, true)); }
[ "protected", "int", "getHistorySubtitleSpacing", "(", "int", "index", ")", "{", "ChatMessage", "message", "=", "_history", ".", "get", "(", "index", ")", ";", "return", "_logic", ".", "getSubtitleSpacing", "(", "getType", "(", "message", ",", "true", ")", ")...
Determines the amount of spacing to put after a history subtitle. @param index the index of the message in the history list
[ "Determines", "the", "amount", "of", "spacing", "to", "put", "after", "a", "history", "subtitle", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L519-L523
42,763
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.clearGlyphs
protected void clearGlyphs (List<ChatGlyph> glyphs) { if (_target != null) { for (int ii = 0, nn = glyphs.size(); ii < nn; ii++) { ChatGlyph rec = glyphs.get(ii); _target.abortAnimation(rec); } } else if (!glyphs.isEmpty()) { log.w...
java
protected void clearGlyphs (List<ChatGlyph> glyphs) { if (_target != null) { for (int ii = 0, nn = glyphs.size(); ii < nn; ii++) { ChatGlyph rec = glyphs.get(ii); _target.abortAnimation(rec); } } else if (!glyphs.isEmpty()) { log.w...
[ "protected", "void", "clearGlyphs", "(", "List", "<", "ChatGlyph", ">", "glyphs", ")", "{", "if", "(", "_target", "!=", "null", ")", "{", "for", "(", "int", "ii", "=", "0", ",", "nn", "=", "glyphs", ".", "size", "(", ")", ";", "ii", "<", "nn", ...
Clears out the supplied list of chat glyphs.
[ "Clears", "out", "the", "supplied", "list", "of", "chat", "glyphs", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L542-L554
42,764
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.displayMessage
protected void displayMessage (ChatMessage message, Graphics2D gfx) { // get the non-history message type... int type = getType(message, false); if (type != ChatLogic.IGNORECHAT) { // display it now displayMessage(message, type, gfx); } }
java
protected void displayMessage (ChatMessage message, Graphics2D gfx) { // get the non-history message type... int type = getType(message, false); if (type != ChatLogic.IGNORECHAT) { // display it now displayMessage(message, type, gfx); } }
[ "protected", "void", "displayMessage", "(", "ChatMessage", "message", ",", "Graphics2D", "gfx", ")", "{", "// get the non-history message type...", "int", "type", "=", "getType", "(", "message", ",", "false", ")", ";", "if", "(", "type", "!=", "ChatLogic", ".", ...
Display the specified message now, unless we are to ignore it.
[ "Display", "the", "specified", "message", "now", "unless", "we", "are", "to", "ignore", "it", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L559-L567
42,765
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.displayMessage
protected void displayMessage (ChatMessage message, int type, Graphics2D layoutGfx) { // if we're in history mode, this will show up in the history and we'll rebuild our // subtitle list if and when history goes away if (isHistoryMode()) { return; } addSubtitle(cr...
java
protected void displayMessage (ChatMessage message, int type, Graphics2D layoutGfx) { // if we're in history mode, this will show up in the history and we'll rebuild our // subtitle list if and when history goes away if (isHistoryMode()) { return; } addSubtitle(cr...
[ "protected", "void", "displayMessage", "(", "ChatMessage", "message", ",", "int", "type", ",", "Graphics2D", "layoutGfx", ")", "{", "// if we're in history mode, this will show up in the history and we'll rebuild our", "// subtitle list if and when history goes away", "if", "(", ...
Display the message after we've decided which type it is.
[ "Display", "the", "message", "after", "we", "ve", "decided", "which", "type", "it", "is", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L572-L580
42,766
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.addSubtitle
protected void addSubtitle (ChatGlyph rec) { // scroll up the old subtitles Rectangle r = rec.getBounds(); scrollUpSubtitles(-r.height - _logic.getSubtitleSpacing(rec.getType())); // put this one in place Rectangle vbounds = _target.getViewBounds(); rec.setLocation(v...
java
protected void addSubtitle (ChatGlyph rec) { // scroll up the old subtitles Rectangle r = rec.getBounds(); scrollUpSubtitles(-r.height - _logic.getSubtitleSpacing(rec.getType())); // put this one in place Rectangle vbounds = _target.getViewBounds(); rec.setLocation(v...
[ "protected", "void", "addSubtitle", "(", "ChatGlyph", "rec", ")", "{", "// scroll up the old subtitles", "Rectangle", "r", "=", "rec", ".", "getBounds", "(", ")", ";", "scrollUpSubtitles", "(", "-", "r", ".", "height", "-", "_logic", ".", "getSubtitleSpacing", ...
Add a subtitle for display now.
[ "Add", "a", "subtitle", "for", "display", "now", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L585-L600
42,767
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.createSubtitle
protected ChatGlyph createSubtitle (ChatMessage message, int type, Graphics2D layoutGfx, boolean expires) { // we might need to modify the textual part with translations, but we can't do that to the // message object, since other chatdisplays also get it. ...
java
protected ChatGlyph createSubtitle (ChatMessage message, int type, Graphics2D layoutGfx, boolean expires) { // we might need to modify the textual part with translations, but we can't do that to the // message object, since other chatdisplays also get it. ...
[ "protected", "ChatGlyph", "createSubtitle", "(", "ChatMessage", "message", ",", "int", "type", ",", "Graphics2D", "layoutGfx", ",", "boolean", "expires", ")", "{", "// we might need to modify the textual part with translations, but we can't do that to the", "// message object, si...
Create a subtitle, but don't do anything funny with it.
[ "Create", "a", "subtitle", "but", "don", "t", "do", "anything", "funny", "with", "it", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L605-L626
42,768
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.createSubtitle
protected ChatGlyph createSubtitle (Graphics2D gfx, int type, long timestamp, Icon icon, int indent, String text, boolean expires) { Dimension is = new Dimension(); if (icon != null) { is.setSize(icon.getIconWidth(), icon.getIconHeight()); ...
java
protected ChatGlyph createSubtitle (Graphics2D gfx, int type, long timestamp, Icon icon, int indent, String text, boolean expires) { Dimension is = new Dimension(); if (icon != null) { is.setSize(icon.getIconWidth(), icon.getIconHeight()); ...
[ "protected", "ChatGlyph", "createSubtitle", "(", "Graphics2D", "gfx", ",", "int", "type", ",", "long", "timestamp", ",", "Icon", "icon", ",", "int", "indent", ",", "String", "text", ",", "boolean", "expires", ")", "{", "Dimension", "is", "=", "new", "Dimen...
Create a subtitle- a line of text that goes on the bottom.
[ "Create", "a", "subtitle", "-", "a", "line", "of", "text", "that", "goes", "on", "the", "bottom", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L631-L668
42,769
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.getChatExpire
protected long getChatExpire (long timestamp, String text) { long[] durations = _logic.getDisplayDurations(getDisplayDurationOffset()); // start the computation from the maximum of the timestamp or our last expire time long start = Math.max(timestamp, _lastExpire); // set the next ex...
java
protected long getChatExpire (long timestamp, String text) { long[] durations = _logic.getDisplayDurations(getDisplayDurationOffset()); // start the computation from the maximum of the timestamp or our last expire time long start = Math.max(timestamp, _lastExpire); // set the next ex...
[ "protected", "long", "getChatExpire", "(", "long", "timestamp", ",", "String", "text", ")", "{", "long", "[", "]", "durations", "=", "_logic", ".", "getDisplayDurations", "(", "getDisplayDurationOffset", "(", ")", ")", ";", "// start the computation from the maximum...
Get the expire time for the specified chat.
[ "Get", "the", "expire", "time", "for", "the", "specified", "chat", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L673-L684
42,770
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.scrollUpSubtitles
protected void scrollUpSubtitles (int dy) { // dirty and move all the old glyphs Rectangle vbounds = _target.getViewBounds(); int miny = vbounds.y + vbounds.height - _subtitleHeight; for (Iterator<ChatGlyph> iter = _subtitles.iterator(); iter.hasNext();) { ChatGlyph sub =...
java
protected void scrollUpSubtitles (int dy) { // dirty and move all the old glyphs Rectangle vbounds = _target.getViewBounds(); int miny = vbounds.y + vbounds.height - _subtitleHeight; for (Iterator<ChatGlyph> iter = _subtitles.iterator(); iter.hasNext();) { ChatGlyph sub =...
[ "protected", "void", "scrollUpSubtitles", "(", "int", "dy", ")", "{", "// dirty and move all the old glyphs", "Rectangle", "vbounds", "=", "_target", ".", "getViewBounds", "(", ")", ";", "int", "miny", "=", "vbounds", ".", "y", "+", "vbounds", ".", "height", "...
Scroll all the subtitles up by the specified amount.
[ "Scroll", "all", "the", "subtitles", "up", "by", "the", "specified", "amount", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L762-L775
42,771
jdillon/gshell
gshell-core/src/main/java/com/planet57/gshell/internal/completer/ShellCompleter.java
ShellCompleter.extractCommandArguments
private static ParsedLine extractCommandArguments(final ParsedLine line) { // copy the list, so we can mutate and pop the first item off LinkedList<String> words = Lists.newLinkedList(line.words()); String remove = words.pop(); String rawLine = line.line(); // rebuild that list sans the first argum...
java
private static ParsedLine extractCommandArguments(final ParsedLine line) { // copy the list, so we can mutate and pop the first item off LinkedList<String> words = Lists.newLinkedList(line.words()); String remove = words.pop(); String rawLine = line.line(); // rebuild that list sans the first argum...
[ "private", "static", "ParsedLine", "extractCommandArguments", "(", "final", "ParsedLine", "line", ")", "{", "// copy the list, so we can mutate and pop the first item off", "LinkedList", "<", "String", ">", "words", "=", "Lists", ".", "newLinkedList", "(", "line", ".", ...
Extract the command specific portions of the given line. This is everything past the first word.
[ "Extract", "the", "command", "specific", "portions", "of", "the", "given", "line", "." ]
b587c1a4672d2e4905871462fa3b38a1f7b94e90
https://github.com/jdillon/gshell/blob/b587c1a4672d2e4905871462fa3b38a1f7b94e90/gshell-core/src/main/java/com/planet57/gshell/internal/completer/ShellCompleter.java#L120-L139
42,772
threerings/nenya
tools/src/main/java/com/threerings/media/tools/RecolorImage.java
RecolorImage.convert
protected void convert () { if (_image == null) { return; } // obtain the target color and offset try { BufferedImage image; if (_tabs.getSelectedIndex() == 0) { // All recolorings from file. image = getAllRecolors(...
java
protected void convert () { if (_image == null) { return; } // obtain the target color and offset try { BufferedImage image; if (_tabs.getSelectedIndex() == 0) { // All recolorings from file. image = getAllRecolors(...
[ "protected", "void", "convert", "(", ")", "{", "if", "(", "_image", "==", "null", ")", "{", "return", ";", "}", "// obtain the target color and offset", "try", "{", "BufferedImage", "image", ";", "if", "(", "_tabs", ".", "getSelectedIndex", "(", ")", "==", ...
Performs colorizations.
[ "Performs", "colorizations", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/media/tools/RecolorImage.java#L227-L286
42,773
threerings/nenya
tools/src/main/java/com/threerings/media/tools/RecolorImage.java
RecolorImage.getAllRecolors
public BufferedImage getAllRecolors (boolean label) { if (_colRepo == null) { return null; } ColorPository.ClassRecord colClass = _colRepo.getClassRecord((String)_classList.getSelectedItem()); int classId = colClass.classId; BufferedImage img = new B...
java
public BufferedImage getAllRecolors (boolean label) { if (_colRepo == null) { return null; } ColorPository.ClassRecord colClass = _colRepo.getClassRecord((String)_classList.getSelectedItem()); int classId = colClass.classId; BufferedImage img = new B...
[ "public", "BufferedImage", "getAllRecolors", "(", "boolean", "label", ")", "{", "if", "(", "_colRepo", "==", "null", ")", "{", "return", "null", ";", "}", "ColorPository", ".", "ClassRecord", "colClass", "=", "_colRepo", ".", "getClassRecord", "(", "(", "Str...
Gets an image with all recolorings of the selection colorization class.
[ "Gets", "an", "image", "with", "all", "recolorings", "of", "the", "selection", "colorization", "class", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/media/tools/RecolorImage.java#L291-L329
42,774
threerings/nenya
tools/src/main/java/com/threerings/media/tools/RecolorImage.java
RecolorImage.setColorizeFile
public void setColorizeFile (File path) { try { if (path.getName().endsWith("xml")) { ColorPositoryParser parser = new ColorPositoryParser(); _colRepo = (ColorPository)(parser.parseConfig(path)); } else { _colRepo = ColorPository.loadCo...
java
public void setColorizeFile (File path) { try { if (path.getName().endsWith("xml")) { ColorPositoryParser parser = new ColorPositoryParser(); _colRepo = (ColorPository)(parser.parseConfig(path)); } else { _colRepo = ColorPository.loadCo...
[ "public", "void", "setColorizeFile", "(", "File", "path", ")", "{", "try", "{", "if", "(", "path", ".", "getName", "(", ")", ".", "endsWith", "(", "\"xml\"", ")", ")", "{", "ColorPositoryParser", "parser", "=", "new", "ColorPositoryParser", "(", ")", ";"...
Loads up the colorization classes from the specified file.
[ "Loads", "up", "the", "colorization", "classes", "from", "the", "specified", "file", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/media/tools/RecolorImage.java#L426-L493
42,775
kaazing/java.client
ws/ws/src/main/java/org/kaazing/gateway/client/util/StringUtils.java
StringUtils.stripControlCharacters
public static String stripControlCharacters(String rawValue) { if (rawValue == null) { return null; } String value = replaceEntities(rawValue); boolean hasControlChars = false; for (int i = value.length() - 1; i >= 0; i--) { if (Character.isISOControl(va...
java
public static String stripControlCharacters(String rawValue) { if (rawValue == null) { return null; } String value = replaceEntities(rawValue); boolean hasControlChars = false; for (int i = value.length() - 1; i >= 0; i--) { if (Character.isISOControl(va...
[ "public", "static", "String", "stripControlCharacters", "(", "String", "rawValue", ")", "{", "if", "(", "rawValue", "==", "null", ")", "{", "return", "null", ";", "}", "String", "value", "=", "replaceEntities", "(", "rawValue", ")", ";", "boolean", "hasContr...
Strip a String of it's ISO control characters. @param value The String that should be stripped. @return {@code String} A new String instance with its hexadecimal control characters replaced by a space. Or the unmodified String if it does not contain any ISO control characters.
[ "Strip", "a", "String", "of", "it", "s", "ISO", "control", "characters", "." ]
25ad2ae5bb24aa9d6b79400fce649b518dcfbe26
https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/gateway/client/util/StringUtils.java#L49-L95
42,776
threerings/nenya
core/src/main/java/com/threerings/resource/FastImageIO.java
FastImageIO.write
public static void write (BufferedImage image, OutputStream out) throws IOException { DataOutputStream dout = new DataOutputStream(out); // write the image dimensions int width = image.getWidth(), height = image.getHeight(); dout.writeInt(width); dout.writeInt(height...
java
public static void write (BufferedImage image, OutputStream out) throws IOException { DataOutputStream dout = new DataOutputStream(out); // write the image dimensions int width = image.getWidth(), height = image.getHeight(); dout.writeInt(width); dout.writeInt(height...
[ "public", "static", "void", "write", "(", "BufferedImage", "image", ",", "OutputStream", "out", ")", "throws", "IOException", "{", "DataOutputStream", "dout", "=", "new", "DataOutputStream", "(", "out", ")", ";", "// write the image dimensions", "int", "width", "=...
Writes the supplied image to the supplied output stream. @exception IOException thrown if an error occurs writing to the output stream.
[ "Writes", "the", "supplied", "image", "to", "the", "supplied", "output", "stream", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/FastImageIO.java#L71-L103
42,777
kaazing/java.client
amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpArguments.java
AmqpArguments.getEntries
public List<AmqpTableEntry> getEntries(String key) { if ((key == null) || (tableEntryArray == null)) { return null; } List<AmqpTableEntry> entries = new ArrayList<AmqpTableEntry>(); for (AmqpTableEntry entry : tableEntryArray) { if (entry.key.equals(key))...
java
public List<AmqpTableEntry> getEntries(String key) { if ((key == null) || (tableEntryArray == null)) { return null; } List<AmqpTableEntry> entries = new ArrayList<AmqpTableEntry>(); for (AmqpTableEntry entry : tableEntryArray) { if (entry.key.equals(key))...
[ "public", "List", "<", "AmqpTableEntry", ">", "getEntries", "(", "String", "key", ")", "{", "if", "(", "(", "key", "==", "null", ")", "||", "(", "tableEntryArray", "==", "null", ")", ")", "{", "return", "null", ";", "}", "List", "<", "AmqpTableEntry", ...
Returns a list of AmqpTableEntry objects that matches the specified key. If a null key is passed in, then a null is returned. Also, if the internal structure is null, then a null is returned. @param key name of the entry @return List<AmqpTableEntry> object with matching key
[ "Returns", "a", "list", "of", "AmqpTableEntry", "objects", "that", "matches", "the", "specified", "key", ".", "If", "a", "null", "key", "is", "passed", "in", "then", "a", "null", "is", "returned", ".", "Also", "if", "the", "internal", "structure", "is", ...
25ad2ae5bb24aa9d6b79400fce649b518dcfbe26
https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpArguments.java#L158-L170
42,778
vdurmont/etaprinter
src/main/java/com/vdurmont/etaprinter/ETAPrinter.java
ETAPrinter.update
public void update(long numProcessedDuringStep) { if (this.closed) { throw new ETAPrinterException("You cannot update a closed ETAPrinter!"); } DateTime now = DateTime.now(); ItemsDuration itemsDuration = null; if (numProcessedDuringStep > 0) { long stepDu...
java
public void update(long numProcessedDuringStep) { if (this.closed) { throw new ETAPrinterException("You cannot update a closed ETAPrinter!"); } DateTime now = DateTime.now(); ItemsDuration itemsDuration = null; if (numProcessedDuringStep > 0) { long stepDu...
[ "public", "void", "update", "(", "long", "numProcessedDuringStep", ")", "{", "if", "(", "this", ".", "closed", ")", "{", "throw", "new", "ETAPrinterException", "(", "\"You cannot update a closed ETAPrinter!\"", ")", ";", "}", "DateTime", "now", "=", "DateTime", ...
Updates and prints the progress bar with the new values. @param numProcessedDuringStep the number of items processed during the elapsed step
[ "Updates", "and", "prints", "the", "progress", "bar", "with", "the", "new", "values", "." ]
19039bdbbece8b05ceab2a23757f4e1e8b6872cb
https://github.com/vdurmont/etaprinter/blob/19039bdbbece8b05ceab2a23757f4e1e8b6872cb/src/main/java/com/vdurmont/etaprinter/ETAPrinter.java#L109-L131
42,779
jboss/jboss-jsp-api_spec
src/main/java/javax/servlet/jsp/tagext/TagAttributeInfo.java
TagAttributeInfo.getIdAttribute
public static TagAttributeInfo getIdAttribute(TagAttributeInfo a[]) { for (int i=0; i<a.length; i++) { if (a[i].getName().equals(ID)) { return a[i]; } } return null; // no such attribute }
java
public static TagAttributeInfo getIdAttribute(TagAttributeInfo a[]) { for (int i=0; i<a.length; i++) { if (a[i].getName().equals(ID)) { return a[i]; } } return null; // no such attribute }
[ "public", "static", "TagAttributeInfo", "getIdAttribute", "(", "TagAttributeInfo", "a", "[", "]", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "a", ".", "length", ";", "i", "++", ")", "{", "if", "(", "a", "[", "i", "]", ".", "getNam...
Convenience static method that goes through an array of TagAttributeInfo objects and looks for "id". @param a An array of TagAttributeInfo @return The TagAttributeInfo reference with name "id"
[ "Convenience", "static", "method", "that", "goes", "through", "an", "array", "of", "TagAttributeInfo", "objects", "and", "looks", "for", "id", "." ]
da53166619f33a5134dc3315a3264990cc1f541f
https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/tagext/TagAttributeInfo.java#L221-L228
42,780
calrissian/mango
mango-criteria/src/main/java/org/calrissian/mango/criteria/domain/TypedTermLeaf.java
TypedTermLeaf.firstKnownType
protected static <T> Class<T> firstKnownType(T... objects) { for (T obj : objects) if (obj != null) return (Class<T>) obj.getClass(); return null; }
java
protected static <T> Class<T> firstKnownType(T... objects) { for (T obj : objects) if (obj != null) return (Class<T>) obj.getClass(); return null; }
[ "protected", "static", "<", "T", ">", "Class", "<", "T", ">", "firstKnownType", "(", "T", "...", "objects", ")", "{", "for", "(", "T", "obj", ":", "objects", ")", "if", "(", "obj", "!=", "null", ")", "return", "(", "Class", "<", "T", ">", ")", ...
Utility method to allow subclasses to extract type from known variables.
[ "Utility", "method", "to", "allow", "subclasses", "to", "extract", "type", "from", "known", "variables", "." ]
a95aa5e77af9aa0e629787228d80806560023452
https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-criteria/src/main/java/org/calrissian/mango/criteria/domain/TypedTermLeaf.java#L24-L29
42,781
threerings/nenya
core/src/main/java/com/threerings/media/image/ColorPository.java
ColorPository.enumerateColors
public ColorRecord[] enumerateColors (String className) { // make sure the class exists ClassRecord record = getClassRecord(className); if (record == null) { return null; } // create the array ColorRecord[] crecs = new ColorRecord[record.colors.size()]; ...
java
public ColorRecord[] enumerateColors (String className) { // make sure the class exists ClassRecord record = getClassRecord(className); if (record == null) { return null; } // create the array ColorRecord[] crecs = new ColorRecord[record.colors.size()]; ...
[ "public", "ColorRecord", "[", "]", "enumerateColors", "(", "String", "className", ")", "{", "// make sure the class exists", "ClassRecord", "record", "=", "getClassRecord", "(", "className", ")", ";", "if", "(", "record", "==", "null", ")", "{", "return", "null"...
Returns an array containing the records for the colors in the specified class.
[ "Returns", "an", "array", "containing", "the", "records", "for", "the", "colors", "in", "the", "specified", "class", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ColorPository.java#L288-L303
42,782
threerings/nenya
core/src/main/java/com/threerings/media/image/ColorPository.java
ColorPository.enumerateColorIds
public int[] enumerateColorIds (String className) { // make sure the class exists ClassRecord record = getClassRecord(className); if (record == null) { return null; } int[] cids = new int[record.colors.size()]; Iterator<ColorRecord> crecs = record.colors....
java
public int[] enumerateColorIds (String className) { // make sure the class exists ClassRecord record = getClassRecord(className); if (record == null) { return null; } int[] cids = new int[record.colors.size()]; Iterator<ColorRecord> crecs = record.colors....
[ "public", "int", "[", "]", "enumerateColorIds", "(", "String", "className", ")", "{", "// make sure the class exists", "ClassRecord", "record", "=", "getClassRecord", "(", "className", ")", ";", "if", "(", "record", "==", "null", ")", "{", "return", "null", ";...
Returns an array containing the ids of the colors in the specified class.
[ "Returns", "an", "array", "containing", "the", "ids", "of", "the", "colors", "in", "the", "specified", "class", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ColorPository.java#L308-L322
42,783
threerings/nenya
core/src/main/java/com/threerings/media/image/ColorPository.java
ColorPository.getRandomStartingColor
public ColorRecord getRandomStartingColor (String className, Random rand) { // make sure the class exists ClassRecord record = getClassRecord(className); return (record == null) ? null : record.randomStartingColor(rand); }
java
public ColorRecord getRandomStartingColor (String className, Random rand) { // make sure the class exists ClassRecord record = getClassRecord(className); return (record == null) ? null : record.randomStartingColor(rand); }
[ "public", "ColorRecord", "getRandomStartingColor", "(", "String", "className", ",", "Random", "rand", ")", "{", "// make sure the class exists", "ClassRecord", "record", "=", "getClassRecord", "(", "className", ")", ";", "return", "(", "record", "==", "null", ")", ...
Returns a random starting color from the specified color class.
[ "Returns", "a", "random", "starting", "color", "from", "the", "specified", "color", "class", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ColorPository.java#L354-L359
42,784
threerings/nenya
core/src/main/java/com/threerings/media/image/ColorPository.java
ColorPository.getColorization
public Colorization getColorization (int classId, int colorId) { ColorRecord color = getColorRecord(classId, colorId); return (color == null) ? null : color.getColorization(); }
java
public Colorization getColorization (int classId, int colorId) { ColorRecord color = getColorRecord(classId, colorId); return (color == null) ? null : color.getColorization(); }
[ "public", "Colorization", "getColorization", "(", "int", "classId", ",", "int", "colorId", ")", "{", "ColorRecord", "color", "=", "getColorRecord", "(", "classId", ",", "colorId", ")", ";", "return", "(", "color", "==", "null", ")", "?", "null", ":", "colo...
Looks up a colorization by id.
[ "Looks", "up", "a", "colorization", "by", "id", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ColorPository.java#L364-L368
42,785
threerings/nenya
core/src/main/java/com/threerings/media/image/ColorPository.java
ColorPository.getColorization
public Colorization getColorization (String className, int colorId) { ClassRecord crec = getClassRecord(className); if (crec != null) { ColorRecord color = crec.colors.get(colorId); if (color != null) { return color.getColorization(); } } ...
java
public Colorization getColorization (String className, int colorId) { ClassRecord crec = getClassRecord(className); if (crec != null) { ColorRecord color = crec.colors.get(colorId); if (color != null) { return color.getColorization(); } } ...
[ "public", "Colorization", "getColorization", "(", "String", "className", ",", "int", "colorId", ")", "{", "ClassRecord", "crec", "=", "getClassRecord", "(", "className", ")", ";", "if", "(", "crec", "!=", "null", ")", "{", "ColorRecord", "color", "=", "crec"...
Looks up a colorization by name.
[ "Looks", "up", "a", "colorization", "by", "name", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ColorPository.java#L381-L391
42,786
threerings/nenya
core/src/main/java/com/threerings/media/image/ColorPository.java
ColorPository.getColorization
public Colorization getColorization (String className, String colorName) { ClassRecord crec = getClassRecord(className); if (crec != null) { int colorId = 0; try { colorId = crec.getColorId(colorName); } catch (ParseException pe) { ...
java
public Colorization getColorization (String className, String colorName) { ClassRecord crec = getClassRecord(className); if (crec != null) { int colorId = 0; try { colorId = crec.getColorId(colorName); } catch (ParseException pe) { ...
[ "public", "Colorization", "getColorization", "(", "String", "className", ",", "String", "colorName", ")", "{", "ClassRecord", "crec", "=", "getClassRecord", "(", "className", ")", ";", "if", "(", "crec", "!=", "null", ")", "{", "int", "colorId", "=", "0", ...
Looks up a colorization by class and color names.
[ "Looks", "up", "a", "colorization", "by", "class", "and", "color", "names", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ColorPository.java#L396-L414
42,787
threerings/nenya
core/src/main/java/com/threerings/media/image/ColorPository.java
ColorPository.getClassRecord
public ClassRecord getClassRecord (String className) { Iterator<ClassRecord> iter = _classes.values().iterator(); while (iter.hasNext()) { ClassRecord crec = iter.next(); if (crec.name.equals(className)) { return crec; } } log.warni...
java
public ClassRecord getClassRecord (String className) { Iterator<ClassRecord> iter = _classes.values().iterator(); while (iter.hasNext()) { ClassRecord crec = iter.next(); if (crec.name.equals(className)) { return crec; } } log.warni...
[ "public", "ClassRecord", "getClassRecord", "(", "String", "className", ")", "{", "Iterator", "<", "ClassRecord", ">", "iter", "=", "_classes", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", ...
Loads up a colorization class by name and logs a warning if it doesn't exist.
[ "Loads", "up", "a", "colorization", "class", "by", "name", "and", "logs", "a", "warning", "if", "it", "doesn", "t", "exist", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ColorPository.java#L419-L430
42,788
threerings/nenya
core/src/main/java/com/threerings/media/image/ColorPository.java
ColorPository.getColorRecord
public ColorRecord getColorRecord (int classId, int colorId) { ClassRecord record = getClassRecord(classId); if (record == null) { // if they request color class zero, we assume they're just // decoding a blank colorprint, otherwise we complain if (classId != 0) {...
java
public ColorRecord getColorRecord (int classId, int colorId) { ClassRecord record = getClassRecord(classId); if (record == null) { // if they request color class zero, we assume they're just // decoding a blank colorprint, otherwise we complain if (classId != 0) {...
[ "public", "ColorRecord", "getColorRecord", "(", "int", "classId", ",", "int", "colorId", ")", "{", "ClassRecord", "record", "=", "getClassRecord", "(", "classId", ")", ";", "if", "(", "record", "==", "null", ")", "{", "// if they request color class zero, we assum...
Looks up the requested color record.
[ "Looks", "up", "the", "requested", "color", "record", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ColorPository.java#L435-L448
42,789
threerings/nenya
core/src/main/java/com/threerings/media/image/ColorPository.java
ColorPository.getColorRecord
public ColorRecord getColorRecord (String className, String colorName) { ClassRecord record = getClassRecord(className); if (record == null) { log.warning("Requested unknown color class", "className", className, "colorName", colorName, new Exception()); return...
java
public ColorRecord getColorRecord (String className, String colorName) { ClassRecord record = getClassRecord(className); if (record == null) { log.warning("Requested unknown color class", "className", className, "colorName", colorName, new Exception()); return...
[ "public", "ColorRecord", "getColorRecord", "(", "String", "className", ",", "String", "colorName", ")", "{", "ClassRecord", "record", "=", "getClassRecord", "(", "className", ")", ";", "if", "(", "record", "==", "null", ")", "{", "log", ".", "warning", "(", ...
Looks up the requested color record by class and color names.
[ "Looks", "up", "the", "requested", "color", "record", "by", "class", "and", "color", "names", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ColorPository.java#L453-L471
42,790
threerings/nenya
core/src/main/java/com/threerings/media/image/ColorPository.java
ColorPository.addClass
public void addClass (ClassRecord record) { // validate the class id if (record.classId > 255) { log.warning("Refusing to add class; classId > 255 " + record + "."); } else { _classes.put(record.classId, record); } }
java
public void addClass (ClassRecord record) { // validate the class id if (record.classId > 255) { log.warning("Refusing to add class; classId > 255 " + record + "."); } else { _classes.put(record.classId, record); } }
[ "public", "void", "addClass", "(", "ClassRecord", "record", ")", "{", "// validate the class id", "if", "(", "record", ".", "classId", ">", "255", ")", "{", "log", ".", "warning", "(", "\"Refusing to add class; classId > 255 \"", "+", "record", "+", "\".\"", ")"...
Adds a fully configured color class record to the pository. This is only called by the XML parsing code, so pay it no mind.
[ "Adds", "a", "fully", "configured", "color", "class", "record", "to", "the", "pository", ".", "This", "is", "only", "called", "by", "the", "XML", "parsing", "code", "so", "pay", "it", "no", "mind", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ColorPository.java#L485-L493
42,791
threerings/nenya
core/src/main/java/com/threerings/media/image/ColorPository.java
ColorPository.saveColorPository
public static void saveColorPository (ColorPository posit, File root) { File path = new File(root, CONFIG_PATH); try { CompiledConfig.saveConfig(path, posit); } catch (IOException ioe) { log.warning("Failure saving color pository", "path", path, "error", ioe); ...
java
public static void saveColorPository (ColorPository posit, File root) { File path = new File(root, CONFIG_PATH); try { CompiledConfig.saveConfig(path, posit); } catch (IOException ioe) { log.warning("Failure saving color pository", "path", path, "error", ioe); ...
[ "public", "static", "void", "saveColorPository", "(", "ColorPository", "posit", ",", "File", "root", ")", "{", "File", "path", "=", "new", "File", "(", "root", ",", "CONFIG_PATH", ")", ";", "try", "{", "CompiledConfig", ".", "saveConfig", "(", "path", ",",...
Serializes and saves color pository to the supplied file.
[ "Serializes", "and", "saves", "color", "pository", "to", "the", "supplied", "file", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ColorPository.java#L524-L532
42,792
threerings/nenya
core/src/main/java/com/threerings/cast/CharacterSprite.java
CharacterSprite.init
public void init (CharacterDescriptor descrip, CharacterManager charmgr) { // keep track of this stuff _descrip = descrip; _charmgr = charmgr; // sanity check our values sanityCheckDescrip(); // assign an arbitrary starting orientation _orient = SOUTHWEST; ...
java
public void init (CharacterDescriptor descrip, CharacterManager charmgr) { // keep track of this stuff _descrip = descrip; _charmgr = charmgr; // sanity check our values sanityCheckDescrip(); // assign an arbitrary starting orientation _orient = SOUTHWEST; ...
[ "public", "void", "init", "(", "CharacterDescriptor", "descrip", ",", "CharacterManager", "charmgr", ")", "{", "// keep track of this stuff", "_descrip", "=", "descrip", ";", "_charmgr", "=", "charmgr", ";", "// sanity check our values", "sanityCheckDescrip", "(", ")", ...
Initializes this character sprite with the specified character descriptor and character manager. It will obtain animation data from the supplied character manager.
[ "Initializes", "this", "character", "sprite", "with", "the", "specified", "character", "descriptor", "and", "character", "manager", ".", "It", "will", "obtain", "animation", "data", "from", "the", "supplied", "character", "manager", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/CharacterSprite.java#L42-L56
42,793
threerings/nenya
core/src/main/java/com/threerings/cast/CharacterSprite.java
CharacterSprite.setActionSequence
public void setActionSequence (String action) { // sanity check if (action == null) { log.warning("Refusing to set null action sequence " + this + ".", new Exception()); return; } // no need to noop if (action.equals(_action)) { return; ...
java
public void setActionSequence (String action) { // sanity check if (action == null) { log.warning("Refusing to set null action sequence " + this + ".", new Exception()); return; } // no need to noop if (action.equals(_action)) { return; ...
[ "public", "void", "setActionSequence", "(", "String", "action", ")", "{", "// sanity check", "if", "(", "action", "==", "null", ")", "{", "log", ".", "warning", "(", "\"Refusing to set null action sequence \"", "+", "this", "+", "\".\"", ",", "new", "Exception",...
Sets the action sequence used when rendering the character, from the set of available sequences.
[ "Sets", "the", "action", "sequence", "used", "when", "rendering", "the", "character", "from", "the", "set", "of", "available", "sequences", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/CharacterSprite.java#L121-L135
42,794
threerings/nenya
core/src/main/java/com/threerings/cast/CharacterSprite.java
CharacterSprite.updateActionFrames
protected void updateActionFrames () { // get a reference to the action sequence so that we can obtain // our animation frames and configure our frames per second ActionSequence actseq = _charmgr.getActionSequence(_action); if (actseq == null) { String errmsg = "No such a...
java
protected void updateActionFrames () { // get a reference to the action sequence so that we can obtain // our animation frames and configure our frames per second ActionSequence actseq = _charmgr.getActionSequence(_action); if (actseq == null) { String errmsg = "No such a...
[ "protected", "void", "updateActionFrames", "(", ")", "{", "// get a reference to the action sequence so that we can obtain", "// our animation frames and configure our frames per second", "ActionSequence", "actseq", "=", "_charmgr", ".", "getActionSequence", "(", "_action", ")", ";...
Rebuilds our action frames given our current character descriptor and action sequence. This is called when either of those two things changes.
[ "Rebuilds", "our", "action", "frames", "given", "our", "current", "character", "descriptor", "and", "action", "sequence", ".", "This", "is", "called", "when", "either", "of", "those", "two", "things", "changes", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/CharacterSprite.java#L229-L257
42,795
threerings/nenya
core/src/main/java/com/threerings/cast/CharacterSprite.java
CharacterSprite.sanityCheckDescrip
protected void sanityCheckDescrip () { if (_descrip.getComponentIds() == null || _descrip.getComponentIds().length == 0) { log.warning("Invalid character descriptor [sprite=" + this + ", descrip=" + _descrip + "].", new Exception()); } }
java
protected void sanityCheckDescrip () { if (_descrip.getComponentIds() == null || _descrip.getComponentIds().length == 0) { log.warning("Invalid character descriptor [sprite=" + this + ", descrip=" + _descrip + "].", new Exception()); } }
[ "protected", "void", "sanityCheckDescrip", "(", ")", "{", "if", "(", "_descrip", ".", "getComponentIds", "(", ")", "==", "null", "||", "_descrip", ".", "getComponentIds", "(", ")", ".", "length", "==", "0", ")", "{", "log", ".", "warning", "(", "\"Invali...
Makes it easier to track down problems with bogus character descriptors.
[ "Makes", "it", "easier", "to", "track", "down", "problems", "with", "bogus", "character", "descriptors", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/CharacterSprite.java#L270-L277
42,796
threerings/nenya
core/src/main/java/com/threerings/cast/CharacterSprite.java
CharacterSprite.halt
protected void halt () { // only do something if we're actually animating if (_animMode != NO_ANIMATION) { // disable animation setAnimationMode(NO_ANIMATION); // come to a halt looking settled and at peace String rest = getRestingAction(); ...
java
protected void halt () { // only do something if we're actually animating if (_animMode != NO_ANIMATION) { // disable animation setAnimationMode(NO_ANIMATION); // come to a halt looking settled and at peace String rest = getRestingAction(); ...
[ "protected", "void", "halt", "(", ")", "{", "// only do something if we're actually animating", "if", "(", "_animMode", "!=", "NO_ANIMATION", ")", "{", "// disable animation", "setAnimationMode", "(", "NO_ANIMATION", ")", ";", "// come to a halt looking settled and at peace",...
Updates the sprite animation frame to reflect the cessation of movement and disables any further animation.
[ "Updates", "the", "sprite", "animation", "frame", "to", "reflect", "the", "cessation", "of", "movement", "and", "disables", "any", "further", "animation", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/CharacterSprite.java#L348-L360
42,797
kaazing/java.client
ws/ws/src/main/java/org/kaazing/gateway/client/impl/wsn/WebSocketNativeEncoderImpl.java
WebSocketNativeEncoderImpl.unmask
public static void unmask(WrappedByteBuffer buf, int mask) { byte b; int remainder = buf.remaining() % 4; int remaining = buf.remaining() - remainder; int end = remaining + buf.position(); // xor a 32bit word at a time as long as possible while (buf.position() < end) { ...
java
public static void unmask(WrappedByteBuffer buf, int mask) { byte b; int remainder = buf.remaining() % 4; int remaining = buf.remaining() - remainder; int end = remaining + buf.position(); // xor a 32bit word at a time as long as possible while (buf.position() < end) { ...
[ "public", "static", "void", "unmask", "(", "WrappedByteBuffer", "buf", ",", "int", "mask", ")", "{", "byte", "b", ";", "int", "remainder", "=", "buf", ".", "remaining", "(", ")", "%", "4", ";", "int", "remaining", "=", "buf", ".", "remaining", "(", "...
Performs an in-situ unmasking of the readable buf bytes. Preserves the position of the buffer whilst unmasking all the readable bytes, such that the unmasked bytes will be readable after this invocation. @param buf the buffer containing readable bytes to be unmasked. @param mask the mask to apply against the readab...
[ "Performs", "an", "in", "-", "situ", "unmasking", "of", "the", "readable", "buf", "bytes", ".", "Preserves", "the", "position", "of", "the", "buffer", "whilst", "unmasking", "all", "the", "readable", "bytes", "such", "that", "the", "unmasked", "bytes", "will...
25ad2ae5bb24aa9d6b79400fce649b518dcfbe26
https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/gateway/client/impl/wsn/WebSocketNativeEncoderImpl.java#L156-L193
42,798
groupon/monsoon
remote_history/src/main/java/com/groupon/monsoon/remote/history/AbstractServer.java
AbstractServer.newTscStream
private static stream_response newTscStream(Stream<TimeSeriesCollection> tsc, int fetch) { final BufferedIterator<TimeSeriesCollection> iter = new BufferedIterator(tsc.iterator(), TSC_QUEUE_SIZE); final long idx = TSC_ITERS_ALLOC.getAndIncrement(); final IteratorAndCookie<TimeSeriesCollection> i...
java
private static stream_response newTscStream(Stream<TimeSeriesCollection> tsc, int fetch) { final BufferedIterator<TimeSeriesCollection> iter = new BufferedIterator(tsc.iterator(), TSC_QUEUE_SIZE); final long idx = TSC_ITERS_ALLOC.getAndIncrement(); final IteratorAndCookie<TimeSeriesCollection> i...
[ "private", "static", "stream_response", "newTscStream", "(", "Stream", "<", "TimeSeriesCollection", ">", "tsc", ",", "int", "fetch", ")", "{", "final", "BufferedIterator", "<", "TimeSeriesCollection", ">", "iter", "=", "new", "BufferedIterator", "(", "tsc", ".", ...
Create a new TimeSeriesCollection iterator from the given stream.
[ "Create", "a", "new", "TimeSeriesCollection", "iterator", "from", "the", "given", "stream", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/remote_history/src/main/java/com/groupon/monsoon/remote/history/AbstractServer.java#L167-L178
42,799
groupon/monsoon
remote_history/src/main/java/com/groupon/monsoon/remote/history/AbstractServer.java
AbstractServer.newEvalStream
private static evaluate_response newEvalStream(Stream<Collection<CollectHistory.NamedEvaluation>> tsc, int fetch) { final BufferedIterator<Collection<CollectHistory.NamedEvaluation>> iter = new BufferedIterator(tsc.iterator(), EVAL_QUEUE_SIZE); final long idx = EVAL_ITERS_ALLOC.getAndIncrement(); ...
java
private static evaluate_response newEvalStream(Stream<Collection<CollectHistory.NamedEvaluation>> tsc, int fetch) { final BufferedIterator<Collection<CollectHistory.NamedEvaluation>> iter = new BufferedIterator(tsc.iterator(), EVAL_QUEUE_SIZE); final long idx = EVAL_ITERS_ALLOC.getAndIncrement(); ...
[ "private", "static", "evaluate_response", "newEvalStream", "(", "Stream", "<", "Collection", "<", "CollectHistory", ".", "NamedEvaluation", ">", ">", "tsc", ",", "int", "fetch", ")", "{", "final", "BufferedIterator", "<", "Collection", "<", "CollectHistory", ".", ...
Create a new evaluation iterator from the given stream.
[ "Create", "a", "new", "evaluation", "iterator", "from", "the", "given", "stream", "." ]
eb68d72ba4c01fe018dc981097dbee033908f5c7
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/remote_history/src/main/java/com/groupon/monsoon/remote/history/AbstractServer.java#L183-L194