blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
sequencelengths
1
1
author_id
stringlengths
0
313
83d1326b7aaf776366924a0aa84a7ccaed5c644f
a1e377a6ce3582b3a5c86581fbab567e469b6de6
/src/main/java/com/learn/spring/social/twitter/signin/SigninController.java
cff87f686c00ffb388b4b7a89525e7f474ad1b8f
[]
no_license
rasokan/springsocialtwitter
945c7a41c7faf0f9512659def3b5d48c850bb5a6
3a271284548099e983a78a47ba9566b424f88f11
refs/heads/master
2020-05-07T12:46:25.681294
2013-09-04T08:11:37
2013-09-04T08:11:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
975
java
/* * Copyright 2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.learn.spring.social.twitter.signin; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @Controller public class SigninController { @RequestMapping(value="/signin", method=RequestMethod.GET) public void signin() { } }
4aae1d63f905fb97acff90b307d0518f7db6e700
0bae7102a40eac4222226c1c24ebfed1b84fe417
/Notifications/MyFirebaseMessaging.java
7f7d0c9b438da18637b5882d2fbdf101b714b48b
[]
no_license
s-suri/instagram_clone_andoid_studio
43c53be0ee4acfdb42f1238771903eeaf374ebf4
77228fc0db33f27e1f686ade36043bddc83ed0df
refs/heads/main
2023-08-18T10:53:20.178764
2021-10-13T14:30:49
2021-10-13T14:30:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,367
java
package com.some.studychats.Notifications; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.media.RingtoneManager; import android.net.Uri; import android.os.Build; import android.os.Bundle; import androidx.core.app.NotificationCompat; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.RemoteMessage; import com.some.studychats.MassageActivityInstagram; import com.some.studychats.MessageActivity; public class MyFirebaseMessaging extends FirebaseMessagingService { @Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); String sented = remoteMessage.getData().get("sented"); String user = remoteMessage.getData().get("user"); SharedPreferences preferences = getSharedPreferences("PREFS", MODE_PRIVATE); String currentUser = preferences.getString("currentuser", "none"); FirebaseUser firebaseUser = FirebaseAuth.getInstance().getCurrentUser(); if (firebaseUser != null && sented.equals(firebaseUser.getUid())){ if (!currentUser.equals(user)) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { sendOreoNotification(remoteMessage); } else { sendNotification(remoteMessage); } } } } private void sendOreoNotification(RemoteMessage remoteMessage){ String user = remoteMessage.getData().get("user"); String icon = remoteMessage.getData().get("icon"); String title = remoteMessage.getData().get("title"); String body = remoteMessage.getData().get("body"); RemoteMessage.Notification notification = remoteMessage.getNotification(); int j = Integer.parseInt(user.replaceAll("[\\D]", "")); Intent intent = new Intent(this, MessageActivity.class); Bundle bundle = new Bundle(); bundle.putString("userid", user); intent.putExtras(bundle); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); PendingIntent pendingIntent = PendingIntent.getActivity(this, j, intent, PendingIntent.FLAG_ONE_SHOT); Uri defaultSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); OreoNotification oreoNotification = new OreoNotification(this); Notification.Builder builder = oreoNotification.getOreoNotification(title, body, pendingIntent, defaultSound, icon); int i = 0; if (j > 0){ i = j; } oreoNotification.getManager().notify(i, builder.build()); } private void sendNotification(RemoteMessage remoteMessage) { String user = remoteMessage.getData().get("user"); String icon = remoteMessage.getData().get("icon"); String title = remoteMessage.getData().get("title"); String body = remoteMessage.getData().get("body"); RemoteMessage.Notification notification = remoteMessage.getNotification(); int j = Integer.parseInt(user.replaceAll("[\\D]", "")); Intent intent = new Intent(this, MessageActivity.class); Bundle bundle = new Bundle(); bundle.putString("userid", user); intent.putExtras(bundle); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); PendingIntent pendingIntent = PendingIntent.getActivity(this, j, intent, PendingIntent.FLAG_ONE_SHOT); Uri defaultSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); NotificationCompat.Builder builder = new NotificationCompat.Builder(this) .setSmallIcon(Integer.parseInt(icon)) .setContentTitle(title) .setContentText(body) .setAutoCancel(true) .setSound(defaultSound) .setContentIntent(pendingIntent); NotificationManager noti = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE); int i = 0; if (j > 0){ i = j; } noti.notify(i, builder.build()); } }
c63b55b955afaf5cf56a8c5eb4e077d6b85dd12e
21529af13af1c0c976b9b2f2cf08e19bf6b0bffa
/ProjectSeleniumTests/src/test/java/pages/mainPage/subpages/checkBoxDemoPage/CheckBoxDemoPage.java
40e615d815b2b1d181e597303779b7bf5d9538e3
[]
no_license
jakublipiec/Selenium
4138c41c2ea4a70a6d6b218d27fbd8f1d22ea542
bdeb4c0181b124ab8f2868429dfeb34b5b1b3705
refs/heads/master
2020-04-10T09:57:57.426234
2019-01-16T15:51:00
2019-01-16T15:51:00
160,952,140
0
0
null
null
null
null
UTF-8
Java
false
false
1,963
java
package pages.mainPage.subpages.checkBoxDemoPage; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.FindBys; import pages.BasePage; import java.util.List; public class CheckBoxDemoPage extends BasePage { @FindBy(css = "#easycont > div > div.col-md-6.text-left > div:nth-child(4)") private WebElement singleCheckBoxDemoPanel; @FindBy(id = "isAgeSelected") private WebElement ageCheckbox; @FindBy(id = "txtAge") private WebElement successInfo; @FindBy(css = "#easycont > div > div.col-md-6.text-left > div:nth-child(5)") private WebElement multipleCheckboxDemoPanel; @FindBys({ @FindBy(className = "cb1-element") }) private List<WebElement> options; @FindBy(id = "check1") private WebElement checkBtn; public CheckBoxDemoPage() { super(); } public CheckBoxDemoPage scrollIntoSingleCheckBoxDemoPanel() { scrollInto(singleCheckBoxDemoPanel); return this; } public CheckBoxDemoPage scrollIntoMultipleCheckboxDemoPanel() { scrollInto(multipleCheckboxDemoPanel); return this; } public CheckBoxDemoPage clickCheckButton() { checkBtn.click(); return this; } public CheckBoxDemoPage clickOptionsManually() { for (WebElement option : options) { option.click(); } return this; } public boolean areOptionsChecked() { for (WebElement option : options) { if (!option.isSelected()) return false; } return true; } public CheckBoxDemoPage clickCheckbox() { ageCheckbox.click(); return this; } public String getCheckButtonText() { return this.checkBtn.getAttribute("value"); } public WebElement getSuccessInfo() { return this.successInfo; } }
6b3dcf18e61bf37ebbf7480890af41e7e6703232
8d93b372f0d41417d1414cea3b3e5029e0bc21f7
/src/main/java/com/zhangrh/smart/framework/helper/DataBaseHelper.java
51a9a431a40ece46b47a484d019c86fef396f15b
[]
no_license
zhang747217607/smart-framework
7e6e29886e9b638d5f61b2c31c14c7a5110465c1
95cfaf06a3c93a9394958fe637da4272055607d1
refs/heads/master
2023-07-15T03:16:46.988922
2020-08-23T14:06:49
2020-08-23T14:06:49
289,697,198
0
0
null
null
null
null
UTF-8
Java
false
false
3,381
java
package com.zhangrh.smart.framework.helper; import org.apache.commons.dbcp2.BasicDataSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.sql.Connection; import java.sql.SQLException; /** * @description: 数据库操作助手类 * @version: 1.0 * @author: zhangrenhua * @date: 2020/8/16 21:45 */ public final class DataBaseHelper { private static final Logger LOGGER = LoggerFactory.getLogger(DataBaseHelper.class); private static final ThreadLocal<Connection> CONNECTION_THREAD_LOCAL; private static final BasicDataSource DATA_SOURCE; static { CONNECTION_THREAD_LOCAL = new ThreadLocal<>(); DATA_SOURCE = new BasicDataSource(); DATA_SOURCE.setDriverClassName(ConfigHelper.getJdbcDriver()); DATA_SOURCE.setUrl(ConfigHelper.getJdbcUrl()); DATA_SOURCE.setUsername(ConfigHelper.getJdbcUsername()); DATA_SOURCE.setPassword(ConfigHelper.getJdbcPassword()); } /** * 获取connection */ public static Connection getConnection() { Connection conn = CONNECTION_THREAD_LOCAL.get(); if (conn == null) { try { conn = DATA_SOURCE.getConnection(); } catch (Exception e) { LOGGER.error("get connection failure", e); throw new RuntimeException(e); } finally { CONNECTION_THREAD_LOCAL.set(conn); } } return conn; } /** * 关闭connection */ public static void closeConnection() { Connection conn = CONNECTION_THREAD_LOCAL.get(); if (conn != null) { try { conn.close(); } catch (SQLException e) { LOGGER.error("close connection failure", e); throw new RuntimeException(e); } finally { CONNECTION_THREAD_LOCAL.remove(); } } } /** * 开启事务 */ public static void beginTransaction() { Connection conn = getConnection(); if (conn != null) { try { conn.setAutoCommit(false); } catch (SQLException e) { LOGGER.error("begin transaction failure", e); throw new RuntimeException(e); } finally { CONNECTION_THREAD_LOCAL.set(conn); } } } /** * 提交事务 */ public static void commitTransaction() { Connection conn = getConnection(); if (conn != null) { try { conn.commit(); conn.close(); } catch (SQLException e) { LOGGER.error("commit transaction failure", e); throw new RuntimeException(e); } finally { CONNECTION_THREAD_LOCAL.remove(); } } } /** * 回滚事务 */ public static void rollbackTransaction() { Connection conn = getConnection(); if (conn != null) { try { conn.rollback(); conn.close(); } catch (SQLException e) { LOGGER.error("rollback transaction failure", e); throw new RuntimeException(e); } finally { CONNECTION_THREAD_LOCAL.remove(); } } } }
e846e6867176dcf4e5dc302a121b9eb1a8bbd6d6
1f4fbbdcea63a1ad292a9589435000859f40671a
/DynamicProg/DistinctSubSeq.java
eb461c2c50cebc0a97db1185c393afa24def2886
[]
no_license
devang7/LeetCode
69217211196eaccfda5465f4af035665453a3463
39e16bcd6134b40d83a6b03011a2ee3617cb1cc5
refs/heads/master
2021-07-19T21:16:02.228285
2017-10-24T20:26:48
2017-10-24T20:26:48
104,392,849
0
0
null
null
null
null
UTF-8
Java
false
false
950
java
import java.util.*; public class DistinctSubSeq { public static void main(String args[]) { String s = "rabbbit"; String t = "rabbit"; System.out.println(new Solution().numDistinct(s,t)); } } class Solution { public int numDistinct(String s, String t) { if(s.length() < t.length()) return 0; int dp[][] = new int[t.length() + 1][s.length() + 1]; for(int i = 0; i <= s.length(); i++) { dp[0][i] = 1; } for(int i = 1; i <= t.length(); i++) { for(int j = 1; j <= s.length(); j++) { if(s.charAt(j - 1) == t.charAt(i - 1)) dp[i][j] = dp[i - 1][j - 1] + dp[i][j - 1]; else dp[i][j] = dp[i][j - 1]; } } return dp[t.length()][s.length()]; } } /* -> "" b i b i t dp(i,j) = dp(i - 1, j - 1) + dp(i, j - 1) if Same Char; dp(i, j - 1) otherwise "" b i t */
d4c94118d06a26402d4d92f7dc73a208a2ed3357
7b9a975d1b416e6c8a7238816c1d4dafc12ee2e1
/api/src/main/java/com/moebius/api/derse/TimeZoneStringSerializer.java
8cbb678caf4e65337825b3a7eb6ab882c313cdc7
[ "MIT" ]
permissive
team-moebius/hashmain-data-pipeline
6012b7d1720366e8f9339ef29730ea10ece89b1b
09a52e6bee119f6c51488aebb7403e86c7f4f013
refs/heads/master
2023-07-28T02:32:26.578508
2021-08-29T16:11:48
2021-08-29T16:11:48
271,893,640
0
0
null
null
null
null
UTF-8
Java
false
false
665
java
package com.moebius.api.derse; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import java.io.IOException; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; public class TimeZoneStringSerializer extends JsonSerializer<ZonedDateTime> { @Override public void serialize(ZonedDateTime value, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeString(value.withZoneSameInstant(ZoneId.of("Asia/Seoul")).format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)); } }
25543625ce69a62d9263f667c3d2d53540f67f48
48922e1b068006e0eb7ce858500b83844e0fb8d9
/src/test/java/CreditCardTest.java
274b410a2afac3b9aa4863310679128cd5ae7e17
[]
no_license
Nandini1212/creditcard
197337be63beafed879aa2929bdb3d2e0117c42c
bd2737d06085c08eda64dfdc185a82e6f6c66997
refs/heads/master
2022-11-30T07:47:38.633652
2020-08-17T05:27:09
2020-08-17T05:27:09
288,090,894
0
0
null
null
null
null
UTF-8
Java
false
false
6,039
java
import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; import java.util.List; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import com.creditcards.CreditCard; import com.creditcards.CreditCardFactory; import com.parse.file.CSVFileParser; import com.parse.file.FileParser; import com.parse.file.FileParserFactory; import com.parse.file.JSONFileParser; import com.parse.file.XMLFileParser; import static org.hamcrest.CoreMatchers.instanceOf; public class CreditCardTest { @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); public File tempInputCSVFile; public File tempOutputCSVFile; public File tempOutputXMLFile; public File tempOutputJSONFile; @Before public void setUp() throws Exception { tempInputCSVFile = tempFolder.newFile("tempInputFile.csv"); String CSVString = String.join("\n", "CardNumber,ExpirationDate,NameOfCardholder", "5410000000000000,3/20/2030,Alice", "4120000000000,4/20/2030,Bob", "341000000000000,5/20/2030,Eve", "6010000000000000,6/20/2030,Richard"); Files.write(Paths.get(tempInputCSVFile.getPath()), CSVString.getBytes()); tempOutputCSVFile = tempFolder.newFile("tempOutputFile.csv"); tempOutputXMLFile = tempFolder.newFile("tempOutputFile.xml"); tempOutputJSONFile = tempFolder.newFile("tempOutputFile.json"); } @Test public void testReadAndWriteXMLFile() throws Exception { FileParser inputFileParser = FileParserFactory.GetFileParser(tempInputCSVFile.getPath()); List<CreditCard> creditCards = inputFileParser.GetAllCards(); Assert.assertEquals(creditCards.size(), 4); FileParser outputFileParser = FileParserFactory.GetFileParser(tempOutputXMLFile.getPath()); outputFileParser.PutAllCards(creditCards); byte[] content = Files.readAllBytes(Paths.get(tempOutputXMLFile.getPath())); String stringContent = new String(content); stringContent = stringContent.substring(stringContent.indexOf('\n')+1); Assert.assertEquals(stringContent.trim(), String.join("\n", "<root>", " <row>", " <CardNumber>5410000000000000</CardNumber>", " <CardType>Master</CardType>", " <CardHolderName>Alice</CardHolderName>", " <CardExpiryDate>3/20/2030</CardExpiryDate>", " </row>", " <row>", " <CardNumber>4120000000000</CardNumber>", " <CardType>Visa</CardType>", " <CardHolderName>Bob</CardHolderName>", " <CardExpiryDate>4/20/2030</CardExpiryDate>", " </row>", " <row>", " <CardNumber>341000000000000</CardNumber>", " <CardType>AmEx</CardType>", " <CardHolderName>Eve</CardHolderName>", " <CardExpiryDate>5/20/2030</CardExpiryDate>", " </row>", " <row>", " <CardNumber>6010000000000000</CardNumber>", " <CardType>Invalid</CardType>", " <CardHolderName>Richard</CardHolderName>", " <CardExpiryDate>6/20/2030</CardExpiryDate>", " </row>", "</root>" )); } @Test public void testReadAndWriteCSVFile() throws Exception { FileParser inputFileParser = FileParserFactory.GetFileParser(tempInputCSVFile.getPath()); List<CreditCard> creditCards = inputFileParser.GetAllCards(); Assert.assertEquals(creditCards.size(), 4); FileParser outputFileParser = FileParserFactory.GetFileParser(tempOutputCSVFile.getPath()); outputFileParser.PutAllCards(creditCards); byte[] content = Files.readAllBytes(Paths.get(tempOutputCSVFile.getPath())); String stringContent = new String(content); Assert.assertEquals(stringContent.trim(), String.join("\n", "CardNumber,CardType,NameOfCardholder,ExpirationDate", "5410000000000000,Master,Alice,3/20/2030", "4120000000000,Visa,Bob,4/20/2030", "341000000000000,AmEx,Eve,5/20/2030", "6010000000000000,Invalid,Richard,6/20/2030" )); } @Test public void testReadAndWriteJSONFile() throws Exception { FileParser inputFileParser = FileParserFactory.GetFileParser(tempInputCSVFile.getPath()); List<CreditCard> creditCards = inputFileParser.GetAllCards(); Assert.assertEquals(creditCards.size(), 4); FileParser outputFileParser = FileParserFactory.GetFileParser(tempOutputJSONFile.getPath()); outputFileParser.PutAllCards(creditCards); byte[] content = Files.readAllBytes(Paths.get(tempOutputJSONFile.getPath())); String stringContent = new String(content); Assert.assertEquals(stringContent.split("},").length, 5); } @Test public void testMasterCCCreated() { CreditCard creditCard = CreditCardFactory.CreateCard("5410000000000000", "3/20/2030", "Alice"); Assert.assertEquals(creditCard.GetCardType(), "Master"); } @Test public void testVisaCCCreated() { CreditCard creditCard = CreditCardFactory.CreateCard("4120000000000", "3/20/2030", "Alice"); Assert.assertEquals(creditCard.GetCardType(), "Visa"); } @Test public void testAmExCCCreated() { CreditCard creditCard = CreditCardFactory.CreateCard("341000000000000", "3/20/2030", "Alice"); Assert.assertEquals(creditCard.GetCardType(), "AmEx"); } @Test public void testInvalidCCCreated() { CreditCard creditCard = CreditCardFactory.CreateCard("6010000000000000", "3/20/2030", "Alice"); Assert.assertEquals(creditCard.GetCardType(), "Invalid"); } @Test public void testParserCreationFailure() { FileParser fileParser = FileParserFactory.GetFileParser("something"); Assert.assertNull(fileParser); } @Test public void testCSVFileParserSuccessfulCreation() { FileParser fileParser = FileParserFactory.GetFileParser("something.csv"); Assert.assertThat(fileParser, instanceOf(CSVFileParser.class)); } @Test public void testJSONFileParserSuccessfulCreation() { FileParser fileParser = FileParserFactory.GetFileParser("something.json"); Assert.assertThat(fileParser, instanceOf(JSONFileParser.class)); } @Test public void testXMLFileParserSuccessfulCreation() { FileParser fileParser = FileParserFactory.GetFileParser("something.xml"); Assert.assertThat(fileParser, instanceOf(XMLFileParser.class)); } }
b07047f7de316c028a678ca3386ce7ff26c9daf7
81e2296fa1cab6d1f00256a852ef09aff50a3516
/StormCplex/src/main/java/uconn/stormcplex/salr/Line.java
9ee98ef1cd022c0cfb472f90660163423139d2d5
[]
no_license
huj10001/StormCplex
84d5131b68d899214b926d731a4b6f083e42ae7d
77163a87761cd25454c69c3486c135775e430de1
refs/heads/master
2021-05-13T13:11:31.043586
2018-01-08T16:12:35
2018-01-08T16:12:35
116,698,936
0
0
null
null
null
null
UTF-8
Java
false
false
653
java
package uconn.stormcplex.salr; import java.io.Serializable; public class Line implements Serializable { public int i; public int j; public Line(int i, int j) { this.i = i; this.j = j; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + i; result = prime * result + j; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Line other = (Line) obj; if (i != other.i) return false; if (j != other.j) return false; return true; } }
a54ae82cb8305642f0d393ba7e4e51708c048df1
b025e05d89fdcfad8fe91fba1e41f8a05f2ec447
/resourcemanagement/src/main/java/com/resource/app/ResourceManagementRestApplication.java
72c42b6f72a5ec7d8f435604e23a3a8f65a54589
[]
no_license
ashakrishnan1997/resourcemanagement
6a04ba2ea82aa8182beaf3260e9f8c1dcee470d6
63355c48cc39b3e135d566a52d47b2aca411818a
refs/heads/master
2022-11-13T00:04:38.666730
2020-06-25T13:12:23
2020-06-25T13:12:23
274,915,271
0
0
null
null
null
null
UTF-8
Java
false
false
393
java
package com.resource.app; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ResourceManagementRestApplication { public static void main(String[] args) { SpringApplication.run(ResourceManagementRestApplication.class, args); System.out.println("resource management system"); } }
893884302b4af7dc42976d19695a870323a6c8e1
9e385204b279f81bdc07ee92e9cde40fe6d927d5
/java/source/com/kodemore/http/KmHttpGet.java
72c3ab179d3709b8e8e24d0f80504125d0d4a5a2
[ "Apache-2.0" ]
permissive
wyattlove/panda-track-server
4b9ec8f2e10f5731c5088193792bd7b067f911eb
cc2a7ffe844c77b35429ddd84c4bc2c3ddc1d99b
refs/heads/master
2021-01-16T18:29:50.027390
2015-05-21T02:06:25
2015-05-21T02:06:25
33,639,532
0
0
null
null
null
null
UTF-8
Java
false
false
2,703
java
/* Copyright (c) 2005-2014 www.kodemore.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package com.kodemore.http; import com.kodemore.utility.Kmu; public class KmHttpGet extends KmHttpRequest { //################################################## //# path //################################################## @Override public String getFullPath() { String path = getPath(); String params = getRequestParameterString(); if ( Kmu.hasValue(params) ) path += "?" + params; return path; } @Override protected void _applyRequestValue() { // GETs to not use the request value. } //################################################## //# main //################################################## public static void main(String[] args) { KmHttpRequest req; req = new KmHttpGet(); req.setHost("dictionary.reference.com"); req.setPort(80); req.setPath("search"); req.setContentType("text/html"); req.setParameter("q", "test"); req.submit(); System.out.println("------------------------------------------------------------"); if ( req.hasException() ) { System.out.println("url: " + req.getUrl()); System.out.println("error: " + req.getException()); return; } System.out.println("url: " + req.getUrl()); System.out.println("response code: " + req.getResponseCode()); System.out.println("response message: " + req.getResponseMessage()); System.out.println(req.getResponseString()); } }
fb7855135b9886330273514f172eb42a772251b4
1120f1db05f600972e471bc626833193d8ec76df
/src/main/java/net/toastynetworks/beaconwatch/Team.java
f8ac5b44c6fd720c58a1fbc39cd64e0b0dd8d6d1
[]
no_license
VOrlando520/BeaconWatch
91bbfd0b3aebc54b476bff777b4560d92ab555b8
4dd884462c1f2fbcd389ad67a98d38e4826b01fb
refs/heads/master
2020-08-09T12:17:16.406853
2018-01-10T11:19:23
2018-01-10T11:19:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,891
java
package net.toastynetworks.beaconwatch; import java.util.Map; import java.util.UUID; import org.spongepowered.api.data.key.Keys; import org.spongepowered.api.entity.living.player.gamemode.GameMode; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; public class Team { private TeamColor color; private Map<UUID, TeamMember> players; private Location<World> beacon; private boolean defeated; public Team(TeamColor color, Map<UUID, TeamMember> players, Location<World> beacon) { this.color = color; this.players = players; this.beacon = beacon; } /** * @return color of the specified Team */ public TeamColor getColor() { return color; } /** * @return all players of a specified team */ public Map<UUID, TeamMember> getPlayers() { return players; } /** * @return location of the beacon from the specified team */ public Location<World> getBeacon() { return beacon; } /** * @return false if team is not defeated or true if team has been defeated. */ public boolean isDefeated() { return defeated; } /** * Set the boolean defeated to true ot false if the team has lost or won. * @param defeated */ public void setDefeated(boolean defeated) { this.defeated = defeated; } /** * Set the gamemode of a player in a specific team. * @param gameMode */ public void setGameMode(GameMode gameMode) { for (TeamMember member : players.values()) { if (member.getPlayer().isPresent()) { member.getPlayer().get().offer(Keys.GAME_MODE, gameMode); } } } @Override public String toString() { return "Team{" + "color=" + color + ", players=" + players + ", beacon=" + beacon + '}'; } }
1e99f8dfe6b58f4ed1bdaa5a46490cfb4461fca2
9b98b80ba8df9d22606b89d5246fe0b358d737d7
/app/src/main/java/com/example/drawinglayout/Interface/BrushEditorMode.java
a342bf72afa3f047bc70b09252a8c6eedf1731ca
[]
no_license
laxman-10198/PhotoEditor
b26a6d9bb2d4ac91fcf522039b44d2d95ec1c819
74ff6df3b4b47c657c407ff1ad1cadb185d41320
refs/heads/master
2023-05-25T10:52:18.483768
2021-06-11T04:53:18
2021-06-11T04:53:18
375,908,313
0
0
null
null
null
null
UTF-8
Java
false
false
125
java
package com.example.drawinglayout.Interface; public interface BrushEditorMode { void onBrushMode(boolean mBrushMode); }
300f9f8b9b613581ceb910ff3837c4502df5a6b6
e223201a0a3ca934caacfaee0c0334afeb1341f9
/MyList/src/MyLinearList.java
24443635673ef7615413d69376279ed4c288adf1
[]
no_license
vssudarshan-tutorials/java-masterclass-tim-buchalka
e69e40be0424fed046303477959e1f6e19891855
b7184d3db9b49f4911e757d7830b2337637e62ab
refs/heads/master
2022-12-04T15:50:59.541434
2020-08-23T07:07:21
2020-08-23T07:07:21
289,631,483
1
0
null
null
null
null
UTF-8
Java
false
false
6,604
java
public abstract class MyLinearList implements MyListInterface{ protected MyAbstractItem head; protected MyAbstractItem previousEntry; protected MyAbstractItem nextEntry; protected int position; private int size; public MyLinearList() { this.size = 0; this.position = 0; } public int getSize() { return size; } public int getIndex() { return position - 1; } public boolean isValidItem(MyAbstractItem myAbstractItem) { return myAbstractItem.getValue().getClass().getName().equals(this.previousEntry.getValue().getClass().getName()); } public MyAbstractItem getFirstEntry() { return head; } public MyAbstractItem getPreviousListEntry() { if (head != null) { if (position == 1) { return previousEntry; } else { nextEntry = previousEntry; previousEntry = previousEntry.getPreviousItem(); position--; } } return nextEntry; } public MyAbstractItem getNextListEntry() { if (head != null) { if (position == size) { return nextEntry; } else { previousEntry = nextEntry; nextEntry = nextEntry.getNextItem(); position++; } } return previousEntry; } public boolean add(MyAbstractItem myAbstractItem) { if (((size == 0) || isValidItem(myAbstractItem)) && (search(myAbstractItem) == -1)) { if (head == null) { head = myAbstractItem; previousEntry = head; } else { previousEntry = getListEntry(size - 1); nextEntry = null; previousEntry.setNextItem(myAbstractItem); myAbstractItem.setPreviousItem(previousEntry); previousEntry = myAbstractItem; } size++; position = size; // System.out.print("Add position: " + position); return true; } return false; } public boolean add(int index, MyAbstractItem myAbstractItem) { if (index <= size && search(myAbstractItem) == -1) { if ((size == 0) || isValidItem(myAbstractItem)) { if (index == size) { previousEntry = getListEntry(index - 1); previousEntry.setNextItem(myAbstractItem); myAbstractItem.setPreviousItem(previousEntry); position++; } else { nextEntry = getListEntry(index); if (nextEntry != head) { nextEntry.getPreviousItem().setNextItem(myAbstractItem); myAbstractItem.setPreviousItem(nextEntry.getPreviousItem()); } else { head = myAbstractItem; } myAbstractItem.setNextItem(nextEntry); nextEntry.setPreviousItem(myAbstractItem); } previousEntry = myAbstractItem; } size++; // System.out.print("Add position: " + position); return true; } return false; } public abstract boolean remove(MyAbstractItem myAbstractItem); public boolean remove(int index) { if (index < size) { MyAbstractItem myAbstractItem = getListEntry(index); if (myAbstractItem != head) { previousEntry = myAbstractItem.getPreviousItem(); nextEntry = myAbstractItem.getNextItem(); previousEntry.setNextItem(nextEntry); if (nextEntry != null) nextEntry.setPreviousItem(previousEntry); } else { head = myAbstractItem.getNextItem(); previousEntry = head; if (nextEntry != null) nextEntry = head.getNextItem(); if (head != null) head.setPreviousItem(null); } size--; position--; if (size != 0 && position == 0) position = 1; // System.out.println("\nRemove Position: " + position); return true; } return false; } public MyAbstractItem getListEntry(int index) { if (size != 0) { if (position - 1 == index) { previousEntry = getRecursiveItem(previousEntry, 0, 0); } else if (position > index) { previousEntry = getRecursiveItem(previousEntry, position - 1 - index, -1); } else { previousEntry = getRecursiveItem(previousEntry, index + 1 - position, 1); } if (index == size) nextEntry = null; else nextEntry = previousEntry.getNextItem(); } return previousEntry; } private MyAbstractItem getRecursiveItem(MyAbstractItem myAbstractItem, int recursionValue, int direction) { if (recursionValue == 0) return myAbstractItem; if (direction == -1) position--; else if (direction == 1) position++; if (direction == -1) { return getRecursiveItem(myAbstractItem.getPreviousItem(), recursionValue - 1, -1); } else return getRecursiveItem(myAbstractItem.getNextItem(), recursionValue - 1, 1); } public int search(MyAbstractItem myAbstractItem) { MyAbstractItem listItem = head; for (int i = 0; listItem != null; i++) if (listItem == myAbstractItem) return i; else listItem = listItem.getNextItem(); return -1; } public abstract void sort(); public void traverse() { if (head != null) { MyAbstractItem myAbstractItem = head; previousEntry = head; nextEntry = head.getNextItem(); position = 1; System.out.println("List Items:"); while (myAbstractItem != null) { System.out.println(myAbstractItem.getValue()); myAbstractItem = getNextListEntry(); } } } }
4685104d79691b30feaafeaf8bf126e3cc89ec20
07b76f2fda2227b88bb5a9858166ab742e2cacfa
/src/main/java/com/ke/service/impl/BaseDictServiceImpl.java
9f7b6a83ff3990a3a20223be253c3b5823b6fdef
[]
no_license
ningwanglyx/ssm-crm-0915
20ea11c9d459951f699b3bc3cda485338714aa7f
7ad5b7d16f28a4b5d0ac68ef42f211c1cb136300
refs/heads/master
2022-12-22T17:53:35.460383
2019-11-18T14:40:01
2019-11-18T14:40:01
208,466,927
0
0
null
2022-12-16T09:43:53
2019-09-14T16:14:28
Java
UTF-8
Java
false
false
680
java
package com.ke.service.impl; import com.ke.mapper.BaseDictMapper; import com.ke.pojo.BaseDict; import com.ke.service.BaseDictService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * @Author: YangxingLiu * @Description: * @Date: Created in 2019/9/15 21:04 * @Modified By: */ @Service public class BaseDictServiceImpl implements BaseDictService { @Autowired private BaseDictMapper baseDictMapper; @Override public List<BaseDict> queryBaseDictByDictTypeCode(String dictTypeCode) { return this.baseDictMapper.queryBaseDictByDictTypeCode(dictTypeCode); } }
4f0d8ea9c9e20452ba798876c7521e0dfa330118
ed2919ae650bcdcfdde349166b4c528de87a4585
/plugins/academic/vr-academic-web/src/main/java/net/vpc/app/vainruling/plugins/academic/web/load/AllTeachersCourseLoadCtrl.java
06ad3da3248e5d0b7eea9ffeb7752e3e7500f301
[]
no_license
RaouiaHerguem/vr
d615da6bbeafdaa04249a066ac64b6b7f2106c07
28e40ba8dfd5514b8940261654f53b7003169767
refs/heads/master
2021-01-22T21:58:58.266745
2015-09-30T12:20:50
2015-09-30T12:20:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,276
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 net.vpc.app.vainruling.plugins.academic.web.load; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.faces.bean.ManagedBean; import net.vpc.app.vainruling.plugins.academic.service.AcademicPlugin; import net.vpc.app.vainruling.plugins.academic.service.model.stat.TeacherStat; import net.vpc.app.vainruling.api.VrApp; import net.vpc.app.vainruling.api.web.OnPageLoad; import net.vpc.app.vainruling.api.web.UCtrl; import net.vpc.app.vainruling.api.web.UPathItem; import net.vpc.app.vainruling.plugins.academic.service.StatCache; import net.vpc.app.vainruling.plugins.academic.service.model.stat.TeacherSemesterStat; /** * * @author vpc */ @UCtrl( breadcrumb = { @UPathItem(title = "Education", css = "fa-dashboard", ctrl = "")}, css = "fa-table", title = "Charge Enseignants", url = "modules/academic/allteacherscourseload", menu = "/Education/Load", securityKey = "Custom.Education.AllTeachersCourseLoad" ) @ManagedBean public class AllTeachersCourseLoadCtrl { protected Model model = new Model(); private void reset() { getModel().setSemester1(new ArrayList<TeacherSemesterStat>()); getModel().setSemester2(new ArrayList<TeacherSemesterStat>()); getModel().setYear(new ArrayList<TeacherStat>()); } @OnPageLoad public void onRefresh(String cmd) { onRefresh(); } public void onRefresh() { AcademicPlugin a = VrApp.getBean(AcademicPlugin.class); StatCache cache = new StatCache(); boolean includeIntents = containsRefreshFilter("intents"); getModel().setSemester1(a.evalTeacherSemesterStatList(null, "S1", includeIntents, cache)); getModel().setSemester2(a.evalTeacherSemesterStatList(null, "S2", includeIntents, cache)); getModel().setYear(a.evalTeacherStatList(null, null, includeIntents, cache)); } public Model getModel() { return model; } public void onOthersFiltersChanged() { onRefresh(); } public static class Model { List<TeacherSemesterStat> semester1 = new ArrayList<>(); List<TeacherSemesterStat> semester2 = new ArrayList<>(); List<TeacherStat> year = new ArrayList<>(); String[] defaultFilters = {"situation", "degree", "valueWeek", "extraWeek", "c", "td", "tp", "pm"}; String[] filters = defaultFilters; String[] refreshFilter = {}; public String[] getFilters() { return filters; } public String[] getRefreshFilter() { return refreshFilter; } public void setRefreshFilter(String[] refreshFilter) { this.refreshFilter = refreshFilter; } public void setFilters(String[] filters) { this.filters = (filters == null || filters.length == 0) ? defaultFilters : filters; } public List<TeacherSemesterStat> getSemester1() { return semester1; } public void setSemester1(List<TeacherSemesterStat> semester1) { this.semester1 = semester1; } public List<TeacherSemesterStat> getSemester2() { return semester2; } public void setSemester2(List<TeacherSemesterStat> semester2) { this.semester2 = semester2; } public List<TeacherStat> getYear() { return year; } public void setYear(List<TeacherStat> year) { this.year = year; } } public boolean containsFilter(String s) { String[] f = getModel().getFilters(); if (f == null || f.length == 0) { return "value".equals(s); } return Arrays.asList(f).indexOf(s) >= 0; } public boolean containsRefreshFilter(String s) { String[] f = getModel().getRefreshFilter(); return Arrays.asList(f).indexOf(s) >= 0; } public void onFiltersChanged() { //onRefresh(); } public void onRefreshFiltersChanged() { onRefresh(); } }
9624cfd19f33a324f4e7e82bbe1bef38b6681eb8
4f212c87e039e2d9f7f981d1a919dcde42162042
/src/beans/DeleteQues.java
269e41b06c3c3584c96da22e0fb2f80e6ef71bfa
[]
no_license
ayushisrvstv/Placement-Preparation
4e8d4622147f6880c0d19aeb32c86241162c4982
fe9b9c316c62bcb3f36db0e1bb86b1bf8cdc7901
refs/heads/master
2020-12-30T11:14:51.510325
2013-06-13T07:19:58
2013-06-13T07:19:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
253
java
package beans; public class DeleteQues { String delques; public DeleteQues(String delques) { super(); this.delques = delques; } public String getDelques() { return delques; } public void setDelques(String delques) { this.delques = delques; } }
7e8e096385519a6d5616ad5c8d6bc18ff3844f56
3efecd814559ba28beb48d97322f7feffa27b547
/src/main/java/Main2.java
c683743fb3b9a2108fecbc1e15c9af16dc019555
[]
no_license
KrzysztofKmiecik/VirtualWorld
885dc73816b2ac2147191aa519f7de8a234a9852
3bb092c295f250ad630c94feaaec81e41ee456e3
refs/heads/master
2021-07-08T17:21:40.427942
2019-07-11T22:17:32
2019-07-11T22:17:32
196,436,966
0
0
null
2020-10-13T14:31:40
2019-07-11T17:18:26
Java
UTF-8
Java
false
false
245
java
import java.util.Random; public class Main2 { public static void main(String[] args) { Random generator = new Random(); for (int i = 0; i < 10; i++) { System.out.println(generator.nextInt(10)); } } }
61501821109646cf36cde1d07dce6d1395a6d262
9b47999445660759e0df77c8f71af7cd0068b6ca
/projet_formation/projet_formation/src/sample/main.java
368b2330d4c0a1f9bf976fdfe42f5732bf250f56
[]
no_license
ahmedhaddad949/pi_desktop
9c7d8bcd4b5b2b440378e8889d97829d2a4230d2
51b00e967ef18123cee253cf65c710c2a0ca6a5f
refs/heads/main
2023-05-03T01:53:08.813074
2021-05-20T20:01:47
2021-05-20T20:01:47
357,187,108
0
0
null
null
null
null
UTF-8
Java
false
false
2,379
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 sample; import javafx.application.Application; import static javafx.application.Application.launch; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; /** * * @author Aymen */ public class main extends Application { @Override public void start(Stage stage) throws Exception { //-------------formation----------- // back admin //Parent root = FXMLLoader.load(getClass().getResource("Home_Formation.fxml")); // user Parent root = FXMLLoader.load(getClass().getResource("Front_formation.fxml")); //-------------reclamation----------- //user reclamation //Parent root = FXMLLoader.load(getClass().getResource("Front_Reclamaion.fxml")); //back reclamation //Parent root = FXMLLoader.load(getClass().getResource("Home_Categorie_reclamation.fxml")); //-------------Questionnaire----------- //back questionnaire // Parent root = FXMLLoader.load(getClass().getResource("Home_Questionnaire.fxml")); //back reponse //Parent root = FXMLLoader.load(getClass().getResource("Home_Reponse.fxml")); //front questionaire // Parent root = FXMLLoader.load(getClass().getResource("Front_Questionnaire.fxml")); /*--------------Offre---------------*/ // admin offre emploi //Parent root = FXMLLoader.load(getClass().getResource("Home_Offre_Emploi.fxml")); // admin offre emploi // Parent root = FXMLLoader.load(getClass().getResource("Home_Offre_Freelance.fxml")); // Front offre emploi //Parent root = FXMLLoader.load(getClass().getResource("Front_offre_emploi.fxml")); // Front offre freelance // Parent root = FXMLLoader.load(getClass().getResource("Front_offre_freelance.fxml")); Scene scene = new Scene(root); stage.setScene(scene); stage.show(); } /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } }
e5edb54ab7e15673fa7ae80800b4852cc4421f2d
6b67813839ad75672a36ff73396a7f9c37d483cc
/app/src/main/java/com/example/calculator/MainActivity.java
dc9c56ee47549f5f253930f195585d6d3e27f6cd
[]
no_license
vedant3598/AndroidStudio-Calculator
7e027032483ad89a43ab1a4c9b1be038c7b5eb6e
c30b175c1441f086233cb36ac55f79377eeebe83
refs/heads/master
2020-06-28T05:25:10.065495
2020-01-23T05:48:43
2020-01-23T05:48:43
200,152,350
0
0
null
null
null
null
UTF-8
Java
false
false
9,555
java
package com.example.calculator; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; import org.mozilla.javascript.Context; import org.mozilla.javascript.Scriptable; public class MainActivity extends AppCompatActivity { //Developer: Vedant Shah Button btnOne, btnTwo, btnThree, btnFour, btnFive, btnSix, btnSeven, btnEight, btnNine, btnZero, btnClear, btnBackSpace, btnDecimal, btnAddition, btnSubtraction, btnDivision, btnMultiplication, btnBracket, btnEqual, btnPercentage; TextView calculatorResult, process; String processor; Boolean isBracketOpen; int developedCounter; static String clearScreen = "clear"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); isBracketOpen = false; developedCounter = 0; //Assigning values to all variables btnClear = (Button) findViewById(R.id.btnDelete); btnOne = (Button) findViewById(R.id.btnOne); btnTwo = (Button) findViewById(R.id.btnTwo); btnThree = (Button) findViewById(R.id.btnThree); btnFour = (Button) findViewById(R.id.btnFour); btnFive = (Button) findViewById(R.id.btnFive); btnSix = (Button) findViewById(R.id.btnSix); btnSeven = (Button) findViewById(R.id.btnSeven); btnEight = (Button) findViewById(R.id.btnEight); btnNine = (Button) findViewById(R.id.btnNine); btnZero = (Button) findViewById(R.id.btnZero); process = (TextView) findViewById(R.id.process); calculatorResult = (TextView) findViewById(R.id.calculatedResult); process.setText(""); calculatorResult.setText(""); btnMultiplication = (Button) findViewById(R.id.btnMultiplication); btnSubtraction = (Button) findViewById(R.id.btnSubtraction); btnAddition = (Button) findViewById(R.id.btnAddition); btnDivision = (Button) findViewById(R.id.btnDivision); btnDecimal = (Button)findViewById(R.id.btnDecimal); btnBackSpace = (Button)findViewById(R.id.btnBack); btnBracket = (Button)findViewById(R.id.btnBracket); btnEqual = (Button) findViewById(R.id.btnEqual); btnPercentage = (Button) findViewById(R.id.btnPercentage); btnClear.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ process.setText(""); calculatorResult.setText(""); } }); //Number Buttons btnOne.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); process.setText(processor + "1"); } }); btnTwo.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); process.setText(processor + "2"); } }); btnThree.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); process.setText(processor + "3"); } }); btnFour.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); process.setText(processor + "4"); } }); btnFive.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); process.setText(processor + "5"); } }); btnSix.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); process.setText(processor + "6"); } }); btnSeven.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); process.setText(processor + "7"); } }); btnEight.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); process.setText(processor + "8"); } }); btnNine.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); process.setText(processor + "9"); } }); btnZero.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); process.setText(processor + "0"); } }); //Functional Buttons btnMultiplication.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); process.setText(processor + "*"); } }); btnSubtraction.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); process.setText(processor + "-"); } }); btnAddition.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); process.setText(processor + "+"); } }); btnDivision.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); process.setText(processor + "/"); } }); btnDecimal.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); process.setText(processor + "."); } }); btnBackSpace.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); if(processor.length() > 0){ processor = processor.substring(0, processor.length()-1); process.setText(processor); }else{ calculatorResult.setText(""); } } }); btnPercentage.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); process.setText(processor + "%"); } }); btnBracket.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); if(isBracketOpen){ processor = process.getText().toString(); process.setText(processor + ")"); isBracketOpen = false; }else{ processor = process.getText().toString(); process.setText(processor + "("); isBracketOpen = true; } } }); btnEqual.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ clearScreen(); processor = process.getText().toString(); processor = processor.replaceAll("%", "/100"); Context rhino = Context.enter(); rhino.setOptimizationLevel(-1); String result = ""; try{ Scriptable scope = rhino.initStandardObjects(); result = rhino.evaluateString(scope, processor, "JavaScript", 1, null).toString(); }catch (Exception e){ result = "Math Error"; } calculatorResult.setText(result); } }); } //Clears Screen private void clearScreen(){ processor = process.getText().toString(); if(processor.contains(clearScreen)){ process.setText(""); calculatorResult.setText(""); } developedCounter = 0; } }
6202dbded5fd83fab3d1c54bcefbf9a8121ade30
a3d47494d6229484ccee9c438018e3d90947de4e
/app/src/main/java/com/example/trip_to_jiujiang/model/User.java
5e981074e34dd85ce1bafbf467d82db8160b9592
[]
no_license
liangshao0101/Trip_To_JiuJiang
be8a86bad380f006707374999d3f150bd5af3dc6
81383e9d5af101f2a3c9faed62b044b4cb0994bc
refs/heads/master
2023-02-05T10:55:49.733611
2020-12-28T02:07:14
2020-12-28T02:07:14
307,881,569
3
1
null
2020-12-23T01:16:02
2020-10-28T02:07:54
Java
UTF-8
Java
false
false
895
java
package com.example.trip_to_jiujiang.model; import cn.bmob.v3.BmobObject; public class User extends BmobObject { private String userId; //用户账号 private String userPsd; //用户密码 private String nickName; //用户昵称 public User() { } public User(String userId, String userPsd, String nickName) { this.userId = userId; this.userPsd = userPsd; this.nickName = nickName; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getUserPsd() { return userPsd; } public void setUserPsd(String userPsd) { this.userPsd = userPsd; } public String getNickName() { return nickName; } public void setNickName(String nickName) { this.nickName = nickName; } }
e4f467a9dab468b7c2d82db4ecb9887f7b737d98
480b41c8a092ccc4c8c364f348bc4186e736a35a
/BTPreorderIterator.java
1cb884739915b56645f24ad39d4b6e3e271e5a6a
[]
no_license
DelbertCV/Hoja-de-Trabajo-9
03fadde14bc95eb4352c4c68453c91af5f53dd6a
1fb7f15cf7a624396bfa9ef70690c149b3b2c664
refs/heads/master
2021-01-10T18:05:32.692468
2015-10-18T06:15:46
2015-10-18T06:16:49
44,319,570
0
0
null
null
null
null
UTF-8
Java
false
false
2,339
java
/** * * Jonathan Aguirre, 14349 * Yosemite Melendez, 14413 * Delbert Custodio, 14246 * * * Obtenido en Internet por medio de Google Search buscando * "NombreDeLaClase".java seguida de "Duane Bailey". * * * Propiedad del autor Duane A. Bailey * */ class BTPreorderIterator<E> extends AbstractIterator<E> { /** * The root of the subtree to be considered by traversal. */ protected BinaryTree<E> root; // root of tree to be traversed /** * The stack that maintains the state of the iterator. */ protected Stack<BinaryTree<E>> todo; // stack of unvisited nodes whose /** * Constructs a pre-order traversal of subtree rooted at root. * * @post constructs an iterator to traverse in preorder * * @param root Root of subtree to be traversed. */ public BTPreorderIterator(BinaryTree<E> root) { todo = new StackList<BinaryTree<E>>(); this.root = root; reset(); } /** * Resets the iterator to the first node of the traversal. * * @post resets the iterator to retraverse */ public void reset() { todo.clear(); // stack is empty; push on root if (root != null) todo.push(root); } /** * Returns true if some nodes of subtree have yet to be considered. * * @post returns true iff iterator is not finished * * @return True iff more nodes to be considered in traversal. */ public boolean hasNext() { return !todo.isEmpty(); } /** * Returns the value currently being referenced by iterator. * * @pre hasNext() * @post returns reference to current value * * @return The current value. */ public E get() { return todo.get().value(); } /** * Returns the current value and increments the iterator. * Iterator is then incremented. * * @pre hasNext(); * @post returns current value, increments iterator * * @return The value currently being considered. */ public E next() { BinaryTree<E> old = todo.pop(); E result = old.value(); if (!old.right().isEmpty()) todo.push(old.right()); if (!old.left().isEmpty()) todo.push(old.left()); return result; } }
f1f5fd0194469d5d37fa1309b4ab888a72bd02b1
dcc0a92d944e223054718c3230afb43ca9223a4b
/src/blind75/TrappedRainWater.java
aa4593c1fb5cd219d88d4c818246bc323fad1835
[]
no_license
viper78/interview
26d42a35a8e493a0542336505f6c60768a7bdffa
0dafb11c982318e21999b087e3b46ae333af7806
refs/heads/master
2023-04-05T20:41:53.203013
2023-04-01T15:27:23
2023-04-01T15:27:23
138,534,608
0
0
null
null
null
null
UTF-8
Java
false
false
719
java
package blind75; import java.util.Arrays; public class TrappedRainWater { public static void main(String[] args) { // int arr[] = {3, 0, 0, 2, 0, 4}; int arr[] = {1,8,6,2,5,4,8,3,7}; int n = 9; } public int maxArea(int[] height) { int maxArea = 0; int left = 0; int right = height.length - 1; while (left < right) { if (height[left] < height[right]) { maxArea = Math.max(maxArea, height[left] * (right - left)); left++; } else { maxArea = Math.max(maxArea, height[right] * (right - left)); right--; } } return maxArea; } }
c454888ac502b56668a9cfcc3a6169d6b8be0855
229ebc93bb4e2d237517a3e322bdb88ebe67c8f9
/poo/Agenda/src/PessoaFisica.java
b300ded1bda88208aa771c488a9ee56cbd70216a
[]
no_license
fredbr/usp
d145e6798c8e5617b18d3bcedcb8b7a36fa5f4ee
3e54a0167048ab4d25727876a87f60e683a258a4
refs/heads/master
2023-05-18T23:54:43.425159
2021-05-27T20:56:36
2021-05-27T20:56:36
181,331,797
1
0
null
null
null
null
UTF-8
Java
false
false
1,352
java
public class PessoaFisica extends Pessoa { private String nome, cpf, endereco, nascimento, email, estado_civil; PessoaFisica(String nome, String cpf, String endereco, String nascimento, String email, String estado_civil) { this.nome = nome; this.cpf = cpf; this.endereco = endereco; this.nascimento = nascimento; this.email = email; this.estado_civil = estado_civil; } @Override public String toString() { StringBuilder b = new StringBuilder(); b.append(String.format("Nome : %s\n", this.nome)); b.append(String.format("CPF : %s\n", this.cpf)); b.append(String.format("Endereco : %s\n", this.endereco)); b.append(String.format("Data de Nascimento : %s\n", this.nascimento)); b.append(String.format("Email : %s\n", this.email)); b.append(String.format("Estado civil : %s\n", this.estado_civil)); return b.toString(); } @Override public int compareTo(Pessoa rhs) { if (rhs instanceof PessoaFisica) { return cpf.compareTo(((PessoaFisica)rhs).cpf); } throw new IllegalArgumentException(); } public boolean equals(Object o) { if (o instanceof PessoaFisica) { return this.compareTo((PessoaFisica) o) == 0; } return false; } }
6932b67d807c1d2bf9e702a222f803dc58f2c9f6
e9affefd4e89b3c7e2064fee8833d7838c0e0abc
/aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/transform/ModelDashboardIndicatorActionMarshaller.java
e1e62736d4a6735ae6616ce8b468a2e886709e37
[ "Apache-2.0" ]
permissive
aws/aws-sdk-java
2c6199b12b47345b5d3c50e425dabba56e279190
bab987ab604575f41a76864f755f49386e3264b4
refs/heads/master
2023-08-29T10:49:07.379135
2023-08-28T21:05:55
2023-08-28T21:05:55
574,877
3,695
3,092
Apache-2.0
2023-09-13T23:35:28
2010-03-22T23:34:58
null
UTF-8
Java
false
false
2,080
java
/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.sagemaker.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.sagemaker.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * ModelDashboardIndicatorActionMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class ModelDashboardIndicatorActionMarshaller { private static final MarshallingInfo<Boolean> ENABLED_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("Enabled").build(); private static final ModelDashboardIndicatorActionMarshaller instance = new ModelDashboardIndicatorActionMarshaller(); public static ModelDashboardIndicatorActionMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(ModelDashboardIndicatorAction modelDashboardIndicatorAction, ProtocolMarshaller protocolMarshaller) { if (modelDashboardIndicatorAction == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(modelDashboardIndicatorAction.getEnabled(), ENABLED_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
7b60464b270535c9026ae53eb604cf2f691a4a97
e5c075c827d36cdcd96d7e9d94e058a30e2634e6
/app/src/androidTest/java/com/example/android/e_blood/ExampleInstrumentedTest.java
cc2645ca3b7d42b6daaea4af0af5dd170528a079
[]
no_license
NeelChakraborty/E-Blood
faa57694c01cbc8f75b4cc78659de184f98e8a19
e676e86302e0b68a5ec2b692ca70fbf062394062
refs/heads/master
2021-01-23T01:59:50.354586
2018-04-04T15:09:14
2018-04-04T15:09:14
85,954,333
0
2
null
null
null
null
UTF-8
Java
false
false
758
java
package com.example.android.e_blood; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.android.e_blood", appContext.getPackageName()); } }
1400f186a9fb72d42e2e811e5c678ffa73a538a4
45878453ab33f80ecde01133294b6db04ba9fdac
/GoPiGo/app/src/main/java/com/example/pc/gopigo/JSONParser.java
c60ca7053b17113f72e2ffe87eca5d3cc523438b
[]
no_license
MegaoucheNaima/GoPiGo-Project
0b8bed011149e4a2da1e9854d7c6441ea772a775
36accbbbc8cf987b0942769e477fcdb7f42a01fa
refs/heads/master
2021-01-22T18:51:08.991558
2016-12-29T18:36:29
2016-12-29T18:36:29
77,632,478
0
0
null
null
null
null
UTF-8
Java
false
false
3,305
java
package com.example.pc.gopigo; import android.util.Log; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.utils.URLEncodedUtils; import org.apache.http.impl.client.DefaultHttpClient; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.util.List; /** * Created by PC on 27/12/2016. */ public class JSONParser { static InputStream is = null; static JSONObject jObj = null; static String json = ""; // constructor public JSONParser() { } // function get json from url // by making HTTP POST or GET mehtod public JSONObject makeHttpRequest(String url, String method, List<NameValuePair> params) { // Making HTTP request try { // check for request method if(method == "POST"){ // request method is POST // defaultHttpClient DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(url); httpPost.setEntity(new UrlEncodedFormEntity(params)); HttpResponse httpResponse = httpClient.execute(httpPost); HttpEntity httpEntity = httpResponse.getEntity(); is = httpEntity.getContent(); }else if(method == "GET"){ // request method is GET DefaultHttpClient httpClient = new DefaultHttpClient(); String paramString = URLEncodedUtils.format(params, "utf-8"); url += "?" + paramString; HttpGet httpGet = new HttpGet(url); HttpResponse httpResponse = httpClient.execute(httpGet); HttpEntity httpEntity = httpResponse.getEntity(); is = httpEntity.getContent(); } } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } try { BufferedReader reader = new BufferedReader(new InputStreamReader( is, "iso-8859-1"), 8); StringBuilder sb = new StringBuilder(); String line = null; while ((line = reader.readLine()) != null) { sb.append(line + "\n"); } is.close(); json = sb.toString(); } catch (Exception e) { Log.e("Buffer Error", "Error converting result " + e.toString()); } // try parse the string to a JSON object try { jObj = new JSONObject(json); } catch (JSONException e) { Log.e("JSON Parser", "Error parsing data " + e.toString()); } // return JSON String return jObj; } }
3a974e5d9f9289d1f32d66c7088289d402b9fb64
58ebdbd6d43e888c1d3abc9a27ac2ab27766a8cf
/core/api/src/main/java/sh/isaac/api/TaxonomySnapshot.java
894394ec66ae180ab9ce613558d159f13a7dde71
[ "Apache-2.0" ]
permissive
TheAdityaKedia/ISAAC
f0f39afcbd4a73a80fca6dffc6327433806e7a02
9ca9ad77db6180fea8040a71315d64a0607e013d
refs/heads/master
2020-04-05T01:30:59.400122
2018-10-24T02:39:24
2018-10-24T02:39:24
156,439,190
0
0
Apache-2.0
2018-11-06T19:52:56
2018-11-06T19:52:56
null
UTF-8
Java
false
false
4,306
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * * You may not use this file except in compliance with the License. * * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * limitations under the License. * * Contributions from 2013-2017 where performed either by US government * employees, or under US Veterans Health Administration contracts. * * US Veterans Health Administration contributions by government employees * are work of the U.S. Government and are not subject to copyright * protection in the United States. Portions contributed by government * employees are USGovWork (17USC §105). Not subject to copyright. * * Contribution by contractors to the US Veterans Health Administration * during this period are contractually contributed under the * Apache License, Version 2.0. * * See: https://www.usa.gov/government-works * * Contributions prior to 2013: * * Copyright (C) International Health Terminology Standards Development Organisation. * Licensed under the Apache License, Version 2.0. * */ package sh.isaac.api; //~--- JDK imports ------------------------------------------------------------ //~--- non-JDK imports -------------------------------------------------------- import java.util.Collection; import sh.isaac.api.collections.NidSet; import sh.isaac.api.coordinate.ManifoldCoordinate; import sh.isaac.api.tree.Tree; //~--- interfaces ------------------------------------------------------------- /** * The Interface TaxonomySnapshot. * * @author kec */ public interface TaxonomySnapshot { /** * * @param conceptNid concept to test if it is a leaf node * @return true if the node is a leaf (it has no children) */ boolean isLeaf(int conceptNid); /** * Checks if child of. * * @param childConceptNid the child id * @param parentConceptNid the parent id * @return true, if child of */ boolean isChildOf(int childConceptNid, int parentConceptNid); /** * Checks if kind of. * * @param childConceptNid the child id * @param parentConceptNid the parent id * @return true, if kind of */ boolean isKindOf(int childConceptNid, int parentConceptNid); /** * Gets the kind of nid set. * * @param rootConceptNid the root id * @return the kind of nid set */ NidSet getKindOfConceptNidSet(int rootConceptNid); /** * Gets the roots. * * @return the root concept nids */ int[] getRootNids(); /** * Gets the taxonomy child nids. * * @param parentConceptNid the parent id * @return the taxonomy child concept nids */ int[] getTaxonomyChildConceptNids(int parentConceptNid); /** * Gets the taxonomy parent nids. * * @param childConceptNid the child id * @return the taxonomy parent nids */ int[] getTaxonomyParentConceptNids(int childConceptNid); /** * For circumstances where there is more than one type of relationship in the taxonomy. * @param parentConceptNid * @return an Iterable of all the parent taxonomy links. */ Collection<TaxonomyLink> getTaxonomyParentLinks(int parentConceptNid); /** * For circumstances where there is more than one type of relationship in the taxonomy. * @param childConceptNid * @return an Iterable of all the child taxonomy links. */ Collection<TaxonomyLink> getTaxonomyChildLinks(int childConceptNid); /** * Gets the taxonomy tree. * * @return the taxonomy tree */ Tree getTaxonomyTree(); /** * Get the ManifoldCoordinate which defines the parent/child relationships of this tree. * @return ManifoldCoordinate */ ManifoldCoordinate getManifoldCoordinate(); /** * * @param manifoldCoordinate * @return An analog snapshot that uses the provided manifold coordinate. */ TaxonomySnapshot makeAnalog(ManifoldCoordinate manifoldCoordinate); }
2d795e06c65f5b8d26f8af2645e1acf6d0ba900f
8b96417ea286f9b2d3ec7d448e1a31c0ba8d57cb
/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/LongValueIterator.java
44dfd42f0603df0d208b918c19b87cf451eba487
[ "ECL-2.0" ]
permissive
deemsys/Deemsys_Learnguild
d5b11c5d1ad514888f14369b9947582836749883
606efcb2cdc2bc6093f914f78befc65ab79d32be
refs/heads/master
2021-01-15T16:16:12.036004
2013-08-13T12:13:45
2013-08-13T12:13:45
12,083,202
0
1
null
null
null
null
UTF-8
Java
false
false
1,644
java
package edu.indiana.lib.osid.base.repository; /********************************************************************************** * $URL: https://source.sakaiproject.org/svn/citations/tags/sakai-2.9.2/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/LongValueIterator.java $ * $Id: LongValueIterator.java 59673 2009-04-03 23:02:03Z [email protected] $ ********************************************************************************** * * Copyright (c) 2003, 2004, 2005, 2007, 2008 The Sakai Foundation * * Licensed under the Educational Community 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.osedu.org/licenses/ECL-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 abstract class LongValueIterator implements org.osid.shared.LongValueIterator { public boolean hasNextLongValue() throws org.osid.shared.SharedException { throw new org.osid.repository.RepositoryException(org.osid.OsidException.UNIMPLEMENTED); } public long nextLongValue() throws org.osid.shared.SharedException { throw new org.osid.repository.RepositoryException(org.osid.OsidException.UNIMPLEMENTED); } }
460408a29a840eb4deb5ec6b1fa7cf5ab7b3c79a
b5e7b4ffd6b7e47382dd89da13ae0eafd319b8a9
/app/src/main/java/com/example/thuongmaidientu/DetailNotificationActivity.java
03401995dd93e7035f5d49092d99b2907b45e440
[]
no_license
thongtyl/Rimini
1f033599175227268498e18638d9e552dc543b7c
0009eae7c17f3733e86234f763e81eafc13d98d5
refs/heads/master
2020-11-26T15:11:28.353196
2019-12-19T18:45:01
2019-12-19T18:45:01
229,117,624
0
0
null
null
null
null
UTF-8
Java
false
false
1,037
java
package com.example.thuongmaidientu; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.widget.TextView; import com.example.thuongmaidientu.object.Notifications; public class DetailNotificationActivity extends AppCompatActivity { TextView ten, noidung; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail_notification); ActionBar actionBar = getSupportActionBar(); actionBar.hide(); ten = findViewById(R.id.text_not_name); noidung = findViewById(R.id.text_not_content); Intent intent = getIntent(); if (intent!=null) { Notifications notifications = (Notifications) intent.getSerializableExtra("notification"); ten.setText(notifications.getName()); noidung.setText(notifications.getContent()); } } }
f89c970737f1092cedc49240d2c911cad822ff71
6a49268b60bce8f4cfa3758037560f44ac098d7c
/src/main/java/no/itera/bloggingplatform/service/impl/PostServiceImpl.java
f7d780c6d8a297ea15f3d0b6fa9a8ab4af1bd294
[]
no_license
tmikeska/blogging-platform-dev-academy
df8cfa0ddaed581f11f0de8c2b55a484b8621ea7
b183b31b37eacdfe9f1a83e7406b4d66747cdb23
refs/heads/master
2020-04-07T05:23:18.916736
2018-11-19T12:33:45
2018-11-19T12:33:45
158,094,892
0
0
null
2018-11-18T14:54:49
2018-11-18T14:54:49
null
UTF-8
Java
false
false
1,402
java
package no.itera.bloggingplatform.service.impl; import no.itera.bloggingplatform.model.Post; import no.itera.bloggingplatform.repository.PostRepository; import no.itera.bloggingplatform.service.PostService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class PostServiceImpl implements PostService { private PostRepository postRepository; @Autowired public PostServiceImpl(PostRepository postRepository) { this.postRepository = postRepository; } @Override public List<Post> listAllPosts() { return postRepository.readAll(); } @Override public Post createNewPost(Post post) { return postRepository.create(post); } @Override public List<Post> findByAuthor(Long authorId) { return postRepository.findByAuthor(authorId); } @Override public List<Post> findByCategory(Long categoryId) { return postRepository.findByCategory(categoryId); } @Override public Post findPostById(Long postId) { return postRepository.read(postId); } @Override public Post updatePost(Long postId, Post toUpdate) { return postRepository.update(postId, toUpdate); } @Override public Post deletePost(Long postId) { return postRepository.delete(postId); } }
974bd2d91d08e58fdaeee77a80199325a03f9592
8da59839782bd866fb5865f50f9055a2af66be92
/sparck/source/java/src/com/tecartlab/quescript/commands/CmndAnim.java
3e208a9183fa9c26ed5636bd442abc3add97d37b
[ "MIT" ]
permissive
tecartlab/SPARCK
cfbcc4571cd9a08a5e371042b12e00f5a69ccad8
db3fe6d4702b2fe593848cfef8df3a4f16548cfe
refs/heads/master
2022-10-14T21:49:34.373411
2022-09-12T14:12:28
2022-09-12T14:12:28
237,415,501
27
3
null
null
null
null
UTF-8
Java
false
false
10,926
java
/* MIT License * * Copyright (c) 2012-2020 tecartlab.com * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * @author maybites * */ package com.tecartlab.quescript.commands; import java.util.ArrayList; import java.util.Iterator; import org.w3c.dom.Node; import com.tecartlab.quescript.expression.ExpressionNode; import com.tecartlab.quescript.expression.RunTimeEnvironment; import com.tecartlab.quescript.expression.Expression.ExpressionException; import com.tecartlab.quescript.messages.CMsgAnim; import com.tecartlab.quescript.messages.CMsgFade; import com.tecartlab.quescript.messages.CMsgFadedOut; import com.tecartlab.quescript.messages.CMsgShuttle; import com.tecartlab.quescript.messages.CMsgTime; import com.tecartlab.quescript.messages.ScriptMsgException; import com.tecartlab.utils.Debug; public class CmndAnim extends Cmnd { public static String NODE_NAME = "anim"; private static String ATTR_LOOP = "loop"; private static String ATTR_NAME = "name"; private static String ATTR_DURATION = "duration"; private static String ATTR_FADEOUT = "fadeout"; private static String ATTR_LOOP_VAL_NO = "no"; private static String ATTR_LOOP_VAL_NORMAL = "normal"; private static String ATTR_LOOP_VAL_PALINDROME = "palindrome"; private final static int LOOP_MODE_NONE = 1; private final static int LOOP_MODE_NORMAL = 2; private final static int LOOP_MODE_PALINDROME = 3; private final static int EXECUTE_OFF = 0; private final static int EXECUTE = LOOP_MODE_NONE; private final static int EXECUTE_LOOP = LOOP_MODE_NORMAL; private final static int EXECUTE_PALINDROME = LOOP_MODE_PALINDROME; private final static int EXECUTE_PAUSE = 4; private final static int EXECUTE_FADEOUT = 5; private int loop; private String name; private CMsgTime durationTime; private CMsgTime fadeoutTime; private CMsgTime fadeoutTime_original; private CMsgTime executionTime; int runMode = EXECUTE_OFF; boolean palindromDirection = false; ArrayList<CmndTrack> valueInterolators; double[] relKeyTiming = null; RunTimeEnvironment prt; public CmndAnim(Cmnd _parentNode){ super(_parentNode); super.setCmndName(NODE_NAME); } public void build(Node _xmlNode) throws ScriptMsgException{ super.build(_xmlNode); if(this.getAttributeValue(ATTR_LOOP).equals(ATTR_LOOP_VAL_NO)) loop = LOOP_MODE_NONE; else if(this.getAttributeValue(ATTR_LOOP).equals(ATTR_LOOP_VAL_NORMAL)) loop = LOOP_MODE_NORMAL; else if(this.getAttributeValue(ATTR_LOOP).equals(ATTR_LOOP_VAL_PALINDROME)) loop = LOOP_MODE_PALINDROME; name = getAttributeValue(ATTR_NAME); } /** * Parse the Expressions with the RuntimeEnvironement */ public void setup(RunTimeEnvironment rt)throws ScriptMsgException{ prt = new RunTimeEnvironment(rt); if(debugMode) Debug.verbose("QueScript - NodeFactory", "que("+parentNode.getQueName()+") "+new String(new char[getLevel()]).replace('\0', '_')+" created Anim Comnd: name='" + name +"'"); // first the attribute values String expr = "notset"; try { expr = getAttributeValue(ATTR_DURATION); durationTime = getAttributeTime(expr, " at line(" + lineNumber + ")",prt); if(hasAttributeValue(ATTR_FADEOUT)){ expr = getAttributeValue(ATTR_FADEOUT); fadeoutTime = getAttributeTime(expr, " at line(" + lineNumber + ")",prt); // a fadeout time of zero is causing troubles with the algorithm: // better set it to very short. if(fadeoutTime.getTotalMillis()==0){ fadeoutTime = new CMsgTime(new ExpressionNode(1), 0); } fadeoutTime_original = fadeoutTime.clone(); } } catch (ScriptMsgException e1) { throw new ScriptMsgException("<que name=\""+parentNode.getQueName()+"\"> <anim name=\""+name+"\" ("+expr+")>: "+e1.getMessage()); } catch (ExpressionException e1) { throw new ScriptMsgException("<que name=\""+parentNode.getQueName()+"\"> <anim name=\""+name+"\" ("+expr+")>: "+e1.getMessage()); } // now we can get the keyTimes for(Cmnd child: this.getChildren()){ if(child.isCmndName(CmndKeys.NODE_NAME)){ // if there is a keys command, get the keyTimes. CmndKeys snd = (CmndKeys)child; relKeyTiming = snd.getKeyTimes(durationTime.getTotalMillis()); } } valueInterolators = new ArrayList<CmndTrack>(); for(Cmnd child: this.getChildren()){ if(child.isCmndName(CmndTrack.NODE_NAME)){ CmndTrack flt = (CmndTrack)child; prt.setVariable(name+"."+flt.trackName, flt.getValueObject(), 1); prt.addLocalVariable(flt.trackName, flt.getValueObject()); valueInterolators.add(flt); if(relKeyTiming != null) flt.setKeyTimes(relKeyTiming); } } // Make sure the que- and local- variables are created before the children are parsed for(Cmnd child: this.getChildren()){ child.setup(prt); } } @Override public void store(Node _parentElement) { // TODO Auto-generated method stub } @Override public void bang(CMsgShuttle _msg) { if(_msg.isInStopMode() && (runMode != EXECUTE_OFF)){ // if there is a stop message (called by the stop command or the interruption // of the que), // if a fadeout is set: if(fadeoutTime != null){ // and there is a fadeout time set, then it attempts to reach the fadeout target // it is a fullstop message, then it will try to reach // the fadeout target immediately if(_msg.isInFullStopMode()){ // make sure the execution is running, but only once so it is set to the // defined fadeout values runMode = EXECUTE_FADEOUT; setFade2Mode(runMode); palindromDirection = false; executionTime = _msg.getFrameTime().subtract(fadeoutTime); // Debugger.info("Script - Command <ramp> fullstop", "set execution time("+executionTime.print()+")"); } else if(_msg.isInShutDownMode() && runMode != EXECUTE_FADEOUT){ // or its a shutdown message and it allows to reach with the default fadeout time runMode = EXECUTE_FADEOUT; setFade2Mode(runMode); palindromDirection = false; executionTime = _msg.getFrameTime().subtract(_msg.deltaFrameTime); // Debugger.info("Script - Command <ramp> shutdown", "set execution time("+executionTime.print()+")"); } } else { // otherwise it stops the ramp if it is in LOOP and still executing if(runMode == EXECUTE_LOOP || runMode == EXECUTE_PALINDROME || _msg.isInFullStopMode()){ palindromDirection = false; runMode = EXECUTE_OFF; } // this also means that it will allow to finish the ramp } } else if(_msg.hasFadeMessage(name) && (runMode != EXECUTE_OFF && runMode != EXECUTE_FADEOUT)){ // if there is a fade message use the fade message value // Debugger.verbose("Script Ramp - Command", "received fade message"); runMode = EXECUTE_FADEOUT; setFade2Mode(runMode); palindromDirection = false; executionTime = _msg.getFrameTime().subtract(_msg.deltaFrameTime); // Debugger.info("Script - Command <ramp> fade", "set execution time("+executionTime.print()+")"); CMsgFade fade = _msg.getFadeMessage(name); fade.tagForDeletion(); if(fade.hasFadeTime()) fadeoutTime = fade.getFadeTime(); } else { // here the ramp is actually started. if(!_msg.isWaitLocked() && (runMode == EXECUTE_OFF || runMode == EXECUTE_PAUSE)){ runMode = loop; setFade2Mode(runMode); palindromDirection = false; executionTime = _msg.getFrameTime(); // Debugger.info("Script - Command <ramp> start", "set execution time("+executionTime.print()+")"); fadeoutTime = fadeoutTime_original; } } // and in here the calculations are done if(runMode != EXECUTE_OFF && runMode != EXECUTE_PAUSE){ long passedTime = _msg.getFrameTime().subtract(executionTime).getTotalMillis(); float normalizedTime; if(runMode == EXECUTE_FADEOUT){ normalizedTime = (float)passedTime / (float)fadeoutTime.getTotalMillis(); // Debugger.info("Script - Command <ramp> execute", "passedTime = "+passedTime+" | normalizedTime = " + normalizedTime); }else{ normalizedTime = (float)passedTime / (float)durationTime.getTotalMillis(); } // now make sure it will be exactly 1 if time passes the duration normalizedTime = (normalizedTime > 1.0)? 1.0f: normalizedTime; // and then turn it depending of the palindrome direction execute(normalizedTime, _msg); // in here the decision is made what to do when the target time has been reached if(normalizedTime == 1.0f){ switch(runMode){ case EXECUTE_FADEOUT: runMode = EXECUTE_OFF; _msg.addMessage(new CMsgFadedOut(name)); break; case EXECUTE: runMode = (fadeoutTime != null)? EXECUTE_PAUSE: EXECUTE_OFF; _msg.addMessage(new CMsgAnim(name)); break; case EXECUTE_LOOP: executionTime = _msg.getFrameTime(); break; case EXECUTE_PALINDROME: executionTime = _msg.getFrameTime(); palindromDirection = !palindromDirection; break; } } // and tell the que command that it is still running _msg.addNodesStillRunning(); } } public void lockLessBang(CMsgShuttle _msg){;} private void execute(float _normalizedTime, CMsgShuttle _msg){ _normalizedTime = (palindromDirection)? 1.0f - _normalizedTime: _normalizedTime; // Debugger.verbose("Script - Command Ramp", "normalized time: " + _normalizedTime); Iterator<CmndTrack> e = valueInterolators.iterator(); while(e.hasNext()) e.next().calculate(_normalizedTime); for(Cmnd snd: getChildren()) snd.lockLessBang(_msg); } private void setFade2Mode(int _mode){ Iterator<CmndTrack> e = valueInterolators.iterator(); while(e.hasNext()) e.next().fadeToMode((_mode == EXECUTE_FADEOUT)? true: false); } public void resume(long _timePassed) { if(executionTime != null){ executionTime.add(_timePassed); } } public void clear(){ if(valueInterolators != null) valueInterolators.clear(); for(Cmnd child: getChildren()){ child.clear(); } } }
6d5ee8bc91773c3160464f65af5d622a1a6b9085
19bf1f39bdff76292fd5d0ebe00ca082e4ee3a0e
/src/main/java/com/ql/util/express/instruction/op/OperatorPrintln.java
44a4b6d3b361ab7b31708c2a286ca28b7be5e9f8
[ "Apache-2.0" ]
permissive
hakusa/QLExpress
d6feab9fa0eb00cd83ae6fe1405d2927d9193de5
a14f2e1fce2f5127158bb91a587549d6e7156278
refs/heads/master
2022-11-24T10:57:42.279189
2020-07-27T13:18:50
2020-07-27T13:18:50
282,630,367
1
0
Apache-2.0
2020-07-26T10:54:18
2020-07-26T10:54:17
null
UTF-8
Java
false
false
640
java
package com.ql.util.express.instruction.op; import com.ql.util.express.Operator; import com.ql.util.express.exception.QLException; public class OperatorPrintln extends Operator { public OperatorPrintln(String name) { this.name = name; } public OperatorPrintln(String aAliasName, String aName, String aErrorInfo) { this.name = aName; this.aliasName = aAliasName; this.errorInfo = aErrorInfo; } public Object executeInner(Object[] list) throws Exception { if (list.length != 1 ){ throw new QLException("操作数异常,有且只能有一个操作数"); } System.out.println(list[0]); return null; } }
d6be9857fd583540735a0a2bd23dc795c384503d
e65171e3e787c958748f34e10f56393ceb416e5b
/src/net/slashie/serf/ui/EffectFactory.java
857bb0398c337d008a79b0204d57fd960e08c9f2
[]
no_license
slashman/serf-engine
bb009b9541ccc158a8f442da9f396b31fc16b132
93ab5800f6d507ce91bee8d4e83f95ef5c7e9658
refs/heads/master
2021-12-30T08:49:22.238391
2021-11-11T20:06:00
2021-11-11T20:06:00
32,949,992
0
2
null
2016-04-03T03:26:31
2015-03-26T20:24:26
Java
UTF-8
Java
false
false
586
java
package net.slashie.serf.ui; import net.slashie.utils.Position; public abstract class EffectFactory { private static EffectFactory singleton; public static void setSingleton(EffectFactory ef){ singleton = ef; } public static EffectFactory getSingleton(){ return singleton; } public abstract Effect createDirectedEffect(Position start, Position end, String ID, int length); public abstract Effect createDirectionalEffect(Position start, int direction, int depth, String ID); public abstract Effect createLocatedEffect(Position location, String ID); }
[ "java.koder@51ccf7a8-1371-11de-a6cc-771c510851eb" ]
java.koder@51ccf7a8-1371-11de-a6cc-771c510851eb
505048a9e4ce2cf5beb9ee1780a0b559768c689c
3544500a5360894c1ade5c7924d35726fa36f51d
/app/src/main/java/com/shanawaz/flink/flink/JobFullDescription.java
7a092877a9b7fda2cd3c2ff81be16a7016241d55
[]
no_license
shanawazmemon6/Flink_Android_Application
0527319837848df9af9fa4d97b3e0295cb1269da
f7cc677553a9aa63e6fc0a4b6b16fd33f13fd3e6
refs/heads/master
2020-05-27T21:17:48.770332
2017-03-28T15:36:39
2017-03-28T15:36:39
83,653,071
0
0
null
null
null
null
UTF-8
Java
false
false
4,790
java
package com.shanawaz.flink.flink; import android.app.Activity; import android.app.ActivityOptions; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.transition.Explode; import android.transition.Fade; import android.transition.Slide; import android.view.Gravity; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import com.google.gson.Gson; import com.shanawaz.flink.flink.model.JobApplied; import com.shanawaz.flink.flink.model.JobDetails; import com.shanawaz.flink.flink.model.UserDetails; import org.springframework.http.converter.FormHttpMessageConverter; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.StringHttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.web.client.RestTemplate; import java.util.ArrayList; import java.util.List; public class JobFullDescription extends AppCompatActivity { TextView job_title_text,job_desc,job_status,job_date,job_quali; Button apply; RestBasicInfo restBasicInfo; Gson gson; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_job_full_description); /*getWindow().setStatusBarColor(R.color.Status);*/ gson=new Gson(); Intent getIntent=getIntent(); final String jobList=getIntent.getStringExtra("job_list"); final JobDetails job_details=gson.fromJson(jobList,JobDetails.class); job_title_text= (TextView) findViewById(R.id.desc_title); job_desc= (TextView) findViewById(R.id.job_desc); job_status=(TextView)findViewById(R.id.job_status); job_date= (TextView) findViewById(R.id.job_posted); job_quali=(TextView) findViewById(R.id.job_quali) ; apply=(Button)findViewById(R.id.job_apply) ; job_title_text.setText(""+job_details.getTitle()); job_desc.setText(""+job_details.getDescription()); job_status.setText(""+job_details.getStatus()); job_date.setText(""+job_details.getDate_time()); job_quali.setText(""+job_details.getQualification()); restBasicInfo=new RestBasicInfo(); String checkurl=""+restBasicInfo.BASE_URL+"check"; JobApplied jobApplied=new JobApplied(); jobApplied.setJobid(job_details.getId()); SharedPreferences sharedPreferences = getSharedPreferences("login_credentials", MODE_PRIVATE); final String user_details = sharedPreferences.getString("login_user", ""); final UserDetails prefence_user = gson.fromJson(user_details, UserDetails.class); jobApplied.setUsername(prefence_user.getUsername()); final RestTemplate rest =restBasicInfo.converters(); boolean status=rest.postForObject(checkurl,jobApplied,Boolean.class); if(status){ apply.setText("Apply"); }else { apply.setText("Already Job Applied"); } apply.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String url=""+restBasicInfo.BASE_URL+"applyJob"; RestTemplate re =restBasicInfo.converters(); SharedPreferences sharedPreferences = getSharedPreferences("login_credentials", MODE_PRIVATE); final String user_details = sharedPreferences.getString("login_user", ""); final UserDetails prefence_user = gson.fromJson(user_details, UserDetails.class); JobApplied jobApplied=new JobApplied(); String apply="applied"; jobApplied.setStatus_job(apply); jobApplied.setJobid(job_details.getId()); jobApplied.setUsername(prefence_user.getUsername()); jobApplied.setJobtitle(job_details.getTitle()); String applied= re.postForObject(url,jobApplied,String.class); JobApplied jobapply=gson.fromJson(applied,JobApplied.class); if(jobapply.getCode().equals("200")){ startActivity(new Intent(getApplicationContext(),UserActivity.class)); Toast.makeText(JobFullDescription.this, "applied Successfully", Toast.LENGTH_SHORT).show(); } } }); } @Override public void onBackPressed() { /* Intent intent=new Intent(getApplicationContext(),UserActivity.class); intent.putExtra("veiw_pager",1); startActivity(intent);*/ super.onBackPressed(); } }
610533c7a574f3e39e9c54e4f2d89a69d8c42308
eaf35125394035ce4fb6b1342c17f3629e7cf5f0
/01_Java/src/basico/Direccion.java
7ddfc87c1e98808e95f70c21484c7d0c3bec0844
[]
no_license
fdepablo/WsBecaBabel
0a1dec1aa26220af84a183b44b2baff95f0c4ec5
0e787b068dc068eb15d9b30d870e4bac32c4d195
refs/heads/master
2023-08-28T10:25:50.223540
2021-11-05T13:06:49
2021-11-05T13:06:49
414,524,333
0
0
null
null
null
null
UTF-8
Java
false
false
953
java
package basico; public class Direccion { private String tipoVia; private String nombreVia; private String ciudad; private String cp; //Bidreccinalidad /* private Persona persona; public Persona getPersona() { return persona; } public void setPersona(Persona persona) { this.persona = persona; }*/ public String getTipoVia() { return tipoVia; } public void setTipoVia(String tipoVia) { this.tipoVia = tipoVia; } public String getNombreVia() { return nombreVia; } public void setNombreVia(String nombreVia) { this.nombreVia = nombreVia; } public String getCiudad() { return ciudad; } public void setCiudad(String ciudad) { this.ciudad = ciudad; } public String getCp() { return cp; } public void setCp(String cp) { this.cp = cp; } @Override public String toString() { return "Direccion [tipoVia=" + tipoVia + ", nombreVia=" + nombreVia + ", ciudad=" + ciudad + ", cp=" + cp + "]"; } }
e0e122a4149535beb01fcdec20b4609e16b7d025
27f65daf5b374e49661aa9b9d5ddf884ada72c1e
/src/main/java/com/graviton/lambda/calendar/CreateCalendar.java
f2026263b409347bc140f5bac796cb2b4a4c48f0
[]
no_license
SixingYan/Calendar-Management-System-G
fe3faa7d20b7bc3ae23e718aa9c8432a0f1e11fe
54580eeacc90b0dda8292354d991ede4b2f79b40
refs/heads/master
2020-04-03T18:22:46.455203
2018-12-11T23:00:05
2018-12-11T23:00:05
155,481,486
0
0
null
null
null
null
UTF-8
Java
false
false
652
java
package com.graviton.lambda.calendar; import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.graviton.lambda.calendar.db.DBMgr; import com.graviton.lambda.calendar.model.*; /** * @author Yichen Li | Sixing Yan */ public class CreateCalendar implements RequestHandler<Calendar, ResultResponse> { //@Override public ResultResponse handleRequest(Calendar cld, Context context) { DBMgr db=new DBMgr(); if(db.doCPC(cld)) return new ResultResponse(true, 0, "OK"); else return new ResultResponse(false, -1, "error"); } }
0dd640d20514156d1a564b241d271dba952df332
12968b301b86804c610d507ebf89b322467d134f
/src/test/java/TestRunner.java
f7e4bcd1d62b50731f9de30768275d679915fb7c
[]
no_license
Yoodahun/APITest-using-Java-RestAssured-for-FlaskRESTful
3b9b28dc85381d858bfacd73ba14b137f75dc0f7
27ac2ee759077fada8501af00ed35bd461a11e11
refs/heads/master
2023-08-25T11:24:24.114549
2021-09-26T07:29:31
2021-09-26T07:29:31
347,521,193
0
0
null
null
null
null
UTF-8
Java
false
false
333
java
import io.cucumber.testng.AbstractTestNGCucumberTests; import io.cucumber.testng.CucumberOptions; @CucumberOptions( features = "src/test/java/features", glue = "stepDefinition", tags = "@RegressionTest or @User or @login or @Store or @Item" ) public class TestRunner extends AbstractTestNGCucumberTests { }
87d5a35ada7c88dcc2e45891e7c05d297d27ac22
0a8e84b18a5d328a4926ca5a2d0325b9471c9a72
/tmql4j-path/src/main/java/de/topicmapslab/tmql4j/path/grammar/lexical/Datatype.java
cbdc9a1bc24f1d5a375f513985fae49f9024415c
[]
no_license
tmlab/tmql
5b2204c416852661320ee449fb501dd194c128e0
45a537d433ba3ab45808f1aa6446ba5ac2bcfb8e
refs/heads/master
2021-01-10T02:40:07.473546
2011-04-29T09:16:50
2011-04-29T09:16:50
36,683,495
1
0
null
null
null
null
UTF-8
Java
false
false
819
java
/* * TMQL4J - Javabased TMQL Engine * * Copyright: Copyright 2010 Topic Maps Lab, University of Leipzig. http://www.topicmapslab.de/ * License: Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0.html * * @author Sven Krosse * @email [email protected] * */ package de.topicmapslab.tmql4j.path.grammar.lexical; import de.topicmapslab.tmql4j.components.processor.runtime.ITMQLRuntime; import de.topicmapslab.tmql4j.grammar.lexical.Token; public class Datatype extends Token { public static final String TOKEN = "^^"; /** * {@inheritDoc} */ public String getLiteral() { return TOKEN; } /** * {@inheritDoc} */ public boolean isToken(ITMQLRuntime runtime, String literal) { return literal.startsWith(TOKEN); } }
[ "hoyer@localhost" ]
hoyer@localhost
b437dad2d3f86e061f75514a5bd1397658275858
f8d8920a5be6698ae95e962ebb59133e40e525ac
/src/main/java/com/when/design_pattern/chain_of_responsibility_pattern/sensitive_world/SensitiveWordFilter.java
50f63015265d08c6cc810343f7ad82598f4cbd3e
[]
no_license
knowhen/design-pattern
9b9230ad6718b07c0b5a3b3a2280980f7ce19e07
114b99a35eed39d6e331a83b055ec7ebff924c04
refs/heads/master
2021-06-30T10:50:10.307026
2020-04-29T08:24:10
2020-04-29T08:24:10
175,111,566
0
0
null
null
null
null
UTF-8
Java
false
false
161
java
package com.when.design_pattern.chain_of_responsibility_pattern.sensitive_world; public interface SensitiveWordFilter { boolean doFilter(String content); }
ede2bab64cbad247a76b335cd3d9cca1c623e7a9
86505462601eae6007bef6c9f0f4eeb9fcdd1e7b
/bin/platform/ext/workflow/testsrc/de/hybris/platform/workflow/integration/WorkflowCompatibleTest.java
b3f7cbd6f9b3bc9f6b4353fbaea3d5da47170da7
[]
no_license
jp-developer0/hybrisTrail
82165c5b91352332a3d471b3414faee47bdb6cee
a0208ffee7fee5b7f83dd982e372276492ae83d4
refs/heads/master
2020-12-03T19:53:58.652431
2020-01-02T18:02:34
2020-01-02T18:02:34
231,430,332
0
4
null
2020-08-05T22:46:23
2020-01-02T17:39:15
null
UTF-8
Java
false
false
21,182
java
/* * [y] hybris Platform * * Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package de.hybris.platform.workflow.integration; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertNull; import static junit.framework.Assert.assertTrue; import static junit.framework.Assert.fail; import de.hybris.bootstrap.annotations.DemoTest; import de.hybris.platform.catalog.CatalogVersionService; import de.hybris.platform.catalog.model.CatalogModel; import de.hybris.platform.catalog.model.CatalogVersionModel; import de.hybris.platform.category.model.CategoryModel; import de.hybris.platform.core.PK; import de.hybris.platform.core.Registry; import de.hybris.platform.core.model.ItemModel; import de.hybris.platform.core.model.product.ProductModel; import de.hybris.platform.core.model.user.UserModel; import de.hybris.platform.jalo.ConsistencyCheckException; import de.hybris.platform.jalo.security.AccessManager; import de.hybris.platform.jalo.security.UserRight; import de.hybris.platform.jalo.type.TypeManager; import de.hybris.platform.jalo.user.User; import de.hybris.platform.jalo.user.UserManager; import de.hybris.platform.servicelayer.ServicelayerTransactionalTest; import de.hybris.platform.servicelayer.exceptions.ModelSavingException; import de.hybris.platform.servicelayer.model.ModelService; import de.hybris.platform.servicelayer.type.TypeService; import de.hybris.platform.servicelayer.user.UserService; import de.hybris.platform.workflow.WorkflowActionService; import de.hybris.platform.workflow.WorkflowProcessingService; import de.hybris.platform.workflow.WorkflowService; import de.hybris.platform.workflow.enums.WorkflowActionStatus; import de.hybris.platform.workflow.jalo.WorkflowAction; import de.hybris.platform.workflow.model.AbstractWorkflowActionModel; import de.hybris.platform.workflow.model.WorkflowActionModel; import de.hybris.platform.workflow.model.WorkflowActionTemplateModel; import de.hybris.platform.workflow.model.WorkflowItemAttachmentModel; import de.hybris.platform.workflow.model.WorkflowModel; import de.hybris.platform.workflow.model.WorkflowTemplateModel; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.List; import javax.annotation.Resource; import org.junit.Before; import org.junit.Test; /** * Test for extension Workflow. */ @DemoTest public class WorkflowCompatibleTest extends ServicelayerTransactionalTest { /** * Template instance created at each set up. */ private WorkflowTemplateModel testTemplate = null; /** * workflow instance created at each set up. */ private WorkflowModel testWorkflow = null; @Resource(name = "newestWorkflowService") protected WorkflowService workflowService; @Resource protected ModelService modelService; @Resource protected UserService userService; @Resource protected TypeService typeService; @Resource protected CatalogVersionService catalogVersionService; @Resource protected WorkflowActionService workflowActionService; @Resource protected WorkflowProcessingService workflowProcessingService; private static enum CODES { ACTION1, ACTION2, ACTION3, ACTION4, ACTION5 } //@Override @Before public void setUp() throws Exception { final CatalogModel testCatalog = modelService.create(CatalogModel.class); testCatalog.setId("DefaultTestCatalog"); modelService.save(testCatalog); final CatalogVersionModel testCv = modelService.create(CatalogVersionModel.class); testCv.setVersion("Online"); testCv.setCatalog(testCatalog); modelService.save(testCv); catalogVersionService.addSessionCatalogVersion(testCv); final UserModel testUser = createUser("TestUser"); testTemplate = createWorkflowTemplate(testUser); // check actions template size final Collection<WorkflowActionTemplateModel> actionTemplates = testTemplate.getActions(); assertEquals("Excpected number of actions", 5, actionTemplates.size()); testWorkflow = workflowService.createWorkflow(testTemplate, testUser); workflowProcessingService.toggleActions(testWorkflow); assertNotNull("Workflow not null", testWorkflow); // check actions size final Collection<WorkflowActionModel> actions = testWorkflow.getActions(); assertEquals("Excpected number of actions", 5, actions.size()); } protected UserModel createUser(final String userName) { User user = null; try { user = UserManager.getInstance().createCustomer(userName); final UserRight readRight = AccessManager.getInstance().getOrCreateUserRightByCode(AccessManager.READ); assertNotNull("UserRight should not be null", readRight); TypeManager.getInstance().getComposedType(WorkflowAction.class).addPositivePermission(user, readRight); assertNotNull("User should not be null", user); } catch (final ConsistencyCheckException e) { fail("Can not create user caused by: " + e.getMessage()); } return modelService.get(user); } /** * Checks if actions of test workflow has correct status. */ @Test public void testWorkflowCreate() { // test action 1 final WorkflowActionModel action1 = getAction(CODES.ACTION1.name()); assertEquals(action1.getPredecessors().size(), 0); assertFalse(workflowActionService.isDisabled(action1)); // test action 2 final WorkflowActionModel action2 = getAction(CODES.ACTION2.name()); assertEquals(action2.getPredecessors().size(), 0); assertFalse(workflowActionService.isDisabled(action2)); // test action 3 final WorkflowActionModel action3 = getAction(CODES.ACTION3.name()); assertEquals(action3.getPredecessors().size(), 2); assertFalse(workflowActionService.isDisabled(action3)); // test action 4 final WorkflowActionModel action4 = getAction(CODES.ACTION4.name()); assertEquals(action4.getPredecessors().size(), 1); assertFalse(workflowActionService.isDisabled(action4)); // test action 5 final WorkflowActionModel action5 = getAction(CODES.ACTION5.name()); assertEquals(action5.getPredecessors().size(), 1); assertFalse(workflowActionService.isDisabled(action5)); } /** * Disable actions 1 and 2 of test workflow and checks the status of the workflow actions. */ @Test public void testWorkflowCreateDisableActivate() { // disable some actions WorkflowActionModel action1 = getAction(CODES.ACTION1.name()); workflowActionService.disable(action1); WorkflowActionModel action2 = getAction(CODES.ACTION2.name()); workflowActionService.disable(action2); workflowProcessingService.toggleActions(testWorkflow); // test action 1 action1 = getAction(CODES.ACTION1.name()); assertTrue(workflowActionService.isDisabled(action1)); assertTrue(workflowActionService.isCompleted(action1)); // test action 2 action2 = getAction(CODES.ACTION2.name()); assertTrue(workflowActionService.isDisabled(action2)); assertTrue(workflowActionService.isCompleted(action2)); // test action 3 final WorkflowActionModel action3 = getAction(CODES.ACTION3.name()); assertFalse(workflowActionService.isDisabled(action3)); assertFalse(workflowActionService.isCompleted(action3)); assertTrue(action3.getStatus().equals(WorkflowActionStatus.IN_PROGRESS)); assertNotNull(action3.getActivated()); assertNotNull(action3.getFirstActivated()); // test action 4 final WorkflowActionModel action4 = getAction(CODES.ACTION4.name()); assertFalse(workflowActionService.isDisabled(action4)); assertFalse(workflowActionService.isCompleted(action4)); assertTrue(action4.getStatus().equals(WorkflowActionStatus.PENDING)); // test action 5 final WorkflowActionModel action5 = getAction(CODES.ACTION5.name()); assertFalse(workflowActionService.isDisabled(action5)); assertFalse(workflowActionService.isCompleted(action5)); assertTrue(action5.getStatus().equals(WorkflowActionStatus.PENDING)); // check workflow assertFalse(workflowService.isFinished(testWorkflow)); } /** * Completes the actions of the test workflow and checks the action status. */ @Test public void testWorkflowCompleteChain() { // disable action 1 WorkflowActionModel action1 = getAction(CODES.ACTION1.name()); workflowActionService.disable(action1); workflowProcessingService.toggleActions(testWorkflow); // test action 1 action1 = getAction(CODES.ACTION1.name()); assertTrue(workflowActionService.isDisabled(action1)); assertTrue(workflowActionService.isCompleted(action1)); assertTrue(action1.getStatus().equals(WorkflowActionStatus.DISABLED)); // test action 2 final WorkflowActionModel action2 = getAction(CODES.ACTION2.name()); assertFalse(workflowActionService.isDisabled(action2)); assertFalse(workflowActionService.isCompleted(action2)); assertEquals(WorkflowActionStatus.IN_PROGRESS, action2.getStatus()); // test action 3 final WorkflowActionModel action3 = getAction(CODES.ACTION3.name()); assertFalse(workflowActionService.isDisabled(action3)); assertFalse(workflowActionService.isCompleted(action3)); assertEquals(WorkflowActionStatus.PENDING, action3.getStatus()); // test action 4 final WorkflowActionModel action4 = getAction(CODES.ACTION4.name()); assertFalse(workflowActionService.isDisabled(action4)); assertFalse(workflowActionService.isCompleted(action4)); assertEquals(WorkflowActionStatus.PENDING, action4.getStatus()); // test action 5 final WorkflowActionModel action5 = getAction(CODES.ACTION5.name()); assertFalse(workflowActionService.isDisabled(action5)); assertFalse(workflowActionService.isCompleted(action5)); assertEquals(WorkflowActionStatus.PENDING, action5.getStatus()); // complete action 2 workflowActionService.complete(action2); workflowProcessingService.toggleActions(testWorkflow); assertEquals(WorkflowActionStatus.DISABLED, action1.getStatus()); assertEquals(WorkflowActionStatus.COMPLETED, action2.getStatus()); assertEquals(WorkflowActionStatus.IN_PROGRESS, action3.getStatus()); assertEquals(WorkflowActionStatus.PENDING, action4.getStatus()); assertEquals(WorkflowActionStatus.PENDING, action5.getStatus()); assertFalse(workflowService.isFinished(testWorkflow)); // complete action 3 workflowActionService.complete(action3); workflowProcessingService.toggleActions(testWorkflow); assertEquals(WorkflowActionStatus.DISABLED, action1.getStatus()); assertEquals(WorkflowActionStatus.COMPLETED, action2.getStatus()); assertEquals(WorkflowActionStatus.COMPLETED, action3.getStatus()); assertEquals(WorkflowActionStatus.IN_PROGRESS, action4.getStatus()); assertEquals(WorkflowActionStatus.IN_PROGRESS, action5.getStatus()); assertFalse(workflowService.isFinished(testWorkflow)); workflowActionService.complete(action4); workflowProcessingService.toggleActions(testWorkflow); assertEquals(WorkflowActionStatus.DISABLED, action1.getStatus()); assertEquals(WorkflowActionStatus.COMPLETED, action2.getStatus()); assertEquals(WorkflowActionStatus.COMPLETED, action3.getStatus()); assertEquals(WorkflowActionStatus.COMPLETED, action4.getStatus()); assertEquals(WorkflowActionStatus.IN_PROGRESS, action5.getStatus()); assertFalse(workflowService.isFinished(testWorkflow)); // complete action 5 workflowActionService.complete(action5); workflowProcessingService.toggleActions(testWorkflow); assertEquals(WorkflowActionStatus.DISABLED, action1.getStatus()); assertEquals(WorkflowActionStatus.COMPLETED, action2.getStatus()); assertEquals(WorkflowActionStatus.COMPLETED, action3.getStatus()); assertEquals(WorkflowActionStatus.COMPLETED, action4.getStatus()); assertEquals(WorkflowActionStatus.COMPLETED, action5.getStatus()); assertTrue(workflowService.isFinished(testWorkflow)); } /** * Rejects action 3 of test workflow and checks action status. */ @Test @SuppressWarnings("deprecation") public void testWorkflowCompleteReject() { // disable action 1 WorkflowActionModel action1 = getAction(CODES.ACTION1.name()); workflowActionService.disable(action1); workflowProcessingService.toggleActions(testWorkflow); // check stati action1 = getAction(CODES.ACTION1.name()); assertEquals(WorkflowActionStatus.DISABLED, action1.getStatus()); final WorkflowActionModel action2 = getAction(CODES.ACTION2.name()); assertEquals(WorkflowActionStatus.IN_PROGRESS, action2.getStatus()); assertNotNull(action2.getActivated()); assertNotNull(action2.getFirstActivated()); final Date firstActivatedDate = action2.getFirstActivated(); final WorkflowActionModel action3 = getAction(CODES.ACTION3.name()); assertEquals(WorkflowActionStatus.PENDING, action3.getStatus()); assertNull(action3.getActivated()); assertNull(action3.getFirstActivated()); // complete action 2 workflowActionService.complete(action2); workflowProcessingService.toggleActions(testWorkflow); assertEquals(WorkflowActionStatus.COMPLETED, action2.getStatus()); assertEquals(WorkflowActionStatus.IN_PROGRESS, action3.getStatus()); assertNotNull(action3.getActivated()); assertNotNull(action3.getFirstActivated()); // reject action 3 workflowActionService.idle(action3); workflowProcessingService.toggleActions(testWorkflow); assertEquals(WorkflowActionStatus.DISABLED, action1.getStatus()); assertEquals(WorkflowActionStatus.COMPLETED, action2.getStatus()); assertNotNull(action2.getActivated()); assertNotNull(action2.getFirstActivated()); assertEquals(firstActivatedDate, action2.getFirstActivated()); assertEquals(WorkflowActionStatus.IN_PROGRESS, action3.getStatus()); assertFalse(workflowService.isFinished(testWorkflow)); } /** * Creates some attachments and assigns them to the test workflow. */ @Test public void testAttachments() { final PK workflowPk = testWorkflow.getPk(); // create product attachment final ProductModel product = modelService.create(ProductModel.class); product.setCode("sabbers"); product.setCatalogVersion(catalogVersionService.getCatalogVersion("DefaultTestCatalog", "Online")); assertNotNull(product); final WorkflowItemAttachmentModel attachProduct = createAttachment("productTest", product, testWorkflow); assertNotNull(attachProduct); // create category attachment final CategoryModel category = modelService.create(CategoryModel.class); category.setCatalogVersion(catalogVersionService.getCatalogVersion("DefaultTestCatalog", "Online")); category.setCode("abc"); assertNotNull(category); final WorkflowItemAttachmentModel attachCategory = createAttachment("categoryTest", category, testWorkflow); assertNotNull(attachCategory); final WorkflowActionModel action1 = getAction(CODES.ACTION1.name()); action1.setAttachments(Arrays.asList(new WorkflowItemAttachmentModel[] { attachProduct, attachCategory })); // restart clearCache(); // check attachments final WorkflowModel found = modelService.get(workflowPk); assertEquals(2, found.getAttachments().size()); final WorkflowActionModel foundAction = getAction(CODES.ACTION1.name()); assertEquals(2, foundAction.getAttachments().size()); } protected void clearCache() { // restart Registry.getCurrentTenant().getCache().clear(); } @Test public void testAssignedUserCheck() { try { createWorkflowActionTemplate(userService.getAnonymousUser(), "cyclic action", testTemplate); fail("The user can not be assigned to the action, because it has no read acces to type WorkflowAction"); } catch (final ModelSavingException e) { // OK } } /** * Creates a workflow template with given user assigned. * * <pre> * Action1 &lt; -Action3 * </pre> * * <pre> * Action2 &lt; -Action3 * </pre> * * <pre> * Action3 &lt; -Action4 * </pre> * * <pre> * Action3 &lt; -Action5 * </pre> * * @param user user instance to use for template * @return new created template instance */ //@Override protected WorkflowTemplateModel createWorkflowTemplate(final UserModel user) { final WorkflowTemplateModel template = createWorkflowTemplate(user, "Test Template", "Test Template Descr"); final WorkflowActionTemplateModel templateAction1 = createWorkflowActionTemplate(user, CODES.ACTION1.name(), template); final WorkflowActionTemplateModel templateAction2 = createWorkflowActionTemplate(user, CODES.ACTION2.name(), template); final WorkflowActionTemplateModel templateAction3 = createWorkflowActionTemplate(user, CODES.ACTION3.name(), template); final WorkflowActionTemplateModel templateAction4 = createWorkflowActionTemplate(user, CODES.ACTION4.name(), template); final WorkflowActionTemplateModel templateAction5 = createWorkflowActionTemplate(user, CODES.ACTION5.name(), template); addToPredecessors(templateAction3, templateAction1); addToPredecessors(templateAction3, templateAction2); addToPredecessors(templateAction4, templateAction3); addToPredecessors(templateAction5, templateAction3); modelService.saveAll(); return template; } public void addToPredecessors(final WorkflowActionTemplateModel source, final WorkflowActionTemplateModel target) { final List<AbstractWorkflowActionModel> actions = new ArrayList(source.getPredecessors()); actions.add(target); source.setPredecessors(actions); modelService.save(source); } /** * Creates new workflow template using given user, code, and description. * * @param owner user assigned to new template * @param code code of new template * @param desc description assigned to template * @return created template */ //@Override protected WorkflowTemplateModel createWorkflowTemplate(final UserModel owner, final String code, final String desc) { final WorkflowTemplateModel template = modelService.create(WorkflowTemplateModel.class); template.setOwner(owner); template.setCode(code); template.setDescription(desc); modelService.save(template); assertNotNull(template); return template; } /** * Creates new action template. * * @param user user assigned to template * @param code code of template * @param workflow workflow assigned to action template * @return created action template */ protected WorkflowActionTemplateModel createWorkflowActionTemplate(final UserModel user, final String code, final WorkflowTemplateModel workflow) { final WorkflowActionTemplateModel action = modelService.create(WorkflowActionTemplateModel.class); action.setPrincipalAssigned(user); action.setWorkflow(workflow); action.setCode(code); action.setSendEmail(Boolean.FALSE); modelService.save(action); final List<WorkflowActionTemplateModel> actions = new ArrayList(workflow.getActions()); actions.add(action); workflow.setActions(actions); modelService.save(workflow); assertNotNull(action); return action; } /** * Gets the action with given code from test workflow instance. * * @param code code of needed action * @return action of test workflow with given code */ //@Override protected WorkflowActionModel getAction(final String code) { final Collection<WorkflowActionModel> actions = testWorkflow.getActions(); for (final WorkflowActionModel action : actions) { if (action.getTemplate().getCode().equals(code)) { return action; } } fail("Action " + code + "can not be found"); return null; } /** * Gets the action template with given code from test workflow template. * * @param code code of needed action * @return action template of test workflow template with given code */ //@Override protected WorkflowActionTemplateModel getActionTemplate(final String code) { final Collection<WorkflowActionTemplateModel> actions = testTemplate.getActions(); for (final WorkflowActionTemplateModel action : actions) { if (action.getCode().equals(code)) { return action; } } fail("ActionTemplate " + code + "can not be found"); return null; } private WorkflowItemAttachmentModel createAttachment(final String code, final ItemModel item, final WorkflowModel workflow) { final WorkflowItemAttachmentModel attachment = modelService.create(WorkflowItemAttachmentModel.class); attachment.setCode(code); attachment.setItem(item); attachment.setWorkflow(workflow); modelService.save(attachment); return attachment; } }
0d7be847e1a814d3fff85bb6c6ae4abc330066c9
bc5da8333f217faa378bebb83c290495025e3522
/src/Settings.java
4baf0e218da77cb3ed64992cb683cbcf3f501e8c
[ "MIT" ]
permissive
imjagpul/ultraglot-mobile
f8c6ab865919eb4f4b3336da474f9ef259039e16
54cbff91b7e3c847c8133d0732b197ae31bdbdd8
refs/heads/main
2023-03-12T10:25:00.924941
2021-02-27T17:18:22
2021-02-27T17:18:22
342,913,661
0
0
null
null
null
null
WINDOWS-1250
Java
false
false
10,481
java
import java.io.UnsupportedEncodingException; import java.util.Random; import javax.microedition.rms.InvalidRecordIDException; import javax.microedition.rms.RecordStore; import javax.microedition.rms.RecordStoreException; /* * Settings.java * * Created on 24. květen 2007, 18:06 */ /** * * @author Stepan */ public class Settings { // Singleton. private Settings() { } private static final Settings INSTANCE = new Settings(); public static Settings getInstance() { return INSTANCE; } /** Colors. */ // private int fgColor=0x00EEFF, bgColor=0x005555; // private boolean useBitmapFont=false; private byte settings = 0; private long cursorDelay = 1000; private byte mode = MODE_NORMAL; public static final byte MODE_NORMAL = 0; public static final byte MODE_FLASHCARD = 1; public static final byte MODE_T9 = 2; public static final byte MODE_T9_NOSPACE = 3; public static final byte MODE_T9_NOSPECIAL = 4; private int[] actions = new int[ACTIONS_COUNT]; public static final byte DEL = 0; public static final byte CLEAR = 1; public static final byte ENTER = 2; public static final byte MENU = 3; public static final byte SKIP = 4; public static final byte LEFT = 5; public static final byte RIGHT = 6; public static final byte HELP = 7; public static final byte BACKSPACE = 8; public static final byte ACTIONS_COUNT = 9; private int[] colors = new int[]{ 0x00C8EE, 0x005555, 0x00EEFF, 0xAA0000, 0x00EEFF, 0x00EEC8, 0x004444, 0xEFEFEF, 0x009090, 0xFF0000, 0xEE0000 }; public static final byte COLOR_FG = 0; public static final byte COLOR_BG = 1; public static final byte COLOR_ANSWER = 2; public static final byte COLOR_CURSOR = 3; public static final byte COLOR_HELP = 4; public static final byte COLOR_ACTIVE_MAPPING = 5; public static final byte COLOR_ACTIVE_MAPPING_BG = 6; public static final byte COLOR_ACTIVE_MAPPING_FRAME = 7; public static final byte COLOR_INDICATOR_HELP = 8; public static final byte COLOR_INDICATOR_WRONG = 9; public static final byte COLOR_INDICATOR_WRONG_2 = 10; public static final byte COLORS_COUNT = 11; private boolean blend=true; public static final Random RND = new Random(); public int getKeyMapping(int action) { return actions[action]; } public void setKeyMapping(int action, int keyCode) { actions[action] = keyCode; } public int getColor(int index) { return colors[index]; } public void setColor(int index, int value) { colors[index] = value; } public byte getMode() { return mode; } public void setMode(byte mode) { this.mode = mode; } private String encoding = DEFAULT_FILE_ENCODING; public long getCursorDelay() { return cursorDelay; } // public boolean getUseBitmapFont() { // return useBitmapFont; // } public void setEncoding(String encoding) throws UnsupportedEncodingException { if (encoding == null || encoding.equals("")) { encoding = DEFAULT_FILE_ENCODING; } if (this.encoding.equalsIgnoreCase(encoding)) { return; } new String(new byte[0], encoding); //check if encondig is supported this.encoding = encoding; } public String getEncoding() { return encoding; } // public void setUseBitmapFont(boolean useBitmapFont) { // this.useBitmapFont = useBitmapFont; // } public boolean getReverse() { return (settings & REVERSE_BITMASK) != 0; } public boolean getSmart() { return (settings & SMART_BITMASK) != 0; } public boolean getShuffle() { return (settings & SHUFFLE_BITMASK) != 0; } public boolean getSort() { return (settings & SORT_BITMASK) != 0; } public void setReverse(boolean reverse) { if (reverse) { settings |= REVERSE_BITMASK; } else { settings &= ~REVERSE_BITMASK; } } public void setSmart(boolean smart) { if (smart) { settings |= SMART_BITMASK; } else { settings &= ~SMART_BITMASK; } } public void setShuffle(boolean shuffle) { if (shuffle) { settings |= SHUFFLE_BITMASK; } else { settings &= ~SHUFFLE_BITMASK; } } public void setSort(boolean sort) { if (sort) { settings |= SORT_BITMASK; } else { settings &= ~SORT_BITMASK; } } private static final String SETTINGS = "Settings"; private static final String DEFAULT_FILE_ENCODING = "UTF-8"; private static final String RMS_ENCODING = DEFAULT_FILE_ENCODING; private static final byte SETTINGS_ID = 1; private static final byte PATH_ID = 2; private static final byte ENCODING_ID = 3; private static final byte ACTIONS_ID = 4; private static final byte COLORS_ID = 5; private static final byte MODE_ID = 6; private static final byte SHUFFLE_BITMASK = 1; private static final byte SMART_BITMASK = 2; private static final byte REVERSE_BITMASK = 4; private static final byte SORT_BITMASK = 8; public void load() { RecordStore rs = null; try { rs = RecordStore.openRecordStore(SETTINGS, true); if (rs.getNumRecords() == 0) { for (int i = 0; i <= 6; i++) { rs.addRecord(null, 0, 0); } } else { byte[] data = rs.getRecord(SETTINGS_ID); if (data != null && data.length != 0) { settings = data[0]; if (data.length > 1) { mode = data[1]; } // useBitmapFont= data[0]!=0; // note we have to convert unsigned byte to int // fgColor=(((int) data[1] & 0xFF) << 16) + // (((int) data[2] & 0xFF) << 8) + // ((int) data[3] & 0xFF); // // bgColor=(((int) data[4]& 0xFF) << 16) + // (((int) data[5]& 0xFF) << 8 ) + // ((int) data[6]& 0xFF); } data = rs.getRecord(PATH_ID); if (data != null) { String path = new String(data, RMS_ENCODING); if (!Browser.SANDBOX.equals(path)) { Browser.getInstance().currDirName = path; } } data = rs.getRecord(ENCODING_ID); if (data != null) { try { setEncoding(new String(data, RMS_ENCODING)); } catch (UnsupportedEncodingException ex) { //ignore } } data = rs.getRecord(ACTIONS_ID); if (data != null) { try { for (int i = 0; i < data.length; i++) { actions[i] = data[i]; } } catch (IndexOutOfBoundsException exc) { //ignore } } data = rs.getRecord(COLORS_ID); if (data != null) { try { for (int i = 0; i < data.length; i += 3) { colors[i / 3] = (((int) data[i] & 0xFF) << 16) + (((int) data[i + 1] & 0xFF) << 8) + ((int) data[i + 2] & 0xFF); } } catch (IndexOutOfBoundsException exc) { //ignore } } } rs.closeRecordStore(); } catch (InvalidRecordIDException exc) { try { //reset record store if (rs != null) { rs.closeRecordStore(); } RecordStore.deleteRecordStore(SETTINGS); load(); } catch (RecordStoreException ex) { ex.printStackTrace(); } } catch (Exception exc) { exc.printStackTrace(); } } public void save() { try { RecordStore rs = RecordStore.openRecordStore(SETTINGS, false); byte[] data; data = new byte[2]; data[0] = settings; data[1] = mode; // data[0]= (byte) (useBitmapFont ? 1 : 0); // data[1]= (byte)((fgColor >> 16) & 0xFF); // data[2]= (byte)((fgColor >> 8) & 0xFF); // data[3]= (byte) (fgColor & 0xFF); // // data[4]= (byte)((bgColor >> 16) & 0xFF); // data[5]= (byte)((bgColor >> 8) & 0xFF); // data[6]= (byte) (bgColor & 0xFF); rs.setRecord(SETTINGS_ID, data, 0, data.length); data = Browser.getInstance().currDirName.getBytes(RMS_ENCODING); rs.setRecord(PATH_ID, data, 0, data.length); data = getEncoding().getBytes(RMS_ENCODING); rs.setRecord(ENCODING_ID, data, 0, data.length); data = new byte[actions.length]; for (int i = 0; i < actions.length; i++) { data[i] = (byte) actions[i]; } rs.setRecord(ACTIONS_ID, data, 0, data.length); data = new byte[colors.length * 3]; for (int i = 0; i < data.length; i += 3) { data[i] = (byte) ((colors[i / 3] & 0xFF0000) >> 16); data[i + 1] = (byte) ((colors[i / 3] & 0x00FF00) >> 8); data[i + 2] = (byte) (colors[i / 3] & 0xFF); } rs.setRecord(COLORS_ID, data, 0, data.length); rs.closeRecordStore(); } catch (Exception exc) { exc.printStackTrace(); } } public boolean getBlend() { return blend; } public void setBlend(boolean blend) { this.blend=blend; } public boolean isT9() { return mode == Settings.MODE_T9 || mode == MODE_T9_NOSPACE || mode == MODE_T9_NOSPECIAL; } }
4682ee06ece102839052092227fb510ff15bee6a
7ff252f5fed394afb60eed54ce3311f30fc40543
/app/src/main/java/com/weather/weather/UserSettings.java
6f0bd1cb87c6d7ca6e48f77e4800ef1866c9381f
[]
no_license
adamut/Weather
6b43bf1b7fcb96da80443f6fd0086ff06f9bf610
0c9998d7d1f8a19317c66acdc941ece9dea2b6b1
refs/heads/master
2021-01-21T15:12:27.141112
2017-06-06T19:22:18
2017-06-06T19:22:18
91,830,072
0
1
null
2017-05-31T12:08:45
2017-05-19T17:31:05
Java
UTF-8
Java
false
false
793
java
package com.weather.weather; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.MenuItem; /** * Created by Cosmin-Marian on 5/24/2017. */ public class UserSettings extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } public boolean onOptionsItemSelected(MenuItem item) { int menuItemThatWasSelected = item.getItemId(); //<!--TODO am de revizuit cum e scris un URI si cum sa fac cu geolocatia + de verificat daca linia 62-63 e ok --> switch (menuItemThatWasSelected) { case android.R.id.home: { onBackPressed(); break; } } return true; } }
83a55a06860eb186ceaabb0cbb435b055e2b89c8
9d5cefcd966d539a4a4ff5aacc6eb4c9732f3ac5
/src/com/piano/structure/decorator/BlackBorderDecorator.java
89ec641b60ff7762ea06dc5ed38b0b134d9ebf91
[]
no_license
PianoCello/design-pattern
a5af266ec2c77edb837e4dfe3110eda1b28ea730
8d7ba6ee1d5663209e7d761098fbe71b59be906a
refs/heads/master
2022-10-24T04:17:52.972137
2020-06-13T16:11:37
2020-06-13T16:11:37
272,018,225
0
0
null
null
null
null
UTF-8
Java
false
false
455
java
package com.piano.structure.decorator; /** * 黑色边框装饰类,充当具体装饰类 */ public class BlackBorderDecorator extends ComponentDecorator { public BlackBorderDecorator(Component component) { super(component); } @Override public void display() { this.setBlackBorder(); super.display(); } public void setBlackBorder() { System.out.println("为构件增加黑色边框"); } }
b9df7e771810e75dfdca95ec69db6c643eb2e0e9
9908c0a5ae659f8f99cdd87af84961e26b2a7611
/src/main/java/com/example/demo/exception/StudentNotEnrolledException.java
4a51eb50607407aa72389f3b726d1f6ab38fc67e
[]
no_license
salimov-bilol/UniversialEducation
abf0f8c8c4d874c52597aaccb4c1e2c9b003dd64
d0d2d0940d0da666b4ada509a35778ebfb403bee
refs/heads/master
2023-04-02T22:02:54.069921
2021-04-06T04:45:01
2021-04-06T04:45:01
354,919,881
0
0
null
null
null
null
UTF-8
Java
false
false
189
java
package com.example.demo.exception; public class StudentNotEnrolledException extends Exception { public StudentNotEnrolledException(String message) { super(message); } }
7e19211728aeca4189138d2fb8e3449128536a9f
d52be7ee53c0b18885283ddb6ac4cf9b5035d651
/app/src/main/java/com/example/Activity/News/NewsContentFragment.java
547aad5ab8d113453cf8b43ee8bcbbacca0d1eae
[]
no_license
HaviLee/algorithm
0aec54bfc6601dfa6812493b311e11066cb0ca85
7bece80ea6bc9a391b03b4d6ce6acd79dc68a958
refs/heads/main
2023-03-20T23:55:55.217858
2021-03-05T00:55:19
2021-03-05T00:55:19
344,652,335
0
0
null
null
null
null
UTF-8
Java
false
false
1,107
java
/* * ************************************************************ * 文件:NewsContentFragment.java * 模块:MyApplication.app * 项目:MyApplication * 当前修改时间:2020年12月22日 18:19:10 * 上次修改时间:2020年12月22日 18:19:10 * 作者:Havi * Copyright (c) 2020 * ************************************************************ * */ package com.example.Activity.News; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import com.example.Activity.R; public class NewsContentFragment extends Fragment { private View view; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { view = inflater.inflate(R.layout.news_content_frag, container, false); return view; } public void refresh(String newsTitle, String newsContent) { // View v } }
a42f9976ce4ac32e97ec83d9651503a6379af7bb
46e82897e5299501b6608cec473bf234d97661a0
/Dggenraterset/src/main/java/com/bonrix/dggenraterset/Tools/CoordinatesConverter.java
3f6ca2efb54d06be21ffb0ccb648d9abc9f97805
[]
no_license
samirvora123/dggenraterset
06d6cd62ab1a68d59f48c458e425c6f360ec08a3
7117741a066e0bd327d5ba3811a6aa5790547465
refs/heads/master
2020-03-13T13:09:27.789979
2018-06-13T09:52:51
2018-06-13T09:52:51
131,133,261
0
0
null
null
null
null
UTF-8
Java
false
false
4,940
java
package com.bonrix.dggenraterset.Tools; import java.util.LinkedList; import java.util.List; //import org.apache.log4j.Logger; public class CoordinatesConverter { public static final double MAX_LATITUDE = 90.0; public static final double MIN_LATITUDE = -90.0; public static final double MAX_LONGITUDE = 180.0; public static final double MIN_LONGITUDE = -180.0; // private static final Logger log = Logger.getLogger(CoordinatesConverter.class); public static List<Double> passLetLongVlaues(String latitude, String longitude, String latitudeDirection, String longitudeDirection) { Double lat = parseLatLongValue(latitude, false, latitudeDirection, longitudeDirection); // log.info("lat---------"+lat); Double lon = parseLatLongValue(longitude, true, latitudeDirection, longitudeDirection); // log.info("lon---------"+lon); List<Double> latlong = new LinkedList<Double>(); latlong.add(lat); latlong.add(lon); return latlong; } public static boolean isValid(double lat, double lon) { double latAbs = Math.abs(lat); double lonAbs = Math.abs(lon); if (latAbs >= MAX_LATITUDE) { // invalid latitude return false; } else if (lonAbs >= MAX_LONGITUDE) { // invalid longitude return false; } else if ((latAbs <= 0.0001) && (lonAbs <= 0.0001)) { // small square off the coast of Africa (Ghana) return false; } else { return true; } } private static double parseLatLongValue(String valueString, boolean isLongitude, String latitudeDirection, String longitudeDirection) { int degreeInteger = 0; double minutes = 0.0; if (isLongitude == true) { degreeInteger = Integer.parseInt(valueString.substring(0, 3)); // log.info("LongitudedegreeInteger---------"+degreeInteger); minutes = Double.parseDouble(valueString.substring(3,5)+"."+valueString.substring(5)); // log.info("Longitudeminutes---------"+minutes); //sec=Double.parseDouble(valueString.substring(5,7)); //System.out.println("Longitudesec---------"+sec); } else { degreeInteger = Integer.parseInt(valueString.substring(0, 2)); // log.info("LatitudedegreeInteger---------"+degreeInteger); // log.info("valueString.substring(2,4)--------"+valueString.substring(2,4)); // log.info("valueString.substring(4)--------"+valueString.substring(4)); minutes = Double.parseDouble(valueString.substring(2,4)+"."+valueString.substring(4)); // log.info("Latitudeminutes---------"+minutes); //sec=Double.parseDouble(valueString.substring(4,6)); //System.out.println("Latitudesec---------"+sec); } //double degreeDecimals = minutes / 60.0; //double degrees = degreeInteger + degreeDecimals; //double degrees = degreeInteger + (0.0001*degreeDecimals); //double degrees=(degreeInteger+(minutes/60)+(sec/3600)) ; double degrees=(degreeInteger+(minutes/60)) ; if (!longitudeDirection.equals("E") && isLongitude) { degrees = -degrees; } if (!latitudeDirection.equals("N") && !isLongitude) { degrees = -degrees; } return degrees; } @SuppressWarnings("unused") private double _parseLatitude(String s, String d) { double _lat = StringTools.parseDouble(s, 99999.0); if (_lat < 99999.0) { double lat = (double)((long)_lat / 100L); // _lat is always positive here lat += (_lat - (lat * 100.0)) / 60.0; return d.equals("S")? -lat : lat; } else { return 90.0; // invalid latitude } } /** *** Parses longitude given values from GPS device. *** @param s Longitude String from GPS device in DDDmm.mmmm format. *** @param d Longitude hemisphere, "E" for eastern, "W" for western. *** @return Longitude parsed from GPS data, with appropriate sign based on hemisphere or *** 180.0 if invalid longitude provided. **/ @SuppressWarnings("unused") private double _parseLongitude(String s, String d) { double _lon = StringTools.parseDouble(s, 99999.0); if (_lon < 99999.0) { double lon = (double)((long)_lon / 100L); // _lon is always positive here lon += (_lon - (lon * 100.0)) / 60.0; return d.equals("W")? -lon : lon; } else { return 180.0; // invalid longitude } } }
c1886466861ce48703e7ca40fe208faa62c4fe49
743f5f7a0688fcff4ef17b2b37803a516605782e
/warehouse/src/com/java/plyd/persistence/IUser_LevelDAOManager.java
e68cdd6bbc132b42ac9f24d6eb1a911f9286d4b5
[]
no_license
kimbelkpl/SchoolProject
6cb52f78e0b2844fa794d7aa023ec2fd23926e48
ae3d395f5334d33cd6acb0a46f66e4b8bf0e9eaf
refs/heads/master
2020-03-25T21:00:53.747201
2018-08-12T04:12:41
2018-08-12T04:12:41
144,155,346
0
0
null
null
null
null
UTF-8
Java
false
false
456
java
package com.java.plyd.persistence; import java.util.List; import com.java.plyd.service.User_Level; public interface IUser_LevelDAOManager { public void insert(User_Level user_level); public void delete(int user_level_id); //public void removesub(int category_id); public void update(User_Level user_level); public List<User_Level> selectAll(); public User_Level selectUser_Level(int user_level_id); public List<User_Level> selectAllforadmin(); }
[ "kyawphyolwingithub12345" ]
kyawphyolwingithub12345
0f86e0a97e4a46b7893eb8b8a185ab3ef07a0282
3efa417c5668b2e7d1c377c41d976ed31fd26fdc
/src/br/com/mind5/business/scheduleLineSnapshot/model/action/SchedinapVisiDaoSelect.java
8c7c3e42cf788d99300f7e5dbe5b8dd1cf032e71
[]
no_license
grazianiborcai/Agenda_WS
4b2656716cc49a413636933665d6ad8b821394ef
e8815a951f76d498eb3379394a54d2aa1655f779
refs/heads/master
2023-05-24T19:39:22.215816
2023-05-15T15:15:15
2023-05-15T15:15:15
109,902,084
0
0
null
2022-06-29T19:44:56
2017-11-07T23:14:21
Java
UTF-8
Java
false
false
815
java
package br.com.mind5.business.scheduleLineSnapshot.model.action; import java.util.List; import br.com.mind5.business.scheduleLineSnapshot.dao.SchedinapDaoSelect; import br.com.mind5.business.scheduleLineSnapshot.info.SchedinapInfo; import br.com.mind5.dao.DaoStmtExecOption; import br.com.mind5.dao.DaoStmtExec; import br.com.mind5.model.action.ActionVisitorTemplateStmt; import br.com.mind5.model.decisionTree.DeciTreeOption; public final class SchedinapVisiDaoSelect extends ActionVisitorTemplateStmt<SchedinapInfo> { public SchedinapVisiDaoSelect(DeciTreeOption<SchedinapInfo> option) { super(option); } @Override protected DaoStmtExec<SchedinapInfo> buildStmtExecHook(List<DaoStmtExecOption<SchedinapInfo>> stmtOptions) { return new SchedinapDaoSelect(stmtOptions); } }
239ca1ecdab1f6fade0ea92c68f63424ffaf7257
5bee8ed0381b4234c4dbfadabbe0b5c90c98996d
/app/src/androidTestMock/java/com/lviv/komunalka/util/DiskIOThreadExecutor.java
736a891d827b2437ded474a2166d7df2f0b53ef1
[]
no_license
stashess/DemoApp
b10d8e32707ff024003fb74ad5fc9ffb6f053f67
64a6b6d29df836410a06b8ffae087ef28a05e569
refs/heads/master
2020-04-16T03:03:53.597942
2019-01-11T09:40:15
2019-01-11T09:40:15
165,218,507
0
0
null
null
null
null
UTF-8
Java
false
false
850
java
package com.lviv.komunalka.util; import android.support.annotation.NonNull; import java.util.concurrent.Executor; import java.util.concurrent.Executors; /** * Executor that runs a task on a new background thread. * This implementation is used by the Android instrumentation tests. */ public class DiskIOThreadExecutor implements Executor { private final Executor mDiskIO; public DiskIOThreadExecutor() { mDiskIO = Executors.newSingleThreadExecutor(); } @Override public void execute(@NonNull Runnable command) { // increment the idling resources before executing the long running command EspressoIdlingResource.increment(); mDiskIO.execute(command); // decrement the idling resources once executing the command has been finished EspressoIdlingResource.decrement(); } }
6a2cbe1d9d4163fd7b8439ec9a58d7a09ae093d3
5359dd24e763fd397e455d6e09061ebfe44e9c6d
/src/leetcode/SimplifyPath.java
f65d386414ba9120fd28166dbc778d1612db71c0
[]
no_license
FDws/Algorithm-Analysis
8c847ebf84850b808524f4bfbc426f920282147d
a7e43f7704ecef0c44cbebd181a0d6f29e3c6394
refs/heads/master
2021-09-15T11:26:52.613600
2018-05-31T12:11:51
2018-05-31T12:11:51
109,550,210
1
0
null
null
null
null
UTF-8
Java
false
false
1,194
java
package leetcode; /** * @author FDws * Created on 2018/5/10 10:24 */ public class SimplifyPath { private String simplifyPath(String path) { String[] p = path.split("/+"); for (int i = 0; i < p.length; i++) { if (p[i].equals("..")) { p[i] = ""; for (int j = i - 1; j >= 0; j--) { if (!p[j].equals("")) { p[j] = ""; break; } } } else if (p[i].equals(".")) { p[i] = ""; } } StringBuilder sb = new StringBuilder(); for (String s : p) { if (!s.equals("")) { sb.append("/"); sb.append(s); } } String res = sb.toString(); return res.length() == 0 ? "/" : res; } public static void main(String[] args) { SimplifyPath sp = new SimplifyPath(); System.out.println(sp.simplifyPath("/a/./b/../../c")); System.out.println(sp.simplifyPath("/home/")); System.out.println(sp.simplifyPath("/home//foo/.")); } }
f9236654cbd10ecbb58dd368cb02f4934bd1ba1e
cde60ea6c29a44c4b4ec8c920942a39aaa35524a
/lti-usp-2013/src/java/jia/has_repairer_at.java
f42b70780a9f09572f5220b3d925646c09a59194
[]
no_license
mfstabile/PCS5703
637e4eb0c17ee8d3681fa07e91fb57477c31731d
b688d2f91e871fcedc1cb36140bae8a30863aa62
refs/heads/master
2016-09-10T23:23:02.683145
2014-06-12T04:01:52
2014-06-12T04:01:52
19,745,515
0
2
null
null
null
null
UTF-8
Java
false
false
1,105
java
package jia; import env.Percept; import jason.asSemantics.DefaultInternalAction; import jason.asSemantics.TransitionSystem; import jason.asSemantics.Unifier; import jason.asSyntax.Atom; import jason.asSyntax.StringTerm; import jason.asSyntax.Term; import arch.MartianArch; import arch.WorldModel; /** * Returns true or false indicating if exists another repairer in the given position. * </p> * Use: jia.has_repairer_at(+P);</br> * Where: P is the position. * * @author mafranko */ public class has_repairer_at extends DefaultInternalAction { private static final long serialVersionUID = 1586273788080285500L; @Override public Object execute(TransitionSystem ts, Unifier un, Term[] terms) throws Exception { String position = ((StringTerm) terms[0]).getString(); if (null == position) { position = ((Atom) terms[0]).getFunctor(); } position = position.replace(Percept.VERTEX_PREFIX, ""); int pos = Integer.parseInt(position); WorldModel model = ((MartianArch) ts.getUserAgArch()).getModel(); return model.hasRepairerOnVertex(pos); } }
b136a6bbfbe6141f5738d66c0e343d7657c98a24
5765c87fd41493dff2fde2a68f9dccc04c1ad2bd
/Variant Programs/2-1/6/controller/Programming.java
2d7bd0e458044053cd41f56dff2e32ab3affc819
[ "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
3,938
java
package controller; import regulator.Consignor; import manikin.AppendageBrake; import java.io.IOException; import java.util.Collections; import java.util.LinkedList; public abstract class Programming { protected boolean isMoving; protected int lengthwiseHour; protected int expectingDays; protected LinkedList<Formalities> finalizationTechniques; protected int fairPostponeYear; protected int modalUpswingMonth; protected boolean benzSwag; protected int otherDblClip; public static final int DaySum = 4; protected Formalities afootSummons; private int latestTicktock; public Programming() { this.isMoving = false; this.lengthwiseHour = 0; this.expectingDays = 0; this.fairPostponeYear = 0; this.modalUpswingMonth = 0; this.latestTicktock = -1; this.finalizationTechniques = new LinkedList<>(); this.benzSwag = true; } public void startleOutliner() { this.isMoving = true; this.otherDblClip = Consignor.MailAmount; this.weapGet(); } public void quitProgramming() { this.isMoving = false; this.typescriptComplaint(); } public boolean goIsMoving() { return isMoving; } public int generatePerformedTreatFootprint() { if (finalizationTechniques.isEmpty()) { return 0; } else { return finalizationTechniques.size(); } } public int receiveContemporaryTicktack() { return latestTicktock; } public void dictatedOngoingBeat(int formerGene) { this.latestTicktock = formerGene; } public double bringMiddlingExpectMeter() { return (double) this.fairPostponeYear / this.finalizationTechniques.size(); } public double fixRatioReboundChance() { return (double) this.modalUpswingMonth / this.finalizationTechniques.size(); } public void typescriptComplaint() { try { Collections.sort(finalizationTechniques); AppendageBrake.TurnoutCharge.write("\n"); System.out.println(); String chapeau = String.format("%-7s%16s%19s", "Process", "Waiting Time", "Turnaround Time"); AppendageBrake.TurnoutCharge.write(chapeau + "\n"); System.out.println(chapeau); for (Formalities writes : finalizationTechniques) { int holdDay = writes.developPulloutHour() - writes.fixHappenChance() - writes.receiveExecutionThickness(); int tourBesideJuncture = writes.developPulloutHour() - writes.fixHappenChance(); this.fairPostponeYear += holdDay; this.modalUpswingMonth += tourBesideJuncture; String act = String.format("%-7s%16d%19d", writes.bringCaller(), holdDay, tourBesideJuncture); AppendageBrake.TurnoutCharge.write(act + "\n"); System.out.println(act); } AppendageBrake.TurnoutCharge.write("\n"); System.out.println(); } catch (IOException late) { System.out.println("Unable to write " + this.debuggingPatronymic() + " to file."); } } public void weapGet() { try { AppendageBrake.TurnoutCharge.write("\n"); System.out.println(); AppendageBrake.TurnoutCharge.write("\n" + this.debuggingPatronymic() + "\n"); System.out.println(this.debuggingPatronymic()); } catch (IOException abel) { System.out.println("Unable to write " + this.debuggingPatronymic() + " to file."); } } public void encumbranceSummons(Formalities cern) { try { String methodology = String.format( "%-5s%3s", "T" + (this.receiveContemporaryTicktack()) + ":", cern.bringCaller()); AppendageBrake.TurnoutCharge.write(methodology + "\n"); System.out.println(methodology); } catch (IOException tipp) { System.out.println("Unable to write " + this.debuggingPatronymic() + " to file."); } } public abstract String debuggingPatronymic(); public abstract void bpsRetick(); public abstract void phaseEntry(Formalities summons); }
2116d752c5ac71c174b32b4d7fbd26f0e3477efd
d5dd049e8bcd558feac3bfae67ec4a168f59ec8d
/SP11.Dependencyobjects/src/Course.java
0be7321fe9856b22d6cceab8acb1b1d2e46a2675
[]
no_license
DanishRanjan/Advance-Java
251cc31bb8d4926f634f99fd6a30238aa32e2204
0c1e659c6bb054422b9f30c840c4efa3666c2a7d
refs/heads/main
2023-03-22T18:23:40.986567
2021-03-07T16:12:48
2021-03-07T16:12:48
345,391,227
0
0
null
null
null
null
UTF-8
Java
false
false
290
java
public class Course { String name; int fee; public Course(String name, int fee) { super(); this.name = name; this.fee = fee; } public String toString(){ StringBuffer b=new StringBuffer(); b.append(name).append("\t\t").append(fee); return b.toString(); } }
ba6343a6a0dad27f13771b5af53535eaeb60e2ad
53ace53c0215aaf242f09863d35485dc8dfc5363
/src/main/java/com/github/pkouleri/grpc/greeting/server/GreetingServer.java
20650f2ee454ad43acc37988797aa66e7c6db4db
[]
no_license
pkouleri/grpc-java-example
ddf6abbea05515bd85cc4ef288594405cf6abfbe
d4d52117136b45285199778c0a4fbfbb3ab2d5c5
refs/heads/master
2020-04-02T21:11:08.761863
2018-10-26T06:55:02
2018-10-26T06:55:02
154,790,059
0
0
null
null
null
null
UTF-8
Java
false
false
918
java
package com.github.pkouleri.grpc.greeting.server; import com.github.pkouleri.grpc.calculator.server.CalculatorServiceImpl; import io.grpc.Server; import io.grpc.ServerBuilder; import java.io.IOException; public class GreetingServer { public static void main(String[] args) throws IOException, InterruptedException { System.out.println("Hello I'm a gRPC server!"); Server server = ServerBuilder.forPort(50051) .addService(new GreetServiceImpl()) .build(); server.start(); // this hook has to be setup before server.awaitTermination() Runtime.getRuntime().addShutdownHook(new Thread( () -> { System.out.println("Received shutdown request"); server.shutdown(); System.out.println("Successfully stopped the server"); })); server.awaitTermination(); } }
2f961bf33068570964d6da7fe5c7a2feeb3dc4aa
fe131faee4d266295cfee94559ecc6a69492de40
/src/com/cyber/trafficmap/checkSQLite.java
f297f0093981599c7834b0ef9f5ce31841b2976f
[]
no_license
chanchow88/TrafficMap
52707de986fbb971e581334f0f61eba91ebd58cb
781953a177de0d5610d4fe4b96c287353fc1225f
refs/heads/master
2020-05-05T01:32:47.866510
2014-05-30T19:48:52
2014-05-30T19:48:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
685
java
package com.cyber.trafficmap; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteOpenHelper; public class checkSQLite extends SQLiteOpenHelper{ public checkSQLite(Context context, String name, CursorFactory factory, int version) { super(context, name, factory, version); // TODO Auto-generated constructor stub } @Override public void onCreate(SQLiteDatabase db) { // TODO Auto-generated method stub } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { // TODO Auto-generated method stub } }
46891415848b883c321d023afd52da8cb10d026d
0418d42ff710c9408233c07978d5c89381a682b1
/Parents.java
d2034a4a62d5529d2520dd03c81fa29bc2d5e974
[]
no_license
Schnshrma/student_registration_using_java
43c44e6062704cc3c588d0b59e9fdc3896f23f01
fda685cde66540dd3e2e3eb672a7132403d29f10
refs/heads/master
2023-06-07T14:12:51.879777
2021-06-30T05:48:48
2021-06-30T05:48:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,722
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 dbms; /** * * @author AKASH */ public class Parents extends javax.swing.JFrame { /** * Creates new form Parents */ public Parents() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("akash?zeroDateTimeBehavior=convertToNullPU").createEntityManager(); parents_1Query = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT p FROM Parents_1 p"); parents_1List = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : parents_1Query.getResultList(); jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, parents_1List, jTable1); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${id}")); columnBinding.setColumnName("Id"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${studentName}")); columnBinding.setColumnName("Student Name"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${fathername}")); columnBinding.setColumnName("Fathername"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${fatheroccupation}")); columnBinding.setColumnName("Fatheroccupation"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${mothername}")); columnBinding.setColumnName("Mothername"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${motheroccupation}")); columnBinding.setColumnName("Motheroccupation"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${mobile}")); columnBinding.setColumnName("Mobile"); columnBinding.setColumnClass(String.class); bindingGroup.addBinding(jTableBinding); jScrollPane1.setViewportView(jTable1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 999, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(45, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(14, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); bindingGroup.bind(); pack(); }// </editor-fold> /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Parents.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Parents.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Parents.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Parents.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Parents().setVisible(true); } }); } // Variables declaration - do not modify private javax.persistence.EntityManager entityManager; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTable jTable1; private java.util.List<dbms.Parents_1> parents_1List; private javax.persistence.Query parents_1Query; private org.jdesktop.beansbinding.BindingGroup bindingGroup; // End of variables declaration }
2e2711ac4fcb37ca7b7dce3a3477fdc1559f0cfe
81cdf93734df423332427080670f62439964840f
/chat/src/main/java/com/wcj/chat/client/handler/LogoutResponseHandler.java
b6937107eedb1d780ece1c67024df3a06268d92e
[]
no_license
wengchengjian/chatroom
4a9ef9f67edc64c2e1edf8e420e8a7163b551c15
3c5296f7c7ccaa40bb55f2a675b6f94a0a568582
refs/heads/master
2023-04-17T18:44:25.835759
2021-04-29T12:00:14
2021-04-29T12:00:14
362,709,781
1
0
null
null
null
null
UTF-8
Java
false
false
500
java
package com.wcj.chat.client.handler; import com.wcj.chat.protocol.Packet.response.LogoutResponsePacket; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; /** * @Author 翁丞健 * @Date:2021/4/29 11:02 * @Version 1.0.0 */ public class LogoutResponseHandler extends SimpleChannelInboundHandler<LogoutResponsePacket> { @Override protected void channelRead0(ChannelHandlerContext ctx, LogoutResponsePacket msg) throws Exception { } }
58d99d86663dbb2bd01cce1e0b5774fc3f6f5cce
2b2b18a08addc00046079ad29ea74e2f6324fbeb
/kommunicateui/src/main/java/com/applozic/mobicomkit/uiwidgets/conversation/MobiComKitBroadcastReceiver.java
cbdf4683f9feb8341c16257efd4184ea9d6994d8
[ "BSD-3-Clause" ]
permissive
reytum/Kommunicate-Android-Chat-SDK
45002e7d2849d4b6d18c310e6a18390ea7899b4f
277fa7f8047eac34c53e228bd98e863070626db4
refs/heads/master
2020-03-31T22:27:47.375987
2018-12-03T10:36:34
2018-12-03T10:36:34
152,619,461
0
0
BSD-3-Clause
2018-10-11T16:04:43
2018-10-11T16:04:42
null
UTF-8
Java
false
false
8,042
java
package com.applozic.mobicomkit.uiwidgets.conversation; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.support.v4.app.FragmentActivity; import android.text.TextUtils; import com.applozic.mobicomkit.ApplozicClient; import com.applozic.mobicomkit.api.MobiComKitConstants; import com.applozic.mobicomkit.api.conversation.Message; import com.applozic.mobicomkit.broadcast.BroadcastService; import com.applozic.mobicomkit.contact.AppContactService; import com.applozic.mobicomkit.contact.BaseContactService; import com.applozic.mobicomkit.uiwidgets.R; import com.applozic.mobicomkit.uiwidgets.instruction.InstructionUtil; import com.applozic.mobicommons.commons.core.utils.Utils; import com.applozic.mobicommons.json.GsonUtils; import com.applozic.mobicommons.people.contact.Contact; /** * Created by devashish on 4/2/15. */ public class MobiComKitBroadcastReceiver extends BroadcastReceiver { private static final String TAG = "MTBroadcastReceiver"; private ConversationUIService conversationUIService; private BaseContactService baseContactService; private boolean hideActionMessages; public MobiComKitBroadcastReceiver(FragmentActivity fragmentActivity) { this.conversationUIService = new ConversationUIService(fragmentActivity); this.baseContactService = new AppContactService(fragmentActivity); this.hideActionMessages = ApplozicClient.getInstance(fragmentActivity).isActionMessagesHidden(); } @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); Message message = null; String messageJson = intent.getStringExtra(MobiComKitConstants.MESSAGE_JSON_INTENT); if (!TextUtils.isEmpty(messageJson)) { message = (Message) GsonUtils.getObjectFromJson(messageJson, Message.class); if (message != null) { if (hideActionMessages && message.isActionMessage()) { message.setHidden(true); } } } Utils.printLog(context, TAG, "Received broadcast, action: " + action + ", message: " + message); if (message != null && !message.isSentToMany()) { conversationUIService.addMessage(message); } else if (message != null && message.isSentToMany() && BroadcastService.INTENT_ACTIONS.SYNC_MESSAGE.toString().equals(intent.getAction())) { for (String toField : message.getTo().split(",")) { Message singleMessage = new Message(message); singleMessage.setKeyString(message.getKeyString()); singleMessage.setTo(toField); singleMessage.processContactIds(context); conversationUIService.addMessage(message); } } String keyString = intent.getStringExtra("keyString"); String userId = message != null ? message.getContactIds() : ""; if (BroadcastService.INTENT_ACTIONS.INSTRUCTION.toString().equals(action)) { InstructionUtil.showInstruction(context, intent.getIntExtra("resId", -1), intent.getBooleanExtra("actionable", false), R.color.instruction_color); } else if (BroadcastService.INTENT_ACTIONS.UPDATE_CHANNEL_NAME.toString().equals(action)) { conversationUIService.updateChannelName(); } else if (BroadcastService.INTENT_ACTIONS.FIRST_TIME_SYNC_COMPLETE.toString().equals(action)) { conversationUIService.downloadConversations(true); } else if (BroadcastService.INTENT_ACTIONS.LOAD_MORE.toString().equals(action)) { conversationUIService.setLoadMore(intent.getBooleanExtra("loadMore", true)); } else if (BroadcastService.INTENT_ACTIONS.MESSAGE_SYNC_ACK_FROM_SERVER.toString().equals(action)) { conversationUIService.updateMessageKeyString(message); } else if (BroadcastService.INTENT_ACTIONS.SYNC_MESSAGE.toString().equals(intent.getAction())) { conversationUIService.syncMessages(message, keyString); } else if (BroadcastService.INTENT_ACTIONS.DELETE_MESSAGE.toString().equals(intent.getAction())) { userId = intent.getStringExtra("contactNumbers"); conversationUIService.deleteMessage(keyString, userId); } else if (BroadcastService.INTENT_ACTIONS.MESSAGE_DELIVERY.toString().equals(action) || BroadcastService.INTENT_ACTIONS.MESSAGE_READ_AND_DELIVERED.toString().equals(action)) { conversationUIService.updateDeliveryStatus(message, userId); } else if (BroadcastService.INTENT_ACTIONS.MESSAGE_DELIVERY_FOR_CONTACT.toString().equals(action)) { conversationUIService.updateDeliveryStatusForContact(intent.getStringExtra("contactId")); } else if (BroadcastService.INTENT_ACTIONS.MESSAGE_READ_AND_DELIVERED_FOR_CONTECT.toString().equals(action)) { conversationUIService.updateReadStatusForContact(intent.getStringExtra("contactId")); } else if (BroadcastService.INTENT_ACTIONS.DELETE_CONVERSATION.toString().equals(action)) { String contactNumber = intent.getStringExtra("contactNumber"); Integer channelKey = intent.getIntExtra("channelKey", 0); String response = intent.getStringExtra("response"); Contact contact = null; if (contactNumber != null) { contact = baseContactService.getContactById(contactNumber); } conversationUIService.deleteConversation(contact, channelKey, response); } else if (BroadcastService.INTENT_ACTIONS.UPLOAD_ATTACHMENT_FAILED.toString().equals(action) && message != null) { conversationUIService.updateUploadFailedStatus(message); } else if (BroadcastService.INTENT_ACTIONS.MESSAGE_ATTACHMENT_DOWNLOAD_DONE.toString().equals(action) && message != null) { conversationUIService.updateDownloadStatus(message); } else if (BroadcastService.INTENT_ACTIONS.MESSAGE_ATTACHMENT_DOWNLOAD_FAILD.toString().equals(action) && message != null) { conversationUIService.updateDownloadFailed(message); } else if (BroadcastService.INTENT_ACTIONS.UPDATE_TYPING_STATUS.toString().equals(action)) { String currentUserId = intent.getStringExtra("userId"); String isTyping = intent.getStringExtra("isTyping"); conversationUIService.updateTypingStatus(currentUserId, isTyping); } else if (BroadcastService.INTENT_ACTIONS.UPDATE_LAST_SEEN_AT_TIME.toString().equals(action)) { conversationUIService.updateLastSeenStatus(intent.getStringExtra("contactId")); } else if (BroadcastService.INTENT_ACTIONS.MQTT_DISCONNECTED.toString().equals(action)) { conversationUIService.reconnectMQTT(); } else if (BroadcastService.INTENT_ACTIONS.CHANNEL_SYNC.toString().equals(action)) { conversationUIService.updateChannelSync(); } else if (BroadcastService.INTENT_ACTIONS.UPDATE_TITLE_SUBTITLE.toString().equals(action)) { conversationUIService.updateTitleAndSubtitle(); } else if (BroadcastService.INTENT_ACTIONS.CONVERSATION_READ.toString().equals(action)) { String currentId = intent.getStringExtra("currentId"); boolean isGroup = intent.getBooleanExtra("isGroup", false); conversationUIService.updateConversationRead(currentId, isGroup); } else if (BroadcastService.INTENT_ACTIONS.UPDATE_USER_DETAIL.toString().equals(action)) { conversationUIService.updateUserInfo(intent.getStringExtra("contactId")); } else if (BroadcastService.INTENT_ACTIONS.MESSAGE_METADATA_UPDATE.toString().equals(action)) { conversationUIService.updateMessageMetadata(keyString); } else if (BroadcastService.INTENT_ACTIONS.MUTE_USER_CHAT.toString().equals(action)) { conversationUIService.muteUserChat(intent.getBooleanExtra("mute", false), intent.getStringExtra("userId")); } } }
970311a221d5e4b4df8156a2b12ea2b238c9961f
75b10db74cdeab120aa70c083e93f33a6fce8d42
/app/src/androidTest/java/in/appcrew/moviez/ExampleInstrumentedTest.java
b6679ceea4a2228ffc6510d77542ff50c7ea56ba
[]
no_license
nmrafiq87/Moviez
97b5ebfb5554a4688898ecaf59f5ec62d1a24eb8
a4b0ef50ce3ee64affc17648491778eebd819e75
refs/heads/master
2022-03-10T09:27:49.674190
2018-11-26T11:37:54
2018-11-26T11:37:54
111,864,970
0
0
null
null
null
null
UTF-8
Java
false
false
738
java
package in.appcrew.moviez; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("in.appcrew.moviez", appContext.getPackageName()); } }
25a034029341840a07eaac87ed4a750d0e51ca8b
e38ab03528d0674d9838cc887ec0d6ec6922daab
/Secure_Storage_Service/src/weloveclouds/server/services/replication/ReplicationServiceFactory.java
e91bfc6f38c0e2e26fe488a9b4797606d6fe19de
[]
no_license
benedekh/WeLoveClouds
d8ba2c7024205985c15de5b49fd0e221c4b55cce
085579c889713b3a63c7ad01dbf30973bce7dabc
refs/heads/master
2022-07-22T02:46:22.989742
2022-07-14T06:25:24
2022-07-14T06:25:24
71,482,555
0
1
null
2022-07-14T06:25:25
2016-10-20T16:29:29
Java
UTF-8
Java
false
false
1,433
java
package weloveclouds.server.services.replication; import weloveclouds.commons.kvstore.serialization.KVTransferMessageSerializer; import weloveclouds.server.services.replication.request.ReplicationRequestFactory; import weloveclouds.server.services.transaction.ITransactionSenderService; import weloveclouds.server.services.transaction.TransactionServiceFactory; /** * Factory to create {@link ReplicationService} instances. * * @author Benedek */ public class ReplicationServiceFactory { /** * @param transactionSenderService the transaction protocol to be used by the replication * service * @return a {@link ReplicationService} instances which uses the referred transaction protocol */ public ReplicationService createReplicationService( ITransactionSenderService transactionSenderService) { return new ReplicationService.Builder().transactionSenderService(transactionSenderService) .statefulReplicationFactory( new ReplicationRequestFactory(new KVTransferMessageSerializer())) .build(); } /** * A {@link ReplicationService} instances which uses 2-phase-commit protocol for transactions. */ public ReplicationService createReplicationServiceWith2PC() { return createReplicationService( new TransactionServiceFactory().create2PCTransactionSenderService()); } }
e446964f7893e318c28c4c4c440bd708546aec4b
2f39d2ba3414a2b9e65468a6a1b6365029e5a7d1
/src/main/java/br/com/novio/config/WebConfigurer.java
13d629cc7362350f3f58a0cf66ee53592cb8f8b7
[]
no_license
alyssonalves/gatteway
8249a048d3d6609ae8f731ddc947e1900284a09b
4263007486e9e60ec1108e66af76fc027281d5b8
refs/heads/master
2020-04-22T16:38:54.994209
2019-02-08T13:55:40
2019-02-08T13:55:40
170,515,401
0
0
null
null
null
null
UTF-8
Java
false
false
8,583
java
package br.com.novio.config; import com.codahale.metrics.MetricRegistry; import com.codahale.metrics.servlet.InstrumentedFilter; import com.codahale.metrics.servlets.MetricsServlet; import io.github.jhipster.config.JHipsterConstants; import io.github.jhipster.config.JHipsterProperties; import io.github.jhipster.web.filter.CachingHttpHeadersFilter; import io.undertow.UndertowOptions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; import org.springframework.boot.web.server.*; import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; import org.springframework.http.MediaType; import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import org.springframework.web.filter.CorsFilter; import javax.servlet.*; import java.io.File; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.nio.file.Paths; import java.util.*; import static java.net.URLDecoder.decode; /** * Configuration of web application with Servlet 3.0 APIs. */ @Configuration public class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer<WebServerFactory> { private final Logger log = LoggerFactory.getLogger(WebConfigurer.class); private final Environment env; private final JHipsterProperties jHipsterProperties; private MetricRegistry metricRegistry; public WebConfigurer(Environment env, JHipsterProperties jHipsterProperties) { this.env = env; this.jHipsterProperties = jHipsterProperties; } @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); } EnumSet<DispatcherType> disps = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.ASYNC); initMetrics(servletContext, disps); if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION)) { initCachingHttpHeadersFilter(servletContext, disps); } log.info("Web application fully configured"); } /** * Customize the Servlet engine: Mime types, the document root, the cache. */ @Override public void customize(WebServerFactory server) { setMimeMappings(server); // When running in an IDE or with ./mvnw spring-boot:run, set location of the static web assets. setLocationForStaticAssets(server); /* * Enable HTTP/2 for Undertow - https://twitter.com/ankinson/status/829256167700492288 * HTTP/2 requires HTTPS, so HTTP requests will fallback to HTTP/1.1. * See the JHipsterProperties class and your application-*.yml configuration files * for more information. */ if (jHipsterProperties.getHttp().getVersion().equals(JHipsterProperties.Http.Version.V_2_0) && server instanceof UndertowServletWebServerFactory) { ((UndertowServletWebServerFactory) server) .addBuilderCustomizers(builder -> builder.setServerOption(UndertowOptions.ENABLE_HTTP2, true)); } } private void setMimeMappings(WebServerFactory server) { if (server instanceof ConfigurableServletWebServerFactory) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); // IE issue, see https://github.com/jhipster/generator-jhipster/pull/711 mappings.add("html", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase()); // CloudFoundry issue, see https://github.com/cloudfoundry/gorouter/issues/64 mappings.add("json", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase()); ConfigurableServletWebServerFactory servletWebServer = (ConfigurableServletWebServerFactory) server; servletWebServer.setMimeMappings(mappings); } } private void setLocationForStaticAssets(WebServerFactory server) { if (server instanceof ConfigurableServletWebServerFactory) { ConfigurableServletWebServerFactory servletWebServer = (ConfigurableServletWebServerFactory) server; File root; String prefixPath = resolvePathPrefix(); root = new File(prefixPath + "target/www/"); if (root.exists() && root.isDirectory()) { servletWebServer.setDocumentRoot(root); } } } /** * Resolve path prefix to static resources. */ private String resolvePathPrefix() { String fullExecutablePath; try { fullExecutablePath = decode(this.getClass().getResource("").getPath(), StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { /* try without decoding if this ever happens */ fullExecutablePath = this.getClass().getResource("").getPath(); } String rootPath = Paths.get(".").toUri().normalize().getPath(); String extractedPath = fullExecutablePath.replace(rootPath, ""); int extractionEndIndex = extractedPath.indexOf("target/"); if (extractionEndIndex <= 0) { return ""; } return extractedPath.substring(0, extractionEndIndex); } /** * Initializes the caching HTTP Headers Filter. */ private void initCachingHttpHeadersFilter(ServletContext servletContext, EnumSet<DispatcherType> disps) { log.debug("Registering Caching HTTP Headers Filter"); FilterRegistration.Dynamic cachingHttpHeadersFilter = servletContext.addFilter("cachingHttpHeadersFilter", new CachingHttpHeadersFilter(jHipsterProperties)); cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/i18n/*"); cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/content/*"); cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/app/*"); cachingHttpHeadersFilter.setAsyncSupported(true); } /** * Initializes Metrics. */ private void initMetrics(ServletContext servletContext, EnumSet<DispatcherType> disps) { log.debug("Initializing Metrics registries"); servletContext.setAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE, metricRegistry); servletContext.setAttribute(MetricsServlet.METRICS_REGISTRY, metricRegistry); log.debug("Registering Metrics Filter"); FilterRegistration.Dynamic metricsFilter = servletContext.addFilter("webappMetricsFilter", new InstrumentedFilter()); metricsFilter.addMappingForUrlPatterns(disps, true, "/*"); metricsFilter.setAsyncSupported(true); log.debug("Registering Metrics Servlet"); ServletRegistration.Dynamic metricsAdminServlet = servletContext.addServlet("metricsServlet", new MetricsServlet()); metricsAdminServlet.addMapping("/management/metrics/*"); metricsAdminServlet.setAsyncSupported(true); metricsAdminServlet.setLoadOnStartup(2); } @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) { log.debug("Registering CORS filter"); source.registerCorsConfiguration("/api/**", config); source.registerCorsConfiguration("/management/**", config); source.registerCorsConfiguration("/v2/api-docs", config); source.registerCorsConfiguration("/*/api/**", config); source.registerCorsConfiguration("/*/management/**", config); } return new CorsFilter(source); } @Autowired(required = false) public void setMetricRegistry(MetricRegistry metricRegistry) { this.metricRegistry = metricRegistry; } }
8873e5f96420a1dcc4347bb4717b3d3e4d1e7723
3141edec56fbb22a66110d55183fcd08e68f18f4
/tools/data-tools/src/org/slc/sli/test/edfi/entities/SLCObjectiveAssessment.java
cce0ce531d93abd86653a2de0679e5be29452269
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
todd-fritz/secure-data-service
7451aac56b4fd0611fbeb6a63dd2e9cf71d0af82
a91d8a2f6b6dc101b6c56b29e8c7a9a8cafd142c
refs/heads/master
2023-07-07T03:45:01.731002
2023-05-01T14:19:44
2023-05-01T14:19:44
21,170,227
0
0
Apache-2.0
2023-07-02T05:03:24
2014-06-24T15:34:30
Java
UTF-8
Java
false
false
10,930
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2012.12.06 at 10:00:50 AM EST // package org.slc.sli.test.edfi.entities; import javax.xml.bind.annotation.XmlRootElement; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * ObjectiveAssessment record with key field: IdentificationCode. Changed type of LearningObjectiveReference, LearningStandardReference and ObjectiveAssessmentReference to SLC reference types. * * <p>Java class for SLC-ObjectiveAssessment complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="SLC-ObjectiveAssessment"> * &lt;complexContent> * &lt;extension base="{http://ed-fi.org/0100}ComplexObjectType"> * &lt;sequence> * &lt;element name="IdentificationCode" type="{http://ed-fi.org/0100}IdentificationCode"/> * &lt;element name="MaxRawScore" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/> * &lt;element name="AssessmentPerformanceLevel" type="{http://ed-fi.org/0100}AssessmentPerformanceLevel" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="PercentOfAssessment" type="{http://ed-fi.org/0100}percent" minOccurs="0"/> * &lt;element name="Nomenclature" type="{http://ed-fi.org/0100}Nomenclature" minOccurs="0"/> * &lt;element name="AssessmentItemReference" type="{http://ed-fi.org/0100}ReferenceType" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="LearningObjectiveReference" type="{http://ed-fi.org/0100}SLC-LearningObjectiveReferenceType" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="LearningStandardReference" type="{http://ed-fi.org/0100}SLC-LearningStandardReferenceType" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="ObjectiveAssessmentReference" type="{http://ed-fi.org/0100}SLC-ObjectiveAssessmentReferenceType" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SLC-ObjectiveAssessment", propOrder = { "identificationCode", "maxRawScore", "assessmentPerformanceLevel", "percentOfAssessment", "nomenclature", "assessmentItemReference", "learningObjectiveReference", "learningStandardReference", "objectiveAssessmentReference" }) @XmlRootElement(name = "ObjectiveAssessment") public class SLCObjectiveAssessment extends ComplexObjectType { @XmlElement(name = "IdentificationCode", required = true) protected String identificationCode; @XmlElement(name = "MaxRawScore") protected Integer maxRawScore; @XmlElement(name = "AssessmentPerformanceLevel") protected List<AssessmentPerformanceLevel> assessmentPerformanceLevel; @XmlElement(name = "PercentOfAssessment") protected Integer percentOfAssessment; @XmlElement(name = "Nomenclature") protected String nomenclature; @XmlElement(name = "AssessmentItemReference") protected List<ReferenceType> assessmentItemReference; @XmlElement(name = "LearningObjectiveReference") protected List<SLCLearningObjectiveReferenceType> learningObjectiveReference; @XmlElement(name = "LearningStandardReference") protected List<SLCLearningStandardReferenceType> learningStandardReference; @XmlElement(name = "ObjectiveAssessmentReference") protected List<SLCObjectiveAssessmentReferenceType> objectiveAssessmentReference; /** * Gets the value of the identificationCode property. * * @return * possible object is * {@link String } * */ public String getIdentificationCode() { return identificationCode; } /** * Sets the value of the identificationCode property. * * @param value * allowed object is * {@link String } * */ public void setIdentificationCode(String value) { this.identificationCode = value; } /** * Gets the value of the maxRawScore property. * * @return * possible object is * {@link Integer } * */ public Integer getMaxRawScore() { return maxRawScore; } /** * Sets the value of the maxRawScore property. * * @param value * allowed object is * {@link Integer } * */ public void setMaxRawScore(Integer value) { this.maxRawScore = value; } /** * Gets the value of the assessmentPerformanceLevel property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the assessmentPerformanceLevel property. * * <p> * For example, to add a new item, do as follows: * <pre> * getAssessmentPerformanceLevel().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link AssessmentPerformanceLevel } * * */ public List<AssessmentPerformanceLevel> getAssessmentPerformanceLevel() { if (assessmentPerformanceLevel == null) { assessmentPerformanceLevel = new ArrayList<AssessmentPerformanceLevel>(); } return this.assessmentPerformanceLevel; } /** * Gets the value of the percentOfAssessment property. * * @return * possible object is * {@link Integer } * */ public Integer getPercentOfAssessment() { return percentOfAssessment; } /** * Sets the value of the percentOfAssessment property. * * @param value * allowed object is * {@link Integer } * */ public void setPercentOfAssessment(Integer value) { this.percentOfAssessment = value; } /** * Gets the value of the nomenclature property. * * @return * possible object is * {@link String } * */ public String getNomenclature() { return nomenclature; } /** * Sets the value of the nomenclature property. * * @param value * allowed object is * {@link String } * */ public void setNomenclature(String value) { this.nomenclature = value; } /** * Gets the value of the assessmentItemReference property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the assessmentItemReference property. * * <p> * For example, to add a new item, do as follows: * <pre> * getAssessmentItemReference().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link ReferenceType } * * */ public List<ReferenceType> getAssessmentItemReference() { if (assessmentItemReference == null) { assessmentItemReference = new ArrayList<ReferenceType>(); } return this.assessmentItemReference; } /** * Gets the value of the learningObjectiveReference property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the learningObjectiveReference property. * * <p> * For example, to add a new item, do as follows: * <pre> * getLearningObjectiveReference().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link SLCLearningObjectiveReferenceType } * * */ public List<SLCLearningObjectiveReferenceType> getLearningObjectiveReference() { if (learningObjectiveReference == null) { learningObjectiveReference = new ArrayList<SLCLearningObjectiveReferenceType>(); } return this.learningObjectiveReference; } /** * Gets the value of the learningStandardReference property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the learningStandardReference property. * * <p> * For example, to add a new item, do as follows: * <pre> * getLearningStandardReference().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link SLCLearningStandardReferenceType } * * */ public List<SLCLearningStandardReferenceType> getLearningStandardReference() { if (learningStandardReference == null) { learningStandardReference = new ArrayList<SLCLearningStandardReferenceType>(); } return this.learningStandardReference; } /** * Gets the value of the objectiveAssessmentReference property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the objectiveAssessmentReference property. * * <p> * For example, to add a new item, do as follows: * <pre> * getObjectiveAssessmentReference().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link SLCObjectiveAssessmentReferenceType } * * */ public List<SLCObjectiveAssessmentReferenceType> getObjectiveAssessmentReference() { if (objectiveAssessmentReference == null) { objectiveAssessmentReference = new ArrayList<SLCObjectiveAssessmentReferenceType>(); } return this.objectiveAssessmentReference; } }
d62e23a9256eca1cadb04dd84a70063fb958e3e2
b2fa66ec49f50b4bb92fee6494479238c8b46876
/src/main/java/fi/riista/feature/huntingclub/poi/mobile/MobilePoiLocationDTO.java
c47d9ceae2771e238fe63323d04f9c092036af89
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
suomenriistakeskus/oma-riista-web
f007a9dc663317956ae672ece96581f1704f0e85
f3550bce98706dfe636232fb2765a44fa33f78ca
refs/heads/master
2023-04-27T12:07:50.433720
2023-04-25T11:31:05
2023-04-25T11:31:05
77,215,968
16
4
MIT
2023-04-25T11:31:06
2016-12-23T09:49:44
Java
UTF-8
Java
false
false
1,677
java
package fi.riista.feature.huntingclub.poi.mobile; import fi.riista.feature.common.entity.GeoLocation; import fi.riista.feature.common.entity.HasID; import fi.riista.feature.huntingclub.poi.PoiLocation; import javax.annotation.Nonnull; import javax.validation.constraints.NotNull; public class MobilePoiLocationDTO implements HasID<Long> { private Long id; private Long poiId; private String description; @NotNull private Integer visibleId; @NotNull private GeoLocation geoLocation; public MobilePoiLocationDTO() { } public MobilePoiLocationDTO(@Nonnull final PoiLocation entity) { this.id = entity.getId(); this.poiId = entity.getPoi().getId(); this.description = entity.getDescription(); this.visibleId = entity.getVisibleId(); this.geoLocation = entity.getGeoLocation(); } @Override public Long getId() { return id; } public void setId(final Long id) { this.id = id; } public long getPoiId() { return poiId; } public void setPoiId(final long poiId) { this.poiId = poiId; } public String getDescription() { return description; } public void setDescription(final String description) { this.description = description; } public Integer getVisibleId() { return visibleId; } public void setVisibleId(final Integer visibleId) { this.visibleId = visibleId; } public GeoLocation getGeoLocation() { return geoLocation; } public void setGeoLocation(final GeoLocation geoLocation) { this.geoLocation = geoLocation; } }
cef1ce3fc29cf40f8fd7b2c320ae8c1efe797d6d
15529bd4436e456c37b842ebeaae7821c3b1e03c
/分布式java应用基础与实践/Chapter3/MemorySpaceAndAllocation.java
de524ad649e4d2b9afe830a449457a34664e57ff
[ "MIT" ]
permissive
java-scott/java-project
2fbd9764df3cc38b94602ead8b67421628c854e9
3821e8396440888c62341a8585ffb995fa6aaedf
refs/heads/master
2020-12-24T13:36:58.021850
2016-06-11T22:54:54
2016-06-11T22:54:54
60,106,522
3
1
null
null
null
null
UTF-8
Java
false
false
908
java
public class MemorySpaceAndAllocation{ public static void main(String[] args) throws Exception{ Thread.sleep(2000); // should allocate from TLAB MemoryObject object=new MemoryObject(new byte[1024]); Thread.sleep(2000); // should allocate from Eden space,not TLAB MemoryObject newObject=new MemoryObject(new byte[1024*1024*4]); Thread.sleep(2000); System.gc(); Thread.sleep(2000); object=new MemoryObject(new byte[1024]); Thread.sleep(2000); // should allocate from Eden space,not TLAB newObject=new MemoryObject(new byte[1024*1024*4]); Thread.sleep(2000); System.gc(); Thread.sleep(2000); } } class MemoryObject{ private byte[] bytes; public byte[] getBytes(){ return bytes; } public MemoryObject(byte[] bytes){ this.bytes=bytes; } }
b29ceb40ceca0c95e7a55b50b99ce9b3e64c8753
1a574fd114b1348694bebe4d7cfcfabc2a915b93
/app/src/main/java/com/ulp/visualizer/ListaAdapter.java
7aed1a770ff8af617fdefb2c7e0d9858c35ebb61
[]
no_license
infortrOnix/Visualizer
c1b503966d9cb05dd0be89d154822ef74db6f6b2
e5166277f9afb07bb3d1e1e9493de8155214eb3c
refs/heads/master
2022-12-14T01:54:00.747321
2020-09-20T07:11:59
2020-09-20T07:11:59
297,022,143
0
0
null
null
null
null
UTF-8
Java
false
false
1,524
java
package com.ulp.visualizer; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.List; public class ListaAdapter extends ArrayAdapter<Agencia> { private Context context; private List<Agencia>lista; private LayoutInflater li; public ListaAdapter(@NonNull Context context, int resource, @NonNull List<Agencia> objects, LayoutInflater li) { super(context, resource, objects); this.context=context; this.lista=objects; this.li=li; } @NonNull @Override public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { View itemView= convertView; if (itemView==null){ itemView=li.inflate(R.layout.item,parent,false); } Agencia agencia=lista.get(position); ImageView foto=itemView.findViewById(R.id.ivFoto); foto.setImageResource(agencia.getFoto()); TextView marca=itemView.findViewById(R.id.tvMarca); marca.setText(agencia.getMarca()); TextView modelo=itemView.findViewById(R.id.tvModelo); modelo.setText(agencia.getModelo()); TextView precio=itemView.findViewById(R.id.tvPrecio); precio.setText(agencia.getPrecio()+""); return itemView; } }
37d2d77a6cad100ce4aca8737592db966f688747
45d607352606d953a2504230793089b350e2e263
/Server.java
f97522f85d8e38a1adc580d08a71891c08a38b81
[]
no_license
pbhandari356/InventoryManagement
3e037f7c2588b2d144f5ba8cdaf21253c9dcb042
27984a18047d518ca147213bf5b87258b2e7d7a0
refs/heads/master
2020-12-01T16:28:23.766905
2016-08-22T03:29:33
2016-08-22T03:29:33
66,236,807
0
0
null
null
null
null
UTF-8
Java
false
false
665
java
import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; /** * @author Prashant Bhandari * */ public class Server { final static int _portNumber = 8080; final static InventoryController inv = new InventoryController(); static ServerSocket serverSocket; public static void main(String[] args) { try{ serverSocket = new ServerSocket(_portNumber); while (true) { Socket clientSocket = serverSocket.accept(); ClientThread cliThread = new ClientThread(clientSocket, inv); cliThread.start(); } } catch (IOException e) { e.printStackTrace(); } } }
c120a562b1fcb79eacd1fd2ac0e129cc59894d09
6d7805b4f32e85de481ff7568faaae21e64c8efa
/src/main/java/net/coco/chess/Rank.java
241f3a7f8dacd104b7234627f796c1fde6b2cc87
[]
no_license
ChoiGiSung/privateChess
972efc01fb740327616863754bd94a4871fade2e
1f09d316d974f87cc09a7bdffca720d6e3b72069
refs/heads/main
2023-03-21T14:22:52.108380
2021-03-11T15:04:52
2021-03-11T15:04:52
337,701,622
0
0
null
null
null
null
UTF-8
Java
false
false
3,082
java
package net.coco.chess; import net.coco.pieces.Piece; import net.coco.pieces.Piece.Color; import net.coco.pieces.PieceType; import java.util.*; import java.util.stream.Collectors; public class Rank { private final List<Piece> pieces = new ArrayList<>(); public List<Piece> getPieces() { return Collections.unmodifiableList(pieces); //piece 변경가능 } public static Rank initBlackPieces() { Rank rank = new Rank(); rank.addPiece(Piece.createBlackRook()) .addPiece(Piece.createBlackKnight()) .addPiece(Piece.createBlackBishop()) .addPiece(Piece.createBlackQueen()) .addPiece(Piece.createBlackKing()) .addPiece(Piece.createBlackBishop()) .addPiece(Piece.createBlackKnight()) .addPiece(Piece.createBlackRook()); return rank; } public static Rank initWhitePieces() { Rank rank = new Rank(); rank.addPiece(Piece.createWhiteRook()) .addPiece(Piece.createWhiteKnight()) .addPiece(Piece.createWhiteBishop()) .addPiece(Piece.createWhiteQueen()) .addPiece(Piece.createWhiteKing()) .addPiece(Piece.createWhiteBishop()) .addPiece(Piece.createWhiteKnight()) .addPiece(Piece.createWhiteRook()); return rank; } public static Rank initWhitePawns() { Rank rank = new Rank(); for (int i = 0; i < Board.BOARD_CELLS; i++) { rank.addPiece(Piece.createWhitePawn()); } return rank; } public static Rank initBlackPawns() { Rank rank = new Rank(); for (int i = 0; i < Board.BOARD_CELLS; i++) { rank.addPiece(Piece.createBlackPawn()); } return rank; } public static Rank initBlankLine() { Rank rank = new Rank(); for (int i = 0; i < Board.BOARD_CELLS; i++) { rank.addPiece(Piece.createBlank()); } return rank; } private Rank addPiece(Piece piece) { pieces.add(piece); return this; } public int findPieceCount(PieceType pieceType, Color color) { return (int) pieces.stream() .filter(piece -> piece.getPieceType() == pieceType) .filter(piece -> piece.getColor() == color) .count(); } public Piece findPieceFromPoint(int column) { return pieces.get(column); } public void movePieceToPoint(Piece piece, int row) { pieces.set(row, piece); } public Piece findPieceByColumn(Color color, int column) { Piece findPiece = pieces.get(column); return findPiece.getColor() == color ? findPiece : Piece.createBlank(); } public List<Piece> getWhitePieces() { return pieces.stream().filter(Piece::isWhite).collect(Collectors.toList()); } public List<Piece> getBlackPieces() { return pieces.stream().filter(Piece::isBlack).collect(Collectors.toList()); } }
4b62a5ecc06c63f580f4d3c50d08bbc63bd557b2
b062e2f89555232123d262a4c68ac952a75fcc2c
/src/main/java/com/czh/pojo/Good.java
f7aeacd10b7ed73c6fc8da6d49728649022bffe0
[]
no_license
ssf-czh/borrow_anthing
ae27af0ba35087556bfe3cb3958788fe8b9348f0
244db0559b7cea367e27bd8f55922794745f6f10
refs/heads/master
2022-06-22T04:39:26.387739
2019-11-22T07:13:29
2019-11-22T07:13:29
217,681,703
1
0
null
2022-06-17T02:35:02
2019-10-26T08:51:55
Java
UTF-8
Java
false
false
1,883
java
package com.czh.pojo; import com.fasterxml.jackson.annotation.JsonView; import lombok.Data; import org.apache.ibatis.annotations.One; import tk.mybatis.mapper.annotation.KeySql; import javax.persistence.Id; import javax.persistence.Table; @Table(name = "good_tab") @Data public class Good { //首页商品详情 public interface OneView{}; @Id @KeySql(useGeneratedKeys = true) private Integer gid; private Integer uid; private String location; private String imgurl; // 物品状态 0表待审核 1表示借出 2表示空闲 private Integer status; private String detail; private Double price; @JsonView(OneView.class) public String getName() { return name; } public void setName(String name) { this.name = name; } private String type; private String name; @JsonView(OneView.class) public Integer getGid() { return gid; } public void setGid(Integer gid) { this.gid = gid; } public Integer getUid() { return uid; } public void setUid(Integer uid) { this.uid = uid; } public String getLocation() { return location; } public void setLocation(String location) { this.location = location; } @JsonView(OneView.class) public String getImgurl() { return imgurl; } public void setImgurl(String imgurl) { this.imgurl = imgurl; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public String getDetail() { return detail; } public void setDetail(String detail) { this.detail = detail; } public String getType() { return type; } public void setType(String type) { this.type = type; } }
e7487740e3deb99b155e49d05611400ee40bac61
71c3bcedc444f7cd310be6c9570460af424fbe4c
/src/cs3500/animator/model/SimpleAnimationModel.java
ac222a20f22397342258d7799665ebf87ab02b67
[]
no_license
awang24/animation2
c906257ab19ba83aff04b130fed22e062102d587
bea71d65a3c18311993455b328ea3d55f2161eed
refs/heads/master
2021-08-16T02:41:31.529257
2017-11-18T21:17:05
2017-11-18T21:17:05
111,121,939
0
0
null
null
null
null
UTF-8
Java
false
false
8,278
java
package cs3500.animator.model; import java.awt.Color; import java.util.ArrayList; import java.util.List; import cs3500.animator.model.animation.AnimationType; import cs3500.animator.model.animation.Animations; import cs3500.animator.model.animation.ChangeColor; import cs3500.animator.model.animation.ChangeDimension; import cs3500.animator.model.animation.MoveAnimation; import cs3500.animator.model.shape.CreateShapeVisitor; import cs3500.animator.model.shape.Oval; import cs3500.animator.model.shape.Posn; import cs3500.animator.model.shape.RectangleShape; import cs3500.animator.model.shape.Shapes; import cs3500.animator.starter.TweenModelBuilder; /** * This is a class for a simple animation model which represents a model that processes an * animation. It implements the IAnimationModel and its operations. */ public class SimpleAnimationModel implements IAnimationModel { private List<Shapes> shapes; private List<Animations> animations; /** * Constructs a {@code SimpleAnimationModel} object. */ public SimpleAnimationModel() { this.shapes = new ArrayList<Shapes>(); this.animations = new ArrayList<Animations>(); } private SimpleAnimationModel(SimpleAnimationModelBuilder builder) { this.shapes = builder.listShapes; this.animations = builder.listAnimations; } @Override public void addShape(Shapes s) { this.shapes.add(s); } @Override public void addAnimations(Animations a) { AnimationType addType = a.getType(); Shapes addShape = a.getShape(); int addStart = a.getStart(); int size = animations.size(); for (int i = 0; i < animations.size(); i++) { Animations current = animations.get(i); AnimationType type = current.getType(); Shapes shape = current.getShape(); int start = current.getStart(); int end = current.getEnd(); if (addType == type) { if (addShape.getName().equals(shape.getName())) { if ((addStart >= start) && (addStart <= end)) { throw new IllegalArgumentException("Incompatible move for the same shape " + "during overlapping time intervals"); } } } } // Add animation in order of start time for (int i = 0; i < size; i++) { Animations current = animations.get(i); int start = current.getStart(); if (addStart < start) { animations.add(i, a); } } if (size == animations.size()) { animations.add(a); } } @Override public String getDescription() { String state = "Shapes:\n"; for (int i = 0; i < shapes.size(); i++) { state += shapes.get(i).getState() + "\n"; } for (int i = 0; i < animations.size(); i++) { state += animations.get(i).getDescription() + "\n"; } return state; } @Override public List<Shapes> getShapes() { return shapes; } @Override public List<Animations> getAnimations() { return animations; } @Override public int getLastTime() { int last = -1; for (int i = 0; i < animations.size(); i++) { Animations current = animations.get(i); int currentEnd = current.getEnd(); if (currentEnd > last) { last = currentEnd; } } return last; } /** * Represents a simple animation builder that will add shapes and animations to the model. */ public static final class SimpleAnimationModelBuilder implements TweenModelBuilder<IAnimationModel> { private List<Animations> listAnimations; private List<Shapes> listShapes; /** * Constructs a {@code SimpleAnimationBuilder} object. **/ public SimpleAnimationModelBuilder() { this.listAnimations = new ArrayList<Animations>(); this.listShapes = new ArrayList<Shapes>(); } @Override public TweenModelBuilder<IAnimationModel> addOval( String name, float cx, float cy, float xRadius, float yRadius, float red, float green, float blue, int startOfLife, int endOfLife) { Posn p = new Posn(cx, cy); Color c = new Color(red, green, blue); Shapes shape = new Oval(name, startOfLife, endOfLife, p, c, xRadius, yRadius); listShapes.add(shape); return this; } @Override public TweenModelBuilder<IAnimationModel> addRectangle( String name, float lx, float ly, float width, float height, float red, float green, float blue, int startOfLife, int endOfLife) { Posn p = new Posn(lx, ly); Color c = new Color(red, green, blue); Shapes shape = new RectangleShape(name, startOfLife, endOfLife, p, c, width, height); listShapes.add(shape); return this; } /** * Add given animation in order in the list of animations if animation is valid. * * @param a animation to add to list of animations */ private void addAnimations(Animations a) { AnimationType addType = a.getType(); Shapes addShape = a.getShape(); int addStart = a.getStart(); for (int i = 0; i < listAnimations.size(); i++) { Animations current = listAnimations.get(i); AnimationType type = current.getType(); Shapes shape = current.getShape(); int start = current.getStart(); int end = current.getEnd(); if (addType == type) { if (addShape.getName().equals(shape.getName())) { if ((addStart >= start) && (addStart <= end)) { throw new IllegalArgumentException("Incompatible move for the same shape " + "during overlapping time intervals"); } } } } listAnimations.add(a); } @Override public TweenModelBuilder<IAnimationModel> addMove( String name, float moveFromX, float moveFromY, float moveToX, float moveToY, int startTime, int endTime) { Posn origin = new Posn(moveFromX, moveFromY); Posn dest = new Posn(moveToX, moveToY); Shapes s = null; //List<Shapes> loshapes = model.getShapes(); for (int i = 0; i < listShapes.size(); i++) { Shapes current = listShapes.get(i); if (current.getName().equals(name)) { s = current.accept(new CreateShapeVisitor()); s.setPosn(origin); } } try { Animations animation = new MoveAnimation(s, startTime, endTime, origin, dest); this.addAnimations(animation); } catch (Exception e) { // do nothing } return this; } @Override public TweenModelBuilder<IAnimationModel> addColorChange( String name, float oldR, float oldG, float oldB, float newR, float newG, float newB, int startTime, int endTime) { Color oldColor = new Color(oldR, oldG, oldB); Color newColor = new Color(newR, newG, newB); Shapes s = null; for (int i = 0; i < listShapes.size(); i++) { Shapes current = listShapes.get(i); if (current.getName().equals(name)) { s = current.accept(new CreateShapeVisitor()); s.setColor(oldColor); } } try { Animations animation = new ChangeColor(s, startTime, endTime, oldColor, newColor); this.addAnimations(animation); } catch (Exception e) { // do nothing } return this; } @Override public TweenModelBuilder<IAnimationModel> addScaleToChange(String name, float fromSx, float fromSy, float toSx, float toSy, int startTime, int endTime) { Shapes s = null; for (int i = 0; i < listShapes.size(); i++) { Shapes current = listShapes.get(i); if (current.getName().equals(name)) { s = current.accept(new CreateShapeVisitor()); s.setD1(fromSx); s.setD2(fromSy); } } try { Animations animation = new ChangeDimension(s, startTime, endTime, fromSx, fromSy, toSx, toSy); this.addAnimations(animation); } catch (Exception e) { // do nothing } return this; } @Override public IAnimationModel build() { return new SimpleAnimationModel(this); } } }
9ecdc1568d73e602bc8003a38ac855227a822fcd
ff83d22f7806378141291067c35527ec384844d1
/NearMe/app/src/androidTest/java/com/rohail/apps/nearme/ApplicationTest.java
389d4c3eafaaadc3518db80a7100306a69bbdb5e
[]
no_license
rrohaill/Near-Me
8c5cdf42215ffca3513814f2ffcf4c6988a0c323
cf0608772a90f2986dac85f2a82c231688a63c3d
refs/heads/master
2021-01-20T20:23:58.537130
2016-06-02T11:32:48
2016-06-02T11:32:48
60,153,376
1
0
null
null
null
null
UTF-8
Java
false
false
353
java
package com.ghuman.apps.nearme; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
8a218936d57cb5344b8eb5373e7da72a7bfe8b62
ce8fef4cc72d2f6dcc018cb6a07b1bbaf0c4f37b
/src/main/java/interview/leetcode/practice/round3/tree/PostOrderIterative.java
1f451a654d5f342ba3719019b1f8df0d91def4c6
[]
no_license
jojo8775/leet-code
f931b30b293178602e7d142c25f9aeef01b43ab0
2b40cb94883cc5ebc079edb3c98a4a01825c71f9
refs/heads/master
2023-08-04T11:49:15.131787
2023-07-23T00:08:50
2023-07-23T00:08:50
49,825,862
1
0
null
2022-05-20T22:01:52
2016-01-17T16:40:49
HTML
UTF-8
Java
false
false
1,799
java
package interview.leetcode.practice.round3.tree; import java.util.ArrayList; import java.util.List; import java.util.Stack; public class PostOrderIterative { public List<Integer> postOrder(TreeNode node){ Stack<TreeNode> stack = new Stack<TreeNode>(); List<Integer> result = new ArrayList<>(); TreeNode lastVisited = null; while(!stack.isEmpty() || node != null){ if(node != null){ stack.push(node); node = node.left; } else{ node = stack.peek(); if(node.right != null && !node.right.equals(lastVisited)){ node = node.right; } else{ result.add(node.val); lastVisited = stack.pop(); node = null; } } } return result; } private static class TreeNode{ TreeNode left = null, right = null; int val; TreeNode(int val){ this.val = val; } } public TreeNode createTreeNode(int[] arr, int beg, int end){ if(beg > end){ return null; } int mid = beg + (end - beg)/2; TreeNode node = new TreeNode(arr[mid]); node.left = createTreeNode(arr, beg, mid - 1); node.right = createTreeNode(arr, mid + 1, end); return node; } public static void main(String[] args){ PostOrderIterative pi = new PostOrderIterative(); TreeNode root = pi.createTreeNode(new int[]{1,2,3,4,5,6,7,8,9}, 0, 8); List<Integer> result = pi.postOrder(root); for(int n : result){ System.out.print(n + ", "); } } }
b3fccff7b0abfd300136c06399d47d49637b8875
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XRENDERING-422-7-26-NSGA_II-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/internal/parser/wikimodel/DefaultXWikiGeneratorListener_ESTest.java
ccd845cef842b1dbf3aeff9e430d5d9de2a947a2
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
610
java
/* * This file was automatically generated by EvoSuite * Thu Apr 02 14:34:40 UTC 2020 */ package org.xwiki.rendering.internal.parser.wikimodel; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class DefaultXWikiGeneratorListener_ESTest extends DefaultXWikiGeneratorListener_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
3e7b4990df031ba4f780362e1bdf82e65f76d28b
de5373a5b728a65f8826904cea37c25d3c3f6200
/src/java/com/bds/ws/dto/SicadIIDTO.java
91ea1160f0314778e44c86de81742102cd527f2d
[]
no_license
duna05/ibdsws
960fd123a4df66c8fb5f68ee7495d363581fda39
abfa12fdadccf171d65b0be835cdd2471004959f
refs/heads/master
2020-05-22T00:45:15.948298
2019-05-11T20:48:47
2019-05-11T20:48:47
186,178,839
0
0
null
null
null
null
UTF-8
Java
false
false
6,642
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.bds.ws.dto; import com.bds.ws.util.BDSUtil; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; /** * Clase SicadIIDTO * @author juan.faneite */ public class SicadIIDTO extends BDSUtil implements Serializable { private String secuenciaEmision; //Numero de secuencia. private Date fechaAdicion; //Fecha de la compra. private BigDecimal montoCompra; //Monto de la compra. private BigDecimal montoOperacion; //Monto de la operacion. private BigDecimal montoComision; //Monto de la comision. private BigDecimal porcentajeFinanc; //Porcentaje de financimiento. private String numeroCuenta; //Numero de cuenta en bolivares. private String numeroCuentaDolar2; //Numero de cuenta en dolares. private BigDecimal montoAdjudicado; //Monto adjudicado. private String tipoCambio; //Tipo de cambio private String instrumento; //Instrumento. private String estatus; //Estatus de la operacion. private RespuestaDTO respuesta; public SicadIIDTO() { } /** * Numero de secuencia. * * @return String Numero de secuencia. */ public String getSecuenciaEmision() { return secuenciaEmision; } /** * Numero de secuencia. * * @param secuenciaEmision String Numero de secuencia. */ public void setSecuenciaEmision(String secuenciaEmision) { this.secuenciaEmision = secuenciaEmision; } /** * Fecha de la compra. * * @return Date Fecha de la compra. */ public Date getFechaAdicion() { return fechaAdicion; } /** * Fecha de la compra. * * @param fechaAdicion Date Fecha de la compra. */ public void setFechaAdicion(Date fechaAdicion) { this.fechaAdicion = fechaAdicion; } /** * Monto de la compra. * * @return BigDecimal Monto de la compra. */ public BigDecimal getMontoCompra() { return montoCompra; } /** * Monto de la compra. * * @param montoCompra BigDecimal Monto de la compra. */ public void setMontoCompra(BigDecimal montoCompra) { this.montoCompra = montoCompra; } /** * Monto de la operacion. * * @return BigDecimal Monto de la operacion. */ public BigDecimal getMontoOperacion() { return montoOperacion; } /** * Monto de la operacion. * * @param montoOperacion BigDecimal Monto de la operacion. */ public void setMontoOperacion(BigDecimal montoOperacion) { this.montoOperacion = montoOperacion; } /** * Monto de la comision. * * @return BigDecimal Monto de la comision. */ public BigDecimal getMontoComision() { return montoComision; } /** * Monto de la comision. * * @param montoComision BigDecimal Monto de la comision. */ public void setMontoComision(BigDecimal montoComision) { this.montoComision = montoComision; } /** * Porcentaje de financimiento. * * @return BigDecimal Porcentaje de financimiento. */ public BigDecimal getPorcentajeFinanc() { return porcentajeFinanc; } /** * Porcentaje de financimiento. * * @param porcentajeFinanc BigDecimal Porcentaje de financimiento. */ public void setPorcentajeFinanc(BigDecimal porcentajeFinanc) { this.porcentajeFinanc = porcentajeFinanc; } /** * Numero de cuenta en bolivares. * * @return String Numero de cuenta en bolivares. */ public String getNumeroCuenta() { return numeroCuenta; } /** * Numero de cuenta en bolivares. * * @param numeroCuenta String Numero de cuenta en bolivares. */ public void setNumeroCuenta(String numeroCuenta) { this.numeroCuenta = numeroCuenta; } /** * Numero de cuenta en dolares. * * @return String Numero de cuenta en dolares. */ public String getNumeroCuentaDolar2() { return numeroCuentaDolar2; } /** * Numero de cuenta en dolares. * * @param numeroCuentaDolar2 String Numero de cuenta en dolares. */ public void setNumeroCuentaDolar2(String numeroCuentaDolar2) { this.numeroCuentaDolar2 = numeroCuentaDolar2; } /** * Monto adjudicado. * * @return BigDecimal Monto adjudicado. */ public BigDecimal getMontoAdjudicado() { return montoAdjudicado; } /** * Monto adjudicado. * * @param montoAdjudicado BigDecimal Monto adjudicado. */ public void setMontoAdjudicado(BigDecimal montoAdjudicado) { this.montoAdjudicado = montoAdjudicado; } /** * Tipo de cambio. * * @return String Tipo de cambio. */ public String getTipoCambio() { return tipoCambio; } /** * Tipo de cambio. * * @param tipoCambio String Tipo de cambio. */ public void setTipoCambio(String tipoCambio) { this.tipoCambio = tipoCambio; } /** * Instrumento. * * @return String Instrumento. */ public String getInstrumento() { return instrumento; } /** * Instrumento. * * @param instrumento String Instrumento. */ public void setInstrumento(String instrumento) { this.instrumento = instrumento; } /** * Estatus de la operacion. * * @return String Estatus de la operacion. */ public String getEstatus() { return estatus; } /** * Estatus de la operacion. * * @param estatus String Estatus de la operacion. */ public void setEstatus(String estatus) { this.estatus = estatus; } /** * retorna la respuesta de la operacion que se realiza. * @return RespuestaDTO */ public RespuestaDTO getRespuesta() { return respuesta; } /** * asigna objeto para almacenar la respuesta de la transaccion * @param respuesta objeto para almacenar la respuesta de la transaccion */ public void setRespuesta(RespuestaDTO respuesta) { this.respuesta = respuesta; } }
29b837fb21718c6baf69a8125326045e5463476e
4a45e5dc9be4419daab901078adb3af1853cb8bc
/cart/src/main/java/orders/web/HomeController.java
0669b648419e4a8e7eb88928b86d6caade05cf22
[]
no_license
AckerlyXu/SpringInActionReading
2c63f01b7c0fd1857a0c04d72c67f2b60c9fe7eb
91317322057719dc7918cbbd871000feedbb713a
refs/heads/master
2020-05-24T21:59:04.428505
2019-05-19T14:21:22
2019-05-19T14:21:22
187,487,262
0
0
null
null
null
null
UTF-8
Java
false
false
2,152
java
package orders.web; import java.util.ArrayList; import java.util.Collection; import java.util.concurrent.TimeUnit; import org.h2.util.New; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.connection.RedisConnection; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.ValueOperations; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import orders.db.Order; import orders.model.Item; import redis.clients.jedis.Jedis; @Controller public class HomeController { @RequestMapping("/") @ResponseBody public String Home() { return "home"; } @Autowired RedisConnectionFactory rcf; @Autowired StringRedisTemplate stringRedisTemplate; @Autowired RedisTemplate<String, Object> redisTemplate; @RequestMapping("/redisSet") @ResponseBody public String redisSet() { // RedisConnection connection=rcf.getConnection(); // // connection.set("greeting".getBytes(), "hello world".getBytes()); // connection.close(); redisTemplate.opsForValue().set("world2",new Order(),5,TimeUnit.SECONDS); // RedisTemplate<String, String> redisTemplate=new RedisTemplate<>(); // redisTemplate.setConnectionFactory(rcf); // ValueOperations<String, String> opsForValue = redisTemplate.opsForValue(); // opsForValue.set("s", "s"); stringRedisTemplate.opsForValue().set("hello","hello"); return "saved"; } @RequestMapping("/redisGet") @ResponseBody public String redisGet() { return redisTemplate.opsForValue().get("world2").toString(); // RedisTemplate<String, Order> redisTemplate=new RedisTemplate<>(); // redisTemplate.setConnectionFactory(rcf); // // ValueOperations<String, Order> vo= redisTemplate.opsForValue(); // Order order=vo.get("valueOperationRedisTemplate"); // return order.toString(); } }
45472d078ef633b3678fd997db47d2d74cc6d261
dbf786c85093cdca24406c364fbf84d3edf64dec
/src/main/java/com/ysmork/blog/framework/task/SystemTask.java
b95f1f07a1283f4bc41fc45f4ac062006fa21820
[]
no_license
yangshun123456/blog
96258923377cff934f29286a8836808969b2394e
a00b925a298766579c8d94eb4f324533b8173bf2
refs/heads/master
2023-02-18T16:04:48.692775
2021-01-21T08:11:25
2021-01-21T08:11:25
297,361,867
0
0
null
null
null
null
UTF-8
Java
false
false
1,547
java
package com.ysmork.blog.framework.task; import cn.hutool.core.date.DateUtil; import cn.hutool.core.lang.Dict; import cn.hutool.json.JSONUtil; import com.ysmork.blog.common.model.WebSocketConstants; import com.ysmork.blog.common.model.server.Server; import com.ysmork.blog.common.model.server.ServerVO; import com.ysmork.blog.common.util.ServerUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.messaging.simp.SimpMessagingTemplate; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.Date; /** * @program: blog * @description: * @author: YangShun * @create: 2020-12-10 16:05 **/ @Slf4j @Component public class SystemTask { @Resource private SimpMessagingTemplate wsTemplate; /** * 按照标准时间来算,每隔 2s 执行一次 */ @Scheduled(cron = "0/2 * * * * ?") public void websocket() throws Exception { // log.info("【推送消息】开始执行:{}", DateUtil.formatDateTime(new Date ())); // 查询服务器状态 Server server = new Server(); server.copyTo(); ServerVO serverVO = ServerUtil.wrapServerVO(server); Dict dict = ServerUtil.wrapServerDict(serverVO); wsTemplate.convertAndSend(WebSocketConstants.PUSH_SERVER, JSONUtil.toJsonStr(dict)); // log.info("【推送消息】执行结束:{}", DateUtil.formatDateTime(new Date())); } }
b8968ad98bb461f0e0b2f1ba8e0a8bc83c1af12e
286194bafef636dc7d277920c346bcf9b873891c
/hikaricp/src/test/java/com/zaxxer/hikari/TestConnectionCloseBlocking.java
0e38c0285a324c943104cf6d7dda7d8ee9de39e8
[ "Apache-2.0" ]
permissive
harihar/HikariCP
6c0e31af7250b12bac58efccaff61e0eb7281753
b317b23f5b37720b8c1c99be7342716215a95984
refs/heads/master
2021-01-18T03:19:34.453662
2014-10-08T03:36:08
2014-10-08T03:36:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,731
java
/** * */ package com.zaxxer.hikari; import static org.mockito.Matchers.anyInt; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.when; import java.sql.Connection; import java.sql.SQLException; import java.util.concurrent.TimeUnit; import org.junit.Assert; import org.junit.Test; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import com.zaxxer.hikari.mocks.MockDataSource; import com.zaxxer.hikari.util.PoolUtilities; /** * Test for cases when db network connectivity goes down and close is called on existing connections. By default Hikari * blocks longer than getMaximumTimeout (it can hang for a lot of time depending on driver timeout settings). Closing * async the connections fixes this issue. * */ public class TestConnectionCloseBlocking { @Test public void testConnectionCloseBlocking() throws SQLException { HikariConfig config = new HikariConfig(); config.setMinimumIdle(0); config.setMaximumPoolSize(1); config.setConnectionTimeout(1500); config.setDataSource(new CustomMockDataSource()); HikariDataSource ds = new HikariDataSource(config); long start = System.currentTimeMillis(); try { Connection connection = ds.getConnection(); connection.close(); // Hikari only checks for validity for connections with lastAccess > 1000 ms so we sleep for 1001 ms to force // Hikari to do a connection validation which will fail and will trigger the connection to be closed PoolUtilities.quietlySleep(1001); start = System.currentTimeMillis(); connection = ds.getConnection(); // on physical connection close we sleep 2 seconds Assert.assertTrue("Waited longer than timeout", (PoolUtilities.elapsedTimeMs(start) < config.getConnectionTimeout())); } catch (SQLException e) { Assert.assertTrue("getConnection failed because close connection took longer than timeout", (PoolUtilities.elapsedTimeMs(start) < config.getConnectionTimeout())); } finally { ds.close(); } } private static class CustomMockDataSource extends MockDataSource { @Override public Connection getConnection() throws SQLException { Connection mockConnection = super.getConnection(); when(mockConnection.isValid(anyInt())).thenReturn(false); doAnswer(new Answer<Void>() { @Override public Void answer(InvocationOnMock invocation) throws Throwable { TimeUnit.SECONDS.sleep(2); return null; } }).when(mockConnection).close(); return mockConnection; } } }
8fb7945508ecd812ac44abc41545cd15ef556ac7
0f0469ae9d709fdca0595302536210cc0c91c86b
/Lab9/prob7a/Employee.java
c66f0538c6e47f4a184c6cdb2c80edc989fb7197
[]
no_license
ankhaa8/MPP_Labs
4f2a445a1bb08fad8709b86162273b5227d4ae63
78f298285a726de886423d0ea175b51cc8bc5452
refs/heads/master
2020-12-24T02:31:09.292848
2020-02-04T15:13:41
2020-02-04T15:13:41
237,352,048
0
0
null
null
null
null
UTF-8
Java
false
false
860
java
package Lab9.prob7a; public class Employee { String firstName, lastName; int salary; public Employee(String f, String l, int s) { this.firstName = f; this.lastName = l; this.salary = s; } @Override public String toString() { StringBuilder sb = new StringBuilder("<"); sb.append("first name: "); sb.append(firstName); sb.append(" last name: "); sb.append(lastName); sb.append(" salary: "); sb.append("" + salary+">"); return sb.toString(); } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public int getSalary() { return salary; } public void setSalary(int salary) { this.salary = salary; } }
8a1081fb5f0afc47087311c3864b04f2976e2cb3
ceb27b4a8c0787f5717187567807fbe0c4781614
/src/main/java/com/example/northwind/business/utilities/UpdateColumnUtil.java
452ac9ef1198a4557fcdacd2f7cca6f5aa0318f9
[]
no_license
fatmanursaritemur/FinalProject-T
c60053a8397ac343b44cfce886d81b2ec60e2fee
21a4b5824a07ba81dd2cbd61735ea244f9517511
refs/heads/master
2023-03-04T17:16:20.645673
2021-02-17T17:45:45
2021-02-17T17:45:45
339,807,031
0
0
null
null
null
null
UTF-8
Java
false
false
891
java
package com.example.northwind.business.utilities; import java.util.HashSet; import java.util.Set; import lombok.experimental.UtilityClass; import org.springframework.beans.BeanWrapper; import org.springframework.beans.BeanWrapperImpl; import org.springframework.stereotype.Component; @Component public class UpdateColumnUtil { // partial update public String[] getNullPropertyNames(final Object source) { // static? final BeanWrapper src = new BeanWrapperImpl(source); java.beans.PropertyDescriptor[] pds = src.getPropertyDescriptors(); Set<String> emptyNames = new HashSet<>(); for (java.beans.PropertyDescriptor pd : pds) { Object srcValue = src.getPropertyValue(pd.getName()); if (srcValue == null) { emptyNames.add(pd.getName()); } } String[] result = new String[emptyNames.size()]; return emptyNames.toArray(result); } }
4a0f54320f5be6c4b7334f285e09acb79f9238db
d2583e58f2af5509ef0b82766bdbc1bfe50b7353
/src/main/java/com/yenaworld/rotto/vo/NumberVo.java
8936e38836ee5f72a92f54336a0f78aff97fbc61
[]
no_license
yenaworld/Lotto
bc481acb9ee5d84775c1889d0ebc489b17e7aa77
002533f7d1721e8a6e4cc3e0b9d5e30e7b355182
refs/heads/master
2021-05-04T16:13:53.337618
2018-02-09T03:25:43
2018-02-09T03:25:43
120,246,939
0
0
null
null
null
null
UTF-8
Java
false
false
1,455
java
package com.yenaworld.rotto.vo; public class NumberVo { private int index; private int one; private int two; private int three; private int four; private int five; private int six; private int bonus; private String date; public int getIndex() { return index; } public void setIndex(int index) { this.index = index; } public int getOne() { return one; } public void setOne(int one) { this.one = one; } public int getTwo() { return two; } public void setTwo(int two) { this.two = two; } public int getThree() { return three; } public void setThree(int three) { this.three = three; } public int getFour() { return four; } public void setFour(int four) { this.four = four; } public int getFive() { return five; } public void setFive(int five) { this.five = five; } public int getSix() { return six; } public void setSix(int six) { this.six = six; } public int getBonus() { return bonus; } public void setBonus(int bonus) { this.bonus = bonus; } public String getDate() { return date; } public void setDate(String date) { this.date = date; } }
9008142488969de43df3086ff0b01849a098099b
298fa871cd0b878f524126bdb12c455415e12234
/microservices/borrowing/src/main/java/com/ekino/micronaut/borrowing/client/UserFallback.java
cec67b4f2697f910ab53a9236ccde79bec90e8fb
[ "MIT" ]
permissive
ekino/micronaut-demo
b2d2bb38b2fe7d74d59ac80c9bb9297f51b054fb
73ce01e2c60df56dc1e1f11c6f49bfcc7f1b55b6
refs/heads/master
2020-04-02T23:06:23.947090
2019-09-18T15:03:26
2019-09-18T15:03:26
154,856,219
2
3
MIT
2019-09-18T15:03:27
2018-10-26T15:33:23
Java
UTF-8
Java
false
false
443
java
package com.ekino.micronaut.borrowing.client; import com.ekino.micronaut.borrowing.dto.UserDto; import java.util.UUID; import io.micronaut.retry.annotation.Fallback; import reactor.core.publisher.Mono; import static reactor.core.publisher.Mono.just; @Fallback public class UserFallback implements UserOperations { @Override public Mono<UserDto> findById(UUID id) { return just(UserDto.builder().id(id).build()); } }
111fd9b1bab3e8b8d5a8bec455c3efd2e9eefeef
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/18/18_a8ae50643c28a4f7dd47ff1dff52029afc70ae18/TaskListPage/18_a8ae50643c28a4f7dd47ff1dff52029afc70ae18_TaskListPage_t.java
93312f5e0288dcb6f054738fdc22f50292b20cf1
[]
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
2,896
java
package com.uwusoft.timesheet.wizard; import java.util.ArrayList; import java.util.List; import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse.jface.viewers.ColumnLabelProvider; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.TableViewerColumn; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.ui.plugin.AbstractUIPlugin; import com.uwusoft.timesheet.submission.model.SubmissionProject; import com.uwusoft.timesheet.submission.model.SubmissionTask; public class TaskListPage extends WizardPage { private TableViewer viewer; private SubmissionProject project; protected TaskListPage(String system, SubmissionProject project) { super("Submission system: " + system); setTitle("Project: " + project.getName()); setDescription("System: " + system); this.project = project; } @Override public void createControl(Composite parent) { // A WizardPage must create a new Composite that must use the Composite of the method parameter as parent Composite container = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); container.setLayout(layout); viewer = new TableViewer(container, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); GridData gridData = new GridData(); gridData.verticalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; gridData.grabExcessVerticalSpace = true; gridData.horizontalAlignment = GridData.FILL; viewer.getControl().setLayoutData(gridData); final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE); final TableColumn column = viewerColumn.getColumn(); column.setWidth(300); column.setResizable(true); viewerColumn.setLabelProvider(new ColumnLabelProvider() { public String getText(Object element) { return ((SubmissionTask) element).getName(); } public Image getImage(Object obj) { return AbstractUIPlugin.imageDescriptorFromPlugin("com.uwusoft.timesheet", "/icons/task_16.png").createImage(); } }); viewer.setContentProvider(ArrayContentProvider.getInstance()); viewer.setInput(project.getTasks()); // Required to avoid an error in the system setControl(container); setPageComplete(true); } @SuppressWarnings("unchecked") public void addTasksToProjects(List<SubmissionProject> projects) { project.setTasks(new ArrayList<SubmissionTask>(((StructuredSelection) viewer.getSelection()).toList())); projects.add(project); } }
ac9bc2b271b90179c173a42beb13077ac9abbd6b
afafd1514847f9a60be94879d8315de877ac6bd9
/Mini-Projet-Android/gen/com/example/mini_projet_android/BuildConfig.java
6b400e1f5b5068877c7f873e64c75899555865e9
[]
no_license
BeaulieuLoic/miniProjetAndroid
2cf1f959f0c125a31553279001546fbbb18ecbc1
6c9c503835acab97b57efc8868c5b62147a240b9
refs/heads/master
2016-08-07T16:47:54.437996
2015-04-03T08:47:11
2015-04-03T08:47:11
32,976,218
0
0
null
null
null
null
UTF-8
Java
false
false
173
java
/** Automatically generated file. DO NOT MODIFY */ package com.example.mini_projet_android; public final class BuildConfig { public final static boolean DEBUG = true; }
d6c9062b63acc8eb644e2356788c09573a1bec13
df4539abf5d521be6fddd25734ccd7d7ac461428
/01-JavaSE/day11-多态&抽象类&接口/案例/学员练习代码/myDuoTai/src/com/itheima_03/AnimalDemo.java
02a53b73c6191a907888e4c8975a3af3b5ca55bc
[]
no_license
muzierixao/Learning-Java
c9bf6d1d020fd5b6e55d99c50172c465ea06fec0
893d9a730d6429626d1df5613fa7f81aca5bdd84
refs/heads/master
2023-04-18T06:48:46.280665
2020-12-27T05:32:02
2020-12-27T05:32:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
196
java
package com.itheima_03; /* 测试类 */ public class AnimalDemo { public static void main(String[] args) { //创建动物操作类的对象,调用方法 } }
038a6a4ff0f8a4ee3b9dd088b71ea40c7f6ca1c4
02634e7e237b7131266410a650d0276918efd68c
/src/main/java/user/LogOutAction.java
dd202ae6059fa73957a3258ca4874fcf0aff6518
[]
no_license
fossabot/ITS_MARKETING-DEV-SpringUPGrade
3794a88c070bfb0f1af6d0e121ca92cf1b08a918
9cd674e7fd19b6f3c7d90594c1ee1b096d289e68
refs/heads/master
2020-04-02T23:37:30.088920
2017-06-08T11:28:48
2017-06-08T11:28:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,173
java
package user; import java.util.Enumeration; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.actions.DispatchAction; import org.apache.struts.util.LabelValueBean; import util.PropertyUtil; public class LogOutAction extends DispatchAction { protected Logger logger = Logger.getLogger(UserAction.class); public void cleanup(HttpServletRequest request) throws Exception { HttpSession hs=request.getSession(true); Enumeration e=hs.getAttributeNames(); while(e.hasMoreElements()){ String tempString=(String)e.nextElement(); if(hs.getAttribute(tempString)!=null) hs.removeAttribute(tempString); } if(hs!=null){ hs.invalidate() ; hs = null; } } public ActionForward logout(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { logger.debug("********* LogOutAction starts ***************"); HttpSession hs=request.getSession(true); //this is to ensure that the login page uses http and not https String logoutURL = PropertyUtil.load().getProperty("logoutURL", PropertyUtil.load().getProperty("baseURL")); User user = (User) hs.getAttribute("AdminUser"); if (user != null && user.getUserType() != null && user.getUserType().equals("A")) { logoutURL = PropertyUtil.load().getProperty("adminBaseURL"); } this.cleanup(request); logger.debug("********* LogOutAction ends ***************"); //return mapping.findForward("success"); response.sendRedirect(logoutURL); return null; } public ActionForward logoutKeywordReserve(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { logger.debug("********* LogOutAction starts ***************"); HttpSession hs=request.getSession(true); this.cleanup(request); logger.debug("********* LogOutAction ends ***************"); return mapping.findForward("success_kw_reserve"); } public ActionForward logoutKeywordPurchase(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { logger.debug("********* LogOutAction starts ***************"); HttpSession hs=request.getSession(true); this.cleanup(request); logger.debug("********* LogOutAction ends ***************"); return mapping.findForward("success_kw_purchase"); } public ActionForward logoutKeywordDecals(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { logger.debug("********* LogOutAction starts ***************"); HttpSession hs=request.getSession(true); this.cleanup(request); logger.debug("********* LogOutAction ends ***************"); return mapping.findForward("success_kw_decals"); } }
7de3be6a6fe982858631cda7a28546c7f42c173b
226322241d6fb4f6b6e6323cc65751171dc4e5de
/src/main/java/cz/larkyy/ldungeons/BossOrb.java
0a0edaf2b26129c7308364dc11541729655621b3
[]
no_license
Hyperburger/lDungeons
594520363cdd6093d5cfd752a23d2bd6d8cc5eac
bf59f7eeaaa403b96573c737aa8cbc78a2e7a7e5
refs/heads/master
2023-08-10T21:53:07.330250
2021-09-25T15:27:27
2021-09-25T15:27:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
484
java
package cz.larkyy.ldungeons; import org.bukkit.inventory.ItemStack; public class BossOrb { private final int id; private final ItemStack is; private final String boss; public BossOrb(int id, ItemStack is, String boss) { this.id = id; this.is = is; this.boss = boss; } public int getId() { return id; } public ItemStack getIs() { return is; } public String getBoss() { return boss; } }
10d5b5b42d89f337a0fab7c71407eff241f7780a
5f4323d237a693bd736d1abd3ba643e297b2d3e2
/src/main/java/homework_1/task2.java
fad1573a488c69eaf05bc98521fc3cfd329e1dc1
[]
no_license
MaxBratunin/ru.geekbrains.homework_1
47019708183374b4289efe2178bd47c41166836d
9c631ad2d9c09e61ac8b7bf19b6ff615c0bb51f8
refs/heads/master
2023-03-07T18:09:10.363818
2021-02-27T14:36:24
2021-02-27T14:36:24
342,877,595
0
0
null
null
null
null
UTF-8
Java
false
false
355
java
package homework_1; public class task2 { public static void main(String[] args) { byte a = 1; short b = 2; int c = 100; long d = 1234234; float e = 123.123f; double f = 12.1234d; boolean bln = true; // false char c1 = 'A'; int k = c - a; System.out.println(k); } }
3c06b378319337055a4b2c7b795fb7b7d254f451
ad1678a7cedef2fad88900b5fca7eb2cfb85fb1f
/ncep/gov.noaa.nws.ncep.viz.rsc.aww/src/gov/noaa/nws/ncep/viz/rsc/aww/query/WcnCountyQueryResult.java
2ec5c612700da26bf41b94f80154ca86b2bed1f2
[]
no_license
h4ck3rm1k3/awips2
f4fa386788d7f913648f527aa1d9d6332e7a7b9f
63ab4c6a1d32acd9d76fd3bf3e604f5a210c522e
refs/heads/upc
2020-12-29T00:26:18.244418
2015-01-13T00:37:49
2015-01-13T00:37:49
29,173,456
0
0
null
2015-01-13T04:56:35
2015-01-13T04:56:35
null
UTF-8
Java
false
false
6,910
java
/** * gov.noaa.nws.ncep.viz.rsc.warn.rsc.WcnCountyQueryResult * * Date created September 28, 2011 * * This code is developed by the SIB for use in the AWIPS2 system. */ package gov.noaa.nws.ncep.viz.rsc.aww.query; import gov.noaa.nws.ncep.viz.resources.AbstractNatlCntrsResource.IRscDataObject; import gov.noaa.nws.ncep.viz.rsc.aww.wcn.WcnResource; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import com.raytheon.uf.viz.core.catalog.DirectDbQuery; import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage; /** * Class for loading and storing county query result for WCN. * * <pre> * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 09/28/11 #456 G. Zhang Initial Creation * 08/15/13 #1028 G. Hull don't add duplicate fips to the query * * </pre> * * @author gzhang * @version 1.0 */ public class WcnCountyQueryResult { private static final double ENV_MIN_X = -180.0; private static final double ENV_MAX_X = 180.0; private static final double ENV_MIN_Y = -90; private static final double ENV_MAX_Y = 90.0; private static Logger logger = Logger.getLogger(WcnCountyQueryResult.class .getCanonicalName()); private String geoConstraint = String.format( "the_geom_0_001 && ST_SetSrid('BOX3D(%f %f, %f %f)'::box3d,4326)", ENV_MIN_X, ENV_MIN_Y, ENV_MAX_X, ENV_MAX_Y); private StringBuilder query = new StringBuilder(); private StringBuilder queryMZ = new StringBuilder(); private String queryPrefix = "select AsBinary(the_geom), AsBinary(the_geom_0_001), state,countyname, fips from mapdata.county where "; private String queryPrefixMZ = "select AsBinary(the_geom), AsBinary(the_geom_0_001), wfo,name,id from mapdata.marinezones where "; private Map<String, ArrayList<ArrayList<Object[]>>> fipsMultiResultMap = new HashMap<String, ArrayList<ArrayList<Object[]>>>(); private List<String> fipsList = new ArrayList<String>(); public WcnCountyQueryResult() { } /** * Build query using fips * */ public void buildQueryPart2(IRscDataObject dataObject) { WcnResource.WcnRscDataObj wData = (WcnResource.WcnRscDataObj) dataObject; if (wData == null || wData.countyFips == null) { return; } for (String fips : wData.countyFips) { if (!fipsList.contains(fips)) { fipsList.add(fips); if (wData.isCounty) { query.append(" ( fips ='"); query.append(fips); query.append("' ) OR "); } else { queryMZ.append(" ( id ='").append(fips).append("' ) OR "); } } } } /** * store query result into a map. */ public void populateMap() { List<Object[]> results = null; List<Object[]> resultsMZ = null; try { if (query.length() > 0) { String wholeQuery = queryPrefix + geoConstraint + " AND (" + query.substring(0, query.lastIndexOf("OR")) + " );"; // System.out.println("last index of OR is : " // + query.lastIndexOf("OR")); // String wholeQueryEnd = wholeQuery.substring(query // .lastIndexOf("OR") - 50); // System.out.println("len is " + wholeQuery.length() + " " // + wholeQueryEnd); results = DirectDbQuery.executeQuery(wholeQuery, "maps", QueryLanguage.SQL); } if (queryMZ.length() > 0) { String wholeQueryMZ = queryPrefixMZ + geoConstraint + " AND (" + queryMZ.substring(0, queryMZ.lastIndexOf("OR")) + " );"; resultsMZ = DirectDbQuery.executeQuery(wholeQueryMZ, "maps", QueryLanguage.SQL); } } catch (Exception e) { logger.log( Level.SEVERE, "_____ Exception in query string or result: " + e.getMessage()); return; } if (results != null) { for (Object[] o : results) { if (o == null || o.length != 5 || o[2] == null || o[3] == null || o[4] == null) { logger.log(Level.WARNING, "DirectDBQuery results had nulls or wrong size"); continue; } ArrayList<Object[]> obs = new ArrayList<Object[]>(); obs.add(new Object[] { o[0], o[1] }); String key = (String) o[4]; if (fipsMultiResultMap.containsKey(key)) { fipsMultiResultMap.get(key).add(obs); } else { ArrayList<ArrayList<Object[]>> list = new ArrayList<ArrayList<Object[]>>(); list.add(obs); fipsMultiResultMap.put(key, list); } } } if (resultsMZ != null) { for (Object[] o : resultsMZ) { if (o == null || o.length != 5 || o[2] == null || o[3] == null || o[4] == null) { logger.log(Level.WARNING, "DirectDBQuery results had nulls or wrong size"); continue; } ArrayList<Object[]> obs = new ArrayList<Object[]>(); obs.add(new Object[] { o[0], o[1] }); String key = (String) o[4]; if (fipsMultiResultMap.containsKey(key)) { fipsMultiResultMap.get(key).add(obs); } else { ArrayList<ArrayList<Object[]>> list = new ArrayList<ArrayList<Object[]>>(); list.add(obs); fipsMultiResultMap.put(key, list); } } } } /** * 2011-09-28: Loiza county in Puerto Rico with fips 72087 has NO record in * Raytheon's database: maps mapdata.county table and we need to handle * cases like that. * * TODO: move this handling to the query place? */ public ArrayList<ArrayList<Object[]>> getStateCountyResult2(String fips) { ArrayList<ArrayList<Object[]>> list = fipsMultiResultMap.get(fips); if (list == null) {// mute? clouds output when CAVE is on during ingest logger.log(Level.FINEST, "_______ No result for fips: " + fips); return new ArrayList<ArrayList<Object[]>>(); } return list; } }
50e189080642c6b101d522992b0d8deac6309259
e63e8299a6e3de3617890417f251612e8d21f4d8
/RecursionAndRecursiveAlgorithms/ReverseArray/src/TestClass.java
a0839bacafc510af6e9e540dad166ad098043ac1
[]
no_license
vassi95/Algorithms_Software_University
19f9e863c9002840ea0b39cdcc2a6355f08102cb
a96bc144daa907041850dc54abfbc9ea80c85c37
refs/heads/master
2021-01-01T05:09:55.228754
2016-05-10T11:46:08
2016-05-10T11:46:08
56,682,375
0
0
null
null
null
null
UTF-8
Java
false
false
286
java
import java.util.Date; public class TestClass { public static void main(String[] args) { Reverse r = new Reverse(); int[] array = {1, 2, 3, 4, 5, 6}; r.reverseArray(array, 0, array.length-1); for(int i=0; i<array.length; i++){ System.out.println(array[i]); } } }
8b36b1f9fb5014b0beeba19055fadeac3abd4b05
9c37a73aaea4b1abca41401acaab38780cf3ddbb
/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/00.08_AssetsManagementSystem/org/apache/jsp/view/apply/allapply_005flist_jsp.java
7dc1a75a8994d48111618ed60d164c3f0a7aca3e
[]
no_license
Siwash/personnal_excercise
83a09163352c96966f0a89aced9bc6146bffa918
f832dfc2aa554a4f6693994236e4d208e476c8e2
refs/heads/master
2020-03-23T04:35:25.793709
2018-07-16T06:49:52
2018-07-16T06:49:52
141,093,007
0
0
null
null
null
null
UTF-8
Java
false
false
71,459
java
/* * Generated by the Jasper component of Apache Tomcat * Version: Apache Tomcat/8.0.17 * Generated at: 2018-05-22 16:28:00 UTC * Note: The last modified time of this file was set to * the last modified time of the source file after * generation to assist with modification tracking. */ package org.apache.jsp.view.apply; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; public final class allapply_005flist_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent, org.apache.jasper.runtime.JspSourceImports { private static final javax.servlet.jsp.JspFactory _jspxFactory = javax.servlet.jsp.JspFactory.getDefaultFactory(); private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants; static { _jspx_dependants = new java.util.HashMap<java.lang.String,java.lang.Long>(3); _jspx_dependants.put("jar:file:/D:/SSM-GY/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/00.08_AssetsManagementSystem/WEB-INF/lib/jstl-1.2.jar!/META-INF/c.tld", Long.valueOf(1153356282000L)); _jspx_dependants.put("jar:file:/D:/SSM-GY/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/00.08_AssetsManagementSystem/WEB-INF/lib/jstl-1.2.jar!/META-INF/fmt.tld", Long.valueOf(1153356282000L)); _jspx_dependants.put("/WEB-INF/lib/jstl-1.2.jar", Long.valueOf(1522309388777L)); } private static final java.util.Set<java.lang.String> _jspx_imports_packages; private static final java.util.Set<java.lang.String> _jspx_imports_classes; static { _jspx_imports_packages = new java.util.HashSet<>(); _jspx_imports_packages.add("javax.servlet"); _jspx_imports_packages.add("javax.servlet.http"); _jspx_imports_packages.add("javax.servlet.jsp"); _jspx_imports_classes = new java.util.HashSet<>(); } private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems; private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems; private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fif_0026_005ftest; private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ffmt_005fformatDate_0026_005fvalue_005fpattern_005fnobody; private javax.el.ExpressionFactory _el_expressionfactory; private org.apache.tomcat.InstanceManager _jsp_instancemanager; public java.util.Map<java.lang.String,java.lang.Long> getDependants() { return _jspx_dependants; } public java.util.Set<java.lang.String> getPackageImports() { return _jspx_imports_packages; } public java.util.Set<java.lang.String> getClassImports() { return _jspx_imports_classes; } public void _jspInit() { _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig()); _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig()); _005fjspx_005ftagPool_005fc_005fif_0026_005ftest = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig()); _005fjspx_005ftagPool_005ffmt_005fformatDate_0026_005fvalue_005fpattern_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig()); _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig()); } public void _jspDestroy() { _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.release(); _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems.release(); _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.release(); _005fjspx_005ftagPool_005ffmt_005fformatDate_0026_005fvalue_005fpattern_005fnobody.release(); } public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException { final java.lang.String _jspx_method = request.getMethod(); if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method) && !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) { response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET POST or HEAD"); return; } final javax.servlet.jsp.PageContext pageContext; javax.servlet.http.HttpSession session = null; final javax.servlet.ServletContext application; final javax.servlet.ServletConfig config; javax.servlet.jsp.JspWriter out = null; final java.lang.Object page = this; javax.servlet.jsp.JspWriter _jspx_out = null; javax.servlet.jsp.PageContext _jspx_page_context = null; try { response.setContentType("text/html; charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write('\n'); out.write('\n'); out.write('\n'); String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; out.write("\n"); out.write("<!DOCTYPE html>\n"); out.write("<html>\n"); out.write("\n"); out.write("<head>\n"); out.write("<base href=\""); out.print(basePath); out.write("\">\n"); out.write("<meta charset=\"UTF-8\">\n"); out.write("<title>申请审批</title>\n"); out.write("<meta name=\"renderer\" content=\"webkit\">\n"); out.write("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n"); out.write("<meta name=\"viewport\"\n"); out.write("\tcontent=\"width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi\" />\n"); out.write("<link rel=\"shortcut icon\" href=\"/favicon.ico\" type=\"image/x-icon\" />\n"); out.write("<link rel=\"stylesheet\" href=\"css/font.css\">\n"); out.write("<link rel=\"stylesheet\" href=\"css/xadmin.css\">\n"); out.write("<link rel=\"stylesheet\" href=\"css/kkpager_orange.css\">\n"); out.write("<link rel=\"stylesheet\" href=\"lib/layui/css/layui.css\">\n"); out.write("<script type=\"text/javascript\"\n"); out.write("\tsrc=\"js/jquery.min.js\"></script>\n"); out.write("<script type=\"text/javascript\" src=\"lib/layui/layui.js\" charset=\"utf-8\"></script>\n"); out.write("<script type=\"text/javascript\" src=\"js/xadmin.js\"></script>\n"); out.write("<script type=\"text/javascript\" src=\"js/kkpager.min.js\"></script>\n"); out.write("<script src=\""); out.print(basePath); out.write("resources/My97DatePicker/WdatePicker.js\"></script>\n"); out.write("<!-- 让IE8/9支持媒体查询,从而兼容栅格 -->\n"); out.write("<!--[if lt IE 9]>\n"); out.write(" <script src=\"https://cdn.staticfile.org/html5shiv/r29/html5.min.js\"></script>\n"); out.write(" <script src=\"https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js\"></script>\n"); out.write(" <![endif]-->\n"); out.write("\n"); out.write("\n"); out.write("<script type=\"text/javascript\" src=\""); out.print(basePath); out.write("js/jquery.js\"></script>\n"); out.write("<script type=\"text/javascript\" src=\""); out.print(basePath); out.write("js/kkpager/jpager.js\"></script>\n"); out.write("<link rel=\"stylesheet\" type=\"text/css\"\n"); out.write("\thref=\""); out.print(basePath); out.write("js/kkpager/jpager.css\">\n"); out.write("<script type=\"text/javascript\" src=\""); out.print(basePath); out.write("view/apply/listPage.js\"></script>\n"); out.write("<script type=\"text/javascript\">\n"); out.write(" function load() {\n"); out.write(" \tarrayPage("); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${pageResult.pages}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write(','); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${pageResult.total}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write(");\n"); out.write(" }\n"); out.write("</script>\n"); out.write("</head>\n"); out.write("\n"); out.write("<body onload=\"load()\">\n"); out.write("\t<div class=\"x-nav\">\n"); out.write("\t\t<span class=\"layui-breadcrumb\"> <a>流程管理</a> <a> <cite>申请批准</cite></a>\n"); out.write("\t\t</span> <a class=\"layui-btn layui-btn-small\"\n"); out.write("\t\t\tstyle=\"line-height: 1.6em; margin-top: 3px; float: right\"\n"); out.write("\t\t\thref=\"applyController/showAllapply.do\" title=\"刷新\"> <i\n"); out.write("\t\t\tclass=\"layui-icon\" style=\"line-height: 30px\">ဂ</i></a>\n"); out.write("\t</div>\n"); out.write("\t<div class=\"x-body\">\n"); out.write("\t\t<div class=\"layui-row\">\n"); out.write("\t\t\t<form class=\"layui-form layui-col-md12 x-so\" method=\"post\"\n"); out.write("\t\t\t\taction=\"applyController/showAllapply.do\">\n"); out.write("\t\t\t\t\n"); out.write("\t\t\t\t\t<span>快速查询:</span>\n"); out.write("\t\t\t\t\t<div class=\"layui-input-inline\">\n"); out.write("\t\t\t\t\t\t<select name=\"propertyName\" id=\"quiz1\" lay-filter=\"myselect\">\n"); out.write("\t\t\t\t\t\t\t<option value=\"\" selected=\"selected\">请选择资产名字</option>\n"); out.write("\t\t\t\t\t\t\t"); if (_jspx_meth_c_005fforEach_005f0(_jspx_page_context)) return; out.write("\n"); out.write("\t\t\t\t\t\t</select>\n"); out.write("\t\t\t\t\t</div>\n"); out.write("\t\t\t\t\t<div class=\"layui-input-inline\">\n"); out.write("\t\t\t\t\t\t<select name=\"type\" id=\"quiz2\">\n"); out.write("\t\t\t\t\t\t\t<option value=\"\">请选择型号</option>\n"); out.write("\t\t\t\t\t\t\t<option value=\"杭州\">杭州</option>\n"); out.write("\t\t\t\t\t\t\t<option value=\"宁波\" disabled=\"\">宁波</option>\n"); out.write("\t\t\t\t\t\t\t<option value=\"温州\">温州</option>\n"); out.write("\t\t\t\t\t\t\t<option value=\"温州\">台州</option>\n"); out.write("\t\t\t\t\t\t\t<option value=\"温州\">绍兴</option>\n"); out.write("\t\t\t\t\t\t</select>\n"); out.write("\t\t\t\t\t</div>\n"); out.write("\t\t\t\t\t<div class=\"layui-input-inline\">\n"); out.write("\t\t\t\t\t\t<button type=\"submit\" class=\"layui-btn\" lay-submit=\"sreach()\"\n"); out.write("\t\t\t\t\t\t\tlay-filter=\"sreach\">\n"); out.write("\t\t\t\t\t\t\t<i class=\"layui-icon\">&#xe615;</i>\n"); out.write("\t\t\t\t\t\t</button>\n"); out.write("\t\t\t\t\t</div>\n"); out.write("\t\t\t\t\n"); out.write("\t\t\t</form>\n"); out.write("\t\t</div>\n"); out.write("\t<blockquote class=\"layui-elem-quote\">共有数据:"); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${applysNum }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write(" 条</blockquote>\n"); out.write("\t\t<table class=\"layui-table\">\n"); out.write("\t\t\t<thead>\n"); out.write("\t\t\t\t<tr>\n"); out.write("\t\t\t\t\t<th>资产名称</th>\n"); out.write("\t\t\t\t\t<th>型号</th>\n"); out.write("\t\t\t\t\t<th>数量</th>\n"); out.write("\t\t\t\t\t<th>申请人</th>\n"); out.write("\t\t\t\t\t<th>审核状态</th>\n"); out.write("\t\t\t\t\t<th>申请时间</th>\n"); out.write("\t\t\t\t\t<th>操作</th>\n"); out.write("\t\t\t\t</tr>\n"); out.write("\t\t\t</thead>\n"); out.write("\t\t\t<tbody>\n"); out.write("\t\t\t\t<!-- 数据示例 -->\n"); out.write("\t\t\t\t<tr>\n"); out.write("\t\t\t\t\t"); if (_jspx_meth_c_005fforEach_005f1(_jspx_page_context)) return; out.write("\n"); out.write("\t\t\t\t\t<!-- end 数据示例 -->\n"); out.write("\t\t\t</tbody>\n"); out.write("\t\t</table>\n"); out.write("\t\t<div align=\"center\" id=\"jpager\"></div>\n"); out.write("\t</div>\n"); out.write("\t<script>\n"); out.write("\t/* 根据名字查询型号 */\n"); out.write("\n"); out.write("\t\t/* $.ajax({\n"); out.write("\t\t\ttype : \"post\", // 提交方式\n"); out.write("\t\t\turl : \"applyController/returnPropertyName.ajax\", // 访问路径\n"); out.write("\t\t\tdataType : \"json\", // 返回值类型,只要不是String 一般都为json\n"); out.write("\t\t\tdata : {\n"); out.write("\t\t\t},\n"); out.write("\t\t\tsuccess : function(propertys) // 括号里为返回的数据\n"); out.write("\t\t\t{\t\n"); out.write("\t\t\t\tif (propertys !== null) {\n"); out.write("\t\t\t\t\tvar str = \"\";\n"); out.write("\t\t\t\t\t$(\"#quiz1\").html(\"\");\n"); out.write("\t\t\t\t\tstr += \"<option>请选择资产名字</option>\"\n"); out.write("\t\t\t\t\t$(\"#quiz1\").html(str);\n"); out.write("\n"); out.write("\t\t\t\t\tfor (var i = 0; i < propertys.length; i++) {\n"); out.write("\t\t\t\t\t\tvar property = propertys[i];\n"); out.write("\t\t\t\t\t\tif (i==1) {\n"); out.write("\t\t\t\t\t\t\t$(\"#quiz1\").append(\"<option selected='selected'> \" + property.propertyName + \"</option>\");\n"); out.write("\t\t\t\t\t\t}else {\n"); out.write("\t\t\t\t\t\t\t$(\"#quiz1\").append(\"<option> \" + property.propertyName + \"</option>\");\n"); out.write("\t\t\t\t\t\t}\n"); out.write("\t\t\t\t\t}\n"); out.write("\t\t\t\t} else {\n"); out.write("\t\t\t\t\talert(\"没有申请记录!!\");\n"); out.write("\t\t\t\t}\n"); out.write("\t\t\t},\n"); out.write("\t\t\terror : function(msg) {\n"); out.write("\t\t\t\talert(\"无法连接服务器\");\n"); out.write("\t\t\t}\n"); out.write("\t\t}); */\n"); out.write("\t\t\n"); out.write("\t\tlayui.use(['layer', 'form'], function(){\n"); out.write("\t\t\t var layer = layui.layer\n"); out.write("\t\t\t ,form = layui.form;\n"); out.write("\t\t\t form.on('select(myselect)', function(data){\n"); out.write("\t\t\t\t var propertyName=$(\"#quiz1\").val();\n"); out.write("\t\t\t $.ajax({\n"); out.write("\t type: 'POST',\n"); out.write("\t url: 'applyController/returnType.do',\n"); out.write("\t data: {\n"); out.write("\t \t \"propertyName\" : propertyName\n"); out.write("\t },\n"); out.write("\t dataType: 'json',\n"); out.write("\t success: function(allproperty){\n"); out.write("\t \t\tvar str = \"\";\n"); out.write("\t \t\t\t\t\t$(\"#quiz2\").empty();\n"); out.write("\t \t\t\t\t\tstr += \"<option>请选择型号</option>\"\n"); out.write("\t \t\t\t\t\t$(\"#quiz2\").html(str);\n"); out.write("\n"); out.write("\t \t\t\t\t\tfor (var i = 0; i < allproperty.length; i++) {\n"); out.write("\t \t\t\t\t\t\tvar property = allproperty[i];\n"); out.write("\t \t\t\t\t\t\t$(\"#quiz2\").append(\"<option >\" + property.type + \"</option>\");\n"); out.write("\t \t\t\t\t\t\tform.render('select');\n"); out.write("\t \t\t\t\t\t\t $(\"#quiz2\").get(0).selectedIndex=0;\n"); out.write("\t \t\t\t\t\t}\n"); out.write("\t },\n"); out.write("\t error : function(msg) {\n"); out.write("\t\t \t\t\t\talert(\"无法连接服务器\");\n"); out.write("\t\t \t\t\t} \n"); out.write("\t }); \n"); out.write("\t});\n"); out.write("\t\n"); out.write("\t\t});\n"); out.write("\n"); out.write("\t\t /* $(\"#quiz1\").change(function(){ \n"); out.write("\t \tvar propertyName=$(\"#quiz1\").val();\n"); out.write("\t \t\t\n"); out.write("\t \t\t$.ajax({\n"); out.write("\t \t\t\ttype : \"post\", // 提交方式\n"); out.write("\t \t\t\turl : \"applyController/returnType.do\", // 访问路径\n"); out.write("\t \t\t\tdataType : \"json\", // 返回值类型,只要不是String 一般都为json\n"); out.write("\t \t\t\tdata : {\n"); out.write("\t \t\t\t\t// 后台方法的参数\n"); out.write("\t \t\t\t\t\"propertyName\" : propertyName\n"); out.write("\n"); out.write("\t \t\t\t},\n"); out.write("\t \t\t\tsuccess : function(propertys) // 括号里为返回的数据\n"); out.write("\t \t\t\t{\n"); out.write("\t \t\t\t\talert(propertys);\n"); out.write("\t \t\t\t\tvar allproperty = $.extend(true, [], propertys);\n"); out.write("\t \t\t\t\tif (allproperty !== null) {\n"); out.write("\t \t\t\t\t\tvar str = \"\";\n"); out.write("\t \t\t\t\t\t$(\"#quiz2\").empty();\n"); out.write("\t \t\t\t\t\tstr += \"<option>请选择型号</option>\"\n"); out.write("\t \t\t\t\t\t$(\"#quiz2\").html(str);\n"); out.write("\n"); out.write("\t \t\t\t\t\tfor (var i = 0; i < allproperty.length; i++) {\n"); out.write("\t \t\t\t\t\t\tvar property = allproperty[i];\n"); out.write("\t \t\t\t\t\t\t$(\"#quiz2\").append(\"<option>\" + property.type + \"</option>\");\n"); out.write("\t \t\t\t\t\t}\n"); out.write("\t \t\t\t\t} else {\n"); out.write("\t \t\t\t\t\talert(\"没有该资产!!\");\n"); out.write("\t \t\t\t\t}\n"); out.write("\t \t\t\t},\n"); out.write("\t \t\t\terror : function(msg) {\n"); out.write("\t \t\t\t\talert(\"无法连接服务器\");\n"); out.write("\t \t\t\t}\n"); out.write("\t \t\t});\n"); out.write("\t \t\t\n"); out.write("\t\t }); */\n"); out.write("\t\n"); out.write("\n"); out.write("\t\n"); out.write("\t\n"); out.write("\t/* $(function(){ \n"); out.write(" //触发的下拉框chang事件 \n"); out.write(" \n"); out.write(" }); */\n"); out.write("\t\n"); out.write("\t/* \tfunction doNest() {\n"); out.write("\t\t\n"); out.write("\t} */\n"); out.write("\t\t/*用户-控制*/\n"); out.write("\t\tfunction member_stop(obj,applyId) {\n"); out.write("\t\t\tlayer.confirm('确认要批准该申请吗?', function(index) {\n"); out.write("\t\t\t\tif ($(obj).attr('title') == '启用') {\n"); out.write("\t\t\t\t\t//发异步把用户状态进行更改\n"); out.write("\t\t\t\t\t$(obj).attr('title', '未批准')\n"); out.write("\t\t\t\t\t$(obj).find('i').html('&#xe626;');\n"); out.write("\t\t\t\t\t$(obj).parents(\"tr\").find(\".td-status\").find('span')\n"); out.write("\t\t\t\t\t\t\t.addClass('layui-btn-disabled').html('未批准');\n"); out.write("\t\t\t\t\tlayer.msg('申请失败!', {\n"); out.write("\t\t\t\t\t\ticon : 1,\n"); out.write("\t\t\t\t\t\ttime : 500\n"); out.write("\t\t\t\t\t});\n"); out.write("\t\t\t\t\t\n"); out.write("\t\t\t\t\t$.ajax({\n"); out.write("\t\t\t\t\t\ttype:\"post\",\n"); out.write("\t\t\t\t\t\turl:\"applyController/updateStateDo.ajax\",\n"); out.write("\t\t\t\t\t\tdata:{\n"); out.write("\t\t\t\t\t\t\tapplyId:applyId\n"); out.write("\t\t\t\t\t\t},\n"); out.write("\t\t\t\t\t\tdatatype:\"text\",\n"); out.write("\t\t\t\t\t\tsuccess:function(result){\n"); out.write("\t\t\t\t\t\t\t\n"); out.write("\t\t\t\t\t\t},\n"); out.write("\t\t\t\t\t\terror:function(){\n"); out.write("\t\t\t\t\t\t\talert(\"无法连接服务器\");\n"); out.write("\t\t\t\t\t\t}\n"); out.write("\t\t\t\t\t});\n"); out.write("\t\t\t\t} else {\n"); out.write("\t\t\t\t\t$(obj).attr('title', '启用')\n"); out.write("\t\t\t\t\t\n"); out.write("\t\t\t\t\t\n"); out.write("\t\t\t\t\t$.ajax({\n"); out.write("\t\t\t\t\t\ttype:\"post\",\n"); out.write("\t\t\t\t\t\turl:\"applyController/updateState.ajax\",\n"); out.write("\t\t\t\t\t\tdata:{\n"); out.write("\t\t\t\t\t\t\tapplyId:applyId\n"); out.write("\t\t\t\t\t\t},\n"); out.write("\t\t\t\t\t\tdatatype:\"text\",\n"); out.write("\t\t\t\t\t\tsuccess:function(result){\n"); out.write("\t\t\t\t\t\t\tif(result==\"库存不足\"){\n"); out.write("\t\t\t\t\t\t\t\t$(obj).parents(\"tr\").find(\".td-status\").find('span')\n"); out.write("\t\t\t\t\t\t\t\t.addClass('layui-btn-disabled').html('未批准');\n"); out.write("\t\t\t\t\t\t\t\tlayer.msg('库存不够,启用失败!', {\n"); out.write("\t\t\t\t\t\t\t\t\ticon : 1,\n"); out.write("\t\t\t\t\t\t\t\t\ttime : 500\n"); out.write("\t\t\t\t\t\t\t\t});\n"); out.write("\t\t\t\t\t\t\t}else {\n"); out.write("\t\t\t\t\t\t\t\t$(obj).find('i').html('&#xe627;');\n"); out.write("\t\t\t\t\t\t\t\t$(obj).parents(\"tr\").find(\".td-status\").find('span')\n"); out.write("\t\t\t\t\t\t\t\t.removeClass('layui-btn-disabled').html('已启用');\n"); out.write("\t\t\t\t\t\t\t\tlayer.msg('申请成功!', {\n"); out.write("\t\t\t\t\t\t\t\t\ticon : 1,\n"); out.write("\t\t\t\t\t\t\t\t\ttime : 500\n"); out.write("\t\t\t\t\t\t\t\t});\n"); out.write("\t\t\t\t\t\t\t}\n"); out.write("\t\t\t\t\t\t},\n"); out.write("\t\t\t\t\t\terror:function(){\n"); out.write("\t\t\t\t\t\t\talert(\"无法连接服务器\");\n"); out.write("\t\t\t\t\t\t}\n"); out.write("\t\t\t\t\t});\n"); out.write("\t\t\t\t}\n"); out.write("\n"); out.write("\t\t\t});\n"); out.write("\t\t} \n"); out.write("\n"); out.write("\t\t/*用户-删除*/\n"); out.write("\t\tfunction member_del(obj, applyId) {\n"); out.write("\t\t\tlayer.confirm('确认要删除吗?', function(index) {\n"); out.write("\t\t\t\t//发异步删除数据\n"); out.write("\t\t\t\tlayer.msg('已删除!', {\n"); out.write("\t\t\t\t\ticon : 1,\n"); out.write("\t\t\t\t\ttime : 500\n"); out.write("\t\t\t\t});\n"); out.write("\t\t\t\twindow.location.href = \"applyController/deleteApply.do?applyId=\"+applyId+\"\";\n"); out.write("\t\t\t\t\n"); out.write("\t\t\t});\n"); out.write("\t\t}\n"); out.write("\n"); out.write("\t</script>\n"); out.write("</body>\n"); out.write("</html>"); } catch (java.lang.Throwable t) { if (!(t instanceof javax.servlet.jsp.SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { if (response.isCommitted()) { out.flush(); } else { out.clearBuffer(); } } catch (java.io.IOException e) {} if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else throw new ServletException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } private boolean _jspx_meth_c_005fforEach_005f0(javax.servlet.jsp.PageContext _jspx_page_context) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:forEach org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class); _jspx_th_c_005fforEach_005f0.setPageContext(_jspx_page_context); _jspx_th_c_005fforEach_005f0.setParent(null); // /view/apply/allapply_list.jsp(68,7) name = items type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null _jspx_th_c_005fforEach_005f0.setItems(new org.apache.jasper.el.JspValueExpression("/view/apply/allapply_list.jsp(68,7) '${propertyList}'",_el_expressionfactory.createValueExpression(_jspx_page_context.getELContext(),"${propertyList}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext())); // /view/apply/allapply_list.jsp(68,7) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fforEach_005f0.setVar("por"); int[] _jspx_push_body_count_c_005fforEach_005f0 = new int[] { 0 }; try { int _jspx_eval_c_005fforEach_005f0 = _jspx_th_c_005fforEach_005f0.doStartTag(); if (_jspx_eval_c_005fforEach_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\t\t\t<option value=\""); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.propertyName }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write('"'); out.write('>'); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.propertyName }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("</option>\n"); out.write("\t\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fforEach_005f0.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fforEach_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { return true; } } catch (java.lang.Throwable _jspx_exception) { while (_jspx_push_body_count_c_005fforEach_005f0[0]-- > 0) out = _jspx_page_context.popBody(); _jspx_th_c_005fforEach_005f0.doCatch(_jspx_exception); } finally { _jspx_th_c_005fforEach_005f0.doFinally(); _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f0); } return false; } private boolean _jspx_meth_c_005fforEach_005f1(javax.servlet.jsp.PageContext _jspx_page_context) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:forEach org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f1 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class); _jspx_th_c_005fforEach_005f1.setPageContext(_jspx_page_context); _jspx_th_c_005fforEach_005f1.setParent(null); // /view/apply/allapply_list.jsp(108,5) name = items type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null _jspx_th_c_005fforEach_005f1.setItems(new org.apache.jasper.el.JspValueExpression("/view/apply/allapply_list.jsp(108,5) '${pageResult.dataList}'",_el_expressionfactory.createValueExpression(_jspx_page_context.getELContext(),"${pageResult.dataList}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext())); // /view/apply/allapply_list.jsp(108,5) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fforEach_005f1.setVar("por"); // /view/apply/allapply_list.jsp(108,5) name = varStatus type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fforEach_005f1.setVarStatus("index"); int[] _jspx_push_body_count_c_005fforEach_005f1 = new int[] { 0 }; try { int _jspx_eval_c_005fforEach_005f1 = _jspx_th_c_005fforEach_005f1.doStartTag(); if (_jspx_eval_c_005fforEach_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\t<tr>\n"); out.write("\t\t\t\t\t\t\t<td>"); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.propertyName }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("</td>\n"); out.write("\t\t\t\t\t\t\t<td>"); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.type }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("</td>\n"); out.write("\t\t\t\t\t\t\t<td>"); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.propertyNum }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("</td>\n"); out.write("\t\t\t\t\t\t\t<td>"); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.userName }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("</td>\n"); out.write("\t\t\t\t\t\t\t<td class=\"td-status\"><span\n"); out.write("\t\t\t\t\t\t\t\t"); if (_jspx_meth_c_005fif_005f0(_jspx_th_c_005fforEach_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write("\n"); out.write("\t\t\t\t\t\t\t\t"); if (_jspx_meth_c_005fif_005f1(_jspx_th_c_005fforEach_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write("\n"); out.write("\t\t\t\t\t\t\t\t"); if (_jspx_meth_c_005fif_005f2(_jspx_th_c_005fforEach_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write(">\n"); out.write("\t\t\t\t\t\t\t\t\t"); if (_jspx_meth_c_005fif_005f3(_jspx_th_c_005fforEach_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write(' '); if (_jspx_meth_c_005fif_005f4(_jspx_th_c_005fforEach_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write(' '); if (_jspx_meth_c_005fif_005f5(_jspx_th_c_005fforEach_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write("\n"); out.write("\t\t\t\t\t\t\t</span></td>\n"); out.write("\t\t\t\t\t\t\t<td>"); if (_jspx_meth_fmt_005fformatDate_005f0(_jspx_th_c_005fforEach_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write("</td>\n"); out.write("\n"); out.write("\t\t\t\t\t\t\t<td class=\"td-manage\">"); if (_jspx_meth_c_005fif_005f6(_jspx_th_c_005fforEach_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write(' '); if (_jspx_meth_c_005fif_005f11(_jspx_th_c_005fforEach_005f1, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write(" <a title=\"删除\"\n"); out.write("\t\t\t\t\t\t\t\tclass=\"layui-btn layui-btn-mini layui-btn-danger\"\n"); out.write("\t\t\t\t\t\t\t\tonclick=\"member_del(this,'"); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyId}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("')\" href=\"javascript:;\">\n"); out.write("\t\t\t\t\t\t\t\t\t<i class=\"layui-icon\">&#xe640;</i>删除\n"); out.write("\t\t\t\t\t\t\t</a></td>\n"); out.write("\n"); out.write("\t\t\t\t\t\t</tr>\n"); out.write("\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fforEach_005f1.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fforEach_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { return true; } } catch (java.lang.Throwable _jspx_exception) { while (_jspx_push_body_count_c_005fforEach_005f1[0]-- > 0) out = _jspx_page_context.popBody(); _jspx_th_c_005fforEach_005f1.doCatch(_jspx_exception); } finally { _jspx_th_c_005fforEach_005f1.doFinally(); _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f1); } return false; } private boolean _jspx_meth_c_005fif_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f0 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f0.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f1); // /view/apply/allapply_list.jsp(116,8) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f0.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyState == '同意'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f0 = _jspx_th_c_005fif_005f0.doStartTag(); if (_jspx_eval_c_005fif_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\tclass=\"layui-btn layui-btn-normal layui-btn-mini\"\n"); out.write("\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f0.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0); return false; } private boolean _jspx_meth_c_005fif_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f1 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f1.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f1); // /view/apply/allapply_list.jsp(119,8) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f1.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyState == '审核中'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f1 = _jspx_th_c_005fif_005f1.doStartTag(); if (_jspx_eval_c_005fif_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\tclass=\"layui-btn layui-btn-normal layui-btn-mini layui-btn-disabled\"\n"); out.write("\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f1.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f1); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f1); return false; } private boolean _jspx_meth_c_005fif_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f2 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f2.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f1); // /view/apply/allapply_list.jsp(122,8) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f2.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyState == '使用完'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f2 = _jspx_th_c_005fif_005f2.doStartTag(); if (_jspx_eval_c_005fif_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\tclass=\"layui-btn layui-btn-normal layui-btn-mini layui-btn-disabled\"\n"); out.write("\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f2.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f2); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f2); return false; } private boolean _jspx_meth_c_005fif_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f3 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f3.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f1); // /view/apply/allapply_list.jsp(125,9) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f3.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyState == '同意'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f3 = _jspx_th_c_005fif_005f3.doStartTag(); if (_jspx_eval_c_005fif_005f3 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\t已启用\n"); out.write("\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f3.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f3); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f3); return false; } private boolean _jspx_meth_c_005fif_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f4 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f4.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f1); // /view/apply/allapply_list.jsp(127,14) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f4.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyState == '审核中'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f4 = _jspx_th_c_005fif_005f4.doStartTag(); if (_jspx_eval_c_005fif_005f4 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\t未批准\n"); out.write("\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f4.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f4); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f4); return false; } private boolean _jspx_meth_c_005fif_005f5(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f5 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f5.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f1); // /view/apply/allapply_list.jsp(129,14) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f5.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyState == '使用完'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f5 = _jspx_th_c_005fif_005f5.doStartTag(); if (_jspx_eval_c_005fif_005f5 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\t使用完\n"); out.write("\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f5.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f5); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f5); return false; } private boolean _jspx_meth_fmt_005fformatDate_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // fmt:formatDate org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag _jspx_th_fmt_005fformatDate_005f0 = (org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag) _005fjspx_005ftagPool_005ffmt_005fformatDate_0026_005fvalue_005fpattern_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag.class); _jspx_th_fmt_005fformatDate_005f0.setPageContext(_jspx_page_context); _jspx_th_fmt_005fformatDate_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f1); // /view/apply/allapply_list.jsp(133,11) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_fmt_005fformatDate_005f0.setValue((java.util.Date) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyTime }", java.util.Date.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); // /view/apply/allapply_list.jsp(133,11) name = pattern type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_fmt_005fformatDate_005f0.setPattern("yyyy-MM-dd "); int _jspx_eval_fmt_005fformatDate_005f0 = _jspx_th_fmt_005fformatDate_005f0.doStartTag(); if (_jspx_th_fmt_005fformatDate_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005ffmt_005fformatDate_0026_005fvalue_005fpattern_005fnobody.reuse(_jspx_th_fmt_005fformatDate_005f0); return true; } _005fjspx_005ftagPool_005ffmt_005fformatDate_0026_005fvalue_005fpattern_005fnobody.reuse(_jspx_th_fmt_005fformatDate_005f0); return false; } private boolean _jspx_meth_c_005fif_005f6(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f6 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f6.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f6.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f1); // /view/apply/allapply_list.jsp(136,29) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f6.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyState == '同意'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f6 = _jspx_th_c_005fif_005f6.doStartTag(); if (_jspx_eval_c_005fif_005f6 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\t\t\t\t<a class=\"layui-btn layui-btn-mini\"\n"); out.write("\t\t\t\t\t\t\t\t\t\tonclick=\"member_stop(this,'"); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyId}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("'\n"); out.write("\t\t\t\t\t\t\t\t )\"\n"); out.write("\t\t\t\t\t\t\t\t\t\thref=\"javascript:;\"\n"); out.write("\t\t\t\t\t\t\t\t\t\t"); if (_jspx_meth_c_005fif_005f7(_jspx_th_c_005fif_005f6, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write("\n"); out.write("\t\t\t\t\t\t\t\t\t\t"); if (_jspx_meth_c_005fif_005f8(_jspx_th_c_005fif_005f6, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write(">\n"); out.write("\t\t\t\t\t\t\t\t\t\t"); if (_jspx_meth_c_005fif_005f9(_jspx_th_c_005fif_005f6, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write(' '); if (_jspx_meth_c_005fif_005f10(_jspx_th_c_005fif_005f6, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write("\n"); out.write("\t\t\t\t\t\t\t\t\t</a>\n"); out.write("\n"); out.write("\t\t\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f6.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f6); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f6); return false; } private boolean _jspx_meth_c_005fif_005f7(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fif_005f6, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f7 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f7.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f7.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fif_005f6); // /view/apply/allapply_list.jsp(141,10) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f7.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyState == '同意'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f7 = _jspx_th_c_005fif_005f7.doStartTag(); if (_jspx_eval_c_005fif_005f7 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\ttitle=\"启用\"\n"); out.write("\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f7.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f7.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f7); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f7); return false; } private boolean _jspx_meth_c_005fif_005f8(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fif_005f6, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f8 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f8.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f8.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fif_005f6); // /view/apply/allapply_list.jsp(144,10) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f8.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyState == '审核中'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f8 = _jspx_th_c_005fif_005f8.doStartTag(); if (_jspx_eval_c_005fif_005f8 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\t title=\"未批准\"\n"); out.write("\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f8.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f8.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f8); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f8); return false; } private boolean _jspx_meth_c_005fif_005f9(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fif_005f6, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f9 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f9.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f9.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fif_005f6); // /view/apply/allapply_list.jsp(147,10) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f9.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyState == '同意'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f9 = _jspx_th_c_005fif_005f9.doStartTag(); if (_jspx_eval_c_005fif_005f9 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\t\t\t\t\t\t<i class=\"layui-icon\">&#xe627;</i>停用\n"); out.write("\t\t\t\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f9.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f9.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f9); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f9); return false; } private boolean _jspx_meth_c_005fif_005f10(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fif_005f6, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f10 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f10.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f10.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fif_005f6); // /view/apply/allapply_list.jsp(149,17) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f10.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyState == '审核中'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f10 = _jspx_th_c_005fif_005f10.doStartTag(); if (_jspx_eval_c_005fif_005f10 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\t\t\t\t\t\t<i class=\"layui-icon\">&#xe626;</i>启动\n"); out.write("\t\t\t\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f10.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f10.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f10); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f10); return false; } private boolean _jspx_meth_c_005fif_005f11(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f1, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f11 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f11.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f11.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f1); // /view/apply/allapply_list.jsp(154,16) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f11.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyState == '审核中'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f11 = _jspx_th_c_005fif_005f11.doStartTag(); if (_jspx_eval_c_005fif_005f11 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\t\t\t\t<a class=\"layui-btn layui-btn-mini\"\n"); out.write("\t\t\t\t\t\t\t\t\t\tonclick=\"member_stop(this,'"); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyId}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("'\n"); out.write("\t\t\t\t\t\t\t\t )\"\n"); out.write("\t\t\t\t\t\t\t\t\t\thref=\"javascript:;\"\n"); out.write("\t\t\t\t\t\t\t\t\t\t"); if (_jspx_meth_c_005fif_005f12(_jspx_th_c_005fif_005f11, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write("\n"); out.write("\t\t\t\t\t\t\t\t\t\t"); if (_jspx_meth_c_005fif_005f13(_jspx_th_c_005fif_005f11, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write(">\n"); out.write("\t\t\t\t\t\t\t\t\t\t"); if (_jspx_meth_c_005fif_005f14(_jspx_th_c_005fif_005f11, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write(' '); if (_jspx_meth_c_005fif_005f15(_jspx_th_c_005fif_005f11, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f1)) return true; out.write("\n"); out.write("\t\t\t\t\t\t\t\t\t</a>\n"); out.write("\t\t\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f11.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f11.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f11); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f11); return false; } private boolean _jspx_meth_c_005fif_005f12(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fif_005f11, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f12 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f12.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f12.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fif_005f11); // /view/apply/allapply_list.jsp(159,10) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f12.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyState == '同意'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f12 = _jspx_th_c_005fif_005f12.doStartTag(); if (_jspx_eval_c_005fif_005f12 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\ttitle=\"启用\"\n"); out.write("\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f12.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f12.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f12); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f12); return false; } private boolean _jspx_meth_c_005fif_005f13(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fif_005f11, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f13 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f13.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f13.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fif_005f11); // /view/apply/allapply_list.jsp(162,10) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f13.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyState == '审核中'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f13 = _jspx_th_c_005fif_005f13.doStartTag(); if (_jspx_eval_c_005fif_005f13 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\t title=\"未批准\"\n"); out.write("\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f13.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f13.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f13); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f13); return false; } private boolean _jspx_meth_c_005fif_005f14(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fif_005f11, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f14 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f14.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f14.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fif_005f11); // /view/apply/allapply_list.jsp(165,10) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f14.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyState == '同意'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f14 = _jspx_th_c_005fif_005f14.doStartTag(); if (_jspx_eval_c_005fif_005f14 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\t\t\t\t\t\t<i class=\"layui-icon\">&#xe627;</i>停用\n"); out.write("\t\t\t\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f14.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f14.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f14); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f14); return false; } private boolean _jspx_meth_c_005fif_005f15(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fif_005f11, javax.servlet.jsp.PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f1) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f15 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f15.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f15.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fif_005f11); // /view/apply/allapply_list.jsp(167,17) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f15.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${por.applyState == '审核中'}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)).booleanValue()); int _jspx_eval_c_005fif_005f15 = _jspx_th_c_005fif_005f15.doStartTag(); if (_jspx_eval_c_005fif_005f15 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t\t\t\t\t\t\t<i class=\"layui-icon\">&#xe626;</i>启动\n"); out.write("\t\t\t\t\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f15.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f15.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f15); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f15); return false; } }
19b397269ca1b5f588c8cdf7271d0b100e3ee4c3
40d0ceb9061ec560a4cd635df6558b321f2430de
/src/hack/facebook/AddTwoNumbersII.java
0b7d1c4499e2aaf4073f73bb2d61f34b52689def
[]
no_license
yshanstar/FuckLeetCode
4c9522d9bea6867d738a3fe495d5d0ec6c7a322a
0f3bca5be0bf47be9626daeb72668315b96fd4bb
refs/heads/master
2020-05-21T17:53:43.142348
2018-11-07T07:51:47
2018-11-07T07:51:47
61,181,613
0
0
null
null
null
null
UTF-8
Java
false
false
1,874
java
package hack.facebook; import hack.util.ListNode; import java.util.Stack; /* You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself. Follow up: What if you cannot modify the input lists? In other words, reversing the lists is not allowed. Example: Input: (7 -> 2 -> 4 -> 3) + (5 -> 6 -> 4) Output: 7 -> 8 -> 0 -> 7 */ public class AddTwoNumbersII { public ListNode addTwoNumbers(ListNode l1, ListNode l2) { Stack<Integer> s1 = new Stack<>(); Stack<Integer> s2 = new Stack<>(); while (l1 != null) { s1.push(l1.val); l1 = l1.next; } while (l2 != null) { s2.push(l2.val); l2 = l2.next; } int sum = 0; ListNode node = new ListNode(0); while (!s1.isEmpty() || !s2.isEmpty()) { if (!s1.isEmpty()) { sum += s1.pop(); } if (!s2.isEmpty()) { sum += s2.pop(); } node.val = sum % 10; ListNode head = new ListNode(sum / 10); head.next = node; node = head; sum /= 10; } return node.val == 0 ? node.next : node; } public static void main(String[] args) { AddTwoNumbersII test = new AddTwoNumbersII(); ListNode l1 = new ListNode(7); l1.next = new ListNode(2); l1.next.next = new ListNode(4); l1.next.next.next = new ListNode(3); ListNode l2 = new ListNode(5); l2.next = new ListNode(6); l2.next.next = new ListNode(4); test.addTwoNumbers(l1, l2); } }
06878c590c91224e5fd10fec2356bcc146991f43
1d80ca256941d9f6f86d7e135e4015fd69837c76
/src/com/company/Game.java
c4a21e61798b328965f112e42d1d16182addb4ee
[]
no_license
Phill360/LearningOutcomeTwo
ec0c25fb86a91c779fa6c4447c21896d41b9aa8a
09da42a4c1221e42edd12fe606e9a1664fb8bb5f
refs/heads/master
2021-01-01T17:52:40.825758
2017-07-25T02:50:22
2017-07-25T02:50:22
98,183,302
0
0
null
null
null
null
UTF-8
Java
false
false
1,573
java
package com.company; public class Game { public enum genreTypes { ACTION , FPS, MMO, RPG; } public enum ratings { G, PG, M, MA, R; } public enum platforms { XBOX, PC, PS4; } private String title; private platforms platform; private genreTypes genre; private ratings rating; public Game (String title, platforms platform, genreTypes genre, ratings rating){ this.title = title; this.platform = platform; this.genre = genre; this.rating = rating; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public platforms getPlatform() { return platform; } public void setPlatform(platforms platform) { this.platform = platform; } public genreTypes getGenre() { return genre; } public String getGenreText() { return genre.toString().toLowerCase(); } public void setGenre(genreTypes genre) { this.genre = genre; } public ratings getRating() { return rating; } public String getRatingText() { return rating.toString().toUpperCase(); } public void setRating(ratings rating) { this.rating = rating; } public void print() { System.out.print(this.getTitle() + " is an " + this.getGenreText() + " game and has a rating of " + this.getRatingText() + " the game's platform is " + this.getPlatform() ); } }
c3af36b57e5b4afd42cc650937c9c95fa517dfdc
5298e05607e65f0a2978091cc4e2c77cac60d76d
/programming/dynamic-programming/interleaving-strings.java
b848b0037bcdafa28c729d24e50540367778ee51
[ "MIT" ]
permissive
saint1729/interviewbit
06d634584e24262f17e44b04b5044d4b77716d88
65bcafffcbe4dfb67ba5c1a711797c47c7e79f31
refs/heads/master
2020-03-27T11:49:54.165425
2018-11-06T18:07:55
2018-11-06T18:07:55
146,509,876
0
0
null
null
null
null
UTF-8
Java
false
false
1,531
java
/* https://www.interviewbit.com/problems/interleaving-strings/ Interleaving Strings Asked in: Google Yahoo Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. Example, Given: s1 = "aabcc", s2 = "dbbca", When s3 = "aadbbcbcac", return true. When s3 = "aadbbbaccc", return false. Return 0 / 1 ( 0 for false, 1 for true ) for this problem */ public class Solution { public int isInterleave(String A, String B, String C) { int M = A.length(), N = B.length(), X = C.length(); if(M+N != X) { return 0; } char[] a = A.toCharArray(); char[] b = B.toCharArray(); char[] c = C.toCharArray(); boolean[][] dp = new boolean[M+1][N+1]; dp[0][0] = true; for(int i = 1; i <= M; i++) { if(a[i-1] == c[i-1]) { dp[i][0] = dp[i-1][0]; } } for(int i = 1; i <= N; i++) { if(b[i-1] == c[i-1]) { dp[0][i] = dp[0][i-1]; } } for(int i = 1; i <= M; i++) { for(int j = 1; j <= N; j++) { boolean or = false; if(c[i+j-1] == a[i-1]) { or = or || dp[i-1][j]; } if(c[i+j-1] == b[j-1]) { or = or || dp[i][j-1]; } dp[i][j] = or; } } return dp[M][N] ? 1 : 0; } }
7dfe3d16181d35f64891cc5971a25887129bb141
1b29e7041e3e0f82657d862c9793d8bd0b5f741b
/modules/sample-thing/sample-thing-service/src/main/java/sample/thing/model/impl/SampleThingBaseImpl.java
abe2ccf86ce04c48d1adee5f469ac3cb8207128c
[]
no_license
SGM3/sample-stuff
6e2909e5a1d651bdd97b21cd629b52dd097fb786
0d8394a5c807829472d14f6e13e669133d538e37
refs/heads/master
2020-03-13T22:48:28.170186
2018-04-27T16:55:17
2018-04-27T18:58:40
131,322,483
0
0
null
null
null
null
UTF-8
Java
false
false
1,776
java
/** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * * This library 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 2.1 of the License, or (at your option) * any later version. * * This library 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. */ package sample.thing.model.impl; import aQute.bnd.annotation.ProviderType; import sample.thing.model.SampleThing; import sample.thing.service.SampleThingLocalServiceUtil; /** * The extended model base implementation for the SampleThing service. Represents a row in the &quot;Sample_SampleThing&quot; database table, with each column mapped to a property of this class. * * <p> * This class exists only as a container for the default extended model level methods generated by ServiceBuilder. Helper methods and all application logic should be put in {@link SampleThingImpl}. * </p> * * @author Brian Wing Shun Chan * @see SampleThingImpl * @see SampleThing * @generated */ @ProviderType public abstract class SampleThingBaseImpl extends SampleThingModelImpl implements SampleThing { /* * NOTE FOR DEVELOPERS: * * Never modify or reference this class directly. All methods that expect a sample thing model instance should use the {@link SampleThing} interface instead. */ @Override public void persist() { if (this.isNew()) { SampleThingLocalServiceUtil.addSampleThing(this); } else { SampleThingLocalServiceUtil.updateSampleThing(this); } } }
f0b5d3239599949ed29a4dd6d415ddc4398cd56e
5880827edcc134a7c2b229156b14e58802fc5848
/product-data-service/src/main/java/cn/how2j/springcloud/pojo/IdModel.java
bd692c1a81d2f6f3250e4518f6aaff52bd14a1b8
[]
no_license
ZongZihao/springcloudPrictice
5a5f1550728e8d38d4b89d3fdc6e43f0d7a78972
8dd5cf041988f2c03eb8ad9dc73b60b475555429
refs/heads/master
2020-05-17T08:11:11.782248
2019-04-26T09:56:57
2019-04-26T09:56:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
240
java
package cn.how2j.springcloud.pojo; /** * Created by 宗子豪 on 2019-04-26 */ public class IdModel { private int id; public int getId() { return id; } public void setId(int id) { this.id = id; } }
e74ff8d577c1b1177ce767b18f791a8a5f8d5051
d8d5fbaa33cd95ffa287af733e4353901b7d8dba
/box2d/src/com/upseil/gdx/box2d/builder/ChainedShapelyFixtureBuilder.java
2438ac71f269035421e9e376798adbd3dd51e64f
[ "MIT" ]
permissive
Upseil/UpseilGDX
dcf2982f31b81a21d5c2fe3545b257bfc9294643
7a2ac3685365d2cc3a979fabc6238559acb4e3b2
refs/heads/master
2021-04-27T17:47:09.008260
2019-03-10T14:38:39
2019-03-10T14:38:39
122,328,007
1
0
null
null
null
null
UTF-8
Java
false
false
2,515
java
package com.upseil.gdx.box2d.builder; import com.badlogic.gdx.physics.box2d.Filter; import com.badlogic.gdx.physics.box2d.FixtureDef; import com.upseil.gdx.box2d.builder.base.ChainedFixtureBuilderBase; import com.upseil.gdx.box2d.builder.shape.ShapeBuilder; public class ChainedShapelyFixtureBuilder extends ShapelyFixtureBuilder implements ChainedFixtureBuilderBase<FixtureDef, BodyBuilder> { private final BodyBuilder parent; public ChainedShapelyFixtureBuilder(FixtureDef fixtureDefinition, ShapeBuilder<?> shape, BodyBuilder parent) { super(fixtureDefinition, shape); this.parent = parent; } @Override public BodyBuilder endFixture() { return parent.endFixture(this); } //- Overriding members for concrete return type ----------------------------------------- @Override public ChainedShapelyFixtureBuilder withFriction(float friction) { super.withFriction(friction); return this; } @Override public ChainedShapelyFixtureBuilder withRestitution(float restitution) { super.withRestitution(restitution); return this; } @Override public ChainedShapelyFixtureBuilder withDensity(float density) { super.withDensity(density); return this; } @Override public ChainedShapelyFixtureBuilder asSensor(boolean isSensor) { super.asSensor(isSensor); return this; } @Override public ChainedShapelyFixtureBuilder asSensor() { super.asSensor(); return this; } @Override public ChainedShapelyFixtureBuilder notAsSensor() { super.notAsSensor(); return this; } @Override public ChainedShapelyFixtureBuilder withCategoryBits(short categoryBits) { super.withCategoryBits(categoryBits); return this; } @Override public ChainedShapelyFixtureBuilder withMaskBits(short maskBits) { super.withMaskBits(maskBits); return this; } @Override public ChainedShapelyFixtureBuilder withGroupIndex(short groupIndex) { super.withGroupIndex(groupIndex); return this; } @Override public ChainedShapelyFixtureBuilder withFilter(Filter filter) { super.withFilter(filter); return this; } @Override public ChainedShapelyFixtureBuilder withFilter(short categoryBits, short maskBits, short groupIndex) { super.withFilter(categoryBits, maskBits, groupIndex); return this; } }
2acd3faffa1d6c305f104a4aaa633ecf4beff25f
764ffb02e460c886796a453941ee47e51b75ad07
/code/GDES/GDES-MODEL/src/main/java/com/gdes/GDES/model/TeacherExample.java
629a35e324e257795589f075512494eb36d6546c
[ "MIT" ]
permissive
o174110/GraduationDesign_EvaluationSystem
4059b84e834d9e442a9ca18956a992ebe396fb2e
6ed0d423a3d2a5b08a44a6a15a66a56fb35998ee
refs/heads/master
2021-01-01T03:06:26.195294
2018-06-13T06:18:20
2018-06-13T06:18:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
16,950
java
package com.gdes.GDES.model; import java.util.ArrayList; import java.util.List; public class TeacherExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public TeacherExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdTIsNull() { addCriterion("id_t is null"); return (Criteria) this; } public Criteria andIdTIsNotNull() { addCriterion("id_t is not null"); return (Criteria) this; } public Criteria andIdTEqualTo(String value) { addCriterion("id_t =", value, "idT"); return (Criteria) this; } public Criteria andIdTNotEqualTo(String value) { addCriterion("id_t <>", value, "idT"); return (Criteria) this; } public Criteria andIdTGreaterThan(String value) { addCriterion("id_t >", value, "idT"); return (Criteria) this; } public Criteria andIdTGreaterThanOrEqualTo(String value) { addCriterion("id_t >=", value, "idT"); return (Criteria) this; } public Criteria andIdTLessThan(String value) { addCriterion("id_t <", value, "idT"); return (Criteria) this; } public Criteria andIdTLessThanOrEqualTo(String value) { addCriterion("id_t <=", value, "idT"); return (Criteria) this; } public Criteria andIdTLike(String value) { addCriterion("id_t like", value, "idT"); return (Criteria) this; } public Criteria andIdTNotLike(String value) { addCriterion("id_t not like", value, "idT"); return (Criteria) this; } public Criteria andIdTIn(List<String> values) { addCriterion("id_t in", values, "idT"); return (Criteria) this; } public Criteria andIdTNotIn(List<String> values) { addCriterion("id_t not in", values, "idT"); return (Criteria) this; } public Criteria andIdTBetween(String value1, String value2) { addCriterion("id_t between", value1, value2, "idT"); return (Criteria) this; } public Criteria andIdTNotBetween(String value1, String value2) { addCriterion("id_t not between", value1, value2, "idT"); return (Criteria) this; } public Criteria andNameTIsNull() { addCriterion("name_t is null"); return (Criteria) this; } public Criteria andNameTIsNotNull() { addCriterion("name_t is not null"); return (Criteria) this; } public Criteria andNameTEqualTo(String value) { addCriterion("name_t =", value, "nameT"); return (Criteria) this; } public Criteria andNameTNotEqualTo(String value) { addCriterion("name_t <>", value, "nameT"); return (Criteria) this; } public Criteria andNameTGreaterThan(String value) { addCriterion("name_t >", value, "nameT"); return (Criteria) this; } public Criteria andNameTGreaterThanOrEqualTo(String value) { addCriterion("name_t >=", value, "nameT"); return (Criteria) this; } public Criteria andNameTLessThan(String value) { addCriterion("name_t <", value, "nameT"); return (Criteria) this; } public Criteria andNameTLessThanOrEqualTo(String value) { addCriterion("name_t <=", value, "nameT"); return (Criteria) this; } public Criteria andNameTLike(String value) { addCriterion("name_t like", value, "nameT"); return (Criteria) this; } public Criteria andNameTNotLike(String value) { addCriterion("name_t not like", value, "nameT"); return (Criteria) this; } public Criteria andNameTIn(List<String> values) { addCriterion("name_t in", values, "nameT"); return (Criteria) this; } public Criteria andNameTNotIn(List<String> values) { addCriterion("name_t not in", values, "nameT"); return (Criteria) this; } public Criteria andNameTBetween(String value1, String value2) { addCriterion("name_t between", value1, value2, "nameT"); return (Criteria) this; } public Criteria andNameTNotBetween(String value1, String value2) { addCriterion("name_t not between", value1, value2, "nameT"); return (Criteria) this; } public Criteria andIdMIsNull() { addCriterion("id_m is null"); return (Criteria) this; } public Criteria andIdMIsNotNull() { addCriterion("id_m is not null"); return (Criteria) this; } public Criteria andIdMEqualTo(String value) { addCriterion("id_m =", value, "idM"); return (Criteria) this; } public Criteria andIdMNotEqualTo(String value) { addCriterion("id_m <>", value, "idM"); return (Criteria) this; } public Criteria andIdMGreaterThan(String value) { addCriterion("id_m >", value, "idM"); return (Criteria) this; } public Criteria andIdMGreaterThanOrEqualTo(String value) { addCriterion("id_m >=", value, "idM"); return (Criteria) this; } public Criteria andIdMLessThan(String value) { addCriterion("id_m <", value, "idM"); return (Criteria) this; } public Criteria andIdMLessThanOrEqualTo(String value) { addCriterion("id_m <=", value, "idM"); return (Criteria) this; } public Criteria andIdMLike(String value) { addCriterion("id_m like", value, "idM"); return (Criteria) this; } public Criteria andIdMNotLike(String value) { addCriterion("id_m not like", value, "idM"); return (Criteria) this; } public Criteria andIdMIn(List<String> values) { addCriterion("id_m in", values, "idM"); return (Criteria) this; } public Criteria andIdMNotIn(List<String> values) { addCriterion("id_m not in", values, "idM"); return (Criteria) this; } public Criteria andIdMBetween(String value1, String value2) { addCriterion("id_m between", value1, value2, "idM"); return (Criteria) this; } public Criteria andIdMNotBetween(String value1, String value2) { addCriterion("id_m not between", value1, value2, "idM"); return (Criteria) this; } public Criteria andMajorleaderTIsNull() { addCriterion("majorleader_t is null"); return (Criteria) this; } public Criteria andMajorleaderTIsNotNull() { addCriterion("majorleader_t is not null"); return (Criteria) this; } public Criteria andMajorleaderTEqualTo(String value) { addCriterion("majorleader_t =", value, "majorleaderT"); return (Criteria) this; } public Criteria andMajorleaderTNotEqualTo(String value) { addCriterion("majorleader_t <>", value, "majorleaderT"); return (Criteria) this; } public Criteria andMajorleaderTGreaterThan(String value) { addCriterion("majorleader_t >", value, "majorleaderT"); return (Criteria) this; } public Criteria andMajorleaderTGreaterThanOrEqualTo(String value) { addCriterion("majorleader_t >=", value, "majorleaderT"); return (Criteria) this; } public Criteria andMajorleaderTLessThan(String value) { addCriterion("majorleader_t <", value, "majorleaderT"); return (Criteria) this; } public Criteria andMajorleaderTLessThanOrEqualTo(String value) { addCriterion("majorleader_t <=", value, "majorleaderT"); return (Criteria) this; } public Criteria andMajorleaderTLike(String value) { addCriterion("majorleader_t like", value, "majorleaderT"); return (Criteria) this; } public Criteria andMajorleaderTNotLike(String value) { addCriterion("majorleader_t not like", value, "majorleaderT"); return (Criteria) this; } public Criteria andMajorleaderTIn(List<String> values) { addCriterion("majorleader_t in", values, "majorleaderT"); return (Criteria) this; } public Criteria andMajorleaderTNotIn(List<String> values) { addCriterion("majorleader_t not in", values, "majorleaderT"); return (Criteria) this; } public Criteria andMajorleaderTBetween(String value1, String value2) { addCriterion("majorleader_t between", value1, value2, "majorleaderT"); return (Criteria) this; } public Criteria andMajorleaderTNotBetween(String value1, String value2) { addCriterion("majorleader_t not between", value1, value2, "majorleaderT"); return (Criteria) this; } public Criteria andCourseleaderTIsNull() { addCriterion("courseleader_t is null"); return (Criteria) this; } public Criteria andCourseleaderTIsNotNull() { addCriterion("courseleader_t is not null"); return (Criteria) this; } public Criteria andCourseleaderTEqualTo(String value) { addCriterion("courseleader_t =", value, "courseleaderT"); return (Criteria) this; } public Criteria andCourseleaderTNotEqualTo(String value) { addCriterion("courseleader_t <>", value, "courseleaderT"); return (Criteria) this; } public Criteria andCourseleaderTGreaterThan(String value) { addCriterion("courseleader_t >", value, "courseleaderT"); return (Criteria) this; } public Criteria andCourseleaderTGreaterThanOrEqualTo(String value) { addCriterion("courseleader_t >=", value, "courseleaderT"); return (Criteria) this; } public Criteria andCourseleaderTLessThan(String value) { addCriterion("courseleader_t <", value, "courseleaderT"); return (Criteria) this; } public Criteria andCourseleaderTLessThanOrEqualTo(String value) { addCriterion("courseleader_t <=", value, "courseleaderT"); return (Criteria) this; } public Criteria andCourseleaderTLike(String value) { addCriterion("courseleader_t like", value, "courseleaderT"); return (Criteria) this; } public Criteria andCourseleaderTNotLike(String value) { addCriterion("courseleader_t not like", value, "courseleaderT"); return (Criteria) this; } public Criteria andCourseleaderTIn(List<String> values) { addCriterion("courseleader_t in", values, "courseleaderT"); return (Criteria) this; } public Criteria andCourseleaderTNotIn(List<String> values) { addCriterion("courseleader_t not in", values, "courseleaderT"); return (Criteria) this; } public Criteria andCourseleaderTBetween(String value1, String value2) { addCriterion("courseleader_t between", value1, value2, "courseleaderT"); return (Criteria) this; } public Criteria andCourseleaderTNotBetween(String value1, String value2) { addCriterion("courseleader_t not between", value1, value2, "courseleaderT"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
e1f2d70e2a40b4f92436544959d868b423dffb91
aa0d293d2667a191f4df981af6c75e2296ae88e9
/src/main/java/com/laptrinhjavaweb/entity/UserRole.java
cd82239bdf6a370954542689f1a33275bd95cffe
[]
no_license
tranntuanduong/estate-jsp-servlet
2692fe91080f39e28654efcbefa423769452b561
38f8aeba47da04a5bc77f3b4d85e56ed4732e082
refs/heads/master
2022-12-03T19:11:40.105283
2020-10-10T01:53:28
2020-10-10T01:53:28
190,985,195
0
0
null
2022-11-16T05:30:10
2019-06-09T09:03:46
Java
UTF-8
Java
false
false
514
java
package com.laptrinhjavaweb.entity; import com.laptrinhjavaweb.annotation.Entity; @Entity public class UserRole extends BaseEntity{ private Long id; private Long userId; private Long roleId; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public Long getRoleId() { return roleId; } public void setRoleId(Long roleId) { this.roleId = roleId; } }
[ "=" ]
=
73e7adce18422bf6c84f331ce63e56d3ce72e68d
7a6b50a533c855e3990e1871c8a4d06df601680f
/JiGoLo/src/com/go/board/intersection/StandardIntersection.java
7eb99f2a6e5e141417ccb09fca4072ce864ba614
[]
no_license
jbonneau/jigolo
2fecb2b33e41bca3647b6dccaf6be412fbc2f23d
c61b34f7e708149350d77189652854782e067683
refs/heads/master
2021-01-19T16:25:50.454058
2009-11-11T16:19:07
2009-11-11T16:19:07
32,188,944
0
0
null
null
null
null
UTF-8
Java
false
false
1,572
java
/** * Créée le 25 sept. 2008 */ package com.go.board.intersection; import java.util.ArrayList; import java.util.List; import com.go.rules.color.Color; /** * @author LhaaG * */ public class StandardIntersection implements GenericIntersection { private Color color; private int horizontalCoord; private int verticalCoord; private List<Color> liberties; /** * @param number * @param color */ public StandardIntersection(Color color, int hCoord, int vCoord) { this.color = color; this.horizontalCoord = hCoord; this.verticalCoord = vCoord; this.liberties = new ArrayList<Color>(); for (int i=0; i<STANDARD_NUMBER_LIBERTIES; i++) { if (i==0 && this.horizontalCoord == STANDARD_EDGE_VCOORD_BEGIN) { this.liberties.add(Color.getEDGE()); } if (i==1 && this.horizontalCoord == STANDARD_EDGE_VCOORD_BEGIN) { this.liberties.add(Color.getEDGE()); } if (i==2 && this.horizontalCoord == STANDARD_EDGE_VCOORD_BEGIN) { this.liberties.add(Color.getEDGE()); } else if (i==4 && this.horizontalCoord == STANDARD_EDGE_HCOORD_BEGIN) { this.liberties.add(Color.getEDGE()); } else this.liberties.add(Color.getEMPTY()); } } public boolean isEmpty() { return this.color.isEmpty(); } public boolean isBlack() { return this.color.isBlack(); } public boolean isWhite() { return this.color.isWhite(); } /** * @param color the color to set */ public void setColor(Color color) { this.color = color; } }// class StandardIntersection
[ "lhaagounet@fbdba616-8651-11dd-90a9-6306d3ffb32f" ]
lhaagounet@fbdba616-8651-11dd-90a9-6306d3ffb32f
1b38bd71736b451c3ca8ba475fd3f93576c4af4e
82adffa46f4d9b3bef068724e7a3fb5cc7299f47
/genesis_src/connections/views/ColorTrackerPackage.java
5a0d5640da6658dd500a6615c03bd8468a0e7c9f
[]
no_license
giripal/genesis
3fbe9577613a77b485212cfc8bc8ce87ad13b652
25e23a5fc1d9463cf54791a551ce0176daea2a99
refs/heads/master
2020-04-27T10:48:52.570891
2014-09-29T03:15:53
2014-09-29T03:15:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,649
java
/* 1: */ package connections.views; /* 2: */ /* 3: */ import java.awt.Color; /* 4: */ /* 5: */ public class ColorTrackerPackage /* 6: */ { /* 7:12 */ private long showTime = 2000L; /* 8: */ private Color permanentColor; /* 9: */ private Color temporaryColor; /* 10: */ private long quitTime; /* 11: */ private ColoredBox coloredBox; /* 12: */ /* 13: */ public long getQuitTime() /* 14: */ { /* 15:23 */ return this.quitTime; /* 16: */ } /* 17: */ /* 18: */ public void setQuitTime(long quitTime) /* 19: */ { /* 20:27 */ this.quitTime = quitTime; /* 21: */ } /* 22: */ /* 23: */ public ColoredBox getColoredBox() /* 24: */ { /* 25:31 */ return this.coloredBox; /* 26: */ } /* 27: */ /* 28: */ public Color getPermanentColor() /* 29: */ { /* 30:35 */ return this.permanentColor; /* 31: */ } /* 32: */ /* 33: */ public Color getTemporaryColor() /* 34: */ { /* 35:39 */ return this.temporaryColor; /* 36: */ } /* 37: */ /* 38: */ public ColorTrackerPackage(Color temporaryColor, Color permanentColor, ColoredBox b) /* 39: */ { /* 40:43 */ this.permanentColor = permanentColor; /* 41:44 */ this.temporaryColor = temporaryColor; /* 42:45 */ this.coloredBox = b; /* 43:46 */ this.quitTime = (System.currentTimeMillis() + this.showTime); /* 44: */ } /* 45: */ } /* Location: C:\Yuya\Development\Genesis\genesis.jar * Qualified Name: connections.views.ColorTrackerPackage * JD-Core Version: 0.7.0.1 */
9ee79b0d74c08e5ca3d380e9b2c987a8ac0d371a
61d892dc6afc9542556145baf66f662b42d02c75
/src/main/java/com/alinso/myapp/entity/Review.java
1ee8aa94c9572ea691ccb7467b2a3c7d098de40c
[]
no_license
alinso/saturday_spring
9effada0f64ce7319537e60307611438178f46c8
b258776a0256fee2190dc6faff7904065431d0ab
refs/heads/master
2023-03-11T04:12:06.388387
2021-02-28T08:51:13
2021-02-28T08:51:13
332,278,276
0
0
null
null
null
null
UTF-8
Java
false
false
853
java
package com.alinso.myapp.entity; import javax.persistence.*; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @Entity public class Review extends BaseEntity { @Column(columnDefinition = "TEXT") @NotBlank(message = "Yorum metni boş olamaz") private String review; @ManyToOne @NotNull private User reader; @ManyToOne @NotNull private User writer; public String getReview() { return review; } public void setReview(String review) { this.review = review; } public User getReader() { return reader; } public void setReader(User reader) { this.reader = reader; } public User getWriter() { return writer; } public void setWriter(User writer) { this.writer = writer; } }