blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
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
689M
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
131 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
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
ab6a31da4c8761c20133c56fc7d59af465841014
692dcad756e38c4ddb78c9ba16a3ebb06bb39b8c
/app/src/main/java/com/androidtechies/godebate/MessageFeedAdapter.java
ff851d5e75589c9833795890b34655445697eef9
[]
no_license
jasbir1612/GoDebate
f9a5ac82a1e74b781b88c0b9e2e1fdcc47933d25
7aca2317a56212dda5f381b70c448e99d5e5730f
refs/heads/master
2021-01-10T10:36:31.786536
2016-03-10T17:10:13
2016-03-10T17:10:13
52,477,759
2
0
null
null
null
null
UTF-8
Java
false
false
3,225
java
package com.androidtechies.godebate; import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; import java.util.ArrayList; /** * Created by Jasbir Singh on 3/2/2016. */ public class MessageFeedAdapter extends ArrayAdapter<MessageBox> { Context mContext; ClipboardManager clipboard; public MessageFeedAdapter(Context context, ArrayList<MessageBox> messages) { super(context, R.layout.message_row, messages); mContext=context; clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); } @Override public View getView(int position, View convertView, ViewGroup parent) { final MessageBox message = getItem(position); if (convertView == null) { convertView = LayoutInflater.from(mContext).inflate(R.layout.message_row, parent, false); } TextView senderView = (TextView) convertView.findViewById(R.id.name); final TextView messageView = (TextView) convertView.findViewById(R.id.message); TextView timeView = (TextView) convertView.findViewById(R.id.time); if (message.isSelf()) { senderView.setGravity(Gravity.RIGHT); messageView.setGravity(Gravity.RIGHT); RelativeLayout.LayoutParams rightAlign = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT ); rightAlign.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); }else{ senderView.setGravity(Gravity.LEFT); messageView.setGravity(Gravity.LEFT); RelativeLayout.LayoutParams leftAlign = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT ); leftAlign.addRule(RelativeLayout.ALIGN_PARENT_LEFT); } messageView.setText(message.getMessage()); senderView.setText(message.getSender()); timeView.setText(message.getTime()); if (message.getMessage().length() > 0) { convertView.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View view) { ClipData clip = ClipData.newPlainText("message", message.getMessage()); clipboard.setPrimaryClip(clip); Toast.makeText(mContext, "Message copied to clipboard", Toast.LENGTH_SHORT).show(); return true; } }); } else { convertView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { } }); } return convertView; } }
181aad4e2a2155bc34645febef18c34fe4966f55
0384c937f9a6ae4bca4ccedaf3300befb1a81f9d
/switchsdk/src/test/java/net/gini/switchsdk/utils/ExifUtilsTest.java
5c86734e04bfc21a4a57e5dc4d7802bc685a0757
[ "MIT" ]
permissive
gini/gini-switch-sdk-android
4ae677c9dcfe687ac43a22fb78338cce4f037a9a
bd10eededf35b2d6973494e1891eea7f452e03d0
refs/heads/develop
2021-03-16T08:48:38.913514
2017-12-21T11:58:48
2017-12-21T11:58:48
84,853,962
3
1
MIT
2017-12-21T11:58:49
2017-03-13T17:13:16
Java
UTF-8
Java
false
false
3,375
java
package net.gini.switchsdk.utils; import static junit.framework.Assert.assertEquals; import org.junit.Before; import org.junit.Test; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class ExifUtilsTest { private List<Integer> mUnsupportedDegrees; private List<Integer> mUnsupportedExifTags; @Test public void getDegreesFromExif_shouldReturn0IfTagIs1() { int degreesFromExif = ExifUtils.getDegreesFromExif(1); assertEquals("Supported Exif tag 1 should return 0.", 0, degreesFromExif); } @Test public void getDegreesFromExif_shouldReturn0IfTagIsNotSupported() { for (Integer unsupportedExifTag : mUnsupportedExifTags) { int degreesFromExif = ExifUtils.getDegreesFromExif(unsupportedExifTag); assertEquals("Unsupported Exif tag should return 0.", 0, degreesFromExif); } } @Test public void getDegreesFromExif_shouldReturn180IfTagIs3() { int degreesFromExif = ExifUtils.getDegreesFromExif(3); assertEquals("Supported Exif tag 3 should return 180.", 180, degreesFromExif); } @Test public void getDegreesFromExif_shouldReturn270IfTagIs8() { int degreesFromExif = ExifUtils.getDegreesFromExif(8); assertEquals("Supported Exif tag 8 should return 270.", 270, degreesFromExif); } @Test public void getDegreesFromExif_shouldReturn90IfTagIs6() { int degreesFromExif = ExifUtils.getDegreesFromExif(6); assertEquals("Supported Exif tag 6 should return 90.", 90, degreesFromExif); } @Test public void getExifFromDegrees_shouldReturn1IfDegreeIs0() { int exifTag = ExifUtils.getExifFromDegrees(0); assertEquals("Supported degree 0 should return 1.", 1, exifTag); } @Test public void getExifFromDegrees_shouldReturn1IfDegreeIsNotSupported() { for (Integer unsupportedExifTag : mUnsupportedDegrees) { int exifTag = ExifUtils.getExifFromDegrees(unsupportedExifTag); assertEquals("Unsupported degree should return 1.", 1, exifTag); } } @Test public void getExifFromDegrees_shouldReturn3IfDegreeIs180() { int exifTag = ExifUtils.getExifFromDegrees(180); assertEquals("Supported degree 180 should return 3.", 3, exifTag); } @Test public void getExifFromDegrees_shouldReturn6IfDegreeIs90() { int exifTag = ExifUtils.getExifFromDegrees(90); assertEquals("Supported degree 90 should return 6.", 6, exifTag); } @Test public void getExifFromDegrees_shouldReturn8IfDegreeIs270() { int exifTag = ExifUtils.getExifFromDegrees(270); assertEquals("Supported degree 270 should return 8.", 8, exifTag); } @Before public void setUp() throws Exception { mUnsupportedExifTags = new ArrayList<>(); for (int i = -10; i < 10; i++) { mUnsupportedExifTags.add(i); } final List<Integer> supportedExifTags = Arrays.asList(1, 3, 6, 8); mUnsupportedExifTags.removeAll(supportedExifTags); mUnsupportedDegrees = new ArrayList<>(); for (int i = -360; i < 360; i++) { mUnsupportedDegrees.add(i); } final List<Integer> supportedDegrees = Arrays.asList(0, 90, 180, 270); mUnsupportedDegrees.removeAll(supportedDegrees); } }
bdb98aef4dd0ee8c2082830bf3fac8743f5f321b
e7c38a5d6d7740c30d3f8568638fd7855fd5b89f
/RSImageFilterBinderServer/src/cn/louispeng/imagefilter/filter/ImageFilter.java
77791a402b8938890340620a23fb71c1ec94cd69
[ "Apache-2.0" ]
permissive
windboat/RenderScript-ImageFilter-IPC
4d023159f560a2e4e9e6389418521a6b629248ff
137e08a05af4f677f9b976e4c4dd04b812846873
refs/heads/master
2021-01-17T10:15:58.720303
2014-05-26T03:11:20
2014-05-26T03:11:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,291
java
/** * @author pengluyu * * ImageFilter.java * 6:08:04 AM 2014 */ package cn.louispeng.imagefilter.filter; import android.content.Context; import android.graphics.Bitmap; import android.renderscript.Allocation; import android.renderscript.RenderScript; import android.renderscript.ScriptC; import android.util.Log; import cn.louispeng.imagefilter.bindercommon.ProfileUtil; /** * @author pengluyu */ public abstract class ImageFilter { protected final Context mContext; protected final Bitmap mBitmapIn; protected final Bitmap mBitmapOut; protected RenderScript mRS; protected Allocation mInAllocation; protected Allocation mOutAllocation; protected ScriptC mScript; public ImageFilter(Context context, Bitmap bitmapIn, Bitmap bitmapOut) { mContext = context; mBitmapIn = bitmapIn; mBitmapOut = bitmapOut; assert (null != mContext && null != bitmapIn && null != bitmapOut); } protected void preProcess() { mRS = RenderScript.create(mContext); mInAllocation = Allocation.createFromBitmap(mRS, mBitmapIn); mOutAllocation = Allocation.createFromBitmap(mRS, mBitmapOut); } protected void _preProcess() { } protected abstract void _process(); protected void _postProcess() { } public void process() { long startTime = System.currentTimeMillis(); preProcess(); _preProcess(); Log.d("profile", getClass().getSimpleName() + " preProcess use " + (System.currentTimeMillis() - startTime)); startTime = System.currentTimeMillis(); _process(); Log.d("profile", getClass().getSimpleName() + " process use " + (System.currentTimeMillis() - startTime)); startTime = System.currentTimeMillis(); _postProcess(); postProcess(); Log.d("profile", getClass().getSimpleName() + " postProcess use " + (System.currentTimeMillis() - startTime)); } protected void postProcess() { mOutAllocation.copyTo(mBitmapOut); mScript.destroy(); mScript = null; mInAllocation.destroy(); mInAllocation = null; mOutAllocation.destroy(); mOutAllocation = null; mRS.destroy(); mRS = null; System.gc(); } };
ba160648c94f217179bf64317965f937e4fb290e
ce69fb521d6d9809430ce9ef498110dd15b535dc
/app/src/main/java/com/fanqi/wankt/utils/ColorInfo.java
cec29a6b8560aeb940a0fb43a263a101647c1cbd
[ "Apache-2.0" ]
permissive
fanqGithub/wanandroid_kotlin
c8a5775d00e5a3e4b7e267f3d541a179df67ad47
792d2aef62116ef6ec6e5925a7d44fde399105e5
refs/heads/master
2021-07-25T22:31:16.351945
2020-12-25T07:10:25
2020-12-25T07:10:25
231,325,102
2
0
null
null
null
null
UTF-8
Java
false
false
2,145
java
package com.fanqi.wankt.utils; import androidx.annotation.NonNull; /** * 作者:Zhout * 时间:2019/3/12 13:33 * 描述:banner图片颜色渐变Bean * <p> * Vibrant (有活力) * Vibrant dark(有活力 暗色) * Vibrant light(有活力 亮色) * Muted (柔和) * Muted dark(柔和 暗色) * Muted light(柔和 亮色) */ public class ColorInfo { private String imgUrl; private int vibrantColor = 0xFF999999; private int vibrantDarkColor = 0xFF999999; private int vibrantLightColor = 0xFF999999; private int mutedColor = 0xFF999999; private int mutedDarkColor = 0xFF999999; private int mutedLightColor = 0xFF999999; public String getImgUrl() { return imgUrl; } public void setImgUrl(String imgUrl) { this.imgUrl = imgUrl; } public int getVibrantColor() { return vibrantColor; } public void setVibrantColor(int vibrantColor) { this.vibrantColor = vibrantColor; } public int getVibrantDarkColor() { return vibrantDarkColor; } public void setVibrantDarkColor(int vibrantDarkColor) { this.vibrantDarkColor = vibrantDarkColor; } public int getVibrantLightColor() { return vibrantLightColor; } public void setVibrantLightColor(int vibrantLightColor) { this.vibrantLightColor = vibrantLightColor; } public int getMutedColor() { return mutedColor; } public void setMutedColor(int mutedColor) { this.mutedColor = mutedColor; } public int getMutedDarkColor() { return mutedDarkColor; } public void setMutedDarkColor(int mutedDarkColor) { this.mutedDarkColor = mutedDarkColor; } public int getMutedLightColor() { return mutedLightColor; } public void setMutedLightColor(int mutedLightColor) { this.mutedLightColor = mutedLightColor; } @NonNull @Override public String toString() { return "{" + "imgUrl=" + imgUrl + "vibrantColor=" + vibrantColor + "}"; } }
9c3582b6d18b9fbd1e64c3d76ba0b2ee44ca7e62
71615db79dd9304545b0be2e985a7af50dd5d481
/Programming Exercise/Initials.java
63b79a32ba8f22030b425892b28bc3a283428509
[]
no_license
Jay07/CP2406Practical2
c72ed7ba0cf1a4a7c93a661d2f54240dae48a7d6
9c513ed9c078b34019b9a61a2ab9c1c2354ac6e4
refs/heads/master
2020-06-29T07:05:53.412960
2016-11-22T06:32:38
2016-11-22T06:32:38
74,441,992
0
0
null
null
null
null
UTF-8
Java
false
false
613
java
public class Initials{ private String name; public Initials (String n) { name = n; } public String getName() { return name; } public void setName(String n) { this.name = n; } public void displayInitials() { String[] initials = name.split(" "); char first = initials[0].charAt(0); char second = initials[1].charAt(0); char third = initials[2].charAt(0); System.out.println(first + "." + second + "." + third + "."); } }
91784f0ae969910c338bc3c264d87e72346aa1eb
c4275bfe8d9d7e5fa54161a3d503953ea5703695
/Prehistoric/src/com/company/hexgame.java
871bae20f2d24af6a394b81c06127a20874cc2e5
[]
no_license
BjarnyAskoldson/Prehistoric
616f487ccbbad01f21d21b5a97365ffe152a161f
9e24a231fcc7cf1d8e525a0f9b7173ea13a5ace3
refs/heads/master
2022-01-15T21:06:34.244856
2019-06-13T05:33:30
2019-06-13T05:33:30
104,153,119
0
0
null
null
null
null
UTF-8
Java
false
false
7,831
java
package com.company; import com.company.GUI.MainScreen; import com.company.Gameplay.*; import javafx.scene.image.Image; import javafx.stage.Stage; import java.awt.*; import javax.swing.*; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.util.HashSet; /********************************** This is the main class of a Java program to play a game based on hexagonal tiles. The mechanism of handling hexes is in the file hexmech.java. Written by: M.H. Date: December 2012 ***********************************/ public class hexgame { private hexgame() { initGame(); // if (activeSettlement != null) // createAndShowGUI(); } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { new hexgame(); } }); } //constants and global variables final static Color COLOURGRID = Color.BLACK; public final static int BSIZE = 10; //board size. public final static int HEXSIZE = 60; //hex size in pixels final static int BORDERS = 15; final static int SCRSIZE = HEXSIZE * (BSIZE + 1) + BORDERS*3; //screen size (vertical dimension). final static int OPPONENTSNUMBER = 10;//number of AI tribes public final static int SETTLEMENTLOCALWILDGAME = 50;//Wildgame available at settlements' tiles public final static double ResourceRestore = 0.05;//speed of restore for renewable resources public final static double WorkersDeathTool = .05;//basic damage inflicted by working groups public final static double fairTaxLevel = .05;//basic damage inflicted by working groups // static Equipment defaultEquipment = Equipment.StoneBlades; //Percent of newborns public final static double BIRTHRATE = 0.05; //Percent of starvation per unsatisfied vital need public final static double STARVATIONRATE = 0.10; //employment rate that cause people to abandon profession public final static double unemploymentRate = 0.7; public static Image settlementImage = null; public static Image playerSettlementImage = null; public static Image playerCampImage = null; public static Image hunterImage = null; public static Image campImage = null; public static Image battleImage = null; public static Image armyImage = null; public static Image playerArmyImage = null; public static BufferedWriter logFile = null; public static HashSet<Message> messageQueue = new HashSet<>(); // public static Hex[][] board = new Hex[BSIZE][BSIZE]; private static Tribe player; public static HexMap map = new HexMap(/*new Mediator()*/); public static MainScreen mainScreen; public static Stage mainStage; // public static Settlement activeSettlement = null; public static Object activeObject; private static HashSet <Settlement> settlements = new HashSet<>(); public static HashSet<Tribe> tribes = new HashSet<>(); public static HashSet<Settlement> getSettlements (){ return settlements; } private static int turn; public static int getTurnNumber() { return turn; } private static long currentDay = 0; // public static MapScreen mapScreen = new MapScreen(); public static void processArmies() { for (Tribe tbibe : tribes) for (Settlement settlement: tbibe.getSettlements()) for (Army army: settlement.getArmies()) army.processDay(); } public static void processHexes() { for (int x = 0; x<BSIZE; x++) for (int y = 0; y<BSIZE; y++) { HexMap.getBoard()[x][y].processDay(); // Hex location = board[x][y]; // if (location.getWorkingGroups().size()>1) { // long tribesOnHex = location.getWorkingGroups().stream().map(WorkingGroup::getHomeBase).map(Settlement::getOwner).distinct().count(); // HashSet<WorkingGroup> groupsOnLocation = new HashSet<>(location.getWorkingGroups()); // for (WorkingGroup wg : groupsOnLocation) // if (wg.isAggressive()&&tribesOnHex>1) // location.battle(); // break; // } } } public static void depleteRenewableResources() { for (int x = 0; x < BSIZE; x++) for (int y = 0; y < BSIZE; y++) { Hex location = HexMap.getBoard()[x][y]; if (location.getWorkingGroupsCamps().size() > 1) location.depleteRenewableResources(); } } public static HashSet<Tribe> getTribes() { return tribes; } private static Timer mainTimer = new Timer(); public static void stopGame() { mainTimer.interrupt(); } public static Timer getMainTimer() { return mainTimer; } public static Tribe getPlayer() { Tribe player = hexgame.tribes.stream().filter(a->a.isHuman()).findFirst().get(); return player; } public static long getCurrentDay() { return currentDay; } public static void incCurrentDay() { currentDay++; } /** * Method to populate the map before the game starts, - generates terrain and place settlements */ public static void initGame(){ tribes.add(new Tribe("Mighty Donuts", "Donutwille", true)); //activeSettlement = hexgame.getTribes().stream().filter(a->a.isHuman()).map(a->a.getSettlements().get(0)).findFirst().get(); activeObject = hexgame.getTribes().stream().filter(a->a.isHuman()).map(a->a.getSettlements().get(0)).findFirst().get(); try { // settlementImage = ImageIO.read(new File("C:\\Users\\Alex Miliukov\\IdeaProjects\\Prehistoric\\src\\Settlement.png")); // hunterImage = ImageIO.read(new File("C:\\Users\\Alex Miliukov\\IdeaProjects\\Prehistoric\\src\\hunter.png")); settlementImage = new Image("file:C:\\Users\\Alex Miliukov\\Documents\\IdeaProjects\\Prehistoric\\src\\com\\company\\Images\\simpleSettlement.png"); playerSettlementImage = new Image("file:C:\\Users\\Alex Miliukov\\Documents\\IdeaProjects\\Prehistoric\\src\\com\\company\\Images\\simplePlayerSettlement.png"); armyImage = new Image("file:C:\\Users\\Alex Miliukov\\Documents\\IdeaProjects\\Prehistoric\\src\\com\\company\\Images\\simpleArmy.png"); playerArmyImage = new Image("file:C:\\Users\\Alex Miliukov\\Documents\\IdeaProjects\\Prehistoric\\src\\com\\company\\Images\\simplePlayerArmy.png"); playerCampImage = new Image("file:C:\\Users\\Alex Miliukov\\Documents\\IdeaProjects\\Prehistoric\\src\\com\\company\\Images\\simplePlayerCamp.png"); hunterImage = new Image("file:C:\\Users\\Alex Miliukov\\Documents\\IdeaProjects\\Prehistoric\\src\\com\\company\\Images\\simpleHunter.png"); campImage = new Image("file:C:\\Users\\Alex Miliukov\\Documents\\IdeaProjects\\Prehistoric\\src\\com\\company\\Images\\simpleCamp.png"); battleImage = new Image("file:C:\\Users\\Alex Miliukov\\Documents\\IdeaProjects\\Prehistoric\\src\\com\\company\\Images\\simpleBattle.png"); logFile = new BufferedWriter(new FileWriter("C:\\Users\\Alex Miliukov\\Documents\\IdeaProjects\\Prehistoric\\out\\log.txt")); } catch (IOException e){} mainTimer.start(); //now create computer players for (int i = 1; i<=OPPONENTSNUMBER; i++) tribes.add (new Tribe("Player "+i,"Capital "+i,false)); } }
[ "Alex [email protected]" ]
261966cbedf6d62e6b269479eabc99ca73200fe6
6266d6037fbfbd5fe2c8536baf32a8b33597edbd
/src/main/java/kaist/adward/wikimr/job/PageRankCalculationJob.java
e177b272c7a41f18263bc9da1b5fb8f8b7245e4b
[]
no_license
hsyhsw/PageRank
695fbf409dd3544526ee258633f171042e97b0e4
ec484407efe52c29679b665a680c5706aeef2bac
refs/heads/master
2020-04-06T04:30:42.962353
2014-05-21T14:21:44
2014-05-21T14:21:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,487
java
package kaist.adward.wikimr.job; import kaist.adward.wikimr.mapper.PageRankIterationMapper; import kaist.adward.wikimr.reducer.PageRankIterationReducer; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import java.io.IOException; public class PageRankCalculationJob { /** * Represents a single iteration of PageRank calculation. * Typically 20 iterations are enough to stabilize PageRank output. * * @param inputPath Input file path which is from the previous iteration of pagerank * @param outputPath Input file path which is from the current iteration of pagerank * @throws java.io.IOException */ public void calculatePageRank(String inputPath, String outputPath) throws IOException, ClassNotFoundException, InterruptedException { Job job = Job.getInstance(new Configuration(), "Calculate PageRank"); FileInputFormat.setInputPaths(job, new Path(inputPath)); FileOutputFormat.setOutputPath(job, new Path(outputPath)); job.setMapperClass(PageRankIterationMapper.class); job.setReducerClass(PageRankIterationReducer.class); job.setOutputKeyClass(IntWritable.class); job.setOutputValueClass(Text.class); job.setJarByClass(PageRank.class); job.waitForCompletion(true); } }
f019207dd60f9526caf895ffecf2edbc0482127f
17e8438486cb3e3073966ca2c14956d3ba9209ea
/dso/tags/3.5.2_2/code/base/dso-l2/src/com/tc/statistics/retrieval/actions/SRADistributedGC.java
e4382a35c8f007f7b56a6c201dedc988ce86cae6
[]
no_license
sirinath/Terracotta
fedfc2c4f0f06c990f94b8b6c3b9c93293334345
00a7662b9cf530dfdb43f2dd821fa559e998c892
refs/heads/master
2021-01-23T05:41:52.414211
2015-07-02T15:21:54
2015-07-02T15:21:54
38,613,711
1
0
null
null
null
null
UTF-8
Java
false
false
2,946
java
/* * All content copyright (c) 2003-2008 Terracotta, Inc., except as may otherwise be noted in a separate copyright * notice. All rights reserved. */ package com.tc.statistics.retrieval.actions; import com.tc.logging.TCLogger; import com.tc.logging.TCLogging; import com.tc.objectserver.dgc.impl.GCStatisticsAgentSubSystemEventListener; import com.tc.statistics.StatisticData; import com.tc.statistics.StatisticRetrievalAction; import com.tc.statistics.StatisticType; /** * This statistics represents statistics for the Distributed garbage collector. <p/> This statistic contains * {@link StatisticData} with the following elements: * <ul> * <li>iteration</li> * <li>type</li> * <li>start time</li> * <li>elapsed time</li> * <li>begin object count</li> * <li>candidate garbage count</li> * <li>actual garbage count</li> * <li>pause time</li> * <li>delete time</li> * </ul> * <p/> This statistic action should not be used to retrieve the Distributed garbage collector statistic. The actual * collection of the distributed garbage collector statistics is done in individual garbage collectors like * {@link com.tc.objectserver.dgc.impl.MarkAndSweepGarbageCollector} and the statistics are injected into the statistics * sub-system. */ public class SRADistributedGC implements StatisticRetrievalAction { public final static TCLogger LOGGER = TCLogging.getLogger(StatisticRetrievalAction.class); public static final String ACTION_NAME = GCStatisticsAgentSubSystemEventListener.DISTRIBUTED_GC_STATISTICS; public static final String ITERATION_ELEMENT = "iteration"; public static final String TYPE_ELEMENT = "type"; public static final String START_TIME_ELEMENT = "start time"; public static final String ELAPSED_TIME_ELEMENT = "elapsed time"; public static final String BEGIN_OBJECT_COUNT_ELEMENT = "begin object count"; public static final String CANDIDATE_OBJECT_COUNT_ELEMENT = "candidate garbage count"; public static final String ACTUAL_GARBAGE_COUNT_ELEMENT = "actual garbage count"; public static final String PAUSE_TIME_ELEMENT = "pause time"; public static final String MARK_TIME_ELEMENT = "mark time"; public static final String DELETE_TIME_ELEMENT = "delete time"; public static final String TYPE_FULL = "Full"; public static final String TYPE_YOUNG_GEN = "YoungGen"; public StatisticData[] retrieveStatisticData() { LOGGER.warn("Data for statistic '" + ACTION_NAME + " can't be retrieved using the action instance. " + "It will be collected automatically when triggered by the system."); return EMPTY_STATISTIC_DATA; } public String getName() { return ACTION_NAME; } public StatisticType getType() { return StatisticType.TRIGGERED; } }
[ "hhuynh@7fc7bbf3-cf45-46d4-be06-341739edd864" ]
hhuynh@7fc7bbf3-cf45-46d4-be06-341739edd864
59d95c1af1549ca68f4ad402969b2f2b1cc358b2
dd9b37b077cb6bdfcbe5d2d3bcd7b7068c8a076b
/Aurora/src/cn/infogiga/util/HibernateUtil.java
b5df0ed7bf46fc5caeae554b9b8524d4df292ccf
[]
no_license
lancexin/infogiga
91ee4b2805e91ddae897e6fda10eead033e7ff31
5e67173c9b107779a2c1a4ffe7d8d6f78e1c7bcc
refs/heads/master
2021-01-10T08:04:17.290395
2011-03-28T02:17:05
2011-03-28T02:17:05
49,560,996
0
0
null
null
null
null
UTF-8
Java
false
false
389
java
package cn.infogiga.util; import org.hibernate.Session; import org.hibernate.SessionFactory; public class HibernateUtil { private static SessionFactory sessionFactory; public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } public static Session getCurrentSession() { return sessionFactory.openSession(); } }
[ "lance.hz@3c4fb456-26bf-fce3-d946-147801ec67f8" ]
lance.hz@3c4fb456-26bf-fce3-d946-147801ec67f8
039336953106582d7d76f27d1986669649993c0a
1ddc7688baaf609b7dc1595d18f0cb2fa5ee768b
/src/main/java/flinkbase/model/ActiveModel.java
4d81609ae5ef0dffbe9afc388417f752809a488d
[]
no_license
a524631266/flinkdemo
0b7e3932af8ac027071802255404451e69382265
2236b6f30866d7e780fb87e62d10cca1ba3e1ca2
refs/heads/master
2023-01-30T14:28:14.488377
2020-12-16T08:35:23
2020-12-16T08:35:23
290,516,785
0
0
null
null
null
null
UTF-8
Java
false
false
579
java
package flinkbase.model; import com.zhangll.jmock.core.annotation.BasicTokenInfo; import lombok.Data; import lombok.ToString; import java.sql.Timestamp; @Data @ToString public class ActiveModel { @BasicTokenInfo(value = {"/u00[0-9]/"}) private String userId; @BasicTokenInfo(value = {"/A[0-9]/"}) private String activeId; @BasicTokenInfo(min = "2019-09-02 10:00:00", max = "2019-09-02 20:00:00", step = "60") private Timestamp activeTime; private EventEnum eventEnum; @BasicTokenInfo(value = {"北京", "上海"}) private String province; }
d8a902afa33c211ffad1dbded18962eaf3fd37e9
11f55dfb598bbca21526da16db19913fb0db188d
/src/com/younes/model/Product.java
10f2e6a27a1c0f402010c71258ba31e9e658ef64
[]
no_license
younis05/MarketIchemoul
80bd9aeca0a8b649fea9cbf6a3697aa43c922afb
8ce5bf93ed8fdaa7b680f1a15d06a0474b34b4cc
refs/heads/main
2023-01-30T16:22:43.381014
2020-12-15T13:01:44
2020-12-15T13:01:44
321,628,552
0
0
null
null
null
null
UTF-8
Java
false
false
271
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.younes.model; /** * * @author BOUKHTACHE */ public class Product { }
8830c5689edf3ffcef00dcb008442edb0cf08736
7b97f92837b0b02345cb57bbd09b640c3c2acf6c
/javastudy/src/webServer/GetHTML.java
5471739a04b2e2a9f2c07da65b9332e16f4c005f
[]
no_license
SaDaa-Dev/JWorkspace
a3767c87089a3223d80d5557c55d7d933d7d48e9
6fd69f09c6d321d2c22d74b45b2f56f9a9ffa659
refs/heads/master
2023-01-18T17:59:15.493359
2020-11-28T09:01:48
2020-11-28T09:01:48
314,779,080
0
0
null
null
null
null
UTF-8
Java
false
false
817
java
package webServer; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; public class GetHTML { public static void main(String[] args) { try { URL url = new URL("https://www.gachon.ac.kr/introduce/chairman/01.jsp"); System.out.println("프로토콜: " + url.getProtocol()); System.out.println("호스트: " + url.getHost()); System.out.println("포트 : "+ url.getPort()); System.out.println(">> HTML 시작"); InputStream is = url.openStream(); BufferedReader br = new BufferedReader(new InputStreamReader(is)); String msg; while((msg = br.readLine()) != null) { System.out.println(msg); } br.close(); is.close(); }catch(Exception e) { e.printStackTrace(); } } }
168930cef837321679181e2b3070e67e10325f6d
3e5242e36af02a904f8d63b109c4a737b12990ae
/tests/LineTest.java
d984cff01f6716c3d5a1e09f0ddd3c78923ca261
[]
no_license
DBall8/TriangleGame2.0
71ae71403372e6baf16439056726b5815bb510c8
3637118d39b231a3e1f03309cfe1e58f0f48fa68
refs/heads/master
2020-03-25T00:43:40.724424
2018-08-13T23:47:34
2018-08-13T23:47:34
143,202,495
0
0
null
null
null
null
UTF-8
Java
false
false
1,811
java
import physics.Bounds; import physics.Line; import org.junit.Test; import static org.junit.Assert.assertEquals; public class LineTest { @Test public void lineIntersectTest(){ Line l1 = new Line(0, 0, 20, 0); Line l2 = new Line(10, 10, 10, -10); assertEquals(true, l1.intersects(l2)); assertEquals(true, l2.intersects(l1)); l1 = new Line(0, 0, 20, 20); l2 = new Line(0, 20, 20, 0); assertEquals(true, l1.intersects(l2)); assertEquals(true, l2.intersects(l1)); l1 = new Line(0, 0, 20, 20); l2 = new Line(0, 0, 20, 20); assertEquals(true, l1.intersects(l2)); assertEquals(true, l2.intersects(l1)); l1 = new Line(0, 0, 20, 20); l2 = new Line(20, 20, 20, 20); assertEquals(true, l1.intersects(l2)); assertEquals(true, l2.intersects(l1)); l1 = new Line(0, 0, 20, 20); l2 = new Line(20, 20, 40, 40); assertEquals(true, l1.intersects(l2)); assertEquals(true, l2.intersects(l1)); l1 = new Line(10, 10, 20, 20); l2 = new Line(0, 0, 40, 40); assertEquals(true, l1.intersects(l2)); assertEquals(true, l2.intersects(l1)); l1 = new Line(0, 0, 20, 20); l2 = new Line(30, 30, 40, 40); assertEquals(false, l1.intersects(l2)); assertEquals(false, l2.intersects(l1)); l1 = new Line(0, 0, 20, 20); l2 = new Line(10, 11, 0, 40); assertEquals(false, l1.intersects(l2)); assertEquals(false, l2.intersects(l1)); } @Test public void boundsTest(){ Bounds b1 = new Bounds(10, 10, 10, 10); Bounds b2 = new Bounds(10, 10, 20, 20); assertEquals(b1.intersects(b2), true); assertEquals(b2.intersects(b1), true); } }
09a723e9f0b1ab81961f2d0387c398a2b3da5b9b
3651587a213ade07595b849cd5fd7db915fc730a
/PcapReader/src/his/pcap/reader/http/HttpPacket.java
f0624b7828dfafe1f0e5eda803c825949b093731
[]
no_license
alabbas-ali/Network-Protocols-Similarity
c9e9dcfb4270be4adfd009b5d6db268008395831
c8c1d637f6ca6b29fb9f23929039ae9143ff0758
refs/heads/master
2020-03-26T09:37:05.463516
2018-08-20T10:02:44
2018-08-20T10:02:44
144,755,322
1
0
null
null
null
null
UTF-8
Java
false
false
401
java
package his.pcap.reader.http; import java.io.IOException; import io.pkts.packet.impl.ApplicationPacket; public interface HttpPacket extends ApplicationPacket { public HttpHeaders getHeaders(); public byte[] getHttpPayload(); boolean isCompressed(); byte[] contentdecoding() throws IOException; public int getContentLength(); public int getPayloadLength(); public String toString(); }
da0c69a47b361aca566c87149c1d3978a0006297
511c0fdb941bde8072846ca880b6320f8b79d1fc
/OrganizationalForum2016Repo/OrganizationalForum/src/main/java/com/tatvasoft/service/SearchServiceImpl.java
908ae940fa59d629212bb87f43cd17ced09ed967
[]
no_license
cyberstormdotmu/seconds
a93089f79f7995a883e1c755817801fe63d0f0ac
fe332ed0ef33197e76e42b38465141b96960109f
refs/heads/master
2020-04-01T07:35:11.577920
2018-08-08T13:45:49
2018-08-08T13:45:49
152,995,126
0
0
null
2018-10-14T16:33:30
2018-10-14T16:33:30
null
UTF-8
Java
false
false
988
java
package com.tatvasoft.service; import java.util.List; import javax.transaction.Transactional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.tatvasoft.dao.PostDao; import com.tatvasoft.dao.ReplyDao; import com.tatvasoft.dao.SearchDao; import com.tatvasoft.dao.UserDao; import com.tatvasoft.entity.PostEntity; /** * @author TatvaSoft * This interface provide Post search Service methods Implementation. */ @Service @Transactional public class SearchServiceImpl implements SearchService { @Autowired PostDao postDao; @Autowired UserDao userHibernateDao; @Autowired ReplyDao replyDao; @Autowired SearchDao searchdao; /* * All implemented methods of SearchService Interface */ public List<PostEntity> searchPostByCriteria(String keyword, long category_id, String createDate, int sortlimit) { return searchdao.searchPostByCriteria(keyword, category_id, createDate, sortlimit); } }
a6f1cbd20b01808135a01804ab95508d89b517b1
ae6a25d119186cafbeb39a987a02e501dcf830b5
/src/WordNetDet.java
8ef15ff03391a288e3620a732ed492d8611dd2a7
[]
no_license
mugdhachaudhari/PlagiarismDetection
8744845ac2f95ddd422d93a0e6d9ff801e2acfc7
820e35d799795663b7d6e6a278ad32a2aa0832d6
refs/heads/master
2021-01-11T15:56:04.576099
2017-01-24T22:25:15
2017-01-24T22:25:15
79,960,487
0
0
null
null
null
null
UTF-8
Java
false
false
3,882
java
import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.FilenameFilter; import java.io.IOException; import java.io.ObjectInputStream.GetField; import java.net.MalformedURLException; import java.net.URL; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import edu.mit.jwi.Dictionary; import edu.mit.jwi.IDictionary; import edu.mit.jwi.item.IIndexWord; import edu.mit.jwi.item.ISynsetID; import edu.mit.jwi.item.IWord; import edu.mit.jwi.item.IWordID; import edu.mit.jwi.item.POS; import edu.mit.jwi.morph.IStemmer; public class WordNetDet { private String wnhome = "C:\\Program Files (x86)\\WordNet\\2.1"; private Map<String, Integer> POSIdentifier = new HashMap<String, Integer>(); private IDictionary dict; public WordNetDet(String POSFileName) { // construct the URL to the Wordnet dictionary directory String path = wnhome + java.io.File.separator + "dict"; URL url = null; try{ url = new URL("file", null, path); } catch(MalformedURLException e){ e.printStackTrace(); } if(url == null) return; // construct the dictionary object and open it dict = new Dictionary(url); try { dict.open(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } BufferedReader br = null; String line = null; try { br = new BufferedReader(new FileReader(POSFileName)); while ((line = br.readLine()) != null) { String[] lineDet = line.split(","); POSIdentifier.put(lineDet[0], Integer.parseInt(lineDet[2])); } } catch (NumberFormatException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { try { br.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } public Map<String, Character> getSynset(String term, String pos) { Map<String, Character> synsetList = new HashMap<String, Character>(); IIndexWord idxWord = null; int posNr = POSIdentifier.getOrDefault(pos, 9); switch(posNr) { case 0 : idxWord = dict.getIndexWord(term, POS.ADJECTIVE); break; case 1 : idxWord = dict.getIndexWord(term, POS.ADVERB); break; case 2 : break; case 3 : break; case 4 : idxWord = dict.getIndexWord(term, POS.ADJECTIVE); break; case 5 : idxWord = dict.getIndexWord(term, POS.NOUN); break; case 6 : break; case 7 : break; case 8 : idxWord = dict.getIndexWord(term, POS.VERB); break; default : break; } if (idxWord != null) { // int i = 0; for (IWordID wordID : idxWord.getWordIDs()) { // synsetList.put(wordID.getSynsetID().toString(), 'a'); IWord word = dict.getWord(wordID); for (IWord w : word.getSynset().getWords()) { synsetList.put(w.getLemma(), 'a'); } // System.out.println("Id = " + wordID); // System.out.println("Lemma = " + word.getLemma()); // System.out.println("Synset = " + word.getSynset()); // System.out.println("-----------------------"); // i++; // if (i == 4) { // break; // } } } return synsetList; } public static void main(String[] args) { // TODO Auto-generated method stub WordNetDet wd = new WordNetDet(GenerateTextFromFile.returnPath("POS.csv")); // wd.getSynset("fail", "VBG"); // System.out.println(wd.getSynset("allow", "VBG").toString()); System.out.println("\n##########################\nDetails for word -- defeat\n##########################\n"); System.out.println(wd.getSynset("defeat", "VBG").toString()); System.out.println("\n##########################\nDetails for word -- fail\n##########################\n"); System.out.println(wd.getSynset("fail", "VBG").toString()); } }
6464d4406c2888a2bd9626b58465a52d551db60d
2e637c146f23a46896cfb37ca17de60f2553478b
/src/main/java/com/aylien/textapi/parameters/UnsupervisedClassifyParams.java
52d114d9e99c220d724cda86b0ee017297f1e1ad
[ "Apache-2.0" ]
permissive
manolismaragoudakis/aylien_textapi_java
978c1ba93193bd049260cd31344a0428dbdc6687
2ff7c116c424562c80a5474460cd0c90bd8310e6
refs/heads/master
2020-12-07T13:41:47.153809
2015-03-16T12:56:10
2015-03-16T12:56:10
37,009,680
1
0
null
2015-06-07T08:31:21
2015-06-07T08:31:21
null
UTF-8
Java
false
false
3,229
java
/** * Copyright 2015 Aylien, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aylien.textapi.parameters; import java.net.URL; public class UnsupervisedClassifyParams { private String text; private URL url; private String[] classes; private int numberOfConcepts; /** * Constructs parameters that define a document whose needs to be classified. * * @param text Text to classify * This argument may be null, in which case url can not * be null * @param url URL to classify * This argument may be null, in which case text can not * be null * @param classes List of classes to classify into * @param numberOfConcepts Number of concepts used to measure the semantic * similarity between two words. */ public UnsupervisedClassifyParams(String text, URL url, String[] classes, int numberOfConcepts) { this.text = text; this.url = url; this.classes = classes; this.numberOfConcepts = numberOfConcepts; } public String getText() { return text; } public void setText(String text) { this.text = text; } public URL getUrl() { return url; } public void setUrl(URL url) { this.url = url; } public String[] getClasses() { return classes; } public void setClasses(String[] classes) { this.classes = classes; } public int getNumberOfConcepts() { return numberOfConcepts; } public void setNumberOfConcepts(int numberOfConcepts) { this.numberOfConcepts = numberOfConcepts; } public static Builder newBuilder() { return new Builder(); } /** * Builder class to construct a UnsupervisedClassifyParams instance. */ public static class Builder { private String text; private URL url; private String[] classes; private int numberOfConcepts; public Builder setText(String text) { this.text = text; return this; } public Builder setUrl(URL url) { this.url = url; return this; } public Builder setClasses(String[] classes) { this.classes = classes; return this; } public Builder setNumberOfConcepts(int numberOfConcepts) { this.numberOfConcepts = numberOfConcepts; return this; } public UnsupervisedClassifyParams build() { return new UnsupervisedClassifyParams(text, url, classes, numberOfConcepts); } } }
a6cf259769ef8cd71b224b318da1c8e47fdb9e50
ee3483d176c8b64d60850691ac795f1116ab033c
/src/main/java/com/xeno/goo/interactions/Floral.java
4be2e0bc6cba95d13372452c9440749090f147b8
[ "MIT" ]
permissive
skyboy/Goo
cf871ea25e923051932bafc794e76429172964b1
9b66c151d7fcab2b1a16dbd64b268919f0d5699e
refs/heads/master
2023-06-02T11:07:12.236685
2021-03-29T18:29:00
2021-03-29T18:29:00
352,744,462
0
0
MIT
2021-03-29T18:39:24
2021-03-29T18:25:30
Java
UTF-8
Java
false
false
8,818
java
package com.xeno.goo.interactions; import com.xeno.goo.entities.GooBlob; import com.xeno.goo.setup.Registry; import net.minecraft.block.*; import net.minecraft.fluid.Fluids; import net.minecraft.item.BoneMealItem; import net.minecraft.state.BooleanProperty; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.Direction; import net.minecraft.util.Tuple; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.world.server.ServerWorld; import java.util.ArrayList; import java.util.List; public class Floral { public static void registerInteractions() { // splat interactions GooInteractions.registerSplat(Registry.FLORAL_GOO.get(), "grow_grass", Floral::growGrass); GooInteractions.registerSplat(Registry.FLORAL_GOO.get(), "grow_moss", Floral::growMoss); GooInteractions.registerSplat(Registry.FLORAL_GOO.get(), "grow_lilypad", Floral::growLilypad); GooInteractions.registerSplat(Registry.FLORAL_GOO.get(), "grow_bark", Floral::growBark); GooInteractions.registerSplat(Registry.FLORAL_GOO.get(), "flourish", Floral::flourish); GooInteractions.registerPassThroughPredicate(Registry.FLORAL_GOO.get(), Floral::blobPassThroughPredicate); // blob interactions GooInteractions.registerBlob(Registry.FLORAL_GOO.get(), "trigger_growable", Floral::growableTick); GooInteractions.registerBlob(Registry.FLORAL_GOO.get(), "grow_vines", Floral::growVines); } private static boolean growVines(BlobContext blobContext) { if (blobContext.block() instanceof LeavesBlock) { for (Direction face : Direction.values()) { Direction d = face.getOpposite(); if (d == Direction.DOWN) { continue; } doEffects(blobContext); if (blobContext.world() instanceof ServerWorld) { BooleanProperty prop = vinePlacementPropertyFromDirection(d); BlockPos offset = blobContext.blockPos().offset(face); BlockState state; if (blobContext.world().getBlockState(offset).isAir(blobContext.world(), offset)) { state = Blocks.VINE.getDefaultState().with(prop, true); } else { if (blobContext.world().getBlockState(offset).getBlock() instanceof VineBlock) { state = blobContext.world().getBlockState(offset); if (state.get(prop)) { continue; } else { state = state.with(prop, true); } } else { continue; } } blobContext.world().setBlockState(offset, state); return true; } } } return false; } private static net.minecraft.state.BooleanProperty vinePlacementPropertyFromDirection(Direction d) { switch (d) { case UP: return VineBlock.UP; case EAST: return VineBlock.EAST; case WEST: return VineBlock.WEST; case NORTH: return VineBlock.NORTH; case SOUTH: return VineBlock.SOUTH; } return VineBlock.UP; } private static boolean growableTick(BlobContext blobContext) { if (blobContext.block() instanceof IGrowable) { if (blobContext.block() instanceof MushroomBlock) { return false; } if (blobContext.world() instanceof ServerWorld) { ((IGrowable) blobContext.block()).grow((ServerWorld) blobContext.world(), blobContext.world().rand, blobContext.blockPos(), blobContext.blockState()); } doEffects(blobContext); return true; } return false; } private static boolean flourish(SplatContext context) { if (context.block() instanceof GrassBlock) { if (context.world() instanceof ServerWorld) { ((GrassBlock) context.block()).grow((ServerWorld)context.world(), context.world().rand, context.blockPos(), context.blockState()); } doEffects(context); return true; } return false; } private static boolean growLilypad(SplatContext context) { // spawn lilypad if (context.fluidState().getFluid().isEquivalentTo(Fluids.WATER)) { if (!context.isRemote()) { if (context.fluidState().isSource() && context.isBlockAboveAir()) { context.setBlockStateAbove(Blocks.LILY_PAD.getDefaultState()); } } doEffects(context); return true; } return false; } private static boolean exchangeBlock(SplatContext context, Block target, Block... sources) { // do conversion for(Block source : sources) { if (context.block().equals(source)) { if (!context.isRemote()) { context.setBlockState(target.getDefaultState()); } // spawn particles and stuff doEffects(context); return true; } } return false; } private static void doEffects(SplatContext context) { BoneMealItem.spawnBonemealParticles(context.world(), context.blockPos(), 4); } private static void doEffects(BlobContext context) { BoneMealItem.spawnBonemealParticles(context.world(), context.blockPos(), 4); } private static boolean growMoss(SplatContext context) { return exchangeBlock(context, Blocks.MOSSY_COBBLESTONE, Blocks.COBBLESTONE) || exchangeBlock(context, Blocks.MOSSY_STONE_BRICKS, Blocks.STONE_BRICKS); } private static boolean growGrass(SplatContext context) { return exchangeBlock(context, Blocks.GRASS_BLOCK, Blocks.DIRT); } private static Boolean blobPassThroughPredicate(BlockRayTraceResult blockRayTraceResult, GooBlob gooBlob) { BlockState state = gooBlob.getEntityWorld().getBlockState(blockRayTraceResult.getPos()); if (state.getBlock().hasTileEntity(state)) { return false; } return state.getBlock() instanceof LeavesBlock || (state.getBlock() instanceof IGrowable && !(state.getBlock() instanceof GrassBlock)); } // similar to exchange block but respect the state of the original log private static boolean exchangeLog(SplatContext context, Block source, Block target) { if (context.block().equals(source)) { Direction.Axis preservedAxis = context.blockState().get(BlockStateProperties.AXIS); if (!context.isRemote()) { context.setBlockState(target.getDefaultState().with(BlockStateProperties.AXIS, preservedAxis)); } // spawn particles and stuff doEffects(context); return true; } return false; } public static final List<Tuple<Block, Block>> logBarkPairs = new ArrayList<>(); public static void registerLogBarkPair(Block source, Block target) { logBarkPairs.add(new Tuple<>(source, target)); } static { registerLogBarkPair(Blocks.ACACIA_LOG, Blocks.STRIPPED_ACACIA_LOG); registerLogBarkPair(Blocks.ACACIA_WOOD, Blocks.STRIPPED_ACACIA_WOOD); registerLogBarkPair(Blocks.BIRCH_LOG, Blocks.STRIPPED_BIRCH_LOG); registerLogBarkPair(Blocks.BIRCH_WOOD, Blocks.STRIPPED_BIRCH_WOOD); registerLogBarkPair(Blocks.DARK_OAK_LOG, Blocks.STRIPPED_DARK_OAK_LOG); registerLogBarkPair(Blocks.DARK_OAK_WOOD, Blocks.STRIPPED_DARK_OAK_WOOD); registerLogBarkPair(Blocks.JUNGLE_LOG, Blocks.STRIPPED_JUNGLE_LOG); registerLogBarkPair(Blocks.JUNGLE_WOOD, Blocks.STRIPPED_JUNGLE_WOOD); registerLogBarkPair(Blocks.OAK_LOG, Blocks.STRIPPED_OAK_LOG); registerLogBarkPair(Blocks.OAK_WOOD, Blocks.STRIPPED_OAK_WOOD); registerLogBarkPair(Blocks.SPRUCE_LOG, Blocks.STRIPPED_SPRUCE_LOG); registerLogBarkPair(Blocks.SPRUCE_WOOD, Blocks.STRIPPED_SPRUCE_WOOD); } private static boolean growBark(SplatContext context) { for(Tuple<Block, Block> blockPair : Floral.logBarkPairs) { if (exchangeLog(context, blockPair.getB(), blockPair.getA())) { return true; } } return false; } }
46c979a141ffbaf53969db5a45d9f667a0cd8db8
4a40a393fc0b659479235ebafa4498bf5bfe55af
/src/main/java/kthFromTheEnd/LinkedList.java
03796181f74e5ef425b26c7dc894d4e6cf0f41cc
[]
no_license
Ahmed199764/data-structures-and-algorithms-java
64747092e5c0e94a1c462133cc0a74b11861a0ab
9c2b1c334e96788234ddcf93935f1d95efdeabc9
refs/heads/master
2022-01-21T23:53:24.060713
2019-07-18T21:32:07
2019-07-18T21:32:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,264
java
package kthFromTheEnd; import java.util.ArrayList; import java.util.List; /** * The LinkedList class */ public class LinkedList { public Node head; public LinkedList(){ } /** * This method takes a number, k, as a parameter. Return the node’s value that is k * from the LL. * * * @param kth the value length of list * @return Returns a node of the value from the end of the linked list */ public int kthFromTheEnd(int kth){ int lengthOfList = 0; Node current = head; while(current.next != null){ lengthOfList += 1; current = current.next; } if(kth > lengthOfList){ throw new IllegalArgumentException("The kth value is greater than the length of the linked list"); } int frontIndex = lengthOfList - kth; current = head; while(frontIndex != 0){ current = current.next; frontIndex -= 1; } return current.data; } public int kthFromTheEnd2(int kth){ Node forward = this.head; Node back = this.head; for(int i =0 ; forward != null; i++){ forward = forward.next; if(i >= kth){ back = back.next; } } return back.data; } /** * This method takes in no arguments and returns a collection all of the current Node values in the Linked List * * @return Node */ public List<Node> print(){ List<Node> newList = new ArrayList<>(); Node current = head; while(current != null){ newList.add(current); current = current.next; } return newList; } /** * Adds a new node with the given value to the end of the list * * @param value the data */ public void append(int value) throws AssertionError{ if(head == null){ insert(value); } else{ Node current = head; while (current.next != null) { current = current.next; } Node newNode = new Node(value); current.next = newNode; } } /** * * Adds a new node with the given newValue immediately before the first value node * * @param value * @param newVal */ public void insertBefore(int value, int newVal) throws NullPointerException{ if(head.data == value ){ head = new Node(newVal); } else{ Node current = head; while(current.next.data != value){ current = current.next; } Node newNode = new Node(newVal); newNode.next = current.next; current.next = newNode; } } /** * Adds a new node with the given newValue immediately after the first value node * * @param value * @param newValue */ public void insertAfter(int value, int newValue) throws NullPointerException{ Node current = head; while(current.data != value){ current = current.next; } Node newNode = new Node(newValue); newNode.next = current.next; current.next = newNode; if(current.next == null){ current = new Node(newValue); } } /** * This method inserts which takes any value as an argument and adds a new node with that value to the head of the * list with an O(1) Time performance. * * @param value */ public void insert(int value){ Node newNode = new Node(value); newNode.next = head; head = newNode; } /** * * This method called includes which takes any value as an argument and returns a boolean result depending on * whether that value exists as a Node’s value somewhere within the list. * * @param value * @return boolean */ public boolean includes(int value){ Node current = head; while(current != null){ if(current.data == value){ return true; } current = current.next; } return false; } }
1c9608ac1a6c2735bfefb6c5c4d5873bc1cef6ec
1a7c404aa6f6250bcaeb7dcce9e1ef630599fe15
/ForestBlog/src/main/java/com/liuyanzhao/blog/controller/Home/PageController.java
ca89dc8ef5ae684548236f2dfbbfed7ad9ac1a88
[]
no_license
0ne0neZero/helloboy
33f18d5db8ab226a8c0337fdbc848dc4c1cddf0f
4b2463e3d31fbfe1c8391504b0ec333005e07dbd
refs/heads/master
2020-03-28T13:39:34.774896
2018-09-12T06:55:34
2018-09-12T06:55:34
148,415,190
6
0
null
null
null
null
UTF-8
Java
false
false
3,006
java
package com.liuyanzhao.blog.controller.Home; import com.liuyanzhao.blog.entity.custom.*; import com.liuyanzhao.blog.service.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import java.util.List; /** * Created by 言曌 on 2017/9/7. */ @Controller public class PageController { @Autowired private PageService pageService; @Autowired private ArticleService articleService; @Autowired private CategoryService categoryService; @Autowired private TagService tagService; @ModelAttribute public void init(Model model) throws Exception { } //页面显示 @RequestMapping(value = "/{key}") public ModelAndView ArticleDetailView(@PathVariable("key") String key) throws Exception{ ModelAndView modelAndView = new ModelAndView(); PageCustom pageCustom = pageService.getPageByKey(1,key); if(pageCustom!=null) { modelAndView.addObject("pageCustom",pageCustom); modelAndView.setViewName("Home/Page/page"); } else { modelAndView.setViewName("Home/Error/404"); } return modelAndView; } //文章归档页面显示 @RequestMapping(value = "/articleFile") public ModelAndView articleFile() throws Exception { ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("Home/Page/articleFile"); List<ArticleListVo> articleList = articleService.listArticle(1); modelAndView.addObject("articleList",articleList); return modelAndView; } //站点地图显示 @RequestMapping(value = "/map") public ModelAndView siteMap() throws Exception { ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("Home/Page/siteMap"); //文章显示 List<ArticleListVo> articleList = articleService.listArticle(1); modelAndView.addObject("articleList",articleList); //分类显示 List<CategoryCustom> categoryCustomList = categoryService.listCategory(1); modelAndView.addObject("categoryCustomList",categoryCustomList); //标签显示 List<TagCustom> tagCustomList = tagService.listTag(1); modelAndView.addObject("tagCustomList",tagCustomList); return modelAndView; } //留言板 @RequestMapping(value = "/message") public ModelAndView message() throws Exception { ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("Home/Page/message"); return modelAndView; } //百度糯米 @RequestMapping(value = "/nuomi") public String nuomi() { return "Nuomi/nuomi2"; } //地球 @RequestMapping(value = "/") public String earth() { return "Earth/index"; } //登陆 @RequestMapping("/dl") public String login() { return "Earth/login"; } }
e2687107594e1c51ad9634d6b99a58ab7d805157
08ee70613fde2b244932eee4450a37ecc8f97b6e
/src/main/java/com/javaguru/shoppinglist/dto/ProductDTO.java
fb2d87910e7d345391d3c7012d789cace3dca338
[]
no_license
19art91/JavaGuruProj
7c4ce32ebe71d2c793d33bff5ec061c4bb343da8
10920cc62c96aeb8f70ed3e7d4dce5aeb1be86a1
refs/heads/master
2022-12-23T11:18:18.683342
2019-12-13T13:09:16
2019-12-13T13:09:16
214,249,531
0
0
null
2022-12-16T09:56:29
2019-10-10T17:52:35
Java
UTF-8
Java
false
false
1,627
java
package com.javaguru.shoppinglist.dto; import com.javaguru.shoppinglist.domain.ShoppingCart; import javax.persistence.*; import java.math.BigDecimal; import java.util.LinkedList; import java.util.List; public class ProductDTO { private Long id; private String name; private BigDecimal price; private String category; private BigDecimal discount; private String description; public ProductDTO() { } public ProductDTO(Long id, String name, BigDecimal price, String category, BigDecimal discount, String description) { this.id = id; this.name = name; this.price = price; this.category = category; this.discount = discount; this.description = description; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public BigDecimal getPrice() { return price; } public void setPrice(BigDecimal price) { this.price = price; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } public BigDecimal getDiscount() { return discount; } public void setDiscount(BigDecimal discount) { this.discount = discount; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } }
3a1cf707a4b6a49655fdcf6008912d7ed4e70603
2a0b28c1deca3281c2e61a7fc3add2eba94b84d9
/studio-common/src/main/java/com/free/studio/framework/pureui/view/Condition.java
aed86d5c8beadf9d80c475a10d0cba950ebebca1
[]
no_license
787749090/studio-parent
75276003ffe1d0ba2ae1977e79ad8b49b31d6424
88b1f8326190e4bd249677b7bec39d8d2f371f62
refs/heads/master
2021-01-21T10:29:32.355952
2017-05-18T12:41:59
2017-05-18T12:41:59
91,657,924
0
0
null
null
null
null
UTF-8
Java
false
false
334
java
package com.free.studio.framework.pureui.view; import com.free.studio.framework.core.support.model.BaseView; /** * @Title: Condition.java * @Package com.free.studio.framework.pureui.view * @Description: TODO * @author yewp * @date 2017年5月8日 下午5:30:15 * @version V1.0 */ public class Condition extends BaseView { }
cc35dec4b719efa47d6d639582b9ad06aaf01559
14d19c2e0535612c89881137e7236b80fb48fc37
/src/lesson01/AbstractCar.java
b339afd42978408ba9353e88aa97a6f58125ff3e
[]
no_license
vip-89/JavaNewProiectPractica
6b4c663dd467dd45d555f09e78bac614cdc67c32
7975e68aa2a6948e7caedd90c98add29f6365b4d
refs/heads/master
2021-06-07T12:35:32.900248
2016-07-10T07:00:25
2016-07-10T07:00:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
532
java
package lesson01; /** * gkislin * 12.12.2014. */ public abstract class AbstractCar implements Car { protected int speed = 100; public int getSpeed() { return speed; } public void setSpeed(int speed) { this.speed = speed + 12; } public void getDescription() { out("\n" + this.getClass().getSimpleName() + "(Speed: " + speed + ", EngineVolume:" + getEngineVolume()+")"); } private void out(String str) { System.out.println(str); } }
[ "Viorel Popa" ]
Viorel Popa
d7ea281c4a02a5ac543a4882ed835c0a74bde960
76f495e542d5fdddcbea7721b071094fe081e249
/test-uima-annotator-two/src/main/java/com/github/hronom/test/uima/annotator/two/RoomNumber_Type.java
1692ad1302336f48eb19e999e19fe925e358761f
[]
no_license
Hronom/test-uima
889023ae116c2d8ac70af5bed7cf6aeb7bc5261c
9662dceeb344f4afb558a6eebd6436d196da06d6
refs/heads/master
2023-05-01T10:04:41.363461
2015-09-30T18:37:40
2015-09-30T18:37:40
43,450,700
0
0
null
2023-04-16T19:07:57
2015-09-30T18:21:02
Java
UTF-8
Java
false
false
3,307
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 com.github.hronom.test.uima.annotator.two; import org.apache.uima.cas.Feature; import org.apache.uima.cas.FeatureStructure; import org.apache.uima.cas.Type; import org.apache.uima.cas.impl.CASImpl; import org.apache.uima.cas.impl.FSGenerator; import org.apache.uima.cas.impl.FeatureImpl; import org.apache.uima.cas.impl.TypeImpl; import org.apache.uima.jcas.JCas; import org.apache.uima.jcas.JCasRegistry; import org.apache.uima.jcas.tcas.Annotation_Type; public class RoomNumber_Type extends Annotation_Type { public final static int typeIndexID = RoomNumber.typeIndexID; public final static boolean featOkTst = JCasRegistry.getFeatOkTst("RoomNumber"); final Feature casFeat_building; final int casFeatCode_building; private final FSGenerator fsGenerator = new FSGenerator() { public FeatureStructure createFS(int addr, CASImpl cas) { if (instanceOf_Type.useExistingInstance) { // Return eq fs instance if already created FeatureStructure fs = instanceOf_Type.jcas.getJfsFromCaddr(addr); if (null == fs) { fs = new RoomNumber(addr, instanceOf_Type); instanceOf_Type.jcas.putJfsFromCaddr(addr, fs); return fs; } return fs; } else { return new RoomNumber(addr, instanceOf_Type); } } }; public RoomNumber_Type(JCas jcas, Type casType) { super(jcas, casType); casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl) this.casType, getFSGenerator()); casFeat_building = jcas .getRequiredFeatureDE(casType, "building", "uima.cas.String", featOkTst); casFeatCode_building = (null == casFeat_building) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl) casFeat_building).getCode(); } protected FSGenerator getFSGenerator() { return fsGenerator; } public String getBuilding(int addr) { if (featOkTst && casFeat_building == null) { this.jcas.throwFeatMissing("building", "TestAnnot2.RoomNumber"); } return ll_cas.ll_getStringValue(addr, casFeatCode_building); } public void setBuilding(int addr, String v) { if (featOkTst && casFeat_building == null) { this.jcas.throwFeatMissing("building", "TestAnnot2.RoomNumber"); } ll_cas.ll_setStringValue(addr, casFeatCode_building, v); } }
870f83ea6d43561eddd127267da276aa8d6d42ef
26c08cd216e5f40bc89164e34420e104132d6630
/app/src/main/java/com/my/mymh/util/choosePic/common/OnFolderChangeListener.java
2f983d9c9a47df1add88f1f45b9d383a800187b1
[]
no_license
cxw18772827901/Test1
a0695c2aa02f810fbd82c322c07e93c1f0863239
698fe3cd6cdc07622d6e918737cfc83c14d79275
refs/heads/master
2023-06-02T03:29:14.578204
2020-12-01T13:28:39
2020-12-01T13:28:39
317,541,242
0
0
null
null
null
null
UTF-8
Java
false
false
230
java
package com.my.mymh.util.choosePic.common; import com.my.mymh.util.choosePic.bean.Folder; /** * @author yuyh. * @date 2016/8/5. */ public interface OnFolderChangeListener { void onChange(int position, Folder folder); }
864c6816c7e5960790ca62c8bf3a826264534dee
8e4a4384c42ec8c844a99cd8e9fc4250267e36ad
/thymeleafdemo/src/main/java/com/dreamteam/springboot/thymeleafdemo/controller/EmployeeController.java
90b76f04ab3ed2f01b4d930d4179f71b482b30f4
[]
no_license
sfanpro/thymeleaf-demo
71710487abf00d55016eee84a49faa173d40a8af
7fa5cd32c1a35e6e055c0589556fae88c22c3d2e
refs/heads/master
2020-05-20T03:00:52.183256
2019-05-07T18:22:32
2019-05-07T18:22:32
185,346,567
0
0
null
null
null
null
UTF-8
Java
false
false
2,354
java
package com.dreamteam.springboot.thymeleafdemo.controller; import java.util.List; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import com.dreamteam.springboot.thymeleafdemo.entity.Employee; import com.dreamteam.springboot.thymeleafdemo.service.EmployeeService; @Controller @RequestMapping("/employees") public class EmployeeController { private EmployeeService employeeService; public EmployeeController(EmployeeService employeeService) { this.employeeService = employeeService; } // add mapping for "/list" @GetMapping("/list") public String listEmployees(Model theModel) { // get employee from db List<Employee> theEmployees = employeeService.findAll(); // add to the String Model theModel.addAttribute("employees", theEmployees); return "employees/list-employees"; } @GetMapping("/showFormForAdd") public String showFormForAdd(Model theModel) { // create a model attribute to bind form data Employee theEmployee = new Employee(); theModel.addAttribute("employee", theEmployee); return "employees/employee-form"; } @GetMapping("/showFormForUpdate") public String showFormForUpdate(@RequestParam("employeeId") int theId, Model theModel) { // get employee from service Employee theEmployee = employeeService.findById(theId); // set employee as a model attribute to pre-populate the form theModel.addAttribute("employee", theEmployee); // send over to our form return "employees/employee-form"; } @PostMapping("/save") public String saveEmployee(@ModelAttribute("Employee") Employee theEmployee) { // save the employee employeeService.save(theEmployee); // use the redirect to prevent duplicate submissions return "redirect:/employees/list"; } @GetMapping("/delete") public String delete(@RequestParam("employeeId") int theId) { // delete the employee employeeService.deleteById(theId); // redirect to employees list return "redirect:/employees/list"; } }
46a93e6675e1bd1979aaf0c0fde255ce9dc5fb8e
c885ef92397be9d54b87741f01557f61d3f794f3
/tests-without-trycatch/Closure-109/com.google.javascript.jscomp.parsing.JsDocInfoParser/BBC-F0-opt-20/27/com/google/javascript/jscomp/parsing/JsDocInfoParser_ESTest_scaffolding.java
ecc75c64473936af2dd1aa0066520929be3546f3
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
33,222
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sat Oct 23 17:11:14 GMT 2021 */ package com.google.javascript.jscomp.parsing; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.junit.AfterClass; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; import static org.evosuite.shaded.org.mockito.Mockito.*; @EvoSuiteClassExclude public class JsDocInfoParser_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "com.google.javascript.jscomp.parsing.JsDocInfoParser"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); org.evosuite.runtime.classhandling.JDKClassResetter.init(); setSystemProperties(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); try { initMocksToAvoidTimeoutsInTheTests(); } catch(ClassNotFoundException e) {} } @AfterClass public static void clearEvoSuiteFramework(){ Sandbox.resetDefaultSecurityManager(); java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); setSystemProperties(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); resetClasses(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public static void setSystemProperties() { java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); java.lang.System.setProperty("user.dir", "/experiment"); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(JsDocInfoParser_ESTest_scaffolding.class.getClassLoader() , "com.google.javascript.rhino.head.RegExpProxy", "com.google.javascript.rhino.JSDocInfo$StringPosition", "com.google.common.collect.Hashing", "com.google.javascript.rhino.head.Icode", "com.google.javascript.rhino.head.DefaultErrorReporter", "com.google.common.collect.ImmutableList$SubList", "com.google.javascript.rhino.JSDocInfo$Visibility", "com.google.javascript.rhino.head.Script", "com.google.common.collect.Lists$RandomAccessPartition", "com.google.javascript.rhino.SimpleErrorReporter", "com.google.javascript.rhino.head.ScriptRuntime$DefaultMessageProvider", "com.google.javascript.rhino.head.WrappedException", "com.google.javascript.rhino.head.debug.DebuggableObject", "com.google.common.collect.PeekingIterator", "com.google.javascript.rhino.head.jdk13.VMBridge_jdk13", "com.google.common.collect.RegularImmutableList", "com.google.javascript.jscomp.parsing.JsDocInfoParser", "com.google.javascript.rhino.head.ast.Comment", "com.google.javascript.rhino.jstype.StaticScope", "com.google.javascript.rhino.head.Function", "com.google.common.collect.Lists$TransformingRandomAccessList", "com.google.javascript.rhino.head.ScriptableObject$RelinkedSlot", "com.google.javascript.rhino.Node$PropListItem", "com.google.javascript.jscomp.parsing.JsDocToken", "com.google.common.collect.Sets$2", "com.google.javascript.rhino.Node$IntPropListItem", "com.google.common.collect.Sets$3", "com.google.javascript.rhino.Node", "com.google.javascript.rhino.head.RhinoException", "com.google.javascript.rhino.SourcePosition", "com.google.common.collect.Sets$1", "com.google.common.collect.Platform", "com.google.common.collect.ImmutableMapKeySet", "com.google.javascript.rhino.JSDocInfo$TrimmedStringPosition", "com.google.javascript.jscomp.parsing.NullErrorReporter$NewRhinoNullReporter", "com.google.javascript.rhino.JSDocInfo$Marker", "com.google.common.collect.RegularImmutableMap", "com.google.javascript.rhino.Node$NodeMismatch", "com.google.javascript.rhino.head.ContextFactory$Listener", "com.google.javascript.rhino.head.ErrorReporter", "com.google.javascript.rhino.head.optimizer.Codegen", "com.google.javascript.rhino.head.ast.Jump", "com.google.javascript.jscomp.parsing.JsDocInfoParser$1", "com.google.javascript.rhino.head.NativeCall", "com.google.javascript.jscomp.parsing.NullErrorReporter", "com.google.common.collect.RegularImmutableSet", "com.google.common.collect.AbstractMapEntry", "com.google.javascript.rhino.head.ast.Scope", "com.google.common.collect.Iterators$12", "com.google.common.collect.Iterators$11", "com.google.javascript.rhino.head.Scriptable", "com.google.javascript.rhino.head.EcmaError", "com.google.javascript.rhino.head.FunctionObject", "com.google.common.collect.ImmutableMapEntry$TerminalEntry", "com.google.javascript.rhino.head.NativeContinuation", "com.google.javascript.rhino.Node$SiblingNodeIterable", "com.google.javascript.rhino.jstype.JSType", "com.google.javascript.rhino.head.xml.XMLObject", "com.google.common.collect.ImmutableAsList", "com.google.javascript.rhino.Node$StringNode", "com.google.javascript.rhino.head.xml.XMLLib$Factory", "com.google.common.collect.Sets$SetView", "com.google.common.collect.RegularImmutableAsList", "com.google.common.collect.SingletonImmutableSet", "com.google.common.collect.Iterators$13", "com.google.javascript.rhino.InputId", "com.google.javascript.rhino.head.InterpretedFunction", "com.google.common.collect.ImmutableMapEntrySet", "com.google.common.collect.Lists$Partition", "com.google.common.collect.Lists", "com.google.javascript.rhino.head.ast.AstRoot", "com.google.javascript.rhino.head.Token$CommentType", "com.google.javascript.rhino.Node$SideEffectFlags", "com.google.common.collect.UnmodifiableListIterator", "com.google.common.collect.Lists$TransformingSequentialList", "com.google.javascript.rhino.head.NativeNumber", "com.google.javascript.rhino.ErrorReporter", "com.google.javascript.rhino.Token", "com.google.common.collect.ObjectArrays", "com.google.javascript.rhino.Node$FileLevelJsDocBuilder", "com.google.javascript.rhino.jstype.StaticSourceFile", "com.google.javascript.rhino.head.ScriptableObject$Slot", "org.mozilla.classfile.ClassFileWriter$ClassFileFormatException", "com.google.common.collect.AbstractIterator", "com.google.javascript.rhino.head.ScriptableObject$GetterSlot", "com.google.javascript.rhino.head.Context$ClassShutterSetter", "com.google.common.collect.ImmutableList$1", "com.google.javascript.rhino.head.ScriptRuntime$MessageProvider", "com.google.javascript.rhino.head.GeneratedClassLoader", "com.google.javascript.rhino.JSDocInfo$1", "com.google.common.collect.ImmutableMap$MapViewOfValuesAsSingletonSets", "com.google.javascript.rhino.head.ast.FunctionNode", "com.google.javascript.rhino.head.ast.AstNode", "com.google.common.base.Preconditions", "com.google.javascript.rhino.head.ast.ErrorCollector", "com.google.common.collect.UnmodifiableIterator", "com.google.javascript.rhino.JSDocInfo", "com.google.javascript.rhino.head.Context", "com.google.javascript.jscomp.parsing.Config", "com.google.common.collect.ImmutableMapValues", "com.google.javascript.rhino.head.SecurityController", "com.google.common.collect.ImmutableEntry", "com.google.javascript.rhino.head.Callable", "com.google.javascript.jscomp.parsing.JsDocInfoParser$WhitespaceOption", "com.google.javascript.rhino.head.Token", "com.google.common.collect.ImmutableCollection", "com.google.javascript.rhino.head.debug.Debugger", "com.google.javascript.jscomp.parsing.JsDocInfoParser$State", "com.google.javascript.rhino.head.Node", "com.google.javascript.rhino.head.NativeBoolean", "com.google.javascript.rhino.head.ast.Name", "com.google.javascript.rhino.Node$AncestorIterable", "com.google.javascript.rhino.head.ClassShutter", "com.google.common.collect.Lists$RandomAccessListWrapper", "com.google.common.collect.ImmutableEnumSet", "com.google.javascript.rhino.head.ast.ScriptNode", "com.google.javascript.rhino.head.tools.ToolErrorReporter", "com.google.javascript.rhino.head.NativeArray", "com.google.javascript.rhino.head.WrapFactory", "com.google.common.collect.ImmutableList$ReverseImmutableList", "com.google.javascript.rhino.Node$NumberNode", "com.google.common.collect.SingletonImmutableList", "com.google.common.collect.ImmutableCollection$Builder", "com.google.common.collect.Iterators$6", "com.google.common.collect.BiMap", "com.google.common.collect.Iterators$7", "com.google.javascript.jscomp.parsing.JsDocInfoParser$ErrorReporterParser", "com.google.javascript.rhino.head.NativeString", "com.google.javascript.rhino.head.ContextFactory", "com.google.common.collect.ImmutableSet", "com.google.common.collect.Lists$AbstractListWrapper", "com.google.common.collect.ImmutableMap", "com.google.common.collect.ImmutableMapEntry", "com.google.javascript.rhino.head.VMBridge", "com.google.javascript.rhino.jstype.SimpleSourceFile", "com.google.common.collect.AbstractIndexedListIterator", "com.google.common.collect.CollectPreconditions", "com.google.common.collect.Iterators$1", "com.google.javascript.rhino.JSDocInfo$TypePosition", "com.google.common.collect.Iterators$2", "com.google.common.collect.Iterators$3", "com.google.common.collect.Sets", "com.google.javascript.rhino.head.Evaluator", "com.google.javascript.rhino.head.Kit", "com.google.javascript.rhino.JSDocInfo$LazilyInitializedInfo", "com.google.javascript.jscomp.parsing.Annotation", "com.google.javascript.rhino.head.ContextListener", "com.google.javascript.rhino.Node$ObjectPropListItem", "com.google.javascript.rhino.head.jdk15.VMBridge_jdk15", "com.google.javascript.rhino.head.ContinuationPending", "com.google.javascript.rhino.head.ContextAction", "com.google.common.collect.Lists$StringAsImmutableList", "com.google.javascript.rhino.head.ast.IdeErrorReporter", "com.google.javascript.rhino.IR", "com.google.common.collect.Lists$2", "com.google.javascript.rhino.head.JavaScriptException", "com.google.javascript.rhino.head.EvaluatorException", "com.google.javascript.rhino.head.ast.NumberLiteral", "com.google.common.collect.RegularImmutableMap$NonTerminalMapEntry", "com.google.common.collect.Lists$1", "com.google.javascript.rhino.head.TopLevel", "com.google.javascript.jscomp.parsing.JsDocInfoParser$ExtractionInfo", "com.google.javascript.rhino.head.BaseFunction", "com.google.javascript.jscomp.parsing.JsDocTokenStream", "com.google.javascript.rhino.JSDocInfoBuilder", "com.google.common.collect.EmptyImmutableSet", "com.google.common.collect.Iterators", "com.google.javascript.rhino.head.IdFunctionCall", "com.google.common.collect.ImmutableBiMap", "com.google.javascript.rhino.JSDocInfo$NamePosition", "com.google.javascript.rhino.JSDocInfo$LazilyInitializedDocumentation", "com.google.common.collect.ImmutableList", "com.google.javascript.rhino.head.Interpreter", "com.google.javascript.rhino.head.ImporterTopLevel", "com.google.javascript.rhino.Node$AbstractPropListItem", "com.google.javascript.rhino.jstype.JSTypeRegistry", "com.google.javascript.jscomp.parsing.Config$LanguageMode", "com.google.common.collect.RegularImmutableMap$EntrySet", "com.google.javascript.rhino.head.ScriptRuntime$1", "com.google.javascript.rhino.head.ScriptRuntime", "com.google.common.collect.ImmutableMap$Builder", "com.google.javascript.rhino.head.ContextFactory$GlobalSetter", "com.google.javascript.rhino.head.ast.NodeVisitor", "com.google.javascript.rhino.head.ConstProperties", "com.google.javascript.rhino.JSTypeExpression", "com.google.common.collect.Iterators$MergingIterator", "com.google.javascript.rhino.head.ScriptableObject", "com.google.javascript.rhino.head.IdScriptableObject", "com.google.javascript.rhino.head.NativeFunction", "com.google.javascript.rhino.head.debug.DebuggableScript", "com.google.javascript.rhino.head.NativeObject" ); } private static void initMocksToAvoidTimeoutsInTheTests() throws ClassNotFoundException { mock(Class.forName("com.google.javascript.jscomp.parsing.Config", false, JsDocInfoParser_ESTest_scaffolding.class.getClassLoader())); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(JsDocInfoParser_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "com.google.common.collect.ImmutableCollection", "com.google.common.collect.ImmutableSet", "com.google.common.collect.ObjectArrays", "com.google.common.collect.Hashing", "com.google.common.collect.RegularImmutableSet", "com.google.javascript.jscomp.parsing.JsDocInfoParser", "com.google.javascript.jscomp.parsing.JsDocInfoParser$ErrorReporterParser", "com.google.javascript.jscomp.parsing.JsDocInfoParser$ExtractionInfo", "com.google.javascript.jscomp.parsing.JsDocInfoParser$ExtendedTypeInfo", "com.google.common.collect.EmptyImmutableSet", "com.google.javascript.jscomp.parsing.JsDocToken", "com.google.javascript.jscomp.parsing.Config$LanguageMode", "com.google.javascript.jscomp.parsing.JsDocInfoParser$State", "com.google.common.collect.ImmutableMap$Builder", "com.google.common.collect.ImmutableMap", "com.google.common.collect.CollectPreconditions", "com.google.common.collect.AbstractMapEntry", "com.google.common.collect.ImmutableEntry", "com.google.common.collect.ImmutableMapEntry", "com.google.common.collect.ImmutableMapEntry$TerminalEntry", "com.google.common.collect.ImmutableCollection$Builder", "com.google.common.collect.Platform", "com.google.common.collect.RegularImmutableMap", "com.google.common.collect.RegularImmutableMap$NonTerminalMapEntry", "com.google.javascript.jscomp.parsing.Annotation", "com.google.javascript.jscomp.parsing.JsDocInfoParser$1", "com.google.javascript.jscomp.parsing.JsDocInfoParser$WhitespaceOption", "com.google.common.base.CharMatcher$1", "com.google.common.base.CharMatcher$FastMatcher", "com.google.common.base.CharMatcher$13", "com.google.common.base.CharMatcher$RangesMatcher", "com.google.common.base.Preconditions", "com.google.common.base.CharMatcher$2", "com.google.common.base.CharMatcher$3", "com.google.common.base.CharMatcher$4", "com.google.common.base.CharMatcher$5", "com.google.common.base.CharMatcher$6", "com.google.common.base.CharMatcher$Or", "com.google.common.base.CharMatcher$7", "com.google.common.base.CharMatcher$8", "com.google.common.base.CharMatcher$15", "com.google.common.base.CharMatcher", "com.google.javascript.rhino.JSDocInfo$Visibility", "com.google.javascript.jscomp.parsing.JsDocTokenStream", "com.google.javascript.rhino.head.Node", "com.google.javascript.rhino.head.ast.AstNode", "com.google.javascript.rhino.head.ast.Comment", "com.google.javascript.rhino.Node", "com.google.javascript.rhino.jstype.CanCastToVisitor", "com.google.javascript.rhino.jstype.JSType$1", "com.google.javascript.rhino.jstype.JSType", "com.google.javascript.rhino.jstype.ObjectType", "com.google.javascript.rhino.Node$StringNode", "com.google.javascript.jscomp.parsing.Config", "com.google.common.collect.ImmutableMapEntrySet", "com.google.common.collect.RegularImmutableMap$EntrySet", "com.google.common.collect.RegularImmutableList", "com.google.common.collect.ImmutableList", "com.google.common.collect.ImmutableAsList", "com.google.common.collect.RegularImmutableAsList", "com.google.common.collect.UnmodifiableIterator", "com.google.common.collect.UnmodifiableListIterator", "com.google.common.collect.Iterators$1", "com.google.common.collect.Iterators$2", "com.google.common.collect.Iterators", "com.google.common.collect.AbstractIndexedListIterator", "com.google.common.collect.Iterators$11", "com.google.common.collect.Sets", "com.google.javascript.jscomp.parsing.NullErrorReporter", "com.google.javascript.jscomp.parsing.NullErrorReporter$NewRhinoNullReporter", "com.google.javascript.rhino.JSDocInfoBuilder", "com.google.javascript.rhino.JSDocInfo", "com.google.javascript.rhino.IR", "com.google.javascript.rhino.Token", "com.google.javascript.rhino.SimpleErrorReporter", "com.google.javascript.rhino.head.ast.ErrorCollector", "com.google.javascript.rhino.JSDocInfo$LazilyInitializedDocumentation", "com.google.common.collect.Lists", "com.google.javascript.rhino.Node$AbstractPropListItem", "com.google.javascript.rhino.Node$IntPropListItem", "com.google.javascript.rhino.head.tools.ToolErrorReporter", "com.google.javascript.rhino.JSTypeExpression", "com.google.javascript.rhino.Node$FileLevelJsDocBuilder", "com.google.javascript.rhino.head.Kit", "com.google.javascript.rhino.head.ContextFactory", "com.google.javascript.rhino.head.ScriptableObject", "com.google.javascript.rhino.head.ScriptRuntime$DefaultMessageProvider", "com.google.javascript.rhino.head.ScriptRuntime", "com.google.javascript.rhino.head.optimizer.Codegen", "com.google.javascript.rhino.head.Icode", "com.google.javascript.rhino.head.Interpreter", "com.google.javascript.rhino.head.Context", "com.google.javascript.rhino.head.jdk13.VMBridge_jdk13", "com.google.javascript.rhino.head.jdk15.VMBridge_jdk15", "com.google.javascript.rhino.head.VMBridge", "com.google.javascript.rhino.head.DefaultErrorReporter", "com.google.javascript.rhino.head.ContinuationPending", "com.google.javascript.rhino.jstype.JSTypeRegistry", "com.google.common.base.Joiner", "com.google.common.base.Joiner$1", "com.google.common.collect.Collections2", "com.google.common.base.Joiner$MapJoiner", "com.google.common.collect.Maps", "com.google.common.collect.AbstractMultimap", "com.google.common.collect.AbstractMapBasedMultimap", "com.google.common.collect.AbstractSetMultimap", "com.google.common.collect.LinkedHashMultimap", "com.google.common.collect.LinkedHashMultimap$ValueEntry", "com.google.common.collect.AbstractListMultimap", "com.google.common.collect.ArrayListMultimap", "com.google.javascript.rhino.jstype.TemplateTypeMap", "com.google.javascript.rhino.jstype.ModificationVisitor", "com.google.javascript.rhino.jstype.TemplateTypeMapReplacer", "com.google.common.collect.ImmutableCollection$ArrayBasedBuilder", "com.google.common.collect.ImmutableList$Builder", "com.google.javascript.rhino.jstype.ProxyObjectType", "com.google.javascript.rhino.jstype.TemplateType", "com.google.javascript.rhino.jstype.ValueType", "com.google.javascript.rhino.jstype.BooleanType", "com.google.javascript.rhino.jstype.NullType", "com.google.javascript.rhino.jstype.NumberType", "com.google.javascript.rhino.jstype.StringType", "com.google.javascript.rhino.jstype.UnknownType", "com.google.javascript.rhino.jstype.VoidType", "com.google.javascript.rhino.jstype.AllType", "com.google.javascript.rhino.jstype.PrototypeObjectType", "com.google.common.collect.ImmutableBiMap", "com.google.common.collect.EmptyImmutableBiMap", "com.google.javascript.rhino.jstype.PropertyMap$1", "com.google.javascript.rhino.jstype.PropertyMap", "com.google.javascript.rhino.jstype.FunctionType", "com.google.javascript.rhino.jstype.FunctionParamBuilder", "com.google.javascript.rhino.jstype.ArrowType", "com.google.javascript.rhino.jstype.FunctionType$Kind", "com.google.javascript.rhino.jstype.FunctionType$PropAccess", "com.google.javascript.rhino.jstype.InstanceObjectType", "com.google.javascript.rhino.jstype.Property", "com.google.javascript.rhino.jstype.NoObjectType", "com.google.javascript.rhino.jstype.NoType", "com.google.javascript.rhino.jstype.NoResolvedType", "com.google.common.collect.SingletonImmutableList", "com.google.javascript.rhino.jstype.ErrorFunctionType", "com.google.javascript.rhino.jstype.UnionTypeBuilder", "com.google.javascript.rhino.jstype.EquivalenceMethod", "com.google.javascript.rhino.jstype.TemplateTypeMap$EquivalenceMatch", "com.google.javascript.rhino.jstype.UnionType", "com.google.javascript.rhino.jstype.FunctionBuilder", "com.google.javascript.rhino.jstype.JSTypeRegistry$1", "com.google.javascript.rhino.Node$NumberNode", "com.google.javascript.rhino.head.ast.XmlFragment", "com.google.javascript.rhino.head.ast.XmlString", "com.google.javascript.rhino.head.ast.NumberLiteral", "com.google.javascript.rhino.jstype.NamedType", "com.google.javascript.rhino.jstype.EnumType", "com.google.javascript.rhino.jstype.EnumElementType", "com.google.javascript.rhino.head.IdScriptableObject", "com.google.javascript.rhino.head.TopLevel", "com.google.javascript.rhino.head.ImporterTopLevel", "com.google.javascript.rhino.head.ObjArray", "com.google.javascript.rhino.head.JavaAdapter", "com.google.javascript.rhino.head.NativeJavaObject", "com.google.javascript.rhino.head.JavaMembers", "com.google.javascript.rhino.head.ClassCache", "com.google.javascript.rhino.Node$SiblingNodeIterable", "com.google.javascript.rhino.head.ast.Jump", "com.google.javascript.rhino.head.ast.Scope", "com.google.javascript.rhino.head.ast.Loop", "com.google.javascript.rhino.head.ast.ForLoop", "com.google.javascript.rhino.head.NativeObject", "com.google.javascript.rhino.head.Undefined", "com.google.javascript.rhino.head.WrapFactory", "com.google.javascript.rhino.jstype.SimpleSourceFile", "com.google.javascript.rhino.Node$ObjectPropListItem", "com.google.javascript.rhino.head.ast.CatchClause", "com.google.javascript.rhino.head.ast.Name", "com.google.javascript.rhino.head.Node$PropListItem", "com.google.javascript.rhino.head.RhinoException", "com.google.javascript.rhino.head.EvaluatorException", "com.google.javascript.rhino.head.Node$NodeIterator", "com.google.javascript.rhino.head.SecurityUtilities", "com.google.javascript.rhino.head.SecurityUtilities$1", "com.google.javascript.rhino.head.ast.ConditionalExpression", "com.google.javascript.rhino.head.ast.ParseProblem", "com.google.javascript.rhino.head.ast.ParseProblem$Type", "com.google.javascript.rhino.head.SecurityController", "org.mozilla.classfile.ClassFileWriter", "org.mozilla.classfile.ConstantPool", "com.google.javascript.rhino.head.UintMap", "com.google.javascript.rhino.head.ObjToIntMap", "org.mozilla.classfile.ClassFileMethod", "org.mozilla.classfile.FieldOrMethodRef", "com.google.javascript.rhino.head.PolicySecurityController", "com.google.javascript.rhino.head.ast.ForInLoop", "com.google.javascript.rhino.head.ast.ErrorNode", "com.google.javascript.rhino.head.ast.XmlRef", "com.google.javascript.rhino.head.ast.XmlPropRef", "com.google.javascript.rhino.head.ast.InfixExpression", "com.google.javascript.rhino.head.NativeArray", "com.google.javascript.rhino.head.UniqueTag", "com.google.javascript.rhino.head.Scriptable", "com.google.javascript.rhino.head.NativeArray$3", "com.google.javascript.rhino.Node$SideEffectFlags", "com.google.javascript.rhino.head.BaseFunction", "com.google.javascript.rhino.head.TopLevel$Builtins", "com.google.javascript.rhino.head.IdScriptableObject$PrototypeValues", "com.google.javascript.rhino.head.IdFunctionObject", "com.google.javascript.rhino.head.ScriptableObject$Slot", "com.google.javascript.rhino.head.ScriptableObject$RelinkedSlot", "com.google.javascript.rhino.head.NativeError", "com.google.javascript.rhino.head.NativeGlobal", "com.google.javascript.rhino.head.NativeString", "com.google.javascript.rhino.head.NativeBoolean", "com.google.javascript.rhino.head.NativeNumber", "com.google.javascript.rhino.head.NativeDate", "com.google.javascript.rhino.head.NativeMath", "com.google.javascript.rhino.head.NativeJSON", "com.google.javascript.rhino.head.NativeWith", "com.google.javascript.rhino.head.NativeCall", "com.google.javascript.rhino.head.NativeScript", "com.google.javascript.rhino.head.NativeIterator", "com.google.javascript.rhino.head.NativeGenerator", "com.google.javascript.rhino.head.NativeIterator$StopIteration", "com.google.javascript.rhino.head.xml.XMLLib$Factory", "com.google.javascript.rhino.head.xml.XMLLib$Factory$1", "com.google.javascript.rhino.head.LazilyLoadedCtor", "com.google.javascript.rhino.head.ScriptableObject$GetterSlot", "com.google.javascript.rhino.head.JavaScriptException", "com.google.javascript.rhino.head.ast.XmlExpression", "com.google.javascript.rhino.head.ast.DoLoop", "com.google.javascript.rhino.Node$AncestorIterable", "com.google.javascript.rhino.head.LazilyLoadedCtor$1", "com.google.javascript.rhino.head.regexp.NativeRegExp", "com.google.javascript.rhino.head.FunctionObject", "com.google.javascript.rhino.head.regexp.RECompiled", "com.google.javascript.rhino.head.regexp.CompilerState", "com.google.javascript.rhino.head.regexp.RENode", "com.google.javascript.rhino.head.regexp.NativeRegExpCtor", "com.google.javascript.rhino.head.Delegator", "com.google.javascript.rhino.jstype.TemplatizedType", "com.google.common.collect.Iterables", "com.google.javascript.rhino.head.ast.FunctionCall", "com.google.javascript.rhino.head.ast.NewExpression", "com.google.javascript.rhino.jstype.NamespaceType", "com.google.javascript.rhino.head.ast.ArrayComprehension", "com.google.javascript.rhino.head.ast.ExpressionStatement", "com.google.javascript.rhino.head.ContextFactory$1GlobalSetterImpl", "com.google.javascript.rhino.head.ast.ParenthesizedExpression", "com.google.javascript.rhino.head.ast.ContinueStatement", "com.google.javascript.rhino.Node$NodeMismatch", "com.google.javascript.rhino.head.ast.WithStatement", "com.google.javascript.rhino.head.ast.IfStatement", "com.google.javascript.rhino.head.ast.LetNode", "com.google.javascript.rhino.head.ast.Yield", "com.google.javascript.rhino.JSDocInfo$LazilyInitializedInfo", "com.google.javascript.rhino.head.ast.KeywordLiteral", "com.google.javascript.rhino.head.ast.XmlMemberGet", "com.google.javascript.rhino.head.ast.AstNode$DebugPrintVisitor", "com.google.javascript.rhino.head.Token", "com.google.javascript.rhino.head.ContextFactory$1", "com.google.javascript.rhino.head.DefiningClassLoader", "com.google.javascript.rhino.head.ast.VariableDeclaration", "com.google.javascript.rhino.head.WrappedException", "com.google.javascript.rhino.head.ast.Label", "com.google.javascript.rhino.head.ast.ReturnStatement", "com.google.common.collect.Iterators$12", "com.google.javascript.rhino.head.ast.BreakStatement", "com.google.common.collect.ImmutableList$ReverseImmutableList", "com.google.javascript.rhino.head.ast.XmlLiteral", "com.google.javascript.rhino.head.ast.ElementGet", "com.google.javascript.rhino.head.ast.XmlDotQuery", "com.google.javascript.rhino.head.NativeContinuation", "com.google.javascript.rhino.head.ast.Assignment", "com.google.javascript.rhino.head.ast.GeneratorExpressionLoop", "com.google.javascript.rhino.head.ast.XmlElemRef", "com.google.javascript.rhino.head.EcmaError", "com.google.javascript.rhino.head.ast.ScriptNode", "com.google.javascript.rhino.head.ast.UnaryExpression", "com.google.javascript.rhino.head.v8dtoa.FastDtoa", "com.google.javascript.rhino.head.v8dtoa.FastDtoaBuilder", "com.google.javascript.rhino.head.v8dtoa.DoubleHelper", "com.google.javascript.rhino.head.v8dtoa.DiyFp", "com.google.javascript.rhino.head.v8dtoa.CachedPowers$CachedPower", "com.google.javascript.rhino.head.v8dtoa.CachedPowers", "com.google.javascript.rhino.head.NativeJavaClass", "com.google.javascript.rhino.head.CompilerEnvirons", "com.google.javascript.rhino.head.Parser", "com.google.javascript.rhino.head.TokenStream", "com.google.javascript.rhino.head.ast.AstRoot", "com.google.javascript.rhino.head.Parser$ParserException", "com.google.javascript.rhino.head.ast.EmptyStatement", "com.google.javascript.rhino.head.ast.GeneratorExpression", "com.google.common.collect.ImmutableList$1", "com.google.javascript.rhino.head.ast.LabeledStatement", "com.google.javascript.rhino.head.ast.TryStatement", "com.google.javascript.rhino.head.NativeJavaPackage", "com.google.javascript.rhino.head.ast.ArrayComprehensionLoop", "com.google.javascript.rhino.head.BoundFunction", "com.google.javascript.rhino.head.ScriptRuntime$1", "com.google.javascript.rhino.head.MemberBox", "com.google.javascript.rhino.head.AttachJsDocs", "com.google.javascript.rhino.head.ast.SwitchCase", "com.google.javascript.rhino.head.ast.PropertyGet", "com.google.javascript.rhino.head.Context$2", "com.google.javascript.rhino.head.ast.ArrayLiteral", "com.google.javascript.rhino.InputId", "com.google.javascript.rhino.head.ast.ObjectProperty", "com.google.javascript.rhino.head.ast.FunctionNode", "com.google.javascript.rhino.head.ast.FunctionNode$Form", "com.google.javascript.rhino.jstype.BooleanLiteralSet", "com.google.common.collect.AbstractMapBasedMultimap$WrappedCollection", "com.google.common.collect.AbstractMapBasedMultimap$WrappedList", "com.google.common.collect.AbstractMapBasedMultimap$RandomAccessWrappedList", "com.google.common.collect.AbstractMapBasedMultimap$WrappedCollection$WrappedIterator", "com.google.javascript.rhino.head.Synchronizer", "com.google.javascript.rhino.head.ast.Block", "com.google.javascript.rhino.JSDocInfo$Marker", "com.google.javascript.rhino.SourcePosition", "com.google.javascript.rhino.JSDocInfo$StringPosition", "com.google.javascript.rhino.JSDocInfo$TrimmedStringPosition" ); } }
1f0d7e7a924101755d0cb27874c3a93860829982
4ef1b972593f699a71e4eca7ee1010aa231f52cc
/hnLibrary/src/main/java/com/hn/library/jkeyboard/util/KeyboardUtil.java
d69aa9c3f4089626c85cd895653e89e74e02f01d
[]
no_license
LoooooG/youyou
e2e8fb0f576a6e2daf614d1186303ec7ce7bdf4a
5bff0de57159ab3dda075343b83ff4a461df66e2
refs/heads/master
2020-12-03T12:52:00.462951
2020-02-17T10:29:59
2020-02-17T10:29:59
231,321,844
1
0
null
null
null
null
UTF-8
Java
false
false
18,692
java
/* * Copyright (C) 2015-2017 Jacksgong(blog.dreamtobe.cn) * * 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.hn.library.jkeyboard.util; import android.annotation.TargetApi; import android.app.Activity; import android.content.Context; import android.content.res.Resources; import android.graphics.Point; import android.graphics.Rect; import android.os.Build; import android.os.Bundle; import android.util.Log; import android.view.Display; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.view.inputmethod.InputMethodManager; import com.hn.library.R; import com.hn.library.jkeyboard.IPanelHeightTarget; /** * Created by Jacksgong on 15/7/6. * <p/> * For save the keyboard height, and provide the valid-panel-height {@link #getValidPanelHeight(Context)}. * <p/> * Adapt the panel height with the keyboard height just relate {@link #attach(Activity, IPanelHeightTarget)}. * * @see KeyBoardSharedPreferences */ public class KeyboardUtil { public static void showKeyboard(final View view) { view.requestFocus(); InputMethodManager inputManager = (InputMethodManager) view.getContext().getSystemService( Context.INPUT_METHOD_SERVICE); inputManager.showSoftInput(view, 0); } public static void hideKeyboard(final View view) { InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getWindowToken(), 0); } private static int LAST_SAVE_KEYBOARD_HEIGHT = 0; private static boolean saveKeyboardHeight(final Context context, int keyboardHeight) { if (LAST_SAVE_KEYBOARD_HEIGHT == keyboardHeight) { return false; } if (keyboardHeight < 0) { return false; } LAST_SAVE_KEYBOARD_HEIGHT = keyboardHeight; Log.d("KeyBordUtil", String.format("save keyboard: %d", keyboardHeight)); return KeyBoardSharedPreferences.save(context, keyboardHeight); } /** * @param context the keyboard height is stored by shared-preferences, so need context. * @return the stored keyboard height. * @see #getValidPanelHeight(Context) * @see #attach(Activity, IPanelHeightTarget) * <p/> * Handle and refresh the keyboard height by {@link #attach(Activity, IPanelHeightTarget)}. */ public static int getKeyboardHeight(final Context context) { if (LAST_SAVE_KEYBOARD_HEIGHT == 0) { LAST_SAVE_KEYBOARD_HEIGHT = KeyBoardSharedPreferences.get(context, getMinPanelHeight(context.getResources())); } return LAST_SAVE_KEYBOARD_HEIGHT; } /** * @param context the keyboard height is stored by shared-preferences, so need context. * @return the valid panel height refer the keyboard height * @see #getMaxPanelHeight(Resources) * @see #getMinPanelHeight(Resources) * @see #getKeyboardHeight(Context) * @see #attach(Activity, IPanelHeightTarget) * <p/> * The keyboard height may be too short or too height. we intercept the keyboard height in * [{@link #getMinPanelHeight(Resources)}, {@link #getMaxPanelHeight(Resources)}]. */ public static int getValidPanelHeight(final Context context) { final int maxPanelHeight = getMaxPanelHeight(context.getResources()); final int minPanelHeight = getMinPanelHeight(context.getResources()); int validPanelHeight = getKeyboardHeight(context); validPanelHeight = Math.max(minPanelHeight, validPanelHeight); validPanelHeight = Math.min(maxPanelHeight, validPanelHeight); return validPanelHeight; } private static int MAX_PANEL_HEIGHT = 0; private static int MIN_PANEL_HEIGHT = 0; private static int MIN_KEYBOARD_HEIGHT = 0; public static int getMaxPanelHeight(final Resources res) { if (MAX_PANEL_HEIGHT == 0) { MAX_PANEL_HEIGHT = res.getDimensionPixelSize(R.dimen.max_panel_height); } return MAX_PANEL_HEIGHT; } public static int getMinPanelHeight(final Resources res) { if (MIN_PANEL_HEIGHT == 0) { MIN_PANEL_HEIGHT = res.getDimensionPixelSize(R.dimen.min_panel_height); } return MIN_PANEL_HEIGHT; } public static int getMinKeyboardHeight(Context context) { if (MIN_KEYBOARD_HEIGHT == 0) { MIN_KEYBOARD_HEIGHT = context.getResources().getDimensionPixelSize(R.dimen.min_keyboard_height); } return MIN_KEYBOARD_HEIGHT; } /** * Recommend invoked by {@link Activity#onCreate(Bundle)} * For align the height of the keyboard to {@code target} as much as possible. * For save the refresh the keyboard height to shared-preferences. * * @param activity contain the view * @param target whose height will be align to the keyboard height. * @param listener the listener to listen in: keyboard is showing or not. * @see #saveKeyboardHeight(Context, int) */ @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) public static ViewTreeObserver.OnGlobalLayoutListener attach(final Activity activity, IPanelHeightTarget target, /** Nullable **/OnKeyboardShowingListener listener) { final ViewGroup contentView = (ViewGroup) activity.findViewById(android.R.id.content); final boolean isFullScreen = ViewUtil.isFullScreen(activity); final boolean isTranslucentStatus = ViewUtil.isTranslucentStatus(activity); final boolean isFitSystemWindows = ViewUtil.isFitsSystemWindows(activity); // get the screen height. final Display display = activity.getWindowManager().getDefaultDisplay(); final int screenHeight; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) { final Point screenSize = new Point(); display.getSize(screenSize); screenHeight = screenSize.y; } else { //noinspection deprecation screenHeight = display.getHeight(); } ViewTreeObserver.OnGlobalLayoutListener globalLayoutListener = new KeyboardStatusListener( isFullScreen, isTranslucentStatus, isFitSystemWindows, contentView, target, listener, screenHeight); contentView.getViewTreeObserver().addOnGlobalLayoutListener(globalLayoutListener); return globalLayoutListener; } /** * @see #attach(Activity, IPanelHeightTarget, OnKeyboardShowingListener) */ public static ViewTreeObserver.OnGlobalLayoutListener attach(final Activity activity, IPanelHeightTarget target) { return attach(activity, target, null); } /** * Remove the OnGlobalLayoutListener from the activity root view * * @param activity same activity used in {@link #attach} method * @param l ViewTreeObserver.OnGlobalLayoutListener returned by {@link #attach} method */ @TargetApi(Build.VERSION_CODES.JELLY_BEAN) public static void detach(Activity activity, ViewTreeObserver.OnGlobalLayoutListener l) { ViewGroup contentView = (ViewGroup) activity.findViewById(android.R.id.content); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { contentView.getViewTreeObserver().removeOnGlobalLayoutListener(l); } else { //noinspection deprecation contentView.getViewTreeObserver().removeGlobalOnLayoutListener(l); } } private static class KeyboardStatusListener implements ViewTreeObserver.OnGlobalLayoutListener { private final static String TAG = "KeyboardStatusListener"; private int previousDisplayHeight = 0; private final ViewGroup contentView; private final IPanelHeightTarget panelHeightTarget; private final boolean isFullScreen; private final boolean isTranslucentStatus; private final boolean isFitSystemWindows; private final int statusBarHeight; private boolean lastKeyboardShowing; private final OnKeyboardShowingListener keyboardShowingListener; private final int screenHeight; private boolean isOverlayLayoutDisplayHContainStatusBar = false; KeyboardStatusListener(boolean isFullScreen, boolean isTranslucentStatus, boolean isFitSystemWindows, ViewGroup contentView, IPanelHeightTarget panelHeightTarget, OnKeyboardShowingListener listener, int screenHeight) { this.contentView = contentView; this.panelHeightTarget = panelHeightTarget; this.isFullScreen = isFullScreen; this.isTranslucentStatus = isTranslucentStatus; this.isFitSystemWindows = isFitSystemWindows; this.statusBarHeight = StatusBarHeightUtil.getStatusBarHeight(contentView.getContext()); this.keyboardShowingListener = listener; this.screenHeight = screenHeight; } @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) @Override public void onGlobalLayout() { final View userRootView = contentView.getChildAt(0); final View actionBarOverlayLayout = (View) contentView.getParent(); // Step 1. calculate the current display frame's height. Rect r = new Rect(); final int displayHeight; if (isTranslucentStatus) { // status bar translucent. // In the case of the Theme is Status-Bar-Translucent, we calculate the keyboard // state(showing/hiding) and the keyboard height based on assuming that the // displayHeight includes the height of the status bar. actionBarOverlayLayout.getWindowVisibleDisplayFrame(r); final int overlayLayoutDisplayHeight = (r.bottom - r.top); if (!isOverlayLayoutDisplayHContainStatusBar) { // in case of the keyboard is hiding, the display height of the // action-bar-overlay-layout would be possible equal to the screen height. // and if isOverlayLayoutDisplayHContainStatusBar has already been true, the // display height of action-bar-overlay-layout must include the height of the // status bar always. isOverlayLayoutDisplayHContainStatusBar = overlayLayoutDisplayHeight == screenHeight; } if (!isOverlayLayoutDisplayHContainStatusBar) { // In normal case, we need to plus the status bar height manually. displayHeight = overlayLayoutDisplayHeight + statusBarHeight; } else { // In some case(such as Samsung S7 edge), the height of the action-bar-overlay-layout // display bound already included the height of the status bar, in this case we // doesn't need to plus the status bar height manually. displayHeight = overlayLayoutDisplayHeight; } } else { userRootView.getWindowVisibleDisplayFrame(r); displayHeight = (r.bottom - r.top); } calculateKeyboardHeight(displayHeight); calculateKeyboardShowing(displayHeight); previousDisplayHeight = displayHeight; } private void calculateKeyboardHeight(final int displayHeight) { // first result. if (previousDisplayHeight == 0) { previousDisplayHeight = displayHeight; // init the panel height for target. panelHeightTarget.refreshHeight(KeyboardUtil.getValidPanelHeight(getContext())); return; } int keyboardHeight; if (KPSwitchConflictUtil.isHandleByPlaceholder(isFullScreen, isTranslucentStatus, isFitSystemWindows)) { // the height of content parent = contentView.height + actionBar.height final View actionBarOverlayLayout = (View) contentView.getParent(); keyboardHeight = actionBarOverlayLayout.getHeight() - displayHeight; Log.d(TAG, String.format("action bar over layout %d display height: %d", ((View) contentView.getParent()).getHeight(), displayHeight)); } else { keyboardHeight = Math.abs(displayHeight - previousDisplayHeight); } // no change. if (keyboardHeight <= getMinKeyboardHeight(getContext())) { return; } Log.d(TAG, String.format("pre display height: %d display height: %d keyboard: %d ", previousDisplayHeight, displayHeight, keyboardHeight)); // influence from the layout of the Status-bar. if (keyboardHeight == this.statusBarHeight) { Log.w(TAG, String.format("On global layout change get keyboard height just equal" + " statusBar height %d", keyboardHeight)); return; } // save the keyboardHeight boolean changed = KeyboardUtil.saveKeyboardHeight(getContext(), keyboardHeight); if (changed) { final int validPanelHeight = KeyboardUtil.getValidPanelHeight(getContext()); if (this.panelHeightTarget.getHeight() != validPanelHeight) { // Step3. refresh the panel's height with valid-panel-height which refer to // the last keyboard height this.panelHeightTarget.refreshHeight(validPanelHeight); } } } private int maxOverlayLayoutHeight; private void calculateKeyboardShowing(final int displayHeight) { boolean isKeyboardShowing; // the height of content parent = contentView.height + actionBar.height final View actionBarOverlayLayout = (View) contentView.getParent(); // in the case of FragmentLayout, this is not real ActionBarOverlayLayout, it is // LinearLayout, and is a child of DecorView, and in this case, its top-padding would be // equal to the height of status bar, and its height would equal to DecorViewHeight - // NavigationBarHeight. final int actionBarOverlayLayoutHeight = actionBarOverlayLayout.getHeight() - actionBarOverlayLayout.getPaddingTop(); if (KPSwitchConflictUtil.isHandleByPlaceholder(isFullScreen, isTranslucentStatus, isFitSystemWindows)) { if (!isTranslucentStatus && actionBarOverlayLayoutHeight - displayHeight == this.statusBarHeight) { // handle the case of status bar layout, not keyboard active. isKeyboardShowing = lastKeyboardShowing; } else { isKeyboardShowing = actionBarOverlayLayoutHeight > displayHeight; } } else { final int phoneDisplayHeight = contentView.getResources().getDisplayMetrics().heightPixels; if (!isTranslucentStatus && phoneDisplayHeight == actionBarOverlayLayoutHeight) { // no space to settle down the status bar, switch to fullscreen, // only in the case of paused and opened the fullscreen page. Log.w(TAG, String.format("skip the keyboard status calculate, the current" + " activity is paused. and phone-display-height %d," + " root-height+actionbar-height %d", phoneDisplayHeight, actionBarOverlayLayoutHeight)); return; } if (maxOverlayLayoutHeight == 0) { // non-used. isKeyboardShowing = lastKeyboardShowing; } else { isKeyboardShowing = displayHeight < maxOverlayLayoutHeight - getMinKeyboardHeight(getContext()); } maxOverlayLayoutHeight = Math.max(maxOverlayLayoutHeight, actionBarOverlayLayoutHeight); } if (lastKeyboardShowing != isKeyboardShowing) { Log.d(TAG, String.format("displayHeight %d actionBarOverlayLayoutHeight %d " + "keyboard status change: %B", displayHeight, actionBarOverlayLayoutHeight, isKeyboardShowing)); this.panelHeightTarget.onKeyboardShowing(isKeyboardShowing); if (keyboardShowingListener != null) { keyboardShowingListener.onKeyboardShowing(isKeyboardShowing); } } lastKeyboardShowing = isKeyboardShowing; } private Context getContext() { return contentView.getContext(); } } /** * The interface is used to listen the keyboard showing state. * * @see #attach(Activity, IPanelHeightTarget, OnKeyboardShowingListener) * @see KeyboardStatusListener#calculateKeyboardShowing(int) */ public interface OnKeyboardShowingListener { /** * Keyboard showing state callback method. * <p> * This method is invoked in {@link ViewTreeObserver.OnGlobalLayoutListener#onGlobalLayout()} which is one of the * ViewTree lifecycle callback methods. So deprecating those time-consuming operation(I/O, complex calculation, * alloc objects, etc.) here from blocking main ui thread is recommended. * </p> * * @param isShowing Indicate whether keyboard is showing or not. */ void onKeyboardShowing(boolean isShowing); } }
85405a9034807b77d7e25a0f8e4f131341fe5b94
e60b63393a7cef698038c891da4a0bea5f9e78b8
/fmkj-user/user-dao/src/main/java/com/fmkj/user/dao/domain/PmStrategy.java
39d90ed2a752597371bf992e9300fef700d26ded
[]
no_license
DaulYello/hammer-cloud
0b0877a8a59343ad08d27555e2255388ce548b4b
150ebe6817b8e5c6b575280a34b221fbc8c62097
refs/heads/master
2020-04-11T14:52:04.946749
2018-12-03T02:31:51
2018-12-03T02:31:51
161,871,494
0
1
null
null
null
null
UTF-8
Java
false
false
2,549
java
package com.fmkj.user.dao.domain; import com.baomidou.mybatisplus.enums.IdType; import java.util.Date; import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableField; import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.annotations.TableName; import java.io.Serializable; /** * <p> * * </p> * * @author youxun * @since 2018-11-21 */ @TableName("pm_strategy") public class PmStrategy extends Model<PmStrategy> { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id", type = IdType.AUTO) private Integer id; /** * 任务ID */ private Integer tid; /** * 攻略 */ private String strategy; /** * 顺序 */ @TableField("order_num") private Integer orderNum; /** * 创建时间 */ @TableField("create_date") private Date createDate; /** * 修改时间 */ @TableField("update_date") private Date updateDate; /** * 图片ID */ private Integer imageId; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getTid() { return tid; } public void setTid(Integer tid) { this.tid = tid; } public String getStrategy() { return strategy; } public void setStrategy(String strategy) { this.strategy = strategy; } public Integer getOrderNum() { return orderNum; } public void setOrderNum(Integer orderNum) { this.orderNum = orderNum; } public Date getCreateDate() { return createDate; } public void setCreateDate(Date createDate) { this.createDate = createDate; } public Date getUpdateDate() { return updateDate; } public void setUpdateDate(Date updateDate) { this.updateDate = updateDate; } public Integer getImageId() { return imageId; } public void setImageId(Integer imageId) { this.imageId = imageId; } @Override protected Serializable pkVal() { return this.id; } @Override public String toString() { return "PmStrategy{" + "id=" + id + ", tid=" + tid + ", strategy=" + strategy + ", orderNum=" + orderNum + ", createDate=" + createDate + ", updateDate=" + updateDate + ", imageId=" + imageId + "}"; } }
23c84566da72b462edff15a64945699930c82352
5ecda04c9500ec636a471d1e540afc63ce6a4479
/src/com/mxbc/util/PageModel.java
037f2a2764aef93445de464a57012dcdfe2fe908
[]
no_license
Ericwst/mxbc
362e969deddcfbf75fd893cd101280202018e0a8
57b4f8281453b85f4ab31602b0873aaea5248e35
refs/heads/master
2020-05-04T19:26:39.490512
2016-03-14T12:18:42
2016-03-14T12:18:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,379
java
package com.mxbc.util; import java.util.List; public class PageModel { //总记录数 private int totalRecords; //结果集 private List list; //当前页 private int pageNo; //每页显示多少条 private int pageSize; /** * 取得总页数 */ public int getTotalPages() { return (totalRecords + pageSize - 1) / pageSize; } //------------------> public int getTotalRecords() { return totalRecords; } public void setTotalRecords(int totalRecords) { this.totalRecords = totalRecords; } public List getList() { return list; } public void setList(List list) { this.list = list; } public int getPageSize() { return pageSize; } public void setPageSize(int pageSize) { this.pageSize = pageSize; } public int getPageNo() { return pageNo; } public void setPageNo(int pageNo) { this.pageNo = pageNo; } //------------------> /** * 取得第一页 */ public int getTopPageNo(){ return 1; } /** * 取得上一页 */ public int getPreviousPageNo(){ if(pageNo <= 1){ return 1; } return pageNo - 1; } /** * 取得下一页 */ public int getNextPageNo(){ if(pageNo >= getTotalPages()){ return getTotalPages() == 0 ? 1 : getTotalPages(); } return pageNo + 1; } /** * 取得最后一页 */ public int getBottomPageNo(){ return getTotalPages() == 0 ? 1 : getTotalPages(); } }
b0fa25e6983700a76614f4a3c85973bad8fe0592
575fd83e0668c117dc7aff9c8eae8cfb99fb752b
/app/build/generated/source/r/debug/android/support/coreui/R.java
28e86cfe2303cccb861f974d674423748bf6290d
[]
no_license
Ultrayano/Play-Tube
415429bddd0f4dd87ee6457b67b53e9b50e3eb2c
fb5f6dab4a82e5545cdf0e3e46ef1a06ab9efd97
refs/heads/dev
2021-08-28T13:45:37.356878
2017-12-05T14:50:22
2017-12-05T14:50:41
108,970,975
0
0
null
null
null
null
UTF-8
Java
false
false
7,610
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package android.support.coreui; public final class R { public static final class attr { public static final int font = 0x7f030099; public static final int fontProviderAuthority = 0x7f03009b; public static final int fontProviderCerts = 0x7f03009c; public static final int fontProviderFetchStrategy = 0x7f03009d; public static final int fontProviderFetchTimeout = 0x7f03009e; public static final int fontProviderPackage = 0x7f03009f; public static final int fontProviderQuery = 0x7f0300a0; public static final int fontStyle = 0x7f0300a1; public static final int fontWeight = 0x7f0300a2; } public static final class bool { public static final int abc_action_bar_embed_tabs = 0x7f040000; } public static final class color { public static final int notification_action_color_filter = 0x7f05004d; public static final int notification_icon_bg_color = 0x7f05004e; public static final int ripple_material_light = 0x7f050059; public static final int secondary_text_default_material_light = 0x7f05005b; } public static final class dimen { public static final int compat_button_inset_horizontal_material = 0x7f06004d; public static final int compat_button_inset_vertical_material = 0x7f06004e; public static final int compat_button_padding_horizontal_material = 0x7f06004f; public static final int compat_button_padding_vertical_material = 0x7f060050; public static final int compat_control_corner_material = 0x7f060051; public static final int notification_action_icon_size = 0x7f060088; public static final int notification_action_text_size = 0x7f060089; public static final int notification_big_circle_margin = 0x7f06008a; public static final int notification_content_margin_start = 0x7f06008b; public static final int notification_large_icon_height = 0x7f06008c; public static final int notification_large_icon_width = 0x7f06008d; public static final int notification_main_column_padding_top = 0x7f06008e; public static final int notification_media_narrow_margin = 0x7f06008f; public static final int notification_right_icon_size = 0x7f060090; public static final int notification_right_side_padding_top = 0x7f060091; public static final int notification_small_icon_background_padding = 0x7f060092; public static final int notification_small_icon_size_as_large = 0x7f060093; public static final int notification_subtext_size = 0x7f060094; public static final int notification_top_pad = 0x7f060095; public static final int notification_top_pad_large_text = 0x7f060096; } public static final class drawable { public static final int notification_action_background = 0x7f070064; public static final int notification_bg = 0x7f070065; public static final int notification_bg_low = 0x7f070066; public static final int notification_bg_low_normal = 0x7f070067; public static final int notification_bg_low_pressed = 0x7f070068; public static final int notification_bg_normal = 0x7f070069; public static final int notification_bg_normal_pressed = 0x7f07006a; public static final int notification_icon_background = 0x7f07006b; public static final int notification_template_icon_bg = 0x7f07006c; public static final int notification_template_icon_low_bg = 0x7f07006d; public static final int notification_tile_bg = 0x7f07006e; public static final int notify_panel_notification_icon_bg = 0x7f07006f; } public static final class id { public static final int action_container = 0x7f08000e; public static final int action_divider = 0x7f080010; public static final int action_image = 0x7f080011; public static final int action_text = 0x7f080017; public static final int actions = 0x7f080018; public static final int async = 0x7f08001e; public static final int blocking = 0x7f080021; public static final int chronometer = 0x7f08002a; public static final int forever = 0x7f080048; public static final int icon = 0x7f08004e; public static final int icon_group = 0x7f08004f; public static final int info = 0x7f080052; public static final int italic = 0x7f080053; public static final int line1 = 0x7f080057; public static final int line3 = 0x7f080058; public static final int normal = 0x7f080065; public static final int notification_background = 0x7f080066; public static final int notification_main_column = 0x7f080067; public static final int notification_main_column_container = 0x7f080068; public static final int right_icon = 0x7f080073; public static final int right_side = 0x7f080074; public static final int text = 0x7f08009c; public static final int text2 = 0x7f08009d; public static final int time = 0x7f0800a4; public static final int title = 0x7f0800a6; } public static final class integer { public static final int status_bar_notification_info_maxnum = 0x7f090009; } public static final class layout { public static final int notification_action = 0x7f0a002a; public static final int notification_action_tombstone = 0x7f0a002b; public static final int notification_template_custom_big = 0x7f0a0032; public static final int notification_template_icon_group = 0x7f0a0033; public static final int notification_template_part_chronometer = 0x7f0a0037; public static final int notification_template_part_time = 0x7f0a0038; } public static final class string { public static final int status_bar_notification_info_overflow = 0x7f0d002c; } public static final class style { public static final int TextAppearance_Compat_Notification = 0x7f0e0109; public static final int TextAppearance_Compat_Notification_Info = 0x7f0e010a; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0e010c; public static final int TextAppearance_Compat_Notification_Time = 0x7f0e010f; public static final int TextAppearance_Compat_Notification_Title = 0x7f0e0111; public static final int Widget_Compat_NotificationActionContainer = 0x7f0e0187; public static final int Widget_Compat_NotificationActionText = 0x7f0e0188; } public static final class styleable { public static final int[] FontFamily = { 0x7f03009b, 0x7f03009c, 0x7f03009d, 0x7f03009e, 0x7f03009f, 0x7f0300a0 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x7f030099, 0x7f0300a1, 0x7f0300a2 }; public static final int FontFamilyFont_font = 0; public static final int FontFamilyFont_fontStyle = 1; public static final int FontFamilyFont_fontWeight = 2; } }
58e97e99566fecc5b7060b53bca678f91ec58278
7454576f6f6d5ea2b95cccf4c14be3f794f0e5fd
/baselib/src/main/java/com/membership_score/baselib/base/SimpleFragment.java
63486f117e7bea2f0980c1ab57254acb48a3e60e
[]
no_license
yangkai987/Project
23ce1533670ae7c04be0279d7df39efa901e66a1
f4a1c326089ad81989a598e028e7a376e81a3888
refs/heads/master
2020-09-05T18:51:17.961557
2019-11-12T06:33:24
2019-11-12T06:33:24
220,184,841
0
0
null
null
null
null
UTF-8
Java
false
false
4,165
java
package com.membership_score.baselib.base; import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.support.annotation.IdRes; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; /** * Author : zhoujiulong * Email : [email protected] * Time : 2017/03/24 * Desc : SimpleFragment */ public abstract class SimpleFragment extends Fragment implements View.OnClickListener { protected final String TAG = this.getClass().getName(); protected Context mContext; protected Activity mActivity; protected View mRootView; @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mRootView = inflater.inflate(getLayoutId(), container, false); mContext = getActivity(); mActivity = getActivity(); return mRootView; } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); initView(mRootView); initPresenter(); attachView(); initListener(); initData(); getData(); mIsPrepared = true; if (getUserVisibleHint() && mIsFirstTimeLoadData) { mIsFirstTimeLoadData = false; getDataLazy(); } } @Override public void onDestroyView() { detachView(); mRootView = null; mContext = null; mActivity = null; super.onDestroyView(); } /* ********************************************** 初始化相关方法 **************************************************** */ /* ********************************************** 初始化相关方法 **************************************************** */ /** * 获取布局资源 id */ protected abstract int getLayoutId(); /** * 初始化控件 */ protected abstract void initView(View rootView); /** * 初始化逻辑处理层 */ protected abstract void initPresenter(); /** * 初始化监听事件 */ protected abstract void initListener(); /** * 初始化数据,设置数据 */ protected abstract void initData(); /** * 获取网络数据 */ protected abstract void getData(); /** * 懒加载数据在 ViewPager 管理的 Fragment 中才能使用 */ protected void getDataLazy() { } protected abstract void attachView(); protected abstract void detachView(); /** * 設置點擊 */ public void setOnClick(@IdRes int... viewIds) { if (viewIds != null) { for (int id : viewIds) { findViewById(id).setOnClickListener(this); } } } /** * 設置點擊 */ public void setOnClick(View... views){ if (views!=null) { for (View view:views){ view.setOnClickListener(this); } } } public <T extends View> T findViewById(@IdRes int viewId) { return mRootView.findViewById(viewId); } /* ********************************************** 懒加载数据在 ViewPager 管理的 Fragment 中才能使用 **************************************************** */ /* ********************************************** 懒加载数据在 ViewPager 管理的 Fragment 中才能使用 **************************************************** */ /** * 页面布局是否初始化完成 */ protected boolean mIsPrepared = false; /** * 是否是第一次加载数据 */ protected boolean mIsFirstTimeLoadData = true; @Override public void setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); if (isVisibleToUser && mIsFirstTimeLoadData && mIsPrepared) { mIsFirstTimeLoadData = false; getDataLazy(); } } }
2ee9635a9601d11c02662d6c474b29f7d76ada7f
4753b2d52fb0f892bef34c687bef26103aea3c2f
/app/src/main/java/com/example/a22175_000/phonelock/utils/ActivityMonitor.java
bf22907b0a5eff31e441affb1e40dd12e5721f58
[]
no_license
hupodaofeng/PhoneLock
a4ed3cbd71d350d50f396eb82042a0104578358f
2deb85f2a8a5f291e10f45e673967b2b8885b6ea
refs/heads/master
2021-01-20T04:43:07.472097
2017-04-28T15:57:44
2017-04-28T15:57:44
89,721,916
0
0
null
null
null
null
UTF-8
Java
false
false
2,546
java
package com.example.a22175_000.phonelock.utils; import android.app.ActivityManager; import android.app.usage.UsageStats; import android.app.usage.UsageStatsManager; import android.content.Context; import android.os.Build; import java.util.List; /** * Created by 22175_000 on 2017/2/6. */ public class ActivityMonitor { private static ActivityManager activityManager; private static ActivityMonitor activityMonitor = new ActivityMonitor(); private static Context mContext; private ActivityMonitor() { } public static ActivityMonitor getInstantiation(Context context) { mContext = context; activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); return activityMonitor; } /** * 获取当前显示的activity包名 * * @return String packageName */ public String getCurrentShowActiPgNm() { String packageName = ""; int j = 0; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { UsageStatsManager usageStatsManager = (UsageStatsManager) mContext.getSystemService(Context.USAGE_STATS_SERVICE); long endTime = System.currentTimeMillis(); long startTime = endTime - 60 * 1000; List<UsageStats> usageStatsList = usageStatsManager.queryUsageStats(UsageStatsManager.INTERVAL_BEST , startTime, endTime); if (usageStatsList.size() != 0 || !usageStatsList.isEmpty()) { for (int i = 0; i < usageStatsList.size(); i++) { if (usageStatsList.get(i).getLastTimeUsed() > usageStatsList.get(j).getLastTimeUsed()) { j = i; break; } } packageName = usageStatsList.get(j).getPackageName(); } } else { List<ActivityManager.RunningTaskInfo> runningTaskInfos = activityManager.getRunningTasks(1); ActivityManager.RunningTaskInfo runningTaskInfo = runningTaskInfos.get(0); packageName = runningTaskInfo.topActivity.getPackageName(); } return packageName; } /** * 获取系统正在运行的进程 * @return * List<ActivityManager.RunningAppProcessInfo> */ public List<ActivityManager.RunningAppProcessInfo> getRunningProgress() { List<ActivityManager.RunningAppProcessInfo> runningAppProcesses = activityManager.getRunningAppProcesses(); return runningAppProcesses; } }
f09531482dd6b04ee7ec9dc8d56d64c226956b59
813b43ac436b0d45a69992c35a20470c2041fdd6
/app/src/main/java/org/mrcpp/ecv/SplashScreenActivity.java
6c53ba8c7cb3d061629cddbbbf19df3c0b956e27
[]
no_license
evanhutomo/ECV
f37a9f5a5ef6e3a1150235a00eae50f6cd7121f3
821f3cee9c5f7b561db36b8135a6f7c77ddb30ea
refs/heads/master
2020-04-08T14:41:49.813532
2017-11-16T06:59:48
2017-11-16T06:59:48
38,120,393
1
0
null
null
null
null
UTF-8
Java
false
false
640
java
package org.mrcpp.ecv; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; public class SplashScreenActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash_screen); new Handler().postDelayed(new Runnable() { @Override public void run() { startActivity(new Intent(SplashScreenActivity.this, MainActivity.class)); finish(); } }, 2000); // 2 seconds } }
79fe776216c362780b6ed692a3c07d6555c876c5
9e229b1f734f256e85ed44f1278cff39af02c030
/front/src/util/Util.java
51bec1a6acb8af9fab19e43bde51d96ffc3b8ef3
[]
no_license
PPiedel/Compiler
573e6578f4ad6a4d0713ae71b6673410c4132ec2
9451d32c6b28707778e4b430e2455e705633175c
refs/heads/master
2020-03-16T04:23:31.490997
2018-06-11T08:24:52
2018-06-11T08:24:52
132,510,212
0
0
null
null
null
null
UTF-8
Java
false
false
325
java
package util; import java.io.*; public class Util { public static void writeIRToFile(String iR, File file){ try( BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file))){ bufferedWriter.write(iR); } catch (IOException e) { e.printStackTrace(); } } }
58ef5d7006be826453db7a8940def01ba03d777b
a3d87a5ea89fc5815daf2c9739fc67922fa2ad0c
/src/gamemodel/Tile_Line.java
ed16bafdd0513bad4de909042593de4d3822a7c8
[]
no_license
Boy-Blu/Match-3
58683530748b63c6db6eb463f00e74d9e7f9c5a9
b8d2e543b23d05792a3c927a1bd9a6573d42a979
refs/heads/master
2020-03-21T16:51:30.863007
2018-11-14T21:20:50
2018-11-14T21:20:50
138,797,901
2
0
null
null
null
null
UTF-8
Java
false
false
660
java
package gamemodel; public class Tile_Line extends Tile{ boolean direction;// Going Vertically or Horizontal public Tile_Line(int col, boolean direction) { if(col < 0 || col > 7) throw new IllegalArgumentException(); this.color = col; this.direction = direction; this.sr = new Remove_Strat_Line(); } @Override public int getColour() { // TODO Auto-generated method stub return this.color; } @Override public Type getType() { // TODO Auto-generated method stub return Type.LINE; } /** * Get the direction of the line, True for vertical * @return direction */ public boolean getDirection() { return direction; } }
fa705c220491acb7678b736ecc504eef96566ddc
aef4cf984f733a5236261672a6d3e4189b5cdb48
/Generics/src/com/Madina/generics/UserList.java
c8a440adf53015d22a7b7a4ae92d75bd5ed5506c
[]
no_license
MadinaZ/Java
57a7828dfeab00f7d13b841f7a4f9a7f7d415cda
446506b806203155efaa8740e4a6ffc1d1c0da76
refs/heads/master
2023-06-12T07:40:34.952381
2021-06-24T09:44:50
2021-06-24T09:44:50
285,480,595
1
0
null
null
null
null
UTF-8
Java
false
false
120
java
package com.Madina.generics; public class UserList { private User[] items = new User[10]; private int count; }
047afce0f7ed8fc034919063b18170735df871a7
5ce14a17ac211f5cae3574cbf4dd9e379050735d
/StarterPreperation/src/main/Problem1.java
af57415c8c93a606acea8ca1f9274781a9031ee6
[]
no_license
mrinal10/starter
d6c53ec963fe7d652d4bbdcff26dce3bb5a3b8f6
a88aa2aa1ed0faa5742edf03edd4cef4c0d85424
refs/heads/master
2021-08-07T15:47:04.163055
2021-06-12T11:55:17
2021-06-12T11:55:17
200,126,423
0
0
null
null
null
null
UTF-8
Java
false
false
1,574
java
class LinkedListNode{ int data; LinkedListNode next; public LinkedListNode(int v) { data = v; next = null; } } public class Problem1 { private static int getIntersectionPoint(LinkedListNode head1, LinkedListNode head2){ int length1 = getLen(head1); int length2 = getLen(head2); int diff = 0; if(length1>length2){ diff = length1 - length2; return diffVaue(diff, head1, head2); }else{ diff = length2 - length1; return diffVaue(diff, head2, head1); } } private static int diffVaue(int diff, LinkedListNode node1, LinkedListNode node2){ LinkedListNode cur1 = node1; while(diff-->0){ cur1 = cur1.next; } LinkedListNode cur2 = node2; while(cur1.next!=cur2.next){ cur1 = cur1.next; cur2 = cur2.next; } if(cur1.next!=null) return cur1.next.data; else return -1; } private static int getLen(LinkedListNode head){ int cnt=0; LinkedListNode cur = head; while(cur.next!=null){ cur = cur.next; cnt++; } return cnt; } public static void main(String[] args) { LinkedListNode midNode = new LinkedListNode(15); midNode.next = new LinkedListNode(30); LinkedListNode fNode = new LinkedListNode(3); LinkedListNode fNode2 = new LinkedListNode(6); fNode.next = fNode2; LinkedListNode fNode3 = new LinkedListNode(9); fNode2.next = fNode3; fNode3.next = midNode; LinkedListNode sNode = new LinkedListNode(10); sNode.next = midNode; System.out.println(getIntersectionPoint(fNode, sNode)); } }
22b8a45cf38153c7c2533a6c9ef40785042b752c
eb885611ec43870cc4171ee8f8a46f4a360f4573
/src/main/java/pl/gov/hackathon/teamoutofboundsexception/server/integration/pojo/Attributes.java
993d144c69ce1e94d0a865c153d8ca372a59b80b
[ "MIT" ]
permissive
teamoutofboundsexception/backend
41be19e0148aa8aa56c5096e68b23eb45bb5d5ef
d294bf95287b84a97843baca99d7239b899769c3
refs/heads/master
2020-06-04T17:36:56.278807
2019-06-22T06:53:04
2019-06-22T06:53:04
192,127,416
0
0
MIT
2019-06-19T20:30:53
2019-06-15T22:01:22
Java
UTF-8
Java
false
false
373
java
package pl.gov.hackathon.teamoutofboundsexception.server.integration.pojo; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; @Data @JsonIgnoreProperties(ignoreUnknown = true) public class Attributes { public String format; public int file_size; public String title; public String download_url; public String file_url; }
b1ac6bc1a2f2b9f0ccdc35f537cdd2c94476790b
958189eb5791dfb91ab1a503487011cdd9d4edd5
/src/servlet/KorisniciServlet.java
29ef06fc24ac80d08919c3f4ee0228f9c2e1cd07
[]
no_license
DzenitaAdzic/kviz
8c0d779a46a35477b826559153e199b8b0f0d35e
7798bccd2635bbc9fc7cba54112bfe4cfaf83131
refs/heads/master
2020-12-02T06:23:56.450058
2017-07-10T22:29:23
2017-07-10T22:29:23
96,826,500
0
0
null
null
null
null
UTF-8
Java
false
false
859
java
package servlet; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/admin/korisnik") public class KorisniciServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public KorisniciServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.getRequestDispatcher("/korisnici.html").forward(request, response); } }
41308895f76ebdfd75559a2cfc23763077d46df3
d6e87e8a37cefa18121f3c19b0eafe1cd606c6b0
/src/GUI/jTable1.java
cf0b0fb13dd7685d4eb8f25c0950c38fc5b7b763
[]
no_license
Eminemhehe/Qingxiu-mountain-tourist-intelligent-management-system
7aedde1d1d466509d094283ee821f4ab4dfdbdba
a0ec1c944e892bb2e2c4a55a0a7a0494c04a9871
refs/heads/master
2020-05-03T01:15:39.298059
2019-03-29T04:29:48
2019-03-29T04:29:48
178,332,316
1
0
null
null
null
null
UTF-8
Java
false
false
247
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package GUI; /** * * @author wz */ class jTable1 { }
07a70c4ed79726174bbb1a86931b7312784c9ca1
c54062a41a990c192c3eadbb9807e9132530de23
/solutions/lambdaintro/src/main/java/lambdaintro/BankAccount.java
fd06ed0d1a0c1d6baf4282dd61d7a94b68382a5b
[]
no_license
Training360/strukturavalto-java-public
0d76a9dedd7f0a0a435961229a64023931ec43c7
82d9b3c54437dd7c74284f06f9a6647ec62796e3
refs/heads/master
2022-07-27T15:07:57.915484
2021-12-01T08:57:06
2021-12-01T08:57:06
306,286,820
13
115
null
null
null
null
UTF-8
Java
false
false
733
java
package lambdaintro; public class BankAccount implements Comparable<BankAccount> { private String accountNumber; private String nameOfOwner; private double balance; public BankAccount(String accountNumber, String nameOfOwner, double balance) { this.accountNumber = accountNumber; this.nameOfOwner = nameOfOwner; this.balance = balance; } public String getNameOfOwner() { return nameOfOwner; } public String getAccountNumber() { return accountNumber; } public double getBalance() { return balance; } @Override public int compareTo(BankAccount another) { return accountNumber.compareTo(another.accountNumber); } }
334796372506693089834269d4af609c54398b81
7ff9a9a306eff547c81b81cd3dfd3df8436cf9d8
/OwlTranslator/src/test/java/test/testhtmlParser.java
3fd76cc61f19c201598b98fd15cd41c451cb3623
[]
no_license
zYmMiJ/websemantic
c893486c7d7340133c6eae20320f94ead96e89eb
b219bd4eb717d0d4fb79f8926242dcc92d4c0982
refs/heads/master
2022-09-17T05:03:44.640390
2019-06-22T02:43:51
2019-06-22T02:43:51
226,838,939
0
0
null
2022-09-01T23:16:56
2019-12-09T09:55:43
HTML
UTF-8
Java
false
false
1,218
java
package test; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.junit.Test; import junit.framework.TestCase; import translator.DataParsed; import translator.HtmlParser; public class TestHtmlParser extends TestCase { @Test public final void testConnnectionHTMLinDataToList() { List<DataParsed> dataparsedHTML_goodLink = new ArrayList<DataParsed>(); List<DataParsed> dataparsedHTML_existentLink = new ArrayList<DataParsed>(); HtmlParser h_goodLink = new HtmlParser("https://gforge.inria.fr/plugins/mediawiki/wiki/lazylav/index.php/20180828-NOOR"); dataparsedHTML_goodLink = h_goodLink.dataToList(); assertFalse("Bon lien genere une liste vide.", dataparsedHTML_goodLink.isEmpty() ); assertFalse("Bon lien ne genere pas de liste.", dataparsedHTML_goodLink == null ); } @Test(expected = IOException.class) public final void testshould_throw_IOException_testdataToList() throws IOException{ /* HtmlParser h_existentLink = new HtmlParser("https://gforge.inria.fr"); HtmlParser h_badLink = new HtmlParser("mauvaisLiens"); HtmlParser h_nullLink = new HtmlParser(null);*/ } }
27a636324472aa8cc6a931b07e5c33bd89fff8d0
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/tencent/mm/ui/base/h$15.java
a87c6eb362078161601ca15c7caf9319e1cc140d
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
935
java
package com.tencent.mm.ui.base; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import com.tencent.matrix.trace.core.AppMethodBeat; import java.lang.ref.WeakReference; final class h$15 implements DialogInterface.OnCancelListener { h$15(WeakReference paramWeakReference) { } public final void onCancel(DialogInterface paramDialogInterface) { AppMethodBeat.i(106419); DialogInterface.OnCancelListener localOnCancelListener = (DialogInterface.OnCancelListener)this.ytD.get(); if (localOnCancelListener != null) localOnCancelListener.onCancel(paramDialogInterface); y.activateBroadcast(false); AppMethodBeat.o(106419); } } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes-dex2jar.jar * Qualified Name: com.tencent.mm.ui.base.h.15 * JD-Core Version: 0.6.2 */
b0b8a41b764355adb88c4688c8544f405ef510e0
dd7d98aab31377017de4a567905359a59985bd01
/src/main/java/com/spring/main/MainForSpring.java
f7ac5ee4195116b122577c154ac943bb63a30c43
[]
no_license
JiHyun9/springframework
a84cf8c08f75238f00bc0aa5837274bb75c59e31
9d7431ca301bdde03c06ef60c7c3b6f31ef3a2bf
refs/heads/master
2021-03-01T16:56:37.995986
2020-03-08T12:36:43
2020-03-08T12:36:43
245,800,068
0
0
null
null
null
null
UTF-8
Java
false
false
4,087
java
package com.spring.main; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import com.spring.assembler.Assembler; import com.spring.config.AppCtx; import com.spring.java.ChangePasswordService; import com.spring.java.DuplicateMemberException; import com.spring.java.MemberInfoPrinter; import com.spring.java.MemberListPrinter; import com.spring.java.MemberNotFoundException; import com.spring.java.MemberRegisterService; import com.spring.java.RegisterRequest; import com.spring.java.VersionPrinter; import com.spring.java.WrongIdPasswordException; public class MainForSpring { //private static Assembler assembler = new Assembler(); private static ApplicationContext ctx = null; public static void main(String[] args) throws IOException{ // TODO Auto-generated method stub ctx = new AnnotationConfigApplicationContext(AppCtx.class); BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); while(true) { System.out.println("명령어를 입력하세요:"); String command = reader.readLine(); if(command.equalsIgnoreCase("exit")) { System.out.println("종료합니다."); break; } if(command.startsWith("new ")) { processNewCommand(command.split(" ")); // split된 배열 전달 continue; } else if (command.startsWith("change ")) { processChangeCommand(command.split(" ")); continue; } else if(command.equals("list")) { processListCommand(); continue; } else if(command.startsWith("info")) { processInfoCommand(command.split(" ")); continue; } else if(command.equals("version")) { processVersionCommand(); continue; } printHelp(); } } //member 신규 생성, 배열로 전달 private static void processNewCommand(String[] arg) { if(arg.length != 5) { printHelp(); return; } // MemberRegisterService regSvc=assembler.getMemberRegisterService(); MemberRegisterService regSvc=ctx.getBean("memberRegSvc", MemberRegisterService.class); RegisterRequest req = new RegisterRequest(); req.setEmail(arg[1]); req.setName(arg[2]); req.setPassword(arg[3]); req.setConfirmPassword(arg[4]); if(!req.isPasswordEqualToConfirmPassword()) { System.out.println("암호와 확인이 일치하지 않습니다.\n"); return; } try { regSvc.regist(req); System.out.println("등록했습니다\n"); } catch (DuplicateMemberException e){ System.out.println("이미 존재하는 이메일입니다."); } } private static void processChangeCommand(String[] arg) { if(arg.length!=4) { printHelp(); return; } // ChangePasswordService changePwdSvc = assembler.getChangePasswordService(); ChangePasswordService changePwdSvc = ctx.getBean("changePwdSvc", ChangePasswordService.class); try { changePwdSvc.changePasswordService(arg[1], arg[2], arg[3]); System.out.println("암호를 변경했습니다.\n"); } catch (MemberNotFoundException e) { System.out.println("존재하지 않는 메일입니다.\n"); } catch (WrongIdPasswordException e) { System.out.println("이메일과 암호가 일치하지 않습니다.\n"); } } private static void processListCommand() { MemberListPrinter listPrinter=ctx.getBean("listPrinter", MemberListPrinter.class); listPrinter.printAll(); } private static void processInfoCommand(String [] arg) { if(arg.length!=2) { printHelp(); return; } MemberInfoPrinter infoPrinter=ctx.getBean("infoPrinter", MemberInfoPrinter.class); infoPrinter.printMemberInfoPrinter(arg[1]); } private static void processVersionCommand() { VersionPrinter versionPrinter=ctx.getBean("versionPrinter", VersionPrinter.class); versionPrinter.print(); } public static void printHelp() { System.out.println("printHelp...\n"); System.out.println("new 이메일 이름 암호 암호확인"); System.out.println("change 이메일 현재비번 변경비번"); } }
ce00ae5edf9d98b5d4c70a4c5cd6ac8529d43cb8
bccb412254b3e6f35a5c4dd227f440ecbbb60db9
/hl7/model/V2_5/table/Table0182.java
5443f560c6a394e771ca7dcf45bc06a2ee4c2822
[]
no_license
nlp-lap/Version_Compatible_HL7_Parser
8bdb307aa75a5317265f730c5b2ac92ae430962b
9977e1fcd1400916efc4aa161588beae81900cfd
refs/heads/master
2021-03-03T15:05:36.071491
2020-03-09T07:54:42
2020-03-09T07:54:42
245,967,680
0
0
null
null
null
null
UTF-8
Java
false
false
335
java
package hl7.model.V2_5.table; import hl7.bean.table.Table; public class Table0182 extends Table{ private static final String VERSION = "2.5"; public static Table getInstance(){ if(table==null) new Table0182(); return table; } private Table0182(){ setTableName("Staff type"); setOID("2.16.840.1.113883.12.182"); } }
5da2af6223f3cc12e8a6c532df33f9877fc0079b
b6cb55c0dc6dd775805ff393b18daefa70c88c0f
/Express/src/kyle/leis/eo/operation/housewaybill/da/HousewaybillforreportQuery.java
f1e8ce2c6591c40b1a5bb7b899eb28a8332a1e96
[]
no_license
haha541514/Express
d12ec127df2c6137792ef2724ac2239a27f0dd86
72e59fdea51fdba395f52575918ef1972e357cec
refs/heads/master
2021-04-03T06:50:28.984407
2018-03-08T09:04:09
2018-03-08T09:06:50
124,365,014
2
1
null
null
null
null
UTF-8
Java
false
false
16,116
java
package kyle.leis.eo.operation.housewaybill.da; import kyle.common.dbaccess.query.IColumns; import kyle.common.dbaccess.query.JGeneralQuery; public class HousewaybillforreportQuery extends JGeneralQuery { public HousewaybillforreportQuery(){ m_strSelectClause = "SELECT hw.CW_CODE,hw.HW_SIGNINDATE,hw.HW_OP_ID_SIGNIN,siop.OP_NAME, hw.HW_OP_ID_WEIGHTING,hw.HW_SIGNOUTDATE,hw.HW_OP_ID_SIGNOUT,soop.OP_NAME,hw.HW_RECORDDATE,hw.HW_OP_ID_RECORD,rcop.OP_NAME,hw.HW_OP_ID_PACKING,hw.HW_INSURANCEVALUE,hw.HW_CONSIGNEEPOSTCODE,cw.CW_POSTCODE_DESTINATION,cw.CW_PIECES,cw.CW_GROSSWEIGHT,cw.CW_CHARGEWEIGHT,cw.CW_TRANSFERPIECES,cw.CW_TRANSFERGROSSWEIGHT,cw.CW_TRANSFERCHARGEWEIGHT,cw.CW_SERVERCHARGEWEIGHT,cw.CW_CUSTOMEREWBCODE,cw.CW_SERVEREWBCODE,cw.CW_EWBCODE,cw.CW_TRANSFERVOLUMEWEIGHT,cws.CWS_CODE,cws.CWS_NAME,ee.EE_CODE,ee.EE_SNAME,ee.EE_ESNAME,pk.PK_CODE,pk.PK_NAME,pk.PK_SNAME,pk.PK_SENAME,ddt.DT_CODE,ddt.DT_HUBCODE,ddt.DT_NAME,sdt.DT_CODE,sdt.DT_HUBCODE,sdt.DT_NAME,cddt.DT_CODE,cddt.DT_HUBCODE,cddt.DT_NAME,odt.DT_CODE,odt.DT_HUBCODE,odt.DT_NAME,pm.PM_CODE,pm.PM_NAME,schn.CHN_CODE,schn.CHN_NAME,schn.CHN_SNAME,cchn.CHN_CODE,cchn.CHN_NAME,cchn.CHN_SNAME,ct.CT_CODE,ct.CT_NAME,sco.CO_CODE,sco.CO_NAME,sco.CO_SNAME,sco.CO_LABELCODE,cco.CO_CODE,cco.CO_NAME,cco.CO_SNAME,cco.CO_LABELCODE,abw.BW_CODE,abw.BW_LABELCODE,abw.ADD_DATE,dbw.BW_CODE,dbw.BW_LABELCODE,dbw.ADD_DATE,cw.CW_CUSTOMERCHARGEWEIGHT,ihs.IHS_CODE,ihs.IHS_NAME,cw.CW_VOLUMERATE,cw.CW_TRANSFERVOLUMERATE,hw.HW_REMARK,cct.CT_CODE,cct.CT_NAME,csop.OP_ID,csop.OP_NAME,(select cp.cp_Baglabelcode from t_op_corewaybillpieces cp where cp.cw_code = cw.cw_code and rownum < 2) as baglabelcode,ssop.OP_ID,ssop.OP_NAME,cw.znv_Name,cofs.fs_balanceamount + cm.cm_creditlimit as cobalanceamount, FUN_GET_VolumeWeight(hw.CW_CODE) as Volumeweight,hw.HW_OP_ID_WEIGHTCHECK,hwop.op_name,hw.HW_WEIGHTCHECKDATE,decode(nvl(hw.HW_WEIGHTCHECKKIND,'U'),'U','','P','','N','') as HW_WEIGHTCHECKKIND,wcbw.bw_labelcode,cw.cw_Billcounts,cw.cw_Bagcounts,dunop.OP_ID,dunop.OP_NAME,FUN_GET_SPECIALTYTYPE(hw.CW_CODE) as specialtype,FUN_GET_COREWAYBILLPIECESLWH(hw.CW_CODE) as piecelhw FROM T_OP_HOUSEWAYBILL hw,T_OP_COREWAYBILL cw,T_DI_COREWAYBILLSTATUS cws,T_DI_ENTERPRISEELEMENT ee,T_DI_PRODUCTKIND pk,T_DI_DISTRICT ddt,T_DI_DISTRICT cddt, T_DI_DISTRICT sdt, T_DI_DISTRICT odt,T_DI_PAYMENTMODE pm,T_CHN_CHANNEL schn,T_CHN_CHANNEL cchn, T_DI_CARGOTYPE ct,T_CO_CORPORATION sco, T_CO_CORPORATION cco, T_CO_CUSTOMER cm,t_co_financialstatistics cofs,T_DI_CUSTOMERTYPE cct,T_DI_OPERATOR csop,T_DI_OPERATOR ssop,T_DI_OPERATOR dunop,T_DI_OPERATOR siop,T_DI_OPERATOR soop,T_DI_OPERATOR rcop,T_DI_OPERATOR hwop,T_OP_BATCHWAYBILL abw,T_OP_BATCHWAYBILL dbw,T_OP_BATCHWAYBILL wcbw,T_DI_ISSUEHOLDSTATUS ihs"; m_strWhereClause = "hw.CW_CODE = cw.CW_CODE and cw.CWS_CODE = cws.CWS_CODE and cw.EE_CODE = ee.EE_CODE and cw.PK_CODE = pk.PK_CODE and cw.DT_CODE_DESTINATION = ddt.DT_CODE(+) and ddt.DT_COUNTCODE = cddt.DT_CODE(+) and cw.DT_CODE_SIGNIN = sdt.DT_CODE(+) and cw.DT_CODE_ORIGIN = odt.DT_CODE and cw.PM_CODE = pm.PM_CODE and cw.CHN_CODE_SUPPLIER = schn.CHN_CODE(+) and cw.CHN_CODE_CUSTOMER = cchn.CHN_CODE(+) and cw.CT_CODE = ct.CT_CODE and cw.CO_CODE_SUPPLIER = sco.CO_CODE(+) and cw.CO_CODE_CUSTOMER = cco.CO_CODE(+) and cco.CO_CODE = cm.CO_CODE(+) and cco.co_code = cofs.co_code(+) and cm.CT_CODE = cct.CT_CODE(+) and cm.CM_OP_ID_CSERVICE = csop.OP_ID(+) and cm.cm_op_id_sale = ssop.OP_ID(+) and cm.cm_op_id_dun = dunop.OP_ID(+) and hw.HW_OP_ID_SIGNIN = siop.OP_ID(+) and hw.HW_OP_ID_SIGNOUT = soop.OP_ID(+) and hw.HW_OP_ID_RECORD = rcop.OP_ID(+) and hw.hw_op_id_weightcheck = hwop.op_id(+) and cw.BW_CODE_ARRIVAL = abw.BW_CODE(+) and cw.BW_CODE_DEPARTURE = dbw.BW_CODE(+) and cw.bw_code_weightcheck = wcbw.bw_code(+) and cw.IHS_CODE = ihs.IHS_CODE(+) and cm.ct_code = cct.ct_code"; m_strOrderByClause = ""; m_strGroupByClause = ""; m_astrConditionWords = new String[] { "cw.CW_CUSTOMEREWBCODE = '~~'", "cw.CW_SERVEREWBCODE = '~~'", "cw.CW_EWBCODE = '~~'", "hw.hw_Signindate >= to_date('~~','yyyy-mm-dd hh24:mi:ss')", "to_date('~~','yyyy-mm-dd hh24:mi:ss') >= hw.hw_Signindate", "hw.hw_Signoutdate >= to_date('~~','yyyy-mm-dd hh24:mi:ss')", "to_date('~~','yyyy-mm-dd hh24:mi:ss') >= hw.hw_Signoutdate", "hw.hw_Recorddate >= to_date('~~','yyyy-mm-dd hh24:mi:ss')", "to_date('~~','yyyy-mm-dd hh24:mi:ss') >= hw.hw_Recorddate", "cw.cw_Chargeweight >= ~~", "~~ >= cw.cw_Chargeweight", "cw.cw_Serverchargeweight >= ~~", "~~ >= cw.cw_Serverchargeweight", "cws.cws_Code in (~~)", "cws.cws_Code not in (~~)", "pk.pk_Code = '~~'", "ddt.dt_Code = '~~'", "cddt.dt_Code = '~~'", "odt.dt_Code = '~~'", "pm.pm_Code = '~~'", "schn.chn_Code = '~~'", "ct.ct_Code = '~~'", "sco.co_Code = '~~'", "cco.co_Code = '~~'", "abw.bw_Labelcode = '~~'", "dbw.bw_Labelcode = '~~'", "hw.cw_Code = ~~", "ee.ee_Code = '~~'", "csop.op_Id = ~~", "ssop.op_Id = ~~", "hw.hw_op_id_record = ~~", "hw.hw_op_id_signin = ~~", "ihs.ihs_Code = '~~'", "cw.znv_Name = '~~'", "exists (select cp.cp_Id from t_op_corewaybillpieces cp where cp.cw_Code = hw.cw_Code and cp.cp_Baglabelcode in (~~))", "exists (select wst.cw_Code from t_op_waybillspecialtype wst where wst.cw_Code = hw.cw_Code and wst.est_code in (~~))", "abw.ADD_DATE >= to_date('~~','yyyy-mm-dd hh24:mi:ss')", "to_date('~~','yyyy-mm-dd hh24:mi:ss') >= abw.ADD_DATE", "exists (select twv.twb_id from t_op_transportwaybillvalue twv, t_op_transportwaybill tw,t_op_batchwaybill bw,t_op_corewaybillpieces cwp where twv.twb_id = tw.twb_id and twv.bw_code = bw.bw_code and twv.twbv_baglabelcode = cwp.cp_baglabelcode and bw.bw_code = cw.bw_code_departure and cw.cw_code = cwp.cw_code and tw.twb_labelcode = '~~')", "(cw.CW_CUSTOMEREWBCODE in (~~) OR cw.CW_SERVEREWBCODE in (~~))", "(cco.CO_CarryoverSign = '~~' OR cco.CO_CarryoverDate > cw.cw_createdate)", "(cco.CO_CarryoverSign = '~~' AND cw.cw_createdate > cco.CO_CarryoverDate)", "cofs.fs_carryoverenterprise = '~~'", "~~ >= cw.cw_chargeweight", "cw.cw_chargeweight >= ~~", "ee.ee_Structurecode like '~~%'", "hw.HW_OP_ID_WEIGHTCHECK = ~~", "hw.HW_WEIGHTCHECKDATE >= to_date('~~','yyyy-mm-dd hh24:mi:ss')", "to_date('~~','yyyy-mm-dd hh24:mi:ss') >= hw.HW_WEIGHTCHECKDATE", "nvl(hw.HW_WEIGHTCHECKKIND,'U') = '~~'", "wcbw.bw_labelcode = '~~'", "cw.cw_Batchwaybillsign = '~~'", "exists (select wbt.wbt_id from t_cs_waybilltrack wbt where wbt.cw_code = hw.cw_code and wbt.wbts_code = 'AFF' and wbt.wbt_district = '719' and wbt.wbt_createdate >= to_date('~~','yyyy-mm-dd hh24:mi:ss') and to_date('~~','yyyy-mm-dd hh24:mi:ss') >= wbt.wbt_createdate)", "exists (select cp.cp_Id from t_op_corewaybillpieces cp where cp.cw_Code = hw.cw_Code and cp.cp_Sibaglabelcode = '~~')", "cct.ct_Code= '~~'" }; m_aiConditionVariableCount = new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1 }; } @Override public IColumns createColumns() { // TODO Auto-generated method stub return new HousewaybillforreportColumns(); } public void setCustomerewbcode(String Customerewbcode) { this.setField(0, Customerewbcode); } public String getCustomerewbcode() { return this.getField(0); } public void setServerewbcode(String Serverewbcode) { this.setField(1, Serverewbcode); } public String getServerewbcode() { return this.getField(1); } public void setEwbcode(String Ewbcode) { this.setField(2, Ewbcode); } public String getEwbcode() { return this.getField(2); } public void setStartsignindate(String StartSignindate) { this.setField(3, StartSignindate); } public String getStartsignindate() { return this.getField(3); } public void setEndsignindate(String EndSignindate) { this.setField(4, EndSignindate); } public String getEndsignindate() { return this.getField(4); } public void setStartsignoutdate(String StartSignoutdate) { this.setField(5, StartSignoutdate); } public String getStartsignoutdate() { return this.getField(5); } public void setEndsignoutdate(String EndSignoutdate) { this.setField(6, EndSignoutdate); } public String getEndsignoutdate() { return this.getField(6); } public void setStartrecorddate(String StartRecorddate) { this.setField(7, StartRecorddate); } public String getStartrecorddate() { return this.getField(7); } public void setEndrecorddate(String EndRecorddate) { this.setField(8, EndRecorddate); } public String getEndrecorddate() { return this.getField(8); } public void setStartchargeweight(String StartChargeweight) { this.setField(9, StartChargeweight); } public String getStartchargeweight() { return this.getField(9); } public void setEndchargeweight(String EndChargeweight) { this.setField(10, EndChargeweight); } public String getEndchargeweight() { return this.getField(10); } public void setStartserverchargeweight(String StartServerchargeweight) { this.setField(11, StartServerchargeweight); } public String getStartserverchargeweight() { return this.getField(11); } public void setEndserverchargeweight(String EndServerchargeweight) { this.setField(12, EndServerchargeweight); } public String getEndserverchargeweight() { return this.getField(12); } public void setCwscode(String cwsCode) { this.setField(13, cwsCode); } public String getCwscode() { return this.getField(13); } public void setNotcwscode(String NotcwsCode) { this.setField(14, NotcwsCode); } public String getNotcwscode() { return this.getField(14); } public void setPkcode(String pkCode) { this.setField(15, pkCode); } public String getPkcode() { return this.getField(15); } public void setDesdtcode(String DesDtCode) { this.setField(16, DesDtCode); } public String getDesdtcode() { return this.getField(16); } public void setDescountrycode(String DesCountryCode) { this.setField(17, DesCountryCode); } public String getDescountrycode() { return this.getField(17); } public void setOrigindtcode(String OriginDtCode) { this.setField(18, OriginDtCode); } public String getOrigindtcode() { return this.getField(18); } public void setPmcode(String pmCode) { this.setField(19, pmCode); } public String getPmcode() { return this.getField(19); } public void setChncode(String chnCode) { this.setField(20, chnCode); } public String getChncode() { return this.getField(20); } public void setCtcode(String ctCode) { this.setField(21, ctCode); } public String getCtcode() { return this.getField(21); } public void setScocode(String scoCode) { this.setField(22, scoCode); } public String getScocode() { return this.getField(22); } public void setCcocode(String ccoCode) { this.setField(23, ccoCode); } public String getCcocode() { return this.getField(23); } public void setAbwlabelcode(String abwLabelcode) { this.setField(24, abwLabelcode); } public String getAbwlabelcode() { return this.getField(24); } public void setDbwlabelcode(String dbwLabelcode) { this.setField(25, dbwLabelcode); } public String getDbwlabelcode() { return this.getField(25); } public void setCwcode(String cwCode) { this.setField(26, cwCode); } public String getCwcode() { return this.getField(26); } public void setEecode(String eeCode) { this.setField(27, eeCode); } public String getEecode() { return this.getField(27); } public void setCsopid(String csopId) { this.setField(28, csopId); } public String getCsopid() { return this.getField(28); } public void setSsopid(String ssopId) { this.setField(29, ssopId); } public String getSsopid() { return this.getField(29); } public void setOpidrecord(String opIdRecord) { this.setField(30, opIdRecord); } public String getOpidrecord() { return this.getField(30); } public void setOpidsignin(String opIdSignin) { this.setField(31, opIdSignin); } public String getOpidsignin() { return this.getField(31); } public void setIhscode(String ihsCode) { this.setField(32, ihsCode); } public String getIhscode() { return this.getField(32); } public void setZnvname(String znvName) { this.setField(33, znvName); } public String getZnvname() { return this.getField(33); } public void setCpbaglabelcode(String cpBaglabelcode) { this.setField(34, cpBaglabelcode); } public String getCpbaglabelcode() { return this.getField(34); } public void setEstcode(String estCode) { this.setField(35, estCode); } public String getEstcode() { return this.getField(35); } public void setStartarrivedate(String StartArrivedate) { this.setField(36, StartArrivedate); } public String getStartarrivedate() { return this.getField(36); } public void setEndarrivedate(String EndArrivedate) { this.setField(37, EndArrivedate); } public String getEndarrivedate() { return this.getField(37); } public void setTwblabelcode(String twbLabelcode) { this.setField(38, twbLabelcode); } public String getTwblabelcode() { return this.getField(38); } public void setIncustomerewbcode(String InCustomerewbcode) { this.setField(39, InCustomerewbcode); } public String getIncustomerewbcode() { return this.getField(39); } public void setInserverewbcode(String InServerewbcode) { this.setField(40, InServerewbcode); } public String getInserverewbcode() { return this.getField(40); } public void setBegincarryoversign(String BeginCarryoversign) { this.setField(41, BeginCarryoversign); } public String getBegincarryoversign() { return this.getField(41); } public void setEndcarryoversigin(String EndCarryoversigin) { this.setField(42, EndCarryoversigin); } public String getEndcarryoversigin() { return this.getField(42); } public void setFscarryoverenterprise(String fscarryoverenterprise) { this.setField(43, fscarryoverenterprise); } public String getFscarryoverenterprise() { return this.getField(43); } public void setMaxweight(String MaxWeight) { this.setField(44, MaxWeight); } public String getMaxweight() { return this.getField(44); } public void setMinweight(String MinWeight) { this.setField(45, MinWeight); } public String getMinweight() { return this.getField(45); } public void setEestructurecode(String eeStructurecode) { this.setField(46, eeStructurecode); } public String getEestructurecode() { return this.getField(46); } public void setOpidweightcheck(String OpIdWeightCheck) { this.setField(47, OpIdWeightCheck); } public String getOpidweightcheck() { return this.getField(47); } public void setStartcheckdate(String StartCheckdate) { this.setField(48, StartCheckdate); } public String getStartcheckdate() { return this.getField(48); } public void setEndcheckdate(String EndCheckdate) { this.setField(49, EndCheckdate); } public String getEndcheckdate() { return this.getField(49); } public void setHw_weightcheckkind(String HW_WEIGHTCHECKKIND) { this.setField(50, HW_WEIGHTCHECKKIND); } public String getHw_weightcheckkind() { return this.getField(50); } public void setWcbwlabelcode(String wcbwlabelcode) { this.setField(51, wcbwlabelcode); } public String getWcbwlabelcode() { return this.getField(51); } public void setCwbatchwaybillsign(String cwBatchwaybillsign) { this.setField(52, cwBatchwaybillsign); } public String getCwbatchwaybillsign() { return this.getField(52); } public void setStartrecordtrackdate(String StartRecordtrackdate) { this.setField(53, StartRecordtrackdate); } public String getStartrecordtrackdate() { return this.getField(53); } public void setEndrecordtrackdate(String EndRecordtrackdate) { this.setField(54, EndRecordtrackdate); } public String getEndrecordtrackdate() { return this.getField(54); } public void setCpsibaglabelcode(String cpSibaglabelcode) { this.setField(55, cpSibaglabelcode); } public String getCpsibaglabelcode() { return this.getField(55); } public void setCctcode(String cctCode) { this.setField(56, cctCode); } public String getCctcode() { return this.getField(56); } }
c09ec8e3963cc0cf792558271388179abd399a3d
34f8d4ba30242a7045c689768c3472b7af80909c
/JDK-18.0.2.1/src/jdk.localedata/sun/util/resources/cldr/ext/CurrencyNames_en_NF.java
4f85db2e6b8aabf9918fd9820c58c21a68e09a13
[ "Apache-2.0" ]
permissive
lovelycheng/JDK
5b4cc07546f0dbfad15c46d427cae06ef282ef79
19a6c71e52f3ecd74e4a66be5d0d552ce7175531
refs/heads/master
2023-04-08T11:36:22.073953
2022-09-04T01:53:09
2022-09-04T01:53:09
227,544,567
0
0
null
2019-12-12T07:18:30
2019-12-12T07:18:29
null
UTF-8
Java
false
false
3,395
java
/* * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * COPYRIGHT AND PERMISSION NOTICE * * Copyright (c) 1991-2020 Unicode, Inc. All rights reserved. * Distributed under the Terms of Use in https://www.unicode.org/copyright.html. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of the Unicode data files and any associated documentation * (the "Data Files") or Unicode software and any associated documentation * (the "Software") to deal in the Data Files or Software * without restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, and/or sell copies of * the Data Files or Software, and to permit persons to whom the Data Files * or Software are furnished to do so, provided that either * (a) this copyright and permission notice appear with all copies * of the Data Files or Software, or * (b) this copyright and permission notice appear in associated * Documentation. * * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT OF THIRD PARTY RIGHTS. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS * NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL * DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THE DATA FILES OR SOFTWARE. * * Except as contained in this notice, the name of a copyright holder * shall not be used in advertising or otherwise to promote the sale, * use or other dealings in these Data Files or Software without prior * written authorization of the copyright holder. */ package sun.util.resources.cldr.ext; import sun.util.resources.OpenListResourceBundle; public class CurrencyNames_en_NF extends OpenListResourceBundle { @Override protected final Object[][] getContents() { final Object[][] data = new Object[][] { { "AUD", "$" }, }; return data; } }
ef5fe2c1c5724eb2d0334ea298ce36dece8c613b
d2f68372099a743cffbfd1fb78cece9895da7da8
/src/com/ed/smarthome/struts/HistoryAction.java
3a247c98edc5f063a09e2a28a17382c6806ea860
[]
no_license
eliceaas/SmartHome
c704af4d42841a627ec54f6369677f3d744c71f9
a1ddf6ac0eb6b0b995ce067b1483dc2ca0b814ef
refs/heads/master
2020-03-27T21:53:45.350954
2017-10-19T12:49:28
2017-10-19T12:49:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,316
java
package com.ed.smarthome.struts; import java.util.List; import com.ed.smarthome.dao.HistoryDAO; import com.ed.smarthome.entity.History; import com.opensymphony.xwork2.ActionSupport; public class HistoryAction extends ActionSupport { private List<History> list; private int rowsPerPage=10;//num per page private int page=1;//default pagenum private int totalPage; private long totalNum; public int getRowsPerPage() { return rowsPerPage; } public void setRowsPerPage(int rowPerPage) { this.rowsPerPage = rowPerPage; } public int getPage() { return page; } public void setPage(int page) { this.page = page; } public int getTotalPage() { return totalPage; } public void setTotalPage(int totalPage) { this.totalPage = totalPage; } public long getTotalNum() { return totalNum; } public void setTotalNum(int totalNum) { this.totalNum = totalNum; } public List<History> getList() { return list; } public void setList(List<History> list) { this.list = list; } @Override public String execute() throws Exception { // TODO Auto-generated method stub HistoryDAO historyDAO=new HistoryDAO(); list=historyDAO.findHistoryByPage(page, rowsPerPage); totalPage=historyDAO.getHistoryTotalPage(rowsPerPage); totalNum=historyDAO.getCountHistory(); return "history"; } }
f65458fdfac740e131def276dbcd29339551dd00
ce351ec5b8d0e97bbc7a5eaf36e408169402d524
/Merging date-time instances/src/Main.java
a4a3c7fbec840dc27c65f4e8790e8a84d9310916
[]
no_license
Jor-ban/java-hyperskill-problems
2033828507092fbb105babc3fbd18b6ef351c686
8bbe3d51ea3d8505dc69cbb9f75d4fee9ad6ec8d
refs/heads/master
2023-02-03T19:05:39.504500
2020-12-21T13:19:28
2020-12-21T13:19:28
280,867,871
2
0
null
null
null
null
UTF-8
Java
false
false
1,072
java
import java.time.LocalDateTime; import java.util.Scanner; public class Main { public static LocalDateTime merge(LocalDateTime dateTime1, LocalDateTime dateTime2) { // write your code here return LocalDateTime.of( Math.max(dateTime1.getYear(), dateTime2.getYear()), Math.max(dateTime1.getMonthValue(), dateTime2.getMonthValue()), Math.max(dateTime1.getDayOfMonth(), dateTime2.getDayOfMonth()), Math.max(dateTime1.getHour(), dateTime2.getHour()), Math.max(dateTime1.getMinute(), dateTime2.getMinute()), Math.max(dateTime1.getSecond(), dateTime2.getSecond()) ); } /* Do not change code below */ public static void main(String[] args) { final Scanner scanner = new Scanner(System.in); final LocalDateTime firstDateTime = LocalDateTime.parse(scanner.nextLine()); final LocalDateTime secondDateTime = LocalDateTime.parse(scanner.nextLine()); System.out.println(merge(firstDateTime, secondDateTime)); } }
a059f42e433a6a1cbe75169c8938d2c5896c23a0
ffb625d628a1515ae80de984a883583821753696
/src/com/euromillions/beans/Ticket.java
f13bff34f633b54b6b34927711dd88f8cdbcfcdb
[]
no_license
kriamos/euromillions-android
dc2dadb5c675ceef965be6cf6fc61e70aa24955c
6655d29fdb316cec1ef76f5dc78d6f5369d99c09
refs/heads/master
2020-06-08T11:30:47.582822
2012-01-15T17:54:45
2012-01-15T17:54:45
39,590,706
0
0
null
null
null
null
UTF-8
Java
false
false
555
java
package com.euromillions.beans; import java.io.Serializable; public class Ticket implements Serializable { private static final long serialVersionUID = -9163427066175045336L; private long time; private Number[] numbers; private Number[] stars; public Ticket(Number[] numbers, Number[] stars) { this.time = System.currentTimeMillis(); this.numbers = numbers; this.stars = stars; } public long getTime() { return time; } public Number[] getNumbers() { return numbers; } public Number[] getStars() { return stars; } }
aad50a929744bfe8881f5399c5bf21a8a97c1f10
75950d61f2e7517f3fe4c32f0109b203d41466bf
/samples-spring/tags/fabric3-samples-spring-parent-pom-1.7/starter/restcalc/src/main/java/org/fabric3/samples/rs/calculator/SubtractServiceImpl.java
e4f5896da7785e565e5f3432eda1d10cabe091b1
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
codehaus/fabric3
3677d558dca066fb58845db5b0ad73d951acf880
491ff9ddaff6cb47cbb4452e4ddbf715314cd340
refs/heads/master
2023-07-20T00:34:33.992727
2012-10-31T16:32:19
2012-10-31T16:32:19
36,338,853
0
0
null
null
null
null
UTF-8
Java
false
false
1,086
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.fabric3.samples.rs.calculator; /** * An implementation of the subtract service. * * @version $Rev$ $Date$ */ public class SubtractServiceImpl implements SubtractService { public double subtract(double n1, double n2) { return n1 - n2; } }
[ "jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf" ]
jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf
56dc209f93c6f33daba0becc577b83b70f89e015
80dd48bfb2c7e5552530ac0fe20f2d15a60a1c0b
/kostenstellen/view/visitor/AbstrakteKostenArtStandardVisitor.java
2106b3293be435f9db110475908e3ca38bd6ef81
[]
no_license
AlineLa/kostenstellen
7d8353d7c4f5241ec5239b878dac6637f65a5c74
128d8abb1648829f2588afb254f9f59e79bad697
refs/heads/master
2021-01-24T22:52:07.969724
2014-11-11T11:40:44
2014-11-11T11:40:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
829
java
package view.visitor; import view.*; public abstract class AbstrakteKostenArtStandardVisitor implements AbstrakteKostenArtVisitor { public void handleReiseKosten(ReiseKostenView reiseKosten) throws ModelException{ this.standardHandling(reiseKosten); } public void handleKostenArtWurzel(KostenArtWurzelView kostenArtWurzel) throws ModelException{ this.standardHandling(kostenArtWurzel); } public void handleAllgemeineKosten(AllgemeineKostenView allgemeineKosten) throws ModelException{ this.standardHandling(allgemeineKosten); } public void handleLohnKosten(LohnKostenView lohnKosten) throws ModelException{ this.standardHandling(lohnKosten); } protected abstract void standardHandling(AbstrakteKostenArtView abstrakteKostenArt) throws ModelException; }
4b099c7b45926c2d746f4f48cefbd29f7778498b
c81998559036a41b16240acfd0a666205d77c344
/programs/sessions/employee.java
b32e0d8e38262e7e9aa3b13a988f3a549b6f2ffa
[]
no_license
polnara/kala
fdb8b0fffd0b0b0d54a7ddea33e6184c89bd645e
ee927402e7bf5195e09b4ef9dcfc63177e5ccd52
refs/heads/master
2022-12-27T03:51:04.121584
2020-10-14T15:04:40
2020-10-14T15:04:40
295,756,356
0
0
null
null
null
null
UTF-8
Java
false
false
1,254
java
class Employee{ // we can access only static variables in static methods. // we cannot access instance or (non-static) variables in static methods // instance variables (Dynamic) String name = "Harish"; int age = 30; // static variables (Dynamic) static int salary = 5000000; public static int monthlySalary(){ int monthSalary = salary / 12; return monthSalary; } public static int weeklySalary(){ //return salary/65; int weeklySalary = monthlySalary() / 4; return weeklySalary; } public static void main(String[] args){ int monthSalary = monthlySalary(); System.out.println("Anual Salary :: "+salary); System.out.println("Monthly Salary = "+monthSalary); System.out.println("Weekly salary :: "+weeklySalary()); System.out.println("==========================="); salary = 2500000; System.out.println("Anual Salary :: "+salary); System.out.println("Monthly Salary = "+monthlySalary()); System.out.println("Weekly salary :: "+weeklySalary()); System.out.println("==========================="); salary = 7500000; System.out.println("Anual Salary :: "+salary); System.out.println("Monthly Salary = "+monthlySalary()); System.out.println("Weekly salary :: "+weeklySalary()); } }
63f5a42a42d5ec2de6c57b374c788d337966d225
b0d9d1311f2c5b508c04611a1e527aab178d9f97
/app/src/main/java/tw/com/businessmeet/device/bluetooth/BluetoothBroadcast.java
67ee19ec6a0436ffba3ec5b62d7f246102e9e7a5
[]
no_license
NTUB-Project108-2/BeMet_app
f3d6f68955c80e95ef2ce22c4f0ef5555c0a04a5
927c1b395a110bdfa26f1607b2f534da06b40501
refs/heads/master
2023-01-29T04:15:15.772744
2020-12-09T03:56:37
2020-12-09T03:56:37
244,809,532
0
0
null
2020-12-10T13:55:57
2020-03-04T04:46:24
Java
UTF-8
Java
false
false
1,703
java
package tw.com.businessmeet.device.bluetooth; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import tw.com.businessmeet.device.ActionListener; import tw.com.businessmeet.device.DeviceFinder; import tw.com.businessmeet.device.EmptyActionListener; import tw.com.businessmeet.device.FoundedDeviceDetail; import tw.com.businessmeet.device.actionhandler.ActionHandler; import tw.com.businessmeet.device.actionhandler.supplier.ActionHandlerSupplier; import tw.com.businessmeet.device.enumerate.FindAction; public class BluetoothBroadcast extends BroadcastReceiver { private final ActionHandlerSupplier actionHandlerSupplier; private final ActionListener actionListener; public BluetoothBroadcast(ActionHandlerSupplier actionHandlerSupplier, ActionListener actionListener) { this.actionHandlerSupplier = actionHandlerSupplier; this.actionListener = actionListener; } @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); FindAction bluetoothAction = FindAction.getInstance(action); ActionHandler actionHandler = actionHandlerSupplier.get(bluetoothAction); if (actionHandler != null) { if (bluetoothAction == FindAction.FOUND) { FoundedDeviceDetail deviceDetail = new BluetoothDeviceDetail(intent); intent.putExtra(DeviceFinder.EXTRA_FOUNDED_DEVICE_DETAIL, deviceDetail); } actionHandler.handle(context, intent); actionHandler.executeListener(actionListener != null ? actionListener : new EmptyActionListener(), context, intent); } } }
599a8d550b553e5dd4eac89c47cdbac164b1e9e2
ab24e80cd7664a3bce0ca118568102e6ec2a1e9a
/bridge-pattern/src/main/java/com/tugbakaya/bridgepattern/colordrawer/ColorDrawer.java
ba1cf9da2a611271c71f260fee6c8db05345b0cb
[]
no_license
kayatugba/design-patterns
e481c06a3486b439fe84779ed9df7fdddeafdd34
e4c71e88f4fefbdd68e1732ff94d7f78ac264cab
refs/heads/master
2020-06-13T12:32:03.381997
2019-07-11T13:06:03
2019-07-11T13:06:03
194,655,031
0
0
null
null
null
null
UTF-8
Java
false
false
105
java
package com.tugbakaya.bridgepattern.colordrawer; public interface ColorDrawer { public void draw(); }
66e4c2b7ae6b2d70b26486293ae5fe962f561343
f973a6608716edfca4c43a8142745bbaddb749c5
/tool-browser/src/atomdu/tools/browser/BrowserPanel.java
58109978227363c93ac95a455e027803192a2400
[]
no_license
atomdu/intellij-plugin-1024tools
9342015bb1031289370a30257dab1d8fea6a6bff
5a43cfc73e495d107236513a9894bebf94e4fce0
refs/heads/master
2020-03-27T23:15:56.340395
2018-09-03T11:50:06
2018-09-03T11:50:06
147,305,670
1
0
null
null
null
null
UTF-8
Java
false
false
708
java
package atomdu.tools.browser; import java.awt.*; /** * Created by atomdu on 2017/12/4. */ public class BrowserPanel extends BrowserBodyHtmlPanel implements BrowserInputToolbar.ToolbarListener { private BrowserInputToolbar toolbar; public BrowserPanel() { toolbar = new BrowserInputToolbar(BrowserInputToolbar.URL_TYPE_HTML); toolbar.setListener(this); add(toolbar, BorderLayout.NORTH); } @Override public void onSearch(String url, String search) { load(url + search); } public BrowserInputToolbar getToolbar() { return toolbar; } public void setToolbar(BrowserInputToolbar toolbar) { this.toolbar = toolbar; } }
9158c3c3e9edda66d64f6a591374824f8badda0a
d307cdf59c04e15e942240aab4ca351e106b48d1
/src/main/java/org/apache/ibatis/annotations/Results.java
81b3b85d68e39509468a3e2f9e35ebc426a6ae99
[ "Apache-2.0", "BSD-3-Clause" ]
permissive
caoyang007/mybatissourcereading
87c04e4ac635c55eb362f9d74b34261ad41c1892
852baf4bcbb10cfeaeec867891f70e8ff4aa670f
refs/heads/master
2022-09-27T03:21:01.052633
2020-01-21T06:03:01
2020-01-21T06:03:01
226,623,217
3
0
Apache-2.0
2022-09-08T01:04:51
2019-12-08T06:09:27
Java
UTF-8
Java
false
false
1,968
java
/** * Copyright 2009-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ibatis.annotations; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * The annotation that be grouping mapping definitions for property. * * <p><br> * <b>How to use:</b> * <pre> * public interface UserMapper { * &#064;Results({ * &#064;Result(property = "id", column = "id", id = true), * &#064;Result(property = "name", column = "name"), * &#064;Result(property = "email" column = "id", one = @One(select = "selectUserEmailById", fetchType = FetchType.LAZY)), * &#064;Result(property = "telephoneNumbers" column = "id", many = @Many(select = "selectAllUserTelephoneNumberById", fetchType = FetchType.LAZY)) * }) * &#064;Select("SELECT id, name FROM users WHERE id = #{id}") * User selectById(int id); * } * </pre> * @author Clinton Begin */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface Results { /** * Returns the id of this result map. * * @return the id of this result map */ String id() default ""; /** * Returns mapping definitions for property. * * @return mapping definitions */ Result[] value() default {}; }
b5eab0f317344cf756662a6241ea12892e0da4b5
0090594fa32ebad7ce314f7799724c455d7b7349
/springwithreact/src/main/java/com/project/SpringwithreactApplication.java
4ba01cc07a391838a98010100b86f01d3d8c635e
[]
no_license
nareshdevarajan/springwithreact
793706de16fa6c2c34d30bb3ce9eaab406bc6a61
587db3e6b94af657a8f9182ea4c6090281d9e915
refs/heads/master
2020-08-01T04:48:10.921203
2019-09-25T14:52:11
2019-09-25T14:52:11
210,869,280
0
0
null
null
null
null
UTF-8
Java
false
false
322
java
package com.project; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringwithreactApplication { public static void main(String[] args) { SpringApplication.run(SpringwithreactApplication.class, args); } }
94c61ebc3e294638314f51523862777a16b54d90
d690e403aa84908a05a6942e848451068f46ea1b
/spotify-boot/src/main/java/com/example/spotifyboot/util/JwtRequestFilter.java
89de056f0dc5e13c0efeb5a03089d72569d8c014
[]
no_license
gkopplin/spotify-boot
ffa4cbd291ab28c285e80717a1c24b635d1c01f5
fb87511f45c5914375ec7fc232b89196bce56826
refs/heads/master
2020-08-30T09:18:45.305535
2019-11-04T14:01:27
2019-11-04T14:01:27
218,330,861
0
0
null
2019-11-04T05:55:20
2019-10-29T16:17:45
Java
UTF-8
Java
false
false
2,722
java
package com.example.spotifyboot.util; import com.example.spotifyboot.service.UserService; import io.jsonwebtoken.ExpiredJwtException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; import org.springframework.stereotype.Component; import org.springframework.web.filter.OncePerRequestFilter; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @Component public class JwtRequestFilter extends OncePerRequestFilter { @Autowired private UserService userService; @Autowired private JwtUtil jwtUtil; @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException { final String requestTokenHeader = request.getHeader("Authorization"); String username = null; String jwtToken = null; if (requestTokenHeader != null && requestTokenHeader.startsWith("Bearer ")) { jwtToken = requestTokenHeader.substring(7); try { username = jwtUtil.getUsernameFromToken(jwtToken); } catch (IllegalArgumentException e) { System.out.println("Unable to get JWT Token"); } catch (ExpiredJwtException e) { System.out.println("JWT Token has expired"); } } else { logger.warn("JWT Token does not begin with Bearer String"); } if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) { UserDetails userDetails = userService.loadUserByUsername(username); if (jwtUtil.validateToken(jwtToken, userDetails)) { UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = new UsernamePasswordAuthenticationToken( userDetails, null, userDetails.getAuthorities()); usernamePasswordAuthenticationToken .setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); SecurityContextHolder.getContext().setAuthentication(usernamePasswordAuthenticationToken); System.out.println(SecurityContextHolder.getContext()); } } chain.doFilter(request, response); } }
935f50eb9ecdcff90cab19c8133d5805fa14f210
34766ca0648d1623eed718cab3564bb98244dbc9
/PlaceLocator/app/src/test/java/com/example/xcomputers/placelocator/ExampleUnitTest.java
5f13504ac0a370f7ff780f69321cdbda72579a21
[]
no_license
Georgi-Nedko/PlaceLocator
ebc6ecfaafb83b2de88d19b01fcb115e3daa7953
10bc0195e34908c6d0a9d2f6295d46656ea6b05b
refs/heads/master
2021-01-12T17:18:01.427021
2016-10-17T22:18:34
2016-10-17T22:18:34
69,475,432
0
0
null
null
null
null
UTF-8
Java
false
false
413
java
package com.example.xcomputers.placelocator; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
218a1f2d1a32fa10f0c03a83eb86be5a061d5f6b
2e98b7cbd32d5586256b1b7006fd3d575085e725
/set-map/src/com/map/map/Map.java
d4d55a300b5be20b95a5c0192f3af559b755cb61
[]
no_license
coderZYGui/set-map-structure
7505738a14c5dcc86a4b197761c1f30c7f4514b1
c1170aed0206c14e9cf795bcbac0df8b3509de81
refs/heads/master
2023-02-06T12:18:39.092854
2020-12-26T04:08:49
2020-12-26T04:08:49
319,665,731
0
0
null
null
null
null
UTF-8
Java
false
false
589
java
package com.map.map; /** * Description: Map接口 * * @author guizy1 * @date 2020/12/9 15:38 */ public interface Map<K, V> { int size(); boolean isEmpty(); void clear(); V put(K key, V value); //添加元素 V get(K key); V remove(K key); boolean containsKey(K key); //查找key是否存在 boolean containsValue(V value); //查找value是否存在 void traversal(Visitor<K, V> visitor); //元素遍历 public static abstract class Visitor<K, V> { boolean stop; public abstract boolean visit(K key, V value); } }
de64f4bc3aaf9195efa7b5a63eb763e03ac565e0
358021c063a2627d846f33e96ae27818e105f262
/src/main/java/bssend/expr/node/IBinaryExprNode.java
1a4e6b56147a89d6b84044c0d57ec41b32ae2430
[]
no_license
bssend/expr
64b39a7c83c4d02b5e10a4709062f7f735f91475
1f682d0724b601349d265cf479ea44c7a4b45499
refs/heads/master
2020-03-28T21:57:21.093522
2018-09-24T15:47:34
2018-09-24T15:47:34
149,195,028
0
0
null
null
null
null
UTF-8
Java
false
false
207
java
package bssend.expr.node; import bssend.expr.BinaryOperatorType; public interface IBinaryExprNode extends INode { INode getLeftNode(); INode getRightNode(); BinaryOperatorType getOperator(); }
12e992cae6c066a1d23e67781d1a74dea5fa6ea6
3c8d529239c2e6917ff03a9a9def1ef7517156bc
/zuul-demo/src/test/java/com/xwj/springcloud/zuuldemo/ZuulDemoApplicationTests.java
5d81bb437adb7ecc4375be698c86bcfd5b979c05
[]
no_license
xwj920930/springcloud-demo
e2181cd9e4f8fe53b9a9d49b85869a221d6da74d
2afef7bd74ff62cbeda3385dfd32b3dc4579e2cd
refs/heads/master
2021-06-25T14:48:17.498638
2021-01-26T12:41:07
2021-01-26T12:41:07
206,217,497
0
0
null
null
null
null
UTF-8
Java
false
false
347
java
package com.xwj.springcloud.zuuldemo; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class ZuulDemoApplicationTests { @Test public void contextLoads() { } }
2a086e604a85653d3853bde9df7593e05a474c44
10294e36832e897be5205024d429dcee7914d092
/impala/impala-web/test/org/impalaframework/web/resolver/ServletContextModuleLocationResolverTest.java
5d6631c785162024d3e3594227d6c7d807f618b4
[]
no_license
realtimedespatch/impala
8c9241b038e3c0b57eabc0dbaadfbc48647fed08
85c05dbffa47efec6d95ee8565245497d95ffb2e
refs/heads/master
2022-05-16T08:29:22.430871
2022-03-21T16:35:56
2022-03-21T16:35:56
48,985,384
2
2
null
2016-01-04T08:54:47
2016-01-04T08:54:46
null
UTF-8
Java
false
false
2,669
java
/* * Copyright 2007-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ package org.impalaframework.web.resolver; import static org.easymock.EasyMock.*; import java.util.List; import javax.servlet.ServletContext; import org.springframework.core.io.Resource; import org.springframework.web.context.support.ServletContextResource; import junit.framework.TestCase; public class ServletContextModuleLocationResolverTest extends TestCase { private ServletContextModuleLocationResolver resolver; private ServletContext servletContext; @Override protected void setUp() throws Exception { super.setUp(); resolver = new ServletContextModuleLocationResolver(); servletContext = createMock(ServletContext.class); resolver.setServletContext(servletContext); resolver.setApplicationVersion("1.0"); } public final void testGetApplicationModuleClassLocations() { List<Resource> locations = resolver.getApplicationModuleClassLocations("mymodule"); assertEquals(2, locations.size()); assertTrue(locations.get(0) instanceof ServletContextResource); } public void testGetModuleSpecificJarLocations() throws Exception { expect(servletContext.getResource("/WEB-INF/modules/lib/mymodule")).andReturn(null); expect(servletContext.getRealPath("/WEB-INF/modules/lib/mymodule")).andReturn(null); replay(servletContext); List<Resource> locations = resolver.getApplicationModuleLibraryLocations("mymodule"); assertNull(locations); verify(servletContext); } public void testGetPresentModuleSpecificJarLocations() throws Exception { expect(servletContext.getResource("/WEB-INF/modules/lib/mymodule")).andReturn(null); expect(servletContext.getRealPath("/WEB-INF/modules/lib/mymodule")).andReturn("../sample-module3/lib"); replay(servletContext); List<Resource> locations = resolver.getApplicationModuleLibraryLocations("mymodule"); assertNotNull(locations); assertEquals(2, locations.size()); verify(servletContext); } }
e30a49be465810f775df7908092a40b020d9107d
a583350302802777b95a6abea05204fc4f371e88
/app/src/main/java/com/medmeeting/m/zhiyi/UI/SignInAndSignUpView/LoginActivity.java
7081bdf09a48960ee480bd27c645fec30834efda
[]
no_license
luosonglin/YHB
b72531e04bd62d37a6300f950e58261d60da71ef
bb4dbd532600e2998b5e38e9cec7a470d6fb55fa
refs/heads/master
2021-09-13T13:06:16.686344
2018-04-27T08:29:06
2018-04-29T18:01:54
131,267,933
0
0
null
null
null
null
UTF-8
Java
false
false
32,236
java
package com.medmeeting.m.zhiyi.UI.SignInAndSignUpView; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.annotation.TargetApi; import android.app.LoaderManager.LoaderCallbacks; import android.content.CursorLoader; import android.content.Intent; import android.content.Loader; import android.content.pm.PackageManager; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; import android.os.CountDownTimer; import android.os.Handler; import android.os.Message; import android.provider.ContactsContract; import android.support.annotation.NonNull; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.text.InputType; import android.text.TextUtils; import android.util.Log; import android.view.KeyEvent; import android.view.View; import android.view.WindowManager; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.view.inputmethod.EditorInfo; import android.widget.ArrayAdapter; import android.widget.AutoCompleteTextView; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import com.medmeeting.m.zhiyi.Constant.Constant; import com.medmeeting.m.zhiyi.Constant.Data; import com.medmeeting.m.zhiyi.Data.HttpData.HttpData; import com.medmeeting.m.zhiyi.MainActivity; import com.medmeeting.m.zhiyi.R; import com.medmeeting.m.zhiyi.UI.Entity.AccessToken; import com.medmeeting.m.zhiyi.UI.Entity.HttpResult3; import com.medmeeting.m.zhiyi.UI.Entity.UserInfoDto; import com.medmeeting.m.zhiyi.UI.OtherVIew.BrowserActivity; import com.medmeeting.m.zhiyi.Util.DBUtils; import com.medmeeting.m.zhiyi.Util.PhoneUtils; import com.medmeeting.m.zhiyi.Util.ToastUtils; import com.snappydb.SnappydbException; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import cn.jpush.android.api.JPushInterface; import rx.Observer; import static android.Manifest.permission.READ_CONTACTS; /** * A login screen that offers login via phone/password. */ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<Cursor> { /** * Id to identity READ_CONTACTS permission request. */ private static final int REQUEST_READ_CONTACTS = 0; /** * A dummy authentication store containing known user names and passwords. * TODO: remove after connecting to a real authentication system. */ private static final String[] DUMMY_CREDENTIALS = new String[]{ "[email protected]:hello", "[email protected]:world" }; /** * Keep track of the login task to ensure we can cancel it if requested. */ private UserLoginTask mAuthTask = null; // UI references. private ImageView mBackgroundImageView; private AutoCompleteTextView mPhoneView; private EditText mCodeView; private TextView mGetCodeView; private View mProgressView; private View mLoginFormView; private TextView mForgetPasswordView; private TextView mTurnPasswordView; private boolean isCode = true; //图形验证码 private RelativeLayout mTxRlyt; private EditText mTxCodeView; private static ImageView mGetTxCodeView; // timer private CountDownTimer timer = new CountDownTimer(60000, 1000) { @Override public void onTick(long l) { mGetCodeView.setEnabled(false); mGetCodeView.setText("剩余" + l / 1000 + "秒"); } @Override public void onFinish() { mGetCodeView.setEnabled(true); mGetCodeView.setText("获取验证码"); } }; //登陆协议 private TextView mAgreementTv; /** * print some tag in log. */ private String TAG = LoginActivity.class.getSimpleName(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // 隐藏标题栏 // this.requestWindowFeature(Window.FEATURE_NO_TITLE); // set full screen 隐藏状态栏 // getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_login); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);// 设置全屏 mBackgroundImageView = (ImageView) findViewById(R.id.login_background_image); new Handler().postDelayed(() -> { Animation animation = AnimationUtils.loadAnimation(LoginActivity.this, R.anim.login_background_translate_anim); mBackgroundImageView.startAnimation(animation); }, 1000); // Set up the login form. mPhoneView = (AutoCompleteTextView) findViewById(R.id.phone); populateAutoComplete(); mTxRlyt = (RelativeLayout) findViewById(R.id.tx_rlyt); mTxRlyt.setVisibility(View.VISIBLE); mTxCodeView = (EditText) findViewById(R.id.tx_code); mGetTxCodeView = (ImageView) findViewById(R.id.get_tx_code_textview); new WorkThread().start(); getTxCodeView(); mGetTxCodeView.setOnClickListener(view -> { // getTxCodeView() new WorkThread().start(); }); mCodeView = (EditText) findViewById(R.id.code); mCodeView.setOnEditorActionListener((textView, id, keyEvent) -> { if (id == R.id.login_code || id == EditorInfo.IME_NULL) { attemptLogin(); return true; } else if (!isCode) { attemptLogin(); return true; } return false; }); mGetCodeView = (TextView) findViewById(R.id.get_code_textview); mGetCodeView.setOnClickListener(view -> getPhoneCode()); Button mPhoneSignInButton = (Button) findViewById(R.id.phone_sign_in_button); mPhoneSignInButton.setOnClickListener(view -> attemptLogin()); mLoginFormView = findViewById(R.id.login_form); mProgressView = findViewById(R.id.login_progress); mForgetPasswordView = (TextView) findViewById(R.id.forget_password_textview); mForgetPasswordView.setOnClickListener(view -> { // startActivity(new Intent(LoginActivity.this, ForgetPasswordActivity.class)); }); mTurnPasswordView = (TextView) findViewById(R.id.turn_password); mTurnPasswordView.setOnClickListener(view -> { isCode = !isCode; if (!isCode) { mTurnPasswordView.setText("切换验证码登录"); mGetCodeView.setVisibility(View.GONE); mCodeView.setHint("请输入密码"); mCodeView.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); mTxRlyt.setVisibility(View.GONE); return; } mTurnPasswordView.setText("切换密码登录"); mGetCodeView.setVisibility(View.VISIBLE); mCodeView.setHint("请输入验证码"); mCodeView.setInputType(InputType.TYPE_CLASS_NUMBER); mTxRlyt.setVisibility(View.VISIBLE); return; }); mAgreementTv = (TextView) findViewById(R.id.agreement_tv); mAgreementTv.setOnClickListener(view -> BrowserActivity.launch(LoginActivity.this, "http://webview.medmeeting.com/#/page/user-protocol", "《登录协议》")); // mAgreementTv.setOnClickListener(view -> BrowserActivity.launch(LoginActivity.this, "https://testhttps.51fapiao.cn:8181/FPFX/actions/0c03f9078b8380f116e606f5102e64198451e5", "《登录协议》")); } public static void getTxCodeView() { // String url = Constant.API_SERVER_LIVE_TEST + "/"+"v1/token/imageCode/read?v=" + System.currentTimeMillis(); // GlideUrl glideUrl = new GlideUrl(url); // Glide.with(LoginActivity.this) // .load(glideUrl) // .crossFade() // .listener(new RequestListener<GlideUrl, GlideDrawable>() { // @Override // public boolean onException(Exception e, GlideUrl model, Target<GlideDrawable> target, boolean isFirstResource) { // Log.e(getLocalClassName(), model.getHeaders().get("Set-Cookie")); // Log.e(getApplicationContext().toString(),"资源加载异常"); // return false; // } // // @Override // public boolean onResourceReady(GlideDrawable resource, GlideUrl model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) { //// Log.e(getLocalClassName(), model.getHeaders().get("HOST")); // try { // Log.e(getLocalClassName(), model.toURL().getUserInfo()+""); // } catch (MalformedURLException e) { // e.printStackTrace(); // } // Log.e(getApplicationContext().toString(),"图片加载完成"); // return false; // } // }) // .into(mGetTxCodeView); // Map<String, Object> map = new HashMap<>(); // map.put("v", System.currentTimeMillis()); // HttpData.getInstance().HttpDataReadImageCode(new Observer<ResponseBody>() { // @Override // public void onCompleted() { // // } // // @Override // public void onError(Throwable e) { // Log.e("aae ", e.getMessage()); // // Bitmap pic = null; // InputStream is = Data.getInputStream(); // Log.e("is ", is + ""); // if (is != null) { //// pic = BitmapFactory.decodeStream(is); // 关键是这句代码 //// Log.e("pic ", pic+""); //// mGetTxCodeView.setImageBitmap(pic); // getBitmap(is); // } // } // // @Override // public void onNext(ResponseBody d) { //// Glide.with(LoginActivity.this) //// .load(d) //// .crossFade() //// .into(mGetTxCodeView); // Log.e("aa ", d.toString()); // } // }, map); //// // ResponseBody responseBody = Data.getResponseBody(); // if (responseBody != null) // Glide.with(LoginActivity.this) // .load(responseBody) // .crossFade() // .into(mGetTxCodeView); // mGetTxCodeView.setImageBitmap(bitmap); } public static void getBitmap(InputStream inputStream) { Bitmap pic = null; try { pic = BitmapFactory.decodeStream(inputStream); // 关键是这句代码 } catch (Exception e) { e.printStackTrace(); } } private Handler handler = new Handler() { @Override public void handleMessage(Message msg) { if (msg.what == 0) { mGetTxCodeView.setImageBitmap(pic); } } }; //工作线程 private class WorkThread extends Thread { @Override public void run() { //......处理比较耗时的操作 getBitmapFromServer(Constant.API_SERVER_LIVE + "/" + "v1/token/imageCode/read?v=" + System.currentTimeMillis()); // getBitmapFromServer(Constant.API_SERVER_LIVE_TEST + "/" + "v1/token/imageCode/read?v=" + System.currentTimeMillis()); //处理完成后给handler发送消息 Message msg = new Message(); msg.what = 0; handler.sendMessage(msg); } } Bitmap pic = null; public void getBitmapFromServer(String imagePath) { HttpGet get = new HttpGet(imagePath); HttpClient client = new DefaultHttpClient(); try { HttpResponse response = client.execute(get); HttpEntity entity = response.getEntity(); InputStream is = entity.getContent(); pic = BitmapFactory.decodeStream(is); // 关键是这句代码 Log.e("aaa ", pic + ""); Log.e("aaa ", response.getEntity() + ""); Log.e("aaa ", response.getFirstHeader("Set-Cookie") + "");//Set-Cookie: JSESSIONID=B24E8934E24E9CF953D946BAC196BEF6; Path=/; HttpOnly Data.setSession(response.getFirstHeader("Set-Cookie").getValue().split(";")[0] + ""); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } // return pic; } private void getPhoneCode() { if (!PhoneUtils.isMobile(mPhoneView.getText().toString().trim())) { ToastUtils.show(LoginActivity.this, "手机号格式不正确,请重新输入"); return; } timer.start(); // HttpData.getInstance().HttpDataGetPhoneCode(new Observer<SignUpCodeDto>() { // @Override // public void onCompleted() { // Log.e(TAG, "onCompleted"); // } // // @Override // public void onError(Throwable e) { // //设置页面为加载错误 // ToastUtils.show(LoginActivity.this, e.getMessage()); // } // // @Override // public void onNext(SignUpCodeDto signUpCodeDto) { // Log.e(TAG, "onNext sms " + signUpCodeDto.getData().getMsg() + " " + signUpCodeDto.getCode()); // } // }, mPhoneView.getText().toString().trim()); Map<String, Object> options = new HashMap<>(); options.put("phone", mPhoneView.getText().toString().trim()); options.put("imgCode", mTxCodeView.getText().toString().trim()); HttpData.getInstance().HttpDataGetCode(new Observer<HttpResult3>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { ToastUtils.show(LoginActivity.this, e.getMessage()); timer.cancel(); } @Override public void onNext(HttpResult3 data) { if (!data.getStatus().equals("success")) { ToastUtils.show(LoginActivity.this, data.getMsg()); // getTxCodeView(); timer.cancel(); // new WorkThread().start(); mGetCodeView.setEnabled(true); mGetCodeView.setText("获取验证码"); return; } ToastUtils.show(LoginActivity.this, data.getMsg()); } }, options); } private void populateAutoComplete() { if (!mayRequestContacts()) { return; } getLoaderManager().initLoader(0, null, this); } private boolean mayRequestContacts() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { return true; } if (checkSelfPermission(READ_CONTACTS) == PackageManager.PERMISSION_GRANTED) { return true; } if (shouldShowRequestPermissionRationale(READ_CONTACTS)) { Snackbar.make(mPhoneView, "Contacts permissions are needed for providing email completions.", Snackbar.LENGTH_INDEFINITE) .setAction(android.R.string.ok, v -> requestPermissions(new String[]{READ_CONTACTS}, REQUEST_READ_CONTACTS)); } else { requestPermissions(new String[]{READ_CONTACTS}, REQUEST_READ_CONTACTS); } return false; } /** * Callback received when a permissions request has been completed. */ @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if (requestCode == REQUEST_READ_CONTACTS) { if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { populateAutoComplete(); } } } /** * Attempts to sign in or register the account specified by the login form. * If there are form errors (invalid phone, missing fields, etc.), the * errors are presented and no actual login attempt is made. */ private void attemptLogin() { if (mAuthTask != null) { return; } // Reset errors. mPhoneView.setError(null); mCodeView.setError(null); // Store values at the time of the login attempt. String phone = mPhoneView.getText().toString(); String password = mCodeView.getText().toString(); boolean cancel = false; View focusView = null; // Check for a valid phone address. if (TextUtils.isEmpty(phone)) { mPhoneView.setError("手机号不能为空"); focusView = mPhoneView; cancel = true; } else if (!isPhoneValid(phone)) { mPhoneView.setError("手机号格式不正确"); focusView = mPhoneView; cancel = true; } if (TextUtils.isEmpty(password)) { if (isCode) { mCodeView.setError("验证码不能为空"); } else { mCodeView.setError("密码不能为空"); } focusView = mCodeView; cancel = true; } if (cancel) { // There was an error; don't attempt login and focus the first // form field with an error. focusView.requestFocus(); } else { // Show a progress spinner, and kick off a background task to // perform the user login attempt. showProgress(true); mAuthTask = new UserLoginTask(phone, password); mAuthTask.execute((Void) null); } } private boolean isPhoneValid(String phone) { return PhoneUtils.isMobile(phone); } /** * Shows the progress UI and hides the login form. */ @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) private void showProgress(final boolean show) { // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow // for very easy animations. If available, use these APIs to fade-in // the progress spinner. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) { int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime); mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); mLoginFormView.animate().setDuration(shortAnimTime).alpha( show ? 0 : 1).setListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); } }); mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); mProgressView.animate().setDuration(shortAnimTime).alpha( show ? 1 : 0).setListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); } }); } else { // The ViewPropertyAnimator APIs are not available, so simply show // and hide the relevant UI components. mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); } } @Override public Loader<Cursor> onCreateLoader(int i, Bundle bundle) { return new CursorLoader(this, // Retrieve data rows for the device user's 'profile' contact. Uri.withAppendedPath(ContactsContract.Profile.CONTENT_URI, ContactsContract.Contacts.Data.CONTENT_DIRECTORY), ProfileQuery.PROJECTION, // Select only phone addresses. ContactsContract.Contacts.Data.MIMETYPE + " = ?", new String[]{ContactsContract.CommonDataKinds.Email .CONTENT_ITEM_TYPE}, // Show primary email addresses first. Note that there won't be // a primary email address if the user hasn't specified one. ContactsContract.Contacts.Data.IS_PRIMARY + " DESC"); } @Override public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) { List<String> emails = new ArrayList<>(); // cursor.moveToFirst();//? // while (!cursor.isAfterLast()) { // emails.add(cursor.getString(ProfileQuery.ADDRESS)); // cursor.moveToNext(); // } addEmailsToAutoComplete(emails); } @Override public void onLoaderReset(Loader<Cursor> cursorLoader) { } private void addEmailsToAutoComplete(List<String> emailAddressCollection) { //Create adapter to tell the AutoCompleteTextView what to show in its dropdown list. ArrayAdapter<String> adapter = new ArrayAdapter<>(LoginActivity.this, android.R.layout.simple_dropdown_item_1line, emailAddressCollection); mPhoneView.setAdapter(adapter); } private interface ProfileQuery { String[] PROJECTION = { ContactsContract.CommonDataKinds.Email.ADDRESS, ContactsContract.CommonDataKinds.Email.IS_PRIMARY, }; int ADDRESS = 0; int IS_PRIMARY = 1; } /** * Represents an asynchronous login/registration task used to authenticate * the user. */ public class UserLoginTask extends AsyncTask<Void, Void, Boolean> { private final String mPhone; private final String mPassword; private Map<String, Object> map = new HashMap<>(); UserLoginTask(String phone, String password) { mPhone = phone; mPassword = password; } @Override protected Boolean doInBackground(Void... params) { // TODO: attempt authentication against a network service. try { // Simulate network access. Thread.sleep(2000); } catch (InterruptedException e) { return false; } for (String credential : DUMMY_CREDENTIALS) { String[] pieces = credential.split(":"); if (pieces[0].equals(mPhone)) { // Account exists, return true if the password matches. return pieces[1].equals(mPassword); } } // TODO: register the new account here. return true; } @Override protected void onPostExecute(final Boolean success) { mAuthTask = null; // showProgress(false); map.put("phone", mPhone); if (isCode) { map.put("code", mPassword); map.put("source", "android"); HttpData.getInstance().HttpDataLoginByCode(new Observer<HttpResult3<Object, AccessToken>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { ToastUtils.show(LoginActivity.this, e.getMessage()); } @Override public void onNext(HttpResult3<Object, AccessToken> data) { if (!data.getStatus().equals("success")) { ToastUtils.show(LoginActivity.this, data.getMsg()); showProgress(false); return; } Data.setUserToken(data.getEntity().getTokenType() + "_" + data.getEntity().getAccessToken()); try { DBUtils.put(LoginActivity.this, "userToken", data.getEntity().getTokenType() + "_" + data.getEntity().getAccessToken()); DBUtils.put(LoginActivity.this, "phone", mPhone); } catch (SnappydbException e) { e.printStackTrace(); } Data.setPhone(mPhone); //极光推送 别名设置 JPushInterface.setAlias(LoginActivity.this, 1, mPhone); HttpData.getInstance().HttpDataGetUserInfo(new Observer<HttpResult3<Object, UserInfoDto>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { ToastUtils.show(LoginActivity.this, e.getMessage()); } @Override public void onNext(HttpResult3<Object, UserInfoDto> data2) { if (!data2.getStatus().equals("success")) { ToastUtils.show(LoginActivity.this, data2.getMsg()); showProgress(false); return; } Data.setUserId(data2.getEntity().getId()); try { DBUtils.put(LoginActivity.this, "userId", data2.getEntity().getId() + ""); DBUtils.put(LoginActivity.this, "userName", data2.getEntity().getName() + ""); DBUtils.put(LoginActivity.this, "userNickName", data2.getEntity().getNickName() + ""); DBUtils.put(LoginActivity.this, "authentication", data2.getEntity().getAuthenStatus() + ""); DBUtils.put(LoginActivity.this, "confirmNumber", data2.getEntity().getConfirmNumber() + ""); DBUtils.put(LoginActivity.this, "tokenId", data2.getEntity().getTokenId() + ""); } catch (SnappydbException e) { e.printStackTrace(); } finally { Log.d(TAG, "Login succeed!"); finish(); startActivity(new Intent(LoginActivity.this, MainActivity.class)); } } }); } }, map); } else { map.put("pwd", mPassword); HttpData.getInstance().HttpDataLoginByPwd(new Observer<HttpResult3<Object, AccessToken>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { ToastUtils.show(LoginActivity.this, e.getMessage()); } @Override public void onNext(HttpResult3<Object, AccessToken> data) { if (!data.getStatus().equals("success")) { ToastUtils.show(LoginActivity.this, data.getMsg()); showProgress(false); return; } Data.setUserToken(data.getEntity().getTokenType() + "_" + data.getEntity().getAccessToken()); try { DBUtils.put(LoginActivity.this, "userToken", data.getEntity().getTokenType() + "_" + data.getEntity().getAccessToken()); DBUtils.put(LoginActivity.this, "phone", mPhone); } catch (SnappydbException e) { e.printStackTrace(); } Data.setPhone(mPhone); //极光推送 别名设置 JPushInterface.setAlias(LoginActivity.this, 1, mPhone); HttpData.getInstance().HttpDataGetUserInfo(new Observer<HttpResult3<Object, UserInfoDto>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { ToastUtils.show(LoginActivity.this, e.getMessage()); } @Override public void onNext(HttpResult3<Object, UserInfoDto> data2) { if (!data2.getStatus().equals("success")) { ToastUtils.show(LoginActivity.this, data2.getMsg()); return; } Data.setUserId(data2.getEntity().getId()); try { DBUtils.put(LoginActivity.this, "userId", data2.getEntity().getId() + ""); DBUtils.put(LoginActivity.this, "userName", data2.getEntity().getName() + ""); DBUtils.put(LoginActivity.this, "userNickName", data2.getEntity().getNickName() + ""); DBUtils.put(LoginActivity.this, "authentication", data2.getEntity().getAuthenStatus() + ""); DBUtils.put(LoginActivity.this, "confirmNumber", data2.getEntity().getConfirmNumber() + ""); DBUtils.put(LoginActivity.this, "tokenId", data2.getEntity().getTokenId() + ""); } catch (SnappydbException e) { e.printStackTrace(); } finally { Log.d(TAG, "Login succeed!"); finish(); startActivity(new Intent(LoginActivity.this, MainActivity.class)); } } }); } }, map); } } @Override protected void onCancelled() { mAuthTask = null; showProgress(false); } } @Override public boolean onKeyDown(final int pKeyCode, final KeyEvent pKeyEvent) { switch (pKeyCode) { case KeyEvent.KEYCODE_BACK: return false; // case KeyEvent.KEYCODE_MENU: case KeyEvent.KEYCODE_DPAD_LEFT: case KeyEvent.KEYCODE_DPAD_RIGHT: case KeyEvent.KEYCODE_DPAD_UP: case KeyEvent.KEYCODE_DPAD_DOWN: case KeyEvent.KEYCODE_ENTER: case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE: case KeyEvent.KEYCODE_DPAD_CENTER: return true; default: return super.onKeyDown(pKeyCode, pKeyEvent); } } }
58df7478335888581f6684a01cb40a751a5e8ecf
8befffdb1409e29088fe23f90cab4726841a73fb
/app/src/main/java/com/compilesense/liuyi/detectiondemo/view/XDialog.java
122a6df3b17e043af80bedd286303cd3af157a00
[]
no_license
jaryjun/DetectionDemo
fc718de6460ee8517da915b57bc93343ba5cc388
1db37f620aec83a43a2ef6c5d4fe0307138110f3
refs/heads/master
2021-01-11T00:54:27.575583
2016-10-18T10:31:52
2016-10-18T10:31:52
70,459,449
0
0
null
2016-10-10T06:43:53
2016-10-10T06:43:52
null
UTF-8
Java
false
false
1,799
java
package com.compilesense.liuyi.detectiondemo.view; import android.app.AlertDialog; import android.content.Context; import android.os.Bundle; import android.text.TextUtils; import android.view.View; import android.widget.ProgressBar; import android.widget.TextView; import com.compilesense.liuyi.detectiondemo.R; /** * 加载中Dialog * * @author xm */ public class XDialog extends AlertDialog { private TextView tips_loading_msg; private ProgressBar tips_loading_img; Context mContext; private String message = null; public XDialog(Context context) { super(context); message = "加载中..."; mContext = context; } public XDialog(Context context, String message) { super(context); this.message = message; mContext = context; this.setCancelable(false); } public XDialog(Context context, int theme, String message) { super(context, theme); this.message = message; mContext = context; this.setCancelable(false); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.xdg_loading); tips_loading_img = (ProgressBar) findViewById(R.id.progressbar); tips_loading_msg = (TextView) findViewById(R.id.tips_loading_msg); if (TextUtils.isEmpty(message)) { tips_loading_msg.setVisibility(View.GONE); } else { tips_loading_msg.setText(this.message); } // // 加载动画 // Animation loadingAnim = AnimationUtils.loadAnimation(mContext, // R.anim.xdg_loading); // // 使用ImageView显示动画 // tips_loading_img.startAnimation(loadingAnim); } public void setText(String message) { this.message = message; tips_loading_msg.setText(this.message); } public void setText(int resId) { setText(getContext().getResources().getString(resId)); } }
0735bffc68dfc9f433e7a0c5564149fdf5b22491
e6a6954e25db4e2e8ab948a064e44bb450b0c7ba
/assignment03/src/main/java/service/ReadService.java
bb02046606d0a5b9d5ebc99d4c16e7264709087a
[]
no_license
homeworkSoftawreArchitecture/a3
070370aa26d218189f413aee72babff165d19ae5
21cd596b562a107b28d0239ecaea1ef836d40f1d
refs/heads/master
2020-04-18T07:22:12.385800
2019-01-27T13:21:37
2019-01-27T13:21:37
167,208,688
0
0
null
null
null
null
UTF-8
Java
false
false
51
java
package service; public interface ReadService { }
03736fbb3196d65a384478e194654bd0c60ea9d8
15776ec75c465f996791ac17aa2a35ab1a3b2fc1
/rest-services/src/main/java/ru/sout/pojo/FactorsValue.java
ad736abec4f86f8bc07d40bb04b3eb086bc21ab8
[]
no_license
Latinist/soutREST
dd86160a545149feee6d9a4ce852d7697ca22de7
9fead3d4460224a331f1f0398f7aab2a42c2a3e1
refs/heads/master
2021-08-30T14:02:58.712410
2017-12-18T07:50:20
2017-12-18T07:56:03
114,611,314
0
0
null
null
null
null
UTF-8
Java
false
false
6,810
java
package ru.sout.pojo; import javax.persistence.*; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; /** * Created by Анатолий on 16.03.2015. */ @Entity @Table(name = "STRUCTURE_FACTORS", schema = "SOUT69", catalog = "") public class FactorsValue implements Serializable { private BigDecimal id; private BigDecimal idStructure; private BigDecimal idFactors; private String value2; private String sname; private BigDecimal idStatus; // private BigDecimal idSubfactor; // private BigDecimal valueMax; // private BigDecimal valueAvg; private BigDecimal durProc; private BigDecimal classUt; private BigDecimal classUtSiz; private String note; private String job; private Date dtInsert; public FactorsValue(){}; // @JoinColumn(name = "ID_STRUCTURE", referencedColumnName = "ID", insertable = false, updatable = false) // @ManyToOne // private VStructureMobileEntity workplace; // // public VStructureMobileEntity getWorkplace() { // return workplace; // } ; // // public void setWorkplace(VStructureMobileEntity workplace) { // this.workplace = workplace; // }; //@Basic @Id @Column(name = "ID") // //@GeneratedValue(strategy = GenerationType.IDENTITY) // @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="my_Factors_seq_gen") // @SequenceGenerator(name = "my_Factors_seq_gen", sequenceName = "STRUCTURE_FACTORS_SEQ") public BigDecimal getId() { return id; } public void setId(BigDecimal id) { this.id = id; } @Basic @Column(name = "ID_STRUCTURE") public BigDecimal getIdStructure() { return idStructure; } public void setIdStructure(BigDecimal idStructure) { this.idStructure = idStructure; } @Basic @Column(name = "ID_FACTORS") public BigDecimal getIdFactors() { return idFactors; } public void setIdFactors(BigDecimal idFactors) { this.idFactors = idFactors; } // @Basic // @Column(name = "ID_SUBFACTOR") // public BigDecimal getIdSubfactor() { // return idSubfactor; // } // // public void setIdSubfactor(BigDecimal idSubfactor) { // this.idSubfactor = idSubfactor; // } // // @Basic // @Column(name = "VALUE_MAX") // public BigDecimal getValueMax() { // return valueMax; // } // // public void setValueMax(BigDecimal valueMax) { // this.valueMax = valueMax; // } // // @Basic // @Column(name = "VALUE_AVG") // public BigDecimal getValueAvg() { // return valueAvg; // } // // public void setValueAvg(BigDecimal valueAvg) { // this.valueAvg = valueAvg; // } @Basic @Column(name = "DUR_PROC") public BigDecimal getDurProc() { return durProc; } public void setDurProc(BigDecimal durProc) { this.durProc = durProc; } @Basic @Column(name = "ID_STATUS") public BigDecimal getIdStatus() { return idStatus; } public void setIdStatus(BigDecimal idStatus) { this.idStatus = idStatus; } @Basic @Column(name = "VALUE2") public String getValue2(){ return this.value2; } public void setValue2(String value2) { this.value2 = value2; } @Basic @Column(name = "SNAME") public String getSname() { return sname; } public void setSname(String sname) { this.sname = sname; } @Basic @Column(name = "CLASS_UT") public BigDecimal getClassUt() { return classUt; } public void setClassUt(BigDecimal classUt) { this.classUt = classUt; } @Basic @Column(name = "CLASS_UT_SIZ") public BigDecimal getClassUtSiz() { return classUtSiz; } public void setClassUtSiz(BigDecimal clasUtSiz) { this.classUtSiz = clasUtSiz; } @Basic @Column(name = "NOTE") public String getNote() { return note; } public void setNote(String note) { this.note = note; } @Basic @Column(name = "JOB") public String getJob() { return job; } public void setJob(String job) { this.job = job; } @Basic @Column(name = "DT_INSERT") public Date getDtInsert() {return dtInsert;} public void setDtInsert(Date dtInsert) {this.dtInsert = dtInsert;} @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FactorsValue that = (FactorsValue) o; // if (durProc != null ? !durProc.equals(that.durProc) : that.durProc != null) return false; if (id != null ? !id.equals(that.id) : that.id != null) return false; // if (idExpert != null ? !idExpert.equals(that.idExpert) : that.idExpert != null) return false; if (idFactors != null ? !idFactors.equals(that.idFactors) : that.idFactors != null) return false; if (idStructure != null ? !idStructure.equals(that.idStructure) : that.idStructure != null) return false; // if (idSubfactor != null ? !idSubfactor.equals(that.idSubfactor) : that.idSubfactor != null) return false; // if (idclass != null ? !idclass.equals(that.idclass) : that.idclass != null) return false; // if (note != null ? !note.equals(that.note) : that.note != null) return false; if (value2 != null ? !value2.equals(that.value2) : that.value2 != null) return false; // if (valueAvg != null ? !valueAvg.equals(that.valueAvg) : that.valueAvg != null) return false; // if (valueMax != null ? !valueMax.equals(that.valueMax) : that.valueMax != null) return false; if (sname != null ? !sname.equals(that.sname) : that.sname != null) return false; return true; } @Override public int hashCode() { int result = id != null ? id.hashCode() : 0; result = 31 * result + (idStructure != null ? idStructure.hashCode() : 0); result = 31 * result + (idFactors != null ? idFactors.hashCode() : 0); // result = 31 * result + (idSubfactor != null ? idSubfactor.hashCode() : 0); // result = 31 * result + (valueMax != null ? valueMax.hashCode() : 0); // result = 31 * result + (valueAvg != null ? valueAvg.hashCode() : 0); result = 31 * result + (durProc != null ? durProc.hashCode() : 0); result = 31 * result + (value2 != null ? value2.hashCode() : 0); result = 31 * result + (sname != null ? sname.hashCode() : 0); return result; } }
fc85bab306dab11649504ab379bb89661deab7d3
18fdf6afbe9e5796a6a32be513ee847238c0f33e
/src/main/java/com/github/hotire/r2dbc/Entity/Todo.java
0b7770dd6ecdcdb101a091e733136752e4a10b21
[]
no_license
hotire/spring-r2dbc-mysql
dd0c1f933d85962152134e5434916701ba6ef384
c626fb42a3472b012e7cf7154add4f0996b118fb
refs/heads/master
2022-11-08T07:43:40.000245
2020-06-27T05:12:41
2020-06-27T05:12:41
275,301,688
1
0
null
null
null
null
UTF-8
Java
false
false
396
java
package com.github.hotire.r2dbc.Entity; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import org.springframework.data.annotation.Id; @Setter @Getter @AllArgsConstructor @NoArgsConstructor public class Todo { @Id private Long id; private String description; private String details; private boolean done; }
9fe7e1d0ceaedc3d693f473aeff727df5fa3d0bb
b8f58e4c10a2a7f75aa3990bbaa67be70fb002e2
/xs2a-impl/src/main/java/de/adorsys/psd2/xs2a/service/mapper/psd2/ServiceType.java
315c1f5ace025236aefc89f18c1071f08275473d
[ "Apache-2.0" ]
permissive
Kerusak/xs2a
1e854825e1e281349ef8d7827709353ec948b7eb
f793be3c08b8a883971398289ad50ee314c34e9f
refs/heads/develop
2020-04-22T21:23:42.139479
2019-04-08T11:56:08
2019-04-08T11:56:08
170,672,358
0
0
NOASSERTION
2019-04-08T11:48:23
2019-02-14T10:22:47
Java
UTF-8
Java
false
false
720
java
/* * Copyright 2018-2019 adorsys GmbH & Co KG * * 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 de.adorsys.psd2.xs2a.service.mapper.psd2; public enum ServiceType { AIS, PIS, PIIS, SB }
e5378e867aab2df9b53ff72ee8bc07f53f42f835
ea3024547bb286ccedc11c0d1c71ef4d4788bff6
/src/java/ru/ifmo/genetics/structures/set/LongHashSet.java
49f5ad97229b16160bad82744c53df65ee4dc067
[ "MIT" ]
permissive
ctlab/itmo-assembler
befd44df5e30c6b11cf531e5c89d68e98f936293
163177494fa08c50f056ab219bd626a0130ab338
refs/heads/master
2022-04-30T06:08:15.660730
2022-03-22T08:08:55
2022-03-22T08:08:55
136,324,827
3
1
MIT
2019-09-09T07:22:42
2018-06-06T12:21:50
Java
UTF-8
Java
false
false
9,288
java
package ru.ifmo.genetics.structures.set; import it.unimi.dsi.fastutil.HashCommon; import org.apache.commons.lang.mutable.MutableLong; import ru.ifmo.genetics.utils.NumUtils; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.util.Arrays; import java.util.Iterator; import java.util.NoSuchElementException; import java.util.concurrent.locks.ReentrantLock; /** * Resizable memory-efficient set based on hash table with open addressing.<br></br> * Set is synchronized.<br></br> * It can contain not more than 2^30 (~10^9) elements.<br></br> * <br></br> * * Special key value is used for marking free cells, * but you still can work with this key because it is processed manually.<br></br> * <br></br> * * You can extend it for any need. */ public class LongHashSet implements LongHashSetInterface { public static final float DEFAULT_MAX_LOAD_FACTOR = 0.75f; /** * Key value to mark free cells. */ public static final long FREE = 0; /** * Class guarantees that link to keys array and all other values (except containsFreeKey and size) * will be unchanged during usage! */ protected class SetData { public final long[] keys; public volatile boolean containsFreeKey; public volatile int size; public final int capacity, capacityMask; public final int maxFill; protected SetData(int capacity, float maxLoadFactor) { if (Integer.bitCount(capacity) != 1) { // i.e. not power of 2 throw new RuntimeException("Bad capacity " + capacity + "."); } keys = new long[capacity]; // keys array has already filled with FREE key (which is 0) containsFreeKey = false; size = 0; this.capacity = capacity; capacityMask = capacity - 1; maxFill = (int) Math.ceil(capacity * maxLoadFactor); } } protected volatile SetData data; protected final ReentrantLock writeLock = new ReentrantLock(); protected float maxLoadFactor; // constructors public LongHashSet() { this(20, DEFAULT_MAX_LOAD_FACTOR); // 1 M elements } public LongHashSet(int capacity) { this( NumUtils.getPowerOf2(capacity), DEFAULT_MAX_LOAD_FACTOR ); } public LongHashSet(int logCapacity, float maxLoadFactor) { if (logCapacity > 30) { throw new IllegalArgumentException("log capacity > 30!"); } this.maxLoadFactor = maxLoadFactor; int capacity = 1 << logCapacity; data = new SetData(capacity, maxLoadFactor); } // methods @Override public boolean add(long key) { SetData curData = data; if (key == FREE) { if (curData.containsFreeKey) { return false; } writeLock.lock(); try { curData = data; if (curData.containsFreeKey) { return false; } else { curData.containsFreeKey = true; curData.size++; return true; } } finally { writeLock.unlock(); } } while (true) { int pos = getPositionInt(curData, key); if (curData.keys[pos] == key) { return false; } // no such key, adding... writeLock.lock(); try { if (curData == data && curData.keys[pos] == FREE) { // i.e. nothing has changed curData.keys[pos] = key; curData.size++; if (curData.size >= curData.maxFill) { enlargeAndRehash(); } return true; } } finally { writeLock.unlock(); } } } @Override public boolean contains(long key) { return contains(data, key); } protected static boolean contains(SetData curData, long key) { if (key == FREE) { return curData.containsFreeKey; } int pos = getPositionInt(curData, key); return curData.keys[pos] == key; } /** * NOT WORKING for FREE key, check it manually! */ protected static int getPositionInt(SetData curData, long key) { long h = HashCommon.murmurHash3(key); int pos = (int) (h & curData.capacityMask); long[] keys = curData.keys; while (keys[pos] != FREE && keys[pos] != key) { pos++; if (pos == keys.length) { pos = 0; } } return pos; } private void enlargeAndRehash() { SetData curData = data; if (curData.capacity > Integer.MAX_VALUE / 2) { throw new RuntimeException("Can't enlarge set (can't create single array of 2^31 elements)!"); } int newCapacity = 2 * curData.capacity; SetData newData = new SetData(newCapacity, maxLoadFactor); // coping elements for (long key : curData.keys) { if (key != FREE) { int pos = getPositionInt(newData, key); newData.keys[pos] = key; } } newData.containsFreeKey = curData.containsFreeKey; newData.size = curData.size; data = newData; } @Override public long size() { return data.size; } @Override public long capacity() { return data.capacity; } // -------------- Other methods from interface LongHashSetInterface --------------- /** * USE ONLY then no other thread is working with this set!!! */ @Override public void reset() { writeLock.lock(); SetData curData = data; try { Arrays.fill(curData.keys, FREE); curData.containsFreeKey = false; curData.size = 0; } finally { writeLock.unlock(); } } @Override public void prepare() {} @Override public long maxPosition() { return data.capacity; } @Override public long getPosition(long key) { SetData curData = data; if (key == FREE) { return curData.capacity; } int pos = getPositionInt(curData, key); if (curData.keys[pos] == key) { return pos; } return -1; // not true, if data link is updated } @Override public long elementAt(long pos) { SetData curData = data; if (pos == curData.capacity) { return FREE; // ambiguous answer } return curData.keys[(int) pos]; } @Override public boolean containsAt(long pos) { SetData curData = data; if (pos == curData.capacity) { return curData.containsFreeKey; } return curData.keys[(int) pos] != FREE; } @Override public void write(DataOutput out) throws IOException { SetData curData = data; out.writeInt(curData.capacity); out.writeInt(curData.size); out.writeFloat(maxLoadFactor); for (long key : curData.keys) { out.writeLong(key); } out.writeBoolean(curData.containsFreeKey); } @Override public void readFields(DataInput in) throws IOException { int capacity = in.readInt(); int size = in.readInt(); maxLoadFactor = in.readFloat(); SetData newData = new SetData(capacity, maxLoadFactor); long[] keys = newData.keys; for (int i = 0; i < capacity; i++) { keys[i] = in.readLong(); } newData.containsFreeKey = in.readBoolean(); newData.size = size; data = newData; } @Override public Iterator<MutableLong> iterator() { return new MyIterator(data); } protected class MyIterator implements Iterator<MutableLong> { private final SetData curData; private final long[] keys; private int index = 0; private final MutableLong value = new MutableLong(); MyIterator(SetData data) { curData = data; keys = curData.keys; } @Override public boolean hasNext() { while ((index < keys.length) && (keys[index] == FREE)) { index++; } if (index < keys.length) { return true; } if (index == keys.length && curData.containsFreeKey) { return true; } return false; } @Override public MutableLong next() { if (hasNext()){ if (index < keys.length) { value.setValue(keys[index]); } if (index == keys.length) { value.setValue(FREE); } index++; return value; } throw new NoSuchElementException(); } @Override public void remove() { throw new UnsupportedOperationException(); } } }
fb66e2569632d6ebaca760c765db15be01489551
5ad7463f3d63c0e81f9270c0cc26a718f28b6dc4
/javaee148/day08/src/com/lofxve/classtest/concurrent/set/CopyOnWriteArraySetDome.java
df64a920e24a470753b0974c6dfe673d4452e497
[]
no_license
lofxve/practice
bc7fa993e3ee496696f58f33f092a1c35d9250db
f3f49aa7b0939723776fb776f5aaa13b591efd5e
refs/heads/master
2023-04-07T10:20:08.493390
2021-04-15T08:44:41
2021-04-15T08:44:41
342,749,261
1
0
null
null
null
null
UTF-8
Java
false
false
753
java
package com.lofxve.classtest.concurrent.set; /** * @ClassName CopyOnWriteArrayList * @Author lofxve * @Date 2020/12/21 16:16 */ public class CopyOnWriteArraySetDome { /** * ArrayList 出现的问题 * 索引越界异常 * 底层实现是数组,数组在copy的时候 **/ public static void main(String[] args) throws InterruptedException { NewRunnable newRunnable = new NewRunnable(); new Thread(newRunnable).start(); for (int i = 1000; i < 2000; i++) { NewRunnable.set.add(i); Thread.sleep(1); } System.out.println(Thread.currentThread().getName()+"执行结束"); Thread.sleep(4000); System.out.println(NewRunnable.set.size()); } }
32c8c3a464d4fdd580afabd6e20fb02b778adf2a
f81cdfda16cf9f84a9b34aaa498403211aaab723
/src/com/metcash/webservices/eai/xml/RetailerPriceSohValidationAdapter.java
186889641001eba7f23c8480829c0ec71aa22965
[]
no_license
sanikak14/SVN2
85cf843d1a68405ca89c35ed50d5cf3531b8a971
8c8e2672a53a4283f7e0f49f9b8dc54fb0237dd5
refs/heads/master
2022-04-15T05:12:05.713121
2020-04-16T09:26:15
2020-04-16T09:26:15
255,873,159
0
0
null
null
null
null
UTF-8
Java
false
false
1,047
java
/* */ package com.metcash.webservices.eai.xml; /* */ /* */ import com.metcash.webservices.eai.xml.retailer.pricesoh.validation.RetailerPriceSohResponse; /* */ import java.io.StringWriter; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class RetailerPriceSohValidationAdapter /* */ { /* */ public String getXml(RetailerPriceSohResponse response) throws Exception { /* 27 */ StringWriter stringWriter = new StringWriter(); /* 28 */ response.validate(); /* 29 */ response.marshal(stringWriter); /* 30 */ return stringWriter.toString(); /* */ } /* */ } /* Location: D:\Sanika\iOrders War file\Production backu\cf portalapp04\almws.war\WEB-INF\classes\!\com\metcash\webservices\eai\xml\RetailerPriceSohValidationAdapter.class * Java compiler version: 6 (50.0) * JD-Core Version: 1.1.3 */
c0bf7382cd0447ae261981932eed9efd1f077c27
9b88b56b2052293cd78e2246d2830281e779e95b
/ArbetsRymd/OU_2.java
0121750ab41a5c4bf4d7bd372583b007e52e0ab3
[]
no_license
Erabl/GammalKod
d3298d326e8cd38231aaf1ce0de10e064f79baab
bd9d063518eaa2bd820556b448a0d6ed8809a1de
refs/heads/master
2022-04-12T11:37:33.211394
2020-03-27T09:44:25
2020-03-27T09:44:25
null
0
0
null
null
null
null
ISO-8859-1
Java
false
false
1,112
java
package labb; import java.util.Locale; import java.util.Scanner; public class OU_2 { public static void main(String[] args) { System.out.println("Triangel info"); // inmatningsverktyg=Scanner Scanner in = new Scanner(System.in); in.useLocale(Locale.US); // triangelns sidor System.out.println("Sidor: "); int Sidor = in.nextInt(); // skapa array/vektor double[] t = new double[Sidor + 1]; // ange sidornas värden for (int Sida = 1; Sida <= Sidor; Sida++) { System.out.println("Ange sidor" + Sida + ":"); t[Sida] = in.nextDouble(); } // System.out.println(); //display.sidor // System.out.println("Sidorna"); // for(int Sida =1; Sida<= Sidor; Sida++) // System.out.println(t[sidor]+ ""); //hitta triangelns: //Area //Bisektriser för ab bc ca //radier i cirklarna utan och innan triangeln som anges av formlerna nedan // } public static double bisektris(double b, double c, double alfa) { { double p = 2 * b * c * Math.cos(alfa / 2); double bis = p / (b + c); return bis; } } }
2b98448537d178291409cc22a70fe8b13e6d03af
b127c2d42544db8295655b5a49ee03226aa0c6d1
/JavaClassParsers/src/test/java/ua/com/javatraining/PathToJavaClassFile1.java
c8ddf51677a6d773c69aa10158e293fb37aa84d0
[]
no_license
DmitryDudin/JavaLibraries
89e69f566e593a79330576e7e3333575a580bb76
abefc601438ecf2a66bac27e467d8657e4d9b66c
refs/heads/master
2021-09-15T22:08:10.008007
2021-08-13T12:45:30
2021-08-13T12:45:30
96,709,968
0
0
null
null
null
null
UTF-8
Java
false
false
457
java
package ua.com.javatraining; import org.junit.Test; public class PathToJavaClassFile1 { @Test public void getPath() { // System.out.println(TestClassForParsing.class.getProtectionDomain().getCodeSource().toString()); System.out.println(TestClassForParsing.class.getProtectionDomain().getCodeSource().getLocation().getPath()); System.out.println(TestClassForParsing.class.getResource("TestClassForParsing.class")); } }
52e548f8ef77a99962ddb2638c513ad696eb79b1
e984e48c4b218696b35c640db665bee318a570e2
/app/src/main/java/com/dam/myvet/ui/CerrarSesion/CerrarSesionFragment.java
bd6cb4e8e2f951609ad7cd33f1e5793082ad8797
[]
no_license
gonzalolorca99/myVet
c7af1ed4d863a62de74ff8734f20de62accd503b
84e40bbe5bc30c4d4cbd36fd0d793a293125261c
refs/heads/master
2023-05-02T08:30:23.741869
2021-05-23T17:59:13
2021-05-23T17:59:13
366,467,957
0
0
null
null
null
null
UTF-8
Java
false
false
1,180
java
package com.dam.myvet.ui.CerrarSesion; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; import com.dam.myvet.LoginActivity; import com.dam.myvet.MenuClienteActivity; import com.dam.myvet.R; import com.google.firebase.auth.FirebaseAuth; public class CerrarSesionFragment extends Fragment { public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = inflater.inflate(R.layout.activity_login, container, false); FirebaseAuth.getInstance().signOut(); Intent intent = new Intent(getActivity(), LoginActivity.class); startActivity(intent); return root; } @Override public void onDestroyView() { super.onDestroyView(); } }
95df45a885bb998d0653e3920ebd4e79bdff87ea
e72070a0d558d36e5b3a4eae64a304f49614426a
/src/main/java/Selenide/Moodpanda/LoginPage.java
044b7fb3ef0aa22b73193b3a4e8c303aa4914038
[]
no_license
DimaBog22/AutomationProject-Bogdanov-Dmitry
064a096c1c1cd66a8d85a6dc362e4be684292d8b
97658e6e208e5f699d0b479a83f841cb5087e04f
refs/heads/main
2023-08-21T14:15:27.108132
2021-10-26T13:38:48
2021-10-26T13:38:48
393,130,509
0
0
null
2021-10-09T18:36:46
2021-08-05T17:56:11
Java
UTF-8
Java
false
false
937
java
package Selenide.Moodpanda; import Selenide.BasePage; import Selenide.BaseTestSelenide; import com.codeborne.selenide.Condition; import com.codeborne.selenide.SelenideElement; import lombok.extern.log4j.Log4j2; import org.openqa.selenium.support.FindBy; @Log4j2 public class LoginPage extends BasePage { @FindBy(css = "#UpdateMoodWelcome .modal-header h4") SelenideElement loginPageTitle; @FindBy(name = "ctl00$ContentPlaceHolderContent$TextBoxEmail") SelenideElement emailInput; @FindBy(name = "ctl00$ContentPlaceHolderContent$TextBoxPassword") SelenideElement passwordInput; public LoginPage checkLoginPageTitleText() { loginPageTitle.should(Condition.matchText("Login to MoodPanda")); log.info(loginPageTitle.text()); return this; } public LoginPage verifyLoginPage() { isDisplayed(loginPageTitle, emailInput, passwordInput); return this; } }
897ea9ac77005173bfcd7114d1bfbc05a38f8aa6
efb7aac53bf9de2ef2f7075eb157b05b05820bfa
/src/main/java/com/zjs/cms/entity/Task.java
0eafe6247595fe94aef5ffb7d42e2bba9c2e80d6
[]
no_license
superdafee/cms
6f626bb1a86baa34fc5e6b2b73ae1f8ef42cfaa6
f36b3e5fffb42ce6b7714daa9831bc83beab154b
refs/heads/master
2016-09-06T06:03:00.428053
2014-09-04T09:55:50
2014-09-04T09:55:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,530
java
/******************************************************************************* * Copyright (c) 2005, 2014 springside.github.io * * Licensed under the Apache License, Version 2.0 (the "License"); *******************************************************************************/ package com.zjs.cms.entity; import javax.persistence.*; import org.apache.commons.lang3.builder.ToStringBuilder; import org.hibernate.validator.constraints.NotBlank; //JPA标识 @Entity @Table(name = "t_task") public class Task implements Idable { private Long id; private String title; private String description; private User user; @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="TaskSequence") @SequenceGenerator(name = "TaskSequence", sequenceName = "t_seq_task", allocationSize = 1) public Long getId() { return id; } public void setId(Long id) { this.id = id; } // JSR303 BeanValidator的校验规则 @NotBlank public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } // JPA 基于USER_ID列的多对一关系定义 @ManyToOne @JoinColumn(name = "user_id") public User getUser() { return user; } public void setUser(User user) { this.user = user; } @Override public String toString() { return ToStringBuilder.reflectionToString(this); } }
ef2881c4e3659e263073d01494d897192c82e396
f1440fc4695eddc44037c68bdf082ce77c2698ab
/app/src/test/java/com/lzp/androiddemo/ExampleUnitTest.java
86071eeb890013a042d93aeba2caa005338c4249
[]
no_license
initLiu/AndroidDemo
7bce970ddcee2fec61a2ab6c31ade33726726781
bc0ab623d0ae4e218be0ca6829f4b7fdde615f8d
refs/heads/master
2020-03-19T01:45:36.855172
2018-06-05T10:33:53
2018-06-05T10:33:53
135,570,269
0
0
null
null
null
null
UTF-8
Java
false
false
380
java
package com.lzp.androiddemo; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
8497f23d54d08340fbf5f776891246e700fa53c3
0b211c182b4b9bd87caa16ec6c51f48cb3ab3465
/jatrick/android_jatrik/src/com/tsi206/jatrik/util/SystemUiHider.java
2ad439d60bd5f2142086c5f813a61db1798f0625
[]
no_license
jml88/tsi206
32136328a5aeff464935d92f336f86ad6aae9686
c7bd2e0927614ab5e08f14a250bdf5b5c6eae933
refs/heads/master
2021-01-19T08:23:52.891347
2014-12-03T16:45:50
2014-12-03T16:45:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,401
java
package com.tsi206.jatrik.util; import android.app.Activity; import android.os.Build; import android.view.View; /** * A utility class that helps with showing and hiding system UI such as the * status bar and navigation/system bar. This class uses backward-compatibility * techniques described in <a href= * "http://developer.android.com/training/backward-compatible-ui/index.html"> * Creating Backward-Compatible UIs</a> to ensure that devices running any * version of ndroid OS are supported. More specifically, there are separate * implementations of this abstract class: for newer devices, * {@link #getInstance} will return a {@link SystemUiHiderHoneycomb} instance, * while on older devices {@link #getInstance} will return a * {@link SystemUiHiderBase} instance. * <p> * For more on system bars, see <a href= * "http://developer.android.com/design/get-started/ui-overview.html#system-bars" * > System Bars</a>. * * @see android.view.View#setSystemUiVisibility(int) * @see android.view.WindowManager.LayoutParams#FLAG_FULLSCREEN */ public abstract class SystemUiHider { /** * When this flag is set, the * {@link android.view.WindowManager.LayoutParams#FLAG_LAYOUT_IN_SCREEN} * flag will be set on older devices, making the status bar "float" on top * of the activity layout. This is most useful when there are no controls at * the top of the activity layout. * <p> * This flag isn't used on newer devices because the <a * href="http://developer.android.com/design/patterns/actionbar.html">action * bar</a>, the most important structural element of an Android app, should * be visible and not obscured by the system UI. */ public static final int FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES = 0x1; /** * When this flag is set, {@link #show()} and {@link #hide()} will toggle * the visibility of the status bar. If there is a navigation bar, show and * hide will toggle low profile mode. */ public static final int FLAG_FULLSCREEN = 0x2; /** * When this flag is set, {@link #show()} and {@link #hide()} will toggle * the visibility of the navigation bar, if it's present on the device and * the device allows hiding it. In cases where the navigation bar is present * but cannot be hidden, show and hide will toggle low profile mode. */ public static final int FLAG_HIDE_NAVIGATION = FLAG_FULLSCREEN | 0x4; /** * The activity associated with this UI hider object. */ protected Activity mActivity; /** * The view on which {@link View#setSystemUiVisibility(int)} will be called. */ protected View mAnchorView; /** * The current UI hider flags. * * @see #FLAG_FULLSCREEN * @see #FLAG_HIDE_NAVIGATION * @see #FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES */ protected int mFlags; /** * The current visibility callback. */ protected OnVisibilityChangeListener mOnVisibilityChangeListener = sDummyListener; /** * Creates and returns an instance of {@link SystemUiHider} that is * appropriate for this device. The object will be either a * {@link SystemUiHiderBase} or {@link SystemUiHiderHoneycomb} depending on * the device. * * @param activity * The activity whose window's system UI should be controlled by * this class. * @param anchorView * The view on which {@link View#setSystemUiVisibility(int)} will * be called. * @param flags * Either 0 or any combination of {@link #FLAG_FULLSCREEN}, * {@link #FLAG_HIDE_NAVIGATION}, and * {@link #FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES}. */ public static SystemUiHider getInstance(Activity activity, View anchorView, int flags) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { return new SystemUiHiderHoneycomb(activity, anchorView, flags); } else { return new SystemUiHiderBase(activity, anchorView, flags); } } protected SystemUiHider(Activity activity, View anchorView, int flags) { mActivity = activity; mAnchorView = anchorView; mFlags = flags; } /** * Sets up the system UI hider. Should be called from * {@link Activity#onCreate}. */ public abstract void setup(); /** * Returns whether or not the system UI is visible. */ public abstract boolean isVisible(); /** * Hide the system UI. */ public abstract void hide(); /** * Show the system UI. */ public abstract void show(); /** * Toggle the visibility of the system UI. */ public void toggle() { if (isVisible()) { hide(); } else { show(); } } /** * Registers a callback, to be triggered when the system UI visibility * changes. */ public void setOnVisibilityChangeListener( OnVisibilityChangeListener listener) { if (listener == null) { listener = sDummyListener; } mOnVisibilityChangeListener = listener; } /** * A dummy no-op callback for use when there is no other listener set. */ private static OnVisibilityChangeListener sDummyListener = new OnVisibilityChangeListener() { @Override public void onVisibilityChange(boolean visible) { } }; /** * A callback interface used to listen for system UI visibility changes. */ public interface OnVisibilityChangeListener { /** * Called when the system UI visibility has changed. * * @param visible * True if the system UI is visible. */ public void onVisibilityChange(boolean visible); } }
6d3902a495c5fc1ed5a639e88506e69886bb32f4
b210a63440f3ff300c900c7183bd688f8afb72c7
/demo/src/main/java/com/goteny/melo/demo/bean/GitHubMain.java
4724fbbf665f2d249dc3b9d042a6447e4b6b3c7b
[]
no_license
zjjne/melo
89fd094db14f2e62712dbcd652439b002df93f31
a4a4735bd93296b365472c10a756b2067e77c28e
refs/heads/master
2021-01-06T20:44:09.460268
2018-11-05T06:31:01
2018-11-05T06:31:01
99,550,634
2
0
null
null
null
null
UTF-8
Java
false
false
9,787
java
package com.goteny.melo.demo.bean; public class GitHubMain { /** * current_user_url : https://api.github.com/user * current_user_authorizations_html_url : https://github.com/settings/connections/applications{/client_id} * authorizations_url : https://api.github.com/authorizations * code_search_url : https://api.github.com/search/code?q={query}{&page,per_page,sort,order} * commit_search_url : https://api.github.com/search/commits?q={query}{&page,per_page,sort,order} * emails_url : https://api.github.com/user/emails * emojis_url : https://api.github.com/emojis * events_url : https://api.github.com/events * feeds_url : https://api.github.com/feeds * followers_url : https://api.github.com/user/followers * following_url : https://api.github.com/user/following{/target} * gists_url : https://api.github.com/gists{/gist_id} * hub_url : https://api.github.com/hub * issue_search_url : https://api.github.com/search/issues?q={query}{&page,per_page,sort,order} * issues_url : https://api.github.com/issues * keys_url : https://api.github.com/user/keys * notifications_url : https://api.github.com/notifications * organization_repositories_url : https://api.github.com/orgs/{org}/repos{?type,page,per_page,sort} * organization_url : https://api.github.com/orgs/{org} * public_gists_url : https://api.github.com/gists/public * rate_limit_url : https://api.github.com/rate_limit * repository_url : https://api.github.com/repos/{owner}/{repo} * repository_search_url : https://api.github.com/search/repositories?q={query}{&page,per_page,sort,order} * current_user_repositories_url : https://api.github.com/user/repos{?type,page,per_page,sort} * starred_url : https://api.github.com/user/starred{/owner}{/repo} * starred_gists_url : https://api.github.com/gists/starred * team_url : https://api.github.com/teams * user_url : https://api.github.com/users/{user} * user_organizations_url : https://api.github.com/user/orgs * user_repositories_url : https://api.github.com/users/{user}/repos{?type,page,per_page,sort} * user_search_url : https://api.github.com/search/users?q={query}{&page,per_page,sort,order} */ private String current_user_url; private String current_user_authorizations_html_url; private String authorizations_url; private String code_search_url; private String commit_search_url; private String emails_url; private String emojis_url; private String events_url; private String feeds_url; private String followers_url; private String following_url; private String gists_url; private String hub_url; private String issue_search_url; private String issues_url; private String keys_url; private String notifications_url; private String organization_repositories_url; private String organization_url; private String public_gists_url; private String rate_limit_url; private String repository_url; private String repository_search_url; private String current_user_repositories_url; private String starred_url; private String starred_gists_url; private String team_url; private String user_url; private String user_organizations_url; private String user_repositories_url; private String user_search_url; public String getCurrent_user_url() { return current_user_url; } public void setCurrent_user_url(String current_user_url) { this.current_user_url = current_user_url; } public String getCurrent_user_authorizations_html_url() { return current_user_authorizations_html_url; } public void setCurrent_user_authorizations_html_url(String current_user_authorizations_html_url) { this.current_user_authorizations_html_url = current_user_authorizations_html_url; } public String getAuthorizations_url() { return authorizations_url; } public void setAuthorizations_url(String authorizations_url) { this.authorizations_url = authorizations_url; } public String getCode_search_url() { return code_search_url; } public void setCode_search_url(String code_search_url) { this.code_search_url = code_search_url; } public String getCommit_search_url() { return commit_search_url; } public void setCommit_search_url(String commit_search_url) { this.commit_search_url = commit_search_url; } public String getEmails_url() { return emails_url; } public void setEmails_url(String emails_url) { this.emails_url = emails_url; } public String getEmojis_url() { return emojis_url; } public void setEmojis_url(String emojis_url) { this.emojis_url = emojis_url; } public String getEvents_url() { return events_url; } public void setEvents_url(String events_url) { this.events_url = events_url; } public String getFeeds_url() { return feeds_url; } public void setFeeds_url(String feeds_url) { this.feeds_url = feeds_url; } public String getFollowers_url() { return followers_url; } public void setFollowers_url(String followers_url) { this.followers_url = followers_url; } public String getFollowing_url() { return following_url; } public void setFollowing_url(String following_url) { this.following_url = following_url; } public String getGists_url() { return gists_url; } public void setGists_url(String gists_url) { this.gists_url = gists_url; } public String getHub_url() { return hub_url; } public void setHub_url(String hub_url) { this.hub_url = hub_url; } public String getIssue_search_url() { return issue_search_url; } public void setIssue_search_url(String issue_search_url) { this.issue_search_url = issue_search_url; } public String getIssues_url() { return issues_url; } public void setIssues_url(String issues_url) { this.issues_url = issues_url; } public String getKeys_url() { return keys_url; } public void setKeys_url(String keys_url) { this.keys_url = keys_url; } public String getNotifications_url() { return notifications_url; } public void setNotifications_url(String notifications_url) { this.notifications_url = notifications_url; } public String getOrganization_repositories_url() { return organization_repositories_url; } public void setOrganization_repositories_url(String organization_repositories_url) { this.organization_repositories_url = organization_repositories_url; } public String getOrganization_url() { return organization_url; } public void setOrganization_url(String organization_url) { this.organization_url = organization_url; } public String getPublic_gists_url() { return public_gists_url; } public void setPublic_gists_url(String public_gists_url) { this.public_gists_url = public_gists_url; } public String getRate_limit_url() { return rate_limit_url; } public void setRate_limit_url(String rate_limit_url) { this.rate_limit_url = rate_limit_url; } public String getRepository_url() { return repository_url; } public void setRepository_url(String repository_url) { this.repository_url = repository_url; } public String getRepository_search_url() { return repository_search_url; } public void setRepository_search_url(String repository_search_url) { this.repository_search_url = repository_search_url; } public String getCurrent_user_repositories_url() { return current_user_repositories_url; } public void setCurrent_user_repositories_url(String current_user_repositories_url) { this.current_user_repositories_url = current_user_repositories_url; } public String getStarred_url() { return starred_url; } public void setStarred_url(String starred_url) { this.starred_url = starred_url; } public String getStarred_gists_url() { return starred_gists_url; } public void setStarred_gists_url(String starred_gists_url) { this.starred_gists_url = starred_gists_url; } public String getTeam_url() { return team_url; } public void setTeam_url(String team_url) { this.team_url = team_url; } public String getUser_url() { return user_url; } public void setUser_url(String user_url) { this.user_url = user_url; } public String getUser_organizations_url() { return user_organizations_url; } public void setUser_organizations_url(String user_organizations_url) { this.user_organizations_url = user_organizations_url; } public String getUser_repositories_url() { return user_repositories_url; } public void setUser_repositories_url(String user_repositories_url) { this.user_repositories_url = user_repositories_url; } public String getUser_search_url() { return user_search_url; } public void setUser_search_url(String user_search_url) { this.user_search_url = user_search_url; } }
5249443a8f6fee4c4ba5135db136ee87d0ab6e73
ea4dfacb8354b1a61e0e7fa09152921fdedd3e47
/src/com/chris/util/FileUtil.java
f42f901f909d01cd930edf1277849c5df5dfbdba
[]
no_license
havelife/Address_Crawler_Java
a63610f35625d3fa3e1d822c6ed727793deb1c2c
b1fb11cc75a11625ab0d6fc712e1c82d2f7b4f35
refs/heads/master
2020-05-27T00:00:04.370028
2012-05-04T12:02:41
2012-05-04T12:02:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,324
java
package com.chris.util; import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.ArrayList; public class FileUtil { public static BufferedWriter getBufferedWriter(String filePath) { File file = new File(filePath); try { BufferedWriter bw = new BufferedWriter(new FileWriter(file)); return bw; } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } public static BufferedWriter getBufferedWriter(String filePath, String encoding) { File file = new File(filePath); try { OutputStreamWriter write = new OutputStreamWriter( new FileOutputStream(file), encoding); BufferedWriter bw = new BufferedWriter(write); return bw; } catch (IOException e) { e.printStackTrace(); } return null; } public static BufferedReader getBufferedReader(String filePath) { File file = new File(filePath); try { BufferedReader br = new BufferedReader(new FileReader(file)); return br; } catch (IOException e) { e.printStackTrace(); } return null; } public static BufferedReader getBufferedReader(String filePath, String encoding) { File file = new File(filePath); try { InputStreamReader read = new InputStreamReader(new FileInputStream( file), encoding); BufferedReader br = new BufferedReader(read); return br; } catch (IOException e) { e.printStackTrace(); } return null; } /* public static String getDataFile2Str(String filePath) { BufferedReader br = getBufferedReader(filePath); String tmp; StringBuffer sb = new StringBuffer(); try { while ((tmp = br.readLine()) != null) { sb.append(tmp); } } catch (IOException e) { e.printStackTrace(); } return sb.toString(); } */ public static String getDataFile2Str(String filePath) { //, String encoding String encoding = getFileEncoding(filePath); BufferedReader br = getBufferedReader(filePath, encoding); String tmp; StringBuffer sb = new StringBuffer(); try { while ((tmp = br.readLine()) != null) { sb.append(tmp); } } catch (IOException e) { e.printStackTrace(); } return sb.toString(); } public static String getDataFile2Str(String filePath, String encoding) { BufferedReader br = getBufferedReader(filePath, encoding); String tmp; StringBuffer sb = new StringBuffer(); try { while ((tmp = br.readLine()) != null) { sb.append(tmp); } } catch (IOException e) { e.printStackTrace(); } return sb.toString(); } public static String getDataFile2StrKeepReturn(String filePath, String encoding) { BufferedReader br = getBufferedReader(filePath, encoding); String tmp; StringBuffer sb = new StringBuffer(); try { while ((tmp = br.readLine()) != null) { sb.append(tmp + "\n"); } } catch (IOException e) { e.printStackTrace(); } return sb.toString(); } public static boolean writeStr2File(String src, String filePath) { BufferedWriter bw = getBufferedWriter(filePath); try { bw.append(src); bw.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return true; } public static boolean writeStr2File(String src, String filePath, String encoding) { BufferedWriter bw = getBufferedWriter(filePath, encoding); try { bw.append(src); bw.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return true; } /** * Java:判断文件的编�? * * @param sourceFile * 需�?判断编�?的文件 * @return String 文件编�? */ public static String getFileEncoding(String filePath) { //File sourceFile String charset = "GBK"; byte[] first3Bytes = new byte[3]; try { // boolean checked = false; BufferedInputStream bis = new BufferedInputStream( new FileInputStream(new File(filePath))); bis.mark(0); int read = bis.read(first3Bytes, 0, 3); //System.out.println("字节大�?:" + read); if (read == -1) { return charset; // 文件编�?为 ANSI } else if (first3Bytes[0] == (byte) 0xFF && first3Bytes[1] == (byte) 0xFE) { charset = "UTF-16LE"; // 文件编�?为 Unicode // checked = true; } else if (first3Bytes[0] == (byte) 0xFE && first3Bytes[1] == (byte) 0xFF) { charset = "UTF-16BE"; // 文件编�?为 Unicode big endian // checked = true; } else if (first3Bytes[0] == (byte) 0xEF && first3Bytes[1] == (byte) 0xBB && first3Bytes[2] == (byte) 0xBF) { charset = "UTF-8"; // 文件编�?为 UTF-8 // checked = true; } bis.reset(); /* * if (!checked) { int loc = 0; * * while ((read = bis.read()) != -1) { loc++; if (read >= 0xF0) * break; if (0x80 <= read && read <= 0xBF) // �?�独出现BF以下的,也算是GBK * break; if (0xC0 <= read && read <= 0xDF) { read = bis.read(); if * (0x80 <= read && read <= 0xBF) // �?�字节 (0xC0 - 0xDF) // (0x80 // - * 0xBF),也�?�能在GB编�?内 continue; else break; } else if (0xE0 <= read && * read <= 0xEF) {// 也有�?�能出错,但是几率较�? read = bis.read(); if (0x80 <= * read && read <= 0xBF) { read = bis.read(); if (0x80 <= read && * read <= 0xBF) { charset = "UTF-8"; break; } else break; } else * break; } } // System.out.println( loc + " " + * Integer.toHexString( read ) // ); } */ bis.close(); } catch (Exception e) { e.printStackTrace(); } return charset; } public static void levelOrder(File file){ File c; File[] cc; ArrayList<File> q = new ArrayList<File>(); if(file == null) return; c = file; q.add(c); while(q.size()!=0){ c = q.remove(0); doInLevelOrder(c); //System.out.println(c.getAbsolutePath()); cc = c.listFiles(); if(cc != null) for(File tmp : cc)q.add(tmp); } } // 在宽度�??历的时候,你对于�?个节点想�?�的�?作,就写在这个doInLevelOrder()里 public static void doInLevelOrder(File c){ System.out.println(c.getAbsolutePath()); } }
d42c0665eea5f0029817ac33076ef40fe954f119
58cf862c50a0c5f930c087ec22b15aa7c3dbb847
/src/org/fkit/domain/cur_Temperature.java
c7fe8297a278bd70ff0597ad47728d14be39ebf0
[]
no_license
zx669412425/DataCenterMonitoringSystem
8c06003730307a67f297de42b67aa73a0919cdd5
6d74cc0ee4c2bdc8ab0a5240d72525b08aa1dc91
refs/heads/master
2020-06-15T04:21:30.790795
2019-07-04T08:33:53
2019-07-04T08:33:53
195,201,893
1
0
null
null
null
null
UTF-8
Java
false
false
703
java
package org.fkit.domain; public class cur_Temperature { String time_t; String temp_1; String temp_2; String temp_3; public String getTime_t() { return time_t; } public void setTime_t(String time_t) { this.time_t = time_t; } public String getTemp_1() { return temp_1; } public void setTemp_1(String temp_1) { this.temp_1 = temp_1; } public String getTemp_2() { return temp_2; } public void setTemp_2(String temp_2) { this.temp_2 = temp_2; } public String getTemp_3() { return temp_3; } public void setTemp_3(String temp_3) { this.temp_3 = temp_3; } }
83177478027820676e7b3b2bda916c210e59ccdc
9254e7279570ac8ef687c416a79bb472146e9b35
/rds-20140815/src/main/java/com/aliyun/rds20140815/models/CreateAccountResponse.java
411ccb5694ffac4f35a52cfb9fdb9e7e7f44bc81
[ "Apache-2.0" ]
permissive
lquterqtd/alibabacloud-java-sdk
3eaa17276dd28004dae6f87e763e13eb90c30032
3e5dca8c36398469e10cdaaa34c314ae0bb640b4
refs/heads/master
2023-08-12T13:56:26.379027
2021-10-19T07:22:15
2021-10-19T07:22:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,043
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.rds20140815.models; import com.aliyun.tea.*; public class CreateAccountResponse extends TeaModel { @NameInMap("headers") @Validation(required = true) public java.util.Map<String, String> headers; @NameInMap("body") @Validation(required = true) public CreateAccountResponseBody body; public static CreateAccountResponse build(java.util.Map<String, ?> map) throws Exception { CreateAccountResponse self = new CreateAccountResponse(); return TeaModel.build(map, self); } public CreateAccountResponse setHeaders(java.util.Map<String, String> headers) { this.headers = headers; return this; } public java.util.Map<String, String> getHeaders() { return this.headers; } public CreateAccountResponse setBody(CreateAccountResponseBody body) { this.body = body; return this; } public CreateAccountResponseBody getBody() { return this.body; } }
8351b4c9af51a364823bde0edaea423e5fe69e32
7d9b926b065c5fff0771d1e3596236870e8ead45
/rest/springREST9/src/main/java/com/kalyan/springboot/Controller/Employee.java
7c4558eba1adb6fbc43bc2716a8d003ac4a312ee
[]
no_license
kkk-333/assign
974ccb614f2c0ad6d3889180699a1cb481176005
68426edb3148a3be09066521b752404e4e29b878
refs/heads/main
2023-03-28T10:23:27.071083
2021-03-31T16:08:08
2021-03-31T16:08:08
352,958,604
0
0
null
null
null
null
UTF-8
Java
false
false
970
java
package com.kalyan.springboot.Controller; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class Employee { @Id private long id; private String name; private String department; private String designation; public Employee() { } public Employee(long id, String name, String department, String designation) { super(); this.id = id; this.name = name; this.department = department; this.designation = designation; } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDepartment() { return department; } public void setDepartment(String department) { this.department = department; } public String getDesignation() { return designation; } public void setDesignation(String designation) { this.designation = designation; } }
8749b7fa8fb3a628399c1e22df59c26cc3eb31ee
f17b7cc1574c97c793e02eddaaf8961b99da5192
/src/main/java/com/raman/lis/task01/bogdanovich/Task_1.java
f7c93d7642af92631bd79500b0a61486394ab9fe
[]
no_license
dmaksimn/java_core
ca3f811a80511fa4a791310dbff85616e249b2ab
32fb3b3f7d1a912a8b0f1cd5b71ad085979e7400
refs/heads/main
2023-04-21T12:26:47.548875
2021-05-14T13:34:55
2021-05-14T13:34:55
350,718,728
0
0
null
2021-05-14T13:34:56
2021-03-23T13:15:09
Java
UTF-8
Java
false
false
532
java
package com.raman.lis.task01.bogdanovich; public class Task_1 { public static void main(String[] args) { int l = 10, n = 10, i, sum = 0; int array[] = new int[10]; for(i = 0; i < 10; i++) { array[i] = (int) (Math.random() * 10 + 3); n = array[2]; System.out.println(array[i]); if (array[i] != n) { sum += array[i]; } } System.out.println("n = " + n); System.out.println("Сумма = " + sum); } }
bad7a1f0cf45cf8d3dd0ae644d8e904bbb6b515c
13169996b1dc850d66cbad87cb4f9e3024e4d2d0
/src/main/java/model/itemandcateDTO.java
ce5d09122dd003c00dcdb5aaa0221fbcc453e61d
[]
no_license
eugeneji/final_project
cbd21448b95c54320d154bc4afb2e410f7ac7be4
f6d8eaa04909390262a1cd1e29f4a29278b45c50
refs/heads/master
2023-06-26T19:12:22.298368
2021-07-29T08:33:02
2021-07-29T08:33:02
332,145,412
0
0
null
null
null
null
UTF-8
Java
false
false
3,086
java
package more.itemandcate.model; import java.sql.Date; public class itemandcateDTO { private int item_idx; private String item_name; private String cate_code; private int item_price; private String item_info; private String item_mainimg; private int item_stock; private String item_regid; private String item_regdate; private String item_tf; private String cate_parent; private String rnum; private int star_total; private double star_avg; public itemandcateDTO() { super(); } public itemandcateDTO(int item_idx, String item_name, String cate_code, int item_price, String item_info, String item_mainimg, int item_stock, String item_regid, String item_regdate, String item_tf, String cate_parent, String rnum, int star_total, double star_avg) { super(); this.item_idx = item_idx; this.item_name = item_name; this.cate_code = cate_code; this.item_price = item_price; this.item_info = item_info; this.item_mainimg = item_mainimg; this.item_stock = item_stock; this.item_regid = item_regid; this.item_regdate = item_regdate; this.item_tf = item_tf; this.cate_parent = cate_parent; this.rnum = rnum; this.star_total = star_total; this.star_avg = star_avg; } public int getItem_idx() { return item_idx; } public void setItem_idx(int item_idx) { this.item_idx = item_idx; } public String getItem_name() { return item_name; } public void setItem_name(String item_name) { this.item_name = item_name; } public String getCate_code() { return cate_code; } public void setCate_code(String cate_code) { this.cate_code = cate_code; } public int getItem_price() { return item_price; } public void setItem_price(int item_price) { this.item_price = item_price; } public String getItem_info() { return item_info; } public void setItem_info(String item_info) { this.item_info = item_info; } public String getItem_mainimg() { return item_mainimg; } public void setItem_mainimg(String item_mainimg) { this.item_mainimg = item_mainimg; } public int getItem_stock() { return item_stock; } public void setItem_stock(int item_stock) { this.item_stock = item_stock; } public String getItem_regid() { return item_regid; } public void setItem_regid(String item_regid) { this.item_regid = item_regid; } public String getItem_regdate() { return item_regdate; } public void setItem_regdate(String item_regdate) { this.item_regdate = item_regdate; } public String getItem_tf() { return item_tf; } public void setItem_tf(String item_tf) { this.item_tf = item_tf; } public String getCate_parent() { return cate_parent; } public void setCate_parent(String cate_parent) { this.cate_parent = cate_parent; } public String getRnum() { return rnum; } public void setRnum(String rnum) { this.rnum = rnum; } public int getStar_total() { return star_total; } public void setStar_total(int star_total) { this.star_total = star_total; } public double getStar_avg() { return star_avg; } public void setStar_avg(double star_avg) { this.star_avg = star_avg; } }
[ "eugeneJI@DESKTOP-5MJMMD4" ]
eugeneJI@DESKTOP-5MJMMD4
f93cd3f127698cd0623a2fd3e91f14e7036b0942
046219009562c532bb192e2e563c5c246f180c2f
/app/src/main/java/com/lazeebear/parkhere/ServerConnector/Configs.java
8f646b7940e4a6732eca557f9ef91c781636c4d7
[]
no_license
baarian13/ParkHere_new
326eca6dfd4feff35a3d719a05755a026fa312a0
cb4b39d2eb9c15d9e2da743cd383ba7132866fd2
refs/heads/master
2021-01-13T13:12:08.920452
2016-11-30T07:29:52
2016-11-30T07:29:52
72,690,606
1
0
null
null
null
null
UTF-8
Java
false
false
3,301
java
package com.lazeebear.parkhere.ServerConnector; /** * Created by rjaso on 10/27/2016. */ public class Configs { // RESTful Endpoints public static final String baseURL = "http://localhost:8080"; public static final String signinEndpoint = "/signin"; /* Send: String email String password Returns: Success - 200 returned Failure - 401 returned */ public static final String signupEndpoint = "/signup"; /* Send: String username String email String password String firstName String lastName String phoneNumber String photo Bool seeker Bool owner Returns: Success - 200 returned Partial Success - 206 returned (Profile photo submission unsuccessful Failure - 401 returned */ public static final String searchEndpoint = "/search"; /* Send: String address Int longitude Int latitude Int month Int day Int year TIME startTime TIME endTime Returns: List spots String address TIME startTime TIME endTime Int price */ public static final String viewSpotEndpoint = "/view/spot"; /* Send: Int spotID Return: String address Int latitude Int longitude Int ownerRating String picture String phoneNumber TIME startTime TIME endTime String description Float price Int rating */ public static final String postSpotEndpoint = "/post/spot"; /* Send: String address Int latitude Int longitude Int ownerRating String picture String phoneNumber TIME startTime TIME endTime String description String price Return: Success - 200 returned Failure - 401 returned */ public static final String viewUserEndpoint = "/view/user"; /* Send: String email Returns: String username String email Int rating String phoneNumber String email */ public static final String rateUserEndpoint = "/rate"; /* Send: Int spotID Int rating Returns: Success - 200 returned Failure - 401 returned */ public static final String bookSpotEndpoint = "/book"; /* Send: Int spotID String email Returns: Success - 200 returned Failure - 401 returned */ public static final String deleteSpotEndpoint = "/delete"; /* Send: Int spotID Returns: Success - 200 returned Failure - 401 returned */ public static final String viewRentalsEndpoint = "/view/rentals"; /* Send: String email Returns: List<spot> spots */ public static final String viewPostingsEndpoint = "/view/postings"; /* Send: String email Returns: List<spot> spots */ public static final String forgotPasswordEndpoint = "/password/reset"; /* Send: String email Returns: Success - 200 returned Failure - 401 returned */ }
f6294c98a4f44994047b7ed26d729fd6d74a5b52
40e8c09c2e2b420bc9ff464d6ab1228776b176ab
/Pattern5.java
08131b8f14d75774d5d080ff87cce58e03f2e275
[]
no_license
komaragirividya/Java
a254b1bd65f9e52aa49a6a62be47d73399db5acd
8c69e0d71d1035e1b9aad47dede10b5c4c6cf63c
refs/heads/master
2021-01-19T09:55:18.836878
2017-03-12T14:56:26
2017-03-12T14:56:26
82,151,729
0
0
null
null
null
null
UTF-8
Java
false
false
273
java
package numbPattern; /*12345 1234 123 12 1*/ public class Pattern5 { public static void main( String arg[]) { for(int i=5;i>=1;i--){ for(int j=1;j<=i;j++){ System.out.print(j); } System.out.println(); } } }
fa657024efd46e3101001cda9dde5e909cbb6cbd
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/test/java/org/gradle/test/performancenull_288/Testnull_28734.java
6e700116cd63f6fe824f58a632dc759c12c53a14
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
308
java
package org.gradle.test.performancenull_288; import static org.junit.Assert.*; public class Testnull_28734 { private final Productionnull_28734 production = new Productionnull_28734("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
9e8d1bdd58a4a565118c5e027f467441e8684b56
15c3f5f8027eebb454898660801fd3989458a850
/src/view/View.java
ae591ae8df5d94ed4210a65028d2690e9e79e167
[]
no_license
LuisTerceroIII/Greedy-algorithm
6869fa19a011e7b2fd818015020c8884b04504ca
5675feced0d98454096673237d7bf16dc5670ef8
refs/heads/master
2023-09-03T00:50:57.219434
2021-11-04T04:30:45
2021-11-04T04:30:45
420,874,645
0
0
null
2021-11-04T04:30:46
2021-10-25T04:12:39
Java
UTF-8
Java
false
false
2,034
java
package view; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JLabel; import java.awt.Font; import javax.swing.SwingConstants; import controller.Controller; import javax.swing.JButton; import java.awt.event.ActionListener; import java.util.ArrayList; import java.awt.event.ActionEvent; public class View { private JFrame _frame; private CalendarView _calendarView; private ArrayList<String> _calendarData; private Controller _controller; public View(ArrayList<String> calendarData, Controller controller) { super(); this._calendarData = calendarData; _controller = controller; init(); } /** * Launch the application. */ public void start() { EventQueue.invokeLater(new Runnable() { public void run() { try { _frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the application. */ public View() { init(); } /** * Initialize the contents of the frame. */ private void init() { _frame = new JFrame(); _frame.setBounds(100, 100, 696, 572); _frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); _frame.getContentPane().setLayout(null); _frame.setResizable(false); _calendarView = new CalendarView(_calendarData); _frame.getContentPane().add(_calendarView.getScrollPanel()); JLabel title = new JLabel("Calendario Campeonato"); title.setFont(new Font("Tahoma", Font.PLAIN, 28)); title.setHorizontalAlignment(SwingConstants.CENTER); title.setVerticalAlignment(SwingConstants.BOTTOM); title.setBounds(107, 11, 488, 62); _frame.getContentPane().add(title); JButton asignarReferis = new JButton("Asignar Referis"); asignarReferis.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { _controller.assignReferees(); } }); asignarReferis.setBounds(266, 476, 156, 23); _frame.getContentPane().add(asignarReferis); } public void updateCalendar(ArrayList<String> matches) { _calendarView.updateCalendar(matches); } }
95c426e933394352a8b8ed4c88c8acf9d4b1f699
119d5043ab506518796a9454acd3b8a0d20910c5
/src/main/java/com/brt/xwl/repository/PermissionRepository.java
b52f10a15039bd3b38e55e01f21f1bebc68a66bc
[]
no_license
xuanweilun/springSecurityTest
f85e91e0e7358a1cf375bcd86234d97122c4b93e
282053b94bc982bde6b9f4707a3056bcc1da999d
refs/heads/master
2021-07-04T06:20:35.848134
2020-01-19T08:17:54
2020-01-19T08:17:54
229,912,871
0
0
null
2021-04-26T19:53:29
2019-12-24T09:29:36
JavaScript
UTF-8
Java
false
false
393
java
package com.brt.xwl.repository; import org.springframework.data.jpa.repository.JpaRepository; import com.brt.xwl.entity.Permission; /** * @ClassName: PermissionRepository * @Description: TODO(这里用一句话描述这个类的作用) * @author xuanweilun * @date 2019年12月26日 下午17:48:85 */ public interface PermissionRepository extends JpaRepository<Permission, Long>{ }
[ "xuanweilun" ]
xuanweilun
77b96a61a2805a31d7666150fbd09c3e17bc21e8
3d3fa43dcf193f7f39b878ad6326ff397b411d09
/s1_cities-api/src/main/java/co/edu/uniandes/csw/cities/adapters/DateAdapter.java
ae8ca6e53ae75fbaac8069130023605a5def1143
[ "MIT" ]
permissive
Paolaaaaaa/recursos-isis2603
9b70f2677328ef539e9edbc791f52937abe58376
c5e5b2a67b89ee41f3b0416d1fb54eacd1ab4165
refs/heads/master
2023-08-19T19:55:23.399517
2021-10-18T23:14:59
2021-10-18T23:14:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,306
java
/* MIT License Copyright (c) 2019 Universidad de los Andes - ISIS2603 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package co.edu.uniandes.csw.cities.adapters; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.logging.Level; import java.util.logging.Logger; import javax.xml.bind.annotation.adapters.XmlAdapter; /** * Clase adaptador que formatea las fechas en formato serialiable utilizando la * convención: yyyy-MM-dd. Ej: 2018-02-12 * * @author ISIS2603 */ public class DateAdapter extends XmlAdapter<String, Date> { private static final Logger LOGGER = Logger.getLogger(DateAdapter.class.getName()); /** * Thread safe {@link DateFormat}. */ private static final ThreadLocal<DateFormat> DATE_FORMAT_TL = new ThreadLocal<DateFormat>() { @Override protected DateFormat initialValue() { return new SimpleDateFormat("yyyy-MM-dd"); } }; @Override public Date unmarshal(String v) throws Exception { LOGGER.log(Level.INFO, "input date "+v); return DATE_FORMAT_TL.get().parse(v); } @Override public String marshal(Date v) throws Exception { if (v == null) { return null; } return DATE_FORMAT_TL.get().format(v); } }
2d3c75cf0f83509c78f5cc9235fbb1956dc06224
e57149d27fcc33f2873e5a11e4c3d3deb2d0ddc4
/src/day48_Inheritance/DeviceTask/Laptop.java
e028763ac18d36fe47f8aa510be3729ef9bb0f67
[]
no_license
slokostic3212/class-notes
acfa3934d785cb437aef34e737f4b56eef480dcd
00f69d606029b3d692f7f1e4e2da9ff1a59cf611
refs/heads/master
2023-01-01T22:02:12.764144
2020-10-28T22:59:44
2020-10-28T22:59:44
284,545,830
0
0
null
null
null
null
UTF-8
Java
false
false
817
java
package day48_Inheritance.DeviceTask; /* 4. create a sub class of Device called Laptop: attributes: brand, model, price, MadeIn, hasBattery, hasMemory, screenSize, hasCPU, hasMouse, hasKeyBoard, OS methods: coding, setInfo, toString add a constructor that can set the fileds */ public class Laptop extends Device{ public static boolean hasCPU; public static boolean hasMouse; public static boolean hasKeyBoard; public String OS; public Laptop(String brand, String model, double price, boolean hasBattery, boolean hasMemory, String screenSize, String OS){ setInfo(brand, model, price, hasBattery, hasMemory, screenSize); this.OS = OS; } public void coding(String language){ System.out.println("coding "+language+" in "+brand+" "+model); } }
b119a107248123ad9179344ff9149eeeafc2ec35
4606c044cea15cdc8e30c2c40cad1f78600724a6
/app/src/main/java/com/swout/myapplication/PhoneLoginActivity.java
30371906a5d619a77c1d333fdca2cffa673e7806
[]
no_license
Swout/Raztacualzafnalversionjava
d582bbf6addb90d2fdcd4ea771a677b07fc637d5
58bd171d9f25135239948e5b78ee9c4fffa2e8ba
refs/heads/master
2022-12-02T01:47:40.926924
2020-08-20T04:20:46
2020-08-20T04:20:46
286,320,271
0
0
null
null
null
null
UTF-8
Java
false
false
7,171
java
package com.swout.myapplication; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import android.app.ProgressDialog; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.FirebaseException; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.PhoneAuthCredential; import com.google.firebase.auth.PhoneAuthProvider; import java.util.concurrent.TimeUnit; public class PhoneLoginActivity extends AppCompatActivity { private Button sendVerificationButton, VerifyButton; private EditText InputPhoneNumber, InputVerificationCode; private PhoneAuthProvider.OnVerificationStateChangedCallbacks callbacks; private FirebaseAuth mAuth; private ProgressDialog loadingBar; private String mVerificationId; private PhoneAuthProvider.ForceResendingToken mResendToken; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_phone_login); mAuth = FirebaseAuth.getInstance(); sendVerificationButton = (Button) findViewById(R.id.send_ver_code_button); VerifyButton = (Button) findViewById(R.id.verify_button); InputPhoneNumber = (EditText) findViewById(R.id.phone_number_input); InputVerificationCode = (EditText) findViewById(R.id.verification_code_input); loadingBar = new ProgressDialog(this); sendVerificationButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sendVerificationButton.setVisibility(View.INVISIBLE); InputPhoneNumber.setVisibility(View.INVISIBLE); VerifyButton.setVisibility(View.VISIBLE); InputVerificationCode.setVisibility(View.VISIBLE); String phoneNumber = InputPhoneNumber.getText().toString(); if(TextUtils.isEmpty(phoneNumber)){ Toast.makeText(PhoneLoginActivity.this, "Please enter your phone number first...", Toast.LENGTH_SHORT).show(); }else{ loadingBar.setTitle("Phone Verification"); loadingBar.setMessage("Please wait, while we are authentication your phone..."); loadingBar.setCanceledOnTouchOutside(false); loadingBar.show(); PhoneAuthProvider.getInstance().verifyPhoneNumber( phoneNumber, // Phone number to verify 60, // Timeout duration TimeUnit.SECONDS, // Unit of timeout PhoneLoginActivity.this, // Activity (for callback binding) callbacks); // OnVerificationStateChangedCallbacks } } }); VerifyButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sendVerificationButton.setVisibility(View.INVISIBLE); InputPhoneNumber.setVisibility(View.INVISIBLE); String verifcationCode = InputVerificationCode.getText().toString(); if(TextUtils.isEmpty(verifcationCode)) { Toast.makeText(PhoneLoginActivity.this, "Please write te verification code first...", Toast.LENGTH_SHORT).show(); } else { loadingBar.setTitle("Verification Code "); loadingBar.setMessage("Please wait, while we are verification your code..."); loadingBar.setCanceledOnTouchOutside(false); loadingBar.show(); PhoneAuthCredential credential = PhoneAuthProvider.getCredential(mVerificationId, verifcationCode); signInWithPhoneAuthCredential(credential); } } }); callbacks = new PhoneAuthProvider.OnVerificationStateChangedCallbacks() { @Override public void onVerificationCompleted(@NonNull PhoneAuthCredential phoneAuthCredential) { signInWithPhoneAuthCredential(phoneAuthCredential); } @Override public void onVerificationFailed(@NonNull FirebaseException e) { loadingBar.dismiss(); Toast.makeText(PhoneLoginActivity.this, "Invalid Phone Number, Please Enter correctly phone number", Toast.LENGTH_SHORT).show(); sendVerificationButton.setVisibility(View.VISIBLE); InputPhoneNumber.setVisibility(View.VISIBLE); VerifyButton.setVisibility(View.INVISIBLE); InputVerificationCode.setVisibility(View.INVISIBLE); } @Override public void onCodeSent(@NonNull String verificationId, @NonNull PhoneAuthProvider.ForceResendingToken token) { // Save verification ID and resending token so we can use them later mVerificationId = verificationId; mResendToken = token; loadingBar.dismiss(); Toast.makeText(PhoneLoginActivity.this, " Code has been sent, please check and verify..", Toast.LENGTH_SHORT).show(); sendVerificationButton.setVisibility(View.INVISIBLE); InputPhoneNumber.setVisibility(View.INVISIBLE); VerifyButton.setVisibility(View.VISIBLE); InputVerificationCode.setVisibility(View.VISIBLE); } }; } private void signInWithPhoneAuthCredential(PhoneAuthCredential credential) { mAuth.signInWithCredential(credential) .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (task.isSuccessful()) { loadingBar.dismiss(); Toast.makeText(PhoneLoginActivity.this, "Congratulation, you´re logged", Toast.LENGTH_SHORT).show(); sendUserToMainActivity(); } else { String message = task.getException().toString(); Toast.makeText(PhoneLoginActivity.this, "Error"+message, Toast.LENGTH_SHORT).show(); } } }); } private void sendUserToMainActivity(){ Intent mainIntent = new Intent(PhoneLoginActivity.this,MainActivity.class); startActivity(mainIntent); finish(); } }
9b40df26cef9d33293a13f6f1a2e138b0b629237
2e7020495313511d2712efd1b56e52ddecc3d0bf
/src/util/singlestep/AListBrowser.java
0ef54b902ce2f5e910d4d260c8bccf5243a6af77
[]
no_license
pdewan/util
3bc79264ce10afe6337abe6d1128c80a2be54280
7cd83cc286dfb2a5eb87fb54bf74dc42165ceb75
refs/heads/master
2022-06-19T11:03:24.758011
2022-06-09T04:22:27
2022-06-09T04:22:27
16,309,230
0
1
null
null
null
null
UTF-8
Java
false
false
3,548
java
package util.singlestep; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.util.ArrayList; import java.util.List; import util.annotations.Column; import util.annotations.Position; import util.annotations.Row; import util.trace.Tracer; public class AListBrowser implements ListBrowser{ List history = new ArrayList(); int currentIndex; // boolean waiting; PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this); public AListBrowser() { } public List history() { return history; } public boolean preForward() { return currentIndex < history.size() - 1; } @Row(1) @Column(0) public void forward() { currentIndex++; propertyChangeSupport.firePropertyChange("currentObject", null, getCurrentObject()); } public boolean preBack() { return currentIndex > 0; } @Row(1) @Column(1) public void back() { currentIndex--; propertyChangeSupport.firePropertyChange("currentObject", null, getCurrentObject()); } public boolean preGetCurrentObject() { return history.size() > 0; } @Row(0) public Object getCurrentObject() { // if (history.size() == 0) return ""; return history.get(currentIndex); } public void addObject(Object anObject) { currentIndex = history.size(); history.add(anObject); propertyChangeSupport.firePropertyChange("currentObject", null, getCurrentObject()); } public void clear() { history.clear(); } public boolean preDisplayCurrentEvent() { return Tracer.getKeywordDisplayStatus(getCurrentObject().getClass()) == null || !Tracer.getKeywordDisplayStatus(getCurrentObject().getClass()); } public boolean preDoNotDisplayCurrentEvent() { return Tracer.getKeywordDisplayStatus(getCurrentObject().getClass()) != null && Tracer.getKeywordDisplayStatus(getCurrentObject().getClass()); } public boolean preSingleStepCurrentEvent() { return Tracer.getKeywordWaitStatus(getCurrentObject().getClass()) == null || !Tracer.getKeywordWaitStatus(getCurrentObject().getClass()); } public boolean preDoNotSingleStepCurrentEvent() { return Tracer.getKeywordWaitStatus(getCurrentObject().getClass()) != null && Tracer.getKeywordWaitStatus(getCurrentObject().getClass()); } public void displayCurrentEvent() { Tracer.setKeywordDisplayStatus(getCurrentObject().getClass(), true); } public void doNotDisplayCurrentEvent() { Tracer.setKeywordDisplayStatus(getCurrentObject().getClass(), false); } public void singleStepCurrentEvent() { Tracer.setKeywordWaitStatus(getCurrentObject().getClass(), true); } public void doNotSingleStepCurrentEvent() { Tracer.setKeywordWaitStatus(getCurrentObject().getClass(), false); } // @Visible(false) // public synchronized void waitForUser() { // try { // waiting = true; // propertyChangeSupport.firePropertyChange("currentObject", null, getCurrentObject()); // wait(); // waiting = false; // propertyChangeSupport.firePropertyChange("currentObject", null, getCurrentObject()); // } catch (Exception e) { // e.printStackTrace(); // } // } // // public synchronized void proceed() { // try { // notify(); // } catch (Exception e) { // e.printStackTrace(); // } // // } // // public boolean preProceed() { // return waiting; // } @Override public void addPropertyChangeListener(PropertyChangeListener aListener) { propertyChangeSupport.addPropertyChangeListener(aListener); } }
c51a3fbaaaf0dcc59cf673cd0fd6edd6426b14e7
e22cdead128a35fe6e4210e9d4e2777b1a9fcc10
/app/src/main/java/com/zhq/http/ParamNames.java
3c358b4f3b3bed5d56793c8c2306dc5a056ca19b
[]
no_license
1016135097/ZhiHuiQian
1124973c9acf269d0c2e5861e08628ffff1df5de
ec4590f259cd713ffe360648f42ce5df0f515de9
refs/heads/master
2021-08-15T03:56:29.608700
2017-11-17T09:08:31
2017-11-17T09:08:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
397
java
package com.zhq.http; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Created by jingbin on 2015/6/24. */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface ParamNames { String value(); }
80d191c15a4e14b681e7aa016a24d1ea02771cff
a2bc06049969011354b1cdb96e6947631f0f9d1f
/examples/src/main/java/org/uzlocoinj/examples/RestoreFromSeed.java
1b765404539ecd14875ec0f276340147438a67a4
[ "Apache-2.0" ]
permissive
uzlocoin/Uzlocoinj
27f7093f615d83f93fcd19598c1d8c1f6b012a5b
15efb1819ced28154926c7c36d13ec765b9911ec
refs/heads/master
2023-05-09T09:38:05.328491
2021-06-03T10:26:35
2021-06-03T10:26:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,388
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.uzlocoinj.examples; import org.uzlocoinj.core.listeners.DownloadProgressTracker; import org.uzlocoinj.core.*; import org.uzlocoinj.net.discovery.DnsDiscovery; import org.uzlocoinj.params.TestNet3Params; import org.uzlocoinj.store.SPVBlockStore; import org.uzlocoinj.wallet.DeterministicSeed; import org.uzlocoinj.wallet.Wallet; import java.io.File; /** * The following example shows you how to restore a HD wallet from a previously generated deterministic seed. * In this example we manually setup the blockchain, peer group, etc. You can also use the WalletAppKit which provides a restoreWalletFromSeed function to load a wallet from a deterministic seed. */ public class RestoreFromSeed { public static void main(String[] args) throws Exception { NetworkParameters params = TestNet3Params.get(); // Bitcoinj supports hierarchical deterministic wallets (or "HD Wallets"): https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki // HD wallets allow you to restore your wallet simply from a root seed. This seed can be represented using a short mnemonic sentence as described in BIP 39: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki // Here we restore our wallet from a seed with no passphrase. Also have a look at the BackupToMnemonicSeed.java example that shows how to backup a wallet by creating a mnemonic sentence. String seedCode = "yard impulse luxury drive today throw farm pepper survey wreck glass federal"; String passphrase = ""; Long creationtime = 1409478661L; DeterministicSeed seed = new DeterministicSeed(seedCode, null, passphrase, creationtime); // The wallet class provides a easy fromSeed() function that loads a new wallet from a given seed. Wallet wallet = Wallet.fromSeed(params, seed); // Because we are importing an existing wallet which might already have transactions we must re-download the blockchain to make the wallet picks up these transactions // You can find some information about this in the guides: https://bitcoinj.github.io/working-with-the-wallet#setup // To do this we clear the transactions of the wallet and delete a possible existing blockchain file before we download the blockchain again further down. System.out.println(wallet.toString()); wallet.clearTransactions(0); File chainFile = new File("restore-from-seed.spvchain"); if (chainFile.exists()) { chainFile.delete(); } // Setting up the BlochChain, the BlocksStore and connecting to the network. SPVBlockStore chainStore = new SPVBlockStore(params, chainFile); BlockChain chain = new BlockChain(params, chainStore); PeerGroup peers = new PeerGroup(params, chain); peers.addPeerDiscovery(new DnsDiscovery(params)); // Now we need to hook the wallet up to the blockchain and the peers. This registers event listeners that notify our wallet about new transactions. chain.addWallet(wallet); peers.addWallet(wallet); DownloadProgressTracker bListener = new DownloadProgressTracker() { @Override public void doneDownload() { System.out.println("blockchain downloaded"); } }; // Now we re-download the blockchain. This replays the chain into the wallet. Once this is completed our wallet should know of all its transactions and print the correct balance. peers.start(); peers.startBlockChainDownload(bListener); bListener.await(); // Print a debug message with the details about the wallet. The correct balance should now be displayed. System.out.println(wallet.toString()); // shutting down again peers.stop(); } }
1dd44c9cb55226cc71889847c5215f02d95a8a25
767184557abdb08447a68797bf9bc42f1af6c4aa
/infoapp/src/main/java/vn/csdl/infoapp/service/QuarantineService.java
9e9c251b7f0867dc11af217748e57512f236845c
[]
no_license
nhutduongct/comansys
b555a1613545859ea6df5f3e3815d6e921081c95
640e37d23f643b52d8ba14c2412bf61618ca4e09
refs/heads/master
2023-07-11T04:16:51.020770
2021-08-05T15:18:28
2021-08-05T15:18:28
386,329,813
0
0
null
null
null
null
UTF-8
Java
false
false
999
java
package vn.csdl.infoapp.service; import org.springframework.stereotype.Service; import vn.csdl.infoapp.client.TrackerFeignClient; import vn.csdl.infoapp.domain.Quarantine; import vn.csdl.infoapp.repository.QuarantineRepository; import vn.csdl.infoapp.service.dto.QuarantineDTO; import vn.csdl.infoapp.service.mapper.QuarantineMapper; @Service public class QuarantineService { QuarantineRepository repository; TrackerFeignClient trackerFeignClient; QuarantineMapper mapper = QuarantineMapper.INSTANCE; public QuarantineService(QuarantineRepository repository, TrackerFeignClient trackerFeignClient) { this.repository = repository; this.trackerFeignClient = trackerFeignClient; } public Quarantine save(QuarantineDTO dto){ Quarantine entity = mapper.dtoToEntity(dto); entity = repository.save(entity); QuarantineDTO resultDTO = mapper.entityToDTO(entity); entity = repository.save(entity); return entity; } }