method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
2b494ab4-0dbe-4ef2-8d13-9dc5d4fe2ec2 | 5 | public String stringApiValue() {
if (isEmpty()) {
return "(list)";
}
final int fullSlices = (size() / MAX_STRING_API_VALUE_LIST_LITERAL_SIZE);
if (fullSlices > MAX_STRING_API_VALUE_LIST_LITERAL_SIZE) {
// @todo this could be improved upon, since the
// (NCONC (LIST ... slice1 ... ) (L... |
15cf3d79-06aa-4f3e-a81f-4a7cf155ab5d | 4 | public void clearField() {
for (int i = 0; i < gameFieldView().dBricksView().size(); i++) {
BARRIERS_GROUP.remove(gameFieldView().dBricksView().get(i).sprite());
}
gameFieldView().dBricksView().clear();
for (int i = 0; i < gameFieldView().iBricksView().size(); i++) {
... |
ecee41d5-72ad-4547-9988-1a70124715b4 | 0 | @Override
public Balance Accesscreate() {
return Balance.create();
} |
26871bee-5516-4b32-b526-06a6d6633d33 | 1 | @RequestMapping(value="agregarStock", method=RequestMethod.POST)
public ModelAndView agregarStock(@ModelAttribute(value="nombreProducto") String nombreProducto, @ModelAttribute(value="cantidadProducto") Integer cantidadProducto) {
Stock stock = Stock.getInstance();
if (cantidadProducto != null) {
stock.ag... |
a9322e9c-1b36-4dc7-82ca-002a1589f965 | 4 | private boolean kill(String[] args) {
if (args.length >= 2) {
Client client;
if (clientList.containsKey(args[1])) {
client = clientList.get(args[1]);
if (args.length == 2) {
client.disconnect();
return true;
... |
4531ea26-564a-4ab9-ab0a-5a0c7b5cd49c | 5 | private Card getLowestCard(Player p) {
Card lowest = null;
for (Card card : p.getHand()) {
Card.Rank rank = card.getRank();
if (rank != Card.Rank.TWO && rank != Card.Rank.TEN && (lowest == null || rank.compareTo(lowest.getRank()) < 0))
lowest = card;
}
return lowest;
} |
154b2386-bee8-401b-9529-ad9026b37f24 | 4 | @Override
public boolean containsInteger(String name) {
JOSObject<? , ?> raw = this.getObject(name);
if(raw == null) return false;
if(raw.getName().equalsIgnoreCase(INTEGER_NAME)) return true;
return false;
} |
cc35351e-3af5-46e5-a3f7-245c09abb67d | 4 | @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGH)
public void onEntityDamage(EntityDamageEvent event) {
if(!(event.getEntity() instanceof Player)) return;
Player p = (Player) event.getEntity();
AGPlayer agp = pH.getAGPlayer(p.getName());
if(agp == null)
return;
if(agp.isPraying())... |
b28b50c8-be9e-4157-b407-8a5cffbf117e | 3 | public void kickStartSimulatedAnnealing(){
OutputWriter.println(SA_START_MSG);
AnnealedProgramsGatherer gatherer = new AnnealedProgramsGatherer();
List<Thread> annealedSimulators = new ArrayList<Thread>();
List<Program> toAnneal = selectionCrossoverOp.select(population, populationSize/2 + 1);
List<Thread> thr... |
f1402d33-448b-4812-afa8-e1ee4f7b8ea7 | 9 | public void handle(UserProcessingEvent event) {
if (Boolean.getBoolean(Configuration.MULTI_LANE_MODES)) {
ProcessingWorkEntry entry = new ProcessingWorkEntry();
ProcessingWork work = new ProcessingWork();
work.setEvent(event);
entry.setWork(work);
... |
69e98dd8-7665-4756-81ae-94278690eec7 | 7 | public void runMixer(int motor, int time)
{
if (!isConnected())
{
error("Robot is not connected!", "RXTXRobot", "runMixer");
return;
}
if (!getOverrideValidation() && (motor < RXTXRobot.MOTOR1 || moto... |
60f377ea-840d-4672-94da-8ffad6840e55 | 7 | private boolean checkCondition(CommandSender s, String[] a, String command, String type) {
if(!hasPermission(s, command)) {
s.sendMessage("You have no Permission for this Command.");
return false;
}
if(a.length < 4) {
s.sendMessage(ChatColor.RED + _mo... |
e910eee0-1000-45f2-92a3-1645f2ec4103 | 1 | public synchronized static ChatSocketServer getServerSingleton() {
if (instance == null) {
instance = new ChatSocketServer();
}
return instance;
} |
10a390e1-49d9-4328-a8e7-a62924c60789 | 8 | private void btnRegistrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRegistrarActionPerformed
//Asigna lo que hay en las cajas de texto a los String, int, double
//Guarda lo que hay en los atributos en un vector
String archivo = txtNArchivo.getText();
S... |
3b853c15-dd96-4c7d-914e-432992a51b98 | 7 | public static String tickets(int[] peopleInLine)
{
int count50 = 0;
int count25 = 0;
for (int current : peopleInLine){
if (current == 25){
count25++;
}
if (current == 50){
count25--;
if (count25 < 0){
... |
63f335c6-19b2-49f3-b5e7-1edfe1667983 | 2 | public static String readContent(String filePath) throws Exception {
File file = new File(filePath);
if (file.exists()) {
StringBuffer sb = new StringBuffer();
InputStream in = new FileInputStream(file);
InputStreamReader inReader = new InputStreamReader(in,"UTF-8");
BufferedReader beReader = new Buffer... |
2c4ab239-edba-4afd-8e55-dd146fb4063e | 3 | public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof OrderdetailPK)) {
return false;
}
OrderdetailPK castOther = (OrderdetailPK)other;
return
(this.orderNumber == castOther.orderNumber)
&& this.productCode.equals(castOther.productCode);
} |
3bd33b2e-9600-4e50-909a-ceab5fdb9ba4 | 8 | public static String reverseWords(String input) {
//first reverse the string
char[] buff = input.toCharArray();
int left = 0;
int right = buff.length-1;
while(left<right) {
char temp = buff[right];
buff[right] = buff[left];
buff[left] = temp;
... |
d198135c-6d65-4938-a527-5360efac2b88 | 1 | @Override
public String request() {
if(subject == null) {
System.out.println("Subject inactive");
subject = new Subject();
}
System.out.println("Subject active");
return "Proxy: Call to " + subject.request();
} |
12e39f61-8da3-4185-9da6-3d571aae007b | 1 | public void addOkMessage(String message) {
Document docs = textArea.getDocument();
SimpleAttributeSet attrSet = new SimpleAttributeSet();
StyleConstants.setForeground(attrSet, Color.BLACK);
try {
docs.insertString(docs.getLength(), "\r\n" + lineNumber++ + ": "
+ message, attrSet);
} catch (BadLocati... |
4e6abdee-df7c-4298-8cd2-792ecf27971b | 1 | public static boolean input(String question) {
System.out.println(question);
Scanner sc = new Scanner(System.in);
String text = sc.nextLine();
try {
return Boolean.parseBoolean(text);
} catch (NumberFormatException e) {
System.err.println("Enter a valid bo... |
a95e800a-9bf4-47e2-8c74-eb34036522ff | 2 | protected void centerOnClientArea() {
Rectangle clientArea = shell.getDisplay().getPrimaryMonitor().getClientArea();
Point shellSize = shell.getSize();
int xPos = clientArea.x + (clientArea.width - shellSize.x) / 2;
int yPos = clientArea.y + (clientArea.height - shellSize.y) / 2;
... |
39abdf83-5e0d-4a8d-a839-c5d66202b17c | 0 | public Set getSymbolsWithReplacements() {
return symbolToReplacements.keySet();
} |
97bc0946-0ac5-4038-8de7-d4dbd99658e0 | 1 | public String retrieveNetworkPool(String adminLink) throws Exception{
String response = doGet(adminLink + "extension/");
String networkPools = findElement(response, Constants.VCLOUD_LINK, Constants.NETWORK_POOLS, null);
response = doGet(networkPools);
String element = findElement(response, Constants.NET_POOL... |
00b311e2-8fce-4acb-99fb-6b3c7fc7e6df | 4 | private synchronized void processEvent(Sim_event ev) {
double currentTime = GridSim.clock();
boolean success = false;
if(ev.get_src() == myId_) {
if (ev.get_tag() == UPT_SCHEDULE) {
if(currentTime > lastSchedUpt) {
// updates the schedule, finishes jobs, reservations, etc.
u... |
77db7232-ec96-49fd-a3bd-2b03a4be63d6 | 5 | @Override
protected void drawChildren(boolean selection)
{
super.drawChildren(selection);
if(!selection && this.isActive() && dc > 0 && this.cursorInside())
this.cursor.draw();
dc-= Settings.get(SetKeys.R_MAX_FPS, Integer.class)/60 * 2;
if(dc < -Settings.get(SetKeys.R_MAX_FPS, Integer.class))
dc =... |
81ddb218-0376-49a2-9005-7bd9a94a6cd1 | 3 | public boolean isSyncCurrentPosition(int syncmode) throws BitstreamException
{
int read = readBytes(syncbuf, 0, 4);
int headerstring = ((syncbuf[0] << 24) & 0xFF000000) | ((syncbuf[1] << 16) & 0x00FF0000) | ((syncbuf[2] << 8) & 0x0000FF00) | ((syncbuf[3] << 0) & 0x000000FF);
try
{
source.unread(syncbuf, 0,... |
b947283e-09f8-4220-81ff-f4a9c918119c | 6 | @Override
public void addNode(String path, byte[] data) {
if ((nodes.get(path) != null) && nodes.get(path).exists()) {
throw new IllegalStateException("Node '" + path
+ "' already exists");
}
if ((nodes.get(getParent(path)) == null)
|| !nodes.... |
860d3dda-157d-4f0d-aae5-58785aea3b4c | 9 | static protected void FillBuff() throws java.io.IOException
{
if (maxNextCharInd == available)
{
if (available == bufsize)
{
if (tokenBegin > 2048)
{
bufpos = maxNextCharInd = 0;
available = tokenBegin;
}
else if (tokenBegin < 0)
bufpos... |
a27828e4-2b81-412c-8bcf-f9c51e657aef | 2 | private AbstractMob findBestTarget(ArrayList<AbstractMob> list){
AbstractMob best = null;
for (int i = 0; i < list.size(); i++){
if (!(list.get(i) instanceof Zombie)){
best = list.get(i);
break;
}
}
return best;
} |
5fa71df7-d651-4d6e-b515-a038928cf6c7 | 0 | static int getIndex(int year,int month ,int day){
Calendar calendar=new GregorianCalendar(TimeZone.getTimeZone("GMT"));
calendar.set(Calendar.YEAR,year);
calendar.set(Calendar.MONTH,month-1);
calendar.set(Calendar.DATE,day);
calendar.set(Calendar.HOUR_OF_DAY,0);
calendar.... |
87593c68-78d1-4279-9c57-9e0dd60b8e85 | 3 | public static void createTables() throws SQLException {
String query;
Connection con = getConnection();
PreparedStatement statement = null;
if (tableExists(Config.sqlPrefix + "Lifestones") == false) {
System.out.println("Creating Lifestones.Lifestones table.");
query = "CREATE TABLE `"
+ Config.sqlPr... |
2d8d8951-ab5d-44ba-b540-ee9de821ecda | 4 | private Location getLocationFromString(String s) {
switch(s) {
case "trein":
return this._trainPlatform;
case "vrachtauto":
return this._truckPlatform;
case "binnenschip":
return this._riverBoatPlatform... |
f4e77879-d808-4408-b4f8-a5aeba54f98d | 5 | public static int blueTicket( int a, int b, int c )
{
int ab = a + b;
int bc = b + c;
int ac = a + c;
if ( ab == 10 || bc == 10 || ac == 10 )
{
return 10;
}
if ( ab - bc == 10 || ab - ac == 10 )
{
return 5;
}
r... |
b98d844f-5207-4b81-9507-1d2000a234c4 | 3 | public static final BasicGraphEditor getEditor(ActionEvent e)
{
if (e.getSource() instanceof Component)
{
Component component = (Component) e.getSource();
while (component != null
&& !(component instanceof BasicGraphEditor))
{
component = component.getParent();
}
return (BasicGraphEditor)... |
cfaa0dca-ed00-4a43-addf-a92879be24d8 | 4 | public void onFruitCatched(Fruit.Type fruitType){
// if (Log.VERBOSE) Log.v(LOG_TAG, "catched " + fruitType);
System.out.println(LOG_TAG + " Catched: " + fruitType);
Ingredient<Fruit.Type> fruit = currentProgress.getIngredient(fruitType);
actionOcurred(GameActionFactory.createFruitCatchedAction(fruitType, fruit ... |
8b1e1b3a-cdb8-44a7-93c2-bfcd90f996af | 9 | @Test
public void testInfest() {
try {
// Clear the mosaic
re.clear();
// Set the parameters of the mosaic using a raster template
re.setPresenceMap("./resource files/Age.txt",species);
// Set the environment such that no cells are infested
re.setPresenceMap("NONE",species);
re.setHabitatMap("... |
15d79a5f-4e32-4240-a696-4014bdde8129 | 5 | @Override
public void actionPerformed(ActionEvent e)
{
JButton clicked = (JButton) e.getSource();
{
if(clicked == buttons[0])
{
if(owner != null)
{
owner.switchState(Game.EnumState.GAME_STATE);
}
... |
c9d3d2cd-7c71-489a-ac86-2c8998aee1a3 | 0 | public void setDescription(String description) {
this.description = description;
} |
82856c41-e985-46d6-bbf2-14584978ea9d | 0 | public static void main(String[] args) {
BaseballGame game1 = new BaseballGame("Static Brawlers", "Instantiated Kickers");
BaseballGame game2 = new BaseballGame("Blue Cats", "Red Cats");
System.out.println(game1.getTeams());
System.out.println(game2.getTeams());
System.out.println(BaseballGame.getTot... |
924d30b7-d4a5-48a2-9d1f-77a4f986769d | 7 | protected void func_27255_a(int par1, int par2)
{
this.field_27268_b = -1;
if (par1 >= 79 && par1 < 115)
{
this.field_27268_b = 0;
}
else if (par1 >= 129 && par1 < 165)
{
this.field_27268_b = 1;
}
else if (par1 >= 179 && par1 <... |
b4934c41-8628-4880-aec0-d0bcefb1adf8 | 9 | public Vector solve(Matrix A, Vector b, Vector x)
throws IterativeSolverNotConvergedException {
checkSizes(A, b, x);
double rho = 0, rho_1 = 0, xi = 0, gamma = 1., gamma_1 = 0, theta = 0, theta_1 = 0, eta = -1., delta = 0, ep = 0, beta = 0;
A.multAdd(-1, x, r.set(b));
v_tl... |
f60f4abf-0919-433c-a6f3-5a17c8058bfe | 5 | protected Node<T> getLeast(Node<T> startingNode) {
if (startingNode == null)
return null;
Node<T> lesser = startingNode.lesser;
while (lesser != null && lesser.id != null) {
Node<T> node = lesser.lesser;
if (node != null && node.id != null)
le... |
0159f4e4-d727-440f-9016-22657f1f1f7b | 6 | public byte[] getCursorMoveSequence(int direction, int times) {
byte[] sequence = null;
if (times == 1) {
sequence = new byte[3];
} else {
sequence = new byte[times * 3];
}
for (int g = 0; g < times * 3; g++) {
sequence[g] = ESC;
... |
45c7d7c6-fe14-4645-b28f-251236849df0 | 1 | public void visit_d2f(final Instruction inst) {
stackHeight -= 2;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
stackHeight += 1;
} |
d6a695b7-e4c8-4b53-80fb-a70ffd89972d | 6 | public void searchMultiTripFlightsPartOne() {
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
System.out.println("Where is your MySQL JDBC Driver?");
e.printStackTrace();
}
PreparedStatement ps = null;
Conne... |
eca5ef21-4454-4643-8078-c07c5e8e12bf | 5 | public void resurectHero()
{
if (player.getDeadHeroes().size() == 0) {
QMessageBox.warning(this, "Nie można wskrzesić bohatera", "Nie posiadasz martwego bohatera którego można wskrzesić");
} else if (castle.getHero() != null) {
QMessageBox.warning(this, "Nie można wskrzesić bohatera", "W tym zamku znajduje s... |
e7077fc3-0316-4658-8132-bba61acea9cb | 3 | @Override
public void run() {
while (running) {
synchronized (lock) {
if (cacheIndex < 500) {
mouseXCache[cacheIndex] = client.mouseX;
mouseYCache[cacheIndex] = client.mouseY;
cacheIndex++;
}
}
try {
Thread.sleep(50L);
} catch (Exception exception) {
}
}
} |
b820cff6-cba2-4370-897c-72f5eba017d5 | 1 | public void setWidth(double value) {
if (value <= 0) {
throw new IllegalArgumentException(
"Illegal width, must be positive");
} else {
width = value;
weight = calculateTotalWeight();
}
} |
c54969fd-7e86-4a2d-8612-608c9ed901ad | 3 | public void newIssueFired(ActionEvent event) {
final String selectedProject = getSelectedProject();
if (model != null && selectedProject != null) {
ObservableIssue issue = model.createIssueFor(selectedProject);
if (table != null) {
// Select the newly created issu... |
c8af4114-acf6-4d1b-b0d0-a74139672f4c | 4 | private void animateBar(){
for( ActionListener aL : animationTimer.getActionListeners()){
animationTimer.removeActionListener(aL);
}
animationTimer.addActionListener(new
ActionListener(){
public void actionPerformed(ActionEvent event){
if(nextValue > currentValue... |
876f9725-edb7-4ffd-90ff-375992012264 | 8 | public boolean predict(FeatureVector featureVector, SingleDecision decision) throws MaltChainedException {
if (model == null) {
try {
model = Linear.loadModel(new BufferedReader(getInstanceInputStreamReaderFromConfigFile(".mod")));
} catch (IOException e) {
throw new LiblinearException("The model cannot... |
cef1cdc2-5882-4568-bff9-d0013bc01309 | 7 | public static Cons visibleModules(Module from) {
if (from == null) {
from = ((Module)(Stella.$MODULE$.get()));
}
{ MemoizationTable memoTable000 = null;
Cons memoizedEntry000 = null;
Stella_Object memoizedValue000 = null;
if (Stella.$MEMOIZATION_ENABLEDp$) {
memoTable000 = (... |
6052eeba-749e-4179-8435-e97a02f6b78c | 0 | public boolean isDefending() {
return this.isDefendingNow;
} |
384b26e1-3f96-4a08-94c4-d9626c8d9569 | 6 | private static Set difFiles(String[] files1, String[] files2) {
Set set1 = new HashSet();
Set set2 = new HashSet();
Set extra = new HashSet();
for (int x=0; x < files1.length; x++) {
set1.add(files1[x]);
}
for (int x=0; x < files2.length; x++) {
set2.add(files2[x]);
}
Iterato... |
0939f33e-564f-4e10-926b-c3e2fb78fc68 | 1 | public boolean padding()
{
if (h_padding_bit == 0) return false;
else return true;
} |
5e518f02-dd91-48b9-868b-8977ac4cda52 | 0 | public EventComment findEventCommentById(final Long id) {
return new EventComment();
} |
0fb225cb-1ae2-44d3-97b1-f9f6561cbc34 | 5 | @Override
public void caseAIntArrHexp(AIntArrHexp node)
{
inAIntArrHexp(node);
if(node.getRSq() != null)
{
node.getRSq().apply(this);
}
if(node.getExp() != null)
{
node.getExp().apply(this);
}
if(node.getLSq() != null)
... |
db46fd3e-c814-4d00-9961-69d30bcdb181 | 9 | public static String eBookingCarrier2SoushippingCarrier(String eBookingCarrier){
String retSoushippingCarrier=null;
if(eBookingCarrier.equals("MAERSK"))
{
retSoushippingCarrier = "MSK";
}else if (eBookingCarrier.equals("EMI")) {
retSoushippingCarrier = "EMIRATES";
}else if (eBookingCarrier.equals("EMC")... |
75c05d24-1aa3-4198-88e9-cc7c956851da | 6 | @SuppressWarnings("unchecked")
protected void calcRows(List results) {
if (results.size() == 0){
setTruthValue(Boolean.FALSE);
return;
}
if (results.size() == 1) {
Object val = results.get(0);
if ((val instanceof CycSymbol) && (((CycSymbol)val).toString().equalsIgnoreCase("nil"))) ... |
83d18094-8044-42ef-8e2b-3354b5f6ceb1 | 2 | public boolean foundAllTypes() {
for (int i = 0; i < types.length; i++)
if (types[i] == null) return false;
return true;
} |
9ee79c04-8a23-4668-8cfe-2d4d86144cc1 | 0 | public void stop() {
thread = null;
} |
93cfc5aa-1edf-4da0-95d5-832070d0f785 | 4 | public static void displayURL(String url)
{
boolean windows = isWindowsPlatform();
String cmd = null;
try
{
if (windows)
{
// cmd = 'rundll32 url.dll,FileProtocolHandler http://...'
cmd = WIN_PATH + " " + WIN_FLAG + " " + url;
... |
6d812032-5068-4f13-b23a-da5be7bd1381 | 5 | private boolean isNeedsEscape(String character) {
if (character.matches("\\(")) {
return true;
} else if (character.matches("\\)")) {
return true;
} else if (character.matches("\\$")) {
return true;
} else if (character.matches("\\^")) {
return true;
} else if (character.matches("\\!")) {
retur... |
1255d8d2-55c2-46a1-acbc-7c07aee38831 | 8 | public static void notify(String title, String message) {
_shell = new Shell(Display.getDefault(), SWT.ON_TOP | SWT.NO_TRIM);
_shell.setLayout(new FillLayout());
_shell.setForeground(_fgColor);
_shell.setBackgroundMode(SWT.INHERIT_DEFAULT);
_shell.addListener(SWT.Dispose, new Lis... |
87a9839f-e987-4f0f-87b3-74c1263ad77e | 3 | private static ConnectionHandler getConnection() {
for ( ConnectionHandler c : connections ) {
if ( !c.isUsed() ) {
return c;
}
}
// create a new connection as none are free
Connection connection = null;
ConnectionHandler ch = null;
... |
78ac203b-d310-43da-b5a6-97e0a3d6ad0c | 9 | static String serializeNodeValue(Object value)
{
String strValue;
if (value == null)
{
strValue = null;
}
else if (value instanceof Boolean)
{
strValue = XMPUtils.convertFromBoolean(((Boolean) value).booleanValue());
}
else if (value instanceof Integer)
{
strValue = XMPUtils.convertFromInteg... |
f8a2532c-654d-4d5f-bee1-e3ed232da0d2 | 5 | public boolean matches( IPAddress dest ) {
if( equals(dest) ) return true;
if( dest instanceof IP6Address ) {
IP6Address dest6 = (IP6Address)dest;
long hi = getUpper64(), lo = getLower64();
// solicited node multicast?
if( hi == 0xFF02000000000000l &&
(lo & 0xFFFFFFFFFF000000l) == 0x00000001FF000... |
0b52b9f5-3281-43e3-bc02-977d0d3eb24b | 9 | @Override
public boolean execute(MOB mob, List<String> commands, int metaFlags)
throws java.io.IOException
{
commands.remove(0);
final String protectMe=CMParms.combine(commands,0);
if(protectMe.length()==0)
{
mob.tell(L("Protect whom? Enter a player name to protect from autopurge."));
return false;
... |
45753aef-e548-4be7-9537-7fbfc6741574 | 4 | public static Movimientos getInstance(int tipo){
switch(tipo){
case 1: return movimientos1;
case 2: return movimientos2;
case 3: return movimientos3;
case 4: return movimientos4;
}
return null;
} |
788a562d-b34c-4172-a36d-3367342d855e | 8 | private void updatePlaerInfoPosition(PlayerInfo playerInfo, Direction direction) {
switch (direction) {
case NORTH:
playerInfo.decrementY();
break;
case EAST:
playerInfo.incrementX();
break;
case SOUTH:
playerInfo.incrementY();
break;
case WEST:
playerInfo.d... |
c5ebb11a-704d-4235-9e5a-729f60ca1d5e | 7 | private int writeToStream(OutputStream streamOut, int count)
throws IOException {
int oldVirtualSize = virtualSize;
if (virtualSize > 0) { // If the buffer isn't empty
int bytesToWrite;
// If the virtual buffer wraps
if (head + virtualSize >= physicalSize... |
3fc7fbef-4b72-4ee7-96f7-66d992cb81d0 | 1 | public void stopTime() {
if (this.timer != null) {
this.timer.cancel();
}
} |
30977f8f-bff8-4e8f-b746-48c4fe84d479 | 4 | void parse_frame() throws BitstreamException
{
// Convert Bytes read to int
int b=0;
byte[] byteread = frame_bytes;
int bytesize = framesize;
// Check ID3v1 TAG (True only if last frame).
//for (int t=0;t<(byteread.length)-2;t++)
//{
// if ((byteread[t]=='T') && (byteread[t+1]=='A') && (byteread[t+2]=='G'))
... |
c6b90014-4207-443b-b23c-1787739a9ddf | 6 | @Override
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
if(aValue != null){
Message Msg = ListMsg.get(rowIndex);
MessageDAO MsgDAO = new MessageDAO();
switch(columnIndex){
case 0:
break;
case 1:
... |
6528023b-7622-4e30-8306-e36c9f481e3f | 9 | public void run(){
for( int k = lastSteps + 1; k < maxIter; k++){
for( int m = 0; m < maxTemp; m++ ){
for( int j = 0; j < maxStep; j++ ) {
for( int h = 0; h < dim; h++){
// Step in a random direction for each dimension.
double f = obj.eval();
double r = r... |
75ee9352-29af-4b32-9c33-80fbd2b50398 | 4 | @Override
public List<StrasseDTO> findStreetsByStartPoint(Long startPunktId, boolean b) {
List<StrasseDTO> ret = new ArrayList<StrasseDTO>();
if(startPunktId ==1){
StrasseDTO s= new StrasseDTO();
s.setStartPunktId(Long.valueOf(1));
s.setEndPunktId(Long.valueOf(2));
// s.setStartPunktName("A"... |
ca6ebbd0-cb30-4c75-90aa-19c871143127 | 6 | public static byte[] encrypt(byte[] in,byte[] key){
K = expandKey(key);
int lenght=0;
byte[] padding = new byte[1];
int i;
lenght = 16 - in.length % 16;
padding = new byte[lenght];
padding[0] = (byte) 0x80;
for (i = 1; i < lenght; i++)
padding[i] = 0;
byte[] tmp = new byte[in.lengt... |
f0567b84-cfed-427a-951d-ecf81d2ad3c9 | 6 | public static void main(String[] args) throws IOException {
InputStreamReader ir = new InputStreamReader(System.in);
BufferedReader in = new BufferedReader(ir);
int num = Integer.parseInt(in.readLine());
for (int i = 0; i < num; i++) {
String line = in.readLine();
String result = "";
int half = line.... |
d2ee86ad-0603-4a25-a0fe-d24ccdeed4d7 | 7 | public void renderSprite(int xp, int yp, Sprite sprite, boolean fixed) {
if (fixed) {
xp -= xOffset;
yp -= yOffset;
}
for (int y = 0; y < sprite.getHeight(); y++) {
int ya = y + yp;
for (int x = 0; x < sprite.getWidth(); x++) {
int xa = x + xp;
if (xa < 0 || xa >= width || ya < 0 || ya >= h... |
945cd5a5-7167-4942-8e7b-ded3dafc5965 | 7 | private void populateNodes() {
if (andList != null && andList.size() > 0 && orList != null && orList.size() > 0) {
return;
}
if (currentNode != null && currentNode.children != null && currentNode.children.length == 3) {
SimpleNode left = (SimpleNode) currentNode.children[0];
SimpleNode right = (Simple... |
2e366c9f-96af-49b8-a0f8-9bf737b266d5 | 9 | private final String[] create(
int aInSize,
int aInSingleIndentSize,
boolean aInStartWithEmpty,
String aInFirst,
String aInLast,
String aInCommon)
{
boolean lIsDefault = ((!isTab) && (DEFAULT_FIRST.equals(aInFirst) &&
... |
1996d41d-457b-426f-9abc-b44557f52881 | 3 | public void setRight(PExp node)
{
if(this._right_ != null)
{
this._right_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
... |
10c6c31c-cffa-4b4d-b1d6-702db332618c | 9 | private void botonComenzarImportacionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonComenzarImportacionActionPerformed
String col = getIdColeccion().getText();
String em = getIdEmision().getText();
String rut = getRutaCarpeta().getText();
int valor = 0;
... |
28e84c46-f786-4e49-bbad-8228a9eb8f90 | 1 | private synchronized void writeLog(String message) throws Exception {
try {
bw.write(message);
bw.newLine();
bw.flush();
} catch (Exception e) {
throw new Exception(e.getMessage());
}
} |
f089ab80-a51f-4c7b-b439-a45702322cd7 | 9 | public static PsdObject loadPsdObject(PsdInputStream stream)
throws IOException {
String type = stream.readString(4);
PsdObject.logger.finest("loadPsdObject.type: " + type);
if (type.equals("Objc")) {
return new PsdDescriptor(stream);
} else if (type.equals("VlLs")) {
return new PsdList(stream);
} ... |
bceea7c2-60f3-4b7b-bd55-042c03c45f56 | 8 | public static String stringFor_cl_gl_object_type(int n)
{
switch (n)
{
case CL_GL_OBJECT_BUFFER: return "CL_GL_OBJECT_BUFFER";
case CL_GL_OBJECT_TEXTURE2D: return "CL_GL_OBJECT_TEXTURE2D";
case CL_GL_OBJECT_TEXTURE3D: return "CL_GL_OBJECT_TEXTURE3D";
c... |
2c5f8f91-ff13-4ec0-9c78-59489df49285 | 0 | public List<V> get(Object key) {
return this.map.get(key);
} |
fcbef5ad-87b2-4aa7-bb01-5371425f32e7 | 1 | public void changeName(String id, String newName) {
if(participants.containsKey(id)) {
participants.get(id).setName(newName);
setChanged();
notifyObservers(ModelNotification.LIST_OF_PARTICIPANTS_CHANGED);
setChanged();
notifyObservers(ModelNotification.NAME_CHANGED);
}
} |
8eae0e1c-a2af-4325-9bee-f06efd5587be | 4 | public void run()
{
running = true;
try
{
if (!main.getConfig().getBoolean("force-update"))
{
VersionChecker.checkVersion(main.getApi());
while (askUpdate)
{
// Wait user.
... |
7768853f-55a9-4ba6-997c-b5b587859887 | 2 | private void exitCompositeState(CompositeState<TransitionInput> composite) {
for(StateMachineEventListener<TransitionInput> eventListener : eventListeners) {
eventListener.beforeCompositeStateExited(composite, this);
}
composite.onExit();
for(StateMachineEventListener<TransitionInput> eventListener : event... |
3d5595ee-4a66-4019-bafd-f15b99cefa02 | 9 | private void readSkills(String path, DataModel dataModel) {
try {
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse(new File(path));
// normalize text representation
doc.... |
5f67decd-19c3-4a7a-bb3a-5951779fc908 | 1 | public EmployeeDaoStub() {
map = new HashMap<Integer, Employee>();
for (int i = 0; i < 10; i++) {
Employee employee = new Employee();
employee.setEmail("v@pupkin" + i + ".com");
employee.setFirstName("Vasya" + i);
employee.setId((long) i);
empl... |
0007369c-70cd-4c91-933f-1c159e4c6cf7 | 1 | @SuppressWarnings("unchecked")
@Override
public <T> T adaptTo(Class<T> type) {
if (type.equals(ClassElement.class)) {
return (T) this;
}
return null;
} |
6f9879fa-5230-4125-a530-91d85130a504 | 5 | public void lireMateriel() {
if (simu.touchePressee(1)) {
controleur.start();
}
if (simu.touchePressee(2)) {
controleur.stop();
}
if (simu.touchePressee(3)) {
controleur.inc();
}
if (simu.touchePressee(4)) {
controleur.dec();
}
float p = simu.position();
if (p != prevp) {
controleur.u... |
7261ff43-b931-4a67-88b3-3c9c3929faf1 | 7 | @Override
public boolean equals(Object o)
{
if(o == null)
return false;
if(o == this)
return true;
if(!(o instanceof Auftrag))
return false;
Auftrag a = (Auftrag)o;
if(a.getNr() != nr || a.isIstAbgeschlossen() != istAbgeschlossen)
... |
0cc6338b-645f-4fbd-81d8-6f7eacc5f7a4 | 8 | private static List<String> processDeltas(List<String> origLines,
List<Delta<String>> deltas, int contextSize) {
List<String> buffer = new ArrayList<String>();
int origTotal = 0; // counter for total lines output from Original
int revTotal = 0; // counter for total lines output from Original
int line;
Del... |
8f44f554-9c2a-4ad7-9654-297a26ecc642 | 6 | public final void handleEnergyCharge(final int skillid, final byte targets) {
final ISkill echskill = SkillFactory.getSkill(skillid);
final byte skilllevel = getSkillLevel(echskill);
if (skilllevel > 0) {
if (targets > 0) {
if (getBuffedValue(MapleBuffStat.ENERGY_CHAR... |
545c4e40-aba4-4dab-ab30-440c1f1536e8 | 4 | public void crearTabla(){
int x=0;
while(x<NumeroEntradas){
List<Boolean> newLista=new List();
int y=0;
while(y<LargoLista){
for(int i=0;i<alternado;i++){
newLista.append(true);
y++;
}
... |
b83d469f-451d-4724-839d-b6c4a0cd2a97 | 9 | protected void stepFWDBackTrack(boolean showSteps) {
// Global alignment: start from D(m,n)
// TODO: Not very elegant. To be changed!
CellElement theOneBefore = null;
if (!m_backTrackList.isEmpty()) {
theOneBefore = (CellElement) m_backTrackList.getLast();
}
if (m_backtra... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.