text stringlengths 14 410k | label int32 0 9 |
|---|---|
private Particle parseGroup() throws PrologSyntaxException {
Particle g = new Particle(Particle.GROUP);
g.particles = new Vector();
new AtomParser(db, as, pp, g).parseParticles();
int n = g.particles.size();
int flags = 0;
for (int i = 0; i < n; i++) {
switch (((Particle)g.particles.elemen... | 9 |
public Spinner(int x, int y, int size, int min, int max, int val, int step, GuiRotation rot) {
this.x = x;
this.y = y;
if (rot == GuiRotation.HORIZONTAL) {
width = size;
height = HEIGHT;
} else {
width = HEIGHT;
height = size;
}
value = val;
this.min = min;
this.max = max;
this.step = step... | 9 |
protected void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed
if(JOptionPane.showConfirmDialog(rootPane, "Você tem certeza que deseja cancelar?")== 0){
dispose();
}
}//GEN-LAST:event_btnCancelarActionPerformed | 1 |
public static int firstMissingPositive(int[] A) {
int len = A.length;
if(len == 0) {
return 1;
}
for(int i=0;i<len;i++) {
int current = A[i];
if(current < 1 || current > len) {
A[i] = 0;
} else if(current != (i+1)){
int tmp = A[curr... | 8 |
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 |
private static int sumOfDivs(int n){
int divSum = 1;
for(int i=2;i<=Math.sqrt(n);i++){
if (i==Math.sqrt(n) && n%i==0) divSum+=i;
else if (n%i==0) divSum+=i+n/i;
}
return divSum;
} | 4 |
private static Instances clusterInstances(Instances data) {
XMeans xmeans = new XMeans();
Remove filter = new Remove();
Instances dataClusterer = null;
if (data == null) {
throw new NullPointerException("Data is null at clusteredInstances method");
}
//Get the... | 7 |
private static BytesRef pack(byte[]... point) {
if (point == null) {
throw new IllegalArgumentException("point must not be null");
}
if (point.length == 0) {
throw new IllegalArgumentException("point must not be 0 dimensions");
}
if (point.length == 1) {
return new BytesRef(point[0... | 9 |
@Test
public void reTest2() {
userInput.add("hi");
userInput.add("my name is meng meng");
userInput.add("can you tell me about hamburger");
userInput.add("ingredients");
userInput.add("errorhandling");
userInput.add("errorhandling");
userInput.add("errorhandling");
userInput.add("errorhandling");
use... | 8 |
@Override
public List<Convenio> listByNome(String nome) {
Connection con = null;
PreparedStatement pstm = null;
ResultSet rs = null;
List<Convenio> convenio = new ArrayList<>();
try{
con = ConnectionFactory.getConnection();
pstm = con... | 3 |
public void displaychapter(int framenum, int labelnum) throws IOException
{
chapdispframenum = framenum;
labelnumber = labelnum;
BufferedImage testimg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
File file = new File(filename);
... | 8 |
public static float idealNestPop(
Species species, Venue site, World world, boolean cached
) {
final Nest nest = (cached && site instanceof Nest) ?
(Nest) site : null ;
if (nest != null && nest.idealPopEstimate != -1) {
return nest.idealPopEstimate ;
}
// TODO: Repeating the sample h... | 7 |
public static void main(String[] args) {
long time = System.nanoTime();
for (int n = 0; n < TEST_SIZE; n++) {
vt = System.currentTimeMillis();
}
System.out.println("volatile write:");
System.out.println((System.nanoTime() - time));
time = System.nanoTime();
... | 8 |
public ServerGUI() {
field = new JTextField("6060",10);
field.setHorizontalAlignment(JTextField.RIGHT);
field.setBorder(BorderFactory.createTitledBorder("Inserisci la porta"));
field.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(Ke... | 9 |
public void exportSolution() {
int steps = model.getMoves().size();
File file = new File(basePath + player + "/" + FOLDER_SOLUTIONS + "/"
+ levelName + ".sol");
// Create the file, if it doesn't already exist
try {
if (file.createNewFile()) {
try {
FileWriter fw = new FileWriter(file);
fw... | 6 |
@Override
public T createAdaptiveExtensionProxy(final Class<T> iFaceType) {
checkAnnotation(iFaceType);
Enhancer en = new Enhancer();
en.setSuperclass(iFaceType);
en.setCallback(new MethodInterceptor() {
@Override
public Object intercept(Object arg0, Method method, Object[] params, MethodProxy arg3) thr... | 4 |
@Override
public void setIndicatorState(int indicatorState) {
this.indicatorState = indicatorState;
} | 0 |
static private int jjMoveStringLiteralDfa6_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(4, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(5, active0);
return 6;
}
switch(curChar)
{
cas... | 4 |
private JPanel multiLineLabelPanel(String sourceL,
int splitWidth) {
JPanel jp = new JPanel();
Vector v = new Vector();
int labelWidth = m_fontM.stringWidth(sourceL);
if (labelWidth < splitWidth) {
v.addElement(sourceL);
} else {
// find mid point
int mid = sourceL.lengt... | 8 |
public Object getValueAt( int rowIndex, int columnIndex )
{
Object back = "" ;
TLanguageFile dummy = data.getData(rowIndex) ;
if (dummy != null)
{
switch (columnIndex)
{
case -1 : // normally not used - debugging
if ( (data.getDefaultLang() != null) && (rowIndex == ... | 8 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final TimeTable other = (TimeTable) obj;
if (this.dayOfWeek != other.dayOfWeek) {
return false;
... | 6 |
@Around("execution(* ProfileServiceImpl.readProfile(..))")
public void aroundRead(ProceedingJoinPoint joinPoint) throws Throwable{
ProfileServiceImpl profileService = (ProfileServiceImpl)joinPoint.getTarget();
Object [] args = joinPoint.getArgs();
System.out.println(args[0] + " reads the profile of " + args[1... | 5 |
private final List<File> getFiles(File dir, List<File> files)
throws ClusterException {
if(dir == null)
throw new ClusterException("The directory is null");
if(files == null)
files = new ArrayList<File>();
if(dir.isDirectory() == false) {
if(dir.getName().startsWith("SONG_L... | 5 |
private double search() {
double l=mu-sigma*2;
double r=mu+sigma*2;
while (l+0.1<r){
double t1=(r-l)/3+l;
double t2=2*(r-l)/3+l;
if(f(t1) < f(t2))
l=t1;
else r=t2;
}
return (l+r)/2;
} | 2 |
public int size() {
return results.size();
} | 0 |
public void setReal(TReal node)
{
if(this._real_ != null)
{
this._real_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
}... | 3 |
private void consume() {
try {
if (requestSocket != null) {
while (!queue.isEmpty()) {
for (ProcessRequestData processRequestData : queue) {
queue.poll();
processCommand.processRequest(processRequestData);
}
queue.notifyAll();
}
} else {
Thread.sleep(wait);
Comv... | 4 |
public void togglePause() {
if(state.sdprint){
//Execute commands to pause
if(state.pause){
state.pause=false; //Continue and resume
addToPrintQueue(GCodeFactory.getGCode("M24",-24), false);
}else{
addToPrintQueue(GCodeFactory.getGCode("M25",-25), false);
try {
Thread.sleep(1000); //w... | 9 |
private boolean ignoreScan(String intf)
{
if (scanPackages != null)
{
for (String scan : scanPackages)
{
// do not ignore if on packages to scan list
if (intf.startsWith(scan + "."))
{
return false;
}
}
return true; // did... | 5 |
public FSATransitionCreator(AutomatonPane parent) {
super(parent);
} | 0 |
private boolean isFunctionOver(){
if(this.token.length()>0){
String tmp=this.token;
int leftBracketCount=0;
int rightBracketCount=0;
char T[]=tmp.toCharArray();
for(int i=0;i<T.length;++i){
if(T[i]=='('){
leftBracketCount++;
}else if(T[i]==')'){
rightBracketCount++;
}
}
if(l... | 7 |
@Override
public void Connect(Server server) {
this.server = server;
try {
Class.forName(DRIVER).newInstance();
connection = DriverManager.getConnection(getURL() + DB, username, pass);
} catch (Exception e) {
e.printStackTrace();
}
} | 1 |
protected void setCell(CellSnapshot cellSnapshot) {
if ( (cellSnapshot.id != this.cellSnapshot.id)
|| (cellSnapshot.row != this.cellSnapshot.row)
|| (cellSnapshot.positionInRow != this.cellSnapshot.positionInRow)
) {
this.cellSnapshot = cellSnapshot;
... | 3 |
private int findSize(int type) {
int size = 1;
int edgeCount;
if (type % 2 == 0) {
edgeCount = 3;
} else {
edgeCount = 4;
}
size += edgeCount;
if ((type / 2) % 2 == 1)
size += 1; /* Material */
if ((type / 4) % 2 == 1)
size += 1; /* Face UV */
if ((type / 8) % 2 == 1)
size += edgeCount;... | 8 |
public IMessage decrypter(IMessage crypte, String key) {
/*
* Les caractres sont dcods un un via oprations elementaires
* Les caractres ne correspondant pas des lettres sont ajouts tel quels.
*/
long d=new Date().getTime();
int k=Integer.parseInt(key);
char[] c=new char[crypte.taille()];
for(int i=... | 7 |
private boolean sendGridlet(String errorMsg, int gridletId, int userId,
int resourceId, double delay, int tag, boolean ack)
{
boolean valid = validateValue(errorMsg, gridletId, userId, resourceId);
if (!valid || delay < 0.0) {
return false;
}
i... | 5 |
protected long getChecksumStream(InputStream in) throws ClassNotFoundException,
InstantiationException, IllegalAccessException, IOException {
CheckedInputStream cis = new CheckedInputStream(in, createChecksumObject());
byte[] buff = new byte[128];
while (cis.read(buff) >= 0) {
}
return cis... | 1 |
@Override
public void resetAllProperties() {
Iterator it = getKeys();
while (it.hasNext()) {
String key = (String) it.next();
if (propertyDefaultExists(key)) {
setProperty(key, getPropertyDefault(key));
} else {
removeProperty(key);
}
}
} | 2 |
public OperationExpression combineConstInput() {
Operator newOp;
if (left instanceof BooleanConstant) {
if (((BooleanConstant) left).getConst()) { // true const
newOp = ((PrimitiveOperator) op).oneLeft();
} else {
newOp = ((PrimitiveOperator) op).zeroLeft();
}
return new BinaryOpExpression(new... | 5 |
public manajData1() {
initComponents();
conn = new DBconn();
getDataFromDb();
System.out.println(queryPendaftar.length +" | "+ queryPendaftar[0].length);
for(int x=0; x<queryPendaftar.length; x++){
jTable1.setValueAt(queryPendaftar[x][1], x, 0);
}
... | 8 |
public QueuePublisherThread(BlockingQueue<Integer> queue) {
this.queue = queue;
} | 0 |
private void readLuminance() {
int type = sourceImage.getType();
if (type == BufferedImage.TYPE_INT_RGB || type == BufferedImage.TYPE_INT_ARGB) {
int[] pixels = (int[]) sourceImage.getData().getDataElements(0, 0, width, height, null);
for (int i = 0; i < picsize; i++) {
int p = pixels[i];
int r = (p &... | 9 |
public static <T> List<T> simpleFind(String sql,ResultSetBeanMapping<T> mapping)
throws SQLException{
Connection con = null;
Statement smt = null;
try {
con = DBManager.getConnection();
smt = con.createStatement();
ResultSet rs = smt.executeQuery(sql);
List<T> list = new ArrayList<T>();
while(... | 5 |
@Override
public boolean addPriceReserveAlert(boolean value,AuctionBean auctionBean) {
ObjectComparator objectComparator=new ObjectComparator();
//Si l'utilisateur est acheteur, ou un acheteur vendeur
if(this.getRole().equals(RoleEnum.BUYER)|| this.getRole().equals(RoleEnum.SELLER_BUYER)){
//il faut qu... | 7 |
@Override
public HantoPiece getPieceAt(HantoCoordinate where) {
HantoPiece ret = null;
HantoCoordinate zero = new BasicCoordinate(0, 0);
if(where.getX() == 0 && where.getY() == 0) {
ret = new BasicHantoPiece(HantoPieceType.BUTTERFLY, HantoPlayerColor.BLUE);
}
else if(isAdjacent(zero, where) && currentTurn... | 4 |
int insertKeyRehash(double val, int index, int hash, byte state) {
// compute the double hash
final int length = _set.length;
int probe = 1 + (hash % (length - 2));
final int loopIndex = index;
int firstRemoved = -1;
/**
* Look... | 9 |
private void savePrefs()
{
for (int i = 0; i < Math.min(cmbFilter.getItemCount(), 20); i++)
prefs.put(PREFS_KEY_FILTER + i, cmbFilter.getItemAt(i));
if (tblClasses.getRowSorter().getSortKeys().size() > 0)
{
int i = tblClasses.getRowSorter().getSortKeys().get(0).getCo... | 9 |
public static void main(String[] args) throws Exception{
SOP("==========Chapter 5 Bit Manipulation===");
SOP("To run: java c5 [function name] [function arguments]");
SOP("Example: java c5 q1");
SOP("");
SOP("Possible functions:");
SOP("q1\tQuestion 1");
SOP("q2\tQ... | 7 |
public static void main(String[] args) {
try {
throw new LoggingException();
} catch (LoggingException e) {
System.err.println("Catch " + e);
}
try {
throw new LoggingException();
} catch (LoggingException e) {
System.err.println("C... | 2 |
public int getScaledHeight() {
return HEIGHT;
} | 0 |
public static int arrayMinIndex(float[] array, int startInd, int endInd){
if(array == null || array.length == 0)
return 0;
float min = array[startInd];
int minInd = startInd;
for(int i=startInd; i<endInd;i++){
if(array[i] < min){
min = array[i];
minInd = i;
}
}
return minInd;
} | 4 |
@Override
public void init()
{
super.init();
int cch = ByteTools.readShort( getByteAt( 0 ), getByteAt( 1 ) );
int pos = 1;
if( cch > 0 )
{
//A - fHighByte (1 bit): A bit that specifies whether the characters in rgb are double-byte characters.
// 0x0 All the characters in the string have a high byte o... | 4 |
public float[] bowl(boolean firstRound){
float[] averageBowl = new float[NUM_FRUIT_TYPES];
float[] platter = platter();
System.out.println(Arrays.toString(platter));
bowlScoreStats = new Stats();
for (int i = 0; i < 1000; i++) {
float[] tempPlatter = platter.clone();
float[] tempBowl = s... | 3 |
public int size() {
return this.equivalenceList.size();
} | 0 |
@Override
public Word get(Word word){
if(!base.containsKey(word.getWord())){
return null;
}
return new Word(base.ceilingKey(word.getWord()),base.get(base.ceilingKey(word.getWord())));
} | 1 |
@Override
public void execute(CommandSender sender, String worldName, List<String> args) {
this.sender = sender;
if (worldName == null) {
error("No world given.");
reply("Usage: /gworld load <worldname>");
} else if (!hasWorld(worldName)) {
reply("Unknown world: " + worldName);
} else {
if (getW... | 3 |
public static void main(String[] args) {
// TODO Auto-generated method stub
Map<String, Integer> map= new HashMap<String,Integer>();
map.put("Ling", 0);map.put("Yi", 1);map.put("Er", 2);map.put("San", 3);map.put("Si", 4);
map.put("Wu", 5);map.put("Liu", 6);map.put("Qi", 7);map.put("Ba", 8);map.put("Jiu", 9);
... | 9 |
private CellGui cellGuiAt(int row, int col){
for (CellGui cell : cells){
if (cell.underlying().row == row && cell.underlying().column == col) return cell;
}
throw new RuntimeException("unable to find cell at "+row+", "+col+" in next shape gui");
} | 3 |
@Override
public MapObject doNextAction(MapEngine engine, double s_elapsed) {
if (can_growl && growl_cooldown_left < 0.0) {
registerGrowler(engine);
}
MultipleObject created_objects = new MultipleObject();
if (!is_exploded) {
if (firing_cannon && shields >= 0) {
if (volley_reload_t... | 7 |
private EntityManager() {
entityList = new LinkedList<Entity>();
registeredComponents = new HashMap<Class<? extends IComponent>, HashMap<Entity, IComponent>>();
} | 1 |
@Override
public void virusAttack(int iterationNum) {
if (updateInfectionStatus && iterationNum != this.timeOfUpdate) {
this.infectionStatus = true;
} else {
if (random.getResult()) {
this.updateInfectionStatus = true;
this.timeOfUpdate = itera... | 3 |
private double average() {
double sum = 0, number = 0;
for (Patient p : this.allPatients) {
if (!p.isHospitalized()) {
sum += p.getTotalTime();
number++;
}
}
return sum / number;
} | 2 |
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
int row, int column) {
Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (value instanceof TmpCounterParty) {
cell.setForeground(C... | 2 |
private ASPlayer setCurOnline(ASPlayer data, TableType table, int value) {
switch(table) {
case DAY: data.curDay.online = value;
break;
case WEEK: data.curWeek.online = value;
break;
case MONTH: data.curMonth.online = value;
break;
default: plugin.severe("Invalid Type in setCurOnline");
}
return ... | 3 |
public boolean estPositionValide(Position unePosition)
{
if (unePosition.obtenirCoordonneesEnX() >= 0
&& unePosition.obtenirCoordonneesEnX() < NOMBRE_DE_COLONNES)
if (unePosition.obtenirCoordonneesEnY() >= 0
&& unePosition.obtenirCoordonneesEnY() < NOMBRE_DE_LIGNES)
return true;
return false;
} | 4 |
private static void merge(Comparable[] a, Comparable[] aux, int lo,
int mid, int hi) {
for (int k = lo; k <= hi; k++)
aux[k] = a[k];
int i = lo, j = mid + 1;
for (int k = lo; k <= hi; k++) {
if (i > mid)
a[k] = aux[j++];
else if (j ... | 5 |
@SuppressWarnings({ "unchecked", "rawtypes" })
static ArrayList generateCustomers(Class documentClass) throws Exception {
ArrayList<HashMap<String,Object>> customers = new ArrayList<HashMap<String,Object>>();
for (int i=0;i<documentCount;i++) {
HashMap<String,Object> customer = (HashMap<Str... | 3 |
public void stopLoad() {
isRun = false;
} | 0 |
private boolean LoadKerning(String line)
{
try
{
Scanner s = new Scanner(line);
Kerning newKerning = new Kerning();
int id = 0;
while(s.hasNext())
{
StringTokenizer st = new StringTokenizer(s.next(), "=");
String command = st.nextToken();
if (command.equals("first"))
{
... | 6 |
public void setDirection(int dir)
{
this.direction = dir;
switch(direction) {
case SOUTH :
setRotation(90);
break;
case EAST :
setRotation(0);
break;
case NORTH :
setRotation(270);
... | 4 |
double getRowLength(double row) {
if (row <= 0) {
return 0;
}
if (row <= n) {
return 6 * row;
}
if (row <= 2 * n) {
return 3 * n + 3 * row;
}
if (row <= 3 * n) {
return 9 * n;
}
if (row <= 4 * n) {
... | 6 |
public static void pauseSchedule(){
// used for loops
int i;
// Used to access the specific methods associated with a video player
VideoPlayer currentVideoPlayer;
// Used to access the specific methods associated with a audio player
AudioPlayer currentAudioPlayer;
// Used to access the specific methods a... | 7 |
public void quickSort(int[] data, int start, int end){
int i = start;
int j = end;
int p = (start + end)/2;
int pivot = data[p];
while(i < j){
while(i < p && pivot >= data[i]){
++i;
}
if(i < p){
data[p] = data[i];
p = i;
}
while(j > p && pivot <= data[j]){
--j;
}
if(j >... | 9 |
@Override
public int hashCode() {
int result;
long temp;
result = itemId;
result = 31 * result + (name != null ? name.hashCode() : 0);
temp = percent != +0.0d ? Double.doubleToLongBits(percent) : 0L;
result = 31 * result + (int) (temp ^ (temp >>> 32));
return ... | 2 |
private void menuShowHelpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuShowHelpActionPerformed
formHelp fh = new formHelp();
fh.setAlwaysOnTop(true);
fh.setVisible(true);
// TODO add your handling code here:
}//GEN-LAST:event_menuShowHelpActionPerformed | 0 |
private Object js_unescape(Object[] args)
{
String s = ScriptRuntime.toString(args, 0);
int firstEscapePos = s.indexOf('%');
if (firstEscapePos >= 0) {
int L = s.length();
char[] buf = s.toCharArray();
int destination = firstEscapePos;
for (int... | 8 |
public static TimeDuration stringToTimeDuration(String duration) {
{ int nDays = 0;
int nMillis = 0;
boolean negativeP = Native.stringSearch(duration, "minus", 0) != Stella.NULL_INTEGER;
int dayStartPosition = 0;
int dayEndPosition = 0;
int msStartPosition = 0;
int msEndPosition ... | 6 |
public BareBonesWhile(String[] Lines, String[] CurrentLineParts, LineReference currentLine, HashMap<String, Integer> Variables) throws BareBonesSyntaxException, BareBonesCompilerException
{
super(Lines, currentLine, Variables);
if(!CurrentLineParts[0].equalsIgnoreCase("while")) throw new BareBonesCompilerExcept... | 8 |
public static String removeNewLine(String text) {
do {
text = text.replaceAll("\n", "");
} while (text.contains("\n"));
return text;
} | 1 |
public double getSimilarity(String s1, String s2) {
s1 = s1.toLowerCase();
s2 = s2.toLowerCase();
int[] costs = new int[s2.length() + 1];
for (int i = 0; i <= s1.length(); i++) {
int lastValue = i;
for (int j = 0; j <= s2.length(); j++) {
if (i == 0)
costs[j] = j;
else {
if (j > 0) {
... | 6 |
public void menuCadastrarHorario(String disci, String dia, int numero,
int hI, int hF) {
try {
Disciplina disciplina = sistemaFrontEnd.pesquisaDisciplina(disci);
try {
sistemaFrontEnd.pesquisaTurma(disci, numero);
sistemaFrontEnd
.cadastraHorarioTurma(disci, numero, dia, hI, hF);
} catch (Tu... | 2 |
private int addGNoise(int pixel, Random random) {
int v, ran;
boolean inRange = false;
do {
double nextGaussian = 0;
//nextGaussian = random.nextGaussian();
nextGaussian = getGaussianNoise(this.mean,this.getVariance());
ran = (int) Math.round(nextGaussian * noiseFactor);
v = pixel + ran;
// chec... | 3 |
public static Dimension sanitizeSize(Dimension size) {
if (size.width < 0) {
size.width = 0;
} else if (size.width > MAXIMUM_SIZE) {
size.width = MAXIMUM_SIZE;
}
if (size.height < 0) {
size.height = 0;
} else if (size.height > MAXIMUM_SIZE) {
size.height = MAXIMUM_SIZE;
}
return size;
} | 4 |
@Override
public final void mousePressed(MouseEvent mouseevent) {
int x = mouseevent.getX();
int y = mouseevent.getY();
if (frame != null) {
x -= 4;
y -= 22;
}
idleTime = 0;
clickX = x;
clickY = y;
clickTime = System.currentTimeMillis();
if (mouseevent.isMetaDown()) {
clickMode1 = 2;
clic... | 2 |
public Type getCanonic() {
int types = possTypes;
int i = 0;
while ((types >>= 1) != 0) {
i++;
}
return simpleTypes[i];
} | 1 |
public static Cons javaTranslateCondition(Cons condition, boolean symbolcasep) {
{ Cons translatedactions = Cons.cons(Stella.SYM_STELLA_JAVA_STATEMENTS, Cons.javaTranslateListOfTrees(condition.rest).concatenate(Stella.NIL, Stella.NIL));
Stella_Object keys = condition.value;
Stella_Object translatedkeys ... | 6 |
public Matrix3D plus(Matrix3D B) {
Matrix3D A = this;
if (B.M != A.M || B.N != A.N || B.K != A.K) throw new RuntimeException("Illegal matrix dimensions.");
Matrix3D C = new Matrix3D(M, N, K);
for (int i = 0; i < M; i++)
for (int j = 0; j < N; j++)
for (int l = 0;... | 6 |
@Basic
@Column(name = "level_debt")
public double getLevel_debt() {
return level_debt;
} | 0 |
public static void main(String[] args) {
PlayGame play = new PlayGame();
int in = 0;
Game game = null;
while (in != 4) {
switch (in = play.userInput()) {
case 1:
game = new Game(new HumanPlayer(), new ComputerPlayer());
break;
case 2:
game = new Game(new HumanPlayer(), new HumanPlayer());... | 6 |
private void createPrinterCombo() {
PrintService[] services = PrinterJob.lookupPrintServices();
if (services.length == 0) {
services = new PrintService[] { new DummyPrintService() };
}
WrappedPrintService[] serviceWrappers = new WrappedPrintService[services.length];
int selection = 0;
for (int i = 0; i <... | 3 |
private boolean find(char[][] board, boolean[][] visited, int i, int j) {
if (i - 1 < 0 || i + 1 >= board.length || j - 1 < 0 || j + 1 >= board[0].length) {
return false;
}
int[] rowStep = {-1, 1, 0, 0};
int[] colStep = {0, 0, -1, 1};
for (int t = 0; t < 4; t++) {
... | 8 |
public boolean sincronizarModelComView(Servico model) {
if (!txtItendificador.getText().equals("")) {
model.setId(Integer.parseInt(txtItendificador.getText()));
}else{
model.setId(null);
}
if (!cbClientes.getSelectedItem().equals("Selecione")) {
mode... | 6 |
public void setTotalHrsForYear(double totalHrsForYear) {
if (totalHrsForYear < 0){
throw new IllegalArgumentException("Hour total must be greater than or equal to zero");
}
this.totalHrsForYear = totalHrsForYear;
} | 1 |
public Point getPosition()
{
return recognizer.centroid;
} | 0 |
public void createUser(){
String email, nombre, pass, tipo;
boolean ciclo;
if(activo.validateTipo(Usuario.ADMINISTRADOR) && counterOfUsers < 50){
do{ System.out.print("Ingrese su email: ");
email = scan.next();
ciclo = false;
for (int x=0; x<counte... | 5 |
private void importData(String tableName, String query,
List<TableField> fieldsList, Connection bizConn, Connection memConn)
throws Exception {
// 共多少行
int totalRowNum = 0;
// 共多少页
int totalPage = 0;
// 相同字段
List<String> joinFieldList = null;
PreparedStatement pst = null;
try {
memConn.setAutoC... | 8 |
public static List<String> toSortedKeyList(Set<Object> keys) {
List<String> list = new ArrayList<String>();
for (Object key : keys) {
list.add(key.toString());
}
Collections.sort(list);
return list;
} | 1 |
public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( (other == null ) ) return false;
if ( !(other instanceof RelMarchaProcesionId) ) return false;
RelMarchaProcesionId castOther = ( RelMarchaProcesionId ) other;
return (this.getIdmarcha()==castOther.getIdmarch... | 4 |
public void run() {
try {
Thread.sleep(5000L);
if(NetworkManager.getReadThread(this.netManager).isAlive()) {
try {
NetworkManager.getReadThread(this.netManager).stop();
} catch (Throwable var3) {
;
}
}
if(Networ... | 5 |
public static int getTypeSize(String typeSig) {
return usingTwoSlots(typeSig.charAt(0)) ? 2 : 1;
} | 1 |
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.