text stringlengths 14 410k | label int32 0 9 |
|---|---|
public Vector<Shift> getShiftsBetween(Calendar start, Calendar end)
{
if(shifts.size() > 0)
{
Vector<Shift> result = new Vector<Shift>();
int x = 0;
//Get to the first date within the specified date
while(x < shifts.size() && shifts.get(x).getStartTime().before(start)) x++;
//Start adding dates ... | 5 |
public static int findMaxSum(int matrix[][]) {
int rows = matrix.length;
int max = 0;
if (rows > 0) {
int cols = matrix[0].length;
if (cols > 0) {
// i, j will determine the size of the submatrix
for (int i = rows; i > 0; i--) {
for (int j = cols; j > 0; j--) {
// x, y will determine ... | 9 |
@Override
public void handleResult() throws InvalidRpcDataException {
String result = getStringResult();
if (result.equalsIgnoreCase(STATUS_STRING_OK)) {
EventBusFactory.getDefault().fire(new RemoteDownloadsChangedEvent());
} else {
// TODO: handle
... | 1 |
private void cancelCheckTask() {
if (checkTask != null)
checkTask.cancel();
} | 1 |
public void readSource(String input)
{
StringBuilder sb = new StringBuilder();
try
{
FileInputStream fis = new FileInputStream(input);
DataInputStream dis = new DataInputStream(fis);
BufferedReader br = new BufferedReader(new InputStreamReader(dis));
String line;
while ((lin... | 2 |
public void setPotionEffects(ArrayList<PotionEffect> effects) {
if(effects.isEmpty()) {
this.compound.remove("ActiveEffects");
if(this.autosave) savePlayerData();
return;
}
NBTTagList activeEffects = new NBTTagList();
for(PotionEffect pe : effects) {
NBTTagCompound eCompound = ne... | 4 |
public static void main(String[] args) {
try {
BufferedReader in = null;
if (args.length > 0) {
in = new BufferedReader(new FileReader(args[0]));
} else {
in = new BufferedReader(new InputStreamReader(System.in));
}
// BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
... | 5 |
public void testInternal(int effort) throws IOException, InterruptedException {
File tmpDirectory = TestUtil.directoriesToFile("tmp", "SnzOutputStreamTest");
tmpDirectory.mkdirs();
for(File org : testdataDirectory.listFiles()) {
if(org.isFile()) {
System.out.println("compressing " + org.getName()); ... | 5 |
protected void showSelectedCountry(SessionRequestContent request) {
String selected = request.getParameter(JSP_SELECT_ID);
Country currCountry = null;
if (selected != null) {
Integer idCountry = Integer.decode(selected);
if (idCountry != null) {
List<Count... | 5 |
public boolean isBranch() {
switch (this) {
case BEQ:
case BGE:
case BGT:
case BLE:
case BLT:
case BNE:
case BSR:
return true;
}
return false;
} | 7 |
public void actionPerformed(ActionEvent e)
{
String actioncommand = e.getActionCommand();
if (actioncommand.equals("New Class")) {
ClassRoom newclassroom = new ClassRoom();
String name = (String) JOptionPane.showInputDialog(main, "Enter the new Classroom's name");
if (name != null) {
File file = n... | 7 |
public int getMinRange(String minMatch, String maxMatch, int dataContentLength) {
if (minMatch != null) {
return Integer.parseInt(minMatch);
} else {
return dataContentLength - (Integer.parseInt(maxMatch));
}
} | 1 |
@Override
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
return Movie.class.isAssignableFrom(type);
} | 1 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ChannelTeds that = (ChannelTeds) o;
if (!dataConverter.equals(that.dataConverter)) return false;
if (!dataStructure.equals(that.dataStructure))... | 7 |
private RebalanceIndex getRebalanceIndex(Node n) {
//Index der angibt wie die Rebalancierung durchzuführen ist
RebalanceIndex rebalanceIndex = null;
//Balancierungsindex des Root Knotens berechnen
int balanceIndex = getBalanceIndex(n);
if (balanceIndex >= -1 && balanceIndex <= ... | 7 |
public static String buildParameterStr(Collection<Parameter> parameters) {
StringBuilder sb = new StringBuilder("");
if (parameters != null && parameters.size() > 0) {
for (Parameter param : parameters) {
sb.append(param.getKey());
sb.append("=");
try {
sb.append(param.getValue() != null
... | 6 |
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null)
return false;
if (o instanceof UserDTO) {
final UserDTO other = (UserDTO) o;
return Objects.equal(getId(), other.getId())
&& Objects.equ... | 7 |
public StreamedContent downloadArquivo() {
try {
logger.info(pasta+" Inciando o download......");
FacesContext context = FacesContext.getCurrentInstance();
InputStream stream;
if (verificaTamanho(arquivo.getTmDownload()) == true) {
... | 5 |
@EventHandler
public void scaleHunger(FoodLevelChangeEvent e) {
ScaleHungerEvent event = new ScaleHungerEvent(plugin, (Player) e.getEntity());
plugin.getServer().getPluginManager().callEvent(event);
// Cancel hunger if the custom event is cancelled.
if (event.isCancelled()) {
e.setCancelled(true);
... | 1 |
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPlayerCommand(PlayerCommandPreprocessEvent event) {
Player player = event.getPlayer();
if (player.hasPermission("GameAPI.join")) {
if (okayNoArgCommands.contains(event.getMessage().toLowerCase()))
... | 7 |
@Override
public String expectedDelivery(String item, String client, String market) {
logger.info("Calculating expected time to delivery. " +
"item " + item + ", client " + client + ", market " + market);
// business rule: delivery date depends of the client first letter
char key = client.toUpperCase()... | 8 |
private LinkMatrix getLinkMatrix() {
// erzeuge Matrix
int L[][] = new int[pageCount][pageCount];
for (Page j : pages.values()) {
L[j.nbr][j.nbr] = 1;
for (Page i : j.links)
L[i.nbr][j.nbr] = 1;
}
// stelle Output zusammen
LinkMatrix lm = new LinkMatrix();
lm.L = L;
lm.urls = new String[pageC... | 3 |
@Test
public void testGetPublisher() throws Exception {
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/librarysystem?user=admin&password=123456");
Statement st = conn.createStatement();
ResultSet rs = null;
try {
//Unmatched isbn
ArrayList<Publisher> pubs = bh.getPublishers(0L, st... | 5 |
public boolean equals(Object otherObject)
{
if (this == otherObject) return true;
if (otherObject == null) return false;
if (getClass() != otherObject.getClass()) return false;
Item other = (Item) otherObject;
return description.equals(other.description)
&& partNumber == othe... | 4 |
@SuppressWarnings("unchecked")
public final JSONArray names() {
JSONArray ja = new JSONArray();
Iterator keys = keys();
while (keys.hasNext()) {
ja.put(keys.next());
}
return ja.length() == 0 ? null : ja;
} | 2 |
public String getString() {
if (data_ == null)
return "void";
else if (data_ instanceof Void)
return "void";
else if (getType() == ValueType.COLOR)
return Utils.codeColor((Color) data_);
else if (getType() == ValueType.ARRAY) {
@SuppressWarnings("unchecked")
ArrayList<Value> vals = (ArrayList<Val... | 7 |
public MuteableURL(String spec) {
String[] parsed_url = parseURL(spec);
// Then store the parts
if (parsed_url != null) {
setProtocol(parsed_url[0]);
setAuthority(parsed_url[1]);
setUserInfo(parsed_url[2]);
setHost(parsed_url[3]);
try {
String port_string = parsed_url[4];
if (port_string... | 4 |
public MenuSaisie() {
initComponents();
for (Entreprise entr : MainProjet.lesEntreprises) {
jComboNomE.addItem(entr.getNom());
}
} | 1 |
@Override
public boolean isMovingEnabledAt( int x, int y ) {
if( moveableIfSelected ){
SelectableCapability selectable = getCapability( CapabilityName.SELECTABLE );
if( selectable != null ){
return selectable.getSelected().isSelected();
} else {
return false;
}
} else {
return getBoundaries(... | 2 |
public static Boolean UpdateQuestion(Question QuestionToUpdate)
{
List<String> statements = new ArrayList<String>();
statements.add(String.format("Update Question Set QuestionText = '%s', isValidated = %s, isRejected = %s where QuestionId = %d", QuestionToUpdate.questionText, QuestionToUpdate.isVali... | 6 |
public synchronized void drawImage(AbstractAlgorithm imgGen, double scale) {
BufferedImage toDraw = imgGen.generate();
int scaledWidth = (int) (toDraw.getWidth() * scale);
int scaledHeight = (int) (toDraw.getHeight() * scale);
BufferedImage scaled = new BufferedImage(scaledWidth, scaledHeight,
BufferedImage... | 2 |
public void dumpInstruction(TabbedPrintWriter writer)
throws java.io.IOException {
writer.println("continue"
+ (continueLabel == null ? "" : " " + continueLabel) + ";");
} | 1 |
public void close() {
closed = true;
try {
if (inputStream != null) {
inputStream.close();
}
if (outputStream != null) {
outputStream.close();
}
if (socket != null) {
socket.close();
}
} catch (IOException exception) {
System.out.println("Error closing stream");
}
isWriter = f... | 4 |
public int experienceLevels(MOB caster, int asLevel)
{
if(caster==null)
return 1;
int adjLevel=1;
final int qualifyingLevel=CMLib.ableMapper().qualifyingLevel(caster,this);
final int lowestQualifyingLevel=CMLib.ableMapper().lowestQualifyingLevel(this.ID());
if(qualifyingLevel>=0)
{
final int qualClas... | 8 |
private void labelWebsiteUriMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_labelWebsiteUriMouseClicked
try {
URI website = new URI(this.websiteUri);
openUriInBrowser(website);
} catch (URISyntaxException ex) {
ex.printStackTrace();
}
}//GEN... | 1 |
protected final void resetCurrentFailure() {
this.currentFailure.set(NO_FAILURE);
} | 0 |
public char nextClean() throws JSONException {
for (;;) {
char c = next();
if (c == 0 || c > ' ') {
return c;
}
}
} | 3 |
public static void main(String[] argsv) {
// Setting op a bank.
Bank christmasBank = new Bank();
christmasBank.addAccount(new BankAccount(BigInteger.valueOf(100)));
christmasBank.addAccount(new BankAccount(BigInteger.valueOf(50), BigInteger.valueOf(-1000)));
// Print the balanc... | 1 |
private static Member memberForSignature2(String s, boolean isCtor) {
int openPar = s.indexOf('(');
int closePar = s.indexOf(')');
// Verify only one open/close paren, and close paren is last char.
assert openPar == s.lastIndexOf('(') : s;
assert closePar == s.lastIndexOf(')') : ... | 9 |
private String[] ubahStringKeArray(int batas, int maxBagian, String kata){
String[] temp= new String[maxBagian];
int j = kata.length();
int k;
int banyakBagian = ((j % batas) == 0 ? (j / batas) :Math.round((j / batas) + 0.5f));
for(int i = banyakBagian - 1; i >=0 ; i--){
... | 4 |
public boolean replace(int index, T newV) {
if (index < 0 || index >= size)
return false;
T oldV = heap.get(index).element();
heap.get(index).setElement(newV);
if (comp.compare(oldV, newV) < 0)
trickleUp(index);
else
trickleDown(index);
return true;
} | 3 |
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(System.in);
StringBuilder out = new StringBuilder();
while (in.hasNext()) {
int size = in.nextInt();
if (size == 0)
break;
blocks = new Point[size];
for (int i = 0; i < size; i++)
blocks[i] = new Point(in.next... | 3 |
private int subscribeRdfFiles(final File folder) {
int count = 0;
for (final File fileEntry : folder.listFiles()) {
if (fileEntry.isDirectory()) {
subscribeRdfFiles(fileEntry);
} else {
String regex = "([^\\s]+(\\.(?i)(ttl|rdf|n3))$)";
if (fileEntry.getName().matches(regex)) {
System.out.println... | 5 |
public void setA(int a){
acceleration = a;
} | 0 |
public boolean isAccessible(Site other) {
//everything that is accessible, is adjacent
if (!isAdjacent(other)){
//log.info("Is not adacent");
return false;
//check it is standable at the start
} else if (!isWalkable()){
//log.info("Is not walkable")... | 6 |
protected void placeC4()
{
if(C4Placed)
{
int n = listElements.size();
Element e;
for(int i = 0; i < n; i++)
{
e = listElements.get(i);
if(e.type == Type.WEAPONS)
pushEvent(e, "C4");
}
}
else if(nbC4 > 0)
{
if(collisionElementList(((int)(x/32.0))*32+16, ((int)(y/32.0))*32+16, T... | 6 |
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page ... | 5 |
public static StringBuilder Htmlfullticket (Integer integer) {
// Display the selected item
String [] Array = FullTicket.searchFullTicket(integer);
Object [] product = Comp.searchTicketProduct(integer).toArray();
//Set color for ticket status
... | 5 |
public int parse(CharsetDetector det)
{
int b;
boolean ignoreSpace = false;
while ((b = nextByte(det)) >= 0) {
byte mb = byteMap[b];
// TODO: 0x20 might not be a space in all character sets...
if (m... | 5 |
public String getDesc() {
return desc;
} | 0 |
public boolean isUserAlreadyExists(String userId) {
Connection connection = new DbConnection().getConnection();
ResultSet resultSet = null;
boolean flag = false;
Statement statement = null;
try {
statement = connection.createStatement();
resultSet = statement.executeQuery(IS_USER_ALREADY_EXISTS + userId... | 6 |
@Override
public void run() {
int run = 1;
while (run == 1) {
String message = "";
// Block and wait for input from the socket
try {
message = socket.readMessage();
if (message==null) {
try {
... | 4 |
public static String deleteAny(String inString, String charsToDelete) {
if (!hasLength(inString) || !hasLength(charsToDelete)) {
return inString;
}
StringBuilder builder = new StringBuilder();
for (int i = 0; i < inString.length(); i++) {
char c = inString.charAt(i);
if (charsToDelete.indexOf(c) == -1)... | 4 |
public void shutdown() {
log.log(Level.INFO,"Starting Shutdown");
if(conLis != null) {
conLis.end();
}
disconnect(ALL());
serverStatus = ServerStatus.SHUTDOWN;
log.log(Level.INFO, "Finished Shutdown");
} | 1 |
@SuppressWarnings("unchecked")
@Override
public Object run() {
List<Map<String, Object>> filtered = new ArrayList<Map<String, Object>>();
if(source().containsKey(occurrenceField)) {
List<Map<String, Object>> occurrences = (List<Map<String, Object>>)source().get(occurrenceField);
addParsedOccurrenceFields(o... | 8 |
void setBytes( String ur, String desc, String tm )
{
try
{
setGrbit();
int pos = 32; // start of description/text input
byte[] blankbytes = new byte[2]; // trailing zero word
byte[] newbytes = new byte[pos];
System.arraycopy( mybytes, 0, newbytes, 0, pos ); // copy old pre-string data into ne... | 4 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
long temp;
temp = Double.doubleToLongBits(apertureValue);
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + ((autoFocus == null) ? 0 : autoFocus.hashCode());
... | 9 |
public static void main(String arg[]) {
// int[] sizes = {4};
// int index = 4;
// int[] indexes = new int[1];
//
//
// for (int foo = 0; foo < 4; foo++) {
// System.out.print(foo);
// MmsParameter.figureOutIndexes(foo, sizes, indexes);
//
// for (int i = 0... | 3 |
public static void main(String[] args) {
final CircularBuffer<Integer> cb = new CircularBuffer<>(23);
final Random randomizer = new Random();
final int MAX_MARGIN = 120_000;
final CountDownLatch latch = new CountDownLatch(1);
class Producer extends Thread {
private ... | 9 |
private List<Network> getNetworkDevices(Component component, SoftwareSystem system) {
HardwareSet hardwareSet = null;
List<Network> networkDevices = new LinkedList<>();
for (DeployedComponent deployedComponent : system.getDeploymentAlternative().getDeployedComponents())
if (deployedComponent.getComponent().equ... | 6 |
public void paint(Graphics g) {
//the objects created above are made clickable with the mouseClicked method
super.paint(g);
final Graphics2D g2d = (Graphics2D) g;
g2d.setColor(Color.white);
g2d.setFont(new Font("Courier", Font.BOLD, 60));
g2d.drawImage(MenuBG, 0, 0, this... | 9 |
public void InitGUI() {
cmActionListener listener = new cmActionListener();
Container m_container = getContentPane();
m_container.setLayout(new FlowLayout());
JPanel optionsPanel = new JPanel(new GridLayout(UI_ROW,UI_COL));
m_container.add(optionsPanel);
... | 2 |
public void createResources() throws GridSimRunTimeException {
printRuntimeMessage("Creating resouces");
int currentResourceID = 0;
for (GridSimResourceConfig resConfig: _config.getResources()) {
MachineList machines = new MachineList();
int currentMachineID = 0;... | 4 |
public Object[] GetColumnData(int columnNo){
if(!(columnNo<m_attributeCount)){
JPanel frame = new JPanel();
JOptionPane.showMessageDialog(frame,
"Column Index out of bounds",
"File error",
JOptionPane.ERROR_MESSAGE);
} else {
m_c... | 2 |
private synchronized void insert(Packet np, double time)
{
if ( timeList.isEmpty() )
{
timeList.add( new Double(time) );
pktList.add(np);
return;
}
for (int i = 0; i < timeList.size(); i++)
{
double next = ( (Double) timeList.g... | 3 |
public void receive(Object obj) {
// TODO Parse all possible messages
Event event = (Event)obj;
int port;
switch(event.type) {
case "new game":
port = (int)event.data;
if (port==-1) throw new RuntimeException("could not create game, go back to main menu");
else {
gui.joinGame(port);
}
... | 7 |
public static void sendMe(MapleCharacter player, String msg) {
MaplePacket packet;
switch (player.getGMLevel()) {
case 0:
packet = MaplePacketCreator.serverNotice(6, "[Rookie ~ " + player.getName() + "] " + msg);
break;
case 1:
pack... | 5 |
private int getDimenMasLargo(){
int dim=0;
LinkedList<Atributo> la=clase.getListaAtributos();
if ( la!=null ){
for ( int i=0 ; i<la.size() ; i++ ) {
Atributo a = la.get(i);
if ( a.toStringGrafico().length()>dim )
dim = a.toStringG... | 7 |
public static <T extends RestObject> T getRestObject(Class<T> restObject, String url) throws RestfulAPIException {
InputStream stream = null;
try {
URLConnection conn = new URL(url).openConnection();
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X... | 6 |
final void method346() {
if (anInt584 == -1) {
anInt584 = 0;
if (anIntArray558 != null && (anIntArray574 == null || anIntArray574[0] == 10)) {
anInt584 = 1;
}
for (int i = 0; i < 5; i++) {
if (actions[i] == null) {
... | 8 |
public Object open(final int coordX, final int coordY) {
try {
fr = new BufferedReader(new FileReader(new File(pathToDiagramsLogFile)));
lines = new ArrayList<String>();
String line;
while ((line = fr.readLine()) != null) {
lines.add(line.re... | 5 |
public void setTarget( ItemKey<? extends Box> target ) {
this.target = target;
} | 1 |
private JPanel createProcessorSettingsPanel()
{
final JPanel jp = new JPanel();
jp.setBorder(default_border);
BoxLayout bl = new BoxLayout(jp, BoxLayout.PAGE_AXIS);
jp.setLayout(bl);
JComponent cp = new JLabel(UIStrings.UI_PROC_NAME_LABEL);
setItemAlignment(cp);
jp.add(cp);... | 8 |
private boolean fskFreqHalf (CircularDataBuffer circBuf,WaveData waveData,int pos) {
boolean out;
int sp=(int)samplesPerSymbol/2;
// First half
double early[]=doRTTYHalfSymbolBinRequest(baudRate,circBuf,pos,lowBin,highBin);
// Last half
double late[]=doRTTYHalfSymbolBinRequest(baudRate,circBuf,(pos+sp),lowB... | 6 |
public int getPieceCount() {
if (this.pieces == null) {
throw new IllegalStateException("Torrent not initialized yet.");
}
return this.pieces.length;
} | 1 |
public void keyPressed(KeyEvent ke) {
char keyPressed = ke.getKeyChar();
if(!world.inBattle())
{
world.movePlayer(keyPressed);
world.blockAppear();
if(!world.inBattle())
{
if(world.isInStore()) {
_controlPanel.switchToMenu(ControlPanel.MenuType.ItemShop);
... | 4 |
private void RdesremActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RdesremActionPerformed
vtexto = Ctexto.getText();
DefaultTableModel tr = (DefaultTableModel)tabla.getModel();
try
{
Statement s = cone.getMiConexion().createStatement();
... | 8 |
public void onEnable()
{
if((citizensPlugin = (CitizensPlugin)Bukkit.getPluginManager().getPlugin("Citizens")) == null)
{
this.getLogger().log(Level.SEVERE, "Citizens not found. Disabling OWHQuests.");
Bukkit.getPluginManager().disablePlugin(this);
}
if((worldGuardPlugin = (WorldGuardPlugin)Bukkit.get... | 3 |
public void cleanNotDamaAvvicinando(){
//Se qualche dama si può avvicinare
//Elimino le mosse che spostano dame lontano da pedine o dame nemiche
if(haveSomeDamaAvvicinando()){
//Recupero il valore minimo di avvicinamento
int min = this.getMossaMinAvvicinando();
for(int i=0;i<desmosse.length;i++)
... | 5 |
public int numIslands(char[][] grid) {
if (grid == null || grid.length == 0)
return 0;
g=grid;
boolean[][] visited = new boolean[grid.length][grid[0].length];
for (int i=0; i<g.length; i++) {
for (int j=0; j<g[0].length; j++) {
visited[i][j] = fal... | 8 |
public int transform(CtClass clazz, int pos, CodeIterator iterator,
ConstPool cp) throws CannotCompileException
{
int index;
int c = iterator.byteAt(pos);
if (c == NEW) {
index = iterator.u16bitAt(pos + 1);
if (cp.getClassInfo(index).equals(cl... | 7 |
public void setPrezzo(Float prezzo) {
this.prezzo = prezzo;
} | 0 |
public void showNotificationsToFile(FileWriter f) throws IOException {
for (TimedPosts post : notifications) {
long elapsedTimeInSec = (endTime - post.getTime()) / 1000000000;
endTime += 1000000000;
if (elapsedTimeInSec < 60) {
int elapsedTime = (int) elapsed... | 2 |
public void setData(int row, int col, String data) {
if (row < 0
|| col < 0
|| row > (getRowsCount() - 1)
|| col > (getColsCount() - 1)) {
throw new IndexOutOfBoundsException();
}
Vector theRow = (Vector)m_fileContent.get(row);
theRow.setElementAt(data, col);
... | 4 |
static void mainToOutput(String[] args, PrintWriter output) throws Exception {
if (!parseArgs(args)) {
return;
}
AdaptiveLogisticModelParameters lmp = AdaptiveLogisticModelParameters
.loadFromFile(new File(modelFile));
CsvRecordFactory csv = lmp.getCsvRecordFactory();
csv.setIdName(id... | 7 |
public void addNum(int val) {
Node node = new Node(val);
if(!treeSet.add(node)) return;
Node prev = treeSet.lower(node);
Node next = treeSet.higher(node);
if (prev != null) {
node.prev = prev;
prev.next=node;
if ... | 9 |
public byte[] packData() throws IOException {
ExtendedByteArrayOutputStream out = new ExtendedByteArrayOutputStream();
out.putShort(this.indexOffset);
for (ImageBean i : this.imageBeans) {
int[] pixels = i.getPixels();
if (this.packType == 0) {
for (int x = 0; x < pixels.length; x++)
out.write(find... | 6 |
public void servere(String message) {
log(Level.SEVERE, message);
} | 0 |
public void paint(Graphics g) {
Graphics2D g2D = (Graphics2D) g;
boolean isPressed = getModel().isPressed();
boolean isRollover = getModel().isRollover();
int width = getWidth();
int height = getHeight();
Color[] tc = AbstractLookAndFeel.getThem... | 7 |
public static void handleEvent(int eventId)
{
// Changes focus to Main Ship Shop Menu
if(eventId == 1)
{
System.out.println("Exit Ship Shop Weapons menu to Main Ship Shop Menu selected");
Main.ShipShopWeaponsMenu.setVisible(false);
Main.ShipShopWeaponsMenu.setEnabled(false);
Main.ShipShopWeaponsMenu.... | 8 |
private boolean transaccionBancaria(int cc,double m,Transaccion tp) throws IOException{
if( buscar(cc) ){
rCuentas.readInt();
rCuentas.readUTF();
long pos = rCuentas.getFilePointer();
double s = rCuentas.readDouble();
rCuentas.readLong();
... | 5 |
private static boolean modifyEmployee(Employee bean, PreparedStatement stmt, String field) throws SQLException{
String sql = "UPDATE employees SET "+field+"= ? WHERE username = ?";
stmt = conn.prepareStatement(sql);
if(field.toLowerCase().equals("pass"))
stmt.setString(1, bean.getPass());
if(field.toLo... | 6 |
protected Element createStateElement(Document document, State state, Automaton container)
{
// System.out.println("moore create state element called");
Element se = super.createStateElement(document, state, state.getAutomaton());
se.appendChild(createElement(document, STATE_OUTPUT_NAME, null,... | 0 |
public ListNode reverseKGroup(ListNode head, int k) {
if (k <= 1 || head == null || head.getNext() == null) {
return head;
}
ListNode prev = new ListNode(0);
prev.setNext(head);
head = prev;
//find current position
ListNode cur = prev.getNext();
... | 8 |
public static int firstIndexOfSubstring(String s, String p) {
int firstIndex = 0;
int lastIndex = 0;
while(lastIndex < s.length()) {
// If there is an initial match, update firstIndex.
if(s.charAt(lastIndex) == p.charAt(0))
firstIndex = lastIndex;
// If we have searched beyond the length of the p... | 5 |
public void pushBack() {
if (ttype != TT_NOTHING) /* No-op if nextToken() not called */
pushedBack = true;
} | 1 |
public static FileConfiguration getChannels() {
if (Channels == null) {
reloadChannels();
}
return Channels;
} | 1 |
public ParseException generateParseException() {
jj_expentries.clear();
boolean[] la1tokens = new boolean[4];
if (jj_kind >= 0) {
la1tokens[jj_kind] = true;
jj_kind = -1;
}
for (int i = 0; i < 0; i++) {
if (jj_la1[i] == jj_gen) {
for (int j = 0; j < 32; j++) {
if ... | 8 |
@SuppressWarnings("unchecked")
static private void createNextLevel( final RowData rowData, final String path,
final Data data, final SelectionManager selectionManager) {
if(data.isPlain()) {
String value = data.valueToString();
rowData.setValue(value);
}
else {
if( data.isList()) { // kein Array
... | 7 |
public void run() {
byte[] buffer = new byte[5000];
DatagramPacket packet;
try {
//Create a socket
MulticastSocket socket = new MulticastSocket(port+1);
InetAddress address = InetAddress.getByName("224.0.0.31");
socket.joinGroup(address);
while (true) {
packet = new DatagramPacket(buffer, buffe... | 6 |
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.