text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void utilities(){
if(center) Base.render.center();
if(quit) System.exit(0);
} | 2 |
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
ContaReceber ContaReceber = filtrados.get(rowIndex);
switch (columnIndex) {
case 0:
return ContaReceber.getId();
case 1:
if (ContaReceber.getParceiro().isFisica()) {
... | 9 |
private long sizeOfType(Class<?> type) {
if (type == int.class) {
return INT;
} else if (type == long.class) {
return LONG;
} else if (type == byte.class) {
return BYTE;
} else if (type == boolean.class) {
return BOOLEAN;
} else if (type == char.class) {
... | 9 |
public static <T> Set<T> treeSet(T... params) {
Set<T> result = new TreeSet<T>();
for (T t : params) {
result.add(t);
}
return result;
} | 1 |
private void bind() {
HasAllMouseHandlers canvas = automatonView.getHandlerCanvas();
canvas.addMouseDownHandler(new MouseDownHandler() {
@Override
public void onMouseDown(MouseDownEvent event) {
StateView stateView = findStateAt(event.getX(), event.getY());
if (stateView != null) {
moveState = st... | 4 |
public static double getWeaponSpeed(WeaponType type) {
switch (type) {
case mel_sword:
return 3;
case mel_hammer:
return 4;
case rng_bow:
return 5;
}
return 1;
} | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof EMailTyp))
return false;
EMailTyp other = (EMailTyp) obj;
if (email == null) {
if (other.email != null)
return false;
} else if (!email.equals(other.email))
ret... | 6 |
public static void unzipFile(String zipFilePath, String outputDir) {
byte[] buffer = new byte[1024];
try {
// create output directory is not exists
File folder = new File(outputDir);
if (!folder.exists()) {
folder.mkdir();
}
// getLogger().info("zip file : " + zipFilePath);
// get the zip fi... | 5 |
public void run() {
URL url = null;
try {
url = new URL("http://skriptlib.exsoloscript.com/files/" + name + "/" + name);
} catch (MalformedURLException e) {
this.plugin.messageOps("Something went wrong whilst connecting to the SkriptLib server.");
return;
}
if (!exists(url)) {
this.plugin.messa... | 3 |
private void Open_File_Menu_ItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Open_File_Menu_ItemActionPerformed
//==== Initialize the filechooser, using the user's home dir, or the last working dir
if(this.currentDirectory.equals(""))
{ this.fc = new JFileChooser(); }
... | 4 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Colaborador other = (Colaborador) obj;
if (this.id != other.id && (this.id == null || !this.id.equals(oth... | 5 |
public AIModule getAI() {
return ai;
} | 0 |
private static void Sortingbywieghtdividedbylength() {
// TODO Auto-generated method stub
int i = 0;
int j = 0;
for (i = 0; i < 10000; i++) {
for (j = 0; j < 9999; j++) {
if (jobs[j][0] * jobs[j + 1][1] < jobs[j + 1][0] * jobs[j][1]) {
int l, m, n;
l = jobs[j][0];
m = jobs[j][1];
n =... | 5 |
static boolean isPlain(char ch) {
switch(ch) {
case '0': case '1': // don't have letters
case '+': case '-': // int'l prefix, dash
case '(': case ')': // silly North Americans
case '*': case '#': // just in case (should not occur, but...)
return true;
}
return false;
} | 8 |
@Override
public void display(UserInterface ui) {
UserInterface.println(
"Unraveling execution and re-executing current function.");
ui.signalNeedToDisplayFunction();
} | 0 |
public static TimerLabel swigToEnum(int swigValue) {
if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) {
return swigValues[swigValue];
}
for (int i = 0; i < swigValues.length; i++) {
if (swigValues[i].swigValue == swigVal... | 5 |
private JPanel pasEncore()
{
JPanel panel = new JPanel(new BorderLayout());
JLabel label ;
try {
BoxLayout bl=new BoxLayout(panel,BoxLayout.Y_AXIS); //layoutManager
panel.setLayout(bl); //attache le layoutManager au panel
label=... | 1 |
public byte dominantDimensionNum()
{
int d = -1;
int dl = -1;
for (int i = 0; i < min.length; i++)
{
int il = max[i] - min[i];
if (il > dl && canSplitInDim(i))
{
dl = il;
d = i... | 3 |
public static void main(String[] args) throws Exception
{
PrivateMember p = new PrivateMember();
Class<?> classType = p.getClass();
Method method = classType.getDeclaredMethod("getMessage",new Class[]{String.class});
/**
*
* Exception in thread "main" java.lang.NoSuchMethodException: reflectio... | 1 |
@BeforeClass
public static void setUpClass() throws Exception {
ctx = new AnnotationConfigApplicationContext(ConnectionConfig.class);
} | 0 |
void updateGui(String fieldname) {
Object fieldval = fieldvalues.get(fieldname);
Object fieldcom = fieldcomponents.get(fieldname);
String fieldtype = (String)fieldtypes.get(fieldname);
if (fieldcom instanceof JCheckBox) {
((JCheckBox)fieldcom).setSelected(
((Boolean)fieldval).booleanValue() );
/* more ... | 7 |
public void figureVoxels() {
start = dateFormat.format(cal.getTime());
/*
long commonCounter = 0;
for (int i = 0; i < topView3DCoordinates.size(); i++) {
Coord3d sample = topView3DCoordinates.get(i);
if (foundLateral(sample) == true && foundFront(sample) == true) {
commonCounter++;
System.out.pri... | 4 |
public static void main(String[] args) {
ParcelLocal p = new ParcelLocal();
Destination d = p.destination("Tasmania");
} | 0 |
public Test getTest(String suiteClassName) {
if (suiteClassName.length() <= 0) {
clearStatus();
return null;
}
Class testClass= null;
try {
testClass= loadSuiteClass(suiteClassName);
} catch (ClassNotFoundException e) {
String clazz= e.getMessage();
if (clazz == null)
clazz= suiteClassName;... | 9 |
public int getIconWidth() {
return 400;
} | 0 |
public CtConstructor[] getConstructors() {
try {
return getSuperclass().getConstructors();
}
catch (NotFoundException e) {
return super.getConstructors();
}
} | 1 |
public static void selectWordLeftText(OutlinerCellRendererImpl textArea, JoeTree tree, OutlineLayoutManager layout) {
Node currentNode = textArea.node;
int currentPosition = textArea.getCaretPosition();
String text = textArea.getText();
int text_length = text.length();
if (currentPosition == 0) {
retur... | 7 |
protected void reEstablishCycConnection() throws UnknownHostException, IOException, CycApiException {
previousAccessedMilliseconds = System.currentTimeMillis();
cycConnection.close();
cycConnection = new CycConnection(hostName,
port,
this);
if (!(cycImageID.equals(getCycImageID()... | 1 |
public UIAltaAnuncio() {
cal.setTime(new Date());
vendedor = usuarioservice.obtenerVendedor(usuarioservice.validar(usuario, contrasenia));
initComponents();
jTextField3.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
... | 4 |
public Set<Map.Entry<Long,Float>> entrySet() {
return new AbstractSet<Map.Entry<Long,Float>>() {
public int size() {
return _map.size();
}
public boolean isEmpty() {
return TLongFloatMapDecorator.this.isEmpty();
}
publ... | 8 |
public static void main(String[] args) throws Exception {
ExecutorService exec = Executors.newCachedThreadPool();
for (int i = 0; i < 5; i++)
exec.execute(new Accesor(i));
TimeUnit.SECONDS.sleep(3);
exec.shutdownNow();
} | 1 |
@Override
public List<Item> getDepositedItems(String depositorName)
{
if((depositorName==null)||(depositorName.length()==0))
return new ArrayList<Item>();
final List<Item> items=new Vector<Item>();
final Hashtable<String,Pair<Item,String>> pairings=new Hashtable<String,Pair<Item,String>>();
for(final Pla... | 8 |
@Override
public Object registeringGUI() {
String name, descr;
int year;
double initPrice;
name = guiImpl.requestData("Nome:");
descr = guiImpl.requestData("Decrição:");
while(true){
try{
year = Integer.parseInt(guiImpl.requestDat... | 4 |
private Memento(int state) {
this.state = state;
} | 0 |
public boolean verify(byte[] sig) throws Exception{
int i=0;
int j=0;
byte[] tmp;
if(sig[0]==0 && sig[1]==0 && sig[2]==0){
j=((sig[i++]<<24)&0xff000000)|((sig[i++]<<16)&0x00ff0000)|
((sig[i++]<<8)&0x0000ff00)|((sig[i++])&0x000000ff);
i+=j;
j=((sig[i++]<<24)&0xff000000)|((sig[i++]<<16)&0x00... | 3 |
public void drawCCW(Bitmap bitmap, int xo, int yo) {
for (int y = 0; y < bitmap.width; y++) {
int yy = bitmap.width - y + yo;
if (yy < 0 || yy >= this.height)
continue;
for (int x = 0; x < bitmap.height; x++) {
int xx = x + xo;
if (xx < 0 || xx >= this.width)
continue;
int color = bitmap... | 7 |
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getSource() instanceof JFormattedTextField) {
JFormattedTextField jtf = (JFormattedTextField) evt.getSource();
if ("File Size Change".equals(jtf.getName())) {
Number num = (Number) jtf.getValue();
if (num != null) {
model.... | 3 |
public static String getProperName(String name) {
String stringSplitUp[], totalString = null;
// Regex strip everthing exept leters and spaces.
name = name.replaceAll("[^A-Za-z ]", "_").trim();
if (name != null && !name.isEmpty() && name.length() > 1) {
stringSplitUp = name... | 9 |
private void setupIndividualCardPosition(Card card, int rowNumber,
int colNumber) {
final int CARD_DISPLAY_TOP = 60;
final int DISPLAY_GAP = 6;
int leftPositionForRow = getLeftPositionForRow(rowNumber);
int y = CARD_DISPLAY_TOP + (cardHeight * 3 / 4) * rowNumber;
int x = CARD_DISPLAY_LEFT + leftPositionF... | 2 |
private void btnExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirActionPerformed
DepartamentoBO departamentoBO = new DepartamentoBO();
try {
departamentoBO.DeleteDepartamento(txtCodDepartamnento.getText());
JOptionPane.showMessageDialog(null, "D... | 2 |
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
{
if (!(sender instanceof Player))
{
sender.sendMessage("Only players can use this command.");
return true;
}
Player p = (Player) sender;
Block lookingAt = Utilities.getLookingAtAir(p);
if(lookin... | 8 |
@EventHandler
public void OnGameQuit(GameQuitEvent event){
String pName = event.getPlayerName();
Player p = event.getPlayer();
if (plugin.PlayersInGame.contains(pName))
{
plugin.PlayersInGame.remove(pName);
if (plugin.sbHandler.badTeam != null && plugin.sbHandler.goodTeam != null)
{
if (plugin.sbH... | 9 |
public void visitGotoStmt(final GotoStmt stmt) {
if (stmt.target() == oldDst) {
if (FlowGraph.DEBUG) {
System.out.print(" replacing " + stmt);
}
stmt.setTarget(newDst);
if (FlowGraph.DEBUG) {
System.out.println(" with " + stmt);
}
}
} | 3 |
@EventHandler (priority = EventPriority.NORMAL)
public void join(final PlayerJoinEvent evt) {
String name = evt.getPlayer().getDisplayName();
evt.setJoinMessage(null);
for (Player pl : Bukkit.getServer().getOnlinePlayers()) {
if (pl.getName().equalsIgnoreCase(evt.getPlayer().getName())) break;
if (pl.hasP... | 8 |
public Object getResponse() {
return response;
} | 0 |
public static String nickOf(final String source) {
if (source.length() < 1) {
return "";
}
final int si;
switch (source.charAt(0)) {
case '#':
case '!':
case '&':
case '*':
return "";
case '+':
... | 9 |
public Crs getCrs()
{
return crs;
} | 0 |
private Boolean checkTables() throws Exception {
if (!this.db.checkTable("chunky_objects")) {
if (!db.createTable(QueryGen.createObjectTable())) return false;
Logging.info("Created chunky_objects table.");
}
if (!this.db.checkTable("chunky_ownership")) {
if (!... | 8 |
public String doFilter(String input) {
StringBuffer buffer = new StringBuffer();
File file = new File(input);
if (file.exists()) {
if (file.isDirectory()) {
File list[] = file.listFiles();
for (int i = 0; i < list.length; ++i) {
if (showFullPath) {
buffer.append(list[i]);
buffer.append('\n');
... | 5 |
public void addEvent(final GenericEvent ge) {
final Class<?> c = ge.getClass( );
if ( this.handlers.containsKey(c) )
for (final EventHandler h : this.handlers.get(c))
h.add(ge);
} | 3 |
public ArrayList<Integer> findLongestTrainTrack(){
ArrayList<Integer> maxId = new ArrayList<Integer>(); //最長火車的id序列
for(int i=0 ; i<receivingTrack.length ; i++){
int count = maxId.size();
for(int j=maxId.size()-1 ; j>=0 ; j--){
if(receivingTrack[i].ifEmpty == false){
if(receivingTrack[i].t... | 7 |
@Override
public void addIllness(IllnessDTO illness) throws SQLException {
Session session = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.save(illness);
session.getTransaction().commit();
... | 3 |
String classToType(Class cls) {
if (cls==Point.class) {
return "int2";
} else if (cls==Integer.TYPE
|| cls==Integer.class ) {
return "int";
} else if (cls==Double.TYPE
|| cls==Double.class ) {
return "double";
} else if (cls==String.class) {
return "String";
} else if (cls==Boo... | 8 |
private boolean isValidFont(String name, Map<String, String> data) {
StringBuilder errorList = new StringBuilder();
// Iterate through the required fields and make sure we have the field
// we need! Otherwise append to the string builder, at this point we
// don't kill it and throw an exception. I believe it's... | 3 |
private String getIdSetSqlCondition() {
if (!selectedIds.isPresent()) {
return "";
}
Set<Long> ids = selectedIds.get();
StringBuilder sb = new StringBuilder("id in (");
if (ids.isEmpty()) {
sb.append("null");
} else {
Iterator<Long> idIterator = selectedIds.get().iterator();
... | 4 |
public void useSkill(Skill skill) {
if (skill.getEffect().getType().equals("remove debuffs")) {
skill.use(this, target);
}
else if (hitAvailable && !isStunned && !skill.isUsed() && !isDead) {
skill.use(this, target);
hitAvailable = false;
... | 5 |
protected void assignToTeamAOrB(String teamType) {
Object selectedValue = studentsCDJlst.getSelectedValue();
String selectedStudent = null;
int selectedIndex = 0;
if (selectedValue == null ) {
//warn no selected student
JOptionPane.showMessageDialog(this, "No student selected", "No student selected", JOpt... | 3 |
private void enabledPanels(Boolean enabled){
for(int i=0;i<jTabbedPane1.getComponentCount();i++){
if(jTabbedPane1.getComponent(i) instanceof JPanel){
JPanel jpanelTemp=(JPanel)jTabbedPane1.getComponent(i);
for(int j=0;j<jpanelTemp.getComponentCount();j++){
... | 5 |
public Node search(Node x, int key) {
if (x == null || x.key == key) {
return x;
}
if (key < x.key) {
return search(x.left, key);
} else {
return search(x.right, key);
}
} | 3 |
static final public void opRel() throws ParseException {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case 56:
jj_consume_token(56);
expression.empiler(EGAL);yvm.push(EGAL);
break;
case 57:
jj_consume_token(57);
expression.empiler(DIFFERENT);yvm.push(DIFFERENT);
break;
... | 7 |
public static void removePacks (String xml) {
ArrayList<ModPack> remove = Lists.newArrayList();
int removed = -1; // TODO: if private xmls ever contain more than one modpack, we need to change this
for (ModPack pack : packs) {
if (pack.getParentXml().equalsIgnoreCase(xml)) {
... | 6 |
final ItemDefinition method1177(int i) {
if (stackIDs != null && i > 1) {
int k = -1;
for (int l = 0; l < 10; l++) {
if (i >= stackAmounts[l] && stackAmounts[l] != 0) {
k = stackIDs[l];
}
}
if (k != -1) {
... | 6 |
public Iterator<Pfad> getPathIterator() {
return pfadList.iterator();
} | 0 |
protected void doEditing() {} | 0 |
public RuleConfigs custom(Tester<?,?> tester,String tag){
testerMapping.put(tag,tester);
return this;
} | 2 |
@Override
//for simplicity, the getNeighbor method is the same for 4 and 8 pixels, works
//for both values (and even larger ones, for experiments)
public PixelInfo getNeighbor(PixelInfo pixel, int i, int width, int height) {
//in case that i>8:
//1 cycle = 8 pixels around the given pixel
//i'th neighbor = nu... | 8 |
private void verMensajes() {
Mensaje mensaje;
while ((mensaje = client.getNuevoMensaje()) != null)// llamamos a client
{
System.out.print(NUEVO_MENSAJE);
System.out.println(mensaje.getSource());
System.out.println(ASUNTO + mensaje.getTitulo());
Sys... | 2 |
public void checkforbubble() {
if (bubble == 1) {
setImage(bubble1);
}
else if (bubble == 2) {
setImage(bubble2);
}
else if (bubble == 3) {
setImage(enemylist);
}
else if (bubble == 4) {
setImage(enemylist2);
... | 6 |
public static void main(String[] args) {
MultipleLayerLruCache cache = new MultipleLayerLruCache(128, "C:/cache/", 1024L);
StringCache []datas = new StringCache[count];
for(int i=0;i<count;++i){
String s = "";
for(int j=0;j<48;++j) s += ""+i;
StringCache sc = new StringCache();
sc.mContent = s;
da... | 3 |
private void detectFields() {
try {
ProtobufDecoder protobufDecoder = new ProtobufDecoder(
transMeta.environmentSubstitute(wClasspath.getText().trim()
.split(File.pathSeparator)), wRootClass.getText(),
null);
try {
Map<String, Class<?>> fields = protobufDecoder.guessFields();
RowMeta ro... | 5 |
@MethodInformation(author="Wolfgang", date="07.12.2012", description="deletes element from Set")
public boolean delete(Object element) {
Node p = head;
Node prev = head;
while(p != null) {
if(p.getElement() == element) {
if(p == head)
head = p.getNextNode();
if(p == tail)
ta... | 4 |
public static Symbol getInstanceName(Stella_Object instanceref) {
{ Stella_Object instance = Logic.getInstance(instanceref);
{ Surrogate testValue000 = Stella_Object.safePrimaryType(instance);
if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_LOGIC_OBJECT)) {
{ LogicObject instance000... | 6 |
private static boolean isToken(String x)
{
return isString(x)||isFloat(x)||isIdentifier(x)||isKeyword(x)||isWhite(x)||isSemicolon(x)||isOpenParen(x)||isCloseParen(x)||isOperator(x);
} | 8 |
public int bonusGain() {
int bonus = 0;
Iterator<Element> it = this.elements.iterator();
while (it.hasNext()) {
bonus += it.next().bonusGain();
}
return bonus;
} | 1 |
@Override
public String toString() {
byte b;
final StringBuilder s = new StringBuilder(bits.length * Byte.SIZE);
for (int i = 0; i < lastByte; i++) {
for (int j = Byte.SIZE - 1; j >= 0; j--) {
b = bits[i];
s.append((b >> j & 1) == 0 ? '0' : '1');
}
}
for (int j = Byte.SIZE - 1; j >= lastBit; j-... | 5 |
public void output() {
if (!isEmpty()) {
for (ValueType current : this) {
System.out.print(current + " ");
}
System.out.println();
}
} | 2 |
private ArrayList<ArrayList<Integer>> createGen() {
ArrayList<ArrayList<Integer>> nextGen = new ArrayList<ArrayList<Integer>>();
double fitSum = getFitSum();
for (int i = 0; i < currGen.size(); i++) {
nextGen.add(new ArrayList<Integer>());
int parentOne = getIndividual(f... | 7 |
protected void inPostAttrib(final char c)
{
switch(c)
{
case ' ': case '\t': case '\r': case '\n': bufDex++; return;
case '=': changeTagState(State.BEFOREATTRIBVALUE); return;
case '<':
endEmptyAttrib(endDex[State.INATTRIB.ordinal()]);
piece.innerStart = bufDex;
abandonTagState(State.BEFORETAG);
... | 8 |
private void configureCGIHeaderMap() {
// Find the child environment for the 'cgi_map_headers' section
Environment<String,BasicType> cgiHeaderMap =
this.getHandler().getGlobalConfiguration().getChild( Constants.CKEY_HTTPCONFIG_SECTION_CGI_MAP_HEADERS );
if( cgiHeaderMap == null ) {
this.getLogger().log... | 6 |
protected double getBalance(MOB mob)
{
double balance = 0;
// return the balance in int form
if(surviveReboot)
{
final List<JournalEntry> V =CMLib.database().DBReadJournalMsgsByUpdateDate("BRIBEGATE_"+gates(), true);
final Vector<JournalEntry> mine = new Vector<JournalEntry>();
for (int v = 0; v < V.s... | 8 |
@Override
public void run() {
try {
// Eclipse doesn't support System.console()
BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
ConfigManager config = NetBase.theNetBase().config();
String targetIP = config.getProperty("net.server.ip");
if ( targetIP == null ) {
Sys... | 8 |
public synchronized void allsended ()
{
if (GD != null) GD.unchain();
if (Closed) return;
ListElement p = L.first();
int i, n = 0;
while (p != null)
{
n++;
p = p.next();
}
if (n > 3)
{
GamesObject v[] = new GamesObject[n - 1];
p = L.first().next();
for (i = 0; i < n - 1; i++)
{
... | 8 |
public GibbsLDA (int K, int V, float alpha, float beta, int iter, int data [][]) {
this.K = K;
this.V = V;
this.alpha = alpha;
this.beta = beta;
this.iter = iter;
this.data = data;
this.M = data.length;
int N = 0;
Random random = new Rando... | 8 |
public boolean isValidItem(EntityType et, Material mat) {
if (et == null || mat == null) {
return false;
}
try {
if (ITEMS_REQUIRED.containsKey(et.name())) {
if (ITEMS_REQUIRED.get(et.name()).contains("ANY")) {
return true;
... | 8 |
@SuppressWarnings("unchecked")
private static <T> Converter<Object, T> lookupConversionService(Class from,
Class to) {
for (ConversionProvider converter : convServices) {
Converter c = converter.getConverter(from, to);
if (c != null) {
return c;
}
}
return null;
} | 2 |
private static void traverse(int row, int i, char[][] board) {
Stack<Pair> stack = new Stack<Pair>();
stack.push(new Pair(row, i));
while (!stack.isEmpty()) {
Pair p = stack.pop();
board[p.row][p.col] = 'E';
if (p.row - 1 > 0 && board[p.row - 1][p.col] == 'O')... | 9 |
public final int runNextPlan(int deciSeconds) throws FatalError,
RestartLater {
if (planManager == null) {
return deciSeconds;
}
GregorianCalendar finish = new GregorianCalendar();
finish.setTime(Config.getDate());
finish.add(Calendar.MILLISECOND, deciSeconds * 100);
while (((finish.getTimeInMillis... | 4 |
private void copyFileToArchive(final ZipArchiveOutputStream zos, final File file, final String dir) {
try {
if (file.isFile()) {
ZipArchiveEntry zae = new ZipArchiveEntry(dir + file.getName());
zae.setSize(file.length());
zos.putArchiveEntry(zae);
... | 7 |
@Override
public void run() {
while (!paused) {
update();
repaint();
if (inHandler.getKeys()[KeyEvent.VK_F3]) {
if(!opened){
opened=true;
// opens new frame
JFrame frame = new JFrame();
frame.setSize(500, 210);
frame.setLayout(new BorderLayout());
baos = new Byt... | 6 |
private void affichageErreur(List<Error> erreurs) {
for (Error e : erreurs) {
switch (e) {
case raisonSocialeVide:
this.labelErreurRaisonSociale.setText("Veuillez saisir une raison sociale");
break;
case telephoneVide:
... | 9 |
public static int[] scramble(int[] m, int[] c) {
int x = 0;
int y = 0;
while (x < m.length) {
if (y >= c.length) {
y = 0;
}
m[x] = m[x] * c[y];
x++;
y++;
}
return m;
} | 2 |
@Override
public AuthorModel getAuthor(int id) throws WebshopAppException {
if (id > 0) {
try (Connection conn = getConnection()) {
String sql = "SELECT * FROM author WHERE id = ?";
try (PreparedStatement pstmt = conn.prepareStatement(sql)) {
pstmt.setInt(1, id);
try (ResultSet rs = pstmt.ex... | 3 |
@Override
public void Run()
{
List<ClassDocumentation> docs = DeserializeModel(Android);
for( ClassDocumentation doc : docs )
{
for( ThreadElement thread : doc.getValidatedThreads() )
{
HashSet<LinkType> types = new HashSet<LinkType>();
for( LinkSpan link : thread.Question.getLinks(doc.Klass) )
... | 8 |
* @return the ID for the meeting
* @throws IllegalArgumentException if the meeting is set for a time in the past,
* of if any contact is unknown / non-existent
*/
public int addFutureMeeting(Set<Contact> contacts, Calendar date) throws IllegalArgumentException
{
now.setTime(new Date());
if(date.before(now))... | 3 |
@Override public void paintDeterminate(Graphics g, JComponent c) {
if (!(g instanceof Graphics2D)) {
return;
}
Insets b = progressBar.getInsets(); // area for border
int barRectWidth = progressBar.getWidth() - (b.right + b.left);
int barRectHeight = progressBar.getHeight() - (b.top + b... | 5 |
public static void OrdiVsJoueur(Parametre param){
Ligne ligneOrdi = new Ligne(param, true);
Ligne ligneJoueur = new Ligne(param, false);
LigneMarqueur liMarq = new LigneMarqueur(param.getTailleLigne());
Scanner sc = new Scanner(System.in);
String esp = param.esp(" "); //... | 7 |
public void parseExpressions(String expressions, Handler handler) {
for(String expression : expressions.split("[\n\r,]+")) {
parseExpression(expression, handler);
}
} | 1 |
public void toggle_draw_pf() {
if (!draw_pf_map) {
draw_pf_map = true;
APXUtils._pf_compute(0);
} else {
draw_pf_map = false;
}
} | 1 |
private Object readResolve() throws ObjectStreamException {
RectangleAnchor result = null;
if (this.equals(RectangleAnchor.CENTER)) {
result = RectangleAnchor.CENTER;
}
else if (this.equals(RectangleAnchor.TOP)) {
result = RectangleAnchor.TOP;
}
el... | 9 |
private int getDayOfBirth() {
view.printDayOfBirthInputRequest();
int dayOfBirth = ConsoleInputUtils.readIntValue();
List<ValidateException> validateExceptionList = new DOBValidator().validateDay(dayOfBirth);
if (!validateExceptionList.isEmpty()) {
view.printValidateExcepti... | 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.