method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
57f25f4b-262d-4802-8942-a3ea053142cf | 0 | public ServerInterface(DcServer server) {
super(server);
this.server = server;
} |
6c241e1f-74bf-4b59-842f-9e5fc239b47e | 0 | private void updateAspectRatio() {
this.aspectRatio = ((float)this.width / (float)this.height);
} |
d37cb945-6425-4e55-8eba-bea356ee3835 | 9 | public WorldFrame(World<T> world)
{
this.world = world;
count++;
resources = ResourceBundle
.getBundle(getClass().getName() + "Resources");
try
{
System.setProperty("sun.awt.exception.handler",
GUIExceptionHandler.class.getName());
... |
33773b9b-6f69-4019-b6cc-5df801c0002b | 7 | private boolean calculateGameOver(){
for(int x = 1; x <= FIELD_SIZE; ++x){
for(int y = 1; y <= FIELD_SIZE; ++y){
if(field[x][y] <= 0){ return false; }
else if(
field[x-1][y] == field[x][y] ||
field[x+1][y] == field[x][y] ||
field[x][y-1] == field[x][y] ||
field[x][y+1] == field... |
9d577db7-8032-47d6-87e5-50b827744ccb | 9 | private void checkEnableButtons() {
//System.out.println("btnEnlever : " + lTeach.getSelectedIndex() + " " + lGroup.getSelectedIndex() + " " + lField.getSelectedIndex());
btnEnlever.setEnabled(lTeach.getSelectedIndex() != -1 && lGroup.getSelectedIndex() != -1 && lField.getSelectedIndex() != -1);
//System.ou... |
445be2e6-8ffd-4f04-a1a5-25c636b109eb | 5 | @Override
public Property deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
JsonObject o = jsonElement.getAsJsonObject();
String name = o.get("name").getAsString();
int displayMode = o.get("displayMode").getAsI... |
17ed8e5e-07d4-4838-bcc9-069908160d16 | 1 | public static Filter inSubpackage( String targetPackage )
{
if ( targetPackage == null )
{
throw new IllegalArgumentException( "Parameter 'targetPackage' must be not null" );
}
return new InSubpackage( targetPackage );
} |
1e8b355f-42b1-46be-99ed-5fc4fa5686a4 | 3 | @Execute
public void execute() {
StringWriter out = new StringWriter();
StringWriter err = new StringWriter();
try {
Processes p = new Processes(new File(exe));
p.setArguments((Object[]) args);
if (working_dir != null && !working_dir.isEmpty()) {
... |
571939d8-6a65-43f1-851c-88c77d882569 | 3 | public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
String uri = request.getRequestURI();
String action = uri.substring(uri.lastIndexOf("/") + 1, uri.lastIndexOf(".do"));
if (action.eq... |
917acfa0-7419-4e7e-8f80-43f4a9b06a55 | 6 | public void draw (Graphics g){
//box
g.fillRect(x-10, y-13, 20, 20);
//tread
if (dir=='l'){
g.fillRect(x-18, y-16, 35, 5);
g.fillRect(x-18, y+5, 35, 5);
}
else if (dir=='r'){
g.fillRect(x-18, y-16, 35, 5);
g.fillRect(x-18, y+5, 35, 5);
}
else{
g.fillRect(x-10, y-20, 5, 35);
g.fillRect(x+10,... |
50cb61bb-b0f3-46ed-9419-4d1925064df8 | 2 | public String getFormatName() {
if (format >= 0 && format < FORMAT_NAMES.length) {
return FORMAT_NAMES[format];
} else {
return "?";
}
} |
39ccaf55-5eef-4ecc-9a0b-f762b72a52b9 | 7 | double getLowestBaseP(String s){
Annotation document = new Annotation(s);
pipeline.annotate(document);
List<CoreMap> sentences = document.get(SentencesAnnotation.class);
Tree t =sentences.get(0).get(TreeAnnotation.class);
List<Tree> list = t.postOrderNodeList();
double min = 0;
String wo... |
428f1cef-8a30-4334-ba5a-ef149fc23e2c | 3 | @Override
public boolean hasNext() {
if ((lastNode!=null && index<lastNode.keysSize)||(toVisit.size()>0)) return true;
return false;
} |
f6b81e94-edfc-4fc3-8bd8-c77d9d098db5 | 2 | public boolean checkEventStatus(String identifier)
{
//We iterate through the whole list, checking for the Event with that identifier
//If we don't find any events with that identifier, we throw an exception
for(Event e: events){
if(e.getIdentifier().equals(identifier))
... |
cebdf8f0-44c9-4950-a8ad-d2bc078a7787 | 5 | public void checkParameters() {
getDriver().findElement(By.xpath(MainPage.FIRST_ITEM)).click();
getDriver().findElement(By.xpath(MainPage.COMPARE)).click();
ItemPage itemPage1 = PageFactory.initElements(getDriver(),
ItemPage.class);
Microwave microwave1 = itemPage1.grabAllCharacteristics();
System.out.p... |
18a4de33-473e-4c0e-998b-a761688edcb6 | 2 | @Override
public void setfocus(Widget w) {
if (w == this) {
w = in;
}
if (w == null)
return;
super.setfocus(w);
} |
97558f21-773d-48cf-908c-c973a755ef52 | 1 | public void end() {
if(!drawing) {
throw new IllegalStateException("You aren't drawing!");
}
drawing = false;
flush();
} |
8cfda9df-02d4-494a-a1e1-dd966a424caf | 3 | public static void Cliente_Armazena(String nome, InterfaceControlador ic_cliente) throws RemoteException{
Scanner sc = new Scanner(System.in);
System.out.println("Digite o nome do objeto:");
nome=sc.next();
System.out.println("Armazenando objeto...");
try
{
/*This sends the object to the Cont... |
69f30d18-de75-4bf4-900e-eb311ff2a8ce | 9 | public static void send(RsProtocol protocol, RsPlan plan) throws IOException {
DataOutputStream output = protocol.output; // merely to save some typing
RsObject [] object;
RsWall wall;
RsTarget target;
RsPlacement placement;
RsNavNode navNode;
RsNavLink n... |
f4755263-f28e-4cb6-8327-d4f2f06115ff | 6 | public void sendUnicast (Message message)
{
try
{
// On test le type de message que l'on envoi
switch (message.getType())
{
// Etat 20 : On envoi un message en unicast
case 20 :
{
// On creer une copie pour nous meme avant d'envoyer le message
Panel_Conversation conversation = (Panel... |
6a820591-dd2d-419c-b699-f289f10aa596 | 4 | private static void mutate(Individual indiv)
{
// Loop through genes
for (int i = 0; i < indiv.size(); i++)
{
if (Math.random() <= mutationRate)
{
// Create random gene
byte gene = (byte) Math.round(Math.random());
if(gene == 1 && GA.items[i] + indiv.getFitness() > 2000)
{
gene = ... |
aeed787b-4fe7-4ff0-be06-d19b9dec5b01 | 4 | @Override
public int loop() {
if(start) {
if(task == null || !task.hasNext()) {
task = container.iterator();
} else {
final Node curr = task.next();
if(curr.activate()) {
curr.execute();
}
... |
141ce000-5014-4950-be58-ca2b833f0d75 | 8 | private String convertMapToPlist(Object map)
throws IllegalArgumentException, UnsupportedEncodingException,
IllegalAccessException, InvocationTargetException, MDMException {
StringBuffer resultBuffer = new StringBuffer();
Set<?> keySet = (Set<?>) ((Map<?, ?>) map).keySet();
Iterator<?> it = keySet.iterator... |
74bde031-3db1-4bcc-9ca7-989772f815d3 | 3 | public static String trimTrailingWhitespace(String str) {
if (!hasLength(str)) {
return str;
}
StringBuilder sb = new StringBuilder(str);
while (sb.length() > 0 && Character.isWhitespace(sb.charAt(sb.length() - 1))) {
sb.deleteCharAt(sb.length() - 1);
}
return sb.to... |
0133ef3c-dd94-425e-8383-71d2e46e81f1 | 3 | private Document getHtml(serverCall call) throws IOException, badApplicationScriptParsingException{
Connection con=Jsoup.connect(call.url).userAgent(call.userAgent).ignoreContentType(true).followRedirects(true).timeout(20000);
if(call.variables!=null) con.data(call.variables);
switch (call.type){
case "GET": r... |
e051220b-73d5-4ed2-94d3-8b5293982b0d | 1 | public void attachDirty(Problem instance) {
log.debug("attaching dirty Problem instance");
try {
Session session = getSession();
Transaction tr = session.beginTransaction();
session.saveOrUpdate(instance);
tr.commit();
session.flush();
session.close();
log.debug("attach successful");
} catc... |
14d93787-f308-430f-b83a-4abe810eb634 | 4 | @Override
public void run() {
try {
byte[] buf = new byte[1000];
DatagramPacket dgp = new DatagramPacket(buf, buf.length);
DatagramSocket sk;
sk = new DatagramSocket(PORT);
sk.setSoTimeout(5000);
while (listening) {
... |
338eb8dc-cd0e-41c7-99c8-378277589cdb | 3 | static boolean isComponentClass(Class<?> c) {
Method[] m = c.getMethods();
for (Method method : m) {
if (method.getAnnotation(Execute.class) != null) {
return true;
}
}
return false;
} |
e7334f61-ce80-4544-9773-ecc2da49b395 | 4 | private boolean validateClassicTime(String timeString)
{
timeString = timeString.toLowerCase();
//format
if (!timeString.matches("\\d{2}:\\d{2}:\\d{2}:\\d{3}"))
{
return false;
}
//data
String[] time = timeString.split(timeDelimiter);
if (... |
c66562c0-c6aa-47ea-8b09-a2687b1b59bc | 7 | public static int fillTable(int rows, int cols,int colStart,int colEnd){
int cri=1;//current row index. begin calc at table [1][1]
int cci=1;//current col. index
int up,left,caddy,bestChoice=0,val=0;//the ones to look at and the one to choose.
char let1,let2;//left and top seq letters. gene left genome top
in... |
7d3e9aa5-9cd5-402b-a491-e57d74796ae5 | 1 | public Location freeAdjacentLocation(Location location)
{
// The available free ones.
List<Location> free = getFreeAdjacentLocations(location);
if(free.size() > 0) {
return free.get(0);
}
else {
return null;
}
} |
782090db-803c-42bd-86c6-c3d5258186c9 | 7 | static private double incbd(double a, double b, double x) throws ArithmeticException {
double xk, pk, pkm1, pkm2, qk, qkm1, qkm2;
double k1, k2, k3, k4, k5, k6, k7, k8;
double r, t, ans, z, thresh;
int n;
double big = 4.503599627370496e15;
double biginv = 2.22044604925031308085e-16;
k1 = a;
k2 = b - 1.... |
6811d4b4-9fa7-4ded-b730-c06d35e4b533 | 9 | @Command(cmd = {"ftc", "fairytailcraft", "ft", "fairytail"},
firstArg = {"info"})
public boolean returnMyInfo(CommandSender sender, String cmd, String[] args) {
if (sender instanceof Player) {
Player sent = (Player) sender;
if (args.length > 1) {
if (Util.hasPermi... |
ff9a06e0-bc24-451d-a8dc-70f26f0a9378 | 5 | public boolean equal(Matrix A) {
int i, j;
if(_cols != A._cols || _rows != A._rows)
return false;
for(i = 0; i < _rows; i++) {
for(j = 0; j < _cols; j++) {
if(_mat[i][j] != A._mat[i][j])
return false;
}
}
return tru... |
d9abdd73-3d82-458e-ace7-6cd78c65ac31 | 7 | @Override
public void actionPerformed(ActionEvent e) {
String comando = e.getActionCommand();
switch (comando) {
case "Ingresar":
abrirBase();
String user = view.getTextUser().getText();
String pass = new String(view.getTextPass().getPasswo... |
27ae1ae7-812e-48be-80ea-3b59aeff71e3 | 3 | public boolean isEmpty() {
if (hasNoGold() && hasNoWumpus() && hasNoPit()) {
return true;
} else {
return false;
}
} |
50d28cca-e13e-4aa4-ba69-d511ed79319f | 4 | public JobCreator(int nrClusters, String registry) throws RemoteException
{
this.nrClusters = nrClusters;
JobCreator.registry = registry;
/*LocalSocket lSocket = new LocalSocket();
socket = new SynchronizedSocket(lSocket);
socket.register("JobCreator");
socket.addMessageReceivedHandler(this);*/
... |
7f53f3d4-22bb-49bb-970f-5e5455b75931 | 4 | public Operator deepCopy(){
ArrayList<Variable> vl = new ArrayList<Variable>();
ArrayList<Predicate> adl = new ArrayList<Predicate>();
ArrayList<Predicate> del = new ArrayList<Predicate>();
ArrayList<Predicate> prl = new ArrayList<Predicate>();
for(Variable v : varList){
vl.add(v.clone());
}
for(Predic... |
39d5802f-498c-4c01-8e29-33674cce07e5 | 0 | public static void main(String[] args) {
FinalArguments bf = new FinalArguments();
bf.without(null);
bf.with(null);
} |
c29ed478-d117-400f-b922-ac05068fc735 | 7 | public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
String inputStr = sc.nextLine();
String strArr[] = inputStr.split("\\s+");
/*事前判断*/
if(strArr.length != 3){
System.out.println(0);
return;
}
Pattern pattern = Pattern.compile("[0-9]*");... |
d90261a0-aa47-43aa-9099-91303420fffd | 5 | public void doOpercity(){
BufferedImage bi = ip.getBufferedImage();
int w = bi.getWidth();
int h = bi.getHeight();
img = new BufferedImage(w, h ,
BufferedImage.TYPE_INT_ARGB);
for(int x = 0 ; x < w ; x ++) {
for (int y = 0 ; y < h ; y ++) {
int rgb[] = new int[3];
ipin.getPixel(x, y, rgb);
/... |
f3f0e3e0-0755-4913-81bc-168a785cd261 | 0 | public void modifyState(int m) {
state = m;
System.out.println("the state is " + state + " now");
} |
a21e4d3d-a3a6-4f89-8ecf-ccab5eed0b36 | 2 | private void addBigButtonToPanel(Component comp, JPanel pnl) {
Dimension dim = null;
if (mainWindowHeaderPanelSize == null) {
mainWindowHeaderPanelSize = settings.getDimension(MAIN_PANEL_TITLE);
}
System.out.println("addBigButtonToPanel]]]" + mainWindowHeaderPanelSize);
... |
290bef93-2994-40f4-b01c-7439b3e5d8c6 | 9 | private Set<Integer> findGivenValueInCol(int value, int startPoint, int numberOfFinds) {
Set<Integer> valueLocations = new HashSet<Integer>();
int stopPoint = (int) Math.pow(this.getSize(), 2);
int nextColCellNumber = this.getSize();
int foundNumber = 0;
if (numberOfFinds == 0) {
foundNumber--... |
399236bf-a545-4129-9aff-2290aa452eb9 | 2 | public static String romanConvertTo(int N) {
String roman = "";
for (int i = 0; i < numbers.length; i++) {
while (N >= numbers[i]) {
roman += letters[i];
N -= numbers[i];
}
}
return roman;
} |
4420cc44-844b-4054-8474-2bade7bf1f30 | 8 | @Override
protected void updateWeights() {
RBM rbm = getNeuralNetwork();
RBMLayerCalculator lc = getLayerCalculator();
int mbs = lc.getPositivePhaseVisible().getDimensions()[lc.getPositivePhaseVisible().getDimensions().length - 1];
if (weightUpdatesKernel == null || weightUpdatesKernel.getMiniBatchSize() != m... |
53162138-2b86-4dae-abb8-5fcac01f7184 | 5 | @Override
protected long calculateBase(final long base, final long remainder, final int droppedDigits, final int layoutBase)
{
final long roundedBase = base - ((base < 0 && remainder != 0) ? 1 : 0);
if (layoutBase != 1)
{
final long layoutRemainder = roundedBase % layoutBase;
if (layoutRemainder != 0)
{... |
1c53ac7f-804b-4561-a3e2-2b3c9d218493 | 9 | public void getFile(String path, File destination) throws IOException,
HTTPException {
path = urlEncodeFileNames(path);
InputStream is = null;
OutputStream os = null;
destination.getParentFile().mkdirs();
HttpURLConnection con = (HttpURLConnection) this.sc.getURL(
"/file/" + path + "/").openConnection(... |
f9260059-2410-43bf-a2cc-62752f6c10d4 | 1 | @Override
public void onPluginUpdate(final PluginUpdate update) {
if (update == null)
return;
versionPanel.removeAll();
JLabel newVersion = new JLabel(String.format("New version - %s, is available", update.getVersion().toString()));
newVersion.setForeground(Color.WHITE)... |
cee30700-c211-4c92-acae-319629d079b8 | 5 | public Boolean isInGui(int x, int y){
if(this.menu.getVisible() && this.menu.getShape().contains(x, y)){
return true;
}
if(this.spellbar.getShape().contains(x, y)){
return true;
}
if(this.inv.getVisible() && this.inv.getShape().contains(x, y)){
return true;
}
return false;
} |
689630fe-ac02-4b4b-956d-e5a5b5ebec0b | 1 | private String getStringValue(int value) { // interfaceIntToString
if (value <= Integer.MAX_VALUE) {
return String.valueOf(value);
} else {
return "*";
}
} |
31bbabd2-5e1a-4a9b-b2af-e718301c9f09 | 5 | @Override
protected ByteBuffer onAllocate(int size, AtomicBoolean cache)
{
// If the power is to small or to large then return a HeapByteBuffer.
if (size < minBufferSize || size > maxBufferSize) {
try {
return ByteBuffer.allocate(size);
}
catch (OutOfMemoryError e) {
System.err.format("Cannot al... |
61afcbf9-2e22-4938-b2ab-f5d4d6b22934 | 3 | public boolean isDefinedClass() throws SyntaxError {
if (isDigit()) {
return true;
} else if (isNonZero()) {
return true;
} else if (isChar()) {
return true;
} else {
// throw new SyntaxError("Invalid defined-class");
return false;
}
} |
24d661ee-55f2-49ab-9482-b044096008a7 | 2 | @Override
public void removeNode(Node node) {
// Check to see if the Node is contained in the NodeMap
if (!nodeMap.containsValue(node)) {
// If it is not contained then throw an error for trying
// to remove a nonexistent node
... |
9d7737cc-ca90-4f95-a0da-94dcd8be8356 | 3 | public void readAuthors(){
while(true){
Author author = new Author();
author.setFirstName(read("First name"));
author.setLastName(read("Last name"));
author.setCountry(read("Country"));
authors.add(author);
String yes = read("Create another... |
bce43cb0-e997-420f-a3d6-e110c24df287 | 2 | public synchronized boolean shot(Position position) {
if (insideBounds(position) && getItemType(position) != ' ') {
return field[position.getX()][position.getY()].fired();
}
return false;
} |
357c5fa1-a78f-4015-8281-938bfa882fdf | 4 | public Tab(String title, boolean userlist, int selectedaction)
{
this.title = title;
setName(title);
action = selectedaction;
jPanel1 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
output = new javax.swing.JTextArea();
input = new javax.swing.JTextField();
output.setEditable(... |
bec886a5-fb03-49b8-b101-91eb7b3c8a9a | 4 | public User findContact(String UserID) throws ProfileExceptions{
if (UserID == null || UserID.isEmpty()) throw new ProfileExceptions(ProfileExceptionType.UserIdEmptyName);
else {
for(User contact : this.contacts){
if(contact.getUserId().equals(UserID))
return cont... |
97ec6116-3f07-4038-8c23-78787223fdb5 | 9 | public boolean isSameTree(TreeNode p, TreeNode q){
if(p == null && q == null){
return true;
}
if(p == null && q != null){
return false;
}
if(p != null && q == null){
return false;
}
if(p.val == q.val){
return true && isSameTree(p.left, q.left) && isSameTree(p.right, q.right);
}
... |
1766358b-4936-4ac3-ba24-06d53600b4df | 3 | private String getReserveLabelText() {
if(model.getRobot().getFuelTank().isInfinite()) {
return "Reserves not needed: INFINITE FUEL.";
} else {
if(model.getRobot().getReserves() == 0) {
return "You don't have any reserves!";
} else if(model.getRobot().getReserves() == 1) {
return "You have 1 fuel r... |
ec66bc15-2d75-4376-b1db-f1f2f2aa43d8 | 7 | public boolean getOpenApplications(CommandSender sender, int pageNumber) throws SQLException {
String database = plugin.getConfig().getString("mysql.database");
String query = "SELECT * FROM `" + database + "`.`applications` WHERE `applicant` IS NOT NULL";
String getNumberOfResults = "SELECT C... |
a80dc826-341d-44e8-81ed-d3908c50323e | 3 | public String KonvertPcsToBigMedSmall(int qtyPcs, int bigToSmall, int medToSmall){
int Big, Med = 0, Small;
int sisaBig, sisaMed = 0;
//1. Cari Besar dulu
Big = qtyPcs/bigToSmall;
sisaBig=qtyPcs % bigToSmall;
//2. Cari Sedang jika Besar ada sisa dan medToSmall>1
i... |
6edc760a-7649-4d11-b7a9-6d111e59dbc4 | 1 | public void setResult(Boolean result){
if(!result)
loginViewTextPane.setText("Kullanıcı Adı ya da Parola Hatalı!");
} |
03a2cd17-9b37-486d-80de-8da13859ff46 | 1 | public void swapBackground(Track track) {
if(background != null) {
this.background.getClip().stop();
this.background.getClip().close();
}
this.background = track;
this.background.play();
} |
9f3d1c1b-f761-4133-85e0-a7738643acce | 6 | @Override
public void keyReleased(KeyEvent e) {
if (currentCard == 0) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
cardLayout.show(cardPanel, "1");
currentCard = 1;
}
}
if (currentCard == 2) {
if (e.getKeyCode() == KeyEvent.VK_C) {
updateStats();
cardLayout.show(cardPanel, "3");
cu... |
0482bbb9-67ad-49d2-9505-3b284649728b | 5 | public static void replace(char[] a, int len) {
int space = 0;
for(int i =0; i< len; i++) {
if(a[i] ==' ')
space ++;
}
int new_len = len + space*2;
int end = new_len - 1;
for(int i = len-1; i >=0; i-- ) {
if(a[i]!=' ')
a[end--] = a[i];
else{
a[end--] = '0';
a[end--] = '2';
a[end... |
8adabb4e-0397-4fd5-a024-3bcfeae116f1 | 6 | @Override
public boolean equals(Object other) {
if (other == null) return false;
if (other == this) return true;
if (!this.getClass().isInstance(other)) return false;
Vect o = (Vect) other;
if (o.getX() != this.getX()) return false;
if (o.getY() != this.getY()) return false;
if (o.getZ() != this.getZ()) ... |
d7ad429a-4cb5-42b8-88fe-66e4017879b1 | 5 | private boolean checkFieldsForSaving(boolean aReturnTrue) {
boolean mReturnValue = true;
//Check whether there has been a node selected in the parent categories.
if (aReturnTrue == false && (trvParentCategory.getSelectionCount() == 0 || getParentID() == this.pCategoryDetail.getID())) {
... |
1d66027f-2445-44c2-9952-1544d217a9e0 | 3 | public static int singleNumberByHashMap(int[] A) {
HashMap<Integer,Integer> hMap=new HashMap<>();
for(int i=0;i<A.length;i++)
{
if(hMap.containsKey(A[i])){
hMap.put(A[i], hMap.get(A[i])+1);
if(hMap.get(A[i]) == 3)
hMap.remove(A[i]);
}
... |
4ebc4e81-d372-4f08-9189-a95d40106dc6 | 5 | public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
{
Player player = (Player)sender;
ChatColor blue = ChatColor.AQUA;
ChatColor gold = ChatColor.GOLD;
ChatColor green = ChatColor.GREEN;
if(player.hasPermission("skeptermod.usecommand.smexplode") || (... |
2f8de3e9-328a-4e8c-8be0-ce16fbd2e5ed | 2 | @Override
public void doMapCollision() {
checkCollisionMap();
if (mapCollision == Collision.NONE) {
setFall(true);
}
if (mapCollision != Collision.NONE) {
setFall(false);
}
} |
686f2a1b-3778-421e-84d3-ae97411a7e80 | 7 | public static Iterator sqlJoin(Proposition proposition, LogicObject database, Stella_Object arguments) {
RDBMS.checkForExternalDbUpdates(proposition, database);
{ MemoizationTable memoTable000 = null;
Cons memoizedEntry000 = null;
Stella_Object memoizedValue000 = null;
if (Stella.$MEMOIZATION... |
4c91eca8-3293-4ac0-91f6-8898d7d2add5 | 9 | private int wrap(String string, int from) {
int pos = -1;
if ((pos = string.indexOf('\n', from)) != -1 && pos <= Terminal.width) {
return pos + 1;
}
if (string.length() <= Terminal.width) {
return -1;
}
pos = Terminal.width;
while (pos >= from) {
if (string.charAt(pos) == ' ' || strin... |
c0400c88-6d08-4a17-8934-f6f24349c424 | 5 | public void readFileAndPrint(String filePath){
File file = new File(filePath);
BufferedReader in = null;
try {
if(!file.exists()){
throw new SecurityException();
}
in = new BufferedReader(new FileReader(file));
String line;
while((line... |
38fe10d4-24be-4963-8d19-9107cf0f1756 | 1 | private void initializeBoard() {
for (int i = 0; i < boardArray.length; i++) boardArray[i] = OPEN;
} |
a8431e9f-64d1-4fe9-a992-404485c40ade | 2 | public long getAllMailSize() {
long size = 0;
for (int i = 1; i <= mailCounter; i++) {
if (!mailIsDeleted(i)) {
size += getMailSize(i);
}
}
return size;
} |
242c65db-7ca4-49d4-a520-baf0275a0a21 | 2 | public void elRelay(){
if (oi.getGB4()){
elRelay.set(Relay.Value.kForward);
}
else if (oi.getGB6()){
elRelay.set(Relay.Value.kReverse);
}
else
elRelay.set(Relay.Value.kOff);
} |
315c7f17-cd59-44b3-9c29-f8d2282994e3 | 5 | @EventHandler(priority=EventPriority.LOW, ignoreCancelled=true)
private void onEntitySpawn(EntitySpawnEvent event)
{
// Check per-chunk limits
for (GroupSettings settings : mChunkGroups)
{
if (!settings.matches(event.getEntity()))
continue;
// Prevent spawning if limit is exceeded
Chunk chunk =... |
55768ce1-7fde-4049-926c-ce51c88c9bed | 4 | public void enterScreen(int id){
previousScreen = currentScreen;
if(currentScreen != null){
currentScreen.hide();
}
currentScreen = screens.get(id);
currentScreen.show();
if(previousScreen != null && previousScreen instanceof GameScreen){
GameScreen prevGameScreen = (GameScreen) previousScreen;
... |
2c203d6f-b16f-44f2-af98-bed67ad5f027 | 1 | public void characters (char ch[], int start, int length)
throws SAXException
{
if (readCdata)
{
cdata.append (ch, start, length);
}
} |
e4ba05d8-6389-44af-ac01-78df2d0578c3 | 2 | private void setSelectedCardComponent(CardComponent component) {
if (component == selectedCardComponent) {
return;
}
if (component != null) {
component.setColor(ProjUtils.saturate(component.getTrueColor(), 0.25f), true);
}
else {
selectedCardCo... |
1f61e6ee-f0bb-4255-84cb-b201cea6dd81 | 1 | public synchronized void downloadPiece(Piece piece)
throws IllegalStateException {
if (this.isDownloading()) {
IllegalStateException up = new IllegalStateException(
"Trying to download a piece while previous " +
"download not completed!");
logger.warn(up.getMessage());
throw up; // ah ah.
}
... |
095abdf5-5a5f-46d0-b3f5-dae988b4f560 | 5 | public void start(String[] args) {
try {
if(args.length == 0)
processDirectoryTree(new File("."));
else
for(String arg : args) {
File fileArg = new File(arg);
if(fileArg.isDirectory())
processDirectoryTree(fileArg);
else {
// Allow us... |
b039ea66-5e4d-4fa6-bc5d-6f35439b8d20 | 9 | private int jjMoveStringLiteralDfa8_0(long old1, long active1)
{
if (((active1 &= old1)) == 0L)
return jjStartNfa_0(6, 0L, old1);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(7, 0L, active1);
return 8;
}
switch(curChar)
{
ca... |
c4bbe7ab-85ae-4539-bc29-fe07013a6ace | 9 | public FilterAction doVisit(String url, int depth, int childNum)
throws Exception {
if (visited.contains(url)) {
return FilterAction.DONT_VISIT;
}
FilterAction ok = FilterAction.VISIT;
Pattern pat = Pattern.compile(".*(\\.(css|js|bmp|gif|jpe?g"
+ "|png|tif... |
4460c54a-8466-4194-ac66-a37f13c5ca40 | 0 | public int size() {
return params.size();
} |
0eef3eda-8875-4c9a-9f21-7951665470c3 | 4 | @Override
public int read() throws IOException {
if(bufferFilled!=0){
int byte_ = 0;
Boolean bit;
for(int i = 0; i < 8; i++){
bit = readBit();
if(bit==null)
return -1;
byte_<<=1;
if(bit)
byte_++;
}
return byte_;
}
return in.read();
} |
6dcf6fb3-901b-4921-90df-ba6188a7b7be | 3 | public boolean equals(Object obj){
if(this == obj){
return true;
}
if(obj instanceof ColorAttr){
if(this.getName().equals(((ColorAttr) obj).getName())){
return true;
}
else
return false;
}
else {
return false;
}
} |
21c56fb3-f3c0-417a-9ce8-83e53f81215e | 2 | public void sql_add_account() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException
{
//Used for testing to let user know they are inside of the sql_add_acount method
System.out.println("Inside sql_add_account");
System.out.println(f_name_input.getText() + l_name_input.getTe... |
e2558158-7750-4bdb-91e8-650daf0117ee | 7 | void initFirstBlock(int maxStack, int maxLocals, String className,
String methodDesc, boolean isStatic, boolean isConstructor)
throws BadBytecode
{
if (methodDesc.charAt(0) != '(')
throw new BadBytecode("no method descriptor: " + methodDesc);
stackTop = 0... |
a58702bc-500d-4308-b08a-2cdef8eb467d | 1 | public String toString(){
String str = item.toString();
ArgumentListExpression itemsList = this.items;
if(itemsList != null)
str = str + "," + itemsList.toString();
return str;
} |
8d20cbbd-a2ac-4df8-afc0-52ac72fe0499 | 7 | private Rectangle findDiffRect(BufferedImage img, int frame) {
int left = width;
int top = height;
int right = 0;
int bottom = 0;
int x1 = (frame % grid) * width;
int y1 = (frame / grid) * height;
frame--;
int x2 = (frame % grid) * width;
int y2 = (frame / grid) * height;
for (int y = 0; y < height;... |
c2a378e2-2ea4-445a-b0bf-acceab2382dc | 6 | @Override
public int hashCode() {
int hash = 3;
hash = 79 * hash + this.id;
hash = 79 * hash + (this.tenant != null ? this.tenant.hashCode() : 0);
hash = 79 * hash + (this.workType != null ? this.workType.hashCode() : 0);
hash = 79 * hash + (this.workScale != null ? this.work... |
e4d6dc21-23a8-4892-933f-8dc5084e0595 | 0 | public void rotate(int angle)
{
} |
e6a0244f-2ba8-4542-b1ea-1d8dbccbd92a | 0 | public List<RouteStop> getStops()
{
return _stops;
} |
9d45454c-b7e7-4c63-9796-396263febe79 | 8 | public void move(int width, int height){
//
if(getLeft()&&getX()>=getV()){
setX(getX()-getV());
}
if(getRight()) {
if (getX()<=(width-(20 + getV()))){
setX(getX()+getV());
}
}
if(getDown()&&getY()<=(height-(20 + getV()))){
setY(getY()+getV());
}
if(getUp()&&getY()>=getV()){
setY(getY()... |
23efaa50-064a-4e1e-96c4-d66cc9fea82a | 7 | private void b_searchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b_searchActionPerformed
f_payment.setText("");
f_payment.setEnabled(false);
d_date_first.setEnabled(true);
d_date_last.setEnabled(true);
rb_payment.setSelected(false);
rb_expiry.setSel... |
f0ed811e-e8b0-4e14-aba4-4de653fe5dcf | 5 | void playerMovement(){
if (keyPressed)
{
switch(keyCode)
{
case UP:
posY -= 2;
break;
case DOWN:
posY += 2;
break;
case LEFT:
posX -= 2;
break;
case RIGHT:
posX += 2;
break;
}
}
fill(255);
noStroke();
ellipse(posX, posY, 30, 30);
... |
62bcaff8-ca11-4d06-aec1-eef99954097c | 5 | public void destroy(Integer id) throws IllegalOrphanException, NonexistentEntityException {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
TObject TObject;
try {
TObject = em.getReference(TObject.class,... |
049f74b2-ddeb-4c0f-8650-e78db0527ff0 | 3 | private void fetchNews() {
//Download news
try {
FileUtils.copyURLToFile(new URL("https://sites.google.com/site/moddlerepo/news.zip"), new File("./data/news/news.zip"));
} catch (IOException ex) {
Logger.warning("MainForm.formWindowOpened", "Could not fetch news!");
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.