method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
8d77f183-7986-4855-afb2-a99a901abb39 | 2 | public void visitIntInsn(final int opcode, final int operand) {
buf.setLength(0);
buf.append(tab2)
.append(OPCODES[opcode])
.append(' ')
.append(opcode == Opcodes.NEWARRAY
? TYPES[operand]
: Integer.toString(... |
e146857f-3913-4d8b-bf22-33b0e7eb06c4 | 1 | private static void writeTableDescription(BufferedWriter out, TableDescription td) throws IOException {
String tableName = td.getName();
List<String> columnNames = td.getColumnNames();
out.write("table: " + tableName + "\n");
for (String columnName : columnNames) {
out.write... |
8cec4604-8bf2-49aa-8565-d2835dd1fa0d | 1 | @Override
public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible) {
WindowMenuProvider.update();
}
} |
efc53d64-b2cc-4ff8-ab15-c53cae7fac90 | 2 | private static <T> T randomObject(RandomObjectFunction<T> f) {
T t = null;
do {
if (r.nextInt(10) != 0) {
t = f.get();
}
} while (t == null);
return t;
} |
2ebd3e7d-fdd3-43e9-b475-be77d7f77924 | 1 | public void testFactory_FromCalendarFields() throws Exception {
GregorianCalendar cal = new GregorianCalendar(1970, 1, 3, 4, 5, 6);
cal.set(Calendar.MILLISECOND, 7);
MonthDay expected = new MonthDay(2, 3);
assertEquals(expected, MonthDay.fromCalendarFields(cal));
try {
... |
0f47e8b2-04cd-469d-af3a-a2bdd418da65 | 4 | private void dropLink() {
BufferedReader in;
try {
LinkListViewHelper helper = (LinkListViewHelper) dropLinkComboBox.getSelectedItem();
if(helper == null)
return;
Link l = helper.getLink();
DataOutputStream dos = new DataOutputStream(socket.getOutputStream());
in = new BufferedReader(new I... |
41d14a07-8502-4cf0-aae5-7df10f290205 | 4 | @SuppressWarnings("unchecked")
public void showCache() {
ArrayList<HostRecord> validRecords = new ArrayList<HostRecord>();
synchronized(hostCache) {
for (HostRecord hostRecord: hostCache.getItems()) {
if (hostRecord.getIpAddresses().size() > 0) {
validRecords.add(hostRecord);
}
}
}
Collectio... |
ec25986f-2366-4da0-b43d-d300a7d1eff3 | 0 | public void removeItem(int id){
inv[id].type = 0;
} |
190a5ad5-e109-4801-8769-6bc527650e35 | 4 | public <T> TypeAdapter<T> getDelegateAdapter(TypeAdapterFactory skipPast, TypeToken<T> type) {
boolean skipPastFound = false;
for (TypeAdapterFactory factory : factories) {
if (!skipPastFound) {
if (factory == skipPast) {
skipPastFound = true;
}
continue;
}
... |
a2441092-b35d-4a37-bc28-92f391ea03f2 | 3 | private void registerEvents(Scene scene) {
Logger.getLogger(FXReadInterface.class.getName()).entering(FXReadInterface.class.getName(), "registerEvents", scene);
Logger.getLogger(ReadComponent.class.getName()).log(Level.CONFIG, "Gestures events are being registered");
scene.setOnZoom((ZoomEvent e... |
3ace9529-6ba9-4ec9-a9a7-b846f75de4b6 | 6 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PosFuncEstadoPK that = (PosFuncEstadoPK) o;
if (fesCedula != that.fesCedula) return false;
if (fesIdPos != null ? !fesIdPos.equals(that.fesIdPo... |
fc1ce3b3-5f67-411b-9dfa-8869668a23f2 | 2 | static void input(double[][] matrix){
for(int i = 0; i < matrix.length; i++){
for(int j = 0; j < matrix[i].length; j++){
matrix[i][j] = scan.nextDouble();
}
}
} |
06f820e5-7e42-4880-9803-a09e4e32b4b8 | 7 | public int smallestMultiple(int limit){
int sum=1;
ArrayList<Integer> divisors=new ArrayList<Integer>();
for(int i=2;i<=limit;i++){
for(int j=0;j<divisors.size();j++){
int div=divisors.get(j);
if(i%div==0){
divisors.remove((Object)div);
}
}
divisors.add(i);
}
for(int i=2;i<limit;i... |
29597e85-c97f-4a7c-be07-7b52567c3203 | 4 | public boolean newgame()
{
Scene localScene = null;
try
{
localScene = SceneBuilder.readScene(this.applet, this.inp, GameApplet.this.progressDialog);
}
catch (Exception localException)
{
localException.printStackTrace();
}
GameState localGameState = ne... |
2fc65f67-78b7-4b62-9025-e0f30bd9dfeb | 7 | @Override
public void addScript(ScriptingEngine S)
{
if(scripts==null)
scripts=new SVector<ScriptingEngine>(1);
if(S==null)
return;
if(!scripts.contains(S))
{
ScriptingEngine S2=null;
for(int s=0;s<scripts.size();s++)
{
S2=scripts.elementAt(s);
if((S2!=null)&&(S2.getScript().equalsIgnor... |
5553f00e-6d66-43eb-a953-782f8eb6a6a4 | 1 | public static void sliceAndDice(Destructible d) {
// Lazy instantiation
if (ginsu == null) {
ginsu = new Ginsu();
Thread t = new Thread(ginsu);
t.start();
}
ginsu.destructibles.push(d);
} |
2d00949b-12a5-4350-83f4-6e279a7476e6 | 2 | private HashMap<String, CatanColor> getPlayerColorMap() {
HashMap<String, CatanColor> playerColors = new HashMap<String, CatanColor>();
if(this.serverModel != null) {
List<Player> players = new ArrayList<Player>(presenter.getClientModel().getServerModel().getPlayers());
players.removeAll(Collections.singleton... |
13463fa8-cdee-4163-b17b-16d929b6517e | 5 | public void pre_paid()
{
int i, count = 1;
get_date();
if(!Paid_MaSP.isEmpty() && Money_count_Items != 0)
{
normal_mode(true);
ComboBox_history.setEnabled(false);
Vector Final_paid_SelectSP = new Vector<>();
for( i =0; i < Paid_MaSP.siz... |
84e848a3-7460-4e70-b41e-cd6bfb4f3dce | 4 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (!(obj instanceof AbstractLocomotive))
return false;
AbstractLocomotive other = (AbstractLocomotive) obj;
if (maxSpeed != other.maxSpeed)
return false;
return true;
} |
40cf15f1-a58a-44df-ae37-7079f8acf58c | 9 | private static ArrayList<String> filter (ArrayList<String> wordList)
{
ArrayList<String> filteredWords = new ArrayList<String>();
filteredWords.add("usgin");
filteredWords.add("document:text");
filteredWords.add("document:image");
filteredWords.add("Downloadable");
for (int i = wordList.size() - 1; i >= 0; ... |
77ab9f6a-9f6e-45d0-9728-8dfe49eb1451 | 4 | private void JBRemoverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBRemoverActionPerformed
this.zerarModelo();
int crm;
try{
int linha = JTListaMedico.getSelectedRow();
if( linha >= 0){
crm = (int) JTListaMedico.getValueAt(li... |
bc1a96f0-9549-4ace-8f02-be3c80aafb14 | 9 | public void initialize() throws Exception {
int numOfAttributes;
int numOfInstances;
int i;
int j;
Change = 0.0;
//Manipulate Data
if (NormalizeData) {
m_Filter = new Normalize();
m_Filter.setInputFormat(m_Instances);
m_Instances = Filter.useFilter(m_Instances, m_Filter);... |
613c1098-d02e-44ac-9022-12250029eeca | 8 | String consumeLetterThenDigitSequence() {
int start = pos;
while (pos < length) {
char c = input[pos];
if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
pos++;
else
break;
}
while (!isEmpty()) {
char c = ... |
c3b8ec38-d19c-4dba-bdd2-0480e3f14103 | 0 | public void onStop() throws JFException { console.getOut().println("---Auto Trader OFF---"); } |
a0e8bcfd-12ed-41ff-9474-93a5e9570524 | 4 | static double GetMaxBACKEndCompletionTime() {
double ret = systemClock.getCurrent();
if (sessionList.size() > 0) {
for (int i = 0; i < sessionList.size(); i++) {
if (sessionList.get(i).getBackEndCompletionTime() != Double.MAX_VALUE) {
if (sessionList.get(i).getBackEndCompletionTime() >= ret) {
r... |
2e9d29ef-0ad5-422b-9263-412e302876c0 | 8 | @Override
public void actionPerformed(ActionEvent e) {
String command = e.getActionCommand();
if (ALL.equals(command)) {
for (int i = 0; i < goodsList.getModel().getSize() && i < maxCargo;
i++) {
GoodsItem gi = (GoodsItem) goodsList.getModel().getElementA... |
56d704ed-a9cb-4b2a-97b4-58d478b53a2e | 1 | private int scavenge(int obj) {
int len = toSpace[obj];
// Scan the fields in this object, using forward on
// any pointer fields that we find to make sure the
// objects that they refer to are copied into toSpace.
for (int i = obj; i <= (obj+len); i++) {
toSpace[i] = forward(toSpace[... |
e6eba61d-2038-482e-a488-b5cd0434eeb4 | 6 | public int returnHight(TreeNode root) {
if (root == null){
return 0;
}
int hLeft = returnHight(root.left);
int hRight = returnHight(root.right);
if (hLeft-hRight<-1||hLeft-hRight>1||hLeft==-2||hRight==-2){
return -2;
}
else {
re... |
85f3f0c4-7fe7-475c-bc9f-ff16998ee608 | 6 | public void blink() {
if (getWorld().getObjects(Dolphin.class).size() != 0) {
getXD = ((Dolphin) getWorld().getObjects(Dolphin.class).get(0)).getX();
getYD = ((Dolphin) getWorld().getObjects(Dolphin.class).get(0)).getY();
setLocation(getXD - 20, getYD + 25);
}
... |
7d251cd7-fe27-4716-a2b2-f19b081a9b75 | 8 | private static String escapeJSON(String text) {
StringBuilder builder = new StringBuilder();
builder.append('"');
for (int index = 0; index < text.length(); index++) {
char chr = text.charAt(index);
switch (chr) {
case '"':
case '\\':
... |
56878352-3a6a-49f1-8c43-db8c0b5d70fc | 1 | @Override
public boolean onMouseDown(int mX, int mY, int button) {
if(super.onMouseDown(mX, mY, button)) {
return true;
}
Application.get().getHumanView().popScreen();
return true;
} |
94de7409-c6e4-4c06-a04f-317e5030f035 | 0 | public void setAcceptByFinalState() {
myAcceptance = FINAL_STATE;
} |
33304303-63da-42f4-9f3a-10fb36474dc5 | 7 | public static int calculoDosPicos(int[] entrada){
//calculo de la posicion del histograma con el mayor dato
int hk=0; //esta variable hace referencia al valor mas alto H(k)
int k=0; //hace referencia al punto mas alto de los picos
for(int i=0; i<entrada.length; i++)
if(entrada... |
5a3dcea6-d2f9-4612-8070-a6c1e07b97c8 | 2 | @Test
public void testQueuePeekMultipleJobs() throws LuaScriptException,
InterruptedException {
String jid1 = addJob();
Thread.sleep(1000);
String jid2 = addJob();
List<BaseJob> jobs = _queue.peek(2);
assertEquals(2, jobs.size());
for (BaseJob baseJob : jobs) {
assertTrue(baseJob.getAttributes().g... |
467c89e0-79eb-4ff0-abde-637231094516 | 3 | public void mouseClicked(MouseEvent me) {
Point cell = me.getPoint();//
Point location = me.getLocationOnScreen();
int col = tabel.columnAtPoint(cell);
boolean columnOk = activeColumns.isEmpty() || activeColumns.contains(col);
if (columnOk && me.getButton() == 3) {
in... |
60460205-06a1-4eed-89ac-5dc83b7cb448 | 1 | public void dumpInstruction(TabbedPrintWriter writer)
throws java.io.IOException {
writer.println("continue"
+ (continueLabel == null ? "" : " " + continueLabel) + ";");
} |
56149951-c8b4-437a-8a5a-1b4fb36dc91d | 3 | @Override
public boolean equals(Object ob)
{
if (ob == this)
{
return true;
}
if (ob == null || ob.getClass() != this.getClass())
{
return false;
}
User user = (User) ob;
return user.getName().equalsIgnoreCase(this.getName());
} |
8d3b158f-c36e-4834-83d6-f1be74a870a3 | 3 | public void endElement(final String namespaceURI,
final String localName,
final String qName)
throws SAXException
{
if(isTargetQuestion && qName.equals(DPH_tag.QUESTION_TAG)){
isTargetQuestion = false;
}
if (qName.equals(DPH_tag.ANSWE... |
6a3b65c8-9a07-4fa7-b937-0ff0011a8e31 | 4 | public void paint(Graphics window) {
Graphics2D g2d = (Graphics2D) window;
// the frame is 550 wide, the bg image is 900 wide
if (nX1 < -1000) {
nX1 = nX2 + nWidth; //move it to the far right
} else if (nX2 < -1000) {
nX2 = nX1 + nWidth; //move it to the far righ... |
ded08bf7-4205-415a-97ac-faf2363f6bb2 | 9 | public static final char[] getPassword(InputStream in, String prompt) throws IOException {
MaskingThread maskingthread = new MaskingThread(prompt);
Thread thread = new Thread(maskingthread);
thread.start();
char[] lineBuffer;
char[] buf;
int i;
buf = lineBuffer ... |
2aa25b9c-1036-4154-a2e3-8e59e8a23e92 | 7 | public static void startupDefclass() {
if (Stella.currentStartupTimePhaseP(0)) {
Stella.$ALL_RECYCLE_LISTS$ = Stella.makeNonRecycledList();
}
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, ... |
7ec1005b-1c22-4986-9dc0-1e60e2336bbc | 7 | private <T> boolean checkPrivateMethod(String testname, Object expected,
T object, String method, Object[] args, boolean inexact) {
this.testname = testname;
// create an Array of the argument types
int length = Array.getLength(args);
Class<?>[] parameters = new Class[length];
for (int i = 0; i < length;... |
7dedaaac-64f3-438d-b5a7-e629cc6351f2 | 2 | private void initTransitionListener() {
minDfa.addTransitionListener(new AutomataTransitionListener() {
public void automataTransitionChange(AutomataTransitionEvent e) {
if (!e.isAdd())
return;
Transition transition = e.getTransition();
if (!remainingTransitions.contains(transition)) {
JOptio... |
dacd787b-1c93-4595-8c8a-9e046dfc01e9 | 7 | private RTreeNode chooseLeaf(T o, RTreeNode n)
{
assert(n != null);
if (n.isLeaf())
{
return n;
}
else
{
final BoundedCube box = o.getBounds();
int maxOverlap = Integer.MAX_VALUE;
RTreeNode maxnode = null;
for (int i = 0; i < n.children.size(); i++)
{
final int overlap = expansionNee... |
ba58d8a2-3326-4f7b-9f1f-1c3f3bc070a4 | 2 | public ClassAnalyzer getClassAnalyzer(ClassInfo cinfo) {
if (cinfo == getClazz())
return this;
if (parent == null)
return null;
return getParent().getClassAnalyzer(cinfo);
} |
845f36dd-506a-4c7a-a8b6-4932324b4454 | 5 | protected void WriteToMultiple(String getkey,List<String> getvaluelist,PrintWriter writer){
if(getkey.equals("address")){
writer.print("\t\t\t\t");
for(String item:getvaluelist){
writer.print(item);
}
writer.println();
}
else if(getkey.equals("booklist")){
for(int index=0;index<getvaluelist.siz... |
686715ae-206c-43c4-9998-0a7f05d441d1 | 1 | private List<Integer> processLine(String line, List<Integer> list) {
Scanner scanner = new Scanner(line); //create scanner for line
while (scanner.hasNextInt()) {
list.add(scanner.nextInt());
}
return list;
} |
248a4c91-a7cd-4dbc-8210-5665623b2478 | 0 | public EndPoint(int port, String address) {
setPort(port);
setAddress(address);
} |
1d0e4257-e345-49db-b98a-23481dba84c2 | 8 | public void dumpInstruction(TabbedPrintWriter writer)
throws java.io.IOException {
boolean needBrace = thenBlock.needsBraces();
writer.print("if (");
cond.dumpExpression(writer.EXPL_PAREN, writer);
writer.print(")");
if (needBrace)
writer.openBrace();
else
writer.println();
writer.tab();
thenBl... |
8faac48b-2195-41bf-9daf-4e9e2329e997 | 8 | @Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == view.ingredientsButton) {
setUpView(new IngredientView(model.getAllIngredients()));
}
if (e.getSource() == view.preparationButton) {
setUpView(new PreparationView(model));
}
if (e.getSource() == view.starter.panelSearch) {
... |
4ea7157f-2d35-4f40-a0db-6211ada09a59 | 4 | public static String addStylename(String style, String stylename)
{
if (indexOfStylename(style, stylename) < 0)
{
if (style == null)
{
style = "";
}
else if (style.length() > 0
&& style.charAt(style.length() - 1) != ';')
{
style += ';';
}
style += stylename;
}
return style;
... |
2e890757-7ca2-4201-8524-c87791db1126 | 5 | private void findConfigurableAnnotation(ArrayList<Class<?>> classes)
{
System.out.println("Finding configurable annotation... " + classes.size());
try {
for(Class c : classes)
{
System.out.println("checking if configurable annotation... " + c.getName());
... |
ae22c6eb-52e7-48c2-bb69-5985c8525404 | 4 | private static double executaOperador(char op, double lhs, double rhs) throws InvalidOperator
{
switch (op) {
case '+': return lhs + rhs;
case '-': return lhs - rhs;
case '*': return lhs * rhs;
case '/': return lhs / rhs;
default: throw new InvalidOperator(op);
}
} |
8688afa0-b58d-41a4-9cd4-3b3ffe8deb09 | 7 | public static Level[] getLevels(JFrame frame, Game game) {
ArrayList<Level> levels = new ArrayList<Level>();
try {
Statement s1 = conn.createStatement();
ResultSet rs = s1
.executeQuery("Exec getLevelLayout");
if (rs != null) {
while (rs.next()) {
int levelID = rs.getInt("layoutID");
... |
bbbd053c-806a-44e8-bac2-0e51bd697398 | 9 | private static List<String> getURLS(Elements links, int whichObject) {
List<String> set = new ArrayList<String>();
List<String> mainSet = new ArrayList<String>();
for (Element link : links) {
Elements elems = link.getElementsByTag("tr");
for (Element element : elems) {
String[] array = element.toString(... |
55bc3749-1c19-42f2-8c67-530e8c116957 | 2 | public ClientInfo find(String t_name) {
for (ClientInfo a : client_list) {
if (a.name.equals(t_name))
return a;
}
return null;
} |
de3a2fbe-7a9d-4e02-a2e8-6ad7810f15e7 | 2 | public void start() throws Exception
{
System.out.println("1. Begin game.");
System.out.println("2. Abandon game.");
System.out.println("What's your choice?");
String choice = sc.nextLine();
switch(choice)
{
case "1": playersChoice();
brea... |
b3b9d93c-cdd7-4f88-87dc-e775489df48e | 6 | public void emptyGasTank()
{
for (Police p : data.getLevel().getPolices())
{
if (p.containsPoint(x + INTERSECTION_RADIUS, y + INTERSECTION_RADIUS))
{
float oldVelocityX = p.getVx();
float oldVelocityY = p.getVy();
p.setVx(0);
... |
17b9c50b-1a07-497b-89bb-938f3da405b9 | 8 | @Override
public T askChoice(boolean cancel) {
String cancelString = "Cancel";
String playerName = control.getPlayer().getName();
if (cancel) {
System.out.println(playerName + ", " + promptMessage + " Type \"" + cancelString + "\" to cancel.");
} else {
System.out.println(playerName + ", " + promptMessa... |
5e6bdbf0-98e5-4065-9eef-563a60ed0f0f | 6 | public byte[] decodeBytes(boolean implicit) throws Asn1Exception {
byte[] retValue = null;
//
// There must be at least 2 bytes available
//
if (residualLength < 2)
throw new Asn1Exception("Attempt to read past end of stream");
//
// Validate the tag... |
ab932613-4011-45f4-b51b-01311118c0c6 | 6 | public void add(T element) {
// create element
Node z = new Node();
z.key = element;
Node y = NULL;
Node x = root;
while (x != NULL) {
y = x;
int compare = z.key.compareTo(x.key);
if (compare < 0) {
x = x.left;
} else {
if (compare == 0 && !allowSameElementMultipleTimes) {
return;... |
56aecea9-b936-4225-bcb7-0c746eee55e4 | 4 | private ShipTypeMapper() {
shipTypeToColorMap.put(ShipType.PASSENGER, ShipTypeColor.BLUE);
shipTypeToColorMap.put(ShipType.CARGO, ShipTypeColor.GREEN);
shipTypeToColorMap.put(ShipType.TANKER, ShipTypeColor.RED);
shipTypeToColorMap.put(ShipType.HSC, ShipTypeColor.YELLOW);
shipTypeToColorMap.put(ShipTy... |
2ef4fe8d-598f-4ff6-ad98-5913e2b128fc | 8 | @Override
public void run() {
while (active) {
RtmpPacket rtmpPacket = writeQueue.poll();
// Write all queued RTMP packets
while (rtmpPacket != null) {
try {
final ChunkStreamInfo chunkStreamInfo = rtmpSessionInfo.getChunkStreamInfo(rt... |
8ff6d522-af43-4765-b3a5-2917814090f7 | 0 | public String getCode_sec() {
return code_sec;
} |
ecc68c79-e00b-47cd-8144-149759115208 | 6 | public CallStackElement(CallStackElement<?> caller, Thread thread, Class<?> declaringType, String fileName, int lineNumber, Object object, F function, Object[] args) {
super();
this.caller = caller;
this.thread = thread;
this.declaringType = declaringType;
this.fileName = fileName;
this.lineNumber = lineNum... |
9e6d7f52-2eee-49a7-9451-21cb4091b939 | 0 | public void setWritter(IDeviceWritter writter) {
this.writter = writter;
} |
d3110daa-f968-4a70-806f-35508439c2f1 | 6 | private boolean savebill(String saveFile){
boolean return_val = true;
String unknownComsumer = "......................";
if(No_cu.getText().isEmpty()){
No_cu.setText("0.0");
}
try{
Double.parseDouble(No_cu.getText());
}catch(NumberFormatExc... |
798eeb2f-39a7-4990-b55d-eb9e91da6d67 | 3 | @Override
protected void reactPressed(MouseEvent event) {
ProgramState curr = StateMachine.getState();
if (curr != ProgramState.ARR_PLAYING) {
if ((Settings.debug & 0b100000) != 0)
System.out.println("Delete song");
ObservableList<String> l = theStaff.getArran... |
138356e5-cb2b-491b-ac25-25a8a88ec24a | 7 | public void playSound(String filename) {
String strFilename = filename;
try {
soundFile = new File(strFilename);
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
try {
audioStream = AudioSystem.getAudioInputStream(soundFile);
} catch (Exception e) {
e.printStackTrace();
Sy... |
a438c567-9496-43af-8a0b-7e792b15a03f | 7 | private void filterPixels(DirectGif89Frame dgf) throws IOException
{
if (ciLookup == null)
throw new IOException("RGB frames require palette autodetection");
int[] argb_pixels = (int[]) dgf.getPixelSource();
byte[] ci_pixels = dgf.getPixelSink();
int npixels... |
a263711a-089a-4b0b-aa8b-93615b4aba42 | 3 | public void setValor(PValor node)
{
if(this._valor_ != null)
{
this._valor_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
... |
897477fa-bdad-483a-88cb-cb7409f64c41 | 0 | public Visiteur(String matricule, String nom, String prenom, String adresse, String cp, String ville, String dateEmbauche, Secteur secteur, Labo labo) {
this.matricule = matricule;
this.nom = nom;
this.prenom = prenom;
this.adresse = adresse;
this.cp = cp;
this.ville = vi... |
faec9001-780c-48ef-bec6-634e24fdba98 | 3 | public String update( String mtGoxJson )
{
ObjectMapper mapper = new ObjectMapper();
String tickerJson;
try
{
Ticker ticker = new Ticker();
MtGoxTicker mtGoxTicker;
mtGoxTicker = mapper.readValue( mtGoxJson, MtGoxTicker.class );
ticker.setLast( (long)(mtGoxTicker.getLast() * Exchange.getInstanc... |
587a065f-d814-46dc-8342-71648d84cabe | 4 | public boolean containsModel(int id) {
if (definition == null) {
return false;
}
int[][] models = definition.modelIds;
if (models != null) {
int[] ints = models[0];
for (int i : ints) {
if (i == id) {
return true;
}
}
}
return false;
} |
908bc8d2-1c0e-4adc-a2d2-f04b19855174 | 8 | public int work(float[] buffer) throws AOException {
System.out.println("Point 1");
//System.out.println("grainsPerSecond: " + grainsPerSecond);
// Regarding the filter: I am thinking it will be easier to initiate the filter
// as part of the instrument, rather than in this section, so t... |
d550ec2e-4a57-4e74-a7a9-6f25d35cb1e0 | 2 | private void dfs(Digraph G, int v)
{
marked[v] = true;
for (int w : G.adj(v))
if (!marked(w))
dfs(G, w);
} |
ad7e3f8c-aa66-420b-a17e-ad12007e9f78 | 4 | private boolean isAbundant(int num) {
if(num < 12) {
return false;
} else {
int sum = 0;
for(int i = 1; i < num; i++) {
if(num % i == 0) {
sum += i;
if(sum > num) {
return true;
}
}
}
return false;
}
} |
4ac52ec4-f350-4987-b1a4-df2dd2217323 | 3 | @Override
public void findClasses() {
Enumeration<JarEntry> jarEntries = jarFile.entries();
while (jarEntries.hasMoreElements()) {
JarEntry jarEntry = jarEntries.nextElement();
String entryName = jarEntry.getName();
if (entryName.endsWith(".class")) {
ClassNode classNode = new ClassNode();
try {
... |
ba8112af-59d6-462a-8533-f7e7c423fe6d | 3 | public ResultDataNormal searchByISO(String s) {
ArrayList paths = new ArrayList<>();
ArrayList names = new ArrayList<>();
//Consulta por modelo de camara
MongoHandler dbmon = new MongoHandler();
DB dbmongo = dbmon.connect();
DBCursor cursorDoc;
DBCollection collec... |
c3a1b455-21b9-4fd5-85f4-3c1795a9f994 | 6 | private int jjMoveStringLiteralDfa11_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(9, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(10, active0);
return 11;
}
switch(curChar)
{
case 32... |
02de448a-f0bd-46eb-a690-89b7c0e0d43f | 4 | public void run() {
/////////////////////////////////////////////////////
// For ease of I/O (since we haven't yet discussed
// binary packet data), convert the distance vector into
// a String so it can be read using a Scanner:
//////////////////////////////////////////////////... |
a9d9449b-0a3d-4b2f-81ef-b5424a205714 | 4 | public Object getService2(java.lang.Class serviceType) throws Exception {
if (serviceType == null) {
return new IllegalArgumentException("serviceType");
}
for (Object o : this._list) {
if (serviceType.isInstance(o)) {
return o;
}
}
if (this._parentProvider != null) {
return this._parentProvid... |
a50430d8-0c48-404e-a01c-f098f1f9aa76 | 0 | public static void collapseEverything(JoeTree tree) {
TextKeyListener.collapseEverything(tree);
return;
} |
4addd7dc-6268-4848-b2ca-ed044fe28204 | 1 | public GamePanel(GameView gameView) {
super();
this.gameView = gameView;
this.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
final int x = e.getX() / SQUARE_SIZE;
final int y = e.getY() / SQUARE_SIZE;
try {
gameView.clickSquare(x, y);
rep... |
85f287d2-75ba-4eda-93c3-9fd955a29b19 | 6 | public void close() throws IOException {
if (out != null) {
if (!finished) {
// out.close() must be called even if writePending() fails.
// writePending() saves the possible exception so we can
// ignore exceptions here.
try {
... |
111ca03f-2935-41b4-ba6e-e7dbeffb902a | 0 | private void start()
{
initDrools();
initLighter(startEntryPoint);
cleanUpSession();
} |
b16cf313-d593-4173-ab84-cd01596070a1 | 8 | private void composeDemos(Index index, ClassLoader cl) throws ClassNotFoundException, NoSuchMethodException, SecurityException {
List<AnnotationInstance> demoAnnoInstances = index.getAnnotations(DotName.createSimple(org.jboss.demos.Demo.class.getName()));
for (AnnotationInstance ai: demoAnnoInstances) {
Annotati... |
ebd50a1e-b096-4d84-af9a-6c8842b06846 | 2 | private static void realizarLexer() throws FileNotFoundException, InvalidCantidadDeTokensDeLookaheadException, IOException, BufferDeTokensVacioException {
TokenManager tokenManager = new TokenManager(2, new FileReader("src/test/fuente_prueba.txt"));
//El token reconocido por el lexer
... |
56d7982e-5462-401d-ad8a-2206224f85ad | 2 | public String getTheater() {
// for a movie and show
try {
// Always return the first theater
List<ShowTiming> list =
em.createNamedQuery("ShowTiming.findByMovieAndTimingId",
ShowTiming.class)
.setParame... |
4a1508b9-93d1-4c5a-b213-9b7e3ef11b0b | 9 | public void actionPerformed(ActionEvent e) {
// TODO: es sollte gesucht werden nach dem klick auf suchen und der
// Graph soll kontinuierlich aufgebaut werden. ist die suche komplett
// soll erst die meldung erscheinen
if (e.getSource() == this.userSearchButton || e.getActionCommand().equals("comboBoxEdited")) ... |
d8a7f911-161a-46c6-a966-b29b63804376 | 9 | private static Object getOrderLine(TimeInForceField timeinforce, PriceType type, MarketSideField side, String acct, double price, double stop, double offset)
{
if (side.equals(MarketSideField.BUY_TO_COVER))
{
if (price > 0)
{
if (type.equals(PriceType.STOP))
{
return "<Order TmInForce=\"" + time... |
7dc5260e-f78c-42d2-9307-0431753a221f | 0 | public void buildPartA() {
System.out.println("build partA");
partA = new PartA();
} |
05d402cd-dfbf-4c4c-8ac8-f53f273580e7 | 6 | @Override
public boolean xsetsockopt (int option_, Object optval_)
{
if (option_ != ZMQ.ZMQ_SUBSCRIBE && option_ != ZMQ.ZMQ_UNSUBSCRIBE) {
ZError.errno(ZError.EINVAL);
return false;
}
byte[] val;
if (optval_ instanceof String)
val = (... |
2c630bba-937d-40d4-bfb5-93dcc5168c4d | 1 | public void makePurchase(int amount) {
int availableCredit = this.creditLimit - balance;
if (amount > availableCredit) {
balance = balance + amount + 50;
} else {
balance = balance + amount;
this.purchases++;
}
} |
570f8501-a6c1-47da-b7dd-3a2218ae7750 | 3 | @Override
public double[] get3DData(int px, int pz, int py, int sy, int sx, int sz)
{
double[] d = f.get3DData(px, pz, py, sy, sx, sz);
int s = sx * sy * sz;
for (int i = 0; i < s; i++)
{
double n = d[i];
if (n < min)
n = min;
... |
50764205-923c-462f-bc63-76c683b0a9fa | 7 | public List func_71558_b(ICommandSender par1ICommandSender, String par2Str)
{
String as[] = par2Str.split(" ", -1);
String s = as[0];
if (as.length == 1)
{
ArrayList arraylist = new ArrayList();
Iterator iterator = field_71562_a.entrySet().iterator();
... |
a1b6362e-a330-44f2-b3bd-b6e33076939a | 5 | void deleteActivity(Component dialogParent, Activity activity) {
if (activity != null) {
if (AlertMessages.deleteActivityConfirmation(dialogParent, activity)) {
try {
Connection conn = Dao.getConnection();
for (Time t : timeDao.getTimesByActivity(conn, activity)) {
timeDao.deleteTime(conn, t);
... |
293e5ced-877b-4b7d-98e2-a948e73cf6d2 | 9 | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
HttpSession sesionOk = request.getSession();
if (sesionOk.getAttribute("usuario") != null) {
response.setContentType("text/html;charset=UTF-8");
... |
b05f3532-82d8-4344-bb1e-8da799fe7710 | 5 | public boolean execute(Robot paramRobot)
{
if (!this.animating)
{
int i = this.where.getDirection(paramRobot);
switch (i) {
case 0:
i = 180; break;
case 180:
i = 0; break;
case 90:
i = 270; break;
case 270:
i = 90; break;
}
param... |
194f9371-2130-45d3-8fc6-a2e1e0fe1fce | 3 | public List<TraverseMode> getModes() {
ArrayList<TraverseMode> modeList = new ArrayList<TraverseMode>();
for (TraverseMode mode : TraverseMode.values()) {
int mask = getMaskForMode(mode);
if (mask != 0 && (modes & mask) == mask) {
modeList.add(mode);
}... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.