text stringlengths 14 410k | label int32 0 9 |
|---|---|
public synchronized void addFrame(Image image,
long duration)
{
totalDuration += duration;
frames.add(new AnimFrame(image, totalDuration));
} | 0 |
public static String escape(String string) {
char c;
String s = string.trim();
StringBuffer sb = new StringBuffer();
int length = s.length();
for (int i = 0; i < length; i += 1) {
c = s.charAt(i);
if (c < ' ' || c == '+' || c == '%' ... | 6 |
public void handleStartTag( HTML.Tag t, MutableAttributeSet a,
int pos )
{
if ( t == HTML.Tag.SELECT)
{
Object value = getValueOfAttribute(a, "name") ;
if (value != null)
{
if (value.toString().hashCode() == "systran_lp".hashCode())
{
s... | 5 |
public Iterator iterator() {
return new BallIterator(this);
} | 0 |
public void removeNode(final Object key) {
final GraphNode node = getNode(key);
Assert.isTrue(node != null, "No node for " + key);
succs(node).clear();
preds(node).clear();
if (removingNode == 0) {
nodes.removeNodeFromMap(key);
} else if (removingNode != 1) {
throw new RuntimeException();
}
// ... | 2 |
public boolean fromDocument(Document document) {
boolean result = true;
NodeList serversList = document.getElementsByTagName(C.servers);
NodeList tasksList = document.getElementsByTagName(C.tasks);
for (int i=0; i<serversList.getLength(); i++) {
result = result && servers.fromElement((Element)serv... | 4 |
String getResourceCamelOrLowerCase(boolean mandatory, String ending) {
String name = getConventionalName(true, ending);
URL found = getClass().getResource(name);
if (found != null) {
return name;
}
System.err.println("File: " + name + " not found, attempting with came... | 3 |
private void loadSplashes() {
try (BufferedReader reader = new BufferedReader(new FileReader(System.getProperty("resources") + "/splash/splash text"))) {
Icon splashIcon;
String line = null;
while((line = reader.readLine()) != null) {
// Load each screen
splashIcon = new Icon(line);
splashIco... | 2 |
public void encode(OutputStream os, BencodeType... values) throws IOException {
if (values != null) {
for (BencodeType value : values) {
value.encode(os);
}
}
} | 2 |
public ListChooserTF(Frame frame, Component locationComp, String labelText,
String title, Object[] data, int initialIndex, String longValue,
String okLabel, String[] inputTextLabel, int[] inputTextMinValue, int[] inputTextMaxValue, int[] inputTextDefaultValues ) {
super(frame, locationComp, labelText, title, da... | 8 |
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int biggestNum = Integer.MIN_VALUE;
int smallestNum = Integer.MAX_VALUE;
int biggestOddNumber = Integer.MIN_VALUE;
boolean oddNumberFound = false;
while (true) {
int input = sc.nextInt();
if (input == 0) {
break;
}
... | 8 |
public Token run(List<Token> tokens) {
for (Token token : tokens) {
if (token instanceof ValueToken) {
values.push((ValueToken) token);
continue;
}
OperatorToken o = (OperatorToken) token;
if (Operator.OPEN_PARENTHESIS == o.getOper... | 8 |
static void indexStatistic(){
/*record # of entries with different hitting number */
long entryRcord[] = new long[7];
Iterator<Entry<String, long[]>> iter = index.entrySet().iterator();
while(iter.hasNext()){
Entry<String, long[]> entry= iter.next();
long meta[] = new long[M+2];
meta = entry.getValue()... | 3 |
public Long getLongItem(String... names) throws ReaderException {
try {
return Long.parseLong(getItem(names).toString());
} catch (NumberFormatException e) {
throw new ReaderException("No key exists with this type, keys: " + _parseMessage(names) + ". In file: " + ConfigurationManager.config_file_path);
}
... | 1 |
public Worker () {
//initial settings
results = new String[VALUE_ITERATIONS_NUMBER];
this.keyboard = new BufferedReader(new InputStreamReader(System.in));
System.out.println(MSG_WELCOME);
//start
this.lifeCycle();
} | 0 |
public void init() {
grid = new Cell[8][8];
for (int x = 0; x < 8; x++) {
for (int y = 0; y < 8; y++) {
grid[x][y] = new CellImpl(new Point(y, x));
}
}
for (int q = 0; q < 6; q++) {
grid[0][q + 1].setPiece(Checker.WHITE);
grid[7][q + 1].setPiece(Checker.WHITE);
grid[q + 1][0].setPiece(C... | 9 |
private static MobInventory getMobInventory(int invId)
throws SlickException {
QueryExecutor qe = new QueryExecutor();
qe.SendQuery("SELECT * FROM RPG372DB_Inventory WHERE invId='" + invId
+ "'");
if (qe.resultSize() == 0)
return null;
MobInventory mobInv = new MobInventory(null);
int tempId;
for... | 3 |
private JPopupMenu getSelectionPopupMenu() {
JPopupMenu popup = new JPopupMenu("Selection");
// MenuBar -> Selection -> Copy
JMenuItem menuItemCopy = new JMenuItem("Copy");
menuItemCopy.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
copySelection();... | 7 |
public static List getAllRelationsWithPrefix(Module module, boolean localP, String prefix) {
{ Iterator iter = Logic.allNamedDescriptions(module, localP);
List result = List.newList();
String downcasedprefix = Native.stringDowncase(prefix);
{ NamedDescription description = null;
Iterator ... | 6 |
public Element toElement(CashOffice cashOffice) {
Element cashOfficeElement = new Element("cashOffice");
List<Seance> seances = cashOffice.getSeances();
for (Seance seance : seances) {
Element seanceElement = new SeanceTranslator().toElement(seance);
Element ticketsElement = new Element("tickets... | 2 |
public void setSelectedTool(Tool tool){
if(tool == Tool.FOREGROUND){
this.toForeground();
return;
}
if(tool == Tool.BACKGROUND){
this.toBackground();
return;
}
if(tool == Tool.EDIT){
this.edit();
return;
}
selectedTool = tool;
for(ToolButton button : toolButtons){
if(button.getTool(... | 8 |
public void testSeDurationBeforeEnd_long2() {
MutableInterval test = new MutableInterval(TEST_TIME1, TEST_TIME2);
try {
test.setDurationBeforeEnd(-1);
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
public String buildConfigStructureAux(NodeList nl, Element element, String path){
String path_aux = path;
String nodeName;
Node node;
NodeList cn;
int cnSize;
List<Node> lst;
int i = 0;
while(nl.getLength() > i){
path=path_aux;
node = nl.item(i);
cn = node.g... | 9 |
public static Proposition findOrCreateFunctionProposition(GeneralizedSymbol predicate, Cons inputarguments) {
{ Proposition proposition = Logic.beginCreatingFunctionProposition(predicate, inputarguments);
Proposition duplicate = ((!Logic.descriptionModeP()) ? Proposition.findDuplicateFunctionProposition(propo... | 6 |
protected void demo16() 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 rkfPhraseReader api function.\n");
String phrase = "peng... | 1 |
Xpp3Dom createTimeStamp(final Date date) {
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);
return createElementWithText("timestamp", dateFormat.format(date));
} | 0 |
public Set<Unit> collectMinerals(Set<Unit> drones, Set<Unit> minerals) {
// System.out.println("collectMinerals!");
Set<Unit> claimedMinerals = new HashSet<Unit>();
if (drones==null || drones.isEmpty() || minerals==null || minerals.isEmpty()){
return claimedMinerals;
}
for (Unit drone : drones) {
for ... | 7 |
@Override
public void addSubProcess(ProductType productType, SubProcess subProcess) {
productType.addSubProcess(subProcess);
tx.begin();
if (em.contains(subProcess)) em.merge(subProcess);
else em.persist(subProcess);
tx.commit();
} | 1 |
public ArrayList<TreeNode> generate(int start, int end) {
ArrayList<TreeNode> result = new ArrayList<TreeNode>();
if (start > end) {
TreeNode root = null;
result.add(root);
return result;
}
for (int i = start; i <= end; i++) {
ArrayList<T... | 4 |
private void persist(String cubeIdentifier) throws PersistErrorException,
PageFullException, IOException, SchemaNotExistsException,
CubeNotExistsException {
SchemaClientInterface schemaClient = SchemaClient.getSchemaClient();
Schema schema = schemaClient.getSchema(cubeIdentifier... | 9 |
public void actionPerformed(ActionEvent e) {
if (e.getSource() == m_defaultButton) {
m_matrix.initialize();
matrixChanged();
} else if (e.getSource() == m_openButton) {
openMatrix();
} else if (e.getSource() == m_saveButton) {
saveMatrix();
} else if ( (e.getSource() == m_classesFi... | 8 |
private void btnEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarActionPerformed
// TODO add your handling code here:
if (correo != null) {
int confirma = JOptionPane.showConfirmDialog(this, "¿Seguro que desea eliminar este correo?", "Confirma", JOptionPa... | 4 |
private String seperateField(String temp)
{
String field = "";
for(int i = 1; i <= temp.length(); i++)
{
if(temp.substring(i - 1, i).equals(","))
{
break;
}
else if(temp.substring(i - 1, i).equals(">"))
{
... | 6 |
public static File showSaveDialog(String title) {
final ExtensionFileFilter filter = new ExtensionFileFilter();
JFileChooser Save = new JFileChooser();
JFrame frame = new JFrame();
frame.setIconImage(Program.programIcon);
if (title.compareTo(Tools.getLocalizedString(ActionType.EXPORT.name()
+ ".Name")) ==... | 4 |
public Node getNode( int id ){
for( Node node : nodes ){
if( node.getID() == id ){
return node;
}
}
return null;
} | 2 |
public DnDAlternativeVoteResult(List<Vote> votes, Set<Candidate> candidateSet) {
winners = new ArrayList<Option>();
List<String> winnersGUIDs = computeAVResult(votes, 42);
for (String winnerGUID : winnersGUIDs) {
for (Candidate candidate : candidateSet) {
if (winnerGUID.equals(candidate.getGUID())) {
... | 3 |
static protected void FillBuff() throws java.io.IOException
{
if (maxNextCharInd == available)
{
if (available == bufsize)
{
if (tokenBegin > 2048)
{
bufpos = maxNextCharInd = 0;
available = tokenBegin;
}
else if (tokenBegin < 0)
bufpos... | 9 |
public static void main(String[] args) {
ChocolateChip chip = new ChocolateChip();
chip.chomp();
ChocolateChipProtected chipProtected = new ChocolateChipProtected();
chipProtected.chomp();
} | 0 |
public static void startRound(){
round = round + 1;
gui.initialiseRound();
letGen = new LetterGen();
while(howHardCanItBe() == false)
{
letGen = new LetterGen();
}
if(Game.round == 1){
gui.setRoundText("Let's Begin! Round 1");
}
else if(Game.round == 5){
gui.setRoundText("Last Round, Final Chanc... | 3 |
public ArrayList<String> cbEscolhaProjetos(String codDepartamento) throws SQLException {
ArrayList<String> Projeto = new ArrayList<>();
Connection conexao = null;
PreparedStatement comando = null;
ResultSet resultado = null;
try {
conexao = BancoDadosUtil.getConnec... | 7 |
public static void main(String[] args) throws IOException {
StaticDynamicUncertaintyULHSolver solverWithoutADI = new StaticDynamicUncertaintyULHSolver();
StaticDynamicUncertaintyWithADIULHSolver solverWithADI = new StaticDynamicUncertaintyWithADIULHSolver();
ConstantNormalDistributedProblemGenerator problemGenera... | 1 |
protected Collection createCollection(Class destClass) {
if (destClass == List.class || destClass == ArrayList.class) {
return new ArrayList(); // list默认为ArrayList
}
if (destClass == LinkedList.class) {
return new LinkedList();
}
... | 8 |
public void create(Qualificador qualificador) {
if (qualificador.getQualificadorAplicacaoCollection() == null) {
qualificador.setQualificadorAplicacaoCollection(new ArrayList<QualificadorAplicacao>());
}
if (qualificador.getQualificadorProdutoCollection() == null) {
quali... | 9 |
public void readFields(DataInput in) throws IOException {
String data = new String(in.readLine());
try {
String tokens[] = data.split("[=]|[\\{]|[\\}]|[,]");
if(data.indexOf("Book") != -1 || tokens.length > 0) {
for( int i = 0; i < tokens.length ; i++) {
... | 8 |
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
Player player = (Player)sender;
if(commandLabel.equalsIgnoreCase("whois")) {
if(sender.hasPermission("basics.command.whois.self")) {
if(args.length == 0) {
sender.sendMessage(ChatColor.GRAY + "IP: " + playe... | 5 |
public static Integer getNextPort(String listenHostname, String hostname) {
String[] split = pare(listenHostname, hostname);
if(split == null) {
return null;
}
String[] split2 = split[0].split(":");
String portnum;
if(split2.length<=1) {
try {
return Integer.parseInt(split2[0]);
... | 5 |
@Override
public boolean hasNext() {
try {
String tmp;
this.block.delete(0, this.block.length());
do {
tmp = br.readLine();
if (null == tmp)
return false;
if (tmp.contains(" lo ") || tmp.contains(" sit0 "... | 8 |
public void login(boolean reconnect)
{
// ok it is a connection request
name = tf.getText().trim();
// empty username ignore it
if(name.length() == 0)
return;
// empty serverAddress ignore it
String server = tfServer.getText().trim();
if(server.length() == 0)
return;
// empty or inv... | 8 |
final Model method1554(boolean bool, int i) {
anInt2796++;
int i_0_ = anInt2792;
int i_1_ = anInt2767;
if (bool) {
i_1_ = anInt2775;
i_0_ = anInt2822;
}
if ((i_0_ ^ 0xffffffff) == 0)
return null;
Model class124
= Class300.createModel(0,
((ItemLoader) (((ItemDefinition) this)
... | 9 |
public static <T extends DC> Equality getPhiEqu(Set<Pair<Pair<PT<Integer>,T>,Pair<PT<Integer>,T>>> done)
{ if(done!=null)
{ if(done.getNext()!=null)
{ return new Equality(done.getFst().fst().snd().delta(done.getFst().snd().snd()).equa().getValue()&&getPhiEqu(done.getNext()).getValue());
}
else
... | 3 |
private boolean routeBetween(Tile a, Tile b) {
if (a == b) return false ;
//
// Firstly, determine the correct current route.
// TODO: Allow the road search to go through arbitrary Boardables, and
// screen out any non-tiles or blocked tiles?
final Route route = new Route(a, b) ;
final R... | 5 |
@Override
public void receiveAlert(AIAlert alert, float urgency, Hostility hostility) {
switch(alert) {
case ATTACKED:
priority = 1f;
break;
}
} | 1 |
public static void main(String[] args){
if(args.length != 3){
System.out.println("args: id of this server, ip address of another server, ip address of database");
return;
}
Server server = null;
try {
server = new Server(Integer.parseInt(args[0]), "rmi://"+args[2]+":10001/db");
//register server to ... | 7 |
public void stop(IntBuffer source) {
if(source != null)
if(AL10.alIsSource(source.get(0)))
AL10.alSourceStop(source);
} | 2 |
public Request(Socket socket) {
if(socket == null){
return;
}
try {
InputStreamReader isr = new InputStreamReader(
socket.getInputStream());
BufferedReader brInput = new BufferedReader(isr);
String line = brInput.readLine();
while (line != null && !line.equals(... | 5 |
public static void main(String[] args) {
FileReader fr = null;
try {
fr = new FileReader("test2101.txt");
} catch (FileNotFoundException e1) {
e1.printStackTrace();
}
SortListMaker slm = null;
try {
slm = new SortListMaker(fr);
} catch (FileNotFoundException e1) {
e1.printStackTrace();
... | 5 |
Power(String name, int properties, String imgFile, String helpInfo) {
this.name = name ;
this.helpInfo = helpInfo ;
this.buttonTex = Texture.loadTexture(IMG_DIR+imgFile) ;
this.properties = properties ;
} | 9 |
private JSONWriter append(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write('... | 7 |
private <T, R> Pair<ConvertType, TypeConverter<T, R>> getConvertInfo(T instance, Class<R> targetClass) {
boolean isNull = (instance == null);
if (instance != null && (targetClass.equals(instance.getClass()) || targetClass.isAssignableFrom(instance.getClass()))) {
return new Pair(ConvertType.identity, null);
}... | 7 |
@Test
public void testPlayCvC() {
//fail("Not yet implemented");
RockPaperScissors myRPSgame = new RockPaperScissors();
assertTrue(myRPSgame.playCvC() <=2);
int battleResult=0;
int Zeroes=0, Ones=0, Twos=0, tooBig=0, tooSmall=0;
for(int i=0;i<50;i++){
battleResult=myRPSgame.playCvC();
if (battleR... | 6 |
public boolean arenaStart(Player player, String name) {
if (!this.arenas.containsKey(name)) {
player.sendMessage(ChatColor.RED + this.lang.getString("arenaStart.notContainsKey"));
return true;
}
if (this.games.containsKey(name)) {
if (this.games.get(name).hasPlayers()) {
player.sendMessage(ChatColor... | 4 |
public static void endAllOwnedBy(String owner){
for(ScheduleData data : schedules){
if(data.getOwner().equalsIgnoreCase(owner)) endSchedule(data.getScheduleID());
}
} | 2 |
@Override
public Command planNextMove(Info info){
int warning_radius = 300;
int danger_radius = 100;
InfoDetail next_target;
warning_zone = new Ellipse2D.Double((double)(info.getX() - warning_radius/2), (double)(info.getY() - warning_radius/2), warning_radius, warning_radius... | 9 |
@Override
public void run()
{
while(finish == false)
{
//Prüfen ob der PathCollector nioch gebraucht wird
if(System.currentTimeMillis() - time > timeout)
{
stop();
}
//Neuen Weg erkunden
if(Paths.size() < maxpaths)
{
searchNewPath();
}
//Debug
System.out.println("Neue... | 7 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((action == null) ? 0 : action.hashCode());
result = prime * result
+ ((emagResource == null) ? 0 : emagResource.hashCode());
result = prime * result + ((endTime == null) ? 0 : endTime.hashCode());
result ... | 8 |
public DisplayMode getCurrentDisplayMode() {
return device.getDisplayMode();
} | 0 |
public void update(){
move();
action();
checkLasers();
if(health<=0) {
alive = false;
if (this instanceof Minions) {
for(int q=0;q<objects.size();q++){
if(objects.get(q)==parent&&kind==1){
parent.count--... | 6 |
@Override
public void applyEffect(Joueur jou){
jou.setPositionCourante(super.getMonopoly().getCarreau(11));
jou.setToursPrison(4);
if(jou.getLiberationPrison()){
Scanner sc = new Scanner(System.in);
System.out.printf("Vous possédez une carte Libération de Prison. Voul... | 3 |
@Override
public Item peekFirstItem()
{
if(packageText().length()==0)
return null;
final List<XMLLibrary.XMLTag> buf=CMLib.xml().parseAllXML(packageText());
if(buf==null)
{
Log.errOut("Packaged","Error parsing 'PAKITEM'.");
return null;
}
final XMLTag iblk=CMLib.xml().getPieceFromPieces(buf,"PAKI... | 7 |
public List<Octo> getAll() {
List<Octo> result = new ArrayList<Octo>();
for(EntityBase ent: db.getItems())
{
if(ent instanceof Octo)
result.add((Octo)ent);
}
return result;
} | 2 |
public void computeIORatio() {
long fInputKeyValuePairsNum = 0;
long fOutputKeyValuePairsNum = 0;
long fInputBytes = 0;
long fOutputBytes = 0;
for(Reducer fr : finishedReducerList) {
Reduce reduce = fr.getReduce();
fInputKeyValuePairsNum += reduce.getInputKeyValuePairsNum();
fOutputKeyValueP... | 4 |
public static ActiveDeactiveType valOf(Character val) throws Exception {
if (val.equals(Active.getVal())) {
return Active;
} else if (val.equals(Inactive.getVal())) {
return Inactive;
}
throw new Exception("Kode tidak terdaftar");
} | 2 |
public static void debug() {
try
{
} catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
} | 1 |
public void merge(Pair p, int ind) {
edges.remove(ind);
/*int xxx = ind;
while (xxx >= 0) {
edges.remove(xxx);
xxx = edges.indexOf(p);
}*/
Iterator<Pair> it = edges.iterator();
while (it.hasNext()) {
Pair n = it.next();
if (p.v2 == n.v1 || p.v2 == n.v2) {
if (p.v2 == n.v1) {
int has = e... | 7 |
public void setAvailability(Date dateAt, Object val) {
// check, if date is already existing
RosterAvailability r = checkAvailability (dateAt);
if (r == null) {
rosterAvailability.add(new RosterAvailability (dateAt.getTime(), (int)val));
rosterChangeSupport.firePropertyChange("rosterAvailability", null, va... | 1 |
public static CtMethod wrapped(CtClass returnType, String mname,
CtClass[] parameterTypes,
CtClass[] exceptionTypes,
CtMethod body, ConstParameter constParam,
CtClass declaring)
... | 1 |
static boolean isStandardProperty(Class clazz) {
return clazz.isPrimitive() ||
clazz.isAssignableFrom(Byte.class) ||
clazz.isAssignableFrom(Short.class) ||
clazz.isAssignableFrom(Integer.class) ||
clazz.isAssignableFrom(Long.class) ||
... | 9 |
public static String getConcatedString(ArrayList<String> strings) {
String retString = new String();
for (int i = 0; i < strings.size(); i++) {
if (i > 0)
retString = retString + "&&&";
retString = retString + strings.get(i);
}
return retString;
} | 2 |
@Override
public void show(){
for (T item : getHistogram().keySet()) {
System.out.println(item + " " + getHistogram().get(item));
}
} | 1 |
@Override
public Set<Class<?>> getAnnotatedEndpointClasses(Set<Class<?>> scanned) {
return null;
} | 2 |
public void AddChild(int id, int i, RoomItem Child)
{
if (i < 1)
{
for (int i_ = 0; i_ < MAX_CHILDS_PER_WIRED; i_++)
{
Items[id][i_] = null;
}
}
if (Child == null) return;
Items[id][i] = Child;
ItemOriginal_ExtraDat... | 3 |
public String sellStock(Stock st, int numShares){
portfolio = qs.qsort(portfolio, 0); // 0 sorts by ticker name, handy when printing
int index = -1;
// check if they already own some shares in that stock
String searchedTicker = st.getTicker();
// traverse until ticker is found in portfolio
for (int i = 0; i < po... | 5 |
public String buscarClientePorFecha(String fecha){
//##########################CARGA_BASE DE DATOS#############
tablaDeClientes();
//##########################INGRESO_VACIO###################
if(fecha.equals("")){
fecha = "No busque nada";
return resultBu... | 5 |
public static void main(String[] args)
{
FrameWithPanel frame = new FrameWithPanel("This is Frame With Panel !");
Panel panel = new Panel();
frame.setSize(200, 200);
frame.setBackground(Color.BLUE);
frame.setLayout(null);
panel.setSize(100, 100);
panel.setBackground(Color.CYAN);
frame.add(p... | 0 |
final public Expression IntExpression() throws ParseException {
final Variable v;
final String s;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case VARIABLE:
v = Variable();
{if (true) return new VariableExpression(v);}
break;
case STRING_END:
case INTEGER:
ca... | 8 |
public long Problem3() {
long n=Long.parseLong("600851475143");
long maior=0;
while(n!=1) {
int i=2;
while (i<=n) {
if (Utility.isPrime(i) && n%i==0) {
if (i>maior) {
maior = i;
}
n/=i;
break;
}
i++;
}
}
return maior;
} | 5 |
@Override
public boolean isConverted() {
// TODO Auto-generated method stub
return false;
} | 0 |
public AbstractTab() {
createContent();
Settings s = Settings.getInstance();
timestampFormat = "";
if ( s.isViewEnabled("timestamp-enabled") )
timestampFormat = s.getViewTimestampFormat();
isChatLoggingEnabled = s.isEventEnabled("log-chat");
} | 1 |
public static void reverse(int[] arr, int from, int to){
//determine the number of swaps
int iters=0;
if(from>to){
iters=((arr.length-from)+to+1)/2;
} else {
iters=(to-from+1)/2;
}
//do the swaps
while(iters>0){
swap(arr,from,to);
iters--;
//update indexes
from++;
to--;
//check for... | 4 |
@SuppressWarnings("deprecation")
public void testConstructor_RP_RP_PeriodType5() throws Throwable {
YearMonthDay dt1 = null;
YearMonthDay dt2 = null;
try {
new Period(dt1, dt2, PeriodType.standard());
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
public String toString(){
String str = (aluno != null ? aluno.toString() : "");
str += (getMedia() != null ? " " + getMedia().toString() : "");
str += (getSituacao() != null ? " " + getSituacao() : "");
return str;
} | 3 |
public TableModel obtenerResumenMembresiasDB(int ano, String mes) {
Connection conn = null;
Statement stmt = null;
String query = "SELECT TC.IDCLIENTE, NOMBRE, FECHA_INICIO, DURACION, "
+ "DESCRIPCION, PRECIO FROM GYMDB.CLIENTES TC JOIN "
+ "GYMDB.MEMBRESIAS AS TM... | 6 |
final void method80(int i) {
if (Class184.aBoolean2469)
Class318_Sub1_Sub2.writeScriptSettings(i + -110);
anInt5170++;
Class59_Sub1_Sub1.method556(false);
if (Class348_Sub8.currentToolkit != null)
Class348_Sub8.currentToolkit.destroy();
if (Class34.aFrame476 != null) {
LoadingStage.method527(Class34... | 7 |
@Override
public String toString() {
if (reversed) {
reverse();
}
Element tmp = firstElement;
String result = "";
while (tmp != null) {
result += tmp.getValue() + " ";
tmp = tmp.getNextElement();
}
return result;
} | 2 |
public boolean containsTree(Node<T> root, Node<T> otherRoot) {
if(root ==null || otherRoot ==null){
return false;
}
if(root.data.compareTo(otherRoot.data)==0){
if(matchTree(root,otherRoot,false)){
return true;
}
}
if(root.left!=... | 8 |
public Point getRoute(int x, int y)
{
if (thread != null) {
try {
thread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
return route[y][x];
} | 2 |
public void makeInactive() {
this.setBorder(BorderFactory.createEmptyBorder());
this.setDefaultBackgroundColor();
} | 0 |
public static boolean mouseButtonState(int button) {
return mouseState[button - 1];
} | 0 |
private void forward(int[] sequence, double[][] fwd, double[] scaling) {
int T = sequence.length;
int S = this.getNumberOfStates();
double[] pi = this.pi;
double[][] a = this.a;
double[][] b = this.b;
// 1. Initialization
scaling[0x00] = 0.0d;
for (int i ... | 8 |
public int getPriority() {
return postfix ? 800 : 700;
} | 1 |
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.