input stringlengths 20 285k | output stringlengths 20 285k |
|---|---|
public static void beforeClass() throws Exception {
server = new DummyServer("localhost", 6999);
server.start();
server.register("my-app", "my-module", null, EchoBean.class.getSimpleName(), new EchoBean());
final Endpoint endpoint = Remoting.createEndpoint("endpoint", Executors.newSi... | public static void beforeClass() throws Exception {
server = new DummyServer("localhost", 6999);
server.start();
server.register("my-app", "my-module", "", EchoBean.class.getSimpleName(), new EchoBean());
final Endpoint endpoint = Remoting.createEndpoint("endpoint", Executors.newSing... |
public void testShades() throws IOException {
String mvn = System.getProperty("path.to.mvn", "mvn");
String version = BPMLocalTest.getBonitaVersion();
String thePom = getPom(version);
File file = new File("shadeTester");
file.mkdir();
String outputOfMaven;
try... | public void testShades() throws IOException {
String mvn = System.getProperty("path.to.mvn", "mvn");
String version = BPMLocalTest.getBonitaVersion();
String thePom = getPom(version);
File file = new File("shadeTester");
file.mkdir();
String outputOfMaven;
try... |
public boolean use(Hero hero, LivingEntity target, String[] args) {
Player player = hero.getPlayer();
if (target instanceof Player) {
Player tPlayer = (Player) target;
if (!(player.getItemInHand().getType() == Material.PAPER)) {
Messaging.send(player, "You nee... | public boolean use(Hero hero, LivingEntity target, String[] args) {
Player player = hero.getPlayer();
if (target instanceof Player) {
Player tPlayer = (Player) target;
if (!(player.getItemInHand().getType() == Material.PAPER)) {
Messaging.send(player, "You nee... |
private RubyTime createTime(IRubyObject[] args, boolean gmt) {
int len = 6;
if (args.length == 10) {
args = new IRubyObject[] { args[5], args[4], args[3], args[2], args[1], args[0] };
} else {
len = checkArgumentCount(args, 1, 7);
}
ThreadContext tc = ... | private RubyTime createTime(IRubyObject[] args, boolean gmt) {
int len = 6;
if (args.length == 10) {
args = new IRubyObject[] { args[5], args[4], args[3], args[2], args[1], args[0] };
} else {
len = checkArgumentCount(args, 1, 7);
}
ThreadContext tc = ... |
private void generateASCII()
{
System.out.println("Converting image into ASCII...");
this.output = "";
int width = this.output_image.getWidth();
int height = this.output_image.getHeight();
int last_percent = 0;
for(int i = 0; i < height; ++i)
{
for(int j = 0; j < width; ++j)
{
String character... | private void generateASCII()
{
System.out.println("Converting image into ASCII...");
this.output = "";
int width = this.output_image.getWidth();
int height = this.output_image.getHeight();
int last_percent = 0;
for(int i = 0; i < height; ++i)
{
for(int j = 0; j < width; ++j)
{
String character... |
public void testProjectNameValue() throws Exception {
final DistributedMasterBuilder masterBuilder = new DistributedMasterBuilder();
final Builder nestedBuilder = new MockBuilder();
masterBuilder.add(nestedBuilder);
masterBuilder.setModule("deprecatedModule");
try {
... | public void testProjectNameValue() throws Exception {
final DistributedMasterBuilder masterBuilder = DistributedMasterBuilderTest.getMasterBuilder_LocalhostONLY();
final Builder nestedBuilder = new MockBuilder();
masterBuilder.add(nestedBuilder);
masterBuilder.setModule("deprecatedMo... |
public LinkedList<MIDPrimerCombo> loadMIDS() throws MIDFormatException
{
LinkedList <MIDPrimerCombo> MIDTags = new LinkedList <MIDPrimerCombo>();
int midCount = 0;
try
{
String line = input.readLine();
while (line != null)
{
if(line.trim().length() == 0)
{
continue;
}
String[] c... | public LinkedList<MIDPrimerCombo> loadMIDS() throws MIDFormatException
{
LinkedList <MIDPrimerCombo> MIDTags = new LinkedList <MIDPrimerCombo>();
int midCount = 0;
try
{
String line = input.readLine();
while (line != null)
{
if(line.trim().length() == 0)
{
line = input.readLine();
... |
public Map pageListToMap(HttpServletRequest req, boolean loggedIn, Site site,
SitePage page, String toolContextPath, String portalPrefix, boolean doPages,
boolean resetTools, boolean includeSummary)
{
Map<String, Object> theMap = new HashMap<String, Object>();
String pageUrl = Web.returnUrl(req, "/" + porta... | public Map pageListToMap(HttpServletRequest req, boolean loggedIn, Site site,
SitePage page, String toolContextPath, String portalPrefix, boolean doPages,
boolean resetTools, boolean includeSummary)
{
Map<String, Object> theMap = new HashMap<String, Object>();
String pageUrl = Web.returnUrl(req, "/" + porta... |
protected void onRowPopulated(final WebMarkupContainer rowComponent) {
if (disableRowClickNotifications())
return;
rowComponent.add(new AjaxFormSubmitBehavior(getForm(), "onclick") {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target) {
}
@... | protected void onRowPopulated(final WebMarkupContainer rowComponent) {
if (disableRowClickNotifications())
return;
rowComponent.add(new AjaxFormSubmitBehavior(getForm(), "onclick") {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target) {
}
@... |
private void editResource
(AppleResponse
res, AppleRequest
req, String
type, String
messages) {
boolean validated = true;
boolean insertSuccess = false;
boolean updateDate = false;
String dctPublisher;
String dctIden... | private void editResource
(AppleResponse
res, AppleRequest
req, String
type, String
messages) {
boolean validated = true;
boolean insertSuccess = false;
boolean updateDate = false;
String dctPublisher;
String dctIden... |
public void run() {
try {
socket = new DatagramSocket(port);
} catch (Exception e) {
System.out.println("Unable to start UDP server on port " + port + ". Ignoring ...");
return ;
}
System.out.println("UDP server started on port " + port);
while (true) {
try {
if (isInterrupted()) ... | public void run() {
try {
socket = new DatagramSocket(port);
} catch (Exception e) {
System.out.println("Unable to start UDP server on port " + port + ". Ignoring ...");
return ;
}
System.out.println("UDP server started on port " + port);
while (true) {
try {
if (isInterrupted()) ... |
ChartsPanel(RemoteCollector remoteCollector) {
super(remoteCollector);
final JLabel throbberLabel = new JLabel(THROBBER_ICON);
add(throbberLabel, BorderLayout.NORTH);
add(createButtonsPanel(), BorderLayout.CENTER);
final SwingWorker<Map<String, byte[]>, Object> swingWorker = new SwingWorker<Map<String, byte[... | ChartsPanel(RemoteCollector remoteCollector) {
super(remoteCollector);
final JLabel throbberLabel = new JLabel(THROBBER_ICON);
add(throbberLabel, BorderLayout.NORTH);
add(createButtonsPanel(), BorderLayout.CENTER);
final SwingWorker<Map<String, byte[]>, Object> swingWorker = new SwingWorker<Map<String, byte[... |
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
se... | public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
se... |
private final TextElement parseText(String currentText, String tag, String arg) {
TextElement result = new TextElement(tag);
if(result.mType == TextElementType.Quote)
result.mContent = arg;
if (currentText.substring(0,1).equals("\n")) {
result.mConsumedLength++;
}
Pattern tagPattern = Pattern.compile("... | private final TextElement parseText(String currentText, String tag, String arg) {
TextElement result = new TextElement(tag);
if(result.mType == TextElementType.Quote)
result.mContent = arg;
if (currentText.length() > 0) {
if (currentText.substring(0,1).equals("\n")) {
result.mConsumedLength++;
}
}... |
public void testRegistration() {
Page page = tester.startPage(RegisterPage.class);
tester.assertRenderedPage(RegisterPage.class);
PortalSession.get().getRights().add(new Right("captcha.disabled"));
FormTester ft = tester.newFormTester("form");
ft.setValue("username", "peterpa... | public void testRegistration() {
Page page = tester.startPage(RegisterPage.class);
tester.assertRenderedPage(RegisterPage.class);
PortalSession.get().getRights().add(new Right("captcha.disabled"));
FormTester ft = tester.newFormTester("form");
ft.setValue("username", "peterpa... |
public void draw(Canvas canvas) {
if (mViews != null) {
final int n = mViews.size();
for (int i = 0; i < mCurrent; i++) {
drawView(mViews.get(i), canvas);
}
for (int i = n - 1; i > mCurrent; i--) {
drawView(mViews.get(i), canvas... | public void draw(Canvas canvas) {
if ((mViews != null) && (mCurrent > -1)) {
final int n = mViews.size();
for (int i = 0; i < mCurrent; i++) {
drawView(mViews.get(i), canvas);
}
for (int i = n - 1; i > mCurrent; i--) {
drawView(... |
public void init(FMLInitializationEvent event)
{
System.out.println("Initilizing Sustainable Resources Mod (SMR)");
System.out.println("You are using a pre-alpha build! And peter fails :P");
}
| public void init(FMLInitializationEvent event)
{
System.out.println("Initilizing Sustainable Resources Mod (SMR)");
System.out.println("You are using a pre-alpha build!");
}
|
public static void main (String [] args) {
assert args.length > 5;
int NUM_READERS = 5;
int NUM_WRITERS = 1;
final int N = Integer.parseInt(args[0]);
final int R = Integer.parseInt(args[1]);
int W = Integer.parseInt(args[2]);
int K = Integer.parseInt(args[3]);
assert K ... | public static void main (String [] args) {
assert args.length > 5;
int NUM_READERS = 5;
int NUM_WRITERS = 1;
final int N = Integer.parseInt(args[0]);
final int R = Integer.parseInt(args[1]);
int W = Integer.parseInt(args[2]);
int K = Integer.parseInt(args[3]);
assert K ... |
public void execute(final ScheduledJob scheduledJob) {
final SystemHelper systemHelper = SingletonS2Container
.getComponent(SystemHelper.class);
final JobLog jobLog = new JobLog(scheduledJob);
final String scriptType = scheduledJob.getScriptType();
final String script... | public void execute(final ScheduledJob scheduledJob) {
final SystemHelper systemHelper = SingletonS2Container
.getComponent(SystemHelper.class);
final JobLog jobLog = new JobLog(scheduledJob);
final String scriptType = scheduledJob.getScriptType();
final String script... |
public static void init() {
oi = new OI();
SmartDashboard.putData(driveTrain);
SmartDashboard.putData(shooter);
SmartDashboard.putdata(feeder);
}
| public static void init() {
oi = new OI();
SmartDashboard.putData(driveTrain);
SmartDashboard.putData(shooter);
SmartDashboard.putData(feeder);
}
|
protected boolean processCharacters( HWPFDocumentCore document,
int currentTableLevel, Range range, final Element block )
{
if ( range == null )
return false;
boolean haveAnyText = false;
if ( document instanceof HWPFDocument )
{
final HWPFDocu... | protected boolean processCharacters( HWPFDocumentCore document,
int currentTableLevel, Range range, final Element block )
{
if ( range == null )
return false;
boolean haveAnyText = false;
if ( document instanceof HWPFDocument )
{
final HWPFDocu... |
public String getSelector() {
buildEngineMap();
if (_engines.isEmpty())
return "<b>No search engines specified</b>";
String dflt = _context.getProperty(PROP_DEFAULT);
if (dflt == null || !_engines.containsKey(dflt)) {
int idx = _context.random().nextInt(_engin... | public String getSelector() {
buildEngineMap();
if (_engines.isEmpty())
return "<b>No search engines specified</b>";
String dflt = _context.getProperty(PROP_DEFAULT);
if (dflt == null || !_engines.containsKey(dflt)) {
int idx = _context.random().nextInt(_engin... |
public void save(){
Iterator<SaveCommand> siter = saveCommands.iterator();
int previousCommand = -1;
int count = 0;
while(siter.hasNext()){
this.progress = (int)((double)count / (double)this.saveCommands.size() * 100);
this.mapDel.setProgressBarValue(this.progress, "Saving Map");
count++;
SaveComma... | public void save(){
Iterator<SaveCommand> siter = saveCommands.iterator();
int previousCommand = -1;
int count = 0;
while(siter.hasNext()){
this.progress = (int)((double)count / (double)this.saveCommands.size() * 100);
this.mapDel.setProgressBarValue(this.progress, "Saving Map");
count++;
SaveComma... |
public SessionProvider(
Registry registry,
MBeanService mBeanService,
@SessionCache Cache<?, ?> cache,
@BackgroundScheduler ScheduledExecutorService scheduler,
@Named(IpcSessionConfig.EXPIRATION_TIME) long time,
@Named(IpcSessionConfig.EXPIRATION_TIME_UNIT) TimeUnit t... | public SessionProvider(
Registry registry,
MBeanService mBeanService,
@SuppressWarnings("rawtypes") @SessionCache Cache cache,
@BackgroundScheduler ScheduledExecutorService scheduler,
@Named(IpcSessionConfig.EXPIRATION_TIME) long time,
@Named(IpcSessionConfig.EXPIRATI... |
private synchronized void broadcastTags(Intent intent) {
TagCache cache = app.getTagCache();
synchronized(cache) {
Integer currentNestId = Integer.valueOf(intent.getIntExtra(BUNDLE_NEST_ID, -1));
List<String> out = new ArrayList<String>();
Set<String> lt = cache.getLocalTags(currentNestId);
if(lt != nu... | private synchronized void broadcastTags(Intent intent) {
TagCache cache = app.getTagCache();
synchronized(cache) {
Integer currentNestId = Integer.valueOf(intent.getIntExtra(BUNDLE_NEST_ID, -1));
Set<String> out;
Set<String> lt = cache.getLocalTags(currentNestId);
if(lt != null) {
out = new HashSet... |
protected void onHandleIntent(Intent intent) {
long now = java.lang.System.currentTimeMillis();
SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(this);
long last = settings.getLong("lastDataUpdate", 0);
boolean updateNeeded = false;
if (last == 0) {
updateNeeded = true;
Log.d("... | protected void onHandleIntent(Intent intent) {
long now = java.lang.System.currentTimeMillis();
SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(this);
long last = settings.getLong("lastDataUpdate", 0);
boolean updateNeeded = false;
if (last == 0) {
updateNeeded = true;
Log.d("... |
public static int processSum(ResultSet result, int sample_size, int db_size) throws SQLException {
HashMap<Integer, Integer> frequencies = new HashMap<Integer, Integer>();
Integer k;
Integer v;
int sum = 0;
int s = 0;
while (result.next()) {
k = new Integer(result.getInt("value"));
if (frequencies.co... | public static long processSum(ResultSet result, int sample_size, int db_size) throws SQLException {
HashMap<Integer, Integer> frequencies = new HashMap<Integer, Integer>();
Integer k;
Integer v;
long sum = 0;
int s = 0;
while (result.next()) {
k = new Integer(result.getInt("value"));
if (frequencies.... |
public User(String email_, String password_, String firstname_, String lastname_, String question_, String answer_)
{
this.email_ = email_;
this.password_ = password_;
this.firstname_ = firstname_;
this.lastname_ = lastname_;
this.question_ = question_;
this.answe... | public User(String email_, String password_, String firstname_, String lastname_, String question_, String answer_)
{
this.email_ = email_;
this.password_ = password_;
this.firstname_ = firstname_;
this.lastname_ = lastname_;
this.question_ = question_;
this.answe... |
public void completeJoblet(int jobletId, JobletResult result,
String logMessage) throws TransportException, InvalidApiKey,
InvalidJobletId {
log.trace("completeJoblet()");
Joblet joblet = readJoblet(jobletId);
joblet.setStatus(result.getStatus());
dao.update(joblet);
result.setJoblet(joblet);
result.... | public void completeJoblet(int jobletId, JobletResult result,
String logMessage) throws TransportException, InvalidApiKey,
InvalidJobletId {
log.trace("completeJoblet()");
Joblet joblet = readJoblet(jobletId);
joblet.setStatus(result.getStatus());
dao.update(joblet);
result.setJoblet(joblet);
result.... |
public void shouldGetListOfUserSupportedProgramsForAFacilityForGivenRights() {
Program program = new Program();
List<Program> programs = new ArrayList<>(Arrays.asList(program));
Long facilityId = 12345L;
when(programService.getProgramsSupportedByUserHomeFacilityWithRights(facilityId, USER_ID, VIEW_REQ... | public void shouldGetListOfUserSupportedProgramsForAFacilityForGivenRights() {
Program program = new Program();
List<Program> programs = new ArrayList<>(Arrays.asList(program));
Long facilityId = 12345L;
when(programService.getProgramsForUserByFacilityAndRights(facilityId, USER_ID, VIEW_REQUISITION)).... |
private void _startScan( File folder ){
File[] files = folder.listFiles( new FileFilter() {
@Override
public boolean accept(File pathname) {
if ( ! pathname.canRead() ) return false;
if ( pathname.isHidden() && ! _hidden ) return false;
... | private void _startScan( File folder ){
File[] files = folder.listFiles( new FileFilter() {
@Override
public boolean accept(File pathname) {
if ( ! pathname.canRead() ) return false;
if ( pathname.isHidden() && ! _hidden ) return false;
... |
private boolean getLockInformation(ITransaction transaction,
HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
Node lockInfoNode = null;
DocumentBuilder documentBuilder = null;
documentBuilder = getDocumentBuilder();
try ... | private boolean getLockInformation(ITransaction transaction,
HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
Node lockInfoNode = null;
DocumentBuilder documentBuilder = null;
documentBuilder = getDocumentBuilder();
try ... |
public static double[] getUniquedValuesFromMatrix(IMatrix data, IElementAdapter cellAdapter, int valueDimension, int maxUnique, IProgressMonitor monitor) {
Double[] values = null;
List<Double> valueList = new ArrayList<Double>();
MatrixUtils.DoubleCast cast = MatrixUtils.createDoubleCast(
... | public static double[] getUniquedValuesFromMatrix(IMatrix data, IElementAdapter cellAdapter, int valueDimension, int maxUnique, IProgressMonitor monitor) {
Double[] values = null;
List<Double> valueList = new ArrayList<Double>();
MatrixUtils.DoubleCast cast = MatrixUtils.createDoubleCast(
... |
void startCleanup() {
final long now = System.currentTimeMillis();
if (locallyOwnedMap != null) {
locallyOwnedMap.evict(now);
}
if (mapNearCache != null) {
mapNearCache.evict(now, false);
}
final Set<Record> recordsDirty = new HashSet<Record>()... | void startCleanup() {
final long now = System.currentTimeMillis();
if (locallyOwnedMap != null) {
locallyOwnedMap.evict(now);
}
if (mapNearCache != null) {
mapNearCache.evict(now, false);
}
final Set<Record> recordsDirty = new HashSet<Record>()... |
protected void writeRatings(RatingDataAccessObject dao, Long2IntMap userSegments) throws MojoExecutionException, SQLException {
Connection[] dbcs = new Connection[numFolds];
PreparedStatement[] insert = new PreparedStatement[numFolds];
PreparedStatement[] test = new PreparedStatement[numFold... | protected void writeRatings(RatingDataAccessObject dao, Long2IntMap userSegments) throws MojoExecutionException, SQLException {
Connection[] dbcs = new Connection[numFolds];
PreparedStatement[] insert = new PreparedStatement[numFolds];
PreparedStatement[] test = new PreparedStatement[numFold... |
private static void initWizards() {
WIZARDS_DICT = new HashMap<String, WizardInfo>();
WIZARDS_DICT.put("BASIC", new WizardInfo("BASIC", "Basic",
R.drawable.ic_wizard_basic, 50,
new Locale[] {}, true, false,
Basic.class));
WIZARDS_DICT.put("ADVANCED", new WizardInfo("ADVANCED", "Advanced",
R.d... | private static void initWizards() {
WIZARDS_DICT = new HashMap<String, WizardInfo>();
WIZARDS_DICT.put("BASIC", new WizardInfo("BASIC", "Basic",
R.drawable.ic_wizard_basic, 50,
new Locale[] {}, true, false,
Basic.class));
WIZARDS_DICT.put("ADVANCED", new WizardInfo("ADVANCED", "Advanced",
R.d... |
public static JavaArchive createDeployment() {
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
.addPackages(
true,
"junit",
"org.junit",
"org.hamcrest",
Ar... | public static JavaArchive createDeployment() {
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
.addPackages(
true,
"junit",
"org.junit",
"org.hamcrest",
Ar... |
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main_web);
new RestaurantInfoTask().execute("http://18.238.2.68/cuisinestream/phonedata.cgi?user=jes&location=42.358506+-71.060142&radius=2000... | protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main_web);
new RestaurantInfoTask().execute("http://18.238.2.68/cuisinestream/phonedata.cgi?user=jes&location=42.358506+-71.060142&radius=2000... |
public String formatBinary(byte[] bytes) {
StringBuffer sb = new StringBuffer();
sb.append("decode('");
appendBytesInHex(sb, bytes);
sb.append("', 'hex')");
return sb.toString();
}
| public String formatBinary(byte[] bytes) {
StringBuffer sb = new StringBuffer();
sb.append("E'\\\\x");
appendBytesInHex(sb, bytes);
sb.append("'");
return sb.toString();
}
|
public SubmitJob(byte[] pktdata)
{
super(pktdata);
taskName = new AtomicReference<String>();
uniqueId = new AtomicReference<String>();
epochString = new AtomicReference<String>();
int pOff = 0;
pOff = parseString(pOff, taskName);
pOff = parseString(pOff, u... | public SubmitJob(byte[] pktdata)
{
super(pktdata);
taskName = new AtomicReference<String>();
uniqueId = new AtomicReference<String>();
epochString = new AtomicReference<String>();
int pOff = 0;
pOff = parseString(pOff, taskName);
pOff = parseString(pOff, u... |
public void run() throws Exception {
super.run();
logger.info("Starting download in TASK " + fileURL);
HttpMethod method = getGetMethod(fileURL);
if (makeRedirectedRequest(method)) {
String contentAsString = getContentAsString();
checkProblems();
... | public void run() throws Exception {
super.run();
logger.info("Starting download in TASK " + fileURL);
HttpMethod method = getGetMethod(fileURL);
if (makeRedirectedRequest(method)) {
String contentAsString = getContentAsString();
checkProblems();
... |
public Url notifyChildClosed(final WebProcess subProcess) {
if (subProcess.getClass().equals(PaylineProcess.class)) {
final PaylineProcess subPro = (PaylineProcess) subProcess;
if (subPro.isSuccessful()) {
return new AccountPageUrl();
}
unlock(... | public Url notifyChildClosed(final WebProcess subProcess) {
if (subProcess.getClass().equals(PaylineProcess.class)) {
final PaylineProcess subPro = (PaylineProcess) subProcess;
if (subPro.isSuccessful()) {
return new AccountPageUrl();
}
unlock(... |
public void testExecute() throws Exception {
final File libDir = new File(tempDir, "lib");
if (!libDir.exists() && !libDir.mkdirs()) {
throw new IOException("Failed to create directory " + libDir);
}
final Integrator i = new Integrator();
i.setDitaDir(tempDir);
... | public void testExecute() throws Exception {
final File libDir = new File(tempDir, "lib");
if (!libDir.exists() && !libDir.mkdirs()) {
throw new IOException("Failed to create directory " + libDir);
}
final Integrator i = new Integrator();
i.setDitaDir(tempDir);
... |
public static List<AssetId> getAssetRelationTreeParents(ICS ics, Log log, AssetId child, String expectedParentType,
String associationName) {
FTValList vl = new FTValList();
vl.setValString("ftcmd", "findnode");
vl.setValString("treename", "AssetRelationTree");
vl.setValS... | public static List<AssetId> getAssetRelationTreeParents(ICS ics, Log log, AssetId child, String expectedParentType,
String associationName) {
FTValList vl = new FTValList();
vl.setValString("ftcmd", "findnode");
vl.setValString("treename", "AssetRelationTree");
vl.setValS... |
public static Map<ISOKey, AdminLevelSet> parseDublinCoreCoverageString(
final String dcCoverageString) {
final Map<ISOKey, AdminLevelSet> retValue = new HashMap<ISOKey, AdminLevelSet>();
if (dcCoverageString != null && dcCoverageString != "") {
final StringTokenizer st = new StringTokenizer(dcCoverageString... | public static Map<ISOKey, AdminLevelSet> parseDublinCoreCoverageString(
final String dcCoverageString) {
final Map<ISOKey, AdminLevelSet> retValue = new HashMap<ISOKey, AdminLevelSet>();
if (dcCoverageString != null && !"".equals(dcCoverageString)) {
final StringTokenizer st = new StringTokenizer(dcCoverage... |
public void upload(loci.visbio.data.Dataset data,
String server, String username, String password)
{
try {
OMEWriter writer = new OMEWriter();
OMEXMLMetadataStore store = new OMEXMLMetadataStore();
store.setRoot(data.getOMENode());
writer.setMetadataStore(store);
String id = se... | public void upload(loci.visbio.data.Dataset data,
String server, String username, String password)
{
try {
OMEWriter writer = new OMEWriter();
OMEXMLMetadataStore store = new OMEXMLMetadataStore();
store.setRoot(data.getOMENode());
writer.setMetadata(store);
String id = server ... |
public void workSessions() {
Iterator<G_Player> player1Iter = S_Server.getInstance()
.getWorldModule().getPlayerManager().getPlayerListIterator();
while (player1Iter.hasNext()) {
G_Player player1 = player1Iter.next();
if (statusUpdateTime.getTimeElapsedSeconds() >= 10) {
S_Client client = S_Server.ge... | public void workSessions() {
Iterator<G_Player> player1Iter = S_Server.getInstance()
.getWorldModule().getPlayerManager().getPlayerListIterator();
while (player1Iter.hasNext()) {
G_Player player1 = player1Iter.next();
if (statusUpdateTime.getTimeElapsedSeconds() >= 10) {
S_Client client = S_Server.ge... |
public Inheritance() {
BChild ch = null;
try {
System.out.println("a: " + ch.a);
} catch (NullPointerException e) {
System.out.println("Cannot getfield on a null object.");
}
BChild child = new BChild();
child.a = 3;
child.b = 5;
System.out.println("Child a: " + child.a);
System.out.println("Pa... | public Inheritance() {
String blargh = "I'm Nigel Thornberry!";
BChild ch = null;
try {
System.out.println("a: " + ch.a);
} catch (NullPointerException e) {
System.out.println("Cannot getfield on a null object.");
}
System.out.println(blargh);
BChild child = new BChild();
child.a = 3;
child.b =... |
public ImagePlus open(int sample,
int tpMin, int tpMax,
int region,
int angle,
int channel,
int zMin, int zMax,
int fMin, int fMax,
int yMin, int yMax,
int xMin, int xMax,
int xDir,
int yDir,
int zDir,
boolean virtual,
int projectionMethod,
int projectionDir) {
... | public ImagePlus open(int sample,
int tpMin, int tpMax,
int region,
int angle,
int channel,
int zMin, int zMax,
int fMin, int fMax,
int yMin, int yMax,
int xMin, int xMax,
int xDir,
int yDir,
int zDir,
boolean virtual,
int projectionMethod,
int projectionDir) {
... |
public static ServiceInterface login(GlobusCredential cred,
char[] password, String username, String idp,
LoginParams loginParams) throws LoginException {
DependencyManager.initArcsCommonJavaLibDir();
DependencyManager.checkForBouncyCastleDependency();
Security
.addProvider(new org.bouncycastle.jce.pro... | public static ServiceInterface login(GlobusCredential cred,
char[] password, String username, String idp,
LoginParams loginParams) throws LoginException {
DependencyManager.initArcsCommonJavaLibDir();
DependencyManager.checkForBouncyCastleDependency();
java.security.Security.addProvider(new ArcsSecurityPro... |
private void generateDoLoadMethod(PrintWriter out) {
out.println("\tprotected void doLoad(java.io.InputStream inputStream, java.util.Map<?,?> options) throws java.io.IOException {");
out.println("\t\tjava.lang.String encoding = null;");
out.println("\t\tjava.io.InputStream actualInputStream = inputSt... | private void generateDoLoadMethod(PrintWriter out) {
out.println("\tprotected void doLoad(java.io.InputStream inputStream, java.util.Map<?,?> options) throws java.io.IOException {");
out.println("\t\tjava.lang.String encoding = null;");
out.println("\t\tjava.io.InputStream actualInputStream = inputSt... |
public void testEquals() {
ThermometerPlot p1 = new ThermometerPlot();
ThermometerPlot p2 = new ThermometerPlot();
assertTrue(p1.equals(p2));
assertTrue(p2.equals(p1));
p1.setPadding(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
assertFalse(p1.equals(p2));
p2.setPadding(new R... | public void testEquals() {
ThermometerPlot p1 = new ThermometerPlot();
ThermometerPlot p2 = new ThermometerPlot();
assertTrue(p1.equals(p2));
assertTrue(p2.equals(p1));
p1.setPadding(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
assertFalse(p1.equals(p2));
p2.setPadding(new R... |
private void reload() {
initTypes();
_props = GlobalContext.getGlobalContext().getPluginsConfig().getPropertiesForPlugin("archive.conf");
_cycleTime = 60000 * Long.parseLong(PropertyHelper.getProperty(_props,"cycletime", "30"));
if (_runHandler != null) {
_runHandler.cancel();
}
_runHandler = new TimerT... | private void reload() {
initTypes();
_props = GlobalContext.getGlobalContext().getPluginsConfig().getPropertiesForPlugin("archive.conf");
_cycleTime = 60000 * Long.parseLong(PropertyHelper.getProperty(_props,"cycletime", "30"));
if (_runHandler != null) {
_runHandler.cancel();
GlobalContext.getGlobalCont... |
private void setNeighbours() {
setNeighbours(Country.ALASKA, Country.NORTHWESTTERRITORY);
setNeighbours(Country.ALASKA, Country.KAMCHATKA);
setNeighbours(Country.ALASKA, Country.ALBERTA);
setNeighbours(Country.NORTHWESTTERRITORY, Country.GREENLAND);
setNeighbours(Country.NORT... | private void setNeighbours() {
setNeighbours(Country.ALASKA, Country.NORTHWESTTERRITORY);
setNeighbours(Country.ALASKA, Country.KAMCHATKA);
setNeighbours(Country.ALASKA, Country.ALBERTA);
setNeighbours(Country.NORTHWESTTERRITORY, Country.GREENLAND);
setNeighbours(Country.NORT... |
public final Collection<CRResolvableBean> getObjects(
final CRRequest request, final boolean doNavigation) throws CRException {
UseCase uc = MonitorFactory.startUseCase("LuceneRequestProcessor."
+ "getObjects(" + name + ")");
UseCase ucPrepareSearch = MonitorFactory.startUseCase(
"LuceneRequestProcessor.g... | public final Collection<CRResolvableBean> getObjects(
final CRRequest request, final boolean doNavigation) throws CRException {
UseCase uc = MonitorFactory.startUseCase("LuceneRequestProcessor."
+ "getObjects(" + name + ")");
UseCase ucPrepareSearch = MonitorFactory.startUseCase(
"LuceneRequestProcessor.g... |
public void processQueue() throws SQLException {
db.startTransaction();
vms = (ArrayList<VirtualMachine>) db.getVirtualMachineDB().getAll();
db.endTransaction(true);
for (int i = 0; i < vms.size(); i++) {
if (vms.get(i).isAvailable()) {
for (int j = 0; j < jobs.size(); j++) {
if (!jobs.get(j).... | public void processQueue() throws SQLException {
db.startTransaction();
vms = (ArrayList<VirtualMachine>) db.getVirtualMachineDB().getAll();
db.endTransaction(true);
for (int i = 0; i < vms.size(); i++) {
if (vms.get(i).isAvailable()) {
for (int j = 0; j < jobs.size(); j++) {
if (!jobs.get(j).... |
public Object post( Context context, Request request, Response response, Object payload )
throws ResourceException
{
PrivilegeResourceRequest resourceRequest = (PrivilegeResourceRequest) payload;
PrivilegeListResourceResponse result = null;
if ( resourceRequest != null )
... | public Object post( Context context, Request request, Response response, Object payload )
throws ResourceException
{
PrivilegeResourceRequest resourceRequest = (PrivilegeResourceRequest) payload;
PrivilegeListResourceResponse result = null;
if ( resourceRequest != null )
... |
public Set<String> getAllAvailableNames() {
ServletContext ctx = getServletContext();
if (ctx == null) {
logger.warn("Servlet context not available - cannot get all available names");
return Collections.emptySet();
}
Set<String> names = new HashSet<String>();
Set<String> resources = ctx.getResourcePath... | public Set<String> getAllAvailableNames() {
ServletContext ctx = getServletContext();
if (ctx == null) {
logger.warn("Servlet context not available - cannot get all available names");
return Collections.emptySet();
}
Set<String> names = new HashSet<String>();
Set<String> resources = ctx.getResourcePath... |
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
YamlConfiguration config = (YamlConfiguration) plugin.getConfig();
boolean auth = false;
Player player = null;
String admin = "server";
if (sender instanceof Player){
player = (Player)sender;
if (Permi... | public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
YamlConfiguration config = (YamlConfiguration) plugin.getConfig();
boolean auth = false;
Player player = null;
String admin = "server";
if (sender instanceof Player){
player = (Player)sender;
if (Permi... |
private void initComponents() {
helpDialog = new javax.swing.JDialog();
helpCloseButton = new javax.swing.JButton();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jLabel23 = new javax.swing.JLabel();
... | private void initComponents() {
helpDialog = new javax.swing.JDialog();
helpCloseButton = new javax.swing.JButton();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jLabel23 = new javax.swing.JLabel();
... |
public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving player) {
if(Math.random() < 0.7)
return false;
if(itemstack.getItem().itemID == MetallurgyMetals.netherSet.getOreInfo("Ignatius").sword.itemID)
{
entityliving.setFire(2);
}
else if(itemstack.getItem().itemID == Metal... | public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving player) {
if(Math.random() < 0.7)
return false;
if(itemstack.getItem().itemID == MetallurgyMetals.netherSet.getOreInfo("Ignatius").sword.itemID)
{
entityliving.setFire(2);
}
else if(itemstack.getItem().itemID == Metal... |
public Element exec(Element params, ServiceContext context) throws Exception
{
String url = params.getChildText("url");
URL u = new URL(url);
HttpURLConnection conn = (HttpURLConnection)u.openConnection();
BufferedInputStream is = new BufferedInputStream(conn.getInputStream());
Element mapContext = Xml.load... | public Element exec(Element params, ServiceContext context) throws Exception
{
String url = params.getChildText("url");
URL u = new URL(url);
HttpURLConnection conn = (HttpURLConnection)u.openConnection();
BufferedInputStream is = new BufferedInputStream(conn.getInputStream());
Element mapContext = Xml.load... |
public String getFieldDefinition(Value v, String tk, String pk, boolean use_autoinc, boolean add_fieldname, boolean add_cr)
{
StringBuffer retval=new StringBuffer(128);
String fieldname = v.getName();
int length = v.getLength();
int precision = v.getPrecision();
if (add_fieldname) retval.append(fie... | public String getFieldDefinition(Value v, String tk, String pk, boolean use_autoinc, boolean add_fieldname, boolean add_cr)
{
StringBuffer retval=new StringBuffer(128);
String fieldname = v.getName();
int length = v.getLength();
int precision = v.getPrecision();
if (add_fieldname) retval.append(fie... |
public String parse(String templ, Contact contactCustomer, Contact contactContractor,
Contact conctactController, Plant plant, Place place) {
String template = templ;
template.replace(CUSTOMER,
contactCustomer.getFirstName() + " " + contactCustomer.getLastName());
... | public String parse(String templ, Contact contactCustomer, Contact contactContractor,
Contact conctactController, Plant plant, Place place) {
String template = templ;
template.replace(CUSTOMER, contactCustomer.getName() + " " + contactCustomer.getName());
template.replace(CUSTOME... |
private Object instantiateFromString(String pkg, String cls, String args) {
String className = pkg + cls;
Object object;
try {
Class<?> clsObj = Class.forName(className);
Constructor<?> ctor = clsObj.getConstructor(String.class);
... | private Object instantiateFromString(String pkg, String cls, String args) {
String className = pkg + cls;
Object object;
try {
Class<?> clsObj = Class.forName(className);
Constructor<?> ctor = clsObj.getConstructor(String.class);
... |
private static void printTable(double[][] res, String file, String caption, String label) throws Exception {
double[][] res2 = new double[6][];
int max = 0;
for (int gap = 1; gap <= 3; gap++) {
BufferedReader in = ReaderUtil.createInputReader(new File("res", "share_" + file + "_"... | private static void printTable(double[][] res, String file, String caption, String label) throws Exception {
double[][] res2 = new double[6][];
int max = 0;
for (int gap = 1; gap <= 3; gap++) {
BufferedReader in = ReaderUtil.createInputReader(new File("res", "share_" + file + "_"... |
public void testEditWithControls() throws Exception {
HtmlPage page = environment.getPage("//inplaceInputTest.jsf");
String withControlsComponentId = BASE_ID + WITH_CONTROLS;
edit(page, withControlsComponentId, "Another Test String");
HtmlElement cancel = page.getFirstByXPath("//*[@i... | public void testEditWithControls() throws Exception {
HtmlPage page = environment.getPage("//inplaceInputTest.jsf");
String withControlsComponentId = BASE_ID + WITH_CONTROLS;
edit(page, withControlsComponentId, "Another Test String");
HtmlElement cancel = page.getFirstByXPath("//*[@i... |
private boolean validate() {
ServiceModel model = wizard.getServiceModel();
if (wizard.isJAXWS()) {
setMessage(JBossWSUIMessages.JBossWS_GenerateWizard_GenerateWizardPage_Description);
setErrorMessage(null);
JBossWSGenerateWizardValidator.setServiceModel(model);
addJarsIfFound.setEnabled(false);
if ... | private boolean validate() {
ServiceModel model = wizard.getServiceModel();
if (wizard.isJAXWS()) {
setMessage(JBossWSUIMessages.JBossWS_GenerateWizard_GenerateWizardPage_Description);
setErrorMessage(null);
JBossWSGenerateWizardValidator.setServiceModel(model);
addJarsIfFound.setEnabled(false);
if ... |
public static void main(String[] args) {
String userTypeName = null;
boolean noSplash = false;
if (args.length > 0) {
for (int i = 0; i < args.length; i++) {
if (args[i].equals("-userType")) {
userTypeName = args[i + 1];
}
if (args[i].equals("-nosplash")) {
noSplash = true;
} else if... | public static void main(String[] args) {
String userTypeName = null;
boolean noSplash = false;
if (args.length > 0) {
for (int i = 0; i < args.length; i++) {
if (args[i].equals("-userType")) {
userTypeName = args[i + 1];
}
if (args[i].equals("-nosplash")) {
noSplash = true;
} else if... |
public void buildInnerTARDIS(String[][][] s, World world, Constants.COMPASS d, int dbID) {
int level, row, col, id, x, y, z, startx, starty = 15, startz, resetx, resetz, cx = 0, cy = 0, cz = 0, rid = 0, multiplier = 1, tx = 0, ty = 0, tz = 0;
byte data = 0;
short damage = 0;
String t... | public void buildInnerTARDIS(String[][][] s, World world, Constants.COMPASS d, int dbID) {
int level, row, col, id, x, y, z, startx, starty = 15, startz, resetx, resetz, cx = 0, cy = 0, cz = 0, rid = 0, multiplier = 1, tx = 0, ty = 0, tz = 0;
byte data = 0;
short damage = 0;
String t... |
public Map<String,Object> toMarkerAttributes(Map<String,Object> p) {
assert !disposed;
assert Protocol.isDispatchThread();
Map<String,Object> client_data = (Map<String,Object>)p.get(IBreakpoints.PROP_CLIENT_DATA);
if (client_data != null) {
Map<String,Object> m = (Map<Str... | public Map<String,Object> toMarkerAttributes(Map<String,Object> p) {
assert !disposed;
assert Protocol.isDispatchThread();
Map<String,Object> client_data = (Map<String,Object>)p.get(IBreakpoints.PROP_CLIENT_DATA);
if (client_data != null) {
Map<String,Object> m = (Map<Str... |
public void doPostCredential(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
if(!Hudson.adminCheck(req,rsp)) return;
MultipartFormDataParser parser = new MultipartFormDataParser(req);
String url = parser.get("url");
String kind = pa... | public void doPostCredential(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
if(!Hudson.adminCheck(req,rsp)) return;
MultipartFormDataParser parser = new MultipartFormDataParser(req);
String url = parser.get("url");
String kind = pa... |
public static void main(String[] args) throws IOException {
Adafruit8x8LEDMatrix leds = new Adafruit8x8LEDMatrix(I2C_BUS_NR, LED_PACK_ADDRESS);
Ampel ampel = new Ampel(GPIO_PIN_RED, GPIO_PIN_YELLOW, GPIO_PIN_GREEN);
while(true){
for (int row = 0; row < 8; row++) {
... | public static void main(String[] args) throws IOException {
Adafruit8x8LEDMatrix leds = new Adafruit8x8LEDMatrix(I2C_BUS_NR, LED_PACK_ADDRESS);
Ampel ampel = new Ampel(GPIO_PIN_RED, GPIO_PIN_YELLOW, GPIO_PIN_GREEN);
while(true){
for (int row = 0; row < 8; row++) {
... |
public void run(final boolean fork, boolean cancelable, final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
try {
operationInProgress = true;
final StatusLineManager mgr = getStatusLineManager();
if (mgr == null) {
runnable.run(new NullProgressMonitor());
return;
... | public void run(final boolean fork, boolean cancelable, final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
try {
operationInProgress = true;
final StatusLineManager mgr = getStatusLineManager();
if (mgr == null) {
runnable.run(new NullProgressMonitor());
return;
... |
public void getSamplesByHostIdsAndSampleKindIds(final List<Integer> hostIdList,
@Nullable final List<Integer> sampleKindIdList,
final DateTime startTime,
final ... | public void getSamplesByHostIdsAndSampleKindIds(final List<Integer> hostIdList,
@Nullable final List<Integer> sampleKindIdList,
final DateTime startTime,
final ... |
public JSONObject getRDF(String uri, String output, String containerSessionId, SecurityToken token) throws Exception {
String url = uri;
boolean local = false;
if (systemDomain != null && url.toLowerCase().startsWith(systemDomain.toLowerCase())) {
local = true;
if (VIVO.equalsIgnoreCase(system)) {
url ... | public JSONObject getRDF(String uri, String output, String containerSessionId, SecurityToken token) throws Exception {
String url = uri;
boolean local = false;
if (systemDomain != null && url.toLowerCase().startsWith(systemDomain.toLowerCase())) {
local = true;
if (VIVO.equalsIgnoreCase(system)) {
url ... |
public XmcdDisc next() throws XmcdExtractionException, XmcdMissingInformationException {
XmcdDisc xmcdDisc;
try {
while ((nextEntry != null) && (nextEntry.isDirectory())) {
nextEntry = tar.getNextTarEntry();
}
currentEntry = nextEntry;
... | public XmcdDisc next() throws XmcdExtractionException, XmcdMissingInformationException {
XmcdDisc xmcdDisc;
try {
while ((nextEntry != null) && (nextEntry.isDirectory())) {
nextEntry = tar.getNextTarEntry();
}
currentEntry = nextEntry;
... |
public SimpleMessageListenerContainer messageListenerContainer() {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
container.setConnectionFactory(connectionFactory());
container.setQueues(machineQueue());
container.setMessageListener(new MessageListen... | public SimpleMessageListenerContainer messageListenerContainer() {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
container.setConnectionFactory(connectionFactory());
container.setQueues(machineQueue());
container.setMessageListener(new MessageListen... |
public boolean isSameType( IType obj ){
if( obj == this )
return true;
if( obj instanceof ITypedef )
return obj.isSameType( this );
if( obj instanceof ICQualifierType ){
ICQualifierType qt = (ICQualifierType) obj;
try {
if( isConst() != qt.isConst() ) ret... | public boolean isSameType( IType obj ){
if( obj == this )
return true;
if( obj instanceof ITypedef )
return obj.isSameType( this );
if( obj instanceof ICQualifierType ){
ICQualifierType qt = (ICQualifierType) obj;
try {
if( isConst() != qt.isConst() ) ret... |
public GlobalStats() throws IOException {
final String apiUrl = "http://api.mcstats.org/1.0/All+Servers/graph/Global+Statistics";
final String jsonString = getPage(apiUrl);
final JsonObject jsonObject = new JsonParser().parse(jsonString).getAsJsonObject();
final J... | public GlobalStats() throws IOException {
final String apiUrl = "http://api.mcstats.org/1.0/All+Servers/graph/Global+Statistics";
final String jsonString = getPage(apiUrl);
final JsonObject jsonObject = new JsonParser().parse(jsonString).getAsJsonObject();
final J... |
protected void setUp() throws Exception {
super.setUp();
System.setProperty(Context.INITIAL_CONTEXT_FACTORY, SpringInitialContextFactory.class.getName());
System.setProperty(Context.PROVIDER_URL, "jndi.xml");
TransactionManagerFactoryBean factory = new TransactionManagerFactoryBean()... | protected void setUp() throws Exception {
super.setUp();
System.setProperty(Context.INITIAL_CONTEXT_FACTORY, SpringInitialContextFactory.class.getName());
System.setProperty(Context.PROVIDER_URL, "jndi.xml");
TransactionManagerFactoryBean factory = new TransactionManagerFactoryBean()... |
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.tether_prefs);
final Activity activity = getActivity();
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
if (adapter != null) {
adapter.getProfileProxy(a... | public void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.tether_prefs);
final Activity activity = getActivity();
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
if (adapter != null) {
adapter.getProfileProxy(a... |
public NewWaveEvent(Arena arena, Wave wave, int waveNo) {
this.wave = wave;
this.waveNo = waveNo;
}
| public NewWaveEvent(Arena arena, Wave wave, int waveNo) {
this.arena = arena;
this.wave = wave;
this.waveNo = waveNo;
}
|
public char getopt(String argv[]) {
Debug.println("getopt",
"optind=" + optind + ", argv.length="+argv.length);
if (optind >= (argv.length)-1) {
done = true;
}
if (done) {
return DONE;
}
String thisArg = argv[optind++];
if (thisArg.startsWith("-")) {
optarg = null;
for (int i=0; i<options.... | public char getopt(String argv[]) {
Debug.println("getopt",
"optind=" + optind + ", argv.length="+argv.length);
if (optind >= (argv.length)-1) {
done = true;
}
if (done) {
return DONE;
}
String thisArg = argv[optind++];
if (thisArg.startsWith("-")) {
optarg = null;
for (int i=0; i<options.... |
public BaseActionInterface buildAction(Context context, String name) {
BaseActionInterface seedAction = null;
if ("beak".equals(name))
seedAction = new BeakeringAction(context);
else if ("cut".equals(name))
seedAction = new CuttingAction(context);
else if ("lighten".equals(name))
seedAction = new Ligh... | public BaseActionInterface buildAction(Context context, String name) {
BaseActionInterface seedAction = null;
if ("beak".equals(name))
seedAction = new BeakeringAction(context);
else if ("cut".equals(name))
seedAction = new CuttingAction(context);
else if ("lighten".equals(name))
seedAction = new Ligh... |
public void handleRequest(EngineRequest request, EngineResponse response, JSAPResult results) throws HokanException {
String horo = results.getString(ARG_HORO);
HoroUpdater horoUpdater = (HoroUpdater) updaterManagerService.getUpdater("horoUpdater");
UpdaterData updaterData = new UpdaterData();
horoUpd... | public void handleRequest(EngineRequest request, EngineResponse response, JSAPResult results) throws HokanException {
String horo = results.getString(ARG_HORO);
HoroUpdater horoUpdater = (HoroUpdater) updaterManagerService.getUpdater("horoUpdater");
UpdaterData updaterData = new UpdaterData();
horoUpd... |
public LabOrderListItem saveLabOrder(Integer orderId, Integer patientId, String orderConceptStr, String orderLocationStr, String orderDateStr, String accessionNumber, String discontinuedDateStr, Map<String, LabResultListItem> labResults) {
log.debug("Saving LabOrder with params: " + orderId + ", " + patientId + ", "... | public LabOrderListItem saveLabOrder(Integer orderId, Integer patientId, String orderConceptStr, String orderLocationStr, String orderDateStr, String accessionNumber, String discontinuedDateStr, Map<String, LabResultListItem> labResults) {
log.debug("Saving LabOrder with params: " + orderId + ", " + patientId + ", "... |
private static ChatRoomResultSet crrsPostRequest(List<NameValuePair> rgparam, String stUrl) {
JSONObject json = makeRequest(stUrl, rgparam);
try {
boolean fSucceeded = json.getString(RequestParameters.PARAMETER_SUCCESS).equals("true");
if (fSucceeded) {
List<ChatRoomInfo> rg... | private static ChatRoomResultSet crrsPostRequest(List<NameValuePair> rgparam, String stUrl) {
JSONObject json = makeRequest(stUrl, rgparam);
try {
boolean fSucceeded = json.getString(RequestParameters.PARAMETER_SUCCESS).equals("true");
if (fSucceeded) {
List<ChatRoomInfo> rg... |
public void doGo(Session session, Exit exit) {
Character chara = session.character;
String name = chara.givenName;
chara.writeLnToRoom(String.format(customMsg(exit.exitMsg,"%s moves %s."), name, exit.name));
session.writeLn(String.format(customMsg(exit.travelMsg,"You move %s."), exit.name));
chara.setRoom(ex... | public void doGo(Session session, Exit exit) {
Character chara = session.character;
String name = chara.givenName;
chara.writeLnToRoom(String.format(customMsg(exit.exitMsg,"%s moves %s."), name, exit.name));
session.writeLn(String.format(customMsg(exit.travelMsg,"You move %s."), exit.name));
chara.setRoom(ex... |
public static void main(String argv[]) {
if (argv.length < 2) {
printUsage();
System.exit(1);
}
XMLParserConfiguration parserConfiguration = null;
String arg = null;
int i = 0;
arg = argv[i];
if (arg.equals("-p")) {
i++;
... | public static void main(String argv[]) {
if (argv.length < 2) {
printUsage();
System.exit(1);
}
XMLParserConfiguration parserConfiguration = null;
String arg = null;
int i = 0;
arg = argv[i];
if (arg.equals("-p")) {
i++;
... |
public final ProcessorResult processAttribute(final Arguments arguments, final Element element, final String attributeName) {
final RemovalType removalType = getRemovalType(arguments, element, attributeName);
if (removalType == null) {
return ProcessorResult.OK;
}
switch ... | public final ProcessorResult processAttribute(final Arguments arguments, final Element element, final String attributeName) {
final RemovalType removalType = getRemovalType(arguments, element, attributeName);
if (removalType == null) {
return ProcessorResult.OK;
}
switch ... |
public boolean handleTransfer(JTextComponent targetComponent) {
String code = NbBundle.getMessage( Circle.class, "TEMPLATE_Text" );
CodeTemplateManager ctm = CodeTemplateManager.get( targetComponent.getDocument());
CodeTemplate template = ctm.createTemporary( code );
template.insert(... | public boolean handleTransfer(JTextComponent targetComponent) {
String code = NbBundle.getMessage( Circle.class, "TEMPLATE_Text" );
CodeTemplateManager ctm = CodeTemplateManager.get( targetComponent.getDocument());
CodeTemplate template = ctm.createTemporary( code );
template.insert(... |
protected Object doInBackground(Object... params) {
int updatedRows = 0;
boolean serverUpdated = false;
boolean netOn = Util.isNetworkOn(mContext);
try {
String sessionId = ((SugarCrmApp) SugarCrmApp.app).getSessionId();
String url = SugarCrmSettings.getSugarR... | protected Object doInBackground(Object... params) {
int updatedRows = 0;
boolean serverUpdated = false;
boolean netOn = Util.isNetworkOn(mContext);
try {
String sessionId = ((SugarCrmApp) SugarCrmApp.app).getSessionId();
String url = SugarCrmSettings.getSugarR... |
private Object addConstraint(IntVariable v1, BinaryOp op, Object o2) {
switch (op) {
case BITAND:
if (o2 instanceof IntVariable) {
v1.bitand((IntVariable) o2);
} else if (o2 instanceof Integer) {
v1.bitand((Integer) o2);
} else {
break;
}
case EQ:
if (o2 instanceof IntVaria... | private Object addConstraint(IntVariable v1, BinaryOp op, Object o2) {
switch (op) {
case BITAND:
if (o2 instanceof IntVariable) {
v1.bitand((IntVariable) o2);
} else if (o2 instanceof Integer) {
v1.bitand((Integer) o2);
} else {
break;
}
case EQ:
if (o2 instanceof IntVaria... |
public void process(MApplication application, EModelService modelService) {
MCommand command = null;
for (MCommand cmd : application.getCommands()) {
if (E4_TOOLING_LIVEMODEL.equals(cmd.getElementId())) {
command = cmd;
}
}
if (command == null) {
command = modelService.createModelElement(MCommand.... | public void process(MApplication application, EModelService modelService) {
MCommand command = null;
for (MCommand cmd : application.getCommands()) {
if (E4_TOOLING_LIVEMODEL.equals(cmd.getElementId())) {
command = cmd;
}
}
if (command == null) {
command = modelService.createModelElement(MCommand.... |
private ConstrettoConfiguration buildConfig(Element element, ConfigurationContextResolver configurationContextResolver) {
ConstrettoBuilder builder = new ConstrettoBuilder(configurationContextResolver, true);
Element storeElement = DomUtils.getChildElementByTagName(element, "stores");
... | private ConstrettoConfiguration buildConfig(Element element, ConfigurationContextResolver configurationContextResolver) {
ConstrettoBuilder builder = new ConstrettoBuilder(configurationContextResolver, true);
Element storeElement = DomUtils.getChildElementByTagName(element, "stores");
... |
protected <T> T get(String key, ValueCreator<T> creator, T defaultValue)
{
T value = (T)cachedAttributes.get(key);
if (value == null)
{
Parameter parameter = parameters.get(key);
if (parameter != null)
{
Object paramValue = parameter.getValue();
... | protected <T> T get(String key, ValueCreator<T> creator, T defaultValue)
{
T value = (T)cachedAttributes.get(key);
if (value == null)
{
Parameter parameter = parameters.get(key);
if (parameter != null)
{
Object paramValue = parameter.getValue();
... |
private void complete(ClassOrInterface klass, ClassMirror classMirror) {
Map<MethodMirror, List<MethodMirror>> variables = new HashMap<MethodMirror, List<MethodMirror>>();
boolean isFromJDK = isFromJDK(classMirror);
boolean isCeylon = (classMirror.getAnnotation(CEYLON_CEYLON_ANNOTATION) != n... | private void complete(ClassOrInterface klass, ClassMirror classMirror) {
Map<MethodMirror, List<MethodMirror>> variables = new HashMap<MethodMirror, List<MethodMirror>>();
boolean isFromJDK = isFromJDK(classMirror);
boolean isCeylon = (classMirror.getAnnotation(CEYLON_CEYLON_ANNOTATION) != n... |
private void initComponents() {
bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
appBean = getApplicationBean();
partySummaryList = createPartySummaryList();
applicationDocumentsHelper = new org.sola.clients.beans.application.ApplicationDocumentsHelperBean();
vali... | private void initComponents() {
bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
appBean = getApplicationBean();
partySummaryList = createPartySummaryList();
applicationDocumentsHelper = new org.sola.clients.beans.application.ApplicationDocumentsHelperBean();
vali... |
public Object exec(Tuple tuple) throws IOException {
getInputSchema();
RList result_list;
try {
List<RType> params = RUtils.pigTupleToR(tuple, inputSchema, 0).expand();
String paramStr = params.isEmpty() ? "" : params.get(0).toRString();
for(int i = 1; i <... | public Object exec(Tuple tuple) throws IOException {
getInputSchema();
RList result_list;
try {
List<RType> params = RUtils.pigTupleToR(tuple, inputSchema, 0).expand();
String paramStr = params.isEmpty() ? "" : params.get(0).toRString();
for(int i = 1; i <... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.