text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void main(String[] args)
{
List<String> a = new LinkedList<String>();
a.add("Amy");
a.add("Carl");
a.add("Erica");
List<String> b = new LinkedList<String>();
b.add("Bob");
b.add("Doug");
b.add("Frances");
b.add("Gloria");
// merge the words ... | 4 |
public static void main(String[] args) throws IOException {
InputStream inputStream = Tongues.class.getResourceAsStream("A-small-practice.in");
InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
BufferedReader bufferReader = new BufferedReader(inputStreamReader);
int numLines = Integer.pa... | 2 |
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "KeyInfo")
public JAXBElement<KeyInfoType> createKeyInfo(KeyInfoType value) {
return new JAXBElement<KeyInfoType>(_KeyInfo_QNAME, KeyInfoType.class, null, value);
} | 0 |
public boolean collision(double x1, double y1, double x2, double y2, int imgW2, int imgH2){
if(x1 > x2 && x1 < x2 + imgW2){
if(y1 > y2 && y1 < y2 + imgH2){
return false;
}
}else if(x1 < x2 && x1 > x2 - imgW2){
if(y1 < y2 && y1 > y2 - imgH2){
r... | 8 |
@Override
public void onEnable() {
if (setupEconomy()) {
FreeForAll.instance = this;
FreeForAll.ffaconfig = new FFAConfig(this);
ffaconfig.load();
loadArenas();
new Queue().runTaskTimer(this, 20, 20);
System.ou... | 9 |
public void get() {
String s = getClipboardData();
s = s.trim();
if (s.equals("")) {
return;
}
int comboCount = stringCombo.getItemCount();
boolean containsIt = false;
for (int i = 0; i < comboCount; ++i) {
if (stringCombo.getItemAt(i).toSt... | 4 |
public static byte[] read(String filePath) throws IOException,
FileNotFoundException {
if (filePath == null) {
return null;
}
FileInputStream fis = new FileInputStream(new File(filePath));
int size = fis.available();
ByteArrayOutputStream baos = new ByteArrayOutputStream(size);
byte[] data = null;
i... | 4 |
public void drawBackground(Graphics g) {
for (int x = 0; x < 30; x++) {
for (int y = 0; y < 20; y++) {
for (int r = 0; r < 8; r++) {
for (int c = 0; c < 8; c++) {
Chunk chunk = Main.world.chunks[0];
Square square = c... | 4 |
private boolean plantable(MOB mob, Item I2)
{
if((I2!=null)
&&(I2 instanceof RawMaterial)
&&(CMLib.flags().canBeSeenBy(I2,mob))
&&(I2.container()==null)
&&(((I2.material()&RawMaterial.MATERIAL_MASK)==RawMaterial.MATERIAL_VEGETATION)
||(I2.material()==RawMaterial.RESOURCE_COTTON)
||(I2.material()==RawMa... | 8 |
public List<Transition> getTransitions(StateEnum stateFrom) {
Map<EventEnum, Transition> transitionMap = transitionFromState.get(stateFrom);
return transitionMap == null ? Collections.<Transition>emptyList() : new ArrayList<Transition>(transitionMap.values());
} | 1 |
@Override
public void init() {
setSize(800, 480);
setBackground(Color.BLACK);
setFocusable(true);
addKeyListener(this);
// Frame frame = (Frame) this.getParent().getParent();
// frame.setTitle("Q-Bot Alpha");
try {
base = getDocumentBase();
} catch (Exception e) {
// TODO: handle exception
}
... | 1 |
public static String randomString(final int size) {
return randomObject(new RandomObjectFunction<String>() {
public String get() {
StringBuilder sb = new StringBuilder(size);
for (int i = 0; i < size; i++) {
char c = (char) ((r.nextBoolean() ? 'A' : 'a') + r
.nextInt('z' - 'a'));
sb.append... | 2 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
int nCase = 0;
while ((line = in.readLine()) != null && line.length() != 0) {
if (nCase++ != 0)
out.append("\n... | 9 |
public final void waitForStatus() throws FatalError {
getCharacter();
while (User.getCurrentLivePoints() != User.getMaxLivePoints()) {
Output.printTabLn("Warte bis Leben aufgefüllt ist.", 2);
Control.sleep(300, 2);
getCharacter();
}
} | 1 |
private Entity checkRegexPatterns(String text) {
Entity plausible = null;
String temp = text;
if(Character.isUpperCase(temp.charAt(0))) {
if(temp.contains("'")) {
if(temp.contains("'s")) {
temp = temp.replaceAll("'s", "");
} else if(temp.contains("s'")) {
temp = temp.replace("s'", "");
} ... | 9 |
public boolean addMaster(File file, int resID)
{
if (file == null || resID == -1) {
return false;
}
int fileSize = file.getSizeInByte();
Object[] packet = new Object[2];
packet[0] = file;
packet[1] = myID_;
int tag = DataGridTags.FILE_ADD_MASTER;... | 4 |
public String getCoef() {
return coef;
} | 0 |
public String toString()
{
final StringBuffer buf = new StringBuffer(30);
buf.append("DM ");
if (mc == MC_PROPREAD_REQ)
buf.append("prop-read.req");
else if (mc == MC_PROPREAD_CON)
buf.append("prop-read.con");
else if (mc == MC_PROPWRITE_REQ)
buf.append("prop-write.req");
else if (mc == MC_PROPWRI... | 9 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
@Override
Apfloat pValue(GeneSet geneSet) {
// Count number of p-values less or equal to 'pValueCutOff'
int count = 0, tot = 0;
for (String geneId : geneSet) {
if (geneSets.hasValue(geneId)) {
if (isTopScore(geneId)) count++;
tot++;
}
}
// No genes have values? We are done
if (tot <= 0) retu... | 5 |
public int findLongestArithmeticProgress(int[] a) {
int maxLen = 0;
if (a.length< 2) {
return 0;
}
if (a.length < 3) {
return 2;
}
int[][] l = new int[a.length][a.length];
for (int middle = 1; middle < a.length - 1; middle++) {
... | 8 |
public static int parseInt(String num) {
if(num != null && num.isEmpty())
{
throw new ArithmeticException("Input cannot be null or blank");
}
char [] numArray = num.toCharArray();
// 1. "1" -> 1
//2. "25" -> 2*10 + 5
// 3. "235" -> 2*100 ... | 7 |
private boolean jj_3R_48()
{
if (jj_scan_token(LEFTB)) return true;
if (jj_3R_9()) return true;
if (jj_scan_token(RIGHTB)) return true;
return false;
} | 3 |
@Override
public void onMouseButtonPress(int buttonID)
{
for(GuiButton button : buttons)
{
if(button.isMouseOver())
{
Sound.button_hit.play();
button.onClick();
}
}
} | 2 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
@Override
public void logicUpdate(GameTime gameTime) {
if (!viewPort.getTopLeftLocation().equals(previousViewPortLocation)) {
previousViewPortLocation = viewPort.getTopLeftLocation();
// The 'previous'viewport location at this point really the current.
updateMapPosition(previousViewPortLocation);
}
} | 1 |
public boolean canInject(final BeanKey bean) {
if (bean == null) {
return false;
}
if (bean == this) {
return true;
}
if (beanType.equals(bean.getBeanType()) && qualifier == null) {
return true;
}
if (GenericsHelper.isAssigna... | 7 |
private void renderBlocks(Screen screen) {
for (int y = HIDDEN_ROWS; y < rows.length; y++) {
Block[] row = rows[y];
for (int x = 0; x < row.length; x++) {
Block block = row[x];
if (block == null) {
//screen.renderBlank(x*BLOCK_SCALE+getX(), y*BLOCK_SCALE+getY(), BLOCK_SCALE, BLOCK_SCALE, 0x00ff00);... | 3 |
@EventHandler
private void onPlayerConnect(PlayerLoginEvent evt) {
// Bukkit.broadcastMessage(evt.getPlayer().getName());
String reason = pds.getBanReason(evt.getPlayer().getName());
if (evt.getPlayer().isBanned()) {
evt.setKickMessage(reason);
evt.disallow(Result.KICK_BANNED, evt.getKickMessage());
} ... | 2 |
public void windowClosing(WindowEvent e) {
w.dispose();
if (quit) {
System.exit(0);
}
} | 1 |
private int normalizeCharClass(StringBuilder newPattern, int i) {
StringBuilder charClass = new StringBuilder();
StringBuilder eq = null;
int lastCodePoint = -1;
String result;
i++;
charClass.append("[");
while(true) {
int c = normalizedPattern.codePo... | 9 |
protected final void update() {
float var1 = MathHelper.sin(this.sheep.yRot * 3.1415927F / 180.0F);
float var2 = MathHelper.cos(this.sheep.yRot * 3.1415927F / 180.0F);
var1 = -0.7F * var1;
var2 = 0.7F * var2;
int var4 = (int)(this.mob.x + var1);
int var3 = (int)(this.mob.y - 2.0F);
... | 5 |
public static <T extends Model> T findLast(final Class<T> cls) {
final String tableName = Reflection.getSimpleClassName(cls);
final List<T> list = Model.where(cls, "_id=(select max(_id) from " + tableName + ")");
T model = null;
if (list != null && list.size() > 0) {
model = list.iterator().next();
}
ret... | 2 |
public static void findMinimumWindow(String s, String t) {
char[] needToFind = new char[256];
char[] hasFound = new char[256];
for( int i = 0 ; i< t.length(); i++) {
needToFind[t.charAt(i)] ++;
}
// how many elements have been found
int count = 0;
in... | 9 |
public Double getAttribute(int index){
if( index < attributes.length ) {
return attributes[index];
} else return null;
} | 1 |
public synchronized void drain() {
if (m_line!=null && m_line.isActive()) {
long t=0;
long waitTime=AMAudioFormat.bytes2Ms(m_bufferSize, m_format)+50;
if (Debug.DEBUG || Debug.TRACE) {
Debug.println(this, "drain() simulation ("+waitTime+"ms...");
t=System.currentTimeMillis();
}
try {
wait(w... | 6 |
public static FontInfo getFont(String font) {
String lowerFont = font.toLowerCase();
if (lowerFont == "helvetica") {
return HELVETICA;
} else if (lowerFont == "times new roman" ||
lowerFont == "times_new_roman" ||
lowerFont == "timesnewroman") {
return TIMES_NEW_ROM... | 4 |
public static List<String> getAlphabetCombination(int order) {
if (order <0 || order>3) {
throw new IllegalArgumentException("Supports order 1,2, or 3");
}
switch(order) {
case 1: return ALPHABET_COMBINATIONS_1;
case 2: return ALPHABET_COMBINATIONS_2;
... | 5 |
@Override
public void onPluginEnable(PluginEnableEvent event) {
if (plugin.economy != null) {
if (plugin.economy.isEnabled()) {
//System.out.println("[" + plugin.getDescription().getName() + "] Payment method enabled: " + plugin.economy.getName() + ".");
}
}
if (plugin.permission != null) {
if (plug... | 4 |
public static boolean isPrime(int number) {
if (number < 0) {
throw new IllegalArgumentException();
}
if (number <= 1) {
return false;
}
for (int i = 2; i <= Math.sqrt(number); i++) {
if (number % i == 0) {
return false;
}
}
return true;
} | 4 |
@Override
public void beforePhase(PhaseEvent event) {
System.out.println("Depois da fase: "+ getPhaseId());
if (event.getPhaseId().equals(PhaseId.RENDER_RESPONSE)){
Session session = FacesContextUtil.getRequestSession();
try {
session.getTransaction().commit()... | 3 |
protected int clock_interpolate(CycleCount delta_t, short buf[], int n,
int interleave) {
int s = 0;
int i;
for (;;) {
int /* cycle_count */next_sample_offset = sample_offset
+ cycles_per_sample;
int /* cycle_count */delta_t_sample = next_sample_offset >> FIXP_SHIFT;
if (delta_t_sample > delta_t... | 7 |
public void watch(Source source) {
// make sure the source exists:
if (source == null)
return;
// make sure we aren't already watching this source:
if (streamingSources.contains(source))
return;
ListIterator<Source> iter;
Source src;
// Make sure noone else is accessing the list of sources:
syn... | 5 |
protected void handleErrorAndCallConnector() {
try {
RequestScopeObject scopeObj=RequestScope.getRequestObj();
SwingObjectsExceptions e = scopeObj.getErrorObj();
boolean isCall=true;
if(e!=null) {
CommonUI.showErrorDialogForComponent(e);
switch(e.getErrorSeverity()) {
case E... | 6 |
@Override
public void mutateStackForInfixTranslation(Stack<Token> operatorStack, StringBuilder output) {
if (this.isOpen()) {
operatorStack.push(this);
} else {
Token next;
while ((next = operatorStack.peek()) instanceof OperatorToken || next instanceof FunctionToken || (next instanceof ParenthesesToken &... | 5 |
public void putInternal(final int key, final FastSparseSet<Integer> value, boolean remove) {
int index = 0;
int ikey = key;
if (ikey < 0) {
index = 2;
ikey = -ikey;
}
else if (ikey >= VarExprent.STACK_BASE) {
index = 1;
ikey -= VarExprent.STACK_BASE;
}
FastSparseSet... | 8 |
public String layer_string()
{
switch (h_layer)
{
case 1:
return "I";
case 2:
return "II";
case 3:
return "III";
}
return null;
} | 3 |
public void whiteTurn(int sx, int sy, int ex, int ey) {
int piece = board.getPiece(sx, sy);
board.whiteTurn(sx, sy, ex, ey);
if (board.getMoveW()) {
setInfo(0);
turns++;
if (cm.canAttackKing(board.getBoard(), piece, ex, ey... | 5 |
public Result allocate(String type, int n) throws IOException {
ArrayList<ByteBuffer> bufs = new ArrayList<ByteBuffer>(n);
long start = System.currentTimeMillis();
if (type.equalsIgnoreCase("onheap"))
{
for (int i = 0; i < n; i++) // 1200*1M to produce OOM with a 1G heap
{
ByteBuffer bb = ByteBu... | 7 |
private boolean outOfBound(double x, double dx, double xBound){
return (x + dx < 0) || (x + dx > xBound );
} | 1 |
public void rotarAtrasIzquierda() {
if (direccion.equals(Direccion.derecha)) {
rotar(tipoTrans.enZ, -135);
} else if (direccion.equals(Direccion.adelante)) {
rotar(tipoTrans.enZ, 135);
} else if (direccion.equals(Direccion.atras)) {
rotar(tipoTrans.enZ, -45);
... | 7 |
private static Camera makecam(Class<? extends Camera> ct, String... args)
throws ClassNotFoundException {
try {
try {
Constructor<? extends Camera> cons = ct
.getConstructor(String[].class);
return (cons.newInstance(new Object[]{arg... | 8 |
public void gameUpdated(GameUpdateType type)
{
// find our super parent frame -- needed for dialogs
Component c = this;
while (null != c.getParent())
c = c.getParent();
switch (type)
{
case ERROR:
boardFrame.bp.repaint();
boardPanel.repaint();
controlPanel.play.setEnabled(false);
controlPan... | 8 |
@Basic
@Column(name = "item_cost_price")
public BigDecimal getItemCostPrice() {
return itemCostPrice;
} | 0 |
@Override
protected void logBindInfo(Method method) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("绑定" + getDescription() + "到方法[" + method + "]成功");
}
} | 1 |
private static int onOff(int source) {
assert((source >= 0) && (source < Simulator.numNodes()));
if(m_nodeStates == null) {
m_nodeStates = new int [Simulator.numNodes()];
for(int n = 0; n < m_nodeStates.length; n++)
m_nodeStates[n] = 0;
}
// advance state: off -> on OR on -> off
if(m_nodeSt... | 8 |
public PacketCodec(ImmutableBiMap<Integer, Class<? extends Packet>> packetMapping) {
this.packetMapping = packetMapping;
} | 1 |
static ArrayList<Integer> KMP(char[] p) {
ArrayList<Integer> r = new ArrayList<>();
int i = 1, j = 0, n = t.length, m = p.length;
while (i < n) {
while (j >= 0 && t[i] != p[j])
j = b[j];
i++;
j++;
if (j == m) {
if (ids[i - m - 1] != ids[i - m] && ids[i - m] == ids[i - 1])
r.add(ids[i - 1]... | 6 |
@Override
public String toString() {
String txt = "";
switch (locType) {
case LATLONG:
txt = this.name + delim + this.lat + delim + this.lon;
break;
case NORTHINGEASTING:
txt = this.name + delim + this.northing + delim + this.... | 3 |
public static void rectangle(double x, double y, double halfWidth, double halfHeight) {
if (halfWidth < 0) throw new RuntimeException("half width can't be negative");
if (halfHeight < 0) throw new RuntimeException("half height can't be negative");
double xs = scaleX(x);
double ys = scal... | 4 |
@Override
public void doCharacterCollision(ArrayList<Collision> collisions, StageObject stageObject) {
/**
* @todo remove tempory fix
*/
Collision collision = collisions.get(0);
if (stageObject instanceof StageMario) {
if (hadCollision) {
if (!st... | 4 |
private void button6MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_button6MouseClicked
if(numberofpins < 4)
{
if(numberofpins == 0)
{
Login_form.setString1("5");
}
if(numberofpins == 1)
{
Login_form.setString2("5");
}
if(numberofpins == 2)
{
Login_... | 5 |
@SuppressWarnings("rawtypes")
private void chooseTargetShire() {
Shire myShire = Me.myShire();
Library library = myShire.getLibrary();
SK_ k = SK_.valToSK.get(Me.FB.randomValueInPriority());
KnowledgeBlock kb = library.findKnowledge(k);
if (kb != null) {kb.useKnowledge(Me);}
else {sendScout(k);}
Clan myS... | 5 |
private void gestureProcessing(Frame frame) {
if (!frame.fingers().empty()) {
// Configure Custom Gesture Settings
controller.config().setFloat("Gesture.KeyTap.MinDownVelocity ", 30);
controller.config().setFloat("Gesture.Swipe.MinVelocity ", 1000);
controller.config().save();
controller.enableGestu... | 8 |
private void calcularCalificacion(){
ArrayList<Respuesta> nuevaListaRespuestaUsuario = new ArrayList();
int index = -1;
int calificacion = 0;
ArrayList<Respuesta> grupos = obtenerTodosGrupos();
int indicadorGrupo = 0;
for (int i = 0; i < _respuestaUsuario.size();... | 9 |
public String getSearchSearchArg()
{
_read.lock();
try
{
return _searchSearchArg;
}
finally
{
_read.unlock();
}
} | 0 |
@Override
protected void onTopic(String channel, String topic, String setBy, long date, boolean changed) {
for (ChannelEventsListener listener : channelEventsListeners) {
if ( listener.getChannelName().equals(channel) ) {
listener.topicChanged(setBy, topic);
break... | 2 |
@Override
public void run() {
while (true) {
watchdog.set(false);
try {
Thread.sleep(65);
} catch (InterruptedException ex) {
//System.out.println("Watchdog: whimper");
return;
... | 3 |
static public String numberToString(Number n)
throws JSONException {
if (n == null) {
throw new JSONException("Null pointer");
}
testValidity(n);
// Shave off trailing zeros and decimal point, if possible.
String s = n.toString();
if (s.indexOf('.') > 0 ... | 6 |
private void drawRobotArm() {
Mass shoulder = null;
Mass elbow = null;
Mass hand = null;
for (Mass mass : networkGraph.getMasses()) {
switch (mass.getType()) {
case SHOULDER:
shoulder = mass;
break;
case... | 8 |
public JpaDao() {
boolean create = false;
try {
Class.forName("com.mysql.jdbc.Driver");
Connection connection = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/", "carletti", "carletti");
Statement stmt = connection.createStatement();
try {
stmt.executeUpdate("USE carletti;");
Re... | 4 |
static public void initialize(actor.interfaces.Movable newListener) {
if (enabled) {
listener = newListener;
al = ALFactory.getAL();
ALut.alutInit();
checkForALErrorsWithMessage("Failed to initialize OpenAl");
sources = new LinkedList<Source>();
... | 5 |
public int uniquePathsWithObstacles(int[][] obstacleGrid) {
int m = obstacleGrid.length;
if (m < 1)
return 0;
int n = obstacleGrid[0].length;
if (n < 1)
return 0;
if (obstacleGrid[0][0] != 0)
return 0;
int[] dp = new int[n];
dp[0] = 1;
// Initialize first row
for (int j = 1; j < n; j++) {
... | 9 |
Log4JMembersInjector(Field field) {
this.field = field;
this.logger = Logger.getLogger(field.getDeclaringClass());
field.setAccessible(true);
} | 0 |
* @param hitDelay The delay before hitting the target.
* @param attackStyle The attack style used.
* @param weaponId The weapon id.
* @param hit The hit done.
* @param gfxId The gfx id.
* @param startHeight The start height of the original projectile.
* @param endHeight The end height of the original projec... | 7 |
public static void main(String[] args) throws NotExistException {
Map map = new Map();
map.setRobot(1);
map.setRobot(3);
map.setRobot(5);
for (int i = 0; i < 30; i++) {
try {
map.progress();
} catch (NotExistException exception) {
... | 2 |
public void setCtrPosId(int ctrPosId) {
this.ctrPosId = ctrPosId;
} | 0 |
void setExampleWidgetPopupMenu() {
Control[] controls = getExampleControls();
for (int i = 0; i < controls.length; i++) {
final Control control = controls [i];
control.addListener(SWT.MenuDetect, new Listener() {
public void handleEvent(Event event) {
Menu menu = control.getMenu();
i... | 5 |
void createBuffers(int width, int height, String options) {
if (g != null)
g.dispose();
if (frontImageBuffer != null)
frontImageBuffer.flush();
if (backImageBuffer != null)
backImageBuffer.flush();
options = options != null ? options.toLowerCase() : "";
bufferSize = new Dimension(width, heigh... | 9 |
public List<Double> getStat(String statIndex, Date currDate) {
List<Double> retList = new ArrayList<Double>();
try {
View view = client.getView("get", "get_thread_vm");
Query query = new Query();
query.setIncludeDocs(true).setLimit(20);
query.setStale(Sta... | 6 |
@Override
public TLValue evaluate() {
for(TLNode stat : statements) {
TLValue value = stat.evaluate();
if(value != TLValue.VOID) {
// return early from this block if value is a return statement
return value;
}
}
// return VOID or returnStatement.evaluate() if it's not nu... | 3 |
private void switchOptions() {
switch (switchMode) {
case (SWITCH_RENDERER): {
isIdle=true;
if (buffer.usesRenderer(IRenderer.RENDERER_OPENGL)) {
keyMapper.destroy();
buffer.disableRenderer(IRenderer.RENDERER_OPENGL);
buffer.enableRende... | 3 |
public void getMapReset(int mapId) {
if (mapId == 1) { // Lille map
globalPosX = 1;
globalPosY = 0;
xStart = Run.window.screen.width/2 - (Screen.blockSize * 5);
yStart = Run.window.screen.height/2 - (Screen.blockSize * 4);
outOfPlaceHor = false;
outOfPlaceVer = false;
Run.player.setPlayer(270, 12... | 2 |
public void modeChange(int mode) {
switch (mode) {
case CPController.M_DRAW:
curSelectedMode = curDrawMode;
break;
case CPController.M_FLOODFILL:
curSelectedMode = floodFillMode;
break;
case CPController.M_RECT_SELECTION:
curSelectedMode = rectSelectionMode;
break;
case CPController.M_MOV... | 5 |
@Override
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException {
Schema schemaAnnotation = null;
for (Annotation annotation : annotations) {
if ... | 4 |
public static Type convertType(String name) {
if (name.equals("pool"))
return Type.Pool;
else if (name.equals("qemu"))
return Type.VmQemu;
else if (name.equals("node"))
return Type.Node;
else if (name.equals("storage"))
return Type.Storage;
else
return Type.Unknown;
} | 4 |
public void stop() {
if (isMovingRight() == false && isMovingLeft() == false) {
speedX = 0;
}
if (isMovingRight() == false && isMovingLeft() == true) {
moveLeft();
}
if (isMovingRight() == true && isMovingLeft() == false) {
moveRight();
}
} | 6 |
public void adjustBeginLineColumn(int newLine, int newCol)
{
int start = tokenBegin;
int len;
if (bufpos >= tokenBegin)
{
len = bufpos - tokenBegin + inBuf + 1;
}
else
{
len = bufsize - tokenBegin + bufpos + 1 + inBuf;
}
int i = 0, j = 0, k = 0;
int nextColDiff = ... | 6 |
public int getTaille() {
return taille;
} | 0 |
@SuppressWarnings("unchecked")
private List<Column> getTableColumns(Table table, List<String> primaryKeys, List<String> indices, Map<Object, Object> uniqueIndices, Map<Object, Object> uniqueColumns) throws SQLException {
List<Column> pkList = new ArrayList<Column>();
List<Column> columns = new LinkedList<Column>(... | 8 |
@Override
public W<DeltaMSet> delta(DC obj)
{ if(obj instanceof MSet)
{ MSet that=(MSet)obj;
Set<Pair<T,PT<Integer>>> baseSetA=this.getBaseSet();
Set<Pair<T,PT<Integer>>> baseSetB=that.getBaseSet();
Set<Pair<Pair<T,PT<Integer>>,Pair<T,PT<Integer>>>> phiMax=getPhiMax(getAllPhis(base... | 4 |
private boolean isKeyCurrent()
{
return ( nNode>0 && sRecno>0 && nKey>=0 && sRecno==recno && pgR[nKey] == recno);
} | 4 |
public final void setRowHeight(int height) {
if (mRowHeight != height) {
mRowHeight = height;
invalidateAllRowHeights();
}
} | 1 |
private void init() {
util = new Utility(this);
try {
String out = new Scanner(new URL(McCheckVersionPath).openStream(), "UTF-8").useDelimiter("\\A").next();
con.log("Log","McLauncher version: " + McVersion + " Checked version: " +out);
//Compare versions
if(!util.testSameVersion(out,McVersion) && util.... | 5 |
public String getSBIName(String inSBICode){
if (SBICode.containsKey(inSBICode))
return SBICode.get(inSBICode);
System.out.println("key not found:" + inSBICode);
//Changes in SBI http://www.kvk.nl/over-de-kvk/over-het-handelsregister/wat-staat-er-in-het-handelsregister/overzicht-sbi-codes/
switch (inSBICode)... | 3 |
public void setValue(ELContext context,
Object base,
Object property,
Object val) {
if (context == null) {
throw new NullPointerException();
}
if (base == null || property == null){
return;
... | 9 |
public String getName() {
return this._name;
} | 0 |
public static String[][] leer(String nombreArchivo) {
File archivo = null;
FileReader fr = null;
BufferedReader br = null;
String texto="";
try {
// Apertura del fichero y creacion de BufferedReader para poder
// hacer una lectura comoda (disponer del metodo readLine())... | 6 |
@Override
public void run() {
try {
ServerSocket server = new ServerSocket(Config.BIND_PORT, 50, InetAddress.getByName(Config.BIND_ADDRESS));
Socket socket;
while ((socket = server.accept()) != null) {
try {
DataInputStream reader = new DataInputStream(socket.getInputStream());
int packet... | 8 |
public static void defaultOptionHandler(Stella_Object self, StorageSlot slot, Stella_Object tree) {
{ Stella_Object parsedvalue = null;
if (slot.type() == Stella.SGT_STELLA_BOOLEAN) {
parsedvalue = Stella_Object.coerceToBoolean(tree);
}
else {
if (tree != null) {
parsedv... | 6 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.