method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
65a25fda-8290-48f3-90d0-6fc14f409e4f | 5 | public LogInConnect(String name,String pw){
user_name=name;
pass_word=pw;
try{
@SuppressWarnings("resource")
Socket socket=new Socket("localhost",2553);
BufferedWriter out=new BufferedWriter(
new OutputStreamWriter(socket.getOutputS... |
c0441873-9383-41ae-9cd0-00aa0b8989e9 | 1 | protected CtMember.Cache hasMemberCache() {
if (memberCache != null)
return (CtMember.Cache)memberCache.get();
else
return null;
} |
0b8f638f-7007-4a07-a832-666a5326b90c | 3 | private static Method checkForCreatorMethod(Method m) {
if(m.getAnnotation(TestObjectCreate.class) == null)
return null;
if(!m.getReturnType().equals(testClass))
throw new RuntimeException("@TestObjectCreate " +
"must return instance of Class to be tested");
if((m.getModifiers() &
... |
974d571d-b57a-4b2c-8313-ef35c87cccea | 2 | @EventHandler
public void onPlayerDeath(PlayerRespawnEvent evt){
if(evt.getPlayer() == warden){
evt.getPlayer().teleport(locwar);
}else if(team.getPlayers().contains(evt.getPlayer())){
evt.getPlayer().teleport(cell1);
}
} |
37f8fee3-3e77-4847-802d-7d66d9c65798 | 3 | public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String host = "";
int port = 21025;
System.out.print("Enter Host: ");
try {
host = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}... |
d86bddb2-b947-46b4-95b7-b71c28a9d032 | 1 | public void visit_iadd(final Instruction inst) {
stackHeight -= 2;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
stackHeight += 1;
} |
2070ad49-7741-49f1-8190-b88b677f5138 | 0 | private void type()
{
expect(Token.Kind.IDENTIFIER);
} |
08b4c742-63a3-453c-90e7-b7946fa14d22 | 7 | @Override
public void write(int b) throws IOException {
count++;
if (count > MAX_BUFFER_SIZE) {
StringBuilder newBuffer = new StringBuilder(MAX_BUFFER_SIZE);
int brAfterPadding = buffer.indexOf("\n", BUFFER_PADDING);
newBuffer.append(buffer.subSequence(brAfterPadding, buffer.length()));
buffer =... |
87b6dee6-6c41-4c32-8eb4-ceb541813d01 | 8 | public void Shoot(Direction d){
setChanged();
if (d==Direction.UP || d==Direction.DOWN){
for(int row=0; row<grid.length; ++row)
if (grid[row][currCol]==RoomState.WUMPUS){
setChanged();
this.notifyObservers(GameStatus.SHOTHIT);
}
this.notifyObservers(GameStatus.SHOTMISSED);
}
else i... |
e53dd73d-6a41-4975-8892-ed468c136eee | 6 | private void drawSimplification() {
if (simplificationStep == -2) {
bufferGraphics.drawImage(strips[simplificationList.size()], 401, stripYPos[simplificationList.size()-1], this);
}
if (simplificationStep == 0) {
bufferGraphics.drawImage(strips[simplificationList.size()-1], 401, stripYPos[simplificationList... |
bef1777a-d1bd-4641-8bc4-7eddb20754a2 | 4 | public QuadTree[] getQuadTrees()
{
if (NW == null && NE == null && SW == null && SE == null)
{
return new QuadTree[0];
} else
{
return new QuadTree[]
{
NW, NE, SW, SE
};
}
} |
0accfa78-d37d-48c8-8b7c-95f1ff4dec78 | 0 | public String[] getElementsUnbalanced() {
return this.ELEMENTS_UNBALANCED;
} |
1b8bfcd2-ff5f-4ebc-9a0a-cc95f50bf798 | 6 | @Override
public void update(int delta) {
if (!hasMob && respawnTime >= respawnMax){
respawnTime = 0;
createMob();
}
else if (!hasMob){
respawnTime += delta;
}
else if (hasMob){
mob.update(delta);
if (mob.isDead()){
tmx.runLootTable(mob);
mob = null;
hasMob = false;
}
else if... |
b3b0730a-76db-4544-a9d2-0b10e02d4823 | 1 | public void setImage(Image image) {
button.setIcon(image == null ? null : new ImageIcon(image));
} |
ee4a0296-b58f-4d70-babd-88a6d938a61e | 4 | public void propScoreAdd(int type){
if( type == PropType.star){
Game.propScore += 150 ;
}else if( type == PropType.life){
Game.propScore += 500 ;
}else if( type == PropType.hat){
Game.propScore += 200 ;
}else if( type == PropType.mime){
Game.propScore += 100 ;
}
} |
686679fd-43aa-4d01-b9b7-c35ac862297f | 8 | @SuppressWarnings("unchecked")
private Behavior loadBehaviorClass(File compiledFile) {
FileClassLoader fcl = new FileClassLoader(BehaviorLoader.class.getClassLoader());
Class<Behavior> behClass = null;
// get the class
try {
behClass = fcl.loadClassFromFile(compiledFile);
... |
b0658b44-d0b1-4270-837a-3568e2a57191 | 2 | private static void readInGrafo(Core output, Document xml, String updateId) {
long source = Long.parseLong(xml.getElementsByTagName(SOURCE).item(HEAD).getTextContent());
long target = Long.parseLong(xml.getElementsByTagName(TARGET).item(HEAD).getTextContent());
NodeList dispositivos = xml.getEle... |
7e0bed6c-647b-4fe5-a272-bfc27bd79955 | 9 | private boolean convertYUV422toRGB(int[] y, int[] u, int[] v, int[] rgb)
{
if (this.upSampler != null)
{
// Requires u & v of same size as y
this.upSampler.superSampleHorizontal(u, u);
this.upSampler.superSampleHorizontal(v, v);
return this.convertYUV444to... |
72f75a67-bcc2-4b04-a8f4-befe03ed3426 | 4 | private void height() {
if (this.isEmpty())
this.height = 0;
else if (this.isLeaf())
this.height = 1;
else if (this.getLeft() == null)
this.height = 1 + this.getRight().height;
else if (this.getRight() == null)
this.height = 1 + this.getLeft().height;
else
this.height =... |
683226e9-dad6-4512-882c-6cd65a80c9cc | 8 | @Override
public void unInvoke()
{
if(canBeUninvoked() && (!super.unInvoked))
{
if((affected!=null)&&(affected instanceof MOB)&&(!helping))
{
final MOB mob=(MOB)affected;
if(!aborted)
{
if((messedUp)&&(room!=null))
{
notifyMessUp(mob, recipe);
}
else
{
this.b... |
decdaa64-9dcf-447a-8428-20e2a8c42fbc | 4 | private void handleMouseOverEvents(Input input) {
int buttonIndex = 0;
for (Button button : buttons) {
if (!(button instanceof Button.BlankButton)) { // Don't want tooltip
// for blank button
if (button.isMouseOver(input)) {
for (ButtonRowListener listener : listeners) {
listener.bu... |
1f32a41e-8a67-456a-beb6-604be275eeac | 1 | public String toString() {
if (name == null) {
return "Local$" + index;
}
return name + "$" + index;
} |
26d2d38d-0035-465d-af9c-7fb552ab8690 | 3 | public String[][] getConnectedPlayers() {
String playerNamesList = "";
int ACTIVE_CONNECTIONS = 0;
ACTIVE_CONNECTIONS = getActiveConnections();
// Now ask about their details:
outToServer.println("FETCHPLAYERS");
String totalPlayerArray[][] = new String[(ACTIVE_CONNECTIONS +1)][5];
try {
playerNam... |
2e584742-5f3e-4090-b5c1-f1f1e4226586 | 6 | public article parseH5Introduction(selectObj selectObj, urlObj urlObj) throws IOException {
Document doc = Jsoup.connect(urlObj.getUrl()).get();
Elements elements = doc.select(selectObj.getDocumentSelect());
System.out.println("Fetching : " + urlObj.getUrl());
article article = new art... |
29489089-47be-48b8-a421-cc67e57fd0fd | 5 | public About (JFrame parent) {
super(parent,"\u00DCber das Programm");
setModalityType(ModalityType.APPLICATION_MODAL);
setLayout(new BorderLayout());
JPanel p = new JPanel (new FlowLayout ());
p = new JPanel (new FlowLayout ());
p.add (new JLabel ("Camp Planer " + MainWindow.versionString));
add (p... |
59aeab6c-30fd-4759-842e-7ca3d0a66bbc | 3 | public void save()
{
String savePath = new Control_GetPath().getStreamRipStarPath();
XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
int[] intOptions = new int[5];
try {
XMLEventWriter writer = outputFactory.createXMLEventWriter( new FileOutputStream(savePath+"/ScheduleManager.xml" ), ... |
3df188cf-101b-4b69-9d1e-2804ade841ec | 7 | public int maxDonationsWrapper(int[] donations) {
int[] T = new int[donations.length];
int[] P = new int[donations.length];
T[0] = donations[0];
P[0] = -1;
for (int i = 1; i < T.length; i++) {
int max = Integer.MIN_VALUE;
for (int j = 0; j < i - 1; j++) {
if (max < T[j] + donations[i]) {
if (... |
6a6de79f-50ed-4016-84a6-288f8c7d61c2 | 7 | public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
ConsolePlayerMessage send = new ConsolePlayerMessage(sender);
if(cmd.getName().equalsIgnoreCase("clickless")){
ArrayList<ClicklessSign> signs = getClickless().getSigns... |
de471ca3-ad0f-4c57-8dbd-b5938bddfa66 | 6 | @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ImgPerson)) {
return false;
}
ImgPerson other = (ImgPerson) obj;
if (username == null) {
if (other.username != null) {
return false;
}
} else if (... |
633c07d7-bcc9-4c92-96f2-3f298045cf13 | 0 | public EntityManager getEntityManager() {
return em;
} |
33283853-d146-49eb-8197-96c64897dc22 | 2 | public static String likePurviewCode(String alias,String puriveCode,String columnName){
if(puriveCode == null){
return "";
}
if(isBlank(alias)){
alias = "";
}else{
alias += ".";
}
StringBuilder sb = new StringBuilder();
sb.append(" ( ");
sb.append(alias).append(columnName).append(" like ... |
5b2728d3-71b4-4489-8aa2-90b5ff7aa60c | 0 | public JFrame getFrame(){
return frame;
} |
8330198b-e6dc-42f7-a581-fe4dd4738f31 | 3 | public static double studentTCDF(double tValue, int df) {
if (tValue != tValue) throw new IllegalArgumentException("argument tValue is not a number (NaN)");
if (tValue == Double.POSITIVE_INFINITY) {
return 1.0;
} else {
if (tValue == Double.NEGATIVE_INFINITY) {
return 0.0;
} else {
double ddf = ... |
217da409-b407-4ed2-89ae-a711bbc1e7f8 | 0 | public SearchForGameThread(PongWindow window) throws SocketException {
super("SearchForGameThread");
this.window = window;
socket = new DatagramSocket(4445);
} |
62a46084-cc50-4547-975c-36f4b02671f8 | 3 | @Override
public int neighbourhoodBest(int particle) {
int cubeRoot = getCubeRoot();
if(cubeRoot == 1){
return particle;
}else if(particle < cubeRoot * cubeRoot){
Vector<Integer> temp = particlesOnPlane(particle, cubeRoot);
temp.add(particle);
temp.add(particle + cubeRoot * cubeRoot);
return getfi... |
0e1a713e-72ac-4302-bcfa-2f02d28cb1b4 | 6 | @Override
public void caseADeclEscrevaDefinicaoComando(ADeclEscrevaDefinicaoComando node)
{
inADeclEscrevaDefinicaoComando(node);
if(node.getEscreva() != null)
{
node.getEscreva().apply(this);
}
if(node.getLPar() != null)
{
node.getLPar().a... |
1c474833-6d46-4268-9cf5-9f1537382daf | 7 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Autore other = (Autore) obj;
if (annoNascita != other.annoNascita)
return false;
if (nome == null) {
if (other.nome != null)
return f... |
acecdce8-b320-41be-abec-25dbc100c5f5 | 8 | private STS transformCondition(Condition condition, int prevIndex) {
init();
State initialState = createState();
logger.trace("Transforming condition " + condition);
StateFormula condNoNegations =
condition.getFormula().getEquivalentFormulaWithoutNegations();
Map<ObjectTransition, DomainObject> ... |
a9d7bcaf-485a-4331-a985-1c724e1f0300 | 5 | private static boolean equal(Color[][] colors1, Color[][] colors2) {
if (colors1.length != colors2.length
|| colors1[0].length != colors2[0].length) {
return false;
}
for (int row = 0; row < colors1.length; row++) {
for (int col = 0; col < colors1[row].length... |
7f05e8d5-d3b9-4729-b139-e491aafafa62 | 4 | public Rectangle2D.Float getMediaBox() {
// add all of the pages media box dimensions to a vector and process
Vector boxDimensions = (Vector) (library.getObject(entries, "MediaBox"));
if (boxDimensions != null) {
mediaBox = new PRectangle(boxDimensions);
// System.out.prin... |
30336695-7d49-4268-983d-ea9f0381d208 | 6 | public static int dehexchar(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
if (c >= 'A' && c <= 'F') {
return c - ('A' - 10);
}
if (c >= 'a' && c <= 'f') {
return c - ('a' - 10);
}
return -1;
} |
30d50da7-459e-41e5-822d-7f57b163d429 | 1 | private void updateTextureOffsets(Transform transform) {
Vector4f textureOffsets = transform.textureOffsets;
if(textureOffsets == null) {
texXOffset = 0;
texYOffset = 0;
texWidth = texture.getWidth();
texHeight = texture.getHeight();
} else {
texXOffset = textureOffsets.x;
texYOffset = textureOf... |
ddcee3ce-b90e-4479-95f1-a306448e2e05 | 8 | public BigDecimal calculaTaxa(Transferencia transferencia){
BigDecimal taxa = BigDecimal.ZERO;
Date dt = transferencia.getDataTransferencia();
int dias = calculaPrazo(dt);
try{
//maior que 30 dias da data de cadastro - 1.2%
if(dias > 30){
... |
1b4373a4-8a44-4469-af83-3ecc8e6d7d42 | 7 | public void doTransformations() {
if (GlobalOptions.verboseLevel > 0)
GlobalOptions.err.println("Transforming " + this);
info.setName(getFullAlias());
transformSuperIfaces();
transformInnerClasses();
Collection newFields = new ArrayList(fieldIdents.size());
Collection newMethods = new ArrayList(methodId... |
417fe02b-a699-4a6c-a758-7de5683d185e | 9 | public static void addPatientObservation( Patient patient, Observation obs, ObservationType ot, String observations ) {
Connection conn = null;
Connection conn2 = null;
PreparedStatement ps = null;
PreparedStatement ps2 = null;
ResultSet rs = null;
try {
// Get a connection ... |
44f94937-84d1-4021-8b40-927668804935 | 4 | @Override
public boolean equals(Object o) {
if(o instanceof Piece) {
Piece p = (Piece)o;
if(p.getX() == getX() && p.getY() == getY() && p.getColor() == getColor()) {
return true;
}
}
return false;
} |
0e00604c-4f99-4de2-bdf1-b76240afdc3d | 7 | public V put(K key, V value) {
if (key == null) {
key = (K) KeyFactory.NULL;
}
cleanup();
// Make sure the key is not already in the WeakIdentityMap.
Entry[] tab = this.table;
int hash = System.identityHashCode(key);
int index = (hash & 0x7fffffff) %... |
c1e9dd1a-cf09-40f3-9b38-92edb0399f7e | 5 | public int hashIntArray(int[] array) {
int a = 0xdeadbeef + ((array.length)<<2);
int[] tab = new int[3];
tab[0] = tab[1] = tab[2] = a;
int pt = 0;
int length = array.length;
while(length>3){
tab[0] += array[pt];
tab[1] += array[pt+1];
tab[2] += array[pt+2];
mix(tab);
length -= 3;
pt += ... |
58d89f36-5bf4-40b1-93d2-79503794462a | 0 | public int getExpYear() {
return expYear;
} |
4e3baf0f-bb20-4da4-95e0-a809a8ff16f9 | 0 | @Override
public void mouseEntered(MouseEvent e) {} |
43843567-167a-400b-8e0c-4551bfde6085 | 4 | public int getID( int whichID ) {
if( whichID < 0 && whichID > 3 )
return -1;
try {
ResultSet result = SQL_SEARCH[ whichID ].executeQuery();
if( result.first() ) {
return result.getInt( 1 );
} else {
return -1;
}
} catch ( Exception e ) {
e.printStackTrace();
return -1;
}
} |
7098b0e6-8868-4374-993f-edbb38b9ca24 | 5 | private void displayHelp(String helpType) {
String helpText = null;
switch (helpType) {
case HelpMenuView.BOARD: helpText =
"\tThe game board for Sudoku. It consist of a grid of "
+ "\n\tlocations. Players type the numbers 1-9 on the different locatio... |
46c6a46d-7191-409c-a8a9-1cf1255b1b33 | 7 | private byte[] zeroCompressDataIntoTable(int imageWidth, int imageHeight, byte[] uncompactedData, byte[] zeroCompressionTableData)
{
byte pessimisticCompactedData[] = new byte[uncompactedData.length];
int lineDataOffset = 0;
int uncompactedByteArrayIndex = 0;
for (int row = 0; row < imageH... |
5f55c135-b9d0-49a5-ab58-f31308844bbc | 9 | private void declaraVariavel(String tipo, String nome, String valor) {
Variavel var = null;
if (! existeVariavel(nome)) {
if (tipo.equals("inteiro")) {
var = new Inteiro(nome, valor.equals("") ? 0 : Integer.parseInt(valor));
} else if (tipo.equals("real")) {
var = new Real(nome, valor.equals("") ? 0.0... |
aa5df587-af5a-4daa-8394-71ef7baa4d82 | 2 | public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int cases = input.nextInt();
for (int q = 0; q < cases; ++q) {
long p = input.nextInt();
int flips = 0;
while (!isPalindrome(p)) {
... |
8349a631-8e7a-4ba6-af5f-aa6cee8ab0b2 | 8 | public void notifyObservers(Event event)
{
if(observers != null) {
synchronized (observers) {
if(!observers.isEmpty()) {
loopCounter++;
for(EventListener obs : observers) {
try {
obs.eventOccured(event);
}
catch(Error err) {
notifyFailure(err, obs);
}
... |
83d289a7-64c4-4e6c-b838-e404308fd950 | 0 | public Ball(int x, int y, int width, int height) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
} |
5cc245b6-fa5d-4f56-801d-d9eefdc46804 | 9 | public KeyListenerEvent(){
Key = KeyType.NULL;
JFrame gui = new JFrame();
gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
gui.setTitle("Bomberman's KeyListenerEvent");
gui.setSize(700,200);
gui.setLocationRelativeTo(null);
DisplayKey = new JTextArea();
ReceiveKey = new JTextArea();
... |
21e4712e-1346-4bd5-8e72-cf7a36605754 | 8 | private static void makeTet5(SquareColor[][] tet) {
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
if ((i == 2 && j == 1) || (i == 3 && (j == 0 || j == 1 || j == 2))) {
tet[i][j] = SquareColor.BLUE;
} else tet[i][j] = null;
... |
2b62af37-059a-4abc-a91a-972891b6c52e | 0 | public TrackedPeer removePeer(String peerId) {
return this.peers.remove(peerId);
} |
01eaf70c-46bd-4bd3-91f6-3a17305b1839 | 5 | public void explosion(int x, int y, int hardness)
{
for (int xa = -(hardness / 2); xa <= (hardness / 2); xa++) {
for (int ya = -(hardness / 2); ya <= (hardness / 2); ya++) {
int distance = (int) Math.abs(Math.sqrt(xa*xa + ya*ya));
if (distance <= (hardness / 2)) {... |
38e454b3-7dfd-43f3-9bd5-bca043c01f9a | 7 | private final boolean cvc(int i) {
if (i < 2 || !cons(i) || cons(i - 1) || !cons(i - 2))
return false;
{
int ch = b[i];
if (ch == 'w' || ch == 'x' || ch == 'y')
return false;
}
return true;
} |
d4f49266-08b7-4942-b034-d0ed640f7d3c | 1 | public ContinuousUniform(double low, double high) throws ParameterException {
if (low >= high) {
throw new ParameterException("ContinuousUniform parameters low < high.");
} else {
this.low = low;
this.high = high;
this.rand = new Random();
}
} |
1d155e9e-47ee-43e7-a5af-35d2b9bf42e8 | 3 | public double interpolate(double xx){
double h=0.0D,b=0.0D,a=0.0D, yy=0.0D;
int k=0;
int klo=0;
int khi=this.nPoints-1;
while (khi-klo > 1){
k=(khi+klo) >> 1;
if(this.x[k] > xx){
khi=k;
}
else{
klo=k;
}
}
h=this.x[khi]-t... |
d1954f0b-be40-427e-81e5-3d825b967a0d | 5 | final public void partition(ParseList list) throws ParseException {
ParseArea area; ParseModifier modifier; ParseModifierGroup mGroup;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case AREA:
area = area();
partition(list);
list.addArea(area);
break;
case MODIFIER:
modifier = modifier... |
42fa4a06-6092-4e8c-870e-195ad8a0f0f1 | 4 | public JSONWriter key(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null key.");
}
if (this.mode == 'k') {
try {
this.stack[this.top - 1].putOnce(string, Boolean.TRUE);
if (this.comma) {
... |
e8cc1d38-1c89-4d95-9b46-9f732e3ad178 | 2 | public void printComponent(Graphics g) {
// boolean oldAdapt = adapt;
// adapt = true;
if (transformNeedsReform)
reformTransform(g.getClipBounds());
g.setColor(java.awt.Color.white);
g.fillRect(0, 0, g.getClipBounds().width, g.getClipBounds().height);
Graphics2D g2 = (Graphics2D) g;
g2.transfor... |
807893a7-c533-43ee-a6f9-628401040f42 | 8 | public double[][] string_to_double_array(String[] lines)
{
double[][] temp=null;
for(int i=0;i<lines.length;i++)
{
String[] part=lines[i].split(" ");
int c=0;
if(i==0)
{
c=0;
for(int j=0;j<part.length;j++)
{
if(part[j].length()>0&&is_numeric(part[j]))
{
c++;
}
}
... |
1c8114d8-7ef6-484d-b2b8-6a9de4acae01 | 7 | public void updateAsScheduled(int numUpdates) {
super.updateAsScheduled(numUpdates) ;
checkMeltdownAdvance() ;
if (! structure.intact()) return ;
//
// Calculate output of power and consumption of fuel-
float fuelConsumed = 0.01f, powerOutput = 5 ;
fuelConsumed *= 2 / (2f + structure.upgrad... |
fe018796-13d5-463a-adab-3744e4e14552 | 4 | public static void setTemplate(int template) throws UnsupportedLookAndFeelException, ClassNotFoundException, IllegalAccessException, InstantiationException, Exception {
UIManager.put("Menu.font", templateFont);
UIManager.put("MenuItem.font", templateFont);
UIManager.put("Button.font", templateFont);
UIManager.p... |
688c91bd-be4c-4fc3-9139-4e48f30fc703 | 0 | public Queue<RouterPacket>[] GetInputBuffer()
{
return inputBuffer;
} |
1d765466-e5f4-4d5c-9372-7962d98a0c93 | 8 | public static void createStDevStats1(int n, int k, String... files)
{
try
{
int line_number=0;
if(n==2)
line_number = Ngrams2_lineNumber;
else if(n==3)
line_number = Ngrams3_lineNumber;
else if(n==4)
line_number = Ngrams4_lineNumber;
else if(n==5)
line_number = Ngrams5_lineNumber... |
4d1890ea-068a-426a-83f2-c7a9b3c82796 | 9 | public void processQueries(String strInputFilePath, String strOutputFilePath)
throws IOException {
oBufferedReader = new BufferedReader(new FileReader(strInputFilePath));
oBufferedWriter = new BufferedWriter(new FileWriter(strOutputFilePath));
calcuateTFIDF(oBufferedReader);
oBufferedReader.close();
oBuff... |
1a6154f4-e1f8-4d43-a44a-ec6f9950a587 | 6 | public static Boolean isNullOrEmpty(Object object) {
if (object == null) {
return true;
} else {
if (object instanceof Collection) {
if (((Collection) object).isEmpty()) {
return true;
}
} else if (object instanceof ... |
f8fa1469-1b5c-4b79-b584-5ade5f47bb82 | 9 | private static Class<?> getVirtualMachineClass() throws ClassNotFoundException {
try {
return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
public Class<?> run() throws Exception {
try {
return ClassLoader.getSys... |
d6363908-1bd0-4b23-ae61-4db9342ee881 | 3 | private void alarm() {
if (input.getAlarmFlag() && time == alarmTime) {
alarmCounter = 20;
}
if (alarmCounter > 0) {
alarmCounter -= 1;
output.doAlarm();
}
} |
25d77da6-9cba-4e15-9cf6-f5605244f9d6 | 0 | @Basic
@Column(name = "CTR_ESTADO")
public String getCtrEstado() {
return ctrEstado;
} |
a2598219-c1fe-4583-866d-5478670fb518 | 8 | static final void method165(int i, int i_6_, int i_7_, int i_8_, int i_9_,
int i_10_, int i_11_, byte i_12_, int i_13_,
int i_14_) {
anInt5194++;
if (i_9_ < 512 || i_11_ < 512
|| (i_9_ ^ 0xffffffff) < ((-2 + Class367_Sub4.mapSizeX) * 512
^ 0xffffffff)
|| (-2 + Class348_Sub40_Sub3.mapSizeY)... |
a58155e0-e6e7-4124-8552-b2415fbd0788 | 8 | @EventHandler
public void onPull(PlayerInteractEvent e) {
Block b = e.getClickedBlock();
if(e.getAction() == Action.RIGHT_CLICK_BLOCK && b.getType() == Material.LEVER && SlotMachine.isSlotMachinePart(e.getClickedBlock())){
if(!e.getPlayer().hasPermission("slotmachines.use")) {
e.getPlayer().sendMessage(Chat... |
5da21509-afff-4bc4-97f1-f917201520cc | 4 | public void generateDOT(){
try{
File file = new File("calls.dot");
if (!file.exists()) {
file.createNewFile();
}
FileWriter fw = new FileWriter(file);
BufferedWriter bw = new BufferedWriter(fw);
bw.write("digraph calls {\n");
System.out.println(calls.toString());
for (String s1 : cal... |
38996486-9c88-4733-9ca1-e210dce60ccf | 6 | public void run() {
Actions.count = false;
System.out.println("СПИЧКИ:\n");
spichki = 15;
engine();
while (spichki > 0) {
if (!once) {
System.out.println("Для начала игры:\n" + "1) нажмите ENTER\n"
+ "2) введите от любое число и нажмите ENTER");
sc.next();
}
once = true;
playerMove();
... |
64fbc294-5c6c-4ac0-81d0-d6bd4f0765a3 | 4 | public V remove(K key) {
searchElement(key);
if (_searchHolder == null) {
return null; // Nothing was found
}
// Found a value
V value = _searchHolder.value;
// Deleting the entry
if (buckets.getElement(_searchBucketIndex).getSize() ==... |
25780ab9-9d3f-4067-b568-bb6c3fad2f84 | 3 | public String checkYourself(String stringGuess) {
int guess = Integer.parseInt(stringGuess);
String result = "miss";
for (int cell: locationCells)
{
if (guess == cell) {
result = "hit";
numOfHits++;
break;
}
... |
c62e7bbf-6e36-45aa-a0be-77e80857e364 | 1 | public void runGroups(boolean includeManual)
{
for(GroupSettings settings : getGroups(includeManual))
runGroup(settings, mNoisy, includeManual);
} |
90553ec8-1702-4af0-95e4-0fd4b1784d32 | 1 | public DecoderPanel(int usableSize, int random) {
super();
this.random = random;
int cipherPanelSize = 400;
int wrapamount = (usableSize / cipherPanelSize);
//set LayoutMng
this.setLayout(new MigLayout("wrap" + wrapamount, "[grow, center]", ""));
this.setBackgro... |
a9947016-0126-4f5a-9420-015f66a1e829 | 3 | private static void calcNoOfNodes(Node node) {
if (node instanceof Parent) {
if (((Parent) node).getChildrenUnmodifiable().size() != 0) {
ObservableList<Node> tempChildren = ((Parent) node).getChildrenUnmodifiable();
noOfNodes += tempChildren.size();
f... |
ec9c7904-ca5d-4384-93c2-fb9b19debf9f | 9 | public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
{
Player player = (Player)sender;
ChatColor blue = ChatColor.AQUA;
ChatColor gold = ChatColor.GOLD;
ChatColor green = ChatColor.GREEN;
if(command.getName().equalsIgnoreCase("sm") && (player.isOp() |... |
a5ac8d1c-7ad9-458a-b0de-fa0a2fae5e0d | 4 | public void update(Vector3f plr) // Aux Thread
{
chunksLoaded = 0;
Chunk.updatePlrPos(plr);
playerPos = plr;
for(int i = (int)plr.x / Chunk.size - viewRange; i < (int)plr.x / Chunk.size + viewRange; i++)
for(int j = (int)plr.z/ Chunk.size - viewRange; j < (int)plr.z/ Chunk.size + viewRange; j++)
if(w... |
1ca5cbcf-750e-46ad-a9d9-e9ffbd0ec118 | 2 | private static Map<String, String> getCurlParams(Node db) {
try {
ConfigParser cp = ConfigParser.getParser(db);
HashMap<String, String> ret = new HashMap<String, String>();
try {
ret.put("curl-url", cp.getElementAt("curl-url", 0)
.getAttribute("url"));
} catch (Exception e) {
cp.setNode((Ele... |
fcd5dedf-4d3b-41f1-871e-b264733b4065 | 1 | public int lookAhead() throws IOException {
if (lookaheadChar == UNDEFINED) {
lookaheadChar = super.read();
}
return lookaheadChar;
} |
bc2ddd35-be52-475c-83ee-bb7d9d632d8a | 3 | public static Host deserializeHost(PeerReference peer) {
if (peer == null) {
throw new NullPointerException("Cannot transform a null value to a Host object");
}
Host host = null;
try {
host = new PGridHost(peer.address, peer.port);
host.setHostPath(pe... |
c8784a8c-ffed-4569-aa01-d567b48050ca | 0 | public void setDefault_(String default_) {
this.default_ = default_;
} |
f5be8f74-5f6e-4928-8ed4-d91e26d23ba7 | 2 | private void drawSecondSelectedCase(Graphics g) {
if (swappedI != -1 && swappedJ != -1) {
g.setColor(Color.YELLOW);
g.fillRect(swappedI * caseWidth + 1, swappedJ * caseHeight + 1,
caseWidth - 1, caseHeight - 1);
}
} |
d3dbe74e-b5d7-4a13-a83f-34a734272079 | 8 | public T deleteMin() {
int currentSize = heap.size() - 1;
if (currentSize == 0) {
return null;
}
// СԪ
T x = heap.get(1);
// һԪ
T y = heap.remove(currentSize);
// عӸʼΪyѰҺʵλ
// ѵĵǰڵ
int i = 1;
// iĺ
int ci = 2;
currentSize = heap.size() - 1;
try {
Class<?> c = y.getClass();
Meth... |
f506d9f4-2330-4e66-b180-510b67459b15 | 5 | @Override
public String toString() {
// 現在の盤情報を文字列で取得する
StringBuilder sb = new StringBuilder();
sb.append(" 01234567\r\n");
Pos workPos = new Pos();
for (int y = Common.Y_MIN_LEN; y < Common.Y_MAX_LEN; y++) {
workPos.setY(y);
sb.append(y+" ");
for (int x = Common.X_MIN_LEN; x < Common.X_MAX_LEN; x+... |
18adf882-bd51-428b-8254-fab6a3d2aec9 | 2 | public void copyRegionVFlip(CPRect r, CPLayer source) {
CPRect rect = new CPRect(0, 0, width, height);
rect.clip(r);
for (int j = rect.top, s = rect.bottom - 1; j < rect.bottom; j++, s--) {
for (int i = rect.left; i < rect.right; i++) {
data[i + j * width] = source.data[i + s * width];
}
}
} |
c05b7e31-7921-4370-9f64-d6f2de7ad6d7 | 3 | @Override
public boolean gainPassage(Oergi oergi) {
Element element = oergi.getElement();
ElementMovability elementMovability = new ElementMovability();
Movability movability = elementMovability.getMovability(this.getBiotype(), element);
if (movability == Movability.NO) {
return false;
}
else if (mov... |
bd7253f0-8923-4cb0-aa1b-7ea99c4b25e4 | 9 | public List<String> createReversePolishExpression(String subStr) {
// 正实数的正则表达式;
String regex = "\\d+\\.{0,1}\\d*";
// 将匹配的正实数保存在字符串数组numbers中;
String[] numbers = matcher(regex, subStr);
String changeStr = subStr.replaceAll(regex, "0")
.replaceAll("E\\-0", "E1").replaceAll("\\^\\-0", "^1")
.replaceAll... |
d84c4d59-0ebc-4520-b8ec-716b9e1807e7 | 6 | private void setupBlock() throws IOException {
if (this.data == null) {
return;
}
final int[] cftab = this.data.cftab;
final int[] tt = this.data.initTT(this.last + 1);
final byte[] ll8 = this.data.ll8;
cftab[0] = 0;
System.arraycopy(this.data.unzftab... |
4fd360d3-0d91-434b-a337-0ea78a8eea83 | 5 | @Override
public Object getValueAt(int row, int column) {
Consulta m = linhas.get(row);
if (column == COL_ID) {
return m.getCodigo();
} else if (column == COL_HORA) {
return m.getHorario();
} else if (column == COL_DATA) {
return m.getDataDaConsult... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.