text stringlengths 14 410k | label int32 0 9 |
|---|---|
public byte[] getTiledImageDataPart(int px, int py, int ptx, int pty)
{
byte[] palettedImage = new byte[ptx * pty];
int tileCount = ptx * pty / 64;
int tileWidth = ptx / 8;
for (int t = 0; t < tileCount; t++)
for (int y = 0; y < 8; y++)
for (int x = 0; x... | 3 |
private int indexCycle(int index, int delta) {
int size = m_Components.length;
int next = (index + delta + size) % size;
return next;
} | 0 |
static File downloadDir() throws MalformedURLException {
String dir = System.getProperty("user.dir");
File f = new File(dir, "oms3");
// installation directory
if (f.exists()) {
return f;
}
throw new IllegalArgumentException("Not found for install: " + f.toStr... | 1 |
@Override
public void flush() throws IOException {
try {
// Calling flush but write has not been called. do nothing
if (chunkIndex == 0 && position == 0) {
return;
}
// Too many bytes written. Drop everything
if (maxChunksReached) ... | 4 |
public Modificar() {
initComponents();
} | 0 |
@Override
public int castingQuality(MOB mob, Physical target)
{
if((mob!=null)&&(target!=null))
{
if(mob.isInCombat()&&(mob.rangeToTarget()>0))
return Ability.QUALITY_INDIFFERENT;
if(mob.charStats().getStat(CharStats.STAT_DEXTERITY)<CMProps.getIntVar(CMProps.Int.BASEMAXSTAT))
return Ability.QUALITY_... | 7 |
Tile(TileColor _color, int _size, TileShape _shape, int _x, int _y, int _rotation){
color = _color;
size = _size;
shape = _shape;
x = _x;
y = _y;
rotation = _rotation;
neighbours = new Array<Tile>();
switch(shape){
case SQUARE:
tileSprite = new Sprite(tilesRegions[0][7]);
break;
case LON... | 8 |
@Override
public boolean processButtonClick(int interfaceId, int componentId,
int slotId, int packetId) {
switch (interfaceId) {
case 271:
if (player.getDuelConfigurations().getRule(5)) {
player.getPackets().sendGameMessage(
"You can't use prayers in this duel.");
return false;
}
return t... | 9 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Motivo)) {
return false;
}
Motivo other = (Motivo) object;
if ((this.idMotivo == null && other.idMotivo != null... | 5 |
public boolean skipPast(String to) throws JSONException {
boolean b;
char c;
int i;
int j;
int offset = 0;
int length = to.length();
char[] circle = new char[length];
/*
* First fill the circle buffer with as many characters as are in the
* to str... | 9 |
public static ColorModel
coerceData(WritableRaster wr, ColorModel cm, boolean newAlphaPreMult) {
// System.out.println("CoerceData: " + cm.isAlphaPremultiplied() +
// " Out: " + newAlphaPreMult);
if (!cm.hasAlpha())
// Nothing to do no alpha channel
... | 3 |
private Boolean openFile(){
/* creates a data backup in case the file is corrupted */
m_dataSetBackup = m_dataSet;
/* add .csv extension selection to File Chooser
* m_firstTimeOpen flag ensures that it's added only once
* */
if(m_firstTimeOpen) {
m_firstTimeOpen = fal... | 4 |
@Test
public void testFindWords() {
assertTrue(_dictionary.findWords("356937").size() > 0);
} | 0 |
@Override
public void keyReleased(KeyEvent arg0) {
} | 0 |
public static void operate() {
Pattern hashPattern = Pattern.compile("prev_commit_hash = \\w*");
String urlBase = "https://raw.github.com/dongli/CodeMate/"+
"master/products/installer/payload/";
String dirBase = System.getenv("HOME")+"/.codemate/";
// -----------------------------------------------------... | 7 |
public static void main(String[] args)
{
// reading the configuration file.
ConfigurationReader configuration = new ConfigurationReader(_propertiesFile);
if (!configuration.readConfigurationFile())
{
System.out.println("Failed in reading configuration file.");
return;
}
// creating client
RpcCl... | 6 |
public void run() // Execution
{
// Listen to network to get the latest state of the
// game from the server
// Update model with this information, Redisplay model
DEBUG.trace( "Player.run" );
try {
NetObjectReader input = new NetObjectReader(s); // try make a rea... | 3 |
@Override
public void spring(MOB target)
{
if((target!=invoker())&&(target.location()!=null))
{
if((doesSaveVsTraps(target))
||(invoker().getGroupMembers(new HashSet<MOB>()).contains(target)))
target.location().show(target,null,null,CMMsg.MASK_ALWAYS|CMMsg.MSG_NOISE,L("<S-NAME> avoid(s) setting off a no... | 9 |
@Override
protected void updateWeights() {
RBM rbm = getNeuralNetwork();
RBMLayerCalculator lc = getLayerCalculator();
int mbs = lc.getPositivePhaseVisible().getDimensions()[lc.getPositivePhaseVisible().getDimensions().length - 1];
if (weightUpdatesKernel == null || weightUpdatesKernel.getMiniBatchSize() != m... | 8 |
private double pathCostEstimate(Location start, Location goal, Agent agent) {
if (agent == null) { // default agent
int dx = Math.abs(goal.x - start.x);
int dy = Math.abs(goal.y - start.y);
double diff = (double) Math.abs(dx - dy);
return typicalCost * (dx + dy);
} else {
return 1;
}
} | 1 |
public static void main(String[] args) {
df = new DecimalFormat("#.00");
// Run a total of 4 timer accuracy tests (for different batch sizes)
timerAccuracyTest(500);
timerAccuracyTest(1000);
timerAccuracyTest(1500);
timerAccuracyTest(2000);
// Run a number of di... | 4 |
public int method185(int i, int j) {
if (i == -2)
return 0xbc614e;
if (i == -1) {
if (j < 0)
j = 0;
else if (j > 127)
j = 127;
j = 127 - j;
return j;
}
j = (j * (i & 0x7f)) / 128;
if (j < 2)
j = 2;
else if (j > 126)
j = 126;
return (i & 0xff80) + j;
} | 6 |
public void buttonClicked(int ID)
{
switch (ID)
{
case 0:
game.changeMenu(new MenuCharCreation(game));
break;
case 1:
game.loadFile();
break;
case 3:
game.changeMenu(new MenuInfo(game));
break;
}
} | 3 |
void calcMarginalProbabilities() {
// calculate marginal probabilities
int [] values = new int[m_nNodes.length];
int [] order = new int[m_bayesNet.getNrOfNodes()];
m_MarginalP = new double[m_nNodes.length][];
for (int iNode = 0; iNode < m_nNodes.length; iNode++) {
order[m_nNodes[iNode]] = iNode;
... | 7 |
public static void main(String[] agrs){
Scanner in = new Scanner(System.in);
int n =in.nextInt();
int l=in.nextInt();
int curr=0;
int result = 0;
while(n-->0){
int s = in.nextInt();
curr+=s+10;
result+=2;
}
curr-=10;
result-=2;
if(curr<=l){
result+=(l-curr)/5;
System.out.println(re... | 2 |
public PNGDecoder(InputStream input) throws IOException {
this.input = input;
this.crc = new CRC32();
this.buffer = new byte[4096];
readFully(buffer, 0, SIGNATURE.length);
if(!checkSignature(buffer)) {
throw new IOException("Not a valid PNG file");
}
... | 7 |
public String getState()
{
if(atBP())
return "Boiling Point";
if(isBoiling())
return "Boiling";
return "Not Boiling";
} | 2 |
@Override
public void execute() {
Task.sleep(50);
switch (Settings.location.getFurnaceId()) {
case 11666:
Constants.FALADOR_WALK_FURNACE.traverse();
break;
case 26814:
Constants.EDGEVILLE_WALK_FURNACE.traverse();
break;
case 76293:
Constants.AL_KHARID_WALK_FURNACE.tr... | 4 |
public boolean hasLayer(String layer) {
String[] lrs = gob().resnames();
for(int i = 0; i < lrs.length; i++)
if(lrs[i].contains(layer)) return true;
return false;
} | 2 |
public static void pprintDefinition(Cons self, boolean hasvariablesP, org.powerloom.PrintableStringWriter stream) {
if (((java.lang.reflect.Method)(OntosaurusUtil.$PPRINT_BEFORE_DEFINITION_FUNCTION$.get())) != null) {
edu.isi.stella.javalib.Native.funcall(((java.lang.reflect.Method)(OntosaurusUtil.$PPRINT_BEF... | 6 |
public Clazz findClazz(String clazz) {
Clazz ret = getClass(clazz);
if (ret != null) return ret;
for (DirManager dm : subDirs) {
ret = dm.findClazz(clazz);
if (ret != null) return ret;
}
return null;
} | 3 |
private boolean r_prelude() {
int among_var;
int v_1;
// repeat, line 36
replab0: while(true)
{
v_1 = cursor;
lab1: do {
// (, line 36
... | 8 |
@Override
public Component getListCellRendererComponent(JList<? extends ArrayList<Configuration>> list, ArrayList<Configuration> value, int index, boolean isSelected, boolean cellHasFocus) {
setOpaque(true);
if (isSelected) {
setBackground(list.getSelectionBackground());
... | 8 |
protected OgexMaterial toMaterial( DataStructure ds, Map<BaseStructure, Object> index ) {
OgexMaterial result = (OgexMaterial)index.get(ds);
if( result != null ) {
return result;
}
result = new OgexMaterial();
index.put(ds, result);
if( "true".equals(ds.getP... | 7 |
private void initLighter(WorkingMemoryEntryPoint startEntryPoint)
{
startEntryPoint.insert(new ReachedBottom());
lighter.init(startEntryPoint);
} | 0 |
private void initJNDI(Configuration configuration) throws TorqueException {
log.debug("Starting initJNDI");
Configuration c = configuration.subset(JNDI_KEY);
if (c == null || c.isEmpty()) {
throw new TorqueException("JndiDataSourceFactory requires a jndi "
+ "path property to lookup the DataS... | 9 |
LeagueRunner(ServletContext context,int leagueNumber)
{
this.context=context;
this.leagueNumber=leagueNumber;
File path = new File("../Source");
list = path.list(new DirectoryFilter("java"));
for(int currentFile=0;currentFile<list.length;currentFile++)
{
try
{
FileReader... | 4 |
@Override
public boolean isMoveable(Location loc) {
if (super.isValid(loc)) {
if (!super.isMoveable(loc)) {
return false;
}
if (!this.objectGrid.isMoveable(loc)) {
return false;
}
if (!this.mapGrid.isMoveable(loc)) {... | 4 |
private void drawGlyphAlpha(byte glyphPixels[], int x, int y, int width, int height,
int colour, int alpha) {
int outputPosition = x + y * DrawingArea.width;
int outputWidth = DrawingArea.width - width;
int inputWidth = 0;
int inputPosition = 0;
/*
* Calculate the height of the glyph.
*/
if (y <... | 6 |
private List<Card> findPossibleCards(List<Card> cardList, int rowNumber) {
List<Card> result = new ArrayList<>();
if ((rowNumber > 4)||(rowNumber < 1)) {
throw new IllegalArgumentException();
}
int rowIndex = rowNumber - 1;
for (int columnIndex = 0; columnIndex < 4; c... | 3 |
@Basic
@Column(name = "CTR_CANTIDAD")
public int getCtrCantidad() {
return ctrCantidad;
} | 0 |
public ErmitForm (ArrayList<Excel> allEx)
{
allex = allEx;
setColoredExes();
} | 0 |
public void run()
{
final byte[] buf = PacketHelper.toPacket(new ConnectionstateRequest(channelId,
new HPAI(HPAI.IPV4_UDP, useNat ? null : (InetSocketAddress) socket
.getLocalSocketAddress())));
final DatagramPacket p = new DatagramPacket(buf, buf.length, ctrlEndpt.getAddress(),
ctrlEndpt.getPo... | 9 |
public static void main(String[] args) {
Graphium g = GraphiumLoader.open(args[0]);
Vertex nut = g.getVertexURI("http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugcategory/micronutrient");
GraphIterator<Edge> it1, it2, it3;
it1 = nut.getEdgesIn();
while (it1.hasNext()) {
Vertex drug = it1.next().get... | 6 |
public String getType() {
return type;
} | 0 |
public static void decode(InputStream src, OutputStream dst) {
byte[] bytesRead = new byte[8192];
byte[] bytesToWrite = new byte[8192];
byte[] alphabet = getBytesAlphabet();
int numberOfBytesRead;
try {
int i;
while ((numberOfBytesRead = src.read(bytesRea... | 3 |
public void actionPerformed (ActionEvent ae)
{
if (ae.getActionCommand().equals("Envoyer"))
{
// On envoi un message s'il n'est pas vide
if (ucast_chat.getText().length() > 0)
{
String my_contact = Cast.getAddress() + ";" + program.getNickname();
String[] recipients = new String[contacts.size()];
... | 3 |
public User authentifier(String id, String mdp) {
String requete= "SELECT ID_user, Login, Pass, Age, Sexe, Email, Aime, AimePas, Activite, Droit, Avatar " +
"FROM Utilisateur WHERE Login = '"+id+"' AND pass = '"+mdp+"'";
DateFormat format = new SimpleDateFormat("yyyy/MM/dd");
String date1 = format.format(new ... | 4 |
public String format(LogRecord par1LogRecord)
{
StringBuilder stringbuilder = new StringBuilder();
stringbuilder.append(field_74268_a.format(Long.valueOf(par1LogRecord.getMillis())));
Level level = par1LogRecord.getLevel();
if (level == Level.FINEST)
{
stringbuil... | 8 |
private void ConnectionButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ConnectionButtonActionPerformed
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:VideoStore", "", "");
Statement stat = ... | 5 |
public boolean matarFantasma(int n)
{
Query q2;
switch(n){
case 0:
q2 = new Query("matarBlinky");
return q2.hasSolution();
case 1:
q2 = new Query("matarClyde");
return q2.hasSolution();
case ... | 4 |
public void playM(String p)
{
try
{
if(!Mclip.isActive())
{
MaudioInputStream = AudioSystem.getAudioInputStream(new File(Main.loc + p));
Maf = MaudioInputStream.getFormat();
Msize = (int) (Maf.getFrameSize() * MaudioInputStream.getFrameLength());
Maudio = new byte[Msize];
Minfo = new DataLine.... | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
Coordinate other = (Coordinate) obj;
if (D... | 5 |
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 |
public static int[][] setZero (int[][] matrix) {
HashSet<Integer> row = new HashSet<Integer>();
HashSet<Integer> col = new HashSet<Integer>();
for(int i=0;i<matrix.length;i++)
for(int j=0;j<matrix[i].length;j++){
if(matrix[i][j]==0) {
row.add(i);
col.add(j);
}
}
for(int i=0;i<matrix.l... | 9 |
@Basic
@Column(name = "FUN_TERMINAL")
public String getFunTerminal() {
return funTerminal;
} | 0 |
private String compute(String tableName, List<TableField> fields,
List<StepSetOperation> operations, Connection memConn)
throws Exception {
long startTime = 0;
// 栏目设置整理
List<List<StepSetOperation>> lists = new ArrayList<List<StepSetOperation>>();
// 共多少行
int totalRowNum = 0;
// 共多少页
int totalPage =... | 8 |
@Override
public void setMethodInfo(wadl wadl, String wsdlPath)
{
try
{
FileInputStream fstream = new FileInputStream(wsdlPath);
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
... | 8 |
private String elapsed() {
final long days = elapsed / MILLISECONDS_PER_DAY;
final long drest = elapsed % MILLISECONDS_PER_DAY;
final long hours = drest / MILLISECONDS_PER_HOUR;
final long hrest = drest % MILLISECONDS_PER_HOUR;
final long minutes = hrest / MILLISECONDS_PER_MINUTE;
final long mrest = hres... | 8 |
public Map getVersions() throws TimeoutException {
Map<InetSocketAddress, String> map = new HashMap<InetSocketAddress, String>();
PooledBlockingClient pbc[] = blockingClientPool.getOneBlockingClientForAllActiveHosts();
if (pbc == null) {
throw new TimeoutException("we do not have any client array [pbc] to con... | 7 |
public String buscarProspectoPorFecha(String fecha){
//##########################CARGA_BASE DE DATOS#############
tablaDeProspectos();
//##########################INGRESO_VACIO###################
if(fecha.equals("")){
fecha = "No busque nada";
return resu... | 5 |
public static void main(String[] args)
{
if (args.length == 1)
{
try
{
daytimeTCP(args[0]);
}
catch (IOException e)
{
e.printStackTrace();
System.exit(1);
}
}
else... | 5 |
public static String md5Encrypt(String string) {
String encrypted = "";
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
byte[] stringBytes = string.getBytes();
digest.reset();
digest.update(stringBytes);
byte[] message = digest.... | 2 |
public static List<TipoObra> listaDeObras() {
ResultSet tr = null;
String select = "SELECT * FROM tipo_obra";
ArrayList<TipoObra> listaTipoObra = new ArrayList<TipoObra>();
Statement statement = null;
Connection conexion = null;
try {
conexion = DataSource... | 9 |
public static void main(String[] args) throws Throwable {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder( );
int casos = 1;
for (String line; (line = in.readLine())!=null; casos++) {
if(line.equals(""))break;
sumas = new long[line.length()];
... | 9 |
public static ArrayList<NoteMessage> getMessagesByUserID(int userID) {
ArrayList<NoteMessage> noteMessageQueue = new ArrayList<NoteMessage>();
try {
String statement = new String("SELECT * FROM " + DBTable +" WHERE uid2 = ?");
PreparedStatement stmt = DBConnection.con.prepareStatement(statement);
stmt.setI... | 2 |
public static int getClientId(String name)
{
if (name.equals("rpcclientfacade") || name.equals("RpcClientFacade"))
{
return RpcClientFacadeFactory.RPC_CLIENT_FACADE;
}
else if (name.equals("rpcclientfacadewrapper") || name.equals("RpcClientFacadeWrapper") )
{
return RpcClientFacadeFactory.RPC_CLIENT_FA... | 4 |
public void dropPiece(final int X, final int Y,
final Piece.ConnectFourPieceColour col) {
m_dropping = true;
if (col == Piece.ConnectFourPieceColour.YELLOW) {
m_currentPieceColour = YELLOW_PIECE;
} else if (col == Piece.ConnectFourPieceColour.RED) {... | 5 |
@Override
public DenseMatrix64F getQ( DenseMatrix64F Q , boolean compact ) {
if( compact ) {
if( Q == null ) {
Q = CommonOps.identity(numRows,minLength);
} else {
if( Q.numRows != numRows || Q.numCols != minLength ) {
throw new Ille... | 9 |
public static byte[] handshake(byte[] peerId, byte[]info_hash){
//Create the handshake
//Set the first bits equal to "BitTorrent protocol" as specified by BT protocol
byte[] handshake = new byte[68];
handshake[0] = 19;
handshake[1] = 'B';
handshake[2] = 'i';
handshake[3] = 't';
handshake[4] ... | 3 |
public void push( StatMethod stat )
{
trace[depth].pause();
if (++depth == trace.length)
{
int newLength = depth + (depth >> 1);
trace = Arrays.copyOf( trace, newLength );
for (int i = depth; i < newLength; i++)
{
trace[i] = new Trace();
}
}
trace[depth].s... | 2 |
public static double[][] benchmarkJLargeArraysDoubleSequentual(long[] sizes, int[] nthreads, int iters, String file)
{
double[][] results = new double[nthreads.length][sizes.length];
long k;
System.out.println("Benchmarking JLargeArrays (doubles, sequentual)");
for (int th = 0; th < ... | 8 |
@Override
public long doRead(Master master, ReadRequest readRequest) {
incrementAccessAndMaybeRecalibrate(master);
long fileId = readRequest.getFileId();
Location accessLoc = readRequest.getLocation();
MasterMeta fm = master.map.get(fileId);
if (fm == null || fm.instances.size() == 0) {
retu... | 9 |
public int indexOfOpenDocument(Document doc) {
return openDocuments.indexOf(doc);
} | 0 |
int inflateInit(int w) {
z.msg = null;
blocks = null;
// handle undocumented wrap option (no zlib header or check)
wrap = 0;
if (w < 0) {
w = -w;
} else if ((w & INFLATE_ANY) != 0) {
wrap = 4;
w &= ~INFLATE_ANY;
if (w < 48)
w &= 15;
} else if ((w & ~31) != 0) { // for example, DEF_WBITS +... | 9 |
public void scrollCellToView(JTable table, int rowIndex, int vColIndex) {
if (!(table.getParent() instanceof JViewport)) {
return;
}
JViewport viewport = (JViewport) table.getParent();
Rectangle rect = table.getCellRect(rowIndex, vColIndex, true);
Rectangle viewRect =... | 9 |
public void setVisible(boolean visible) {
if(frame == null) {
frame = new JFrame("About YAMG");
mainPanel = new JPanel(new GridLayout(18, 2));
mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
addRow("Game Version", Yamg.VERSION);
addRow("Lead Programmer", "Daniel Glus");
addRow("A... | 3 |
@Override
public void run() {
//Loading
Loading load = new Loading(this);
display.setScreen(load);
synchronized (load) {
try {load.wait();} catch (InterruptedException e) {e.printStackTrace();}
}
//Startup
db = assets.get("db/pokemon");
world = new World(this);
player = new Player(this, new Spr... | 2 |
int putIndexed(int tag, Object obj1, int index1, int index2) {
Key key = new Key(tag, obj1, index2);
Integer indexObj = (Integer) entryToIndex.get(key);
if (indexObj != null) {
/* Maybe this was a reserved, but not filled entry */
int index = indexObj.intValue();
indices1[index] = index1;
indices2[ind... | 1 |
public int[] findEdge(Cube cube, TileColor c1, TileColor c2) {
for (int f = 0; f < 6; f++) {
for (int x = 0; x < 3; x++) {
for (int y = 0; y < 3; y++) {
if ((x == 1 || y == 1) && !(x == 1 && y == 1)) {
if (cube.getColor(cube.createArray(f, x, y)).equals(c1) && cube.getColor(Cube.getOthers(cube.creat... | 9 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Company other = (Company) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
re... | 9 |
public static ArrayList<Subcategorias> sqlSelect(){
ArrayList<Subcategorias> subcat = new ArrayList();
if(!BD.getInstance().sqlSelect("SELECT sc.nombre, sc.idsubcategorias FROM subcategorias sc INNER JOIN cat_subcat_tit_attr_descr pr ON pr.subcategorias_id = sc.idsubcategorias GROUP BY sc.nombre;")){
... | 2 |
public static String extractDigits(String s) {
if (s == null) {
return StringPool.BLANK;
}
StringBuilder sb = new StringBuilder();
char[] c = s.toCharArray();
for (int i = 0; i < c.length; i++) {
if (Validator.isDigit(c[i])) {
sb.append(c[i]);
}
}
return sb.toString();
} | 3 |
private String getSelectedOption()
{
String result="";
switch(Equation.getSelectedIndex()+1)
{
case 1:
result="f(x)";
break;
case 2:
result="g(x)";
break;
case 3:
result="a(x)"... | 7 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
Diff other = (Diff) obj;
if (operation != other.operation) {
return f... | 7 |
public static void closeConnection(Connection con) {
if (con != null) {
try {
con.close();
}
catch (SQLException e) {
throw new RuntimeException(e.getSQLState()
+ "\nCaused by\n"
+ e.getCause(), e);
}
finally {
try {
con.close();
} catch (SQLException e) {
... | 3 |
@Override
public long getEncodedLength () {
long childLength = 0;
for (final Value<?> val : value) {
childLength += val.getEncodedLength();
}
return childLength + 2;
} | 2 |
public void loadFromDB()
{
try
{
PreparedStatement ps = getSelectStmt();
ResultSet rs = ps.executeQuery();
if (rs.next())
fillMembers(rs);
rs.close();
}
catch (SQLException sqle)
{ }
} | 2 |
void render() {
VdwForceLines lines = (VdwForceLines) shape;
Pair[] pairs = lines.pairs;
if (pairs == null)
return;
int n = pairs.length;
if (n <= 0)
return;
Atom[] atoms = frame.atoms;
Atom a1 = null;
Atom a2 = null;
short colix1, colix2;
int x, y, z;
int i1, i2;
int atomCount = viewer.ge... | 9 |
public void respondToChangeGameSpeedRequest()
{
game.getAudio().play(pathXPropertyType.AUDIO_CUE_SELECT.toString(), false);
// OPEN UP JOPTIONPANE TO OBTAIN USER INPUT
String inputGameSpeed = JOptionPane.showInputDialog(null, "Enter a game speed between 0 and 3");
try
... | 5 |
@Override
public boolean onPointerMove(int mX, int mY, int mDX, int mDY) {
Iterator<IScreenItem> it = screenItems.iterator();
while(it.hasNext()) {
IScreenItem item = it.next();
if(item.onPointerMove(mX, mY, mDX, mDY)) {
return true;
}
... | 2 |
public Node addWordToTree(String word, Node adjacent, int direction){
Node currentWord = isAChild(word,adjacent,direction);
Node x = inDistNodeList(word,adjacent.getDistance()+1,direction);
//Found in the Sentence Tree
if(currentWord.getLabel().equals(word)){
//Alredy present, increment count
}
String ... | 9 |
private void clickedCheck()
{
if (btnCheck.getText().startsWith("N"))
{
nextPhrase();
}
else
{
if (exPanel.verify())
{
nextPhrase();
}
else
{
btnCheck.setText("Next Phrase");
btnCheck.setMnemonic('n');
}
}
} | 2 |
public boolean equals(Vector4d v) {
return x == v.x && y == v.y && z == v.z && w == v.w;
} | 3 |
public void setEncodings(int nEncodings, int[] encodings)
{
if (nEncodings > nEncodings_) {
encodings_ = new int[nEncodings];
}
nEncodings_ = nEncodings;
useCopyRect = false;
supportsLocalCursor = false;
supportsDesktopResize = false;
currentEncoding_ = Encodings.raw;
for (int i... | 7 |
public void rendermap(MapElement tocreate) {
map.clearTiles();
UE = new ArrayList<UnitElement>();
UE = (ArrayList<UnitElement>) tocreate.getunitlist();
EE = new ArrayList<EnvironmentElement>();
EE = (ArrayList<EnvironmentElement>) tocreate.getEnviromentList();
pixelsX = tocreate.getpixelsX();
pixelsY = ... | 9 |
public PlayerEntity(TileLevel level, Tile startingTile) {
super(level, startingTile);
standAnim = null;
moveAnim = null;
bumpAnim = null;
if(PlayerEntity.STAND_ANIMATIONS != null && PlayerEntity.MOVE_ANIMATIONS != null && PlayerEntity.BUMP_ANIMATIONS != null)
copyAnimations();
} | 3 |
public static void main(final String[] args) {
if (args.length > 1) {
FileInStream fis;
FileOutStream fos;
CodeFormatter codeFormatter = new CodeFormatter();
FormatOptions formatOptions = new FormatOptions(DEFAULT_FORMATTER_PROPERTIES);
try {
... | 5 |
public static StateActor convertToState(int action){
switch (action){
case 8 : return UP;
case 2 : return DOWN;
case 4 : return LEFT;
case 6 : return RIGHT;
case 88 : return ATTACKINGUP;
case 22 : return ATTACKINGDOWN;
case 44 : return ATTACKINGLEFT;
case 66 : return ATTACKINGRIGHT;
default : retu... | 8 |
public void setVolume(String sourcename, float value) {
if (midiSourcename(sourcename)) {
midiChannel.setVolume(value);
} else {
Source mySource = sourceMap.get(sourcename);
if (mySource != null) {
float newVolume = value;
if (newVolume < 0.0f)
newVolume = 0.0f;
else if (newVolume > 1.0f)
... | 4 |
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.