method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
2bc12c97-f37a-415d-9c74-1309802fc6db | 7 | private void projectionTest(int n)
{
planner= new Planner();
Variable scale= new Variable("scale", 10);
Variable offset= new Variable("offset", 1000);
Variable src= null, dst= null;
ArrayList<Variable> dests= new ArrayList<Variable>();
for (int i= 0; i < n; ++i) {
src= new Variable("s... |
5d45d79a-3af6-4628-bdab-07f6d681d59f | 2 | private static void input() {
if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
bat.setDX(-.2);
} else if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
bat.setDX(.2);
} else {
bat.setDX(0);
}
} |
0bca3099-a451-44b6-b576-9aaf86df153f | 2 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
try {
List<String> args = new ArrayList<>();
args.add("disconnect");
if (!jFormattedTextField2.getText().equals("")) {
args.add(jFormattedTextField2... |
010f2c71-ee4c-4631-9fab-1f36ccb8ffb6 | 0 | public void setDirectionX(int a){
directionX = a;
} |
f31abb2b-201e-42df-a5b5-dbf8849d7e79 | 7 | private List<MergeCell> detectPotentialMerge(double[][] costs, int[] assigns, SegmentedImage A, SegmentedImage B, double ep){
List<MergeCell> result = new ArrayList<MergeCell>();
for(int j = 0; j < costs[0].length; j++){
List<ProcessedCell> temp = new ArrayList<ProcessedCell>();
int index = -1;
for(int k =... |
786aeb73-116d-41d9-ba4e-a16af467c21b | 2 | public int getBits(int size) { // readBits
int byteOff = bitOffset >> 3;
int bitOff = MAX_BIT_LEN - (bitOffset & 7);
int dest = 0;
bitOffset += size;
for (; size > bitOff; bitOff = MAX_BIT_LEN) {
dest += (payload[byteOff++] & Stream.bitMask[bitOff]) << size - bitOff;
size -= bitOff;
}
if (size == bi... |
fd7859fd-d87d-41c0-b778-343ba64a3015 | 4 | private void runSecurityDisplay(Scanner scan, PrintWriter pout)
{
if(sout != null)
{
sendMessage("another", pout);
return;
}
sout = pout;
sout.println("successful connection!");
while(theSocket.i... |
85cf5c20-08a2-46ef-b96f-e962bf51e0e4 | 5 | private String afficher_tableau(Vector<Vector<String>> data)
{
String stream="\n\n";
DecimalFormat df = new DecimalFormat("#.##");
for(int i=0;i<data.size();i++)
{
for(int j=0;j<data.get(i).size();j++)
{
if(i==0 || j==0)
str... |
62605656-ea46-403d-ae74-40cf170b0474 | 3 | @Override
public List<Class<?>> getDatabaseClasses() {
// register database beans/pojos
List<Class<?>> classes = new LinkedList<Class<?>>();
// add all beans here
classes.add(DHcorePlayer.class);
// ... add other beans
// return the complete list
return classes;
} |
ebbf73ff-f4d1-4c51-8df4-68107334793b | 2 | public static void addSpectator(Player player, boolean normalLeave) {
if (!HyperPVP.spectators.containsKey(player.getName())) {
HyperPVP.spectators.put(player.getName(), player);
} else {
HyperPVP.spectators.remove(player.getName());
HyperPVP.spectators.put(player.getName(), player);
}
if (normalLeave... |
7490b986-df00-4fed-9af2-a1c36074537c | 8 | @Override
public void update(Observable arg0, Object arg1) {
ModelNotification notificationType = (ModelNotification) arg1;
switch(notificationType) {
case LIST_OF_PARTICIPANTS_CHANGED:
participantsJListModel.clear();
ArrayList<String> participants = participantList.getParticipantNames();
for(in... |
4ddfe83f-67b3-4d48-bbf9-06a3f272e8a4 | 3 | public synchronized boolean update(){
long now = System.currentTimeMillis()/1000;
seconds = time - now + local - (server - start)/SERVER_RATIO;
if(seconds <= 0){
Window wnd = new Window(new Coord(250,100), Coord.z, UI.instance.root, "Timer");
String str;
if(seconds < -60){
str = String.format("%s el... |
bd8d985c-f8cc-4e0e-88aa-a607a9363f25 | 7 | public void jouerTour(Tour tour) {
if (tour.getType() == TypeTour.DEPLACEMENT) {
ArrayList<Mouvement> mouvements = ((Deplacement) tour).getMouvements();
for (Mouvement mouvement : mouvements) {
int xDepart = mouvement.getXDepart();
int yDepart = mouvement.... |
dc3e0668-54b8-4ab8-a028-ada95c93cd9c | 7 | public FSOnlineGame(MainFrame frame, int paneWidth, int paneHeight) throws ScriptException, NoSuchMethodException {
super(frame, paneWidth, paneHeight);
setBackgroundImage(Color.green, Main.getImageResource("bgGame.jpg"));
_gameManager = Main.getGameManager();
_sessionMa... |
cc6ccb01-cf29-41b1-a42d-a2ba4ce1a7eb | 1 | public static Settings getInstance(GameEngine engine) {
// Make sure someone smart hasn't done getInstance(null)
if (engine == null) {
return null;
}
return instance;
} |
80a4dc62-0543-4d4d-86d7-b362787e808a | 8 | public Combo_Box_Change_Group_Information() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException
{
//MAIN FRAME
super("Team J's Scheduler | Change Group Information");
setBounds(50,50,500,300);
setResizable(false);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
... |
207d23f5-88da-4254-858b-39177deca4a2 | 1 | public void setPlayer( int player) {
if ( player == 1) {
redBarIndicator.setVisible(true);
blueBarIndicator.setVisible(false);
} else {
blueBarIndicator.setVisible(true);
redBarIndicator.setVisible(false);
}
} |
9a1913d6-d86f-47ad-a2ff-7935cb72f8e3 | 4 | public static boolean writeObjectToFile(Object obj, String filename) {
try {
File file = new File(filename);
File parent = file.getParentFile();
if (parent != null && !parent.exists()) {
boolean dirsCreated = parent.mkdirs();
if (!dirsCreated) {
System.out.println("ERROR: Unable to crea... |
81675d80-eb6b-43e9-9f66-9916c78786e0 | 4 | public static String getAlphaVal( int i )
{
String ret = "";
int leftover = 0;
if( i > 701 )
{ // has 3rd digit
int z = (i / 676) - 1; // -1 to account for 0-based
if( (i % 676) < 26 )
{ // then "leftover" is actually 2nd digit
z--;
leftover = 676;
}
ret = String.valueOf( alpharr[z] );
... |
85120f11-f57c-45a5-94aa-4164e9fa65ac | 6 | public ClickableObject getObjectAt(Point point) {
for(ClickableObject object : clickableObjects) {
if(Geometry.isInRectangle(point.ix, point.iy, object.getIntX(), object.getIntY(), object.getRectangle())) {
return object;
}
}
for(Building building : buildings) {
if(Geometry.isInRectangle(point.ix, po... |
cdfb8d43-2e9c-467f-9d46-72ca93856304 | 1 | public Model() {
try {
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection("jdbc:mysql://registrydb.ccg9w8x2ngjz.us-west-2.rds.amazonaws.com:3306/crmpp", "admin", "invarionadmin");
initialize();
}
catch (Exception e) {
e.printStackTrace();
}
} |
c2ec4ceb-a4e1-4fed-aa44-1e61427bad84 | 9 | public OptionsDialog(final LauncherAPI api)
{
super(api.getFrame());
this.api = api;
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent event)
{
setVisible(false);
}
});
setTi... |
fbdc3dd6-0f1f-42eb-910f-2a95dde17f69 | 1 | @Override
public void mouseDragged(MouseEvent e) {
if (activeMove != null) {
activeX = e.getX();
activeY = e.getY();
} else {
activeX = -1;
activeY = -1;
}
BufferedImage copyImage = new BufferedImage(lastImage.getWidth(), lastImage.getH... |
435380a4-1410-4ea8-9adc-c2e144082d60 | 7 | public CommandClient(String host, int port) {
this.HOST = host;
this.PORT = port;
try {
this.socket = new Socket(HOST, PORT);
System.out.println("Connected ...");
} catch (UnknownHostException e) {
System.err.println("UnknownHostException with... |
7d3d30f1-669c-4293-86b1-95b4bdc5ce63 | 2 | public boolean isValid(Fact fact) throws UnknownKeyException {
for(Condition condition : conditions) {
if (!condition.isValid(fact))
return false;
}
return true;
} |
2a584f60-5609-4010-9b8a-fbeedaaa00f0 | 1 | public void handleInteraction(Automaton automaton,
AutomatonSimulator simulator, Configuration[] configurations,
Object initialInput) {
SimulatorPane simpane = new SimulatorPane(automaton, simulator,
configurations, environment, true);
if (initialInput instanceof String[])
initialInput = java.util.Arra... |
11f66f14-8c8d-46d2-a3d4-e02fb1915622 | 8 | @EventHandler
public void BlockPlace(BlockPlaceEvent event) {
SpoutBlock block = (SpoutBlock) event.getBlock();
if (block.getCustomBlock() == Reciever_Block_off) {
spout_Reciever_block.add(block);
block_channel.put(block, 0);
// Update Receiver
ReceiverUpdate(block);
}
else if (block.g... |
3b397922-6317-473c-a473-3f9e57b90fda | 7 | private void saveCurrentValues() {
try {
Mobile mobileTemplate = (Mobile) ((DefaultMutableTreeNode) mobilesTree.getSelectionPath().getLastPathComponent()).getUserObject();
mobileTemplate.setCreatureName(tbCreatureName.getText());
mobileTemplate.setScriptLocation(tbScriptLocation.getText());
mobileTempla... |
2f58569d-7bda-4819-b2b1-e87583eb3ca9 | 4 | @Override
public int hashCode() {
int hash = 3;
hash = 29 * hash + (this.majorVersion != null ? this.majorVersion.hashCode() : 0);
hash = 29 * hash + (this.featureVersion != null ? this.featureVersion.hashCode() : 0);
hash = 29 * hash + (this.bugfixVersion != null ? this.bugfixVersio... |
47a102fb-a01c-4685-897d-a4e4374bf7e7 | 5 | public static void moveLeft(OutlinerCellRendererImpl textArea, JoeTree tree, OutlineLayoutManager layout) {
Node currentNode = textArea.node;
Node youngestNode = tree.getYoungestInSelection();
Node node = tree.getPrevNode(youngestNode);
if (node == null) {
return;
}
// Put the Undoable onto the UndoQueu... |
ad9e3d44-9a27-4d98-9d34-93a03b932109 | 5 | private void liberaButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_liberaButtonActionPerformed
// TODO add your handling code here:
try {
if (fac.validaTicket(ticket.getCodigo())) {
JOptionPane.showMessageDialog(null, "Este ticket já esta liberado!");
... |
8f44f3db-b707-484d-baf8-1af650bbf39a | 9 | public static boolean identicalSignaturesP(MethodSlot method1, MethodSlot method2) {
{ boolean testValue000 = false;
{ boolean alwaysP000 = true;
{ StandardObject ts1 = null;
Cons iter000 = method1.methodParameterTypeSpecifiers().rest();
StandardObject ts2 = null;
Cons ... |
07c0ead6-22fa-4e90-85c6-387e1c77a8d0 | 7 | private void horizontalShade(Graphics g, JComponent c, boolean darkerToRight)
{
int width = c.getWidth();
int height = c.getHeight();
if(width > 255 * 2)
{
return; // exceedingly wide component not supported
}
Border bo = c.getBorder();
int rim = 1;
int left = rim;
int top = ... |
d142e1fb-d91f-4586-8bd3-e991802f8bd8 | 3 | public Treningsokt getAlleOkterEnMnd(String dato) { //"dd/MM/yyyy"
if (treningsokter != null) {
for (Treningsokt t : treningsokter) {
if (dato.equals(t.getDato())) {
return t;
}
}
}
return null;
} |
a64daabc-e64b-432e-bb30-a864f2826463 | 4 | protected void lazyClose() {
//System.out.println("emLazyClose "+this.ownerId);
try {
// auto-rollback if TX was started and is still open
if (getTransaction().isActive())
getTransaction().rollback();
} catch (Exception ex) { } // nothing we can do, silent fail
if (listener != null) {
try { listene... |
3013ee1a-bdb6-465a-b351-9cfd3d72f1f6 | 1 | public void add(Cluster cluster) {
if (!this.isCluster(cluster))
this.list.add(cluster);
} |
8858c850-5e0c-4674-8c88-cd99a7e2ad25 | 3 | public ArrayList<Piece> getValidMoves(PieceColor color) {
HashSet<Piece> moveSet = new HashSet<Piece>();
ArrayList<Piece> moves = new ArrayList<Piece>();
ArrayList<Piece> opposingPieces = getPieces(color.getOpposite());
for(Piece opposingPiece : opposingPieces) {
ArrayList<Piece> freeNeighbor... |
d0d55727-d9d0-4354-9405-3a34a6e0a90f | 7 | private boolean readFrame() throws IOException
{
final int len = is.read();
final byte[] buf = new byte[len + 4];
// read rest of frame, check header, ctrl, and end tag
final int read = is.read(buf);
if (read == len + 4 && (buf[0] & 0xff) == len && (buf[1] & 0xff) == START
&& (buf[len + 3] & 0xff)... |
102a3fad-03f5-4593-b5e1-4c5b75c5b87c | 3 | public static boolean like(String str1,String str2) {
// I hate remembering regular expressions, so I'll just write this ickle translator
if (str1 == null) return false;
if (str2 == null) return false;
if (str2.endsWith("*")) {
str2=str2.substring(0,str2.length()-1);
}
str1=str1.toLowerCase();
str2=st... |
a1e23af8-b757-4095-92b3-e282854ad541 | 8 | protected void convertMapsToSections(Map<?, ?> input, ConfigurationSection section) {
for (Map.Entry<?, ?> entry : input.entrySet()) {
String key = entry.getKey().toString();
Object value = entry.getValue();
if (value instanceof Map) {
convertMapsToSections((... |
81c24bf8-9e0f-4bb4-98e8-4ec36cbd3c86 | 3 | protected AbstractEdit getPrevEdit(UndoManager undoManager) {
int insertionPoint = getIndexOfNextAdd(undoManager);
if (insertionPoint < 1) {
return new NoEdit();
}
Class c = undoManager.getClass();
Field field;
try {
field = c.getDeclaredField("edi... |
b105be88-bda3-4f27-8280-8fe676156e85 | 8 | public boolean equals(Object obj) {
if (obj == this) return true;
if (obj == null) return false;
if (obj.getClass() != this.getClass()) return false;
Picture that = (Picture) obj;
if (this.width() != that.width()) return false;
if (this.height() != that.height()) return... |
6d117818-6b39-48ef-a2c8-52b83623a628 | 9 | Condition getCondition(String inName)
{
String strStore="Error opening file";
try
{
RandomAccessFile rafConditionDef = new RandomAccessFile("defConditions/"+inName.toLowerCase(), "r");
Condition cndStore = new Condition();
cndStore.strName = inName;
strStore = rafConditionDef.readLine();
while (!(... |
118ab578-88ea-406c-918a-d97bdce9a241 | 7 | protected static Queue<Cell> findPath(Cell inpSource, Cell inpDestination) {
Queue<Cell> q = new LinkedList<Cell>();
Set<Cell> used = new HashSet<Cell>();
Map<Cell, Cell> prev = new HashMap<Cell, Cell>();
q.offer(inpSource);
used.add(inpSource);
prev.put(inpSource, null);... |
a5b6aeb1-d0c3-4e2a-ab86-48c808d83a91 | 7 | public boolean cast(Spell spell) {
if (spell.getSpellbook().isOpen(ctx)) {
final Action action = ctx.combatBar.select().id(spell.id()).poll();
if (action.valid() && ctx.combatBar.expanded(true) && action.component().interact("Cast")) {
return true;
}
if (spell.getWindow().open(ctx)) {
final Compo... |
f9acf8a0-e628-43ee-8180-233450e58d6b | 8 | @Override
public String toString() {
switch (i) {
case 1 : return String.format(name + "(%d)", value);
case 2 : return String.format(name + "(%d)", value);
case 3 : return String.format(name + "(%d,%d)", value, value2);
case 4 : return name + " (" + Boolean.toString(bool) + ")";
case 5 : return name + " ("... |
89a590f4-ef02-45da-a74a-ff0d229a32bb | 7 | private void refreshTable() {
tblSchedule.setModel(new javax.swing.table.DefaultTableModel(
new Object[][]{},
new String[]{}) {
@Override
public Class<?> getColumnClass(int columnIndex) {
if (columnIndex == 0 || columnIndex == 2) {
... |
69eb8d00-0732-4159-ba6f-9dbcf60adcfa | 1 | protected Integer calcBPB_TotSec32() throws UnsupportedEncodingException {
byte[] bTemp = new byte[4];
for (int i = 32;i < 36; i++) {
bTemp[i-32] = imageBytes[i];
}
BPB_TotSec32 = byteArrayToInt(bTemp);
System.out.println("Общее количество секторов = " + BPB_TotSec32)... |
27fd2a1c-2939-466d-8d54-5b4ccf2fe7d5 | 0 | public void fileDeleted(int arg0, String arg1, String arg2) {
// IGNORE
} |
a3947ab4-135c-47d6-9523-e1975acc6215 | 3 | public XMLWriterWrapper writeFilledOrEmpty(String element, String content, int inLevel) throws XMLStreamException {
indent(inLevel);
indent(inLevel + 1);
if (content == null || content.isEmpty() || "true".equals(content)) {
writer.writeEmptyElement(element);
} else {
... |
5ee9cbcd-0911-4dcc-831f-3efdb7ea4c9b | 5 | BigDecimal getRollbackBalance(Operation src) throws OperationServiceException {
Operation repositoryOperation = find(src.getId());
BigDecimal rollbackAmount = repositoryOperation.getCost();
Account account = repositoryOperation.getAccount();
BigDecimal balance = account.getBalance();
... |
68edc997-9eb4-42ff-b012-eb26272b2c3d | 6 | public int minesNeeded(int i, int j) {
int flags = 0;
for (int x = i - 1; x <= i + 1; x++) {
for (int y = j - 1; y <= j + 1; y++) {
if (positionExists(x, y) || (x == i && y == j)) continue;
if (board[x][y].isFlagged()) flags++;
}
}
return board[i][j].numMines() - flags;
} |
c6e60b5d-31cb-4c85-9c7b-11152704ee90 | 9 | public void writeTRJ(String filename, int reldepth, String release) {
File file = new File(filename);
BufferedReader br = null;
String ln = null;
try {
br = new BufferedReader(new FileReader(file));
br.readLine();
ln = br.readLine();
while (ln != null) {
StringTokenizer stk = new StringTokeniz... |
74346055-82c9-4451-857b-2ebe056ba344 | 6 | public Catalog(Server Server) throws Exception
{
DatabaseClient DB = new DatabaseClient(Server.DataBase);
ResultSet table = DB.Query("SELECT * FROM catalog_pages ORDER BY id ASC;");
while (table.next())
{
CatalogPage Page = new CatalogPage();
Page.Id = table.... |
c4cfce6a-9cce-4926-a30c-6cd07a1c50ed | 3 | static Mode fromString(String string)
{
switch (string.toLowerCase())
{
case "zip":
return ZIP;
case "zipandwrap":
return ZIPANDWRAP;
case "unwrap":
return UNWRAP;
default:
return null;
... |
630a7f52-f7e1-4967-9c97-2effaa7feb03 | 8 | private void writeRigidBodies(Document document) {
for (int i = 0; i < rigidBodies.size(); i++) {
RigidBody body = rigidBodies.get(i);
Element rigidBody = document.createElement("rigid_body");
String type = ((body.getDynamicsType() / 100) == 1) ? "dynamic"
: ((body.getDynamicsType() / 100) == 2) ? "stat... |
ed329f48-ed8f-4e0f-baad-176fce66461b | 1 | public float VtoTextureSpace(float _v) {
if(texture != null) {
return (heightRatio * _v);
}
else {
System.err.print("RoyalFlush: Texture2D.VtoTextureSpace - No texture has been loaded.\n");
return _v;
}
} |
d566053d-9f06-48da-a736-b89cd5c271d0 | 4 | @Override
public void setBoolean(long i, boolean value)
{
if (ptr != 0) {
Utilities.UNSAFE.putFloat(ptr + sizeof * i, value == true ? 1.0f : 0.0f);
} else {
if (isConstant()) {
throw new IllegalAccessError("Constant arrays cannot be modified.");
... |
57735289-de59-4f5d-886b-b240a4b0fb73 | 4 | public void rectangle(double x, double y, double halfWidth, double halfHeight) {
if (halfWidth < 0) throw new RuntimeException("half width can't be negative");
if (halfHeight < 0) throw new RuntimeException("half height can't be negative");
double xs = scaleX(x);
double ys = scaleY(y);
... |
aa4def32-c3c5-4e16-b7c0-55cbafc1d151 | 5 | @Override
public void keyPressed(int k){
if(k == KeyEvent.VK_ENTER){
select();
}
if(k == KeyEvent.VK_UP){
currentChoice--;
if(currentChoice == -1){
currentChoice = options.length - 1;
}
... |
0ff15ad8-1bff-49f3-9d13-dc2b2aa4bfbd | 9 | @Override
public void keyPressed() {
if(parent.key == parent.CODED) {
if(parent.keyCode == parent.CONTROL) {
DrawMenu menu = new DrawMenu(parent, "ballgame.DrawMenu", new PVector(parent.mouseX, parent.mouseY));
}
}
switch(parent.key) {
case 'f':
ForceObject force = new ForceObject(parent, "ballg... |
ce71d7af-38ea-43e0-b23b-f0bfbd723dca | 0 | public DeleteServlet() {
super();
// TODO Auto-generated constructor stub
} |
b84e093a-a96b-49fa-8e1c-1e28861afa92 | 9 | private int interpreteStep(Node node) {
int east = (node.east + 100) - (currentPosition.east + 100);
int north = (node.north + 100) - (currentPosition.north + 100);
int rotation = 0;
boolean entro = false;
if (east == 0 && north == 1) {
rotation = 0;
entr... |
1fc11a42-0902-454f-9ebe-897b4dbc030c | 7 | public void actionPerformed(ActionEvent ev){
fen.comptnombre=0;
System.out.println("Veuillez placer un " +fen.liste2.getSelectedItem());
for(int i=0;i<5;i++){
if(fen.liste2.getSelectedItem()==fen.items[i]) {
compt=i;
if(compt==0){
f... |
eb2708fb-979a-439b-b01c-35d6833b0fb4 | 2 | public Match(int matchType, Playmode playmode){
this.gameID = -1;
this.userID = -1;
this.matchType = matchType;
this.playmode = playmode;
this.userIDtoMatchLoaded = new HashMap<>();
this.userIDtoClientEvents = new HashMap<>();
this.running = false;
this.playing = false;
this.showingCountDown = false;
... |
b35714f6-6961-4f92-a80b-432cb8e656de | 6 | private void initListeners() {
fsPathBrowseButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
File selectedDir = null;
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChoo... |
a08b3cd5-7ab8-4efb-865f-1b8754821171 | 3 | public final static void shutDownMM() {
if(MasterMetadata.artistES != null)
MasterMetadata.artistES.shutdownNow();
if(MasterMetadata.albumES != null)
MasterMetadata.albumES.shutdownNow();
if(MasterMetadata.songES != null)
MasterMetadata.songES.shutdownNow();
} |
4a79a877-34b2-41d3-8279-6331869894de | 6 | public void turnoComputer()
{
//metodo che scorre la damiera e riempie, per ogni mossa valida trovata, 2 liste di mosse differenti.
//Al termine di un'analisi (delegata a un'altra funzione), sceglie, dalle 2 liste, la mossa che reca
//maggiore vantaggio. Dopodichè, la esegue.
//Nel caso non fossero disponib... |
22d4f23c-1510-40a5-8192-1f397e3b593b | 1 | public MusicManagementService()
{
try
{
s3Credentials = TransferManager.loadKeys();
// To communicate with S3 use the RestS3Service.
s3Service = TransferManager.connectToS3(s3Credentials);
} catch (Exception e)
{
e.printStackTrace();
... |
4d2236d2-a6d6-45ab-a369-232e7dc451c4 | 7 | private void handleMouseEvent(final MouseEvent EVENT) {
if (active && MouseEvent.MOUSE_ENTERED == EVENT.getEventType()) {
final Region SRC = (Region) EVENT.getSource();
if (Orientation.HORIZONTAL == getSkinnable().getOrientation()) {
for (int i = 0 ; i... |
29fa8adc-0524-4313-bf20-c8e55f6a4f1a | 7 | public static Rule_SP parse(ParserContext context)
{
context.push("SP");
boolean parsed = true;
int s0 = context.index;
ArrayList<Rule> e0 = new ArrayList<Rule>();
Rule rule;
parsed = false;
if (!parsed)
{
{
ArrayList<Rule> e1 = new ArrayList<Rule>();
int s1 = c... |
8a9c83f6-0761-4eec-9e27-04de3f1a91d9 | 8 | public void move(Dimension bounds) {
int diameter = Math.min(bounds.width, bounds.height);
double Xcoord = Math.cos(2 * Math.PI * diameter / 2) + diameter / 2;
double Ycoord = Math.sin(2 * Math.PI * diameter / 2) + diameter / 2;
if (myCenter.x > Xcoord && myCenter.y > Ycoord) {
direction = 225;
}
if (... |
3d3f85f2-484e-4ff4-81f9-1665293bcc3d | 0 | public void removeFromWorld(){
removeFromParent();
currentChunk = null;
} |
60bc7436-ce74-4502-98f5-4041bc902141 | 3 | public void inicio(AreaConhecimento areaconhecimento) throws Exception
{
salvar = new JButton("Salvar");
id = new JTextInt(areaconhecimento.getId());
id.setEditable(false);
id.setEnabled(false);
nome = new JTextField(areaconhecimento.getNome() == null ? ""
: areaconhecimento.getNome());
ciencia = new J... |
8457068a-9eac-4700-9979-54947263f0c8 | 5 | private static byte[] safeFold(byte[] N, byte q) {
byte r = (byte)Math.round((Math.log(N.length)/LOG_2));
if(q >= r) {
return N;
}
byte[] R;
if(r - q > 1) {
N = safeFold(N, (byte)(q + 1));
}
int o = N.length/2;
R = new byte[o];
for(int i = 0; i < o; i++) {
byte b0 =... |
995f104c-aaf3-4842-bc90-4877b0664c8d | 8 | public Model getRotatedModel()
{
Model model = aSpotAnim_1568.getModel();
if(model == null)
return null;
int j = aSpotAnim_1568.aAnimation_407.anIntArray353[anInt1569];
Model model_1 = new Model(true, Class36.method532(j), false, model);
if(!aBoolean1567)
{
model_1.method469();
model_1.method470(j... |
917b39b9-bd25-4e66-b1b1-e06d45b0ecb4 | 4 | private int jjMoveStringLiteralDfa7_0(long old0, long active0) {
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(5, old0, 0L);
try {
curChar = input_stream.readChar();
} catch (java.io.IOException e) {
jjStopStringLiteralDfa_0(6, active0, 0L);
return 7;
}
switch (curChar) {
case 110:
if ((... |
4f0d7138-fb63-4286-b9de-912a99a75fb6 | 9 | @EventHandler
public void playerTakeDamage(EntityDamageEvent event) {
if (shazamImmunity.contains(event.getCause())) {
if (event.getEntity() instanceof Player) {
if (ShazamState.playersInShazamState.contains((Player) event.getEntity())) {
event.setCancelled(true); // should theoretically give
... |
72290ee7-2a66-45e7-91b5-1fc86cac9443 | 7 | public static void MP_COMMENT() {
char currentChar = file.charAt(index);
currentLexeme = "";
String tempLexeme = "";
int state = 0;
while(true){
currentChar = file.charAt(index);
switch(state){
case 0:
if(currentChar == '{') {
tempLexeme += currentChar;
index++;
currentColNumber++;... |
62408d2f-728b-4587-bd34-e3e0c5cbadfa | 3 | public void mousePressed(MouseEvent paramMouseEvent)
{
if (!PaletteComponent.this.OurPalette.getDisabled())
{
ProgramComponent localProgramComponent = PaletteComponent.this.Sample.copy();
Object localObject = PaletteComponent.this.realthis;
paramMouseEvent.getPoint(); paramMouse... |
4d7ab6c9-1336-456e-9992-b7989718065f | 3 | public GroupMembership getGroupMembershipByUsernameAndGroupID(int groupMembershipID, String username){
for(GroupMembership groupMembership : groupMemberships){
if(groupMembershipID == groupMembership.getGroupID() && username.equals(groupMembership.getUsername())) return groupMembership;
}
... |
93a5c227-e538-4364-9eed-d96f49c53f5c | 6 | protected int num_adjacent(HantoCoordinate location) {
int count = 0;
if(gameboard.get(new BasicCoordinate(location.getX(), location.getY() + 1).getkey()) != null) {
count++;
}
if(gameboard.get(new BasicCoordinate(location.getX() + 1, location.getY()).getkey()) != null) {
count++;
}
if(gameboard.ge... |
1e0e2f45-d5bc-4cf2-8288-2f8c20701d02 | 1 | public UserProperties() {
super("User Properties");
usersList = null;
try {
usersList = requests.getAllUsers();
} catch (Exception e1) {
e1.printStackTrace();
}
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setBounds(100, 100, 450, 300);
Toolkit toolkt = Toolkit.getDefaultToolkit();
Dim... |
fa21580a-4d07-4353-8896-bd2ffe8165df | 3 | public VueTournee(Tournee uneTournee, Color uneCouleur) {
setTourneeModel(uneTournee);
if(uneTournee.getCheminsResultats() !=null){
for (Chemin ch : uneTournee.getCheminsResultats()) {
for(Troncon tr : ch.getTroncons()) {
vTroncons.add(new VueTroncon(tr));... |
57f5a587-1abb-458d-90e3-b29980617e1b | 7 | private void validateInput() throws MojoExecutionException, MojoFailureException {
if (cores <=0)
throw new MojoExecutionException(String.format(
"Cannot process with no cores: `%d'",
cores
));
if (!maps.exists() || maps.isDirectory())
throw new MojoFailureException(String.format(
"Cannot proc... |
7dc26912-2c36-436f-b594-622cc8479c2d | 7 | @Override
public void alert(LayerEvent l) {
if (l.type == LayerEvent.LAYER_CREATED) {
layerCount++;
displayed.add(true);
selected = displayed.size() - 1;
}
if (l.type == LayerEvent.LAYER_SELECTED) {
displayed.set(l.layer, true);
sel... |
8bc91521-523e-4749-bfc8-f314e545dce1 | 6 | public Tarefa(String nome, String descricao, String data, String hora)
throws Exception {
this.nome = nome;
if (nome.isEmpty()) {
throw new NomeNullException("Nome é obrigatório");
}
this.descricao = descricao;
this.dataCriacao = new GregorianCalendar();
this.Concluida = false;
if (data.isEmpty()) ... |
4a2908f1-4fa2-4fb4-95bd-6fff4d85839f | 0 | public TMState getParent(){
return parent;
} |
2eadad47-56b8-4965-9e58-5f962840ccf8 | 0 | public static void main(String[] args) throws IOException
{
Math135.Math135Semester();
DamonReport.GenerateReport();
} |
d401098b-c0d0-4bb0-8050-e502837b4d04 | 1 | protected void btnAdicionarTelefoneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAdicionarTelefoneActionPerformed
Telefone tmp = new Telefone();
try{
tmp.setDdd(Integer.parseInt(txtDdd.getText()));
tmp.setNumero(Integer.parseInt(txtNumeroTelefone.getText()... |
5c338819-cd17-45da-bf22-437720a24c03 | 4 | public void addToOutput(String message) {
try {
Element p = gui.houtput.getParagraphElement(gui.houtput.getLength());
gui.houtput.insertAfterEnd(p, "<div align=left> "+message+" </div>");
} catch (NullPointerException e) {
e.printStackTrace();
} catch (BadLocationException e) {
e.printStackTrace();
... |
945c623e-ac4d-4721-9fec-6164ecd8be18 | 9 | public Subtitles()
{
// SETS EMPTY BORDER
this.setBorder(javax.swing.BorderFactory.createEmptyBorder());
text.setBorder(javax.swing.BorderFactory.createEmptyBorder());
// MENU
menu = new JMenu("Help");
menubar = new JMenuBar();
menu.setMnemonic(KeyEvent.VK_H);
menu.getAccessibleContext().setAccessib... |
79c45ea8-ab82-4742-942c-9091fb0d0073 | 3 | @Override
public boolean equals(Object obj) {
if(obj == null || !(obj instanceof Vector)) {
return false;
}
Vector vector = (Vector) obj;
return x == vector.x && y == vector.y;
} |
579b579c-9ebb-48f2-8f1c-7022c8510125 | 3 | public void removeItem(Item item) {
if(item.isStackable()) {
for(Item i : items) {
if(i.equals(item)) {
int ovf = i.removeQuantity(item.getQuantity());
item.setQuantity(ovf);
break;
}
}
}
else {
items.remove(item);
}
dirty = true;
} |
7b7a9081-2489-4be8-849e-427b0e784441 | 2 | static double[][] transpose(double[][] A){
double[][] B = new double[A[0].length][A.length];
for(int i = 0; i < A.length; i++){
for(int j = 0; j < A[i].length; j++){
B[j][i] = A[i][j];
}
}
return B;
} |
08100245-53fc-49d5-a2aa-0be59d068018 | 7 | public static char eight(int r, int c, int f) {
if (s1(r, c, f) || s2(r, c, f) || s4(r, c, f) || s5(r, c, f))
return '|';
else if (s3(r, c, f) || s6(r, c, f) || s7(r, c, f))
return '_';
return '.';
} |
faf58c67-597c-49ea-9e56-c2d4575bc08d | 8 | public synchronized float[] getConfidenceLevelInterval(float coverage)
{
if (coverage < 1e-3 || 1. < coverage)
throw new IllegalArgumentException("require 0 < coverage < 1");
float[] CLInterval = new float[2];
//first element is lower bound
//second element is upper boun... |
c1fb06ca-99b1-462b-ae74-b4c8e107beb3 | 5 | public void onUse(ItemStack s, Entity owner, int x, int y, World lvl)
{
AABB aabb = new AABB(x*Block.BLOCK_WIDTH,y*Block.BLOCK_HEIGHT,Block.BLOCK_WIDTH, Block.BLOCK_HEIGHT);
if((lvl.getEntitiesInAABB(aabb, null).size() == 0 || !block.isSolid()) && Block.getBlock(lvl.getBlockAt(x, y)) != block && Block.get... |
1d4020e7-7fce-4974-b4e8-69b6c63d834d | 9 | protected void flattenFastq(String input) {
final String newline = System.getProperty("line.separator");
StringBuilder sb = new StringBuilder();
try (BufferedReader br = Files.newBufferedReader(FileSystems.getDefault().getPath(input), Charset.defaultCharset())) {
String line = br.rea... |
5fb9b975-a03a-4d41-a201-bf24fb68845d | 5 | private LaunchItDatabase() {
try {
log.addHandler(getLogFileHandler());
} catch (SecurityException e) {
log.log(Level.SEVERE,
"Cannot create log file due to Security Exception: ", e);
}
try {
Class.forName("org.sqlite.JDBC");
} ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.