text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
protected TreeRow clone() {
try {
TreeRow other = (TreeRow) super.clone();
other.mParent = null;
other.mIndex = 0;
return other;
} catch (CloneNotSupportedException exception) {
return null; // Not possible
}
} | 1 |
@Override
public void update(int delta) {
cube.move(SPEED*direction*delta,0, 0);
pos.add(SPEED*direction*delta,0, 0);
if(pos.x > 100){
pos.x = 100;
direction *= -1;
}
if(pos.x < -100){
pos.x = -100;
direction *= -1;
}
} | 2 |
public static void stream_align(FlaggableCharacterString input_stream,
Vector<AlignmentTuple> alignments,
Vector<AlignmentTriplet> triplets) {
for (AlignmentTuple alignment : alignments) {
// copy strings
FlaggableCharacterString presented = alignment.getPresented();
FlaggableCharacterString trans... | 6 |
@Override
protected void UpdateProductPassingThrough()
{
List<Product> productsAtExit = new LinkedList();
for (NodeStartPoint entrancePoint : m_listNodeStartPoint)
{
for (Product product : entrancePoint.GetBallot().GetProduct())
{
if (Cont... | 3 |
public boolean HasItemAmount(int itemID, int itemAmount) {
int playerItemAmountCount = 0;
for (int i=0; i<playerItems.length; i++)
{
if (playerItems[i] == itemID+1)
{
playerItemAmountCount = playerItemsN[i];
}
if(playerItemAmountCount >= itemAmount){
... | 3 |
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext(
"applicationContext.xml");
IMusicBox musicBox = (IMusicBox) context.getBean("musicBox");
musicBox.play();
} | 0 |
public boolean isHigherOnActivitySeries(Element element)
{
if((this.isMetal() && !element.isMetal()) || (!this.isMetal() && element.isMetal()))
System.err.println("isHigherOnActivitySeries - One element is a metal and the other isn't!");
if(this.equals(element))
System.err.println("isHigherOnActivitySerie... | 8 |
public void handle(HttpExchange exchange) throws IOException {
OutputStream responseBody = exchange.getResponseBody();
Headers responseHeaders = exchange.getResponseHeaders();
responseHeaders.set("Content-Type", "text/plain");
exchange.sendResponseHeaders(200, 0);
switch(exchang... | 7 |
TreeNode buildTreeWithPreorderAndInorder(int[] preorder, int[] inorder,
int startPreOrder, int endPreOrder, int startInOrder, int endInOrder) {
// if startPreOrder out of range of preorder
if (startPreOrder >= preorder.length)
return null;
TreeNode root = new TreeNode(preorder[startPreOrder]);
int indexR... | 5 |
private void printJoins(Vector<LogicalJoinNode> js, PlanCache pc,
HashMap<String, TableStats> stats,
HashMap<String, Double> selectivities) {
JFrame f = new JFrame("Join Plan for " + p.getQuery());
// Set the default close operation for the window,
// or else the progra... | 8 |
@Override
public void deserialize(Buffer buf) {
super.deserialize(buf);
partyType = buf.readByte();
if (partyType < 0)
throw new RuntimeException("Forbidden value on partyType = " + partyType + ", it doesn't respect the following condition : partyType < 0");
maxParticipan... | 4 |
public static void drawCircle(Graphics g, int centerX, int centerY, int radius, Color color) {
g.setColor(color);
int x, y, d, dE, dSE;
x = 0;
y = radius;
d = 1 - radius;
dE = 3;
dSE = -2*radius+5;
simetry(g, x, y, centerX, centerY);
while (y > x) {
if (d < 0) {
d += dE;
dE += 2;
dSE... | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
IdentNode other = (IdentNode) obj;
if (identName == null) {
if (other.ide... | 6 |
public void ge_or_logical(TextArea area,SimpleNode node,String prefix,int cur_end_num,int if_or_while)throws SemanticErr{
int or_num = node.jjtGetNumChildren();
SimpleNode left = (SimpleNode)node.jjtGetChild(0);
if(or_num==1)or_last=2;
else or_last=-1;
ge_and_logical(area,left,pr... | 4 |
@Override
public int castingQuality(MOB mob, Physical target)
{
if(mob!=null)
{
if(target instanceof MOB)
{
final Room R=((MOB)target).location();
boolean found=false;
if(R!=null)
for(int r=0;r<R.numInhabitants();r++)
{
final MOB M=R.fetchInhabitant(r);
if((M!=null)&&(M!=mo... | 9 |
public static String getStringValue(String attr) {
return prop.getProperty(attr);
} | 0 |
public String getStatusFrequencyOverPartOfDay() {
Map<String, Integer> map = analytic.getStatusFrequencyOverPartOfDay();
StringBuilder sb = new StringBuilder();
List<Entry<String, Integer>> entries = new ArrayList<Entry<String, Integer>>(map.entrySet());
Collections.sort(entries, new Comparator<Entry<String,... | 1 |
double funct(double x[]) {
//RefreshDataHandles();
for (int j = 0; j < parameters.length; j++) {
try {
parameters[j] = x[j];
} catch (Exception e) {
throw new RuntimeException("Error! Parameter No. " + j + " wasn^t found" + e.toString());
... | 7 |
protected boolean isPrimitiveValue(Object value)
{
return value instanceof String || value instanceof Boolean
|| value instanceof Character || value instanceof Byte
|| value instanceof Short || value instanceof Integer
|| value instanceof Long || value instanceof Float
|| value instanceof Double || v... | 9 |
public String getPackageName() {
return this.packageName;
} | 0 |
public Document getDocument(String filePath){
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
Document document = null;
try{
//DOM parse instance
DocumentBuilder builder = builderFactory.newDocumentBuilder();
//parse an XML file into a DOM tree
document = builder.parse(... | 3 |
public Integer getTopDiskNo() {
return maxDisks - (disks.peek() - 1);
} | 0 |
@Override
public void close() {
if (readMonitor != stdin) {
try {
in.close();
} catch (IOException e) {
System.err.printf("Cannot close console input. %s: %s%n", getClass(), e.getMessage());
}
}
if (out != stdout) {
try {
out.close();
} catch (IOException e) {
System.err.printf("Ca... | 4 |
public void calculateStateSpace() {
/* Initialization */
PetriNet _net = petriNet;
//State _intialState=new State(_net.getState(), 0, null);
Trie _stateSpace = new Trie();
State _currentState;
State firstState;
firstState = new State(_net.getState(), 0, null, _ne... | 7 |
private Boolean checkLookAndFeel(String name)
{
try {
UIManager.setLookAndFeel(name);
return true;
} catch (ClassNotFoundException ex) {
Logger.getLogger(Window.class.getName()).log(Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
... | 4 |
private void waitForThread() {
if ((this.thread != null) && this.thread.isAlive()) {
try {
this.thread.join();
} catch (final InterruptedException e) {
e.printStackTrace();
}
}
} | 3 |
public ArrayList<Usuarios> getByNombre(Usuarios u){
PreparedStatement ps;
ArrayList<Usuarios> usuarios = new ArrayList<>();
try {
ps = mycon.prepareStatement("SELECT * FROM Usuarios WHERE nombre LIKE ?");
ps.setString(1, "%"+u.getNombre()+"%");
ResultSet rs = ... | 4 |
private void newSolve(ArrayList<Solve> population, int ind1, int ind2) {
Random rand = new Random();
Solve a = population.get(ind1);
Solve b = population.get(ind2);
Solve c = new Solve();
Solve d = new Solve();
int j = rand.nextInt(chromosomesize);
for (int i = 0;... | 2 |
@Override
public boolean isObstacle(Element e) {
if (e instanceof PowerFailure)
return false;
return true;
} | 1 |
private boolean isMatch(final char current, final Element element) {
boolean rv = false;
if (element.isSpecial) {
switch(element.item) {
case '.':
rv = true;
break;
case 'd':
rv = Character.isDigit(current);
break;
case 'D':
rv = !Character.isDigit(current);
break;
... | 9 |
@SuppressWarnings({ "unchecked", "static-access" })
public static void readXml() {
try {
SAXReader saxReader = new SAXReader();
File file = new File(xml);
if (file.exists()) {
Document doc = saxReader.read(file);
Element rootEle = doc.getRootElement();
List<Element> list = (List<Element>) rootEl... | 5 |
public ClassGeneratorUtil(Modifiers classModifiers, String className, String packageName, Class superClass, Class[] interfaces, Variable[] vars, DelayedEvalBshMethod[] bshmethods, NameSpace classStaticNameSpace, boolean isInterface) {
this.classModifiers = classModifiers;
this.className = className;
if (packageNa... | 6 |
public Boolean update(String query) {
if(autoCommit){
return updateIntern(query, false);
}
this.queries += query+="\n";
return null;
} | 1 |
private void quaff()
{
Grid<GridActor> gr = getGrid();
Location loc = getLocation(); // stores the current location of player
Location next = loc.getAdjacentLocation(0); // it chooses up by default
if(Greenfoot.isKeyDown("right") || Greenfoot.isKeyDown("l")) // player choos... | 8 |
public Tree andExpressionPro(){
Tree firstConditionalExpression = null, secondConditionalExpression = null;
Symbol operator = null;
if((firstConditionalExpression = equalityExpressionPro()) != null){
if((operator = accept(Symbol.Id.PUNCTUATORS,"&&")) != null){
if((secondConditionalExpression = andExpres... | 3 |
private boolean canProceed() throws SSLException {
while (true) {
switch (mEngine.getHandshakeStatus()) {
case NEED_TASK:
runSSLTasks();
break;
case NEED_UNWRAP:
switch (mEngine.unwrap(mInboundData, mAppData).getStatus()) {
case BUFFER_OVERFLOW:
resizeAppDataBuffer();
bre... | 9 |
public int getCapacity() {
return buf.length;
} | 0 |
private boolean isRepairMats(ItemStack i) {
if(i.getData().getItemType().equals(Material.WOOD))
return true;
if(i.getData().getItemType().equals(Material.STONE))
return true;
if(i.getData().getItemType().equals(Material.IRON_INGOT))
return true;
if(i.g... | 5 |
public static void main(String[] args) {
if (System.console() == null) {
System.err.println("Error: Not connected to compatible console");
System.exit(1);
}
File rc = new File(System.getProperty("user.home"), ".acmbotrc");
boolean firstTime = !rc.exists();
SmartBot bot = new SmartBot(rc.getAbsolutePath(... | 7 |
private boolean containsPrefixHelper(String s, int indexLow, int indexMid, int indexHigh){
if(LexiconArrayList.get(indexLow).startsWith(s) || LexiconArrayList.get(indexMid).startsWith(s) || LexiconArrayList.get(indexHigh).startsWith(s)){
return true;
}else if(s.compareTo(LexiconArrayList.get(indexLow)) < 0 || s.... | 9 |
@SuppressWarnings("unchecked")
WeekView(JFrame parent){
first = false;
// Sets look to that of the OS
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (ClassNotFoundException e) {
}
catch (InstantiationException e) {
}
catch (IllegalAccessException e) {
}
c... | 9 |
@EventHandler(priority = EventPriority.NORMAL)
public void onEntityChangeBlock(EntityChangeBlockEvent event) {
if (event.isCancelled())
return;
// plugin.debug(event.getEventName());
Block block = event.getBlock();
if (plugin.isProtected(block)) {
event.setCancelled(true);
plugin.debug("Blocking enty... | 2 |
public void comen2(char []codigo){
int let=0;
//Para eliminar el comentario /*
while(let<codigo.length-1){
if(codigo[let]=='/' && codigo[let+1]=='*'){
codigo[let] = ' ';
codigo[let+1] = ' ';
let++;
let++;
... | 7 |
private InfoDetail firstGranateForMe (InfoDetail me, List<InfoDetail> granates){
if(granates.isEmpty()){
return null;
}
InfoDetail granat=null;
for(int i=0; i<granates.size(); i++){
if(isForMe(me, granates.get(i))){
granat=granates.get(i);
... | 7 |
public static void question8() {
/*
QUESTION PANEL SETUP
*/
questionLabel.setText("Which of these words best describe you?");
questionNumberLabel.setText("8");
/*
ANSWERS PANEL SETUP
*/
//resetting
radioButton1.setSelected(false);
r... | 0 |
public int getTexture(String par1Str)
{
TexturePackBase var2 = this.texturePack.selectedTexturePack;
Integer var3 = (Integer)this.textureMap.get(par1Str);
if (var3 != null)
{
return var3.intValue();
}
else
{
try
{
... | 8 |
public String GrepUniqueID(String searchLink){
/*
* Gets the unique file ID (used to generate a .torrent location)
* This method also take server load/latency into account
*/
int searchLinkStart = 0;
int searchLinkEnd = 0;
int attempts = 0;
String uniqueID = "0000000000000000"; //loop atleast once.
... | 4 |
private static Long getMaxColumnProduct(int numbers) {
int max = Integer.MIN_VALUE;
for (int c = 0; c < DATA[0].length; c++) {
for (int r = 0; r + numbers < DATA.length; r++) {
int sum = 1;
for (int offset = 0; offset < numbers; offset++) {
... | 3 |
@Override
public void run() {
int size = 1024;
GZIPOutputStream gzipOutputStream = null;
try {
gzipOutputStream = new GZIPOutputStream(this.output, size);
} catch (IOException e1) {
System.err.println("\t\t\tFileCompress:IOException occurred while instantiating the GZIPOutputStream.");
this.finished =... | 9 |
public AutomatonPane getView(){
return myView;
} | 0 |
public SintomaFacade() {
super(Sintoma.class);
} | 0 |
public boolean equals(Vector2f r)
{
return m_x == r.GetX() && m_y == r.GetY();
} | 1 |
public String getInsertStatement(String book, int chapter) throws ParseException, IOException {
// String strBook = String.format("B%02d", book);
// String strChapter = String.format("C%03d", chapter);
// String strHtml = getOneChapterHtmlSource(ver, getBook/home/mark/bible/checking/bgpda/hb_1_0Cha... | 5 |
private void processAuctionEvent(AuctionEvent event) {
if (event.getType().equals(AuctionEvent.AUCTION_STARTED)) {
auctionList.add(event);
}
if (event.getType().equals(AuctionEvent.AUCTION_ENDED)) {
// AVG- Duration
if (avgAuctionDurationTimeEvent == null) {
Timestamp currentTimestamp = new Timesta... | 7 |
public void startRippingSelected() {
if(getTabel().isTHSelected()) {
Stream[] streamsToRecord = table.getSelectedStream();
for( int i=0 ; i <streamsToRecord.length; i++) {
if (streamsToRecord[i] == null) {
JOptionPane.showInputDialog(trans.getString("exeError"));
} else {
if(!streamsToReco... | 5 |
@Override
public String getTableName(String fileName) {
String line = "";
log.info("Start to read table name in "+fileName+"... ...");
//GET Table Name
try {
FileReader fr = new FileReader(new File(artificialFolderPath+"/"+fileName));
BufferedReader br = new BufferedReader(fr);
//#后为TableName
while ... | 5 |
@Override
public void actionPerformed(ActionEvent e) {
JButton reduire = (JButton) e.getSource();
System.out.println("Reduire vitesse");
new Thread(new Runnable() {
public void run() {
try { Main.service.diminuerVitesse(bus); }
catch (IOException e) { e.printStackTrace(); }
}
}).start();
} | 1 |
@Override
public void open() throws AudioException {
super.open();
DataLine.Info info = new DataLine.Info(
this.mTargetDataLineClass,
this.mAudioFormat
);
try {
if ( !this.mMixer.isOpen() ) {
this.mMixer.open();
this.mOpenedMixer = true;
}
this.mTargetDataLine = (TargetDataLine) this.m... | 3 |
public void tick(Graphics2D g) {
for (Tank tank : GameState.getInstance().getPlayers()) {
if (tank.getNick() == null)
tank.setNick("Player");
}
if (inputReal.menu.clicked) {
inputReal.menu.clicked = false;
inputReal.releaseAll();
if (!menuTitle.isVisible()) {
menuTitle.setVisible(true);
m... | 5 |
public static void main(String[] args) {
List<Integer> arrayList = new ArrayList<Integer>();
arrayList.add(10);
arrayList.add(3);
arrayList.add(7);
arrayList.add(5);
System.out.println("arrayList: " + arrayList);
List<Integer> linkedList = new LinkedList<Integer>(... | 0 |
private static String initialise(Token currentToken,
int[][] expectedTokenSequences,
String[] tokenImage) {
String eol = System.getProperty("line.separator", "\n");
StringBuffer expected = new StringBuffer();
int maxSize = 0;
for (int i = 0; i < expe... | 8 |
public static Connection getConnection() throws SQLServerException {
if (m_connection == null) // first time
{
SQLServerDataSource ds = new SQLServerDataSource();
ds.setApplicationName("jdbc:sqlserver://");
//ds.setServerName("10.211.55.8");
ds.setServerN... | 1 |
final void A(int i, aa var_aa, int i_145_, int i_146_) {
aa_Sub3 var_aa_Sub3 = (aa_Sub3) var_aa;
int[] is = ((aa_Sub3) var_aa_Sub3).anIntArray5201;
int[] is_147_ = ((aa_Sub3) var_aa_Sub3).anIntArray5202;
int i_148_;
if (((SoftwareToolkit) this).height < i_146_ + is.length)
i_148_ = ((SoftwareToolkit) this).he... | 7 |
final public void Address() throws ParseException {
/*@bgen(jjtree) Address */
ASTAddress jjtn000 = new ASTAddress(JJTADDRESS);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
AddExp();
jj_consume_token(AT);
Domain();
} catch (Throwable jjte000) {
if (jjtc000) {
... | 8 |
private PropertiesLoader(String propertiesFilePath) throws IOException {
properties = new Properties();
try(FileInputStream file = new FileInputStream(propertiesFilePath)) {
properties.load(file);
} catch (IOException e) {
String errMsg = String.format("Properties file i... | 1 |
public static void fillItemArr(double itemArray[][], int itemNumber[], boolean bError, Scanner scan){
for(int i=0; i<4; i++){
bError = true;
System.out.print("Insert cost of item " + itemNumber[i] + " ($): ");
while(bError){
if(scan.hasNextDouble()){
itemArray[0][i] = scan.nextDouble();
}
el... | 6 |
public boolean equalsExpr(final Expr other) {
return (other != null) && (other instanceof InstanceOfExpr)
&& ((InstanceOfExpr) other).checkType.equals(checkType)
&& ((InstanceOfExpr) other).expr.equalsExpr(expr);
} | 3 |
public static String diffStr(String s1, String s2) {
// Create a string indicating differences
int minLen = Math.min(s1.length(), s2.length());
char diff[] = new char[minLen];
for (int j = 0; j < minLen; j++) {
if (s1.charAt(j) != s2.charAt(j)) {
diff[j] = '|';
} else diff[j] = ' ';
}
return new ... | 2 |
public void BacaCSVAll(String filePath) throws FileNotFoundException, IOException{
File theFile = new File(filePath);
FileReader readerFile = new FileReader(theFile);
BufferedReader bufReadFile = new BufferedReader(readerFile);
String readByte;
int pencacah = 0... | 3 |
public The5zigModUser getUser() {
return user;
} | 0 |
private final byte[] method2371() {
int i = 0;
for (int i_2_ = 0; i_2_ < 10; i_2_++) {
if (aClass80Array3969[i_2_] != null
&& (((Class80) aClass80Array3969[i_2_]).anInt1421
+ ((Class80) aClass80Array3969[i_2_]).anInt1407) > i)
i = (((Class80) aClass80Array3969[i_2_]).anInt1421
+ ((Class80) aClas... | 8 |
public void setLieu(String lieu) {
this.lieu = lieu;
} | 0 |
private static Result toResult(Object xml) throws IOException {
if (xml == null)
throw new IllegalArgumentException("no XML is given");
if (xml instanceof String) {
try {
xml = new URI((String) xml);
} catch (URISyntaxException e) {
xm... | 9 |
private void addAllAttributes(String shaderText) {
final String ATTRIBUTE_KEYWORD = "attribute";
int attributeStartLocation = shaderText.indexOf(ATTRIBUTE_KEYWORD);
int attribNumber = 0;
while (attributeStartLocation != -1) {
if (!(attributeStartLocation != 0
... | 5 |
@SuppressWarnings("unchecked")
private Collection<KnowledgePackage> downloadFromGuvnor(String packageId, String version) throws IOException, ClassNotFoundException{
UrlResource res=(UrlResource)ResourceFactory.newUrlResource(new URL(basePath+packageId+"/"+version));
if (enableBasicAuthentication){
res.s... | 9 |
@Override
public boolean consumeFuel(int amount)
{
final List<Item> fuel=getFuel();
boolean didSomething =false;
for(final Item I : fuel)
{
if((I instanceof RawMaterial)
&&(!I.amDestroyed())
&&CMParms.contains(this.getConsumedFuelTypes(), ((RawMaterial)I).material()))
{
amount-=CMLib.materials... | 8 |
private boolean isExcluded(String name) {
return name.startsWith(ClassMetaobject.methodPrefix)
|| name.equals(classobjectAccessor)
|| name.equals(metaobjectSetter)
|| name.equals(metaobjectGetter)
|| name.startsWith(readPrefix)
|| name.startsWith(write... | 5 |
private boolean r_Step_4() {
int among_var;
int v_1;
// (, line 140
// [, line 141
ket = cursor;
// substring, line 141
among_var = find_among_b(a_7, 18);
if (among_var == 0)
... | 9 |
public static void main(String[] args) {
try {
TextComponent text = (TextComponent) new BookReader().read("text.txt");
System.out.println(new ComponentConverter().componentToString(text));
System.out.print("Sentencis with the same words: ");
System.out.println(new SameWordsFinder(text).getSentenceCount())... | 1 |
public int countGenerators(String[] fragment, int W, int i0, int j0){
int n = fragment.length;
int m = fragment[0].length();
int result=0;
for(int l=1; l<=W; l++){
char[] string = new char[l];
boolean valid = true;
int filledCount = 0;
for(... | 7 |
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
String msj_error = "Error al exportar consulta";
HttpSession ... | 2 |
private int fillbuf() throws IOException {
if (markpos == -1 || (pos - markpos >= marklimit)) {
/* Mark position not set or exceeded readlimit */
int result = in.read(buf);
if (result > 0) {
markpos = -1;
pos = 0;
count = result... | 9 |
public Point getInitialResizePoint() {
return initialResizePoint;
} | 0 |
private String getMimeType(String request) {
if(request.endsWith(".html") || request.endsWith(".htm"))
return "text/html";
else if(request.endsWith(".css"))
return "text/css";
else if(request.endsWith(".js"))
return "text/javascript";
else if(request.endsWith(".jpg") || request.endsWith("... | 8 |
private void pop(char c) throws JSONException {
if (this.top <= 0) {
throw new JSONException("Nesting error.");
}
char m = this.stack[this.top - 1] == null ? 'a' : 'k';
if (m != c) {
throw new JSONException("Nesting error.");
}
this.top -= 1;
... | 5 |
public static int sum(List<? extends Number> numbers){
int sum = 0;
for(Number number: numbers){
sum += number.doubleValue();
}
return sum;
} | 2 |
public String getFlagStr(){
if (this.getFlag()==1) return "SYN";
if (this.getFlag()==2) return "FIN";
if (this.getFlag()==3) return "PSH";
if (this.getFlag()==4) return "ACK";
if (this.getFlag()==5) return "SYN_ACK";
return "";
} | 5 |
@Override
public void run() {
if(inputFile.length() < inputSize/BYTESIZE) {
System.out.println("Input too short, check inputfile");
return;
}
byte[] bytesRead = getBytesFromFile();
BitString input = byteArrayToBitSet(bytesRead);
if (mode.equals(Driver.EVAL_FAIRPLAY_IA32)) {
input = input.getIA32Bi... | 5 |
private boolean moveable(int destx, int desty) {
if (destx<0||desty<0) {return false;}
if (destx>=Game.map.width||desty>=Game.map.height) {return false;}
if (Pathed(destx,desty)) {return true;}
return false;
} | 5 |
public void deleteCustomer(int id) {
Connection con = null;
Statement stmt = null;
try {
DBconnection dbCon = new DBconnection();
Class.forName(dbCon.getJDBC_DRIVER());
con = DriverManager.getConnection(dbCon.getDATABASE_URL(),
dbCon.getDB... | 4 |
public String toString(String input) {
return _base+"^("+input+")";
} | 0 |
public static String deleteWhitespace(String str)
{
if (isEmpty(str))
{
return str;
}
int sz = str.length();
char[] chs = new char[sz];
int count = 0;
for (int i = 0; i < sz; i++)
{
if (!Character.isWhitespace(str.charAt(i)))
... | 4 |
public void testLigne(int lig, int col, String nom) {// a renommer en
// lecture
System.out.println("lig: " + lig + " col:" + col + " nom: " + nom);
setChanged();
notifyObservers();
} | 0 |
public static void main(String[] args) {
DeleteAll de = new DeleteAll();
de.delAll1(new File("D:/aaa"));
// de.delAll( "D:/aaa/sdagsda");
} | 0 |
@Override
public void notifyObservers() {
ModelChangedEventArgs args = new ModelChangedEventArgs(
this.getChildren());
for (IObserver observer : this.observers) {
observer.updateObserver(args);
}
} | 1 |
public static int evaluate(String [] expr) {
LinkedList<String> stack = new LinkedList<>();
String operators = "+-*/";
for(String symbol : expr ) {
if(!operators.contains(symbol)) {
stack.push(symbol);
} else {
if(stack.size() >=2) {
... | 8 |
@Override
public void run()
{
String input;
StringTokenizer idata;
int i, j;
int counter = 0;
input = Main.ReadLn(255);
while ((input != null) && !input.equals(""))
{
idata = new StringTokenizer(input);
i = Integer.parseInt(idata.n... | 5 |
public void toggleRowOpenState() {
boolean first = true;
boolean open = true;
for (int i = 0; i < mRows.size(); i++) {
Row row = getRowAtIndex(i);
if (row.canHaveChildren()) {
if (first) {
open = !row.isOpen();
first = false;
}
row.setOpen(open);
}
}
} | 3 |
public JSONWriter key(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null key.");
}
if (this.mode == 'k') {
try {
this.stack[this.top - 1].putOnce(string, Boolean.TRUE);
if (this.comma) {
... | 4 |
public void updateUniforms(Matrix4f worldMatrix, Matrix4f projectedMatrix, Material material)
{
if(material.getTexture() != null)
material.getTexture().bind();
else
RenderUtil.unbindTextures();
setUniform("transform", projectedMatrix);
setUniform("color", material.getColor());
} | 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.