Error
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.

input

What Comes Out Goes Back In with the Microbial Home [Design]
Sunday, 30 October 2011 19:00
The Microbial Home by Philips Design is all about input and output. Waste (output), powers your herb garden (input). Like life, it's a cyclical thing. Ya dig? More »


Read more: http://feeds.gawker.com/~r/gizmodo/full/~3/8JOab7KGuow/

 
Read Text File
Monday, 25 April 2011 15:48
// Read input from a text file. Paste input handling code in the while loop


public void readFile(String filename){
try{
FileInputStream fstream = new FileInputStream(filename);
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;

//read line per line
while ((strLine = br.readLine()) != null) {

// input
// handling
// code

}

//Close stream
in.close();
}catch (Exception e){
e.printStackTrace();
}



}

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/pQqLxRTGx-k/13155

 
Aufgabe P16 Teil B
Wednesday, 24 November 2010 05:58
Das Zeilenweise einlesen hab ich diesmal durch einen String ersetzt.


import Prog1Tools.*;

public class InverterRekursiv
{
public static void main (String [] args)
{
// Read String
String input = IOTools.readString();

// print Header
System.out.println("===============================");
System.out.println("Invertierer (rekursive Version)");
System.out.println("===============================\n");

// call recursion method
String result = invertString(input, 1);

// print result
System.out.println("\nDie umgekehrte Zeichenfolge lautet: " + result);
}

// recursiv method to invert string
// int i is just used to print 1., 2., ... Zeichen
public static String invertString(String input, int i)
{
// get first char
String first = input.substring(0,1);
// print char
System.out.println(i++ + ".Zeichen: " + first);
// new string = del first char of old string
input = input.substring(1);

// abort condition
if(input.length() == 1)
{
// print char
System.out.println(i + ".Zeichen: " + input);
// return from recursion
return input + first;
}
else // continue recursion
{
return invertString(input, i) + first;
}
}
}

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/IJ2B8n1BZ_c/12657

 
This Desk Is Cooler Than Your Desk Because It's a 58" iPhone [IPhone]
Friday, 29 October 2010 19:00
Whether owning a "Table Connect" would make you awesome, or something of a douchebag, is probably a matter of taste. But there's no doubt it's technically impressive—taking input from your iPhone to create a fully touch-functional, desk-sized replica. More »


Read more: http://feeds.gawker.com/~r/gizmodo/full/~3/MrZ_9Z-2LIE/this-desk-is-cooler-than-your-desk-because-its-a-58-iphone

 
Get Input With JOptionPane
Tuesday, 19 October 2010 19:49
// Gets user input using JOPtionPanes.
// -Validates as datatyoe
// -Continues to loop for valid input or user quits.

import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.*;


public static final Pattern CHARACTER = Pattern.compile("\\S.*?");
public static final Pattern UNSIGNED_INT = Pattern.compile("\\d+.*?");
public static final Pattern INT = Pattern.compile("[+-]?\\d+.*?");
public static final Pattern UNSIGNED_DOUBLE =
Pattern.compile("((\\d+\\.?\\d*)|(\\.\\d+))([Ee][-+]?\\d+)?.*?");
public static final Pattern DOUBLE =
Pattern.compile("[+-]?((\\d+\\.?\\d*)|(\\.\\d+))([Ee][-+]?\\d+)?.*?");

public static double getIntInput (String promptMsg)
{
boolean validInput = false;
double returnVal;
String inString = "";
while (!validInput)
{
inString = JOptionPane.showInputDialog(null, promptMsg);
Matcher m = INT.matcher(inString);
validInput = m.find(); // RETURN FROM VALIDATEDOUBLE METHOD


if (!validInput)
{
showErrorPane("VALIDATION ERROR", "Could not validate input. This is most likely due to either:\n1. Input was not a valid number (contains only #'s and decimal point).\n2. The number was negative (negative #'s not valid).");
}
}
returnVal = Integer.parseInt(inString);
return returnVal;
}

public static void showErrorPane(String msg, String title) {
int selection = JOptionPane.showOptionDialog(null,
title, msg, JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE, null,
new String[]{"Try Again", "Exit"}, "Try Again");
if (selection == JOptionPane.NO_OPTION)
System.exit(0);
}


Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/9bgMTJAYgEc/12501

 


Taxonomy by Zaragoza Online