blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
bbea8dbe8ebb29bbc9a67cf0b2feba438b78d8aa
db90e6e0b5d1ed1065c480f5d6e6527882f37a88
/src/main/java/dev/mohsenkohan/jokeapp/config/ChuckConfiguration.java
bf9809c1f6d84dc1e1911892fc27a3272dbf6d52
[]
no_license
MohsenKohan-Dev/joke-app
4219096f027599faacb90b0fa380e5f4ae9534dd
50b372604d62de461195de0d8b1eb4c666946990
refs/heads/master
2021-04-10T21:19:40.527408
2020-03-31T18:13:52
2020-03-31T18:13:52
248,967,282
0
0
null
null
null
null
UTF-8
Java
false
false
374
java
package dev.mohsenkohan.jokeapp.config; import guru.springframework.norris.chuck.ChuckNorrisQuotes; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class ChuckConfiguration { @Bean public ChuckNorrisQuotes chuckNorrisQuotes() { return new ChuckNorrisQuotes(); } }
[ "mohsenkohan.dev@gmail.com" ]
mohsenkohan.dev@gmail.com
2f64998cbde804b831de0197285d082cc6d5fc1e
313154227cfdb9fcc48df3333afb3d49c4037330
/exceptions/exceptionExample2.java
0acd3ed24048aff7f34e0b4f779f5dbef3f6c7b5
[]
no_license
Premdeep/CSC220-SFSU-Fall-2017
3538bd25f8c64f5d5cfc652bd4bc78a9c9a66671
688732b610e390e3a273c4481f1ead1502f6c031
refs/heads/master
2021-01-20T06:46:38.453863
2017-12-18T06:26:22
2017-12-18T06:26:22
101,516,150
1
5
null
null
null
null
UTF-8
Java
false
false
568
java
public class exceptionExample2{ public static void main(String[] args){ int x = 10, y = 2; int counter = 0; boolean flag = true; while (flag) { start: try { if ( y > 1 ) break start; if ( y < 0 ) return; x = x / y; System.out.println ( "x : " + x + " y : "+y ); } catch ( Exception e ) { System.out.println ( e.getMessage() ); } finally { ++counter; System.out.println ( "finally: Counter : " + counter ); } --y; // after exception, continue here… System.out.println(" y after finally : "+y); } } }
[ "preamdhep.usapp@gmail.com" ]
preamdhep.usapp@gmail.com
18fcad9e40058b03fffc4934260cdecf5d9d8f83
98235d60133234f9ce7df9736ef081cbfc7f1bb3
/Queue/Queue.java
fa78a1156eb8af368eeb3539359f199b77b7941d
[]
no_license
massoudsalem/dataStructures
8e2467bee3a6b8a1d8ebc120fe2b7d1534fa8c70
0b429a05cc5dd5bdab1ff88b188707a4f5c8ece6
refs/heads/master
2021-03-31T01:15:09.164400
2020-01-21T14:00:31
2020-01-21T14:00:31
124,343,721
0
0
null
null
null
null
UTF-8
Java
false
false
1,072
java
class Queue<T>{ class Node<T>{ T data; Node next; public Node(T data){ this.data = data; } } Node front; Node rear; Integer size = 0; public boolean isEmpty(){ return front == null; } public void push(T data){ Node node = new Node(data); if(isEmpty()) front = node; else rear.next = node; rear = node; size++; } public T pop(){ Node temp; if(isEmpty()) return null; temp = front; front = front.next; size--; return (T) temp.data; } public Integer size(){ return size; } public T front() throws Exception{ if(isEmpty()){ throw new java.lang.RuntimeException("Queue is Empty"); } return (T) front.data; } public T back() throws Exception{ if(isEmpty()){ throw new java.lang.RuntimeException("Queue is Empty"); } return (T) rear.data; } }
[ "massoudsalem@users.noreply.github.com" ]
massoudsalem@users.noreply.github.com
4f733d64e34fd6e22be211b01ddbdd684f263675
89e2a22e059b73fd0ad40dd6e9fe4bdf0a80bb1f
/src/main/java/com/doglandia/gpsemulator/ui/StartEndEmulationPanel.java
cc422c4a4a6641ac4aacb4ec22e213ef2904e2fe
[]
no_license
ThomasKomarnicki/MockLocationPlugin
3e7a5b785c952c3c0054e6539e47bd1fc78fb1e8
10b26f4bb4dc4f2e469dd4baac520378d69fc8bd
refs/heads/master
2021-01-10T15:10:04.081566
2017-01-15T16:32:05
2017-01-15T16:32:05
48,307,424
13
1
null
2016-03-05T16:39:38
2015-12-20T04:38:04
Java
UTF-8
Java
false
false
6,295
java
package com.doglandia.gpsemulator.ui; import com.doglandia.gpsemulator.dataValidation.DataValidator; import com.doglandia.gpsemulator.dataValidation.ValidationResult; import com.doglandia.gpsemulator.model.GpsEmulationModel; import com.doglandia.gpsemulator.model.GpsPoint; import com.doglandia.gpsemulator.model.PersistableState; import com.doglandia.gpsemulator.model.PersistableUiElement; import com.doglandia.gpsemulator.presenter.PanelPresenter; import com.doglandia.gpsemulator.util.CardName; import org.jdom.Element; import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.util.ArrayList; import java.util.List; /** * Created by Thomas on 12/20/2015. */ public class StartEndEmulationPanel extends JPanel implements CardName, EmulationPanel, PersistableUiElement<StartEndEmulationPanel.State> { private JPanel gpsPathPanel; private JTextField startLocationLat; private JTextField startLocationLon; // private JButton startGPSEmulationButton; private JTextField stepsTextField; private JTextField timeIntervalField; private JTextField endLocationLat; private JTextField endLocationLon; private JPanel startEndRootJpanel; private JLabel errorText; private PanelPresenter panelPresenter; private DataValidator dataValidator; public StartEndEmulationPanel(){ dataValidator = new DataValidator(); } public void setPanelPresenter(PanelPresenter panelPresenter) { this.panelPresenter = panelPresenter; } @Override public String getCardName() { return "startEndEmulationPanel"; } @Override public String toString() { return "Start and End Points"; } @Override public GpsEmulationModel createGpsEmulationData() { double startLat = Double.valueOf(startLocationLat.getText()); double startLon = Double.valueOf(startLocationLon.getText()); double endLat = Double.valueOf(endLocationLat.getText()); double endLon = Double.valueOf(endLocationLon.getText()); int steps = Integer.valueOf(stepsTextField.getText()); int timeInterval = Integer.valueOf(timeIntervalField.getText()); double latDiff = startLat - endLat; double lonDiff = startLon - endLon; double latStep = latDiff / steps; double lonStep = lonDiff / steps; List<GpsPoint> points = new ArrayList<>(); for(int i = 0; i < steps-1; i++){ points.add(new GpsPoint(startLat - (i*latStep), startLon -(i * lonStep))); } points.add(new GpsPoint(endLat, endLon)); GpsEmulationModel gpsEmulationModel = new GpsEmulationModel(points, timeInterval * steps); return gpsEmulationModel; } @Override public boolean validateData() { errorText.setText(""); dataValidator.startValidation(); dataValidator.validateLat(startLocationLat.getText(),"Start Latitude"); dataValidator.validateLon(startLocationLon.getText(), "Start Longitude"); dataValidator.validateLat(endLocationLat.getText(), "End Latitude"); dataValidator.validateLon(endLocationLon.getText(), "End Longitude"); dataValidator.validateInt(stepsTextField.getText(), "Steps"); dataValidator.validateInt(timeIntervalField.getText(), "Time Interval"); ValidationResult validationResult = dataValidator.getResult(); if(validationResult.isValid()) { return true; }else{ errorText.setText("<html>"+validationResult.getErrorsText()+"</html>"); return false; } } @Nullable @Override public State getState() { State state = new State(); state.startLat = startLocationLat.getText(); state.startLon = startLocationLon.getText(); state.endLat = endLocationLat.getText(); state.endLon = endLocationLon.getText(); state.steps = stepsTextField.getText(); state.timeBetweenSteps = timeIntervalField.getText(); return state; } @Override public void restoreState(State state) { startLocationLat.setText(state.startLat); startLocationLon.setText(state.startLon); endLocationLat.setText(state.endLat); endLocationLon.setText(state.endLon); stepsTextField.setText(state.steps); timeIntervalField.setText(state.timeBetweenSteps); } @Override public String getElementName() { return State.START_END_PANEL_TAG; } public static class State implements PersistableState { private static final String START_END_PANEL_TAG = "StartEndPanel"; private static final String START_LAT = "startLat"; private static final String START_LON = "startLon"; private static final String END_LAT = "endLat"; private static final String END_LON = "endLon"; private static final String STEPS = "steps"; private static final String TIME_INTERVAL = "timeInterval"; public State(){ } public String startLat; public String startLon; public String endLat; public String endLon; public String steps; public String timeBetweenSteps; @Override public Element save() { Element startEndElement = new Element(START_END_PANEL_TAG); startEndElement.setAttribute(START_LAT, startLat); startEndElement.setAttribute(START_LON, startLon); startEndElement.setAttribute(END_LAT, endLat); startEndElement.setAttribute(END_LON, endLon); startEndElement.setAttribute(STEPS, steps); startEndElement.setAttribute(TIME_INTERVAL, timeBetweenSteps); return startEndElement; } @Override public void restore(Element element) { if(element != null) { startLat = element.getAttributeValue(START_LAT); startLon = element.getAttributeValue(START_LON); endLat = element.getAttributeValue(END_LAT); endLon = element.getAttributeValue(END_LON); steps = element.getAttributeValue(STEPS); timeBetweenSteps = element.getAttributeValue(TIME_INTERVAL); } } } }
[ "komarnicki.thomas@gmail.com" ]
komarnicki.thomas@gmail.com
aba2611d3b207af14fe60b545735008ac7f7bdeb
171fe394aabeb1e5d2871742e3c0a473455383bd
/src/main/java/com/zcf/common/utils/IPAddrFetcher.java
1eb8476ff4381af35cf8abd5f58fd3b7f2849fba
[]
no_license
caosunxiang/1.3
7e1ca955ab7eabec135a6511f4d29244ed27a828
26b89cd6212e080ca24ddc027c941478df79a0e6
refs/heads/master
2022-12-26T00:53:08.197346
2019-06-24T02:42:42
2019-06-24T02:42:42
185,117,650
0
0
null
2022-12-16T08:31:39
2019-05-06T03:30:08
Java
UTF-8
Java
false
false
3,088
java
package com.zcf.common.utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.servlet.http.HttpServletRequest; import java.net.Inet4Address; import java.net.InetAddress; import java.net.NetworkInterface; import java.util.Enumeration; public class IPAddrFetcher { private static Logger logger = LoggerFactory.getLogger(IPAddrFetcher.class); /** * 获取客户端IP地址,支持代理服务器 * * @param request * @return */ public static String getRemoteIpAddress(HttpServletRequest request) { String ip = ""; // 匹配大小写,保证无论Nginx如何配置代理参数,系统都能正常获取代理IP Enumeration<?> enumeration = request.getHeaderNames(); while (enumeration.hasMoreElements()) { String paraName = (String) enumeration.nextElement(); if ("x-forward-for".equalsIgnoreCase(paraName) || "x-forwarded-for".equalsIgnoreCase(paraName)) { ip = request.getHeader(paraName); break; } } String localIP = "127.0.0.1"; if ((ip == null) || (ip.length() == 0) || (ip.equalsIgnoreCase(localIP)) || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("Proxy-Client-IP"); } if ((ip == null) || (ip.length() == 0) || (ip.equalsIgnoreCase(localIP)) || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("WL-Proxy-Client-IP"); } if ((ip == null) || (ip.length() == 0) || (ip.equalsIgnoreCase(localIP)) || "unknown".equalsIgnoreCase(ip)) { ip = request.getRemoteAddr(); } return ip; } public static String getGuessUniqueIP() { try { Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); while (interfaces.hasMoreElements()) { NetworkInterface ni = interfaces.nextElement(); Enumeration<InetAddress> inetAddresses = ni.getInetAddresses(); while (inetAddresses.hasMoreElements()) { InetAddress address = inetAddresses.nextElement(); if (address instanceof Inet4Address) { if (!"127.0.0.1".equals(address.getHostAddress())) { return address.getHostAddress(); } } } } } catch (Exception e) { logger.error("Get IP Error", e); } return null; } public String getIPInfo() { StringBuilder sb = new StringBuilder(); try { Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); while (interfaces.hasMoreElements()) { NetworkInterface ni = interfaces.nextElement(); sb.append("Interface " + ni.getName() + ":\r\n"); Enumeration<InetAddress> inetAddresses = ni.getInetAddresses(); while (inetAddresses.hasMoreElements()) { InetAddress address = inetAddresses.nextElement(); sb.append("Address"); if (address instanceof Inet4Address) { sb.append("(v4)"); } else { sb.append("(v6)"); } sb.append(":address=" + address.getHostAddress() + " name=" + address.getHostName() + "\r\n"); } } } catch (Exception ex) { ex.printStackTrace(); } return sb.toString(); } public static void main(String[] args) { // System.out.println(IPAddrFetcher.getGuessUniqueIP()); } }
[ "48078630+caosunxiang@users.noreply.github.com" ]
48078630+caosunxiang@users.noreply.github.com
1638ee377f7cbaae5249d5d1dd02371f358f897d
bc9b9b6690dcc26a5eded565f3761b79ee29676a
/bvcommon/src/test/java/com/bazaarvoice/bvandroidsdk/AnalyticsManagerTest.java
8f0ea93442b19f3eaa22fba1659531782728a761
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
jfri/bv-android-sdk
5c5d9e16028de70df9db4a449e79783fb088b6e6
0de734ad4a50229c4c088358552b9e60004a13c3
refs/heads/master
2021-09-10T14:17:27.960316
2018-03-27T18:44:13
2018-03-27T18:44:13
111,873,486
0
0
null
2017-11-24T03:49:09
2017-11-24T03:49:08
null
UTF-8
Java
false
false
3,732
java
package com.bazaarvoice.bvandroidsdk; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowApplication; import java.util.UUID; import java.util.concurrent.ExecutorService; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import okhttp3.OkHttpClient; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.mockito.Matchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.robolectric.RuntimeEnvironment.application; @RunWith(RobolectricTestRunner.class) @Config(shadows = {BaseShadows.ShadowNetwork.class, BvSdkShadows.BvShadowAsyncTask.class, BaseShadows.ShadowAdIdClientNoLimit.class}) public class AnalyticsManagerTest { String versionName; String versionCode; String packageName; String clientId; String uuidTestStr = "0871bbf6-b73e-4841-99f2-5e3d887eaea2"; UUID uuid; OkHttpClient okHttpClient; BazaarEnvironment environment; @Mock ScheduledExecutorService scheduledExecutorService; @Mock ExecutorService immediateExecutorService; String shopperAdvertisingApiKey; @Mock BVAuthenticatedUser bvAuthenticatedUser; @Mock BVSDK bvsdk; String analyticsUrl; AnalyticsManager subject; @Before public void setup() { // arrange versionName = "3.0.0"; versionCode = "56"; packageName = "com.mypackagename.app"; clientId = "pretendcompany"; analyticsUrl = "https://www.example.com"; MockitoAnnotations.initMocks(this); okHttpClient = new OkHttpClient(); environment = BazaarEnvironment.STAGING; shopperAdvertisingApiKey = "foobar-bvtestshopperadvertisingid"; uuid = UUID.fromString(uuidTestStr); subject = new AnalyticsManager(application.getApplicationContext(), clientId, analyticsUrl, okHttpClient, immediateExecutorService, scheduledExecutorService, bvAuthenticatedUser, uuid, false); } ArgumentCaptor<Long> initialDelayCaptor = ArgumentCaptor.forClass(Long.class); ArgumentCaptor<Long> delayCaptor = ArgumentCaptor.forClass(Long.class); @Test public void whenCreatedShouldSetupBatchAnalyticsEventEvery10Seconds() { // arrange Long expectedInitialDelay = 10L; Long expectedDelay = 10L; // assert verify(scheduledExecutorService, times(1)).scheduleWithFixedDelay(any(Runnable.class), initialDelayCaptor.capture(), delayCaptor.capture(), any(TimeUnit.class)); assertEquals(expectedInitialDelay, initialDelayCaptor.getValue()); assertEquals(expectedDelay, delayCaptor.getValue()); } @Test public void whenSendPersonalizationEventShouldProcessImmediately() throws Exception { // arrange ShadowApplication.runBackgroundTasks(); // act subject.sendPersonalizationEvent(); // assert verify(immediateExecutorService, times(1)).execute(any(Runnable.class)); } @Mock BvAnalyticsSchema schema; @Test public void shouldNotSendAnalyticsEventWithPii() { // arrange when(schema.allowAdId()).thenReturn(false); // act subject.addMagpieData(schema); // assert assertFalse(schema.getDataMap().containsKey("advertisingId")); } @After public void tearDown() { BVSDK.destroy(); } }
[ "casey.kulm@bazaarvoice.com" ]
casey.kulm@bazaarvoice.com
8e2a48860662be3d6d94bf3d9b07234790b984cd
9fce01d889bf907b87b618c97c4b83cd3a69155d
/zh/kiralynok_szitabalazs/QueensPart2/src/hu/elte/progtech/queens/view/QueensFrame.java
13a543589020d9dcc876054ed2f6e35c7324b8f3
[]
no_license
8emi95/elte-ik-pt1
c235dea0f11f90f96487f232ff9122497c86d4a6
45c24fe8436c29054b7a8ffecb2f55dbd3cb3f42
refs/heads/master
2020-04-29T09:16:14.310592
2019-03-16T19:48:50
2019-03-16T19:48:50
176,018,106
0
0
null
null
null
null
UTF-8
Java
false
false
2,636
java
package hu.elte.progtech.queens.view; import static java.awt.Color.GRAY; import static java.awt.Color.WHITE; import static javax.swing.JOptionPane.YES_NO_OPTION; import static javax.swing.JOptionPane.YES_OPTION; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JOptionPane; import hu.elte.progtech.queens.model.QueensEngine; public class QueensFrame extends JFrame { private static final long serialVersionUID = 2265228622194396011L; private static final String NEWGAME_TITLE = "You won"; private static final String NEWGAME_QUESTION = "You won!\nWant to play again?"; private static final String QUEEN = "Q"; private static final String EMPTY = ""; private QueensEngine engine; public QueensFrame(QueensEngine engine) { super("Queens"); this.engine = engine; } public void showFrame() { setDefaultCloseOperation(EXIT_ON_CLOSE); setLayout(new GridLayout(engine.getSize(), engine.getSize())); addFields(); setVisible(true); pack(); } private void addFields() { for (int i = 0; i < engine.getSize(); ++i) { for (int j = 0; j < engine.getSize(); ++j) { addField(i, j); } } } private void addField(int i, int j) { JButton field = new JButton(); field.setPreferredSize(new Dimension(65, 65)); field.setFont(field.getFont().deriveFont(20.0f)); field.setBackground(getFieldBackground(i, j)); field.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (engine.put(i, j)) { updateFields(); checkEndGame(); } } }); getContentPane().add(field); } private Color getFieldBackground(int row, int column) { return row % 2 == column % 2 ? WHITE : GRAY; } private void updateFields() { for (int i = 0; i < engine.getSize(); ++i) { for (int j = 0; j < engine.getSize(); ++j) { updateField(i, j); } } } private void updateField(int row, int column) { Component component = getContentPane().getComponent(row * engine.getSize() + column); JButton field = (JButton) component; field.setText(getFieldLabel(row, column)); } private String getFieldLabel(int row, int column) { return engine.isQueen(row, column) ? QUEEN : EMPTY; } private void checkEndGame() { if (engine.isWon()) { int answer = JOptionPane.showConfirmDialog(this, NEWGAME_QUESTION, NEWGAME_TITLE, YES_NO_OPTION); if (answer == YES_OPTION) { engine.startNewGame(); updateFields(); } } } }
[ "8emi95@inf.elte.hu" ]
8emi95@inf.elte.hu
63d05b8c84e9c7460f9884ea2756875af5a0ff36
3eb74b2a9a1b094b13a244ed37714568c47cc8b8
/FirstJava/src/threadTest/CountDownThread.java
d2c0155a2da1c6770aa7a8b515b941c79eab35fc
[]
no_license
Gamaspin/javawork
ae25b0963a1f89d59835b04b71e4423430e88798
8e345ddd523fa6342103b0d028cb504b14740fe6
refs/heads/main
2023-07-07T14:28:43.168465
2021-08-05T06:12:09
2021-08-05T06:12:09
392,977,982
0
0
null
2021-08-05T09:12:13
2021-08-05T09:12:13
null
UTF-8
Java
false
false
497
java
package threadTest; public class CountDownThread extends Thread{ //③10초 카운팅은 스레드를 이용해서 처리해봅시다. @Override public void run() { for(int i = 10; i > 0; i--) { if(HighLowGame.check) { return; } try { sleep(1000); } catch(InterruptedException e) { e.printStackTrace(); } } System.out.println(); System.out.println("시관초과입니다."); System.out.println("프로그램을 종료합니다."); System.exit(0); } }
[ "yoonbung12@gmail.com" ]
yoonbung12@gmail.com
9c12011d35fd76f1da5892a775218fa6b7f7adcb
38d70f2243595e4dcf95163e0f4d45ded380c5a6
/app/src/main/java/com/example/ehsan/safeparking/CustomToast.java
a4713f3c3427f92c6adae493827cc724ee885d04
[]
no_license
ehsanlatif/SmartParkingSystem
eb02eaf87e534d0bfc6a8966a4e4b760561d3fc8
846d62ea4ef1dabc05c36fcd67c23c1f44e08d71
refs/heads/master
2021-05-15T05:54:06.635907
2017-12-31T21:08:03
2017-12-31T21:08:03
115,885,419
1
2
null
null
null
null
UTF-8
Java
false
false
1,326
java
package com.example.ehsan.safeparking; /** * Created by ehsan on 03-12-2017. */ import android.content.Context; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import android.widget.Toast; public class CustomToast { // Custom Toast Method public void Show_Toast(Context context, View view, String error) { // Layout Inflater for inflating custom view LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); // inflate the layout over view View layout = inflater.inflate(R.layout.custom_toast, (ViewGroup) view.findViewById(R.id.toast_root)); // Get TextView id and set error TextView text = (TextView) layout.findViewById(R.id.toast_error); text.setText(error); Toast toast = new Toast(context);// Get Toast Context toast.setGravity(Gravity.TOP | Gravity.FILL_HORIZONTAL, 0, 0);// Set // Toast // gravity // and // Fill // Horizoontal toast.setDuration(Toast.LENGTH_SHORT);// Set Duration toast.setView(layout); // Set Custom View over toast toast.show();// Finally show toast } }
[ "ehsanlatif000@gmail.com" ]
ehsanlatif000@gmail.com
875553bb88bd63e374df4619e4a50fe108e57820
ff2683777d02413e973ee6af2d71ac1a1cac92d3
/src/main/java/com/alipay/api/response/KoubeiCateringPosCooklistQueryResponse.java
1be0c3f32d37b80bd1e7affde92d6b3904b6ede9
[ "Apache-2.0" ]
permissive
weizai118/alipay-sdk-java-all
c30407fec93e0b2e780b4870b3a71e9d7c55ed86
ec977bf06276e8b16c4b41e4c970caeaf21e100b
refs/heads/master
2020-05-31T21:01:16.495008
2019-05-28T13:14:39
2019-05-28T13:14:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
875
java
package com.alipay.api.response; import java.util.List; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; import com.alipay.api.domain.PosDishCookModel; import com.alipay.api.AlipayResponse; /** * ALIPAY API: koubei.catering.pos.cooklist.query response. * * @author auto create * @since 1.0, 2019-01-07 20:51:15 */ public class KoubeiCateringPosCooklistQueryResponse extends AlipayResponse { private static final long serialVersionUID = 4867356487447856898L; /** * 菜谱列表 */ @ApiListField("cook_models") @ApiField("pos_dish_cook_model") private List<PosDishCookModel> cookModels; public void setCookModels(List<PosDishCookModel> cookModels) { this.cookModels = cookModels; } public List<PosDishCookModel> getCookModels( ) { return this.cookModels; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
7a9086fff5fa3cbdb13c42ce1f5da31b049e4bf8
ea8266f779a3b59cb97e35c83773142aab64bbff
/app/src/main/java/com/dreamforone/jipgo/MyFirebaseMessagingService.java
6fe5451b23d739045e080176c0611907ba7e6a2a
[]
no_license
ItForYou/Jipgo
e2b01e3c141bfc852b9f41ac3566799f1b15b6d7
52300c42f6f6fe6e21e2dcabb57c2868b844261e
refs/heads/master
2020-09-22T16:19:12.646796
2019-12-02T02:48:40
2019-12-02T02:48:40
225,271,034
0
0
null
null
null
null
UTF-8
Java
false
false
5,200
java
/** * Copyright 2016 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.dreamforone.jipgo; import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.media.RingtoneManager; import android.net.Uri; import android.os.Build; import android.support.v4.app.NotificationCompat; import android.util.Log; import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.RemoteMessage; import util.Common; public class MyFirebaseMessagingService extends FirebaseMessagingService { private static final String TAG = "MyFirebaseMsgService"; public static int identity=0; /** * Called when message is received. * * @param remoteMessage Object representing the message received from Firebase Cloud Messaging. */ // [START receive_message] @Override public void onMessageReceived(RemoteMessage remoteMessage) { // TODO(developer): Handle FCM messages here. // If the application is in the foreground handle both data and notification messages here. // Also if you intend on generating your own notifications as a result of a received FCM // message, here is where that should be initiated. See sendNotification method below. sendNotification(remoteMessage); } // [END receive_message] /** * Create and show a simple notification containing the received FCM message. * * */ private void sendNotification(RemoteMessage remote) { String messageBody=remote.getData().get("message"); String subject=remote.getData().get("subject"); String goUrl=remote.getData().get("goUrl"); String channelId = "JipGo"; Intent intent = new Intent(this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.putExtra("goUrl",goUrl); Log.d("remote",remote.toString()); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent, PendingIntent.FLAG_ONE_SHOT); Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); Bitmap BigPictureStyle= BitmapFactory.decodeResource(getResources(),R.mipmap.ic_launcher); /**/ NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, channelId) .setSmallIcon(R.mipmap.ic_launcher) .setContentTitle(subject) .setContentText(messageBody) .setAutoCancel(true) .setContentIntent(pendingIntent) .setDefaults(Notification.DEFAULT_ALL) .setSound(defaultSoundUri) .setVibrate(new long[]{0, 500, 0, 500}) .setPriority(NotificationCompat.PRIORITY_HIGH) .setStyle(new NotificationCompat.BigTextStyle().bigText(messageBody)); /*android.support.v7.app.NotificationCompat.Builder notificationBuilder2 = (android.support.v7.app.NotificationCompat.Builder) new android.support.v7.app.NotificationCompat.Builder(this) .setSmallIcon(R.mipmap.ic_launcher) .setContentTitle(subject) .setContentText(messageBody) .setAutoCancel(true);*/ NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { NotificationChannel channel = new NotificationChannel(channelId, "Channel human readable title", NotificationManager.IMPORTANCE_DEFAULT); notificationManager.createNotificationChannel(channel); } if(Common.getPref(getApplicationContext(),"push",false)==true){ notificationManager.notify(identity /* ID of notification */, notificationBuilder.build()); } identity++; // notificationManager.notify(1 /* ID of notification */, notificationBuilder2.build()); /* Intent popupIntent= new Intent(this,PopupActivity.class); popupIntent.addFlags(popupIntent.FLAG_ACTIVITY_NEW_TASK); popupIntent.putExtra("subject",subject); popupIntent.putExtra("message",messageBody); startActivity(popupIntent);*/ } }
[ "kimnamhyong@naver.com" ]
kimnamhyong@naver.com
805d5317ef080dbc583411f91a6159da15c6e029
e5d5965e9159b47e5a7be4e5237af50943dd4d5e
/src/main/java/com/project/sq/service/ICircleService.java
b693a2e82486acfa862d70f2a7f8d52471c981be
[]
no_license
guopinya/msp
e5beabe130192a68eda3e9e4534c84502eae10d2
81e27ed43af7cbbd38545ed6f9b185bfc2a863c7
refs/heads/master
2020-09-15T01:21:21.139150
2020-01-13T05:12:48
2020-01-13T05:12:48
223,314,536
1
0
null
2020-09-04T20:58:08
2019-11-22T03:18:33
JavaScript
UTF-8
Java
false
false
1,080
java
package com.project.sq.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.project.sq.entity.Circle; import com.project.sq.entity.CircleMaster; /** * 圈子服务 * * @author zhuyifa */ public interface ICircleService extends IService<Circle> { /** * 查询圈子分页 * * @param p 分页对象 * @param p2 圈子对象 * @return 查询到的圈子分页对象 */ IPage<Circle> page(Page<Circle> p, Circle p2); /** * 查询圈子达人分页 * * @param p 分页对象 * @param p2 达人对象 * @return 查询到的达人分页对象 */ IPage<CircleMaster> pageMaster(IPage<CircleMaster> p, CircleMaster p2); /** * 保存圈子达人 * * @param p 达人对象 */ void saveMaster(CircleMaster p); /** * 删除圈子达人 * * @param p 达人对象 */ void removeMaster(CircleMaster p); }
[ "2357586084@qq.com" ]
2357586084@qq.com
6410b1ebf5d089452ba747139d577b2c05a7cb1c
0d561b2f96550e52847a92bf771698a0ec1d2003
/app/src/main/java/com/annasblackhat/printtousb/PrinterManager.java
80282e50d4b76c692cb4fcf0b74de636bc5ed4a9
[]
no_license
ANNASBlackHat/USB-Printer
a65590655b2a28ba5824902d9ab2dbaf14d5115d
10fbd3fc951d5ed6283de4bd0e625ea7e7b54655
refs/heads/master
2020-06-14T09:08:56.803443
2019-07-03T02:42:51
2019-07-03T02:42:51
194,966,800
0
0
null
null
null
null
UTF-8
Java
false
false
1,040
java
package com.annasblackhat.printtousb; import android.hardware.usb.UsbDeviceConnection; import android.hardware.usb.UsbEndpoint; import android.hardware.usb.UsbInterface; import android.os.AsyncTask; /** * Created by annasblackhat on 18/12/18 */ public class PrinterManager { public void print(String text, final UsbDeviceConnection connection, final UsbEndpoint endpoint, UsbInterface usbInterface){ final byte[] data = (text + "\n\n\n").getBytes(); connection.claimInterface(usbInterface, true); Thread thread = new Thread(new Runnable() { @Override public void run() { connection.bulkTransfer(endpoint, data, data.length, 0); } }); thread.run(); // new AsyncTask<Void, Void, Void>(){ // // @Override // protected Void doInBackground(Void... voids) { // connection.bulkTransfer(endpoint, data, data.length, 0); // return null; // } // }.execute(); } }
[ "annas685@gmail.com" ]
annas685@gmail.com
0e9439f011c56ebe352ed4207ca02c6baf7b53e8
50954e28cda402c5ec6d198711bffe3c50b0f7c7
/JavaSE/src/main/resources/src/com/sun/corba/se/spi/activation/_RepositoryImplBase.java
a24b23cc7fa738cf178eda6a65ac15f7ccdf8aa7
[]
no_license
bulusky/Note
f7b4a76a4ea5d1f10a122152afacd23a4aed4fd6
73c60b2fccac89d48a7566a265217e601c8fcb79
refs/heads/master
2023-01-03T10:03:29.615608
2020-10-24T09:38:45
2020-10-24T09:38:45
303,957,641
2
0
null
null
null
null
UTF-8
Java
false
false
7,672
java
package com.sun.corba.se.spi.activation; /** * com/sun/corba/se/spi/activation/_RepositoryImplBase.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from c:/jenkins/workspace/8-2-build-windows-amd64-cygwin/jdk8u251/737/corba/src/share/classes/com/sun/corba/se/spi/activation/activation.idl * Thursday, March 12, 2020 6:33:10 AM UTC */ public abstract class _RepositoryImplBase extends org.omg.CORBA.portable.ObjectImpl implements com.sun.corba.se.spi.activation.Repository, org.omg.CORBA.portable.InvokeHandler { // Constructors public _RepositoryImplBase () { } private static java.util.Hashtable _methods = new java.util.Hashtable (); static { _methods.put ("registerServer", new java.lang.Integer (0)); _methods.put ("unregisterServer", new java.lang.Integer (1)); _methods.put ("getServer", new java.lang.Integer (2)); _methods.put ("isInstalled", new java.lang.Integer (3)); _methods.put ("install", new java.lang.Integer (4)); _methods.put ("uninstall", new java.lang.Integer (5)); _methods.put ("listRegisteredServers", new java.lang.Integer (6)); _methods.put ("getApplicationNames", new java.lang.Integer (7)); _methods.put ("getServerID", new java.lang.Integer (8)); } public org.omg.CORBA.portable.OutputStream _invoke (String $method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler $rh) { org.omg.CORBA.portable.OutputStream out = null; java.lang.Integer __method = (java.lang.Integer)_methods.get ($method); if (__method == null) throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); switch (__method.intValue ()) { // always uninstalled. case 0: // activation/Repository/registerServer { try { com.sun.corba.se.spi.activation.RepositoryPackage.ServerDef serverDef = com.sun.corba.se.spi.activation.RepositoryPackage.ServerDefHelper.read (in); int $result = (int)0; $result = this.registerServer (serverDef); out = $rh.createReply(); out.write_long ($result); } catch (com.sun.corba.se.spi.activation.ServerAlreadyRegistered $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerAlreadyRegisteredHelper.write (out, $ex); } catch (com.sun.corba.se.spi.activation.BadServerDefinition $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.BadServerDefinitionHelper.write (out, $ex); } break; } // unregister server definition case 1: // activation/Repository/unregisterServer { try { int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in); this.unregisterServer (serverId); out = $rh.createReply(); } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex); } break; } // get server definition case 2: // activation/Repository/getServer { try { int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in); com.sun.corba.se.spi.activation.RepositoryPackage.ServerDef $result = null; $result = this.getServer (serverId); out = $rh.createReply(); com.sun.corba.se.spi.activation.RepositoryPackage.ServerDefHelper.write (out, $result); } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex); } break; } // Return whether the server has been installed case 3: // activation/Repository/isInstalled { try { int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in); boolean $result = false; $result = this.isInstalled (serverId); out = $rh.createReply(); out.write_boolean ($result); } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex); } break; } // if the server is currently marked as installed. case 4: // activation/Repository/install { try { int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in); this.install (serverId); out = $rh.createReply(); } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex); } catch (com.sun.corba.se.spi.activation.ServerAlreadyInstalled $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerAlreadyInstalledHelper.write (out, $ex); } break; } // if the server is currently marked as uninstalled. case 5: // activation/Repository/uninstall { try { int serverId = com.sun.corba.se.spi.activation.ServerIdHelper.read (in); this.uninstall (serverId); out = $rh.createReply(); } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex); } catch (com.sun.corba.se.spi.activation.ServerAlreadyUninstalled $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerAlreadyUninstalledHelper.write (out, $ex); } break; } // list registered servers case 6: // activation/Repository/listRegisteredServers { int $result[] = null; $result = this.listRegisteredServers (); out = $rh.createReply(); com.sun.corba.se.spi.activation.ServerIdsHelper.write (out, $result); break; } // servers. case 7: // activation/Repository/getApplicationNames { String $result[] = null; $result = this.getApplicationNames (); out = $rh.createReply(); com.sun.corba.se.spi.activation.RepositoryPackage.StringSeqHelper.write (out, $result); break; } // Find the ServerID associated with the given application name. case 8: // activation/Repository/getServerID { try { String applicationName = in.read_string (); int $result = (int)0; $result = this.getServerID (applicationName); out = $rh.createReply(); out.write_long ($result); } catch (com.sun.corba.se.spi.activation.ServerNotRegistered $ex) { out = $rh.createExceptionReply (); com.sun.corba.se.spi.activation.ServerNotRegisteredHelper.write (out, $ex); } break; } default: throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); } return out; } // _invoke // Type-specific CORBA::Object operations private static String[] __ids = { "IDL:activation/Repository:1.0"}; public String[] _ids () { return (String[])__ids.clone (); } } // class _RepositoryImplBase
[ "814192772@qq.com" ]
814192772@qq.com
660888d640e21d259113d433cf16de9b4f508322
0d59b7b0e792cdf6a3f4ad27b46691cbba28fb17
/server/src/main/java/Team_wolf_server/server/po/ForPricePromotionPO.java
67ac42924892091aa275c624e6a208d1ad394e4b
[]
no_license
TeamColorWolf/Team-Wolf-server
182b3c041ba8a146df22a9ce8554547cd59964e1
6665b2031e87924db13fd5da5c436ff2843321d0
refs/heads/master
2021-03-12T23:17:35.762537
2014-11-16T11:42:59
2014-11-16T11:42:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
505
java
package Team_wolf_server.server.po; import java.util.ArrayList; import Team_wolf_server.server.vo.ForPricePromotionVO; /** * * @author WHJ * */ public class ForPricePromotionPO extends PromotionPO{ double workCondition; ArrayList<GiftForPromotionPO> list; double cashCoupon; public ForPricePromotionPO(ForPricePromotionVO vo){ super(PromotionTypePO.forPrice, vo); workCondition = vo.workCondition; cashCoupon = vo.cashCoupon; list = setGiftList(vo.list); } }
[ "emls0401@163.com" ]
emls0401@163.com
95654f96bd7333943cc646e4e0c7279375ff15f4
2cae427b0ad47ed4d7a6339824423e39cc0f8a40
/src/main/java/com/algaworks/osworks/domain/exception/EntidadeNaoEncontradaException.java
0157e8c054d162019138fc28682d7572ecfeba61
[]
no_license
vitorfcutulo/OSWorks-API
c8cd1ffab8e7f98436cde5d224bc798502bbbeab
fc6399f7ff25824063989c402cf9b87335f80ced
refs/heads/master
2023-02-19T12:42:30.890472
2021-01-15T03:47:21
2021-01-15T03:47:21
328,795,359
0
0
null
2021-01-15T03:47:22
2021-01-11T21:25:42
Java
UTF-8
Java
false
false
255
java
package com.algaworks.osworks.domain.exception; public class EntidadeNaoEncontradaException extends NegocioException { private static final long serialVersionUID = 1L; public EntidadeNaoEncontradaException(String message) { super(message); } }
[ "global.vitor@ao3tech.com" ]
global.vitor@ao3tech.com
c8581da4818a4aee043b7ba6d5fe67849b4d4fba
e332fecc390e6254562f8f2b3576eae9c5518a3e
/java/URI1858.java
aba0b0c5a07f684139aad90f7b2a39e42e0723d8
[]
no_license
Jeronimo-MZ/URI
61956260e09a9b9acfbe5f6358d8250a89bd04e6
615051cabcd284a653541967677b2dfcc8ce016e
refs/heads/master
2022-12-27T06:19:33.884618
2020-10-09T11:17:08
2020-10-09T11:17:08
283,883,329
2
0
null
null
null
null
UTF-8
Java
false
false
430
java
import java.util.Scanner; public class URI1858 { public static void main(String args[]){ final Scanner teclado = new Scanner(System.in); int N = teclado.nextInt(); int valor = teclado.nextInt(); int menor = valor; int posMenor = 1; for (int i = 2; i <= N; i++){ valor = teclado.nextInt(); if (valor < menor){ menor = valor; posMenor = i; } } System.out.println(posMenor); teclado.close(); } }
[ "mataveljeronimo@gmail.com" ]
mataveljeronimo@gmail.com
3d0d56be072aaa591e358c072098b23b2788b1e5
49ee49ee34fa518b0df934081f5ea44a0faa3451
/LearnAndroid/Step3-Fragments/app/src/main/java/com/kc/step3_fragments/app/MainActivity.java
b7ca35c4074e3a1cbfaf0a205bd5d662b5abb6a8
[ "MIT" ]
permissive
kingsamchen/Eureka
a9458fcc7d955910bf2cefad3a1561cec3559702
e38774cab5cf757ed858547780a8582951f117b4
refs/heads/master
2023-09-01T11:32:35.575951
2023-08-27T15:21:42
2023-08-27T15:22:31
42,903,588
28
16
MIT
2023-09-09T07:33:29
2015-09-22T01:27:05
C++
UTF-8
Java
false
false
1,122
java
package com.kc.step3_fragments.app; import android.app.Activity; import android.app.FragmentManager; import android.app.FragmentTransaction; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button btnChangeView = (Button)findViewById(R.id.button); btnChangeView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { AnotherRightFragment rightFragment = new AnotherRightFragment(); FragmentManager fragmentManager = getFragmentManager(); FragmentTransaction transaction = fragmentManager.beginTransaction(); transaction.replace(R.id.right_layout, rightFragment); transaction.addToBackStack(null); transaction.commit(); } }); } }
[ "kingsamchen@gmail.com" ]
kingsamchen@gmail.com
ff3c1878ec85405ced56a07c396bed2e8e2075dc
8f09cc504f009e929ca274e9759279c8e9a7ceb5
/spring-core/src/main/java/org/springframework/cglib/util/StringSwitcher.java
5c0874bacaa3f4b78f6f3d95b4aa3a88c8cd8559
[]
no_license
bblswei/wl
e1d5055b56d239b38402c643d74d9f5900914ce2
59bb57628bb1ebe1b815f3ea7aa8b8a74fb8d787
refs/heads/master
2021-05-09T06:44:46.718312
2018-02-05T15:07:59
2018-02-05T15:07:59
119,338,878
0
0
null
null
null
null
UTF-8
Java
false
false
1,007
java
package org.springframework.cglib.util; import org.springframework.asm.Type; import org.springframework.cglib.core.KeyFactory; import org.springframework.cglib.core.Signature; import org.springframework.cglib.core.TypeUtils; import org.springframework.cglib.util.StringSwitcher.Generator; import org.springframework.cglib.util.StringSwitcher.StringSwitcherKey; public abstract class StringSwitcher { private static final Type STRING_SWITCHER = TypeUtils.parseType("org.springframework.cglib.util.StringSwitcher"); private static final Signature INT_VALUE = TypeUtils.parseSignature("int intValue(String)"); private static final StringSwitcherKey KEY_FACTORY = (StringSwitcherKey) KeyFactory.create(StringSwitcherKey.class); public static StringSwitcher create(String[] strings, int[] ints, boolean fixedInput) { Generator gen = new Generator(); gen.setStrings(strings); gen.setInts(ints); gen.setFixedInput(fixedInput); return gen.create(); } public abstract int intValue(String arg0); }
[ "lei.wei@phicomm.com" ]
lei.wei@phicomm.com
cf36f360743a86d10e7e629f93f453d22a696d7c
2826ae6a731b00cfd2b8f1305b66ca8dd3a05d3a
/src/main/java/com/github/wmarkow/amp/maven/mojo/platform/ListLibrariesMojo.java
39f947ab12e4e4b8c6acf903d78fa8b52cbe99a0
[]
no_license
wmarkow/arduino-maven-plugin
ee602a3f737e3060233a8000fc792d38fde70ba3
162bfcb1da0c35ab2ad937edf8950692991fe084
refs/heads/master
2022-06-05T11:43:48.365635
2020-01-08T22:05:39
2020-01-08T22:05:39
167,057,045
0
0
null
2022-05-20T20:55:52
2019-01-22T19:48:51
Java
UTF-8
Java
false
false
2,598
java
package com.github.wmarkow.amp.maven.mojo.platform; import java.io.File; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.ResolutionScope; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; import com.github.wmarkow.amp.maven.mojo.GenericMojo; import com.github.wmarkow.amp.maven.mojo.phase.gensources.UnpackDependenciesMojo; @Mojo( name = "list-libraries", defaultPhase = LifecyclePhase.NONE, requiresDependencyResolution = ResolutionScope.TEST, requiresProject = true ) public class ListLibrariesMojo extends UnpackDependenciesMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { final Artifact arduinoCore = getArduinoCoreDependency(); final String[] names = getArduinoCoreLibrariesNames(); for( String name : names ) { final String groupId = arduinoCore.getGroupId(); final String artifactId = name; final String extension = GenericMojo.ARDUINO_CORE_LIB_EXTENSION; final String version = arduinoCore.getVersion(); Artifact dep = new DefaultArtifact( groupId, artifactId, extension, version ); getLog().info( artifactToDependencyString( dep ) ); } } private String[] getArduinoCoreLibrariesNames() throws MojoExecutionException { File unpackedArduinoCore = getPathToUnpackedArduinoCore(); File libraries = new File( unpackedArduinoCore, "libraries" ); if( !libraries.exists() ) { throw new MojoExecutionException( String.format( "Directore not exists: %s", libraries.getAbsolutePath() ) ); } return libraries.list(); } private String artifactToDependencyString( Artifact artifact ) { StringBuilder sb = new StringBuilder(); sb.append( String.format( "<dependency>" ) ); sb.append( String.format( " <groupId>%s</groupId>", artifact.getGroupId() ) ); sb.append( String.format( " <artifactId>%s</artifactId>", artifact.getArtifactId() ) ); sb.append( String.format( " <version>%s</version>", artifact.getVersion() ) ); sb.append( String.format( " <type>%s</type>", artifact.getExtension() ) ); sb.append( String.format( "</dependency>" ) ); return sb.toString(); } }
[ "witold.a.markowski@gmail.com" ]
witold.a.markowski@gmail.com
a8a2764aa2b70c2d40c5fbb3ae77078f53a35762
48731c9be89080e3a2a7ee3ba6cdcda1e5748933
/TestingEJBModule/src/test/java/com/sunkuet02/testejb/testutils/Utils.java
d59a0271ef0dd677bbafe5771294f1362cf441c2
[]
no_license
sunkuet02/java-library-test
fe2c0d8c7f04a1fc6edb70d0b9f04bbb8aa90e7a
2de83836c705d3c38289d01a4854a67491703884
refs/heads/master
2020-12-19T05:15:43.019207
2017-08-06T10:15:19
2017-08-06T10:15:19
60,323,611
0
0
null
null
null
null
UTF-8
Java
false
false
680
java
package com.sunkuet02.testejb.testutils; import java.util.HashMap; import java.util.Map; import java.util.Properties; /** * Created by sun on 5/8/17. */ public class Utils { public static Properties getDbProperties() { Properties properties = new Properties(); properties.put("javax.persistence.jdbc.driver", "org.hsqldb.jdbcDriver"); properties.put("javax.persistence.jdbc.user","sa"); properties.put("javax.persistence.jdbc.password" ,""); properties.put("javax.persistence.jdbc.url" ,"jdbc:hsqldb:mem:testdb"); properties.put("hibernate.dialect" ,"org.hibernate.dialect.HSQLDialect"); return properties; } }
[ "sunkuet02@gmail.com" ]
sunkuet02@gmail.com
0b2f0b3b602660e83a5e77fb90d3be4ded04e6dd
29a7085c5ebc6f0e8eef33c227c0da902ed8191d
/TheBolsoVilla/src/main/java/com/handbags/spring/Impl/ProductImpl.java
d143f0f6e12b83e8167a4273fb07031369078e9e
[]
no_license
ashwnipande94/project1-version-3
38009ab34cd64b9e671aebb46ae96d13f98cc778
8e8f2e817c53ab5faf17c4cb242fb64d90c6ec95
refs/heads/master
2021-01-02T22:18:38.172983
2017-01-12T09:03:26
2017-01-12T09:03:26
78,726,175
0
0
null
null
null
null
UTF-8
Java
false
false
2,695
java
package com.handbags.spring.Impl; import java.util.List; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.handbags.spring.DAO.ProductDAO; import com.handbags.spring.model.Product; import com.handbags.spring.model.ViewProduct; @Repository public class ProductImpl implements ProductDAO{ @Autowired SessionFactory sessionFactory; public ProductImpl(SessionFactory sessionFactory) { this.sessionFactory=sessionFactory; } public void addProductDAO(Product product) { sessionFactory.getCurrentSession().saveOrUpdate(product); } public List<Product> getList() { Session session =sessionFactory.getCurrentSession(); String hql="from Product"; @SuppressWarnings("unchecked") List<Product> clist=session.createQuery(hql).getResultList(); return clist; } public Product getProductById(int productId ) { Session session =sessionFactory.getCurrentSession(); String hql="from Product where productId =" +productId; @SuppressWarnings("unchecked") List<Product> clist=session.createQuery(hql).getResultList(); return clist.get(0); } public void deleteProduct(int productId){ Product productToDelete= new Product(); productToDelete.setProductId(productId); sessionFactory.getCurrentSession().delete(productToDelete); } public Product getProductByName(String productName){ Session session =sessionFactory.getCurrentSession(); String hql="from Product where productName="+"'"+productName+"'"; @SuppressWarnings("unchecked") List<Product> clist=session.createQuery(hql).getResultList(); return clist.get(0); } public String getJsonList() { Session session =sessionFactory.getCurrentSession(); String hql="from Product"; @SuppressWarnings("unchecked") List<Product> clist=session.createQuery(hql).getResultList(); // Gson gson = new Gson(); Gson gson= new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); String jsonList = gson.toJson(clist); return jsonList; } public ViewProduct getViewProductById(int productId ) { Session session =sessionFactory.getCurrentSession(); String hql="from ViewProduct where productId =" +productId; @SuppressWarnings("unchecked") List<ViewProduct> vplist=session.createQuery(hql).getResultList(); return vplist.get(0); } public void updateQuantity (int productId){ String hql="update Product set productQuantity =productQuantity-1 where productId="+productId; sessionFactory.getCurrentSession().createQuery(hql).executeUpdate(); } }
[ "ashwinipande94@gmail.com" ]
ashwinipande94@gmail.com
44180d8ea375f3fecdeaf517304cb831a71d6037
2379fc9f41297fd7b35eef03e38124c25233d614
/svc-rrd-common/src/main/java/gr/forthnet/nms/svc/rrd/common/messages/FetchLastCommandMessageReply.java
65fdcb841251fb1cf471510d8ff9fcb7e4d5fa64
[]
no_license
cvasilak/svc-rrd-parent
955e37b9f8ed43899174700de50eb11062910b70
b7bcc538e0f2abc58023c03003a6d597785d2036
refs/heads/master
2020-05-01T19:54:51.229404
2012-05-31T16:19:04
2012-05-31T16:19:04
3,152,740
0
0
null
null
null
null
UTF-8
Java
false
false
539
java
package gr.forthnet.nms.svc.rrd.common.messages; import gr.forthnet.nms.svc.rrd.common.entities.RRALast; import java.util.Set; public class FetchLastCommandMessageReply extends CommandMessage { private String neId; private Set<RRALast> rras; public FetchLastCommandMessageReply() { super("fetchRRA"); } public String getNeId() { return neId; } public void setNeId(String neId) { this.neId = neId; } public Set<RRALast> getRRAs() { return rras; } public void setRRAs(Set<RRALast> rras) { this.rras = rras; } }
[ "cvasilak@gmail.com" ]
cvasilak@gmail.com
1d3556464cf5c2bcc64bde0b2f7028d14cc70fcc
f0f77cb213306af7855fba7f4c9ef3ff8840bd90
/app/src/test/java/com/example/tatina/myapplication/ExampleUnitTest.java
feef2eceb59a1f9b209dd1b94a3472147a0c0391
[]
no_license
TatianaLebedik/app-for-testing-android-client
939dd0fd2f34e1c89c78b4abfec00e0ac0c0e749
a8700d6086714a6c9d8aa811ad81d4010332dde5
refs/heads/master
2020-06-26T19:02:59.812715
2019-07-30T20:24:55
2019-07-30T20:24:55
199,721,813
0
0
null
null
null
null
UTF-8
Java
false
false
393
java
package com.example.tatina.myapplication; 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); } }
[ "lebedyktatiana@gmail.com" ]
lebedyktatiana@gmail.com
73e3d7c9e355b117d0f93508398775663e3609b3
359be21b086767aeddc445deccccff3e6d6dd409
/src/main/java/com/lec/framework/compnents/xls/imports/anotation/XlsMappingResolver.java
9e6216742dadc0540f96382817b6cf9f8eb0c0be
[]
no_license
haoxiang417/cloud_v1
066afa281a0cb531a2719ca07943dadf2b20b36c
b9eaef7b650d002c0df60428d4fdca4208d31afa
refs/heads/master
2020-05-17T07:28:49.409498
2019-04-26T07:33:50
2019-04-26T07:33:50
183,580,202
0
0
null
null
null
null
UTF-8
Java
false
false
1,253
java
package com.lec.framework.compnents.xls.imports.anotation; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; /** * <p>XlsMapping注解处理类</p> * @author zhouhaij * @since 1.0 * @version */ public class XlsMappingResolver { /*** * 处理xls导入验证时的xlsMapping注解 * @param clazz * @return xls映射属性包装类 */ @SuppressWarnings("rawtypes") public List<XlsProperty> process(Class clazz) { Field[] fields = clazz.getDeclaredFields(); List<XlsProperty> xlsPropertys = new ArrayList<XlsProperty>(); for (Field field : fields) { XlsMapping mapping = field.getAnnotation(XlsMapping.class); if (mapping != null) { field.setAccessible(true); try { String value = mapping.value(); String propName = field.getName(); XlsProperty xlsProperty = new XlsProperty(propName, mapping.cellNo()); xlsProperty.setFixity(mapping.fixity()); xlsProperty.setIstransfer(mapping.istransfer()); xlsProperty.setDefaultValue(value); xlsProperty.setFixValue(mapping.fixValue()); xlsPropertys.add(xlsProperty); } catch (IllegalArgumentException e) { } } } return xlsPropertys; } }
[ "haoxiang_417@163.com" ]
haoxiang_417@163.com
da74cdb4663cada3a1d72f3caf335dc9fd4bbcc6
6be39fc2c882d0b9269f1530e0650fd3717df493
/weixin反编译/sources/com/tencent/mm/plugin/sns/ui/SnsCommentFooter.java
8972fc171282d8f8f3b5da0b44c461d77f684a35
[]
no_license
sir-deng/res
f1819af90b366e8326bf23d1b2f1074dfe33848f
3cf9b044e1f4744350e5e89648d27247c9dc9877
refs/heads/master
2022-06-11T21:54:36.725180
2020-05-07T06:03:23
2020-05-07T06:03:23
155,177,067
5
0
null
null
null
null
UTF-8
Java
false
false
17,605
java
package com.tencent.mm.plugin.sns.ui; import android.content.Context; import android.text.Editable; import android.text.TextWatcher; import android.util.AttributeSet; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnTouchListener; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import android.view.animation.AnimationUtils; import android.view.animation.ScaleAnimation; import android.widget.Button; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import com.tencent.mm.plugin.sns.i.e; import com.tencent.mm.plugin.sns.i.f; import com.tencent.mm.plugin.sns.i.g; import com.tencent.mm.plugin.sns.i.i; import com.tencent.mm.plugin.sns.i.j; import com.tencent.mm.pluginsdk.ui.ChatFooterPanel; import com.tencent.mm.protocal.c.bku; import com.tencent.mm.sdk.platformtools.bi; import com.tencent.mm.sdk.platformtools.x; import com.tencent.mm.ui.BasePanelKeybordLayout; import com.tencent.mm.ui.MMActivity; import com.tencent.mm.ui.base.h; import com.tencent.mm.ui.widget.MMEditText; import java.util.ArrayList; import java.util.List; public class SnsCommentFooter extends BasePanelKeybordLayout { private MMActivity fnF; private ImageButton opZ; MMEditText oqa; private Button oqb; ChatFooterPanel oqc; boolean oqd = false; public boolean oqe = false; private boolean oqf = true; boolean oqg = true; private TextWatcher oqh = new TextWatcher() { public final void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) { } public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) { } public final void afterTextChanged(Editable editable) { if (SnsCommentFooter.this.oqa.getText() != null) { SnsCommentFooter.this.oqa.requestFocus(); boolean z = editable.length() > 0 && editable.toString().trim().length() > 0; if (z && SnsCommentFooter.this.oqg) { SnsCommentFooter.this.gz(true); SnsCommentFooter.this.oqg = false; } if (!z) { SnsCommentFooter.this.gz(false); SnsCommentFooter.this.oqg = true; } } } }; ImageView rHf; Button rHg; int rHh = 0; public boolean rHi; private String rHj = ""; private boolean rHk = false; a rHl; d rHm; private bi rHn; bku raa = null; int state = 0; interface a { void bBr(); } interface c { void Mp(String str); } interface d { void onShow(); } /* renamed from: com.tencent.mm.plugin.sns.ui.SnsCommentFooter$7 */ class AnonymousClass7 implements OnClickListener { final /* synthetic */ b rHs; AnonymousClass7(b bVar) { this.rHs = bVar; } public final void onClick(View view) { SnsCommentFooter.this.rHf.setImageResource(e.qEY); Animation scaleAnimation = new ScaleAnimation(0.9f, 1.3f, 0.9f, 1.3f, 1, 0.5f, 1, 0.5f); scaleAnimation.setDuration(400); scaleAnimation.setStartOffset(100); scaleAnimation.setRepeatCount(0); SnsCommentFooter.this.rHf.startAnimation(scaleAnimation); scaleAnimation.setAnimationListener(new AnimationListener() { public final void onAnimationEnd(Animation animation) { SnsCommentFooter.this.rHf.setImageResource(e.qEX); } public final void onAnimationRepeat(Animation animation) { } public final void onAnimationStart(Animation animation) { } }); this.rHs.bBs(); } } interface b { void bBs(); } static /* synthetic */ void h(SnsCommentFooter snsCommentFooter) { snsCommentFooter.oqc.onPause(); snsCommentFooter.oqc.setVisibility(8); } public final boolean bBt() { if (this.oqa.getText() == null || bi.oN(this.oqa.getText().toString())) { return true; } return false; } public SnsCommentFooter(Context context, AttributeSet attributeSet) { super(context, attributeSet); this.fnF = (MMActivity) context; } public final void bBu() { ViewGroup viewGroup = (ViewGroup) inflate(this.fnF, g.qNn, this); this.rHf = (ImageView) viewGroup.findViewById(f.qKL); this.oqb = (Button) viewGroup.findViewById(f.qGL); this.rHg = (Button) viewGroup.findViewById(f.qGF); this.oqa = (MMEditText) viewGroup.findViewById(f.qGD); gz(false); this.opZ = (ImageButton) viewGroup.findViewById(f.bJR); this.opZ.setOnClickListener(new OnClickListener() { public final void onClick(View view) { SnsCommentFooter.this.oqd = true; x.i("MicroMsg.SnsCommentFooter", "state onClick" + SnsCommentFooter.this.state); if (SnsCommentFooter.this.state == 0) { SnsCommentFooter.this.bBw(); SnsCommentFooter.this.oqa.requestFocus(); SnsCommentFooter.this.state = 1; SnsCommentFooter.this.anD(); SnsCommentFooter.this.opZ.setImageResource(e.bBp); SnsCommentFooter.this.oqf = false; return; } SnsCommentFooter.h(SnsCommentFooter.this); SnsCommentFooter.this.oqf = false; SnsCommentFooter.this.oqa.requestFocus(); SnsCommentFooter.this.bBv(); SnsCommentFooter.this.opZ.setImageResource(e.bBo); SnsCommentFooter.this.state = 0; } }); this.oqa.setHint(this.fnF.getString(j.qSG)); this.oqa.setOnTouchListener(new OnTouchListener() { public final boolean onTouch(View view, MotionEvent motionEvent) { SnsCommentFooter.this.oqf = false; SnsCommentFooter.this.oqc.setVisibility(8); SnsCommentFooter.this.oqc.onPause(); SnsCommentFooter.this.opZ.setImageResource(e.bBo); if (SnsCommentFooter.this.rHl != null) { SnsCommentFooter.this.rHl.bBr(); } SnsCommentFooter.this.state = 0; return false; } }); if (com.tencent.mm.pluginsdk.ui.chat.e.vxZ == null) { this.oqc = new com.tencent.mm.pluginsdk.ui.chat.d(this.fnF); return; } this.oqc = com.tencent.mm.pluginsdk.ui.chat.e.vxZ.cw(getContext()); this.oqc.ej(ChatFooterPanel.SCENE_SNS); this.oqc.setVisibility(8); this.oqc.setBackgroundResource(e.bzZ); ((LinearLayout) findViewById(f.cIB)).addView(this.oqc, -1, 0); this.oqc.tk(); this.oqc.aH(false); this.oqc.vqj = new com.tencent.mm.pluginsdk.ui.ChatFooterPanel.a() { public final void aYA() { } public final void gA(boolean z) { } public final void anG() { if (SnsCommentFooter.this.oqa != null && SnsCommentFooter.this.oqa.zCS != null) { SnsCommentFooter.this.oqa.zCS.sendKeyEvent(new KeyEvent(0, 67)); SnsCommentFooter.this.oqa.zCS.sendKeyEvent(new KeyEvent(1, 67)); } } public final void append(String str) { try { SnsCommentFooter.this.oqa.aaU(str); } catch (Throwable e) { x.printErrStackTrace("MicroMsg.SnsCommentFooter", e, "", new Object[0]); } } }; } public void setVisibility(int i) { boolean z = false; this.state = 0; if (i == 0) { z = true; } iO(z); super.setVisibility(i); } public final void iO(boolean z) { if (this.oqc != null) { this.rHi = z; x.i("MicroMsg.SnsCommentFooter", "showState " + z); if (z) { if (this.state == 0) { bBv(); this.oqa.requestFocus(); this.oqc.setVisibility(8); } else { bBw(); this.oqa.requestFocus(); anD(); } this.oqf = false; return; } this.oqc.setVisibility(8); this.opZ.setImageResource(i.dBm); bBw(); requestLayout(); } } private void bBv() { if (this.fnF.mController.xRL != 1) { this.fnF.showVKB(); } } private void bBw() { if (this.fnF.mController.xRL == 1) { this.fnF.aWY(); } } private void anD() { this.oqc.onResume(); this.oqc.setVisibility(0); LayoutParams layoutParams = this.oqc.getLayoutParams(); if (layoutParams != null && com.tencent.mm.compatible.util.j.aS(getContext()) && this.oqf) { layoutParams.height = com.tencent.mm.compatible.util.j.aQ(getContext()); this.oqc.setLayoutParams(layoutParams); this.oqf = false; } if (this.rHm != null) { this.rHm.onShow(); } } public final boolean bBx() { return this.state == 1; } public final void bBy() { if (this.oqa == null) { x.e("MicroMsg.SnsCommentFooter", "send edittext is null"); return; } this.oqa.removeTextChangedListener(this.oqh); this.oqa.addTextChangedListener(this.oqh); } public final void i(final List<l> list, String str) { this.rHj = str; if (this.oqa != null) { String aD; String str2 = ""; for (l lVar : list) { if (str.equals(lVar.aAM)) { list.remove(lVar); aD = bi.aD(lVar.text, ""); break; } } aD = str2; if (bi.oN(aD)) { this.oqa.setText(""); } else { this.rHg.setVisibility(0); this.oqb.setVisibility(8); this.oqa.setText(""); this.oqa.aaU(aD); } if (!this.rHk) { this.oqa.addTextChangedListener(new TextWatcher() { public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) { } public final void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) { } public final void afterTextChanged(Editable editable) { if (SnsCommentFooter.this.oqa.getText() != null) { l lVar; boolean z; x.d("MicroMsg.SnsCommentFooter", "update commentkey:" + SnsCommentFooter.this.rHj); for (l lVar2 : list) { if (SnsCommentFooter.this.rHj.equals(lVar2.aAM)) { x.d("MicroMsg.SnsCommentFooter", "afterTextChanged update"); lVar2.text = SnsCommentFooter.this.oqa.getText().toString(); z = true; break; } } z = false; if (!z) { x.d("MicroMsg.SnsCommentFooter", "afterTextChanged add"); lVar2 = new l(); lVar2.aAM = SnsCommentFooter.this.rHj; lVar2.text = SnsCommentFooter.this.oqa.getText().toString(); if (lVar2.text != null && lVar2.text.length() > 0) { list.add(lVar2); } } if (list.size() > 5) { x.d("MicroMsg.SnsCommentFooter", "comments remove"); list.remove(0); } SnsCommentFooter.this.oqa.requestFocus(); z = editable.length() > 0 && editable.toString().trim().length() > 0; if (z && SnsCommentFooter.this.oqg) { SnsCommentFooter.this.gz(z); SnsCommentFooter.this.oqg = false; } if (!z) { SnsCommentFooter.this.gz(z); SnsCommentFooter.this.oqg = true; } } } }); } this.rHk = true; } } public final void a(String str, bku bku) { this.rHh = 0; if (bi.oN(str)) { this.oqa.setHint(""); } else { this.oqa.setHint(com.tencent.mm.pluginsdk.ui.d.i.a(getContext(), str + this.fnF.getString(j.qQj, new Object[]{Float.valueOf(this.oqa.getTextSize())}))); } this.raa = bku; } public final void b(String str, bku bku) { if (bi.oN(str)) { this.oqa.setHint(""); } else { this.oqa.setHint(com.tencent.mm.pluginsdk.ui.d.i.a(getContext(), this.fnF.getString(j.qQb) + str + this.fnF.getString(j.qQj, new Object[]{Float.valueOf(this.oqa.getTextSize())}))); this.rHh = 1; } this.raa = bku; } public final void bBz() { this.oqa.setText(""); this.oqa.setHint(""); this.raa = null; this.rHh = 0; this.state = 0; } public final void MB(String str) { this.oqa.setHint(com.tencent.mm.pluginsdk.ui.d.i.b(getContext(), str, this.oqa.getTextSize())); } public final bku bBA() { if (this.raa == null) { return new bku(); } return this.raa; } public final void a(final c cVar) { this.rHg.setOnClickListener(new OnClickListener() { public final void onClick(View view) { com.tencent.mm.ui.tools.a.c Hg = com.tencent.mm.ui.tools.a.c.d(SnsCommentFooter.this.oqa).Hg(com.tencent.mm.j.b.zI()); Hg.zwQ = true; Hg.a(new com.tencent.mm.ui.tools.a.c.a() { public final void vE(String str) { cVar.Mp(SnsCommentFooter.this.oqa.getText().toString()); SnsCommentFooter.this.oqa.setText(""); } public final void anp() { } public final void aeD() { h.h(SnsCommentFooter.this.fnF, j.qSK, j.qSL); } }); } }); } public final void bBB() { this.rHf.setVisibility(8); } protected final void ra(int i) { super.ra(i); switch (i) { case -3: this.oqe = true; if (getVisibility() == 0 && this.rHn != null) { x.d("MicroMsg.SnsCommentFooter", "jacks dynamic adjust animation up"); this.rHn.bCU(); return; } return; default: this.oqe = false; return; } } public final void aYy() { this.rHn = null; if (this.oqc != null) { x.i("MicroMsg.SnsCommentFooter", "commentfooter release"); this.oqc.tj(); this.oqc.destroy(); } } private void gz(boolean z) { Animation loadAnimation = AnimationUtils.loadAnimation(getContext(), com.tencent.mm.plugin.sns.i.a.bqk); Animation loadAnimation2 = AnimationUtils.loadAnimation(getContext(), com.tencent.mm.plugin.sns.i.a.bql); loadAnimation.setDuration(150); loadAnimation2.setDuration(150); if (this.oqb != null && this.rHg != null) { if (z) { if (this.oqb.getVisibility() != 8 && this.oqb.getVisibility() != 4) { this.rHg.startAnimation(loadAnimation); this.rHg.setVisibility(0); this.oqb.startAnimation(loadAnimation2); this.oqb.setVisibility(8); } else { return; } } else if (this.oqb.getVisibility() != 0 && this.oqb.getVisibility() != 0) { this.oqb.startAnimation(loadAnimation); this.oqb.setVisibility(0); this.rHg.startAnimation(loadAnimation2); this.rHg.setVisibility(8); } else { return; } this.rHg.getParent().requestLayout(); } } protected final List<View> aYz() { List<View> arrayList = new ArrayList(); arrayList.add(this.oqc); return arrayList; } }
[ "denghailong@vargo.com.cn" ]
denghailong@vargo.com.cn
3f1e72dc91c6b5a2a5613a00e931d16c4b902a10
39086ef22b518e9d71abccb6d700610335caa38c
/src/KumohTime/View/Home/SelectedLecture/SelectedLectureLayoutController.java
fb6f4d71f17f7ec223535e8d68cb520594794e66
[ "MIT" ]
permissive
foryou8033j/KumohTime
284e21f12042d10b5bc02df7bc90837cb6f406d8
6dcbca118be9fec0163282a4718e3bdab39f7f80
refs/heads/master
2021-07-19T04:30:12.640610
2018-12-28T14:32:04
2018-12-28T14:32:04
144,011,244
3
4
MIT
2018-12-28T14:32:05
2018-08-08T12:34:11
Java
UTF-8
Java
false
false
4,510
java
package KumohTime.View.Home.SelectedLecture; import java.awt.AWTException; import java.awt.Robot; import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.StringSelection; import java.net.URL; import java.util.Random; import java.util.ResourceBundle; import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXColorPicker; import KumohTime.MainApp; import KumohTime.Model.TimeTable.Lecture; import KumohTime.Util.InfoManager; import javafx.application.Platform; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.geometry.HPos; import javafx.scene.layout.GridPane; import javafx.scene.paint.Color; import javafx.scene.text.Text; /** * 선택 된 강의리스트 View Controller * * @author Jeongsam Seo * @since 2018-08-01 * */ public class SelectedLectureLayoutController implements Initializable{ @FXML private GridPane pane; @FXML private Text name; @FXML private Text professor; @FXML private Text time; @FXML private JFXButton delete; @FXML private JFXColorPicker colorPicker; @FXML private JFXButton code; @FXML private JFXButton copyAll; @FXML public void handleCodeCopy(ActionEvent event) { StringSelection stringSelection = new StringSelection(lecture.getCode().get().replaceAll("-", "")); Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); clipboard.setContents(stringSelection, null); new Thread(()->{ Platform.runLater(()->{ code.setText("복사됨"); }); try { new Robot().delay(1000); } catch (AWTException e) { e.printStackTrace(); } Platform.runLater(()->{ code.setText(lecture.getCode().get()); }); }).start(); } @FXML public void handleCopy(ActionEvent event) { StringSelection stringSelection = new StringSelection(code.getText() + "\t" + professor.getText() + "\t\t"+ name.getText() + "\t\t" + time.getText()); Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); clipboard.setContents(stringSelection, null); new Thread(()->{ Platform.runLater(()->{ copyAll.setText("복사됨"); }); try { new Robot().delay(1000); } catch (AWTException e) { e.printStackTrace(); } Platform.runLater(()->{ copyAll.setText("전체 복사"); }); }).start(); } @FXML void handleDelete(ActionEvent event) { try { if(!isUseAble) { handleCodeCopy(null); return; } mainApp.getAppData().getTimeTableData().getSelectedLecture().remove(lecture); mainApp.getAppData().getTimeTableData().enableSimilarLecture(lecture); mainApp.getAppData().getTimeTableData().getSelectedLecture().remove(lecture); }catch (Exception e) { return; } } private MainApp mainApp; private Lecture lecture; private GridPane layout; private Boolean isUseAble; public void setDefault(MainApp mainApp, Lecture lecture, GridPane layout, boolean isUseAble) { this.isUseAble = isUseAble; this.mainApp = mainApp; this.lecture = lecture; this.layout = layout; if(!isUseAble) { colorPicker.setDisable(true); delete.setText("Ctrl+" + Integer.toString(mainApp.getAppData().getTimeTableData().getSelectedLecture().indexOf(lecture)+1)); layout.getColumnConstraints().get(0).setPercentWidth(10); } if(lecture.getLectureTime().size()==0) colorPicker.setVisible(false); name.setText(lecture.getName().get()); professor.setText(lecture.getProfessor().get()); code.setText(lecture.getCode().get()); time.setText(lecture.getTime().get()); colorPicker.valueProperty().set(lecture.getColor()); if(isUseAble) { colorPicker.valueProperty().addListener((observable, oldValue, newValue) -> { lecture.setColor(newValue); }); } //수강꾸러미일경우 배경 색상을 변경한다. if(lecture.getLecPackage().get().equals("N")) name.setFill(Color.rgb(241, 149, 104)); } public Lecture getLecture() { return lecture; } @Override public void initialize(URL location, ResourceBundle resources) { } }
[ "foryou8033j@gmail.com" ]
foryou8033j@gmail.com
835258921ef3978280bb89d72bdd6d29ce4265b6
d489e7874a8094c30362d3c420c4b86eab4a61d3
/src/main/java/pl/java/scalatech/dataSupplier/domain/Position.java
5c172c7d6c163b056f8c0c3d6449b96dab32bc4e
[ "MIT" ]
permissive
przodownikR1/dataSupplier
c8789758653c985fc18ccf53f7a1e220d9de0008
87938806cc9d24f6db14160e665a6f3222dcb54b
refs/heads/master
2020-04-12T22:54:48.103549
2019-01-21T13:28:43
2019-01-21T13:28:43
162,802,591
2
0
null
null
null
null
UTF-8
Java
false
false
129
java
package pl.java.scalatech.dataSupplier.domain; public enum Position { PROGRAMMER, DEVOPS, MANAGER, LEADER, DBA, TESTER; }
[ "przodownikr1@gmail.com" ]
przodownikr1@gmail.com
dca64d74315a65959cb4abd4432890fe5ab27004
5fb7b5a3792ce9bead97a86a0a37beebf3856669
/Service/src/lbs/LocationService.java
bb77e4f9532c309e9560b20cf853fbed3d65c156
[]
no_license
a191705907/e_help
21a0b7906a18780a98fcb675d805156617380914
ce0d8e47f4ed36f098cffe637e5846f5d29e79d0
refs/heads/master
2021-01-18T05:04:01.610203
2014-12-15T05:08:45
2014-12-15T05:08:45
null
0
0
null
null
null
null
GB18030
Java
false
false
4,584
java
package lbs; import com.amap.api.location.AMapLocation; import com.amap.api.location.AMapLocationListener; import com.amap.api.location.LocationManagerProxy; import com.amap.api.location.LocationProviderProxy; import com.amap.api.maps.model.LatLng; import android.app.Service; import android.content.Intent; import android.location.Location; import android.os.Binder; import android.os.Bundle; import android.os.IBinder; import android.util.Log; import android.widget.Toast; /** * 定位服务,打开app时开启,关闭app时关闭 请在app启动时bindservice 在app关闭时unbindservice * 通过静态方法可以获取定位信息 调用前先判断是否定位成功及service是否已经开启 * service开启一次定位一次,需要更新位置时startservice则可 * @author Jeese * */ public class LocationService extends Service implements AMapLocationListener { private LocationManagerProxy mLocationManagerProxy = null; private static double geoLat;// 纬度 private static double geoLng;// 精度 private static String province; // 省名称 private static String city; // 城市名称 private static String city_code; // 城市编码 private static String district;// 区县名称 private static String ad_code;// 区域编码 private static String street;// 街道和门牌信息 private static String address;// 详细地址 private static LatLng latlng; private static boolean success = false;// 是否定位成功 @Override public void onCreate() { super.onCreate(); } @Override public void onStart(Intent intent, int startId) { init(); } @Override public void onDestroy() { if (mLocationManagerProxy != null) { mLocationManagerProxy.removeUpdates(this); mLocationManagerProxy.destroy(); } mLocationManagerProxy = null; super.onDestroy(); } /** * 初始化定位 */ private void init() { mLocationManagerProxy = LocationManagerProxy .getInstance(LocationService.this); // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗, // 注意设置合适的定位时间的间隔,并且在合适时间调用removeUpdates()方法来取消定位请求 // 在定位结束后,在合适的生命周期调用destroy()方法 // 其中如果间隔时间为-1,则定位只定一次 mLocationManagerProxy.requestLocationData( LocationProviderProxy.AMapNetwork, -1, 15, this); mLocationManagerProxy.setGpsEnable(false); } @Override public void onLocationChanged(Location location) { // TODO Auto-generated method stub } @Override public void onStatusChanged(String provider, int status, Bundle extras) { // TODO Auto-generated method stub } @Override public void onProviderEnabled(String provider) { // TODO Auto-generated method stub } @Override public void onProviderDisabled(String provider) { // TODO Auto-generated method stub } @Override public void onLocationChanged(AMapLocation amapLocation) { if (amapLocation != null && amapLocation.getAMapException().getErrorCode() == 0) { // 设置位置详细信息 geoLat = amapLocation.getLatitude(); geoLng = amapLocation.getLongitude(); province = amapLocation.getProvince(); city = amapLocation.getCity(); city_code = amapLocation.getCityCode(); district = amapLocation.getDistrict(); address = amapLocation.getAddress(); street = amapLocation.getStreet(); ad_code = amapLocation.getAdCode(); // 设置定位成功 success = true; System.out.println("定位一次" + amapLocation.getStreet()); } } // 绑定服务,方便app关闭时关闭定位服务 private MyBinder myBinder = new MyBinder(); @Override public IBinder onBind(Intent intent) { return myBinder; } public class MyBinder extends Binder { public LocationService getService() { return LocationService.this; } } /******* get *************/ public static boolean getSuccess() { return success; } public static double getGeoLat() { return geoLat; } public static double getGeoLng() { return geoLng; } public static String getProvince() { return province; } public static String getCity() { return city; } public static String getCityCode() { return city_code; } public static String getDistrict() { return district; } public static String getAdCode() { return ad_code; } public static String getStreet() { return street; } public static String getAddress() { return address; } public static LatLng getLatLng() { return new LatLng(geoLat,geoLng); } }
[ "jeese@live.cn" ]
jeese@live.cn
8249b2e737fcde58848a27a0ce3f27d4c5bcb4f0
e034fc2e0ccc7bfcb4deca70f5dd4da57f18814b
/api.gamification.education/src/main/java/com/api/gamification/education/api/gamification/education/controller/QuestionCotroller.java
f6b9c2a3d1a6faf367093c5e0b0585c3cd8e2b12
[]
no_license
alanfernandes63/gamefication-education
c5f832c12f0e6082ac968e501d2b2ff67691cb75
ffeb1a7ccd97023e228aad9b3e8ca30e52bebd94
refs/heads/master
2020-07-15T15:47:10.603854
2019-09-05T02:29:08
2019-09-05T02:29:08
205,599,159
0
0
null
null
null
null
UTF-8
Java
false
false
3,036
java
package com.api.gamification.education.api.gamification.education.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.api.gamification.education.api.gamification.education.model.Question; import com.api.gamification.education.api.gamification.education.model.Teacher; import com.api.gamification.education.api.gamification.education.service.QuestionService; import com.api.gamification.education.api.gamification.education.service.TeacherService; @RestController @RequestMapping(value="/api/v1/") public class QuestionCotroller { @Autowired QuestionService questionService; private final String path = "teacher/questions/"; @Autowired TeacherService teacheService; @GetMapping(path= path + "{idTeacher}") public ResponseEntity<List<Question>> listAllQuestions(@PathVariable(value="idTeacher") long idTeacher){ Teacher teacher = teacheService.getTeacher(idTeacher); questionService.listAllQuestions(teacher); if(teacher != null) return new ResponseEntity<List<Question>>(questionService.listAllQuestions(teacher),HttpStatus.OK); else return new ResponseEntity<>(HttpStatus.BAD_REQUEST); } @PostMapping(path= path + "{idTeacher}") public ResponseEntity<Question> saveQuestion(@PathVariable long idTeacher,@RequestBody Question question) { Teacher teacher = teacheService.getTeacher(idTeacher); if(teacher != null) { question.setTeacher(teacher); return new ResponseEntity<Question>(questionService.saveQuestion(question),HttpStatus.CREATED); } else return new ResponseEntity(HttpStatus.BAD_REQUEST); } @DeleteMapping(path = path + "{idQuestion}") public ResponseEntity deleteQuestions(@PathVariable long idQuestion) { questionService.deleteQuestion(idQuestion); return new ResponseEntity(HttpStatus.NO_CONTENT); } @PutMapping(path = path + "{idQuestion}") public ResponseEntity updateQuestion(@RequestBody Question questionUpdate,@PathVariable long idQuestion) { Question question = questionService.getQuestion(idQuestion); if(question != null) { Teacher teacher = question.getTeacher(); questionUpdate.setId(question.getId()); question = questionUpdate; question.setTeacher(teacher); questionService.updateQuestion(question); return new ResponseEntity(HttpStatus.OK); } else return new ResponseEntity(HttpStatus.BAD_REQUEST); } }
[ "alan.fernandes63@gmail.com" ]
alan.fernandes63@gmail.com
3e28482e2b5babacbd8b97e06082ad9e9706b13e
09b696c6224408c0dedcf64974a61752593d58b5
/src/Algorithms/HouseRobber.java
515ce8a462cc21489e3921bb3fe1173382efd01d
[]
no_license
yuhuazheng/JH
f1c346ba5fe786908506120775c7689dbeba3ceb
305a8c771495549f7bdb88d5fa24d68273967840
refs/heads/master
2021-01-23T13:29:08.697925
2016-10-27T10:34:32
2016-10-27T10:34:32
22,968,875
0
0
null
null
null
null
UTF-8
Java
false
false
523
java
public class HouseRobber { public int rob(int[] nums) { if(nums==null||nums.length==0) return 0; if(nums.length==1) return nums[0]; if(nums.length==2) return Math.max(nums[0],nums[1]); int pre2=nums[0]; int pre1=Math.max(nums[1],pre2); int maxM=pre1; for(int i=2;i<nums.length;i++){ maxM = Math.max(pre1,pre2+nums[i]); // don't rob i, equals pre1; robi, plus pre2 pre2=pre1; pre1=maxM; } return maxM; } }
[ "yuhuazheng2006@gmail.com" ]
yuhuazheng2006@gmail.com
dc133aca4d3cbf420bdddb63bf4aabdad7dd84fb
63f142347bbd63a41c0c69a646f10747ea9edede
/src/main/java/com/crfeb/tbmpt/project/model/vo/ProjectSectionVo.java
3c4974e3049fafd24074cbbd3543eb90c701163c
[]
no_license
guoxuhui/Tbmpt_Web
c842e500797bc843968a7f683fadeda4047a2031
131380902383dc51e6a29a53ddd0f78c74400233
refs/heads/master
2021-07-10T05:53:02.856913
2017-10-10T11:08:21
2017-10-10T11:08:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,425
java
package com.crfeb.tbmpt.project.model.vo; import java.io.Serializable; import com.baomidou.mybatisplus.annotations.IdType; import com.baomidou.mybatisplus.annotations.TableField; import com.baomidou.mybatisplus.annotations.TableId; /** * * 项目区间信息表 * */ public class ProjectSectionVo implements Serializable { @TableField(exist = false) private static final long serialVersionUID = 1L; /** UUID */ @TableId(type = IdType.UUID) private String id; /** 区间名称 */ @TableField(value = "SECTION_NAME") private String sectionName; /** 区间简称 */ private String abbreviation; /** 地层情况 */ private String dcqk; /** 备注 */ private String remark; /** 项目信息ID */ @TableField(value = "PRO_ID") private String proId; /** 项目名称 */ private String proName; /** 录入时间 */ private String entertime; /** 录入人 */ private String enterperson; /** 删除标识 */ private int deleteflag; public String getId() { return this.id; } public void setId(String id) { this.id = id; } public String getSectionName() { return this.sectionName; } public void setSectionName(String sectionName) { this.sectionName = sectionName; } public String getRemark() { return this.remark; } public void setRemark(String remark) { this.remark = remark; } public String getProId() { return this.proId; } public void setProId(String proId) { this.proId = proId; } public String getProName() { return proName; } public void setProName(String proName) { this.proName = proName; } public String getEntertime() { return this.entertime; } public void setEntertime(String entertime) { this.entertime = entertime; } public String getEnterperson() { return this.enterperson; } public void setEnterperson(String enterperson) { this.enterperson = enterperson; } public int getDeleteflag() { return this.deleteflag; } public void setDeleteflag(int deleteflag) { this.deleteflag = deleteflag; } public String getAbbreviation() { return abbreviation; } public void setAbbreviation(String abbreviation) { this.abbreviation = abbreviation; } public String getDcqk() { return dcqk; } public void setDcqk(String dcqk) { this.dcqk = dcqk; } }
[ "wpisen@163.com" ]
wpisen@163.com
62fb4e16f460205e04438aa9f12574d4df9360f5
6a10d004af2c7e7f2107a3e68ae16bdbb16e2c73
/Workspace/Medical TREC/src/UtsMetathesaurusContent/TreePositionDTO.java
016ccc0e2e641290d4f67e40fb4d3cd1eb5f0d55
[]
no_license
DaveNFS/UMLSTest
a7749ab8caf3f63b0fa708f43614e9a9286b9dda
62061582e44d4109b82f6c47989465b75a7c8c2e
refs/heads/master
2020-06-04T04:34:40.954959
2014-11-14T05:06:04
2014-11-14T05:06:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,767
java
package UtsMetathesaurusContent; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for treePositionDTO complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="treePositionDTO"> * &lt;complexContent> * &lt;extension base="{http://webservice.uts.umls.nlm.nih.gov/}sourceDataDTO"> * &lt;sequence> * &lt;element name="additionalRelationLabel" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="childCount" type="{http://www.w3.org/2001/XMLSchema}int"/> * &lt;element name="defaultPreferredName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="pathsToRootCount" type="{http://www.w3.org/2001/XMLSchema}int"/> * &lt;element name="siblingCount" type="{http://www.w3.org/2001/XMLSchema}int"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "treePositionDTO", propOrder = { "additionalRelationLabel", "childCount", "defaultPreferredName", "pathsToRootCount", "siblingCount" }) @XmlSeeAlso({ AtomTreePositionDTO.class, SourceAtomClusterTreePositionDTO.class }) public class TreePositionDTO extends SourceDataDTO { protected String additionalRelationLabel; protected int childCount; protected String defaultPreferredName; protected int pathsToRootCount; protected int siblingCount; /** * Gets the value of the additionalRelationLabel property. * * @return * possible object is * {@link String } * */ public String getAdditionalRelationLabel() { return additionalRelationLabel; } /** * Sets the value of the additionalRelationLabel property. * * @param value * allowed object is * {@link String } * */ public void setAdditionalRelationLabel(String value) { this.additionalRelationLabel = value; } /** * Gets the value of the childCount property. * */ public int getChildCount() { return childCount; } /** * Sets the value of the childCount property. * */ public void setChildCount(int value) { this.childCount = value; } /** * Gets the value of the defaultPreferredName property. * * @return * possible object is * {@link String } * */ public String getDefaultPreferredName() { return defaultPreferredName; } /** * Sets the value of the defaultPreferredName property. * * @param value * allowed object is * {@link String } * */ public void setDefaultPreferredName(String value) { this.defaultPreferredName = value; } /** * Gets the value of the pathsToRootCount property. * */ public int getPathsToRootCount() { return pathsToRootCount; } /** * Sets the value of the pathsToRootCount property. * */ public void setPathsToRootCount(int value) { this.pathsToRootCount = value; } /** * Gets the value of the siblingCount property. * */ public int getSiblingCount() { return siblingCount; } /** * Sets the value of the siblingCount property. * */ public void setSiblingCount(int value) { this.siblingCount = value; } }
[ "bill.dave.utah@gmial.com" ]
bill.dave.utah@gmial.com
577dacbfd3d984417099bf935af34c4e053ef675
0d59ef76feb60f81f5cace8fff4695e32e003c30
/Webworkspace/web26_Ajax_Jquery/src/servlet/ajax/JQueryAjax.java
cf2f52715ecc57386a212a55186c64e6a3f37135
[]
no_license
cksdud7158/Programming_edu
16dee58ee6386885a16161125785eff3b339826b
7105683a859adb39f5bded0c2dcb165b48a0e8c1
refs/heads/master
2022-11-17T21:42:32.548950
2020-07-16T12:17:02
2020-07-16T12:17:02
256,147,811
0
0
null
null
null
null
UTF-8
Java
false
false
778
java
package servlet.ajax; import java.io.IOException; import java.io.PrintWriter; 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("/JQueryAjax") public class JQueryAjax extends HttpServlet { private static final long serialVersionUID = 1L; public JQueryAjax() { super(); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); String id = request.getParameter("id"); String pass = request.getParameter("pass"); out.print(id+","+pass); } }
[ "cksdud7158@gmail.com" ]
cksdud7158@gmail.com
49145d8b3641005378f8863e7602d4f40d922d27
a3fd6aeac873f0fbff2798c3be529475f0dfbf8d
/src/test/java/com/palehorsestudios/ard/environment/PuzzleTest.java
555faaaac9c3e9e0c95d11a07578b60bcfce9d9f
[]
no_license
wonil-park/ard
65f7bddad18d047b3387bd91eab6ed383ce29eec
937804f2710744ff4dcac7255ca61f44ffdbe158
refs/heads/master
2022-12-17T04:19:43.279007
2020-09-23T05:20:01
2020-09-23T05:20:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,231
java
package com.palehorsestudios.ard.environment; import org.junit.Before; import org.junit.Test; import java.util.List; import java.util.Set; import static org.junit.Assert.*; public class PuzzleTest { Puzzle puzzle; @Before public void setUp() { puzzle = new Puzzle("This is the question", "easy", "Correct Answer", Set.of("wrong1", "wrong2", "wrong3")); } @Test public void getAllAnswers() { var correct = List.of("Correct Answer", "wrong1", "wrong2", "wrong3"); puzzle.getAllAnswers().forEach(e -> assertTrue(correct.contains(e))); } @Test public void getDifficultyInt_easy() { assertEquals(1, puzzle.getDifficultyInt()); } @Test public void getDifficultyInt_medium() { puzzle = new Puzzle("", "medium", "", Set.of("")); assertEquals(2, puzzle.getDifficultyInt()); } @Test public void getDifficultyInt_hard() { puzzle = new Puzzle("", "hard", "", Set.of("")); assertEquals(3, puzzle.getDifficultyInt()); } @Test public void getDifficultyInt_weirdCase() { puzzle = new Puzzle("", "hArD", "", Set.of()); assertEquals(3, puzzle.getDifficultyInt()); } }
[ "tucchase@amazon.com" ]
tucchase@amazon.com
e3c70eec8bef5d5e2ba2eeb4cd98f2648d07d9ec
42ff2acd4aab18f8807df84e7133825d2c42d6c1
/spring/app/src/main/java/calculator/Calculator.java
7966e5953a49fc5d918a10786503e228c89fb4cd
[]
no_license
uyw4687/web
9e51698507266dee416627fdfce6821d88fcf2bc
1d7b3fb28fa9d2ea3817f62fb9de10ec3e7b07bf
refs/heads/main
2023-08-02T00:32:51.796061
2021-09-22T18:13:16
2021-09-22T18:13:16
404,803,482
0
0
null
null
null
null
UTF-8
Java
false
false
91
java
package calculator; public interface Calculator { public long factorial(long num); }
[ "uyw4687@naver.com" ]
uyw4687@naver.com
357412986fef1e42fdee42f9721cb557b4657da1
9a857d1407cf27764f402399adb9fc81c3511b6c
/src/20141123/game-dao/src/main/java/com/lodogame/game/dao/impl/mysql/UserHeroSkillTrainDaoMysqlImpl.java
d1d1c4d9977cb5d4eca4e756c82db9a2e1b48808
[]
no_license
zihanbobo/smsg-server
fcfec6fc6b55441d7ab64bb8b769d072752592c0
abfebf8b1fff83332090b922e390b892483da6ed
refs/heads/master
2021-06-01T00:01:43.208825
2016-05-10T10:10:01
2016-05-10T10:10:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,734
java
package com.lodogame.game.dao.impl.mysql; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import com.lodogame.common.jdbc.Jdbc; import com.lodogame.common.jdbc.SqlParameter; import com.lodogame.game.dao.UserHeroSkillTrainDao; import com.lodogame.model.UserHeroSkillTrain; public class UserHeroSkillTrainDaoMysqlImpl implements UserHeroSkillTrainDao { private String table = "user_hero_skill_train"; @Autowired private Jdbc jdbc; @Override public List<UserHeroSkillTrain> getList(String userId, String userHeroId) { String sql = "SELECT * FROM " + table + " WHERE user_id = ? AND user_hero_id = ? ORDER BY skill_group_id DESC "; SqlParameter parameter = new SqlParameter(); parameter.setString(userId); parameter.setString(userHeroId); return this.jdbc.getList(sql, UserHeroSkillTrain.class, parameter); } @Override public boolean delete(String userId, String userHeroId) { String sql = "DELETE FROM " + table + " WHERE user_id = ? AND user_hero_id = ? "; SqlParameter parameter = new SqlParameter(); parameter.setString(userId); parameter.setString(userHeroId); return this.jdbc.update(sql, parameter) > 0; } @Override public boolean delete(String userId, String userHeroId, int skillGroupId) { String sql = "DELETE FROM " + table + " WHERE user_id = ? AND user_hero_id = ? AND skill_group_id = ? "; SqlParameter parameter = new SqlParameter(); parameter.setString(userId); parameter.setString(userHeroId); parameter.setInt(skillGroupId); return this.jdbc.update(sql, parameter) > 0; } @Override public boolean add(List<UserHeroSkillTrain> userHeroSkillTrainList) { this.jdbc.insert(userHeroSkillTrainList); return true; } }
[ "dogdog7788@qq.com" ]
dogdog7788@qq.com
a4ccce5b92e17b294c8e629a0b8166984d7a6c4f
5ca626cbd3de8f5e21cc3c24ca066cd927225a9d
/src/main/java/com/sjzxy/quartz/util/Query.java
66101ffe2e4e9536188a382ae329d782305fde3c
[]
no_license
shijiazhuangwsq/quartz-test
658b4e2fe50567160b18ba071e33a365a65cd0c5
32e5ac9a263175cdf67ca0e50554dda1a88f9870
refs/heads/master
2022-06-28T08:41:47.484977
2020-01-15T01:44:40
2020-01-15T01:44:40
233,964,922
4
0
null
2022-06-17T02:49:30
2020-01-15T00:39:50
Java
UTF-8
Java
false
false
1,956
java
package com.sjzxy.quartz.util; import java.util.LinkedHashMap; import java.util.Map; /** * 查询参数 * * @author asiainfo * * @date 2017-03-14 23:15 */ public class Query extends LinkedHashMap<String, Object> { private static final long serialVersionUID = 1L; //当前页数 private Integer pageNum; //当前记录数 private Integer pageSize; public Query(Map<String, Object> params){ //分页参数的验证 //如果页面上的分页参数不符合则按默认值来 Integer pageNum = new Integer(1); Integer pageSize = new Integer(10); Object oPageNum = params.get("pageNum"); Object oPageSize = params.get("pageSize"); if(oPageNum != null) { try { Integer sPageNum = Integer.parseInt(oPageNum.toString()); if(sPageNum.compareTo(0) >=0) { pageNum = sPageNum; } } catch (NumberFormatException e) { } } if(oPageSize != null) { try { Integer sPageSize = Integer.parseInt(oPageSize.toString()); if(sPageSize.compareTo(0) > 0) { pageSize = sPageSize; } } catch (NumberFormatException e) { pageSize = 15; } } this.pageNum = pageNum; this.pageSize = pageSize; params.put("pageNum", pageNum); params.put("pageSize", pageSize); this.putAll(params); //防止SQL注入(因为sidx、order是通过拼接SQL实现排序的,会有SQL注入风险) /* String sidx = params.get("sidx").toString(); String order = params.get("order").toString(); this.put("sidx", SQLFilter.sqlInject(sidx)); this.put("order", SQLFilter.sqlInject(order));*/ } public Integer getPageNum() { return pageNum; } public void setPageNum(Integer pageNum) { this.pageNum = pageNum; } public Integer getPageSize() { return pageSize; } public void setPageSize(Integer pageSize) { this.pageSize = pageSize; } }
[ "shiyuanwangshiqi@aliyun.com" ]
shiyuanwangshiqi@aliyun.com
87629ede5b8d9baed64971793ca30b6c896c89a5
27e1cd93995263b49292a34dc33aecd414eaf507
/doshou-common/src/main/java/me/doshou/common/utils/security/DESCoder.java
52f168dd5212604da4bec3f00c2a481dc69c7efb
[]
no_license
yorkchow/doshou
6b0209910b7070eb66ceedd7f58b13e1a49a1583
b3d23e1e344cef57d913428bbb0d0a86ae7ed009
refs/heads/master
2016-08-06T13:28:03.566701
2015-01-09T09:02:36
2015-01-09T09:02:36
26,951,011
1
1
null
null
null
null
UTF-8
Java
false
false
3,977
java
package me.doshou.common.utils.security; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; import java.security.Key; /** * DES安全编码组件 * <p/> * <pre> * 支持 DES、DESede(TripleDES,就是3DES)、AES、Blowfish、RC2、RC4(ARCFOUR) * DES key size must be equal to 56 * DESede(TripleDES) key size must be equal to 112 or 168 * AES key size must be equal to 128, 192 or 256,but 192 and 256 bits may not be available * Blowfish key size must be multiple of 8, and can only range from 32 to 448 (inclusive) * RC2 key size must be between 40 and 1024 bits * RC4(ARCFOUR) key size must be between 40 and 1024 bits * 具体内容 需要关注 JDK Document http://.../docs/technotes/guides/security/SunProviders.html * </pre> * * @version 1.0 * @since 1.0 */ public abstract class DESCoder extends Coder { /** * ALGORITHM 算法 <br> * 可替换为以下任意一种算法,同时key值的size相应改变。 * <p/> * <pre> * DES key size must be equal to 56 * DESede(TripleDES) key size must be equal to 112 or 168 * AES key size must be equal to 128, 192 or 256,but 192 and 256 bits may not be available * Blowfish key size must be multiple of 8, and can only range from 32 to 448 (inclusive) * RC2 key size must be between 40 and 1024 bits * RC4(ARCFOUR) key size must be between 40 and 1024 bits * </pre> * <p/> * 在Key toKey(byte[] key)方法中使用下述代码 * <code>SecretKey secretKey = new SecretKeySpec(key, ALGORITHM);</code> 替换 * <code> * DESKeySpec dks = new DESKeySpec(key); * SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(ALGORITHM); * SecretKey secretKey = keyFactory.generateSecret(dks); * </code> */ public static final String ALGORITHM = "TripleDES"; /** * 转换密钥<br> * * @param key * @return * @throws Exception */ private static Key toKey(byte[] key) throws Exception { // DESKeySpec dks = new DESKeySpec(key); // SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(ALGORITHM); // SecretKey secretKey = keyFactory.generateSecret(dks); // 当使用其他对称加密算法时,如AES、Blowfish等算法时,用下述代码替换上述三行代码 SecretKey secretKey = new SecretKeySpec(key, ALGORITHM); return secretKey; } /** * 解密 * * @param data * @param key * @return * @throws Exception */ public static byte[] decrypt(byte[] data, String key) throws Exception { Key k = toKey(decryptBASE64(key)); Cipher cipher = Cipher.getInstance(ALGORITHM); cipher.init(Cipher.DECRYPT_MODE, k); return cipher.doFinal(data); } /** * 加密 * * @param data * @param key * @return * @throws Exception */ public static byte[] encrypt(byte[] data, String key) throws Exception { Key k = toKey(decryptBASE64(key)); Cipher cipher = Cipher.getInstance(ALGORITHM); cipher.init(Cipher.ENCRYPT_MODE, k); return cipher.doFinal(data); } /** * 生成密钥 * * @return * @throws Exception */ public static String initKey() throws Exception { return initKey(null); } /** * 生成密钥 * * @param seed * @return * @throws Exception */ public static String initKey(String seed) throws Exception { seed = seed + "1234567890987654321012345678901234567890"; byte[] bytes = seed.getBytes(); byte[] result = new byte[24]; for (int i = 0; i < 24; i++) { result[i] = bytes[i]; } return encryptBASE64(result); } }
[ "marqro.york.chow@gmail.com" ]
marqro.york.chow@gmail.com
fc8e9e1d609b2713d06cc02060e425f13e8a9887
709901ac63e114636add5a930a873596006acf01
/src/java/adm/controller/Member1Facade.java
d0533de551cec30b059da757cd6e2e611721211a
[]
no_license
tesarrdptr/ADM_manager
ac880181eeea77c5693593063e9098b50316668a
a39152ff803124e229865250bbe89d45f1c95ecf
refs/heads/master
2022-12-04T22:18:00.271861
2020-08-11T10:21:51
2020-08-11T10:21:51
285,715,268
0
1
null
null
null
null
UTF-8
Java
false
false
755
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 adm.controller; import adm.model.Member1; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; /** * * @author RAKA */ @Stateless public class Member1Facade extends AbstractFacade<Member1> { @PersistenceContext(unitName = "ADM_ManagerPU") private EntityManager em; /** * * @return */ @Override protected EntityManager getEntityManager() { return em; } /** * */ public Member1Facade() { super(Member1.class); } }
[ "tesarradiputro@gmail.com" ]
tesarradiputro@gmail.com
185e97e38f5291262bc26a44bea93e1fca6fb0aa
6050b45818d4930c944cb57e2a116ab3880b448a
/src/eventplannerPD/Event.java
b389623d3773c11304a54abc0f3bebefc573054f
[]
no_license
nshimiyimaana/EventPlanner
9d54b3c378a38ff5d8eeeb594f15d22ea9295843
a926c4ec967757039259825a320cd54ca5d9f5b3
refs/heads/master
2021-06-19T16:19:30.660430
2017-07-21T18:14:48
2017-07-21T18:14:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,738
java
package eventplannerPD; import java.util.*; import eventplannerPD.enums.EventStatus; /** * The Event is the primary problem domain class. It contains the necessary information needed to generate seating assignments. The event class represents the event Eagle Event Planning is hosting for the customer. */ public class Event { /** * The ID is the unique identifier used in the database to ensure that each of the events have their own unique row. */ private Integer id; /** * The guestList is a collection of guests that are attending the event. */ private GuestList guestList; /** * The date is the day and time the event is being held. */ private GregorianCalendar date; /** * The location is the venue for the event. This has little impact on the system's calculations. It is up to human intuition and experience to know whether or not a venue is large enough for the guest list provided. */ private String location; /** * The menu represents the food that will be provided at the event in the system. This is of little consequence to the seating problem. */ private String menu; /** * This attribute represents the name of the event in the system. */ private String name; /** * The customer that commissioned Eagle Event Planning to host this event. */ private Customer customer; /** * The Eagle Event Planning employee charged with planning the event. */ private User assignedUser; /** * The current status of the event, whether it is in the planning process, newly opened, canceled, or over. See the EventStatus enumeration for more details. */ private EventStatus eventStatus; /** * The collection of tables at the event. Each table knows its size and shape. Seat numbers begin from the leftmost upper corner of rectangular tables or the twelve o'clock position of elliptical tables. */ private Collection<Table> tables; /** * The percentage of seats allowed to be vacant at a table. This value is used along with the size of the guest list to determine the number of seats that should be available at the event. This will in turn be used to determine the number of tables at the event. */ private double percentSeatsEmpty; /** * The total seats are the number of seats at the event based on the number of tables at the event. */ private int totalSeats; public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } public GuestList getGuestList() { return this.guestList; } public void setGuestList(GuestList guestList) { this.guestList = guestList; } public GregorianCalendar getDate() { return this.date; } public void setDate(GregorianCalendar date) { this.date = date; } public String getLocation() { return this.location; } public void setLocation(String location) { this.location = location; } public String getMenu() { return this.menu; } public void setMenu(String menu) { this.menu = menu; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public Customer getCustomer() { return this.customer; } public void setCustomer(Customer customer) { this.customer = customer; } public User getAssignedUser() { return this.assignedUser; } public void setAssignedUser(User assignedUser) { this.assignedUser = assignedUser; } public EventStatus getEventStatus() { return this.eventStatus; } public void setEventStatus(EventStatus eventStatus) { this.eventStatus = eventStatus; } public Collection<Table> getTables() { return this.tables; } public void setTables(Collection<Table> tables) { this.tables = tables; } public double getPercentSeatsEmpty() { return this.percentSeatsEmpty; } public void setPercentSeatsEmpty(double percentSeatsEmpty) { this.percentSeatsEmpty = percentSeatsEmpty; } public int getTotalSeats() { return this.totalSeats; } public void setTotalSeats(int totalSeats) { this.totalSeats = totalSeats; } /** * Default "no-argument" constructor for the Event. This is required for JPA persistence. */ public Event() { // TODO - implement Event.Event throw new UnsupportedOperationException(); } /** * Determines whether the event can be removed from the database. An event is only fit for deletion if it's eventStatus value is equal to "Canceled". * @return True: The event may be deleted and removed from the database. * False: The event may not be deleted and removed from the database. */ public boolean isOkToDelete() { // TODO - implement Event.isOkToDelete throw new UnsupportedOperationException(); } /** * Calculates the number of tables needed to accommodate the guest list and the required ratio of empty seats. * @param pse The percentage of empty seats we are expecting at a table. This is used to prevent filling up a tables and leaving others completely empty. * @param table The table is an object of a certain shape, either rectangular or elliptical, and a size from four to twelve. The table is where the guests sit. The table object is passed in for its size attribute. * @param gl The guest list is passed into this method for its size attribute. The chosen table size and the size of the guest list is needed to determine the number of tables needed. * @return The number of tables needed to accommodate the guest list with the required ratio of empty seats. */ public int calculateNumTables(double pse, Table table, GuestList gl) { // TODO - implement Event.calculateNumTables throw new UnsupportedOperationException(); } /** * Calculates the number of seats that are needed for the guest list and the percentage of vacancies. This is required to accommodate guests that did not RSVP or brought extra people. * @param pse * @param gl */ public int calculateTotalSeats(double pse, GuestList gl) { // TODO - implement Event.calculateTotalSeats throw new UnsupportedOperationException(); } }
[ "rdnotlaw91@outlook.com" ]
rdnotlaw91@outlook.com
3c7102d3d3d3d033eece933c72cdc88a1e49416d
08552623f87a66c5684ba0ece0ae039f6d05d8dd
/app/src/main/java/com/juyijia/mm/beauty/DefaultBeautyViewHolder.java
cf3bf78298edaccad91a67cb16f0ccc6dd042d2c
[]
no_license
ls895977/cityAdvertising_YuanBan
8d528dff55432460c24861d06c7ac47664a88b24
c6df5537562cac05154b20db4a35c07a7e692638
refs/heads/master
2022-07-15T02:31:28.572576
2020-05-17T06:31:55
2020-05-17T06:31:55
263,084,475
0
0
null
null
null
null
UTF-8
Java
false
false
5,708
java
package com.juyijia.mm.beauty; import android.content.Context; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.SparseArray; import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; import com.juyijia.beauty.bean.FilterBean; import com.juyijia.beauty.custom.TextSeekBar; import com.juyijia.mm.R; import com.juyijia.mm.interfaces.OnItemClickListener; import com.juyijia.mm.views.AbsViewHolder; /** * Created by cxf on 2018/6/22. * 默认美颜 */ public class DefaultBeautyViewHolder extends AbsViewHolder implements View.OnClickListener, BeautyViewHolder { private SparseArray<View> mSparseArray; private int mCurKey; private FilterAdapter mFilterAdapter; private DefaultEffectListener mEffectListener; private VisibleListener mVisibleListener; private boolean mShowed; public DefaultBeautyViewHolder(Context context, ViewGroup parentView) { super(context, parentView); } @Override protected int getLayoutId() { return R.layout.view_beauty_default; } @Override public void init() { findViewById(R.id.btn_beauty).setOnClickListener(this); findViewById(R.id.btn_filter).setOnClickListener(this); findViewById(R.id.btn_hide).setOnClickListener(this); mSparseArray = new SparseArray<>(); mSparseArray.put(R.id.btn_beauty, findViewById(R.id.group_beauty)); mSparseArray.put(R.id.btn_filter, findViewById(R.id.group_filter)); mCurKey = R.id.btn_beauty; TextSeekBar.OnSeekChangeListener onSeekChangeListener = new TextSeekBar.OnSeekChangeListener() { @Override public void onProgressChanged(View view, int progress) { if (mEffectListener != null) { switch (view.getId()) { case R.id.seek_meibai: mEffectListener.onMeiBaiChanged(progress); break; case R.id.seek_mopi: mEffectListener.onMoPiChanged(progress); break; case R.id.seek_hongrun: mEffectListener.onHongRunChanged(progress); break; } } } }; TextSeekBar seekMeiBai = ((TextSeekBar) findViewById(R.id.seek_meibai)); TextSeekBar seekMoPi = ((TextSeekBar) findViewById(R.id.seek_mopi)); TextSeekBar seekHongRun = ((TextSeekBar) findViewById(R.id.seek_hongrun)); seekMeiBai.setOnSeekChangeListener(onSeekChangeListener); seekMoPi.setOnSeekChangeListener(onSeekChangeListener); seekHongRun.setOnSeekChangeListener(onSeekChangeListener); //滤镜 RecyclerView filterRecyclerView = (RecyclerView) findViewById(R.id.filter_recyclerView); filterRecyclerView.setHasFixedSize(true); filterRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false)); mFilterAdapter = new FilterAdapter(mContext); mFilterAdapter.setOnItemClickListener(new OnItemClickListener<FilterBean>() { @Override public void onItemClick(FilterBean bean, int position) { if (mEffectListener != null) { mEffectListener.onFilterChanged(bean); } } }); filterRecyclerView.setAdapter(mFilterAdapter); } @Override public void setEffectListener(EffectListener effectListener) { if (effectListener != null && effectListener instanceof DefaultEffectListener) { mEffectListener = (DefaultEffectListener) effectListener; } } @Override public void show() { if (mVisibleListener != null) { mVisibleListener.onVisibleChanged(true); } if (mParentView != null && mContentView != null) { ViewParent parent = mContentView.getParent(); if (parent != null) { ((ViewGroup) parent).removeView(mContentView); } mParentView.addView(mContentView); } mShowed = true; } @Override public void hide() { removeFromParent(); if (mVisibleListener != null) { mVisibleListener.onVisibleChanged(false); } mShowed = false; } @Override public void onClick(View v) { int id = v.getId(); switch (id) { case R.id.btn_beauty: case R.id.btn_filter: toggle(id); break; case R.id.btn_hide: hide(); break; } } private void toggle(int key) { if (mCurKey == key) { return; } mCurKey = key; for (int i = 0, size = mSparseArray.size(); i < size; i++) { View v = mSparseArray.valueAt(i); if (mSparseArray.keyAt(i) == key) { if (v.getVisibility() != View.VISIBLE) { v.setVisibility(View.VISIBLE); } } else { if (v.getVisibility() == View.VISIBLE) { v.setVisibility(View.INVISIBLE); } } } } @Override public boolean isShowed() { return mShowed; } @Override public void release() { mVisibleListener = null; mEffectListener = null; } @Override public void setVisibleListener(VisibleListener visibleListener) { mVisibleListener = visibleListener; } }
[ "895977304@qq.com" ]
895977304@qq.com
8f10d8cb1f64b8a10a8e75e371070da560926f9b
6ae03ab4191a687401e99e2cd08abbe8ec50e477
/src/com/lei/security/configuration/UserRolesType.java
a24045419f3eca72da5b51a9cac06988c18a4079
[]
no_license
chandrakant09/TMS
4b552989b40b38294830f892457e339a04baa0a1
d6a2a89b23db9c1495f4dd4169418e3611477b6a
refs/heads/master
2020-03-10T02:49:19.886561
2018-04-15T09:03:43
2018-04-15T09:03:43
129,147,051
0
0
null
null
null
null
UTF-8
Java
false
false
469
java
package com.lei.security.configuration; /** * @author chandu * */ public enum UserRolesType { /*USER("USER"), DBA("DBA"), ADMIN("ADMIN"); */ CUSTOMER("CUST"), MANAGER("MGR"), SYSADMIN("SYSADM"), DATAADMIN("DTADM"), DATAANALYST("DTANY"), QAANALYST("QAANY"); String userProfileType; private UserRolesType(String userProfileType){ this.userProfileType = userProfileType; } public String getUserProfileType(){ return userProfileType; } }
[ "chandrakant1825@gmail.com" ]
chandrakant1825@gmail.com
50af0b1a59eed10879df84eebd2c29079c3ec29f
db2149edfd52f6b9fef4372eb9c381bd06d3ea53
/fuelservice/src/test/java/biz/suckow/fuelservice/business/consumption/control/FuelConsumptionCalculatorTest.java
9adc9120e2cfecdc80ab6ea7a7942748de0ee5f4
[ "Apache-2.0" ]
permissive
suckowbiz/fuel
56985900a05fd39f7b2d39740b01cf155b38c6a3
7929d3a7cd46f928cfab7f7a9a4f9480485a40ac
refs/heads/master
2023-06-29T03:38:58.672183
2015-10-21T17:18:47
2015-10-21T17:18:47
29,754,864
1
1
null
null
null
null
UTF-8
Java
false
false
7,552
java
package biz.suckow.fuelservice.business.consumption.control; /* * #%L * fuel * %% * Copyright (C) 2014 Suckow.biz * %% * 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. * #L% */ import biz.suckow.fuelservice.business.TestHelper; import biz.suckow.fuelservice.business.owner.entity.Owner; import biz.suckow.fuelservice.business.refuelling.boundary.RefuellingStore; import biz.suckow.fuelservice.business.refuelling.entity.Refuelling; import biz.suckow.fuelservice.business.refuelling.entity.StockAddition; import biz.suckow.fuelservice.business.refuelling.entity.StockRelease; import biz.suckow.fuelservice.business.vehicle.entity.Vehicle; import org.easymock.EasyMockSupport; import org.easymock.Mock; import org.easymock.MockType; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import javax.persistence.EntityManager; import java.math.BigDecimal; import java.util.Arrays; import java.util.Collections; import java.util.Date; import java.util.Optional; import java.util.logging.Logger; import static org.assertj.core.api.Assertions.assertThat; import static org.easymock.EasyMock.anyObject; import static org.easymock.EasyMock.expect; public class FuelConsumptionCalculatorTest extends EasyMockSupport { @Mock private RefuellingStore refuellingStoreMock; @Mock private FuelStockLocator fuelStockLocatorMock; @Mock(type = MockType.NICE) private EntityManager emMock; @BeforeClass public void BeforeClass() { injectMocks(this); } @Test(expectedExceptions = IllegalArgumentException.class) public void nonFillUpMustFail() { final Refuelling refuelling = new Refuelling.Builder().kilometre(100L).litres(10D).dateRefueled(new Date()) .fillUp(false).build(); new FuelConsumptionCalculator(this.refuellingStoreMock, this.fuelStockLocatorMock, Logger.getAnonymousLogger()) .computeConsumption(refuelling); } @Test public void mustNotComputeWithoutPredecessor() { this.resetAll(); expect(this.refuellingStoreMock.getFillUpBefore(anyObject(Date.class))).andStubReturn( Optional.<Refuelling>empty()); this.replayAll(); final Refuelling refuelling = new Refuelling.Builder().kilometre(100L).litres(10D).dateRefueled(new Date()) .fillUp(true).build(); final Optional<BigDecimal> actualResult = new FuelConsumptionCalculator(this.refuellingStoreMock, this.fuelStockLocatorMock, Logger.getAnonymousLogger()).computeConsumption(refuelling); assertThat(actualResult.isPresent()).isFalse(); } @Test(description = "Simple case of refuelling and consuming this refuelling.") public void simpleComputationMustSucceed() { final Date january = TestHelper.getMonth(0); final Date february = TestHelper.getMonth(1); final Owner duke = TestHelper.createDuke(); final Vehicle vehicle = TestHelper.createDukeCar(duke); final Refuelling refuellingBefore = new Refuelling.Builder().kilometre(100L).litres(10D).dateRefueled(january) .fillUp(true).build(); final Refuelling refuelling = new Refuelling.Builder().kilometre(200L).litres(10D).dateRefueled(february) .fillUp(true).vehicle(vehicle).build(); this.resetAll(); expect(this.refuellingStoreMock.getFillUpBefore(february)).andStubReturn(Optional.of(refuellingBefore)); expect(this.fuelStockLocatorMock.getAdditionsBetween(january, february, vehicle)).andStubReturn( Collections.emptyList()); expect(this.refuellingStoreMock.getPartialRefuellingsBetween(january, february, vehicle)).andStubReturn( Collections.emptyList()); expect(this.fuelStockLocatorMock.getReleasesBetween(january, february, vehicle)).andStubReturn( Collections.emptyList()); this.replayAll(); final Optional<BigDecimal> actualResult = new FuelConsumptionCalculator(this.refuellingStoreMock, this.fuelStockLocatorMock, Logger.getAnonymousLogger()).computeConsumption(refuelling); assertThat(actualResult.isPresent()); assertThat(actualResult.get().doubleValue()).isEqualTo(10D / 100D); this.verifyAll(); } @SuppressWarnings("serial") @Test(description = "Have a refuelling with consideration of stock and consumption of this refuelling and stock.") public void complexRefuelingMustSucceed() { final Date january = TestHelper.getMonth(0); final Date february = TestHelper.getMonth(1); final Date march = TestHelper.getMonth(2); final Date april = TestHelper.getMonth(3); final Owner duke = TestHelper.createDuke(); final Vehicle vehicle = TestHelper.createDukeCar(duke); final double litresPartiallyRefueled = 20D; final double litresFilledUp = 40D; final double litresToStock = 5D; final double litresFromStock = 5D; final long kilometresLastFillUp = 100L; final long kilometresFilledUp = 1100L; final double expectedConsumption = (litresFilledUp + litresPartiallyRefueled + litresToStock - litresFromStock) / (kilometresFilledUp - kilometresLastFillUp); final Refuelling partialRefuelling = new Refuelling.Builder().litres(litresPartiallyRefueled) .dateRefueled(march) .fillUp(false).build(); final Refuelling refuellingBefore = new Refuelling.Builder().kilometre(kilometresLastFillUp) .litres(litresFilledUp).dateRefueled(january).fillUp(true).build(); final Refuelling refuelling = new Refuelling.Builder().kilometre(kilometresFilledUp).litres(litresFilledUp) .dateRefueled(april).fillUp(true).vehicle(vehicle).build(); final StockAddition addition = new StockAddition().setDateAdded(february).setLitres(litresToStock); final StockRelease release = new StockRelease().setDateReleased(march).setLitres(litresFromStock); this.resetAll(); expect(this.refuellingStoreMock.getFillUpBefore(april)).andStubReturn(Optional.of(refuellingBefore)); expect(this.fuelStockLocatorMock.getAdditionsBetween(january, april, vehicle)).andStubReturn( Arrays.asList(addition)); expect(this.refuellingStoreMock.getPartialRefuellingsBetween(january, april, vehicle)).andStubReturn( Arrays.asList(partialRefuelling)); expect(this.fuelStockLocatorMock.getReleasesBetween(january, april, vehicle)).andStubReturn( Arrays.asList(release)); this.replayAll(); final Optional<BigDecimal> actualResult = new FuelConsumptionCalculator(this.refuellingStoreMock, this.fuelStockLocatorMock, Logger.getAnonymousLogger()).computeConsumption(refuelling); assertThat(actualResult.isPresent()); assertThat(actualResult.get().doubleValue()).isEqualTo(expectedConsumption); this.verifyAll(); } }
[ "tobias@suckow.biz" ]
tobias@suckow.biz
39f5db0d4cdb5ae37af45cdc50436d1d8ebc180e
03b30728d16e263a4a74671c9a1134e0616936cb
/jena/areks_testlab/_GLOBAL/deDE.java
2cb27b36de677c15b85226323da4ce3ca6d7ad66
[]
no_license
VRage/intpro
a2a68f8e337eae391e1e234b4415b03089405b55
4de587fb7085f806ea077913baeea6ea57c6b528
refs/heads/master
2016-09-10T14:30:10.459910
2014-10-26T18:30:36
2014-10-26T18:30:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
255
java
package _GLOBAL; public class deDE extends Language{ public deDE(){ ERROR_NOPAGEDIR = "Es Wurde kein page directory Pfad festgelegt!"; CONNECTFUSEKIBUTTONCONNECT = "verbinden"; CONNECTFUSEKIBUTTONDISCONNECT = "beenden"; } }
[ "Administrator@C3PO" ]
Administrator@C3PO
8c67091daa3798bb183cceb5683e6749a286ea22
a56ff3160d648cc12286d75e0339977335b37b88
/Lunchy/src/com/tu/lunchy/util/AccountType.java
3f974eb9a3d5222f88e739741e6da9a5d8a184d8
[]
no_license
desso919/lunchy
4141f413ce9c71050071841d8fb31f64db685f94
b622ac8bc7657e0104fc269c5242b67745913579
refs/heads/master
2022-06-27T08:30:25.540715
2019-07-21T12:15:52
2019-07-21T12:15:52
116,573,087
0
0
null
2022-06-20T22:56:50
2018-01-07T14:42:41
JavaScript
UTF-8
Java
false
false
110
java
package com.tu.lunchy.util; public enum AccountType { ADMINISTRATOR, RESTAURANT_WORKER, CLIENT, UNKNOWN }
[ "desso430@gmail.com" ]
desso430@gmail.com
db95d82deadaf828a58115d7f28d12dc16f02bc8
af1d7dca2619f893378b92a962cd6e004b06d67a
/Games/src/at/mis/games/wintergame/actors/Snowflake.java
321966f1bff61521a3eb870a9098384f6593ca44
[]
no_license
niklasmischi/desginpatterns
7d70f76a7ecca58acb8be56430eb381fec5f9ba5
2ae9f0b1a78b9d2a65a6db3824a51fc844602756
refs/heads/master
2022-12-21T01:31:09.193347
2020-09-25T09:54:12
2020-09-25T09:54:12
296,567,743
0
0
null
null
null
null
UTF-8
Java
false
false
943
java
package at.mis.games.wintergame.actors; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; public class Snowflake implements Actor{ private double x; private double y; private int height; private int width; private int random; private int random2; private double speed; public Snowflake(int height, int width, double speed) { super(); this.random = (int)(Math.random() * 800 + 1); this.random2 = (int)(-(Math.random() * 800 + 1)); this.x = 0 + random; this.y = 0 + random2; this.height = height; this.width = width; this.speed = speed; } public void update(int delta) { this.y = this.y + 1 * this.speed; if (this.y == 800) { this.y = 0; } } public void render(Graphics graphics) { graphics.fillOval((int)this.x, (int)this.y, this.height, this.width); } @Override public void update(GameContainer gc, int delta) { // TODO Auto-generated method stub } }
[ "niklas.mischi@gmail.com" ]
niklas.mischi@gmail.com
b3fe0f88a46e86722c15e1905d04f735461d68f2
7a4915ea7f8cd2e2d6ffa4243f81108263b8e884
/Business Logic/src/Models/Scheduling/Comment.java
fe3e75ffcc155ddcb87628376539903edcb09e84
[]
no_license
sonianara/ThinkInc
3473485d8809ee675d0b8f73cbf0529dfd48a7aa
7ccb32dbfff99658cafdcc0b5fc0071d4a0b1932
refs/heads/master
2021-01-11T14:50:55.469866
2017-02-27T18:02:37
2017-02-27T18:02:37
80,231,383
0
1
null
null
null
null
UTF-8
Java
false
false
93
java
package Models.Scheduling; /** * Created by Kris on 2/3/2017. */ public class Comment { }
[ "kcampos0101@gmail.com" ]
kcampos0101@gmail.com
863ce1add7450b8782e72102e62c0d62ea6c0c9b
397c899e18d26c5c12df07eab4d27f4125915c4a
/video-api/src/main/java/top/yinjinbiao/video/common/enums/ChatMsgSignEnum.java
78fdf807baf4e05b7ec69dbb3bd08a1589d395e0
[ "Apache-2.0" ]
permissive
JinbiaoYin/video
a18f29530632990d14a50c3f384ca00e04355a20
925e504517e7fea6cbafc236b45c0d3a27b8e88b
refs/heads/master
2022-07-15T10:01:48.062568
2021-03-28T05:54:02
2021-03-28T05:54:02
245,750,916
0
1
Apache-2.0
2020-03-20T07:03:30
2020-03-08T04:21:17
JavaScript
UTF-8
Java
false
false
340
java
package top.yinjinbiao.video.common.enums; /** * chat模块中的是否签收字段 * @author yin.jinbiao * */ public enum ChatMsgSignEnum { UNSIGN(false),SIGN(true); private final Boolean value; ChatMsgSignEnum(Boolean value) { this.value = value; } public Boolean value(){ return value; } }
[ "731509863@qq.com" ]
731509863@qq.com
513327d7c56647199be1951e8522e24231616c40
eca963fa3b666daea5537b2768a8b7881d41f442
/haxby/image/jcodec/containers/mps/MTSUtils.java
556fb7c33ae61a971edcd1c0ec2a51c8e98fa560
[ "Apache-2.0" ]
permissive
iedadata/geomapapp
1bee9fcbb686b9a932c467cb6d1e4511277d6a46
5368b21c425ff188a125939877f1db1eefb7ed9b
refs/heads/master
2023-08-17T08:47:13.342087
2023-08-15T20:20:25
2023-08-15T20:20:25
98,096,914
1
3
Apache-2.0
2023-08-15T20:20:27
2017-07-23T12:38:27
Java
UTF-8
Java
false
false
6,572
java
package haxby.image.jcodec.containers.mps; import static haxby.image.jcodec.common.Preconditions.checkState; import static haxby.image.jcodec.common.io.NIOUtils.getRel; import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; import haxby.image.jcodec.common.IntArrayList; import haxby.image.jcodec.common.io.NIOUtils; import haxby.image.jcodec.common.io.SeekableByteChannel; import haxby.image.jcodec.containers.mps.psi.PATSection; import haxby.image.jcodec.containers.mps.psi.PMTSection; import haxby.image.jcodec.containers.mps.psi.PSISection; import haxby.image.jcodec.containers.mps.psi.PMTSection.PMTStream; /** * This class is part of JCodec ( www.jcodec.org ) This software is distributed * under FreeBSD License * * @author The JCodec project * */ public class MTSUtils { /** * Parses PAT ( Program Association Table ) * * @param data * @deprecated Use org.jcodec.containers.mps.psi.PAT.parse method instead, * this method will not work correctly for streams with multiple * programs * @return Pid of the first PMT found in the PAT */ @Deprecated public static int parsePAT(ByteBuffer data) { PATSection pat = PATSection.parsePAT(data); if (pat.getPrograms().size() > 0) return pat.getPrograms().values()[0]; else return -1; } @Deprecated public static PMTSection parsePMT(ByteBuffer data) { return PMTSection.parsePMT(data); } @Deprecated public static PSISection parseSection(ByteBuffer data) { return PSISection.parsePSI(data); } private static void parseEsInfo(ByteBuffer read) { } public static PMTStream[] getProgramGuids(File src) throws IOException { SeekableByteChannel ch = null; try { ch = NIOUtils.readableChannel(src); return getProgramGuidsFromChannel(ch); } finally { NIOUtils.closeQuietly(ch); } } public static PMTStream[] getProgramGuidsFromChannel(SeekableByteChannel _in) throws IOException { PMTExtractor ex = new PMTExtractor(); ex.readTsFile(_in); PMTSection pmt = ex.getPmt(); return pmt.getStreams(); } private static class PMTExtractor extends TSReader { public PMTExtractor() { super(false); } private int pmtGuid = -1; private PMTSection pmt; @Override public boolean onPkt(int guid, boolean payloadStart, ByteBuffer tsBuf, long filePos, boolean sectionSyntax, ByteBuffer fullPkt) { if (guid == 0) { pmtGuid = parsePAT(tsBuf); } else if (pmtGuid != -1 && guid == pmtGuid) { pmt = parsePMT(tsBuf); return false; } return true; } public PMTSection getPmt() { return pmt; } }; public static abstract class TSReader { private static final int TS_SYNC_MARKER = 0x47; private static final int TS_PKT_SIZE = 188; // Buffer must have an integral number of MPEG TS packets public static final int BUFFER_SIZE = TS_PKT_SIZE << 9; private boolean flush; public TSReader(boolean flush) { this.flush = flush; } public void readTsFile(SeekableByteChannel ch) throws IOException { ch.setPosition(0); ByteBuffer buf = ByteBuffer.allocate(BUFFER_SIZE); for (long pos = ch.position(); ch.read(buf) >= TS_PKT_SIZE; pos = ch.position()) { long posRem = pos; buf.flip(); while (buf.remaining() >= TS_PKT_SIZE) { ByteBuffer tsBuf = NIOUtils.read(buf, TS_PKT_SIZE); ByteBuffer fullPkt = tsBuf.duplicate(); pos += TS_PKT_SIZE; checkState(TS_SYNC_MARKER == (tsBuf.get() & 0xff)); int guidFlags = ((tsBuf.get() & 0xff) << 8) | (tsBuf.get() & 0xff); int guid = (int) guidFlags & 0x1fff; int payloadStart = (guidFlags >> 14) & 0x1; int b0 = tsBuf.get() & 0xff; int counter = b0 & 0xf; if ((b0 & 0x20) != 0) { NIOUtils.skip(tsBuf, tsBuf.get() & 0xff); } boolean sectionSyntax = payloadStart == 1 && (getRel(tsBuf, getRel(tsBuf, 0) + 2) & 0x80) == 0x80; if (sectionSyntax) { // Adaptation field NIOUtils.skip(tsBuf, tsBuf.get() & 0xff); } if (!onPkt(guid, payloadStart == 1, tsBuf, pos - tsBuf.remaining(), sectionSyntax, fullPkt)) return; } if (flush) { buf.flip(); ch.setPosition(posRem); ch.write(buf); } buf.clear(); } } protected boolean onPkt(int guid, boolean payloadStart, ByteBuffer tsBuf, long filePos, boolean sectionSyntax, ByteBuffer fullPkt) { // DO NOTHING return true; } } public static int getVideoPid(File src) throws IOException { for (PMTStream stream : MTSUtils.getProgramGuids(src)) { if (stream.getStreamType().isVideo()) return stream.getPid(); } throw new RuntimeException("No video stream"); } public static int getAudioPid(File src) throws IOException { for (PMTStream stream : MTSUtils.getProgramGuids(src)) { if (stream.getStreamType().isAudio()) return stream.getPid(); } throw new RuntimeException("No audio stream"); } public static int[] getMediaPidsFromChannel(SeekableByteChannel src) throws IOException { return filterMediaPids(MTSUtils.getProgramGuidsFromChannel(src)); } public static int[] getMediaPids(File src) throws IOException { return filterMediaPids(MTSUtils.getProgramGuids(src)); } private static int[] filterMediaPids(PMTStream[] programs) { IntArrayList result = IntArrayList.createIntArrayList(); for (PMTStream stream : programs) { if (stream.getStreamType().isVideo() || stream.getStreamType().isAudio()) result.add(stream.getPid()); } return result.toArray(); } }
[ "shanen314@gmail.com" ]
shanen314@gmail.com
2d68d788b57ecdc697342e457632f00cb1a60af4
44bbb37c7ea5f638bae7f8c4f0663b1734fb9b01
/src/main/java/Weather.java
aea79a90c7ec6497bd329bf1e033567f83600597
[]
no_license
mi100/weatherBot
01a844bc5d08c0571b64b411076509e4294104db
1a493606e7865d61f5ca201f3073a91a93507b2f
refs/heads/master
2023-02-18T06:08:21.907779
2021-01-18T22:23:27
2021-01-18T22:23:27
330,800,981
0
0
null
null
null
null
UTF-8
Java
false
false
1,785
java
import org.json.JSONArray; import org.json.JSONObject; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.util.Scanner; public class Weather { public static String getWeather(String message, Model model) throws IOException { URL url = new URL("https://api.openweathermap.org/data/2.5/weather?q=" + message + "&units=metric&appid=6d234f428279e60b405fc4ab0b1f5e3c"); Scanner in = new Scanner((InputStream) url.getContent()); String result = ""; while (in.hasNext()){ result += in.nextLine(); } JSONObject object = new JSONObject(result); model.setName(object.getString("name")); JSONObject main = object.getJSONObject("main"); model.setTemp(main.getDouble("temp")); model.setHumidity(main.getDouble("humidity")); model.setPressure(main.getDouble("pressure")); JSONArray getArray = object.getJSONArray("weather"); for (int i = 0; i < getArray.length(); i++) { JSONObject obj = getArray.getJSONObject(i); model.setIcon(obj.getString("icon")); model.setMain(obj.getString("main")); } JSONObject wind = object.getJSONObject("wind"); model.setSpeed(wind.getDouble("speed")); return "City: " + model.getName() + "\n" + "Temperature " + model.getTemp() + "C" + "\n" + "Humidity " + model.getHumidity() + "%" + "\n" + "Pressure " + model.getPressure() + "mm" + "\n" + "Main " + model.getMain() + "\n" + "Speed " + model.getSpeed() + "m/s" + "\n" + "http://openweathermap.org/img/w/" + model.getIcon() + ".png" + "\n"; } }
[ "vulf999@cmail.com" ]
vulf999@cmail.com
236a382f69867d69761be0d3b69f2ce34c15cc7c
ce3298580f723c8f7a9318455b87ef2725552dd8
/sources/android/support/v7/widget/GapWorker.java
b20ef52e6ec23b591d993a3cc98e6a6d94360e92
[]
no_license
okandonmez/Android_UdentifyApp
6d3d22cf2688edf5fc93cca4755900b7c761b561
b39b665c8fd44b770d6691f7d4ed8f864a85efb8
refs/heads/master
2020-04-13T19:27:03.322914
2018-12-28T11:30:41
2018-12-28T11:30:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
12,555
java
package android.support.v7.widget; import android.support.annotation.Nullable; import android.support.v4.os.TraceCompat; import android.support.v7.widget.RecyclerView.LayoutManager; import android.support.v7.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry; import android.support.v7.widget.RecyclerView.Recycler; import android.support.v7.widget.RecyclerView.ViewHolder; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.concurrent.TimeUnit; final class GapWorker implements Runnable { static final ThreadLocal<GapWorker> sGapWorker = new ThreadLocal(); static Comparator<Task> sTaskComparator = new C02721(); long mFrameIntervalNs; long mPostTimeNs; ArrayList<RecyclerView> mRecyclerViews = new ArrayList(); private ArrayList<Task> mTasks = new ArrayList(); /* renamed from: android.support.v7.widget.GapWorker$1 */ static class C02721 implements Comparator<Task> { C02721() { } public int compare(Task lhs, Task rhs) { int i = -1; if ((lhs.view == null ? 1 : 0) != (rhs.view == null ? 1 : 0)) { return lhs.view == null ? 1 : -1; } else { if (lhs.immediate != rhs.immediate) { if (!lhs.immediate) { i = 1; } return i; } int deltaViewVelocity = rhs.viewVelocity - lhs.viewVelocity; if (deltaViewVelocity != 0) { return deltaViewVelocity; } int deltaDistanceToItem = lhs.distanceToItem - rhs.distanceToItem; return deltaDistanceToItem != 0 ? deltaDistanceToItem : 0; } } } static class Task { public int distanceToItem; public boolean immediate; public int position; public RecyclerView view; public int viewVelocity; Task() { } public void clear() { this.immediate = false; this.viewVelocity = 0; this.distanceToItem = 0; this.view = null; this.position = 0; } } static class LayoutPrefetchRegistryImpl implements LayoutPrefetchRegistry { int mCount; int[] mPrefetchArray; int mPrefetchDx; int mPrefetchDy; LayoutPrefetchRegistryImpl() { } void setPrefetchVector(int dx, int dy) { this.mPrefetchDx = dx; this.mPrefetchDy = dy; } void collectPrefetchPositionsFromView(RecyclerView view, boolean nested) { this.mCount = 0; if (this.mPrefetchArray != null) { Arrays.fill(this.mPrefetchArray, -1); } LayoutManager layout = view.mLayout; if (view.mAdapter != null && layout != null && layout.isItemPrefetchEnabled()) { if (nested) { if (!view.mAdapterHelper.hasPendingUpdates()) { layout.collectInitialPrefetchPositions(view.mAdapter.getItemCount(), this); } } else if (!view.hasPendingAdapterUpdates()) { layout.collectAdjacentPrefetchPositions(this.mPrefetchDx, this.mPrefetchDy, view.mState, this); } if (this.mCount > layout.mPrefetchMaxCountObserved) { layout.mPrefetchMaxCountObserved = this.mCount; layout.mPrefetchMaxObservedInInitialPrefetch = nested; view.mRecycler.updateViewCacheSize(); } } } public void addPosition(int layoutPosition, int pixelDistance) { if (layoutPosition < 0) { throw new IllegalArgumentException("Layout positions must be non-negative"); } else if (pixelDistance < 0) { throw new IllegalArgumentException("Pixel distance must be non-negative"); } else { int storagePosition = this.mCount * 2; if (this.mPrefetchArray == null) { this.mPrefetchArray = new int[4]; Arrays.fill(this.mPrefetchArray, -1); } else if (storagePosition >= this.mPrefetchArray.length) { int[] oldArray = this.mPrefetchArray; this.mPrefetchArray = new int[(storagePosition * 2)]; System.arraycopy(oldArray, 0, this.mPrefetchArray, 0, oldArray.length); } this.mPrefetchArray[storagePosition] = layoutPosition; this.mPrefetchArray[storagePosition + 1] = pixelDistance; this.mCount++; } } boolean lastPrefetchIncludedPosition(int position) { if (this.mPrefetchArray != null) { int count = this.mCount * 2; for (int i = 0; i < count; i += 2) { if (this.mPrefetchArray[i] == position) { return true; } } } return false; } void clearPrefetchPositions() { if (this.mPrefetchArray != null) { Arrays.fill(this.mPrefetchArray, -1); } this.mCount = 0; } } GapWorker() { } public void add(RecyclerView recyclerView) { this.mRecyclerViews.add(recyclerView); } public void remove(RecyclerView recyclerView) { boolean removeSuccess = this.mRecyclerViews.remove(recyclerView); } void postFromTraversal(RecyclerView recyclerView, int prefetchDx, int prefetchDy) { if (recyclerView.isAttachedToWindow() && this.mPostTimeNs == 0) { this.mPostTimeNs = recyclerView.getNanoTime(); recyclerView.post(this); } recyclerView.mPrefetchRegistry.setPrefetchVector(prefetchDx, prefetchDy); } private void buildTaskList() { int i; int viewCount = this.mRecyclerViews.size(); int totalTaskCount = 0; for (i = 0; i < viewCount; i++) { RecyclerView view = (RecyclerView) this.mRecyclerViews.get(i); if (view.getWindowVisibility() == 0) { view.mPrefetchRegistry.collectPrefetchPositionsFromView(view, false); totalTaskCount += view.mPrefetchRegistry.mCount; } } this.mTasks.ensureCapacity(totalTaskCount); int totalTaskIndex = 0; for (i = 0; i < viewCount; i++) { view = (RecyclerView) this.mRecyclerViews.get(i); if (view.getWindowVisibility() == 0) { LayoutPrefetchRegistryImpl prefetchRegistry = view.mPrefetchRegistry; int viewVelocity = Math.abs(prefetchRegistry.mPrefetchDx) + Math.abs(prefetchRegistry.mPrefetchDy); for (int j = 0; j < prefetchRegistry.mCount * 2; j += 2) { Task task; boolean z; if (totalTaskIndex >= this.mTasks.size()) { task = new Task(); this.mTasks.add(task); } else { task = (Task) this.mTasks.get(totalTaskIndex); } int distanceToItem = prefetchRegistry.mPrefetchArray[j + 1]; if (distanceToItem <= viewVelocity) { z = true; } else { z = false; } task.immediate = z; task.viewVelocity = viewVelocity; task.distanceToItem = distanceToItem; task.view = view; task.position = prefetchRegistry.mPrefetchArray[j]; totalTaskIndex++; } } } Collections.sort(this.mTasks, sTaskComparator); } static boolean isPrefetchPositionAttached(RecyclerView view, int position) { int childCount = view.mChildHelper.getUnfilteredChildCount(); for (int i = 0; i < childCount; i++) { ViewHolder holder = RecyclerView.getChildViewHolderInt(view.mChildHelper.getUnfilteredChildAt(i)); if (holder.mPosition == position && !holder.isInvalid()) { return true; } } return false; } private ViewHolder prefetchPositionWithDeadline(RecyclerView view, int position, long deadlineNs) { if (isPrefetchPositionAttached(view, position)) { return null; } Recycler recycler = view.mRecycler; try { view.onEnterLayoutOrScroll(); ViewHolder holder = recycler.tryGetViewHolderForPositionByDeadline(position, false, deadlineNs); if (holder != null) { if (!holder.isBound() || holder.isInvalid()) { recycler.addViewHolderToRecycledViewPool(holder, false); } else { recycler.recycleView(holder.itemView); } } view.onExitLayoutOrScroll(false); return holder; } catch (Throwable th) { view.onExitLayoutOrScroll(false); } } private void prefetchInnerRecyclerViewWithDeadline(@Nullable RecyclerView innerView, long deadlineNs) { if (innerView != null) { if (innerView.mDataSetHasChangedAfterLayout && innerView.mChildHelper.getUnfilteredChildCount() != 0) { innerView.removeAndRecycleViews(); } LayoutPrefetchRegistryImpl innerPrefetchRegistry = innerView.mPrefetchRegistry; innerPrefetchRegistry.collectPrefetchPositionsFromView(innerView, true); if (innerPrefetchRegistry.mCount != 0) { try { TraceCompat.beginSection("RV Nested Prefetch"); innerView.mState.prepareForNestedPrefetch(innerView.mAdapter); for (int i = 0; i < innerPrefetchRegistry.mCount * 2; i += 2) { prefetchPositionWithDeadline(innerView, innerPrefetchRegistry.mPrefetchArray[i], deadlineNs); } } finally { TraceCompat.endSection(); } } } } private void flushTaskWithDeadline(Task task, long deadlineNs) { long taskDeadlineNs; if (task.immediate) { taskDeadlineNs = Long.MAX_VALUE; } else { taskDeadlineNs = deadlineNs; } ViewHolder holder = prefetchPositionWithDeadline(task.view, task.position, taskDeadlineNs); if (holder != null && holder.mNestedRecyclerView != null && holder.isBound() && !holder.isInvalid()) { prefetchInnerRecyclerViewWithDeadline((RecyclerView) holder.mNestedRecyclerView.get(), deadlineNs); } } private void flushTasksWithDeadline(long deadlineNs) { int i = 0; while (i < this.mTasks.size()) { Task task = (Task) this.mTasks.get(i); if (task.view != null) { flushTaskWithDeadline(task, deadlineNs); task.clear(); i++; } else { return; } } } void prefetch(long deadlineNs) { buildTaskList(); flushTasksWithDeadline(deadlineNs); } public void run() { try { TraceCompat.beginSection("RV Prefetch"); if (!this.mRecyclerViews.isEmpty()) { int size = this.mRecyclerViews.size(); long latestFrameVsyncMs = 0; for (int i = 0; i < size; i++) { RecyclerView view = (RecyclerView) this.mRecyclerViews.get(i); if (view.getWindowVisibility() == 0) { latestFrameVsyncMs = Math.max(view.getDrawingTime(), latestFrameVsyncMs); } } if (latestFrameVsyncMs == 0) { this.mPostTimeNs = 0; TraceCompat.endSection(); return; } prefetch(TimeUnit.MILLISECONDS.toNanos(latestFrameVsyncMs) + this.mFrameIntervalNs); this.mPostTimeNs = 0; TraceCompat.endSection(); } } finally { this.mPostTimeNs = 0; TraceCompat.endSection(); } } }
[ "ce.okandonmez@gmail.com" ]
ce.okandonmez@gmail.com
e7252b3911f47a3451101485f5c35553bc010b79
0a88d2d7f49f25df93137793fec1e335916e363b
/src/main/java/docker/api/service/Service.java
08fcf358d9aaa227c32d5531c1eb627e84e18ce2
[]
no_license
traviskosarek/docker-stack-api
0526cde91a579dac91107799a58cd74bd1f3475f
0dfb488b1731c5e6e51b48f69fe6332cf0cdb9d9
refs/heads/master
2021-05-02T15:28:57.950091
2017-12-15T01:03:06
2017-12-15T01:03:06
120,696,409
0
0
null
null
null
null
UTF-8
Java
false
false
2,065
java
package docker.api.service; public class Service { private final String id; private ServiceMode mode; private int runningReplicas; private int totalReplicas; private final String image; public Service(String[] tokens) { if (tokens.length == 4) { this.id = tokens[0]; this.mode = this.parseServiceMode(tokens[1]); this.runningReplicas = this.parseRunningReplicas(tokens[2]); this.totalReplicas = this.parseTotalReplicas(tokens[2]); this.image = tokens[3]; } else { this.id = ""; this.mode = ServiceMode.Unknown; this.runningReplicas = 0; this.totalReplicas = 0; this.image = ""; } } public String getId() { return this.id; } public String getImage() { return this.image; } public ServiceMode getMode() { return this.mode; } public int getRunningReplicas() { return this.runningReplicas; } public int getTotalReplicas() { return this.totalReplicas; } private ServiceMode parseServiceMode(String mode) { try { ServiceMode serviceMode = ServiceMode.valueOf(mode); return serviceMode; } catch (Exception e) { return ServiceMode.Unknown; } } private int parseRunningReplicas(String replicas) { String[] tokens = replicas.split("/"); if (tokens.length == 2 && this.stringIsInteger(tokens[0])) { return Integer.parseInt(tokens[0]); } return 0; } private int parseTotalReplicas(String replicas) { String[] tokens = replicas.split("/"); if (tokens.length == 2 && this.stringIsInteger(tokens[1])) { return Integer.parseInt(tokens[1]); } return 0; } private Boolean stringIsInteger(String s) { try { Integer.parseInt(s); } catch (Exception e) { return false; } return true; } }
[ "travis.kosarek@gmail.com" ]
travis.kosarek@gmail.com
37dee3001ab1d56c259d46a4bc3876935c9c6626
40cb0c25786790e448e76650c4213f5c9314bbe6
/src/main/java/beans/Authentification.java
9a9d28b11e83dba5826469ac6b63f510166c5d06
[]
no_license
souhailAL/tp3
bbb50af1721b548b50e86ad3cdc73bb79c2087b3
ea22d8baf6e31163f22b3ba67ae308b37abcae4f
refs/heads/master
2023-04-15T19:00:17.488795
2021-04-22T18:57:23
2021-04-22T18:57:23
360,652,226
0
0
null
null
null
null
UTF-8
Java
false
false
583
java
package beans; public class Authentification { private String login; private String password; public Authentification(){ setLogin(""); setPassword(""); } public boolean Valide(){ boolean validation=false; if ((getLogin().equals("USER1"))&&(getPassword().equals("PASS1"))){ validation=true; } return validation; } public String getLogin() { return login; } public void setLogin(String login) { this.login = login; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
[ "souhail@DESKTOP-9JJVBNH" ]
souhail@DESKTOP-9JJVBNH
bbb6447e9cab8df96233b9ac5ae455d6912177d8
b79e0278c734fe89d7b8ae157d23b65c9865c8d1
/lec5/src/adammar/MyString.java
f176852fee7a8abbf0cbb4e918d3adba1745629c
[]
no_license
piratte/Java
4f08a1906139310de266651792e11818456c9544
fff8980af5d9680b052f131e1db84ee678afd3de
refs/heads/master
2016-09-06T12:21:48.821754
2015-01-07T16:22:15
2015-01-07T16:22:15
27,225,830
0
0
null
null
null
null
UTF-8
Java
false
false
1,886
java
package src.adammar; import java.util.Iterator; import java.util.Arrays; public class MyString implements Iterable<Character>{ private char[] data; private int size; private final int defSize = 4; private void enoughCap(int wanted) { int cap = data.length; if (wanted > cap) { int newcap = cap + (wanted - cap) * 2; data = Arrays.copyOf(data, newcap); } } private void rangeCheck(int ind) { if((ind >= size) || (size == 0)) throw new IndexOutOfBoundsException("Index: " + ind + ", Size: " + size); } MyString() { data = new char[defSize]; size = 0; } MyString(String s) { int len = s.length(); data = new char[len]; for (int i=0; i < len ; i++ ) { data[i] = s.charAt(i); } size = len; } void append(String s) { int addition = s.length(); enoughCap(size + addition); for (int i=0; i < addition ; i++ ) { data[size+i] = s.charAt(i); } size += addition; } void append(char ch) { enoughCap(size++); data[size-1] = ch; } void insert(int pos, String s) { rangeCheck(pos); int addition = s.length(); enoughCap(size + addition); for (int i=size-1; i>pos ; i--) { data[i+addition] = data[i]; } for (int i=0; i<addition ; i++) { data[pos+i] = s.charAt(i); } size += addition; } void insert(int pos, char ch) { rangeCheck(pos); enoughCap(size++); for (int i=size-1; i>pos ; i--) { data[i+1] = data[i]; } data[pos] = ch; size += 1; } void delete(int pos, int len) { rangeCheck(pos); size -= len; } public String toString() { return size == 0 ? new String() : new String(data); } public Iterator<Character> iterator() { return new Iterator<Character>() { private int index = 0; public boolean hasNext() { return index < size; } public Character next() { rangeCheck(index); return data[index++]; } public void remove() {} }; } }
[ "piratte65@gmail.com" ]
piratte65@gmail.com
b98a2b064040aeaf4988381cd79cdb559a19b56f
5765c87fd41493dff2fde2a68f9dccc04c1ad2bd
/Variant Programs/5-2/18/ScottyPerformancesLog.java
e4a6c11cc75d34767ca5d5ba4e59b7f68764e11a
[ "MIT" ]
permissive
hjc851/Dataset2-HowToDetectAdvancedSourceCodePlagiarism
42e4c2061c3f8da0dfce760e168bb9715063645f
a42ced1d5a92963207e3565860cac0946312e1b3
refs/heads/master
2020-08-09T08:10:08.888384
2019-11-25T01:14:23
2019-11-25T01:14:23
214,041,532
0
0
null
null
null
null
UTF-8
Java
false
false
7,466
java
import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.util.Random; import java.util.logging.Logger; public class ScottyPerformancesLog extends javax.servlet.http.HttpServlet { private Posterior[] investRaft; private java.lang.String ranked; private int rearAmount; private int buns; private java.lang.String operatorSecurity; private java.lang.String mobile; private java.lang.String destination; private java.lang.String post; private static java.util.logging.Logger consignor = java.util.logging.Logger.getLogger("bensTheatre"); public void doGet(HttpServletRequest appeal, HttpServletResponse reply) throws ServletException, IOException { java.io.PrintWriter prohibited = reply.getWriter(); ranked = appeal.getParameter("row"); buns = java.lang.Integer.parseInt(appeal.getParameter("seat")); rearAmount = java.lang.Integer.parseInt(appeal.getParameter("seatnumber")); investRaft = tellReadme(); java.lang.String venueFront = letRegistrationTab(); prohibited.println(venueFront); } public void doPost(HttpServletRequest wishes, HttpServletResponse responsive) throws ServletException, IOException { ranked = wishes.getParameter("row"); buns = java.lang.Integer.parseInt(wishes.getParameter("seat")); rearAmount = java.lang.Integer.parseInt(wishes.getParameter("seatnumber")); operatorSecurity = wishes.getParameter("userid"); destination = wishes.getParameter("address"); post = wishes.getParameter("email"); mobile = wishes.getParameter("phone"); investRaft = tellReadme(); int made = 0; for (Posterior ora : investRaft) { if (ora.goExploiterQuod() != null && ora.goExploiterQuod().equals(operatorSecurity)) { made++; } } if (made > 2) { responsive.sendRedirect("benstheatre?message=limitexceeded"); } else { investRaft[rearAmount].orderedPatientNerfling(operatorSecurity); investRaft[rearAmount].markAdress(destination); investRaft[rearAmount].dictatedEmailed(post); investRaft[rearAmount].markMobile(mobile); investRaft[rearAmount].arrangedSentence(IainAmphitheatre.catchRifeWhen()); investRaft[rearAmount].settledVisible(false); helpData(investRaft); responsive.sendRedirect("benstheatre?message=success"); } } public java.lang.String letRegistrationTab() { java.lang.String standards = firewallEncode(); java.lang.String metadata = ""; metadata += "<!DOCTYPE html>\n" + "<html lang=\"en\">\n" + " <head>\n" + " <meta charset=utf-8>\n" + " <title>Seat Booking</title>\n" + " <!--[if IE]>\n" + " <script src=\"http://html5shiv.googlecode.com/svn/trunk/html5.js\">\n" + " </script>\n" + " <![endif]-->\n" + " <link rel=\"stylesheet\" type=\"text/css\" href=\"css/style.css\">\n" + " </head>\n" + " <body class=\"booking\">\n" + " <header>\n" + " <a href=\"benstheatre\">HOME</a>\n" + " <h1>Seat Booking</h1>\n" + " </header>\n" + " <article>\n" + " <h2>Your Selection</h2>\n" + " <div class=\"selected\">\n" + " <p class=\"heading\">Selected Seat:</p>"; metadata += "<p class=\"option\">" + ranked + buns + "</p>"; metadata += "</div>\n" + " <div class=\"security\">\n" + " <p class=\"heading\">Security Code:</p>"; metadata += "<p class=\"option\" data-code=\"" + standards + "\">" + standards + "</p>"; metadata += "</div>\n" + "\n" + " <form method=\"post\" action=\"./booking\">\n" + " <input type=\"hidden\" name=\"seat\" value=\"" + buns + "\" />\n" + " <input type=\"hidden\" name=\"row\" value=\"" + ranked + "\" />\n" + " <input type=\"hidden\" name=\"seatnumber\" value=\"" + rearAmount + "\" />\n" + " <input type=\"text\" name=\"userid\" placeholder=\"UserID*\" />\n" + " <input type=\"text\" name=\"phone\" placeholder=\"Phone\" />\n" + " <input type=\"text\" name=\"address\" placeholder=\"Address\" />\n" + " <input type=\"text\" name=\"email\" placeholder=\"Email*\" />\n" + " <input type=\"text\" name=\"security\" placeholder=\"Security Code*\" />\n" + " <button type=\"reset\" value=\"Clear\" class=\"form-clear\">Clear</button>\n" + " <button type=\"submit\" value=\"Submit\" class=\"form-submit\">Submit</button>\n" + " </form>\n" + " </article>\n" + " <footer>\n" + " <div class=\"author\">\n" + " <p>&copy; Ben Sutter 2016</p>\n" + " <p>c3063467</p>\n" + " </div>\n" + " </footer>\n" + " <script src=\"js/jquery.min.js\"></script>\n" + " <script src=\"js/script.js\"></script>\n" + " </body>\t\n" + "</html>"; return metadata; } public java.lang.String firewallEncode() { java.lang.String cards[] = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; java.lang.String rates[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}; java.util.Random coincidental = new java.util.Random(); java.lang.String momenta, cc, betas, fgf, r6, u; momenta = cards[coincidental.nextInt(cards.length)]; cc = rates[coincidental.nextInt(rates.length)]; betas = cards[coincidental.nextInt(cards.length)]; fgf = rates[coincidental.nextInt(rates.length)]; r6 = cards[coincidental.nextInt(cards.length)]; u = rates[coincidental.nextInt(rates.length)]; return momenta + cc + betas + fgf + r6 + u; } public Posterior[] tellReadme() { try { Posterior[] votes; java.io.FileInputStream nsiPapers = new java.io.FileInputStream(getServletContext().getRealPath("/WEB-INF/bookingData.ser")); java.io.ObjectInputStream proponents = new java.io.ObjectInputStream(nsiPapers); votes = (Posterior[]) proponents.readObject(); proponents.close(); nsiPapers.close(); return votes; } catch (java.io.IOException i) { consignor.info(i.toString()); return null; } catch (java.lang.ClassNotFoundException cesium) { consignor.info(cesium.toString()); cesium.printStackTrace(); return null; } } public void helpData(Posterior[] member) { try { java.io.FileOutputStream prohibitedPapers = new java.io.FileOutputStream(getServletContext().getRealPath("/WEB-INF/bookingData.ser")); java.io.ObjectOutputStream back = new java.io.ObjectOutputStream(prohibitedPapers); back.writeObject(member); back.close(); prohibitedPapers.close(); } catch (java.io.IOException officio) { officio.printStackTrace(); } } }
[ "hayden.cheers@me.com" ]
hayden.cheers@me.com
0892d69b9fe23bdc9c778e0ad2bb12bbf36c86ed
a66cfacefc6348dd5d9f65396db7b6bf67cdfea5
/simple-rpc/src/main/java/com.study.simple.rpc/RpcClient.java
1c3cd335aaca0a5aad5a680319f5e9d60d1622ff
[]
no_license
LostLegend/RPC-study
70d899d523e370c7856d2901bdbf6a394102b542
f19ff6e23289a9ba3a8b236203af119ea427698b
refs/heads/master
2021-01-04T16:53:23.204331
2020-02-18T14:21:30
2020-02-18T14:21:30
240,644,143
1
0
null
null
null
null
UTF-8
Java
false
false
2,040
java
package com.study.simple.rpc; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.net.InetSocketAddress; import java.net.Socket; /** * @author : lost legend 2020.02.18 21:42 * @since V1.0 */ public class RpcClient<S> { public S invoker(final Class<?> serviceClass, final InetSocketAddress address) { return (S) Proxy.newProxyInstance(serviceClass.getClassLoader(), new Class<?>[]{serviceClass.getInterfaces()[0]}, new InvocationHandler() { @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Socket socket = null; ObjectOutputStream output = null; ObjectInputStream input = null; try { socket = new Socket(); socket.connect(address); output = new ObjectOutputStream(socket.getOutputStream()); output.writeUTF(serviceClass.getName()); output.writeUTF(method.getName()); output.writeObject(method.getParameterTypes()); output.writeObject(args); input = new ObjectInputStream(socket.getInputStream()); return input.readObject(); } finally { if (socket != null) { socket.close(); } if (input != null) { input.close(); } if (output != null) { output.close(); } } } }); } }
[ "forsakenzero@163.com" ]
forsakenzero@163.com
256fdd4dc8e17fa26edb9231d9e4892c008db1d2
1cd006a4cc590ec445c87e5e0b9b26f64c57ec29
/src/main/java/com/example/cisco/assignment/entity/UserInfo.java
9bbd4b83b231fcf61d3937406e55cf06df7d7607
[]
no_license
shukan26/User-SignUp-Springboot
9fbd4fb58d75b8dd0942f13ca43149d1f57747fa
018d4a57595d70a32dab75d7433e3acac80e387c
refs/heads/main
2023-04-17T21:06:56.778509
2021-05-10T19:12:50
2021-05-10T19:12:50
365,944,019
0
0
null
null
null
null
UTF-8
Java
false
false
657
java
package com.example.cisco.assignment.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.*; import java.util.UUID; @Entity @Data @Builder @AllArgsConstructor @NoArgsConstructor @Table(name = "User_Info") public class UserInfo { @Id @Column(name = "userId") private UUID userId; private String firstName; private String lastName; private String email; private String twitter; private String instagram; private String devEnvironment; private String city; private String technology; private String profession; }
[ "Shukan@shukans-mbp.attlocal.net" ]
Shukan@shukans-mbp.attlocal.net
48ba9183a2afb9c9dd503c8b19f868202623156b
41d04277ad5907765147560933e59d5ebd7d8488
/UserInterface.java
38179512b89fc22e49c1214c1a24ca219033ebd7
[]
no_license
bxtr/calc_java
ad65e88032cbc41f2a116e47714536366c82cecf
ada448bd55f1a6b9d0176f1d7384424c28781d9d
refs/heads/master
2021-01-25T08:43:22.199299
2017-01-14T10:40:06
2017-01-14T10:40:06
5,905,877
0
0
null
null
null
null
UTF-8
Java
false
false
142
java
interface UserInterface { public String getExpression(); public void setAnswer(String answer); public void displayError(String error); }
[ "somemadperson@gmail.com" ]
somemadperson@gmail.com
4179e0439512282af9c9e61dc8972e1a9b8e3d81
aaedcca9e420c01dbd98f5523bdd17688e5dc89f
/app/src/main/java/com/ichirotech/igcopy/PostAdapter.java
c2a66d83efa9afc6cbf4d67fa73582443354f0c8
[]
no_license
Hendra-Bratanata/IgCopy
7ec968468ddbc346874c2ba985d792a99afd398c
28c495d583e653085884da016ea015fba5bf5888
refs/heads/master
2020-04-14T05:28:26.377754
2018-12-31T10:55:52
2018-12-31T10:55:52
163,661,655
0
0
null
null
null
null
UTF-8
Java
false
false
2,079
java
package com.ichirotech.igcopy; import android.content.Context; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; import com.github.chrisbanes.photoview.PhotoView; import java.util.ArrayList; import butterknife.BindView; import butterknife.ButterKnife; import de.hdodenhof.circleimageview.CircleImageView; public class PostAdapter extends RecyclerView.Adapter<PostAdapter.ViewHolder> { public PostAdapter(Context context) { this.context = context; } Context context; public ArrayList<Jadwal> getListPost() { return listPost; } public void setListPost(ArrayList<Jadwal> listPost) { this.listPost = listPost; } ArrayList<Jadwal> listPost; @NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.post,viewGroup,false); return new ViewHolder(v); } @Override public void onBindViewHolder(@NonNull ViewHolder viewHolder, int i) { viewHolder.judulPost.setText(getListPost().get(i).judud); Glide.with(context) .load(getListPost().get(i).gambar) .into(viewHolder.imgPost); Glide.with(context) .load(getListPost().get(i).gambar) .into(viewHolder.photoView); } @Override public int getItemCount() { return getListPost().size(); } public class ViewHolder extends RecyclerView.ViewHolder { @BindView(R.id.photoView) PhotoView photoView; @BindView(R.id.imgPost) CircleImageView imgPost; @BindView(R.id.tvJudulPost) TextView judulPost; public ViewHolder(@NonNull View itemView) { super(itemView); ButterKnife.bind(this,itemView); } } }
[ "Hendrabratanata88@gmail.com" ]
Hendrabratanata88@gmail.com
3edb4c096a5832c747055abf20c78959560b10db
94868c3888e0dfd3cf8dd36bbde97e6ec8bfd96f
/src/sample/Admin/Admin.java
bd14a11e407df722cc571ff77879a5a08d94ccea
[]
no_license
AlarikaRoderick/course_project_saipis
a68199b6022eea49919d0b0b3b83abd13a9ba0d7
7b10393960652c22ce9764eec4b961908e36caeb
refs/heads/master
2020-03-30T06:52:12.879047
2018-09-29T19:09:53
2018-09-29T19:09:53
150,895,225
0
0
null
null
null
null
UTF-8
Java
false
false
381
java
package sample.Admin; public class Admin { private String Login; private String Password; public String getLogin() { return Login; } public void setLogin(String login) { Login = login; } public String getPassword() { return Password; } public void setPassword(String password) { Password = password; } }
[ "lena.rodevich@gmail.com" ]
lena.rodevich@gmail.com
4373eec4a74a123c63f405b466096664dfb69a42
8af7b56f36a14a24c9e08890be4b7c9886916e1d
/src/lessons13/AbstracrList.java
8897570af7bffbaa92a980dc234413b7fce5d35c
[]
no_license
DenchikkD/OOP27
46f58f07f523abe6238499f230fc2915af21d0b9
63e1a9e29b781d699bf051cbbc8b93f45eee672e
refs/heads/master
2020-05-21T20:55:34.209449
2016-09-29T13:25:22
2016-09-29T13:25:22
65,226,850
0
0
null
null
null
null
UTF-8
Java
false
false
377
java
package lessons13; /** * Created by Denni on 12.09.2016. */ public abstract class AbstracrList<E> implements List<E> { @Override public void add(E element) { add(size(), element); } @Override public boolean isEmpty() { return size() == 0; } @Override public boolean contains(E o) { return indexOf(o) >= 0; } }
[ "Online08.08@mail.ru" ]
Online08.08@mail.ru
327c9b95e97cc2343c379aa3212a56e109ce77d0
2ff8fc0c60f2c1286def40dde547597c048e30e6
/core/src/main/java/org/uma/jmetal/qualityindicator/impl/Hypervolume.java
72752e27297ef0168955999d0bb5f948e510535c
[]
no_license
White-Chen/MOEA-Benchmark
f6cba0a7b89b0035772a68d8f8313f1e5a231d53
277127adcbdf239a8c06a25046bf3e095da0a7df
refs/heads/master
2021-01-10T14:37:24.856973
2018-03-12T13:08:21
2018-03-12T13:08:21
55,589,187
4
1
null
null
null
null
UTF-8
Java
false
false
1,993
java
// Hypervolume.java // // Author: // Antonio J. Nebro <antonio@lcc.uma.es> // Juan J. Durillo <durillo@lcc.uma.es> // // Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. package org.uma.jmetal.qualityindicator.impl; import org.uma.jmetal.solution.Solution; import org.uma.jmetal.util.front.Front; import java.io.FileNotFoundException; import java.util.List; /** * This interface represents implementations of the Hypervolume quality indicator * * @author Antonio J. Nebro <antonio@lcc.uma.es> * @author Juan J. Durillo */ @SuppressWarnings("serial") public abstract class Hypervolume<S extends Solution<?>> extends GenericIndicator<S> { public Hypervolume() { } public Hypervolume(String referenceParetoFrontFile) throws FileNotFoundException { super(referenceParetoFrontFile); } public Hypervolume(Front referenceParetoFront) { super(referenceParetoFront); } public abstract List<S> computeHypervolumeContribution(List<S> solutionList, List<S> referenceFrontList); public abstract double getOffset(); public abstract void setOffset(double offset); @Override public String getName() { return "HV"; } @Override public boolean isTheLowerTheIndicatorValueTheBetter() { return false; } }
[ "q953387601@163.com" ]
q953387601@163.com
55a5de2ab2be394ba6e2f8ce9b15cda0586bfd35
3bd07ca84ac239e259e2b757b696f6145dae0626
/src/main/java/com/josericardo/cursomc/domain/enums/TipoCliente.java
e1bb38787b745ae2158fb7cd74cab5bfbcf4c6bf
[]
no_license
josericardobf/PrimeiroTrabalhoServer
bb2fbd32bef69f1b5d8bea82f9bfe3263b047785
f1fc9447fd5380a01a2606e1ff9281e6381d82e4
refs/heads/master
2020-05-05T11:47:41.784162
2019-06-10T01:48:24
2019-06-10T01:48:24
180,004,332
0
0
null
null
null
null
UTF-8
Java
false
false
677
java
package com.josericardo.cursomc.domain.enums; public enum TipoCliente { PESSOAFISICA(1, "Pessoa Física"), PESSOAJURIDICA(2, "Pessoa Jurídica"); private Integer cod; private String descricao; private TipoCliente (Integer cod, String descricao) { this.cod = cod; this.descricao = descricao; } public int getCod() { return cod; } public String getDescricao() { return descricao; } public static TipoCliente toEnum(Integer cod) { if (cod == null) { return null; } for (TipoCliente x : TipoCliente.values()) { if (cod.equals(x.getCod())) { return x; } } throw new IllegalArgumentException("Id inválido: " + cod); } }
[ "josericardobf@gmail.com" ]
josericardobf@gmail.com
77cf5d5b74eba9caeaf6e888d15c1b06be082364
7626c8fc8742859f369834eaab3a6120dd2c5f6f
/src/main/java/org/rcsb/cif/model/generated/ChemicalConnAtom.java
78e38d19a45ac6abe6f8ead45a265137357e0a87
[ "MIT" ]
permissive
BobHanson/ciftools-SwingJS
58c02723827c7c2b6e7716b7cd9c870076ce0f54
e5266a8bfe6e6d5feeab85dc97b0f67e6b0e2594
refs/heads/master
2020-09-12T10:28:07.592153
2019-11-29T21:18:43
2019-11-29T21:18:43
222,393,459
0
0
null
null
null
null
UTF-8
Java
false
false
4,547
java
package org.rcsb.cif.model.generated; import org.rcsb.cif.model.*; import javax.annotation.Generated; import java.util.Map; /** * Data items in the CHEMICAL_CONN_ATOM category would not, in * general, be used in a macromolecular CIF. See instead the * ENTITY data items. * * Data items in the CHEMICAL_CONN_ATOM and CHEMICAL_CONN_BOND * categories record details about the two-dimensional (2D) * chemical structure of the molecular species. They allow * a 2D chemical diagram to be reconstructed for use in a * publication or in a database search for structural and * substructural relationships. * * The CHEMICAL_CONN_ATOM data items provide information about the * chemical properties of the atoms in the structure. In cases * where crystallographic and molecular symmetry elements coincide, * they must also contain symmetry-generated atoms, so that the * CHEMICAL_CONN_ATOM and CHEMICAL_CONN_BOND data items will always * describe a complete chemical entity. */ @Generated("org.rcsb.cif.generator.SchemaGenerator") public class ChemicalConnAtom extends BaseCategory { public ChemicalConnAtom(String name, Map<String, Column> columns) { super(name, columns); } public ChemicalConnAtom(String name, int rowCount, Object[] encodedColumns) { super(name, rowCount, encodedColumns); } public ChemicalConnAtom(String name) { super(name); } /** * The net integer charge assigned to this atom. This is the * formal charge assignment normally found in chemical diagrams. * @return IntColumn */ public IntColumn getCharge() { return (IntColumn) (isText ? textFields.computeIfAbsent("charge", IntColumn::new) : getBinaryColumn("charge")); } /** * The 2D Cartesian x coordinate of the position of this atom in a * recognizable chemical diagram. The coordinate origin is at the * lower left corner, the x axis is horizontal and the y axis * is vertical. The coordinates must lie in the range 0.0 to 1.0. * These coordinates can be obtained from projections of a suitable * uncluttered view of the molecular structure. * @return FloatColumn */ public FloatColumn getDisplayX() { return (FloatColumn) (isText ? textFields.computeIfAbsent("display_x", FloatColumn::new) : getBinaryColumn("display_x")); } /** * The 2D Cartesian y coordinate of the position of this atom in a * recognizable chemical diagram. The coordinate origin is at the * lower left corner, the x axis is horizontal and the y axis * is vertical. The coordinates must lie in the range 0.0 to 1.0. * These coordinates can be obtained from projections of a suitable * uncluttered view of the molecular structure. * @return FloatColumn */ public FloatColumn getDisplayY() { return (FloatColumn) (isText ? textFields.computeIfAbsent("display_y", FloatColumn::new) : getBinaryColumn("display_y")); } /** * The number of connected atoms excluding terminal hydrogen atoms. * @return IntColumn */ public IntColumn getNCA() { return (IntColumn) (isText ? textFields.computeIfAbsent("NCA", IntColumn::new) : getBinaryColumn("NCA")); } /** * The total number of hydrogen atoms attached to this atom, * regardless of whether they are included in the refinement or * the ATOM_SITE list. This number is the same as * _atom_site.attached_hydrogens only if none of the hydrogen * atoms appear in the ATOM_SITE list. * @return IntColumn */ public IntColumn getNH() { return (IntColumn) (isText ? textFields.computeIfAbsent("NH", IntColumn::new) : getBinaryColumn("NH")); } /** * The chemical sequence number to be associated with this atom. * Within an ATOM_SITE list, this number must match one of * the _atom_site.chemical_conn_number values. * @return IntColumn */ public IntColumn getNumber() { return (IntColumn) (isText ? textFields.computeIfAbsent("number", IntColumn::new) : getBinaryColumn("number")); } /** * This data item is a pointer to _atom_type.symbol in the * ATOM_TYPE category. * @return StrColumn */ public StrColumn getTypeSymbol() { return (StrColumn) (isText ? textFields.computeIfAbsent("type_symbol", StrColumn::new) : getBinaryColumn("type_symbol")); } }
[ "bittrich@hs-mittweida.de" ]
bittrich@hs-mittweida.de
a90efe92e75de6ee2b510280f65e91b8f9070105
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/3/3_c20218bfeb6233e5919e30f38fa0537fdf7629a0/PmDefaultsFrame/3_c20218bfeb6233e5919e30f38fa0537fdf7629a0_PmDefaultsFrame_s.java
320d66b53537d180a1169659cc61c1cbc408c621
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
15,311
java
// PmDefaults -- a small application to set PortMIDI default input/output /* Implementation notes: This program uses PortMidi to enumerate input and output devices and also to send output messages to test output devices and to receive input messages to test input devices. */ package pmdefaults; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.lang.Math.*; import jportmidi.*; import jportmidi.JPortMidiApi.*; import java.util.ArrayList; import java.util.prefs.*; public class PmDefaultsFrame extends JFrame implements ActionListener, ComponentListener { // This class extends JPortMidi in order to override midi input handling // In this case, midi input simply blinks the activity light public class JPM extends JPortMidi { ActivityLight light; PmDefaultsFrame frame; int lightTime; boolean lightState; int now; // current time in ms final int HALF_BLINK_PERIOD = 250; // ms public JPM(ActivityLight al, PmDefaultsFrame df) throws JPortMidiException { light = al; frame = df; lightTime = 0; lightState = false; // meaning "off" now = 0; } public void poll(int ms) throws JPortMidiException { // blink the light. lightState is initially false (off). // to blink the light, set lightState to true and lightTime // to now + 0.25s; turn on light // now > ligntTime && lightState => set lightTime = now + 0.25s; // set lightState = false // turn off light // light can be blinked again when now > lightTime && !lightState now = ms; if (now > lightTime && lightState) { lightTime = now + HALF_BLINK_PERIOD; lightState = false; light.setState(false); } super.poll(); } public void handleMidiIn(PmEvent buffer) { System.out.println("midi in: now " + now + " lightTime " + lightTime + " lightState " + lightState); if (now > lightTime && !lightState) { lightState = true; lightTime = now + HALF_BLINK_PERIOD; light.setState(true); } } } public class ActivityLight extends JPanel { Color color; final Color OFF_COLOR = Color.BLACK; final Color ON_COLOR = Color.GREEN; ActivityLight() { super(); Dimension size = new Dimension(50, 25); setMaximumSize(size); setPreferredSize(size); setMinimumSize(size); color = OFF_COLOR; System.out.println("ActivityLight " + getSize()); } public void setState(boolean on) { color = (on ? ON_COLOR : OFF_COLOR); repaint(); } public void paintComponent(Graphics g) { super.paintComponent(g); // paint background g.setColor(color); int x = (getWidth() / 2) - 5; int y = (getHeight() / 2) - 5; g.fillOval(x, y, 10, 10); g.setColor(OFF_COLOR); g.drawOval(x, y, 10, 10); } } private JLabel inputLabel; private JComboBox inputSelection; // inputIds maps from the index of an item in inputSelection to the // device ID. Used to open the selected device. private ArrayList<Integer> inputIds; private ActivityLight inputActivity; private JLabel outputLabel; private JComboBox outputSelection; // analogous to inputIds, outputIds maps selection index to device ID private ArrayList<Integer> outputIds; private JButton testButton; private JButton refreshButton; private JButton updateButton; private JButton closeButton; private JLabel logo; private JPM jpm; private Timer timer; public void componentResized(ComponentEvent e) { System.out.println(e); if (e.getComponent() == this) { Insets insets = getInsets(); Dimension dim = getSize(); layoutComponents(dim.width - insets.left - insets.right, dim.height - insets.top - insets.bottom); } } public void componentMoved(ComponentEvent e) { System.out.println(e); } public void componentHidden(ComponentEvent e) { System.out.println(e); } public void componentShown(ComponentEvent e) { System.out.println(e); } PmDefaultsFrame(String title) { super(title); initComponents(); System.out.println("initComponents returned\n"); pack(); // necessary before calling getInsets(); // initially, only width matters to layout: layoutComponents(500, 300); System.out.println("after layout, pref " + getPreferredSize()); // now, based on layout-computed preferredSize, set the Frame size Insets insets = getInsets(); Dimension dim = getPreferredSize(); dim.width += (insets.left + insets.right); dim.height += (insets.top + insets.bottom); setSize(dim); System.out.println("size" + getPreferredSize()); addComponentListener(this); timer = new Timer(50 /* ms */, this); timer.addActionListener(this); try { jpm = new JPM(inputActivity, this); jpm.setTrace(true); loadDeviceChoices(); timer.start(); // don't start timer if there's an error } catch(JPortMidiException e) { System.out.println(e); } } void openInputSelection() { int id = inputSelection.getSelectedIndex(); if (id < 0) return; // nothing selected id = (Integer) (inputIds.get(id)); // map to device ID // openInput will close any previously open input stream try { jpm.openInput(id, 100); // buffer size hopes to avoid overflow } catch(JPortMidiException e) { System.out.println(e); } } // make a string to put into preferences describing this device String makePrefName(int id) { String name = jpm.getDeviceName(id); String interf = jpm.getDeviceInterf(id); // the syntax requires comma-space separator (see portmidi.h) return interf + ", " + name; } public void savePreferences() { Preferences prefs = Preferences.userRoot().node("/PortMidi"); int id = outputSelection.getSelectedIndex(); if (id >= 0) { String prefName = makePrefName(outputIds.get(id)); prefs.put("PM_RECOMMENDED_OUTPUT_DEVICE", prefName); } id = inputSelection.getSelectedIndex(); if (id >= 0) { String prefName = makePrefName(inputIds.get(id)); prefs.put("PM_RECOMMENDED_INPUT_DEVICE", prefName); } } public void actionPerformed(ActionEvent e) { Object source = e.getSource(); try { if (source == timer) { jpm.poll(jpm.timeGet()); } else if (source == refreshButton) { if (jpm.isOpenInput()) jpm.closeInput(); if (jpm.isOpenOutput()) jpm.closeOutput(); jpm.refreshDeviceLists(); loadDeviceChoices(); } else if (source == updateButton) { savePreferences(); } else if (source == closeButton) { if (jpm.isOpenInput()) jpm.closeInput(); if (jpm.isOpenOutput()) jpm.closeOutput(); } else if (source == testButton) { sendTestMessages(); } else if (source == inputSelection) { // close previous selection and open new one openInputSelection(); } else if (source == outputSelection) { jpm.closeOutput(); // remains closed until Test button reopens } } catch(JPortMidiException ex) { System.out.println(ex); } }; private void layoutComponents(int width, int height) { // I tried to do this with various layout managers, but failed // It seems pretty straightforward to just compute locations and // sizes. int gap = 2; // pixel separation between components int indent = 20; int y = gap; // inputLabel goes in upper left inputLabel.setLocation(0, y); inputLabel.setSize(inputLabel.getPreferredSize()); // inputSelection goes below and indented, width based on panel y += inputLabel.getHeight() + gap; inputSelection.setLocation(indent, y); // size of inputSelection must leave room at right for inputButton // (in fact, inputActivity goes there, but we'll make inputSelection // and outputSelection the same size, based on leaving room for // testButton, which is larger than inputActivity.) Dimension dim = inputSelection.getPreferredSize(); Dimension dimButton = testButton.getPreferredSize(); // make button and selection the same height so they align dim.height = dimButton.height = Math.max(dim.height, dimButton.height); // make selection width as wide as possible dim.width = width - indent - dimButton.width - gap; inputSelection.setSize(dim); // inputActivity goes to the right of inputSelection inputActivity.setLocation(indent + dim.width + gap, y); // square size to match the height of inputSelection inputActivity.setSize(dim.height, dim.height); // outputLabel goes below y += dim.height + gap; outputLabel.setLocation(0, y); outputLabel.setSize(outputLabel.getPreferredSize()); // outputSelection is like inputSelection y += outputLabel.getHeight() + gap; outputSelection.setLocation(indent, y); outputSelection.setSize(dim); // testButton is like inputActivity testButton.setLocation(indent + dim.width + gap, y); testButton.setSize(dimButton); System.out.println("button " + dimButton + " selection " + dim); // refreshButton is below y += dim.height + gap; dim = refreshButton.getPreferredSize(); refreshButton.setLocation(indent, y); refreshButton.setSize(dim); // updateButton to right of refreshButton int x = indent + dim.width + gap; updateButton.setLocation(x, y); dim = updateButton.getPreferredSize(); updateButton.setSize(dim); // closeButton to right of updateButton x += dim.width + gap; closeButton.setLocation(x, y); dim = closeButton.getPreferredSize(); closeButton.setSize(dim); // place logo centered at bottom y += dim.height + gap; logo.setLocation((width - logo.getWidth()) / 2, height - gap - logo.getHeight()); // set overall size y += logo.getHeight() + gap; System.out.println("computed best size " + width + ", " + y); setPreferredSize(new Dimension(width, y)); } private void initComponents() { Container wholePanel = getContentPane(); wholePanel.setLayout(null); setLayout(null); inputLabel = new JLabel(); inputLabel.setText("Default Input"); wholePanel.add(inputLabel); inputSelection = new JComboBox(); inputSelection.addActionListener(this); inputSelection.setLocation(20, 30); inputSelection.setSize(inputSelection.getPreferredSize()); System.out.println("Adding inputSelection to panel"); wholePanel.add(inputSelection); inputIds = new ArrayList<Integer>(); inputActivity = new ActivityLight(); wholePanel.add(inputActivity); outputLabel = new JLabel(); outputLabel.setText("Default Output"); wholePanel.add(outputLabel); outputSelection = new JComboBox(); outputSelection.addActionListener(this); wholePanel.add(outputSelection); testButton = new JButton(); testButton.setText("Test"); testButton.addActionListener(this); wholePanel.add(testButton); outputIds = new ArrayList<Integer>(); refreshButton = new JButton(); refreshButton.setText("Refresh Device Lists"); System.out.println("refresh " + refreshButton.getPreferredSize()); System.out.println(getLayout()); refreshButton.addActionListener(this); wholePanel.add(refreshButton); updateButton = new JButton(); updateButton.setText("Update Preferences"); updateButton.setSize(refreshButton.getPreferredSize()); updateButton.addActionListener(this); wholePanel.add(updateButton); closeButton = new JButton(); closeButton.setText("Close/Release Ports"); closeButton.setSize(refreshButton.getPreferredSize()); closeButton.addActionListener(this); wholePanel.add(closeButton); ImageIcon icon = new ImageIcon("portmusic_logo.png"); logo = new JLabel(icon); logo.setSize(logo.getPreferredSize()); wholePanel.add(logo); setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } void loadDeviceChoices() throws JPortMidiException { // initialize and load combo boxes with device descriptions int n = jpm.countDevices(); inputSelection.removeAllItems(); inputIds.clear(); outputSelection.removeAllItems(); outputIds.clear(); for (int i = 0; i < n; i++) { String interf = jpm.getDeviceInterf(i); String name = jpm.getDeviceName(i); String selection = name + " [" + interf + "]"; if (jpm.getDeviceInput(i)) { inputIds.add(i); inputSelection.addItem(selection); } else { outputIds.add(i); outputSelection.addItem(selection); } } } void sendTestMessages() { try { if (!jpm.isOpenOutput()) { int id = outputSelection.getSelectedIndex(); if (id < 0) return; // nothing selected id = (Integer) (outputIds.get(id)); System.out.println("calling openOutput"); jpm.openOutput(id, 10, 10); } jpm.midiNote(0, 67, 100); // send an A (440) jpm.midiNote(0, 67, 0, jpm.timeGet() + 500); } catch(JPortMidiException e) { System.out.println(e); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
abc3d3ebd1726e355bda7cb207f04ca975e0c5cf
94b9dff273d96a076a8809b4befcf90c4fcf263e
/src/main/java/ElasticJavaAPI.java
25fc95f425c1d17884dc015563bcc6336f9e8812
[]
no_license
samidakhani/elasticsearch_java_client
2cd3035be580186c76c2cd594b67e3fab063df03
5dad83942b4028c2b03a049032dddc857c838b86
refs/heads/master
2021-01-01T05:06:10.156880
2016-05-04T23:32:47
2016-05-04T23:32:47
58,089,246
1
0
null
null
null
null
UTF-8
Java
false
false
3,584
java
import org.elasticsearch.action.delete.DeleteResponse; import org.elasticsearch.action.get.GetResponse; import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.action.update.UpdateResponse; import org.elasticsearch.client.Client; import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.node.Node; import java.util.Date; import java.util.HashMap; import java.util.Map; import static org.elasticsearch.node.NodeBuilder.*; // Elasticsearch 1.7 and 2.3 (current) // ./elasticsearch --cluster.name elasticsearch_sdakhani --node.name SpireonNode public class ElasticJavaAPI{ static String index = "my_deezer"; static String type = "song"; static String id = "11"; public static Client connectToExistingCuster(){ //Uses Transport Client Settings settings = ImmutableSettings.settingsBuilder() .put("cluster.name", "elasticsearch_sdakhani").build(); Client client = new TransportClient(settings) .addTransportAddress(new InetSocketTransportAddress("localhost", 9300)); return client; } public static Client createAnEmbededode(){ //Uses Node Client Node node = nodeBuilder().clusterName("elasticsearch_sdakhani").node(); Client client = node.client(); return client; //node.close(); } public static void closeClient(Client client){ client.close(); } public static void indexAPI(Client client){ Map<String, Object> json = new HashMap<String, Object>(); json.put("title","Fake"); json.put("artist","DanceAndMight"); json.put("year",1990); IndexResponse response = client.prepareIndex(index,type,id) .setSource(json) .execute() .actionGet(); System.out.println(response.isCreated()); } public static void getAPI(Client client){ GetResponse response = client.prepareGet(index,type,id) .execute() .actionGet(); System.out.println(response.getSourceAsMap()); System.out.println(response.getSourceAsMap().get("title")); System.out.println(response.getSourceAsMap().get("artist")); System.out.println(response.getSourceAsMap().get("year")); } public static void updateAPI(Client client) { Map<String, Object> json = new HashMap<String, Object>(); json.put("title","Roses"); try { UpdateRequest updateRequest = new UpdateRequest(index, type, id) .doc(json); UpdateResponse response =client.update(updateRequest).get(); System.out.println(response.getVersion()); }catch (Exception e){ e.printStackTrace(); } } public static void deleteAPI(Client client){ DeleteResponse response = client.prepareDelete(index,type,id) .execute() .actionGet(); System.out.println(response.isFound()); } public static void main(String[] args) { Client client = connectToExistingCuster(); indexAPI(client); getAPI(client); //updateAPI(client); //deleteAPI(client); closeClient(client); } }
[ "samidakhani@gmail.com" ]
samidakhani@gmail.com
f1e6e6c9e834b7243a4a4a4c86caf0561e428fad
87767ce1e15a8ee20febc3876f8d55c8a16a1d64
/HelloWorldGit.java
71ddcefcc4e95fa2422cb2ec23905902d5d080a3
[]
no_license
poorna1235/MyJavaRepository
4113c32923d894c9c6ba61634bfb4bcea34ee4c0
be24cf1922f161e2b4dd384ad82444b703656bc9
refs/heads/master
2020-03-24T03:37:14.552414
2018-07-26T10:47:22
2018-07-26T10:47:22
142,425,802
0
0
null
null
null
null
UTF-8
Java
false
false
272
java
class HelloWorld{ void displayDate(){ system.out.println("display todays date:-"+new Date()); } public static void main(String[] args){ system.out.println("hello world!!!welcome to git!!!"); displayDate(); } }
[ "poorna_fondekar@persistent.co.in" ]
poorna_fondekar@persistent.co.in
26c70a69b6c260b4dda7be995492a2e831d18a1e
f727d763d0cec7d8ffa738ce59ef461add3f7c64
/src/main/java/in/dragonbra/javasteam/steam/handlers/steamuser/AnonymousLogOnDetails.java
0d495b5367ecf4abd497241e881d151ac0276ccd
[ "MIT" ]
permissive
dpruckler/JavaSteam
f7e59aa350ef362ec6529bd48ef776114279f080
b47a7d3e467df0bb069e404139b5377aa415ee5a
refs/heads/master
2022-12-10T17:39:14.730588
2022-12-02T16:25:40
2022-12-02T16:25:40
221,637,767
0
0
MIT
2019-11-14T07:31:58
2019-11-14T07:31:57
null
UTF-8
Java
false
false
993
java
package in.dragonbra.javasteam.steam.handlers.steamuser; import in.dragonbra.javasteam.enums.EOSType; import in.dragonbra.javasteam.util.Utils; /** * Represents the details required to log into Steam3 as an anonymous user. */ public class AnonymousLogOnDetails { private int cellID; private EOSType clientOSType; private String clientLanguage; public AnonymousLogOnDetails() { clientOSType = Utils.getOSType(); clientLanguage = "english"; } public int getCellID() { return cellID; } public void setCellID(int cellID) { this.cellID = cellID; } public EOSType getClientOSType() { return clientOSType; } public void setClientOSType(EOSType clientOSType) { this.clientOSType = clientOSType; } public String getClientLanguage() { return clientLanguage; } public void setClientLanguage(String clientLanguage) { this.clientLanguage = clientLanguage; } }
[ "lngtrn94@gmail.com" ]
lngtrn94@gmail.com
ba16ba9fa50ea94454ee3c523d996ece70c822eb
1f8b825a0a6fb8d39c581d05bd13338c1e4c4318
/bukkit/rpk-essentials-bukkit/src/main/java/com/rpkit/essentials/bukkit/database/jooq/tables/records/RpkitTrackingDisabledRecord.java
4afdccf17a919c4307f18d82426fedb93a3a91b9
[ "Apache-2.0" ]
permissive
WorldOfCasus/RPKit
4544dd2d1f458f383a2fb675b99c0111c78eb197
a78d9204a7ef4bd45998107a97e464878fbc9618
refs/heads/main
2023-06-26T10:28:36.231219
2021-06-20T22:08:08
2021-06-20T22:08:08
336,911,550
0
0
Apache-2.0
2021-02-07T23:20:14
2021-02-07T23:20:13
null
UTF-8
Java
false
true
2,821
java
/* * This file is generated by jOOQ. */ package com.rpkit.essentials.bukkit.database.jooq.tables.records; import com.rpkit.essentials.bukkit.database.jooq.tables.RpkitTrackingDisabled; import org.jooq.Field; import org.jooq.Record1; import org.jooq.Row1; import org.jooq.impl.UpdatableRecordImpl; /** * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class RpkitTrackingDisabledRecord extends UpdatableRecordImpl<RpkitTrackingDisabledRecord> implements Record1<Integer> { private static final long serialVersionUID = 1L; /** * Setter for <code>rpkit_essentials.rpkit_tracking_disabled.character_id</code>. */ public void setCharacterId(Integer value) { set(0, value); } /** * Getter for <code>rpkit_essentials.rpkit_tracking_disabled.character_id</code>. */ public Integer getCharacterId() { return (Integer) get(0); } // ------------------------------------------------------------------------- // Primary key information // ------------------------------------------------------------------------- @Override public Record1<Integer> key() { return (Record1) super.key(); } // ------------------------------------------------------------------------- // Record1 type implementation // ------------------------------------------------------------------------- @Override public Row1<Integer> fieldsRow() { return (Row1) super.fieldsRow(); } @Override public Row1<Integer> valuesRow() { return (Row1) super.valuesRow(); } @Override public Field<Integer> field1() { return RpkitTrackingDisabled.RPKIT_TRACKING_DISABLED.CHARACTER_ID; } @Override public Integer component1() { return getCharacterId(); } @Override public Integer value1() { return getCharacterId(); } @Override public RpkitTrackingDisabledRecord value1(Integer value) { setCharacterId(value); return this; } @Override public RpkitTrackingDisabledRecord values(Integer value1) { value1(value1); return this; } // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- /** * Create a detached RpkitTrackingDisabledRecord */ public RpkitTrackingDisabledRecord() { super(RpkitTrackingDisabled.RPKIT_TRACKING_DISABLED); } /** * Create a detached, initialised RpkitTrackingDisabledRecord */ public RpkitTrackingDisabledRecord(Integer characterId) { super(RpkitTrackingDisabled.RPKIT_TRACKING_DISABLED); setCharacterId(characterId); } }
[ "ren.binden@gmail.com" ]
ren.binden@gmail.com
a67bccbbe3223fd4aa17d3bcbf29e63faf5e2ca2
d8ce228dffe2f9cfd8d1e999fb32f9536401f750
/src/main/java/net/fischboeck/discogs/model/collection/Folder.java
481664017d29d686d67939a6e9cefa11657f48ee
[ "Apache-2.0" ]
permissive
mfischbo/java-discogs-client
c2bb675a32ad6ac42fc8a9271b926d9aa5238f2f
6f5f6afa007df47aec1fde1e50fea59a4441e6ff
refs/heads/master
2021-01-17T16:44:19.467957
2018-05-09T21:34:49
2018-05-09T21:34:49
69,288,623
1
2
Apache-2.0
2018-02-03T20:32:10
2016-09-26T20:10:04
Java
UTF-8
Java
false
false
1,053
java
// // Copyright 2016 M. Fischboeck // // 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 net.fischboeck.discogs.model.collection; import com.fasterxml.jackson.annotation.JsonProperty; public class Folder { private long id; private int count; private String name; @JsonProperty("resource_url") private String resourceUrl; public long getId() { return id; } public int getCount() { return count; } public String getName() { return name; } public String getResourceUrl() { return resourceUrl; } }
[ "m.fischboeck@googlemail.com" ]
m.fischboeck@googlemail.com
7176d1a9e48a87470ca41c46f9dfe54008a7e741
5a7b83f264c82824a6055887630df8adfa2f56d2
/java_jpa/financas/src/br/com/caelum/financas/teste/TesteGerenciamentoJPA.java
441b196adadef195f5b67d8a7c0641406132017c
[]
no_license
diogosantinon/alura
5cd021aeef690c10ba83e53089a1198180ef051e
c36006e686e5003aed746ee5b37fa047bb7bb164
refs/heads/master
2022-12-21T13:34:00.181991
2019-10-22T23:43:30
2019-10-22T23:43:30
76,803,227
0
0
null
2022-12-16T10:33:01
2016-12-18T19:50:07
Java
UTF-8
Java
false
false
827
java
package br.com.caelum.financas.teste; import javax.persistence.EntityManager; import br.com.caelum.financas.modelo.Conta; import br.com.caelum.financas.util.JPAUtil; public class TesteGerenciamentoJPA { public static void main(String[] args) { EntityManager manager = new JPAUtil().getEntityManager(); manager.getTransaction().begin(); // ID de uma conta que exista no banco de dados, no caso ID: 1 Conta conta = manager.find(Conta.class, 1); // commit antes da alteração manager.getTransaction().commit(); // Alteração do titular da conta conta.setTitular("Caelum Ensino e Inovação"); manager.getTransaction().begin(); manager.merge(conta); manager.getTransaction().commit(); manager.close(); } }
[ "diogo.santinon@cwi.com.br" ]
diogo.santinon@cwi.com.br
e2eec6ef3c9a05c2504370d60b164e89c25579db
a7995a853290193abbac8790572017cdeb227fe2
/src/Array/NO289GameofLife/Solution.java
ab3f45738e91c149c15dbbffad7e65db4c225b67
[]
no_license
JJFly-JOJO/LeetCode
c42775973f025f5d8c82ca1f0921f0de117ca6de
0c172a87ca4e0f23e68f388186c77f9e51370660
refs/heads/master
2023-07-09T20:47:22.363062
2021-08-11T16:57:06
2021-08-11T16:57:06
328,843,633
0
1
null
null
null
null
UTF-8
Java
false
false
2,763
java
package Array.NO289GameofLife; /** * @author zzj * @version 1.0 * @date 2020/10/13 16:29 * 输入: * [ *   [0,1,0], *   [0,0,1], *   [1,1,1], *   [0,0,0] * ] * 输出: * [ *   [0,0,0], *   [1,0,1], *   [0,1,1], *   [0,1,0] * ] */ public class Solution { public void gameOfLife(int[][] board) { int row = board.length; int col = board[0].length; //3表示1->0 4表示0->1 for (int i = 0; i < row; i++) { for (int j = 0; j < col; j++) { int liveCeils = getAroundCeils(i, j, board, row, col); if (board[i][j] == 1) { if (liveCeils < 2 || liveCeils > 3) { board[i][j] = 3; } } else { if (liveCeils == 3) { board[i][j] = 4; } } } } update(board, row, col); } private void update(int[][] board, int row, int col) { for (int i = 0; i < row; i++) { for (int j = 0; j < col; j++) { if (board[i][j] == 3) { board[i][j] = 0; } else if (board[i][j] == 4) { board[i][j] = 1; } } } } private int getAroundCeils(int i, int j, int[][] board, int row, int col) { int count = 0; //左上 上 右上 左中 右中 左下 下 右下 //int[][] position=new int[][]{{i-1,j-1},{}} if (i - 1 >= 0 && j - 1 >= 0) { if (board[i - 1][j - 1] == 1 || board[i - 1][j - 1] == 3) { count++; } } if (i - 1 >= 0) { if (board[i - 1][j] == 1 || board[i - 1][j] == 3) { count++; } } if (i - 1 >= 0 && j + 1 < col) { if (board[i - 1][j + 1] == 1 || board[i - 1][j + 1] == 3) { count++; } } if (j - 1 >= 0) { if (board[i][j - 1] == 1 || board[i][j - 1] == 3) { count++; } } if (j + 1 < col) { if (board[i][j + 1] == 1 || board[i][j + 1] == 3) { count++; } } if (i + 1 < row && j - 1 >= 0) { if (board[i + 1][j - 1] == 1 || board[i + 1][j - 1] == 3) { count++; } } if (i + 1 < row) { if (board[i + 1][j] == 1 || board[i + 1][j] == 3) { count++; } } if (i + 1 < row && j + 1 < col) { if (board[i + 1][j + 1] == 1 || board[i + 1][j + 1] == 3) { count++; } } return count; } }
[ "13419232991@163.com" ]
13419232991@163.com
af4c530dce4af3e9d69c363670715b5e31ddaae8
214473480ef7182a8c3c33e3e17583a735f63ba9
/src/main/java/Base25/week6/lesson12/MainTask5.java
df485e1f8c88b15345d8e291479d95ad0fd0feb5
[]
no_license
sokhoda/alexandr_khoda
b353a05388a071ed5386b92d82d953e4f275caf8
9cf718190816d418ff529b1fc58009b90606685d
refs/heads/master
2021-01-13T08:10:30.798724
2016-10-23T17:43:24
2016-10-23T17:43:24
71,718,755
0
0
null
null
null
null
UTF-8
Java
false
false
1,846
java
package Base25.week6.lesson12; import java.util.ArrayList; import java.util.Vector; public class MainTask5 { static int ThreadNum = 10; static int MaxVal = 10000; public static void main(String[] args) { int k = 1; if (k == 0) { ArrayList<Integer> val = new ArrayList<Integer>(MaxVal); for (int i = 0; i < MaxVal; i++) { val.add(i); } System.out.println(val); long t1 = System.nanoTime(); Task5Thread[] thr = new Task5Thread[ThreadNum]; for (int i = 0; i < thr.length; i++) { thr[i] = new Task5Thread(val, i * (MaxVal / ThreadNum), (MaxVal / ThreadNum)); thr[i].start(); } try { for (Task5Thread element : thr) { element.join(); } } catch (InterruptedException e) { e.printStackTrace(); return; } int sum = 0; for (Task5Thread element : thr) { sum += element.getSum(); } long t2 = System.nanoTime(); System.out.printf("ArrayList Time = %.2e", (t2 - t1) * 1.); System.out.println("\nсумма = " + sum); } if (k == 1) { Vector<Integer> vector = new Vector<Integer>(MaxVal); for (int i = 0; i < MaxVal; i++) { vector.add(i); } System.out.println(vector); long t1 = System.nanoTime(); Task5ThreadVect[] thr = new Task5ThreadVect[ThreadNum]; for (int i = 0; i < thr.length; i++) { thr[i] = new Task5ThreadVect(vector, i * (MaxVal / ThreadNum), (MaxVal / ThreadNum)); thr[i].start(); } try { for (Task5ThreadVect element : thr) { element.join(); } } catch (InterruptedException e) { e.printStackTrace(); return; } int sum = 0; for (Task5ThreadVect element : thr) { sum += element.getSum(); } long t2 = System.nanoTime(); System.out.printf("Vector Time = %.2e", (t2 - t1) * 1.); System.out.println("\nсумма = " + sum); } } }
[ "oleksandr.khodakovskyi@gmail.com" ]
oleksandr.khodakovskyi@gmail.com
4e80fe30e3d2c95c62a90c5198c2b4fba416cbd8
0c3e1bacced1572fcf3f8018a816dc5a8e7a8f80
/Calculator/src/domain/entities/Operator.java
4e16e1fabb4c4516934906d08dd10d76987b4394
[ "MIT" ]
permissive
Rod1Andrade/Java-calculator-2
48fe51f958f85f5412abb1d6c8951f6e1d50e861
735bba764c5f895aaa5ba98ee4e0a3c73cdb941b
refs/heads/main
2023-01-23T15:18:34.323836
2020-12-02T00:25:47
2020-12-02T00:25:47
316,730,177
0
0
null
null
null
null
UTF-8
Java
false
false
1,615
java
package domain.entities; /** * Classe de modelo para operadores * * @author Rodrigo M.P Andrade * */ public class Operator { private Character simbol; private String name; private int precedenceNumber; /** * Construtor padrão * * @param simbol Simbolo represante da operação matemática * @param name Nome da operação matemática * @param precedenceNumber Valor de precedência do operador matemático quanto, * maior o número menor sua precedência em relação aos * outros operadores. */ public Operator(Character simbol, String name, int precedenceNumber) { this.simbol = simbol; this.name = name; this.precedenceNumber = precedenceNumber; } /** * Retorna Simbolo represante da operação matemática * * @return Character */ public Character getSimbol() { return simbol; } /** * Define Simbolo represante da operação matemática * * @param simbol */ public void setSimbol(Character simbol) { this.simbol = simbol; } /** * @return String */ public String getName() { return name; } /** * Define o nome para a operação matemática. * * @param name */ public void setName(String name) { this.name = name; } /** * Retorna o valor de precedência * * @return int */ public int getPrecedenceNumber() { return precedenceNumber; } /** * Define o valor de precedência do operador. * * @param precedenceNumber */ public void setPrecedenceNumber(int precedenceNumber) { this.precedenceNumber = precedenceNumber; } }
[ "51142291+Rod1Andrade@users.noreply.github.com" ]
51142291+Rod1Andrade@users.noreply.github.com
985ff0467b38330abf87379d0fc432346c439022
daa4c1ab3784076af5e65ba2cb2faa5aea31463c
/src/com/javarush/test/level06/lesson11/home02/Cat.java
de8c31d0ca5e483723e31636b392ae2192b5e96a
[]
no_license
sergiokulchytsky/JavaRushHomeWork
f799bdbfb5ee1e9f121dfa81f9351a747450bc16
c0d0125431e0ded47913c6d83426e4ab28b3fc87
refs/heads/master
2021-01-19T03:25:20.834446
2016-08-01T19:27:49
2016-08-01T19:27:49
45,702,092
0
0
null
null
null
null
UTF-8
Java
false
false
1,010
java
package com.javarush.test.level06.lesson11.home02; import java.util.ArrayList; /* Статические коты 1. В классе Cat добавь public статическую переменную cats (ArrayList<Cat>). 2. Пусть при каждом создании кота (нового объекта Cat) в переменную cats добавляется этот новый кот. Создать 10 объектов Cat. 3. Метод printCats должен выводить всех котов на экран. Нужно использовать переменную cats. */ public class Cat { public static ArrayList<Cat> cats = new ArrayList<Cat>(); public Cat() { cats.add(this); } public static void main(String[] args) { for (int i = 0; i < 10; i++) { Cat cat = new Cat(); } printCats(); } public static void printCats() { for (Cat cat : cats) { System.out.println(cat); } } }
[ "serhiyx16@gmail.com" ]
serhiyx16@gmail.com
6dd842b56a646392a69d73a3ce1396bd9c49c2e4
fc1bf26252525f1dca780f0c26cea165c3b3f531
/com/planet_ink/coffee_mud/Abilities/Druid/Chant_TremorSense.java
b773c85927b6ab025eca9a66d35d6631f98731e1
[ "Apache-2.0" ]
permissive
mikael2/CoffeeMud
8ade6ff60022dbe01f55172ba3f86be0de752124
a70112b6c67e712df398c940b2ce00b589596de0
refs/heads/master
2020-03-07T14:13:04.765442
2018-03-28T03:59:22
2018-03-28T03:59:22
127,521,360
1
0
null
2018-03-31T10:11:54
2018-03-31T10:11:53
null
UTF-8
Java
false
false
6,471
java
package com.planet_ink.coffee_mud.Abilities.Druid; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.TrackingLibrary; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; /* Copyright 2004-2018 Bo Zimmerman 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. */ public class Chant_TremorSense extends Chant { @Override public String ID() { return "Chant_TremorSense"; } private final static String localizedName = CMLib.lang().L("Tremor Sense"); @Override public String name() { return localizedName; } private final static String localizedStaticDisplay = CMLib.lang().L("(Tremor Sense)"); @Override public String displayText() { return localizedStaticDisplay; } @Override public int classificationCode() { return Ability.ACODE_CHANT | Ability.DOMAIN_DEEPMAGIC; } @Override public int abstractQuality() { return Ability.QUALITY_OK_SELF; } @Override protected int canAffectCode() { return CAN_MOBS | CAN_ROOMS; } protected Vector<Room> rooms = new Vector<Room>(); @Override public CMObject copyOf() { final Chant_TremorSense obj=(Chant_TremorSense)super.copyOf(); obj.rooms=new Vector<Room>(); obj.rooms.addAll(rooms); return obj; } @Override public void unInvoke() { // undo the affects of this spell if(!(affected instanceof MOB)) { super.unInvoke(); return; } final MOB mob=(MOB)affected; super.unInvoke(); if(canBeUninvoked()) { if((mob.location()!=null)&&(!mob.amDead())) mob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("<S-YOUPOSS> tremor sense fades.")); } for(int r=0;r<rooms.size();r++) { final Room R=rooms.elementAt(r); final Ability A=R.fetchEffect(ID()); if((A!=null)&&(A.invoker()==mob)) A.unInvoke(); } } @Override public void executeMsg(final Environmental myHost, final CMMsg msg) { super.executeMsg(myHost,msg); if(affected==null) return; if(affected instanceof MOB) { if(msg.amISource((MOB)affected) &&((msg.sourceMinor()==CMMsg.TYP_STAND) ||(msg.sourceMinor()==CMMsg.TYP_LEAVE))) unInvoke(); } else if(affected instanceof Room) { if((msg.target()==affected) &&(msg.targetMinor()==CMMsg.TYP_ENTER) &&(!CMLib.flags().isInFlight(msg.source())) &&(invoker!=null) &&(invoker.location()!=null)) { if(invoker.location()==affected) invoker.tell(L("You feel footsteps around you.")); else { final int dir=CMLib.tracking().radiatesFromDir((Room)affected,rooms); if(dir>=0) invoker.tell(L("You feel footsteps @x1",CMLib.directions().getInDirectionName(dir))); } } else if((msg.tool() instanceof Ability) &&((msg.tool().ID().equals("Prayer_Tremor")) ||(msg.tool().ID().endsWith("_Earthquake")))) { if(invoker.location()==affected) invoker.tell(L("You feel a ferocious rumble.")); else { final int dir=CMLib.tracking().radiatesFromDir((Room)affected,rooms); if(dir>=0) invoker.tell(L("You feel a ferocious rumble @x1",CMLib.directions().getInDirectionName(dir))); } } } } @Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { MOB target=mob; if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB)) target=(MOB)givenTarget; if(target.fetchEffect(this.ID())!=null) { mob.tell(target,null,null,L("<S-NAME> <S-IS-ARE> already sensing tremors.")); return false; } if((!CMLib.flags().isSitting(mob))||(mob.riding()!=null)) { mob.tell(L("You must be sitting on the ground for this chant to work.")); return false; } if(!super.invoke(mob,commands,givenTarget,auto,asLevel)) return false; final boolean success=proficiencyCheck(mob,0,auto); if(success) { final CMMsg msg=CMClass.getMsg(mob,target,this,verbalCastCode(mob,target,auto),L("@x1<T-NAME> gain(s) a sense of the earth!^?",L(auto?"":"^S<S-NAME> chant(s) to <S-HIM-HERSELF>. "))); if(mob.location().okMessage(mob,msg)) { mob.location().send(mob,msg); rooms=new Vector<Room>(); TrackingLibrary.TrackingFlags flags; flags = CMLib.tracking().newFlags() .plus(TrackingLibrary.TrackingFlag.NOEMPTYGRIDS) .plus(TrackingLibrary.TrackingFlag.NOAIR) .plus(TrackingLibrary.TrackingFlag.NOWATER); int range=5 +(super.getXMAXRANGELevel(mob)/2); CMLib.tracking().getRadiantRooms(mob.location(),rooms,flags,null,range,null); for(int r=0;r<rooms.size();r++) { final Room R=rooms.elementAt(r); if((R!=mob.location()) &&(R.domainType()!=Room.DOMAIN_INDOORS_AIR) &&(!CMLib.flags().isWateryRoom(R)) &&(R.domainType()!=Room.DOMAIN_OUTDOORS_AIR) &&(R.domainType()!=Room.DOMAIN_OUTDOORS_UNDERWATER) &&(R.domainType()!=Room.DOMAIN_OUTDOORS_WATERSURFACE)) beneficialAffect(mob,R,asLevel,0); } beneficialAffect(mob,target,asLevel,0); } } else return beneficialWordsFizzle(mob,target,L("<S-NAME> chant(s), but nothing happens.")); // return whether it worked return success; } }
[ "bo@zimmers.net" ]
bo@zimmers.net
a70b4ddcbe728efe3c5d9b814906451ccfd8f9a8
8935002755d85c8b21c0e62196044100472ef5d5
/main/test/otherTests/DeencapsulationTest.java
0014e5ee7c909f708daedb36f2e4b74f6c9581c2
[ "BSD-3-Clause", "MIT" ]
permissive
shamseer81/jmockit1
2a16ab047efbb9bf78e461d4fd6c8511c42aa1ce
6a4ea1a1d33fa77264ed9360ef6a2418a5471bbd
refs/heads/master
2020-04-05T09:18:19.912304
2018-11-03T22:34:20
2018-11-03T22:34:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,982
java
package otherTests; import java.util.*; import org.junit.*; import org.junit.rules.*; import static org.junit.Assert.*; import mockit.*; import static org.hamcrest.CoreMatchers.*; public final class DeencapsulationTest { @Rule public final ExpectedException thrown = ExpectedException.none(); static final class Subclass extends BaseClass { final int INITIAL_VALUE = new Random().nextInt(); final int initialValue = -1; @SuppressWarnings("unused") private static final Integer constantField = 123; private static StringBuilder buffer; @SuppressWarnings("unused") private static char static1; @SuppressWarnings("unused") private static char static2; static StringBuilder getBuffer() { return buffer; } static void setBuffer(StringBuilder buffer) { Subclass.buffer = buffer; } private String stringField; private int intField; private int intField2; private List<String> listField; int getIntField() { return intField; } void setIntField(int intField) { this.intField = intField; } int getIntField2() { return intField2; } void setIntField2(int intField2) { this.intField2 = intField2; } String getStringField() { return stringField; } void setStringField(String stringField) { this.stringField = stringField; } List<String> getListField() { return listField; } void setListField(List<String> listField) { this.listField = listField; } } final Subclass anInstance = new Subclass(); @Test public void getInstanceFieldByName() { anInstance.setIntField(3); anInstance.setStringField("test"); anInstance.setListField(Collections.<String>emptyList()); Integer intValue = Deencapsulation.getField(anInstance, "intField"); String stringValue = Deencapsulation.getField(anInstance, "stringField"); List<String> listValue = Deencapsulation.getField(anInstance, "listField"); assertEquals(anInstance.getIntField(), intValue.intValue()); assertEquals(anInstance.getStringField(), stringValue); assertSame(anInstance.getListField(), listValue); } @Test public void attemptToGetInstanceFieldByNameWithWrongName() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("No instance field of name \"noField\" found"); Deencapsulation.getField(anInstance, "noField"); } @Test public void getInheritedInstanceFieldByName() { anInstance.baseInt = 3; anInstance.baseString = "test"; anInstance.baseSet = Collections.emptySet(); Integer intValue = Deencapsulation.getField(anInstance, "baseInt"); String stringValue = Deencapsulation.getField(anInstance, "baseString"); Set<Boolean> listValue = Deencapsulation.getField(anInstance, "baseSet"); assertEquals(anInstance.baseInt, intValue.intValue()); assertEquals(anInstance.baseString, stringValue); assertSame(anInstance.baseSet, listValue); } @Test @SuppressWarnings("unchecked") public void getInstanceFieldByType() { anInstance.setStringField("by type"); anInstance.setListField(new ArrayList<String>()); String stringValue = Deencapsulation.getField(anInstance, String.class); List<String> listValue = Deencapsulation.getField(anInstance, List.class); List<String> listValue2 = Deencapsulation.getField(anInstance, ArrayList.class); assertEquals(anInstance.getStringField(), stringValue); assertSame(anInstance.getListField(), listValue); assertSame(listValue, listValue2); } @Test public void attemptToGetInstanceFieldByTypeWithWrongType() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Instance field of type byte or Byte not found"); Deencapsulation.getField(anInstance, Byte.class); } @Test public void attemptToGetInstanceFieldByTypeForClassWithMultipleFieldsOfThatType() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("More than one instance field"); thrown.expectMessage("of type int "); thrown.expectMessage("INITIAL_VALUE, initialValue"); Deencapsulation.getField(anInstance, int.class); } @Test @SuppressWarnings("unchecked") public void getInheritedInstanceFieldByType() { Set<Boolean> fieldValueOnInstance = new HashSet<>(); anInstance.baseSet = fieldValueOnInstance; Set<Boolean> setValue = Deencapsulation.getField(anInstance, fieldValueOnInstance.getClass()); Set<Boolean> setValue2 = Deencapsulation.getField(anInstance, HashSet.class); assertSame(fieldValueOnInstance, setValue); assertSame(setValue, setValue2); } @Test public void getInstanceFieldOnBaseClassByType() { anInstance.setLongField(15); long longValue = Deencapsulation.getField(anInstance, long.class); assertEquals(15, longValue); } @Test public void getStaticFieldByName() { Subclass.setBuffer(new StringBuilder()); StringBuilder b = Deencapsulation.getField(Subclass.class, "buffer"); assertSame(Subclass.getBuffer(), b); } @Test public void attemptToGetStaticFieldByNameFromWrongClass() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("No static field of name \"buffer\" found in class otherTests.BaseClass"); Deencapsulation.getField(BaseClass.class, "buffer"); } @Test public void getStaticFieldByType() { Subclass.setBuffer(new StringBuilder()); StringBuilder b = Deencapsulation.getField(Subclass.class, StringBuilder.class); assertSame(Subclass.getBuffer(), b); } @Test public void setInstanceFieldByName() { anInstance.setIntField2(1); Deencapsulation.setField(anInstance, "intField2", 901); assertEquals(901, anInstance.getIntField2()); } @Test public void attemptToSetInstanceFieldByNameWithWrongName() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("No instance field of name \"noField\" found"); Deencapsulation.setField(anInstance, "noField", 901); } @Test public void setInstanceFieldByType() { anInstance.setStringField(""); Deencapsulation.setField(anInstance, "Test"); assertEquals("Test", anInstance.getStringField()); } @Test public void attemptToSetInstanceFieldByTypeWithWrongType() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Instance field of type byte or Byte not found"); Deencapsulation.setField(anInstance, (byte) 123); } @Test public void attemptToSetInstanceFieldByTypeForClassWithMultipleFieldsOfThatType() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("More than one instance field "); Deencapsulation.setField(anInstance, 901); } @Test public void setStaticFieldByName() { Subclass.setBuffer(null); Deencapsulation.setField(Subclass.class, "buffer", new StringBuilder()); assertNotNull(Subclass.getBuffer()); } @Test public void attemptToSetStaticFieldByNameWithWrongName() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("No static field of name \"noField\" found "); Deencapsulation.setField(Subclass.class, "noField", null); } @Test public void setStaticFieldByType() { Subclass.setBuffer(null); Deencapsulation.setField(Subclass.class, new StringBuilder()); assertNotNull(Subclass.getBuffer()); } @Test public void attemptToSetFieldByTypeWithoutAValue() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Missing field value"); Deencapsulation.setField(Subclass.class, null); } @Test public void attemptToSetStaticFieldByTypeWithWrongType() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Static field of type StringBuffer not found"); Deencapsulation.setField(Subclass.class, new StringBuffer()); } @Test public void attemptToSetStaticFieldByTypeForClassWithMultipleFieldsOfThatType() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("More than one static field "); Deencapsulation.setField(Subclass.class, 'A'); } @Test public void setFinalInstanceFields() { Subclass obj = new Subclass(); Deencapsulation.setField(obj, "INITIAL_VALUE", 123); Deencapsulation.setField(obj, "initialValue", 123); assertEquals(123, obj.INITIAL_VALUE); assertEquals(123, Deencapsulation.getField(obj, "initialValue")); assertEquals(-1, obj.initialValue); // in this case, the compile-time constant gets embedded in client code } @Test public void attemptToSetAStaticFinalField() { thrown.expectCause(isA(IllegalAccessException.class)); Deencapsulation.setField(Subclass.class, "constantField", 54); } }
[ "rliesenfeld@gmail.com" ]
rliesenfeld@gmail.com
c5b42ccece879c83b2f6dd544f328ee270c3d06f
a04cbcde2edf0ab722bc977d399aa8b0e1f2282e
/src/com/honda/displayaudio/system/traffic/RdsGroup.java
8ebd8511118dc58a223bed1304185f31e9b3c704
[ "LicenseRef-scancode-unicode", "Apache-2.0" ]
permissive
xmutzlq/trunk
669f887d95ed2795af8ae93307dd46a19a32dbcd
0fa686e9fd0fed9e9213ee41be4eab5ff0f9bc59
refs/heads/master
2021-01-21T02:41:59.367187
2015-01-20T05:03:18
2015-01-20T05:03:18
29,511,844
1
0
null
null
null
null
UTF-8
Java
false
false
2,761
java
package com.honda.displayaudio.system.traffic; import android.os.Parcel; import android.os.Parcelable; public class RdsGroup implements Parcelable { private int mBlockA; // Block A of the group private int mBlockB; // Block B of the group private int mBlockC; // Block C of the group private int mBlockD; // Block D of the group private int mCorrectedErrorCount; // Number of corrected errors in this group private int mUncorrectedErrorCount; // Number of uncorrected errors in this group public static final Parcelable.Creator<RdsGroup> CREATOR = new Parcelable.Creator<RdsGroup>() { @Override public RdsGroup createFromParcel(Parcel source) { return new RdsGroup(source); } @Override public RdsGroup[] newArray(int size) { return new RdsGroup[size]; } }; public int getmBlockA() { return mBlockA; } public void setmBlockA(int mBlockA) { this.mBlockA = mBlockA; } public int getmBlockB() { return mBlockB; } public void setmBlockB(int mBlockB) { this.mBlockB = mBlockB; } public int getmBlockC() { return mBlockC; } public void setmBlockC(int mBlockC) { this.mBlockC = mBlockC; } public int getmBlockD() { return mBlockD; } public void setmBlockD(int mBlockD) { this.mBlockD = mBlockD; } public int getmCorrectedErrorCount() { return mCorrectedErrorCount; } public void setmCorrectedErrorCount(int mCorrectedErrorCount) { this.mCorrectedErrorCount = mCorrectedErrorCount; } public int getmUncorrectedErrorCount() { return mUncorrectedErrorCount; } public void setmUncorrectedErrorCount(int mUncorrectedErrorCount) { this.mUncorrectedErrorCount = mUncorrectedErrorCount; } private RdsGroup(Parcel source) { readFromParcel(source); } /**************************************************************************** * readFromParcel(Parcel source) * ****************************************************************************/ public void readFromParcel(Parcel source) { mBlockA = source.readInt(); mBlockB = source.readInt(); mBlockC = source.readInt(); mBlockD = source.readInt(); mCorrectedErrorCount = source.readInt(); mUncorrectedErrorCount = source.readInt(); } @Override public int describeContents() { return 0; } /**************************************************************************** * writeToParcel(Parcel dest, int flags) * ****************************************************************************/ @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(mBlockA); dest.writeInt(mBlockB); dest.writeInt(mBlockC); dest.writeInt(mBlockD); dest.writeInt(mCorrectedErrorCount); dest.writeInt(mUncorrectedErrorCount); } }
[ "380233376@qq.com" ]
380233376@qq.com
cf722685acfa375264acf5b2047ab860232b6f19
40b01754865ee47887da586388e132682b8e6c62
/src/number_18_treemaxvalue/FindMaxValueTest.java
32eb71e24bbbafbdce5aa7a3e080696cd06b86eb
[]
no_license
KumasakaPanos/data-structures-and-algorithms-java
e49671a12f710f05563b96998a38d2b566efbd60
79429a959b50a6921c2f393da5f560f1fb279c00
refs/heads/master
2021-09-22T22:33:27.805399
2018-09-18T05:19:50
2018-09-18T05:19:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
851
java
package number_18_treemaxvalue; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; class FindMaxValueTest { @Test void findMaxValueNormal() { BinaryTree testTree = new BinaryTree(); testTree.add(4); testTree.add(2); testTree.add(10); testTree.add(1); testTree.add(3); testTree.add(7); testTree.add(11); assertEquals(11,FindMaxValue.findMaxValue(testTree)); } @Test void findMaxValueNullRoot() { BinaryTree testTree = new BinaryTree(); assertEquals(Integer.MIN_VALUE,FindMaxValue.findMaxValue(testTree)); } @Test void findMaxValueOnlyRoot() { BinaryTree testTree = new BinaryTree(); testTree.add(9001); assertEquals(9001,FindMaxValue.findMaxValue(testTree)); } }
[ "user@Gurren.gachi.club" ]
user@Gurren.gachi.club
8962e296f63cdbb71cc08f094c0f46201bd2cd34
2e3bb422d654a2feea7b10fcc79e4919a95a4f40
/BallysBLL/src/main/java/pkgPokerEnum/eGame.java
e0d3e802f713fea1410e7be64e1fd71aebcbde65
[]
no_license
mhub1/Lab-4
33b0b5fe5172791d26a968005dc7c6d6ff7fd090
b820a850a30cbe036e30db88d5c36cc6cf9f0dac
refs/heads/master
2021-01-19T20:51:23.547272
2017-04-19T03:13:41
2017-04-19T03:13:41
88,569,110
0
1
null
null
null
null
UTF-8
Java
false
false
1,621
java
package pkgPokerEnum; import java.util.HashMap; import java.util.Map; public enum eGame { FiveStud(1, false) { @Override public String toString() { return "Five Card Stud"; } }, FiveStudOneJoker(2, true) { @Override public String toString() { return "Five Card Stud, One Joker"; } }, FiveStudTwoJoker(3, false) { @Override public String toString() { return "Five Card Stud, Two Jokers"; } }, TexasHoldEm(4, false) { @Override public String toString() { return "Texas Hold'em"; } }, Omaha(5, false) { @Override public String toString() { return "Omaha"; } }, DeucesWild(6, false) { @Override public String toString() { return "Deuces Wild"; } }, AcesAndEights(7, false) { @Override public String toString() { return "Aces and Eights"; } }, SevenDraw(8, false) { @Override public String toString() { return "Seven Card Draw"; } }, SuperOmaha(9, false) { @Override public String toString() { return "Super Omaha"; } } ; private int gameNbr; private boolean bDefault = false; private static Map<Integer, eGame> map = new HashMap<Integer, eGame>(); static { for (eGame game : eGame.values()) { map.put(game.gameNbr, game); } } public static eGame getGame(int gameNbr) { return map.get(gameNbr); } private eGame(final int gameNbr, boolean bDefault){ this.gameNbr = gameNbr; this.bDefault = bDefault; } public int getGame(){ return gameNbr; } public boolean getDefault(){ return this.bDefault; } }
[ "tstbag@verizon.net" ]
tstbag@verizon.net
f0eeba09c2477734ba5566466c3adc486819ce10
2e0437a06361bd9fc8c5533814726ba5f89bf03c
/src/main/java/br/com/lojavirtual/lojavirtual/reources/exeption/ResourceExeptionHandler.java
3e759e6fd1ea68512db1a18a927685f2b23b3c9b
[]
no_license
messiasfernandes/lojavirtualmc
d25f8464ec58efba19512c8ae1b381790d12d22e
e9cf332f5de629752023a1a1a7b73a8c27c46fd4
refs/heads/master
2022-11-27T19:51:31.281667
2020-08-14T17:55:42
2020-08-14T17:55:42
286,791,621
0
0
null
null
null
null
UTF-8
Java
false
false
876
java
package br.com.lojavirtual.lojavirtual.reources.exeption; import javax.servlet.http.HttpServletResponse; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import br.com.lojavirtual.lojavirtual.service.exeptions.*; @ControllerAdvice public class ResourceExeptionHandler { @ExceptionHandler(ObejtonaoEncontroadoException.class) public ResponseEntity<StandertmsgError >ObjetonaoEncontrado(ObejtonaoEncontroadoException e, HttpServletResponse response){ StandertmsgError std =new StandertmsgError(); std.setStatus(HttpStatus.NOT_FOUND.value()); std.setMsg(e.getMessage()); std.setTimestamp( System.currentTimeMillis()); return ResponseEntity.status(HttpStatus.NOT_FOUND).body(std); } }
[ "messiasfernandes@gmail.com" ]
messiasfernandes@gmail.com
414e072820e32578af11cbb86c420ac93aebf023
fa816eae7aaefd41a9f7bbfdb168e3c0709394d5
/ProCat-backend/src/main/java/proCat/service/RentStationService.java
52b65c011e3aa500381292ea0b85b6f154ba0bf9
[ "MIT" ]
permissive
MikrasovP/ProCat
6800222fee479a2cbafbed023cec297991f93a75
f961ff0fc4b9b41fe14d560639a7a22b518117b9
refs/heads/main
2023-06-02T00:01:28.836605
2021-06-21T18:10:54
2021-06-21T18:10:54
343,069,697
0
0
MIT
2021-06-21T18:10:54
2021-02-28T09:49:32
Kotlin
UTF-8
Java
false
false
585
java
package proCat.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import proCat.entity.RentStation; import proCat.repository.RentStationRepository; import java.util.List; @Service public class RentStationService { private final RentStationRepository stationRepository; @Autowired public RentStationService(RentStationRepository stationRepository) { this.stationRepository = stationRepository; } public List<RentStation> findAll() { return stationRepository.findAll(); } }
[ "sakharov487@mail.ru" ]
sakharov487@mail.ru
c9d1c85c72804c9a134653d43a1d5b424c169b1a
74c0d85417dccd0403ae0ea4662e06743ef639c2
/DigitalSignalProcessing/src/test/java/PolynomialApproximatorTest.java
7d5653fc9bd243406f572dc41e01f1eb955aba46
[]
no_license
TihiyTi/HeartLive
32b146f5276e47826c3e05e253402192cfd00e82
d17adff821070e5ec5ffcd0b66d30e46c1e1671f
refs/heads/master
2016-09-09T23:02:14.073594
2015-05-26T05:22:02
2015-05-26T05:22:02
5,828,532
1
0
null
null
null
null
UTF-8
Java
false
false
4,969
java
import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class PolynomialApproximatorTest { public static void main(String[] args) { List<Double> list1 = Arrays.asList(0., 0., 0., 0., 3.6, 5.4, 5.4, 7.2, 7.2); List<Double> list2 = Arrays.asList(1.77, 3.54, 3.54, 3.54, 5.31, 7.08, 10.62, 12.39, 15.93); List<Double> list3 = Arrays.asList(0., 1.75, 1.75, 3.5, 7., 8.75, 10.5, 12.25, 14.2); List<Double> list4 = Arrays.asList(-1.75, -1.75, 0., 1.775, 3.5, 5.25, 8.75, 10.5, 12.25); List<Double> list5 = Arrays.asList(1.71, 3.42, 5.13, 6.84, 8.55, 10.26, 11.97, 11.97, 13.68); List<Double> listOfArgs = new ArrayList<Double>(); List<Double> listOfApproxArgs = new ArrayList<Double>(); // int i = 0; // for (Double ignored : list1) { // for(int j = 0; j < 10; j++){ // if(i!= list1.size() -1){ // listOfApproxArgs.add((double) i+j/10.0); // } // } // listOfArgs.add((double) i++); // } for (int k = 0; k < list1.size(); k++) { listOfApproxArgs.add((double) k); listOfArgs.add((double) k); } PolynomialApproximator approximator = new PolynomialApproximator(); // approximator.approxKoef(list1, 7); // System.out.println(approximator.getApproxSignal(list1, 7).toString()); System.out.println("Signal 1"); // System.out.println(approximator.getApproxSignal(list1, listOfApproxArgs, 5).toString()); approximator.getApproxSignal(list1, 5, 5).forEach(e -> System.out.printf("%.1f ", e)); System.out.println(); // System.out.println(approximator.getApproxSignal(list1, 5, 5).toString()); // SignalViewCreator.createSignalView( // Arrays.asList(list1, approximator.getApproxSignal(list1, listOfApproxArgs, 3), approximator.getApproxSignal(list1, listOfApproxArgs, 4), approximator.getApproxSignal(list1, listOfApproxArgs, 5)), // Arrays.asList(listOfArgs, listOfApproxArgs, listOfApproxArgs, listOfApproxArgs)); System.out.println("Signal 2"); // System.out.println(approximator.getApproxSignal(list2, listOfApproxArgs, 4).toString()); approximator.getApproxSignal(list2, 5, 4).forEach(e -> System.out.printf("%.1f ", e)); System.out.println(); // System.out.println(approximator.getApproxSignal(list2, 5, 4).toString()); // SignalViewCreator.createSignalView( // Arrays.asList(list2, approximator.getApproxSignal(list2, listOfApproxArgs, 3),approximator.getApproxSignal(list2, listOfApproxArgs, 4),approximator.getApproxSignal(list2, listOfApproxArgs, 5)), // Arrays.asList(listOfArgs, listOfApproxArgs, listOfApproxArgs, listOfApproxArgs)); System.out.println("Signal 3"); // System.out.println(approximator.getApproxSignal(list3, listOfApproxArgs, 5).toString()); approximator.getApproxSignal(list3, 5, 5).forEach(e -> System.out.printf("%.1f ", e)); System.out.println(); // System.out.println(approximator.getApproxSignal(list3, 5, 5).toString()); // SignalViewCreator.createSignalView( // Arrays.asList(list3, approximator.getApproxSignal(list3, listOfApproxArgs, 3),approximator.getApproxSignal(list3, listOfApproxArgs, 4),approximator.getApproxSignal(list3, listOfApproxArgs, 5)), // Arrays.asList(listOfArgs, listOfApproxArgs, listOfApproxArgs, listOfApproxArgs)); System.out.println("Signal 4"); // System.out.println(approximator.getApproxSignal(list4, listOfApproxArgs, 3).toString()); approximator.getApproxSignal(list4, 5, 3).forEach(e -> System.out.printf("%.1f ", e)); System.out.println(); // System.out.println(approximator.getApproxSignal(list4, 5, 3).toString()); // SignalViewCreator.createSignalView( // Arrays.asList(list4, approximator.getApproxSignal(list4, listOfApproxArgs, 3),approximator.getApproxSignal(list4, listOfApproxArgs, 4),approximator.getApproxSignal(list4, listOfApproxArgs, 5)), // Arrays.asList(listOfArgs, listOfApproxArgs, listOfApproxArgs, listOfApproxArgs)); System.out.println("Signal 5"); // System.out.println(approximator.getApproxSignal(list5, listOfApproxArgs, 5).toString()); approximator.getApproxSignal(list5, 5, 5).forEach(e -> System.out.printf("%.1f ", e)); System.out.println(); // System.out.println(approximator.getApproxSignal(list5, 5, 5).toString()); // SignalViewCreator.createSignalView( // Arrays.asList(list5, approximator.getApproxSignal(list5, listOfApproxArgs, 3),approximator.getApproxSignal(list5, listOfApproxArgs, 4),approximator.getApproxSignal(list5, listOfApproxArgs, 5)), // Arrays.asList(listOfArgs, listOfApproxArgs, listOfApproxArgs, listOfApproxArgs)); } }
[ "tihiy-ti@mail.ru" ]
tihiy-ti@mail.ru
88cb15dca161c53e26c8a2dc103403ea28f47e1b
c82ef3b93352fc0dfad1e009da78c5c167c3efd0
/src/main/java/com/alchemi/health/Health.java
89fbe303af3da8679b2e1e20959005180d910be8
[]
no_license
Alchemi1963/Health-Indicator
f80008a024856e3915e5cd518ec344283930afeb
b80fec172eb0a1f4cd20a6998e323c1eb47f1dad
refs/heads/master
2020-03-25T00:42:03.752595
2018-11-20T13:16:08
2018-11-20T13:16:08
143,200,808
0
0
null
null
null
null
UTF-8
Java
false
false
2,345
java
package com.alchemi.health; import java.math.RoundingMode; import java.text.DecimalFormat; import com.alchemi.health.client.key.KeyBindings; import com.alchemi.health.object.GUIRegistry; import com.alchemi.health.object.event.Events; import com.alchemi.health.object.gui.indicators.ClassicGUI; import com.alchemi.health.object.gui.indicators.DefaultGUI; import com.alchemi.health.object.gui.indicators.DoctorWhoGUI; import com.alchemi.health.object.gui.indicators.TransparentGUI; import com.alchemi.health.proxy.CommonProxy; import net.minecraft.client.Minecraft; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.config.Config.Type; import net.minecraftforge.common.config.ConfigManager; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; @Mod(modid = Reference.MOD_ID, name = Reference.NAME, version = Reference.VERSION, acceptedMinecraftVersions = Reference.ACCEPTED_MC, canBeDeactivated = true) public class Health { @Instance public static Health instance; public static Minecraft mc; public static GUIRegistry gui_reg = new GUIRegistry(); public static DecimalFormat df = new DecimalFormat("#.#"); @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS) public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent e) { MinecraftForge.EVENT_BUS.register(this); mc = Minecraft.getMinecraft(); df.setRoundingMode(RoundingMode.CEILING); } @EventHandler public void init(FMLInitializationEvent e) { KeyBindings.init(); gui_reg.register(DefaultGUI.class, "gui.default"); gui_reg.register(TransparentGUI.class, "gui.transparent"); gui_reg.register(ClassicGUI.class, "gui.classic"); gui_reg.register(DoctorWhoGUI.class, "gui.doctor_who"); ConfigManager.sync(Reference.MOD_ID, Type.INSTANCE); } @EventHandler public void postInit(FMLPostInitializationEvent e) { MinecraftForge.EVENT_BUS.register(new Events()); } }
[ "misha.smit@xs4all.nl" ]
misha.smit@xs4all.nl
b8dcf5b3db6c7741796019cdd90a81aafdd8f8a6
abf65d1c98822b65317ab1c5b8152ebcfe505d1a
/library/src/main/java/xiaoliang/library/algorithm/GroupUtil.java
7c857d93982eae560c2b021a82f1070b1c7b717f
[]
no_license
Mr-XiaoLiang/LAnimation
d304fd40830abff93b2f2201d75fcf00a2bd804f
561224505433437774f0174fca32aa8116b2720c
refs/heads/master
2020-08-05T06:30:14.764883
2016-09-11T08:26:56
2016-09-11T08:26:56
67,011,824
0
2
null
null
null
null
UTF-8
Java
false
false
7,105
java
package xiaoliang.library.algorithm; import android.app.Activity; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.RelativeLayout; import java.util.HashMap; /** * Created by LiuJ on 2016/9/8. * 一个容器工具类 * 用于简单的创建及管理容器或图层 */ public class GroupUtil { private static HashMap<String,LinearLayout> linearLayoutHashMap = new HashMap<>(); private static HashMap<String,FrameLayout> frameLayoutHashMap = new HashMap<>(); private static HashMap<String,RelativeLayout> relativeLayoutHashMap = new HashMap<>(); /** * 添加View到动画层 * @param vg 容器 * @param view View本身 * @param location 坐标 * @return 被添加的View */ public static View addViewToAnimLayout(LinearLayout vg, final View view, int[] location) { int x = location[0]; int y = location[1]; cleanView(view); vg.addView(view); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); lp.leftMargin = x; lp.topMargin = y; view.setLayoutParams(lp); return view; } /** * 添加View到动画层 * @param vg 容器 * @param view View本身 * @param location 坐标 * @return 被添加的View */ public static View addViewToAnimLayout(FrameLayout vg, final View view, int[] location) { int x = location[0]; int y = location[1]; cleanView(view); vg.addView(view); FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams( FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT); lp.leftMargin = x; lp.topMargin = y; view.setLayoutParams(lp); return view; } /** * 添加View到动画层 * @param vg 容器 * @param view View本身 * @param location 坐标 * @return 被添加的View */ public static View addViewToAnimLayout(RelativeLayout vg, final View view, int[] location) { int x = location[0]; int y = location[1]; cleanView(view); vg.addView(view); RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); lp.leftMargin = x; lp.topMargin = y; view.setLayoutParams(lp); return view; } /** * 清理干净一个View * 从一个从属关系中剔除出来 * @param view 待清理的View */ public static void cleanView(View view){ if(view.getParent()!=null){ //如果View已经有了归宿,则把他从原有归属中剔除,然后加入现有归属 view.getParent().recomputeViewAttributes(view); } } /** * 获取一个独立动画层的LinearLayout * 这个方法是同步的,保证了对象的唯一性 * 并且使动画层可以重复利用 * 获取对象的key是Activity的句柄 * @param activity 页面对象 * @return 容器 */ public static synchronized LinearLayout getAnimLinearLayout(Activity activity){ if(linearLayoutHashMap.get(activity.toString())==null){ linearLayoutHashMap.put(activity.toString(),createAnimLinearLayout(activity)); } return linearLayoutHashMap.get(activity.toString()); } /** * 获取一个独立动画层的RelativeLayout * 这个方法是同步的,保证了对象的唯一性 * 并且使动画层可以重复利用 * 获取对象的key是Activity的句柄 * @param activity 页面对象 * @return 容器 */ public static synchronized FrameLayout getAnimFrameLayout(Activity activity){ if(frameLayoutHashMap.get(activity.toString())==null){ frameLayoutHashMap.put(activity.toString(),createAnimFrameLayout(activity)); } return frameLayoutHashMap.get(activity.toString()); } /** * 获取一个独立动画层的RelativeLayout * 这个方法是同步的,保证了对象的唯一性 * 并且使动画层可以重复利用 * 获取对象的key是Activity的句柄 * @param activity 页面对象 * @return 容器 */ public static synchronized RelativeLayout getAnimRelativeLayout(Activity activity){ if(relativeLayoutHashMap.get(activity.toString())==null){ relativeLayoutHashMap.put(activity.toString(),createAnimRelativeLayout(activity)); } return relativeLayoutHashMap.get(activity.toString()); } /** * 屏幕上创建一个透明的动画层 * 本方法创建的是一个新的LinearLayout * @param activity 页面对象 * @return 容器 */ public static LinearLayout createAnimLinearLayout(Activity activity) { ViewGroup rootView = (ViewGroup) activity.getWindow().getDecorView(); LinearLayout animLayout = new LinearLayout(activity); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); animLayout.setLayoutParams(lp); animLayout.setBackgroundResource(android.R.color.transparent); rootView.addView(animLayout); return animLayout; } /** * 屏幕上创建一个透明的动画层 * 本方法创建的是一个新的FrameLayout * @param activity 页面对象 * @return 容器 */ public static FrameLayout createAnimFrameLayout(Activity activity) { ViewGroup rootView = (ViewGroup) activity.getWindow().getDecorView(); FrameLayout animLayout = new FrameLayout(activity); FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); animLayout.setLayoutParams(lp); animLayout.setBackgroundResource(android.R.color.transparent); rootView.addView(animLayout); return animLayout; } /** * 屏幕上创建一个透明的动画层 * 本方法创建的是一个新的RelativeLayout * @param activity 页面对象 * @return 容器 */ public static RelativeLayout createAnimRelativeLayout(Activity activity) { ViewGroup rootView = (ViewGroup) activity.getWindow().getDecorView(); RelativeLayout animLayout = new RelativeLayout(activity); RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); animLayout.setLayoutParams(lp); animLayout.setBackgroundResource(android.R.color.transparent); rootView.addView(animLayout); return animLayout; } }
[ "liujian594@hotmail.com" ]
liujian594@hotmail.com
d42dbfe9227162f757c8f8fb1194cad25b170de4
62e146b0784f442184d3ed16a07a36cf4389ef77
/app/src/main/java/com/example/management/DocRecyclerItemClickListener.java
56ae3e14e11e3a07c5e3436a21d05fad2bed6946
[]
no_license
JackshyKG/Storage_management
bdacbb942963b3d41cf0c0acd9ee3d8b7764a880
15b16d9ae7e43ab033b2cc30b89e05b0eff2ccd4
refs/heads/master
2022-11-29T06:12:37.755938
2020-08-14T15:13:41
2020-08-14T15:13:41
273,019,115
0
0
null
null
null
null
UTF-8
Java
false
false
1,473
java
package com.example.management; import android.content.Context; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; public class DocRecyclerItemClickListener implements RecyclerView.OnItemTouchListener { private OnItemClickListener listener; private GestureDetector gestureDetector; public interface OnItemClickListener { void onItemClick(View view, int position);} public DocRecyclerItemClickListener(Context context, final OnItemClickListener listener) { this.listener = listener; gestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() { @Override public boolean onSingleTapUp(MotionEvent e) {return true;} }); } @Override public boolean onInterceptTouchEvent(@NonNull RecyclerView rv, @NonNull MotionEvent e) { View childView = rv.findChildViewUnder(e.getX(), e.getY()); if (childView != null && listener != null && gestureDetector.onTouchEvent(e)) { listener.onItemClick(childView, rv.getChildAdapterPosition(childView)); return true; } return false; } @Override public void onTouchEvent(@NonNull RecyclerView rv, @NonNull MotionEvent e) {} @Override public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {} }
[ "jackshykg@gmail.com" ]
jackshykg@gmail.com
f2f89856d435f9def8db85b231e9d5ef35260d67
812bf5d1df56446ab92a9a65c79ba6202b5fc9af
/BroadcastBestPractice/app/src/main/java/com/example/rookie/broadcastbestpractice/MainActivity.java
58e82153154e7df6418c54e56fd0db2fce90a029
[]
no_license
Rookie-liu/AndroidST
7ab3d406a9fb1b4b6b0eb7ee83c08229bac7cf04
b142b0c4babf902486d55c4dadcc63569f2fde16
refs/heads/master
2021-04-15T18:34:22.599966
2018-03-26T07:42:17
2018-03-26T07:42:17
126,788,528
0
0
null
null
null
null
UTF-8
Java
false
false
800
java
package com.example.rookie.broadcastbestpractice; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class MainActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button forceOffline = (Button) findViewById(R.id.force_offline); forceOffline.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent("com.example.bradcastbestpractice.FORCE_OFFLINE"); sendBroadcast(intent); } }); } }
[ "liuyafang@tton.co" ]
liuyafang@tton.co
f99386b10d75307266e8a6563aa02f0c4db78ed7
2766df12ac1812d1d74fbfa94593011ad45bc376
/src/main/java/org/ligson/gitteste/Add.java
2be66d664adcea6e7ede7d01924b6a6af877f9dc
[ "Apache-2.0" ]
permissive
ligson/gittest
908c6a043119491d8161326fe92e50bc28225256
f48aa8c188ee890dc3846399480804b0ac2b1269
refs/heads/master
2020-04-02T07:08:49.427443
2016-06-27T04:31:12
2016-06-27T04:31:12
62,024,146
0
0
null
null
null
null
UTF-8
Java
false
false
192
java
package org.ligson.gitteste; /** * Created by trq on 2016/6/27. */ public class Add { public static void main(String[] args) { System.out.println("add bug fix......."); } }
[ "lijinsheng@e-ling.com.cn" ]
lijinsheng@e-ling.com.cn
2f02e285c04bc1a5534f3579ebb0db4c1f654867
be2a927db5b3970223153ca91dfe79f4393071fa
/java/src/main/java/com/ceph/rados/impl/RadosAsyncImpl.java
ff59062bf355452c88e9b69a6409c5d0a1743e45
[ "Apache-2.0" ]
permissive
tristantarrant/rados-jni
b3f6f20c7ce9203692907cace561dce6313c85d7
5797d9409ff994f758de97eb8d466cb1f567dc97
refs/heads/master
2022-10-30T02:44:43.542347
2020-06-08T12:47:59
2020-06-10T08:42:18
269,344,754
0
0
null
null
null
null
UTF-8
Java
false
false
1,982
java
package com.ceph.rados.impl; import java.nio.ByteBuffer; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; import com.ceph.rados.ASyncWriteOp; import com.ceph.rados.RadosAsync; public class RadosAsyncImpl implements RadosAsync { private final IOCtxImpl ioCtx; public RadosAsyncImpl(IOCtxImpl ioCtx) { this.ioCtx = ioCtx; } @Override public CompletionStage<Void> write(String oid, ByteBuffer buf) { assert buf.isDirect(); CompletableFuture<Void> complete = new CompletableFuture<>(); Native.INSTANCE.aio_write(ioCtx.address, oid, buf, buf.position(), 0, buf.limit() - buf.position(), complete, null); return complete; } @Override public CompletionStage<Void> append(String oid, ByteBuffer buf) { assert buf.isDirect(); CompletableFuture<Void> complete = new CompletableFuture<>(); Native.INSTANCE.aio_append(ioCtx.address, oid, buf, buf.position(), buf.limit() - buf.position(), complete, null); return complete; } @Override public CompletionStage<Void> remove(String oid) { CompletableFuture<Void> complete = new CompletableFuture<>(); Native.INSTANCE.aio_remove(ioCtx.address, oid, complete, null); return complete; } @Override public CompletionStage<Void> read(String oid, ByteBuffer buf) { assert buf.isDirect(); return null; } @Override public CompletionStage<Void> flush() { return null; } @Override public CompletionStage<Void> setXattr(String oid, String name, ByteBuffer buf) { return null; } @Override public CompletionStage<Void> getXattr(String oid, String name, ByteBuffer buf) { return null; } @Override public CompletionStage<Void> rmXattr(String oid, String name) { return null; } @Override public ASyncWriteOp writeOp() { return null; } }
[ "ttarrant@redhat.com" ]
ttarrant@redhat.com
9563f53db0b06a05d5fcea9e409138f4a9fa0be6
001782411d3d0d9e2ad56a3bf14bafaca4cfd172
/app/src/main/java/com/hbdiye/lechuangsmart/Global/CWebSocketHandler.java
5628dbbaf7faf13946b40d24089df297447d4738
[]
no_license
a1019421612/lechuangsmart
92c325f6c06dfa8baf9e1532c935cd14de835bbf
4c8b9f6ac7e4b503e8fc7d34ac9e92d723cfd5fa
refs/heads/master
2020-03-18T11:39:23.143648
2018-09-29T09:27:45
2018-09-29T09:27:45
134,683,969
0
0
null
null
null
null
UTF-8
Java
false
false
654
java
package com.hbdiye.lechuangsmart.Global; import android.content.Intent; import com.hbdiye.lechuangsmart.MyApp; import com.hbdiye.lechuangsmart.activity.LoginActivity; import de.tavendo.autobahn.WebSocketHandler; public class CWebSocketHandler extends WebSocketHandler { @Override public void onTextMessage(String payload) { if (payload.contains("{\"pn\":\"PRTP\"}")) { MyApp.finishAllActivity(); Intent intent = new Intent(MyApp.getContextObject(), LoginActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK ); MyApp.getContextObject().startActivity(intent); } } }
[ "1019421612@qq.com" ]
1019421612@qq.com
edd9ce39a0ae0ecc00cd67cb24af016bd959368b
0c7d6bc2daadab10fd9127ae531bb712f87767e7
/app/src/main/java/com/ainisi/queenmirror/queenmirrorcduan/ui/mine/bean/AliyunPlayAuthBean.java
1232d99f8175519e9f484942af00c86dd9b3204f
[]
no_license
wjcjava/QueenClient
9c7f1d181ce49ac3a05eb2a7e948ae91810e6795
c7f25a5e2351f7ccccc652da4515e3f6bcc501ec
refs/heads/master
2020-04-14T15:32:27.237228
2019-01-03T06:06:49
2019-01-03T06:06:49
163,913,787
0
0
null
null
null
null
UTF-8
Java
false
false
4,743
java
package com.ainisi.queenmirror.queenmirrorcduan.ui.mine.bean; /** * Created by jiangchao on 2018/9/10 下午5:18. */ public class AliyunPlayAuthBean { /** * success : true * errorCode : 0 * msg : 成功 * body : {"playAuth":"eyJTZWN1cml0eVRva2VuIjoiQ0FJUzN3SjFxNkZ0NUIyeWZTaklyNG5sZVBETTJKZHo0SVdSTm1ENWtWVTdTUDUrbGFMUGx6ejJJSGhKZVhOdkJPMGV0ZjQrbVdCWTdQY1lsck1xRWM0Y0ZCR1ZNWklwczhzTHExcjRKcExGc3QySjZyOEpqc1Y2bCsxc3YxcXBzdlhKYXNEVkVma3VFNVhFTWlJNS8wMGU2TC8rY2lyWVhEN0JHSmFWaUpsaFE4MEtWdzJqRjFSdkQ4dFhJUTBRazYxOUszemRaOW1nTGlidWkzdnhDa1J2MkhCaWptOHR4cW1qL015UTV4MzFpMXYweStCM3dZSHRPY3FjYThCOU1ZMVdUc3Uxdm9oemFyR1Q2Q3BaK2psTStxQVU2cWxZNG1YcnM5cUhFa0ZOd0JpWFNaMjJsT2RpTndoa2ZLTTNOcmRacGZ6bjc1MUN0L2ZVaXA3OHhtUW1YNGdYY1Z5R0dOLzZuNU9aUXJ6emI0WmhKZWVsQVJtWGpJRFRiS3VTbWhnL2ZIY1dPRGxOZjljY01YSnFBWFF1TUdxQ2QvTDlwdzJYT2x6NUd2WFZnUHRuaTRBSjVsSHA3TWVNR1YrRGVMeVF5aDBFSWFVN2EwNDQvNWVUWWFwazFNVWFnQUU3LzFvMytZSm1CdCtCL1J0YUttSE9KOWd4eDhTbldLSmtCWEpXVzJqU1ViTnpIdXFEODlSNmhOZ3VoZlZxWjJSWXorU1ZNMGhOZ3U0THhtL0oxUzNhWW93ZkFGNDBhZEMrbnhlRnlIZkt0ejZ2VVVabDk1dWZNdnZ0NVl6ZStDZEdGbWFxaHlVY1pJQmgyTE1ZcU40V2VrSklLWVlseWFkTmxDd1RYY2gxT1E9PSIsIkF1dGhJbmZvIjoie1wiQ2FsbGVyXCI6XCJ2NFRZMzNLTEpEM1JzaVJRTk1vaVJvMS9aQjVjWmVmRGdXZnRsUTRWckJrPVxcclxcblwiLFwiRXhwaXJlVGltZVwiOlwiMjAxOC0wOS0xMFQwOToxODowM1pcIixcIk1lZGlhSWRcIjpcIjZlOGM4ZWU3MTJhZjRjZWVhNjhlY2JkZmZiYjZiZTUzXCIsXCJTaWduYXR1cmVcIjpcInRGUVlpVUtZN20zYllpYTM3blZMQUx3RUFBQT1cIn0iLCJWaWRlb01ldGEiOnsiU3RhdHVzIjoiTm9ybWFsIiwiVmlkZW9JZCI6IjZlOGM4ZWU3MTJhZjRjZWVhNjhlY2JkZmZiYjZiZTUzIiwiVGl0bGUiOiJPSyIsIkNvdmVyVVJMIjoiaHR0cDovL3Yuaml5dWFuZXQuY29tLzZlOGM4ZWU3MTJhZjRjZWVhNjhlY2JkZmZiYjZiZTUzL2NvdmVycy82YTJkMjQzNjk5OTM0NDAxOGJjODUxNjg3NDJiYTQwMi0wMDAwMS5qcGciLCJEdXJhdGlvbiI6Ny44NDl9LCJBY2Nlc3NLZXlJZCI6IlNUUy5OSlAzSng1SFJXR3o0Rkh1VW5EcVJ6Z2R1IiwiUGxheURvbWFpbiI6InYuaml5dWFuZXQuY29tIiwiQWNjZXNzS2V5U2VjcmV0IjoiRXladGNCdHhMVkdSMUxyYmJoWGpISndYdFZpQnp3TTlHZzVyemFaOUI0WlEiLCJSZWdpb24iOiJjbi1zaGFuZ2hhaSIsIkN1c3RvbWVySWQiOjEyOTE5NTk0MTE1NzQyMTF9"} */ private boolean success; private String errorCode; private String msg; private BodyEntity body; public boolean isSuccess() { return success; } public void setSuccess(boolean success) { this.success = success; } public String getErrorCode() { return errorCode; } public void setErrorCode(String errorCode) { this.errorCode = errorCode; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public BodyEntity getBody() { return body; } public void setBody(BodyEntity body) { this.body = body; } public static class BodyEntity { /** * playAuth : eyJTZWN1cml0eVRva2VuIjoiQ0FJUzN3SjFxNkZ0NUIyeWZTaklyNG5sZVBETTJKZHo0SVdSTm1ENWtWVTdTUDUrbGFMUGx6ejJJSGhKZVhOdkJPMGV0ZjQrbVdCWTdQY1lsck1xRWM0Y0ZCR1ZNWklwczhzTHExcjRKcExGc3QySjZyOEpqc1Y2bCsxc3YxcXBzdlhKYXNEVkVma3VFNVhFTWlJNS8wMGU2TC8rY2lyWVhEN0JHSmFWaUpsaFE4MEtWdzJqRjFSdkQ4dFhJUTBRazYxOUszemRaOW1nTGlidWkzdnhDa1J2MkhCaWptOHR4cW1qL015UTV4MzFpMXYweStCM3dZSHRPY3FjYThCOU1ZMVdUc3Uxdm9oemFyR1Q2Q3BaK2psTStxQVU2cWxZNG1YcnM5cUhFa0ZOd0JpWFNaMjJsT2RpTndoa2ZLTTNOcmRacGZ6bjc1MUN0L2ZVaXA3OHhtUW1YNGdYY1Z5R0dOLzZuNU9aUXJ6emI0WmhKZWVsQVJtWGpJRFRiS3VTbWhnL2ZIY1dPRGxOZjljY01YSnFBWFF1TUdxQ2QvTDlwdzJYT2x6NUd2WFZnUHRuaTRBSjVsSHA3TWVNR1YrRGVMeVF5aDBFSWFVN2EwNDQvNWVUWWFwazFNVWFnQUU3LzFvMytZSm1CdCtCL1J0YUttSE9KOWd4eDhTbldLSmtCWEpXVzJqU1ViTnpIdXFEODlSNmhOZ3VoZlZxWjJSWXorU1ZNMGhOZ3U0THhtL0oxUzNhWW93ZkFGNDBhZEMrbnhlRnlIZkt0ejZ2VVVabDk1dWZNdnZ0NVl6ZStDZEdGbWFxaHlVY1pJQmgyTE1ZcU40V2VrSklLWVlseWFkTmxDd1RYY2gxT1E9PSIsIkF1dGhJbmZvIjoie1wiQ2FsbGVyXCI6XCJ2NFRZMzNLTEpEM1JzaVJRTk1vaVJvMS9aQjVjWmVmRGdXZnRsUTRWckJrPVxcclxcblwiLFwiRXhwaXJlVGltZVwiOlwiMjAxOC0wOS0xMFQwOToxODowM1pcIixcIk1lZGlhSWRcIjpcIjZlOGM4ZWU3MTJhZjRjZWVhNjhlY2JkZmZiYjZiZTUzXCIsXCJTaWduYXR1cmVcIjpcInRGUVlpVUtZN20zYllpYTM3blZMQUx3RUFBQT1cIn0iLCJWaWRlb01ldGEiOnsiU3RhdHVzIjoiTm9ybWFsIiwiVmlkZW9JZCI6IjZlOGM4ZWU3MTJhZjRjZWVhNjhlY2JkZmZiYjZiZTUzIiwiVGl0bGUiOiJPSyIsIkNvdmVyVVJMIjoiaHR0cDovL3Yuaml5dWFuZXQuY29tLzZlOGM4ZWU3MTJhZjRjZWVhNjhlY2JkZmZiYjZiZTUzL2NvdmVycy82YTJkMjQzNjk5OTM0NDAxOGJjODUxNjg3NDJiYTQwMi0wMDAwMS5qcGciLCJEdXJhdGlvbiI6Ny44NDl9LCJBY2Nlc3NLZXlJZCI6IlNUUy5OSlAzSng1SFJXR3o0Rkh1VW5EcVJ6Z2R1IiwiUGxheURvbWFpbiI6InYuaml5dWFuZXQuY29tIiwiQWNjZXNzS2V5U2VjcmV0IjoiRXladGNCdHhMVkdSMUxyYmJoWGpISndYdFZpQnp3TTlHZzVyemFaOUI0WlEiLCJSZWdpb24iOiJjbi1zaGFuZ2hhaSIsIkN1c3RvbWVySWQiOjEyOTE5NTk0MTE1NzQyMTF9 */ private String playAuth; public String getPlayAuth() { return playAuth; } public void setPlayAuth(String playAuth) { this.playAuth = playAuth; } } }
[ "2931748796@qq.com" ]
2931748796@qq.com
1126501203919172417a86de2de616eb5bee5cc9
a092410da1b50bb6d6eac585fc68d5c04985b5b8
/app/src/main/java/org/quizGen/shasha/learnspelling/Constants.java
750168185b7cedecaeb7d3a72d0c2575fcccef9e
[ "Apache-2.0" ]
permissive
Teamexe/Quiz-Generator
d37ade7f77e3e4c864502b6983a7ddc15ab76e6d
d4b45a4e2614dd88117a05320e5e86ba8dcd8b7b
refs/heads/master
2021-01-19T21:13:53.305645
2017-10-16T05:57:16
2017-10-16T05:57:16
88,630,388
2
1
null
2017-10-16T05:08:41
2017-04-18T13:49:01
Java
UTF-8
Java
false
false
397
java
package org.quizGen.shasha.learnspelling; /** * @brief Constants used in spell template's simulator relating databases. */ public class Constants { public static final int COL_WORD = 1; public static final int COL_MEANING = 2; public static final int COL_ANSWERED = 3; public static final int COL_ATTEMPTED = 4; public static String XMLFileName = "spelling_content.xml"; }
[ "allblue.shasha@gmail.com" ]
allblue.shasha@gmail.com
9b8774dbb4660f667dedc387a585d2618c773959
5c7158187cddd319fe70a94408d97f48a3aab347
/src/com/chapter_1_1_basicProgramModel/Ex_15_to_21_recursive.java
6adcbcad80da96ea429b933658ee414e1b26e09f
[]
no_license
Why-Amazing/MyAlgorithms
2985c68c0cbf7ee2c41da76eb8652ada42bec590
aa8e8d6257e7a0c185dc49cf032986ba5e9d926f
refs/heads/master
2021-05-11T00:59:59.373375
2018-03-04T08:06:10
2018-03-04T08:06:10
118,317,038
0
0
null
null
null
null
UTF-8
Java
false
false
6,375
java
package com.chapter_1_1_basicProgramModel; import edu.princeton.cs.algs4.StdIn; import edu.princeton.cs.algs4.StdOut; import org.junit.Test; //递归 public class Ex_15_to_21_recursive { /* * 1.1.15 编写一个静态方法 histogram(),接受一个整型数组 a[] 和一个整数 M 为参数并返回一个大小为 M 的数组, * 其中第 i 个元素的值为整数 i 在参数数组中出现的次数。如果 a[] 中的值均在 0 到 M-1之间,返回数组中所有元素之和应该和 a.length 相等。 */ @Test public void Ex_15_jianShu() { int[] arr = {2, 1, 4, 3, 2, 3, 1, 1, 6, 8}; int M = 10; int[] newArr = new int[M]; int m = 0; int n = 0; for (int i = 0; i < M; i++) { for (int j = 0; j < arr.length; j++) { if (arr[j] == i) m++; newArr[i] = m; } m = 0; } for (int i = 0; i < M; i++) { n += newArr[i]; } System.out.println(n == newArr.length); for (int i = 0; i < newArr.length; i++) { System.out.print(newArr[i] + " "); } } @Test public void Ex_15_github() { int[] arr = {2, 1, 4, 3, 2, 3, 1, 1, 6, 8}; int M = 10; int[] newArr = new int[M]; for (int i = 0; i < arr.length; i++) { if (arr[i] < M) newArr[arr[i]]++; } for (int i = 0; i < newArr.length; i++) System.out.println(newArr[i]); } public static String exR1(int n) { if (n <= 0) return ""; return exR1(n - 3) + n + exR1(n - 2) + n; } @Test public void Ex_16() { exR1(6); } /* 1.1.18 请看以下递归函数: mystery(2, 25) 和 mystery(3, 11) 的返回值是多少?给定正整数 a 和 b, mystery(a,b)计算的结果是什么?将代码中的 + 替换为 * 并将 return 0 改为 return 1, 然后回答相同的问题。 */ //这道题目考了一个思想,数据和操作,即第一个参数是数据,第二个参数是操作的。这在实际编程中也是一种解耦的思想 public static int mystery(int a, int b) { if (b == 0) return 0; if (b % 2 == 0) return mystery(a + a, b / 2); return mystery(a + a, b / 2) + a; } } /* 斐波那契数列 计算机用这段程序在一个小时之内能够得到 F(N) 结果的最大 N 值是多少? 开发 F(N) 的一个更好的实现,用数组保存已经计算过的值。 */ class Fibonacci_A { public static long F(int N) { if (N == 0) return 0; if (N == 1) return 1; return F(N - 1) + F(N - 2); } public static void main(String[] args) { for (int N = 0; N < 100; N++) StdOut.println(N + " " + F(N)); } } /*具体能算到多少不知道,部分结果如下: 0 0 1 1 2 1 3 2 4 3 5 5 6 8 7 13 8 21 9 34 10 55 11 89 12 144 13 233 14 377 15 610 16 987 17 1597 18 2584 19 4181 20 6765 21 10946 22 17711 23 28657 24 46368 25 75025 26 121393 27 196418 28 317811 29 514229 30 832040 31 1346269 32 2178309 33 3524578 34 5702887 35 9227465 36 14930352 37 24157817 38 39088169 39 63245986 40 102334155 41 165580141 42 267914296 43 433494437 44 701408733 45 1134903170 46 1836311903 47 2971215073 48 4807526976 49 7778742049 50 12586269025 //这是计算了5分钟左右能计算到第50个,越往后越慢,因为使用了递归的方式, 每次的时间都是所有之前的时间的总和 */ //改良版本: class Fibonacci_B { public static long F1(int N) { if (N == 0) return 0; if (N == 1) return 1; long f = 0; long g = 1; for (int i = 0; i < N ; i++) { f = f + g; g = f - g; } return f; } public static void main(String[] args) { for (int N = 0; N < 100; N++) System.out.println(N + " " + F1(N)); } } /**需要注意的是,long类型大小限制,后面就会出现负数 81 37889062373143906 82 61305790721611591 83 99194853094755497 84 160500643816367088 85 259695496911122585 86 420196140727489673 87 679891637638612258 88 1100087778366101931 89 1779979416004714189 90 2880067194370816120 91 4660046610375530309 92 7540113804746346429 93 -6246583658587674878 94 1293530146158671551 95 -4953053512429003327 96 -3659523366270331776 97 -8612576878699335103 98 6174643828739884737 99 -2437933049959450366 所以需要替换成其他类型比如BigInteger */ /* 1.1.20 编写一个递归的静态方法计算 ln(N!) 的值。 分析 背景知识 ln是数学中的对数符号。 数学领域自然对数用ln表示,前一个字母是小写的L(l),不是大写的i(I)。 ln 即自然对数 ln=loge a。 以e为底数的对数通常用于ln,而且e还是一个超越数。 N!是N的阶乘 对数的运算法则:两个正数的积的对数,等于同一底数的这两个数的对数的和,即 题目中我们使用归纳法来解决问题 令f(N)= ln(N!) f(1) = ln(1!) = 0 f(2) = ln(2!) = ln(2 * 1) = ln2 + ln1 f(3) = ln(3!) = ln(3 * 2 * 1) = ln3 + ln2 + ln1 = f2 + ln3 f(4) = ln(4!) = ln(4 * 3 * 2 * 1) = ln4 + ln3 + ln2 + ln1 = f(3) + ln4 f(5) = ln(5!) = ln(5 * 4 * 3 * 2 * 1) = ln5 + ln4 + ln3 + ln2 + ln1 = f(4) + ln5 ... f(n) = f(n-1) +lnn */ class Ex_20{ public static double logarithmic(int n){ if(n == 0) return 0; if(n == 1) return 0; return logarithmic(n - 1) + Math.log(n); } } /** * 1.1.21 编写一段程序,从标准输入按行读取数据, * 其中每行都包含一个名字和两个整数。 * 然后用printf() 打印一张表格, * 每行的若干列数据包括名字、两个整数和第一个整数除以第二个整数 的结果, * 精确到小数点后三位。 * 可以用这种程序将棒球球手的击球命中率或者学生的考试分数 制成表格。 */ class Ex_21{ public static void main(String[] args) { int M = 3; int index = 0; String[] strs = new String[M]; while (index < M) strs[index++] = StdIn.readLine(); for (int i = 0; i < strs.length; ++i) { String[] arr = strs[i].split("\\s+"); double temp = Double.parseDouble(arr[1]) / Double.parseDouble(arr[2]); StdOut.printf("%-10s %-10s %-10s %-13.3f\n", arr[0], arr[1], arr[2], temp); } } }
[ "wocwacc@outlook.com" ]
wocwacc@outlook.com
fe15ef985f2dba289a2b3947ad25b51f60c4d75c
8aeb5e5910ad6fbb5873b6647e9b68aacfa67235
/src/main/java/es/fantasymanager/scheduler/jobs/ScheduleJobBuilder.java
ad14887205da328a3f0f1bd7928fd15bafdabfa7
[]
no_license
rpberenguer/seleniumParser
229a38ca9d845bb10a260973eba0448071fc6704
36114b201029685c0ee091da70f80daf2d67556e
refs/heads/master
2021-12-26T10:50:55.283978
2021-10-25T18:04:09
2021-10-25T18:04:09
137,947,282
0
0
null
2021-10-09T16:44:45
2018-06-19T21:25:50
Java
UTF-8
Java
false
false
1,718
java
package es.fantasymanager.scheduler.jobs; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.quartz.CronScheduleBuilder; import org.quartz.JobBuilder; import org.quartz.JobDetail; import org.quartz.SchedulerException; import org.quartz.Trigger; import org.quartz.TriggerBuilder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.quartz.SchedulerFactoryBean; import org.springframework.stereotype.Component; import es.fantasymanager.data.business.SchedulerTaskData; import es.fantasymanager.data.enums.JobsEnum; @Component public class ScheduleJobBuilder { @Autowired private SchedulerFactoryBean schedulerFactory; public void schedule(SchedulerTaskData task) throws SchedulerException { Map<JobDetail, Set<? extends Trigger>> jobs = new HashMap<>(); JobsEnum jobEnum = task.getJobEnum(); JobDetail job = JobBuilder.newJob(jobEnum.getClazz()) .withIdentity(task.getUuid().toString(), jobEnum.getName()) .withDescription(jobEnum.getDescription()) .usingJobData(task.getJobDataMap()) .storeDurably(true) .build(); Trigger trigger = TriggerBuilder.newTrigger() .forJob(job) .withIdentity(job.getKey().getName(), jobEnum.getName()) .withSchedule(CronScheduleBuilder.cronSchedule(task.getCronExpression())) .build(); HashSet<Trigger> triggers = new HashSet<>(); triggers.add(trigger); jobs.put(job, triggers); // When the task has id it is an update. Otherwise it is new. boolean replaceJobs = null != task.getScheduledTaskId(); this.schedulerFactory.getScheduler().scheduleJobs(jobs, replaceJobs); } }
[ "raul@DESKTOP-Q9LPCRE" ]
raul@DESKTOP-Q9LPCRE
80355e7c1322e6a9a5399daf8cf85d2efebdabed
f753380db31a1b3fa6bd8733093401d8291afded
/app/src/main/java/com/example/lenove/zhihunews/util/recyclerview/SlideInItemAnimator.java
81c60553c6685b056a76acce5e6e05e9418b6ef9
[]
no_license
syg-todo/ZhiHuNews
e8f39f0d7f7fbf6179293f847f9097f04f0023ec
5bfe8de94192ba9470984a053278192218b6d0f1
refs/heads/master
2021-09-01T13:35:11.002632
2017-09-24T03:43:12
2017-09-24T03:43:16
104,615,892
0
0
null
null
null
null
UTF-8
Java
false
false
452
java
package com.example.lenove.zhihunews.util.recyclerview; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.RecyclerView; import android.view.Gravity; import android.widget.Button; /** * Created by lenove on 2017/8/30. */ public class SlideInItemAnimator extends DefaultItemAnimator { @Override public boolean animateAdd(RecyclerView.ViewHolder holder) { return super.animateAdd(holder); } }
[ "417173927@qq.com" ]
417173927@qq.com
688e6c147e4ed6754222a24490e4732e868509eb
9cfa20f826fc1e0042ebd4f11563f7abf5e3ec4d
/rackspace/src/test/java/org/jclouds/rackspace/cloudfiles/functions/ParseObjectInfoFromHeadersTest.java
461ef57f47e637916dc14ba9c87520147309f384
[]
no_license
rimuhosting/jclouds
e56e9c7dd83c1c2bd41d78f47faede73e3033823
f488c9f8c3072599fe4c6f015ea724d663dc5998
refs/heads/master
2022-07-30T11:47:18.202365
2009-11-25T00:55:02
2009-11-25T00:55:02
376,723
0
0
null
2022-07-06T19:59:46
2009-11-18T02:38:34
Java
UTF-8
Java
false
false
3,064
java
/** * * Copyright (C) 2009 Cloud Conscious, LLC. <info@cloudconscious.com> * * ==================================================================== * 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.jclouds.rackspace.cloudfiles.functions; import static org.easymock.EasyMock.expect; import static org.easymock.classextension.EasyMock.createMock; import static org.easymock.classextension.EasyMock.replay; import static org.testng.Assert.assertNotNull; import java.net.URI; import org.jclouds.blobstore.reference.BlobStoreConstants; import org.jclouds.http.HttpResponse; import org.jclouds.http.functions.config.ParserModule; import org.jclouds.rackspace.cloudfiles.domain.MutableObjectInfoWithMetadata; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.testng.annotations.Test; import com.google.inject.AbstractModule; import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.util.Jsr330; /** * Tests behavior of {@code ParseContainerListFromJsonResponse} * * @author Adrian Cole */ @Test(groups = "unit", testName = "cloudfiles.ParseObjectInfoFromHeadersTest") public class ParseObjectInfoFromHeadersTest { Injector i = Guice.createInjector(new ParserModule(), new AbstractModule() { @Override protected void configure() { bindConstant().annotatedWith( Jsr330.named(BlobStoreConstants.PROPERTY_USER_METADATA_PREFIX)).to("sdf"); } }); public void testEtagCaseIssue() { ParseObjectInfoFromHeaders parser = i.getInstance(ParseObjectInfoFromHeaders.class); GeneratedHttpRequest<?> request = createMock(GeneratedHttpRequest.class); expect(request.getEndpoint()).andReturn(URI.create("http://localhost/test")).atLeastOnce(); replay(request); parser.setContext(request); HttpResponse response = new HttpResponse(); response.getHeaders().put("Content-Type", "text/plain"); response.getHeaders().put("Last-Modified", "Fri, 12 Jun 2007 13:40:18 GMT"); response.getHeaders().put("Content-Length", "0"); response.getHeaders().put("Etag", "feb1"); MutableObjectInfoWithMetadata md = parser.apply(response); assertNotNull(md.getHash()); } }
[ "adrian.f.cole@3d8758e0-26b5-11de-8745-db77d3ebf521" ]
adrian.f.cole@3d8758e0-26b5-11de-8745-db77d3ebf521
52a19fb7871fd9a748fe8a03b1c7f17c80160c0b
11352947dac5fbf1c6a6eaf1a74b22d61c78b470
/src/com/leetcode/learning/rh/leetcode/Quest297.java
62a765a83978129ed05cb43db8191ba61f604a99
[]
no_license
yimoxuan/leetcode_rh
2e97edfd22d6d7914cf660fb713ad51934fb2616
eadea9d7ac299cb2e2813886c79f6e63a2b965f1
refs/heads/master
2023-08-27T04:35:13.589523
2021-10-18T09:30:46
2021-10-18T09:30:46
365,498,216
0
0
null
null
null
null
UTF-8
Java
false
false
3,150
java
package com.leetcode.learning.rh.leetcode; import java.awt.image.AreaAveragingScaleFilter; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } } public class Quest297 { public class Codec { // Encodes a tree to a single string. public String serialize(TreeNode root) { Queue<ArrayList<TreeNode>> queue = new LinkedList<>(); queue.add(new ArrayList<>(){{add(root);}}); StringBuffer stringBuffer = new StringBuffer(); while(!queue.isEmpty()) { ArrayList<TreeNode> rowList = queue.poll(); ArrayList<TreeNode> nextRow = new ArrayList<>(); for (int i=0; i<rowList.size(); i++) { if (rowList.get(i) == null) stringBuffer.append("#\t"); else { stringBuffer.append(rowList.get(i).val); nextRow.add(rowList.get(i).left); nextRow.add(rowList.get(i).right); } } if (nextRow.size() != 0) queue.add(new ArrayList<>(nextRow)); } stringBuffer.delete(stringBuffer.length()-1, stringBuffer.length()); return stringBuffer.toString(); } // Decodes your encoded data to tree. public TreeNode deserialize(String data) { Queue<TreeNode> fatherList = new LinkedList<>(); TreeNode root = null; boolean fag = true; for (String num : data.split("\t")) { if (fatherList.size() == 0) { if (num.equals("#")) return null; root = new TreeNode(Integer.valueOf(num)); fatherList.add(root); } else{ if (fag){ // 左子树 TreeNode father = fatherList.peek(); if (!num.equals("#")) { father.left = new TreeNode(Integer.valueOf(num)); fatherList.add(father.left); } fag = false; } else{ // 柚子树 TreeNode father = fatherList.poll(); if (!num.equals("#")) { father.right = new TreeNode(Integer.valueOf(num)); fatherList.add(father.right); } fag = true; } } } return root; } } public static void main(String[] args) { Quest297 quest297 = new Quest297(); Codec codec = quest297.new Codec(); System.out.println(codec.deserialize("7\t2\t#")); } }
[ "jsjrenheng@163.com" ]
jsjrenheng@163.com
f7dfa772f5119de21a7490bf8b1629ca4c380389
7bffa26da934a40195f5edcc01ebe76aaa9a7e10
/src/main/java/io/itman/library/push/ios/IOSBroadcast.java
b4d1cd6220c0dfd63f0813f43bd703a55c8c4ed4
[]
no_license
leaveslvmoon/basic
eb3c4e2167b5f58fe92c1cec68f808d320c693b7
ec7120be1e7f5fa4d0ab30d510547e82f775a2ab
refs/heads/master
2022-07-15T05:31:02.448380
2020-01-18T08:43:35
2020-01-18T08:43:35
232,461,755
0
0
null
2022-06-29T17:53:41
2020-01-08T02:38:47
JavaScript
UTF-8
Java
false
false
359
java
package io.itman.library.push.ios; import io.itman.library.push.IOSNotification; public class IOSBroadcast extends IOSNotification { public IOSBroadcast(String appkey,String appMasterSecret) throws Exception { setAppMasterSecret(appMasterSecret); setPredefinedKeyValue("appkey", appkey); this.setPredefinedKeyValue("type", "broadcast"); } }
[ "1264836157@qq.com" ]
1264836157@qq.com
dd7da9af324240ab8df87dee7a86fb22e69553d3
362a3185542df3750918abc735f1a38487273cd8
/src/src/main/java/com/jeecms/cms/dao/main/impl/CmsModelItemDaoImpl.java
2cb4b85f398867f035d45f982a39827b1520980d
[ "Apache-2.0" ]
permissive
zhangzlyuyx/jeecms81
a4517d02453de641c262bb276c34a2b4d40785ca
b7f5633114b3a1283f096fd8da9e5efe3ddf575d
refs/heads/master
2022-12-26T12:29:41.143251
2020-04-17T02:27:08
2020-04-17T02:27:08
248,179,752
0
1
Apache-2.0
2022-12-16T08:19:03
2020-03-18T08:45:54
Java
UTF-8
Java
false
false
1,257
java
package com.jeecms.cms.dao.main.impl; import java.util.List; import org.springframework.stereotype.Repository; import com.jeecms.cms.dao.main.CmsModelItemDao; import com.jeecms.cms.entity.main.CmsModelItem; import com.jeecms.common.hibernate4.HibernateBaseDao; @Repository public class CmsModelItemDaoImpl extends HibernateBaseDao<CmsModelItem, Integer> implements CmsModelItemDao { @SuppressWarnings("unchecked") public List<CmsModelItem> getList(Integer modelId, boolean isChannel, boolean hasDisabled) { StringBuilder sb = new StringBuilder( "from CmsModelItem bean where bean.model.id=? and bean.channel=?"); if (!hasDisabled) { sb.append(" and bean.display=true"); } sb.append(" order by bean.priority asc,bean.id asc"); return find(sb.toString(), modelId, isChannel); } public CmsModelItem findById(Integer id) { CmsModelItem entity = get(id); return entity; } public CmsModelItem save(CmsModelItem bean) { getSession().save(bean); return bean; } public CmsModelItem deleteById(Integer id) { CmsModelItem entity = super.get(id); if (entity != null) { getSession().delete(entity); } return entity; } @Override protected Class<CmsModelItem> getEntityClass() { return CmsModelItem.class; } }
[ "mail@zhangzlyuyx.com" ]
mail@zhangzlyuyx.com