text
stringlengths
14
410k
label
int32
0
9
public boolean isSimplified(){ if(this.top instanceof Number && this.bottom instanceof Number){ Number top = (Number) this.top; Number bottom = (Number) this.bottom; //if they aren't whole numbers or top or bottom is negative if(top.getDecimal() != null || bottom.getDecimal() != null || !bottom.sign() || ...
7
public double getActionAngle(Instance vision, String angleType) throws Exception { if (angleType == StringUtil.KICK_ANGLE && kickAngleCls != null) { return kickAngleCls.classifyInstance(vision); } else if (angleType == StringUtil.TURN_ANGLE && turnAngleCls != null) { return turnAngleCls.classifyInstance(visio...
6
public static void main(String[] args) { if (args.length == 5) { double totalElapsedTime; StopWatch programRunning = new StopWatch(); DataLoader dl; Instances data = null; try { dl = new DataLoader(args[0]); data = dl.instancesLoader(); } catch (FileNotFoundException e) { e.printStac...
9
@Override public void remove(int i) { for(int j = i; j<=this.size;j++){ this.keys[j] = this.keys[j+1]; } this.size--; }
1
@Override public String toString() { String lsAttrs = ""; for (int i = 0; caAttributes != null && i < caAttributes.size(); i++) { lsAttrs += " " + caAttributes.get(i).toString(); } StringBuilder builder = new StringBuilder(); builder.append("ROOM [attributeid=");...
3
public void insert(String table, String name[], String value[]) { if(name.length != value.length){ String message = "not the same length"; throw new RangeException((short) 0, message); } try { con = DriverManager.getConnection(url, user, password); String questionMarkStm = ""; String stm = null; ...
8
public void abort() { mStarted = 0; for (File file : mFiles.values()) { file.delete(); } mFiles.clear(); }
1
public void setSolIdElemento(Integer solIdElemento) { this.solIdElemento = solIdElemento; }
0
@Override protected void act() { if(state == State.START) { Robot.getInstance().getMotion().getPilot().setRotateSpeed(180); poses.add(new Pose(80, 0, 0)); chaine.add("BlackY"); poses.add(new Pose(30, 0, 0)); chaine.add("BlackY"); poses.add(new Pose(-20, 0, 0)); chaine.add("BlackY"); poses.add...
7
private void initializeEconomy() { if (plugin.getServer().getPluginManager().getPlugin("Vault") == null) { throw new IllegalStateException("Vault plugin not found!"); } RegisteredServiceProvider<Economy> provider = plugin.getServer().getServicesManager().getRegistrati...
3
final public void setHeader(String firstLine, String... additionalLines) { header.clear(); header.add(firstLine); if (additionalLines != null) { for (String line : additionalLines) { header.add(line); } } onChange(); }
2
public SerializedCodec(XMLCodec xmlcodec) { this.xmlcodec = xmlcodec; }
0
@SuppressWarnings("unused") private static void checkTime() { long pre = System.nanoTime(); // 計測対象の処理 for (int i = 0; i < 100; i++) { System.out.println("hello"); } long post = System.nanoTime(); NumberFormat nf = NumberFormat.getNumberInstance(); System.out.println("[" + nf.format((post - pre)/...
1
@Override public boolean keyDown(int keycode) { if (keycode == Keys.ESCAPE) { ((Game) Gdx.app.getApplicationListener()).setScreen(new MainMenu( game)); } switch (keycode) { case Keys.W: break; } switch (keycode) { case Keys.S: break; } switch (keycode) { case Keys.A: break; } s...
5
private boolean saveFile(String filename) { boolean success; String editorString; FileWriter fwriter; PrintWriter outputFile; try { fwriter = new FileWriter(filename); outputFile = new PrintWriter(fwriter); editorString = editorText.getText(); outputFile.print(editorString); outpu...
1
public DefaultMutableTreeNode getTreeList() { DefaultMutableTreeNode parent = new DefaultMutableTreeNode(Integer.toString(currentId) + " - " + getType(getInterface().id, getInterface().type), true); treeModel = new DefaultTreeModel(parent); if (getInterface() != null) { if (getInterface().children != null) { ...
5
public static void main ( String[] args ) { // test default constructor ArrayLinearList<Integer> x = new ArrayLinearList<>( ); // test size System.out.println( "Initial size is " + x.size( ) ); // test isEmpty if( x.isEmpty( ) ) System.out.println( "The list is empty" ); else System.o...
5
private void checkModelFieldExist(Class<?> queryParamsClass, Class<?> modelClass) throws Exception { StringBuilder modelFieldErroMsg = new StringBuilder(); for (Field callField : queryParamsClass.getDeclaredFields()) { QueryCondition conditionAnno = callField .getAnnotation(QueryCondition.class); ...
9
@Override public void collideWith(Element e) { super.collideWith(e); if (e instanceof IdentityDisc) dropFlagOnAdjacentPosition(getGrid().getElementPosition(this)); }
1
public static int[] convert(String s,int len){ //a = 97, A = 65, difference = 32 int defaul[] = {62}; int st[] = new int[len]; for(int i = 0; i < len; i++){ int val = (int)(s.charAt(0)); int value = 0; if(val>= 65){ if(val < 91); else if(val < 97){ ...
9
boolean checkValidFeedback(String feedback){ try { check(feedback.length() == 4); check(feedback.charAt(1) == 'b'); check(feedback.charAt(3) == 'w'); int b = feedback.charAt(0) - '0'; int w = feedback.charAt(2) -'0'; check(b <= CL && b >= 0); check(w <= CL && w >= 0); check(b...
4
public MyList ownees(String player) { MyList ownees = new MyList(); if (!(player == null || player.equals("red") || player.equals("blue") )) return null; // Iterate over all Hexpos's Set set = owner.keySet(); Iterator it = set.iterator(); while (it.hasNext()) { Hexpos hp = (Hexpos) it.next(); if...
6
public int longestConsecutive(int[] num) { int n = num.length; if (n<=1){ return n; } HashMap<Integer,Integer> checkBox = new HashMap<Integer,Integer>(); for (int i = 0;i<n;i++) { checkBox.put(num[i],1); } int result = 1; for (int ...
7
private static <T> ArrayList<T> newArrayList(List<T> values) { if (values != null) { return new ArrayList<T>(values) ; } else { return new ArrayList<T>(); } }
1
@Override public void handle(SocketConnection connection, String[] params, PrintWriter printWriter) { try { int id = Integer.parseInt(params[1]); if(ServerCore.instance().connections.get(id) != null) { printWriter.println("Information on user " + id + ":"); printWriter.println("Username: " + (Serve...
8
public boolean startNewTourn(final GUI g) { if (gameTask != null) { gameTask.cancel(true); } gameTask = gameExecutor.submit(new Runnable() { @Override public void run() { winners = runTournament(g); } }); return tru...
1
private Double rankDiffSwapThreeCards() { Double rankdiff = 0.0; int bestcardoneindex = 0; int bestcardtwoindex = 0; int bestcardthreeindex = 0; Card bestcardtoswapcardone; Card bestcardtoswapcardtwo; Card bestcardtoswapcardthree; for (int i = 0; i < hand.size() - 2 ; i++) for (int j = i+1; j...
4
private CodeRunResult runExecuteMethod(Object object, Method method) { CodeRunResult result = new CodeRunResult(); Runnable runnable = () -> { try { result.setFailedTestMessages((List<String>) method.invoke(object)); result.setCompleted(true); } c...
5
protected FlacAudioSubFrame(int predictorOrder, int channelNumber, FlacAudioFrame audioFrame) { this.predictorOrder = predictorOrder; this.audioFrame = audioFrame; this.blockSize = audioFrame.getBlockSize(); // Adjust sample size for channel number, if needed // TODO Is this the...
6
public boolean deleteTracking(Tracking tracking) throws AftershipAPIException,IOException,ParseException,JSONException{ String parametersExtra = ""; if(tracking.getId()!=null && !(tracking.getId().compareTo("")==0)){ parametersExtra = tracking.getId(); }else { ...
3
@Override public boolean hasNext() { try { if (!resultSet.isLast()) { return true; } } catch (SQLException e) { e.printStackTrace(); } return false; }
2
public static int climbStairs(int n) { if (n < 2) return n; int[] ways = new int[n + 1]; for (int i = 0; i <= n; i++) { if (i < 2) { ways[i] = 1; } else { ways[i] = ways[i - 1] + ways[i - 2]; } } return ways[n]; }
3
public static List<PDBStructure> reloadStructures(CyNetwork network, CyIdentifiable id, List<CDDHit> hits) { List<String> structures = getStructures(network, id); if (structures == null || structures.size() == 0) return null; List<PDBStructure> structureList...
6
private void print(Object o) { if (logWriter != null) { System.out.print(o); } }
1
public static SSLContext setupClientSSL(String cert_path, String cert_password, boolean trustAll) throws SSLConfigurationException { SSLContext sslContext=null; try { kmf = KeyManagerFactory.getInstance("SunX509"); KeyStore ks = p12ToKeyStore(cert_path, cert_password); kmf.init(ks, cert_password.toC...
6
public SaltAndPepperDialog(final Panel panel) { setTitle("Salt and pepper"); setBounds(1, 1, 250, 150); Dimension size = getToolkit().getScreenSize(); setLocation(size.width / 3 - getWidth() / 3, size.height / 3 - getHeight() / 3); this.setResizable(false); setLayout(null); JPanel paramPanel = new JP...
6
public void addRestrictionToEvent(String eventIdentifier, String restrictionIdentifier) { //Get that restriction Restriction restrictionToAdd = null; for(Restriction r: restrictions){ if(r.getIdentifier().equals(restrictionIdentifier)) restrictionToAdd = r; ...
7
public static TableModel createTableModel(final CSTable src) { final List<String[]> rows = new ArrayList<String[]>(); for (String[] row : src.rows()) { rows.add(row); } return new TableModel() { @Override public int getColumnCount() { ...
2
@Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (sender.hasPermission("CreeperWarning.warn")) { if (args.length >= 2) { String prefix = CreeperWarningMain.chat.getPlayerPrefix((Player) sender); prefix = CreeperWarningMain.replaceChatColors(prefix); ...
8
public AnObject(int aField1, long aField2, Object internalObject) { this.aField1 = aField1; this.aField2 = aField2; this.internalObject = internalObject; }
0
public static Language load(String lang) throws FileNotFoundException, IOException, InvalidConfigurationException, IllegalArgumentException, IllegalAccessException { //Create the new language file that will be returned. Language l = new Language(); //Get the lines of the String[] lines = readFile(getLangua...
2
private static int applySpecialScore(String passwd) { int specials = 0; // SPECIAL CHAR Matcher m = Pattern.compile(".??[:,!,@,#,$,%,^,&,*,?,_,~]").matcher(passwd); while (m.find()) // [verified] at least one special character { specials += 1; } if (specials == 1) { log.debug("5 points for 1...
3
public boolean newRun() { Field f, f2; if(this.newVal > 0) { return false; } else{ for(int i = this.fieldSize; i < this.finishindex; i++) { f = pole.get(i); if(f.playerColor == player && f.figure != null) { ...
9
public BigDecimal getBigDecimal(BigDecimal defaultValue) { try { if (isNull()) { return defaultValue; } if (data instanceof Double) { return BigDecimal.valueOf((Double) data); } if (data instanceof Long) { return BigDecimal.valueOf((Long) data); } if (data instanceof Integer) { re...
6
public static void f() throws MyException { System.out.println("Throwing MyException from f()"); throw new MyException(); }
0
public config(){ String settings = fileHandler.readFile("config.jShare"); ArrayList<String> config = new ArrayList<String>(); if(!settings.isEmpty()){ Matcher m = Pattern.compile("\\{([^}]+)\\}").matcher(settings); while(m.find()) { config.add(m.group(1));...
9
public void mergeList(int a[], int start1, int end1, int start2, int end2) { int temp[] = new int[end1 - start1 + end2 - start2 + 2]; int ptr1 = start1, ptr2 = start2, ptrmain = 0; while (ptr1 <= end1 && ptr2 <= end2) { if (a[ptr1] < a[ptr2]) { temp[ptrmain++] = a[ptr...
7
public String escape(String in) { if (in==null) { return ""; } CharSequence collapsed = Whitespace.collapseWhitespace(in); StringBuffer sb = new StringBuffer(collapsed.length() + 10); for (int i=0; i<collapsed.length(); i++) { char c = collapsed.charAt(i);...
9
@Override public String toString() { StringBuilder sb = new StringBuilder(); for (String genVer : this) { String name = nameByVersion.get(genVer).replace('_', ' '); String ref = referenceByVersion.get(genVer); sb.append("\t" + genVer); sb.append("\t" + name); if (ref != null) sb.append("\t" + ref)...
2
public String toDiffString(String jobId) { String f1 = "%1$-3.0f"; String f2 = "%1$-3.1f"; float mOUdf = exOU - rmOU; float xOUdf = exOU - rxOU; float mNGUdf = exNGU - rmNGU; float xNGUdf = exNGU - rxNGU; float xHeapUdf = exHeapU - rxHeapU; float RSSdf = exHeapU - rxRSS; float mOUrt = rmOU == 0 ...
6
*/ void wordExtendBackwards( Variant v ) { char pc; int index = v.startIndex; int offset = v.startOffset; Pair p = pairs.get( index ); do { offset--; while ( offset < 0 || p.length() == 0 ) { index = previous( in...
6
protected Environmental[] makeTalkers(MOB s, Environmental p, Environmental t) { final Environmental[] Ms=new Environmental[]{s,p,t}; Ms[0]=getInvisibleMOB(); if(p instanceof MOB) { if(p==s) Ms[1]=Ms[0]; else Ms[1]=getInvisibleMOB(); } else if(p!=null) { Ms[1]=getInvisibleItem(); } ...
7
public static void main(String[] args) { System.out.println("testaticTstatic".intern() == new String("testaticTstatic").intern()); }
0
protected synchronized void doStart() throws Exception { log.info("Version "+Version.getImplVersion()); MultiException mex = new MultiException(); statsReset(); if (log.isDebugEnabled()) { log.debug("LISTENERS: "+_listeners); ...
9
public static void main(String[] args) { w = new Worker(); }
0
private boolean inside( int posX, int posY ){ if(posX>=this.posX && posX<=this.posX+this.width){ if(posY>=this.posY && posY<=this.posY+this.height){ return true; } } return false; }
4
private void flushSessions() { if (flushingSessions.size() == 0) return; for (;;) { DatagramSessionImpl session = flushingSessions.poll(); if (session == null) break; session.setScheduledForFlush(false); try { ...
7
public void handleRemoveInputAlphabetButton() { Object alphabet = startView.getInputAlphabetList().getSelectedValue(); if(startView.getInputAlphabetList().getSelectedIndex() != -1){ startView.getInputAlphabetItems().removeElement(alphabet); if(startView.getTapeAlphabetItems().contains(alph...
3
public boolean duplicateEntrySection(int x, int y, String entry) { boolean duplicate = false; int sx = (x/size)*size, sy = (y/size)*size; for (int i=sx; i < sx+size && !duplicate; i++) { for (int j=sy; j < sy+size && !duplicate; j++) { duplicate = (sudokuGrid[i][j].equals(entry) ? true : false); } ...
5
public void updurgency(HWindow wnd, int level) { if ((wnd == awnd) && vc.c) level = -1; if (level == -1) { if (wnd.urgent == 0) return; wnd.urgent = 0; } else { if (wnd.urgent >= level) return; wnd.urgent...
8
public static void main(String[] args) { Scanner s = new Scanner(System.in); int[][] numbers = new int[2][5]; int[] counters = new int[2]; for(int i = 0; i < 15; i++){ int x = s.nextInt(); int ind = Math.abs(x) % 2 == 1 ? 0 : 1; numbers[ind][coun...
8
public void key(KeyEvent e, int s) { int Key = e.getKeyCode(); if (s == KEY_PRESS) { boolean rep = false; for (int i=0; i <= keys.size()-1; i++) { if (keys.get(i) == Key) { rep = true; } } if (keys.size()...
8
static String toUnsignedHex8String(long pValue) { String s = Long.toString(pValue, 16); //force length to be eight characters if (s.length() == 0) {return "00000000" + s;} else if (s.length() == 1) {return "0000000" + s;} else if (s.length() == 2) {return "000000" + s;} else if (s...
8
private void subMenu(String sub) { this.clear(); StringBuilder sb = new StringBuilder(); sb.append(sub.charAt(0)).append(sub.substring(1).toLowerCase()); System.out.println("=========== " + sb + " MENU ============"); System.out.println("\t1. Add " + sb); System.out.println("\t2. Update " + sb); System...
9
@Override public void run() { count++; if(automaticCars < 40) { Car c = new AutomaticCar(id++); c.setSpeed(45); c.setReceiveBehavior(new AutomaticReceive(c)); c.setSendBehavior(new AutomaticSend(c)); towerChannel.registerCar(c); automaticCars++; } if(manualCars < 50) { Car ...
7
@Override public void visitRow(Row row) { List<UiGlyph> glyphs = row.getUiGlyphs(); for (UiGlyph uiGlyph : glyphs) { this.uiGlyphs.add(uiGlyph); uiGlyph.getGlyph().accept(this); } /* This checking is required for last word. */ if (this.currentWord.length() > 0) { this.spellCheck(); } }
2
public void onAction(String name, boolean isPressed, float tpf) { if (isPressed) { if (name.equals(KeyMapper.SHOW_PLAYER_LIST)) { togglePlayerList(true); } else if (name.equals(KeyMapper.SHOW_CHAT)) { if (!chat) { toggleChat(true); ...
7
public void modificarAudio(int id, ArrayList datos) { // Cambiamos todos los datos, que se puedan cambiar, a minúsculas for(int i = 0 ; i < datos.size() ; i++) { try{datos.set(i, datos.get(i).toString().toLowerCase());} catch(Exception e){} } bibliotec...
2
@Override public boolean placeResearvation(int rowNum, Column column, Passenger passenger) throws ClassCastException, IndexOutOfBoundsException, IllegalArgumentException, NullPointerException { if (!isInitialized) { throw new NullPointerException("Passenger List has not been initialized"); ...
6
private List<Integer> shrinkHeap(List<Integer> list) { for (int n = list.size() - 1; n >= 0; n--) { appUtil.swap(list, 0, n); int parent = 0; while (true) { int leftChild = 2 * parent + 1; if (leftChild >= n) break; int rig...
6
public void keyTyped(KeyEvent e) { char key = e.getKeyChar(); System.out.println("KEY TYPED: " + key); switch(key) { case 's': //System.out.println("About to smooth!"); if(_wps.getSmoothPath().size() > 2) _wps.smoothWeighted(_tolerance); update(); repaint(); break; ...
4
public void back() throws JSONException { if (this.usePrevious || this.index <= 0) { throw new JSONException("Stepping back two steps is not supported"); } this.index -= 1; this.character -= 1; this.usePrevious = true; this.eof = false; }
2
public void initSamples() { for( int ns = 0; ns < numberOfSamples; ns++ ) for( int i = 0; i < n; i++ ) { samples[ns][i] = i + 1; rankSum[ns][i] = 0; } }
2
public static void startupHttpServerImpl() { { Object old$Module$000 = Stella.$MODULE$.get(); Object old$Context$000 = Stella.$CONTEXT$.get(); try { Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/HTTP/SUN", Stella.$STARTUP_TIME_PHASE$ > 1)); Native.setSpecial(Stella.$CONTEX...
8
public MapGeneratorOptionsDialog(FreeColClient freeColClient, GUI gui, OptionGroup mgo, boolean editable, boolean loadCustomOptions) { super(freeColClient, gui, editable); if (editable && loadCustomOptions) { loadCust...
9
@SuppressWarnings("resource") public static void main(String[] args) { // Record the starting timestamp and set the thread name for debugging // purposes serverStartTime = (new Date()).getTime(); Thread.currentThread().setName("Main Thread"); // Read the port from t...
7
public SaveAsFileMenuItem(FileProtocol protocol) { setProtocol(protocol); addActionListener(this); }
0
public Object getEncodedDestination() { // write out the destination name if (namedDestination != null) { return namedDestination; } // build and return a fector of changed valued. else if (object instanceof Vector) { Vector<Object> v = new Vector<Object>(...
9
@Override public boolean equals(Object activity) { if (this.getName().compareTo(((Activity) activity).getName()) == 0) { return true; } else return false; }
1
public boolean pass(int[] bowl, int bowlId, int round, boolean canPick, boolean musTake) { int bowlScore = 0; double expectedScore=0; if(strategy == 0 || (strategy==1 && round==1)){ //System.out.println("Strategy: "+strategy+"\t"+"Round: "+round); bowlScore = bui...
9
public void setId(String value) { this.id = value; }
0
public static String getMiniIconName(int miniIconNumber) { // Hardcoded in MM6.exe file // These icon names are contained in icon.lod switch(miniIconNumber) { case 0: return "NO SYMBOL"; case 1: return "castle"; case...
9
@Test public void testPolar() { System.out.println("Polar"); assertEquals(Complex.NaN, Complex.Polar(Double.NaN, Double.NaN)); assertEquals(Complex.NaN, Complex.Polar(Double.NaN, 1.0)); assertEquals(Complex.NaN, Complex.Polar(1.0, Double.NaN)); assertEquals(Complex.Infinity...
5
private void render(float interpol) { Graphics2D g = null; try { g = (Graphics2D)bs.getDrawGraphics(); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); // Profiler.lapRestart("Obtain Graphics"); draw(g,interpol); // Profiler.lapRestart("Draw Content"); if (!bs.c...
2
protected Color getHeaderBackground() { Color c = UIManager .getColor("SimpleInternalFrame.activeTitleBackground"); if (c != null) return c; if (LookUtils.IS_LAF_WINDOWS_XP_ENABLED) c = UIManager.getColor("InternalFrame.activeTitleGradient"); r...
3
private void paintAreasBoundaries(Graphics2D g2d) { if (drawAreaBoundaries) { g2d.setColor(Color.GRAY); final float dash1[] = { 4.0f }; final BasicStroke dashed = new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 5.0f, dash1, 0.0f); ...
2
private void incAsset(String as, int inc){ if ("Pork Bellies".equals(as)){ pb = pb+inc; } else if ("Frozen Orange Juice Concentrate".equals(as)){ oj = oj+inc; } else if ("Soybeans".equals(as)){ sb = sb+inc; }else throw new Error("No suc...
3
@Override public String getAsString(FacesContext facesContext, UIComponent component, Object object) { if (object == null || (object instanceof String && ((String) object).length() == 0)) { return null; } if (object instanceof Detallecotizacion) { Deta...
4
public static void main(String args[]) { /*//Trying for perfum Perfume[] pf = PerfumeFactory.getAllPerfume(); //Setting the training desired value for the class pf[0].setDesiredValue(1); for(int i = 1; i < pf.length; i++) { pf[i].setDesiredValue(-1); } Perceptron<Perfume> p = new Perceptron<Perfume>...
3
private String arrayToString(ArrayList<Path> array) { String s = ""; for(Path path : array) s += path.toString()+"\n"; return s; }
1
public static String getExceptionMessage(final Throwable e) { if (e.getCause() != null) { String msg = getExceptionMessage(e.getCause()); if (!msg.equalsIgnoreCase(e.getClass().getName())) { return msg; } } if (e.getLocalizedMessage() != null)...
5
public void update() { if(GameManager.getGames().size()!= games) getInventory(); for(ItemStack item: menu.getContents()) { if(item!= null && item.getType()!= Material.MAGMA_CREAM) { ItemMeta im = item.getItemMeta(); String name = ChatColor.stripColor(im.getDisplayName().split(" ")[0]); Game game =...
7
protected void checkSingleParameters(OAuthMessage message) throws IOException, OAuthException { // Check for repeated oauth_ parameters: boolean repeated = false; Map<String, Collection<String>> nameToValues = new HashMap<String, Collection<String>>(); for (Map.Entry<String, String> para...
7
public Object getColumnValue(UserColumns column) { switch (column) { case ID: return id; case COMMENT: return comment; case CREATE_TIME: return createTime; case DN:...
9
public Medico getMedico() { return medico; }
0
private ArrayList<Entry<String, Integer>> sortByValue(TreeMap<String, Integer> keywords){ ArrayList<Entry<String,Integer>> list = new ArrayList<Entry<String,Integer>>(keywords.entrySet()); Collections.sort(list, new Comparator<Map.Entry<String, Integer>>(){ @Override public int compare(Entry<String, Integer...
0
public static void main(String[] args) { IHello hello = new HelloSpeaker(); StaticHelloProxy proxy = new StaticHelloProxy(hello); proxy.hello("Laud"); }
0
private void createPropertyFile(String fileName, String query, String time, String dbName) { Properties prop = new Properties(); ByteArrayOutputStream arrayOut = new ByteArrayOutputStream(); FileOutputStream out = null; File file = new File("src/main/resources/properties"); if(!file.exists()) { file.mkdir(...
4
private void jTextField1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1KeyReleased // TODO add your handling code here: if (jRadioButton1.isSelected()) { try { ResultSet rs = DB.myConnection().createStatement().executeQuery("select * from author wher...
6
private File createDataFile(String data) throws IOException { File tempDir = makeTempDir(); File tempFile = new File(tempDir, "tzdata"); tempFile.deleteOnExit(); InputStream in = new ByteArrayInputStream(data.getBytes("UTF-8")); FileOutputStream out = new FileOutputStream(temp...
1