text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void testParseInto_simple() {
MutableDateTime expect = null;
expect = new MutableDateTime(2004, 6, 9, 11, 20, 30, 0, LONDON);
MutableDateTime result = new MutableDateTime(0L);
assertEquals(20, g.parseInto(result, "2004-06-09T10:20:30Z", 0));
assertEquals(expect, result);
... | 1 |
private static void checkedException() {
FileOutputStream out = null;
try {
out = new FileOutputStream(new File("/tmp/file.txt"));
System.out.println("File opened");
} catch (FileNotFoundException e) {
e.printStackTrace();
} finally {
try {
out.close();
} catch (IOException e) {
e.printSt... | 2 |
private ASPlayer setLastActivity(ASPlayer data, TableType table, int value) {
switch(table) {
case DAY: data.lastDay.activity = value;
break;
case WEEK: data.lastWeek.activity = value;
break;
case MONTH: data.lastMonth.activity = value;
break;
default: plugin.severe("Invalid Type in setLastActivity")... | 3 |
private static Connection innitializeDB(String URL, final String TABLES)
{
Statement stmt = null;
Connection conn = null;
try
{
conn = DriverManager.getConnection(URL);
}
catch (SQLException e)
{
e.printStackTrace();
}
try
{
stmt = conn.createStatement();
}
catch (SQLExce... | 3 |
public void actionPerformed(ActionEvent e)
{
if (e.getSource() == trocaMusica)
{
//System.out.println("Entrou aqui");
if (m_flagPlayStop){
somDaMensagem.interrupt();
m_flagPlayStop = false;
}
else
{
somDaMensagem = new ExecutarSom( "musicas/hedwigsTheme.wav"... | 8 |
@Override
public Individual getParent(List<Individual> population) throws Exception{
Random rand = new Random();
List<Individual> local = new ArrayList<Individual>();
Individual best = null;
//Form the sample group
while(local.size() < tournamentSize){
int random ... | 7 |
protected void handleEvilPopupMgrBackup() {
if (RegKey.POPUP_MGR.type != null) return;
// this will return String (REG_SZ), int (REG_DWORD), or null if the key is missing
RegKey.POPUP_MGR.type = WindowsUtils.discoverRegistryKeyType(RegKey.POPUP_MGR.key);
Class<?> backupPopupMgrType = discov... | 8 |
private void begin () {
long t__send, dt;
double rate;
_t_send = System.currentTimeMillis();
while (++times <= Utils.MAX) {
broadcast("TEST", String.format("%d", System.currentTimeMillis()));
if (times % Utils.STEP == 0) {
t__send = System.currentTimeMillis();
dt = t__send - _t_send;
if (dt > 0)
... | 3 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Positie positie = (Positie) o;
if (x != positie.x) return false;
if (y != positie.y) return false;
return true;
} | 5 |
private void connectToServer() {
if(iptf.getText().equals(""))
{
JOptionPane.showMessageDialog(SwitchServerWindow.this, "The IP can't be blank!", "Error", JOptionPane.ERROR_MESSAGE);
}else
{
if(connect == null || !connect.isAlive()) {
connect = new Thread( new Runnable() {
@Override
pu... | 5 |
public void visitLocalExpr(final LocalExpr expr) {
// Determines whether or not the LocalExpr in question is the this
// pointer. If the LocalExpr resides within an InitStmt, and the
// LocalExpr is the first variable defined by the InitStmt, it is
// the this pointer.
if (thisPtr != null) {
return;
}
... | 5 |
String arrayName(String component, int dims) {
// Using char[] since we have no StringBuilder in JDK4, and StringBuffer is slow.
// Although, this is more efficient even if we did have one.
int i = component.length();
int size = i + dims * 2;
char[] string = new char[size];
... | 1 |
@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 CcsTest)) {
return false;
}
CcsTest other = (CcsTest) object;
if ((this.id == null && other.id != null) || (thi... | 5 |
@Override
public boolean touchRobot() {
boolean touch = false;
for (int i = 0; i < Board.robots.size(); i++) {
if (Board.robots.get(i) != this.owner) {
ArrayList<Line2D.Double> linies = Board.robots.get(i).getBoundLines();
for (int j = 0; j < linies.size(... | 5 |
public static ChunkyWorld getChunkyWorld(String worldName) {
ChunkyObject object = getObject(ChunkyWorld.class.getName(), worldName);
if (object == null) {
World world = Bukkit.getServer().getWorld(worldName);
if (world != null) {
object = new ChunkyWorld();
... | 2 |
public void run() {
int here = monitor.stop();
while (true) {
liftView.moveLift(here, monitor.move());
here = monitor.stop();
}
} | 1 |
public static boolean simulate(double height, double v, double angle, double maxX, double[] targetY){
if(parameterCheck(height, v, angle, maxX, targetY)==false){//is the input bad?
return false;//stop
}
y0 = height;
v0 = v;
a = angle;
targetX = maxX;
h... | 9 |
public static void main(String[] args){
Boat.createBoat("RaceBoat");
Boat boat = Boat.getInstance();
try{
System.out.println("Setting sail to 0 degrees.");
boat.com.sendMessage("set sail 0");
Thread.sleep(5000);
for(int i = 10; i <= 360; i += 10){
System.out.print("Setting sail to " +i+" degrees.... | 2 |
public static StandardUnit addStandardUnit(String name, String typeName, String systemName, double factorToReference) {
StandardUnit createdUnit = null;
if(!listUnits.containsKey(name) && listTypes.containsKey(typeName) && listSystems.containsKey(systemName)) {
Type... | 4 |
public static void loadNewsInfo() throws IOException {
checkUSB();
System.out.println("start to load news info from usb");
String rootPath = USBConfig.drivePath;
String initnewFolder = rootPath + USBConfig.INI_NEW_FOLDER + "\\";
File folder = new File(initnewFolder);
if(!folder.exists()){
folder.mkdirs()... | 5 |
public void setFacOracleDAO(FacOracleDAO casurOracleDAO) {
this.facOracleDAO = casurOracleDAO;
} | 0 |
@Override
public boolean isCellEditable(int row, int col) {
return false;
} | 0 |
private void makePack(List<Card> cardList) {
for (Card.Suit suit : Card.Suit.values()) {
for (Card.Rank rank : Card.Rank.values()) {
cardList.add(new Card(suit, rank));
}
}
} | 2 |
@Override
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) {
if (ELEMENT_PROPERTY.equals(qName)) {
try {
String class_name = atts.getValue(ATTRIBUTE_CLASS);
String property_name = atts.getValue(ATTRIBUTE_NAME);
String property_value = atts.getValue(A... | 8 |
public int compareTo(Object o) {
return (equals(o) ? 0 : -1);
} | 1 |
protected Class getClass(final Type t) {
try {
if (t.getSort() == Type.ARRAY) {
return Class.forName(t.getDescriptor().replace('/', '.'),
false,
loader);
}
return Class.forName(t.getClassName(), false, loader);
... | 2 |
@Override
public boolean isTypeOf(Property p) {
if(p==null)
return true;
if(equals(p))
return true;
return this.superType.isTypeOf(p);
} | 2 |
public static void readTemplates(String fileName, boolean resampledFirst, ArrayList<Template> templates){
try {
Scanner sc = new Scanner(new File(fileName));
String curTemplate = "";
ArrayList<Point> curPoints = null;
while(sc.hasNext()){
String cur = sc.next();
if(cur.charAt(0) == '#'){
i... | 9 |
boolean checkMyType(Object object) {
if (object == null || !(object instanceof MyType[]) || ((MyType[])object).length == 0) return false;
MyType[] myTypes = (MyType[])object;
for (int i = 0; i < myTypes.length; i++) {
if (myTypes[i] == null ||
myTypes[i].firstName == null ||
myTypes[i].firstName.length() =... | 9 |
@Override
public Grid clone() {
Grid ret = new Grid(width, height, intelligentX, intelligentY, targetX,
targetY);
ret.setCurrentCells(Arrays.copyOf(currentCells, currentCells.length));
for (Integer i : intellingentMovementHistory) {
ret.getIntellingentMovementHistory().add(i);
}
return ret;
} | 1 |
public void commandAction(Command command, Displayable displayable) {
String commandLabel = command.getLabel();
try {
if (PlaygroundApp.ROOM_SELECTED_COMMAND.equals(commandLabel)) {
launchRoomScreen();
} else if (PlaygroundApp.TURN_ON_LIGHT_COMMAND.equals(commandL... | 7 |
private BufferedImage process(BufferedImage old) {
int w = old.getWidth();
int h = old.getHeight();
BufferedImage img = new BufferedImage(
w, h, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = img.createGraphics();
g2d.drawImage(old, 0, 0, n... | 7 |
public boolean removerDependente(String nomeDependente){
for(String d: dependentes){
if( d.equalsIgnoreCase(nomeDependente) ){
dependentes.remove(nomeDependente);
return true;
}
}
return false;
} | 2 |
public List<Integer> getFrequents(int[] nums)
{
// Find all the high frequency candidates
for (int num : nums)
{
Integer count = counters.get(num);
if (count != null) {
// If it's one of the counters, increment
counters.put(num, ++count... | 8 |
public static Filter annotatedWithType( Class<? extends Annotation> annotationType )
{
if ( annotationType == null )
{
throw new IllegalArgumentException( "Parameter 'annotationType' must not be null" );
}
checkForRuntimeRetention( annotationType );
return new A... | 2 |
@Override
public void learnNetworkRules(List<Pair> learningDataset, int startRuleNum,
int endRuleNum, int epochPerRule) {
double smallestError = 0;
int bestRuleCount = 0;
for (int r = startRuleNum; r <= endRuleNum; r++) {
createRules(r);
double iterError = 0;
System.out.println("=======... | 4 |
public void set_Intcon_value(int s) {
if ((s & 0b00000001) == 1) {
label_58.setText("1");
} else {
label_58.setText("0");
}
if ((s & 0b00000010) == 2) {
label_57.setText("1");
} else {
label_57.setText("0");
}
if ((s & 0b00000100) == 4) {
label_56.setText("1");
} else {
label_56.setTex... | 8 |
public int addLoadParameters(CtClass[] params, int offset) {
int stacksize = 0;
if (params != null) {
int n = params.length;
for (int i = 0; i < n; ++i)
stacksize += addLoad(stacksize + offset, params[i]);
}
return stacksize;
} | 2 |
private static String changeFirstCharacterCase(String str, boolean capitalize) {
if (str == null || str.length() == 0) {
return str;
}
StringBuilder sb = new StringBuilder(str.length());
if (capitalize) {
sb.append(Character.toUpperCase(str.charAt(0)));
}
else {
sb.append(Character.toLowerCase(str.... | 3 |
@Override
public void run() {
while(true){
if(engine.getSide().equalsIgnoreCase("None")){
serverTick();
clientTick();
}
else if(engine.getSide().equalsIgnoreCase("Client")){
clientTick();
}
else if(engine.getSide().equalsIgnoreCase("Server")){
serverTick();
}
try {
Thr... | 5 |
@Override
//Quick and dirty implementation, needs some hard revision
public AbstractStochasticLotSizingSolution solve(
AbstractStochasticLotSizingProblem problem, boolean[] setupPattern)
throws SolvingInitialisiationException,
ConvolutionNotDefinedException {
//Check inputs
if (problem.getPeriods().le... | 6 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public void processMouseEvent(MouseEvent event) {
transformMouseEvent(event);
super.processMouseEvent(event);
} | 0 |
boolean isAttackPlaceHorizontallyRightNotHarming(int position, char[] boardElements, int dimension, int rightPosition) {
while (rightPosition > 0) {
if (isPossibleToPlaceRight(position, dimension, rightPosition)
&& isBoardElementAnotherFigure(boardElements[position + rightPositio... | 3 |
public LinkedList<Integer> searchForPattern(String pattern, String context) {
LinkedList<Integer> foundPatternList = new LinkedList<Integer>();
int patternLength = pattern.length(); int contextLength = context.length();
for(int contextIndex = 0; contextIndex <= contextLength - patternLength; contextIndex++) {
... | 4 |
public void visitForceChildren(final TreeVisitor visitor) {
if (visitor.reverse()) {
target.visit(visitor);
}
for (int i = 0; i < operands.size(); i++) {
final LocalExpr expr = (LocalExpr) operands.get(i);
expr.visit(visitor);
}
if (!visitor.reverse()) {
target.visit(visitor);
}
} | 3 |
public static void weekPrediction(String inputFile) throws FileNotFoundException, IOException{
String line, season = null, jornada = null;
ArrayList<String> matchs1 = new ArrayList<>();
ArrayList<String> matchs2 = new ArrayList<>();
Boolean primera = false, segunda = false;
... | 8 |
public static Throwable unwrap(Throwable e) {
Throwable unwrapp = e;
while (true) {
if (unwrapp instanceof InvocationTargetException) {
unwrapp = ((InvocationTargetException) unwrapp).getTargetException();
} else if (unwrapp instanceof UndeclaredThrowableException) {
unwrapp = ((UndeclaredThrowableEx... | 3 |
private int evalRPNHelper( List<String> los ){
// trivial case
if ( los.size() == 1 ) {
return Integer.parseInt(los.get(0));
}
// non trivial case
// 1. process the los
List<String> ret = new ArrayList<>();
int i = 2; // index
while ( i < los.size() ){
if ( isOperator( los.get(i)) ){
... | 3 |
public void readAndParse() throws IOException
{
String currentLine;
int i = 0;
Map<Character,Set<Tile>> layoutToUse = wholeLayout1;
try{
while((currentLine = cleanLine(lineReader.readLine())) != null)
{
if(currentLine.length() > 0)
{
if(currentLine.charAt(0) == '*' && layoutToUse == wholeLay... | 7 |
public EncryptedDataType getEncryptedValue() {
return encryptedValue;
} | 0 |
public void Logar() {
//cria duas variaveis para receber os dados de login do usuario
String login = txtLogin.getText();
String Senha = txtSenha.getText();
//Verifica se a senha digitada estar cadastrada no banco de forma criptografada
//hash sha-256
criptografiaUtil cr... | 2 |
private void fireNewPeerConnection(Socket socket, byte[] peerId) {
for (IncomingConnectionListener listener : this.listeners) {
listener.handleNewPeerConnection(socket, peerId);
}
} | 1 |
public void setPlayer1Name(JLabel label) {
boolean test = false;
if (test || m_test) {
System.out.println("Drawing :: setPlayer1Name() BEGIN");
}
m_player1Name = label;
if (test || m_test)
System.out.println("Drawing:: setPlayer1Name() - END");
} | 4 |
public void run() {
// Make the initial map data, convert to PIT format
String parts[] = gameData.split("\\|");
String planets[] = parts[0].split(":");
String planetData[];
StringBuilder map = new StringBuilder();
StringBuilder planet;
for (String p : planets) {
planetData = p.split("\... | 7 |
public boolean chunkExists(int par1, int par2)
{
if (!this.canChunkExist(par1, par2))
{
return false;
}
else if (par1 == this.lastQueriedChunkXPos && par2 == this.lastQueriedChunkZPosition && this.lastQueriedChunk != null)
{
return true;
}
... | 6 |
public int getNumberOfZombie(){
int res = 0;
for (Being being: beings){
if (being.isZombie()){
res++;
}
}
return res;
} | 2 |
public URIMatcher setPort(Integer port) {
this.port = port==null?null:(port <= NO_PORT ? NO_PORT : port);
return this;
} | 2 |
public LocalInfo getLocalInfo() {
if (shadow != null) {
while (shadow.shadow != null) {
shadow = shadow.shadow;
}
return shadow;
}
return this;
} | 2 |
@Override
public synchronized void addReliable(int connectPort) throws RemoteException {
try {
ServentDescriptor elem = new ServentDescriptor(InetAddress.getByName(RemoteServer.
getClientHost()), connectPort, 0);
boolean found = false;
for (int i = 0; i < reliableServents.size(); i... | 7 |
public String getSort() {
return sort;
} | 0 |
@Override
public <E extends ApiResponse> E execute(ApiRequest request, AbstractContentHandler contentHandler, Class<E> clazz) throws ApiException {
ApiConnector connector = getConnector();
URL url = connector.getURL(request);
Map<String, String> params = connector.getParams(request);
InputStream inputStream = ... | 3 |
public void paintExpression(Graphics g, Expression e, double xmid, double xfactor, double ymid, double yfactor) throws UnresolvedNameException {
HashMap<String, Double> h = new HashMap<String, Double>();
double lastX = 0, lastY = 0;
boolean hasBegan = false;
for (double x = xbl; x < xbh... | 6 |
private void eltran(double[][] a, double[][] zz, int[] ordr, int n)
{
int i, j, m;
for (i = 0; i < n; i++)
{
for (j = i + 1; j < n; j++)
{
zz[i][j] = 0.0;
zz[j][i] = 0.0;
}
zz[i][i] = 1.0;
}
if (n <= 2)
{
return;
}
for (m = n - 1; m >= 2; m--)
{
for (i = m; i < n; i++)
{... | 7 |
protected void readChild(XMLStreamReader in) throws XMLStreamException {
if (in.getLocalName().equals(Colony.getXMLElementTagName())) {
settlement = updateFreeColGameObject(in, Colony.class);
} else if (in.getLocalName().equals(IndianSettlement.getXMLElementTagName())) {
settleme... | 9 |
OutputInformation report_table_layout() {
OutputInformation infos = new OutputInformation();
infos.add_parameter("V", "discretization", discretizer);
if (predefinedFirstThreshold == null || predefinedSecondThreshold == null) {
infos.add_parameter("P", "requested P-value", pvalue);
}
if (prede... | 5 |
public static void main(String[] args)
{
Scanner input = new Scanner(System.in); //fuori dal try
input.useLocale(Locale.US);
boolean done = false;
while(done!=true)
{
try
{
// Scanner input = new Scanner(System.in); //nel try
// input.useLocale(Locale.US);
/* perchè quando catturo InputMismatch... | 3 |
public void printTransactions(boolean writeHeader, String fileNameTransactions){
try{
String outputFileName = folder + fileNameTransactions;
FileWriter writer = new FileWriter(outputFileName, true);
if (writeHeader){
writer.write("moHFT;mo;loHFT;lo;tradeTime;F... | 8 |
public static int returnMax(int[] arr, int start, int end, int n) {
int mid = start + (end - start) / 2;
// only one element
if (mid == 0 && mid == n - 1)
return mid;
if ((mid == 0 || arr[mid - 1] <= arr[mid])
&& (mid == n - 1 || arr[mid + 1] <= arr[mid]))
... | 8 |
@Override
public void run() {
while(running) {
try {
String s = reader.readLine();
if(s != "" && s != null) {
Log.info(s);
Message m = new Message(s);
m.parse();
}
} catch (IOException e) { Log.error(e); }
}
} | 4 |
public static void main(String args[]) {
String filename;
File f;
if (args.length == 1) {
f = new File(args[0]);
try {
parser = new LogoParser(new java.io.FileInputStream(f));
} catch (java.io.FileNotFoundException e) {
e.prin... | 9 |
@Override
public void e(float sideMot, float forMot) {
if (this.passenger == null || !(this.passenger instanceof EntityHuman)) {
super.e(sideMot, forMot);
this.W = 0.5F; // Make sure the entity can walk over half slabs,
// instead of jumping
return;
}
EntityHuman human = (EntityHuman) this.passe... | 8 |
protected Object getPrimitive(Element node) throws Exception {
Object result;
Object tmpResult;
Class cls;
cls = determineClass(node.getAttribute(ATT_CLASS));
tmpResult = Array.newInstance(cls, 1);
if (cls == Boolean.TYPE)
... | 8 |
public void setAccessToken_secret(String accessToken_secret) {
this.accessToken_secret = accessToken_secret;
} | 0 |
public String getYearStr() {
if (year <= 0) {
return "";
}
return String.valueOf(year);
} | 1 |
public void clearProxies() {
for (OutlineProxy proxy : mProxies) {
mModel.removeListener(proxy);
}
mProxies.clear();
} | 1 |
public String toMachineString() {
String machineString;
if (OPCODE.getValue() == 13 || OPCODE.getValue() == 10) { //For HALT and SKZ instructions with no fields
return OPCODE.toString();
}
if (OPCODE.getValue() > 7 && OPCODE.getValue() < 10) { //For branch instructions with only one field
machineString... | 4 |
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
final InputStream license = OverMapped.class.getResourceAsStream("/COPYING.HEADER.TXT");
if (license != null) {
try {
getLog().info(new String(ByteStreams.toByteArray(license), "UTF8"));
} catch (final IOException ex) {... | 6 |
@EventHandler(ignoreCancelled = true)
public void onInventoryClick(InventoryClickEvent e) {
HumanEntity human = e.getWhoClicked();
if(!(human instanceof Player)) {
return;
}
Player p = (Player)human;
Dodgeball m;
if((m = mm.getPlayerMinigame(p.getName())) ... | 2 |
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new FileReader("msched.in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("msched.out")));
StringTokenizer st = new StringTokenizer(br.readLine());
int n = Integer.pars... | 9 |
public static void main(String[] args) {
int n = 20;
for(int j = 1; j < MAX_NUMCHANGE; j++){
for(double eP = 0.5; eP < 1; eP+=.1){
eP = ((double)(Math.round(eP * 10)) / 10);
int sig = 0; int before = 0; int total = 0; long start = System.currentTimeMillis();
System.out.println("eP: " + eP + " numCha... | 8 |
public boolean isBypassable(Player player) {
String name = player.getDisplayName();
if (owner == null) {
Citadel.severe(String.format("isBypassable(%s) encountered unowned reinforcement: %s",
name, toString()));
sendMessage(player, ChatColor.RED, "This ... | 3 |
@RequestMapping(value = "/uploadFile.vpage", method=RequestMethod.POST)
String uploadFile(@RequestParam("filedata") MultipartFile file,Model model,
HttpServletResponse response) throws IOException {
String originalFileName = file.getOriginalFilename();
String contentType = file... | 7 |
public void updateEffects() {
for(int var1 = 0; var1 < 4; ++var1) {
for(int var2 = 0; var2 < this.fxLayers[var1].size(); ++var2) {
EntityFX var3 = (EntityFX)this.fxLayers[var1].get(var2);
var3.onUpdate();
if(var3.isDead) {
this.fxLayers[var1].remove(var2... | 3 |
public void analyzeIdentifier(Identifier ident) {
if (ident == null)
throw new NullPointerException();
toAnalyze.add(ident);
} | 1 |
public void play() throws IOException {
String response;
if (isMultiplayer) {
while (true) {
response = in.readLine();
if (response.startsWith("LEGAL_MOVE")) {
currentButton.setText(team);
} else if (response.startsWith("... | 9 |
@Override
public void deserialize(Buffer buf) {
presetId = buf.readByte();
if (presetId < 0)
throw new RuntimeException("Forbidden value on presetId = " + presetId + ", it doesn't respect the following condition : presetId < 0");
symbolId = buf.readByte();
if (symbolId < ... | 3 |
protected int[] determineIndices(int numAttributes) throws Exception {
int[] result;
Vector<Integer> list;
int i;
StringTokenizer tok;
String token;
String[] range;
int from;
int to;
list = new Vector<Integer>();
// parse range
tok = new StringTokenizer(m_N... | 7 |
private String preMakeRoom(javax.swing.JTextArea Area) {
String bs = "";
int act = Area.getCaretPosition();
try {
String ant = Area.getText(act - 1, 1);
if (!ant.equalsIgnoreCase("\n")) {
bs = "\n";
}
} catch (BadLocationException ex) {... | 2 |
public static void main(String[] args) {
try {
Logger logger = LoggerFactory.newLogger(LoggerFactory.CONSOLE);
logger.connect();
logger.log("test message #1");
logger.disconnect();
} catch (CannotConnectException cce) {
System.err.println("cannot connect to console-based logger");
} catch (NotConne... | 6 |
public pair ge_add_expression(TextArea area,SimpleNode node,String prefix)throws SemanticErr{
SimpleNode left = (SimpleNode) node.jjtGetChild(0);
int ex_num = node.jjtGetNumChildren();
if(ex_num==1)
return ge_mul_expression(area, left, prefix);
else {
pair left_p... | 4 |
private ArrayList<Integer> getNineInvertedDigits(int value) {
ArrayList<Integer> result = new ArrayList<Integer>();
if (value == 0)
result.add(0);
else
while (value > 0) {
int digit = value % 9;
result.add(digit);
value = va... | 2 |
public boolean equals(Object other) {
// standard two checks for equals()
if (this == other) return true;
if (!(other instanceof TPoint)) return false;
// check if other point same as us
TPoint pt = (TPoint)other;
return(x==pt.x && y==pt.y);
} | 3 |
public void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException
{
//String st=request.getParameter("name");
//int i=Integer.parseInt(st);
String str=request.getParameter("name");
/*String str1=request.getParameter("option1");
String str2=request.getParameter(... | 2 |
private static boolean isAlnumUline(char ch){
if(ch > 'a' && ch < 'z' || ch > 'A' && ch < 'Z' || ch > '0' && ch < '9' || ch == '_'){
return true;
}
return false;
} | 7 |
public String formatOrganization_name(String value) {
String[] delimiterlist = {" ", "-", "_", "'", "."};
String[] abbreviationlist = {"ag", "bvba", "cv", "cvba", "cvoa", "esv", "nv", "pvba", "vzw"};
boolean first = true;
boolean afterdelimiter = false;
int index = 0;
Str... | 9 |
private void drawNode(No no, Graphics g) {
g.drawRoundRect(no.getX(), no.getY(), no.computeSize(), hNo, 25, 25);
if (no==busca){
int pos=0;
for(int i=0 ; i < no.getN() ; i++){
if(no.getChave().get(i)==keyBusca)
pos=i;
}
... | 7 |
public void plot(ArrayList<DatasetPattern> dataset,ArrayList<Cluster> clusters){
XYSeriesCollection datasetCollection = new XYSeriesCollection();
for (int i = 0; i < clusters.size(); i++) {
Cluster c = clusters.get(i);
if(!c.getIsActive()) continue;
ArrayList<DenseRegion> regions = c.getRegions();
... | 6 |
public boolean match(String pattern)
{
Queue<Entry<String, NfaNode>> queue = new LinkedList<>();
queue.addAll(start.getAllTransitions());
if (finalStates.contains(start) || epsilonTransitionsToFinal(start))
queue.add(createEntry("~", start));
Entry<String, NfaNod... | 9 |
private static String formatTime(long time){
// Given time in seconds.
int sec = (int)(time / Framework.milisecInNanosec / 1000);
// Given time in minutes and seconds.
int min = sec / 60;
sec = sec - (min * 60);
String minString, secString;
if(min <= 9)
... | 2 |
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.