text stringlengths 14 410k | label int32 0 9 |
|---|---|
public long getMaxClients() {
return maxClients;
} | 0 |
public static void insertInitInfectedContacts() {
int numInserts = 0;
double minContactDuration = 0.0;
try {
HashSet<Integer> sick = new HashSet<Integer>(565685);
Connection con = dbConnect();
ResultSet getSickQ = con.createStatement().executeQuery(
"SELECT victimID FROM "+dendroTbl);
while (getS... | 7 |
public static final Color checkColour(int red, int green, int blue)
{
if (red < 0)
red = 0;
else if (red > 255)
red = 255;
if (green < 0)
green = 0;
else if (green > 255)
green = 255;
if (blue < 0)
blue = 0;
else if (blue > 255)
blue = 255;
return new Colo... | 6 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
return false;
} | 1 |
private void draw() {
if (this.turnNumber > 1) {
this.activePlayer.draw(1);
}
} | 1 |
public static Map<String, Object> getHasOne(Object obj) throws Exception {
Map<String, Object> attrs = new HashMap<String, Object>();
for (Field field : obj.getClass().getDeclaredFields()) {
Class<?> fieldType = field.getType();
String fieldName = field.getName();
Annotation[] annotations = field.getDeclar... | 4 |
protected void rodaMidiaVirtual(){
/*
* verificacao de seguranca.
* se nao houver nenhuma midia na memoria secundaria.
*/
if(jogos.isEmpty())
if(JOptionPane.showConfirmDialog(null, "\nSem midias virtuais no disco local.\n\nAdicionar?","Midias Virtuais",JOp... | 6 |
public void updateState(int state) {
if( isValidStateToGo(state) ) {
setState(state);
switch (state) {
case CREATED:
setCreateTime(new Date());
case RUNNING:
setStartTime(new Date());
case ENDED:
case ENDED_CANCELLED:
case ENDED_TIMEOUT:
setEndTime(new Date());
default:
}
... | 6 |
public void sendGlobalMessage(ChatPlayer player, String message) {
String formattedMessage = formatMessage(player, message);
for (ChatPlayer data : plugin.onlinePlayers.values()) {
if (!data.ignoringPlayer(player.getName()) || data.isChatSpying()) {
data.sendMessage(formattedMessage);
}
}
if (plugin... | 4 |
public void render()
{
for(int i = 0; i < Sidebar.MAX_ELEMS; i ++)
{
if(elements[i] != null)
{
elements[i].render(Sidebar.xPos_ + Sidebar.HORIZONTAL_SPACING, elementPos[i]);
}
}
} | 2 |
public void run() {
try {
// this will handle our XML
voyageurhandler voyHandler = new voyageurhandler();
// get a parser object
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
// get an InputStream from somewhere (could be HttpConne... | 6 |
private SimpleNode findNodeABR(SimpleNode node, final int value) {
SimpleNode ret = null;
if (this.root == null) {
throw new RuntimeException("Le noeud [" + this.min + "; " + this.max + "] est vide et ne contient donc pas " + value + " !");
}
if (node == null) {
... | 7 |
protected void initializeCommandTypeInfo()
{
super.initializeCommandTypeInfo();
Map mm6ArgumentTypeArrayByCommandTypeMap = super.getArgumentTypeArrayByCommandTypeMap();
Map mm6ArgumentTypeDisplayInfoArrayByCommandTypeMap = super.getArgumentTypeDisplayInfoArrayByCommandTypeMap();
... | 7 |
public static int[][] place(State[][] map, int width, int height) {
int _i = width / 2;
int _j = height / 2;
int _1strandi;
int _1strandj;
int _2ndrandi;
int _2ndrandj;
int _3rdrandi;
int _3rdrandj;
int d12;
int d13;
int d23;
do {
Random rand = new Random();
do { ... | 6 |
public List<String> start(String nzbPath) {
List<String> out = new LinkedList<String>();
NZB nzb = getNzb(nzbPath);
List<File> files = nzb.getFiles();
int fileCount = 1;
for (Iterator<File> i = files.iterator(); i.hasNext();) {
File file = i.next();
... | 9 |
public <G, H> BinaryCompositeBinaryFunction(BinaryFunction<? super G, ? super H, ? extends T> f,
BinaryFunction<? super L, ? super R, ? extends G> g, BinaryFunction<? super L, ? super R, ? extends H> h) {
this.helper = new Helper<G, H, L, R, T>(
Validate.notNull(f, "final BinaryFunct... | 9 |
private void setFilterJob(String targetColumn, String... args) {
// Mapper Class
job.setMapperClass(FilterMapper.class);
// Output Key/Value
job.setMapOutputKeyClass(NullWritable.class);
job.setMapOutputValueClass(Text.class);
// Reducer Task
job.setNumReduceTasks(0);
//Set Parameters
//value : EMP... | 6 |
@Override
public void paint(Graphics g, RsTransform gt){
Color fc, lc;
fc = getFillColor();
lc = getLineColor();
if(fc==null && lc==null)
return;
if(refSegment==null){
// the shape is not depicted and not interactive because
// no polygon was ever supplied
... | 6 |
public void addSetMethod(Field field, Method method) {
if(field == null) {
throw new IllegalArgumentException("Field cannot be null");
}
FieldStoreItem item = store.get(FieldStoreItem.createKey(field));
if(item != null) {
item.setSetMethod(method);
} else ... | 2 |
public boolean readFile(String filename)
{
try
{
BufferedReader reader = new BufferedReader(new FileReader(filename));
String currentLine = reader.readLine();
while(currentLine!=null)
{
switch(currentLine.charAt(0))
{
... | 4 |
@Override
public boolean hasNext()
{
if (position >= addIngredientCommands.size() || addIngredientCommands == null) {
return false;
} else {
return true;
}
} | 2 |
public List<Integer> grayCode(int n) {
List<Integer> list = new ArrayList<Integer>();
list.add(0);
for(int i =0; i < n;i++){
int base = 1 << i;
for(int j = list.size()-1;j >=0;j--){
list.add(base + list.get(j));
}
}
return list;... | 2 |
private static void performWork(String dataStructure, int nrThreads,
int nrItems, int workTime, long seed)
throws InterruptedException {
Sorted<Integer> sorted = null;
if (dataStructure.equals(CGL)) {
sorted = new CoarseGrainedList<Integer>();
} else if (dataStructure.equals(CGT)) {
sorted = new Co... | 6 |
public void fall() {
for (Block b : currentTetromino.getBlocks()) {
if ((b.getMapIndexY() == boardSizeY)
|| (tetrisMap[b.getMapIndexX()][b.getMapIndexY() + 1] == 1)) {
currentTetromino.setActiveStatus(false);
for (Block blk : currentTetromino.getBlocks()) {
tetrisMap[blk.getMapIndexX()][blk.getMa... | 7 |
private static int getuid(String s) {
try {
File file = new File(s + "uid.dat");
if (!file.exists() || file.length() < 4L) {
DataOutputStream dataoutputstream = new DataOutputStream(
new FileOutputStream(s + "uid.dat"));
dataoutputstream.writeInt((int) (Math.random() * 99999999D));
dataoutputs... | 4 |
private void testHelper_method_nullAnchor_shouldFail(MethodToTest method)
{
final IMutableMolecule NULL_ANCHOR = null;
switch (method)
{
case changeMoleculeEnergyLevel:
moleculeMediator.changeMoleculeEnergyLevel(NULL_ANCHOR, VALID_POSITION, VALID_ENERGY_CHANGE_AMOUNT);
break;
case createMoleculeAtPosit... | 7 |
public static void main(String[] args) {
List<Integer> powInts = new ArrayList<>();
int limit = 10000000;
int pow = 5;
int start = 2; //ignore 1 for sum
for (Integer i = start; i < limit; i++) {
String s = String.valueOf(i);
char[] c = new char[s.length()];
c = s.toCharArray();
int sum = 0... | 4 |
protected float convert(char tipo, float grados){
float aux=0;
switch(tipo){
case 'c':
aux=(float)(this.gradosK-273.15);
break;
case 'k':
aux=(float)(this.gradosC+273.15);
break;
default:
System.out.println("Error el tipo es c o k");
break;
}
return aux;
} | 2 |
private String createImports() {
ImportGenerator imports = new ImportGenerator( filePath );
imports.addImport( "import static org.junit.Assert.*;" );
imports.addImport( "import org.junit.*;" );
if ( hasSearch ) {
imports.addImport( "import java.util.List;" );
}
... | 1 |
public void majResumePersos(Joueur j){
LinkedList<Personnage> persos = j.getPersonnages();
Iterator<Personnage> persosIt = persos.iterator();
Personnage p;
JPanel unPerso;
panelResumePerso.removeAll();
while(persosIt.hasNext()){
p = persosIt.next();
... | 5 |
public static void saveDimension(File file, PlaneDimension pd) {
Cell[][] dim = pd.getAllSeats();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < dim[0].length; i++) {
for (int j = 0; j < dim.length; j++) {
int outputVal = 0;
Cell.CellType ... | 6 |
public boolean replaceSubBlock(StructuredBlock oldBlock,
StructuredBlock newBlock) {
if (innerBlock == oldBlock)
innerBlock = newBlock;
else
return false;
return true;
} | 1 |
private void start (Player p) {
if ( p != white_player && p != black_player ) {
// runtime error!
return;
}
curPlayer = p;
} | 2 |
public void mouseDragged(MouseEvent e) {
if (documentViewModel.getViewToolMode() ==
DocumentViewModel.DISPLAY_TOOL_TEXT_SELECTION) {
textSelectionHandler.mouseDragged(e);
} else if (documentViewModel.getViewToolMode() ==
DocumentViewModel.DISPLAY_TOOL_SELECTIO... | 3 |
public void intersect( PhysicObject object1, PhysicObject object2 )
{
// TODO: do intersect with all colliders
IntersectData intersectData = Intersect.colliders( object1.getColliders().get( 0 ), object2.getColliders().get( 0 ) );
if ( intersectData != null && intersectData.isIntersect() )
{
Vector3f directi... | 2 |
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int k, m;
while ((k = sc.nextInt())!=0 && k!=0) {
m = sc.nextInt();
HashMap course = new HashMap();
boolean satisfied = true;
for (int i = 0; i < k; i++) {
... | 8 |
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof Pair<?, ?>) {
Pair<?, ?> other = (Pair<?, ?>) obj;
return ObjectUtils.equals(first, other.first)
&& ObjectUtils.equals(second, other.second);
}
return false;
} | 9 |
@Override
public void nativeKeyPressed(NativeKeyEvent ev) {
// Copy
if (ev.getKeyCode() == NativeKeyEvent.VK_C
&& NativeInputEvent.getModifiersText(ev.getModifiers()).equals(
"Ctrl")) {
System.out.println("Ctrl+C : call");
// Clip the pop
try {
Thread.sleep(100);
} catch (InterruptedExcep... | 9 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result
+ ((orderProductId == null) ? 0 : orderProductId.hashCode());
result = prime * result
+ ((productId == null) ? 0 : productId.hashCode());
res... | 8 |
public boolean hasError() {
return isErrorProteinLength() || isErrorStartCodon() || isErrorStopCodonsInCds();
} | 2 |
public final String relativize(final Path base) {
Path p = this;
synchronized (Path.relativizer) {
Path.relativizer.clear();
while (p.getNameCount() > base.getNameCount()) {
p = p.getParent();
}
int same = p.getNameCount();
if (p != base) {
Path q = base;
if (q.getNameCount() > p.getNameC... | 7 |
public void setEdge ( int edge ) {
if ( edge < 8 )
throw new IllegalArgumentException ( "Parameter edge must be not less than 8 it was set to " + edge );
if ( edge > MAX_EDGE )
throw new IllegalArgumentException ( "Parameter edge must be less than " + MAX_EDGE + " it was set to ... | 5 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
private void deactivate() {
if (!isActive())
throw new IllegalArgumentException("Forcefield was already deactivated, something went wrong");
this.active = false;
} | 1 |
@Override
public void actionPerformed(ActionEvent e) {
@SuppressWarnings("rawtypes")
JComboBox cb = (JComboBox) e.getSource();
String component = (String) cb.getSelectedItem();
// Afiseaza sau ascunde imaginea de background
if (component.compareTo(ElementsVisibility.S_IMAGE.toString()) == 0) {
gui.getDra... | 4 |
@Override
public boolean renomearArquivo(String caminhoOrigem, String novoNome, String nomeUsuario)
throws RemoteException, XPathExpressionException {
Document xml = pedirXML(nomeUsuario);
//Alterar XML
String expressao;
if (caminhoOrigem.endsWith(".txt")) {
... | 4 |
public void setListener(MqttListener listener) {
this.listener = listener;
if (handler != null) {
handler.setListener(listener);
}
} | 1 |
private void merge(int[] array, int start, int mid, int end){
int leftIndex = start;
int rightIndex = mid+1;
int helperIndex = start;
//Compare and add elements in sorted manner to helper array
while(leftIndex <= mid && rightIndex <= end){
if(array[leftIndex] < array[rightIndex]){
mHelperArray[helpe... | 8 |
public JPanel getOptionBarMenu() {
if (!isInitialized()) {
IllegalStateException e = new IllegalStateException("Call init first!");
throw e;
}
return this.optionsBarMenu;
} | 1 |
@Override
public void propertyChange(PropertyChangeEvent evt)
{
CompoundPainter<?> painter = ref.get();
if (painter == null)
{
AbstractPainter<?> src = (AbstractPainter<?>) evt.getSource();
src.removePropertyChangeListener(this);
}
else
{
String property = evt.getPropertyName();
... | 6 |
protected void parseStormData(StormSet stormSet, String gpx)
throws Exception
{
if(gpx == null)
throw new Exception("GPX XML is null");
this.stormSet = stormSet;
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setValidating(false);
SAXParser parser = factory.newSAXPars... | 3 |
public void refresh() {
Transform3D t3d = new Transform3D();
presentation.getTransform(t3d);
t3d.setRotation(abstraction.getOrientation());
t3d.setTranslation(abstraction.getPosition());
t3d.normalize();
if (getUsedBy().isEmpty() && presentation.isBillBoardExisting())
presentation.hideBillBoard();
else... | 4 |
@Override
public void execute(CommandSender sender, String[] arg1) {
if (!CommandUtil.hasPermission(sender, PERMISSION_NODES)) {
sender.sendMessage(plugin.NO_PERMISSION);
return;
}
if (arg1.length < 1) {
sender.sendMessage(ChatColor.RED + "/" + plugin.mute + " (player)");
return;
}
ProxiedP... | 4 |
public void layoutContainer(Container parent){
Insets insets=parent.getInsets();
synchronized(parent.getTreeLock()){
int n=parent.getComponentCount();
Dimension pd=parent.getSize(); int y=0;
//work out the total size
for(int i=0;i<n;i++){
Component c=parent.getComponent(i);
Dimension d=c.get... | 7 |
public ArrayList<String> placeDotCom(int comSize) { // line 19
ArrayList<String> alphaCells = new ArrayList<String>();
String [] alphacoords = new String [comSize]; // holds 'f6' type coords
String temp = null; // temporary String for concat
int [] coo... | 8 |
@SuppressWarnings("unchecked")
@Override
public void drop(DropTargetDropEvent dtde) {
Transferable trans = dtde.getTransferable();
if (isDnD(trans)) {
dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
Vector<File> fileLst = new Vector<File>();
try {
if (trans.isDataFlavorSupported... | 9 |
public static Date getStartOfTheDay(Date date) {
String value = date2String(date, "yyyy-MM-dd 00:00:00");
return string2Date(value);
} | 0 |
public Boolean load() {
FileInputStream fis = null;
ObjectInputStream ois = null;
try {
File f = new File("abalone.save");
fis = new FileInputStream(f);
ois = new ObjectInputStream(fis);
Game loadedGame = (Game) ois.readObject();
this.game = new Game(loaded... | 5 |
@Override
public void insertUpdate(DocumentEvent de) {
//Skip to the next TextField if input is valid and complete
try {
String text = de.getDocument().getText(0, de.getDocument().getLength());
int inputNumber = Integer.parseInt(text);
if ((inputNumber... | 6 |
private static void addFiles(File file,
List<String> result,
File reference) {
if (!file.exists() || !file.isDirectory()) {
return;
}
for (File child : file.listFiles()) {
if (child.isDirectory()) {
addFiles(child, result, reference);
} else {
String path = null;
while (chil... | 7 |
public SimpleComputer()
{
clearAll = new JButton("Clear All");
save = new JButton("Save");
load = new JButton("Load");
step = new JButton("Step");
run = new JButton("Run");
quickRef = new JButton("Quick Reference");
memory = new RegisterBox("Memory", 100, 20, ... | 3 |
@Override
protected String toString(int indent) {
String result = toString(indent, "Procedure");
// // decl
// return toString(indent, "ProcedureDeclaration\n")
// + procHeading.toString(indent + 1) + "\n"
// + procBody.toString(indent + 1);
// // head
// String str = toString(indent, "ProcedureHeadingNod... | 3 |
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
try {
int index = interfaceList.getSelectedIndex();
if((!model.isEmpty() || model.getElementAt(0) != "<html><i>Your order is empty</i></html>") && index >= 0) {
if(mo... | 9 |
static final public void valConst() throws ParseException {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case entier:
jj_consume_token(entier);
declaration.ajoutConstanteParEntier(YakaTokenManager.entierLu);
break;
case SUBNEG:
jj_consume_token(SUBNEG);
jj_consume_token(entier);
... | 6 |
public Barrillo generarGrano() {
Random rand = new Random();
int x = (int) (0.28 * getWidth()) + rand.nextInt((int) (0.42 * getWidth()));
int y = (int) (0.34 * getHeight()) + rand.nextInt((int) (0.55 * getHeight()));
int maxAncho = rand.nextInt(20);
int maxAlto = maxAncho;
... | 2 |
private int getMachineIndexBySelectedRow(JTable table){
InputTableModel model = (InputTableModel) table.getModel();
int row = table.getSelectedRow();
if(row < 0) return -1;
String machineFileName = (String)model.getValueAt(row, 0);
return getMachineIndexByName(machineFileName);
} | 1 |
public void valueChanged( final ListSelectionEvent e ) {
if ( e.getSource() == _font_list ) {
if ( _font_list.getSelectedValue() != null ) {
_fonts_tf.setText( ( ( String ) ( _font_list.getSelectedValue() ) ) );
}
_type = _fonts_tf.getText();
_test... | 9 |
public Tile getTileFromVec(Vector2f v)
{
int x = (int) (v.getX() / Tile.size);
int y = (int) (v.getY() / Tile.size);
if(x < 0 || x > world.loadedMap.tileWidth - 1 || y < 0 || y > world.loadedMap.tileHeight - 1)
return null;
return world.tileGrid[y][x];
} | 4 |
public static boolean isTypePage(Class<?> type) {
return (type != null && isAssignable(type, Page.class));
} | 2 |
@Override
public boolean equals( Object obj ) {
if( obj == this ){
return true;
}
if( obj == null || obj.getClass() != getClass() ){
return false;
}
ConnectionFlavor that = (ConnectionFlavor)obj;
return that.id.equals( id );
} | 3 |
private Direction getTurnDirection(double start, double stop) {
boolean turnOverZero = false;
if (Math.abs(start - stop) > 180)
turnOverZero = true;
if (turnOverZero && start > stop)
return Direction.LEFT;
else if (turnOverZero && start < stop)
return Direction.RIGHT;
else if (!turnOverZero && start... | 7 |
public static void crearMusica(HashMap<Integer, Musica> tablaMusica)
{
String titulo;
String formato;
Scanner entrada = null;
do // Validacion nombre
{
entrada = new Scanner(System.in);
System.out.print("Titulo del disco: ");
titulo = entrada.nextLine();
} while(titulo.equals(""));
do //... | 3 |
@Override
public String lookup(String barcode) {
String productDesc = "";
if(!(barcode == null || barcode.equals("")))
{
try
{
//Max lookups per day
// There are max lookup of 2500 requests per day //if(numberOfRequests < 2500)
String result = "";
String finalVal = "";
result = getR... | 8 |
public /*@non_null@*/ int [] getSelection() {
if (m_Upper == -1) {
throw new RuntimeException("No upper limit has been specified for range");
}
int [] selectIndices = new int [m_Upper + 1];
int numSelected = 0;
if (m_Invert)
{
for (int i = 0; i <= m_Upper; i++) {
if (!m_SelectFlags... | 8 |
public synchronized Image getImage() {
if (frames.size() == 0) {
return null;
} else {
return getFrame(currentFrame).image;
}
} | 1 |
@Override
public String getDesc() {
return "BrandishSpear";
} | 0 |
public String createTable(DataSetDescriptor dsd) {
String tableName = dsd.getTablename();
String nameGeomColumn = dsd.getGeoColumnName();
String pk = dsd.getNamePK();
List<Column> columns = dsd.getFields();
int srid = 4326;
String columnsToTable = "";
String sqlCreateTable = "CREATE TABLE ";
Column geoC... | 4 |
public void apply() throws XPathExpressionException {
if(!input.isEnabled()) {
return;
}
int value = Integer.parseInt(input.getText());
// sanity checks
if(value < min) {
throw new IllegalArgumentException("Value is " + value + ". Has to be > " +... | 3 |
private static Node dot(Node recieverNode, Node call)
{
Argument reciever = recieverNode.getArgument();
if (!(call instanceof Reference))
throw new EvaluationException(call, "Can not invoke " + call);
Reference ref = (Reference) call;
String name = ref.getName();
Argument[] args = ref.resolveArguments(... | 6 |
public static String getFilePath(File file) {
if(file == null) { return null; }
String path;
try {
path = file.getCanonicalPath();
}
catch(IOException e) {
path = file.getAbsolutePath();
}
if(file.isFile()) {
int index = -1;
for(int i=path.length() - 1;i>=0;i--) {
if(path.charAt(i) =... | 9 |
public static int partition2(int[] records, int low, int high){
if(low > records.length - 1|| high > records.length - 1) {
throw new IllegalArgumentException();
}
int pivot = records[low];
while(low < high){
while (records[high] > pivot && low < high){
... | 7 |
private static void test7() throws FileNotFoundException {
//Test winning by waiting for the guard to pass
String input = "new\n" + "pick up key\n" + "wait\n"
+ "unlock door with key\n" + "go through cell door\n" + "quit\n" + "y\n";
HashMap<Integer, String> output = new HashMap<Integer, String>();
boolean... | 7 |
public void desconectarBaseDeDatos(){
//metodo de desconexion
try{
if(conexion !=null){
if (sentencia !=null){
//si la conexion devuelve valores nulos
sentencia.close();
}
conexion.close();
}
... | 3 |
public static String longestCommonPrefix(String[] strs){
int i = 0;
int minLength = Integer.MAX_VALUE;
if(strs == null || strs.length == 0) return "";
for(String str : strs){
if(str.length() < minLength) minLength = str.length();
}
char[] chs = new char[minLength];
while(true) {
char c = ' ';
for... | 9 |
static String[] sort(String[] input){
String temp;
int left=0;
int right=0;
for(int i=1; i<input.length;i++){
left=0;
right=i-1;
while(left<right){
int mid=(left+right)/2;
if(input[mid].compareTo(input[i])>0){
right=mid-1;
}else{
left=mid +1;
}
}
t... | 7 |
public static void swap(List<Character> list, int i, int j) {
Character temp = list.get(i);
list.set(i, list.get(j));
list.set(j, temp);
} | 0 |
public static RunData loadFromFile(File file) throws XMLParsingExeption, ParserConfigurationException, SAXException, IOException
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setIgnoringElementContentWhitespace(true);
DocumentBuilder builder = factory.newDocumentBuild... | 3 |
@Override
public void mouseClicked(final MouseEvent e) {
this.e = e;
player.setActivityTimer(1000);
//if(player.getActivityTimer()==0){
new Thread(new Runnable(){
@Override
public void run() {
BarOverlay overlay = (BarOverlay)((JLabel) e.getSource()).getParent();
overlay.progress.setVisi... | 6 |
public static void loadScripts() throws IOException {
System.out.println("Loading scripts...");
ScriptManager.python.cleanup();
File scriptDir = new File("./Data/scripts/");
if (scriptDir.isDirectory() && !scriptDir.getName().startsWith(".")) {
File[] children = scriptDir.listFiles();
for (File child : ch... | 5 |
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
/**
* Servlet näyttää käyttäjälle hänen tekemänsä tilauksen, jonka tiedot
* haetaan tietokannasta. Aluksi varmistetaan, ettei käyttäjä saa
* virheilmoitusta jos hän päivittää sivun sen jäl... | 3 |
public String toString(String input) {
return name;
} | 0 |
public int addRun(int start, int length, T font) {
int end = start + length - 1;
RunArrayEntry newEntry = new RunArrayEntry(start, end, font);
if (runArray.size() == 0) {
// Empty runArray
runArray.add(newEntry);
return 0;
}
// Find position of new entry
int previousEntryIdx = -1;
int nextEntry... | 8 |
public static Question getQuestionData(int QDbId)
{
try
{
Question q = new Question();
String qstatement = String.format("Select * from question where questionid = %d", QDbId);
ResultSet qrs = getQueryResults(qstatement);
if (qrs.next())
{
q.questio... | 4 |
private int maximalSquareLengthFromPoint(char matrix[][], int row, int column) {
String areaLookupKey = String.valueOf(row)+","+String.valueOf(column);
if (areaLookup.containsKey(areaLookupKey)) {
return areaLookup.get(areaLookupKey);
}
if (matrix[row][column] == '0') {
... | 7 |
public void logisticProbabilityPlot(){
this.lastMethod = 8;
// Check for suffient data points
this.logisticNumberOfParameters = 2;
if(this.numberOfDataPoints<3)throw new IllegalArgumentException("There must be at least three data points - preferably considerably more");
... | 3 |
final void method737(AbstractToolkit var_ha, int i, int i_32_, int i_33_, int i_34_,
int i_35_, int i_36_) {
if (aClass105_1221 != null) {
int i_37_ = anInt1231 - i_35_ & 0x3fff;
int i_38_ = anInt1219 - i_36_ & 0x3fff;
if (i_38_ > 8192)
i_38_ -= 16384;
if (i_37_ > 8192)
i_37_ -= 16384;
... | 7 |
public void setScreenX(int screenX) {
this.screenX = screenX;
} | 0 |
private void removeFoundNode(TreeNode removingNode) {
TreeNode parentNode;
if (removingNode.left == null || removingNode.right == null) {
parentNode = removingNode;
} else {
parentNode = successor(removingNode);
removingNode.key = parentNode.key;
}
TreeNode childNode;
if (parentNode.left != n... | 6 |
public int readBits(int numBits) {
if (numBits < 1 || numBits > 32) {
throw new IllegalArgumentException();
}
int result = 0;
// First, read remainder from current byte
if (bitOffset > 0) {
int bitsLeft = 8 - bitOffset;
int toRead = numBits < bitsLeft ? numBits : bitsLeft;
... | 8 |
public void execute(String statement)
{
try{
Statement stat;
stat=this.conn.createStatement();
stat.execute(statement);
}catch(SQLException e)
{
e.printStackTrace();
}
} | 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.