text stringlengths 14 410k | label int32 0 9 |
|---|---|
@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... | 3 |
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(... | 1 |
@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... | 7 |
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... | 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 = ... | 4 |
@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... | 5 |
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
... | 7 |
public int getSeat() {
return seat;
} | 0 |
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... | 6 |
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... | 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... | 4 |
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... | 2 |
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;
... | 5 |
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... | 3 |
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 < ... | 4 |
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... | 7 |
public SessionFactory getSf() {
return sessionFactory;
} | 0 |
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... | 5 |
@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... | 3 |
public Kuuntelija(Pelaaja pelaaja) {
this.pelaaja = pelaaja;
} | 0 |
public void setMobileLab(String mobileLab) {
MobileLab = mobileLab;
} | 0 |
@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... | 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... | 9 |
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... | 3 |
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... | 7 |
@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... | 9 |
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);
}
} | 4 |
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... | 1 |
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... | 5 |
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);
... | 4 |
@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... | 9 |
public GeoJsonObject getGeometry()
{
return geometry;
} | 0 |
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... | 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... | 4 |
public Date getBuiltOn() {
return builtOn;
} | 0 |
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... | 5 |
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));
} | 2 |
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... | 9 |
@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... | 6 |
public void closeConnection(){
try {
this.clone();
} catch (CloneNotSupportedException ex) {
Logger.getLogger(DatabaseConnection.class.getName()).log(Level.SEVERE, null, ex);
}
} | 1 |
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... | 4 |
public void sendOnlineUsers (List<String> clients)
{
String clientString = "";
for (String user : clients)
{
clientString = clientString + user+", ";
}
send("ONLINE# " + clientString);
} | 1 |
public void stop() {
if (frame != null)
frame.dispose();
} | 1 |
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);
... | 4 |
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;
} | 2 |
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... | 7 |
public void setDistance(Distance distance) {
for(int i=0;i<_distances.length;++i) {
if(_distances[i] == distance) {
_setDistance(i);
return;
}
}
} | 2 |
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()... | 4 |
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... | 2 |
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... | 9 |
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());
... | 2 |
@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... | 0 |
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... | 7 |
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... | 5 |
private void broadcastChange(Slot<T> slot) {
for(DraftListener<? super T> crnt : allListeners) {
crnt.onChange(slot);
}
} | 2 |
public static XStoreFault getInstance(String faultCode, String faultString) {
XStoreFault xStoreFault = new XStoreFault();
xStoreFault.setFaultCode(faultCode);
xStoreFault.setFaultString(faultString);
return xStoreFault;
} | 0 |
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();
... | 7 |
public static boolean streetAddress(String address){
if(address.matches("(\\d)+(\\s)[a-zA-Z\\s\\.]+")&&address.length()<100)
return true;
return false;
} | 2 |
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... | 7 |
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... | 0 |
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... | 7 |
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;
} | 2 |
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... | 9 |
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... | 7 |
@Test(expected=IllegalNumberOfOperandsException.class)
public void testIllegalNumberOfOperandsPlus() {
calculator.pushOperand(7.0);
calculator.pushPlusOperator();
calculator.evaluateStack();
//assertTrue("An IllegalNumberOfOperandsException should heve been thrown here.", false);
} | 0 |
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);
}
} | 1 |
@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 ... | 9 |
public int calculate(int a, int b)
{
return a + b;
} | 0 |
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... | 2 |
private static int decodeConnectionId(byte connectionId) {
return (int) (connectionId < 0 ? connectionId - 2*Byte.MIN_VALUE : connectionId);
} | 1 |
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... | 7 |
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");
... | 4 |
@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";
} | 0 |
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... | 3 |
@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... | 7 |
@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+")");
}... | 2 |
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... | 9 |
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... | 3 |
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... | 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... | 5 |
public static void setGamePanel(Game panel) {
instance.contentPanel.removeAll();
if (panel != null) {
instance.contentPanel.add(panel, BorderLayout.CENTER);
instance.repaint();
instance.revalidate();
}
} | 1 |
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) {
... | 4 |
@Override
public Key next()
{
if (!hasNext())
throw new NoSuchElementException();
Key key = current.key;
current = current.next;
return key;
} | 1 |
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... | 4 |
@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... | 9 |
public static String getAttribute(Element element, String key, String defaultRet) {
return element.hasAttribute(key)? element.getAttribute(key):defaultRet;
} | 1 |
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 ... | 7 |
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... | 6 |
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());
... | 8 |
private void findZip() {
//郵便番号検索
//画面の郵便番号を取得
String searchZip = textZipCode.getText().replaceAll("-", "");
int serchL = searchZip.length();
if ((serchL == 3) || (serchL == 5)) {
//3桁・5桁指定
//一覧呼び出し
JyusyoJDialog digJyusyo = new Jyusyo... | 8 |
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) {
... | 4 |
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;
} | 2 |
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... | 1 |
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);
} ... | 6 |
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;
... | 8 |
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) {
... | 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);
} | 1 |
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... | 4 |
@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... | 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... | 5 |
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.