method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
a75a13f8-b45a-4897-8a2c-eb575dbb359e | 3 | @Override
public void run() {
t1 = new Date();
try {
serverSocket = new DatagramSocket(514);
receiveData = new byte[1024];
scoresTimout = new Date();
outOfOrderCall = false;
} catch (SocketException e) {
Logger.getLogger(SyslogServ... |
1fb087e0-ced7-4ca2-9512-ee494a233837 | 1 | public FieldAnalyzer(ClassAnalyzer cla, FieldInfo fd, ImportHandler i) {
clazz = cla;
imports = i;
modifiers = fd.getModifiers();
type = Type.tType(fd.getType());
fieldName = fd.getName();
constant = null;
this.isSynthetic = fd.isSynthetic();
this.isDeprecated = fd.isDeprecated();
if (fd.getConstant(... |
16f2806f-586e-40e9-8b96-8f72e63edcf3 | 7 | @Override
public void onClick(MouseEvent event, int x, int y){
editPanel.setVisible(false);
if (selectedAnim != null){
for (ImageData iData : MainWindow.MAIN_WINDOW.getSheetData().getAllImageData()){
if (iData.getRect() != null && iData.getRect().contains(x, y)){
selectedFrame = iData;
editPanel.s... |
7fc713d9-c080-4b95-b627-8e2ca22be150 | 4 | public void createGraph(){
Scanner console = new Scanner(System.in);
String fileName;
if (gSize != 0)
clearGraph();
Scanner infile = null;
try{
System.out.print("Input file name for nodes: ");
fileName = console.nextLine();
Syst... |
3dfe9d4a-a9ca-4044-883a-cb572c3a76a7 | 4 | @SuppressWarnings("resource")
public final void registModule() {
try {
Socket clientSocket = null;
DataInputStream reader = null;
DataOutputStream writer = null;
try {
logger.info("正在连接..."
+ Setting.str_MalayansIP + ":"
+ Setting.int_DataInPort);
clientSocket = ... |
b038749f-2cda-4530-ab5a-aca69b7ef1c1 | 5 | @Override
public boolean execute(WorldChannels plugin, CommandSender sender,
Command command, String label, String[] args) {
final Map<Flag, String> info = new EnumMap<Flag, String>(Flag.class);
info.put(Flag.TAG, WorldChannels.TAG);
if(sender.hasPermission(PermissionNode.SHOUT.g... |
0f8b8ea7-08df-480c-913c-4fbc48f71fd3 | 7 | public WorldSavedData loadData(Class par1Class, String par2Str)
{
WorldSavedData var3 = (WorldSavedData)this.loadedDataMap.get(par2Str);
if (var3 != null)
{
return var3;
}
else
{
if (this.saveHandler != null)
{
try
... |
4a62a450-624c-4f5d-98e6-d52f4d149bab | 0 | public int getSeat() {
return seat;
} |
5df24095-1066-4382-a38a-85a7d0dc9ec1 | 6 | public static String escape(String string) {
StringBuffer sb = new StringBuffer();
for (int i = 0, length = string.length(); i < length; i++) {
char c = string.charAt(i);
switch (c) {
case '&':
sb.append("&");
break;
cas... |
c8cd456b-a963-43ad-91cc-779c3e3cbefc | 4 | private void deal() {
final List<Suit> suits = asList(Suit.Hearts,Suit.Diamonds,Suit.Spades,Suit.Clubs);
final List<Face> faces = asList(Face.Nine,Face.Jack,Face.Queen,Face.King,Face.Ten,Face.Ace);
List<Card> deck = new ArrayList<Card>(48);
// Fill new Pinochle deck
for (int i = 0; i < 2; i++) { // 2 of... |
d8d9a64d-3280-4fc5-9e3c-b37f6348be84 | 4 | public static boolean containsJavaFile(File file) {
boolean containsJavaFile = false;
if (file.isDirectory()) {
File list[] = file.listFiles();
for (int i=0; i < list.length; ++i) {
boolean ret = containsJavaFile(list[i]);
if (ret) {
return true;
}
}
} else {
if (file.getName().endsWi... |
a874970a-4dab-4cf3-b417-b04ac5ddfac3 | 2 | private void Remover_Button1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Remover_Button1ActionPerformed
try {
if (NomeJogador_TextField2.getText().equals("")) {
JOptionPane.showMessageDialog(null, "Selecione um jogador para remover!", "Alerta!", JOptionPane.WARN... |
883cade6-7d82-401b-aedd-0d5c6f8177c5 | 5 | private void load() {
// Load main model, if file is present
boolean haveOldData = false;
File file = settings.getStaticFile();
try {
FileInputStream reader = new FileInputStream(file);
XmlModelAdapter xml = new XmlModelAdapter();
xml.readModel(reader, model);
reader.close();
haveOldData = true;
... |
64fd1397-e74f-49e2-83f3-e2bff1eaaed8 | 3 | public static TileEntity createAndLoadEntity(NBTTagCompound var0) {
TileEntity var1 = null;
try {
Class var2 = (Class)nameToClassMap.get(var0.getString("id"));
if(var2 != null) {
var1 = (TileEntity)var2.newInstance();
}
} catch (Exception var3) {
var3.p... |
01ed7c3c-7ff4-4533-93a1-147f23ada6a6 | 4 | public static void main(String[] args)
{
World w = new World();
w.setAutoRepaint(false);
Deer[] deerArray = new Deer[20];
for (int i = 0; i < 20; i++)
{
deerArray[i] = new Deer(w);
}
// now loop to do simulation
for (int i = 0; i < 100; i++)
{
for (int d = 0; d < ... |
c1b4dc24-b317-4329-93e7-53414fd6fa77 | 7 | private void updateArgs() {
GameSize newSize;
if (R8.isSelected()) {
newSize = GameSize.C8;
}
else if (R7.isSelected()) {
newSize = GameSize.C7;
}
else {
newSize = GameSize.C6;
}
// Check if settings have changed and there is still a game active
if (Game.getThis() != null) {
if (Options... |
b0bc9f8e-ec09-473f-adf9-5fed5067749e | 0 | public SessionFactory getSf() {
return sessionFactory;
} |
34fe817c-792a-4f81-95ee-0e471eee821c | 5 | public static final void renderLine(final int x0, final int y0, final int x1, final int y1, final float[] v) {
final int dy=y1-y0;
final int adx=x1-x0;
final int base=dy/adx;
final int sy=dy<0?base-1:base+1;
int x=x0;
int y=y0;
int err=0;
final int ady=(dy<0?-dy:dy)-(base... |
813dc5bb-0d0b-4f33-92bd-fab27c96a713 | 3 | @Override
public Properties getOutputProperties() {
Properties properties = new Properties();
properties.put(NAME,getName());
if(startCapital!=null){
properties.put(Mortgages.TOTAL, startCapital.toString());
}
properties.put(Mortgages.NRPAYED, Integer.toString(alr... |
859880a2-d441-4e20-8484-50359ce8ec03 | 0 | public Kuuntelija(Pelaaja pelaaja) {
this.pelaaja = pelaaja;
} |
6520cc37-c7bd-428e-b1ec-225fa5ff28a2 | 0 | public void setMobileLab(String mobileLab) {
MobileLab = mobileLab;
} |
b804467c-dfdc-4992-95da-5aa965c11355 | 9 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=proficiencyCheck(mob,0,auto);
final Room room=mob.location();
int affectType=CMMsg.MSG_CAST_VERBA... |
4942d39e-87d5-4e55-92fb-1ab4f24b25b6 | 9 | public static List<ABObject> Hit (ABObject bird, ABObject obs, List<ABObject> objects, List<Point> trajs)
{
// List of affected object
List<ABObject> affectedList = new ArrayList<ABObject>();
affectedList.add(obs);
// Regular Rectangle
double ratio = obs.height / obs.width;
// Red bird - lowest dam... |
9731ba21-d9a6-4f9a-8f4d-6f668050a964 | 3 | public void onTopic(String chan, IRCUserInfo u, String topic) {
System.out.println(chan + " " + u.getNick() + " " + topic);
if(isJoiningAChannel && u.getNick() == main.getNick()){
System.out.println("Topic received...");
//channels.add(new ChatChannel(chan, main, topic));
numChannelFlag--;
if(numC... |
174397e8-0e21-4b1a-b291-986d37cc4fca | 7 | public static boolean isValid(String value) {
if (value == null || value.length() != 24) {
return false;
}
value = value.toUpperCase();
for (int i = 0; i < value.length(); ++i) {
char c = value.charAt(i);
if ((c < '0' || c > '9') && (c < 'A' || c > 'F... |
b41024a2-ca12-4440-896b-6ba8930f02a8 | 9 | @Override
public void run() {
String firstMessage = "";
try {
getStreams();
do {
firstMessage = (String) input.readObject();
if (firstMessage.equals(Messages.REGISTER)) {
registerUser();
} else if (firstMessage.equals(Messages.LOGIN)) {
loginUser();
} else if (firstMessage.equals... |
c96af65a-b0a2-4f15-bf99-7113b31c7a00 | 4 | public static void main(String[] args) {
for(int i=0; i<=10; i++ )
{
if( i%2 == 0)
System.out.println(i);
}
System.out.println();
for(int i=10; i>0; i-- )
{
if( i%2 == 0)
System.out.println(i);
}
} |
79aa99ef-fe3a-47bc-990c-bfb752f7c9ce | 1 | static void download(File url, File local) throws IOException {
logger.info("Installing :" + url + " -> " + local);
File tmp = File.createTempFile(local.getName() + "-", ".part", local.getParentFile());
tmp.deleteOnExit();
BufferedInputStream in = new BufferedInputStream(new FileInputStr... |
b863ee9a-688e-49bc-b344-c7dce649537f | 5 | public boolean setJTableRow(String[] result, String name) {
// TODO game={key1:value;key2:value...},game={key1:value;key2:value...}
Component comp = fetchComponent(null, name);
if (comp instanceof JTable) {
JTable table = (JTable) comp;
int count =0;
for (String game : result) {
for (int j = 0; j < t... |
a57b7282-7a74-478f-a0af-474b9994d1e3 | 4 | public static double futureDirection(int move) {
scenarios[move].setNext();
double down = scenarios[move].move(0, false);
scenarios[move].setNext();
double left = scenarios[move].move(1, false);
scenarios[move].setNext();
double up = scenarios[move].move(2, false);
... |
c9853d18-114d-4c5a-a21c-22ca71cb83cc | 9 | @Override
public boolean load(File file, SSGlobals glob) throws ParserConfigurationException, IOException, SAXException, NoSuchMethodException, InvocationTargetException, IllegalAccessException
{
if (!(glob.getConfig() instanceof IChangeableConfig))
{
return false;
}
IChangeableConfig config = (IChangeab... |
e8bb55d9-8600-4927-8b24-1217544b4986 | 0 | public GeoJsonObject getGeometry()
{
return geometry;
} |
7d7daa70-505c-4811-a34a-663a8d1f9724 | 4 | private boolean checkDiagonalDescending(CellState player, int col, int row) { // diagonal-\
// check winLength-in-a-row
int winCounter = 0;
int x = 0;
int y = 0;
for (int i = -model.getWinLength() - 1; i < model.getWinLength(); ++i) {
x = col + i;
// FIXME wtf?? i+1??
y = row + i + 1;
if (isIn... |
becd0ce6-9b8d-4df8-8703-250f5c8f4ca9 | 4 | public void deleteMiddleNode(LinkedNode node){
if(node==null || node.nextNode==null){
return;
}
LinkedNode current = node;
while(current.nextNode !=null){
current.value = current.nextNode.value;
if(current.nextNode.nextNode==null){
cur... |
c4b84468-a7ae-4bdf-bb8c-b1ab0be5b7a0 | 0 | public Date getBuiltOn() {
return builtOn;
} |
9eb3cdca-cab2-42c3-822e-5341e5b77ede | 5 | public InputStream getResourceAsStream(String name)
{
System.out.println("getResourceAsStream >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
InputStream ret = super.getResourceAsStream(name);
if(ret == null)
{
JarFile jar = null;
ZipEntry ze = null;
Enumeration enumeration = j... |
c933f393-5b5d-4d30-a9d7-2e0702cbda71 | 2 | public long[] keySetArray(long from, long to) {
TreeSet<Long> t = new TreeSet<Long>(keySet());
if (from == 0 && to == Reconciler.getDatamax()) return Reconciler.toArray(t);
return Reconciler.toArray(t.subSet(from, to));
} |
e33625be-1f27-47c8-a560-4a62e164935a | 9 | public static void main(String[] args) {
ServerSocket server = null;
int port = DEFAULT_PORT;
if (args.length > 0) {
try {
port = Integer.parseInt(args[0]);
if (port < 0 || port >= 65535) {
LOGGER.log(Level.SEVERE, "port must betwee... |
d259fbd7-9f69-4360-9fd6-1d3a84f77402 | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
RGBColor other = (RGBColor) obj;
if (b != other.b)
return false;
if (g != other.g)
return false;
if (r != other.r)
return false;
r... |
8b7cc615-a507-4b9f-8e54-98e64933c98a | 1 | public void closeConnection(){
try {
this.clone();
} catch (CloneNotSupportedException ex) {
Logger.getLogger(DatabaseConnection.class.getName()).log(Level.SEVERE, null, ex);
}
} |
ea70cff5-c9be-4b06-894c-644f7ce9ff89 | 4 | public static List<Aikaslotti> haeAikaslotit() throws NamingException, SQLException {
Yhteys tietokanta = new Yhteys();
Connection yhteys = tietokanta.getYhteys();
String sql = "SELECT * FROM Aikaslotti";
PreparedStatement kysely = yhteys.prepareStatement(sql);
ResultSet rs = kys... |
9b6d7521-b231-46eb-9b79-882e38a3e78e | 1 | public void sendOnlineUsers (List<String> clients)
{
String clientString = "";
for (String user : clients)
{
clientString = clientString + user+", ";
}
send("ONLINE# " + clientString);
} |
2471458d-b573-4888-8e90-de16b4a8635c | 1 | public void stop() {
if (frame != null)
frame.dispose();
} |
9e393d98-36dc-488f-acf5-3177358a8127 | 4 | public Usuario validarLoginUser(String user, String password) throws Throwable {
String jsql = "SELECT u FROM Usuario u WHERE u.login=:loginname and u.status='true'";
try {
Query query = HibernateUtil.getSession().createQuery(jsql);
query.setParameter("loginname", user);
... |
37fcb964-0d10-4339-8838-93638d860a94 | 2 | private boolean isKeyWord(String token, ArrayList<String> keywordList)
{
for (int i = 0; i < keywordList.size(); i++)
{
if (token.equals(keywordList.get(i)))
{
return true;
}
}
return false;
} |
fe9df7f2-2bbc-4bdb-902b-eed4ca4bad5d | 7 | public void sendRunScript(int scriptId, Object... params) {
try {
OutputStream stream = new OutputStream();
stream.writePacketVarShort(50);
String parameterTypes = "";
if (params != null) {
for (int count = params.length - 1; count >= 0; count--) {
if (params[count] instanceof String)
param... |
6009161d-f502-4784-b437-a817e52f338d | 2 | public void setDistance(Distance distance) {
for(int i=0;i<_distances.length;++i) {
if(_distances[i] == distance) {
_setDistance(i);
return;
}
}
} |
de4c9e6c-d32b-4595-8c53-0495c2c01006 | 4 | public void setSymtab(Symtab st) {
SymtabEntry funcEntry = st.lookup(id.toString());
if (funcEntry == null)
Main.error("The function " + id.toString() + " does not exist");
Symtab table = st.lookup(id.toString()).getTable();
int plLength;
if (pl == null)
plLength = 0;
else
plLength = pl.getLength()... |
7b33d573-5bae-4725-bf30-cb1c908ebf37 | 2 | public static String vectorCaddieDeletionToHTML(Vector<Caddie> rs){
if (rs.isEmpty())
return "";
String toReturn = "<TABLE BORDER='1' width=\"1000\">";
toReturn+="<CAPTION>Ces places ne sont pas réservables car la représentation a déjà eu lieu :</CAPTION>";
toReturn+="<TR>";
toReturn+="<TH> <i>Reservatio... |
4241c410-b27d-4edb-aaa5-092bd0ada5d4 | 9 | public void update() throws MaltChainedException {
// Retrieve the address value
final AddressValue arg1 = addressFunction.getAddressValue();
// if arg1 or arg2 is null, then set a NO_NODE null value as feature value
if (arg1.getAddress() == null ) {
featureValue.setIndexCode(table.getNullValueCode(NullVal... |
58916678-4012-4c54-b5a4-018dc621a23f | 2 | public static Socket getSocket(Neighbor from, Neighbor to) throws IOException {
if (!sockets.containsKey(to)){
// crear socket
Setup.println("[Broadcaster.getSocket] Creando socket a " + to.getAddr().getHostAddress());
Socket socket = new Socket(to.getAddr(), to.getPort());
... |
161f85df-bd33-4129-9f06-f38a2327cb60 | 0 | @RequestMapping(value = "/hall-event-sponsor-list/{hallEventId}", method = RequestMethod.GET)
@ResponseBody
public PartnerListResponse hallEventSponsorList(
@PathVariable(value = "hallEventId") final String hallEventIdStr
) {
return typedPartnerList(hallEventIdStr, PartnerRole.SPONSOR_RO... |
e35fab95-9beb-4be6-b964-c5cfe10e0ad4 | 7 | public static Cons allEquivalentRelations(NamedDescription relation, boolean reflexiveP) {
{ MemoizationTable memoTable000 = null;
Cons memoizedEntry000 = null;
Stella_Object memoizedValue000 = null;
if (Stella.$MEMOIZATION_ENABLEDp$) {
memoTable000 = ((MemoizationTable)(Logic.SGT_LOGIC_F... |
315ed1f9-f1a7-4ad9-982f-eadfe34929f4 | 5 | public void populationDistribution(){
int[][] species = new int[library.size()][2];
for(int i=0; i<bucket.size(); i++){
Molecule M = bucket.get(i);
species[M.getID()][0] = M.getID();
species[M.getID()][1]++;
}
int k;
for(int j=0; j<library.size(); j++){
int... |
07853b70-db7c-48d4-ae2c-61d251bb0ef1 | 2 | private void broadcastChange(Slot<T> slot) {
for(DraftListener<? super T> crnt : allListeners) {
crnt.onChange(slot);
}
} |
db3d01bd-999a-43c4-a4fc-1fb4a06fe7ff | 0 | public static XStoreFault getInstance(String faultCode, String faultString) {
XStoreFault xStoreFault = new XStoreFault();
xStoreFault.setFaultCode(faultCode);
xStoreFault.setFaultString(faultString);
return xStoreFault;
} |
914069f1-3963-45a3-8092-e088c471c3f4 | 7 | private void jTextField1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1KeyPressed
if (evt.getKeyCode() == java.awt.event.KeyEvent.VK_ENTER) {
Cliente c;
String cpf;
int tam;
cpf = jTextField1.getText();
tam = cpf.length();
... |
2cc66073-57cc-4f31-b4ff-73ed69426f6a | 2 | public static boolean streetAddress(String address){
if(address.matches("(\\d)+(\\s)[a-zA-Z\\s\\.]+")&&address.length()<100)
return true;
return false;
} |
9e6bd983-1c34-42dc-a5b5-caafafd30f8f | 7 | public boolean contains(double d) {
if (lowerUndefined)
return (upperOpen ? d < upperBound : d <= upperBound);
else if (upperUndefined)
return (lowerOpen ? d > lowerBound : d >= lowerBound);
else
return
(upperOpen ? d < upperBound : d <= upperBound) &&
(lowerOpen ? d > lowerBound : d >= lowerBo... |
10ca4583-0d16-4f6d-887b-852f92fee0a6 | 0 | public void go() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
//System.out.println("Bite!!!");
Stat eaterAttack = eater.getConstStats().get(StatType.C_ATTACK);
Stat eaterHunger = eater.getDynamicStats().get(StatType.D_HUNGER);
Stat victimHealth = vic... |
1665958f-39d0-4e75-b4c8-a0b6873fc205 | 7 | public void sort(Comparable[] arr) {
if (arr == null || arr.length <= 1)
return;
int size = arr.length;
int h = 1;
while (h < size / 3)
h = 3 * h + 1; // 1, 4, 13 ............
while (h >= 1) {
for (int k = h; k < size; k += h) {
int index = k;
Comparable tmp = arr[k];
while (index - h... |
d735364d-2e80-4b2f-a2e2-e533e5c1410c | 2 | public Boolean userNameExists(String username){
try {
cs = con.prepareCall("{call GET_USERNAME(?)}");
cs.setString(1, username);
if(!cs.executeQuery().next()){
return false;
}
} catch (SQLException e) {
e.printStackTrace();
}
return true;
} |
6c33c676-be7d-41ad-b1ef-41c150603cc9 | 9 | public void tick(JFrame frame) {
if (game_over) {
board.resetBoard();
this.timer.stop();
activeTetromino = null;
frame.repaint();
return;
}
if (this.running) {
if (firstFrame) {
lastTime = System.nanoTime();
frameAverageCounter = 1;
firstFrame = f... |
de1519ae-78d6-40d0-886b-930e34cb438e | 7 | private void writeBody(OutputStreamWriter out, List<PackageCoverageStatistics> stats, PackageCoverageStatistics totalStats) throws IOException {
out.append("<table class=\"report\" id=\"packageResults\">\n");
out.append("<thead><tr> <td class=\"heading\">Package</td> <td class=\"heading\"># Procedures</td> <td c... |
e5a88ff6-20f8-4d17-b479-2ad9de0fbc8f | 0 | @Test(expected=IllegalNumberOfOperandsException.class)
public void testIllegalNumberOfOperandsPlus() {
calculator.pushOperand(7.0);
calculator.pushPlusOperator();
calculator.evaluateStack();
//assertTrue("An IllegalNumberOfOperandsException should heve been thrown here.", false);
} |
9df9df69-8fa1-4608-a38f-364ba4fbe013 | 1 | private <X,Y> void addToMapSet(Map<X, Set<Y>> target, X layoutFile, Y callback) {
if (target.containsKey(layoutFile))
target.get(layoutFile).add(callback);
else {
Set<Y> callbackSet = new HashSet<Y>();
callbackSet.add(callback);
target.put(layoutFile, callbackSet);
}
} |
bf682a6f-bcbc-4b0a-bb85-1ff1eb803ebc | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Patient other = (Patient) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return ... |
75461366-6a55-47af-9949-369d5b4848d0 | 0 | public int calculate(int a, int b)
{
return a + b;
} |
5acba627-fd0b-4bdd-b3f0-d8509f2f64eb | 2 | private String convert2Java(final String program, final boolean hasStatus) {
StringBuilder b = new StringBuilder();
Map<String, Integer> methodMap = Utils.getMethods(program);
b.append(convertMethod2Java(program, methodMap, false, hasStatus));
b.append("}");
for (Map.Entry<String... |
054c0f25-57d9-4078-ac53-28195bc4ac51 | 1 | private static int decodeConnectionId(byte connectionId) {
return (int) (connectionId < 0 ? connectionId - 2*Byte.MIN_VALUE : connectionId);
} |
ec453c4d-ecbf-423a-a95c-dabd410c1661 | 7 | public static int versionLaterThan(String v1, String v2) {
if (v1 == null) {
return 1;
}
if (v2 == null) {
return -1;
}
String[] v1Decomp = formatVersion(v1).split("\\.");
String[] v2Decomp = formatVersion(v2).split("\\.");
int shortestLeng... |
75a192fe-3a4f-45ad-8805-b4a3983369d4 | 4 | public String get() throws IOException, JSONException, NullPointerException
{
try{
long StartTime = System.currentTimeMillis();
String keyvalue = null;
if(Table == null)
{
System.err.println("Table name not set");
}
else if(ColumnFamily == null)
{
System.err.println("Column family not set");
... |
81e34f20-4ae3-4055-bb95-7332b48ad6a6 | 0 | @Override
public String adiciona(HttpServletRequest request,
HttpServletResponse response) {
String nome = request.getParameter("nome");
Empresa e1 = new Empresa(nome);
new EmpresaDAO().adiciona(e1);
request.setAttribute("nome", nome);
return "/WEB-INF/paginas/novaEmpresa.jsp";
} |
bf03a3e5-eb76-405b-a4ba-f4dbcd810322 | 3 | private void openMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openMenuItemActionPerformed
// TODO add your handling code here:
int returnVal = openFileChooser.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = openFileChoos... |
277e668e-2ffd-4728-bfee-41300fd4f050 | 7 | @Override
public List<Status<?>> getStatuses() {
/*
* COMMENTS: I moved this code here from onStatusUpdateRequested.
*/
int speed = fanGpioUtility.getFanSpeed();
List<Status<?>> statusList = new ArrayList<Status<?>>();
if (speed == 0) {
statusList.add(Status.newStatus("Power On", Type.BOOLEAN, false... |
d17df1fb-3204-4cb9-a600-5ecd65e763fe | 2 | @Override
public String toString() {
String main1=main.replaceAll("\n","\\\\n");
char delimiter='|';
String other="";
if (subType!=null) {
other=delimiter+subType;
}
if (enamexType.equals("SP")) {
return("("+main1+delimiter+startOffset+delimiter+enamexType+")");
}... |
d06a1acf-b5a6-458a-9569-cb615583fa05 | 9 | void addText(String text) {
if (currentStringArray.size() == 0) {
charCount = 0;
}
if (isParSave && !_endnoteMode) {
int par = parSkip;
while (par > 0) {
_pagePrinter.write((String) null);
par--;
}
isParS... |
b05570b7-edb3-4489-838a-d4f9e4011731 | 3 | boolean WESTdiagnoalHasCraftedBlock(Location startLocation)
{
boolean res = false;
// Check WEST 45 degrees =========================================================
// Check if there is a valid crafted ceiling block in 45 degrees upwards to the player within given distance
Location checked... |
32dc2f1d-3e42-468a-8fda-90fdf2131aab | 5 | private boolean isObserverMatch(String key,String url) {
String[] keya= key.split("/");
String[] urla= url.split("/");
for (int i=1;i<keya.length;i++) { // we need to match each part all must be valid
String skey = keya[i];
if (urla.length-1<i) return false;
String surl = urla[i];
// if we don't h... |
c0161853-3843-432a-9cbe-b52c32958eee | 5 | public void itemStateChanged(ItemEvent evt){//***Event
if(evt.getStateChange() == ItemEvent.SELECTED) {
if (evt.getSource() == cBoxUnlead) {
que.setUserChoice(Q1_GasType.UNLEAD);
}else if (evt.getSource() == cBoxPlus) {
que.setUserChoice(Q1_GasType.PLUS_UN... |
6b5f71cb-54e7-481b-9217-64c0227853ce | 1 | public static void setGamePanel(Game panel) {
instance.contentPanel.removeAll();
if (panel != null) {
instance.contentPanel.add(panel, BorderLayout.CENTER);
instance.repaint();
instance.revalidate();
}
} |
f0e0326c-6f2d-4c19-b2c5-44a008e1dc83 | 4 | public Sphere(Location center, int radius) {
this.center = center;
this.radius = radius;
for(int X = -radius; X < radius; X++) {
for(int Y = -radius; Y < radius; Y++) {
for(int Z = -radius; Z < radius; Z++) {
if(Math.sqrt((X * X) + (Y * Y) + (Z * Z)) <= radius) {
... |
e05b1cdc-68c2-4e1f-808c-4943ee0d49ee | 1 | @Override
public Key next()
{
if (!hasNext())
throw new NoSuchElementException();
Key key = current.key;
current = current.next;
return key;
} |
dba30bb8-14e1-4166-9ca9-63958b50c4f4 | 4 | public static int[][] rotate_right(int [][] matrix)
{
System.out.println("Rotating to right 90 degrees: ");
int new_matrix [][] = new int [matrix.length][matrix.length];
int z = 0;
for(int i=2; i >= 0; i--)
{
for(int j=0; j<=2; j++)
{
new_matrix[j][z] = matrix[i][j];
}
z++;
}
for(int i... |
64d39eab-ef53-4e7c-9e5c-f8a633954628 | 9 | @Override
public void onBrowserEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEDOWN:
if (!mouseDown) {
mouseDown = true;
CSSUtils.setStyleName(staticClass, this);
}
break;
case Event.ONMOUSEUP:
if (mouseDown) {
mouseDown = false;
CSSUtils.setStyleName(staticC... |
2ccf9e57-7cf7-4f37-a0ab-98a9e9155d2f | 1 | public static String getAttribute(Element element, String key, String defaultRet) {
return element.hasAttribute(key)? element.getAttribute(key):defaultRet;
} |
68273b3e-5826-4e3d-bdfe-626f0128d789 | 7 | private String loadHeightmap() {
if (details) System.out.println("Loading the heightmap.");
File imageFile = new File("output/"+name+"/overviews/heightmap_overview.png");
if (imageFile.exists()) {
try {
BufferedImage heightmapImage = ImageIO.read(imageFile);
if (heightmapImage.getWidth() == chunksX ... |
ce829505-d173-4998-a17e-e703da7878d1 | 6 | public void start() {
keepGoing = true;
/* create socket server and wait for connection requests */
try {
keyPair = KeyPairFactory.generateKeyPair();
// System.out.println(publicKey);
// the socket used by the server
ServerSocket serverSocket = new ServerSocket(port);
// infinite loop to wait for... |
2779e68d-ef90-4f64-9104-d2a8ad8ffefe | 8 | private void AjouterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AjouterActionPerformed
Pattern patternpseudo = Pattern.compile("^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*");
Matcher matcherpseudo = patternpseudo.matcher(login.getText());
... |
2a3ad5d3-7316-423a-a058-ad323ba3e0ea | 8 | private void findZip() {
//郵便番号検索
//画面の郵便番号を取得
String searchZip = textZipCode.getText().replaceAll("-", "");
int serchL = searchZip.length();
if ((serchL == 3) || (serchL == 5)) {
//3桁・5桁指定
//一覧呼び出し
JyusyoJDialog digJyusyo = new Jyusyo... |
a0aee203-8ef6-4832-aebc-fa77ca6b12a0 | 4 | public static double runTest(int numThreads, int N) {
ExecutorService execService = Executors.newFixedThreadPool(numThreads);
List<Future<Double>> results = null;
try {
results = execService.invokeAll(init(numThreads, N));
} catch (InterruptedException ex) {
... |
341934ea-8c69-41af-a5b6-bd164a7be471 | 2 | public static ArrayList<Integer> generate(int n) {
ArrayList<Integer> factors = new ArrayList<Integer>();
for(int i = 2; n > 1; i++) {
for(; n % i == 0; n /= i) {
factors.add(i);
}
}
return factors;
} |
57e9eadd-be24-49fa-9a4b-283a336a4db4 | 1 | public void testMinus_int() {
Minutes test2 = Minutes.minutes(2);
Minutes result = test2.minus(3);
assertEquals(2, test2.getMinutes());
assertEquals(-1, result.getMinutes());
assertEquals(1, Minutes.ONE.minus(0).getMinutes());
try {
Minutes.M... |
0c8d244d-48e9-48a9-b52f-c39699d0e992 | 6 | public void rotate() {
ImageData src = sourceImage.getImageData();
if (src == null)
return;
PaletteData srcPal = src.palette;
PaletteData destPal;
ImageData dest;
// construct a new ImageData
if (srcPal.isDirect) {
destPal = new PaletteData(srcPal.redMask, srcPal.greenMask, srcPal.blueMask);
} ... |
d37da4e6-762a-427d-b10b-0c44e7d79cca | 8 | private boolean parseTWO(int[] buf) {
switch (buf[0]) {
case IAC:
// doubled IAC to escape 255 is handled within the
// read method.
break;
case AYT:
IamHere();
break;
... |
a3cabf5f-f963-448d-9613-3d9e6798f102 | 1 | public CreateUserResponse createUser(CreateUserRequest request)
throws GongmingApplicationException, GongmingConnectionException {
URL path = _getPath(CREATE_USER);
CreateUserResponse response = _POST(path, request, CreateUserResponse.class);
if (response.code != GMResponseCode.COMMON_SUCCESS) {
... |
5ab27e8e-a4b4-4615-8a6c-19a9f3701099 | 1 | public Integer decrement(K key){
if (map.containsKey(key)){
map.put(key, map.get(key)-1);
}
else {
map.put(key, 1);
}
return map.get(key);
} |
6239ecd6-3b57-4e2a-b4ec-10bba2188d79 | 4 | public void testPrinterSettings( WorkBookHandle book )
{
WorkSheetHandle sheet = null;
PrinterSettingsHandle printersetup = null;
try
{
sheet = book.getWorkSheet( 0 );
for( int x = 0; x < 10; x++ )
{
for( int t = 0; t < 10; t++ )
{
sheet.add( "Hello World " + t, t, x );
}
}
prin... |
fb1d5a94-70da-4ced-9fd0-2da77427fec9 | 5 | @Override
public void validate() {
if (platform == null) {
addActionError("Please Select Platorm");
}
if (location == null) {
addActionError("Please Select Location");
}
if (iphone.equals("Please select")) {
addActionError("Please Sele... |
bc0d5fc8-09f5-440f-95cf-0d0746aab08e | 5 | public ArrayList<Player> mostBooks() {
ArrayList<Player> mosts = new ArrayList<Player>();
Player most = this.playerList[0];
int mostPos = 0;
// Searches for the player with the most books.
// Keeps track of the position at which that player is found,
// so that when searching through the list of players ag... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.