text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
IkszorBinaryObject other = (IkszorBinaryObject) obj;
if (!Arrays.equals(decodedValue, other.decodedValue))
return false;
if (!Arrays.equals(... | 6 |
private Result pDirectAbstractDeclarator$$Tail1(final int yyStart)
throws IOException {
Result yyResult;
int yyBase;
int yyOption1;
Node yyOpValue1;
Action<Node> yyValue;
ParseError yyError = ParseError.DUMMY;
// Alternative 1.
yyResult = pSymbol... | 8 |
public static void filledCircle(double x, double y, double r) {
if (r < 0) {
throw new IllegalArgumentException("circle radius must be nonnegative");
}
double xs = scaleX(x);
double ys = scaleY(y);
double ws = factorX(2 * r);
double hs = factorY(2 * r);
... | 3 |
public boolean setPlayer2(Player player) {
boolean test = false;
if (test || m_test) {
System.out.println("Game :: setPlayer2() BEGIN");
}
if (player == null) {
throw new IllegalArgumentException(
"Game::SetPlayer2 - Invalid player type(null) for player2");
}
m_pl... | 5 |
@Override
public int getRoll(){
Iterator<IStrategy> it = this.getStrategies().iterator();
int max = 0;
while(it.hasNext()){
max = Math.max(it.next().getRoll(), max);
}
return max;
} | 1 |
public void addAgent(Agent agent) {
agents.add(agent);
if(this instanceof Connection){
agent.addConnection(this);
} else {
System.out.println(this.toString());
}
} | 1 |
public int maxPoints(Point[] points) {
Map<Double, Integer> statistic = new HashMap<Double, Integer>();
int maxNum = 0;
int duplicate = 1;
double k = 0.0;
for(int i=0; i < points.length; i++) {
statistic.clear();
statistic.put(Double.MIN_VALUE, 0); //itself
... | 8 |
@Override
public boolean hasMoreElements() {
return hasMore;
} | 0 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public List<List<Integer>> permute(int[] num) {
length = num.length;
if(length == 0) return result;
flag = new boolean[length]; //init flag
DFS(num); // dfs deep first research
return result; // return
} | 1 |
@Test
public void testGetPastMeetingList1()
{
cmInst.addNewPastMeeting(testContactSet, pastDate, "added as NewPastMeeting");
Calendar fDate = Calendar.getInstance();
fDate.setTime(new Date());
fDate.add(Calendar.SECOND, 1);
int fmId = cmInst.addFutureMeeting(testContactSet, fDate);
try {
Thread.sleep(1... | 3 |
public CoordinateWrapper promptForCoordinates() {
Scanner in = Sudoku260.input;
int x, y;
do {
//Prompt the user for the coordinates:
System.out.println("Enter the coordinates in the format: x y");
String response = in.nextLine();
if(r... | 8 |
public void fillWithData()
{
try
{
synchronized (this)
{
if (reader != null)
{
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
while (reader.available() > 0)
{
final int c = reader.read();
if (c == -1)
throw new IOException("Received EOF");
if (... | 7 |
public SignatureVisitor visitReturnType() {
endFormals();
if (!hasParameters) {
buf.append('(');
}
buf.append(')');
return this;
} | 1 |
public void doDrawing(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setColor(Color.black);
g2d.drawString("START", 30, 250);
int[] c = new int[3];
c[0] = 20;
c[1] = 80;
c[2] = 50;
int[] d = new int[3];
d[0] = 290;
d[1] = 290;
d[2] = 310;
g2d.fillPolygon( c, d, 3 );
g2d.fillRect(40, 250, 20, 40);
g... | 9 |
public static ArrayList<String> words(String line){
if(stopwords.size() == 0)
addStopwords();
ArrayList result = new ArrayList();
String[] words = line.split("[ \t\n,\\.\"!?$~()\\[\\]\\{\\}:;/\\\\<>+=%*]");
for(int i=0; i < words.length; i++){
if(words[i] != null && !words[i].equals("")){
String wor... | 5 |
@Override
public void actionPerformed(ActionEvent e)
{
if ("yes".equals(e.getActionCommand()))
{
action.buttonClicked(ButtonClicked.YES_CLICKED);
if (action.removeFrame())
{
frame.dispose();
}
}
if ("no".equals(e.getActionCommand()))
{
action.buttonClicked(ButtonClicked.NO_CLICKED);
if... | 4 |
public int splitBalanced(int[] array) {
if (array == null
|| array.length == 0
|| array.length == 1) {
return -1;
}
int length = array.length;
long leftSum = 0;
long rightSum = 0;
int quit = -1;
for (int i = 1; i < len... | 7 |
public String getPermutation(int n, int k) {
if (n==1) return "1";
String rs = "";
if(k==1) {
for (int i=1; i<=n; i++){
rs += i;
}
return rs;
}
k = k - 1;
int[] product = new int[8];
product[0] = 1;
fo... | 9 |
public State[] getStatesOnTerminal(String terminal, State[] states,
Automaton automaton) {
ArrayList list = new ArrayList();
for (int k = 0; k < states.length; k++) {
State state = states[k];
Transition[] transitions = automaton.getTransitionsFromState(state);
for (int i = 0; i < transitions.length; i++... | 5 |
@Override
public EntityManager getEntityManager() {
return super.getEntityManager();
} | 0 |
@Override
public boolean isInsideCircle(int cX, int cY, int rad, FieldObject fo) {
int dx = cX - fo.getX();
int dy = cY - fo.getY();
boolean insSq = Math.abs(dx) <= rad && Math.abs(dy) <= rad;
if (!insSq) { return false; }
if (dx * dy < 0) { return true; }
... | 4 |
private void playGame()
{
gameCurrentlyRunning = true;
//infinite game!!
while(true)
{
if(currentGame == totalLevels){
JOptionPane.showMessageDialog( null, "Thanks for playing Asteroids! Congrats on battling the asteroid belt.\nRestart game..." );
//gameCurrentlyRunning = false;
currentGame = -... | 9 |
public static void loadFonkozeBase(){
ImD1 = new ImportDriver1("//localhost/fonkoze","root","");
if(ImD1.verifyConnection()){
try{
result=ImD1.executer("SELECT * FROM membre");
if(result !=null){
while(result.next()){
System.out.println("id: "+result.getInt("id"));
... | 4 |
public void addReturn(CtClass type) {
if (type == null)
addOpcode(RETURN);
else if (type.isPrimitive()) {
CtPrimitiveType ptype = (CtPrimitiveType)type;
addOpcode(ptype.getReturnOp());
}
else
addOpcode(ARETURN);
} | 2 |
public void setKickingDistance(float newDistance) {
if (newDistance <= 1.0f && newDistance > 0.0f)
kickingDistance = newDistance;
} | 2 |
public static Ptg calcNormsInv( Ptg[] operands )
{
if( operands.length != 1 )
{
return PtgCalculator.getValueError();
}
try
{
double x = operands[0].getDoubleVal();
if( (x < 0) || (x > 1) )
{
return new PtgErr( PtgErr.ERROR_NUM );
}
/*
* the algorithm is supposed to iterate over NOR... | 6 |
public String getColumnName(int i) throws Exception {
String colName = null;
if (i == 0)
colName = "personID";
else if (i == 1)
colName = "name";
else if (i == 2)
colName = "projectID";
else if (i == 3)
colName = "role";
else
throw new Exception("Access to invalid colu... | 4 |
public Currency search(String token) {
for (Currency currency : CurrencySet.getInstance()) {
if (currency.getCode().toLowerCase().equals(token.toLowerCase()))
return currency;
if (currency.getSymbol().toLowerCase().equals(token.toLowerCase()))
return curre... | 4 |
public static RailSubmodesOfTransportEnumeration fromValue(String v) {
for (RailSubmodesOfTransportEnumeration c: RailSubmodesOfTransportEnumeration.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
} | 2 |
private static boolean verifyRunningReplica(Task task, OurSim ourSim) {
int running = 0;
for (Replica replica : task.getReplicas()) {
ExecutionState replicaState = replica.getState();
if (ExecutionState.RUNNING.equals(replicaState) || ExecutionState.UNSTARTED.equals(replicaState)) {
running++;
}... | 6 |
@SuppressWarnings("deprecation")
@EventHandler
public void onPlayerInteractBlock(PlayerInteractEvent event)
{
if(event.getPlayer().hasPermission("skeptermod.useitem.warhammer") || (event.getPlayer().isOp()))
if(event.getPlayer().getItemInHand().getTypeId() == Material.GOLD_AXE.getId() && event.getPlayer().get... | 6 |
public void setLine(Line line) {
if (line.getPoint0() == this || line.getPoint1() == this) {
haveLine = true;
this.line = line;
if (this == line.getPoint0()) {
if (line.getPoint0().getX() == line.getPoint1().getX()) { //Для вертикальных прямых
... | 5 |
private void read_page (PageId pageno, Page page) throws
BufMgrException {
try {
SystemDefs.JavabaseDB.read_page(pageno, page);
} catch (Exception e) {
throw new BufMgrException(e, "BUFMGR: read_page() failed");
} // end try
} // end read_page() | 1 |
@Override
public ArrayList< DefaultConfig > loadConfig( String configPath )
{
ArrayList< DefaultConfig > result = new ArrayList< DefaultConfig >();
File config = null;
FileInputStream fis = null;
InputStreamReader isr = null;
BufferedReader reader = null;
String line = null;
String name = null;
Defa... | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
User other = (User) obj;
if (firstname == null) {
if (other.firstname != null)
return false;
} else if (!firstname.equals(other.firstnam... | 9 |
* @param end
* @param dict
* @return
*/
public ArrayList<ArrayList<String>> findLadders(String start, String end, HashSet<String> dict) {
ArrayList<ArrayList<String>> result = new ArrayList<ArrayList<String>>();
dict.add(end);
int size = dict.size();
ArrayList<String> ... | 8 |
@Override
public void run() {
while(running){
try{
if(inStream.available() > 0){
gameTime = inStream.readDouble();
//playerArray = (int[][]) inStream.readObject();
}
} catch(Exception e){
e.printStackTrace();
}
}
} | 3 |
public Placeable getRandomPlacable() {
Placeable p = null;
Object[] ks = placeables.keySet().toArray();
if (ks.length > 0) {
String s = ks[Rand.getRange(0, ks.length - 1)].toString();
p = placeables.get(s);
}
return p;
} | 1 |
@Override
public void connect() throws Exception {
if (remoteClientCall == null) {
throw new IllegalStateException("RemoteClientConnection is not initial.");
}
remoteClientCall.connect();
} | 1 |
private Vector2 SnapToGrid(Vector2 mouse)
{
if (mouse.X % gridW[mode] != 0)
{
if (mouse.X < 0)
mouse.X -= gridW[mode];
mouse.X = ((int) (mouse.X / gridW[mode])) * gridW[mode];
}
if (mouse.Y % gridH[mode] != 0)
{
if (mouse.Y < 0)
mouse.Y -= gridH[mode];
mouse.Y = ((int) (mouse.Y / gridH[mo... | 4 |
public void start() {
if (state == EnumStopWatchState.STOP) {
timer = new Timer(NAME);
timer.scheduleAtFixedRate(this, 0, 1000);
state = EnumStopWatchState.RUNNING;
log.info("start stopwatch, it's state:" + state + ", elapseTime:"
+ elapseTime);
}
} | 1 |
public File getTransactionFile(String name) {
for (File f : getTransactionFiles()) {
main.debug("Comparing " + f.getName() + " to " + name + ".yml");
if (f.getName().equals(name + ".yml")) {
return f;
}
}
return null;
} | 2 |
protected void updateTable(String name, Map<String, String> columns) throws SQLException {
PreparedStatement statement = null;
try {
StringBuilder builder = new StringBuilder();
builder.append("CREATE TABLE IF NOT EXISTS ? (");
for (int i = 0; i < columns.size(); i++)... | 6 |
@Override
public void clearAppenders() {
doClearAppenders();
} | 0 |
public void addInputCallPanel(final String remoteChannel, final String localChannel){
if(remoteChannel!=null&&localChannel!=null){
final String remoteNumber = remoteChannel.substring(0,remoteChannel.indexOf("-"));
JPanel panel = new JPanel();
answerButton = new JButton("Ответить");
answerButton.a... | 2 |
JComponent getBankingTab() {
JPanel inner = new JPanel(new GridBagLayout());
GridBagConstraints innerConstraints = new GridBagConstraints();
innerConstraints.fill = GridBagConstraints.BOTH;
innerConstraints.gridx = 0;
innerConstraints.gridy = 0;
innerConstraints.weightx = 1;
innerConstraints.gridwidth = ... | 5 |
@AfterClass
public static void tearDownClass() {
} | 0 |
public static Storyboard findStoryboardById(ArrayList<Storyboard> storyboards, int id) {
for(Storyboard storyboard:storyboards) {
if(storyboard.getId()==id) {
return storyboard;
}
}
return new Storyboard();
} | 2 |
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource() == browse) {
JFileChooser chooser = new JFileChooser();
int approve = chooser.showOpenDialog(null);
if(approve == JFileChooser.APPROVE_OPTION) {
File selectedFile = chooser.getSelectedFile();
... | 7 |
@Override
protected void finalize() throws Throwable {
stat.close();
conn.close();
super.finalize();
} | 0 |
protected void applyToTitle(Title title) {
if (title instanceof TextTitle) {
TextTitle tt = (TextTitle) title;
tt.setFont(this.largeFont);
tt.setPaint(this.subtitlePaint);
}
else if (title instanceof LegendTitle) {
LegendTitle lt = (LegendTitle) ti... | 9 |
@Override
public void deleteDirectory(String directory)
{
if (!dirEntries.containsKey(directory.toLowerCase())) return;
DirEntry de = dirEntries.get(directory.toLowerCase());
DirEntry parent = de.parentDir;
if (parent != null)
parent.childrenDirs.remove(de);
... | 4 |
public static void main(String[] args) {
Socket clientSocket = null;
DataInputStream in = null;
PrintStream out = null;
DataInputStream inputLine = null;
//open a socket on port 6001
try {
clientSocket = new Socket("localhost", 6001);
out = new PrintStream(clientSocket.getOutpu... | 9 |
public boolean ModificarTrabajo(Trabajo p){
if (p!=null) {
cx.Modificar(p);
return true;
}else {
return false;
}
} | 1 |
private void execute() {
if(newWorkspace == null && removedImports.size() == 0) {
for(String newImport : addedImports) {
doImport(newImport);
}
imported.addAll(addedImports);
addedImports.clear();
if(imported.size() > 0 && reloadImportButton != null)
reloadImportButton.setEnabled(true);
... | 9 |
static final public void instruction() throws ParseException {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ident:
affectation();
break;
case LIRE:
lecture();
break;
case ECRIRE:
case ALALIGNE:
ecriture();
break;
case SI:
conditionnelle();
break;
... | 8 |
public void setLoaded(boolean loaded) {
this.loaded = loaded;
} | 0 |
public GameWindow(Game game) {
boolean test = false;
if (test || m_test) {
System.out.println("GameWindow :: GameWindow() BEGIN");
}
boolean m_Trace = false;
if(m_Trace) System.out.println
("GameWindow::GameWindow() - window initializing");
if(m_Trace) System.out.println
("GameWin... | 7 |
public static Properties readConf(String s) {
File f = new File(s);
System.out.println(s);
if (f.exists() && f.canRead()) {
try {
String s1 = null;
BufferedReader read = new BufferedReader(new FileReader(f));
while ((s1 = read.readLine()) != null) {
if (s1.startsWith("#")) {
} els... | 5 |
@Override
protected void drawData(Graphics g) {
if(graphValues == null) return;
int X, Y;
int lastX = Integer.MIN_VALUE;
int highestValue = bufferYmax;
int lowestValue = bufferYmin;
if (lowestValue <= highestValue){
//jLabelVMin... | 8 |
public void selectSize(int x,int y)
{
for(int i=0;i<markers;i++)
{
marker[i].selectSize(x, y);
}
} | 1 |
@SuppressWarnings("resource")
public void serverStart() throws Exception {
System.out.println("Server started");
ServerSocket serverSocket = new ServerSocket(5432);
LinkedList<Socket> clientSockets = new LinkedList<Socket>();
ArrayList<PrintWriter> outArrayList = new ArrayList<PrintWriter>();
int coun... | 6 |
public void setUsername(String username) {
this.username = username;
} | 0 |
public void setRpcPass(String rpcPass) throws InvalidSettingException {
if (rpcPass != null) {
this.rpcPass = rpcPass;
} else {
throw new InvalidSettingException("Invalid Password");
}
} | 1 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 3 |
@Test ( timeout = 2000 )
public void serverWriteToSocketClosedByServer () throws Exception {
Socket[] sockets = connectToServer();
try ( Socket serverSocket = sockets[ 0 ];
Socket clientSocket = sockets[ 1 ] ) {
serverSocket.close();
// wait for close to propag... | 1 |
public JobSchedulerBuilder withStoreDurably( boolean storeDurably )
{
this.storeDurably = storeDurably;
return this;
} | 0 |
public <T extends IMessage>void addHandler(final Class<T> type, final IMessageHandler<T> handler) {
List<IMessageHandler<? extends IMessage>> handlers = handlersByMessage.get(type);
if (handlers == null) {
handlers = new ArrayList<IMessageHandler<? extends IMessage>>();
... | 4 |
ClientSideView( int portNum, String host )
{
eventMapper = new EventMapper( new ClientActionConfigurator().getConfigurator());
text = new JLabel( "Text to send over socket:" );
textField = new JTextField( 20 );
button = new JButton( "Click Me" );
webSocketPortOpener = new JButton( "Open web-socket port" );
... | 3 |
private synchronized boolean checkPulse(Peer p){
return p.hasPulse()? true:false;
} | 1 |
protected double objectiveFunction() throws NNException {
double result = 0;
for (Pattern<?,?> pattern : patterns) {
List<Double> processed = network.process(pattern.getInputSignal());
for (int i = 0; i < processed.size(); i++) {
result += Math.pow(processed.get(i).doubleValue() - pattern.getOutputSignal(... | 4 |
@Override
public int attack(double agility, double luck) {
System.out.println("I did a default skill attack");
return (int) agility;
} | 0 |
public void onEndPage(PdfWriter writer, Document document) {
if (this.numberPos > 0) {
float width = document.getPageSize().getWidth();
float height = document.getPageSize().getHeight();
try {
if (total == null)
total = writer.getDirectContent().createTemplate(30, 16);
if (this.hasTotleNumber)
... | 9 |
public Expression mergeIntoExpression(Expression expr) {
/* assert expr.getFreeOperandCount() == stackMap.length */
for (int i = stackMap.length - 1; i >= 0; i--) {
// if (!used.contains(stackMap[i]))
// used.addElement(stackMap[i]);
expr = expr.addOperand(new LocalLoadOperator(stackMap[i].getType(),
... | 1 |
public void create(PypAdmAgend pypAdmAgend) {
if (pypAdmAgend.getPypAdmAsistConList() == null) {
pypAdmAgend.setPypAdmAsistConList(new ArrayList<PypAdmAsistCon>());
}
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
... | 9 |
@Override
public void paint(Graphics2D g2d) {
super.paint(g2d);
g2d.setColor(Color.CYAN);
g2d.drawString("R:"+salud, x, y+50);
if(salud <= 10 && vidas > 0){
g2d.setColor(Color.LIGHT_GRAY);
g2d.drawString("v:"+vidas, x, y+10);
}
} | 2 |
public void setRoomEventList(final List<RoomEvent> roomEventList) {
this.roomEventList = roomEventList;
} | 0 |
private void updateALUTable(){
//Get a copy of the memory stations
ALUStation[] temp_alu = sim_instance.getALUStations();
//Update the table with current values for the stations
for( int i =0; i < temp_alu.length; i++ ){
//generate a meaningfull repre... | 5 |
public static void main(String[] args) {
System.out.println("Starting client...");
// Parse and set command-line arguments
try {
parseCommandLineArguments(args);
} catch (IllegalArgumentException iae) {
System.err.println("Error parsing port number: " + iae.getLoc... | 3 |
public static void main(String[] args) throws Exception {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String linea;
while((linea=bf.readLine())!=null){
String[] boxes = linea.split(" ");
long totalCajas = 0 ;
for(int i=0;i<boxes.length;++i){
totalCajas += Integer.parseIn... | 7 |
public String getAuthor() {
return this.author == null ? "" : this.author;
} | 1 |
public static void main(String[] args) {
creator1 = new ConcreteCreator1();
product1 = creator1.factory();
creator2 = new ConcreteCreator2();
product2 = creator2.factory();
} | 0 |
public void mouseDragged(MouseEvent e){
x = e.getX();
y = e.getY();
} | 0 |
public void sort(SortArray a, SortCanvas c) {
int j;
int limit = a.length();
int st = 0;
while (st < limit) {
boolean flipped = false;
st++;
limit--;
for (j = st; j < limit; j++) {
if (a.greater(j, j + 1)) {
a.swap(j, j+1);
flipped = true;
}
c.paintNumbers();
}
if (!flip... | 7 |
public void buildAssociations(Instances instances) throws Exception {
Frame valuesFrame = null; /* Frame to display the current values. */
/* Initialization of the search. */
if (m_parts == null) {
m_instances = new Instances(instances);
} else {
m_instances = new IndividualInstances(new I... | 7 |
public void ForgotPassword(RequestPacket request, DBCollection coll, User user) {
try {
// Check that given username and email match a record in DB
DBCursor cursor = coll.find(new BasicDBObject("user_name", request.getUser_name()));
if(cursor.hasNext()) {
if(request.getEmail().equalsIgnoreCase(((BasicDBO... | 3 |
public void createHuffTree()
{
while(items > 2)
{
Node first = removeFirst();
Node second = removeFirst();
Node newNode = new Node(first.frequency + second.frequency, -1);
newNode.left = first;
newNode.right = second;
first.next = first.prev = second.next = second.prev = null;
insert(newNo... | 1 |
public synchronized void stop() {
running = false;
try {
thread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
} | 1 |
public static void save(String filename, double[] input) {
// assumes 44,100 samples per second
// use 16-bit audio, mono, signed PCM, little Endian
AudioFormat format = new AudioFormat(SAMPLE_RATE, 16, 1, true, false);
byte[] data = new byte[2 * input.length];
for (int i = 0; i... | 6 |
public void doAll() {
// TODO Auto-generated method stub
switch (currentStep) {
case CREATE_SINGLE_TRAPSTATE:
JOptionPane.showMessageDialog(frame,
"Just create a state.\nIt's not too difficult.",
"Create the State", JOptionPane.ERROR_MESSAGE);
return;
}
for (Integer key:myNeededTransitionMap.key... | 3 |
private JFileChooser setFilters(JFileChooser jfc, boolean predefined, String comment, String extension) {
if (predefined ||
!jfc.getFileFilter().getDescription().equalsIgnoreCase("Todos los Archivos")) {
jfc.setAcceptAllFileFilterUsed(false);
}
FileNameExtensionFilte... | 3 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if((affected==null)||(!(affected instanceof MOB))||(target==null))
return true;
final MOB mob=(MOB)affected;
if(mob.location()!=target.location())
unInvoke();
if(mob.getVictim()!=target)
unInvoke();
if(mob.rangeToTar... | 7 |
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(Locale locale, Model model) {
logger.info("Welcome home! The client locale is {}.", locale);
Date date = new Date();
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
String formatt... | 0 |
public void log(String content) {
try {
if ( !Files.exists(dir, LinkOption.NOFOLLOW_LINKS) )
Files.createDirectory(dir);
content += System.getProperty("line.separator");
Files.write(file, content.getBytes(), StandardOpenOption.CREATE,
... | 2 |
public void print(List<String> IdsToStrings,String pad) {
Iterator<T> uniIter=UnigramCounts.keySet().iterator();
T myValue;
Double myVal;
int getVal;
if (pad==null) {
pad="";
}
while (uniIter.hasNext()) {
myValue=uniIter.next();
myVal=UnigramCounts.g... | 5 |
private static boolean available(int port) {
if (port < MIN_PORT_NUMBER || port > MAX_PORT_NUMBER) {
throw new IllegalArgumentException("Invalid start port: " + port);
}
ServerSocket ss = null;
DatagramSocket ds = null;
try {
ss = new ServerSocket(port);
ss.setReuseAddress(true);
ds = new Datagra... | 6 |
@Override
public List<Integer> save(List<Order> beans, GenericSaveQuery saveGeneric, Connection conn) throws DaoQueryException {
try {
return saveGeneric.sendQuery(SAVE_QUERY, conn, Params.fill(beans, (Order bean) -> {
Object[] obj = new Object[8];
obj[0] = bean.g... | 1 |
public PanelValidationReservation(JFrame frame, List<Reservation> listeReservations) {
SimpleDateFormat formatterDeb = new SimpleDateFormat("'Le 'dd/MM/yyyy' de 'HH'h '");
SimpleDateFormat formatterFin = new SimpleDateFormat("HH");
infosPaiement = null;
Date dateReservation = null;
int duree;
dateReservati... | 7 |
private static void getCommand() {
System.out.print("[Moves:" + moves + " Score:" + score + " Ratio:" + ratio + " Possible directions:" + possibleDirs + "] ");
Scanner inputReader = new Scanner(System.in);
command = inputReader.nextLine();
} | 0 |
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.