text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public boolean equals(Object obj) {
if (obj == this)
return true;
if(!(obj instanceof Operation))
return false;
Operation op = (Operation) obj;
return (operation.equals(op.getString()) && timeStamp == op.gettimeStamp());
} | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Picture other = (Picture) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
... | 9 |
@SuppressWarnings("unchecked")
<T> T getArrayForType(Class<? extends T> type) {
if (!type.isArray()) {
throw new IllegalArgumentException("Not an array type");
}
Class cType = getArrayBaseType(type);
Object o = new Parser(co.get(key(String.class, cType))).parse(0,
layout, types(dims, cType));
... | 3 |
@Override
public Account removeAccount(User owner, Account account) {
PreparedStatement pStmt = null;
Account ac = null;
Integer result;
ac = getAccount(account.getId());
if (ac != null){
try {
pStmt = conn.prepareStatement("DELETE FROM ACCOUNT WHERE user_login = ? AND id = ?;");
... | 3 |
public void mouseUp(MouseEvent e, int x, int y) {
// ask the associated board figure to perform its associated action based
// upon the coordinates of mouse down and mouse up (move or click)
if ( clickedFigure != null ) {
boolean valid = clickedFigure.performAction(fStartX, fStartY,
... | 5 |
public void volverCero(){
if(Calendar.getInstance().get(Calendar.MONTH) != mes || Calendar.getInstance().get(Calendar.YEAR) != anio){
mes = Calendar.getInstance().get(Calendar.MONTH);
anio = Calendar.getInstance().get(Calendar.YEAR);
for(beansMiembro miembro : miembros){
miembro.setEgresos(0);
miemb... | 3 |
public void layoutContainer(Container target) {
synchronized (target.getTreeLock()) {
Insets insets = target.getInsets();
int top = insets.top;
int bottom = target.getHeight() - insets.bottom;
int left = insets.left;
int right = target.getWidth() - insets.right;
int centerWidth = 0;
int centerHei... | 5 |
private int getClusterInPlot(int x, int y) {
int clusterId = -1;
float xInPixels, yInPixels, radiusInPixels;
double dist, smallerRadius = Double.MAX_VALUE;
ChartItem clusterItem;
for (Integer id : ChartData.getAllIds()) {
clusterItem = ChartData.getItemById(id);
xInPixels = getPointXInPixels(clusterIte... | 3 |
public int compareTo( Object obj ) {
if( obj == null ) {
return( 1 );
}
else if( obj instanceof GenKbContactListByUDescrIdxKey ) {
GenKbContactListByUDescrIdxKey rhs = (GenKbContactListByUDescrIdxKey)obj;
if( getRequiredTenantId() < rhs.getRequiredTenantId() ) {
return( -1 );
}
else if( getRequ... | 9 |
public void updateItems() {
try {
String strResult = ""+(char)6,
strStore;
int i;
Item itmStore;
LifoQueue qStore;
Iterator iter=vctItems.keySet().iterator();
while(iter.hasNext()) {
qStore = (LifoQueue)vctItems.get(iter.next());
if (qStore.size() > 0) {
itmStore = (Item)qStore.fir... | 7 |
@Override
public void addEdge(N from, N to, W weight) {
if(containsNode(from) && containsNode(to) && !containsEdge(from, to)) {
nodes.get(from).add(new WeightedEdge<N, W>(from, to, weight));
if(!isDirected) {
nodes.get(to).add(new WeightedEdge<N, W>(to, from, weight));
}
}
} | 4 |
public Shoe(int numDecks) {
this.deckCount = numDecks;
this.numCards = deckCount * numDecks;
if (numDecks >= minDecks) {
for (int i = 1; i < 14; i++) {
for (int j = 1; j < 4; j++) {
Shoe.add(new Card(i, j));
}
}
} else {
throw new IllegalStateException("Minimum decks is 4");
}
Collecti... | 3 |
public CheckResultMessage checkDayofMonth() {
// clear message list
messageList.clear();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMM");
try {
Date date = dateFormat.parse(monthDate);
Calendar cal = Calendar.getInstance();
cal.setTime(date);
maxDay = cal.getActualMaximum(Calendar.D... | 7 |
public void solve(){
int m = this.y.length;
double[] w = new double[m]; // weights
Arrays.fill(w, 1.0);
double[][] D = new double[this.T][m]; // distribution of row's pure strategy
Arrays.fill(D[0], 1.0/((double)m));
double sum = 0.0;
for ( int t = 0; t < T; t++ ){
int j = getMaxJ(D[t]);
sum += g... | 4 |
public Object clone() {
try {
SimpleSet other = (SimpleSet) super.clone();
other.elementObjects = (Object[]) elementObjects.clone();
return other;
} catch (CloneNotSupportedException ex) {
throw new alterrs.jode.AssertError("Clone?");
}
} | 1 |
private static void addToVariables(Character var) throws ValidationException {
for (Character c : variables) {
if (c.equals(var)) {
return;
}
}
variables.add(var);
if (variables.size() > MAX_VARIABLES) {
throw new ValidationException("You have more than " + MAX_VARIABLES + " variables");
}
} | 3 |
public boolean isOddNumber(int num){
if(num%2 == 0)
return false;
else
return true;
} | 1 |
public WorldMap(int sizex, int sizey) {
rand = new Random();
seed = (int) (rand.nextInt(100000000) * rand.nextFloat());
System.out.println(seed);
map = new ArrayList<ArrayList<Region>>();
for (int x = 0; x < sizex; x++) {
map.add(new ArrayList<Region>());
... | 2 |
public void setEntradasIdEntrada(Entradas entradasIdEntrada) {
this.entradasIdEntrada = entradasIdEntrada;
} | 0 |
public <T> TypeAdapter<T> create(final Gson gson, final TypeToken<T> type) {
Class<?> rawType = type.getRawType();
final boolean skipSerialize = excludeClass(rawType, true);
final boolean skipDeserialize = excludeClass(rawType, false);
if (!skipSerialize && !skipDeserialize) {
return null;
}
... | 6 |
private List<Generator> test1Generators() throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
List<Generator> result = new ArrayList<>();
result.add(new NumberedStringGenerator("dim1", "dim1_key", "key"));
result.add(new IntegerGenerator("dim1", "num1", 0))... | 0 |
void pushDuskObject(DuskObject objIn)
{
synchronized(objEntities)
{
if (objIn.intLocX < 0 || objIn.intLocY < 0 || objIn.intLocX >= MapColumns || objIn.intLocY >= MapRows)
{
return;
}
DuskObject objStore;
objStore = objEntities[objIn.intLocX][objIn.intLocY];
if (objIn == objStore) // needed to... | 8 |
private final boolean method3960(boolean bool) {
int i = ((DirectxToolkit) this).anIDirect3DDevice9810.TestCooperativeLevel();
if (bool)
method3880(null, null, (byte) -68);
if (i == 0 || -2005530519 == i) {
Class53 class53 = (Class53) ((DirectxToolkit) this).anObject7919;
method3922(false);
class53.me... | 5 |
public double getKiihtyvyys2X() {
double res = 0;
if(getNappaimenTila(VASEN2)){
res -= KIIHTYVYYS;
}
if(getNappaimenTila(OIKEA2)){
res += KIIHTYVYYS;
}
return res;
} | 2 |
public static void main(String[] args) throws IOException {
String path = "C:/Users/Frede/Desktop/fehler.txt";
String file = readFile(path);
String[] lines = file.split("\n");
for(String line : lines) {
if(line.contains("konnte nicht eingetragen werden.") && line.length() > 0) {
line... | 3 |
public SudokuBoard(String inputFile) throws IOException {
BufferedReader in = null;
try {
in = new BufferedReader(new FileReader(inputFile));
String line = null;
//read in rows;
for(int i = 0; i < 9;i++) {
line = in.readLine();
//read in a row
for(int j = 0; j < 9;j++)
{
... | 4 |
public static void lerak( int[][] tabla )
{
b = 1; jatekos = 0;
while( b != 19 )
{
AktualisRajzol.rajzol(tabla);
jatekos = Jatek.melyJatekosKovetkezik(b, jatekos, 0);
sor = sc.nextLine();
if( Ellenor.ellenorLerak(sor) == false )
{
System.out.println( "Rossz formátumban adtál meg értéket... | 3 |
public boolean onlyHasSolution (){
int countWeapon =0;
int countPerson=0;
int countRoom =0;
for(Card c: seenCards){
switch (c.getType()){
case WEAPON : countWeapon++;
break;
case PERSON : countPerson++;
break;
... | 7 |
@Override
public boolean checkGrammarTree(GrammarTree grammarTree,
SyntaxAnalyser syntaxAnalyser) throws GrammarCheckException {
boolean firstLevelIsOk = this.checkFirstLevel(grammarTree);
if (!firstLevelIsOk) {
GrammarCheckException exception = new GrammarCheckException(
"Error: the sentence has mutipl... | 7 |
@Override
public void update() {
if(++updateCount >= REGEN_TIME) {
updateCount = 0;
amount++;
}
if(amount < 0) {
getWorld().removeStructure(this);
} else if(amount > SPREAD) {
Set<Tile> neighbours = new HashSet<Tile>();
Tile temp;
temp = getWorld().getTile(getX()+-1, getY());
neighbours.... | 9 |
public final void Init() throws IOException
{
Code = 0;
Range = -1;
for (int i = 0; i < 5; i++)
Code = (Code << 8 | Stream.read());
} | 1 |
public static MediaCopy getMediaCopyByMediaCopyID(int copyID){
MediaCopy mc = null;
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
... | 5 |
public File getLocalFile(URI remoteUri)
{
if (baseURL != null)
{
String remote = remoteUri.toString();
if (!remote.startsWith(baseURL))
{
return null;
}
}
StringBuilder sb = new StringBuilder();
String host = remoteUri.getHost();
String query = remoteUri.getQuery();
... | 7 |
private void verifyTargets(final Block block, final Set targets) {
Assert.isTrue(targets.size() == cfg.succs(block).size(), block
+ " has succs " + cfg.succs(block) + " != " + targets + " in "
+ block.tree().lastStmt());
final Iterator iter = targets.iterator();
while (iter.hasNext()) {
final Block t... | 1 |
@Override
public void putAll(Map<? extends String, ?> m) {
for (Map.Entry<? extends String, ?> entry : m.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
this.put(key, value);
}
} | 5 |
public void sort(ArrayList<Integer> arr) {
timeOfSorting = System.currentTimeMillis();
Random rnd = new Random();
while(true) {
boolean sorted = true;
for (int i = 0; i < arr.size()-1; i++) {
compare_count++;
if(arr.get(i) > arr.get(i+1)){
... | 5 |
private static final Hashtable createFactoryStore() {
Hashtable result = null;
String storeImplementationClass
= System.getProperty(HASHTABLE_IMPLEMENTATION_PROPERTY);
if (storeImplementationClass == null) {
storeImplementationClass = WEAK_HASHTABLE_CLASSNAME;
}
... | 5 |
private ArithmeticResult factor(Block codeBlock) throws SyntaxFormatException, IOException {
ArithmeticResult designatorResult = designator(codeBlock);
if (designatorResult != null) {
return designatorResult;
}
ArithmeticResult funcCallResult = funcCall(codeBlock);
if (funcCallResult != null) {
return ... | 5 |
public static boolean verifyPrescription(FillPrescription fillP){
if(DatabaseProcess.getDrugNames().contains(fillP.getDrugName().getText().toLowerCase())){
if(InputChecker.digits(fillP.getQuantity().getText())){
if(InputChecker.digits(fillP.getRefillCount().getText())){
if(InputChecker.dob(fillP.getFil... | 5 |
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 != null)... | 6 |
void ComputeEmissionProbsForDoc(_Doc d) {
for(int i=0; i<d.getSenetenceSize(); i++) {
_Stn stn = d.getSentence(i);
Arrays.fill(emission[i], 0);
int start = 0, end = this.number_of_topics;
if(i==0 && d.getSourceType()==2){ // first sentence is specially handled for newEgg
//get the se... | 9 |
public static boolean equals(int[][] actual, int[][] expected) {
boolean equal = true;
for (int i = 0; i < expected.length; i++) {
for (int j = 0; j < expected[i].length; j++) {
if (expected[i][j] != actual[i][j]) {
equal = false;
}
... | 3 |
public void setKind(Integer kind) {
this.kind = kind;
} | 0 |
public void update(LineEvent lineEvent) {
int clipIdx = 0;
boolean triggingClipFound = false;
while (triggingClipFound == false && clipIdx < clipAssembly.length) {
if (clipAssembly[clipIdx] == lineEvent.getSource()) {
if (lineEvent.getType() == LineEvent.Type.STOP) {... | 4 |
public void setAnnotations(Annotation[] annotations) {
ByteArrayOutputStream output = new ByteArrayOutputStream();
AnnotationsWriter writer = new AnnotationsWriter(output, constPool);
try {
int n = annotations.length;
writer.numAnnotations(n);
for (int i = 0; ... | 2 |
public Object invokeMethod(Reference ref, boolean isVirtual, Object cls,
Object[] params) throws InterpreterException,
InvocationTargetException {
if (!isVirtual && cls != null) /* XXX */
throw new InterpreterException("Can't invoke nonvirtual Method "
+ ref + ".");
Method m;
try {
String[] para... | 8 |
protected String getPokemonName(int i) {
if (getGame().getPlayer().pokeData.isCaught(i) || getGame().getPlayer().pokeData.isSeen(i)) {
return cache[i - 1].name;
}
return "-------------------";
} | 2 |
private static Packet getLoginPacket(String packet) {
Scanner sc = new Scanner(packet);
if(!sc.next().equals(Packet.PACKET_CODES.LOGIN_CMD)) return null;
Packet res = new Packet(Packet.PACKET_CODES.LOGIN_CMD);
HashMap<String, String> data = new HashMap<Strin... | 3 |
@Override
public void serialize(Date date, JsonGenerator gen, SerializerProvider provider)
throws IOException, JsonProcessingException {
String formattedDate = dateFormat.format(date);
gen.writeString(formattedDate);
} | 0 |
boolean savetodatabase(String columns[], String items[])
{
boolean errorfound = false;
String builtstatement;
Statement stmt = null;
java.sql.Connection conn = null;
java.sql.ResultSet rs = null;
try
{
//get a connection
Connection.initialize_Connection_SQL();
conn = Connection.getSQLConn();
... | 5 |
@Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
String path = atts.getValue(A_PATH);
URL url_path = null;
if (path == null) {
System.out.println("WARNING: path attribute not provided for HTMLViewerMenuItem: " + getText());
} else if (path.indexOf("://") != -1) {
try {
... | 4 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final OutputArCustomer other = (OutputArCustomer) obj;
if (!Objects.equals(this.szCustomerId, other.szCustomerI... | 3 |
public List<String> getIDList(String term) {
String query = "select IDList from termidlist where term=\"" + term
+ "\"";
ResultSet rsSet = sqLconnection.Query(query);
List<String> iDList = new ArrayList<>();
try {
while (rsSet.next()) {
String id = rsSet.getString("IDList");
iDList = Arrays.asLis... | 2 |
public Stella_Object lookup(Stella_Object key) {
{ KeyValueMap self = this;
{ Stella_Object map = self.theMap;
int crossover = self.crossoverPoint;
if (crossover == 0) {
return (StellaHashTable.stellaHashTableLookup(((StellaHashTable)(map)), key));
}
else {
... | 6 |
public boolean isInField(Vector2d coord) {
if ((coord.x>=position.x && coord.x<=position.x+widthHeight.x) || (coord.x<=position.x && coord.x>=position.x+widthHeight.x)) {
if ((coord.y>=position.y && coord.y<=position.y+widthHeight.y) || (coord.y<=position.y && coord.y>=position.y+widthHeight.y)) {
return tr... | 8 |
public void verify(FileInputStream ciphertext, FileInputStream cleartext) {
int Lp = p.bitLength(); // bitlength of p (512 bit)
int L = (Lp - 1) / 8; // blocksize
// read ciphertext
BigInteger C = readCipher(ciphertext);
BigInteger M = readClear(cleartext, L);
Boolean verified = true;
whil... | 6 |
public void update(float delta) {
boardTimer += delta / 1000;
if (boardTimer > minSpawnTime) {
Random rng = new Random(System.currentTimeMillis());
int r1 = rng.nextInt();
int spawnTime = maxSpawnTime - minSpawnTime;
if ((int) r1 % spawnTime == 0 || boardT... | 5 |
public ArrayIterator(T[] source)
{
this._source = source;
} | 0 |
public static void init() {
} | 0 |
@Override
public void Borrar(Object value) {
Session session = null;
try {
Equipo equipo = (Equipo) value;
session = NewHibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.delete(equipo);
session.getTransa... | 2 |
public void act(List<Actor> newHunters)
{
// Move towards a source of food if found.
Location newLocation = findTarget();
if(newLocation == null) {
// No food found - try to move to a free location.
newLocation = getField().freeAdjacentLocation(getLocation());
}... | 2 |
@Override public boolean getControls(String control){
if(control == "Age"){ return true;}
if(control == "Fade"){ return true;}
if(control == "Mat"){ return true;}
if(control == "Orient"){ return true;}
if(control == "Mirror"){ return true;}
if(control == "Any"){return true;}
if(control == "All"){re... | 9 |
public List<RoomEvent> findRoomEventsByEventBranchId(final Long eventBranchId) {
return new ArrayList<RoomEvent>();
} | 0 |
static float lpc_from_data(float[] data, float[] lpc, int n, int m){
float[] aut=new float[m+1];
float error;
int i, j;
// autocorrelation, p+1 lag coefficients
j=m+1;
while(j--!=0){
float d=0;
for(i=j; i<n; i++)
d+=data[i]*data[i-j];
aut[j]=d;
}
// Generate ... | 8 |
public void run() {
try {
// loop until thread is terminated
while (!isInterrupted() && processMsg(readInt())) ;
} catch (Exception ex) {
if (parent().isConnected()) {
eWrapper().error(ex);
}
}
if (parent().isConnected()) {
... | 5 |
private void findCosineSimilarity(double[] activeUser) { // Add Logic to check that not all elements are same otherwise Wau =0
for (int user = 0; user < totalUsers; user++) {
double innerProduct = 0;
double lengthOfActiveUser = 1;
double lengthofUser = 1;
... | 7 |
public int getPendingSaveCount() {
int count = 0;
for (PlayerReinforcement pr : pendingDbUpdate) {
DbUpdateAction action = pr.getDbAction();
if (action == DbUpdateAction.INSERT || action == DbUpdateAction.SAVE) {
++count;
}
... | 3 |
public <V> Adapter.Setter<V> makeSetter(String methodName, Class<V> _class) {
try {
final Method method = version.getClass().getMethod(methodName, _class);
return new Adapter.Setter<V>() {
public void call(V value) {
try {
Transaction me = Thread.getTransaction();
... | 8 |
public void DeleteAtividade(int IDatividade) throws SQLException {
Connection conexao = null;
PreparedStatement comando = null;
ResultSet resultado = null;
try {
conexao = BancoDadosUtil.getConnection();
comando = conexao.prepareStatement(SQL_DELETE_ATIVIDADE);... | 6 |
public AnalyzeProteins() {
//iterate through all dssp files on-hand
int counter = 0;
File dir = new File("C:/Users/Bryn/Documents/CodingProjects/dssp/");
for (File child : dir.listFiles()) {
if (".".equals(child.getName()) || "..".equals(child.getName())) {
continue; // Ignore the self and parent aliases.
... | 4 |
public void login(ActionEvent actionEvent){
RequestContext context = RequestContext.getCurrentInstance();
FacesMessage msg = null;
boolean loggedIn = false;
if(usuaCuenta != null && usuaCuenta.equals("admin") && usuaContrasena != null && usuaContrasena.equals("admin")){
... | 4 |
public static Duration available(Duration maximum, Duration current) {
if (current.isLongerThan(maximum)) {
return new Duration(0);
} else {
return maximum.minus(current);
}
} | 1 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Utente other = (Utente) obj;
if (nome == null) {
if (other.nome != null)
return false;
} else if (!nome.equals(other.nome))
return fa... | 6 |
private void sendMessage(PaneTab selectedTab) {
if (!selectedTab.getMessageField().getText().isEmpty()) {
String message = selectedTab.getMessageField().getText();
if (this.view.tabs.getSelectedIndex() == 0) {
// Public message
int maxPublicMessageLength = this.client.MAX_PACKET_SIZE
- this.client... | 4 |
private static void validarCPF(String digits) throws ValidacaoException {
try {
boolean isvalid = false;
if (Long.parseLong(digits) % 10 == 0) {
isvalid = somaPonderadaCPF(digits) % 11 < 2;
} else {
isvalid = somaPonderadaCPF(digits) % 11 == 0... | 3 |
private synchronized void readPasswd(final InputStream in) throws IOException {
final BufferedReader din = new BufferedReader(new InputStreamReader(in));
String line;
entries = new HashMap();
while ((line = din.readLine()) != null) {
final String[] fields = new String[7];
final... | 8 |
public void RemoveTlv(int tag){
int newlen=0;
if (this.OtherTlvArray != null) {
Tlv[] tmp = new Tlv[OtherTlvArray.length];
for(int i=0;i<OtherTlvArray.length;i++){
if (OtherTlvArray[i].Tag != tag){
tmp[newlen]=OtherTlvArray[i];
newlen++;
}
}
//System.out.println("newlen:"+newlen);
... | 4 |
public static void main(String[] args) {
Connection con = null;//null is used to initialize;
Statement stmn = null;
ResultSet rs = null;
try {
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost/gufran?" + "user=root&password=Mysql786");
... | 4 |
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
response.setContentType("text/html;charset=UTF-8");
request.setCharacterEncoding("UTF-8");
ICommand command = RequestHelper.getInst... | 1 |
public List<ParkBoy> getParkBoyList() {
return parkBoyList;
} | 0 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Tuple2 other = (Tuple2) obj;
if (_1 == null) {
if (other._1 != null)
return false;
} else if (!_1.equals(other._1))
return false;
i... | 9 |
@Override
public void run()
{
while(true)
{
Messages.parseForMessages();
DateTime dt = new DateTime();
System.out.println(dt.getHourOfDay()+":"+dt.getMinuteOfHour());
if(counteratlastsecond==-1)
try {
System.out.... | 9 |
public void setIdUsuario(Integer idUsuario) {
this.idUsuario = idUsuario;
} | 0 |
public void UpdateAtividade(Atividade atividade) throws SQLException {
Connection conexao = null;
PreparedStatement comando = null;
try {
conexao = BancoDadosUtil.getConnection();
comando = conexao.prepareStatement(SQL_UPDATE_ATIVIDADE);
comando.setString(1... | 6 |
public void close()
{
if( blockvec != null )
{
blockvec.clear();
blockvec = null;
}
if( (nextblock != null) && (!nextblock.equals( this )) )
{
nextblock = null;
}
mystore = null;
if( data != null )
{
data.clear();
data = null;
}
} | 4 |
public void delete() {
if (getInstalledDirectory() != null && getInstalledDirectory().exists()) {
try {
FileUtils.deleteDirectory(getInstalledDirectory());
} catch (IOException ex) {
Utils.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
}
... | 5 |
@Override
public void process(JCas aJCas) throws AnalysisEngineProcessException {
PosTagNamedEntityRecognizer recognizer = null;
try {
recognizer = new PosTagNamedEntityRecognizer();
} catch (ResourceInitializationException e) {
e.printStackTrace();
}
String sentenceText = aJCas.g... | 5 |
public void setCtrlCR(CtrlComptesRendus ctrlCR) {
this.ctrlCR = ctrlCR;
} | 0 |
public PanelFalsaPosicion(){
c1Field = new JTextField(5);
c2Field = new JTextField(5);
expField= new JTextField(5);
c3Field = new JTextField(5);
xaField = new JTextField(5);
xbField = new JTextField(5);
errorField = new JTextField(5);
c1Label = new JLabel("Coeficiente del termino cuadratico");
... | 3 |
@Test
public void equals_test() {
try{
double []vec1= {1.0,2.0,3.0};
double []vec2= {1.0,2.0,3.0};
boolean result= Vector.equals(vec1, vec2);
Assert.assertTrue(result);
}
catch (Exception e) {
// TODO Auto-generated catch block
fail("Not yet implemented");
}
} | 1 |
public void openDevice(int index) { // Opens the device takes in index you
// want to use
deviceIndex = index; // Sets the index to the parameter
try { // beginning of a try catch block
sender = JpcapSender.openDevice(devices[deviceIndex]); // Opens the
// selected
//... | 1 |
public boolean shouldOutputCoords() {
if (this.elementType == ElementType.BLOCK
|| this.elementType == ElementType.IMAGEBLOCK
|| this.elementType == ElementType.TEXTBLOCK
|| this.elementType == ElementType.TEXTLINE) {
return true;
} else {
return false;
}
} | 4 |
public void setjTextFieldAdresse(JTextField jTextFieldAdresse) {
this.jTextFieldAdresse = jTextFieldAdresse;
} | 0 |
private void displayUsersTasks(){
//find tasks for user logged in
try {
Project tempProject = null;
ResultSet dbUsersTasks = null;
Statement statement;
statement = connection.createStatement();
dbUsersTasks = statement.executeQuery... | 4 |
@Override
protected void setUp() throws Exception {
buffy = allocateAlignedByteBuffer(2 * PAGE_SIZE, PAGE_SIZE);
buffy.position(PAGE_SIZE + offset);
buffy.limit(buffy.position() + 32);
buffy = buffy.slice().order(ByteOrder.nativeOrder());
String host = "localhost";
int port = 12345;
final ServerSocketCha... | 9 |
private void isolateSubgraph(Subgraph subgraph, Node member) {
Edge edge = null;
for (int i = 0; i < member.incoming.size(); i++) {
edge = member.incoming.getEdge(i);
if (!subgraph.isNested(edge.source) && !edge.flag)
removeEdge(edge);
}
for (int i = 0; i < member.outgoing.size(); i++) {
edge = mem... | 8 |
public void testMultipleNotifyingFutures() throws Exception {
MethodCall sleep=new MethodCall("sleep", new Object[]{100L}, new Class[]{long.class});
List<CompletableFuture<RspList<Long>>> listeners=new ArrayList<>();
RequestOptions options=new RequestOptions(ResponseMode.GET_ALL, 30000L);
... | 7 |
private String getComponentNameFromInfo(InfoPacket info){
Iterator<Pair<?>> pairIt = info.namedValues.iterator();
Pair<?> pair = null;
String name = null;
while(pairIt.hasNext() && name==null){
pair = pairIt.next();
if(pair.getLabel() == Label.cNme){
name = (String) pair.second();
}
}
return na... | 5 |
@Override
public boolean containsBooleanArray(String name) {
JOSObject<? , ?> raw = this.getObject(name);
if(raw == null) return false;
if(raw.getName().equalsIgnoreCase(BOOLEAN_ARRAY_NAME)) return true;
return false;
} | 4 |
private void listen() throws IOException, InterruptedException {
reply(200);
String line = null;
while ((line = reader.readLine()) != null) {
StringTokenizer st = new StringTokenizer(line);
String command = st.nextToken().toLowerCase();
int code = 0;
if (command.equals("register-peer")) {
code =... | 9 |
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.