blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2
values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 7 5.41M | extension stringclasses 11
values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e63e598152974d506066974ce722232856ee104b | 66894d2375e5af66b3d447b87867336bbe1c1531 | /src/ejerciciosCaracteres/Ejercicio4.java | 69496be3a757abfcf5df2fec3b0c5bb7ebb8636b | [] | no_license | JuanJJ/ejerciciosCaracteres | 82d5dd490afe0593153abcce07b0ca9563efb559 | 280424fe313d8f749fe76d3646c4ace19bc4b809 | refs/heads/master | 2020-06-18T19:31:37.069852 | 2019-07-11T15:26:28 | 2019-07-11T15:26:28 | 196,420,329 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 1,747 | java | package ejerciciosCaracteres;
import java.util.Scanner;
public class Ejercicio4 {
public Ejercicio4() {
super();
String letradni="TRWAGMYFPDXBNJZSQVHLCKE";
String dni="";
boolean dnicorrecto=false;
Scanner leer=new Scanner(System.in);
do {
System.out.println("Introduce un DNI para comprobar que sea correcto");
dni=leer.nextLine();
dnicorrecto=compruebadni(dni);
compruebaletra(dni, letradni);
System.out.println();
} while (dnicorrecto!=true);
}
private void compruebaletra(String dni, String letradni) {
// TODO Apéndice de método generado automáticamente
int resto=0;
int numdni=Integer.parseInt(dni.substring(0, 8));
resto=numdni%23;
char caracterdni=letradni.charAt(resto);
boolean letracorrecta=caracterdni==Character.toUpperCase(dni.charAt(8));
if (letracorrecta) {
System.out.println("El dni "+dni+" tiene la letra correcta "+caracterdni);
} else {
System.out.println("Al dni "+dni+" le corresponde la letra "+caracterdni);
}
}
//comprueba si el dni tiene el formato correcto
private boolean compruebadni(String dni) {
// TODO Apéndice de método generado automáticamente
boolean dnivalido=true;
boolean tamaño=dni.length()==9;
try {
int numdni=Integer.parseInt(dni.substring(0, 8));
} catch (NumberFormatException e) {
// TODO: handle exception
System.out.println("El DNI introducido es incorrecto");
dnivalido=false;
return dnivalido;
}
int numletra=dni.charAt(8);
boolean letra=(numletra>=65&&numletra<=90)||(numletra>=97&&numletra<=122);
dnivalido=tamaño&&letra;
if (dnivalido==false) {
System.out.println("El DNI introducido es incorrecto");
}
return dnivalido;
}
}
| [
"setzer86@gmail.com"
] | setzer86@gmail.com |
e0c2886e6a2456872a9032daad21434dfeef6c2a | b1a5712b4704bad941bd70701b87d4a97b1bd139 | /org-netbeans-core-windows/src/main/java/org/netbeans/core/windows/actions/ActionUtils.java | e13aed3bb70afb64d25915cb91fc6a41c4a9a6b0 | [
"Apache-2.0"
] | permissive | aditosoftware/adito-nb-modules | e735922096a44d11830db990d42f16e17bc7ec6f | 5b8f2f928cd334fe6b576177b78d65e1914da0e8 | refs/heads/master | 2023-08-08T07:39:11.174392 | 2023-07-25T11:41:23 | 2023-07-25T11:41:23 | 142,895,048 | 2 | 3 | Apache-2.0 | 2023-09-13T09:27:30 | 2018-07-30T15:34:59 | Java | UTF-8 | Java | false | false | 24,725 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.netbeans.core.windows.actions;
import java.awt.event.*;
import java.io.IOException;
import java.util.*;
import javax.swing.*;
import org.netbeans.core.windows.*;
import org.netbeans.core.windows.view.ui.slides.SlideController;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.awt.Actions;
import org.openide.awt.Mnemonics;
import org.openide.cookies.SaveCookie;
import org.openide.util.*;
import org.openide.util.actions.Presenter;
import org.openide.windows.Mode;
import org.openide.windows.TopComponent;
/**
* Utility class for creating contextual actions for window system
* and window action handlers.
*
* @author Peter Zavadsky
*/
public abstract class ActionUtils {
private static HashMap<Object, Object> sharedAccelerators = new HashMap<Object, Object>();
private ActionUtils() {}
public static Action[] createDefaultPopupActions(TopComponent tc) {
ModeImpl mode = findMode(tc);
int kind = mode != null ? mode.getKind() : Constants.MODE_KIND_EDITOR;
TopComponentTracker tcTracker = TopComponentTracker.getDefault();
boolean isEditor = tcTracker.isEditorTopComponent( tc );
List<Action> actions = new ArrayList<Action>();
if(kind == Constants.MODE_KIND_EDITOR) {
//close window
if( Switches.isClosingEnabled(tc)) {
if( (isEditor && Switches.isEditorTopComponentClosingEnabled())
|| (!isEditor && Switches.isViewTopComponentClosingEnabled()) ) {
actions.add(new CloseWindowAction(tc));
}
}
if( Switches.isEditorTopComponentClosingEnabled() ) {
//close all
actions.add(new CloseAllDocumentsAction(true));
//close all but this
CloseAllButThisAction allBut = new CloseAllButThisAction(tc, true);
if (mode != null && mode.getOpenedTopComponents().size() == 1) {
allBut.setEnabled(false);
}
actions.add(allBut);
}
actions.add(null); // Separator
//maximize window
if( Switches.isTopComponentMaximizationEnabled() && Switches.isMaximizationEnabled(tc)) {
actions.add(new MaximizeWindowAction(tc));
}
//undock window
if( Switches.isTopComponentUndockingEnabled() && Switches.isUndockingEnabled(tc)) {
actions.add(new UndockWindowAction(tc));
}
//undock group
if( Switches.isEditorModeUndockingEnabled() && isEditor )
actions.add( new UndockModeAction( mode) );
//dock window
if( Switches.isTopComponentUndockingEnabled() && Switches.isUndockingEnabled(tc)) {
actions.add(new DockWindowAction(tc));
}
//dock group
if( Switches.isEditorModeUndockingEnabled() && isEditor )
actions.add( new DockModeAction( mode, null ) );
//move window left
actions.add( MoveWindowWithinModeAction.createMoveLeft(tc) );
//move window right
actions.add( MoveWindowWithinModeAction.createMoveRight(tc));
if( isEditor ) {
actions.add( null ); // Separator
actions.add(new CloneDocumentAction(tc));
actions.add(new NewTabGroupAction(tc));
actions.add( new CollapseTabGroupAction( mode ) );
}
} else if (kind == Constants.MODE_KIND_VIEW) {
//close window
if( Switches.isClosingEnabled(tc)) {
if( (isEditor && Switches.isEditorTopComponentClosingEnabled())
|| (!isEditor && Switches.isViewTopComponentClosingEnabled()) ) {
actions.add(new CloseWindowAction(tc));
}
}
//close group
if( Switches.isModeClosingEnabled() ) {
actions.add(new CloseModeAction(mode));
}
actions.add( null ); //separator
//maximize window
if (Switches.isTopComponentMaximizationEnabled()
&& Switches.isMaximizationEnabled(tc)) {
actions.add(new MaximizeWindowAction(tc));
}
//minimize window
if( Switches.isTopComponentSlidingEnabled() && Switches.isSlidingEnabled( tc ) )
actions.add( createMinimizeWindowAction( tc ) );
//minimize group
if( Switches.isModeSlidingEnabled() )
actions.add( new MinimizeModeAction( mode) );
//undock window
if( Switches.isTopComponentUndockingEnabled() && Switches.isUndockingEnabled(tc)) {
actions.add(new UndockWindowAction(tc));
}
//undock group
if( Switches.isViewModeUndockingEnabled() )
actions.add( new UndockModeAction( mode) );
//dock window
if( Switches.isTopComponentUndockingEnabled() && Switches.isUndockingEnabled(tc)) {
actions.add(new DockWindowAction(tc));
}
//dock group
if( Switches.isViewModeUndockingEnabled() )
actions.add( new DockModeAction( mode, null ) );
actions.add( null ); // Separator
//move window
actions.add( new MoveWindowAction( tc ) );
//move window left
actions.add( MoveWindowWithinModeAction.createMoveLeft(tc) );
//move window right
actions.add( MoveWindowWithinModeAction.createMoveRight(tc));
//move group
actions.add( new MoveModeAction( mode) );
//size group
actions.add( new ResizeModeAction( mode) );
if( isEditor ) {
actions.add( null ); // Separator
actions.add(new CloneDocumentAction(tc));
}
} else if (kind == Constants.MODE_KIND_SLIDING) {
//close window
if( Switches.isClosingEnabled(tc)) {
if( (isEditor && Switches.isEditorTopComponentClosingEnabled())
|| (!isEditor && Switches.isViewTopComponentClosingEnabled()) ) {
actions.add(new CloseWindowAction(tc));
}
}
//close group
if( Switches.isModeClosingEnabled() ) {
actions.add(new CloseModeAction(mode));
}
actions.add( null ); //separator
//maximize window
if (Switches.isTopComponentMaximizationEnabled()
&& Switches.isMaximizationEnabled(tc)) {
actions.add(new MaximizeWindowAction(tc));
}
//minimize window
if( Switches.isTopComponentSlidingEnabled() && Switches.isSlidingEnabled( tc ) )
actions.add(createDisabledAction("CTL_MinimizeWindowAction"));
//minimize group
if( Switches.isModeSlidingEnabled() )
actions.add(createDisabledAction("CTL_MinimizeModeAction"));
//undock window
if( Switches.isTopComponentUndockingEnabled() && Switches.isUndockingEnabled(tc)) {
actions.add(new UndockWindowAction(tc));
}
//undock group
if( Switches.isViewModeUndockingEnabled() )
actions.add(createDisabledAction("CTL_UndockModeAction"));
//dock window
if( Switches.isTopComponentUndockingEnabled() && Switches.isUndockingEnabled(tc)) {
actions.add(new DockWindowAction(tc));
}
//dock group
if( Switches.isViewModeUndockingEnabled() || Switches.isModeSlidingEnabled() )
actions.add( new DockModeAction( findPreviousMode( tc, mode ), mode) );
actions.add( null ); // Separator
//move window
actions.add(createDisabledAction("CTL_MoveWindowAction"));
//move group
actions.add(createDisabledAction("CTL_MoveModeAction"));
//size group
actions.add(createDisabledAction("CTL_ResizeModeAction"));
if( isEditor ) {
actions.add( null ); // Separator
actions.add(new CloneDocumentAction(tc));
}
}
Action[] res = actions.toArray(new Action[actions.size()]);
for( ActionsFactory factory : Lookup.getDefault().lookupAll( ActionsFactory.class ) ) {
res = factory.createPopupActions( tc, res );
}
return res;
}
public static Action[] createDefaultPopupActions(ModeImpl mode) {
int kind = mode != null ? mode.getKind() : Constants.MODE_KIND_EDITOR;
List<Action> actions = new ArrayList<Action>();
if(kind == Constants.MODE_KIND_EDITOR) {
if( Switches.isEditorTopComponentClosingEnabled() ) {
actions.add(createDisabledAction("CTL_CloseWindowAction"));
actions.add(new CloseAllDocumentsAction(true));
actions.add(createDisabledAction("CTL_CloseAllButThisAction")); //NOI18N
actions.add(null); // Separator
}
actions.add(null); // Separator
//maximize window
if( Switches.isTopComponentMaximizationEnabled() ) {
actions.add(createDisabledAction("CTL_MaximizeWindowAction"));
}
//float window
if( Switches.isTopComponentUndockingEnabled()) {
actions.add(createDisabledAction("CTL_UndockWindowAction"));
}
//float group
if( Switches.isEditorModeUndockingEnabled()) {
actions.add(new UndockModeAction(mode));
}
//dock window
if( Switches.isTopComponentUndockingEnabled()) {
actions.add(createDisabledAction("CTL_UndockWindowAction_Dock"));
}
//dock group
if( Switches.isEditorModeUndockingEnabled() )
actions.add( new DockModeAction( mode, null ) );
actions.add(null); // Separator
actions.add(createDisabledAction("CTL_CloneDocumentAction"));
actions.add(createDisabledAction("CTL_NewTabGroupAction"));
actions.add( new CollapseTabGroupAction( mode ) );
} else if (kind == Constants.MODE_KIND_VIEW) {
//close window
if( Switches.isViewTopComponentClosingEnabled() ) {
actions.add(createDisabledAction("CTL_CloseWindowAction"));
}
//close group
if( Switches.isModeClosingEnabled() ) {
actions.add(new CloseModeAction(mode));
}
actions.add( null ); //separator
// maximize window
if (Switches.isTopComponentMaximizationEnabled() ) {
actions.add(createDisabledAction("CTL_MaximizeWindowAction"));
}
//minimize window
if (Switches.isTopComponentSlidingEnabled() ) {
actions.add(createDisabledAction("LBL_AutoHideWindowAction"));
}
//minimize group
if( Switches.isModeSlidingEnabled() )
actions.add( new MinimizeModeAction( mode) );
//float window
if( Switches.isTopComponentUndockingEnabled() ) {
actions.add(createDisabledAction("CTL_UndockWindowAction"));
}
//float group
if( Switches.isViewModeUndockingEnabled() )
actions.add( new UndockModeAction( mode) );
//dock window
if( Switches.isTopComponentUndockingEnabled()) {
actions.add(createDisabledAction("CTL_UndockWindowAction_Dock"));
}
//dock group
if( Switches.isViewModeUndockingEnabled() )
actions.add( new DockModeAction( mode, null ) );
actions.add( null );
//move window
actions.add(createDisabledAction("CTL_MoveWindowAction"));
//move group
actions.add( new MoveModeAction( mode ) );
//size group
actions.add( new ResizeModeAction( mode ) );
} else if (kind == Constants.MODE_KIND_SLIDING) {
if( Switches.isViewTopComponentClosingEnabled() ) {
actions.add(createDisabledAction("CTL_CloseWindowAction"));
actions.add(new CloseModeAction(mode));
}
if (mode.getState() == Constants.MODE_STATE_JOINED
&& Switches.isTopComponentMaximizationEnabled()) {
actions.add(createDisabledAction("CTL_MaximizeWindowAction"));
}
if( Switches.isTopComponentUndockingEnabled() ) {
actions.add(createDisabledAction("CTL_UndockWindowAction"));
}
}
Action[] res = actions.toArray(new Action[actions.size()]);
for( ActionsFactory factory : Lookup.getDefault().lookupAll( ActionsFactory.class ) ) {
res = factory.createPopupActions( mode, res );
}
return res;
}
static Action createMinimizeWindowAction( TopComponent tc ) {
SlideController slideController = ( SlideController ) SwingUtilities.getAncestorOfClass( SlideController.class, tc );
ModeImpl mode = findMode( tc );
int tabIndex = null == mode ? -1 : mode.getOpenedTopComponents().indexOf( tc );
boolean initialState = WindowManagerImpl.getInstance().isTopComponentMinimized( tc );
Action res = new AutoHideWindowAction( slideController, tabIndex, initialState );
res.setEnabled( null != mode && mode.getState() == Constants.MODE_STATE_JOINED );
return res;
}
/** Auto-hide toggle action */
public static final class AutoHideWindowAction extends AbstractAction implements Presenter.Popup {
private final SlideController slideController;
private final int tabIndex;
private boolean state;
private JCheckBoxMenuItem menuItem;
public AutoHideWindowAction(SlideController slideController, int tabIndex, boolean initialState) {
super();
this.slideController = slideController;
this.tabIndex = tabIndex;
this.state = initialState;
putValue(Action.NAME, NbBundle.getMessage(ActionUtils.class, "LBL_AutoHideWindowAction"));
}
public HelpCtx getHelpCtx() {
return null;
}
/** Chnage boolean state and delegate event to winsys through
* SlideController (implemented by SlideBar component)
*/
@Override
public void actionPerformed(ActionEvent e) {
// update state and menu item
state = !state;
getMenuItem().setSelected(state);
// send event to winsys
slideController.userToggledAutoHide(tabIndex, state);
}
@Override
public JMenuItem getPopupPresenter() {
return getMenuItem();
}
private JCheckBoxMenuItem getMenuItem() {
if (menuItem == null) {
menuItem = new JCheckBoxMenuItem("", state);
Mnemonics.setLocalizedText(menuItem, (String)getValue(Action.NAME));
//#45940 - hardwiring the shortcut UI since the actual shortcut processignb is also
// hardwired in AbstractTabViewDisplayerUI class.
// later this should be probably made customizable?
// -> how to get rid of the parameters passed to the action here then?
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, InputEvent.CTRL_DOWN_MASK));
menuItem.addActionListener(this);
menuItem.setEnabled(isEnabled());
}
return menuItem;
}
} // End of class AutoHideWindowAction
/**
* Toggle transparency of slided-in window
*/
public static final class ToggleWindowTransparencyAction extends AbstractAction {
public ToggleWindowTransparencyAction(SlideController slideController, int tabIndex, boolean initialState) {
super();
putValue(Action.NAME, NbBundle.getMessage(ActionUtils.class, "LBL_ToggleWindowTransparencyAction")); //NOI18N
}
public HelpCtx getHelpCtx() {
return null;
}
@Override
public void actionPerformed(ActionEvent e) {
DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message(
NbBundle.getMessage(ActionUtils.class, "LBL_WindowTransparencyHint"), NotifyDescriptor.INFORMATION_MESSAGE)); //NOI18N
}
} // End of class ToggleWindowTransparencyAction
private static class CloneDocumentAction extends AbstractAction {
private final TopComponent tc;
public CloneDocumentAction(TopComponent tc) {
this.tc = tc;
putValue(Action.NAME, NbBundle.getMessage(ActionUtils.class, "LBL_CloneDocumentAction"));
//hack to insert extra actions into JDev's popup menu
putValue("_nb_action_id_", "clone"); //NOI18N
setEnabled(tc instanceof TopComponent.Cloneable);
}
@Override
public void actionPerformed(ActionEvent evt) {
cloneWindow(tc);
}
} // End of class CloneDocumentAction.
// Utility methods >>
/** Closes all documents, based on isContext flag
*
* @param isContext when true, closes all documents in active mode only,
* otherwise closes all documents in the system
*/
public static void closeAllDocuments (boolean isContext) {
if (isContext) {
TopComponent activeTC = TopComponent.getRegistry().getActivated();
List<TopComponent> tcs = getOpened(activeTC);
closeAll( tcs.toArray(new TopComponent[tcs.size()]) );
} else {
TopComponent[] tcs = WindowManagerImpl.getInstance().getEditorTopComponents();
closeAll( tcs );
}
}
private static void closeAll( TopComponent[] tcs ) {
for( TopComponent tc: tcs ) {
if( !Switches.isClosingEnabled(tc) )
continue;
final TopComponent toBeClosed = tc;
SwingUtilities.invokeLater( new Runnable() {
@Override
public void run() {
toBeClosed.putClientProperty("inCloseAll", Boolean.TRUE);
toBeClosed.close();
}
});
}
}
/** Closes all documents except given param, according to isContext flag
*
* @param isContext when true, closes all documents except given
* in active mode only, otherwise closes all documents in the system except
* given
*/
public static void closeAllExcept (TopComponent tc, boolean isContext) {
if (isContext) {
List<TopComponent> tcs = getOpened(tc);
for(TopComponent curTC: tcs) {
if( !Switches.isClosingEnabled(curTC) )
continue;
if (curTC != tc) {
curTC.putClientProperty("inCloseAll", Boolean.TRUE);
curTC.close();
}
}
} else {
TopComponent[] tcs = WindowManagerImpl.getInstance().getEditorTopComponents();
for(TopComponent curTC: tcs) {
if( !Switches.isClosingEnabled(curTC) )
continue;
if (curTC != tc) {
curTC.putClientProperty("inCloseAll", Boolean.TRUE);
curTC.close();
}
}
}
}
/** Returns List of opened top components in mode of given TopComponent.
*/
private static List<TopComponent> getOpened (TopComponent tc) {
ModeImpl mode = findMode(tc);
List<TopComponent> tcs = new ArrayList<TopComponent>();
if (mode != null) {
tcs.addAll(mode.getOpenedTopComponents());
}
return tcs;
}
static void closeWindow(TopComponent tc) {
tc.close();
}
private static void saveDocument(TopComponent tc) {
SaveCookie sc = getSaveCookie(tc);
if(sc != null) {
try {
sc.save();
} catch(IOException ioe) {
Exceptions.printStackTrace(ioe);
}
}
}
private static SaveCookie getSaveCookie(TopComponent tc) {
Lookup lookup = tc.getLookup();
Object obj = lookup.lookup(SaveCookie.class);
if(obj instanceof SaveCookie) {
return (SaveCookie)obj;
}
return null;
}
static void cloneWindow(TopComponent tc) {
if(tc instanceof TopComponent.Cloneable) {
TopComponent clone = ((TopComponent.Cloneable)tc).cloneComponent();
int openIndex = -1;
Mode m = findMode(tc);
if( null != m ) {
TopComponent[] tcs = m.getTopComponents();
for( int i=0; i<tcs.length; i++ ) {
if( tcs[i] == tc ) {
openIndex = i + 1;
break;
}
}
if( openIndex >= tcs.length )
openIndex = -1;
}
if( openIndex >= 0 ) {
clone.openAtTabPosition(openIndex);
} else {
clone.open();
}
clone.requestActive();
}
}
static void putSharedAccelerator (Object key, Object value) {
sharedAccelerators.put(key, value);
}
static Object getSharedAccelerator (Object key) {
return sharedAccelerators.get(key);
}
private static Action createDisabledAction( String bundleKey ) {
return new DisabledAction( NbBundle.getMessage(ActionUtils.class, bundleKey) );
}
private static class DisabledAction extends AbstractAction {
private DisabledAction( String name ) {
super( name );
}
@Override
public void actionPerformed( ActionEvent e ) {
}
@Override
public boolean isEnabled() {
return false;
}
}
// Utility methods <<
static ModeImpl findMode( TopComponent tc ) {
WindowManagerImpl wm = WindowManagerImpl.getInstance();
ModeImpl mode = (ModeImpl)wm.findMode(tc);
if( null == mode ) {
//maybe it's multiview element
TopComponent multiviewParent = ( TopComponent ) SwingUtilities.getAncestorOfClass( TopComponent.class, tc);
if( null != multiviewParent )
mode = (ModeImpl)wm.findMode(multiviewParent);
}
return mode;
}
private static ModeImpl findPreviousMode( TopComponent tc, ModeImpl slidingMode ) {
ModeImpl res = null;
WindowManagerImpl wm = WindowManagerImpl.getInstance();
String tcId = wm.findTopComponentID( tc );
if( null != tcId ) {
res = wm.getPreviousModeForTopComponent( tcId, slidingMode );
}
return res;
}
}
| [
"j.boesl@adito.de"
] | j.boesl@adito.de |
3e245dc5c0f76ffc71de9ff52a7f3133a570bc5e | bd0f43bc4e02f3cf4566c06b2b539ca13b156a55 | /src/main/java/com/victorgasparillo/android/criminalintent/CrimeActivity.java | d80a80db14893251d31958cb9e4260c5b8e45b5e | [] | no_license | GaspaDev/Criminal_Intent | 6fcf48ca6ad38258a956a078ac5ddd830f0e92ac | db50d244a9e18083589164e5654865b4a678d8ee | refs/heads/master | 2020-03-19T01:19:15.877285 | 2018-05-31T05:35:39 | 2018-05-31T05:35:39 | 135,537,184 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 332 | java | package com.victorgasparillo.android.criminalintent;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class CrimeActivity extends SingleFragmentActivity {
@Override
protected Fragment createFragment() {
return new CrimeFragment();
}
}
| [
"GaspaDev@gmail.com"
] | GaspaDev@gmail.com |
7d65b81f73c2b86b40a5a393a175fd8178faa5fb | d8f0461db2f54abde5ebef078399703e898433de | /carfax_ucl_qa/src/test/java/com/carfax_ucl/runners/CukesRunner.java | 5f6db65b473eed7890e5d2f3a95aa0af9c20b055 | [] | no_license | Sean-Xiao-Liu/CarfaxQA | a8b2f3dbe592926488aed813e3b095aae975bfd2 | 4541cd79a2287d4c7661b33481aef2093b9884ea | refs/heads/master | 2021-04-21T02:12:42.012567 | 2020-03-09T15:18:52 | 2020-03-09T15:18:52 | 249,739,732 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 527 | java | package com.carfax_ucl.runners;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(
plugin = {"html:target/default-cucumber-reports",
"json:target/cucumber.json",
"rerun:target.rerun.txt"},
features = "src/test/resources/com/carfax/features",
glue = {"com/carfax_ucl/step_definitions"},
tags = "@m&d-1" ,
dryRun = false
)
public class CukesRunner {
}
| [
"annachernyshova@carfax.com"
] | annachernyshova@carfax.com |
a344ee310f8ebb618b97d051e3fcd202e5c00af1 | a655cc83cc923dd45f9944996db2adc7126dff0c | /jstun/src/main/java/de/javawi/jstun/test/BindingLifetimeTest.java | a24deeb5887af68c4bffdf31718083cb67a46a93 | [] | no_license | yuebinyun/j-stun | ca72624f6b1e49d667ccee6a1c6531e1e95cd723 | 08d5fe0ebaa30e8b39a3a9ab368da2b3925b7537 | refs/heads/master | 2020-03-23T15:13:25.255276 | 2018-08-04T15:26:50 | 2018-08-04T15:26:50 | 141,731,373 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,060 | java | /*
* This file is part of JSTUN.
*
* Copyright (c) 2005 Thomas King <king@t-king.de> - All rights
* reserved.
*
* This software is licensed under either the GNU Public License (GPL),
* or the Apache 2.0 license. Copies of both license agreements are
* included in this distribution.
*/
package de.javawi.jstun.test;
import de.javawi.jstun.attribute.*;
import de.javawi.jstun.header.MessageHeader;
import de.javawi.jstun.header.MessageHeaderParsingException;
import de.javawi.jstun.util.UtilityException;
import org.apache.log4j.Logger;
import java.io.IOException;
import java.net.*;
import java.util.Timer;
import java.util.TimerTask;
public class BindingLifetimeTest {
private static final Logger LOGGER = Logger.getLogger(BindingLifetimeTest.class);
String stunServer;
int port;
int timeout = 300; //ms
MappedAddress ma;
Timer timer;
DatagramSocket initialSocket;
// start value for binary search - should be carefully choosen
int upperBinarySearchLifetime = 345000; // ms
int lowerBinarySearchLifetime = 0;
int binarySearchLifetime = ( upperBinarySearchLifetime + lowerBinarySearchLifetime ) / 2;
// lifetime value
int lifetime = -1; // -1 means undefined.
boolean completed = false;
public BindingLifetimeTest(String stunServer, int port) {
super();
this.stunServer = stunServer;
this.port = port;
timer = new Timer(true);
}
public void test() throws UtilityException, SocketException, UnknownHostException, IOException, MessageAttributeParsingException, MessageAttributeException, MessageHeaderParsingException {
initialSocket = new DatagramSocket();
initialSocket.connect(InetAddress.getByName(stunServer), port);
initialSocket.setSoTimeout(timeout);
if (bindingCommunicationInitialSocket()) {
return;
}
BindingLifetimeTask task = new BindingLifetimeTask();
timer.schedule(task, binarySearchLifetime);
LOGGER.debug("Timer scheduled initially: " + binarySearchLifetime + ".");
}
private boolean bindingCommunicationInitialSocket() throws UtilityException, IOException, MessageHeaderParsingException, MessageAttributeParsingException {
MessageHeader sendMH = new MessageHeader(MessageHeader.MessageHeaderType.BindingRequest);
sendMH.generateTransactionID();
ChangeRequest changeRequest = new ChangeRequest();
sendMH.addMessageAttribute(changeRequest);
byte[] data = sendMH.getBytes();
DatagramPacket send = new DatagramPacket(data, data.length, InetAddress.getByName(stunServer), port);
initialSocket.send(send);
LOGGER.debug("Binding Request sent.");
MessageHeader receiveMH = new MessageHeader();
while (!(receiveMH.equalTransactionID(sendMH))) {
DatagramPacket receive = new DatagramPacket(new byte[200], 200);
initialSocket.receive(receive);
receiveMH = MessageHeader.parseHeader(receive.getData());
receiveMH.parseAttributes(receive.getData());
}
ma = (MappedAddress) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.MappedAddress);
ErrorCode ec = (ErrorCode) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.ErrorCode);
if (ec != null) {
LOGGER.debug("Message header contains an Errorcode message attribute.");
return true;
}
if (ma == null) {
LOGGER.debug("Response does not contain a Mapped Address message attribute.");
return true;
}
return false;
}
public int getLifetime() {
return lifetime;
}
public boolean isCompleted() {
return completed;
}
public void setUpperBinarySearchLifetime(int upperBinarySearchLifetime) {
this.upperBinarySearchLifetime = upperBinarySearchLifetime;
binarySearchLifetime = (upperBinarySearchLifetime + lowerBinarySearchLifetime) / 2;
}
class BindingLifetimeTask extends TimerTask {
public BindingLifetimeTask() {
super();
}
public void run() {
try {
lifetimeQuery();
} catch (Exception e) {
LOGGER.debug("Unhandled Exception. BindLifetimeTasks stopped.");
e.printStackTrace();
}
}
public void lifetimeQuery() throws UtilityException, MessageAttributeException, MessageHeaderParsingException, MessageAttributeParsingException, IOException {
try {
DatagramSocket socket = new DatagramSocket();
socket.connect(InetAddress.getByName(stunServer), port);
socket.setSoTimeout(timeout);
MessageHeader sendMH = new MessageHeader(MessageHeader.MessageHeaderType.BindingRequest);
sendMH.generateTransactionID();
ChangeRequest changeRequest = new ChangeRequest();
ResponseAddress responseAddress = new ResponseAddress();
responseAddress.setAddress(ma.getAddress());
responseAddress.setPort(ma.getPort());
sendMH.addMessageAttribute(changeRequest);
sendMH.addMessageAttribute(responseAddress);
byte[] data = sendMH.getBytes();
DatagramPacket send = new DatagramPacket(data, data.length, InetAddress.getByName(stunServer), port);
socket.send(send);
LOGGER.debug("Binding Request sent.");
MessageHeader receiveMH = new MessageHeader();
while (!(receiveMH.equalTransactionID(sendMH))) {
DatagramPacket receive = new DatagramPacket(new byte[200], 200);
initialSocket.receive(receive);
receiveMH = MessageHeader.parseHeader(receive.getData());
receiveMH.parseAttributes(receive.getData());
}
ErrorCode ec = (ErrorCode) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.ErrorCode);
if (ec != null) {
LOGGER.debug("Message header contains errorcode message attribute.");
return;
}
LOGGER.debug("Binding Response received.");
if (upperBinarySearchLifetime == (lowerBinarySearchLifetime + 1)) {
LOGGER.debug("BindingLifetimeTest completed. UDP binding lifetime: " + binarySearchLifetime + ".");
completed = true;
return;
}
lifetime = binarySearchLifetime;
LOGGER.debug("Lifetime update: " + lifetime + ".");
lowerBinarySearchLifetime = binarySearchLifetime;
binarySearchLifetime = (upperBinarySearchLifetime + lowerBinarySearchLifetime) / 2;
if (binarySearchLifetime > 0) {
BindingLifetimeTask task = new BindingLifetimeTask();
timer.schedule(task, binarySearchLifetime);
LOGGER.debug("Timer scheduled: " + binarySearchLifetime + ".");
} else {
completed = true;
}
} catch (SocketTimeoutException ste) {
LOGGER.debug("Read operation at query socket timeout.");
if (upperBinarySearchLifetime == (lowerBinarySearchLifetime + 1)) {
LOGGER.debug("BindingLifetimeTest completed. UDP binding lifetime: " + binarySearchLifetime + ".");
completed = true;
return;
}
upperBinarySearchLifetime = binarySearchLifetime;
binarySearchLifetime = (upperBinarySearchLifetime + lowerBinarySearchLifetime) / 2;
if (binarySearchLifetime > 0) {
if (bindingCommunicationInitialSocket()) {
return;
}
BindingLifetimeTask task = new BindingLifetimeTask();
timer.schedule(task, binarySearchLifetime);
LOGGER.debug("Timer scheduled: " + binarySearchLifetime + ".");
} else {
completed = true;
}
}
}
}
}
| [
"yuebinyun@gmail.com"
] | yuebinyun@gmail.com |
897363dbfe37c7b28ff7aecc71fe840aaff0ddb3 | 610baa212af6683c6826c49fff8225b3ff18cbab | /XDSmartPark_Android/app/src/main/java/org/zt/xdsmartpark/model/request/GetParkLocationRequest.java | c542275f1e4a77240be4ab549c023e8ae2ba755c | [] | no_license | ztZero/XDSmartPark | 532af33e70adc1da5c2fc3d4beb3f46610148167 | ec0ce6b925f326938bf42114826648f401e32bbc | refs/heads/master | 2022-11-26T12:09:25.856447 | 2020-08-11T06:37:35 | 2020-08-11T06:37:35 | 286,638,059 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 455 | java | package org.zt.xdsmartpark.model.request;
import com.google.gson.annotations.SerializedName;
public class GetParkLocationRequest {
@SerializedName("parkId")
private int parkId;
public GetParkLocationRequest(int parkId) {
this.parkId = parkId;
}
public GetParkLocationRequest() {
}
public int getParkId() {
return parkId;
}
public void setParkId(int parkId) {
this.parkId = parkId;
}
}
| [
"1429885979@qq.com"
] | 1429885979@qq.com |
2fe532b0cc6aa9e6fb6b650050006467483066d0 | c93811e6e3aa85d95c9daac6fbfbbde4f23fe2cf | /com.egvo.hello/src/main/java/egovframework/example/admin/resume/web/AdminResumeController.java | 196d10f0b5fda13003a4e695ac053365817aa8bd | [] | no_license | CloudShareService/Bus | e9a73c219a5e0c46145c63c596efa8b21d68997f | 932dab78d6cb96a765d2f591d034141e6fc43108 | refs/heads/master | 2020-04-16T06:01:17.197356 | 2019-01-12T04:20:29 | 2019-01-12T04:22:48 | 165,330,261 | 0 | 0 | null | 2019-01-12T01:33:02 | 2019-01-12T00:43:32 | JavaScript | UTF-8 | Java | false | false | 346 | java | package egovframework.example.admin.resume.web;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class AdminResumeController {
@RequestMapping("resume/adminResume")
private String adminResume() throws Exception {
return "admin/resume/adminResume";
}
}
| [
"kimri42@naver.com"
] | kimri42@naver.com |
19df11baa4e025cc8e86296dd9dbc0dfcffd6941 | b31120cefe3991a960833a21ed54d4e10770bc53 | /modules/org.llvm.ir/src/org/llvm/ir/DINode.java | 993695b36438e43767c4d45fff17ff1aa88906dc | [] | no_license | JianpingZeng/clank | 94581710bd89caffcdba6ecb502e4fdb0098caaa | bcdf3389cd57185995f9ee9c101a4dfd97145442 | refs/heads/master | 2020-11-30T05:36:06.401287 | 2017-10-26T14:15:27 | 2017-10-26T14:15:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 22,762 | java | /**
* This file was converted to Java from the original LLVM source file. The original
* source file follows the LLVM Release License, outlined below.
*
* ==============================================================================
* LLVM Release License
* ==============================================================================
* University of Illinois/NCSA
* Open Source License
*
* Copyright (c) 2003-2017 University of Illinois at Urbana-Champaign.
* All rights reserved.
*
* Developed by:
*
* LLVM Team
*
* University of Illinois at Urbana-Champaign
*
* http://llvm.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal with
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimers.
*
* * Redistributions in binary form must reproduce the above copyright notice
* this list of conditions and the following disclaimers in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the names of the LLVM Team, University of Illinois at
* Urbana-Champaign, nor the names of its contributors may be used to
* endorse or promote products derived from this Software without specific
* prior written permission.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
* SOFTWARE.
*
* ==============================================================================
* Copyrights and Licenses for Third Party Software Distributed with LLVM:
* ==============================================================================
* The LLVM software contains code written by third parties. Such software will
* have its own individual LICENSE.TXT file in the directory in which it appears.
* This file will describe the copyrights, license, and restrictions which apply
* to that code.
*
* The disclaimer of warranty in the University of Illinois Open Source License
* applies to all code in the LLVM Distribution, and nothing in any of the
* other licenses gives permission to use the names of the LLVM Team or the
* University of Illinois to endorse or promote products derived from this
* Software.
*
* The following pieces of software have additional or alternate copyrights,
* licenses, and/or restrictions:
*
* Program Directory
* ------- ---------
* Autoconf llvm/autoconf
* llvm/projects/ModuleMaker/autoconf
* Google Test llvm/utils/unittest/googletest
* OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex}
* pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT}
* ARM contributions llvm/lib/Target/ARM/LICENSE.TXT
* md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h
*/
package org.llvm.ir;
import org.clank.support.*;
import org.clank.support.aliases.*;
import static org.clank.support.NativePointer.*;
import static org.clank.support.Unsigned.*;
import static org.llvm.support.llvm.*;
import org.llvm.adt.*;
import org.llvm.adt.aliases.*;
import org.llvm.ir.*;
/// \brief Tagged DWARF-like metadata node.
///
/// A metadata node with a DWARF tag (i.e., a constant named \c DW_TAG_*,
/// defined in llvm/Support/Dwarf.h). Called \a DINode because it's
/// potentially used for non-DWARF output.
//<editor-fold defaultstate="collapsed" desc="llvm::DINode">
@Converted(kind = Converted.Kind.AUTO,
source = "${LLVM_SRC}/llvm/include/llvm/IR/DebugInfoMetadata.h", line = 135,
FQN="llvm::DINode", NM="_ZN4llvm6DINodeE",
cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/DebugInfoMetadata.cpp -nm=_ZN4llvm6DINodeE")
//</editor-fold>
public class DINode extends /*public*/ MDNode implements Destructors.ClassWithDestructor {
/*friend class LLVMContextImpl*/
/*friend class MDNode*/
/*protected:*/
//<editor-fold defaultstate="collapsed" desc="llvm::DINode::DINode">
@Converted(kind = Converted.Kind.AUTO,
source = "${LLVM_SRC}/llvm/include/llvm/IR/DebugInfoMetadata.h", line = 140,
FQN="llvm::DINode::DINode", NM="_ZN4llvm6DINodeC1ERNS_11LLVMContextEjNS_8Metadata11StorageTypeEjNS_8ArrayRefIPS3_EES7_",
cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/DebugInfoMetadata.cpp -nm=_ZN4llvm6DINodeC1ERNS_11LLVMContextEjNS_8Metadata11StorageTypeEjNS_8ArrayRefIPS3_EES7_")
//</editor-fold>
protected DINode(final LLVMContext /*&*/ C, /*uint*/int ID, Metadata.StorageType Storage, /*uint*/int Tag,
ArrayRef<Metadata /*P*/ > Ops1) {
this(C, ID, Storage, Tag,
Ops1, new ArrayRef<Metadata /*P*/ >(None, true));
}
protected DINode(final LLVMContext /*&*/ C, /*uint*/int ID, Metadata.StorageType Storage, /*uint*/int Tag,
ArrayRef<Metadata /*P*/ > Ops1, ArrayRef<Metadata /*P*/ > Ops2/*= None*/) {
// : MDNode(C, ID, Storage, Ops1, Ops2)
//START JInit
super(C, ID, Storage, new ArrayRef<Metadata /*P*/ >(Ops1), new ArrayRef<Metadata /*P*/ >(Ops2));
//END JInit
assert ($less_uint(Tag, 1/*U*/ << 16));
SubclassData16 = $uint2ushort(Tag);
}
//<editor-fold defaultstate="collapsed" desc="llvm::DINode::~DINode">
@Converted(kind = Converted.Kind.AUTO,
source = "${LLVM_SRC}/llvm/include/llvm/IR/DebugInfoMetadata.h", line = 146,
FQN="llvm::DINode::~DINode", NM="_ZN4llvm6DINodeD0Ev",
cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/DebugInfoMetadata.cpp -nm=_ZN4llvm6DINodeD0Ev")
//</editor-fold>
public/*protected*/ void $destroy()/* = default*/ {
super.$destroy();
}
/*template <class Ty> TEMPLATE*/
//<editor-fold defaultstate="collapsed" desc="llvm::DINode::getOperandAs">
@Converted(kind = Converted.Kind.MANUAL_SEMANTIC,
source = "${LLVM_SRC}/llvm/include/llvm/IR/DebugInfoMetadata.h", line = 148,
FQN="llvm::DINode::getOperandAs", NM="Tpl__ZNK4llvm6DINode12getOperandAsEj",
cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/DebugInfoMetadata.cpp -nm=Tpl__ZNK4llvm6DINode12getOperandAsEj")
//</editor-fold>
protected </*class*/ Ty> Ty /*P*/ getOperandAs(Class<Ty> clazz,/*uint*/int I) /*const*/ {
return cast_or_null(clazz,getOperand(I));
}
//<editor-fold defaultstate="collapsed" desc="llvm::DINode::getStringOperand">
@Converted(kind = Converted.Kind.MANUAL_COMPILATION,
source = "${LLVM_SRC}/llvm/include/llvm/IR/DebugInfoMetadata.h", line = 152,
FQN="llvm::DINode::getStringOperand", NM="_ZNK4llvm6DINode16getStringOperandEj",
cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/DebugInfoMetadata.cpp -nm=_ZNK4llvm6DINode16getStringOperandEj")
//</editor-fold>
protected StringRef getStringOperand(/*uint*/int I) /*const*/ {
{
MDString /*P*/ S = this.getOperandAs(MDString.class, I);
if ((S != null)) {
return S.getString();
}
}
return new StringRef();
}
//<editor-fold defaultstate="collapsed" desc="llvm::DINode::getCanonicalMDString">
@Converted(kind = Converted.Kind.AUTO,
source = "${LLVM_SRC}/llvm/include/llvm/IR/DebugInfoMetadata.h", line = 158,
FQN="llvm::DINode::getCanonicalMDString", NM="_ZN4llvm6DINode20getCanonicalMDStringERNS_11LLVMContextENS_9StringRefE",
cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/DebugInfoMetadata.cpp -nm=_ZN4llvm6DINode20getCanonicalMDStringERNS_11LLVMContextENS_9StringRefE")
//</editor-fold>
protected static MDString /*P*/ getCanonicalMDString(final LLVMContext /*&*/ Context, StringRef S) {
if (S.empty()) {
return null;
}
return MDString.get(Context, new StringRef(S));
}
/// Allow subclasses to mutate the tag.
//<editor-fold defaultstate="collapsed" desc="llvm::DINode::setTag">
@Converted(kind = Converted.Kind.AUTO,
source = "${LLVM_SRC}/llvm/include/llvm/IR/DebugInfoMetadata.h", line = 165,
FQN="llvm::DINode::setTag", NM="_ZN4llvm6DINode6setTagEj",
cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/DebugInfoMetadata.cpp -nm=_ZN4llvm6DINode6setTagEj")
//</editor-fold>
protected void setTag(/*uint*/int Tag) {
SubclassData16 = $uint2ushort(Tag);
}
/*public:*/
//<editor-fold defaultstate="collapsed" desc="llvm::DINode::getTag">
@Converted(kind = Converted.Kind.AUTO,
source = "${LLVM_SRC}/llvm/include/llvm/IR/DebugInfoMetadata.h", line = 168,
FQN="llvm::DINode::getTag", NM="_ZNK4llvm6DINode6getTagEv",
cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/DebugInfoMetadata.cpp -nm=_ZNK4llvm6DINode6getTagEv")
//</editor-fold>
public /*uint*/int getTag() /*const*/ {
return $ushort2uint(SubclassData16);
}
/// \brief Debug info flags.
///
/// The three accessibility flags are mutually exclusive and rolled together
/// in the first two bits.
//<editor-fold defaultstate="collapsed" desc="llvm::DINode::DIFlags">
@Converted(kind = Converted.Kind.AUTO,
source = "${LLVM_SRC}/llvm/include/llvm/IR/DebugInfoMetadata.h", line = 174,
FQN="llvm::DINode::DIFlags", NM="_ZN4llvm6DINode7DIFlagsE",
cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/DebugInfoMetadata.cpp -nm=_ZN4llvm6DINode7DIFlagsE")
//</editor-fold>
public static final class/*enum*/ DIFlags {
public static final /*uint*/int FlagPrivate = 1;
public static final /*uint*/int FlagProtected = 2;
public static final /*uint*/int FlagPublic = 3;
public static final /*uint*/int FlagFwdDecl = (1 << 2);
public static final /*uint*/int FlagAppleBlock = (1 << 3);
public static final /*uint*/int FlagBlockByrefStruct = (1 << 4);
public static final /*uint*/int FlagVirtual = (1 << 5);
public static final /*uint*/int FlagArtificial = (1 << 6);
public static final /*uint*/int FlagExplicit = (1 << 7);
public static final /*uint*/int FlagPrototyped = (1 << 8);
public static final /*uint*/int FlagObjcClassComplete = (1 << 9);
public static final /*uint*/int FlagObjectPointer = (1 << 10);
public static final /*uint*/int FlagVector = (1 << 11);
public static final /*uint*/int FlagStaticMember = (1 << 12);
public static final /*uint*/int FlagLValueReference = (1 << 13);
public static final /*uint*/int FlagRValueReference = (1 << 14);
public static final /*uint*/int FlagExternalTypeRef = (1 << 15);
public static final /*uint*/int FlagSingleInheritance = (1 << 16);
public static final /*uint*/int FlagMultipleInheritance = (2 << 16);
public static final /*uint*/int FlagVirtualInheritance = (3 << 16);
public static final /*uint*/int FlagIntroducedVirtual = (1 << 18);
public static final /*uint*/int FlagBitField = (1 << 19);
public static final /*uint*/int FlagAccessibility = DIFlags.FlagPrivate | DIFlags.FlagProtected | DIFlags.FlagPublic;
public static final /*uint*/int FlagPtrToMemberRep = DIFlags.FlagSingleInheritance | DIFlags.FlagMultipleInheritance
| DIFlags.FlagVirtualInheritance;
};
//<editor-fold defaultstate="collapsed" desc="llvm::DINode::getFlag">
@Converted(kind = Converted.Kind.MANUAL_COMPILATION,
source = "${LLVM_SRC}/llvm/lib/IR/DebugInfoMetadata.cpp", line = 68,
FQN="llvm::DINode::getFlag", NM="_ZN4llvm6DINode7getFlagENS_9StringRefE",
cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/DebugInfoMetadata.cpp -nm=_ZN4llvm6DINode7getFlagENS_9StringRefE")
//</editor-fold>
public static /*uint*/int getFlag(StringRef Flag) {
return new StringSwitchUInt(/*NO_COPY*/Flag).Case(/*KEEP_STR*/"DIFlagPrivate", DIFlags.FlagPrivate).
Case(/*KEEP_STR*/"DIFlagProtected", DIFlags.FlagProtected).
Case(/*KEEP_STR*/"DIFlagPublic", DIFlags.FlagPublic).
Case(/*KEEP_STR*/"DIFlagFwdDecl", DIFlags.FlagFwdDecl).
Case(/*KEEP_STR*/"DIFlagAppleBlock", DIFlags.FlagAppleBlock).
Case(/*KEEP_STR*/"DIFlagBlockByrefStruct", DIFlags.FlagBlockByrefStruct).
Case(/*KEEP_STR*/"DIFlagVirtual", DIFlags.FlagVirtual).
Case(/*KEEP_STR*/"DIFlagArtificial", DIFlags.FlagArtificial).
Case(/*KEEP_STR*/"DIFlagExplicit", DIFlags.FlagExplicit).
Case(/*KEEP_STR*/"DIFlagPrototyped", DIFlags.FlagPrototyped).
Case(/*KEEP_STR*/"DIFlagObjcClassComplete", DIFlags.FlagObjcClassComplete).
Case(/*KEEP_STR*/"DIFlagObjectPointer", DIFlags.FlagObjectPointer).
Case(/*KEEP_STR*/"DIFlagVector", DIFlags.FlagVector).
Case(/*KEEP_STR*/"DIFlagStaticMember", DIFlags.FlagStaticMember).
Case(/*KEEP_STR*/"DIFlagLValueReference", DIFlags.FlagLValueReference).
Case(/*KEEP_STR*/"DIFlagRValueReference", DIFlags.FlagRValueReference).
Case(/*KEEP_STR*/"DIFlagExternalTypeRef", DIFlags.FlagExternalTypeRef).
Case(/*KEEP_STR*/"DIFlagSingleInheritance", DIFlags.FlagSingleInheritance).
Case(/*KEEP_STR*/"DIFlagMultipleInheritance", DIFlags.FlagMultipleInheritance).
Case(/*KEEP_STR*/"DIFlagVirtualInheritance", DIFlags.FlagVirtualInheritance).
Case(/*KEEP_STR*/"DIFlagIntroducedVirtual", DIFlags.FlagIntroducedVirtual).
Case(/*KEEP_STR*/"DIFlagBitField", DIFlags.FlagBitField).
Default(0);
}
//<editor-fold defaultstate="collapsed" desc="llvm::DINode::getFlagString">
@Converted(kind = Converted.Kind.AUTO,
source = "${LLVM_SRC}/llvm/lib/IR/DebugInfoMetadata.cpp", line = 75,
FQN="llvm::DINode::getFlagString", NM="_ZN4llvm6DINode13getFlagStringEj",
cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/DebugInfoMetadata.cpp -nm=_ZN4llvm6DINode13getFlagStringEj")
//</editor-fold>
public static /*const*/char$ptr/*char P*/ getFlagString(/*uint*/int Flag) {
switch (Flag) {
default:
return $EMPTY;
case DIFlags.FlagPrivate:
return $("DIFlagPrivate");
case DIFlags.FlagProtected:
return $("DIFlagProtected");
case DIFlags.FlagPublic:
return $("DIFlagPublic");
case DIFlags.FlagFwdDecl:
return $("DIFlagFwdDecl");
case DIFlags.FlagAppleBlock:
return $("DIFlagAppleBlock");
case DIFlags.FlagBlockByrefStruct:
return $("DIFlagBlockByrefStruct");
case DIFlags.FlagVirtual:
return $("DIFlagVirtual");
case DIFlags.FlagArtificial:
return $("DIFlagArtificial");
case DIFlags.FlagExplicit:
return $("DIFlagExplicit");
case DIFlags.FlagPrototyped:
return $("DIFlagPrototyped");
case DIFlags.FlagObjcClassComplete:
return $("DIFlagObjcClassComplete");
case DIFlags.FlagObjectPointer:
return $("DIFlagObjectPointer");
case DIFlags.FlagVector:
return $("DIFlagVector");
case DIFlags.FlagStaticMember:
return $("DIFlagStaticMember");
case DIFlags.FlagLValueReference:
return $("DIFlagLValueReference");
case DIFlags.FlagRValueReference:
return $("DIFlagRValueReference");
case DIFlags.FlagExternalTypeRef:
return $("DIFlagExternalTypeRef");
case DIFlags.FlagSingleInheritance:
return $("DIFlagSingleInheritance");
case DIFlags.FlagMultipleInheritance:
return $("DIFlagMultipleInheritance");
case DIFlags.FlagVirtualInheritance:
return $("DIFlagVirtualInheritance");
case DIFlags.FlagIntroducedVirtual:
return $("DIFlagIntroducedVirtual");
case DIFlags.FlagBitField:
return $("DIFlagBitField");
}
}
/// \brief Split up a flags bitfield.
///
/// Split \c Flags into \c SplitFlags, a vector of its components. Returns
/// any remaining (unrecognized) bits.
//<editor-fold defaultstate="collapsed" desc="llvm::DINode::splitFlags">
@Converted(kind = Converted.Kind.AUTO,
source = "${LLVM_SRC}/llvm/lib/IR/DebugInfoMetadata.cpp", line = 86,
FQN="llvm::DINode::splitFlags", NM="_ZN4llvm6DINode10splitFlagsEjRNS_15SmallVectorImplIjEE",
cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/DebugInfoMetadata.cpp -nm=_ZN4llvm6DINode10splitFlagsEjRNS_15SmallVectorImplIjEE")
//</editor-fold>
public static /*uint*/int splitFlags(/*uint*/int Flags,
final SmallVectorImplUInt /*&*/ SplitFlags) {
{
// Accessibility and member pointer flags need to be specially handled, since
// they're packed together.
/*uint*/int A = Flags & DIFlags.FlagAccessibility;
if ((A != 0)) {
if (A == DIFlags.FlagPrivate) {
SplitFlags.push_back(DIFlags.FlagPrivate);
} else if (A == DIFlags.FlagProtected) {
SplitFlags.push_back(DIFlags.FlagProtected);
} else {
SplitFlags.push_back(DIFlags.FlagPublic);
}
Flags &= ~A;
}
}
{
/*uint*/int R = Flags & DIFlags.FlagPtrToMemberRep;
if ((R != 0)) {
if (R == DIFlags.FlagSingleInheritance) {
SplitFlags.push_back(DIFlags.FlagSingleInheritance);
} else if (R == DIFlags.FlagMultipleInheritance) {
SplitFlags.push_back(DIFlags.FlagMultipleInheritance);
} else {
SplitFlags.push_back(DIFlags.FlagVirtualInheritance);
}
Flags &= ~R;
}
}
{
/*uint*/int Bit = Flags & 1;
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & 2;
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & 3;
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 2);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 3);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 4);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 5);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 6);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 7);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 8);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 9);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 10);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 11);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 12);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 13);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 14);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 15);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 16);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (2 << 16);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (3 << 16);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 18);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
{
/*uint*/int Bit = Flags & (1 << 19);
if ((Bit != 0)) {
SplitFlags.push_back(Bit);
Flags &= ~Bit;
}
}
return Flags;
}
//<editor-fold defaultstate="collapsed" desc="llvm::DINode::classof">
@Converted(kind = Converted.Kind.AUTO,
source = "${LLVM_SRC}/llvm/include/llvm/IR/DebugInfoMetadata.h", line = 192,
FQN="llvm::DINode::classof", NM="_ZN4llvm6DINode7classofEPKNS_8MetadataE",
cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/DebugInfoMetadata.cpp -nm=_ZN4llvm6DINode7classofEPKNS_8MetadataE")
//</editor-fold>
public static boolean classof(/*const*/ Metadata /*P*/ MD) {
switch (Metadata.MetadataKind.valueOf(MD.getMetadataID())) {
default:
return false;
case GenericDINodeKind:
case DISubrangeKind:
case DIEnumeratorKind:
case DIBasicTypeKind:
case DIDerivedTypeKind:
case DICompositeTypeKind:
case DISubroutineTypeKind:
case DIFileKind:
case DICompileUnitKind:
case DISubprogramKind:
case DILexicalBlockKind:
case DILexicalBlockFileKind:
case DINamespaceKind:
case DITemplateTypeParameterKind:
case DITemplateValueParameterKind:
case DIGlobalVariableKind:
case DILocalVariableKind:
case DIObjCPropertyKind:
case DIImportedEntityKind:
case DIModuleKind:
return true;
}
}
@Override public String toString() {
return "" + super.toString(); // NOI18N
}
}
| [
"voskresensky.vladimir@gmail.com"
] | voskresensky.vladimir@gmail.com |
0a4c45862842fd2506045a43692c94d8a90132ed | 9c00688a804f059fa128cc929ec5523351731b3e | /hot-deploy/demo/src/com/util/DealPageRequest.java | becd8fcbac2e38f42f2799def0a7bb7d5439934a | [] | no_license | yangrui110/asunerp | f37b4c9f425cd67c9dd6fc35cac124ae9f89e241 | 3f702ce694b7b7bd6df77a60cd6578a8e1744bb5 | refs/heads/master | 2020-05-07T12:45:16.575197 | 2019-04-10T07:46:41 | 2019-04-10T07:46:41 | 180,295,937 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,207 | java | package com.util;
import com.hanlin.fadp.base.util.UtilHttp;
import com.util.constant.PageConstant;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
/**
* @author 杨瑞
* @date 2018-11-23
*
* 此类主要处理前端传过来的page和size参数
* */
public class DealPageRequest {
private static int dealMap(Map parameters,String data){
Object page =parameters.get(data);
if(page==null)
return 0;
else {
if(page instanceof Integer)
return (Integer)page;
else if(page instanceof String)
return Integer.parseInt((String)page);
else return 0;
}
}
private static int dealRequest(HttpServletRequest request,String data){
Map<String, Object> parameters = UtilHttp.getCombinedMap(request);
return dealMap(parameters,data);
}
public static int getPage(HttpServletRequest request){
return dealRequest(request, PageConstant.PAGE);
}
public static int getSize(HttpServletRequest request){
int rs=dealRequest(request,PageConstant.SIZE);
if(rs==0)
return 10;
else return rs;
}
}
| [
"“Youremail@xxx.com”"
] | “Youremail@xxx.com” |
a894ca148ae69daa19d537f35ae28c5fc7dbe6e4 | b33e38f7aa8dbcbc9a7f94acf10c2bd916ca35e2 | /app/src/main/java/com/example/undraitytelab2/MainActivity.java | f4ffa02acd89d48aaab3b3f7841324c0e1d1bc17 | [] | no_license | KotrynaUn/UndraityteLab2 | 9fb0695effc2f8d86418935230f40a00d233b864 | 68a03f0eb69918a9ef92c4dad2156dbad9c3667a | refs/heads/master | 2023-05-07T13:54:09.272868 | 2021-05-28T10:37:44 | 2021-05-28T10:37:44 | 364,541,837 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,265 | java | package com.example.undraitytelab2;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
Spinner ddList;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
this.ddList = (Spinner) findViewById(R.id.ddList);
ArrayAdapter<CharSequence> arrayAdapter = ArrayAdapter.createFromResource(this, R.array.selection_array, android.R.layout.simple_spinner_item);
arrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
this.ddList.setAdapter(arrayAdapter);
}
public void btnCalculateOnClick(View view) {
EditText edInput = findViewById(R.id.edInput);
TextView tvResult = findViewById(R.id.tvResult);
String userInputText = edInput.getText().toString();
String selection = this.ddList.getSelectedItem().toString();
int resId = R.string.char_selection;
String charSelectionOption = getResources().getString(R.string.char_selection);
String numberSelectionOption = getResources().getString(R.string.numbers_selection);
String wordSelectionOption = getResources().getString(R.string.words_selection);
if(edInput.getText().toString().trim().isEmpty()) {
//display Toast message
Toast.makeText(this, "Empty", Toast.LENGTH_SHORT).show();
}
if(selection.equalsIgnoreCase(charSelectionOption)){
int count = Calculator.getCharsCount(userInputText);
tvResult.setText(String.valueOf(count));
}
if(selection.equalsIgnoreCase(numberSelectionOption)){
int count = Calculator.getNumbersCount(userInputText);
tvResult.setText(String.valueOf(count));
}
if(selection.equalsIgnoreCase(wordSelectionOption)){
int count = Calculator.getWordsCount(userInputText);
tvResult.setText(String.valueOf(count));
}
}
} | [
"kotryna.undraityte@knf.stud.vu.lt"
] | kotryna.undraityte@knf.stud.vu.lt |
2d18486310bee5457f299e82dcf3b88618af52eb | a64e225d43fe964088b38abe38db6a9a809bd4a8 | /ScootGeneralFlow/src/main/java/ScootGeneral/ScootGeneralFlow/PaymentDateRangeOneWay.java | 022413ef1f2a7a222a71e85088ca89074d2ee020 | [] | no_license | selvendranr/ScootGeneralFlow | 5ad1aeec31400c7eba7d222201a0a65564599d24 | 9e5592bd6809ce20c4b6d464e02fc709d88ef28d | refs/heads/master | 2020-03-22T17:53:22.430904 | 2018-07-10T11:58:01 | 2018-07-10T11:58:01 | 140,422,408 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,496 | java | package ScootGeneral.ScootGeneralFlow;
import java.util.List;
import org.apache.commons.lang3.time.StopWatch;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Keys;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;
import pack.base.TestBaseSetup;
public class PaymentDateRangeOneWay extends TestBaseSetup {
protected WebDriver driver;
String requestInfo="a[title='Request info']";
String makePayment="li[class='makePaymentUser']>a"; //link Text
//String groupName="input[id=requestGroupName][name=requestGroupName]";
String groupId="input[id=requestMasterId][name=requestMasterId]";
//String tripType = "select[id=requestType][name=requestType]";
String searchBtn = "a.btn.custom-btn.mar-top-30";
//Search
String viewDetails1="//td/p[text()[contains(.,'";
String viewDetails2="')]]/../../td[6]/a[contains(text(),'Make payment')]";
String processing="//span[text()='Loading data, please wait...']";
String loadingImg="img[title='Loading...']";
//-----------------Request Details------------------------------//
String grpId="div.approved-flight-hdr.mar-top-none+table tbody tr:nth-of-type(2) td:first-of-type>p>span";
String accFarePerPax="div.approved-flight-hdr.mar-top-none+table tbody tr:nth-of-type(2) td:nth-of-type(2) span";
String totalFare="div.approved-flight-hdr.mar-top-none+table tbody tr:nth-of-type(2) td:nth-of-type(3)";
String pnr="div.approved-flight-hdr.mar-top-none+table tbody tr:nth-of-type(2) td:nth-of-type(3) a";
String agentId="select[id='agentName']";
String makePaymentBtn="//input[@value='Submit' and not(@id='sendRequest')]";
String succedMassage="div[id*='container-']>span[id*='component-']";
String succedMsgOkBtn="//span[text()='OK']/..";
String thankYou="div[class='thankyou-alert-box']";
String logOut="a[class=logout]";
String grpIdIDOnPayPage,accFarePerPaxOnPayPage,totalFareOnPayPage,pnrOnPayPage;
StopWatch processingTime = new StopWatch();
double pageLoadTimeV,paymentSubmitTimeV;
Login login;
Select select;
public PaymentDateRangeOneWay(WebDriver driver) {
this.driver = driver;
}
public void makePayment(String reqId) {
driver.navigate().refresh();
/* try {
Thread.sleep(5000);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
login=new Login(driver);
login.doLogin(1);
*/
try {
Thread.sleep(5000);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} waitExplicitlyByLocator(driver,requestInfo,"cssselector",60);
findEle(driver,requestInfo,"cssselector").click();
try {
Thread.sleep(1000);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
waitExplicitlyByLocator(driver,makePayment,"cssselector",30);
findEle(driver,makePayment,"cssselector").click();
try{
waitExplicitlyByLocator(driver,loadingImg,"cssselector",50);
processingTime.start();
waitExplicitlyNotByLocator(driver,loadingImg,"cssselector",120);
processingTime.stop();
pageLoadTimeV=pageLoadTimeV+processingTime.getTime();
processingTime.reset();
}
catch(TimeoutException e){
System.out.println("After Munu Click Processing is not displayed");
}
String onlyNo=reqId.replaceAll("[^\\.0123456789]","");
findEle(driver,groupId,"cssselector").sendKeys(onlyNo);
waitExplicitlyByLocator(driver,searchBtn,"cssselector",30);
findEle(driver,searchBtn,"cssselector").click();
try{
waitExplicitlyByLocator(driver,loadingImg,"cssselector",50);
processingTime.start();
waitExplicitlyNotByLocator(driver,loadingImg,"cssselector",120);
processingTime.stop();
pageLoadTimeV=pageLoadTimeV+processingTime.getTime();
processingTime.reset();
}
catch(TimeoutException e){
System.out.println("After Search Processing is not displayed");
}
waitExplicitlyByLocator(driver,viewDetails1+reqId+viewDetails2,"xpath",30);
findEle(driver,viewDetails1+reqId+viewDetails2,"xpath").click();
try{
waitExplicitlyByLocator(driver,loadingImg,"cssselector",50);
processingTime.start();
waitExplicitlyNotByLocator(driver,loadingImg,"cssselector",120);
processingTime.stop();
pageLoadTimeV=pageLoadTimeV+processingTime.getTime();
processingTime.reset();
}
catch(TimeoutException e){
System.out.println("After Make Payment Link Processing is not displayed");
}
waitExplicitlyByLocator(driver,grpId,"cssselector",50);
//---------------------Get the values of Request Details-----------------------------//
grpIdIDOnPayPage=findEle(driver,grpId,"cssselector").getText();
accFarePerPaxOnPayPage=findEle(driver,accFarePerPax,"cssselector").getText();
totalFareOnPayPage=findEle(driver,totalFare,"cssselector").getText();
//check=new CheckBrokenLink(driver) ;
//paymentList=check.getLinkList("Adhoc Oneway Make Payment Page Broken Link");
select =new Select(findEle(driver,agentId,"cssselector"));
select.selectByIndex(1);
try {
Thread.sleep(5000);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
findEle(driver,makePaymentBtn,"xpath").click();
try{
waitExplicitlyByLocator(driver,loadingImg,"cssselector",50);
processingTime.start();
waitExplicitlyNotByLocator(driver,loadingImg,"cssselector",1500);
processingTime.stop();
paymentSubmitTimeV=paymentSubmitTimeV+processingTime.getTime();
processingTime.reset();
}
catch(TimeoutException e){
System.out.println("After Search Processing is not displayed");
}
try{
waitExplicitlyByLocator(driver,succedMassage,"cssselector",50);
findEle(driver,succedMsgOkBtn,"xpath").click();
waitExplicitlyByLocator(driver,thankYou,"cssselector",50);
}catch(TimeoutException e){
System.out.println("After Submit Success is not displayed");
}
}
}
| [
"selvagithub@gmail.com"
] | selvagithub@gmail.com |
ca37547f93c29714552b7207100f7e6c5d02f0cc | b2ee4dbd6054852129e208221a167f92f1b7d429 | /Java/src/Test/Employee.java | 2631b4b4a88ad84918e0abc4ebadb1f12112354e | [] | no_license | XuanSonMai/Btapjava | 942195760225eff7fdb95118c79a9507269db5f5 | 8a5ae1770011c8b0730d437531101c6940eeb9dc | refs/heads/main | 2023-08-05T02:03:01.434150 | 2021-10-10T04:06:04 | 2021-10-10T04:06:04 | 415,480,825 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 149 | java | package Test;
public class Employee extends Person {
public Employee()
{
super("a");
}
public Employee(String ten)
{
super(ten);
}
}
| [
"son@gmail.com"
] | son@gmail.com |
4572bc2ed422cf02561884a2d4b08246e01f02e1 | d612b961ca28a5662baa86d19a5de088c11eae11 | /app/src/main/java/com/av/mediajourney/image/ImageActivity.java | 00751510d0a6fe85ac5973cd6d127ab9491bfd7e | [
"Apache-2.0"
] | permissive | majorxia/mediajourney | dc3950314504bd7296c8979539c5b550f57f58f9 | cf8fa1aec760f8fe8b3a16e0783b3ee0ae916a6f | refs/heads/main | 2023-07-29T16:36:55.773131 | 2021-09-15T06:35:51 | 2021-09-15T06:35:51 | 397,843,519 | 0 | 0 | Apache-2.0 | 2021-08-19T06:42:19 | 2021-08-19T06:42:18 | null | UTF-8 | Java | false | false | 3,804 | java | package com.av.mediajourney.image;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.widget.ImageView;
import androidx.appcompat.app.AppCompatActivity;
import com.av.mediajourney.R;
import java.io.File;
public class ImageActivity extends AppCompatActivity {
private static final String TAG = "MainActivity";
private ImageView imageView;
private SurfaceView surfaceView;
private CustomView customView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_image_layout);
imageView = findViewById(R.id.imageview);
surfaceView = findViewById(R.id.surfaceview);
customView = findViewById(R.id.customview);
String path = Environment.getExternalStorageDirectory().getPath() + File.separator + "Pictures"+ File.separator + "temp_1602121905506.jpg";
Log.d("MainActivity", "onCreate: path: "+path);
Bitmap bitmap = BitmapFactory.decodeFile(path);
imageView.setImageBitmap(bitmap);
handSurfaceview();
// PermissionHandler.requestCameraPermission(MainActivity.this, PermissionHandler.storagePermissions, "请求存储权限。请在【设置-应用-权限】中开启存储权限,以正常使用",
// new Runnable() {
// @Override
// public void run() {
// handSurfaceview();
// }
// }, new Runnable() {
// @Override
// public void run() {
// Log.d("MainActivity", "onCreate: 无权限 ");
// }
// });
}
private void handSurfaceview() {
final String path = Environment.getExternalStorageDirectory().getPath() + File.separator + "Pictures" + File.separator + "temp_1602121905506.jpg";
Log.d("MainActivity", "onCreate: path: "+path);
Bitmap bitmap = BitmapFactory.decodeFile(path);
imageView.setImageBitmap(bitmap);
surfaceView.getHolder().addCallback(new SurfaceHolder.Callback() {
@Override
public void surfaceCreated(SurfaceHolder holder) {
if(holder == null){
return;
}
Paint paint = new Paint();
paint.setAntiAlias(true);
// paint.setStyle(Paint.Style.STROKE);
String path = Environment.getExternalStorageDirectory().getPath() + File.separator + "Pictures" + File.separator + "temp_1602121905506.jpg";
Bitmap bitmap1 = BitmapFactory.decodeFile(path);
Canvas canvas = null;
try {
canvas = holder.lockCanvas();
canvas.drawBitmap(bitmap1,0,0,paint);
}catch (Exception e){
e.printStackTrace();
} finally {
if(canvas!=null){
holder.unlockCanvasAndPost(canvas);
}
}
Log.d(TAG, "surfaceCreated: ");
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
Log.d(TAG, "surfaceChanged: format"+format+" w="+width+" h="+height);
}
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
Log.d(TAG, "surfaceDestroyed: ");
}
});
}
}
| [
"yangyabin@kugou.net"
] | yangyabin@kugou.net |
dc8a670d3d6fd25e97a7b5948cadb4dc9ef43b72 | c65f765e8565469dc6762c6c66ea77c24fa3cd7a | /hsydemo/src/main/java/com/db/common/aspect/SysLogAspect.java | c749874e4810cc26dd66fd8abb7da3fc1be82569 | [] | no_license | 774109811/study | ca2225b1cce25ea1dfc98a7e71fe0ebc3c028152 | 3eedcb602fdb016b96ebbae5f9a01f912407833b | refs/heads/master | 2022-12-22T08:26:02.134999 | 2020-11-22T08:22:36 | 2020-11-22T08:22:36 | 230,391,319 | 0 | 0 | null | 2022-12-16T12:02:17 | 2019-12-27T07:02:32 | JavaScript | UTF-8 | Java | false | false | 3,783 | java | package com.db.common.aspect;
import com.db.common.annotation.RequiresLog;
import com.db.common.utils.IPUtils;
import com.db.common.utils.ShiroUtils;
import com.db.sys.dao.SysLogDao;
import com.db.sys.entity.SysLog;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Date;
/**
* 使用@Aspect注解修饰的类为一个切面类型
* 切面对象:封装扩展功能
* 切面构成:
* 1)切入点(Pointcut):切入扩展功能的点,连接点(一个具体方法)结合
* 2)通知(Advice) 本质为一个实现了扩展功能的一个方法
*/
@Aspect
@Service
public class SysLogAspect {
@Autowired
private SysLogDao sysLogDao;
/**
* 1)@Pointcut 注解用于定义切入点
* 2)bean(...) 为一种切入点表达式(值为bean的id)
*/
//@Pointcut("bean(*ServiceImpl)") //粗粒度切入点表达式
//@Pointcut("bean(sysUserServiceImpl)")
//细粒度切入点表达式(可以精确到方法)多各切入点
@Pointcut("@annotation(com.db.common.annotation.RequiresLog)")
public void logPointCut(){}//空方法(相当于为切入点起了个别名)
/**
* 说明:
* 1)@Around 描述方法为一个环绕通知
* JoinPoint 为一个连接点(切入点中的某个方法信息对象)
* 目标方法的执行结果
* Throwable
*/
@Around("logPointCut()")
public Object around(ProceedingJoinPoint jp)//环绕通知
throws Throwable{
long start=System.currentTimeMillis();
Object result=jp.proceed();//执行目标方法(result为目标方法的执行结果)
long end=System.currentTimeMillis();
//System.out.println("execute time :"+(end-start));
saveObject(jp,end-start);//添加日志信息的方法和用时
return result;
}
//添加是谁修改用户的日志方法
private void saveObject(
ProceedingJoinPoint jp,
long totalTime) throws NoSuchMethodException, SecurityException{
//1.获取日志信息
//获取用户
String username=ShiroUtils.getUser().getUsername();
//获取IP
String ip=IPUtils.getIpAddr();
//获取方法签名信息(包含了方法名以及参数列表信息)
Signature s=jp.getSignature();
//System.out.println(s.getClass().getName());
MethodSignature ms=(MethodSignature)s;
//获取目标对象的类对象(字节码对象:反射的起点)
Class<?> targetCls=jp.getTarget().getClass();
//获取目标方法对象
Method targetMethod=targetCls.getDeclaredMethod(
ms.getName(),ms.getParameterTypes());
//获取目标方法上的RequiresLog注解
RequiresLog requiresLog=
targetMethod.getDeclaredAnnotation(RequiresLog.class);
//获取注解中value属性的值
String operation=requiresLog.value();
//获取方法
String method=targetCls.getName()+"."+targetMethod.getName();
System.out.println(method);
//获取链接点上的参数
String params=Arrays.toString(jp.getArgs());
System.out.println(params);
//2.封装日志信息(封装到SysLog对象)
SysLog log=new SysLog();
log.setUsername(username);
log.setIp(ip);
log.setOperation(operation);
log.setMethod(method);
log.setParams(params);
log.setTime(totalTime);
log.setCreatedTime(new Date());
//3.存储日志信息(写入到数据库)
int i = sysLogDao.insertObject(log);
System.out.println(i);
}
}
| [
"774109811@qq.com"
] | 774109811@qq.com |
69c4446f0f620ede315705b5891e9c7e733a8184 | 56a899f35bcbf031e6e717cbb03cd755cdd3d578 | /travel/src/main/java/com/gkemayo/voy/ticket/SimpleTicketDTO.java | ffaf2ed10ec6c4bb1b4d9c11544fac44a932bec7 | [] | no_license | icon-soft/travel-app | edfab99dfee8491c4c17d92c24a2fcbf3b994db9 | 83263c8f2b73ab328e4f839697b91f4c6c0ac17b | refs/heads/main | 2022-12-31T04:42:23.787801 | 2020-10-12T08:27:28 | 2020-10-12T08:27:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,101 | java | package com.gkemayo.voy.ticket;
import java.time.LocalDate;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel(value = "Simple Loan Model")
public class SimpleTicketDTO {
@ApiModelProperty(value = "Book id concerned by the loan")
private Integer bookId;
@ApiModelProperty(value = "Customer id concerned by the loan")
private Integer customerId;
@ApiModelProperty(value = "Loan begining date")
private LocalDate beginDate;
@ApiModelProperty(value = "Loan ending date")
private LocalDate endDate;
public Integer getBookId() {
return bookId;
}
public void setBookId(Integer bookId) {
this.bookId = bookId;
}
public Integer getCustomerId() {
return customerId;
}
public void setCustomerId(Integer customerId) {
this.customerId = customerId;
}
public LocalDate getBeginDate() {
return beginDate;
}
public void setBeginDate(LocalDate beginDate) {
this.beginDate = beginDate;
}
public LocalDate getEndDate() {
return endDate;
}
public void setEndDate(LocalDate endDate) {
this.endDate = endDate;
}
}
| [
"aaron.njoya@yahoo.fr"
] | aaron.njoya@yahoo.fr |
2c77ffd0928822bae9b4f5f631c12a167142bc0d | 0146c2ac6f4699fe774f9d1a0d90fd0bd6e5aec0 | /src/main/java/dataParser/sym.java | c204d50f716701a136fbaeb554f22249a42fb99d | [
"BSD-2-Clause"
] | permissive | jeisner/erma | 6c5c8434082fc8c3273be399d0a369ccc57395b2 | 04e49e210b4d8ded876086ae03d3add23a406c89 | refs/heads/master | 2016-09-06T02:08:05.025926 | 2016-03-09T14:32:05 | 2016-03-09T14:32:05 | 10,772,404 | 2 | 2 | null | 2016-03-08T21:21:58 | 2013-06-18T20:04:32 | Java | UTF-8 | Java | false | false | 1,150 | java |
//----------------------------------------------------
// The following code was generated by CUP v0.11a beta 20060608
// Wed Oct 10 16:56:26 EDT 2012
//----------------------------------------------------
package dataParser;
/** CUP generated interface containing symbol constants. */
public interface sym {
/* terminals */
public static final int INPUT = 15;
public static final int IDENT = 20;
public static final int EQL = 17;
public static final int PLUS = 3;
public static final int SEMI = 10;
public static final int RSB = 14;
public static final int STAR = 9;
public static final int FEATURES = 4;
public static final int DOUB = 18;
public static final int RELATIONS = 5;
public static final int LB = 11;
public static final int WEIGHTS = 6;
public static final int EXAMPLE = 16;
public static final int RB = 12;
public static final int COMMA = 8;
public static final int NUMBER = 19;
public static final int EOF = 0;
public static final int ARROW = 2;
public static final int error = 1;
public static final int ASSIGN = 7;
public static final int LSB = 13;
}
| [
"jason@cs.jhu.edu"
] | jason@cs.jhu.edu |
1808f8fe9c71518b61fcc36822367e7ed97338d8 | 78f7fd54a94c334ec56f27451688858662e1495e | /partyanalyst-service/trunk/src/main/java/com/itgrids/partyanalyst/dao/hibernate/JbCommitteeConfirmRuleDAO.java | 6d9b9c915bd9c69289b5ebf0101b5d72b8dfbec7 | [] | no_license | hymanath/PA | 2e8f2ef9e1d3ed99df496761a7b72ec50d25e7ef | d166bf434601f0fbe45af02064c94954f6326fd7 | refs/heads/master | 2021-09-12T09:06:37.814523 | 2018-04-13T20:13:59 | 2018-04-13T20:13:59 | 129,496,146 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 474 | java | package com.itgrids.partyanalyst.dao.hibernate;
import org.appfuse.dao.hibernate.GenericDaoHibernate;
import com.itgrids.partyanalyst.dao.IJbCommitteeConfirmRuleDAO;
import com.itgrids.partyanalyst.model.JbCommitteeConfirmRule;
public class JbCommitteeConfirmRuleDAO extends GenericDaoHibernate<JbCommitteeConfirmRule, Long>
implements IJbCommitteeConfirmRuleDAO {
public JbCommitteeConfirmRuleDAO() {
super(JbCommitteeConfirmRule.class);
}
}
| [
"itgrids@b17b186f-d863-de11-8533-00e0815b4126"
] | itgrids@b17b186f-d863-de11-8533-00e0815b4126 |
540cf1596a723693c44024bf0c04eaebf6f3b649 | 9b61d241a50b3b6c0622c0025ac676fcc33b146d | /IntelliJHomeworks/hw08/src/cs3500/music/controller/Controller.java | 812bf111131fda4959505464653ae9d0a9824751 | [] | no_license | northcott-j/EclipseWorkspace | b98b50baeb4a078294dba0b2042069b29e9cfec6 | 6dbd59203ae064777506318e8434958fa5e8f6fe | refs/heads/master | 2020-04-08T08:33:17.916527 | 2015-12-11T22:18:10 | 2015-12-11T22:18:10 | 29,544,849 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package cs3500.music.controller;
import java.io.IOException;
import javax.sound.midi.InvalidMidiDataException;
/**
* Interface to connect all Controllers Created by Jonathan on 11/18/2015.
*/
public interface Controller {
/**
* Runs the Controller
*
* @throws java.io.IOException if there's an error
*/
void run() throws IOException, InvalidMidiDataException;
}
| [
"northcott.j@chisigma.co"
] | northcott.j@chisigma.co |
db6c34e13f646548db099ed95d0a75ff55f0eeba | fdc5fdb32052369253e1bfecabe78cc1a11196ed | /src/test/java/com/synsoft/config/WebConfigurerTestController.java | e33b03b891e9edbae3dc548212d7e4b48c85d922 | [] | no_license | BulkSecurityGeneratorProject/energyFlux | 57b3ad91dafa9b11667cdebe124b1f877b9dccb2 | 04bdc9fb1c7a2819d812345dc96405d483b51602 | refs/heads/master | 2022-12-26T17:24:20.723598 | 2019-06-30T20:14:38 | 2019-06-30T20:14:38 | 296,592,806 | 0 | 0 | null | 2020-09-18T10:46:09 | 2020-09-18T10:46:08 | null | UTF-8 | Java | false | false | 374 | java | package com.synsoft.config;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class WebConfigurerTestController {
@GetMapping("/api/test-cors")
public void testCorsOnApiPath() {
}
@GetMapping("/test/test-cors")
public void testCorsOnOtherPath() {
}
}
| [
"nebojsazak@gmail.com"
] | nebojsazak@gmail.com |
41e9830fdf612e23b1774e062e7cbfe8cb7471c4 | c249aa1a9960d02a0c6fdb76c4352b5b4f5ccee1 | /src/main/groovy/com/github/abrarsyed/gmcp/JarBouncer.java | cd3d0933955bff12ec79b1cf6de8cfaba03e0cce | [] | no_license | GUIpsp/GMCP_scripts | 9dcea7212973100456739797fc91b713e68ea284 | 14cfaa9ea119261f889c6d37db5186d463135be4 | refs/heads/master | 2016-09-06T06:30:03.167950 | 2013-05-14T20:56:06 | 2013-05-14T20:56:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,664 | java | package com.github.abrarsyed.gmcp;
import java.io.File;
import java.io.PrintStream;
import java.lang.reflect.Method;
import net.md_5.specialsource.SpecialSource;
import de.fernflower.main.decompiler.ConsoleDecompiler;
public class JarBouncer
{
public static void fernFlower(String inputDir, String outputDir)
{
String[] args = new String[7];
args[0] = "-din=0";
args[1] = "-rbr=0";
args[2] = "-dgs=1";
args[3] = "-asc=1";
args[4] = "-log=ERROR";
args[5] = inputDir;
args[6] = outputDir;
try
{
PrintStream stream = System.out;
System.setOut(new PrintStream(new File(Main.logs, "FF.log")));
ConsoleDecompiler.main(args);
// -din=0 -rbr=0 -dgs=1 -asc=1 -log=WARN {indir} {outdir}
System.setOut(stream);
}
catch (Exception e)
{
e.printStackTrace();
}
}
public static void specialSource(File inJar, File outJar, File srg)
{
try
{
SpecialSource.main(new String[] { "-i=" + inJar.getPath(), "-o=" + outJar.getPath(), "-m=" + srg.getPath() });
}
catch (Exception e)
{
System.err.println("SpecialSource remapping has failed!");
e.printStackTrace();
}
}
public static void injector(File input, File output, File config)
{
String[] args = new String[]
{
input.getPath(),
output.getPath(),
config.getPath(),
new File(Main.logs, "MCInjector.log").getPath()
};
// {input} {output} {conf} {log}
try
{
Class<?> c = Class.forName("MCInjector");
Method m = c.getMethod("main", new Class[] { String[].class });
m.invoke(null, new Object[] { args });
}
catch (Exception e)
{
System.err.println("MCInjector has failed!");
e.printStackTrace();
}
}
}
| [
"sacabrarsyed@gmail.com"
] | sacabrarsyed@gmail.com |
3fd47a6984c653ef9c9f072b884c268b5fe3cc18 | ef97e2ee0af5d1dce6d9574534da9129f03b0452 | /src/main/java/com/faforever/server/security/UniqueIdService.java | 7e490b85511761e4abeda347e82b77d958e113bc | [] | no_license | niklaskp/faf-java-server | 81bdd3d38627c2c9d5e37f74533c4e15e20b839d | 1266a4e31b90a6e76bdf7f341d426552044e0b71 | refs/heads/master | 2021-07-17T07:22:45.374912 | 2017-09-14T12:22:17 | 2017-09-14T12:22:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,811 | java | package com.faforever.server.security;
import com.faforever.server.config.ServerProperties;
import com.faforever.server.entity.HardwareInformation;
import com.faforever.server.entity.Player;
import com.faforever.server.error.ErrorCode;
import com.faforever.server.error.Requests;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Sets;
import com.google.common.hash.Hashing;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.bouncycastle.crypto.InvalidCipherTextException;
import org.bouncycastle.crypto.engines.AESFastEngine;
import org.bouncycastle.crypto.modes.CBCBlockCipher;
import org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher;
import org.bouncycastle.crypto.params.KeyParameter;
import org.bouncycastle.crypto.params.ParametersWithIV;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.springframework.stereotype.Service;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.inject.Inject;
import javax.transaction.Transactional;
import java.io.IOException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.Security;
import java.security.interfaces.RSAPrivateCrtKey;
import java.security.spec.InvalidKeySpecException;
import java.util.Arrays;
import java.util.Base64;
import java.util.Base64.Decoder;
import java.util.Objects;
import java.util.Set;
import static com.github.nocatch.NoCatch.noCatch;
import static java.nio.charset.StandardCharsets.UTF_8;
@Service
@Slf4j
@Transactional
public class UniqueIdService {
private final ObjectMapper objectMapper;
private final boolean enabled;
private final HardwareInformationRepository hardwareInformationRepository;
private final String linkToSteamUrl;
private final RSAPrivateCrtKey privateKey;
private final int aesKeyBase64Size;
@Inject
public UniqueIdService(ServerProperties properties, ObjectMapper objectMapper, HardwareInformationRepository hardwareInformationRepository) throws NoSuchAlgorithmException, InvalidKeySpecException, IOException {
this.objectMapper = objectMapper;
this.enabled = properties.getUid().isEnabled();
this.linkToSteamUrl = properties.getUid().getLinkToSteamUrl();
this.hardwareInformationRepository = hardwareInformationRepository;
if (enabled) {
if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) {
Security.addProvider(new BouncyCastleProvider());
}
privateKey = RsaHelper.readPkcs1(properties.getUid().getPrivateKey());
// Mostly copied from the legacy server, didn't try to understand.
int aesModulusBitLength = privateKey.getModulus().bitLength();
int aesKeyBase64Size = aesModulusBitLength / 6;
this.aesKeyBase64Size = aesModulusBitLength / 6 + 3 - ((aesKeyBase64Size + 3) % 4);
} else {
privateKey = null;
aesKeyBase64Size = -1;
}
}
public void verify(Player player, String uid) {
if (!enabled) {
log.debug("Skipping unique ID check for player '{}' because it is disabled", player);
return;
}
if (player.getUniqueIdExempt() != null) {
log.debug("Skipping unique ID check for player '{}' because: {}", player, player.getUniqueIdExempt().getReason());
return;
}
if (player.getSteamId() != null) {
log.debug("Skipping unique ID check for player '{}' because of steam ID: {}", player, player.getSteamId());
return;
}
UidPayload uidPayload = noCatch(() -> extractPayload(uid));
String hash = Hashing.md5().hashString(
uidPayload.getMachine().getUuid()
+ uidPayload.getMachine().getMemory().getSerial0()
+ uidPayload.getMachine().getDisks().getControllerId()
+ uidPayload.getMachine().getBios().getManufacturer()
+ uidPayload.getMachine().getProcessor().getName()
+ uidPayload.getMachine().getProcessor().getId()
+ uidPayload.getMachine().getBios().getSmbbVersion()
+ uidPayload.getMachine().getBios().getSerial()
+ uidPayload.getMachine().getDisks().getVSerial()
, UTF_8
).toString();
HardwareInformation information = hardwareInformationRepository.findOneByHash(hash)
.orElseGet(() -> hardwareInformationRepository.save(new HardwareInformation(0,
hash,
uidPayload.getMachine().getUuid(),
uidPayload.getMachine().getMemory().getSerial0(),
uidPayload.getMachine().getDisks().getControllerId(),
uidPayload.getMachine().getBios().getManufacturer(),
uidPayload.getMachine().getProcessor().getName(),
uidPayload.getMachine().getProcessor().getId(),
uidPayload.getMachine().getBios().getSmbbVersion(),
uidPayload.getMachine().getBios().getSerial(),
uidPayload.getMachine().getDisks().getVSerial(),
Sets.newHashSet(player)
)));
player.getHardwareInformations().add(information);
Set<Player> players = information.getPlayers();
int count = players.size();
Requests.verify(count < 2, ErrorCode.UID_USED_BY_MULTIPLE_USERS, linkToSteamUrl);
Requests.verify(count == 0 || Objects.equals(players.iterator().next().getId(), player.getId()), ErrorCode.UID_USED_BY_ANOTHER_USER, linkToSteamUrl);
if (count == 0) {
// This happens if hardware information is already present but the user associations have been deleted.
information.getPlayers().add(player);
hardwareInformationRepository.save(information);
}
log.debug("Player '{}' passed unique ID check", player);
}
private UidPayload extractPayload(String uid) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, IOException, InvalidAlgorithmParameterException, InvalidCipherTextException {
Decoder b64Decoder = Base64.getDecoder();
byte[] bytes = b64Decoder.decode(uid.getBytes(UTF_8));
// First byte is the number of trailing bytes the plaintext has. Not sure why, but this doesn't seem to be needed
byte[] initVector = b64Decoder.decode(Arrays.copyOfRange(bytes, 1, 25));
byte[] aesEncryptedJson = b64Decoder.decode(Arrays.copyOfRange(bytes, 25, bytes.length - aesKeyBase64Size));
byte[] rsaEncryptedAesKey = b64Decoder.decode(Arrays.copyOfRange(bytes, bytes.length - aesKeyBase64Size, bytes.length));
// The JSON string is AES encrypted. Decrypt the AES key with our RSA key.
byte[] aesKey = rsaDecrypt(rsaEncryptedAesKey);
// Then decrypt the AES encrypted message
byte[] plaintext = aesDecrypt(initVector, aesEncryptedJson, aesKey);
// The JSON string is prefixed with the magic byte "2", meaning version 2 of the UID's JSON
String json = new String(plaintext, 1, plaintext.length - 1, UTF_8);
return objectMapper.readValue(json, UidPayload.class);
}
private byte[] aesDecrypt(byte[] initVector, byte[] aesEncryptedJson, byte[] aesKey) throws InvalidCipherTextException {
PaddedBufferedBlockCipher cipher = new PaddedBufferedBlockCipher(new CBCBlockCipher(new AESFastEngine()));
cipher.init(false, new ParametersWithIV(new KeyParameter(aesKey), initVector));
int plaintextSize = cipher.processBytes(aesEncryptedJson, 0, aesEncryptedJson.length, aesEncryptedJson, 0);
plaintextSize += cipher.doFinal(aesEncryptedJson, plaintextSize);
return Arrays.copyOf(aesEncryptedJson, plaintextSize);
}
@SneakyThrows
private byte[] rsaDecrypt(byte[] encryptedData) throws IOException, InvalidCipherTextException {
Cipher rsa = Cipher.getInstance("RSA");
rsa.init(Cipher.DECRYPT_MODE, privateKey);
return rsa.doFinal(encryptedData);
}
}
| [
"michel.jung89@gmail.com"
] | michel.jung89@gmail.com |
545061decfba7f04aa8d012f04646ad52d117ff5 | 909ae5f3cace2b52f9006482afb1a1f522aeffdf | /THEKEY Mainnet/Blockchain-Exploer/yibaodapp/yibaodapp/service/impl/PageFunctionServiceImpl.java | 662ade94f0e9e0f3c408562c3cd54191fe095563 | [] | no_license | thekeygithub/MVP | ca58f5547b2528b8be410a8d7cda5d5d6e53e286 | cf6e9d7ca4c03db999f5dd0a284de79c91190a81 | refs/heads/master | 2020-03-18T19:00:33.574777 | 2018-12-07T06:52:41 | 2018-12-07T06:52:41 | 135,128,576 | 15 | 3 | null | null | null | null | UTF-8 | Java | false | false | 8,435 | java | package com.xczg.blockchain.yibaodapp.service.impl;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.http.util.TextUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.stereotype.Service;
import com.xczg.blockchain.common.dao.BaseDao;
import com.xczg.blockchain.common.model.PageResult;
import com.xczg.blockchain.yibaodapp.bean.TblAuditRecord;
import com.xczg.blockchain.yibaodapp.bean.TblTransactionInfo;
import com.xczg.blockchain.yibaodapp.service.PageFunctionService;
import com.xczg.blockchain.yibaodapp.util.ChainUtil;
@Service("PageFunctionServiceImpl")
public class PageFunctionServiceImpl implements PageFunctionService{
private static Logger log = LoggerFactory.getLogger(ChainUtil.class);
@Autowired
private Environment env;
@Resource(name = "jdbcTemplate")
private JdbcTemplate jdbc;
@Resource
private BaseDao baseDao;
/**
* 首页功能,获取开始时间(第一个区块创建时间),运行时间,区块数量,交易数量,用户数量
*/
@Override
@SuppressWarnings("unchecked")
public Map<String, Object> getNewstInfo() {
try {
String url = env.getProperty("neo.url");
ChainUtil chainUtil = new ChainUtil();
//获取第一块区块
String StrForFirstBlk="{\"jsonrpc\": \"2.0\",\"method\": \"getblock\",\"params\": [1,1],\"id\": 1}";
Map<String, Object> MsgForFirstBlk = chainUtil.getBlockMessage(url,StrForFirstBlk);
Map<String, Object> result = (Map<String, Object>) MsgForFirstBlk.get("result");
String time =result.get("time").toString();//获取到第一个区块的时间,但是为unix时间戳
//将unix时间戳转化为北京时间
String formats ="yyyy-MM-dd HH:mm:ss";
if (TextUtils.isEmpty(formats))
formats = "yyyy-MM-dd HH:mm:ss";
Long timestamp = Long.parseLong(time) * 1000;
String startTime = new SimpleDateFormat(formats, Locale.CHINA).format(new Date(timestamp));
//获取区块数量
String StrForBlkCount="{\"jsonrpc\": \"2.0\",\"method\": \"getblockcount\",\"params\": [],\"id\": 1}";
Map<String, Object> MsgForBlkCount = chainUtil.getBlockMessage(url,StrForBlkCount);
String BlkCount = MsgForBlkCount.get("result").toString();
String sql = " select count(txid) as traNum,TIMESTAMPDIFF(DAY,?,?)"
+" as start_days,count(distinct sender)+count(distinct receiver) as user_num from tbl_transaction_info";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//得到当天日期
String currentDay = sdf.format(new Date());
Map<String, Object> NewestInfo =
jdbc.query(sql.toString(),new String[]{startTime.substring(0,10),currentDay},new ResultSetExtractor<Map<String, Object>>(){
@Override
public Map<String, Object> extractData(ResultSet rs)
throws SQLException, DataAccessException {
Map<String, Object> temp = null;
while(rs.next()){
temp = new HashMap<String, Object>();
temp.put("traNum", rs.getString("traNum"));//交易数量
temp.put("start_days", rs.getString("start_days"));//启动时间
temp.put("user_num", rs.getString("user_num"));//用户数量
}
return temp;
}
});
NewestInfo.put("startTime", startTime.substring(0,10));
NewestInfo.put("BlkCount", BlkCount);
return NewestInfo;
} catch (Exception e) {
log.error("获取区块链最新信息 失败 " + e.getMessage(), e.toString());
return null;
}
}
/**
* 根据区块索引查询区块信息
*/
@SuppressWarnings("unchecked")
@Override
public Map<String, Object> searchBlockInfo(int blockIndex) {
try {
String url = env.getProperty("neo.url");
ChainUtil chainUtil = new ChainUtil();
String StrForFirstBlk="{\"jsonrpc\": \"2.0\",\"method\": \"getblock\",\"params\": ["+blockIndex+",1],\"id\": 1}";
Map<String, Object> MsgForFirstBlk = chainUtil.getBlockMessage(url,StrForFirstBlk);
Map<String, Object> blockInfo = (Map<String, Object>) MsgForFirstBlk.get("result");
String formats ="yyyy-MM-dd HH:mm:ss";
String time = blockInfo.get("time").toString();
if (TextUtils.isEmpty(formats))
formats = "yyyy-MM-dd | HH:mm:ss";
Long timestamp = Long.parseLong(time) * 1000;
String startTime = new SimpleDateFormat(formats, Locale.CHINA).format(new Date(timestamp));
blockInfo.put("createTime", startTime);
return blockInfo;
} catch (Exception e) {
log.error("调用区块链,通过区块索引获取区块信息 失败 " + e.getMessage(), e.toString());
return null;
}
}
/**
* 根据交易标识查询
* 第一步,根据交易信息获取到区块hash
* 第二步,根据区块hash获取到对应区块信息
* 第三部,查询数据库获取该交易信息对应的区账户信息
*/
@Override
@SuppressWarnings("unchecked")
public Map<String, Object> searchtraInfo(String searchInfo) {
try {
String url = env.getProperty("neo.url");
ChainUtil chainUtil = new ChainUtil();
//根据交易标识获取区块hash
String searchBlkHash="{\"jsonrpc\": \"2.0\",\"method\": \"getrawtransaction\",\"params\": [\""+searchInfo+"\",1],\"id\": 1}";
Map<String, Object> traInfo = chainUtil.getBlockMessage(url,searchBlkHash);
//判断是否获取到数据
Map<String, Object> blockInfo = (Map<String, Object>) traInfo.get("result");
String hash = blockInfo.get("blockhash").toString();
//根据区块hash获取对应区块信息
String block="{\"jsonrpc\": \"2.0\",\"method\": \"getblock\",\"params\": [\""+hash+"\",1],\"id\": 1}";
Map<String, Object> resultInfo = chainUtil.getBlockMessage(url,block);
Map<String, Object> map = (Map<String, Object>) resultInfo.get("result");
//根据交易标识查询对应的账户信息
String sql = "select sender_addr,receiver_addr from tbl_transaction_info where txid = ?";
List<Map<String, Object>> addInfo =
jdbc.query(sql.toString(),new String[]{searchInfo},new ResultSetExtractor<List<Map<String, Object>>>(){
@Override
public List<Map<String, Object>> extractData(ResultSet rs)
throws SQLException, DataAccessException {
List<Map<String, Object>> temp = new ArrayList<Map<String,Object>>();
Map<String, Object> info = new HashMap<String, Object>();
while(rs.next()){
info.put("sender_addr", rs.getString("sender_addr"));//发送方钱包地址
info.put("receiver_addr", rs.getString("receiver_addr"));//接收方钱包地址
temp.add(info);
}
return temp;
}
});
map.put("addInfo", addInfo);
return map;
} catch (Exception e) {
log.error("调用区块链,通过区块索引获取区块信息 失败 " + e, e.toString());
return null;
}
}
/**
* 获取最新的交易信息
*/
@Override
public PageResult<TblTransactionInfo> findPageBySql(
PageResult<TblTransactionInfo> pageResult) {
TblTransactionInfo info = new TblTransactionInfo();
String orderSql = "order by time desc";
PageResult<TblTransactionInfo> queryPageByEntity = baseDao.queryPageByEntity(info,pageResult,orderSql);
return queryPageByEntity;
}
@Override
public PageResult<TblAuditRecord> queryPageByEntity(
TblAuditRecord auditRecord, PageResult<TblAuditRecord> pageResult) {
String ordersql = " order by TREATMENT_DATE desc ";
PageResult<TblAuditRecord> queryPageByEntity = baseDao.queryPageByEntity(auditRecord, pageResult, ordersql);
return queryPageByEntity;
}
@Override
public List<TblTransactionInfo> getTraInfoByID(String txid) {
String sql = " and txid in ("+txid+") ";
TblTransactionInfo info = new TblTransactionInfo();
List<TblTransactionInfo> queryByEntity = baseDao.queryByEntity(info,sql);
return queryByEntity;
}
}
| [
"silong.xing@HLJ-xingsilong.ebaonet.corp"
] | silong.xing@HLJ-xingsilong.ebaonet.corp |
2000936a14d44805b0fc4848a8af16fd0a3df32b | 0ae7f535c79372089927e5edb5d8ebbe51f67e5b | /src/cn/ucai/superwechat/adapter/GroupAdapter.java | 63c5d66a5756ed1c624a977301576d1113de56c8 | [
"Apache-2.0"
] | permissive | xuyunhao02/superwechat | 727eb5a7b286f80ada0e7d9548b25700fd03a783 | a656ae4ff2b443ab6eeae8a26463afb5ec72f61f | refs/heads/master | 2016-09-13T20:24:18.603713 | 2016-06-01T12:21:33 | 2016-06-01T12:21:33 | 59,528,754 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,334 | java | /**
* Copyright (C) 2013-2014 EaseMob Technologies. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.ucai.superwechat.adapter;
import android.content.Context;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.util.SparseIntArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.EditText;
import android.widget.Filter;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.SectionIndexer;
import android.widget.TextView;
import com.android.volley.toolbox.NetworkImageView;
import java.util.ArrayList;
import java.util.List;
import cn.ucai.superwechat.R;
import cn.ucai.superwechat.bean.Group;
import cn.ucai.superwechat.utils.UserUtils;
public class GroupAdapter extends BaseAdapter implements SectionIndexer {
private static final String TAG = GroupAdapter.class.getName();
private LayoutInflater inflater;
private String newGroup;
private String addPublicGroup;
ArrayList<Group> mGroupList;
ArrayList<Group> mCopyGroupList;
private SparseIntArray positionOfSection;
private SparseIntArray sectionOfPosition;
List<String> list;
private MyFilter myFilter;
private boolean notiyfyByFilter;
Context mContext;
public GroupAdapter(Context context, int res, ArrayList<Group> groups) {
this.mContext = context;
this.inflater = LayoutInflater.from(context);
newGroup = context.getResources().getString(R.string.The_new_group_chat);
addPublicGroup = context.getResources().getString(R.string.add_public_group_chat);
mGroupList = groups;
mCopyGroupList = new ArrayList<Group>();
mCopyGroupList.addAll(groups);
}
@Override
public int getViewTypeCount() {
return 4;
}
@Override
public int getItemViewType(int position) {
if (position == 0) {
return 0;
} else if (position == 1) {
return 1;
} else if (position == 2) {
return 2;
} else {
return 3;
}
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (getItemViewType(position) == 0) {
if (convertView == null) {
convertView = inflater.inflate(R.layout.search_bar_with_padding, null);
}
final EditText query = (EditText) convertView.findViewById(R.id.query);
final ImageButton clearSearch = (ImageButton) convertView.findViewById(R.id.search_clear);
query.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence s, int start, int before, int count) {
getFilter().filter(s);
if (s.length() > 0) {
clearSearch.setVisibility(View.VISIBLE);
} else {
clearSearch.setVisibility(View.INVISIBLE);
}
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
public void afterTextChanged(Editable s) {
}
});
clearSearch.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
query.getText().clear();
}
});
} else if (getItemViewType(position) == 1) {
if (convertView == null) {
convertView = inflater.inflate(R.layout.row_add_group, null);
}
((ImageView) convertView.findViewById(R.id.avatar)).setImageResource(R.drawable.create_group);
((TextView) convertView.findViewById(R.id.name)).setText(newGroup);
} else if (getItemViewType(position) == 2) {
if (convertView == null) {
convertView = inflater.inflate(R.layout.row_add_group, null);
}
((ImageView) convertView.findViewById(R.id.avatar)).setImageResource(R.drawable.add_public_group);
((TextView) convertView.findViewById(R.id.name)).setText(addPublicGroup);
((TextView) convertView.findViewById(R.id.header)).setVisibility(View.VISIBLE);
} else {
if (convertView == null) {
convertView = inflater.inflate(R.layout.row_group, null);
}
Group group = getItem(position);
((TextView) convertView.findViewById(R.id.name)).setText(group.getMGroupName());
UserUtils.setGroupBeanAvatar(group.getMGroupHxid(),((NetworkImageView) convertView.findViewById(R.id.avatar)));
}
return convertView;
}
@Override
public int getCount() {
return mGroupList==null?3:mGroupList.size() + 3;
}
@Override
public Group getItem(int position) {
if(position>=3){
return mGroupList.get(position-3);
}
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
public void initList(ArrayList<Group> list) {
mGroupList.addAll(list);
notifyDataSetChanged();
}
@Override
public Object[] getSections() {
positionOfSection = new SparseIntArray();
sectionOfPosition = new SparseIntArray();
int count = getCount();
list = new ArrayList<String>();
list.add(mContext.getString(R.string.search_header));
positionOfSection.put(0, 0);
sectionOfPosition.put(0, 0);
for (int i = 1; i < count; i++) {
String letter = getItem(i).getHeader();
Log.e(TAG, "contactadapter getsection getHeader:" + letter + " name:" + getItem(i).getMGroupName());
int section = list.size() - 1;
if (list.get(section) != null && !list.get(section).equals(letter)) {
list.add(letter);
section++;
positionOfSection.put(section, i);
}
sectionOfPosition.put(i, section);
}
return list.toArray(new String[list.size()]);
}
public Filter getFilter() {
if(myFilter==null){
myFilter = new MyFilter(mGroupList);
}
return myFilter;
}
private class MyFilter extends Filter{
List<Group> mOriginalList = null;
public MyFilter(List<Group> myList) {
this.mOriginalList = myList;
}
@Override
protected synchronized FilterResults performFiltering(CharSequence prefix) {
FilterResults results = new FilterResults();
if(mOriginalList==null){
mOriginalList = new ArrayList<Group>();
}
Log.e(TAG, "contacts original size: " + mOriginalList.size());
Log.e(TAG, "contacts copy size: " + mCopyGroupList.size());
if(prefix==null || prefix.length()==0){
results.values = mCopyGroupList;
results.count = mCopyGroupList.size();
}else{
String prefixString = prefix.toString();
final int count = mOriginalList.size();
final ArrayList<Group> newValues = new ArrayList<Group>();
for(int i=0;i<count;i++){
final Group group = mOriginalList.get(i);
String username = UserUtils.getPinYinFromHanZi(group.getMGroupName());
if(username.contains(prefixString)){
newValues.add(group);
}
else{
final String[] words = username.split(" ");
final int wordCount = words.length;
// Start at index 0, in case valueText starts with space(s)
for (int k = 0; k < wordCount; k++) {
if (words[k].contains(prefixString)) {
newValues.add(group);
break;
}
}
}
}
results.values=newValues;
results.count=newValues.size();
}
Log.e(TAG, "contacts filter results size: " + results.count);
return results;
}
@Override
protected synchronized void publishResults(CharSequence constraint,
FilterResults results) {
mGroupList.clear();
mGroupList.addAll((List<Group>)results.values);
Log.e(TAG, "publish contacts filter results size: " + results.count);
if (results.count > 0) {
notiyfyByFilter = true;
notifyDataSetChanged();
notiyfyByFilter = false;
} else {
notifyDataSetInvalidated();
}
}
}
@Override
public void notifyDataSetChanged() {
super.notifyDataSetChanged();
if(!notiyfyByFilter){
mCopyGroupList.clear();
mCopyGroupList.addAll(mGroupList);
}
}
@Override
public int getPositionForSection(int sectionIndex) {
return positionOfSection.get(sectionIndex);
}
@Override
public int getSectionForPosition(int position) {
return sectionOfPosition.get(position);
}
} | [
"1336209466@qq.com"
] | 1336209466@qq.com |
95d8c05d4bc0d402a632e420f44ce6a272d5cc3a | 95e545e45e8e5122766c0eba0d3f35ba782a6030 | /src/test/java/com/blogspot/mstachniuk/solarsystem/task09/SolarSystemFactoryTest.java | 216e8f281912068f453e5806f4fec81f035e7956 | [] | no_license | earion/PlanetBuilder | 7aec95683495c0e8ed6f867af50d921b326dbba0 | 91433e53f4d16544e8d8939c98dc34e45a3192d9 | refs/heads/master | 2021-03-12T21:48:20.944446 | 2014-09-28T21:03:24 | 2014-09-28T21:03:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,817 | java | package com.blogspot.mstachniuk.solarsystem.task09;
import com.blogspot.mstachniuk.solarsystem.Gas;
import com.blogspot.mstachniuk.solarsystem.Planet;
import com.blogspot.mstachniuk.solarsystem.RotationDirection;
import com.blogspot.mstachniuk.solarsystem.task07.SolarSystemFactory;
import org.junit.Test;
import java.math.BigDecimal;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static org.junit.Assert.assertEquals;
public class SolarSystemFactoryTest {
/**
* Task 09: Poniżej jest zrefaktorowany kod z siódmego zadania. Sekcja then jest znacznie czytelniejsza,
* ale assertPlanet() jest dalej mało czytelne.
* Zrefaktoruj test tak, aby korzystał z FEST Assert 2.X.
*/
@Test
public void shouldCreateInnersPlants() {
// given
SolarSystemFactory factory = new SolarSystemFactory();
// when
List<Planet> innerPlanets = factory.createInnerPlanets();
// then
Planet mercury = innerPlanets.get(0);
assertPlanet(mercury, "Mercury", RotationDirection.LEFT, "4879400", "87.96935", "47.362",
3.701, Gas.OXYGEN, Gas.SODIUM, Gas.HYDROGEN);
Planet venus = innerPlanets.get(1);
assertPlanet(venus, "Venus", RotationDirection.RIGHT, "12103700", "224.70096", "35.02",
8.87, Gas.CARBON_DIOXIDE, Gas.NITROGEN);
Planet earth = innerPlanets.get(2);
assertPlanet(earth, "Earth", RotationDirection.LEFT, "12756273", "365.256363004", "29.78",
9.806_65, Gas.NITROGEN, Gas.OXYGEN, Gas.CARBON_DIOXIDE, Gas.ARGON);
Planet mars = innerPlanets.get(3);
assertPlanet(mars, "Mars", RotationDirection.LEFT, "6804900", "686.9601", "24.077",
3.69, Gas.CARBON_DIOXIDE, Gas.NITROGEN);
}
private void assertPlanet(Planet planet, String planetName, RotationDirection direction, String diameterInMeter,
String yearInEarthDays, String avgOrbitalSpeedInKmPerSecond, double acceleration,
Gas... atmosphereGases) {
assertEquals(planetName, planet.getName());
assertEquals(direction, planet.getRotationDirection());
assertEquals(0, new BigDecimal(diameterInMeter).compareTo(planet.getDiameter().getMeter()));
assertEquals(0, new BigDecimal(yearInEarthDays).compareTo(planet.getSiderealYear().inEarthDays()));
assertEquals(0, new BigDecimal(avgOrbitalSpeedInKmPerSecond).compareTo(planet.getAvgOrbitalSpeed().getKmPerSecond()));
assertEquals(acceleration, planet.getAcceleration(), 0.01);
Set<Gas> expectedGases = Stream.of(atmosphereGases).collect(Collectors.toSet());
assertEquals(expectedGases, planet.getAtmosphereGases());
}
}
| [
"mstachniuk@gmail.com"
] | mstachniuk@gmail.com |
8a1f088f43265791b9114e89ba0a37047e8eb58c | d4408191844bf38125712a18ed7ffdea2c7d162c | /src/model_DAO/DAOManagementFactoryDepartment.java | 1d11cdcc906c49bb6676c6f1edcaac92591c4e1a | [] | no_license | lflla/DII | d3c32f5d3607d7fa3d476d45391d4808dfe77811 | 385cb86d3497f250d7c3ace6fb628d6e44cc3834 | refs/heads/master | 2021-05-12T00:45:24.788284 | 2018-01-15T12:52:58 | 2018-01-15T12:52:58 | 117,543,292 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,379 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package model_DAO;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
import model_DS.DSFileDepartment;
import model_DS.DSFileEmployee;
import model_DS.ejemploContactoMySQL;
import interfaceDAO.IDAOManagement;
/**
*
* @author Administrador
*/
public class DAOManagementFactoryDepartment {
private static DAOManagementFactoryDepartment instance = null;
private DAOManagementFactoryDepartment() {
}
public static DAOManagementFactoryDepartment getInstance() {
if (instance == null) {
instance = new DAOManagementFactoryDepartment();
}
return instance;
}
public IDAOManagement createDAO() throws FileNotFoundException, IOException {
File f = new File("config.properties");
Properties p = new Properties();
p.load(new FileInputStream(f));
String imp = p.getProperty("baseDatos");
IDAOManagement cDAO ;
if ("File".equals(imp)) {
cDAO = new DSFileDepartment("FileDepartment.DAT");
} else {
cDAO = new ejemploContactoMySQL();
}
return cDAO;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
937671d0a3c79ed469109426f98fa05923326e25 | be801ca22e95d793b084f48861631da379433fd4 | /app/src/androidTest/java/com/example/a72button/ExampleInstrumentedTest.java | 9a828033ef338e0f1e581c9c8e0be80fc7162e92 | [] | no_license | Pyry-Santahuhta/Smartpost-9.3 | 54a856c9180f6efeed47380928e5050969006b67 | dd3bc6c6c221154baa9a54bb5eee6a0deb50080f | refs/heads/master | 2022-06-29T06:13:39.196830 | 2020-05-07T07:20:39 | 2020-05-07T07:20:39 | 255,899,325 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 758 | java | package com.example.a72button;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.a72button", appContext.getPackageName());
}
}
| [
"61690808+Pyry-Santahuhta@users.noreply.github.com"
] | 61690808+Pyry-Santahuhta@users.noreply.github.com |
150b20a7acf6a66833181bc49d91bc789fa4dd1d | 61f83bcfe1b0e7c0fb80cc6d01cae527fc45f82f | /JavaTestingConcept/src/com/variable/Static.java | 02dd24c33bf3689f2a7a1df9f00d05aac3e8c87c | [] | no_license | mahendrakishore/JavaConcept | d3dffd36a62b97606c646329d5379af537648a54 | d293474c61566f7b921d17bc78f3332a8f57a2e0 | refs/heads/master | 2021-01-23T01:56:01.351302 | 2017-05-31T03:56:28 | 2017-05-31T03:56:28 | 92,899,816 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 294 | java | package com.variable;
public class Static {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("string main");
}
public static void main(int[] args) {
// TODO Auto-generated method stub
System.out.println("int main");
}
}
| [
"mahen@mahen-PC"
] | mahen@mahen-PC |
f1c553ab2d67090b7ec13f12ccbbd16e333a0ab1 | acbccd3c9cb44fe7546916788c7a060cc895495c | /kiwi-parser/src/main/java/de/goto3d/kiwi/compiler/parser/StatementListParser.java | 7e4ebb4d09b5dd8c1d8da0e932012b40a7481f6c | [] | no_license | zapmya/Kiwi | 6b84bd4c282bf4d003694c7fb1d137ccaef66895 | 8cbd1fafc63c76888f24fd0898ca70079ec651b0 | refs/heads/master | 2021-06-10T03:14:34.544808 | 2021-05-05T07:07:40 | 2021-05-05T07:07:40 | 178,700,187 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,100 | java | package de.goto3d.kiwi.compiler.parser;
import com.creativewidgetworks.goldparser.engine.Reduction;
import com.creativewidgetworks.goldparser.engine.Token;
import com.creativewidgetworks.goldparser.parser.GOLDParser;
import com.creativewidgetworks.goldparser.parser.ProcessRule;
import de.goto3d.kiwi.compiler.ast.statements.StatementListNode;
import de.goto3d.kiwi.compiler.ast.statements.StatementNode;
/**
* Created by IntelliJ IDEA.
* User: gru
* Date: 16.01.13
* Time: 11:04
*/
@ProcessRule(rule={
"<Statements> ::= <Statement> <Statements>",
"<Statements> ::= <Statement>"
})
public class StatementListParser extends ListParser<StatementNode> {
public StatementListParser(GOLDParser parser) {
Reduction reduction = parser.getCurrentReduction();
StatementListNode statementListNode = new StatementListNode(this.convertPosition(parser));
this.parseList(statementListNode, reduction);
this.astNode = statementListNode;
}
@Override
protected StatementNode createTerminalNode(Token token) {
return null;
}
}
| [
"t.grundner@tallence.com"
] | t.grundner@tallence.com |
509595a95660ecaa94dc39fe987fe8b159ee8a34 | 43e5bf5eeff0749b77f213a76a092ebc8d43831b | /app/src/main/java/com/example/jingdong/decoding/DecodeThread.java | 355455b2e87e2f5eade82ba4cdb1cd3fe70afafc | [] | no_license | Domineering/JingDong | d4c727055fcbe10ce6a956c621cfbfca4d97ba00 | 0c0f8f490f84b6c7a97614c68465d9189566fd2d | refs/heads/master | 2021-08-31T10:03:15.763111 | 2017-12-21T01:09:53 | 2017-12-21T01:09:53 | 114,536,275 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,568 | java | /*
* Copyright (C) 2008 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.jingdong.decoding;
import android.os.Handler;
import android.os.Looper;
import com.example.jingdong.view.MipcaActivityCapture;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.DecodeHintType;
import com.google.zxing.ResultPointCallback;
import java.util.Hashtable;
import java.util.Vector;
import java.util.concurrent.CountDownLatch;
/**
* This thread does all the heavy lifting of decoding the images.
* 解码线程
*/
final class DecodeThread extends Thread {
public static final String BARCODE_BITMAP = "barcode_bitmap";
private final MipcaActivityCapture activity;
private final Hashtable<DecodeHintType, Object> hints;
private Handler handler;
private final CountDownLatch handlerInitLatch;
DecodeThread(MipcaActivityCapture activity,
Vector<BarcodeFormat> decodeFormats,
String characterSet,
ResultPointCallback resultPointCallback) {
this.activity = activity;
handlerInitLatch = new CountDownLatch(1);
hints = new Hashtable<DecodeHintType, Object>(3);
if (decodeFormats == null || decodeFormats.isEmpty()) {
decodeFormats = new Vector<BarcodeFormat>();
decodeFormats.addAll(DecodeFormatManager.ONE_D_FORMATS);
decodeFormats.addAll(DecodeFormatManager.QR_CODE_FORMATS);
decodeFormats.addAll(DecodeFormatManager.DATA_MATRIX_FORMATS);
}
hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats);
if (characterSet != null) {
hints.put(DecodeHintType.CHARACTER_SET, characterSet);
}
hints.put(DecodeHintType.NEED_RESULT_POINT_CALLBACK, resultPointCallback);
}
Handler getHandler() {
try {
handlerInitLatch.await();
} catch (InterruptedException ie) {
// continue?
}
return handler;
}
@Override
public void run() {
Looper.prepare();
handler = new DecodeHandler(activity, hints);
handlerInitLatch.countDown();
Looper.loop();
}
}
| [
"1318319029@qq.com"
] | 1318319029@qq.com |
81fc5f036ab5190696667cf42872e57004595efb | 0d5ca984cbc89be34fe387c66e9c04b9c7d92143 | /mms-user-ms/src/main/java/com/capg/mms/register/repo/IRegisterRepo.java | 64aaa50925569d736fa4e3616f85aac09d3ca132 | [] | no_license | mahesh146/capg-bvrit-b1-online-movie-ticket-system | 316a33ad1ece7881107f751a53f3b74a67192084 | 69469db91eb64d5097c5fee75508ed5e86e98d4c | refs/heads/master | 2022-12-24T10:47:31.589668 | 2020-10-05T11:56:29 | 2020-10-05T11:56:29 | 261,792,643 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 215 | java | package com.capg.mms.register.repo;
import org.springframework.data.jpa.repository.JpaRepository;
import com.capg.mms.register.model.User;
public interface IRegisterRepo extends JpaRepository<User, Integer> {
}
| [
"hp@192.168.0.5"
] | hp@192.168.0.5 |
e69fafad7973df584e51b9ab02e561204f59363d | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/15/15_91bde9e0fa01b40149c3dded7fd1fcd37fddbabe/P2PClient/15_91bde9e0fa01b40149c3dded7fd1fcd37fddbabe_P2PClient_t.java | 7ced703d7fcf77139a33261ca4077ab21e4bec96 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 13,160 | java | // $Id: P2PClient.java,v 1.21 2007-10-31 17:27:11 radicke Exp $
package org.dcache.pool.p2p;
import java.io.PrintWriter;
import java.io.IOException;
import java.net.UnknownHostException;
import java.net.InetAddress;
import java.util.Map;
import java.util.Collections;
import java.util.List;
import java.util.HashMap;
import java.util.concurrent.ScheduledExecutorService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.dcache.pool.classic.ChecksumModuleV1;
import org.dcache.pool.repository.Repository;
import org.dcache.pool.repository.EntryState;
import org.dcache.pool.repository.StickyRecord;
import org.dcache.cells.AbstractCellComponent;
import org.dcache.cells.CellMessageReceiver;
import org.dcache.cells.CellCommandListener;
import org.dcache.cells.CellStub;
import diskCacheV111.util.CacheException;
import diskCacheV111.util.CacheFileAvailable;
import diskCacheV111.util.PnfsId;
import diskCacheV111.vehicles.DoorTransferFinishedMessage;
import diskCacheV111.vehicles.HttpDoorUrlInfoMessage;
import diskCacheV111.vehicles.HttpProtocolInfo;
import diskCacheV111.vehicles.StorageInfo;
import dmg.util.Args;
public class P2PClient
extends AbstractCellComponent
implements CellMessageReceiver,
CellCommandListener
{
private final static Logger _log = LoggerFactory.getLogger(P2PClient.class);
private final Map<Integer, Companion> _companions = new HashMap();
private ScheduledExecutorService _executor;
private Repository _repository;
private ChecksumModuleV1 _checksumModule;
private int _maxActive;
private CellStub _pnfs;
private CellStub _pool;
private String _destinationPoolCellname;
private String _destinationPoolCellDomainName;
private InetAddress _interface;
@Override
public void afterSetup()
{
}
public void init() {
_destinationPoolCellname = getCellName();
_destinationPoolCellDomainName = getCellDomainName();
}
public synchronized void setExecutor(ScheduledExecutorService executor)
{
_executor = executor;
}
public synchronized void setRepository(Repository repository)
{
_repository = repository;
}
public synchronized void setChecksumModule(ChecksumModuleV1 csm)
{
_checksumModule = csm;
}
public synchronized void setPnfs(CellStub pnfs)
{
_pnfs = pnfs;
}
public synchronized void setPool(CellStub pool)
{
_pool = pool;
}
public synchronized int getActiveJobs()
{
return (_companions.size() <= _maxActive) ? _companions.size() : _maxActive;
}
public synchronized int getMaxActiveJobs()
{
return _maxActive;
}
public synchronized int getQueueSize()
{
return
(_companions.size() > _maxActive)
? (_companions.size() - _maxActive)
: 0;
}
public synchronized InetAddress getInterface()
throws UnknownHostException
{
return (_interface == null) ? InetAddress.getLocalHost() : _interface;
}
public synchronized void messageArrived(DoorTransferFinishedMessage message)
{
HttpProtocolInfo pinfo = (HttpProtocolInfo)message.getProtocolInfo();
int sessionId = pinfo.getSessionId();
Companion companion = _companions.get(sessionId);
if (companion != null) {
companion.messageArrived(message);
}
}
public synchronized void messageArrived(HttpDoorUrlInfoMessage message)
{
int sessionId = (int) message.getId();
Companion companion = _companions.get(sessionId);
if (companion != null) {
companion.messageArrived(message);
}
}
/**
* Adds a companion to the _companions map.
*/
private synchronized int addCompanion(Companion companion)
{
int sessionId = companion.getId();
_companions.put(sessionId, companion);
return sessionId;
}
/**
* Removes a companion from the _companions map.
*/
private synchronized void removeCompanion(int sessionId)
{
_companions.remove(sessionId);
notifyAll();
}
/**
* Cancels all companions for a given file.
*/
private synchronized void cancelCompanions(PnfsId pnfsId, String cause)
{
for (Companion companion: _companions.values()) {
if (pnfsId.equals(companion.getPnfsId())) {
companion.cancel(cause);
}
}
}
/**
* Small wrapper for the real callback. Will remove the companion
* from the <code>_companions</code> map.
*/
private class Callback implements CacheFileAvailable
{
private CacheFileAvailable _callback;
private int _id;
Callback(CacheFileAvailable callback)
{
_callback = callback;
_id = -1;
}
synchronized void setId(int id)
{
_id = id;
notifyAll();
}
synchronized int getId()
throws InterruptedException
{
while (_id == -1) {
wait();
}
return _id;
}
@Override
public void cacheFileAvailable(PnfsId pnfsId, Throwable t)
{
try {
if (_callback != null) {
_callback.cacheFileAvailable(pnfsId, t);
}
removeCompanion(getId());
/* In case of a successfull transfer, there is no
* reason to keep other companions on the same file
* around.
*/
if (t == null) {
cancelCompanions(pnfsId,
"Replica already exists");
}
} catch (InterruptedException e) {
// Ignored, typically happens at cell shutdown
}
}
}
public synchronized int newCompanion(PnfsId pnfsId,
String sourcePoolName,
StorageInfo storageInfo,
EntryState targetState,
List<StickyRecord> stickyRecords,
CacheFileAvailable callback)
throws IOException, CacheException, InterruptedException
{
if (getCellEndpoint() == null) {
throw new IllegalStateException("Endpoint not initialized");
}
if (_pool == null) {
throw new IllegalStateException("Pool stub not initialized");
}
if (_executor == null) {
throw new IllegalStateException("Executor not initialized");
}
if (_repository == null) {
throw new IllegalStateException("Repository not initialized");
}
if (_checksumModule == null) {
throw new IllegalStateException("Checksum module not initialized");
}
if (_pnfs == null) {
throw new IllegalStateException("PNFS stub not initialized");
}
if (_repository.getState(pnfsId) != EntryState.NEW) {
throw new IllegalStateException("Replica already exists");
}
Callback cb = new Callback(callback);
Companion companion =
new Companion(_executor, getInterface(), _repository,
_checksumModule,
_pnfs, _pool,
pnfsId, storageInfo,
sourcePoolName,
_destinationPoolCellname,
_destinationPoolCellDomainName,
targetState, stickyRecords,
cb);
int id = addCompanion(companion);
cb.setId(id);
return id;
}
/**
* Cancels a transfer. Returns true if the transfer was
* cancelled. Returns false if the transfer was already completed
* or did not exist.
*/
public synchronized boolean cancel(int id)
{
Companion companion = _companions.get(id);
return (companion == null)
? false
: companion.cancel("Transfer was cancelled");
}
/**
* Cancels all transfers.
*/
public synchronized void shutdown()
throws InterruptedException
{
for (Companion companion: _companions.values()) {
companion.cancel("Pool is going down");
}
while (!_companions.isEmpty()) {
wait();
}
}
@Override
public synchronized void getInfo(PrintWriter pw)
{
try {
pw.println(" Interface : " + getInterface());
} catch (UnknownHostException e) {
pw.println(" Interface : " + e.getMessage());
}
pw.println(" Max Active : " + _maxActive);
pw.println("Pnfs Timeout : " + (_pnfs.getTimeout() / 1000L) + " seconds ");
}
@Override
public synchronized void printSetup(PrintWriter pw)
{
pw.println("#\n# Pool to Pool (P2P) [$Revision$]\n#");
pw.println("pp set max active " + _maxActive);
pw.println("pp set pnfs timeout " + (_pnfs.getTimeout() / 1000L));
if (_interface != null) {
pw.println("pp interface " + _interface.getHostAddress());
}
}
public static final String hh_pp_set_pnfs_timeout = "<Timeout/sec>";
public synchronized String ac_pp_set_pnfs_timeout_$_1(Args args)
{
long timeout = Long.parseLong(args.argv(0));
_pnfs.setTimeout(timeout * 1000L);
return "Pnfs timeout set to " + timeout + " seconds";
}
public static final String hh_pp_set_max_active = "<normalization>";
public synchronized String ac_pp_set_max_active_$_1(Args args)
{
_maxActive = Integer.parseInt(args.argv(0));
return "";
}
public static final String hh_pp_set_port = "<port> # Obsolete";
public synchronized String ac_pp_set_port_$_1(Args args)
{
return "'pp set port' is obsolete";
}
public static final String fh_pp_set_listen =
"The command is deprecated. Use 'pp interface' instead.";
public static final String hh_pp_set_listen = "<address> # Deprecated";
public synchronized String ac_pp_set_listen_$_1_2(Args args)
throws UnknownHostException
{
return ac_pp_interface_$_0_1(new Args(args.argv(0)));
}
public static final String fh_pp_interface =
"Specifies the interface used when connecting to other pools.\n\n" +
"For pool to pool transfers, the destination creates a TCP\n" +
"conection to the source pool. For this to work the source pool\n" +
"must select one of its network interfaces to which the destination\n" +
"pool can connect. For compatibility reasons this interface is\n" +
"not specified explicitly on the source pool. Instead an interface\n" +
"on the target pool is specified and the source pool selects an\n" +
"interface facing the target interface.\n\n" +
"If * is provided then an interface is selected automatically.";
public static final String hh_pp_interface = "[<address>]";
public synchronized String ac_pp_interface_$_0_1(Args args)
throws UnknownHostException
{
if (args.argc() == 1) {
String host = args.argv(0);
_interface = host.equals("*") ? null : InetAddress.getByName(host);
}
return "PP interface is " + getInterface();
}
public static final String hh_pp_get_file = "<pnfsId> <pool>";
public synchronized String ac_pp_get_file_$_2(Args args)
throws CacheException, IOException, InterruptedException
{
PnfsId pnfsId = new PnfsId(args.argv(0));
String pool = args.argv(1);
List<StickyRecord> stickyRecords = Collections.emptyList();
newCompanion(pnfsId, pool, null, EntryState.CACHED, stickyRecords, null);
return "Transfer Initiated";
}
public static final String hh_pp_remove = "<id>";
public synchronized String ac_pp_remove_$_1(Args args)
throws NumberFormatException
{
int id = Integer.valueOf(args.argv(0));
if (!cancel(id)) {
throw new IllegalArgumentException("Id not found: " + id);
}
return "";
}
public static final String hh_pp_ls = " # get the list of companions";
public synchronized String ac_pp_ls(Args args)
{
StringBuilder sb = new StringBuilder();
for (Companion c : _companions.values()) {
sb.append(c.toString()).append("\n");
}
return sb.toString();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
85d7b6ca7332fa5a80d62abb774da6ab5a5ce6e3 | 5bd55d54390a0b7953985b55de9af007001a8d02 | /p1_quickly_start/src/BMICalculator.java | 363d9b8026d74e79e7eb500f3528fac56eedcfdd | [] | no_license | PGMonster/java_practice | a700fdf2da0ac24495d7c3c10c5af3e5847130e4 | 1b8eb97f9791343bc681a71c428e8691ac817606 | refs/heads/main | 2023-08-24T16:57:16.455099 | 2021-10-10T16:29:56 | 2021-10-10T16:29:56 | 332,423,736 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,440 | java | package p1_quickly_start;
import java.util.Scanner;
public class BMICalculator {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Welcome to use BMI Calculator !!!"); // 打印提示
int c1 = 1;
// char c2 = 'N';
while (c1 == 1) {
System.out.print("Input your weight(kg): "); //打印提示
float weight = scanner.nextFloat(); // 读取一行输入并获取浮点数
System.out.print("Input your height(m): ");
float height = scanner.nextFloat();
// 计算BMI值
float bmi = weight / (height * height);
String res;
// 判断结果
if (bmi < 18.5) {
res = "过轻";
} else if (bmi < 25) {
res = "正常";
} else if (bmi < 28) {
res = "过重";
} else if (bmi < 32) {
res = "肥胖";
} else {
res = "过于肥胖";
}
System.out.println("Check out your report!");
System.out.printf("Weight\t:\t%.1f(kg)\n", weight);
System.out.printf("Height\t:\t%.2f(m)\n", height);
System.out.printf("BMI \t:\t%.1f\n", bmi);
System.out.printf("Results\t:\t%s\n", res);
System.out.println();
System.out.print("是否继续查询?");
String button = scanner.nextLine();
switch (button) {
case "Y":
case "Yes":
case "yes":
case "y":
default:
c1 = 1;
break;
case "N":
case "n":
case "No":
case "no":
c1 = 0;
break;
}
}
}
}
| [
"15026582173@163.com"
] | 15026582173@163.com |
723d60ec7beb11f6856dce697045946a02641c6d | e27942cce249f7d62b7dc8c9b86cd40391c1ddd4 | /modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201708/cm/FeedItemValidationStatus.java | 4e61212717af111fe3d9572131b0d433bc45eeb7 | [
"Apache-2.0"
] | permissive | mo4ss/googleads-java-lib | b4b6178747d25d16ae6aa0c80d80ee18a2dfe01a | efaa9c3bd8a46a3ed4b00963dc9760c6dd8bd641 | refs/heads/master | 2022-12-05T00:30:56.740813 | 2022-11-16T10:47:15 | 2022-11-16T10:47:15 | 108,132,394 | 0 | 0 | Apache-2.0 | 2022-11-16T10:47:16 | 2017-10-24T13:41:43 | Java | UTF-8 | Java | false | false | 1,819 | java | // Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.api.ads.adwords.jaxws.v201708.cm;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for FeedItemValidationStatus.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="FeedItemValidationStatus">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="UNCHECKED"/>
* <enumeration value="ERROR"/>
* <enumeration value="VALID"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "FeedItemValidationStatus")
@XmlEnum
public enum FeedItemValidationStatus {
/**
*
* Validation pending.
*
*
*/
UNCHECKED,
/**
*
* An error was found.
*
*
*/
ERROR,
/**
*
* FeedItem is semantically well-formed.
*
*
*/
VALID;
public String value() {
return name();
}
public static FeedItemValidationStatus fromValue(String v) {
return valueOf(v);
}
}
| [
"jradcliff@users.noreply.github.com"
] | jradcliff@users.noreply.github.com |
53ea6aac153c2300b4876e890869ac69be0cd4e3 | de79bb6f4bddd40b205c0e94bc785de9f372d297 | /app/src/main/java/com/homeinspection/PropertyOverviewCheckInOutActivity.java | e9627d591279c581cf7deb1bf81cbea5b33df83c | [] | no_license | mehul-personal/HomeInspection | aa12a113e3b3f129845fd507d95c8e4907e281ce | e7870f5cde9f0d62a0a9c5e0e0709f019ce80d44 | refs/heads/master | 2020-07-30T07:01:16.687820 | 2016-11-13T18:12:13 | 2016-11-13T18:12:13 | 73,633,722 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,201 | java | package com.homeinspection;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.DefaultRetryPolicy;
import com.android.volley.NoConnectionError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.TimeoutError;
import com.android.volley.VolleyError;
import com.android.volley.VolleyLog;
import com.android.volley.toolbox.StringRequest;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.Map;
public class PropertyOverviewCheckInOutActivity extends AppCompatActivity {
FrameLayout back;
TextView header;
EditText edtCheckInDescription, edtCheckInAdditionalComment, edtCheckOutAdditionalComment;
Button btnCheckInDone, btnCheckOutDone;
String apiCall = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_property_overview_check_inout);
back = (FrameLayout) findViewById(R.id.flBack);
header = (TextView) findViewById(R.id.txvHeader);
edtCheckInDescription = (EditText) findViewById(R.id.edtCheckInDescription);
edtCheckInAdditionalComment = (EditText) findViewById(R.id.edtCheckInAdditionalComment);
edtCheckOutAdditionalComment = (EditText) findViewById(R.id.edtCheckOutAdditionalComment);
btnCheckInDone = (Button) findViewById(R.id.btnCheckInDone);
btnCheckOutDone = (Button) findViewById(R.id.btnCheckOutDone);
Intent i = getIntent();
header.setText(i.getStringExtra("HEADER"));
apiCall = i.getStringExtra("APICALL");
edtCheckInDescription.setText(i.getStringExtra("IN_DESC"));
edtCheckInAdditionalComment.setText(i.getStringExtra("IN_ADDITIONAL"));
edtCheckOutAdditionalComment.setText(i.getStringExtra("OUT_DESC"));
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
btnCheckInDone.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (getSharedPreferences("LOGIN_DETAIL", 0).getString("PROPERTY_TYPE", "").equalsIgnoreCase("checkin")) {
insertPropertyOverview(edtCheckInDescription.getText().toString(), edtCheckInAdditionalComment.getText().toString(),
apiCall, getSharedPreferences("LOGIN_DETAIL", 0).getString("PROPERTY_TYPE_ID_CHECKIN", ""));
} else {
Toast.makeText(PropertyOverviewCheckInOutActivity.this, "Sorry! You have started " +
getSharedPreferences("LOGIN_DETAIL", 0).getString("PROPERTY_TYPE", "") + " process", Toast.LENGTH_LONG).show();
}
}
});
btnCheckOutDone.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (getSharedPreferences("LOGIN_DETAIL", 0).getString("PROPERTY_TYPE", "").equalsIgnoreCase("checkout")) {
insertPropertyOverview(edtCheckOutAdditionalComment.getText().toString(), "",
apiCall, getSharedPreferences("LOGIN_DETAIL", 0).getString("PROPERTY_TYPE_ID_CHECKOUT", ""));
} else {
Toast.makeText(PropertyOverviewCheckInOutActivity.this, "Sorry! You have started " +
getSharedPreferences("LOGIN_DETAIL", 0).getString("PROPERTY_TYPE", "") + " process", Toast.LENGTH_LONG).show();
}
}
});
}
public void insertPropertyOverview(final String generalDesc, final String additionalDesc, final String type, final String propertyTypeId) {
String tag_json_obj = "json_obj_req";
String url = ApplicationData.serviceURL + "insertpropertyoverview";
final ProgressDialog mProgressDialog = new ProgressDialog(this);
mProgressDialog.setTitle("");
mProgressDialog.setCanceledOnTouchOutside(false);
mProgressDialog.setMessage("Please Wait...");
mProgressDialog.show();
StringRequest jsonObjReq = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.e("insertpropertyoverview", response.toString());
try {
mProgressDialog.dismiss();
JSONObject dataOb = new JSONObject(response.toString());
JSONArray msgArray = dataOb.getJSONArray("Message");
JSONObject msgOb = msgArray.getJSONObject(0);
if (msgOb.getBoolean("result")) {
Toast.makeText(PropertyOverviewCheckInOutActivity.this, "Property overview comment saved successfully",
Toast.LENGTH_LONG).show();
Intent i = new Intent();
i.putExtra("msg", "SUCCESS");
setResult(11, i);
finish();
} else {
Toast.makeText(PropertyOverviewCheckInOutActivity.this, "" + msgOb.getString("message"),
Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
if (e instanceof TimeoutError || e instanceof NoConnectionError) {
Toast.makeText(PropertyOverviewCheckInOutActivity.this, "Please check your internet connection!", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(PropertyOverviewCheckInOutActivity.this, "Something is wrong Please try again!", Toast.LENGTH_LONG).show();
}
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
mProgressDialog.dismiss();
VolleyLog.e("insertpropertyoverview Error", "Error: "
+ error.getMessage());
// hide the progress dialog
error.getCause();
error.printStackTrace();
if (error instanceof TimeoutError || error instanceof NoConnectionError) {
Toast.makeText(PropertyOverviewCheckInOutActivity.this, "Please check your internet connection!", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(PropertyOverviewCheckInOutActivity.this, "Something is wrong Please try again!", Toast.LENGTH_LONG).show();
}
}
}) {
@Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<String, String>();
// ?emailid="+edtEmail.getText().toString()+"&password="+edtPassword.getText().toString()
params.put("propertytypeid", "" + propertyTypeId);
params.put("overview_general", "" + generalDesc);
params.put("overview_addtional", "" + additionalDesc);
params.put("propertytype", "" + type);
return params;
}
};
jsonObjReq.setRetryPolicy(new DefaultRetryPolicy(20 * 1000, 1, 1.0f));
// Adding request to request queue
ApplicationData.getInstance().addToRequestQueue(jsonObjReq,
tag_json_obj);
}
}
| [
"mbpatel6245@gmail.com"
] | mbpatel6245@gmail.com |
005b4d4660e7c92490bc34d8c0cbd0c60965b874 | b1abc61284fce9d86e6094913fef7d7fc7c05f04 | /app/src/main/java/com/example/imdb/fragment/MovieList.java | 1b32aa085f7d28f9ea679e49eb270dae741bf797 | [] | no_license | Subhrajyoti123/IMDB. | 403352da3ef72db4484209c294edd02dc7aa1b14 | 3c3b0a70936d80fcc94f57a623892ea1e41eae9a | refs/heads/master | 2021-01-19T20:40:46.650413 | 2017-04-17T17:13:43 | 2017-04-17T17:13:43 | 88,530,642 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,209 | java | package com.example.imdb.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.Toast;
import com.example.imdb.R;
import com.example.imdb.adapter.ListAdapter;
import com.example.imdb.async.GetMovieInfo;
import com.example.imdb.async.GetSingleMovieInfo;
import com.example.imdb.db.MovieDataBase;
import com.example.imdb.model.Constants;
import com.example.imdb.model.MovieInfo;
import com.example.imdb.views.DetailsActivity;
import java.util.ArrayList;
import java.util.List;
public class MovieList extends ListFragment {
public String URL;
private ListView listview;
private List<MovieInfo> movieList;
public ListAdapter adapter;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
setHasOptionsMenu(true);
return inflater.inflate(R.layout.movie_list, container, false);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
listview = getListView();
movieList = new ArrayList<>();
SetList(Constants.MOVIE_NOW_PLAYING);
getActivity().setTitle(Constants.NOW_PLAYING);
adapter = new ListAdapter(getActivity(), R.layout.list_item, movieList);
}
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
MovieInfo movieInfo = movieList.get(position);
adapter.imageLoader.clearCache();
showDetails(movieInfo.getId());
}
void showDetails(String id) {
Intent intent = new Intent();
intent.setClass(getActivity(), DetailsActivity.class);
intent.putExtra("MovieID", id);
startActivity(intent);
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
inflater.inflate(R.menu.menu_main, menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
switch(id) {
case R.id.watchlist:
WatchList();
return true;
case R.id.favorites:
Favorites();
return true;
case R.id.refresh:
String barTitle = getActivity().getTitle().toString();
switch(barTitle) {
case Constants.MOST_POPULAR:
SetList(Constants.MOVIE_POPULAR);
case Constants.UPCOMING:
SetList(Constants.MOVIE_UPCOMING);
case Constants.NOW_PLAYING:
SetList(Constants.MOVIE_NOW_PLAYING);
case Constants.TOP_RATED:
SetList(Constants.MOVIE_TOP_RATED);
case Constants.LATEST:
SetListSingleMovie(Constants.MOVIE_LATEST);
/*case Constants.WATCHLIST:
WatchList();
case Constants.FAVORITES:
Favorites();*/
}
return true;
case R.id.most_popular:
SetList(Constants.MOVIE_POPULAR);
getActivity().setTitle(Constants.MOST_POPULAR);
return true;
case R.id.upcoming_movies:
SetList(Constants.MOVIE_UPCOMING);
getActivity().setTitle(Constants.UPCOMING);
return true;
case R.id.latest_movies:
SetListSingleMovie(Constants.MOVIE_LATEST);
getActivity().setTitle(Constants.LATEST);
return true;
case R.id.now_playing:
SetList(Constants.MOVIE_NOW_PLAYING);
getActivity().setTitle(Constants.NOW_PLAYING);
return true;
case R.id.top_rated:
SetList(Constants.MOVIE_TOP_RATED);
getActivity().setTitle(Constants.TOP_RATED);
return true;
}
return super.onOptionsItemSelected(item);
}
private void SetList(String context_path) {
URL = Constants.BASE_URL + Constants.API_VERSION + "/" + context_path + Constants.API_KEY;
movieList.clear();
new GetMovieInfo(getActivity(), movieList, listview).execute(URL);
}
private void SetListSingleMovie(String context_path) {
URL = Constants.BASE_URL + Constants.API_VERSION + "/" + context_path + Constants.API_KEY;
movieList.clear();
new GetSingleMovieInfo(getActivity(), movieList, listview).execute(URL);
}
private void Favorites() {
movieList.clear();
MovieDataBase db = new MovieDataBase(getActivity());
movieList = db.getFavorites();
if (movieList.isEmpty()) {
Toast.makeText(getActivity(), "Favorites list is empty", Toast.LENGTH_SHORT).show();
} else {
getActivity().setTitle(Constants.FAVORITES);
adapter = new ListAdapter(getActivity(), R.layout.list_item, movieList);
listview.setAdapter(adapter);
}
}
private void WatchList() {
movieList.clear();
MovieDataBase db = new MovieDataBase(getActivity());
movieList = db.getWatchList();
if (movieList.isEmpty()) {
Toast.makeText(getActivity(), "Watchlist is empty", Toast.LENGTH_SHORT).show();
} else {
getActivity().setTitle(Constants.WATCHLIST);
adapter = new ListAdapter(getActivity(), R.layout.list_item, movieList);
listview.setAdapter(adapter);
}
}
}
| [
"subhra.brahma9@gmail.com"
] | subhra.brahma9@gmail.com |
84a464ba40e3119369eff2b1501370736d110a75 | 27cda5e6fb5da7ae2dea91450ca1082bcaa55424 | /Source/Java/VistaImagingDataSourceProvider/main/src/java/gov/va/med/imaging/vistaimagingdatasource/VistaImagingDicomQueryFactory.java | bee71141953dda1a0af9f2303343ecb47b98d898 | [
"Apache-2.0"
] | permissive | VHAINNOVATIONS/Telepathology | 85552f179d58624e658b0b266ce83e905480acf2 | 989c06ccc602b0282c58c4af3455c5e0a33c8593 | refs/heads/master | 2021-01-01T19:15:40.693105 | 2015-11-16T22:39:23 | 2015-11-16T22:39:23 | 32,991,526 | 3 | 9 | null | null | null | null | UTF-8 | Java | false | false | 4,593 | java | package gov.va.med.imaging.vistaimagingdatasource;
import gov.va.med.imaging.core.interfaces.exceptions.MethodException;
import gov.va.med.imaging.url.vista.VistaQuery;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import org.apache.log4j.Logger;
public class VistaImagingDicomQueryFactory
{
// MAG rpc calls
public static final String CFIND_QUERY = "MAG CFIND QUERY";
//Context RPCs
public static final String DICOM_GATEWAY_FULL_CONTEXT = "MAG DICOM GATEWAY FULL";
public final static String DICOM_QR_CONTEXT = "MAG DICOM VISA"; // "MAG DICOM QUERY RETRIEVE";
public final static String MAG_WINDOWS_CONTEXT = "MAG WINDOWS";
//RPCs
public static final String CHECK_AETITLE = "MAG DICOM CHECK AE TITLE";
public static final String GET_VISTA_AETITLE = "MAG DICOM VISTA AE TITLE";
public static final String GET_GATEWAY_INFO = "MAG DICOM GET GATEWAY INFO";
public static final String STUDY_UID_QUERY = "MAG STUDY UID QUERY";
public static final String GET_CURRENT_IMAGE_INFO = "MAG IMAGE CURRENT INFO";
private final static String RPC_DGW_INSTRUMENT_LIST = "MAGV DGW INSTRUMENT LIST";
private final static String RPC_DGW_MODALITY_LIST = "MAGV DGW MODALITY LIST";
private final static String RPC_GET_SRC_AE_SEC_MX = "MAGV GET SRC AE SEC MX";
private final static String RPC_MAGV_GET_DGW_EMAIL_INFO = "MAGV GET DGW CONFIG"; // "MAGV GET EMAIL INFO";
private final static String RPC_DGW_UID_ACTION_LIST = "MAGV DGW ACTION UID LIST";
private final static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS"); // for DICOM UID generation only
private static Logger getLogger()
{
return Logger.getLogger(VistaImagingDicomQueryFactory.class);
}
/**
* Initiates the background task on VistA to retrieve the results of the query
*
* @param patientICN
* @return
* @throws MethodException
*/
@Deprecated
public static VistaQuery createInitiateCFindTaskVistaQuery(HashMap<String, String> tags, String result, String offset, String maxReturn)
{
VistaQuery vm = new VistaQuery(CFIND_QUERY);
vm.addParameter(VistaQuery.LIST, tags);
vm.addParameter(VistaQuery.LITERAL, result);
vm.addParameter(VistaQuery.LITERAL, offset);
vm.addParameter(VistaQuery.LITERAL, maxReturn);
return vm;
}
/**
* Checks to see if the background VistA task has completed, and returns query results if possible
*
* @param tags
* @param result
* @param offset
* @param maxReturn
* @return
*/
@Deprecated
public static VistaQuery createRetrieveCFindResultsVistaQuery(HashMap<String, String> tags, String result, String offset, String maxReturn)
{
VistaQuery vm = new VistaQuery(CFIND_QUERY);
vm.addParameter(VistaQuery.LITERAL, tags);
vm.addParameter(VistaQuery.LITERAL, result);
vm.addParameter(VistaQuery.LITERAL, offset);
vm.addParameter(VistaQuery.LITERAL, maxReturn);
return vm;
}
/**
* Cleans up the temporary storage for the results on the VistA server
*
* @param tags
* @param result
* @param maxReturn
* @return
*/
@Deprecated
public static VistaQuery createCleanUpCFindResultsVistaQuery(HashMap<String, String> tags, String result, String maxReturn)
{
VistaQuery vm = new VistaQuery(CFIND_QUERY);
vm.addParameter(VistaQuery.LITERAL, tags);
vm.addParameter(VistaQuery.LITERAL, result);
vm.addParameter(VistaQuery.LITERAL, "-1");
vm.addParameter(VistaQuery.LITERAL, maxReturn);
return vm;
}
public static VistaQuery createGetDgwInstrumentListQuery(String hostName)
{
VistaQuery vm = new VistaQuery(RPC_DGW_INSTRUMENT_LIST);
vm.addParameter(VistaQuery.LITERAL, hostName);
return vm;
}
public static VistaQuery createGetDgwModalityListQuery(String hostName)
{
VistaQuery vm = new VistaQuery(RPC_DGW_MODALITY_LIST);
vm.addParameter(VistaQuery.LITERAL, hostName);
return vm;
}
public static VistaQuery createGetSourceAESecurityMatrix()
{
VistaQuery vm = new VistaQuery(RPC_GET_SRC_AE_SEC_MX);
return vm;
}
public static VistaQuery createGetDGWEmailInfo(String hostName)
{
VistaQuery vm = new VistaQuery(RPC_MAGV_GET_DGW_EMAIL_INFO);
vm.addParameter(VistaQuery.LITERAL, hostName);
return vm;
}
public static VistaQuery createGetDgwUIDActionTableQuery(String type, String subType, String action)
{
VistaQuery vm = new VistaQuery(RPC_DGW_UID_ACTION_LIST);
vm.addParameter(VistaQuery.LITERAL, type); // MAGTYPE
vm.addParameter(VistaQuery.LITERAL, subType); // MAGSUBT
vm.addParameter(VistaQuery.LITERAL, action); // MAGACT
return vm;
}
}
| [
"ctitton@vitelnet.com"
] | ctitton@vitelnet.com |
700a2622eb3483b7b2e0474bebd7a14679310694 | 6b80f0ac87a430dc9debdd62f6ad71d009eff54c | /SugarCRM/src/main/java/com/sugarcrm/pages/SupportPage.java | 7253f4377dc7703f14f038dc23367c6d39ea6f96 | [] | no_license | rahulmandve/SugarCRMTest | 721488e7753b38583def8f2639982b699a42da39 | 333dcae4e3a96923bae608c9d0ec87ad2adbe38f | refs/heads/master | 2020-03-22T19:57:13.716297 | 2018-09-10T10:04:03 | 2018-09-10T10:04:03 | 140,563,348 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 64 | java | package com.sugarcrm.pages;
public class SupportPage {
}
| [
"rahul.mandwe259@gmail.com"
] | rahul.mandwe259@gmail.com |
629277cb3c945617281858b63a2f776b54a4ed52 | 575c19e81594666f51cceb55cb1ab094b218f66b | /octopusconsortium/src/main/java/OctopusConsortium/Models/RCSGB/RoleClassEmployeeX.java | afef55ad9bf01b9aeb7642e1350011b9b22b021c | [
"Apache-2.0"
] | permissive | uk-gov-mirror/111online.ITK-MessagingEngine | 62b702653ea716786e2684e3d368898533e77534 | 011e8cbe0bcb982eedc2204318d94e2bb5d4adb2 | refs/heads/master | 2023-01-22T17:47:54.631879 | 2020-12-01T14:18:05 | 2020-12-01T14:18:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,043 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-257
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.10.24 at 11:01:41 AM BST
//
package OctopusConsortium.Models.RCSGB;
import javax.xml.bind.annotation.XmlEnum;
/**
* <p>Java class for RoleClassEmployee_X.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="RoleClassEmployee_X">
* <restriction base="{urn:hl7-org:v3}cs">
* <enumeration value="EMP"/>
* <enumeration value="MIL"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlEnum
public enum RoleClassEmployeeX {
EMP,
MIL;
public String value() {
return name();
}
public static RoleClassEmployeeX fromValue(String v) {
return valueOf(v);
}
}
| [
"tom.axworthy@nhs.net"
] | tom.axworthy@nhs.net |
168cc172fe1e316ee01989b332ec1a49975d407e | 17f0e5c111f79c060850ea3708d1ca2ba8b5b52a | /collect_app/src/test/java/org/enumero/collect/android/preferences/FormMetadataMigratorTest.java | 3a42c5c147246020b479bdf581cf804614b718ed | [
"Apache-2.0"
] | permissive | atappz/collect | 6ad432c13723012bd56cc511f7df4858d19c24ae | b9c4325b80c0d493fc9bb51737a0a89482f787cf | refs/heads/master | 2021-01-01T18:44:30.004249 | 2017-07-31T12:58:51 | 2017-07-31T12:58:51 | 98,419,500 | 0 | 0 | null | 2017-07-26T12:19:06 | 2017-07-26T12:19:06 | null | UTF-8 | Java | false | false | 5,134 | java | package org.enumero.collect.android.preferences;
import android.annotation.SuppressLint;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.enumero.collect.android.BuildConfig;
import org.enumero.collect.android.application.Collect;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.enumero.collect.android.preferences.FormMetadataMigrator.migrate;
import static org.enumero.collect.android.preferences.FormMetadataMigrator.sourceTargetValuePairs;
import static org.enumero.collect.android.preferences.PreferenceKeys.KEY_METADATA_EMAIL;
import static org.enumero.collect.android.preferences.PreferenceKeys.KEY_METADATA_MIGRATED;
import static org.enumero.collect.android.preferences.PreferenceKeys.KEY_METADATA_PHONENUMBER;
import static org.enumero.collect.android.preferences.PreferenceKeys.KEY_METADATA_USERNAME;
import static org.enumero.collect.android.preferences.PreferenceKeys.KEY_SELECTED_GOOGLE_ACCOUNT;
import static org.enumero.collect.android.preferences.PreferenceKeys.KEY_USERNAME;
/** Tests the FormMetadataFragment */
@Config(constants = BuildConfig.class)
@RunWith(RobolectricTestRunner.class)
public class FormMetadataMigratorTest {
private SharedPreferences sharedPreferences;
private final PrintStream printStream = System.out;
/** The keys of preferences affected by the migration */
private final List<String> affectedKeys = Arrays.asList(
KEY_METADATA_MIGRATED,
KEY_METADATA_USERNAME,
KEY_METADATA_PHONENUMBER,
KEY_METADATA_EMAIL,
KEY_USERNAME,
KEY_SELECTED_GOOGLE_ACCOUNT);
/** The inputs to the migration */
private final String[][] sourceKeyValuePairs = new String[][] {
{KEY_USERNAME, "a user"},
{KEY_SELECTED_GOOGLE_ACCOUNT, "a Google email address"}
};
/** Changes to make to the metadata after the migration */
private final String[][] modifiedMetadataValuePairs = new String[][] {
{KEY_METADATA_USERNAME, "a user--changed"},
{KEY_METADATA_PHONENUMBER, "a phone number--changed"},
{KEY_METADATA_EMAIL, "an email--changed"},
};
@Before
public void setUp() throws Exception {
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(Collect.getInstance());
}
@Test
public void shouldMigrateDataCorrectly() {
setPreferencesToPreMigrationValues();
displayAffectedPreferences("Before calling migrate");
migrate(sharedPreferences);
displayAffectedPreferences("After calling migrate");
checkPostMigrationValues();
setPreferencesToValues(modifiedMetadataValuePairs);
displayAffectedPreferences("After changing metadata");
migrate(sharedPreferences);
displayAffectedPreferences("After calling migrate again");
ensureSecondMigrationCallPreservesMetadata();
}
private void displayAffectedPreferences(String message) {
printStream.println("\n" + message);
SortedMap<String, ?> allPrefs = new TreeMap<>(sharedPreferences.getAll());
for (Map.Entry<String, ?> es : allPrefs.entrySet()) {
if (affectedKeys.contains(es.getKey())) {
printStream.format("%-25s %s\n", es.getKey(), es.getValue());
}
}
}
@SuppressLint("ApplySharedPref")
private void setPreferencesToPreMigrationValues() {
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean(KEY_METADATA_MIGRATED, false);
editor.commit();
setPreferencesToValues(sourceKeyValuePairs);
}
@SuppressLint("ApplySharedPref")
private void setPreferencesToValues(String[][] valuePairs) {
SharedPreferences.Editor editor = sharedPreferences.edit();
for (String[] pair : valuePairs) {
editor.putString(pair[0], pair[1]);
}
editor.commit();
}
private void checkPostMigrationValues() {
assertTrue(sharedPreferences.getBoolean(KEY_METADATA_MIGRATED, false));
assertPrefsMatchValues(sourceKeyValuePairs);
for (String[] pair : sourceTargetValuePairs) {
assertEquals(sharedPreferences.getString(pair[0], ""),
sharedPreferences.getString(pair[1], ""));
}
}
private void ensureSecondMigrationCallPreservesMetadata() {
assertPrefsMatchValues(modifiedMetadataValuePairs);
}
private void assertPrefsMatchValues(String[][] valuePairs) {
for (String[] pair : valuePairs) {
String prefValue = sharedPreferences.getString(pair[0], "");
assertEquals(prefValue, pair[1]);
}
}
}
| [
"aneesh"
] | aneesh |
80d64cb89bdb72e10517d700b5b5da7d0935dfe6 | e7027cad62867a64873b3d5ecd56a72be3177624 | /src/datamanagement/Main.java | e92414fddf37f1f55e25305bf0988a8e046d11c6 | [] | no_license | shal4skull/fantastic4 | 2705051de9e177f7b72743d8edf9f22a88fe722f | 1aa442cb81cbfccde261bb2d9c21b13a5a91a3b8 | refs/heads/master | 2020-04-06T07:03:04.474381 | 2016-09-20T05:47:19 | 2016-09-20T05:47:19 | 64,192,215 | 0 | 0 | null | 2016-09-20T05:47:19 | 2016-07-26T05:20:47 | Java | UTF-8 | Java | false | false | 347 | java | /*
* Author: Tsoi Wing Kui
* Date: 26/8/2016
* Version: 1.1
* Moderator: Khue Dinh
* Reader: Jayatunga siriwardana
* Inspector: Shaluka Heshan samarakoon Epitagedara
*/
package datamanagement;
public class Main {
public static void main(String[] p){
//Executes the task in cgCTL file.
new cgCTL().execute();
}
} | [
"noreply@github.com"
] | noreply@github.com |
08ce8c1b777d1b080a968bc31c3d63d5f422f074 | cab9e2201389e6577f8c421d4f044cf6203761f1 | /sushe_class/src/cn/tw/dao/impl/CollegeDaoImpl.java | e86cb58938e46f92832acd601f5411dd0b32e973 | [] | no_license | Chenjinying1998/sushe | be37549ae21fa725dd572111cbff4e5f8ef70188 | 557e38a73e82138523f61ad3fcfe85a78e29d7ca | refs/heads/master | 2023-02-05T21:14:22.865153 | 2020-12-28T12:09:15 | 2020-12-28T12:09:15 | 315,566,606 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 477 | java | package cn.tw.dao.impl;
import org.springframework.stereotype.Repository;
import cn.tw.dao.CollegeDao;
import cn.tw.domain.College;
import cn.tw.pagination.Page;
@Repository
public class CollegeDaoImpl extends BaseDaoImpl<College> implements CollegeDao {
public CollegeDaoImpl() {
super.setNs("cn.tw.mapper.CollegeMapper");
}
@Override
public String findResultSize(Page page) {
return super.getSqlSession().selectOne(super.getNs() + ".findResultSize",page);
}
}
| [
"442249603@qq.com"
] | 442249603@qq.com |
5190fa81a34cfbf865887bdcc6c0bda9bf5fb2f6 | 3ab7293f5cd035db8365278fde33520fd49b3f81 | /socialize-sdk-android-3.1.6/lib/android-ioc/src/com/socialize/android/ioc/Argument.java | 9079d9e705b2cf717e00d4665d2b0715f0d7d7bc | [] | no_license | SydneyGroshong/FU-Android-App | 1d520ffef4f9ef9bea27fecd97bfaa12835b6ec8 | 8b24e54ec60abb452f1ed97b107cb110477044e6 | refs/heads/master | 2021-01-10T15:05:24.556044 | 2015-12-04T21:23:22 | 2015-12-04T21:23:22 | 43,385,662 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,621 | java | /*
* Copyright (c) 2012 Socialize Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.socialize.android.ioc;
import java.util.LinkedList;
import java.util.List;
/**
*
* @author Jason Polites
*
*/
public final class Argument {
public static enum RefType {
UNDEFINED,
NULL,
BEAN,
CONTEXT,
ACTIVITY,
SHORT,
INTEGER,
LONG,
STRING,
CHAR,
BYTE,
FLOAT,
DOUBLE,
BOOLEAN,
LIST,
MAP,
MAPENTRY,
SET};
public static enum CollectionType {
LINKEDLIST,
ARRAYLIST,
VECTOR,
STACK,
HASHMAP,
TREEMAP,
HASHSET,
TREESET
}
private String key;
private String value;
private RefType type = RefType.UNDEFINED;
private CollectionType collectionType;
private List<Argument> children;
public Argument() {
super();
}
public Argument(String key,String value,RefType type) {
super();
this.key = key;
this.value = value;
this.type = type;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public RefType getType() {
return type;
}
public void setType(RefType type) {
this.type = type;
}
public CollectionType getCollectionType() {
return collectionType;
}
public void setCollectionType(CollectionType collectionType) {
this.collectionType = collectionType;
}
public List<Argument> getChildren() {
return children;
}
public synchronized void addChild(Argument arg) {
if(children == null) children = new LinkedList<Argument>();
children.add(arg);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((key == null) ? 0 : key.hashCode());
result = prime * result + ((type == null) ? 0 : type.hashCode());
result = prime * result + ((value == null) ? 0 : value.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Argument other = (Argument) obj;
if (key == null) {
if (other.key != null)
return false;
} else if (!key.equals(other.key))
return false;
if (type != other.type)
return false;
if (value == null) {
if (other.value != null)
return false;
} else if (!value.equals(other.value))
return false;
return true;
}
}
| [
"groshongs1@nku.edu"
] | groshongs1@nku.edu |
9919a0b2f2ee34099a0a8c5d3f50bacfdf587536 | 8b6b025408deed1d067ff8bd4ef3c536f9c79543 | /config-datatypes-io/src/main/java/gov/nist/toolkit/configDatatypesIo/PatientErrorMapIO.java | f66bc4d8a2de796ef6b00ed1f79907ba576fc9ad | [] | no_license | usnistgov/iheos-toolkit2 | 96847a78a05ff4e86fb9ed78ab67db9851170f9d | 61b612a7378e1df32f8685ac13f1a14b1bf69002 | refs/heads/master | 2023-08-17T07:16:34.206995 | 2023-06-21T17:02:37 | 2023-06-21T17:02:37 | 61,730,404 | 48 | 29 | null | 2023-07-13T23:54:57 | 2016-06-22T15:32:13 | Java | UTF-8 | Java | false | false | 638 | java | package gov.nist.toolkit.configDatatypesIo;
import com.fasterxml.jackson.databind.ObjectMapper;
import gov.nist.toolkit.configDatatypes.client.PatientErrorMap;
import java.io.IOException;
/**
*
*/
public class PatientErrorMapIO {
static private ObjectMapper mapper;
static {
mapper = new ObjectMapper();
}
public static String marshal(PatientErrorMap patientErrorMap) throws IOException {
return mapper.writeValueAsString(patientErrorMap);
}
public static PatientErrorMap unmarshal(String stream) throws IOException {
return mapper.readValue(stream, PatientErrorMap.class);
}
}
| [
"devnull@localhost"
] | devnull@localhost |
e7faa5c090ab2cf095b2e4ed6724c21454d3be0c | 2e3ffba27c65ea0083e3d2ae57d5c3512315b414 | /Algorithms/Tree.java | 98e712a30413f7823a5d1af388cb2ed40b320523 | [] | no_license | WildCLown/Algorithms | ef63f86ed790188e4d4159bedfaf83de20bc3c04 | cc1fd41433ba7f881fc8bbb362c3513f7edbfd97 | refs/heads/master | 2021-09-09T04:50:58.246166 | 2021-09-06T16:43:44 | 2021-09-06T16:43:44 | 132,055,229 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 1,789 | java | import java.util.Scanner;
public class Tree {
public static void main(String[] args) {
Scanner leia = new Scanner(System.in);
PauBrasil pauBrasil = new PauBrasil();
int aux = 0;
while (leia.hasNext()) {
int preOrder = leia.nextInt();
pauBrasil.Insert(preOrder);
aux++;
}
pauBrasil.printPosOrder();
}
}
class PauBrasil {
// Uma Arvore necessita ter o filho da esquerda e o da direita, logo, podemos
// inicializar uma arvore da seguinte forma:
PauBrasil left;
PauBrasil right;
int key;
int balance;
// Uma booleana de checagem, para saber se o número de fato existe.
boolean check;
public PauBrasil() {
this.left = null;
this.right = null;
this.key = 0;
this.balance = 0;
this.check = false;
}
public void Insert(int key) { // Pelo conceito de árvores, o elemento da esquerda é menor que o elemento do
// nó, e o da direita é maior.
if (this.check) {
if (this.key > key) {
this.left.Insert(key);
}else {
this.right.Insert(key);
}
} else {
this.key = key;
this.check = true;
if (this.left == null) {
this.left = new PauBrasil();
this.right = new PauBrasil();
}
}
}
public void Pop(int key) {
if (this.check) {
if (this.left.check == false && this.right.check == false) {
} else {
System.out.println("Chave Inexistete.");
}
}
}
// PRINTS//
public void printPosOrder() { // A arvore recebe os termos, a forma pósfixa imprime o elemento da esquerda >
// Direita > Nó
if (this.left != null && this.left.check) {
this.left.printPosOrder();
}
if (this.right != null && this.right.check) {
this.right.printPosOrder();
}
System.out.println(this.key);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
4db575c383305f41e3173df09a8e5458f0a7b847 | 0cc91c363c219ffe35e5b9a2951e473caf0319da | /Java/PathingAlgorithms/src/util/QMath.java | e110423d09e389841d5f400dbe69d3cec37d6ceb | [] | no_license | StoneT2000/Practice | 09b84385430abbd575b7798b58e679a0f13ea3fa | 068e06b8d700781c8e4788e3d935358c98e9aef6 | refs/heads/master | 2020-04-26T07:16:15.640731 | 2019-07-13T11:46:36 | 2019-07-13T11:46:36 | 173,389,481 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 533 | java | package util;
public class QMath {
public int sqdist(Position p1, Position p2) {
int dx = p2.x - p1.x;
int dy = p2.y - p1.y;
return dx * dx + dy * dy;
}
public static double dist(Position p1, Position p2) {
int dx = p2.x - p1.x;
int dy = p2.y - p1.y;
return Math.sqrt(dx * dx + dy * dy);
}
public static int manhattanDist(Position p1, Position p2) {
int dx = p2.x - p1.x;
int dy = p2.y - p1.y;
return Math.abs(dx) + Math.abs(dy);
}
}
| [
"stoneztao@gmail.com"
] | stoneztao@gmail.com |
72d9e45dcfd50af35c166cfe5b6892da07f35e45 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/34/34_e19882ac24ee035d74a39a19d3535450876dd9fe/MonitoringHandlerInterceptorTest/34_e19882ac24ee035d74a39a19d3535450876dd9fe_MonitoringHandlerInterceptorTest_s.java | f65cff0398c9645aba9f176e1f9d6cfec4bbc8a7 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 6,463 | java | package de.is24.util.monitoring.spring;
import de.is24.util.monitoring.Counter;
import de.is24.util.monitoring.InApplicationMonitor;
import de.is24.util.monitoring.Timer;
import de.is24.util.monitoring.tools.DoNothingReportVisitor;
import org.junit.Before;
import org.junit.Test;
import org.springframework.mock.web.MockHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
import static de.is24.util.monitoring.spring.MonitoringHandlerInterceptor.POST_HANDLE_TIME;
import static de.is24.util.monitoring.spring.MonitoringHandlerInterceptor.START_TIME;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.number.IsCloseTo.closeTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
public class MonitoringHandlerInterceptorTest {
private static final String PREFIX = "MonitoringHandlerInterceptor.";
private static final String HANDLING = ".handling";
private static final String RENDERING = ".rendering";
private static final String COMPLETE = ".complete";
private static final String ERROR = ".error";
private static final int SLEEP_TIME = 100;
private final Map<String, Long> counterCalled = new HashMap<String, Long>();
private InApplicationMonitor monitor = InApplicationMonitor.getInstance();
private MonitoringHandlerInterceptor interceptor = new MonitoringHandlerInterceptor();
@Test
public void shouldMeasureDurations() throws Exception {
HttpServletRequest request = new MockHttpServletRequest();
Object handlerInstance = new Object();
interceptor.preHandle(request, null, handlerInstance);
Thread.sleep(SLEEP_TIME);
interceptor.postHandle(request, null, handlerInstance, null);
Thread.sleep(SLEEP_TIME);
interceptor.afterCompletion(request, null, handlerInstance, null);
final Map<String, Timer> timerMap = createTimerMap();
// measuring times on windows machines is a little tricky since the internal clock
// does not roll with every ms tick but only every 15th or 16th tick
assertTimer(timerMap, handlerInstance, HANDLING, SLEEP_TIME);
assertTimer(timerMap, handlerInstance, RENDERING, SLEEP_TIME);
assertTimer(timerMap, handlerInstance, COMPLETE, 2 * SLEEP_TIME);
}
@Test
public void shouldStripOfCGLIBEnhancerIdFromKey() {
Object handlerClass = new FeedbackController$$EnhancerByCGLIB$$700793d4();
String prefix = interceptor.getPrefix(handlerClass);
assertEquals(
"MonitoringHandlerInterceptor.de.is24.util.monitoring.spring.MonitoringHandlerInterceptorTest$FeedbackControllerEnhancerByCGLIB_IdStripped",
prefix);
}
@Test
public void shouldNotMeasureInCaseOfErrorInActionPhase() throws Exception {
HttpServletRequest request = new MockHttpServletRequest();
Object handlerInstance = new Long(1L);
interceptor.preHandle(request, null, handlerInstance);
Thread.sleep(SLEEP_TIME);
interceptor.afterCompletion(request, null, handlerInstance, null);
final Map<String, Timer> timerMap = createTimerMap();
assertNoMeasurement(timerMap, handlerInstance, HANDLING);
assertNoMeasurement(timerMap, handlerInstance, RENDERING);
assertNoMeasurement(timerMap, handlerInstance, COMPLETE);
}
@Test
public void shouldNotMeasureInCasePreHandleWasNotCalledButIncrementErrorCounter() throws Exception {
HttpServletRequest request = new MockHttpServletRequest();
Object handlerInstance = new Integer(1);
Thread.sleep(SLEEP_TIME);
interceptor.afterCompletion(request, null, handlerInstance, null);
final Map<String, Timer> timerMap = createTimerMap();
assertThat(counterCalled.get(PREFIX + handlerInstance.getClass().getName() + ERROR), is(1L));
assertNoMeasurement(timerMap, handlerInstance, HANDLING);
assertNoMeasurement(timerMap, handlerInstance, RENDERING);
assertNoMeasurement(timerMap, handlerInstance, COMPLETE);
}
@Test
public void shouldRemoveStartAndPostHandleTime() throws Exception {
HttpServletRequest request = new MockHttpServletRequest();
request.setAttribute(START_TIME, 123L);
request.setAttribute(POST_HANDLE_TIME, 123L);
interceptor.afterCompletion(request, null, new String(), null);
assertThat(request.getAttribute(START_TIME), is(nullValue()));
assertThat(request.getAttribute(POST_HANDLE_TIME), is(nullValue()));
}
@Test
public void shouldRemovePostHandleTimeWhenStartTimeIsNotSet() throws Exception {
HttpServletRequest request = new MockHttpServletRequest();
request.setAttribute(POST_HANDLE_TIME, 123L);
interceptor.afterCompletion(request, null, new Float(0.1), null);
assertThat(request.getAttribute(POST_HANDLE_TIME), is(nullValue()));
}
@Before
public void resetTimers() {
// monitor.clear();
}
private void assertNoMeasurement(Map<String, Timer> timerMap, Object handlerInstance, String name) {
String timerFullName = PREFIX + handlerInstance.getClass().getName() + name;
assertTrue(!timerMap.containsKey(timerFullName));
}
private Map<String, Timer> createTimerMap() {
final Map<String, Timer> timerMap = new HashMap<String, Timer>();
monitor.reportInto(new DoNothingReportVisitor() {
@Override
public void reportCounter(Counter counter) {
counterCalled.put(counter.getName(), counter.getCount());
}
@Override
public void reportTimer(Timer timer) {
timerMap.put(timer.getName(), timer);
}
});
return timerMap;
}
private void assertTimer(Map<String, Timer> timerMap, Object handlerInstance, String timerName, int time) {
String timerFullName = PREFIX + handlerInstance.getClass().getName() + timerName;
Timer timer = timerMap.get(timerFullName);
assertNotNull(timer);
assertEquals(1, timer.getCount());
assertThat(new Double(time), closeTo(time, 16 /* tick diff on windows machines*/));
}
public static class FeedbackController$$EnhancerByCGLIB$$700793d4 {
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
c0eaea804fd817e69d63c6d1badabcc0aeda7477 | 54e57f627ac03e9980349bfbd690981b0749396c | /Settii/src/settii/Options.java | 2ff1f1bb29ee6d7d8c024a20ce43fee0ea065f0b | [] | no_license | ApinaSalaatti/settii | 6f2e800e08a26d0dba89b46856493aacddb2b187 | 81b9d024b31b1130d69ffb3bbe4a568daa4acc36 | refs/heads/master | 2021-01-01T18:03:39.532014 | 2013-03-31T12:07:18 | 2013-03-31T12:07:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,545 | java | package settii;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import settii.eventManager.events.OptionsChangedEvent;
/**
*
* @author Merioksan Mikko
*/
public class Options {
private float soundVolume;
private float musicVolume;
public Options() {
soundVolume = 1.0f;
musicVolume = 1.0f;
}
public void createFromXML(NodeList options) {
Node n = options.item(0);
while(n != null) {
if(n.getNodeType() == Node.ELEMENT_NODE) {
if(n.getNodeName().equalsIgnoreCase("soundVolume")) {
soundVolume = Float.parseFloat(n.getFirstChild().getNodeValue());
}
else if(n.getNodeName().equalsIgnoreCase("musicVolume")) {
musicVolume = Float.parseFloat(n.getFirstChild().getNodeValue());
}
}
n = n.getNextSibling();
}
}
public boolean soundOn() {
return soundVolume >0;
}
public float soundVolume() {
return soundVolume;
}
public void setVolume(float vol) {
soundVolume = vol;
}
public void enableSound() {
soundVolume = 1.0f;
}
public void disableSound() {
soundVolume = 0.0f;
}
public float musicVolume() {
return musicVolume;
}
public void setMusicVolume(float vol) {
musicVolume = vol;
}
public void save() {
Application.get().getEventManager().queueEvent(new OptionsChangedEvent());
}
}
| [
"mmerioksa@gmail.com"
] | mmerioksa@gmail.com |
e149c545a0fe91fd77384cd27ebe598182509bc6 | 4ff1b0098b02aded39e1bb8d84e00a2583211082 | /java/src/joohoyo/leetcode/contest/C186_5394_2.java | 8143cbdb2896452f49a4411f57db5238c4a3a250 | [] | no_license | joohoyo/LeetCode | 1004f7d4ddf42e448cdca7deffff8e6735ca2a08 | 1e1a39e52514a825f1ac1ab4210d1eda21abe847 | refs/heads/master | 2021-04-19T19:44:19.868056 | 2020-07-17T07:45:26 | 2020-07-17T07:45:26 | 249,631,019 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,727 | java | package joohoyo.leetcode.contest;
// 5394. Diagonal Traverse II
// https://leetcode.com/contest/weekly-contest-186/problems/diagonal-traverse-ii/
// medium
// 12:13 ~ (min)
// Time Limit Exceeded
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.List;
public class C186_5394_2 {
@Test
public void test1() {
Solution s = new Solution();
List<List<Integer>> list = new ArrayList<>();
list.add(new ArrayList<>());
list.add(new ArrayList<>());
list.add(new ArrayList<>());
list.get(0).add(1);
list.get(0).add(2);
list.get(0).add(3);
list.get(1).add(4);
list.get(1).add(5);
list.get(1).add(6);
list.get(2).add(7);
list.get(2).add(8);
list.get(2).add(9);
Assertions.assertArrayEquals(new int[]{1, 4, 2, 7, 5, 3, 8, 6, 9}, s.findDiagonalOrder(list));
}
class Solution {
public int[] findDiagonalOrder(List<List<Integer>> nums) {
int n = nums.size();
int m = 0;
int totalCount = 0;
for (List<Integer> numList : nums) {
m = Math.max(m, numList.size());
totalCount += numList.size();
}
int[] answer = new int[totalCount];
int count = 1;
for (int i = 0; i < totalCount; ) {
for (int j = count - 1; j >= 0; j--) {
if (nums.get(j).size() > 0) {
answer[i++] = nums.get(j).remove(0);
}
}
count = Math.min(count + 1, n);
}
return answer;
}
}
}
| [
"joohoyo@gmail.com"
] | joohoyo@gmail.com |
b5a2368deaaa3e690be9ec18ced69b8cdacc4d41 | b344bad612f39264a0546def1f27f65ee7337d47 | /mug/src/test/java/com/google/mu/util/stream/BiCollectorsTest.java | 16d74bd74e8849ce50326413d26c6a6b6c99793c | [
"Apache-2.0"
] | permissive | NishantSharmaAgra/mug | ffaae82ffaca67063c5f23ff5b47188860fb90dc | 3fde04f082fdf213f878fcda8702a7698519696a | refs/heads/master | 2023-03-21T03:09:13.888522 | 2021-02-15T17:44:30 | 2021-02-15T17:44:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,098 | java | /*****************************************************************************
* ------------------------------------------------------------------------- *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
*****************************************************************************/
package com.google.mu.util.stream;
import static com.google.common.truth.Truth.assertThat;
import static com.google.mu.util.stream.BiCollectors.groupingBy;
import static com.google.mu.util.stream.BiCollectors.toMap;
import static com.google.mu.util.stream.BiStream.biStream;
import static com.google.mu.util.stream.BiStreamTest.assertKeyValues;
import static java.util.Collections.nCopies;
import static java.util.stream.Collectors.summingInt;
import static java.util.stream.Collectors.toList;
import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSetMultimap;
import com.google.mu.util.BiOptional;
@RunWith(JUnit4.class)
public class BiCollectorsTest {
@Test public void testToMap_valuesCollected() {
ImmutableList<Town> towns =
ImmutableList.of(new Town("WA", 100), new Town("WA", 50), new Town("IL", 200));
assertThat(
BiStream.from(towns, Town::getState, town -> town)
.collect(toMap(summingInt(Town::getPopulation))))
.containsExactly("WA", 150, "IL", 200)
.inOrder();
}
@Test public void testToMap_keyEncounterOrderRetainedThroughValueCollector() {
ImmutableList<Town> towns =
ImmutableList.of(
new Town("WA", 1),
new Town("FL", 2),
new Town("WA", 3),
new Town("IL", 4),
new Town("AZ", 5),
new Town("OH", 6),
new Town("IN", 7),
new Town("CA", 8),
new Town("CA", 9));
assertThat(
BiStream.from(towns, Town::getState, town -> town)
.collect(toMap(summingInt(Town::getPopulation))))
.containsExactly("WA", 4, "FL", 2, "IL", 4, "AZ", 5, "OH", 6, "IN", 7, "CA", 17)
.inOrder();
}
@Test public void testToMap_empty() {
ImmutableList<Town> towns = ImmutableList.of();
assertThat(
BiStream.from(towns, Town::getState, town -> town)
.collect(toMap(summingInt(Town::getPopulation))))
.isEmpty();
}
@Test public void testToImmutableMap_covariance() {
Map<Object, String> map = BiStream.of(1, "one").collect(toMap());
assertThat(map).containsExactly(1, "one");
}
@Test public void testCounting() {
assertThat(BiStream.of(1, "one", 2, "two").collect(BiCollectors.counting())).isEqualTo(2L);
}
@Test public void testCountingDistinct_distinctEntries() {
assertThat(BiStream.of(1, "one", 2, "two").collect(BiCollectors.countingDistinct()))
.isEqualTo(2);
assertThat(BiStream.of(1, "one", 1, "uno").collect(BiCollectors.countingDistinct()))
.isEqualTo(2);
assertThat(BiStream.of(1, "one", 2, "one").collect(BiCollectors.countingDistinct()))
.isEqualTo(2);
}
@Test public void testCountingDistinct_duplicateEntries() {
assertThat(BiStream.of(1, "one", 1, "one").collect(BiCollectors.countingDistinct()))
.isEqualTo(1);
}
@Test public void testCountingDistinct_duplicateEntries_withNulls() {
assertThat(BiStream.of(1, null, 1, null).collect(BiCollectors.countingDistinct()))
.isEqualTo(1);
assertThat(BiStream.of(null, null, null, null).collect(BiCollectors.countingDistinct()))
.isEqualTo(1);
assertThat(BiStream.of(null, "one", null, "one").collect(BiCollectors.countingDistinct()))
.isEqualTo(1);
}
@Test public void testCountingDistinct_distinctEntries_withNulls() {
assertThat(BiStream.of(1, "one", 1, null).collect(BiCollectors.countingDistinct()))
.isEqualTo(2);
assertThat(BiStream.of(1, "one", null, "one").collect(BiCollectors.countingDistinct()))
.isEqualTo(2);
assertThat(BiStream.of(1, "one", null, null).collect(BiCollectors.countingDistinct()))
.isEqualTo(2);
}
@Test public void testSummingInt() {
assertThat(BiStream.of(1, 10, 2, 20).collect(BiCollectors.summingInt((a, b) -> a + b))).isEqualTo(33);
}
@Test public void testSummingLong() {
assertThat(BiStream.of(1L, 10, 2L, 20).collect(BiCollectors.summingLong((a, b) -> a + b))).isEqualTo(33L);
}
@Test public void testSummingDouble() {
assertThat(BiStream.of(1, 10D, 2, 20D).collect(BiCollectors.summingDouble((a, b) -> a + b))).isEqualTo(33D);
}
@Test public void testAveragingInt() {
assertThat(BiStream.of(1, 3, 2, 4).collect(BiCollectors.averagingInt((Integer a, Integer b) -> a + b)))
.isEqualTo(5D);
}
@Test public void testAveragingLong() {
assertThat(BiStream.of(1L, 3, 2L, 4).collect(BiCollectors.averagingLong((Long a, Integer b) -> a + b)))
.isEqualTo(5D);
}
@Test public void testAveragingDouble() {
assertThat(BiStream.of(1L, 3, 2L, 4).collect(BiCollectors.averagingDouble((Long a, Integer b) -> a + b)))
.isEqualTo(5D);
}
@Test public void testSummarizingInt() {
assertThat(BiStream.of(1, 10, 2, 20).collect(BiCollectors.summarizingInt((a, b) -> a + b)).getMin())
.isEqualTo(11);
}
@Test public void testSummarizingLong() {
assertThat(BiStream.of(1, 10, 2, 20).collect(BiCollectors.summarizingLong((a, b) -> a + b)).getMin())
.isEqualTo(11L);
}
@Test public void testSummarizingDouble() {
assertThat(BiStream.of(1, 10, 2, 20).collect(BiCollectors.summarizingDouble((a, b) -> a + b)).getMin())
.isEqualTo(11D);
}
@Test public void testGroupingBy_empty() {
assertKeyValues(BiStream.empty().collect(groupingBy(Object::toString, toList()))).isEmpty();
}
@Test public void testGroupingBy_singleEntry() {
assertKeyValues(BiStream.of(1, "one").collect(groupingBy(Object::toString, toList())))
.containsExactly("1", ImmutableList.of("one"));
}
@Test public void testGroupingBy_distinctEntries() {
assertKeyValues(BiStream.of(1, "one", 2, "two").collect(groupingBy(Object::toString, toList())))
.containsExactly("1", ImmutableList.of("one"), "2", ImmutableList.of("two"));
}
@Test public void testGroupingBy_multipleValuesGrouped() {
assertKeyValues(BiStream.of(1, "one", 1L, "uno").collect(groupingBy(Object::toString, toList())))
.containsExactly("1", ImmutableList.of("one", "uno"));
}
@Test public void testGroupingBy_groupedByDiff() {
assertKeyValues(
BiStream.of(1, 3, 2, 4, 11, 111)
.collect(groupingBy((a, b) -> b - a, ImmutableSetMultimap::toImmutableSetMultimap)))
.containsExactly(2, ImmutableSetMultimap.of(1, 3, 2, 4), 100, ImmutableSetMultimap.of(11, 111));
}
@Test public void testGroupingBy_withReducer_empty() {
BiStream<String, Integer> salaries = BiStream.empty();
assertKeyValues(salaries.collect(groupingBy(s -> s.charAt(0), (a, b) -> a + b))).isEmpty();
}
@Test public void testGroupingBy_withReducer_singleEntry() {
BiStream<String, Integer> salaries = BiStream.of("Joe", 100);
assertKeyValues(salaries.collect(groupingBy(s -> s.charAt(0), Integer::sum)))
.containsExactly('J', 100);
}
@Test public void testGroupingBy_withReducer_twoEntriesSameGroup() {
BiStream<String, Integer> salaries = BiStream.of("Joe", 100, "John", 200);
assertKeyValues(salaries.collect(groupingBy(s -> s.charAt(0), Integer::sum)))
.containsExactly('J', 300);
}
@Test public void testGroupingBy_withReducer_twoEntriesDifferentGroups() {
BiStream<String, Integer> salaries = BiStream.of("Joe", 100, "Tom", 200);
assertKeyValues(salaries.collect(groupingBy(s -> s.charAt(0), Integer::sum)))
.containsExactly('J', 100, 'T', 200)
.inOrder();
}
@Test public void testMapping_downstreamCollector() {
BiStream<String, Integer> salaries = BiStream.of("Joe", 100, "Tom", 200);
assertThat(salaries.collect(BiCollectors.mapping((k, v) -> k + ":" + v, toList())))
.containsExactly("Joe:100", "Tom:200")
.inOrder();
}
@Test public void testMapping_downstreamBiCollector() {
BiStream<String, Integer> salaries = BiStream.of("Joe", 100, "Tom", 200);
BiCollector<String, Integer, ImmutableMap<Integer, String>> toReverseMap =
BiCollectors.mapping((k, v) -> v, (k, v) -> k, ImmutableMap::toImmutableMap);
assertThat(salaries.collect(toReverseMap))
.containsExactly(100, "Joe", 200, "Tom")
.inOrder();
}
@Test public void testMapping_pairWise() {
BiStream<String, Integer> salaries = BiStream.of("Joe", 100, "Tom", 200);
BiCollector<String, Integer, ImmutableMap<Integer, String>> toReverseMap =
BiCollectors.mapping(
(k, v) -> BiOptional.of(v, k).orElseThrow(),
ImmutableMap::toImmutableMap);
assertThat(salaries.collect(toReverseMap))
.containsExactly(100, "Joe", 200, "Tom")
.inOrder();
}
@Test public void testFlatMapping_toStream() {
BiStream<String, Integer> salaries = BiStream.of("Joe", 1, "Tom", 2);
assertThat(salaries.collect(BiCollectors.flatMapping((k, c) -> nCopies(c, k).stream(), toList())))
.containsExactly("Joe", "Tom", "Tom")
.inOrder();
}
@Test public void testFlatMapping_toBiStream() {
BiStream<String, Integer> salaries = BiStream.of("Joe", 1, "Tom", 2);
ImmutableListMultimap<String, Integer> result = salaries.collect(
BiCollectors.flatMapping(
(String k, Integer c) -> biStream(nCopies(c, k)).mapValues(u -> c),
ImmutableListMultimap::toImmutableListMultimap));
assertThat(result)
.containsExactly("Joe", 1, "Tom", 2, "Tom", 2)
.inOrder();
}
private static final class Town {
private final String state;
private final int population;
Town(String state, int population) {
this.state = state;
this.population = population;
}
int getPopulation() {
return population;
}
String getState() {
return state;
}
}
}
| [
"yujige@gmail.com"
] | yujige@gmail.com |
bf6751bb57548fa4ca4a640d34d3efbb2138b0a8 | 89070daed997b719f1ba85f4fc7b9adf46685a35 | /CorpseSlasherAndroid/src/GUI/LoginScreen.java | 8f2f7589c39b3e1d4666a2b4f05e024cf738c4b2 | [
"BSD-3-Clause"
] | permissive | njTaljaard/Laminin_CorpseSlasher | 1bab0f435f13d327f7115b9babeba02a5dfc404e | 466773f738808a4c547b16ec1b7fd882bdc98df9 | refs/heads/master | 2021-06-07T16:26:38.365726 | 2014-10-19T23:35:24 | 2014-10-19T23:35:24 | 19,076,204 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,744 | java | package GUI;
//~--- non-JDK imports --------------------------------------------------------
import com.jme3.app.Application;
import com.jme3.app.state.AppStateManager;
import com.jme3.asset.AssetManager;
import com.jme3.audio.AudioRenderer;
import com.jme3.input.InputManager;
import com.jme3.niftygui.NiftyJmeDisplay;
import com.jme3.renderer.ViewPort;
import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.builder.LayerBuilder;
import de.lessvoid.nifty.builder.PanelBuilder;
import de.lessvoid.nifty.builder.ScreenBuilder;
import de.lessvoid.nifty.controls.button.builder.ButtonBuilder;
import de.lessvoid.nifty.controls.label.builder.LabelBuilder;
import de.lessvoid.nifty.controls.textfield.builder.TextFieldBuilder;
import de.lessvoid.nifty.screen.ScreenController;
import de.lessvoid.nifty.tools.Color;
/**
*
* @author gerhard An extension of the screen class to create a Login Screen
* where the user has to enter a Username and password, or chose which social
* media it wants to login with or create a new custom account or retrieve his
* password
*/
public class LoginScreen extends Screens {
private Nifty nifty;
public LoginScreen(AssetManager assetManager, InputManager inputManager, AudioRenderer audioRenderer,
ViewPort guiViewPort, AppStateManager appState, Application app, NiftyJmeDisplay screen) {
super(assetManager, inputManager, audioRenderer, guiViewPort, appState, app, screen);
}
/**
* Buiilds the NiftyGui
*/
public void build() {
nifty = screen.getNifty();
nifty.enableAutoScaling(800, 600);
nifty.setIgnoreKeyboardEvents(true);
guiViewPort.addProcessor(screen);
buildGui(nifty);
nifty.gotoScreen("#Login_Screen");
}
/**
*
* @param nifty the nifty object that has to be designed Helper function to
* build, adding buttons and labels
*/
private void buildGui(Nifty nifty) {
nifty.loadStyleFile("nifty-default-styles.xml");
nifty.loadControlFile("nifty-default-controls.xml");
nifty.addScreen("#Login_Screen", new ScreenBuilder("Login To Connect") {
{
controller((ScreenController) app);
layer(new LayerBuilder("#background") {
{
font("Interface/Fonts/zombie.fnt");
childLayoutCenter();
backgroundImage("Backgrounds/ZOMBIE1.jpg");
visibleToMouse(true);
}
});
layer(new LayerBuilder("#foreground") {
{
font("Interface/Fonts/zombie.fnt");
visibleToMouse(true);
childLayoutVertical();
panel(new PanelBuilder("#Main_Login_Panel") {
{
childLayoutCenter();
font("Interface/Fonts/zombie.fnt");
control(new LabelBuilder("#Username_ID", "Username :") {
{
align(Align.Left);
valign(VAlign.Top);
marginLeft("21%");
marginTop("26%");
height("15%");
width("15%");
visibleToMouse(true);
font("Interface/Fonts/zombie.fnt");
color("#ff0000");
}
});
control(new TextFieldBuilder("#Username_Input_ID", "Enter Username") {
{
alignCenter();
valign(VAlign.Top);
marginTop("26%");
height("10%");
width("25%");
visibleToMouse(true);
font("Interface/Fonts/zombie.fnt");
color("#ff0000");
interactOnClick("erase(#Username_Input_ID)");
}
});
control(new LabelBuilder("#Password_ID", "Password :") {
{
align(Align.Left);
valign(VAlign.Top);
marginLeft("21%");
marginTop("44%");
height("15%");
width("15%");
visibleToMouse(true);
font("Interface/Fonts/zombie.fnt");
color("#ff0000");
}
});
control(new TextFieldBuilder("#Password_Input_ID", "Enter Password") {
{
alignCenter();
valign(VAlign.Top);
marginTop("44%");
height("10%");
width("25%");
visibleToMouse(true);
font("Interface/Fonts/zombie.fnt");
color("#ff0000");
passwordChar('*');
interactOnClick("erase(#Password_Input_ID)");
}
});
control(new ButtonBuilder("#Connect_ID", "Login") {
{
alignCenter();
valign(VAlign.Bottom);
marginBottom("11%");
height("10%");
width("25%");
interactOnClick("loadingScreen()");
font("Interface/Fonts/zombie.fnt");
}
});
control(new LabelBuilder("#New_Account_ID", "Create New Account") {
{
marginLeft("-25%");
marginBottom("-50%");
height("10%");
width("25%");
interactOnClick("newAccount()");
font("Interface/Fonts/zombie.fnt");
color("#ff0000");
}
});
control(new LabelBuilder("#Retrieve_Password_ID", "Retrieve Password") {
{
marginLeft("25%");
marginBottom("-50%");
height("10%");
width("25%");
interactOnClick("retrievePassword()");
font("Interface/Fonts/zombie.fnt");
color("#ff0000");
}
});
}
;
});
panel(new PanelBuilder("#Button_Panel") {
{
childLayoutHorizontal();
align(Align.Left);
valign(VAlign.Top);
marginLeft("34%");
marginTop("-33%");
height("10%");
width("15%");
paddingLeft("7px");
paddingRight("7px");
paddingTop("4px");
paddingBottom("4px");
visibleToMouse(true);
font("Interface/Fonts/zombie.fnt");
panel(new PanelBuilder() {
{
childLayoutHorizontal();
backgroundImage("Icons/fb.jpg");
width("70px");
interactOnClick("socialLogin(1)");
font("Interface/Fonts/zombie.fnt");
color("#ff0000");
}
});
panel(new PanelBuilder() {
{
childLayoutHorizontal();
marginLeft("94%");
backgroundImage("Icons/google+.jpg");
width("70px");
interactOnClick("socialLogin(2)");
font("Interface/Fonts/zombie.fnt");
color("#ff0000");
}
});
}
});
control(new ButtonBuilder("", "Quit Game") {
{
width("100px");
height("50px");
interactOnClick("quitGame()");
alignCenter();
marginTop("23%");
}
});
}
});
}
}.build(nifty));
}
}
//~ Formatted by Jindent --- http://www.jindent.com
| [
"gsmit16@gmail.com"
] | gsmit16@gmail.com |
75b004006974eac4b2af37cc2b011b5e1f8b0dd5 | 1dd94ce1a8a3d268dd6bab01351c8cbb6b10c00f | /src/SCJPprograms/Access_Privatevariables.java | 11123d5e216ad3c303fd04bdebc723a3a6cf56f3 | [] | no_license | Snehagit6/Core-_Java_advanced_java | 4ad5eccb1c9dccbf35d4eb55afd43b93f0177f8d | cd32650e00db8ceb8db475fe14b9170494136b62 | refs/heads/master | 2020-03-30T06:48:17.164897 | 2018-11-28T05:27:27 | 2018-11-28T05:27:27 | 150,889,976 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 502 | java | package SCJPprograms;
public class Access_Privatevariables {
private int y=9;
public static void main(String[] args) {
// TODO Auto-generated method stub
Access_Privatevariables p=new Access_Privatevariables();
System.out.println(p.getY());//Private variable without given a public access can be accessed in main method
}
/*Getter and setter has to be included to access a private variable in a different class*/
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
}
| [
"snehaclass12@gmail.com"
] | snehaclass12@gmail.com |
697d15fb2cd72f77454460172558a557b0513521 | 7c5fd32e93edcd032a33bb1cb4544f53d9095d87 | /fees/src/main/java/com/emt/vo/Series.java | 71ba0e46eb8145172cebaf12d2d989e7d4fdbd9d | [] | no_license | traxexee/esdemo | 00ca3fbdf8039e0bddf41ffa2aa3e1c3cad08483 | 25f412280fe15b96ee412c20996fa93875184a27 | refs/heads/master | 2023-02-02T14:17:54.482276 | 2020-12-15T09:54:14 | 2020-12-15T09:54:14 | 321,617,504 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 360 | java | package com.emt.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* @Author:刘震
* @Description:
* @Date: Created in14:17 2019/4/11.
* @Modified By:
*/
@Data
public class Series {
private String name;
private String type;
private String stack;
private String cursor;
private List<BigDecimal> data;
}
| [
"zhen.liu@i-emt.com"
] | zhen.liu@i-emt.com |
d95400abe29f2719e0e3a8f48ff26ec41132e50f | 32020803dbd34cfb6b69be9db4ae3521ebc8c046 | /projects/OG-MasterDB/tests/unit/com/opengamma/masterdb/position/ModifyPositionDbPositionMasterWorkerRemovePositionTest.java | 5a5085a65205b769fea4788163043d417edca7e8 | [
"Apache-2.0"
] | permissive | gsteri1/OG-Platform | 2cf873df438e0e202da8381e5db2a3186f15fdc5 | e682c31e69cadde06dd3776544913dde17fe41ba | refs/heads/master | 2020-12-25T11:42:03.683586 | 2011-10-14T16:18:00 | 2011-10-14T16:18:00 | 2,582,195 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,888 | java | /**
* Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.masterdb.position;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertNotNull;
import java.math.BigDecimal;
import javax.time.Instant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.Factory;
import org.testng.annotations.Test;
import com.opengamma.DataNotFoundException;
import com.opengamma.id.ExternalId;
import com.opengamma.id.ExternalIdBundle;
import com.opengamma.id.UniqueId;
import com.opengamma.master.position.ManageablePosition;
import com.opengamma.master.position.PositionDocument;
import com.opengamma.util.test.DBTest;
/**
* Tests ModifyPositionDbPositionMasterWorker.
*/
public class ModifyPositionDbPositionMasterWorkerRemovePositionTest extends AbstractDbPositionMasterWorkerTest {
// superclass sets up dummy database
private static final Logger s_logger = LoggerFactory.getLogger(ModifyPositionDbPositionMasterWorkerRemovePositionTest.class);
@Factory(dataProvider = "databases", dataProviderClass = DBTest.class)
public ModifyPositionDbPositionMasterWorkerRemovePositionTest(String databaseType, String databaseVersion) {
super(databaseType, databaseVersion);
s_logger.info("running testcases for {}", databaseType);
}
//-------------------------------------------------------------------------
@Test(expectedExceptions = DataNotFoundException.class)
public void test_removePosition_versioned_notFound() {
UniqueId uniqueId = UniqueId.of("DbPos", "0", "0");
_posMaster.remove(uniqueId);
}
@Test
public void test_removePosition_removed() {
Instant now = Instant.now(_posMaster.getTimeSource());
UniqueId uniqueId = UniqueId.of("DbPos", "122", "0");
_posMaster.remove(uniqueId);
PositionDocument test = _posMaster.get(uniqueId);
assertEquals(uniqueId, test.getUniqueId());
assertEquals(_version1Instant, test.getVersionFromInstant());
assertEquals(now, test.getVersionToInstant());
assertEquals(_version1Instant, test.getCorrectionFromInstant());
assertEquals(null, test.getCorrectionToInstant());
ManageablePosition position = test.getPosition();
assertNotNull(position);
assertEquals(uniqueId, position.getUniqueId());
assertEquals(BigDecimal.valueOf(122.987), position.getQuantity());
ExternalIdBundle secKey = position.getSecurityLink().getExternalId();
assertEquals(1, secKey.size());
assertEquals(ExternalId.of("TICKER", "ORCL"), secKey.getExternalIds().iterator().next());
}
//-------------------------------------------------------------------------
@Test
public void test_toString() {
assertEquals(_posMaster.getClass().getSimpleName() + "[DbPos]", _posMaster.toString());
}
}
| [
"stephen@opengamma.com"
] | stephen@opengamma.com |
1e5c7bc1adfce8afb0fbc70c06a3ed9ca2872843 | 204a224ce8ddd52d8ec282043460288baa1e2c6b | /application.linux-arm64/source/game.java | 8467f33125731a99a74fef60771c23855faf03c7 | [] | no_license | PulseBeat02/Grid-World | 9489a9c680e0901c1834d2d3b3bac56c970fbcc0 | 63102a034841406696ae78e44f2cb3eb8b0815ad | refs/heads/master | 2020-05-07T21:13:20.616683 | 2019-04-11T23:59:00 | 2019-04-11T23:59:00 | 180,896,038 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,660 | java | import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import arb.soundcipher.*;
import arb.soundcipher.constants.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class game extends PApplet {
/*
Objective: Get all Gems before Dying
- You can lose health if you step into lava (Red)
- You can lose health if your thirst level is 0. You can get water to increase your thirst, however, these water cells will go away
if you drink too much! The same goes with hunger.
- Do not touch the black at all times.
- The pink are chug jugs, giving you max everything
Good Luck!
*/
int[] notes = {
60,
69,
64,
62,
64,
67,
64
};
SoundCipher sc = new SoundCipher(this); // Import Soundcipher
int frames_per_beat = 30;
int[][] world;
int ROWS, COLS;
int C_SIZE = 25; // CELL SIZE (how many pixels is a cell across/up&down)
int GRASS = 0; // constant variables - not going to change
int WATER = 1; // stand-in for actual numbers - usually all-caps
int SWAMP = 2;
int LAVA = 3;
int STONE = 4;
int GEMS = 5;
int collectedGem = 6;
int FOOD = 7;
int CHUGJUG = 8;
int ILLUMANATI = 9;
int GemsCollected = 0;
int totalGems = 0;
double health = 100;
double hunger = 100;
double thirst = 100;
double energy = 100;
boolean isDamage = false;
boolean isAlive = true;
boolean isMoving = true;
boolean isIllumanati = false;
// to store where the player is
int pr, pc;
int waterDranked = 3;
int foodEaten = 5;
int moves = 0;
PImage player, dead, gem, illumanati, good, ok, bad; // Defining PImages
// int [][] lava = new int[50][50];
public void setup() {
ROWS = height / C_SIZE;
COLS = width / C_SIZE;
initBoard();
pr = ROWS / 2;
pc = COLS / 2;
player = loadImage("https://i.ibb.co/BZYDjjz/download.jpg"); // Loading URL's
dead = loadImage("https://i.ibb.co/BP6KfdS/download.png");
gem = loadImage("https://i.ibb.co/Scfddhm/gem.png");
illumanati = loadImage("https://i.ibb.co/Ptdcz1V/illuminati.jpg");
good = loadImage("https://i.ibb.co/DCmd7x5/smileemoji.png");
ok = loadImage("https://i.ibb.co/WsLhGhG/warning.png");
bad = loadImage("https://i.ibb.co/XWyXVzy/bad.png");
}
public void keyPressed() {
if (isAlive && isMoving) {
if (keyCode == RIGHT && energy > 15) {
pc++;
energy -= 0.5f;
moves++;
} else if (keyCode == LEFT && energy > 15) {
pc--;
energy -= 0.5f;
moves++;
} else if (keyCode == UP && energy > 15) {
pr--;
energy -= 0.5f;
moves++;
} else if (keyCode == DOWN && energy > 15) {
pr++;
energy -= 0.5f;
moves++;
}
}
}
public void initBoard() {
world = new int[ROWS][COLS];
// filled with 0s
for (int r = 0; r < ROWS; r++) {
for (int c = 0; c < COLS; c++) {
float rand = random(1); // even chance b/w 0.0 and 1.0
if (rand < 0.65f) { // 0.0 - 0.8 -> 80%
world[r][c] = GRASS;
} else if (rand >= 0.65f && rand < 0.73f) {
world[r][c] = WATER;
} else if (rand >= 0.73f && rand < 0.81f) {
world[r][c] = LAVA;
} else if (rand >= 0.81f && rand < 0.86f) {
world[r][c] = SWAMP;
} else if (rand >= 0.86f && rand < 0.88f) {
world[r][c] = STONE;
} else if (rand >= 0.88f && rand < 0.98f) {
world[r][c] = FOOD;
} else if (rand >= 0.98f && rand < 0.998f) {
world[r][c] = GEMS;
totalGems++;
} else if (rand >= 0.998f && rand < 0.9998f) {
world[r][c] = CHUGJUG;
} else {
world[r][c] = ILLUMANATI;
}
}
world[pr][pc] = GEMS;
}
}
public void draw() {
preventArrayException();
String GemsCollectedResult = " Gems Collected: " + GemsCollected + "/" + totalGems;
float healthString = ((int)(health * 100)) / 100.0f;
drawWorld();
drawPlayer();
if (key == ' ') {
textSize(90);
text("Press Any Key to Begin", 400, 750);
GemsCollected = 0;
totalGems = 0;
health = 100;
hunger = 100;
energy = 100;
thirst = 100;
isDamage = false;
isAlive = true;
waterDranked = 25;
initBoard();
}
fill(211, 211, 211, 200);
rect(40, 20, 1520, 120);
rect(40, 140, 1520, 120);
rect(40, 260, 1520, 120);
fill(0);
textSize(75);
text("Health: " + healthString + "/100", 50, 100);
text(GemsCollectedResult, 700, 100);
fill(0);
text("Thirst: " + thirst + "/200", 50, 215);
text(" Hunger: " + hunger + "/200", 705, 215);
text("Energy " + energy + "/200", 55, 330);
text(" Rating: ", 705, 330);
if ((health < 25 || thirst < 25 || hunger < 25 || energy < 25) && (health != 0 || thirst != 0 || hunger != 0 || energy != 0)) {
image(bad, 1000, 250, 100, 100);
sc.playNote(64, 10, 1);
} else if (health < 50 || thirst < 50 || hunger < 50 || energy < 50) {
image(ok, 1050, 250, 100, 100);
} else if (health >= 50 || thirst >= 50 || hunger >= 50 || energy >= 50) {
image(good, 1050, 250, 100, 100);
} else if (health <= 0) {
image(dead, 1050, 250, 100, 100);
}
fill(255);
text("Spacebar to Restart :)", 10, 1200);
if (isDamage) {
health--;
}
if (health <= 0) {
GemsCollectedResult = "Fail";
isDamage = false;
isAlive = false;
health = 0;
thirst = 0;
hunger = 0;
energy = 0;
textSize(200);
fill(211, 211, 211);
rect(300, 480, 1100, 200);
fill(166, 16, 30);
text("YOU DIED!", 325, 650);
}
if (GemsCollected == totalGems) {
isDamage = false;
isAlive = false;
health = 0;
thirst = 0;
hunger = 0;
energy = 0;
textSize(200);
fill(212, 175, 55);
text("YOU WON!", 325, 650);
}
if (thirst <= 0 || hunger <= 0) {
thirst = 0;
hunger = 0;
if (health > 0) {
health -= 0.5f;
}
}
if (energy <= 15 && energy != 0) {
println("You crawl onto the ground and fall because of your lack of energy. Your only chance now is to restart the game");
}
for (int i = 0; i < notes.length; i++) {
if ((i * frames_per_beat) + 1 == frameCount) {
sc.playNote(notes[i], 100, 1);
}
}
}
int thirstCounter = 60;
int hungerCounter = 60;
int healthCounter = 240;
int energyCounter = 120;
public void drawPlayer() {
float x = pc * C_SIZE; // middle of the cell of player
float y = pr * C_SIZE;
fill(255);
if (thirstCounter-- <= 0) {
thirstCounter = 60;
if (thirst > 0) {
thirst -= 3.5f;
}
} else if (hungerCounter-- <= 0) {
hungerCounter = 60;
if (hunger > 0) {
hunger -= 2.5f;
}
} else if (healthCounter-- <= 0) {
healthCounter = 240;
if (health > 0 && health != 100) {
health += 1;
}
} else if (energyCounter-- <= 0) {
energyCounter = 120;
if (energy > 0 && energy != 200) {
energy -= 1;
}
}
if (isAlive) {
image(player, x, y, C_SIZE, C_SIZE);
} else {
image(dead, x, y, C_SIZE, C_SIZE);
}
if (world[pr][pc] == LAVA && moves != 0) {
isDamage = true;
} else if (world[pr][pc] == GEMS) {
GemsCollected++;
world[pr][pc] = collectedGem;
// ellipse(x + 20, y + 20, 50, 50);
} else if (world[pr][pc] == CHUGJUG) {
health = 100;
thirst = 200;
hunger = 200;
energy = 200;
world[pr][pc] = GRASS;
} else if (world[pr][pc] == ILLUMANATI) {
image(illumanati, 0, 0, 1600, 1200);
isDamage = false;
isAlive = false;
health = 666;
thirst = 666;
hunger = 666;
energy = 666;
GemsCollected = 666;
isIllumanati = true;
for (int g = 0; g < 100; g++) {
println("You found me");
}
} else {
isDamage = false;
}
if (world[pr][pc] == WATER) {
if (waterDranked == 1) {
world[pr][pc] = GRASS;
waterDranked = 15;
} else if (thirst != 200) {
thirst += 0.5f;
waterDranked--;
}
} else if (world[pr][pc] == FOOD) {
hunger++;
energy++;
if (foodEaten == 1) {
world[pr][pc] = GRASS;
foodEaten = 15;
} else if (hunger != 200) {
hunger += 0.5f;
foodEaten--;
}
} else if (world[pr][pc] == STONE) {
int randomStep = random(2) > 0 ? 1 : -1;
pr += randomStep;
pc += randomStep;
}
}
public void drawWorld() {
for (int r = 0; r < ROWS; r++) {
for (int c = 0; c < COLS; c++) {
int x = c * C_SIZE;
int y = r * C_SIZE;
int cell = world[r][c];
if (cell == GRASS) {
fill(0, 128, 0); // dark green
} else if (cell == WATER) {
fill(0, 0, 100); // dark blue
} else if (cell == SWAMP) {
fill(153, 50, 204); // purple
} else if (cell == LAVA) {
fill(178, 34, 34); // Red
} else if (cell == STONE) {
fill(105, 105, 105);
} else if (cell == collectedGem) {
fill(255, 233, 0);
} else if (cell == FOOD) { // Brown
fill(101, 67, 33);
} else if (cell == CHUGJUG) { // Pink
fill(255, 192, 203);
} else if (cell == ILLUMANATI) {
fill(0);
} else {
fill(135, 206, 250); // Gem (light blue)
image(gem, x, y);
}
noStroke();
rect(x, y, C_SIZE, C_SIZE);
}
}
}
public void preventArrayException() {
if (pr > 47) {
pr = 47;
} else if (pr < 0) {
pr = 0;
} else if (pc > 63) {
pc = 63;
} else if (pc < 0) {
pc = 0;
}
}
public void throwException(String message) throws Exception {
println(new Exception(message));
}
// int setIntegerLimit(int value, int begin, int end) {
// if (value < begin || value > end) {
// }
// }
public void settings() { size(1600, 1200); }
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "game" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
5a75b096ad776f6fcda851f090808170ed7ea38d | 15c42a76f8a623912abf7e8836ee4ed1e3b98130 | /src/ReadFromFile.java | 32e520a30070db242f50e360ac5efde69a926e47 | [] | no_license | mertemreozturk/Monitor-payroll-of-Personnel-in-a-University-with-Java | 73b5f03c7c1c9f849b9b2cc0ddb80602d7811cac | 5a97b9050eee7e1fa5de87983cedcf09b1957614 | refs/heads/main | 2023-05-23T13:58:23.017309 | 2021-06-19T22:56:29 | 2021-06-19T22:56:29 | 378,518,240 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 482 | java |
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Paths;
public class ReadFromFile {
public String[] readFile(String path) {
try {
int i = 0;
int length = Files.readAllLines(Paths.get(path)).size();
String[] results = new String[length];
for(String line: Files.readAllLines(Paths.get(path))) {
results[i++] = line;
}
return results;
}
catch(IOException e){
e.printStackTrace();
return null;
}
}
} | [
"noreply@github.com"
] | noreply@github.com |
3b3bd882dfba6b407f9a61528398a3e366aba318 | a4462d7726b285b942de43f580e0cf4379128102 | /src/main/java/com/syscxp/biz/entity/redmine/Workflow_.java | b499cad374e847a7d18bf5a220ac797d7eed6da4 | [] | no_license | GUTIREZ/activiti-boot | 2a480cee789c45c12020149cb8fcd2df8a5bd483 | 7b3c2e095c40cec99ef51c2c2de87a23c75c26ee | refs/heads/master | 2020-03-26T13:12:58.707316 | 2018-09-30T01:22:12 | 2018-09-30T01:22:12 | 144,928,957 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 749 | java | package com.syscxp.biz.entity.redmine;
import org.springframework.stereotype.Component;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
/**
* @Author: sunxuelong.
* @Cretion Date: 2018-09-17.
* @Description: .
*/
@StaticMetamodel(Workflow.class)
@Component
public class Workflow_ {
public static volatile SingularAttribute<Issue, Long> id;
public static volatile SingularAttribute<Issue, Long> trackerId;
public static volatile SingularAttribute<Issue, Long> roleId;
public static volatile SingularAttribute<Issue, String> type;
public static volatile SingularAttribute<Issue, String> fieldName;
public static volatile SingularAttribute<Issue, String> rule;
} | [
"gutirez@163.com"
] | gutirez@163.com |
94c685fcbba572b37f0b8b96a78101e4bbb5a4ca | 1f742409cbab86f55d310ab282359fccf5f907c0 | /day9/Quest36.java | bdb8cd58a87c1a48bd91e94d78dda5763e0d61a0 | [] | no_license | sriramselvaraj21/Java | fc675550a4476b9e5975c69db7218253ae920897 | 6b9df408fcc439308148c54a5b4cad55adafe5af | refs/heads/main | 2023-04-25T10:48:30.105298 | 2021-04-27T05:35:35 | 2021-04-27T05:35:35 | 353,292,828 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 711 | java | package day9;
public class Quest36 {
public static void main(String[] args) {
checkPallindromeNumber();
checkPallindromeString("sriram");
}
static void checkPallindromeNumber() {
int rem, rev = 0, temp;
int n = 121;
temp = n;
while (n != 0) {
rem = n % 10;
rev = rev * 10 + rem;
n = n / 10;
}
if (temp == rev)
System.out.println(temp + " is a palindrome.");
else
System.out.println(temp + " is not a palindrome.");
}
static void checkPallindromeString(String s) {
String reverse = new StringBuffer(s).reverse().toString();
if (s.equals(reverse))
System.out.println("Yes, it is a palindrome");
else
System.out.println("No, it is not a palindrome");
}
}
| [
"Sriram.Selvaraj@gds.ey.com"
] | Sriram.Selvaraj@gds.ey.com |
5ce09590aa2e20392fb299279792e04412e76a72 | 8c23b656c3aff79861366a1957587567229bd4d0 | /round-39/pga/src/com/coderbd/view/NewJFrame.java | 7d72daaa4b1c56746386fd46b62568b9055388a7 | [] | no_license | hyeminimeyh/swing | a72e8f1b13bf1cd7d372f790d60f7a7250dd786f | 2f1c01246e8db66c6353179a088593b2d16576eb | refs/heads/master | 2022-11-09T22:01:17.987934 | 2020-02-24T12:58:29 | 2020-02-24T12:58:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,627 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.coderbd.view;
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferByte;
import java.awt.image.WritableRaster;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.filechooser.FileNameExtensionFilter;
/**
*
* @author User
*/
public class NewJFrame extends javax.swing.JFrame {
private static final int IMG_WIDTH = 120;
private static final int IMG_HEIGHT = 120;
ImageIcon photo;
WritableRaster raster;
DataBufferByte data;
File image;
JLabel label;
/**
* Creates new form NewJFrame
*/
public NewJFrame() {
initComponents();
panelDisplayImage.setSize(120, 120);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
btnSave = new javax.swing.JButton();
panelDisplayImage = new javax.swing.JPanel();
lblphoto = new javax.swing.JLabel();
btnFileChooser = new javax.swing.JButton();
lblImageDisplay = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
btnSave.setText("Save");
btnSave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSaveActionPerformed(evt);
}
});
panelDisplayImage.setBackground(new java.awt.Color(255, 204, 204));
javax.swing.GroupLayout panelDisplayImageLayout = new javax.swing.GroupLayout(panelDisplayImage);
panelDisplayImage.setLayout(panelDisplayImageLayout);
panelDisplayImageLayout.setHorizontalGroup(
panelDisplayImageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblphoto, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 133, Short.MAX_VALUE)
);
panelDisplayImageLayout.setVerticalGroup(
panelDisplayImageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblphoto, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
);
btnFileChooser.setBackground(new java.awt.Color(255, 255, 255));
btnFileChooser.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
btnFileChooser.setText("Choose A File");
btnFileChooser.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnFileChooserActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(167, 167, 167)
.addComponent(btnFileChooser)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnSave)
.addGap(47, 47, 47))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addComponent(lblImageDisplay, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(138, 138, 138)))
.addComponent(panelDisplayImage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(67, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(77, 77, 77)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnSave)
.addComponent(btnFileChooser))
.addGap(35, 35, 35)
.addComponent(lblImageDisplay, javax.swing.GroupLayout.DEFAULT_SIZE, 96, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGap(49, 49, 49)
.addComponent(panelDisplayImage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(190, 190, 190))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_btnSaveActionPerformed
private void btnFileChooserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFileChooserActionPerformed
JFileChooser chooser;
FileNameExtensionFilter filter;
chooser = new JFileChooser();
chooser.setCurrentDirectory(image);
filter = new FileNameExtensionFilter("jpeg, gif and png files", "jpg", "gif", "png");
chooser.addChoosableFileFilter(filter);
int i = chooser.showOpenDialog(this);
if (i == JFileChooser.APPROVE_OPTION) {
image = chooser.getSelectedFile();
lblImageDisplay.setText(image.getAbsolutePath());
try {
BufferedImage originalImage = ImageIO.read(image);
int type = originalImage.getType() == 0 ? BufferedImage.TYPE_INT_ARGB : originalImage.getType();
BufferedImage resizeImageJpg = ImageUtil.resizeImage(originalImage, type,IMG_WIDTH, IMG_HEIGHT );
photo = new ImageIcon(ImageUtil.toImage(resizeImageJpg));
System.out.println("=====" + photo.getIconHeight());
//converting buffered image to byte array
raster = resizeImageJpg.getRaster();
data = (DataBufferByte) raster.getDataBuffer();
} catch (IOException e) {
System.out.println(e.getMessage());
}
// panelDisplayImage.removeAll();
lblphoto = new JLabel("", photo, JLabel.CENTER);
panelDisplayImage.add(lblphoto);
repaint();
chooser.setCurrentDirectory(image);
}
}//GEN-LAST:event_btnFileChooserActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new NewJFrame().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnFileChooser;
private javax.swing.JButton btnSave;
private javax.swing.JLabel lblImageDisplay;
private javax.swing.JLabel lblphoto;
private javax.swing.JPanel panelDisplayImage;
// End of variables declaration//GEN-END:variables
}
| [
"springapidev@gmail.com"
] | springapidev@gmail.com |
4f6ac5d00f5116baabdf83faf32bbc848a94221c | c0f1237b3562671f0ef3376824d1fd9e96983bb9 | /src/main/java/com/lanxi/equity/report/api/AddEquityRes.java | cad5c76d3bb47ecfc26189db79ec26f102da1351 | [] | no_license | LuckyMagacian/equity | 2a4449251104e072217f70482a906fefb2049081 | b5d4f0e7cea04e260eb92350fdcc1abb0e4f5a43 | refs/heads/master | 2021-01-24T20:27:16.022510 | 2018-03-06T03:51:59 | 2018-03-06T03:51:59 | 123,253,928 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,112 | java | package com.lanxi.equity.report.api;
import com.lanxi.equity.assist.Comment;
import com.lanxi.equity.assist.ConvertAssist;
import com.lanxi.equity.assist.InRange;
import com.lanxi.equity.config.ReportDealStatus;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
/**
* 增加权益接口调用结果详情
* @author yangyuanjian created in 2018/2/6 11:28
*/
@Comment("增加权益接口响应")
public class AddEquityRes implements ResProto{
@Comment("用户编号")
private String userId;
// @Comment("机构自定用户编号")
// private String orgaUserId;
@Comment("对每个code的响应")
private List<DealResult> resdetail;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
// public String getOrgaUserId() {
// return orgaUserId;
// }
//
// public void setOrgaUserId(String orgaUserId) {
// this.orgaUserId = orgaUserId;
// }
public List<DealResult> getResdetail() {
return resdetail;
}
public void setResdetail(List<DealResult> resdetail) {
this.resdetail = resdetail;
}
@Override public Element toElement() {
Element body= DocumentHelper.createElement("body");
// body.addElement("userId").setText(userId);
Optional.ofNullable(userId).ifPresent(e->body.addElement("userId").setText(e));
Element detail=body.addElement("result");
resdetail.stream().forEach(e->{
Element element=DocumentHelper.createElement("entry");
Optional.ofNullable(e.getCode()).ifPresent(f->element.addElement("code").setText(e.getCode()));
Optional.ofNullable(e.getDealStatus()).ifPresent(f->element.addElement("status").setText(e.getDealStatus()));
Optional.ofNullable(e.getDesc()).ifPresent(f->element.addElement("desc").setText(e.getDesc()));
// element.addElement("code").setText(ConvertAssist.nullAsEmpty(e.getCode()));
// element.addElement("status").setText(ConvertAssist.nullAsEmpty(e.getDealStatus()));
// element.addElement("desc").setText(ConvertAssist.nullAsEmpty(e.getDesc()));
detail.add(element);
});
return body;
}
public static class DealResult{
@Comment("兑换码")
private String code;
@Comment("处理结果描述")
private String desc;
@InRange(clazz= ReportDealStatus.class,message="兑换码处理结果必须是在ReportDealStatus中声明的值")
@Comment("处理结果状态")
private String dealStatus;
public DealResult(){}
public DealResult(String code,String desc,String dealStatus){
this.code=code;
this.desc=desc;
this.dealStatus=dealStatus;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getDealStatus() {
return dealStatus;
}
public void setDealStatus(String dealStatus) {
this.dealStatus = dealStatus;
}
@Override public String toString() {
final StringBuffer sb = new StringBuffer("DealResult{");
sb.append("code='").append(code).append('\'');
sb.append(", desc='").append(desc).append('\'');
sb.append(", dealStatus='").append(dealStatus).append('\'');
sb.append('}');
return sb.toString();
}
}
@Override public String toString() {
final StringBuffer sb = new StringBuffer("AddEquityRes{");
sb.append("userId='").append(userId).append('\'');
sb.append(", resdetail=").append(resdetail);
sb.append('}');
return sb.toString();
}
}
| [
"yangyuanjian@188lanxi.com"
] | yangyuanjian@188lanxi.com |
b128f909e0a7373f67d3f7613b1cbf52e5683627 | 382b765dba9446969f0fb444568b51fe9df565f5 | /src/main/java/com/mycompany/myapp/domain/Farm.java | b3ace3cabe9189c79a65e866df72103d11b5cd5e | [] | no_license | jh64/jhipster-water-order | 6506e81a2d38e8657daf38b0b55d64e22f18ffbc | 50f161cd610c9a2121785861bc75d46678ae9cc1 | refs/heads/master | 2023-01-13T10:52:33.761159 | 2020-11-17T21:55:28 | 2020-11-17T21:55:28 | 312,456,939 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,093 | java | package com.mycompany.myapp.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
/**
* A Farm.
*/
@Entity
@Table(name = "farm")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Farm implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@NotNull
@Size(min = 3)
@Column(name = "name", nullable = false)
private String name;
@ManyToOne
@JsonIgnoreProperties(value = "farms", allowSetters = true)
private User user;
// jhipster-needle-entity-add-field - JHipster will add fields here
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public Farm name(String name) {
this.name = name;
return this;
}
public void setName(String name) {
this.name = name;
}
public User getUser() {
return user;
}
public Farm user(User user) {
this.user = user;
return this;
}
public void setUser(User user) {
this.user = user;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Farm)) {
return false;
}
return id != null && id.equals(((Farm) o).id);
}
@Override
public int hashCode() {
return 31;
}
// prettier-ignore
@Override
public String toString() {
return "Farm{" +
"id=" + getId() +
", name='" + getName() + "'" +
"}";
}
}
| [
"48374211+jh64@users.noreply.github.com"
] | 48374211+jh64@users.noreply.github.com |
449ebf714b4f52c9d707f0bcd36a5b4c208132c1 | fd57ede0ba18642a730cc862c9e9059ec463320b | /data-binding/compiler/src/main/java/android/databinding/tool/util/GenerationalClassUtil.java | dc360e8f692c4fe76cfaa6e73c3f5afe76af8a06 | [] | no_license | kailaisi/android-29-framwork | a0c706fc104d62ea5951ca113f868021c6029cd2 | b7090eebdd77595e43b61294725b41310496ff04 | refs/heads/master | 2023-04-27T14:18:52.579620 | 2021-03-08T13:05:27 | 2021-03-08T13:05:27 | 254,380,637 | 1 | 1 | null | 2023-04-15T12:22:31 | 2020-04-09T13:35:49 | C++ | UTF-8 | Java | false | false | 7,651 | java | /*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.databinding.tool.util;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.filefilter.TrueFileFilter;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import javax.annotation.processing.ProcessingEnvironment;
import javax.tools.FileObject;
import javax.tools.StandardLocation;
/**
* A utility class that helps adding build specific objects to the jar file
* and their extraction later on.
*/
public class GenerationalClassUtil {
private static List[] sCache = null;
public static <T extends Serializable> List<T> loadObjects(ExtensionFilter filter) {
if (sCache == null) {
buildCache();
}
//noinspection unchecked
return sCache[filter.ordinal()];
}
private static void buildCache() {
L.d("building generational class cache");
ClassLoader classLoader = GenerationalClassUtil.class.getClassLoader();
Preconditions.check(classLoader instanceof URLClassLoader, "Class loader must be an"
+ "instance of URLClassLoader. %s", classLoader);
//noinspection ConstantConditions
final URLClassLoader urlClassLoader = (URLClassLoader) classLoader;
sCache = new List[ExtensionFilter.values().length];
for (ExtensionFilter filter : ExtensionFilter.values()) {
sCache[filter.ordinal()] = new ArrayList();
}
for (URL url : urlClassLoader.getURLs()) {
L.d("checking url %s for intermediate data", url);
try {
final File file = new File(url.toURI());
if (!file.exists()) {
L.d("cannot load file for %s", url);
continue;
}
if (file.isDirectory()) {
// probably exported classes dir.
loadFromDirectory(file);
} else {
// assume it is a zip file
loadFomZipFile(file);
}
} catch (IOException e) {
L.d("cannot open zip file from %s", url);
} catch (URISyntaxException e) {
L.d("cannot open zip file from %s", url);
}
}
}
private static void loadFromDirectory(File directory) {
for (File file : FileUtils.listFiles(directory, TrueFileFilter.INSTANCE,
TrueFileFilter.INSTANCE)) {
for (ExtensionFilter filter : ExtensionFilter.values()) {
if (filter.accept(file.getName())) {
InputStream inputStream = null;
try {
inputStream = FileUtils.openInputStream(file);
Serializable item = fromInputStream(inputStream);
if (item != null) {
//noinspection unchecked
sCache[filter.ordinal()].add(item);
L.d("loaded item %s from file", item);
}
} catch (IOException e) {
L.e(e, "Could not merge in Bindables from %s", file.getAbsolutePath());
} catch (ClassNotFoundException e) {
L.e(e, "Could not read Binding properties intermediate file. %s",
file.getAbsolutePath());
} finally {
IOUtils.closeQuietly(inputStream);
}
}
}
}
}
private static void loadFomZipFile(File file)
throws IOException {
ZipFile zipFile = new ZipFile(file);
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
for (ExtensionFilter filter : ExtensionFilter.values()) {
if (!filter.accept(entry.getName())) {
continue;
}
InputStream inputStream = null;
try {
inputStream = zipFile.getInputStream(entry);
Serializable item = fromInputStream(inputStream);
L.d("loaded item %s from zip file", item);
if (item != null) {
//noinspection unchecked
sCache[filter.ordinal()].add(item);
}
} catch (IOException e) {
L.e(e, "Could not merge in Bindables from %s", file.getAbsolutePath());
} catch (ClassNotFoundException e) {
L.e(e, "Could not read Binding properties intermediate file. %s",
file.getAbsolutePath());
} finally {
IOUtils.closeQuietly(inputStream);
}
}
}
}
private static Serializable fromInputStream(InputStream inputStream)
throws IOException, ClassNotFoundException {
ObjectInputStream in = new ObjectInputStream(inputStream);
return (Serializable) in.readObject();
}
public static void writeIntermediateFile(ProcessingEnvironment processingEnv,
String packageName, String fileName, Serializable object) {
ObjectOutputStream oos = null;
try {
FileObject intermediate = processingEnv.getFiler().createResource(
StandardLocation.CLASS_OUTPUT, packageName,
fileName);
OutputStream ios = intermediate.openOutputStream();
oos = new ObjectOutputStream(ios);
oos.writeObject(object);
oos.close();
L.d("wrote intermediate bindable file %s %s", packageName, fileName);
} catch (IOException e) {
L.e(e, "Could not write to intermediate file: %s", fileName);
} finally {
IOUtils.closeQuietly(oos);
}
}
public enum ExtensionFilter {
BR("-br.bin"),
LAYOUT("-layoutinfo.bin"),
SETTER_STORE("-setter_store.bin");
private final String mExtension;
ExtensionFilter(String extension) {
mExtension = extension;
}
public boolean accept(String entryName) {
return entryName.endsWith(mExtension);
}
public String getExtension() {
return mExtension;
}
}
}
| [
"541018378@qq.com"
] | 541018378@qq.com |
9863993762f75f2762a975171d7c861adafde067 | db6a46a6c30925a1fe9ec4d3786f15dd3e8b5d59 | /web-master-Upmusic-ver1/src/main/java/com/upmusic/web/domain/converter/MusicTrackStatusAttributeConverter.java | c1e0f699c91ac47c62b6cb880f16ab6d06461435 | [] | no_license | hungtruong121/AllmusicKoreaUpmusic | 1ed8c3c64d95a96b30021772550b4830a0949b0f | 481929e1275efbc173d496fbb27ebfebbfb9dc0b | refs/heads/master | 2022-07-01T22:34:00.275717 | 2020-05-07T16:40:27 | 2020-05-07T16:40:27 | 262,104,209 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,007 | java | package com.upmusic.web.domain.converter;
import javax.persistence.AttributeConverter;
import com.upmusic.web.config.UPMusicConstants.MusicTrackStatus;
public class MusicTrackStatusAttributeConverter implements AttributeConverter<MusicTrackStatus, Integer> {
@Override
public Integer convertToDatabaseColumn(MusicTrackStatus status) {
Integer code = 0;
switch(status) {
case BEFORE_EXAM:
code = 1;
break;
case UNDER_EXAM:
code = 2;
break;
case ACCEPTED:
code = 3;
break;
case REJECTED:
code = 4;
break;
}
return code;
}
@Override
public MusicTrackStatus convertToEntityAttribute(Integer code) {
MusicTrackStatus type = MusicTrackStatus.BEFORE_EXAM;
switch(code) {
case 1:
type = MusicTrackStatus.BEFORE_EXAM;
break;
case 2:
type = MusicTrackStatus.UNDER_EXAM;
break;
case 3:
type = MusicTrackStatus.ACCEPTED;
break;
case 4:
type = MusicTrackStatus.REJECTED;
break;
}
return type;
}
}
| [
"hungtruonglearning@gmail.com"
] | hungtruonglearning@gmail.com |
8cbdfaaec29765c7b8184e01d35462f22e784b26 | f356d11745a2fa730dc6ca22c0847c571e15ad0d | /app/src/main/java/com/shashank/root/myapp/common/Loader.java | efe5aab3edec439c23aa50d288e0e249e81bbef5 | [] | no_license | ShashankKasera/ChatApp | ec81704a25dace2aa43e1a50dc4f94bf5055e1a9 | 2abd0032505f2a1577ec88ff2003be0c7165e5ab | refs/heads/master | 2020-04-13T15:21:01.558861 | 2019-01-31T07:42:34 | 2019-01-31T07:42:34 | 163,283,000 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 962 | java | package com.shashank.root.myapp.common;
import android.app.Dialog;
import android.content.Context;
import android.view.Window;
import com.airbnb.lottie.LottieAnimationView;
import com.airbnb.lottie.LottieDrawable;
import com.shashank.root.myapp.R;
public class Loader {
private Dialog dialog;
public Loader(Context context){
dialog = new Dialog(context);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setCancelable(false);
dialog.setContentView(R.layout.dialog_loader);
dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
LottieAnimationView animationView = dialog.findViewById(R.id.animation_view);
animationView.setSpeed(0.9f);
animationView.setRepeatMode(LottieDrawable.REVERSE);
}
public void show(){
dialog.show();
}
public void dismiss(){
dialog.dismiss();
}
}
| [
"shashankkasera98@gmail.com"
] | shashankkasera98@gmail.com |
fe25e3d4dcaabe668e8f51b8c4a16edbd8d03ef9 | e17e1a1d6b42502fb0883aa1b853875b3ab542a3 | /app/src/main/java/com/example/exam/SelectTestActivity.java | 0a9385d24b4f3434f3880af8083770c7383fc6e7 | [] | no_license | vg-madt/exam | 0554353e21eff15a1d96caeab88972ab74d22210 | 44fc21a0585177c2950a00f817e1e9da47d7b35c | refs/heads/main | 2023-02-28T11:21:44.984039 | 2021-02-04T18:40:44 | 2021-02-04T18:40:44 | 336,046,440 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,532 | java | package com.example.exam;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import java.util.ArrayList;
public class SelectTestActivity extends AppCompatActivity {
Spinner sp;
ArrayList<String> allTests;
String testName;
Button start;
String user;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_select_test);
final DatabaseInitClass db = new DatabaseInitClass(this);
allTests = new ArrayList<>();
start = findViewById(R.id.startTest);
sp = findViewById(R.id.spinner);
Bundle bundle = getIntent().getExtras();
//Extract the data…
user = bundle.getString("user");
allTests = db.getAllTests();
ArrayAdapter aa=new ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item,allTests);
aa.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
sp.setAdapter(aa);
sp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
testName = sp.getSelectedItem().toString();
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
start.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String usr = user.trim();
String test = testName.trim();
boolean s = db.checkIfWritten(test, usr);
if (s == true) {
Toast.makeText(SelectTestActivity.this, "Test taken already", Toast.LENGTH_SHORT).show();
}else{
Intent intent = new Intent(getBaseContext(), MainActivity.class);
Bundle b = new Bundle();
b.putString("testName", testName);
b.putString("user", user);
intent.putExtras(b);
startActivity(intent);
}
}
});
}
}
| [
"noreply@github.com"
] | noreply@github.com |
5125efdee701cc31ca33438c204e33e92044dbe8 | 040441bfac1ee64672e0a908d68a4b6d914c5e8b | /src/main/java/vendning/project/Vending_Machine/service/V_M.java | 1a693c4134cce1b27c81e648ec91c1281f94325d | [] | no_license | kruger3891/vending-machine | 092e6e0681699593ed737fada5b5a4e1f848af3c | cafa8cb4048b59184366a56a24f5dba8d47d9a10 | refs/heads/master | 2020-04-21T01:01:39.956351 | 2019-04-09T13:56:10 | 2019-04-09T13:56:10 | 169,211,868 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 384 | java | package vendning.project.Vending_Machine.service;
import vendning.project.Vending_Machine.model.Product;
public interface V_M {
void getFruits();
void getConfection();
void getJuice();
void getPhone();
void showMoneyList();
void setProducta();
int[] getMoneyArray();
Product[] getProductList();
int getSave();
void setSave(int save);
} | [
"kruger3891@gmail.com"
] | kruger3891@gmail.com |
c7228915cefbc099231ef2dc6b2fb32a04ec3218 | c1e045307743d3a69cc5a19161ed03adeafc9ae4 | /android_klient/projekt/Smart-Fine 30.4.2012/src/cz/smartfine/android/MyApp.java | 6114ad864f202df7f1ade20ff816d6addbfccd1e | [] | no_license | marstaj/smart-fine | 3a7b5687f594ea9e10420ea00b7429992857a036 | fde5c569f26a3595a7d77713761b2591e238d877 | refs/heads/master | 2016-09-06T00:18:18.431416 | 2012-06-18T16:59:37 | 2012-06-18T16:59:37 | 33,733,178 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,023 | java | package cz.smartfine.android;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.net.InetSocketAddress;
import cz.smartfine.android.R;
import cz.smartfine.android.dao.FileFreqValuesDAO;
import cz.smartfine.android.dao.FileLawDAO;
import cz.smartfine.android.dao.FileLocationDAO;
import cz.smartfine.android.dao.FileTicketDAO;
import cz.smartfine.android.dao.PhotoDAO;
import cz.smartfine.android.dao.interfaces.IFreqValuesDAO;
import cz.smartfine.android.dao.interfaces.ILocationDAO;
import cz.smartfine.android.dao.interfaces.IPhotoDAO;
import cz.smartfine.android.dao.interfaces.ITicketDAO;
import cz.smartfine.android.model.util.Toaster;
import cz.smartfine.android.networklayer.ConnectionProvider;
import cz.smartfine.android.networklayer.links.SecuredMobileLink;
import cz.smartfine.android.networklayer.networkinterface.SimpleNetworkInterface;
import cz.smartfine.networklayer.links.ILink;
import cz.smartfine.android.model.Settings;
import android.app.Application;
/**
* Třída reprezentující aplikaci
*
* @author Martin Štajner
*
*/
public class MyApp extends Application {
/**
* Pristup k fileTicketDAO
*/
private ITicketDAO fileTicketDAO;
/**
* Pristup k fileLocationDAO
*/
private ILocationDAO fileLocationDAO;
/**
* Přistup k photoDAO
*/
private IPhotoDAO photoDAO;
/**
* Pristup k fileFreqValuesDAO
*/
private IFreqValuesDAO fileFreqValuesDAO;
/**
* Pristup k fileLawDAO
*/
private IFreqValuesDAO fileLawDAO;
/**
* Provider pripojeni
*/
private ConnectionProvider connectionProvider;
// ==================================== INICIALIZACE ==================================== //
/*
* (non-Javadoc)
*
* @see android.app.Application#onCreate()
*/
@Override
public void onCreate() {
super.onCreate();
// Nastavi kontext aplikace Toasteru, aby mohl toastovat
Toaster.context = getApplicationContext();
// Vytvoří FileTicketDAO pro práci s parkovacími lístky a načte soubor s lístky
try {
fileTicketDAO = new FileTicketDAO(this);
fileTicketDAO.loadAllTickets();
} catch (FileNotFoundException e) {
Toaster.toast("Soubor nenalezen", Toaster.SHORT);
} catch (Exception e) {
Toaster.toast("Nepodařilo se načíst uložené lístky", Toaster.SHORT);
}
// Vytvori photoDAO pro praci s fotografiemi
try {
photoDAO = new PhotoDAO(this);
} catch (Exception e) {
Toaster.toast("Nepodařilo se vytvořit složku pro ukladání fotografií", Toaster.SHORT);
}
// Vytvori FileFreqValuesDAO pro praci s nejcastejsimi hodnotami a nacte je
fileFreqValuesDAO = new FileFreqValuesDAO(this);
fileFreqValuesDAO.loadValues();
// Vytvori FileLawDAO pro praci s nejcastejsimi hodnotami zákonů přestupků a nacte je
fileLawDAO = new FileLawDAO(this);
fileLawDAO.loadValues();
// Vytvoří FileLocationDAO pro práci s polohou policistu
try {
fileLocationDAO = new FileLocationDAO(this);
fileLocationDAO.loadAllWaypoints();
} catch (FileNotFoundException e) {
Toaster.toast("Soubor location nenalezen", Toaster.SHORT);
} catch (Exception e) {
Toaster.toast("Nepodařilo se načíst informace o poloze.", Toaster.SHORT);
}
}
/**
* Inicializuje ConnectionProvider
*/
public void inicilizeConnectionToServer() throws Exception {
Settings settings;
// Pak se bude vytahovat ze settings TODO
// settings.getSyncUrl(this);
InetSocketAddress address = new InetSocketAddress("192.168.0.121", 25000);
// TODO predelat RAW na ASSETS???
InputStream in = this.getResources().openRawResource(R.raw.ssltestcert);
ILink ilink = new SecuredMobileLink(address, in, "ssltest");
SimpleNetworkInterface ni = new SimpleNetworkInterface();
connectionProvider = new ConnectionProvider(this, ilink, ni);
}
// ==================================== GETTERY SETTERY ==================================== //
/**
* Vrátí přístup k DAO
*
* @return přístup k DAO
*/
public ITicketDAO getTicketDao() {
return fileTicketDAO;
}
/**
* Vrátí přístup k PhotoDAO
*
* @return přístup k PhotoDAO
*/
public IPhotoDAO getPhotoDAO() {
return photoDAO;
}
/**
* Vrátí přístup k FileFreqValuesDAO
*
* @return přístup k FileFreqValuesDAO
*/
public IFreqValuesDAO getFreqValuesDAO() {
return fileFreqValuesDAO;
}
/**
* Vrátí přístup k FileLawDAO
*
* @return přístup k FileLawDAO
*/
public IFreqValuesDAO getLawDAO() {
return fileLawDAO;
}
/**
* Vrátí přístup k FileLocationDAO
*
* @return přístup k FileLocationDAO
*/
public ILocationDAO getLocationDAO() {
return fileLocationDAO;
}
/**
* Vrátí přístup k ConnectionProvider
*
* @return přístup k ConnectionProvider
*/
public ConnectionProvider getConnectionProvider() {
return connectionProvider;
}
}
| [
"Marstaj1@gmail.com@e923c2b7-bbb3-8d9b-135d-a4a544919022"
] | Marstaj1@gmail.com@e923c2b7-bbb3-8d9b-135d-a4a544919022 |
9f6aa808a5f603e19492100190567d26da3b73d5 | b8f4e27b12d45e4c71249e9bc793eeaaf371cf4e | /src/main/java/onlinealgo/EquiPoint.java | 710c53dbc4b6675e210a78cf8e15b239bd43524e | [
"MIT"
] | permissive | Ernestyj/JStudy | ca9a67801ba935655c935e310e4d8ed117200583 | b5a622ce2a011517a0a00307af7b87ca24fa9d1c | refs/heads/master | 2020-04-04T07:13:55.202675 | 2016-11-17T13:37:07 | 2016-11-17T13:37:07 | 40,429,136 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,527 | java | package onlinealgo;
/**A zero-indexed array A consisting of N integers is given. An equilibrium index of this array is any integer P such that 0 ≤ P < N and the sum of elements of lower indices is equal to the sum of elements of higher indices, i.e.
A[0] + A[1] + ... + A[P−1] = A[P+1] + ... + A[N−2] + A[N−1].
Sum of zero elements is assumed to be equal to 0. This can happen if P = 0 or if P = N−1.
For example, consider the following array A consisting of N = 8 elements:
A[0] = -1
A[1] = 3
A[2] = -4
A[3] = 5
A[4] = 1
A[5] = -6
A[6] = 2
A[7] = 1
P = 1 is an equilibrium index of this array, because:
A[0] = −1 = A[2] + A[3] + A[4] + A[5] + A[6] + A[7]
P = 3 is an equilibrium index of this array, because:
A[0] + A[1] + A[2] = −2 = A[4] + A[5] + A[6] + A[7]
P = 7 is also an equilibrium index, because:
A[0] + A[1] + A[2] + A[3] + A[4] + A[5] + A[6] = 0
and there are no elements with indices greater than 7.
P = 8 is not an equilibrium index, because it does not fulfill the condition 0 ≤ P < N.
Write a function:
class Solution { public int solution(int[] A); }
that, given a zero-indexed array A consisting of N integers, returns any of its equilibrium indices. The function should return −1 if no equilibrium index exists.
For example, given array A shown above, the function may return 1, 3 or 7, as explained above.
Assume that:
N is an integer within the range [0..100,000];
each element of array A is an integer within the range [−2,147,483,648..2,147,483,647].
Complexity:
expected worst-case time complexity is O(N);
expected worst-case space complexity is O(N), beyond input storage (not counting the storage required for input arguments).
Elements of input arrays can be modified.
* Created by eugene on 16/4/8.
*/
public class EquiPoint {
public static void main(String[] args) {
System.out.println("*****RESULT*****");
// int[] A = {-1, 3, -4, 5, 1, -6, 2, 1};
int[] A = {1,2,1};
System.out.println(solution(A));
}
public static int solution(int[] A) {
int len = A.length;
int[] cumsum = new int[len+1];
cumsum[0] = 0;
for(int i=1; i<=len; i++){
cumsum[i] = cumsum[i-1]+A[i-1];
}
int total = cumsum[len];
int tailSum;
for(int i=1; i<=len; i++) {
if (i==len) tailSum = 0;
else tailSum = total-A[i]-cumsum[i];
if (cumsum[i]==tailSum) return i;
}
return -1;
}
}
| [
"ernestyj@outlook.com"
] | ernestyj@outlook.com |
3fb39ac021fd3a0315fd489a2c3e8470a5aad353 | b6b04c3bc6afe61e3c3128f552417091c451ba69 | /flink-ml-iteration/flink-ml-iteration-common/src/main/java/org/apache/flink/iteration/progresstrack/OperatorEpochWatermarkTrackerFactory.java | d15beb427c7d45caa900bbb08c23ae096f9ff912 | [
"Apache-2.0"
] | permissive | apache/flink-ml | d15365e1b89b82eb451b99af0050d66dff279f0c | 5619c3b8591b220e78a0a792c1f940e06149c8f0 | refs/heads/master | 2023-08-31T04:08:10.287875 | 2023-08-24T06:40:12 | 2023-08-24T06:40:12 | 351,617,021 | 288 | 85 | Apache-2.0 | 2023-09-07T08:03:42 | 2021-03-26T00:42:03 | Java | UTF-8 | Java | false | false | 3,040 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.flink.iteration.progresstrack;
import org.apache.flink.runtime.io.network.partition.consumer.InputGate;
import org.apache.flink.streaming.api.graph.StreamConfig;
import org.apache.flink.streaming.api.graph.StreamEdge;
import org.apache.flink.streaming.runtime.tasks.StreamTask;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeSet;
/**
* The factory of {@link OperatorEpochWatermarkTracker}. It analyzes the inputs of an operator and
* create the corresponding progress tracker.
*/
public class OperatorEpochWatermarkTrackerFactory {
public static OperatorEpochWatermarkTracker create(
StreamConfig streamConfig,
StreamTask<?, ?> containingTask,
OperatorEpochWatermarkTrackerListener progressTrackerListener) {
int[] numberOfChannels;
if (!streamConfig.isChainStart()) {
numberOfChannels = new int[] {1};
} else {
InputGate[] inputGates = containingTask.getEnvironment().getAllInputGates();
List<StreamEdge> inEdges =
streamConfig.getInPhysicalEdges(containingTask.getUserCodeClassLoader());
// Mapping the edge type (input number) into a continuous sequence start from 0.
// Currently for one-input operator, the type number is 0; for two-inputs and
// multiple-inputs, the type number is from 1 to N. We want to map them to [0, N - 1]
// uniformly.
TreeSet<Integer> edgeTypes = new TreeSet<>();
inEdges.forEach(edge -> edgeTypes.add(edge.getTypeNumber()));
Map<Integer, Integer> edgeTypeToIndices = new HashMap<>();
for (int edgeType : edgeTypes) {
edgeTypeToIndices.put(edgeType, edgeTypeToIndices.size());
}
numberOfChannels = new int[edgeTypeToIndices.size()];
for (int i = 0; i < inEdges.size(); ++i) {
numberOfChannels[edgeTypeToIndices.get(inEdges.get(i).getTypeNumber())] +=
inputGates[i].getNumberOfInputChannels();
}
}
return new OperatorEpochWatermarkTracker(numberOfChannels, progressTrackerListener);
}
}
| [
"gaoyunhenhao@gmail.com"
] | gaoyunhenhao@gmail.com |
bbbb00929ea56f458a3a8faa4838c98072714e3c | 7d04348808cd7e85aa832027ec8fd022d20ca2f9 | /SocketServerForBenchmark/src/main/java/com/alltobid/quotabid/BidServerInitializer.java | bd20d8c09c7a2187eafa081c6d60f2da9d2d1ec7 | [] | no_license | lixiaochun/graffiti | efd507976272b537011933b065ef952ee641c502 | d251c9e665117474bc917d8045cdeac101992bb1 | refs/heads/master | 2020-06-27T01:19:03.300032 | 2017-05-15T03:12:23 | 2017-05-15T03:12:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,522 | java | /*
* Copyright 2013 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.alltobid.quotabid;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.string.StringEncoder;
import io.netty.handler.logging.LoggingHandler;
import io.netty.handler.timeout.IdleStateHandler;
import io.netty.util.CharsetUtil;
public class BidServerInitializer extends ChannelInitializer<SocketChannel> {
private final StringEncoder stringEncoder = new StringEncoder(CharsetUtil.UTF_8);
private final LoggingHandler loggingHandler = new LoggingHandler();
@Override
public void initChannel(SocketChannel ch) {
ChannelPipeline p = ch.pipeline();
p.addLast(new IdleStateHandler(20, 0, 0));
p.addLast(loggingHandler);
p.addLast(SocketServer.globalTrafficShapingHandler);
p.addLast(stringEncoder);
p.addLast(SocketServer.bidServerHandler);
}
}
| [
"黎鹏"
] | 黎鹏 |
a018e45206e74a20af709df78f5cf70ec3fc9c40 | 1d558c18bff2563917a7b5f6ddc5f94c0fdec7c0 | /Chewbie/duetOS/apps/me/xiangchen/app/duetapp/email/EmailExtension.java | b526fa93a1f3bd4ac36334753453236d33c1bf40 | [] | no_license | sceo/2013Summer | b63cee9463a06909ea16ae23b0624b5af4aa4abe | b2135adecfbc344ab3d51c532dfc8abf249897c5 | refs/heads/master | 2021-01-17T11:56:53.584742 | 2013-09-03T14:24:31 | 2013-09-03T14:24:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,024 | java | package me.xiangchen.app.duetapp.email;
import java.util.Calendar;
import me.xiangchen.app.duetapp.AppExtension;
import me.xiangchen.app.duetos.LauncherManager;
import me.xiangchen.app.duetos.R;
import me.xiangchen.technique.doubleflip.xacAuthenticSenseFeatureMaker;
import me.xiangchen.technique.flipsense.xacFlipSenseFeatureMaker;
import me.xiangchen.technique.handsense.xacHandSenseFeatureMaker;
import me.xiangchen.technique.sharesense.xacShareSenseFeatureMaker;
import me.xiangchen.technique.touchsense.xacTouchSenseFeatureMaker;
import me.xiangchen.ui.xacToast;
import android.content.Context;
import android.graphics.Bitmap;
import com.sonyericsson.extras.liveware.aef.control.Control;
import com.sonyericsson.extras.liveware.extension.util.control.ControlTouchEvent;
public class EmailExtension extends AppExtension {
xacToast toast;
public EmailExtension(Context context) {
EmailManager.setWatch(this);
toast = new xacToast(context);
toast.setImage(R.drawable.email_small);
}
@Override
public void doResume() {
showText("Email");
}
@Override
public void doAccelerometer(float[] values) {
xacHandSenseFeatureMaker.updateWatchAccel(values);
xacHandSenseFeatureMaker.addWatchFeatureEntry();
xacTouchSenseFeatureMaker.updateWatchAccel(values);
xacTouchSenseFeatureMaker.addWatchFeatureEntry();
xacFlipSenseFeatureMaker.updateWatchAccel(values);
xacFlipSenseFeatureMaker.addWatchFeatureEntry();
xacShareSenseFeatureMaker.updateWatchAccel(values);
xacShareSenseFeatureMaker.addWatchFeatureEntry();
xacAuthenticSenseFeatureMaker.updateWatchAccel(values);
xacAuthenticSenseFeatureMaker.addWatchFeatureEntry();
}
@Override
public void doTouch(ControlTouchEvent event) {
int action = event.getAction();
switch (action) {
case Control.Intents.TOUCH_ACTION_PRESS:
int watchMode = xacShareSenseFeatureMaker.doClassification();
if (watchMode == xacShareSenseFeatureMaker.PRIVATE) {
LauncherManager.showText(EmailManager.getNumUnnotifiedEmails() + " new email(s)");
}
break;
case Control.Intents.TOUCH_ACTION_RELEASE:
break;
}
}
@Override
public void doSwipe(int direction) {
Calendar calendar = Calendar.getInstance();
long curTime = calendar.getTimeInMillis();
switch (direction) {
case Control.Intents.SWIPE_DIRECTION_RIGHT:
EmailManager.updateWatchGesture(
EmailManager.SWIPECLOSE, curTime);
break;
case Control.Intents.SWIPE_DIRECTION_LEFT:
EmailManager.updateWatchGesture(
EmailManager.SWIPEOPEN, curTime);
break;
}
}
public void showNotification(int flag) {
if(LauncherManager.getWatchMuteness() == true) {
toast.setImage(R.drawable.mute_small);
}
else {
toast.setImage(R.drawable.email_small);
}
if(flag > 0) {
toast.fadeIn(null);
Bitmap bitmap = toast.getBitmap();
updateWatchVisual(bitmap, false);
buzz(100);
} else {
toast.fadeOut();
if(toast.getAlpha() <= xacToast.LOWALPHA * 2) {
updateWatchVisual(null, false);
}
}
}
}
| [
"xiangchen@cmu.edu"
] | xiangchen@cmu.edu |
48f0e1501ed26700bf06fa279ce1bb6ff0508582 | b2b62edbab84a37196b342507a8a098615d001b2 | /src/countingelements/PermCheck/PermCheck.java | 78c18b21f16e764b9a60d76ad92884fec6373bdc | [] | no_license | vishy1214/Coding-testruns | dacf493e5ef49d11810c859786cc08873c68b8fc | 3f6d029a078b91b0b106091ee29cf364713600d4 | refs/heads/main | 2023-02-15T07:51:45.728964 | 2021-01-06T23:05:46 | 2021-01-06T23:05:46 | 325,099,013 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 449 | java | package countingelements.PermCheck;
import java.util.*;
public class PermCheck {
public int solution(int[] A) {
// write your code in Java SE 8
Set<Integer> contents = new HashSet<>();
for (Integer item : A) {
contents.add(item);
}
for (int i = 1; i < A.length + 1; i++) {
if (!contents.contains(i)) {
return 0;
}
}
return 1;
}
}
| [
"1tzmylife"
] | 1tzmylife |
e2d958d0f01edcea69d0e1ab1d210dc11eb4f313 | a0b1353ed23ef52e320dac3c8cbe47e46580cfc0 | /src/main/java/y2015/Y2015D16.java | d44342d51b71ee61c987bc890dfd5a8cc4ade6c7 | [] | no_license | RichardBradley/advent-of-code | 7110ed6c56ffcd97315f1c80a4d968e506ee4a54 | 0c98dfbc923ddb1d00486a4a34211bfec2f8d1da | refs/heads/master | 2023-01-05T22:13:25.716780 | 2022-12-25T09:07:10 | 2022-12-25T09:07:10 | 161,348,691 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 33,366 | java | package y2015;
import lombok.Value;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Stream;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.truth.Truth.assertThat;
import static java.util.stream.Collectors.toList;
public class Y2015D16 {
public static void main(String[] args) throws Exception {
// 1
System.out.println(matchingSues(spec, sues));
// 2
System.out.println(matchingSues2(spec, sues));
}
private static List<Integer> matchingSues(Map<String, Integer> spec, List<Map<String, Integer>> sues) {
List<Integer> acc = new ArrayList<>();
for (int i = 0; i < sues.size(); i++) {
Map<String, Integer> sue = sues.get(i);
if (matches(spec, sue)) {
acc.add(i + 1);
}
}
return acc;
}
private static List<Integer> matchingSues2(Map<String, Integer> spec, List<Map<String, Integer>> sues) {
List<Integer> acc = new ArrayList<>();
for (int i = 0; i < sues.size(); i++) {
Map<String, Integer> sue = sues.get(i);
if (matches2(spec, sue)) {
acc.add(i + 1);
}
}
return acc;
}
private static boolean matches2(Map<String, Integer> spec, Map<String, Integer> sue) {
for (Map.Entry<String, Integer> field : sue.entrySet()) {
String key = field.getKey();
Integer value = field.getValue();
if (value == null) {
continue;
}
// the cats and trees readings indicates that there are greater than that many
if ("cats".equals(key) || "trees".equals(key)) {
if (value.compareTo(spec.get(key)) <= 0) {
return false;
}
} else if ("pomeranians".equals(key) || "goldfish".equals(key)) {
// the pomeranians and goldfish readings indicate that there are fewer than that many (due to the modial interaction of magnetoreluctance).
if (value.compareTo(spec.get(key)) >= 0) {
return false;
}
} else if (!value.equals(spec.get(key))) {
return false;
}
}
return true;
}
private static boolean matches(Map<String, Integer> spec, Map<String, Integer> sue) {
for (Map.Entry<String, Integer> field : sue.entrySet()) {
if (!field.getValue().equals(spec.get(field.getKey()))) {
return false;
}
}
return true;
}
static Pattern specPattern = Pattern.compile("Sue (\\d+):(( (\\w+): (\\d+),?)+)");
static Pattern fieldPattern = Pattern.compile("(\\w+): (\\d+)");
private static Map<String, Integer> parseSue(String spec) {
Matcher specM = specPattern.matcher(spec);
checkState(specM.matches());
String fields = specM.group(2);
Matcher fieldsM = fieldPattern.matcher(fields);
HashMap<String, Integer> acc = new HashMap<>();
while (fieldsM.find()) {
acc.put(fieldsM.group(1), Integer.parseInt(fieldsM.group(2)));
}
return acc;
}
static Map<String, Integer> spec = parseSue("Sue 0: children: 3, cats: 7, samoyeds: 2, pomeranians: 3, akitas: 0, vizslas: 0, goldfish: 5, trees: 3, cars: 2, perfumes: 1");
private static List<Map<String, Integer>> sues = Stream.of(
"Sue 1: cars: 9, akitas: 3, goldfish: 0",
"Sue 2: akitas: 9, children: 3, samoyeds: 9",
"Sue 3: trees: 6, cars: 6, children: 4",
"Sue 4: trees: 4, vizslas: 4, goldfish: 9",
"Sue 5: akitas: 9, vizslas: 7, cars: 5",
"Sue 6: vizslas: 6, goldfish: 6, akitas: 3",
"Sue 7: pomeranians: 5, samoyeds: 0, perfumes: 10",
"Sue 8: cars: 10, pomeranians: 7, goldfish: 8",
"Sue 9: trees: 2, vizslas: 7, samoyeds: 6",
"Sue 10: perfumes: 5, pomeranians: 4, children: 9",
"Sue 11: vizslas: 5, perfumes: 8, cars: 10",
"Sue 12: children: 10, cars: 6, perfumes: 5",
"Sue 13: cats: 4, samoyeds: 7, pomeranians: 8",
"Sue 14: perfumes: 6, goldfish: 10, children: 7",
"Sue 15: perfumes: 4, pomeranians: 3, cars: 6",
"Sue 16: perfumes: 7, cars: 9, pomeranians: 6",
"Sue 17: goldfish: 3, cars: 6, vizslas: 7",
"Sue 18: perfumes: 6, cars: 7, goldfish: 3",
"Sue 19: trees: 0, akitas: 3, pomeranians: 8",
"Sue 20: goldfish: 6, trees: 2, akitas: 6",
"Sue 21: pomeranians: 9, akitas: 9, samoyeds: 9",
"Sue 22: vizslas: 2, cars: 9, perfumes: 5",
"Sue 23: goldfish: 10, samoyeds: 8, children: 9",
"Sue 24: akitas: 4, goldfish: 1, vizslas: 5",
"Sue 25: goldfish: 10, trees: 8, perfumes: 6",
"Sue 26: vizslas: 5, akitas: 8, trees: 1",
"Sue 27: trees: 3, cars: 6, perfumes: 2",
"Sue 28: goldfish: 8, trees: 7, akitas: 10",
"Sue 29: children: 5, trees: 1, goldfish: 10",
"Sue 30: vizslas: 3, perfumes: 8, akitas: 3",
"Sue 31: cars: 6, children: 10, perfumes: 7",
"Sue 32: cars: 10, perfumes: 3, goldfish: 10",
"Sue 33: perfumes: 9, vizslas: 3, akitas: 4",
"Sue 34: perfumes: 10, vizslas: 7, children: 8",
"Sue 35: cars: 5, perfumes: 5, vizslas: 9",
"Sue 36: trees: 9, cars: 9, akitas: 7",
"Sue 37: samoyeds: 9, perfumes: 2, cars: 10",
"Sue 38: akitas: 7, cars: 5, trees: 5",
"Sue 39: goldfish: 8, trees: 9, cars: 10",
"Sue 40: trees: 0, cats: 1, pomeranians: 1",
"Sue 41: pomeranians: 6, perfumes: 9, samoyeds: 1",
"Sue 42: vizslas: 6, akitas: 3, pomeranians: 1",
"Sue 43: vizslas: 2, perfumes: 3, pomeranians: 6",
"Sue 44: akitas: 5, pomeranians: 0, vizslas: 10",
"Sue 45: vizslas: 4, goldfish: 1, cars: 5",
"Sue 46: cars: 4, vizslas: 8, cats: 0",
"Sue 47: cats: 5, children: 8, pomeranians: 2",
"Sue 48: vizslas: 3, perfumes: 6, cats: 0",
"Sue 49: akitas: 7, perfumes: 0, trees: 7",
"Sue 50: trees: 4, akitas: 10, vizslas: 2",
"Sue 51: goldfish: 10, cars: 9, trees: 4",
"Sue 52: cars: 5, children: 9, perfumes: 0",
"Sue 53: vizslas: 5, cars: 3, cats: 8",
"Sue 54: cars: 5, akitas: 1, goldfish: 10",
"Sue 55: akitas: 10, vizslas: 2, cars: 6",
"Sue 56: cats: 6, trees: 0, cars: 4",
"Sue 57: vizslas: 1, akitas: 1, samoyeds: 7",
"Sue 58: samoyeds: 6, vizslas: 1, akitas: 7",
"Sue 59: akitas: 9, cars: 8, vizslas: 1",
"Sue 60: cars: 6, vizslas: 7, goldfish: 0",
"Sue 61: pomeranians: 5, akitas: 6, vizslas: 2",
"Sue 62: samoyeds: 2, cats: 8, goldfish: 7",
"Sue 63: vizslas: 10, goldfish: 7, samoyeds: 9",
"Sue 64: perfumes: 2, trees: 1, akitas: 6",
"Sue 65: cars: 8, perfumes: 10, vizslas: 9",
"Sue 66: akitas: 8, vizslas: 8, perfumes: 8",
"Sue 67: goldfish: 7, cars: 9, samoyeds: 9",
"Sue 68: perfumes: 2, children: 7, akitas: 1",
"Sue 69: perfumes: 7, vizslas: 9, akitas: 1",
"Sue 70: samoyeds: 3, vizslas: 1, trees: 1",
"Sue 71: vizslas: 8, goldfish: 7, trees: 9",
"Sue 72: goldfish: 8, cars: 6, trees: 9",
"Sue 73: perfumes: 5, cars: 10, samoyeds: 7",
"Sue 74: pomeranians: 4, perfumes: 3, cars: 5",
"Sue 75: samoyeds: 1, perfumes: 1, pomeranians: 1",
"Sue 76: goldfish: 4, cats: 6, akitas: 7",
"Sue 77: perfumes: 5, akitas: 4, vizslas: 8",
"Sue 78: perfumes: 4, cats: 3, children: 4",
"Sue 79: vizslas: 5, pomeranians: 9, samoyeds: 7",
"Sue 80: cars: 3, samoyeds: 5, pomeranians: 7",
"Sue 81: vizslas: 2, samoyeds: 4, perfumes: 2",
"Sue 82: trees: 1, akitas: 10, vizslas: 9",
"Sue 83: vizslas: 0, akitas: 2, samoyeds: 5",
"Sue 84: perfumes: 5, vizslas: 7, children: 8",
"Sue 85: cats: 3, children: 2, trees: 0",
"Sue 86: cars: 3, perfumes: 2, goldfish: 2",
"Sue 87: trees: 1, akitas: 7, vizslas: 0",
"Sue 88: trees: 1, akitas: 2, samoyeds: 1",
"Sue 89: cars: 4, vizslas: 8, akitas: 1",
"Sue 90: perfumes: 5, cats: 3, vizslas: 0",
"Sue 91: samoyeds: 7, cats: 6, goldfish: 8",
"Sue 92: samoyeds: 10, cats: 0, cars: 7",
"Sue 93: cars: 6, akitas: 7, samoyeds: 2",
"Sue 94: perfumes: 0, goldfish: 6, trees: 9",
"Sue 95: cars: 6, pomeranians: 2, samoyeds: 8",
"Sue 96: cars: 2, trees: 9, samoyeds: 4",
"Sue 97: goldfish: 5, trees: 1, children: 0",
"Sue 98: akitas: 9, goldfish: 7, children: 6",
"Sue 99: goldfish: 9, akitas: 0, pomeranians: 0",
"Sue 100: samoyeds: 6, children: 8, vizslas: 5",
"Sue 101: vizslas: 6, cars: 5, goldfish: 4",
"Sue 102: vizslas: 6, akitas: 2, perfumes: 6",
"Sue 103: samoyeds: 3, akitas: 7, children: 4",
"Sue 104: cars: 3, perfumes: 10, cats: 6",
"Sue 105: vizslas: 9, pomeranians: 0, cars: 1",
"Sue 106: cats: 6, samoyeds: 8, pomeranians: 5",
"Sue 107: cars: 7, trees: 4, akitas: 10",
"Sue 108: perfumes: 3, vizslas: 1, goldfish: 9",
"Sue 109: trees: 6, cars: 8, goldfish: 5",
"Sue 110: pomeranians: 2, children: 1, vizslas: 7",
"Sue 111: akitas: 0, vizslas: 8, cars: 0",
"Sue 112: goldfish: 3, vizslas: 6, akitas: 2",
"Sue 113: akitas: 10, pomeranians: 7, perfumes: 7",
"Sue 114: cars: 10, cats: 2, vizslas: 8",
"Sue 115: akitas: 8, trees: 1, vizslas: 2",
"Sue 116: vizslas: 2, akitas: 7, perfumes: 1",
"Sue 117: goldfish: 0, vizslas: 10, trees: 9",
"Sue 118: trees: 3, cars: 0, goldfish: 0",
"Sue 119: perfumes: 7, goldfish: 5, trees: 9",
"Sue 120: children: 9, vizslas: 3, trees: 5",
"Sue 121: vizslas: 1, goldfish: 7, akitas: 10",
"Sue 122: perfumes: 1, cars: 6, trees: 1",
"Sue 123: akitas: 2, vizslas: 0, goldfish: 7",
"Sue 124: vizslas: 10, pomeranians: 7, akitas: 0",
"Sue 125: perfumes: 4, cats: 5, vizslas: 2",
"Sue 126: cars: 6, samoyeds: 8, akitas: 3",
"Sue 127: trees: 9, goldfish: 7, akitas: 9",
"Sue 128: cars: 8, trees: 0, perfumes: 2",
"Sue 129: pomeranians: 7, vizslas: 2, perfumes: 6",
"Sue 130: vizslas: 9, pomeranians: 3, trees: 6",
"Sue 131: vizslas: 7, cars: 9, perfumes: 1",
"Sue 132: akitas: 2, pomeranians: 9, vizslas: 7",
"Sue 133: trees: 9, pomeranians: 10, samoyeds: 0",
"Sue 134: children: 4, akitas: 10, perfumes: 4",
"Sue 135: vizslas: 1, cats: 1, trees: 8",
"Sue 136: samoyeds: 7, cars: 8, goldfish: 5",
"Sue 137: perfumes: 0, children: 1, pomeranians: 10",
"Sue 138: vizslas: 4, perfumes: 5, cars: 5",
"Sue 139: trees: 2, perfumes: 8, goldfish: 0",
"Sue 140: cars: 10, akitas: 5, goldfish: 7",
"Sue 141: children: 4, trees: 3, goldfish: 8",
"Sue 142: cars: 8, perfumes: 6, trees: 7",
"Sue 143: akitas: 6, goldfish: 0, trees: 10",
"Sue 144: akitas: 7, pomeranians: 10, perfumes: 10",
"Sue 145: trees: 10, vizslas: 3, goldfish: 4",
"Sue 146: samoyeds: 4, akitas: 3, perfumes: 6",
"Sue 147: akitas: 8, perfumes: 2, pomeranians: 10",
"Sue 148: cars: 2, perfumes: 0, goldfish: 8",
"Sue 149: goldfish: 6, akitas: 7, perfumes: 6",
"Sue 150: cars: 2, pomeranians: 5, perfumes: 4",
"Sue 151: goldfish: 1, cars: 5, trees: 0",
"Sue 152: pomeranians: 4, cars: 7, children: 1",
"Sue 153: goldfish: 8, cars: 1, children: 10",
"Sue 154: cars: 6, perfumes: 8, trees: 1",
"Sue 155: akitas: 4, perfumes: 6, pomeranians: 2",
"Sue 156: pomeranians: 5, cars: 4, akitas: 1",
"Sue 157: cats: 5, cars: 9, goldfish: 8",
"Sue 158: vizslas: 5, samoyeds: 1, children: 7",
"Sue 159: vizslas: 1, perfumes: 3, akitas: 1",
"Sue 160: goldfish: 10, pomeranians: 9, perfumes: 5",
"Sue 161: samoyeds: 3, trees: 7, cars: 2",
"Sue 162: cars: 2, pomeranians: 1, vizslas: 6",
"Sue 163: vizslas: 3, perfumes: 5, akitas: 6",
"Sue 164: vizslas: 1, trees: 0, akitas: 5",
"Sue 165: vizslas: 5, cars: 6, pomeranians: 8",
"Sue 166: cars: 10, perfumes: 2, trees: 9",
"Sue 167: cars: 10, pomeranians: 6, perfumes: 4",
"Sue 168: akitas: 7, trees: 10, goldfish: 7",
"Sue 169: akitas: 1, perfumes: 10, cars: 10",
"Sue 170: akitas: 5, samoyeds: 8, vizslas: 6",
"Sue 171: children: 3, akitas: 2, vizslas: 3",
"Sue 172: goldfish: 5, vizslas: 5, perfumes: 9",
"Sue 173: perfumes: 5, goldfish: 10, trees: 5",
"Sue 174: akitas: 5, vizslas: 2, children: 7",
"Sue 175: perfumes: 5, cars: 7, samoyeds: 2",
"Sue 176: cars: 8, vizslas: 10, akitas: 7",
"Sue 177: perfumes: 7, children: 8, goldfish: 7",
"Sue 178: cars: 1, pomeranians: 9, samoyeds: 0",
"Sue 179: perfumes: 6, cars: 2, trees: 6",
"Sue 180: trees: 3, vizslas: 7, children: 3",
"Sue 181: vizslas: 8, samoyeds: 2, trees: 9",
"Sue 182: perfumes: 3, cats: 1, children: 5",
"Sue 183: akitas: 9, cats: 6, children: 3",
"Sue 184: pomeranians: 9, cars: 6, perfumes: 8",
"Sue 185: vizslas: 9, trees: 0, akitas: 9",
"Sue 186: perfumes: 6, cars: 5, goldfish: 5",
"Sue 187: perfumes: 4, cats: 7, vizslas: 2",
"Sue 188: akitas: 7, cars: 4, children: 10",
"Sue 189: akitas: 0, goldfish: 7, vizslas: 5",
"Sue 190: akitas: 5, cars: 5, cats: 6",
"Sue 191: cars: 6, children: 0, perfumes: 3",
"Sue 192: cats: 2, perfumes: 10, goldfish: 7",
"Sue 193: trees: 1, perfumes: 0, cars: 8",
"Sue 194: perfumes: 9, children: 4, cats: 6",
"Sue 195: akitas: 7, trees: 3, goldfish: 6",
"Sue 196: goldfish: 8, cars: 8, samoyeds: 0",
"Sue 197: cats: 0, akitas: 10, vizslas: 0",
"Sue 198: goldfish: 1, perfumes: 3, cars: 8",
"Sue 199: akitas: 10, vizslas: 5, samoyeds: 6",
"Sue 200: pomeranians: 9, goldfish: 9, samoyeds: 7",
"Sue 201: samoyeds: 0, goldfish: 7, akitas: 6",
"Sue 202: vizslas: 0, goldfish: 2, akitas: 1",
"Sue 203: goldfish: 3, children: 0, vizslas: 8",
"Sue 204: cars: 8, trees: 2, perfumes: 2",
"Sue 205: cars: 4, perfumes: 5, goldfish: 8",
"Sue 206: vizslas: 3, trees: 2, akitas: 1",
"Sue 207: cars: 7, goldfish: 5, trees: 1",
"Sue 208: goldfish: 1, cars: 6, vizslas: 8",
"Sue 209: cats: 4, trees: 1, children: 0",
"Sue 210: cats: 10, children: 0, perfumes: 0",
"Sue 211: cars: 4, pomeranians: 7, samoyeds: 5",
"Sue 212: cars: 2, pomeranians: 10, trees: 1",
"Sue 213: trees: 10, cats: 5, cars: 10",
"Sue 214: perfumes: 5, trees: 1, vizslas: 1",
"Sue 215: akitas: 10, vizslas: 8, samoyeds: 8",
"Sue 216: vizslas: 2, cats: 5, pomeranians: 3",
"Sue 217: akitas: 10, perfumes: 0, cats: 10",
"Sue 218: trees: 8, cats: 5, vizslas: 2",
"Sue 219: goldfish: 10, perfumes: 8, children: 2",
"Sue 220: samoyeds: 9, trees: 8, vizslas: 7",
"Sue 221: children: 7, trees: 6, cars: 6",
"Sue 222: cats: 4, akitas: 5, pomeranians: 0",
"Sue 223: trees: 8, goldfish: 2, perfumes: 8",
"Sue 224: pomeranians: 9, cars: 8, akitas: 5",
"Sue 225: akitas: 10, vizslas: 0, trees: 2",
"Sue 226: akitas: 8, cats: 6, cars: 7",
"Sue 227: trees: 1, akitas: 3, goldfish: 4",
"Sue 228: pomeranians: 6, cats: 3, goldfish: 3",
"Sue 229: trees: 10, perfumes: 3, vizslas: 7",
"Sue 230: perfumes: 8, cars: 7, akitas: 0",
"Sue 231: perfumes: 10, goldfish: 4, cars: 6",
"Sue 232: goldfish: 7, trees: 3, cats: 2",
"Sue 233: perfumes: 6, trees: 4, akitas: 4",
"Sue 234: goldfish: 9, cats: 4, cars: 7",
"Sue 235: pomeranians: 6, vizslas: 0, akitas: 6",
"Sue 236: samoyeds: 5, cars: 5, children: 4",
"Sue 237: vizslas: 10, cars: 4, goldfish: 4",
"Sue 238: goldfish: 3, samoyeds: 7, akitas: 2",
"Sue 239: cats: 8, children: 2, vizslas: 7",
"Sue 240: cars: 9, perfumes: 4, trees: 9",
"Sue 241: trees: 8, vizslas: 2, goldfish: 5",
"Sue 242: cars: 6, trees: 3, vizslas: 3",
"Sue 243: cats: 6, children: 7, cars: 4",
"Sue 244: cats: 10, perfumes: 2, goldfish: 7",
"Sue 245: akitas: 8, cats: 10, perfumes: 8",
"Sue 246: vizslas: 8, akitas: 5, perfumes: 10",
"Sue 247: goldfish: 2, vizslas: 5, akitas: 7",
"Sue 248: akitas: 3, perfumes: 0, trees: 10",
"Sue 249: cats: 4, vizslas: 5, pomeranians: 6",
"Sue 250: children: 3, vizslas: 7, perfumes: 2",
"Sue 251: cars: 0, pomeranians: 10, perfumes: 0",
"Sue 252: akitas: 0, goldfish: 9, cars: 6",
"Sue 253: perfumes: 7, cars: 4, samoyeds: 5",
"Sue 254: akitas: 9, trees: 10, cars: 4",
"Sue 255: samoyeds: 10, children: 6, akitas: 7",
"Sue 256: trees: 8, goldfish: 8, perfumes: 8",
"Sue 257: goldfish: 3, akitas: 2, perfumes: 6",
"Sue 258: cats: 7, trees: 0, vizslas: 1",
"Sue 259: perfumes: 7, cars: 7, akitas: 7",
"Sue 260: goldfish: 0, vizslas: 0, samoyeds: 2",
"Sue 261: vizslas: 2, children: 2, cats: 3",
"Sue 262: vizslas: 2, pomeranians: 9, samoyeds: 3",
"Sue 263: cats: 1, akitas: 3, vizslas: 1",
"Sue 264: pomeranians: 10, trees: 2, goldfish: 7",
"Sue 265: samoyeds: 5, trees: 7, perfumes: 4",
"Sue 266: perfumes: 10, cars: 1, pomeranians: 3",
"Sue 267: trees: 6, goldfish: 1, cars: 0",
"Sue 268: cars: 6, samoyeds: 4, pomeranians: 5",
"Sue 269: goldfish: 3, vizslas: 3, akitas: 3",
"Sue 270: children: 5, cats: 0, cars: 4",
"Sue 271: goldfish: 3, perfumes: 8, pomeranians: 7",
"Sue 272: samoyeds: 6, cars: 7, perfumes: 10",
"Sue 273: trees: 4, cars: 2, vizslas: 7",
"Sue 274: samoyeds: 10, perfumes: 9, goldfish: 6",
"Sue 275: cars: 4, trees: 2, perfumes: 7",
"Sue 276: akitas: 3, perfumes: 9, cars: 9",
"Sue 277: akitas: 8, vizslas: 2, cats: 6",
"Sue 278: trees: 5, goldfish: 7, akitas: 3",
"Sue 279: perfumes: 9, cars: 8, vizslas: 2",
"Sue 280: trees: 3, vizslas: 0, children: 0",
"Sue 281: cars: 7, trees: 2, cats: 5",
"Sue 282: vizslas: 4, cars: 10, cats: 3",
"Sue 283: akitas: 10, cats: 3, samoyeds: 9",
"Sue 284: trees: 7, children: 5, goldfish: 6",
"Sue 285: cars: 2, perfumes: 5, cats: 7",
"Sue 286: samoyeds: 5, trees: 10, goldfish: 6",
"Sue 287: goldfish: 10, perfumes: 4, trees: 7",
"Sue 288: vizslas: 9, trees: 9, perfumes: 0",
"Sue 289: trees: 4, goldfish: 9, vizslas: 8",
"Sue 290: vizslas: 3, cars: 3, trees: 2",
"Sue 291: goldfish: 2, akitas: 2, trees: 2",
"Sue 292: children: 1, cars: 0, vizslas: 5",
"Sue 293: trees: 5, akitas: 4, goldfish: 6",
"Sue 294: akitas: 3, vizslas: 7, pomeranians: 5",
"Sue 295: goldfish: 10, vizslas: 3, trees: 1",
"Sue 296: cars: 2, trees: 1, akitas: 0",
"Sue 297: akitas: 10, vizslas: 6, samoyeds: 2",
"Sue 298: children: 5, trees: 1, samoyeds: 9",
"Sue 299: perfumes: 9, trees: 6, vizslas: 1",
"Sue 300: akitas: 7, pomeranians: 6, vizslas: 6",
"Sue 301: cats: 7, children: 6, vizslas: 7",
"Sue 302: trees: 2, vizslas: 7, samoyeds: 4",
"Sue 303: goldfish: 0, samoyeds: 10, cars: 4",
"Sue 304: pomeranians: 9, children: 3, vizslas: 5",
"Sue 305: akitas: 8, vizslas: 4, cars: 5",
"Sue 306: akitas: 0, perfumes: 2, pomeranians: 10",
"Sue 307: akitas: 9, cars: 0, trees: 2",
"Sue 308: vizslas: 10, goldfish: 8, akitas: 6",
"Sue 309: trees: 0, cats: 6, perfumes: 2",
"Sue 310: vizslas: 10, cars: 1, trees: 4",
"Sue 311: goldfish: 8, perfumes: 6, cats: 3",
"Sue 312: goldfish: 0, children: 1, akitas: 2",
"Sue 313: pomeranians: 10, trees: 6, samoyeds: 6",
"Sue 314: vizslas: 5, akitas: 4, pomeranians: 2",
"Sue 315: goldfish: 7, trees: 0, akitas: 5",
"Sue 316: goldfish: 4, vizslas: 5, cars: 7",
"Sue 317: perfumes: 7, cats: 10, cars: 4",
"Sue 318: samoyeds: 10, cars: 9, trees: 7",
"Sue 319: pomeranians: 8, vizslas: 6, cars: 3",
"Sue 320: cars: 4, cats: 9, akitas: 4",
"Sue 321: cars: 6, trees: 2, perfumes: 6",
"Sue 322: goldfish: 1, cats: 2, perfumes: 4",
"Sue 323: akitas: 6, cats: 5, cars: 8",
"Sue 324: cats: 4, vizslas: 9, akitas: 0",
"Sue 325: children: 8, samoyeds: 9, trees: 4",
"Sue 326: vizslas: 2, samoyeds: 10, perfumes: 7",
"Sue 327: goldfish: 7, pomeranians: 4, akitas: 10",
"Sue 328: perfumes: 8, cats: 4, akitas: 10",
"Sue 329: trees: 0, cars: 9, goldfish: 3",
"Sue 330: trees: 5, samoyeds: 7, perfumes: 8",
"Sue 331: cars: 4, perfumes: 2, goldfish: 0",
"Sue 332: vizslas: 4, pomeranians: 7, akitas: 1",
"Sue 333: akitas: 4, goldfish: 3, perfumes: 0",
"Sue 334: samoyeds: 3, akitas: 10, vizslas: 0",
"Sue 335: goldfish: 1, akitas: 7, vizslas: 6",
"Sue 336: perfumes: 1, goldfish: 1, pomeranians: 8",
"Sue 337: children: 5, cars: 4, cats: 4",
"Sue 338: vizslas: 5, cars: 10, cats: 3",
"Sue 339: trees: 2, goldfish: 3, cars: 1",
"Sue 340: trees: 10, goldfish: 6, perfumes: 2",
"Sue 341: akitas: 5, trees: 6, cats: 3",
"Sue 342: cars: 10, children: 8, goldfish: 0",
"Sue 343: cats: 2, akitas: 0, pomeranians: 4",
"Sue 344: perfumes: 1, vizslas: 3, cars: 3",
"Sue 345: samoyeds: 8, cats: 5, perfumes: 8",
"Sue 346: cars: 5, akitas: 10, trees: 2",
"Sue 347: vizslas: 9, akitas: 9, cars: 3",
"Sue 348: cars: 3, perfumes: 1, pomeranians: 9",
"Sue 349: akitas: 1, cars: 4, perfumes: 0",
"Sue 350: perfumes: 8, vizslas: 2, trees: 6",
"Sue 351: pomeranians: 5, akitas: 9, cats: 8",
"Sue 352: pomeranians: 8, vizslas: 3, goldfish: 10",
"Sue 353: trees: 2, pomeranians: 0, goldfish: 6",
"Sue 354: cats: 5, akitas: 7, goldfish: 6",
"Sue 355: goldfish: 6, children: 4, trees: 10",
"Sue 356: children: 1, trees: 3, akitas: 7",
"Sue 357: trees: 2, samoyeds: 10, goldfish: 3",
"Sue 358: samoyeds: 10, cats: 0, goldfish: 0",
"Sue 359: perfumes: 3, children: 6, pomeranians: 1",
"Sue 360: cars: 10, pomeranians: 1, samoyeds: 5",
"Sue 361: samoyeds: 9, pomeranians: 7, perfumes: 6",
"Sue 362: goldfish: 6, trees: 8, perfumes: 9",
"Sue 363: samoyeds: 10, pomeranians: 9, children: 10",
"Sue 364: perfumes: 3, goldfish: 7, cars: 9",
"Sue 365: cats: 3, children: 4, samoyeds: 8",
"Sue 366: trees: 0, cars: 10, vizslas: 10",
"Sue 367: pomeranians: 10, children: 8, perfumes: 2",
"Sue 368: cars: 5, vizslas: 0, samoyeds: 3",
"Sue 369: trees: 1, goldfish: 8, cars: 8",
"Sue 370: vizslas: 0, cars: 2, perfumes: 5",
"Sue 371: trees: 2, cars: 3, vizslas: 8",
"Sue 372: trees: 10, children: 9, cats: 1",
"Sue 373: pomeranians: 3, perfumes: 1, vizslas: 0",
"Sue 374: vizslas: 0, perfumes: 6, trees: 0",
"Sue 375: vizslas: 7, pomeranians: 1, akitas: 10",
"Sue 376: vizslas: 8, trees: 2, cars: 10",
"Sue 377: perfumes: 9, cats: 5, goldfish: 5",
"Sue 378: cats: 0, akitas: 10, perfumes: 9",
"Sue 379: cars: 4, akitas: 1, trees: 1",
"Sue 380: cars: 4, perfumes: 5, trees: 3",
"Sue 381: goldfish: 3, akitas: 5, samoyeds: 9",
"Sue 382: goldfish: 7, perfumes: 5, trees: 5",
"Sue 383: akitas: 4, cats: 6, cars: 8",
"Sue 384: children: 6, goldfish: 10, akitas: 7",
"Sue 385: akitas: 7, vizslas: 5, perfumes: 10",
"Sue 386: children: 7, vizslas: 10, akitas: 10",
"Sue 387: goldfish: 6, akitas: 7, trees: 2",
"Sue 388: vizslas: 6, trees: 1, akitas: 2",
"Sue 389: cars: 5, vizslas: 3, akitas: 7",
"Sue 390: vizslas: 4, cats: 8, perfumes: 7",
"Sue 391: akitas: 3, trees: 0, children: 2",
"Sue 392: cats: 7, cars: 3, children: 9",
"Sue 393: trees: 10, vizslas: 3, goldfish: 7",
"Sue 394: perfumes: 0, goldfish: 7, akitas: 4",
"Sue 395: cats: 6, cars: 7, vizslas: 0",
"Sue 396: vizslas: 4, perfumes: 6, goldfish: 5",
"Sue 397: pomeranians: 8, trees: 1, akitas: 9",
"Sue 398: goldfish: 7, pomeranians: 6, samoyeds: 9",
"Sue 399: perfumes: 10, cars: 1, trees: 8",
"Sue 400: trees: 0, goldfish: 9, children: 6",
"Sue 401: trees: 1, cars: 6, pomeranians: 8",
"Sue 402: perfumes: 9, cars: 0, vizslas: 10",
"Sue 403: samoyeds: 4, akitas: 1, vizslas: 9",
"Sue 404: perfumes: 0, trees: 2, cars: 4",
"Sue 405: akitas: 0, perfumes: 5, samoyeds: 4",
"Sue 406: akitas: 8, vizslas: 6, children: 2",
"Sue 407: children: 1, trees: 8, goldfish: 10",
"Sue 408: pomeranians: 4, trees: 10, cars: 9",
"Sue 409: perfumes: 5, vizslas: 5, akitas: 4",
"Sue 410: trees: 1, akitas: 10, vizslas: 6",
"Sue 411: samoyeds: 0, goldfish: 9, perfumes: 7",
"Sue 412: goldfish: 7, samoyeds: 10, trees: 1",
"Sue 413: samoyeds: 0, pomeranians: 10, vizslas: 6",
"Sue 414: children: 2, cars: 10, samoyeds: 2",
"Sue 415: trees: 2, goldfish: 8, cars: 0",
"Sue 416: samoyeds: 4, goldfish: 9, trees: 2",
"Sue 417: trees: 8, akitas: 10, perfumes: 3",
"Sue 418: samoyeds: 9, goldfish: 2, cars: 1",
"Sue 419: akitas: 2, perfumes: 8, trees: 2",
"Sue 420: children: 3, goldfish: 6, perfumes: 5",
"Sue 421: akitas: 8, perfumes: 2, samoyeds: 6",
"Sue 422: vizslas: 10, akitas: 4, pomeranians: 3",
"Sue 423: cats: 8, perfumes: 3, trees: 4",
"Sue 424: cars: 2, children: 4, pomeranians: 8",
"Sue 425: pomeranians: 4, samoyeds: 2, goldfish: 4",
"Sue 426: perfumes: 6, cars: 4, goldfish: 4",
"Sue 427: akitas: 0, goldfish: 7, perfumes: 5",
"Sue 428: perfumes: 4, cars: 3, akitas: 5",
"Sue 429: trees: 0, vizslas: 0, goldfish: 1",
"Sue 430: perfumes: 4, vizslas: 2, cars: 7",
"Sue 431: goldfish: 7, pomeranians: 8, trees: 0",
"Sue 432: goldfish: 7, children: 9, trees: 3",
"Sue 433: akitas: 1, vizslas: 10, trees: 2",
"Sue 434: perfumes: 2, cars: 4, goldfish: 10",
"Sue 435: pomeranians: 6, vizslas: 9, trees: 1",
"Sue 436: cars: 9, trees: 0, goldfish: 0",
"Sue 437: trees: 1, goldfish: 1, vizslas: 8",
"Sue 438: goldfish: 7, samoyeds: 8, children: 2",
"Sue 439: children: 1, cats: 7, vizslas: 8",
"Sue 440: cats: 2, pomeranians: 6, goldfish: 4",
"Sue 441: perfumes: 7, cats: 3, vizslas: 6",
"Sue 442: akitas: 4, samoyeds: 5, cars: 2",
"Sue 443: akitas: 3, perfumes: 3, cats: 9",
"Sue 444: perfumes: 10, akitas: 6, trees: 0",
"Sue 445: cars: 5, children: 9, perfumes: 8",
"Sue 446: vizslas: 10, cars: 3, perfumes: 5",
"Sue 447: children: 9, perfumes: 1, cars: 10",
"Sue 448: akitas: 0, goldfish: 8, trees: 3",
"Sue 449: cars: 7, akitas: 8, children: 3",
"Sue 450: cars: 4, akitas: 9, cats: 0",
"Sue 451: perfumes: 4, samoyeds: 5, goldfish: 6",
"Sue 452: perfumes: 10, akitas: 1, cars: 7",
"Sue 453: trees: 1, goldfish: 3, vizslas: 6",
"Sue 454: goldfish: 8, pomeranians: 6, trees: 10",
"Sue 455: akitas: 5, vizslas: 8, goldfish: 10",
"Sue 456: cats: 5, trees: 4, samoyeds: 0",
"Sue 457: perfumes: 8, cars: 0, cats: 3",
"Sue 458: akitas: 1, trees: 10, vizslas: 2",
"Sue 459: vizslas: 6, akitas: 3, children: 10",
"Sue 460: perfumes: 7, trees: 9, goldfish: 8",
"Sue 461: children: 6, vizslas: 4, perfumes: 5",
"Sue 462: vizslas: 6, akitas: 8, perfumes: 9",
"Sue 463: goldfish: 8, cars: 4, trees: 10",
"Sue 464: pomeranians: 8, cars: 5, vizslas: 0",
"Sue 465: cats: 10, goldfish: 7, akitas: 1",
"Sue 466: cats: 2, children: 1, cars: 6",
"Sue 467: perfumes: 3, samoyeds: 6, cars: 0",
"Sue 468: samoyeds: 10, pomeranians: 6, trees: 2",
"Sue 469: children: 2, perfumes: 2, pomeranians: 4",
"Sue 470: cats: 1, perfumes: 5, vizslas: 9",
"Sue 471: vizslas: 5, perfumes: 2, akitas: 7",
"Sue 472: samoyeds: 8, goldfish: 6, cats: 1",
"Sue 473: goldfish: 10, perfumes: 9, cars: 4",
"Sue 474: samoyeds: 0, cars: 4, vizslas: 4",
"Sue 475: trees: 2, cars: 7, akitas: 8",
"Sue 476: vizslas: 3, perfumes: 5, goldfish: 1",
"Sue 477: cats: 7, cars: 4, trees: 1",
"Sue 478: vizslas: 8, akitas: 3, goldfish: 0",
"Sue 479: cars: 6, cats: 3, perfumes: 2",
"Sue 480: goldfish: 1, children: 9, vizslas: 3",
"Sue 481: pomeranians: 5, vizslas: 1, cars: 10",
"Sue 482: children: 5, perfumes: 5, cats: 1",
"Sue 483: perfumes: 2, goldfish: 7, trees: 6",
"Sue 484: akitas: 2, goldfish: 4, perfumes: 10",
"Sue 485: samoyeds: 3, goldfish: 0, akitas: 1",
"Sue 486: trees: 8, vizslas: 9, goldfish: 0",
"Sue 487: goldfish: 8, samoyeds: 0, trees: 0",
"Sue 488: perfumes: 7, cars: 5, trees: 0",
"Sue 489: vizslas: 3, pomeranians: 2, perfumes: 5",
"Sue 490: cars: 5, perfumes: 5, akitas: 5",
"Sue 491: children: 8, trees: 1, pomeranians: 4",
"Sue 492: pomeranians: 0, akitas: 1, vizslas: 8",
"Sue 493: akitas: 10, perfumes: 10, samoyeds: 8",
"Sue 494: perfumes: 6, vizslas: 4, cats: 6",
"Sue 495: children: 6, pomeranians: 5, samoyeds: 4",
"Sue 496: vizslas: 1, trees: 5, akitas: 1",
"Sue 497: vizslas: 10, perfumes: 10, pomeranians: 3",
"Sue 498: samoyeds: 3, trees: 2, cars: 5",
"Sue 499: cats: 6, children: 3, perfumes: 0",
"Sue 500: pomeranians: 10, cats: 3, vizslas: 5"
).map(Y2015D16::parseSue).collect(toList());
}
| [
"Richard.Bradley@softwire.com"
] | Richard.Bradley@softwire.com |
bed3ac636db42ca82c832d3f53cd2f8d0185c49b | 33e6b0f49fc082ca3d26c8007ace823646a1057d | /MapForWms/app/src/main/java/com/gxsn/gaodemapdemo/google/MapsActivity.java | 52221a8b10ebc58e85a3029b16f905d8d3c79941 | [
"MIT"
] | permissive | zkjmyy/Mapwms | de02149ea38f8bdc7daaa59b1716c02de2a66a92 | 391e13a6a3be802bd26383eb8dfa511482ed977a | refs/heads/master | 2021-08-21T20:33:38.322142 | 2017-11-29T01:21:18 | 2017-11-29T01:21:18 | 112,409,451 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,168 | java | package com.gxsn.gaodemapdemo.google;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.gxsn.gaodemapdemo.R;
public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
private GoogleMap mMap;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
/**
* Manipulates the map once available.
* This callback is triggered when the map is ready to be used.
* This is where we can add markers or lines, add listeners or move the camera. In this case,
* we just add a marker near Sydney, Australia.
* If Google Play services is not installed on the device, the user will be prompted to install
* it inside the SupportMapFragment. This method will only be triggered once the user has
* installed Google Play services and returned to the app.
*/
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
// Add a marker in Sydney and move the camera
LatLng sydney = new LatLng(-34, 151);
mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
//google tilelayer 添加的方式;
GoogleHeritageScopeTileProvider tileProvidergoogle = new GoogleHeritageScopeTileProvider();
mMap.addTileOverlay(new com.google.android.gms.maps.model.TileOverlayOptions().tileProvider(tileProvidergoogle));
}
}
| [
"[zkjthinking@foxmail.com]"
] | [zkjthinking@foxmail.com] |
7aaa1cb2f2d917303a66443906823084dc42a1ef | 727e91b524d6de541fe64e77ca205a4f2c3bbf28 | /src/main/java/com/codecool/model/Student.java | 786d57b4a771d102f8fa55c6956e0d7ce3dc1b5c | [] | no_license | CodecoolKRK20173/ccms-ccmsdreamteam | 36d2bf39b08403b45bd439960a4ee114b8f636bb | 04f0ef5bb705e19c281db381abdd866c3ef7b86c | refs/heads/master | 2020-03-30T09:33:18.241834 | 2018-10-02T13:08:06 | 2018-10-02T13:08:06 | 151,080,120 | 0 | 1 | null | 2018-10-02T13:08:08 | 2018-10-01T11:51:18 | Java | UTF-8 | Java | false | false | 68 | java | package com.codecool.model;
public class Student extends Human {
}
| [
"mihuwis@gmail.com"
] | mihuwis@gmail.com |
5cb10f1bb96b783b6fd239160589eb59f66ed89b | 5741045375dcbbafcf7288d65a11c44de2e56484 | /reddit-decompilada/com/twitter/sdk/android/core/internal/scribe/ScribeEventFactory.java | f83451836bfe854aef8d33817833098dd97fe35f | [] | no_license | miarevalo10/ReporteReddit | 18dd19bcec46c42ff933bb330ba65280615c281c | a0db5538e85e9a081bf268cb1590f0eeb113ed77 | refs/heads/master | 2020-03-16T17:42:34.840154 | 2018-05-11T10:16:04 | 2018-05-11T10:16:04 | 132,843,706 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 932 | java | package com.twitter.sdk.android.core.internal.scribe;
import java.util.List;
public class ScribeEventFactory {
public static ScribeEvent m25880a(EventNamespace eventNamespace, String str, long j, String str2, String str3, List<ScribeItem> list) {
Object obj;
String str4 = eventNamespace.f23975a;
if (str4.hashCode() == 114757) {
if (str4.equals("tfw")) {
obj = null;
if (obj == null) {
return new SyndicatedSdkImpressionEvent(eventNamespace, j, str2, str3, list);
}
return new SyndicationClientEvent(eventNamespace, str, j, str2, str3, list);
}
}
obj = -1;
if (obj == null) {
return new SyndicationClientEvent(eventNamespace, str, j, str2, str3, list);
}
return new SyndicatedSdkImpressionEvent(eventNamespace, j, str2, str3, list);
}
}
| [
"mi.arevalo10@uniandes.edu.co"
] | mi.arevalo10@uniandes.edu.co |
813f3b152ca819bae8f371a054500b2d6910fdc4 | 69a8be7c6e9fb9d363e372d8ee13c2653e104287 | /src/main/java/com/example/demo/entity/User.java | e18ed601e360477d7a7ac1a53ed76349d797146f | [] | no_license | l1p1p3088/springboot | dc8feb214ba308f5d7acd5bbc54948283cd931f5 | c74644817e4d3eeced7bb1652e80296e3599c7ed | refs/heads/master | 2020-05-20T11:45:06.828268 | 2019-05-08T07:36:33 | 2019-05-08T07:36:33 | 185,556,515 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 637 | java | package com.example.demo.entity;
public class User {
private int id;
private String name;
private int age;
private String desc;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
| [
"591583054@qq.com"
] | 591583054@qq.com |
59309c49ca44ee72a2736fa5082eba753226a253 | aedd4a32c28a1ee1fcaa644bde2f01b66de5560f | /spring-core/src/test/java/org/springframework/util/comparator/InvertibleComparatorTests.java | b2e9e5aa7f23840952c01d9c22dbb85782d7fa9b | [
"Apache-2.0"
] | permissive | jmgx001/spring-framework-4.3.x | 262bc09fe914f2df7d75bd376aa46cb326d0abe0 | 5051c9f0d1de5c5ce962e55e3259cc5e1116e9d6 | refs/heads/master | 2023-07-13T11:18:35.673302 | 2021-08-12T15:59:07 | 2021-08-12T15:59:07 | 395,353,329 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,524 | java | /*
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.util.comparator;
import java.util.Comparator;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
/**
* Tests for {@link InvertibleComparator}.
*
* @author Keith Donald
* @author Chris Beams
* @author Phillip Webb
*/
public class InvertibleComparatorTests {
private final Comparator<Integer> comparator = new ComparableComparator<>();
@Test(expected = IllegalArgumentException.class)
public void shouldNeedComparator() throws Exception {
new InvertibleComparator<>(null);
}
@Test(expected = IllegalArgumentException.class)
public void shouldNeedComparatorWithAscending() throws Exception {
new InvertibleComparator<>(null, true);
}
@Test
public void shouldDefaultToAscending() throws Exception {
InvertibleComparator<Integer> invertibleComparator = new InvertibleComparator<>(comparator);
assertThat(invertibleComparator.isAscending(), is(true));
assertThat(invertibleComparator.compare(1, 2), is(-1));
}
@Test
public void shouldInvert() throws Exception {
InvertibleComparator<Integer> invertibleComparator = new InvertibleComparator<>(comparator);
assertThat(invertibleComparator.isAscending(), is(true));
assertThat(invertibleComparator.compare(1, 2), is(-1));
invertibleComparator.invertOrder();
assertThat(invertibleComparator.isAscending(), is(false));
assertThat(invertibleComparator.compare(1, 2), is(1));
}
@Test
public void shouldCompareAscending() throws Exception {
InvertibleComparator<Integer> invertibleComparator = new InvertibleComparator<>(comparator, true);
assertThat(invertibleComparator.compare(1, 2), is(-1));
}
@Test
public void shouldCompareDescending() throws Exception {
InvertibleComparator<Integer> invertibleComparator = new InvertibleComparator<>(comparator, false);
assertThat(invertibleComparator.compare(1, 2), is(1));
}
}
| [
"1119459519@qq.com"
] | 1119459519@qq.com |
4a88149455872c0d56a3e593f936f01ff7757036 | 568380c527ba3d8486b06071dddb024674fd5f8a | /SuriBack/src/main/java/com/uos/suribank/auth/JwtAuthenticationFilter.java | f9b853a330eeb9e70ec502a55654bf58dda53c5d | [] | no_license | howtolivelikehuman/SuriBank | 947e28187fb3a0200c5ba07d04b03065ba356d8b | c0c141734013eed970e3e845b8d6ed60d0b3819e | refs/heads/main | 2023-04-09T11:45:00.851989 | 2021-03-13T05:09:31 | 2021-03-13T05:09:31 | 330,595,081 | 1 | 1 | null | 2021-04-23T08:32:34 | 2021-01-18T08:02:38 | Java | UTF-8 | Java | false | false | 1,425 | java | package com.uos.suribank.auth;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.filter.GenericFilterBean;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
@RequiredArgsConstructor
public class JwtAuthenticationFilter extends GenericFilterBean {
private final JwtTokenProvider jwtTokenProvider;
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
// 헤더에서 JWT 를 받아옵니다.
String token = jwtTokenProvider.resolveToken((HttpServletRequest) request);
// 유효한 토큰인지 확인합니다.
if (token != null && jwtTokenProvider.validateToken(token)) {
// 토큰이 유효하면 토큰으로부터 유저 정보를 받아옵니다.
Authentication authentication = jwtTokenProvider.getAuthentication(token);
// SecurityContext 에 Authentication 객체를 저장합니다.
SecurityContextHolder.getContext().setAuthentication(authentication);
}
chain.doFilter(request, response);
}
}
| [
"yoicch19@gmail.com"
] | yoicch19@gmail.com |
ec988ba754e33875ff09b8b236e8903bf8b91b64 | d238a605278ac72cc09e86d223040c41fd8ecfa2 | /src/main/java/io/nem/apps/util/AppPropertiesUtil.java | e8ddacbc83f67467170a7b837bc0c6f690ba5bee | [
"MIT"
] | permissive | phuongdo/nem-apps-lib | b493081a905fb93ed92f09611827c5de39c50e63 | 6b6784eeb0b38ba9b9e4c2279591ca0470d18e6e | refs/heads/master | 2020-03-11T15:47:57.570134 | 2018-05-16T16:40:48 | 2018-05-16T16:40:48 | 130,096,409 | 0 | 0 | null | 2018-04-18T17:08:58 | 2018-04-18T17:08:58 | null | UTF-8 | Java | false | false | 604 | java | package io.nem.apps.util;
import java.io.IOException;
import java.util.Properties;
/**
* The Class AppPropertiesUtil.
*/
public class AppPropertiesUtil {
/** The properties. */
static Properties properties = new Properties();
static {
try {
properties.load(AppPropertiesUtil.class.getClassLoader().getResourceAsStream("app.properties"));
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Gets the property.
*
* @param key
* the key
* @return the property
*/
public static String getProperty(String key) {
return properties.getProperty(key);
}
}
| [
"areyes@piosoft.org"
] | areyes@piosoft.org |
29b110566232f336347cd71fbb5d074e13d93aa2 | a5c3531bc53dc322a79541d5ab89d6bf5681c961 | /aic-praise-read-only/src/main/java/com/sri/ai/praise/lbp/core/AbstractLBPHierarchicalRewriter.java | 983bc00fe50a52801c92cdb2f09e985453a1c67a | [] | no_license | Git-xfff/aic-praise | 90a6171f51b707bf5b718ed7c9537d8616f0c84f | bc0585e83dfa28856950fce3985ca5f9257259a6 | refs/heads/master | 2021-05-28T09:29:33.769586 | 2015-02-25T21:25:53 | 2015-02-25T21:25:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,261 | java | /*
* Copyright (c) 2013, SRI International
* All rights reserved.
* Licensed under the The BSD 3-Clause License;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://opensource.org/licenses/BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of the aic-praise nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.sri.ai.praise.lbp.core;
import com.google.common.annotations.Beta;
import com.sri.ai.grinder.core.AbstractHierarchicalRewriter;
import com.sri.ai.praise.lbp.LBPRewriter;
/**
* A abstract class to be extended by implementations of {@link LBPRewriter}s.
*
* @author oreilly
*
*/
@Beta
public abstract class AbstractLBPHierarchicalRewriter extends AbstractHierarchicalRewriter implements LBPRewriter {
}
| [
"piotrm@gmail.com"
] | piotrm@gmail.com |
d666f47af43bdfaad9da83942dde6ed6ffb67827 | aa9c02ef5b9e15ff25be6debdd7e4b80a42354bf | /src/main/java/hello/hellospring/controller/HelloController.java | 83fd4b84359a09750dc6185f7c04af15cdc747c0 | [] | no_license | jnlee1112/hello-spring | a636daf050122d512c8ffa8402aad3ad51f964e5 | 3188be142b810fdacbbfdfe30ebc9f704228c720 | refs/heads/master | 2023-06-12T12:27:28.166050 | 2021-07-05T14:36:01 | 2021-07-05T14:36:01 | 383,170,518 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 443 | java | package hello.hellospring.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class HelloController {
@GetMapping("hello") //url Get방식
public String hello(Model model) {
model.addAttribute("data", "spring!");
return "hello";
// templates/hello.html Thymeleaf템플릿 엔진 처리(viewResolver)
}
}
| [
"jnlee1112@gmail.com"
] | jnlee1112@gmail.com |
4dfb8e6ffeed078994e77fb3529fa2ae9c82e87b | 56fad12308bc549dee43f19aafb41bf31b497fad | /Programing/SampleGame/app/src/androidTest/java/kr/ac/kpu/game/s2016182041/samplegame/ExampleInstrumentedTest.java | bccf31e089ac3866b9b33db4363a99e5ae5f9586 | [] | no_license | Eva-go/PhoneGamePrograming | 817dae4daf4ae44b5c3c68f67ff4b261a26ca454 | 544427932fbb4cc3782a26b456aa974f77dbd111 | refs/heads/master | 2023-05-27T03:35:06.530779 | 2021-06-10T19:01:38 | 2021-06-10T19:01:38 | 349,117,547 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 788 | java | package kr.ac.kpu.game.s2016182041.samplegame;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("kr.ac.kpu.game.s2016182041.samplegame", appContext.getPackageName());
}
} | [
"jkyu6554@kpu.ac.kr"
] | jkyu6554@kpu.ac.kr |
4adfd582c146fb2547bb0ccf5490d49ceba8cf60 | ba643ef9a91d0a7151d44c6014b6939671a272af | /src/editor/SimulateRegExpr.java | 5597f2bcc5cdc17f28d03a50b234c52e52f44b3a | [] | no_license | gagan144/CompilerAutomationTool | 9eab3ae89d36bffe957b8e673ca11667dfb50047 | 4417ce97fd780e9ed907d2ff1ec5195193c24fcf | refs/heads/master | 2020-08-03T08:04:12.498809 | 2019-09-29T16:50:38 | 2019-09-29T16:50:38 | 211,677,055 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,693 | java | package editor;
import commanLib.GraphNode;
import java.awt.Color;
import java.util.ArrayList;
import javax.swing.table.DefaultTableModel;
public class SimulateRegExpr extends javax.swing.JPanel {
private GraphNode dfa=null;
private boolean setChk;
//private GraphNode last=null;
private ArrayList<GraphNode> accStates = new ArrayList<GraphNode>();
public SimulateRegExpr() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
textF_str = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
lbl_intSt = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
tableSim = new javax.swing.JTable();
lbl_accSt = new javax.swing.JLabel();
lbl_fnlSt = new javax.swing.JLabel();
lbl_remark = new javax.swing.JLabel();
setPreferredSize(new java.awt.Dimension(500, 400));
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Test Case", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.TOP, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 51, 255))); // NOI18N
jLabel1.setText("Enter String :");
textF_str.setFont(new java.awt.Font("Courier New", 0, 12)); // NOI18N
jButton1.setText("Simulate");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(textF_str)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton1))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(textF_str, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1)
.addComponent(jButton1))
);
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Simulation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.TOP, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 51, 255))); // NOI18N
lbl_intSt.setForeground(new java.awt.Color(0, 51, 204));
lbl_intSt.setText("Initial State :");
tableSim.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Input", "Next State"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class
};
boolean[] canEdit = new boolean [] {
false, true
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
tableSim.getTableHeader().setReorderingAllowed(false);
jScrollPane1.setViewportView(tableSim);
tableSim.getColumnModel().getColumn(0).setResizable(false);
tableSim.getColumnModel().getColumn(1).setResizable(false);
lbl_accSt.setForeground(new java.awt.Color(0, 102, 51));
lbl_accSt.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
lbl_accSt.setText("Accepting State(s) :");
lbl_fnlSt.setForeground(new java.awt.Color(255, 102, 0));
lbl_fnlSt.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
lbl_fnlSt.setText("Final State : ");
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(20, 20, 20)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(lbl_fnlSt, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(lbl_intSt, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 49, Short.MAX_VALUE)
.addComponent(lbl_accSt, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
.addGap(26, 26, 26))))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lbl_intSt, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lbl_accSt))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lbl_fnlSt)
.addContainerGap())
);
lbl_remark.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
lbl_remark.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
lbl_remark.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Remark", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.TOP, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 51, 255))); // NOI18N
lbl_remark.setPreferredSize(new java.awt.Dimension(38, 20));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lbl_remark, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lbl_remark, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE))
);
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
String text=textF_str.getText();
int bar=0,inc=0;
CATModeler.setMessages("Simulating String : "+text+" ...","Simulating...",bar);
inc=(100/(text.length()+1));
char c;
resetTable();
DefaultTableModel model=(DefaultTableModel)tableSim.getModel();
if(text.equals(""))
{ text=" "; }
else if(CATModeler.data.isKeyword(text))
{
model.addRow(new Object[]{text,"Terminated! Keyword found!"});
lbl_fnlSt.setText("Final State : Terminated");
lbl_remark.setForeground(Color.red);
lbl_remark.setText("NOT Accepted");
CATModeler.setMessages("Done!","Simulating...Done!",100);
return;
}
GraphNode ptr=dfa,reachedSt=null;
for(int i=0;i<text.length();i++)
{
c=text.charAt(i);
if(c==' ' && i==0)
{
reachedSt=ptr;
model.addRow(new Object[]{c,"Finished"});
break;
}
ptr=ptr.getNextState(c,setChk,CATModeler.data);
if(ptr==null)
{
reachedSt=ptr;
model.addRow(new Object[]{c,"Terminated"});
break;
}
else
{
reachedSt=ptr;
model.addRow(new Object[]{c,ptr.lb});
}
bar=bar+inc;
CATModeler.setMessages(null,null,bar);
}
if(reachedSt!=null)
{
lbl_fnlSt.setText("Final State : "+reachedSt.lb);
//if(last.lb.equals(reachedSt.lb))
if(accStates.contains(reachedSt))
{
lbl_remark.setForeground(new Color(7, 131, 45));
lbl_remark.setText("Accepted");
}else
{
lbl_remark.setForeground(Color.red);
lbl_remark.setText("NOT Accepted");
}
}
else
{
lbl_fnlSt.setText("Final State : Terminated");
lbl_remark.setForeground(Color.red);
lbl_remark.setText("NOT Accepted");
}
CATModeler.setMessages("Done!","Simulating...Done!",100);
}//GEN-LAST:event_jButton1ActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JLabel lbl_accSt;
private javax.swing.JLabel lbl_fnlSt;
private javax.swing.JLabel lbl_intSt;
private javax.swing.JLabel lbl_remark;
private javax.swing.JTable tableSim;
private javax.swing.JTextField textF_str;
// End of variables declaration//GEN-END:variables
public void getRefrence(GraphNode d,boolean stChk)
{
dfa=d;
setChk=stChk;
//get initial & accepting states
GraphNode ptr=dfa;
lbl_intSt.setText("Initial State : "+ptr.lb);
int cnt=0;
while(ptr!=null)
{
if(ptr.state=='F' || ptr.state=='*') //Identification of accepting states
{ accStates.add(cnt,ptr); cnt++; }
ptr=ptr.nextSt;
}
//last=ptr;
//set label in GUI
String St="";
for(int i=0;i<cnt;i++)
{
St+=accStates.get(i).lb;
if(accStates.get(i).state=='*')
{St+='*'; }
if(i!=cnt-1)
{ St+=", "; }
}
lbl_accSt.setText("Accepting State(s) : "+St);
}
private void resetTable()
{
tableSim = new javax.swing.JTable();
tableSim.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Input", "Next State"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class
};
boolean[] canEdit = new boolean [] {
false, true
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
tableSim.getTableHeader().setReorderingAllowed(false);
jScrollPane1.setViewportView(tableSim);
tableSim.getColumnModel().getColumn(0).setResizable(false);
tableSim.getColumnModel().getColumn(1).setResizable(false);
}
}
| [
"singh.gagan144@gmail.com"
] | singh.gagan144@gmail.com |
bfd6047e98bd747978ba3a2a7da004a4384a42d0 | 0013c3d0f81f8874897812bee9bad942a26b046a | /qrextract/src/main/java/com/component/spider/controller/ExtractController.java | 3a84f8b994a473d0761e799c90ac2cb60fae7bbc | [] | no_license | haoziapple/fast_reaper | 1ad9a6fb6ef19a0b913ded589c1c64fcb90c7e18 | 00e9ea162ddc95bc824efc7af886a23c50ad61aa | refs/heads/master | 2022-07-14T19:23:02.797538 | 2019-12-24T01:32:00 | 2019-12-24T01:32:00 | 138,585,437 | 1 | 0 | null | 2022-06-21T02:25:47 | 2018-06-25T11:24:56 | Vue | UTF-8 | Java | false | false | 1,157 | java | package com.component.spider.controller;
import com.component.spider.service.ExtractService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* Created by ASUS on 2018/5/10.
*/
@RestController
@RequestMapping("/extract")
public class ExtractController {
@Autowired
private ExtractService extractService;
private static final Logger log = LoggerFactory.getLogger(ExtractController.class);
@RequestMapping(value = "/staticHtml", method = RequestMethod.GET)
public ActionResult<Map<String, String>> staticHtml(@RequestParam("url") String url) {
log.debug("try to extract url:" + url);
Map<String, String> resultMap = extractService.extract(url);
log.debug("extract map:" + resultMap);
return new ActionResult<>(resultMap);
}
}
| [
"haozixiaowang@163.com"
] | haozixiaowang@163.com |
cd6f8970f8b709764f2fa0a6282c407b1c836030 | 542dad1f1b2fc7c44d560008dbc8ca3d2c181d70 | /src/main/java/com/aop/AoPdemoApplication.java | 9fc880e8f14ac18a74f7ea0211d18d378ed6541a | [] | no_license | shanmukhchandrasekhar/Spring-AOP | 7e7082af4dc86c1e842becd5d20f79fdd5130791 | 02db1b5ac8fb1c03cab4467aee2b6e46127f468f | refs/heads/master | 2022-12-28T20:32:00.428874 | 2020-10-18T21:52:31 | 2020-10-18T21:52:31 | 303,323,540 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 302 | java | package com.aop;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class AoPdemoApplication {
public static void main(String[] args) {
SpringApplication.run(AoPdemoApplication.class, args);
}
}
| [
"shanmukh.030@gmail.com"
] | shanmukh.030@gmail.com |
dafb31b88e22253adc08c54c4f5002f2880d07fe | 1253083db533225859b52bc71f60455e981de2bb | /app/src/main/java/com/oum/e_commerceapp/adapter/ProductAdapter.java | f7b2b155d813445fae8ac41aa24e90a66d2f6b2b | [] | no_license | ikhwan92/ECommerceApp-master | eeb76252478fa9d146962f7bba350558637632da | df3876e392149b3f8fa0845da8b29a80f5df1555 | refs/heads/master | 2021-04-09T13:10:39.972949 | 2018-03-16T08:44:01 | 2018-03-16T08:44:01 | 125,488,526 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,978 | java | package com.oum.e_commerceapp.adapter;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.oum.e_commerceapp.R;
import com.oum.e_commerceapp.modal.ProductDomain;
import java.util.ArrayList;
/**
* Created by seqato on 15/03/18.
*/
public class ProductAdapter extends BaseAdapter {
ArrayList<ProductDomain> productList;
LayoutInflater layoutInflater;
Context context;
public ProductAdapter(ArrayList<ProductDomain> productDomainArrayList,Context context) {
this.productList=productDomainArrayList;
this.context = context;
}
public int getCount() {
// TODO Auto-generated method stub
return productList.size();
}
public Object getItem(int arg0) {
// TODO Auto-generated method stub
return null;
}
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
LayoutInflater mInflater = (LayoutInflater) context
.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
convertView = mInflater.inflate(R.layout.product_list, null);
}
TextView title = (TextView) convertView.findViewById(R.id.category_name);
TextView pricetxt = (TextView) convertView.findViewById(R.id.price);
ImageView img=(ImageView)convertView.findViewById(R.id.flag);
// setting the image resource and title
title.setText(productList.get(position).getProductName());
pricetxt.setText(productList.get(position).getProductPrice());
img.setImageResource(productList.get(position).getImageId());
return convertView;
}
}
| [
"ikhwan92"
] | ikhwan92 |
9d14fb690a75f190a472265fb6142d4f94a8a270 | 916ead69441036043ce3c261241ce3f9228357e9 | /app/build/generated/source/r/debug/android/support/constraint/R.java | 97e4fcc7adb2868eb3e375db86a1b16c2a2dbadb | [] | no_license | TextToShihab/Codee | 83311a0003145a2a66d838257be9b8d7e3dc3662 | a1e0278153ea1d2e07b5c53335e028daf5fe93f3 | refs/heads/master | 2020-04-09T08:35:02.563766 | 2018-12-03T14:25:14 | 2018-12-03T14:25:14 | 160,199,813 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,797 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.constraint;
public final class R {
public static final class attr {
public static final int barrierAllowsGoneWidgets = 0x7f020037;
public static final int barrierDirection = 0x7f020038;
public static final int chainUseRtl = 0x7f020045;
public static final int constraintSet = 0x7f020058;
public static final int constraint_referenced_ids = 0x7f020059;
public static final int content = 0x7f02005a;
public static final int emptyVisibility = 0x7f020074;
public static final int layout_constrainedHeight = 0x7f020090;
public static final int layout_constrainedWidth = 0x7f020091;
public static final int layout_constraintBaseline_creator = 0x7f020092;
public static final int layout_constraintBaseline_toBaselineOf = 0x7f020093;
public static final int layout_constraintBottom_creator = 0x7f020094;
public static final int layout_constraintBottom_toBottomOf = 0x7f020095;
public static final int layout_constraintBottom_toTopOf = 0x7f020096;
public static final int layout_constraintCircle = 0x7f020097;
public static final int layout_constraintCircleAngle = 0x7f020098;
public static final int layout_constraintCircleRadius = 0x7f020099;
public static final int layout_constraintDimensionRatio = 0x7f02009a;
public static final int layout_constraintEnd_toEndOf = 0x7f02009b;
public static final int layout_constraintEnd_toStartOf = 0x7f02009c;
public static final int layout_constraintGuide_begin = 0x7f02009d;
public static final int layout_constraintGuide_end = 0x7f02009e;
public static final int layout_constraintGuide_percent = 0x7f02009f;
public static final int layout_constraintHeight_default = 0x7f0200a0;
public static final int layout_constraintHeight_max = 0x7f0200a1;
public static final int layout_constraintHeight_min = 0x7f0200a2;
public static final int layout_constraintHeight_percent = 0x7f0200a3;
public static final int layout_constraintHorizontal_bias = 0x7f0200a4;
public static final int layout_constraintHorizontal_chainStyle = 0x7f0200a5;
public static final int layout_constraintHorizontal_weight = 0x7f0200a6;
public static final int layout_constraintLeft_creator = 0x7f0200a7;
public static final int layout_constraintLeft_toLeftOf = 0x7f0200a8;
public static final int layout_constraintLeft_toRightOf = 0x7f0200a9;
public static final int layout_constraintRight_creator = 0x7f0200aa;
public static final int layout_constraintRight_toLeftOf = 0x7f0200ab;
public static final int layout_constraintRight_toRightOf = 0x7f0200ac;
public static final int layout_constraintStart_toEndOf = 0x7f0200ad;
public static final int layout_constraintStart_toStartOf = 0x7f0200ae;
public static final int layout_constraintTop_creator = 0x7f0200af;
public static final int layout_constraintTop_toBottomOf = 0x7f0200b0;
public static final int layout_constraintTop_toTopOf = 0x7f0200b1;
public static final int layout_constraintVertical_bias = 0x7f0200b2;
public static final int layout_constraintVertical_chainStyle = 0x7f0200b3;
public static final int layout_constraintVertical_weight = 0x7f0200b4;
public static final int layout_constraintWidth_default = 0x7f0200b5;
public static final int layout_constraintWidth_max = 0x7f0200b6;
public static final int layout_constraintWidth_min = 0x7f0200b7;
public static final int layout_constraintWidth_percent = 0x7f0200b8;
public static final int layout_editor_absoluteX = 0x7f0200b9;
public static final int layout_editor_absoluteY = 0x7f0200ba;
public static final int layout_goneMarginBottom = 0x7f0200bb;
public static final int layout_goneMarginEnd = 0x7f0200bc;
public static final int layout_goneMarginLeft = 0x7f0200bd;
public static final int layout_goneMarginRight = 0x7f0200be;
public static final int layout_goneMarginStart = 0x7f0200bf;
public static final int layout_goneMarginTop = 0x7f0200c0;
public static final int layout_optimizationLevel = 0x7f0200c1;
}
public static final class id {
public static final int barrier = 0x7f07001e;
public static final int bottom = 0x7f070021;
public static final int chains = 0x7f070024;
public static final int dimensions = 0x7f07002d;
public static final int direct = 0x7f07002e;
public static final int end = 0x7f070031;
public static final int gone = 0x7f070036;
public static final int invisible = 0x7f07003e;
public static final int left = 0x7f070040;
public static final int none = 0x7f07004f;
public static final int packed = 0x7f070054;
public static final int parent = 0x7f070055;
public static final int percent = 0x7f070057;
public static final int right = 0x7f07005b;
public static final int spread = 0x7f070073;
public static final int spread_inside = 0x7f070074;
public static final int standard = 0x7f070078;
public static final int start = 0x7f070079;
public static final int top = 0x7f070086;
public static final int wrap = 0x7f07008c;
}
public static final class styleable {
public static final int[] ConstraintLayout_Layout = { 0x010100c4, 0x0101011f, 0x01010120, 0x0101013f, 0x01010140, 0x7f020037, 0x7f020038, 0x7f020045, 0x7f020058, 0x7f020059, 0x7f020090, 0x7f020091, 0x7f020092, 0x7f020093, 0x7f020094, 0x7f020095, 0x7f020096, 0x7f020097, 0x7f020098, 0x7f020099, 0x7f02009a, 0x7f02009b, 0x7f02009c, 0x7f02009d, 0x7f02009e, 0x7f02009f, 0x7f0200a0, 0x7f0200a1, 0x7f0200a2, 0x7f0200a3, 0x7f0200a4, 0x7f0200a5, 0x7f0200a6, 0x7f0200a7, 0x7f0200a8, 0x7f0200a9, 0x7f0200aa, 0x7f0200ab, 0x7f0200ac, 0x7f0200ad, 0x7f0200ae, 0x7f0200af, 0x7f0200b0, 0x7f0200b1, 0x7f0200b2, 0x7f0200b3, 0x7f0200b4, 0x7f0200b5, 0x7f0200b6, 0x7f0200b7, 0x7f0200b8, 0x7f0200b9, 0x7f0200ba, 0x7f0200bb, 0x7f0200bc, 0x7f0200bd, 0x7f0200be, 0x7f0200bf, 0x7f0200c0, 0x7f0200c1 };
public static final int ConstraintLayout_Layout_android_orientation = 0;
public static final int ConstraintLayout_Layout_android_maxWidth = 1;
public static final int ConstraintLayout_Layout_android_maxHeight = 2;
public static final int ConstraintLayout_Layout_android_minWidth = 3;
public static final int ConstraintLayout_Layout_android_minHeight = 4;
public static final int ConstraintLayout_Layout_barrierAllowsGoneWidgets = 5;
public static final int ConstraintLayout_Layout_barrierDirection = 6;
public static final int ConstraintLayout_Layout_chainUseRtl = 7;
public static final int ConstraintLayout_Layout_constraintSet = 8;
public static final int ConstraintLayout_Layout_constraint_referenced_ids = 9;
public static final int ConstraintLayout_Layout_layout_constrainedHeight = 10;
public static final int ConstraintLayout_Layout_layout_constrainedWidth = 11;
public static final int ConstraintLayout_Layout_layout_constraintBaseline_creator = 12;
public static final int ConstraintLayout_Layout_layout_constraintBaseline_toBaselineOf = 13;
public static final int ConstraintLayout_Layout_layout_constraintBottom_creator = 14;
public static final int ConstraintLayout_Layout_layout_constraintBottom_toBottomOf = 15;
public static final int ConstraintLayout_Layout_layout_constraintBottom_toTopOf = 16;
public static final int ConstraintLayout_Layout_layout_constraintCircle = 17;
public static final int ConstraintLayout_Layout_layout_constraintCircleAngle = 18;
public static final int ConstraintLayout_Layout_layout_constraintCircleRadius = 19;
public static final int ConstraintLayout_Layout_layout_constraintDimensionRatio = 20;
public static final int ConstraintLayout_Layout_layout_constraintEnd_toEndOf = 21;
public static final int ConstraintLayout_Layout_layout_constraintEnd_toStartOf = 22;
public static final int ConstraintLayout_Layout_layout_constraintGuide_begin = 23;
public static final int ConstraintLayout_Layout_layout_constraintGuide_end = 24;
public static final int ConstraintLayout_Layout_layout_constraintGuide_percent = 25;
public static final int ConstraintLayout_Layout_layout_constraintHeight_default = 26;
public static final int ConstraintLayout_Layout_layout_constraintHeight_max = 27;
public static final int ConstraintLayout_Layout_layout_constraintHeight_min = 28;
public static final int ConstraintLayout_Layout_layout_constraintHeight_percent = 29;
public static final int ConstraintLayout_Layout_layout_constraintHorizontal_bias = 30;
public static final int ConstraintLayout_Layout_layout_constraintHorizontal_chainStyle = 31;
public static final int ConstraintLayout_Layout_layout_constraintHorizontal_weight = 32;
public static final int ConstraintLayout_Layout_layout_constraintLeft_creator = 33;
public static final int ConstraintLayout_Layout_layout_constraintLeft_toLeftOf = 34;
public static final int ConstraintLayout_Layout_layout_constraintLeft_toRightOf = 35;
public static final int ConstraintLayout_Layout_layout_constraintRight_creator = 36;
public static final int ConstraintLayout_Layout_layout_constraintRight_toLeftOf = 37;
public static final int ConstraintLayout_Layout_layout_constraintRight_toRightOf = 38;
public static final int ConstraintLayout_Layout_layout_constraintStart_toEndOf = 39;
public static final int ConstraintLayout_Layout_layout_constraintStart_toStartOf = 40;
public static final int ConstraintLayout_Layout_layout_constraintTop_creator = 41;
public static final int ConstraintLayout_Layout_layout_constraintTop_toBottomOf = 42;
public static final int ConstraintLayout_Layout_layout_constraintTop_toTopOf = 43;
public static final int ConstraintLayout_Layout_layout_constraintVertical_bias = 44;
public static final int ConstraintLayout_Layout_layout_constraintVertical_chainStyle = 45;
public static final int ConstraintLayout_Layout_layout_constraintVertical_weight = 46;
public static final int ConstraintLayout_Layout_layout_constraintWidth_default = 47;
public static final int ConstraintLayout_Layout_layout_constraintWidth_max = 48;
public static final int ConstraintLayout_Layout_layout_constraintWidth_min = 49;
public static final int ConstraintLayout_Layout_layout_constraintWidth_percent = 50;
public static final int ConstraintLayout_Layout_layout_editor_absoluteX = 51;
public static final int ConstraintLayout_Layout_layout_editor_absoluteY = 52;
public static final int ConstraintLayout_Layout_layout_goneMarginBottom = 53;
public static final int ConstraintLayout_Layout_layout_goneMarginEnd = 54;
public static final int ConstraintLayout_Layout_layout_goneMarginLeft = 55;
public static final int ConstraintLayout_Layout_layout_goneMarginRight = 56;
public static final int ConstraintLayout_Layout_layout_goneMarginStart = 57;
public static final int ConstraintLayout_Layout_layout_goneMarginTop = 58;
public static final int ConstraintLayout_Layout_layout_optimizationLevel = 59;
public static final int[] ConstraintLayout_placeholder = { 0x7f02005a, 0x7f020074 };
public static final int ConstraintLayout_placeholder_content = 0;
public static final int ConstraintLayout_placeholder_emptyVisibility = 1;
public static final int[] ConstraintSet = { 0x010100c4, 0x010100d0, 0x010100dc, 0x010100f4, 0x010100f5, 0x010100f7, 0x010100f8, 0x010100f9, 0x010100fa, 0x0101031f, 0x01010320, 0x01010321, 0x01010322, 0x01010323, 0x01010324, 0x01010325, 0x01010326, 0x01010327, 0x01010328, 0x010103b5, 0x010103b6, 0x010103fa, 0x01010440, 0x7f020090, 0x7f020091, 0x7f020092, 0x7f020093, 0x7f020094, 0x7f020095, 0x7f020096, 0x7f020097, 0x7f020098, 0x7f020099, 0x7f02009a, 0x7f02009b, 0x7f02009c, 0x7f02009d, 0x7f02009e, 0x7f02009f, 0x7f0200a0, 0x7f0200a1, 0x7f0200a2, 0x7f0200a3, 0x7f0200a4, 0x7f0200a5, 0x7f0200a6, 0x7f0200a7, 0x7f0200a8, 0x7f0200a9, 0x7f0200aa, 0x7f0200ab, 0x7f0200ac, 0x7f0200ad, 0x7f0200ae, 0x7f0200af, 0x7f0200b0, 0x7f0200b1, 0x7f0200b2, 0x7f0200b3, 0x7f0200b4, 0x7f0200b5, 0x7f0200b6, 0x7f0200b7, 0x7f0200b8, 0x7f0200b9, 0x7f0200ba, 0x7f0200bb, 0x7f0200bc, 0x7f0200bd, 0x7f0200be, 0x7f0200bf, 0x7f0200c0 };
public static final int ConstraintSet_android_orientation = 0;
public static final int ConstraintSet_android_id = 1;
public static final int ConstraintSet_android_visibility = 2;
public static final int ConstraintSet_android_layout_width = 3;
public static final int ConstraintSet_android_layout_height = 4;
public static final int ConstraintSet_android_layout_marginLeft = 5;
public static final int ConstraintSet_android_layout_marginTop = 6;
public static final int ConstraintSet_android_layout_marginRight = 7;
public static final int ConstraintSet_android_layout_marginBottom = 8;
public static final int ConstraintSet_android_alpha = 9;
public static final int ConstraintSet_android_transformPivotX = 10;
public static final int ConstraintSet_android_transformPivotY = 11;
public static final int ConstraintSet_android_translationX = 12;
public static final int ConstraintSet_android_translationY = 13;
public static final int ConstraintSet_android_scaleX = 14;
public static final int ConstraintSet_android_scaleY = 15;
public static final int ConstraintSet_android_rotation = 16;
public static final int ConstraintSet_android_rotationX = 17;
public static final int ConstraintSet_android_rotationY = 18;
public static final int ConstraintSet_android_layout_marginStart = 19;
public static final int ConstraintSet_android_layout_marginEnd = 20;
public static final int ConstraintSet_android_translationZ = 21;
public static final int ConstraintSet_android_elevation = 22;
public static final int ConstraintSet_layout_constrainedHeight = 23;
public static final int ConstraintSet_layout_constrainedWidth = 24;
public static final int ConstraintSet_layout_constraintBaseline_creator = 25;
public static final int ConstraintSet_layout_constraintBaseline_toBaselineOf = 26;
public static final int ConstraintSet_layout_constraintBottom_creator = 27;
public static final int ConstraintSet_layout_constraintBottom_toBottomOf = 28;
public static final int ConstraintSet_layout_constraintBottom_toTopOf = 29;
public static final int ConstraintSet_layout_constraintCircle = 30;
public static final int ConstraintSet_layout_constraintCircleAngle = 31;
public static final int ConstraintSet_layout_constraintCircleRadius = 32;
public static final int ConstraintSet_layout_constraintDimensionRatio = 33;
public static final int ConstraintSet_layout_constraintEnd_toEndOf = 34;
public static final int ConstraintSet_layout_constraintEnd_toStartOf = 35;
public static final int ConstraintSet_layout_constraintGuide_begin = 36;
public static final int ConstraintSet_layout_constraintGuide_end = 37;
public static final int ConstraintSet_layout_constraintGuide_percent = 38;
public static final int ConstraintSet_layout_constraintHeight_default = 39;
public static final int ConstraintSet_layout_constraintHeight_max = 40;
public static final int ConstraintSet_layout_constraintHeight_min = 41;
public static final int ConstraintSet_layout_constraintHeight_percent = 42;
public static final int ConstraintSet_layout_constraintHorizontal_bias = 43;
public static final int ConstraintSet_layout_constraintHorizontal_chainStyle = 44;
public static final int ConstraintSet_layout_constraintHorizontal_weight = 45;
public static final int ConstraintSet_layout_constraintLeft_creator = 46;
public static final int ConstraintSet_layout_constraintLeft_toLeftOf = 47;
public static final int ConstraintSet_layout_constraintLeft_toRightOf = 48;
public static final int ConstraintSet_layout_constraintRight_creator = 49;
public static final int ConstraintSet_layout_constraintRight_toLeftOf = 50;
public static final int ConstraintSet_layout_constraintRight_toRightOf = 51;
public static final int ConstraintSet_layout_constraintStart_toEndOf = 52;
public static final int ConstraintSet_layout_constraintStart_toStartOf = 53;
public static final int ConstraintSet_layout_constraintTop_creator = 54;
public static final int ConstraintSet_layout_constraintTop_toBottomOf = 55;
public static final int ConstraintSet_layout_constraintTop_toTopOf = 56;
public static final int ConstraintSet_layout_constraintVertical_bias = 57;
public static final int ConstraintSet_layout_constraintVertical_chainStyle = 58;
public static final int ConstraintSet_layout_constraintVertical_weight = 59;
public static final int ConstraintSet_layout_constraintWidth_default = 60;
public static final int ConstraintSet_layout_constraintWidth_max = 61;
public static final int ConstraintSet_layout_constraintWidth_min = 62;
public static final int ConstraintSet_layout_constraintWidth_percent = 63;
public static final int ConstraintSet_layout_editor_absoluteX = 64;
public static final int ConstraintSet_layout_editor_absoluteY = 65;
public static final int ConstraintSet_layout_goneMarginBottom = 66;
public static final int ConstraintSet_layout_goneMarginEnd = 67;
public static final int ConstraintSet_layout_goneMarginLeft = 68;
public static final int ConstraintSet_layout_goneMarginRight = 69;
public static final int ConstraintSet_layout_goneMarginStart = 70;
public static final int ConstraintSet_layout_goneMarginTop = 71;
public static final int[] LinearConstraintLayout = { 0x010100c4 };
public static final int LinearConstraintLayout_android_orientation = 0;
}
}
| [
"pothik.shihab78@gmail.com"
] | pothik.shihab78@gmail.com |
165ba5d81c27c192d4fa5936431a1c88ae0587bd | a6da2ef5b03a2ce0de036c20cb1129361a42ef7c | /location-microservice/src/main/java/com/shanijeet/inventory/microservices/locationservice/locationmicroservice/model/User.java | c995dca7f19b62603d479e3949efb1cb5a074180 | [] | no_license | shanijeet/InventoryHub | 83efc633121d1affb425ac5ae8fe9ab38a6192a1 | dcc4f6615b917ee46d4327722acf009bd756b4b0 | refs/heads/master | 2020-04-11T11:37:49.452797 | 2018-12-14T08:17:06 | 2018-12-14T08:17:06 | 161,593,273 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,666 | java | package com.shanijeet.inventory.microservices.locationservice.locationmicroservice.model;
import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;
@Entity
@Table(name = "USER_DETAIL")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name="USER_ID")
private int userid;
@Column(name="USERNAME")
private String username;
@Column(name="PASSWORD")
private String password;
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinTable(
name="USER_ROLE",
joinColumns = {@JoinColumn(name="USER_ID")},
inverseJoinColumns = {@JoinColumn(name = "ROLE_ID")}
)
private Set<Role> roleList=new HashSet<Role>();
public User() {
}
public Set<Role> getRoleList() {
return roleList;
}
public void setRoleList(Set<Role> roleList) {
this.roleList = roleList;
}
public int getUserid() {
return userid;
}
public void setUserid(int userid) {
this.userid = userid;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return "User{" +
"userid=" + userid +
", username='" + username + '\'' +
", password='" + password + '\'' +
", roleList=" + roleList +
'}';
}
}
| [
"shani.sinha20@gmail.com"
] | shani.sinha20@gmail.com |
4c43380a32fa8049d565797f1ff6a9623e3a9f85 | 2bbc84a6cddc5ab8414c7f1b29618694b3508952 | /9.9.2-config-client-refresh-bus/src/main/java/cn/vincent992/controller/ConfigClientController.java | 0334d7deedbc1bb9af088fd300738b12550aac89 | [] | no_license | wsws0521/IDEA-Vincent-microservice | ecb9c76ce8f7e2bda8b24cca23d6dd65fa995059 | 01be2781ffe7f0bee17e3c695d203ab4ee167fcb | refs/heads/master | 2021-11-30T16:20:06.112848 | 2021-11-12T11:39:39 | 2021-11-12T11:39:39 | 226,063,638 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 516 | java | package cn.vincent992.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RefreshScope // 9.8-
public class ConfigClientController {
@Value("${profile}")
private String profile;
@GetMapping("/profile")
public String hello() {
return this.profile;
}
}
| [
"623540439@qq.com"
] | 623540439@qq.com |
a539d29ef9591067b322a28cc772ddc674de4863 | e9e6434126b6620283b89c980d7a206d032daa6c | /src/com/Bridgelabz/snakeAndLadder.java | 2ccbdd001b74f7a1432c005bc69ec265bc6e04bc | [] | no_license | Sunil1919-tech/Snake-And-Ladder | ec4840222b652f13d3d274d6985f3d5b38bca57a | 5563d64115c863ded1117d8f61869c2432a2e4a1 | refs/heads/master | 2023-07-13T14:48:57.909562 | 2021-08-11T04:25:15 | 2021-08-11T04:25:15 | 393,595,428 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,893 | java | package com.Bridgelabz;
/*
program for Snake and Ladder
declering logics for die position, Win position and play for 2
*/
public class snakeAndLadder {
//declering constant variables
public static final int LADDER = 1;
public static final int SNAKE = 2;
public static final int NO_PLAY = 0;
public static void main(String[] args) {
System.out.println("Welcome to Snake And Ladder Game.");
//variable decleration
int player1Position=0;
int player2Position=0;
int newPosition = 0;
int currentPlayer=1;
int count1 = 0;
int count2=0;
int option;
//delcaring while loop condition for player1 & player2 Turns
while (true) {
//Logic for Player 1
if (currentPlayer == 1) {
System.out.println("Now Player-1's turn");
count1++;
//random function to get dice number
int diceNum = (int) Math.floor((Math.random() * 6) + 1);
System.out.println("The Die number is = " +diceNum);
//logic to know whether it snake & ladder & no play
option = (int) Math.floor((Math.random() * 3));
System.out.println("The Option is =" +option);
switch (option) {
case NO_PLAY:
newPosition = 0;
break;
case LADDER:
newPosition = diceNum;
break;
case SNAKE:
newPosition = -diceNum;
break;
}
player1Position = player1Position + newPosition;
if (player1Position < 0) {
player1Position = 0;
}
if (player1Position > 100) {
player1Position = newPosition;
}
System.out.println("now Player-1 at " + player1Position + "th" + " Position");
if (player1Position == 100) {
break;
}
}
else {
//logic for player 2
count2++;
System.out.println("Now Player-2's turn");
int DieRolled = (int) (Math.random() * 6) + 1;
option = (int) (Math.random() * 3);
switch (option){
case NO_PLAY:
newPosition = 0;
break;
case LADDER:
newPosition = DieRolled;
break;
case SNAKE:
newPosition = -DieRolled;
break;
}
player2Position = player2Position + newPosition;
if (player2Position < 0) {
player2Position = 0;
}
if (player2Position > 100) {
player2Position = newPosition;
}
System.out.println("Now Player-2 at " + player2Position + "th" + " Position");
if (player2Position == 100) {
break;
}
}
if (option==1) {
System.out.println("You got Ladder. Now play again.");
}
else {
if (currentPlayer==1) {
currentPlayer = 2;
}
else {
currentPlayer = 1;
}
}
}
if (player1Position==100) {
System.out.println("\nCongratulation Player-1 you won! \n after die Rolled"+ count1+" times.");
} else {
System.out.println("\nCongratulation Player-2 you won! \n after die Rolled"+ count2+" times.");
}
}
}
| [
"sunigollapalli19@gmail.com"
] | sunigollapalli19@gmail.com |
830adab8a24ef54571bb1ff05539410126d013de | 47119d527d55e9adcb08a3a5834afe9a82dd2254 | /apisvc/src/main/java/com/emc/storageos/api/service/impl/resource/CapacityService.java | 2d601c803595f2261539d5fe9140cfde07039a92 | [] | no_license | chrisdail/coprhd-controller | 1c3ddf91bb840c66e4ece3d4b336a6df421b43e4 | 38a063c5620135a49013aae5e078aeb6534a5480 | refs/heads/master | 2020-12-03T10:42:22.520837 | 2015-06-08T15:24:36 | 2015-06-08T15:24:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,744 | java | /**
* Copyright 2015 EMC Corporation
* All Rights Reserved
*/
/**
* Copyright (c) 2013 EMC Corporation
* All Rights Reserved
*
* This software contains the intellectual property of EMC Corporation
* or is licensed to EMC Corporation from third parties. Use of this
* software and the intellectual property contained therein is expressly
* limited to the terms and conditions of the License Agreement under which
* it is provided by or on behalf of EMC.
*/
package com.emc.storageos.api.service.impl.resource;
import java.io.IOException;
import java.net.URI;
import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import com.emc.storageos.db.client.constraint.AlternateIdConstraint;
import com.emc.storageos.db.client.model.PropertyListDataObject;
import com.emc.storageos.model.vpool.ManagedResourcesCapacity;
import com.emc.storageos.model.vpool.ManagedResourcesCapacity.ManagedResourceCapacity;
import com.emc.storageos.model.vpool.ManagedResourcesCapacity.CapacityResourceType;
import static com.emc.storageos.db.client.model.mapper.PropertyListDataObjectMapper.map;
import com.emc.storageos.volumecontroller.impl.ManagedCapacityImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.emc.storageos.volumecontroller.impl.ManagedCapacityImpl;
/**
* API for obtaining the current provisioning managed capacity.
*/
@Path("/internal/system")
public class CapacityService extends ResourceService {
private static final Logger _log = LoggerFactory.getLogger(CapacityService.class);
/**
* Get the provisioning managed capacity.
* @return
* @throws IOException
*/
@GET
@Path("/managed-capacity")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
public ManagedResourcesCapacity getManagedCapacity() {
ManagedResourcesCapacity resources = null;
try {
resources = getCapacityDataResource();
}
catch (Exception ex) {
// failed to find capacity in the database, try to compute directly
try {
resources = ManagedCapacityImpl.getManagedCapacity(_dbClient);
}
catch( InterruptedException ignore) {
//impossible
}
}
return resources;
}
private ManagedResourcesCapacity getCapacityDataResource() throws Exception {
ManagedResourcesCapacity capacities = new ManagedResourcesCapacity();
for( CapacityResourceType capType : CapacityResourceType.values() ) {
ManagedCapacityImpl.CapacityPropertyListTypes resourceType = ManagedCapacityImpl.mapCapacityType(capType);
List<URI> dataResourcesURI = _dbClient.queryByConstraint(
AlternateIdConstraint.Factory.getConstraint(PropertyListDataObject.class,
"resourceType",
resourceType.toString()));
if (dataResourcesURI.size() == 0) {
_log.error("Failed to find capacity of type {} in the database, recompute", resourceType);
throw new Exception("Failed to find capacity in the database");
}
PropertyListDataObject resource = _dbClient.queryObject(PropertyListDataObject.class, dataResourcesURI.get(0));
ManagedResourceCapacity mCap = map(resource,ManagedResourceCapacity.class);
capacities.getResourceCapacityList().add(mCap);
}
return capacities;
}
} | [
"review-coprhd@coprhd.org"
] | review-coprhd@coprhd.org |
dca18c7a3b5ffbeac07238ae34a024a4b4973c66 | 6b9f769894e658f8cb064dea6624961b9bcf053f | /spmia-chapter2/licensing-service/src/main/java/com/thoughtmechanix/licenses/controllers/ApiController.java | 260ad09743f4dd087c72c978b8f91155329ab71c | [] | no_license | muckyang/MSAProject | e86c7fe0fb56eea49b3cfbb81fb851da5c4bbe06 | 315d223fa25619cd6fbaaf2b2940e4f02303c727 | refs/heads/master | 2023-03-20T02:10:03.866480 | 2021-03-09T11:22:54 | 2021-03-09T11:22:54 | 344,358,707 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 721 | java | package com.thoughtmechanix.licenses.controllers;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
@RestController
@RequestMapping("/api/")
public class ApiController {
@GetMapping( value = "test", produces = MediaType.TEXT_PLAIN_VALUE)
@ApiOperation(value = "Test Sample")
public Object sample(@RequestParam String param) {
return ResponseEntity.ok(param);
}
}
| [
"yn782@naver.com"
] | yn782@naver.com |
c1a56420b965e7c20e94b817ce3cb238fc08e265 | 67a635bc5733e1fed960441b01d6cba03639efe0 | /se-workspace/9Day-Polymorphism/src/step1/TestObjectClass.java | 3607aa5f56623730f43eff0b1dcd0ae3e53c5e9e | [] | no_license | sungsikyang92/KOSTA203-INST-PRAC | 3b95c44b58d5982f0b60081ac4d589181dcf852e | 29e6172bad26b3b5b5b3d4823a34ec69dc53fa04 | refs/heads/master | 2022-12-28T08:21:47.423141 | 2020-10-05T10:15:53 | 2020-10-05T10:15:53 | 296,010,220 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 941 | java | package step1;
//아래와 같이 별도의 상속관계 표현이 없으면 자동으로
//상속관계를 준다. extends Object
class Parent{// extends Object
Parent(){
super();
System.out.println("Parent 객체생성");
}
}
class Child extends Parent{
Child(){
super();//부모 생성자 호출하여 부모 객체 생성
System.out.println("Child 객체생성");
}
}
class Car{//별도의 상속관계가 없으면 extends Object
}
public class TestObjectClass {
public static void main(String[] args) {
Child c=new Child();
//Child는 별도의 메소드가 정의되어 있지 않지만
//상속받은 Parent가 extends Object하고 있어서
//Object class의 getClass()를 자신의 기능으로
//사용할 수 있다.
System.out.println(c.getClass());
Car car=new Car();
//Object 자식이므로 Object class의 get Class()를 사용
//할 수 있다.
System.out.println(car.getClass());
}
}
| [
"sungsik.yang92@gmail.com"
] | sungsik.yang92@gmail.com |
170a70594fad1e1ce5058e93deea0a6bc08c2852 | e5c9d3af261ff1f2bbdd098e07f5f0d93f9774a6 | /app/src/main/java/io/firebase/contactlens/MainActivity.java | bfee95165648d0e46615a0d905afd9aedc114150 | [] | no_license | ContactLens/Team-Project | 12b1b4dd6aad066276d537877a90a12477807262 | 4aeb09b409cb223539f67974919c3ebbbbe6cef2 | refs/heads/master | 2021-01-13T08:12:47.131369 | 2016-12-19T19:54:11 | 2016-12-19T19:54:11 | 71,731,621 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,317 | java | package io.firebase.contactlens;
import android.app.ProgressDialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.appindexing.Action;
import com.google.android.gms.appindexing.AppIndex;
import com.google.android.gms.appindexing.Thing;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DatabaseReference;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private Button buttonRegister;
private EditText editTextEmail;
private EditText editTextPassword;
private TextView textViewSignin;
private ProgressDialog progressDialog;
private FirebaseAuth firebaseAuth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//initialise firebase auth object
firebaseAuth = FirebaseAuth.getInstance();
if (firebaseAuth.getCurrentUser() != null) {
//profile activity here
finish();
startActivity(new Intent(getApplicationContext(), MenuActivity.class));
}
//initialise views
editTextEmail = (EditText) findViewById(R.id.editTextEmail);
editTextPassword = (EditText) findViewById(R.id.editTextPassword);
textViewSignin = (TextView) findViewById(R.id.textViewSignin);
buttonRegister = (Button) findViewById(R.id.buttonRegister);
progressDialog = new ProgressDialog(this);
buttonRegister.setOnClickListener(this);
textViewSignin.setOnClickListener(this);
}
private void registerUser() {
//getting email and password from edit texts
String email = editTextEmail.getText().toString().trim();
String password = editTextPassword.getText().toString().trim();
//checking if email and password are empty
if (TextUtils.isEmpty(email)) {
//email is empty
Toast.makeText(this, "Please enter email", Toast.LENGTH_SHORT).show();
//stopping the function executing further
return;
}
if (TextUtils.isEmpty(password)) {
//password is empty
Toast.makeText(this, "Please enter password", Toast.LENGTH_SHORT).show();
//stopping the function executing further
return;
}
progressDialog.setMessage("Registering User...");
progressDialog.show();
//Firebase native function, establishes email/password pair with application
firebaseAuth.createUserWithEmailAndPassword(email, password)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
finish();
startActivity(new Intent(getApplicationContext(), MenuActivity.class));
} else {
Toast.makeText(MainActivity.this, "Registration failed, please try again", Toast.LENGTH_SHORT).show();
return;
}
}
});
}
@Override
public void onClick(View view) {
if (view == buttonRegister) {
registerUser();
}
if (view == textViewSignin) {
startActivity(new Intent(this, LoginActivity.class));
}
}
@Override
public void onStart() {
super.onStart();
}
@Override
public void onStop() {
super.onStop();
}
} | [
"jmrlgh@gmail.com"
] | jmrlgh@gmail.com |
26df8e7b9e6aa8baf3932a418dc5773a4ac8f12e | 180e78725121de49801e34de358c32cf7148b0a2 | /dataset/protocol1/neo4j/learning/1152/ReadOnlyIndexReferenceTest.java | bf8b4912cdac69fa1057b1a5815242ac79334a15 | [] | no_license | ASSERT-KTH/synthetic-checkstyle-error-dataset | 40e8d1e0a7ebe7f7711def96a390891a6922f7bd | 40c057e1669584bfc6fecf789b5b2854660222f3 | refs/heads/master | 2023-03-18T12:50:55.410343 | 2019-01-25T09:54:39 | 2019-01-25T09:54:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,467 | java | /*
* Copyright (c) 2002-2018 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.index.impl.lucene.explicit;
import org.apache.lucene.search.IndexSearcher;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
class ReadOnlyIndexReferenceTest
{
private IndexIdentifier identifier = mock( IndexIdentifier.class );
private IndexSearcher searcher = mock( IndexSearcher.class );
private CloseTrackingIndexReader reader = new CloseTrackingIndexReader();
private ReadOnlyIndexReference indexReference = new ReadOnlyIndexReference( identifier, searcher );
@BeforeEach
void setUp()
{
when( searcher.getIndexReader() ).thenReturn( reader );
}
@Test
void obtainingWriterIsUnsupported()
{
UnsupportedOperationException uoe = assertThrows( UnsupportedOperationException.class, () -> indexReference.getWriter() );
assertEquals( uoe.getMessage(), "Read only indexes do not have index writers." );
}
@Test
void markAsStaleIsUnsupported()
{
UnsupportedOperationException uoe = assertThrows( UnsupportedOperationException.class, () -> indexReference.setStale() );
assertEquals( uoe.getMessage(), "Read only indexes can't be marked as stale." );
}
@Test
void checkAndClearStaleAlwaysFalse()
{
assertFalse( indexReference.checkAndClearStale() );
}
@Test
void disposeClosingSearcherAndMarkAsClosed() throws IOException
{
indexReference.dispose();
assertTrue( reader.isClosed() );
assertTrue( indexReference.isClosed() );
}
@Test
void detachIndexReferenceWhenSomeReferencesExist() throws IOException
{
indexReference.incRef();
indexReference.detachOrClose();
assertTrue( indexReference.isDetached(), "Should leave index in detached state." );
}
@Test
void closeIndexReferenceWhenNoReferenceExist() throws IOException
{
indexReference.detachOrClose();
assertFalse( indexReference.isDetached(), "Should leave index in closed state." );
assertTrue( reader.isClosed() );
assertTrue( indexReference.isClosed() );
}
@Test
void doNotCloseInstanceWhenSomeReferenceExist()
{
indexReference.incRef();
assertFalse( indexReference.close() );
assertFalse( indexReference.isClosed() );
}
@Test
void closeDetachedIndexReferencedOnlyOnce() throws IOException
{
indexReference.incRef();
indexReference.detachOrClose();
assertTrue( indexReference.isDetached(), "Should leave index in detached state." );
assertTrue( indexReference.close() );
assertTrue( reader.isClosed() );
assertTrue( indexReference.isClosed() );
}
@Test
void doNotCloseDetachedIndexReferencedMoreThenOnce() throws IOException
{
indexReference.incRef();
indexReference.incRef();
indexReference.detachOrClose();
assertTrue( indexReference.isDetached(), "Should leave index in detached state." );
assertFalse( indexReference.close() );
}
@Test
void doNotCloseReferencedIndex()
{
indexReference.incRef();
assertFalse( indexReference.close() );
assertFalse( indexReference.isClosed() );
}
@Test
void closeNotReferencedIndex()
{
assertTrue( indexReference.close() );
}
}
| [
"bloriot97@gmail.com"
] | bloriot97@gmail.com |
699284f97889a77e323dd7f355b3c51f034c6836 | 4692a13a5cf139cb89549e7791337c6e7568fdd5 | /PCM/org.palladiosimulator.pcm/src/org/palladiosimulator/pcm/core/entity/util/EntityResourceImpl.java | d16182e5cba5e67a53960fbcdd2e7fe4e98e9921 | [] | no_license | SQuAT-Team/kamp-test | 95b87067d03c3e2ed36912f898a3130e9de40dd9 | 8285478066a760fcd2ed1972b799c6895493d256 | refs/heads/master | 2022-06-26T21:29:19.209964 | 2019-04-01T11:53:59 | 2019-04-01T11:53:59 | 56,880,344 | 0 | 1 | null | 2021-06-03T19:33:40 | 2016-04-22T19:31:42 | Java | UTF-8 | Java | false | false | 966 | java | /**
* Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany
*/
package org.palladiosimulator.pcm.core.entity.util;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl;
/**
* <!-- begin-user-doc --> The <b>Resource </b> associated with the package. <!-- end-user-doc -->
*
* @see org.palladiosimulator.pcm.core.entity.util.EntityResourceFactoryImpl
* @generated
*/
public class EntityResourceImpl extends XMIResourceImpl {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public static final String copyright = "Copyright 2005-2015 by palladiosimulator.org";
/**
* Creates an instance of the resource. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @param uri
* the URI of the new resource.
* @generated
*/
public EntityResourceImpl(final URI uri) {
super(uri);
}
} // EntityResourceImpl
| [
"alejandrorago@MacBook-Pro.local"
] | alejandrorago@MacBook-Pro.local |
34dc9f1b00d3b6185645deaa61008b0677cdc16d | 6a11eb45bab67a26fb35e85c2c8f7691b504800e | /azurefunctions-extension/src/main/java/org/ballerinax/azurefunctions/AzureFunctionsPlugin.java | 52084538959e82552da14c43d6416600fc1088ba | [
"Apache-2.0"
] | permissive | lafernando/azurefunctions | ef920bd989b6cdcb2e705059c889da45d93762a7 | f09d0e90b035829e06a3a2a8ce09b110326475fd | refs/heads/master | 2022-06-03T15:04:28.145137 | 2020-04-13T01:36:21 | 2020-04-13T01:36:21 | 255,052,438 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,955 | java | /*
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.ballerinax.azurefunctions;
import org.ballerinalang.compiler.plugins.AbstractCompilerPlugin;
import org.ballerinalang.compiler.plugins.SupportedAnnotationPackages;
import org.ballerinalang.model.TreeBuilder;
import org.ballerinalang.model.elements.Flag;
import org.ballerinalang.model.elements.PackageID;
import org.ballerinalang.model.tree.AnnotationAttachmentNode;
import org.ballerinalang.model.tree.FunctionNode;
import org.ballerinalang.model.tree.IdentifierNode;
import org.ballerinalang.model.tree.PackageNode;
import org.ballerinalang.util.diagnostic.Diagnostic;
import org.ballerinalang.util.diagnostic.DiagnosticLog;
import org.ballerinalang.util.exceptions.BallerinaException;
import org.wso2.ballerinalang.compiler.desugar.ASTBuilderUtil;
import org.wso2.ballerinalang.compiler.semantics.model.Scope;
import org.wso2.ballerinalang.compiler.semantics.model.SymbolTable;
import org.wso2.ballerinalang.compiler.semantics.model.symbols.BAnnotationSymbol;
import org.wso2.ballerinalang.compiler.semantics.model.symbols.BInvokableSymbol;
import org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol;
import org.wso2.ballerinalang.compiler.semantics.model.symbols.BSymbol;
import org.wso2.ballerinalang.compiler.semantics.model.symbols.Symbols;
import org.wso2.ballerinalang.compiler.semantics.model.types.BInvokableType;
import org.wso2.ballerinalang.compiler.semantics.model.types.BNilType;
import org.wso2.ballerinalang.compiler.tree.BLangAnnotationAttachment;
import org.wso2.ballerinalang.compiler.tree.BLangBlockFunctionBody;
import org.wso2.ballerinalang.compiler.tree.BLangFunction;
import org.wso2.ballerinalang.compiler.tree.BLangFunctionBody;
import org.wso2.ballerinalang.compiler.tree.BLangIdentifier;
import org.wso2.ballerinalang.compiler.tree.BLangImportPackage;
import org.wso2.ballerinalang.compiler.tree.BLangPackage;
import org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression;
import org.wso2.ballerinalang.compiler.tree.expressions.BLangInvocation;
import org.wso2.ballerinalang.compiler.tree.expressions.BLangLiteral;
import org.wso2.ballerinalang.compiler.tree.expressions.BLangSimpleVarRef;
import org.wso2.ballerinalang.compiler.tree.statements.BLangExpressionStmt;
import org.wso2.ballerinalang.compiler.util.CompilerContext;
import org.wso2.ballerinalang.compiler.util.Name;
import org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos;
import org.wso2.ballerinalang.util.Flags;
import java.io.IOException;
import java.io.PrintStream;
import java.net.URI;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Compiler plugin to process Azure Functions function annotations.
*/
@SupportedAnnotationPackages(value = "ballerinax/azurefunctions:0.0.0")
public class AzureFunctionsPlugin extends AbstractCompilerPlugin {
private static final String AZURE_FUNCS_OUTPUT_ZIP_FILENAME = "azure-functions.zip";
private static final String AZURE_FUNCTIONS_PACKAGE_NAME = "azurefunctions";
private static final String AZURE_FUNCTIONS_PACKAGE_ORG = "ballerinax";
private static final String AZURE_FUNCS_REG_FUNCTION_NAME = "__register";
private static final String MAIN_FUNC_NAME = "main";
private static final PrintStream OUT = System.out;
private static List<String> generatedFuncs = new ArrayList<>();
private DiagnosticLog dlog;
private SymbolTable symTable;
@Override
public void init(DiagnosticLog diagnosticLog) {
this.dlog = diagnosticLog;
}
public void setCompilerContext(CompilerContext context) {
this.symTable = SymbolTable.getInstance(context);
}
@Override
public void process(PackageNode packageNode) {
List<BLangFunction> azureFunctions = new ArrayList<>();
for (FunctionNode fn : packageNode.getFunctions()) {
BLangFunction bfn = (BLangFunction) fn;
if (this.isAzureFunction(bfn)) {
azureFunctions.add(bfn);
}
}
BLangPackage myPkg = (BLangPackage) packageNode;
if (!azureFunctions.isEmpty()) {
BPackageSymbol azureFuncsPkgSymbol = this.extractAzureFuncsPackageSymbol(myPkg);
if (azureFuncsPkgSymbol == null) {
// this symbol will always be there, since the import is needed to add the annotation
throw new BallerinaException("Azure Functions package symbol cannot be found");
}
BLangFunction epFunc = this.extractMainFunction(myPkg);
if (epFunc == null) {
// main function is not there, lets create our own one
epFunc = this.createFunction(myPkg.pos, MAIN_FUNC_NAME, myPkg);
packageNode.addFunction(epFunc);
} else {
// clear out the existing statements
((BLangBlockFunctionBody) epFunc.body).stmts.clear();
}
BLangBlockFunctionBody body = (BLangBlockFunctionBody) epFunc.body;
for (BLangFunction func : azureFunctions) {
this.addRegisterCall(myPkg.pos, azureFuncsPkgSymbol, body, func);
AzureFunctionsPlugin.generatedFuncs.add(func.name.value);
}
}
}
private BLangFunction extractMainFunction(BLangPackage myPkg) {
for (BLangFunction func : myPkg.getFunctions()) {
if (MAIN_FUNC_NAME.equals(func.getName().value)) {
return func;
}
}
return null;
}
private BPackageSymbol extractAzureFuncsPackageSymbol(BLangPackage myPkg) {
for (BLangImportPackage pi : myPkg.imports) {
if (AZURE_FUNCTIONS_PACKAGE_ORG.equals(pi.orgName.value) && pi.pkgNameComps.size() == 1 &&
AZURE_FUNCTIONS_PACKAGE_NAME.equals(pi.pkgNameComps.get(0).value)) {
return pi.symbol;
}
}
return null;
}
private void addRegisterCall(DiagnosticPos pos, BPackageSymbol lamdaPkgSymbol, BLangBlockFunctionBody blockStmt,
BLangFunction func) {
List<BLangExpression> exprs = new ArrayList<>();
exprs.add(this.createStringLiteral(pos, func.name.value));
exprs.add(this.createVariableRef(pos, func.symbol));
BLangInvocation inv = this.createInvocationNode(lamdaPkgSymbol, AZURE_FUNCS_REG_FUNCTION_NAME, exprs);
BLangExpressionStmt stmt = new BLangExpressionStmt(inv);
stmt.pos = pos;
blockStmt.addStatement(stmt);
}
private BLangLiteral createStringLiteral(DiagnosticPos pos, String value) {
BLangLiteral stringLit = new BLangLiteral();
stringLit.pos = pos;
stringLit.value = value;
stringLit.type = symTable.stringType;
return stringLit;
}
private BLangSimpleVarRef createVariableRef(DiagnosticPos pos, BSymbol varSymbol) {
final BLangSimpleVarRef varRef = (BLangSimpleVarRef) TreeBuilder.createSimpleVariableReferenceNode();
varRef.pos = pos;
varRef.variableName = ASTBuilderUtil.createIdentifier(pos, varSymbol.name.value);
varRef.symbol = varSymbol;
varRef.type = varSymbol.type;
return varRef;
}
private BLangInvocation createInvocationNode(BPackageSymbol pkgSymbol, String functionName,
List<BLangExpression> args) {
BLangInvocation invocationNode = (BLangInvocation) TreeBuilder.createInvocationNode();
BLangIdentifier name = (BLangIdentifier) TreeBuilder.createIdentifierNode();
name.setLiteral(false);
name.setValue(functionName);
invocationNode.name = name;
invocationNode.pkgAlias = (BLangIdentifier) TreeBuilder.createIdentifierNode();
invocationNode.symbol = pkgSymbol.scope.lookup(new Name(functionName)).symbol;
invocationNode.type = new BNilType();
invocationNode.requiredArgs = args;
return invocationNode;
}
private BLangFunction createFunction(DiagnosticPos pos, String name, BLangPackage packageNode) {
final BLangFunction bLangFunction = (BLangFunction) TreeBuilder.createFunctionNode();
final IdentifierNode funcName = ASTBuilderUtil.createIdentifier(pos, name);
bLangFunction.setName(funcName);
bLangFunction.flagSet = EnumSet.of(Flag.PUBLIC);
bLangFunction.pos = pos;
bLangFunction.type = new BInvokableType(new ArrayList<>(), new BNilType(), null);
bLangFunction.body = this.createBlockStmt(pos);
BInvokableSymbol functionSymbol = Symbols.createFunctionSymbol(Flags.asMask(bLangFunction.flagSet),
new Name(bLangFunction.name.value), packageNode.packageID,
bLangFunction.type, packageNode.symbol, true);
functionSymbol.scope = new Scope(functionSymbol);
bLangFunction.symbol = functionSymbol;
return bLangFunction;
}
private BLangFunctionBody createBlockStmt(DiagnosticPos pos) {
final BLangFunctionBody blockNode = (BLangFunctionBody) TreeBuilder.createBlockFunctionBodyNode();
blockNode.pos = pos;
return blockNode;
}
private boolean isAzureFunction(BLangFunction fn) {
List<BLangAnnotationAttachment> annotations = fn.annAttachments;
boolean hasAzureFuncsAnnon = false;
for (AnnotationAttachmentNode attachmentNode : annotations) {
hasAzureFuncsAnnon = this.hasAzureFunctionsAnnotation(attachmentNode);
if (hasAzureFuncsAnnon) {
break;
}
}
if (hasAzureFuncsAnnon) {
BLangFunction bfn = (BLangFunction) fn;
if (!this.validateAzureFunction(bfn)) {
dlog.logDiagnostic(Diagnostic.Kind.ERROR, fn.getPosition(),
"Invalid function signature for an Azure Functions function: " +
bfn + ", it should be 'public function (json) returns json|error'");
return false;
} else {
return true;
}
} else {
return false;
}
}
private boolean validateAzureFunction(BLangFunction node) {
return true;
}
private boolean hasAzureFunctionsAnnotation(AnnotationAttachmentNode attachmentNode) {
BAnnotationSymbol symbol = ((BLangAnnotationAttachment) attachmentNode).annotationSymbol;
return AZURE_FUNCTIONS_PACKAGE_ORG.equals(symbol.pkgID.orgName.value) &&
AZURE_FUNCTIONS_PACKAGE_NAME.equals(symbol.pkgID.name.value) && "Function".equals(symbol.name.value);
}
@Override
public void codeGenerated(PackageID packageID, Path binaryPath) {
if (AzureFunctionsPlugin.generatedFuncs.isEmpty()) {
// no azure functions, nothing else to do
return;
}
OUT.println("\t@azurefunctions:Function: " + String.join(", ", AzureFunctionsPlugin.generatedFuncs));
try {
this.generateZipFile(binaryPath);
} catch (IOException e) {
throw new BallerinaException("Error generating Azure Functions zip file: " + e.getMessage(), e);
}
OUT.println("\n\tRun the following command to deploy Ballerina Azure Functions:");
OUT.println("\taz functionapp deployment source config-zip -g <resource_group> -n <function_app_name> --src "
+ AZURE_FUNCS_OUTPUT_ZIP_FILENAME);
}
private void generateZipFile(Path binaryPath) throws IOException {
Map<String, String> env = new HashMap<>();
env.put("create", "true");
URI uri = URI.create("jar:file:" + binaryPath.toAbsolutePath().getParent().resolve(
AZURE_FUNCS_OUTPUT_ZIP_FILENAME).toUri().getPath());
try (FileSystem zipfs = FileSystems.newFileSystem(uri, env)) {
Path pathInZipfile = zipfs.getPath("/" + binaryPath.getFileName());
Files.copy(binaryPath, pathInZipfile, StandardCopyOption.REPLACE_EXISTING);
}
}
}
| [
"lafernando@gmail.com"
] | lafernando@gmail.com |
9fb5c5aa98cc5905069d0cdfa8fb629e8d499794 | 8c228718fb9ecead420174806d2621d3697fb91a | /com.github.sormuras.bach/main/java/com/github/sormuras/bach/internal/Strings.java | 30e7399cd5d573cc25ec7795b46eb44590c9408f | [
"MIT"
] | permissive | code-refs/bach | 4f66c26caaaee4ab4edc579c25e0871a6c1ff46a | 7d242d44f388eb631362bf200e178747ae4dd64c | refs/heads/main | 2023-05-25T06:31:19.773529 | 2021-06-05T05:40:01 | 2021-06-05T05:40:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,460 | java | package com.github.sormuras.bach.internal;
import com.github.sormuras.bach.Bach;
import com.github.sormuras.bach.api.BachException;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.OutputStream;
import java.lang.module.FindException;
import java.lang.module.ModuleDescriptor.Version;
import java.math.BigInteger;
import java.nio.file.Files;
import java.nio.file.Path;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
import java.time.Duration;
import java.util.ArrayDeque;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/** String-related helpers. */
public class Strings {
public static String banner() {
var location = BachInfoModuleBuilder.location();
var type = Files.isDirectory(location) ? "directory" : "modular JAR file";
var directory = Path.of("").toAbsolutePath();
return """
Bach %s
Loaded from %s %s in directory: %s
Launched by Java %s running on %s.
The current working directory is: %s
"""
.formatted(
Bach.version(),
type,
location.getFileName(),
directory.relativize(location).getParent().toUri(),
Runtime.version(),
System.getProperty("os.name"),
directory.toUri())
.strip();
}
public static Stream<String> unroll(String string) {
return string.lines().map(String::strip);
}
public static Stream<String> unroll(String... strings) {
if (strings.length == 0) return Stream.empty();
if (strings.length == 1) return unroll(strings[0]);
return unroll(List.of(strings));
}
public static Stream<String> unroll(Collection<String> strings) {
return strings.stream().flatMap(String::lines).map(String::strip);
}
public static String toEnumName(String string) {
return string.toUpperCase(Locale.ROOT).replace('-', '_');
}
public static <E extends Enum<E>> E toEnum(Class<E> enumClass, String string) {
return Enum.valueOf(enumClass, toEnumName(string));
}
/** {@return a human-readable representation of the given duration} */
public static String toString(Duration duration) {
return duration
.truncatedTo(TimeUnit.MILLISECONDS.toChronoUnit())
.toString()
.substring(2)
.replaceAll("(\\d[HMS])(?!$)", "$1 ")
.toLowerCase();
}
/**
* {@return a string containing the version number and, if present, the pre-release version}
*
* @param version the module's version
*/
public static String toNumberAndPreRelease(Version version) {
var string = version.toString();
var firstPlus = string.indexOf('+');
if (firstPlus == -1) return string;
var secondPlus = string.indexOf('+', firstPlus + 1);
return string.substring(0, secondPlus == -1 ? firstPlus : secondPlus);
}
/** {@return a string composed of paths joined via the system-dependent path-separator} */
public static String join(Collection<Path> paths) {
return join(paths, File.pathSeparator);
}
/** {@return a string composed of paths joined via the given delimiter} */
public static String join(Collection<Path> paths, CharSequence delimiter) {
return paths.stream().map(Path::toString).collect(Collectors.joining(delimiter));
}
/** {@return the file name of the path as a string, or {@code null}} */
public static String name(Path path) {
return nameOrElse(path, null);
}
/** {@return the file name of the path as a string, or the given default name} */
public static String nameOrElse(Path path, String defautName) {
var name = path.toAbsolutePath().normalize().getFileName();
return Optional.ofNullable(name).map(Path::toString).orElse(defautName);
}
/** {@return the message digest of the given file as a hexadecimal string} */
public static String hash(String algorithm, Path file) throws Exception {
var md = MessageDigest.getInstance(algorithm);
try (var in = new BufferedInputStream(new FileInputStream(file.toFile()));
var out = new DigestOutputStream(OutputStream.nullOutputStream(), md)) {
in.transferTo(out);
}
return String.format("%0" + (md.getDigestLength() * 2) + "x", new BigInteger(1, md.digest()));
}
/** {@return a string in module-pattern form usable as a {@code --module-source-path} value} */
public static String toModuleSourcePathPatternForm(Path info, String module) {
var deque = new ArrayDeque<String>();
for (var element : info.normalize()) {
var name = element.toString();
if (name.equals("module-info.java")) continue;
deque.addLast(name.equals(module) ? "*" : name);
}
var pattern = String.join(File.separator, deque);
if (!pattern.contains("*")) throw new FindException("Name '" + module + "' not found: " + info);
if (pattern.equals("*")) return ".";
if (pattern.endsWith("*")) return pattern.substring(0, pattern.length() - 2);
if (pattern.startsWith("*")) return "." + File.separator + pattern;
return pattern;
}
public static List<String> lines(Path file) {
try {
return Files.readAllLines(file);
} catch (Exception e) {
throw new BachException(e);
}
}
/** Hidden default constructor. */
private Strings() {}
}
| [
"sormuras@gmail.com"
] | sormuras@gmail.com |
d1f6807083438505d8eae0e2f6ab7e97b849f0d9 | 0b084546e7ff271f2d2067eda61bf62af162aae6 | /module/fluance-appbase-security/src/main/java/net/fluance/app/security/util/auth/TrustedPartner.java | 2ca6b461a34ceaedb553ae0f8ef2ee94ce511671 | [] | no_license | Fluance/fec-mw-app-base | 97c5cb2224ddb39bfa5ea4f1960ec29f51bf3b80 | fef65fb9e8b77aaef2f59a77d1de93a759a7a813 | refs/heads/master | 2021-08-28T21:03:56.642505 | 2020-03-10T10:13:59 | 2020-03-10T10:13:59 | 246,268,551 | 0 | 0 | null | 2021-08-13T15:35:56 | 2020-03-10T10:14:39 | Java | UTF-8 | Java | false | false | 2,296 | java | /**
*
*/
package net.fluance.app.security.util.auth;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
public class TrustedPartner {
public static final String CONF_NAME_FIELD = "name";
public static final String CONF_SSL_KEY_ALIAS_FIELD = "ssl-key-alias";
public static final String CONF_JWT_SPEC_FIELD = "jwt-spec";
private String name;
@JsonProperty(CONF_SSL_KEY_ALIAS_FIELD)
private String sslKeyAlias;
@JsonProperty(CONF_JWT_SPEC_FIELD)
private TrustedPartnerJwtSpec jwtSpec;
public TrustedPartner() {}
public TrustedPartner(String name, String sslKeyAlias, TrustedPartnerJwtSpec jwtSpec) {
super();
this.name = name;
this.sslKeyAlias = sslKeyAlias;
this.jwtSpec = jwtSpec;
}
public TrustedPartner(ObjectNode jsonConfigNode) throws JsonProcessingException {
ObjectMapper objectMapper = new ObjectMapper();
if(!isJsonConfigNodeValid(jsonConfigNode)) {
throw new IllegalArgumentException("Invalid configuration: " + objectMapper.writeValueAsString(jsonConfigNode));
}
this.name = jsonConfigNode.get(CONF_NAME_FIELD).textValue();
this.sslKeyAlias = jsonConfigNode.get(CONF_SSL_KEY_ALIAS_FIELD).textValue();
JsonNode jwtSpecNode = jsonConfigNode.get(CONF_JWT_SPEC_FIELD);
this.jwtSpec = new TrustedPartnerJwtSpec((ObjectNode) jwtSpecNode);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSslKeyAlias() {
return sslKeyAlias;
}
public void setSslKeyAlias(String sslKeyAlias) {
this.sslKeyAlias = sslKeyAlias;
}
public TrustedPartnerJwtSpec getJwtSpec() {
return jwtSpec;
}
public void setJwtSpec(TrustedPartnerJwtSpec jwtSpec) {
this.jwtSpec = jwtSpec;
}
public static boolean isJsonConfigNodeValid(ObjectNode jsonNode) {
return jsonNode != null && jsonNode.has(CONF_NAME_FIELD) && jsonNode.get(CONF_NAME_FIELD).isTextual()
&& jsonNode.has(CONF_SSL_KEY_ALIAS_FIELD) && jsonNode.get(CONF_SSL_KEY_ALIAS_FIELD).isTextual()
&& jsonNode.has(CONF_JWT_SPEC_FIELD) && jsonNode.get(CONF_JWT_SPEC_FIELD).isObject();
}
}
| [
"zroncevic@flunace.ch"
] | zroncevic@flunace.ch |
08c5208bbeb56de7417b2b3dbe4c4b4c300a1e07 | 4ce336ce2b47519d9751420a8d401fffadfba249 | /workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/work/Catalina/localhost/_/org/apache/jsp/WEB_002dINF/jsp/contents/academy/anatomy/contentsUpdate_jsp.java | 038e256dba91f11aaf3903fd10327f6e83e24dfc | [] | no_license | yuyunsu1187/gittest | 4796c8fb3bf594bd202e26433bbff5cdf0cd1872 | de42dc91e5a390900f27ebbebffc0ec4f31fe063 | refs/heads/master | 2022-11-25T07:42:26.607899 | 2020-10-12T05:32:36 | 2020-10-12T05:32:36 | 140,378,348 | 0 | 0 | null | 2022-11-16T05:53:04 | 2018-07-10T04:46:27 | Java | UTF-8 | Java | false | false | 79,501 | java | /*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/7.0.52
* Generated at: 2020-10-12 00:40:23 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp.WEB_002dINF.jsp.contents.academy.anatomy;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class contentsUpdate_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005furl_0026_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fif_0026_005ftest;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_005fjspx_005ftagPool_005fc_005furl_0026_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005fc_005furl_0026_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems.release();
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.release();
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=utf-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write('\r');
out.write('\n');
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<script type=\"text/javaScript\" language=\"javascript\">\r\n");
out.write("//<![CDATA[\r\n");
out.write("\t\r\n");
out.write("\t// 필수 입력정보인 아이디, 비밀번호가 입력되었는지 확인하는 함수\r\n");
out.write("\tfunction checkValue() {\r\n");
out.write("\t\r\n");
out.write("\t\tif (!document.anatomyContentsInfo.title.value) {\r\n");
out.write("\t\t\talert(\"제목을 입력하세요.\");\r\n");
out.write("\t\t\treturn false;\r\n");
out.write("\t\t}\r\n");
out.write("\t\t\r\n");
out.write("\t\tif (!document.anatomyContentsInfo.readerUserId.value) {\r\n");
out.write("\t\t\talert(\"담당 강사를 선택 하세요.\");\r\n");
out.write("\t\t\treturn false;\r\n");
out.write("\t\t}\r\n");
out.write("\r\n");
out.write("\t}\r\n");
out.write("\t\r\n");
out.write("\t// 해당 파일 다운로드\r\n");
out.write("\tfunction fnDownload(index) {\r\n");
out.write("\t\tvar app = document.getElementById(\"append\");\r\n");
out.write("\t\tapp.innerHTML = \"<input type=hidden class=Lcheckbox name=checkIndex id=checkIndex value=\"+ index +\">\";\r\n");
out.write("\t\t\r\n");
out.write("\t\tdocument.contentsInfo.action = \"");
if (_jspx_meth_c_005furl_005f0(_jspx_page_context))
return;
out.write("\";\r\n");
out.write("\t\tdocument.contentsInfo.submit();\r\n");
out.write("\t}\r\n");
out.write("\t\r\n");
out.write("\t// 파일 저장\r\n");
out.write("\tfunction fnSave() {\r\n");
out.write("\t\tdocument.anatomyContentsInfo.action = \"");
if (_jspx_meth_c_005furl_005f1(_jspx_page_context))
return;
out.write("\";\r\n");
out.write("\t\tdocument.anatomyContentsInfo.submit();\r\n");
out.write("\t}\r\n");
out.write("\t\r\n");
out.write("\t\r\n");
out.write("\t// 취소 클릭시 Academy 컨텐츠 화면으로\r\n");
out.write("\tfunction goAcademyContentsList() {\r\n");
out.write("\t\tvar url = \"/contents/anatomyList.do\";\r\n");
out.write("\t\tlocation.href = url;\r\n");
out.write("\t}\r\n");
out.write("\t\t\r\n");
out.write("\tfunction deleteFileName(element) {\r\n");
out.write("\t\telement.value = null;\r\n");
out.write("\t}\r\n");
out.write("\t\r\n");
out.write("\t// 삭제\r\n");
out.write("\tfunction fnDeleteContents() {\r\n");
out.write("\t\tvar delConfirm = confirm('정말로 삭제 하시겠습니까?');\r\n");
out.write("\t\tif (delConfirm) {\r\n");
out.write("\t\t\tdocument.contentsInfo.action = \"");
if (_jspx_meth_c_005furl_005f2(_jspx_page_context))
return;
out.write("\";\r\n");
out.write("\t\t\tdocument.contentsInfo.submit();\r\n");
out.write("\t\t}\r\n");
out.write("\t}\r\n");
out.write("\r\n");
out.write("// ]]>\r\n");
out.write("</script>\r\n");
out.write("\t\t\t\r\n");
out.write("<section class=\"content-section\">\r\n");
out.write("\t<header class=\"content-header\">\r\n");
out.write("\t\t<h2 class=\"content-tit\">Anatomy Contents</h2>\r\n");
out.write("\t</header>\r\n");
out.write("\t\r\n");
out.write("\t<!-- [S] 게시물 수정/삭제 --> \r\n");
out.write("\t<article class=\"board-wrap\" data-board-type=\"form-write\">\r\n");
out.write("\t\t<div class=\"board-area\">\r\n");
out.write("\t\t\t<!-- 입력한 값을 전송하기 위해 form 태그를 사용한다 -->\r\n");
out.write("\t\t\t<form method=\"post\" action=\"/contents/anatomyUpdate.do\" name=\"anatomyContentsInfo\" id=\"anatomyContentsInfo\" onsubmit=\"return checkValue()\" enctype=\"multipart/form-data\">\r\n");
out.write("\t\t\t\t<input type=\"hidden\" name=\"seq\" id=\"seq\" value=\"");
if (_jspx_meth_c_005fout_005f0(_jspx_page_context))
return;
out.write("\" />\r\n");
out.write("\t\t\t\t<input type=\"hidden\" name=\"fileId\" id=\"fileId\" value=\"");
if (_jspx_meth_c_005fout_005f1(_jspx_page_context))
return;
out.write("\" />\r\n");
out.write("\t\t\t\t<input type=\"hidden\" name=\"contentsId\" id=\"contentsId\" value=\"");
if (_jspx_meth_c_005fout_005f2(_jspx_page_context))
return;
out.write("\" />\r\n");
out.write("\t\t\t\t<input type=\"hidden\" name=\"stateCode\" id=\"stateCode\" maxlength=\"50\" value=\"");
if (_jspx_meth_c_005fout_005f3(_jspx_page_context))
return;
out.write("\"/>\r\n");
out.write("\t\t\t\t<input type=\"hidden\" name=\"menuId\" id=\"menuId\" value=\"");
if (_jspx_meth_c_005fout_005f4(_jspx_page_context))
return;
out.write("\"/>\r\n");
out.write("\t\t\t\t<input type=\"hidden\" name=\"thumFileName\" id=\"thumFileName\" value=\"");
if (_jspx_meth_c_005fout_005f5(_jspx_page_context))
return;
out.write("\"/>\r\n");
out.write("\t\t\t\t<input type=\"hidden\" name=\"fileName\" id=\"fileName\" value=\"");
if (_jspx_meth_c_005fout_005f6(_jspx_page_context))
return;
out.write("\"/>\r\n");
out.write("\t\t\t\t<div id=\"append\"></div>\r\n");
out.write("\t\t\t\t\r\n");
out.write("\t\t\t\t<table class=\"default-table\">\r\n");
out.write("\t\t\t\t\t<caption>Anatomy 수정</caption>\r\n");
out.write("\t\t\t\t\t<colgroup>\r\n");
out.write("\t\t\t\t\t\t<col style=\"width:30%;\" />\r\n");
out.write("\t\t\t\t\t\t<col style=\"width:auto;\" />\r\n");
out.write("\t\t\t\t\t</colgroup>\r\n");
out.write("\t\t\t\t\t\r\n");
out.write("\t\t\t\t\t<tbody>\r\n");
out.write("\t\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t\t\t\t<th scale=\"col\" data-text-style=\"essential\">카테고리</th>\r\n");
out.write("\t\t\t\t\t\t\t<td>\r\n");
out.write("\t\t\t\t\t\t\t<ul class=\"form\" data-form=\"radio\">\r\n");
out.write("\t\t\t\t\t\t\t");
if (_jspx_meth_c_005fforEach_005f0(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t</ul>\r\n");
out.write("\t\t\t\t\t\t\t</td>\r\n");
out.write("\t\t\t\t\t\t</tr>\r\n");
out.write("\t\t\t\t\t\r\n");
out.write("\t\t\t\t\t\r\n");
out.write("\t\t\t\t\t\t\r\n");
out.write("\t\t\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t\t\t\t<th scale=\"col\" data-text-style=\"essential\">제목</th>\r\n");
out.write("\t\t\t\t\t\t\t<td>\r\n");
out.write("\t\t\t\t\t\t\t\t<div class=\"form\"><input type=\"text\" class=\"input-form\" name=\"title\" id=\"title\" maxlength=\"70\" placeholder=\"제목을 입력해주세요.\" value=\"");
if (_jspx_meth_c_005fout_005f11(_jspx_page_context))
return;
out.write("\" /></div>\r\n");
out.write("\t\t\t\t\t\t\t</td>\r\n");
out.write("\t\t\t\t\t\t</tr>\r\n");
out.write("\t\t\t\t\t\t\r\n");
out.write("\t\t\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t\t\t\t<th scale=\"col\">강의 내용</th>\r\n");
out.write("\t\t\t\t\t\t\t<td>\r\n");
out.write("\t\t\t\t\t\t\t\t<div class=\"form\"><textarea class=\"input-form\" name=\"contents\" id=\"contents\" placeholder=\"문의 내용을 입력해주세요.\" rows=\"12\">");
if (_jspx_meth_c_005fout_005f12(_jspx_page_context))
return;
out.write("</textarea></div>\r\n");
out.write("\t\t\t\t\t\t\t</td>\r\n");
out.write("\t\t\t\t\t\t</tr>\r\n");
out.write("\t\t\t\t\t\t\r\n");
out.write("\t\t\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t\t\t\t<th scale=\"col\" data-text-style=\"essential\">썸네일 이미지</th>\r\n");
out.write("\t\t\t\t\t\t\t<td>\r\n");
out.write("\t\t\t\t\t\t\t\t<div class=\"form-area\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"fileName\" value=\"");
if (_jspx_meth_c_005fout_005f13(_jspx_page_context))
return;
out.write("\" />\r\n");
out.write("\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"uploadFilePath\" value=\"");
if (_jspx_meth_c_005fout_005f14(_jspx_page_context))
return;
out.write("\" />\r\n");
out.write("\t\t\t\t\t\t\t\t\t<div class=\"form\" data-mult-form=\"uploade-file\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"link-btn\" onclick=\"fnDownload(0);\">");
if (_jspx_meth_c_005fout_005f15(_jspx_page_context))
return;
out.write("</a>\r\n");
out.write("\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<div class=\"form\" data-mult-form=\"file\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"input-form\" readonly />\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<input type=\"file\" class=\"file-form\" name=\"uploadFileThum\" id=\"uploadFileThum\" />\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<label for=\"uploadFileThum\" class=\"file-label\">찾아보기</label>\r\n");
out.write("\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<p class=\"form-txt\"><span class=\"point-color\">340 X 190</span> 해상도 이미지 파일로 업로드하여 주시기 바랍니다</p>\r\n");
out.write("\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t</td>\r\n");
out.write("\t\t\t\t\t\t</tr>\r\n");
out.write("\t\t\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<th scale=\"col\" data-text-style=\"essential\">강의 영상</th>\r\n");
out.write("\t\t\t\t\t\t\t<td>\r\n");
out.write("\t\t\t\t\t\t\t\t<div class=\"form-area\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"fileName\" value=\"");
if (_jspx_meth_c_005fout_005f16(_jspx_page_context))
return;
out.write("\" />\r\n");
out.write("\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"uploadFilePath\" value=\"");
if (_jspx_meth_c_005fout_005f17(_jspx_page_context))
return;
out.write("\" />\r\n");
out.write("\t\t\t\t\t\t\t\t\t<div class=\"form\" data-mult-form=\"uploade-file\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"link-btn\" onclick=\"fnDownload(1);\">");
if (_jspx_meth_c_005fout_005f18(_jspx_page_context))
return;
out.write("</a>\r\n");
out.write("\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<div class=\"form\" data-mult-form=\"file\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"input-form\" readonly />\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<input type=\"file\" class=\"file-form\" name=\"uploadFileDetail\" id=\"uploadFileDetail\" />\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<label for=\"uploadFileDetail\" class=\"file-label\">찾아보기</label>\r\n");
out.write("\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t </td>\r\n");
out.write("\t\t\t\t\t\t</tr>\r\n");
out.write("\t\t\t\t\t\t\r\n");
out.write("\t\t\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t\t\t\t<th scale=\"col\" data-text-style=\"essential\">담당 강사</th>\r\n");
out.write("\t\t\t\t\t\t\t<td>\r\n");
out.write("\t\t\t\t\t\t\t\t<div class=\"form\" data-form=\"select\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<select class=\"select-form\" id=\"readerUserId\" name=\"readerUserId\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<option value=\"\"> 담당 강사를 반드시 선택하세요 </option>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t");
if (_jspx_meth_c_005fforEach_005f1(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t\t\t\t\t \t\t</select>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<i class=\"fas fa-angle-down\"></i>\r\n");
out.write("\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t \t\t\t\t\r\n");
out.write("\t\t\t\t\t\t\t</td>\r\n");
out.write("\t\t\t\t\t\t</tr>\r\n");
out.write("\t\t\t\t\t\t\r\n");
out.write("\t\t\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t\t\t\t<th scale=\"col\">설문 조사</th>\r\n");
out.write("\t\t\t\t\t\t\t<td>\r\n");
out.write("\t\t\t\t\t\t\t\t<div class=\"form\" data-form=\"select\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<select class=\"select-form\" id=\"surveyId\" name=\"surveyId\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<option value=\"\"> 설문조사를 선택하세요 </option>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t");
if (_jspx_meth_c_005fforEach_005f2(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t\t\t\t\t \t\t</select>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<i class=\"fas fa-angle-down\"></i>\r\n");
out.write("\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t</td>\r\n");
out.write("\t\t\t\t\t\t</tr>\r\n");
out.write("\t\t\t\t\t</tbody>\t\t\t\t\r\n");
out.write("\t\t\t\t</table>\r\n");
out.write("\t\t\t\r\n");
out.write("\t\t\t\t<div class=\"submit-area\">\r\n");
out.write("\t\t\t\t\t<button type=\"button\" class=\"sub-btn\" data-offset=\"left\" onclick=\"fnDeleteContents();\">삭제</button>\r\n");
out.write("\t\t\t\t\t<button type=\"button\" class=\"sub-btn\" onclick=\"goAcademyContentsList();\">취소</button>\r\n");
out.write("\t\t\t\t\t<button type=\"submit\" class=\"main-btn\">수정</button>\r\n");
out.write("\t\t\t\t</div>\r\n");
out.write("\t\t\t</form>\r\n");
out.write("\t\t</div>\r\n");
out.write("\t</article>\r\n");
out.write("\t<!-- [E] 게시물 수정/삭제 -->\r\n");
out.write("\r\n");
out.write("</section>\r\n");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_c_005furl_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:url
org.apache.taglibs.standard.tag.rt.core.UrlTag _jspx_th_c_005furl_005f0 = (org.apache.taglibs.standard.tag.rt.core.UrlTag) _005fjspx_005ftagPool_005fc_005furl_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.UrlTag.class);
_jspx_th_c_005furl_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005furl_005f0.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(43,34) name = value type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005furl_005f0.setValue("/function/filedownload/downloadFileList.do");
int _jspx_eval_c_005furl_005f0 = _jspx_th_c_005furl_005f0.doStartTag();
if (_jspx_th_c_005furl_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005furl_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005furl_005f0);
return true;
}
_005fjspx_005ftagPool_005fc_005furl_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005furl_005f0);
return false;
}
private boolean _jspx_meth_c_005furl_005f1(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:url
org.apache.taglibs.standard.tag.rt.core.UrlTag _jspx_th_c_005furl_005f1 = (org.apache.taglibs.standard.tag.rt.core.UrlTag) _005fjspx_005ftagPool_005fc_005furl_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.UrlTag.class);
_jspx_th_c_005furl_005f1.setPageContext(_jspx_page_context);
_jspx_th_c_005furl_005f1.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(49,41) name = value type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005furl_005f1.setValue("/contents/anatomyUpdate.do");
int _jspx_eval_c_005furl_005f1 = _jspx_th_c_005furl_005f1.doStartTag();
if (_jspx_th_c_005furl_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005furl_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005furl_005f1);
return true;
}
_005fjspx_005ftagPool_005fc_005furl_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005furl_005f1);
return false;
}
private boolean _jspx_meth_c_005furl_005f2(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:url
org.apache.taglibs.standard.tag.rt.core.UrlTag _jspx_th_c_005furl_005f2 = (org.apache.taglibs.standard.tag.rt.core.UrlTag) _005fjspx_005ftagPool_005fc_005furl_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.UrlTag.class);
_jspx_th_c_005furl_005f2.setPageContext(_jspx_page_context);
_jspx_th_c_005furl_005f2.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(68,35) name = value type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005furl_005f2.setValue("/contents/anatomyDelete.do");
int _jspx_eval_c_005furl_005f2 = _jspx_th_c_005furl_005f2.doStartTag();
if (_jspx_th_c_005furl_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005furl_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005furl_005f2);
return true;
}
_005fjspx_005ftagPool_005fc_005furl_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005furl_005f2);
return false;
}
private boolean _jspx_meth_c_005fout_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f0 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f0.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(86,52) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f0.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.seq}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f0 = _jspx_th_c_005fout_005f0.doStartTag();
if (_jspx_th_c_005fout_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f0);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f0);
return false;
}
private boolean _jspx_meth_c_005fout_005f1(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f1 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f1.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f1.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(87,58) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f1.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.fileId}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f1 = _jspx_th_c_005fout_005f1.doStartTag();
if (_jspx_th_c_005fout_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f1);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f1);
return false;
}
private boolean _jspx_meth_c_005fout_005f2(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f2 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f2.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f2.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(88,66) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f2.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.contentsId}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f2 = _jspx_th_c_005fout_005f2.doStartTag();
if (_jspx_th_c_005fout_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f2);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f2);
return false;
}
private boolean _jspx_meth_c_005fout_005f3(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f3 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f3.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f3.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(89,79) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f3.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.stateCode}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f3 = _jspx_th_c_005fout_005f3.doStartTag();
if (_jspx_th_c_005fout_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f3);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f3);
return false;
}
private boolean _jspx_meth_c_005fout_005f4(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f4 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f4.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f4.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(90,58) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f4.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${menuId}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f4 = _jspx_th_c_005fout_005f4.doStartTag();
if (_jspx_th_c_005fout_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f4);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f4);
return false;
}
private boolean _jspx_meth_c_005fout_005f5(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f5 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f5.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f5.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(91,70) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f5.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.thumFileName }", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f5 = _jspx_th_c_005fout_005f5.doStartTag();
if (_jspx_th_c_005fout_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f5);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f5);
return false;
}
private boolean _jspx_meth_c_005fout_005f6(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f6 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f6.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f6.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(92,62) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f6.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.fileName}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f6 = _jspx_th_c_005fout_005f6.doStartTag();
if (_jspx_th_c_005fout_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f6);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f6);
return false;
}
private boolean _jspx_meth_c_005fforEach_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f0.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(107,7) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setVar("categoryCodeList");
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(107,7) name = items type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setItems(new org.apache.jasper.el.JspValueExpression("/WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(107,7) '${categoryCodeList}'",_el_expressionfactory.createValueExpression(_jspx_page_context.getELContext(),"${categoryCodeList}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext()));
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(107,7) name = varStatus type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setVarStatus("status");
int[] _jspx_push_body_count_c_005fforEach_005f0 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f0 = _jspx_th_c_005fforEach_005f0.doStartTag();
if (_jspx_eval_c_005fforEach_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t");
if (_jspx_meth_c_005fset_005f0(_jspx_th_c_005fforEach_005f0, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f0))
return true;
out.write("\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t<li><input type=\"radio\" class=\"check-form\" name=\"categoryCode\" id=\"menuId_");
if (_jspx_meth_c_005fout_005f7(_jspx_th_c_005fforEach_005f0, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f0))
return true;
out.write("\" value=\"");
if (_jspx_meth_c_005fout_005f8(_jspx_th_c_005fforEach_005f0, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f0))
return true;
out.write("\" \r\n");
out.write("\t\t\t\t\t\t\t\t\t");
if (_jspx_meth_c_005fif_005f0(_jspx_th_c_005fforEach_005f0, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f0))
return true;
out.write(" />\r\n");
out.write("\t\t\t\t\t\t\t\t\t<label for=\"menuId_");
if (_jspx_meth_c_005fout_005f9(_jspx_th_c_005fforEach_005f0, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f0))
return true;
out.write("\" class=\"label-form\">");
if (_jspx_meth_c_005fout_005f10(_jspx_th_c_005fforEach_005f0, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f0))
return true;
out.write("</label>\r\n");
out.write("\t\t\t\t\t\t\t\t</li>\r\n");
out.write("\t\t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (java.lang.Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f0[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f0.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f0.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f0);
}
return false;
}
private boolean _jspx_meth_c_005fset_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f0, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f0)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:set
org.apache.taglibs.standard.tag.rt.core.SetTag _jspx_th_c_005fset_005f0 = (org.apache.taglibs.standard.tag.rt.core.SetTag) _005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.SetTag.class);
_jspx_th_c_005fset_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fset_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f0);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(108,8) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fset_005f0.setVar("index");
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(108,8) name = value type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null
_jspx_th_c_005fset_005f0.setValue(new org.apache.jasper.el.JspValueExpression("/WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(108,8) '${status.index}'",_el_expressionfactory.createValueExpression(_jspx_page_context.getELContext(),"${status.index}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext()));
int _jspx_eval_c_005fset_005f0 = _jspx_th_c_005fset_005f0.doStartTag();
if (_jspx_th_c_005fset_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.reuse(_jspx_th_c_005fset_005f0);
return true;
}
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.reuse(_jspx_th_c_005fset_005f0);
return false;
}
private boolean _jspx_meth_c_005fout_005f7(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f0, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f0)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f7 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f7.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f7.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f0);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(110,82) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f7.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${index}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f7 = _jspx_th_c_005fout_005f7.doStartTag();
if (_jspx_th_c_005fout_005f7.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f7);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f7);
return false;
}
private boolean _jspx_meth_c_005fout_005f8(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f0, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f0)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f8 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f8.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f8.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f0);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(110,116) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f8.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${categoryCodeList.code}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f8 = _jspx_th_c_005fout_005f8.doStartTag();
if (_jspx_th_c_005fout_005f8.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f8);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f8);
return false;
}
private boolean _jspx_meth_c_005fif_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f0, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f0)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:if
org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f0 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class);
_jspx_th_c_005fif_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fif_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f0);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(111,9) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fif_005f0.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.categoryCode == categoryCodeList.code}", java.lang.Boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false)).booleanValue());
int _jspx_eval_c_005fif_005f0 = _jspx_th_c_005fif_005f0.doStartTag();
if (_jspx_eval_c_005fif_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("checked");
int evalDoAfterBody = _jspx_th_c_005fif_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fif_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0);
return true;
}
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0);
return false;
}
private boolean _jspx_meth_c_005fout_005f9(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f0, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f0)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f9 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f9.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f9.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f0);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(112,28) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f9.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${index}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f9 = _jspx_th_c_005fout_005f9.doStartTag();
if (_jspx_th_c_005fout_005f9.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f9);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f9);
return false;
}
private boolean _jspx_meth_c_005fout_005f10(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f0, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f0)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f10 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f10.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f10.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f0);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(112,74) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f10.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${categoryCodeList.value}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f10 = _jspx_th_c_005fout_005f10.doStartTag();
if (_jspx_th_c_005fout_005f10.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f10);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f10);
return false;
}
private boolean _jspx_meth_c_005fout_005f11(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f11 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f11.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f11.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(124,136) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f11.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.title}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f11 = _jspx_th_c_005fout_005f11.doStartTag();
if (_jspx_th_c_005fout_005f11.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f11);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f11);
return false;
}
private boolean _jspx_meth_c_005fout_005f12(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f12 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f12.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f12.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(131,124) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f12.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.contents}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f12 = _jspx_th_c_005fout_005f12.doStartTag();
if (_jspx_th_c_005fout_005f12.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f12);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f12);
return false;
}
private boolean _jspx_meth_c_005fout_005f13(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f13 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f13.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f13.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(139,53) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f13.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.thumFileName}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f13 = _jspx_th_c_005fout_005f13.doStartTag();
if (_jspx_th_c_005fout_005f13.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f13);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f13);
return false;
}
private boolean _jspx_meth_c_005fout_005f14(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f14 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f14.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f14.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(140,59) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f14.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.thumFilePath}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f14 = _jspx_th_c_005fout_005f14.doStartTag();
if (_jspx_th_c_005fout_005f14.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f14);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f14);
return false;
}
private boolean _jspx_meth_c_005fout_005f15(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f15 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f15.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f15.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(142,64) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f15.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.thumFileName}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f15 = _jspx_th_c_005fout_005f15.doStartTag();
if (_jspx_th_c_005fout_005f15.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f15);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f15);
return false;
}
private boolean _jspx_meth_c_005fout_005f16(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f16 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f16.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f16.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(157,53) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f16.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.fileName}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f16 = _jspx_th_c_005fout_005f16.doStartTag();
if (_jspx_th_c_005fout_005f16.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f16);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f16);
return false;
}
private boolean _jspx_meth_c_005fout_005f17(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f17 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f17.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f17.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(158,59) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f17.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.filePath}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f17 = _jspx_th_c_005fout_005f17.doStartTag();
if (_jspx_th_c_005fout_005f17.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f17);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f17);
return false;
}
private boolean _jspx_meth_c_005fout_005f18(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f18 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f18.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f18.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(160,64) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f18.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.fileName}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f18 = _jspx_th_c_005fout_005f18.doStartTag();
if (_jspx_th_c_005fout_005f18.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f18);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f18);
return false;
}
private boolean _jspx_meth_c_005fforEach_005f1(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f1 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f1.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f1.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(177,10) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f1.setVar("result");
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(177,10) name = items type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f1.setItems(new org.apache.jasper.el.JspValueExpression("/WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(177,10) '${lecturerList}'",_el_expressionfactory.createValueExpression(_jspx_page_context.getELContext(),"${lecturerList}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext()));
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(177,10) name = varStatus type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f1.setVarStatus("status");
int[] _jspx_push_body_count_c_005fforEach_005f1 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f1 = _jspx_th_c_005fforEach_005f1.doStartTag();
if (_jspx_eval_c_005fforEach_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<option value=\"");
if (_jspx_meth_c_005fout_005f19(_jspx_th_c_005fforEach_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write("\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t");
if (_jspx_meth_c_005fif_005f1(_jspx_th_c_005fforEach_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write(" > \r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t");
if (_jspx_meth_c_005fout_005f20(_jspx_th_c_005fforEach_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1))
return true;
out.write(" </option>\r\n");
out.write("\t\t\t\t\t\t\t \t\t");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (java.lang.Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f1[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f1.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f1.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f1);
}
return false;
}
private boolean _jspx_meth_c_005fout_005f19(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f19 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f19.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f19.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f1);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(178,26) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f19.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${result.readerUserId}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f19 = _jspx_th_c_005fout_005f19.doStartTag();
if (_jspx_th_c_005fout_005f19.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f19);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f19);
return false;
}
private boolean _jspx_meth_c_005fif_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:if
org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f1 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class);
_jspx_th_c_005fif_005f1.setPageContext(_jspx_page_context);
_jspx_th_c_005fif_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f1);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(179,11) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fif_005f1.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.readerUserId == result.readerUserId}", java.lang.Boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false)).booleanValue());
int _jspx_eval_c_005fif_005f1 = _jspx_th_c_005fif_005f1.doStartTag();
if (_jspx_eval_c_005fif_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write(" selected=\"selected\"");
int evalDoAfterBody = _jspx_th_c_005fif_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fif_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f1);
return true;
}
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f1);
return false;
}
private boolean _jspx_meth_c_005fout_005f20(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f20 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f20.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f20.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f1);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(180,11) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f20.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${result.nameLast} ${result.nameFirst} ", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f20 = _jspx_th_c_005fout_005f20.doStartTag();
if (_jspx_th_c_005fout_005f20.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f20);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f20);
return false;
}
private boolean _jspx_meth_c_005fforEach_005f2(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f2 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f2.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f2.setParent(null);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(195,10) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f2.setVar("survey");
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(195,10) name = items type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f2.setItems(new org.apache.jasper.el.JspValueExpression("/WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(195,10) '${surveyList}'",_el_expressionfactory.createValueExpression(_jspx_page_context.getELContext(),"${surveyList}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext()));
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(195,10) name = varStatus type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f2.setVarStatus("status");
int[] _jspx_push_body_count_c_005fforEach_005f2 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f2 = _jspx_th_c_005fforEach_005f2.doStartTag();
if (_jspx_eval_c_005fforEach_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<option value=\"");
if (_jspx_meth_c_005fout_005f21(_jspx_th_c_005fforEach_005f2, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f2))
return true;
out.write("\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t");
if (_jspx_meth_c_005fif_005f2(_jspx_th_c_005fforEach_005f2, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f2))
return true;
out.write(" > \r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t");
if (_jspx_meth_c_005fout_005f22(_jspx_th_c_005fforEach_005f2, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f2))
return true;
out.write(" </option>\r\n");
out.write("\t\t\t\t\t\t\t \t\t");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (java.lang.Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f2[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f2.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f2.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f2);
}
return false;
}
private boolean _jspx_meth_c_005fout_005f21(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f2, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f2)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f21 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f21.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f21.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f2);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(196,26) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f21.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${survey.code}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f21 = _jspx_th_c_005fout_005f21.doStartTag();
if (_jspx_th_c_005fout_005f21.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f21);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f21);
return false;
}
private boolean _jspx_meth_c_005fif_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f2, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f2)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:if
org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f2 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class);
_jspx_th_c_005fif_005f2.setPageContext(_jspx_page_context);
_jspx_th_c_005fif_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f2);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(197,11) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fif_005f2.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${contentsResult.surveyId == survey.code}", java.lang.Boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false)).booleanValue());
int _jspx_eval_c_005fif_005f2 = _jspx_th_c_005fif_005f2.doStartTag();
if (_jspx_eval_c_005fif_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write(" selected=\"selected\"");
int evalDoAfterBody = _jspx_th_c_005fif_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fif_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f2);
return true;
}
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f2);
return false;
}
private boolean _jspx_meth_c_005fout_005f22(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f2, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f2)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f22 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_005fout_005f22.setPageContext(_jspx_page_context);
_jspx_th_c_005fout_005f22.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f2);
// /WEB-INF/jsp/contents/academy/anatomy/contentsUpdate.jsp(198,11) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fout_005f22.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${survey.value}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
int _jspx_eval_c_005fout_005f22 = _jspx_th_c_005fout_005f22.doStartTag();
if (_jspx_th_c_005fout_005f22.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f22);
return true;
}
_005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f22);
return false;
}
}
| [
"41039964+yuyunsu1187@users.noreply.github.com"
] | 41039964+yuyunsu1187@users.noreply.github.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.