method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
89e4a6f3-a59c-46d3-b0ae-a887a6d263ed | 0 | public condition getCondVal() {
return condVal;
} |
cde1c265-3eb6-49eb-b1f8-6c6bb8fb9a99 | 5 | public static String lTrim(final String value) {
if (value == null) {
return null;
}
String trimmed = value;
int offset = 0;
final int maxLength = value.length();
while (offset < maxLength && (value.charAt(offset) == ' ' || value.charAt(offset) == '\t')) {
... |
9b9c5429-94f0-42c7-8054-d50e943e8423 | 5 | public void handleMessage(String string) {
//this should send the message to the current service as well
System.out.println("incoming... "+string);
//do something with the message from the client
if(string.indexOf("CON;") == 0) {
//if incoming is CON;, alert everyone that ci... |
89050f88-9a5f-4813-a1ae-ad808632dd58 | 3 | public void findCostRecursively(Employee employee,int headCount){
if(employee.getReportees()==null || employee.getReportees().size()==0){
return;
}
else {
costSaved += employee.getCostSavings(headCount);
for (Employee e : employee.getReportees()) {
... |
88d510b0-719f-4600-bcdf-490000b80330 | 4 | public synchronized void sendPrivateChatEvent(ChatEvent chatEvent) {
String to = chatEvent.getTo();
boolean success = false;
for (ClientConnection clientConnection : clientConnections) {
// if clientConnection is the RECEIVER or SENDER
if (clientConnection.getUser().getDisplayName().toLowerCase().equals(to.... |
8de31ef7-2a86-4d48-a6b4-10e587357b2c | 0 | public void setTpv(Tpv tpv) {
this.tpv = tpv;
} |
ad95aa31-6751-43b7-8aea-6cc7ad4540bc | 6 | public int Problem33() {
int numerador=1;
int denominador=1;
for (int d=10;d<100;d++) {
for (int n=10;n<d;n++) {
int n0=n%10;
int n1=n/10;
int d0=d%10;
int d1=d/10;
if ((n1==d0 && n0*d==n*d1) || (n0==d1 && n1*d == n*d0)) {
numerador*=n;
denominador*=d;
}
}
}
return deno... |
c6a46441-0db9-4b26-99fa-98db18d0e7f4 | 7 | @Override
public void run() {
System.err.println("Die Kasse wurde geöffnet!");
while(!emptyQueue){
synchronized (waitingQueue) {
while(waitingQueue.size() < 1 && removedOne){
try {
waitingQueue.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
if... |
d6abe66b-9b93-4ab7-ad6e-117991bc1c68 | 9 | private boolean isStandardProperty(Class clazz) {
return clazz.isPrimitive() ||
clazz.isAssignableFrom(Byte.class) ||
clazz.isAssignableFrom(Short.class) ||
clazz.isAssignableFrom(Integer.class) ||
clazz.isAssignableFrom(Long.class) ||
clazz.isAssignab... |
26224978-8170-45e8-aa42-4d09c4dedd8a | 7 | public Object [][] getDatos(){
Object[][] data = new String[getCantidad_Cuentas ()][colum_names.length];
//realizamos la consulta sql y llenamos los datos en "Object"
try{
if (colum_names.length>=0){
r_con.Connection();
String c... |
c79d4d6c-c317-49c7-aaeb-93413f0cf402 | 7 | private static MethodDoc getMethodForType(ClassDoc classDoc, String nestedType) {
notNull(classDoc, "classDoc");
notNull(nestedType, "nestedType");
MethodDoc result = null;
MethodDoc[] methods = classDoc.methods();
for (MethodDoc method : methods) {
if (method.name().equalsIgnoreC... |
c30a4009-95d7-4dad-a60a-ee9c07f720cc | 9 | public static String checkReplacement(CharSequence rep) {
for (int i=0; i<rep.length(); i++) {
char c = rep.charAt(i);
if (c == '$') {
if (i+1 < rep.length()) {
char next = rep.charAt(++i);
if (next < '0' || next > '9') {
... |
052ce478-4e56-4673-93b4-7be775696921 | 9 | public static void main(String[] args) {
if (args.length != 1) {
System.out.println("This simple demo utility must be called with a JPEG file. For example:");
System.out.println(" bin/jpegLister.sh myWonderfulJpegFile.jpg");
return;
}
JpegData parser = new JpegData();
try {
RandomAccessFi... |
65613f23-e888-4676-9b65-6d6b76073833 | 6 | public static void copyDirectory(Path source, final Path dest) throws IOException {
if ((source == null) || (dest == null) || !Files.exists(source, LinkOption.NOFOLLOW_LINKS)
|| !Files.isDirectory(source, LinkOption.NOFOLLOW_LINKS)) {
throw new InvalidParameterException();
}
... |
b4e2e60e-8bd2-48eb-9baf-48f5f8d49678 | 5 | @Override
public boolean hesapSil(String kullaniciAdi) {
if(kullaniciAdi == null)
return false;
if(kullaniciAdi.equals("")){
JOptionPane.showMessageDialog(null, "Kullanici adı boş olamaz!",
"Hata", JOptionPane.ERROR_MESSAGE);
ret... |
4d6e12f2-3fee-4309-a244-5d4709e343a4 | 3 | public boolean mouseup(Coord c, int button) {
if (a && button == 1) {
a = false;
ui.grabmouse(null);
if (c.isect(new Coord(0, 0), sz))
click();
return (true);
}
return (false);
} |
0709ce7d-4ba3-4b2c-af23-70e8a7fce421 | 3 | @Override
public void deserialize(Buffer buf) {
id = buf.readUShort();
if (id < 0 || id > 65535)
throw new RuntimeException("Forbidden value on id = " + id + ", it doesn't respect the following condition : id < 0 || id > 65535");
int limit = buf.readUShort();
parameters =... |
8afe3798-a829-4622-b777-7013d1589caf | 5 | public boolean over()
{
boolean over30000=false;
boolean under0=false;
for(Player p:players){
if(gamescore(p) >=30000){
over30000=true;
}
if(gamescore(p) < 0){
under0=true;
}
}
return over30000 && (round > EAST || under0);
} |
bbc1900d-f4d6-4a6b-9f25-9c97a0caee4f | 9 | @SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.HIGHEST)
void onInventoryClick(InventoryClickEvent event) {
if (event.getInventory().getTitle().equals(name) && (player == null || event.getWhoClicked() == player)) {
event.setCancelled(true);
if (event.g... |
17b18673-4206-4ece-ae05-be92c30ddfe8 | 7 | @Override
protected void loadPossiblePlays (Position position, Board field) {
if ( field.getPiece(position)!=null ){
int forward = field.getPiece(position).getColor() ? +1 : -1;
AbstractPlay test;
test = new Capture(field, position, 1, forward);
if (test.isValid())
plays.add(test);
tes... |
7ee76493-4aa2-4554-a7e4-6ecee7cace6d | 7 | private boolean checkRedstone(Block block, Material target) {
if(block.getRelative(1, 0, 0).getType() == Material.REDSTONE || block.getRelative(1, 0, 0).getType() == Material.REDSTONE_WIRE || block.getRelative(1, 0, 0).getType() == Material.DIODE || block.getRelative(1, 0, 0).getType() == Material.REDSTONE_TORCH_OFF ... |
4875c486-56e9-4942-9bad-1ddf738077f1 | 1 | @Override
public int getWidth() {
int width = 0;
if (this.fontmetrics != null) {
width = this.fontmetrics.stringWidth(Character.toString(this.ch));
}
return width;
} |
88b44402-c83c-4b7c-a864-96743bd22cd1 | 4 | public List<PDFGlyph> getGlyphs(PDFFont font, String text) {
List<PDFGlyph> outList = new ArrayList<PDFGlyph>(text.length());
// go character by character through the text
char[] arry = text.toCharArray();
for (int i = 0; i < arry.length; i++) {
switch (type) {
... |
13a1f5a4-217b-4214-980a-e35d734721ac | 6 | void paint (GC gc) {
int padding = parent.getHeaderPadding ();
int x = getX ();
int startX = x + padding;
if ((getStyle () & SWT.LEFT) == 0) {
int contentWidth = getContentWidth (gc, true);
if ((getStyle () & SWT.RIGHT) != 0) {
startX = Math.max (startX, x + width - padding - contentWidth);
} else { /* ... |
3f545044-aaf7-4e19-9593-4777f8d94001 | 5 | public byte[] invert(InputStream is, int fStart, int fEnd, FrameBuffer frame_buffer ) throws Exception{
int cont = 0;
reader = new Manager(is);
FrameData fd;
if( frame_buffer.get_buffer_len() == 0){
throw new Exception("Error: buffer is empt... |
2d4f1d42-943d-4e7c-a6b4-75e816535e8a | 0 | public Object getValue() {
return this.value;
} |
e8f0d8e5-2332-454c-b9a6-733102fb2367 | 6 | @Override
public void changeCards(List<ICard> liste) {
LinkedList<ICard> tmpList = new LinkedList<ICard>();
tmpList.addAll(liste);
if (this.getCardInFieldGame().size() < tmpList.size()) {
sizeOfField = tmpList.size();
}
LinkedList<Integer> keysforbeuse = new LinkedList<Integer>();
for (Integer key : th... |
e8da2f94-8b90-4251-923d-cc2eed945243 | 0 | @POST
@Path("addPassenger/{participant}/{idCar}")
@Consumes(MediaType.TEXT_PLAIN)
public void addPassenger(@PathParam("participant") String participant, @PathParam("idCar") int idCar){
System.out.println("Add a participant to a car");
JpaTest.eventService.addToCar(idCar, participant);
} |
f453b94a-819c-488f-844b-94c99d07cb99 | 4 | public static boolean checkHttpResponseOK (URLConnection connection) {
if (connection instanceof HttpURLConnection)
try {
return ((HttpURLConnection)connection).getResponseCode() == HttpURLConnection.HTTP_OK;
} catch (IOException e) {
return false;
}
// exceptional treatment of local files, for ... |
3f8bc310-e70e-4af5-bd9d-0412f486fd42 | 6 | public void keyReleased(KeyEvent e) {
if(open) {
switch(e.getKeyCode()) {
case KeyEvent.VK_ESCAPE:
typing = "";
input = null;
break;
case KeyEvent.VK_ENTER:
typing = typing.trim();
if(!typing.equals("")) {
input = typing;
completedInput = true;
}
typing = "";
break;
... |
15a227cd-7787-4143-b1ae-be5e599aa0f3 | 7 | public int largestRectangleArea(int[] height) {
if (height == null || height.length == 0)
return 0;
int area = 0;
Stack<Integer> stack = new Stack<Integer>();
for (int i = 0; i <= height.length; i++) {
int h = i < height.length ? height[i] : 0;
if (stack.empty() || height[stack.peek()] < h) {
stack... |
cdfc7be3-ec94-422b-ba64-5225917a4a4c | 9 | private static void initThreadInfo() throws IOException {
Thread threads[] = new Thread[10];
Thread.State status[] = new Thread.State[10];
for(int i = 0; i < COUNT; i++) {
threads[i] = new Thread(new Calculator(i));
if (i % 2 == 0) {
threads[i].setPriority... |
0a5f03be-1e1d-4823-9495-ee6a292ec24c | 7 | private void takeTurn(JTable table) {
String playersMarker;
int selectedRow = table.getSelectedRow();
int selectedColumn = table.getSelectedColumn();
Point selectedLocation = new Point(selectedRow, selectedColumn);
Player currentPlayer = this.game.getCurrentPlayer();
Pla... |
f6e7f24a-3a1d-490b-9c0f-861c19243772 | 7 | private Shape selectRandomShape() {
Random rand = new Random();
int randomNumber = rand.nextInt(7);
switch (randomNumber) {
case 0:
return new IShape();
case 1:
return new JShape();
case 2:
return new LShape();
case 3:
return new OShape();
case 4:
return new SShape();
case 5:
retur... |
9375ca94-7564-470b-ae09-41640933e4e3 | 3 | public int findHighestScoreForNode(int node) {
int highestScore = 0;
for (List<Integer> list : graph) {
if (list.get(1) == node) {
int score = list.get(2);
if (score > highestScore) {
highestScore = score;
}
}
... |
c5cfddf9-a2d3-47ef-a033-803422695cb2 | 5 | public static Object castResultSetToObject(ResultSet RS,Object obj){
Field[] FS = obj.getClass().getDeclaredFields();
Class[] paramString = new Class[1];
paramString[0] = String.class;
for (Field FS1 : FS) {
String key = FS1.getName();
if(key.equals("crud"))continue;
... |
41269b73-60b1-45a1-a959-ab0770052286 | 8 | private boolean preUpdate() throws IOException, AbortingException {
ensureOpen();
boolean hasEvents = false;
if (flushControl.anyStalledThreads() || flushControl.numQueuedFlushes() > 0) {
// Help out flushing any queued DWPTs so we can un-stall:
if (infoStream.isEnabled("DW")) {
infoStre... |
b58862b0-5ee2-4d6d-aa14-a9b5fae5d145 | 6 | public void addBook(Book book){
books.add(book);
//check for new words or authors
checkUniqueWords(book.getTitle());
checkUniqueAuthor(book.getAuthor());
int bookPage = book.getNumPages();
int bookYear = book.getPubYear();
//Update min and max page for this set of book data
if(minPage==-1){
//... |
59ed02ec-9bde-4220-a1fb-f17c5a4f2d2b | 5 | @Override
public void keyEvent(int button) {
if(button == KeyEvent.VK_UP)
Game.get().player.up(Game.get().level);
if(button == KeyEvent.VK_DOWN)
Game.get().player.down(Game.get().level);
if(button == KeyEvent.VK_LEFT)
Game.get().player.left(Game.get().level);
if(button == KeyEvent.VK_RIGHT)
Game.ge... |
5685259c-96d3-46f7-bbac-362347249b7e | 1 | private String getDescription() {
String desc = "@Query(value=[" + this.getParsedSql().getOriginalExpression() + "],fetchSize=[" + fetchSize
+ "]),@MapperBy(" + rowMapper.getClass() + ")";
if (this.isUnique) {
desc = desc + ",@Unique()";
}
return desc;
} |
44397f92-7744-4431-a800-9cb7377439eb | 1 | public void testToStandardSeconds() {
Days test = Days.days(2);
Seconds expected = Seconds.seconds(2 * 24 * 60 * 60);
assertEquals(expected, test.toStandardSeconds());
try {
Days.MAX_VALUE.toStandardSeconds();
fail();
} catch (ArithmeticException ... |
60330f69-c038-4d9d-93fc-6fb828ca2895 | 3 | private boolean associationCorrect(MCDAssociation ass) {
// L'association à plus de 2 liens
// ou l'association est une association porteuse d'informations
if (ass.sizeLink() > 2 || ass.sizeInformation() > 0) {
// Vérifie que l'association a au moins deux liens dans
// le cas de la porteuse.
if (ass.siz... |
ed140d80-7491-4ef5-ab49-57b7b588e2f0 | 0 | public void testApp()
{
assertTrue( true );
} |
57f2a2fd-e47e-41a4-9eaf-f2994f25330d | 1 | public static void setDefaultBounds() {
Rasterizer.lineOffsets = new int[Graphics2D.height];
for (int i = 0; i < Graphics2D.height; i++) {
Rasterizer.lineOffsets[i] = Graphics2D.width * i;
}
Rasterizer.centerX = Graphics2D.width / 2;
Rasterizer.centerY = Graphics2D.height / 2;
} |
504b1d33-0d28-49f0-a3bd-9abed7490267 | 5 | public void _updateNodeCollection(Node n) {
if(!n.holdInNodeCollection) {
return; // the node is not yet hold by this node collection
}
//sensitiveInformationChanged = true;
// test whether the node has changed the cell of the matrix
// the old position in the matrix
CubePos oldPos = (CubePos) n.node... |
1ce0c0a4-8d63-4a71-91ea-d3b5d2702c26 | 2 | @Override
protected SignalAspect getSignalAspectForPair(WorldCoordinate otherCoord) {
SignalAspect aspect = SignalAspect.GREEN;
for (Map.Entry<WorldCoordinate, SignalAspect> entry : aspects.entrySet()) {
if (entry.getKey().equals(otherCoord)) {
continue;
}
... |
91662743-0fde-4eba-a81f-df206af175bc | 8 | public static void choldc_f77(int n, double a[][], double diagmx,
double tol, double addmax[]) {
/*
Here is a copy of the choldc FORTRAN documentation:
SUBROUTINE CHOLDC(NR,N,A,DIAGMX,TOL,ADDMAX)
C
C PURPOSE
C -------
C FIND THE PERTURBED L(L-TRANSPOSE) [WRITTEN LL+] DECOMPOSIT... |
b951561c-ff67-4719-a3b4-258d8e09df16 | 4 | public void update(){
up = keys[KeyEvent.VK_UP] || keys[KeyEvent.VK_W];
down = keys[KeyEvent.VK_DOWN] || keys[KeyEvent.VK_S];
left = keys[KeyEvent.VK_LEFT] || keys[KeyEvent.VK_A];
right = keys[KeyEvent.VK_RIGHT] || keys[KeyEvent.VK_D];
center = keys[KeyEvent.VK_ENTER];
quit = keys[KeyEvent.VK_ESCAPE];
} |
d779b7c3-974b-46b6-9ff0-7624c208bf11 | 7 | private void setColumns(BufferedImage image, Colour backgroundCol, HashMap<Color, Colour> colorMap, ArrayList<Column> columns) {
for (int i = 0; i < image.getWidth(); i++) {
Column column = new Column();
column.setIndex(i);
ArrayList<Block> blocks = new ArrayList<Block>();
Bloc... |
553fb3f6-8c33-4ddc-95e2-357eecc1371c | 3 | public void insertionSort()
{
int i,j;
for(i = 0; i < employees.size(); i++)
{
Employee temp = employees.get(i);
j = i - 1;
while (j >= 0 && employees.get(j).getLastName().compareToIgnoreCase(temp.getLastName()) > 0)
{
employees... |
445374c0-6154-40db-8ecd-02831c487520 | 4 | public Boolean isGameOver() {
boolean gameOver = false;
int totalNumber = listMrX.size() + listDetectives.size();
roundNumber = (int) Math.ceil((double) currentTurn / totalNumber);
for (MrX player : listMrX) {
for (Detective d : listDetectives) {
if (d.getPosition().equals(player.getPosition())) {
w... |
1a4925b3-0f61-4a6c-a8f7-441400248a3b | 9 | @Override
protected void processElement(final XMLStreamReader reader, final Kraj item)
throws XMLStreamException {
switch (reader.getNamespaceURI()) {
case NAMESPACE:
switch (reader.getLocalName()) {
case "Geometrie":
Utils.... |
f9dee91b-dad4-4faf-a225-9e635b1da4c6 | 4 | @Override
public seatClass getMinSeatClass() {
Ticket.seatClass rez = seatClass.SEAT_CLASS_FIRST;
for(SingleTicket ticket:this.tickets){
if (ticket.getSeatClass().equals(seatClass.SEAT_CLASS_BUSINESS)) {
rez = seatClass.SEAT_CLASS_BUSINESS;
}
}
... |
7908daae-f39d-40ef-8b05-e05aba7d1d4b | 3 | public boolean load(String filename) {
boolean success = true;
Scanner scanner = null;
try {
scanner = new Scanner(new File(filename));
// we assume the line format is <string> : <int> \n
scores.clear();
while (scanner.hasNext()) {
String[] elements = scanner.nextLine().split(":");
String p... |
a011699f-8306-4521-9d8a-1638b65d36f2 | 3 | private void placeAction(AllocationAction action, boolean shouldPause) {
notifyListeners(action);
if(shouldPause){
if(isStepByStepEnabled()){
GridSim.pauseSimulation();
}
else if(isSlowMotionModeEnabled()){
smallSimulationPause();
}
}
} |
a886eaf8-dbac-455a-917d-ae43e19ea8ff | 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... |
332561ea-80b9-4267-ae67-3254c60efa09 | 6 | public void setMacro( String macro )
{
// Have a shape with a macro?
String m = null;
OOXMLElement oe = getObject( SP );
if( oe != null )
{
m = ((Sp) oe).getMacro();
}
if( m != null )
{
((Sp) oe).setMacro( macro );
return;
}
// how's about a picture?
oe = getObject( PIC );
if( oe != nu... |
9a73015f-bf57-4ae1-b97c-fe748eaf5f9d | 5 | public void save(){
File file = new File(fileName);
if(!file.exists()){
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
Properties prop = new Properties();
try {
prop.load(new FileInputStream(new File(fileName)));
} catch (IOException e) {
e.printStackTr... |
9e6e2830-396d-4775-ba28-1abb1b80c070 | 1 | public Nodo<E> getAndQuitarElementoAzar(){
Nodo<E> nodoTmp;
int posicionAzar = (int )(Math.random() * talla);
Nodo<E> datoEscogido = cabeza;
for ( int cont = 0; cont < posicionAzar; cont++ ) {
datoEscogido = datoEscogido.siguiente;
}
nodoTmp=datoEscog... |
07edab45-d0cc-4096-80f2-6864079046c3 | 5 | public synchronized Varargs lua_resume(LuaThread new_thread, Varargs args) {
LuaThread previous_thread = globals.running;
try {
globals.running = new_thread;
this.args = args;
if (this.status == STATUS_INITIAL) {
this.status = STATUS_RUNNING;
new Thread(this, "Coroutine-" + (++coroutine_coun... |
34720949-e784-40d6-941e-765614d8c341 | 9 | @Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!(affected instanceof MOB))
return true;
final MOB mob=(MOB)affected;
if((msg.amITarget(mob))
&&(msg.targetMinor()==CMMsg.TYP_WEAPONATTACK)
&&(mob!=msg.source()))
{
if(numberOfImages <= 0)
{
unInvoke();
... |
a7f5d292-dbf6-4e2d-94f6-0c5a32c1b325 | 6 | public static void main(String[] args) {
try {
//
// Initialize the application variables
//
fileSeparator = System.getProperty("file.separator");
lineSeparator = System.getProperty("line.separator");
dataPath = System.getProperty("user.ho... |
6ecd456d-16b2-4f4e-b443-1a2507722934 | 2 | public static void main(String[] args) {
try {
System.out.println("[ JNanoBoard version: " + VERSION + "]");
RulesManager.getInstance().loadRules(RULES_DIR);
config = new Properties();
try {
config.load(new FileInputStream(CO... |
3df96b43-cd3c-4767-8c04-5105208986c3 | 9 | public static int calcUTF16toUTF8Length(final CharSequence s, final int offset, final int len) {
final int end = offset + len;
int res = 0;
for (int i = offset; i < end; i++) {
final int code = (int) s.charAt(i);
if (code < 0x80)
res++;
else if (code < 0x800) {
res += 2;
... |
8ceb4575-d8f7-4700-8400-33b814ff56f8 | 9 | private void drawFastJuliaAntialiasedBruteForce(int image_size) {
double size = fractal.getSize();
double size_2_x = size * 0.5;
double size_2_y = (size * height_ratio) * 0.5;
double temp_size_image_size_x = size / image_size;
double temp_size_image_size_y = (size * height_rati... |
b7948991-a27e-41e2-88b4-84106b0eb1e3 | 3 | private void btnEditarClienteApagarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditarClienteApagarActionPerformed
try {
if (JOptionPane.showConfirmDialog(rootPane, "Deseja realmente apagar cliente?") == 0) {
carregaObjeto();
... |
39f5907c-19de-4349-b6db-79676c7253a5 | 7 | private static void initDisplay(boolean fullscreen) throws Exception {
Display.setTitle(TITLE); // sets aplication name
Display.setFullscreen(fullscreen); // create a full screen window if possible
DisplayMode displayMode = null;
DisplayMode d[] = Display.getAvailableDisplayModes();
f... |
d1d188e0-288b-475c-9234-bdb19d125963 | 5 | private boolean checkRas() throws IOException {
byte[] a = new byte[14];
if (read(a) != a.length) {
return false;
}
final byte[] RAS_MAGIC = {0x6a, (byte)0x95};
if (!equals(a, 0, RAS_MAGIC, 0, 2)) {
return false;
}
format = FORMAT_RAS;
width = getIntBigEndian(a, 2);
height = getIntBigEndian(a, 6... |
23cc5b1d-6a7c-45e1-b15a-5cf96a6ffa51 | 8 | protected void oneMoreStoryLine(){
if(curStory.isEmpty()&&curPStory.isEmpty()){
timer.stop();
storyDiscription="";
pStoryDiscription="";
storyCharIndex=0;
pStoryCharIndex=0;
return;
}
if(!curStory.isEmpty()){
... |
45ce5005-c716-44b5-b95b-08c2e7bec1a7 | 9 | public <ITEMS extends Items<ITEM>, ITEM extends Item> List<ITEM> getRecommendations(final List<ITEMS> itemsList, final ITEMS targetItems,
final Class<ITEM> clazz)
throws InstantiationException,
IllegalAccessException {
Map<Object, Double> scores = new HashMap<Object, Double>(... |
40e0fe24-b06c-4bbe-a441-bae6d68db9b3 | 5 | @Override
public void actionPerformed(ActionEvent evenement) {
System.out.println("----------------------------------------") ;
System.out.println("GuiCR::actionPerformed()") ;
Object sourceEvt = evenement.getSource() ;
if(sourceEvt == this.itemQuitter){
this.controleur.quitterApplication() ;
}
else ... |
3b0afa06-7883-4c9f-8530-75ebf3de75e5 | 7 | void outputResult(ResultSetReference ref) throws SQLException {
// NOTICE: This method will be called by non AWT thread.
// To access GUI, use "Later".
final OutputProcessor opref = env.getOutputProcessor();
invoker.doLater("clearResultSetTable");
ResultSet rs = ref.getResultSet(... |
20e641af-a503-4e5c-9106-9650d4a06b90 | 2 | public String getDatumValue(String datumName) {
String fieldName = datumName;
String value = null;
for (int i=0; i<displayData.size(); i++ ) {
TileObjectDisplayDatum dataLine = displayData.get(i);
String label = dataLine.getName();
if(label.equals(fieldName))
{
value = dataLine... |
199a1e93-738f-4a42-9aae-5409048ec36a | 6 | private void updateSettings(MouseEvent e){
if(startingEvent == null){
initSettings(e);
} else {
Point p = getNormalizedLocationFromScaledLocation(e.getX(), e.getY());
if(p == null){ // not being tracked
return;
}
p = getTileLoca... |
4b7e82e7-25e4-41bf-a2d8-33259c3f5f3d | 5 | public void freezeTime()
{
if (!data.won() && !data.lost())
{
if (game.isCurrentScreenState(GAME_SCREEN_STATE))
{
if (data.getBalance() >= COST_FREEZE_TIME)
{
if (!data.isPaused())
{
... |
a1219d25-2f6b-45d5-8efe-80def2f1ca3f | 8 | public String getServiceIcon(Integer idService) {
String s;
if (idService == 1) {
s = "brightness-contrast";
} else if ((idService > 1) && (idService < 7)) {
s = "lock";
} else if (idService == 7) {
s = "phone";
} else if (idService == 8) {
... |
b9125cd2-238a-40f9-b347-4e997eabc17d | 2 | @Override
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException {
if (DATA_FLAVOR.equals(flavor)) {
return this;
}
if (DataFlavor.stringFlavor.equals(flavor)) {
return getSanitizedName();
}
throw new UnsupportedFlavorException(flavor);
} |
fc021fc6-6c74-4bf7-8265-08d59b6f1853 | 9 | public void renderWall(int[] p1, int[] p2, int[] p3, int[] p4, double zDiff, double z0, double z1, double x0, double x1, BufferedImage image, boolean alphaEnabled){
Screen screen = raycaster.getBuffer();
double topYDiff = p2[1] - p1[1];
double topXDiff = p2[0] - p1[0];
double topGrad ... |
9f6c7103-07ed-4d5f-bf06-91dc5eca3ecf | 2 | public String getPhonenumberByUID(Statement statement,String UID)//根据用户名获取电话
{
String result = null;
sql = "select phonenumber from Users where UID = '" + UID +"'";
try
{
ResultSet rs = statement.executeQuery(sql);
while (rs.next()) {
result = rs.getString("phonenumber");
}
}
catch (SQLExcep... |
667b8a97-095b-439c-9fa1-0d443adc1603 | 0 | public int getDeptId() {
return deptId;
} |
cd1f0de7-4ac1-49bc-aadb-195a7069c6d1 | 5 | private void button1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_button1MouseClicked
if(numberofpins < 4)
{
if(numberofpins == 0)
{
Login_form.setString1("3");
}
if(numberofpins == 1)
{
Login_form.setString2("3");
}
if(numberofpins == 2)
{
Login_... |
8c5ac7c3-c549-47d8-ba59-0f0c252b42ae | 1 | public String getRiverName () {
River r = trip.getRiver();
if (r == null) {
return "<?>";
}
return r.getRiverName ();
} |
9cedf77b-e68f-4846-a41d-1829537ca880 | 9 | public ArrayList getOrdersToRovers(String orders) throws InputParseException{
String[] tmp = orders.split("\\s+");
String order = "";
ArrayList otr = new ArrayList();
int cnt = 0;
for (int i = 0; i < tmp.length; i++) {
if (cnt < 4) {
order += " ";
... |
08ce1fca-e97f-4817-8cf4-1001d2a59717 | 4 | private String getCharBuffer() {
StringBuilder lb=new StringBuilder();
int a;
for (a=0;a<7;a++) {
if (inChar[a]==true) lb.append("1");
else lb.append("0");
if ((a==0)||(a==5)) lb.append(" ");
}
return lb.toString();
} |
907bc023-dec9-4550-80a7-e66fb64a1153 | 2 | public boolean hasBlacklistBypassPermission() {
return this.blacklistByPassPermission != null && !this.blacklistByPassPermission.equals("*") && !this.blacklistByPassPermission.equals("");
} |
f1ffeaef-c380-4236-98d2-8ef01dab81f8 | 1 | public void setLater(final boolean flag) {
if (StackPRE.DEBUG) {
System.out.println(this + " Later = " + flag);
}
later = flag;
} |
a26da69b-2113-4fdc-8515-4658540efd51 | 0 | public ArrayIterable(T[] source)
{
this._source = source;
} |
4061d88e-99c2-4fda-9596-a85e497de6cd | 3 | public String toString()
{
StringBuffer localStringBuffer = new StringBuffer("ImageComponent[");
if (this.CurrentImage == null) {
localStringBuffer.append("null image");
}
else if (ImageNamer != null)
{
localStringBuffer.append("(\"");
localStringBuffer.append(ImageNamer.getImage... |
5a5399f9-ad9a-4ce4-ac3f-a0a998bd4adf | 9 | private boolean step() throws LexicalError, SyntaticError, SemanticError
{
if (currentToken == null)
{
int pos = 0;
if (previousToken != null)
pos = previousToken.getPosition()+previousToken.getLexeme().length();
currentToken = new Token(DOLLAR, "... |
0eff79f5-7ce5-48ba-a41c-a78d17f05469 | 2 | public boolean isActor(String id) {
boolean isActor = false;
for (Stakeholder stakeholder : stakeholders)
if (stakeholder.getId().equals(id))
isActor = true;
return isActor;
} |
fb13f7fa-526f-4425-acde-a31201d5d396 | 0 | public Result Login() {
return this.LoginResult;
} |
492e7eaf-e4f6-406d-b4d3-5fb12da7c895 | 5 | public VariableStack mapStackToLocal(VariableStack stack) {
VariableStack newStack;
int params = instr.getFreeOperandCount();
if (params > 0) {
exprStack = stack.peek(params);
newStack = stack.pop(params);
} else
newStack = stack;
VariableStack lastStack = newStack;
for (int i = 0; i < caseBlocks.l... |
33c49d5f-9ec0-4961-924b-cc441c3e0b64 | 2 | public AudioClient (Socket socket){ //put in socket with server address
try {
sampleRate = 44100;
int sampleSizeInBits = 16;
int channels = 1;
boolean signed = true;
boolean bigEndian = false;
format = new AudioFormat(sampleRate, sampleSizeInBits, channels, signed, bigEndian);
DataLine.Info d... |
2b9cc0d3-616a-4abb-9159-9651b236c515 | 1 | public static IntegerNode newList(int [] arrayIn){
IntegerNode finalList = new IntegerNode(arrayIn[0]);
for(int i = 0; i < arrayIn.length; i++){
IntegerNode addItem = new IntegerNode(arrayIn[i]);
finalList.setNext(addItem);
}
finalList.printList();
return finalList;
} |
188ef2a6-4973-4fcc-bafe-fc055058c810 | 4 | public static void main(String[] args)
{
// The bus stops with names BSi are meant to be regular bus stops for
// which time information is not displayed in the schedule.
// The others are meant to be time points for which time information
// is printed in the schedule.
// Note: ... |
d7feecfc-4499-48b6-8f92-2bbbcb619a59 | 7 | static int getNextIDPosilek(){
if(posilki[0]==null)
return 1;
for(int i=0 ; i<10 ; i++)
if(freeIDPosilki[i]!=0)
{
int d = freeIDPosilki[i];
freeIDPosilki[i]=0;
return d;
}
int ID;
boolean flaga=true;
while(true)
{
IteratorPosilki.first();
ID= posilki[CountPosilki-1].id + 1;
while(Iterator... |
94af2887-ea1b-4c54-89eb-d5165e139a14 | 0 | public Message(String content, String source){
this.content = content;
this.source = source;
} |
dde577cb-acea-4f3b-af3a-92da9d67937c | 4 | public boolean rakennaMallista(Sijainti sijainti, boolean[][] malli)
{
for(int y = 0; y < malli.length; y++)
for(int x = 0; x < malli[y].length; x++)
if(malli[y][x] && !tetrimino.palikkakokoelma().tungePalikka(uusiPalikka(x, y)))
return false;
... |
144528b5-f98c-4c6f-a08c-217fef9c7d32 | 1 | @Override
public void processEvent(BodyEvent event) {
if(event instanceof MoveEvent) {
processMoveEvent((MoveEvent) event);
}
} |
82861e11-d956-461d-9a90-bc14b8b26d77 | 6 | public String toString() {
String string = "";
for(String key : params.keySet()) {
string += key + ": " + params.get(key) + "\n";
}
if (metadata != null) {
for(NameTypePair item : metadata) {
string += item.getName() + ": " + item.getType() + "; ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.