text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public double calculateFractalWithoutPeriodicity(Complex pixel) {
iterations = 0;
Complex tempz = new Complex(pertur_val.getPixel(init_val.getPixel(pixel)));
Complex tempz2 = new Complex(init_val2.getPixel(pixel));
Complex[] complex = new Complex[3];
complex[0] = ... | 8 |
public void rotateTo(int x, int y, int handle) {
if (savedCenter == null)
savedCenter = getCenterOfMass2D();
double dx = x - savedCenter.getX();
double dy = y - savedCenter.getY();
double distance = Math.hypot(dx, dy);
if (distance < 1.0)
return;
double sintheta0 = 0, costheta0 = 0;
boolean b = s... | 9 |
protected Upgrade bonusFor(int state) {
switch (state) {
case (DRILL_MELEE ) : return Garrison.MELEE_TRAINING ;
case (DRILL_RANGED ) : return Garrison.MARKSMAN_TRAINING ;
case (DRILL_ENDURANCE) : return Garrison.ENDURANCE_TRAINING ;
case (DRILL_AID ) : return Garrison.AID_TRAI... | 4 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Cotizacion)) {
return false;
}
Cotizacion other = (Cotizacion) object;
if ((this.idCotizacion == null && other.... | 5 |
public int tapes() {
return toRead.size();
} | 0 |
public ArrayList<BEPlaylist> getAllPlaylists() throws SQLException {
ArrayList<BEPlaylist> result = new ArrayList<BEPlaylist>();
Statement stm = DBConnection.getConnection().createStatement();
stm.execute("Select * From Playlist");
ResultSet res = stm.getResultSet();
while (res.... | 1 |
private void var_decl_id() {
if( is(TK.ID) ) {
if (symtab.add_entry(tok.string, tok.lineNumber, TK.VAR)) {
gcprint("int ");
gcprintid(tok.string);
gcprint("="+initialValueEVariable+";");
}
scan();
}
else {
... | 2 |
public Game(JavaPlugin plugin, int gameid, int maxPlayers, Location signLoc, String gameName, GameStage gamestage, ArrayList<Location> teamspawns, long delay, long period) {
if (plugin == null) {
throw new IllegalArgumentException("Plugin cannot be null!");
}
if (!plugin.isEnabled())... | 8 |
@Override
public void setInvokeHandler(Object invokeHandler) {
this.invokeHandler = invokeHandler;
} | 0 |
private static ArrayList<Fact> getNonAnswers(ArrayList<Fact> list) {
ArrayList<Fact> newList = new ArrayList();
for (Fact f : list) {
if (!f.isAnswer() && !f.isMiddle()) {
newList.add(f);
}
}
Collections.sort(newList);
... | 3 |
public void mouseDragged(MouseEvent e) {
if (dragCallback != null) {
int mask = e.getModifiers();
int index = 0;
if ((mask & InputEvent.BUTTON1_MASK) == InputEvent.BUTTON1_MASK) {
index = MouseEvent.BUTTON1;
} else if ((mask & InputEvent.BUTTON2_MA... | 7 |
public static void main(String args[]) {
int portnumber = 0;
if (args.length > 0) {
portnumber = Integer.parseInt(args[0]);
} else {
System.out.println("The portnumber to listen to is: ");
Scanner scanner = new Scanner(System.in);
String line = scanner.nextLine();
if(!line.isEmpty()) {
portnum... | 3 |
void parseLocation(String loc) {
loc = loc.replaceAll("[<>()]", "");
if (loc.startsWith("complement")) {
complement = true;
loc = loc.substring(COMPLEMENT_STRING.length());
}
String se[] = loc.split("[\\.]+");
if (se.length > 1) {
start = Gpr.parseIntSafe(se[0]);
end = Gpr.parseIntSafe(se[1]);
... | 2 |
private static List<OtuHolder> getOTUList(HashMap<Integer, Holder> map, OtuWrapper wrapper) throws Exception
{
List<OtuHolder> list = new ArrayList<OtuHolder>();
List<Integer> keys = new ArrayList<Integer>();
int numOTUS =wrapper.getOtuNames().size();
for( Integer key : map.keySet())
{
Holder h ... | 8 |
public void removeServiceListener(IServiceListener listener)
{
this._listeners.remove(listener);
} | 0 |
public void print(Graphics g, int x, int lag){
g.drawImage(bg.getImg(), 0, 0, null);
int j0 = (x-lag)/genObstacle.sWidth -1; // part of the grid to draw the obstacles (j0<0 special case)
int j1 = j0 + Stubi.WINDX/genObstacle.sWidth + 2;
for (int i = 0; i<obstacles.length;++i){ // i = y coord
for (int j = j0;... | 5 |
default WorldCoord getSubassemblySize(Entity excluding, Entity part) {
WorldCoord s = part.getSize();
double x = s.x, y = s.y, z = s.z;
if (getJoints().has(part)) {
EnumMap<JointType, Double> extents = new EnumMap<>(JointType.class);
for (Joint j : getJoints().get(part)) {
if (j.to != excluding) ... | 9 |
public static RoadGraph findNearestForStation(Point p) {
RoadGraph nearestPoint = null;
double minDistance = Double.POSITIVE_INFINITY;
double dist;
for (RoadGraph i : JMaps.getRoadGraphList()) {
dist = Math.sqrt((i.getPoint().x - p.x) * (i.getPoint().x - p.x) + (i.getPoint().... | 2 |
public boolean doesNotSurpassGrid(){
int moveable = 0;
if(this.vehicle.isHorizontal()){
moveable = this.vehicle.position.x;
} else {
moveable = this.vehicle.position.y;
}
if(moveable + this.steps + (this.vehicle.length-1) < this.gridSize && steps > 0){
return true;
} else if (moveable + this.steps ... | 5 |
@EventHandler
public void EnderDragonHunger(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getEnderDragonConfig().getDouble("Ender... | 6 |
public PdbTMReaderWriter () {
super() ;
// if (Outliner.DEBUG) { System.out.println("\tStan_Debug:\tPdbTMReaderWriter:constructor:DLL is loaded? " + bNativeInterfaceCodeLoaded); }
// if (Outliner.DEBUG) { System.out.println("\tStan_Debug:\tPdbTMReaderWriter:constructor:DLL is initialized? " + bNativeInterfaceCode... | 0 |
public ReleaseType getLatestType() {
this.waitForThread();
if (this.versionType != null) {
for (ReleaseType type : ReleaseType.values()) {
if (this.versionType.equals(type.name().toLowerCase())) {
return type;
}
}
... | 3 |
protected void remove(TileObjectDisplayData displayData){
//check if any of the three categories has the displayData, and remove it.
if (displayData == characterData){
clearCharacterData();
notifyDataRemoved(displayData);
return;
}
if (itemData.contains(displayData)){
itemData.remove(displayDa... | 5 |
HashMap<Character,Integer> generate_map(String k, int[] num)
{
//int num_size=num.length;
int cur_num=0;
HashMap<Character,Integer> m=new HashMap<Character,Integer>();
boolean[] filled=new boolean[26];
for(int i=0;i<k.length();i++)
{
char cur_char=k.charAt(i);
int pos=cur_char-'A';
if(!fill... | 6 |
public ScrambleDataInfo getScrambleInfo()
{
if (this.mStream == null)
throw new AssertionError();
if (this.mDataInfo != null)
throw new AssertionError();
this.mDataInfo = new ScrambleDataInfo();
try
{
byte[] hdrArr = new byte[2];
this.mStream.read(hdrArr, 0, 2);
this.... | 3 |
public String toString() {
String affiche = "message actionneur";
return affiche;
} | 0 |
private SubField[] parseSubFields(String name, int ior, String desc) {
int totalbits = 0;
int count = 0;
SubField[] sfs = new SubField[8];
StringCharacterIterator i = new StringCharacterIterator(desc);
int ior_hbit = 7;
while ( ior_hbit >= 0 && i.current() != CharacterIte... | 7 |
private void LoadAllLists() {
ResultSet tasksOnAssetListResultSet = null;
Statement statement;
try {
statement = connection.createStatement();
tasksOnAssetListResultSet = statement.executeQuery("SELECT * FROM Task WHERE projectID = " + projectID + "... | 9 |
public void generation(GameField currentField, GameField generateTo) {
if(currentField.width!=generateTo.width || currentField.height!=generateTo.height) {
//what the holy fuck are you trying to do?
throw new RuntimeException();
}
this.currentField=currentField;
... | 8 |
@Override
public void insert(Matrix matrix, int matrix_id) throws SQLException {
deleteMatrix(matrix_id);
int rows = matrix.getRowsCount();
int cols = matrix.getColsCount();
long startTime = System.currentTimeMillis();
statement = connection.prepareStatement(insertMatrixS... | 3 |
public ContentBody toContentBody() {
if (file != null) {
return new FileBody(file) {
@Override
public String getFilename() {
return fileName;
}
};
} else if (data != null) {
... | 2 |
public static final void FormatTable2() {
final File readFile = new File("printerfriendly.htm");
final File writeFile = new File("Table2.txt");
try {
writeFile.createNewFile(); // create write file
final FileWriter outStream = new FileWriter(writeFile); // open filewriter stream
final BufferedWrite... | 8 |
public boolean isRunning(){
return this.running;
} | 0 |
public void addAgent(String key, GenericAgent agent)
{
try
{
if (agent instanceof Organization)
return;
AgentRole role = agent.getAllAgentRoles().values().iterator().next();
AgentController control = role.getOwner().getContainerController().acceptNewAgent(key, agent);
//control.start();
... | 4 |
@Override
public Address getAddress() {
return super.getAddress();
} | 0 |
@Override
protected String crearTextoRespuesta() {
StringBuilder sb = new StringBuilder("***Resultados del algoritmo de inducción***\n\n");
sb = sb.append("Explicación:\n");
sb = sb.append("Objetivo: ").append(objetivo).append('\n');
for (Regla r : reglasDisparadas) {
sb... | 5 |
public void update(long deltaMs) {
GameActor a = Application.get().getLogic().getActor(actor);
if(a != null) {
PhysicsComponent pc = (PhysicsComponent)a.getComponent("PhysicsComponent");
x = pc.getX();
y = pc.getY();
z = pc.getZ();
setRotation(... | 2 |
@Test
public void testRemoveArgs() {
System.out.println("removeArgs");
NodeVariable.resetIds();
NodeFunction.resetIds();
NodeArgument.resetIds();
COP_Instance cop = null;
try {
cop = Cerberus.getInstanceFromFile("bounded_arity5.cop2");
} catch ... | 5 |
public ThePanel(String name, String imgPath) {
setBackground(BG_COLOR);
setLayout(new BorderLayout());
label.setForeground(FG_COLOR);
label.setFont(new Font("Sans", Font.BOLD, 90));
label.setVerticalAlignment(SwingConstants.CENTER);
label.setHorizontalAlignment(SwingConstants.CENTER);
label.setText(name)... | 4 |
public Object put(Object key, Object value) {
processQueue();
Object rtn = hash.put(key, SoftValueRef.create(key, value, queue));
if (rtn != null)
rtn = ((SoftReference)rtn).get();
return rtn;
} | 1 |
public boolean InsertarTipoCultivo(TipoCultivo p){
if (p!=null) {
cx.Insertar(p);
return true;
}else {
return false;
}
} | 1 |
@Override
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof DateSimple)) {
return false;
}
DateSimple d = (DateSimple) obj;
return year == d.year && month == d.month && day == d.day;
} | 4 |
public Boolean isLastCoffer(Player player){
if(player==null)
return null;
return (getTotalCoffers(player)==1);
} | 1 |
public void CreateAccount(RequestPacket request, DBCollection coll, User user) {
try {
if(!(paramValidator.validate(request.getUser_name(), "username") &&
paramValidator.validate(request.getEmail(), "email"))) {
user.sendMessage(msgTransformer.writeMessage(new ResponsePacket().setResponse("response").set... | 5 |
public int Finder(int start, int end, int elementToFind)
{
int mid;
System.out.println("start:"+start+ " "+"end:"+end);
if(start > end)
{
return -1;
}
mid = (start+end)/2;
System.out.println("mid : "+number[mid] + " " + elementToFind);
if(number[mid] == elementToFind)
{
return mid;
}
... | 8 |
static void returnConnection(Connection conn) throws DaoConnectException {
try {
if (conn == null || !conn.isValid(DB_ISVALID_TIMEOUT)) {
throw new DaoConnectException("Can't return: null or unvalid connection.");
}
} catch (SQLException ex) {
throw ne... | 4 |
public void doAction(String value) {
char choice = value.toUpperCase().charAt(0);
while (choice != 'A' && choice != 'B' && choice != 'C' && choice != 'D') {
System.out.println("Invalid selection");
value = getInput();
choice = value.toUpperCase().charAt(0);
}... | 5 |
private SubFrameResidual(int partitionOrder, int bits, int escapeCode, BitsReader data) throws IOException {
this.partitionOrder = partitionOrder;
numPartitions = 1<<partitionOrder;
riceParams = new int[numPartitions];
int numSamples = 0;
if (partitionOrder >... | 7 |
public Character fetchAbbr() {
if(!hasAbbArg()) {
throw new InputMismatchException("There is no abbreviation at the head of ArgSet.");
} else {
String s = pop();
return s.charAt(1);
}
} | 1 |
private static <T> Entry<T> mergeLists(Entry<T> one, Entry<T> two) {
/* There are four cases depending on whether the lists are null or not.
* We consider each separately.
*/
if (one == null && two == null) { // Both null, resulting list is null.
return null;
}
... | 7 |
@Override
public void keyTyped(KeyEvent arg0) {
// TODO Auto-generated method stub
} | 0 |
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final Combination that = (Combination)o;
if (!Arrays.equals(coins, that.coins)) {
ret... | 4 |
private boolean isDiagonallyOccupied(HantoCell from, HantoCell to){
boolean isOccupied = false;
if (to.getX() > from.getX()){
for (int i = from.getX() + 1; i < to.getX(); i++){
if (findCell(i, -i) == null){
isOccupied = false;
break;
}
}
} else {
for (int i = to.getX() - 1; i < from.get... | 5 |
private void readIndex() throws IOException {
// read the index entirely into memory
if (this.keys != null) {
return;
}
this.count = 0;
this.keys = new WritableComparable[1024];
this.positions = new long[1024];
try {
... | 8 |
public synchronized boolean put(String key, String value) throws Exception {
if (key != null) {
key = key.replaceAll("[\n|\r]+","").trim();
if (key.length() > 0) {
key = new String(key.getBytes());
//if (!this.contains(key)) {
value = ne... | 7 |
private void setBackgroundColor(int r, int g, int b) {
if (r >= 0 && r <= 255 && g >= 0 && g <= 255 && b >= 0 && b <= 255)
this.view.color.setBackground(new Color(r,g,b));
} | 6 |
public static void putResult(String barrierServer, LinkedList<Record> records, Map<Long, LinkedList<Long>> edgeListMap, int blockSize){
BServer server;
try {
server = (BServer) Naming.lookup(barrierServer);
Result [] results = new Result[blockSize];
int remainLen = records.size();
ListIterator<Record> c... | 8 |
public FlowBlock getNextFlowBlock(StructuredBlock subBlock) {
if (subBlock == subBlocks[0]) {
if (subBlocks[1].isEmpty())
return subBlocks[1].getNextFlowBlock();
else
return null;
}
return getNextFlowBlock();
} | 2 |
public SingleTreeNode uct() {
SingleTreeNode selected = null;
double bestValue = -Double.MAX_VALUE;
for (SingleTreeNode child : this.children)
{
double hvVal = child.totValue;
double childValue = hvVal / (child.nVisits + this.epsilon);
childValue =... | 3 |
public static Boolean dateIncrense(Date staticsDate){
Date d = new Date();
Date d1 = new Date();
Date d2 = new Date();
d1.setHours(0);
d1.setMinutes(0);
d1.setSeconds(0);
d2.setHours(23);
d2.setMinutes(59);
d2.setSeconds(59);
if(staticsDate.after(d1) && staticsDate.before(d2)){
return false... | 2 |
public String calculateGrade() {
double totalMarks = (quiz1 + quiz2 + quiz3 + quiz4) * .10;
totalMarks += (midTerm1) * .20;
totalMarks += (midTerm2) * .15;
totalMarks += finalTerm * .25;
double percentage = totalMarks; //because total maximum marks are 100 hence totalMarks would... | 7 |
public void deliverMode(Player p){
if(this == PREVOTE){
p.setMaxHealth(20);
for(Objective o : p.getScoreboard().getObjectives()){
o.unregister();
}
}else if(this == VOTE){
p.setScoreboard(Vote.output);
MenuManager.sendPlayerVoteMenu(p);
}else if(this == POSTVOTE){
}else if(this == GAME){
... | 5 |
public synchronized void bestowBlessings(MOB mob)
{
norecurse=true;
try
{
if((!alreadyBlessed(mob))&&(numBlessings()>0))
{
mob.location().show(this,mob,CMMsg.MSG_OK_VISUAL,L("You feel the presence of <S-NAME> in <T-NAME>."));
if((mob.charStats().getCurrentClass().baseClass().equals("Cleric"))
|... | 9 |
public BufferedImage render() {
BufferedImage res = new BufferedImage(MainPanel.GAME_WIDTH,MainPanel.GAME_HEIGHT,BufferedImage.TYPE_INT_ARGB);
Graphics g = res.getGraphics();
g.setFont(MainPanel.font);
// black background for in case of
g.setColor(Color.black);
g.fillRect(0, 0, MainPanel.GAME_WIDTH, M... | 2 |
@Override
/**
* @see IPlayer#bid(int, Pile)
*
* Return an integer of our bid. The bid must be higher than the current highest bid.
* Use the cards in our hand to determine how high we want to bid.
*/
public boolean bid(int currentHighestBid,Pile hand,boolean canMatch)
{
if(maxBid==-1)
{
/* First ti... | 5 |
public static void main(String args[]) {
String cfgPath = "sephiabot.xml";
boolean greet = true;
final String usage = "\nUsage: sephiabot [-c config file] [--nogreet]\n" +
" Default config file: ./sephiabot.xml";
if (args != null && args.length > 0) {
for (int i = 0; i < args.length; i++) {
if (args[... | 9 |
private void addHardwareSystemIfNew(HardwareSystem hardwareSystem) {
for(HardwareSystem hardwareSystemPresent : project.getHardwareSystemsCalculated())
if(hardwareSystemPresent.getId().equals(hardwareSystem.getId()))
return;
project.getHardwareSystems().add(hardwareSystem);
} | 2 |
private void updateStateEntry(List<Keyword> keywords, List<String> terms, boolean inAden, boolean askPrice) {
if(keywords.isEmpty()) {
DialogManager.giveDialogManager().setInErrorState(true);
return;
}
int k_count = 0;
int t_count = 0;
for( Keyword kw : keywords) {
if(kw.getKeywordData().getWord().cont... | 7 |
@Override
public int castingQuality(MOB mob, Physical target)
{
if(mob!=null)
{
if(mob.fetchEffect(this.ID())!=null)
return Ability.QUALITY_INDIFFERENT;
final Room R=mob.location();
if(R!=null)
{
for(int r=0;r<R.numInhabitants();r++)
{
final MOB M=R.fetchInhabitant(r);
if((M!=nu... | 7 |
public void validaCampos(String dataInicio, String dataFim, boolean pendencia, String probInformado, String probDetectado, String probSolucao, String probPendencia) {
if (dataInicio.equals(" / / : ") == true) {
JOptionPane.showMessageDialog(null, "Data Início inválida!");
txt_da... | 6 |
public static AbstractEvento manutencaoParseEvento(FuncionarioModel funcionario, ManutencaoModel model, EnumEtapasManutencao enumEM) {
if (enumEM.equals(EnumEtapasManutencao.RANQUEAMENTO)) {
return new EventoRanqueamento(model, funcionario);
} else if (enumEM.equals(EnumEtapasManutencao.ANAL... | 8 |
public static String unicode2String(String unicodeStr) {
StringBuffer sb = new StringBuffer();
String str[] = unicodeStr.toUpperCase().split("U");
for (int i = 0; i < str.length; i++) {
if (str[i].equals(""))
continue;
char c = (char) Integer.parseInt(str[i].trim(), 16);
sb.append(c);
}
return sb... | 2 |
public static void main(String[] args) {
if (args.length != 2) {
greska();
}
int algNum = -1;
try {
algNum = Integer.parseInt(args[0]);
} catch (NumberFormatException ex) {
greska();
}
File file = new File(args[1]);
if (!file.exists()) {
greska();
}
List<String> lines = null;
try {
... | 7 |
private void deleteBall(int x, int y)
{
for(int i=0; i<Balls.size(); i++)
{
if(Math.sqrt(((x-Balls.elementAt(i).getPosition()[0])*(x-Balls.elementAt(i).getPosition()[0])) + ((y-Balls.elementAt(i).getPosition()[1])*(y-Balls.elementAt(i).getPosition()[1]))) <= Balls.elementAt(i).getRadius())
{
Balls.elemen... | 2 |
@Override
public MapConnector<String, Long> forceSynchronization() throws Exception {
try (Connection con = getConnectorInfo().getConnection()) {
forceClear();
int n = 0;
StringBuilder values = new StringBuilder();
String stm;
for (String s : getMa... | 5 |
public synchronized void put(T message) {
for (MessageQueue<T> q : outputs) {
q.put(message);
}
} | 1 |
public static void main(String[] args) {
try {
Date dt = new Date();
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
//System.err.println("DBThread Runs");
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager.ge... | 2 |
public ArrayList<Auction> searchWinnerByUsername(String username,
String winner) {
try {
ArrayList<Auction> auctions = new ArrayList<Auction>();
String[] keywords = username.split(" ");
String[] usernames = winner.split(" ");
String sql = "select * from (select * from " + tableName
+ " where ";
... | 7 |
public int characterAt(int at) throws JSONException {
int c = get(at);
if ((c & 0x80) == 0) {
return c;
}
int character;
int c1 = get(at + 1);
if ((c1 & 0x80) == 0) {
character = ((c & 0x7F) << 7) | c1;
if (character > 0x7F) {
... | 8 |
private static void exportNode(final Node node, final BufferedWriter writer, final boolean force) throws IOException{
if (!node.isModified() && !force) {
return;
}
final StringBuilder nodeString = new StringBuilder();
nodeString.append(" ");
nodeString.append("<node"... | 6 |
public void mainMenu() {
do {
System.out.println();
MenuActions action = userInputManager.showMenu("QUIZ PLAYER MENU", playerMenu);
try {
switch (action) {
case SELECT_QUIZ_FROM_LIST:
try {
... | 6 |
private Component luoAsetukset() {
JPanel panel = new JPanel(new GridLayout(4, 2));
JLabel pelaaja1Teksti = new JLabel("Pelaaja X: ");
final JTextField pelaaja1 = new JTextField();
JLabel pelaaja2Teksti = new JLabel("Pelaaja 0: ");
final JTextField pelaaja2 = new JTextField();
... | 8 |
public double calculateSimilarity(float[] value1, float[] value2) {
float sum = 0.0f;
float sum1 = 0.0f;
float sum2 = 0.0f;
for (int i = 0; i < value1.length; i++) {
float v1 = value1[i];
float v2 = value2[i];
if ((!Float.isNaN(v1)) && (!Float.isNaN(v2... | 7 |
void startUp() {
try {
updateProgress("Unpacking archives...", 25);
titleArchive = getArchive(1);
small = new RSFont(false, "p11_full", titleArchive);
regular = new RSFont(false, "p12_full", titleArchive);
bold = new RSFont(false, "b12_full", titleArchive);
fancy = new RSFont(true, "q8_full", titleA... | 3 |
public static RNASecStr loadSecStrCT(String path)
{
RNASecStr res = null;
try
{
BufferedReader fr = new BufferedReader(new FileReader(path));
String line = fr.readLine();
String seqTmp = "";
Vector<Integer> strTmp = new Vector<Integer>();
while(line!= null)
{
line = line.trim();... | 9 |
public boolean deleteAllSongs() {
try {
if (connection == null) {
connection = getConnection();
}
String sql = "delete from org.music";
Statement stmt = connection.createStatement();
return stmt.executeUpdate(sql) > -1;
} catch (Exception e) {
log.log(Level.SEVERE,e.getMessag... | 2 |
public void doPrint() {
List<String> nodes = this.graph.getVertexes();
for (String node : nodes) {
List<String> edges = this.graph.getIncident(node);
for (String edge : edges) {
if (this.graph.getSource(edge).equals(node)) {
System.out.format("%4s (%3s,%3s) %4s",
node,
this.graph.g... | 5 |
public String woundTaken(int épDamage, int fpDamage) {
if (épDamage != 0) {
épDamage -= armor.getSfé();
Ép -= épDamage;
Fp -= épDamage * 2;
} else {
fpDamage -= armor.getSfé();
Fp -= fpDamage;
}
if (Fp < 0) {
Ép -= ... | 7 |
public Object[][] getMultipleRows(String testcase) {
String testSheetName = getTestSheetName(testcase);
if(testSheetName.equalsIgnoreCase("TestSheet Not Found")){
return null;
}
HSSFSheet testSheet = workBook.getSheet(testSheetName);
String cellData;
int totalRows = testSheet.getPhysicalNumberOfRows(); ... | 9 |
@Override
public boolean getNGramsFromService(String context, int maxResults)
throws NGramException {
try {
NgramServiceFactory factory = NgramServiceFactory
.newInstance(NGramStore.Key);
if (factory == null) {
// NGramException if the service fails to connect
throw new NGramException(
... | 9 |
public void setUserlistImageOverlay_Height(int height) {
if (height <= 0) {
this.userlistImgOverlay_Height = UISizeInits.USERLIST_IMAGEOVERLAY.getHeight();
} else {
this.userlistImgOverlay_Height = height;
}
somethingChanged();
} | 1 |
public void setCatched() {
catched = true;
} | 0 |
public void drawHighlight(Graphics2D g) {
if (needsRefresh)
refreshCurve();
Graphics2D g2 = (Graphics2D) g.create();
g2.setStroke(new java.awt.BasicStroke(6.0f));
g2.setColor(HIGHLIGHT_COLOR);
g2.draw(curve);
g2.transform(affineToText);
g2.fill(bounds);
g2.dispose();
} | 1 |
public byte mixWt(String fileName) throws IOException {
initialize(fileName);
FileOutputStream fos = null;
DataOutputStream dos = null;
try{
// create file output stream
fos = new FileOutputStream("mixWt_bin");
// create data output stream
dos = new DataOutputStream(fos);
Strin... | 8 |
public void setTitle(String title) {
this.title = title;
} | 0 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!(affected instanceof MOB))
return true;
final MOB mob=(MOB)affected;
if((msg.amITarget(mob))
&&(!mob.amDead())
&&((mob.fetchAbility(ID())==null)||proficiencyCheck(mob,0,false)))
{
boolean yep=(msg.targetMinor()==C... | 9 |
public Component getTableCellRendererComponent (JTable table, Object value, boolean selected, boolean focused, int row, int column){
super.getTableCellRendererComponent(table, value, selected, focused, row, column);
if (column == 0 || column == 6){ //Week-end
setBackground(new Color(255, 220, 220));
}
e... | 6 |
public void poistaPieni() {
if (tyhja()) {
return;
}
boolean jarjVaihtoOk = false;
BinomiNode prev = null;
BinomiNode prevMin = null;
BinomiNode current = root;
BinomiNode currentMin = root;
BinomiKeko keko;
while (current != null) {
... | 8 |
public static void main(String[] args) {
FileInputStream fis=null;
ObjectInputStream ois = null;
try {
fis = new FileInputStream("MyBinaryFile.g");
ois =new ObjectInputStream(fis);
int x = ois.readInt();
double y = ois.readDouble();
Circle obj = (Circle)ois.readObject();
int radius=obj.g... | 6 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
try {
String nome = jTextField1.getText();
long tel = Long.parseLong(jTextField2.getText());
String email = jTextField3... | 2 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.