text stringlengths 14 410k | label int32 0 9 |
|---|---|
private Symbol tryDeclareSymbol(Token ident)
{
assert (ident.isToken(Token.Kind.IDENTIFIER));
String name = ident.lexeme;
try
{
return symbolTable.insert(name);
}
catch (RedeclarationError re)
{
String message = reportDeclareSymbolError(name, ident.lineNumber, ident.charPosition);
return new Err... | 1 |
public Quaternion slerp( Quaternion dest, float lerpFactor, boolean shortest )
{
final float EPSILON = 1e3f;
float cos = this.dot( dest );
Quaternion correctedDest = dest;
if ( shortest && cos < 0 )
{
cos = -cos;
correctedDest = new Quaternion( -dest.getX(), -dest.getY(), -dest.getZ(), -dest.getW() )... | 3 |
private static void ensembleMethodOverlap() throws ParserConfigurationException, Exception {
Scanner sc = new Scanner(System.in);
System.out.println("How many systems for the ensemble?");
int numSystems = sc.nextInt();
//sc.close();
ArrayList<String> testSets[] = new ArrayList[numSystems];
AbstractResult... | 9 |
@Override
public void invoke(ChatSocket socket) throws InvalidCommandException {
// Sanity check the command
if (present && socket.getPresenceManager().isPresent(roomName, socket.getUUID())) {
throw new InvalidCommandException("Could not join " + roomName + ": Already present.");
... | 8 |
public ScreenManager() {
GraphicsEnvironment environment =
GraphicsEnvironment.getLocalGraphicsEnvironment();
device = environment.getDefaultScreenDevice();
} | 0 |
public ArrayList<Tree> findLoopControlStatements(){
ArrayList<Tree> loopControlstatements = new ArrayList<Tree>();
if(this.statement instanceof LoopControlStatement)
loopControlstatements.add(this.statement);
if(this.statements instanceof LoopControlStatement)
loopControlstatements.add(this.statements... | 3 |
@Override
public boolean equals(Object object) {
if (object == this) {
return true;
}
if (object == null || !(object instanceof AABB3)) {
return false;
}
AABB3 aabb = (AABB3) object;
return aabb.x1 == x1 && aabb.y1 == y1 && aabb.z1 == z1 && aabb.x2 == x2 && aabb.y2 == y2 && aabb.z2 == z2;
} | 8 |
@Override
public Boolean save(ModelUser oUser) {
try {
if (oUser.getId() != null) {
if (oUser.getPassword() == null
|| oUser.getPassword().equals("")
|| oUser.getPassword().equals("********")) {
String password =... | 5 |
private void foo(String str, int starts, int ends, ArrayList<String> result) {
if (starts > ends)
return;
if (starts < 0)
return;
if (starts == 0 && ends == 0) {
result.add(str);
return;
}
foo(str + '(', starts - 1, ends, result);
... | 4 |
final boolean method2535(AbstractToolkit var_ha, long l) {
if (aLong6472 != aLong6471)
method2534();
else
method2537();
if (l - aLong6472 > 750L) {
method2530();
return false;
}
int i = (int) (l - aLong6471);
if (aBoolean6484) {
for (Class318_Sub7 class318_sub7
= (Class318_Sub7) aC... | 6 |
@Override
public List<Node> shortestPath(Node source, Node dest) throws IOException {
// System.out.println("Calling shortestPath.");
LinkedList<Node> list = null;
String input = null;
try {
StringBuilder sb = new StringBuilder("shortestPath\n");
sb.append(ProtocolParser.encodeEmptyNode(source));
s... | 8 |
@Basic
@Column(name = "SOL_FECHA_HORA")
public Date getSolFechaHora() {
return solFechaHora;
} | 0 |
public MobileScriptBuilder() {
initialize();
// Perform these after UI setup
try { createDependencies(); } catch (Exception e) { Helpers.showExceptionError(frmPswgToolsMbs, e.getLocalizedMessage());}
// Populate Default Attacks combobox
Vector<String> defaultAttacks = new Vector<String>();
try(BufferedRea... | 8 |
public static List<FreightBean> get56(String oringHarborName,String destHarborName){
List<FreightBean> retFreightBeans = new ArrayList<FreightBean>();
HttpClient httpClient = new HttpClient();
httpClient.getParams().setParameter(HttpMethodParams.SO_TIMEOUT, 50000);
httpClient.getHttpConnectionManager().getParam... | 9 |
private final String stringFilter( String line )
{
if ( line == null || line.equals( "" ) )
{
return "";
}
StringBuffer buf = new StringBuffer();
if ( line.indexOf( "\"" ) <= -1 )
{
return keywordFilter( line );
}
int start = 0;... | 5 |
public boolean equals(Object o) {
return (o instanceof TreeElement)
&& fullName.equals(((TreeElement) o).fullName);
} | 1 |
private void makeDiagonalMove(Player player)
{
int diagonalDown = 0;
int diagonalUp = 0;
for(int i = 0; i < 3; i++)
{
if(this.gameField.getGameField()[i][i] == player)
{
diagonalDown++;
}
if(this.gameField.getGameField... | 9 |
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.print("Please enter x: ");
double x = keyboard.nextDouble();
int terms = 0;
while (terms == 0) {
System.out.print("Please enter the number of terms, an integer (>1 and <64): ");
terms = keyboard.nextInt();
... | 4 |
public static String toString(JSONObject jo) throws JSONException {
StringBuffer sb = new StringBuffer();
sb.append(escape(jo.getString("name")));
sb.append("=");
sb.append(escape(jo.getString("value")));
if (jo.has("expires")) {
sb.append(";expires=");
s... | 4 |
private void Speedup(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Speedup
if (currSpeed < 10)
{
++currSpeed;
world.setSpeed(currSpeed);
speedCounter.setText("Speed: " + currSpeed);
}
}//GEN-LAST:event_Speedup | 1 |
protected static final
synchronized void putCachedRaster(ColorModel cm,
WritableRaster ras) {
if (cached != null) {
WritableRaster cras = (WritableRaster) cached.get();
if (cras != null) {
int cw = cras.getWidth();
... | 5 |
public static void removeFromListById(List<AchievementRecord> achList, String achievementId) {
for ( ListIterator<AchievementRecord> it = achList.listIterator(); it.hasNext(); ) {
AchievementRecord rec = it.next();
if ( rec.getAchievementId().equals(achievementId) ) {
it.remove();
}
}
} | 2 |
public boolean get_mbr(){
if (!proj_IA_network_x.calculate() || !proj_IA_network_y.calculate()){ return false;}
//if any of the IA networks is unsatisfiable, return false
mbr = new Rectangle[var_num];
for(int i=0;i<var_num;i++){
mbr[i] = new Rectangle();
}
//Arrays.fill(mbr, new Rectangle());
maxX=0;m... | 6 |
public void color(int i, int x, int y) {
if(x < texture.getWidth() && y < texture.getHeight() && x >= 0 && y >= 0) {
texture.setRGB(x, y, new Color(i).getRGB());
this.repaint();
}
} | 4 |
public IVPBoolean ivpEqualTo(IVPValue num, Context c, HashMap map, DataFactory factory) {
IVPBoolean result = factory.createIVPBoolean();
map.put(result.getUniqueID(), result);
boolean resultBoolean = false;
if(getValueType().equals(IVPValue.INTEGER_TYPE) && num.getValueType().equals(IVPValue.INTEGER_TYPE)){
... | 5 |
public static String extractAlbumFrom(String filePath)
/*
* The extractAlbumFrom method checks the ID3 version of the mp3 file and
* extracts the artist's name from the MP3 file.
*/
{
String albumName = null;
try
{
Mp3File mp3File = new Mp3File(filePath);
if (mp3File.hasId3v2Tag())
{
ID3... | 7 |
public static void sort(Comparable[] a){
for(int i = 0; i < a.length; i++){
int k = i;
for(int j = i + 1; j < a.length; j++){
if(a[j].compareTo(a[k]) < 0){
k = j;
}
}
if( k == i) continue;
Comparable tmp = a[k];
a[k] = a[i];
a[i] = tmp;
}
} | 4 |
private byte[] rehash(byte[] passwordHash, byte[] salt) {
try {
MessageDigest md = MessageDigest.getInstance("SHA-256");
byte[] bytes = new byte[passwordHash.length + salt.length];
// Join passwordHash and salt together into a single array, seed
System.arraycopy(passwordHash, 0, bytes, 0, passwordHash.le... | 2 |
public void terminateSesion() {
endSesion = true;
try {
clientSocket.close();
clientSocket = null;
} catch (IOException e) {
e.printStackTrace();
}
} | 1 |
@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 Medico)) {
return false;
}
Medico other = (Medico) object;
if ((this.idMedico == null && other.idMedico != null... | 5 |
public static void main(String[] args) {
int[][] array = new Spiral_Matrix_II().generateMatrix(6);
for(int i=0;i< array[0].length;i++)
System.out.println(Arrays.toString(array[i]));
} | 1 |
private boolean isStoppingCriterionNotMet(int currentIteration) {
if (!UserStopCondition.shouldStop()) {
if (isStoppingCriterion) {
return (population.getBestFitness() > FITNESS_THRESHOLD);
} else {
return ((maxIterations == 0) || (currentIteration < maxIterations));
}
} else {
return false;
}... | 3 |
public boolean step(Point where) {
Viewport port = findViewport(owner);
Rectangle rect = Rectangle.SINGLETON;
port.getClientArea(rect);
port.translateToParent(rect);
port.translateToAbsolute(rect);
if (!rect.contains(where) || rect.crop(threshold).contains(where))
return false;
// set scroll offset (... | 9 |
public AttributeResource(int id) {
this.attributeID = id;
} | 0 |
protected WordText buildSpaceWord(GlyphText sprite) {
// because we are in a normalized user space we can work with ints
Rectangle2D.Float bounds1 = currentGlyph.getBounds();
Rectangle.Float bounds2 = sprite.getBounds();
float space = bounds2.x - (bounds1.x + bounds1.width);
//... | 3 |
@Path("editUser.html")
@Produces(MediaType.TEXT_HTML)
@GET
public Response getEditUserView(@CookieParam("authUser") String token, @QueryParam("message") String message, @QueryParam("userName") String userName) {
try {
UserToken verifiedUserToken = doVerifyUserToken(token);
/... | 7 |
@Override
public boolean decideDraw(int turn) {
int[] votes = new int[2];
for (Model m: ensemble)
votes[m.decideDraw(turn) ? 1 : 0]++;
return votes[1] > votes[0];
} | 2 |
private void verificarInvariante() {
int i,x1,y1,x2,y2 ;
ArrayList<Integer> actual;
Nodo nodoAEvaluar;
Nodo posibleAdyacente;
int N=(int) Math.sqrt(V);
for(i = 0; i< V; i++){
actual=adj(i);
x1=i%N;
y1=(i-x1)/N;
nodoAEvaluar=malla[y1][x1];
for (Integer j : actual)
{
x2=j%N;
y2=(j-x... | 3 |
public static void main(String[] args)
{
System.out.println("Starting network example ...");
try
{
//////////////////////////////////////////
// First step: Initialize the GridSim package. It should be called
// before creating any entities. We can't run ... | 7 |
protected Icon getIcon() {
java.net.URL url = getClass().getResource("/ICON/state_collapse.gif");
return new ImageIcon(url);
} | 0 |
public Channel getChannel() {
if (name.equals(Server.get().getButler().getName())) {
return null;
}
synchronized (channels) {
return channels.get(channels.size() - 1);
}
} | 1 |
@Override
public void run(int interfaceId, int componentId) {
if (stage == -1) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(), "I'm hoping this is worth the time Reaper." },
IS_PLAYER, player.getIndex(), 12379);
stage = 1;
} else if (stage == 1) {
sendEntityDialogue(SE... | 9 |
protected static ArtifactType getArtifactTypeFromEntry(Entry entry) {
// Take a look at what's in the JAXB artifact wrapper (if one exists).
try {
Artifact artifactWrapper = getArtifactWrapper(entry);
if (artifactWrapper != null) {
String hint = null;
... | 8 |
public float getMaxSpeed() {
return 0;
} | 0 |
public void testConstructorEx1_Type_int() throws Throwable {
try {
new Partial(null, 4);
fail();
} catch (IllegalArgumentException ex) {
assertMessageContains(ex, "must not be null");
}
} | 1 |
void copyUtf8ReadBuffer(int count) throws java.lang.Exception
{
int i = 0;
int j = readBufferPos;
int b1;
boolean isSurrogate = false;
while (i < count) {
b1 = rawReadBuffer[i++];
isSurrogate = false;
// Determine whether we are dealing
... | 6 |
public void printCosts(){
System.out.println("costs matrix for the traveling salesman problem:");
for(int i = 0;i<costs.length;i++){
for(int j = 0;j<costs[i].length;j++){
System.out.print(costs[i][j]+" ");
}
System.out.print("\n");
}
} | 2 |
private void createPaths() {
if( path == null ) {
path = new Path2D.Float();
closedPath = new Path2D.Float();
Iterator<Point> line = createLine().iterator();
if( line.hasNext() ) {
Point previous = line.next();
List<Line2D> lines = new ArrayList<>();
List<Line2D> reverse = new ArrayList<>()... | 5 |
private boolean checkFields() {
if(employeeName.getText().equals(""))
{
JOptionPane.showMessageDialog(this,
"There is no such employee with that ID. Please enter a valid ID",
"Incomplete Form",
JOptionPane.WARNING_MESSAGE);
return false;
}
if(employerName.getText().equals(""))
{
... | 8 |
private static String cutString(final String string, final boolean deleteDelimiters, final String ending, final String... begining) throws Exception
{
if(!string.contains(ending))
throw new Exception();
boolean exists = false;
for(final String temp : begining)
if(string.contains(temp))
exists = true;
... | 8 |
private void quitter() {
System.out.println("Déconnexion du client...");
if (emetteur != null) {
try {
emetteur.close();
} catch (IOException e) {
System.out.println("Problème de déconnexion.");
}
}
System.out.println("Client déconnecté. Bye !");
} | 2 |
public static void main(String[] args) {
GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabase(Name.DB_PATH);
Node refeNode = graphDb.getReferenceNode();
// 查找所有单位
logger.debug("==查找所有单位:");
Traverser orgTraverser = TraverserHelper.findAllOrg2(refeNode);
for (Path orgPath : orgTrave... | 8 |
private boolean inBounds(int x, int y) {
return ( ((x >= 0) && (x < width))
&& ((y >= 0) && (y < height)) );
} | 3 |
public void onStop() throws JFException {
// ストラテジーを停止した際に呼ばれます。
LOGGER.info("onStop");
printWriter.close();
} | 0 |
public int getRatingId() {
return ratingId;
} | 0 |
@Override
public int[][] findMatching(DeviceGraph graph) {
ObjectGraphBuilder ogb = new ObjectGraphBuilder();
HashSet<Requestor> requestors = ogb.buildObjectGraph(graph);
int requestorCount = requestors.size();
HelperGroupFinder hgf = new HelperGroupFinder();
ArrayList<Requestor> matchedRequestors = new Arra... | 8 |
public void uimsg(String msg, Object... args) {
if(msg == "set") {
synchronized(ui) {
int i = 0, o = 0;
while(i < equed.size()) {
if(equed.get(i) != null)
equed.get(i).unlink();
int res = (Integer)args[o++];
if(res >= 0) {
int q = (Integer)args[o++];
Item ni = new Item(Coord.z, res,... | 9 |
public void outputPMFile(PMFile file, File outputFile) {
try {
byte[] key = new BASE64Decoder().decodeBuffer(file.getPassword());
if (file.getNum() != null) {
for (int i = 0; i < file.getNum().intValue(); i++) {
File f = new File(Setting.DIRNAME_OF_SAVING_PMFILE
+ file.getName() + i + Setting.EN... | 9 |
public AdjacencyList getMinBranching(Node root, AdjacencyList list) {
AdjacencyList reverse = list.getReversedList();
// remove all edges entering the root
if (reverse.getAdjacent(root) != null) {
reverse.getAdjacent(root).clear();
}
AdjacencyList outEdges = new Adjac... | 9 |
public void calculateInternals(double duration) {
if (body[0] == null) swapBodies();
if (body[0] != null)
{
calculateContactBasis();
relativeContactPosition[0] = new Vector3d(contactPoint);
relativeContactPosition[0].Substract(body[0].getPosition());
if (body[1] != null)
{
relativ... | 4 |
@Override
public boolean execute(MOB mob, List<String> commands, int metaFlags)
throws java.io.IOException
{
final PlayerStats pstats=mob.playerStats();
if(pstats==null)
return false;
String channelName=commands.get(0).toUpperCase().trim().substring(2);
commands.remove(0);
int channelNum=-1;
for(int ... | 9 |
public BigDecimal mean_as_BigDecimal() {
BigDecimal mean = BigDecimal.ZERO;
switch (type) {
case 1:
double[] dd = this.getArray_as_double();
double meand = 0.0D;
for (int i = 0; i < length; i++)
meand += dd[i];
meand /= length;
mean = new BigDecimal(meand);
break;
case 12:
BigDecimal[] ... | 5 |
private static Boolean runStatement(String statement)
{
try
{
getConnection();
PreparedStatement st = con.prepareStatement(statement);
st.executeUpdate();
return true;
}
catch (SQLException ex)
{
System... | 1 |
public void makeNonVoid() {
if (type != Type.tVoid)
throw new jode.AssertError("already non void");
ClassInfo clazz = getClassInfo();
InnerClassInfo outer = getOuterClassInfo(clazz);
if (outer != null && outer.name == null) {
/* This is an anonymous class */
if (clazz.getInterfaces().length > 0)
ty... | 4 |
public static Comparator comparator() {
if (Type.comparator != null) {
return (Type.comparator);
}
Type.comparator = new Comparator() {
public int compare(final Object o1, final Object o2) {
// o1 < o2 : -1
// o1 == o2 : 0
// o1 > o2 : 1
if (!(o1 instanceof Type)) {
throw new IllegalA... | 4 |
private void initialize(final int flags) {
this.flags = flags;
count = 0;
count += ((flags&InputFlags.TA_IN_PRICE_OPEN)!=0) ? 1 : 0;
count += ((flags&InputFlags.TA_IN_PRICE_HIGH)!=0) ? 1 : 0;
count += ((flags&InputFlags.TA_IN_PRICE_LOW)!=0) ? 1 : 0;
count += ((flags&Input... | 6 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if((!mob.isInCombat())||(mob.rangeToTarget()<1))
{
mob.tell(L("You really should be in ranged combat to cast this."));
return false;
}
for(int i=0;i<mob.location().numItems();i++)
{
fi... | 9 |
HubNode (
Device dev,
TreeNode parent
) throws IOException
{
super (dev, parent);
hub = new Hub (dev);
addr = dev.getAddress ();
// Flat tree display: devices connect to root hub.
if (isFlatTree) {
if (hub.isRootHub ()) {
Bus bus = dev.getBus ();
children = new USBNode [127];
last = 0;
f... | 7 |
public String RetrieveActualPassword(String userName) throws SQLException{
String actualPassword=null;
try{
databaseConnector=myConnector.getConnection();
stmnt=(Statement) databaseConnector.createStatement();
SQLQuery="SELECT passwor... | 4 |
public void render(GameContainer gc, Graphics g) throws SlickException{
if(dx == 0 && dy == 0){
if(facingRight)
animation = idleRight;
else
animation = idleLeft;
}
animation.draw(x, y);
g.setColor(Color.red);
g.drawRect(x, y - 12, 16, 4);
g.setColor(Color.green);
g.drawRect(x, y - 12, 16 ... | 3 |
private boolean containsExcludeToken(String agentString)
{
if (excludeList != null) {
for (String exclude : excludeList) {
if (agentString != null && agentString.toLowerCase().indexOf(exclude.toLowerCase()) != -1)
return true;
}
}
return false;
} | 4 |
public String getaddress()
{
return address;
} | 0 |
public static String getString(String urlString) throws MalformedURLException, IOException {
URL url;
InputStream is = null;
BufferedReader br;
String line;
StringBuilder result = new StringBuilder();
try {
url = new URL(urlString);
HttpURLConnect... | 2 |
public void reset() {
this.year=-1;
this.month=-1;
this.day=-1;
this.hour=-1;
this.minute=-1;
this.second=-1;
this.extraData=null;
} | 0 |
private String parsePrefix(final ByteArrayInputStream is) {
final StringBuilder b = this.b;
b.setLength(0);
int ch;
is.mark(0);
ch = is.read();
if (ch != ':') {
is.reset();
return "";
}
ch = is.read();
while (ch != ' ' && ch... | 9 |
public ClientListenerHandler(ServerSocket socket, String userName) {
// TODO Auto-generated constructor stub
socketListen = socket;
run = true;
myUserName = userName;
} | 0 |
protected boolean automatonActionPermissible(Component source) {
if (!(getObject() instanceof Automaton))
return true;
if (automaton.getInitialState() == null) {
JOptionPane.showMessageDialog(source,
"Simulation requires an automaton\n"
+ "with an initial state!", "No Initial State",
JOptionP... | 8 |
static private boolean jj_3R_18() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_5()) {
jj_scanpos = xsp;
if (jj_3R_39()) {
jj_scanpos = xsp;
if (jj_3R_40()) {
jj_scanpos = xsp;
if (jj_3R_41()) {
jj_scanpos = xsp;
if (jj_3_6()) {
jj_scanpos = xsp;
if (jj_3R_42()) {
jj_sc... | 7 |
@Override
public int getPages(int intRegsPerPag, ArrayList<FilterBean> hmFilter, HashMap<String, String> hmOrder) throws Exception {
int pages;
try {
oMysql.conexion(enumTipoConexion);
pages = oMysql.getPages("cliente", intRegsPerPag, hmFilter, hmOrder);
oMysql.de... | 1 |
public Position GetPositionInFront(int Rotation)
{
Position Return = new Position(this.X, this.Y, this.Z);
switch(Rotation)
{
case 0:
Return.Y--;
break;
case 1:
Return.X--;
Return.Y--;
break;
case 2:
Return.X++;
break;
case 3:
Return.X--;
Return.Y++;
... | 8 |
public void evaluate(Instance instance, Prediction prediction) {
Label correct = instance.label();
Label predicted = prediction.winner();
if (correct.equals(predicted)) {
if (correct.isPositive() && predicted.isPositive())
TP++;
else if (!correct.isPositive() && !predicted.isPositive())
TN++;
els... | 9 |
public void refuel(int fuel) {
tank.refuel(fuel);
if(!tank.isEmpty()) {
setDead(false);
}
} | 1 |
private boolean versionCheck(String title)
{
if (this.type != UpdateType.NO_VERSION_CHECK) {
final String version = this.plugin.getDescription().getVersion().replace("dev", "");
if (title.split(" v").length == 2) {
final String remoteVersion = title.split(" v")[1].sp... | 7 |
public void visitShiftExpr(final ShiftExpr expr) {
if (expr.expr == from) {
expr.expr = (Expr) to;
((Expr) to).setParent(expr);
} else if (expr.bits == from) {
expr.bits = (Expr) to;
((Expr) to).setParent(expr);
} else {
expr.visitChildren(this);
}
} | 2 |
public void close() {
System.out.println("tcp servers closed");
TCPServer tcpServer;
for (int i = 0; i < tcpServers.size(); i++) {
tcpServer = tcpServers.get(i);
if (tcpServer != null) {
tcpServer.keepRunning = false;
}
}
shut... | 4 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final OutputCanDDeliveryOrderItemDetailPK other = (OutputCanDDeliveryOrderItemDetailPK) obj;
if (!Objects.equal... | 5 |
public synchronized Robot getRobot(String robot_name) {
return robots.get(robot_name);
} | 0 |
public void update() throws IOException {
checkTileMapCollision();
setPosition(xtemp, ytemp);
if(dx == 0 && !hit) {
setHit();
}
animation.update();
if(hit && animation.hasPlayedOnce()) {
remove = true;
}
} | 4 |
public boolean isReturn() {
switch (opcode) {
case opc_areturn:
case opc_ireturn:
case opc_lreturn:
case opc_freturn:
case opc_dreturn:
case opc_return:
return true;
default:
return false;
}
} | 6 |
public static void displayCalendar(int year) {
Calendar cal = Calendar.getInstance();
cal.set(year, 0, 1);
String[] months = { "January", "February", "March", "April", "May",
"June", "July", "August", "September", "October", "November",
"December" };
String[] days = { "", "Su", "Mo", "Tu", "We", "Th", ... | 6 |
public static void main (String [] args )
{
Piece p;
Scanner keyboard = new Scanner (System.in);
System.out.print ("Would you like to play with a Bishop, Knight or King? ");
String answer = keyboard.nextLine ();
if (answer.charAt(0) == 'b' || answer.charAt(0) == 'B') p = ne... | 8 |
public void compFinalResult() {
do {
iStage++;
compAllocation();
if (compDistribution()) {
/* deadline can not be satisfied */
if (!bDeadline) {
System.out.println("THE DEADLINE CAN NOT BE SATISFIED!");
return;
} else {
System.out.println("\nNEW ROUND WITHOUT CHECKING:");
dEv... | 7 |
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 void setNote(Note note){
myNote = note;
} | 0 |
@Override
protected Unmarshaller create() {
try {
return context.createUnmarshaller();
} catch (JAXBException e) {
throw new XmlTransformationException("Failed to create jaxb unmarshaller", e);
}
} | 1 |
public int patientsLengthRecursively() {
if (this.isLast) {
return 1;
} else {
return 1 + nextPatient.patientsLengthRecursively();
}
} | 1 |
@Basic
@Column(name = "PCA_DESCRIPCION")
public String getPcaDescripcion() {
return pcaDescripcion;
} | 0 |
public Village getVillage() { return village; } | 0 |
public String ObtenerImagen(String Ruta, String Nombre){
try {
Mp3File mp3file = null;
mp3file = new Mp3File(Ruta);
if (mp3file != null && mp3file.hasId3v2Tag()) {
ID3v2 id3v2Tag = mp3file.getId3v2Tag();
byte[] imageData = id3v2Tag.getAlbumI... | 5 |
private String twoDigitString(int timeValue)
{
String result = Integer.toString(timeValue);
if (result.length() == 1)
{
result = "0" + result;
}
return result;
} | 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.