text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public void paintComponent(Graphics g){
Graphics2D g2 = (Graphics2D) g;
drawBackground(g2);
for(Sprite sprite : sprites)
if(sprite.isLayered()) sprite.draw(g2);
for(Sprite sprite : sprites)
if(!sprite.isLayered())sprite.draw(g2);
for(Sprite s... | 7 |
public void visitIfCmpStmt(final IfCmpStmt stmt) {
print("if (");
stmt.left().visit(this);
print(" ");
switch (stmt.comparison()) {
case IfStmt.EQ:
print("==");
break;
case IfStmt.NE:
print("!=");
break;
case IfStmt.GT:
print(">");
break;
case IfStmt.GE:
print(">=");
break;
ca... | 7 |
public static BoardLoader getInstance() {
if (instance == null) {
instance = new BoardLoader();
}
return instance;
} | 1 |
public void isPossible(final int[] code)
{
// Creates a new thread
thread = new Thread(new Runnable()
{
@Override
public void run()
{
// Checks if there are no Inputs.
if (mastermind.getRowSize() == 0)
{
... | 7 |
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
if (! request.getParameterMap().isEmpty()) {
List<String> fouten = new ArrayList<>();
BigDecimal van = null;
try {
van = new BigDecimal(request.getParameter("van"));
} catch (Numbe... | 8 |
public static NamesManager getInstance()
{
return instance;
} | 0 |
private void setCurrentElement(PhysicsElement e) {
if (currentElement != null) {
currentElement.setReleased();
currentElement = null;
}
if (e != null) {
currentElement = e;
currentElement.setSelected();
if (currentElement instanceof Ball) {
... | 5 |
public void play()
{
try
{
if (clip != null)
{
new Thread()
{
public void run()
{
synchronized (clip)
{
clip.stop();
clip.setFramePosition(0);
clip.start();
}
}
}.start();
}
} catch (Exception e)
{
System.out.println(e);
}
} | 2 |
private static String trimSpacesAndNulls(String value) {
int len = value.length();
int st = 0;
while ((st < len) && (value.charAt(st) == ' ' || value.charAt(st) == 0 )) {
st++;
}
while ((st < len) && (value.charAt(len - 1) == ' ' || value.charAt(len - 1) == 0)) {
... | 8 |
@Override
public void updateInputMap() {
System.out.println("Uppdaterar Inputs");
final Action menuUp = new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
if (currentOption > 0)
currentOption--;
}
};
final Action menuDown = new AbstractAction() {
@Override
pub... | 5 |
public final void setOnline(final int cid, final boolean online, final int channel) {
boolean bBroadcast = true;
for (final MapleGuildCharacter mgc : members) {
if (mgc.getId() == cid) {
if (mgc.isOnline() && online) {
bBroadcast = false;
}
mgc.setOnline(online);
mgc.setChannel((byte) channel);
... | 5 |
private int hasInfo() {
if (strings == null) {
return 1;
//return this.size();
}
int infos = 0;
for (String value : strings) {
if (value != null && !value.matches(spaceRegex))
infos++;
}
return infos;
} | 4 |
private void dhcpResponse(){
int responseTime = -1;
// create request packet
LOG.info("create request packet");
byte[] requestMessage = createRequestMessage();
DatagramPacket requestPacket = null;
try {
requestPacket = new DatagramPacket(requestMessage,
... | 8 |
public static void expandEverything(JoeTree tree) {
tree.getRootNode().ExpandAllSubheads();
tree.getDocument().panel.layout.redraw();
return;
} | 0 |
public void setActivePanel(final PanelType type) {
if (this.frame != null) {
this.frame.dispose();
}
switch (type) {
case START:
this.frame = new PlainPanel(this.sfb, SWT.FILL, CompositeBrick.DEFAULT);
break;
case CLUBS:
this.frame = new ClubPanel(this.sfb, SWT.FILL, CompositeBrick.DEFAULT);
... | 8 |
private final void setLeaves()
{
if (daughterNodes.size() > 0)
for (Node n : daughterNodes)
n.setLeaves();
else
{
isLeaf = true;
for (Point p : leafLocations)
if (p.x == (int) x && p.y == (int) y)
isLeaf = false;
if ... | 6 |
public MethodHelper(Class<?> clazz) {
Method[] methods = clazz.getMethods();
for(Method method : methods) {
if(method.getParameterTypes().length != 0) continue;
if(method.getReturnType().equals(Void.TYPE)) continue;
if(method.getDeclaringClass().equals(Object.class)) continue;
String property = keyForMe... | 9 |
private void discoverAndIntimateForClassAnnotations (ClassFile classFile, boolean visible, boolean invisible) {
Set<Annotation> annotations = new HashSet<Annotation>();
if (visible) {
AnnotationsAttribute visibleA = (AnnotationsAttribute) classFile.getAttribute(AnnotationsAttribute.visibleT... | 9 |
private final void copy() {
final int length = length();
if (this.tail < this.head) {
System.arraycopy(this.content[this.cIdx], this.head,
this.content[this.cIdxNext], StringBuilder.PATTERN_SIZE,
length - this.tail);
System.arraycopy(this.content[this.cIdx], 0,
this.content[this.cIdxNext], (len... | 3 |
public boolean isOrInheritsFrom(String parent_id) {
if(id.equals(parent_id))
return true;
else if(parents.size() != 0) {
for(int i = 0; i < parents.size(); ++i) {
if(parents.get(i).isOrInheritsFrom(parent_id))
return true;
}
return false;
}
else
return false;
} | 4 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Answer)) {
return false;
}
Answer other = (Answer) object;
if ((this.idAnswer == null && other.idAnswer != null... | 5 |
public void stop() {
// Pass on to upstream beans
if (m_trainingProvider != null && m_trainingProvider instanceof BeanCommon) {
((BeanCommon)m_trainingProvider).stop();
}
if (m_testProvider != null && m_testProvider instanceof BeanCommon) {
((BeanCommon)m_testProvider).stop();
}
... | 8 |
public Set<Vehicule> getVehiculesDisponibles(){
System.out.println("ModeleLocations::getVehiculesDisponibles()") ;
Set<Vehicule> vehiculesDisponibles = new HashSet<Vehicule>() ;
for(Vehicule vehicule : this.vehicules){
if(vehicule.estDisponible()){
vehiculesDisponibles.add(vehicule) ;
}
}
return veh... | 2 |
public static void main(String[] args) {
int n = scn.nextInt();
int tc = 0;
while (n != 0) {
// Create the nodes and put them in the map
Point[] points = new Point[n + 1];
for (int i = 1; i <= n; i++) {
points[i] = new Point(i);
}
// The starting point
int s = sc... | 8 |
public void testToStandardMinutes() {
Weeks test = Weeks.weeks(2);
Minutes expected = Minutes.minutes(2 * 7 * 24 * 60);
assertEquals(expected, test.toStandardMinutes());
try {
Weeks.MAX_VALUE.toStandardMinutes();
fail();
} catch (ArithmeticExcepti... | 1 |
public static void main(String[] args) {
float float_pi = 3.145926535897896F;
double double_pi = 3.145926535897896D;
System.out.println(float_pi); // 3.1459265
System.out.println(double_pi); // 3.145926535897896
} | 0 |
private void showTrigDialog(Account acc) {
Account selectedAccount = acc;
TriggerDialog diag = new TriggerDialog(shell, shell.getStyle(), acc,
mySelf);
shell.setEnabled(false);
diag.open();
// Check if the account still exists
Boolean deleted = true;
for (Account a : FkManager.getInstance().getList(... | 3 |
@Override
public void update(Observable o, Object arg) {
String sender = o.getClass().getName();
System.out.println("Board received ["+ arg +"] from ["+ sender +"]");
if (sender.equals("Core.List"))
{
String message = (String) arg;
// On transmet la notification pour les plugins
// Seulement si le ... | 5 |
public static void close(Connection conn,Statement statement,ResultSet reSet){
if(reSet!=null){
try {
reSet.close();
} catch (Exception e) {
e.printStackTrace();
}finally{
/* 手动将其引用指向null,java的内存清理机制最终会对其清除 */
reSet = null;
}
}
if(statement!=null){
try {
statement.close();... | 6 |
synchronized public static void write()
{
FileOutputStream fosTmp = null;
Properties props = new Properties();
try
{
for(Field fld: EzimConf.class.getFields())
{
EzimSetting setting = fld.getAnnotation(EzimSetting.class);
if (null == setting) continue;
props.setProperty(setting.name(), fl... | 5 |
private boolean isHexDigit() {
return current >= '0' && current <= '9'
|| current >= 'a' && current <= 'f'
|| current >= 'A' && current <= 'F';
} | 5 |
public Tower getTower(){
int ID = (id-1) / 3;
int level = (id-1) % 3 + 1;
Tower t;
if (ID == 0){ //air
t = new AirTower();
}else if (ID == 1){ //water
t = new WaterTower();
}else if (ID == 2){ //fire
t = new FireTower(... | 4 |
public TileMap createExampleMap() {
int size = Configuration.getInstance().getValueAsInt("mapSize");
TileMap tileMap = new TileMap(size, size);
FloorCellFactory floorCellFactory = GameFactories.getInstance().getFloorCellFactory();
FloorCell earth = floorCellFactory.getFloorCell("earth");
FloorCell grass = fl... | 9 |
private boolean hasLocalArrayListFlavor(DataFlavor[] arrDfIn)
{
if (this.dfLocal == null) return false;
for(int iCnt = 0; iCnt < arrDfIn.length; iCnt ++)
{
if (arrDfIn[iCnt].equals(this.dfLocal)) return true;
}
return false;
} | 3 |
public int newLocal(final Type type) {
Object t;
switch (type.getSort()) {
case Type.BOOLEAN:
case Type.CHAR:
case Type.BYTE:
case Type.SHORT:
case Type.INT:
t = Opcodes.INTEGER;
break;
case Type.FLOAT:
t = Opcodes.FLOAT... | 9 |
public static void main(String[] args) {
server1.start();
server2.start();
HB.start();
try {filerdr();} catch (IOException e) {e.printStackTrace();}
} | 1 |
private boolean rotation(int rotation) {
boolean colision = false;
Vecteur<Integer> temp = new Vecteur();
if (rotation != 0) {
if (rotation == -1) {
courante.rotCW();
} else if (rotation == 1) {
courante.rotACW();
}
... | 8 |
public static void writeMap(Map paramMap, OutputStream paramOutputStream) throws IOException
{
Dimension localDimension = paramMap.getSize();
ObjectOutputStream localObjectOutputStream;
if ((paramOutputStream instanceof ObjectOutput))
localObjectOutputStream = (ObjectOutputStream)paramOutputStream;
... | 7 |
public boolean charsAtEqual(ArrayList<String> file, int index, int num, String[] chars) {
for (int j=0; j<chars.length; ++j){
if(charAtEquals(file, index, num, chars[j])) {
return true;
} // end if
} // end for
return false;
} | 2 |
@Override
public boolean click(int mx, int my, boolean click)
{
if (mouseIn(mx, my))
{
if(click)
{
if(preClick)
{
if (!clicked)
{
clicked = true;
return true;
}
clicked = true;
return false;
}
return false;
}
preClick = true;
mouseOver = true;
... | 4 |
private void distribute(Msg msg_, int flags_) {
// If there are no matching pipes available, simply drop the message.
if (matching == 0) {
return;
}
for (int i = 0; i < matching; ++i)
if(!write (pipes.get(i), msg_))
--i; // Retry last wr... | 3 |
private int writeBankJumpPointer(BufferedWriter bw, int curAddress, int end) throws Throwable {
for(;rom.type[curAddress] == ROM.DATA_BANKJUMPPOINTER && curAddress < end;curAddress+=3) {
addLabel(bw, curAddress);
String bankString = "$"+Integer.toHexString(rom.data[curAddress] & 0xFF);
String da... | 7 |
public static double calculateCosineSimilarity(Double[] ratingsOne, Double[] ratingsTwo) {
double enumerator = 0, denominatorOne = 0, denominatorTwo = 0;
for (int i = 0; i < ratingsOne.length; i++) {
enumerator += ratingsOne[i] * ratingsTwo[i];
denominatorOne += Math.pow(ratingsOne[i], 2);
denominatorTwo ... | 4 |
public void renderSprite(double x, double y, double z, double yOff, int[] pix) {
int spriteSize = h / 2;
double upco = -0.125;
double rightco = 0.125;
double forwardco = 0.125;
double walkco = 0.0625;
double xc = ((x / 2) - (right * rightco)) * 2 + 0.5;
double yc ... | 8 |
public void updateStatus() {
try {
if (_leftFrontMotor != null) {
SmartDashboard.putNumber("Left Front Jaguar", _leftFrontMotor.getOutputVoltage());
SmartDashboard.putNumber("Left Front Current", _leftFrontMotor.getOutputCurrent());
}
... | 4 |
private void encrypt(String pass) {
try {
byte[] utf8 = pass.getBytes("UTF8");
byte[] enc = this.encrypter.doFinal(utf8);
this.setEncryptedPass(Base64.encode(enc));
} catch (javax.crypto.BadPaddingException e) {
} catch (IllegalBlockSizeException e) {
} catch (UnsupportedEncodingException e) {
}
} | 3 |
private boolean checkCreditsInputs() {
//first check if the user has entered text to be overlaid
if (creditText.getText().equals("")) {
JOptionPane.showMessageDialog(null, "Please enter text to overlay on video", "Missing Input",
JOptionPane.WARNING_MESSAGE);
//otherwise if text has been entered, continue... | 9 |
@Override
protected Class<?> loadClass(String name, boolean resolve)
{
try {
if ("fruit.sim.Player".equals(name))
return parent.loadClass(name);
else
return super.loadClass(name, resolve);
} catch (ClassNotFoundException e) {
re... | 3 |
public void crearBD(String nombreBD)
{
try
{
// Abre la base de datos para realizar operaciones en ella
this.bd = SqlJetDb.open(new File(nombreBD), true);
this.bd.getOptions().setAutovacuum(true);
// Esta función hace que las operaciones a realizar se... | 2 |
public CGIExecute(String binPath)
{
cgiApp = new ProcessBuilder(binPath);
} | 0 |
private static boolean[] primeBoolArray(int limit) {
boolean[] nums = new boolean[limit];
for (int i = 2; i < nums.length; i++)
nums[i] = true;
int nextPrime = 2;
while (nextPrime < nums.length / 2) {
int i = nextPrime;
for (; i < nums.length; i += nextPrime)
nums[i] = false;
nums[nextPrime] = t... | 5 |
@Override
public void paintRow(Graphics2D g2d,
int row,
int firstCol,
int lastCol,
int x,
int y,
int cellWidth,
int rowHeight) {
Sequence seq = currentSG.get(row);
setCellSize(cellWidth, rowHeight);
g2d.setFont(font);
List<SequenceAnnotation> orfs = seq.getAnnotationsByType(Simpl... | 7 |
private String getText(BufferedReader reader) {
String finishedText = "";
String s = "";
StringBuilder sb = new StringBuilder();
while (s != null && !s.contains("<div class=\"csc-textpic-text\">")) { //go to the text passage in the html-code
try {
s = reader.... | 8 |
private static void debugInfo() {
String cv = "kFold: " + cf.getInt("num.kfold")
+ (cf.isOn("is.parallel.folds") ? " [Parallel]" : " [Singleton]");
float ratio = (float) cf.getDouble("val.ratio");
int givenN = cf.getInt("num.given.n");
float givenRatio = cf.getFloat("val.given.ratio");
String cvInfo = c... | 9 |
public static Matrice createSubMatrix(Matrice matrix, int excluding_row, int excluding_col)
{
Matrice mat;
if(excluding_row==-1)
mat = new Matrice(matrix.getNbLines(), matrix.getNbColumns()-1);
else if(excluding_col==-1)
mat = new Matrice(matr... | 6 |
public void setPreference(Preference pref) {
this.pref = pref;
} | 0 |
public void printOverzicht(){
int i = 1;
for (Huisdier dier : lijst){
System.out.println("Naam dier" + i + ": " + dier.getNaam());
i ++;
}
} | 1 |
public static void test3(){
try
{
InputStream returnStream = null;
HttpsURLConnection conn = null;
int connectTimeout=15000;
int readTimeout=30000;
String requestMethod="GET";
String charEncode="utf-8";
String url="https... | 9 |
@RequestMapping(value = {"/SucursalesBancarias"}, method = RequestMethod.GET)
public void readAll(HttpServletRequest httpRequest, HttpServletResponse httpServletResponse) {
try {
ObjectMapper jackson = new ObjectMapper();
String json = jackson.writeValueAsString(sucursalBancariaDAO.f... | 2 |
@Test
public void testProfileCrudUsingCard() throws BeanstreamApiException {
String profileId = null;
try {
Address billing = getTestCardValidAddress();
Card card = getTestCard();
// test create profile
ProfileResponse createdProfile = beanstream.profiles()
.createProfile(card, billing);
profil... | 4 |
private boolean check(FlowNetwork G, int s, int t) {
// check that flow is feasible
if (!isFeasible(G, s, t)) {
System.err.println("Flow is infeasible");
return false;
}
// check that s is on the source side of min cut and that t is not on
// source side... | 9 |
public Integer getInf( int field, Boolean net ) {
try {
switch ( field) {
case ALLOCATED:
if ( net ) {
return (int) (mInflation * mNetAllocated);
} else {
return (int) (mInflation * mGrossAllocated);
}
case REVISED:
if ( net ) {
return (int) (mInflation * mNetRevised);
} els... | 7 |
public int GetSequenceNumber()
{
return sequence;
} | 0 |
@Test
public void testBuyDevCard() {
//me
BuyDevCardRequest request=new BuyDevCardRequest(0);
ServerModel aGame=gamesList.get(2);
cookie=new CookieParams("Bobby", "bobby", 0, 2);
int playerNewCards=aGame.getPlayers().get(0).getNewDevCards().getTotalDevCardCount();
int playerOldCards=aGame.getPlayers().get(... | 2 |
private void deletePlaylist() {
try {
int id;
System.out.println("Enter id: ");
showPlaylists();
id = Keyboard.readInt();
BEPlaylist aPlaylist = new BEPlaylist(id);
BLLPlaylist ds = new BLLPlaylist();
ds.deletePlaylist(aPlay... | 1 |
public Problem getProblem() {
return problem;
} | 0 |
public List<Token> postProcess(List<Token> tokens) {
if (tokens.size() == 0) {
return tokens;
}
List<Token> newTokens = new ArrayList<Token>();
Token prevToken = null;
Rule currentRule = null;
outer_loop: for (int i = 0; i < tokens.size(); i++) {
Token token = tokens.get(i);
if (currentRule != nu... | 9 |
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
config = plugin.getConfig();
if (args.length == 1 ){
if (sender instanceof Player) {
if (sender.hasPermission("darkcommand.kiss")){
if (commandLabel.equalsIgnoreCase("kiss")){
Player player = (Player)... | 6 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
AbstractComponent other = (AbstractComponent) obj;
if (type != other.type)
return false;
return true;
} | 4 |
@Override
public Bean parse(String filename) {
Bean newBean = new Bean();
String[] splited;
// lecture du fichier texte
try {
InputStream ips = new FileInputStream(filename);
InputStreamReader ipsr = new InputStreamReader(ips);
BufferedReader br = new BufferedReader(ipsr);
String ligne;
int i =... | 7 |
public static boolean updateList()
{
// Download mod list
if (modList.exists())
{
System.out.print("Backing up mod List\n");
try
{
if (oldList.exists())
{
FileManager.deleteFile(FileManager.updaterDir, "/... | 8 |
@Override
public void update() {
super.update();
if (jumpCounter > 0) {
dy = -3;
--jumpCounter;
}
} | 1 |
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
ManagerReport frame = new ManagerReport();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
} | 1 |
@Override
public IEmailKontakt first() throws NoEmailKontaktFoundException {
System.out.println("Display first contact...");
Connection con = null;
try {
con = initDBConnection();
} catch (SQLException e) {
e.printStackTrace();
}
ResultSet rs = null;
Statement stmt = null;
EmailKontakt ek = new E... | 4 |
public ControleurDeuxJoueurs(ModeleDeuxJoueurs _plateaux) {
super(_plateaux.getPlateau1());
plateau2 = _plateaux.getPlateau2();
} | 0 |
private void init() {
input.clear();
cache.clear();
;
} | 0 |
public IOClient(Socket client, PacketManager pm) {
if (client == null)
return;
this.client = client;
this.pm = pm;
try {
writer = new PrintStream(client.getOutputStream());
//writer.flush();
reader = new DataInputStream(client.getInputStream());
} catch (IOException e) {
pm.server.Log("Error");... | 2 |
public void advancePlayer(){
this.currentPlayer.setSelected(false);
//if the list is at the end, reset
if(list.lastIndexOf(currentPlayer) == list.size() - 1){
this.currentPlayer = list.get(0);
//otherwise, go forward
} else {
this.currentPlayer = list.g... | 1 |
public static String rot13(String input) {
StringBuilder output = new StringBuilder();
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
if (c >= 'a' && c <= 'm') {
c += 13;
} else if (c >= 'A' && c <= 'M') {
c += 13;... | 9 |
@Test
public void testInvokeZeroArgMethod()
{
Bean bean = new Bean();
Assert.assertNull(ReflectUtils.invokeZeroArgMethod(bean, "voidMethod"));
Assert.assertEquals(
"public",
ReflectUtils.invokeZeroArgMethod(bean, "publicMethod")
);
Assert.... | 0 |
@Test
public void testNextGreaterPowerOf2() {
logger.info("nextGreaterPowerOf2");
int[] number = {0, 1,2, 3,4, 5,6,7,8, 9,10,11,12,13,14,15,16,17,18,19,20};
int[] expResult = {1, 1,2, 4,4, 8,8,8,8, 16,16,16,16,16,16,16,16,32,32,32,32};
for (int i = 0; i < number.lengt... | 1 |
public void getData( Config config ) {
try {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
saveData.dataInfo.encode = "UTF-8";
saveData.dataInfo.language = "中文";
saveData.dataInfo.crawlDate = dateFormat.format(new Date());
for (Rea... | 5 |
public CoffeescriptPartitionScanner() {
IToken commentToken = new Token(COMMENT);
IToken stringToken = new Token(STRING);
List<IPredicateRule> rules = new ArrayList<IPredicateRule>();
rules.add( new MultiLineRule("###", "###", commentToken) );
rules.add( new EndOfLineRule("#" , commentToken) );
... | 0 |
@Test
/**
* D'après les resultats obtenus, on peut affirmer que l'alea mis en place est correct.
*/
public void testDistribution() {
double[] matrix;
int size = 100000;
int taille = 8;
double[] somme = new double[taille];
for (int i = 0; i < taille; i++) {
... | 4 |
public static void loadUnitPropetries(JsonReader reader, Unit unit) throws IOException
{
while (reader.peek() == JsonToken.NAME)
{
String name = reader.nextName();
if ("i".equals(name))
unit.i = reader.nextInt();
else if ("j".equals(name))
unit.j = reader.nextInt();
else if ("health".equals(nam... | 8 |
public boolean userExists(String userName)
{
// inserted this pseudo-condition for testing purposes.
if(true)
return false;
checkUserExistsSql = String.format(checkUserExistsSql, userName);
Connection conn = null;
Statement stmt = null;
ResultSet rs = nul... | 8 |
public void play_opponents() {
Suit round = null;
Submission temp;
for ( Player player : players_ ) {
if ( !player.is_human() ) {
// Player will draw a card from the draw pile
if (game_.turn_.draw()) {
player.take_card(deck_.draw())... | 6 |
private double innerProduct(Instance instance) {
double sum = 0;
for (int index : linearParam.getVector().keySet()) {
if (instance.getFeatureVector().getVector().containsKey(index)) {
sum += instance.getFeatureVector().get(index) * linearParam.get(index);
}
}
return sum;
} | 2 |
public Hero getHero(Player p) {
return getheroesplugin().getCharacterManager().getHero(p);
} | 0 |
public HostMenuPanel(final MainFrame frame) {
final JLabel error = new JLabel();;
this.addLabel(frame, "PortLabel");
final JTextArea port = new JTextArea(1, 30);
this.addComponent(port);
ActionListener listener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
i... | 9 |
public String getCourseName(int courseId) throws SQLException {
NoteDatabaseManager dm = new NoteDatabaseManager();
String s_courseId = Integer.toString(courseId);
String sql = "select course_name from course where course_id = "
+ s_courseId + ";";
ResultSet rs = dm.sqlQuery(sql);
String courseName = null... | 1 |
public static void main(String[] args) throws Exception {
new ParallaxMapping().loop();
} | 0 |
public static Double idealGasLaw(Double p, Double v, Double n, Double t)
{
boolean[] nulls = new boolean[4];
nulls[0] = (p == null);
nulls[1] = (v == null);
nulls[2] = (n == null);
nulls[3] = (t == null);
int nullCount = 0;
for(int k = 0; k < nulls.length; k++)
{
if(nulls[k])
nullCount++;
}... | 7 |
public boolean connect(String remoteHost) {
try {
// Connect to the server
m_skServer = new Socket(remoteHost, Utils.PORT_NUM);
// Get the output stream object
m_stOutput = new ObjectOutputStream(m_skServer.getOutputStream());
m_stInput = new ObjectInputStream(m_skServer.getInputStream());
... | 4 |
public Main() {
} | 0 |
private void jTxtFldFindClienteKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTxtFldFindClienteKeyTyped
// TODO add your handling code here:
try {
clearClientes();
String sql = "SELECT * FROM clientes WHERE email LIKE ? ";
Connection conn = Conexion.GetConn... | 2 |
public List<String> getMostFrequentWords(List<List<Object>> sequenceList, int highestCount) {
List<String> frequentWordList = new ArrayList();
for (int i = 0; i < sequenceList.size(); i++) {
List<Object> countAndSequenceList = sequenceList.get(i);
//only get the most frequent wor... | 3 |
@XmlAttribute
public void setId(int id) {
this.id = id;
} | 0 |
@Override
public void warning(SAXParseException e) {
System.out.println("SAXParserException Warning: " + e.getMessage());
this.errorOccurred = true;
} | 0 |
public final void redirect(String target, String... patterns) {
for (String path : patterns) {
pages.redirect(target, path);
}
} | 1 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.