method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
8c548d8f-c2db-4fa7-9b02-c8854e9c7c04 | 1 | public boolean saveUpdateProductType() {
String productTypeName = txtProdName.getText();
if (productType == null) {
productType = Service.createProductType(productTypeName);
}
else {
Service.updateProductType(productType, productTypeName);
}
return true;
} |
005f3932-dc46-4621-acd5-aa3a7d521ce2 | 4 | public void setSubSubChildren() {
if (subchildren == null) {
return;
}
subsubchildren = new HashMap<RSInterface, RSInterface[]>();
for (RSInterface layer : subchildren.keySet()) {
if (layer.hasChildren()) {
RSInterface[] children = new RSInterface[layer.children.size()];
for (int index = 0; index ... |
9fbadc78-b198-4257-938e-659915feefec | 4 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final BitGroup other = (BitGroup) obj;
if (this.data != other.data) {
return false;
}
... |
674cf322-fda6-4385-b48d-70c83d11ce4b | 7 | public static String generateTree(City c)
{
TechTree tech = c.owner.techTree;
HashMap<String, Integer> predictedGain = new HashMap<String, Integer>();
for (String action: tech.allowedUnits)
{
predictedGain.put(action, generateTreeForCityUnit(c, action));
}
for (String action: tech.allowedCityImprovemen... |
25d3535f-bf51-4fcf-bf95-cedc157e967a | 9 | @Override
public ZoneOffsetTransition previousTransition(Instant instant) {
long epochSec = instant.getEpochSecond();
if (instant.getNano() > 0 && epochSec < Long.MAX_VALUE) {
epochSec += 1; // allow rest of method to only use seconds
}
// check if using last rules
long lastHistoric = this... |
95704a56-c0cb-403b-850b-b44c66a1c837 | 8 | protected void generateMines(int numMines) {
for(Actor actor : actors) {
if(actor instanceof Mine) { actors.remove(actor); }
}
counts.clear();
mines.clear();
Random rnd = new Random();
for(int m = 0; m < numMines; m++) {
int pos = rnd.nextInt(hidden.size() - m);
Iterator<Location> iter = hidden.i... |
18e088e3-952a-4b9f-818f-d2d3638ee526 | 9 | @Override
public final DocIdSetIterator iterator() throws IOException {
if (acceptDocs == null) {
// Specialization optimization disregard acceptDocs
return new DocIdSetIterator() {
private int doc = -1;
@Override
public int docID() {
return doc;
}
... |
01228dc2-ff38-4e67-acd0-878f815ef965 | 0 | public void setNumber(short number)
{
this.number = number;
} |
7b2c6664-9696-4b2d-b517-da1e57f8eb80 | 0 | public void updateRobotState(int currentState) {
robotState = currentState;
} |
8cdc9bc9-b5a6-4df8-8279-91d7a7027609 | 7 | private void DrawCircle(int color, int x0, int y0, int radius) {
int width = radius * 2 + 2;
int[] pixels = new int[width * width];
for (int i = 0; i < pixels.length; i++) {
pixels[i] = -100;
}
int xf = radius;
int yf = radius;
int f = 1 - radius;
int ddF_x = 1;
int ddF_y = -2 * radius;
int x ... |
5b6be2db-588d-4f34-972f-fd01e420f006 | 1 | public void reserveSmallConstants(GrowableConstantPool gcp) {
if (bytecode != null)
bytecode.reserveSmallConstants(gcp);
} |
b32d33b4-e9da-456d-9b62-32c6e34f406f | 3 | private List<UserBean> prepareListOfClientBean(List<UserModel> userModel) {
// TODO Auto-generated method stub
List<UserBean> listofClientBean = null;
if(userModel != null && !userModel.isEmpty()){
listofClientBean = new ArrayList<UserBean>();
UserBean userBean = null;
for(UserModel model : userModel){
... |
259acb5c-bbb8-4ca8-bdd6-9e02e3690384 | 8 | private String calcStepType(double temp) {
String stepType = "none";
// less than 90, none
// 86 - 95 - acid
if (temp >= ACIDTMPF && temp < GLUCANTMPF)
stepType = ACID;
// 95 - 113 - glucan
else if (temp < PROTEINTMPF)
stepType = GLUCAN;
// 113 - 131 protein
else if (temp < BETATMPF)
stepType =... |
46ee0875-5104-44a1-a99b-2d663aa5ebe4 | 4 | private void computeBias(double ai, double aj, int yi, int yj, double kii, double kjj, double kij) {
double b1 = model.b - Ei - yi*(ai-ai_old)*kii - yj*(aj-aj_old)*kij;
double b2 = model.b - Ej - yi*(ai-ai_old)*kij - yj*(aj-aj_old)*kjj;
if (0 < ai && ai<C)
... |
77ab337e-5ef1-4ab1-bd29-9b2851f4537a | 6 | @org.junit.Test
public void testSpacesAroundOperations() {
javaCode = "{{{{a+b=3;{{{{{{+++{{{{&&}}{{{int a=3-f;{{{!}||}}}}**a}{{}}}---}}}!!}}}/}}}}}";
FormatOptions formatOptions = new FormatOptions();
try {
makeTest(formatOptions);
} catch (Exception ex) {
if... |
1d1b4d4a-85df-4816-93f3-c3e711052f7b | 0 | private EarthService() {
} |
dcbd8a38-5330-421b-8dbb-51aad5a08851 | 1 | public static String getConstructorDescriptor(final Constructor c) {
Class[] parameters = c.getParameterTypes();
StringBuffer buf = new StringBuffer();
buf.append('(');
for (int i = 0; i < parameters.length; ++i) {
getDescriptor(buf, parameters[i]);
}
return buf.append(")V").toString();
} |
9973ea8a-8daa-4299-be7a-c7a9abba0309 | 7 | @SuppressWarnings("unchecked")
@Override
public double getScore(Object userAnswer) {
if (userAnswer == null)
return 0;
ArrayList<String> ans = (ArrayList<String>) userAnswer;
ArrayList<String> trueAns = (ArrayList<String>) answer;
int matches = 0;
if (isOrdered) {
for (int i = 0; i < Math.min(ans.si... |
dcb616f8-0e74-474e-b6ce-bf2c1e367773 | 3 | public static void main(String[] args) {
ArrayList<Apple> apples = new ArrayList<Apple>();
for (int i = 0; i < 3; i++)
apples.add(new Apple());
// Compile-time error:
// apples.add(new Orange());
for (int i = 0; i < apples.size(); i++)
System.out.println(apples.get(i).id());
// Using forea... |
ec6b54db-00ef-4a19-85e9-a535c52ba9d3 | 0 | @Test
public void testPizzaBuilders() {
Waiter waiter = new Waiter();
PizzaBuilder hawaiian_pizzabuilder = new HawaiianPizzaBuilder();
PizzaBuilder spicy_pizzabuilder = new SpicyPizzaBuilder();
waiter.setPizzaBuilder( hawaiian_pizzabuilder );
waiter.constructPizza();
... |
aba40c00-36d2-4b86-bf0e-2626bf66b5a7 | 0 | public static BeverageFactory getInstance() {
return instance;
} |
cf375ec5-e6f7-4b33-9480-2e4f4f8dd877 | 2 | private boolean cmdGlobalIgnore(CommandSender sender) {
boolean ignoring;
try {
ignoring = plugin.getPlayerHandler().ignoring(sender.getName());
}
catch (SQLException e) {
sender.sendMessage("An error occured!");
e.printStackTrace();
return true;
}
if (ignoring) {
sender.sendMessage("You a... |
0d8d347a-efff-4deb-b6bf-4536131c872a | 9 | private boolean computeSubsetSum(int[] num, int target,
ArrayList<ArrayList<Integer>> sol, ArrayList<Integer> current,
int index) {
if (index == num.length && target != 0 || target < 0) {
return false;
}
if (target == 0) {
if (!sol.contains(current)) {
ArrayList<Integer> validSubset = new ArrayLis... |
451efc14-5b22-40cf-9c88-36eedd40b390 | 1 | public void addParents(ArrayList<Point> points) {
points.add(location);
if (parent == null) {
return;
}
parent.addParents(points);
} |
86a1c162-0353-441e-b235-23681459abea | 8 | private void trackButtons (MouseInfo m){
List<Actor> l = getObjectsAt (m.getX(), m.getY(), null); //list of all the actors the mouse is ontop of
if (l.size() == 1 && l.get(0) instanceof Ui){
//if its just the ui, not hovering over a button
if (prevButton != null){
... |
7bc7068f-7a4f-460e-a4eb-9c7a515773a6 | 3 | private void setupPermissions() {
RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
perms = rsp.getProvider();
if (perms == null) {
throw new IllegalStateException("No vault compatable permission plugins found.");
... |
7c2e721b-3ad0-43fe-a8ed-e2ee5a8a1515 | 4 | @Override
protected boolean isAddable(Position pos) {
// YG: Piece의 isAddable과 중복되는 내용은
// YG: super.isAddable로 중복 제거할 수 있음
if (!isValidPos(pos))
return false;
if (!isEmptyPlace(pos) && isSameTeam(pos))
return false;
if (!isSafePlace(pos))
return false;
return true;
} |
5086c298-d6cf-49bd-bc0b-185c539202bb | 5 | public void keyReleased(KeyEvent e) {
int key = e.getKeyCode();
if(key == KeyEvent.VK_SHIFT){
hero.heroShoot();
System.out.println("Bleh");
}
if(key == KeyEvent.VK_A){
hero.left = false;
}
if(key == KeyEvent.VK_D){
hero.right = false;
}
if(key == KeyEvent.VK_W){
hero.up = fal... |
7729f12d-9726-4bab-8937-6150a17a2da6 | 9 | public static final boolean isIllegialWords(MapleCharacter player, String text) {
if (player.getReborns() > 3) {
return false;
}
String origitext = text;
text = text.replaceAll(" ", "").toLowerCase();
// server sucks
String[] bannedcomments = {"isserversux", "... |
937ff801-f1bc-44b9-a8dc-cd6a93310ce7 | 3 | static public ArrayList<Cuenta> search (String termino){
ArrayList<Cuenta> result = new ArrayList<Cuenta>();
for(Cuenta cuentaActual : cuentas){
if (cuentaActual.getCuenta().toLowerCase().contains(termino.toLowerCase())){
result.add(cuentaActual);
con... |
ef396a7e-e8ea-4ede-b3f2-27545d838fa5 | 4 | @Override
public void dibuja(Graphics g) {
g.drawImage(fondo, 0, 0, null);
if(pausa) {
g.drawString("PAUSA", 600, 400); //si esta pausado, se escribe pausa en la pantalla
}
barra.dibuja(g); //dibuja la barra
//dibuja los bloques
... |
753e8b18-ceb1-412b-a947-7881350bb155 | 6 | public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... |
d6c4bd15-c2d8-4deb-8081-7039e98df3e0 | 6 | public static void stream_align(FlaggableCharacterString input_stream,
Vector<AlignmentTuple> alignments,
Vector<AlignmentTriplet> triplets) {
for (AlignmentTuple alignment : alignments) {
// copy strings
FlaggableCharacterString presented = alignment.getPresented();
FlaggableCharacterStri... |
b36a0028-5a94-4b06-a28f-6a82fd1718b1 | 3 | private void processButtonAction() {
if (currentFile != null) {
if (!currentFile.exists()) {
text.append("Can't process not-existing file: " + currentFile.getAbsolutePath());
return;
}
text.append(String.format(
"Started to pro... |
39eaaf3f-48e4-427c-a52b-37b97b90967d | 2 | public int maxArea(int[] height) {
int i = 0, j = height.length - 1;
int res = 0;
while(i <= j){
res = Math.max(res, Math.min(height[i], height[j])*(j-i));
if(height[i] >= height[j]){
--j;
}else{
++i;
}
}
... |
bf8fa07f-3cf8-4daf-ac13-e21935582f2f | 8 | public CodeTree buildCodeTree() {
// Note that if two nodes have the same frequency, then the tie is broken by which tree contains the lowest symbol. Thus the algorithm is not dependent on how the queue breaks ties.
Queue<NodeWithFrequency> pqueue = new PriorityQueue<NodeWithFrequency>();
// Add leaves for sym... |
b351c7b5-9728-4e20-89a8-f1ecbb9b29b1 | 9 | @Override
public void run() {
setUp();
try {
while (true) {
String line = scan.nextLine();
Socket connection;
ObjectOutputStream out;
String[] arguments = line.split("\\W");
if (arguments[0].equalsIgnoreCase(STOP_SIGN)) {
connection = new Socket(SERVER_HOST, SERVER_PORT);
Proces... |
96c46908-bc94-4d05-8bf5-2f68fcb570ca | 1 | public void testGoodAnswerGameToBeWonAtLastAttempt() {
System.out.println("Test 3 : gameToBeWonAtLastAttempt");
Game gameToBeWonAtLastAttempt = new Game(new GameMaster(
DefaultValues.DEFAULTATTEMPTCOMBINATION1), new Board());
Answer answer;
// 1. Wrong combinations input. Number : Board size - ... |
14b87184-85c8-4a0c-90f2-1ae370672543 | 1 | public void random(int level){
if(level > 1){
nextNode = new Expression(this.level-1, next);
nextNode2 = new Expression(this.level-1, next);
}
else{
double ran = (Math.random());
nextNode = new InputXY(ran);
nextNode2 = new Inpu... |
454e0d54-0971-456a-aea8-399878d593bb | 4 | private void close() {
try {
if (rs != null) {
rs.close();
}
if (statement != null) {
statement.close();
}
if (conn != null) {
conn.close();
}
} catch (SQLException e) {
th... |
43c7fbae-2b20-40fb-810e-7ffccaad3ecf | 8 | public boolean noOfTiles(int n, int noOfPlayers)
{
if(noOfPlayers>1 && noOfPlayers < 5)
{
if (n < 5 || n >50)
return false;
else
return true;
}
else if(noOfPlayers>4 && noOfPlayers < 9)
{
if (n < 8 || n >50)
return false;... |
86590e10-501c-4395-a20e-bc9a5ef937dd | 5 | @RequestMapping(value = "/", method = RequestMethod.GET)
public String getFields(@PathVariable int idGame, ModelMap model) {
Game game = gameService.getGameById(idGame);
if ( !game.isCompleted() &&
((game.getFirstLogin().equals(SecurityContextHolder.getContext().getAuthentication().getN... |
66aee59e-1c78-48c8-a503-dd1c6abce6ef | 7 | public static Vector<Move> ObtainForcedMovesForWhite(int r, int c, Board board)
{
Vector<Move> furtherCaptures = new Vector<Move>();
if (board.cell[r][c].equals(CellEntry.white) || board.cell[r][c].equals(CellEntry.whiteKing))
{
if (Forwa... |
393b8bce-babf-4c0b-9946-3e93e36ce9ac | 2 | public String receiveMessage () throws IOException {
String nextLine = "";
String message = "";
int c;
while((c = this.conn.reader.read()) != '\n') {
if(c != 0){
nextLine = nextLine + (char)c;
}
}
message = nextLine;
return message;
} |
a3e38162-c13d-41cc-a78e-3a5ef078d423 | 3 | public VariableStack mapStackToLocal(VariableStack stack) {
StructuredBlock[] subBlocks = getSubBlocks();
VariableStack after;
if (subBlocks.length == 0)
after = stack;
else {
after = null;
for (int i = 0; i < subBlocks.length; i++) {
after = VariableStack.merge(after,
subBlocks[i].mapStackTo... |
fe55dd57-e6e2-42e1-b5c8-ef22bf650c6d | 3 | public boolean isPrimitiveNumber() {
return (clazz.isPrimitive() && !is(boolean.class) && !is(char.class) && !is(void.class));
} |
31f5e2bb-9f50-4cb1-96dc-5fa4110ffe18 | 2 | protected void startBroadMessage(){
while(true){
try{
Response rs = new Response();
String msg = "current datetime of server current datetime of server current datetime of server current datetime of server current datetime of server current datetime of server: " + System.currentTimeMillis();
//System... |
87d9cb09-2531-4f40-b060-5be85ff8a255 | 3 | private boolean failRequest(Request request) {
Site tempSite = this.siteMap.get(request.site);
// Check if the site exists
if (tempSite == null) {
System.out.println("error: site [" + request.site
+ "] does not exists");
return false;
}
... |
2fe00b4d-a260-4d92-a1f2-7a918873964b | 1 | public static void AddOrUpdate(HashMap<Integer, String> source, Integer number, String text) {
if (source.containsKey(number)) {
source.remove(number);
}
source.put(number, text);
} |
1cbeaf81-15a4-4b4c-b738-0bf7bb75cf5a | 0 | public static List<RapportVisite> selectOneByVisiteur(EntityManager em, Visiteur leVisiteur) throws PersistenceException {
List<RapportVisite> lesRapportVisites = null;
Query query= em.createQuery("select rv from RapportVisite rv where rv.matricule = :matricule");
query.setParameter("matricule",... |
fdf9e048-23fa-4f2d-a7d1-c319b46ac2cb | 9 | @Override
public void save(Client client) throws DAOException {
BaseDAO baseDAO = new BaseDAOImpl();
PreparedStatement stmtClient = null;
try (Connection conn = baseDAO.openConnection()) {
if (client.getId() == -1) {
stmtClient = getQuery(QueryType.INSERT, client, conn);
if (stmtClient.... |
7fe47468-7d97-4b75-bcee-b311cabe7cab | 9 | @Override
public void itemStateChanged(ItemEvent arg) {
if(!visualizer.isNull()) {
if(arg.getSource()==bSpeciesTree) {
visualizer.setSpeciesTreeVisible(bSpeciesTree.isSelected());
bTaxonNames.setEnabled(bSpeciesTree.isSelected());
}
if(arg.getSource()==bTaxonNames) {
visualizer.setTaxonNamesVisi... |
f3be8c5a-b81d-43d7-9104-8582abe734cd | 3 | private void loadLeads() {
DefaultComboBoxModel<Anstalld> dcbm = (DefaultComboBoxModel<Anstalld>) cbLead.getModel();
ArrayList<String> altemp = new ArrayList<>();
ArrayList<Anstalld> al = new ArrayList<>();
try {
String query = "select aid from projektledare";
al... |
581792ee-574b-468f-83a7-747d593b3b88 | 3 | public void calcTEmodeEffectiveRefractiveIndices(){
this.effectiveRefractiveIndicesTE = new double[this.numberOfTEmeasurementsPrism];
this.effectiveErrorsTE = new double[this.numberOfTEmeasurementsPrism];
if(this.setTEerrors){
ErrorProp alpha = new ErrorProp(this.prismAngleAlphaRad, ... |
47c76330-d262-4522-82f0-0b1b376c6d3a | 1 | public OutlinerCellRendererImpl() {
super();
// Add Actions to TextArea
setupMaps(this.getInputMap(), this.getActionMap());
setupMaps(this.button.getInputMap(), this.button.getActionMap());
Keymap keymap = this.getKeymap();
keymap.setDefaultAction(defaultAction);
// Settings
setFont(font);
... |
92a720e0-91a6-4fc6-b703-f4c6896945dd | 6 | public String buscarClientePorCorreo(String mail){
//##########################CARGA_BASE DE DATOS#############
tablaDeClientes();
//##########################INGRESO_VACIO###################
if(mail.equals("") || !mail.contains("@")){
mail = "No busque nada... |
d50ea5a7-db0c-499f-9ff6-dff7720a00f5 | 3 | public void stopMusic() {
// TODO Auto-generated method stub
if(wavThread.isAlive()){
wavThread.interrupt();
}
for(int i = 0 ; i < auline.length;i++){
if(auline[i]!=null)auline[i].stop();
}
kill=true;
ready=true;
} |
2eb5f81d-dc58-411b-8c06-f32e4a8ad61f | 1 | public boolean jumpMayBeChanged() {
return (subBlocks[1].jump != null || subBlocks[1].jumpMayBeChanged());
} |
c4d7c2f5-3627-4a08-96c7-c713c29607d0 | 0 | @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "DigestValue")
public JAXBElement<byte[]> createDigestValue(byte[] value) {
return new JAXBElement<byte[]>(_DigestValue_QNAME, byte[].class, null, ((byte[]) value));
} |
3cec599b-998f-4fc4-973b-a23184be1b77 | 5 | public ShopItem getItemByID(int... ids) {
if (ids != null && ids.length > 0)
for (ShopItem nextItem : items)
for (int nextID : ids)
if (nextItem.getID() == nextID)
return nextItem;
return null;
} |
a971024f-d572-4e2b-9e52-b1b673d98f28 | 1 | private void setIntegerValue(final Cursor cursor, final int index, final Field field, final Object object) {
final Integer value = (!cursor.isNull(index) ? cursor.getInt(index) : null);
Reflection.setFieldValue(field.getName(), object, value);
} |
a5f2191a-d634-44ae-984f-c1d4d029f19e | 5 | public static String addBinary(String a, String b) {
StringBuffer sb = new StringBuffer();
int alen = a.length();
int blen = b.length();
int isin = 0;
int i = 0, j = 0;
for (i = alen - 1, j = blen - 1; i >= 0 && j >= 0; i--, j--) {
int ac = a.charAt(i) - '0';
... |
a8ed88ca-53fc-466a-bbb5-04e3fd1d51c3 | 8 | private Converter<?, ?> buildConverter(Class<? extends Converter<?, ?>> converterType) {
try {
Converter<?, ?> converter = converterType.newInstance();
return converter;
} catch (Exception e) {
throw new IllegalArgumentException("Invalid constructor for "+converterTyp... |
7e523f76-1703-4966-b127-03dce89f64a0 | 9 | private void extractAttributes(String todoLine) {
resetFields();
List<BaseFragment> fragments = parseFragments(todoLine);
for (BaseFragment fragment : fragments) {
switch (fragment.getType()) {
case COMPLETION_DATE:
completionDate = (DateFragment) ... |
88ec049d-19c7-4704-a6cb-ce4675f60dc0 | 3 | public static MIME getMime(String extension) {
if (extension == null)
return DEFAULT;
for (MIME mime : MIME.values())
if (mime.extensions.contains(extension.toLowerCase()))
return mime;
return DEFAULT;
} |
c1e1a9cf-04b8-4e2f-9ed9-c521c377aa7c | 1 | public void removeDevilFruit(Player p)
{
for (PotionEffect effect : p.getActivePotionEffects()) //Clear Effects
p.removePotionEffect(effect.getType());
fruits.remove(p.getName());
} |
1fc1fa6f-413b-4991-890e-a8a5dd890b3a | 5 | public static void main(String[] args)
{
final Socket socket;
final InputStream entrada;
final OutputStream salida;
try
{
String IP_Address = args[0];
int port = Integer.parseInt(args[1]);
socket = new Soc... |
eb05c3e5-d808-4cf0-83c7-a9ba9a87f1e6 | 9 | public String analysePif(List<Scanner.pif> pifs, List<String> indentifiersST, List<String> constantsST){
System.out.println("------------------------- ANALYSIS PIFS ------------------------------");
String output="";
List<Object> stack = new ArrayList<>();
stack.add(states.get(0));
while(true){
... |
aec332f3-cad8-4a8e-bcf7-38d28f0f6d7a | 9 | public boolean isReadable(Object bean, String name) {
try {
Object[] call = resolveNested(bean, name);
if (call != null) {
bean = call[0];
name = (String) call[1];
}
} catch (IllegalAccessException e) {
return false;
... |
bb8786c4-4335-400d-85c9-5074d1471092 | 1 | public DistributedLock createLock(String lockName){
DistributedLock lock = locks.get(lockName);
if(lock == null){
lock = new DistributedLock(lockName, this);
locks.put(lockName, lock);
}
return lock;
} |
291ad8d9-c4d7-4ef4-87e1-cc5aed612cb5 | 3 | private void select() {
if (currentChoice == 0) {
gsm.setState(GameStateManager.CHARACTERSELECT);
}
if (currentChoice == 1) {
gsm.setState(GameStateManager.HELP);
}
if (currentChoice == 2) {
System.exit(0);
}
} |
34d63ed7-af71-4a52-b190-00915cc30281 | 5 | @Override
public String toString () {
String s = "Day " + (LineManager.dayNum + 1) + " {" + "\n";
// Print Translations
for (int i = 0; i < spTransNum || i < enTransNum; i++) {
// ts (Spanish) and te (English) are purely for speed's sake.
String ts = trans[i]... |
61c783e5-42ec-4050-9460-c8a484aa48be | 7 | * @return
*/
private TreeMap<String,ArrayList<String>> generateUnionSpecs(String[][] wCL, Set<String> dataKeys){
//System.out.println(dataKeys);
Map<String,?> rc=data.get("roomsandcourses");
Map<String,?> rd=data.get("roomsanddepartments");
Map<String,?> rp=data.get("roomsandprofessors");
TreeMap<String,Ar... |
c6b0545f-c1dd-4f41-9fd5-5e8f45c22214 | 0 | public DeliverRespMessage(byte msg_Id[],int sequence_id, int status){
int len=26;
this.sequence_Id = sequence_id;
buf =new byte[len];
TypeConvert.int2byte(len, buf, 0);
TypeConvert.int2byte(RequestId.Deliver_Resp, buf, 4);
TypeConvert.int2byte(sequence_id, buf, 8);
System.... |
78961b0d-e417-4a82-8685-f02a2df62b67 | 1 | private JPanel buildLicensePane()
{
JPanel panel = new JPanel(new BorderLayout());
URL url = Main.class.getResource("help/GPL.html");
try {
JEditorPane editor = new JEditorPane(url);
editor.setEditable(false);
panel.setBorder(BorderFactory.createEmptyBord... |
3ca8c88b-fb98-42c0-bd9f-bb151bd686e5 | 0 | public ForeignKey(String sourceTable, String sourceColumn, String targetTable, String targetColumn) {
this.sourceTable = sourceTable;
this.sourceColumn = sourceColumn;
this.targetTable = targetTable;
this.targetColumn = targetColumn;
} |
67d1091c-4992-4333-b73f-392a04920142 | 7 | private void executeCommand() {
String strCommand = console.getCommandString().trim();
if (strCommand.length() == 0)
return;
console.requestFocusInWindow();
if (strCommand.equalsIgnoreCase("clear") || strCommand.equalsIgnoreCase("cls")) {
clear();
return;
}
console.appendNewline();
console.setPro... |
bc3ed440-ecae-4757-b1e2-cab9d00448cb | 8 | static Cons helpGetTypes(LogicObject renamed_Object, Module module, Environment environment) {
{ Module mdl000 = module;
Context cxt000 = mdl000;
if (mdl000 == null) {
mdl000 = ((Module)(Stella.$MODULE$.get()));
cxt000 = ((Context)(Stella.$CONTEXT$.get()));
}
{ Object old$Mo... |
54d53c29-dafc-41b5-af9a-2ad2c4cc2706 | 0 | public Server(){
} |
7f357f41-60c6-43f5-9d7a-64ef3331e084 | 8 | public Point getNeighbor(int direction)
{
Point neighbor;
switch(direction)
{
case 0 : neighbor = new Point(xPos, yPos - 1); //North
break;
case 1 : neighbor = new Point(xPos + 1, yPos - 1);//North East
break;
case 2 : neighbor = new Point(xPos + 1, yPos); //East
break... |
0f7f446e-4fa8-4498-963f-d86a9e9868d3 | 7 | public String toString() {
StringBuilder result = new StringBuilder();
StringBuilder ascii = new StringBuilder();
if (offset >= 0)
result.append(String.format("Location: %d-%d\n", offset, offset+bytes.length));
else
result.append(String.format("Length: %d\n", bytes.length));
for (int i=0; i < bytes.le... |
409584ed-0778-462d-a3a2-4eb1768ea23d | 7 | public static boolean assignDeptToStudent(StudentBean student)
{
ResultSet rs=null;
Connection con=null;
PreparedStatement ps=null;
boolean result=true;
try{
String sql="INSERT INTO STUDENT(s_id,major,deptid) values (?,?,?)";
con=ConnectionPool.getConnectionFromPool();
ps=con.prepareStatement(sql);
... |
94325ee2-f430-4093-b95a-d27895bd9a9b | 3 | private Column getVirtualColumn( Token token ) {
VirtualStringColumn column = new VirtualStringColumn();
column.setType( FieldType.VSTRING );
token = getNextToken();
if ( !token.isOpenParen() )
throwException( "Expecting open parenthesis" );
token = getNextToken();
... |
bdf785b7-5295-413d-aa73-a129231b9fe9 | 5 | public Link getLink(Node source, Node dest){
for(Link l:links){
Node s = l.getSourceNode();
Node d = l.getDestNode();
if((s.getName().equals(source.getName())) && (d.getName().equals(dest.getName()))){
return l;
}
if((d.getName().equals(source.getName())) && (dest.getName().equals(... |
70ae2482-da31-476a-8d3b-621ed4ce5f6e | 0 | public void setNumeroColegiado(Integer numeroColegiado) {
this.numeroColegiado = numeroColegiado;
} |
1f548ad7-fdde-4f90-a030-045dc75e51fe | 4 | public int readWsFrameLength() throws IOException {
byte type = readRawByte();
if (type == 0xFF) {
return 0;
} else if ((type & 0x80) == 0x80) {
// If the MSB on type is set, decode the frame length
long frameSize = 0;
int lengthFieldSize = 0;
byte b;
do {
b = readRawByte();
frameSize <<... |
e8f9ec7e-9104-4485-a7d7-e2b50ce6630a | 4 | public static void readFile(String fileName) {
if (fileName == null) // Go back to reading standard input
readStandardInput();
else {
BufferedReader newin;
try {
newin = new BufferedReader( new FileReader(fileName) );
}
catch (Exception e) {
... |
42ecd0bf-e14d-4d25-9c07-b03de9476b88 | 9 | public int findMaxContinue(int[] data) {
int length = data.length;
int numContinue = 1;
int maxContinue = 0;
int currentPtr = -1;
for(int i = 1; i < length; ++i){
if(data[i - 1] <= data[i]){
numContinue++;
}else{
if(maxContinue < numContinue){
maxContinue = numContinue;
currentPtr = i ... |
785cd570-4c69-4d7c-ad5c-adf87477da06 | 4 | @SuppressWarnings("unchecked")
private void wednesdayCheckActionPerformed(java.awt.event.ActionEvent evt) {
if(this.dayChecks[3].isSelected()) {
this.numSelected++;
if(this.firstSelection) {
stretch();
}
... |
8a7a967d-925d-4e29-9550-2a5feff77da6 | 0 | public String getEspecialidad() {
return especialidad;
} |
3c9a6edf-4557-4021-b2cd-13e6fc1236b6 | 4 | private void getdatabeginptr()
{
try { fdbf.seek(0); } catch (IOException e) {}
try { signature = (byte) fdbf.readUnsignedByte(); } catch (IOException e) { e.printStackTrace(); }
fpt_file = false; //( signature == (DOS_FOX ? SIG_DOSFOX_WITH_MEMO : SIG_WINFOX_WITH_MEMO) );
try { fdbf.seek(8); } catch (IOExce... |
086b4301-d382-480e-8bcd-a7b9e2587fe3 | 9 | public void run() throws Exception {
//设置输出路径
FileWriter fw = new FileWriter("data.txt");
FileWriter fw2 = new FileWriter("title.txt");
sb.append("send_flower_count\t").append("send_egg_count\t").append("receive_flower_count\t").append("receive_egg_count\t")
.append("thread_length\t").append("reply... |
01fa2807-5463-4da4-8d6e-ed642cc03c5c | 7 | @Subscribe
public void changeServer(ServerConnectedEvent event) throws SQLException {
if(!plugin.chatEnabled)return;
if (!plugin.onlinePlayers.containsKey(event.getPlayer().getName())) {
String player = event.getPlayer().getName();
String connection = event.getPlayer().getAddress().getAddress()
.toStrin... |
81822856-133a-493b-9ae0-3b71bf997b65 | 3 | @Test
public void lineOneTodayMoltkeExpl() {
LinkedList<String> meals = new LinkedList<String>();
LinkedList<String> price = new LinkedList<String>();
Canteen curCanteen = new Canteen(new CanteenData(CanteenNames.MOLTKE, 0));// 0 for "today"
for (MealData m : curCanteen.getCanteenData().getLines().get(0).getTo... |
6674e749-1bc4-4a0a-b33f-bad394503dde | 1 | public void dropInfo(int howMuch) {
if ((howMuch & KNOWNATTRIBS) != 0) {
lvt = null;
lnt = null;
}
super.dropInfo(howMuch);
} |
c4ca8990-d0cd-4159-8fec-4c26257181ad | 6 | public void addLauncherToClient(String id) {
if ((id.isEmpty()) || (WarUtility.getLauncherById(id, this) != null)) {
try {
throw new Exception("This Id is empty or already exist");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
boolean is_hidden = (Math.ro... |
a0927cda-34e4-40af-b7d2-ba70d19c6a87 | 2 | public void insertarEnIndex(String pIndex, E pData){
for(Nodo<E> i = cabeza; i != null; i = i.getSiguiente())
if(pIndex == i.getIndex())
i.setData(pData);
} |
f4acdfe8-0fd6-4cd9-95b1-c5410af17fa8 | 6 | private void searchNewQueens() {
int y = 0;
for (int x = 0; x < CELL_SIDE_NUM; x += 2) {
Cell cell = contents[x][y];
if (cell.hasCheckerOf(Player.OPPONENT) && cell.hasSimpleChecker()) {
cell.getChecker().makeQueen();
}
}
y = 7;
... |
96fb8434-e5b5-49a7-b205-3f542d6e0a33 | 8 | private static char colArraytoUI(int input) {
switch (input) {
case 0:
return 'a';
case 1:
return 'b';
case 2:
return 'c';
case 3:
return 'd';
case 4:
return 'e';
case 5:
return 'f';
c... |
50deccc9-b0db-40fa-b453-2cd1ae6e7c92 | 2 | public void setCountryCode(String countryCode)
{
countryCode = countryCode.trim().toUpperCase();
if ( countryCode.isEmpty() ) {
throw new RuntimeException( "'country code' should not be empty" );
}
if ( this.countryISOCodes.indexOf( countryCode ) < 0 ) {
thr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.