blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
acb04e9cb6832c99d8993a640af679d17a9d4c98 | 33d1d44adefae082b6bc976520b2d54fc1829186 | /src/main/java/dpl/SimulationManagement/InternalStateMachine/InternalEndState.java | 76c0a273738d09241f1d834c5f38129d6148215d | [] | no_license | prashantsarvi/Ice-Hockey-Simulator | 36f9399d740caca7cecd3f49be3bc58d7441f90a | 5067d042394faebf670512df4400961d1c491b1b | refs/heads/master | 2023-04-21T05:41:16.898195 | 2021-05-05T22:18:17 | 2021-05-05T22:18:17 | 364,662,054 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,083 | java | package dpl.SimulationManagement.InternalStateMachine;
import dpl.SimulationManagement.StateConstants;
import dpl.UserInputOutput.UserOutput.IUserOutput;
import java.util.logging.Level;
import java.util.logging.Logger;
public class InternalEndState implements ISimulationState {
private static IUserOutput output;
private static String stateName;
private static String nextStateName;
private static final Logger log = Logger.getLogger(InternalEndState.class.getName());
public InternalEndState(IUserOutput output) {
this.output = output;
this.stateName = StateConstants.END_STATE;
}
public ISimulationState nextState(InternalStateContext context) {
this.nextStateName = StateConstants.NO_STATE;
return null;
}
public void doProcessing() {
output.setOutput(StateConstants.END_STATE_FINISH);
output.sendOutput();
log.log(Level.INFO, StateConstants.END_STATE_FINISH);
}
public boolean shouldContinue() {
return true;
}
public String getStateName() {
return this.stateName;
}
public String getNextStateName() {
return this.nextStateName;
}
}
| [
"pr486824@dal.ca"
] | pr486824@dal.ca |
27d87036591c1e0794ae2f385f8f0510d05cf01b | 48dcb3423bb54716c731d35d271e9444566216b4 | /core/src/com/fworg64/duckpond/game/Assets.java | 9ad3d94e34d535f683f0154813900e6e5f9883d0 | [
"MIT"
] | permissive | Fworg64/DuckPond | 2ea60c79984c6e83ffa380c7c9ae809843e7dcca | f917290e1c2ef87a5397763edf9038186e00bae3 | refs/heads/master | 2021-01-24T17:47:25.451795 | 2016-06-23T22:02:01 | 2016-06-23T22:02:10 | 50,696,046 | 0 | 0 | null | 2016-02-14T00:10:12 | 2016-01-29T22:36:31 | Java | UTF-8 | Java | false | false | 21,034 | java | package com.fworg64.duckpond.game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.utils.Array;
/**
* This is the Assets files, it handles loading of assets
* and is where all assets are accesed from
*
*
* this includes textures and sounds
*
* Created by fworg on 2/9/2016.
*/
public class Assets
{
public static BitmapFont font;
public static Texture LevelEditMapaAbajo;
public static Texture LevelEditClock;
public static Texture LevelEditConfirm;
public static Texture LevelEditDuck;
public static Texture LevelEditExit;
public static Texture LevelEditFlechaIzq;
public static TextureRegion LevelEditFlechaDer;
public static Texture LevelEditLily;
public static Texture LevelEditLOAD;
public static Texture LevelEditRemoveItem;
public static Texture LevelEditSave;
public static Texture LevelEditShark;
public static Texture LevelEditTimeBar;
public static Texture LevelEditLives;
public static Texture LevelEditUnlives;
public static Texture LevelEditShare;
public static Texture LevelEditNumblock;
public static Texture NavigationFlechaIzq;
public static TextureRegion NavigationFlechaDer;
public static Texture NavigationUpone;
public static Texture NavigationCancel;
public static Texture NavigationConfirm;
public static Texture NavigationWorldButt;
public static Texture NavigationBack;
public static Texture NavigationFolder;
public static Texture LevelSelectionMainMenu;
public static Texture LevelSelectionGetMore;
public static Texture LevelSelectionWorldMaker;
public static Texture ShareBigAst;
public static Texture MainMenuTitle;
public static Texture MainMenuPlay;
public static Texture MainMenuOptions;
public static Texture MainMenuExit;
public static Texture OptionsMenu;
public static Texture OptionsMenuSlider;
public static Texture OptionsMenuSliderPressed;
public static Texture OptionsMenuCheckMark;
public static Texture OptionsMenuReturnPressed;
public static Texture OptionsMenuCreditsPressed;
public static Texture GameBackground;
public static Texture HUD;
public static Texture HUDMute;
public static Texture HUDUnmute;
public static Texture HUDlives;
public static Texture GamePaused;
public static Texture GameVictory;
public static Texture GameDefeat;
public static Texture GamePlay;
public static Texture GameMenuButt;
private static Texture duck;
private static TextureRegion[][] duckframes;
private static TextureRegion[] duckSwimUp;
private static TextureRegion[] duckSwimDown;
private static TextureRegion[] duckSwimSideRight;
//private static TextureRegion[] duckSwimSideLeft;
private static TextureRegion[] duckPad;
private static TextureRegion[] duckEaten;
public static Array<TextureRegion> duckSwimUpFrames;
public static Array<TextureRegion> duckSwimDownFrames;
public static Array<TextureRegion> duckSwimSideRightFrames;
public static Array<TextureRegion> duckSwimSideLeftFrames;
public static Array<TextureRegion> duckPadFrames;
public static Array<TextureRegion> duckEatenFrames;
public static Animation swimUpAnim;
public static Animation swimSideRightAnim;
public static Animation swimSideLeftAnim;
public static Animation swimDownAnim;
public static Animation eatenAnim;
public static Animation padAnim; //for the duck
private static Texture shark;
private static TextureRegion[][] sharkframes;
private static TextureRegion[] sharkSwimLeft;
//private static TextureRegion[] sharkSwimRight;
private static TextureRegion[] sharkSwimUp;
private static TextureRegion[] sharkSwimDown;
private static TextureRegion[] sharkEat;
public static Array<TextureRegion> sharkSwimLeftFrames;
public static Array<TextureRegion> sharkSwimRightFrames;
public static Array<TextureRegion> sharkSwimUpFrames;
public static Array<TextureRegion> sharkSwimDownFrames;
public static Array<TextureRegion> sharkEatFrames;
public static Animation sharkEatAnim;
public static Animation sharkSwimLeftAnim;
public static Animation sharkSwimRightAnim;
public static Animation sharkSwimUpAnim;
public static Animation sharkSwimDownAnim;
public static Texture lily;
static String res;
public static void load_mainmenu()
{
Gdx.app.debug("Assets: ", "MainMenu Loading");
if (Options.highres) res = "highres\\";
else res = "stdres\\";
MainMenuTitle = new Texture(Gdx.files.internal(res + "mainmenu\\title.png"));
MainMenuPlay = new Texture(Gdx.files.internal(res + "mainmenu\\play.png"));
MainMenuOptions = new Texture(Gdx.files.internal(res + "mainmenu\\options.png"));
MainMenuExit = new Texture(Gdx.files.internal(res + "mainmenu\\exit.png"));
}
public static void dispose_mainmenu()
{
MainMenuTitle.dispose();
MainMenuPlay.dispose();
MainMenuOptions.dispose();
MainMenuExit.dispose();
}
public static void load_options()
{
if (Options.highres) res = "highres\\";
else res = "stdres\\";
OptionsMenu = new Texture(Gdx.files.internal(res + "options\\options.png"));
OptionsMenuSlider = new Texture(Gdx.files.internal(res + "options\\cuadrado.png"));
OptionsMenuSliderPressed = new Texture(Gdx.files.internal(res + "options\\cuadradooscuro.png"));
OptionsMenuCheckMark = new Texture(Gdx.files.internal(res + "options\\checkmark.png"));
OptionsMenuReturnPressed = new Texture(Gdx.files.internal(res + "options\\returnoscuro.png"));
OptionsMenuCreditsPressed = new Texture(Gdx.files.internal(res + "options\\creditsoscuro.png"));
}
public static void dispose_options()
{
OptionsMenu.dispose();
OptionsMenuSlider.dispose();
OptionsMenuSliderPressed.dispose();
OptionsMenuCheckMark.dispose();
OptionsMenuReturnPressed.dispose();
OptionsMenuCreditsPressed.dispose();
}
public static void load_gamescreen()
{
if (Options.highres) res = "highres\\";
else res = "stdres\\";
GameBackground = new Texture(Gdx.files.internal(res + "gamescreen\\gbkgnd.png"));
HUD = new Texture(Gdx.files.internal(res + "gamescreen\\barrita.png"));
HUDMute = new Texture(Gdx.files.internal(res + "gamescreen\\mute.png"));
HUDUnmute = new Texture(Gdx.files.internal(res + "gamescreen\\unmute.png"));
HUDlives = new Texture(Gdx.files.internal(res + "gamescreen\\lives.png"));
GamePaused = new Texture(Gdx.files.internal(res + "gamescreen\\paused.png"));
GameVictory = new Texture(Gdx.files.internal(res + "gamescreen\\youwon.png"));
GameDefeat = new Texture(Gdx.files.internal(res + "gamescreen\\youlost.png"));
GamePlay = new Texture(Gdx.files.internal(res + "gamescreen\\play.png"));
GameMenuButt = new Texture(Gdx.files.internal(res + "gamescreen\\menubutt.png"));
duck = new Texture(Gdx.files.internal(res + "gamescreen\\duck.png"));
duckframes = TextureRegion.split(duck, Options.spriteWidth,Options.spriteHeight);
duckSwimUp = new TextureRegion[] {duckframes[0][0], duckframes[1][0], duckframes[2][0], duckframes[3][0], duckframes[4][0]};
duckSwimDown = new TextureRegion[] {duckframes[0][2], duckframes[1][2], duckframes[2][2], duckframes[3][2], duckframes[4][2]};
duckSwimSideRight = new TextureRegion[] {duckframes[0][1], duckframes[1][1], duckframes[2][1], duckframes[3][1], duckframes[4][1]};
//duckSwimSideLeft = new TextureRegion[] {duckframes[0][1], duckframes[1][1], duckframes[2][1]};
duckPad = new TextureRegion[] {duckframes[0][4], duckframes[1][4]};
duckEaten = new TextureRegion[] {duckframes[0][3], duckframes[1][3], duckframes[2][3], duckframes[3][3]};
duckSwimUpFrames = new Array<TextureRegion>(duckSwimUp);
duckSwimDownFrames = new Array<TextureRegion>(duckSwimDown);
duckSwimSideRightFrames = new Array<TextureRegion>(duckSwimSideRight);
duckSwimSideLeftFrames = new Array<TextureRegion>();
for (TextureRegion t:duckSwimSideRightFrames)
{
TextureRegion temp = new TextureRegion(t);
temp.flip(true,false);
duckSwimSideLeftFrames.add(temp);
}
duckPadFrames = new Array<TextureRegion>(duckPad);
duckEatenFrames = new Array<TextureRegion>(duckEaten);
swimUpAnim = new Animation(.2f, Assets.duckSwimUpFrames, Animation.PlayMode.LOOP_PINGPONG);
swimDownAnim = new Animation(.2f, Assets.duckSwimDownFrames, Animation.PlayMode.LOOP_PINGPONG);
swimSideRightAnim = new Animation(.2f, Assets.duckSwimSideRightFrames, Animation.PlayMode.LOOP_PINGPONG);
swimSideLeftAnim = new Animation(.2f, Assets.duckSwimSideLeftFrames, Animation.PlayMode.LOOP_PINGPONG);
eatenAnim = new Animation(.3f, Assets.duckEatenFrames, Animation.PlayMode.NORMAL);
padAnim = new Animation(.4f, Assets.duckPadFrames, Animation.PlayMode.LOOP);
lily = new Texture(Gdx.files.internal(res + "gamescreen\\lily.png"));
shark = new Texture(Gdx.files.internal(res + "gamescreen\\shark.png"));
sharkframes = TextureRegion.split(shark, Options.spriteWidth,Options.spriteHeight);
sharkSwimLeft = new TextureRegion[] {sharkframes[0][0], sharkframes[1][0], sharkframes[2][0], sharkframes[3][0], sharkframes[4][0]};
sharkSwimUp = new TextureRegion[] {sharkframes[0][3], sharkframes[1][3], sharkframes[2][3], sharkframes[3][3], sharkframes[4][3]};
sharkSwimDown = new TextureRegion[] {sharkframes[0][2], sharkframes[1][2], sharkframes[2][2], sharkframes[3][2], sharkframes[4][2]};
sharkEat = new TextureRegion[] {sharkframes[0][1], sharkframes[1][1], sharkframes[2][1], sharkframes[3][1], sharkframes[4][1]};
sharkSwimLeftFrames = new Array<TextureRegion>(sharkSwimLeft);
sharkSwimRightFrames = new Array<TextureRegion>();
for (TextureRegion t:sharkSwimLeftFrames)
{
TextureRegion temp = new TextureRegion(t);
temp.flip(true,false);
sharkSwimRightFrames.add(temp);
}
sharkSwimUpFrames = new Array<TextureRegion>(sharkSwimUp);
sharkSwimDownFrames = new Array<TextureRegion>(sharkSwimDown);
sharkEatFrames = new Array<TextureRegion>(sharkEat);
sharkSwimLeftAnim = new Animation(.2f, sharkSwimLeftFrames, Animation.PlayMode.LOOP);
sharkSwimRightAnim = new Animation(.2f, sharkSwimRightFrames, Animation.PlayMode.LOOP);
sharkSwimUpAnim = new Animation(.2f, sharkSwimUpFrames, Animation.PlayMode.LOOP);
sharkSwimDownAnim = new Animation(.2f, sharkSwimDownFrames, Animation.PlayMode.LOOP);
sharkEatAnim = new Animation(.2f, Assets.sharkEatFrames, Animation.PlayMode.NORMAL);
}
public static void dispose_gamescreen()
{
GameBackground.dispose();
HUD.dispose();
HUDMute.dispose();
HUDUnmute.dispose();
HUDlives.dispose();
GamePaused.dispose();
GameVictory.dispose();
GameDefeat.dispose();
GamePlay.dispose();
GameMenuButt.dispose();
duck.dispose();
lily.dispose();
shark.dispose();
//not sure what happens to the texture regions... dont touch them after this.
}
public static void load_levelscreen()
{
if (Options.highres) res = "highres\\";
else res = "stdres\\";
LevelSelectionWorldMaker = new Texture(Gdx.files.internal(res + "levelselection\\worldmakergreen.png"));
LevelSelectionGetMore = new Texture(Gdx.files.internal(res + "levelselection\\download.png"));
LevelSelectionMainMenu = new Texture(Gdx.files.internal(res + "levelselection\\mainbuttgreen.png"));
}
public static void dispose_levelscreen()
{
LevelSelectionWorldMaker.dispose();
LevelSelectionGetMore.dispose();
LevelSelectionMainMenu.dispose();
}
public static void load_navigation()
{
if (!Options.isHighres()) load_navigation_std();
else load_navigation_high();
}
public static void load_navigation_std()
{
NavigationCancel = new Texture(Gdx.files.internal("stdres\\navigation\\cancel.png"));
NavigationConfirm = new Texture(Gdx.files.internal("stdres\\navigation\\confirm.png"));
NavigationFlechaIzq = new Texture(Gdx.files.internal("stdres\\navigation\\flechaizq.png"));
NavigationFlechaDer = new TextureRegion(NavigationFlechaIzq);
NavigationFlechaDer.flip(true, false);
NavigationUpone = new Texture(Gdx.files.internal("stdres\\navigation\\upone.png"));
NavigationWorldButt = new Texture(Gdx.files.internal("stdres\\navigation\\levelbutt.png"));
NavigationBack = new Texture(Gdx.files.internal("stdres\\navigation\\back.png"));
NavigationFolder = new Texture(Gdx.files.internal("stdres\\navigation\\folder.png"));
}
public static void load_navigation_high()
{
NavigationCancel = new Texture(Gdx.files.internal("highres\\navigation\\cancel.png"));
NavigationConfirm = new Texture(Gdx.files.internal("highres\\navigation\\confirm.png"));
NavigationFlechaIzq = new Texture(Gdx.files.internal("highres\\navigation\\flechaizq.png"));
NavigationFlechaDer = new TextureRegion(NavigationFlechaIzq);
NavigationFlechaDer.flip(true, false);
NavigationUpone = new Texture(Gdx.files.internal("highres\\navigation\\upone.png"));
NavigationWorldButt = new Texture(Gdx.files.internal("highres\\navigation\\levelbutt.png"));
NavigationBack = new Texture(Gdx.files.internal("highres\\navigation\\back.png"));
NavigationFolder = new Texture(Gdx.files.internal("highres\\navigation\\folder.png"));
}
public static void dispose_navigation()
{
NavigationFlechaIzq.dispose();
NavigationCancel.dispose();
NavigationConfirm.dispose();
NavigationUpone.dispose();
NavigationWorldButt.dispose();
NavigationBack.dispose();
NavigationFolder.dispose();
}
public static void load_share()
{
Gdx.app.debug("Assets: ", "sharescreen Loading");
if (Options.highres) res = "highres\\";
else res = "stdres\\";
ShareBigAst = new Texture(Gdx.files.internal((res + "share\\bigast.png")));
}
public static void dispose_share()
{
ShareBigAst.dispose();
Gdx.app.debug("Assets: ", "disposed");
}
public static void load_font()
{
if (Options.highres) res = "highres\\";
else res = "stdres\\";
Gdx.app.debug("Assets: ", "Font Loading " + res);
font = new BitmapFont(Gdx.files.internal(res + "font\\lois.fnt"), Gdx.files.internal(res + "font\\loisfont.png"), false, false);
}
public static void load_font_std()
{
Gdx.app.debug("Assets: ", "Explicit loading std font");
font = new BitmapFont(Gdx.files.internal("stdres\\font\\lois.fnt"), Gdx.files.internal("stdres\\font\\loisfont.png"), false, false);
}
public static void load_font_high()
{
Gdx.app.debug("Assets: ", "Explicit loading high font");
font = new BitmapFont(Gdx.files.internal("highres\\font\\lois.fnt"), Gdx.files.internal("highres\\font\\loisfont.png"), false, false);
}
public static void dispose_font()
{
font.dispose();
}
public static void load_leveledit()
{
load_font();
LevelEditMapaAbajo = new Texture(Gdx.files.internal("leveledit\\mapaabajo.png"));
LevelEditClock = new Texture(Gdx.files.internal("leveledit\\RELOJ.png"));
LevelEditConfirm = new Texture(Gdx.files.internal("leveledit\\CONFIRM.png"));
LevelEditDuck = new Texture(Gdx.files.internal("leveledit\\duck.png"));
LevelEditExit = new Texture(Gdx.files.internal("leveledit\\EXIT.png"));
LevelEditLily = new Texture(Gdx.files.internal("leveledit\\lily.png"));
LevelEditLOAD = new Texture(Gdx.files.internal("leveledit\\LOAD.png"));
LevelEditLives = new Texture(Gdx.files.internal("leveledit\\lives.png"));
LevelEditUnlives = new Texture(Gdx.files.internal("leveledit\\unlives.png"));
LevelEditRemoveItem = new Texture(Gdx.files.internal("leveledit\\REMOVEITEM.png"));
LevelEditSave = new Texture(Gdx.files.internal("leveledit\\SAVE.png"));
LevelEditShark = new Texture(Gdx.files.internal("leveledit\\shark.png"));
LevelEditTimeBar = new Texture(Gdx.files.internal("leveledit\\timebar.png"));
LevelEditFlechaIzq = new Texture(Gdx.files.internal("leveledit\\flechaizq.png"));
LevelEditFlechaDer = new TextureRegion(LevelEditFlechaIzq);
LevelEditFlechaDer.flip(true, false);
LevelEditShare = new Texture(Gdx.files.internal("leveledit\\share.png"));
LevelEditNumblock = new Texture(Gdx.files.internal("leveledit\\numblock.png"));
GameBackground = new Texture(Gdx.files.internal("leveledit\\gbkgnd.png"));
duck = new Texture(Gdx.files.internal("stdres\\gamescreen\\duck.png"));
duckframes = TextureRegion.split(duck, DuckPondGame.stdspriteW,DuckPondGame.stdspriteH);
duckSwimUp = new TextureRegion[] {duckframes[0][0], duckframes[1][0], duckframes[2][0]};
duckSwimDown = new TextureRegion[] {duckframes[0][2], duckframes[1][2], duckframes[2][2]};
duckSwimSideRight = new TextureRegion[] {duckframes[0][1], duckframes[1][1], duckframes[2][1]};
//duckSwimSideLeft = new TextureRegion[] {duckframes[0][1], duckframes[1][1], duckframes[2][1]};
duckSwimUpFrames = new Array<TextureRegion>(duckSwimUp);
duckSwimDownFrames = new Array<TextureRegion>(duckSwimDown);
duckSwimSideRightFrames = new Array<TextureRegion>(duckSwimSideRight);
duckSwimSideLeftFrames = new Array<TextureRegion>();
for (TextureRegion t:duckSwimSideRightFrames)
{
TextureRegion temp = new TextureRegion(t);
temp.flip(true,false);
duckSwimSideLeftFrames.add(temp);
}
swimUpAnim = new Animation(.2f, Assets.duckSwimUpFrames, Animation.PlayMode.LOOP_PINGPONG);
swimDownAnim = new Animation(.2f, Assets.duckSwimDownFrames, Animation.PlayMode.LOOP_PINGPONG);
swimSideRightAnim = new Animation(.2f, Assets.duckSwimSideRightFrames, Animation.PlayMode.LOOP_PINGPONG);
swimSideLeftAnim = new Animation(.2f, Assets.duckSwimSideLeftFrames, Animation.PlayMode.LOOP_PINGPONG);
shark = new Texture(Gdx.files.internal("stdres\\gamescreen\\shark.png"));
sharkframes = TextureRegion.split(shark, DuckPondGame.stdspriteW,DuckPondGame.stdspriteH);
sharkSwimLeft = new TextureRegion[] {sharkframes[0][0], sharkframes[1][0]};
sharkSwimUp = new TextureRegion[] {sharkframes[0][3], sharkframes[1][3]};
sharkSwimDown = new TextureRegion[] {sharkframes[0][2], sharkframes[1][2]};
sharkSwimLeftFrames = new Array<TextureRegion>(sharkSwimLeft);
sharkSwimRightFrames = new Array<TextureRegion>();
for (TextureRegion t:sharkSwimLeftFrames)
{
TextureRegion temp = new TextureRegion(t);
temp.flip(true,false);
sharkSwimRightFrames.add(temp);
}
sharkSwimUpFrames = new Array<TextureRegion>(sharkSwimUp);
sharkSwimDownFrames = new Array<TextureRegion>(sharkSwimDown);
sharkSwimLeftAnim = new Animation(.2f, sharkSwimLeftFrames, Animation.PlayMode.LOOP);
sharkSwimRightAnim = new Animation(.2f, sharkSwimRightFrames, Animation.PlayMode.LOOP);
sharkSwimUpAnim = new Animation(.2f, sharkSwimUpFrames, Animation.PlayMode.LOOP);
sharkSwimDownAnim = new Animation(.2f, sharkSwimDownFrames, Animation.PlayMode.LOOP);
lily = new Texture(Gdx.files.internal("stdres\\gamescreen\\lily.png"));
}
public static void dispose_leveledit()
{
GameBackground.dispose();
LevelEditMapaAbajo.dispose();
LevelEditClock.dispose();
LevelEditConfirm.dispose();
LevelEditDuck.dispose();
LevelEditExit.dispose();
LevelEditLily.dispose();
LevelEditLOAD.dispose();
LevelEditLives.dispose();
LevelEditUnlives.dispose();
LevelEditRemoveItem.dispose();
LevelEditSave.dispose();
LevelEditShark.dispose();
LevelEditTimeBar.dispose();
LevelEditFlechaIzq.dispose();
duck.dispose();
shark.dispose();
lily.dispose();
LevelEditShare.dispose();
LevelEditNumblock.dispose();
}
}
| [
"fworg64@gmail.com"
] | fworg64@gmail.com |
cb82dcb924a0195424accdf80f9dc5545c24c725 | d796b7b098f2c20bd526c4e9ea0a1a22eaece990 | /src/usethread/MyThread.java | df4e230ca6698dd6a53e5f2422a23622c16c2d3e | [] | no_license | mattywang7/Java-Concurrency | e7b7d7312b7bdcb9a2c4281f3b6993da48b26887 | c3b1f229f1e0d261c8b8cce7bca92a549f4367fa | refs/heads/main | 2023-03-13T22:00:37.255439 | 2021-03-04T19:43:04 | 2021-03-04T19:43:04 | 343,772,331 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 267 | java | package usethread;
public class MyThread extends Thread {
@Override
public void run() {
System.out.println("Extends from Thread.");
}
public static void main(String[] args) {
MyThread mt = new MyThread();
mt.start();
}
}
| [
"mattywang7@gmail.com"
] | mattywang7@gmail.com |
2e7a3f58cc0ccd6586771947a7b9b19ee15a1ed8 | 5e6da40a8bba6664487b4bad1d0c837927c9a8b2 | /src/main/java/com/femis/account/AccountRole.java | c03cd435eab92b807b7416bb26bcc46a19169fb4 | [] | no_license | tkillman/rest-api-with-spring | 7b03c8f77c4821ba992ea259c639ff3e14133626 | 1a4aeb82f51b7642465e2bc9afdc319fe51597fc | refs/heads/master | 2022-12-05T22:05:38.964917 | 2020-08-15T00:16:28 | 2020-08-15T00:16:28 | 285,585,714 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 70 | java | package com.femis.account;
public enum AccountRole {
ADMIN, USER;
}
| [
"dkkim1004@hanmail.net"
] | dkkim1004@hanmail.net |
d0a579e07e2597a9ae34a07020b23a22aae1a21d | e6c214a34378d047c9f1069a02775ac69e14205d | /src/main/java/com/css/gfg/queue/Queue.java | 07855665b44aa01ef10b180fcc1e5167d03bc4f7 | [] | no_license | kishorerouthu/GFG | 2195a28786e895563b686cc7ea63a77cc6ad1418 | 350d16deca9d550521a1d5b55fc421916e738c50 | refs/heads/master | 2021-01-11T15:18:41.773884 | 2020-08-15T15:47:42 | 2020-08-15T15:47:42 | 80,324,896 | 0 | 0 | null | 2020-10-12T23:46:26 | 2017-01-29T02:33:05 | Java | UTF-8 | Java | false | false | 228 | java | package com.css.gfg.queue;
public interface Queue<T> {
void enqueue(T data);
T dequeue();
boolean isEmpty();
boolean isFull();
void delete();
void print();
int size();
T front();
T rear();
}
| [
"kishore.routhu5@gmail.com"
] | kishore.routhu5@gmail.com |
82fdc83250a03e129fcc9b3a816a3435209ba919 | e4d4fe65fcc29433a970bc91e62d7dc9b86b852f | /Second-Semester/java/HospitalManagement.java | b3228b1257aeedd9de3494dc8be3aa35bb297f48 | [] | no_license | skgautam1010/RVCE | 0b44c5f85c28d558f268d4362f9bf2599c842f3f | fe9404e5074449ba13f5facf0d906c8f9d429196 | refs/heads/master | 2023-07-05T20:37:33.534635 | 2021-07-31T18:17:46 | 2021-07-31T18:17:46 | 288,137,572 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 23,268 | java | import java.io.*;
import java.util.*;
import java.util.Calendar;
/* Hospital Management System Project in Java with Source Code PDF Visit for more https://www.programmingwithbasics.com/ */
class staff
{
String sid, sname, desg, sex;
int salary;
void new_staff()
{
Scanner input = new Scanner(System.in);
System.out.print("id:-");
sid = input.nextLine();
System.out.print("name:-");
sname = input.nextLine();
System.out.print("desigination:-");
desg = input.nextLine();
System.out.print("sex:-");
sex = input.nextLine();
System.out.print("salary:-");
salary = input.nextInt();
}
void staff_info()
{
System.out.println(sid + "\t" + sname + "\t" + sex + "\t" + salary);
}
}
class doctor
{
String did, dname, specilist, appoint, doc_qual;
int droom;
void new_doctor()
{
Scanner input = new Scanner(System.in);
System.out.print("id:-");
did = input.nextLine();
System.out.print("name:-");
dname = input.nextLine();
System.out.print("specilization:-");
specilist = input.nextLine();
System.out.print("work time:-");
appoint = input.nextLine();
System.out.print("qualification:-");
doc_qual = input.nextLine();
System.out.print("room no.:-");
droom = input.nextInt();
}
void doctor_info()
{
System.out.println(did + "\t" + dname + " \t" + specilist + " \t" + appoint + " \t" + doc_qual + " \t" + droom);
}
}
class patient
{
String pid, pname, disease, sex, admit_status;
int age;
void new_patient()
{
Scanner input = new Scanner(System.in);
System.out.print("id:-");
pid = input.nextLine();
System.out.print("name:-");
pname = input.nextLine();
System.out.print("disease:-");
disease = input.nextLine();
System.out.print("sex:-");
sex = input.nextLine();
System.out.print("admit_status:-");
admit_status = input.nextLine();
System.out.print("age:-");
age = input.nextInt();
}
void patient_info()
{
System.out.println(pid + "\t" + pname + " \t" + disease + " \t" + sex + " \t" + admit_status + "\t" + age);
}
}
class medical
{
String med_name, med_comp, exp_date;
int med_cost, count;
void new_medi()
{
Scanner input = new Scanner(System.in);
System.out.print("name:-");
med_name = input.nextLine();
System.out.print("comp:-");
med_comp = input.nextLine();
System.out.print("exp_date:-");
exp_date = input.nextLine();
System.out.print("cost:-");
med_cost = input.nextInt();
System.out.print("no of unit:-");
count = input.nextInt();
}
void find_medi()
{
System.out.println(med_name + " \t" + med_comp + " \t" + exp_date + " \t" + med_cost);
}
}
class lab
{
String fecility;
int lab_cost;
void new_feci()
{
Scanner input = new Scanner(System.in);
System.out.print("fecility:-");
fecility = input.nextLine();
System.out.print("cost:-");
lab_cost = input.nextInt();
}
void feci_list()
{
System.out.println(fecility + "\t\t" + lab_cost);
}
}
class fecility //Sorry Facility but do not change the name
{
String fec_name;
void add_feci()
{
Scanner input = new Scanner(System.in);
System.out.print("fecility:-");
fec_name = input.nextLine();
}
void show_feci()
{
System.out.println(fec_name);
}
}
public class HospitalManagement
{
public static void main(String args[])
{
String months[] = {
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
};
Calendar calendar = Calendar.getInstance();
//System.out.println("--------------------------------------------------------------------------------");
int count1 = 4, count2 = 4, count3 = 4, count4 = 4, count5 = 4, count6 = 4;
System.out.println("\n--------------------------------------------------------------------------------");
System.out.println(" *** Welcome to Hospital Management System Project in Java ***");
System.out.println("--------------------------------------------------------------------------------");
System.out.print("Date: " + months[calendar.get(Calendar.MONTH)] + " " + calendar.get(Calendar.DATE) + " " + calendar.get(Calendar.YEAR));
System.out.println("\t\t\t\t\t\tTime: " + calendar.get(Calendar.HOUR) + ":" + calendar.get(Calendar.MINUTE) + ":" + calendar.get(Calendar.SECOND));
doctor[] d = new doctor[25];
patient[] p = new patient[100];
lab[] l = new lab[20];
fecility[] f = new fecility[20];
medical[] m = new medical[100];
staff[] s = new staff[100];
int i;
for (i = 0; i < 25; i++)
d[i] = new doctor();
for (i = 0; i < 100; i++)
p[i] = new patient();
for (i = 0; i < 20; i++)
l[i] = new lab();
for (i = 0; i < 20; i++)
f[i] = new fecility();
for (i = 0; i < 100; i++)
m[i] = new medical();
for (i = 0; i < 100; i++)
s[i] = new staff();
d[0].did = "21";
d[0].dname = "Dr.Ghanendra";
d[0].specilist = "ENT";
d[0].appoint = "5-11AM";
d[0].doc_qual = "MBBS,MD";
d[0].droom = 17;
d[1].did = "32";
d[1].dname = "Dr.Vikram";
d[1].specilist = "Physician";
d[1].appoint = "10-3AM";
d[1].doc_qual = "MBBS,MD";
d[1].droom = 45;
d[2].did = "17";
d[2].dname = "Dr.Rekha";
d[2].specilist = "Surgeon";
d[2].appoint = "8-2AM";
d[2].doc_qual = "BDM";
d[2].droom = 8;
d[3].did = "33";
d[3].dname = "Dr.Pramod";
d[3].specilist = "Artho";
d[3].appoint = "10-4PM";
d[3].doc_qual = "MBBS,MS";
d[3].droom = 40;
p[0].pid = "12";
p[0].pname = "Pankaj";
p[0].disease = "Cancer";
p[0].sex = "Male";
p[0].admit_status = "y";
p[0].age = 30;
p[1].pid = "13";
p[1].pname = "Sumit";
p[1].disease = "Cold";
p[1].sex = "Male";
p[1].admit_status = "y";
p[1].age = 23;
p[2].pid = "14";
p[2].pname = "Alok";
p[2].disease = "Maleriya";
p[2].sex = "Male";
p[2].admit_status = "y";
p[2].age = 45;
p[3].pid = "15";
p[3].pname = "Ravi";
p[3].disease = "Diabetes";
p[3].sex = "Male";
p[3].admit_status = "y";
p[3].age = 25;
m[0].med_name = "Corex";
m[0].med_comp = "Cino pvt";
m[0].exp_date = "9-5-16";
m[0].med_cost = 55;
m[0].count = 8;
m[1].med_name = "Nytra";
m[1].med_comp = "Ace pvt";
m[1].exp_date = "4-4-15";
m[1].med_cost = 500;
m[1].count = 5;
m[2].med_name = "Brufa";
m[2].med_comp = "Reckitt";
m[2].exp_date = "12-7-17";
m[2].med_cost = 50;
m[2].count = 56;
m[3].med_name = "Pride";
m[3].med_comp = "DDF pvt";
m[3].exp_date = "12-4-12";
m[3].med_cost = 1100;
m[3].count = 100;
l[0].fecility = "X-ray ";
l[0].lab_cost = 800;
l[1].fecility = "CT Scan ";
l[1].lab_cost = 1200;
l[2].fecility = "OR Scan ";
l[2].lab_cost = 500;
l[3].fecility = "Blood Bank";
l[3].lab_cost = 50;
f[0].fec_name = "Ambulance";
f[1].fec_name = "Admit Facility ";
f[2].fec_name = "Canteen";
f[3].fec_name = "Emergency";
s[0].sid = "22";
s[0].sname = "Prakash";
s[0].desg = "Worker";
s[0].sex = "Male";
s[0].salary = 5000;
s[1].sid = "23";
s[1].sname = "Komal";
s[1].desg = "Nurse";
s[1].sex = "Female";
s[1].salary = 2000;
s[2].sid = "24";
s[2].sname = "Raju";
s[2].desg = "Worker";
s[2].sex = "Male";
s[2].salary = 5000;
s[3].sid = "25";
s[3].sname = "Rani";
s[3].desg = "Nurse";
s[3].sex = "Female";
s[3].salary = 20000;
Scanner input = new Scanner(System.in);
int choice, j, c1, status = 1, s1 = 1, s2 = 1, s3 = 1, s4 = 1, s5 = 1, s6 = 1;
while (status == 1)
{
System.out.println("\n MAIN MENU");
System.out.println("-----------------------------------------------------------------------------------");
System.out.println("1.Doctos 2. Patients 3.Medicines 4.Laboratories 5. Facilities 6. Staff");
System.out.println("-----------------------------------------------------------------------------------");
choice = input.nextInt();
switch (choice)
{
case 1:
{
System.out.println("--------------------------------------------------------------------------------");
System.out.println(" **DOCTOR SECTION**");
System.out.println("--------------------------------------------------------------------------------");
s1 = 1;
while (s1 == 1)
{
System.out.println("1.Add New Entry\n2.Existing Doctors List");
c1 = input.nextInt();
switch (c1)
{
case 1:
{
d[count1].new_doctor();count1++;
break;
}
case 2:
{
System.out.println("--------------------------------------------------------------------------------");
System.out.println("id \t Name\t Specilist \t Timing \t Qualification \t Room No.");
System.out.println("--------------------------------------------------------------------------------");
for (j = 0; j < count1; j++)
{
d[j].doctor_info();
}
break;
}
}
System.out.println("\nReturn to Back Press 1 and for Main Menu Press 0");
s1 = input.nextInt();
}
break;
}
case 2:
{
System.out.println("--------------------------------------------------------------------------------");
System.out.println(" **PATIENT SECTION**");
System.out.println("--------------------------------------------------------------------------------");
s2 = 1;
while (s2 == 1)
{
System.out.println("1.Add New Entry\n2.Existing Patients List");
c1 = input.nextInt();
switch (c1)
{
case 1:
{
p[count2].new_patient();count2++;
break;
}
case 2:
{
System.out.println("--------------------------------------------------------------------------------");
System.out.println("id \t Name \t Disease \t Gender \t Admit Status \t Age");
System.out.println("--------------------------------------------------------------------------------");
for (j = 0; j < count2; j++) {
p[j].patient_info();
}
break;
}
}
System.out.println("\nReturn to Back Press 1 and for Main Menu Press 0");
s2 = input.nextInt();
}
break;
}
case 3:
{
s3 = 1;
System.out.println("--------------------------------------------------------------------------------");
System.out.println(" **MEDICINE SECTION**");
System.out.println("--------------------------------------------------------------------------------");
while (s3 == 1)
{
System.out.println("1.Add New Entry\n2. Existing Medicines List");
c1 = input.nextInt();
switch (c1)
{
case 1:
{
m[count3].new_medi();count3++;
break;
}
case 2:
{
System.out.println("--------------------------------------------------------------------------------");
System.out.println("Name \t Company \t Expiry Date \t Cost");
System.out.println("--------------------------------------------------------------------------------");
for (j = 0; j < count3; j++) {
m[j].find_medi();
}
break;
}
}
System.out.println("\nReturn to Back Press 1 and for Main Menu Press 0");
s3 = input.nextInt();
}
break;
}
case 4:
{
s4 = 1;
System.out.println("--------------------------------------------------------------------------------");
System.out.println(" **LABORATORY SECTION**");
System.out.println("--------------------------------------------------------------------------------");
while (s4 == 1)
{
System.out.println("1.Add New Entry \n2.Existing Laboratories List");
c1 = input.nextInt();
switch (c1)
{
case 1:
{
l[count4].new_feci();count4++;
break;
}
case 2:
{
System.out.println("--------------------------------------------------------------------------------");
System.out.println("Fecilities\t\t Cost");
System.out.println("--------------------------------------------------------------------------------");
for (j = 0; j < count4; j++) {
l[j].feci_list();
}
break;
}
}
System.out.println("\nReturn to Back Press 1 and for Main Menu Press 0");
s4 = input.nextInt();
}
break;
}
case 5:
{
s5 = 1;
System.out.println("--------------------------------------------------------------------------------");
System.out.println(" **HOSPITAL FACILITY SECTION**");
System.out.println("--------------------------------------------------------------------------------");
while (s5 == 1)
{
System.out.println("1.Add New Facility\n2.Existing Fecilities List");
c1 = input.nextInt();
switch (c1)
{
case 1:
{
f[count5].add_feci();count5++;
break;
}
case 2:
{
System.out.println("--------------------------------------------------------------------------------");
System.out.println("Hospital Facility are:");
System.out.println("--------------------------------------------------------------------------------");
for (j = 0; j < count5; j++) {
f[j].show_feci();
}
break;
}
}
System.out.println("\nReturn to Back Press 1 and for Main Menu Press 0");
s5 = input.nextInt();
}
break;
}
case 6:
{
s6 = 1;
System.out.println("--------------------------------------------------------------------------------");
System.out.println(" **STAFF SECTION**");
System.out.println("--------------------------------------------------------------------------------");
while (s6 == 1)
{
String a = "nurse", b = "worker", c = "security";
System.out.println("1.Add New Entry \n2.Existing Nurses List\n3.Existing Workers List \n4.Existing Security List");
c1 = input.nextInt();
switch (c1)
{
case 1:
{
s[count6].new_staff();count6++;
break;
}
case 2:
{
System.out.println("--------------------------------------------------------------------------------");
System.out.println("id \t Name \t Gender \t Salary");
System.out.println("--------------------------------------------------------------------------------");
for (j = 0; j < count6; j++)
{
if (a.equals(s[j].desg))
s[j].staff_info();
}
break;
}
case 3:
{
System.out.println("--------------------------------------------------------------------------------");
System.out.println("id \t Name \t Gender \t Salary");
System.out.println("--------------------------------------------------------------------------------");
for (j = 0; j < count6; j++)
{
if (b.equals(s[j].desg))
s[j].staff_info();
}
break;
}
case 4:
{
System.out.println("--------------------------------------------------------------------------------");
System.out.println("id \t Name \t Gender \t Salary");
System.out.println("--------------------------------------------------------------------------------");
for (j = 0; j < count6; j++)
{
if (c.equals(s[j].desg))
s[j].staff_info();
}
break;
}
}
System.out.println("\nReturn to Back Press 1 and for Main Menu Press 0");
s6 = input.nextInt();
}
break;
}
default:
{
System.out.println(" You Have Enter Wrong Choice!!!");
}
}
System.out.println("\nReturn to MAIN MENU Press 1");
status = input.nextInt();
}
}
}
| [
"sonukumargautam41638@gmail.com"
] | sonukumargautam41638@gmail.com |
56351956f045071433f881f037c61bfe40b204be | 3731f11c515fbce46e0f0a0aa63696d8321a9b97 | /EMS/src/com/controller/AnalysisController.java | 0284110adb6ea3bafb1ab8a7814c77421f079ef3 | [] | no_license | t2money11/EMS | 4ad5c04e567a11a7ae116305954a4bf1a27d317c | 9b2a32385f26582e8caa029765836c9a168628f8 | refs/heads/master | 2023-07-11T06:52:14.909304 | 2021-08-13T13:55:17 | 2021-08-13T13:55:17 | 386,938,643 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,148 | java | package com.controller;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.context.Message;
import com.entity.Analysis;
import com.entity.AnalysisProfit;
import com.entity.AnalysisResult;
import com.entity.AnalysisResultExportInfo;
import com.entity.Production;
import com.entity.TradeOrderPop;
import com.poi.AnalysisExport;
import com.service.AnalysisService;
import com.util.DateUtil;
import com.util.IsEmptyUtil;
import com.util.StringHandler;
@Controller
@RequestMapping("/analysis")
public class AnalysisController{
@Autowired
private AnalysisService analysisService = null;
@Autowired
private AnalysisExport analysisExport = null;
/**
* 数据分析检索画面初期化
* @param session
* @return ModelAndView
*/
@RequestMapping(value = "/searchShow")
public ModelAndView searchGet(HttpSession session) {
//CURRENT菜单设定
session.setAttribute("currentMenu", "analysisManagement");
//CURRENT画面标题设定
session.setAttribute("pageTitle", Message.PAGETITLE_ANALYSIS);
ModelAndView mav = new ModelAndView();
mav.addObject("analysis", new Analysis());
mav.setViewName("analysis");
return mav;
}
/**
* 下载产品订购信息
* @param analysis
* @param response
* @return ModelAndView
* @throws Exception
*/
@RequestMapping(value = "/downloadPTA")
public ModelAndView downloadPTA(Analysis analysis, HttpServletResponse response) throws IOException {
ModelAndView mav = null;
List<TradeOrderPop> tradeOrderPopList = null;
try {
tradeOrderPopList = analysisService.productionAnalysis(analysis.getDateFrom(), analysis.getDateTo());
} catch (Exception e) {
mav = new ModelAndView();
mav.addObject("analysis", new Analysis());
mav.addObject("errorMessage", e.getMessage());
mav.setViewName("analysis");
return mav;
}
OutputStream os = response.getOutputStream();
try {
String fileName = URLEncoder.encode("产品订购信息_" + DateUtil.getNowDateString(DateUtil.DATE_FORMAT4) + ".xlsx", "UTF-8");
String fileFullPath = analysisExport.generateFile4ProductionAnalysis(tradeOrderPopList, fileName);
response.reset();
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
response.setContentType("application/octet-stream; charset=utf-8");
os.write(FileUtils.readFileToByteArray(new File(fileFullPath)));
os.flush();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (os != null) {
os.close();
}
}
return mav;
}
/**
* 下载订单进展信息
* @param analysis
* @param response
* @return ModelAndView
* @throws Exception
*/
@RequestMapping(value = "/downloadTPA")
public ModelAndView downloadTPA(Analysis analysis, HttpServletResponse response) throws IOException {
ModelAndView mav = null;
List<AnalysisResult> analysisResultList = null;
try {
analysisResultList = analysisService.tradeOrderAnalysis(analysis.getDateFrom(), analysis.getDateTo());
} catch (Exception e) {
mav = new ModelAndView();
mav.addObject("analysis", new Analysis());
mav.addObject("errorMessage", e.getMessage());
mav.setViewName("analysis");
return mav;
}
OutputStream os = response.getOutputStream();
try {
String fileName = URLEncoder.encode("订单进展信息_" + DateUtil.getNowDateString(DateUtil.DATE_FORMAT4) + ".xlsx", "UTF-8");
String fileFullPath = analysisExport.generateFile4TradeOrderAnalysis(analysisResultList, fileName);
response.reset();
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
response.setContentType("application/octet-stream; charset=utf-8");
os.write(FileUtils.readFileToByteArray(new File(fileFullPath)));
os.flush();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (os != null) {
os.close();
}
}
return mav;
}
/**
* 下载投诉单补货进展信息
* @param analysis
* @param response
* @return ModelAndView
* @throws Exception
*/
@RequestMapping(value = "/downloadC")
public ModelAndView downloadC(Analysis analysis, HttpServletResponse response) throws IOException {
ModelAndView mav = null;
List<AnalysisResult> analysisResultList = null;
try {
analysisResultList = analysisService.complaintAnalysis(analysis.getDateFrom(), analysis.getDateTo());
} catch (Exception e) {
mav = new ModelAndView();
mav.addObject("analysis", new Analysis());
mav.addObject("errorMessage", e.getMessage());
mav.setViewName("analysis");
return mav;
}
OutputStream os = response.getOutputStream();
try {
String fileName = URLEncoder.encode("投诉单补货进展信息_" + DateUtil.getNowDateString(DateUtil.DATE_FORMAT4) + ".xlsx", "UTF-8");
String fileFullPath = analysisExport.generateFile4ComplaintAnalysis(analysisResultList, fileName);
response.reset();
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
response.setContentType("application/octet-stream; charset=utf-8");
os.write(FileUtils.readFileToByteArray(new File(fileFullPath)));
os.flush();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (os != null) {
os.close();
}
}
return mav;
}
/**
* 下载报关金额信息
* @param analysis
* @param response
* @return ModelAndView
* @throws Exception
*/
@RequestMapping(value = "/downloadMEI")
public ModelAndView downloadMEI(Analysis analysis, HttpServletResponse response) throws IOException {
ModelAndView mav = null;
List<AnalysisResultExportInfo> analysisResultExportInfoList = null;
try {
//年份必须选择
if(IsEmptyUtil.isEmpty(analysis.getYearSelected())){
throw new Exception(Message.YEAR_REQUIRED);
}
analysisResultExportInfoList = analysisService.exportInfoAnalysis(analysis.getYearSelected(), analysis.getMonthSelected());
} catch (Exception e) {
mav = new ModelAndView();
mav.addObject("analysis", new Analysis());
mav.addObject("errorMessage", e.getMessage());
mav.setViewName("analysis");
return mav;
}
OutputStream os = response.getOutputStream();
try {
String fileName = URLEncoder.encode("报关金额信息_" + DateUtil.getNowDateString(DateUtil.DATE_FORMAT4) + ".xlsx", "UTF-8");
String fileFullPath = analysisExport.generateFile4ExportInfoAnalysis(analysis.getYearSelected(),
analysis.getMonthSelected(),
analysisResultExportInfoList,
fileName);
response.reset();
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
response.setContentType("application/octet-stream; charset=utf-8");
os.write(FileUtils.readFileToByteArray(new File(fileFullPath)));
os.flush();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (os != null) {
os.close();
}
}
return mav;
}
/**
* 下载产品基本信息
* @param response
* @return ModelAndView
* @throws Exception
*/
@RequestMapping(value = "/downloadPI")
public ModelAndView downloadPI(HttpServletResponse response) throws IOException {
ModelAndView mav = null;
List<Production> productionList = null;
try {
productionList = analysisService.exportProduction();
} catch (Exception e) {
mav = new ModelAndView();
mav.addObject("analysis", new Analysis());
mav.addObject("errorMessage", e.getMessage());
mav.setViewName("analysis");
return mav;
}
OutputStream os = response.getOutputStream();
try {
String fileName = URLEncoder.encode("产品基本信息_" + DateUtil.getNowDateString(DateUtil.DATE_FORMAT4) + ".xlsx", "UTF-8");
String fileFullPath = analysisExport.generateFile4ProductionExport(productionList, fileName);
response.reset();
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
response.setContentType("application/octet-stream; charset=utf-8");
os.write(FileUtils.readFileToByteArray(new File(fileFullPath)));
os.flush();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (os != null) {
os.close();
}
}
return mav;
}
/**
* 下载利润信息
* @param analysis
* @param response
* @return ModelAndView
* @throws Exception
*/
@RequestMapping(value = "/downloadPA")
public ModelAndView downloadPA(Analysis analysis, HttpServletResponse response) throws IOException {
ModelAndView mav = null;
List<AnalysisProfit> analysisProfitList = null;
try {
if(IsEmptyUtil.isEmpty(analysis.getRate())){
throw new Exception(Message.RATE_REQUIRED);
}else if(!StringHandler.isDouble(analysis.getRate(), 2)){
throw new Exception(Message.RATE_FORMAT_ERROR);
}
analysisProfitList = analysisService.profitAnalysis();
} catch (Exception e) {
mav = new ModelAndView();
mav.addObject("analysis", new Analysis());
mav.addObject("errorMessage", e.getMessage());
mav.setViewName("analysis");
return mav;
}
OutputStream os = response.getOutputStream();
try {
String fileName = URLEncoder.encode("利润信息_" + DateUtil.getNowDateString(DateUtil.DATE_FORMAT4) + ".xlsx", "UTF-8");
String fileFullPath = analysisExport.generateFile4ProfitAnalysis(analysisProfitList, analysis.getRate(), fileName);
response.reset();
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
response.setContentType("application/octet-stream; charset=utf-8");
os.write(FileUtils.readFileToByteArray(new File(fileFullPath)));
os.flush();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (os != null) {
os.close();
}
}
return mav;
}
}
| [
"45346@windows10.microdone.cn"
] | 45346@windows10.microdone.cn |
0523ff91a5050cd84aca7d7a3f9738b5318ba71b | 1d8d3f11f734fac34e0d197f4707f3ba1c9fe7d6 | /MyApplication/app/src/main/java/notrace/daytongue/views/UnScrollableGridView.java | 8f9ea1802862df7025931b8fe212784a4ccf6bda | [] | no_license | messnoTrace/DayTongue | 6e7edd2294616463ac9f80785d82b4b30d72ef57 | 8b2a5869af29a6d836ee1360567b9768d6d87c12 | refs/heads/master | 2020-04-13T12:43:14.596456 | 2015-09-28T11:04:37 | 2015-09-28T11:04:37 | 42,583,946 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 771 | java | package notrace.daytongue.views;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;
/**
* 解决GridView和ScrollView嵌套滚动冲突的问题
*/
public class UnScrollableGridView extends GridView {
public UnScrollableGridView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public UnScrollableGridView(Context context) {
super(context);
}
public UnScrollableGridView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
} | [
"cy_nforget@126.com"
] | cy_nforget@126.com |
d81dc3e1b48fc8a9efcdb9c72bb7150894200c58 | e899a9cdfe2a6728447eb263c8777052d04b3e79 | /Trials/src/cecs/BankAccountFactory.java | 08ab01dfbf1262da0d94541722c03c339015f542 | [] | no_license | AgentBluenote/java8 | b332bcb1709656970e5fd32ff0911607574edc1b | fc8aa103a8aa63411c6b0af9338b77db88dcb79e | refs/heads/master | 2021-01-13T09:49:04.264311 | 2019-07-27T14:29:00 | 2019-07-27T14:29:00 | 51,530,321 | 0 | 0 | null | 2020-10-12T20:12:30 | 2016-02-11T17:01:44 | Java | UTF-8 | Java | false | false | 1,091 | java | package cecs;
import java.util.*;
public final class BankAccountFactory {
//
// default Constructor
//
public BankAccountFactory(){
}
//
//
//
public static FinancialInstitution getBankAccount( String ss_number ){
FinancialInstitution m_usbank = new Bank();
switch ( ss_number ){ // we know the name of the student
case "8118":
System.out.println("Criminal Name: Dennis Volper" );
//m_usbank = new Bank( "8118" );
m_usbank = new Bank( );
break;
case "3855":
System.out.println("Criminal Name: Miss M. Ariana" );
// m_usbank = new Bank( "3855" );
m_usbank = new Bank();
default:
System.out.println("default case: " );
} // end switch
return m_usbank;
}
//
// main()
//
public static void main(String[] args) {
// FinancialInstitution usbank = new Bank();
// usbank = usbank.getBankAccount("8818");
}
}
| [
"michael@michael-Satellite-P775"
] | michael@michael-Satellite-P775 |
d7ec55c06ea62135780b3a3d520b5e053b84edeb | 1d64bf4b7cec44c8a12e4086ad2918e8df6dcc76 | /SpringRelatedJars/spring-framework-2.0.5/dist/org/springframework/jms/connection/ChainedExceptionListener.java | db14f6a43e345e1f974a69bd2af02e97826e1798 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | XerO00/AllJarFiles | 03472690fad55b5c2fcae530ac7de6294c54521e | d546337cfa29f4d33c3d3c5a4479a35063771612 | refs/heads/master | 2020-05-07T15:51:39.184855 | 2019-04-10T20:08:57 | 2019-04-10T20:08:57 | 180,655,268 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,960 | java | /*
* Copyright 2002-2006 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
*
* 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.springframework.jms.connection;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.jms.ExceptionListener;
import javax.jms.JMSException;
import org.springframework.util.Assert;
/**
* Implementation of the JMS ExceptionListener interface that supports chaining,
* allowing the addition of multiple ExceptionListener instances in order.
*
* @author Juergen Hoeller
* @since 2.0
*/
public class ChainedExceptionListener implements ExceptionListener {
/** List of ExceptionListeners */
private final List delegates = new ArrayList(2);
/**
* Add an ExceptionListener to the chained delegate list.
*/
public final void addDelegate(ExceptionListener listener) {
Assert.notNull(listener, "ExceptionListener must not be null");
this.delegates.add(listener);
}
/**
* Return all registered ExceptionListener delegates (as array).
*/
public final ExceptionListener[] getDelegates() {
return (ExceptionListener[]) this.delegates.toArray(new ExceptionListener[this.delegates.size()]);
}
public void onException(JMSException ex) {
for (Iterator it = this.delegates.iterator(); it.hasNext();) {
ExceptionListener listener = (ExceptionListener) it.next();
listener.onException(ex);
}
}
}
| [
"prasannadandhalkar1@gmail.com"
] | prasannadandhalkar1@gmail.com |
e5922bfa58dba4d9ef00970214e5253aa92ae625 | eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3 | /tags/2010-06-20/seasar2-2.4.42/seasar2/s2-framework/src/main/java/org/seasar/framework/exception/SRuntimeException.java | e9773bd2109d7a6018ecd36daca453e2e7406a1f | [
"Apache-2.0"
] | permissive | svn2github/s2container | 54ca27cf0c1200a93e1cb88884eb8226a9be677d | 625adc6c4e1396654a7297d00ec206c077a78696 | refs/heads/master | 2020-06-04T17:15:02.140847 | 2013-08-09T09:38:15 | 2013-08-09T09:38:15 | 10,850,644 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,965 | java | /*
* Copyright 2004-2010 the Seasar Foundation and the Others.
*
* 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 org.seasar.framework.exception;
import org.seasar.framework.message.MessageFormatter;
/**
* Seasar2の例外のベースクラスです。
*
* @author higa
*
*/
public class SRuntimeException extends RuntimeException {
private static final long serialVersionUID = -4452607868694297329L;
private String messageCode;
private Object[] args;
private String message;
private String simpleMessage;
/**
* {@link SRuntimeException}を作成します。
*
* @param messageCode
*/
public SRuntimeException(String messageCode) {
this(messageCode, null, null);
}
/**
* {@link SRuntimeException}を作成します。
*
* @param messageCode
* @param args
*/
public SRuntimeException(String messageCode, Object[] args) {
this(messageCode, args, null);
}
/**
* {@link SRuntimeException}を作成します。
*
* @param messageCode
* @param args
* @param cause
*/
public SRuntimeException(String messageCode, Object[] args, Throwable cause) {
super(cause);
this.messageCode = messageCode;
this.args = args;
simpleMessage = MessageFormatter.getSimpleMessage(messageCode, args);
message = "[" + messageCode + "]" + simpleMessage;
}
/**
* メッセージコードを返します。
*
* @return メッセージコード
*/
public final String getMessageCode() {
return messageCode;
}
/**
* 引数の配列を返します。
*
* @return 引数の配列
*/
public final Object[] getArgs() {
return args;
}
public final String getMessage() {
return message;
}
/**
* メッセージを設定します。
*
* @param message
* メッセージ
*/
protected void setMessage(String message) {
this.message = message;
}
/**
* メッセージコードなしの単純なメッセージを返します。
*
* @return メッセージコードなしの単純なメッセージ
*/
public final String getSimpleMessage() {
return simpleMessage;
}
} | [
"koichik@319488c0-e101-0410-93bc-b5e51f62721a"
] | koichik@319488c0-e101-0410-93bc-b5e51f62721a |
bf0a7995eeeb850113154db5e850853abd991d7c | b0da2b49d65d92b16cc382326e512f57d61efe43 | /app/src/main/java/com/example/moonlightapplication/moonlight/InforUserActivity.java | 4ec5750ba2d3d8ffdbdff8deca6f061ecb269fa9 | [] | no_license | nhathuyit3/HCI | 75d1b20990dcc98c71016b4a1e1b2cd5340594fe | 717cac7f8c38d32ffebfb887bd0904c82170f597 | refs/heads/master | 2023-02-24T11:19:58.537651 | 2021-01-30T09:41:03 | 2021-01-30T09:41:03 | 332,723,299 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 809 | java | package com.example.moonlightapplication.moonlight;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import com.example.moonlightapplication.R;
import com.example.moonlightapplication.fragments.AccountFragment;
public class InforUserActivity extends AppCompatActivity {
private ImageView imgBackToMenu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_infor_user);
imgBackToMenu = (ImageView)findViewById(R.id.imgBackToMenu);
// getFragmentManager().beginTransaction().replace(R.id.imgBackToMenu, InforUserActivity.this).addToBackStack(AccountFragment.class.getSimpleName()).commit();
}
} | [
"hnhuy.17it3@sict.udn.vn"
] | hnhuy.17it3@sict.udn.vn |
7936218a5cafaf5a82e09ecc16631631448ea6e8 | 3b481ea385bb41acee41b9015caf6e5ad3b06c85 | /java/com/seguroshorizonte/sistemadecorrespondecia/ws/CorrespondenciaWS.java | 0e6d263acc390e41284f435253c0712ef4096128 | [] | no_license | luzarboleda25/srcSH | adafe5745afcc3f4ade2a4b0a1da781441bda77a | 9261fa349fed6196fdab6e6e9c141346adbe30d0 | refs/heads/master | 2021-01-21T13:34:32.327123 | 2014-04-10T01:09:00 | 2014-04-10T01:09:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 96,256 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.seguroshorizonte.sistemadecorrespondecia.ws;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Adjunto;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Areatrabajo;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Bandeja;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Bitacora;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Buzon;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Documento;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Incidente;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Infobandeja;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Mensaje;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Nivel;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Organizacion;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Paquete;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Prioridad;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Proveedor;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Rol;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Sede;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Seguimiento;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Usuario;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Usuariosede;
import com.seguroshorizonte.sistemadecorrespondecia.entidades.Valija;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.AdjuntoFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.AlertaFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.AreatrabajoFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.BandejaFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.BitacoraFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.BuzonFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.DocumentoFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.IncidenteFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.InfobandejaFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.MensajeFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.NivelFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.OrganizacionFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.PaqueteFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.PrioridadFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.ProveedorFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.ProveedorsedeFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.RolFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.SedeFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.SeguimientoFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.UsuarioFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.UsuariosedeFacade;
import com.seguroshorizonte.sistemadecorrespondecia.sessionfacade.ValijaFacade;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Iterator;
import java.util.List;
import javax.ejb.EJB;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
/**
*
* @author Pangea
*/
@WebService(serviceName = "CorrespondeciaWS")
public class CorrespondenciaWS {
@EJB
private UsuarioFacade ejbUsuario;
@EJB
private InfobandejaFacade ejbInfobandeja;
@EJB
private PaqueteFacade ejbPaquete;
@EJB
private BuzonFacade ejbBuzon;
@EJB
private UsuariosedeFacade ejbUsuariosede;
@EJB
private SedeFacade ejbSede;
@EJB
private BandejaFacade ejbBandeja;
@EJB
private DocumentoFacade ejbDocumento;
@EJB
private ValijaFacade ejbValija;
@EJB
private BitacoraFacade ejbBitacora;
@EJB
private RolFacade ejbRol;
@EJB
private SeguimientoFacade ejbSeguimiento;
@EJB
private IncidenteFacade ejbIncidente;
@EJB
private MensajeFacade ejbMensaje;
@EJB
private AdjuntoFacade ejbAdjunto;
@EJB
private PrioridadFacade ejbPrioridad;
@EJB
private AreatrabajoFacade ejbAreaTrabajo;
@EJB
private OrganizacionFacade ejbOrganizacion;
@EJB
private AlertaFacade ejbAlerta;
@EJB
private ProveedorFacade ejbProveedor;
@EJB
private ProveedorsedeFacade ejbProveedorSede;
@EJB
private NivelFacade ejbNivel;
/**
* This is a sample web service operation
*
* @return
*/
@WebMethod(operationName = "consultarBandejas")
public List<Infobandeja> consultarBandejas() {
List<Infobandeja> Registro = new ArrayList<Infobandeja>();
try {
Registro = ejbInfobandeja.findAll();
} catch (Exception e) {
Registro = null;
}
return Registro;
}
/**
*
* @param UsuarioActual
* @return
*/
@WebMethod(operationName = "buscarUsuario")
public Usuario buscarUsuario(@WebParam(name = "user") String UsuarioActual) {
BigDecimal id = new BigDecimal(UsuarioActual);
return ejbUsuario.find(id);
}
/**
*
* @param idUser
* @param ban
* @return
*/
@WebMethod(operationName = "consultarPaquetesXBandeja")
public List<Paquete> consultarPaquetesXBandeja(@WebParam(name = "user") String idUser, @WebParam(name = "ban") String ban) {
BigDecimal id = new BigDecimal(idUser);
BigDecimal b1 = new BigDecimal("1");
BigDecimal b2 = new BigDecimal("2");
BigDecimal b3 = new BigDecimal("3");
BigDecimal b4 = new BigDecimal("4");
List<Paquete> Registro = new ArrayList<Paquete>();
Infobandeja inBandeja = ejbInfobandeja.consultarBandejaXNombre(ban);
Usuario usuario = ejbUsuario.find(id);
BigDecimal banj = inBandeja.getIdiba();
Iterator<Bandeja> iterator = inBandeja.getBandejaCollection().iterator();
while (iterator.hasNext()) {
Bandeja aux = iterator.next();
if (banj.equals(b1) || banj.equals(b2)) {
if (aux.getIdpaq().getOrigenpaq().getIdusu().getIdusu() == usuario.getIdusu() && aux.getIdusu().getIdusu() == usuario.getIdusu()) {
Registro.add(aux.getIdpaq());
} else {
iterator.remove();
}
}
if (banj.equals(b3) || banj.equals(b4)) {
if (aux.getIdpaq().getDestinopaq().getIdusu().getIdusu() == usuario.getIdusu() && aux.getIdusu().getIdusu() == usuario.getIdusu()) {
Registro.add(aux.getIdpaq());
} else {
iterator.remove();
}
}
}
return Registro;
}
/**
* Método que que retorna el número de registros existentes de la entidad
* Usuario
*
* @return entero con el número de Usuarios
*/
@WebMethod(operationName = "contarUsuario")
public int contarUsuario() {
return ejbUsuario.count();
}
/**
* Método que lista los registros de la entidad Usuario de acuerdo a su
* estado si es borrado o no
*
* @param status booleano si es 0 es desahablitado si es 1 es habilitado
* @return lista de la entidad Usuario
*
*/
@WebMethod(operationName = "listarUsuarios")
public List<Usuario> listarUsuarios(@WebParam(name = "status") String status) {
return ejbUsuario.listarUsuarios(status);
}
/**
* Método encargado de insertar registros de la entidad Usuario
*
* @param registroUsuario objeto de la entidad Usuario , debe tener como
* mínimo los campos obligatorios para poder insertar
* @return
*/
@WebMethod(operationName = "insertarUsuario")
public int insertarUsuario(@WebParam(name = "registroUsuario") Usuario registroUsuario) {
int Resultado;
try {
ejbUsuario.insertar(registroUsuario);
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
* Método encargado de insertar registros de la entidad Usuario
*
* @param registroSede
* @param idorg
* @return
*/
@WebMethod(operationName = "insertarSede")
public int insertarSede(@WebParam(name = "registroSede") Sede registroSede, @WebParam(name = "idorg") String idorg) {
Organizacion org = ejbOrganizacion.find(new BigDecimal(idorg));
registroSede.setIdorg(org);
int Resultado;
try {
ejbSede.create(registroSede);
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
*
* @param registroP
* @return
*/
@WebMethod(operationName = "insertarProveedor")
public int insertarProveedor(@WebParam(name = "registroProveedor") Proveedor registroP) {
int Resultado;
try {
ejbProveedor.create(registroP);
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
*
* @param registroArea
* @param idsed
* @return
*/
@WebMethod(operationName = "insertarArea")
public int insertarArea(@WebParam(name = "registroArea") Areatrabajo registroArea, @WebParam(name = "idsed") String idsed) {
Sede sed = ejbSede.find(new BigDecimal(idsed));
registroArea.setIdsed(sed);
int Resultado;
try {
ejbAreaTrabajo.create(registroArea);
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
* Método encargado de deshabilitar registros de usuario el status cambiara
* a 0
*
* @param idUsuario objeto de la entidad usuario , debe tener el campo id
* como mínimo
*/
@WebMethod(operationName = "deshabilitarUsuario")
public void deshabilitarUsuario(@WebParam(name = "idUsuario") String idUsuario) {
ejbUsuario.deshabilitar(idUsuario);
}
/**
* Método encargado de cambiar el status de registros de la entidad Usuario,
* el status cambiara a 1
*
* @param idUsuario String que contiene el id del Usuario a habilitar
*/
@WebMethod(operationName = "habilitarUsuario")
public void habilitarUsuario(@WebParam(name = "idUsuario") String idUsuario) {
ejbUsuario.habilitar(idUsuario);
}
/**
* Método encargado de consultar un registro de Usuario de acuerdo a su id
*
* @param idUsuario string que contiene el id del Usuario a consultar
* @return objeto de la entidad Usuario
*/
@WebMethod(operationName = "consultarUsuario")
public Usuario consultarUsuario(@WebParam(name = "idUsuario") String idUsuario) {
Usuario Resultado;
try {
Resultado = ejbUsuario.consultarUsuario(idUsuario);
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
*
* @param registroDocumento
* @return
*/
@WebMethod(operationName = "insertarDocumento")
public int insertarDocumento(@WebParam(name = "registroDocumento") Documento registroDocumento) {
int Resultado;
try {
ejbDocumento.insertar(registroDocumento);
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
* Método encargado de editar registros de la entidad Documento
*
* @param registroDocumento objeto de la entidad Documento
* @return
*/
@WebMethod(operationName = "editarDocumento")
public int editarDocumento(@WebParam(name = "registroDocumento") Documento registroDocumento) {
int Resultado;
try {
ejbDocumento.editar(registroDocumento);
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
* Método encargado de deshabilitar registros de Documento el status
* cambiara a 0
*
* @param idDocumento objeto de la entidad Documento , debe tener el campo
* id como mínimo
*/
@WebMethod(operationName = "eliminarDocumento")
public void eliminarDocumento(@WebParam(name = "idDocumento") String idDocumento) {
ejbDocumento.eliminar(idDocumento);
}
/**
* Método encargado de consultar un registro de Documento de acuerdo a su id
*
* @param idDocumento string que contiene el id del Documento a consultar
* @return objeto de la entidad Documento
*/
@WebMethod(operationName = "consultarDocumento")
public Documento consultarDocumento(@WebParam(name = "idDocumento") String idDocumento) {
Documento Resultado;
try {
Resultado = ejbDocumento.consultarDocumento(idDocumento);
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
*
* @param docum
* @return
*/
@WebMethod(operationName = "consultarDocumentoXNombre")
public Documento consultarDocumentoXNombre(@WebParam(name = "doc") String docum) {
return ejbDocumento.consultarDocumentoXNombre(docum);
}
/**
*
* @param registroPaquete
* @return
*/
@WebMethod(operationName = "crearPaquete")
public int insertarPaquete(@WebParam(name = "registroPaquete") Paquete registroPaquete) {
int Resultado;
try {
ejbPaquete.crearPaquete(registroPaquete);
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
*
* @param idusu
* @param IdsedeO
* @param sedeD
* @param fechapaq
* @return
* @throws ParseException
*/
@WebMethod(operationName = "insertarValija")
public String insertarValija(@WebParam(name = "idusu") String idusu, @WebParam(name = "sorigen") String IdsedeO, @WebParam(name = "sdestino") String sedeD, @WebParam(name = "fechaapaq") String fechapaq) throws ParseException {
Usuario usu = ejbUsuario.consultarUsuario(idusu);
Sede origen = ejbSede.consultarSedeXId(new BigDecimal(IdsedeO));
Usuariosede use = ejbUsuariosede.ConsultarXUsuarioYSede(usu, origen);
BigDecimal Resultado;
BigDecimal id = new BigDecimal(IdsedeO);
Valija registroValija = new Valija();
Date hoy = new Date();
Sede destino = ejbSede.ConsultarSedeXNombre(sedeD);
registroValija.setDestinoval(destino);
registroValija.setOrigenval(id);
registroValija.setIduse(use);
registroValija.setFechaval(hoy);
registroValija.setStatusval("0");
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
java.util.Date d = sdf.parse(fechapaq);
try {
Resultado = ejbValija.crearValija(registroValija);
ejbBitacora.insertarBitacora(destino, usu, "INSERCIÓN", "Creacion de Valija");
} catch (Exception e) {
Resultado = new BigDecimal(0);
}
return Resultado.toString();
}
/**
*
* @param registroValija
* @param sede
* @return
*/
@WebMethod(operationName = "ConsultarPaquetesXValija")
public List<Paquete> ConsultarPaquetesXValija(@WebParam(name = "registroValija") String registroValija, @WebParam(name = "sede") String sede) {
List<Paquete> Resultado = null;
try {
Resultado = ejbPaquete.ConsultarPaquetesXValija(registroValija, sede);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param tiempo
* @param idniv
* @return
*/
@WebMethod(operationName = "actualizarTiempoNivel")
public int actualizarTiempoNivel(@WebParam(name = "tiempo") String tiempo, @WebParam(name = "idniv") String idniv) {
int Resultado = 0;
try {
ejbNivel.editarTiempoNivel(tiempo, idniv);
Resultado = 1;
} catch (Exception e) {
return 0;
}
return Resultado;
}
/**
*
* @param registroValija
* @param sede
* @return
*/
@WebMethod(operationName = "ConsultarValija")
public Valija ConsultarValija(@WebParam(name = "registroValija") String registroValija, @WebParam(name = "sede") String sede) {
Valija valija = null;
BigDecimal val = new BigDecimal(registroValija);
try {
valija = ejbValija.consultarValija(val, sede);
if (valija.getCodproveedorval() == null) {
valija = null;
}
} catch (Exception e) {
return null;
}
return valija;
}
/**
*
* @param sede
* @param sedeDestino
* @return
*/
@WebMethod(operationName = "ConsultarPaquetesParaValija")
public List<Paquete> ConsultarPaquetesParaValija(@WebParam(name = "sede") String sede, @WebParam(name = "sedeDestino") String sedeDestino) {
List<Paquete> Resultado = new ArrayList<Paquete>();
try {
List<Paquete> Resul = ejbPaquete.ConsultarPaquetesParaValija(sede);
Iterator<Paquete> lista = Resul.iterator();
while (lista.hasNext()) {
Paquete aux = lista.next();
if (aux.getDestinopaq().getIdatr().getIdsed().getNombresed().equals(sedeDestino) && aux.getIdval() == null) {
Resultado.add(aux);
} else {
lista.remove();
}
}
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param sede
* @return
*/
@WebMethod(operationName = "ConsultarSedeParaValija")
public List<String> ConsultarSedeParaValija(@WebParam(name = "sede") String sede) {
List<String> Resultado = new ArrayList();
List<String> Resultad = null;
try {
Resultad = ejbPaquete.ConsultarSedeParaValija(sede);
Iterator<String> lista = Resultad.iterator();
while (lista.hasNext()) {
String aux = lista.next();
if (!sede.equals(aux)) {
Resultado.add(aux);
} else {
lista.remove();
}
}
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param idSede
* @return
*/
@WebMethod(operationName = "ConsultarSede")
public Sede ConsultarSede(@WebParam(name = "idSede") String idSede) {
Sede Resultado = null;
BigDecimal id = new BigDecimal(idSede);
try {
Resultado = ejbSede.find(id);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param sede
* @return
*/
@WebMethod(operationName = "consultarAreasXSede")
public List<Areatrabajo> consultarAreasXSede(@WebParam(name = "sede") String sede) {
List<Areatrabajo> Resultado = null;
try {
Resultado = ejbAreaTrabajo.consultarAreasXSede(sede);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param pri
* @return
*/
@WebMethod(operationName = "consultarNivel")
public List<Nivel> consultarNivel(@WebParam(name = "prioridad") String pri) {
List<Nivel> Resultado = null;
try {
Resultado = ejbNivel.consultarNivel(pri);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param area
* @return
*/
@WebMethod(operationName = "estadoArea")
public int estadoArea(@WebParam(name = "area") String area) {
int Resultado = 0;
try {
ejbAreaTrabajo.estadoArea(area);
Resultado = 1;
} catch (Exception e) {
return 0;
}
return Resultado;
}
/**
*
* @param sede
* @return
*/
@WebMethod(operationName = "consultarAreasXSedeXNombre")
public List<Areatrabajo> consultarAreasXSedeXNombre(@WebParam(name = "sede") String sede) {
List<Areatrabajo> Resultado = null;
try {
Resultado = ejbAreaTrabajo.consultarAreasXSedeXNombre(sede);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param sede
* @return
*/
@WebMethod(operationName = "consultarUsuariosXSede")
public List<Usuario> consultarUsuariosXSede(@WebParam(name = "sede") String sede) {
List<Usuario> Resultado = null;
try {
Resultado = ejbUsuario.consultarUsuariosXSede(sede);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param sede
* @return
*/
@WebMethod(operationName = "ConsultarSedeXNombre")
public Sede ConsultarSedeXNombre(@WebParam(name = "sede") String sede) {
Sede Resultado = null;
try {
Resultado = ejbSede.ConsultarSedeXNombre(sede);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param sede
* @return
*/
@WebMethod(operationName = "consultarSedeExistente")
public int consultarSedeExistente(@WebParam(name = "sede") String sede) {
int Resultado = 0;
try {
ejbSede.ConsultarSedeExistente(sede);
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
*
* @param area
* @param sede
* @return
*/
@WebMethod(operationName = "consultarAreaExistente")
public int consultarAreaExistente(@WebParam(name = "area") String area, @WebParam(name = "sede") String sede) {
int Resultado = 0;
try {
ejbAreaTrabajo.consultarAreaExistente(area, sede);
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
*
* @param idusu
* @param sede
* @return
*/
@WebMethod(operationName = "consultarPaquetesporArea")
public List<Paquete> consultarPaquetesporArea(@WebParam(name = "idusu") String idusu, @WebParam(name = "idsed") String sede) {
List<Paquete> Resultado;
try {
Usuario usu = ejbUsuario.consultarUsuario(idusu);
Sede sed = ejbSede.consultarSedeXId(new BigDecimal(sede));
Usuariosede use = ejbUsuariosede.ConsultarXUsuarioYSede(usu, sed);
Resultado = ejbPaquete.BuscarArea(use.getIdatr().getIdatr(), sed.getIdsed());
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
*
* @param idpaq
* @param idval
* @return
*/
@WebMethod(operationName = "ActualizacionLocalizacionyValijaDelPaquete")
public List<Paquete> ActualizacionLocalizacionyValijaDelPaquete(@WebParam(name = "idpaq") String idpaq, @WebParam(name = "idval") String idval) {
List<Paquete> Resultado = null;
try {
ejbPaquete.ActualizacionLocalizacionyValijaDelPaquete(idpaq, idval);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param idusu
* @param sede
* @return
*/
@WebMethod(operationName = "insertarBuzon")
public int insertarBuzon(@WebParam(name = "idusu") String idusu, @WebParam(name = "sede") String sede) {
try {
Usuario usu = ejbUsuario.consultarUsuario(idusu);
Sede sed = ejbSede.consultarSedeXId(new BigDecimal(sede));
Buzon buzoni = new Buzon();
Usuariosede use = ejbUsuariosede.ConsultarXUsuarioYSede(usu, sed);
String nombre = usu.getNombreusu() + "." + usu.getApellidousu();
buzoni.setIdatr(use.getIdatr());
buzoni.setIdusu(usu);
buzoni.setNombrebuz(nombre);
buzoni.setDireccionbuz(usu.getDireccionusu());
buzoni.setTipobuz("0");
ejbBuzon.insertarBuzon(buzoni);
} catch (Exception e) {
return 0;
}
return 1;
}
/**
*
* @param buz
* @param idusu
* @param sede
* @return
*/
@WebMethod(operationName = "insertarBuzonExterno")
public int insertarBuzonExterno(@WebParam(name = "buzon") Buzon buz, @WebParam(name = "idusu") String idusu, @WebParam(name = "sede") String sede) {
try {
Usuario usu = ejbUsuario.consultarUsuario(idusu);
buz.setIdusu(usu);
ejbBuzon.insertarBuzon(buz);
} catch (Exception e) {
return 0;
}
return 1;
}
/**
*
* @return
*/
@WebMethod(operationName = "consultarRoles")
public List<Rol> consultarRoles() {
List<Rol> Resultado = new ArrayList<Rol>();
try {
Resultado = ejbRol.findAll();
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
*
* @param idusu
* @param idsede
* @return
*/
@WebMethod(operationName = "consultarStatusPaquete")
public List<Paquete> consultarStatusPaquete(@WebParam(name = "idusu") String idusu, @WebParam(name = "idsede") String idsede) {
List<Paquete> Resultado = new ArrayList<Paquete>();
Usuario usu = ejbUsuario.consultarUsuario(idusu);
Sede origen = ejbSede.consultarSedeXId(new BigDecimal(idsede));
Usuariosede use = ejbUsuariosede.ConsultarXUsuarioYSede(usu, origen);
try {
Resultado = ejbPaquete.consultarStatusPaquete(use);
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
*
* @param idusu
* @param idsede
* @return
*/
@WebMethod(operationName = "consultarStatusValija")
public List<Valija> consultarStatusValija(@WebParam(name = "idusu") String idusu, @WebParam(name = "idsede") String idsede) {
List<Valija> Resultado = new ArrayList<Valija>();
Usuario usu = ejbUsuario.consultarUsuario(idusu);
Sede origen = ejbSede.consultarSedeXId(new BigDecimal(idsede));
try {
Usuariosede use = ejbUsuariosede.ConsultarXUsuarioYSede(usu, origen);
Resultado = ejbValija.consultarStatusValija(use);
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
*
* @param idusu
* @param sede
* @return
*/
@WebMethod(operationName = "consultarSedeRol")
public Usuariosede consultarSedeRol(@WebParam(name = "idusu") String idusu, @WebParam(name = "sede") String sede) {
Usuariosede Resultado = new Usuariosede();
Sede sed = ejbSede.ConsultarSedeXNombre(sede);
try {
Resultado = ejbUsuariosede.sedeRolXId(idusu, sed);
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
*
* @return
*/
@WebMethod(operationName = "ConsultarSedes")
public List<Sede> ConsultarSedes() {
List<Sede> Resultado = null;
try {
Resultado = ejbSede.findAll();
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param sede
* @return
*/
@WebMethod(operationName = "ConsultarSedesBuzon")
public List<Sede> ConsultarSedesBuzon(@WebParam(name = "sede") String sede) {
List<Sede> Result = new ArrayList<Sede>();
try {
List<Sede> Resultado = ejbSede.findAll();
Iterator<Sede> lista = Resultado.iterator();
while (lista.hasNext()) {
Sede aux = lista.next();
if (!aux.getNombresed().equals(sede)) {
Result.add(aux);
}
}
} catch (Exception e) {
return null;
}
return Result;
}
/**
*
* @param idusu
* @return
*/
@WebMethod(operationName = "ConsultarSedesParaAsignar")
public List<Sede> ConsultarSedesParaAsignar(@WebParam(name = "user") String idusu) {
List<Sede> Resultado = new ArrayList<Sede>();
Usuario usu = ejbUsuario.consultarUsuarioXUser(idusu);
List<Sede> sed = consultarSedeDeUsuario(usu);
try {
List<Sede> Resultad = ejbSede.findAll();
Iterator<Sede> lista = sed.iterator();
Iterator<Sede> lista2 = Resultad.iterator();
while (lista.hasNext()) {
Sede aux = lista.next();
while (lista2.hasNext()) {
Sede aux2 = lista2.next();
if (aux.getIdsed() == aux2.getIdsed()) {
lista2.remove();
}
}
}
Resultado.addAll((Collection<? extends Sede>) lista2);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param idpaq
* @return
*/
@WebMethod(operationName = "actualizacionLocalizacionRecibidoPaquete")
public int actualizacionLocalizacionRecibidoPaquete(@WebParam(name = "idpaq") String idpaq) {
int Resultado = 0;
try {
ejbPaquete.ActualizacionLocalizacionyDelPaqueteRecibido(idpaq);
Resultado = 1;
} catch (Exception e) {
return 0;
}
return Resultado;
}
/**
*
* @param idpaq
* @param mensaje
* @return
*/
@WebMethod(operationName = "actualizacionPaqueteextraviado")
public int actualizacionPaqueteextraviado(@WebParam(name = "idpaq") String idpaq, @WebParam(name = "mensaje") String mensaje) {
int Resultado = 0;
try {
ejbPaquete.ActualizacionLocalizacionyDelPaqueteRecibido(idpaq);
Mensaje msj = new Mensaje();
msj.setNombremen("Extravio");
msj.setDescripcionmen(mensaje);
Paquete p = ejbPaquete.ConsultarPaqueteXId(new BigDecimal(idpaq));
msj.setIdpaq(p);
ejbMensaje.insertarMensaje(msj);
Resultado = 1;
} catch (Exception e) {
return 0;
}
return Resultado;
}
/**
*
* @param idpaq
* @param Localizacion
* @return
*/
@WebMethod(operationName = "actualizacionLocalizacionRecibidoValija")
public int actualizacionLocalizacionRecibidoValija(@WebParam(name = "idpaq") String idpaq, @WebParam(name = "Localizacion") String Localizacion) {
int Resultado = 0;
try {
BigDecimal idu = new BigDecimal(idpaq);
ejbPaquete.editarLocalizacionPaquete(idu, Localizacion);
Resultado = 1;
} catch (Exception e) {
return 0;
}
return Resultado;
}
/**
*
* @param idpaq
* @return
*/
@WebMethod(operationName = "actualizarBandeja")
public int actualizarBandeja(@WebParam(name = "idpaq") String idpaq) {
int Resultado;
try {
BigDecimal idu = new BigDecimal(idpaq);
Paquete paq = ejbPaquete.find(idu);
Usuario usu = ejbUsuario.consultarUsuario(paq.getOrigenpaq().getIdusu().getIdusu().toString());
Usuario usud = ejbUsuario.consultarUsuario(paq.getDestinopaq().getIdusu().getIdusu().toString());
if ("0".equals(paq.getRespaq())) {
ejbPaquete.ActualizacionLocalizacionyDelPaqueteRecibido(idpaq);
ejbBandeja.actualizacionBandeja(usu, usud, paq);
String idP = ejbSeguimiento.ultimoSegXPaq(idpaq);
ejbSeguimiento.editarSeguimiento(new BigDecimal(idP), "1");
}
if ("1".equals(paq.getRespaq())) {
ejbPaquete.ActualizacionLocalizacionyDelPaqueteRecibido(idpaq);
ejbBandeja.actualizacionBandeja(usu, usud, paq);
String idP = ejbSeguimiento.ultimoSegXPaq(idpaq);
ejbSeguimiento.editarSeguimiento(new BigDecimal(idP), "1");
}
if ("2".equals(paq.getRespaq())) {
//ejbPaquete.ActualizacionLocalizacionyDelPaqueteRecibido("entregado con respuesta", paq.getIdpaqres().toString());
ejbPaquete.ActualizacionLocalizacionyDelPaqueteRecibido(idpaq);
ejbBandeja.actualizacionBandeja(usu, usud, paq);
String idP = ejbSeguimiento.ultimoSegXPaq(idpaq);
ejbSeguimiento.editarSeguimiento(new BigDecimal(idP), "1");
}
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
*
* @param idval
* @param status
* @param idusu
* @param sede
* @return
*/
@WebMethod(operationName = "entregarValija")
public int entregarValija(@WebParam(name = "idval") String idval, @WebParam(name = "status") String status, @WebParam(name = "idusu") String idusu, @WebParam(name = "sede") String sede) {
int Resultado = 0;
BigDecimal id = new BigDecimal(idval);
Sede destino = ejbSede.ConsultarSedeXNombre(sede);
Usuario usu = ejbUsuario.consultarUsuario(idusu);
Usuariosede use = ejbUsuariosede.ConsultarXUsuarioYSede(usu, destino);
try {
ejbValija.entregarValija(id, status, use);
ejbBitacora.insertarBitacora(destino, usu, "DESGLOSAR", "Desglozar Valija");
Resultado = 1;
} catch (Exception e) {
return 0;
}
return Resultado;
}
/**
*
* @param idusu
* @param rol
* @param sede
* @return
*/
@WebMethod(operationName = "editarRol")
public int editarRol(@WebParam(name = "idusu") String idusu, @WebParam(name = "rol") String rol, @WebParam(name = "sede") String sede) {
int Resultado = 0;
Sede sed = ejbSede.ConsultarSedeXNombre(sede);
BigDecimal idu = new BigDecimal(idusu);
BigDecimal ro = new BigDecimal(rol);
try {
ejbUsuariosede.editarRol(idu, ro, sed.getIdsed());
Resultado = 1;
} catch (Exception e) {
return 0;
}
return Resultado;
}
/**
*
* @param idusu
* @param tipo
* @return
*/
@WebMethod(operationName = "editarTipoUsuario")
public int editarTipoUsuario(@WebParam(name = "idusu") String idusu, @WebParam(name = "tipo") String tipo) {
int Resultado = 0;
Usuario usu = ejbUsuario.consultarUsuarioXUser(idusu);
try {
ejbPaquete.editarTipo(usu.getIdusu(), tipo);
Resultado = 1;
} catch (Exception e) {
return 0;
}
return Resultado;
}
/**
*
* @param idusu
* @param sede
* @return
*/
@WebMethod(operationName = "asignarSede")
public int asignarSede(@WebParam(name = "idusu") String idusu, @WebParam(name = "sede") String sede) {
int Resultado = 0;
BigDecimal idr = new BigDecimal("6");
Usuario usu = ejbUsuario.consultarUsuarioXUser(idusu);
Sede sed = ejbSede.ConsultarSedeXNombre(sede);
Rol ro = ejbRol.find(idr);
try {
ejbUsuariosede.asignarSede(usu, ro, sed);
Resultado = 1;
} catch (Exception e) {
return 0;
}
return Resultado;
}
/**
* Método que inserta los datos en bitacora
*
* @param idSede
* @param idUsu
* @param accion
* @param observacion
* @return entero 1 si se inserto correctamente y 0 si no inserto
*/
@WebMethod(operationName = "insertarBitacora")
public int insertarBitacora(@WebParam(name = "idSede") String idSede, @WebParam(name = "idUsu") String idUsu, @WebParam(name = "accion") String accion, @WebParam(name = "observacion") String observacion) {
int Resultado;
try {
BigDecimal idSed = new BigDecimal(idSede);
Sede sed = ejbSede.consultarSedeXId(idSed);
Usuario usu = ejbUsuario.consultarUsuario(idUsu);
ejbBitacora.insertarBitacora(sed, usu, accion, observacion);
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
* Método que lista la información de bitacora
*
* @return lista de tipo bitacora con toda la información
*/
@WebMethod(operationName = "listarBitacora")
public List<Bitacora> listarBitacora() {
List<Bitacora> Resultado = null;
try {
Resultado = ejbBitacora.listarBitacora();
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
* Método que vacia toda la información de bitacora
*
* @return entero 1 si se vacio correctamente y 0 si no se vacio
*/
@WebMethod(operationName = "vaciarBitacora")
public int vaciarBitacora() {
List<Bitacora> bitacoras = null;
Bitacora registroBitacora;
int Resultado = 0;
try {
bitacoras = ejbBitacora.listarBitacora();
registroBitacora = new Bitacora();
for (int i = 0; i < bitacoras.size(); i++) {
registroBitacora = bitacoras.get(i);
ejbBitacora.vaciarBitacora(registroBitacora);
}
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
* Método que confirma la valija en el Proveedor que se selecciona
*
* @param idValija
* @param proveedor
* @param codProveedor
* @return entero 1 si se confirma correctamente y 0 si no se confirma
*/
@WebMethod(operationName = "confirmarValija")
public int confirmarValija(@WebParam(name = "idValija") String idValija, @WebParam(name = "proveedor") String proveedor, @WebParam(name = "codProveedor") String codProveedor) {
int Resultado = 0;
List<Paquete> lista;
BigDecimal idPaquete;
BigDecimal idVal;
BigDecimal idPro;
String localizacion;
Valija idValPaq;
try {
idVal = new BigDecimal(idValija);
idValPaq = new Valija();
idValPaq.setIdval(idVal);
Valija consulta = ejbValija.find(idVal);
idPro = new BigDecimal(proveedor);
if (consulta != null) {
ejbValija.editarProveedorValija(idVal, codProveedor, idPro);
lista = ejbPaquete.listarPaquetesXValija(idValPaq);
localizacion = ejbProveedor.consultarProveedorXId(idPro).getNombrepro();
for (int i = 0; i < lista.size(); i++) {
idPaquete = lista.get(i).getIdpaq();
ejbPaquete.editarLocalizacionPaquete(idPaquete, localizacion);
}
Resultado = 1;
}
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
* Metodo que reporta el paquete excedente, pertenezca o no a una valija
*
* @param registroPaquete
* @param registroUsuario
* @param registroSede
* @param datosPaquete
* @return entero 1 si se reporta correctamente, 0 si no se reporta
*/
@WebMethod(operationName = "reportarPaqueteExcedente")
public int reportarPaqueteExcedente(@WebParam(name = "registroPaquete") String registroPaquete, @WebParam(name = "registroUsuario") String registroUsuario, @WebParam(name = "registroSede") String registroSede, @WebParam(name = "datosPaquete") String datosPaquete) {
int Resultado = 0;
BigDecimal idVal;
BigDecimal idPaq;
Seguimiento nuevoSeg;
Incidente nuevoIncidente;
Paquete registroPaq;
Mensaje nuevoMensaje;
Valija idValija;
try {
registroPaq = new Paquete();
idPaq = new BigDecimal(registroPaquete);
registroPaq = ejbPaquete.consultarPaqueteXIdOCodigoBarras(registroPaquete);
Usuario usu = ejbUsuario.consultarUsuario(registroUsuario);
Sede origen = ejbSede.consultarSedeXId(new BigDecimal(registroSede));
Usuariosede use = ejbUsuariosede.ConsultarXUsuarioYSede(usu, origen);
//Seguimiento
nuevoSeg = new Seguimiento();
nuevoSeg.setIdpaq(registroPaq);
nuevoSeg.setIduse(use);
nuevoSeg.setFechaseg(new Date());
nuevoSeg.setStatusseg("2");
nuevoSeg.setTiposeg("1");
nuevoSeg.setNivelseg("Valija");
ejbSeguimiento.insertarSeguimiento(nuevoSeg);
//Mensaje
nuevoMensaje = new Mensaje();
nuevoMensaje.setNombremen("Paquete Excedente");
nuevoMensaje.setDescripcionmen(datosPaquete);
nuevoMensaje.setIdpaq(registroPaq);
ejbMensaje.insertarMensaje(nuevoMensaje);
//Cambio de Status de Paquete a Reenviado (3)
ejbPaquete.editarStatusPaquete(idPaq, "3");
if (registroPaq.getIdval() != null) {
idVal = registroPaq.getIdval().getIdval();
idValija = new Valija();
idValija.setIdval(idVal);
//Incidente
nuevoIncidente = new Incidente();
nuevoIncidente.setNombreinc("Paquete Excedente");
nuevoIncidente.setDescripcioninc("Reporte de paquete excedente");
nuevoIncidente.setIdval(idValija);
ejbIncidente.insertarIncidente(nuevoIncidente);
//Cambio de Status de Valija con Paquete Excedente (3)
ejbValija.editarStatusValija(idVal, "3");
}
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
* Metodo que reporta el paquete por extravió, pertenezca o no a una valija
*
* @param registroPaquete
* @param registroUsuario
* @param registroSede
* @param datosPaquete
* @return entero 1 si se reporta correctamente, 0 si no se reporta
*/
@WebMethod(operationName = "reportarPaqueteExtravio")
public int reportarPaqueteExtravio(@WebParam(name = "registroPaquete") String registroPaquete, @WebParam(name = "registroUsuario") String registroUsuario, @WebParam(name = "registroSede") String registroSede, @WebParam(name = "datosPaquete") String datosPaquete) {
int Resultado = 0;
BigDecimal idPaq;
Paquete registroPaq;
Mensaje nuevoMensaje;
try {
registroPaq = ejbPaquete.consultarPaqueteXIdOCodigoBarras(registroPaquete);
Usuario usu = ejbUsuario.consultarUsuario(registroUsuario);
Sede origen = ejbSede.consultarSedeXId(new BigDecimal(registroSede));
Usuariosede use = ejbUsuariosede.ConsultarXUsuarioYSede(usu, origen);
String idP = ejbSeguimiento.ultimoSegXPaq(registroPaquete);
//Edito Seguimiento
ejbSeguimiento.editarSeguimiento(new BigDecimal(idP), "3");
//Mensaje
nuevoMensaje = new Mensaje();
nuevoMensaje.setNombremen("Paquete Extraviado");
nuevoMensaje.setDescripcionmen(datosPaquete);
nuevoMensaje.setIdpaq(registroPaq);
ejbMensaje.insertarMensaje(nuevoMensaje);
//Cambio de Status de Paquete a extraviado (4)
ejbPaquete.ActualizacionPaqueteExtraviado(idP);
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
* Método que reporta valija con destino erroneo
*
* @param registroValija
* @param registroUsuario
* @param registroSede
* @param datosValija
* @return entero 1 si se reporta correctamente, 0 si no se reporta
*/
@WebMethod(operationName = "reportarValija")
public int reportarValija(@WebParam(name = "registroValija") String registroValija, @WebParam(name = "registroUsuario") String registroUsuario, @WebParam(name = "registroSede") String registroSede, @WebParam(name = "datosValija") String datosValija) {
int Resultado = 0;
List<Paquete> lista;
BigDecimal idPaq;
Seguimiento nuevoSeg;
Incidente nuevoIncidente;
Paquete registroPaquete;
Valija idValija;
try {
Usuario usu = ejbUsuario.consultarUsuario(registroUsuario);
Sede origen = ejbSede.consultarSedeXId(new BigDecimal(registroSede));
Usuariosede use = ejbUsuariosede.ConsultarXUsuarioYSede(usu, origen);
Valija val = ejbValija.consultarValijaXIdOCodigoBarra(registroValija);
//Incidente
nuevoIncidente = new Incidente();
nuevoIncidente.setNombreinc("Valija Incorrecta");
nuevoIncidente.setDescripcioninc(datosValija);
nuevoIncidente.setIdval(val);
ejbIncidente.insertarIncidente(nuevoIncidente);
lista = ejbPaquete.listarPaquetesXValija(val);
for (int i = 0; i < lista.size(); i++) {
idPaq = lista.get(i).getIdpaq();
registroPaquete = new Paquete();
registroPaquete.setIdpaq(idPaq);
//Seguimiento
nuevoSeg = new Seguimiento();
nuevoSeg.setIdpaq(registroPaquete);
nuevoSeg.setIduse(use);
nuevoSeg.setFechaseg(new Date());
nuevoSeg.setStatusseg("2");
nuevoSeg.setTiposeg("1");
nuevoSeg.setNivelseg("Valija");
ejbSeguimiento.insertarSeguimiento(nuevoSeg);
//Cambio de Status de Paquete a Reenviado (3)
ejbPaquete.editarStatusPaquete(idPaq, "3");
}
//Cambio de Status de Valija a Reenviada (4)
ejbValija.editarStatusValija(val.getIdval(), "4");
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
* Método que reporta valija con destino erroneo
*
* @param registroValija
* @param registroUsuario
* @param registroSede
* @param datosValija
* @return entero 1 si se reporta correctamente, 0 si no se reporta
*/
@WebMethod(operationName = "reportarValijaExtravio")
public int reportarValijaExtravio(@WebParam(name = "registroValija") String registroValija, @WebParam(name = "registroUsuario") String registroUsuario, @WebParam(name = "registroSede") String registroSede, @WebParam(name = "datosValija") String datosValija) {
int Resultado = 0;
List<Paquete> lista;
BigDecimal idPaq;
Incidente nuevoIncidente;
try {
Usuario usu = ejbUsuario.consultarUsuario(registroUsuario);
Sede origen = ejbSede.consultarSedeXId(new BigDecimal(registroSede));
Usuariosede use = ejbUsuariosede.ConsultarXUsuarioYSede(usu, origen);
Valija val = ejbValija.consultarValijaXIdOCodigoBarra(registroValija);
//Incidente
nuevoIncidente = new Incidente();
nuevoIncidente.setNombreinc("Valija extraviada");
nuevoIncidente.setDescripcioninc(datosValija);
nuevoIncidente.setIdval(val);
ejbIncidente.insertarIncidente(nuevoIncidente);
lista = ejbPaquete.listarPaquetesXValija(val);
for (int i = 0; i < lista.size(); i++) {
idPaq = lista.get(i).getIdpaq();
//Cambio de Status de Paquete a extraviado (4)
ejbPaquete.ActualizacionPaqueteExtraviado(idPaq.toString());
}
//Cambio de Status de Valija a extraviada (5)
ejbValija.editarStatusValija(val.getIdval(), "5");
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
* Método que lista las valijas dependiendo del rango de fecha y de la sede
*
* @param fechaInicio
* @param idsede
* @param fechaFinal
* @param consulta
* @return lista tipo valija con toda la información
*/
@WebMethod(operationName = "consultarEstadisticasValijas")
public List<Valija> consultarEstadisticasValijas(@WebParam(name = "fechaInicio") String fechaInicio, @WebParam(name = "fechaFinal") String fechaFinal, @WebParam(name = "consulta") String consulta, @WebParam(name = "idsede") String idsede) {
List<Valija> Resultado = new ArrayList<Valija>();
Calendar calendario = GregorianCalendar.getInstance();
Date fecha = calendario.getTime();
System.out.println(fecha);
SimpleDateFormat formatoDeFecha = new SimpleDateFormat("dd/MM/yyyy");
try {
Date fechaini = formatoDeFecha.parse(fechaInicio);
Date fechafin = formatoDeFecha.parse(fechaFinal);
Resultado = ejbValija.estadisticasValija(fechaini, fechafin, consulta, idsede);
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
* Método que lista los paquetes dependiendo del rango de fecha y de la sede
*
* @param fechaInicio
* @param idsede
* @param fechaFinal
* @param consulta
* @return lista tipo paquete con toda la información
*/
@WebMethod(operationName = "consultarEstadisticasPaquetes")
public List<Paquete> consultarEstadisticasPaquetes(@WebParam(name = "fechaInicio") String fechaInicio, @WebParam(name = "fechaFinal") String fechaFinal, @WebParam(name = "consulta") String consulta, @WebParam(name = "idsede") String idsede) {
List<Paquete> Resultado = new ArrayList<Paquete>();
Calendar calendario = GregorianCalendar.getInstance();
Date fecha = calendario.getTime();
System.out.println(fecha);
SimpleDateFormat formatoDeFecha = new SimpleDateFormat("dd/MM/yyyy");
try {
Date fechaini = formatoDeFecha.parse(fechaInicio);
Date fechafin = formatoDeFecha.parse(fechaFinal);
Resultado = ejbPaquete.estadisticasPaquete(fechaini, fechafin, consulta, idsede);
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
* Método que consulta los datos de la sede por el id
*
* @param idSede
* @return objeto tipo sede con toda la información
*/
@WebMethod(operationName = "consultarSedeXId")
public Sede consultarSedeXId(@WebParam(name = "idSede") String idSede) {
Sede Resultado = null;
try {
BigDecimal idSed = new BigDecimal(idSede);
Resultado = ejbSede.consultarSedeXId(idSed);
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
* Método para obtener el último paquete guardado
*
* @param idUsuario
* @return objeto tipo paquete con toda la información
*/
@WebMethod(operationName = "ultimoPaqueteXOrigen")
public Paquete ultimoPaqueteXOrigen(@WebParam(name = "idUsuario") String idUsuario) {
String idPaquete;
BigDecimal idPaq;
Usuario idUsua;
Paquete Resultado = null;
try {
idUsua = ejbUsuario.consultarUsuario(idUsuario);
idPaquete = ejbPaquete.ultimoPaqueteXOrigen(idUsua);
if (idPaquete != null) {
idPaq = new BigDecimal(idPaquete);
Resultado = ejbPaquete.consultarPaquete(idPaq);
}
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
* Método que consulta datos del paquete por el id
*
* @param idPaquete
* @return objeto tipo paquete con toda la información
*/
@WebMethod(operationName = "consultarPaqueteXId")
public Paquete consultarPaqueteXId(@WebParam(name = "idPaquete") String idPaquete) {
Paquete Resultado = null;
BigDecimal idPaq = new BigDecimal(idPaquete);
try {
Resultado = ejbPaquete.consultarPaquete(idPaq);
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
* Método para obtener la última valija guardada
*
* @param idUsuario
* @return objeto tipo valija con toda la información
*/
@WebMethod(operationName = "ultimaValijaXUsuario")
public Valija ultimaValijaXUsuario(@WebParam(name = "idUsuario") String idUsuario) {
BigDecimal idUsu;
Valija Resultado = null;
try {
idUsu = ejbValija.ultimaValija(new BigDecimal(idUsuario));
if (idUsu != null) {
Resultado = ejbValija.consultarPaquete(idUsu);
}
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
* Método que consulta datos del adjunto por el id
*
* @param idPaquete
* @return objeto tipo adjunto con toda la información
*/
@WebMethod(operationName = "consultarAdjuntoXPaquete")
public Adjunto consultarAdjuntoXPaquete(@WebParam(name = "idPaquete") String idPaquete) {
Adjunto Resultado = null;
Paquete idPaq;
try {
idPaq = new Paquete();
idPaq.setIdpaq(new BigDecimal(idPaquete));
Resultado = ejbAdjunto.consultarAdjuntoXPaquete(idPaq);
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
*
* @param idPaquete
* @return
*/
@WebMethod(operationName = "consultarSeguimientoXPaquete")
public List<Seguimiento> consultarSeguimientoXPaquete(@WebParam(name = "idPaquete") String idPaquete) {
List<Seguimiento> Resultado;
Paquete idPaq;
try {
idPaq = new Paquete();
idPaq.setIdpaq(new BigDecimal(idPaquete));
Resultado = ejbSeguimiento.consultarSeguimientoXPaquete(idPaq);
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
*
* @param sede
* @return
*/
@WebMethod(operationName = "consultarProveedorXSede")
public List<Proveedor> consultarProveedorXSede(@WebParam(name = "sede") Sede sede) {
List<Proveedor> Resultado;
try {
Resultado = ejbProveedorSede.consultarProveedorXSede(sede);
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
*
* @param nombre
* @return
*/
@WebMethod(operationName = "consultarProveedorXNombre")
public List<Proveedor> consultarProveedorXNombre(@WebParam(name = "nombre") String nombre) {
List<Proveedor> Resultado;
try {
Resultado = (List<Proveedor>) ejbProveedor.consultarProveedorNombre(nombre);
} catch (Exception e) {
Resultado = null;
}
return Resultado;
}
/**
* Registra el seguimiento del paquete retorna 0 si ya fue confirmado
* retorna 1 si confirmo retorna 2 si aún no le corresponde confirmar
*
* @param registroPaquete
* @param registroUsuario
* @param registroSede
* @param Caso
* @return
*/
@WebMethod(operationName = "registroSeguimiento")
public int registroSeguimiento(@WebParam(name = "registroPaquete") Paquete registroPaquete, @WebParam(name = "registroUsuario") Usuario registroUsuario, @WebParam(name = "registroSede") Sede registroSede, @WebParam(name = "Caso") String Caso) {
int Resultado = 0, primeraVez = 0;
boolean reenvio = false, aunNo = false;
String nivelSeg = "", Tipo;
Seguimiento nuevoSeg = new Seguimiento();
Usuariosede usuarioSede = null;
try {
List<Seguimiento> RegistrosSeguimiento = ejbSeguimiento.consultarSeguimientoXPaquete(registroPaquete);
usuarioSede = consultarUsuarioSede(registroUsuario, registroSede);
registroPaquete = ejbPaquete.ConsultarPaqueteXId(registroPaquete.getIdpaq());
try {
Paquete Registro = ejbPaquete.ConsultarPaqueteXIdPaqueteYSedeDeValija(registroSede, registroPaquete.getIdpaq());
Tipo = "1";
} catch (Exception e) {
Tipo = "0";
}
if (RegistrosSeguimiento.isEmpty()) {
if (Caso.compareTo("Confirmar") == 0) {
primeraVez = 1;
} else {
nuevoSeg = new Seguimiento();
nuevoSeg.setFechaseg(new Date());
nuevoSeg.setIdpaq(registroPaquete);
nuevoSeg.setIduse(usuarioSede);
nuevoSeg.setTiposeg(Tipo);
nuevoSeg.setNivelseg("Usuario");
nuevoSeg.setStatusseg("0");
ejbSeguimiento.insertarSeguimiento(nuevoSeg);
ejbBitacora.insertarBitacora(registroSede, registroUsuario, "CONFIRMACIÓN", "Registro de paquete Usuario Normal");
primeraVez = 2;
return 1;
}
if (primeraVez == 1) {
return 2;
} else if (primeraVez == 2) {
return 1;
}
}
if (usuarioSede.getIdrol().getIdrol().toString().compareTo("1") == 0) {
nivelSeg = "Area de Trabajo";
} else if (usuarioSede.getIdrol().getIdrol().toString().compareTo("2") == 0) {
nivelSeg = "Sede";
} else if (usuarioSede.getIdrol().getIdrol().toString().compareTo("3") == 0) {
nivelSeg = "Emisario";
} else if (usuarioSede.getIdrol().getIdrol().toString().compareTo("4") == 0) {
nivelSeg = "Valija";
} else if (usuarioSede.getIdrol().getIdrol().toString().compareTo("5") == 0) {//caso del multirol
if (Tipo.compareTo("0") == 0) {
if (registroPaquete.getLocalizacionpaq().compareTo("Sede") == 0) {//REVISAR LOCALIZACION
nivelSeg = "Valija";
} else {
nivelSeg = "Sede";
}
if (Caso.compareTo("Confirmar") == 0) {
for (int i = 0; i < RegistrosSeguimiento.size(); i++) {
if (RegistrosSeguimiento.get(i).getIduse() == usuarioSede) {
return Resultado;
}
}
}
} else {//destino
if (registroPaquete.getLocalizacionpaq().compareTo("Valija") == 0) {//REVISAR LOCALIZACION
nivelSeg = "Sede";
} else {
nivelSeg = "Valija";
}
}
}
if (RegistrosSeguimiento.size() == 1) {
if (usuarioSede.getIdrol().getIdrol().toString().compareTo("5") == 0 || usuarioSede.getIdrol().getIdrol().toString().compareTo("1") == 0 || usuarioSede.getIdrol().getIdrol().toString().compareTo("2") == 0 || usuarioSede.getIdrol().getIdrol().toString().compareTo("3") == 0 || Tipo.compareTo("0") == 0) {
nuevoSeg = new Seguimiento();
nuevoSeg.setFechaseg(new Date());
nuevoSeg.setIdpaq(registroPaquete);
nuevoSeg.setIduse(usuarioSede);
nuevoSeg.setTiposeg(Tipo);
nuevoSeg.setNivelseg(nivelSeg);
nuevoSeg.setStatusseg("0");
ejbSeguimiento.insertarSeguimiento(nuevoSeg);
ejbPaquete.editarLocalizacionPaquete(registroPaquete.getIdpaq(), nivelSeg);
if (usuarioSede.getIdrol().getIdrol().toString().compareTo("1") == 0) {
ejbBitacora.insertarBitacora(registroSede, registroUsuario, "CONFIRMACIÓN", "Registro de paquete Area de trabajo");
} else if (usuarioSede.getIdrol().getIdrol().toString().compareTo("2") == 0 || usuarioSede.getIdrol().getIdrol().toString().compareTo("5") == 0) {
ejbBitacora.insertarBitacora(registroSede, registroUsuario, "CONFIRMACIÓN", "Registro de paquete Sede");
} else if (usuarioSede.getIdrol().getIdrol().toString().compareTo("3") == 0) {
ejbBitacora.insertarBitacora(registroSede, registroUsuario, "CONFIRMACIÓN", "Registro de paquete Emisario");
}
return 1;
} else {
return 2;
}
}
for (int i = 0; i < RegistrosSeguimiento.size(); i++) {
//pregunto ya un envajilador habia tocado el paquete y el q recibo como parametro es envajilador quiere decir que es un reenvio de paquete
if (RegistrosSeguimiento.get(i).getNivelseg().compareTo(nivelSeg) == 0 && RegistrosSeguimiento.get(i).getTiposeg().compareTo(Tipo) == 0 && RegistrosSeguimiento.get(i).getNivelseg().compareTo("Emisario") == 0) {
reenvio = true;
} else {
if (RegistrosSeguimiento.get(i).getTiposeg().compareTo(Tipo) == 0 && RegistrosSeguimiento.get(i).getNivelseg().compareTo(nivelSeg) == 0 && RegistrosSeguimiento.get(i).getNivelseg().compareTo("Emisario") != 0) {
return Resultado;
}
}
}
//caso de multirol cuando esta en la vista de confirmacion
//Caso Receptor nivel 1 Origen o Receptor nivel 3 Origen
if ((usuarioSede.getIdrol().getIdrol().toString().compareTo("1") == 0 || usuarioSede.getIdrol().getIdrol().toString().compareTo("3") == 0) && Tipo.compareTo("0") == 0) {
for (int i = 0; i < RegistrosSeguimiento.size(); i++) {
if (RegistrosSeguimiento.get(i).getNivelseg().compareTo("Sede") == 0 && RegistrosSeguimiento.get(i).getTiposeg().compareTo("0") == 0) {
return Resultado;
}
}
Resultado = 1;
} //Caso Receptor nivel 2 Origen
else if (usuarioSede.getIdrol().getIdrol().toString().compareTo("2") == 0 && Tipo.compareTo("0") == 0) {
Resultado = 1;
} //Caso MultiRol Origen
else if (usuarioSede.getIdrol().getIdrol().toString().compareTo("5") == 0 && Tipo.compareTo("0") == 0) {
Resultado = 1;
} //Caso Empaquetador
else if (usuarioSede.getIdrol().getIdrol().toString().compareTo("4") == 0 && Tipo.compareTo("0") == 0) {
for (int i = 0; i < RegistrosSeguimiento.size(); i++) {
if (RegistrosSeguimiento.get(i).getNivelseg().compareTo("Sede") == 0 && RegistrosSeguimiento.get(i).getTiposeg().compareTo("0") == 0) {
Resultado = 1;
aunNo = true;
break;
}
}
if (!aunNo) {
return 2;
}
}//Caso Desenvalijador
else if (usuarioSede.getIdrol().getIdrol().toString().compareTo("4") == 0 && Tipo.compareTo("1") == 0) {
for (int i = 0; i < RegistrosSeguimiento.size(); i++) {
if (RegistrosSeguimiento.get(i).getNivelseg().compareTo("Valija") == 0 && RegistrosSeguimiento.get(i).getTiposeg().compareTo("0") == 0 && registroPaquete.getIdval().getCodproveedorval() != null) {
Resultado = 1;
aunNo = true;
break;
}
}
if (!aunNo) {
return 2;
}
}//Caso Receptor nivel 1 Destino o Caso Receptor nivel 3 Destino
else if ((usuarioSede.getIdrol().getIdrol().toString().compareTo("1") == 0 || usuarioSede.getIdrol().getIdrol().toString().compareTo("3") == 0) && Tipo.compareTo("1") == 0) {
for (int i = 0; i < RegistrosSeguimiento.size(); i++) {
if (RegistrosSeguimiento.get(i).getNivelseg().compareTo("Sede") == 0 && RegistrosSeguimiento.get(i).getTiposeg().compareTo("1") == 0) {
Resultado = 1;
aunNo = true;
break;
}
}
if (!aunNo) {
return 2;
}
} //Caso Receptor nivel 2 Destino
else if (usuarioSede.getIdrol().getIdrol().toString().compareTo("2") == 0 && Tipo.compareTo("1") == 0) {
for (int i = 0; i < RegistrosSeguimiento.size(); i++) {
if (RegistrosSeguimiento.get(i).getNivelseg().compareTo("Valija") == 0 && RegistrosSeguimiento.get(i).getTiposeg().compareTo("1") == 0) {
Resultado = 1;
aunNo = true;
break;
}
}
if (!aunNo) {
return 2;
}
}//Caso MultiRol Destino
else if (usuarioSede.getIdrol().getIdrol().toString().compareTo("5") == 0 && Tipo.compareTo("1") == 0) {
if (nivelSeg.compareTo("Sede") == 0) { //si es sede
for (int i = 0; i < RegistrosSeguimiento.size(); i++) {
if (RegistrosSeguimiento.get(i).getNivelseg().compareTo("Valija") == 0 && RegistrosSeguimiento.get(i).getTiposeg().compareTo("1") == 0) {
Resultado = 1;
aunNo = true;
break;
}
}
if (!aunNo) {
return 2;
}
} else { // si es desenvajilador
for (int i = 0; i < RegistrosSeguimiento.size(); i++) {
if (RegistrosSeguimiento.get(i).getNivelseg().compareTo("Valija") == 0 && RegistrosSeguimiento.get(i).getTiposeg().compareTo("0") == 0 && registroPaquete.getIdval().getCodproveedorval() != null) {
Resultado = 1;
aunNo = true;
break;
}
}
if (!aunNo) {
return 2;
}
}
Resultado = 1;
}
if (Resultado == 1) {
nuevoSeg = new Seguimiento();
nuevoSeg.setFechaseg(new Date());
nuevoSeg.setIdpaq(registroPaquete);
nuevoSeg.setIduse(usuarioSede);
nuevoSeg.setTiposeg(Tipo);
nuevoSeg.setNivelseg(nivelSeg);
if (reenvio) {
nuevoSeg.setStatusseg("2");
} else {
nuevoSeg.setStatusseg("0");
}
for (int i = 0; i < RegistrosSeguimiento.size(); i++) {
RegistrosSeguimiento.get(i).setStatusseg("1");
ejbSeguimiento.edit(RegistrosSeguimiento.get(i));
}
ejbSeguimiento.insertarSeguimiento(nuevoSeg);
ejbPaquete.editarLocalizacionPaquete(registroPaquete.getIdpaq(), nivelSeg);
if (usuarioSede.getIdrol().getIdrol().toString().compareTo("1") == 0) {
ejbBitacora.insertarBitacora(registroSede, registroUsuario, "CONFIRMACIÓN", "Registro de paquete Area de trabajo");
} else if (usuarioSede.getIdrol().getIdrol().toString().compareTo("2") == 0) {
ejbBitacora.insertarBitacora(registroSede, registroUsuario, "CONFIRMACIÓN", "Registro de paquete Sede");
} else if (usuarioSede.getIdrol().getIdrol().toString().compareTo("3") == 0) {
ejbBitacora.insertarBitacora(registroSede, registroUsuario, "CONFIRMACIÓN", "Registro de paquete Emisario");
if (reenvio) {
ejbBitacora.insertarBitacora(registroSede, registroUsuario, "REENVIO", "Reenvio correspondencia");
}
} else if (usuarioSede.getIdrol().getIdrol().toString().compareTo("4") == 0) {
ejbBitacora.insertarBitacora(registroSede, registroUsuario, "CONFIRMACIÓN", "Registro de paquete Valija");
} else if (usuarioSede.getIdrol().getIdrol().toString().compareTo("5") == 0) {
if (nivelSeg.compareTo("Sede") == 0) {
ejbBitacora.insertarBitacora(registroSede, registroUsuario, "CONFIRMACIÓN", "Registro de paquete Sede");
} else {
ejbBitacora.insertarBitacora(registroSede, registroUsuario, "CONFIRMACIÓN", "Registro de paquete Valija");
}
}
}
} catch (Exception e) {
return Resultado;
}
//Caso id1: nivel 1
//Caso id2: nivel 2
//Caso id3: nivel 3
//Caso id4: Empaquetador Desempaquetador 4
return Resultado;
}
/**
* consulta el usuario sede por usuario y sede
*
* @param registroUsuario
* @param registroSede
* @return
*/
@WebMethod(operationName = "consultarUsuarioSede")
public Usuariosede consultarUsuarioSede(@WebParam(name = "registroUsuario") Usuario registroUsuario, @WebParam(name = "registroSede") Sede registroSede) {
Usuariosede Resultado = null;
try {
Resultado = ejbUsuariosede.ConsultarXUsuarioYSede(registroUsuario, registroSede);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
* consulta el buzon por usuario
*
* @param registroUsuario
* @return
*/
@WebMethod(operationName = "consultarBuzonUsuario")
public List<Buzon> consultarBuzonUsuario(@WebParam(name = "registroUsuario") String registroUsuario) {
List<Buzon> Resultado;
try {
Resultado = ejbBuzon.ConsultarBuzonXUsuario(new BigDecimal(registroUsuario));
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param idbuz
* @return
*/
@WebMethod(operationName = "consultarBuzon")
public Buzon consultarBuzon(@WebParam(name = "idbuz") String idbuz) {
Buzon Resultado;
try {
Resultado = ejbBuzon.consultarBuzonXId(idbuz);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param nombre
* @param apellido
* @param area
* @return
*/
@WebMethod(operationName = "consultarBuzonParaEnviar")
public List<Buzon> consultarBuzonParaEnviar(@WebParam(name = "nombre") String nombre, @WebParam(name = "apellido") String apellido, @WebParam(name = "area") String area, @WebParam(name = "miBuzon") Buzon miBuzon, @WebParam(name = "sede") String sede) {
List<Buzon> Resultado;
try {
Resultado = ejbBuzon.buscarBuzonParaEnviar(nombre, apellido, area, miBuzon,sede);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
* cuando el usuario destino recibe el paquete se finaliza el seguimiento
*
* @param registroPaquete
* @param registroUsuario
* @return
*/
@WebMethod(operationName = "finalizarSeguimiento")
public int finalizarSeguimiento(@WebParam(name = "registroPaquete") Paquete registroPaquete, @WebParam(name = "registroUsuario") Usuario registroUsuario) {
int Resultado = 0;
//Caso Usuario Destino
try {
List<Seguimiento> RegistrosSeguimiento = ejbSeguimiento.consultarSeguimientoXPaquete(registroPaquete);
boolean Nivel2 = false;
for (int i = 0; i < RegistrosSeguimiento.size(); i++) {
if (RegistrosSeguimiento.get(i).getIdpaq().getOrigenpaq().getIdusu().toString().compareTo(registroPaquete.getOrigenpaq().getIdusu().toString()) == 0 && RegistrosSeguimiento.get(i).getNivelseg().compareTo("Sede") == 0 && RegistrosSeguimiento.get(i).getTiposeg().compareTo("1") == 0) {
Nivel2 = true;
break;
}
}
if (Nivel2) {
for (int i = 0; i < RegistrosSeguimiento.size(); i++) {
RegistrosSeguimiento.get(i).setStatusseg("1");
ejbSeguimiento.edit(RegistrosSeguimiento.get(i));
}
ejbPaquete.editarLocalizacionPaquete(registroPaquete.getIdpaq(), registroUsuario.getUserusu());
Resultado = 1;
}
} catch (Exception e) {
return 0;
}
return Resultado;
}
/**
* Editar usuario
*
* @param registroUsuario
* @return
*/
@WebMethod(operationName = "editarUsuario")
public int editarUsuario(@WebParam(name = "registroUsuario") Usuario registroUsuario) {
int Resultado = 0;
try {
ejbUsuario.editarUsuario(registroUsuario);
Resultado = 1;
} catch (Exception e) {
return 0;
}
return Resultado;
}
/**
* Editar usuario
*
* @param registroBuzon
* @return
*/
@WebMethod(operationName = "editarBuzon")
public int editarBuzon(@WebParam(name = "registroBuzon") Buzon registroBuzon) {
int Resultado = 0;
try {
ejbBuzon.editarBuzon(registroBuzon);
Resultado = 1;
} catch (Exception e) {
return 0;
}
return Resultado;
}
/**
* lista paquetes que se pasaron de fecha limite o si la fecha alerta es
* igual a la actualy el paquete no ha llegado de los paquetes que se han
* enviado
*
* @param registroUsuario
* @param registroSede
* @return
*/
@WebMethod(operationName = "paquetesVencidosXOrigen")
public List<Paquete> paquetesVencidosXOrigen(@WebParam(name = "registroUsuario") Usuario registroUsuario, @WebParam(name = "registroSede") Sede registroSede) {
List<Paquete> ResultadoVencidas = null;
try {
ResultadoVencidas = ejbAlerta.consultarPaquetesXUsuarioOrigen(registroUsuario, registroSede);
} catch (Exception e) {
return null;
}
return ResultadoVencidas;
}
/**
* lista paquetes que se pasaron de fecha limite o si la fecha alerta es
* igual a la actualy el paquete no ha llegado de los paquetes que debetria
* recibir
*
* @param registroUsuario
* @param registroSede
* @return
*/
@WebMethod(operationName = "paquetesVencidosXDestino")
public List<Paquete> paquetesVencidosXDestino(@WebParam(name = "registroUsuario") Usuario registroUsuario, @WebParam(name = "registroSede") Sede registroSede) {
List<Paquete> Resultado = null;
try {
Resultado = ejbAlerta.consultarPaquetesXUsuarioDestino(registroUsuario, registroSede);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param usuarioSede
* @return
*/
@WebMethod(operationName = "paquetesVencidosXSeguimiento")
public List<Paquete> paquetesVencidosXSeguimiento(@WebParam(name = "usuarioSede") Usuariosede usuarioSede) {
List<Paquete> Resultado = null;
try {
Resultado = ejbAlerta.consultarPaquetesXSeguimiento(usuarioSede);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
* consulta los contactos que el usuario tiene registrado en buzón
*
* @param registroUsuario
* @param registroSede
* @return
*/
@WebMethod(operationName = "consultarBuzonXUsuario")
public List<Buzon> consultarBuzonXUsuario(@WebParam(name = "registroUsuario") Usuario registroUsuario, @WebParam(name = "registroSede") Sede registroSede) {
List<Buzon> Interno = null, Externo = null;
try {
Interno = ejbBuzon.ConsultarBuzonInternoXUsuario(registroUsuario, registroSede);
Externo = ejbBuzon.ConsultarBuzonExternoXUsuario(registroUsuario);
if (Interno.isEmpty() && !Externo.isEmpty()) {
return Externo;
} else if (!Interno.isEmpty() && Externo.isEmpty()) {
return Interno;
} else if (!Interno.isEmpty() && !Externo.isEmpty()) {
for (int i = 0; i < Externo.size(); i++) {
Interno.add(Externo.get(i));
}
}
} catch (Exception e) {
return null;
}
return Interno;
}
/**
* lista todos los tipos de documentos
*
* @return
*/
@WebMethod(operationName = "listarDocumentos")
public List<Documento> listarDocumentos() {
List<Documento> Resultado = null;
try {
Resultado = ejbDocumento.listarDocumentos();
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
* lista todas las prioridades
*
* @return
*/
@WebMethod(operationName = "listarPrioridad")
public List<Prioridad> listarPrioridad() {
List<Prioridad> Resultado = null;
try {
Resultado = ejbPrioridad.listarPrioridades();
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
* consultarPaquetesXUsuario confirmados al día
*
* @param idUsuarioSede
* @return
*/
@WebMethod(operationName = "consultarPaquetesConfirmadosXUsuarioSede")
public List<Paquete> consultarPaquetesConfirmadosXUsuarioSede(@WebParam(name = "idUsuarioSede") Usuariosede idUsuarioSede) {
List<Paquete> Resultado = null;
try {
Resultado = ejbSeguimiento.listaPaquetesProcesadosXUsuarioSede(idUsuarioSede);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param idUsuarioSede
* @return
*/
@WebMethod(operationName = "consultarPaquetesConfirmadosXRol")
public List<Paquete> consultarPaquetesConfirmadosXRol(@WebParam(name = "idUsuarioSede") Usuariosede idUsuarioSede) {
List<Paquete> Resultado = null;
try {
Resultado = ejbSeguimiento.consultarPaquetesConfirmadosXRol(idUsuarioSede);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
* consulta sede de usuario sirve solo cuando tiene una sola sede
* ..........ojo se usa en index
*
* @param registroUsuario
* @return
*/
@WebMethod(operationName = "consultarSedeDeUsuario")
public List<Sede> consultarSedeDeUsuario(@WebParam(name = "registroUsuario") Usuario registroUsuario) {
List<Sede> Resultado = null;
try {
Resultado = ejbUsuariosede.ConsultarSedeDeUsuario(registroUsuario);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
* consulta usuario por useruse
*
* @param user
* @return
*/
@WebMethod(operationName = "consultarUsuarioXUser")
public Usuario consultarUsuarioXUser(@WebParam(name = "user") String user) {
Usuario Resul = null;
try {
Resul = ejbUsuario.consultarUsuarioXUser(user);
} catch (Exception e) {
return null;
}
if (Resul.getIdusu() == null) {
return null;
}
return Resul;
}
/**
* si agrego una imagen se usa el servicio
*
* @param registroAdj
* @return
*/
@WebMethod(operationName = "insertarAdjunto")
public int insertarAdjunto(@WebParam(name = "registroAdj") Adjunto registroAdj) {
int Resultado = 0;
try {
ejbAdjunto.insertarAdjunto(registroAdj);
Resultado = 1;
} catch (Exception e) {
return 0;
}
return Resultado;
}
/**
* lista todas las sedes
*
* @return
*/
@WebMethod(operationName = "listarSedes")
public List<Sede> listarSedes() {
List<Sede> Resultado = null;
try {
Resultado = ejbSede.listarSedes();
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
* lista todas las sedes
*
* @return
*/
@WebMethod(operationName = "consultarOrganizaciones")
public List<Organizacion> consultarOrganizaciones() {
List<Organizacion> Resultado = null;
try {
Resultado = ejbOrganizacion.findAll();
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
* caso en el cual se crea usuario
*
* @param registroUsuSede
* @param userUsu
* @return
*/
@WebMethod(operationName = "insertarUsuarioSedeXDefecto")
public int insertarUsuarioSedeXDefecto(@WebParam(name = "registroUsuSede") Usuariosede registroUsuSede, @WebParam(name = "userUsu") String userUsu) {
int Resultado = 0;
try {
Usuario RegUsu = new Usuario(ejbUsuario.consultarMAXId(userUsu));
registroUsuSede.setIdusu(RegUsu);
ejbUsuariosede.insertarUsuarioSede(registroUsuSede);
Resultado = 1;
Resultado = insertarBuzon(RegUsu.getIdusu().toString(), registroUsuSede.getIdsed().getIdsed().toString());
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
* caso en buzon adicional
*
* @param idusu
* @param idatr
* @param idsed
* @return
*/
@WebMethod(operationName = "insertarUsuarioSedeXAdicional")
public int insertarUsuarioSedeXAdicional(@WebParam(name = "idusu") String idusu, @WebParam(name = "idatr") String idatr, @WebParam(name = "idsed") String idsed) {
int Resultado = 0;
try {
Usuariosede registroUsuSede = new Usuariosede();
Rol rol = ejbRol.find(new BigDecimal("6"));
Sede sed = ejbSede.ConsultarSedeXNombre(idsed);
registroUsuSede.setIdatr(ejbAreaTrabajo.consultarAreasXId(idatr));
registroUsuSede.setIdsed(sed);
registroUsuSede.setIdusu(ejbUsuario.find(new BigDecimal(idusu)));
registroUsuSede.setIdrol(rol);
Usuario usuario = ejbUsuario.find(new BigDecimal(idusu));
try {
Usuariosede registro = ejbUsuariosede.ConsultarXUsuarioYSede(usuario, sed);
return 2;
} catch (Exception e) {
}
ejbUsuariosede.insertarUsuarioSede(registroUsuSede);
Resultado = 1;
Resultado = insertarBuzon(idusu, sed.getIdsed().toString());
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
* consultaNombreSedeXId
*
* @param Id
* @return
*/
@WebMethod(operationName = "consultaNombreSedeXId")
public String consultaNombreSedeXId(@WebParam(name = "Id") String Id) {
String Resultado = "";
try {
Resultado = ejbSede.listarNombresXId(new BigDecimal(Id));
} catch (Exception e) {
}
return Resultado;
}
/**
* consultarBuzonXNombreUsuario o userusu del contacto y tambien por el
* dueño del buzón
*
* @param userUsu
* @param idUsuario
* @return
*/
@WebMethod(operationName = "consultarBuzonXNombreUsuario")
public Buzon consultarBuzonXNombreUsuario(@WebParam(name = "userUsu") String userUsu, @WebParam(name = "idUsuario") Usuario idUsuario) {
Buzon Resultado = null;
try {
Resultado = ejbBuzon.ConsultarBuzonInternoXNombreUsuario(userUsu, idUsuario);
if (Resultado == null) {
Resultado = ejbBuzon.ConsultarBuzonExternoXNombreUsuario(userUsu, idUsuario);
}
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param idusu
* @param sede
* @return
*/
@WebMethod(operationName = "consultarBuzonXUsuarioSede")
public Buzon consultarBuzonXUsuarioSede(@WebParam(name = "idusu") String idusu, @WebParam(name = "idsede") String sede) {
Buzon Resultado = null;
try {
Resultado = ejbBuzon.ConsultarBuzonXNombreSede(idusu, sede);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param dueno
* @param contacto
* @param idSede
* @return
*/
@WebMethod(operationName = "verificarExistenciaBuzon")
public int verificarExistenciaBuzon(@WebParam(name = "dueno") Usuario dueno, @WebParam(name = "contacto") Usuario contacto, @WebParam(name = "idSede") Sede idSede) {
int Resultado = 0;
try {
Buzon Result = ejbBuzon.verficarBuzon(dueno, contacto, idSede);
Resultado = 1;
} catch (Exception e) {
Buzon Nuevo = new Buzon();
Nuevo.setIdusu(dueno);
Nuevo.setTipobuz("0");
ejbBuzon.insertarBuzon(Nuevo);
return Resultado;
}
return Resultado;
}
/**
*
* @param idSede
* @return
*/
@WebMethod(operationName = "valijasXFechaVencidaXUsuarioOrigen")
public List<Valija> valijasXFechaVencidaXUsuarioOrigen(@WebParam(name = "idSede") String idSede) {
List<Valija> Resultado = null;
try {
Resultado = ejbValija.listarValijasXFechaVencimientoOrigen(new BigDecimal(idSede));
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param registroSede
* @return
*/
@WebMethod(operationName = "valijasXFechaVencidaXUsuarioDestino")
public List<Valija> valijasXFechaVencidaXUsuarioDestino(@WebParam(name = "registroSede") Sede registroSede) {
List<Valija> Resultado = null;
try {
Resultado = ejbValija.listarValijasXFechaVencimientoDestino(registroSede);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param idpaq
* @return
*/
@WebMethod(operationName = "insertarBandejaOrigen")
public int insertarBandejaOrigen(@WebParam(name = "idpaq") String idpaq) {
int Resultado;
try {
Paquete paquete = ejbPaquete.find(new BigDecimal(idpaq));
Bandeja nuevo = new Bandeja();
Infobandeja registroInfoB;
registroInfoB = new Infobandeja(new BigDecimal("1"));
nuevo.setIdiba(registroInfoB);
nuevo.setIdpaq(paquete);
nuevo.setLeidoban("0");
nuevo.setIdusu(paquete.getOrigenpaq().getIdusu());
ejbBandeja.insertarBandeja(nuevo);
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
*
* @param idpaq
* @return
*/
@WebMethod(operationName = "insertarBandejaDestino")
public int insertarBandejaDestino(@WebParam(name = "idpaq") String idpaq) {
int Resultado;
try {
Paquete paquete = ejbPaquete.find(new BigDecimal(idpaq));
Bandeja nuevo = new Bandeja();
Infobandeja registroInfoB;
registroInfoB = new Infobandeja(new BigDecimal("3"));
nuevo.setIdiba(registroInfoB);
nuevo.setIdpaq(paquete);
nuevo.setLeidoban("0");
nuevo.setIdusu(paquete.getDestinopaq().getIdusu());
ejbBandeja.insertarBandeja(nuevo);
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
*
* @param idpaq
* @param status
* @return
*/
@WebMethod(operationName = "editarEstatusPaquete")
public int editarEstatusPaquete(@WebParam(name = "idpaq") String idpaq, @WebParam(name = "status") String status) {
int Resultado;
try {
ejbPaquete.editarStatusPaquete(new BigDecimal(idpaq), status);
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
/**
*
* @param sede
* @return
*/
@WebMethod(operationName = "consultarPaquetesExternosXEnviar")
public List<Paquete> consultarPaquetesExternosXEnviar(@WebParam(name = "sede") Sede sede) {
List<Paquete> Resultado = null;
try {
Resultado = ejbPaquete.ConsultarPaquetesExternos(sede);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param registroPaquete
* @param registroUsuario
* @param registroSede
* @param localizacion
* @return
*/
@WebMethod(operationName = "seguimientoExterno")
public int seguimientoExterno(@WebParam(name = "registroPaquete") Paquete registroPaquete, @WebParam(name = "registroUsuario") Usuario registroUsuario, @WebParam(name = "registroSede") Sede registroSede, @WebParam(name = "localizacion") String localizacion) {
int Resultado = 0;
try {
List<Seguimiento> RegistrosSeguimiento = ejbSeguimiento.consultarSeguimientoXPaquete(registroPaquete);
for (int i = 0; i < RegistrosSeguimiento.size(); i++) {
RegistrosSeguimiento.get(i).setStatusseg("1");
ejbSeguimiento.edit(RegistrosSeguimiento.get(i));
}
Usuariosede registroUsuSede = ejbUsuariosede.ConsultarXUsuarioYSede(registroUsuario, registroSede);
Seguimiento nuevoSeg = new Seguimiento();
nuevoSeg.setIdpaq(registroPaquete);
nuevoSeg.setIduse(registroUsuSede);
nuevoSeg.setFechaseg(new Date());
nuevoSeg.setStatusseg("0");
nuevoSeg.setTiposeg("0");
nuevoSeg.setNivelseg("Externo");
ejbSeguimiento.insertarSeguimiento(nuevoSeg);
ejbBitacora.insertarBitacora(registroSede, registroUsuario, "ENVIO EXTERNO", "Envio de corrspondencia externa");
ejbPaquete.editarLocalizacionPaquete(registroPaquete.getIdpaq(), localizacion);
Resultado = 1;
} catch (Exception e) {
return 0;
}
return Resultado;
}
/**
*
* @param sede
* @return
*/
@WebMethod(operationName = "consultarPaquetesXConfirmarExternos")
public List<Paquete> consultarPaquetesXConfirmarExternos(@WebParam(name = "sede") Sede sede) {
List<Paquete> Resultado = null;
try {
Resultado = ejbSeguimiento.consultarPaquetesXConfirmarExternos(sede);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param codigo
* @return
*/
@WebMethod(operationName = "consultarPaqueteXIdOCodigoBarras")
public Paquete consultarPaqueteXIdOCodigoBarras(@WebParam(name = "codigo") String codigo) {
Paquete Resultado = null;
try {
Resultado = ejbPaquete.consultarPaqueteXIdOCodigoBarras(codigo);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param codigo
* @param sede
* @return
*/
@WebMethod(operationName = "consultarValijaXIdOCodigoBarras")
public Valija consultarValijaXIdOCodigoBarras(@WebParam(name = "codigo") String codigo, @WebParam(name = "sede") String sede) {
Valija Resultado = null;
try {
Resultado = ejbValija.consultarValijaXIdOCodigoBarras(codigo, sede);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param codigo
* @return
*/
@WebMethod(operationName = "consultarValijaXIdOCodigoBarra")
public Valija consultarValijaXIdOCodigoBarra(@WebParam(name = "codigo") String codigo) {
Valija Resultado = null;
try {
Resultado = ejbValija.consultarValijaXIdOCodigoBarra(codigo);
} catch (Exception e) {
return null;
}
return Resultado;
}
/**
*
* @param autenticacion
* @return
*/
@WebMethod(operationName = "auntenticarLDAP")
public String auntenticarLDAP(@WebParam(name = "user") String user, @WebParam(name = "password") String password) {
String Resultado;
try {
Resultado = ejbUsuario.auntenticarLDAPauntenticarLDAP(user, password);
} catch (Exception e) {
Resultado = "Fail";
}
return Resultado;
}
/**
*
* @param idpaq
* @return
*/
@WebMethod(operationName = "confirmarCorrespondenciaExterna")
public int confirmarCorrespondenciaExterna(@WebParam(name = "idpaq") String idpaq) {
int Resultado;
try {
BigDecimal idu = new BigDecimal(idpaq);
Paquete paq = ejbPaquete.find(idu);
ejbPaquete.ActualizacionLocalizacionyDelPaqueteExterno(paq);
ejbBandeja.actualizacionBandejaEnvioExterno(paq);
ejbSeguimiento.actualizacionEstadoEnvioExterno(paq);
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
@WebMethod(operationName = "miIdBuzon")
public int miIdBuzon(@WebParam(name = "idUsuario") Usuario idUsuario) {
int Resultado = 0;
try {
Resultado = ejbBuzon.myIdBuzon(idUsuario);
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
@WebMethod(operationName = "editarRespuestaPaquete")
public int editarRespuestaPaquete(@WebParam(name = "idpaq") String idpaq) {
int Resultado;
try {
ejbPaquete.editarRespaqDePaquete(new BigDecimal(idpaq));
Resultado = 1;
} catch (Exception e) {
Resultado = 0;
}
return Resultado;
}
@WebMethod(operationName = "listarSedesParaEnvio")
public List<Sede> listarSedesParaEnvio(@WebParam(name = "idSede") String idSede) {
List<Sede> Resultado = null;
try {
Resultado = ejbSede.listarSedesParaEnvio(new BigDecimal(idSede));
} catch (Exception e) {
return null;
}
return Resultado;
}
} | [
"luz.arboleda25@gmail.com"
] | luz.arboleda25@gmail.com |
0918a4cc63173a4e12e28feeead8e278a027cf7b | 2d733faec9579487d69a6295704817b8efd1b3ca | /source/ButtonSegmentController.java | 5b0441d10a62feb8d1d46d904ce166c0b9490e21 | [] | no_license | grbcp5/cs5405_hw09 | 5cdce7dcd1e2b5136eb6defb7b6bb68f026fe9de | 4d1a676206e7008182ac7a77e174870f3bcd7ef9 | refs/heads/master | 2020-04-08T03:58:04.871267 | 2018-11-25T04:14:14 | 2018-11-25T04:14:14 | 158,996,828 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,418 | java | /*
* CS5405
* Homework 05
* Grant Broadwater (grbcp5)
* October 16, 2018
*
* ButtonSegmentController.java
*/
package code;
import javafx.scene.layout.BorderPane;
import javafx.event.EventHandler;
import javafx.event.ActionEvent;
import javafx.scene.control.Button;
public class ButtonSegmentController extends BorderPane implements EventHandler<ActionEvent> {
private ButtonMenu buttonMenu;
protected ButtonSegmentControllerDataSource dataSource;
public ButtonSegmentController(ButtonSegmentControllerDataSource dataSource) {
super();
this.buttonMenu = new ButtonMenu();
this.dataSource = dataSource;
this.setTop(this.buttonMenu);
this.reloadData();
}
public void reloadData() {
if (this.dataSource == null) {
return;
}
this.buttonMenu.removeAllButtons();
for(int i = 0; i < this.dataSource.getNumberOfSegments(); i++) {
this.buttonMenu.addButton(
this,
this.dataSource.getContentForSegment(i)
);
}
if(this.dataSource.getNumberOfSegments() > 0) {
this.setCenter(
this.dataSource.getPaneForSegment(
this.dataSource.getContentForSegment(0).title
)
);
}
}
@Override
public void handle(ActionEvent actionEvent) {
String senderTitle = ((Button)actionEvent.getSource()).getText();
this.setCenter(this.dataSource.getPaneForSegment(senderTitle));
}
}
| [
"grbcp5@mst.edu"
] | grbcp5@mst.edu |
bcb2e941fb3cfb7eec8acad214a287fc7565f314 | 0a000c0592fc0fb4090d45a803aebdd0fd14b6c8 | /app/src/test/java/com/hallo/helloworld/ExampleUnitTest.java | 76d7ee282b55fd568aa9a3da16098cb59f71a782 | [] | no_license | ebensantosa/ProgAndroid | f01f07188a8d392d488620ea93c5f8d595805dc3 | 8a67cb9d9733d55fe9c7fc50b0d849d4749d0aa3 | refs/heads/master | 2023-01-20T17:56:52.245961 | 2020-11-26T16:31:34 | 2020-11-26T16:31:34 | 299,979,592 | 3 | 0 | null | 2020-11-26T16:31:35 | 2020-09-30T16:19:05 | Java | UTF-8 | Java | false | false | 381 | java | package com.hallo.helloworld;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"ebensantosa9@gmail.com"
] | ebensantosa9@gmail.com |
aecc3c640ec9a05af2922228e684e2685633823d | 7c146c448e883c77de0761145bd0c5808cf3b7bb | /test/edu/dufe/oes/api/StudentAPITest.java | 680cfc9cf9d19c9b2581d6ad33550de0da187e54 | [] | no_license | yuriak/OES | c94bf12f10d94130c203132fd6348d20e391598a | 71debc772aea314f4d03cd0a39d9f9ddab91b26e | refs/heads/master | 2021-01-10T01:10:59.800112 | 2018-03-12T03:54:59 | 2018-03-12T03:54:59 | 54,037,291 | 3 | 1 | null | 2016-03-17T13:37:32 | 2016-03-16T14:09:32 | JavaScript | UTF-8 | Java | false | false | 5,838 | java | package edu.dufe.oes.api;
import static org.junit.Assert.*;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.Test;
public class StudentAPITest {
StudentAPI studentAPI=new StudentAPI();
@Test
public void testGetStudentCourseList() {
// System.out.println(studentAPI.getStudentCourseList(10+"", 201601));
// System.out.println(studentAPI.deleteStudentCourse(1, "2"));
// for (int i = 1; i <=10; i++) {
// System.out.println(studentAPI.getStudentCourseList("2", 201601));
// }
}
@Test
public void testGetElectiveCourseInfo() {
// System.out.println(studentAPI.getElectiveCourseInfo(1, 10+""));
// for (int i = 1; i <=12; i++) {
// for (int j = 1; j <=8; j++) {
// System.out.println(studentAPI.getElectiveCourseInfo(j, i+""));
// }
// }
}
@Test
public void testDeleteStudentCourse() {
// System.out.println(studentAPI.deleteStudentCourse(8, 10+""));
// System.out.println(studentAPI.deleteStudentCourse(8, 12+""));
}
@Test
public void testGetAllAvailableCourseList() {
// studentAPI.getAllAvailableCourseList("301a299672b7cf1f750a21f4292fd384");
// for (int i = 1; i <= 14; i++) {
// System.out.println(studentAPI.getAllAvailableCourseList(i+""));
// }
}
@Test
public void testGetCourseInfo() {
// studentAPI.getCourseInfo(1, 10+"");
// System.out.println(studentAPI.getCourseInfo(1, "1"));
}
@Test
public void testQueryCourse() {
// System.out.println(studentAPI.queryCourse("1", "1"));
}
@Test
public void testGetAllCollege() {
// System.out.println(studentAPI.getAllCollege("1"));
}
@Test
public void testElectCourse() {
// for (int i = 1; i <=14; i++) {
// for (int j = 1; j <=8; j++) {
// System.out.println(studentAPI.electCourse(j, i+""));
// }
//
// }
}
@Test
public void testGetLessonListByCourse() {
// for (int i = 1; i <=14; i++) {
// for (int j = 1; j <=8; j++) {
// System.out.println(studentAPI.getLessonListByCourse(i+"", j));
// }
//
// }
}
@Test
public void testGetNoticeByLessonID() {
// for (int i = 1; i <=36; i++) {
// for (int j = 1; j <=12; j++) {
// System.out.println(studentAPI.getNoticeByLessonID(i, j+""));
// }
// }
}
@Test
public void testGetLeaveInfo() {
// for (int i = 1; i < 36; i++) {
// for (int j =1; j <=12; j++) {
// System.out.println(studentAPI.getLeaveInfo(j+"", i));
// }
// }
}
@Test
public void testLeave() {
// studentAPI.leave("死了", 37, "c23fe0df7ea004aa6c82bde18d11bf87");
// for (int i = 34; i <=36; i++) {
// for (int j = 1; j <=12; j++) {
// System.out.println(studentAPI.leave(i+"c", i, j+""));
// }
// }
}
@Test
public void testGetEvaluationListByLesson() {
// for (int i = 1; i <=12; i++) {
// for (int j =1; j <=36; j++) {
// System.out.println(studentAPI.getEvaluationListByLesson(j, i+""));
// }
// }
}
@Test
public void testGetGroupInfo() {
// System.out.println(studentAPI.getGroupInfo(2, "e30582b0b259a74bbc298101265cac05"));
// for (int i = 1; i <=99; i++) {
// for (int j = 1; j <=12; j++) {
// System.out.println(studentAPI.getGroupInfo(i, j+""));
// }
//
// }
}
@Test
public void testAddGroup() {
// for (int i = 1; i <=97; i+=3) {
// for (int j = 1; j <=4; j++) {
// System.out.println(studentAPI.addGroup(j+"", i));
// }
// for (int j = 4; j <=8; j++) {
// System.out.println(studentAPI.addGroup(j+"", i+1));
// }
// for (int j = 8; j <=12; j++) {
// System.out.println(studentAPI.addGroup(j+"", i+2));
// }
// }
}
@Test
public void testSetMeAsReceiver() {
// for (int i = 1; i <=12; i++) {
// for (int j =1 ; j <=99; j++) {
// System.out.println(studentAPI.setMeAsReceiver(i+"",j));
// }
// }
// System.out.println(studentAPI.setMeAsReceiver("1", 1));
}
@Test
public void testGetEvaluationStatus() {
// for (int i = 1; i <=12; i++) {
// for (int j = 1; j <=99; j++) {
// System.out.println(studentAPI.getEvaluationStatus(j, i+""));
// }
// }
}
@Test
public void testGetEvaluationFieldList() {
// for (int i = 1; i <=12; i++) {
// for (int j = 1; j <=99; j++) {
// System.out.println(studentAPI.getEvaluationFieldList(j,i+"" ));
// }
// }
}
@Test
public void testStudentGetReceiverList() {
// for (int i = 2; i <=2; i++) {
// for (int j = 1; j <=12; j++) {
// System.out.println(studentAPI.studentGetReceiverList(i, j+""));
// }
// }
}
@Test
public void testStudentGetResult() {
// System.out.println(studentAPI.studentGetResult(1+"", 1));
}
@Test
public void testStudentSetResult() throws JSONException {
//
for (int i = 1; i <=12; i++) {
// for (int j = 110; j <=120; j++) {
// JSONObject jsonObject=new JSONObject();
// JSONArray resultArray=new JSONArray();
// JSONObject r1=new JSONObject();
// r1.put("resultTypeID", 1);
// r1.put("evaluationFieldID", 9);
// r1.put("resultContent", 100);
// JSONObject r2=new JSONObject();
// r2.put("resultTypeID", 2);
// r2.put("evaluationFieldID", 10);
// r2.put("resultContent", "");
// JSONObject r21=new JSONObject();
// r21.put("resultTypeID", 3);
// r21.put("evaluationFieldID", 11);
// r21.put("resultContent", "#1#3");
// JSONObject r22=new JSONObject();
// r22.put("resultTypeID", 4);
// r22.put("evaluationFieldID", 12);
// r22.put("resultContent", "heh的e");
// resultArray.put(r1);
// resultArray.put(r2);
// resultArray.put(r21);
// resultArray.put(r22);
// jsonObject.put("resultContent", resultArray);
// System.out.println(studentAPI.studentSetResult(i+"", jsonObject.toString(), i, j));
// }
}
}
}
| [
"yuriak1911@gmail.com"
] | yuriak1911@gmail.com |
4520dd9a7530f882d223b909421a668df166a509 | 13658d53bba9a5a9f98de1f4937421f15bd62917 | /src/astaire/Controller.java | 6898f504c3a34739d8a70fd0da5b2f05928d9f0d | [] | no_license | JordanL1/cs2310-coursework | f8459b5b8c8c93a1f2868cab958f2bc6798eab9c | 0a94734a8decf53ace0f8176c7d5b02eb141d7b1 | refs/heads/master | 2020-04-10T19:28:37.883148 | 2018-12-13T23:55:38 | 2018-12-13T23:55:38 | 161,236,516 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,412 | java | /**
*
*/
package astaire;
/**
* A controller for the dance show programme generator system.
* This controller includes the 4 features that the intended
* prototype system is expected to have.
*
* @author Sylvia Wong
* @version 08/11/2018
*/
public interface Controller {
/**
* Lists the names of all performers in a specified dance.
* @param dance a specified dance in the dance show
* @return the name of all performers that are in the specified dance.
*/
String listAllDancersIn(String dance);
/**
* Lists all dance numbers and the name of the respective performers in alphabetical order.
* @return a String representation of dance numbers
* and the name of the respective performers in alphabetical order
*/
String listAllDancesAndPerformers();
/**
* Checks feasibility of a given running order.
* @param filename the name of a tab-separated CSV file containing a proposed running order
* @param gaps the required number of gaps between dances for each dancer
* @return a String representation of potential issues
*/
String checkFeasibilityOfRunningOrder(String filename, int gaps);
/**
* Generates a running order of the dances for the dance show.
* @param gaps the required number of gaps between dances for each dancer
* @param
* @return a String representation of the generate running order
*/
String generateRunningOrder(int gaps);
}
| [
"leesja@aston.ac.uk"
] | leesja@aston.ac.uk |
62e260028ec237a0c1a09676cd216dedd38bd237 | 357021d55346bf2e52964ad11acb91a13473e5ea | /app/src/main/java/utn/proy2k18/vantrack/utils/DateTimePicker.java | 6848b51d5663a167f13d5d4d0732d5827410d8f6 | [] | no_license | JuanPabloNicosanti/VanTrackAndroid | d50f278a1729063180b4d558e9e1a496c6d8fcf1 | f2fb270b2d9c7cf0c44c178d9768f89d5943c72b | refs/heads/master | 2020-03-26T15:33:56.461132 | 2019-10-12T19:00:58 | 2019-10-12T19:00:58 | 145,050,769 | 0 | 0 | null | 2019-11-27T01:55:44 | 2018-08-16T23:59:17 | Java | UTF-8 | Java | false | false | 2,057 | java | package utn.proy2k18.vantrack.utils;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import androidx.fragment.app.FragmentActivity;
import android.widget.DatePicker;
import android.widget.TextView;
import android.widget.TimePicker;
import java.util.Calendar;
import java.util.Locale;
public class DateTimePicker {
private Calendar calendar;
private FragmentActivity activity;
public DateTimePicker(FragmentActivity activity) {
this.activity = activity;
this.calendar = Calendar.getInstance();
}
public void pickDate(final TextView textView) {
int day = this.calendar.get(Calendar.DAY_OF_MONTH);
final int month = this.calendar.get(Calendar.MONTH);
final int year = this.calendar.get(Calendar.YEAR);
DatePickerDialog datePickerDialog = new DatePickerDialog(this.activity, new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int yearSelected, int monthOfYearSelected, int dayOfMonthSelected) {
textView.setText(String.format(Locale.getDefault(),"%02d-%02d-%02d",
dayOfMonthSelected, monthOfYearSelected + 1, yearSelected));
}
}, day, month, year);
datePickerDialog.updateDate(year, month, day);
datePickerDialog.show();
}
public void pickTime(final TextView textView) {
int hour = this.calendar.get(Calendar.HOUR_OF_DAY);
int minute = this.calendar.get(Calendar.MINUTE);
TimePickerDialog mTimePicker;
mTimePicker = new TimePickerDialog(this.activity, new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
textView.setText(String.format(Locale.getDefault(), "%02d:%02d", selectedHour,
selectedMinute));
}
}, hour, minute, true);
mTimePicker.setTitle("Select Time");
mTimePicker.show();
}
}
| [
"jpnicosanti@gmail.com"
] | jpnicosanti@gmail.com |
f25ab00157fb5c2f20c57a87ec732790d2243969 | 8aa8e01308fbc56db78b0e211b28ebac2679a643 | /Productive/src/shared/UserSuite.java | 16536b7e6c4c167eb5107548d0a19f61d7cbe23e | [] | no_license | ahouts/ProDuctive-client | 253e668a75d05c33d7929c7dc9476dbf3421a569 | a07a48134120c872581757c1681672fdf4f5e4e9 | refs/heads/master | 2021-08-22T08:56:50.282021 | 2017-11-29T20:39:41 | 2017-11-29T20:39:41 | 105,924,135 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,733 | java | package shared;
import java.util.ArrayList;
import javax.swing.DefaultListModel;
import backend.HTTPRequests;
public class UserSuite {
private ArrayList<Reminder> remindersArray = new ArrayList();
private ArrayList<Note> notes = new ArrayList<>();
public ArrayList<Project> projects = new ArrayList<>();
public DefaultListModel<String> ReminderList = new <String>DefaultListModel();
public DefaultListModel<String> ProjectList = new <String>DefaultListModel();
public DefaultListModel<String> NoteList = new <String>DefaultListModel();
public Note ActiveNote = new Note();
public UserInfo myUser;
public UserSuite(UserInfo userToUse) {
myUser = userToUse;
refreshAll();
}
public DefaultListModel<String> refreshProjectList() {
projects.clear();
ProjectList.clear();
projects.add( new Project());
ProjectList.addElement(allnotesStr);
ArrayList<Project> newProjects = new HTTPRequests().getAllProjects(myUser);
if(newProjects!=null && !newProjects.isEmpty())
for(Project proj:newProjects) {
projects.add(proj);
ProjectList.addElement(proj.title);
}
return ProjectList;
}
public DefaultListModel<String> refreshNoteList(Long IDofProject) {
notes.clear();
NoteList.clear();
ArrayList<Note> newNotes = new ArrayList<>();
if (IDofProject==Project.NO_PROJECT_ID)
newNotes = new HTTPRequests().getAllNotes(this.myUser);
else
newNotes = new HTTPRequests().getNotesFromProject(IDofProject, this.myUser);
System.out.println(newNotes.size());
for(Note n: newNotes) {
notes.add(n);
NoteList.addElement(n.getTitle());
}
return NoteList;
}
public DefaultListModel<String> refreshReminders() {
ReminderList.clear();
remindersArray.clear();
ArrayList<Reminder> newReminders = new HTTPRequests().getAllReminders(myUser);
for(Reminder r: newReminders) {
ReminderList.addElement("<html><b>" + r.getBody() + "</b><br> Created on " + r.getCreatedDate() + "</html>");
remindersArray.add(r);
}
return ReminderList;
}
public void refreshAll() {
refreshReminders();
refreshProjectList();
}
public void insertNewReminder(String reminderText) {
new HTTPRequests().insertNewReminder(myUser, reminderText);
}
public void deleteReminder(int indexToDelete) {
String idToDelete = remindersArray.get(indexToDelete).getReminderId();
new HTTPRequests().deleteReminder(myUser, idToDelete);
}
public String getUserName() {
return myUser.getUserEmail();
}
public Note getNoteAtIndex(int i) {
return notes.get(i);
}
public Note getNoteFromDB(String noteID) {
return new HTTPRequests().getANote(myUser, noteID);
}
public long getProjectIDFromIndex(int i) {
return this.projects.get(i).getID();
}
public static final String allnotesStr = "All Notes";
public void updateNote(Note updateThisNote) {
new HTTPRequests().updateNote(updateThisNote, myUser);
}
public void createNewNote(Note newNote) {
new HTTPRequests().addNote(newNote,myUser);
}
public void inserNewProject(String s) {
new HTTPRequests().addProject(s,myUser);
}
public void deleteNote(Note noteToDelete) {
new HTTPRequests().deleteNote(noteToDelete, myUser);
}
public void deleteProject(Long projectIdToDelete) {
new HTTPRequests().deleteProject(projectIdToDelete, myUser);
}
public void shareProject(Long projectIDToShare, long userIdToShareWith) throws Exception{
new HTTPRequests().shareProject(projectIDToShare, userIdToShareWith, myUser);
}
public long getUserIDFromStr(String userNameToShareWith) throws Exception {
return new HTTPRequests().getUserID(userNameToShareWith);
}
public void shareNote(long noteID, long userIDToShareWith) throws Exception{
new HTTPRequests().shareNote(noteID, userIDToShareWith, myUser);
}
}
| [
"joejdion@gmail.com"
] | joejdion@gmail.com |
c111e3181e0531c77677ff1fadb5f7e09d08c0e2 | 3b1c59b5604053602a56a1d09c0a442eaeed8c05 | /src/com/example/HttpTest.java | 28c3f86e59fd32b4cddb22355c7adc044cd9723b | [] | no_license | huangbeidan/Spider | 72094e8dc65fbc5d322d81ca26f044b63ac545a7 | b28cd2523af1a6d728ba80741e5b54b04ace6fe0 | refs/heads/master | 2020-04-10T18:57:53.159881 | 2019-03-06T04:09:07 | 2019-03-06T04:09:07 | 161,218,664 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,597 | java | package com.example;
import java.io.IOException;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import org.junit.Test;
import com.example.OutJson;
public class HttpTest {
// Send GET requests to get json back
public static String getHttpResult(String url) {
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(url);
String json = null;
try {
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
if (entity != null) {
json = EntityUtils.toString(entity, "UTF-8").trim();
}
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
httpget.abort();
}
return json;
}
@Test
public void test() {
String rs = getHttpResult(
"https://www.googleapis.com/customsearch/v1?key=AIzaSyA2i3EhSg33fmu8xniH46F-FHZRn3NcDOU&cx=002464989021538692093:kwh17neen_y&q=site:https://www.allsides.com/unbiased-balanced-news&dateRestrict=d1");
System.out.println(rs);
OutJson.createJsonFile(rs,"/Users/beidan/Spider","getjson");
System.out.println("生成文件完成!");
}
}
| [
"huangbeidan@gmail.com"
] | huangbeidan@gmail.com |
9d77b9c913b53c200b2ba8987825523ffa311d75 | e4dd681bbeffbfe698427306617121dd2ea97c6b | /app/src/main/java/com/team/witkers/eventbus/MonitorEvent.java | 6fcd29f69161d3825963a6be951086a7978b32a2 | [] | no_license | hys421123/weikers03 | 048c65a41890b315f141c990345d141ea5f6e714 | 13fce58abc0a6033fbda84664a83c4a5cfb5ae83 | refs/heads/master | 2020-07-23T17:23:38.467459 | 2017-02-21T11:02:29 | 2017-02-21T11:02:29 | 73,803,979 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 555 | java | package com.team.witkers.eventbus;
import com.team.witkers.bean.TendComments;
import com.team.witkers.bean.TendItems;
import com.team.witkers.utils.MonitorData;
/**
* Created by hys on 2016/8/29.
*/
public class MonitorEvent {
public TendItems getTend() {
return tend;
}
public TendComments getComment() {
return comment;
}
private TendComments comment;
private TendItems tend;
public MonitorEvent(TendItems tend,TendComments comment){
this.tend=tend;
this.comment=comment;
}
}
| [
"hys421123@163.com"
] | hys421123@163.com |
22929d596792b7e74bfb24186f18609c7553db40 | 73a68fa7dd596074686874c2094705b6e8f6fd00 | /src/main/java/com/ixcorp/app/bibliotecasoap/endpoint/AutorEndPoint.java | 8783137ae52186ac49704aa15d1e1e7c54ad9d16 | [] | no_license | jedionmelbin/bilioteca-soap | be62ab351d33c3e14ba9d667eebee39ce52aa620 | c92c6d3ff66eedd2274b40b149140e163d090981 | refs/heads/master | 2023-01-07T11:52:58.544047 | 2020-11-09T13:44:11 | 2020-11-09T13:44:11 | 311,191,336 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,260 | java | package com.ixcorp.app.bibliotecasoap.endpoint;
import com.ixcorp.app.bibliotecasoap.domain.AutorEntity;
import com.ixcorp.app.bibliotecasoap.service.AutorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
import pe.com.ixcorp.biblioteca_soap.autor.AddAutorRequest;
import pe.com.ixcorp.biblioteca_soap.autor.AddAutorResponse;
import pe.com.ixcorp.biblioteca_soap.autor.Autor;
import pe.com.ixcorp.biblioteca_soap.autor.GetAllAutorResponse;
import java.util.ArrayList;
import java.util.List;
@Endpoint
public class AutorEndPoint {
@Autowired
private AutorService autorService;
@PayloadRoot(namespace = "http://ixcorp.com.pe/biblioteca-soap/listAutor", localPart = "getAllAutorRequest")
@ResponsePayload
public GetAllAutorResponse getAllAutorResponse() {
GetAllAutorResponse response = new GetAllAutorResponse();
List<Autor> autorType = new ArrayList<>();
List<AutorEntity> autorEntityList = autorService.listAllAutor();
for (AutorEntity autorEntity : autorEntityList) {
Autor autor = new Autor();
autor.setAutorId(autorEntity.getAutorId());
autor.setNombre(autorEntity.getNombres());
autor.setApellidos(autorEntity.getApellidos());
autorType.add(autor);
}
response.getAutorType().addAll(autorType);
return response;
}
@PayloadRoot(namespace = "http://ixcorp.com.pe/biblioteca-soap/addAutor", localPart = "addAutorRequest")
@ResponsePayload
public AddAutorResponse addAutor(@RequestPayload AddAutorRequest request) {
AddAutorResponse response = new AddAutorResponse();
AutorEntity newAutorEntity = new AutorEntity();
newAutorEntity.setAutorId(request.getAutorId());
newAutorEntity.setNombres(request.getNombre());
newAutorEntity.setApellidos(request.getApellidos());
autorService.crearAutor(newAutorEntity);
return response;
}
}
| [
"jedionmelbin@gmail.com"
] | jedionmelbin@gmail.com |
481cf77e6ad4feb162ee6832da26b68c2d76e383 | 2d010adfbdeb0f8bc313cca562d38a8fa8d63d54 | /src/tests/pathfinding/PathfindingTest.java | cb51b6c71460803c7b9421b40367c85322e0c1fe | [] | no_license | magic2k/TowerDefence | c1ae3fd825ef1a685e4fbd1226b3639ed200fe7c | a35afc2196103dc833829a7a43f6d53146de9e19 | refs/heads/master | 2021-01-20T11:31:54.545439 | 2014-02-22T21:37:38 | 2014-02-22T21:37:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,123 | java | package tests.pathfinding;
import javax.swing.*;
/**
* Date: 04.01.12
* Time: 14:33
*/
public class PathfindingTest implements Runnable {
private JFrame frame;
private DrawPanel drawPanel;
private volatile boolean isRunning;
World world;
public static final long PERIOD =40;
Field field;
public PathfindingTest() {
super();
String userdir = System.getProperty("user.dir");
System.out.println(userdir);
world = World.getInstance();
field = new Field();
field.createField();
//interface
frame = new JFrame();
drawPanel = new DrawPanel();
frame.getContentPane().add(drawPanel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize((Tile.getTileWidth() * Field.FIELD_WIDTH)+14, (Tile.getTileHeight() * Field.FIELD_HEIGHT)+36 );
frame.setVisible(true);
// GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(frame);
}
public static void main(String args[]) {
PathfindingTest m = new PathfindingTest();
m.run();
}
public void run() {
isRunning = true;
long beforeTime, afterTime, timeDiff, sleepTime;
while(isRunning) {
beforeTime = System.nanoTime();
//
gameUpdate(); // game state is updated
drawPanel.gameRender(); // render to a buffer
drawPanel.paintScreen(); // draw buffer to screen
afterTime = System.nanoTime();
timeDiff = afterTime - beforeTime;
sleepTime = PERIOD - (timeDiff/1000000000L);
// System.out.println(sleepTime);
if(sleepTime > 0) {
try {
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
e.printStackTrace();
}
} else {
Thread.yield();
}
}
}
public void stopGame() {
isRunning = false;
}
public void gameUpdate() {
world.update();
}
} | [
"magic2ktech@gmail.com"
] | magic2ktech@gmail.com |
720b9e65df0a11761f5e912a2c060f22f50a0382 | 0eb7dcb0459de31871e2357cf5c713a53ea5f015 | /graph-browser/src/org/dancingbear/graphbrowser/importer/dotparser/NodeId.java | 411fda4c85b963cb86ecd7f73fcd44ce5174663a | [] | no_license | cwi-swat/meta-environment | a87055da2a6825c97c7744cdd84c08d39d9f3f66 | eea9a90fdb52415f43430a89adc7acddba2be0a4 | refs/heads/master | 2021-01-19T08:42:05.812049 | 2012-11-15T14:16:54 | 2012-11-15T14:16:54 | 5,178,544 | 8 | 2 | null | null | null | null | UTF-8 | Java | false | false | 553 | java | /* Generated By:JJTree: Do not edit this line. NodeId.java Version 4.1 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package org.dancingbear.graphbrowser.importer.dotparser;
public
class NodeId extends SimpleNode {
public NodeId(int id) {
super(id);
}
public NodeId(DOTParser p, int id) {
super(p, id);
}
}
/* JavaCC - OriginalChecksum=68308e31c9f383800bcefaa73580a9de (do not edit this line) */
| [
"arnold.lankamp@gmail.com"
] | arnold.lankamp@gmail.com |
8e814b3696fa4dc3fd8d1f1b24b462a433c0d39c | d66f09d033798112480fca248c242956eb130d03 | /GoSoccer-ejb/src/java/com/gosoccer/excepcion/DatoErroneoException.java | caa35f9d565db5bf83d5ebbfbe07d41753f42487 | [] | no_license | lumaschi/arqsw | 3406f85dcc58483f9b551289be32accb024e873f | dff6992bf718ec1335000f712edcea252f9e9670 | refs/heads/master | 2021-01-17T13:01:48.522718 | 2016-06-23T21:37:47 | 2016-06-23T21:37:47 | 57,081,805 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 422 | java | package com.gosoccer.excepcion;
public class DatoErroneoException extends Exception{
public DatoErroneoException() {
super();
}
public DatoErroneoException(String message){
super(message);
}
public DatoErroneoException(String message, Throwable cause){
super(message, cause);
}
public DatoErroneoException(Throwable cause){
super(cause);
}
}
| [
"vgalarza@saur00276.corp.netledger.com"
] | vgalarza@saur00276.corp.netledger.com |
814d05673c716d15d0aa131f0511d46998793bd8 | f766baf255197dd4c1561ae6858a67ad23dcda68 | /app/src/main/java/com/tencent/mm/protocal/c/nh.java | 299de8f257b718e91a9f35c854ff5088992b46c5 | [] | no_license | jianghan200/wxsrc6.6.7 | d83f3fbbb77235c7f2c8bc945fa3f09d9bac3849 | eb6c56587cfca596f8c7095b0854cbbc78254178 | refs/heads/master | 2020-03-19T23:40:49.532494 | 2018-06-12T06:00:50 | 2018-06-12T06:00:50 | 137,015,278 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,851 | java | package com.tencent.mm.protocal.c;
public final class nh
extends com.tencent.mm.bk.a
{
public String rro;
public String rrp;
public String rrq;
public int rrr;
public int rrs;
public String rrt;
public int rru;
protected final int a(int paramInt, Object... paramVarArgs)
{
if (paramInt == 0)
{
paramVarArgs = (f.a.a.c.a)paramVarArgs[0];
if (this.rro != null) {
paramVarArgs.g(1, this.rro);
}
if (this.rrp != null) {
paramVarArgs.g(2, this.rrp);
}
if (this.rrq != null) {
paramVarArgs.g(3, this.rrq);
}
paramVarArgs.fT(4, this.rrr);
paramVarArgs.fT(5, this.rrs);
if (this.rrt != null) {
paramVarArgs.g(6, this.rrt);
}
paramVarArgs.fT(7, this.rru);
return 0;
}
if (paramInt == 1) {
if (this.rro == null) {
break label461;
}
}
label461:
for (int i = f.a.a.b.b.a.h(1, this.rro) + 0;; i = 0)
{
paramInt = i;
if (this.rrp != null) {
paramInt = i + f.a.a.b.b.a.h(2, this.rrp);
}
i = paramInt;
if (this.rrq != null) {
i = paramInt + f.a.a.b.b.a.h(3, this.rrq);
}
i = i + f.a.a.a.fQ(4, this.rrr) + f.a.a.a.fQ(5, this.rrs);
paramInt = i;
if (this.rrt != null) {
paramInt = i + f.a.a.b.b.a.h(6, this.rrt);
}
return paramInt + f.a.a.a.fQ(7, this.rru);
if (paramInt == 2)
{
paramVarArgs = new f.a.a.a.a((byte[])paramVarArgs[0], unknownTagHandler);
for (paramInt = com.tencent.mm.bk.a.a(paramVarArgs); paramInt > 0; paramInt = com.tencent.mm.bk.a.a(paramVarArgs)) {
if (!super.a(paramVarArgs, this, paramInt)) {
paramVarArgs.cJS();
}
}
break;
}
if (paramInt == 3)
{
f.a.a.a.a locala = (f.a.a.a.a)paramVarArgs[0];
nh localnh = (nh)paramVarArgs[1];
switch (((Integer)paramVarArgs[2]).intValue())
{
default:
return -1;
case 1:
localnh.rro = locala.vHC.readString();
return 0;
case 2:
localnh.rrp = locala.vHC.readString();
return 0;
case 3:
localnh.rrq = locala.vHC.readString();
return 0;
case 4:
localnh.rrr = locala.vHC.rY();
return 0;
case 5:
localnh.rrs = locala.vHC.rY();
return 0;
case 6:
localnh.rrt = locala.vHC.readString();
return 0;
}
localnh.rru = locala.vHC.rY();
return 0;
}
return -1;
}
}
}
/* Location: /Users/Han/Desktop/wxall/微信反编译/反编译 6.6.7/dex2jar-2.0/classes4-dex2jar.jar!/com/tencent/mm/protocal/c/nh.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"526687570@qq.com"
] | 526687570@qq.com |
a4b033cf3f6d94dcc213f54243a0dfd400b94bdb | 92b43754c53244b9911da4af26022fd55b3bb329 | /src/Test.java | bf077c7fa0dc92fe96ec40cd4c17eee10a15c7da | [] | no_license | teej107/TeejMediaPlayer | f275690f0b4186fb3551d248844ab68b37bca87d | e114416fb744e4c118a969b92d88c3c06cd54ba3 | refs/heads/master | 2021-01-19T17:33:21.605009 | 2017-07-13T19:28:32 | 2017-07-13T19:28:32 | 88,330,333 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 159 | java | import java.io.IOException;
/**
* Created by teej107 on 4/15/17.
*/
public class Test
{
public static void main(String[] args) throws IOException
{
}
}
| [
"teej107@gmail.com"
] | teej107@gmail.com |
afb79a47fc65cf5190a7363ccfb5ca5c81b877b2 | e063958c575a27532c256e15bd9dd80d8b240fc1 | /WeatherApp/app/src/main/java/com/example/topway/weatherapp/RVweatherAdapter.java | 0d206edbeef5f1c4e0de75c108ddd16cc930f297 | [] | no_license | khan4/WeatherApplication | 54a02195a1035cb06e8956a70b7e564110ee4832 | bbd5bbf5f261592d89210d3712c08874216903d9 | refs/heads/master | 2021-03-19T15:58:19.919447 | 2019-05-19T18:27:28 | 2019-05-19T18:27:28 | 103,365,170 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,534 | java | package com.example.topway.weatherapp;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.List;
import static android.content.ContentValues.TAG;
/**
* Created by topway on 8/26/2017.
*/
public class RVweatherAdapter extends RecyclerView.Adapter<RVweatherViewHolder> {
private LayoutInflater inflater;
private List<Weather> weatherArrayList;
private Context context;
int flag=0;
public RVweatherAdapter(MainActivity context) {
this.context = context;
inflater=context.getLayoutInflater();
this.weatherArrayList=new ArrayList<>();
}
@Override
public RVweatherViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = inflater.inflate(R.layout.place_activity, parent, false);
return new RVweatherViewHolder(view);
}
@Override
public void onBindViewHolder(RVweatherViewHolder holder, int position) {
Log.d(TAG, "onBindViewHolder: pehle on bind view Holder");
holder.populate(context, weatherArrayList.get(position));
}
@Override
public int getItemCount() {
if (weatherArrayList!=null) {
return weatherArrayList.size();
}return 0;
}
public void LoadNewData(List<Weather> weathers){
weatherArrayList=weathers;
notifyDataSetChanged();
}
} | [
"30455854+khan4@users.noreply.github.com"
] | 30455854+khan4@users.noreply.github.com |
dc00dd007e543743e1a507588a872eda5e625e76 | b2dc32d407ca13c32fb1decd0e42fde1ba5d52d6 | /src/ENTITY/TaiKhoan.java | b6d763c91d7f7cc584541ed04520d9ec316f0409 | [] | no_license | thangrm/QuanLyThiSinh | f0e89f1dc5c11652849628ef9a433c23b8c14dff | ac77c1cf5e8785d4921be3b665b5cfc61db164b4 | refs/heads/master | 2023-05-13T03:20:33.222084 | 2021-06-05T09:46:42 | 2021-06-05T09:46:42 | 364,296,385 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,181 | 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 ENTITY;
import java.io.Serializable;
/**
*
* @author Hoàng Thắng <hoangthangrm>
*/
public class TaiKhoan implements Serializable {
public static int ADMIN = 1;
public static int MANAGER = 2;
protected String username;
protected String password;
protected int role;
public TaiKhoan() {
this.username = null;
this.password = null;
}
public TaiKhoan(String username, String password, int role) {
this.username = username;
this.password = password;
this.role = role;
}
public String getUsername() {
return username;
}
public String getPassword() {
return password;
}
public int getRole() {
return role;
}
public void setUsername(String username) {
this.username = username;
}
public void setPassword(String password) {
this.password = password;
}
public void setRole(int role) {
this.role = role;
}
}
| [
"hoangthangrm@gmail.com"
] | hoangthangrm@gmail.com |
7403907bfb5b243184c3f1b1aaaf29444404574e | 7b2a833645b190c9332f1cccf1fb5fe7314090e9 | /BUOI3/BAI2/test.java | 2942772d6fa986173a985d17dec4d597e39ff821 | [] | no_license | minhdua/MMT | 7b3c3b24be3f9d401f54c6bc8a0e5376cb6381b2 | 238fe3d022ec756a25712f86d1f34b73ef2d8cdb | refs/heads/master | 2020-08-11T11:03:43.848644 | 2019-10-21T03:26:22 | 2019-10-21T03:26:22 | 214,554,979 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 335 | java | import java.io.*;
public class test{
public static void main(String []args){
try{
String filename = "test.txt";
FileOutputStream fo = new FileOutputStream(filename);
String str = "Hello World! abc";
byte []b = str.getBytes();
fo.write(b);
fo.close();
}
catch(IOException e){
System.err.print(e);
}
}
}
| [
"SaitamaCoder@gmai.com"
] | SaitamaCoder@gmai.com |
004ac48ef4e32df2205ad124c9d6f05672566f6d | d08ffa2a98856abdd2ce406019fe7968d3ff6778 | /app/src/main/java/com/shenhua/pc_controller/utils/SocketCallback.java | ec345cc889e88504188079b2aa394807f280ebe8 | [
"Apache-2.0"
] | permissive | shenhuanet/PCController-android | fdf946f61efd1f2987668233a8bc5dc0a74af1f0 | 469f1c110f94be09e520e1412f1aaf2e036ab0b2 | refs/heads/master | 2021-07-25T16:50:16.822035 | 2017-11-07T06:07:49 | 2017-11-07T06:07:49 | 77,839,453 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 800 | java | package com.shenhua.pc_controller.utils;
import android.os.Handler;
import android.os.Message;
/**
* Created by Shenhua on 1/1/2017.
* e-mail shenhuanet@126.com
*/
public abstract class SocketCallback<T> extends Handler {
public static final int SUCCESS = 1;
public static final int FAILED = 0;
public abstract void onSuccess(T msg);
public abstract void onFailed(int errorCode, String msg);
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case SUCCESS:
// msg.obj是回调返对象
onSuccess((T) msg.obj);
break;
case FAILED:
// msg.arg1是errorCode
onFailed(msg.arg1, msg.obj.toString());
break;
}
}
}
| [
"shenhuanet@126.com"
] | shenhuanet@126.com |
fd042462107da3c518b172f4d9277436de6f7ba2 | e070d1075621d4c46a5521d0a99dd549a94eebe3 | /app/src/main/java/thinktechsol/msquare/model/OrderDetails/BuyerDetails.java | 75f885ee556d582db46cdb9372b05e351616189f | [] | no_license | EhtishamShami/mSquare | 9b2a0d4c00ac18ab123869fcc0d7355159160220 | c06263b3cd104310f0b7b0a27f820d909d63ba31 | refs/heads/master | 2021-01-11T20:55:58.746284 | 2017-01-17T10:21:35 | 2017-01-17T10:21:35 | 79,215,639 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,458 | java | package thinktechsol.msquare.model.OrderDetails;
/**
* Created by Arshad Iqbal on 8/15/2016.
*/
public class BuyerDetails {
public String location;
public String status;
public String state;
public String lName;
public String udid;
public String password;
public String googlePlus;
public String fName;
public String phoneNo;
public String houseNo;
public String id;
public String twitter;
public String area;
public String email;
public String facebook;
public String streetNo;
public String datetime;
public String thumb;
public BuyerDetails(String location, String status, String state, String lName, String udid, String password, String googlePlus, String fName, String phoneNo, String houseNo, String id, String twitter, String area, String email, String facebook, String streetNo, String datetime, String thumb) {
this.location = location;
this.status = status;
this.state = state;
this.lName = lName;
this.udid = udid;
this.password = password;
this.googlePlus = googlePlus;
this.fName = fName;
this.phoneNo = phoneNo;
this.houseNo = houseNo;
this.id = id;
this.twitter = twitter;
this.area = area;
this.email = email;
this.facebook = facebook;
this.streetNo = streetNo;
this.datetime = datetime;
this.thumb = thumb;
}
}
| [
"k.arshad063@gmail.com"
] | k.arshad063@gmail.com |
4d13ff3e2b4b80e48c7a3b54e049ec5cd22ac30f | 3f66f2cb48d3eedfb78fb526df470568d8881f21 | /src/main/java/com/dovit/backend/model/LicenseCategoryHelperDTO.java | 25d031d8a846b75c92a948549cda2631beae4ec5 | [] | no_license | labg94/dovit-backend | 74f9277d0a79ad3c41cf4e47a19ea19f0acd81f3 | 3e75565e1a009fd11d25c1e155238ee3d6b55683 | refs/heads/master | 2022-11-24T12:48:46.173236 | 2020-07-29T22:49:46 | 2020-07-29T22:49:46 | 205,573,970 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 366 | java | package com.dovit.backend.model;
import com.dovit.backend.domain.CompanyLicense;
import com.dovit.backend.domain.DevOpsCategory;
import lombok.Builder;
import lombok.Data;
/**
* @author Ramón París
* @since 29-06-20
*/
@Data
@Builder
public class LicenseCategoryHelperDTO {
private DevOpsCategory devOpsCategory;
private CompanyLicense companyLicense;
}
| [
"rparis@retailsbs.com"
] | rparis@retailsbs.com |
d111523db6e04fb6c11acc2d6ceccea3000d7847 | 8a38bee9eade83d57e9aee122c132846162b428b | /src/main/java/classloading/SuperClass.java | afe65d9312da7e7270e1507f3db53db71dcc6d9a | [] | no_license | gwokhou/javalabs | df2ca9bd6f41d14bd92f9013b6e68ac98c35887c | b72a473b4ed79f21ebc25509c49c1781c3a110ca | refs/heads/master | 2020-06-27T16:07:42.575738 | 2019-09-30T07:40:07 | 2019-09-30T07:40:07 | 199,993,956 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 51 | java | package classloading;
public class SuperClass {
}
| [
"akidezhang@outlook.com"
] | akidezhang@outlook.com |
5e0364acd802f90dc309f202347a49ba87c3dc07 | e9a9bd52532f3f7d8e36da0707ee8f6055a0a6b8 | /src/com/homelearning/CollectionDemo.java | d3629e325da65271d791c83eece7e0544e9eb988 | [] | no_license | soul33d/Homework02.1 | 3f3ebd062290de4aa15937940f132867d79e82db | cb1675201408f2ff65b7f320c7059adce2fd7653 | refs/heads/master | 2020-12-30T14:01:33.058123 | 2017-05-15T01:17:18 | 2017-05-15T01:17:18 | 91,282,175 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,544 | java | /* Ostapenko Vitaliy
Необходимо реализовать коллекцию целых чисел, которая позволяет выполнять операции:
добавления
удаления
поиска элемента по значению
поиска элемента по индексу
поиска максимального элемента
поиска минимального элемента
поиска среднего арифметического всех элементов
При этом:
при добавлении нового элемента все элементы увеличивают своё значение на добавляемый элемент
при удалении - уменьшают своё значение на удаляемый элемент
Недопустим ввод в коллекцию null, символов и других значений, кроме целых чисел.
Результатом работы должен быть отдельный репозиторий github/bitbucket с README файлом, который описывает задание,
сам класс и содержит инструкции по запуску приложения.*/
package com.homelearning;
import java.util.Random;
public class CollectionDemo {
public static void main(String[] args) {
IntegersCollection integers = new IntegersCollection();
Random random = new Random();
printIntegersInfo(integers);
integers.add(null);
for (int i = 0; i < 10; i++) {
int rand = random.nextInt(10);
printIntegersInfo(integers);
integers.add(rand);
System.out.println("Adding " + rand);
}
printIntegersInfo(integers);
for (;integers.size() > 1;) {
int rand = integers.get(random.nextInt(integers.size() - 1) + 1);
System.out.println(integers);
System.out.println(integers.remove(rand));
System.out.println(rand + " removed");
printIntegersInfo(integers);
}
}
private static void printIntegersInfo(IntegersCollection integers) {
System.out.println(integers);
System.out.println("Average is " + integers.getAverage());
System.out.println("Max value is " + integers.getMaxValue());
System.out.println("Min value is " + integers.getMinValue());
System.out.println("The size is " + integers.size());
System.out.println();
}
} | [
"soul33d@gmail.com"
] | soul33d@gmail.com |
d754f849ca6725130840374ddbf3a9d92768f1bc | 2499f9c56f273dc3944c52fc8bd0aa9abb1c1748 | /src/main/java/com/starsmobi/elasticsearchclient/ElasticsearchClient.java | f39acc53b5796d67c33cfb1d76e8402f715a6703 | [] | no_license | denghongbin/elasticsearchdemo | c7f0bd8f1d36a5aa5cae63c31cb5ba883e46adc1 | 7ea5b637edeacf640f7f56c80e23c4553463cb60 | refs/heads/master | 2021-01-02T09:00:04.379278 | 2018-01-12T10:46:57 | 2018-01-12T10:46:57 | 99,118,505 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,663 | java | package com.starsmobi.elasticsearchclient;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.starsmobi.domain.GoodsEs;
import com.starsmobi.domain.SearchEntity;
import com.starsmobi.domain.StoresEs;
import com.starsmobi.service.IGoodService;
import com.vividsolutions.jts.geom.Coordinate;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse;
import org.elasticsearch.action.bulk.BulkRequestBuilder;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.client.Requests;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.geo.builders.ShapeBuilders;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.GeoShapeQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.search.sort.SortBuilders;
import org.elasticsearch.search.sort.SortOrder;
import org.elasticsearch.transport.client.PreBuiltTransportClient;
import org.locationtech.spatial4j.context.SpatialContextFactory;
import org.locationtech.spatial4j.io.GeoJSONWriter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.index.query.QueryBuilders.*;
import org.elasticsearch.common.geo.ShapeRelation;
import org.elasticsearch.common.geo.builders.ShapeBuilder;
/**
* Created by vincent on 2017-08-02.
*/
public class ElasticsearchClient {
private static TransportClient client;
/**
* jackson用于序列化操作的mapper
*/
private static final ObjectMapper objectMapper = new ObjectMapper();
private static final int DEFAULT_PORT = 9300;//ElasticsearchClient 集群的主节点的默认是9300
@Autowired
private IGoodService goodService;
private static boolean t = true;
private static boolean f = false;
/**
* logger
*/
private static final Logger LOGGER = LoggerFactory.getLogger(ElasticsearchClient.class);
private void elasticSearchClient(){
//创建ES 客户端连接
Settings settings = Settings.builder().put("client.transport.sniff",true)
.put("cluster.name","mygoods").build();
try {
client = new PreBuiltTransportClient(settings)
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.0.1"), 9300));
} catch (UnknownHostException e) {
}
LOGGER.info("elasticsearch 客户端初始化成功!");
}
/**
* 创建商品索引
* @param list
* @return
*/
public static boolean bulkGoodIndex(List<GoodsEs> list){
//创建ES 客户端连接
Settings settings = Settings.builder().put("client.transport.sniff",true)
.put("cluster.name","vincent-application").build();
try {
client = new PreBuiltTransportClient(settings)
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.0.1"), 9300));
} catch (UnknownHostException e) {
LOGGER.info("elasticsearch UnknownHostException 客户端连接失败");
}
LOGGER.info("elasticsearch 客户端初始化成功!");
LOGGER.info("elasticsearch 开始创建索引"+list.size());
list.forEach(goodsEs -> {
try {
final String goodsJson = objectMapper.writeValueAsString(goodsEs);
client.prepareIndex("go", "go", goodsEs.getId()).setSource(goodsJson, XContentType.JSON).execute();
LOGGER.info("elasticsearch 创建索引成功");
} catch (JsonProcessingException e) {
LOGGER.info("商品对象json格式化异常:{}");
}
});
client.close();
return t;
}
/**
* 创建店铺索引模版
* @param
* @return
*/
public static boolean bulkStoresIndex(){
//创建ES 客户端连接
Settings settings = Settings.builder().put("client.transport.sniff",true)
.put("cluster.name","vincent-application").build();
try {
client = new PreBuiltTransportClient(settings)
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.0.1"), 9300));
} catch (UnknownHostException e) {
LOGGER.info("elasticsearch UnknownHostException 客户端连接失败");
}
LOGGER.info("elasticsearch 客户端初始化成功!");
// 创建Mapping
XContentBuilder mapping = createMapping("storess");
try {
System.out.println("mapping:" + mapping.string());
} catch (IOException e) {
e.printStackTrace();
}
//创建空索引
client.admin().indices().prepareCreate("storess").execute().actionGet();
LOGGER.info("elasticsearch 创建空索引");
PutMappingRequest putMapping = Requests.putMappingRequest("storess").type("storess").source(mapping);
PutMappingResponse response = client.admin().indices().putMapping(putMapping).actionGet();
if (!response.isAcknowledged()) {
System.out.println("Could not define mapping for type [" + "stores" + "]/[" + "stores" + "].");
} else {
System.out.println("Mapping definition for [" + "stores" + "]/[" + "stores" + "] succesfully created.");
}
client.close();
return true;
}
/**
* 导入店铺索引数据
* @param
* @return
*/
public static boolean importDate(List<StoresEs> storesEs){
//创建ES 客户端连接
Settings settings = Settings.builder().put("client.transport.sniff",true)
.put("cluster.name","vincent-application").build();
try {
client = new PreBuiltTransportClient(settings)
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.0.1"), 9300));
} catch (UnknownHostException e) {
LOGGER.info("elasticsearch UnknownHostException 客户端连接失败");
}
LOGGER.info("elasticsearch 客户端初始化成功!");
List<String> stores = new ArrayList<String>();
storesEs.forEach(s->{
stores.add(obj2JsonData(s));
});
// 创建索引库
List<IndexRequest> requests = new ArrayList<IndexRequest>();
for (int i = 0; i < stores.size(); i++) {
IndexRequest request = client.prepareIndex("hh", "hh").setSource(stores.get(i)).request();
//client.prepareIndex("stores", "stores").setSource(stores.get(i)).execute();
LOGGER.info("elasticsearch 创建索引成功"+i);
requests.add(request);
}
// 批量创建索引
BulkRequestBuilder bulkRequest = client.prepareBulk();
for (IndexRequest request : requests) {
bulkRequest.add(request);
}
BulkResponse bulkResponse = bulkRequest.execute().actionGet();
if (bulkResponse.hasFailures()) {
System.out.println("批量创建索引错误!");
}
client.close();
return true;
}
// 创建店铺mapping
public static XContentBuilder createMapping(String indexType) {
XContentBuilder mapping = null;
try {
mapping = jsonBuilder().startObject()
// 索引库名(类似数据库中的表)
.startObject(indexType).startObject("properties")
// ID
.startObject("Id").field("type", "string").endObject()
// 店铺id
.startObject("storeId").field("type", "string").endObject()
// 店铺名称
.startObject("name").field("type", "string").endObject()
// 坐标集合
.startObject("location").field("type", "geo_shape").endObject()
// 创建时间
.startObject("createTime").field("type", "string").endObject()
// 更新时间
.startObject("updateTime").field("type", "string").endObject()
// 是否删除
.startObject("isDisable").field("type", "string").endObject()
.endObject().endObject().endObject();
} catch (IOException e) {
e.printStackTrace();
}
return mapping;
}
public static String obj2JsonData(StoresEs s){
String jsonData = null;
try {
XContentBuilder jsonBuild = XContentFactory.jsonBuilder();
jsonBuild.startObject()
.field("name", s.getName())
.startObject("location").field("type","multipolygon").field("coordinates", s.getLocation()).endObject()
.endObject();
jsonData = jsonBuild.string();
System.out.println(jsonData);
} catch (IOException e) {
e.printStackTrace();
}
return jsonData;
}
public static SearchResponse searchStores(double[] coor){
//创建ES 客户端连接
Settings settings = Settings.builder().put("client.transport.sniff",true)
.put("cluster.name","vincent-application").build();
try {
client = new PreBuiltTransportClient(settings)
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.0.1"), 9300));
} catch (UnknownHostException e) {
LOGGER.info("elasticsearch UnknownHostException 客户端连接失败");
}
LOGGER.info("elasticsearch 客户端初始化成功!");
Coordinate coordinate = new Coordinate(coor[0], coor[1]);
GeoShapeQueryBuilder qb = null;
try {
qb = geoShapeQuery(
"pin.location",
ShapeBuilders.newPoint(coordinate));
} catch (IOException e) {
e.printStackTrace();
}
qb.relation(ShapeRelation.INTERSECTS);
SearchResponse response = client.prepareSearch("to")
.setTypes("to")
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.setQuery(qb)
.setFrom(0)
.setSize(20)
.execute()
.actionGet();
LOGGER.info("查找成功");
client.close();
return response;
}
public static SearchResponse search(String index, String type, SearchEntity searchEntity){
//创建ES 客户端连接
Settings settings = Settings.builder().put("client.transport.sniff",true)
.put("cluster.name","vincent-application").build();
try {
client = new PreBuiltTransportClient(settings)
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.0.1"), 9300));
} catch (UnknownHostException e) {
LOGGER.info("elasticsearch UnknownHostException 客户端连接失败");
}
LOGGER.info("elasticsearch 客户端初始化成功!");
Map<String, Object> fieldMap = searchEntity.getFieldMap();
LOGGER.info("++++"+fieldMap.get("name")+"=++++++++"+fieldMap.get("stores.storeId"));
if (fieldMap == null || fieldMap.isEmpty()) {
return null;
}
SortOrder sortOrder = buildSort(searchEntity);
BoolQueryBuilder bqb = boolQuery();
//bqb.must(matchQuery("name",fieldMap.get("name")));
fieldMap.forEach((key, value) -> bqb.must(matchQuery(key, value)));
LOGGER.info("index:"+index);
SearchResponse response = client.prepareSearch(index)
.setTypes(type)
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.setQuery(bqb)
.addSort(SortBuilders.scoreSort())
.addSort(searchEntity.getOrderField(), sortOrder)
.setFrom(0)
.setSize(20)
.execute()
.actionGet();
LOGGER.info("查找成功");
client.close();
return response;
}
/**
* 构建排序信息
*
* @param searchEntity 查询实体类
* @return SortOrder
*/
private static SortOrder buildSort(SearchEntity searchEntity) {
SortOrder sortOrder;
if (Objects.equals(searchEntity.getSortOrder(), "asc")) {
sortOrder = SortOrder.ASC;
} else if (Objects.equals("desc", searchEntity.getSortOrder())) {
sortOrder = SortOrder.DESC;
} else {
sortOrder = SortOrder.DESC;
}
return sortOrder;
}
}
| [
"hongbin.deng@happylifeplat.com"
] | hongbin.deng@happylifeplat.com |
de7acb9f3c36970541c4c7a5b2fa7256ebb52b6c | ac13e9a734000ca709c714b0ac6af4133440e5f3 | /Eindwerk/TiboHulensEindwerkEJB/src/java/Entity/AbstractFacade.java | d02d3906b8818d78ab162717231eae1a337ea9a5 | [] | no_license | tiboke1992/DistributedApplications | 519527813f73a3e1b03c03b3f88a6e25a9428637 | 8ccea77d50f2952d890f4889c40e0ee34652a3ad | refs/heads/master | 2016-09-05T16:58:25.210617 | 2012-12-02T15:34:34 | 2012-12-02T15:34:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,876 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Entity;
import java.util.List;
import javax.persistence.EntityManager;
/**
*
* @author stinson
*/
public abstract class AbstractFacade<T> {
private Class<T> entityClass;
public AbstractFacade(Class<T> entityClass) {
this.entityClass = entityClass;
}
protected abstract EntityManager getEntityManager();
public void create(T entity) {
getEntityManager().persist(entity);
}
public void edit(T entity) {
getEntityManager().merge(entity);
}
public void remove(T entity) {
getEntityManager().remove(getEntityManager().merge(entity));
}
public T find(Object id) {
return getEntityManager().find(entityClass, id);
}
public List<T> findAll() {
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
cq.select(cq.from(entityClass));
return getEntityManager().createQuery(cq).getResultList();
}
public List<T> findRange(int[] range) {
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
cq.select(cq.from(entityClass));
javax.persistence.Query q = getEntityManager().createQuery(cq);
q.setMaxResults(range[1] - range[0]);
q.setFirstResult(range[0]);
return q.getResultList();
}
public int count() {
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
javax.persistence.criteria.Root<T> rt = cq.from(entityClass);
cq.select(getEntityManager().getCriteriaBuilder().count(rt));
javax.persistence.Query q = getEntityManager().createQuery(cq);
return ((Long) q.getSingleResult()).intValue();
}
}
| [
"tibo_hulens@hotmail.com"
] | tibo_hulens@hotmail.com |
03b66a4152d319384436e129e7bc5da0a91b5345 | 609c444aab0fab6534391f0ede232f9f1c210591 | /mobile/src/main/java/com/mattrubacky/monet2/deserialized/splatoon/CoopSummary.java | 16b7ce35698121c3811dd63f297d647eaea02379 | [] | no_license | msruback/MoNet2 | 2185685892294552f73e9a6e77c7d2f0eac415b8 | 16d0916f4bb87d30995342243e161c04c3acccae | refs/heads/master | 2021-01-23T21:55:11.959099 | 2019-02-01T02:47:34 | 2019-02-01T02:47:36 | 102,909,185 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,245 | java | package com.mattrubacky.monet2.deserialized.splatoon;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.gson.annotations.SerializedName;
import com.mattrubacky.monet2.helper.ShiftStats;
import java.util.ArrayList;
/**
* Created by mattr on 10/6/2018.
*/
public class CoopSummary implements Parcelable{
public CoopSummary(){}
@SerializedName("card")
public CoopCard coopCard;
@SerializedName("stats")
public ArrayList<ShiftStats> shifts;
protected CoopSummary(Parcel in) {
coopCard = in.readParcelable(CoopCard.class.getClassLoader());
shifts = in.createTypedArrayList(ShiftStats.CREATOR);
}
public static final Creator<CoopSummary> CREATOR = new Creator<CoopSummary>() {
@Override
public CoopSummary createFromParcel(Parcel in) {
return new CoopSummary(in);
}
@Override
public CoopSummary[] newArray(int size) {
return new CoopSummary[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeParcelable(coopCard, flags);
dest.writeTypedList(shifts);
}
}
| [
"mattrubacky@gmail.com"
] | mattrubacky@gmail.com |
78585e2ab225e5b55c11f2c7340a1f3709925504 | 967df5d63c9889ad63329c532d7e0ed2c2be2a62 | /app/src/main/java/com/nbs/mvpsample/base/adapter/BaseHeaderAdapter.java | f6805b4ad2730793903ad0ac2ee7226886b8d2f6 | [] | no_license | kazwert/mvp-android | 8ccfd7a0fba5d6206ec3154542d0943e82130db4 | 3b63e7ce8a5024aade387a3dbd4299553466893a | refs/heads/master | 2021-01-19T17:38:15.040280 | 2017-04-16T17:50:48 | 2017-04-16T17:50:48 | 88,337,928 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,425 | java | package com.nbs.mvpsample.base.adapter;
import android.content.Context;
import android.os.Bundle;
import android.view.ViewGroup;
import com.nbs.mvpsample.base.adapter.viewholder.BaseHeaderViewHolder;
import com.nbs.mvpsample.base.adapter.viewholder.BaseItemViewHolder;
import java.util.ArrayList;
import java.util.List;
public abstract class BaseHeaderAdapter<Data, ViewHolder extends BaseItemViewHolder<Data>,
Header extends BaseHeaderViewHolder> extends
BaseRecyclerAdapter<Data, BaseItemViewHolder> {
protected static final int TYPE_HEADER = 0;
protected static final int TYPE_ITEM = 1;
protected boolean mHasHeader = true;
protected Header mHeader;
protected Bundle mBundle;
public BaseHeaderAdapter(Context context, Bundle bundle) {
super(context);
this.mBundle = bundle;
if (mHasHeader) {
mDatas.add(null);
}
}
@Override
protected int getItemResourceLayout(int viewType) {
if (viewType == TYPE_HEADER) {
return getHeaderLayout();
} else {
return getItemLayout(viewType);
}
}
protected abstract int getHeaderLayout();
protected abstract int getItemLayout(int viewType);
@Override
public BaseItemViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
if (mHasHeader && viewType == TYPE_HEADER) {
mHeader = onCreateHeaderViewHolder(viewGroup, viewType);
return mHeader;
}
return onCreateItemViewHolder(viewGroup, viewType);
}
protected abstract Header onCreateHeaderViewHolder(ViewGroup viewGroup, int viewType);
public abstract ViewHolder onCreateItemViewHolder(ViewGroup viewGroup, int viewType);
@Override
public void onBindViewHolder(BaseItemViewHolder holder, int position) {
if (mHasHeader && position == 0) {
mHeader.show();
return;
}
holder.setHasHeader(mHasHeader);
super.onBindViewHolder(holder, position);
}
@Override
public int getItemViewType(int position) {
if (position == 0 && mHasHeader) {
return TYPE_HEADER;
} else {
return TYPE_ITEM;
}
}
public void showHeader() {
if (!mHasHeader) {
mHasHeader = true;
mDatas.add(0, null);
}
}
public void hideHeader() {
if (mHasHeader) {
mHasHeader = false;
mDatas.remove(0);
}
}
public boolean isHasHeader() {
return mHasHeader;
}
@Override
public void clear() {
super.clear();
if (mHasHeader) {
mDatas.add(null);
}
}
@Override
public List<Data> getDatas() {
return mHasHeader ? new ArrayList<>(mDatas.subList(1, mDatas.size())) : super.getDatas();
}
public Header getHeader() {
return mHeader;
}
@Override
public void add(Data item, int position) {
if (mHasHeader) {
mDatas.add(position + 1, item);
notifyItemInserted(position + 1);
} else {
super.add(item, position);
}
}
@Override
public void remove(int position) {
if (mHasHeader) {
mDatas.remove(position + 1);
notifyItemRemoved(position + 1);
} else {
super.remove(position);
}
}
}
| [
"kazwert@gmail.com"
] | kazwert@gmail.com |
90e8368afed7e03e4ec37f4edc2014bd3f28b95f | b9b524603f6181227f271f5f32ede5b5b0b4e26a | /focos/src/focos/Focos.java | 6b7d5df3715bfb48a794edfc3c21353ba7c3e52d | [] | no_license | JeanChavezMori/Ejercicios-Java | 08577dc720ff2c50cf609e8076b664267e1ee695 | 9df9a293c37c1194ff9cc4501d46e90761f51375 | refs/heads/master | 2022-12-17T21:16:37.615494 | 2020-09-04T02:29:02 | 2020-09-04T02:29:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,283 | 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 focos;
import java.util.Scanner;
/**
*
* @author ESCORPIO
*/
public class Focos {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
//EJERCICIO 4.4
Scanner dato = new Scanner(System.in);
int con=0;
int cont=0;
int conta=0;
int focos=0;
String color="";
System.out.println("Ingresar Cantidad de Focos:");
focos=dato.nextInt();
for(int i=1;i<=focos;i++)
{
System.out.println("Ingresar Color:"+i);
color=dato.next();
switch(color){
case "rojo":
con++;
break;
case"blanco":
cont++;
break;
case"verde":
conta++;
break;
}
}
System.out.println("Cantidad de Blancos:"+cont);
System.out.println("Cantidad de Rojos:"+con);
System.out.println("Cantidad de Verdes:"+conta);
}
}
| [
"Rafa291996hotmail.com"
] | Rafa291996hotmail.com |
7d4f813980d18a1dee453277e7b2f961a813ecf1 | 767fcaecb092d294e26734f520d59bedeb3cfd9d | /BusApp/src/main/java/com/bus/app/controller/TestBusController.java | 337319d56ce2d29ad5dcc407c0b21e43f946f7ac | [] | no_license | ABLive/BusApp | 84b5b3493ea779ce9efad4c55ab81932f2112ad0 | fafa4b28187448d33cce5d43ae0c956c28b81f54 | refs/heads/master | 2020-04-27T01:56:27.026883 | 2019-03-10T17:04:45 | 2019-03-10T17:04:45 | 173,979,212 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 485 | java | package com.bus.app.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class TestBusController {
@RequestMapping(value = "/sonu/learningREST", method = RequestMethod.GET)
public TestBus something() {
TestBus t1 = new TestBus();
t1.setTestBusId(1001);
t1.setBusColor("RED");
return t1;
}
} | [
"test@test.com"
] | test@test.com |
c29a7c8c12aefab978a9d812d2d7d96777362381 | 8a3323916c8ae0c700273a975c88822cd36eb7ca | /LessonChess/src/com/example/business/Rook.java | a5f308d2a5adfa2676d509af04bab8351c9e281a | [] | no_license | SebastienFERRAND/chessLesson | 18e0053ea78932c43300d31275c6c55301593fb9 | ff654f5f9298860846466e065ce2472611f88d21 | refs/heads/master | 2016-09-06T18:40:02.482158 | 2014-01-23T18:08:01 | 2014-01-23T18:08:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,060 | java | package com.example.business;
import java.util.ArrayList;
import android.content.Context;
import com.example.lessonchess.ChessActivity;
import com.example.lessonchess.R;
public class Rook extends Piece{
private int ressource;
private int currentSquare;
private int colorA;
private Context context;
boolean blocked = false;
private ArrayList<Integer> listSquare;
private Piece[] currentBoard;
public Rook (int color, Context chessActivity){
context = chessActivity;
colorA = color;
if (color == 0){
ressource = R.drawable.new_white_rook_tran_small;
}else{
ressource = R.drawable.new_black_rook_tran_small;
}
}
public int getColor(){
return colorA;
}
public int getRessource(){
return ressource;
}
public void setCurrentSquare(int position) {
currentSquare = position;
}
public int getCurrentSquare() {
return currentSquare;
}
public ArrayList<Integer> getPossibleMoves(){
listSquare = new ArrayList<Integer>();
currentBoard = ((ChessActivity)context).getAlp();
int currentLine = currentSquare/8;
int beginOfRow = currentLine * 8;
int endOfRow = (currentLine+1) * 8;
blocked = false;
for (int i = currentSquare; i >= beginOfRow ; i--){
addSquare(i);
}
blocked = false;
for (int i = currentSquare; i < endOfRow ; i++){
addSquare(i);
}
blocked = false;
for (int i = currentSquare; i < 64; i=i+8 ){
addSquare(i);
}
blocked = false;
for (int i = currentSquare; i >= 0 ; i=i-8 ){
addSquare(i);
}
while(listSquare.lastIndexOf(currentSquare) != -1){
listSquare.remove(listSquare.lastIndexOf(currentSquare));
}
return listSquare;
}
public void addSquare(int i){
if (!blocked){
//if empty
if(currentBoard[i].getColor() == -1){
listSquare.add(i);
//if different color
}else if (currentBoard[i].getColor() != this.getColor()){
// if (!(currentBoard[i] instanceof King)){
listSquare.add(i);
// }
blocked = true;
//if same color
}else{
if (i != currentSquare){
blocked = true;
}
}
}
}
}
| [
"sebastien.ferrand.dev@gmail.com"
] | sebastien.ferrand.dev@gmail.com |
1d51db70caa64aba7c928a18d639ece1681ea4a8 | 88dd09bd087f8708149be1752713b5b9b2f6392b | /app/src/androidTest/java/pl/edu/pwr/dawidszewczyk/lab1/lab1/ExampleInstrumentedTest.java | d8b9779a97d29d9a99d22166e5756f70841fdfda | [] | no_license | dawid-szewczyk/Lab1 | fdc8919dce815ff0fdbd21f316443ca00d90612b | 73535e0c36272597eb8bb9635fe4eff37853853c | refs/heads/master | 2021-01-19T07:16:47.383302 | 2017-04-07T10:22:06 | 2017-04-07T10:22:06 | 87,478,857 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 772 | java | package pl.edu.pwr.dawidszewczyk.lab1.lab1;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation 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() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("pl.edu.pwr.dawidszewczyk.lab1.lab1", appContext.getPackageName());
}
}
| [
"dawid.szewczyk19@gmail.com"
] | dawid.szewczyk19@gmail.com |
4aeca1321ce5e01f872ba9459dc3deaf592d5322 | b4464284be41e481d9462522e35332f6726d2743 | /src/entidades/Medico.java | 94c46b8a1b2aaaed56615f8b5900cbee110b7671 | [] | no_license | LucasEsteves2/-Sistema-Clinica-Medica- | 0d2aff5e10af6277ae423807ba017cb8e730f22d | f72b7ad216a6e3efe01b195d93529ab213a839bf | refs/heads/main | 2023-08-06T14:03:06.880453 | 2021-10-06T22:06:05 | 2021-10-06T22:06:05 | 389,400,134 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,220 | java | package entidades;
public class Medico {
private String nome;
private String cpf;
private String especialidade;
private String sexo;
private int id;
public Medico(int id2, String nome, String cpf, String endereco, String email) {
this.id = id2;
this.nome = nome;
this.cpf = cpf;
this.especialidade = endereco;
this.email = email;
}
public String getEndereco() {
return especialidade;
}
public void setEndereco(String endereco) {
this.especialidade = endereco;
}
public String getDtNascimento() {
return sexo;
}
public void setDtNascimento(String dtNascimento) {
this.sexo = dtNascimento;
}
public String getSintomas() {
return sintomas;
}
public void setSintomas(String sintomas) {
this.sintomas = sintomas;
}
private String email;
private String sintomas;
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getCpf() {
return cpf;
}
public void setCpf(String cpf) {
this.cpf = cpf;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
}
| [
"lucasesteves5304@gmail.com"
] | lucasesteves5304@gmail.com |
573d3c8b2a719345879cfb87f3e8492b4f2d41f9 | 8d8a23042b8411b5e6a489ddbbfbaa29aa463316 | /app/src/androidTest/java/com/johndon/cmcc/util/Base/ExampleInstrumentedTest.java | 2aae7aa06fe7b5481b6e762b9ae346f8382eb873 | [] | no_license | dengjiangdun/Base | 5bb8bf1ed9cc9cdd3e15903b808f68901d7ac7ef | ed71b66e754b33ba5594823739c89352c4a99e61 | refs/heads/master | 2021-08-19T22:37:08.371250 | 2017-11-27T14:36:25 | 2017-11-27T14:36:25 | 112,193,952 | 0 | 0 | null | 2017-11-27T14:44:30 | 2017-11-27T12:32:15 | Java | UTF-8 | Java | false | false | 756 | java | package com.johndon.cmcc.util.Base;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation 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() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.johndon.cmcc.util.Base", appContext.getPackageName());
}
}
| [
"dengjd@gionee.com"
] | dengjd@gionee.com |
e0f50126175cb58142ff745627a0ef3fcdc2453f | 05b978c8163e505cbe7f9bf2dc6e9af0789bfa9c | /chapter-09/src/org/liufeng/course/pojo/UserLocation.java | 4af174f67392111b8bbbfc2456a5ee523c0910ba | [] | no_license | Dax1n/wechat_code_book | 88d01a22090ffd868e05af874df43385abd16075 | 7d25ef700d7a18659b4af6f866f13aaffd6dc4ef | refs/heads/master | 2020-12-02T17:50:45.919543 | 2017-07-06T14:32:40 | 2017-07-06T14:32:40 | 96,439,166 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 824 | java | package org.liufeng.course.pojo;
/**
* 用户地理位置model
*
* @author liufeng
* @date 2013-11-19
*/
public class UserLocation {
private String openId;
private String lng;
private String lat;
private String bd09Lng;
private String bd09Lat;
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
public String getLng() {
return lng;
}
public void setLng(String lng) {
this.lng = lng;
}
public String getLat() {
return lat;
}
public void setLat(String lat) {
this.lat = lat;
}
public String getBd09Lng() {
return bd09Lng;
}
public void setBd09Lng(String bd09Lng) {
this.bd09Lng = bd09Lng;
}
public String getBd09Lat() {
return bd09Lat;
}
public void setBd09Lat(String bd09Lat) {
this.bd09Lat = bd09Lat;
}
}
| [
"568275045@qq.com"
] | 568275045@qq.com |
421304fcaf6f2bf9ce061cabb090e0ba4882bf36 | 1224e21d2e88994fd5d4b2d3f9f6f9d52d0c3887 | /src/main/java/visitor/Employee.java | 24da536443c361046d53ab0434d2bed737db4657 | [] | no_license | AlvinTech/DesignPatterns | fe16f6ba1a99a72394bde3da4a75642c6a5c2eee | c8156b615399b235279b4ad7c7c99c00271d5dce | refs/heads/master | 2021-05-04T09:01:58.076949 | 2017-01-07T12:51:48 | 2017-01-07T12:51:48 | 70,387,203 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 391 | java | package visitor;
import lombok.Data;
/**
* Created by Alvin on 16/11/14.
*/
@Data
public abstract class Employee {
private String name;
private int age;
private double salary;
public Employee(String name, int age, double salary) {
this.name = name;
this.age = age;
this.salary = salary;
}
public abstract void accept(Visitor visitor);
}
| [
"alvalp@live.cn"
] | alvalp@live.cn |
a4ed805fc4fb24f66354a985f2373cd3e6144b1d | bbe10639bb9c8f32422122c993530959534560e1 | /delivery/app-release_source_from_JADX/com/google/android/gms/ads/internal/zzm.java | 3570c5e4b00ae9450f8d8a51e79cd1cabfadc271 | [
"Apache-2.0"
] | permissive | ANDROFAST/delivery_articulos | dae74482e41b459963186b6e7e3d6553999c5706 | ddcc8b06d7ea2895ccda2e13c179c658703fec96 | refs/heads/master | 2020-04-07T15:13:18.470392 | 2018-11-21T02:15:19 | 2018-11-21T02:15:19 | 158,476,390 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,105 | java | package com.google.android.gms.ads.internal;
import android.content.Context;
import com.google.android.gms.ads.internal.client.zzw.zza;
import com.google.android.gms.ads.internal.util.client.zzb;
import com.google.android.gms.internal.zzha;
@zzha
public class zzm extends zza {
private static final Object zzqf = new Object();
private static zzm zzqg;
private final Context mContext;
private boolean zzqh = false;
zzm(Context context) {
this.mContext = context;
}
public static zzm zzr(Context context) {
zzm com_google_android_gms_ads_internal_zzm;
synchronized (zzqf) {
if (zzqg == null) {
zzqg = new zzm(context.getApplicationContext());
}
com_google_android_gms_ads_internal_zzm = zzqg;
}
return com_google_android_gms_ads_internal_zzm;
}
public void zza() {
synchronized (zzqf) {
if (this.zzqh) {
zzb.zzaH("Mobile ads is initialized already.");
return;
}
this.zzqh = true;
}
}
}
| [
"cespedessanchezalex@gmail.com"
] | cespedessanchezalex@gmail.com |
f2b4094d0f2fc4b8f53d422b5de53c58600f51fa | 22919f620c40af4b6f2cffdf66e0e57af9fc4a85 | /guns-admin/src/main/java/com/stylefeng/guns/netty/requestEntity/BillCodeDefinitionVOEntity.java | bed708eac5ea3b0b210b21b057bf4bdc22f8bdfb | [
"Apache-2.0"
] | permissive | iam6/best | 0a44d2ccb853266b139b6d6ad08260ac16cb2b2b | 398b6f65bb41acb7decfbda09f9032f2e19e50dd | refs/heads/master | 2020-04-13T05:39:53.791389 | 2018-08-24T05:48:49 | 2018-08-24T05:48:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,065 | java | package com.stylefeng.guns.netty.requestEntity;
/**
* 缓存的面单规则
*/
public class BillCodeDefinitionVOEntity {
private String code; //面单种类编码
private String name; //面单种类名称
private Boolean isList; //是否有明细
private Integer unitNumber; //单位数目
private String startChars; //开始字符
private Integer afterLength; //开始字符之后的字长度
private Integer totalLength; //面单字符总长度
private Integer billTypeId;//面单类型 id
private long syncVersion; //版本号
private String billTypeName; //面单类型名称
private Boolean isEBill; //是否是电子面单
public Boolean getIsList() {
return isList;
}
public void setIsList(Boolean list) {
isList = list;
}
@Override
public String toString() {
return "BillCodeDefinitionVOEntity{" +
"code='" + code + '\'' +
", name='" + name + '\'' +
", isList=" + isList +
", unitNumber=" + unitNumber +
", startChars='" + startChars + '\'' +
", afterLength=" + afterLength +
", totalLength=" + totalLength +
", billTypeId=" + billTypeId +
", syncVersion=" + syncVersion +
", billTypeName='" + billTypeName + '\'' +
", isEBill=" + isEBill +
'}';
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getUnitNumber() {
return unitNumber;
}
public void setUnitNumber(Integer unitNumber) {
this.unitNumber = unitNumber;
}
public String getStartChars() {
return startChars;
}
public void setStartChars(String startChars) {
this.startChars = startChars;
}
public Integer getAfterLength() {
return afterLength;
}
public void setAfterLength(Integer afterLength) {
this.afterLength = afterLength;
}
public Integer getTotalLength() {
return totalLength;
}
public void setTotalLength(Integer totalLength) {
this.totalLength = totalLength;
}
public Integer getBillTypeId() {
return billTypeId;
}
public void setBillTypeId(Integer billTypeId) {
this.billTypeId = billTypeId;
}
public long getSyncVersion() {
return syncVersion;
}
public void setSyncVersion(long syncVersion) {
this.syncVersion = syncVersion;
}
public String getBillTypeName() {
return billTypeName;
}
public void setBillTypeName(String billTypeName) {
this.billTypeName = billTypeName;
}
public Boolean getIsEBill() {
return isEBill;
}
public void setIsEBill(Boolean EBill) {
isEBill = EBill;
}
}
| [
"438483836@qq.com"
] | 438483836@qq.com |
4673edbd1dfa0363bcc7f55b45d679cebe19d83a | e465358040c4de9d5dc9a3e1e08fa4eb27547810 | /asterixdb/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AStringPrinter.java | 6f379271af5d90577bb65a03c8690b8ddee3f7e1 | [] | no_license | zhaosheng-zhang/cdnc | 84ff7511b57c260e070fc0f3f1d941f39101116e | bc436a948ab1a7eb5df9857916592c7e7b39798c | refs/heads/master | 2016-08-04T18:43:31.480569 | 2013-10-15T17:29:04 | 2013-10-15T17:29:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,406 | java | /*
* Copyright 2009-2013 by The Regents of the University of California
* 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 from
*
* 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 edu.uci.ics.asterix.dataflow.data.nontagged.printers;
import java.io.IOException;
import java.io.PrintStream;
import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
import edu.uci.ics.hyracks.algebricks.data.utils.WriteValueTools;
public class AStringPrinter implements IPrinter {
public static final AStringPrinter INSTANCE = new AStringPrinter();
@Override
public void init() {
}
@Override
public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
try {
WriteValueTools.writeUTF8String(b, s + 1, l - 1, ps);
} catch (IOException e) {
throw new AlgebricksException(e);
}
}
} | [
"happily84@gmail.com"
] | happily84@gmail.com |
a738469c6d3c3ddb13d54d8d3e5da8e389849b03 | eb31a49ac745a8cc276c52d8c934e960164d35ff | /src/com/appspot/recipebookdb/RecipeBookDBServlet.java | ba70246f553ba832712ad7537d9adedc477d7197 | [] | no_license | tahosook/recipebookdb | e44f8741fe2f7d8a6cbae4613c7e4f64c5cc7042 | c4c22c09c80b68303832c8211020eedd93809721 | refs/heads/master | 2016-09-05T19:27:57.610574 | 2014-01-04T17:22:40 | 2014-01-04T17:22:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | package com.appspot.recipebookdb;
import java.io.IOException;
import javax.servlet.http.*;
@SuppressWarnings("serial")
public class RecipeBookDBServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
resp.setContentType("text/plain");
resp.getWriter().println("Hello, world");
}
}
| [
"tahosook@yahoo-corp.jp"
] | tahosook@yahoo-corp.jp |
bd0dba1787f84aa7e4c00b238aa98bc4b8cd6d6d | 807a6fd8f589f07aefe2d39e64e582d9b14cad3b | /src/com/company/EnumClass.java | b0588bf40a63ee805b4248881f172fbb9c1c0201 | [] | no_license | DerrickJiao/cha13 | 44cf560b9d6faea60dd0983dd17aa04010d37f07 | 51ac8fbe6008486948adcec7e50b9f454027970b | refs/heads/master | 2020-03-25T04:23:35.067140 | 2018-08-04T03:10:43 | 2018-08-04T03:10:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 533 | java | package com.company;
enum Size{
SMALL, MEDIUM, LARGE;
}
public class EnumClass {
public static void main(String[] args) {
for (Size size : Size.values()){
System.out.println(size + "的序数是:" + size.ordinal());
System.out.println(size.compareTo(Size.SMALL));
System.out.println(size.equals(Size.SMALL));
System.out.println(size == Size.SMALL);
System.out.println(size.name());
System.out.println("***************");
}
}
}
| [
"1300456010@qq.com"
] | 1300456010@qq.com |
edd34bf8cc4da31d9b9df0de70e6423a31aab5b8 | 4d37505edab103fd2271623b85041033d225ebcc | /spring-test/src/test/java/org/springframework/test/util/subpackage/StaticFields.java | 92723c0ac97328d42fdfcad76f08161922a6b452 | [
"Apache-2.0"
] | permissive | huifer/spring-framework-read | 1799f1f073b65fed78f06993e58879571cc4548f | 73528bd85adc306a620eedd82c218094daebe0ee | refs/heads/master | 2020-12-08T08:03:17.458500 | 2020-03-02T05:51:55 | 2020-03-02T05:51:55 | 232,931,630 | 6 | 2 | Apache-2.0 | 2020-03-02T05:51:57 | 2020-01-10T00:18:15 | Java | UTF-8 | Java | false | false | 1,112 | java | /*
* Copyright 2002-2018 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.test.util.subpackage;
/**
* Simple class with static fields; intended for use in unit tests.
*
* @author Sam Brannen
* @since 4.2
*/
public class StaticFields {
public static String publicField = "public";
private static String privateField = "private";
public static void reset() {
publicField = "public";
privateField = "private";
}
public static String getPrivateField() {
return privateField;
}
}
| [
"huifer97@163.com"
] | huifer97@163.com |
e93fc955e13cd1ea99680e2205fa1566f87fdb4a | c752d79047eafe3b3179ae6ffe15e18119f8e015 | /Demo/src/aircraft/carrier/Carrier.java | 1518f010a9088bf4fc8522a8c77c856e04714b10 | [] | no_license | green-fox-academy/szekelymarton00 | 257e715ddf048a6d0b326593536d4b98fe8ec401 | 4b8327be9c592e185f4e719375c548916158be3e | refs/heads/master | 2021-08-08T04:26:51.195002 | 2017-11-09T15:31:36 | 2017-11-09T15:31:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,214 | java | package aircraft.carrier;
import java.util.ArrayList;
public class Carrier {
ArrayList<Aircraft> aircrafts;
int carrierAmmo;
int carrierHealth;
public Carrier(int carrierAmmo, int health) {
aircrafts = new ArrayList<Aircraft>();
this.carrierAmmo = carrierAmmo;
this.carrierHealth = health;
}
public void addAircraft(String type) {
aircrafts.add(new Aircraft(type));
}
public void fill() {
for (Aircraft a : aircrafts) {
a.refill(carrierAmmo);
}
}
public void fight(Carrier another) {
int totalDamage = 0;
for (Aircraft aircraft : aircrafts) {
totalDamage += aircraft.fight();
}
another.carrierHealth -= totalDamage;
}
public void getStatus() {
int totalDamage = 0;
for (Aircraft a : aircrafts) {
totalDamage += a.currentAmmo * a.baseDamage;
}
if (carrierHealth <= 0) {
System.out.println("It's dead, Jim! :(");
} else {
for (Aircraft a : aircrafts) {
System.out.println(a.getStatus());
}
System.out.println("HP: " + carrierHealth + ", Aircraft count: " + aircrafts.size() + ", "
+ "Ammo storage: " + carrierAmmo + ", Total Damage: " + totalDamage);
}
}
}
| [
"szekelymarton00@gmail.com"
] | szekelymarton00@gmail.com |
aa1b77b8b67f21b438ecb9257153f92ef567ed2b | 0a08a3792decc8f077201b4a50331d045c01b08e | /scalecube-organization/src/test/java/io/scalecube/organization/ut/UpdateOrganizationTest.java | 07e45aee85476d04494f5db6ea0f2373cabb378a | [] | no_license | scalecube/scalecube-organization-service | 98a86ef74c2a8ba2a8337a5b9b7416af835fa45f | 631669b6540c473416e8510e9495565e223b3b18 | refs/heads/develop | 2022-11-27T09:08:04.171908 | 2020-01-17T22:57:54 | 2020-01-17T22:57:54 | 139,597,096 | 4 | 0 | null | 2022-11-15T23:46:58 | 2018-07-03T14:40:07 | JavaScript | UTF-8 | Java | false | false | 488 | java | package io.scalecube.organization.ut;
import io.scalecube.organization.fixtures.InMemoryOrganizationServiceFixture;
import io.scalecube.organization.scenario.UpdateOrganizationScenario;
import io.scalecube.test.fixtures.Fixtures;
import io.scalecube.test.fixtures.WithFixture;
import org.junit.jupiter.api.extension.ExtendWith;
@ExtendWith(Fixtures.class)
@WithFixture(value = InMemoryOrganizationServiceFixture.class)
class UpdateOrganizationTest extends UpdateOrganizationScenario {}
| [
"d.lazebny@gmail.com"
] | d.lazebny@gmail.com |
4cc481c6c27999935ab899a678a6d2af8df7ef3a | 9a599b64137b487e2374c594b3e13f54a7d0084f | /day02_01spring_ioc_anno/src/main/java/com/itheima/dao/impl/AccountDaoImpl.java | f083346f8fb4f26d8b4dbfbcc747914eb7ac509a | [] | no_license | linuxjava/SpringStudy | 573711d5c7b5844f4462298ef20b7b3c0b34f110 | 3d6c666d9d085b8639d7dcc0ca126c882786668f | refs/heads/master | 2022-07-11T13:31:51.211781 | 2020-07-16T04:19:13 | 2020-07-16T04:19:13 | 252,671,058 | 0 | 0 | null | 2022-06-21T03:52:07 | 2020-04-03T08:13:59 | Java | UTF-8 | Java | false | false | 378 | java | package com.itheima.dao.impl;
import com.itheima.dao.IAccountDao;
import org.springframework.stereotype.Repository;
@Repository("accountDao")
public class AccountDaoImpl implements IAccountDao{
public AccountDaoImpl() {
System.out.println("AccountDaoImpl");
}
public void saveAccount() {
System.out.println("AccountDaoImpl saveAccount");
}
}
| [
"robincxiao@tencent.com"
] | robincxiao@tencent.com |
e14c47b6216738ff0bea4e019477048be1c91687 | 8a056a0981c2e3beb49f2f47e6838e4c79346ed6 | /administration/src/main/java/sgsits/cse/dis/administration/request/TelephoneComplaintForm.java | c87c31a333bb06f77042602a4d9fb54575602080 | [] | no_license | lilesh09cse/cse-dis-backend | cce47fd9cda76f8502cc47825e5ae7d892bbf161 | a6a7c4d13264d2eba58cf65519f81c6042d36bfd | refs/heads/master | 2023-04-20T21:18:07.458684 | 2021-02-17T07:42:39 | 2021-02-17T07:42:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 420 | java | package sgsits.cse.dis.administration.request;
import javax.validation.constraints.NotBlank;
public class TelephoneComplaintForm {
@NotBlank
private String extensionNo;
@NotBlank
private String location;
@NotBlank
private String details;
public String getLocation() {
return location;
}
public String getDetails() {
return details;
}
public String getExtensionNo() {
return extensionNo;
}
}
| [
"pranaygarg001@gmail.com"
] | pranaygarg001@gmail.com |
deaa90191e0987fca58704aa81df2c6df96e4e7d | 17430f758afa69e973ebbe4c8db460bf5d59624e | /RabbitMQ/src/main/java/simpleQueue/RabbitMQProduc.java | d3c20ef0b3a07a5bdec743aa96671a9e08f2e559 | [] | no_license | jorybeast97/MagicSpace | 47db250c11bd42efa52987f18be176c7d1be10c1 | 548ffc368c85741e17cb509a666a0e5a8dcfd487 | refs/heads/master | 2020-12-07T23:39:20.397533 | 2020-07-15T00:32:28 | 2020-07-15T00:32:28 | 232,826,359 | 0 | 0 | null | 2020-01-09T14:25:48 | 2020-01-09T14:21:05 | Java | UTF-8 | Java | false | false | 1,083 | java | package simpleQueue;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import utils.RabbitMQUtils;
public class RabbitMQProduc {
public static void main(String[] args) throws Exception {
for (int i = 0; i < 10; i++) {
prodceMessage();
Thread.sleep(3000);
}
}
/**
* 队列名称
*/
public final static String QUEUE_NAME = "MyProductQueue";
public static void prodceMessage() throws Exception {
//获取连接
Connection connection = RabbitMQUtils.
getRabbitMQConnection("localhost", 5672,
"/magnolia", "guest", "guest");
//获取通道
Channel channel = connection.createChannel();
channel.queueDeclare(QUEUE_NAME, false, false, false, null);
//发送消息
String msg = "HELLO WORLD";
channel.basicPublish("", QUEUE_NAME, null, msg.getBytes());
System.out.println("消息已经发送!");
//关闭
channel.close();
connection.close();
}
}
| [
"489282384@qq.com"
] | 489282384@qq.com |
96c5b51b8c73104b3756d8111da8fd5baee97876 | f8cc68bad3ed6c25226c847532bf6f7ae6b270f9 | /src/main/java/us/zingalicio/handlefish/commands/HandleHelp.java | de23920f99f12429cae70bd2f10d915c5cd610a5 | [] | no_license | Zingalicious/Handlefish | fdeb47bfdb4251fe463685b4f6f135bb767c7b70 | c7fc011a35bc33279720245e834b4c0b6b1dfa80 | refs/heads/master | 2021-01-25T10:29:09.105148 | 2014-10-13T02:25:34 | 2014-10-13T02:25:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,298 | java | package us.zingalicio.handlefish.commands;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.YamlConfiguration;
import us.zingalicio.handlefish.Handlefish;
import us.zingalicio.cordstone.StoredMessages;
import us.zingalicio.cordstone.util.MessageUtil;
import us.zingalicio.cordstone.util.NumberUtil;
import us.zingalicio.cordstone.util.PermissionsUtil;
public final class HandleHelp implements CommandExecutor
{
Handlefish plugin;
YamlConfiguration help;
public HandleHelp(Handlefish plugin)
{
this.plugin = plugin;
this.help = plugin.getHelp();
}
public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
{
if(args.length == 0)
{
List<String> topics = new ArrayList<>();
for(String key : help.getConfigurationSection("listed").getKeys(false))
{
for(String s: help.getConfigurationSection("listed." + key).getKeys(false))
{
if(PermissionsUtil.checkPermission(sender, "handlefish.help." + s, true))
{
topics.add("/help " + s + ": " + ChatColor.WHITE + help.getString("listed." + key + "." + s));
}
}
}
MessageUtil.paginate(sender, topics, 1);
}
else if(NumberUtil.getInt(args[0]) != null)
{
int pageN = NumberUtil.getInt(args[0]);
List<String> topics = new ArrayList<>();
for(String key : help.getConfigurationSection("listed").getKeys(false))
{
for(String s: help.getConfigurationSection("listed." + key).getKeys(false))
{
if(PermissionsUtil.checkPermission(sender, "handlefish.help." + s, true))
{
topics.add("/help " + s + ": " + ChatColor.WHITE + help.getString("listed." + key + "." + s));
}
}
}
MessageUtil.paginate(sender, topics, pageN);
}
else if(help.contains("topics." + args[0]))
{
int pageN = 1;
if(args.length > 1 && NumberUtil.getInt(args[1]) != null)
{
pageN = NumberUtil.getInt(args[1]);
}
MessageUtil.paginate(sender, help.getStringList("topics." + args[0]), pageN);
return true;
}
else
{
MessageUtil.sendMessage(plugin, sender, StoredMessages.NO_HELP.selfMessage());
}
return false;
}
}
| [
"admin@zingalicio.us"
] | admin@zingalicio.us |
0eec22733abf7360b4d7c3e30a470387ec1c3c36 | a80ce2b0d53f160af766ae3b807e0628d4030157 | /app/src/main/java/com/example/mysqlcrud/Model/User.java | 971c8576db636f9f165da3e0eb02c6dcba77bc49 | [] | no_license | Asadrao125/Mysql-CRUD | 61f5b90aca90e0dd8034be3da24facea434a7ddb | 8999d2f991c07c5373924987c308e0480f63da5b | refs/heads/master | 2023-01-07T11:39:42.771252 | 2020-11-05T06:53:02 | 2020-11-05T06:53:02 | 308,288,674 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,046 | java | package com.example.mysqlcrud.Model;
public class User {
private String id, name, email, country, mobile;
public User(String id, String name, String email, String country, String mobile) {
this.id = id;
this.name = name;
this.email = email;
this.country = country;
this.mobile = mobile;
}
public User() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
}
| [
"raoasad125@gmail.com"
] | raoasad125@gmail.com |
2cd2ed083d90abd46223ee39ebf2561e564d062c | 7d456323130b5f68ccb361eaa2b56f9e29770b52 | /src/main/java/com/example/demo/domain/ItemPedido.java | 32bc389f2eb8dd6726efaef5865e934cc52efe2d | [] | no_license | ggbzrr/cursoMcNovo | 1ae145577f5b3014e5326b927e6094dcb16929d2 | 35542372af88daed059912da656966e2918ef7c2 | refs/heads/master | 2020-07-19T14:13:20.210308 | 2019-09-21T20:08:01 | 2019-09-21T20:08:01 | 206,462,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,887 | java | package com.example.demo.domain;
import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import com.fasterxml.jackson.annotation.JsonIgnore;
@Entity
public class ItemPedido implements Serializable{
private static final long serialVersionUID = 1L;
@JsonIgnore
@EmbeddedId
private ItemPedidoPK id = new ItemPedidoPK();
private Double desconto;
private Integer quantidade;
private double preco;
private ItemPedido() {
}
public ItemPedido(Pedido pedido, Produto produto, Double desconto, Integer quantidade, double preco) {
super();
id.setPedido(pedido);
id.setProduto(produto);
this.id = id;
this.desconto = desconto;
this.quantidade = quantidade;
this.preco = preco;
}
@JsonIgnore
public Pedido getPedido() {
return id.getPedido();
}
public Produto getProduto() {
return id.getProduto();
}
public ItemPedidoPK getId() {
return id;
}
public void setId(ItemPedidoPK id) {
this.id = id;
}
public Double getDesconto() {
return desconto;
}
public void setDesconto(Double desconto) {
this.desconto = desconto;
}
public Integer getQuantidade() {
return quantidade;
}
public void setQuantidade(Integer quantidade) {
this.quantidade = quantidade;
}
public double getPreco() {
return preco;
}
public void setPreco(double preco) {
this.preco = preco;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.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;
ItemPedido other = (ItemPedido) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
}
| [
"ggbzrr@yahoo.com.br"
] | ggbzrr@yahoo.com.br |
001124dfe34068648a22805a8d1e213e7a39e812 | 6db25d094c8c921e889ea0b1b01a1511b3cfbc8b | /src/main/java/decodeways/Solution.java | 847982e14acb0a1681f34d61f8e207350493570c | [] | no_license | thechipsweredown/leetcode-practice | fee311b490db3144999211e71681aab9bdbf774a | 329e53047e9ab03d5dfd87b51eea4b01f882ffe9 | refs/heads/master | 2023-07-21T22:38:04.863260 | 2021-09-10T04:38:16 | 2021-09-10T04:38:16 | 277,714,573 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,968 | java | package decodeways;
import java.util.Arrays;
import java.util.List;
public class Solution {
Character[] c = new Character[]{ '1', '2','*'};
List<Character> list = Arrays.asList(c);
public int numDecodings(String s) {
double[] w = new double[s.length()+1];
w[0] = 1;
for(int i=1; i<=s.length();i++){
if(i==1){
if(s.charAt(i-1) == '0') return 0;
else if(s.charAt(i-1) == '*') w[i] = 9;
else w[i] = 1;
}else{
if(s.charAt(i-1) == '0' && !list.contains(s.charAt(i-2))) return 0;
else if(s.charAt(i-1) == '0'){
if(s.charAt(i-2) == '*') w[i] = (w[i-2]*2)%((Math.pow(10,9)+7));
else w[i] = w[i-2];
}else if(s.charAt(i-1) == '*'){
if(s.charAt(i-2) == '*') w[i] = 15*w[i-2] + 9*w[i-1];
else if(s.charAt(i-2) == '1') w[i] = 9*(w[i-2] + w[i-1]);
else if(s.charAt(i-2) == '2') w[i] = 9*w[i-1] + 6*w[i-2];
else w[i] = 9*w[i-1];
}else{
if(s.charAt(i-2) == '0') w[i] = w[i-1];
else if(s.charAt(i-2) == '*') w[i] = w[i-1] + w[i-2]*(Integer.parseInt(Character.toString(s.charAt(i-1))) < 7 ? 2 : 1);
else if(s.charAt(i-2) == '1') w[i] = w[i-1] + w[i-2];
else if(s.charAt(i-2) == '2'){
int t = Integer.parseInt(Character.toString(s.charAt(i-1)));
if(t < 7) w[i] = w[i-1]+ w[i-2];
else w[i] = w[i-1];
}else{
w[i] = w[i-1];
}
}
}
w[i] = w[i]%((Math.pow(10,9)+7));
}
return (int)w[s.length()];
}
public static void main(String[] args) {
System.out.println(new Solution().numDecodings("*********"));
}
}
| [
"tungdangduc@admicro.vn"
] | tungdangduc@admicro.vn |
b0bf1fe790636a89f8afd3495c1518f87b01117e | d6e99ba2f6ee1d92b9b9972ba59e38a24920d991 | /src/main/java/com/interviewbit/linkedlist/twopointer/PalindromeList.java | 681354fff69cceb2b2a86fed464d95062e29b9b4 | [] | no_license | Mrinal-Bhattacharya/Data_Structure | 3a7ddb637164eb38523292a433bfa64f477d7696 | 654422117874765f05524b13141f4d509b28f852 | refs/heads/master | 2021-01-18T12:24:12.720661 | 2020-02-05T06:12:32 | 2020-02-05T06:12:32 | 42,710,167 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,120 | java | package com.interviewbit.linkedlist.twopointer;
import com.interviewbit.linkedlist.ListNode;
public class PalindromeList {
public int lPalin(final ListNode head) {
if ((head == null) || (head.next == null)) {
return 1;
}
int l = 0;
ListNode curr = head;
while (curr != null) {
l++;
curr = curr.next;
}
int i = 1;
curr = head;
while (i < (l / 2)) {
curr = curr.next;
i++;
}
ListNode mid = this.reverse(curr.next);
curr = head;
while (mid != null) {
if (curr.val != mid.val) {
return 0;
}
curr = curr.next;
mid = mid.next;
}
return 1;
}
public ListNode reverse(final ListNode head) {
ListNode curr = head;
ListNode prev = null;
ListNode next = null;
while (curr != null) {
next = curr.next;
curr.next = prev;
prev = curr;
curr = next;
}
return prev;
}
}
| [
"mrinal.bhattacharya@boeing.com"
] | mrinal.bhattacharya@boeing.com |
2f686dbbc95c40f41083eb01213f5ec6f8b6cad1 | bc794d54ef1311d95d0c479962eb506180873375 | /kerenpaie/kerenpaie-rest/src/main/java/com/keren/kerenpaie/jaxrs/ifaces/employes/CategorieRS.java | cf610a4a7b4c0726d0c1f75042cdc53a21467b04 | [] | no_license | Teratech2018/Teratech | d1abb0f71a797181630d581cf5600c50e40c9663 | 612f1baf9636034cfa5d33a91e44bbf3a3f0a0cb | refs/heads/master | 2021-04-28T05:31:38.081955 | 2019-04-01T08:35:34 | 2019-04-01T08:35:34 | 122,177,253 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 362 | java |
package com.keren.kerenpaie.jaxrs.ifaces.employes;
import com.keren.kerenpaie.model.employes.Categorie;
import com.megatimgroup.generic.jax.rs.layer.ifaces.GenericService;
/**
* Interface du service JAX-RS
* @since Thu Mar 01 10:22:26 GMT+01:00 2018
*
*/
public interface CategorieRS
extends GenericService<Categorie, Long>
{
}
| [
"bekondo_dieu@yahoo.fr"
] | bekondo_dieu@yahoo.fr |
2f0beafc833fde46868378cfd09f67f0a0a9c352 | 5ff6dd4a4e53aaa5a95d4d569a06d78521b02b62 | /jdk1.6.0_45-src/org/omg/IOP/TAG_MULTIPLE_COMPONENTS.java | b82627e63be97b2a96cf0f703f0205de46166296 | [] | no_license | xchen-manbu/JDK_SRC | c12e8f3ae7c77fb1ad5c0c920ac6a46e568d29d2 | 5eb24c0441cca9224d8b6ad6afe4d57edb89eccd | refs/heads/master | 2022-08-15T17:06:16.206768 | 2019-01-17T09:24:40 | 2019-01-17T09:24:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 882 | java | package org.omg.IOP;
/**
* org/omg/IOP/TAG_MULTIPLE_COMPONENTS.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from ../../../../src/share/classes/org/omg/PortableInterceptor/IOP.idl
* Monday, April 1, 2013 8:55:47 PM GMT
*/
public interface TAG_MULTIPLE_COMPONENTS
{
/**
* Indicates that the value encapsulated is of type
* <code>MultipleComponentProfile</code>. In this case, the profile
* consists of a list of protocol components, the use of which must
* be specified by the protocol using this profile. This profile may
* be used to carry IOR components.
* <p>
* The <code>profile_data</code> for the
* <code>TAG_MULTIPLE_COMPONENTS</code> profile is a CDR encapsulation
* of the <code>MultipleComponentProfile</code> type shown above.
*/
public static final int value = (int)(1L);
}
| [
"30653851+walker-chan@users.noreply.github.com"
] | 30653851+walker-chan@users.noreply.github.com |
3639601153dc8ca98416b10cb17288b5b00462f7 | 3b06898ace0f4c037ac4ea2f4cf6dc278012fb72 | /presentation/src/main/java/com/devs/kero/team7/learningrxjava/contract/CompleteTasksContract.java | bf9854f1b756450fbf713bc9523b20f005ba9f6b | [] | no_license | akram09/ReminderPro-Clone | aac19eac9e6e6cfc3733bc895eb77eaf2ad5e286 | 2b32a2d2523501cfcf48f2fd3af5dca90b8ff6b0 | refs/heads/master | 2020-04-08T01:13:44.019480 | 2018-11-23T23:23:12 | 2018-11-23T23:23:12 | 158,885,874 | 2 | 1 | null | 2019-10-04T00:08:38 | 2018-11-23T23:20:06 | Java | UTF-8 | Java | false | false | 233 | java | package com.devs.kero.team7.learningrxjava.contract;
public interface CompleteTasksContract {
interface View extends MainScreenContract.View {
}
interface PRESENTER extends MainScreenContract.Presenter {
}
}
| [
"a.boutouchent@esi-sba.dz"
] | a.boutouchent@esi-sba.dz |
d806364ce335582a9a4f8ecc171f4caf406f782a | 1f62c917af105ba30fa1957fc02e9618880d92e0 | /src/main/java/br/com/sulamerica/igor/repository/IUsuarioRepository.java | 4f59423859020a3f9515d6724d74e3edf8adbec8 | [] | no_license | barrozaum/igorSulamerica | debec48b4f35674821dd887f763d03decff4ddb7 | 8c0dccf59c000880deb820e297a7bbc511e3868d | refs/heads/master | 2020-09-01T02:03:38.195629 | 2019-11-01T03:09:18 | 2019-11-01T03:09:18 | 218,852,226 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 209 | java | package br.com.sulamerica.igor.repository;
import java.util.Optional;
import br.com.sulamerica.igor.model.Usuario;
public interface IUsuarioRepository {
Optional<Usuario> findById(Long id);
}
| [
"Igor@Barrozaum.Home"
] | Igor@Barrozaum.Home |
7456d92e9798141b72c0f239202baef9ce090f36 | 6d79a1a900f75d8d6b6250054ac570f5be7c2ecf | /src/objects/towers/MineTower.java | ae9634ca242c9561bc6e6147ed62b1d7eed506bc | [] | no_license | FrostWork/td-game | 26c126f3a85826bfe271d54ceaae7b5e1633a39c | 929093d4261af65893c22b13ddf9eb1530665fcb | refs/heads/master | 2021-01-20T11:38:17.209551 | 2017-08-28T18:54:43 | 2017-08-28T18:54:43 | 101,675,965 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,905 | java | package objects.towers;
import java.awt.Point;
import java.util.ArrayList;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.scene.effect.GaussianBlur;
import javafx.scene.image.ImageView;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.util.Duration;
import objects.Enemy;
import objects.TargetedTower;
import ui.Main;
public class MineTower extends TargetedTower{
public MineTower(double x, double y, double width, double height) {
super(200, 30, 3000, "mine", Main.mine, x, y, width, height);
}
@Override
public void fire(Enemy enemy) {
if(canFire()){
setCanFire(false);
ImageView mine = new ImageView(Main.bomb);
mine.setFitWidth(enemy.getRadius());
mine.setFitHeight(enemy.getRadius());
mine.setLayoutX(enemy.getLayoutX()+enemy.getCenterX()+enemy.getRadius()/2-mine.getFitWidth());
mine.setLayoutY(enemy.getLayoutY()+enemy.getCenterY()+enemy.getRadius()/2-mine.getFitHeight());
mine.xProperty().bind(enemy.translateXProperty());
mine.yProperty().bind(enemy.translateYProperty());
Main.addNode(mine);
new Timeline(new KeyFrame(getDelay(), x -> setCanFire(true))).play();
new Timeline(new KeyFrame(getDelay().divide(2), e -> {
Point center = Main.getCenterCoords(mine);
Circle aoe = new Circle(center.getX(), center.getY(), getRange(), Color.rgb(255, 102, 204, 0.3));
aoe.setStroke(Color.rgb(204, 51, 0, 0.3));
aoe.setEffect(new GaussianBlur());
Main.addNode(aoe);
Main.removeNode(mine);
new Timeline(new KeyFrame(Duration.millis(50), ev -> {
ArrayList<Enemy> enemies = Main.getEnemies();
for(Enemy enem: enemies){
if(Main.getDistanceBetween(aoe, enem) <= getRange()){
enem.takeDamage(getDamage());
}
}
Main.removeNode(aoe);
})).play();
})).play();
}
}
}
| [
"ray.chen.3@stonybrook.edu"
] | ray.chen.3@stonybrook.edu |
1b0402d59afac08b416ab46a1137b0cd7ebfdde0 | 71505060050f0a9f4e6478e1755280c2bbaccac9 | /morganStanley/src/main/java/com/suidifu/morganstanley/model/request/repayment/CheckPrepayment.java | a1c508f3307745996daf84bf43358439ac86b599 | [] | no_license | soldiers1989/comsui | 1f73003e7345946ef51af7d73ee3da593f6151ed | 6f5c8a28fb1f58e0afc979a1dd5f2e43cbfa09cc | refs/heads/master | 2020-03-27T19:25:33.560060 | 2018-07-06T06:21:05 | 2018-07-06T06:21:05 | 146,988,141 | 0 | 1 | null | 2018-09-01T10:11:31 | 2018-09-01T10:11:31 | null | UTF-8 | Java | false | false | 3,528 | java | package com.suidifu.morganstanley.model.request.repayment;
import com.suidifu.matryoshka.customize.CustomizeServices;
import com.suidifu.matryoshka.handler.ProductCategoryCacheHandler;
import com.suidifu.matryoshka.handler.SandboxDataSetHandler;
import com.suidifu.matryoshka.productCategory.ProductCategory;
import com.suidifu.matryoshka.snapshot.ContractSnapshot;
import com.suidifu.matryoshka.snapshot.SandboxDataSet;
import com.suidifu.morganstanley.controller.api.repayment.PrepaymentController;
import com.zufangbao.gluon.api.earth.v3.model.ApiMessage;
import com.zufangbao.gluon.exception.ApiException;
import com.zufangbao.gluon.spec.earth.v3.ApiResponseCode;
import com.zufangbao.sun.utils.AmountUtils;
import com.zufangbao.sun.utils.DateUtils;
import com.zufangbao.sun.utils.JsonUtils;
import com.zufangbao.sun.utils.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 校验提前全额还款接口请求参数
* @author louguanyang at 2017/10/16 14:35
*/
public class CheckPrepayment {
/**
* 校验提前还款请求参数
*
* @param prepayment 提前还款请求参数
*/
public static void check(@NotNull Prepayment prepayment) {
Integer hasDeducted = prepayment.getHasDeducted();
if (hasDeducted != null) {
if (hasDeducted < 0 || hasDeducted > 1) {
throw new ApiException(ApiMessage.INVALID_PARAMS.getCode(), "hasDeducted:错误,取值范围:0-[本端未扣款],1-[对端已扣款]");
}
}
if (AmountUtils.notEquals(prepayment.getAssetInitialValueBD(), prepayment.getAmount())) {
throw new ApiException(ApiMessage.INVALID_PARAMS.getCode(), "提前还款明细金额之和与总金额[assetInitialValue]不匹配");
}
}
public static void checkInterestAndPrincipal(@NotNull Prepayment prepayment, boolean isWF, SandboxDataSetHandler sandboxDataSetHandler, ProductCategoryCacheHandler productCategoryCacheHandler){
Map<String, String> preRequest = new HashMap<>();
List<BigDecimal> interests = new ArrayList<>();
List<BigDecimal> principals = new ArrayList<>();
List<String> assetRecycleDates = new ArrayList<>();
interests.add(new BigDecimal(prepayment.getAssetInterest()));
principals.add(new BigDecimal(prepayment.getAssetInterest()));
assetRecycleDates.add(prepayment.getAssetRecycleDate());
preRequest.put("interest", JsonUtils.toJSONString(interests));
preRequest.put("principal", JsonUtils.toJSONString(principals));
preRequest.put("assetRecycleDate", JsonUtils.toJSONString(assetRecycleDates));
preRequest.put("uniqueId", prepayment.getUniqueId());
preRequest.put("contractNo", prepayment.getContractNo());
if(isWF) {
ProductCategory productCategory = productCategoryCacheHandler.get("importAssetPackage/weifang/10003", true);
CustomizeServices services = (CustomizeServices) productCategoryCacheHandler.getScript(productCategory);
boolean result = services.evaluate(sandboxDataSetHandler, preRequest, new HashMap<>(), LogFactory.getLog(PrepaymentController.class));
if(!result){
throw new ApiException(ApiResponseCode.CUSTOMER_FEE_CHECK_FAIL);
}
}
}
}
| [
"mwf5310@163.com"
] | mwf5310@163.com |
120abcd347b606d818a9ac5e743d353131fe1b3e | 4f98e193fc3b771bf9938962b001b9b4604908ae | /viikko6/tehtava2/src/main/java/statistics/matcher/Not.java | 66898978853f4dee45da3058058263d09aebdc86 | [] | no_license | fir3porkkana/ohtu | 2fffba05c2bf5e7748bc7f9de0488726ba798344 | 36d2af7f39afe525615a55aed0728b74a84f4f68 | refs/heads/master | 2020-08-30T23:07:10.449866 | 2019-12-09T15:00:27 | 2019-12-09T15:00:27 | 218,515,996 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 426 | java |
package statistics.matcher;
import statistics.Player;
public class Not implements Matcher {
private Matcher[] matchers;
public Not(Matcher... matchers) {
this.matchers = matchers;
}
@Override
public boolean matches(Player p) {
for (Matcher matcher : matchers) {
if (matcher.matches(p)) {
return false;
}
}
return true;
}
}
| [
"tiera.salmi@gmail.com"
] | tiera.salmi@gmail.com |
1b5e2e69c27cec8a6ab98868e7d8bc7817420c54 | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /test/irvine/oeis/a010/A010434Test.java | a840f2f0930efc51dfea2c8f261a35ddeaead103 | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 195 | java | package irvine.oeis.a010;
import irvine.oeis.AbstractSequenceTest;
/**
* Tests the corresponding class.
* @author Sean A. Irvine
*/
public class A010434Test extends AbstractSequenceTest {
}
| [
"sairvin@gmail.com"
] | sairvin@gmail.com |
c956aae1b4735dec2c2e2f14ecb6c5b63c466c3a | b8c5f083c13babb711341bedf5d4def0b05133c2 | /app/src/main/java/com/example/mypar/gift/server/Article_Request.java | ffbaedba98a4add0631092389ac6cfc2095e767a | [] | no_license | sekimain/GIFT | d46156bef982af792049b71bd94dfd3e8749d3fb | c3c5fea7d716abb6a2e4e4c7939993896176d29c | refs/heads/master | 2020-03-19T01:18:23.115526 | 2018-05-31T05:37:34 | 2018-05-31T05:37:34 | 135,536,214 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 619 | java | package com.example.mypar.gift.server;
import com.android.volley.Response;
import com.android.volley.toolbox.StringRequest;
import java.util.HashMap;
import java.util.Map;
public class Article_Request extends StringRequest {
final static private String URL = "http://rshak8912.cafe24.com/board/search.php";
private Map<String,String> parameters;
public Article_Request( Response.Listener<String> listener)
{
super(Method.POST, URL, listener,null);
parameters = new HashMap<>();
}
@Override
public Map<String,String> getParams()
{
return parameters;
}
} | [
"ekrcy505@kw.ac.kr"
] | ekrcy505@kw.ac.kr |
e8dc381c2c653d93a3f151285319fbd2617a82bb | 92cbd572d8239de627a4ff89558a2c5d6a84c240 | /clonepedia/src/clonepedia/java/visitor/CollectStatementInMethodVisitor.java | 07e07064664cb148d6e6c54e3e03a0f9f7a58a65 | [] | no_license | llmhyy/clonepedia | 95491e0948561b170ca770e1b6d4c01a50f8cb7c | 04fc913af7e9884b53904ac4f96225bc29c8552c | refs/heads/master | 2020-12-11T04:00:26.152439 | 2019-11-08T12:58:38 | 2019-11-08T12:58:38 | 68,502,477 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 777 | java | package clonepedia.java.visitor;
import java.util.ArrayList;
import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.Block;
import org.eclipse.jdt.core.dom.Statement;
public class CollectStatementInMethodVisitor extends ASTVisitor {
private ArrayList<Statement> totalStatList = new ArrayList<Statement>();
@Override
public boolean preVisit2(ASTNode node){
if(node instanceof Statement){
Statement stat = (Statement)node;
if(!(stat instanceof Block)){
totalStatList.add(stat);
return false;
}
else{
return true;
}
}
else{
return true;
}
}
public ArrayList<Statement> getTotalStatementList(){
return totalStatList;
}
}
| [
"llmhyy@gmail.com"
] | llmhyy@gmail.com |
e95700ed6c9d29d1fc82512e91a90d4420d4f157 | 6635387159b685ab34f9c927b878734bd6040e7e | /src/ve.java | 412012dca48d0a8ed0e1d04c2cd33fe029fa5530 | [] | no_license | RepoForks/com.snapchat.android | 987dd3d4a72c2f43bc52f5dea9d55bfb190966e2 | 6e28a32ad495cf14f87e512dd0be700f5186b4c6 | refs/heads/master | 2021-05-05T10:36:16.396377 | 2015-07-16T16:46:26 | 2015-07-16T16:46:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 177 | java | public abstract interface ve
{
public abstract long a(int paramInt);
}
/* Location:
* Qualified Name: ve
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
c84c4f0cb753d81cf509feed8ace3a5eb0132ce5 | 12fb094f5d4ee7677115a8eefb6b9d6535baedff | /src/net/sumppen/whatsapi4j/BinTreeNodeReader.java | 7d1d41e8c41206fcf2663cfa52019ac348f6e094 | [] | no_license | mmushfiq/WhatsApi4JWithoutMaven | eb9405f3c008016eec788aa126a7087019aeb0b5 | 5bb94e48271e5ef6fe51e9d2cb184a41b23698e9 | refs/heads/master | 2016-09-05T12:12:50.056681 | 2015-03-26T15:56:14 | 2015-03-26T15:56:14 | 31,326,707 | 2 | 3 | null | null | null | null | UTF-8 | Java | false | false | 6,998 | java | package net.sumppen.whatsapi4j;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.Map;
import org.apache.log4j.Logger;
public class BinTreeNodeReader {
private String[] dictionary;
private KeyStream key;
private byte[] input;
private final Logger log = Logger.getLogger(BinTreeNodeReader.class);
public BinTreeNodeReader(String[] dictionary) {
this.dictionary = dictionary;
}
public void resetKey() {
this.key = null;
}
public void setKey(KeyStream key) {
this.key = key;
}
/**
*
* @param readData
* @return
* @throws IncompleteMessageException
* @throws InvalidMessageException
* @throws InvalidTokenException
* @throws IOException
*/
public ProtocolNode nextTree(byte[] readData) throws IncompleteMessageException, InvalidMessageException, InvalidTokenException, IOException {
if(readData != null) {
input = readData;
// log.debug("Input ="+new String(readData));
}
int stanzaFlag = (peekInt8(0) & 0xF0) >> 4;
int stanzaSize = peekInt16(1);
if(stanzaSize > input.length) {
throw new IncompleteMessageException("incomplete message");
}
readInt24();
if ((stanzaFlag & 8) != 0) {
if (key != null) {
byte[] remainingData = Arrays.copyOfRange(input, stanzaSize, input.length+1);
byte[] decoded = key.decode(input, 0, stanzaSize);
input = Arrays.copyOf(decoded, decoded.length+remainingData.length);
System.arraycopy(remainingData, 0, input, decoded.length, remainingData.length);
} else {
throw new InvalidMessageException("Encountered encrypted message, missing key");
}
}
if (stanzaSize > 0) {
return nextTreeInternal();
}
return null;
}
private ProtocolNode nextTreeInternal() throws InvalidTokenException, IOException {
int token = readInt8();
int size = readListSize(token);
token = readInt8();
if (token == 1) {
Map<String, String> attributes = readAttributes(size);
return new ProtocolNode("start", attributes, null, null);
}
if (token == 2) {
return null;
}
String tag = new String(readString(token));
Map<String, String> attributes = readAttributes(size);
if ((size % 2) == 1) {
return new ProtocolNode(tag, attributes, null, null);
}
token = readInt8();
if (isListTag(token)) {
return new ProtocolNode(tag, attributes, readList(token), null);
}
return new ProtocolNode(tag, attributes, null, readString(token));
}
private LinkedList<ProtocolNode> readList(int token) throws InvalidTokenException, IOException {
int size = readListSize(token);
LinkedList<ProtocolNode> ret = new LinkedList<ProtocolNode>();
for (int i = 0; i < size; i++) {
ret.add(nextTreeInternal());
}
return ret;
}
private boolean isListTag(int token) {
return ((token == 248) || (token == 0) || (token == 249)); }
private byte[] readString(int token) throws IOException, InvalidTokenException {
ByteArrayOutputStream ret = new ByteArrayOutputStream();
int size;
if (token == -1) {
throw new InvalidTokenException("BinTreeNodeReader->readString: Invalid token $token");
}
switch(token) {
case 0:
break;
case 0xfc:
size = readInt8();
ret.write(fillArray(size));
break;
case 0xfd:
size = readInt24();
ret.write(fillArray(size));
break;
case 0xfe:
token = readInt8();
ret.write(getToken(token + 0xf5));
break;
case 0xfa:
byte[] user = readString(readInt8());
byte[] server = readString(readInt8());
if((user.length > 0) && (server.length > 0)) {
ret.write(user);
ret.write('@');
ret.write(server);
} else {
if (server.length > 0) {
ret.write(server);
}
}
default:
if(token > 4 && token < 0xf5) {
ret.write(getToken(token));
}
break;
}
return ret.toByteArray();
}
private byte[] fillArray(int size) {
byte[] ret = null;
if (input.length >= size) {
ret = Arrays.copyOfRange(input, 0, size);
input = Arrays.copyOfRange(input, size, input.length);
}
return ret;
}
private byte[] getToken(int token) throws InvalidTokenException {
String ret = "";
if ((token >= 0) && (token < dictionary.length)) {
ret = dictionary[token];
} else {
throw new InvalidTokenException("BinTreeNodeReader->getToken: Invalid token "+token);
}
return ret.getBytes();
}
private int readListSize(int token) throws InvalidTokenException {
int size = 0;
switch(token) {
case 0xf8:
case -8:
size = readInt8();
break;
case 0xf9:
case -7:
size = readInt16();
break;
default:
throw new InvalidTokenException("BinTreeNodeReader->readListSize: Invalid token "+token);
}
return size;
}
private Map<String, String> readAttributes(int size) throws IOException, InvalidTokenException {
Map<String, String> attributes = new LinkedHashMap<String, String>();
int attribCount = (size - 2 + size % 2) / 2;
for (int i = 0; i < attribCount; i++) {
String key = new String(readString(readInt8()));
String value = new String(readString(readInt8()));
attributes.put(key, value);
}
return attributes;
}
private int readInt24() {
int ret = peekInt24(0);
if (input.length >= 3) {
input = Arrays.copyOfRange(input, 3, input.length+1);
}
return ret;
}
private int peekInt24(int offset) {
int ret = 0;
if (input.length >= (3 + offset)) {
ret = (input[offset]&0xFF) << 16;
ret |= (input[offset + 1]&0xFF) << 8;
ret |= (input[offset + 2]&0xFF) << 0;
}
return ret;
}
private int readInt8() {
int ret = peekInt8(0);
if (input.length >= 1) {
input = Arrays.copyOfRange(input, 1, input.length+1);
}
return ret;
}
private int peekInt8(int offset) {
if(input.length >= (1+offset)) {
return input[offset] & 0xFF;
}
return 0;
}
private int readInt16() {
int ret = peekInt16(0);
if (input.length >= 2) {
input = Arrays.copyOfRange(input, 2, input.length+1);
}
return ret;
}
private int peekInt16(int offset) {
int ret = 0;
if(input.length >= (2+offset)) {
ret += (input[offset]&0xFF) << 8;
ret += (input[offset+1]&0xFF) << 0;
}
return ret;
}
}
| [
"mushfiqazeri@gmail.com"
] | mushfiqazeri@gmail.com |
fc160c92b989d69b172268cea895272fcec0823a | b13882425de42ad04df3e54b22e7e830ae0abf0a | /mano/src/main/java/mano/http/HttpRequestCookie.java | 5b1d5de65c129616a987236d5c91ce9dcb2fd59f | [] | no_license | diosay/mano | 8774b211a5c2556e424f62e1757845730e6bd02d | c0c8f64121c1019cae2ff7c12894c975de069d60 | refs/heads/master | 2020-12-24T08:30:37.802449 | 2016-08-03T07:19:32 | 2016-08-03T07:19:32 | 21,358,841 | 0 | 0 | null | 2016-08-03T07:20:27 | 2014-06-30T17:00:14 | null | UTF-8 | Java | false | false | 644 | java | /*
* Copyright (C) 2014 The MANO Project. All rights reserved.
*
* See more http://mano.diosay.com/
*
*/
package mano.http;
/**
* 提供一组用于读取 HTTP Cookie 的方法。
* @author jun <jun@diosay.com>
*/
public interface HttpRequestCookie {
/**
* 从 Cookie 集合中返回具有指定名称的 Cookie。
* @param key 要从集合中检索的 Cookie 的名称。
* @return 按 name 指定的 HttpCookie。
*/
String get(String key);
/**
* 返回集合的迭代器。
* @return
*/
Iterable<HttpCookieCollection.CookieEntry> iterator();
}
| [
"jun@diosay.com"
] | jun@diosay.com |
4e4f847a959e71daa28271bd9dedda1d3e80f113 | 6ae9a5d840a7a80ce97906e4576a2f9611817a86 | /src/main/java/edu/arizona/biosemantics/oto2/oto/shared/model/community/Synonymization.java | 60d62e96851aefdee94686b957f6cbf23efe1395 | [] | no_license | rodenhausen/otosteps | e581d5ba93ea06054aea2a5f70a146c56a6eb01f | 4ab7615d1ff754e3166827076108cbbd04ca150f | refs/heads/master | 2021-01-10T20:17:53.933206 | 2014-11-19T13:20:09 | 2014-11-19T13:20:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 663 | java | package edu.arizona.biosemantics.oto2.oto.shared.model.community;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
public class Synonymization implements Serializable {
private String label;
private String mainTerm;
private Set<String> synonyms = new HashSet<String>();
public Synonymization(String label, String mainTerm, Set<String> synonyms) {
this.label = label;
this.mainTerm = mainTerm;
this.synonyms = synonyms;
}
public String getLabel() {
return label;
}
public String getMainTerm() {
return mainTerm;
}
public Set<String> getSynonyms() {
return synonyms;
}
} | [
"thomas.rodenhausen@gmail.com"
] | thomas.rodenhausen@gmail.com |
df682a8415d012876d06a1a92e4ddd94da9ac01f | 53930e9751619ca6a1a3fb561bfca66eb5ff238e | /src/main/java/tk/lexno/blog/service/impl/SysServiceImpl.java | d81025f7cdc1cc25b25ffe8eeb48bce07610d696 | [] | no_license | lexno/springboot-blog | ec584b8936850a79b4bb38a0359d218a2b64d6e6 | afba185c5e6d82e9e6767613f0c9ba9e76aa54cb | refs/heads/master | 2020-03-28T03:31:19.307286 | 2018-11-06T07:01:33 | 2018-11-06T07:01:33 | 147,651,547 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,147 | java | package tk.lexno.blog.service.impl;
import org.springframework.stereotype.Service;
import tk.lexno.blog.dao.SysLogMapper;
import tk.lexno.blog.dao.SysViewMapper;
import tk.lexno.blog.entity.SysLog;
import tk.lexno.blog.entity.SysView;
import tk.lexno.blog.service.SysService;
import javax.annotation.Resource;
import java.util.List;
@Service
public class SysServiceImpl implements SysService {
@Resource
private SysLogMapper sysLogMapper;
@Resource
private SysViewMapper sysViewMapper;
@Override
public void addLog(SysLog sysLog) {
sysLogMapper.insertSelective(sysLog);
}
@Override
public void addView(SysView sysView) {
sysViewMapper.insertSelective(sysView);
}
@Override
public Long getLogCount() {
return sysLogMapper.selectAllLogCount();
}
@Override
public Long getViewCount() {
return sysViewMapper.selectAllViewCount();
}
@Override
public List<SysLog> listAllLog() {
return sysLogMapper.selectAllLog();
}
@Override
public List<SysView> listAllView() {
return sysViewMapper.selectAllView();
}
}
| [
"lexno23@gmail.com"
] | lexno23@gmail.com |
d566190dece9396b23821e526c48cfd0dbf1d97e | 37838502b6f4f3a393c2df710efe6624c1d4dcd5 | /src/main/java/edu/eci/arsw/blueprints/services/BlueprintsServices.java | 7b0efbfc8cc5dfa3022b3d49d74da0f36ed40939 | [] | no_license | JuanPabloArevalo/ARSW-Lab6-CSS-JQuery | 3b6ba60d1a15de26e3b0e088901ddf8eb253cd1a | 833fc237013b24cba1add628ecf75641d0ee65b4 | refs/heads/main | 2023-07-15T06:42:37.640655 | 2021-08-30T20:39:14 | 2021-08-30T20:39:14 | 401,479,774 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,744 | 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 edu.eci.arsw.blueprints.services;
import edu.eci.arsw.blueprints.filtroInter.Filtro;
import edu.eci.arsw.blueprints.model.Blueprint;
import edu.eci.arsw.blueprints.persistence.BlueprintNotFoundException;
import edu.eci.arsw.blueprints.persistence.BlueprintPersistenceException;
import edu.eci.arsw.blueprints.persistence.BlueprintsPersistence;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
*
* @author hcadavid
*/
@Service
public class BlueprintsServices {
@Autowired
BlueprintsPersistence bpp = null;
@Autowired
Filtro filtro = null;
/**
* Metodo encargado de adicionar un nuevo BluePrint
* @param bp
* @throws BlueprintPersistenceException
*/
public void addNewBlueprint(Blueprint bp) throws BlueprintPersistenceException{
bpp.saveBlueprint(bp);
}
/**
* Metodo encargado de modificar o adicionar un nuevo BluePrint
* @param bp
* @param author
* @param name
* @throws BlueprintPersistenceException
*/
public void modifyOrAddBlueprint(Blueprint bp, String author, String name) throws BlueprintPersistenceException{
bpp.modifyOrAddBlueprintS(bp, author, name);
}
/**
* Metodo encargado de traer todos los BluePrints
* @return Blueprint
* @throws BlueprintNotFoundException
*/
public Set<Blueprint> getAllBlueprints() throws BlueprintNotFoundException{
return bpp.getAllBluePrint();
}
/**
*
* @param author blueprint's author
* @param name blueprint's name
* @return the blueprint of the given name created by the given author
* @throws BlueprintNotFoundException if there is no such blueprint
*/
public Blueprint getBlueprint(String author,String name) throws BlueprintNotFoundException{
return bpp.getBlueprint(author , name);
}
/**
*
* @param author blueprint's author
* @return all the blueprints of the given author
* @throws BlueprintNotFoundException if the given author doesn't exist
*/
public Set<Blueprint> getBlueprintsByAuthor(String author) throws BlueprintNotFoundException{
return bpp.getBlueprintByAuthor(author);
}
/**
* Metodo encargado de filtrar el bluePrint
* @param bp
* @return
*/
public Blueprint filtrar(Blueprint bp){
return filtro.getBluePrintFiltrado(bp);
}
/**
* Metodo encargado de traer todos los planos filtrados
* @return
*/
public Set<Blueprint> getPlanosFiltrados(){
Set<Blueprint> planosFiltrados = new HashSet<Blueprint>();
Set<Blueprint> planosSinFiltro ;
try {
planosSinFiltro = getAllBlueprints();
for (Iterator it = planosSinFiltro.iterator(); it.hasNext(); ) {
Blueprint bp = (Blueprint)it.next();
planosFiltrados.add(filtrar(bp));
}
} catch (BlueprintNotFoundException ex) {
Logger.getLogger(BlueprintsServices.class.getName()).log(Level.SEVERE, null, ex);
}
return planosFiltrados;
}
/**
* Metodo encargado de eliminar el BluePrint
* @param author
* @param name
*/
public void deleteBlueprint(String author, String name){
bpp.deleteBluePrint(author, name);
}
}
| [
"juanpablo.arevalo.contractor@bbva.com"
] | juanpablo.arevalo.contractor@bbva.com |
a5604c9efcce8ddfb31c4c0bd1c3eb73e1e8e819 | 761b9071da2c4eef951dc35bc5a59aad56f5ac42 | /strings/UsernameChecker.java | 22ecc1f6957b1144918d93a0a961d5f76039cd3e | [] | no_license | nichiporenko/java-studying | 666755cd5ff4f7ea840ce753b2748117b1d48076 | d4b035e4361f8ffa7c1b6c9647da5344769fef7c | refs/heads/master | 2021-10-11T00:25:35.752663 | 2019-01-19T19:46:54 | 2019-01-19T19:46:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 839 | java | package strings;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* The username can contain alphanumeric characters and/or underscores(_).
* The username must start with an alphabetic character.
*/
class UsernameChecker {
static void getResult() {
Scanner in = new Scanner(System.in);
int testCases = Integer.parseInt(in.nextLine());
while (testCases > 0) {
String username = in.nextLine();
String pattern = "^[aA-zZ]\\w{7,29}$";
Pattern p = Pattern.compile(pattern);
Matcher matcher = p.matcher(username);
if (matcher.find()) {
System.out.println("Valid");
} else {
System.out.println("Invalid");
}
testCases--;
}
}
}
| [
"excelsiorious@gmail.com"
] | excelsiorious@gmail.com |
7b396334fb18188cf8105d2a10786a790b9609af | cef1892bf0d619d3dfcc3d28c523124b9d318ba7 | /hchp_server/src/com/zjht/asyniobiframework/callback/AsynIoClientJsonWriteCompletionHandler.java | 8cafe209e2c98abce83d6b890e026a8122e43081 | [] | no_license | wolfan1987/studys | 13a2b7ebff82aeb8f3b4f355f52714eddf18d75b | 6abf0cfe21b6c7bfa177dd7d0bf7504f90d11961 | refs/heads/master | 2020-03-08T13:23:56.240643 | 2018-08-14T07:54:12 | 2018-08-14T07:54:12 | 128,156,932 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 547 | java | package com.zjht.asyniobiframework.callback;
import java.nio.channels.AsynchronousSocketChannel;
import java.nio.channels.CompletionHandler;
public class AsynIoClientJsonWriteCompletionHandler implements CompletionHandler<Integer, AsynchronousSocketChannel>{
@Override
public void completed(Integer result,
AsynchronousSocketChannel attachment) {
System.out.println("发送json数据,结束!");
}
@Override
public void failed(Throwable exc, AsynchronousSocketChannel attachment) {
// TODO Auto-generated method stub
}
}
| [
"liudaan@chinaexpresscard.com"
] | liudaan@chinaexpresscard.com |
6dae4847bdb2fd94724e3508b68086197010e528 | 5f96c183d92c575f4e1a86388f5c4525d7d92bc5 | /app/src/test/java/example/codeclan/com/staff/ExampleUnitTest.java | 06149040bea1ec0201ab5975f79ab5d8ac2da9d2 | [] | no_license | clarkee013/staff | a4dd9f77f932d365e4998c128f21da49cc243eec | f37fb27e5e86e8a05f3b7db72c250cef16d497f1 | refs/heads/master | 2021-01-11T13:57:34.438374 | 2017-06-21T08:52:27 | 2017-06-21T08:52:27 | 94,911,605 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 404 | java | package example.codeclan.com.staff;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"clarkee013@gmail.com"
] | clarkee013@gmail.com |
1e37863ad9f9056aeaf864b795e15c3ec2bce02c | fc9cce67869e4490e92c7bce892a70b615cceaab | /src/main/java/com/kios/storage/entity/StorageUnit.java | 70cd1ab7ceb2a507093f06c93f733b2cb130f867 | [] | no_license | kios-software/storage-backend | 43a5491a80168516288d6d19fe06052ccf9fac86 | a24df2dac6719adbf76c6686bbe8c01108065da0 | refs/heads/master | 2022-09-19T00:16:22.142540 | 2020-05-22T00:29:36 | 2020-05-22T00:29:36 | 260,996,739 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,772 | java | package com.kios.storage.entity;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonManagedReference;
/*
* This class is a more specific drill down into the storage
* For example, if StorageClass is StorageClass.VEHICLE, then there will be
* some more specific details to narrow down what that means in terms of size
* (small, medium, large, etc.)
*/
@Entity
public class StorageUnit {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;
private StorageClass storageClass;
@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "storage_id")
@JsonBackReference(value = "storage-storage-unit")
private Storage storage;
@OneToOne
@JoinColumn(name = "property_id")
@JsonManagedReference(value = "storage-unit-property")
private Property property;
/* TODO: Clearly define the storage sizes somewhere */
private Size size;
public Long getId() {
return id;
}
public StorageClass getStorageClass() {
return storageClass;
}
public void setStorageClass(StorageClass storageClass) {
this.storageClass = storageClass;
}
public Size getSize() {
return size;
}
public void setSize(Size size) {
this.size = size;
}
public Storage getStorage() {
return storage;
}
public void setStorage(Storage storage) {
this.storage = storage;
}
public Property getProperty() {
return property;
}
public void setProperty(Property property) {
this.property = property;
}
} | [
"bostonjohn94@gmail.com"
] | bostonjohn94@gmail.com |
599b1dc9f307dc5ddcce0fe7254d515e3a341f3b | cdc1c94998a09c7b2ba05b7d9d96357d2284bf8b | /Greatest of two number/Main.java | 12644a664fd5fd605ddd403b311fcfb096df6299 | [] | no_license | SumaiyaRafeeq/Playground | 340a11954c0a3bbb1ba83f737db0152f40f815be | f209958229590013d7bb6bff44e2001bae463383 | refs/heads/master | 2020-06-09T12:14:51.577209 | 2019-07-27T06:51:10 | 2019-07-27T06:51:10 | 193,436,022 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 238 | java | #include<stdio.h>
int main()
{
int num1,num2;
scanf("%d%d",&num1,&num2);
if(num1>num2)
printf("num1 is the greatest");
else if(num1<num2)
printf("num2 is the greatest");
else
printf("Both number Equal");
return 0;
} | [
"51454367+SumaiyaRafeeq@users.noreply.github.com"
] | 51454367+SumaiyaRafeeq@users.noreply.github.com |
3f0fdf29b21f267d736e61641a1fb1f23833a504 | 683c88a690999fa0eeda5718f2eb478c7bd3e649 | /simple-read-display-csv/src/ReadFileWriteToConsole.java | 9dd39526e12e80daecf2fd4266b1720b1c365fa6 | [] | no_license | EmilyKraft/ProxorPractice | b2991de4b8a5c88444ddcac308d5e703f3aebd3d | 5199c788b4b572129fe2fc8a946302952a0713e1 | refs/heads/master | 2021-01-19T16:18:09.191228 | 2017-08-21T22:13:16 | 2017-08-21T22:13:16 | 100,996,105 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,382 | java | import java.io.FileNotFoundException;
import java.io.IOException;
import com.csvreader.CsvReader;
import com.csvreader.CsvWriter;
public class ReadFileWriteToConsole {
private static final int MAXROW = 3;
private static final int MAXCOL = 3;
private static final String inFile = "in.csv";
public String[][] sheet = new String[MAXROW][MAXCOL];
public static void main(String args[]) throws IOException {
// create a ReadWriteToConsole object
// Do not change the signature of this method.
// ... insert code here ...
// invoke readSheet()
// ... insert code here ...
// invoke writeSheet()
// ... insert code here ...
ReadFileWriteToConsole rwtc = new ReadFileWriteToConsole();
rwtc.readSheet();
rwtc.writeSheet();
}
public void readSheet() throws IOException {
// ... insert code here ...
CsvReader reader = new CsvReader(inFile);
int i = 0;
while(reader.readRecord()){
sheet[i] = reader.getRawRecord().split(",");
i++;
}
// Do not change the signature of this method.
}
public void writeSheet(){
// ... insert code here ...
int i = 0;
while (i < MAXCOL){
for (String string : sheet[i]){
System.out.print("["+string+"]");
}
System.out.println("");
i++;
// Do not change the signature of this method.
}
}
}
| [
"ejkraft1@cougars.ccis.edu"
] | ejkraft1@cougars.ccis.edu |
65c497ae94c2de8b4cdd9acb6f959d9c6219708e | 9157763f1f95f8d24a8106268ec49555d6368094 | /src/day07/Array03.java | 31dae18e1aadff76ce27e5b0735a9cd3a064ee14 | [] | no_license | kemgur/-JavaPracticeTurkishSpring | 582e12ebb1a6f2ae182c7e0685642ca283f1005d | 713551c151c09c13e1c55113f3828966f1b2b106 | refs/heads/main | 2023-03-17T10:17:08.857494 | 2021-03-08T06:01:26 | 2021-03-08T06:01:26 | 345,006,041 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 333 | java | package day07;
public class Array03 {
// Array elemanlarinin ortalamasini bulan java kodu yazalim.
// 20,30,40,25,-15,55
public static void main(String[] args) {
int sum =0;
int arr[]= {20,30,40,25,-15,55};
for (int i = 0; i < arr.length; i++) {
sum =sum +arr[i];
}
System.out.println(sum/arr.length);
}
}
| [
"kemgur52@gmail.com"
] | kemgur52@gmail.com |
e824311d2b3bc064d48136bbef738126a33bb066 | 68f3f3fe281c591d5c1b55465eb72c331dd13807 | /src/面试题/Test1.java | 1e226218d6fce6c10ffaca87615d6b6554e6c178 | [] | no_license | kingFeng666/DataStructs666 | 1250c544110473aa484110530635af1392bf294f | 84842cac6cb6f9489a642912a41fc2277619b920 | refs/heads/master | 2023-02-16T19:02:37.688119 | 2020-12-25T07:24:35 | 2020-12-25T07:24:35 | 308,400,492 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 900 | java | package 面试题;
/**
* @ClassName: Test1
* @Description:
* @Author: 李峰
* @Date: 2020 年 11月 29 19:18
* @Version 1.0
*/
import java.util.Scanner;
public class Test1 {
public static boolean judge(int number){
int count = 0;
for (int i = 2; i <number ; i++) {
if(number%i == 0){
count++;
if(count == 2){
return true;
}
}
}
return false;
}
public static void main(String[] args) {
int count = 0;
Scanner scanner = new Scanner(System.in);
int number = scanner.nextInt();
for (int i = 1; i <= number ; i++) {
if(judge(i)){
count++;
}
}
System.out.println(count);
}
}
| [
"1072784590@qq.com"
] | 1072784590@qq.com |
c6cb44e099aae6bfbe78415e3ad2eee605c1bca8 | 17e21f079ae8cabaaa56bae4441f0fc8e491d543 | /NetBeansProjects/TrackingPRoject/TrackingProject/src/logcode/ProjectLog.java | 9bf4a2a9dfc7095c136b3b52d9a24eb7ff38dcc4 | [] | no_license | arifikapm/realproject | 76e088c2e1e2da6135cf3d6e0071c6bb3b89581d | ced024f76237b459f62af2e4bff28bfb5469acb3 | refs/heads/master | 2020-04-12T08:25:06.734634 | 2019-05-05T06:00:40 | 2019-05-05T06:00:40 | 162,383,059 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 356 | 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 logcode;
/**
*
* @author kuupie
*/
public class ProjectLog {
public String logInsert;
public String logUpdate;
public String logDelete;
}
| [
"arifikapm93@gmail.com"
] | arifikapm93@gmail.com |
a0d49ade04009c288e280ec498fdd226d7b71d66 | d5cace40d435e48f5e5691a76cb56a1a1b3ba748 | /AP_Lesson_01/firstProg.java | bea370819e5b93181338b3d8a37c74bc83e0bca9 | [] | no_license | Opwoa/Hornilla_Joshua | 07079483296a568617b247bf90696df39d54d01b | d82551156e841e5a2816c209ffe0f71e3983906b | refs/heads/master | 2021-06-17T18:02:37.902827 | 2017-05-31T18:08:17 | 2017-05-31T18:08:17 | 67,533,191 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 614 | java | public class firstProg {
public static void main(String[]args) {
System.out.println(" .==.");
System.out.println(" ()''()-.");
System.out.println(" .---. ;--; /");
System.out.println(" .'_:___\". _..'. __'.");
System.out.println(" |__ --==|'-''' \'...;");
System.out.println(" [ ] :[| |---\\");
System.out.println(" |__| I=[| .' '.");
System.out.println(" / / ____| : '._");
System.out.println(" |-/.____.' | : :");
System.out.println(" /___\\ /___\\ '-'._----'");
}
} | [
"joshuahornilla@gmail.com"
] | joshuahornilla@gmail.com |
8d9a9367e67851f73eb2193824533ee7d330dc18 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-12584-2-3-NSGA_II-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/store/XWikiHibernateStore_ESTest_scaffolding.java | cd575d9c9a4248d66382bd0cca849b519f262008 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 443 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Wed Apr 01 14:54:37 UTC 2020
*/
package com.xpn.xwiki.store;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class XWikiHibernateStore_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
d30a72929af066b5cc6165eb6e55f8ee112a97db | 68296d704f28ab7f99d06a432b6a9900b246f290 | /Task_5/src/test/java/berezin/StackTest.java | 19e60e37e50a6d18f78f24a61190b92115d9c802 | [] | no_license | SuperArt3000/JavaSchool2021 | b47a6c59278dd960ddbb78e4fcc66f0b3326ca53 | a1c1246043512d1bcb915f570773613b49b098fa | refs/heads/main | 2023-05-14T15:12:53.657897 | 2021-06-08T04:50:54 | 2021-06-08T04:50:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,621 | java | package berezin;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
public class StackTest {
@Test
public void stackPushTopAndPopTest() throws QueueStackException {
Stack stack = new Stack(3);
Object obj1 = 1;
Object obj2 = 2;
Object obj3 = 3;
stack.push(obj1);
stack.push(obj2);
stack.push(obj3);
assertEquals(obj3, stack.pop());
assertEquals(obj2, stack.top());
assertEquals(obj2, stack.top());
}
@Test
public void stackPushErrorTest() {
Stack stack = new Stack(2);
try {
stack.push(1);
stack.push(2);
stack.push(3);
}catch (QueueStackException e){
assertEquals(ErrorCode.STACK_IS_FULL, e.getErrorCode());
}
}
@Test
public void stackPopErrorTest(){
Stack stack = new Stack(5);
try{
stack.pop();
}catch (QueueStackException e){
assertEquals(ErrorCode.STACK_IS_EMPTY, e.getErrorCode());
}
}
@Test
public void stackIsEmptyTest() throws QueueStackException {
Stack stack = new Stack(3);
assertTrue(stack.isEmpty());
}
@Test
public void stackIsEmptyPopTest() throws QueueStackException {
Stack stack = new Stack(3);
stack.push(1);
stack.pop();
assertTrue(stack.isEmpty());
}
@Test
public void stackNotEmptyTest() throws QueueStackException {
Stack stack = new Stack(3);
stack.push(22);
assertFalse(stack.isEmpty());
}
}
| [
"andreyberezin55@gmail.com"
] | andreyberezin55@gmail.com |
ef7430f856ac9833b20a4b8b64107dbefec3e140 | 9fd87f2d665338645a985b8889ce3b1f0807fa7a | /src/main/java/util/EndpointUtil.java | b3a038e05bc50f9b30fede7d92acf7754b7eae7f | [] | no_license | anapso/induccion-parte1 | 3ce6f5a2bf8c4fc845de6dc55222bf9f5ffe6708 | 190b926ba878d17e4672b54896eca4e6f9cc4b8d | refs/heads/master | 2023-02-27T23:30:19.978613 | 2021-02-08T21:08:20 | 2021-02-08T21:08:20 | 337,205,649 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 653 | java | package util;
import com.mercadopago.MercadoPago;
import com.mercadopago.exceptions.MPException;
public class EndpointUtil {
public static String CLIENT_ID = "3154206633105477";
public static String CLIENT_SECRET = "jA2md2jqhi26b5Le1ggXWw7ZRXdDtsPQ";
public static String ACCESS_TOKEN = "APP_USR-3154206633105477-012713-b7f50bc11b9e22e12e8301d4f5e9fd60-707289365";
public static void setUserCredentials() throws MPException {
MercadoPago.SDK.setClientId(EndpointUtil.CLIENT_ID);
MercadoPago.SDK.setClientSecret(EndpointUtil.CLIENT_SECRET);
MercadoPago.SDK.setAccessToken(EndpointUtil.ACCESS_TOKEN);
};
}
| [
"anasou@br0c02cr2t8md6n.ml.com"
] | anasou@br0c02cr2t8md6n.ml.com |
487d0285b04d575298a82ac3715cf92dc972b5fa | 60b2a94499d7221d85a5a68e832c1470ce5148d3 | /app-order/src/main/java/com/mdl/alkb/server/order/service/impl/BiDefOrderServiceImpl.java | 7b070096226097a39c550a65245cb18083e8a4a2 | [] | no_license | altraman00/alkb-cloud | e647d59e506652b03235dc958233a8d7a36c1468 | a8e8488efba73eca1823842ab107cdcded32ea15 | refs/heads/master | 2022-12-07T05:52:18.149992 | 2020-09-04T09:39:01 | 2020-09-04T09:39:01 | 291,645,962 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,269 | java | package com.mdl.alkb.server.order.service.impl;
import com.mdl.alkb.server.order.entity.BiDefOrderEntity;
import com.mdl.alkb.server.order.repository.BiDefOrderRepository;
import com.mdl.alkb.server.order.service.BiDefOrderService;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Project : cloudService
* @Package Name : com.mdl.alkb.fn.service
* @Description : TODO
* @Author : xiekun
* @Create Date : 2020年08月31日 14:50
* ----------------- ----------------- -----------------
*/
@Service
public class BiDefOrderServiceImpl implements BiDefOrderService {
@Autowired
private BiDefOrderRepository orderRepository;
@Override
public String findById(String id) {
Optional<BiDefOrderEntity> byId = orderRepository.findById(id);
String name = byId.get().getName();
BiDefOrderEntity byName = orderRepository.findByName(name);
String price = byName.getPrice();
List<BiDefOrderEntity> allByName = orderRepository.findAllByPrice(price);
String collect = allByName.stream().map(BiDefOrderEntity::getName).collect(Collectors.joining(","));
return collect;
}
}
| [
"kun.xie@mobvoi.com"
] | kun.xie@mobvoi.com |
996036fae458001f3370b86af5eae6d437c83fd4 | 0f9e34f15e5fcfaa1bf0aa49aa723e6541f87aa4 | /PCATool/app/src/main/java/br/uece/gesad/pcatoolbrasil/modelAntigo/BDOpenHelper.java | d1ea6f7d9fe2f5a35a4fc332bb770b96fd9b0073 | [] | no_license | AdsonRoberto/Projeto-Externo-PCATool | 4542f7b97af163dec473b08bcaf9d2d66cf50a02 | 3b5c667e29dc70a19a9d6a054b2b3986d123540a | refs/heads/master | 2022-06-23T21:48:47.986250 | 2022-06-13T12:21:32 | 2022-06-13T12:21:32 | 89,161,219 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,043 | java | package br.uece.gesad.pcatoolbrasil.modelAntigo;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
/**
* Created by Messias on 25/04/2017.
*/
public abstract class BDOpenHelper extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 1;
private static final String DATABASE_NAME = "Database_PCATool";
private Context context;
public static final String TABELA_REGIONAL = "regional";
public static final String ID_REGIONAL = "id_regional";
public static final String NOME_REGIONAL = "nome_regional";
public static final String ENDERECO_REGIONAL = "endereco_regional";
public static final String TABELA_POSTO = "posto";
public static final String ID_POSTO = "id_posto";
public static final String NOME_POSTO = "nome_posto";
public static final String ENDERECO_POSTO = "endereco_posto";
public static final String TABELA_QUESTAO = "questao";
public static final String ID_QUESTAO = "id_questao";
public static final String NUMERO_QUESTAO= "numero_questao";
public static final String DESCRICAO_QUESTAO = "descricao_questao";
public static final String TABELA_ENTREVISTADO = "entrevistado";
public static final String ID_ENTREVISTADO = "id_entrevistado";
public static final String NOME_ENTREVISTADO = "nome_entrevistado";
public static final String SEXO_ENTREVISTADO = "sexo_entrevistado";
public static final String DATA_NASCIMENTO = "data_nascimento";
public static final String TABELA_QUESTIONARIO = "questionario";
public static final String ID_QUESTIONARIO = "id_questionario";
public static final String DATA_REALIZACAO = "data_realizacao";
public static final String TIPO_QUESTIONARIO = "tipo_questionario";
public static final String TABELA_RESPOSTA = "resposta";
public static final String ID_RESPOSTA = "id_resposta";
public static final String OPCAO_RESPOTA = "opcao_resposta";
public static final String NOME_PROF_SERV = "nome_profissional_servico";
public static final String ENDERECO_RESPOSTA = "endereco_resposta";
public BDOpenHelper(Context context){
super(context, DATABASE_NAME, null, DATABASE_VERSION);
this.context = context;
}
@Override
public void onCreate(SQLiteDatabase db) {
String CREATE_TABLE_REGIONAL = "CREATE TABLE IF NOT EXISTS " + TABELA_REGIONAL + "(" +
ID_REGIONAL + " INTEGER PRIMARY KEY AUTOINCREMENT," +
NOME_REGIONAL + " TEXT," +
ENDERECO_REGIONAL + " TEXT)";
db.execSQL(CREATE_TABLE_REGIONAL);
String CREATE_TABLE_POSTO = "CREATE TABLE IF NOT EXISTS " + TABELA_POSTO + "(" +
ID_POSTO + " INTEGER PRIMARY KEY AUTOINCREMENT," +
ID_REGIONAL + " INTEGER NOT NULL," +
NOME_POSTO + " TEXT," +
ENDERECO_POSTO + " TEXT)";
db.execSQL(CREATE_TABLE_POSTO);
String CREATE_TABLE_QUESTAO = "CREATE TABLE IF NOT EXISTS " + TABELA_QUESTAO + "(" +
ID_QUESTAO + " INTEGER PRIMARY KEY AUTOINCREMENT," +
NUMERO_QUESTAO + " TEXT NOT NULL," +
DESCRICAO_QUESTAO + " TEXT)";
db.execSQL(CREATE_TABLE_QUESTAO);
String CREATE_TABLE_ENTREVISTADO = "CREATE TABLE IF NOT EXISTS " + TABELA_ENTREVISTADO + "(" +
ID_ENTREVISTADO + " INTEGER PRIMARY KEY AUTOINCREMENT," +
NOME_ENTREVISTADO + " TEX," +
SEXO_ENTREVISTADO + " TEX," +
DATA_NASCIMENTO + " TEXT)";
db.execSQL(CREATE_TABLE_ENTREVISTADO);
String CREATE_TABLE_QUESTIONARIO = "CREATE TABLE IF NOT EXISTS " + TABELA_QUESTIONARIO + "(" +
ID_QUESTIONARIO + " INTEGER PRIMARY KEY AUTOINCREMENT," +
ID_ENTREVISTADO + " INTEGER NOT NULL," +
ID_POSTO + " INTEGER NOT NULL," +
DATA_REALIZACAO + " TEXT," +
TIPO_QUESTIONARIO + " TEXT)";
db.execSQL(CREATE_TABLE_QUESTIONARIO);
String CREATE_TABLE_RESPOSTA = "CREATE TABLE IF NOT EXISTS " + TABELA_RESPOSTA + "(" +
ID_RESPOSTA + " INTEGER PRIMARY KEY AUTOINCREMENT," +
ID_QUESTAO + " INTEGER NOT NULL," +
ID_QUESTIONARIO + " INTEGER NOT NULL," +
OPCAO_RESPOTA + " INTEGER," +
NOME_PROF_SERV + " TEXT," +
ENDERECO_RESPOSTA + " TEXT)";
db.execSQL(CREATE_TABLE_RESPOSTA);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + TABELA_RESPOSTA);
db.execSQL("DROP TABLE IF EXISTS " + TABELA_QUESTIONARIO);
db.execSQL("DROP TABLE IF EXISTS " + TABELA_ENTREVISTADO);
db.execSQL("DROP TABLE IF EXISTS " + TABELA_QUESTAO);
db.execSQL("DROP TABLE IF EXISTS " + TABELA_POSTO);
db.execSQL("DROP TABLE IF EXISTS " + TABELA_REGIONAL);
this.onCreate(db);
}
}
| [
"messiasfilho17@hotmail.com"
] | messiasfilho17@hotmail.com |
653ade26c3b3975e114175eaae6e05681b02377c | 1b69646b8b265c598e13bab72a5d9270bee2fe34 | /src/com/vunke/shareHome/model/UserLoginLog.java | be4255c33f60cdd9900b3bbe9cbb602f6cdafb8d | [] | no_license | a1601501088/ShareHome-web | bb3cd8a59cbfb2cdb9f85eb2ba502289a98fbf00 | e45c3ef657edc9a76ead86967bc58c6ea43f4e7b | refs/heads/master | 2020-12-25T14:57:57.588981 | 2016-09-02T05:21:17 | 2016-09-02T05:21:17 | 67,192,011 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,380 | java | package com.vunke.shareHome.model;
import java.util.Calendar;
import java.util.Date;
public class UserLoginLog {
private String loginId;
private String userName;
private String userType;
private Date loginTime;
private String appVesionName;
private Date appMotifyTime;
private String appVesionCode;
private String userIp;
public UserLoginLog(String userName, String userType, String appVesionName, Date appMotifyTime, String appVesionCode, String userIp) {
Calendar calendar = Calendar.getInstance();
this.userName = userName;
this.userType = userType;
this.loginTime = calendar.getTime();
this.appVesionName = appVesionName;
this.appMotifyTime = appMotifyTime;
this.appVesionCode = appVesionCode;
this.userIp = userIp;
}
public UserLoginLog() {
}
public String getLoginId() {
return loginId;
}
public void setLoginId(String loginId) {
this.loginId = loginId == null ? null : loginId.trim();
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName == null ? null : userName.trim();
}
public String getUserType() {
return userType;
}
public void setUserType(String userType) {
this.userType = userType == null ? null : userType.trim();
}
public Date getLoginTime() {
return loginTime;
}
public void setLoginTime(Date loginTime) {
this.loginTime = loginTime;
}
public String getAppVesionName() {
return appVesionName;
}
public void setAppVesionName(String appVesionName) {
this.appVesionName = appVesionName == null ? null : appVesionName.trim();
}
public Date getAppMotifyTime() {
return appMotifyTime;
}
public void setAppMotifyTime(Date appMotifyTime) {
this.appMotifyTime = appMotifyTime;
}
public String getAppVesionCode() {
return appVesionCode;
}
public void setAppVesionCode(String appVesionCode) {
this.appVesionCode = appVesionCode == null ? null : appVesionCode.trim();
}
public String getUserIp() {
return userIp;
}
public void setUserIp(String userIp) {
this.userIp = userIp == null ? null : userIp.trim();
}
} | [
"1601501088@qq.com"
] | 1601501088@qq.com |
048d9af26435185bef33d59f4220203dce1697e0 | d16724e97358f301e99af0687f5db82d9ac4ff7e | /rawdata/java/snippets/243.java | 8fbbbdf36678ce89d11ce531a1289bdf87d24a54 | [] | no_license | kaushik-rohit/code2seq | 39b562f79e9555083c18c73c05ffc4f379d1f3b8 | c942b95d7d5997e5b2d45ed8c3161ca9296ddde3 | refs/heads/master | 2022-11-29T11:46:43.105591 | 2020-01-04T02:04:04 | 2020-01-04T02:04:04 | 225,870,854 | 0 | 0 | null | 2022-11-16T09:21:10 | 2019-12-04T13:12:59 | C# | UTF-8 | Java | false | false | 215 | java | void add(long value) {
if (value >= 0) {
if (count > 0) {
min = Math.min(min, value);
max = Math.max(max, value);
} else {
min = value;
max = value;
}
count++;
sum += value;
}
} | [
"kaushikrohit325@gmail.com"
] | kaushikrohit325@gmail.com |
5db7f147651152852c67264af552825730717358 | 92a796158b3539c9ad13cc59c008d327b99027a3 | /src/main/java/com/haoyu/family_blog/Service/IBlogVisitLogService.java | 6925380ee55cf29bebf6d5f8401fa701487eea58 | [] | no_license | HYWuCharles/FamilyBlogBackend | 95c5eed57734e56617af26153d1a4228e452995a | e00661ae3878bc150daa048a9b3d14338793fcd1 | refs/heads/master | 2022-06-16T10:16:03.032338 | 2020-05-05T03:20:49 | 2020-05-05T03:20:49 | 260,851,419 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 500 | java | package com.haoyu.family_blog.Service;
import com.haoyu.family_blog.Model.BlogVisitLog;
import java.util.List;
/**
* Created by Haoyu WU on 2020/4/24.
*/
public interface IBlogVisitLogService {
void insertNewLog(Long userId, Long blogId);
void deleteSingleLogByUserIdAndBlogId(Long userId, Long blogId);
void hideSingleBlogVisitById(Long id);
List<BlogVisitLog> findAllHistory(Long userId);
List<BlogVisitLog> findHistoryByPage(Long userId, int pageNum, int pageSize);
}
| [
"haoyuwu1996@gmail.com"
] | haoyuwu1996@gmail.com |
c1ba798c87d297555e522524941ed7b41af15cd5 | 9819a1b0f3fc4855407d58a30ed8f44008c96c5b | /src/main/java/com/personal/application/repository/UserRepository.java | fe876023c22cf8af6ed191e3340bb32c60e6a421 | [] | no_license | wenlvp/- | a29b21fb90f4c3fc3a41788b9dd88fea0bece527 | 3dfc58d33318a3a792ad3ed675d79cadd88da870 | refs/heads/master | 2021-01-19T08:30:26.736735 | 2019-04-07T11:23:44 | 2019-04-07T11:23:44 | 87,639,287 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 231 | java | package com.personal.application.repository;
import com.personal.application.pojo.UserInfo;
import org.springframework.data.jpa.repository.JpaRepository;
public interface UserRepository extends JpaRepository<UserInfo,String> {
}
| [
"2377685674@qq.com"
] | 2377685674@qq.com |
01461880d09a17052e1ee540811c56261e4412e0 | b37211455063134cbb72507900f1f5155d900d8a | /UsefeelingCabinStillAndroid/src/com/usefeeling/android/cabinstill/imageloader/ImageDisplayer.java | 3f9d0e51d0c2de2cb4acb9bb661171d15f674c60 | [] | no_license | moisesvilar/usefeeling | 2bc3fd4d25df72932236afea6463e77faabb5b2d | c2eec00fdab58638885a02f2df74b4fc06bd9afe | refs/heads/master | 2021-07-06T12:04:09.968442 | 2017-01-03T10:20:52 | 2017-01-03T10:20:52 | 17,287,392 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 635 | java | package com.usefeeling.android.cabinstill.imageloader;
import android.graphics.Bitmap;
import android.widget.ImageView;
public class ImageDisplayer implements Runnable {
private Bitmap mBitmap;
private ImageView mItem;
/**
* Constructor.
* @param context Contexto.
* @param _bitmap Imagen.
* @param _overlayItem Widget donde se visualizará la imagen.
*/
public ImageDisplayer(Bitmap _bitmap, ImageView _overlayItem) {
this.mBitmap = _bitmap;
this.mItem = _overlayItem;
}
@Override
public void run() {
if (this.mBitmap != null && this.mItem != null) {
this.mItem.setImageBitmap(this.mBitmap);
}
}
}
| [
"moisvv@gmail.com"
] | moisvv@gmail.com |
3ab7e753bca2c24e3f2f2ed425aeeab748beb97d | fc774e1fca69ed132cb54efb5a35b48a4bbc2594 | /app/src/main/java/com/example/together/activities/ChatListActivity.java | b56cba45152c5b3e7f6d18dca30ad984858da588 | [
"MIT"
] | permissive | JDhyeok/opensource-project-Together | 2d6b40c5eda06d9e01f8cdae6c3965c6f5ba3ac4 | caced0e0bc612d1ed2bc346ba3b7832f9023083a | refs/heads/main | 2023-05-28T19:09:06.527370 | 2021-06-09T09:07:33 | 2021-06-09T09:07:33 | 363,541,633 | 0 | 4 | MIT | 2021-06-07T16:18:08 | 2021-05-02T01:22:15 | Java | UTF-8 | Java | false | false | 881 | java | package com.example.together.activities;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import com.example.together.R;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
public class ChatListActivity extends AppCompatActivity {
private FirebaseAuth mAuth;
private FirebaseDatabase mDatabase;
private DatabaseReference mRef;
private Toolbar mToolbar;
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
mAuth = FirebaseAuth.getInstance();
mDatabase = FirebaseDatabase.getInstance();
mRef = mDatabase.getReference("ChatRoom");
setContentView(R.layout.activity_chat_list);// UI view
}
}
| [
"show3391@gmail.com"
] | show3391@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.