text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void calcular(boolean diagonales)
{
nodosEvaluados= new HashSet<>(); //set de nodos evaluados
PriorityQueue<Nodo> nodosPorEvaluar = new PriorityQueue<>();//set de nodos por evaluar, contiene inicialmente al nodo inicial
inicio.setFuncionG(0); //costo desde el inicio hasta el mejor c... | 8 |
public void initUndoKeeper(){
myKeeper = new UndoKeeper(getAutomaton());
} | 0 |
@Override
public DisplayState getDisplayState() {
File stateFile = new File(directory, ".displaystate");
if(stateFile.exists())
try {
return (DisplayState)DisplayState.deSerialize(stateFile.getPath());
} catch (IOException ex) {
Logger... | 3 |
private static void drawCircle(double x, double y, double radius){
//filled circle
double x1,y1,x2,y2;
double angle;
GL11.glColor3f(0.7f, 0.7f, 0.7f);
GL11.glBegin(GL11.GL_TRIANGLE_FAN);
GL11.glVertex2d(x,y);
for (angle=1.0f;angle<361.0f;angle+=0.2)
{
x2 = x+Math.sin(a... | 1 |
public String byte2hex(byte[] b) {
String hs = "";
String stmp = "";
for (int i = 0; i < b.length; i++) {
stmp = Integer.toHexString(b[i] & 0xFF);
if (stmp.length() == 1) {
hs += "0" + stmp;
}
else {
hs += stmp;
}
}
return hs.toUpperCase();
} | 2 |
public void enqueueMessage(int queueId, Message message) throws MessageEnqueueException, MessageEnqueueSenderDoesNotExistException, MessageEnqueueQueueDoesNotExistException {
try {
_out.writeInt(20 + message.getMessage().getBytes().length); //Size
_out.writeInt(Response.MSG_QUEUE_ENQUEU... | 5 |
@Override
public String makeMove(CardGame game, CardPanel panel) {
List<List<Card>> board = game.getBoard();
List<Card> pack = game.getPack();
Stack<Card> deck = game.getDeck();
game.setCanAddToDeckFromBoard(false);
for (int j = 0; j < 12; j++) {
//Want them all... | 3 |
public String getRunButtonImageName() {
if(Configuration.handleEmptyEventQueue && Configuration.asynchronousMode) {
if(appConfig.guiRunOperationIsLimited) {
return "refillrun.gif";
} else {
return "refillrunforever.gif";
}
} else {
if(appConfig.guiRunOperationIsLimited) {
return "run.gif";
... | 4 |
static public Spell getLightningSpell(int i)
{
switch (i)
{
default:
case 0:
return new Lightning();
case 1:
return new LightningStorm();
case 2:
return new LightningBall();
case 3:
... | 7 |
@Override
public boolean createUser(String login, String password, String firstName, String lastName, String passportInfo) {
//заполнение sql скрипта
Map<String, Object> pageVariables = dataToKey(new String [] { "login", "password", "firstName", "lastName", "passportInfo" },
login, ... | 3 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((mediaName == null) ? 0 : mediaName.hashCode());
result = prime * result + ((date == null) ? 0 : date.get(Calendar.MONTH));
result = prime * result + ((date == null) ? 0 : date.... | 4 |
private void doHandshake() throws IOException
{
// C0
byte C0 = 0x03;
out.write(C0);
// C1
long timestampC1 = System.currentTimeMillis();
byte[] randC1 = new byte[1528];
rand.nextBytes(randC1);
out.writeInt((int)timestampC1);
out.writeInt(0);
out.write(randC1, 0, 1528);
out.flush();
// S0
... | 4 |
public void run(String arg) {
if (IJ.versionLessThan("1.37f")) return;
int[] wList = WindowManager.getIDList();
// 1 - Obtain the currently active image if necessary:
// 2 - Ask for parameters:
boolean whiteParticles =Prefs.blackBackground, connect4=false;
GenericDialog gd = new GenericD... | 5 |
@Override
public void setValueAt(Object value, int row, int column) {
Variable variableToChange = variableList.get(row);
if (column == 1) {
variableToChange.setReplacementName((String)value);
} else if (column == 2) {
variableToChange.setObfuscate((Boolean)value);
}
} | 2 |
public boolean start() {
if (System.getSecurityManager() == null) {
System.setSecurityManager(new SecurityManager());
}
try {
IJobProcessingService stub = (IJobProcessingService) UnicastRemoteObject
.exportObject(this, 0);
// LocateRegistry.getRegistry(JobUtility.getPort());
registry = LocateReg... | 5 |
public void update(GameContainer gcan, StateBasedGame state, int dtime) throws SlickException
{
a.update();
b.update();
c.update();
d.update();
e.update();
f.update();
gb.update();
if(b.activated())
{
SessionSettings.ingame = true;
state.enterState(1, new FadeOutTransition(Color.black, 250),... | 7 |
public final List<Pair<Integer, String>> getAllItems() {
if (itemNameCache.size() != 0) {
return itemNameCache;
}
final List<Pair<Integer, String>> itemPairs = new ArrayList<Pair<Integer, String>>();
MapleData itemsData;
itemsData = stringData.getData("Cash.img");
... | 8 |
public String longestCommonSubstring(String s, String t) {
int[][] matrix = new int[s.length()][t.length()];
int maxLen = 0;
int lastSubStart = 0;
int currentSubStart = 0;
StringBuilder sb = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
for (int j = 0; j < t.length(); j++) {
if (s.charA... | 7 |
@Override
public void run() {
for (Citation c : citations.getCitations()) {
io.println(c.getId() + ": " + c.getTitle());
}
Integer command = -5;
try {
command = io.getInteger("Give id of the article to tag (or -1 to cancel): ");
}
catc... | 5 |
private static void prepareMenu() {
menu = new HashMap<Integer, String>();
menu.put(1, "Coffee");
menu.put(2, "Tea");
menu.put(3, "Lemonade");
menu.put(4, "GrilledSandwich");
menu.put(5, "PeanutButterSandwich");
menu.put(6, "CheeseSandwich");
} | 0 |
public int getFirewallId2() {
return firewallId2;
} | 0 |
public void map() {
//points is start, controls, end
double[][][] V = new double[points.length-1][intervals+1][2];
for (int c = 0; c < V.length; c++) {
for (int i = 0; i < V[c].length; i++) {
V[c][i][0] = (1 - (double)i/intervals)*points[c][0] + ((double)i/intervals)*points[c+1][0];
V[c][i][1] = ... | 6 |
public void resetAllGameActions() {
for (int i=0; i<keyActions.length; i++) {
if (keyActions[i] != null) {
keyActions[i].reset();
}
}
for (int i=0; i<mouseActions.length; i++) {
if (mouseActions[i] != null) {
mouseActions[i].re... | 4 |
private void mouseHelper(int codeNeg, int codePos,
int amount)
{
GameAction gameAction;
if (amount < 0) {
gameAction = mouseActions[codeNeg];
}
else {
gameAction = mouseActions[codePos];
}
if (gameAction != null) {
gameActio... | 2 |
public ArrayList subledger1(String type, String loanid, float amount)
{ //get all details subledger needs
arrayTemp= new ArrayList();
String query = "select * from loan_dtl where loanid="+loanid+" and amordate between to_date('"+startDate.substring(0, 10) +"','yyyy-mm-dd') and to_date('"+endD... | 7 |
private void byAttribute() {
TokenQueue cq = new TokenQueue(tq.chompBalanced('[', ']')); // content queue
String key = cq.consumeToAny(AttributeEvals); // eq, not, start, end, contain, match, (no val)
Validate.notEmpty(key);
cq.consumeWhitespace();
if (cq.isEmpty()) {
... | 8 |
public boolean isMoreOuterThan(ClassDeclarer declarer) {
ClassDeclarer ancestor = declarer;
while (ancestor != null) {
if (ancestor == this)
return true;
ancestor = ancestor.getParent();
}
return false;
} | 2 |
public void run() throws IOException, NoSuchAlgorithmException, InvalidPvidException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, InvalidKeyException
{
try{
//Displaying choices that the voter has
Voter.displayMainMenu();
System.out.println("Please enter your choice");
int ... | 7 |
public static ByteBuffer outputBufferFrom(final Object object) throws IOException {
if (object instanceof ByteBuffer) return (ByteBuffer)object;
if (object instanceof File) return IO._outputBufferFrom_((File)object);
if (object instanceof FileChannel) return IO._outputBufferFrom_((FileChannel)object);
if (objec... | 7 |
@EventHandler
public void GhastMiningFatigue(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getZombieConfig().getDouble("Ghast.Min... | 7 |
private void permuteHelper(int size, int usedIndex) {
if (size == k) {
ArrayList<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < ans.length; i++) {
list.add(ans[i]);
}
result.add(list);
return;
}
for (int ... | 4 |
public Iterator<Integer> calculateWinningScores(int numberOfTurns){
int numberOfScores = (numberOfTurns%2==0)? (numberOfTurns/2):((numberOfTurns/2) -1);
ArrayList<Integer> scores = new ArrayList<Integer>();
int multiplier = -1;
return scores.iterator();
} | 1 |
public void deplacementDroite() {
if (!pause) {
plateau.updatePosition(1, 0);
updateObservers();
}
} | 1 |
@XmlElementDecl(namespace = "http://www.w3.org/2001/04/xmlenc#", name = "KA-Nonce", scope = AgreementMethodType.class)
public JAXBElement<byte[]> createAgreementMethodTypeKANonce(byte[] value) {
return new JAXBElement<byte[]>(_AgreementMethodTypeKANonce_QNAME, byte[].class, AgreementMethodType.class, ((byte... | 0 |
public ListNode addTwoNumbers(ListNode l1, ListNode l2) {
ListNode reNode = new ListNode(0);
ListNode tail = reNode;
int carry = 0;
while(l1 != null || l2 != null){
ListNode temp = new ListNode((carry+(l1 == null?0:l1.val)+(l2==null?0:l2.val))%10);
carry = (carry... | 9 |
public static void testVerifierLoginMdp(){
EntityManager em;
boolean resultat;
String nomVisiteur;
String mdpVisiteur;
System.out.println("\nDEBUT DES TESTS");
// Instanciation du gestionnaire d'entités (contexte de persistance)
em = EntityManagerFactorySingleton... | 0 |
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException, Exception {
//retardo debug
// try {
// Thread.sleep(80);
// } catch (InterruptedException ex) {
// Thread.currentThread().interrupt();
//... | 3 |
void init(byte[] input, int windowStart, int from, int to) {
int[] hashVal = this.hashVal;
int[] head = this.head;
int[] same = this.same;
int[] prev = this.prev;
int[] hashVal2 = this.hashVal2;
int[] head2 = this.head2;
int[] prev2 = this.prev2;
System.a... | 9 |
@Override
public void unInvoke()
{
// undo the affects of this spell
if((affected!=null)&&(canBeUninvoked()))
{
if(affected instanceof Room)
{
final Room room=(Room)affected;
room.showHappens(CMMsg.MSG_OK_VISUAL, L("Time starts moving again..."));
if(invoker!=null)
{
final Ability me=... | 9 |
private void loadMap(String filename) throws IOException {
ArrayList lines = new ArrayList();
int width = 0;
int height = 0;
BufferedReader reader = new BufferedReader(new FileReader(filename));
while(true){
String line = reader.readLine();
if(line == null){
reader.close();
break;
}
if ... | 6 |
private static String escapeJSON(String text) {
StringBuilder builder = new StringBuilder();
builder.append('"');
for (int index = 0; index < text.length(); index++) {
char chr = text.charAt(index);
switch (chr) {
case '"':
case '\\':
builder.append('\\');
builder.append(chr);
break;
... | 8 |
@Test
public void testGetTransaction() {
Gateway beanstream = new Gateway("v1", 300200578,
"4BaD82D9197b4cc4b70a221911eE9f70", // payments API passcode
"D97D3BE1EE964A6193D17A571D9FBC80", // profiles API passcode
"4e6Ff318bee64EA391609de89aD4CF5d");// reporti... | 2 |
@Override
public void mouseDragged(MouseEvent e) {
this.diagramPanel.setMoveHandCursor();
if (SwingUtilities.isLeftMouseButton(e)&&e.isControlDown()) {
int scrollPositionX = this.diagramScrollPane.getViewport().getViewPosition().x;
int scrollPositionY = this.diagramScrollPane... | 5 |
private JLabel getJLabel1() {
if (jLabel1 == null) {
jLabel1 = new JLabel();
jLabel1.setText("seporator:");
}
return jLabel1;
} | 1 |
public void update(Graphics g) {
// setup the graphics environment
Graphics2D g2 = (Graphics2D)g;
if (manager.antialiasing) {
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
... | 5 |
public ServerController()
{
this.observers = new LinkedList<IClientObserver>();
game = new Game();
CallHandler callHandler = new CallHandler();
try
{
callHandler.registerGlobal(IServerObserver.class, this);
this.addServerListener(new MyServerListener()... | 4 |
public void setHealth(double health) {
if(health < 0)
this.health = 0;
else
this.health = health;
} | 1 |
public void actualiza() {
long tiempoTranscurrido = System.currentTimeMillis() - tiempoActual;
granada.avanza();
if (canasta.getMoveLeft()) {
canasta.setPosX(canasta.getPosX() - 6);
}
if (canasta.getMoveRight()) {
canasta.setPo... | 3 |
public void writeNumbers (int pTamano) {
JSONObject obj = new JSONObject();
JSONArray list = new JSONArray();
for(int i = 0 ; i < pTamano; i++){
int ram = (int) (Math.random() * 100000);
list.add(ram + "");
}
obj.put("Tags", list);
try {
... | 2 |
public void initialize(FlowChartInstance flowChartinstance, ChartItemSpecification chartItemSpecification) throws MaltChainedException {
super.initialize(flowChartinstance, chartItemSpecification);
for (String key : chartItemSpecification.getChartItemAttributes().keySet()) {
if (key.equals("id")) {
idName... | 7 |
public ComplexMatrix getABCDmatrix(){
if(this.segmentLength==-1)throw new IllegalArgumentException("No distance along the line as been entered");
if(this.distributedResistance==0.0D && this.distributedConductance==0.0D){
this.generalABCDmatrix = this.getIdealABCDmatrix();
}
e... | 3 |
public static boolean readBoolean() {
String line = null;
try {
BufferedReader is = new BufferedReader(new InputStreamReader(
System.in));
line = is.readLine();
} catch (NumberFormatException ex) {
System.err.println("Not a valid number: " ... | 3 |
public void placeObjectOnBoard(Placeable object) {
if (isValidPositions(object)) {
setPriority(object);
}
} | 1 |
public void testConstructor_ObjectStringEx2() throws Throwable {
try {
new YearMonth("T10:20:30.040+14:00");
fail();
} catch (IllegalArgumentException ex) {
// expected
}
} | 1 |
public static void main(String args[]){
int[] reactantsA = {43, 18};
int[] productsA = {4, 52, 1};
int[] reactantsB = {12, 18};
int[] productsB = {6, 1, 52};
int[] reactantsC = {18, 43};
int[] productsC = {52, 4, 1};
int[] reactantsD = {18, 43};
int[] productsD = {52,... | 4 |
public void handleConf(CSTAEvent event) {
if ((event == null) || (event.getEventHeader().getEventClass() != 5)
|| (event.getEventHeader().getEventType() != this.pdu)) {
return;
}
if (this.pdu == 28) {
boolean enable = ((CSTAQueryMwiConfEvent) event.getEvent())
.isMessages();
if ((event.getPrivD... | 9 |
public static JIPMainWindow getInstance() {
if (instance_ == null) instance_ = new JIPMainWindow();
return instance_;
} | 1 |
public Map toMap(){
Map<String,Object> root = new HashMap<String,Object>();
// for(String key : sys_properties.stringPropertyNames()){
// String value = sys_properties.getProperty(key);
// if(key.contains(".")){
// parseComplexKey(key,root,parseValue(value));
// ... | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Leerling other = (Leerling) obj;
if (leerjaar != other.leerjaar)
return false;
if (leerlingNaam == null) {
if (other.leerlingNaam != null)
return ... | 7 |
public void alimentaTabela(String SQL){
ArrayList dados = new ArrayList();
String [] Colunas = new String[]{"ID","Nome","CPF","RG","CNH","Cat","Contato","Parent","Telefone","Tel2","TeleContato"};
conecta.executaSQL(SQL);
try {
conecta.rs.... | 2 |
@Override
public boolean equals(Object o) {
if (o == null)
return false;
if (!(o instanceof Pair))
return false;
Pair<?, ?> pairo = (Pair<?, ?>) o;
return this.left.equals(pairo.getLeft())
&& this.right.equals(pairo.getRight());
} | 7 |
public IRCResponse getResponseByNumber(int number){
for(IRCResponse response: IRCResponse.values()){
if (number == response.getNumeric())
return response;
}
return null;
} | 2 |
private void parseVersionNumbers(XMLEventReader xmlReader) throws XMLStreamException {
CompareVersionNumbers versionNumberComparator = new CompareVersionNumbers();
while (xmlReader.hasNext()) {
XMLEvent = xmlReader.nextEvent();
if (XMLEvent.isStartElement()) {
... | 7 |
public boolean isBlocked(Account account){ return account.isBlocked(); } | 0 |
@EventHandler(priority = EventPriority.HIGHEST)
public void onBreak(BlockBreakEvent e) {
long time = System.nanoTime();
if (BlockTools.isSign(e.getBlock())) {
this.plugin.getLoggerUtility().log("Block is sign", LoggerUtility.Level.DEBUG);
if (((Sign) e.getBlock().getState()).getLine(0).equalsIgnoreCase("[" +... | 6 |
@Override
public String toString() {
return "ImageMap [" + (name != null ? "name=" + name + ", " : "")
+ (src != null ? "src=" + src + ", " : "")
+ (dimension != null ? "dimension=" + dimension + ", " : "")
+ "]";
} | 3 |
@Id
@Column(name = "FUN_CEDULA")
public Long getFunCedula() {
return funCedula;
} | 0 |
private static BufferedImage delegateRendering(Algebra algebra) {
if(algebra instanceof Equation) return renderEquation((Equation)algebra);
else {
BufferedImage rendered = null;
if(algebra instanceof Expression) rendered = renderExpression((Expression)algebra);
else if(algebra instanceof Term) rendered = r... | 7 |
public static int romanToInt(String s) {
Character[] metric = {'I','V','X','L','C','D','M'};
int[] a = {1,5,10,50,100,500,1000};
Map<Character, Integer> smap = new HashMap<Character, Integer>();
for (int i = 0; i < metric.length; i++) {
smap.put(metric[i], a[i]);
}
int res = 0;
for (int i = 0; i < s.le... | 4 |
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Main frame = new Main();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
} | 1 |
public PolyLinje[] sortPolylinjer(PolyLinje[] randomPolylinje) throws NullPointerException
{
int antalGula = 0;
// Räknar antalet gula Polylinjer av dem slump-
// mässigt genererade.
for(int i = 0; i < randomPolylinje.length; i++)
{
if(randomPolylinje[i].getFarg() == "gul")
{
antalGula++;
}
... | 5 |
public static List<Field> outVars(Class<?> comp) {
List<Field> f = new ArrayList<Field>();
for (Field field : comp.getFields()) {
Out out = field.getAnnotation(Out.class);
if (out != null) {
f.add(field);
}
}
return f;
} | 3 |
public void setComponents(double[][] values) {
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
m[i][j] = values[i][j];
} | 2 |
public List<Event> getPickingInfo(String picikingId) {
List<Event> events = new ArrayList<Event>();
for (Event e : eventLog) {
EventType type = e.getEventType();
String picId = splitMetaData(e.getMetaData())[0];
if (picId.equals(picikingId)) {
if (type == EventType.NEW_PICKING
|| type == EventT... | 5 |
private boolean checkSetting() {
if (DoSetting.tmpUserName.getText().isEmpty())
return false;
if (new String(DoSetting.tmpPassWord.getPassword()).isEmpty())
return false;
if (DoSetting.tmpKeyPath.getText().isEmpty())
return false;
if (DoSetting.tmpHostName.getText().isEmpty())
return false;
if (Do... | 6 |
protected void demo17() throws IOException, UnknownHostException, CycApiException {
if (cycAccess.isOpenCyc()) {
Log.current.println("\nThis demo is not available in OpenCyc");
}
else {
Log.current.println("Demonstrating usage of the generateDisambiguationPhraseAndTypes api function.\n");
... | 1 |
public void save()
{
try
{
File file = new File(this.absoluteFileName);
DocumentBuilderFactory factory = DocumentBuilderFactory
.newInstance();
factory.setNamespaceAware(true);
Document document = factory.newDocumentBuilder().newDocument();
Element unisensElement = this.createElement(document)... | 7 |
protected void appendImage(String text) {
String[] link=split(text, '|');
URI uri=null;
try { // validate URI
uri=new URI(link[0].trim());
}
catch (URISyntaxException e) {
}
if (uri!=null && uri.isAbsolute() && !uri.isOpaque()) {
String alt=escapeHTML(unescapeHTML(link.length>=2 ... | 6 |
public int getPort() {
return this.port;
} | 0 |
@Override
public void run() {
while (true) {
player.update();
currentSprite = anim.getImage();
if (playerState == PlayerState.Combat) {
if (!player.getLocation().combat(player)){
playerState = PlayerState.Dead;
} else playerState = PlayerState.Alive;
}
else if (player.getLocation().is... | 7 |
public int NumberParser(String str){
// Parses valid number for different formats from Strings
// used for parsing numerical arguments like immediate values and
// address jumps and memory initializations
int x=0;
String temp="";
if(str.length()>2)
temp=str.subs... | 9 |
public boolean equals( Object other )
{
Match m = ((Match)other);
if ( m.length == this.length
&& this.data != null
&& ((Match)other).data != null )
{
for ( int i=0;i<length;i++ )
{
if ( m.data[i] != this.data[i] )
return false;
}
return true;
}
return false;
} | 5 |
public Icon loadIconIfNonEmpty(String url) {
if (url != null && !url.isEmpty()) {
try {
return ImageSupporter.loadImageIcon(url);
} catch (MalformedURLException ignored) {}
}
return null;
} | 3 |
public static void testVersion(boolean testIfEnabled, boolean displayIfVersionMatch) {
displayIfOK = displayIfVersionMatch;
if(isRunning) {
return;
}
if(testIfEnabled) {
if(!AppConfig.getAppConfig().checkForSinalgoUpdate) {
return;
}
long last = AppConfig.getAppConfig().timeStampOfLastUpdateChec... | 4 |
public static void main(String[] args)
{
int a = 3;
int c = 0;
/**
* if b = 0;
* Exception in thread "main" java.lang.ArithmeticException: / by zero
* at exceptionTest.ExceptionTest.main(ExceptionTest.java:10)
*/
try{
int b = 0;
System.out.println("From Main Before!");
c = a / b;
}
... | 1 |
public void saveCache() throws IOException {
if (xmlFile != null)
synchronized (doc) {
try (OutputStream outStream = Files.newOutputStream(xmlFile)) {
outputter.output(doc, outStream);
}
}
} | 1 |
public boolean chooseOptionFromMenu() {
int userChoice= Program.getUserInput();
if (userChoice == 1) {
Program.displayBookList();
}
else if (userChoice == 2) {
user.reserveBook();
}
else if (userChoice == 3) {
if (User.loggedIn()) {
... | 7 |
protected synchronized WebPage processHtml(final String url, final int depth) //
throws ParserException, Exception {
this.cobweb.addSearchedSites(url);
//
Parser parser = new Parser();
parser.setURL(url);
URLConnection uc = parser.getConnection();
uc.connect();
//
WebPage wp = new WebPage();
wp.setDe... | 1 |
private void setupKeys(EntityRegistry registry) {
// for (Field f : keyRegistry.getDeclaredFields()) {
// FieldId ann = f.getAnnotation(FieldId.class);
// if (ann != null) {
// Object okey;
// try {
// okey = f.get(TKey.class);
// ... | 7 |
@Override
public boolean equals(Object obj) {
if (!(obj instanceof ByteOrderMark)) {
return false;
}
ByteOrderMark bom = (ByteOrderMark)obj;
if (bytes.length != bom.length()) {
return false;
}
for (int i = 0; i < bytes.length; i++) {
... | 4 |
public void SetNumebrOfPackets(int packets)
{
NumberOfPackets = packets;
//UDarray = new int[NumberOfPackets];
} | 0 |
public void mouseMoved(MouseEvent e) // used to show where the piece will be placed
{
for (Square[] a : squares)
{
for (Square s : a)
{
if (s.rect.contains(e.getPoint()))
{
x = s.x + 40;
y = s.y + 40;
}
}
}
} | 3 |
private boolean importFile() {
File lastFile = fileChooser.getSelectedFile();
boolean success = false;
final Frame frame = JOptionPane.getFrameForComponent(this);
fileChooser.setAcceptAllFileFilterUsed(false);
fileChooser.addChoosableFileFilters(new String[] { "html", "txt" });
fileChooser.setDialogType(JFi... | 8 |
private void printBoard(Board board, Engine engine)
{
//System.out.println("Current Board:");
// Print Header
System.out.println(" X ");
System.out.println(" 0|1|2");
// Iterate over the rows, y.
for (int y=0; y<3; y++)
{
... | 3 |
public void loadFromObject() { try {
if (cls==null) return;
for (int i=0; i<fields.size(); i++) {
String fieldname = (String)fields.get(i);
String fieldtype = (String)fieldtypes.get(fieldname);
//System.out.println("<field "+fieldname+" "+fieldvalue);
if (fieldtype.equals("key")
|| fieldtype.equals(... | 9 |
@Override
public void registerToken(NotificationToken token) {
String logData = "";
if (token.getType() == null) { // result
logData += "Result of access request:\n";
logData += "Time: "+token.getTimestamp()+"\n";
logData += "Controller: "+token.getController()+"\n";
logData += "AccessPoint: "+token.ge... | 3 |
public void setjTextFieldMotifVis(JTextField jTextFieldMotifVis) {
this.jTextFieldMotifVis = jTextFieldMotifVis;
} | 0 |
private void constraint_31A() throws IOException {
for (int k = 1; k <= NUM_VARS; k++) {
for (int m = 1; m <= SQUARE_SIZE; m += 3) {
for (int n = 1; n <= SQUARE_SIZE; n += 3) {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
... | 5 |
private static String[] getInitialData() {
File file = new File(INPUT_FILE_NAME);
if (!file.exists()) {
return InitialDataGeneratorHelper.
generateInitialData(DEFAULT_TOWERS_NUMBER, DEFAULT_CALLS_NUMBER);
}
String[] result = new String[2];
try (Bu... | 4 |
private void initialize(Header header)
throws DecoderException
{
// REVIEW: allow customizable scale factor
float scalefactor = 32700.0f;
int mode = header.mode();
int layer = header.layer();
int channels = mode==Header.SINGLE_CHANNEL ? 1 : 2;
// set up output buffer if not set up by client.... | 3 |
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.