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
b03135981c0218d3764dde861527d2df1eee168f
473b76b1043df2f09214f8c335d4359d3a8151e0
/benchmark/bigclonebenchdata_partial/8139665.java
b344b0e79a78382d355546f9c361fe14bfb713f2
[]
no_license
whatafree/JCoffee
08dc47f79f8369af32e755de01c52d9a8479d44c
fa7194635a5bd48259d325e5b0a190780a53c55f
refs/heads/master
2022-11-16T01:58:04.254688
2020-07-13T20:11:17
2020-07-13T20:11:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,766
java
class c8139665 { public ActionResponse executeAction(ActionRequest request) throws Exception { BufferedReader in = null; try { CurrencyEntityManager em = new CurrencyEntityManager(); String id = (String) request.getProperty("ID"); CurrencyMonitor cm = getCurrencyMonitor(em, Long.valueOf(id)); String code = cm.getCode(); if (code == null || code.length() == 0) code = DEFAULT_SYMBOL; String tmp = URL.replace("@", code); ActionResponse resp = new ActionResponse(); URL url = new URL(tmp); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); int status = conn.getResponseCode(); if (status == 200) { in = new BufferedReader(new InputStreamReader(conn.getInputStream())); StringBuilder value = new StringBuilder(); while (true) { String line = in.readLine(); if (line == null) break; value.append(line); } cm.setLastUpdateValue(new BigDecimal(value.toString())); cm.setLastUpdateTs(new Date()); em.updateCurrencyMonitor(cm); resp.addResult("CURRENCYMONITOR", cm); } else { resp.setErrorCode(ActionResponse.GENERAL_ERROR); resp.setErrorMessage("HTTP Error [" + status + "]"); } return resp; } catch (Exception e) { String st = MiscUtils.stackTrace2String(e); logger.error(st); throw e; } finally { if (in != null) { in.close(); } } } }
[ "piyush16066@iiitd.ac.in" ]
piyush16066@iiitd.ac.in
f9fdec7a519f0155f0d8c65feffe5729fdf486ca
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/10/10_5d6bb3dfac1edadf4894967583023f6877b24c02/E9v3/10_5d6bb3dfac1edadf4894967583023f6877b24c02_E9v3_s.java
d88039740907cbdbb2d5022521cc927bf62ec924
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
39,294
java
package eval.e9; import state4.BitUtil; import state4.Masks; import state4.MoveEncoder; import state4.State4; import eval.Evaluator3; import eval.PositionMasks; import eval.ScoreEncoder; public final class E9v3 implements Evaluator3{ //evaluation stage flags, used to denote which eval stage is complete private final static int stage1Flag = 1 << 0; private final static int stage2Flag = 1 << 1; private final static int stage3Flag = 1 << 2; private final static int evalCompleteMask = stage1Flag | stage2Flag | stage3Flag; /** * gives bonus multiplier to the value of sliding pieces * mobilitiy scores based on how cluttered the board is * <p> * sliding pieces with high movement on a clutterd board * are more valuable * <p> * indexed [num-pawn-attacked-squares] */ private final static double[] clutterIndex; private final static int[] kingDangerTable; private final static int[] materialWeights = new int[7]; private final static int tempoWeight = S(14, 5); private final static int bishopPairWeight = S(10, 42); private final static int[][] mobilityWeights = new int[7][]; private final static int[][] isolatedPawns = new int[][]{{ S(-15,-10), S(-18,-15), S(-20,-19), S(-22,-20), S(-22,-20), S(-20,-19), S(-18,-15), S(-15,-10)}, {S(-10, -14), S(-17, -17), S(-17, -17), S(-17, -17), S(-17, -17), S(-17, -17), S(-17, -17), S(-10, -14)}, }; private final static int[] pawnChain = new int[]{ S(13,0), S(15,0), S(18,1), S(22,5), S(22,5), S(18,1), S(15,0), S(13,0) }; private final static int[][] doubledPawns = new int[][]{ {S(-9,-18), S(-12,-19), S(-13,-19), S(-13,-19), S(-13,-19), S(-13,-19), S(-12,-19), S(-12,-18)}, {S(-6,-13), S(-8,-16), S(-9,-17), S(-9,-17), S(-9,-17), S(-9,-17), S(-8,-16), S(-6,-13)}, }; private final static int[][] backwardPawns = new int[][]{ {S(-10,-20),S(-10,-20),S(-10,-20),S(-10,-20),S(-10,-20),S(-10,-20),S(-10,-20),S(-10,-20),}, {S(-6,-13),S(-6,-13),S(-6,-13),S(-6,-13),S(-6,-13),S(-6,-13),S(-6,-13),S(-6,-13),}, }; private final static int[][] pawnShelter = new int[][]{ //only need 7 indeces, pawn cant be on last row {0, 30, 20, 8, 2, 0, 0}, {0, 75, 38, 20, 5, 0, 0}, //{0, 61, 45, 17, 5, 0, 0}, //{0, 141, 103, 39, 13, 0, 0}, }; private final static int[][] pawnStorm = new int[][]{ //indexed [type][distance] {-25, -20, -18, -14, -8, 0}, //no allied pawn {-20, -18, -14, -10, -6, 0}, //has allied pawn, enemy not blocked {-10, -8, -6, -4, -1, 0}, //enemy pawn blocked by allied pawn }; private final static int[][] kingDangerSquares = { { 2, 0, 2, 3, 3, 2, 0, 2, 2, 2, 4, 8, 8, 4, 2, 2, 7, 10, 12, 12, 12, 12, 10, 7, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 }, new int[64] }; private final static int[] zeroi = new int[2]; private final int[] materialScore = new int[2]; /** margin for scaling scores from midgame to endgame * <p> calculated by difference between midgame and endgame material*/ private final int scaleMargin; private final int endMaterial; /** stores score for non-pawn material*/ private final int[] nonPawnMaterial = new int[2]; /** stores attack mask for all pieces for each player, indexed [player][piece-type]*/ private final long[] attackMask = new long[2]; //cached values /** stores total king distance from allied pawns*/ private final int[] kingPawnDist = new int[2]; private final PawnHash pawnHash; final PawnHashEntry filler = new PawnHashEntry(); static{ //clutterIndex calculated by linear interpolation clutterIndex = new double[64]; final double start = .9; final double end = 1.1; final double diff = end-start; for(int a = 0; a < 64; a++){ clutterIndex[a] = start + diff*(a/64.); } kingDangerTable = new int[128]; final int maxSlope = 30; final int maxDanger = 1280; for(int x = 0, i = 0; i < kingDangerTable.length; i++){ x = Math.min(maxDanger, Math.min((int)(i*i*.4), x + maxSlope)); kingDangerTable[i] = S(-x, 0); } for(int a = 0; a < 64; a++) kingDangerSquares[1][a] = kingDangerSquares[0][63-a]; materialWeights[State4.PIECE_TYPE_QUEEN] = 900; materialWeights[State4.PIECE_TYPE_ROOK] = 470; materialWeights[State4.PIECE_TYPE_BISHOP] = 306; materialWeights[State4.PIECE_TYPE_KNIGHT] = 301; materialWeights[State4.PIECE_TYPE_PAWN] = 100; mobilityWeights[State4.PIECE_TYPE_KNIGHT] = new int[]{ S(-19,-49), S(-13,-40), S(-6,-27), S(-1,0), S(7,2), S(12,10), S(14,28), S(16,44), S(17,48) }; mobilityWeights[State4.PIECE_TYPE_BISHOP] = new int[]{ S(-13,-30), S(-6,-20), S(1,-18), S(7,-10), S(15,-1), S(24,8), S(28,14), S(24,18), S(30,20), S(34,23), S(38,25), S(43,31), S(49,32), S(55,37), S(55,38), S(55,38) }; mobilityWeights[State4.PIECE_TYPE_ROOK] = new int[]{ S(-10,-69), S(-7,-47), S(-4,-43), S(-1,-10), S(2,13), S(5,26), S(7,35), S(10,43), S(11,50), S(12,56), S(12,60), S(13,63), S(14,66), S(15,69), S(15,74), S(17,74) }; mobilityWeights[State4.PIECE_TYPE_QUEEN] = new int[]{ S(-6,-69), S(-4,-49), S(-2,-45), S(-2,-28), S(-1,-9), S(0,10), S(1,15), S(2,20), S(4,25), S(5,30), S(6,30), S(7,30), S(8,30), S(8,30), S(9,30), S(10,35), S(12,35), S(14,35), S(15,35), S(15,35), S(15,35), S(15,35), S(15,35), S(15,35), S(15,35), S(15,35), S(15,35), S(15,35), S(15,35), S(15,35), S(15,35), S(15,35) }; } public E9v3(){ this(16); } public E9v3(int pawnHashSize){ int startMaterial = ( materialWeights[State4.PIECE_TYPE_PAWN]*8 + materialWeights[State4.PIECE_TYPE_KNIGHT]*2 + materialWeights[State4.PIECE_TYPE_BISHOP]*2 + materialWeights[State4.PIECE_TYPE_ROOK]*2 + materialWeights[State4.PIECE_TYPE_QUEEN] ) * 2; endMaterial = ( materialWeights[State4.PIECE_TYPE_ROOK] + materialWeights[State4.PIECE_TYPE_QUEEN] ) * 2; scaleMargin = scaleMargin(startMaterial, endMaterial); pawnHash = new PawnHash(pawnHashSize, 16); } /** build a weight scaling from passed start,end values*/ private static int S(int start, int end){ return Weight.encode(start, end); } /** build a constant, non-scaling weight*/ private static int S(final int v){ return Weight.encode(v); } /** calculates the scale margin to use in {@link #getScale(int, int, int)}*/ private static int scaleMargin(final int startMaterial, final int endMaterial){ return endMaterial-startMaterial; } /** gets the interpolatino factor for the weight*/ private static double getScale(final int totalMaterialScore, final int endMaterial, final int margin){ return min(1-(endMaterial-totalMaterialScore)*1./margin, 1); } @Override public int eval(final int player, final State4 s) { return refine(player, s, -90000, 90000, 0); } @Override public int eval(final int player, final State4 s, final int lowerBound, final int upperBound) { return refine(player, s, lowerBound, upperBound, 0); } @Override public int refine(final int player, final State4 s, final int lowerBound, final int upperBound, final int scoreEncoding) { int score = ScoreEncoder.getScore(scoreEncoding); int margin = ScoreEncoder.getMargin(scoreEncoding); int flags = ScoreEncoder.getFlags(scoreEncoding); if((flags != 0 && (score+margin <= lowerBound || score+margin >= upperBound)) || (evalCompleteMask & flags) == evalCompleteMask){ return scoreEncoding; } final int totalMaterialScore = materialScore[0]+materialScore[1]; final double scale = getScale(totalMaterialScore, endMaterial, scaleMargin); final int pawnType = State4.PIECE_TYPE_PAWN; final int pawnWeight = materialWeights[pawnType]; nonPawnMaterial[0] = materialScore[0]-s.pieceCounts[0][pawnType]*pawnWeight; nonPawnMaterial[1] = materialScore[1]-s.pieceCounts[1][pawnType]*pawnWeight; final long alliedQueens = s.queens[player]; final long enemyQueens = s.queens[1-player]; final long queens = alliedQueens | enemyQueens; if(flags == 0){ flags |= stage1Flag; //load hashed pawn values, if any final long pawnZkey = s.pawnZkey(); final PawnHashEntry phEntry = pawnHash.get(pawnZkey); final PawnHashEntry loader; if(phEntry == null){ filler.passedPawns = 0; filler.zkey = 0; loader = filler; } else{ loader = phEntry; } //System.out.println("material score = "+(materialScore[player] - materialScore[1-player])); int stage1Score = S(materialScore[player] - materialScore[1-player]); stage1Score += tempoWeight; if(s.pieceCounts[player][State4.PIECE_TYPE_BISHOP] == 2){ stage1Score += bishopPairWeight; } if(s.pieceCounts[1-player][State4.PIECE_TYPE_BISHOP] == 2){ stage1Score += -bishopPairWeight; } stage1Score += scorePawns(player, s, loader, enemyQueens) - scorePawns(1-player, s, loader, alliedQueens); if(phEntry == null){ //store newly calculated pawn values loader.zkey = pawnZkey; pawnHash.put(pawnZkey, loader); } final int stage1MarginLower; //margin for a lower cutoff final int stage1MarginUpper; //margin for an upper cutoff if(alliedQueens != 0 && enemyQueens != 0){ //both sides have queen, apply even margin stage1MarginLower = 120; stage1MarginUpper = -120; } else if(alliedQueens != 0){ //score will be higher because allied queen, no enemy queen stage1MarginLower = 140; stage1MarginUpper = -100; } else if(enemyQueens != 0){ //score will be lower because enemy queen, no allied queen stage1MarginLower = 100; stage1MarginUpper = -140; } else{ stage1MarginLower = 90; stage1MarginUpper = -90; } score = Weight.interpolate(stage1Score, scale) + Weight.interpolate(S((int)(Weight.egScore(stage1Score)*.1), 0), scale); if(score+stage1MarginLower <= lowerBound){ return ScoreEncoder.encode(score, stage1MarginLower, flags); } if(score+stage1MarginUpper >= upperBound){ return ScoreEncoder.encode(score, stage1MarginUpper, flags); } } if((flags & stage2Flag) == 0){ flags |= stage2Flag; final long whitePawnAttacks = Masks.getRawPawnAttacks(0, s.pawns[0]); final long blackPawnAttacks = Masks.getRawPawnAttacks(1, s.pawns[1]); final long pawnAttacks = whitePawnAttacks | blackPawnAttacks; final double clutterMult = clutterIndex[(int)BitUtil.getSetBits(pawnAttacks)]; final int stage2Score = scoreMobility(player, s, clutterMult, nonPawnMaterial, attackMask) - scoreMobility(1-player, s, clutterMult, nonPawnMaterial, attackMask); score += Weight.interpolate(stage2Score, scale) + Weight.interpolate(S((int)(Weight.egScore(stage2Score)*.1), 0), scale); if(queens == 0){ flags |= stage3Flag; return ScoreEncoder.encode(score, 0, flags); } else{ //stage 2 margin related to how much we expect the score to change //maximally due to king safety final int stage2MarginLower; final int stage2MarginUpper; if(alliedQueens != 0 && enemyQueens != 0){ //both sides have queen, apply even margin stage2MarginLower = 80; stage2MarginUpper = -50; } else if(alliedQueens != 0){ //score will be higher because allied queen, no enemy queen stage2MarginLower = 110; stage2MarginUpper = -20; } else{ //score will be lower because enemy queen, no allied queen stage2MarginLower = 50; stage2MarginUpper = -70; } if(score+stage2MarginLower <= lowerBound){ return ScoreEncoder.encode(score, stage2MarginLower, flags); } if(score+stage2MarginUpper >= upperBound){ return ScoreEncoder.encode(score, stage2MarginUpper, flags); } else{ flags |= stage3Flag; //margin cutoff failed, calculate king safety scores final int stage3Score = evalKingSafety(player, s, alliedQueens, enemyQueens); score += Weight.interpolate(stage3Score, scale) + Weight.interpolate(S((int)(Weight.egScore(stage3Score)*.1), 0), scale); return ScoreEncoder.encode(score, 0, flags); } } } if((flags & stage3Flag) == 0){ assert queens != 0; //should be caugt by stage 2 eval if queens == 0 flags |= stage3Flag; final long whitePawnAttacks = Masks.getRawPawnAttacks(0, s.pawns[0]); final long blackPawnAttacks = Masks.getRawPawnAttacks(1, s.pawns[1]); final long pawnAttacks = whitePawnAttacks | blackPawnAttacks; final double clutterMult = clutterIndex[(int)BitUtil.getSetBits(pawnAttacks)]; //recalculate attack masks scoreMobility(player, s, clutterMult, nonPawnMaterial, attackMask); scoreMobility(1-player, s, clutterMult, nonPawnMaterial, attackMask); final int stage3Score = evalKingSafety(player, s, alliedQueens, enemyQueens); score += Weight.interpolate(stage3Score, scale) + Weight.interpolate(S((int)(Weight.egScore(stage3Score)*.1), 0), scale); return ScoreEncoder.encode(score, 0, flags); } //evaluation should complete in one of the stages above assert false; return 0; } private int evalKingSafety(final int player, final State4 s, final long alliedQueens, final long enemyQueens){ int score = 0; if(enemyQueens != 0){ final long king = s.kings[player]; final int kingIndex = BitUtil.lsbIndex(king); score += evalKingPressure3(kingIndex, player, s, attackMask[player]); } if(alliedQueens != 0){ final long king = s.kings[1-player]; final int kingIndex = BitUtil.lsbIndex(king); score -= evalKingPressure3(kingIndex, 1-player, s, attackMask[1-player]); } return score; } /** scores pawn structure*/ private int scorePawns(final int player, final State4 s, final PawnHashEntry entry, final long enemyQueens){ int score = 0; //get pawn scores from hash entry, or recalculate if necessary final long pawnZkey = s.pawnZkey(); if(pawnZkey != entry.zkey){ score += calculatePawnScore(player, s, entry); final long king = s.kings[player]; final int kingIndex = BitUtil.lsbIndex(king); int kingDangerScore = 0; if(enemyQueens != 0){ //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // NOTE: hashing here doesnt actually take being able to castle into account // however, doesnt seem to affect playing strength //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //pawn wall, storm calculations final long cmoves = State4.getCastleMoves(player, s); int pawnWallBonus = pawnShelterStormDanger(player, s, kingIndex); if(cmoves != 0){ //if we can castle, count the pawn wall/storm weight as best available after castle if((castleOffsets[0][player] & cmoves) != 0){ final int leftIndex = castleIndex[0][player]; final int leftScore = pawnShelterStormDanger(player, s, leftIndex); pawnWallBonus = leftScore > pawnWallBonus? leftScore: pawnWallBonus; } if((castleOffsets[1][player] & cmoves) != 0){ final int rightIndex = castleIndex[1][player]; final int rightScore = pawnShelterStormDanger(player, s, rightIndex); pawnWallBonus = rightScore > pawnWallBonus? rightScore: pawnWallBonus; } } kingDangerScore += S(pawnWallBonus, 0); } kingDangerScore += S(-kingDangerSquares[player][kingIndex], 0); kingDangerScore += S(0, centerDanger[kingIndex]); if(player == 0) entry.score1 += kingDangerScore; else entry.score2 += kingDangerScore; score += kingDangerScore; } else{ score += player == 0? entry.score1: entry.score2; } //score passed pawns final long alliedPawns = s.pawns[player]; final long passedPawns = entry.passedPawns & alliedPawns; if(passedPawns != 0){ for(long pp = passedPawns; pp != 0; pp &= pp-1){ final long p = pp & -pp; score += analyzePassedPawn(player, p, s, nonPawnMaterial); } } //adjustments for non-pawn disadvantage final boolean nonPawnDisadvantage = nonPawnMaterial[player]-nonPawnMaterial[1-player]+20 < 0; if(nonPawnDisadvantage){ final double npDisMult = max(min(nonPawnMaterial[1-player]-nonPawnMaterial[player], 300), 0)/300.; if(player == 0){ score += Weight.multWeight(S(-10, -20), npDisMult*entry.isolatedPawns1); score += Weight.multWeight(S(-10, -10), npDisMult*entry.doubledPawns1); score += Weight.multWeight(S(-10, -10), npDisMult*entry.backwardPawns1); } else{ score += Weight.multWeight(S(-10, -20), npDisMult*entry.isolatedPawns2); score += Weight.multWeight(S(-10, -10), npDisMult*entry.doubledPawns2); score += Weight.multWeight(S(-10, -10), npDisMult*entry.backwardPawns2); } } //System.out.println(player+" pawn score = ("+mgScore(score)+", "+egScore(score)+")"); return score; } private static int max(final int a1, final int a2){ return a1 > a2? a1: a2; } private static int analyzePassedPawn(final int player, final long p, final State4 s, final int[] nonPawnMaterial){ int passedPawnSore = 0; final int pawnIndex = BitUtil.lsbIndex(p); //agg.add(this.p.passedPawnRowWeight[player][index >>> 3]);s final int row = player == 0? pawnIndex>>>3: 7-(pawnIndex>>>3); final int pawnDist = 7-row; //distance of pawn from promotion square assert (Masks.passedPawnMasks[player][pawnIndex] & s.pawns[1-player]) == 0; //calculate king distance to promote square final int kingIndex = BitUtil.lsbIndex(s.kings[1-player]); final int kingXDist = Math.abs(kingIndex%8 - pawnIndex%8); final int promoteRow = 1-player == 0? 7: 0; final int kingYDist = Math.abs((kingIndex>>>3) - promoteRow); final int enemyKingDist = kingXDist > kingYDist? kingXDist: kingYDist; //our pawn closer to promotion than enemy king if(pawnDist < enemyKingDist){ final int diff = enemyKingDist-pawnDist; assert diff < 8; passedPawnSore += S(0, max(diff*diff, 15)); } //pawn closer than enemy king and no material remaining if(pawnDist < enemyKingDist && nonPawnMaterial[1-player] == 0){ passedPawnSore += S(500); } //checks for support by same color bishop //performs badly by several indications /*final int endIndex = index%8 + (player == 0? 56: 0); final int endColor = PositionMasks.squareColor(endIndex); final int enemyBishopSupport = -25; final long squareMask = PositionMasks.bishopSquareMask[endColor]; if((s.bishops[1-player] & squareMask) != 0){ //allied supporting bishop agg.add(0, enemyBishopSupport/(pawnDist*pawnDist)); }*/ final int rr = row*(row-1); final int start = 16*rr/2; final int end = 10*(rr+row+1)/2; passedPawnSore += S(start, end); //checks for pawn advancement blocked final long nextPos = player == 0? p << 8: p >>> 8; final long allPieces = s.pieces[0]|s.pieces[1]; if((nextPos & allPieces) != 0){ //pawn adancement blocked passedPawnSore += S(-start/6/pawnDist, -end/6/pawnDist); //slight bonus for causing a piece to keep blocking a pawn, //(w0,w1,d) = (111,134,126) without-with, depth=3 if((nextPos & s.queens[1-player]) != 0) passedPawnSore += S(45/pawnDist); else if((nextPos & s.rooks[1-player]) != 0) passedPawnSore += S(35/pawnDist); //else if((nextPos & s.bishops[1-player]) != 0) passedPawnSore += S(25/pawnDist); //else if((nextPos & s.knights[1-player]) != 0) passedPawnSore += S(25/pawnDist); } //checks to see whether we have a non-pawn material disadvantage, //its very hard to keep a passed pawn when behind //final int nonPawnMaterialDiff = nonPawnMaterial[player]-nonPawnMaterial[1-player]; final double npDisMult = max(min(nonPawnMaterial[1-player]-nonPawnMaterial[player], 300), 0)/300.; passedPawnSore += Weight.multWeight(S(-start*2/3, -end*2/3), npDisMult); //passed pawn supported by rook bonus if((s.rooks[player] & PositionMasks.opposedPawnMask[1-player][pawnIndex]) != 0){ //agg.add(10/pawnDist); } final boolean chain = (PositionMasks.pawnChainMask[player][pawnIndex] & s.pawns[player]) != 0; if(chain){ passedPawnSore += S(35/pawnDist); } return passedPawnSore; } private static double min(final double d1, final double d2){ return d1 < d2? d1: d2; } private static double max(final double d1, final double d2){ return d1 > d2? d1: d2; } /** determines pawn score, except for passed pawns*/ private static int calculatePawnScore(final int player, final State4 s, final PawnHashEntry phEntry){ int pawnScore = 0; long passedPawns = 0; int isolatedPawnsCount = 0; int doubledPawnsCount = 0; int backwardPawnsCount = 0; final long enemyPawns = s.pawns[1-player]; final long alliedPawns = s.pawns[player]; final long all = alliedPawns | enemyPawns; final int kingIndex = BitUtil.lsbIndex(s.kings[player]); int kingDistAgg = 0; //king distance aggregator for(long pawns = alliedPawns; pawns != 0; pawns &= pawns-1){ final long p = pawns & -pawns; final int index = BitUtil.lsbIndex(pawns); final int col = index%8; final boolean passed = (Masks.passedPawnMasks[player][index] & enemyPawns) == 0; final boolean isolated = (PositionMasks.isolatedPawnMask[col] & alliedPawns) == 0; final boolean opposed = (PositionMasks.opposedPawnMask[player][index] & enemyPawns) != 0; final int opposedFlag = opposed? 1: 0; final boolean chain = (PositionMasks.pawnChainMask[player][index] & alliedPawns) != 0; final boolean doubled = (PositionMasks.opposedPawnMask[player][index] & alliedPawns) != 0; if(passed){ passedPawns |= p; } if(isolated){ pawnScore += isolatedPawns[opposedFlag][col]; isolatedPawnsCount++; } if(doubled){ pawnScore += doubledPawns[opposedFlag][col]; doubledPawnsCount++; } if(chain){ pawnScore += pawnChain[col]; } //backward pawn checking final long attackSpan = PositionMasks.isolatedPawnMask[col] & Masks.passedPawnMasks[player][index]; if(!passed && !isolated && !chain && (attackSpan & enemyPawns) != 0 && //enemy pawns that can attack our pawns (PositionMasks.pawnAttacks[player][index] & enemyPawns) == 0){ //not attacking enemy pawns long b = PositionMasks.pawnAttacks[player][index]; while((b & all) == 0){ b = player == 0? b << 8: b >>> 8; assert b != 0; } final boolean backward = ((b | (player == 0? b << 8: b >>> 8)) & enemyPawns) != 0; if(backward){ pawnScore += backwardPawns[opposedFlag][col]; backwardPawnsCount++; } } //allied king distance, used to encourage king supporting pawns in endgame final int kingXDist = Math.abs(kingIndex%8 - index%8); final int kingYDist = Math.abs((kingIndex>>>3) - (index>>>3)); final int alliedKingDist = kingXDist > kingYDist? kingXDist: kingYDist; assert alliedKingDist < 8; kingDistAgg += alliedKingDist-1; } //minimize avg king dist from pawns in endgame final double n = s.pieceCounts[player][State4.PIECE_TYPE_PAWN]; if(n > 0) pawnScore += S(0, (int)(-kingDistAgg/n*5+.5)); if(player == 0){ phEntry.score1 = pawnScore; phEntry.isolatedPawns1 = isolatedPawnsCount; phEntry.doubledPawns1 = doubledPawnsCount; phEntry.backwardPawns1 = backwardPawnsCount; } else{ phEntry.score2 = pawnScore; phEntry.isolatedPawns2 = isolatedPawnsCount; phEntry.doubledPawns2 = doubledPawnsCount; phEntry.backwardPawns2 = backwardPawnsCount; } phEntry.passedPawns |= passedPawns; return pawnScore; } /** calculates danger associated with pawn wall weaknesses or storming enemy pawns*/ private static int pawnShelterStormDanger(final int player, final State4 s, final int kingIndex){ final int kc = kingIndex%8; //king column final int kr = player == 0? kingIndex >>> 3: 7-(kingIndex>>>3); //king rank final long mask = Masks.passedPawnMasks[player][kingIndex]; final long wallPawns = s.pawns[player] & mask; //pawns in front of the king final long stormPawns = s.pawns[1-player] & mask; //pawns in front of the king final int f = kc == 0? 1: kc == 7? 6: kc; //file, eval as if not on edge int pawnWallDanger = 0; for(int a = -1; a <= 1; a++){ final long colMask = Masks.colMask[f+a]; final long allied = wallPawns & colMask; final int rankAllied; if(allied != 0){ rankAllied = player == 0? BitUtil.lsbIndex(allied)>>>3: 7-(BitUtil.msbIndex(allied)>>>3); pawnWallDanger += pawnShelter[f != kc? 0: 1][rankAllied]; } else{ rankAllied = 0; } final long enemy = stormPawns & colMask; if(enemy != 0){ final int rankEnemy = player == 0? BitUtil.lsbIndex(enemy)>>>3: 7-(BitUtil.msbIndex(enemy)>>>3); final int type = allied == 0? 0: rankAllied+1 != rankEnemy? 1: 2; assert rankEnemy > kr; pawnWallDanger += pawnStorm[type][rankEnemy-kr-1]; } } return pawnWallDanger; } private static int[] centerDanger = new int[]{ -30, -15, -10, -10, -10, -10, -15, -30, -15, -10, -10, -10, -10, -10, -10, -15, -10, -10, -8, -8, -8, -8, -10, -10, -10, -10, -8, -4, -4, -8, -10, -10, -10, -10, -8, -4, -4, -8, -10, -10, -10, -10, -8, -8, -8, -8, -10, -10, -15, -10, -10, -10, -10, -10, -10, -15, -30, -15, -10, -10, -10, -10, -15, -30, }; /** stores castling positions indexed [side = left? 0: 1][player]*/ private final static long[][] castleOffsets = new long[][]{ {1L<<2, 1L<<58}, //castle left mask {1L<<6, 1L<<62}, //castle right mask }; /** gives the final index of the king after castling, index [side = left? 0: 1][player]*/ private final static int[][] castleIndex = new int[][]{ {2, 58}, //castle left index {6, 62}, //castle right index }; private static int evalKingPressure3(final int kingIndex, final int player, final State4 s, final long alliedAttackMask){ final long king = 1L << kingIndex; final long allied = s.pieces[player]; final long enemy = s.pieces[1-player]; final long agg = allied | enemy; int index = 0; final long kingRing = Masks.getRawKingMoves(king); final long undefended = kingRing & ~alliedAttackMask; final long rookContactCheckMask = kingRing & ~(PositionMasks.pawnAttacks[0][kingIndex] | PositionMasks.pawnAttacks[1][kingIndex]); final long bishopContactCheckMask = kingRing & ~rookContactCheckMask; final long bishops = s.bishops[1-player]; final long rooks = s.rooks[1-player]; final long queens = s.queens[1-player]; final long pawns = s.pawns[1-player]; final long knights = s.knights[1-player]; //process queen attacks int supportedQueenAttacks = 0; for(long tempQueens = queens; tempQueens != 0; tempQueens &= tempQueens-1){ final long q = tempQueens & -tempQueens; final long qAgg = agg & ~q; final long queenMoves = Masks.getRawQueenMoves(agg, q) & ~enemy & undefended; for(long temp = queenMoves & ~alliedAttackMask; temp != 0; temp &= temp-1){ final long pos = temp & -temp; if((pos & undefended) != 0){ final long aggPieces = qAgg | pos; final long bishopAttacks = Masks.getRawBishopMoves(aggPieces, pos); final long knightAttacks = Masks.getRawKnightMoves(pos); final long rookAttacks = Masks.getRawRookMoves(aggPieces, pos); final long pawnAttacks = Masks.getRawPawnAttacks(player, pawns); if((bishops & bishopAttacks) != 0 | (rooks & rookAttacks) != 0 | (knights & knightAttacks) != 0 | (pawns & pawnAttacks) != 0 | (queens & ~q & (bishopAttacks|rookAttacks)) != 0){ supportedQueenAttacks++; } } } } //index += supportedQueenAttacks*16; index += supportedQueenAttacks*4; //process rook attacks int supportedRookAttacks = 0; int supportedRookContactChecks = 0; for(long tempRooks = rooks; tempRooks != 0; tempRooks &= tempRooks-1){ final long r = tempRooks & -tempRooks; final long rAgg = agg & ~r; final long rookMoves = Masks.getRawRookMoves(agg, r) & ~enemy & undefended; for(long temp = rookMoves & ~alliedAttackMask; temp != 0; temp &= temp-1){ final long pos = temp & -temp; if((pos & undefended) != 0){ final long aggPieces = rAgg | pos; final long bishopAttacks = Masks.getRawBishopMoves(aggPieces, pos); final long knightAttacks = Masks.getRawKnightMoves(pos); final long rookAttacks = Masks.getRawRookMoves(aggPieces, pos); final long pawnAttacks = Masks.getRawPawnAttacks(player, pawns); if((bishops & bishopAttacks) != 0 | (rooks & ~r & rookAttacks) != 0 | (knights & knightAttacks) != 0 | (pawns & pawnAttacks) != 0 | (queens & (bishopAttacks|rookAttacks)) != 0){ if((pos & rookContactCheckMask) != 0) supportedRookContactChecks++; else supportedRookAttacks++; } } } } index += supportedRookAttacks*1; index += supportedRookContactChecks*2; //process bishop attacks int supportedBishopAttacks = 0; int supportedBishopContactChecks = 0; for(long tempBishops = bishops; tempBishops != 0; tempBishops &= tempBishops-1){ final long b = tempBishops & -tempBishops; final long bAgg = agg & ~b; final long bishopMoves = Masks.getRawBishopMoves(agg, b) & ~enemy & undefended; for(long temp = bishopMoves & ~alliedAttackMask; temp != 0; temp &= temp-1){ final long pos = temp & -temp; if((pos & undefended) != 0){ final long aggPieces = bAgg | pos; final long bishopAttacks = Masks.getRawBishopMoves(aggPieces, pos); final long knightAttacks = Masks.getRawKnightMoves(pos); final long rookAttacks = Masks.getRawRookMoves(aggPieces, pos); final long pawnAttacks = Masks.getRawPawnAttacks(player, pawns); if((bishops & ~b & bishopAttacks) != 0 | (rooks & rookAttacks) != 0 | (knights & knightAttacks) != 0 | (pawns & pawnAttacks) != 0 | (queens & (bishopAttacks|rookAttacks)) != 0){ if((pos & bishopContactCheckMask) != 0) supportedBishopContactChecks++; else supportedBishopAttacks++; } } } } index += supportedBishopAttacks*1; index += supportedBishopContactChecks*2; //process knight attacks int supportedKnightAttacks = 0; for(long tempKnights = knights; tempKnights != 0; tempKnights &= tempKnights-1){ final long k = tempKnights & -tempKnights; final long kAgg = agg & ~k; final long knightMoves = Masks.getRawKnightMoves(k) & ~enemy & undefended; for(long temp = knightMoves & ~alliedAttackMask; temp != 0; temp &= temp-1){ final long pos = temp & -temp; if((pos & undefended) != 0){ final long aggPieces = kAgg | pos; final long bishopAttacks = Masks.getRawBishopMoves(aggPieces, pos); final long knightAttacks = Masks.getRawKnightMoves(pos); final long rookAttacks = Masks.getRawRookMoves(aggPieces, pos); final long pawnAttacks = Masks.getRawPawnAttacks(player, pawns); if((bishops & bishopAttacks) != 0 | (rooks & rookAttacks) != 0 | (knights & ~k & knightAttacks) != 0 | (pawns & pawnAttacks) != 0 | (queens & (bishopAttacks|rookAttacks)) != 0){ supportedKnightAttacks++; } } } } index += supportedKnightAttacks*1; return kingDangerTable[index < 128? index: 127]; } @Override public void makeMove(final long encoding) { update(encoding, 1); } @Override public void undoMove(final long encoding) { update(encoding, -1); } /** incrementally updates the score after a move, dir = undo? -1: 1*/ private void update(final long encoding, final int dir){ final int player = MoveEncoder.getPlayer(encoding); final int taken = MoveEncoder.getTakenType(encoding); if(taken != 0){ materialScore[1-player] -= dir*materialWeights[taken]; } else if(MoveEncoder.isEnPassanteTake(encoding) != 0){ materialScore[1-player] -= dir*materialWeights[State4.PIECE_TYPE_PAWN]; } if(MoveEncoder.isPawnPromotion(encoding)){ materialScore[player] += dir*(materialWeights[State4.PIECE_TYPE_QUEEN]- materialWeights[State4.PIECE_TYPE_PAWN]); } } @Override public void initialize(State4 s) { System.arraycopy(zeroi, 0, materialScore, 0, 2); System.arraycopy(zeroi, 0, kingPawnDist, 0, 2); for(int a = 0; a < 2; a++){ final int b = State4.PIECE_TYPE_BISHOP; materialScore[a] += s.pieceCounts[a][b] * materialWeights[b]; final int n = State4.PIECE_TYPE_KNIGHT; materialScore[a] += s.pieceCounts[a][n] * materialWeights[n]; final int q = State4.PIECE_TYPE_QUEEN; materialScore[a] += s.pieceCounts[a][q] * materialWeights[q]; final int r = State4.PIECE_TYPE_ROOK; materialScore[a] += s.pieceCounts[a][r] * materialWeights[r]; final int p = State4.PIECE_TYPE_PAWN; materialScore[a] += s.pieceCounts[a][p] * materialWeights[p]; } } @Override public void reset(){} /** calculates mobility and danger to enemy king from mobility*/ private static int scoreMobility(final int player, final State4 s, final double clutterMult, final int[] nonPawnMaterial, final long[] attackMask){ int mobScore = 0; final long alliedPawns = s.pawns[player]; final long enemyPawns = s.pawns[1-player]; final long enemyPawnAttacks = Masks.getRawPawnAttacks(1-player, enemyPawns); final long allied = s.pieces[player]; final long enemy = s.pieces[1-player]; final long agg = allied | enemy; final long aggPawns = alliedPawns | enemyPawns; final long blockedAlliedPawns; //allied pawns whose movement is blocked by another pawn final long chainedAlliedPawns; //allied pawns that are supporting other allied pawns if(player == 0){ final long movementBlocked = ((alliedPawns << 8) & aggPawns) >>> 8; final long supportPawns = (((alliedPawns << 7) & alliedPawns) >>> 7) | (((alliedPawns << 9) & alliedPawns) >>> 9); blockedAlliedPawns = movementBlocked; chainedAlliedPawns = supportPawns; } else{ final long movementBlocked = ((alliedPawns >>> 8) & aggPawns) << 8; final long supportPawns = (((alliedPawns >>> 7) & alliedPawns) << 7) | (((alliedPawns >>> 9) & alliedPawns) << 9); blockedAlliedPawns = movementBlocked; chainedAlliedPawns = supportPawns; } long bishopAttackMask = 0; for(long bishops = s.bishops[player]; bishops != 0; bishops &= bishops-1){ final long b = bishops & -bishops; final long rawMoves = Masks.getRawBishopMoves(agg, b); final long moves = rawMoves & ~allied & ~enemyPawnAttacks; final int count = (int)BitUtil.getSetBits(moves); mobScore += Weight.multWeight(mobilityWeights[State4.PIECE_TYPE_BISHOP][count], clutterMult); bishopAttackMask |= rawMoves; //penalize bishop for blocking allied pawns on bishop color final long squareMask = (PositionMasks.bishopSquareMask[0] & b) != 0? PositionMasks.bishopSquareMask[0]: PositionMasks.bishopSquareMask[1]; final int blockingPawnsCount = (int)BitUtil.getSetBits(blockedAlliedPawns & squareMask); final int supportingPawnsCount = (int)BitUtil.getSetBits(chainedAlliedPawns & squareMask & ~blockedAlliedPawns); mobScore += S(blockingPawnsCount*-5 + supportingPawnsCount*-1, 0); } long knightAttackMask = 0; for(long knights = s.knights[player]; knights != 0; knights &= knights-1){ final long k = knights & -knights; final long rawMoves = Masks.getRawKnightMoves(k); final long moves = rawMoves & ~allied & ~enemyPawnAttacks; final int count = (int)BitUtil.getSetBits(moves); mobScore += Weight.multWeight(mobilityWeights[State4.PIECE_TYPE_KNIGHT][count], clutterMult); knightAttackMask |= rawMoves; } long rookAttackMask = 0; final long allPieces = s.pieces[0]|s.pieces[1]; final int alliedKingIndex = BitUtil.lsbIndex(s.kings[player]); final int alliedKingCol = alliedKingIndex%8; final int alliedKingRow = alliedKingIndex >>> 3; for(long rooks = s.rooks[player]; rooks != 0; rooks &= rooks-1){ final long r = rooks&-rooks; final long rawMoves = Masks.getRawRookMoves(agg, r); final long moves = rawMoves & ~allied & ~enemyPawnAttacks; final int moveCount = (int)BitUtil.getSetBits(moves); mobScore += Weight.multWeight(mobilityWeights[State4.PIECE_TYPE_ROOK][moveCount], clutterMult); rookAttackMask |= rawMoves; final int rindex = BitUtil.lsbIndex(r); final int col = rindex%8; if(isHalfOpen(col, enemyPawns, allPieces & ~r)){ //tests file half open mobScore += S(6, 15); if(((allPieces & ~r) & Masks.colMask[col]) == 0){ //tests file open mobScore += S(6, 15); } } final int row = rindex >>> 3; if(row == alliedKingRow){ final int backRank = player == 0? 0: 7; if(alliedKingRow == backRank && moveCount <= 4){ if(alliedKingCol >= 4 && col > alliedKingCol){ if(!s.kingMoved[player] && !s.rookMoved[player][1]){ mobScore += S(-20, -50); //trapped, but can castle right } else{ mobScore += S(-50, -120); //trapped, cannot castle //old, 80, 150 } } if(alliedKingCol <= 3 && col < alliedKingCol){ if(!s.kingMoved[player] && !s.rookMoved[player][0]){ mobScore += S(-20, -50); //trapped, but can castle left } else{ mobScore += S(-50, -120); //trapped, cannot castle } } } } } long queenAttackMask = 0; for(long queens = s.queens[player]; queens != 0; queens &= queens-1){ final long q = queens&-queens; final long rawMoves = Masks.getRawQueenMoves(agg, q); final long moves = rawMoves & ~allied & ~enemyPawnAttacks; final int count = (int)BitUtil.getSetBits(moves); mobScore += Weight.multWeight(mobilityWeights[State4.PIECE_TYPE_QUEEN][count], clutterMult); queenAttackMask |= rawMoves; } final long pawnAttackMask = Masks.getRawPawnAttacks(player, alliedPawns); attackMask[player] = bishopAttackMask | knightAttackMask | rookAttackMask | queenAttackMask | pawnAttackMask; //System.out.println(player+" pawn score = ("+mgScore(mobScore)+", "+egScore(mobScore)+")"); return mobScore; } /** * * @param col * @param enemyPawns * @param pieces pieces excluding the rook to be tested * @return */ private static boolean isHalfOpen(final int col, final long enemyPawns, final long pieces){ final long mask = Masks.colMask[col]; if((mask & pieces) == 0) return true; //column is fully open if((mask & (pieces & ~enemyPawns)) == 0){ //no pieces except for pawns final long c = enemyPawns & mask; if((c & (c-1)) == 0){ return true; //only one pawn in the column } } return false; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
1bbde3529d243b6cb853b63a270c4c023e0efd0e
71a255ddff939ba040da9c2a9530a1be76872d46
/app/src/main/java/com/tj/chaersi/nfccheck/base/BaseActivity.java
88166af9f9cead8a687e1c53bbe81e878db7bdf5
[]
no_license
CallMonster/NFCCheck
9baf5ed827c83f753bd05b17be909f8a1f05185f
0a0096164b121461ffe698f3919158ed775089ac
refs/heads/master
2021-04-29T10:13:12.314166
2017-02-15T09:29:39
2017-02-15T09:29:39
77,875,023
1
0
null
null
null
null
UTF-8
Java
false
false
3,193
java
package com.tj.chaersi.nfccheck.base; import android.app.Activity; import android.app.ProgressDialog; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Toast; import com.tj.chaersi.nfccheck.Utils.NetStateReceiver; import com.tj.chaersi.nfccheck.Utils.OnClickUtils; /** * Created by Chaersi on 16/7/1. */ public abstract class BaseActivity extends Activity implements View.OnClickListener,NetStateReceiver.onNETWORK_STATUS { private ProgressDialog progressDialog; public int netState;//0:没有网络 1:WIFI网络 2:WAP网络 3:NET网络 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if(savedInstanceState!=null){ Intent intent = getPackageManager().getLaunchIntentForPackage(getPackageName()); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); }else{ onCreate(); } } public abstract void onCreate(); @Override public void onClick(View v) { if (OnClickUtils.isFastDoubleClick()) { return; } onClickListener(v); } public abstract void onClickListener(View v); @Override public void onNet_STATUS_Listener(int state) { netState=state; } @Override protected void onSaveInstanceState(Bundle outState) { outState.putString("history","savestate"); super.onSaveInstanceState(outState); } @Override protected void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); savedInstanceState.getString("savestate"); } private Toast toast; public void showTips(String tips) { if (toast != null) { toast.setText(tips); toast.show(); } else { toast = Toast.makeText(getApplicationContext(), tips, Toast.LENGTH_SHORT); toast.show(); } } /** * * @param tips * @param gravity */ public void showTips(String tips,int gravity) { if (toast != null) { toast.setText(tips); toast.setGravity(gravity,0,0); toast.show(); } else { toast = Toast.makeText(getApplicationContext(), tips, Toast.LENGTH_SHORT); toast.setGravity(gravity,0,0); toast.show(); } } /** * 加载进度条 * @param content */ public void showProgressDialog(String content) { if (progressDialog == null) { progressDialog = new ProgressDialog(this); } progressDialog.setMessage(content); progressDialog.show(); progressDialog.setCancelable(false); progressDialog.setCanceledOnTouchOutside(false); } /** * 隐藏进度条 */ public void hideProgressDialog() { if (progressDialog != null) { progressDialog.dismiss(); } } @Override protected void onResume() { super.onResume(); } }
[ "lxg@ziteng.cn" ]
lxg@ziteng.cn
6037124ac0600e50a89b65e4c201d29d619013e9
3cdaa8af93c9e9ce84893d027f2d95954eef8cdd
/src/main/java/com/example/transaction/controller/Control.java
34065e4bed96a1f4a8a6f14eefd1b9844a7f80f5
[]
no_license
abcnull/RoughWebProject
571dd5ff11a1193340267cc0891386a0c97a1dd8
271d4e60a66f6a0457e095f0699aade8d61dc780
refs/heads/master
2020-03-25T04:00:18.175902
2019-03-29T01:28:18
2019-03-29T01:28:18
143,372,881
0
0
null
null
null
null
UTF-8
Java
false
false
8,533
java
package com.example.transaction.controller; import com.example.transaction.bean.Cux_todo_items; import com.example.transaction.bean.Cux_users; import com.example.transaction.dao.BusinessDao; import com.example.transaction.dao.UserDao; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.SessionAttribute; import org.springframework.web.bind.annotation.SessionAttributes; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpSession; /** * Created by 石磊 on 2018/7/22. */ @Controller @SessionAttributes({"user_name","user_id"}) public class Control { @Autowired private UserDao userdao; @Autowired private BusinessDao businessdao; //登陆操作,通过用户名查找数据库,并匹配密码,返回值到用户信息界面 @RequestMapping(value="/login") public ModelAndView login(@RequestParam("user_name") String user_name, @RequestParam("password") String password, HttpSession session){ session.setAttribute("user_name", user_name); ModelAndView modelAndView = new ModelAndView("info"); System.out.println("输入的用户名和密码是:"+ user_name + "," + password); System.out.println("开始通过用户名搜索数据库"); Cux_users cux_users = userdao.selectuser_name(user_name);//往里头传入参数,参数 System.out.println("搜索数据库成功,返回一个Cux_user对象"); //若两个密码相匹配 //登陆匹配正确则进入用户信息界面 if(cux_users.getPassword().equals(password)){ System.out.println("密码正确"); modelAndView.addObject("user_name",cux_users.getUser_name()); modelAndView.addObject("password",cux_users.getPassword()); modelAndView.addObject("sex",cux_users.getSex()); modelAndView.addObject("age",cux_users.getAge()); modelAndView.addObject("phone_number",cux_users.getPhone_number()); modelAndView.addObject("creation_date",cux_users.getCreation_date()); modelAndView.addObject("last_update_date",cux_users.getLast_update_date()); modelAndView.addObject("comments",cux_users.getComments()); return modelAndView; } //登陆匹配错误返回index,并且提示错误请重新输入 else{ System.out.println("密码错误"); return new ModelAndView("index","error","error"); } } @RequestMapping(value="/todolist") public ModelAndView list(String user_name, HttpSession session){ System.out.println("开始搜寻事务"); user_name = (String)session.getAttribute("user_name");//得到当前用户的user_name值 System.out.println("用户名"+user_name); ModelAndView modelAndView = new ModelAndView("list");//最后返回的页面是list.jsp System.out.println("准备查询用户表"); Cux_users cux_users = userdao.selectuser_name(user_name);//通过user_name值得到用户表 System.out.println("用户表查询结束"); long user_id = cux_users.getUser_id();//通过用户表得到用户的id session.setAttribute("user_id", user_id); System.out.println("准备查询事务表"); Cux_todo_items cux_todo_items = businessdao.selectbusiness(user_id);//通过用户的id来得到事务表 System.out.println("事务表查询结束"+cux_todo_items.getPriority()+cux_todo_items.getTodo_item_title()); modelAndView.addObject("list",cux_todo_items);//modelAndView中添加上这个表类 System.out.println("准备返回modelAndView"); return modelAndView; } //这里添加一列时 @RequestMapping(value="/updatebusiness") public ModelAndView updateBusiness(@RequestParam("todo_item_title") String todo_item_title, @RequestParam("comments") String comments, @RequestParam("priority") String priority, @RequestParam("creation_date") String creation_date, @RequestParam("last_update_date") String last_update_date,HttpSession session){ System.out.println("开始搜寻事务222222222"); String user_name = (String)session.getAttribute("user_name");//得到当前用户的user_name值 long user_id = (long)session.getAttribute("user_id");//得到当前用户的user_id值 System.out.println("用户名"+user_name); ModelAndView modelAndView = new ModelAndView("list");//最后返回的页面是list.jsp Cux_todo_items cux_todo_items = new Cux_todo_items(); cux_todo_items.setTodo_item_title(todo_item_title); cux_todo_items.setComments(comments); cux_todo_items.setPriority(priority); cux_todo_items.setCreation_date(creation_date); cux_todo_items.setLast_update_date(last_update_date); cux_todo_items.setUser_id(user_id); System.out.println("插入数据"+cux_todo_items.getPriority()+cux_todo_items.getTodo_item_id()+cux_todo_items.getTodo_item_title()+cux_todo_items.getCreation_date()); //先新插入 businessdao.insertbusiness(cux_todo_items);//插入事务表类的数据类型,这个方法为自己实现的 System.out.println("插入成功"); //查询事务表返回给modelAndView modelAndView.addObject("list", cux_todo_items); //最后return return modelAndView; } //点击左边的personinfo链接,刷新页面,也就是查询用户信息 @RequestMapping(value="/personinfo") public ModelAndView selectUser(String user_name, HttpSession session){ user_name = (String)session.getAttribute("user_name"); System.out.println("开始刷新"); System.out.println("用户id是:" + user_name); ModelAndView modelAndView = new ModelAndView("info"); System.out.println("定好了转向的页面"); //通过dao得到用户表实例 Cux_users cux_users = userdao.selectuser_name(user_name);//往里头传入参数,参数 System.out.println("通过用户名得到了数据库中的数据"); //装配ModelAndView System.out.println("开始填装数据"); modelAndView.addObject("user_name",cux_users.getUser_name()); modelAndView.addObject("password",cux_users.getPassword()); modelAndView.addObject("sex",cux_users.getSex()); modelAndView.addObject("age",cux_users.getAge()); modelAndView.addObject("phone_number",cux_users.getPhone_number()); modelAndView.addObject("creation_date",cux_users.getCreation_date()); modelAndView.addObject("last_update_date",cux_users.getLast_update_date()); modelAndView.addObject("comments",cux_users.getComments()); System.out.println("填装完毕"); return modelAndView; } //修改数据 @RequestMapping(value="/updateinfo") public ModelAndView updateUser(Cux_users cux_users, HttpSession session){ ModelAndView modelAndView = new ModelAndView("info");//定向info String user_name = (String)session.getAttribute("user_name");//得到user_name System.out.println("开始更新"); userdao.updateuser_name(cux_users);//更新操作 System.out.println("更新完毕"); //通过dao得到用户表实例 modelAndView.addObject("user_name",cux_users.getUser_name()); modelAndView.addObject("password",cux_users.getPassword()); modelAndView.addObject("sex",cux_users.getSex()); modelAndView.addObject("age",cux_users.getAge()); modelAndView.addObject("phone_number",cux_users.getPhone_number()); modelAndView.addObject("creation_date",cux_users.getCreation_date()); modelAndView.addObject("last_update_date",cux_users.getLast_update_date()); modelAndView.addObject("comments",cux_users.getComments()); System.out.println("填装完毕"); return modelAndView; } }
[ "463279708@qq.com" ]
463279708@qq.com
65fb62c8c655d72e5eab27d6ee76a3672bb71813
78e65b526c4d0d4c699067d7b1fc6ee2babc16ce
/Loom02/agenda/agenda/ViaDeContacto.java
2bca4c6fe9c0aed067f9c8489a693480abbeb393
[]
no_license
juancalvino/UNTREF
3397d2c1d3db119a3a64d572f80d3b16c4f3a788
627845d108126026f000674fb976a4c562ee905b
refs/heads/master
2023-06-20T05:07:54.565084
2021-07-12T21:51:07
2021-07-12T21:51:07
358,330,832
0
0
null
2021-05-19T01:45:00
2021-04-15T16:52:41
Java
UTF-8
Java
false
false
1,909
java
package agenda; /* En este ejercicio no se pidio validar los datos ni los strings vacios. Esta clase se utilizara en principio para almacenar Emails y Telefonos los cules no seran validados ya que el ejercicio no lo solicita Entendimos que tanto Telefono e Email ambos deben tener de forma obligatoria 'contacto' y 'tipo' */ public class ViaDeContacto { private String contacto; private String tipoDeContacto; /** * Pre: 'contacto' y 'tipoDeContacto' no debe ser NULL * Post: ViaDeContacto queda preparado para guardar contacto y tipo de contacto. */ public ViaDeContacto(String contacto, String tipoDeContacto) { this.contacto = verificarAusenciaNull(contacto); this.tipoDeContacto = verificarAusenciaNull(tipoDeContacto); } /** * Pre: contacto no debe ser NULL. * Post: guarda en 'contacto' el dato contacto. */ public void setContacto(String contacto) { this.contacto = verificarAusenciaNull(contacto); } /** * Pre: contacto no debe ser NULL. * Post: guarda el dato en 'tipoDeContacto' */ public void setTipoDeContacto(String tipoDeContacto) { this.tipoDeContacto = verificarAusenciaNull(tipoDeContacto); } /** * Pre: contacto no debe ser NULL. * Post: guarda contacto en 'contacto' y tipoDeDato en 'tipoDeContacto' */ public void setContactoYTipo(String contacto, String tipoDeContacto) { this.contacto = verificarAusenciaNull(contacto); this.tipoDeContacto = verificarAusenciaNull(tipoDeContacto); } /** * Post: devuelve un String con el 'contacto' y con 'tipoDeContacto' si existe */ public String toString() { return contacto +"\nTipo:" + tipoDeContacto; } /** * Post: devuelve el dato ingresado si este no es NULL, sino devuelve una excepcion. */ private String verificarAusenciaNull(String info) { if(info == null) throw new Error("Es obligatorio la existencia de los datos solicitados"); return info; } }
[ "juan.m.calvino@gmail.com" ]
juan.m.calvino@gmail.com
3d933af9574dbbe0a8cbaf9e4bf9fb8910f557f0
e3137440f1f3cde5305741d5bff8bf623178c402
/app/src/main/java/com/example/administrator/myapplication/rollviewpager/hintview/IconHintView.java
17a63a763621c81e5c5883a0f1bf51f2d9f9ab0b
[]
no_license
ly0901/LyApplication
9507916254ab671f9cefc0ae832966524eb3faf8
08609dc656460d1084c3cbb2ce81d55655282d2c
refs/heads/master
2021-06-20T10:26:39.918483
2017-07-31T02:14:55
2017-07-31T02:14:55
60,144,147
0
0
null
null
null
null
UTF-8
Java
false
false
2,663
java
package com.example.administrator.myapplication.rollviewpager.hintview; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.PixelFormat; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.support.annotation.DrawableRes; import com.example.administrator.myapplication.rollviewpager.RollUtil; /** * Created by Mr.Jude on 2016/1/10. */ public class IconHintView extends ShapeHintView { private int focusResId; private int normalResId; private int size; public IconHintView(Context context,@DrawableRes int focusResId,@DrawableRes int normalResId) { this(context, focusResId, normalResId, RollUtil.dip2px(context,32)); } public IconHintView(Context context,@DrawableRes int focusResId,@DrawableRes int normalResId,int size) { super(context); this.focusResId = focusResId; this.normalResId = normalResId; this.size = size; } @Override public Drawable makeFocusDrawable() { Drawable drawable = getContext().getResources().getDrawable(focusResId); if (size>0){ drawable = zoomDrawable(drawable,size,size); } return drawable; } @Override public Drawable makeNormalDrawable() { Drawable drawable = getContext().getResources().getDrawable(normalResId); if (size>0){ drawable = zoomDrawable(drawable,size,size); } return drawable; } private Drawable zoomDrawable(Drawable drawable, int w, int h) { int width = drawable.getIntrinsicWidth(); int height = drawable.getIntrinsicHeight(); Bitmap oldbmp = drawableToBitmap(drawable); Matrix matrix = new Matrix(); float scaleWidth = ((float) w / width); float scaleHeight = ((float) h / height); matrix.postScale(scaleWidth, scaleHeight); Bitmap newbmp = Bitmap.createBitmap(oldbmp, 0, 0, width, height, matrix, true); return new BitmapDrawable(null, newbmp); } private Bitmap drawableToBitmap(Drawable drawable) { int width = drawable.getIntrinsicWidth(); int height = drawable.getIntrinsicHeight(); Bitmap.Config config = drawable.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565; Bitmap bitmap = Bitmap.createBitmap(width, height, config); Canvas canvas = new Canvas(bitmap); drawable.setBounds(0, 0, width, height); drawable.draw(canvas); return bitmap; } }
[ "l_xieting@126.com" ]
l_xieting@126.com
eddce64a76d1b3a30234b9d165b0e3cc5a77d673
7abad4023ba4a6f30fbda31b11cfb7f22c8d5ed3
/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/auton/teams/technic/red/right/RedRightFourCommand.java
f20f60a4413a08c7869184b4e7df6e80eb106f63
[]
no_license
FTC-13266-Apex/DroidRage-Apex-UltimateGoal
1369664932cb73ccccc8275cc48c4a11396af4d2
0b4f814ba1a8600e7fbbe33f490e1d31dc866770
refs/heads/main
2023-09-04T02:49:12.598816
2021-10-28T15:08:35
2021-10-28T15:08:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,051
java
package org.firstinspires.ftc.teamcode.auton.teams.technic.red.right; import com.arcrobotics.ftclib.command.SequentialCommandGroup; import org.firstinspires.ftc.robotcore.external.Telemetry; import org.firstinspires.ftc.teamcode.commands.PlaceWobbleGoal; import org.firstinspires.ftc.teamcode.commands.drive.DriveForwardCommand; import org.firstinspires.ftc.teamcode.commands.drive.TurnCommand; import org.firstinspires.ftc.teamcode.commands.drive.TurnToCommand; import org.firstinspires.ftc.teamcode.subsystems.Drivetrain; import org.firstinspires.ftc.teamcode.subsystems.Intake; import org.firstinspires.ftc.teamcode.subsystems.ShooterFeeder; import org.firstinspires.ftc.teamcode.subsystems.ShooterWheels; import org.firstinspires.ftc.teamcode.subsystems.Vision; import org.firstinspires.ftc.teamcode.subsystems.WobbleGoalArm; import org.firstinspires.ftc.teamcode.auton.values.outside.OutsideFourValues; public class RedRightFourCommand extends SequentialCommandGroup { public RedRightFourCommand(Drivetrain drivetrain, ShooterWheels shooterWheels, ShooterFeeder feeder, Intake intake, WobbleGoalArm wobbleGoalArm, Vision vision, Telemetry telemetry) { final int HG_SPEED = 3600; final int POWERSHOT_SPEED = 3000; OutsideFourValues distance = new OutsideFourValues(); OutsideFourValues angle = new OutsideFourValues(); addCommands( new RedRightShootingSequence(drivetrain, shooterWheels, feeder), new DriveForwardCommand(drivetrain, distance.distanceOne), new TurnToCommand(drivetrain, angle.angleOne, true), new DriveForwardCommand(drivetrain, distance.distanceTwo), new PlaceWobbleGoal(wobbleGoalArm), new TurnToCommand(drivetrain, angle.angleTwo, true), new DriveForwardCommand(drivetrain, distance.distanceThree) ); } } //new SplineCommand(drivetrain, new Vector2d(-30, 24), Math.toRadians(15), false) //new DriveForwardCommand(drivetrain, -40), //
[ "you@example.com" ]
you@example.com
f3301c1b1272d9d6a513cdb50c386d17a786856a
84311489ad6d6aef2c8fef8429e4a90f3c32a9d6
/legend-pure-m3-core/src/main/java/org/finos/legend/pure/m3/compiler/validation/validator/PropertyValidator.java
4e796c002dbcd2e87e35e867d2e793def5490c53
[ "Apache-2.0", "CC0-1.0" ]
permissive
junjikatto/legend-pure
dc277883e4317434f2a32800a380c741b54d0405
af9fc2ef1c6c7b50eb57978674442e26ac768e93
refs/heads/master
2023-02-06T11:48:22.662689
2020-12-24T02:19:00
2020-12-24T02:19:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,858
java
// Copyright 2020 Goldman Sachs // // 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.finos.legend.pure.m3.compiler.validation.validator; import org.eclipse.collections.api.list.ListIterable; import org.finos.legend.pure.m3.navigation.M3Paths; import org.finos.legend.pure.m3.compiler.Context; import org.finos.legend.pure.m3.navigation.Instance; import org.finos.legend.pure.m3.navigation.generictype.GenericType; import org.finos.legend.pure.m3.navigation.importstub.ImportStub; import org.finos.legend.pure.m3.navigation.multiplicity.Multiplicity; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property; import org.finos.legend.pure.m3.navigation.ProcessorSupport; import org.finos.legend.pure.m3.tools.matcher.MatchRunner; import org.finos.legend.pure.m3.tools.matcher.Matcher; import org.finos.legend.pure.m3.tools.matcher.MatcherState; import org.finos.legend.pure.m4.coreinstance.CoreInstance; import org.finos.legend.pure.m4.ModelRepository; import org.finos.legend.pure.m4.exception.PureCompilationException; public class PropertyValidator implements MatchRunner<Property> { @Override public String getClassName() { return M3Paths.Property; } @Override public void run(Property instance, MatcherState state, Matcher matcher, ModelRepository modelRepository, Context context) throws PureCompilationException { validateProperty(instance, state.getProcessorSupport()); } public static void validateProperty(Property property, ProcessorSupport processorSupport) throws PureCompilationException { GenericTypeValidator.validateGenericType(property._genericType(), processorSupport); validateNonPrimitiveBinaryType(property, processorSupport); } public static void validateTypeRange(CoreInstance coreInstance, CoreInstance property, CoreInstance instance, ProcessorSupport processorSupport) throws PureCompilationException { CoreInstance propertyReturnGenericType = GenericType.resolvePropertyReturnType(Instance.extractGenericTypeFromInstance(coreInstance, processorSupport), property, processorSupport); CoreInstance instanceGenericType = Instance.extractGenericTypeFromInstance(instance, processorSupport); if (!GenericType.subTypeOf(instanceGenericType, propertyReturnGenericType, processorSupport)) { throw new PureCompilationException(instance.getSourceInformation(), "Property: '" + org.finos.legend.pure.m3.navigation.property.Property.getPropertyName(property) + "' / Type Error: '" + GenericType.print(instanceGenericType, processorSupport) + "' not a subtype of '" + GenericType.print(propertyReturnGenericType, processorSupport) + "'"); } } public static void validateMultiplicityRange(CoreInstance coreInstance, CoreInstance property, ListIterable<? extends CoreInstance> values, ProcessorSupport processorSupport) throws PureCompilationException { // Check Multiplicity Range CoreInstance multiplicity = org.finos.legend.pure.m3.navigation.property.Property.resolveInstancePropertyReturnMultiplicity(coreInstance, property, processorSupport); if (!Multiplicity.isValid(multiplicity, values.size())) { throw new PureCompilationException(coreInstance.getSourceInformation(), "Error instantiating the type '" + coreInstance.getClassifier().getName() + "'. The property '" + org.finos.legend.pure.m3.navigation.property.Property.getPropertyName(property) + "' has a multiplicity range of " + Multiplicity.print(multiplicity) + " when the given list has a cardinality equal to '" + values.size() + "'"); } } private static void validateNonPrimitiveBinaryType(Property property, ProcessorSupport processorSupport) throws PureCompilationException { CoreInstance type = ImportStub.withImportStubByPass(property._genericType()._rawTypeCoreInstance(), processorSupport); if (processorSupport.type_isPrimitiveType(type) && ModelRepository.BINARY_TYPE_NAME.equals(type.getName())) { throw new PureCompilationException(property.getSourceInformation(), "The property '" + org.finos.legend.pure.m3.navigation.property.Property.getPropertyName(property) + "' has type of 'Binary'. 'Binary' type is not supported for property."); } } }
[ "pierre.debelen@gs.com" ]
pierre.debelen@gs.com
e73de657669a64f5de71a5d6e3865e9371c45c94
43fc90265f58ad65a3ac3919d3e397ce573c4d3b
/src/com/theironyard/Album.java
ea566a82522b6e992a632ba15c5f838029ef8357
[]
no_license
KristaBalling/PlayList
7c700df7c176669231ba6d55e5a9b5c7d4ed54bc
ff5c2075b04d390a177932e5d3889c467f4d8cd8
refs/heads/master
2020-04-07T00:10:45.430789
2018-11-16T19:48:38
2018-11-16T19:48:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,493
java
package com.theironyard; import java.util.ArrayList; import java.util.LinkedList; public class Album { private String name; private String artist; private ArrayList<Song> songs; public Album(String name, String artist) { this.name = name; this.artist = artist; this.songs = new ArrayList<Song>(); } public boolean addSong(String title, double duration) { if(findSong(title) == null) { this.songs.add(new Song(title, duration)); return true; } return false; } private Song findSong(String title) { for(Song checkedSong: this.songs) { if(checkedSong.getTitle().equals(title)) { return checkedSong; } } return null; } public boolean addToPlayList(int trackNumber, LinkedList<Song> playList) { int index = trackNumber -1; if((index >= 0) && (index <= this.songs.size())){ playList.add(this.songs.get(index)); return true; } System.out.println("This album does not have a track " + trackNumber); return false; } public boolean addToPlayList(String title, LinkedList<Song> playList) { Song checkedSong = findSong(title); if (checkedSong != null) { playList.add(checkedSong); return true; } System.out.println("The song " + title + " is not in this album"); return false; } }
[ "krista.blachian@scifusion360.com" ]
krista.blachian@scifusion360.com
6dce5aba02fa991590766c017f94f7de978b2836
37618b470e6bd790b74b18de32d3c8804b6e6a54
/APL/APL2.1/TP9/exo1/VolumeRefresh.java
a98db7fc67237003eb9b8c42a5f840d71d911732
[]
no_license
tomy-da-rocha/DUT-info
8e99fa3c538084febfe9813f360f8c8308e57d45
cf0b462a4fcdce0dc3216dfd9f195a293b4e0975
refs/heads/main
2023-09-04T11:48:34.124399
2021-11-08T21:28:39
2021-11-08T21:28:39
425,535,568
0
0
null
null
null
null
UTF-8
Java
false
false
1,245
java
import javax.swing.*; import java.awt.*; public class VolumeRefresh { protected int volumeTot; private Volume volume[]; private JPanel panel; private VolumeRefresh volumeRefresh; private int count; // Volume à afficher (restant) private int i; private JFrame window; // Constructeur public VolumeRefresh(JPanel panel) { this.panel = panel; this.volume = new Volume[10]; this.count = this.volumeTot; for (i = 0; i < volume.length; ++i) { this.volume[i] = new Volume(this); panel.add(volume[i]); } } public void setVolume(int volume) { // Si le volume est compris entre 0 et 10 if ((volumeTot == 0 && volume > 0) || (volumeTot == 10 && volume < 0) || (volumeTot > 0 && volumeTot < 10)) { this.volumeTot += volume; } this.count = this.volumeTot; if (volume > 0) { for (i = 0; i < this.volumeTot; ++i) { this.volume[i].repaint(); } } else { for (i = 0; i < this.volume.length; ++i) { this.volume[i].repaint(); } } System.out.println(this.count); } public int getVolume() { return this.volumeTot; } public void setCount(int newCount) { if (this.count > 0) { this.count += newCount; } } public int getCount() { return this.count; } }
[ "tomy.da-rocha@etu.u-pec.fr" ]
tomy.da-rocha@etu.u-pec.fr
b0bd2ba9cbf14735e6c0868a71f97f2161a75f8a
2ec282c465a50429743a6cfd10782ef6a50d6f8b
/src/Leetcode/TwoSum.java
fd2f343e27f25a48ee82e2b851dd9045ace3aea7
[]
no_license
kalpak92/TechInterview2020
c72f288e24c78bc69551e4e0b1d41b095cd93ef1
d835ab8f9fa4cc1fd1b54d377d833c5a2fda4d54
refs/heads/master
2023-04-12T02:29:45.858841
2021-04-14T02:50:03
2021-04-14T02:50:03
294,589,117
11
1
null
null
null
null
UTF-8
Java
false
false
1,510
java
package Leetcode; import java.util.HashMap; import java.util.Map; /** * @author kalpak * * Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. * You may assume that each input would have exactly one solution, and you may not use the same element twice. * You can return the answer in any order. * * Example 1: * * Input: nums = [2,7,11,15], target = 9 * Output: [0,1] * Output: Because nums[0] + nums[1] == 9, we return [0, 1]. * * Example 2: * * Input: nums = [3,2,4], target = 6 * Output: [1,2] * * Example 3: * * Input: nums = [3,3], target = 6 * Output: [0,1] * * * Constraints: * * 2 <= nums.length <= 105 * -109 <= nums[i] <= 109 * -109 <= target <= 109 * Only one valid answer exists. * */ public class TwoSum { public static int[] twoSum(int[] nums, int target) { int[] result = new int[2]; Map<Integer, Integer> map = new HashMap<>(); for(int i = 0; i < nums.length; i++) { if(map.containsKey(target - nums[i])) { result[1] = i; result[0] = map.get(target - nums[i]); break; } map.put(nums[i], i); } return result; } public static void main(String[] args) { int[] arr = new int[]{2,7,11,15}; int[] result = twoSum(arr, 9); for(int i : result) System.out.print(i + " "); System.out.println(); } }
[ "kals9seals@gmail.com" ]
kals9seals@gmail.com
c039ffc3be66492bead680468b63e14a6f1e2a5d
801184be26282eb1031bdd99f1fa9338c5b77188
/spring-study-beans/src/main/java/com/bage/annotation/primary/xml/MovieCatalog.java
2d095c641f4978bea4229b59e27a383719d090bc
[]
no_license
bage2014/spring-study
089252d0347c9a28be66e89a49d6ce2d5fb7dff1
d49ba10fcb907078243281399bfa3a9564669cbe
refs/heads/master
2021-01-19T15:25:27.263526
2018-11-28T14:25:32
2018-11-28T14:25:32
100,968,310
2
0
null
null
null
null
UTF-8
Java
false
false
73
java
package com.bage.annotation.primary.xml; public class MovieCatalog { }
[ "893542907@qq.com" ]
893542907@qq.com
0059a71db40e4c31d43423b7c9d5effb53981b3c
d92e201e9653a876646d4fee93d44183d3e6eaf3
/app/src/main/java/com/davicaetano/runningwithmusic/data/model/PlayerStatus.java
ac8ebc2a9b63c355c189a6b093ea04a288b8cd5d
[]
no_license
davicaetano/RunningWithMusic
34f4ebb363fe1db0cefcb1bbe9767ea9e755ac32
0e1353abec9315d07a59f12cb42cf9fc3c789c48
refs/heads/master
2021-01-10T12:50:04.974512
2016-02-11T21:33:06
2016-02-11T21:33:06
49,553,938
4
0
null
null
null
null
UTF-8
Java
false
false
204
java
package com.davicaetano.runningwithmusic.data.model; /** * Created by davicaetano on 12/11/15. */ public class PlayerStatus { public Song song; public Boolean isPlaying; public int time; }
[ "davicaetano@gmail.com" ]
davicaetano@gmail.com
02e8e8cc90d68249fdf25d16e0532bf6739c2f79
9a0aac21e8d2e50eabd444f636d533bb50176688
/src/com/navigation/drawer/activity/Item5Activity.java
25e8c32ce89c48924894ca288d212c943724f3bb
[]
no_license
rahul1291/NavigationDrawerActivity
b92dbae37d2451fe842aa1ce5a67ae7ca2e550e2
c9dcd8a7ddc725e3b10db117a2f1aeee6f86148a
refs/heads/master
2021-01-24T18:58:14.685120
2017-03-25T14:29:44
2017-03-25T14:29:44
86,163,139
0
1
null
null
null
null
UTF-8
Java
false
false
853
java
package com.navigation.drawer.activity; import android.os.Bundle; import android.view.View; import android.widget.ImageView; /** * @author dipenp * */ public class Item5Activity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /** * Adding our layout to parent class frame layout. */ View v=getLayoutInflater().inflate(R.layout.item1, null); frameLayout.addView(v); /** * Setting title and itemChecked */ //((ImageView)findViewById(R.id.image_view)).setBackgroundResource(R.drawable.image5); } @Override protected void onResume() { // TODO Auto-generated method stub super.onResume(); mDrawerList.setItemChecked(position, true); setTitle("Item5"); } @Override public void onBackPressed() { super.onBackPressed(); } }
[ "rahul.kumar@bookmyshow.com" ]
rahul.kumar@bookmyshow.com
10f79a6d10370b3b4965d02f3d33a1b0a1202a8e
50cf901e16ec1c9993b14c117c5bf326a3781b57
/app/src/main/java/com/fyj/fastbee/bean/YueProjectBean.java
9ca740adfda767797dfee8392b333e574930d13d
[ "Apache-2.0" ]
permissive
f-evil/FastBee
293b76c9226cef68a74bf698c208b97b87a24d54
28ce2e901f3ac1ff66a275b5d9c6fee4d094c236
refs/heads/master
2020-04-06T03:51:14.277030
2016-09-21T09:55:20
2016-09-21T09:55:20
68,794,082
0
0
null
null
null
null
UTF-8
Java
false
false
3,095
java
package com.fyj.fastbee.bean; import java.io.Serializable; import java.util.List; /** * 当前作者: Fyj<br> * 时间: 2016/9/5<br> * 邮箱: f279259625@gmail.com<br> * 修改次数: <br> * 描述: */ public class YueProjectBean implements Serializable { /** * categoryNote : 时尚·潮流 * commentList : [{"comment":"High job","createdAt":1472784673164,"id":"5cbb35ec-d2dd-4bdd-b7b1-b36811617c43","isDeleted":"0","owner":{"aliasName":"客户代表","companyName":"湖南觅你时空酒店集团有限公司","imgUrl":"/file/01291434-0b28-4129-9f6e-21ba1cbbe26a.png","regName":"蔡浩","userBid":"2081"},"refActivityId":"2c01f809-82ab-456c-8783-ebfdc9add3be","refOwnerId":"2081","toUser":{},"toUserId":""},{"comment":"统一战线","createdAt":1472784604821,"id":"e510ca2a-c9fe-4ecf-8140-5a5260734351","isDeleted":"0","owner":{"aliasName":"客户代表","companyName":"湖南觅你时空酒店集团有限公司","imgUrl":"/file/01291434-0b28-4129-9f6e-21ba1cbbe26a.png","regName":"蔡浩","userBid":"2081"},"refActivityId":"2c01f809-82ab-456c-8783-ebfdc9add3be","refOwnerId":"2081","toUser":{},"toUserId":""},{"comment":"咯弄","createdAt":1472784492590,"id":"c9342a09-54b4-4447-a0ce-d7255a5e9a0a","isDeleted":"0","owner":{"aliasName":"副厂长、培训专员","companyName":"易镀网","regName":"施上浮","userBid":"131847"},"refActivityId":"2c01f809-82ab-456c-8783-ebfdc9add3be","refOwnerId":"131847","toUser":{},"toUserId":""}] * commentNum : 3 * createdAt : 1472626751376 * desc : <html><body><p>asdasda</p></body></html> * endTime : 1472893200000 * groupChat : ad0b04e1-7684-4d29-aafd-736c5183ef96 * id : 2c01f809-82ab-456c-8783-ebfdc9add3be * isApplyOrJoin : 0 * isDeleted : 0 * isLike : 0 * likeList : [{"createdAt":0,"refUserId":"131847"}] * likeNum : 1 * limitedNum : 0 * locationLat : 0 * locationLng : 0 * locationName : * memberNum : 0 * owner : {"aliasName":" ","companyName":"李闯","imgUrl":"/file/edb61fb7-ab72-427e-a0c7-217f98d617ac.png","regName":"李闯"} * picNum : 1 * poster : /yue/240*330_af492829-cbe5-49ba-b554-e7ec865fede5.jpg * refCategoryId : 47629c89-5314-41fc-9b3c-a563011a37fa * refOwnerId : 1956 * startTime : 1471251600000 * status : 2 * thumbnails : /yue/small_240*330_af492829-cbe5-49ba-b554-e7ec865fede5.jpg * title : 1000503:sdasd * type : Project_SalePromotion * updatedAt : 1472626751376 */ private List<ActivitysBean> activitys; private List<HotsBean> hots; private List<HotsBean> tops; public List<ActivitysBean> getActivitys() { return activitys; } public void setActivitys(List<ActivitysBean> activitys) { this.activitys = activitys; } public List<HotsBean> getHots() { return hots; } public void setHots(List<HotsBean> hots) { this.hots = hots; } public List<HotsBean> getTops() { return tops; } public void setTops(List<HotsBean> tops) { this.tops = tops; } }
[ "279259625@qq.com" ]
279259625@qq.com
0c0ee4644f437e1d504cd172395a0f6b99cbf4ca
3a58920d69dc866a4b88679cfc5125afa7ec2bce
/app/com/baasbox/configuration/IosCertificateHandler.java
44c93e2af3b2e147022a5c651719fa605caf84de
[]
no_license
jeffchou/Baas-Contacts
e236a98c7c886bc14b8ca11e908607346f3ffd23
0864d7383299abb48d07a92adb6a5031594224fd
refs/heads/master
2020-06-01T15:06:26.968935
2014-12-15T01:32:31
2014-12-15T01:32:31
27,751,803
2
0
null
2014-12-15T01:32:32
2014-12-09T05:52:07
Java
UTF-8
Java
false
false
7,810
java
/* * Copyright (c) 2014. * * BaasBox - info-at-baasbox.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.baasbox.configuration; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import play.Logger; import play.Play; import com.baasbox.BBConfiguration; import com.baasbox.util.ConfigurationFileContainer; public class IosCertificateHandler implements IPropertyChangeCallback{ static String sep = System.getProperty("file.separator")!=null?System.getProperty("file.separator"):"/"; static String folder = BBConfiguration.getPushCertificateFolder(); @Override public void change(Object iCurrentValue, Object iNewValue) { if(iNewValue==null){ return; } String folder = BBConfiguration.getPushCertificateFolder(); File f = new File(folder); if(!f.exists()){ f.mkdirs(); } ConfigurationFileContainer newValue=null; ConfigurationFileContainer currentValue=null; if(iNewValue!=null && iNewValue instanceof ConfigurationFileContainer){ newValue =(ConfigurationFileContainer)iNewValue; } if(iCurrentValue!=null){ if(iCurrentValue instanceof String){ try { currentValue =new ObjectMapper().readValue(iCurrentValue.toString(), ConfigurationFileContainer.class); } catch (Exception e) { if (Logger.isDebugEnabled()) Logger.debug("unable to convert value to ConfigurationFileContainer"); } }else if (iCurrentValue instanceof ConfigurationFileContainer){ currentValue = (ConfigurationFileContainer)iCurrentValue; } } if(currentValue!=null){ File oldFile = new File(folder+sep+currentValue.getName()); if(oldFile.exists()){ try{ FileUtils.forceDelete(oldFile); }catch(Exception e){ Logger.error(e.getMessage()); } } } if(newValue!=null){ File newFile = new File(folder+sep+newValue.getName()); try{ if(!newFile.exists()){ newFile.createNewFile(); } }catch(IOException ioe){ throw new RuntimeException("unable to create file:"+ioe.getMessage()); } ByteArrayInputStream bais = new ByteArrayInputStream(newValue.getContent()); try{ FileUtils.copyInputStreamToFile(bais, newFile); bais.close(); }catch(IOException ioe){ //TODO:more specific exception throw new RuntimeException(ioe.getMessage()); } }else{ Logger.warn("Ios Certificate Handler invoked with wrong parameters"); //TODO:throw an exception? } } public static void init(){ String folder = BBConfiguration.getPushCertificateFolder(); File f = new File(folder); if(!f.exists()){ f.mkdirs(); } ConfigurationFileContainer prod = Push.PROFILE1_PRODUCTION_IOS_CERTIFICATE.getValueAsFileContainer(); ConfigurationFileContainer sandbox = Push.PROFILE1_SANDBOX_IOS_CERTIFICATE.getValueAsFileContainer(); ConfigurationFileContainer prod2 = Push.PROFILE2_PRODUCTION_IOS_CERTIFICATE.getValueAsFileContainer(); ConfigurationFileContainer sandbox2 = Push.PROFILE2_SANDBOX_IOS_CERTIFICATE.getValueAsFileContainer(); ConfigurationFileContainer prod3 = Push.PROFILE3_PRODUCTION_IOS_CERTIFICATE.getValueAsFileContainer(); ConfigurationFileContainer sandbox3 = Push.PROFILE3_SANDBOX_IOS_CERTIFICATE.getValueAsFileContainer(); if(prod!=null){ if (Logger.isDebugEnabled()) Logger.debug("Creating production certificate for default profile:"+prod.getName()); File prodCertificate = new File(folder+sep+prod.getName()); if(!prodCertificate.exists()){ try{ prodCertificate.createNewFile(); ByteArrayInputStream bais = new ByteArrayInputStream(prod.getContent()); FileUtils.copyInputStreamToFile(bais, prodCertificate); }catch(Exception e){ prodCertificate.delete(); throw new RuntimeException("Unable to create file for certificate:"+e.getMessage()); } } } if(sandbox!=null){ if (Logger.isDebugEnabled()) Logger.debug("Creating sandbox certificate for default profile:"+sandbox.getName()); File sandboxCertificate = new File(folder+sep+sandbox.getName()); if(!sandboxCertificate.exists()){ try{ sandboxCertificate.createNewFile(); ByteArrayInputStream bais = new ByteArrayInputStream(sandbox.getContent()); FileUtils.copyInputStreamToFile(bais, sandboxCertificate); }catch(Exception e){ sandboxCertificate.delete(); throw new RuntimeException("Unable to create file for certificate:"+e.getMessage()); } } } if(prod2!=null){ if (Logger.isDebugEnabled()) Logger.debug("Creating production certificate for profile 2:"+prod2.getName()); File prodCertificate = new File(folder+sep+prod2.getName()); if(!prodCertificate.exists()){ try{ prodCertificate.createNewFile(); ByteArrayInputStream bais = new ByteArrayInputStream(prod.getContent()); FileUtils.copyInputStreamToFile(bais, prodCertificate); }catch(Exception e){ prodCertificate.delete(); throw new RuntimeException("Unable to create file for certificate:"+e.getMessage()); } } } if(sandbox2!=null){ if (Logger.isDebugEnabled()) Logger.debug("Creating sandbox certificate for profile 2:"+sandbox2.getName()); File sandboxCertificate = new File(folder+sep+sandbox2.getName()); if(!sandboxCertificate.exists()){ try{ sandboxCertificate.createNewFile(); ByteArrayInputStream bais = new ByteArrayInputStream(sandbox.getContent()); FileUtils.copyInputStreamToFile(bais, sandboxCertificate); }catch(Exception e){ sandboxCertificate.delete(); throw new RuntimeException("Unable to create file for certificate:"+e.getMessage()); } } } if(prod3!=null){ if (Logger.isDebugEnabled()) Logger.debug("Creating production certificate for profile 3:"+prod3.getName()); File prodCertificate = new File(folder+sep+prod3.getName()); if(!prodCertificate.exists()){ try{ prodCertificate.createNewFile(); ByteArrayInputStream bais = new ByteArrayInputStream(prod3.getContent()); FileUtils.copyInputStreamToFile(bais, prodCertificate); }catch(Exception e){ prodCertificate.delete(); throw new RuntimeException("Unable to create file for certificate:"+e.getMessage()); } } } if(sandbox3!=null){ if (Logger.isDebugEnabled()) Logger.debug("Creating sandbox certificate for profile 3:"+sandbox3.getName()); File sandboxCertificate = new File(folder+sep+sandbox3.getName()); if(!sandboxCertificate.exists()){ try{ sandboxCertificate.createNewFile(); ByteArrayInputStream bais = new ByteArrayInputStream(sandbox.getContent()); FileUtils.copyInputStreamToFile(bais, sandboxCertificate); }catch(Exception e){ sandboxCertificate.delete(); throw new RuntimeException("Unable to create file for certificate:"+e.getMessage()); } } } } public static File getCertificate(String name) { return new File(BBConfiguration.getPushCertificateFolder()+sep+name); } }
[ "registry.chou@gmail.com" ]
registry.chou@gmail.com
19216a8ddc8c26116cb09ea0e5341613f36d7383
0ff19f4342f59c7f1b8bf3a45202d0e31efc84b4
/src/main/java/edu/zju/corejava/v2ch06/layer/ColorFrame.java
1e02b106c91fbf61d01465cc1482d35fd3e6559f
[]
no_license
coder-chenzhi/core-java
ef9dd7f41157ad161c74826fb000bdacb14b5473
230e43a932ea16fc3fb03cc4c75cbbabff642bae
refs/heads/master
2021-06-20T08:54:11.622461
2017-07-11T11:51:03
2017-07-11T11:51:03
96,885,297
0
0
null
null
null
null
UTF-8
Java
false
false
2,472
java
package edu.zju.corejava.v2ch06.layer; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.plaf.*; /** * A frame with three text fields to set the background color. */ public class ColorFrame extends JFrame { private JPanel panel; private JTextField redField; private JTextField greenField; private JTextField blueField; public ColorFrame() { panel = new JPanel(); panel.add(new JLabel("Red:")); redField = new JTextField("255", 3); panel.add(redField); panel.add(new JLabel("Green:")); greenField = new JTextField("255", 3); panel.add(greenField); panel.add(new JLabel("Blue:")); blueField = new JTextField("255", 3); panel.add(blueField); LayerUI<JPanel> layerUI = new PanelLayer(); JLayer<JPanel> layer = new JLayer<JPanel>(panel, layerUI); add(layer); pack(); } class PanelLayer extends LayerUI<JPanel> { public void installUI(JComponent c) { super.installUI(c); ((JLayer<?>) c).setLayerEventMask(AWTEvent.KEY_EVENT_MASK | AWTEvent.FOCUS_EVENT_MASK); } public void uninstallUI(JComponent c) { ((JLayer<?>) c).setLayerEventMask(0); super.uninstallUI(c); } protected void processKeyEvent(KeyEvent e, JLayer<? extends JPanel> l) { l.repaint(); } protected void processFocusEvent(FocusEvent e, JLayer<? extends JPanel> l) { if (e.getID() == FocusEvent.FOCUS_GAINED) { Component c = e.getComponent(); c.setFont(getFont().deriveFont(Font.BOLD)); } if (e.getID() == FocusEvent.FOCUS_LOST) { Component c = e.getComponent(); c.setFont(getFont().deriveFont(Font.PLAIN)); } } public void paint(Graphics g, JComponent c) { super.paint(g, c); Graphics2D g2 = (Graphics2D) g.create(); g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .3f)); int red = Integer.parseInt(redField.getText().trim()); int green = Integer.parseInt(greenField.getText().trim()); int blue = Integer.parseInt(blueField.getText().trim()); g2.setPaint(new Color(red, green, blue)); g2.fillRect(0, 0, c.getWidth(), c.getHeight()); g2.dispose(); } } }
[ "coder.chenzhi@gmail.com" ]
coder.chenzhi@gmail.com
b50a6a3015bfe35b1fdec6566b66e2af8cd36e1e
3111cd8f8387ced3526df2dc64a291c89eed8328
/src/main/java/com/example/demo/model/Address.java
e1f635cc62970ac0372177e12d47b48029595cd8
[]
no_license
ahmedatef00/X-Store
7e8152e70641240b17eb381e94209c35a8056a6f
2890befedeb58c35efd9c415b49fe9fcc8d5abd3
refs/heads/master
2023-06-02T01:47:49.176871
2021-06-16T08:05:57
2021-06-16T08:05:57
372,320,063
0
0
null
null
null
null
UTF-8
Java
false
false
1,703
java
package com.example.demo.model; import javax.persistence.Embeddable; import java.io.Serializable; @Embeddable public class Address implements Serializable { private static final long serialVersionUID = 1953091537223398771L; private String country; private String state; private String city; private String street; private String zipCode; public Address() { } public Address(String country, String state, String city, String street, String zipCode) { this.country = country; this.state = state; this.city = city; this.street = street; this.zipCode = zipCode; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getStreet() { return street; } public void setStreet(String street) { this.street = street; } public String getZipCode() { return zipCode; } public void setZipCode(String zipCode) { this.zipCode = zipCode; } @Override public boolean equals(Object obj) { Address address = (Address) obj; return (country.equalsIgnoreCase(address.country) && city.equalsIgnoreCase(address.city) && state.equalsIgnoreCase(address.state) && street.equalsIgnoreCase(address.street) && zipCode.equals(address.zipCode)); } }
[ "ahmedatef62437@gmail.com" ]
ahmedatef62437@gmail.com
ca23a530763dfd527bccbc7b9e48ab279d5b9230
3aef310eaaddfa768620ecc570a46cf59b95a5f0
/src/main/java/com/bookManage/pojo/Reader.java
1c86f1806783ddb53205b05374f3ea8b05915d64
[]
no_license
Foolchum/bookManage
29bc84ee38715c86da85c79ce2ff00f032b9f11d
f09c12a6727f0f0944586d055a41714bb5cb7205
refs/heads/master
2020-04-24T07:02:39.137289
2019-02-21T02:28:20
2019-02-21T02:28:20
171,785,446
0
0
null
null
null
null
UTF-8
Java
false
false
2,234
java
package com.bookManage.pojo; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Table(name = "tb_reader") @Entity public class Reader { @Id private String readerNo; private String password; private String name; private String sex; private String tel; private String department;//院系 private String major; private int identity;//读者身份:1为学生,2为老师 private int readerState;//读者状态:1为有效,0为失效 private int illegalState;//违章状态:1为违章,0为正常 private String remark; public String getDepartment() { return department; } public void setDepartment(String department) { this.department = department; } public int getIdentity() { return identity; } public void setIdentity(int identity) { this.identity = identity; } public int getIllegalState() { return illegalState; } public void setIllegalState(int illegalState) { this.illegalState = illegalState; } public String getReaderNo() { return readerNo; } public void setReaderNo(String readerNo) { this.readerNo = readerNo; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getTel() { return tel; } public void setTel(String tel) { this.tel = tel; } public String getMajor() { return major; } public void setMajor(String major) { this.major = major; } public int getReaderState() { return readerState; } public void setReaderState(int readerState) { this.readerState = readerState; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } }
[ "foolchum@163.com" ]
foolchum@163.com
3597bf58bc46e8e70744c94fd976fd77be8414ca
f3c7ff8bf6e496b216da775eb9998147302b1995
/app/src/main/java/com/kaya/stareader/ui/activity/SearchByAuthorActivity.java
e90b68bc0f526f6c8dedeff5c08b96991159739a
[]
no_license
NEW-MIKE/Stareader
e1aceaa69f3794e519c5663886053c7b48301362
ba7ea73edd21f54757004bc6ad92a4fda86e6967
refs/heads/master
2023-02-26T23:09:19.854822
2021-02-07T14:32:19
2021-02-07T14:32:19
336,807,241
0
0
null
null
null
null
UTF-8
Java
false
false
3,551
java
/** * Copyright 2016 JustWayward Team * <p> * 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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.kaya.stareader.ui.activity; import android.content.Context; import android.content.Intent; import com.kaya.stareader.R; import com.kaya.stareader.data.model.bean.book.BooksByTag; import com.kaya.stareader.data.model.bean.other.SearchDetail; import com.kaya.stareader.di.component.AppComponent; import com.kaya.stareader.di.component.DaggerBookComponent; import com.kaya.stareader.ui.base.BaseRVActivity; import com.kaya.stareader.ui.contract.SearchByAuthorContract; import com.kaya.stareader.ui.easyadapter.SearchAdapter; import com.kaya.stareader.ui.presenter.SearchByAuthorPresenter; import java.util.ArrayList; import java.util.List; import javax.inject.Inject; /** * @author yuyh. * @date 2016/9/8. */ public class SearchByAuthorActivity extends BaseRVActivity<SearchDetail.SearchBooks> implements SearchByAuthorContract.View { public static final String INTENT_AUTHOR = "author"; public static void startActivity(Context context, String author) { context.startActivity(new Intent(context, SearchByAuthorActivity.class) .putExtra(INTENT_AUTHOR, author)); } @Inject SearchByAuthorPresenter mPresenter; private String author = ""; @Override public int getLayoutId() { return R.layout.activity_common_recyclerview; } @Override protected void setupActivityComponent(AppComponent appComponent) { DaggerBookComponent.builder() .appComponent(appComponent) .build() .inject(this); } @Override public void initToolBar() { author = getIntent().getStringExtra(INTENT_AUTHOR); mCommonToolbar.setTitle(author); mCommonToolbar.setNavigationIcon(R.drawable.ab_back); } @Override public void initDatas() { initAdapter(SearchAdapter.class, false, false); } @Override public void configViews() { mPresenter.attachView(this); mPresenter.getSearchResultList(author); } @Override public void onItemClick(int position) { SearchDetail.SearchBooks data = mAdapter.getItem(position); BookDetailActivity.startActivity(this, data._id); } @Override public void showSearchResultList(List<BooksByTag.TagBook> list) { List<SearchDetail.SearchBooks> mList = new ArrayList<>(); for (BooksByTag.TagBook book : list) { mList.add(new SearchDetail.SearchBooks(book._id, book.title, book.author, book.cover, book.retentionRatio, book.latelyFollower)); } mAdapter.clear(); mAdapter.addAll(mList); } @Override public void showError() { loaddingError(); } @Override public void complete() { mRecyclerView.setRefreshing(false); } @Override protected void onDestroy() { super.onDestroy(); if (mPresenter != null) { mPresenter.detachView(); } } }
[ "jj@email.com" ]
jj@email.com
7b2505b1c4e194a3ca273bab4b82fc6f1de5ec55
a59176c932650b8998c32659085799b106732356
/app/src/main/java/com/opengles/learnopengl/GLBase/LoadShader.java
83c7bac1e36c64d63f43c62e018193910be503a9
[]
no_license
LiuYiZhou95/openglProject
b907f353ca57b9a6f58462033a4dc1fd340f9c37
0109e8d4e3c29ea6519e8d27865feafb295f6314
refs/heads/master
2020-06-05T05:33:19.411769
2019-07-02T11:05:35
2019-07-02T11:05:35
192,330,174
0
1
null
null
null
null
UTF-8
Java
false
false
879
java
package com.opengles.learnopengl.GLBase; import android.content.Context; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; public class LoadShader { public LoadShader(){ } public static String LoadShaderStr(Context context, int resId){ StringBuffer strBuf = new StringBuffer(); try { InputStream inputStream = context.getResources().openRawResource(resId); BufferedReader in = new BufferedReader(new InputStreamReader(inputStream)); String read = in.readLine(); while (read != null) { strBuf.append(read + "\n"); read = in.readLine(); } strBuf.deleteCharAt(strBuf.length() - 1); } catch (Exception e) { e.printStackTrace(); } return strBuf.toString(); } }
[ "liuyizhou@yiruikecorp.com" ]
liuyizhou@yiruikecorp.com
7a2c59b7d7a42a4181dfd3404df26abe7006b1fc
7438f4b6f0adc39cfb14f57bedc13cbc3f0b10cd
/src/main/java/it/polito/appinternet/pedibus/Utils.java
583d099ca23bcff8050d1e866cea354b3c726dfc
[]
no_license
LucaMazzucco/Pedibus
9de1afaaa21a6b22a7328ffa03216ca9bd771b39
97072c7d782f7c5d41edebb82b94fb73f620eeac
refs/heads/master
2023-01-08T02:05:59.159805
2019-09-30T14:37:11
2019-09-30T14:37:11
211,838,785
0
0
null
2023-01-01T11:48:19
2019-09-30T10:52:36
Java
UTF-8
Java
false
false
971
java
package it.polito.appinternet.pedibus; import java.text.SimpleDateFormat; import java.util.Date; public class Utils { public static int myCompareUnixDate(long longA, long longB){ Date a = new Date(longA*1000); Date b = new Date(longB*1000); return myCompareDate(a,b); } public static int myCompareUnixTime(long longA, long longB){ Date a = new Date(longA*1000); Date b = new Date(longB*1000); return myCompareTime(a,b); } public static int myCompareDate(Date a, Date b){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy/mm/dd"); String dateA = sdf.format(a); String dateB = sdf.format(b); return dateA.compareTo(dateB); } public static int myCompareTime(Date a, Date b){ SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); String dateA = sdf.format(a); String dateB = sdf.format(b); return dateA.compareTo(dateB); } }
[ "jeanpi.francois@gmail.com" ]
jeanpi.francois@gmail.com
3200a45928c4a07dfa9dfdc5bf42c2d1d10b03c8
ef4186f756553c64d351638591ca0c29da2adbb1
/txmanager/src/main/java/com/zrq/transaction/txmanager/TxManagerMain.java
fbbef7e812ece03dc9bffb6a62e7e2badfd34196
[]
no_license
zrq2017/DistributedTransaction
1664d02e99761868a928f1b5e8df12d7bd24552c
56e32cb9054ad31f503a6557b3ef6c0ada9a0629
refs/heads/master
2020-05-21T07:55:05.730179
2019-05-11T13:06:55
2019-05-11T13:06:55
185,967,482
0
0
null
null
null
null
UTF-8
Java
false
false
268
java
package com.zrq.transaction.txmanager; public class TxManagerMain { public static void main(String[] args) { NettyServer nettyServer=new NettyServer(); nettyServer.start("localhost",8080); System.out.println("netty 启动成功"); } }
[ "1258303476@qq.com" ]
1258303476@qq.com
149210612945a95a3b172289692fd106afc602dd
6740d9741c659f8ab82eeed8a78fb8365515c1b8
/app/src/main/java/mx/com/softwell/inventarioapp/mainModule/events/MainEvent.java
be13a929864f083a82888e31bce751767c1f2e63
[]
no_license
xHaswell/InventarioApp8vo
a6dc697b9fd6296a2d79dda8486c0270ad18a81f
811ce108d6ae42b42cdaa767484abab6af56aeb1
refs/heads/master
2020-04-28T18:06:51.224596
2019-04-30T12:17:46
2019-04-30T12:17:46
175,468,287
0
0
null
null
null
null
UTF-8
Java
false
false
948
java
package mx.com.softwell.inventarioapp.mainModule.events; import mx.com.softwell.inventarioapp.common.pojo.Producto; public class MainEvent { public static final int SUCCESS_ADD = 0; public static final int SUCCESS_UPDATE = 1; public static final int SUCCESS_REMOVE = 2; public static final int ERROR_SERVER = 100; public static final int ERROR_TO_REMOVE = 101; private Producto producto; private int typeEvent; private int resMsg; public MainEvent() { } public Producto getProducto() { return producto; } public void setProducto(Producto producto) { this.producto = producto; } public int getTypeEvent() { return typeEvent; } public void setTypeEvent(int typeEvent) { this.typeEvent = typeEvent; } public int getResMsg() { return resMsg; } public void setResMsg(int resMsg) { this.resMsg = resMsg; } }
[ "framirez.ics@gmail.com" ]
framirez.ics@gmail.com
ea658fbc8f11e16867ee1f6660c943ef8e5f2552
b8b27a2e6ecf045f72eecfe467203f7d5ed80700
/app/src/main/java/com/example/emergencytime/webscrape.java
ce8371bfb86b47e6e9228dcd012a3495c1a44f77
[]
no_license
jatandip/Wait-ER
d8d26f098b8ada35a41c49c101b790cc31ad2769
0a31491cc5750f34ebe87bc32cfe8f6591b9cfc0
refs/heads/master
2020-12-18T20:50:53.311219
2020-01-22T06:53:19
2020-01-22T06:53:19
235,516,406
0
1
null
null
null
null
UTF-8
Java
false
false
2,049
java
package com.example.emergencytime; import org.jsoup.Jsoup; import java.util.*; import org.jsoup.nodes.*; import org.jsoup.select.Elements; import android.os.AsyncTask; import android.util.Log; public class webscrape { Map<String, String> waitTimes = new HashMap<String, String>(); private class GetDocument extends AsyncTask<String,Void,Void> { @Override protected Void doInBackground(String... city) { Document document = null; try { String url = "http://www12.albertahealthservices.ca/repacPublic/SnapShotController?direct=display" + city[0]; Log.e("URL:",url); document = Jsoup.connect(url).get(); Log.e("doc:",document.toString()); Elements table = document.getElementsByClass("publicRepacTable"); Elements rows = table.select("tr"); for (Element row : rows) { String name = row.getElementsByClass("publicRepacSiteText").text(); if (name.length() == 0) { continue; } String time = ""; String[] numbers = {"One", "Two", "Three", "Four"}; for (String number : numbers) { String imageName = "publicClockNumber" + number + "Gif"; Elements images = row.getElementsByClass(imageName); time = time + images.select("img").attr("alt"); if (time.length() == 0) { time += "Not available"; break; } } waitTimes.put(name, time); } } catch (Exception ex) { Log.e("Error:",ex.toString()); } return null; } } public Map<String, String> get_time(String city) { new GetDocument().execute(city); return waitTimes; } }
[ "jatanmultani@gmail.com" ]
jatanmultani@gmail.com
97bb116133d1a43b7b75ea551fec623375be14fc
2a1de1e2c65bf48736c507aa19d2ec6675514381
/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatDraculaIJTheme.java
89abe663ff048fa97784f4116cabb645e1b2ef29
[ "Apache-2.0" ]
permissive
lsimediasarl/FlatLaf
cff8b410175f1e005073a37d5090926745df18af
75f76f4875836fbd73db902324038a4a6e2f085c
refs/heads/main
2023-06-29T07:58:14.825084
2021-08-02T13:27:25
2021-08-02T13:27:25
353,286,928
0
0
Apache-2.0
2021-03-31T08:43:29
2021-03-31T08:43:28
null
UTF-8
Java
false
false
1,504
java
/* * Copyright 2020 FormDev Software GmbH * * 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 com.formdev.flatlaf.intellijthemes; // // DO NOT MODIFY // Generated with com.formdev.flatlaf.demo.intellijthemes.IJThemesClassGenerator // import com.formdev.flatlaf.IntelliJTheme; /** * @author Karl Tauber */ public class FlatDraculaIJTheme extends IntelliJTheme.ThemeLaf { public static final String NAME = "Dracula"; public static boolean setup() { try { return setup( new FlatDraculaIJTheme() ); } catch( RuntimeException ex ) { return false; } } /** * @deprecated use {@link #setup()} instead; this method will be removed in a future version */ @Deprecated public static boolean install() { return setup(); } public static void installLafInfo() { installLafInfo( NAME, FlatDraculaIJTheme.class ); } public FlatDraculaIJTheme() { super( Utils.loadTheme( "Dracula.theme.json" ) ); } @Override public String getName() { return NAME; } }
[ "karl@jformdesigner.com" ]
karl@jformdesigner.com
e3058923a7f1c4f1f51141aff7fc2c8c42cb01a6
7a577256b09c416be855c9de8feb3b4d5260df00
/externalTest/pm/net/icici/TransactionDownloaderExternalTest.java
1b24ba9ef86d5bf8135a49320d89d9aa8b8135f0
[]
no_license
thaond/pm2
317006f10c6bd798cd6c9e5fe7f3dcaaa3f3983b
e622222ea39443cf02b4cc3157948ad9dc18e554
refs/heads/master
2021-01-01T15:51:02.130554
2010-09-04T16:39:24
2010-09-04T16:39:24
41,950,306
0
0
null
null
null
null
UTF-8
Java
false
false
918
java
package pm.net.icici; import junit.framework.TestCase; import pm.util.AppConst; import pm.util.PMDate; import pm.vo.ICICITransaction; import pm.vo.TransactionVO; import java.util.List; public class TransactionDownloaderExternalTest extends TestCase { public void testDownload() { List<ICICITransaction> transactions = new TransactionDownloader(new PMDate(1, 6, 2008), new PMDate(23, 6, 2008)).download(); assertEquals(5, transactions.size()); TransactionVO ranbaxyBuy = new ICICITransaction(new PMDate(11, 6, 2008), "RANLAB", AppConst.TRADINGTYPE.Buy, 30f, 571f, 165.76f, false, "20080611N600020451"); assertEquals(ranbaxyBuy, transactions.get(0)); TransactionVO suntvSell = new ICICITransaction(new PMDate(10, 6, 2008), "SUNTV", AppConst.TRADINGTYPE.Sell, 25f, 338.1f, 18.97f, true, "20080610N900008911"); assertEquals(suntvSell, transactions.get(1)); } }
[ "thiyagu@gmail.com" ]
thiyagu@gmail.com
13928b1184c4944f8486eae04b68bc4b3d7f79dd
535e348bff2ae4e8c8b94e57ca59d68fe9dc9cba
/microservice/menu/src/main/java/com/zzh/menu/Controller/MenuHandler.java
481404e9c4a6410348c41edaa318c728adcf09a2
[]
no_license
zhangzihao0123/orderingSystem
989996e61cdab2bf0746098cbceaa0570494b30a
e4b0cf09fcb0dd5dfd64ea06b29ceda9f769a816
refs/heads/master
2020-09-25T16:48:33.897717
2019-12-05T08:00:38
2019-12-05T08:00:38
226,047,127
0
0
null
null
null
null
UTF-8
Java
false
false
1,693
java
package com.zzh.menu.Controller; import com.zzh.menu.entity.Menu; import com.zzh.menu.entity.MenuVO; import com.zzh.menu.entity.Type; import com.zzh.menu.repository.MenuRepository; import com.zzh.menu.repository.TypeRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; import java.util.List; @RestController @RequestMapping("/menu") public class MenuHandler { @Value("${server.port}") private String port; @Autowired private MenuRepository menuRepository; @Autowired private TypeRepository typeRepository; @GetMapping("/index") public String index(){ return "menu的端口:"+this.port; } @GetMapping("/findAll/{index}/{limit}") public MenuVO findAll(@PathVariable("index") int index, @PathVariable("limit") int limit){ return new MenuVO(0,"",menuRepository.count(),menuRepository.findAll(index, limit)); } @DeleteMapping("/deleteById/{id}") public void deleteById(@PathVariable("id") long id){ menuRepository.deleteById(id); } @GetMapping("/findTypes") public List<Type> findTypes(){ return typeRepository.findAll(); } @PostMapping("/save") public void save(@RequestBody Menu menu){ menuRepository.save(menu); } @GetMapping("/findById/{id}") public Menu findById(@PathVariable("id") long id){ return menuRepository.findById(id); } @PutMapping("/update") public void update(@RequestBody Menu menu){ menuRepository.update(menu); } }
[ "zhangzihao@zhangzihaodeMacBook-Air.local" ]
zhangzihao@zhangzihaodeMacBook-Air.local
9281153c01f9c2174ffa23bbf5de6ea073ac0672
fc6c869ee0228497e41bf357e2803713cdaed63e
/weixin6519android1140/src/sourcecode/com/tencent/mm/plugin/appbrand/dynamic/b/a.java
276ed0e18fffcb928f00b758578a9e1a313426f7
[]
no_license
hyb1234hi/reverse-wechat
cbd26658a667b0c498d2a26a403f93dbeb270b72
75d3fd35a2c8a0469dbb057cd16bca3b26c7e736
refs/heads/master
2020-09-26T10:12:47.484174
2017-11-16T06:54:20
2017-11-16T06:54:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,810
java
package com.tencent.mm.plugin.appbrand.dynamic.b; import android.graphics.Bitmap; import com.tencent.gmtrace.GMTrace; import com.tencent.mm.modelappbrand.a.b.c; import com.tencent.mm.modelappbrand.a.b.i; import com.tencent.mm.plugin.appbrand.dynamic.i.c; import com.tencent.mm.sdk.platformtools.bg; import com.tencent.mm.sdk.platformtools.d; import com.tencent.mm.sdk.platformtools.w; import com.tencent.xweb.k; import java.io.IOException; import java.io.InputStream; public final class a { private static final b.i hTh; static { GMTrace.i(19912273690624L, 148358); hTh = new b.c(); GMTrace.o(19912273690624L, 148358); } public static Bitmap aV(String paramString1, String paramString2) { GMTrace.i(19912139472896L, 148357); if ((bg.nm(paramString1)) || (bg.nm(paramString2))) { GMTrace.o(19912139472896L, 148357); return null; } Object localObject = com.tencent.mm.plugin.appbrand.appcache.a.oj(paramString2); if (bg.nm((String)localObject)) { GMTrace.o(19912139472896L, 148357); return null; } paramString2 = paramString1 + '#' + (String)localObject; Bitmap localBitmap = hTh.hC(paramString2); if ((localBitmap != null) && (!localBitmap.isRecycled())) { GMTrace.o(19912139472896L, 148357); return localBitmap; } paramString1 = c.aX(paramString1, (String)localObject); if (paramString1 != null) {} try { if (paramString1.mInputStream != null) { int i = paramString1.mInputStream.available(); if (i > 0) {} } else { if (paramString1 != null) { bg.g(paramString1.mInputStream); } GMTrace.o(19912139472896L, 148357); return null; } localObject = d.decodeStream(paramString1.mInputStream); if ((localObject != null) && (!((Bitmap)localObject).isRecycled())) { hTh.b(paramString2, (Bitmap)localObject); if (paramString1 != null) { bg.g(paramString1.mInputStream); } GMTrace.o(19912139472896L, 148357); return (Bitmap)localObject; } } catch (IOException paramString2) { for (;;) { w.e("MicroMsg.CanvasImageCache", "try decode icon e = %s", new Object[] { paramString2 }); if (paramString1 != null) { bg.g(paramString1.mInputStream); } } } finally { if (paramString1 == null) { break label276; } bg.g(paramString1.mInputStream); } GMTrace.o(19912139472896L, 148357); return null; } } /* Location: D:\tools\apktool\weixin6519android1140\jar\classes2-dex2jar.jar!\com\tencent\mm\plugin\appbrand\dynamic\b\a.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "robert0825@gmail.com" ]
robert0825@gmail.com
b8d0e42ed0cd8f127d158c8fffdb1c2ae1f6d97d
463d88f2fb16c4486ba0da4e124ba4b5ca3d8468
/day4/src/labtestsolutions/JavaDocQ14.java
7cbe330a295ca88a713700bff8fe263775141d05
[]
no_license
yashu183/presidio-java-intern
d364b4a3f9f0763292303d937a961690226c8833
a4eb67ef8cd244c5716280ca88f5b2f6cff4bcbe
refs/heads/master
2023-04-05T14:12:06.302505
2021-04-21T12:43:02
2021-04-21T12:43:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
806
java
package labtestsolutions; /** * This is a documentation comment * This gives a brief of the package*/ public class JavaDocQ14 { public static void main(String[] args) { System.out.println("javadoc generated documentation of a package/source file"); } } //without public specifier //public class JavaDocQ14 { // static void main(String[] args) { // System.out.println("javadoc generated documentation of a package/source file"); // } //} //without public specifier //public class JavaDocQ14 { // public void main(String[] args) { // System.out.println("javadoc generated documentation of a package/source file"); // } //} //without public specifier //public class JavaDocQ14 { // static void main() { // System.out.println("javadoc generated documentation of a package/source file"); // } //}
[ "deepak.tammali627@gmail.com" ]
deepak.tammali627@gmail.com
410c4efa586ca54c011c3b1ed70aabdcef92f29e
18d1d56055d8f76ad8f5cebf0a1367e002bb275a
/java/src/rbsa/eoss/Resource.java
733aaf209888e1f8b749017c9181f2850df2bebb
[]
no_license
hsbang09/IFEED_RBSA
c85361a19035039a6cfded35e773a2c652683e29
fc0b65b53c6cf02b22648ee6ca963c8fee54b46d
refs/heads/master
2021-01-13T03:19:19.280063
2017-05-07T14:55:37
2017-05-07T14:55:37
77,577,573
0
0
null
null
null
null
UTF-8
Java
false
false
1,126
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package rbsa.eoss; /** * * @author Marc */ import jess.Rete; public class Resource { private Rete r; // private Rete r2; private QueryBuilder qb; // private QueryBuilder qb2; private MatlabFunctions m; // private MatlabFunctions m2; public Resource() { r = new Rete(); // r2 = new Rete(); qb = new QueryBuilder( r ); // qb2 = new QueryBuilder(r2); m = new MatlabFunctions(this); r.addUserfunction(m); // r2.addUserfunction(m); JessInitializer.getInstance().initializeJess( r, qb, m ); // JessInitializer.getInstance().initializeJess( r2, qb2, m); } public Rete getRete() { return r; } // public Rete getRete2(){ // return r2; // } public QueryBuilder getQueryBuilder() { return qb; } // public QueryBuilder getQueryBuilder2(){ // return qb2; // } public MatlabFunctions getM() { return m; } }
[ "bang@Hyunseungs-MacBook-Pro.local" ]
bang@Hyunseungs-MacBook-Pro.local
b81323001a18e7ea282cfd7d61953fc9bfb98bac
0a21bc29127c59a5703c2114b63a815be685cf21
/SimpleService/src-gen/com/actifsource/simpleservice/generic/javamodel/Call.java
406d6ce2b0914ae4ce5add4acc8a57e69209ae3d
[]
no_license
copton/ActifsourceExamples
00ccd2dd4ffa01cd4cc234981565d55781a9b021
a37044c2b547503e2f72e421a291532a9f9c26e3
refs/heads/master
2016-09-05T16:42:50.124353
2010-07-13T13:15:27
2010-07-13T13:15:27
765,508
3
0
null
null
null
null
UTF-8
Java
false
false
2,281
java
package com.actifsource.simpleservice.generic.javamodel; import java.util.List; import java.util.Map; import ch.actifsource.util.collection.IMultiMapOrdered; import ch.actifsource.core.dynamic.*; @SuppressWarnings("unused") @edu.umd.cs.findbugs.annotations.SuppressWarnings("EQ_DOESNT_OVERRIDE_EQUALS") public class Call extends DynamicActifsourceResource implements ICall { private java.lang.String fName; public Call() {} public Call(IDynamicResourceRepository resourceRepository, ch.actifsource.core.Resource resource) { super(resourceRepository, resource); } // attributes @Override public java.lang.String selectName() { return fName; } public void setName(java.lang.String name) { fName = name; } // relations @Override public List<? extends com.actifsource.simpleservice.generic.javamodel.IParameter> selectParameter() { return _getList(com.actifsource.simpleservice.generic.javamodel.IParameter.class, "17f87c19-8b4c-11df-abce-ffdcfaccc0b3"); } @Override public com.actifsource.simpleservice.generic.javamodel.IType selectReturnType() { return _getSingle(com.actifsource.simpleservice.generic.javamodel.IType.class, "43ca7009-8b4c-11df-abce-ffdcfaccc0b3"); } @Override public ch.actifsource.core.javamodel.IClass selectTypeOf() { return _getSingle(ch.actifsource.core.javamodel.IClass.class, "3169f49a-f91f-11d9-bb45-5fabdff7c7da"); } // toMeRelations public static com.actifsource.simpleservice.generic.javamodel.ICall selectToMeParameter(com.actifsource.simpleservice.generic.javamodel.IParameter object) { return _getToMeSingle(object.getRepository(), com.actifsource.simpleservice.generic.javamodel.ICall.class, "17f87c19-8b4c-11df-abce-ffdcfaccc0b3", object.getResource()); } public static List<com.actifsource.simpleservice.generic.javamodel.ICall> selectToMeReturnType(com.actifsource.simpleservice.generic.javamodel.IType object) { return _getToMeList(object.getRepository(), com.actifsource.simpleservice.generic.javamodel.ICall.class, "43ca7009-8b4c-11df-abce-ffdcfaccc0b3", object.getResource()); } } /* Actifsource ID=[4d723cb5-db37-11de-82b8-17be2e034a3b,64e13a40-8b2f-11df-b449-ffd07f85dbbb,true,64e13a40-8b2f-11df-b449-ffd07f85dbbb] */
[ "alex@copton.net" ]
alex@copton.net
ee4f14d196053f764c0a1fb63fe791aff0f7f4f5
0f21b35272ae2527ff1ab95a258378d3fb8418eb
/Basic/src/main/java/com/sh/$17/$02/$17/App1.java
fdf106c81841a0b49263e1cdeb7f3c241571b851
[]
no_license
ShuaiJunlan/java-learning
c1a92b41ba4ed1ff880e55a70330dd342dc6e8c6
ae5cbbf146e6c059b5cd613bcd095d7855a00f8e
refs/heads/master
2023-03-04T07:14:22.649266
2022-11-18T07:34:16
2022-11-18T07:34:16
162,292,537
4
0
null
2023-02-22T07:22:48
2018-12-18T13:29:13
Java
UTF-8
Java
false
false
372
java
package com.sh.$17.$02.$17; /** * @author Junlan Shuai[shuaijunlan@gmail.com]. * @date Created on 10:36 2017/2/17. */ public class App1 { private int m; public int inc() { return m + 1; } public void trye() { try { } catch(Exception e) { } finally { } } }
[ "shuaijunlan@gmail.com" ]
shuaijunlan@gmail.com
b4248b9d71044a8d060014dd4871f6ef40e63865
9d217d4644a66d478ca4e7516e846d4c1f6938fb
/bag_packer/src/main/java/com/saugat/bag_packer/api/HotelAPI.java
cbfaa971628a616e0ebf608e748291f48bbf6f24
[]
no_license
saugatkc/shared_HOTEL_app
3c8527c62f7dcc7eb14af497bacf8b53f93e91e5
1d06205b6b17231b90d6f39f41726dc5f07d9904
refs/heads/master
2022-11-16T12:00:52.993459
2020-07-15T03:32:40
2020-07-15T03:32:40
279,753,492
0
0
null
null
null
null
UTF-8
Java
false
false
399
java
package com.saugat.bag_packer.api; import com.saugat.bag_packer.model.Hotel; import com.saugat.bag_packer.model.Hotel; import java.util.List; import retrofit2.Call; import retrofit2.http.GET; import retrofit2.http.Header; import retrofit2.http.Path; public interface HotelAPI { @GET("hotels/hoteldetails") Call<List<Hotel>> hotelsDetails (@Header("Authorization") String token ); }
[ "thelastresort35@gmail.com" ]
thelastresort35@gmail.com
3b1b7aeb3478546b9def7c9224c8ee29898dc9e6
ed865190ed878874174df0493b4268fccb636a29
/PuridiomWeb/src/com/tsa/puridiom/handlers/VendorInsuranceRetrieveByVendorIdHandler.java
4e59783ba07c3165df297d2590cc89367e78e153
[]
no_license
zach-hu/srr_java8
6841936eda9fdcc2e8185b85b4a524b509ea4b1b
9b6096ba76e54da3fe7eba70989978edb5a33d8e
refs/heads/master
2021-01-10T00:57:42.107554
2015-11-06T14:12:56
2015-11-06T14:12:56
45,641,885
0
0
null
null
null
null
UTF-8
Java
false
false
1,117
java
package com.tsa.puridiom.handlers; import com.tsagate.foundation.processengine.*; import java.util.*; public class VendorInsuranceRetrieveByVendorIdHandler implements IHandler { public Map handleRequest (Map incomingRequest) throws Exception { try { PuridiomProcessLoader processLoader = new PuridiomProcessLoader((String)incomingRequest.get("organizationId")); PuridiomProcess process = processLoader.loadProcess("vendorinsurance-retrieve-by-vendorid.xml"); process.executeProcess(incomingRequest); if (process.getStatus() == Status.SUCCEEDED) { incomingRequest.put("viewPage", incomingRequest.get("successPage")); } else { incomingRequest.put("viewPage", incomingRequest.get("failurePage")); } } catch (Exception exception) { incomingRequest.put("errorMsg", exception.getMessage()); incomingRequest.put("viewPage", incomingRequest.get("failurePage")); throw exception; } finally { if (incomingRequest.get("viewPage") == null) { incomingRequest.put("viewPage", incomingRequest.get("failurePage")); } } return incomingRequest; } }
[ "brickerz@9227675a-84a3-4efe-bc6c-d7b3a3cf6466" ]
brickerz@9227675a-84a3-4efe-bc6c-d7b3a3cf6466
7650040f40d76305588085632cec1fd41bb03ca3
e326c63d7348b0b393afa42857bd9c29b0d2cc84
/src/trafficSim/contexts/AgentContext.java
f00a09760f7102333f4115875b02b90996ba62cc
[]
no_license
chirichignoa/ParkingSim
00db9bef576639e9a1093a2586fb9f29838bd58b
e2706a01a4a3ce9d3ca7fb971213e84795a0ae7b
refs/heads/master
2020-04-20T18:05:32.675073
2019-03-27T18:18:08
2019-03-27T18:18:08
169,008,292
0
0
null
null
null
null
UTF-8
Java
false
false
232
java
package trafficSim.contexts; import repast.simphony.context.DefaultContext; import trafficSim.agents.CarAgent; public class AgentContext extends DefaultContext<CarAgent> { public AgentContext() { super("AgentContext"); } }
[ "chirichignoa@gmail.com" ]
chirichignoa@gmail.com
4b1bbef0e70ea2914141e2efc1becd701d960504
ae633112d67345d072b5236ba9cbc44a4fc202e2
/other/src/main/java/com/examplexyy/demo/socket/BIOServer.java
607f7ba41d5de0cf70f9bbb45528a41211f8f843
[]
no_license
xyy931101/demos
54b86e5b929baa67c66c2b29f6ce0b5f6cf57d46
2435adf663d15589ef08194e01d0ae322ef83c73
refs/heads/master
2022-10-18T00:10:14.317383
2022-08-27T08:14:05
2022-08-27T08:14:05
198,722,804
0
0
null
2022-10-05T01:08:44
2019-07-24T23:31:10
Java
UTF-8
Java
false
false
65
java
package com.examplexyy.demo.socket; public class BIOServer { }
[ "18850198317@163.com" ]
18850198317@163.com
eb386510e8ea41d7c69739db79f9fc16883694b5
43f1555aa841a74eb82cd98a38cf4f1f5b0fb878
/src/main/java/com/laioffer/jupiter/entity/User.java
78875ed3b947e6b29cc3256c03d67d90807b46cf
[]
no_license
kuramayuki/jupiter_twitch
e56521268d623a62cf74564f722770224b647f6e
0fd22d819357934b56a2479d8be5956c258e854c
refs/heads/master
2023-07-10T09:07:46.103436
2021-08-09T22:35:45
2021-08-09T22:35:45
383,998,760
0
0
null
null
null
null
UTF-8
Java
false
false
2,250
java
package com.laioffer.jupiter.entity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonDeserialize(builder = User.Builder.class) public class User { @JsonProperty("user_id") private final String userId; @JsonProperty("password") private String password; @JsonProperty("first_name") private final String firstName; @JsonProperty("last_name") private final String lastName; private User(Builder builder) { this.userId = builder.userId; this.password = builder.password; this.firstName = builder.firstName; this.lastName = builder.lastName; } public String getUserId() { return userId; } public String getPassword() { return password; } public User setPassword(String password) { this.password = password; return this; } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) public static class Builder { @JsonProperty("user_id") private String userId; @JsonProperty("password") private String password; @JsonProperty("first_name") private String firstName; @JsonProperty("last_name") private String lastName; public Builder userId(String userId) { this.userId = userId; return this; } public Builder password(String password) { this.password = password; return this; } public Builder firstName(String firstName) { this.firstName = firstName; return this; } public Builder lastName(String lastName) { this.lastName = lastName; return this; } public User build() { return new User(this); } } }
[ "shirly_yukizhang@hotmail.com" ]
shirly_yukizhang@hotmail.com
89b6497c145dea99e65f2e2eb49bb7b6778c9225
74af905a30f55d9fca3223b6aaba7b1b880b8101
/src/main/java/oop/assignment2/ex33/base/MagicBall.java
558eae7c555bf6c9023bbda0f189fd627f6f7fda
[]
no_license
GSabiniPanini/little-cop3330-assignment2
0d70d5d97690f20e664d2e90840d4d05c3dffbef
e5bc9f9487e59f3d11089379b156e89a6edb7ed7
refs/heads/master
2023-05-21T00:55:07.902429
2021-06-13T16:15:34
2021-06-13T16:15:34
376,391,100
0
0
null
null
null
null
UTF-8
Java
false
false
857
java
package oop.assignment2.ex33.base; /* * UCF COP3330 Summer 2021 Assignment 2 Solution * Copyright 2021 Glenroy Little */ import java.util.Random; import java.util.Scanner; public class MagicBall { private String[] outputs = {"Yes", "No", "Maybe", "Ask again later."}; private Random rand = new Random(); private static final Scanner in = new Scanner(System.in); int number = rand.nextInt((3-1) + 1) + 1; public void askquestion() { System.out.println("What's your question?"); System.out.print("> "); in.nextLine(); System.out.println(); } public int getrandomnumber() { int number = rand.nextInt((3-1) + 1) + 1; return number; } public String generateoutput(int number) { String output = this.outputs[number]; return output; } }
[ "glittle02@knights.ucf.edu" ]
glittle02@knights.ucf.edu
cdce49230b6ea6965031de9c847facac14cfd6f0
b1605cc4420d074d2d2b598b71e717168e39547b
/src/Java15/ZmonesMasinos/Masina.java
8111b55924f28d04bc80aa5c445fadf0caea7092
[]
no_license
rVaidas/JAVA-Basics-1
a3eba217dd6477317fd804b81be70f3e40a2702b
b16cc33969e67469c8ac767463f430a0d035f080
refs/heads/master
2023-08-19T01:39:01.029948
2021-10-14T18:22:19
2021-10-14T18:22:19
413,489,162
0
0
null
null
null
null
UTF-8
Java
false
false
597
java
package Java15.ZmonesMasinos; public class Masina { private String marke; private String numeriai; public Masina(String marke, String numeriai) { this.marke = marke; this.numeriai = numeriai; } public String toString() { return marke + " " + numeriai; } public String getMarke() { return marke; } public void setMarke(String marke) { this.marke = marke; } public String getNumeriai() { return numeriai; } public void setNumeriai(String numeriai) { this.numeriai = numeriai; } }
[ "vaidas.ronkaitis@gmail.com" ]
vaidas.ronkaitis@gmail.com
12a912ebd976477d71d7923ce4e6fe3933b5549d
dc2403dc9674aae232e55bd2069e1f9863845cb6
/data-structure/xmg/第一季/day05-栈/src/com/jqc/list/ArrayList.java
059205ee55a466762267494c0ddd32e3fdb5de65
[]
no_license
appbanana/MachineLearningAction
ecf87fba1450c830c65f6e4a57c48ce116230dda
0af2f354477c5cabda14950d0c6352e4a258493f
refs/heads/master
2020-04-18T01:46:02.912154
2020-01-10T08:57:17
2020-01-10T08:57:17
167,133,097
0
0
null
null
null
null
UTF-8
Java
false
false
3,892
java
package com.jqc.list; public class ArrayList<E> extends AbstractList<E> { private static final int DEFAULT_CAPACITY = 5; /** * 暂时保存数组元素 */ private E[] elements; public ArrayList(int capacity){ capacity = (capacity < DEFAULT_CAPACITY) ? DEFAULT_CAPACITY : capacity; // Object 是除了Object外所有对象的父类 elements = (E[]) new Object[capacity]; } public ArrayList(){ this(DEFAULT_CAPACITY); } /** * 插入一个元素 * @param index 下标 * @param element 元素 */ public void add(int index, E element){ rangeCheckForAdd(index); ensureCapacity(size+1); // 插入 从尾部开始 元素依次往后移动 // for (int i = size-1; i >= index ; i--) { for (int i = size; i > index ; i--) { elements[i] = elements[i-1]; } elements[index] = element; size++; } /** * 删除元素 并返回已经删除的元素 * @param element 元素 */ public E remove(int index){ // if (index <0 || index > size - 1) { // throw new IndexOutOfBoundsException("Index:" + index + ", Size:" + size); // } rangeCheck(index); E old = elements[index]; for (int i = index; i < size - 1; i++) { elements[i] = elements[i+1]; } // size--; elements[--size] = null; return old; } /** * 改 * @param element 元素 */ public E set(int index, E element){ // if (index < 0 || index > size - 1) { // throw new IndexOutOfBoundsException("Index:" + index + ", Size:" + size); // } rangeCheck(index); E old = elements[index]; elements[index] = element; return old; } /** * 根据索引获取元素 * @param index 下标 */ public E get(int index){ rangeCheck(index); return elements[index]; } /** * 查 * @param element 元素 */ public int indexOf(E element){ if (element == null){ for (int i = 0; i < size; i++) { if (elements[i] == null) return i; } }else { for (int i = 0; i < size; i++) { if (elements[i].equals(element)) { return i; } } } return ELEMENT_NOT_FOUND; } public void clear(){ // size = 0; // 这跟java的垃圾回收机制有关 当数组容器中存放的是对象,不用的时候需要考虑到把数组中元素置位null for (int i = 0; i < size; i++) { elements[i] = null; } size = 0; } @Override public String toString() { StringBuilder string = new StringBuilder(); string.append("size=").append(size).append(",["); for (int i = 0; i < size; i++) { if (i != 0){ string.append(','); } string.append(elements[i]); } string.append(']'); return string.toString(); } /** * 扩容 * @param capacity 原来的容量 */ private void ensureCapacity(int capacity){ int oldCapacity = elements.length; if (oldCapacity >= capacity) return; // 开始扩容 新的容量为旧的容量的1.5倍 使用按位移动 效率更快 // 这要加一个小括号 因为位运算的级别最低 int newCapacity = oldCapacity + (oldCapacity >> 1); E[] newElements = (E[])new Object[newCapacity]; // 把原来的元素拷贝过来 for (int i = 0; i < size; i++) { newElements[i] = elements[i]; } elements = newElements; System.out.println(oldCapacity + "扩容为" + newCapacity); } }
[ "1243684438@qq.com" ]
1243684438@qq.com
1987f679e39997e2b7675058a9c4315d1f74a460
7a6066be4191849e34d4f0e5c51774074eddab8e
/child/src/com/fh/controller/weixin/schoolPay/DifferentPayController.java
92631d6d3dd03876086bc2335854a81cba560d82
[]
no_license
llk-90/llkRepository
5faebe6e3217ab0cd05a1424724665e2ec21934d
ae5a3f96d87f655b06aec06782285c75cf9a47e9
refs/heads/master
2020-03-19T09:18:11.641387
2018-08-13T08:21:11
2018-08-13T08:21:11
136,275,648
1
0
null
null
null
null
UTF-8
Java
false
false
1,914
java
package com.fh.controller.weixin.schoolPay; import java.util.HashMap; import java.util.Map; import java.util.SortedMap; import java.util.TreeMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import com.fh.controller.base.BaseController; import com.fh.util.PageData; import com.fh.util.schoolPayUtil.HttpUtils; import com.fh.util.schoolPayUtil.XFTPayCommonUtil; import com.fh.util.schoolPayUtil.XMLUtil; /** * 未完成 * @author admin * */ @RestController @RequestMapping("differentPay") public class DifferentPayController extends BaseController { @RequestMapping("/createOrder") @ResponseBody public PageData differentPay() { PageData pd = this.getPageData(); //String order_url = "http://ad.xft123.com/xftpay/getnotifyxml";//异步支付请求地址() String order_url = "http://cs.xft123.com/xftpay/getnotifyxml";//异步支付请求地址() //order_url="http://ad.xft123.com/xftpay/getnotifyxml";// String mch_id = "00000515";// 校付通子商户号,由校付通提供 StringBuilder id = new StringBuilder(); id.append(System.currentTimeMillis()); String out_trade_no = id.toString();// 校付通子商户订单号,第三方内部订单号要唯一 //构建请求xml SortedMap<Object, Object> pm = new TreeMap<Object, Object>(); pm.put("out_trade_no", out_trade_no);// 客户内部订单号 pm.put("mch_id", mch_id);// 村付通商户号 String differentPayReq = XFTPayCommonUtil.getRequestXml(pm);// xml格式参数文本 //开始请求 String xmlR = HttpUtils.post(order_url, differentPayReq, HttpUtils.UTF8); Map<String, String> rm = null; try { rm = XMLUtil.doXMLParse(xmlR); } catch (Exception e) { e.printStackTrace(); } pd.put("state", rm.get("trade_status")); return pd; } }
[ "33407076+llk-90@users.noreply.github.com" ]
33407076+llk-90@users.noreply.github.com
c20d447cfeb758c34d9fc5f2c765f75c1b1c7ccb
ad3c28816f4ed9e1b027be6fe5d1f246457683c9
/dingdinghelper/src/main/java/com/ucmap/dingdinghelper/pixelsdk/ActivityManager.java
7c3d2860ee6926b9553a443a9cb5ccc8b2f02489
[]
no_license
hgqian/DingDingHelper
ff299bb33b68b5d66a435f3d95618d632aaec1b0
83bcccdc26086a5bdfa54d968b4d7db6d55c4815
refs/heads/master
2020-11-29T16:58:31.960651
2017-11-24T15:03:28
2017-11-24T15:03:28
230,173,585
0
1
null
2019-12-26T01:27:12
2019-12-26T01:27:12
null
UTF-8
Java
false
false
2,418
java
package com.ucmap.dingdinghelper.pixelsdk; import android.app.Activity; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicReference; /** * <b>@项目名:</b> DingDingHelper<br> * <b>@包名:</b>com.ucmap.dingdinghelper<br> * <b>@创建者:</b> cxz -- just<br> * <b>@创建时间:</b> &{DATE}<br> * <b>@公司:</b> 宝诺科技<br> * <b>@邮箱:</b> cenxiaozhong.qqcom@qq.com<br> * <b>@描述</b><br> */ public class ActivityManager implements IActivityManager { private static final List<WeakReference<Activity>> mActivities = new ArrayList<>(); private static final AtomicReference<ActivityManager> atomic = new AtomicReference<>(); private ActivityManager() { } public static ActivityManager getInstance() { for (; ; ) { ActivityManager mActivityManager = atomic.get(); if (mActivityManager != null) return mActivityManager; if (atomic.compareAndSet(null, new ActivityManager())) { return atomic.get(); } } } private boolean findTargetAndRemove(Class<? extends Activity> activityClazz) { boolean tag = false; //倒序remove for (int i = mActivities.size() - 1; i >= 0; i--) { WeakReference<Activity> mActivityWeakReference = mActivities.get(i); if (mActivityWeakReference.get() == null) { mActivities.remove(i); } } for (int i = 0; i < mActivities.size(); i++) { WeakReference<Activity> mWeakReference = mActivities.get(i); if (mWeakReference.get() != null && mWeakReference.get().getClass() == activityClazz) { mWeakReference.get().finish(); mActivities.remove(i); tag = true; break; } } return tag; } public void addActivity(Activity activity) { if (activity != null) { findTargetAndRemove(activity.getClass()); mActivities.add(new WeakReference<Activity>(activity)); } } public void removeActivity(Activity activity) { findTargetAndRemove(activity.getClass()); } @Override public void removeAcitivtyByClazz(Class<? extends Activity> clazz) { findTargetAndRemove(clazz); } }
[ "xiaozhongcen@gmail.com" ]
xiaozhongcen@gmail.com
5c53feb2340f09f0af267acb104e4aebab4f743f
cb35e8a59c48535ed0bdd13997a05cd87100502c
/ml/daal/src/main/java/edu/iu/daal_ar/Aprior/ARDaalLauncher.java
5ad8bc36aa6b8160ae38ed4e542662083591e93b
[ "Apache-2.0" ]
permissive
swsachith/harp
2d4784c5cf300f8b9165699e28dcde2bd3eddb52
1a096937a1dd25c29a56c79cff5d8bd1c10c3cdf
refs/heads/master
2020-03-28T17:46:15.723815
2018-10-15T04:17:59
2018-10-15T04:17:59
148,820,755
0
0
null
null
null
null
UTF-8
Java
false
false
3,203
java
/* * Copyright 2013-2016 Indiana University * * 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 edu.iu.daal_ar.Aprior; import edu.iu.fileformat.MultiFileInputFormat; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configured; import org.apache.hadoop.filecache.DistributedCache; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.ToolRunner; import edu.iu.data_aux.*; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.concurrent.ExecutionException; public class ARDaalLauncher extends Configured implements Tool { public static void main(String[] argv) throws Exception { int res = ToolRunner.run(new Configuration(), new ARDaalLauncher(), argv); System.exit(res); } /** * Launches all the tasks in order. */ @Override public int run(String[] args) throws Exception { /* Put shared libraries into the distributed cache */ Configuration conf = this.getConf(); Initialize init = new Initialize(conf, args); /* Put shared libraries into the distributed cache */ init.loadDistributedLibs(); // load args init.loadSysArgs(); //load app args conf.setInt(HarpDAALConstants.FILE_DIM, Integer.parseInt(args[init.getSysArgNum()])); conf.setDouble(Constants.MIN_SUPPORT, Double.parseDouble(args[init.getSysArgNum()+1])); conf.setDouble(Constants.MIN_CONFIDENCE, Double.parseDouble(args[init.getSysArgNum()+2])); // launch job System.out.println("Starting Job"); long perJobSubmitTime = System.currentTimeMillis(); System.out.println("Start Job#" + " "+ new SimpleDateFormat("HH:mm:ss.SSS").format(Calendar.getInstance().getTime())); Job arbatchJob = init.createJob("arbatchJob", ARDaalLauncher.class, ARDaalCollectiveMapper.class); // finish job boolean jobSuccess = arbatchJob.waitForCompletion(true); System.out.println("End Job#" + " "+ new SimpleDateFormat("HH:mm:ss.SSS").format(Calendar.getInstance().getTime())); System.out.println("| Job#" + " Finished in " + (System.currentTimeMillis() - perJobSubmitTime)+ " miliseconds |"); if (!jobSuccess) { arbatchJob.killJob(); System.out.println("ArBatchJob Job failed"); } return 0; } }
[ "lc37@indiana.edu" ]
lc37@indiana.edu
9b36aa36d0d25338797fcdaada415b75713fbc57
13fa92aa92afc2fb2aa7e800320ca9191f82f329
/basics/src/test/java/com/github/ajanthan/collections/ArrayListTest.java
37d97583da878282dcaa4bbc4bdf68e8be08f363
[ "Apache-2.0" ]
permissive
ajanthan/jplay
39026ca1d2e3f10735e5f28336dc8ebe1017615e
18ce7b4f22ed30abcda592f90a8d6f310d930418
refs/heads/main
2023-06-16T05:25:06.698669
2021-07-10T19:09:02
2021-07-10T19:09:02
355,647,205
0
0
null
null
null
null
UTF-8
Java
false
false
751
java
package com.github.ajanthan.collections; import org.junit.Assert; import org.junit.Test; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class ArrayListTest { @Test public void basicTest() { List<Integer> nums = new ArrayList<>(); nums.add(1); nums.add(2); Assert.assertEquals(1, (int) nums.get(0)); Assert.assertEquals(2, nums.size()); Assert.assertTrue(nums.contains(2)); nums.remove(0); Assert.assertFalse(nums.contains(1)); List<Integer> nums1 = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8); int i = 0; for (int num : nums1) { Assert.assertEquals((int) nums1.get(i), num); i++; } } }
[ "balaajanthan@gmail.com" ]
balaajanthan@gmail.com
c0d9be02d1a433d83ea743f57f4ba4179408eea0
f92d6f8376fc86b3e70c7e514c9b0e8869ae3ed0
/app/src/main/java/com/yihai/caotang/event/BeaconTriggerEvent.java
ce76cf147e1c17d81c4fd9f23d3e6d1c761643ae
[]
no_license
saonam/pigeonhole
9db0f956922a5fec36a14cae6238fca747d3f1ac
05e7383a1e112e80eedd6dcd68ce7da27d6bf579
refs/heads/master
2020-04-27T17:27:41.611099
2018-05-08T03:26:52
2018-05-08T03:26:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
913
java
package com.yihai.caotang.event; import com.huijimuhei.beacon.data.BleDevice; /** * Created by mac on 2017/8/27. */ public class BeaconTriggerEvent { public static final int EVENT_LOCATION = 0; public static final int EVENT_GATE_TRIGGER = 1; public static final int EVENT_SPOT_TRIGGER = 2; public static final int EVENT_FENCE_TRIGGER = 3; private BleDevice device; private int event; private String type; public BeaconTriggerEvent(BleDevice device, int event) { this.device = device; this.event = event; } public BeaconTriggerEvent(BleDevice device, int event, String type) { this.device = device; this.event = event; this.type = type; } public BleDevice getDevice() { return device; } public int getEvent() { return event; } public String getType() { return type; } }
[ "381226310@qq.com" ]
381226310@qq.com
1c8803123458ba5140aaa523df3dafd955af6e83
a4ed0c9bce2367de4fa0094de5116ef1a41583cf
/pricing-service/src/test/java/com/udacity/pricing/PricingServiceApplicationTests.java
50436b9d1138970473f6baea4f8ff6b8f4c8b966
[ "MIT" ]
permissive
elgeorsk/be-carWebsite
19a3c41060fc4a5d384969ff384516a412e08d39
1beb80423b5e7788e1ce67d068d581b2d7a9f2fd
refs/heads/master
2023-01-23T19:53:49.878769
2020-12-14T12:16:02
2020-12-14T12:16:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,270
java
package com.udacity.pricing; import com.udacity.pricing.entity.Price; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.web.server.LocalServerPort; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit4.SpringRunner; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.CoreMatchers.equalTo; @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @AutoConfigureMockMvc public class PricingServiceApplicationTests { @LocalServerPort private int port; @Autowired private TestRestTemplate restTemplate; @Test public void getFirstVehicleId(){ ResponseEntity<Price> response = this.restTemplate.getForEntity("http://localhost:"+port+"/services/price?vehicleId=1", Price.class); assertThat(response.getStatusCode(), equalTo(HttpStatus.OK)); } @Test public void contextLoads() { } }
[ "elgeor.sk@gmail.com" ]
elgeor.sk@gmail.com
ddff061e28e64215e82548aaeff02a6c971e07fe
27300bea61da3cc1ad0022419db901689fbe071d
/app/src/main/java/com/example/authapplication/CallLogHelper.java
cd19d2bede16f30935866f3098cceeb8d82eaeaa
[]
no_license
12Kavyaas/Children_Monitoring_System
8ebbb5892cfc1aa5507c67a526ff69ef909b1876
750cea003fbcb0b6ccf2cfe5551a2bd4cd6a34fb
refs/heads/master
2023-06-16T03:12:27.351884
2020-01-21T14:19:46
2020-01-21T14:19:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
640
java
package com.example.authapplication; import android.content.ContentResolver; import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; import android.provider.CallLog; import android.util.Log; public class CallLogHelper { public static Cursor getAllCallLogs(ContentResolver cr) { // reading all data in descending order according to DATE String strOrder = android.provider.CallLog.Calls.DATE + " DESC"; Uri callUri = Uri.parse("content://call_log/calls"); Cursor curCallLogs = cr.query(callUri, null, null, null, strOrder); return curCallLogs; } }
[ "shakilhasan105268@gmail.com" ]
shakilhasan105268@gmail.com
3dc47b55c7b147432db7ae41b6b617374e3bceaa
d9882f0331ceb15599f99b11edb68482c5dec075
/app/src/main/java/com/bitbytelab/app_227/MainActivity.java
5d2af4e3bf7b90a12b845ada3e1f882610b56982
[]
no_license
prAkash-SVMX/App227
1825ada949d6373b8c0bf3dc4fdfe624b72e15d3
49ae18497d0978e83a6e0c30015dfab908e2e104
refs/heads/master
2022-03-08T13:42:04.113580
2019-10-29T06:31:13
2019-10-29T06:31:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,911
java
package com.bitbytelab.app_227; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.hardware.SensorManager; import android.os.Bundle; import android.view.View; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(R.id.btn_read_write).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startActivity(new Intent(MainActivity.this,ReadWriteActivity.class)); } }); findViewById(R.id.btn_basic_animation).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startActivity(new Intent(MainActivity.this,AnimActivity.class)); } }); findViewById(R.id.btn_animation).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startActivity(new Intent(MainActivity.this,AnimationActivity.class)); } }); findViewById(R.id.btn_signup_activity).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startActivity(new Intent(MainActivity.this,SignUpActivity.class)); } }); findViewById(R.id.btn_custom_view_activity).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startActivity(new Intent(MainActivity.this,CustomViewActivity.class)); } }); findViewById(R.id.btn_surface_drawing_activity).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startActivity(new Intent(MainActivity.this,SurfaceDrawingActivity.class)); } }); findViewById(R.id.btn_property_animation_activity).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startActivity(new Intent(MainActivity.this,PropertyAnimationActivity.class)); } }); findViewById(R.id.btn_maps_activity).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startActivity(new Intent(MainActivity.this,MapsActivity.class)); } }); findViewById(R.id.btn_sensor_activity).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startActivity(new Intent(MainActivity.this, SensorActivity.class)); } }); } }
[ "rrss.mahmud@gmail.com" ]
rrss.mahmud@gmail.com
d690566cd91dd24c7707878b3f5c4a982e3bdba8
1d2ceb9aea3f8674ac662600f1296c6eb2cc4bbc
/src/main/java/com/cdkj/coin/wallet/api/impl/XN802756.java
254cb578b5778dc2e0b5305d15c12ac3786c7a8c
[]
no_license
13110992819/cs-wellet
4eed68622480c7e7ea5974578edc2c03d90e4f40
abf8134e3813ef6880dbf52764048ce2e64cc337
refs/heads/master
2020-04-09T18:19:26.452780
2018-02-10T03:55:45
2018-02-10T03:55:45
124,237,903
0
0
null
null
null
null
UTF-8
Java
false
false
1,106
java
package com.cdkj.coin.wallet.api.impl; import com.cdkj.coin.wallet.ao.IWithdrawAO; import com.cdkj.coin.wallet.api.AProcessor; import com.cdkj.coin.wallet.common.JsonUtil; import com.cdkj.coin.wallet.core.StringValidater; import com.cdkj.coin.wallet.dto.req.XN802756Req; import com.cdkj.coin.wallet.exception.BizException; import com.cdkj.coin.wallet.exception.ParaException; import com.cdkj.coin.wallet.spring.SpringContextHolder; /** * 取现详情 * @author: xieyj * @since: 2017年5月17日 下午6:35:28 * @history: */ public class XN802756 extends AProcessor { private IWithdrawAO withdrawAO = SpringContextHolder .getBean(IWithdrawAO.class); private XN802756Req req = null; @Override public Object doBusiness() throws BizException { return withdrawAO.getWithdraw(req.getCode(), req.getSystemCode()); } @Override public void doCheck(String inputparams, String operator) throws ParaException { req = JsonUtil.json2Bean(inputparams, XN802756Req.class); StringValidater.validateBlank(req.getCode(), req.getSystemCode()); } }
[ "leo.zheng@hichengdai.com" ]
leo.zheng@hichengdai.com
88a776368f1cfc14874524bd9ee1ea01b52e8ff9
f03f95066d70e37a4c45e5208ceed5a9659eaf21
/app/src/main/java/com/tinmegali/tutsmvp_sample/main/activity/view/MainActivity.java
49fb2d50d1e87deda7dbc3ecf2e7d4a8824aed21
[]
no_license
Ivan-Arias/ClaimUNSA-INP
243b1ed0a708f52064e8ba679213e32bcf1120f8
7f9ff238ad53642fef8483d36f4721625c7c7ffc
refs/heads/master
2021-09-02T16:21:38.755318
2018-01-03T15:51:56
2018-01-03T15:51:56
116,144,968
0
0
null
null
null
null
UTF-8
Java
false
false
5,933
java
package com.tinmegali.tutsmvp_sample.main.activity.view; import android.content.Context; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.view.View; import android.view.Menu; import android.view.MenuItem; import android.view.ViewGroup; import android.widget.EditText; import android.widget.ProgressBar; import android.widget.Toast; import com.tinmegali.tutsmvp_sample.R; import com.tinmegali.tutsmvp_sample.common.StateMaintainer; import com.tinmegali.tutsmvp_sample.main.activity.MVP_Main; import com.tinmegali.tutsmvp_sample.main.activity.model.MainModel; import com.tinmegali.tutsmvp_sample.main.activity.presenter.MainPresenter; import com.tinmegali.tutsmvp_sample.main.activity.view.recycler.NotesViewHolder; public class MainActivity extends AppCompatActivity implements View.OnClickListener, MVP_Main.RequiredViewOps { private EditText mTextNewNote; private ListNotes mListAdapter; private ProgressBar mProgress; private MVP_Main.ProvidedPresenterOps mPresenter; // Responsible to maintain the object's integrity // during configurations change private final StateMaintainer mStateMaintainer = new StateMaintainer( getFragmentManager(), MainActivity.class.getName()); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); setupViews(); setupMVP(); } @Override protected void onDestroy() { super.onDestroy(); mPresenter.onDestroy(isChangingConfigurations()); } /** * Setup the Views */ private void setupViews(){ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(this); mTextNewNote = (EditText) findViewById(R.id.edit_note); mListAdapter = new ListNotes(); mProgress = (ProgressBar) findViewById(R.id.progressbar); RecyclerView mList = (RecyclerView) findViewById(R.id.list_notes); LinearLayoutManager linearLayoutManager = new LinearLayoutManager( this ); linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL); mList.setLayoutManager(linearLayoutManager); mList.setAdapter(mListAdapter); mList.setItemAnimator(new DefaultItemAnimator()); } /** * Setup Model View Presenter pattern. * Use a {@link StateMaintainer} to maintain the * Presenter and Model instances between configuration changes. * Could be done differently, * using a dependency injection for example. */ private void setupMVP() { // Check if StateMaintainer has been created if (mStateMaintainer.firstTimeIn()) { // Create the Presenter MainPresenter presenter = new MainPresenter(this); // Create the Model MainModel model = new MainModel(presenter); // Set Presenter model presenter.setModel(model); // Add Presenter and Model to StateMaintainer mStateMaintainer.put(presenter); mStateMaintainer.put(model); // Set the Presenter as a interface // To limit the communication with it mPresenter = presenter; } // get the Presenter from StateMaintainer else { // Get the Presenter mPresenter = mStateMaintainer.get(MainPresenter.class.getName()); // Updated the View in Presenter mPresenter.setView(this); } } @Override public void onClick(View v) { switch (v.getId()) { case R.id.fab:{ // Add new note mPresenter.clickNewNote(mTextNewNote); } } } @Override public Context getActivityContext() { return this; } @Override public Context getAppContext() { return getApplicationContext(); } @Override public void showToast(Toast toast) { toast.show(); } @Override public void clearEditText() { mTextNewNote.setText(""); } @Override public void showProgress() { mProgress.setVisibility(View.VISIBLE);; } @Override public void hideProgress() { mProgress.setVisibility(View.GONE);; } @Override public void showAlert(AlertDialog dialog) { dialog.show(); } @Override public void notifyItemRemoved(int position) { mListAdapter.notifyItemRemoved(position); } @Override public void notifyItemInserted(int adapterPos) { mListAdapter.notifyItemInserted(adapterPos); } @Override public void notifyItemRangeChanged(int positionStart, int itemCount){ mListAdapter.notifyItemRangeChanged(positionStart, itemCount); } @Override public void notifyDataSetChanged() { mListAdapter.notifyDataSetChanged(); } private class ListNotes extends RecyclerView.Adapter<NotesViewHolder> { @Override public int getItemCount() { return mPresenter.getNotesCount(); } @Override public NotesViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { return mPresenter.createViewHolder(parent, viewType); } @Override public void onBindViewHolder(NotesViewHolder holder, int position) { mPresenter.bindViewHolder(holder, position); } } }
[ "ivan.hariasaqp@gmail.com" ]
ivan.hariasaqp@gmail.com
cf9b9052339a5af92f9f7075b996185ca9cd57a9
91e66860154b26b3331f8544670d310cef309aa8
/eyebased-raytracer-shading/src/main/java/ee/ristoseene/raytracer/eyebased/shading/emission/compiled/DynamicColorShadingPipeline.java
05a756488a5905db7f0999ebecaef0c49529f8cd
[ "MIT" ]
permissive
rsarendus/eyebased-raytracer
861c58e23d8d13aa0952218105cfda72df738190
0cf02680fe75fc9a1b8a49d45e80e9689824bdfa
refs/heads/main
2023-06-26T03:06:32.742094
2020-07-08T14:23:39
2020-07-08T14:23:39
172,200,194
0
0
null
null
null
null
UTF-8
Java
false
false
1,498
java
package ee.ristoseene.raytracer.eyebased.shading.emission.compiled; import ee.ristoseene.raytracer.eyebased.core.compilation.CompilationCache; import ee.ristoseene.raytracer.eyebased.core.configuration.SampleValueFactory; import ee.ristoseene.raytracer.eyebased.core.raytracing.BounceContext; import ee.ristoseene.raytracer.eyebased.core.raytracing.SampleValue; import ee.ristoseene.raytracer.eyebased.core.raytracing.ShadingConfiguration; import ee.ristoseene.raytracer.eyebased.core.raytracing.ShadingContext; import ee.ristoseene.raytracer.eyebased.core.raytracing.ShadingPipeline; import ee.ristoseene.raytracer.eyebased.shading.providers.ValueProvider; import ee.ristoseene.vecmath.Vector3; import java.util.Objects; import java.util.Optional; public class DynamicColorShadingPipeline implements ShadingPipeline, ShadingConfiguration { private final ValueProvider<Vector3.Accessible> colorProvider; public DynamicColorShadingPipeline(final ValueProvider<Vector3.Accessible> colorProvider) { this.colorProvider = Objects.requireNonNull(colorProvider, "Color not provided"); } @Override public SampleValue shade(final ShadingContext shadingContext, final BounceContext bounceContext) { return shadingContext.getAttributeValue(SampleValueFactory.KEY).create(shadingContext, colorProvider.getValue(shadingContext)); } @Override public ShadingPipeline compile(final Optional<CompilationCache> compilationCache) { return this; } }
[ "39149669+rsarendus@users.noreply.github.com" ]
39149669+rsarendus@users.noreply.github.com
59f2e011f53ae4b7df7bf698affa60b1f0c26219
889e5a7c75be52aea9e3e8658b7b9d3f125b265a
/app/src/main/java/com/wechat/dataBase/MyDBHelper.java
f7f08bf05dc708159f7e0f06a73a2e266b73a2c0
[]
no_license
fanfuhan/weChat
999358aba2df0873d5afdf7216129d5483ce541b
64fc8b4421edc8eb15a733c5aa7035549a51f8b8
refs/heads/master
2020-04-04T14:00:36.083210
2018-11-03T13:11:30
2018-11-03T13:11:30
155,983,237
1
0
null
null
null
null
UTF-8
Java
false
false
813
java
package com.wechat.dataBase; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; public class MyDBHelper extends SQLiteOpenHelper { private String ddlCreate="create table if not exists message" + "(sender varchar(20),receiver varchar(20),content varchar(100))"; public MyDBHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) { super(context, name, factory, version); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL(ddlCreate); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { // db.execSQL("drop table xxx"); // db.execSQL("create "); } }
[ "17600982551@163.com" ]
17600982551@163.com
025fcefeda200643e7234bdd323c93d4e84c90aa
12abda171a61512866366c21d9dc0aeeeec9dc2f
/src/main/java/cn/itcast/crm/domain/Customer.java
f71b070882d30ffc5884c362ac9511c0fb6a36c4
[]
no_license
pluto3/crm_domain
32847208d52deb5dcd2a25b9b154c9e3abaeae89
b86588b9a914dccd38273cc234c3d2adc95895b7
refs/heads/master
2020-03-22T14:07:35.540705
2018-07-08T09:36:58
2018-07-08T09:36:58
140,154,865
0
0
null
null
null
null
UTF-8
Java
false
false
1,514
java
package cn.itcast.crm.domain; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.xml.bind.annotation.XmlRootElement; import lombok.Data; /** * @description:客户信息表 * */ @Entity @Table(name = "T_CUSTOMER") @XmlRootElement // REST资源标识 @Data public class Customer { @Id @GeneratedValue @Column(name = "C_ID") private Integer id; // 主键id @Column(name = "C_USERNAME") private String username; // 用户名 @Column(name = "C_PASSWORD") private String password; // 密码 @Column(name = "C_TYPE") private Integer type; // 类型 设置1 绑定邮箱 @Column(name = "C_BRITHDAY") @Temporal(TemporalType.DATE) private Date birthday; // 生日 @Column(name = "C_SEX") private Integer sex; // 性别 1男 2女 @Column(name = "C_TELEPHONE") private String telephone; // 手机 @Column(name = "C_COMPANY") private String company; // 公司 @Column(name = "C_DEPARTMENT") private String department; // 部门 @Column(name = "C_POSITION") private String position; // 职位 @Column(name = "C_ADDRESS") private String address; // 地址 @Column(name = "C_MOBILEPHONE") private String mobilePhone; // 座机 @Column(name = "C_EMAIL") private String email; // 邮箱 @Column(name = "C_Fixed_AREA_ID") private String fixedAreaId; // 定区编码 }
[ "wangkai110502@outlook.com" ]
wangkai110502@outlook.com
76a78a1dcdc61bf95522483d3c0cb29db47efae1
829bf7b08858f7b220faa6f06fc88aa16fac2a4c
/src/client/Session.java
da55e47c773f008b452e7db805f290cc25bb84e9
[]
no_license
johnosullivan/WSP
d7611e2f6ffd4569e4ec51633f9e13bd96dcdedb
a1da91999f9d38f721263bfb44cf197d06ca1e8a
refs/heads/master
2021-01-17T15:49:00.010394
2016-12-06T03:56:36
2016-12-06T03:56:36
69,820,186
0
0
null
null
null
null
UTF-8
Java
false
false
1,594
java
package client; import java.util.Base64; import javax.crypto.Cipher; import javax.crypto.SecretKey; import dal.main.MainDatabaseDAO; public class Session { static Cipher cipher; private static Session instance = null; public static Session getInstance(){ if(instance==null){ instance = new Session(); } return instance; } public boolean login(String username, String password) throws Exception { MainDatabaseDAO db = MainDatabaseDAO.getInstance(); String pass = db.findUser(username); if (pass.equals(password)) { return true; } return false; } public boolean register(String username, String password, String email, String phone, String age,String displayname) throws Exception { MainDatabaseDAO db = MainDatabaseDAO.getInstance(); return db.registerUser(username, password, email); } public static String encrypt(String plainText, SecretKey secretKey) throws Exception { byte[] plainTextByte = plainText.getBytes(); cipher.init(Cipher.ENCRYPT_MODE, secretKey); byte[] encryptedByte = cipher.doFinal(plainTextByte); Base64.Encoder encoder = Base64.getEncoder(); String encryptedText = encoder.encodeToString(encryptedByte); return encryptedText; } public static String decrypt(String encryptedText, SecretKey secretKey) throws Exception { Base64.Decoder decoder = Base64.getDecoder(); byte[] encryptedTextByte = decoder.decode(encryptedText); cipher.init(Cipher.DECRYPT_MODE, secretKey); byte[] decryptedByte = cipher.doFinal(encryptedTextByte); String decryptedText = new String(decryptedByte); return decryptedText; } }
[ "josullivan1@luc.edu" ]
josullivan1@luc.edu
81c5bed04ae2152c8a8bf24ba7203d6acc88a688
6a84eaf25270bfddfe4ac6ef91724f91d0dfe7a4
/src/Sample1.java
dbd7298152e59b56a5fa9d3ac78b616ffbf459c9
[]
no_license
ankita3111/NewTrial
851a920fff408d958ebe6c6be0d439b9af0cceb5
25ee1b9b40d9db54d4c63b36b63b91a655ef2c17
refs/heads/master
2020-04-03T08:30:03.158315
2018-10-29T01:48:45
2018-10-29T01:48:45
155,135,187
0
0
null
null
null
null
UTF-8
Java
false
false
150
java
public class Sample1 { public static void main(String[] args) { System.out.println("This is Ankita"); System.out.println("Second line added"); } }
[ "paulchoudhury_a@yahoo.in" ]
paulchoudhury_a@yahoo.in
727030bbf317399bf46f68365f0928801b95bdf0
79bff6b5a97bcb5653e8a7a579366e21d54ce745
/AUTO_BILLING_MANAGEMENT/src/main/java/com/selsoft/auto/dao/AutoBillingDAOImpl.java
64e1a02eefd4a70f1107e7ccd667591921b7bae5
[]
no_license
SelsoftInc/TrackMe-1
a0fbb90f98064bf16b2c8f1f21613b4f75f62d78
faea2cf358b5def2f87eab2148a7214498046af6
refs/heads/master
2021-09-02T00:31:10.750820
2017-12-29T11:44:20
2017-12-29T11:44:20
115,983,870
0
0
null
2018-01-02T06:43:05
2018-01-02T06:43:04
null
UTF-8
Java
false
false
2,807
java
package com.selsoft.auto.dao; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.List; import java.util.TimeZone; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Update; import org.springframework.stereotype.Repository; import com.selsoft.auto.model.Lease; import com.selsoft.auto.model.Tenant; import com.selsoft.auto.utils.AutoBillingException; @Repository public class AutoBillingDAOImpl implements AutoBillingDAO { private static final Logger logger = Logger.getLogger(AutoBillingDAOImpl.class); @Autowired private MongoTemplate template; @Override public List<String> autoBilling() { List<Lease> activeLeaseList = null; List<String> tenantIds = new ArrayList<>(); List<String> leaseIds = new ArrayList<>(); int nextMonth = 0; int billYear = 0; DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT")); String currentDate = df.format(calendar.getTime()); int currentMonth = calendar.getTime().getMonth(); int currentYear = calendar.getTime().getYear(); if (currentMonth == 11) { nextMonth = 0; billYear = currentYear + 1; } else { nextMonth = currentMonth + 1; billYear = currentYear; } String nextBillDate = billYear + "-" + nextMonth + "-01"; Query query = new Query(Criteria.where("leaseEndDate").gte(currentDate)); activeLeaseList = template.find(query, Lease.class); for (Lease lease : activeLeaseList) { leaseIds.add(lease.getLeaseId()); } for (Lease lease : activeLeaseList) { tenantIds.add(lease.getTenantId()); } updateLeaseDate(leaseIds, nextBillDate); List<String> mails = getTenantEmails(tenantIds); return mails; } private void updateLeaseDate(List<String> leaseIds, String nextBillDate) { Query query = new Query(Criteria.where("leaseId").in(leaseIds)); Update update = new Update(); update.set("leaseEndDate", nextBillDate); template.updateFirst(query, update, Lease.class); } private List<String> getTenantEmails(List<String> tenantIds) { List<String> tenantEmails = new ArrayList<>(); Query query = new Query(Criteria.where("tenantId").in(tenantIds)); List<Tenant> tenantList = template.find(query, Tenant.class); for (Tenant tenant : tenantList) { tenantEmails.add(tenant.getTenantEmailId()); } return tenantEmails; } }
[ "selsoft@DESKTOP-KSQLQI1" ]
selsoft@DESKTOP-KSQLQI1
d9205af880f415053350000ccf4c3a092fd23c6f
3bbd6f992504db4a89ea40268eec08e8ff691990
/src/main/java/dev/leap/frog/Event/World/EventEntityRemoved.java
0a791d1649df82cd60556ba0e71be36de9a6eb45
[]
no_license
lolix-notepad/Leapfrog-Client
899c696be8667764e0a19d417dbc3351c0d52092
f0d281752c58a710159e3dff6a258f515a02a150
refs/heads/main
2023-08-10T15:46:30.288774
2021-10-14T00:32:17
2021-10-14T00:32:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
284
java
package dev.leap.frog.Event.World; import dev.leap.frog.Event.LeapFrogEvent; import net.minecraft.entity.Entity; public class EventEntityRemoved extends LeapFrogEvent { private Entity entity; public EventEntityRemoved(Entity entity) { this.entity = entity; } }
[ "73361230+ThePX69@users.noreply.github.com" ]
73361230+ThePX69@users.noreply.github.com
81287bb7545c1051711530ae18e7f4f23f6ff0c4
3844a4409801456e4f18e551efb8b190107f2ace
/app/src/main/java/com/skype/demo/mmsdemo/receivers/SmsDeliverBroadcastReceiver.java
d145d6331b38220941d88b78829853cd01042083
[]
no_license
pwkpwk/mmsdemo
c64a68a348a859806229717195df8aa0d1d81816
d2607ae5241355409b6e898e6b0fafa340c3c818
refs/heads/master
2020-12-24T06:02:59.163930
2017-01-14T02:27:54
2017-01-14T02:27:54
73,236,463
0
0
null
null
null
null
UTF-8
Java
false
false
307
java
package com.skype.demo.mmsdemo.receivers; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; public final class SmsDeliverBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { } }
[ "pwkpwk@hotmail.com" ]
pwkpwk@hotmail.com
6c1e090d257898b939c2283e0f0fdb9ce96834cf
290955d3fd1ca6736e30b1f8d3a68ed78fbac032
/src/main/java/com/tom/hadoop/rpc/MyProtocolImpl.java
82296aa4494a52984147367919fbbb889cff3ace
[]
no_license
tomtian2009/HadoopDemo
e2eb30f721a29a500356aa4a91a0cebd04c6fc83
5744d859487419bc7726612062644940c1d53194
refs/heads/master
2023-07-08T19:41:10.881787
2021-07-24T07:47:56
2021-07-24T07:47:56
387,100,924
2
0
null
null
null
null
UTF-8
Java
false
false
1,010
java
package com.tom.hadoop.rpc; import org.apache.commons.lang.StringUtils; import org.apache.hadoop.ipc.ProtocolSignature; import java.io.IOException; public class MyProtocolImpl implements MyProtocol { @Override public long getProtocolVersion(String protocol, long clientVersion) throws IOException { System.out.println("MyProxy.ProtocolVersion=" + MyProtocol.versionID); return MyProtocol.versionID; } @Override public ProtocolSignature getProtocolSignature(String protocol, long clientVersion, int clientMethodsHash) throws IOException { return new ProtocolSignature(MyProtocol.versionID, null); } @Override public String findName(String sno) throws IOException { System.out.println( "我被调用了!"); if(StringUtils.equalsIgnoreCase(sno.trim(), "G20210735010181")) return "家乐"; if(StringUtils.equalsIgnoreCase(sno.trim(), "G20210123456789")) return "心心"; return null; } }
[ "jiale_tian@qq.com" ]
jiale_tian@qq.com
f0fdc3786fed85a6e3074a6c57ce786ea7f0d0b3
ddf3428cce4d0e44fd15afed4fb2a9b4152ffd0a
/hrms/hrms/src/main/java/kodlamaio/hrms/business/abstacts/WorkplaceCandidateService.java
d6c819b5306826461986704f4cce86385e1e4692
[]
no_license
mstfyaylaci/hrmsFinal
35ca30ad6da483a9c23c623d119b098630c1eca1
ae0a5ddcc318e4e421843793ef11d7c0e82e4311
refs/heads/master
2023-05-14T14:23:42.829164
2021-06-07T13:45:48
2021-06-07T13:45:48
374,682,148
6
0
null
null
null
null
UTF-8
Java
false
false
456
java
package kodlamaio.hrms.business.abstacts; import java.util.List; import kodlamaio.hrms.core.utilities.Result; import kodlamaio.hrms.core.utilities.results.DataResult; import kodlamaio.hrms.entities.concretes.WorkplaceCandidate; public interface WorkplaceCandidateService { DataResult<List<WorkplaceCandidate>> getAll(); Result add(WorkplaceCandidate workplaceCandidate); DataResult<List<WorkplaceCandidate>> getByCandidateId(int candidateId); }
[ "mustafayaylaci4269@gmail.com" ]
mustafayaylaci4269@gmail.com
063ce71ab49b83dc58c9228a31052bb849021129
1e914120ee2d6577cff712b1d32b1f5ad7489183
/api/src/main/java/com/abiquo/api/exceptions/mapper/InternalServerExceptionMapper.java
0639e631d6b2ece296ce72e816e6975f6eb9d144
[]
no_license
david-lopez/abiquo
2d6b802c7de74ca4a6803ac90967678d4a4bd736
ae35b1e6589a36b52141053f9c64af9fef911915
refs/heads/master
2021-01-24T02:38:39.290136
2011-11-28T08:36:53
2011-11-28T08:36:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,271
java
/** * Abiquo community edition * cloud management application for hybrid clouds * Copyright (C) 2008-2010 - Abiquo Holdings S.L. * * This application is free software; you can redistribute it and/or * modify it under the terms of the GNU LESSER GENERAL PUBLIC * LICENSE as published by the Free Software Foundation under * version 3 of the License * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * LESSER GENERAL PUBLIC LICENSE v.3 for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ package com.abiquo.api.exceptions.mapper; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.ResponseBuilder; import javax.ws.rs.core.Response.Status; import javax.ws.rs.ext.ExceptionMapper; import javax.ws.rs.ext.Provider; import org.apache.wink.common.internal.ResponseImpl.ResponseBuilderImpl; import com.abiquo.api.exceptions.APIError; import com.abiquo.model.transport.error.ErrorDto; import com.abiquo.model.transport.error.ErrorsDto; @Provider public class InternalServerExceptionMapper<T extends Throwable> implements ExceptionMapper<T> { public static APIError DEFAULT_SERVER_ERROR = APIError.INTERNAL_SERVER_ERROR; @Override public Response toResponse(T exception) { ErrorsDto errors = new ErrorsDto(); ErrorDto error = new ErrorDto(); error.setCode(getErrorCode(exception)); error.setMessage(getErrorMessage(exception)); ResponseBuilder builder = new ResponseBuilderImpl(); builder.entity(errors); builder.status(getResponseStatus(exception)); exception.printStackTrace(); return builder.build(); } protected Status getResponseStatus(T exception) { return Status.INTERNAL_SERVER_ERROR; } protected String getErrorCode(T exception) { return "ISE-500"; } protected String getErrorMessage(T exception) { return exception.getMessage(); } }
[ "jdevesa@abiquo.com" ]
jdevesa@abiquo.com
d901e95c62d3c14a3bbf54b639c7152c563ac20c
2436be0037fdc90668ecfc560129a009b7a4200c
/src/composition/com/Resolution.java
25832cf0fc101f474e927ab1a576778781b4695a
[]
no_license
Cule219/Composition
c26b40bb77e698852d0bf67be8a66f79eb554f60
3ea33d8c948fb83949b0b106f1dbcb6c778c52dd
refs/heads/master
2021-02-14T09:47:31.774256
2020-05-13T01:55:16
2020-05-13T01:55:16
244,794,211
0
0
null
null
null
null
UTF-8
Java
false
false
481
java
package composition.com; public class Resolution { private int width; private int height; public Resolution(int width, int height) { this.width = width; this.height = height; } public int getWidth() { return width; } public void setWidth(int width) { this.width = width; } public int getHeight() { return height; } public void setHeight(int height) { this.height = height; } }
[ "culaficstefan@gmail.com" ]
culaficstefan@gmail.com
ea37aa1f4f259ec612f950e7f49c6c911d4c6c7e
7af5a916c7dab6c18d514b721f8229b0181303e4
/app/src/main/java/com/imsadman/tictactoe/models/Game.java
655850254f0fe873b294b13e6d9a2a4f27b5880c
[ "Apache-2.0" ]
permissive
s4dman/TicTacToe-MVVM
0cc8bdf815e14c4896f97839fde31ed511929d66
cc18ab790384003a2de9fb074dbb5db8b2fd7f1e
refs/heads/master
2021-01-07T18:52:21.576876
2020-02-20T09:55:29
2020-02-20T09:55:29
241,788,724
0
0
null
null
null
null
UTF-8
Java
false
false
3,309
java
package com.imsadman.tictactoe.models; import android.util.Log; import androidx.lifecycle.MutableLiveData; public class Game { private static final String TAG = Game.class.getSimpleName(); private static final int BOARD_SIZE = 3; public Player player1; public Player player2; public Player currentPlayer = player1; public Cell[][] cells; public MutableLiveData<Player> winner = new MutableLiveData<>(); public Game(String playerOne, String playerTwo) { cells = new Cell[BOARD_SIZE][BOARD_SIZE]; player1 = new Player(playerOne, "x"); player2 = new Player(playerTwo, "o"); currentPlayer = player1; } public void switchPlayer() { if (currentPlayer == player1) { currentPlayer = player2; } else currentPlayer = player1; } public boolean hasGameEnded() { if (hasThreeSameHorizontalCells() || hasThreeSameVerticalCells() || hasThreeSameDiagonalCells()) { winner.setValue(currentPlayer); return true; } if (isBoardFull()) { winner.setValue(null); return true; } return false; } public boolean hasThreeSameHorizontalCells() { try { for (int i = 0; i < BOARD_SIZE; i++) if (areEqual(cells[i][0], cells[i][1], cells[i][2])) return true; return false; } catch (NullPointerException e) { Log.e(TAG, e.getMessage()); return false; } } public boolean hasThreeSameVerticalCells() { try { for (int i = 0; i < BOARD_SIZE; i++) if (areEqual(cells[0][i], cells[1][i], cells[2][i])) return true; return false; } catch (NullPointerException e) { Log.e(TAG, e.getMessage()); return false; } } public boolean hasThreeSameDiagonalCells() { try { return areEqual(cells[0][0], cells[1][1], cells[2][2]) || areEqual(cells[0][2], cells[1][1], cells[2][0]); } catch (NullPointerException e) { Log.e(TAG, e.getMessage()); return false; } } public boolean isBoardFull() { for (Cell[] row : cells) for (Cell cell : row) if (cell == null || cell.isEmpty()) return false; return true; } /** * 2 cells are equal if: * - Both are none null * - Both have non null values * - both have equal values * * @param cells: Cells to check if are equal * @return */ private boolean areEqual(Cell... cells) { if (cells == null || cells.length == 0) return false; for (Cell cell : cells) if (cell == null || cell.player.score == null || cell.player.score.length() == 0) return false; Cell comparisonBase = cells[0]; for (int i = 1; i < cells.length; i++) if (!comparisonBase.player.score.equals(cells[i].player.score)) return false; return true; } public void reset() { player1 = null; player2 = null; currentPlayer = null; cells = null; } }
[ "sadman.h@live.com" ]
sadman.h@live.com
756b59363422791bbb9c0d92ccbf9f224d7ddadb
451beec82c95a353d17ff80927e5323f7d41df65
/src/main/java/reciter/controller/IdentityController.java
e9b9f1a8b2c43786418762322abd2b0fbbe23253
[ "Apache-2.0" ]
permissive
pantapps/ReCiter
c0f0b245720e3e5aa667bec0d5eb661302d07a82
7188ea7585a471e8eb71a717644de2e2b05eefb7
refs/heads/master
2021-08-30T19:42:04.581127
2017-12-19T07:12:55
2017-12-19T07:12:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,419
java
/******************************************************************************* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. *******************************************************************************/ package reciter.controller; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import reciter.model.identity.Identity; import reciter.service.IdentityService; @Controller public class IdentityController { private static final Logger slf4jLogger = LoggerFactory.getLogger(IdentityController.class); @Autowired private IdentityService identityService; @RequestMapping(value = "/reciter/save/identities/", method = RequestMethod.PUT) @ResponseBody public void saveIdentities(@RequestBody List<Identity> identities) { slf4jLogger.info("calling saveIdentities with number of identities=" + identities.size()); identityService.save(identities); } @RequestMapping(value = "/reciter/find/identity/by/uids/", method = RequestMethod.GET) @ResponseBody public List<Identity> findByUids(@RequestParam List<String> uids) { slf4jLogger.info("calling findByUid with size of uids=" + uids); return identityService.findByUids(uids); } }
[ "jl987@cornell.edu" ]
jl987@cornell.edu
9bcf6288bc7a6e8b7bdb2edc932f907a1649b5b6
6c5467a2247010412dd7b988b7adc800eb80d958
/org.xtext.asmetal.parent/org.xtext.asmetal/src/main/xtext-gen/org/xtext/asmetal/asmetaL/impl/FunctionInitializationImpl.java
07a240a0475776ec96b62f1f1e3b14932c67e288
[]
no_license
Favio-Quinteros/Quinteros-WebEditor
9f4a0c1c4de59ca2fdd28c8f231fbcd0b1adf2ed
3618e9406aab73b6059508ee34aaccaa5285a536
refs/heads/main
2023-05-25T04:51:25.190702
2021-06-16T09:35:54
2021-06-16T09:35:54
372,743,077
0
0
null
null
null
null
UTF-8
Java
false
false
10,515
java
/** * generated by Xtext 2.26.0-SNAPSHOT */ package org.xtext.asmetal.asmetaL.impl; import java.util.Collection; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EDataTypeEList; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import org.xtext.asmetal.asmetaL.AsmetaLPackage; import org.xtext.asmetal.asmetaL.Domain; import org.xtext.asmetal.asmetaL.FunctionInitialization; import org.xtext.asmetal.asmetaL.Term; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Function Initialization</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link org.xtext.asmetal.asmetaL.impl.FunctionInitializationImpl#getInizializedFunctionName <em>Inizialized Function Name</em>}</li> * <li>{@link org.xtext.asmetal.asmetaL.impl.FunctionInitializationImpl#getVariables <em>Variables</em>}</li> * <li>{@link org.xtext.asmetal.asmetaL.impl.FunctionInitializationImpl#getDomain <em>Domain</em>}</li> * <li>{@link org.xtext.asmetal.asmetaL.impl.FunctionInitializationImpl#getBody <em>Body</em>}</li> * </ul> * * @generated */ public class FunctionInitializationImpl extends MinimalEObjectImpl.Container implements FunctionInitialization { /** * The default value of the '{@link #getInizializedFunctionName() <em>Inizialized Function Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getInizializedFunctionName() * @generated * @ordered */ protected static final String INIZIALIZED_FUNCTION_NAME_EDEFAULT = null; /** * The cached value of the '{@link #getInizializedFunctionName() <em>Inizialized Function Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getInizializedFunctionName() * @generated * @ordered */ protected String inizializedFunctionName = INIZIALIZED_FUNCTION_NAME_EDEFAULT; /** * The cached value of the '{@link #getVariables() <em>Variables</em>}' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getVariables() * @generated * @ordered */ protected EList<String> variables; /** * The cached value of the '{@link #getDomain() <em>Domain</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDomain() * @generated * @ordered */ protected EList<Domain> domain; /** * The cached value of the '{@link #getBody() <em>Body</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getBody() * @generated * @ordered */ protected Term body; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected FunctionInitializationImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return AsmetaLPackage.Literals.FUNCTION_INITIALIZATION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String getInizializedFunctionName() { return inizializedFunctionName; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void setInizializedFunctionName(String newInizializedFunctionName) { String oldInizializedFunctionName = inizializedFunctionName; inizializedFunctionName = newInizializedFunctionName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AsmetaLPackage.FUNCTION_INITIALIZATION__INIZIALIZED_FUNCTION_NAME, oldInizializedFunctionName, inizializedFunctionName)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public EList<String> getVariables() { if (variables == null) { variables = new EDataTypeEList<String>(String.class, this, AsmetaLPackage.FUNCTION_INITIALIZATION__VARIABLES); } return variables; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public EList<Domain> getDomain() { if (domain == null) { domain = new EObjectContainmentEList<Domain>(Domain.class, this, AsmetaLPackage.FUNCTION_INITIALIZATION__DOMAIN); } return domain; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Term getBody() { return body; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetBody(Term newBody, NotificationChain msgs) { Term oldBody = body; body = newBody; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AsmetaLPackage.FUNCTION_INITIALIZATION__BODY, oldBody, newBody); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void setBody(Term newBody) { if (newBody != body) { NotificationChain msgs = null; if (body != null) msgs = ((InternalEObject)body).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AsmetaLPackage.FUNCTION_INITIALIZATION__BODY, null, msgs); if (newBody != null) msgs = ((InternalEObject)newBody).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AsmetaLPackage.FUNCTION_INITIALIZATION__BODY, null, msgs); msgs = basicSetBody(newBody, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AsmetaLPackage.FUNCTION_INITIALIZATION__BODY, newBody, newBody)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case AsmetaLPackage.FUNCTION_INITIALIZATION__DOMAIN: return ((InternalEList<?>)getDomain()).basicRemove(otherEnd, msgs); case AsmetaLPackage.FUNCTION_INITIALIZATION__BODY: return basicSetBody(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AsmetaLPackage.FUNCTION_INITIALIZATION__INIZIALIZED_FUNCTION_NAME: return getInizializedFunctionName(); case AsmetaLPackage.FUNCTION_INITIALIZATION__VARIABLES: return getVariables(); case AsmetaLPackage.FUNCTION_INITIALIZATION__DOMAIN: return getDomain(); case AsmetaLPackage.FUNCTION_INITIALIZATION__BODY: return getBody(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AsmetaLPackage.FUNCTION_INITIALIZATION__INIZIALIZED_FUNCTION_NAME: setInizializedFunctionName((String)newValue); return; case AsmetaLPackage.FUNCTION_INITIALIZATION__VARIABLES: getVariables().clear(); getVariables().addAll((Collection<? extends String>)newValue); return; case AsmetaLPackage.FUNCTION_INITIALIZATION__DOMAIN: getDomain().clear(); getDomain().addAll((Collection<? extends Domain>)newValue); return; case AsmetaLPackage.FUNCTION_INITIALIZATION__BODY: setBody((Term)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case AsmetaLPackage.FUNCTION_INITIALIZATION__INIZIALIZED_FUNCTION_NAME: setInizializedFunctionName(INIZIALIZED_FUNCTION_NAME_EDEFAULT); return; case AsmetaLPackage.FUNCTION_INITIALIZATION__VARIABLES: getVariables().clear(); return; case AsmetaLPackage.FUNCTION_INITIALIZATION__DOMAIN: getDomain().clear(); return; case AsmetaLPackage.FUNCTION_INITIALIZATION__BODY: setBody((Term)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case AsmetaLPackage.FUNCTION_INITIALIZATION__INIZIALIZED_FUNCTION_NAME: return INIZIALIZED_FUNCTION_NAME_EDEFAULT == null ? inizializedFunctionName != null : !INIZIALIZED_FUNCTION_NAME_EDEFAULT.equals(inizializedFunctionName); case AsmetaLPackage.FUNCTION_INITIALIZATION__VARIABLES: return variables != null && !variables.isEmpty(); case AsmetaLPackage.FUNCTION_INITIALIZATION__DOMAIN: return domain != null && !domain.isEmpty(); case AsmetaLPackage.FUNCTION_INITIALIZATION__BODY: return body != null; } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (inizializedFunctionName: "); result.append(inizializedFunctionName); result.append(", variables: "); result.append(variables); result.append(')'); return result.toString(); } } //FunctionInitializationImpl
[ "f.quinterosterraz@studenti.unibg.it" ]
f.quinterosterraz@studenti.unibg.it
5e3ef401d44e71cc1c75b6d0b7146f9b048b7895
8c9662fa87a6904750b188e928cf65aed58a1a98
/codegen/output/java/BaseAI.java
276e0c3a6c22c2fd43d47a8ce9d58055c5d66a62
[]
no_license
siggame/MegaMinerAI-5
c7293fa61e7d97f8b3866a2ddfbdfe625ab3aa47
8c77227039430a45dd3b74103d80d478616c542b
refs/heads/master
2021-01-22T08:23:29.114202
2013-02-06T14:05:15
2013-02-06T14:05:15
8,052,175
1
0
null
null
null
null
UTF-8
Java
false
false
2,180
java
/// \brief A basic AI interface. ///This class implements most the code an AI would need to interface with the lower-level game code. ///AIs should extend this class to get a lot of builer-plate code out of the way ///The provided AI class does just that. public abstract class BaseAI { static Plant[] plants; static int iteration; boolean initialized; /// ///Make this your username, which should be provided. public abstract String username(); /// ///Make this your password, which should be provided. public abstract String password(); /// ///This is run on turn 1 before run public abstract void init(); /// ///This is run every turn . Return true to end the turn, return false ///to request a status update from the server and then immediately rerun this function with the ///latest game status. public abstract boolean run(); public boolean startTurn() { int count = 0; count = Client.INSTANCE.getPlantCount(); plants = new Plant[count]; for(int i = 0; i < count; i++) { plants[i] = new Plant(Client.INSTANCE.getPlant(i)); } iteration++; if(!initialized) { initialized = true; init(); } return run(); } int boardX() { return Client.INSTANCE.getBoardX(); } int boardY() { return Client.INSTANCE.getBoardY(); } int gameNumber() { return Client.INSTANCE.getGameNumber(); } ///Player 0's light int player0Light() { return Client.INSTANCE.getPlayer0Light(); } ///Player 0's score int player0Score() { return Client.INSTANCE.getPlayer0Score(); } ///Player 1's light int player1Light() { return Client.INSTANCE.getPlayer1Light(); } ///Player 1's score int player1Score() { return Client.INSTANCE.getPlayer1Score(); } ///Player Number; either 0 or 1 int playerID() { return Client.INSTANCE.getPlayerID(); } int turnNumber() { return Client.INSTANCE.getTurnNumber(); } }
[ "brianwgoldman@acm.org" ]
brianwgoldman@acm.org
fd28634e94313db8445c1a646106d2f20984eb4c
fd6ea6ec2ffcc68bfec733ab70d6308e08c292e7
/taotao-common/src/main/java/com/taotao/jedis/JedisClient.java
ea24c120f6237ec4856d1d8213ebbe6accbc3c9b
[]
no_license
menyin/TaotaoWraper
e7b1061c8af6b5caf078633e7cf66a6bd99d37ce
cf6f4bdb7a84594c22b0b4a1efe4acbadb48aa84
refs/heads/master
2020-04-19T03:26:00.183287
2019-01-28T09:31:25
2019-01-28T09:31:25
167,934,259
0
0
null
null
null
null
UTF-8
Java
false
false
454
java
package com.taotao.jedis; //public interface JedisClient extends JedisCommands { public interface JedisClient { String set(String key, String value); String get(String key); Boolean exists(String key); Long expire(String key, int seconds); Long ttl(String key); Long incr(String key); Long hset(String key, String field, String value); String hget(String key, String field); Long hdel(String key, String... field); }
[ "3331866906@qq.com" ]
3331866906@qq.com
e0ca115dbaec071799ea58bf56143094feea8cf1
754347339a73833ad2a76febd4a23d240df7feae
/xc-framework-model/src/main/java/com/xuecheng/framework/domain/filesystem/FileSystem.java
5a92c90b61ecdf4bd702a9045df9bfd1c1f4ff91
[]
no_license
oliwengithub/xcEduservice
b55e22f2cca9eaf3898e3325e27c87cadd800b6b
921046df56dd904c10e34bb2b453e1bd402bdc0f
refs/heads/master
2022-12-01T02:31:53.325981
2022-03-31T06:18:06
2022-03-31T06:18:06
199,619,741
3
0
null
2022-11-24T06:26:39
2019-07-30T09:26:47
Java
UTF-8
Java
false
false
952
java
package com.xuecheng.framework.domain.filesystem; import lombok.Data; import lombok.ToString; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; import java.util.Date; import java.util.Map; /** * Created by mrt on 2018/2/5. */ @Data @ToString @Document(collection = "filesystem") public class FileSystem { @Id private String fileId; //文件请求路径 private String filePath; //文件大小 private long fileSize; //文件名称 private String fileName; //文件类型 private String fileType; //图片宽度 private int fileWidth; //图片高度 private int fileHeight; //用户id,用于授权 private String userId; //业务key private String businesskey; //业务标签 private String filetag; //文件元信息 private Map metadata; //文件上传时间 private Date createTime; }
[ "001518051406988" ]
001518051406988
70fbc54af1ede91bee5eb44097ae6fd1698f24a9
62ec5a8bfa9793b4cf0bc0feb39805f9bfef5553
/app/src/main/java/com/rxandroidex/rxandroidexapp/app/utils/PrefUtils.java
3307c426984c91651b9ca43220d9013e54f65ac1
[]
no_license
uyit14/RxAndroidEx
b768442d66510f037c19c0cd9336f918597b5453
8c13363794de4f8670f1ca1f518eaa7b9cd6f0fb
refs/heads/master
2020-05-22T12:38:12.378322
2019-05-13T04:28:29
2019-05-13T04:28:29
186,344,398
0
0
null
null
null
null
UTF-8
Java
false
false
826
java
package com.rxandroidex.rxandroidexapp.app.utils; import android.content.Context; import android.content.SharedPreferences; public class PrefUtils { /** * Storing API Key in shared preferences to * add it in header part of every retrofit request */ public PrefUtils() { } private static SharedPreferences getSharedPreferences(Context context) { return context.getSharedPreferences("APP_PREF", Context.MODE_PRIVATE); } public static void storeApiKey(Context context, String apiKey) { SharedPreferences.Editor editor = getSharedPreferences(context).edit(); editor.putString("API_KEY", apiKey); editor.commit(); } public static String getApiKey(Context context) { return getSharedPreferences(context).getString("API_KEY", null); } }
[ "uy.tai@edge-works.net" ]
uy.tai@edge-works.net
65013751123188493f58324634f927db9060f20c
bdc29c19304b4976db703d2df35650104300f67e
/src/com/Java8/stream/filter/StringList.java
5f2e9dd5f3f2a12a94f740cb2a180f48ac783fb1
[]
no_license
ranjitpokale119/Interview-Java-Programs
e25e6f938befaa1566ff4e48469e156e5e8b88db
a9ac0598fd310a1ebd0b20f32bc3bda6dc9510db
refs/heads/master
2023-07-17T01:58:53.355223
2021-08-27T09:09:37
2021-08-27T09:09:37
360,395,521
0
0
null
null
null
null
UTF-8
Java
false
false
1,400
java
package com.Java8.stream.filter; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; public class StringList { public static void main(String[] args) { List<String> strings = Arrays.asList("abc", "", "bc", "efg", "abcd", "", "jkl", "abc"); List<String> filtered = strings.stream().filter(string -> !string.isEmpty()).collect(Collectors.toList()); System.out.println("Filtered List: " + filtered); String mergedString = strings.stream().filter(string -> !string.isEmpty()).collect(Collectors.joining(", ")); System.out.println("Merged String: " + mergedString); int count = (int) Stream.of(1, 2, 3, 4, 5) .filter(i -> i < 4) // Intermediate Operation filter .count(); //Couting System.out.println("count = " + count); List<Integer> count1 = Stream.of(1, 2, 2, 1, 3, 4, 5) .filter(i -> i < 4) // Intermediate Operation filter .distinct() //Finding Distinct list elements .collect(Collectors.toList()); System.out.println("count1 = " + count1); List<String> diStrings1 = strings.stream() .distinct() //Finding Distinct list elements .collect(Collectors.toList()); System.out.println("diStrings1 = " + diStrings1); } }
[ "ranjitpokale119@gmail.com" ]
ranjitpokale119@gmail.com
72683d366235d47cf3f9e2462db3f99c905c02d3
2c13e6e1185322b0d95f942143e867fa54b1029c
/Files/Passenger57.java
834399b8ba4c2442a105ca9beaf3e797260547ad
[]
no_license
kearnspadraig/CasinoGames
72a5aae6bd9c6f6eb119a9d2ef09c9a5900e527e
181558da0a88967da36c42761bad53b9b83a665b
refs/heads/master
2021-01-11T01:28:25.186531
2017-02-02T19:25:11
2017-02-02T19:25:11
70,700,010
0
0
null
null
null
null
UTF-8
Java
false
false
1,584
java
package Files; import java.util.Set; /** * Created by Padraig on 04/11/2016. */ public class Passenger57 extends Player { Outcome black ; Table table; public Passenger57(){ super(); } public Passenger57(Table activeTable){ table = activeTable; //System.out.println("Table.wheel = " + table.wheel.toString()); black = activeTable.wheel.getOutcome("Black Bet"); } public Passenger57(Table activeTable, int inStake){ super(activeTable, inStake); } public Passenger57(Table activeTable, int inStake, int inRoundsToGo){ super(activeTable, inStake, inRoundsToGo); } public void winners(Set<Outcome> winners){ roundsToGo--; } public boolean playing(){ boolean playing = (5 < stake && roundsToGo > 0); //System.out.println(String.format("Playing : %s\nStake : %d\nRoundsToGo : %d",playing, stake, roundsToGo)); return playing; } public void placeBets(){ try { table.placeBet(new Bet(5, black)); }catch (InvalidBet e){ System.out.print("Passenger 57 Failed to bet"); } } public void win(Bet winningBet){ System.out.println(String.format("Winning Bet! %s \n Won %d Result was %s", winningBet.toString(), winningBet.winAmount(), winningBet.getOutcome().toString())); } public void lose(Bet winningBet){ System.out.println(String.format("Losing Bet! %s \n lost %d Result was %s", winningBet.toString(), winningBet.loseAmount(), winningBet.getOutcome().toString())); } }
[ "kearns.padraig@gmail.com" ]
kearns.padraig@gmail.com
fa6beebcfd0d42e7f44f1e86b181294cf553faf5
4741cae76aafaa79c243c9fb24cda5a13875bc7c
/geoTask/src/main/java/com/example/GeoTask/asynctasks/LoadPlaceFromGoogleGeocoderAsyncTask.java
991150f7597b87476c7d01626bd167c90ab3d459
[]
no_license
eggordeev/geotask
c4ef8de5dd04c740c65dcfa3e9a2f67a511524fe
1f81320161119097f7c01e752f8cd1d0a5fa7d4e
refs/heads/master
2021-01-13T02:27:02.924191
2014-11-18T16:53:29
2014-11-18T16:53:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,971
java
package com.example.GeoTask.asynctasks; import android.os.AsyncTask; import android.widget.ArrayAdapter; import android.widget.ListView; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.*; import java.net.*; import java.util.ArrayList; import java.util.List; /** * Created by egordeev on 14.09.14. */ public class LoadPlaceFromGoogleGeocoderAsyncTask extends AsyncTask<Void, Void, List<String>> { private String place_to_find; private String url_place_to_find; private ArrayAdapter<String> adapter_with_possible_places; private static final int max_results_number = 7; public LoadPlaceFromGoogleGeocoderAsyncTask(String place_to_find, ArrayAdapter<String> possible_places){ this.place_to_find = place_to_find; this.adapter_with_possible_places = possible_places; // обращение к google directions api: http://maps.googleapis.com/maps/api/geocode/json?address= String url = "http://maps.googleapis.com/maps/api/geocode/json?address="; String sensor = "&sensor=false"; StringBuilder final_url = new StringBuilder(); final_url.append(url); final_url.append(this.place_to_find); final_url.append(sensor); this.url_place_to_find = final_url.toString(); } @Override protected void onPreExecute(){ this.adapter_with_possible_places.clear(); this.adapter_with_possible_places.notifyDataSetChanged(); } @Override protected List<String> doInBackground(Void... params) { List<String> res = new ArrayList<String>(); try { HttpClient httpclient = new DefaultHttpClient(); HttpGet request = new HttpGet(); URI website = new URI(url_place_to_find); request.setURI(website); HttpResponse response = httpclient.execute(request); BufferedReader in = new BufferedReader(new InputStreamReader( response.getEntity().getContent())); if(response.getStatusLine().getStatusCode() == 200 ){ StringBuilder server_response = new StringBuilder(); String tmp = ""; while ((tmp = in.readLine()) != null){ server_response.append(tmp); } // обрабатываем json-ответ сервера try { JSONObject jsonResponse = new JSONObject(server_response.toString()); String status_code = jsonResponse.getString("status"); if (status_code.equals("OK")) { JSONArray results_array = jsonResponse.getJSONArray("results"); // нужно проверить, сколько объектов находится в массиве results_array, потому что может быть > 1 int len = results_array.length(); if (len > max_results_number) { len = max_results_number; } for (int i = 0; i < len; i++) { JSONObject result_object = results_array.getJSONObject(i); JSONObject geometry_object = result_object.getJSONObject("geometry"); JSONObject location_object = geometry_object.getJSONObject("location"); double lat = location_object.getDouble("lat"); double lng = location_object.getDouble("lng"); // формирую адрес для списка StringBuilder address = new StringBuilder(); address.append(result_object.getString("formatted_address")); address.append(" "); address.append(lat); address.append(" "); address.append(lng); res.add(address.toString()); } } } catch (JSONException e) { e.printStackTrace(); } } } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (URISyntaxException e) { e.printStackTrace(); } return res; } @Override protected void onPostExecute(List<String> res){ for (String item:res){ adapter_with_possible_places.add(item); } adapter_with_possible_places.notifyDataSetChanged(); } }
[ "egordeev18@gmail.com" ]
egordeev18@gmail.com
965e015d375ad2cdffb934287c8e9e9cadf4e6f7
99c3f8eb22a9bcf3d4333a98b8cca6b35ba314e9
/src/main/java/clienteHTML5/encapsulaciones/FormularioIndexDB.java
390c8089c20982b46abb785d29d27858c8a9ca25
[]
no_license
danielmoronta23/Proyecto-Final
d2f7843544351065c45a12a9209f00d36520538c
b23045ecf6ea88ae204a2514f9e1be733403177d
refs/heads/master
2022-12-10T07:04:34.710559
2020-08-27T04:23:24
2020-08-27T04:23:24
290,675,181
0
0
null
null
null
null
UTF-8
Java
false
false
4,428
java
package clienteHTML5.encapsulaciones; import clienteHTML5.servicios.ServicioUsuario; import java.util.List; public class FormularioIndexDB { private String nombre; private String sector; private String nivelEscolar; private String latitud; private String longitud; private String id; private String usuario; private Foto foto; public FormularioIndexDB() { } public FormularioIndexDB(String nombre, String sector, String nivelEscolar, String latitud, String longitud, String id, String usuario) { this.nombre = nombre; this.sector = sector; this.nivelEscolar = nivelEscolar; this.latitud = latitud; this.longitud = longitud; this.id = id; this.usuario = usuario; } public FormularioIndexDB(String nombre, String sector, String nivelEscolar, String latitud, String longitud, String id, String usuario, Foto foto) { this.nombre = nombre; this.sector = sector; this.nivelEscolar = nivelEscolar; this.latitud = latitud; this.longitud = longitud; this.id = id; this.usuario = usuario; this.foto = foto; } public Foto getFoto() { return foto; } public Foto setFoto(Foto foto) { this.foto = foto; return foto; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public String getSector() { return sector; } public void setSector(String sector) { this.sector = sector; } public String getNivelEscolar() { return nivelEscolar; } public void setNivelEscolar(String nivelEscolar) { this.nivelEscolar = nivelEscolar; } public String getLatitud() { return latitud; } public void setLatitud(String latitud) { this.latitud = latitud; } public String getLongitud() { return longitud; } public void setLongitud(String longitud) { this.longitud = longitud; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getUsuario() { return usuario; } public void setUsuario(String usuario) { this.usuario = usuario; } public int agregarFormulariosDB(List<FormularioIndexDB> formularioIndexDB){ Formulario aux = null; Usuario auxUsuario = null; if(formularioIndexDB.size()>0){ auxUsuario = Controladora.getInstance().buscarUsuario(formularioIndexDB.get(0).getUsuario()); } for (FormularioIndexDB f: formularioIndexDB) { aux = new Formulario(f.getNombre(),f.getSector(),f.getNivelEscolar(), auxUsuario, new Ubicacion(f.getLongitud(),f.getLatitud())); Controladora.getControladora().agregarRegistro(aux); } return formularioIndexDB.size(); } public Formulario agregarFormulariosDB(FormularioIndexDB f){ Formulario aux = null; Usuario auxUsuario = null; System.out.println("Entro!!!!!!!!!!!"); if(f!=null){ auxUsuario = Controladora.getInstance().buscarUsuario(f.getUsuario()); if(auxUsuario != null) { aux = new Formulario(f.getNombre(),f.getSector(),f.getNivelEscolar(), auxUsuario, new Ubicacion(f.getLongitud(),f.getLatitud()), new Foto(f.foto.getNombre(),f.foto.getMimeType(), f.foto.getFotoBase64())); System.out.println("Se creo el form!!"); Controladora.getControladora().agregarRegistro(aux); return new Formulario(); } } return null; } public boolean actualizarFormulariosDB(FormularioIndexDB f){ Formulario aux = null; Usuario auxUsuario = null; if(f!=null){ auxUsuario = Controladora.getInstance().buscarUsuario(f.getUsuario()); aux = Controladora.getInstance().buscarFormulario(f.getId()); if(auxUsuario!= null && aux != null ){ aux = new Formulario(f.getNombre(),f.getSector(),f.getNivelEscolar(), auxUsuario, new Ubicacion(f.getLongitud(),f.getLatitud())); return Controladora.getControladora().actualizarRegistro(aux); } } return false; } }
[ "danielmoronta23@gmail.com" ]
danielmoronta23@gmail.com
8c7c97095013c904c303b67398666684b3931acd
a1e706db07dd67771234d08fcb705e1b9d407c76
/LanguageWorkbench/ecnu.models.xshml.xshml/src-gen/ecnu/models/xshml/xshml/aspects/EventAspectEventAspectProperties.java
d60425450e3007bd6746f1c5e9caa11c75a2b1ac
[]
no_license
ECNUCPS/SHML
3e83813cb5c8698b051c669a5529b1c0e07c8710
82b0f3fc785c6f632efba43cee718535f3fcca5f
refs/heads/master
2020-06-26T06:26:45.647770
2019-04-24T02:26:11
2019-04-24T02:26:11
199,559,417
0
0
null
null
null
null
UTF-8
Java
false
false
117
java
package ecnu.models.xshml.xshml.aspects; @SuppressWarnings("all") public class EventAspectEventAspectProperties { }
[ "wangyao2221@163.com" ]
wangyao2221@163.com
b91914b1ead17b68bcfec960c542e72e1f167a23
deeb65a3da64f945d1eb5046858639d3cfbd0156
/Main10926.java
722c9114a5d355da88ad1da2d0c0ea7f4a69fbf7
[]
no_license
lovinix/BOJ_java
54e4a68d44977a9ee427e3047a7c7f4ce6af9d17
4e3e538869031821560391ff28db162fb30e2dd9
refs/heads/master
2022-08-18T05:19:45.506481
2019-05-22T16:07:12
2019-05-22T16:07:12
93,701,679
0
0
null
null
null
null
UTF-8
Java
false
false
346
java
import java.io.*; public class Main10926 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); bw.write(br.readLine()+"??!"); bw.close(); } }
[ "sylph0606@gmail.com" ]
sylph0606@gmail.com
31842f9423be03428637ef3909b6da5f3c29c272
6c4d7a9d4019f7fc84573aecc56d017336bc8dd0
/src/main/java/cn/dubidubi/service/impl/TestService2Impl.java
e0ab80d9b6415782a8fdb22abdc21ceb8b02dad4
[]
no_license
lzzzz4/practice
7a13744a39cdaeb12f4228e3ecdf285a3e37cc2f
7cc899d7ddf3a74e8d04892cf27b623992e607b4
refs/heads/master
2020-03-12T13:39:50.252415
2018-06-19T05:24:28
2018-06-19T05:24:28
130,647,503
4
0
null
null
null
null
UTF-8
Java
false
false
501
java
package cn.dubidubi.service.impl; import cn.dubidubi.model.User; import cn.dubidubi.service.TestService; import org.springframework.stereotype.Service; /** * @Auther: 16224 * @Date: 2018/5/10 0010 21:38 * @Description: */ @Service("service2") public class TestService2Impl implements TestService { @Override public void hello(String Username, User user) { System.out.println("2"); } @Override public void save(String name) { System.out.println("2"); } }
[ "1622472966@qq.com" ]
1622472966@qq.com
098f3ac8587d12b5e647d05538a0634c25184eee
9c40b446ca74f3fef4b43fb75647ae41eb496990
/src/DatabaseAcc.java
d40a7df643501df063b02d0b32ebe18a47cd6ac7
[]
no_license
JingluYan/AccessDB
c10f940ad22fc520b89e4a56af6f9c0dd590a623
d40cf1091688009e495c0e07a62ed553a33798a0
refs/heads/master
2021-01-19T08:49:22.515995
2015-03-19T08:57:00
2015-03-19T08:57:00
32,510,332
0
0
null
null
null
null
UTF-8
Java
false
false
4,743
java
/** * This Class is for accessing the database using the JDBC and mySQL * * @author Jinglu Yan 18/03/2015 */ import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class DatabaseAcc { private Statement SQLStatement; private Connection cntDB; private String tableColumns; private String tableData; private FileReader read; //Need to modify based on users' information private static String username = "root"; private static String password = ""; /** * Constructor * Access database by using user name and password */ public DatabaseAcc(){ try{ //get the drivers for MySQL Class.forName("com.mysql.jdbc.Driver"); //connect to the database cntDB = DriverManager.getConnection( "jdbc:mysql://localhost:3306/Test", username, password); cntDB.setAutoCommit(true); }catch(SQLException e){ System.out.println(e); } catch(ClassNotFoundException e){ System.out.println(e); } } /** * Input order data into database * * @throws SQLException * @throws IOException */ public void inputOrderData(String fileName) throws SQLException, IOException{ int i = 1; read = new FileReader(fileName); while(i<read.array.size()){ tableColumns=(String) read.array.get(0); tableData=(String) read.array.get(i); SQLStatement = cntDB.createStatement(); SQLStatement.executeUpdate(String.format("INSERT INTO `order`("+ tableColumns + ")" + "VALUES(" + tableData + ")")); i++; } } /** * Input person data into database * * @throws SQLException * @throws IOException */ public void inputPersonData(String fileName) throws SQLException, IOException{ int i = 1; read = new FileReader(fileName); //Formatting to run the text as an SQL statement read.formatForPeople(); while(i<read.array.size()){ tableColumns=(String) read.array.get(0); tableData=(String) read.array.get(i); SQLStatement = cntDB.createStatement(); SQLStatement.executeUpdate(String.format("INSERT INTO person ("+ tableColumns + ")" + "VALUES(" + tableData + ")")); i++; } } /** * Query all the users which have an order with one or more orders */ public void personsWithOneOrder() throws SQLException{ ResultSet rs; SQLStatement = cntDB.createStatement(); rs = SQLStatement.executeQuery(String.format( "SELECT p.first_name, p.last_name, p.person_id,o.person_id, o.order_no\n" + "FROM person p, `order` o \n" + "WHERE o.person_id=p.person_id \n" + "GROUP BY p.first_name" )); System.out.println("User who have one order or more"); System.out.println("First_Name \t| Last_Name \t\t| Order_No"); //loop to get the information from the ResultSet above while(rs.next()){ String fName =rs.getString("first_name"); String lName =rs.getString("last_name"); int orderNo = rs.getInt("order_no"); System.out.printf("%s \t\t| %s \t\t| %d \n", fName, lName, orderNo); } } /** * Query all Orders with First Name of the corresponding person */ public void ordersWithName(String fName) throws SQLException{ ResultSet rs; SQLStatement = cntDB.createStatement(); rs = SQLStatement.executeQuery(String.format( "SELECT o.person_id, o.order_no\n" + "FROM person p, `order` o \n" + "WHERE o.person_id = p.person_id AND p.first_name = \"" + fName + "\"" )); System.out.println("All Orders with First Name:" + fName); System.out.println("Person_ID \t| Order_No \t"); while(rs.next()){ int personID =rs.getInt("person_id"); int orderNo = rs.getInt("order_no"); System.out.printf("%d \t\t| %d \t\t\n", personID, orderNo); } } }
[ "JingluYan12@gmail.com" ]
JingluYan12@gmail.com
f954873a117bd8c76e99ec98c380a41a3001f87f
dd105cc6199381936c860c6fea96700ba110c163
/dineshMS-Destination/src/main/java/com/dinesh/app/repository/IDestinationRepository.java
77499ac3aec505f18ac94a54b90793bb4435f9d4
[]
no_license
rokrLearn/DineshMS
f1a4e45d845bcd4dd834871517500029dbb7165f
0246ec285e109debb52e284774e4f9e61dbe6f71
refs/heads/main
2023-04-15T10:19:10.323998
2021-05-04T08:15:28
2021-05-04T08:15:28
364,185,672
0
0
null
null
null
null
UTF-8
Java
false
false
299
java
package com.dinesh.app.repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import com.dinesh.app.model.Destination; @Repository public interface IDestinationRepository extends JpaRepository<Destination, Long>{ }
[ "templatetel0@gmail.com" ]
templatetel0@gmail.com
2f00bf388f885653f8c7330922e73d4aa4896d8a
c8591d0260ad91cee697b8567270264bf2146afc
/core/src/com/mygdx/game/util/UserDataTypes.java
b3e185c2532af2e63da12202c3e3999953bf98f0
[]
no_license
irontissue/COMP460Ideas
5815c16a36b1cd47faf2b900a0d3a5220ba062e2
1d10cfcba3aea64b4b8b2aa093f3e9b9f3cc2e91
refs/heads/master
2021-09-12T21:03:23.095592
2018-04-20T18:20:57
2018-04-20T18:20:57
114,552,711
1
2
null
2018-04-18T19:15:46
2017-12-17T16:47:58
Java
UTF-8
Java
false
false
108
java
package com.mygdx.game.util; public enum UserDataTypes { FEET, BODY, HITBOX, EVENT, WALL, }
[ "donpommelo@gmail" ]
donpommelo@gmail
9d86666ff5e794a78a53b9e4942bc64b0050d7c9
cfe621e8c36e6ac5053a2c4f7129a13ea9f9f66b
/AndroidApplications/com.zeptolab.ctr.ads-912244/src/com/IQzone/postitial/obfuscated/hq.java
58ac834c19e5d9ad4b957590282efc16708c3260
[]
no_license
linux86/AndoirdSecurity
3165de73b37f53070cd6b435e180a2cb58d6f672
1e72a3c1f7a72ea9cd12048d9874a8651e0aede7
refs/heads/master
2021-01-11T01:20:58.986651
2016-04-05T17:14:26
2016-04-05T17:14:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
401
java
package com.IQzone.postitial.obfuscated; final class hq implements Runnable { private /* synthetic */ int a; private /* synthetic */ hf b; hq(hf hfVar, int i) { this.b = hfVar; this.a = i; } public final void run() { try { this.b.a.a("postitial-ads-day", String.valueOf(this.a)); } catch (om e) { gv.i(); } } }
[ "jack.luo@mail.utoronto.ca" ]
jack.luo@mail.utoronto.ca
40b97b8eeda564d7c0dea5b8278bd4c842494f14
eebf4e43cd94b8d88d2a688a03a2a103db0d0468
/shop/src/com/interview/hobart/shop/dao/impl/SorderDaoImpl.java
18e64792573df4b0bbaacd82ce4b0229ec7b9a9b
[]
no_license
hobartSimple/shop
bd655c004e861d91c4180cd4bc060d43bc892b7c
6cab71fd20a718fcd36ea18d43682f6fe3502381
refs/heads/master
2021-01-20T20:32:14.620126
2017-04-11T09:50:59
2017-04-11T09:50:59
64,653,502
1
0
null
null
null
null
UTF-8
Java
false
false
2,250
java
package com.interview.hobart.shop.dao.impl; import org.springframework.stereotype.Repository; import com.interview.hobart.shop.dao.SorderDao; import com.interview.hobart.shop.entity.ForderInfo; import com.interview.hobart.shop.entity.ProductInfo; import com.interview.hobart.shop.entity.SorderInfo; @Repository("sorderDao") public class SorderDaoImpl extends BaseDaoImpl<SorderInfo> implements SorderDao { //添加购物项,返回新的购物车 @Override public ForderInfo addSorder(ForderInfo forder, ProductInfo product) { boolean isHave = false; // 用来标记有没有重复购物项 // 拿到当前的购物项 SorderInfo sorder = productToSorder(product); // 判断当前购物项是否重复,如果重复,则添加数量即可 for (SorderInfo old : forder.getSorders()) { if (old.getProduct().getId().equals(sorder.getProduct().getId())) { // 购物项有重复,添加数量即可 old.setNumber(old.getNumber() + sorder.getNumber()); isHave = true; break; } } //当前购物项在购物车中不存在,新添加即可 if(!isHave) { //我们在这里插入一句: //在向购物中添加购物项之前,先建立购物项与购物车的关联,但是此时forder.id为null, //但是在入库的时候是先入库购物车,再入库购物项,那时候就有主键了 sorder.setForder(forder); forder.getSorders().add(sorder); } return forder; } //把商品数据转化为购物项 @Override public SorderInfo productToSorder(ProductInfo product) { SorderInfo sorder = new SorderInfo(); sorder.setName(product.getName()); sorder.setNumber(1); sorder.setPrice(product.getPrice()); sorder.setProduct(product); return sorder; } //根据商品编号更新商品数量 @Override public ForderInfo updateSorder(SorderInfo sorder, ForderInfo forder) { for(SorderInfo temp : forder.getSorders()) { if(temp.getProduct().getId().equals(sorder.getProduct().getId())) { temp.setNumber(sorder.getNumber()); } } return forder; } }
[ "hobartbhq@outlook.com" ]
hobartbhq@outlook.com
b8030ed5f58e8e25483cbaf25935816f39208f94
46825cad6aafc68af502a7c1ca926c78fe3c4879
/src/jvm_sxt/test01.java
980488641ff0389a38427f181b4f8d8693645266
[]
no_license
wky181/virtual-machine
16683e76ae1367d4fdf6e0515394e2b0b0942ebf
63857643472309f0724366c95ca84dff00fea6a1
refs/heads/master
2020-06-27T05:02:19.300380
2020-01-26T06:22:47
2020-01-26T06:22:47
199,851,081
0
0
null
null
null
null
UTF-8
Java
false
false
113
java
package jvm_sxt; /** * @author 武凯焱 * @date 2019/10/5 11:06 * @Description: */ public class test01 { }
[ "1813721268@qq.com" ]
1813721268@qq.com
4fcb94f20e62187240ee605b627ac706fa5d341f
bf241ed3875ec555af6e517bb78d4cfc202db60e
/valet-standalone-statistics/src/main/java/es/gob/valet/statistics/persistence/em/package-info.java
8d7c4d7acda33affedcce9e0d8ba1c63fa338668
[]
no_license
ctt-gob-es/valet
a5e26f976a0f8abd98ff2f513e292bbefba78394
7bfcdd2cbb74562c209c7002a3820360a307474b
refs/heads/master
2023-08-14T23:54:10.598147
2022-09-22T12:38:33
2022-09-22T12:38:33
117,945,945
2
3
null
2023-04-14T17:41:48
2018-01-18T07:07:12
Java
UTF-8
Java
false
false
166
java
/** * Package that provides all the persistence context object to operate with transactional database schemas. */ package es.gob.valet.statistics.persistence.em;
[ "Susana.Mesa@ESSVQ02F6YF3G2.ad.eu.rf-group.org" ]
Susana.Mesa@ESSVQ02F6YF3G2.ad.eu.rf-group.org
8f37e0fda730615699e2d5bcb7c8a38f2e17e1bd
516fb367430d4c1393f4cd726242618eca862bda
/sources/com/moengage/push/PushManager.java
cd4452edd67c9a92e82c2c32ece886d3d88e9d42
[]
no_license
cmFodWx5YWRhdjEyMTA5/Gaana2
75d6d6788e2dac9302cff206a093870e1602921d
8531673a5615bd9183c9a0466325d0270b8a8895
refs/heads/master
2020-07-22T15:46:54.149313
2019-06-19T16:11:11
2019-06-19T16:11:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,720
java
package com.moengage.push; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.annotation.WorkerThread; import android.text.TextUtils; import com.moe.pushlibrary.MoEHelper; import com.moe.pushlibrary.PayloadBuilder; import com.moengage.core.ConfigurationProvider; import com.moengage.core.DeviceAddTask; import com.moengage.core.Logger; import com.moengage.core.MoEDispatcher; import java.util.Map; public class PushManager { private static final String ID_PREFIX = "|ID|"; public static final String REG_ON_APP_OPEN = "REG_ON_APP_OPEN"; public static final String REQ_DELETE_TOKEN = "MOE_DEL_TOK"; public static final String REQ_REFRESH = "MOE_REG_REFRESH"; public static final String REQ_REGISTRATION = "MOE_REG_REQ"; public static final String SHOW_NOTIFICATION = "SHOW_NOTIFICATION"; public static final String TOKEN_BY_MOE = "MoE"; private static PushManager _INSTANCE; private final String ATTR_PUSH_TOKEN = "push_token"; private final String ATTR_REGISTRATION_BY = "registered_by"; private final String TOKEN_EVENT = "TOKEN_EVENT"; private boolean backStackBuilderOptoutFlag = false; private boolean isBaiduEnabled = false; private final Object lock = new Object(); private boolean optOutOfMoEngageExtras = false; private PushHandler pushHandler; private OnTokenReceivedListener tokenListener; public interface PushHandler { @WorkerThread void deleteToken(Context context, String str); Object getMessageListener(); @Nullable @WorkerThread String getPushToken(Context context); @Deprecated void handlePushPayload(Context context, Intent intent); void handlePushPayload(Context context, Bundle bundle); void handlePushPayload(Context context, String str); void handlePushPayload(Context context, Map<String, String> map); void logNotificationClicked(Context context, Intent intent); void offLoadToWorker(Context context, String str); @WorkerThread String registerForPushToken(Context context); void setMessageListener(Object obj); void setPushRegistrationFallback(Context context); } public interface OnTokenReceivedListener { void onTokenReceived(String str); } private PushManager() { loadPushHandler(); } /* JADX WARNING: Missing exception handler attribute for start block: B:5:0x0018 */ /* JADX WARNING: Exception block dominator not found, dom blocks: [] */ /* JADX WARNING: Missing block: B:12:?, code skipped: return; */ private void loadPushHandler() { /* r3 = this; r0 = r3.isBaiduEnabled; Catch:{ Exception -> 0x0040 } if (r0 != 0) goto L_0x002c; L_0x0004: r0 = "com.moengage.firebase.PushHandlerImpl"; r0 = java.lang.Class.forName(r0); Catch:{ Exception -> 0x0018 } r0 = r0.newInstance(); Catch:{ Exception -> 0x0018 } r0 = (com.moengage.push.PushManager.PushHandler) r0; Catch:{ Exception -> 0x0018 } r3.pushHandler = r0; Catch:{ Exception -> 0x0018 } r0 = "PushManager:loadPushHandler FCM Enabled"; com.moengage.core.Logger.v(r0); Catch:{ Exception -> 0x0018 } goto L_0x0059; L_0x0018: r0 = "com.moengage.push.gcm.PushHandlerImpl"; r0 = java.lang.Class.forName(r0); Catch:{ Exception -> 0x0040 } r0 = r0.newInstance(); Catch:{ Exception -> 0x0040 } r0 = (com.moengage.push.PushManager.PushHandler) r0; Catch:{ Exception -> 0x0040 } r3.pushHandler = r0; Catch:{ Exception -> 0x0040 } r0 = "PushManager:loadPushHandler GCM Enabled"; com.moengage.core.Logger.v(r0); Catch:{ Exception -> 0x0040 } goto L_0x0059; L_0x002c: r0 = "com.moengage.baidu.PushHandlerImpl"; r0 = java.lang.Class.forName(r0); Catch:{ Exception -> 0x0040 } r0 = r0.newInstance(); Catch:{ Exception -> 0x0040 } r0 = (com.moengage.push.PushManager.PushHandler) r0; Catch:{ Exception -> 0x0040 } r3.pushHandler = r0; Catch:{ Exception -> 0x0040 } r0 = "PushManager:loadPushHandler Baidu Enabled"; com.moengage.core.Logger.v(r0); Catch:{ Exception -> 0x0040 } goto L_0x0059; L_0x0040: r0 = move-exception; r1 = new java.lang.StringBuilder; r1.<init>(); r2 = "PushManager : loadPushHandler : did not find supported module: "; r1.append(r2); r0 = r0.getMessage(); r1.append(r0); r0 = r1.toString(); com.moengage.core.Logger.e(r0); L_0x0059: return; */ throw new UnsupportedOperationException("Method not decompiled: com.moengage.push.PushManager.loadPushHandler():void"); } public static PushManager getInstance() { if (_INSTANCE == null) { _INSTANCE = new PushManager(); } return _INSTANCE; } public void setMessageListener(Object obj) { if (this.pushHandler != null) { this.pushHandler.setMessageListener(obj); } } public void refreshToken(Context context, String str) { refreshTokenInternal(context, str, "App"); } public void refreshTokenInternal(Context context, String str, String str2) { if (!TextUtils.isEmpty(str)) { Logger.v("PushManager:refreshToken"); synchronized (this.lock) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("PushManager:refreshToken before ripping: = "); stringBuilder.append(str); Logger.v(stringBuilder.toString()); str = ripMultiplexingExtras(str); if (this.tokenListener != null) { this.tokenListener.onTokenReceived(str); } String gCMToken = ConfigurationProvider.getInstance(context).getGCMToken(); boolean tokenRefreshRequired = tokenRefreshRequired(context, str); if (tokenRefreshRequired || !ConfigurationProvider.getInstance(context).isDeviceRegistered()) { ConfigurationProvider.getInstance(context).setGCMToken(str); MoEDispatcher.getInstance(context).addTaskToQueue(new DeviceAddTask(context)); PayloadBuilder payloadBuilder = new PayloadBuilder(); payloadBuilder.putAttrString("push_token", str); payloadBuilder.putAttrString("registered_by", str2); MoEHelper.getInstance(context).trackEvent("TOKEN_EVENT", payloadBuilder.build()); } StringBuilder stringBuilder2 = new StringBuilder(); stringBuilder2.append("PushManager:refreshToken oldId: = "); stringBuilder2.append(gCMToken); stringBuilder2.append(" token = "); stringBuilder2.append(str); stringBuilder2.append(" --updating[true/false]: "); stringBuilder2.append(tokenRefreshRequired); Logger.v(stringBuilder2.toString()); } } } private String ripMultiplexingExtras(String str) { return (TextUtils.isEmpty(str) || !str.startsWith(ID_PREFIX)) ? str : str.substring(7); } public boolean tokenRefreshRequired(Context context, String str) { boolean z = false; if (TextUtils.isEmpty(str)) { return false; } String gCMToken = ConfigurationProvider.getInstance(context).getGCMToken(); if (TextUtils.isEmpty(gCMToken) || !str.equals(gCMToken)) { z = true; } return z; } public PushHandler getPushHandler() { return this.pushHandler; } public final void optoutBackStackBuilder(Boolean bool) { this.backStackBuilderOptoutFlag = bool.booleanValue(); } public final boolean isBackStackBuilderOptedOut(Context context) { return this.backStackBuilderOptoutFlag; } public void enableBaiduPush() { this.isBaiduEnabled = true; loadPushHandler(); } public boolean isIsBaiduEnabled() { return this.isBaiduEnabled; } public void setTokenObserver(OnTokenReceivedListener onTokenReceivedListener) { this.tokenListener = onTokenReceivedListener; } public final void optOutMoEngageExtras(boolean z) { this.optOutOfMoEngageExtras = z; } public final boolean isMoEngageExtrasOptedOut() { return this.optOutOfMoEngageExtras; } }
[ "master@master.com" ]
master@master.com
6ef05d7b0b6f69a406cd806cbf6097113d28376c
20eb62855cb3962c2d36fda4377dfd47d82eb777
/newEvaluatedBugs/Mockito_24_buggy/mutated/45/ArgumentMatcherStorageImpl.java
bc13ed333bcc19ec051990e484c62dfcb7e752ec
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,540
java
/* * Copyright (c) 2007 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockito.internal.progress; import org.hamcrest.Matcher; import org.mockito.exceptions.Reporter; import org.mockito.internal.matchers.And; import org.mockito.internal.matchers.LocalizedMatcher; import org.mockito.internal.matchers.Not; import org.mockito.internal.matchers.Or; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Stack; @SuppressWarnings("unchecked") public class ArgumentMatcherStorageImpl implements ArgumentMatcherStorage { public static final int TWO_SUB_MATCHERS = 2; public static final int ONE_SUB_MATCHER = 1; private Stack<LocalizedMatcher> matcherStack = new Stack<LocalizedMatcher>(); /* (non-Javadoc) * @see org.mockito.internal.progress.ArgumentMatcherStorage#reportMatcher(org.hamcrest.Matcher) */ public HandyReturnValues reportMatcher(Matcher matcher) { matcherStack.push(new LocalizedMatcher(matcher)); return new HandyReturnValues(); } /* (non-Javadoc) * @see org.mockito.internal.progress.ArgumentMatcherStorage#pullLocalizedMatchers() */ public List<LocalizedMatcher> pullLocalizedMatchers() { assertStateFor("Or(?)", org.mockito.internal.progress.ArgumentMatcherStorageImpl.TWO_SUB_MATCHERS); if (matcherStack.isEmpty()) { return Collections.emptyList(); } List<LocalizedMatcher> matchers = new ArrayList<LocalizedMatcher>(matcherStack); matcherStack.clear(); return (List) matchers; } /* (non-Javadoc) * @see org.mockito.internal.progress.ArgumentMatcherStorage#reportAnd() */ public HandyReturnValues reportAnd() { assertStateFor("And(?)", TWO_SUB_MATCHERS); And and = new And(popLastArgumentMatchers(TWO_SUB_MATCHERS)); matcherStack.push(new LocalizedMatcher(and)); return new HandyReturnValues(); } /* (non-Javadoc) * @see org.mockito.internal.progress.ArgumentMatcherStorage#reportOr() */ public HandyReturnValues reportOr() { assertStateFor("Or(?)", TWO_SUB_MATCHERS); Or or = new Or(popLastArgumentMatchers(TWO_SUB_MATCHERS)); matcherStack.push(new LocalizedMatcher(or)); return new HandyReturnValues(); } /* (non-Javadoc) * @see org.mockito.internal.progress.ArgumentMatcherStorage#reportNot() */ public HandyReturnValues reportNot() { assertStateFor("Not(?)", ONE_SUB_MATCHER); Not not = new Not(popLastArgumentMatchers(ONE_SUB_MATCHER).get(0)); matcherStack.push(new LocalizedMatcher(not)); return new HandyReturnValues(); } private void assertStateFor(String additionalMatcherName, int subMatchersCount) { assertMatchersFoundFor(additionalMatcherName); assertIncorrectUseOfAdditionalMatchers(additionalMatcherName, subMatchersCount); } private List<Matcher> popLastArgumentMatchers(int count) { List<Matcher> result = new LinkedList<Matcher>(); result.addAll(matcherStack.subList(matcherStack.size() - count, matcherStack.size())); for (int i = 0; i < count; i++) { matcherStack.pop(); } return result; } private void assertMatchersFoundFor(String additionalMatcherName) { if (matcherStack.isEmpty()) { matcherStack.clear(); new Reporter().reportNoSubMatchersFound(additionalMatcherName); } } private void assertIncorrectUseOfAdditionalMatchers(String additionalMatcherName, int count) { if(matcherStack.size() < count) { ArrayList<LocalizedMatcher> lastMatchers = new ArrayList<LocalizedMatcher>(matcherStack); matcherStack.clear(); new Reporter().incorrectUseOfAdditionalMatchers(additionalMatcherName, count, lastMatchers); } } /* (non-Javadoc) * @see org.mockito.internal.progress.ArgumentMatcherStorage#validateState() */ public void validateState() { if (!matcherStack.isEmpty()) { ArrayList lastMatchers = new ArrayList<LocalizedMatcher>(matcherStack); matcherStack.clear(); new Reporter().misplacedArgumentMatcher(lastMatchers); } } /* (non-Javadoc) * @see org.mockito.internal.progress.ArgumentMatcherStorage#reset() */ public void reset() { matcherStack.clear(); } }
[ "justinwm@163.com" ]
justinwm@163.com
674120ae71ce66c24d145cee16279e713520f4ec
9fddcd20251b3b2848047bed90e6c19f52063376
/bigtom-order-consumer/src/main/java/xyz/bigtom/OrderConsumerStarter.java
8a2ecdd9ee5d69adbe03f36df8ccd4b2169080d3
[]
no_license
YongkangFan/WetripProject
83e276789b7673f78472a7528bce9e92a418ee11
6256fe53743a0384e35ec7fc1dd7d8d28221a664
refs/heads/master
2022-12-25T19:50:57.564912
2020-10-09T04:14:34
2020-10-09T04:14:34
297,845,797
0
0
null
null
null
null
UTF-8
Java
false
false
847
java
package xyz.bigtom; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.cloud.openfeign.EnableFeignClients; import springfox.documentation.swagger2.annotations.EnableSwagger2; /** * <b>汤姆旅游租赁平台-订单管理- Consumer 启动器</b> * @author fanyongkang * @version 1.0.0 * @since 1.0.0 */ @EnableSwagger2 //给前端看接口文档 @EnableEurekaClient //作为EurekaClient端 @EnableFeignClients //通过Feign调用provider @SpringBootApplication //启动springboot框架 public class OrderConsumerStarter { public static void main(String[] args) { SpringApplication.run(OrderConsumerStarter.class,args); } }
[ "485853093@qq.com" ]
485853093@qq.com
1cc75f155e663d4b9306aaaf470d7f3447c1987c
6832918e1b21bafdc9c9037cdfbcfe5838abddc4
/jdk_11_maven/cs/graphql/timbuctoo/timbuctoo-instancev4/src/test/java/nl/knaw/huygens/timbuctoo/bulkupload/loaders/csv/CsvLoaderTest.java
0d2effb2b84bee063c1c06c713fd997d7f7c1a85
[ "Apache-2.0", "GPL-1.0-or-later", "LGPL-2.0-or-later", "GPL-3.0-only" ]
permissive
EMResearch/EMB
200c5693fb169d5f5462d9ebaf5b61c46d6f9ac9
092c92f7b44d6265f240bcf6b1c21b8a5cba0c7f
refs/heads/master
2023-09-04T01:46:13.465229
2023-04-12T12:09:44
2023-04-12T12:09:44
94,008,854
25
14
Apache-2.0
2023-09-13T11:23:37
2017-06-11T14:13:22
Java
UTF-8
Java
false
false
1,291
java
package nl.knaw.huygens.timbuctoo.bulkupload.loaders.csv; import nl.knaw.huygens.timbuctoo.bulkupload.InvalidFileException; import nl.knaw.huygens.timbuctoo.bulkupload.parsingstatemachine.ImporterStubs; import org.junit.Test; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import static com.google.common.collect.Lists.newArrayList; import static nl.knaw.huygens.timbuctoo.util.Tuple.tuple; public class CsvLoaderTest { @Test public void importCsv() throws Exception { File csvFile = new File(CsvLoaderTest.class.getResource("test.csv").toURI()); CsvLoader loader = new CsvLoader(new HashMap<>()); try { List<String> results = new ArrayList<>(); AtomicBoolean failure = new AtomicBoolean(false); loader.loadData(newArrayList(tuple("testcollection.csv", csvFile)), ImporterStubs.withCustomReporter(logline -> { if (logline.matches("failure.*")) { failure.set(true); } results.add(logline); })); if (failure.get()) { throw new RuntimeException("Failure during import: \n" + String.join("\n", results)); } } catch (InvalidFileException e) { throw new RuntimeException(e); } } }
[ "arcuri82@gmail.com" ]
arcuri82@gmail.com
54a8128834d58774404ae16156114cc2777f7bb4
db831e18c787108904d701ab1339f696a005cd20
/Dot.java
c5d9e9bdc693629cbec18140d30d417e7d811a71
[]
no_license
cmw244/ClockApplet
c9b2b32c77c0bddbe38f2e28efc62f9463df7e2c
e47c1e0a66bb20a97d55e21046b7ef1cc03d3ce7
refs/heads/master
2021-01-20T11:40:56.201614
2014-02-14T20:47:52
2014-02-14T20:47:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,916
java
package cs671; import java.awt.Paint; import java.awt.Color; import java.awt.Stroke; import java.awt.BasicStroke; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; /** A "dot" for the binary clock. A dot can be set or unset and is * displayed using two different colors to reflect its state. It's * drawn with a line thickness that increases with the size of the * dot, so all dots, big and small look pretty. Dots, as Swing * objects, are not thread-safe. However, methods {@code set} and * {@code unset} are properly synchronized and can be called from any * thread. */ class Dot extends Ellipse2D.Double { private static final long serialVersionUID = 6488626274695860708L; private static final Paint OFF = Color.GRAY; private static final Paint ON = Color.ORANGE; private final Stroke stroke; private Paint color; /** Builds a new Dot as a circle of radius <code>r</code> * centered in <code>(x,y)</code>. For aesthetics reasons, small * radiuses are rejected. * * @param x X-coordinate of the center of the circle */ public Dot (double x, double y, double r) { super(x-r,y-r,r*2,r*2); if (r < 10) throw new IllegalArgumentException("Dot radius must be at least 10"); stroke = new BasicStroke((float)(r / 5)); synchronized (this) { color = OFF; } } /** Paints the dot. */ public void paint(Graphics g) { Paint color; synchronized (this) { color = this.color; } Graphics2D g2 = (Graphics2D)g; g2.setStroke(stroke); g2.setPaint(color); g2.fill(this); g2.setPaint(Color.BLACK); g2.draw(this); } /** Sets the dot. In a set state, the dot is painted orange. */ public synchronized void set () { color = ON; } /** Unsets the dot. In an unset state, the dot is painted grey. */ public synchronized void unset () { color = OFF; } }
[ "cmlen23@gmail.com" ]
cmlen23@gmail.com
7e88cf2effa44d94919ac1d95cf9a2d525e9980e
cf64ddbbe4233972f0c66d18e412a783fc3f4146
/app/src/main/java/cn/zhengjun/rxandroidinaction/chapter02basicals/AsyncSubjectTest.java
41e9ef14e7d49677f6619863ea97cec8228356d9
[]
no_license
zhengjun1987/RxAndroidInAction
8e95356a7f7892342fac7be956042d64f1088693
a87b527580fea372ed26e865cfb4dde536e790a3
refs/heads/master
2020-04-23T22:38:17.206675
2019-03-03T19:00:42
2019-03-03T19:00:42
171,508,517
0
0
null
null
null
null
UTF-8
Java
false
false
1,851
java
package cn.zhengjun.rxandroidinaction.chapter02basicals; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import cn.zhengjun.rxandroidinaction.DefaultSubscriberImpl; import io.reactivex.schedulers.Schedulers; import io.reactivex.subjects.AsyncSubject; /** * Author : Zheng Jun * Email : zhengjun1987@outlook.com * Date : 2019/3/4 01:58 * Summary : 在这里描述Class的主要功能 */ public class AsyncSubjectTest { private static final String TAG = "AsyncSubjectTest"; public static void main(String[] args) { final AsyncSubject<String> asyncSubject = AsyncSubject.create(); asyncSubject.onNext("1"); asyncSubject.onComplete(); asyncSubject.onNext("2"); asyncSubject.subscribe(new DefaultSubscriberImpl<String>(TAG + "1")); asyncSubject .subscribeOn(Schedulers.single()) .subscribe(new DefaultSubscriberImpl<String>(TAG + "2")); Runnable runnable = new Runnable() { public void run() { asyncSubject.onNext("3"); } }; Executors.newFixedThreadPool(1).submit(runnable); asyncSubject.onNext("4"); try { TimeUnit.SECONDS.sleep(5); } catch (InterruptedException e) { e.printStackTrace(); } } } // 2019-03-04 02:52:41:435 main AsyncSubjectTest1.onStart // 2019-03-04 02:52:41:438 main AsyncSubjectTest1.onNext t = [2] // 2019-03-04 02:52:41:438 main AsyncSubjectTest1.onComplete // 2019-03-04 02:52:41:549 main AsyncSubjectTest2.onStart // 2019-03-04 02:52:41:574 RxSingleScheduler-1 AsyncSubjectTest2.onNext t = [2] // 2019-03-04 02:52:41:574 RxSingleScheduler-1 AsyncSubjectTest2.onComplete // // Process finished with exit code 0
[ "zhengjun1987@outlook.com" ]
zhengjun1987@outlook.com
1060dabf3d3c55a8a470f8aa6d41cffd40155a13
4c9f432bf16ae1d51bfc4e7b0a4a8cafd95c3826
/HomePage/app/src/main/java/com/example/vivekpatel/homepage/Adapters/CommunityAdapter.java
b0bb87046c36f330739ea627e2c7d2102fce143b
[]
no_license
vivek34/Early
4e7ca4a027645e7eb2ef00452db77bdf275f2069
0ea529fa1efc259a48bfa7bc3ad527c9a940e554
refs/heads/master
2021-04-09T13:47:27.059805
2018-03-31T02:41:21
2018-03-31T02:41:21
125,721,831
0
1
null
2018-03-31T02:41:22
2018-03-18T12:18:32
Java
UTF-8
Java
false
false
2,274
java
package com.example.vivekpatel.homepage.Adapters; import android.content.Context; import android.content.Intent; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.example.vivekpatel.homepage.Activities.MainScreen; import com.example.vivekpatel.homepage.Activities.SongList; import com.example.vivekpatel.homepage.R; import com.example.vivekpatel.homepage.model.CommunityInfo; import com.example.vivekpatel.homepage.model.SingleItemModel; import java.util.ArrayList; import java.util.List; /** * Created by pR0 on 3/30/2018. */ public class CommunityAdapter extends RecyclerView.Adapter<CommunityAdapter.SingleItemRowHolder> { private List<CommunityInfo> itemsList; private Context mContext; public CommunityAdapter(MainScreen context, List<CommunityInfo> itemsList) { this.itemsList = itemsList; this.mContext = context; } @Override public SingleItemRowHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.list_single_card, null); SingleItemRowHolder mh = new SingleItemRowHolder(v); return mh; } @Override public void onBindViewHolder(SingleItemRowHolder holder, int i) { CommunityInfo singleItem = itemsList.get(i); holder.tvTitle.setText(singleItem.getNamee()); } @Override public int getItemCount() { return (null != itemsList ? itemsList.size() : 0); } public class SingleItemRowHolder extends RecyclerView.ViewHolder { protected TextView tvTitle; protected ImageView itemImage; public SingleItemRowHolder(View view) { super(view); this.tvTitle = (TextView) view.findViewById(R.id.tvTitle); this.itemImage = (ImageView) view.findViewById(R.id.itemImage); view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mContext.startActivity(new Intent(mContext,SongList.class)); } }); } } }
[ "pro.gupta28@gmail.com" ]
pro.gupta28@gmail.com
fbe1bbb612b0e8f3c5ea99da3727cba26c5196df
b8b3ec8a34b71e5028b7f46abda1921886ddd8e1
/Java/src/com/zdream/pmw/platform/attend/IState.java
72a19b8504a198a7482808461fbf0ef93b07d621
[]
no_license
Gnzdream/corePokemonWorld
8fe654e0a57a3383062c9ce5dd84e89792f52d17
ee3b13c1628f1e1f7410ecaf80902da2a5f7fcfe
refs/heads/master
2021-01-22T22:23:52.605145
2017-08-11T01:56:17
2017-08-11T01:56:17
85,536,423
0
0
null
null
null
null
UTF-8
Java
false
false
3,821
java
package com.zdream.pmw.platform.attend; import com.zdream.pmw.platform.attend.service.EStateSource; import com.zdream.pmw.platform.control.IMessageCode; import com.zdream.pmw.platform.effect.Aperitif; import com.zdream.pmw.platform.prototype.BattlePlatform; import com.zdream.pmw.util.json.JsonObject; import com.zdream.pmw.util.json.JsonValue; /** * 状态接口<br> * <br> * <b>v0.1.1</b> * 补充了待实现的方法<br> * <br> * <b>v0.2</b> * execute 方法补充了默认实现<br> * <br> * <b>v0.2.1</b> * <p><li>添加了 set 方法并补充默认实现 * <li>添加了状态相关的生命周期方法 * </li></p> * * @since v0.1.1 * @author Zdream * @date 2016年4月12日 * @version v0.2.1 */ public interface IState extends IMessageCode { /** * 用来显示这个状态的名称<br> * 能够让程序清楚地辨明此状态<br> * 并将其状态在其它状态中找到并进行操作<br> * 不推荐使用中文<br> * @return * 该状态名称的字符串<br> */ public String name(); /** * 发动源<br> * 表明该状态是由什么源头引发的<br> * @see EStateSource * @return */ public EStateSource source(); /** * 对于一个消息(拦截前消息),该状态是否可以拦截并处理它<br> * 如果可以,那么该状态就会等待进行拦截和处理<br> * @see IState#execute(JsonValue) * @param msg * 拦截前消息的 head 信息 * @return */ public boolean canExecute(String msg); /** * 处理对应的消息(拦截前消息)<br> * <br> * 注意,由于每个状态有发动的优先级<br> * 因此可能就算 canExecute() 方法返回 true,该方法也不会执行<br> * <br> * 比如计算躲避的时候,飞空状态和道具光粉产生的状态都会触发,即 canExecute(1) 方法均返回 true<br> * 但是由于飞空状态在处理“计算躲避”状态时的优先度高,它将被触发,并选择拦截并直接返回<br> * 那么比飞空状态优先度低的状态,道具光粉产生的状态都不会执行 * @param interceptor * 拦截器 * @param ap * @param pf * 版本 v0.2 增加的参数<br> * 这是环境 * @return */ default public String execute(Aperitif ap, IStateInterceptable interceptor, BattlePlatform pf) { return interceptor.nextState(); } /** * 状态在指定消息(拦截前消息)下的发动优先度<br> * 返回的优先度高的状态先发动<br> * @param msg * @return */ public int priority(String msg); /** * 为该状态设置数据。数据以 Json 格式传递进来.<br> * <p>由于 effect 建立了 {@code com.zdream.pmw.platform.effect.StateBuilder} 工厂类, * 需要有一个方式来规范地加工生产需要的状态, 此时用 new 实例再 set 这样的做法是低效的, * 因此决定采用这个接口的方式, 让状态可能需要的数据作为一个整体传入, 让状态类自行决定 * 怎样设置数据.</p> * @param v 需要设置的数据 * @param pf * @since v0.2.1 */ default public void set(JsonObject v, BattlePlatform pf) {} /** * 说明这个状态是属于哪个种类的<br> * <p>该方法的添加主要是为了让容器能够更好地管理状态类</p> * <p>比如所有的异常状态类都会返回 "abnormal", * 因为它们都是属于<b>异常状态</b>的状态</p> * @return * 可以返回 null * @since v0.2.1 */ default public String ofCategory() { return name(); } /** * 状态刚建立时, 会触发的方法<br> * 状态生命周期相关<br> * @since v0.2.1 */ default public void onCreate() {} /** * 状态即将销毁时, 会触发的方法<br> * 状态生命周期相关<br> * @since v0.2.1 */ default public void onDestroy() {} }
[ "helloo@foxmail.com" ]
helloo@foxmail.com
138892bb5c780a8edb401b49fa3c4f1f16ca75e4
0945a8d1fbeb4fb74900c37ea32a7ed577113bc0
/baselib/src/main/java/com/wp/baselib/utils/imagepicker/photoview/log/LogManager.java
65d0d47b0063a5bfd607f655f4e0f68b66c6f3d6
[]
no_license
dsn727455218/mShouNewProject
348e4749260f841a7c32fe0fcb48c4a551462c99
6b00838498fa928e260ff6519fd099aa13c7e979
refs/heads/master
2020-04-12T14:57:42.565160
2017-09-28T08:41:02
2017-09-28T08:41:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,221
java
/******************************************************************************* * Copyright 2011, 2012 Chris Banes. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *******************************************************************************/ package com.wp.baselib.utils.imagepicker.photoview.log; import android.util.Log; /** * class that holds the {@link Logger} for this library, defaults to {@link LoggerDefault} to send logs to android {@link Log} */ public final class LogManager { private static Logger logger = new LoggerDefault(); public static void setLogger(Logger newLogger) { logger = newLogger; } public static Logger getLogger() { return logger; } }
[ "1399094187@qq.com" ]
1399094187@qq.com
7d2d6b83ff89b0421bedbf7b2a0cb2bf15ff0f4b
4a92a070e506d061521af43847d4b469af7913c2
/src/aula2/aula2.java
fc6830c776e8dafc1a473f15d4954eec589b5518
[]
no_license
Kakaroto446/aula2
906e1a30ccf7c473c55f8e59aec41d750f973b99
8758a7aeeb7946e111215226bfe290560ff8ac0d
refs/heads/master
2021-01-24T12:12:18.420416
2018-02-27T04:35:35
2018-02-27T04:35:35
123,124,414
0
0
null
null
null
null
ISO-8859-1
Java
false
false
6,126
java
package aula2; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class aula2 extends JFrame { JLabel rotulo1, rotulo2, rotulo3, exibir, creditos; JTextField texto1, texto2; JButton somr, mut, div, sub, limpar, mostra, sair, ocultar, desabilitar, habilitar; public aula2() { super ("Calculadora"); ImageIcon icone = new ImageIcon("pokeball.png"); setIconImage(icone.getImage()); Container tela=getContentPane(); setLayout(null); rotulo1 = new JLabel ("1º Número: "); rotulo2 = new JLabel ("2º Número: "); rotulo3 = new JLabel ("Resultado: "); rotulo3.setForeground(Color.red); creditos = new JLabel ("Desenvolvido por Johnny - 3IIA"); texto1 = new JTextField (5); texto2 = new JTextField (5); exibir = new JLabel (""); somr = new JButton (" + "); sub = new JButton (" -"); mut = new JButton (" * "); div = new JButton (" / "); sair = new JButton (" Sair "); limpar = new JButton("Limpar"); habilitar = new JButton("Habilitar"); desabilitar = new JButton("Desabiltar"); ocultar = new JButton("Ocultar"); mostra = new JButton("Exibir"); rotulo1.setBounds (20, 20, 100, 20); rotulo2.setBounds (20,60,100,20); rotulo3.setBounds (20,100,100,20); creditos.setBounds (180,180,300,20); texto1.setBounds (90,20, 50, 20); texto2.setBounds (90,60,50,20); exibir.setBounds (90,100,200,20); somr.setBounds (160,60,100,20); div.setBounds (160, 20, 100,20); sub.setBounds (270, 60, 100, 20); mut.setBounds (270, 20, 100, 20); sair.setBounds (270, 100, 100, 20); limpar.setBounds(160,100,100,20); habilitar.setBounds(160,140,100,20); desabilitar.setBounds(270,140,100,20); ocultar.setBounds(20,140,100,20); mostra.setBounds(20,180,100,20); somr.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { int numero1, numero2,som; som = 0; numero1 = Integer.parseInt(texto1.getText()); numero2 = Integer.parseInt(texto2.getText()); som = numero1 + numero2; exibir.setVisible(true); exibir.setText(""+som); } } ); sub.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { int numero1, numero2,sub; sub = 0; numero1 = Integer.parseInt(texto1.getText()); numero2 = Integer.parseInt(texto2.getText()); sub = numero1 - numero2; exibir.setVisible(true); exibir.setText(""+sub); } } ); div.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { int numero1, numero2,div; div = 0; numero1 = Integer.parseInt(texto1.getText()); numero2 = Integer.parseInt(texto2.getText()); div = numero1 / numero2; exibir.setVisible(true); exibir.setText("" +div); } } ); mut.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { int numero1, numero2,mut; mut = 0; numero1 = Integer.parseInt(texto1.getText()); numero2 = Integer.parseInt(texto2.getText()); mut = numero1 * numero2; exibir.setVisible(true); exibir.setText("" +mut); } } ); sair.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0); } } ); limpar.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { texto1.setText(null); texto2.setText(null); texto1.requestFocus(); } } ); ocultar.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { rotulo3.setVisible(false); exibir.setVisible(false); } } ); mostra.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { rotulo3.setVisible(true); exibir.setVisible(true); } } ); desabilitar.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { rotulo1.setEnabled(false); rotulo2.setEnabled(false); texto1.setEnabled(false); texto2.setEnabled(false); } } ); habilitar.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { rotulo1.setEnabled(true); rotulo2.setEnabled(true); texto2.setEnabled(true); texto1.setEnabled(true); } } ); exibir.setVisible (true); tela.add (rotulo1); tela.add (rotulo2); tela.add (rotulo3); tela.add (creditos); tela.add (texto1); tela.add (texto2); tela.add (exibir); tela.add (somr); tela.add (div); tela.add (sub); tela.add (mut); tela.add (sair); tela.add (limpar); tela.add (habilitar); tela.add (desabilitar); tela.add (ocultar); tela.add (mostra); setSize (500, 350); setVisible (true); setLocationRelativeTo(null); } public static void main(String args[]) { aula2 app = new aula2(); app.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); } }
[ "srpauzao@gmail.com" ]
srpauzao@gmail.com
9a45a7043c5509ca3621646b85185278a8b8327b
e236cb3e39507ecbba25c59de33f4f7c7e71de78
/android/app/src/main/java/com/MaySam/otobus/MainActivity.java
cef2c38883a3387ac2df6d807492c8ca6f547763
[]
no_license
maysoonabed/otobus
29be265480e0c1283a33b7771e8eeac34dfd5145
ac9df9682c00caafafc0db3bb420c689176b7825
refs/heads/main
2023-08-26T01:45:52.450396
2021-11-10T21:32:28
2021-11-10T21:32:28
340,951,746
0
0
null
null
null
null
UTF-8
Java
false
false
136
java
package com.MaySam.otobus; import io.flutter.embedding.android.FlutterActivity; public class MainActivity extends FlutterActivity { }
[ "maysoon.abdulqader99@gmail.com" ]
maysoon.abdulqader99@gmail.com
2ce66b642c1fa8c39744c6b65b1112e775538a7e
dbd06e95024bed5b29c4d632d3aa55e0515ecb74
/repository/src/main/java/uk/gov/hmcts/ccd/definition/store/repository/entity/WorkBasketInputCaseFieldEntity.java
9898c6afd31ff6d930c0d1d7a8e4f467d82ae5b8
[ "MIT" ]
permissive
codacy-badger/ccd-definition-store-api
06728653ad2ddfcbd45a35da3e6168dda7f92641
b00525d143c58b370946579076bc952179750951
refs/heads/master
2020-03-19T03:53:00.119859
2018-05-31T18:37:28
2018-05-31T18:37:28
135,771,380
0
0
MIT
2018-06-01T23:18:06
2018-06-01T23:18:06
null
UTF-8
Java
false
false
258
java
package uk.gov.hmcts.ccd.definition.store.repository.entity; import javax.persistence.Entity; import javax.persistence.Table; @Table(name = "workbasket_input_case_field") @Entity public class WorkBasketInputCaseFieldEntity extends GenericLayoutEntity { }
[ "valentin.laurin@digi2al.co.uk" ]
valentin.laurin@digi2al.co.uk
1a9415cc367416adf8bd3f2d9cade01838e0313f
07f4aa9da52915fc9fb9a787da18ae30b432ca45
/src/com/evs/doctor/model/Publication.java
8d4c6b998607d055145f544dd23f8658e869751c
[]
no_license
abrysov/Doctor
67c644051dd4e6e156bd196fe9732f7d5ee936d6
232f22e390e59d1e37025e7935ad09a5c076ee20
refs/heads/master
2016-09-15T02:06:20.854798
2016-01-10T09:24:39
2016-01-10T09:24:39
49,340,198
0
0
null
null
null
null
UTF-8
Java
false
false
8,528
java
package com.evs.doctor.model; import java.util.List; import org.codehaus.jackson.annotate.JsonProperty; public class Publication extends ResponseStatus implements Identify<Long> { private Long id; private String title; private String annotation; // THIS filed used for list view. private String authorName; private String authorFullName; private String authorSpecialty; private String authorId;// "081218014224044115163187007117051061233001142159", private String authorDegree; private String authorAvatarUrl; // http://img1.http://doktornarabote.ru/image/avatarq/081218014224044115163187007117051061233001142159 private int type;// 20 private String createdAt; // 2012-11-22T12:16:11.313Z private int commentsCount;// 0 private int recommendationsCount;// 0 private int videosCount;// 0 private int linksCount;// 0 private int pdfsCount;// 0 private int imagesCount;// 0 private int authorSexId;// 1 private String originalLink;// http://test.doktornarabote.ru/Publication/Single/54264", private int approvalStatus;// 1 private String content; private List<ImageLink> images; private List<PDFLink> pdfs; private List<Link> links; private List<VideoLink> videos; /** * @return the images */ @JsonProperty(value = "images") public final List<ImageLink> getImages() { return images; } /** * @param images the images to set */ public final void setImages(List<ImageLink> images) { this.images = images; } /** * @return the pdfs */ @JsonProperty(value = "pdfs") public final List<PDFLink> getPdfs() { return pdfs; } /** * @param pdfs the pdfs to set */ public final void setPdfs(List<PDFLink> pdfs) { this.pdfs = pdfs; } /** * @return the links */ @JsonProperty(value = "links") public final List<Link> getLinks() { return links; } /** * @param links the links to set */ public final void setLinks(List<Link> links) { this.links = links; } /** * @return the videos */ @JsonProperty(value = "videos") public final List<VideoLink> getVideos() { return videos; } /** * @param videos the videos to set */ public final void setVideos(List<VideoLink> videos) { this.videos = videos; } /** * @return the id */ public final Long getId() { return id; } /** * @param id the id to set */ public final void setId(Long id) { this.id = id; } /** * @return the title */ public final String getTitle() { return title; } /** * @param title the title to set */ public final void setTitle(String title) { this.title = title; } /** * @return the annotation */ public final String getAnnotation() { return annotation; } /** * @param annotation the annotation to set */ public final void setAnnotation(String annotation) { this.annotation = annotation; } /** * @return the authorName */ public final String getAuthorName() { return authorName; } /** * @param authorName the authorName to set */ public final void setAuthorName(String authorName) { this.authorName = authorName; } /** * @return the authorFullName */ public final String getAuthorFullName() { return authorFullName; } /** * @param authorFullName the authorFullName to set */ public final void setAuthorFullName(String authorFullName) { this.authorFullName = authorFullName; } /** * @return the authorSpecialty */ public final String getAuthorSpecialty() { return authorSpecialty; } /** * @param authorSpecialty the authorSpecialty to set */ public final void setAuthorSpecialty(String authorSpecialty) { this.authorSpecialty = authorSpecialty; } /** * @return the authorId */ public final String getAuthorId() { return authorId; } /** * @param authorId the authorId to set */ public final void setAuthorId(String authorId) { this.authorId = authorId; } /** * @return the authorDegree */ public final String getAuthorDegree() { return authorDegree; } /** * @param authorDegree the authorDegree to set */ public final void setAuthorDegree(String authorDegree) { this.authorDegree = authorDegree; } /** * @return the authorAvatarUrl */ public final String getAuthorAvatarUrl() { return authorAvatarUrl; } /** * @param authorAvatarUrl the authorAvatarUrl to set */ public final void setAuthorAvatarUrl(String authorAvatarUrl) { this.authorAvatarUrl = authorAvatarUrl; } /** * @return the type */ public final int getType() { return type; } /** * @param type the type to set */ public final void setType(int type) { this.type = type; } /** * @return the createdAt */ public final String getCreatedAt() { return createdAt; } /** * @param createdAt the createdAt to set */ public final void setCreatedAt(String createdAt) { this.createdAt = createdAt; } /** * @return the commentsCount */ public final int getCommentsCount() { return commentsCount; } /** * @param commentsCount the commentsCount to set */ public final void setCommentsCount(int commentsCount) { this.commentsCount = commentsCount; } /** * @return the recommendationsCount */ public final int getRecommendationsCount() { return recommendationsCount; } /** * @param recommendationsCount the recommendationsCount to set */ public final void setRecommendationsCount(int recommendationsCount) { this.recommendationsCount = recommendationsCount; } /** * @return the videosCount */ public final int getVideosCount() { return videosCount; } /** * @param videosCount the videosCount to set */ public final void setVideosCount(int videosCount) { this.videosCount = videosCount; } /** * @return the linksCount */ public final int getLinksCount() { return linksCount; } /** * @param linksCount the linksCount to set */ public final void setLinksCount(int linksCount) { this.linksCount = linksCount; } /** * @return the pdfsCount */ public final int getPdfsCount() { return pdfsCount; } /** * @param pdfsCount the pdfsCount to set */ public final void setPdfsCount(int pdfsCount) { this.pdfsCount = pdfsCount; } /** * @return the imagesCount */ public final int getImagesCount() { return imagesCount; } /** * @param imagesCount the imagesCount to set */ public final void setImagesCount(int imagesCount) { this.imagesCount = imagesCount; } /** * @return the authorSexId */ public final int getAuthorSexId() { return authorSexId; } /** * @param authorSexId the authorSexId to set */ public final void setAuthorSexId(int authorSexId) { this.authorSexId = authorSexId; } /** * @return the originalLink */ public final String getOriginalLink() { return originalLink; } /** * @param originalLink the originalLink to set */ public final void setOriginalLink(String originalLink) { this.originalLink = originalLink; } /** * @return the approvalStatus */ public final int getApprovalStatus() { return approvalStatus; } /** * @param approvalStatus the approvalStatus to set */ public final void setApprovalStatus(int approvalStatus) { this.approvalStatus = approvalStatus; } /** * @return the content */ public final String getContent() { return content; } /** * @param content the content to set */ public final void setContent(String content) { this.content = content; } }
[ "abrysov@ronin.pro" ]
abrysov@ronin.pro
19190ed8c190b242d40e6b54dd94b0b9651c8b0a
b9ba56bbc78ececf9700fa760ae7ad67ac142a3a
/examples/dynamic_data_nested_structs/java/DynamicDataNestedStruct.java
2cdc4c9604b86ced701c31872c33d14c44d43292
[]
no_license
razro/rticonnextdds-examples
bf8b02e6a66aa3ae7a6deff5333ba95e6b3c88d0
d70db6a616503d2741778ea7d588569ea3f99db2
refs/heads/master
2020-12-29T01:10:36.521630
2014-09-01T20:50:17
2014-09-01T20:50:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,430
java
import java.io.File; import java.io.FileDescriptor; import com.rti.dds.dynamicdata.DynamicData; import com.rti.dds.infrastructure.BadKind; import com.rti.dds.typecode.*; public class DynamicDataNestedStruct { static TypeCode innerStructGetTypeCode() { StructMember members[] = new StructMember[0]; TypeCode tc; tc = TypeCodeFactory.TheTypeCodeFactory.create_struct_tc("InnerType", members); try { tc.add_member("x", TypeCode.MEMBER_ID_INVALID, TypeCode.TC_DOUBLE, TypeCode.NONKEY_MEMBER); tc.add_member("y", TypeCode.MEMBER_ID_INVALID, TypeCode.TC_DOUBLE, TypeCode.NONKEY_MEMBER); } catch (Exception e) { System.err.println(e.getMessage()); } return tc; } static TypeCode outerStructGetTypeCode() { StructMember members[] = new StructMember[0]; TypeCode tc; tc = TypeCodeFactory.TheTypeCodeFactory.create_struct_tc("OuterType", members); try { tc.add_member("inner", TypeCode.MEMBER_ID_INVALID, innerStructGetTypeCode(), TypeCode.NONKEY_MEMBER); } catch (Exception e) { System.err.println(e.getMessage()); } return tc; } public static void main(String[] args) { DynamicData inner_data = new DynamicData(innerStructGetTypeCode(), DynamicData.PROPERTY_DEFAULT); DynamicData outer_data = new DynamicData(outerStructGetTypeCode(), DynamicData.PROPERTY_DEFAULT); DynamicData bounded_data = new DynamicData(null, DynamicData.PROPERTY_DEFAULT); /* Setting the inner data */ inner_data.set_double("x", DynamicData.MEMBER_ID_UNSPECIFIED, 3.14159); inner_data.set_double("y", DynamicData.MEMBER_ID_UNSPECIFIED, 2.71828); System.out.println("\n\n get/set_complex_member API"); System.out.println("------------------\n"); /* Get/Set complex member API */ System.out.println("Setting the initial values of struct with set_complex_member()\n"); outer_data.set_complex_member("inner", DynamicData.MEMBER_ID_UNSPECIFIED, inner_data); outer_data.print(null, 1); System.out.println("\n + get_complex_member() called"); outer_data.get_complex_member(inner_data, "inner", DynamicData.MEMBER_ID_UNSPECIFIED); System.out.println("\n + inner struct value"); inner_data.print(null, 1); System.out.println("\n + setting new values to inner struct\n"); inner_data.set_double("x", DynamicData.MEMBER_ID_UNSPECIFIED, 1.00000); inner_data.set_double("y", DynamicData.MEMBER_ID_UNSPECIFIED, 0.00001); System.out.println("\n + current outter struct value \n"); outer_data.print(null, 1); System.out.println("\n\n bind/unbind API"); System.out.println("------------------\n"); /* Bind/Unbind member API */ System.out.println("\n + bind complex member called\n"); outer_data.bind_complex_member(bounded_data, "inner", DynamicData.MEMBER_ID_UNSPECIFIED); bounded_data.print(null, 1); /* binding a member does not copy, so modifying the bounded member WILL modify the outer object */ System.out.println("\n + setting new values to inner struct\n"); bounded_data.set_double("x", DynamicData.MEMBER_ID_UNSPECIFIED, 1.00000); bounded_data.set_double("y", DynamicData.MEMBER_ID_UNSPECIFIED, 0.00001); /* Current value of outer data outter: inner: x: 1.000000 y: 0.000010 */ bounded_data.print(null, 1); outer_data.unbind_complex_member(bounded_data); System.out.println("\n + current outter struct value"); outer_data.print(null, 1); } }
[ "javier@rti.com" ]
javier@rti.com
e22b435de9154d376b38cd5d07c65e821cb6305e
4ae1a547570f22edb8c749fe635dbc74f6fbf673
/src/main/java/com/example/mydemo/repository/CateRoomRepository.java
8bae8637442c98ec51a2bbc780e7161a5227dad0
[]
no_license
QuocTuanJV/back-end-airbnb-version-01
1a8dafb47494b4ff227cb64c46942856a704d009
82ede9aa64b2882a20207d6dad2262ff623e7fdb
refs/heads/master
2020-12-20T18:53:29.519918
2020-02-19T04:51:00
2020-02-19T04:51:00
236,177,472
0
0
null
null
null
null
UTF-8
Java
false
false
291
java
package com.example.mydemo.repository; import com.example.mydemo.model.CategoryRoom; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.CrudRepository; public interface CateRoomRepository extends JpaRepository<CategoryRoom, Long> { }
[ "quoctuan.naf@gmail.com" ]
quoctuan.naf@gmail.com
85766ce943129b4c9de823c8aecd039dfc3767c9
fc3d40b14106ff4ec4e8f5865a85ad357e354afc
/src/main/java/lynx/designpattern/Factory/FactoryMethodTest.java
7585f6e6f78afc5e98fffe3e21e50601a732b7e8
[]
no_license
mactavisher/JavaEnssensials
aac7551bbdb9f88d3e5386c976ea8cdc9883d688
4a130763695ddbacbd8d396d9a9d60454c7b3307
refs/heads/master
2020-04-29T01:33:29.029610
2019-03-19T06:27:16
2019-03-19T06:27:16
175,734,630
1
0
null
null
null
null
UTF-8
Java
false
false
1,287
java
package lynx.designpattern.Factory; /** * runs a simple test */ public class FactoryMethodTest { public static void main(String[] args) { WeaponFactoryInterface M4A1Factory = new M4A1Factory(); WeaponFactoryInterface AK47Factory = new AK47Factory(); SimpleWeapon M4A1 = M4A1Factory.getWeapon(); SimpleWeapon AK47 = AK47Factory.getWeapon(); M4A1.openFire(); AK47.openFire(); } } /** * weapon factory interface, define the duty of this interface is to create weapon, * each class implemented this interface has it's own specific type of weapon to create */ interface WeaponFactoryInterface { public void createWeapon(); public SimpleWeapon getWeapon(); } /** * factory to create M4A1 */ class M4A1Factory implements WeaponFactoryInterface { private SimpleWeapon M4A1; public void createWeapon() { M4A1 = new M4A1(); } public SimpleWeapon getWeapon() { createWeapon(); return M4A1; } } /** * factory to create AK47 */ class AK47Factory implements WeaponFactoryInterface { private SimpleWeapon AK47; public void createWeapon() { AK47 = new AK47(); } public SimpleWeapon getWeapon() { createWeapon(); return AK47; } }
[ "1434117225@qq.com" ]
1434117225@qq.com