text stringlengths 14 410k | label int32 0 9 |
|---|---|
public JSONObject toJSONObject() {
JSONObject json = new JSONObject(this);
json.put("_id", get_id());
Map<String, Method> methodMap = new HashMap<String, Method>();
for (Method method : this.getClass().getMethods()) {
methodMap.put(method.getName(), method);
}
for (Object key : json.keySet()) {
String... | 9 |
public static void toggleEditableText(Node currentNode, JoeTree tree, OutlineLayoutManager layout) {
CompoundUndoablePropertyChange undoable = new CompoundUndoablePropertyChange(tree);
toggleEditableForSingleNode(currentNode, undoable);
if (!undoable.isEmpty()) {
undoable.setName("Toggle Editability for Node"... | 1 |
public void setFile(final File file, final JTree tree, final NBTFrame frame) {
this.file = file;
try {
final PrintWriter pw = new PrintWriter(LAST, "UTF-8");
pw.println(file);
pw.close();
} catch(final IOException e) {
e.printStackTrace();
}
NBTReader read = null;
NBTComp... | 9 |
public static void main(String[] args) throws FileNotFoundException, IOException, ParseException {
setFilePath();
SimpleDateFormat df = new SimpleDateFormat("yyyy_MM_dd");// 设置日期格式
today = "thunder_" + df.format(new Date());
read();
// write();
} | 0 |
public static JMeterHTablePool getinstancePool(Configuration config,
int poolSize, byte[] tableName, final boolean autoFlush,
final long writeBufferSize) {
if (instancePool == null) {
synchronized (JMeterHTablePool.class) {
if(instancePool == null ){
System.out.println("Pool instance");
instance... | 2 |
public void bigify(int dc1, int dc2) {
if (moves.size()>0) {
if (((Move) moves.elementAt(0)).getNumAtomicMoves()==1) {
int big_die = 0;
for (int i=0; i<moves.size(); i++) {
AtomicMove am = ((Move) moves.elementAt(i)).getAtomicMove(0);
int this_die = Math.abs(am.source_column - am.dest_column);
... | 6 |
public void startReceiverThread()
{
new Thread()
{
public void run()
{
String tmp = null;
RadiogramConnection dgConnection = null;
Datagram dg = null;
try
{
dg... | 5 |
private static ArrayList<MenuItem> create() {
ArrayList<MenuItem> items = new ArrayList<>();
items.add(new MenuItem("List All", "l", new Callable<Menu_1_2>() {
@Override
public Menu_1_2 call() throws Exception {
try {
PlaylistManager pm = new Play... | 7 |
public void close() throws BitstreamException
{
try
{
source.close();
}
catch (IOException ex)
{
throw newBitstreamException(STREAM_ERROR, ex);
}
} | 1 |
public void union(int p, int q) {
int i = root(p);
int j = root(q);
if (i == j)
return;
if (siz[i] < siz[j]) {
id[i] = j;
siz[j] += siz[i];
} else {
id[j] = i;
siz[i] += siz[j];
}
count--;
} | 2 |
private void checkIsPlaceFreeRet(ArrayList<String> teachersSymbols) {
this.proposalsInPlan.clear();
boolean placeFound;
for(String teacher : teachersSymbols) {// rozmieszczanie propozycji
placeFound = false;
for(MultiRoomerPlace place : proposalsInPlan) {
if(plac... | 5 |
private static void zmq_ctx_destroy(Ctx ctx_) {
if (ctx_ == null || !ctx_.check_tag ()) {
throw new IllegalStateException();
}
ctx_.terminate ();
} | 2 |
public void SRC(){
pcIncrease();
int number = Integer.parseInt(getCOUNT().get(), 2);
getALU().OP1.set(SelectRegister().get());
if (getI().get().equals("0")&&getT().get().equals("0")){
getALU().arithShiftRight(number);
SelectRegister().set(getALU().RES.get(... | 6 |
public int getH() {
return h;
} | 0 |
private void add(ActionEvent e)
{
System.out.println("Add employee button clicked.");
if (e.getSource() instanceof JButton)
{
JButton source = (JButton) e.getSource();
File f = new File("Employee.txt");
try
{
PrintWriter pw = new PrintWriter(new FileOutputStream(f, true));
user.getText()... | 4 |
@Override
public void run() {
while(true){
//if steuerung =.... dann tue ....
}
} | 1 |
@Override
public void execute() {
// NoteEditorFrame noteEditorFrame = NoteEditorFrame.getInstance();
File file = noteEditorFrame.showOpenFileDialog("Open file");
if (file != null){
editFile(file);
}
} | 1 |
public boolean isSink() {
return isSink;
} | 0 |
@Override
public void update(GameContainer gc, StateBasedGame sb, float delta) {
if(this.position.y > SCREEN_HEIGHT - BOTTOM_GUI_HEIGHT - BIRD_HEIGHT || this.position.y < 0 + GUI_HEIGHT + BIRD_HEIGHT){
this.velocity.y*=-1;
}
this.updatePosition(delta);
} | 2 |
public void scanToSubBlock(long subFP) {
assert !isLeafBlock;
//if (DEBUG) System.out.println(" scanToSubBlock fp=" + fp + " subFP=" + subFP + " entCount=" + entCount + " lastSubFP=" + lastSubFP);
//assert nextEnt == 0;
if (lastSubFP == subFP) {
//if (DEBUG) System.out.println(" already positi... | 9 |
public void initActionBox() {
actionBox = new HBox(24);
actionBox.setAlignment(Pos.CENTER);
actionBox.getStyleClass().add("popUpActionBox");
actionBox.setPadding(new Insets(5, 0, 8, 0));
Button okBtn = new Button("Submit");
okBtn.getStyleClass().add("submit-button");
okBtn.setPrefWidth(75);
okBtn.setOn... | 0 |
public Transition modifyTransition(Transition transition, TableModel model)
{
String label = (String) model.getValueAt(0, 0);
MooreTransition t = (MooreTransition) transition;
try
{
return new MooreTransition(t.getFromState(), t.getToState(), label);
}
ca... | 1 |
public static void scheduleEvent( String method, Object target, long time, Object... parameters )
{
Event event = new Event();
try
{
Class< ? >[] paramClasses = new Class< ? >[ parameters.length ];
for ( int i = 0; i < paramClasses.length; i++ )
{
... | 6 |
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
if (commandLabel.equalsIgnoreCase("needcombined") || commandLabel.equalsIgnoreCase("nc")){
if (args.length == 1){
if (args[0].equalsIgnoreCase("info")){
msgHandler.info(sender);
return true;
}
if... | 8 |
public String getApellidos() {
return apellidos;
} | 0 |
public void addScore(String playerName, int value) {
Score score = new Score(playerName, value);
// find the location to place the new score
int i = 0;
while (i < scores.size()) {
if (value > scores.get(i).value) {
break;
}
++i;
}
// add the new score
if (i < scores.size()) {
scores.add(... | 3 |
private void makeSubscriptions(String argumentString) {
if (!isInVerify) {
String[] arguments = argumentString.split(" ");
ArgumentList argumentList = new ArgumentList(arguments);
String[] dataDescriptions = null;
ArrayList matchList = new ArrayList();;
ArgumentList.Argument arg;
while(argumentList.... | 7 |
@Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
setEnabled(false);
addActionListener(this);
Outliner.documents.addDocumentRepositoryListener(this);
} | 0 |
public int getTowerInformation(TowerInformation towerInformation) {
double counter = 0;
for (GameAction currentGameAction : getGameActions()) {
if (currentGameAction.hasAnAttack()) {
switch (towerInformation) {
case DMG:
counter += ... | 8 |
public int computeDependencies() {
// some of the dependencies in the "action" part and in the grouping and sort keys aren't relevant,
// because they don't depend on values set outside the for-each-group expression
int dependencies = 0;
dependencies |= select.getDependencies();
... | 9 |
private String buildIdName(String word){
try {
while(st.nextToken() == '_' || st.ttype == StreamTokenizer.TT_WORD || st.ttype == StreamTokenizer.TT_NUMBER) {
if(st.ttype == StreamTokenizer.TT_WORD)
word += st.sval;
else if(st.ttype == StreamTokenizer.TT_NUMBER)
word += String.valueOf((int)st.nval... | 7 |
private static void pNode(XMLNode node, int tabIndex) {
String tabs = "";
for (int i = 0; i < tabIndex; i++) {
tabs += " ";
}
String tabs2 = tabs + " ";
System.out.println(tabs + "[" + node.getName() + "] {");
for (XMLAttribute attr : node.getAttributes()) {
System.out.println(tabs2 + attr.g... | 3 |
public static boolean isCataloguePath(String path) {
path = path.trim().toLowerCase();
return path.endsWith(DataConstants.CATALOGUE_FILE_EXTENSION)
|| path.endsWith(DataConstants.CATALOGUE_COMPRESSED_FILE_EXTENSION)
|| path.endsWith(DataConstants.CATALOGUE_COMPRESSED_FILE... | 2 |
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
try {
Applicatie a = new Applicatie();
a.nieuwSpel();
} catch (Exception e) {
e.printStackTrace();
}
}
});
} | 1 |
public JsonElement serialize() {
JsonObject obj = new JsonObject();
if (this.timestamp != null) {
obj.addProperty("timestamp", this.timestamp);
}
if (this.actor != null) {
obj.add("actor", this.actor.serialize());
}
if (this.verb != null) {
... | 7 |
public Plateau(final int taille){
super(new GridLayout(taille, taille));
int position = 0;
for(int ligne=0; ligne<taille; ligne++){
for(int colonne=0; colonne<taille; colonne++){
if((colonne%2==0 && ligne%2==0) || (colonne%2!=0 && ligne%2!=0))
ajouterCase(Couleur.BLANC, 0);
else
ajouterCase(... | 6 |
private void setPesoLlaveEntera(int llave, double valor){
switch (llave) {
case 0:
this.setPeso(EMBARAZOS, valor);
break;
case 1:
this.setPeso(CONCENTRACION_GLUCOSA, valor);
break;
case 2:
this.setPeso(PRESION_ARTERIAL, valor);
break;
case 3:
this.setPeso(GROSOR_TRICEPS, val... | 8 |
public String getName() {
return name;
} | 0 |
final void method617
(int i, int i_83_, Class348_Sub42_Sub17 class348_sub42_sub17,
int i_84_, Class348_Sub42_Sub17 class348_sub42_sub17_85_,
boolean bool, boolean bool_86_, int i_87_, int i_88_) {
try {
anInt1125++;
if (i != -1) {
method622();
if (!NA())
method621();
else {
Class4 clas... | 7 |
public void add(Ball b)
{
balls.add(b);
} | 0 |
public int compareTo(Coord c) {
if (c.y != y)
return (c.y - y);
if (c.x != x)
return (c.x - x);
return (0);
} | 2 |
Writer createRawWriter() {
final SimpleArchive<Player> simpleArchive = new SimpleArchive<Player>();
Writer toFile = new Writer() {
public void writePlayers(String key, Iterable<? extends Player> players) throws KeyNotFoundException, KeyNotUpdatedException {
PrintStream out =... | 3 |
public void keyTyped(char c, int key) {
if (!theTextField.isMouseInside()){
return;
}
if (key == Keyboard.KEY_BACK) {
String txt = text;
if (txt.length() > 0) {
txt = txt.substring(0, txt.length() - 1);
text = txt;
}... | 5 |
public double getDataLevel(String name) {
try {
File f = new File(plugin.getDataFolder() + File.separator + "Players" + File.separator + name + ".data");
BufferedReader br = new BufferedReader(new FileReader(f));
StringBuilder readReason = new StringBuilder();
String line;
String[] line2;
while ((li... | 5 |
public void printTable() {
for (int i = 0; i < m; i++) {
if (table[i] == null) {
System.out.println("m = " + m + " i = [" + i + "] - null");
} else {
System.out.println("m = " + m + " i = [" + i + "] - " + table[i].getKey() + " | " + table[i].getI());
... | 2 |
public void collisionCheck(ArrayList<Entity> a){
for(int i = 0; i < a.size(); i++){
Entity entity1 = a.get(i);
}//end for loop 1
}//end method | 1 |
void scoreRandTest(int maxLen, int minLen, Random rand, DnaCoder dnaCoder, DnaSubsequenceComparator<DnaSequence> comparator) {
// First sequence
int len1 = rand.nextInt(maxLen) + minLen;
String seq1 = randSeq(len1, rand);
// Second sequence
int over = rand.nextInt(len1 - minLen + 1);
int start = over;
St... | 6 |
@SuppressWarnings("unchecked")
@Override
public int compareTo(ChannelRequest<T> o) {
if (request instanceof Comparable<?> && o.request instanceof Comparable<?>) {
return ((Comparable<T>) request).compareTo(o.request);
}
return 0;
} | 4 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=prof... | 7 |
public void fireActions()
{
//Execute cards
crdsToRemove = new ArrayList<card>();
for(int i = 0; i < sizeOfDeck(); i++)
{
card tmp = getCard(i);
tmp.mainAction();
//if the card has expired (been used or its mu... | 3 |
@Override
public void configure(AbstractCommand command, String[] args) {
TimeBanUnbanCommand unbanCommand = (TimeBanUnbanCommand) command;
if (CommandLineParser.isOptionPresent(args[0], 'a')) {
unbanCommand.setUnbanAll(true);
} else if (args[0] != null && !args[0].isEmp... | 3 |
public void renderInventory(Graphics g) {
g.setColor(Color.black);
g.fillRect(inv_window_start, 0, 226, 600);
g.setColor(Color.red);
g.fillArc(inv_window_start, 0, 226, 140, 0, 360);
//create armor inventory
int next = 0;
for(int y = 0; y < arm_... | 9 |
public int Decode(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, int posState) throws IOException
{
if (rangeDecoder.DecodeBit(m_Choice, 0) == 0)
return m_LowCoder[posState].Decode(rangeDecoder);
int symbol = 8;
if (rangeDecoder.DecodeBit(m_Choice, 1) == 0)
symbol += m_MidCo... | 2 |
private void printBoard() {
int count = 0;
System.out.println("CAMPO RESULTANTE: ");
for (int i = 0; i < board.length; i++) {
System.out.print("(");
for (int j = 0; j < board[i].length; j++) {
if (board[i][j].hasMine()) count++;
System.out.... | 3 |
@Override
public Object getAsObject(FacesContext facesContext, UIComponent component, String value) {
if (value == null || value.length() == 0 || JsfUtil.isDummySelectItem(component, value)) {
return null;
}
return this.ejbFacade.find(getKey(value));
} | 3 |
@Override
public void onStop() {
if (skillData != null) {
final int option = JOptionPane.showConfirmDialog(new JFrame(), "Would you like to leave feedback?", "Feedback", JOptionPane.YES_NO_OPTION);
if (option == 0)
Util.openURL("https://www.powerbot.org/community/topi... | 2 |
private void lifeCycle() {
String s = "";
while (isInputActive) {
try {
s = readInput();
if (s.length()==0) {
break;
}
if (this.isValidInput(s)) {
this.isInputActive = false;
break;
} else {
System.out.println(MSG_WELCOME);
}
} catch (IOException e) {... | 4 |
public void basicSetParcours(Parcours myParcours) {
if (this.parcours != myParcours) {
if (myParcours != null){
if (this.parcours != myParcours) {
Parcours oldparcours = this.parcours;
this.parcours = myParcours;
if (oldparcours != null)
oldparcours.removeGPSPoint(this);
}
}
}
} | 4 |
public void setSaleId(int saleId) {
this.saleId = saleId;
} | 0 |
@Override
public void windowClosing(WindowEvent arg0) {
/*TODO
* Put this into a separate (static?) function to be
* called upon an exception that terminates the game
* so as to prevent database clogging up
*/
System.out.println("window closing");
//TODO find way to go around this pro... | 5 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
PriorityQueue<Register> pq = new PriorityQueue<Register>();
while ((line = in.readLine()) != null && !line.equals("#"... | 3 |
public boolean addAtIndex (T e, int index) {
if (index < 0 || index >= this.size) throw new IndexOutOfBoundsException();
// add at index 0
if (index == 0) return this.addFirst(e);
// add at the last index
else if (index == this.size - 1) return this.addLast(e);
// add at an index that is neither... | 5 |
@Override
public Object getValue() {
return this.embeddedImageLink;
} | 0 |
private final void method1923(int i, int i_13_,
ByteBuffer class348_sub49) {
anInt3254++;
if (i_13_ == 4) {
if (i != 1) {
if (i != 2) {
if ((i ^ 0xffffffff) == -4)
((Class253) this).anInt3244
= class348_sub49.getShort();
else if (i == 4)
((Class253) this).anInt3251
= class... | 5 |
protected void handleCommand(String command) {
if (command.equalsIgnoreCase("stop") || command.equalsIgnoreCase("halt"))
this.stop();
else
LOGGER.info("Command: \"" + command + "\" does not exist!");
} | 2 |
public void build(boolean classes, boolean jars) throws IOException {
HashSet<File> explored = new HashSet<File>();
for(File file : exploreDirs) {
HashMap<String, ClassInfo> db = new HashMap<String, ClassInfo>();
explore(file, explored, db, true, true, classes, jars);
looseDBs.add(db);
}
for(int i = 0;... | 3 |
public static void main(String[] args) {
// TODO Auto-generated method stub
int [] three = new int[10000];
int [] five = new int [10000];
int [] ff = new int [10000];
int sum3 = 0;
int sum5 = 0;
int sum15 = 0;
for(int i = 0 ; i <= 333 ; i++){
three[i] = 3*i;
}
for(int three1 : three){
... | 6 |
protected Size2D arrangeNN(BlockContainer container, Graphics2D g2) {
double y = 0.0;
double height = 0.0;
double maxWidth = 0.0;
List blocks = container.getBlocks();
int blockCount = blocks.size();
if (blockCount > 0) {
Size2D[] sizes = new Size2D[blocks.size... | 7 |
@Override
public void salvar(Cliente cliente, Funcionario funcionario, Secao secao, Evento evento) {
try{
conn = ConnectionFactory.getConnection();
String sql = "INSERT INTO compra (id, datacompra, idcliente, idfuncionario, idingresso) "
+ "VALUES ((SELECT NV... | 2 |
public Board clone() {
Board cloned = new Board(width, height);
for(int x = 0; x < width; x++){
for(int y = 0; y < height; y++){
cloned.grid[x][y] = grid[x][y];
}
}
return cloned;
} | 2 |
public final void advanceVertically() throws IOException {
do {
String line = lineSource.getNextLine();
if (line == null) {
reset(null);
eof = true;
dent = -indentationStack.size();
indentationSta... | 8 |
public Graph[] readGraphs(String path)
{
File f=new File(path);
File[] list=f.listFiles();
Graph[] g=new Graph[list.length];
int i=0;
for(i=0;i<list.length;i++)
{
g[i]=new Graph(list[i].getName().toUpperCase());
try
{
BufferedReader br=new BufferedReader(new FileReader(list[i]));
br.readLi... | 3 |
private boolean indexOK(int index) {
return (index >= 0 && index < total);
} | 1 |
@Override
public void removeItems(Collection<String> items) {
for (String item: items) {
removeItem(item);
}
} | 1 |
public slideMediaObject(Integer branch,Integer duration,Integer startTime, Integer chapterBranch) {
super();
this.setOpaque(false);
this.setLayout(null);
this.branch = branch;
this.chapterBranch = chapterBranch;
if(duration == -1 || duration == 0)
{
this.finishTime = -1;
}
else
{
this.finishTi... | 2 |
@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Road other = (Road) obj;
if (neighborhood1 == null) {
if (other.neighborhood1 != null)
return false;
} else if (!neighborhood1.equals(o... | 9 |
public void updateAchievementWindow()
{
if (this.theAchievement != null && this.achievementTime != 0L)
{
double var1 = (double)(System.currentTimeMillis() - this.achievementTime) / 3000.0D;
if (!this.haveAchiement && (var1 < 0.0D || var1 > 1.0D))
{
... | 8 |
public boolean handleRightClick(Point clickPoint) {
Placeable placeable = null;
//start from the top and work our way down to "layer" the huds
try {
for (String key : placeables.keySet()) {
placeable = (Placeable) placeables.get(key);
if (placeable.ha... | 3 |
private void testLogout()
{
//Nodes moeten zichzelf herstellen na logout
//Beginsituatie = 3 nodes
tests++;
try
{
Node prevNode2 = null;
Node nextNode2 = null;
Node prevNode3 = null;
Node nextNode3 = null;
NodeLinkManagerInterface iFace2 = (NodeLinkManagerInterface)c2.getRMIInterface("//l... | 7 |
public void loadClip(String fileName, String name)
{
try
{
URL soundURL = Helpers.getResourceURL(this, fileName);
Clip clip = AudioSystem.getClip();
AudioInputStream inputStream = AudioSystem.getAudioInputStream(soundURL);
clip.open(inputStream);
clips.put(name, clip);
}
catch(Unsupporte... | 4 |
private boolean eiLiianLahellaLaitaa(Pelihahmo h){
double halkaisija = h.getMahdSuojakilvenHalkaisija();
boolean vx = h.getX() - halkaisija/2 >= 0;
boolean ox = h.getX() + halkaisija/2 <= kentanLeveys;
boolean yy = h.getY() - halkaisija/2 >= 0;
boolean ay = h.getY() + halkaisija/... | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof SessionID)) {
return false;
}
SessionID other = (SessionID) obj;
if (serverID == null) {
if (other.serverID != null) {
return false;
}
} else if (... | 9 |
public int getValue() {
if (andOrTerm2.getOp().equals("and")) {
if (equalityTerm.getValue() != 0 && andOrTerm2.getValue() != 0)
return 1;
else
return 0;
}
else if (andOrTerm2.getOp().equals("or")) {
if (equalityTerm.getValue() != 0 || andOrTerm2.getValue() != 0)
ret... | 6 |
public int getCharIndex(char chr) {
switch((int)chr) {
case 20: // whitespace
return 1023;
}
if((int) chr >= (int)'A' && (int) chr <= (int) 'Z') {
return (sgaMode ? 96 : 0)+(int)chr-(int)'A';
}
if((int) chr >= (int)'a' && (int) chr <= (int) 'z') {
return (sgaMode ? 96 : 32)+(int)chr-(int)'a';
}
... | 9 |
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[").append(bits()).append("]");
sb.append(" ").append(type());
if (checkHealth()) sb.append(" check health");
if (grown()) sb.append(" grown");
if (grown() && type() != FruitTreeType.FRUIT_TREE_PATCH) sb.append(" fruit: ").append(... | 4 |
public void spasiPromjene() {
Klase.Gost g = (Klase.Gost) listG.getSelectedValue();
if (validirajIzmjene() != "") {
JOptionPane.showMessageDialog(null, validirajIzmjene(), "Info",
JOptionPane.INFORMATION_MESSAGE);
return;
}
StraniGost sg = new StraniGost();
if (isStraniGost(g)) {
sg = DBManager... | 4 |
@Override
protected void paintTabBorder( Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected){
Graphics2D g2D = (Graphics2D)g;
switch( tabPlacement ){
case LEFT:
case RIGHT:
case BOTTOM:
/* codigo pa... | 5 |
@Override
public void recalculatePermissions(){ throw new UnsupportedOperationException("Not supported yet."); } | 0 |
public P_SingleMakeTab(){
this.setLayout(new BorderLayout());
topPane = new JPanel();
keyLabel = new JLabel("Key");
keyTxtFld = new JTextField(10);
keyLabel = new JLabel("Enter key and tick checkbox to print just one card");
singleCardCB = new JCheckBox();
addBt = new JButton("ADD")... | 7 |
public Object fromStringToOtherType(String s, String targetType) {
Object retVal = null;
ClassType type = wrapperClasses.get(targetType) ;
switch(type) {
case BYTE:
retVal = Byte.valueOf(s);
break;
case SHORT:
retVal = Short.valueOf(s);
break;
case STRING:
retVal = s;
break;
ca... | 9 |
@Override
public void deserialize(Buffer buf) {
entityId = buf.readInt();
if (entityId < 0)
throw new RuntimeException("Forbidden value on entityId = " + entityId + ", it doesn't respect the following condition : entityId < 0");
elemId = buf.readInt();
if (elemId < 0)
... | 4 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Proposta other = (Proposta) obj;
if (codigo == null) {
if (other.codigo != null)
return false;
} else if (!codigo.equals(other.codigo))
... | 6 |
public void addNewPastMeeting(Set<Contact> contacts, Calendar date,
String notes) throws IllegalArgumentException,
NullPointerException {
try {
if (date.getTime().after(theCalendar.getTime())) {
throw new IllegalArgumentException(
"The time entered was in the future!");
}
} catch (IllegalArgu... | 3 |
private void kayitla_karsilastir(){
try {
Statement st = baglantiAc();
ResultSet res = st.executeQuery("select adi,sifre from kisi");
boolean bulundu=false;
if((jTextField1.getText())!="" && ( jPasswordField1.getText())!="")
{
while(... | 7 |
public static boolean LoadScen(Path p) {
try {
BufferedReader reader = Files.newBufferedReader(p, cSet);
String readL = "";
GlobalFuncs.loadMapCharacteristics(reader);
GlobalFuncs.scenMap.loadMap(reader);
GlobalFuncs.allCOAs = new Vector<COA>();
// Load units
while(readL != null) {
... | 7 |
double getVoltage() {
double w = 2*pi*(sim.t-freqTimeZero)*frequency + phaseShift;
switch (waveform) {
case WF_DC: return maxVoltage+bias;
case WF_AC: return Math.sin(w)*maxVoltage+bias;
case WF_SQUARE:
return bias+((w % (2*pi) > (2*pi*dutyCycle)) ?
-maxVoltage : maxVoltage);
case WF_TRIANGLE:
retur... | 8 |
static public boolean isCorrectResult(Matrix coef, Matrix free,
Matrix result, double eps) {
int n = coef.getHeight();
for (int i = 0; i < n; i++) {
double res = 0.;
for (int j = 0; j < n; j++) {
res += (coef.get(i, j) * result.get(i, 0));
}
if (Double.isInfinite(res) || Double.isNaN(res)
||... | 5 |
private static BatchUtils init() throws BatchException {
logger.setMethodName("init");
String os = System.getProperty("os.name").toLowerCase();
BatchUtils.logger.write("Operating System is: " + os,
ILogger.SEVERITY_INFO);
Properties prop = new Properties();
String fileName = BATCHS_PATH.concat(File.separ... | 9 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
FuelTank other = (FuelTank) obj;
if (fuelCapacity != other.fuelCapacity)
return false;
if (fuelLevel != other.fuelLevel)
return false;
... | 7 |
public void actionPerformed(ActionEvent arg0)
{
String command = arg0.getActionCommand();
if (command.compareToIgnoreCase("Begin") == 0)
{
// disable the begin button and the configPanel (freeze the config)
controlPanel.begin.setEnabled(false);
configPanel.setEnabled(false);
fast = false;
// T... | 8 |
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.