text stringlengths 14 410k | label int32 0 9 |
|---|---|
public boolean verifyConnection(){
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
this.connect=DriverManager.getConnection("jdbc:mysql:"+this.link,this.username, this.passwd);
this.statement=this.connect.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
... | 4 |
public static void main(String[] args) {
System.out.println(ternary(9));
System.out.println(ternary(10));
System.out.println(standardIfElse(9));
System.out.println(standardIfElse(10));
} | 0 |
public static void main(String[] args)
{
try
{
if (System.getProperty("os.name").equals("Linux"))
{
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels())
if ("Nimbus".equals(info.getName()))
{
UIManager.setLookAndFeel(info.getClassName());
... | 7 |
public double[][] rawCorrelationCoefficients(){
if(!this.dataPreprocessed)this.preprocessData();
if(!this.covariancesCalculated)this.covariancesAndCorrelationCoefficients();
return this.rawCorrelationCoefficients;
} | 2 |
public void renderSubScreens()
{
for (SubScreen ss : subScreens)
{
if(ss.isVisible())
{
ss.render();
int[] image = ss.pixels;
for (int x = 0; x < ss.getWidth(); x++)
{
for (int y = 0; y < ss.getHeight(); y++)
{
if (ss.getY() + y >= 0 && ss.getY() + y < height && ss.getX() + x ... | 9 |
public static void setToolbarShortcut(String buttonName) {
if (buttonName.equals(Utility.getPropertyValue(Constants.billing))) {
button.setMnemonic(java.awt.event.KeyEvent.VK_B);
}
if (buttonName.equals(Utility.getPropertyValue(Constants.category))) {
button.setMnemonic(java.awt.event.KeyEvent.VK_C);
}
... | 9 |
public void animate(){
// If we are moving right, then facing left is false
if (dx > 0) {
facingLeft = false;
} else if (dx < 0) {
facingLeft = true;
}
// If we aren't moving, then don't animate
// and set frame to right facing and not moving
// unless we are facing left, then face it left
if (dx ... | 9 |
@Test
public void test() {
GameConfiguration conf = new GameConfiguration();
conf.setAgentCount(1);
conf.setInitialFoodAmount(1);
conf.setFoodAmountIncrese(1);
conf.setHiddenLayers(1);
conf.setNodesPerHiddenLayer(1);
conf.setWorldSize(1000);
WorldDescriptor wd = new WorldDescriptor(conf);
try {
Fi... | 1 |
public static String[] GetFileSystemList()
{
String sDisk[] = new String[]{"/","","","",""} ;
LOGGER.debug("Read CDiskSpaceUtil Properties");
try{
Configuration config = new PropertiesConfiguration("caspermon.properties");
for(int i=0 ; i<6 ; i++)
{
if(config.containsKey("diskutils.DISK"+... | 3 |
public Reference getReferenceAlias(Reference ref) {
Reference alias = (Reference) aliasesHash.get(ref);
if (alias == null) {
Identifier ident = getIdentifier(ref);
String newType = getTypeAlias(ref.getType());
if (ident == null)
alias = Reference.getReference(ref.getClazz(), ref.getName(),
newTyp... | 2 |
public String toString() {
String affiche = "message capteur";
return affiche;
} | 0 |
public List<NasdaqSymbolDto> getNasdaqSymbols() {
if (this.nasdaqSymbols == null || this.nasdaqSymbols.isEmpty()) {
this.nasdaqSymbols = new ArrayList<NasdaqSymbolDto>();
InputStream inputStream = null;
try {
URL url = new URL(NASDAQ_STOCK_LIST_CSV);
URLConnection connection = url.openConnection()... | 6 |
public void init() throws ELMException, IOException {
InputStream inputStream = _socketAdapter.getInputStream();
OutputStream outputStream = _socketAdapter.getOutputStream();
if (inputStream == null || outputStream == null)
throw new ELMException();
_connectionSingleton.setInputStream(inputStream);
... | 2 |
public static short readShort() {
short x = 0;
for (int i = 0; i < 2; i++) {
char c = readChar();
x <<= 8;
x |= c;
}
return x;
} | 1 |
public static void main(String[] args)
{
if (args.length != 1)
{
log.info("Unbundled usage: java PasswordStrengthIndicator <password>");
System.exit(1);
}
if (PasswordStrengthIndicator.isValidPassword(args[0]))
log.info("Password meets or exceeds defined security rules.");
else
log.info("Pas... | 2 |
public HDFS() {
} | 0 |
@Override
public Auction bid(String username, int itemId) {
// searches.get(itemId));
Auction a = searches.get(itemId);
if(a != null){
a.setCurrentBid(a.getCurrentBid()+1);
a.setOwner(username);
// return a;
}
return a;
} | 1 |
static public Class<?> getTypeFromString(String str) {
str = str.trim();
// Does it contain anything other then numbers or a decimal point?
if (Pattern.matches("[\\d]+((([\\.]){1}[\\d]+)|(L))?", str)) {
if (str.contains(".")) {
return Double.TYPE;
}
if (str.contains("L")) {
return Long.TYPE;
... | 5 |
protected int require (int required) throws KryoException {
int remaining = limit - position;
if (remaining >= required) return remaining;
if (required > capacity) throw new KryoException("Buffer too small: capacity: " + capacity + ", required: " + required);
int count;
// Try to fill the buffer.
if (rem... | 9 |
protected ArrayList<int[]> getCharacterSetList() {
ArrayList<int[]> alphabets = new ArrayList<int[]>();
if(allowAscii) alphabets.add(getAsciiCharArray());
if(allowSpaces) alphabets.add(getSpaceArray());
if(allowNumbers) alphabets.add(getNumericArray());
if(allowWhiteSpaces) alphabets.add(getWhiteSpaceArray())... | 5 |
private void printNaryRelHelp(ORASSNode node1, ORASSNode node2, String relName, int node2Index, List<String> entityOrder, CachedRowSet data, String id, int indentation) throws MainException{
try{
String table1 = node1.getName();
String table2 = node2.getName();
List<String> cols1 = keyMaps.get(table1);
Li... | 7 |
public void TempData()
{
//Getting the Soil Information
String filename = "rainfall.cdf";
NetcdfFile ncfile = null;
try {
ncfile = NetcdfDataset.openFile(filename, null);
} catch (IOException ioe) {}
try{
String varName = "aprod";
Variable v = ncfile.findVariable(varN... | 8 |
public URL[] getUrls() {
URL[] urls = new URL[_elements.size()];
int index = 0;
for (File file : _elements) {
try {
urls[index++] = file.toURI().toURL();
} catch (MalformedURLException e) {
e.printStackTrace();
return new UR... | 2 |
public List<String> findPath(String[] wordPair, Lexicon lexicon) {
// Null if the word pair is valid. Otherwise contains the invalid word(s)
List<String> isValidWordPair = lexicon.isValidWordPair(wordPair);
// Check to see if word pair is valid
if (isValidWordPair != null) {
// The word pair isn't vali... | 8 |
public Point getCoords() { return loc; } | 0 |
@Override
public void mousePressed(MouseEvent e) {
switch (global) {
case EditMode:
if (e.getButton() == MouseEvent.BUTTON1) {
switch (mode) {
case EditPoly:
//System.out.println("ASDASD");
... | 7 |
public static void main(String[] args) throws IOException {
OutputStream out = new FileOutputStream("/tmp/filter.data");
BufferedOutputStream bos = new BufferedOutputStream(out);
// ZipOutputStream zip = new ZipOutputStream(bos);
DataOutputStream dos = new DataOutputStream(out);
dos.writeInt(10);
dos.w... | 0 |
private void postPlugin(final boolean isPing) throws IOException {
// The plugin's description file containg all of the plugin data such as name, version, author, etc
final PluginDescriptionFile description = plugin.getDescription();
// Construct the post data
final StringBuilder data =... | 9 |
protected boolean verificarConvergencia() {
boolean converge = false;
for (int i = 0; i < this.matriz.linhas && !converge; i++) {
for (int j = i + 1; j < this.matriz.linhas && !converge; j++) {
if (this.criterioLinhas() && this.sassenfeld()) {
converge = true;
... | 8 |
public boolean kontroliertNordamerika(Spieler s) {
boolean res = true;
if(!s.fraktion.equals(laenderGraph.getLaenderList().getLandByID(0).getOwner())) {
res = false;
}
return res; } | 1 |
private JSONWriter append(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write('... | 7 |
public ThreadSpiderTest(String hostName, String startSite, String dirPath, Cobweb spiderEngine) {
this.hostName = hostName;
this.dirPath = dirPath;
File indexDirectory = new File(dirPath);
if (!indexDirectory.exists()) {
indexDirectory.mkdirs();
}
this.spiderEngine = spiderEngine;
// ... | 1 |
public void mouseEntered(MouseEvent e)
{
String str = "The mouse has entered the Frame !";
System.out.println(str);
} | 0 |
public static GameInfo getInstance() {
if(instance == null)
instance = new GameInfo();
return instance;
} | 1 |
public POSTerminal () {
this.orderTotal = BigDecimal.valueOf(0);
this.products = new TreeMap<Character, Product>();
this.order = "";
this.lastErrors = new ArrayList<String>();
UUID idOne = UUID.randomUUID();
this.terminalID = idOne.toString();
} | 0 |
public int numDecodings(String s) {
if(s.length() == 0) return 0;
int[] num = new int[s.length()];
if(s.charAt(0)>'0')
num[0]=1;
else
num[0]=0;
for(int i=1; i<s.length(); i++)
{
int path1 = 0, path2=0;
if(s.charAt(i)>'0') path1 = num[i-1];
if((s.cha... | 8 |
public void run() {
for(int i = 0; i < 16; i++) {
for(int j = 0; j < 128; j++) {
for(int k = 0; k < 16; k++) {
BlockState block = chunk.getBlock(i,j,k).getState();
org.bukkit.Locati... | 6 |
public static int noRecursionFib(int position)
{
int num1, num2, num3;
num1 = -1; num2 = 1;
for (int i = 0; i <= position; i++)
{
num3 = (num1 + num2);
num1 = num2;
num2 = num3;
}//end for loop
return num2;
}//end method | 1 |
private Scriptable js_getClass(Context cx, Scriptable scope, Object[] args)
{
if (args.length > 0 && args[0] instanceof Wrapper) {
Scriptable result = this;
Class<?> cl = ((Wrapper) args[0]).unwrap().getClass();
// Evaluate the class name by getting successive properties... | 7 |
private boolean checkALError()
{
switch( AL10.alGetError() )
{
case AL10.AL_NO_ERROR:
return false;
case AL10.AL_INVALID_NAME:
errorMessage( "Invalid name parameter." );
return true;
case AL10.AL_INVALID_ENUM:
... | 6 |
void compress( int init_bits, OutputStream outs ) throws IOException
{
int fcode;
int i /* = 0 */;
int c;
int ent;
int disp;
int hsize_reg;
int hshift;
// Set up the globals: g_init_bits - initial number of bits
g_init_bits = init_bits;
// Set up the ... | 9 |
public List findByAuther(Object auther) {
return findByProperty(AUTHER, auther);
} | 0 |
public <T> T readValueFromJsonString(String response, Class<T> clazz) {
try {
return OBJECT_MAPPER.readValue(response, clazz);
} catch (JsonParseException e) { log.error("{}", e);
} catch (JsonMappingException e) { log.error("{}", e);
} catch (IOException e) { log.error("{}", e); }
return null;
} | 3 |
public LevelGen(int w, int h, int featureSize) {
this.w = w;
this.h = h;
values = new double[w * h];
for (int y = 0; y < w; y += featureSize) {
for (int x = 0; x < w; x += featureSize) {
setSample(x, y, random.nextFloat() * 2 - 1);
}
}
int stepSize = featureSize;
double scale = 1.0 / w;
dou... | 7 |
@Override
public void onAutoCompleteCreateReplacement(InterfaceController controller, SimpleAutoCompleteEntry entry) {
Construct construct = entry.create(mDocument, this.construct.parent);
ConstructEditor editor = mDocument.editorsFromConstruct(construct);
WeakReference<ConstructEditor> weakParentEditor = mBound... | 4 |
public boolean equals(Object obj) {
if (!(obj instanceof Book))
return false;
Book book = (Book) obj;
return (this.ISBN == book.getISBN()
&& this.getTitle().equals(book.getTitle())
&& this.getAuthor().equals(book.getAuthor()) && this.getPrice() == book
.getPrice());
} | 4 |
public static void main(String[] args) {
roubaix = new City("Roubaix");
for (int i = 1; i < NUMBER_OF_INHABITANTS + 1; i++) {
Inhabitant p = new Inhabitant(("inhabitant_" + i));
roubaix.addInhabitant(p);
}
int week = 6;
for (int i = 1; i <= week; i++) {
for (int j = 0; j < 60; j++) {
System.out.p... | 6 |
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(true){
char[] s = sc.next().toCharArray();
if(s[0]=='0')break;
int a = 0;
int b = 0;
for(int i=1;i<s.length;i++){
if(s[i]=='A')a++;
else b++;
}
if(a>b)a++;
else b++;
System.out.println(a+" "+b);
... | 9 |
private boolean isStraight(Card[] h) {
boolean straight = false;
Card[] hand;
hand = h;
int startValue = hand[0].getValue();
// if statement to ensure that ace can be high or low (A2345 as well as
// 10JQKA are straights)
if (hand[0].getValue() == 0 && hand[1].getValue() == 9
&& hand[2].getValue() ==... | 7 |
public int getSequence_Id() {
return sequence_Id;
} | 0 |
public void setMovingLeft(boolean isMovingLeft) {
this.isMovingLeft = isMovingLeft;
this.isMovingRight = isMovingLeft ? !isMovingLeft : this.isMovingRight;
this.xSpeed = !isMovingLeft ? 0 : this.xSpeed;
} | 2 |
public static void main(String[] args) throws ClassNotFoundException,
FileNotFoundException, IOException, InstantiationException,
IllegalAccessException {
resource = ResourceBundle.getBundle("data_en_EN");
if (!isArgsValid(args))
return;
boolean seeHints = false;
JarLoader jarClassLoader = n... | 9 |
public static List<String> topologicalSort(Graph graph)
{
if(!graph.getDirected())
throw new UnsupportedOperationException("Graph is undirected");
int counter = 0;//To determine whether the graph is cyclic
LinkedList<Vertex> queue = new LinkedList<Vertex>();
LinkedList<Vertex> vertices = new LinkedList<Ver... | 7 |
public Object invoke(Object proxy, Method method, Object[] args) {
/* Business method logic: this should implement it */
if (method.isAnnotationPresent(BusinessLogic.class))
return execMethod(this, method, args);
/* Getters */
if (CommonStatic.isAGetter(method)){
String mN = factory.getCache().fi... | 7 |
private void sendBiColorLine(int[] pixels, int width, int y, int toX,
int toY, int c0, int c1, DisplayMessage m) {
int offset = y * width;
int count = 0;// number of contiguous pixels
int currentColor = pixels[offset];
Vector<Integer> counts = new Vector<Integer>();
// System.out.println("Analysing line")... | 7 |
private static void calcNoOfNodes(Node node) {
if (node instanceof Parent) {
if (((Parent) node).getChildrenUnmodifiable().size() != 0) {
ObservableList<Node> tempChildren = ((Parent) node).getChildrenUnmodifiable();
noOfNodes += tempChildren.size();
f... | 3 |
public StringEncryptor() {
// if there is not default key create one
if (StringEncryptor.defaultKey == null) {
try {
KeyGenerator keyGen = KeyGenerator.getInstance("AES");
keyGen.init(128);
StringEncryptor.defaultKey = (SecretKeySpec) keyGen
.generateKey();
} catch (NoSuchAlgorithmException ... | 5 |
void leganim(int offset) {
if(world.isRemote)
if(onGround){
if(leganimstat){
leganim -=offset;
} else {
leganim +=offset;
}
if(leganim>52||leganim<15){
SoundHandler.playSound("/sound/effects/step/metal"+((int)(Math.random()*2)+1)+".wav");
leganimstat = !leganimstat;
if(leganim>52)leganim = 52... | 7 |
public int getStrength() {
int sum = 0;
int[] weights = {0,1,10,50,600};
for (int i = 0; i < cl.length; i++) {
sum += (getScore(cl[i]) > 0) ? weights[Math.abs(getScore(cl[i]))] : -weights[Math.abs(getScore(cl[i]))];
}
return sum + (currentPlayer == PLAYER_ONE ? 16 : -16);
} | 3 |
public static Map<String, Player> createIdMap(Iterable<? extends Player> database, IdReader idReader) {
Map<String, Player> mergeMap = Maps.newHashMap();
for (Player p : database) {
String key = null;
try {
key = idReader.getId(p);
} catch (Exception e... | 3 |
public final SymbolraetselASTSolver.number_return number() throws RecognitionException {
SymbolraetselASTSolver.number_return retval = new SymbolraetselASTSolver.number_return();
retval.start = input.LT(1);
CommonTree syms=null;
List list_syms=null;
try {
// C:\\Use... | 6 |
private synchronized int getNextIdAndIncrement() {
int nextId = 0;
try (Connection connection = DriverManager.getConnection(connectionString);){
Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery("select max(id) as maxRec from recipe");
if (rs.next()) {
nextId = r... | 2 |
public static UndirectedGraphNode cloneGraph(UndirectedGraphNode node) {
if(node == null) {
return node;
}
Queue<UndirectedGraphNode> nextNode = new LinkedList<UndirectedGraphNode>();
boolean[] created = new boolean[10000];
for(int i=0;i<10000;i++) {
created[i] = false;
... | 6 |
public void eliminarMaterialImproprioCompartilhado(Artigo art) {
String palavra = " RR ";
List<Artigo> artigosRemover = new LinkedList<Artigo>();
for (int i = 0; i < artigo.size(); i++) {
if ((artigo.get(i).getResumo().contains(palavra) || artigo.get(i)
.getResumo().equals("RR"))
|| (artigo.get(i).g... | 8 |
protected Context generateContext(Context parent)
{
final Context funcContext = new Context(returnType.getName(), parent);
Block block = (Block) children.get(0);
for (AbstractSyntaxNode child : block.getChildren())
{
if (child instanceof Creation)
{
... | 6 |
public boolean isGhost(Player player) {
return player != null && hasPlayer(player) && ghosts.contains(player.getName());
} | 2 |
public void loadOrFail(final String fileName) throws IOException {
// set the current picture's file name
this.fileName = fileName;
// set the extension
int posDot = fileName.indexOf('.');
if (posDot >= 0) {
this.extension = fileName.substring(posDot + 1);
}
// if the current title is null use the fi... | 4 |
public Bucket split() {
int mc = -1;
int maxDiff = Integer.MIN_VALUE;
for (int c = 0; c < 3; c++) {
int diff = maxC[c] - minC[c];
if (diff > maxDiff) {
maxDiff = diff;
mc = c;
}
}
final int fmc = mc;
Collections.sort(colors, (o1, o2) -> Col... | 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 |
public String getNom() {
return nom;
} | 0 |
public T elementAt(int index) throws Exception
{
if(this._source instanceof List<?>)
{
return ((List<T>)this._source).get(index);
}
else if(this._source instanceof ArrayIterable<?>)
{
return ((ArrayIterable<T>)this._source).getSource()[index];
}
else
{
int i = 0;
for(T item : this._source)
... | 6 |
public void addMaquina(AbstractRolamento r, String s)
{
if(s.equals("Torno") )
{
for(torno t : maquinaTorno)
{
if(t.getStatus()==0)
{
t.addRolamento(r);
t.setStatus(1);
break;
}
}
}
if(s.equals("Fresa") )
{
for(fresa f : maquinaFresa)
{
if(f.getStatus()==0)... | 9 |
public static synchronized BoxedDropShadowBorder get() {
if (INSTANCE == null) {
INSTANCE = new BoxedDropShadowBorder();
}
return INSTANCE;
} | 1 |
@Override
public void shutdown() {
FileUtil.setProtection(this.authuiSystemfilePath, true);
FileUtil.setProtection(this.basebrdSystemfilePath, true);
if (Files.exists(Constants.PROGRAM_TMP_PATH, LinkOption.NOFOLLOW_LINKS)) { // and deletes the temporary files.
try {
... | 2 |
private void onCorrect()
{
isCorrect = true;
dispose();
} | 0 |
@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 Userpass)) {
return false;
}
Userpass other = (Userpass) object;
if ((this.username == null && other.username !... | 5 |
private State run2(final String program, final State s) {
String java = convert2Java(program, s instanceof StatusState);
StringBuilder builder = new StringBuilder();
builder.append(
"import de.vonloesch.brainfuck.State;import de.vonloesch.brainfuck.StatusState;\npublic class Hell... | 8 |
public Node reverseAlter2KNodes(Node head, int k){
//process 2K nodes at a time
//reverse till k nodes and set the the pointer to k+1
int x = k;
Node moving = head;
Node head_prev = null;
Node head_next = null;
while(x>0 && moving!=null){
head_next = moving.next;
moving.next = head_prev;
head_p... | 6 |
public OpenAction() {
super("Open...", null);
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_O,
MAIN_MENU_MASK));
this.fileChooser = Universe.CHOOSER;
//this.fileChooser = new JFileChooser (System.getProperties().getProperty("user.dir"));
} | 0 |
public int largestRectangleArea(int[] height) {
Stack<Integer> stack = new Stack<Integer>();
int i = 0;
int maxArea = 0;
//push in order, increase
//if smaller than previous one, pop and calculate
while (i < height.length) {
if (stack.isEmpty() || height[stac... | 6 |
@Override
public boolean hasData() {
if (this.windowSize == null &&
this.windowLocation == null &&
this.horizontalDividerLocation == 0 &&
this.verticalDividerLocation == 0 &&
this.selectedEntryTab == 0 &&
this.selectedE... | 6 |
public boolean adicionarProduto(Produto p) throws ExceptionGerenteEstoque {
if(p.getNome() == null || p.getCodigo() == null){
throw new ExceptionGerenteEstoque("Nome ou Codigo n��o inicializados");
}
if (!contensProduto(p.getCodigo()) && !contensProduto(p.getNome())) {
re... | 4 |
public void addEvent(Job event) throws Exception{
if(!(event instanceof DatedEvent) || !(event instanceof SimpleEvent)){
throw new IllegalEventTypeException();
}
if(event instanceof DatedEvent){
if(((DatedEvent)event).getDate().before(new Date(System.currentTimeMillis()))... | 4 |
public Object getConstValue() {
if (Debug.enabled)
Debug.check(constValue!=null);
return constValue;
}; | 1 |
public static void UTF8toUTF16(final byte[] utf8, final int offset, final int length, final UTF16Result result) {
final int end = offset + length;
char[] out = result.result;
if (result.offsets.length <= end) {
int[] newOffsets = new int[2*end];
System.arraycopy(result.offsets, 0, newOffsets, 0... | 8 |
private Result pStructureDeclaration(final int yyStart) throws IOException {
Result yyResult;
int yyBase;
int yyRepetition1;
boolean yyRepeated1;
int yyOption1;
String yyOpValue1;
Node yyValue;
ParseError yyError = ParseError.DUMMY;
// Alternati... | 8 |
public void setState(int state) {
this.state=state;
// Change the status label
if (state==1) theApp.setStatusLabel("Start Tone Hunt");
else if (state==2) theApp.setStatusLabel("Sync Hunt");
else if (state==3) theApp.setStatusLabel("Sync Found");
else if (state==4) theApp.setStatusLabel("Decoding");
else i... | 5 |
public static void main(String[] args) {
Client client = new Client();
try {
client.setDaemon(true);
client.setPriority(NORM_PRIORITY);
client.start();
System.out.print("Please enter your name:");
client.out.println("");
while (!cl... | 5 |
private synchronized void handleConnectionProperty(INDISwitchElementAndValue[] newEvs, Date timestamp) {
for (int i = 0 ; i < newEvs.length ; i++) {
INDISwitchElement el = newEvs[i].getElement();
SwitchStatus s = newEvs[i].getValue();
if (el == connectedE) {
if (s == SwitchStatus.ON) {
... | 9 |
protected void _putcatalog() {
this._out("/Type /Catalog"); //$NON-NLS-1$
this._out("/Pages 1 0 R"); //$NON-NLS-1$
if ((this.zoomMode == null) && (this.zoomFactor > 0)) {
this._out("/OpenAction [3 0 R /XYZ null null " //$NON-NLS-1$
+ this.zoomFactor / 100 + "]"); //$NON-NLS-1$
} else if (Zoom.FULLPAGE.e... | 8 |
public static Performance getLatest(Connection con)
{
Performance perf = null;
try
{
ResultSet result = con.createStatement().executeQuery(
"SELECT ID FROM " + tableInfo.tableName + " ORDER BY LastFail DESC { LIMIT 1 }");
result.next();
perf = new Performance(con, result.getString(1));
result.... | 2 |
public static Hand evaluate(List<Card> sourceCards) {
final Holder<Hand> handHolder = new Holder<Hand>();
final HandCombinationSink handCombinationSink = new HandCombinationSink() {
@Override
public void setBestHand(Hand hand) {
assert handHolder.value == null;
... | 9 |
public boolean write() throws IOException {
SelectionKey key = this.channel.keyFor(this.nioEngineImp.getSelector());
if(currentStateWrite == WRITING_DONE){
if(listBuffer.size() > 0){
bufferWrite = listBuffer.get(0);
listBuffer.remove(0);
bufferWrite.position(0);
lengthBufferWrite.position(0);... | 9 |
@Test (expected = IllegalArgumentException.class)
public void testEmptyTypes() throws IOException {
List<Class<?>> types = new ArrayList<>();
Table table = provider.createTable("simple", types);
} | 1 |
private void btnAceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarActionPerformed
for (int i = 0; i < Obj.principal.mes[Obj.principal.mesActual].getN(); i++) {
Obj.principal.diaActual = i;
Obj.principal.mes[Obj.principal.mesActual].dia[i].calHoras(Obj.p... | 3 |
private String biGramUnderWord(char word, String spelling) {
char[] words1 = new char[1];
words1[0] = word;
char[] words2 = findWaitingWords(spelling).toCharArray();
char word1 = ' ';
char word2 = ' ';
if(words1.length < 1 || words2.length < 1) {
System.out.println("spelling Error: biGram()");
return ... | 8 |
public static boolean createDefaultTradingStrategy(String name,
ArrayList<String> ruleList) {
initialise();
// Check ts name is unique
boolean uniqueName = true;
for (TradingStrategy ts : strategyList) {
if (ts.getName().equals(name) && ts.getUserAccount() == null) {
uniqueName = false;
}
}
... | 7 |
public JsonWriter value (Object value) throws IOException {
if (current != null) {
if (current.array) {
if (!current.needsComma)
current.needsComma = true;
else
writer.write(',');
} else {
if (!named) throw new IllegalStateException("Name must be set.");
named = false;
}
}
if (v... | 7 |
public void load(InputStream input, int size) throws IOException {
this.size = size;
if (input == null) {
throw new IllegalArgumentException("input cannot be null.");
}
readTableDirectory(input);
if (headOffset == -1) {
throw new IOException("HEAD table no... | 9 |
public String[] getPathArray()
{
return pathArray;
} | 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.