method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
a2e376d4-9269-4b4c-9473-3ce3c53aefbd | 7 | public void setMetadata(Screen s){
//System.out.println("EuscreenxlitemApplication.setMetadata()");
FsNode node = (FsNode) s.getProperty("mediaNode");
if (node==null) return; // added by daniel.
String path = node.getPath();
String[] splits = path.split("/");
String provider = splits[4];
String id =... |
75c106ea-d734-4d44-bdec-27fbb874d622 | 9 | public static void main(String[] args) {
// Declaring variables
PPMEC outPPM;
// Store the reference of the output file.
// Default required number of arguments.
final int NUMBERS_OF_ARG = 4;
// Set width and height to -1 because these values cannot be negative.
// These values will be changed to positi... |
e2833afe-37cc-41da-acf7-fe916183df5f | 8 | private void checkForPopUp(MouseEvent e) {
Dockable target = getDockable();
JPopupMenu popup = new JPopupMenu(target.getDockKey().getName());
// first add the standard menu
DockKey key = target.getDockKey();
switch(key.getLocation()) {
case DOCKED:
initDockedPopUp(popup);
break;
case HIDDEN:
... |
9a1c706b-1c9e-4912-8db4-794b2ed11423 | 6 | public static void main(String args[]){
//Creating a colour scheme to test the renderer with
int colourSize = 5;
Colour[] colours = new Colour[colourSize];
for (int i=0; i<colourSize; i++) {
switch (i) {
case 0: Colour black = new Colour("#000000");
colours[i] =... |
e0cee361-fe15-4031-8d31-aac5d1b7a80b | 0 | public static String replace(String in, String match, String replacement) {
return StringTools.replace(in, match, replacement);
} |
84118cce-5de4-48e8-b384-17c15e48f4a1 | 4 | @Override
public void setAudioFormat( AudioFormat audioFormat )
{
resetStream( audioFormat );
if( attachedSource != null && attachedSource.rawDataStream &&
attachedSource.active() && sourceDataLine != null )
sourceDataLine.start();
} |
7b88b4f9-b323-47e2-b4e1-79a890068de3 | 0 | public Cube(double hight, double sum, double lengh_diag){ // первый конструктор
this.hight = hight;
this.setName("Куб");
this.sum = sum;
this.lengh_diag = lengh_diag;
this.area = hight*hight*6;
this.volume = hight*hight*hight;
} |
3c531e68-a6e4-4aa9-9b95-8b11b09a74c7 | 9 | public Element handle(FreeColServer server, Player player,
Connection connection) {
ServerPlayer serverPlayer = server.getPlayer(connection);
Unit unit;
try {
unit = player.getFreeColGameObject(unitId, Unit.class);
} catch (Exception e) {
... |
a7d9913f-9637-48af-995c-ececa35ad175 | 4 | public PersonalEventList getPersonalEvents(String asUserId, String asLastModified) {
if (asUserId == null || asUserId.trim().length() == 0) {
throw new IllegalArgumentException("userId is null");
}
String lsParams = encode(asUserId);
if (asLastModified != null && asLastModi... |
8e6eb411-fdee-45c7-a987-ee9761122175 | 1 | @Override
public double bonusAttaque(Territoire from, Territoire to) {
if( to.has(SallePartiel.class) )
return 2.0;
return 0.0;
} |
899a187a-7257-4a7b-bd36-bd32cba6bde1 | 8 | public void run() {
Timer.showStdErr("Finding genes ");
for (Gene gene : genome.getGenes()) {
if (geneIds.contains(gene.getId())) {
System.err.println("\t" + gene.getId());
genes.add(gene);
geneIds.remove(gene.getId());
}
}
if (!geneIds.isEmpty()) Timer.showStdErr("Not found: " + geneIds);
... |
04c85b13-2d33-4919-adf6-159b29596dfc | 8 | public void printBookData(boolean writeHeader, String fileNameBookData){
try{
String outputFileName = folder + fileNameBookData;
FileWriter writer = new FileWriter(outputFileName, true);
if (writeHeader){
writer.write("EffSpread;");
}
i... |
7d6c3997-afe3-4627-a12d-852d37c49cd7 | 2 | private static void printAllPermutations(char[] str, int index) {
if (index == str.length) {
System.out.println(str);
return;
}
for (int i = index; i < str.length; i++) {
swap(str, index, i);
printAllPermutations(str, index + 1);
swap(str, index, i); //important! need to swap back
}
} |
bcb08433-3b70-430f-a09a-e3991601a918 | 6 | public void getStats(){
Iterator sentenceIterator = sentenceMap.entrySet().iterator();
Iterator wordsIterator;
while(sentenceIterator.hasNext()) {
Map.Entry sentencePair = (Map.Entry) sentenceIterator.next();
Sentence sentence = (Sentence) sentencePair.getValue();
... |
334ef620-3a99-422d-ac44-19a2f46428ce | 2 | private int getNextClientId() {
logger.finest("Getting next client id...");
synchronized(CONNECTION_LOCK) {
if(clients.size() > Packet.MAXIMUM_CONNECTION_ID - Packet.MINIMUM_CONNECTION_ID) {
logger.finer("Assigning anonymous connection id of " + Packet.ANONYMOUS_CONNECTION_ID + " to client because server has... |
40657f7a-9d7c-48a8-8e78-007c705de252 | 0 | public boolean isReplacement() {return isReplacement;} |
ff9f37c3-7cdf-4b11-b34c-ac589b6b3aa8 | 2 | public static void main(String[] args) {
ActionInfo.init();
SkillInfo.init();
MonsterInfo.init();
Monster monsterA=MonsterInfo.create(37);
Monster monsterB=MonsterInfo.create(38);
int MaxTurn=30, turnId=0;
Battle1V1 battle = new Battle1V1(monsterA, monsterB);
while (!battle.isEnd() && turnId<MaxTu... |
b08aa8a4-20fb-45a9-ae33-2d67c9fd1e74 | 3 | private Slot getFirstFreeCell() {
for (int r = 0; r < grid.getNumRows(); r++) {
for (int c = 0; c < grid.getNumColumns(); c++) {
if (cells[r][c].isEmpty()) {
return cells[r][c];
}
}
}
return null;
} |
a7226da1-727b-4864-bff1-f0f161e0d838 | 2 | public String hashpw (String pw) {
String encrypted = "";
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
byte[] passwordByte = pw.getBytes();
digest.reset();
digest.update(passwordByte);
byte message[] = digest.digest();
... |
a74c28be-f43c-468f-ab71-c5d91e88a224 | 9 | protected boolean[] datasetIntegrity(
boolean nominalPredictor,
boolean numericPredictor,
boolean stringPredictor,
boolean datePredictor,
boolean relationalPredictor,
boolean multiInstance,
int classType,
boolean predictorMissing,
boolean classMissing) {
... |
bbb7130a-02bb-49ed-8eb3-8303cbe32e00 | 8 | private void findNextLegalMove() {
nextLegalMove = null;
while (boardIterator.hasNext()) {
BoardSquare sq = boardIterator.next();
BoardCardinalIterator it =
new BoardCardinalIterator(state.getBoard(), sq.getRow(), sq.getColumn());
... |
d94a3b92-16b2-436d-9972-105634f6a5d0 | 3 | public static String convertByte(byte input, @NotNull String key) throws IkszorConvertException {
try {
boolean[] symmetric = IkszorManager.string2BooleanArray(key);
boolean[] value = IkszorManager.byte2BooleanArray(input);
boolean[] result = new boolean[8];
for(int i = 0;i < 8;i++)
result[i] = va... |
aa13ba1f-9bf4-46ea-9548-89400b18e277 | 8 | protected boolean prereqs(MOB mob, boolean quiet)
{
if(mob.isInCombat()&&(mob.rangeToTarget()>0))
{
if(!quiet)
mob.tell(L("You are too far away to do a holy strike!"));
return false;
}
if(!(CMLib.flags().isGood(mob)))
{
mob.tell(L("Your alignment has alienated you from your god."));
return fal... |
0abde0fb-fc0f-47f0-b765-ff80b59aadd6 | 0 | public RemoveCellEditor(PreferencesGUITreeTableComponent component) {
super(new JCheckBox());
this.component = component;
} |
a1eaf07f-1022-48fc-b693-fb3d0eb7487e | 8 | public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int T = sc.nextInt();
while(T>0)
{
T--;
String s=sc.next();
if(s.equals("78") ||s.equals("1") || s.equals("4"))
System.out.println("+");
else if... |
d8e27606-181c-49ed-8fb6-cbd7cf9db01f | 6 | public String HttpRequest(String url)
{
try
{
String content = "";
URL conn = new URL(url);
URLConnection yc = conn.openConnection();
yc.setConnectTimeout(5000);
yc.setReadTimeout(5000);
BufferedReader in;
in = new BufferedReader(new InputStr... |
c17aa6b4-0ec8-4916-8ffb-b85f5edd00a1 | 0 | public static Bank1 getInstance()
{
return bank;
} |
21f13b0b-ce6a-4af0-8b2b-a881fc6dd2ba | 7 | @Override
public void run() {
active = true;
while (keepRunning && !Thread.interrupted()) {
synchronized (guardlock) {
// Wait for the lock on the selector key-set before continuing
}
try {
int eventCount = selector.select(clientTim... |
2a2bd948-78b9-4044-a702-af19e5d4a3b8 | 4 | private String getOptionsForASS(boolean useASSInsteadOfSSA, Style style) {
String options;
if (style.bold)
options="-1,";
else
options="0,";
if (style.italic)
options+="-1,";
else
options+="0,";
if(useASSInsteadOfSSA){
if (style.underline)
options+="-1,";
else
options+="0,";
opt... |
fa379b80-21f4-429e-b82d-98d0f62391d2 | 1 | public static Partie getInstance(){
if( part == null ) {
part = new Partie();
}
return part;
} |
dfae3579-4ecd-4fe3-9f45-a7095622fab4 | 9 | public static void programme(String chaine,int nbEch, float amplMin, float amplMax, String forme, boolean sondes) throws InformationNonConforme {
// Forme
int type;
// Message aleatoire ?
boolean aleatoire;
float teb;
if (Pattern.matches("\\d{1,6}", chaine)) {
aleatoire = true;
} else if (... |
4969e1eb-481b-410e-8041-5ab860809863 | 5 | public static String unencodedSeptetsToString(byte[] bytes)
{
StringBuffer text;
String extChar;
int i, j;
text = new StringBuffer();
for (i = 0; i < bytes.length; i++)
{
if (bytes[i] == 0x1b)
{
// NOTE: - ++i can be a problem if the '1b'
// is right at the end of a PDU
// -... |
4d74d70d-6fd1-4bd2-879c-ee8f1ef9e6b2 | 0 | public void setRange(StopRange value) {
this.Range = value;
} |
8f47f6bb-ac01-4465-a645-b4efe32c376d | 4 | private String executeCmd(String cmd, String author) {
if(cmd.equals("counterget")) {
if(counters.containsKey(author))
return author + "'s counter value is " + counters.get(author);
else
return author + " has no counter";
}
int num = 0;
... |
da81657b-9502-4ed5-bba5-8298a524545b | 8 | protected void processEventBlocks(List<String> eventBlocks) {
if(generateStatistics) {
for(String block : eventBlocks) {
statistics.getOriginalMetrics().setInlineEventSize(statistics.getOriginalMetrics().getInlineEventSize() + block.length());
}
}
if(removeJavaScriptProtocol) {
for(int i = 0; i... |
fd78fea6-4342-4452-9e18-2f4849aafd28 | 0 | public boolean getIsInSources()
{
return _isInSources;
} |
66d337b7-dd02-4551-ad54-cff20453fc84 | 0 | public String[] getSymbols() {
SortedSet symbols = new TreeSet();
symbols.addAll(Arrays.asList(getVariables()));
symbols.addAll(Arrays.asList(getTerminals()));
return (String[]) symbols.toArray(new String[0]);
} |
5b6d773c-c867-4f8b-ba4e-8da6f93156bb | 0 | public int run()
{
sortSampling(aInt);
return 0;
} |
7f366ae5-f1d0-4fba-8bf9-a3b2ee7178b9 | 1 | public static String getUserHome()
{
String home = System.getProperty("user.home");
if (home == null)
{
Joculus.showError(UIStrings.ERROR_NO_HOME);
return null;
}
return home;
} |
7c706719-f4f1-421e-99a5-72b753621bb4 | 5 | private void setOnDuty(Player player, Boolean silent){
if (plugin.TagAPIEnabled){
TagAPI.refreshPlayer(player); //refresh players tag. Makes it go red
}
//Save Inventory Section
plugin.getPlayerInventoryConfig().set(player.getName() + ".inventory", player.getInventory().getContents());
plu... |
103670df-0c6d-4e4c-9137-34be8a197eae | 7 | public List<Integer> postorderTraversal(TreeNode root) {
List<Integer> res = new ArrayList<>();
if (root == null)
return res;
Stack<TreeNode> S = new Stack<>();
S.push(root);
Set<TreeNode> visited = new HashSet<>();
while (!S.isEmpty()) {
TreeNode node = S.pop();
if (visited.contains(node)) {
r... |
77b36707-d1c4-47a7-9303-f3162361f1cb | 3 | private int search(Node x, String query, int d, int length) {
if (x == null) return length;
if (x.val != null) length = d;
if (d == query.length()) return length;
char c = query.charAt(d);
return search(x.next[c], query, d + 1, length);
} |
c1cfbce4-3533-4643-a287-1bc71277cd95 | 9 | @Override
public void run(Player player, String params) {
int radius = 20;
Block block = player.getLocation().getBlock();
List<Block> bList = new ArrayList<Block>();
for (int x = -radius; x <= radius; x++) {
for (int y = -radius; y <= radius; y++) {
for (int z = -radius; z <= radius; z++)... |
9962eba9-0545-423a-9820-eb4fbfcf2732 | 0 | private void modificarDatos(){
idLabel.setText(Integer.toString(p.getIdProducto()));
descripFt.setText(p.getNombre());
refFt.setText(p.getRef());
precioFt.setText(Double.toString(p.getPrecio()));
combFt.setText(Integer.toString(p.getCombinacion()));
} |
b6cde506-caa3-4084-bfec-fe9f163c77f0 | 3 | int find_f(int a){
int i;
for(i = a / 2 ;1 < i;i--){
if(a % i == 0)break;
}
if(i != 1){
return i;
}else{
return a;
}
} |
9798c13c-b63b-411f-962f-a68680ae49cd | 9 | public static void main(String[] args) throws IOException {
long inicio = System.currentTimeMillis();
StringBuilder out = new StringBuilder();
BufferedReader in;
File archivo = new File("entrada");
if (archivo.exists())
in = new BufferedReader(new FileReader(archivo));
else
in = new BufferedReader(new... |
3283e875-c336-4f4a-a8c5-f69d2a639274 | 9 | public static void tightenArgumentBindings(Proposition proposition, Vector iovariables) {
{
{ Stella_Object arg = null;
Vector vector000 = proposition.arguments;
int index000 = 0;
int length000 = vector000.length();
int i = Stella.NULL_INTEGER;
int iter000 = 0;
... |
74fd5bf6-7e87-48d2-913f-de91afc9b132 | 6 | public static String unescape(String string) {
int length = string.length();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < length; ++i) {
char c = string.charAt(i);
if (c == '+') {
c = ' ';
} else if (c == '%' && i + 2 < length) {
... |
90c6e566-bf34-4ed1-98e0-b27a940ec375 | 2 | public Game makeGameFromInput(String title, String ranking, String rules)
{
Game currentGame = new Game();
currentGame.setGameTitle(title);
if (checkNumberFormat(ranking))
{
currentGame.setFunRanking(Integer.parseInt(ranking));
}
else
{
return null;
}
String[] temp = rules.split("\n");
Arr... |
65f1458a-e6a4-4f1d-973e-4f64447ba77f | 6 | private static StructureComponent getNextVillageStructureComponent(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7)
{
if (par7 > 50)
{
return null;
}
else if (Math.abs(par3 - par... |
799ec7bc-53a9-4c68-b0b0-a64ad78562ef | 2 | private void createFileMenu() {
JMenu menu = new JMenu("Chatař");
JMenuItem settings = new JMenuItem("Nastavení");
settings.setIcon( new ImageIcon("img/settings-icon.png") );
settings.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_MASK) );
settings.addActi... |
259a6533-b85e-4600-9874-0d3f07a12148 | 1 | public static void setSpotLights(SpotLight[] spotLights)
{
if(spotLights.length > MAX_SPOT_LIGHTS)
{
System.err.println("Error: You passed in too many spot lights. Max allowed is " + MAX_SPOT_LIGHTS + ", you passed in " + spotLights.length);
new Exception().printStackTrace();
System.exit(1);
}
Phon... |
453eb754-c0b7-4ac5-a618-a2c7e821655b | 1 | public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
MapToolkitApp window = new MapToolkitApp();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
} |
d74942f5-e27e-4c19-9a8f-de3e372d2d7a | 6 | public void require(XMLNodeType type, String name) throws IOException {
if (mType == XMLNodeType.TEXT && type != XMLNodeType.TEXT && isWhitespace()) {
next();
}
if (type != mType || name != null && !name.equals(getName())) {
fail("expected: " + type.name() + "/" + name); //$NON-NLS-1$ //$NON-NLS-2$
}
} |
db8941f0-e991-4764-ab06-b2bb5ff37fa0 | 3 | @Override
public Accounting addBusinessObject(Accounting value) throws EmptyNameException, DuplicateNameException {
TreeMap<String, Accounting> map = dataTables.get(NAME);
if(value.getName()==null || value.getName().trim().equals("")){
throw new EmptyNameException();
} else if(ma... |
9b0faeaa-04bf-402e-a28d-d187387e3a39 | 0 | public void setRuns (int iterations) {
runs = iterations;
} |
af98b7c2-1539-4ce4-80e4-c2abb9e2ecab | 5 | private void resetDownSafe(final Phi phi, final Block block) {
if (phi.hasRealUse(block)) {
return;
}
final Def def = phi.operandAt(block);
if (def instanceof Phi) {
final Phi phidef = (Phi) def;
if (phidef.downSafe()) {
phidef.setDownSafe(false);
if (SSAPRE.DEBUG) {
System.out.println... |
2d5b969c-3090-4adc-b427-c1771b3f03ba | 6 | public int addBooking(Booking booking) {
int id;
PreparedStatement pStatement = null;
ResultSet rs = null;
try{
statement = connection.createStatement();
String query = "INSERT INTO bookings (user_id, cabin_id, date_from, date_to) "
+ "VALUES (?, ?, ?, ?)";
pStatement = connection.prepareStatement... |
edafcdee-8c02-44f4-9f59-0e9f49586690 | 8 | public void connect(TreeLinkNode root) {
if (root == null)
return;
LinkedList<TreeLinkNode> list = new LinkedList<TreeLinkNode>();
list.add(root);
while (!list.isEmpty()) {
int n = list.size();
TreeLinkNode pre = null;
for (int i = 0; i < n; i++) {
... |
f7efd592-008a-40f4-80de-c3315b3d34ba | 6 | public void actionPerformed(ActionEvent action) {
if(action.getSource().equals(connect)) {
int desired = 48;
int latency = 0;
try {
pf.setString("connect_hostname", serverName.getText());
pf.setInt("connect_port", Integer.parseInt(portNum.getText()));
pf.setInt("listen_port", Integer.parseInt... |
318e1742-6f11-4f48-abeb-a776264ba4d1 | 0 | public static void main(String[] args) {
// Working with Variables
String message = "Variables are Awesome!";
System.out.println(message);
// Reassigning Variables
String myMessage = "Variables are Fantastic!";
myMessage = "Variables are Super!";
System.out.println(myMessage);
// Number Variables
i... |
ce3f2f97-1b05-46b0-93e4-3a2de852273e | 5 | @Override
public void initialise() {
for (int custNo = 0 ; custNo < 8; custNo++){
int arrivalDay = masterAgent.agent.getClientPreference(custNo, TACAgent.ARRIVAL);
int departureDay = masterAgent.agent.getClientPreference(custNo, TACAgent.DEPARTURE);
int arrivalAuctionNo = TACAgent.getAuctionFor(TACAg... |
18b58cf9-e01a-4503-9013-4cd653a25af0 | 0 | public String getMed_depotLegal() {
return med_depotLegal;
} |
c21ad785-f3c4-4fd9-af26-f1efc78f179d | 1 | public boolean InsertarPropietario(Propietario p){
if (p!=null) {
cx.Insertar(p);
return true;
}else {
return false;
}
} |
db9efa6f-7e98-4967-b200-377f963cc1ec | 8 | public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int a,b,c,d;
while(true)
{
a=sc.nextInt();b=sc.nextInt();c=sc.nextInt();d=sc.nextInt();
if(a==0 && b==0 && c==0 && d==0)
break;
int sum = 1080;
... |
1001d6f1-8d23-4aa2-8317-ac54c98fbf6e | 2 | protected void putCommand(String cmd, String args) {
if (args == null || args.isEmpty())
cmd += "\r\n";
else
cmd += " " + args + "\r\n";
send(cmd);
} |
e4651cb8-75a6-464b-81e6-5513cbb7145d | 3 | private boolean rewriteKeys(){
PrintWriter keys;
try {
keys = new PrintWriter(pointerStorage);
} catch (Exception e) {
System.out.println("Can't open pointers Storage");
return false;
}
try{
keys.write("");
for(String ke... |
527924fb-9b93-4c5f-80d7-82348664676f | 7 | private void btSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSalvarActionPerformed
Usuario u = new Usuario();
if (!(txCodigo.getText().equals("")) || (txCodigo.getText().equals(null))){
u.setId_usuario(Integer.parseInt(txCodigo.getText()));
}
... |
64f1e6e2-1255-429a-b324-fc8b3e0ee751 | 8 | public static int[] getNeighboorsSlow(final int nb) {
final int result[] = new int[36];
final int v1 = nb % 10;
int root = nb - v1;
int cpt = 0;
for (int i = 0; i < 10; i++) {
final int candidat = root + i;
if (candidat == nb) {
continue;
}
result[cpt++] = candidat;
}
final int v2 = (nb /... |
949106f4-243a-4e68-b296-a802d7eb1438 | 3 | static boolean isUniueChar(String s) {
if (s.length() > 256) {
return false;
}
boolean[] charSet = new boolean[256];
for (int i=0; i<s.length(); i++) {
int val= s.charAt(i);
if (charSet[val]) {
return false;
}
ch... |
04fbc527-a379-4afc-a7c4-e045f7c487f5 | 8 | public static String escapeHTML(String s) {
int len = s.length();
StringBuilder es = new StringBuilder(len + 30);
int start = 0;
for (int i = 0; i < len; i++) {
String ref = null;
switch (s.charAt(i)) {
case '&': ref = "&"; break;
... |
002c3fa5-ae22-4667-9658-1732c409d820 | 3 | public boolean notOnScreen() {
return x + xmap + width < 0 || x + xmap - width > GamePanel.WIDTH || y + ymap + height < 0 || y + ymap - height > GamePanel.HEIGHT;
} |
2bc35ce5-e103-4984-a7e0-a79dfb88e19a | 3 | public static void sort(Comparable[] a) {
int N = a.length;
for (int k = N / 2; k >= 0; k--)
sink(a, k, N);
N = a.length - 1;
while (N < a.length && N >= 0) {
exch(a, 0, N);
sink(a, 0, --N);
}
} |
99dec489-852e-4343-a056-745c48a41744 | 0 | public ResourceId parseResourceId(int resourceId) {
return new ResourceId((resourceId & 0xFF000000) >> 24,
(resourceId & 0x00FF0000) >> 16, resourceId & 0x0000FFFF);
} |
c7c94873-28db-4ee0-a326-cf5599505256 | 8 | public void overideGroup(Group g, Entity proxy) {
if (groups.containsValue(g) == false) {
throw new IllegalArgumentException();
}
if (entities.containsKey(proxy.getCode())) {
throw new IllegalArgumentException();
}
if (entities.containsValue(proxy)) {
throw new IllegalArgumentException();
}
for (... |
672b4a28-34da-42a2-a895-9fd8c246a776 | 0 | public void setCaptchaError(String captchaError) {
this.captchaError = captchaError;
} |
bc1c7f72-c958-4c0e-9e5e-a439aa73c992 | 6 | public HashMap<String,Boolean> getRoles() throws Exception {
Connection conn =null;
Statement stmt = null;
ResultSet rs=null;
HashMap<String,Boolean> role = new HashMap<String,Boolean>();
try{
Class.forName("com.mysql.jdbc.Driver");
... |
1c84e134-859e-4e3c-87c2-c6dc2beb45b8 | 0 | public String getKeyReference() {
return keyReference;
} |
f9df58c7-d325-4527-bf1a-1619a63260aa | 9 | @Override
public Class<?> getColumnClass(int columnIndex) {
switch (columnIndex) {
//ВНИМАНИЕ! не перепутать Long и Integer
case 0: return String.class;
case 1: return BigDecimal.class;
case 2: return BigDecimal.class;
case 3: return String.class;
... |
dc0c9ada-d1c1-41c6-91b1-7343f9903682 | 6 | private static byte[] AES256CBC(byte[] intermediateKey, byte[] encryptedString) {
byte[] finalData = null;
try {
// AES with cipher block chaining and no padding
SecretKeySpec key = new SecretKeySpec(intermediateKey, "AES");
Cipher aes = Cipher.getInstance("AES/CBC/No... |
11beec89-2c05-439a-ab2f-8020f36c9306 | 5 | public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page ... |
c24bb7b3-3828-4847-acb1-1327b8cb6874 | 0 | public String getAccountSecret() {
return this.accountSecret;
} |
129b9446-b966-46fa-a614-a81e13cbe183 | 4 | private void createPath(MazeNode currentNode){
visit(currentNode);
ArrayList<Coordinate> neighbours = currentNode.getNeighbours();
removeEdgeNodes(neighbours);
removeVisitedNodes(neighbours);
if(neighbours.size() != 0){
// shuffle list so next node to select is random
Collections.shuffle(neighbours);... |
7e08673e-2e17-4d4c-9050-5ea40d45ff5a | 2 | private String optimize(String in)
{
this.buffer = in.split("\n");
this.nextLine = 0;
String threeCode, output = "";
while((threeCode = this.getNextCodeBlock()) != null){
for(Optimizer optimizer : optimizers){
threeCode = optimizer.optimize(threeCode);
}
output += threeCode;
}
return out... |
1e3257b5-f8dc-4521-abea-69a3d8c25ee6 | 6 | private void notesKeyEvent(KeyEvent evt){
if (!(evt.isControlDown() && evt.getKeyCode() == KeyEvent.VK_C)
&& !(evt.getKeyCode() == KeyEvent.VK_F1)
&& !(evt.getKeyCode() == KeyEvent.VK_F2)
&& !(evt.getKeyCode() == KeyEvent.VK_F3)) {
evt.consume();
}
... |
af529634-145c-4fd5-90f6-212b12a92afc | 2 | private void activateControllers() {
robotInstance.getJoystickHandler().clearControllers();
if (joy1Selection.getSelectedIndex() != 0)
robotInstance.getJoystickHandler().activateController(joy1Selection.getSelectedIndex() - 1);
if (joy2Selection.getSelectedIndex() != 0)
robotInstance.getJoystickHandler().ac... |
b6944a13-1217-4d41-a413-97b3460db752 | 5 | private void getNextPosition() {
// movement
if (left) {
dx -= moveSpeed;
if (dx < -maxSpeed) {
dx = -maxSpeed;
}
} else if (right) {
dx += moveSpeed;
if (dx > maxSpeed) {
dx = maxSpeed;
}
}
// falling
if (falling) {
dy += fallSpeed;
}
} |
9385f3f0-d998-426a-afc9-c6dbb1cf6f3a | 5 | public boolean loadBoardGraphFromResource(String resourceName) {
boolean isSuccessful = false;
// Attempt to read the data from the file
InputStream resourceStream = Thread.currentThread().
getContextClassLoader().
getResourceAsStr... |
45eddc5a-46e4-4fee-8fe1-40aa443f7416 | 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 fe... |
7efede1f-aaee-40d6-abc7-0a511430f67b | 5 | private void calcExtremes() {
_minLat = Double.MAX_VALUE;
_minLon = Double.MAX_VALUE;
_maxLat = -Double.MAX_VALUE;
_maxLon = -Double.MAX_VALUE;
for (int i = 0; i < mVertices.size(); i++) {
Vertex e = mVertices.get(i);
if (e.get_shape_pt_lat() < _minLat) {
_minLat = e.get_shape_pt_lat();
}
if ... |
ca1eaaf8-56e1-420e-a96f-678eb375171e | 6 | public void onEnable()
{
l.info("SpinningSign By NorthPL starting!");
new EventBlockBreak(this);
new AutoDisableTask(this);
this.saveDefaultConfig();
loadConfig();
Main.l.info("[SpinningSign] Language: "+confLanguage+" (available languages: en, pl)");
Main.l.info("[SpinningSign] Update ... |
203c5516-459d-4655-9d76-4085d63f4654 | 4 | public void run() {
Console.log("[UDP] receiver started.");
timer = System.currentTimeMillis();
while (!done) {
recieve();
if (stopConditionsProcessor(settings.getStopConditions())) {
Console.log("[UDP] " + receivedPackageCount + " packets received");
... |
edfbb99a-1550-47e3-96e5-9c3ac978852d | 5 | private void create() {
Runnable _runOne = new Runnable() {
@Override
public void run() {
Editor.this.previewPanel = new PreviewPanel(Editor.this.skin.getProperties());
}
};
Runnable _runTwo = new Runnable() {
@Override
... |
2f2ed6cb-fa1b-41e5-9363-fe039c339953 | 6 | private void jBEntrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBEntrarActionPerformed
try {
Socket socket = new Socket("localhost", 10001);
String emailEntrar = jTEmailEntrar.getText();
byte b[] = null;
User user... |
36c8c566-2eb1-4900-a11b-200243009583 | 7 | public Point getInputLocation() {
Scanner input = new Scanner(System.in);
String[] location; //String array needed to hold the two values
Point gridLocation = null; //Point array needed to return the grid location
boolean validLocation = false;
//prompt for the location
... |
38e37ee8-38e8-4930-8dd8-27832fee7568 | 9 | public static int getPlace(char spaceLetter)
{
int letterCoord = 0;
switch(Character.toUpperCase(spaceLetter))
{
case 'B':
letterCoord = 1;
break;
case 'C':
letterCoord = 2;
break;
case 'D':
letterCoord = 3;
break;
case 'E':
letterCoord = 4;
break;
case 'F':
letterCoord = 5;
... |
d06d16ec-b3af-468a-8757-113b07e9b90a | 6 | public final WaiprParser.invals_return invals() throws RecognitionException {
WaiprParser.invals_return retval = new WaiprParser.invals_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token char_literal66=null;
ParserRuleReturnScope inval65 =null;
ParserRuleReturnScope inval67 =null;
Co... |
6ab84454-fad8-4ead-b615-a94c0858452c | 9 | @Override public void setParameter(String paramname, int a){
if(paramname == "Age"){ age = a;}
if(paramname == "Fade"){fade = a;}
if(paramname == "Mat"){ mat = a;}
if(paramname == "Matcount"){ matcount = a;}
if(paramname == "MirrX"){hoodx = a;if(mirror){setLocation(hoodx, hoody);}}
if(paramname == "Mi... |
8cd00399-ff3f-440e-ab72-37001e1ef511 | 0 | public void SetFirstTicks(int firstTicks)
{
//set the tick time the bus got to a bus stop
this.firstTicks = firstTicks;
} |
fdd04dd5-2826-4a1d-a443-930ede4b4c67 | 9 | @Action(value="/agregarReserva",results={@Result(location="reserva",name="success",type="tiles")})
public String agregarReserva(){
Gson gs=new Gson();
List<AmbienteDTO> ambientes=new ArrayList<AmbienteDTO>();
List<AmbienteDTO> ambienteCabs=new ArrayList<AmbienteDTO>();
if(!"".equals(fInicio) && !"".equals(fFi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.