text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void calculateLineStatistics() {
if (codeLineCount == 0) {
for (int i = 1; i < lines.size(); i++)
if (lines.get(i) != null) {
codeLineCount++;
if (lines.get(i) > 0)
codeLinesCoveredCount++;
}
... | 4 |
public static double estimateCardinalityOfExtension(NamedDescription description) {
if ((description == null) ||
(!NamedDescription.relationSupportsExtensionP(description))) {
return (Stella.NULL_FLOAT);
}
{ int estimate = Description.accessObservedCardinality(description);
if ((estimat... | 6 |
private static int[] merge(int[] a, int[] b) {
int[] c = new int[a.length + b.length];
int indexA = 0, indexB = 0;
for (int indexC = 0; indexC < c.length; indexC++) {
if (indexA < a.length && (indexB == b.length || a[indexA] <= b[indexB]))
c[indexC] = a[indexA++];
else if (indexB < b.length && (indexA =... | 7 |
static final private AbsValueNode possible_infixed_expression() throws ParseException, CompilationException {
Token t;
AbsValueNode v;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case NUMBER:
t = jj_consume_token(NUMBER);
v = infixed_expression(new NumberVNode(t.image,currentLine));
... | 5 |
private void createEnderPortal(int par1, int par2)
{
byte var3 = 64;
BlockEndPortal.bossDefeated = true;
byte var4 = 4;
for (int var5 = var3 - 1; var5 <= var3 + 32; ++var5)
{
for (int var6 = par1 - var4; var6 <= par1 + var4; ++var6)
{
... | 8 |
@Override
public int numberOfLivingNeighbors(int x, int y) {
int numberOfLivingNeighbors = 0;
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
if (!(i == 0 && j == 0)) {
int xCoordinate = x + i;
int yCoordinate = y + j... | 6 |
public static String formatTime3(long secs) {
int seconds = (int) secs;
int minutes = 0;
int hours = 0;
int days = 0;
days = seconds / (60 * 60 * 24);
hours = seconds / (60 * 60) % 24;
minutes = (seconds / 60) % 60;
seconds %= 60;
StringBuffer buf = new StringBuffer();
if (days > 0) {
buf.appen... | 9 |
private static double _targetFromDistance(Distance distance) {
if(distance == Distance.NEAR) {
return StringPot.VAL_NEAR;
} else if(distance == Distance.CENTER) {
return StringPot.VAL_CENTER;
} else if(distance == Distance.OPPONENT_AUTO) {
return StringPot.VAL... | 4 |
private BufferedImage getDiceImage(int size) {
if (diceImages == null)
return null;
switch(size) {
case 4: return diceImages[0];
case 6: return diceImages[1];
case 8: return diceImages[2];
case 10: return diceImages[3];
cas... | 7 |
private File forres(String nm) {
File res = base;
String[] comp = nm.split("/");
for(int i = 0; i < comp.length - 1; i++) {
res = new File(res, comp[i]);
}
return(new File(res, comp[comp.length - 1] + ".cached"));
} | 1 |
public static void getLongestSubString() {
// 两个需要对比的字符串
String x = "abcdehpoi";
String y = "bcdehfpoidfdegsfet";
int substringLength1 = x.length();
int substringLength2 = y.length();
// 第一步:构造需要遍历的二位数组
int opt[][] = new int[substringLength1 + 1][substringLength2 + 1];
// 定义三个临时变量:最大值,最大值横坐标和竖坐标
int... | 8 |
public boolean canBePillaged(Unit attacker) {
return !hasStockade()
&& attacker.hasAbility("model.ability.pillageUnprotectedColony")
&& !(getBurnableBuildingList().isEmpty()
&& getShipList().isEmpty()
&& (getLootableGoodsList().isEmpty()
... | 7 |
public void addItemsToSupplierCombobox(ArrayList<Person> list) {
supplierComboboxItems.clear();
String item = "<html><font color='red'>Add New Supplier</font></html>";
supplierComboboxItems.add(item);
if (driver.getPersonDB().getSupplierList().size() > 0) {
for (Person person : list) {
item = "\t" + pers... | 2 |
public static void main(String argv[]) throws Exception {
PORT = Integer.parseInt(argv[0]);
FILENAME = argv[1];
WINDOW = Integer.parseInt(argv[2]);
serverSocket = new DatagramSocket(PORT);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
boolean eof = false;
ArrayList<byte[]> packet_buffer = n... | 4 |
@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 TaxonObservationDownloadStatisticsPK)) {
return false;
}
TaxonObservationDownloadStatisticsPK other = (TaxonObservation... | 6 |
public void disconnect(){
try {
instream.close();
outstream.close();
} catch(IOException e) {
}
} | 1 |
protected Integer coerceToInteger(Object value) {
if (value == null || "".equals(value)) {
return Integer.valueOf(0);
}
if (value instanceof Integer) {
return (Integer)value;
}
if (value instanceof Number) {
return Integer.valueOf(((Number)value).intValue());
}
if (value instanceof String) {
t... | 7 |
public int getColsCount() {
return m_colsCount;
} | 0 |
private List<String> getImageNames(boolean sameSize) {
List<String> imagens = new ArrayList<String>();
for (JInternalFrame frame : getDskCenter().getAllFrames())
if (frame instanceof ImagemIFrame) {
if (sameSize) {
BufferedImage selected = getSelectedFrame... | 5 |
@Basic
@Column(name = "sale_estado")
public String getEstadoMovimiento() {
return estadoMovimiento;
} | 0 |
public Configuration[] getSelected() {
return (Configuration[]) selected.toArray(new Configuration[0]);
} | 0 |
private static byte[] joinQuartetsToBytes(byte[] quartets) {
byte[] block = new byte[quartets.length / 2];
for (int i = 0; i < quartets.length; i += 2) {
block[i/2] = ByteHelper.joinBlocks(quartets[i], quartets[i + 1]);
}
return block;
} | 1 |
public void allDFS(Graph G)
{
// find a vertex to serve as the starting point for a DFS search in each
// component. 'componentCount' will not only keep a count of the
// components but will
// also serve as the id to use for all vertices of that component
for (int v = 0; v < G.V(); v++)
{
dfs(G, v);
... | 1 |
private void boutonDeumeureDesElfesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boutonDeumeureDesElfesMouseClicked
// TODO add your handling code here:
if (partie.getDde().isActif()) {
if (!partie.getDieuActuel().isaJoueurEnDeumeureDesElfes()
|| ((partie... | 5 |
protected void layout(List<Object> parallels)
{
Object edge = parallels.get(0);
mxIGraphModel model = graph.getModel();
mxGeometry src = model.getGeometry(model.getTerminal(edge, true));
mxGeometry trg = model.getGeometry(model.getTerminal(edge, false));
// Routes multiple loops
if (src == trg)
{
dou... | 5 |
@Override
public boolean activateProfile(Profile profile) {
// Save the directories
String dataDir = getDir();
String saveDir = dataDir + getGameSaveDir();
String profilesDir = dataDir + getSave() + File.separator;
// Find the currently active profile
... | 7 |
public JList<String> getListUsuarios() {
if (listUsuarios == null) {
listUsuarios = new JList<String>();
}
return listUsuarios;
} | 1 |
private void setupWorldWind() {
BasicModel model = new BasicModel();
globeRound = model.getGlobe();
wwCanvas.setModel(model);
// highlightController = new HighlightController(wwCanvas, SelectEvent.ROLLOVER);
// ttController = new ToolTipController(wwCanvas);
// Register a rendering... | 1 |
public static void main(String[] args) {
Scanner scanIn = new Scanner(System.in);
System.out.println("Please key in number for following algorithms:");
System.out.println("[1] Depth-First-Search");
System.out.println("[2] Breadth-First-Search");
System.out.println("[3] Best-First-Search");
System.out.print... | 6 |
public void checkCoupon(Service service, int position) {
Calendar today = Calendar.getInstance();
long todaysTime = this.expiryDate.getTimeInMillis();
long serviceTime = service.serviceDate.getTimeInMillis();
long oneDay = 1000 * 60 * 60 * 24;
int difference = (int) ((todaysTime ... | 8 |
public void destroy() {
for(BaseComponent bc : components.values()) {
bc.destroy();
}
components.clear();
} | 1 |
@Override
public PermissionType getType() {
return PermissionType.WORLD;
} | 0 |
@SuppressWarnings("deprecation")
@EventHandler
public void click(InventoryClickEvent event)
{
Player player = (Player) event.getView().getPlayer();
OpenQuestLog oql = getOpenQuestLog(player);
if(oql == null)return;
event.setCancelled(true);
if(event.getView() != oql.getInventoryView())
{
player.update... | 8 |
public static void main(String[] args) throws InterruptedException {
final int numberOfTrees = 20;
final int numberOfDucks = 20;
final int numberOfHunters = 20;
HuntField f = new HuntField(21, 70);
for (int i = 0; i < numberOfTrees; i++) new Tree(f);
for (int i =... | 4 |
public void ge_relation(TextArea area,SimpleNode node,String prefix,int cur_end_num,int if_or_while,int con)throws SemanticErr{
if(node.toString().equals("Relation_expression")) {
SimpleNode left = (SimpleNode) node.jjtGetChild(0).jjtGetChild(0).jjtGetChild(0);
SimpleNode rel = (SimpleNo... | 5 |
public String getCurrentPuzzle()
{
String currentPuzzle = "";
int i = 0, j = 0;
for(i = 0; i < 16; i++)
{
for(j = 0; j < 16; j++)
{
if(entries[i][j].isEditable())
{
currentPuzzle = currentPuzzle +"E ";
}
else
{
currentPuzzle = currentPuzzle +"N ";
}
if(entries[i][j].... | 4 |
private static void checkForBlackjack(Dealer dealer, Player player) {
boolean playerHasBlackjack = player.getHasBlackjack();
boolean dealerHasBlackjack = dealer.getHasBlackjack();
// End round if both have blackjack. Tie situation.
if(playerHasBlackjack && dealerHasBlackjack) {
System.out.println("Both ha... | 4 |
public JSONObject putOnce(String key, Object value) throws JSONException {
if (key != null && value != null) {
if (this.opt(key) != null) {
throw new JSONException("Duplicate key \"" + key + "\"");
}
this.put(key, value);
}
return this;
} | 3 |
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args)
{
if(plugin.hasPermission(sender, "authy")){
if(args.length==0){
}else{
if(args[0].equalsIgnoreCase("register")){
this.register(sender, cm... | 3 |
private ArrayList<String> getValidationErrors() {
ArrayList<String> errors = new ArrayList<String>();
String username = txtUsername.getText();
if (username.isEmpty()) { errors.add("Username field is blank"); }
return errors;
} | 1 |
public void nextQuestion(){
Scanner input = new Scanner(System.in);
question=new Test();
Random random = new Random();
number = random.nextInt(4);
while(check.contains(number))
{
number = random.nextInt(4);
}
check.add(number);
switch(num... | 9 |
@Override
public Object getAsObject(FacesContext facesContext, UIComponent component, String value) {
if (value == null || value.length() == 0 || JsfUtil.isDummySelectItem(component, value)) {
return null;
}
return this.ejbFacade.find(getKey(value));
} | 3 |
@Override
public Movement getMove(Board b) {
List<PosibleWord> movements = b.getPosibleWords();
Dictionary dic = b.getDic();
SortedSet<WordInfo> words = new TreeSet<WordInfo>();
for (PosibleWord pw : movements) {
Iterator<String> it = dic.iterator(pw.getPattern());
while (it.hasNext()) {
String... | 5 |
@Get
public Set<Intervention> readAll() {
Set<Intervention> interventions = null;
String userkey = (String) getRequest().getAttributes().get("userid");
if (userkey == null)
return null;
User target = null;
try {
long userid = Long.valueOf(userkey);
EntityManager em = emf.createEntityManager()... | 3 |
public static boolean isString(String line){
if(line.charAt(0) == '"' && line.charAt(line.length()-1) == '"'){
return true;
}
return false;
} | 2 |
public boolean matches(Operator loadop) {
return loadop instanceof GetFieldOperator
&& ((GetFieldOperator) loadop).ref.equals(ref);
} | 1 |
public void registerCommand(Object obj) {
Method methods[] = obj.getClass().getDeclaredMethods();
for(Method m: methods) {
if(m.isAnnotationPresent(DBCommand.class)) {
Class<?> params[] = m.getParameterTypes();
if(params.length == 2 && params[0] == CommandSend... | 7 |
public void respawn(final boolean force) {
if (force) {
final int numShouldSpawn = monsterSpawn.size() - spawnedMonstersOnMap.get();
if (numShouldSpawn > 0) {
int spawned = 0;
for (Spawns spawnPoint : monsterSpawn) {
spawnPoint.spawnM... | 9 |
@Override
public void fill(Parameter parameter, Type type, Annotation[] annotations)
{
Class clazz;
Class reader;
if (type instanceof Class)
{
reader = ((Class)type);
clazz = ((Class)type);
}
else if (type instanceof ParameterizedType)
... | 7 |
private void expand1(byte[] src, byte[] dst) {
for (int i = 1, n = dst.length; i < n; i += 8) {
int val = src[1 + (i >> 3)] & 255;
switch (n - i) {
default:
dst[i + 7] = (byte) ((val) & 1);
case 7:
dst[i + 6] = (byte... | 8 |
private void showAllNodesOnTree(UrlNode node , int i ){
System.out.println("Level : " + i + " , Path : " + node.selfUrl + " , parentUrl : " + node.parentUrl + " , childNum :" + node.childNodes.size() );
if( node.childNodes == null || node.childNodes.size() == 0)
return ;
for(UrlNode nodes : node.childNod... | 3 |
@Override
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
String cmd = request.getParameter(CMD_PARAM);
UserGame game = (UserGame) request.getSession().getAttribute(USER_GAME);
boolean refresh = false;
if (REFRESH_CMD.equals(cmd)) {
r... | 9 |
public void Update(double timeDelta)
{
m_collidedLastFrame = false;
if (m_interType == InteractionType.Kinetic || m_interType == InteractionType.Ghost || m_velocityX != 0.0 || m_velocityY != 0.0)
m_physicsModel.PerformCollisionFor(this);
double dX = m_velocityX * timeDelta + m_accelX * timeDelta * timeDelt... | 5 |
public static void AddIndividualReport(String TestPath, String Testname)
{
FileWriter fstream =null;
BufferedWriter out =null;
try
{
fstream = new FileWriter(TestPath);
out = new BufferedWriter(fstream);
out.write("<html>");
out.write("<head>");
out.write("<title>");
out.write(Testname + " Detailed... | 1 |
private static void mergeSort(Branch[] src, Branch[] dest,
int low, int high, int off) {
int length = high - low;
// Insertion sort on smallest arrays
if (length < INSERTIONSORT_THRESHOLD) {
for (int i = low; i < high; i++)
for (int j = i; j > low
&& (dest[j - 1]).compareTo(dest[j].getC()) > 0; j... | 9 |
@Deprecated
private static String checkNFE(String operation, String[] arguments)
{
if(!operationNFEArgs.containsKey(operation))
{
return "VALID";
}
String[] argsNums = operationNFEArgs.get(operation).split("&");
for(String s : argsNums)
{
if(s.contains("..."))
{
for(int x = Integer.valueOf(s... | 6 |
public Worker(int workerPriority,BlockingQueue<Worker> idleWorkers){
Integer bufferSize = Config.getInt(READ_BUFFER);
if(bufferSize == null){
bufferSize = 10;
}
this.charBuffer = ByteBuffer.allocateDirect(1024 * bufferSize);// 创建读取缓冲区
this.idleWorkers = idleWorkers;
handoffBox = new ArrayBlockingQueue... | 2 |
public Field() {
Point[][] res = new Point[FIELD_SIZE][FIELD_SIZE];
Scanner sc = new Scanner(System.in);
char letter;
while (true) {
System.out.println("Please, enter one letters from matrix:");
for (int i = 0; i < FIELD_SIZE; i++) {
for (int j = 0... | 7 |
private int getEhtoX(Pelihahmo h){
if (h==h1){
return ehtoh1x;
} else {
return ehtoh2x;
}
} | 1 |
public SharingPeer(String ip, int port, ByteBuffer peerId,
SharedTorrent torrent) {
super(ip, port, peerId);
this.torrent = torrent;
this.listeners = new HashSet<PeerActivityListener>();
this.availablePieces = new BitSet(this.torrent.getPieceCount());
this.exchangeLock = new Object();
this.reset();
t... | 0 |
private double findChange(Expr old, Expr nu) {
if (old == null || nu == null)
return 0;
if (old.type != nu.type)
return 0;
if (nu instanceof ExprNumber) {
return Math.abs(((ExprNumber) old).doubleValue() -
((ExprNumber) nu).doubleValue())... | 8 |
void init(){
if(volume<200){
days=0;
}else{
days=Math.min(5,volume/200);
}
} | 1 |
public String getDefinition() {
return definition;
} | 0 |
private boolean binarySearch(int[] num, int target, int s, int e) {
int mid = 0;
while (s <= e) {
mid = s + ((e - s) >> 1);
if (num[mid] == target) {
return true;
} else if (num[mid] > target) {
e = mid - 1;
} else {
s = mid + 1;
}
}
return false;
} | 3 |
public ArrayList<Node> successors()
{
ArrayList<Node> temp = new ArrayList<Node>();
State left = state.goLeft();
State up = state.goUp();
State right = state.goRight();
State down = state.goDown();
if(up != null)
{
temp.add(new Node(up, this, cost+1, Grid.Direction.UP));
}
if(down != null)
{
... | 4 |
public RemoteClientConnection(String serverIP, int port) {
this.serverIP = serverIP;
this.port = port;
} | 0 |
public void visitInnerClass(final String name, final String outerName,
final String innerName, final int access) {
checkState();
CheckMethodAdapter.checkInternalName(name, "class name");
if (outerName != null) {
CheckMethodAdapter.checkInternalName(outerName, "outer class name");
}
if (innerName != null... | 2 |
void checaColision() {
//System.out.println("Entro checaColision");
if(oro.getPosY() - oro.getAlto() > getHeight()) { //Colision de oro con borde
clickOro = false;
oro.setPosX(0);
oro.setPosY(ALTO - oro.getAlto());
if(suena)
bord... | 7 |
public Reading() {
// TODO Auto-generated constructor stub
try {
doc = Jsoup.connect(DOKUMENT_ADRESSE).get();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} | 1 |
public byte[] read_multiple(short address, int length) throws IOException {
if ((this.mode==0) || (this.mode==SET_MODE_I2C_SERIAL)) this.set_mode(SET_MODE_I2C_100);
byte[] data=new byte[3];
data[0]=(byte)RW_MULTIPLE;
data[1]=(byte)address;
data[2]=(byte)length;
byte[] result = this.s... | 3 |
public boolean jumpMayBeChanged() {
return subBlock.jump != null || subBlock.jumpMayBeChanged();
} | 1 |
private void getRootInfo() {
new Thread() {
@Override
public void run() {
setName("Root Info Thread");
setPriority(Thread.MIN_PRIORITY);
while (getDeviceInfo) {
// if (debug)
// logger.log(Level.DEB... | 4 |
public void doHDMA() {
if (frameDisabled || !hdmaEnabled) return;
if (doTransfer) {
if (direction == false) hdmaWritePPU();
else hdmaReadPPU();
}
rlc = Util.limit(Size.BYTE, rlc-1);
doTransfer = isRepeat();
if (getLineCounter() == 0) {
rlc = Core.mem.get(Size.BYTE, srcBank, ta... | 7 |
public void Read(RandomAccessFile raf) throws Exception
{
this.id = raf.readInt();
this.Name = raf.readUTF();
this.height = raf.readDouble();
} | 0 |
public static double power(double number, int power) {
if (power < 0) {
throw new IllegalArgumentException("Error: int cannot be < 0!");
}
double answer = 1;
for (int j = 0; j < power; j++) {
answer *= number;
}
return answer;
} | 2 |
private void freePlayerAction(Player user, FreePlayerData data) {
if(user.getPosition() instanceof Jail) {
if(data.isUseJailbreak() && user.hasJailbreak()) {
user.useJailbreak();
} else {
((Jail) user.getPosition()).payFine(user);
}
}
} | 3 |
public static void addConnection(String nom, String hashtag) {
Connection con = null;
try {
Class.forName("org.sqlite.JDBC");
con = DriverManager.getConnection("jdbc:sqlite:" + Parametre.workspace + "/bdd_models");
Statement stmt = con.createStatement();
ResultSet rs;
ResultSet rs2;
ResultSet rs3;... | 6 |
public final synchronized void close(){
if(fileFound){
try{
input.close();
}catch(java.io.IOException e){
System.out.println(e);
}
}
} | 2 |
private static void doImportFromXML() throws MVDException
{
try
{
if ( xmlFile != null && new File(xmlFile).exists()
&& textFile == null && !new File(mvdFile).exists() )
{
// importing from XML to MVD
File xml = new File( xmlFile );
MVD m = MVDXMLFile.internalise( xml );
MVDFile.externali... | 5 |
public boolean equals(Object object)
{
if(object == this) {
return true;
}
if(!(object instanceof Persoon)) {
return false;
}
Persoon cobj = (Persoon) object;
return (
cobj.bsn==this.bsn &&
cobj.voornaam.equal... | 9 |
public List<String> readBdbLogFile(String bdbLogFilePath) throws LogAnalyseException {
if (StringUtils.isBlank(bdbLogFilePath)) {
throw new LogAnalyseException("bdb log file path is null");
}
File bdbLogFile = new File(bdbLogFilePath);
if (!bdbLogFile.exists()) {
... | 7 |
@Override
public Object clone()
{
mxCellState clone = new mxCellState(view, cell, style);
if (label != null)
{
clone.label = label;
}
if (absolutePoints != null)
{
clone.absolutePoints = new ArrayList<mxPoint>();
for (int i = 0; i < absolutePoints.size(); i++)
{
clone.absolutePoints.a... | 7 |
@Override
public boolean equals(Object obj)
{
if(obj instanceof Item)
{
Item i = (Item) obj;
if(this.name.equals(i.name))
if(this.weight == i.weight)
return true;
}
return false;
} | 3 |
protected void setUp() throws Exception{
super.setUp();
unAuto = new Auto();
unTodoTerreno = new TodoTerreno();
unaMoto = new Moto();
unControlPolicial = new ControlPolicial();
if (unControlPolicial.numeroActual()<50){puntosAuto = 3;}
if (unControlPolicial.numeroActual()<30){puntosTodoTerreno =3;... | 3 |
public void copyToPencilMode() {
for(int i = 0; i < 16; i++) {
for(int j = 0; j < 16; j++) {
if((pencilEntries[i][j].isEditable()) && (pencilEntries[i][j].getText().equals(""))) {
pencilEntries[i][j].setText(entries[i][j].getText());
}
}
}
} | 4 |
@Override
public boolean tick(Tickable ticking, int tickID)
{
if(tickID==Tickable.TICKID_MOB)
{
if((affected!=null)
&&(affected instanceof MOB)
&&(invoker!=null))
{
final MOB mob=(MOB)affected;
if(((mob.amFollowing()!=invoker)
||(mob.amDead())
||(mob.amFollowing().getGroupMembers(new H... | 9 |
public String preCreateAssignment() {
topics = topicModel.getAll(false);
classs = classModel.getAll();
boolean check = true;
if (topics.isEmpty()) {
addFieldError("asmo.topicId", "Topic List is empty");
check = false;
}
if (classs.isEmpty... | 5 |
@Override
public long sizeOf() {
return mContent.length();
} | 0 |
public static BigDecimal toDecimal(int precision, int scale, byte[] value) {
//
final boolean positive = (value[0] & 0x80) == 0x80;
value[0] ^= 0x80;
if (!positive) {
for (int i = 0; i < value.length; i++) {
value[i] ^= 0xFF;
}
}
//
fi... | 7 |
protected String makeIndentStr(int indent) {
String tabSpaceString = /* (tab x 20) . (space x 20) */
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ";
if (indent < 0)
return "NEGATIVEINDENT" + indent;
int tabs = indent / tabWidth;
indent -= tabs * tabWidth;
if (tabs <= 20 && indent <= 20) ... | 5 |
static public ObjectFlag fromLetter(final char c) {
switch (c) {
case 'B': return BANK;
case 'D': return DARK;
case 'G': return GUEST;
case 'F': return FORGE;
case 'H': return HOUSE;
case 'M': return MERCHANT;
case 'S': return SILENT;
... | 9 |
public static String changeXY(String str) {
if(str.length()==0){
return str;
}
else if(str.length()==1 && str.equals("x")){
String s=str.replace(str.substring(str.length()-1),"y");
return s;
}
else if(str.length()==1 && ! str.equals("x")){
... | 6 |
public SystemUI()
{
_instance = this;
_timeSheetCtrl = new TimeSheetCtrl();
_clientCtrl = new ClientCtrl();
_searchCtrl = new SearchCtrl();
setIconImage(Toolkit.getDefaultToolkit().getImage(SystemUI.class.getResource("/icons/48x48/app.png")));
setTitle(SystemInformation.systemInformation(1) + ... | 6 |
public String numeroALetra(String numero, boolean mayusculas) {
String literal = "";
String parte_decimal;
//si el numero utiliza (.) en lugar de (,) -> se reemplaza
numero = numero.replace(".", ",");
//si el numero no tiene parte decimal, se le agrega ,00
if (numero.inde... | 9 |
public String getUpdate(String appKey, String userKey, String version) {
try {
appKey = URLEncoder.encode(appKey, "UTF-8");
userKey = URLEncoder.encode(userKey, "UTF-8");
version = URLEncoder.encode(version, "UTF-8");
} catch (UnsupportedEncodingException e) {
... | 1 |
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof User)) {
return false;
}
final User user = (User) o;
return !(username != null ? !username.equals(user.getUsername()) : user.getUsername() != null);
} | 3 |
public MapleCustomQuest(int id) {
try {
this.id = id;
startActs = new LinkedList<MapleQuestAction>();
completeActs = new LinkedList<MapleQuestAction>();
startReqs = new LinkedList<MapleQuestRequirement>();
completeReqs = new LinkedList<MapleQuestRequirement>();
PreparedStatement ps = Dat... | 7 |
public int FantasmaX(int n){
Query q2;
Variable a = new Variable("X");
Variable b = new Variable("Y");
switch(n){
case 0:
q2 = new Query("blinky", new Term[]{a,b});
return java.lang.Integer.parseInt(q2.oneSolution().get("X").toString());
... | 4 |
public static Term fromString(String str){
String temp = new String(str);
TermImp result = null;
if (temp.contains("x^")){
// handle term with the form ax^n
StringTokenizer strTok = new StringTokenizer(temp, "x^");
List<String> list = new ArrayList<String>(2);
while(strTok.hasMoreElements()){
list... | 7 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
txt2 = new javax.swing.JTextField();
txt3 = new javax.swing.JTextField();
txt4 = new javax.swing.JTextField();
txt5 = new java... | 0 |
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.