text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void printReaction(){
System.out.printf(""+molReactants.get(0).toStringf()+" + "+molReactants.get(1).toStringf()+" --> ");
System.out.printf(""+molProducts.get(0).toStringf());
for(int i=1; i< molProducts.size(); i++){
System.out.printf(" + "+molProducts.get(i).toStringf());
}
... | 1 |
public void setArea(BackgroundColor c, int start, int end) {
int color = c.ordinal();
if (start < 0 || start >= 60 || end < 0 || end >= 60)
return;
for (int i = start; i < end; i++)
m_hasColor[color][i] = true;
repaint();
} | 5 |
public boolean compare(Predicate.Op op, Field val) {
IntField iVal = (IntField) val;
switch (op) {
case EQUALS:
return value == iVal.value;
case NOT_EQUALS:
return value != iVal.value;
case GREATER_THAN:
return value > iVal.value;
c... | 7 |
private void setAction()
{
loginButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
String username = inputUser.getText();
String password = inputPass.getText();
User user = null;
if(username.length()!=0 && password.length()!=0)
{
... | 4 |
@Override
public int multiply(int a, int b) {
return a * b;
} | 0 |
public ListNode reverseBetween(ListNode head, int m, int n) {
if (head == null || head.next == null || m >= n) {
return head;
}
ListNode dummy = new ListNode(0);
dummy.next = head;
int curPos = 0;
ListNode pre = dummy;
while (curPos < m - 1 && pre != null) { // find m-1
pre = pre.next;
curPos++;
... | 7 |
@Override
public void onEnable() {
getConfig().options().copyDefaults(true);
saveConfig();
allDeaths = getConfig().getDouble("dropSkulls.allDeaths", 0);
killedByPlayer = getConfig().getDouble("dropSkulls.killedByPlayer", 1);
placeInKillerInv = getConfig().getBoolean("dropSku... | 8 |
public FileIO(String directory, String fi, boolean app){
log = new Logger();
s = System.getProperty("file.separator");
File dir = new File(directory);
if (!dir.exists()){
dir.mkdirs();
}
// get the path to the file
file = new File(dir... | 4 |
private String getToken(boolean quoted) {
// Trim leading white spaces
while ((i1 < i2) && (Character.isWhitespace(chars[i1]))) {
i1++;
}
// Trim trailing white spaces
while ((i2 > i1) && (Character.isWhitespace(chars[i2 - 1]))) {
i2--;
}
/... | 9 |
public void click(final MenuItem CLICKED_ITEM) {
List<Transition> transitions = new ArrayList<>(items.size() * 2);
for (Parent node : items.keySet()) {
if (items.get(node).equals(CLICKED_ITEM)) {
// Add enlarge transition to selected item
ScaleTransition enlar... | 3 |
@Override
public GameState doAction(GameState state, Card card, int time) {
if(time == Time.DAY)
{
//Do nothing
}
else if(time == Time.DUSK)
{
PickTreasure temp = new PickTreasure();
state = temp.doAction(state, card, time);
}
else if(time == Time.NIGHT)
{
state = freedSlaveNightAction(stat... | 3 |
protected void moveToNewLocation(int flag, double supp, double conf,
double dsupp, double dconf, double accuracy, int numCRs) {
switch (flag) {
case 0: // Increase support (north)
moveLocDataForIncSupp();
break;
case 1: // Increase support and confidence (north-east)
moveLocDataFo... | 9 |
public boolean stoppingStrategy(int[] bowl, int round) {
int choicesLeft, cutoff = 0;
boolean pickFlag = false;
choice++;
choicelist[choice] = bowl.clone();
if (round == 0) {
choicesLeft = nplayers - index - choice;
if((choice + 1) > Math.round((nplayers - index) / Math.E))
pickFlag = true;
} ... | 9 |
@Override
public void onReceiveStart(long totalBytes) {
System.out.print(totalBytes);
} | 0 |
private static int search1(Cards[] hands, Cards board, int numhands, int[] wins, int[] ties, Cards remaining) {
int total = 0;
for (Card card1 : remaining) {
board.add(card1);
total = rankHands(hands, board, numhands, wins, ties, total);
board.remove(card1);
}... | 1 |
private void btnExportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExportActionPerformed
String input = Utils.showFileChooser("Opslaan", "Tijdlijst");
if (!input.isEmpty()) {
boolean inverted = Utils.promptQuestion("Wilt u de tabel omgedraaid of precies zoals hierbov... | 2 |
@Override
public void onMeasure(int width, int height) {
super.onMeasure(width, height);
int totalWidth = 0;
int totalHeight = 0;
if (children.size() == 0) {
totalHeight = 10; // TODO This is so bad, but if onMeasure is called before children are added...what can we do?
... | 9 |
@Override
public void update() {
// If player wishes to skip screen
if(Keybind.CONFIRM.clicked()) {
// Remove current screen
splashImages.poll();
// Stop any sound effects playing
// Restart screen if a new one exists
if(!splashImages.isEmpty()) {
timer = 5f;
Camera.get().addScreenEffect... | 8 |
public void combine(String IP_PORT,String apiKey){
DBService dbService = new DBService();
HashMap data = null;
if(link.contains("dgtle")){
PageDgtle pageDgtle = new PageDgtle();
data = pageDgtle.getInfo(this.link);
}
if(link.contains("huxiu")){
... | 8 |
public boolean removeCompletely(String name) {
Connection conn = null;
PreparedStatement ps = null;
try
{
conn = iConomy.getiCoDatabase().getConnection();
ps = conn.prepareStatement("DELETE FROM " + Constants.SQLTable + " WHERE username = ? LIMIT 1");
ps.setString(1, name);
ps.ex... | 5 |
public static void main(String[] args)
{
String[][] cartoons =
{
{ "Flintstones", "Fred", "Wilma", "Pebbles", "Dino" },
{ "Rubbles", "Barney", "Betty", "Bam Bam" },
{ "Jetsons", "George", "Jane", "Elroy", "Judy",
"Rosie", "Astro" },
{ "Scooby Doo Gang", "Scooby Doo", "Shaggy", "Vel... | 2 |
@Override
public String getGoTo() {
return null;//goToList;
} | 0 |
public void createFSFolders(int currentLevel, String currentPath) {
if (currentLevel > this.levels) {
return;
}
for (int i = 0; i < this.foldersPerLevel; i++) {
try {
String folderName = "l" + currentLevel + "-c" + (i + 1);
FileUtils.forceMkdir(new File(currentPath + folderName));
String newP... | 3 |
private void fetchingEmails() {
/* Ab Java 7: try-with-resources mit automat. close benutzen! */
try {
/* Socket erzeugen --> Verbindungsaufbau mit dem Server */
clientSocket = new Socket(user.getServerAdress(), user.getPort());
/* Socket-Basisstreams durch spezielle Streams filtern */
outToServer = n... | 5 |
public String readString(int sz) throws IOException {
if (sz == 0) return null;
byte[] buf = new byte[sz];
int i = 0;
for (; i<sz; i++) {
int b = read();
if (b == 0) break;
buf[i] = (byte)b;
}
if (i == 0) return null;
return new String(buf, 0, i);
} | 4 |
public void setUserId(String userId) {
this.userId = userId;
} | 0 |
final public ASTN_Recipient N_Recipient() throws ParseException {
/*@bgen(jjtree) N_Recipient */
ASTN_Recipient jjtn000 = new ASTN_Recipient(JJTN_RECIPIENT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
N_PluginExp();
jjtree.closeNodeScope(jjtn000, true);
... | 9 |
@SuppressWarnings("unchecked")
public static void unzip(String zipFileName, String extPlace) throws Exception {
try {
(new File(extPlace)).mkdirs();
File f = new File(zipFileName);
ZipFile zipFile = new ZipFile(zipFileName);
if((!f.exists()) && (f.length() <= 0)) {
throw new Exception(... | 9 |
public Sprite(int[] pixels, int width, int height) {
this.pixels = pixels;
this.width = width;
this.height = height;
} | 0 |
public void addCSV(String absolutePath, int readMode) {
String s = "";
RosterDB newDB = readCSV (absolutePath);
for (Roster r: newDB.getRosters()) {
if (rosterExists (r) && (readMode == READ_MODE_ADD)) {
s += "Ignoriere doppelten Fahrtenleiter " + r.getGivenName() + " " + r.getFamilyName() + "\n";
... | 3 |
private void buildBoard() {
int rows = polymino.boardRows();
int cols = polymino.boardCols();
if (board == null) {
board = new int[rows][cols];
}
for (int row = 0; row < rows; ++row) {
for (int col = 0; col < cols; ++col) {
if (polymino.getBoard()[row][col]) {
// wall
board[row][col] = -2;... | 8 |
public void attachHost(GridSimCore entity, PacketScheduler sched)
{
String msg = super.get_name() + ".attachHost(): Error - ";
if (entity == null)
{
System.out.println(msg + "the entity is null.");
return;
}
if (sched == null)
{
Sy... | 4 |
public int largestRectangleArea(int[] height) {
int maxRect = 0;
int[] moreHeight = new int[height.length+1];
for(int i=0; i<height.length; i++)
moreHeight[i] = height[i];
Stack<Integer> stack = new Stack<Integer>();
for(int i=0; i<moreHeight.length; i++){
if(!stack.isEmpty() && moreHeight[i] < mo... | 7 |
private void resize() {
width = getWidth();
height = getHeight();
if (width > 0 && height > 0) {
background.setCache(false);
flap.setCache(false);
background.setFitWidth(width);
background.setFitHeight(height);
flap.setFitWidth(widt... | 3 |
public void actionPerformed(ActionEvent e)
{
if (e.getSource() == cancelButton)
closeWindow();
else if (e.getSource() == okButton)
{
String name = (String) comboBoxUnitName.getSelectedItem();
double azimuth = Utility.stringToDouble(textFieldAzimuth.getText());
double elevation = Utility.stringTo... | 9 |
@Override
public MapConnector<String, Double> forceSynchronization() throws Exception {
try (Connection con = getConnectorInfo().getConnection()) {
forceClear();
int n = 0;
StringBuilder values = new StringBuilder();
String stm;
for (String s : get... | 5 |
private List<Subset> generateNeighborhood(BitSet S, int numNeighborhood)
throws Exception{
int counter = 0;
List<Subset> neighborhood = new ArrayList<Subset>();
int numAttribs = (m_classIndex == -1) ? m_numAttribs : m_numAttribs - 1;
if(numNeighborhood >= numAttribs){
for (int i = 0; i < m_nu... | 9 |
public static String getHash(String text) {
try {
MessageDigest m = MessageDigest.getInstance("MD5");
m.reset();
m.update(text.getBytes());
byte[] digest = m.digest();
BigInteger bigInt = new BigInteger(1, digest);
String hashtext = bigInt.toString(16);
// If needed, insert zeros to get 32 chars
... | 2 |
public static final void compress(final File zippedFile,
final IOHandler ioHandler, final File... files) {
try {
if (!zippedFile.exists()) {
// create file write zip header
final OutputStream out = ioHandler.openOut(zippedFile);
final ZipOutputStream zipOut = new ZipOutputStream(out);
zipOut.clo... | 4 |
public static void main(String args[]) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAcce... | 8 |
public String getPrenom() {
return prenom;
} | 0 |
@Override
public void onDraw(Graphics G, int viewX, int viewY) {
if (X>viewX&&X<viewX+300&&Y>viewY&&Y<viewY+300)
{
G.setColor(Color.lightGray);
int deg = r.nextInt(360);
G.fillArc((int)(X-1)-viewX, (int)(Y-1)-viewY, 2, 2, deg, 15);
deg = r.nextInt(360)... | 4 |
public User verifyUser(User user){
try {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
String url = "jdbc:derby:" + DBName;
Connection connection = DriverManager.getConnection(url);
Statement statement = connection.createStatement();
String sqlStatement = "SELECT * FROM users WHERE juser='" + ... | 2 |
@Override
public void saveDefaultStudy(Study study) {
if(study == null) {
// If unsetting study, delete file
File f = new File("./studies/.defaultstudy");
f.delete();
return;
}
PrintWriter out = null;
try {
// Write... | 3 |
public List<Contact> getListOfTelephoneBookRecord() {
System.out.println("Telephone book: ");
List listOfContacts = new ArrayList();
try {
byte[] resp = getResponsesFromEFandSelectDF(DatabaseOfEF.EF_ADN);
for (int i = 1; i <= Converter.getSizes(resp)[2]; i++) {
... | 3 |
public Object createObjectInstance(String name) throws Exception {
if (!loaded_component_classes.containsKey(name)) {
Logger.getLogger(GameScriptManager.class.getName()).log(Level.SEVERE, "Class not loaded: {0}.", name);
throw new JMException("Class not loaded: " + name);
}
Object ret = null;
try {
... | 5 |
static final void method1418(int i, int j, int k, boolean flag) {
if (!flag) {
anInt4310 = -73;
}
if (i != 1002) {
if (i == 1001) {
Class142_Sub6.method1255(k, j, 0x7fffffff, 11);
return;
}
if (i != 1011) {
... | 6 |
private void manageClients() {
manage = new Thread("Manage") {
public void run() {
while (running) {
sendToAll("/i/server");
sendStatus();
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
for (int i = 0; i < clients.size(); i++) {
... | 5 |
@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 Site)) {
return false;
}
Site other = (Site) object;
if ((this.id == null && other.id != null) || (this.id != n... | 5 |
public static String max(String v1,String v2){
if(v1 != null && v2 == null){
return v1;
}
if(v2 != null && v1 == null){
return v2;
}
if(v1 == null && v2 == null){
return null;
}
ListItem v1c = parseVersion(v1);
ListItem ... | 7 |
public void addList(String... items) {
String collector = "(list ";
for (String item : items)
collector += item + " ";
collector += ")";
arguments.add(collector);
} | 1 |
@Test
public void validationIntegerWithIntegerPositiveTest() {
view.getNumberOfPointsTextField().setText("1");
view.getNumberOfPointsTextField().getFocusListeners()[0].focusLost(focusEvent);
assertTrue(view.getDrawButton().isEnabled());
} | 0 |
@Override
public void channelCommand(MessageEvent<PircBotX> event) throws IllegalAccessException, SQLException, InstantiationException {
super.channelCommand(event);
if(Permissions.isModerator(user,event, true)){
if(args[1].equalsIgnoreCase("add")){
try {
... | 9 |
@Override
public void setLogWriter(PrintWriter arg0) throws SQLException {
} | 0 |
public void run(){
try{
File file = new File("Sound.wav");
AudioInputStream ais = AudioSystem.getAudioInputStream(file);
Clip soundClip = AudioSystem.getClip();
soundClip.open(ais);
soundClip.start();
long millisecs = soundClip.getMicrosecondLength()/1000;
Thread.sleep(millisecs);
}
c... | 1 |
public static DiagramComponent createOpenFromBoundaryCells(
final TextGrid grid,
final CellSet boundaryCells,
final int cellWidth,
final int cellHeight,
boolean allRound) {
if(boundaryCells.getType(grid) != CellSet.TYPE_OPEN) throw new IllegalArgumentException("This shape is closed and cannot be han... | 9 |
public String getCode() {
return code;
} | 0 |
private static double[] getResistPoints(int lineNumber, double[] highPrices) {
double[] rPoints = new double[lineNumber];
for(int i =0;i<lineNumber-1;i++){
double price = 0;
for(int j=-25;j<=0;j++){
if((i+j>=0) && (i+j<lineNumber-1) && highPrices[i+j]>price){
... | 5 |
public Element getElement(int key) {
return this.elements.get(key);
} | 0 |
private static char getNrMinesBBCase(char[][] m, int r, int c) {
int n = 0;
if (m[r - 1][c] == MINE) {
n++;
}
if (m[r - 1][c + 1] == MINE) {
n++;
}
if (m[r][c + 1] == MINE) {
n++;
}
if (m[r + 1][c + 1] == MINE) {
... | 8 |
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in,
"ISO-8859-1"));
String line = "";
StringBuilder out = new StringBuilder();
OutputStreamWriter cout = new OutputStreamWriter(System.out,
"ISO-8859-1");
d: do {
line = b... | 9 |
public CheckReport(File file) throws Exception {
this.file = file;
fileName = file.getName();
version = checkVersion(file);
} | 0 |
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 sort(SortData[] paramArrayOfSortData, boolean paramBoolean)
{
int i = 1;
while (i != 0)
{
i = 0;
for (int j = 0; j < paramArrayOfSortData.length - 1; j++)
{
SortData localSortData1;
SortData localSortData2;
if (paramBoolean)
{
localS... | 4 |
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
PrintWriter out = response.getWriter();
String action = request.getParameter("action");
String zone = request.getParameter("zone");
if(action==null){
out.... | 9 |
void scoreRandTestThreshold(int maxLen, int minLen, Random rand, int threshold, int overlapChanges) {
// First sequence
int len1 = rand.nextInt(maxLen) + minLen;
String seq1 = randSeq(len1, rand);
if( verbose ) System.out.println("\nseq1:\t" + seq1);
// Second sequence
int over = rand.nextInt(len1 - minLen... | 7 |
@Override
public void exec(CommandSender sender, String commandName, String[] args, Player player, boolean isPlayer) {
String broadcastMessage = "";
String broadcastStaffTag = "";
String broadcastRegularTag = "";
if (!isPlayer) {
sender.sendMessage(ChatColor.RED + "Run t... | 8 |
public static Vector localSearch(Vector v) {
int tests = 0;
// Incrementally optimize this vector
v = v.clone(); // don't modify the original
double bestLength = v.length();
Vector bestVector = v.clone();
int[] increments = new int[] { -1, 2, -1 };
boolean improved = true;
while (impr... | 7 |
private static void setNull(PreparedStatement ps, int paramIndex) throws SQLException {
boolean useSetObject = false;
int sqlType = Types.NULL;
try {
DatabaseMetaData metaData = ps.getConnection().getMetaData();
String databaseProductName = metaData.getDatabaseProductName();
String jdbcDriverName = metaD... | 8 |
public void setCenter(LatLng center) {
if (center == null)
throw new IllegalArgumentException("Window's center may not be null.");
this.center = center;
} | 1 |
private List<Player> getPlayersInChat(List<Player> list, String chat){
List<Player> newPlayerList = new ArrayList<Player>();
for (Player playeren : list){
if (plugin.playerChat.containsKey(playeren)){
if (plugin.playerChat.get(playeren).equals(chat)){
newPlayerList.add(playeren);
}
}else{
... | 7 |
public Integer[] getLineSurvivalMove(Integer[] move, String type, int i,
String line) {
int j;
if(checkLineNeedSurvival(line)) {
j = line.indexOf(" ");
} else {
return move;
}
if(type.equals("row")) {
... | 5 |
public void save() {
if (changed) {
/* Copy old File */
File source = new File(file.getPath());
String filePath = file.getPath();
File temp = new File(filePath.substring(0, filePath.length() - 4) + "_old.yml");
if (temp.exists())
temp.delete();
source.renameTo(temp);
/* Save */
FileConf... | 4 |
@Override
public void run() {
Graphics g = bstrategy.getDrawGraphics();
if(bstrategy.contentsLost() == false){
Insets insets = frame1.getInsets();
g.translate(insets.left, insets.top);
if(spkey == true){
speed = speed - 0.25;
}else{
speed = speed + 0.25;
}
if(speed < -6) speed... | 5 |
public void actualiza() {
//Determina el tiempo que ha transcurrido desde que el Applet inicio su ejecución
long tiempoTranscurrido = System.currentTimeMillis() - tiempoActual;
//Guarda el tiempo actual
tiempoActual += tiempoTranscurrido;
//Actualiza la a... | 7 |
@Override
public Label predict(Instance instance) {
// TODO Auto-generated method stub
double sumOdd = 0;
double sumEven = 0;
for (Integer index: instance.getFeatureVector().getVector().keySet()) {
if (index % 2 == 0) {
sumOdd += instance.getFeatureVector().get(index);
}
else if (index % 2 == 1) {... | 4 |
private void setUp() {
File tmpUser = null;
File tmpMusic = null;
try{
tmpUser = new File("res/users.data");
tmpMusic = new File("res/musics.data");
this.setuserFileOut(new FileOutputStream(tmpUser));
this.setUserFileIn(new FileInputStream(tmpUser));
this.setMusicFileOut(new FileOutputStream(tmpMus... | 7 |
public int getAno() {
return ano;
} | 0 |
@SuppressWarnings("static-access")
private void ROUND10() {
enemises.clear();
System.out.println("Round10!!!!!!");
for (int i = 0; i < level.getWidth(); i++) {
for (int j = 0; j < level.getHeight(); j++) {
if ((level.getPixel(i, j) & 0x0000FF) == 2) {
... | 3 |
public void render() {
// Get the loaded materials and initialise necessary variables
Material[] materials = coinMesh.materials;
Material material;
Triangle drawTriangle;
int currentMaterial = -1;
int triangle = 0;
// For each triangle in the object
for (triangle = 0; triangle < coinMesh.triangles.len... | 8 |
private void sendData(APDU apdu, byte[] buffer, short len) {
apdu.setOutgoing();
if (len > (short)254) {
apdu.setOutgoingLength((short)254);
apdu.sendBytesLong(buffer, remainingDataOffset, (short)254);
remainingDataOffset += 254;
remainingDataLength = (shor... | 2 |
public <V> Adapter.Setter<V> makeSetter(String methodName, Class<V> _class) {
try {
T version = (T) start.get().newVersion;
final Method method = version.getClass().getMethod(methodName, _class);
return new Adapter.Setter<V>() {
public void call(V value) {
try {
Trans... | 7 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
WithListAnnotated withList = (WithListAnnotated) o;
if (list != null ? !list.equals(withList.list) : withList.list != null) return false;
retu... | 5 |
public void update(){
if (remainingTime == 0) {
this.frame.getPanPara().getButPause().setVisible(false);
this.frame.getPanPara().getButGeneration().setVisible(true);
this.frame.getPanPara().getTfStep().setEnabled(true);
this.frame.getPanPara().getTfStepNumber().se... | 7 |
@Override
public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
try {
String data = "{\"data\": [\"id\", \"nombre\", \"primer apellido\", \"segundo apellido\", \"email\"]}";
return data;
} catch (Exception e) {
throw ne... | 1 |
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
logger.info("detail servlet doGet:" + request.getRemoteAddr());
userLogInTest(request, response);
String option = "bogus";
String key = "0";
Enumeration<String> paramz = req... | 8 |
public Object nextValue() throws JSONException {
char c = this.nextClean();
String string;
switch (c) {
case '"':
case '\'':
return this.nextString(c);
case '{':
this.back();
return new JSONObject(this);
... | 7 |
public void addItemsToOrderCombobox() {
orderComboboxItems.clear();
String item = "";
if (driver.getPersonDB().getCustomerList().size() > 0) {
for (Order order : driver.getOrderDB().getCustomerOrderList()) {
if (order.getPerson() == person) {
item = "ID:\t" + order.getId() + " \t " + "Date: " + order.... | 3 |
public boolean isBoxInFrustum(float F0, float F1, float F2, float F3, float F4, float F5) {
final float frustum00F0 = frustum[0][0] * F0;
final float frustum01F1 = frustum[0][1] * F1;
final float frustum02F2 = frustum[0][2] * F2;
return !(frustum00F0 + frustum01F1 + frustum02F2 + frustum... | 7 |
public void paint(java.awt.Graphics g) {
super.paint(g);
int fillX = 0;
int fillY = 0;
int w = getWidth();
int h = getHeight();
FontInfo fi = getFontInfo();
int round = ((fi.decoration & FontInfo.ROUND) != 0) ? 1 : 0;
if((fi.decoration & FontInfo.SHADOW) != 0){
g.setColor(fi.... | 9 |
public static boolean binarySearch(ArrayList<Integer> s, int x)
{
//For later
ArrayList<Integer> sub = new ArrayList<Integer>();
//corner cases
if (s.size() == 0)
{
return false;
}
else
{
//If its equal to the middle then return true
int middle = s.size()/2;
if(s.get(middle) == x)
{
... | 5 |
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int testCases = in.nextInt();
while (testCases > 0) {
System.out.println(totalChoc(in.nextInt(), in.nextInt(), in.nextInt()));
testCases--;
}
} | 1 |
private String stringHashMap()
{
String str = "";
for(Equivalence equ : equivs.values())
{
str = str + equ + ln;
}
return str.trim();
} | 1 |
@Override
public void putAll(Map<? extends String, ? extends String> m)
{
Set<? extends String> nuKeys = m.keySet();
for (String s : nuKeys)
{
String value = m.get(s);
put(s, value);
}
} | 4 |
String value(ResourceBundle bundle, K key) {
// Build name
String name = key.name();
String fallback = name;
if (key instanceof Message) {
String[] args = ((Message) key).args();
if ((args != null) && (args.length > 0)) { // anonym index
... | 9 |
public ClassNode[] getInheritors(MethodID id) {
ClassNode c = getClass(id.owner);
List<ClassNode> inheritors = new LinkedList<ClassNode>();
classLoop: for (ClassNode c2 : getClasses().values()) {
ClassNode[] inherited = (c.access & ACC_INTERFACE) == 0 ? getHierarchy(c2)
: getInterfaces(c2);
int index ... | 7 |
public void setPassword(String password) {
this.password = password;
} | 0 |
@Override
public Boolean existsOne(String strTabla, int id) throws Exception {
int result = 0;
Statement oStatement;
try {
oStatement = (Statement) oConexionMySQL.createStatement();
String strSQL = "SELECT count(*) FROM " + strTabla + " WHERE 1=1";
ResultS... | 2 |
public void stopListeningForCheaters() {
try {
cheaterSub.remove();
} catch (Exception e) {
// do nothing
}
cheaterSub = null;
} | 1 |
public static void main(String[] args) throws Exception {
DatabaseManager.getSingleton().addDatabase(DatabaseConnection.create("127.0.0.1", "lolserver", "lollol", "server"), "info");
DatabaseConnection c = DatabaseManager.getSingleton().getConnection("info");
BufferedReader br = new BufferedReader(new FileReader(... | 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.