method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
9b6531ab-6adb-4293-8e65-cba3f9658178 | 3 | @RequestMapping(value="/image/upload", method=RequestMethod.POST)
@ResponseStatus(value = HttpStatus.OK)
public void handleFileUpload(@RequestParam("hashTagText") String hashTagText,
@RequestParam("file") MultipartFile file,
... |
2f9be6c9-612a-4012-baab-c8829101dda1 | 7 | public static void setSoundMode(SoundMode mode)
{
if(AudioHandler.soundSystem == null || AudioHandler.isShutDown())
return;
AudioSwitcher.soundMode = mode;
if(currentSound != null)
{
AudioHandler.stop(currentSound);
currentSound = null;
}
switch(soundMode)
{
case TITLE:
currentSound = Au... |
9f8bce50-6d9a-4987-b53b-f1be542c1422 | 9 | private final void method648(boolean bool, int i) {
if ((6 * anInt5616 ^ 0xffffffff) >= (aGLToolkit5692.aFloatBuffer6661.buffer.length ^ 0xffffffff)) {
aGLToolkit5692.aFloatBuffer6661.offset = 0;
} else {
aGLToolkit5692.aFloatBuffer6661 = new FloatBuffer((anInt5616 - -100) * 6);
}
anInt5632++;
FloatBuff... |
a181e681-de05-4f98-aad8-485bfa905803 | 1 | public void checkClientTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
try {
sunJSSEX509TrustManager.checkClientTrusted(chain, authType);
} catch (CertificateException excep) {
// do any special handling here, or rethrow exception.
... |
bb306ed1-44ce-45db-8130-a4ce8afa034a | 0 | public static String css(){
return "<style>\n"+
"#hor-minimalist-b\n" +
" {\n" +
" font-family: \"Lucida Sans Unicode\", \"Lucida Grande\", Sans-Serif;\n" +
" font-size: 12px;\n" +
" background: #fff;\n" +
... |
fe14e457-125c-4666-9572-753dc1f4b6e5 | 3 | private void createActivity(JobMetaData meta, Allocation alloc) {
ArrayList<IJob> list = new ArrayList<IJob>();
HashMap<Integer, HashMap<Integer, String>> allocs = alloc.getAllocations();
for (Integer vmId : allocs.keySet()) {
SlaveVM vm = this.pool.getVMById(vmId);
SocketSender sender = new SocketSen... |
076dc97a-e658-4f1b-8412-42540868bfaa | 7 | private void criaEventoTextField() {
textFieldConta.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (textFieldConta.getText() != null) {
Integer agenciaSelecionada = new Integer(textFieldConta
.getText());
agenciaSelecionada--;
//... |
017d5da6-6a25-4ced-a4fa-da3d41a24df4 | 1 | @Override
public V get(Object key) {
if (key instanceof String) {
return super.get(((String) key).toLowerCase());
}
else {
return null;
}
} |
46f8bef0-b7e6-4bee-9273-9d9b34c406ee | 7 | private List<Method> findMethodsByMappedColumnName(Object targetObject, String mappedColumnName) {
List<Method> methods = new ArrayList<>();
for (Method method : targetObject.getClass().getDeclaredMethods()) {
if (method.isAnnotationPresent(XlsxColumnName.class)) {
XlsxCo... |
cab14c3a-f462-4c47-bb3d-901dbc89f8f4 | 9 | private static long getSmallestMultiple(int number)
{
if (number < 0)
{
return 0;
}
if (number <= 2)
{
return number;
}
boolean[] isPrimes = new boolean[number];
for (int i = 0; i < number; ++i)
{
isPrimes[i] = true;
}
for (int i = 2; i < number; ++i)
{
if (isPrimes[i])
{
fo... |
45d7227a-e255-4f6e-a15e-020885850106 | 2 | public ArrayList<BusinessObject> getSelectedObjects() {
int[] rows = getSelectedRows();
ArrayList<BusinessObject> businessObjectArrayList = new ArrayList<>();
for(int row : rows) {
BusinessObject businessObject = (BusinessObject) model.getValueAt(row, 0);
businessObjectAr... |
d79b0482-eba4-4044-a66a-f7cc5e1639eb | 4 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final TDatdprPK other = (TDatdprPK) obj;
if (!Objects.equals(this.transNo, other.transNo)) {
return... |
a60d6341-6c0d-45c6-81a7-f8978f31bbce | 5 | public boolean containsNearbyDuplicate(int[] nums, int k) {
if(k<1){
return false;
}
if(nums==null ){
return false;
}
boolean res =false;
HashMap s = new HashMap<>();
for(int i=0;i<nums.length;i++){
Object idx = s.get(nums[i]);
if(idx==null){
s.put(nums[i],i);
}else{
int iidx = (in... |
bbb6ecd1-1536-4096-9d23-3efe6f26176c | 6 | public static void make() {
if (!Bank.isOpen()) {
if (Inventory.getCount(Variables.gemToCut) > 0) {
if (gemInterface()) {
Crafting.clickStart();
final Timer gemTimer = new Timer(20000);
while (gemTimer.isRunning()
... |
f5e8d2c3-3af4-4133-8e3a-b7d8eb016298 | 8 | private void actualizarJuga(int j1,int j2){
if (j1==Jugador.HUMANO)
jLabelJug1.setText("Humano");
else{
if (j1 == OthelloHexagonal.FACIL)
jLabelJug1.setText("Maquina-Principiante");
if (j1 == OthelloHexagonal.MEDIO)
jLabelJug1.setText("... |
959a24c2-c214-44da-a556-21182cc7ffcb | 6 | @Override
public void add(E elem) {
if (root == null) {
root = new Node(elem, null, null, null);
} else {
for (Node start = root; start != null; ) {
if (start.item.compareTo(elem) > 0) {
if (start.left != null) {
sta... |
d155c43b-85b7-4fa3-b4c3-dd6b1d89e273 | 0 | public Dimension getMinimumSize(JComponent c) {
return getPreferredSize(c);
} |
93b94c3f-0b64-499a-85a9-58d8aa3e31aa | 7 | public BrowserLauncher getBrowserLauncher(String browser, String sessionId, RemoteControlConfiguration configuration, BrowserConfigurationOptions browserOptions) {
if (browser == null) {
throw new IllegalArgumentException("browser may not be null");
}
String executablePath = null;
... |
ef689615-d614-41a3-9c8b-d5b3a6e023ab | 4 | @Override
public boolean activate() {
return (!validate(Constants.WAITFOR_WIDGET)
&& !Inventory.contains(Settings.bar.getFirstId())
&& Inventory.contains(Settings.bar.getBarId())
&& !Bank.isOpen()
&& !Widgets.get(13, 0).isOnScreen());
} |
63f5ae5f-6714-451e-8085-c1e932f30fd9 | 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... |
e9f72d73-3284-4045-a0a8-3930f896c449 | 8 | void createOffscreenImage(boolean discard_image) {
d=getSize();
if(discard_image) {
img=null;
imgsize=null;
}
if(img == null || imgsize == null || imgsize.width != d.width || imgsize.height != d.height) {
img=createImage(d.w... |
3ee37284-60fc-4c8a-834f-731a0c84dcaf | 8 | public static void deleteFiles(File dir, FilenameFilter filter) {
// validations
if(dir == null) {
throw new DataUtilException("The delete directory parameter can not be a null value");
} else if(!dir.exists() || !dir.isDirectory()) {
throw new DataUtilException("The dele... |
db2be0a5-538c-4a17-9291-822ef6937895 | 6 | public static Type max(Type p1, Type p2) {
if (!numeric(p1) || !numeric(p2)) {
return null;
} else if (p1 == Type.Fixed || p2 == Type.Fixed) {
return Type.Fixed;
} else if (p1 == Type.Integer || p2 == Type.Integer) {
return Type.Integer;
} else {
... |
d627a0cc-f810-40b1-9c9b-50821156a358 | 0 | @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509Data")
public JAXBElement<X509DataType> createX509Data(X509DataType value) {
return new JAXBElement<X509DataType>(_X509Data_QNAME, X509DataType.class, null, value);
} |
71f94bfe-cd08-461c-8f00-0c332197247f | 7 | @Override
public String toString() {
if (seqChange == null || marker == null) return null;
String pos = pos();
if (pos == null) return null;
String protChange = "";
switch (seqChange.getChangeType()) {
case SNP:
case MNP:
return snpOrMnp();
case INS:
protChange = ins();
break;
case DEL:
... |
35a3b7d7-363a-4f26-b4d2-fc1773fb2deb | 2 | private Table getTableAyantId(int tableId) {
for (Table table : tables) {
if (table.getTableId() == tableId)
return table;
}
return null;
} |
72c65c6e-7127-485d-a265-45b770756057 | 4 | public void recalcHeightMap()
{
for (int x = 0; x < 16; x++)
for (int z = 0; z < 16; z++)
{
int y = MAP_HEIGHT - 1;
while (Blocks.getBlockOpacity(getBlock(x, y, z)) == 0 && y > 0)
y--;
y++;
setHeight(... |
07d49511-32dd-4b7e-8415-8e74d08a92fa | 1 | public void make(Piece[][] board) {
Piece1 = board[x1][y1];
//System.out.println("Make: " + (Piece1.x == x1 && Piece1.y == y1));
if (board[x2][y2] != null) {
Piece2 = board[x2][y2];
}
board[x2][y2] = board[x1][y1];
board[x1][y1] = null; ... |
30bf8e55-d6f7-45f1-8f07-49b82a420544 | 6 | public double calculateDistance(DataPoint other) {
if (this.equals(other))
return 1;
HashMap<Integer, Double> minHash, maxHash;
HashMap<Integer, Double> current = getVector(), otherHashMap = other
.getVector();
if (current.size() < otherHashMap.size()) {
minHash = current;
maxHash = otherHashMap;
... |
ffeb8742-32d4-4d7d-8ec8-a4191f8dc92e | 6 | public String getResultString() {
// String resultString;
// String filter = this.getFileFilter().getDescription();
String path = null;
// boolean isDirMode = (this.getFileSelectionMode() == DIRECTORIES_ONLY);
boolean isMulti = this.isMultiSelectionEnabled();
if (isMulti) {... |
5fcc6e9d-af88-41ec-9a35-535eaa2ffb4a | 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((... |
a0a5f0fe-dc6e-4f4d-8e56-489739fd601f | 8 | private static int memoryLocation(int abv) {
switch (abv) {
case ABV_MEMSIZE:
return 0;
case ABV_DEFENSE:
return 1;
case ABV_OFFENSE:
return 2;
case ABV_SIZE:
return 3;
case ABV_ENERGY:
return 4;
case ABV_PASS:
return 5;
case ABV_TAG:
return 6;
case ABV_POSTURE:
return 7;
def... |
9507a03c-3cad-4416-a6f3-83df4951a55a | 8 | private boolean checkNeedE( int res1, int res1AANum, int res1RotNum, int res2, int res2AANum, int res2RotNum ){
//Returns if we need to compute the given shell or pairwise energy
if(!compCETM)//Need all energies for normal energy matrices
return true;
... |
af154d3e-04da-42b5-af93-40199fbe705e | 1 | @Test
public void testNoAgregarEntidad() {
Sistema sistema = Sistema.getInstance();
String nombre = "Alicates";
int tamAnterior = sistema.getEntidades().size();
try {
CONTROL.agregarEntidad(new Long(3000), nombre, new Double(nombre));
} catch (NumberFormatExceptio... |
f006ad98-8596-4440-b4a3-e3f5ba3087c5 | 0 | public String getTeams() {
return "For todays game we hate the " + this.team1 + " versus the " + this.team2;
} |
e6e7ce26-ed5d-44cf-aa85-aa7a4d6159f7 | 1 | public static String addLeadingZero(String s) {
// If it's length is one, then add a zero
if (s.length() == 1)
return "0" + s;
// Otherwise just return it as it is
return s;
} |
1fec87fc-ebce-4727-a815-88158be2b36f | 5 | @Override
public V compute(final A arg) throws InterruptedException {
while (true) { // 重试机制:无限次!
Future<V> f = cache.get(arg);
if (f == null) { // 首先检查某个计算是否已经开始
Callable<V> eval = new Callable<V>() {
@Override
public V call() throws Exception {
return c.compute(arg);
}
};
... |
1db9432a-d51e-4ae8-898b-53aa1e50dec3 | 9 | private String readFileAsString(String filename) throws Exception {
StringBuilder source = new StringBuilder();
FileInputStream in = new FileInputStream(filename);
Exception exception = null;
BufferedReader reader;
try {
reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
Exception inne... |
e40c3295-8a3c-4f39-a69a-cc122aeabbb0 | 9 | static void printSpiralMatrix(int[][] matrix, int rows, int columns){
int columnIndex1 = 0;
int columnIndex2 = columns-1;
int rowIndex1 = 0;
int rowIndex2 = rows-1;
int indexVisited = 1;
int i;
while(indexVisited <= columns*rows){
for(i = columnIndex1;... |
b345ddef-5a58-448f-ae33-96e4ca5961a0 | 5 | public void handleRequest() {
Thread pollQueue = new Thread(new Runnable() {
public void run() {
while (true) {
FolderWatcherQueue s = changes.poll();
// System.out.println("The size of the " + changes.size());
if (s != null) {
String eventType = s.getEventType();
if (eventType.equa... |
abfb198a-aac8-48d0-8c4b-ce0398e2e72d | 7 | * @param improvementType a <code>TileImprovementType</code> value
*/
public void changeWorkImprovementType(Unit unit,
TileImprovementType improvementType) {
if (!requireOurTurn()) return;
if (!unit.checkSetState(UnitState.IMPROVING)
|| impr... |
b0b7a7c1-27e2-4684-8dbc-fb0aa65264e1 | 8 | public int Open(String Filename, int NewMode)
{
int retcode = DDC_SUCCESS;
if ( fmode != RFM_UNKNOWN )
{
retcode = Close();
}
if ( retcode == DDC_SUCCESS )
{
switch ( NewMode )
{
case RFM_WRITE:
try
{
file = new RandomAccessFile(Filena... |
5a9fc135-2d46-4772-a844-63571d439e83 | 7 | public Colgroup(HtmlMidNode parent, HtmlAttributeToken[] attrs){
super(parent, attrs);
for(HtmlAttributeToken attr:attrs){
String v = attr.getAttrValue();
switch(attr.getAttrName()){
case "align":
align = Align.parse(this, v);
break;
case "char":
charr = Char.parse(this, v);
break... |
782f194f-1edd-4b03-bc4d-c71606bc4347 | 0 | protected Transition initTransition(State from, State to)
{
return new MealyTransition(from, to, "", "");
} |
bbed6bb9-7327-4895-b63c-56458a033c3b | 2 | public void skipRemaining() throws IOException {
while (length > 0) {
int skipped = (int) skip(length);
if (skipped == 0)
throw new EOFException();
length -= skipped;
}
} |
e3943675-d574-4e6e-8843-475fea60b518 | 0 | public Analizer() {
} |
9951f089-6c0a-43c9-933b-5ec4207edf29 | 3 | @Override
public String toString() {
String result = "\n\t\t<s id=\"" + id + "\">";
result += "\n\t\t\t<graph root=\"" + rootIDref + "\">";
result += "\n\t\t\t\t<terminals>";
terminals = Helper.sortByKey(terminals);
for (Node terminal : terminals.values()) {
result += terminal;
}
result += "\n\t\t\t\t... |
1a1f4cf7-5ae2-4d1b-8683-85d95734b71f | 9 | private void createScrollPane(Attributes attrs) {
scrollPane = new ScrollPane(scrollpaneDef);
// loop through all attributes, setting appropriate values
for (int i = 0; i < attrs.getLength(); i++) {
if (attrs.getQName(i).equals("x"))
scrollPane.getStartPoint().setX(
Integer.valueOf(attrs.getValue(i))... |
e9015e64-3ce6-4f02-a2e7-2b93c7985748 | 5 | public void ChangeDoor(int ArrayID) {
int objectID = server.objectHandler.ObjectOriID[ArrayID];
int objectX = server.objectHandler.ObjectX[ArrayID];
int objectY = server.objectHandler.ObjectY[ArrayID];
int Face = server.objectHandler.ObjectFace[ArrayID];
int Type = server.objectHandler.ObjectType[ArrayID];
... |
127c75e5-56c6-4cc9-8035-2ae004560cbc | 9 | public boolean canMoveExact( int playerColor) {
if (! legitPlayerColor(playerColor)) {
throw new IllegalArgumentException("Bad color '" + playerColor + "'");
}
if ((myDice.isDoubles( )) && (myDice.getDoubletMovesCountdown( ) < 1)) {
return false;
}
// ?? n... |
9901803d-647e-4824-9ca9-9905c989e686 | 5 | public static ArrayList<Adress> getAll() {
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
ArrayList<Adress> adressList = new ArrayList<Adres... |
89f7ae42-6ead-48d1-bdf4-8dd5f368c705 | 5 | public boolean lautaValmis() {
int nro = 1;
for (int i = 0; i < getKorkeus(); i++) {
for (int j = 0; j < getLeveys(); j++) {
if (i == getKorkeus() - 1 && j == getLeveys() - 1) {
return true;
}
if (getNappula(i, j).getTunnis... |
4a6ecd79-b003-47e4-aa51-35ff08f63582 | 9 | @Override
public void setMovement(Board b) {
int x = getLocation().getX();
int y = getLocation().getY();
movement.setSize(0);
movement.trimToSize();
if (y > 6 || b.getCell(new Location(x, y+1)) != null) {
} else {
movement.add(new Location(x, y+1));
... |
88c88a1d-576d-4c50-9d13-b1a0f8889cab | 1 | public void hyperlinkUpdate(HyperlinkEvent e)
{
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
history.addFirst(editor.getPage());
Cursor c = editor.getCursor();
Cursor waitCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
editor.se... |
20af3036-b7a9-42c7-af8d-3802019f51dd | 9 | public BmgPanelCustom(BmgFrame fen) {
super();
this.fen = fen;
this.setLayout(new BorderLayout());
JPanel panHaut = new JPanel();
panHaut.setLayout(new GridLayout(3, 2));
// Labels
JLabel label1 = new JLabel("| Nom de l'exercice : ");
JLabel label2 = n... |
ef41c020-9128-4eb3-b293-54c08b1ce145 | 5 | @Override
public boolean onCommand(CommandSender sender, Command cmd, String cmdLabel, String[] args) {
if (!sender.hasPermission("VanishCommand.list")) {
sender.sendMessage(ChatColor.RED + "No permission!");
return true;
}
if (args.length != 0)
return false;
if (this.plugin.getHiders().isEmpty()) ... |
306adc9c-1a78-4d95-ac0e-cf0b950131e0 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Account other = (Account) obj;
if (name == null) {
if (other.name != null... |
19c4243f-0f5f-41d9-a442-29b5101afe38 | 6 | private boolean parse(String line){
boolean retVal = true;
StringTokenizer st = new StringTokenizer(line , ",");
String command = st.nextToken();
System.out.println("SERVER : The command is : " + command);
if(command.equals("REQ")){
int numDep = Integer.parseInt(st.nextToken());
int numArr = Integer.p... |
7097a1b2-a563-4134-b75a-af1bc82840a4 | 8 | static String readCommand(String cmd) throws Exception {
boolean error = false;
cmd = cmd.replace(" ", "");
// Check if only allowed chars
if(Pattern.matches(PATTERN, cmd)) {
// This chunk here checks balancing brackets
LinkedList<Character> stack = new LinkedLi... |
a0bae3e1-f94d-4b78-9c43-ada52e4a9d85 | 1 | @Override
public void endTransaction() {
if(commit()){
this.transaction = false;
}
} |
2fde465e-23e3-455f-8f6f-da5fa817a22e | 8 | public static AngleData getInterpolatedAngleData(List<AngleData> dataBase,int n,int index,double target)
{
int gpsWeek = dataBase.get(0).getTime().getWN();
int offset = 0;
double []towArray = new double[n];
double []leftAngleArray = new double[n];
double []rightAngleArray =... |
62b1a985-d1ff-4a04-ae9f-daebc0d555c9 | 4 | @Override
public Object getValueAt(int row, int column) {
int index = 0;
for (Entry<Integer, Boolean> e : pu.entrySet()) {
if (row == index) {
if (column == 0)
return e.getKey();
else
return e.getValue() ? "Active" : "Inactive";
}
index++;
}
return "";
} |
7becacd6-de05-490d-bb71-939f125280f5 | 5 | private ArrayList<String> fetchMatchingSpelproject() {
String searchFor = tfSpelprojectSearch.getText();
ArrayList<HashMap<String, String>> temp = null;
try {
temp = DB.fetchRows("select * from spelprojekt");
} catch (InfException e) {
e.getMessage();
}
... |
7d9474da-33ed-4038-9b91-2d79b3592e5f | 9 | public static String getPreferredJavaType(int sqlType, int size, int decimalDigits) {
if ((sqlType == Types.DECIMAL || sqlType == Types.NUMERIC) && decimalDigits == 0) {
if (size == 1) {
return "Boolean";
} else if (size < 3) {
return "Byte";
} else if (size < 5) {
return "Short";
} else if (s... |
315108d6-0b05-4757-995a-3b0777241c21 | 1 | private void checkvault() {
Plugin p = getServer().getPluginManager().getPlugin("Vault");
if (p == null) {
sendtoserver(":δҵVault");
sendtoserver("Trd.");
setEnabled(false);
} else {
return;
}
} |
03dc4799-e6e8-4894-96e1-222897546d1a | 1 | public MyMap(){
int i;
registers=new HashMap<String,Integer>();
opcodes=new HashMap<String,Integer>();
opcodes_tail=new HashMap<String,Integer>();
Labels=new HashMap<String,Integer>();
for(i=0;i<8;i++){
registers.put("r"+i,i);
registers.put("R"+i,i... |
433025eb-85cb-415d-9a73-223a1bfa45d0 | 1 | private void cleanupEdge(final Block src, final Block dst) {
dst.visit(new TreeVisitor() {
public void visitPhiJoinStmt(final PhiJoinStmt stmt) {
final Expr operand = stmt.operandAt(src);
if (operand != null) {
operand.cleanup();
// Remove the operand associated with src
// from a PhiJoinS... |
601d1188-0c47-4d7e-a6e1-2685b788f226 | 9 | public static Command toCommand(String str, String prefix, String botnick) {
// Use this function to get the enum value for a string
String command;
String [] commandList;
commandList = str.split(" ");
command = commandList[0].toUpperCase();
if(prefix ==... |
8e385afb-d33c-4efc-9265-33f627fb98fa | 3 | public void AddToMenu() {
if (Glob.instance != null && Glob.instance.paginae != null)
if (!Glob.instance.paginae.contains(res)) Glob.instance.paginae.add(res);
} |
9328a865-9af9-407b-9d59-f98cd9db756a | 4 | public static void main(String[] args) {
Parameters.load();
try {
// Set System L&F
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (UnsupportedLookAndFeelException e) {
// handle exception
} catch (ClassNotFoundException e) {
// handle exception
} catch (Instantiation... |
e1e7da4d-da50-4215-980a-4d05d0fc86e7 | 5 | public String cryptanalyseCle(IMessage clair, IMessage crypte) {
long d=new Date().getTime();
int j=0;
boolean trouve=false;
while(j<clair.taille() && !trouve) {
if((char)(33+(clair.getChar(j)+47-33)%93)!=crypte.getChar(j) && clair.getChar(j)!=crypte.getChar(j)) {
trouve=true;
}
j++;
}
if(!trou... |
2d132fd8-3a78-4c1f-8ccd-7b52a1f53882 | 7 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Ex25Java other = (Ex25Java) obj;
if (age != other.age)
return false;
if (name == null) {
if (other.name != null)
return false;
} el... |
cd96e824-16a7-4a9e-99b6-964a767ebc7d | 3 | public boolean solved(){
for(Cell[] rows : puzzle)
for(Cell cell : rows)
if(cell.getColor() == '.') return false;
return true;
} |
ccd9e398-8fd5-4f19-94ad-3a7ac86ae684 | 8 | public void resize(int x, int y) {
if (x < 1 || y < 1)
return;
Tile newMap[][] = new Tile[x][y];
initTab(newMap);
if (x <= tab.length && y <= tab[0].length) {
copy(newMap, tab, x, y);
}
else if (x > tab.length && y <= tab[0].length) {
copy(newMap, tab, tab.length, y);
}
else if (x <= tab.... |
0de50995-2c1a-49bb-bae1-340bbe5c6504 | 8 | private void read(BufferedReader reader) throws IOException
{
String line;
// Header
line = reader.readLine();
if(!"Item".equals(line)) {
throw new IOException("Wrong header: " + line);
}
// Version
line = reader.readLine();
if(!"v.1".e... |
56bba659-a07a-474c-819f-723ac0c0a6cf | 3 | public boolean checkColision(int x1, int y1, int x2, int y2){
if(alive){
if(colidate(x1, y1, x2, y2) ){
if(!getProtect().isActive()){
lives--;
imgLives.setText("x"+lives);
alive = false;
explosionTime = 0;
exp = true;
SoundManager.playExplosion();
}
return true;
}
}
... |
af93ce03-52ae-4b26-a793-33531204ab6b | 4 | @SuppressWarnings("unchecked")
@Override
public HashMap<String, JOSObject<?, ?>> getObjects() {
return (HashMap<String, JOSObject<?, ?>>) DATA.clone();
} |
a51afccb-c96e-4f5e-b525-f9885ad0b2fc | 0 | protected Automaton createEmptyAutomaton(Document document)
{
return new MealyMachine();
} |
dad9fb7c-6b31-4bd0-873b-d977c8566af3 | 1 | public static void main(String[] args) {
int[] candidates ={7,12,5,10,9,4,6,8};
int target = 32;
List<List<Integer>> list = new Combination_Sum().combinationSum(candidates, target);
for(int i =0 ;i< list.size();i++){
System.out.println(Arrays.toString(list.get(i).toArray()));... |
cebbb599-edd6-4235-a3a5-1ab7a61d13f3 | 5 | /* */ public static boolean ClassListEqual(Class<?>[] l1, Class<?>[] l2) {
/* 167 */ boolean equal = true;
/* */
/* 169 */ if (l1.length != l2.length)
/* 170 */ return false;
/* 171 */ for (int i = 0; i < l1.length; i++) {
/* 172 */ if (l1[i] != l2[i]) {
/* 173 */ equal = fals... |
54a0e357-449c-43f7-9044-b59e1e3bcce2 | 3 | public String getFullAlias() {
if (parent != null) {
String parentAlias = parent.getFullAlias();
String alias = getAlias();
if (alias.length() == 0)
return parentAlias;
else if (parentAlias.length() == 0)
return alias;
else
return parentAlias + "." + alias;
}
return "";
} |
6d277ab1-aa2a-4e0a-a674-e2f743bedda9 | 3 | public static boolean getYesOrNoAnswer(){
Scanner scanner = new Scanner(System.in);
String answer;
while (true){
answer = scanner.nextLine();
if (answer.equals("yes")){
return true;
}
if (answer.equals("no")){
return... |
c1824cfd-0663-4446-8763-6bb8abc1e813 | 5 | public static RepSmartList UPDATE_SMART_LIST(OVSmartList ovSmartList) throws SQLException {
RepSmartList rep = new RepSmartList();
Connection connexion = GET_CONNECTION();
try {
for (OVListeProduit ovListeProduit : ovSmartList.getProduitsSmartList()) {
int coche =... |
e476e1d1-7b15-41d0-8679-5cb10c78e19f | 2 | private static byte[] combineCD(byte[] C, byte[] D) {
byte[] CD = new byte[7];
// get 28 first bits from C
for(int bit = 0; bit < 28; bit++) {
ByteHelper.setBit(CD, bit, ByteHelper.getBitInt(C, bit));
}
// get 28 next bits from D
for(int bit = 28; bit < 56; bi... |
e3d9dc28-93ca-41e9-97f9-1f55c42d5f95 | 0 | public void setNodePlacer(NodePlacer placer) {
this.nodePlacer = placer;
invalidate();
} |
1958924f-a321-4711-afd9-eae9142779a7 | 0 | public UndoableDocumentAttributeChange(JoeTree tree, String oldKey, Object oldValue, boolean oldReadOnly, String newKey, Object newValue, boolean newReadOnly) {
this.tree = tree;
this.oldKey = oldKey;
this.oldValue = oldValue;
this.oldReadOnly = oldReadOnly;
this.newKey = newKey;
this.newValue = newValue;
... |
e3fda94c-3bf6-40d3-b287-392b1a540746 | 5 | public int findKthSortedArrays(int A[], int sA, int B[], int sB, int k){
int eA = A.length - 1;
int eB = B.length - 1;
if(eA - sA > eB - sB){
return findKthSortedArrays(B, sB, A, sA, k);
}
if(sA > eA) return B[sB+k-1];
if(k==1) return Math.min(A[sA],B[sB]); //... |
d34901de-bf50-4246-bd30-ae80bf6081f0 | 1 | public Player(int x, int y, Cell landlord) {
super(x, y, landlord);
try {
img = ImageIO.read(new File("res/img/RaphiLangu.png"));
} catch (IOException e) {
}
} |
2cd5b98a-eb95-4f5c-80b8-fafff31d7a70 | 0 | @Test
public void testGetTipoInteres() {
System.out.println("getTipoInteres");
Cuenta instance = new Cuenta();
float expResult = 0.0F;
float result = instance.getTipoInteres();
assertEquals(expResult, result, 0.0);
// TODO review the generated test code and remove the... |
24e60608-8d7b-4536-b065-e5b0793e68fc | 7 | public void addCell(cell ecoli, int x, int y){
int myx; int myy;
if(x >= xmin && x < xmax){myx = x-xmin;}else{myx = -1;}
if(y >= ymin && y < ymax){myy = y-ymin;}else{myy = -1;}
if(myy == -1 || myx == -1){ }
else{culture[myx][myy] = null;
culture[myx][myy] = ecoli;
if(ecoli.getOption("Mirror")){}else{ culture... |
c1c132a0-36de-4552-a803-466e7b2430f2 | 4 | public void updateScreens() {
// GameScreen g = screens.get(screens.size()-1);
List<GameScreen> screensToInput = new ArrayList<GameScreen>();
for (int i = screens.size() - 1; i >= 0; i--) {
if (screens.get(i).state != ScreenState.HIDDEN) {
screensToInput.add(screens.get(i));
}
}
GameScreen s1 = s... |
343dd589-59bb-496c-9b0e-40a5d34f77ee | 1 | public static void main(String[] args) {
// TODO Auto-generated method stub
String[] fruits = {"Pine Apple", "Mango", "Banana", "Apple"};
Arrays.sort(fruits);
for(String temp: fruits){
System.out.println(temp);
}
} |
80898c4f-9c72-419a-8a54-1dbc89594473 | 5 | private void readXML(String fileName)
{
Document document;
DocumentBuilder documentBuilder;
DocumentBuilderFactory documentBuilderFactory;
NodeList nodeList;
File folder;
File[] xmlInputFiles;
ArrayList<ShotData> shots;
String currentDoc = "";
... |
ab29de49-3248-4957-a2ad-5619415d3e17 | 6 | private Class<? extends Event> getRegistrationClass(Class<? extends Event> clazz) throws IllegalAccessException {
try {
clazz.getDeclaredMethod("getEventList");
return clazz;
} catch (NoSuchMethodException e) {
if (clazz.getSuperclass() != null
&& ... |
d04cf966-6d32-4f0f-8ec4-37cb7e026ea9 | 9 | private ArrayList<Integer> print(int[][] matrix, int top, int left, int bottom, int right) {
ArrayList<Integer> result = new ArrayList<Integer>();
// top
if (top <= bottom) {
for (int i = left; i <= right; i++) {
result.add(matrix[top][i]);
}
}
// right
if (right >= left) {
for (int i = top + 1... |
9b41931d-c67c-4988-b6e1-27ae5191ecad | 1 | public void visit_ifnull(final Instruction inst) {
if (longBranch) {
final Label tmp = method.newLabel();
addOpcode(Opcode.opc_ifnonnull);
addBranch(tmp);
addOpcode(Opcode.opc_goto_w);
addLongBranch((Label) inst.operand());
addLabel(tmp);
} else {
addOpcode(Opcode.opc_ifnull);
addBranch((Lab... |
3ec65e1e-c4ae-4bf3-a066-d1f79bfc30d9 | 9 | public static Type preserveType(Type currentType, Type newType) {
Type result = newType;
if (newType != null && currentType != null &&
currentType.getObjectClass() == newType.getObjectClass()) {
if (newType.getGenericType().getGenericType() instanceof Class &&
!(c... |
5d533e83-24d0-4d1c-bf98-f6d5d7cf7c3a | 5 | public void removeDocument(Document doc) {
openDocuments.remove(doc);
// Fire Event
fireDocumentRemovedEvent(doc);
// Unregister the Document
doc.setDocumentRepository(null);
// Select the last non-iconified document in the window menu and
// change to it. Otherwise change to an iconified doc. O... |
15c355a0-4300-496b-aa11-3a13dd40dba8 | 0 | private Combination<Colors> generateAttemptCombination3() {
List<Token<Colors>> attemptTokens = new ArrayList<Token<Colors>>();
attemptTokens.add(new Token<Colors>(Colors.P));
attemptTokens.add(new Token<Colors>(Colors.W));
attemptTokens.add(new Token<Colors>(Colors.R));
attemptTokens.add(new Token<... |
271f29b4-e5da-4340-8637-afb04474ba7b | 5 | private void lblUpdateMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblUpdateMouseClicked
// check so eveything is ok
if (!Validate.tfEmpty(tfBenamning) && !Validate.tfEmpty(tfProducent)) {
if (Validate.notOverSize(tfBenamning) && Validate.notOverSize(tfProducent) && Validat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.