text stringlengths 14 410k | label int32 0 9 |
|---|---|
@XmlTransient
public Collection<Medico> getMedicoCollection() {
return medicoCollection;
} | 0 |
public double getWidth(Graphics pen)
{
if(myText.length() == 0)
return 0;
Graphics2D p = (Graphics2D)pen;
FontRenderContext frc = p.getFontRenderContext();
TextLayout layout = new TextLayout(myText, FONT, frc);
return layout.getBounds().getWidth();
} | 1 |
public static void main(String args[]) {
Initializer initilizer = new Initializer();
try {
initilizer.initializeServerWithPersistDataInServer();
} catch (CubeXmlFileNotExistsException e) {
e.printStackTrace();
} catch (CubeAlreadyExistsException e) {
e... | 8 |
public void validateItemsInRoom() {
List<Item> remItems = Runtime.getRemItems();
List<Item> items = getItems();
for (int cnt = 0; cnt < getItems().size(); cnt++) {
for (int count = 0; count < (remItems.size())
&& (!getItems().isEmpty()); count++) {
System.out.println("You picked up " + remItems.size(... | 4 |
public Shape createStrokedShape (Shape shape) {
GeneralPath result = new GeneralPath();
PathIterator it = new FlatteningPathIterator(shape.getPathIterator(null), FLATNESS);
float points[] = new float[6];
float moveX = 0, moveY = 0;
float lastX = 0, lastY = 0;
float thisX = 0, thisY = 0;
int type = ... | 8 |
public boolean equals(Object p_other) {
if ( this == p_other ) {
return true;
}
else if ( p_other == null ) {
return false;
}
ComboLeg l_theOther = (ComboLeg)p_other;
if (m_conId != l_theOther.m_conId ||
m_ratio != l_theOther.m_r... | 9 |
@Override
protected void onMode(String channel, String sourceNick, String sourceLogin,
String sourceHostname, String mode) {
// User mode: +o nickname
// Channel mode: +m
String change = mode.substring(0, 1);
boolean granted = change.equals("+");
... | 3 |
@Override
public String toString()
{
return String.format( "xor(%s, %s)", this.a, this.b );
} | 0 |
private StateManager()
{
} | 0 |
@Override
public void dispose() {
if (!isClosed()) {
WINDOW_LIST.remove(this);
if (WINDOW_LIST.isEmpty()) {
for (PaletteWindow window : getWindows(PaletteWindow.class)) {
window.setAppWindow(null);
}
}
}
super.dispose();
WindowMenuProvider.update();
} | 3 |
public Tester(String name) {
this.name = name;
} | 1 |
public void left(int velocity) {
controls.left(velocity);
} | 0 |
public void printInfo(UQuest plugin, Player player){
Quester quester = plugin.getQuestInteraction().getQuester(player);
player.sendMessage(ChatColor.GOLD + this.name);
player.sendMessage(ChatColor.GREEN + this.startInfo);
//Progress
player.sendMessage("Objective:");
for(Objective objective : this.objectives... | 5 |
public static ArrayList<Question> findById_AllQuestions(int id, BaseSetting bs) {
Connection connection = bs.getConnection();
ArrayList<Question> alq = new ArrayList<Question>();
try {
String query = "SELECT * FROM Contains WHERE id_e = ?";
PreparedStatement p_statement... | 5 |
public void login(final HttpServletRequest httpRequest, final HttpServletResponse httpResponse) {
HttpSession session = httpRequest.getSession();
session.setAttribute("drupalauth.authCookieName", authCookieName);
session.setAttribute("drupalauth.authValidationEndpoint", authValidationEndpoint);
... | 2 |
public Line complete(int start) {
String[] args = line.split(" ");
StringBuilder string = new StringBuilder();
for (int i = start; i < args.length; i++) {
string.append(args[i] + " ");
}
return new Line(string.toString().substring(0, string.length() - 1));
} | 1 |
final void assertHasExactlyOneNamedNonEmptyElement(final Xpp3Dom testCase, final String name) {
final Xpp3Dom[] children = testCase.getChildren(name);
assertEquals("Expected exactly one " + name, 1, children.length);
assertFalse("Expected " + name + " not to be empty.", children[0].getValue().is... | 0 |
@Override
public ArrayList<Object> ifVoucher(SalesReceiptPO receipt) {
// TODO Auto-generated method stub
ArrayList<Object> returnPromotions=new ArrayList<Object>();
for(PromotionPO p:promotions){
if(p.getPromotionType()==PromotionSort.Voucher&&
checkDateValid(receipt.getSerialNumber(), p)&&
checkCu... | 5 |
private void generate_mode() {
if(mode.equals("joint_stereo"))
headerstring |= 0x40;
if(mode.equals("dual_channel"))
headerstring |= 0x80;
if(mode.equals("single_channel"))
headerstring |= 0xc0;
} | 3 |
public void setOldTranslation(String oldTranslation){
this.oldTranslation.setText(oldTranslation);
} | 0 |
private static String send(final EntityEnclosingMethod httpMethod, String url,
RequestEntity requestEntity, String username, String pw) {
HttpClient client = new HttpClient();
HttpConnectionManager connectionManager = client.getHttpConnectionManager();
try {
... | 9 |
public String getCode(){
String str = "";
if(identifiers != null)
str += identifiers.getCode();
str += this.printLineNumber(true) + identifier.getNewName() + " := pop" + "\n";
return str;
} | 1 |
@Override
public boolean getPoint(int mouseX, int mouseY){
int newX = -1;
int newY = -1;
if (mouseX < 800){
int cx = Boot.getPlayer().getX();
int cy = Boot.getPlayer().getY();
newX = cx + (mouseX / Standards.TILE_SIZE) - 12;
newY = cy + ((Standards.W_HEIGHT - mouseY) / Standards.TILE_SIZE) - 12;
... | 4 |
private RenderableObject generateObject(String next, Scanner inFile) {
RenderableObject ro = null;
switch (next) {
case "Ellipse":
ro = generateElipse(inFile);
break;
case "Rectangle":
ro = generateRectangle(inFile);
break;
case "Text":
ro = generateText(inFile);
break;
case "Shape":
ro... | 6 |
private TreeNode rotateRight(TreeNode rotatingNode) {
TreeNode rotatedTreeRootNode = rotatingNode.left;
rotatedTreeRootNode.parent = rotatingNode.parent;
rotatingNode.left = rotatedTreeRootNode.right;
if (rotatingNode.left != null) {
rotatingNode.left.parent = rotatingNode;
}
rotatedTreeRootNode.righ... | 4 |
public int getAge() {
return age;
} | 0 |
@Test
public void test() {
String pattern = "AB*A";
String text1 = "Hello World ACA! NFA";
String text2 = "Hello World AA! NFA";
String text3 = "Hello World ABBBBA! NFA";
NFA nfa = new NFA(pattern);
assert(nfa.recognizes(text1) == false);
assert(nfa.recognizes(text2) == true);
assert(nfa.recogniz... | 0 |
protected String getUrl() {
String newUrl = "";
if(url != null && !"".equals(url.trim()))
newUrl = newUrl+ url;
if(url != null && !"".equals(url.trim()) && projectRoot != null && !"".equals(projectRoot.trim()))
newUrl = newUrl + " in ";
if(projectRoot != null && !"".equals(projectRoot.trim()))
newUrl =... | 8 |
public static void paramSendCheck(Object[] objs) throws NotSerializableException {
for (int i = 0; i < objs.length; i++) {
/* Check if parameters are all serializable */
if ( (objs[i] != null) && !(objs[i] instanceof Serializable) ) {
throw new NotSerializableException("Non-serializable parameter");
}
... | 6 |
static public byte[] decode(final String source)
{
final String base32 = source.toLowerCase();
int i, index, lookup, offset, digit;
byte[] bytes = new byte[base32.length()*5/8];
for(i = 0, index = 0, offset = 0; i < base32.length(); i++)
{
lookup = base32.charAt(... | 8 |
public List<Token> getObjects(){
try{
CSVFileManager csvMgr = new CSVFileManager();
SimpleHttpReader reader = new SimpleHttpReader();
SimpleMatchParser parser = new SimpleMatchParser(TokenType.parse(csvMgr
.readFile("res/pulsSheduleObjects.txt").getCSVObject()));
SimpleTextWriter writer = new SimpleT... | 1 |
public void loadSave(File loadPath) {
int[] waveEnemies;
int numEnemiesInWave;
int numEnemies = 0;
int airIdHolder = 0;
try {
Scanner loadScanner = new Scanner(loadPath);
while (loadScanner.hasNext()) {
Frame.gameScreen.level = loadScanner.nextInt();
Screen.myHealth = loadScanner.nex... | 9 |
private static int[] mergeSort(int[] list){
if(list.length <= 1){
return list;
} else{
//Split the array
int[] la = mergeSort(Arrays.copyOfRange(list, 0, list.length/2));
int[] ra = mergeSort(Arrays.copyOfRange(list, list.length/2, list.length));
//Run through the list, replacing the values as we go
... | 9 |
@Override
public boolean doSmall() {
if ((script.houseTask.getHouseLocation() != HouseTask.HouseLocation.YANILLE && !options.useOtherHouse.get())) {
options.status = "House not in yanille";
return false;
} else {
options.status = "Walking to yanille portal";
final Tile tile = locationAttribute.getSmall... | 4 |
public void addEventListener(String type, ipsilonS3ToolEngineListener listener) {
if(type.equals(ipsilonS3ToolEvent.TYPE_DELETING)){
listenerDeleting.add(ipsilonS3ToolEngineListener.class, listener);
}
if(type.equals(ipsilonS3ToolEvent.TYPE_UPLOADING)){
listenerUploading.add(ipsilonS... | 8 |
public int[] getVertexGridCoords(int xDim, int yDim, int value)
{
if (value > ((yDim * xDim) - 1) || xDim < 0 || yDim < 0 || value < 0)
{
throw new IllegalArgumentException();
}
int yCoord = (int) Math.floor(value / xDim);
int xCoord = (value - yCoord * xDim) + 1;
yCoord += 1;
int[] coords = new int... | 4 |
public void parseHtml() throws IOException {
String html = "error";
int i=0;
for(i=0;i<5 && html.equals("error");i++){
html = new GetHTML().getHtml(this.articleUrl,"UTF-8");
System.out.println("in Article...:"+this.articleUrl);
}
if(i<5){
Sys... | 5 |
public void secureDatabase() {
logger.debug("<<<< DatabasePasswordSecurerBean is running!!! >>>>>");
getJdbcTemplate().query("select username, password, password_encrypted from users", new RowCallbackHandler() {
@Override
public void processRow(ResultSet rs) throws SQLException... | 3 |
@MethodInformation(author="Matthias", date="09.12.2012", description="Gives back a double that describes the average carrying capacity of all DieselTraktor")
protected double avgCapacityDiesel() throws DivideByZeroException{
MyIterator it = (MyIterator) traktoren.iterator();
double sum = 0;
int count = 0;
w... | 4 |
public Range(Match match, Tile origin, Ability ability)
{
this.match = match;
this.origin = origin;
this.ability = ability;
validTargetPaths = new ConcurrentHashMap<Tile, ArrayList<Tile>>();
invalidTargets = new ArrayList<Tile>();
blockingTiles = new ArrayList<Tile>();
//Movement ranges can "wrap"... | 1 |
private void generateMoveList() {
moveList = new ArrayList<Integer>();
int curX = 0, curY = 0;
boolean upperCase = true;
for(int i=0;i<name.length();i++) {
char c = name.charAt(i);
int newX = getCharX(c);
int newY = getCharY(c);
if(newX == -1 || newY == -1)
throw new RuntimeException("invalid ch... | 7 |
private SpatialTree<E> octant(Vector3f position) {
if (position.x > division_x) {
if (position.y > division_y) {
if (position.z > division_z)
return octant1;
else
return octant5;
} else {
if (position... | 7 |
public static void initDatabase() {
Session session = HibernateUtil.getSession();
session.beginTransaction();
/* Locals */
Local local1 = new Local("Palau Sant Jordi", "C/Falsa 123");
Local local2 = new Local("Indispuesto", "C/Parla");
Local local2_2 = new Local("PepeStage", "C/Tio Pepe");
Local local2_3... | 8 |
private void attachTo(Component paramComponent)
{
if ((paramComponent instanceof ImageComponent)) {
((ImageComponent)paramComponent).addImageListener(this);
} else if ((paramComponent instanceof ImageComposite)) {
((ImageComposite)paramComponent).addImageListener(this);
} else if (((paramCompo... | 6 |
public static void setPrizes(int prizeIncrease){
prizes[0] = 0;
for (int i = 1; i < 16; i++) {
if (i < 5)
prizes[i] = prizeIncrease * (i + 1);
if (i < 10 && i >= 5)
prizes[i] = prizeIncrease * 2 * (i + 1);
if (i >= 10)
prizes[i] = prizeIncrease * 3 * (i + 1);
}
LOGG.logInfo("Prizes set."... | 5 |
@After
public void tearDown() {
} | 0 |
synchronized void putLine(String inp) {
try {
while (available==size) wait();
} catch (InterruptedException exc) {
throw new RTError("Buffer.putLine interrupted: "+exc);
};
buffData[nextToPut] = new String(inp);
if (++nextToPut >= size) nextToPut = 0;
available++;
notifyAll(); // Only notify() could... | 3 |
public boolean processedMacro(StringBuilder sb, String text) {
if (text.equals("LocalChanges")) {
return processedLocalChangesMacro(sb, text);
} else if (text.equals("RebasedChanges")) {
return processedRebasedChangesMacro(sb, text);
} else if (text.equals("TitleIndex")) ... | 6 |
public void renderTrail(float[] color) {
if (body.hasTrail){
GL11.glBegin(GL11.GL_LINE_STRIP);
GL11.glVertex3d(body.position.x, body.position.y, body.position.z);
for (int i = 0; i < path.length; i++) {
GL11.glColor4f(color[0], color[1], color[2],
(float) Math.pow((1.0 - ((double) i / path.length))... | 3 |
public void runPersistentConnectionThread(){
int counter =0;
//String persistent_header="HTTP/1.1: 200 OK\r\n"+"Content-Type: text/html\r\n" + "Connection:Keep-Alive\r\n" + "\r\n";
String persistent_header="<script>ThreadId-"+ Integer.toString(current_client_number) +"-</script>";
outputChannel.println( persi... | 8 |
public Double getPhi() {
return phi;
} | 0 |
@Override
public String toString() {
StringBuilder print = new StringBuilder();
char[] blanks = new char[width()*height()];
Arrays.fill(blanks, '_');
print.append(blanks);
for(Point p : _path) {
print.setCharAt((p.x() - min_x()) + width()*((p.y() - min_y())), '#');
}
print.setCharAt((start()... | 2 |
public static void main(String[] args) throws IOException {
String keyFileName;
try {
keyFileName = args[args.length-1];
if(keyFileName.startsWith("-"))
throw new RuntimeException();
} catch(RuntimeException e) {
System.err.println("No key file specified.");
return;
}
String addr = null;
sh... | 9 |
public boolean update(float tslf, Tile[][] tiles)
{
xpos += xspeed * tslf;
ypos += yspeed * tslf;
int tilexpos = (int) ((xpos + look.getWidth() / 2) / Texture.tilesize);
int tileypos = (int) ((ypos + look.getHeight() / 2) / Texture.tilesize);
if(tiles[tilexpos][tileypos].getLookID() == 3) return true;
... | 5 |
public double getProportion(String oldUnit, String newUnit)
{
double result = 0;
double numerador = 0;
double denominador = 1;
if(oldUnit.equalsIgnoreCase("Hours"))
{
numerador = 1;
}
else if(oldUnit.equalsIgnoreCase("Days"))
{
numerador = 24;
}
else if(oldUnit.equalsIgnoreCase("Months"))
... | 8 |
protected void lancerOption(int i) {
switch (i) {
case 0:
new InstrumentSelectorFrame(0, 5);
break;
case 1:
new InstrumentSelectorFrame(1, 5);
break;
case 2:
new InstrumentSelectorFrame(2, 5);
break;
case 3:
... | 6 |
public void renderSheet(int xp, int yp, SpriteSheet sheet, boolean fixed){
if(fixed){
xp -= xOffset;
yp -= yOffset;
}
for(int y = 0; y < sheet.HEIGHT; y++){
int ya = y + yp;
for(int x = 0; x < sheet.WIDTH; x++){
int xa = x + xp;
if(xa < 0 || xa >= width || ya < 0 || ya >= height) continue;
... | 7 |
public List<Message> consumeMulti(final int number, Boolean shouldBeRequeued) throws Exception {
if (shouldBeRequeued) {
return this.rabbitTemplate.execute(new ChannelCallback<List<Message>>() {
public List<Message> doInRabbit(Channel channel) throws IOException {
List<Message> resultList = new Array... | 7 |
@Override
public void removeItem(final String item) {
new Thread(new Runnable() {
@Override
public void run() {
File removedFile = new File(workingDirectory + File.separator + item);
if (removedFile.exists()) {
removedFile.delete();... | 1 |
public static void textPack(byte packedData[], java.lang.String text) {
if (text.length() > 80) {
text = text.substring(0, 80);
}
text = text.toLowerCase();
int carryOverNibble = -1;
int ofs = 0;
for (int idx = 0; idx < text.length(); idx++) {
char... | 9 |
public void incValue(float inc) {
//Include weight, and use it to modify familiarity?
//
// Roll dice matching current relationship against magnitude of event.
final int numDice = (int) (Math.abs(attitude / ATTITUDE_DIE) + 0.5f) ;
int roll = 0 ;
for (int n = numDice ; n-- > 0 ;) roll += Rand.ye... | 4 |
public AIScreen(String screenPath) {
this.screenPath = screenPath;
} | 0 |
public EvidenziaFAM(Model mod){
//pulisco la damiera dalle vecchie caselle evidenziate
mod.getDamiera().clearEvid();
//Evidenzio i pezzi che si possono muovere del giocatore che deve muovere
for(int i=0;i<mod.getDamiera().getDim();i++)
for(int j=0;j<mod.getDamiera().getDim();j++)
if(mod.getDamier... | 6 |
public static void main(String[] args) {
Class<?> c = null;
try {
c = Class.forName("type_information.ex01.FancyToy");
} catch(ClassNotFoundException e) {
System.out.println("Can't find FancyToy");
System.exit(1);
}
printInfo(c);
for(Cl... | 7 |
private void putAllImpl(Map<? extends K, ? extends V> map) {
if (resizingIntoElementData != null) {
if (backgroundResizeComplete) {
forceFinishResizing();
}
}
int capacity = elementCount + map.size();
if (capacity > threshold) {
doResiz... | 8 |
private boolean r_mark_suffix_with_optional_n_consonant() {
int v_1;
int v_2;
int v_3;
int v_4;
int v_5;
int v_6;
int v_7;
// (, line 132
// or, line 134
lab0: do {
... | 9 |
public char getSuit() {
return mySuit;
} | 0 |
private void unplug () {
assert (plugged);
plugged = false;
// Cancel all fd subscriptions.
if (io_enabled) {
io_object.rm_fd (handle);
io_enabled = false;
}
// Disconnect from I/O threads poller object.
io_object.unplug ();
//... | 3 |
public static void encodeFileToFile( String infile, String outfile )
throws java.io.IOException {
String encoded = Base64.encodeFromFile( infile );
java.io.OutputStream out = null;
try{
out = new java.io.BufferedOutputStream(
new java.io.FileOutputStrea... | 2 |
public void receivePartyMemberHP() {
if (party != null) {
int channel = client.getChannel();
for (MaplePartyCharacter partychar : party.getMembers()) {
if (partychar.getMapid() == getMapId() && partychar.getChannel() == channel) {
MapleCharacter other ... | 5 |
public static int[] plusOne(int[] digits) {
if(digits == null || digits.length == 0){
return null;
}
StringBuilder numBuilder = new StringBuilder();
for(int digit: digits){
numBuilder.append(digit);
}
long num = Long.valueOf(numBuilder.toString());
num += 1;
int[] result = new int[String... | 4 |
public static List<String> whoDrops(int itemid) {
int searchid = itemid;
List<String> retMobs = new ArrayList<String>();
MapleData data = null;
MapleDataProvider dataProvider = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("net.sf.odinms.wzpath") + "/" + "String.wz... | 7 |
public static void main( String[] args ) throws Exception
{
UserImplementation userImplementation = new UserImplementation();
Protocol protocol = MessageProtocol.PROTOCOL;
protocol.addListener( userImplementation );
Client client = protocol.newClient( MessageProtocol.HOST, MessageP... | 4 |
public Player(TileMap tm) {
super(tm);
width = 30;
height = 30;
cwidth = 20;
cheight = 20;
moveSpeed = 0.3;
maxSpeed = 1.6;
stopSpeed = 0.4;
fallSpeed = 0.15;
maxFallSpeed = 4.0;
jumpStart = -4.8;
stopJumpSpeed = 0.3;
facingRight = true;
health = maxHealth = 5;
fire = maxFire = 2500;
... | 4 |
public static void insertActionCom( int idactiontype,int idutilisateur, Date dateaction, String actioncommercial ) throws SQLException {
String query="";
try {
query = "INSERT INTO ACTION_COM (ID_ACTION_TYPE,ID_INTERLOCUTEUR,ACTDATE,ACTCOMM) VALUES (?,?,?,?); " ;
... | 1 |
public static File open(JFrame view) {
int fileChosen = chooser.showDialog(view, "Open file");
if (fileChosen == JFileChooser.APPROVE_OPTION) {
chooser.requestFocus();
file = chooser.getSelectedFile();
}
return file;
} | 1 |
public Note findNoteOf(Critere c) {
for (Note n : notes) {
if (c.equals(n.getCritere())) {
return n;
}
}
return null;
} | 2 |
private static void loadKeywords() {
// if (wordTypes != null) {
// return;
// }
// wordTypes = new HashMap<String, Character>();
wordTypes = new HashMap<String, Character>();
defaultWords = new HashMap<String, String>();
Scanner scanner = null;
String l... | 9 |
public void addPosition(final int x, final int y) {
if (npoints >= xpoints.length || npoints >= ypoints.length) {
int newLength = npoints * 2;
if (newLength < MIN_LENGTH) {
newLength = MIN_LENGTH;
} else if ((newLength & (newLength - 1)) != 0) {
... | 5 |
protected Method getMethod(String name, boolean isStatic) {
try {
Method method = clazz.getDeclaredMethod(name, Map.class);
if (!ConfigurationSerializable.class.isAssignableFrom(method.getReturnType())) {
return null;
}
if (Modifier.isStatic(metho... | 4 |
@Override
public void acceptDraggableObject(DraggableObject object)
{
if(object instanceof DraggableObjectFile)
{
DraggableObjectFile fileobj = ((DraggableObjectFile)object);
if(fileobj.file != null)
{
if(Animation.isValidFile(fileobj.file.getName()))
{
textField.text = fileobj.file.getPath(... | 3 |
@SuppressWarnings("deprecation")
private void processDictionaryRequest(OMMSolicitedItemEvent event)
{
OMMMsg msg = event.getMsg();
int msgType = msg.getMsgType();
Token token = event.getRequestToken();
switch (msgType)
{
case OMMMsg.MsgType.REQUEST:
... | 7 |
private void sink(int k) {
//My method.
if (false) {
int i = k * 2;
int length = size;
while (i <= length) {
if (i < length && less(i, i++)) {
i++;
}
if (less(i, i / 2)) {
exch(i, ... | 9 |
private int findDay (String input) {
Scanner s = new Scanner (input);
int[] date = new int[3];
s.useDelimiter("/");
while(s.hasNext()) {
for (int i = 0; i < date.length; i++) {
date[i] = s.nextInt();
}
}
s.close();
return date[1];
} | 2 |
public void update(int delta) {
while(performAction(delta) != -1);
} | 1 |
protected final Logger getLogger() {
return LoggerFactory.getLogger(this.getClass());
} | 0 |
public void loadImageUrls() {
try {
List<String> lines = Files.readAllLines(Paths.get(MainClass.URLS_FILE), Charset.forName("UTF-8"));
for (String url : lines) {
downloadedUrls.put(url, Boolean.TRUE);
}
} catch (IOException ex) {
File urls... | 4 |
public static void addTraySelectionChangedListener(
TraySelectionChangedListener listener) {
if (listener != null) StorageUnitDisplayPanel.traySelectionChangedListeners
.add(listener);
} | 1 |
private String toDot(boolean includeAdvisors) {
String STYLE_WAITING = "";
String STYLE_RUNNABLE = "style=filled color=yellow";
String STYLE_RUNNING = "style=filled color=green";
String STYLE_FINISHED = "style=filled color=grey";
StringBuilder sb = new StringB... | 9 |
@Override
public void run() {
SpeechResult speechResult;
while(running) {
speechResult = listen();
String hypothesis = speechResult.getHypothesis();
if(!hypothesis.isEmpty()) {
emit(new Event(EventType.INPUT, this, hypothesis));
}
... | 2 |
protected void beforeCloseTag(final char c)
{
switch(c)
{
case ' ': case '\t': case '\r': case '\n': bufDex++; return;
case '<': changeTagState(State.BEFORETAG); return;
case '/': changeTagState(State.BEFORECLOSETAG); return;
default:
if(Character.isLetter(c))
changedTagState(State.INCLOSETAG);
e... | 7 |
private String getNodeIndex(JTree tree, TreeNode node) {
TreeNode root = (TreeNode) tree.getModel().getRoot();
if (node == root) {
return "";
}
TreeNode parent = node.getParent();
if (parent == null) {
return null;
}
String parentIndex= getNodeIndex(tree, parent);
... | 3 |
@Override
public void xwrite_activated (Pipe pipe_)
{
for (Map.Entry<Blob, Outpipe> it: outpipes.entrySet()) {
if (it.getValue().pipe == pipe_) {
assert (!it.getValue().active);
it.getValue().active = true;
break;
}
}
... | 2 |
@Override
public String getName() {
return super.getName();
} | 0 |
@Override
public void propertyChange(PropertyChangeEvent event) {
JMenuItem mi = mTarget.get();
if (mi == null) {
Action action = (Action) event.getSource();
action.removePropertyChangeListener(this);
} else {
if (event.getPropertyName().equals(Action.ACCELERATOR_KEY)) {
mi.setAccelerator((KeyStroke... | 2 |
private void calculateSimilarities() {
for (Map.Entry<Integer, HashSet<Integer>> movie1 : usersByMovie.entrySet()) {
LinkedHashMap<Integer, Double> comparedMovies = new LinkedHashMap<Integer, Double>();
for (Map.Entry<Integer, HashSet<Integer>> movie2 : usersByMovie.entrySet()) {
// Only calculate similari... | 5 |
public static PackedImage threshold(PackedImage img, int level) {
PackedImage outImg = new PackedImage(img.rows(), img.cols());
int sum;
for (int r = 0; r < img.rows(); r++) {
for (int c = 0; c < img.cols(); c++) {
sum = img.at(r, c, 0) + img.at(r, c, 1) + img.at(r, c, 2);
if (sum/3 < level... | 3 |
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doGet(req, res);
header("Places disponibles");
if (!testConnection()){ footer(); return; }
String numS, date, nomS;
numS = req.getParameter("numS");
date = req.getParameter("date");
nomS = req.... | 5 |
@Override
public void execute(CommandSender sender, String gateName, List<String> args) {
this.sender = sender;
if (gateName == null) {
error("No gate given.");
reply("Usage: /gate delete <gatename>");
} else if (!gateExists(gateName)) {
reply("Gate not found: " + gateName);
} else {
DataGate th... | 5 |
protected void insertFix(TreeNode<K, D> nd) {
while (nd.parent.color == RED) {
if (nd.parent == nd.parent.parent.left) {
TreeNode<K, D> nd2 = nd.parent.parent.right;
if (nd2.color == RED) {
nd.parent.color = BLACK;
nd2.color = B... | 6 |
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.