blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
325fdd0c51a4048c4e5180bf4eb47b75160a4fdd | 8dcdb46fbb6a9ba9ebcd4fd827ce2670c1953069 | /threatconnect-app/playbooks-core/src/main/java/com/threatconnect/app/playbooks/content/accumulator/KeyValueAccumulator.java | b764615575bb5d6bfaf1d3498eec5fd516ac05b0 | [
"Apache-2.0"
] | permissive | ThreatConnect-Inc/threatconnect-java | 1243d812cae54724710276dab60418cd7e2e97ed | af1397e9e9d49c4391e321cbd627340bfd3003bc | refs/heads/master | 2023-08-31T18:22:06.686473 | 2021-08-25T15:06:28 | 2021-08-25T15:06:28 | 27,193,063 | 5 | 3 | NOASSERTION | 2022-05-20T20:49:45 | 2014-11-26T19:38:13 | Java | UTF-8 | Java | false | false | 2,039 | java | package com.threatconnect.app.playbooks.content.accumulator;
import com.threatconnect.app.addons.util.config.install.StandardPlaybookType;
import com.threatconnect.app.playbooks.content.converter.KeyValueConverter;
import com.threatconnect.app.playbooks.content.entity.KeyValue;
import com.threatconnect.app.playbooks.db.DBService;
import com.threatconnect.app.playbooks.util.KeyValueUtil;
/**
* @author Greg Marut
*/
public class KeyValueAccumulator extends TypedContentAccumulator<KeyValue>
{
private final StringAccumulator stringAccumulator;
public KeyValueAccumulator(final DBService dbService)
{
super(dbService, StandardPlaybookType.KeyValue, new KeyValueConverter());
this.stringAccumulator = new StringAccumulator(dbService);
}
/**
* Reads the content while looking for embedded variables and replacing them with their resolved value.
*
* @param key the key to check to resolve any embedded variables
* @param resolveEmbeddedVariables when true, recursion is allowed when resolving variables. Therefore, if a
* variable is resolved and it contains more variables embedded in the string, the
* lookups continue until all variables have been recursively resolved or a variable
* could not be found.
* @return the content read from the database using the given key.
* @throws ContentException if there was an issue reading/writing to the database.
*/
public KeyValue readContent(final String key, final boolean resolveEmbeddedVariables)
throws ContentException
{
//read the key value object and check for variables
KeyValue result = super.readContent(key);
//ensure that embedded variables should be resolved
if (resolveEmbeddedVariables)
{
KeyValueUtil.resolveEmbeddedVariables(result, stringAccumulator);
}
return result;
}
@Override
public KeyValue readContent(final String key) throws ContentException
{
return readContent(key, true);
}
}
| [
"gmarut@threatconnect.com"
] | gmarut@threatconnect.com |
01bb0eb0d132a248962f2e20a5d3c14065d25fb2 | 2e0c65731e9cc46e9e9c4104428370966eff0385 | /src/main/java/com/bidproject/service/bidserver/bidder/BidderResource.java | 8337574e25bcdb0e17dd4350b7cb920d262d3f9d | [] | no_license | pratiktest/bidserver | 59d2bf8736641beb9a59689815799c999312467f | fba5e57c824da4139ab41eef327867bc0c3f1086 | refs/heads/master | 2020-04-11T11:12:45.678992 | 2018-12-17T04:27:44 | 2018-12-17T04:27:44 | 161,741,355 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,151 | java | package com.bidproject.service.bidserver.bidder;
import com.bidproject.service.bidserver.bid.Bid;
import com.bidproject.service.bidserver.bid.BidRepository;
import com.bidproject.service.bidserver.project.Project;
import com.bidproject.service.bidserver.project.ProjectExpiredException;
import com.bidproject.service.bidserver.project.ProjectRepository;
import com.bidproject.service.bidserver.seller.NotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import javax.validation.Valid;
import java.net.URI;
import java.util.*;
@RestController
public class BidderResource {
@Autowired
private BidderRepository bidderRepository;
@Autowired
private ProjectRepository projectRepository;
@Autowired
private BidRepository bidRepository;
@PostMapping("/bidders")
public ResponseEntity<Object> createBidder(@Valid @RequestBody Bidder bidder) {
Bidder savedBidder = bidderRepository.save(bidder);
//gets /sellers from the above uri and appends /{id} to it after which replaces the id template with stored seller id
URI location = ServletUriComponentsBuilder.fromCurrentRequest().path("/{id}").buildAndExpand(savedBidder.getId()).toUri();
return ResponseEntity.created(location).build();
}
@GetMapping("/bidder/{id}")
public Bidder getBidder(@PathVariable int id) throws NotFoundException {
Optional<Bidder> bidder = bidderRepository.findById(id);
if(!bidder.isPresent()){
throw new NotFoundException("Bidder "+ id + " not found");
}
return bidder.get();
}
@GetMapping("/bidder/name/{name}")
public Bidder getBidderByName(@PathVariable String name) throws NotFoundException {
List<Bidder> bidders = bidderRepository.findByName(name);
return bidders.get(0);
}
@PostMapping("/bidder/{bidderId}/project/{projectId}/bid")
public ResponseEntity<Object> placeBid(@PathVariable int bidderId, @PathVariable int projectId, @Valid @RequestBody Bid bid) throws NotFoundException, ProjectExpiredException {
Optional<Bidder> bidderOptional = bidderRepository.findById(bidderId);
Optional<Project> projectOptional = projectRepository.findById(projectId);
if(!bidderOptional.isPresent()){
throw new NotFoundException("Bidder "+ bidderId + " not found");
}
if(!projectOptional.isPresent()){
throw new NotFoundException("Project "+ projectId + " not found");
}
Bidder bidder = bidderOptional.get();
Project project = projectOptional.get();
if(project.getExpiry().compareTo(new Date()) < 0){
throw new ProjectExpiredException("Project "+ projectId + " not found");
}
bid.setBidder(bidder);
bid.setProject(project);
bidRepository.save(bid);
int rows = projectRepository.updateMaxBid(bid.getPrice(), projectId, bidderId, bid.getId());
System.out.println(rows);
//gets /sellers from the above uri and appends /{id} to it after which replaces the id template with stored seller id
URI location = ServletUriComponentsBuilder.fromPath("/bid/{id}").buildAndExpand(bid.getId()).toUri();
return ResponseEntity.created(location).build();
}
@DeleteMapping("/bidder/{bidderId}/project/{projectId}/bid/{bidId}")
public ResponseEntity<Object> deleteBid(@PathVariable int bidderId, @PathVariable int projectId, @PathVariable int bidId) throws NotFoundException, ProjectExpiredException {
int updatedRows = projectRepository.deleteMaxBidder(Double.MAX_VALUE, projectId, bidderId, bidId);
//send response and return do below in a kafka event consumer
Optional<Bid> bid = bidRepository.findById(bidId);
if(!bid.isPresent()){
throw new NotFoundException("Project "+ projectId + " not found");
}
bidRepository.delete(bid.get());
List<Bid> projectbids = bidRepository.findByProjectId(projectId);
projectbids.sort((Bid b1, Bid b2) -> {
if(b1.getPrice()<b2.getPrice()){
return -1;
}else if(b1.getPrice()>b2.getPrice()){
return 1;
}else{
int compareTime = b1.getPlacetime().compareTo(b2.getPlacetime());
if(compareTime != 0){
return compareTime;
}else {
return 0;
}
}
});
if(projectbids != null && projectbids.size()>0 && projectbids.get(0) != null){
Integer bidder = projectbids.get(0).getBidder().getId();
Double prPrice = projectbids.get(0).getPrice();
Integer minBidId = projectbids.get(0).getId();
projectRepository.updateMaxBid(prPrice, projectId , bidder, minBidId);
}
//send kafka refresh events to sync bids with min bidder
return ResponseEntity.ok().build();
}
}
| [
"prkale@ebay.com"
] | prkale@ebay.com |
5df4c704f1e76837e6feb8571eebd60fb140b3de | c01d748d6aee872b87036b16d9ce4dcbc054d1a5 | /app/src/main/java/com/rhealabs/keyboard/latin/UserBinaryDictionary.java | e0072a4151780496ebf0503cbf8fb7cfb3f39dcb | [] | no_license | georgesp90/just-sul | a2b15bd1998880506ba178b64e5d4b18394749da | 8274f4457eab08d9cdedfe1e835d01c565b7a65a | refs/heads/master | 2021-08-19T19:11:43.998362 | 2017-11-25T00:39:24 | 2017-11-25T00:39:24 | 111,965,298 | 0 | 1 | null | 2017-11-27T05:46:14 | 2017-11-25T00:34:23 | Makefile | UTF-8 | Java | false | false | 10,127 | java | /*
* Copyright (C) 2012 The Android Open Source Project
*
* 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.rhealabs.keyboard.latin;
import android.content.ContentResolver;
import android.content.Context;
import android.database.ContentObserver;
import android.database.Cursor;
import android.database.sqlite.SQLiteException;
import android.net.Uri;
import android.provider.UserDictionary.Words;
import android.text.TextUtils;
import android.util.Log;
import com.rhealabs.keyboard.annotations.ExternallyReferenced;
import com.rhealabs.keyboard.latin.utils.SubtypeLocaleUtils;
import java.io.File;
import java.util.Arrays;
import java.util.Locale;
import javax.annotation.Nullable;
/**
* An expandable dictionary that stores the words in the user dictionary provider into a binary
* dictionary file to use it from native code.
*/
public class UserBinaryDictionary extends ExpandableBinaryDictionary {
private static final String TAG = ExpandableBinaryDictionary.class.getSimpleName();
// The user dictionary provider uses an empty string to mean "all languages".
private static final String USER_DICTIONARY_ALL_LANGUAGES = "";
private static final int HISTORICAL_DEFAULT_USER_DICTIONARY_FREQUENCY = 250;
private static final int LATINIME_DEFAULT_USER_DICTIONARY_FREQUENCY = 160;
private static final String[] PROJECTION_QUERY = new String[] {Words.WORD, Words.FREQUENCY};
private static final String NAME = "userunigram";
private ContentObserver mObserver;
final private String mLocaleString;
final private boolean mAlsoUseMoreRestrictiveLocales;
protected UserBinaryDictionary(final Context context, final Locale locale,
final boolean alsoUseMoreRestrictiveLocales,
final File dictFile, final String name) {
super(context, getDictName(name, locale, dictFile), locale, Dictionary.TYPE_USER, dictFile);
if (null == locale) throw new NullPointerException(); // Catch the error earlier
final String localeStr = locale.toString();
if (SubtypeLocaleUtils.NO_LANGUAGE.equals(localeStr)) {
// If we don't have a locale, insert into the "all locales" user dictionary.
mLocaleString = USER_DICTIONARY_ALL_LANGUAGES;
} else {
mLocaleString = localeStr;
}
mAlsoUseMoreRestrictiveLocales = alsoUseMoreRestrictiveLocales;
ContentResolver cres = context.getContentResolver();
mObserver = new ContentObserver(null) {
@Override
public void onChange(final boolean self) {
// This hook is deprecated as of API level 16 (Build.VERSION_CODES.JELLY_BEAN),
// but should still be supported for cases where the IME is running on an older
// version of the platform.
onChange(self, null);
}
// The following hook is only available as of API level 16
// (Build.VERSION_CODES.JELLY_BEAN), and as such it will only work on JellyBean+
// devices. On older versions of the platform, the hook above will be called instead.
@Override
public void onChange(final boolean self, final Uri uri) {
setNeedsToRecreate();
}
};
cres.registerContentObserver(Words.CONTENT_URI, true, mObserver);
reloadDictionaryIfRequired();
}
// Note: This method is called by {@link DictionaryFacilitator} using Java reflection.
@ExternallyReferenced
public static UserBinaryDictionary getDictionary(
final Context context, final Locale locale, final File dictFile,
final String dictNamePrefix, @Nullable final String account) {
return new UserBinaryDictionary(
context, locale, false /* alsoUseMoreRestrictiveLocales */,
dictFile, dictNamePrefix + NAME);
}
@Override
public synchronized void close() {
if (mObserver != null) {
mContext.getContentResolver().unregisterContentObserver(mObserver);
mObserver = null;
}
super.close();
}
@Override
public void loadInitialContentsLocked() {
// Split the locale. For example "en" => ["en"], "de_DE" => ["de", "DE"],
// "en_US_foo_bar_qux" => ["en", "US", "foo_bar_qux"] because of the limit of 3.
// This is correct for locale processing.
// For this example, we'll look at the "en_US_POSIX" case.
final String[] localeElements =
TextUtils.isEmpty(mLocaleString) ? new String[] {} : mLocaleString.split("_", 3);
final int length = localeElements.length;
final StringBuilder request = new StringBuilder("(locale is NULL)");
String localeSoFar = "";
// At start, localeElements = ["en", "US", "POSIX"] ; localeSoFar = "" ;
// and request = "(locale is NULL)"
for (int i = 0; i < length; ++i) {
// i | localeSoFar | localeElements
// 0 | "" | ["en", "US", "POSIX"]
// 1 | "en_" | ["en", "US", "POSIX"]
// 2 | "en_US_" | ["en", "en_US", "POSIX"]
localeElements[i] = localeSoFar + localeElements[i];
localeSoFar = localeElements[i] + "_";
// i | request
// 0 | "(locale is NULL)"
// 1 | "(locale is NULL) or (locale=?)"
// 2 | "(locale is NULL) or (locale=?) or (locale=?)"
request.append(" or (locale=?)");
}
// At the end, localeElements = ["en", "en_US", "en_US_POSIX"]; localeSoFar = en_US_POSIX_"
// and request = "(locale is NULL) or (locale=?) or (locale=?) or (locale=?)"
final String[] requestArguments;
// If length == 3, we already have all the arguments we need (common prefix is meaningless
// inside variants
if (mAlsoUseMoreRestrictiveLocales && length < 3) {
request.append(" or (locale like ?)");
// The following creates an array with one more (null) position
final String[] localeElementsWithMoreRestrictiveLocalesIncluded =
Arrays.copyOf(localeElements, length + 1);
localeElementsWithMoreRestrictiveLocalesIncluded[length] =
localeElements[length - 1] + "_%";
requestArguments = localeElementsWithMoreRestrictiveLocalesIncluded;
// If for example localeElements = ["en"]
// then requestArguments = ["en", "en_%"]
// and request = (locale is NULL) or (locale=?) or (locale like ?)
// If localeElements = ["en", "en_US"]
// then requestArguments = ["en", "en_US", "en_US_%"]
} else {
requestArguments = localeElements;
}
final String requestString = request.toString();
addWordsFromProjectionLocked(PROJECTION_QUERY, requestString, requestArguments);
}
private void addWordsFromProjectionLocked(final String[] query, String request,
final String[] requestArguments)
throws IllegalArgumentException {
Cursor cursor = null;
try {
cursor = mContext.getContentResolver().query(
Words.CONTENT_URI, query, request, requestArguments, null);
addWordsLocked(cursor);
} catch (final SQLiteException e) {
Log.e(TAG, "SQLiteException in the remote User dictionary process.", e);
} finally {
try {
if (null != cursor) cursor.close();
} catch (final SQLiteException e) {
Log.e(TAG, "SQLiteException in the remote User dictionary process.", e);
}
}
}
private static int scaleFrequencyFromDefaultToLatinIme(final int defaultFrequency) {
// The default frequency for the user dictionary is 250 for historical reasons.
// Latin IME considers a good value for the default user dictionary frequency
// is about 160 considering the scale we use. So we are scaling down the values.
if (defaultFrequency > Integer.MAX_VALUE / LATINIME_DEFAULT_USER_DICTIONARY_FREQUENCY) {
return (defaultFrequency / HISTORICAL_DEFAULT_USER_DICTIONARY_FREQUENCY)
* LATINIME_DEFAULT_USER_DICTIONARY_FREQUENCY;
}
return (defaultFrequency * LATINIME_DEFAULT_USER_DICTIONARY_FREQUENCY)
/ HISTORICAL_DEFAULT_USER_DICTIONARY_FREQUENCY;
}
private void addWordsLocked(final Cursor cursor) {
if (cursor == null) return;
if (cursor.moveToFirst()) {
final int indexWord = cursor.getColumnIndex(Words.WORD);
final int indexFrequency = cursor.getColumnIndex(Words.FREQUENCY);
while (!cursor.isAfterLast()) {
final String word = cursor.getString(indexWord);
final int frequency = cursor.getInt(indexFrequency);
final int adjustedFrequency = scaleFrequencyFromDefaultToLatinIme(frequency);
// Safeguard against adding really long words.
if (word.length() <= MAX_WORD_LENGTH) {
runGCIfRequiredLocked(true /* mindsBlockByGC */);
addUnigramLocked(word, adjustedFrequency, false /* isNotAWord */,
false /* isPossiblyOffensive */,
BinaryDictionary.NOT_A_VALID_TIMESTAMP);
}
cursor.moveToNext();
}
}
}
}
| [
"georgesp90@gmail.com"
] | georgesp90@gmail.com |
2aea49f2793ef64aa7731b7fbfbdfd0689b14192 | 0de02da2c932361a792dca766ef96d95aac13597 | /expense-service/src/main/java/com/thiagodev/app/expenseservice/controller/dto/ExpenseFilterDTO.java | ec7ce12f4163964229551127ce510ce72d791fab | [] | no_license | thiagosilva95/TestBackJava | bd0370b45465544058a3f9d8f05e8605fbffd8c4 | 75c76ab3a4dfcb796a154328f7acf1d3b420c6d2 | refs/heads/master | 2020-04-01T12:00:43.589974 | 2018-11-06T00:16:26 | 2018-11-06T00:16:26 | 153,187,237 | 0 | 0 | null | 2018-10-15T22:00:58 | 2018-10-15T22:00:58 | null | UTF-8 | Java | false | false | 336 | java | package com.thiagodev.app.expenseservice.controller.dto;
import java.time.LocalDate;
import org.springframework.format.annotation.DateTimeFormat;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class ExpenseFilterDTO {
@DateTimeFormat(pattern ="dd/MM/yyyy")
private LocalDate date;
private Long userCode;
}
| [
"thiagonascimento95@hotmail.com"
] | thiagonascimento95@hotmail.com |
980c3545d92556aac916a27790a23b68993bb6d3 | 28d2a0b23ec31ca6dc98090848f53e94c6c8c0de | /Java/JDBC/IntroduccionJDBC/src/main/java/test/TestMYSqlJDBC.java | 5adb8a6dad5ce99a71f903be39d6b2f2eb20a1ef | [] | no_license | molinajp/Universidad-Java | d8ef43fd141f5173427ce4b310c99e8a2e2ce485 | cc3fdcb2d8dcecc007c1e2486f3506cd7a4756d5 | refs/heads/main | 2023-06-28T15:49:44.828917 | 2021-07-30T22:15:22 | 2021-07-30T22:15:22 | 389,254,378 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,429 | java | package test;
import java.sql.*;
public class TestMYSqlJDBC {
public static void main(String[] args) {
var url = "jdbc:mysql://localhost:3306/test?useSSL=false&useTimezone"
+ "=true&serverTimezone=UTC&allowPublicKeyRetrieval=true";
try {
//Class.forName("com.mysql.cj.jdbc.Driver"); hoy en dia no es requerido
Connection conexion = DriverManager.getConnection(url,"root",
"Escritorio*10");
Statement instruccion = conexion.createStatement();
var sql = "SELECT id_persona, nombre, apellido, email, "
+ "telefono FROM persona";
ResultSet resultado = instruccion.executeQuery(sql);
while(resultado.next()){
System.out.print("Id Persona: " + resultado.getInt
("id_persona"));
System.out.print(" Nombre: " + resultado.getString("nombre"));
System.out.print(" Apellido: " + resultado.getString("apellido"));
System.out.print(" Email: " + resultado.getString("email"));
System.out.println(" Telefono: " + resultado.getString("telefono"));
}
resultado.close();
instruccion.close();
conexion.close();
} catch (SQLException ex) {
ex.printStackTrace(System.out);
}
}
}
| [
"juan_pablo2969@hotmail.com"
] | juan_pablo2969@hotmail.com |
7d6fa6fe5e88e6fdc7274ca5cb7ef5956dc144b3 | 9b6be15725240f2ef80593d2c24b32f59c529e86 | /increpas0809/src/pm/MyMouseMaps.java | 7f322198fa49f8e4157a1bd1ea9d714cd2ecd046 | [] | no_license | ksm0207/increpas | 9164357521a282ba09da54837d252ff2b8b11cd4 | 0ce9e3621827f0df4dc26ffdcc0a09bf05e58754 | refs/heads/main | 2023-07-18T06:02:03.012112 | 2021-09-06T07:01:26 | 2021-09-06T07:01:26 | 386,208,023 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 629 | java | package pm;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
public class MyMouseMaps extends MouseAdapter{
Ex1_MouseTest ex1;
public MyMouseMaps(Ex1_MouseTest ex1) {
this.ex1 = ex1;
}
@Override
public void mousePressed(MouseEvent e) {
// 1. 마우스 클릭 시 X 좌표와 Y 좌표를 구하자.
int x = e.getX();
int y = e.getY();
StringBuffer sb = new StringBuffer();
sb.append("X좌표 : ");
sb.append(x);
sb.append(",Y좌표 : ");
sb.append(y);
ex1.setTitle(sb.toString());
// System.out.println(sb.toString());
}
}
| [
"ksm03071@naver.com"
] | ksm03071@naver.com |
a77b1f949f7b4b3e95f5a218281531ea802ea298 | 772a92d22d1c350131b20c311ab652629b03681e | /src/main/java/may/day3/Solution.java | 8b406c4d40b53df05f3c189d1729bbe3eb98e8f3 | [] | no_license | biprajeet/Leetcode | 7d5959023732f68761655857c2304ffcd592b17b | ceb0a8795332556aaa02ebba4274bfee9fd69542 | refs/heads/master | 2022-05-28T12:39:27.838914 | 2020-05-02T13:26:59 | 2020-05-02T13:26:59 | 260,370,897 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 51 | java | package may.day3;
public class Solution {
}
| [
"biprajeet.pal@gmail.com"
] | biprajeet.pal@gmail.com |
28e6ca86081b177a4edbd79957d761e88183a2cc | b892d657cc4ed14071f260c5e447275824562508 | /src/test/java/com/example/helloworld/resources/ProtectedResourceTest.java | 4711aa028b3792f7238f81fea63b011d7a89477a | [] | no_license | neolynx-blr/lector | 409b2d6e94a49d2007abf6c66a55c7da2a577497 | 8e254145c484284e002903b332741447256b8227 | refs/heads/master | 2021-01-18T19:00:46.285751 | 2016-08-26T05:14:19 | 2016-08-26T05:14:19 | 63,081,739 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,125 | java | package com.example.helloworld.resources;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown;
import io.dropwizard.auth.AuthDynamicFeature;
import io.dropwizard.auth.AuthValueFactoryProvider;
import io.dropwizard.auth.basic.BasicCredentialAuthFilter;
import io.dropwizard.testing.junit.ResourceTestRule;
import javax.ws.rs.ForbiddenException;
import javax.ws.rs.NotAuthorizedException;
import javax.ws.rs.core.HttpHeaders;
import org.glassfish.jersey.server.filter.RolesAllowedDynamicFeature;
import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory;
import org.junit.ClassRule;
import org.junit.Test;
import com.example.helloworld.auth.ExampleAuthenticator2;
import com.example.helloworld.auth.ExampleAuthorizer2;
import com.example.helloworld.core.User;
public class ProtectedResourceTest {
private static final BasicCredentialAuthFilter<User> BASIC_AUTH_HANDLER =
new BasicCredentialAuthFilter.Builder<User>()
.setAuthenticator(new ExampleAuthenticator2())
.setAuthorizer(new ExampleAuthorizer2())
.setPrefix("Basic")
.setRealm("SUPER SECRET STUFF")
.buildAuthFilter();
@ClassRule
public static final ResourceTestRule RULE = ResourceTestRule.builder()
.addProvider(RolesAllowedDynamicFeature.class)
.addProvider(new AuthDynamicFeature(BASIC_AUTH_HANDLER))
.addProvider(new AuthValueFactoryProvider.Binder<>(User.class))
.setTestContainerFactory(new GrizzlyWebTestContainerFactory())
.addProvider(ProtectedResource.class)
.build();
@Test
public void testProtectedEndpoint() {
String secret = RULE.getJerseyTest().target("/protected").request()
.header(HttpHeaders.AUTHORIZATION, "Basic Z29vZC1ndXk6c2VjcmV0")
.get(String.class);
assertThat(secret).startsWith("Hey there, good-guy. You know the secret!");
}
@Test
public void testProtectedEndpointNoCredentials401() {
try {
RULE.getJerseyTest().target("/protected").request()
.get(String.class);
failBecauseExceptionWasNotThrown(NotAuthorizedException.class);
} catch (NotAuthorizedException e) {
assertThat(e.getResponse().getStatus()).isEqualTo(401);
assertThat(e.getResponse().getHeaders().get(HttpHeaders.WWW_AUTHENTICATE))
.containsOnly("Basic realm=\"SUPER SECRET STUFF\"");
}
}
@Test
public void testProtectedEndpointBadCredentials401() {
try {
RULE.getJerseyTest().target("/protected").request()
.header(HttpHeaders.AUTHORIZATION, "Basic c25lYWt5LWJhc3RhcmQ6YXNkZg==")
.get(String.class);
failBecauseExceptionWasNotThrown(NotAuthorizedException.class);
} catch (NotAuthorizedException e) {
assertThat(e.getResponse().getStatus()).isEqualTo(401);
assertThat(e.getResponse().getHeaders().get(HttpHeaders.WWW_AUTHENTICATE))
.containsOnly("Basic realm=\"SUPER SECRET STUFF\"");
}
}
@Test
public void testProtectedAdminEndpoint() {
String secret = RULE.getJerseyTest().target("/protected/admin").request()
.header(HttpHeaders.AUTHORIZATION, "Basic Y2hpZWYtd2l6YXJkOnNlY3JldA==")
.get(String.class);
assertThat(secret).startsWith("Hey there, chief-wizard. It looks like you are an admin.");
}
@Test
public void testProtectedAdminEndpointPrincipalIsNotAuthorized403() {
try {
RULE.getJerseyTest().target("/protected/admin").request()
.header(HttpHeaders.AUTHORIZATION, "Basic Z29vZC1ndXk6c2VjcmV0")
.get(String.class);
failBecauseExceptionWasNotThrown(ForbiddenException.class);
} catch (ForbiddenException e) {
assertThat(e.getResponse().getStatus()).isEqualTo(403);
}
}
}
| [
"niteshgarg@gmail.com"
] | niteshgarg@gmail.com |
f1a4dd8cad7edb381d055f94ad6e38606ddbbdfb | cae13525b9dfdfc5bf5fe935ee2f37d442524d0c | /src/main/java/bootwildfly/TestRepository.java | 41afbf74a48b3f4ab5bc556b05cf303c56499cb2 | [] | no_license | MaysaMacedo/daca | 8faf8564547fc5847ea3f2730c957ab69ffefaaf | f69efaf1dc2f2d4b941a3796f324aef6a9a96911 | refs/heads/master | 2021-01-23T01:08:34.844356 | 2016-10-15T02:52:44 | 2016-10-15T02:52:44 | 64,503,148 | 1 | 0 | null | 2016-07-29T18:43:44 | 2016-07-29T18:43:44 | null | UTF-8 | Java | false | false | 474 | java | package bootwildfly;
import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
public interface TestRepository extends CrudRepository<Teste, String> {
//Page<Teste> findAB(Pageable pageable);
//List<Teste> findByProblem(Problem problem);
}
| [
"maysa.macedo95@gmail.com"
] | maysa.macedo95@gmail.com |
c2d19b3cd6452300cd57a2168000f80cbecde933 | 70d229ac56934e739f19de7fc67213812963a2b3 | /app/src/main/java/com/delaroystudios/fragrancecart/sync/FragranceSyncService.java | 584a1e5566a13213e4d098cb6933fc40bfc828c2 | [] | no_license | shubhamMonga777/SyncAdaptorMaster | 4df2fb77b7d2249969bfd6bc64016b2b5d4e706b | 55d0d75cbebb16dbfe66519fce73b2f599723d6c | refs/heads/master | 2022-02-05T20:07:22.381976 | 2019-07-22T11:40:51 | 2019-07-22T11:40:51 | 198,211,753 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 847 | java | package com.delaroystudios.fragrancecart.sync;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
/**
* Created by delaroy on 10/18/17.
*/
public class FragranceSyncService extends Service {
private static final Object sSyncAdapterLock = new Object();
private static FragranceSyncAdapter eFragranceSyncAdapter = null;
@Override
public void onCreate() {
Log.d("MovieSyncService", "onCreate - MovieSyncService");
synchronized (sSyncAdapterLock) {
if (eFragranceSyncAdapter == null) {
eFragranceSyncAdapter = new FragranceSyncAdapter(getApplicationContext(), true);
}
}
}
@Override
public IBinder onBind(Intent intent) {
return eFragranceSyncAdapter.getSyncAdapterBinder();
}
}
| [
"monga.shubham8@gmail.com"
] | monga.shubham8@gmail.com |
1341c0428d2bbf753ea03f522feb638ebd24088c | ec7988c4f48cccc912501c2f9f06d61a38fd3863 | /src/Strings/RestoreIPAddress.java | 9dc9cf952a4bb36a36acb3bb4a44b496243a4fba | [] | no_license | anotherruchit/Programs | d2f58016513a1c1d24e11e111bca3a05c81507f0 | 4558d772f79f4483dc4e670d2a02ca47e82afc04 | refs/heads/master | 2020-12-02T21:11:47.373180 | 2017-09-06T07:26:28 | 2017-09-06T07:26:28 | 96,267,577 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,250 | java | package Strings;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
/**
* Created by dharabavishi on 7/3/17.
* https://leetcode.com/problems/restore-ip-addresses/#/solutions
* Problem Statement : Given “25525511135”,
return [“255.255.11.135”, “255.255.111.35”]. (Make sure the returned strings are sorted in order)
* TODO: https://www.interviewbit.com/problems/valid-ip-addresses/ - better solution
*/
public class RestoreIPAddress {
public static void main(String args[]){
List<String> list = restoreIPAddress("12321232");
System.out.println(list.toString());
// error condition
list = restoreIPAddress("123212A32");
System.out.println(list.toString());
//error condition
list = restoreIPAddress("123");
System.out.println(list.toString());
}
public static ArrayList<String> restoreIPAddress(String s){
ArrayList<String> res = new ArrayList<>();
int len = s.length();
if(s.length() > 12)
return res;
if(s.length() < 4)
return res;
for(int i = 1; i < 4 && i < len-2; i++){
for(int j = i+1; j < i+4 && j < len-1; j++){
for(int k = j+1; k < j+4 && k < len; k++){
String s1 = s.substring(0, i),
s2 = s.substring(i, j),
s3 = s.substring(j, k),
s4 = s.substring(k, len);
// startIndex: inclusive, endIndex: exclusive
if(isValid(s1) && isValid(s2) && isValid(s3) && isValid(s4)){
res.add(s1+"."+s2+"."+s3+"."+s4);
}
}
}
}
return res;
}
public static boolean isValid(String s){
int number;
try{
number = Integer.parseInt(s);
} catch (NumberFormatException nfe){
System.out.println(s + " is not a number");
return false;
}
if(s.length() > 3 ||number > 255 || s.charAt(0) == '0' && s.length() > 1 ||
s.length() == 0)
return false;
return true;
}
}
| [
"dharabavishi@gmail.com"
] | dharabavishi@gmail.com |
7a3718638e4a0eb7c66307c5d1782b677f6b6bb0 | 6b3521db91ca5a1093c46c22178f26191db15a1f | /eureka-server/src/main/java/com/shop/eurekaserver/EurekaServerApplication.java | a84e913670ba9a5fd2d633c7ef4466af237e61c7 | [] | no_license | linuxciscoarnaud/Micro-services-with-Zuul-Eureka | c552557eebc2ea828fa0d4efebcae6a29d587ff2 | 20f6652613844304e6ff956c6579a4f10bade2e0 | refs/heads/master | 2020-04-12T03:29:52.656212 | 2018-12-18T10:16:09 | 2018-12-18T10:16:09 | 162,268,885 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 421 | java | package com.shop.eurekaserver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
public class EurekaServerApplication {
public static void main(String[] args) {
SpringApplication.run(EurekaServerApplication.class, args);
}
}
| [
"arnaudkenfack@yahoo.fr"
] | arnaudkenfack@yahoo.fr |
57f0090a6bf6743cf9f236a6e382673c08fe2de2 | aff5c1fdb9d167ddde5c7112ba416f8edeeab553 | /provider_server/src/main/java/com/yaozhou/ProviderServerApplication.java | 8ed8ce6b9e26628d6b5bc36ae323687f967dd0c1 | [] | no_license | yaozhoucn/dubbo_zookeeper | be0a748f8108b15ab5ec4027169e7263606c94f0 | 01d44886d62ec908a535906d49ea3f5989968935 | refs/heads/master | 2023-08-13T23:45:26.031856 | 2021-09-24T08:58:38 | 2021-09-24T08:58:38 | 409,898,260 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 332 | java | package com.yaozhou;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ProviderServerApplication {
public static void main(String[] args) {
SpringApplication.run(ProviderServerApplication.class, args);
}
}
| [
"wangxiao_h@126.com"
] | wangxiao_h@126.com |
e92d1d1e1bc273fdbdaec73315f2c75ce146dd36 | 012599c02882063433ec19cfb3abb1da7337bdb0 | /subway/src/com/subway/dao/test/FaultDAOTest.java | 4a370ea3dc9a830eb20a9a1a4ad241ab76ef6290 | [] | no_license | liyanfeng/subway | 815e5f1e4c47f94ea2da285ae6d09b3c3cb3162d | 827357f3c82bdd9fedc32de815e649b5b645f769 | refs/heads/master | 2021-01-10T19:53:46.787452 | 2014-09-17T04:54:55 | 2014-09-17T04:54:55 | 24,130,349 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 225 | java | package com.subway.dao.test;
import com.subway.dao.FaultDAO;
public class FaultDAOTest {
public static void main(String[] args) {
FaultDAO fd = new FaultDAO();
System.out.println(fd.findByCode("TH14080601"));
}
}
| [
"2573746941@qq.com"
] | 2573746941@qq.com |
c18cf2136ecfe6ad90489273c219395cc1faa584 | 6c3be6962040d4fc6bf8393cccc713049af6c62b | /app/src/main/java/com/example/soumit/grocerylist/Activities/MainActivity.java | eed2fb626388fc69505caf02366eb52fa3351465 | [] | no_license | Soumit38/GroceryList | 15b2f466deee7b85ab58cee8d791d16e57f0b156 | 4c34ef1e98b3138d0763a01ef2fcc51e8647fc4a | refs/heads/master | 2021-04-29T23:01:52.399154 | 2018-02-14T18:44:09 | 2018-02-14T18:44:09 | 121,546,950 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,564 | java | package com.example.soumit.grocerylist.Activities;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.example.soumit.grocerylist.Data.DatabaseHandler;
import com.example.soumit.grocerylist.Model.Grocery;
import com.example.soumit.grocerylist.R;
public class MainActivity extends AppCompatActivity {
private static final String TAG = "MainActivity";
private AlertDialog.Builder dialogBuilder;
private AlertDialog dialog;
private EditText groceryItem;
private EditText quantity;
private Button saveBtn;
private DatabaseHandler db;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
db = new DatabaseHandler(this);
byPassActivity();
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
/*Snackbar.make(view, "Hello Soumit", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();*/
createPopupDialog();
}
});
}
private void createPopupDialog() {
dialogBuilder = new AlertDialog.Builder(this);
View view = getLayoutInflater().inflate(R.layout.popup, null);
groceryItem = (EditText) view.findViewById(R.id.item_id);
quantity = (EditText) view.findViewById(R.id.quantity_id);
saveBtn = (Button) view.findViewById(R.id.saveBtn);
dialogBuilder.setView(view);
dialog = dialogBuilder.create();
dialog.show();
saveBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!groceryItem.getText().toString().isEmpty()
&& !quantity.getText().toString().isEmpty()) {
saveGroceryToDB(view);
}
}
});
}
private void saveGroceryToDB(View view) {
Grocery grocery = new Grocery();
String newGrocery = groceryItem.getText().toString();
String newQuantity = quantity.getText().toString();
grocery.setName(newGrocery);
grocery.setQuantity(newQuantity);
db.addGrocery(grocery);
Snackbar.make(view, "Item saved !", Snackbar.LENGTH_SHORT).show();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
dialog.dismiss();
Intent intent = new Intent(MainActivity.this, ListActivity.class);
startActivity(intent);
}
}, 1000);
// Log.d(TAG, "saveGroceryToDB: Item count : " + db.getGroceriesCount());
}
private void byPassActivity(){
if(db.getGroceriesCount() > 0){
startActivity(new Intent(MainActivity.this, ListActivity.class));
finish();
}
}
}
| [
"soumitkumar4@gmail.com"
] | soumitkumar4@gmail.com |
b40685b3fe10a389546e71f4162bc66bdc5a60fa | 9e08e211b4d98aeed220797031b9bf750a9fa1d2 | /src/main/java/net/segoia/distributed/framework/TaskProcessingResponse.java | 4afe7fe3e8e6309a1e9d3c5c717a7bdb289d647b | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | acionescu/distributed-processor | 378366f6f16b653bdf21d89430d34cced2643783 | 35454f048a92cdb3501dfebe2ee85804a9ca2c09 | refs/heads/master | 2020-12-24T16:24:48.291088 | 2017-06-14T12:30:06 | 2017-06-14T12:30:06 | 1,417,589 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,377 | java | /**
* distributed-processor - A distributed task processing framework
* Copyright (C) 2009 Adrian Cristian Ionescu - https://github.com/acionescu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.segoia.distributed.framework;
import java.io.Serializable;
import org.jgroups.Address;
/**
* The response that contains the information obtained after a task was processed
*
* @author adi
*
*/
public class TaskProcessingResponse implements Serializable {
/**
*
*/
private static final long serialVersionUID = -3088811983234127035L;
private Long taskId;
protected Serializable result;
protected Exception exception;
private Address processingNodeAddress;
public TaskProcessingResponse(Long taskId, Serializable result) {
this.taskId = taskId;
this.result = result;
}
public TaskProcessingResponse(Long taskId, Serializable result, Address nodeAddress) {
this(taskId, result);
this.processingNodeAddress = nodeAddress;
}
public TaskProcessingResponse(Long taskId, Serializable result, Exception ex) {
this.taskId = taskId;
this.result = result;
this.exception = ex;
}
public TaskProcessingResponse(Long taskId, Serializable result, Exception ex, Address nodeAddress) {
this(taskId, result, ex);
this.processingNodeAddress = nodeAddress;
}
public TaskProcessingResponse(Long taskId) {
this.taskId = taskId;
}
public boolean isSucessful() {
return (exception == null);
}
public Long getTaskId() {
return taskId;
}
public Serializable getResult() {
return result;
}
public Exception getException() {
return exception;
}
/**
* @return the processingNodeAddress
*/
public Address getProcessingNodeAddress() {
return processingNodeAddress;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((processingNodeAddress == null) ? 0 : processingNodeAddress.hashCode());
result = prime * result + ((taskId == null) ? 0 : taskId.hashCode());
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
TaskProcessingResponse other = (TaskProcessingResponse) obj;
if (processingNodeAddress == null) {
if (other.processingNodeAddress != null)
return false;
} else if (!processingNodeAddress.equals(other.processingNodeAddress))
return false;
if (taskId == null) {
if (other.taskId != null)
return false;
} else if (!taskId.equals(other.taskId))
return false;
return true;
}
}
| [
"adrian.ionescu.consulting@gmail.com"
] | adrian.ionescu.consulting@gmail.com |
24d911ef0c68a8a244153c72ba3c490c597769a7 | 88686f1aa367241b02082693f41a5523d1b28da0 | /interfaceComponents/StatusCombo.java | 8ca548ad414c42268c5e5f693f71679dbdb556b7 | [
"BSD-3-Clause"
] | permissive | jalingo/Galileo | ac3c389f83c0f73423f969265a77981384a2d537 | c45b45faff0864336f44c55ff6175a9c309c4946 | refs/heads/master | 2021-04-26T22:52:24.756874 | 2018-03-07T01:33:47 | 2018-03-07T01:33:47 | 124,159,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 332 | java | package interfaceComponents;
import javax.swing.JComboBox;
public class StatusCombo extends JComboBox<String> {
private static final long serialVersionUID = -1182769752963399075L;
//constructor
public StatusCombo() {
addItem("PENDNG");
addItem("CONFRM");
addItem("OPENED");
addItem("CLOSED");
addItem("CANCEL"); }
}
| [
"jalingo@berkeley.edu"
] | jalingo@berkeley.edu |
b80a1cd1288fd9b3fdc72d03a86bc467d40b8963 | 28152c75f8efe5abf09a11998eb2fb53edaa545f | /generic/src/at/generic/service/CorrelatingEventsPersistenceService.java | 4837cfd72a5f6d9b3245d3fbe50604670a0afb97 | [] | no_license | BackupTheBerlios/springbreak | cbf8209ef7f8a2224f3a2bfbcc6e46b30a1a30f3 | d27e25b5ba0cbb4c68dbdc17f1dfa96dc3b5c537 | refs/heads/master | 2021-01-22T01:55:07.162006 | 2006-05-03T15:27:26 | 2006-05-03T15:27:26 | 40,260,340 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,487 | java | package at.generic.service;
import java.util.List;
import at.generic.dao.CorrelatedeventDAO;
import at.generic.dao.CorrelatedsetDAO;
import at.generic.dao.EventDAO;
import at.generic.dao.EventattributeDAO;
import at.generic.dao.EventtypeDAO;
import at.generic.dao.RwtimeDAO;
import at.generic.dao.TxtimeDAO;
import at.generic.eventmodel.Event;
import at.generic.eventmodel.Eventattribute;
import at.generic.model.Correlatedevent;
import at.generic.model.Correlationset;
/**
* @author szabolcs
* @version $Id: CorrelatingEventsPersistenceService.java,v 1.4 2006/04/18 22:39:02 szabolcs Exp $
* $Author: szabolcs $
* $Revision: 1.4 $
*
* Facade for correlating events persitence operations
*/
public interface CorrelatingEventsPersistenceService {
// ========== correlated events stuff ===========
/**
* @return List with Correlated Events
*/
public List getCorrelatedevents();
/**
* @return List with Correlated Events using pagination
*/
public List getCorrelatedeventsByPage(int pageNumber, int pageSize);
/**
* @param id Correlated events id
* @return Correlated event
*/
public Correlatedevent getCorrelatedevent(Integer id);
/**
* @param correlatedEvent Correlatedevent to save
*/
public void saveCorrelatedevent(Correlatedevent correlatedEvent);
/**
* @param correlatedEvent Correlatedevent to update
*/
public void updateCorrelatedevent(Correlatedevent correlatedEvent);
/**
* @param id Correlated events id to remove
*/
public void removeCorrelatedevent(Integer id);
// ========== correlated set stuff ===========
/**
* @return List with Correlated Sets
*/
public List getCorrelatedset();
/**
* @param id Correlated sets id
* @return Correlatedset
*/
public Correlationset getCorrelatedset(Integer id);
/**
* @param correlatedSet Correlatedevent to save
*/
public void saveCorrelatedset(Correlationset correlatedSet);
/**
* @param correlatedEvent Correlatedevent to update
*/
public void updateCorrelatedset(Correlationset correlatedSet);
/**
* @param id Correlated sets id to remove
*/
public void removeCorrelatedset(Integer id);
/**
* Returns a list with correlatedsets according to the given guid
*
* @param guid
* @return List with correlatedsets or null if nothing found
*/
public List getCorrelatedsetByGuid (String guid);
/**
* Returns a list with correlatedsets according to the given eventid
*
* @param guid
* @return List with correlatedsets or null if nothing found
*/
public List getCorrelatedsetByEvent (Long eventid);
/**
* Creates a list of all occuring correlationsettypes
* @return List with unique correlation types
*/
public List getCorrelationsSetTypes ();
/**
* Returns a List of Correlatedevent objects using paging
*
* @return List with Correlated Events using pagination
*/
public List getCorrelatedSetByPage(int pageNumber, int pageSize);
// ========== Getters and Setters ===========
/**
* @return Returns the correlatedEventDAO.
*/
public CorrelatedeventDAO getCorrelatedEventDAO();
/**
* @param correlatedEventDAO The correlatedEventDAO to set.
*/
public void setCorrelatedEventDAO(CorrelatedeventDAO correlatedEventDAO);
/**
* @return Returns the correlatedSetDAO.
*/
public CorrelatedsetDAO getCorrelatedSetDAO();
/**
* @param correlatedSetDAO The correlatedSetDAO to set.
*/
public void setCorrelatedSetDAO(CorrelatedsetDAO correlatedSetDAO);
} | [
"szabolcs"
] | szabolcs |
391d47dc1d65b33fbbc44f5ffcd675dc2d1331ab | 526d0a4333f1fd34566fbd15300b3d74e1df37ad | /src/main/java/com/jetbuild/social/stream/StreamServiceImpl.java | 8bab3b83141a39fe2fd49b299d04bb02efef04ac | [] | no_license | gsharma/jetbuild-server | 903634108aab91e8bcb8699fb3902122bd25ea75 | f351650c56badce95c7d84a2b39b29cd28e21959 | refs/heads/master | 2020-12-24T13:35:46.844634 | 2012-05-03T08:02:32 | 2012-05-03T08:02:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,185 | java | package com.jetbuild.social.stream;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.jetbuild.social.model.Account;
import com.jetbuild.social.model.Comment;
@Component("stream-service")
public class StreamServiceImpl implements StreamService {
@Autowired
private StreamDAO streamDAO;
@Override
public List<Comment> getComments(String username) {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Comment> getInbox(Account account) {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Comment> getMentions(String username) {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Comment> getThread(String threadId) {
// TODO Auto-generated method stub
return null;
}
@Override
public void postNewComment(Comment comment) {
// TODO Auto-generated method stub
}
@Override
public void replyToComment(Comment comment) {
// TODO Auto-generated method stub
}
}
| [
"gaurav.cs.sharma@gmail.com"
] | gaurav.cs.sharma@gmail.com |
6316a80ebe4fe791bbb11cf9cbb819cf502d66bb | b05eb308af1af8b7216c282bd8b0ef0ee4fd5cbd | /scp/scp-cmd-cygl/src/main/java/com/scp/cmd/cygl/ws/ModifyUserRequest.java | 4f26aaa944d5f67a763fe17e4b7bb336ac430458 | [] | no_license | zaizhuzhu123/scp-cygl | 8de708ddfc246c75ea18f60e3401c364ff5e31f0 | dde14702107ab4fd6558ef1f7353042617d6a6b3 | refs/heads/master | 2020-03-23T01:25:16.536398 | 2018-07-20T01:44:05 | 2018-07-20T01:44:05 | 140,916,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,191 | java | //
// 此文件是由 JavaTM Architecture for XML Binding (JAXB) 引用实现 v2.2.7 生成的
// 请访问 <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// 在重新编译源模式时, 对此文件的所有修改都将丢失。
// 生成时间: 2018.07.18 时间 07:33:16 PM CST
//
package com.scp.cmd.cygl.ws;
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.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>anonymous complex type的 Java 类。
*
* <p>以下模式片段指定包含在此类中的预期内容。
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="userInfo" type="{http://www.cygl.cmd.scp.com/ws}userInfo" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"userInfo"
})
@XmlRootElement(name = "modifyUserRequest")
public class ModifyUserRequest {
@XmlElement(nillable = true)
protected List<UserInfo> userInfo;
/**
* Gets the value of the userInfo 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 userInfo property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getUserInfo().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link UserInfo }
*
*
*/
public List<UserInfo> getUserInfo() {
if (userInfo == null) {
userInfo = new ArrayList<UserInfo>();
}
return this.userInfo;
}
}
| [
"651857512@qq.com"
] | 651857512@qq.com |
7879f467db79ac5a94b8a2c6cea585f0b4425101 | ea3024547bb286ccedc11c0d1c71ef4d4788bff6 | /src/java/ru/ifmo/genetics/distributed/util/Compress.java | 4f00a0da82870e53b92dfd6923637a458b9fcccd | [
"MIT"
] | permissive | ctlab/itmo-assembler | befd44df5e30c6b11cf531e5c89d68e98f936293 | 163177494fa08c50f056ab219bd626a0130ab338 | refs/heads/master | 2022-04-30T06:08:15.660730 | 2022-03-22T08:08:55 | 2022-03-22T08:08:55 | 136,324,827 | 3 | 1 | MIT | 2019-09-09T07:22:42 | 2018-06-06T12:21:50 | Java | UTF-8 | Java | false | false | 574 | java | package ru.ifmo.genetics.distributed.util;
import org.apache.hadoop.io.compress.GzipCodec;
import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.JobConf;
/**
* Author: Sergey Melnikov
*/
public class Compress {
private Compress() {
}
public static void enableFullCompression(JobConf conf) {
FileOutputFormat.setCompressOutput(conf, true);
FileOutputFormat.setOutputCompressorClass(conf, GzipCodec.class);
conf.setCompressMapOutput(true);
conf.setMapOutputCompressorClass(GzipCodec.class);
}
}
| [
"svkazakov@rain.ifmo.ru"
] | svkazakov@rain.ifmo.ru |
63201edfddb48e2d3034fd16bbf421ff84ee4932 | ab07f638ec2edbb7aaa8d794f50435a5f83353ce | /mall-user/mall-user-api/src/main/java/com/jxufe/mall/user/api/constants/ResponseCodeEnum.java | 3973e41cd244881fbd7425cbba8428cb2c1590e9 | [] | no_license | TreasureLX/mall | 1a0ff8ee6717b5406dd214610936d163f6019d2f | d276fcc738ddd8da253422fb343c26f214135a3a | refs/heads/master | 2020-03-24T16:01:45.091228 | 2018-07-30T01:42:16 | 2018-07-30T01:42:16 | 142,809,761 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 773 | java | package com.jxufe.mall.user.api.constants;
/**
* 腾讯课堂搜索 咕泡学院
* 加群获取视频:608583947
* 风骚的Michael 老师
*/
public enum ResponseCodeEnum {
USERORPASSWORD_ERRROR("001001","用户名或密码不存在"),
SUCCESS("000000","成功"),
SYS_PARAM_NOT_RIGHT("001002","请求参数错误"),
TOKEN_EXPIRE("001003","token过期"),
SIGNATURE_ERROR("001004","签名验证失败"),
SYSTEM_BUSY("001099","系统繁忙,请稍候重试");
private final String code;
private final String msg;
ResponseCodeEnum(String code, String msg) {
this.code = code;
this.msg = msg;
}
public String getCode() {
return code;
}
public String getMsg() {
return msg;
}
}
| [
"1130876885@qq.com"
] | 1130876885@qq.com |
ceec09b7065378618d5da70aca5b8bfdaebdb770 | 0e557dd60a322e918700feea6ce12d3e16b0f75e | /src/main/java/com/pizzeria/domain/ingredientdomain/IngredientRepositoryRead.java | f3665c91e6c3936a83e64229929911686b5a64c8 | [] | no_license | sergiolarrion/BackendPizzeriaSpring | eb19955a4b8ab492a0b62b5912cb5ba99b6dc22d | 51029c36201872926a5d724e3de9ad2c05ee4755 | refs/heads/main | 2023-07-12T19:19:55.122601 | 2021-09-01T09:44:48 | 2021-09-01T09:44:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 197 | java | package com.pizzeria.domain.ingredientdomain;
import java.util.List;
public interface IngredientRepositoryRead {
public List<IngredientProjection> getAll (String name, int page, int size);
}
| [
"acclaim1@hotmail.com"
] | acclaim1@hotmail.com |
d79f1238995585cbccbe2f52c402c5be701f7b56 | 7b16528786586d26c94b521f4bb36aef69f91482 | /src/test/java/aulasangelica/steps/ComponentesSteps.java | 6c31cd91f5dc516043a2f796804a8c37341ac55a | [] | no_license | leonardoduarte1305/Cucumber-Faculdade-UdemyFINALIZADO | 8f2790c0af268104ec273fa8d6a67ea065ef0b60 | 7dc52894393164f472ad90c479f6575f09017679 | refs/heads/master | 2023-04-12T20:54:42.809149 | 2021-05-19T14:55:31 | 2021-05-19T14:55:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,043 | java | package aulasangelica.steps;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import aulasangelica.utils.Componentes;
import io.cucumber.java.AfterStep;
import io.cucumber.java.pt.Dado;
import io.cucumber.java.pt.Entao;
import io.cucumber.java.pt.Quando;
public class ComponentesSteps {
private Componentes componente = new Componentes();
private WebDriver driver = new ChromeDriver();
private String arquivo = "componentes.html";
@AfterStep
public void fecharBrowser() {
driver.quit();
}
// @Dado("que o usuario acessou o arquivo Campo de Treinamento")
// public void queOUsuarioAcessouOArquivoCampoDeTreinamento() {
// componente.inicializar(arquivo);
// }
@Quando("o usuario digitar Batatinha")
public void oUsuarioDigitarBatatinha() {
componente.testeTextField();
}
@Entao("o resultado no campo text area deve ser Batatinha")
public void oResultadoNoCampoTextFieldDeveSerBatatinha() {
componente.testeTextArea();
driver.close();
}
@Quando("o usuario clicar no RadioButton")
public void oUsuarioClicarNoRadioButton() {
componente.testeRadioButton();
}
@Quando("o usuario clicar no CheckBox")
public void oUsuarioClicarNoCheckBox() {
componente.testeCheckBox();
}
@Quando("o usuario selecionar um valor no elemento combo")
public void oUsuarioSelecionarUmValorNoElementoCombo() {
componente.selecionarValorComboEscolaridade();
}
@Entao("o valor aparece selecionado")
public void ooValorApareceSelecionado() {
componente.validarComboBoxEscolaridade();
driver.close();
}
@Quando("o usuario selecionar um valor no combo")
public void oUsuarioSelecionarUmValorNoCombo() {
componente.selecionarValorComboPeloTextoEscolaridade();
}
@Entao("o valor selecionado deve ser apresentado")
public void oValorSelecionadoDeveSerApresentado() {
componente.validarValorComboPeloTextoEscolaridade();
driver.close();
}
@Quando("o usuario selecionar Mestrado no combo")
public void oUsuarioSelecionarMestradoNoCombo() {
componente.selecionarMestradoNoCombo();
}
@Entao("o Mestrado deve estar selecionado")
public void oMestradoDeveSerSelecionado() {
componente.verificaSeMestradoEstaSelecionado();
driver.close();
}
@Quando("o usuario selecionar Mestrado")
public void oUsuarioSelecionarMestrado() {
componente.selecionarMestrado();
}
@Entao("a opcao Mestrado deve estar selecionada")
public void aOpcaoMestradoDeveEstarSelecionada() {
componente.verificarSeMestradoEstaSelecionado();
}
@Quando("o usuario selecionar um elemento campo de multipla escolha")
public void oUsuarioSelecionarUmElementoCampoDeMultiplaEscolha() {
componente.selecionarComboMultiplaEscolha();
}
@Entao("o valor deve aparecer selecionado no elemento combobox")
public void oValorDeveAparecerSelecionadoNoElementoCombobox() {
componente.verificarSeOValorApareceSelecionado();
}
@Quando("o usuario clicar no botao Clique Me")
public void oUsuarioClicarNoBotaoCliqueMe() {
componente.clicarNoBotaoCliqueMe();
}
@Entao("o nome do botao deve ser alterado para Obrigado!")
public void oNomeDoBotaoDeveSerAlteradoParaObrigado() {
componente.verificarOBotaoCliqueMeAposOClique();
}
@Quando("o usuario clicar no botao alert")
public void oUsuarioClicarNoBotaoAlert() {
componente.clicarNoAlert();
}
@Entao("deve aparecer a mensagem de feedback Alert simples")
public void deveAparecerAMensagemDeFeedbackAlertSimples() {
componente.verificarMensagem();
}
@Quando("o usuario clicar no botao Confirm")
public void oUsuarioClicarNoBotaoConfirm() {
componente.clicarNoBotaoConfirm();
}
@Entao("deve aparecer a mensagem de feedback Confirm Simples")
public void deveAparecerAMensagemDeFeedbackConfirmSimples() {
componente.verificarMensagemDeConfirmSimples();
}
@Entao("deve clicar em Ok")
public void deveClicarEmOk() {
componente.clicarEmOk();
}
@Entao("deve aparecer a mensagem de feedback Confirmado")
public void deveAparecerAMensagemDeFeedbackConfirmado() {
componente.verificarMensagemDeConfirm();
}
}
| [
"leonardoduarte1305@gmail.com"
] | leonardoduarte1305@gmail.com |
6f4a5349088bd9272738f7c4535659efd08711fd | b74e687017636540075fd4a98f4edf2073291855 | /graphql-maven-plugin-samples/graphql-maven-plugin-samples-StarWars-client/src/main/java/com/graphql_java_generator/mavenplugin/samples/simple/client/Queries.java | 40e469dd07819957d53b9c0f0711b760ac95189e | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | sullis/graphql-maven-plugin-project | 4a26292410f927304285808e69c3265965a2932d | de31466b3000b10ff096b107c6f99dcb4cbb5421 | refs/heads/master | 2020-06-28T05:06:57.290251 | 2019-07-18T11:48:43 | 2019-07-18T11:48:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,666 | java | package com.graphql_java_generator.mavenplugin.samples.simple.client;
import com.generated.graphql.Character;
import com.generated.graphql.Droid;
import com.generated.graphql.Human;
import com.graphql_java_generator.client.response.GraphQLExecutionException;
import com.graphql_java_generator.client.response.GraphQLRequestPreparationException;
public interface Queries {
// First part: queries
Character heroFull() throws GraphQLExecutionException, GraphQLRequestPreparationException;
Character heroPartial() throws GraphQLExecutionException, GraphQLRequestPreparationException;
Character heroFriendsFriendsFriends() throws GraphQLExecutionException, GraphQLRequestPreparationException;
Human humanFull() throws GraphQLExecutionException, GraphQLRequestPreparationException;
Human humanPartial() throws GraphQLExecutionException, GraphQLRequestPreparationException;
Human humanFriendsFriendsFriends() throws GraphQLExecutionException, GraphQLRequestPreparationException;
Droid droidFull() throws GraphQLExecutionException, GraphQLRequestPreparationException;
Droid droidPartial() throws GraphQLExecutionException, GraphQLRequestPreparationException;
Droid droidFriendsFriendsFriends() throws GraphQLExecutionException, GraphQLRequestPreparationException;
Droid droidDoesNotExist() throws GraphQLExecutionException, GraphQLRequestPreparationException;
// Second part: mutations
Human createHuman(String name, String homePlanet)
throws GraphQLExecutionException, GraphQLRequestPreparationException;
Character addFriend(String idCharacter, String idNewFriend)
throws GraphQLExecutionException, GraphQLRequestPreparationException;
} | [
"etienne_sf@users.sf.net"
] | etienne_sf@users.sf.net |
b952894d21b544633db181b622149dd4eb79aa6e | 3ec0c428ec872d60b6720190fddffba84d94520e | /src/main/java/br/com/zupacademy/armando/mercadolivre/fakers/NotifyRankingSellerController.java | 19c945c82797be94851be8cb8ab6feaaf73bc539 | [
"Apache-2.0"
] | permissive | armandodelcol-coder/orange-talents-05-template-mercado-livre | c9f6a54c85fa2cec8e4f1e77733204449924a5e9 | eb4cffce2ac9ba5ba75afe00fb7616a9ae8bef9f | refs/heads/main | 2023-05-13T00:58:14.872786 | 2021-06-01T15:42:37 | 2021-06-01T15:42:37 | 370,341,970 | 0 | 0 | Apache-2.0 | 2021-05-24T12:19:49 | 2021-05-24T12:19:49 | null | UTF-8 | Java | false | false | 599 | java | package br.com.zupacademy.armando.mercadolivre.fakers;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class NotifyRankingSellerController {
@PostMapping("/api/notifica-ranking-sellers")
public void send(@RequestBody NotifyRankingSellerRequest notifyRankingSellerRequest) {
System.out.println("Notificação enviada para a equipe de marketing");
System.out.println(notifyRankingSellerRequest.toString());
}
}
| [
"atdc.codemaster@gmail.com"
] | atdc.codemaster@gmail.com |
04bbcd8a449fcb926bb556fba79377715c3d7c57 | 85520d2425db0d0a4ad5c501149a31905c49c754 | /src/main/java/dk/statsbiblioteket/dpaviser/qatool/Main.java | 3548c8075a9b57c6719983bd1ef119c7fd8a006e | [
"Apache-2.0"
] | permissive | kb-dk/dpaviser-qa-tool | 0058b46b0e16e758490ed727a14a8643b5ce848f | 2c3e61c3f21dcc5f7458c954e22f8b815b1d4423 | refs/heads/master | 2021-07-24T12:28:11.100470 | 2021-07-01T08:46:31 | 2021-07-01T08:46:31 | 40,599,778 | 0 | 0 | Apache-2.0 | 2021-07-01T08:46:58 | 2015-08-12T12:38:02 | Java | UTF-8 | Java | false | false | 7,313 | java | package dk.statsbiblioteket.dpaviser.qatool;
import dk.statsbiblioteket.dpaviser.BatchStructureCheckerComponent;
import dk.statsbiblioteket.dpaviser.metadatachecker.MetadataCheckerComponent;
import dk.statsbiblioteket.medieplatform.autonomous.Batch;
import dk.statsbiblioteket.medieplatform.autonomous.ConfigConstants;
import dk.statsbiblioteket.medieplatform.autonomous.ResultCollector;
import dk.statsbiblioteket.medieplatform.autonomous.RunnableComponent;
import dk.statsbiblioteket.util.Strings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Properties;
import static dk.statsbiblioteket.medieplatform.autonomous.ConfigConstants.AT_NINESTARS;
import static dk.statsbiblioteket.medieplatform.autonomous.ConfigConstants.AUTONOMOUS_BATCH_STRUCTURE_STORAGE_DIR;
import static dk.statsbiblioteket.medieplatform.autonomous.ConfigConstants.ITERATOR_FILESYSTEM_BATCHES_FOLDER;
import static dk.statsbiblioteket.medieplatform.autonomous.ConfigConstants.THREADS_PER_BATCH;
public class Main {
private Logger log; // initialized in doMain(...)
public static void main(String[] args) {
try {
System.exit(new Main().doMain(args));
} catch (Throwable e) {
e.printStackTrace(System.err);
System.exit(1);
}
}
/**
* Create a properties construct with just one property, "scratch". Scratch denotes the folder where the batches
* reside. It is takes as the parent of the first argument, which should be the path to the batch
*
* @param batchPath the path to the batch
* @return a properties construct
* @throws RuntimeException on trouble parsing arguments.
*/
private static Properties createProperties(String batchPath) throws IOException {
Properties properties = new Properties(System.getProperties());
File batchFile = new File(batchPath);
setIfNotSet(properties, ITERATOR_FILESYSTEM_BATCHES_FOLDER, batchFile.getParent());
setIfNotSet(properties, AT_NINESTARS, Boolean.TRUE.toString());
setIfNotSet(properties, AUTONOMOUS_BATCH_STRUCTURE_STORAGE_DIR, createTempDir().getAbsolutePath());
setIfNotSet(properties, THREADS_PER_BATCH, Runtime.getRuntime().availableProcessors() + "");
/*
PDF files are datafiles going into BitMagasinet. Non-datafiles go in DOMS.
*/
setIfNotSet(properties, ConfigConstants.ITERATOR_DATAFILEPATTERN, ".*\\.pdf$");
setIfNotSet(properties, ConfigConstants.ITERATOR_FILESYSTEM_GROUPINGCHAR, ".");
setIfNotSet(properties, ConfigConstants.ITERATOR_FILESYSTEM_CHECKSUMPOSTFIX, ".md5");
setIfNotSet(properties, ConfigConstants.ITERATOR_FILESYSTEM_IGNOREDFILES, "");
return properties;
}
private static File createTempDir() throws IOException {
File temp = File.createTempFile("dpaviser-qa-tool", "");
temp.delete();
temp.mkdir();
temp.deleteOnExit();
return temp;
}
private static void setIfNotSet(Properties properties, String key, String value) {
if (properties.getProperty(key) == null) {
properties.setProperty(key, value);
} else {
System.out.println(properties.getProperty(key));
}
}
private static ResultCollector runComponent(Batch batch,
RunnableComponent component1) {
//log.info("Preparing to run component {}", component1.getComponentName());
ResultCollector result1 = new ResultCollector(component1.getComponentName(), component1.getComponentVersion());
try {
component1.doWorkOnItem(batch, result1);
} catch (Exception e) {
//log.error("Failed to do work on component {}", component.getComponentName(), e);
result1.addFailure(batch.getFullID(),
"exception",
component1.getClass().getSimpleName(),
"Unexpected error in component: " + e.toString(),
Strings.getStackTrace(e));
}
return result1;
}
/**
* Parse the batch and round trip id from the first argument to the script
*
* @param batchDirPath the first command line argument
* @return the batch id as a batch with no events
*/
protected static Batch getBatch(String batchDirPath) {
File batchDirFile = new File(batchDirPath);
System.out.println("Looking at: " + batchDirFile.getAbsolutePath());
if (!batchDirFile.isDirectory()) {
throw new RuntimeException("Must have first argument as existing directory");
}
return new InfomediaBatch(batchDirFile.getName());
}
/**
* Print usage.
*/
private static void usage() {
System.err.print(
"Usage: \n" + "java " + Main.class.getName() + " <batchdirectory>");
System.err.println();
}
protected int doMain(String... args) {
if (args.length < 1) {
System.err.println("Too few parameters");
usage();
return 2;
}
// Launched outside appassembler script in IDE? Emulate behavior before starting logback!
if (System.getProperty("basedir") == null) {
// Find target/classes for the Maven module for _this_ class.
String path = getClass().getProtectionDomain().getCodeSource().getLocation().getPath();
File mavenModuleDir = new File(path, "../..");
File basedir = new File(mavenModuleDir, "target/appassembler");
System.setProperty("basedir", basedir.getAbsolutePath());
// ... and tell logback where to find its configuration file.
File logbackXML = new File(mavenModuleDir, "src/main/config/logback.xml");
System.setProperty("logback.configurationFile", logbackXML.getAbsolutePath());
}
// And NOW trigger logback initialization
log = LoggerFactory.getLogger(getClass());
log.info("Entered " + getClass());
String batchId = args[0];
Properties properties;
Batch batch;
try {
batch = getBatch(batchId);
properties = createProperties(batchId);
} catch (Exception e) {
usage();
e.printStackTrace(System.err);
return 2;
}
ResultCollector finalresult = processBatch(batch, properties);
System.out.println(finalresult.toReport());
if (!finalresult.isSuccess()) {
return 1;
} else {
return 0;
}
}
protected ResultCollector processBatch(Batch batch, Properties properties) {
ResultCollector result = new ResultCollector("batch", getClass().getPackage().getImplementationVersion());
Arrays.<RunnableComponent<Batch>>asList(
new LogNowComponent("Start"),
new BatchStructureCheckerComponent(properties),
new MetadataCheckerComponent(properties),
new LogNowComponent("Stop")
).stream().map(component -> runComponent(batch, component)).reduce(result, (a, next) -> next.mergeInto(a));
return result;
}
}
| [
"tra@statsbiblioteket.dk"
] | tra@statsbiblioteket.dk |
3b93fc6bc1c991b543e90c7e602f272c8fe2d8d9 | 9f0d519a5b25d95c8909c085f1a2e21a365d23de | /src/main/java/com/krt/sys/entity/Role.java | 619f253c55c588b81771edb56ca3871ef0a6cb04 | [] | no_license | Git-ELian/krt_ssm | e58e3d25c3b0a704ed1a754efb90fe3fcf9d35df | a1ab3c797453f773294c281850399fa7d061a134 | refs/heads/master | 2020-04-12T19:11:07.808298 | 2018-12-21T10:54:08 | 2018-12-21T10:54:08 | 162,701,900 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,574 | java | package com.krt.sys.entity;
import com.krt.common.base.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @author 殷帅
* @version 1.0
* @Description: 角色实体类
* @date 2016年5月20日
*/
@Getter
@Setter
@ToString(callSuper = true)
public class Role extends BaseEntity {
/**
* 角色名
*/
@NotBlank(message = "角色名不能为空")
private String name;
/**
* 角色编码
*/
@NotBlank(message = "角色编码不能为空")
private String code;
/**
* 状态 0:正常 1:禁用
*/
private String status;
/**
* 备注
*/
private String remark;
/**
* 排序
*/
@NotNull(message = "排序不能为空")
private Integer sortNo;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Integer getSortNo() {
return sortNo;
}
public void setSortNo(Integer sortNo) {
this.sortNo = sortNo;
}
} | [
"541650751@qq.com"
] | 541650751@qq.com |
a1a9060219520886935c1ee4e977ed2846bfa2e3 | 6ed0afe20f00943baefec93545f52eb0c5cc05b9 | /app/src/main/java/com/example/bluewagon/ecalculo/adapters/dashboardAccount/DashboardItemAdapter.java | 3318aea9689324ddd48eb80fb024dfe249132f83 | [] | no_license | Bijay06199/BlueWagon | 7bd0be944b5f1ccb48fa12b6cc85a512f15b8e7f | 5471dcff792cb5c7808c1a7062266c72e49ce3e5 | refs/heads/main | 2023-04-27T16:27:31.202002 | 2021-05-06T11:54:27 | 2021-05-06T11:54:27 | 364,891,987 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,445 | java | package com.example.bluewagon.ecalculo.adapters.dashboardAccount;
import android.app.AlertDialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.bluewagon.ecalculo.dtos.DashboardItemDTO;
import java.util.List;
public class DashboardItemAdapter extends RecyclerView.Adapter<DashboardItemAdapter.ViewHolder> {
private Context context;
private List<DashboardItemDTO> dashboardItemDTOList;
private LayoutInflater inflater;
private AlertDialog dialog;
public DashboardItemAdapter(Context context, List<DashboardItemDTO> dashboardItemDTOList) {
this.context = context;
this.dashboardItemDTOList = dashboardItemDTOList;
inflater = LayoutInflater.from(context);
System.out.println("size:::: " + dashboardItemDTOList.size());
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return null;
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return 0;
}
public static class ViewHolder extends RecyclerView.ViewHolder {
public ViewHolder(@NonNull View itemView) {
super(itemView);
}
}
}
| [
"bijaybastakoti111@gmail.com"
] | bijaybastakoti111@gmail.com |
80496800a119e15fafe8a109fa4983cf9f11bd36 | 6f6fef28105c4d5fb7b6959930d5b7ca74999719 | /src/com/glub/secureftp/wrapper/TCPWrapper.java | 6f821e206dac0df734f1476156b5f684fa1d5aff | [
"Apache-2.0"
] | permissive | reynand25/ftpswrap | 6c32bc8615aa90421ad114f69defde2dd9eb68f8 | 196e1e2273f325bc04d1361ab1115763e220c549 | refs/heads/master | 2021-02-19T04:48:03.074786 | 2013-07-27T14:28:53 | 2013-07-27T14:28:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,362 | java |
//*****************************************************************************
//*
//* (c) Copyright 2007. Glub Tech, Incorporated. All Rights Reserved.
//*
//* $Id: TCPWrapper.java 39 2009-05-11 22:50:09Z gary $
//*
//*****************************************************************************
package com.glub.secureftp.wrapper;
import java.io.*;
import java.net.*;
import java.util.*;
public class TCPWrapper extends HashMap {
public static final int UNSET = -1;
public static final int ALLOW = 0;
public static final int DENY = 1;
private ServerLogger logger = null;
private ServerInfo serverInfo = null;
private int status = UNSET;
private File inputFile = null;
public TCPWrapper( ServerInfo serverInfo, ServerLogger logger ) {
super();
this.serverInfo = serverInfo;
this.logger = logger;
initWrapper();
}
private void initWrapper() {
if ( serverInfo.getAllowFile() != null &&
serverInfo.getAllowFile().exists() ) {
status = ALLOW;
inputFile = serverInfo.getAllowFile();
}
else if ( serverInfo.getDenyFile() != null &&
serverInfo.getDenyFile().exists() ) {
status = DENY;
inputFile = serverInfo.getDenyFile();
}
if ( null != inputFile ) {
loadFile( inputFile );
(new TCPWrapperUpdate(this, inputFile)).start();
}
}
public boolean allow( InetAddress ip ) {
boolean result = false;
Object val = get( ip.getHostAddress() );
if ( status == UNSET ) {
result = true;
}
else if ( status == ALLOW ) {
result = val != null;
}
else if ( status == DENY ) {
result = val == null;
}
return result;
}
protected void loadFile( File inputFile ) {
clear();
try {
FileReader fileRead = new FileReader( inputFile );
BufferedReader read = new BufferedReader( fileRead );
String line = null;
logger.debug( "Loading IP ACLs...", ServerLogger.DEBUG2_LOG_LEVEL );
while( (line = read.readLine()) != null ) {
if ( line.trim().length() > 0 ) {
put( line, new Integer(1) );
if ( serverInfo.getLogLevel() >= ServerLogger.DEBUG3_LOG_LEVEL ) {
String statStr = "ALLOWING";
if ( status == DENY ) {
statStr = "DENYING";
}
logger.info( statStr + " IP: " + line);
}
}
}
}
catch ( FileNotFoundException fnfe ) {
logger.warning("IP control file not found: " +
inputFile.getAbsolutePath());
}
catch ( IOException ioe ) {
logger.warning( "Problem parsing IP control file: " + ioe.getMessage() );
}
}
}
class TCPWrapperUpdate extends Thread {
private TCPWrapper tcpd = null;
private File inputFile = null;
private long modTime = 0L;
private boolean running = true;
public TCPWrapperUpdate( TCPWrapper tcpd, File inputFile ) {
this.tcpd = tcpd;
this.inputFile = inputFile;
modTime = inputFile.lastModified();
}
public void run() {
while( running ) {
if ( null != inputFile && inputFile.lastModified() != modTime ) {
modTime = inputFile.lastModified();
tcpd.loadFile( inputFile );
}
try {
sleep( 20000 );
}
catch( InterruptedException ie ) {}
}
}
public void terminate() { running = false; }
}
| [
"gcohen@adobe.com"
] | gcohen@adobe.com |
d1789ebfada5e51a705710366417e19275e0140f | 4a2ed9dc31020165d8ff6789d21167f0d487aca9 | /dynomitemanager/src/main/java/com/netflix/dynomitemanager/sidecore/backup/SnapshotTask.java | a61560a25aa61016e871d9ad815e70b9e757d945 | [
"Apache-2.0"
] | permissive | rugby110/dynomite-manager | f69628fa0080924131ea66f1cb8e8ba9e2b5e495 | dfb2df9e073b9a8f232802778d3aea46460e1078 | refs/heads/master | 2020-06-14T03:31:55.530183 | 2016-08-15T18:37:33 | 2016-08-15T18:37:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,164 | java | /**
* Copyright 2016 Netflix, Inc.
*
* 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.netflix.dynomitemanager.sidecore.backup;
import static com.netflix.dynomitemanager.defaultimpl.DynomitemanagerConfiguration.LOCAL_ADDRESS;
import java.io.File;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.joda.time.DateTime;
import com.google.common.collect.Lists;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
import com.google.inject.name.Named;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.exceptions.JedisConnectionException;
import com.netflix.dynomitemanager.InstanceState;
import com.netflix.dynomitemanager.sidecore.IConfiguration;
import com.netflix.dynomitemanager.sidecore.ICredential;
import com.netflix.dynomitemanager.identity.InstanceIdentity;
import com.netflix.dynomitemanager.sidecore.scheduler.SimpleTimer;
import com.netflix.dynomitemanager.sidecore.scheduler.Task;
import com.netflix.dynomitemanager.sidecore.scheduler.TaskTimer;
import com.netflix.dynomitemanager.sidecore.storage.IStorageProxy;
import com.netflix.dynomitemanager.sidecore.utils.ThreadSleeper;
import com.netflix.dynomitemanager.sidecore.scheduler.CronTimer;
import com.netflix.dynomitemanager.sidecore.scheduler.CronTimer.DayOfWeek;
/**
* Task for taking snapshots
*/
@Singleton
public class SnapshotTask extends Task
{
public static final String TaskName = "SnapshotTask";
private static final Logger logger = LoggerFactory.getLogger(SnapshotTask.class);
private final ThreadSleeper sleeper = new ThreadSleeper();
private final ICredential cred;
private final InstanceIdentity iid;
private final InstanceState state;
private final IStorageProxy storageProxy;
private final Backup backup;
private final int storageRetries = 5;
@Inject
public SnapshotTask(IConfiguration config, InstanceIdentity id, ICredential cred, InstanceState state,
IStorageProxy storageProxy, Backup backup)
{
super(config);
this.cred = cred;
this.iid = id;
this.state = state;
this.storageProxy = storageProxy;
this.backup = backup;
}
public void execute() throws Exception
{
this.state.setFirstBackup(false);
if(!state.isRestoring() && !state.isBootstrapping()){
/** Iterate five times until storage (Redis) is ready.
* We need storage to be ready to dumb the data,
* otherwise we may backup older data. Another case,
* is that the thread that starts Dynomite has not
* started Redis yet.
*/
int i = 0;
for (i=0; i < this.storageRetries; i++){
if (!this.state.isStorageAlive()) {
//sleep 2 seconds to make sure Dynomite process is up, Storage process is up.
sleeper.sleepQuietly(2000);
}
else{
this.state.setBackingup(true);
/**
* Set the status of the backup to false every time we start a backup.
* This will ensure that prior to backup we recapture the status of the backup.
*/
this.state.setBackUpStatus(false);
// the storage proxy takes a snapshot or compacts data
boolean snapshot = this.storageProxy.takeSnapshot();
File file = null;
if(config.isAof()){
file = new File(config.getPersistenceLocation() + "/appendonly.aof");
}
else {
file = new File(config.getPersistenceLocation() + "/nfredis.rdb");
}
// upload the data to S3
if (file.length() > 0 && snapshot == true) {
DateTime now = DateTime.now();
DateTime todayStart = now.withTimeAtStartOfDay();
this.state.setBackupTime(todayStart);
if(this.backup.upload(file, todayStart)){
this.state.setBackUpStatus(true);
logger.info("S3 backup status: Completed!");
}
else{
logger.error("S3 backup status: Failed!");
}
}
else {
logger.warn("S3 backup: Redis AOF file length is zero - nothing to backup");
}
break;
}
}
if (i == this.storageRetries) {
logger.error("S3 backup Failed: Redis was not up after " + this.storageRetries + " retries");
}
this.state.setBackingup(false);
}
else {
logger.error("S3 backup Failed: Restore is happening");
}
}
@Override
public String getName()
{
return TaskName;
}
/**
* Returns a timer that enables this task to run on a scheduling basis defined by FP
* if the BackupSchedule == week, it runs on Monday
* if the BackupSchedule == day, it runs everyday.
* @return TaskTimer
*/
public static TaskTimer getTimer(IConfiguration config)
{
int hour = config.getBackupHour();
if (config.getBackupSchedule().equals("week")){
return new CronTimer(DayOfWeek.MON, hour, 1, 0);
}
return new CronTimer(hour, 1, 0);
}
}
| [
"iduckhd@hotmail.com"
] | iduckhd@hotmail.com |
85fa2b811d1c49f21ae16ec682f3c48169468e2c | 8e23a4b01c2bd50ee9b37e781a1f2e5f08737619 | /src/myshopinventory/Registration.java | 42ac2232b1bb76359d7b8bf02b38c80f01659744 | [] | no_license | kumaranindian/java_swing_application | 93380d05cbb91433eec42bd3fdca10e309630538 | 48c3f0fd07f1c2a5b0ab23011d1265ceb7150948 | refs/heads/master | 2022-08-31T08:19:58.417151 | 2020-05-27T11:38:29 | 2020-05-27T11:38:29 | 267,305,919 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,563 | 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 myshopinventory;
/**
*
* @author Karthikeyan
*/
public class Registration extends javax.swing.JDialog {
/**
* Creates new form Registra
*/
public Registration(java.awt.Frame parent, boolean modal) {
super(parent, modal);
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">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel2 = new javax.swing.JPanel();
lblRegistration = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
lblBrandName = new javax.swing.JLabel();
lblQuantity = new javax.swing.JLabel();
lblRate = new javax.swing.JLabel();
txtBrandName = new javax.swing.JTextField();
btnRegister = new javax.swing.JButton();
btnClear = new javax.swing.JButton();
txtAmount = new javax.swing.JTextField();
txtQuantity = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setMaximumSize(new java.awt.Dimension(400, 300));
setMinimumSize(new java.awt.Dimension(400, 300));
setPreferredSize(new java.awt.Dimension(400, 300));
jPanel2.setBackground(new java.awt.Color(0, 153, 204));
jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jPanel2.setMaximumSize(new java.awt.Dimension(100, 50));
jPanel2.setMinimumSize(new java.awt.Dimension(100, 50));
jPanel2.setPreferredSize(new java.awt.Dimension(100, 50));
jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
lblRegistration.setBackground(new java.awt.Color(0, 0, 255));
lblRegistration.setFont(new java.awt.Font("Calibri", 1, 24)); // NOI18N
lblRegistration.setForeground(new java.awt.Color(204, 0, 0));
lblRegistration.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
lblRegistration.setText("Registration");
jPanel2.add(lblRegistration, new org.netbeans.lib.awtextra.AbsoluteConstraints(124, 4, 130, 40));
getContentPane().add(jPanel2, java.awt.BorderLayout.PAGE_START);
jPanel1.setBackground(new java.awt.Color(0, 153, 204));
jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jPanel1.setMaximumSize(new java.awt.Dimension(100, 60));
jPanel1.setMinimumSize(new java.awt.Dimension(100, 60));
jPanel1.setPreferredSize(new java.awt.Dimension(100, 60));
jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
lblBrandName.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
lblBrandName.setText("Brand Name:");
jPanel1.add(lblBrandName, new org.netbeans.lib.awtextra.AbsoluteConstraints(55, 30, 80, -1));
lblQuantity.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
lblQuantity.setText("Quantity (in ml):");
jPanel1.add(lblQuantity, new org.netbeans.lib.awtextra.AbsoluteConstraints(55, 60, 80, -1));
lblRate.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
lblRate.setText("Rate (in Rs):");
jPanel1.add(lblRate, new org.netbeans.lib.awtextra.AbsoluteConstraints(55, 90, 80, -1));
jPanel1.add(txtBrandName, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 30, 180, -1));
btnRegister.setText("Register");
btnRegister.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnRegisterActionPerformed(evt);
}
});
jPanel1.add(btnRegister, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 120, 120, 20));
btnClear.setText("Clear");
jPanel1.add(btnClear, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 120, 120, 20));
jPanel1.add(txtAmount, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 90, 180, -1));
jPanel1.add(txtQuantity, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 60, 180, -1));
getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnRegisterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRegisterActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_btnRegisterActionPerformed
/**
* @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(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
/* Create and display the dialog */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
Registration dialog = new Registration(new javax.swing.JFrame(), true);
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
}
});
dialog.setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnClear;
private javax.swing.JButton btnRegister;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JLabel lblBrandName;
private javax.swing.JLabel lblQuantity;
private javax.swing.JLabel lblRate;
private javax.swing.JLabel lblRegistration;
private javax.swing.JTextField txtAmount;
private javax.swing.JTextField txtBrandName;
private javax.swing.JTextField txtQuantity;
// End of variables declaration//GEN-END:variables
}
| [
"ckarthikeyan60@yahoo.in"
] | ckarthikeyan60@yahoo.in |
8ae1bdbb5f69ce967d7bb026251b9c5aee26a98f | bbf1d8a2c616970483dc7a2cf4ad7200ef64b9f5 | /src/main/java/com/fuerve/villageelder/configuration/PropertyHandler.java | 3bb338350cc24d6c684bb1e01822e866e9c06963 | [
"Apache-2.0"
] | permissive | fuerve/VillageElder | 0728f49a87536c14c181ce4632e9e6369b0bf3b6 | fe2399d0361c24724304fdac261f5375a86ca5d9 | refs/heads/master | 2021-01-10T20:13:15.526967 | 2014-06-28T23:39:51 | 2014-06-28T23:39:51 | 9,740,584 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,214 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.fuerve.villageelder.configuration;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import com.fuerve.villageelder.configuration.types.TypedProperty;
/**
* This abstract base class provides the underlying mechanism for
* loading properties in a way that makes it relatively easy to
* extend and modify the set of properties to be loaded at
* runtime.
*
* @author lparker
*
*/
public abstract class PropertyHandler {
private static final String DEFAULT_PROPERTY_FILE =
"/VillageElder.properties";
private String propertyFilename;
private boolean propertyFileOnClassPath = true;
private Reader propertySource;
private Map<String, TypedProperty<?>> propertyMap;
/**
* Initializes a new instance of PropertyHandler, which
* will load from a default properties file. This default
* properties file should be on the class path and named
* VillageElder.properties. If this file does not exist,
* an exception will result.
*/
public PropertyHandler() {
propertyFilename = DEFAULT_PROPERTY_FILE;
}
/**
* Initializes a new instance of PropertyHandler with a
* pathname to a properties file. This pathname should
* be absolute.
* @param ppropertyFilename The path of the properties file.
*/
public PropertyHandler(final String ppropertyFilename) {
propertyFilename = ppropertyFilename;
propertyFileOnClassPath = false;
}
/**
* Initializes a new instance of PropertyHandler with a property
* source. This will usually be from a file on disk, but could
* be from anywhere.
* @param ppropertySource The property source, in Java properties
* format.
*/
public PropertyHandler(final Reader ppropertySource) {
propertySource = ppropertySource;
}
/**
* Requests that a property be initialized as part of the property
* set. These properties are strongly-typed properties that
* support defaults and custom parsing interaction.
* @param key The name of the property.
* @param property The property itself, which should be a
* descendent of TypedProperty with a specific type parameter.
*/
protected void requestProperty(final String key, final TypedProperty<?> property) {
if (propertyMap == null) {
propertyMap = new HashMap<String, TypedProperty<?>>();
}
if (property == null) {
throw new IllegalArgumentException("Tried to request a null property");
}
propertyMap.put(key, property);
}
/**
* Gets the value of a property, if the property exists and
* has a value.
* @param key The name of the property to retrieve.
* @return The value of the property, or null if no such
* property exists.
*/
@SuppressWarnings("unchecked")
public <T> TypedProperty<T> get(final String key) {
TypedProperty<?> property = propertyMap.get(key);
return (TypedProperty<T>) property;
}
/**
* Triggers the loading of properties from the properties
* stream.
* @throws IOException A fatal error occurred while interacting
* with the properties stream.
*/
public void load() throws IOException {
if (propertySource == null && propertyFilename != null) {
if (propertyFileOnClassPath) {
propertySource = new InputStreamReader(
this.getClass().getResourceAsStream(propertyFilename)
);
} else {
propertySource = new FileReader(
new File(propertyFilename)
);
}
}
PropertyLoader loader = new PropertyLoader(propertySource);
loader.loadProperties();
}
/**
* This class handles the low-level interaction of loading properties
* from the stream and interacting with the strongly-typed property
* system.
*
* @author lparker
*
*/
private class PropertyLoader {
private Reader source;
private Properties properties;
/**
* Initializes a new instance of PropertyLoader with a source stream.
* @param ssource The source, in Java properties format.
*/
public PropertyLoader(final Reader ssource) {
properties = new Properties();
source = ssource;
}
/**
* Loads the properties from a stream and sets the appropriate
* requested values.
* @throws IOException A fatal exception occurred while interacting
* with the properties source stream.
*/
public void loadProperties() throws IOException {
properties.load(source);
if (propertyMap == null) {
// No properties were requested, so there's no need to sweat it.
propertyMap = new HashMap<String, TypedProperty<?>>();
}
for(Entry<Object, Object> property : properties.entrySet()) {
TypedProperty<?> typedProperty = propertyMap.get(property.getKey());
if (typedProperty == null) {
continue;
} else {
typedProperty.doParse((String) property.getValue());
}
}
}
}
} | [
"fuerve@yahoo.com"
] | fuerve@yahoo.com |
c8a2f44ce314e666745f7065c60117f66ecb7c87 | 42e6e7f98090236e416112efafbedd26f9bdb169 | /src/main/java/net/mrscauthd/boss_tools/procedures/RocketOverlyYMarsmainProcedure.java | 624e2606dbd907de50de75190c034ba0f1f01264 | [] | no_license | Romaindu35/Space-Bosstools | 77fe4ef0c416be7e2193406a953c8a6b0abcb00e | 28ed6def84589578fecaf53c71c0df398108287f | refs/heads/master | 2023-03-08T22:39:40.526151 | 2021-03-12T09:20:01 | 2021-03-12T09:20:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,881 | java | package net.mrscauthd.boss_tools.procedures;
import net.mrscauthd.boss_tools.entity.RocketTier3Entity;
import net.mrscauthd.boss_tools.entity.RocketTier2Entity;
import net.mrscauthd.boss_tools.entity.RocketEntity;
import net.mrscauthd.boss_tools.BossToolsModElements;
import net.mrscauthd.boss_tools.BossToolsMod;
import net.minecraft.world.World;
import net.minecraft.world.IWorld;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.RegistryKey;
import net.minecraft.entity.Entity;
import java.util.Map;
@BossToolsModElements.ModElement.Tag
public class RocketOverlyYMarsmainProcedure extends BossToolsModElements.ModElement {
public RocketOverlyYMarsmainProcedure(BossToolsModElements instance) {
super(instance, 705);
}
public static boolean executeProcedure(Map<String, Object> dependencies) {
if (dependencies.get("entity") == null) {
if (!dependencies.containsKey("entity"))
BossToolsMod.LOGGER.warn("Failed to load dependency entity for procedure RocketOverlyYMarsmain!");
return false;
}
if (dependencies.get("world") == null) {
if (!dependencies.containsKey("world"))
BossToolsMod.LOGGER.warn("Failed to load dependency world for procedure RocketOverlyYMarsmain!");
return false;
}
Entity entity = (Entity) dependencies.get("entity");
IWorld world = (IWorld) dependencies.get("world");
if (((world instanceof World ? (((World) world).getDimensionKey()) : World.OVERWORLD) == (RegistryKey.getOrCreateKey(Registry.WORLD_KEY,
new ResourceLocation("boss_tools:mars"))))) {
if ((((entity.getRidingEntity()) instanceof RocketEntity.CustomEntity)
|| (((entity.getRidingEntity()) instanceof RocketTier2Entity.CustomEntity)
|| ((entity.getRidingEntity()) instanceof RocketTier3Entity.CustomEntity)))) {
return (true);
}
}
return (false);
}
}
| [
"unconfigured@null.spigotmc.org"
] | unconfigured@null.spigotmc.org |
a2698c02207e64679ac84026019ff9157b11487e | 9580f93f4bb591343ea2b652a902a6a541b89738 | /etl-file/src/main/java/cc/changic/platform/etl/file/exec/CmdExecResultHandler.java | e8af37a0c30210c904e33ca34439eceeb07c12a8 | [] | no_license | PandaZh/etl | da430da5a1a404d47cfaae81d957432cc64793ed | b6e9cf35ebe6651f037faf4575f5a442d0ae2adf | refs/heads/master | 2021-01-18T21:17:12.611800 | 2016-03-28T11:11:01 | 2016-03-28T11:11:01 | 29,386,030 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,260 | java | package cc.changic.platform.etl.file.exec;
import org.apache.commons.exec.DefaultExecuteResultHandler;
import org.apache.commons.exec.ExecuteException;
import org.apache.commons.exec.ExecuteWatchdog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 命令行执行结果处理类
* Created by Panda.Z on 2015/3/9.
*/
public class CmdExecResultHandler extends DefaultExecuteResultHandler {
private Logger logger = LoggerFactory.getLogger(CmdExecResultHandler.class);
private ExecuteWatchdog watchdog;
private String cmd;
public CmdExecResultHandler(final ExecuteWatchdog watchdog, final String cmd) {
this.watchdog = watchdog;
this.cmd = cmd;
}
@Override
public void onProcessComplete(final int exitValue) {
super.onProcessComplete(exitValue);
logger.info("CommandLine:[{}] execute successfully.", cmd);
}
@Override
public void onProcessFailed(final ExecuteException e) {
super.onProcessFailed(e);
if (watchdog != null && watchdog.killedProcess()) {
logger.error("CommandLine:[{}] execute timed out.", cmd);
} else {
logger.error("CommandLine:[{}] execute failed, message={}.", cmd, e.getMessage());
}
}
} | [
"panda.z.pro@gmail.com"
] | panda.z.pro@gmail.com |
4eb81bbeb307c61d41552aff2cd7423b60b3e30b | 5edac5da2a734471d8e36ab031dd02ae62d5035f | /openiam-pojo-intf/src/main/java/org/openiam/idm/srvc/pswd/dto/ValidatePasswordResetTokenResponse.java | ba325bdc7799e39fe5a60ef1cdbbb3304aef5454 | [] | no_license | ali-rezvani/openiam-idm-ce | 885a6eaf87147db4df2a1dab2e0ee6ec85407a3b | a15eaf2beaa9b0fee2085717f4b694e2f1257480 | refs/heads/master | 2021-01-18T17:11:25.251606 | 2014-05-19T04:17:12 | 2014-05-19T04:17:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,752 | java | /*
* Copyright 2009, OpenIAM LLC
* This file is part of the OpenIAM Identity and Access Management Suite
*
* OpenIAM Identity and Access Management Suite is free software:
* you can redistribute it and/or modify
* it under the terms of the GNU General Public License
* version 3 as published by the Free Software Foundation.
*
* OpenIAM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenIAM. If not, see <http://www.gnu.org/licenses/>. *
*/
/**
*
*/
package org.openiam.idm.srvc.pswd.dto;
import org.openiam.base.ws.Response;
import org.openiam.base.ws.ResponseStatus;
import org.openiam.idm.srvc.auth.dto.Login;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* Object representing a password in OpenIAM
*
* @author suneet
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ValidatePasswordResetTokenResponse", propOrder = {
"principal"
})
public class ValidatePasswordResetTokenResponse extends Response {
protected Login principal;
public ValidatePasswordResetTokenResponse() {
super();
}
public ValidatePasswordResetTokenResponse(ResponseStatus s) {
super(s);
}
public Login getPrincipal() {
return principal;
}
public void setPrincipal(Login principal) {
this.principal = principal;
}
}
| [
"suneet_shah@openiam.com"
] | suneet_shah@openiam.com |
57919ae1ff568f8b329522353a4c72d2eeda47e0 | bf4ada6a72769a8b4ee90807a6e267268df95b0d | /sendbox/app/src/main/java/com/example/rutil/sendbox/ActivityLogin.java | 02e1eabf39211f342430c7385609b1e3f963a97a | [] | no_license | angelsalascalvo/PMYDM | c47c3124a23382764a90733d9fa45eb809460fad | 998f9b8b0db6fae47e4a27144fc8da112cb4c7b9 | refs/heads/master | 2020-04-01T15:51:50.497383 | 2019-06-24T15:57:47 | 2019-06-24T15:57:47 | 153,355,371 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,881 | java | package com.example.rutil.sendbox;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.media.MediaPlayer;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.Toast;
import com.example.rutil.sendbox.Transportista.ActivityTranspor;
import com.example.rutil.sendbox.administrador.ActivityAdmin;
import com.example.rutil.sendbox.administrador.ActivityRegistro;
import com.google.android.gms.auth.api.Auth;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.android.gms.auth.api.signin.GoogleSignInResult;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.SignInButton;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthCredential;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.auth.GoogleAuthProvider;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.util.ArrayList;
public class ActivityLogin extends AppCompatActivity implements GoogleApiClient.OnConnectionFailedListener {
// Autenticacion ============================================
private GoogleApiClient googleApiClient;
private FirebaseAuth firebaseAuth;
private FirebaseAuth.AuthStateListener firebaseAuthListener;
private SignInButton signInButton;
private FirebaseUser user;
public static final int SIGN_IN_CODE = 777;
// Base de datos ============================================
private FirebaseDatabase baseDatos;
private ArrayList<String> uidAdmins = new ArrayList<String>(); //UID usuarios administradores
private ArrayList<String> uidTransp = new ArrayList<String>(); //UID usuarios transportistas
// Otros ====================================================
private boolean adminObtenidos, transpObtenidos, iniciado;
public static Context context;
private ProgressBar pbCargando;
private MediaPlayer mpLogin;
//----------------------------------------------------------------------------------------------
/**
* SOBRESCRITURA DEL METODO ONCREATE
* @param savedInstanceState
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
//Comprobar permisos
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1);
}
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, 1);
}
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.INTERNET) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.INTERNET}, 1);
}
//Iniciar variables
adminObtenidos=false;
transpObtenidos=false;
iniciado=false;
mpLogin = MediaPlayer.create(this, R.raw.login);
pbCargando = (ProgressBar) findViewById(R.id.pbCargando);
pbCargando.setVisibility(View.VISIBLE);
//Referencia a la base de datos
baseDatos = FirebaseDatabase.getInstance();
//Referencia al objeto de autenticacion de firebase
firebaseAuth = FirebaseAuth.getInstance();
//Se intenta obtener el usuario si esta logueado anteriormente
FirebaseUser user = firebaseAuth.getCurrentUser();
// Llamada a los metodos para obtener los diferentes usuarios
obtenerAdministradores();
obtenerTransportistas();
}
//----------------------------------------------------------------------------------------------
/**
* SOBRESCRITURA DEL METODO ONSTART
*/
@Override
protected void onStart() {
super.onStart();
//Añade el escuchador para obtener cuenta de firebase
if(firebaseAuthListener!=null)
firebaseAuth.addAuthStateListener(firebaseAuthListener);
}
//----------------------------------------------------------------------------------------------
/**
* SOBRESCRITURA DEL METODO ONSTOP
*/
@Override
protected void onStop() {
super.onStop();
//Quitamos el escuchador si estaba instanciado
if (firebaseAuthListener != null) {
firebaseAuth.removeAuthStateListener(firebaseAuthListener);
}
}
//----------------------------------------------------------------------------------------------
/**
* METODO PARA INICIAR LA FUNCIONALIDAD DEL ACTIVITY
*/
public void iniciar(){
//Se comprueba si ya esta logueado de anteriores sesiones
if(user!=null){
//Abrimos la activity correspondiente al usuario
siguienteActivity(user);
}
//Si no esta logueado, se abre el inicio de sesion con google (seleccion de cuenta)
else{
inicioSesion();
Log.d("eoee","ee");
}
}
//----------------------------------------------------------------------------------------------
/**
* METODO PARA INICIALIZAR Y LLAMAR ABRIR EL DIALOGO DE SELECCION DE CUENTAS DE GOOGLE PARA EL LOGUEO
*/
public void inicioSesion(){
//Ajustes de la ventana de inicio de sesion propia de google
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(getString(R.string.default_web_client_id))
.requestEmail()
.build();
//Ventana de inicio de sesion propia de google (Dialogo emergente)
googleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this, this)
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.build();
//Declarar boton iniciar
signInButton = (SignInButton) findViewById(R.id.signInButton);
//Boton Iniciar sesion, programar accion al pulsarlo
signInButton.setSize(SignInButton.SIZE_WIDE);
signInButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pbCargando.setVisibility(View.VISIBLE);
signInButton.setVisibility(View.GONE);
//Abrir el intent correspondiente con la ventana de inicio de sesion para seleccionar correo
Intent intent = Auth.GoogleSignInApi.getSignInIntent(googleApiClient);
startActivityForResult(intent, SIGN_IN_CODE);
}
});
//Objeto de escucha para obtener el usuario del listado de utenticacion de firebase
firebaseAuthListener = new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
FirebaseUser user = firebaseAuth.getCurrentUser();
if (user != null) {
siguienteActivity(user);
}else{
pbCargando.setVisibility(View.GONE);
signInButton.setVisibility(View.VISIBLE);
}
}
};
firebaseAuth.addAuthStateListener(firebaseAuthListener);
}
//----------------------------------------------------------------------------------------------
/**
* METODO QUE SE EJECUTA AL FINALIZAR LA VENTANA DE SELECCION DE CUENTA DE GOOGLE PARA EL INICIO DE SESION
* @param requestCode
* @param resultCode
* @param data
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
pbCargando.setVisibility(View.VISIBLE);
signInButton.setVisibility(View.GONE);
//Se comprueba si se ha obtenido el codigo enviado satisfactoriamente (requestCode)
if (requestCode == SIGN_IN_CODE) {
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
handleSignInResult(result);
}
}
//----------------------------------------------------------------------------------------------
/**
* SI SE OBTIENE BIEN LA CUENTA SE ASIGNA LA CUENTA SELECCIONADA AL LISTADO DE AUTENTICACION DE FIREBASE
* @param result
*/
private void handleSignInResult(GoogleSignInResult result) {
if (result.isSuccess()) {
//Llamada al metodo para agregar la cuenta al listado de firebase
firebaseAuthWithGoogle(result.getSignInAccount());
} else {
Toast.makeText(this, R.string.not_log_in, Toast.LENGTH_SHORT).show();
pbCargando.setVisibility(View.GONE);
signInButton.setVisibility(View.VISIBLE);
}
}
//----------------------------------------------------------------------------------------------
/**
* METODO PARA ALMACENAR LA CUENTA SELECCIONADA EN EL LISTADO DE FIREBASE AUTH
* @param signInAccount
*/
private void firebaseAuthWithGoogle(GoogleSignInAccount signInAccount) {
//Pasar el token para almacenar el usuario
AuthCredential credential = GoogleAuthProvider.getCredential(signInAccount.getIdToken(), null);
firebaseAuth.signInWithCredential(credential).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (!task.isSuccessful()) {
Toast.makeText(getApplicationContext(), R.string.not_firebase_auth, Toast.LENGTH_SHORT).show();
}
}
});
}
//----------------------------------------------------------------------------------------------
/**
* METODO ENCARGADO DE ABRIR EL SIGUIENTE INTENT DEPENDIENDO DEL TIPO DE USUARIO
* Si es administrador, transportista o aun no ha indicado sus datos.
* @param user
*/
private void siguienteActivity(FirebaseUser user) {
boolean admin = false;
boolean transp = false;
//Comprobar si el usuario es administrador
for(int i=0; i<uidAdmins.size();i++){
if(user.getUid().equals(uidAdmins.get(i)))
admin=true;
}
//Si no es administrador comprobar si esta registrado como transportista
if(!admin){
for(int i=0; i<uidTransp.size();i++){
if(user.getUid().equals(uidTransp.get(i)))
transp=true;
}
}
//Reproducir sonido
mpLogin.start();
//Iniciar activity segun el tipo de usuario
if(admin){
Intent i = new Intent(this, ActivityAdmin.class);
startActivity(i);
}else if(transp){
Intent i = new Intent(this, ActivityTranspor.class);
startActivity(i);
//En caso contrario se mostrará el activity de registro
}else{
Intent i = new Intent(this, ActivityRegistro.class);
startActivity(i);
}
}
//----------------------------------------------------------------------------------------------
/**
* METODO PARA OBTENER LOS UID DE LOS USUARIOS ADMINISTRADORES DE LA APLICACION
* Se almacenan en el array correspondiente
*/
public void obtenerAdministradores(){
final DatabaseReference administradores = baseDatos.getReference("administradores");
// Poner a la escucha el nodo de administradores
administradores.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
//Cuando se produce un cambio en el nodo, se actualiza en el ArrayList
uidAdmins=new ArrayList<String>();
for(DataSnapshot hijo : dataSnapshot.getChildren()) {
uidAdmins.add(hijo.getKey());
}
adminObtenidos=true;
//Al obtener los datos si se han obtenido los de transportistas
// y no se ha iniciado se inicia la funcionalidad
if(transpObtenidos && iniciado==false){
iniciar();
iniciado = true;
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
//----------------------------------------------------------------------------------------------
/**
* METODO PARA OBTENER LOS UID DE LOS TRANSPORTISTAS DE LA APLICACIÓN
* Se almacenan en el array correspondiente
*/
public void obtenerTransportistas(){
DatabaseReference transportistas = baseDatos.getReference("transportistas");
//Poner a la escucha el nodo de transportistas
transportistas.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
//Al producirse un cambio en un nodo obtenemos los identificadores de los usuarios
//transportistas y los almacenamos en el array.
uidTransp=new ArrayList<String>();
for(DataSnapshot hijo : dataSnapshot.getChildren()) {
uidTransp.add(hijo.getKey());
}
transpObtenidos=true;
//Al obtener los datos si se han obtenido los de administradores
// y no se ha iniciado se inicia la funcionalidad
if(adminObtenidos && iniciado==false){
iniciar();
iniciado = true;
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}
//----------------------------------------------------------------------------------------------
/**
* SOBRESCRITURA DEL METODO onConnectionFailed
* @param connectionResult
*/
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
}
//----------------------------------------------------------------------------------------------
/**
* METODO PARA OBTENER LA RESPUESTA A LA SOLICITUD DE PERMISOS
* @param requestCode
* @param permissions
* @param grantResults
*/
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
//Comprobar si se han aceptado los permisos
if(requestCode==1) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
} else {
finish(); //Finalizar ejecucion si no se aceptan
}
}
}
} | [
"angelsalascalvo@gmail.com"
] | angelsalascalvo@gmail.com |
a814104b3a5c39dfcc580ac6f68d714c2c172c25 | 896fabf7f0f4a754ad11f816a853f31b4e776927 | /opera-mini-handler-dex2jar.jar/cg.java | c043c7641af7e57e28dcc15a14b01d89f9a03a24 | [] | no_license | messarju/operamin-decompile | f7b803daf80620ec476b354d6aaabddb509bc6da | 418f008602f0d0988cf7ebe2ac1741333ba3df83 | refs/heads/main | 2023-07-04T04:48:46.770740 | 2021-08-09T12:13:17 | 2021-08-09T12:04:45 | 394,273,979 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 104,711 | java | import java.io.IOException;
import java.util.Random;
import java.io.OutputStream;
import java.io.DataOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.EOFException;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.Hashtable;
//
// Decompiled by Procyon v0.6-prerelease
//
public class cg
{
public static int A;
public static long B;
public static long C;
public static boolean Code;
public static boolean D;
public static int E;
protected static byte[] F;
protected static byte[] G;
static boolean H;
public static boolean I;
protected static boolean J;
static String[] K;
static boolean L;
static boolean M;
static boolean N;
static int O;
static String P;
static String Q;
static String R;
static int S;
static int T;
static boolean U;
static boolean V;
static byte W;
static Object X;
static byte[] Y;
protected static boolean Z;
public static int a;
private static int aA;
private static final Hashtable aB;
private static Integer aC;
static byte[] aa;
static byte[] ab;
protected static int ac;
protected static int ad;
public static au[] ae;
static int af;
private static int ag;
private static int ah;
private static boolean ai;
private static bv aj;
private static boolean ak;
private static int al;
private static long am;
private static long an;
private static long ao;
private static Object ap;
private static int[] aq;
private static int ar;
private static ak as;
private static int at;
private static int au;
private static int av;
private static int aw;
private static final byte[] ax;
private static final byte[] ay;
private static int az;
public static int b;
public static boolean c;
public static int d;
public static int e;
public static int f;
protected static int g;
public static boolean h;
public static String i;
public static int j;
protected static int k;
public static boolean l;
public static boolean m;
protected static int n;
protected static boolean o;
protected static boolean p;
protected static int q;
public static int r;
static boolean s;
static int t;
protected static int u;
public static boolean v;
public static char w;
public static boolean x;
public static boolean y;
public static boolean z;
static {
cg.C = 500000L;
cg.a = -1;
cg.b = 4;
cg.c = true;
cg.f = -1;
cg.j = -1;
cg.n = -1;
cg.q = 0;
cg.s = true;
cg.t = 2;
cg.u = 2;
cg.w = '*';
cg.ag = -1;
cg.ah = -1;
cg.A = 512;
cg.aj = new bv();
cg.ak = true;
cg.K = new String[4];
cg.ap = new Object();
cg.X = new Object();
ax = new byte[] { 34, 34, 35, 35, 37, 37, 39, 39 };
ay = new byte[] { 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 38, 38, 39, 39, 40, 40, 40, 40, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 65, 65, 65, 65, 66, 66, 66, 66, 67, 67, 67, 67, 68, 68, 68, 68, 69, 69, 69, 69, 70, 70, 70, 70, 71, 71, 71, 71, 72, 72, 73, 73, 74, 74, 74, 74 };
cg.az = -1;
cg.aA = -1;
(aB = new Hashtable(6)).put("http", new Integer(80));
cg.aB.put("https", new Integer(443));
cg.aB.put("ftp", new Integer(21));
cg.aB.put("rtsp", new Integer(554));
cg.aC = new Integer(0);
}
static InputStream B(final String s) {
return u.Code.Z(s);
}
public static String B(final int n) {
if (cg.K[n] != null) {
return cg.K[n];
}
return "";
}
static boolean B() {
bx.b();
return cg.E < 160 && cg.D;
}
public static boolean B(final char c) {
return ('\uf800' & c) == 0xD800;
}
protected static String C(final String s) {
final String property = System.getProperty(s);
if (property == null) {
return property;
}
final byte[] bytes = property.getBytes();
synchronized (cg.aj) {
cg.aj.Code(bytes, 0, bytes.length);
return property;
}
}
public static void C() {
if (cg.W < 3) {
++cg.W;
b();
}
}
private static boolean C(final char c) {
return '\u0600' <= c && c <= '\u06ff';
}
public static byte[] C(int i) {
int n;
int n2;
byte[] code;
final Object o;
ci ci;
DataInputStream dataInputStream;
int code2;
int n3;
u j;
boolean b;
byte[] array;
Label_0041_Outer:Label_0019_Outer:
while (true) {
Label_0019:
while (true) {
Label_0463: {
while (true) {
synchronized (cg.X) {
if (cg.Y == null) {
return null;
}
break Label_0463;
while (true) {
n /= 3;
iftrue(Label_0065:)(n >= 0);
return null;
iftrue(Label_0458:)(n >= cg.Y.length);
iftrue(Label_0058:)(cg.Y[n] != (byte)i);
continue Label_0041_Outer;
}
}
Label_0058: {
n += 3;
}
continue Label_0019;
Label_0065:
n2 = 0;
Label_0390_Outer:
while (true) {
while (true) {
Label_0468: {
Label_0410: {
while (true) {
Label_0425: {
try {
code = bs.Code.Code("mo", n + 2);
i = code[0];
if (i != 1) {
monitorexit(o);
return null;
}
if (code[1] != 16) {
monitorexit(o);
return null;
}
if (cg.aa == null && (cg.Y[n * 3] != code[2] || cg.Y[n * 3 + 1] != code[3] || cg.Y[n * 3 + 2] != code[4])) {
cg.aa = new byte[cg.Y.length];
System.arraycopy(cg.Y, 0, cg.aa, 0, cg.Y.length);
}
if (cg.aa != null) {
cg.aa[n * 3] = code[2];
cg.aa[n * 3 + 1] = code[3];
cg.aa[n * 3 + 2] = code[4];
}
cg.ab[n] = code[5];
if (code.length == 6) {
monitorexit(o);
return new byte[0];
}
ci = new ci();
ci.Code(new DataInputStream(new ByteArrayInputStream(code, 6, code.length - 6)));
dataInputStream = new DataInputStream(ci);
code2 = al.Code((DataInput)dataInputStream);
i = 0;
while (i < code2) {
if ((dataInputStream.read() & 0xFF & 0x80) != 0x0) {
break Label_0410;
}
n3 = dataInputStream.readUnsignedShort();
i += n3 + 3;
if (dataInputStream.skipBytes(n3) < n3) {
throw new EOFException();
}
}
break Label_0425;
}
catch (Throwable t) {
if (n2 >= u.b) {
C();
d();
monitorexit(o);
return null;
}
u.I.h();
j = u.I;
if (n2 > 0) {
b = true;
j.Code(b);
u.I.i();
++n2;
continue Label_0041_Outer;
}
break Label_0468;
array = new byte[al.Code((DataInput)dataInputStream)];
dataInputStream.readFully(array);
monitorexit(o);
return array;
n3 = dataInputStream.readInt();
i += n3 + 5;
continue Label_0390_Outer;
}
}
break;
}
}
break;
}
b = false;
continue;
}
}
Label_0458:
n = -1;
continue Label_0019_Outer;
}
}
n = 0;
continue Label_0019;
}
}
}
private static int Code(final int n, final char c) {
return cg.ae[n].Code(c);
}
public static int Code(final int n, final int n2, final int n3) {
return Math.max(Math.min(n, n3), n2);
}
private static int Code(int int1, final DataInputStream dataInputStream) {
Code((InputStream)dataInputStream, (int1 & 0x7FFF) * 4);
int1 = dataInputStream.readInt();
final int int2 = dataInputStream.readInt();
Code((InputStream)dataInputStream, int1);
return int2 + 4 - int1;
}
static int Code(final int n, final String s) {
return cg.ae[n].Code(s);
}
static int Code(final int n, final char[] array, final int n2, final int n3) {
return cg.ae[n].Code(array, n2, n3);
}
public static int Code(int n, final char[] array, final int n2, int n3, final int n4) {
final int n5 = 0;
if (n4 <= 0) {
return 0;
}
if (n3 > 0) {
final int n6 = n2 + n3;
if (Code(n, array, n2, n3) <= n4) {
n = n6;
}
else {
final int n7 = n3 = n6 - 1;
if (b(array[n7])) {
n3 = n7 - 1;
}
int n8 = n2;
int n9 = n2;
int n10 = n3;
n3 = n5;
int n11;
while (true) {
n11 = n3;
if (n8 >= n10) {
break;
}
final int n12 = n3 = (n8 + n10) / 2;
if (b(array[n12])) {
n3 = n12 - 1;
}
final int code = Code(n, array, n2, n3 - n2);
if (code < n4) {
int n13;
if (B(array[n3])) {
n13 = 2;
}
else {
n13 = 1;
}
final int n14 = n13 + n3;
final int n15 = code;
n9 = n3;
n3 = n15;
n8 = n14;
}
else {
if (code == n4) {
n11 = code;
n9 = n3;
break;
}
n10 = n3;
final int n16 = code;
n9 = n3;
n3 = n16;
}
}
n = n9;
if (n11 > n4) {
n3 = (n = n9 - 1);
if (b(array[n3])) {
n = n3 - 1;
}
}
}
}
else {
n = n2;
}
return n - n2;
}
private static int Code(final au au) {
int n = 0;
boolean b;
if (au.C()) {
b = true;
}
else {
b = false;
}
int n2;
if (au.a()) {
n2 = 2;
}
else {
n2 = 0;
}
int n3;
if (au.b()) {
n3 = 4;
}
else {
n3 = 0;
}
if (au.c()) {
n = 8;
}
return n3 | (n2 | (b ? 1 : 0)) | n;
}
static int Code(final String s, final int n) {
return q.Code(s.substring(0, n));
}
public static int Code(final String s, final String s2) {
final int length = s.length();
if (s2.length() != length + 2 || !s2.startsWith(s)) {
return -1;
}
return s2.charAt(length + 1) - 'A' + (s2.charAt(length) - 'A') * 26;
}
public static int Code(final char[] array, final boolean b, final int n, final int n2, final au au) {
int n3 = 0;
final int n4 = 0;
int length;
if (au.Code(array, 0, array.length) <= n) {
length = n4;
if (b) {
length = array.length;
}
}
else {
final int length2 = array.length;
if (b) {
int n5 = length2;
int n6;
while (true) {
n6 = n5;
if (n5 <= 0) {
break;
}
final int n7 = n5 / 2;
n6 = n5;
if (au.Code(array, 0, n7 + 0) + n2 <= n) {
break;
}
n5 = n7;
}
while (n6 > 0 && au.Code(array, 0, n6 + 0) + n2 > n) {
--n6;
}
return n6;
}
int n8;
while ((n8 = n3) < length2) {
final int n9 = (length2 - n3) / 2 + n3 + 1;
n8 = n3;
if (au.Code(array, n9, length2 - n9) + n2 <= n) {
break;
}
n3 = n9;
}
while ((length = n8) < length2) {
length = n8;
if (au.Code(array, n8, length2 - n8) + n2 <= n) {
break;
}
++n8;
}
}
return length;
}
public static int Code(final int[] array, final int n, final int n2, final int n3) {
return Code(array, 0, n, n2, -1, n3);
}
public static int Code(final int[] array, final int n, int n2, final int n3, final int n4, final int n5) {
int n6 = -1;
while (n2 - n6 > 1) {
final int n7 = n6 + n2 >>> 1;
if ((array[n7 * n3 + n + 0] & n4) < n5) {
n6 = n7;
}
else {
n2 = n7;
}
}
return n2;
}
static az Code(final int n, final boolean b) {
final byte[] c = c(n);
return u.Code.q().Code(c, c.length, b);
}
static String Code(final String s) {
final StringBuffer sb = new StringBuffer();
for (int i = 0; i < s.length(); ++i) {
final char char1 = s.charAt(i);
if (char1 == '\0') {
sb.append("%00");
}
else if ("%&=;".indexOf(char1) >= 0) {
sb.append('%').append(Integer.toString(char1, 16));
}
else {
sb.append(char1);
}
}
return sb.toString();
}
static String Code(final String s, final boolean b) {
if (s == null) {
return s;
}
final StringBuffer sb = new StringBuffer(s.length());
int n;
for (int i = 0; i < s.length(); i = n + 1) {
final char char1 = s.charAt(i);
if (b) {
if (char1 <= '\u007f') {
if (char1 == '%' || char1 <= ' ') {
Code(sb, char1);
n = i;
}
else {
sb.append(char1);
n = i;
}
}
else {
if (char1 > '\u07ff') {
Code(sb, (char)((char1 >> 12 & 0xF) | 0xE0));
Code(sb, (char)((char1 >> 6 & 0x3F) | 0x80));
}
else {
Code(sb, (char)((char1 >> 6 & 0x1F) | 0xC0));
}
Code(sb, (char)((char1 >> 0 & 0x3F) | 0x80));
n = i;
}
}
else if (char1 == '%') {
final int int1 = Integer.parseInt(s.substring(i + 1, i + 3), 16);
if (int1 < 32) {
sb.append(char1);
n = i;
}
else if (int1 <= 127) {
sb.append((char)int1);
n = i + 2;
}
else if (int1 <= 223) {
sb.append((char)((Integer.parseInt(s.substring(i + 4, i + 6), 16) & 0x3F) | (int1 & 0x1F) << 6));
n = i + 5;
}
else {
n = i;
if (int1 <= 239) {
sb.append((char)((Integer.parseInt(s.substring(i + 4, i + 6), 16) & 0x3F) << 6 | (int1 & 0xF) << 12 | (Integer.parseInt(s.substring(i + 7, i + 9), 16) & 0x3F) << 0));
n = i + 8;
}
}
}
else {
sb.append(char1);
n = i;
}
}
return sb.toString();
}
public static String Code(byte[] array) {
final bv bv = new bv();
bv.Code(array, 0, array.length);
array = new byte[32];
bv.Code(array);
return Code(array, array.length);
}
private static String Code(final byte[] array, int i) {
final int min = Math.min(i, 128);
final StringBuffer sb = new StringBuffer();
for (i = 0; i < min + 0; ++i) {
if ((array[i] & 0xFF) < 16) {
sb.append('0');
}
sb.append(Integer.toString(array[i] & 0xFF, 16));
}
return sb.toString();
}
public static void Code() {
Z((int)System.currentTimeMillis());
}
public static void Code(final int n) {
final long n2 = n;
try {
Thread.sleep(n2);
}
catch (InterruptedException ex) {}
}
private static void Code(final int n, final int n2) {
cg.au = ((cg.au <<= n2) | ((1 << n2) - 1 & n));
cg.at += n2;
while (cg.at >= 8) {
cg.at -= 8;
cg.as.write(cg.au >> cg.at);
}
}
public static void Code(final int n, final String s, final boolean b) {
if (cg.K[n] == null || !cg.K[n].equals(s)) {
cg.K[n] = s;
if (n == 1 && b) {
a("mc");
}
else if (n == 3 && b) {
a("md");
}
}
}
static void Code(final long n, final long n2, final long n3) {
synchronized (cg.ap) {
cg.an += n;
cg.ao += n2;
cg.am += n3;
}
}
public static void Code(final ar ar) {
try {
ar.C();
}
catch (Throwable t) {}
}
public static void Code(final aw aw, final int n, final char[] array, final int n2, final int n3, final int n4, final int n5, final int n6, final int n7, final int n8, final int n9) {
aw.Code(n, array, n2, n3, n4, n5 + cg.ae[n].Z(), n6, true, n7, n8, n9);
}
private static void Code(final ByteArrayOutputStream byteArrayOutputStream, final int n, final int n2, final int n3, final String s) {
final byte[] array = new byte[q.Code(s) + 2];
final int code = q.Code(s, array, 0);
byteArrayOutputStream.write(n >> 8 & 0xFF);
byteArrayOutputStream.write(n & 0xFF);
byteArrayOutputStream.write(n2 >> 8 & 0xFF);
byteArrayOutputStream.write(n2 & 0xFF);
byteArrayOutputStream.write(n3);
byteArrayOutputStream.write(code);
byteArrayOutputStream.write(array, 2, code);
}
private static void Code(final DataInputStream dataInputStream, int i) {
while (i > 0) {
Z(dataInputStream.readInt());
--i;
}
}
static void Code(final DataOutputStream dataOutputStream, final int[] array) {
if (array != null) {
dataOutputStream.writeShort(array.length);
dataOutputStream.write(Code(array));
return;
}
dataOutputStream.writeShort(0);
}
public static void Code(final InputStream inputStream) {
try {
inputStream.close();
}
catch (Throwable t) {}
}
public static void Code(final InputStream inputStream, int i) {
while (i > 0) {
i -= (int)inputStream.skip(i);
}
}
public static void Code(final OutputStream outputStream) {
try {
outputStream.close();
}
catch (Throwable t) {}
}
public static void Code(final Object o) {
synchronized (o) {
o.notifyAll();
}
}
public static void Code(final Object o, final int n) {
monitorenter(o);
final long n2 = n;
try {
try {
o.wait(n2);
}
finally {
monitorexit(o);
}
}
catch (InterruptedException ex) {}
}
public static void Code(final Runnable runnable) {
new Thread(runnable).start();
}
private static void Code(final StringBuffer sb, final char c) {
sb.append('%');
if (c < '\u0010') {
sb.append('0');
}
sb.append(Integer.toHexString(c));
}
static void Code(final boolean b) {
Label_0391_Outer:
while (true) {
int n = 0;
bv bv;
char[] array2;
char[] array;
int n2;
int i;
int n3 = 0;
int[] array3;
int n4;
int code;
int abs;
int n5;
int n6;
int[] array4;
int n7;
int n8;
int n9;
int n10;
int n11;
ak as;
Label_0391:Label_0787_Outer:
while (true) {
Label_0787:Label_0753_Outer:
while (true) {
Label_1098:
while (true) {
Label_0733:
while (true) {
while (true) {
Label_1075: {
Label_1070: {
Label_0662:Block_24_Outer:
while (true) {
synchronized (cg.class) {
cg.af = 0;
if (!b && cg.F != null) {
n = cg.F.length;
if (n == 32) {
return;
}
}
bv = new bv();
array = (array2 = new char[13]);
array2[0] = ' ';
array2[1] = 'm';
array2[2] = 'i';
array2[3] = '0';
array2[4] = 'X';
array2[5] = '\u00e5';
array2[6] = '\u0627';
array2[7] = '\u05df';
array2[8] = '\u03a8';
array2[9] = '\u3042';
array2[10] = '\u044e';
array2[11] = '\u4e00';
array2[12] = '\u330f';
cg.as = new ak(32);
cg.ar = (cg.ac - cg.ad) * 16454;
if (b) {
u.I.h();
u.Z.c(cg.ar);
u.I.Z(32);
}
break Label_1070;
Block_18: {
while (true) {
Block_15_Outer:
while (true) {
n2 = Math.max(0, cg.ae[n].I() - d(n) - cg.ae[n].Z());
i = cg.ae[n].I();
cg.as.write(i - n2);
cg.as.write(cg.ae[n].I());
n2 = 0;
while (true) {
Label_0278: {
break Label_0278;
iftrue(Label_1017:)(n3 >= cg.ac);
Block_19: {
while (true) {
Block_17: {
break Block_17;
iftrue(Label_0941:)(i > 65535);
break Block_19;
n3 = 0;
continue Label_0391;
}
iftrue(Label_1122:)(u.Code.a(n3));
break Block_18;
cg.as.write(Code(n, array[n2]));
++n2;
break Label_0278;
Label_0359: {
((bv)(Object)array3).Code(1);
}
cg.as.Code(32);
((bv)(Object)array3).Code(cg.as.Code());
iftrue(Label_1025:)(!b);
continue Block_15_Outer;
}
Code(cg.aw, cg.av);
Code(1, cg.av * 2);
++cg.av;
cg.aw = 1 << cg.av - 1;
break Label_0787;
}
n4 = i + 1;
code = Code(n3, (char)i);
++cg.af;
i = code - n2;
abs = Math.abs(i);
iftrue(Label_1082:)(i != n5 || n4 - 1 == array3[n6]);
++n;
n2 = code;
i = n4;
continue Label_0662;
}
iftrue(Label_0306:)(n2 >= array.length);
continue Block_24_Outer;
}
Label_0306: {
Code(cg.as, n, 1, Code(cg.ae[n]), cg.ae[n].B());
}
((bv)(Object)array3).Code(cg.as.Code(), 0, cg.as.size());
cg.as.reset();
break Label_1075;
iftrue(Label_1098:)(n2 >= n);
Code(n5, cg.av);
++n2;
continue Label_0733;
iftrue(Label_0359:)(n >= cg.ac);
iftrue(Label_1075:)(u.Code.a(n));
continue Label_0391_Outer;
}
iftrue(Label_0863:)(abs >>> cg.av - 1 == 0);
continue Label_0787_Outer;
}
Code(cg.aw, cg.av);
iftrue(Label_0845:)(n > 1 << cg.av * 2 - 1);
Code(n, cg.av * 2);
break Label_1098;
}
n = Math.max(0, cg.ae[n3].I() - d(n3) - cg.ae[n3].Z());
n2 = cg.ae[n3].I();
cg.as.write(n3 >> 8 & 0xFF);
cg.as.write(n3 & 0xFF);
cg.as.write(n2 - n);
cg.as.write(n);
cg.ae[n3].d();
cg.at = 0;
cg.av = 4;
cg.aw = 1 << cg.av - 1;
array3 = (array4 = new int[17]);
array4[array4[0] = 1] = 31;
array4[2] = 2043;
array4[3] = 2303;
array4[4] = 7037;
array4[5] = 7423;
array4[6] = 13312;
array4[7] = 19903;
array4[8] = 19968;
array4[9] = 40895;
array4[10] = 42183;
array4[11] = 42751;
array4[12] = 44032;
array4[13] = 55203;
array4[14] = 55296;
array4[15] = 64255;
array4[16] = 65536;
n6 = 0;
n = 0;
n5 = Integer.MAX_VALUE;
i = 1;
n2 = 0;
continue Label_0662;
}
Label_0845: {
Code(2, cg.av * 2);
}
Code(n, 16);
break Label_1098;
Label_0863:
Code(i, cg.av);
n7 = n6;
n = n2;
n8 = n4;
if (n4 - 1 == array3[n6]) {
Code(0, cg.av);
n9 = array3[n6 + 1];
n10 = array3[n6];
n11 = array3[n6 + 1];
n7 = n6 + 2;
n8 = n11 + 1;
n = n9 - n10 - 1;
i = 0;
}
n4 = i;
i = n8;
n2 = code;
n6 = n7;
n5 = n4;
continue Label_0662;
}
Label_0941: {
if (n > 0) {
Code(cg.aw, cg.av);
Code(2, cg.av * 2);
Code(n, 16);
}
}
Code(cg.aw, cg.av);
Code(3, cg.av * 2);
if (cg.at != 0) {
cg.as.write(cg.au << 8 - cg.at);
}
as = cg.as;
break Label_0787;
Label_1017:
u.Code.ab();
Label_1025:
cg.F = cg.as.toByteArray();
cg.as = null;
cg.G = null;
if (b) {
k();
}
if (b) {
u.I.h();
u.I.Z(33);
return;
}
return;
}
n = 0;
continue Label_0753_Outer;
}
++n;
continue Label_0753_Outer;
}
Label_1082: {
if ((n2 = n) <= 0) {
continue Label_0787;
}
}
if (n < 4) {
n2 = 0;
continue Label_0733;
}
break;
}
continue;
}
n2 = 0;
continue Label_0787;
}
++n3;
continue Label_0391;
}
}
}
static void Code(final byte[] array, final int n, final int n2, final int n3) {
array[0] = 1;
array[1] = 16;
array[2] = (byte)n;
array[3] = (byte)(n2 >> 8);
array[4] = (byte)n2;
array[5] = (byte)n3;
}
static void Code(final byte[] array, int j, int z, int n, final int aa, final int az, final int[] array2) {
final boolean b = aa != -1 && az != -1;
if ((z >= 4 && array[j] == 82) || array[j] == 67 || array[j] == 88) {
if (array[j] == 88) {
array2[0] = (array[j + 1] << 3 | (array[j + 2] >>> 5 & 0x7) * ((array[j + 2] & 0x1F) << 6) | (array[j + 3] >>> 2 & 0x3F) * cg.b);
}
else {
array2[0] = array[j + 1] * array[j + 2] * cg.b;
}
j = array2[0];
array2[1] = (array2[2] = j);
cg.az = 0;
cg.aA = 0;
return;
}
int i = 0;
Label_0188: {
if (z >= 23 && array[j] == -119) {
i = q.J(array, j + 16);
j = q.J(array, j + 20);
z = 0;
}
else {
if (array[j] == -1 && array[j + 1] == -40) {
int n2 = 2;
while (true) {
while (n2 < z && array[j + n2] == -1) {
final int n3 = ++n2;
if (array[j + n3] != -1) {
if (array[j + n3] == 0) {
break;
}
if (array[j + n3] == 1 || (array[j + n3] >= -48 && array[j + n3] <= -41)) {
n2 = n3 + 1;
}
else if (array[j + n3] == -64 || array[j + n3] == -62) {
z = q.Z(array, j + n3 + 6);
final int z2 = q.Z(array, n3 + j + 4);
j = z;
z = z2;
int n4;
if (b) {
n4 = az * 256 / j;
}
else {
n4 = n;
}
if (!cg.s && n4 < 256) {
int n5;
for (n5 = 8; 256 / n5 <= n4; n5 /= 2) {}
final int n6 = j;
j = z;
z = n5;
i = n6;
break Label_0188;
}
final int n7 = 0;
i = j;
j = z;
z = n7;
break Label_0188;
}
else {
final int n8 = n3 + 1;
n2 = n8 + q.Z(array, j + n8);
}
}
}
z = 0;
j = 0;
continue;
}
}
z = 0;
j = 0;
i = 0;
}
}
cg.az = az;
cg.aA = aa;
array2[1] = az * aa * cg.b;
if (n == 256) {
j = array2[1];
array2[0] = (array2[2] = j);
return;
}
array2[0] = ((az * n - 1) / 256 + 1) * ((aa * n - 1) / 256 + 1) * cg.b;
if (z > 0) {
n = array2[0];
array2[2] = j * i * cg.b / z + n;
return;
}
array2[2] = array2[0] + array2[1];
}
static void Code(final byte[] array, int aa, int az, final int[] array2) {
if ((az >= 4 && array[aa] == 82) || array[aa] == 67 || array[aa] == 88) {
if (array[aa] == 88) {
array2[0] = (array[aa + 1] << 3 | (array[aa + 2] >>> 5 & 0x7) * ((array[aa + 2] & 0x1F) << 6) | (array[aa + 3] >>> 2 & 0x3F) * cg.b);
}
else {
array2[0] = array[aa + 1] * array[aa + 2] * cg.b;
}
aa = array2[0];
array2[1] = (array2[2] = aa);
cg.az = 0;
cg.aA = 0;
return;
}
Label_0159: {
if (az >= 23 && array[aa] == -119) {
az = q.J(array, aa + 16);
aa = q.J(array, aa + 20);
}
else {
if (array[aa] == -1 && array[aa + 1] == -40) {
int n = 2;
while (true) {
while (n < az && array[aa + n] == -1) {
final int n2 = ++n;
if (array[aa + n2] != -1) {
if (array[aa + n2] == 0) {
break;
}
if (array[aa + n2] == 1 || (array[aa + n2] >= -48 && array[aa + n2] <= -41)) {
n = n2 + 1;
}
else {
if (array[aa + n2] == -64 || array[aa + n2] == -62) {
az = q.Z(array, aa + n2 + 6);
aa = q.Z(array, n2 + aa + 4);
final boolean s = cg.s;
break Label_0159;
}
final int n3 = n2 + 1;
n = n3 + q.Z(array, aa + n3);
}
}
}
aa = 0;
az = 0;
continue;
}
}
aa = 0;
az = 0;
}
}
array2[1] = az * aa * cg.b;
cg.az = az;
cg.aA = aa;
aa = array2[1];
array2[0] = (array2[2] = aa);
}
public static boolean Code(final char c) {
return I(c) || Z(c);
}
public static boolean Code(final int n, final int n2, final int n3, final int n4, final int n5, final int n6, final int n7, final int n8) {
return n < n5 + n7 && n + n3 > n5 && n2 < n6 + n8 && n2 + n4 > n6;
}
public static boolean Code(final int p0, final byte[] p1) {
//
// This method could not be decompiled.
//
// Original Bytecode:
//
// 3: astore_3
// 4: aload_3
// 5: monitorenter
// 6: getstatic bs.Code:Lbs;
// 9: ldc_w "mo"
// 12: iconst_1
// 13: invokevirtual bs.Code:(Ljava/lang/String;I)[B
// 16: astore 4
// 18: aload 4
// 20: arraylength
// 21: iconst_1
// 22: if_icmpne 175
// 25: aload 4
// 27: iconst_0
// 28: baload
// 29: istore_2
// 30: iload_2
// 31: iconst_m1
// 32: if_icmpne 44
// 35: getstatic bs.Code:Lbs;
// 38: ldc_w "mo"
// 41: invokevirtual bs.Z:(Ljava/lang/String;)V
// 44: iload_0
// 45: iload_2
// 46: if_icmpge 73
// 49: getstatic bs.Code:Lbs;
// 52: ldc_w "mo"
// 55: iload_0
// 56: iconst_2
// 57: iadd
// 58: aload_1
// 59: invokevirtual bs.Code:(Ljava/lang/String;I[B)V
// 62: aload_3
// 63: monitorexit
// 64: iconst_1
// 65: ireturn
// 66: astore 4
// 68: iconst_m1
// 69: istore_2
// 70: goto 30
// 73: iconst_1
// 74: newarray B
// 76: astore 4
// 78: aload 4
// 80: iconst_0
// 81: iload_0
// 82: iconst_1
// 83: iadd
// 84: i2b
// 85: bastore
// 86: iload_2
// 87: iconst_m1
// 88: if_icmpne 130
// 91: getstatic bs.Code:Lbs;
// 94: ldc_w "mo"
// 97: aload 4
// 99: invokevirtual bs.Code:(Ljava/lang/String;[B)I
// 102: pop
// 103: iconst_0
// 104: istore_2
// 105: iload_2
// 106: iload_0
// 107: if_icmpge 156
// 110: getstatic bs.Code:Lbs;
// 113: ldc_w "mo"
// 116: iconst_0
// 117: newarray B
// 119: invokevirtual bs.Code:(Ljava/lang/String;[B)I
// 122: pop
// 123: iload_2
// 124: iconst_1
// 125: iadd
// 126: istore_2
// 127: goto 105
// 130: getstatic bs.Code:Lbs;
// 133: ldc_w "mo"
// 136: iconst_1
// 137: aload 4
// 139: invokevirtual bs.Code:(Ljava/lang/String;I[B)V
// 142: goto 105
// 145: astore_1
// 146: invokestatic cg.b:()V
// 149: invokestatic cg.C:()V
// 152: aload_3
// 153: monitorexit
// 154: iconst_0
// 155: ireturn
// 156: getstatic bs.Code:Lbs;
// 159: ldc_w "mo"
// 162: aload_1
// 163: invokevirtual bs.Code:(Ljava/lang/String;[B)I
// 166: pop
// 167: goto 62
// 170: astore_1
// 171: aload_3
// 172: monitorexit
// 173: aload_1
// 174: athrow
// 175: iconst_m1
// 176: istore_2
// 177: goto 30
// Exceptions:
// Try Handler
// Start End Start End Type
// ----- ----- ----- ----- ---------------------
// 6 25 66 73 Ljava/lang/Throwable;
// 6 25 170 175 Any
// 35 44 170 175 Any
// 49 62 145 156 Ljava/lang/Throwable;
// 49 62 170 175 Any
// 62 64 170 175 Any
// 73 78 145 156 Ljava/lang/Throwable;
// 73 78 170 175 Any
// 91 103 145 156 Ljava/lang/Throwable;
// 91 103 170 175 Any
// 110 123 145 156 Ljava/lang/Throwable;
// 110 123 170 175 Any
// 130 142 145 156 Ljava/lang/Throwable;
// 130 142 170 175 Any
// 146 154 170 175 Any
// 156 167 145 156 Ljava/lang/Throwable;
// 156 167 170 175 Any
//
// The error that occurred was:
//
// java.lang.IllegalStateException: Expression is linked from several locations: Label_0062:
// at com.strobel.decompiler.ast.Error.expressionLinkedFromMultipleLocations(Error.java:27)
// at com.strobel.decompiler.ast.AstOptimizer.mergeDisparateObjectInitializations(AstOptimizer.java:2604)
// at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:235)
// at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)
// at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:209)
// at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:94)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:840)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:733)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:610)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:577)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:193)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:160)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:135)
// at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)
// at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)
// at com.strobel.decompiler.DecompilerDriver.decompileType(DecompilerDriver.java:333)
// at com.strobel.decompiler.DecompilerDriver.decompileJar(DecompilerDriver.java:254)
// at com.strobel.decompiler.DecompilerDriver.main(DecompilerDriver.java:144)
//
throw new IllegalStateException("An error occurred while decompiling this method.");
}
public static boolean Code(final byte[] array, final byte[] array2) {
final boolean b = false;
boolean b2;
if (array == array2) {
b2 = true;
}
else {
b2 = b;
if (array != null) {
b2 = b;
if (array2 != null) {
b2 = b;
if (array.length == array2.length) {
for (int i = 0; i < array.length; ++i) {
b2 = b;
if (array[i] != array2[i]) {
return b2;
}
}
return true;
}
}
}
}
return b2;
}
static byte[] Code(final int[] array) {
final byte[] array2 = new byte[array.length * 4];
int length = array2.length;
while (true) {
--length;
if (length < 0) {
break;
}
array2[length] = (byte)(array[length / 4] >> (3 - length % 4) * 8);
}
return array2;
}
static int[] Code(final DataInputStream dataInputStream) {
final int unsignedShort = dataInputStream.readUnsignedShort();
if (unsignedShort == 0) {
return null;
}
final byte[] array = new byte[unsignedShort * 4];
dataInputStream.readFully(array);
return Code(array, 0, array.length);
}
static int[] Code(final byte[] array, final int n, int length) {
final int[] array2 = new int[length / 4];
length = array2.length;
while (true) {
--length;
if (length < 0) {
break;
}
array2[length] = (array[length * 4 + n] << 24 | (array[length * 4 + n + 1] & 0xFF) << 16 | (array[length * 4 + n + 2] & 0xFF) << 8 | (array[length * 4 + n + 3] & 0xFF));
}
return array2;
}
static int[] Code(final int[] array, final int n) {
final int[] array2 = new int[n];
System.arraycopy(array, 0, array2, 0, array.length);
return array2;
}
static az[] Code(final az[] array, final int n) {
final az[] array2 = new az[n];
System.arraycopy(array, 0, array2, 0, array.length);
return array2;
}
static bm I(final byte[] array) {
Object aj = cg.aj;
synchronized (aj) {
final int al = cg.al;
cg.al = al + 1;
Z(al);
cg.aj.Code(array);
cg.aj.Code(array, 0, 32);
monitorexit(aj);
aj = new bm();
((bm)aj).Code(array, 0);
final byte[] c = aj.c;
((bm)aj).I(c, c.length);
((bm)aj).Z(array, 0);
return (bm)aj;
}
}
static DataInputStream I() {
final DataInputStream dataInputStream = new DataInputStream(B("/t"));
Code(1, dataInputStream);
return dataInputStream;
}
static String I(String substring) {
final StringBuffer sb = new StringBuffer();
sb.ensureCapacity(substring.length());
while (true) {
final int index = substring.indexOf(37);
if (index < 0 || index + 3 > substring.length()) {
break;
}
sb.append(substring.substring(0, index)).append((char)Integer.parseInt(substring.substring(index + 1, index + 3), 16));
substring = substring.substring(index + 3, substring.length());
}
return sb.append(substring).toString();
}
public static void I(final int n) {
cg.E += n;
if (cg.ak) {
u.I.j();
if (cg.E >= 160) {
cg.ak = false;
Code(cg.aj);
}
}
}
public static boolean I(final char c) {
return '\u0590' <= c && c <= '\u05ff';
}
public static boolean I(final String s, final String s2) {
final boolean b = false;
final int length = s2.length();
final int length2 = s.length();
boolean b2;
if (length2 == 0 && length == 0) {
b2 = true;
}
else {
b2 = b;
if (length2 != 0) {
int n = -1;
int n2 = 0;
while (true) {
final int index = s.indexOf(42, n + 1);
String s3;
if (index != -1) {
s3 = s.substring(n + 1, index);
}
else {
s3 = s.substring(n + 1);
}
int index2;
if (s3.length() == 0 && n2 == s2.length()) {
index2 = n2;
}
else {
index2 = s2.indexOf(s3, n2);
}
b2 = b;
if (index2 == -1) {
return b2;
}
if (n2 == 0 && index2 > 0) {
b2 = b;
if (s.charAt(0) != '*') {
return b2;
}
}
if (n == length2 - 1) {
break;
}
n2 = s3.length() + index2;
if (n2 >= length && index == -1) {
return true;
}
n = index;
}
return true;
}
}
return b2;
}
static boolean I(final byte[] array, int n, int n2) {
if (n2 > 8) {
n2 = n + 1;
if (array[n] == -119) {
n = n2 + 1;
if (array[n2] == 80) {
n2 = n + 1;
if (array[n] == 78) {
n = n2 + 1;
if (array[n2] == 71) {
n2 = n + 1;
if (array[n] == 13) {
n = n2 + 1;
if (array[n2] == 10 && array[n] == 26 && array[n + 1] == 10) {
return true;
}
}
}
}
}
}
}
return false;
}
static void J() {
Label_0087: {
synchronized (cg.class) {
if (!B()) {
break Label_0087;
}
u.I.h();
u.Z.c(160);
u.Z.c(cg.E);
u.Z.c(1);
u.I.Z(34);
while (cg.E < 160) {
Code(cg.aj, 5000);
}
}
a("mc");
a("md");
}
if (cg.E >= 160 && cg.K[1] == null) {
final byte[] array = new byte[32];
I(array);
Code(1, Code(array, array.length), true);
}
monitorexit(cg.class);
}
static void J(final int p0) {
//
// This method could not be decompiled.
//
// Original Bytecode:
//
// 1: astore_1
// 2: ldc_w 32768
// 5: iload_0
// 6: iand
// 7: ifne 71
// 10: new Ljava/io/DataInputStream;
// 13: dup
// 14: ldc_w "/t"
// 17: invokestatic cg.B:(Ljava/lang/String;)Ljava/io/InputStream;
// 20: invokespecial java/io/DataInputStream.<init>:(Ljava/io/InputStream;)V
// 23: astore_2
// 24: aload_2
// 25: astore_1
// 26: iload_0
// 27: aload_2
// 28: invokestatic cg.Code:(ILjava/io/DataInputStream;)I
// 31: istore_0
// 32: aload_2
// 33: astore_1
// 34: getstatic u.Z:Lp;
// 37: iload_0
// 38: invokevirtual p.r:(I)V
// 41: aload_2
// 42: astore_1
// 43: getstatic u.Z:Lp;
// 46: getfield p.Code:[B
// 49: astore_3
// 50: aload_2
// 51: astore_1
// 52: getstatic u.Z:Lp;
// 55: astore 4
// 57: aload_2
// 58: astore_1
// 59: aload_2
// 60: aload_3
// 61: iconst_0
// 62: iload_0
// 63: invokevirtual java/io/DataInputStream.readFully:([BII)V
// 66: aload_2
// 67: invokevirtual java/io/InputStream.close:()V
// 70: return
// 71: iload_0
// 72: invokestatic ab.Code:(I)Lab;
// 75: astore_3
// 76: new Ljava/io/DataInputStream;
// 79: dup
// 80: aload_3
// 81: invokespecial java/io/DataInputStream.<init>:(Ljava/io/InputStream;)V
// 84: astore_2
// 85: aload_2
// 86: astore_1
// 87: aload_3
// 88: invokevirtual ab.Code:()I
// 91: istore_0
// 92: goto 32
// 95: astore_1
// 96: aconst_null
// 97: astore_1
// 98: aload_1
// 99: invokevirtual java/io/InputStream.close:()V
// 102: return
// 103: astore_1
// 104: return
// 105: astore_3
// 106: aload_1
// 107: astore_2
// 108: aload_3
// 109: astore_1
// 110: aload_2
// 111: invokevirtual java/io/InputStream.close:()V
// 114: aload_1
// 115: athrow
// 116: astore_1
// 117: return
// 118: astore_2
// 119: goto 114
// 122: astore_1
// 123: goto 110
// 126: astore_1
// 127: goto 110
// 130: astore_1
// 131: goto 110
// 134: astore_2
// 135: goto 98
// Exceptions:
// Try Handler
// Start End Start End Type
// ----- ----- ----- ----- ---------------------
// 10 24 95 98 Ljava/lang/Exception;
// 10 24 105 110 Any
// 26 32 134 138 Ljava/lang/Exception;
// 26 32 122 126 Any
// 34 41 134 138 Ljava/lang/Exception;
// 34 41 130 134 Any
// 43 50 134 138 Ljava/lang/Exception;
// 43 50 130 134 Any
// 52 57 134 138 Ljava/lang/Exception;
// 52 57 130 134 Any
// 59 66 134 138 Ljava/lang/Exception;
// 59 66 130 134 Any
// 66 70 116 118 Ljava/lang/Throwable;
// 71 85 95 98 Ljava/lang/Exception;
// 71 85 105 110 Any
// 87 92 134 138 Ljava/lang/Exception;
// 87 92 126 130 Any
// 98 102 103 105 Ljava/lang/Throwable;
// 110 114 118 122 Ljava/lang/Throwable;
//
// The error that occurred was:
//
// java.lang.IllegalStateException: Expression is linked from several locations: Label_0032:
// at com.strobel.decompiler.ast.Error.expressionLinkedFromMultipleLocations(Error.java:27)
// at com.strobel.decompiler.ast.AstOptimizer.mergeDisparateObjectInitializations(AstOptimizer.java:2604)
// at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:235)
// at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)
// at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:209)
// at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:94)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:840)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:733)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:610)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:577)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:193)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:160)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:135)
// at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)
// at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)
// at com.strobel.decompiler.DecompilerDriver.decompileType(DecompilerDriver.java:333)
// at com.strobel.decompiler.DecompilerDriver.decompileJar(DecompilerDriver.java:254)
// at com.strobel.decompiler.DecompilerDriver.main(DecompilerDriver.java:144)
//
throw new IllegalStateException("An error occurred while decompiling this method.");
}
public static boolean J(final char c) {
boolean b = false;
int n;
if (I(c)) {
n = 2;
}
else if (C(c)) {
n = 4;
}
else if (a(c)) {
n = 8;
}
else {
n = 0;
}
if ((n & cg.r) != 0x0) {
b = true;
}
return b;
}
static byte[] J(final String s) {
final byte[] array = new byte[s.length() / 2];
for (int i = 0; i < array.length; ++i) {
array[i] = (byte)Integer.parseInt(s.substring(i * 2, i * 2 + 2), 16);
}
return array;
}
static String Z(final String s) {
String string = s;
if (s != null) {
string = s;
if (!s.endsWith("/")) {
string = s + "/";
}
}
return string;
}
static void Z() {
synchronized (cg.ap) {
final long an = cg.an;
final long ao = cg.ao;
final long am = cg.am;
cg.am = 0L;
cg.ao = 0L;
cg.an = 0L;
monitorexit(cg.ap);
final long n = an - am;
u.I.h();
u.Z.Z(u.Z.I(10, 56));
u.Z.B(u.Z.Z(), 0, (int)an);
u.Z.B(u.Z.Z(), 1, (int)(an >> 32));
u.Z.B(u.Z.Z(), 2, (int)ao);
u.Z.B(u.Z.Z(), 3, (int)(ao >> 32));
u.Z.B(u.Z.Z(), 4, (int)n);
u.Z.B(u.Z.Z(), 5, (int)(n >> 32));
u.Z.B(u.Z.Z(), 8, (int)am);
u.Z.B(u.Z.Z(), 9, (int)(am >> 32));
u.Z.b(u.Z.Z());
u.Z.Z(0);
u.I.Z(6);
}
}
public static void Z(final int n) {
synchronized (cg.aj) {
cg.aj.Code(n);
}
}
public static boolean Z(final char c) {
return C(c) || a(c);
}
static int a(final int n) {
return cg.ae[n].I();
}
public static void a() {
//
// This method could not be decompiled.
//
// Original Bytecode:
//
// 3: astore_3
// 4: aload_3
// 5: monitorenter
// 6: getstatic cg.Y:[B
// 9: ifnull 18
// 12: getstatic cg.ab:[B
// 15: ifnonnull 95
// 18: getstatic bs.Code:Lbs;
// 21: ldc_w "mo"
// 24: invokevirtual bs.Code:(Ljava/lang/String;)Z
// 27: ifne 33
// 30: aload_3
// 31: monitorexit
// 32: return
// 33: getstatic bs.Code:Lbs;
// 36: ldc_w "mo"
// 39: iconst_1
// 40: invokevirtual bs.Code:(Ljava/lang/String;I)[B
// 43: astore 4
// 45: aload 4
// 47: arraylength
// 48: iconst_1
// 49: if_icmpne 286
// 52: aload 4
// 54: iconst_0
// 55: baload
// 56: istore_0
// 57: iload_0
// 58: ifne 81
// 61: invokestatic cg.b:()V
// 64: aload_3
// 65: monitorexit
// 66: return
// 67: astore 4
// 69: aload_3
// 70: monitorexit
// 71: aload 4
// 73: athrow
// 74: astore 4
// 76: iconst_0
// 77: istore_0
// 78: goto 57
// 81: iload_0
// 82: iconst_3
// 83: imul
// 84: newarray B
// 86: putstatic cg.aa:[B
// 89: iload_0
// 90: newarray B
// 92: putstatic cg.ab:[B
// 95: getstatic cg.aa:[B
// 98: ifnonnull 291
// 101: getstatic cg.Y:[B
// 104: arraylength
// 105: newarray B
// 107: putstatic cg.aa:[B
// 110: getstatic cg.Y:[B
// 113: iconst_0
// 114: getstatic cg.aa:[B
// 117: iconst_0
// 118: getstatic cg.Y:[B
// 121: arraylength
// 122: invokestatic java/lang/System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
// 125: goto 291
// 128: getstatic cg.aa:[B
// 131: arraylength
// 132: iconst_3
// 133: idiv
// 134: istore_1
// 135: iload_0
// 136: iload_1
// 137: if_icmpge 280
// 140: iconst_0
// 141: istore_1
// 142: getstatic bs.Code:Lbs;
// 145: ldc_w "mo"
// 148: iload_0
// 149: iconst_2
// 150: iadd
// 151: invokevirtual bs.Code:(Ljava/lang/String;I)[B
// 154: astore 4
// 156: aload 4
// 158: iconst_0
// 159: baload
// 160: iconst_1
// 161: if_icmpeq 170
// 164: invokestatic cg.b:()V
// 167: aload_3
// 168: monitorexit
// 169: return
// 170: aload 4
// 172: iconst_1
// 173: baload
// 174: bipush 16
// 176: if_icmpeq 185
// 179: invokestatic cg.b:()V
// 182: aload_3
// 183: monitorexit
// 184: return
// 185: getstatic cg.aa:[B
// 188: iload_0
// 189: iconst_3
// 190: imul
// 191: aload 4
// 193: iconst_2
// 194: baload
// 195: bastore
// 196: getstatic cg.aa:[B
// 199: iload_0
// 200: iconst_3
// 201: imul
// 202: iconst_1
// 203: iadd
// 204: aload 4
// 206: iconst_3
// 207: baload
// 208: bastore
// 209: getstatic cg.aa:[B
// 212: iload_0
// 213: iconst_3
// 214: imul
// 215: iconst_2
// 216: iadd
// 217: aload 4
// 219: iconst_4
// 220: baload
// 221: bastore
// 222: getstatic cg.ab:[B
// 225: iload_0
// 226: aload 4
// 228: iconst_5
// 229: baload
// 230: bastore
// 231: iload_0
// 232: iconst_1
// 233: iadd
// 234: istore_0
// 235: goto 128
// 238: astore 4
// 240: iload_1
// 241: getstatic u.b:I
// 244: if_icmpge 271
// 247: getstatic u.I:Lu;
// 250: astore 4
// 252: iload_1
// 253: ifle 296
// 256: iconst_1
// 257: istore_2
// 258: aload 4
// 260: iload_2
// 261: invokevirtual u.Code:(Z)V
// 264: iload_1
// 265: iconst_1
// 266: iadd
// 267: istore_1
// 268: goto 142
// 271: invokestatic cg.C:()V
// 274: invokestatic cg.b:()V
// 277: aload_3
// 278: monitorexit
// 279: return
// 280: invokestatic cg.d:()V
// 283: aload_3
// 284: monitorexit
// 285: return
// 286: iconst_0
// 287: istore_0
// 288: goto 57
// 291: iconst_0
// 292: istore_0
// 293: goto 128
// 296: iconst_0
// 297: istore_2
// 298: goto 258
// Exceptions:
// Try Handler
// Start End Start End Type
// ----- ----- ----- ----- ---------------------
// 6 18 67 74 Any
// 18 32 67 74 Any
// 33 52 74 81 Ljava/lang/Throwable;
// 33 52 67 74 Any
// 61 66 67 74 Any
// 81 95 67 74 Any
// 95 125 67 74 Any
// 128 135 67 74 Any
// 142 156 238 280 Ljava/lang/Throwable;
// 142 156 67 74 Any
// 164 167 238 280 Ljava/lang/Throwable;
// 164 167 67 74 Any
// 167 169 67 74 Any
// 179 182 238 280 Ljava/lang/Throwable;
// 179 182 67 74 Any
// 182 184 67 74 Any
// 185 231 238 280 Ljava/lang/Throwable;
// 185 231 67 74 Any
// 240 252 67 74 Any
// 258 264 67 74 Any
// 271 279 67 74 Any
// 280 285 67 74 Any
//
// The error that occurred was:
//
// java.lang.IllegalStateException: Expression is linked from several locations: Label_0033:
// at com.strobel.decompiler.ast.Error.expressionLinkedFromMultipleLocations(Error.java:27)
// at com.strobel.decompiler.ast.AstOptimizer.mergeDisparateObjectInitializations(AstOptimizer.java:2604)
// at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:235)
// at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)
// at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:209)
// at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:94)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:840)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:733)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:610)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:577)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:193)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:160)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:135)
// at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)
// at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)
// at com.strobel.decompiler.DecompilerDriver.decompileType(DecompilerDriver.java:333)
// at com.strobel.decompiler.DecompilerDriver.decompileJar(DecompilerDriver.java:254)
// at com.strobel.decompiler.DecompilerDriver.main(DecompilerDriver.java:144)
//
throw new IllegalStateException("An error occurred while decompiling this method.");
}
public static void a(final String s) {
Label_0216_Outer:
while (true) {
boolean b = true;
while (true) {
Label_0277:
while (true) {
Label_0272: {
try {
final ak ak = new ak();
final DataOutputStream dataOutputStream = new DataOutputStream(ak);
if ("mc".equals(s)) {
dataOutputStream.write(1);
dataOutputStream.writeUTF(B(1));
dataOutputStream.writeBoolean(false);
}
else if ("md".equals(s)) {
while (true) {
dataOutputStream.write(8);
final byte[] array = new byte[32];
Object o = cg.aj;
while (true) {
synchronized (o) {
cg.aj.Code(array);
cg.aj.Code(array, 0, 32);
monitorexit(o);
dataOutputStream.write(array);
if (cg.E < 160) {
break Label_0272;
}
dataOutputStream.writeBoolean(b);
bx.Code(dataOutputStream);
dataOutputStream.writeBoolean(cg.N);
dataOutputStream.writeInt(0);
dataOutputStream.writeInt(cg.t);
dataOutputStream.writeShort(cg.ag);
dataOutputStream.writeShort(cg.ah);
u.Code.Code(dataOutputStream);
dataOutputStream.writeInt(cg.O);
if (cg.P == null) {
break Label_0277;
}
o = cg.P;
dataOutputStream.writeUTF((String)o);
dataOutputStream.writeByte(cg.W);
if (cg.D && cg.K[3] != null) {
o = cg.K[3];
dataOutputStream.writeUTF((String)o);
break;
}
}
o = "";
continue;
}
}
}
final byte[] byteArray = ak.toByteArray();
bs.Code.Z(s);
bs.Code.Code(s, byteArray);
return;
}
catch (Throwable t) {
return;
}
}
b = false;
continue Label_0216_Outer;
}
Object o = "";
continue;
}
}
}
private static boolean a(final char c) {
return ('\ufb50' <= c && c <= '\ufdff') || ('\ufe70' <= c && c <= '\ufefe');
}
public static void b() {
synchronized (cg.X) {
cg.Y = null;
cg.aa = null;
cg.ab = null;
bs.Code.Z("mo");
}
}
static void b(int i) {
if (cg.aq == null || cg.aq.length < i * 2) {
cg.aq = null;
cg.aq = new int[new int[i * 2].length];
final Random random = new Random(4711L);
for (i = 0; i < cg.aq.length >> 1; ++i) {
cg.aq[i] = (random.nextInt() & 0x7F);
cg.aq[(cg.aq.length >> 1) + i] = cg.aq[i] + 64;
}
}
}
public static void b(String s) {
try {
final DataInputStream dataInputStream = new DataInputStream(new ByteArrayInputStream(bs.Code.I(s)));
if ("mc".equals(s)) {
if (dataInputStream.readByte() == 1) {
s = dataInputStream.readUTF();
if (s.length() >= 64) {
Code(1, s, false);
}
cg.ai = dataInputStream.readBoolean();
}
}
else if ("md".equals(s)) {
final byte byte1 = dataInputStream.readByte();
if (byte1 <= 8) {
try {
Code(dataInputStream, 8);
if (byte1 >= 8) {
cg.ai = dataInputStream.readBoolean();
}
if (cg.ai) {
cg.E = 160;
}
bx.Code(dataInputStream, byte1);
cg.N = dataInputStream.readBoolean();
dataInputStream.readInt();
cg.t = dataInputStream.readInt();
if (byte1 >= 5) {
cg.ag = dataInputStream.readShort();
cg.ah = dataInputStream.readShort();
}
u.Code.Code(dataInputStream, byte1);
cg.O = dataInputStream.readInt();
cg.P = dataInputStream.readUTF();
cg.W = (byte)(dataInputStream.readByte() & 0x3);
s = dataInputStream.readUTF();
if (!s.equals("")) {
Code(3, s, false);
}
}
catch (IOException ex) {}
}
}
}
catch (Throwable t) {}
}
private static boolean b(final char c) {
return ('\ufc00' & c) == 0xDC00;
}
public static int c() {
Label_0115_Outer:
while (true) {
Label_0115:
while (true) {
int n3 = 0;
Label_0163:
while (true) {
int n = 0;
Label_0156: {
Label_0149: {
Label_0146: {
Label_0143: {
synchronized (cg.X) {
if (cg.ab == null) {
break Label_0149;
}
final byte[] array = new byte[6];
final byte[] array2 = new byte[cg.ab.length];
n = 0;
int n2 = 0;
if (n >= cg.ab.length) {
break Label_0146;
}
if ((cg.ab[n] & 0x1) == 0x0) {
break Label_0143;
}
n3 = n2 + 1;
array2[n2] = cg.Y[n * 3];
cg.Y[n * 3 + 1] = 0;
cg.Y[n * 3 + 2] = 0;
Code(array, cg.Y[n * 3], 0, cg.ab[n]);
if (Code(n, array)) {
n2 = n3;
break Label_0156;
}
break Label_0163;
d();
monitorexit(cg.X);
iftrue(Label_0141:)(n2 <= 0);
return u.Z.I(array2, 0, n2);
}
break;
}
break Label_0156;
}
continue Label_0115;
}
final byte[] array2 = null;
int n2 = 0;
continue Label_0115;
}
++n;
continue Label_0115_Outer;
}
int n2 = n3;
continue Label_0115;
}
}
Label_0141: {
return 0;
}
}
public static String c(final String s) {
StringBuffer sb = null;
int n;
StringBuffer sb2;
for (int i = 0; i < s.length(); i = n + 1, sb = sb2) {
final char char1 = s.charAt(i);
n = i;
sb2 = sb;
if ('\ufe80' <= char1) {
n = i;
sb2 = sb;
if (char1 <= '\ufefc') {
if ((sb2 = sb) == null) {
sb2 = new StringBuffer(s);
}
if (char1 < '\ufef5') {
sb2.setCharAt(i, (char)((cg.ay[char1 - '\ufe80'] & 0xFF) + 1536));
n = i;
}
else {
sb2.setCharAt(i, '\u0644');
n = i + 1;
sb2.insert(n, (char)((cg.ax[char1 - '\ufef5'] & 0xFF) + 1536));
}
}
}
}
if (sb == null) {
return s;
}
return sb.toString();
}
private static byte[] c(final int p0) {
//
// This method could not be decompiled.
//
// Original Bytecode:
//
// 3: iload_0
// 4: iand
// 5: ifne 51
// 8: new Ljava/io/DataInputStream;
// 11: dup
// 12: ldc_w "/t"
// 15: invokestatic cg.B:(Ljava/lang/String;)Ljava/io/InputStream;
// 18: invokespecial java/io/DataInputStream.<init>:(Ljava/io/InputStream;)V
// 21: astore_3
// 22: aload_3
// 23: astore_1
// 24: aload_3
// 25: astore_2
// 26: iload_0
// 27: aload_3
// 28: invokestatic cg.Code:(ILjava/io/DataInputStream;)I
// 31: istore_0
// 32: aload_3
// 33: astore_1
// 34: iload_0
// 35: newarray B
// 37: astore_2
// 38: aload_1
// 39: aload_2
// 40: iconst_0
// 41: iload_0
// 42: invokevirtual java/io/DataInputStream.readFully:([BII)V
// 45: aload_1
// 46: invokevirtual java/io/InputStream.close:()V
// 49: aload_2
// 50: areturn
// 51: iload_0
// 52: invokestatic ab.Code:(I)Lab;
// 55: astore 4
// 57: new Ljava/io/DataInputStream;
// 60: dup
// 61: aload 4
// 63: invokespecial java/io/DataInputStream.<init>:(Ljava/io/InputStream;)V
// 66: astore_3
// 67: aload_3
// 68: astore_1
// 69: aload_3
// 70: astore_2
// 71: aload 4
// 73: invokevirtual ab.Code:()I
// 76: istore_0
// 77: aload_3
// 78: astore_1
// 79: goto 34
// 82: astore_1
// 83: aconst_null
// 84: astore_2
// 85: aload_2
// 86: invokevirtual java/io/InputStream.close:()V
// 89: aconst_null
// 90: areturn
// 91: astore_1
// 92: aconst_null
// 93: areturn
// 94: astore_2
// 95: aconst_null
// 96: astore_1
// 97: aload_1
// 98: invokevirtual java/io/InputStream.close:()V
// 101: aload_2
// 102: athrow
// 103: astore_1
// 104: goto 49
// 107: astore_1
// 108: goto 101
// 111: astore_2
// 112: goto 97
// 115: astore_2
// 116: goto 97
// 119: astore_1
// 120: goto 85
// 123: astore_2
// 124: aload_1
// 125: astore_2
// 126: goto 85
// Exceptions:
// Try Handler
// Start End Start End Type
// ----- ----- ----- ----- ---------------------
// 8 22 82 85 Ljava/lang/Exception;
// 8 22 94 97 Any
// 26 32 119 123 Ljava/lang/Exception;
// 26 32 111 115 Any
// 34 45 123 129 Ljava/lang/Exception;
// 34 45 115 119 Any
// 45 49 103 107 Ljava/lang/Throwable;
// 51 67 82 85 Ljava/lang/Exception;
// 51 67 94 97 Any
// 71 77 119 123 Ljava/lang/Exception;
// 71 77 111 115 Any
// 85 89 91 94 Ljava/lang/Throwable;
// 97 101 107 111 Ljava/lang/Throwable;
//
// The error that occurred was:
//
// java.lang.IndexOutOfBoundsException: Index: 81, Size: 81
// at java.util.ArrayList.rangeCheck(ArrayList.java:659)
// at java.util.ArrayList.get(ArrayList.java:435)
// at com.strobel.decompiler.ast.AstBuilder.convertToAst(AstBuilder.java:3379)
// at com.strobel.decompiler.ast.AstBuilder.build(AstBuilder.java:113)
// at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:206)
// at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:94)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:840)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:733)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:610)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:577)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:193)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:160)
// at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:135)
// at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)
// at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)
// at com.strobel.decompiler.DecompilerDriver.decompileType(DecompilerDriver.java:333)
// at com.strobel.decompiler.DecompilerDriver.decompileJar(DecompilerDriver.java:254)
// at com.strobel.decompiler.DecompilerDriver.main(DecompilerDriver.java:144)
//
throw new IllegalStateException("An error occurred while decompiling this method.");
}
private static int d(final int n) {
if (cg.ae[n].J() > 0) {
return cg.ae[n].J();
}
return cg.ae[n].I() - cg.ae[n].Z();
}
public static String d(final String s) {
String substring = s;
if (s != null) {
substring = s;
if (s.startsWith("http://")) {
substring = s;
if (s.indexOf("&url=rtsp://") >= 0) {
substring = s.substring(s.indexOf("rtsp://"));
}
}
}
return substring;
}
public static void d() {
synchronized (cg.X) {
if (cg.aa != null) {
cg.Y = cg.aa;
cg.aa = null;
}
}
}
static String e() {
final int i = i();
final int j = j();
if (i != -1 && j != -1) {
String s;
for (s = Integer.toString(j); s.length() < 3; s = "0" + s) {}
return Integer.toString(i) + "-" + s;
}
return null;
}
public static Object[] e(String s) {
for (s = s.toLowerCase(); s.startsWith("<"); s = s.substring(s.indexOf(62) + 1)) {}
final int index = s.indexOf(58);
while (true) {
Label_0110: {
if (index == -1) {
break Label_0110;
}
final String substring = s.substring(0, index);
if (substring.indexOf(46) != -1) {
break Label_0110;
}
s = s.substring(index + 1);
String s2;
Integer n;
if (!cg.aB.containsKey(substring)) {
s2 = "";
n = cg.aC;
}
else {
String substring2 = s;
if (s.startsWith("//")) {
substring2 = s.substring(2);
}
final int index2 = substring2.indexOf(63);
s = substring2;
if (index2 != -1) {
s = substring2.substring(0, index2);
}
final int index3 = s.indexOf(47);
String substring3;
if (index3 != -1) {
substring3 = s.substring(0, index3);
s = s.substring(index3);
}
else {
final String s3 = "";
substring3 = s;
s = s3;
}
final int index4 = substring3.indexOf(64);
s2 = substring3;
if (index4 != -1) {
s2 = substring3.substring(index4 + 1);
}
if (s2.startsWith("www.")) {
s2 = s2.substring(4);
}
final int index5 = s2.indexOf(58);
if (index5 != -1) {
n = Integer.valueOf(s2.substring(index5 + 1));
s2 = s2.substring(0, index5);
}
else {
n = cg.aB.get(substring);
}
}
return new Object[] { substring, s2, n, s };
}
final String substring = "http";
continue;
}
}
static int f() {
return cg.az;
}
static int g() {
return cg.aA;
}
static String h() {
return "Opera Mini/7.6.40234/hifi/" + u.Code.U() + "/" + ac.Code();
}
private static int i() {
final int m = u.Code.M();
if (m != cg.ag && m != -1) {
cg.ag = m;
a("md");
}
return cg.ag;
}
private static int j() {
final int n = u.Code.N();
if (n != cg.ah && n != -1) {
cg.ah = n;
a("md");
}
return cg.ah;
}
private static void k() {
while (true) {
int n = 0;
Label_0153_Outer:
while (true) {
Label_0177: {
String b = null;
int code = 0;
while (true) {
String s = null;
Label_0160: {
Object o2;
synchronized (cg.class) {
final ak ak = new ak(32);
final int n2 = 0;
final int n3 = 0;
final Object o = null;
if (n >= cg.ac) {
if (o != null) {
Code(ak, n2, cg.ac - n2, n3, (String)o);
}
cg.G = ak.toByteArray();
return;
}
o2 = o;
if (!u.Code.a(n)) {
o2 = cg.ae[n];
b = ((au)o2).B();
code = Code((au)o2);
if ((s = (String)o) != null) {
if (((String)o).equals(b)) {
s = (String)o;
if (code == n3) {
break Label_0160;
}
}
Code(ak, n2, n - n2, n3, (String)o);
s = null;
}
break Label_0160;
}
}
final Object o = o2;
break Label_0177;
}
Object o2;
if ((o2 = s) != null) {
continue;
}
break;
}
final int n2 = n;
final Object o = b;
final int n3 = code;
}
++n;
continue Label_0153_Outer;
}
}
}
}
| [
"commit+ghdevapi.up@users.noreply.github.com"
] | commit+ghdevapi.up@users.noreply.github.com |
1353829b726c4aa325498d3bb1f5c344b03137e7 | d99434ea54ca9c0497720a56f59363e12f8c5aed | /src/block_editor/blocks/BlockMiddleOfLine.java | 7167e22c2b83314047f4cc7c5ba2ad8eb8480309 | [] | no_license | peter-marko/IJA | 06f5fee1c91059c8d25ea561e474d9a3754e24c5 | a5fd0c3e8f22c0180eb0e81b5d882cdffb5061fe | refs/heads/master | 2021-04-15T14:13:44.940663 | 2018-05-06T15:43:44 | 2018-05-06T15:43:44 | 126,827,011 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 943 | java | package block_editor.blocks;
/**
* Block for getting a middle point of the line
* @author Stanislav Mechl
*/
import javafx.scene.paint.Color;
import java.util.Map;
import block_editor.types.*;
public class BlockMiddleOfLine extends Block {
public BlockMiddleOfLine (String newName, Integer newID) {
this.name = newName;
this.id = newID;
this.inputs.add(new TypeLine(newID));
this.outputs.add(new TypeCoordinate2D(newID));
}
public void execute () {
Type in = inputs.get(0);
double output_x = (in.getVal("x1") + in.getVal("x2")) / 2;
double output_y = (in.getVal("y1") + in.getVal("y2")) / 2;
Type cur = outputs.getFirst();
cur.putVal("x", output_x);
cur.putVal("y", output_y);
cur.step();
this.setShadow(Color.GREEN);
System.out.println("final output x:"+ output_x + ", y:" + output_y);
this.showValues();
}
}
| [
"smechl@seznam.cz"
] | smechl@seznam.cz |
8b5bac7a07542ebb663fa4fc16ce4728f8dbf215 | 19ab34eddc034f86daa4f6d52587a168e78a77cb | /javabip-core/org.javabip.spec.examples/src/main/java/org/javabip/spec/helloatom/HelloAtomGlueBuilder.java | 13dd9f4d4033cf2398e8414ff3ad29f4e2795c4a | [] | no_license | TrinhLK/RunnableJavaBIPExample | ed74261695cb8912c8097ff638f0657678d0f1ef | 7126c45253185a9e05ff52ae319ad648f71c46ee | refs/heads/master | 2022-12-23T08:31:56.630915 | 2019-12-11T12:24:12 | 2019-12-11T12:24:12 | 206,248,251 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 880 | java | package org.javabip.spec.helloatom;
import org.javabip.glue.GlueBuilder;
import org.javabip.spec.trackpeer.Peer;
import org.javabip.spec.trackpeer.Tracker;
public class HelloAtomGlueBuilder extends GlueBuilder{
@Override
public void configure() {
// TODO Auto-generated method stub
// port(HelloAtomLoop.class, "LOOP").accepts(HelloAtomLoop.class, "LOOP");
// port(HelloAtomLoop.class, "LOOP").requires(HelloAtomLoop.class, "LOOP");
// port(HelloAtomLoop.class, "LOOP").requires(LoopConnector.class, "12");
port(HelloAtomLoop.class, "p").requires(LoopConnector.class, "12");
port(HelloAtomLoop.class, "p").accepts(LoopConnector.class, "12");
port(LoopConnector.class, "12").requires(HelloAtomLoop.class, "p");
port(LoopConnector.class, "12").accepts(HelloAtomLoop.class, "p");
data(HelloAtomLoop.class, "helloId").to(LoopConnector.class, "helloId");
}
}
| [
"trinhlk@Trinhs-MacBook-Pro.local"
] | trinhlk@Trinhs-MacBook-Pro.local |
97229823fc1253b0bef7fa7f876905711db1602c | 048c41012deb24e08e3628fcac0ab0757f00c629 | /surefire-extensions-api/src/test/java/org/apache/maven/plugin/surefire/extensions/JUnit4SuiteTest.java | d17e9a6643fb3ce7df7aa8fd06ed90346c8e1f78 | [
"Apache-2.0"
] | permissive | apache/maven-surefire | 8d09f50b3fc49bec02e6907eab8ea931982c8698 | 5aea5e2abf37456ecc775836ed3b97cd16dc5ad7 | refs/heads/master | 2023-08-31T11:52:25.145458 | 2023-08-23T16:41:09 | 2023-08-23T16:41:09 | 832,680 | 374 | 590 | null | 2023-08-31T19:26:27 | 2010-08-12T03:32:41 | Java | UTF-8 | Java | false | false | 1,243 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.plugin.surefire.extensions;
import junit.framework.JUnit4TestAdapter;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
*
*/
public class JUnit4SuiteTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(new JUnit4TestAdapter(CommandlineExecutorTest.class));
return suite;
}
}
| [
"tibor.digana@gmail.com"
] | tibor.digana@gmail.com |
aca3381ce6eb8db1112306ac6339d671add30545 | 2af00c7a9e77d1e2bd2705a00c60529fd8e5f5f5 | /app/src/main/java/com/example/orientacione/ui/dashboard/DashboardFragment.java | 376355e372ca78622763574ee062081f535e697f | [] | no_license | daniel071993/OrientacionE | 0ab50611b83bb8838ea564963da24ca41d50d393 | 7279d182045b0ab57ae8ef22c6437f3c458e9c2c | refs/heads/master | 2022-11-17T10:05:09.977238 | 2020-07-04T01:13:31 | 2020-07-04T01:13:31 | 277,015,195 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,203 | java | package com.example.orientacione.ui.dashboard;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import com.example.orientacione.R;
public class DashboardFragment extends Fragment {
private DashboardViewModel dashboardViewModel;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
dashboardViewModel =
ViewModelProviders.of(this).get(DashboardViewModel.class);
View root = inflater.inflate(R.layout.fragment_dashboard, container, false);
final TextView textView = root.findViewById(R.id.text_dashboard);
dashboardViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
}
});
return root;
}
} | [
"daniel071@gmail.com"
] | daniel071@gmail.com |
6fe3ec472fcedce6c07fb6a568500610e9be7d06 | 1e4ebe6f3053002712fc459559650ba6f266da93 | /src/com/bmc/gibraltar/automation/tests/appdev/ui/ViewDesignerPaletteTest.java | 4e8240b94840839004ed27774447fa2425a3146b | [] | no_license | kidddi/gibraltar-ui-tests | f5f4ec54877c55719b32f44dc26ee638574f36bb | 31fdca70a7117ef95dd495afb43222d102f9d3c3 | refs/heads/master | 2021-01-20T15:44:45.061289 | 2016-06-17T14:30:38 | 2016-06-17T14:30:38 | 60,620,465 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,186 | java | package com.bmc.gibraltar.automation.tests.appdev.ui;
import com.bmc.gibraltar.automation.items.element.ViewDesignerStencilGroup;
import com.bmc.gibraltar.automation.items.tab.Palette;
import com.bmc.gibraltar.automation.items.tab.PaletteForView;
import com.bmc.gibraltar.automation.pages.ViewDefinitionEditorPage;
import com.bmc.gibraltar.automation.pages.ViewDefinitionsPage;
import com.bmc.gibraltar.automation.tests.AppManagerBaseTest;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import ru.yandex.qatools.allure.annotations.Features;
import ru.yandex.qatools.allure.annotations.Stories;
import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
public class ViewDesignerPaletteTest extends AppManagerBaseTest {
private ViewDefinitionEditorPage viewDesigner;
private PaletteForView palette;
private String viewDefinitionName = "Edit Task";
@BeforeClass
public void openView() {
log.info("BeforeClass start");
ViewDefinitionsPage viewDefinitionsPage = new ViewDefinitionsPage(wd, "task-manager").navigateToPage();
viewDesigner = viewDefinitionsPage.openView(viewDefinitionName);
palette = viewDesigner.toPalette(Palette.DEFAULT_VIEW_DESIGNER_TAB);
log.info("BeforeClass end");
}
@AfterClass(alwaysRun = true)
public void closeDesigner() {
log.info("AfterClass start");
viewDesigner.close();
log.info("AfterClass end");
}
@Features("P528 - Process owner tailors view")
@Stories("US206674:'Basic View Designer'")
@Test
public void viewDefinitionNameInHeader() {
assertThat("View definition name is wrong", viewDesigner.getViewDefinitionName(), equalTo(viewDefinitionName));
}
@Features("P528 - Process owner tailors view")
@Stories("US206676:'View Designer Palette'")
@Test
public void presenceDeployedComponents() {
palette.verifyComponentsPresent(
"Container",
"Record Instance Editor",
"Activity Feed");
}
@Features("P528 - Process owner tailors view")
@Stories("US206676:'View Designer Palette'")
@Test
public void validateGroupsComponents() {
palette.verifyGroupsPresence(new ViewDesignerStencilGroup[]{ViewDesignerStencilGroup.BASIC_COMPONENTS});
}
@Features("P528 - Process owner tailors view")
@Stories("US206676:'View Designer Palette'")
@Test
public void basicComponentsPresence() {
palette.verifyComponentsPresentForGroup(ViewDesignerStencilGroup.BASIC_COMPONENTS,
"Attachment Panel",
"Container",
"Record Grid",
"Record Instance Editor");
}
@Features("P528 - Process owner tailors view")
@Stories("US206676:'View Designer Palette'")
@Test
public void componentOnPaletteSortedAlphabetically() {
List<String> actualBasicComponents = palette.getComponentNamesForGroup(ViewDesignerStencilGroup.BASIC_COMPONENTS);
assertTrue(isAlphabetical(actualBasicComponents));
}
} | [
"kidyuk@mail.ru"
] | kidyuk@mail.ru |
94591f4076764c0513e16ea52cd3ee93a0c83cb4 | a4d92a78e6d8b4fc5922a0e6896669695638383a | /src/main/java/com/model/controller/Controller.java | 930ec11de0534ee91eabb9cbcd57a54a61cf239b | [] | no_license | Bharanidhar-Reddy/Assessment6 | 54bd1ecf5b39330cf046ab2c2171cd4e1baf4807 | 42b031da3f91b7db187aee6ccb0ade713281057f | refs/heads/master | 2020-09-08T17:04:56.154080 | 2019-11-12T11:19:32 | 2019-11-12T11:19:32 | 221,191,600 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,569 | java | package com.model.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.example.model.Album;
import com.example.model.Artist;
import com.example.model.Track;
import com.example.repo.AlbumDal;
import com.example.repo.ArtistDal;
import com.example.repo.TrackDal;
@RestController
public class Controller {
@Autowired
private AlbumDal albumdal;
@Autowired
private ArtistDal artistdal;
@Autowired
private TrackDal trackdal;
@GetMapping("/artists")
private List<Artist> findall(){
return artistdal.findall();
}
@GetMapping(value = "/artists/{id}")
private Artist findartist(@PathVariable("id") String id){
return artistdal.find(id);
}
@GetMapping(value = "/albums/{id}")
private Album findalbum(@PathVariable("id") String id){
return albumdal.find(id);
}
@GetMapping(value = "/artists/{id}/albums")
private List<Album> findalbums(@PathVariable("id") String id){
return artistdal.getArtistAlbums(id);
}
@GetMapping(value = "/artists/{id}/albums/{aid}/tracks")
private List<Track> findtracks(@PathVariable("id") String id,@PathVariable("aid") String id2){
return albumdal.getAlbumTracks(id2);
}
@PostMapping(value="/artists")
private Artist addartist(@RequestBody Artist a) {
return artistdal.create(a);
}
@PostMapping(value = "/artists/{id}/albums")
private Album addalbums(@PathVariable("id") String id,@RequestBody Album a){
albumdal.create(a);
artistdal.addAlbumToArtist(a, artistdal.find(id));
return a;
}
@PostMapping(value = "/artists/{id}/albums/{aid}")
private Track addtrack(@PathVariable("id") String id,@PathVariable("aid") String id2,@RequestBody Track t){
trackdal.create(t);
albumdal.addTrackToAlbum(t, albumdal.find(id2));
return t;
}
@DeleteMapping(value = "/artists/{id}")
private boolean deleteartist(@PathVariable("id") String id){
return artistdal.deleteArtist(id);
}
@DeleteMapping(value = "/albums/{id}")
private boolean deletealbum(@PathVariable("id") String id){
return albumdal.deleteAlbum(id);
}
@DeleteMapping(value = "/tracks/{id}")
private boolean deletetrack(@PathVariable("id") String id){
return trackdal.deleteTrack(id);
}
}
| [
"bmarthala@dxc.com"
] | bmarthala@dxc.com |
80cd811b8a04362dbea0332160cd300a06647dc0 | 84fbc1625824ba75a02d1777116fe300456842e5 | /Engagement_Challenges/Engagement_4/withmi_2/source/org/digitaltip/record/actual/SimpleLogger.java | a8f9fa0f00b9ebf114a68d20da4165f946555d20 | [] | no_license | unshorn-forks/STAC | bd41dee06c3ab124177476dcb14a7652c3ddd7b3 | 6919d7cc84dbe050cef29ccced15676f24bb96de | refs/heads/master | 2023-03-18T06:37:11.922606 | 2018-04-18T17:01:03 | 2018-04-18T17:01:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 26,187 | java | /**
* Copyright (c) 2004-2012 QOS.ch
* All rights reserved.
*
* 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 org.digitaltip.record.actual;
import org.digitaltip.record.Logger;
import org.digitaltip.record.event.LoggingEvent;
import org.digitaltip.record.helpers.FormattingTuple;
import org.digitaltip.record.helpers.MarkerIgnoringBase;
import org.digitaltip.record.helpers.MessageFormatter;
import org.digitaltip.record.helpers.Util;
import org.digitaltip.record.spi.LocationAwareLogger;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.PrintStream;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Properties;
/**
* <p>Simple implementation of {@link Logger} that sends all enabled log messages,
* for all defined loggers, to the console ({@code System.err}).
* The following system properties are supported to configure the behavior of this logger:</p>
*
* <ul>
* <li><code>org.slf4j.simpleLogger.logFile</code> - The output target which can be the <em>path</em> to a file, or
* the special values "System.out" and "System.err". Default is "System.err".
*
* <li><code>org.slf4j.simpleLogger.defaultLogLevel</code> - Default log level for all instances of SimpleLogger.
* Must be one of ("trace", "debug", "info", "warn", or "error"). If not specified, defaults to "info". </li>
*
* <li><code>org.slf4j.simpleLogger.log.<em>a.b.c</em></code> - Logging detail level for a SimpleLogger instance
* named "a.b.c". Right-side value must be one of "trace", "debug", "info", "warn", or "error". When a SimpleLogger
* named "a.b.c" is initialized, its level is assigned from this property. If unspecified, the level of nearest parent
* logger will be used, and if none is set, then the value specified by
* <code>org.slf4j.simpleLogger.defaultLogLevel</code> will be used.</li>
*
* <li><code>org.slf4j.simpleLogger.showDateTime</code> - Set to <code>true</code> if you want the current date and
* time to be included in output messages. Default is <code>false</code></li>
*
* <li><code>org.slf4j.simpleLogger.dateTimeFormat</code> - The date and time format to be used in the output messages.
* The pattern describing the date and time format is defined by
* <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/text/SimpleDateFormat.html"><code>SimpleDateFormat</code></a>.
* If the format is not specified or is invalid, the number of milliseconds since start up will be output. </li>
*
* <li><code>org.slf4j.simpleLogger.showThreadName</code> -Set to <code>true</code> if you want to output the current
* thread name. Defaults to <code>true</code>.</li>
*
* <li><code>org.slf4j.simpleLogger.showLogName</code> - Set to <code>true</code> if you want the Logger instance name
* to be included in output messages. Defaults to <code>true</code>.</li>
*
* <li><code>org.slf4j.simpleLogger.showShortLogName</code> - Set to <code>true</code> if you want the last component
* of the name to be included in output messages. Defaults to <code>false</code>.</li>
*
* <li><code>org.slf4j.simpleLogger.levelInBrackets</code> - Should the level string be output in brackets? Defaults
* to <code>false</code>.</li>
*
* <li><code>org.slf4j.simpleLogger.warnLevelString</code> - The string value output for the warn level. Defaults
* to <code>WARN</code>.</li>
* </ul>
*
* <p>In addition to looking for system properties with the names specified above, this implementation also checks for
* a class loader resource named <code>"simplelogger.properties"</code>, and includes any matching definitions
* from this resource (if it exists).</p>
*
* <p>With no configuration, the default output includes the relative time in milliseconds, thread name, the level,
* logger name, and the message followed by the line separator for the host. In log4j terms it amounts to the "%r [%t]
* %level %logger - %m%n" pattern. </p>
* <p>Sample output follows.</p>
* <pre>
* 176 [main] INFO examples.Sort - Populating an array of 2 elements in reverse order.
* 225 [main] INFO examples.SortAlgo - Entered the sort method.
* 304 [main] INFO examples.SortAlgo - Dump of integer array:
* 317 [main] INFO examples.SortAlgo - Element [0] = 0
* 331 [main] INFO examples.SortAlgo - Element [1] = 1
* 343 [main] INFO examples.Sort - The next log statement should be an error message.
* 346 [main] ERROR examples.SortAlgo - Tried to dump an uninitialized array.
* at org.log4j.examples.SortAlgo.dump(SortAlgo.java:58)
* at org.log4j.examples.Sort.main(Sort.java:64)
* 467 [main] INFO examples.Sort - Exiting main method.
* </pre>
*
* <p>This implementation is heavily inspired by
* <a href="http://commons.apache.org/logging/">Apache Commons Logging</a>'s SimpleLog.</p>
*
* @author Ceki Gülcü
* @author <a href="mailto:sanders@apache.org">Scott Sanders</a>
* @author Rod Waldhoff
* @author Robert Burrell Donkin
* @author Cédrik LIME
*/
public class SimpleLogger extends MarkerIgnoringBase {
private static final long serialVersionUID = -632788891211436180L;
private static final String CONFIGURATION_FILE = "simplelogger.properties";
private static long START_TIME = System.currentTimeMillis();
private static final Properties SIMPLE_LOGGER_PROPS = new Properties();
private static final int LOG_LEVEL_TRACE = LocationAwareLogger.TRACE_INT;
private static final int LOG_LEVEL_DEBUG = LocationAwareLogger.DEBUG_INT;
private static final int LOG_LEVEL_INFO = LocationAwareLogger.INFO_INT;
private static final int LOG_LEVEL_WARN = LocationAwareLogger.WARN_INT;
private static final int LOG_LEVEL_ERROR = LocationAwareLogger.ERROR_INT;
private static boolean INITIALIZED = false;
private static int DEFAULT_LOG_LEVEL = LOG_LEVEL_INFO;
private static boolean SHOW_DATE_TIME = false;
private static String DATE_TIME_FORMAT_STR = null;
private static DateFormat DATE_FORMATTER = null;
private static boolean SHOW_THREAD_NAME = true;
private static boolean SHOW_LOG_NAME = true;
private static boolean SHOW_SHORT_LOG_NAME = false;
private static String LOG_FILE = "System.err";
private static PrintStream TARGET_STREAM = null;
private static boolean LEVEL_IN_BRACKETS = false;
private static String WARN_LEVEL_STRING = "WARN";
/** All system properties used by <code>SimpleLogger</code> start with this prefix */
public static final String SYSTEM_PREFIX = "org.slf4j.simpleLogger.";
public static final String DEFAULT_LOG_LEVEL_KEY = SYSTEM_PREFIX + "defaultLogLevel";
public static final String SHOW_DATE_TIME_KEY = SYSTEM_PREFIX + "showDateTime";
public static final String DATE_TIME_FORMAT_KEY = SYSTEM_PREFIX + "dateTimeFormat";
public static final String SHOW_THREAD_NAME_KEY = SYSTEM_PREFIX + "showThreadName";
public static final String SHOW_LOG_NAME_KEY = SYSTEM_PREFIX + "showLogName";
public static final String SHOW_SHORT_LOG_NAME_KEY = SYSTEM_PREFIX + "showShortLogName";
public static final String LOG_FILE_KEY = SYSTEM_PREFIX + "logFile";
public static final String LEVEL_IN_BRACKETS_KEY = SYSTEM_PREFIX + "levelInBrackets";
public static final String WARN_LEVEL_STRING_KEY = SYSTEM_PREFIX + "warnLevelString";
public static final String LOG_KEY_PREFIX = SYSTEM_PREFIX + "log.";
private static String getStringProperty(String name) {
String prop = null;
try {
prop = System.getProperty(name);
} catch (SecurityException e) {
; // Ignore
}
return (prop == null) ? SIMPLE_LOGGER_PROPS.getProperty(name) : prop;
}
private static String getStringProperty(String name, String defaultValue) {
String prop = getStringProperty(name);
return (prop == null) ? defaultValue : prop;
}
private static boolean getBooleanProperty(String name, boolean defaultValue) {
String prop = getStringProperty(name);
return (prop == null) ? defaultValue : "true".equalsIgnoreCase(prop);
}
// Initialize class attributes.
// Load properties file, if found.
// Override with system properties.
static void init() {
if (INITIALIZED) {
return;
}
INITIALIZED = true;
loadProperties();
String defaultLogLevelString = getStringProperty(DEFAULT_LOG_LEVEL_KEY, null);
if (defaultLogLevelString != null)
DEFAULT_LOG_LEVEL = stringToLevel(defaultLogLevelString);
SHOW_LOG_NAME = getBooleanProperty(SHOW_LOG_NAME_KEY, SHOW_LOG_NAME);
SHOW_SHORT_LOG_NAME = getBooleanProperty(SHOW_SHORT_LOG_NAME_KEY, SHOW_SHORT_LOG_NAME);
SHOW_DATE_TIME = getBooleanProperty(SHOW_DATE_TIME_KEY, SHOW_DATE_TIME);
SHOW_THREAD_NAME = getBooleanProperty(SHOW_THREAD_NAME_KEY, SHOW_THREAD_NAME);
DATE_TIME_FORMAT_STR = getStringProperty(DATE_TIME_FORMAT_KEY, DATE_TIME_FORMAT_STR);
LEVEL_IN_BRACKETS = getBooleanProperty(LEVEL_IN_BRACKETS_KEY, LEVEL_IN_BRACKETS);
WARN_LEVEL_STRING = getStringProperty(WARN_LEVEL_STRING_KEY, WARN_LEVEL_STRING);
LOG_FILE = getStringProperty(LOG_FILE_KEY, LOG_FILE);
TARGET_STREAM = computeTargetStream(LOG_FILE);
if (DATE_TIME_FORMAT_STR != null) {
try {
DATE_FORMATTER = new SimpleDateFormat(DATE_TIME_FORMAT_STR);
} catch (IllegalArgumentException e) {
Util.report("Bad date format in " + CONFIGURATION_FILE + "; will output relative time", e);
}
}
}
private static PrintStream computeTargetStream(String logFile) {
if ("System.err".equalsIgnoreCase(logFile))
return System.err;
else if ("System.out".equalsIgnoreCase(logFile)) {
return System.out;
} else {
try {
FileOutputStream fos = new FileOutputStream(logFile);
PrintStream printStream = new PrintStream(fos);
return printStream;
} catch (FileNotFoundException e) {
Util.report("Could not open [" + logFile + "]. Defaulting to System.err", e);
return System.err;
}
}
}
private static void loadProperties() {
// Add props from the resource simplelogger.properties
InputStream in = AccessController.doPrivileged(new PrivilegedAction<InputStream>() {
public InputStream run() {
ClassLoader threadCL = Thread.currentThread().getContextClassLoader();
if (threadCL != null) {
return threadCL.getResourceAsStream(CONFIGURATION_FILE);
} else {
return ClassLoader.getSystemResourceAsStream(CONFIGURATION_FILE);
}
}
});
if (null != in) {
loadPropertiesHome(in);
}
}
private static void loadPropertiesHome(InputStream in) {
try {
SIMPLE_LOGGER_PROPS.load(in);
in.close();
} catch (java.io.IOException e) {
// ignored
}
}
/** The current log level */
protected int currentLogLevel = LOG_LEVEL_INFO;
/** The short name of this simple log instance */
private transient String shortLogName = null;
/**
* Package access allows only {@link SimpleLoggerFactory} to instantiate
* SimpleLogger instances.
*/
SimpleLogger(String name) {
this.name = name;
String levelString = recursivelyComputeLevelString();
if (levelString != null) {
this.currentLogLevel = stringToLevel(levelString);
} else {
this.currentLogLevel = DEFAULT_LOG_LEVEL;
}
}
String recursivelyComputeLevelString() {
String tempName = name;
String levelString = null;
int indexOfLastDot = tempName.length();
while ((levelString == null) && (indexOfLastDot > -1)) {
tempName = tempName.substring(0, indexOfLastDot);
levelString = getStringProperty(LOG_KEY_PREFIX + tempName, null);
indexOfLastDot = String.valueOf(tempName).lastIndexOf(".");
}
return levelString;
}
private static int stringToLevel(String levelStr) {
if ("trace".equalsIgnoreCase(levelStr)) {
return LOG_LEVEL_TRACE;
} else if ("debug".equalsIgnoreCase(levelStr)) {
return LOG_LEVEL_DEBUG;
} else if ("info".equalsIgnoreCase(levelStr)) {
return LOG_LEVEL_INFO;
} else if ("warn".equalsIgnoreCase(levelStr)) {
return LOG_LEVEL_WARN;
} else if ("error".equalsIgnoreCase(levelStr)) {
return LOG_LEVEL_ERROR;
}
// assume INFO by default
return LOG_LEVEL_INFO;
}
/**
* This is our internal implementation for logging regular (non-parameterized)
* log messages.
*
* @param level One of the LOG_LEVEL_XXX constants defining the log level
* @param message The message itself
* @param t The exception whose stack trace should be logged
*/
private void log(int level, String message, Throwable t) {
if (!isLevelEnabled(level)) {
return;
}
StringBuilder buf = new StringBuilder(32);
// Append date-time if so configured
if (SHOW_DATE_TIME) {
logEntity(buf);
}
// Append current thread name if so configured
if (SHOW_THREAD_NAME) {
logHerder(buf);
}
if (LEVEL_IN_BRACKETS)
buf.append('[');
// Append a readable representation of the log level
switch (level) {
case LOG_LEVEL_TRACE:
buf.append("TRACE");
break;
case LOG_LEVEL_DEBUG:
buf.append("DEBUG");
break;
case LOG_LEVEL_INFO:
buf.append("INFO");
break;
case LOG_LEVEL_WARN:
buf.append(WARN_LEVEL_STRING);
break;
case LOG_LEVEL_ERROR:
buf.append("ERROR");
break;
}
if (LEVEL_IN_BRACKETS)
buf.append(']');
buf.append(' ');
// Append the name of the log instance if so configured
if (SHOW_SHORT_LOG_NAME) {
if (shortLogName == null)
shortLogName = computeShortName();
buf.append(String.valueOf(shortLogName)).append(" - ");
} else if (SHOW_LOG_NAME) {
logFunction(buf);
}
// Append the message
buf.append(message);
write(buf, t);
}
private void logFunction(StringBuilder buf) {
buf.append(String.valueOf(name)).append(" - ");
}
private void logHerder(StringBuilder buf) {
new SimpleLoggerCoordinator(buf).invoke();
}
private void logEntity(StringBuilder buf) {
new SimpleLoggerAdviser(buf).invoke();
}
void write(StringBuilder buf, Throwable t) {
TARGET_STREAM.println(buf.toString());
if (t != null) {
writeExecutor(t);
}
TARGET_STREAM.flush();
}
private void writeExecutor(Throwable t) {
t.printStackTrace(TARGET_STREAM);
}
private String computeShortName() {
return name.substring(name.lastIndexOf(".") + 1);
}
/**
* For formatted messages, first substitute arguments and then log.
*
* @param level
* @param format
* @param arg1
* @param arg2
*/
private void formatAndLog(int level, String format, Object arg1, Object arg2) {
if (!isLevelEnabled(level)) {
return;
}
FormattingTuple tp = MessageFormatter.format(format, arg1, arg2);
log(level, tp.obtainMessage(), tp.obtainThrowable());
}
/**
* For formatted messages, first substitute arguments and then log.
*
* @param level
* @param format
* @param arguments a list of 3 ore more arguments
*/
private void formatAndLog(int level, String format, Object... arguments) {
if (!isLevelEnabled(level)) {
return;
}
FormattingTuple tp = MessageFormatter.arrayFormat(format, arguments);
log(level, tp.obtainMessage(), tp.obtainThrowable());
}
/**
* Is the given log level currently enabled?
*
* @param logLevel is this level enabled?
*/
protected boolean isLevelEnabled(int logLevel) {
// log level are numerically ordered so can use simple numeric
// comparison
return (logLevel >= currentLogLevel);
}
/** Are {@code trace} messages currently enabled? */
public boolean isTraceEnabled() {
return isLevelEnabled(LOG_LEVEL_TRACE);
}
/**
* A simple implementation which logs messages of level TRACE according
* to the format outlined above.
*/
public void trace(String msg) {
log(LOG_LEVEL_TRACE, msg, null);
}
/**
* Perform single parameter substitution before logging the message of level
* TRACE according to the format outlined above.
*/
public void trace(String format, Object param1) {
formatAndLog(LOG_LEVEL_TRACE, format, param1, null);
}
/**
* Perform double parameter substitution before logging the message of level
* TRACE according to the format outlined above.
*/
public void trace(String format, Object param1, Object param2) {
formatAndLog(LOG_LEVEL_TRACE, format, param1, param2);
}
/**
* Perform double parameter substitution before logging the message of level
* TRACE according to the format outlined above.
*/
public void trace(String format, Object... argArray) {
formatAndLog(LOG_LEVEL_TRACE, format, argArray);
}
/** Log a message of level TRACE, including an exception. */
public void trace(String msg, Throwable t) {
log(LOG_LEVEL_TRACE, msg, t);
}
/** Are {@code debug} messages currently enabled? */
public boolean isDebugEnabled() {
return isLevelEnabled(LOG_LEVEL_DEBUG);
}
/**
* A simple implementation which logs messages of level DEBUG according
* to the format outlined above.
*/
public void debug(String msg) {
log(LOG_LEVEL_DEBUG, msg, null);
}
/**
* Perform single parameter substitution before logging the message of level
* DEBUG according to the format outlined above.
*/
public void debug(String format, Object param1) {
formatAndLog(LOG_LEVEL_DEBUG, format, param1, null);
}
/**
* Perform double parameter substitution before logging the message of level
* DEBUG according to the format outlined above.
*/
public void debug(String format, Object param1, Object param2) {
formatAndLog(LOG_LEVEL_DEBUG, format, param1, param2);
}
/**
* Perform double parameter substitution before logging the message of level
* DEBUG according to the format outlined above.
*/
public void debug(String format, Object... argArray) {
formatAndLog(LOG_LEVEL_DEBUG, format, argArray);
}
/** Log a message of level DEBUG, including an exception. */
public void debug(String msg, Throwable t) {
log(LOG_LEVEL_DEBUG, msg, t);
}
/** Are {@code info} messages currently enabled? */
public boolean isInfoEnabled() {
return isLevelEnabled(LOG_LEVEL_INFO);
}
/**
* A simple implementation which logs messages of level INFO according
* to the format outlined above.
*/
public void info(String msg) {
log(LOG_LEVEL_INFO, msg, null);
}
/**
* Perform single parameter substitution before logging the message of level
* INFO according to the format outlined above.
*/
public void info(String format, Object arg) {
formatAndLog(LOG_LEVEL_INFO, format, arg, null);
}
/**
* Perform double parameter substitution before logging the message of level
* INFO according to the format outlined above.
*/
public void info(String format, Object arg1, Object arg2) {
formatAndLog(LOG_LEVEL_INFO, format, arg1, arg2);
}
/**
* Perform double parameter substitution before logging the message of level
* INFO according to the format outlined above.
*/
public void info(String format, Object... argArray) {
formatAndLog(LOG_LEVEL_INFO, format, argArray);
}
/** Log a message of level INFO, including an exception. */
public void info(String msg, Throwable t) {
log(LOG_LEVEL_INFO, msg, t);
}
/** Are {@code warn} messages currently enabled? */
public boolean isWarnEnabled() {
return isLevelEnabled(LOG_LEVEL_WARN);
}
/**
* A simple implementation which always logs messages of level WARN according
* to the format outlined above.
*/
public void warn(String msg) {
log(LOG_LEVEL_WARN, msg, null);
}
/**
* Perform single parameter substitution before logging the message of level
* WARN according to the format outlined above.
*/
public void warn(String format, Object arg) {
formatAndLog(LOG_LEVEL_WARN, format, arg, null);
}
/**
* Perform double parameter substitution before logging the message of level
* WARN according to the format outlined above.
*/
public void warn(String format, Object arg1, Object arg2) {
formatAndLog(LOG_LEVEL_WARN, format, arg1, arg2);
}
/**
* Perform double parameter substitution before logging the message of level
* WARN according to the format outlined above.
*/
public void warn(String format, Object... argArray) {
formatAndLog(LOG_LEVEL_WARN, format, argArray);
}
/** Log a message of level WARN, including an exception. */
public void warn(String msg, Throwable t) {
log(LOG_LEVEL_WARN, msg, t);
}
/** Are {@code error} messages currently enabled? */
public boolean isErrorEnabled() {
return isLevelEnabled(LOG_LEVEL_ERROR);
}
/**
* A simple implementation which always logs messages of level ERROR according
* to the format outlined above.
*/
public void error(String msg) {
log(LOG_LEVEL_ERROR, msg, null);
}
/**
* Perform single parameter substitution before logging the message of level
* ERROR according to the format outlined above.
*/
public void error(String format, Object arg) {
formatAndLog(LOG_LEVEL_ERROR, format, arg, null);
}
/**
* Perform double parameter substitution before logging the message of level
* ERROR according to the format outlined above.
*/
public void error(String format, Object arg1, Object arg2) {
formatAndLog(LOG_LEVEL_ERROR, format, arg1, arg2);
}
/**
* Perform double parameter substitution before logging the message of level
* ERROR according to the format outlined above.
*/
public void error(String format, Object... argArray) {
formatAndLog(LOG_LEVEL_ERROR, format, argArray);
}
/** Log a message of level ERROR, including an exception. */
public void error(String msg, Throwable t) {
log(LOG_LEVEL_ERROR, msg, t);
}
public void log(LoggingEvent event) {
int levelInt = event.obtainLevel().toInt();
if (!isLevelEnabled(levelInt)) {
return;
}
FormattingTuple tp = MessageFormatter.arrayFormat(event.getMessage(), event.pullArgumentArray(), event.obtainThrowable());
log(levelInt, tp.obtainMessage(), event.obtainThrowable());
}
private class SimpleLoggerAdviser {
private StringBuilder buf;
public SimpleLoggerAdviser(StringBuilder buf) {
this.buf = buf;
}
public void invoke() {
if (DATE_FORMATTER != null) {
invokeHelper();
} else {
invokeUtility();
}
}
private void invokeUtility() {
buf.append(System.currentTimeMillis() - START_TIME);
buf.append(' ');
}
private void invokeHelper() {
buf.append(getFormattedDate());
buf.append(' ');
}
private String getFormattedDate() {
Date now = new Date();
String dateText;
synchronized (DATE_FORMATTER) {
dateText = DATE_FORMATTER.format(now);
}
return dateText;
}
}
private class SimpleLoggerCoordinator {
private StringBuilder buf;
public SimpleLoggerCoordinator(StringBuilder buf) {
this.buf = buf;
}
public void invoke() {
buf.append('[');
buf.append(Thread.currentThread().getName());
buf.append("] ");
}
}
}
| [
"rborbely@cyberpointllc.com"
] | rborbely@cyberpointllc.com |
6395f772f5f293f72e14cc9e375364fa51272738 | 384c6d01e63e42fd1708a196590db64d63360098 | /src/main/java/dev/samujjal/coding/interview/domain/DeliverySlot.java | 576b57be8e1cf0bfe2992d73c53d202094fc8f3d | [] | no_license | samujjalm/sigtupleproblems | 17e9ba2b570029b4b8b13716e007331748fe80cd | 7f42ae5a27577285d2911fe63e2837ae979d764d | refs/heads/master | 2022-01-10T02:57:35.629483 | 2019-07-20T10:37:26 | 2019-07-20T10:37:26 | 197,902,932 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 467 | java | package dev.samujjal.coding.interview.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode
public class DeliverySlot {
private LocalDateTime startTime;
private LocalDateTime endTime;
private int requestedUnits;
private Boolean slotAvailable;
private String medicineName;
}
| [
"samujjal.majumder@traveloka.com"
] | samujjal.majumder@traveloka.com |
9d7aea6a36f091ea5ab673167601bd42954baef3 | 80bb2019f1f8cf0db2191b34ec486faff6433b0c | /spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/EnvironmentControllerTests.java | a8d80268182377528ea37192ad8d5dca0cb2d56f | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] | permissive | roykachouh/spring-cloud-config | f289a0c1a967bd3148dc978a6ef122f5257d54c4 | 2865804c5bac23b8ba0ebb973a882368b92b3f57 | refs/heads/master | 2021-01-18T02:22:57.834360 | 2015-02-24T22:14:56 | 2015-02-24T23:14:06 | 29,275,294 | 0 | 0 | null | 2015-01-15T01:46:07 | 2015-01-15T01:46:07 | null | UTF-8 | Java | false | false | 6,043 | java | /*
* Copyright 2013-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.config.server;
import static org.junit.Assert.assertEquals;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.Mockito;
import org.springframework.cloud.config.Environment;
import org.springframework.cloud.config.PropertySource;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
/**
* @author Dave Syer
*
*/
public class EnvironmentControllerTests {
@Rule
public ExpectedException expected = ExpectedException.none();
private EnvironmentRepository repository = Mockito.mock(EnvironmentRepository.class);
private EnvironmentController controller = new EnvironmentController(repository,
new EncryptionController());
private Environment environment = new Environment("foo", "master");
@Test
public void vanillaYaml() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
map.put("a.b.c", "d");
environment.add(new PropertySource("one", map));
Mockito.when(repository.findOne("foo", "bar", "master")).thenReturn(environment);
String yaml = controller.yaml("foo", "bar").getBody();
assertEquals("a:\n b:\n c: d\n", yaml);
}
@Test
public void propertyOverrideInYaml() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
map.put("a.b.c", "d");
environment.add(new PropertySource("one", map));
environment.addFirst(new PropertySource("two", Collections.singletonMap("a.b.c", "e")));
Mockito.when(repository.findOne("foo", "bar", "master")).thenReturn(environment);
String yaml = controller.yaml("foo", "bar").getBody();
assertEquals("a:\n b:\n c: e\n", yaml);
}
@Test
public void arrayInYaml() throws Exception {
Map<String, Object> map = new LinkedHashMap<String, Object>();
map.put("a.b[0]", "c");
map.put("a.b[1]", "d");
environment.add(new PropertySource("one", map));
Mockito.when(repository.findOne("foo", "bar", "master")).thenReturn(environment);
String yaml = controller.yaml("foo", "bar").getBody();
assertEquals("a:\n b:\n - c\n - d\n", yaml);
}
@Test
public void mappingForEnvironment() throws Exception {
Mockito.when(repository.findOne("foo", "bar", "master")).thenReturn(environment);
MockMvc mvc = MockMvcBuilders.standaloneSetup(controller).build();
mvc.perform(MockMvcRequestBuilders.get("/foo/bar")).andExpect(
MockMvcResultMatchers.status().isOk());
}
@Test
public void mappingForLabelledEnvironment() throws Exception {
Mockito.when(repository.findOne("foo", "bar", "other")).thenReturn(environment);
MockMvc mvc = MockMvcBuilders.standaloneSetup(controller).build();
mvc.perform(MockMvcRequestBuilders.get("/foo/bar/other")).andExpect(
MockMvcResultMatchers.status().isOk());
}
@Test
public void mappingForYaml() throws Exception {
Mockito.when(repository.findOne("foo", "bar", "master")).thenReturn(environment);
MockMvc mvc = MockMvcBuilders.standaloneSetup(controller).build();
mvc.perform(MockMvcRequestBuilders.get("/foo-bar.yml")).andExpect(
MockMvcResultMatchers.content().contentType(MediaType.TEXT_PLAIN));
}
@Test
public void mappingForLabelledYaml() throws Exception {
Mockito.when(repository.findOne("foo", "bar", "other")).thenReturn(environment);
MockMvc mvc = MockMvcBuilders.standaloneSetup(controller).build();
mvc.perform(MockMvcRequestBuilders.get("/other/foo-bar.yml")).andExpect(
MockMvcResultMatchers.content().contentType(MediaType.TEXT_PLAIN));
}
@Test
public void mappingForLabelledProperties() throws Exception {
Mockito.when(repository.findOne("foo", "bar", "other")).thenReturn(environment);
MockMvc mvc = MockMvcBuilders.standaloneSetup(controller).build();
mvc.perform(MockMvcRequestBuilders.get("/other/foo-bar.properties")).andExpect(
MockMvcResultMatchers.content().contentType(MediaType.TEXT_PLAIN));
}
@Test
public void mappingForProperties() throws Exception {
Mockito.when(repository.findOne("foo", "bar", "master")).thenReturn(environment);
MockMvc mvc = MockMvcBuilders.standaloneSetup(controller).build();
mvc.perform(MockMvcRequestBuilders.get("/foo-bar.properties")).andExpect(
MockMvcResultMatchers.content().contentType(MediaType.TEXT_PLAIN));
}
@Test
public void mappingForLabelledYamlWithHyphen() throws Exception {
Mockito.when(repository.findOne("foo", "bar-spam", "other")).thenReturn(
environment);
MockMvc mvc = MockMvcBuilders.standaloneSetup(controller).build();
mvc.perform(MockMvcRequestBuilders.get("/other/foo-bar-spam.yml")).andExpect(
MockMvcResultMatchers.status().isBadRequest());
}
@Test
public void allowOverrideFalse() throws Exception {
controller.setOverrides(Collections.singletonMap("foo", "bar"));
Map<String, Object> map = new HashMap<String, Object>();
map.put("a.b.c", "d");
environment.add(new PropertySource("one", map));
Mockito.when(repository.findOne("foo", "bar", "master")).thenReturn(environment);
assertEquals("{foo=bar}", controller.master("foo", "bar").getPropertySources()
.get(0).getSource().toString());
}
}
| [
"dsyer@pivotal.io"
] | dsyer@pivotal.io |
c7c70d9094c281d2f23466f374a1083091d7e460 | 685648d14336d1ef12575904d8a81c22e8c357c6 | /src/main/java/com/fc/model/RecommendModel.java | 43e93b0eb252d1157f983d2b776f67e945b8a948 | [] | no_license | wyx1478963/forum | 2a9982c55f1ad9b087536bf911c2686220427d45 | 76567fc3c97d6a70cd66149ee41aa57b2ecb5346 | refs/heads/master | 2020-03-14T16:33:27.096857 | 2018-06-03T08:05:34 | 2018-06-03T08:05:34 | 131,700,315 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,128 | java | package com.fc.model;
import org.deeplearning4j.models.embeddings.loader.WordVectorSerializer;
import org.deeplearning4j.models.word2vec.Word2Vec;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.io.File;
@Component
public class RecommendModel {
private Word2Vec model;
public RecommendModel() {
// long start = System.currentTimeMillis();
// try {
// File file = new File(this.getClass().getClassLoader().getResource("embedding.model").getPath());
// System.out.println(file.getPath());
// Word2Vec recommendModel = WordVectorSerializer.readWord2VecModel(file);
// long end = System.currentTimeMillis();
// Logger logger = LoggerFactory.getLogger(com.sohu.CFRecommend.data.model.RecommendModel.class);
// logger.info(String.format("Model file loaded in %dms.", end - start));
// this.model = recommendModel;
// } catch (Exception e) {
// e.printStackTrace();
// }
}
public Word2Vec getModel() {
return model;
}
} | [
"yongxuanwen@sohu-inc.com"
] | yongxuanwen@sohu-inc.com |
0dd1978e9ecc710e6bccbbdefda4e81d5354f13a | adde0e71a48162653fec33b2a2f52abd427539d4 | /x10-2.4.3-src/x10.runtime/src-java/gen/x10/compiler/ws/Worker.java | 0b007e9c29e6a85ce43debc62baebcd2cb886243 | [] | no_license | indukprabhu/deepChunking | f8030f128df5b968413b7a776c56ef7695f70667 | 2784c6884d19493ea6372343145e557810b8e45b | refs/heads/master | 2022-06-07T19:22:19.105255 | 2020-04-29T18:49:33 | 2020-04-29T18:49:33 | 259,726,892 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 71,327 | java | package x10.compiler.ws;
@x10.runtime.impl.java.X10Generated
final public class Worker extends x10.core.Ref implements x10.serialization.X10JavaSerializable
{
public static final x10.rtt.RuntimeType<Worker> $RTT =
x10.rtt.NamedType.<Worker> make("x10.compiler.ws.Worker",
Worker.class);
public x10.rtt.RuntimeType<?> $getRTT() { return $RTT; }
public x10.rtt.Type<?> $getParam(int i) { return null; }
public static x10.serialization.X10JavaSerializable $_deserialize_body(x10.compiler.ws.Worker $_obj, x10.serialization.X10JavaDeserializer $deserializer) throws java.io.IOException {
$_obj.workers = $deserializer.readObject();
$_obj.random = $deserializer.readObject();
$_obj.id = $deserializer.readInt();
$_obj.deque = $deserializer.readObject();
$_obj.fifo = $deserializer.readObject();
$_obj.lock = $deserializer.readObject();
$_obj.throwable = $deserializer.readObject();
return $_obj;
}
public static x10.serialization.X10JavaSerializable $_deserializer(x10.serialization.X10JavaDeserializer $deserializer) throws java.io.IOException {
x10.compiler.ws.Worker $_obj = new x10.compiler.ws.Worker((java.lang.System[]) null);
$deserializer.record_reference($_obj);
return $_deserialize_body($_obj, $deserializer);
}
public void $_serialize(x10.serialization.X10JavaSerializer $serializer) throws java.io.IOException {
$serializer.write(this.workers);
$serializer.write(this.random);
$serializer.write(this.id);
$serializer.write(this.deque);
$serializer.write(this.fifo);
$serializer.write(this.lock);
$serializer.write(this.throwable);
}
// constructor just for allocation
public Worker(final java.lang.System[] $dummy) {
}
// synthetic type for parameter mangling
public static final class __1$1x10$compiler$ws$Worker$2 {}
//#line 23 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public x10.core.Rail<x10.compiler.ws.Worker> workers;
//#line 24 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public x10.util.Random random;
//#line 26 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public int id;
//#line 27 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public x10.core.Deque deque;
//#line 28 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public x10.core.Deque fifo;
//#line 29 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public x10.util.concurrent.Lock lock;
//#line 31 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public java.lang.RuntimeException throwable;
//#line 33 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
// creation method for java code (1-phase java constructor)
public Worker(final int i, final x10.core.Rail<x10.compiler.ws.Worker> workers, __1$1x10$compiler$ws$Worker$2 $dummy) {
this((java.lang.System[]) null);
x10$compiler$ws$Worker$$init$S(i, workers, (x10.compiler.ws.Worker.__1$1x10$compiler$ws$Worker$2) null);
}
// constructor for non-virtual call
final public x10.compiler.ws.Worker x10$compiler$ws$Worker$$init$S(final int i, final x10.core.Rail<x10.compiler.ws.Worker> workers, __1$1x10$compiler$ws$Worker$2 $dummy) {
{
//#line 33 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
//#line 22 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
this.__fieldInitializers_x10_compiler_ws_Worker();
//#line 34 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.util.Random alloc$77551 = ((x10.util.Random)(new x10.util.Random((java.lang.System[]) null)));
//#line 34 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final long t$80493 = ((long)(((int)(8))));
//#line 34 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80494 = ((i) << (int)(((long)(t$80493))));
//#line 34 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80495 = ((i) + (((int)(t$80494))));
//#line 34 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final long t$80496 = ((long)(((int)(16))));
//#line 34 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80497 = ((i) << (int)(((long)(t$80496))));
//#line 34 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80498 = ((t$80495) + (((int)(t$80497))));
//#line 34 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final long t$80499 = ((long)(((int)(24))));
//#line 34 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80500 = ((i) << (int)(((long)(t$80499))));
//#line 34 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80501 = ((t$80498) + (((int)(t$80500))));
//#line 34 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final long t$80502 = ((long)(((int)(t$80501))));
//#line 34 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
alloc$77551.x10$util$Random$$init$S(t$80502);
//#line 34 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
this.random = ((x10.util.Random)(alloc$77551));
//#line 35 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
this.id = i;
//#line 36 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
this.workers = ((x10.core.Rail)(workers));
}
return this;
}
//#line 39 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public void migrate() {
//#line 40 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
x10.compiler.ws.RegularFrame k = null;
//#line 41 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.util.concurrent.Lock t$80369 = ((x10.util.concurrent.Lock)(lock));
//#line 41 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
t$80369.lock();
//#line 42 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
while (true) {
//#line 42 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.core.Deque t$80370 = ((x10.core.Deque)(deque));
//#line 42 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.Object t$80371 = t$80370.steal();
//#line 42 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.RegularFrame t$80372 = ((x10.compiler.ws.RegularFrame) t$80371);
//#line 42 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.RegularFrame t$80373 = k = ((x10.compiler.ws.RegularFrame)(t$80372));
//#line 42 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final boolean t$80381 = ((null) != (t$80373));
//#line 42 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
if (!(t$80381)) {
//#line 42 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
break;
}
//#line 46 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.util.concurrent.Monitor t$80503 = ((x10.util.concurrent.Monitor)(x10.lang.Runtime.get$atomicMonitor()));
//#line 46 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
t$80503.lock();
//#line 46 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.RegularFrame t$80504 = ((x10.compiler.ws.RegularFrame)(k));
//#line 46 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.FinishFrame obj$80505 = ((x10.compiler.ws.FinishFrame)(t$80504.ff));
//#line 46 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80506 = obj$80505.asyncs;
//#line 46 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80507 = ((t$80506) + (((int)(1))));
//#line 46 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
obj$80505.asyncs = t$80507;
//#line 46 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.util.concurrent.Monitor t$80508 = ((x10.util.concurrent.Monitor)(x10.lang.Runtime.get$atomicMonitor()));
//#line 46 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
t$80508.unlock();
//#line 47 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.core.Deque t$80509 = ((x10.core.Deque)(fifo));
//#line 47 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.RegularFrame t$80510 = ((x10.compiler.ws.RegularFrame)(k));
//#line 47 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
t$80509.push(((java.lang.Object)(t$80510)));
}
//#line 49 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.util.concurrent.Lock t$80382 = ((x10.util.concurrent.Lock)(lock));
//#line 49 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
t$80382.unlock();
}
//#line 52 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public void run() {
//#line 53 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
try {{
//#line 54 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
while (true) {
//#line 55 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.Object k = this.find();
//#line 56 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final boolean t$80383 = ((null) == (k));
//#line 56 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
if (t$80383) {
//#line 56 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
return;
}
//#line 57 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
try {{
//#line 58 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Frame t$80384 = ((x10.compiler.ws.Frame) k);
//#line 58 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
this.unroll(((x10.compiler.ws.Frame)(t$80384)));
}}catch (final x10.compiler.Abort id$53) {
}
}
}}catch (final java.lang.RuntimeException t) {
//#line 62 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.String t$80385 = (("Uncaught exception at place ") + (x10.lang.Place.place(x10.x10rt.X10RT.here())));
//#line 62 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.String t$80386 = ((t$80385) + (" in WS worker: "));
//#line 62 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.String t$80387 = ((t$80386) + (t));
//#line 62 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
java.lang.System.err.println(t$80387);
//#line 63 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
t.printStackTrace();
}
}
//#line 67 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public java.lang.Object find() {
//#line 68 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
java.lang.Object k = null;
//#line 70 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.core.Deque t$80388 = ((x10.core.Deque)(fifo));
//#line 70 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.Object t$80389 = t$80388.steal();
//#line 70 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
k = ((java.lang.Object)(t$80389));
//#line 71 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
while (true) {
//#line 71 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.Object t$80390 = ((java.lang.Object)(k));
//#line 71 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final boolean t$80418 = ((null) == (t$80390));
//#line 71 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
if (!(t$80418)) {
//#line 71 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
break;
}
//#line 296 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final x10.lang.Runtime.Pool t$80511 = ((x10.lang.Runtime.Pool)(x10.lang.Runtime.get$pool()));
//#line 296 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final boolean t$80512 = t$80511.wsEnd;
//#line 72 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
if (t$80512) {
//#line 72 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
return null;
}
//#line 74 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.util.Random t$80513 = ((x10.util.Random)(random));
//#line 74 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80514 = x10.lang.Runtime.get$NTHREADS();
//#line 74 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int rand$80515 = t$80513.nextInt$O((int)(t$80514));
//#line 75 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.core.Rail t$80516 = ((x10.core.Rail)(workers));
//#line 75 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final long t$80517 = ((long)(((int)(rand$80515))));
//#line 75 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Worker victim$80518 = ((x10.compiler.ws.Worker[])t$80516.value)[(int)t$80517];
//#line 76 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.core.Deque t$80519 = ((x10.core.Deque)(victim$80518.fifo));
//#line 76 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.Object t$80520 = t$80519.steal();
//#line 76 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
k = ((java.lang.Object)(t$80520));
//#line 77 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.Object t$80521 = ((java.lang.Object)(k));
//#line 77 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final boolean t$80522 = ((null) != (t$80521));
//#line 77 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
if (t$80522) {
//#line 77 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
break;
}
//#line 79 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.util.concurrent.Lock t$80523 = ((x10.util.concurrent.Lock)(victim$80518.lock));
//#line 79 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final boolean t$80524 = t$80523.tryLock();
//#line 79 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
if (t$80524) {
//#line 80 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.core.Deque t$80525 = ((x10.core.Deque)(victim$80518.deque));
//#line 80 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.Object t$80526 = t$80525.steal();
//#line 80 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
k = ((java.lang.Object)(t$80526));
//#line 81 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.Object t$80527 = ((java.lang.Object)(k));
//#line 81 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final boolean t$80528 = ((null) != (t$80527));
//#line 81 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
if (t$80528) {
//#line 82 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.Object t$80529 = ((java.lang.Object)(k));
//#line 82 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
x10.compiler.ws.RegularFrame r$80530 = ((x10.compiler.ws.RegularFrame) t$80529);
//#line 87 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.util.concurrent.Monitor t$80531 = ((x10.util.concurrent.Monitor)(x10.lang.Runtime.get$atomicMonitor()));
//#line 87 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
t$80531.lock();
//#line 87 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.RegularFrame t$80532 = ((x10.compiler.ws.RegularFrame)(r$80530));
//#line 87 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.FinishFrame obj$80533 = ((x10.compiler.ws.FinishFrame)(t$80532.ff));
//#line 87 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80534 = obj$80533.asyncs;
//#line 87 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80535 = ((t$80534) + (((int)(1))));
//#line 87 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
obj$80533.asyncs = t$80535;
//#line 87 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.util.concurrent.Monitor t$80536 = ((x10.util.concurrent.Monitor)(x10.lang.Runtime.get$atomicMonitor()));
//#line 87 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
t$80536.unlock();
}
//#line 89 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.util.concurrent.Lock t$80537 = ((x10.util.concurrent.Lock)(victim$80518.lock));
//#line 89 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
t$80537.unlock();
}
//#line 91 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.Object t$80538 = ((java.lang.Object)(k));
//#line 91 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final boolean t$80539 = ((null) != (t$80538));
//#line 91 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
if (t$80539) {
//#line 91 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
break;
}
//#line 93 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
x10.runtime.impl.java.Runtime.eventProbe();
//#line 94 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.core.Deque t$80540 = ((x10.core.Deque)(fifo));
//#line 94 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.Object t$80541 = t$80540.steal();
//#line 94 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
k = ((java.lang.Object)(t$80541));
}
//#line 96 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.Object t$80419 = ((java.lang.Object)(k));
//#line 96 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
return t$80419;
}
//#line 99 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public void unroll(x10.compiler.ws.Frame frame) {
//#line 100 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
x10.compiler.ws.Frame up = null;
//#line 101 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
while (true) {
//#line 102 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Frame t$80420 = ((x10.compiler.ws.Frame)(frame));
//#line 102 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
t$80420.wrapResume(((x10.compiler.ws.Worker)(this)));
//#line 103 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Frame t$80421 = ((x10.compiler.ws.Frame)(frame));
//#line 103 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Frame t$80422 = ((x10.compiler.ws.Frame)(t$80421.up));
//#line 103 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
up = ((x10.compiler.ws.Frame)(t$80422));
//#line 104 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Frame t$80423 = ((x10.compiler.ws.Frame)(up));
//#line 104 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Frame t$80424 = ((x10.compiler.ws.Frame)(frame));
//#line 104 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
t$80423.wrapBack(((x10.compiler.ws.Worker)(this)), ((x10.compiler.ws.Frame)(t$80424)));
//#line 47 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Unsafe.x10"
final x10.compiler.ws.Frame o$80220 = ((x10.compiler.ws.Frame)(frame));
//#line 106 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Frame t$80425 = ((x10.compiler.ws.Frame)(up));
//#line 106 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
frame = ((x10.compiler.ws.Frame)(t$80425));
}
}
//#line 110 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public static void wsRunAsync(final long id, final x10.core.fun.VoidFun_0_0 body) {
//#line 111 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final long t$80426 = ((long)x10.x10rt.X10RT.here());
//#line 111 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final boolean t$80427 = ((long) id) == ((long) t$80426);
//#line 111 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
if (t$80427) {
//#line 156 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final x10.core.fun.VoidFun_0_0 o$80223 = ((x10.core.fun.VoidFun_0_0)(body));
//#line 112 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.core.fun.VoidFun_0_0 copy = ((x10.core.fun.VoidFun_0_0)(x10.lang.Runtime.<x10.core.fun.VoidFun_0_0> deepCopy__0x10$lang$Runtime$$T$G(x10.core.fun.VoidFun_0_0.$RTT, ((x10.core.fun.VoidFun_0_0)(o$80223)), ((x10.lang.Runtime.Profile)(null)))));
//#line 113 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
((x10.core.fun.VoidFun_0_0)copy).$apply();
//#line 47 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Unsafe.x10"
final x10.core.fun.VoidFun_0_0 o$80224 = ((x10.core.fun.VoidFun_0_0)(copy));
} else {
//#line 76 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final long id$80227 = id;
//#line 76 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final x10.core.fun.VoidFun_0_0 msgBody$80228 = ((x10.core.fun.VoidFun_0_0)(body));
//#line 76 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final x10.lang.Runtime.Profile prof$80229 = ((x10.lang.Runtime.Profile)(((x10.lang.Runtime.Profile)
(null))));
//#line 77 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
x10.runtime.impl.java.Runtime.runClosureAt((int)(((long)(id$80227))), msgBody$80228, ((x10.lang.Runtime.Profile)(null)), null);
}
//#line 47 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Unsafe.x10"
final x10.core.fun.VoidFun_0_0 o$80232 = ((x10.core.fun.VoidFun_0_0)(body));
}
//#line 121 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public static void runAsyncAt(final x10.lang.Place place, final x10.compiler.ws.RegularFrame frame) {
//#line 122 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.core.fun.VoidFun_0_0 body = ((x10.core.fun.VoidFun_0_0)(new x10.compiler.ws.Worker.$Closure_runAsyncAt(frame)));
//#line 123 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final long t$80429 = place.id;
//#line 123 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
x10.compiler.ws.Worker.wsRunAsync((long)(t$80429), ((x10.core.fun.VoidFun_0_0)(body)));
}
//#line 126 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public static void runAt(final x10.lang.Place place, final x10.compiler.ws.RegularFrame frame) {
//#line 127 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.core.fun.VoidFun_0_0 body = ((x10.core.fun.VoidFun_0_0)(new x10.compiler.ws.Worker.$Closure_runAt(frame)));
//#line 128 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final long t$80431 = place.id;
//#line 128 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
x10.compiler.ws.Worker.wsRunAsync((long)(t$80431), ((x10.core.fun.VoidFun_0_0)(body)));
//#line 129 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.Abort t$80432 = ((x10.compiler.Abort)(x10.compiler.Abort.get$ABORT()));
//#line 129 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
throw t$80432;
}
//#line 132 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public static void stop() {
//#line 133 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.core.fun.VoidFun_0_0 body = ((x10.core.fun.VoidFun_0_0)(new x10.compiler.ws.Worker.$Closure_stop()));
//#line 134 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
int i$80548 = 1;
//#line 134 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
for (;
true;
) {
//#line 134 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80549 = i$80548;
//#line 134 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final long t$80550 = ((long)(((int)(t$80549))));
//#line 134 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final long t$80551 = x10.lang.Place.get$MAX_PLACES();
//#line 134 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final boolean t$80552 = ((t$80550) < (((long)(t$80551))));
//#line 134 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
if (!(t$80552)) {
//#line 134 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
break;
}
//#line 135 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80542 = i$80548;
//#line 76 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final long id$80543 = ((long)(((int)(t$80542))));
//#line 76 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final x10.core.fun.VoidFun_0_0 msgBody$80544 = ((x10.core.fun.VoidFun_0_0)(body));
//#line 76 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final x10.lang.Runtime.Profile prof$80545 = ((x10.lang.Runtime.Profile)(((x10.lang.Runtime.Profile)
(null))));
//#line 77 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
x10.runtime.impl.java.Runtime.runClosureAt((int)(((long)(id$80543))), msgBody$80544, ((x10.lang.Runtime.Profile)(null)), null);
//#line 134 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80546 = i$80548;
//#line 134 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80547 = ((t$80546) + (((int)(1))));
//#line 134 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
i$80548 = t$80547;
}
//#line 47 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Unsafe.x10"
final x10.core.fun.VoidFun_0_0 o$80240 = ((x10.core.fun.VoidFun_0_0)(body));
//#line 293 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final x10.lang.Runtime.Pool t$80553 = ((x10.lang.Runtime.Pool)(x10.lang.Runtime.get$pool()));
//#line 293 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
t$80553.wsEnd = true;
}
//#line 141 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public static x10.compiler.ws.Worker startHere() {
//#line 274 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final x10.lang.Runtime.Pool t$80568 = ((x10.lang.Runtime.Pool)(x10.lang.Runtime.get$pool()));
//#line 274 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final x10.core.Deque t$80569 = ((x10.core.Deque)(new x10.core.Deque()));
//#line 274 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
t$80568.wsBlockedContinuations = ((x10.core.Deque)(t$80569));
//#line 143 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80444 = x10.lang.Runtime.get$NTHREADS();
//#line 143 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final long t$80445 = ((long)(((int)(t$80444))));
//#line 143 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.core.Rail workers = ((x10.core.Rail)(new x10.core.Rail<x10.compiler.ws.Worker>(x10.compiler.ws.Worker.$RTT, t$80445)));
//#line 144 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
int i$80570 = 0;
{
//#line 144 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Worker[] workers$value$80604 = ((x10.compiler.ws.Worker[])workers.value);
//#line 144 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
for (;
true;
) {
//#line 144 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80571 = i$80570;
//#line 144 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80572 = x10.lang.Runtime.get$NTHREADS();
//#line 144 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final boolean t$80573 = ((t$80571) < (((int)(t$80572))));
//#line 144 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
if (!(t$80573)) {
//#line 144 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
break;
}
//#line 145 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80555 = i$80570;
//#line 145 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final long t$80556 = ((long)(((int)(t$80555))));
//#line 145 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Worker alloc$80557 = ((x10.compiler.ws.Worker)(new x10.compiler.ws.Worker((java.lang.System[]) null)));
//#line 145 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80554 = i$80570;
//#line 145 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
alloc$80557.x10$compiler$ws$Worker$$init$S(t$80554, ((x10.core.Rail)(workers)), (x10.compiler.ws.Worker.__1$1x10$compiler$ws$Worker$2) null);
//#line 145 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
workers$value$80604[(int)t$80556]=alloc$80557;
//#line 144 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80558 = i$80570;
//#line 144 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80559 = ((t$80558) + (((int)(1))));
//#line 144 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
i$80570 = t$80559;
}
}
//#line 147 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Worker t$80457 = ((x10.compiler.ws.Worker[])workers.value)[(int)0L];
//#line 745 .. "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final x10.core.Thread t$80455 = x10.core.Thread.currentThread();
//#line 745 .. "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final x10.lang.Runtime.Worker t$80456 = x10.rtt.Types.<x10.lang.Runtime.Worker> cast(t$80455,x10.lang.Runtime.Worker.$RTT);
//#line 278 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final x10.core.Deque t$80458 = ((x10.core.Deque)(t$80456.wsfifo));
//#line 147 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
t$80457.fifo = ((x10.core.Deque)(t$80458));
//#line 148 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
int i$80574 = 1;
{
//#line 148 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Worker[] workers$value$80605 = ((x10.compiler.ws.Worker[])workers.value);
//#line 148 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
for (;
true;
) {
//#line 148 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80575 = i$80574;
//#line 148 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80576 = x10.lang.Runtime.get$NTHREADS();
//#line 148 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final boolean t$80577 = ((t$80575) < (((int)(t$80576))));
//#line 148 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
if (!(t$80577)) {
//#line 148 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
break;
}
//#line 149 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80560 = i$80574;
//#line 149 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final long t$80561 = ((long)(((int)(t$80560))));
//#line 149 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Worker worker$80562 = ((x10.compiler.ws.Worker)workers$value$80605[(int)t$80561]);
//#line 150 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
x10.lang.Runtime.runAsync(((x10.core.fun.VoidFun_0_0)(new x10.compiler.ws.Worker.$Closure$16(worker$80562))));
//#line 148 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80566 = i$80574;
//#line 148 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80567 = ((t$80566) + (((int)(1))));
//#line 148 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
i$80574 = t$80567;
}
}
//#line 155 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Worker t$80470 = ((x10.compiler.ws.Worker[])workers.value)[(int)0L];
//#line 155 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
return t$80470;
}
//#line 158 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public static x10.compiler.ws.Worker start() {
//#line 159 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Worker worker = x10.compiler.ws.Worker.startHere();
//#line 160 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
int i$80585 = 1;
//#line 160 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
for (;
true;
) {
//#line 160 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80586 = i$80585;
//#line 160 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final long t$80587 = ((long)(((int)(t$80586))));
//#line 160 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final long t$80588 = x10.lang.Place.get$MAX_PLACES();
//#line 160 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final boolean t$80589 = ((t$80587) < (((long)(t$80588))));
//#line 160 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
if (!(t$80589)) {
//#line 160 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
break;
}
//#line 161 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80578 = i$80585;
//#line 143 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Place.x10"
final long id$80579 = ((long)(((int)(t$80578))));
//#line 143 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Place.x10"
final x10.lang.Place alloc$80580 = ((x10.lang.Place)(new x10.lang.Place((java.lang.System[]) null)));
//#line 143 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Place.x10"
alloc$80580.x10$lang$Place$$init$S(((long)(id$80579)));
//#line 161 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.lang.Place p$80581 = ((x10.lang.Place)(alloc$80580));
//#line 162 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
x10.lang.Runtime.runAsync(((x10.lang.Place)(p$80581)), ((x10.core.fun.VoidFun_0_0)(new x10.compiler.ws.Worker.$Closure$17())), ((x10.lang.Runtime.Profile)(null)));
//#line 160 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80583 = i$80585;
//#line 160 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final int t$80584 = ((t$80583) + (((int)(1))));
//#line 160 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
i$80585 = t$80584;
}
//#line 164 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
return worker;
}
//#line 167 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public static void main(final x10.compiler.ws.MainFrame frame) {
//#line 168 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Worker worker = ((x10.compiler.ws.Worker)(x10.compiler.ws.Worker.start()));
//#line 169 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.FinishFrame ff = ((x10.compiler.ws.FinishFrame)(frame.ff));
//#line 170 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
boolean finalize = true;
//#line 171 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
try {{
//#line 172 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
frame.fast(((x10.compiler.ws.Worker)(worker)));
}}catch (final x10.compiler.Abort t) {
//#line 174 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
finalize = false;
//#line 175 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
worker.run();
}catch (final java.lang.RuntimeException t) {
//#line 177 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
ff.caught(((java.lang.RuntimeException)(t)));
}finally {{
//#line 179 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final boolean t$80480 = finalize;
//#line 179 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
if (t$80480) {
//#line 179 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
x10.compiler.ws.Worker.stop();
}
}}
//#line 116 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/FinishFrame.x10"
final x10.util.GrowableRail t$80592 = ((x10.util.GrowableRail)(ff.exceptions));
//#line 116 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/FinishFrame.x10"
final boolean t$80593 = ((null) != (t$80592));
//#line 116 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/FinishFrame.x10"
if (t$80593) {
//#line 117 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/FinishFrame.x10"
while (true) {
//#line 117 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/FinishFrame.x10"
final x10.util.GrowableRail this$80594 = ((x10.util.GrowableRail)(ff.exceptions));
//#line 153 .. "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/util/GrowableRail.x10"
final long t$80595 = ((x10.util.GrowableRail<java.lang.RuntimeException>)this$80594).size;
//#line 153 .. "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/util/GrowableRail.x10"
final boolean t$80596 = ((long) t$80595) == ((long) 0L);
//#line 117 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/FinishFrame.x10"
final boolean t$80597 = !(t$80596);
//#line 117 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/FinishFrame.x10"
if (!(t$80597)) {
//#line 117 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/FinishFrame.x10"
break;
}
//#line 118 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/FinishFrame.x10"
final x10.util.GrowableRail t$80590 = ((x10.util.GrowableRail)(ff.exceptions));
//#line 118 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/FinishFrame.x10"
final java.lang.RuntimeException t$80591 = ((x10.util.GrowableRail<java.lang.RuntimeException>)t$80590).removeLast$G();
//#line 118 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/FinishFrame.x10"
x10.lang.Runtime.pushException(((java.lang.Throwable)(t$80591)));
}
}
}
//#line 184 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
public void rethrow() {
//#line 185 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.RuntimeException t$80488 = ((java.lang.RuntimeException)(throwable));
//#line 185 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final boolean t$80489 = ((null) != (t$80488));
//#line 185 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
if (t$80489) {
//#line 186 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final java.lang.RuntimeException t = ((java.lang.RuntimeException)(throwable));
//#line 187 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
this.throwable = null;
//#line 188 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
throw t;
}
}
//#line 22 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final public x10.compiler.ws.Worker x10$compiler$ws$Worker$$this$x10$compiler$ws$Worker() {
//#line 22 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
return x10.compiler.ws.Worker.this;
}
//#line 22 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final public void __fieldInitializers_x10_compiler_ws_Worker() {
//#line 27 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.core.Deque t$80490 = ((x10.core.Deque)(new x10.core.Deque()));
//#line 22 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
this.deque = ((x10.core.Deque)(t$80490));
//#line 28 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.core.Deque t$80491 = ((x10.core.Deque)(deque));
//#line 22 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
this.fifo = t$80491;
//#line 29 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.util.concurrent.Lock t$80492 = ((x10.util.concurrent.Lock)(new x10.util.concurrent.Lock()));
//#line 22 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
this.lock = ((x10.util.concurrent.Lock)(t$80492));
//#line 22 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
this.throwable = null;
}
@x10.runtime.impl.java.X10Generated
final public static class $Closure_runAsyncAt extends x10.core.Ref implements x10.core.fun.VoidFun_0_0, x10.serialization.X10JavaSerializable
{
public static final x10.rtt.RuntimeType<$Closure_runAsyncAt> $RTT =
x10.rtt.StaticVoidFunType.<$Closure_runAsyncAt> make($Closure_runAsyncAt.class,
new x10.rtt.Type[] {
x10.core.fun.VoidFun_0_0.$RTT
});
public x10.rtt.RuntimeType<?> $getRTT() { return $RTT; }
public x10.rtt.Type<?> $getParam(int i) { return null; }
public static x10.serialization.X10JavaSerializable $_deserialize_body(x10.compiler.ws.Worker.$Closure_runAsyncAt $_obj, x10.serialization.X10JavaDeserializer $deserializer) throws java.io.IOException {
$_obj.frame = $deserializer.readObject();
return $_obj;
}
public static x10.serialization.X10JavaSerializable $_deserializer(x10.serialization.X10JavaDeserializer $deserializer) throws java.io.IOException {
x10.compiler.ws.Worker.$Closure_runAsyncAt $_obj = new x10.compiler.ws.Worker.$Closure_runAsyncAt((java.lang.System[]) null);
$deserializer.record_reference($_obj);
return $_deserialize_body($_obj, $deserializer);
}
public void $_serialize(x10.serialization.X10JavaSerializer $serializer) throws java.io.IOException {
$serializer.write(this.frame);
}
// constructor just for allocation
public $Closure_runAsyncAt(final java.lang.System[] $dummy) {
}
public void $apply() {
//#line 122 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.core.Deque t$80428 = x10.lang.Runtime.wsFIFO();
//#line 122 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
t$80428.push(((java.lang.Object)(this.frame)));
}
public x10.compiler.ws.RegularFrame frame;
public $Closure_runAsyncAt(final x10.compiler.ws.RegularFrame frame) {
{
this.frame = ((x10.compiler.ws.RegularFrame)(frame));
}
}
}
@x10.runtime.impl.java.X10Generated
final public static class $Closure_runAt extends x10.core.Ref implements x10.core.fun.VoidFun_0_0, x10.serialization.X10JavaSerializable
{
public static final x10.rtt.RuntimeType<$Closure_runAt> $RTT =
x10.rtt.StaticVoidFunType.<$Closure_runAt> make($Closure_runAt.class,
new x10.rtt.Type[] {
x10.core.fun.VoidFun_0_0.$RTT
});
public x10.rtt.RuntimeType<?> $getRTT() { return $RTT; }
public x10.rtt.Type<?> $getParam(int i) { return null; }
public static x10.serialization.X10JavaSerializable $_deserialize_body(x10.compiler.ws.Worker.$Closure_runAt $_obj, x10.serialization.X10JavaDeserializer $deserializer) throws java.io.IOException {
$_obj.frame = $deserializer.readObject();
return $_obj;
}
public static x10.serialization.X10JavaSerializable $_deserializer(x10.serialization.X10JavaDeserializer $deserializer) throws java.io.IOException {
x10.compiler.ws.Worker.$Closure_runAt $_obj = new x10.compiler.ws.Worker.$Closure_runAt((java.lang.System[]) null);
$deserializer.record_reference($_obj);
return $_deserialize_body($_obj, $deserializer);
}
public void $_serialize(x10.serialization.X10JavaSerializer $serializer) throws java.io.IOException {
$serializer.write(this.frame);
}
// constructor just for allocation
public $Closure_runAt(final java.lang.System[] $dummy) {
}
public void $apply() {
//#line 127 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.core.Deque t$80430 = x10.lang.Runtime.wsFIFO();
//#line 127 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
t$80430.push(((java.lang.Object)(this.frame)));
}
public x10.compiler.ws.RegularFrame frame;
public $Closure_runAt(final x10.compiler.ws.RegularFrame frame) {
{
this.frame = ((x10.compiler.ws.RegularFrame)(frame));
}
}
}
@x10.runtime.impl.java.X10Generated
final public static class $Closure_stop extends x10.core.Ref implements x10.core.fun.VoidFun_0_0, x10.serialization.X10JavaSerializable
{
public static final x10.rtt.RuntimeType<$Closure_stop> $RTT =
x10.rtt.StaticVoidFunType.<$Closure_stop> make($Closure_stop.class,
new x10.rtt.Type[] {
x10.core.fun.VoidFun_0_0.$RTT
});
public x10.rtt.RuntimeType<?> $getRTT() { return $RTT; }
public x10.rtt.Type<?> $getParam(int i) { return null; }
public static x10.serialization.X10JavaSerializable $_deserialize_body(x10.compiler.ws.Worker.$Closure_stop $_obj, x10.serialization.X10JavaDeserializer $deserializer) throws java.io.IOException {
return $_obj;
}
public static x10.serialization.X10JavaSerializable $_deserializer(x10.serialization.X10JavaDeserializer $deserializer) throws java.io.IOException {
x10.compiler.ws.Worker.$Closure_stop $_obj = new x10.compiler.ws.Worker.$Closure_stop((java.lang.System[]) null);
$deserializer.record_reference($_obj);
return $_deserialize_body($_obj, $deserializer);
}
public void $_serialize(x10.serialization.X10JavaSerializer $serializer) throws java.io.IOException {
}
// constructor just for allocation
public $Closure_stop(final java.lang.System[] $dummy) {
}
public void $apply() {
//#line 133 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
x10.lang.Runtime.wsEnd();
}
public $Closure_stop() {
{
}
}
}
@x10.runtime.impl.java.X10Generated
final public static class $Closure$16 extends x10.core.Ref implements x10.core.fun.VoidFun_0_0, x10.serialization.X10JavaSerializable
{
public static final x10.rtt.RuntimeType<$Closure$16> $RTT =
x10.rtt.StaticVoidFunType.<$Closure$16> make($Closure$16.class,
new x10.rtt.Type[] {
x10.core.fun.VoidFun_0_0.$RTT
});
public x10.rtt.RuntimeType<?> $getRTT() { return $RTT; }
public x10.rtt.Type<?> $getParam(int i) { return null; }
public static x10.serialization.X10JavaSerializable $_deserialize_body(x10.compiler.ws.Worker.$Closure$16 $_obj, x10.serialization.X10JavaDeserializer $deserializer) throws java.io.IOException {
$_obj.worker$80562 = $deserializer.readObject();
return $_obj;
}
public static x10.serialization.X10JavaSerializable $_deserializer(x10.serialization.X10JavaDeserializer $deserializer) throws java.io.IOException {
x10.compiler.ws.Worker.$Closure$16 $_obj = new x10.compiler.ws.Worker.$Closure$16((java.lang.System[]) null);
$deserializer.record_reference($_obj);
return $_deserialize_body($_obj, $deserializer);
}
public void $_serialize(x10.serialization.X10JavaSerializer $serializer) throws java.io.IOException {
$serializer.write(this.worker$80562);
}
// constructor just for allocation
public $Closure$16(final java.lang.System[] $dummy) {
}
public void $apply() {
//#line 150 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
try {{
//#line 745 .. "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final x10.core.Thread t$80563 = x10.core.Thread.currentThread();
//#line 745 .. "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final x10.lang.Runtime.Worker t$80564 = x10.rtt.Types.<x10.lang.Runtime.Worker> cast(t$80563,x10.lang.Runtime.Worker.$RTT);
//#line 278 . "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/lang/Runtime.x10"
final x10.core.Deque t$80565 = ((x10.core.Deque)(t$80564.wsfifo));
//#line 151 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
this.worker$80562.fifo = ((x10.core.Deque)(t$80565));
//#line 152 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
this.worker$80562.run();
}}catch (java.lang.Error __lowerer__var__0__) {
//#line 150 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
throw __lowerer__var__0__;
}catch (java.lang.Throwable __lowerer__var__1__) {
//#line 150 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
throw x10.rtt.Types.EXCEPTION.isInstance(__lowerer__var__1__) ? (java.lang.RuntimeException)(__lowerer__var__1__) : new x10.lang.WrappedThrowable(__lowerer__var__1__);
}
}
public x10.compiler.ws.Worker worker$80562;
public $Closure$16(final x10.compiler.ws.Worker worker$80562) {
{
this.worker$80562 = ((x10.compiler.ws.Worker)(worker$80562));
}
}
}
@x10.runtime.impl.java.X10Generated
final public static class $Closure$17 extends x10.core.Ref implements x10.core.fun.VoidFun_0_0, x10.serialization.X10JavaSerializable
{
public static final x10.rtt.RuntimeType<$Closure$17> $RTT =
x10.rtt.StaticVoidFunType.<$Closure$17> make($Closure$17.class,
new x10.rtt.Type[] {
x10.core.fun.VoidFun_0_0.$RTT
});
public x10.rtt.RuntimeType<?> $getRTT() { return $RTT; }
public x10.rtt.Type<?> $getParam(int i) { return null; }
public static x10.serialization.X10JavaSerializable $_deserialize_body(x10.compiler.ws.Worker.$Closure$17 $_obj, x10.serialization.X10JavaDeserializer $deserializer) throws java.io.IOException {
return $_obj;
}
public static x10.serialization.X10JavaSerializable $_deserializer(x10.serialization.X10JavaDeserializer $deserializer) throws java.io.IOException {
x10.compiler.ws.Worker.$Closure$17 $_obj = new x10.compiler.ws.Worker.$Closure$17((java.lang.System[]) null);
$deserializer.record_reference($_obj);
return $_deserialize_body($_obj, $deserializer);
}
public void $_serialize(x10.serialization.X10JavaSerializer $serializer) throws java.io.IOException {
}
// constructor just for allocation
public $Closure$17(final java.lang.System[] $dummy) {
}
public void $apply() {
//#line 162 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
try {{
//#line 162 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
final x10.compiler.ws.Worker t$80582 = x10.compiler.ws.Worker.startHere();
//#line 162 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
t$80582.run();
}}catch (java.lang.Error __lowerer__var__0__) {
//#line 162 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
throw __lowerer__var__0__;
}catch (java.lang.Throwable __lowerer__var__1__) {
//#line 162 "/home/induk/workspace/x10-2.4.3-src/x10.runtime/src-x10/x10/compiler/ws/Worker.x10"
throw x10.rtt.Types.EXCEPTION.isInstance(__lowerer__var__1__) ? (java.lang.RuntimeException)(__lowerer__var__1__) : new x10.lang.WrappedThrowable(__lowerer__var__1__);
}
}
public $Closure$17() {
{
}
}
}
}
| [
"NVIDIA.COM+User(622487)@IK-LT.nvidia.com"
] | NVIDIA.COM+User(622487)@IK-LT.nvidia.com |
2f2cdad51cc7bf5ebdc9794520de74515e9c401d | 1b5987a7e72a58e12ac36a36a60aa6add2661095 | /code/org/processmining/analysis/hierarchicaldatavisualization/HierarchicalData.java | 55a2e3d1cfa5bd160722ba346fc3421450e672ca | [] | no_license | qianc62/BePT | f4b1da467ee52e714c9a9cc2fb33cd2c75bdb5db | 38fb5cc5521223ba07402c7bb5909b17967cfad8 | refs/heads/master | 2021-07-11T16:25:25.879525 | 2020-09-22T10:50:51 | 2020-09-22T10:50:51 | 201,562,390 | 36 | 0 | null | null | null | null | UTF-8 | Java | false | false | 790 | java | package org.processmining.analysis.hierarchicaldatavisualization;
import java.util.List;
import org.processmining.framework.models.DotFormatter;
import org.processmining.framework.models.ModelGraph;
public interface HierarchicalData extends Iterable<HierarchicalDataElement> {
DotFormatter getDotFormatter();
List<String> getAvailableNumberFormatNames();
String formatNumber(int format, double value); // the given format will be a
// valid index in the list
// returned by
// getAvailableNumberFormats
List<ModelGraph> graphsToExclude();
// These two functions should return the type of hierarchy as a string. For
// example: Ontology / Ontologies.
// The names should start with a capital letter.
String getSingularHierarchyName();
String getPluralHierarchyName();
}
| [
"qianc62@gmail.com"
] | qianc62@gmail.com |
f3274e3242584cd7191b7fa5adcede48c129f9b7 | e9ec1673fbd1fa37307e3917216cb6117e0f6eee | /src/main/java/com/database/marketPhones/repository/OrderRepository.java | 20c479289d216931c5c56ced9e25527a33941025 | [] | no_license | KendrickDM/ClientServerApplicationMarketPhones | 919cf90f28002bad9a7c34e7c18dd062f2eae28a | 18b1576ad60b15d453f5f6efa4ea53abfae8f1c6 | refs/heads/master | 2022-06-05T14:01:38.365208 | 2020-05-07T11:41:18 | 2020-05-07T11:41:18 | 262,034,249 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 228 | java | package com.database.marketPhones.repository;
import com.database.marketPhones.model.Order;
import org.springframework.data.jpa.repository.JpaRepository;
public interface OrderRepository extends JpaRepository<Order, Long> {
}
| [
"youngman0220@mail.ru"
] | youngman0220@mail.ru |
b9c671113c019c98e0d8b44dc16d2ee00686c488 | 4082835d52d668dfa6fce72bb97df156805bcd53 | /src/com/javarush/test/level09/lesson02/task05/Solution.java | 79e7ea7712a704b8f07765d7eb534f0088d1f48c | [] | no_license | Arkadiu/JavaRush | 00cd04072fa1af70020d03510b9694f565423aec | c467f58c433b99a7374e11c60a83d30860ae866a | refs/heads/master | 2021-06-25T18:14:15.204111 | 2017-04-17T18:32:06 | 2017-04-17T18:32:06 | 57,323,182 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 888 | java | package com.javarush.test.level09.lesson02.task05;
/* Метод должен возвращать результат – глубину его стек-трейса
Написать метод, который возвращает результат – глубину его стек трейса –
количество методов в нем (количество элементов в списке). Это же число метод должен выводить на экран.
*/
public class Solution
{
public static int getStackTraceDeep()
{
//напишите тут ваш код
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
int count = 0;
for (StackTraceElement element : stackTraceElements)
{
count++;
}
System.out.println(count);
return count;
}
}
| [
"ntfs2002@gmail.com"
] | ntfs2002@gmail.com |
b9023f570ff047c73cdc5778a6f5959efa5ff1e4 | f98a76dc062b4c173aa3a93a8869643f05e807bf | /src/main/java/com/cemgunduz/btcenter/entity/Order.java | 2f8e9b498abddb4400207ac8b168abbe7be518fa | [] | no_license | cgunduz/btcenter | 33fd928dead68ad1d949ad5181041527293c102e | 506c28e502dcccbef4d23e5f7b8bb1eb547056dd | refs/heads/master | 2020-12-24T14:10:48.321395 | 2014-04-02T10:41:25 | 2014-04-02T10:41:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,741 | java | package com.cemgunduz.btcenter.entity;
import com.cemgunduz.btcenter.entity.constants.OrderType;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
/**
* Created by cgunduz on 2/5/14.
*/
@Document(collection = "Order")
public class Order {
public Order(){}
public Order(Double value, Double amount, OrderType orderType, Long unixTimestamp) {
this.value = value;
this.amount = amount;
this.orderType = orderType;
this.unixTimestamp = unixTimestamp;
}
@Id
private Long id;
private Double value;
private Double amount;
@Indexed
private OrderType orderType;
@Indexed
private Long unixTimestamp;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Double getValue() {
return value;
}
public void setValue(Double value) {
this.value = value;
}
public Double getAmount() {
return amount;
}
public void setAmount(Double amount) {
this.amount = amount;
}
public OrderType getOrderType() {
return orderType;
}
public void setOrderType(OrderType orderType) {
this.orderType = orderType;
}
public Long getUnixTimestamp() {
return unixTimestamp;
}
public void setUnixTimestamp(Long unixTimestamp) {
this.unixTimestamp = unixTimestamp;
}
@Override
public String toString() {
return "Value : " + value + "\nAmount : " + amount + "\nOrderType : " + orderType.getValue()
+ "\nTimestamp : " + unixTimestamp;
}
}
| [
"dogancemgunduz@gmail.com"
] | dogancemgunduz@gmail.com |
672b85ad0bbff0da4aa14ec4900ad6182e59da44 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/30/30_60dc74a0d8d0e070cf18e58af4992495d52827a6/SVGZoomAndPanHandler/30_60dc74a0d8d0e070cf18e58af4992495d52827a6_SVGZoomAndPanHandler_t.java | 49855db37e31447019f79ee15641a366242079b9 | [] | 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 | 4,694 | java | package webboards.client.display.svg;
import org.vectomatic.dom.svg.OMSVGMatrix;
import org.vectomatic.dom.svg.OMSVGPoint;
import org.vectomatic.dom.svg.OMSVGRect;
import org.vectomatic.dom.svg.impl.SVGImageElement;
import org.vectomatic.dom.svg.impl.SVGSVGElement;
import webboards.client.display.VisualCoords;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.dom.client.MouseEvent;
import com.google.gwt.event.dom.client.MouseMoveEvent;
import com.google.gwt.event.dom.client.MouseMoveHandler;
import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.event.dom.client.MouseUpHandler;
import com.google.gwt.event.dom.client.MouseWheelEvent;
import com.google.gwt.event.dom.client.MouseWheelHandler;
import com.google.gwt.user.client.Window;
public class SVGZoomAndPanHandler implements MouseDownHandler, MouseUpHandler, MouseMoveHandler, MouseWheelHandler, KeyPressHandler {
private static final float KEY_ZOOM_STEP = 1.3f;
private static final boolean LOW_RES_PANNING = false;
private float minScale = 0.25f;
private final VisualCoords size;
private final VisualCoords mouse = new VisualCoords(0, 0);
private final VisualCoords offset = new VisualCoords(0, 0);
private final SVGSVGElement svg;
private float scale = 1.0f;
private boolean lowRes = false;
private boolean panning = false;
public SVGZoomAndPanHandler(SVGSVGElement svg) {
this.svg = svg;
OMSVGRect viewbox = svg.getViewBox().getBaseVal();
size = new VisualCoords((int) viewbox.getWidth(), (int) viewbox.getHeight());
minScale = Math.min(Window.getClientWidth() / viewbox.getWidth(), Window.getClientHeight() / viewbox.getHeight());
}
@Override
public void onMouseWheel(MouseWheelEvent event) {
if(event.getDeltaY() > 0) {
scale /= KEY_ZOOM_STEP;
} else {
scale *= KEY_ZOOM_STEP;
}
updateZoom();
event.preventDefault();
}
private void updateZoom() {
if (scale < minScale)
scale = minScale;
float x = mouse.x;
float y = mouse.y;
OMSVGPoint before = toUsertSpace(x, y);
OMSVGRect viewbox = svg.getViewBox().getBaseVal();
viewbox.setWidth(size.x / scale);
viewbox.setHeight(size.y / scale);
OMSVGPoint after = toUsertSpace(x, y);
float dx = before.getX() - after.getX();
float dy = before.getY() - after.getY();
viewbox.setX(viewbox.getX() + dx);
viewbox.setY(viewbox.getY() + dy);
}
private OMSVGPoint toUsertSpace(float x, float y) {
OMSVGMatrix ctm = svg.getScreenCTM();
OMSVGPoint p = svg.createSVGPoint();
p.setX(x);
p.setY(y);
p = p.matrixTransform(ctm.inverse());
return p;
}
@Override
public void onMouseMove(MouseMoveEvent e) {
if(e.getNativeButton() == 0) {
panning = false;
onMouseUp(null);
return;
}
if (panning) {
e.preventDefault();
float x = mouse.x;
float y = mouse.y;
OMSVGPoint start = toUsertSpace(x, y);
OMSVGPoint pos = toUsertSpace(e.getClientX(), e.getClientY());
if (!lowRes) {
lowRes = true;
updateImageResolution();
}
OMSVGRect viewBox = svg.getViewBox().getBaseVal();
viewBox.setX(offset.x + (start.getX() - pos.getX()));
viewBox.setY(offset.y + (start.getY() - pos.getY()));
} else {
updateMousePosition(e);
}
}
private void updateImageResolution() {
if(LOW_RES_PANNING) {
SVGImageElement boardImg = (SVGImageElement) svg.getElementById("img");
boardImg.getHref().setBaseVal(lowRes ? "board-low.jpg" : "board.jpg");
}
}
private void updateMousePosition(MouseEvent<?> e) {
mouse.x = e.getClientX();
mouse.y = e.getClientY();
OMSVGRect viewbox = svg.getViewBox().getBaseVal();
offset.x = (int) viewbox.getX();
offset.y = (int) viewbox.getY();
}
@Override
public void onMouseUp(MouseUpEvent event) {
if (panning) {
event.preventDefault();
}
panning = false;
lowRes = false;
updateImageResolution();
}
@Override
public void onMouseDown(MouseDownEvent event) {
updateMousePosition(event);
panning = true;
}
@Override
public void onKeyPress(KeyPressEvent event) {
char c = event.getCharCode();
switch (c) {
case '[':case 'q':
scale /= KEY_ZOOM_STEP;
updateZoom();
break;
case ']':case 'w':
scale *= KEY_ZOOM_STEP;
updateZoom();
break;
case '\\': case '1':
scale = 1;
updateZoom();
OMSVGRect viewBox = svg.getViewBox().getBaseVal();
viewBox.setX(0);
viewBox.setY(0);
break;
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
6eb11502bfc7d8f9fce33469c3ce231543e9583f | 7f8979d8b6c652f8a1d3ad52efadf5e9025e8fd6 | /src/main/java/service/MenuInfoService.java | 2e970733438d89f01b93f05ae7e271eee621e538 | [] | no_license | sumail2333/homework | 7562602b987a3dcecb103f96a677e202712d5d5e | 17dde3a8a165e0e93f1b3d147663a59dfbe06dac | refs/heads/master | 2020-04-16T19:23:48.949958 | 2019-01-17T14:14:12 | 2019-01-17T14:14:12 | 165,857,708 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 273 | java | package service;
import pojo.MenuInfo;
import java.util.List;
public interface MenuInfoService {
List<MenuInfo> selectAllMenuItem();
int insertSelective(MenuInfo m);
int deleteByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(MenuInfo record);
}
| [
"zhao.xiong@dxc.com"
] | zhao.xiong@dxc.com |
9726c7bbe2b55efd9a0022a6fc8238cb72ac4fb7 | 128071e32d737f14ead62884788cd7194cb99348 | /app/src/main/java/wxb/beautifulgirls/ui/GirlActivity.java | ee62e3dcacd789a2dbc0072685c6f148712dfceb | [
"Apache-2.0"
] | permissive | weixianshishen/BeautifulGirls | ed2aaff1432d1d7d9f0586cad66666b3df29b445 | a5d52eedd6d5fb8d5683d562783d2c203e08aa6a | refs/heads/master | 2020-05-23T23:32:43.747415 | 2017-03-21T03:08:46 | 2017-03-21T03:08:46 | 84,801,102 | 5 | 3 | null | null | null | null | UTF-8 | Java | false | false | 4,836 | java | package wxb.beautifulgirls.ui;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Environment;
import android.support.v7.app.AlertDialog;
import android.view.Menu;
import android.view.MenuItem;
import com.squareup.picasso.Picasso;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import butterknife.BindView;
import rx.Observable;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
import uk.co.senab.photoview.PhotoView;
import wxb.beautifulgirls.R;
import wxb.beautifulgirls.ui.base.BaseActivity;
public class GirlActivity extends BaseActivity {
@BindView(R.id.picture)
PhotoView mGirlImg;
private String mImgTitle;
private String mImgUrl;
@Override
protected int getLayoutId() {
return R.layout.activity_girl;
}
@Override
protected void initView() {
mImgTitle = getIntent().getStringExtra("imgTitle");
mImgUrl = getIntent().getStringExtra("imgUrl");
setToolbar(true);
setAppBarAlpha(0.5f);
setTitle(mImgTitle);
Picasso.with(this).load(mImgUrl).into(mGirlImg);
setupPhotoListener();
}
private void setupPhotoListener() {
mGirlImg.setOnViewTapListener((view, v, v1) -> hideOrShowToolbar());
mGirlImg.setOnLongClickListener(view -> {
new AlertDialog.Builder(GirlActivity.this)
.setMessage("是否保存到手机?")
.setNegativeButton("取消", (dialogInterface, i) -> dialogInterface.dismiss())
.setPositiveButton("确定", (dialogInterface, i) -> {
dialogInterface.dismiss();
saveImgToGallery();
})
.show();
return true;
});
}
private void saveImgToGallery() {
Observable.create(new Observable.OnSubscribe<Bitmap>() {
@Override
public void call(Subscriber<? super Bitmap> subscriber) {
Bitmap bitmap = null;
try {
bitmap = Picasso.with(GirlActivity.this).load(mImgUrl).get();
} catch (Exception e) {
subscriber.onError(e);
}
if (bitmap == null) {
subscriber.onError(new Exception("无法下载到图片"));
}
subscriber.onNext(bitmap);
subscriber.onCompleted();
}
}
).subscribeOn(Schedulers.io())
.flatMap(bitmap -> {
File appDir = new File(Environment.getExternalStorageDirectory(), "Girls");
if (!appDir.exists()) {
appDir.mkdir();
}
String fileName = mImgTitle.replace('/', '-') + ".jpg";
File file = new File(appDir, fileName);
try {
FileOutputStream outputStream = new FileOutputStream(file);
assert bitmap != null;
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
outputStream.flush();
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
Uri uri = Uri.fromFile(file);
// 通知图库更新
Intent scannerIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri);
sendBroadcast(scannerIntent);
return Observable.just(appDir.getAbsolutePath());
})
.observeOn(AndroidSchedulers.mainThread())
.subscribe(s -> showToast(String.format("保存到%s目录下", s)), throwable -> showToast("保存失败,请重试"));
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_picture, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
switch (id) {
case R.id.action_share:
return true;
case R.id.action_save:
saveImgToGallery();
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onDestroy() {
super.onDestroy();
}
}
| [
"291167065@qq.com"
] | 291167065@qq.com |
89ae01c565096544c90dbb95acf2f97a77e68606 | 088cad7c00db1e05ad2ab219e393864f3bf7add6 | /classes/android/support/graphics/drawable/Animatable2Compat$AnimationCallback$1.java | 728b64a8be0ef3b07e6addefd108b24a78f163e9 | [] | no_license | devidwfreitas/com-santander-app.7402 | 8e9f344f5132b1c602d80929f1ff892293f4495d | e9a92b20dc3af174f9b27ad140643b96fb78f04d | refs/heads/main | 2023-05-01T09:33:58.835056 | 2021-05-18T23:54:43 | 2021-05-18T23:54:43 | 368,692,384 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 746 | java | package android.support.graphics.drawable;
import android.graphics.drawable.Animatable2;
import android.graphics.drawable.Drawable;
class Animatable2Compat$AnimationCallback$1 extends Animatable2.AnimationCallback {
public void onAnimationEnd(Drawable paramDrawable) {
Animatable2Compat$AnimationCallback.this.onAnimationEnd(paramDrawable);
}
public void onAnimationStart(Drawable paramDrawable) {
Animatable2Compat$AnimationCallback.this.onAnimationStart(paramDrawable);
}
}
/* Location: C:\Users\devid\Downloads\SAST\Santander\dex2jar-2.0\classes-dex2jar.jar!\android\support\graphics\drawable\Animatable2Compat$AnimationCallback$1.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 1.1.3
*/ | [
"devid.wfreitas@gmail.com"
] | devid.wfreitas@gmail.com |
a198464e63f684247edb1d3a23741991facf5ed9 | 247e602d355e1b3d49902db405cceecf5806dbc9 | /LMDriverApp/src/main/java/com/appzoneltd/lastmile/driver/services/pickups/OnDemandPickupService.java | df2c8af050cbf79dffc16c49ec6a529b2227c14a | [] | no_license | Kdsaid/CleanMVP | 5a6710c7496c7d601b7d63933b5353943333b8a6 | e96e3b40daf00f2dafaa70df800c2c1b9e369068 | refs/heads/master | 2021-06-16T23:52:44.314930 | 2017-05-06T03:09:51 | 2017-05-06T03:10:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,375 | java | package com.appzoneltd.lastmile.driver.services.pickups;
import android.content.Intent;
import com.appzoneltd.lastmile.driver.R;
import com.base.abstraction.annotations.interfaces.Address;
import com.base.abstraction.annotations.interfaces.Executable;
import com.base.abstraction.events.Message;
import com.base.abstraction.system.AppResources;
import com.base.presentation.base.services.AbstractService;
import com.base.presentation.base.services.ServiceStartCommandParams;
import com.entities.cached.pickup.OnDemandPickupRequestAssignedPayload;
/**
* a service that handles On-Demand pickup-assigned notification response to
* server
* <p>
* Created by Ahmed Adel on 2/19/2017.
*/
@Address(R.id.addressOnDemandPickupService)
public class OnDemandPickupService extends AbstractService<OnDemandPickupModel> {
@Executable({R.id.onServiceStarted, R.id.onServiceStartedAgain})
void onStart(Message message) {
ServiceStartCommandParams p = message.getContent();
Intent intent = p.getIntent();
String key = AppResources.string(R.string.INTENT_KEY_ON_DEMAND_NOTIFICATION_ACTION);
request(key, payload(intent).getPackageId(), actionId(intent, key));
}
private OnDemandPickupRequestAssignedPayload payload(Intent intent) throws ClassCastException {
String key = AppResources.string(R.string.INTENT_KEY_ON_DEMAND_PAYLOAD);
OnDemandPickupRequestAssignedPayload payload;
payload = (OnDemandPickupRequestAssignedPayload) intent.getSerializableExtra(key);
return payload;
}
private long actionId(Intent intent, String key) throws UnsupportedOperationException {
long actionId = intent.getLongExtra(key, 0);
if (actionId == 0) {
throw new UnsupportedOperationException("no " + key + " set in the Intent");
}
return actionId;
}
private void request(String key, long packageId, long actionId)
throws UnsupportedOperationException {
if (actionId == R.string.ACTION_ON_DEMAND_NOTIFICATION_ACCEPT) {
getModel().driverPickupAccept.request(packageId);
} else if (actionId == R.string.ACTION_ON_DEMAND_NOTIFICATION_REJECT) {
getModel().driverPickupRejection.request(packageId);
} else {
throw new UnsupportedOperationException(key + " : undefined");
}
}
}
| [
"ahm3d.ad3l@bey2ollak.com"
] | ahm3d.ad3l@bey2ollak.com |
f301f460025792012a522b0da796c25042c379ed | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/CHART-13b-3-1-PESA_II-WeightedSum:TestLen:CallDiversity/org/jfree/chart/block/BorderArrangement_ESTest.java | 416466ba5cbdcefd771629af68733da01135c89f | [] | 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 | 568 | java | /*
* This file was automatically generated by EvoSuite
* Sun Jan 19 16:04:14 GMT+00:00 2020
*/
package org.jfree.chart.block;
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 BorderArrangement_ESTest extends BorderArrangement_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
d37e0d42e54c52b5d27082ebb7923a40e48dfa57 | 73267be654cd1fd76cf2cb9ea3a75630d9f58a41 | /services/ec/src/main/java/com/huaweicloud/sdk/ec/v1/model/ShowEquipmentSpecificConfigRequest.java | 02a967f76c0dfafac7b302b532bcaee2a6bb5317 | [
"Apache-2.0"
] | permissive | huaweicloud/huaweicloud-sdk-java-v3 | 51b32a451fac321a0affe2176663fed8a9cd8042 | 2f8543d0d037b35c2664298ba39a89cc9d8ed9a3 | refs/heads/master | 2023-08-29T06:50:15.642693 | 2023-08-24T08:34:48 | 2023-08-24T08:34:48 | 262,207,545 | 91 | 57 | NOASSERTION | 2023-09-08T12:24:55 | 2020-05-08T02:27:00 | Java | UTF-8 | Java | false | false | 4,001 | java | package com.huaweicloud.sdk.ec.v1.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* Request Object
*/
public class ShowEquipmentSpecificConfigRequest {
/**
* 设备类型
*/
public static final class EquipmentTypeEnum {
/**
* Enum STANDARD for value: "standard"
*/
public static final EquipmentTypeEnum STANDARD = new EquipmentTypeEnum("standard");
private static final Map<String, EquipmentTypeEnum> STATIC_FIELDS = createStaticFields();
private static Map<String, EquipmentTypeEnum> createStaticFields() {
Map<String, EquipmentTypeEnum> map = new HashMap<>();
map.put("standard", STANDARD);
return Collections.unmodifiableMap(map);
}
private String value;
EquipmentTypeEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static EquipmentTypeEnum fromValue(String value) {
if (value == null) {
return null;
}
return java.util.Optional.ofNullable(STATIC_FIELDS.get(value)).orElse(new EquipmentTypeEnum(value));
}
public static EquipmentTypeEnum valueOf(String value) {
if (value == null) {
return null;
}
return java.util.Optional.ofNullable(STATIC_FIELDS.get(value))
.orElseThrow(() -> new IllegalArgumentException("Unexpected value '" + value + "'"));
}
@Override
public boolean equals(Object obj) {
if (obj instanceof EquipmentTypeEnum) {
return this.value.equals(((EquipmentTypeEnum) obj).value);
}
return false;
}
@Override
public int hashCode() {
return this.value.hashCode();
}
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "equipment_type")
private EquipmentTypeEnum equipmentType;
public ShowEquipmentSpecificConfigRequest withEquipmentType(EquipmentTypeEnum equipmentType) {
this.equipmentType = equipmentType;
return this;
}
/**
* 设备类型
* @return equipmentType
*/
public EquipmentTypeEnum getEquipmentType() {
return equipmentType;
}
public void setEquipmentType(EquipmentTypeEnum equipmentType) {
this.equipmentType = equipmentType;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
ShowEquipmentSpecificConfigRequest that = (ShowEquipmentSpecificConfigRequest) obj;
return Objects.equals(this.equipmentType, that.equipmentType);
}
@Override
public int hashCode() {
return Objects.hash(equipmentType);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ShowEquipmentSpecificConfigRequest {\n");
sb.append(" equipmentType: ").append(toIndentedString(equipmentType)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"hwcloudsdk@huawei.com"
] | hwcloudsdk@huawei.com |
d91ade235812a3260b5eb02b1f2c2f434e16e113 | a5333ba503402bcd964fc0a36fd68bf050c17af9 | /acmicpc/Java_2751.java | bba52272b459d1e2b8e6f9d98c7274e6b9ef5159 | [] | no_license | Atlasias/Algorithm | 04b9aca7fe616e46cc1d7d77d4f991d23c886db2 | e3f8d8a6ee7c53ca9f57105b5784568906611485 | refs/heads/main | 2023-07-09T15:38:51.524888 | 2021-08-09T13:29:26 | 2021-08-09T13:29:26 | 394,302,261 | 0 | 0 | null | 2021-08-09T13:29:14 | 2021-08-09T13:29:13 | null | UTF-8 | Java | false | false | 550 | java | import java.io.*;
import java.util.Arrays;
public class Java_2751 {
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = Integer.parseInt(br.readLine());
}
Arrays.sort(arr);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < arr.length; i++) {
sb.append(arr[i]).append("\n");
}
System.out.print(sb);
}
}
| [
"50049254+Hwisaek@users.noreply.github.com"
] | 50049254+Hwisaek@users.noreply.github.com |
a3f9937e3824429b06c8010f721f449fbb61f764 | 572ceb4bc5fdebc5da502d0b245501335129ff82 | /src/main/java/com/evozon/domain/dtos/EntryDTO.java | 1b8c8dfa21cb7ccedc979c5b883177e866d5a0e7 | [] | no_license | florinani94/mvc | f89ffa7c1ae2337cf9182d8714c4f9fad5b07b1a | 78060ff314dcee5a275e4cb19b2d883bb8bbdd65 | refs/heads/master | 2021-01-11T03:43:13.133630 | 2016-10-04T15:30:06 | 2016-10-04T15:30:06 | 69,979,126 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 941 | java | package com.evozon.domain.dtos;
/**
* Created by mateimihai on 7/22/2016.
*/
public class EntryDTO {
private Integer id;
private String name;
private Double price;
private Integer quantity;
private Double subtotal;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public Integer getQuantity() {
return quantity;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
public Double getSubtotal() {
return subtotal;
}
public void setSubtotal(Double subtotal) {
this.subtotal = subtotal;
}
}
| [
"florin.ani@ebs.msft"
] | florin.ani@ebs.msft |
7f74f2d968d198ad2f4e46225dcd210e2feb9c2f | 0228f8f4aeb3666592ac6f0b9bf4741b59ef5bfd | /servlet-practices/test/src/main/java/test/GuestbookVo.java | afd9ef88ead85cf8c84d2c87b5e1639923f329d2 | [] | no_license | GeunHyeong-Jo/servlet-practices | c5b9cb714081044b4df5d6ec51ce698cfe925fcb | 21712ac69b758b5bac90835816d9137f89507666 | refs/heads/master | 2023-04-07T01:47:47.267755 | 2021-04-20T09:58:33 | 2021-04-20T09:58:33 | 345,874,732 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 953 | java | package test;
public class GuestbookVo {
private Long no;
private String name;
private String password;
private String contents;
private String reg_date;
public Long getNo() {
return no;
}
public void setNo(Long no) {
this.no = no;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getContents() {
return contents;
}
public void setContents(String contents) {
this.contents = contents;
}
public String getReg_date() {
return reg_date;
}
public void setReg_date(String reg_date) {
this.reg_date = reg_date;
}
// 디버그용
@Override
public String toString() {
return "GuestbookVo [no=" + no + ", name=" + name + ", password=" + password + ", contents=" + contents
+ ", reg_date=" + reg_date + "]";
}
}
| [
"jgh03@host.docker.internal"
] | jgh03@host.docker.internal |
d564877be9b27ec79d5f0103b6e32dd38e0d4bbb | 227c758d39de2aa45aaf2b039bb626bc73c707cb | /CEA102G5/src/com/member_recipient/model/MemrService.java | a71bd32a25474f9fafbe50ec9f7ee8ffd43bb8cd | [] | no_license | gult01327/CEA102G5-1 | bdb3ffcfdf5c4f919480505c813d571611e6a8ee | 3422de85ce8083d76a5ef9b61d2e7be968fce15b | refs/heads/master | 2023-03-29T00:23:15.027256 | 2021-03-28T08:19:17 | 2021-03-28T08:19:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,137 | java | package com.member_recipient.model;
import java.util.List;
import com.member.model.MemDAO;
public class MemrService {
private MemrDAO_interface dao;
public MemrService() {
dao = new MemrDAO();
}
public MemrVO addMemr(Integer memID, String memrName, String memrPhone, String memrAddress) {
MemrVO memrVO = new MemrVO();
memrVO.setMemID(memID);
memrVO.setMemrName(memrName);
memrVO.setMemrPhone(memrPhone);
memrVO.setMemrAddress(memrAddress);
dao.insert(memrVO);
return memrVO;
}
public MemrVO updateMemr(Integer memrID, String memrName, String memrPhone, String memrAddress) {
MemrVO memrVO = new MemrVO();
memrVO.setMemrID(memrID);
memrVO.setMemrName(memrName);
memrVO.setMemrPhone(memrPhone);
memrVO.setMemrAddress(memrAddress);
dao.update(memrVO);
return memrVO;
}
public List<MemrVO> getAllByMemID(Integer memID){
return dao.getAllByMemID(memID);
}
public MemrVO getByMemrID(Integer memrID) {
return dao.findByMemrID(memrID);
}
public void deleteMemrByMemrID(Integer memrID) {
dao.delete(memrID);
}
}
| [
"tibame201020@gmail.com"
] | tibame201020@gmail.com |
4f2579b9d74859b67413f6db21e9f6cb90fffd9b | f7178bc3be195496dcc5e80174098bc64dfe1c56 | /app/src/main/java/com/example/savitransperu/models/LoginRequest.java | 52137fd5bc4bc0e770c5c06bdefd8824a4529b87 | [] | no_license | MathiasExtz/SaviTransPeru | 645bced9303c016e28ddf69cb228017b9f316027 | 5b7b7eadce6dec22b2f8ec8fbf37a0b883eff09b | refs/heads/master | 2022-11-20T01:16:10.120788 | 2020-07-21T21:53:01 | 2020-07-21T21:53:01 | 280,275,279 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 418 | java | package com.example.savitransperu.models;
public class LoginRequest {
private String email;
private String password;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
| [
"mathias94445@gmail.com"
] | mathias94445@gmail.com |
a7afe94d5ba343bdc645393c66aae1b00629fc57 | 4f77330f4037f039720c5df12af2b70f648ca4c7 | /test/ComparadorCidadeTest.java | 22261691f18d05a48d2890ff4d737fbae48cd48f | [] | no_license | calinepatriota/final-unit-test | 61b632df9b58e7ea6e0b7999daf82c1e88f45843 | 20be1960ee1a1a66b2bf8e1f5e5a127f1747175a | refs/heads/main | 2023-08-28T01:12:28.991526 | 2021-10-23T23:46:29 | 2021-10-23T23:46:29 | null | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 571 | java | import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Assertions;
class ComparadorCidadeTest {
ComparadorCidade comparadorCidade;
@Test
void compare() {
Cidade cidade= new Cidade("Belo Horizonte");
Cidade cidade2= new Cidade("São Paulo");
cidade.distancia=50;
cidade2.distancia=100;
comparadorCidade = new ComparadorCidade();
comparadorCidade.compare(cidade, cidade2);
Assertions.assertEquals(-1, comparadorCidade.compare(cidade, cidade2),"Erro ao comparar distancia");
}
} | [
"calinepatriota@gmail.com"
] | calinepatriota@gmail.com |
b25ea2e6a2f6dbe9a045edaa72eaaeb8764b951c | 32a879851e97196400ccc3066e2f873abf525306 | /app/src/main/java/tw/cchi/handicare/ui/shock/ShockPresenter.java | abb705925ee904fc0b66e6e2de18317a445cee45 | [] | no_license | edingroot/HandiCare | e9692ee6edba173108b829b4f504ceafda7afefb | ed01f5f850f76f916b402ef4fe64744b3006cb8a | refs/heads/master | 2021-09-14T21:03:24.561727 | 2018-05-19T15:57:00 | 2018-05-19T15:57:00 | 113,294,333 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,213 | java | package tw.cchi.handicare.ui.shock;
import android.content.Context;
import android.content.IntentFilter;
import android.support.v7.app.AppCompatActivity;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
import io.reactivex.Observable;
import io.reactivex.Scheduler;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import tw.cchi.handicare.Config;
import tw.cchi.handicare.MvpApp;
import tw.cchi.handicare.R;
import tw.cchi.handicare.device.bluno.BlunoHelper;
import tw.cchi.handicare.device.eshock.DeviceAcup;
import tw.cchi.handicare.di.ActivityContext;
import tw.cchi.handicare.di.PresenterHolder;
import tw.cchi.handicare.receiver.UsbBroadcastReceiver;
import tw.cchi.handicare.ui.base.BasePresenter;
import static tw.cchi.handicare.Constants.ACTION_USB_PERMISSION;
public class ShockPresenter<V extends ShockMvpView> extends BasePresenter<V> implements ShockMvpPresenter<V> {
private static final long TIMER_TICK_INTERVAL = 20; // ms
@Inject MvpApp.GlobalVariables globalVar;
@Inject DeviceAcup mDevAcup;
@Inject UsbBroadcastReceiver mUsbReceiver;
@Inject AppCompatActivity activity;
@Inject @ActivityContext Context context;
private boolean usbMode;
private BlunoHelper blunoHelper;
private Disposable powerTimer;
private int initialSeconds = 0;
private float remainingSeconds = 0;
@Inject
public ShockPresenter(CompositeDisposable compositeDisposable, @NonNull PresenterHolder presenterHolder) {
super(compositeDisposable);
presenterHolder.setShockMvpPresenter(this);
}
@Override
public void onAttach(V mvpView) {
super.onAttach(mvpView);
connectBlunoLibraryService().subscribe(blunoLibraryService -> {
if (!blunoLibraryService.isDeviceConnected()) {
getMvpView().showToast(R.string.bluno_not_connected);
enableUsbMode();
} else {
blunoHelper = new BlunoHelper(blunoLibraryService);
blunoHelper.setMode(BlunoHelper.OpMode.SHOCK);
}
});
}
@Override
public boolean powerOn() {
if (!checkDeviceConnected())
return false;
// Turn on
int duration = getMvpView().getDurationSetting();
if (duration == 0){
getMvpView().showSnackBar("請設定時間長度");
return false;
}
if (usbMode) {
mDevAcup.powerOn();
} else {
blunoHelper.setShockEnabled(true);
// Update state
globalVar.bPower = true;
globalVar.nX = globalVar.nY = 1;
}
startPowerTimer(duration);
getMvpView().setPowerAnimationEnabled(true);
updateViewDeviceControls();
return true;
}
@Override
public boolean powerOff() {
if (!checkDeviceConnected())
return false;
if (usbMode) {
mDevAcup.powerOff();
} else {
blunoHelper.setShockEnabled(false);
globalVar.bPower = false;
globalVar.nX = globalVar.nY = globalVar.nZ = 0;
}
stopPowerTimer();
getMvpView().setPowerAnimationEnabled(false);
updateViewDeviceControls();
return true;
}
@Override
public Observable<Boolean> switchUsbMode(boolean isUsbMode) {
if (isUsbMode == usbMode)
return Observable.just(true);
if (isUsbMode) {
enableUsbMode();
return Observable.just(true);
} else {
return Observable.<Boolean>create(emitter -> {
connectBlunoLibraryService().subscribe(blunoLibraryService -> {
if (!blunoLibraryService.isDeviceConnected()) {
getMvpView().showToast(R.string.bluno_not_connected);
emitter.onNext(false);
} else {
blunoHelper = new BlunoHelper(blunoLibraryService);
blunoHelper.setMode(BlunoHelper.OpMode.SHOCK);
disableUsbMode();
emitter.onNext(true);
}
emitter.onComplete();
});
}).subscribeOn(Schedulers.io());
}
}
@Override
public void onCustomStrengthChanged(int progressValue) {
if (globalVar.bPower) {
progressValue = progressValue == 0 ? 1 : progressValue;
} else {
progressValue = 0;
}
mDevAcup.setStrength(progressValue);
updateViewDeviceControls();
}
@Override
public void onCustomFrequencyChanged(int progressValue) {
if (globalVar.bPower) {
progressValue = progressValue == 0 ? 1 : progressValue;
} else {
progressValue = 0;
}
mDevAcup.setFrequency(progressValue);
updateViewDeviceControls();
}
private void startPowerTimer(int seconds) {
initialSeconds = seconds;
remainingSeconds = seconds;
getMvpView().setProgress(0, initialSeconds);
powerTimer = Observable.interval(TIMER_TICK_INTERVAL, TimeUnit.MILLISECONDS)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(aLong -> {
remainingSeconds -= (float) TIMER_TICK_INTERVAL / 1000;
if (remainingSeconds <= 0) {
onPowerTimeEnd();
}
if (isViewAttached())
getMvpView().setProgress(initialSeconds - remainingSeconds, initialSeconds);
});
}
private void stopPowerTimer() {
initialSeconds = 0;
remainingSeconds = 0;
if (isViewAttached())
getMvpView().setProgress(0, initialSeconds);
// Stop timer
if (powerTimer != null)
powerTimer.dispose();
}
private void onPowerTimeEnd() {
powerOff();
}
public void updateViewDeviceControls() {
boolean powerOn = globalVar.bPower;
if (!powerOn)
stopPowerTimer();
getMvpView().updateDeviceControls(powerOn, globalVar.nX, globalVar.nY);
}
@Override
public boolean isUsbMode() {
return usbMode;
}
@Override
public void onDetach() {
super.onDetach();
stopPowerTimer();
if (globalVar.bPower) {
globalVar.bPower = false;
if (checkDeviceConnected()) {
if (usbMode) {
mDevAcup.commWithUsbDevice();
} else {
blunoHelper.setShockEnabled(false);
}
}
}
if (usbMode)
context.unregisterReceiver(this.mUsbReceiver);
}
private void enableUsbMode() {
// Register broadcast receiver events
IntentFilter filterAttachedDetached = new IntentFilter();
filterAttachedDetached.addAction(ACTION_USB_PERMISSION);
filterAttachedDetached.addAction("android.hardware.usb.action.USB_DEVICE_DETACHED");
filterAttachedDetached.addAction("android.hardware.usb.action.USB_DEVICE_ATTACHED");
filterAttachedDetached.addAction("android.intent.action.BATTERY_CHANGED");
context.registerReceiver(mUsbReceiver, filterAttachedDetached);
usbMode = true;
}
private void disableUsbMode() {
context.unregisterReceiver(mUsbReceiver);
usbMode = false;
}
private boolean checkDeviceConnected() {
if (usbMode) {
if (!mDevAcup.connect()) {
if (isViewAttached())
getMvpView().showSnackBar(R.string.usb_not_found);
return false;
}
} else {
if (blunoHelper == null || !blunoHelper.isDeviceConnected()) {
getMvpView().showSnackBar(R.string.bluno_not_connected);
return false;
}
}
return true;
}
}
| [
"edingroot@gmail.com"
] | edingroot@gmail.com |
63117959d8a4d75d8099ac46c9c240f862d445a8 | e6ede5698ee5d49adc5b6484ad09eaa557e2051f | /ijkplayer-fuliao/src/androidTest/java/com/example/ijkplayer_fuliao/ExampleInstrumentedTest.java | 2fed39ac30dead4fbeac6212085ba4402e212f4c | [] | no_license | yangqi168/ijkplayer-home | 5f4e00a2e73bb700232e5e27895e652e84c967b6 | 2f2b084ac71f6a5812f5241deece107eb13c7536 | refs/heads/master | 2021-09-06T06:43:32.119558 | 2018-02-03T09:39:33 | 2018-02-03T09:39:33 | 120,078,493 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 760 | java | package com.example.ijkplayer_fuliao;
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.ijkplayer_fuliao", appContext.getPackageName());
}
}
| [
"yang_qi168@aliyun.com"
] | yang_qi168@aliyun.com |
dc9d40a2ff2b658f1e2e7421e9a2c8976af8fb3b | 473b76b1043df2f09214f8c335d4359d3a8151e0 | /benchmark/bigclonebenchdata_partial/17965562.java | b8a92bc30a2852dce799857eb4645dcacbf2ea97 | [] | no_license | whatafree/JCoffee | 08dc47f79f8369af32e755de01c52d9a8479d44c | fa7194635a5bd48259d325e5b0a190780a53c55f | refs/heads/master | 2022-11-16T01:58:04.254688 | 2020-07-13T20:11:17 | 2020-07-13T20:11:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,595 | java |
class c17965562 {
public void write(File file) throws Exception {
if (isInMemory()) {
FileOutputStream fout = null;
try {
fout = new FileOutputStream(file);
fout.write(get());
} finally {
if (fout != null) {
fout.close();
}
}
} else {
File outputFile = getStoreLocation();
if (outputFile != null) {
size = outputFile.length();
if (!outputFile.renameTo(file)) {
BufferedInputStream in = null;
BufferedOutputStream out = null;
try {
in = new BufferedInputStream(new FileInputStream(outputFile));
out = new BufferedOutputStream(new FileOutputStream(file));
IOUtils.copy(in, out);
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
}
}
if (out != null) {
try {
out.close();
} catch (IOException e) {
}
}
}
}
} else {
throw new FileUploadException("Cannot write uploaded file to disk!");
}
}
}
}
| [
"piyush16066@iiitd.ac.in"
] | piyush16066@iiitd.ac.in |
c683877aa0b07f48c2ad4fd0bcfa5f615759683a | 053d3c8c33691752e240b4f2e721fd0fc0f7fb59 | /service/src/main/java/com/glory/service/study/designpattern/mediator/PlaneDispatcher.java | 20df9ee1fca5d1dcd1e6c7efbff85c3be6f711f0 | [] | no_license | glory-ych/myjava | fb17e61e4295d88fbb530996932d3780b223655e | 6ff70c46728596c70745d7496fe9f7cdde80aaa3 | refs/heads/master | 2020-11-27T17:25:47.401730 | 2017-05-02T09:53:09 | 2017-05-02T09:53:10 | 67,674,408 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 790 | java | package com.glory.service.study.designpattern.mediator;
/**
* Created by yangch on 2017/4/11 0011.
*/
public class PlaneDispatcher extends Dispatcher {
private NFPlane nfPlane;
private BFPlane bfPlane;
@Override
void dispatch(String message, Plane plane) {
System.out.println("控制台得到消息..." + message);
if (plane == nfPlane) {
bfPlane.avoid();
} else if (plane == bfPlane) {
nfPlane.avoid();
}
}
public NFPlane getNfPlane() {
return nfPlane;
}
public void setNfPlane(NFPlane nfPlane) {
this.nfPlane = nfPlane;
}
public BFPlane getBfPlane() {
return bfPlane;
}
public void setBfPlane(BFPlane bfPlane) {
this.bfPlane = bfPlane;
}
}
| [
"yangch@culiu.org"
] | yangch@culiu.org |
729cb93956bf1651d9d805fdc0d81e166d646e5c | 4582b7c72ac12c08689761dd5ff82837d42960e2 | /app/src/test/java/com/ardapekis/cs2340_27/JasonTest.java | 75631703dc77861fe8350c49ab9570c9dcd505da | [] | no_license | ardapekis/cs2340 | 77a08cacf2f8e4c4cb8effb1b10c46b9b6369122 | c32af5a7ec893750d67832fd2015b5259a017f31 | refs/heads/master | 2021-01-20T21:46:04.449234 | 2017-11-21T04:07:53 | 2017-11-21T04:07:53 | 101,790,398 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,718 | java | package com.ardapekis.cs2340_27;
import com.ardapekis.cs2340_27.controller.GraphActivity;
import com.ardapekis.cs2340_27.model.Facade;
import org.junit.Before;
import org.junit.Test;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Locale;
import static org.junit.Assert.*;
public class JasonTest {
private Facade facade;
@Before
public void setUp() throws ParseException {
facade = Facade.getInstance();
DateFormat format = new SimpleDateFormat("MMddyyyy", Locale.US);
facade.setDate1(format.parse("10012016"));
facade.setDate2(format.parse("01012018"));
}
@Test
public void testGetDateRange() throws Exception {
assertEquals(16, facade.getDateRange());
}
@Test
public void testGetDateRangeSameMonth() throws Exception {
DateFormat format = new SimpleDateFormat("MMddyyyy", Locale.US);
facade.setDate1(format.parse("10012016"));
facade.setDate2(format.parse("10012016"));
assertEquals(1, facade.getDateRange());
}
@Test
public void testAddXLabelsSize() throws Exception {
String[] test = GraphActivity.getXLabels();
assertEquals(16, test.length);
}
@Test
public void testAddXLabelsContents() throws Exception {
String[] test = GraphActivity.getXLabels();
String[] expected = {"10/2016", "11/2016", "12/2016", "1/2017",
"2/2017", "3/2017", "4/2017", "5/2017", "6/2017",
"7/2017", "8/2017", "9/2017", "10/2017", "11/2017",
"12/2017", "1/2018"};
assertArrayEquals(expected, test);
}
} | [
"jason.khn.lee@gmail.com"
] | jason.khn.lee@gmail.com |
d022b108a0f112d6186a3c88b844b3a0c8d16468 | 6d896a0f10031fe2ca039d5eaf393658697c5858 | /app/models/Clan.java | 2684200f41e4c4df84033a55729db642fe340cab | [] | no_license | Aha00a/wururung.com | 386b8eacb5613b084b6257a9615a60cd04e16807 | f8fe0687677a1dcb16163af64e36ef7e35dcc7d7 | refs/heads/master | 2021-01-19T12:36:13.968620 | 2015-10-27T05:32:24 | 2015-10-27T05:32:24 | 25,803,890 | 0 | 0 | null | 2014-12-01T14:10:55 | 2014-10-27T04:58:12 | JavaScript | UTF-8 | Java | false | false | 77 | java | package models;
public abstract class Clan extends ModelAutoIncrement {
}
| [
"aha00a@gmail.com"
] | aha00a@gmail.com |
f4c2d9006744ed577db7e7fc90bf851b04add251 | 611ae56941f634d5a582bfb9f08965105df3969f | /src/main/java/cufy/util/package-info.java | a4d75135a3b88e157f8cb016f76dce9b20032662 | [
"Apache-2.0"
] | permissive | cufyorg-archive/framework | a4178ea29db4864b9af9ab8e81fc52c55a844252 | 31414b305c5a93dfb81667dce5a8191ebc69904d | refs/heads/master | 2023-05-31T00:49:16.093365 | 2021-06-16T11:27:09 | 2021-06-16T11:27:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,082 | java | /*
* Copyright 2020 Cufy
*
* 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.
*/
/**
* A package of utilities used in the framework. The utilities can be used anywhere, and it is not designed to work only
* on the framework. It has been designed help to the syntax user and the reflection user. It has a variant type of
* utils such as utils for arrays, collections, readers and reflection and many more.
*
* @author LSafer
* @version 0.1.5
* @see <a href="https://framework.cufy.org/util">framework.cufy.org/util</a>
* @since 0.0.a ~2019.06.11
*/
package cufy.util; | [
"lsaferse@gmail.com"
] | lsaferse@gmail.com |
fa7ba3670bcfa48f4da895c8061ca035adb13546 | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /IntroClassJava/dataset/median/9c9308d4cdf5bc5dfe6efc2b1a9c9bc9a44fbff73c5367c97e3be37861bbb3ba9ac7ad3ddec74dc66e34fe8f0804e46186819b4e90e8f9a59d1b82d9cf0a6218/012/mutations/87/median_9c9308d4_012.java | b9420279f4e1972cb10acc41876e2734f803ed85 | [] | no_license | ozzydong/CapGen | 356746618848065cce4e253e5d3c381baa85044a | 0ba0321b6b1191443276021f1997833342f02515 | refs/heads/master | 2023-03-18T20:12:02.923428 | 2020-08-21T03:08:28 | 2020-08-21T03:08:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,187 | java | package introclassJava;
class IntObj {
public int value;
public IntObj () {
} public IntObj (int i) {
value = i;
}
}
class FloatObj {
public float value;
public FloatObj () {
} public FloatObj (float i) {
value = i;
}
}
class LongObj {
public long value;
public LongObj () {
} public LongObj (long i) {
value = i;
}
}
class DoubleObj {
public double value;
public DoubleObj () {
} public DoubleObj (double i) {
value = i;
}
}
class CharObj {
public char value;
public CharObj () {
} public CharObj (char i) {
value = i;
}
}
public class median_9c9308d4_012 {
public java.util.Scanner scanner;
public String output = "";
public static void main (String[]args) throws Exception {
median_9c9308d4_012 mainClass = new median_9c9308d4_012 ();
String output;
if (args.length > 0) {
mainClass.scanner = new java.util.Scanner (args[0]);
} else {
mainClass.scanner = new java.util.Scanner (System.in);
}
mainClass.exec ();
System.out.println (mainClass.output);
}
public void exec () throws Exception {
DoubleObj n1 = new DoubleObj (), n2 = new DoubleObj (), n3 =
new DoubleObj (), median = new DoubleObj ();
output +=
(String.format ("Please enter 3 numbers separated by spaces > "));
n1.value = scanner.nextDouble ();
n2.value = scanner.nextDouble ();
n3.value = scanner.nextDouble ();
if (n1.value >= n2.value || n1.value >= n3.value) {
if (n2.value >= n3.value && n1.value >= n2.value) {
median.value = n2.value;
} else if (n2.value >= n1.value) {
median.value = n1.value;
} else {
median.value = n3.value;
}
} else if (n2.value >= n3.value) {
median.value = n3.value;
} else {
median.value = n2.value;
}
if (true) return ;
output += (String.format ("%.0f is the median\n", median.value));
if (true)
return;;
}
}
| [
"justinwm@163.com"
] | justinwm@163.com |
e1f4bb9038f955f530234cadf916d442fa94183d | f0d25847654a2056e75d2464ac16471542db3f81 | /app/src/main/java/com/learn/backroundtaskstutorial/JobIntentServiceActivity.java | ee2ecb963364e8d84eeb1a2352b0e0ec44efdcfb | [] | no_license | ashok3190/AndroidTutorials | 8b16dc2369fe1c42859485408a28c12e8de4b349 | b85ec0cd6235816234ec7838c15251ad05fed01f | refs/heads/main | 2023-05-12T04:43:43.705885 | 2021-05-27T04:51:10 | 2021-05-27T04:51:10 | 371,249,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 875 | java | package com.learn.backroundtaskstutorial;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import androidx.annotation.Nullable;
import com.learn.services.ExampleJobIntentService;
public class JobIntentServiceActivity extends Activity {
private EditText editText;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_job_intent_service);
editText = findViewById(R.id.editTextJobIntent);
}
public void onEnqueueWork(View view) {
Intent intent = new Intent(this, ExampleJobIntentService.class);
intent.putExtra("message", editText.getText().toString());
ExampleJobIntentService.customEnqueueWork(this, intent);
}
}
| [
"ashok@nanoheal.com"
] | ashok@nanoheal.com |
37452b1862c7f0810af6331e1d0128b7f572bd10 | 86bf6394bf01b66cda366ebe49120a034c60a8bf | /src/views/TelaCadastroProduto.java | 70cdeba9c803db8823bdaf1988e9dd618cacb9ec | [] | no_license | acferlucas/EstoqueMercado | 97e1f3cd54220e404573e26edd8cd86d47a201b1 | 40b24a76d250e6e3cef0fd17288144dd9bb7b54b | refs/heads/master | 2023-04-18T07:28:08.387122 | 2021-04-27T17:15:26 | 2021-04-27T17:15:26 | 362,192,442 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,145 | 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 views;
import model.bean.Produto;
import model.dao.ProdutoDAO;
/**
*
* @author acfers
*/
public class TelaCadastroProduto extends javax.swing.JFrame {
/**
* Creates new form TelaCadastroProduto
*/
public TelaCadastroProduto() {
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">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel3 = new javax.swing.JPanel();
jPanel1 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
txtNome = new javax.swing.JTextField();
txtQtd = new javax.swing.JTextField();
txtPreco = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jSeparator1 = new javax.swing.JSeparator();
jSeparator2 = new javax.swing.JSeparator();
jSeparator3 = new javax.swing.JSeparator();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel3.setBackground(new java.awt.Color(255, 255, 255));
jPanel1.setBackground(new java.awt.Color(204, 102, 0));
jLabel2.setBackground(new java.awt.Color(204, 102, 0));
jLabel2.setFont(new java.awt.Font("Yu Gothic Light", 0, 18)); // NOI18N
jLabel2.setForeground(new java.awt.Color(255, 255, 255));
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagensMenu/icons8-product-50.png"))); // NOI18N
jLabel2.setText("Cadastro Produto");
jLabel2.setOpaque(true);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 271, Short.MAX_VALUE)
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2)
.addContainerGap(18, Short.MAX_VALUE))
);
jLabel1.setFont(new java.awt.Font("Yu Gothic Light", 0, 14)); // NOI18N
jLabel1.setText("Nome");
jLabel3.setFont(new java.awt.Font("Yu Gothic Light", 0, 14)); // NOI18N
jLabel3.setText("Quantidade");
jLabel4.setFont(new java.awt.Font("Yu Gothic Light", 0, 14)); // NOI18N
jLabel4.setText("preço");
jButton1.setFont(new java.awt.Font("Yu Gothic Light", 0, 12)); // NOI18N
jButton1.setText("Cadastrar");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(37, 37, 37)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel1)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(txtNome)
.addComponent(txtQtd)
.addComponent(txtPreco, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
.addComponent(jSeparator1)
.addComponent(jSeparator2)
.addComponent(jSeparator3)))
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(76, 76, 76)
.addComponent(jButton1)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtQtd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(5, 5, 5)
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtPreco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jButton1)
.addContainerGap(29, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
Produto p = new Produto();
ProdutoDAO dao = new ProdutoDAO();
p.setNome(txtNome.getText());
p.setQtd(Integer.parseInt(txtQtd.getText()));
p.setPreco(Double.parseDouble(txtPreco.getText()));
dao.create(p);
txtNome.setText("");
txtQtd.setText("");
txtPreco.setText("");
new TelaEstoqueProduto().setVisible(true);
this.dispose();
}//GEN-LAST:event_jButton1ActionPerformed
/**
* @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(TelaCadastroProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(TelaCadastroProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(TelaCadastroProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(TelaCadastroProduto.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 TelaCadastroProduto().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel3;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JSeparator jSeparator2;
private javax.swing.JSeparator jSeparator3;
private javax.swing.JTextField txtNome;
private javax.swing.JTextField txtPreco;
private javax.swing.JTextField txtQtd;
// End of variables declaration//GEN-END:variables
}
| [
"matheusacfer.nave@gmail.com"
] | matheusacfer.nave@gmail.com |
c1dcebc7079657e20bebcd32f149efcba192a86f | 36bd4ae7035d5c11bdb4192b6c6782d3f5620e25 | /app/src/main/java/ru/maxitel/lk/listeners/MaxitelStatesTextViewListener.java | 2720abfb1ad825680a1811a1fe5ff3f92ff61d87 | [] | no_license | PPmishapPP/maxitel | 804be31d6472acc6b6e0e5df6550ba77c59de1a9 | 52b747fd857240f22e71fc3902fa54ccd6518fd5 | refs/heads/master | 2021-01-10T15:59:22.107798 | 2016-08-22T13:54:18 | 2016-08-22T13:54:18 | 54,870,863 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,160 | java | package ru.maxitel.lk.listeners;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AlertDialog;
import android.view.View;
import java.util.Locale;
import ru.maxitel.lk.ConfirmActivity;
import ru.maxitel.lk.R;
import ru.maxitel.lk.User;
import ru.maxitel.lk.notification.State;
public class MaxitelStatesTextViewListener implements View.OnClickListener {
private State state;
private Context context;
public MaxitelStatesTextViewListener(State state, Context context) {
this.state = state;
this.context = context;
}
@Override
public void onClick(View v) {
AlertDialog.Builder dialog = new AlertDialog.Builder(context);
switch (state) {
case PLAY:
dialog.setTitle(R.string.inet_on);
String message = context.getString(R.string.inet_on_message_format);
message = String.format(Locale.US, message, User.getTariff().getPriseOneDey(), User.getDaysLeft());
dialog.setMessage(message);
dialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
dialog.setNegativeButton(R.string.zablokirovat, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(context, ConfirmActivity.class);
intent.setAction(ConfirmActivity.VOLUNTARY_LOCKED);
context.startActivity(intent);
}
});
dialog.setNeutralButton(R.string.pay_naw2, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent browseIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://m.payfon24.ru/prudok?card"));
context.startActivity(browseIntent);
}
});
break;
case PAUSE:
dialog.setTitle(R.string.voluntarily_locked);
dialog.setMessage(R.string.voluntarily_locked_info);
dialog.setPositiveButton(R.string.razblokirovat, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(context, ConfirmActivity.class);
intent.setAction(ConfirmActivity.UNBLOCK);
context.startActivity(intent);
}
});
dialog.setNegativeButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
break;
case BLOCK:
dialog.setTitle(R.string.sistem_block);
dialog.setMessage(R.string.system_block_info);
dialog.setPositiveButton(R.string.pay_naw2, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent browseIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://m.payfon24.ru/prudok?card"));
context.startActivity(browseIntent);
}
});
dialog.setNegativeButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
}
dialog.show();
}
} | [
"ka4erp@mail.ru"
] | ka4erp@mail.ru |
affdbddbe9ebf9c092400991bd04a1966ad1300a | c0b37a664fde6a57ae61c4af635e6dea28d7905e | /Helpful dev stuff/AeriesMobilePortal_v1.2.0_apkpure.com_source_from_JADX/com/google/android/gms/internal/auth/zzbh.java | 86ffa3b991068c340a54f05b3f915f7f2e933941 | [] | no_license | joshkmartinez/Grades | a21ce8ede1371b9a7af11c4011e965f603c43291 | 53760e47f808780d06c4fbc2f74028a2db8e2942 | refs/heads/master | 2023-01-30T13:23:07.129566 | 2020-12-07T18:20:46 | 2020-12-07T18:20:46 | 131,549,535 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,346 | java | package com.google.android.gms.internal.auth;
import android.content.Context;
import android.os.Bundle;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Looper;
import android.text.TextUtils;
import com.google.android.gms.auth.api.zzf;
import com.google.android.gms.auth.api.zzh;
import com.google.android.gms.common.GooglePlayServicesUtilLight;
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
import com.google.android.gms.common.internal.ClientSettings;
import com.google.android.gms.common.internal.GmsClient;
public final class zzbh extends GmsClient<zzbk> {
private final Bundle zzcf;
public zzbh(Context context, Looper looper, ClientSettings clientSettings, zzh com_google_android_gms_auth_api_zzh, ConnectionCallbacks connectionCallbacks, OnConnectionFailedListener onConnectionFailedListener) {
super(context, looper, 16, clientSettings, connectionCallbacks, onConnectionFailedListener);
if (com_google_android_gms_auth_api_zzh == null) {
this.zzcf = new Bundle();
return;
}
throw new NoSuchMethodError();
}
protected final /* synthetic */ IInterface createServiceInterface(IBinder iBinder) {
if (iBinder == null) {
return null;
}
IInterface queryLocalInterface = iBinder.queryLocalInterface("com.google.android.gms.auth.api.internal.IAuthService");
return queryLocalInterface instanceof zzbk ? (zzbk) queryLocalInterface : new zzbl(iBinder);
}
protected final Bundle getGetServiceRequestExtraArgs() {
return this.zzcf;
}
public final int getMinApkVersion() {
return GooglePlayServicesUtilLight.GOOGLE_PLAY_SERVICES_VERSION_CODE;
}
protected final String getServiceDescriptor() {
return "com.google.android.gms.auth.api.internal.IAuthService";
}
protected final String getStartServiceAction() {
return "com.google.android.gms.auth.service.START";
}
public final boolean requiresSignIn() {
ClientSettings clientSettings = getClientSettings();
return (TextUtils.isEmpty(clientSettings.getAccountName()) || clientSettings.getApplicableScopes(zzf.API).isEmpty()) ? false : true;
}
}
| [
"joshkmartinez@gmail.com"
] | joshkmartinez@gmail.com |
d91f26f4d9fca679f930967e4c37c1372fc1318c | 79c5a793547b760c16a5f546151a946e394c5450 | /src/test/java/pl/java/scalatech/stat/StatisticsTest.java | b5bd0e29c35d592819ff06ae9ab3911ce1f2c64b | [
"MIT"
] | permissive | przodownikR1/hibernateKata | 567b6eb087461d12494b674d0030216ec4f258ce | cf1f8b7dd1583360a1f1c8f34432bcde3ff55fdb | refs/heads/master | 2016-09-13T14:30:38.903651 | 2016-05-13T19:55:57 | 2016-05-13T19:55:57 | 56,308,522 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,620 | java | package pl.java.scalatech.stat;
import java.math.BigDecimal;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.stat.SessionStatistics;
import org.hibernate.stat.Statistics;
import org.junit.Test;
import lombok.extern.slf4j.Slf4j;
import pl.java.scalatech.domain.Item;
import pl.java.scalatech.hibernate.service.HibernateServiceUtils;
@Slf4j
public class StatisticsTest {
private final SessionFactory sf = HibernateServiceUtils.getSessionFactory();
@Test
public void shouldGetStatistics() {
log.info("+++ show statistics");
Session session = sf.openSession();
SessionStatistics sessionStats = session.getStatistics();
Statistics stats = sf.getStatistics();
try {
Transaction tx = session.beginTransaction();
for(int i =0 ;i<10;i++){
Item item = new Item();
item.setName("fork_"+i);
item.setPrice(BigDecimal.valueOf(100+i));
session.save(item);
}
Query query = session.createQuery("FROM Item");
query.list().forEach(i -> log.info("{}", i));
tx.commit();
} catch (Exception e) {
log.error("{}", e);
} finally {
log.info("getEntityCount- {}", sessionStats.getEntityCount());
log.info("openCount- {}", stats.getSessionOpenCount());
log.info("getEntityInsertCount- {}", stats.getEntityInsertCount());
stats.logSummary();
session.close();
}
}
}
| [
"przodownik@tlen.pl"
] | przodownik@tlen.pl |
e62db152d5563652b1438ea12edc1d552d11f7c6 | a9a40b4a5c2400e64468278a5ba5468e39829bda | /java/test/java_algorithms_implementation/com/algorithms/data_structures/test/SuffixArrayTest.java | 88c82185908637878b2c3d43118679926de98dd6 | [] | no_license | vuquangtin/algorithm | 9a7607817b3aff7fb085f35a2fc4bce1d40ccda9 | 0c33212a66bdeb6513939302d85e7cda9ae445be | refs/heads/master | 2022-12-20T23:43:35.508246 | 2020-09-28T07:19:22 | 2020-09-28T07:19:22 | 290,949,654 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,354 | java | package com.algorithms.data_structures.test;
import com.algorithms.data_structures.SuffixArray;
import com.algorithms.data_structures.SuffixTree;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Set;
import static org.junit.Assert.*;
public class SuffixArrayTest {
@Test
public void testSuffixArray(){
String string = "aasfaasdsadasdfasdasdasdasfdasfassdfas";
SuffixArray suffixArrayBuilder = new SuffixArray(string);
SuffixTree<String> suffixTree = new SuffixTree<String>(string);
Set<String> suffixSet = suffixTree.getSuffixes();
ArrayList<Integer> suffixArray = suffixArrayBuilder.getSuffixArray();
int i=0;
for(String suffix : suffixSet){
String substring = string.substring(suffixArray.get(i++));
assertTrue(suffix.equals(substring));
}
}
@Test
public void testKMRarray(){
String string = "aasfaasdsadasdfasdasdasdasfdasfassdfas";
SuffixArray suffixArrayBuilder = new SuffixArray(string);
ArrayList<Integer> suffixArray = suffixArrayBuilder.getSuffixArray();
ArrayList<Integer> KMRarray = suffixArrayBuilder.getKMRarray();
int length = string.length();
for(int i=0; i<length; i++){
assertTrue(suffixArray.get(KMRarray.get(i)) == i);
}
}
} | [
"tinvuquang@admicro.vn"
] | tinvuquang@admicro.vn |
f79a727df9b4df2f919f1f8437fdae18dd4a195e | 5eed3e026308d6130166ff09a6c659dd7cd70cd4 | /cloud-consumer-feign-order80/src/main/java/com/springcloud/service/PaymentFeignService.java | 16dcdecfc2acb9b3cb13fbf8c25a3c453bc7013d | [] | no_license | xieshiwei/SpringCloud | c52605c2da5bd9d632187bf6bedfffdcdbcda361 | 2de11c3ec935f7a12a7291aac269a12c1e3e0ebd | refs/heads/master | 2023-01-23T00:27:21.460298 | 2020-12-01T05:55:25 | 2020-12-01T05:55:25 | 256,194,137 | 1 | 1 | null | 2020-11-06T16:42:41 | 2020-04-16T11:24:45 | Java | UTF-8 | Java | false | false | 1,024 | java | package com.springcloud.service;
import com.springcloud.entities.CommonResult;
import com.springcloud.entities.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@Component
//找Eureka上名字叫【CLOUD-PAYMENT-SERVICE】的微服务,这个必须和主动启动类上的【EnableEurekaClient】对应
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
public interface PaymentFeignService {
@PostMapping(value = "/payment/create")
public CommonResult create(@RequestBody Payment payment);
@GetMapping(value = "/payment/get/{id}")
public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);
@GetMapping(value = "/payment/feign/timeout")
public String paymentFeignTimeout();
}
| [
"xieshiwei@heycars.cn"
] | xieshiwei@heycars.cn |
d59738bd480ca79811f3525ef1af1763d6e33f2b | 9003621b7523cc095c93a274471b351083a70286 | /src/com/atguigu/sale/NotSafeDemo.java | ed7ab7c4d68db38ebfce03f350886be47b05e005 | [] | no_license | zhaojunen-777/sale | ab382ec7708fce0764ab247b9d5f2b7c2ce6a744 | bcbad2bc039130685316d01755b81a5670dadf3e | refs/heads/master | 2020-11-25T09:29:50.773133 | 2019-12-17T11:55:44 | 2019-12-17T11:55:44 | 228,597,075 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 871 | java | package com.atguigu.sale;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
public class NotSafeDemo {
public static void main(String[] args) {
// Set<String> set = new CopyOnWriteArraySet();//Collections.synchronizedSet(new HashSet<>());
// for (int i = 1; i <= 30; i++) {
// new Thread(()->{
// set.add(UUID.randomUUID().toString().substring(0,6));
// System.out.println(set);
// },String.valueOf(i)).start();
// }
Map<String,String> map = new ConcurrentHashMap<>();
for (int i = 1; i <= 30; i++) {
new Thread(()->{
map.put(Thread.currentThread().getName(),UUID.randomUUID().toString().substring(0,6));
System.out.println(map);
},String.valueOf(i)).start();
}
}
}
| [
"751945963@qq.com"
] | 751945963@qq.com |
ce79cc0aa7274874170b0771943821e4cf0cdfde | 9081a72fb59af8a21b1cbde49e12e6d351bb9905 | /gmall-bean/src/main/java/com/atguigu/gmall/bean/SkuLsAttrValue.java | 4a62108e88ca00141e2fcad6cab8586f5342a3f7 | [] | no_license | CQ13365996676/gmall | 2f96b6c261f8b0ed6c18f08586be4fc5cf46c0a2 | a4d6a855f080859fe587a24f5b3a583412a3fb00 | refs/heads/master | 2022-09-18T16:46:36.366491 | 2020-01-15T14:42:47 | 2020-01-15T14:42:47 | 222,213,615 | 0 | 0 | null | 2022-09-01T23:17:52 | 2019-11-17T07:38:11 | CSS | UTF-8 | Java | false | false | 241 | java | package com.atguigu.gmall.bean;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @auther CQ
* @create 2020-01-05 下午 12:50
*/
@Data
public class SkuLsAttrValue implements Serializable {
String valueId;
}
| [
"1315081503@qq.com"
] | 1315081503@qq.com |
43ca0e29d9cd9e8bb51591b44884a0480bf01a9d | 02660bc78dfb937e7ab75792b03562b5f63054b8 | /step7/basics/step7/Counters.java | d8c8a24094b2ce63e4674f99c3fb5625f7083c15 | [] | no_license | AbdulmelikSAK/training-java-1 | 136b520e9983968918619ea5bdd7870d6a2fa25b | 2ce2105e8a9a1d20e1ae0444656747d92170f849 | refs/heads/master | 2020-07-04T18:55:44.047735 | 2019-08-26T17:08:56 | 2019-08-26T17:08:56 | 202,381,788 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,643 | java | package basics.step7;
public class Counters {
static int nRounds;
static int nRound;
static int nSmooths;
static int nSmooth;
static final boolean OPTIMIZED_SMOOTHER = false;
static final boolean OPTIMIZED_GROW = true; // set to true to avoid allocating lines
static final boolean OPTIMIZED_DRAW = true; // set to true to avoid allocating lines
static int nPoints = 0;
static int nLines = 0;
static int nPolygons = 0;
static int nCircles = 0;
static int nPointArrays = 0;
static int nCircleDraws = 0;
static int nPolygonDraws = 0;
static int nLineDraws = 0;
static int nCircleSmooths = 0;
static long elapsedCircleDraws = 0;
static long elapsedCircleSmooths = 0;
static long elapsedPolygonDraws = 0;
static void echo() {
long elapsed;
System.out.println(" nPoints=" + nPoints);
System.out.println(" nLines=" + nLines);
System.out.println(" nPolygons=" + nPolygons);
System.out.println(" nPointArrays=" + nPointArrays);
System.out.println(" nCircles=" + nCircles);
System.out.println();
System.out.println(" nCircleDraws=" + nCircleDraws);
elapsed = elapsedCircleDraws / 1000;
System.out.println(" elapsed=" + elapsed + "us");
System.out.println(" nPolygonDraws=" + nPolygonDraws);
System.out.println(" nLineDraws=" + nLineDraws);
elapsed = elapsedPolygonDraws / 1000;
System.out.println(" elapsed=" + elapsed + "us");
System.out.println();
System.out.println(" nCircleSmooths=" + nCircleSmooths);
elapsed = elapsedCircleSmooths / 1000;
System.out.println(" elapsed=" + elapsed + "us");
}
}
| [
"Abdulmelik.sak@etu.univ-grenoble-alpes.fr"
] | Abdulmelik.sak@etu.univ-grenoble-alpes.fr |
efbe0c6a5ca82a9180e5c702de5999192554f7b0 | c31e642ed7c3a709ce20bb7250de76ea5f405b49 | /TeamProject/src/kr/co/team/controller/member/MemberLogoutController.java | ea9f6bcddccf1d24a87b0976b7307db3a1c0bf27 | [] | no_license | kimmmmsj/Notepad | 98c68655d368d8cc2b1b0432710b65c3298c645d | 31cf81921850f80ff6776add56b03532c9cb0f05 | refs/heads/main | 2023-07-23T07:04:40.829011 | 2021-09-04T15:03:20 | 2021-09-04T15:03:20 | 378,353,419 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 788 | java | package kr.co.team.controller.member;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import kr.co.team.controller.BackController;
import kr.co.team.service.IService;
import kr.co.team.service.member.MemberLogoutService;
public class MemberLogoutController implements BackController{
IService service;
public MemberLogoutController() {
service=new MemberLogoutService();
}
@Override
public void execute(HttpServletRequest request, HttpServletResponse response) {
try {
response.setCharacterEncoding("utf-8");
service.doService(request, response);
HttpSession session=request.getSession(true);
session.invalidate();
}catch(Exception e){
e.printStackTrace();
}
}
}
| [
"kiiiimsj@naver.com"
] | kiiiimsj@naver.com |
e223c19fc6d028edfdd735d51dc49c39ccdeacdf | d9d5966351e64453623b3aa6c47b4c997bcb1dc3 | /RubidiaQuests/src/me/pmilon/RubidiaQuests/ui/QuestDialogsEditionMenu.java | 169b1c6ed9f131e1598daa34ab1a25d6b80d0a7c | [] | no_license | Rubilmax/rubidia | 507f59d0203ab454a65c7dbd9fa0579a605dcec6 | 2924b7bf9dee45ae430ab39800fdc51b67176429 | refs/heads/master | 2021-06-06T02:54:33.459266 | 2020-05-17T09:42:09 | 2020-05-17T09:42:09 | 132,315,657 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 702 | java | package me.pmilon.RubidiaQuests.ui;
import java.util.List;
import me.pmilon.RubidiaQuests.pnjs.QuestPNJ;
import me.pmilon.RubidiaQuests.quests.Quest;
import org.bukkit.entity.Player;
public abstract class QuestDialogsEditionMenu extends DialogsEditionMenu {
private Quest quest;
private QuestPNJ pnj;
public QuestDialogsEditionMenu(Player p, QuestPNJ pnj, Quest quest,
String title, List<String> dialogs) {
super(p, title, dialogs);
this.pnj = pnj;
this.quest = quest;
}
public QuestPNJ getPnj() {
return pnj;
}
public void setPnj(QuestPNJ pnj) {
this.pnj = pnj;
}
public Quest getQuest() {
return quest;
}
public void setQuest(Quest quest) {
this.quest = quest;
}
}
| [
"rmilon@gmail.com"
] | rmilon@gmail.com |
cb3c645289beb0bbe5391e67cd3d6529875c8af8 | af910a2618ccd45c1e60e398752ac2da56ad4069 | /src/org/xinvest/beans/WebQuotes.java | c214a68bdf6a7f412f17887ba1f94c1c634e4b2d | [] | no_license | badiale/xInvest | f265cd803dca046e80daf7462a3cf4b342e69687 | 086ef751a09668d4fec7d0246b248b45e9697f45 | refs/heads/master | 2016-09-15T22:10:48.682909 | 2011-07-01T06:16:22 | 2011-07-01T06:16:22 | 1,959,875 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,450 | java | package org.xinvest.beans;
// Log4J
import org.apache.log4j.Logger;
import org.xinvest.db.DBManager;
import org.hibernate.*;
import java.io.Serializable;
import javax.persistence.*;
import java.util.*;
/**
* WebQuotes
* @author Gabriel Perri Gimenes
**/
@Entity
public class WebQuotes implements Serializable {
@Id
@Column
private Integer id;
@Column String name;
@OneToMany
@JoinColumn(name="quotes_fk")
private Set<Quote> quotes = new HashSet<Quote>();
/**
* Logger
**/
static Logger log = Logger.getLogger("org.xinvest.beans.WebQuotes");
/**
* Pojo
**/
public WebQuotes() {
this.id = new Integer(0);
}
//SETTERS E GETTERS
public Integer getId() { return this.id; }
public void setId(Integer id) { this.id = id; }
public String getName() { return this.name; }
public void setName(String name) { this.name = name; }
public Set getQuotes() { return this.quotes; }
public void setQuotes(Set quotes) { this.quotes = quotes; }
//SQLERS
public void insert() {
Session session = DBManager.getSession();
session.save(this);
}
public void remove() {
Session session = DBManager.getSession();
session.delete(this);
}
public void update() {
Session session = DBManager.getSession();
session.update(this);
}
public static WebQuotes find(Integer id) {
WebQuotes w = new WebQuotes();
Session session = DBManager.getSession();
session.load(w, id);
return w;
}
public static List findAll() {
Session session = DBManager.getSession();
return session.createQuery("SELECT w FROM WebQuotes w").list();
}
//TESTERS
private static void test01() {
Session session = DBManager.getSession();
session.beginTransaction();
WebQuotes w = new WebQuotes();
w.setId(new Integer(1));
w.setName("Mainlist");
w.insert();
session.getTransaction().commit();
log.info("WebQuotes Inserida");
}
private static void test02() {
Session session = DBManager.getSession();
session.beginTransaction();
WebQuotes w = WebQuotes.find(new Integer(1));
Iterator it = w.getQuotes().iterator();
while (it.hasNext()) {
Quote q = (Quote) it.next();
log.info(q.getQuote());
}
session.getTransaction().commit();
log.info("Todas as quotes foram listadas");
}
public static void main (String args[]) {
test01();
//test02();
}
}
| [
"gabsgimenes@gmail.com"
] | gabsgimenes@gmail.com |
09d66b0c166e2e8ed90add8762fa988db30dd70b | 1710d04420493dcbe2977da50ec533a9cc94ccfb | /Kerberos/src/BitArray/BitArray.java | 86f5ef277f2c398495c20d53e4c37f6e00cb02e1 | [] | no_license | 1064867069/KBClient | a6ea1b0fc7f5105a754249834d2ec507f68b02c8 | 1848a909213553995d4a0b0ea09a48b241158c34 | refs/heads/master | 2023-05-06T11:15:43.049773 | 2021-06-03T02:09:21 | 2021-06-03T02:09:21 | 373,337,649 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,347 | java | /*
* Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package BitArray;
import java.io.ByteArrayOutputStream;
import java.util.Arrays;
/**
* A packed array of booleans.
*
* @author Joshua Bloch
* @author Douglas Hoover
*/
public class BitArray {
private byte[] repn;
private int length;
private static final int BITS_PER_UNIT = 8;
private static int subscript(int idx) {
return idx / BITS_PER_UNIT;
}
private static int position(int idx) { // bits big-endian in each unit
return 1 << (BITS_PER_UNIT - 1 - (idx % BITS_PER_UNIT));
}
/**
* Creates a BitArray of the specified size, initialized to zeros.
*/
public BitArray(int length) throws IllegalArgumentException {
if (length < 0) {
throw new IllegalArgumentException("Negative length for BitArray");
}
this.length = length;
repn = new byte[(length + BITS_PER_UNIT - 1)/BITS_PER_UNIT];
}
/**
* Creates a BitArray of the specified size, initialized from the
* specified byte array. The most significant bit of {@code a[0]} gets
* index zero in the BitArray. The array a must be large enough
* to specify a value for every bit in the BitArray. In other words,
* {@code 8*a.length <= length}.
*/
public BitArray(int length, byte[] a) throws IllegalArgumentException {
if (length < 0) {
throw new IllegalArgumentException("Negative length for BitArray");
}
if (a.length * BITS_PER_UNIT < length) {
throw new IllegalArgumentException("Byte array too short to represent " +
"bit array of given length");
}
this.length = length;
int repLength = ((length + BITS_PER_UNIT - 1)/BITS_PER_UNIT);
int unusedBits = repLength*BITS_PER_UNIT - length;
byte bitMask = (byte) (0xFF << unusedBits);
/*
normalize the representation:
1. discard extra bytes
2. zero out extra bits in the last byte
*/
repn = new byte[repLength];
System.arraycopy(a, 0, repn, 0, repLength);
if (repLength > 0) {
repn[repLength - 1] &= bitMask;
}
}
/**
* Create a BitArray whose bits are those of the given array
* of Booleans.
*/
public BitArray(boolean[] bits) {
length = bits.length;
repn = new byte[(length + 7)/8];
for (int i=0; i < length; i++) {
set(i, bits[i]);
}
}
/**
* Copy constructor (for cloning).
*/
private BitArray(BitArray ba) {
length = ba.length;
repn = ba.repn.clone();
}
/**
* Returns the indexed bit in this BitArray.
*/
public boolean get(int index) throws ArrayIndexOutOfBoundsException {
if (index < 0 || index >= length) {
throw new ArrayIndexOutOfBoundsException(Integer.toString(index));
}
return (repn[subscript(index)] & position(index)) != 0;
}
/**
* Sets the indexed bit in this BitArray.
*/
public void set(int index, boolean value)
throws ArrayIndexOutOfBoundsException {
if (index < 0 || index >= length) {
throw new ArrayIndexOutOfBoundsException(Integer.toString(index));
}
int idx = subscript(index);
int bit = position(index);
if (value) {
repn[idx] |= bit;
} else {
repn[idx] &= ~bit;
}
}
/**
* Returns the length of this BitArray.
*/
public int length() {
return length;
}
/**
* Returns a Byte array containing the contents of this BitArray.
* The bit stored at index zero in this BitArray will be copied
* into the most significant bit of the zeroth element of the
* returned byte array. The last byte of the returned byte array
* will be contain zeros in any bits that do not have corresponding
* bits in the BitArray. (This matters only if the BitArray's size
* is not a multiple of 8.)
*/
public byte[] toByteArray() {
return repn.clone();
}
public boolean equals(Object obj) {
if (obj == this) return true;
if (obj == null || !(obj instanceof BitArray)) return false;
BitArray ba = (BitArray) obj;
if (ba.length != length) return false;
for (int i = 0; i < repn.length; i += 1) {
if (repn[i] != ba.repn[i]) return false;
}
return true;
}
/**
* Return a boolean array with the same bit values a this BitArray.
*/
public boolean[] toBooleanArray() {
boolean[] bits = new boolean[length];
for (int i=0; i < length; i++) {
bits[i] = get(i);
}
return bits;
}
/**
* Returns a hash code value for this bit array.
*
* @return a hash code value for this bit array.
*/
public int hashCode() {
int hashCode = 0;
for (int i = 0; i < repn.length; i++)
hashCode = 31*hashCode + repn[i];
return hashCode ^ length;
}
public Object clone() {
return new BitArray(this);
}
private static final byte[][] NYBBLE = {
{ (byte)'0',(byte)'0',(byte)'0',(byte)'0'},
{ (byte)'0',(byte)'0',(byte)'0',(byte)'1'},
{ (byte)'0',(byte)'0',(byte)'1',(byte)'0'},
{ (byte)'0',(byte)'0',(byte)'1',(byte)'1'},
{ (byte)'0',(byte)'1',(byte)'0',(byte)'0'},
{ (byte)'0',(byte)'1',(byte)'0',(byte)'1'},
{ (byte)'0',(byte)'1',(byte)'1',(byte)'0'},
{ (byte)'0',(byte)'1',(byte)'1',(byte)'1'},
{ (byte)'1',(byte)'0',(byte)'0',(byte)'0'},
{ (byte)'1',(byte)'0',(byte)'0',(byte)'1'},
{ (byte)'1',(byte)'0',(byte)'1',(byte)'0'},
{ (byte)'1',(byte)'0',(byte)'1',(byte)'1'},
{ (byte)'1',(byte)'1',(byte)'0',(byte)'0'},
{ (byte)'1',(byte)'1',(byte)'0',(byte)'1'},
{ (byte)'1',(byte)'1',(byte)'1',(byte)'0'},
{ (byte)'1',(byte)'1',(byte)'1',(byte)'1'}
};
private static final int BYTES_PER_LINE = 8;
/**
* Returns a string representation of this BitArray.
*/
public String toString() {
ByteArrayOutputStream out = new ByteArrayOutputStream();
for (int i = 0; i < repn.length - 1; i++) {
out.write(NYBBLE[(repn[i] >> 4) & 0x0F], 0, 4);
out.write(NYBBLE[repn[i] & 0x0F], 0, 4);
if (i % BYTES_PER_LINE == BYTES_PER_LINE - 1) {
out.write('\n');
} else {
out.write(' ');
}
}
// in last byte of repn, use only the valid bits
for (int i = BITS_PER_UNIT * (repn.length - 1); i < length; i++) {
out.write(get(i) ? '1' : '0');
}
return new String(out.toByteArray());
}
public BitArray truncate() {
for (int i=length-1; i>=0; i--) {
if (get(i)) {
return new BitArray(i+1, Arrays.copyOf(repn, (i + BITS_PER_UNIT)/BITS_PER_UNIT));
}
}
return new BitArray(1);
}
}
| [
"1064867069@qq.com"
] | 1064867069@qq.com |
84d65e6eaf711d736cfd4f368479faf300a1d031 | 3d35b84a5564e9464efa7348289196fbfc49c323 | /src/test/java/com/cpbosi/NativeGreetingResourceIT.java | 1e73e26771b0098ff59de6b3541fe588e351a67c | [] | no_license | cpbosi/orphanages-reactive-quarkus | 226352d8f53536fc8640a6bbef368fffc1982fc1 | 758b30e90a870cef6e8edb7dd68b32a9d53c41c3 | refs/heads/main | 2023-02-12T06:54:51.979505 | 2021-01-16T16:02:53 | 2021-01-16T16:02:53 | 326,814,881 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 206 | java | package com.cpbosi;
import io.quarkus.test.junit.NativeImageTest;
@NativeImageTest
public class NativeGreetingResourceIT extends GreetingResourceTest {
// Execute the same tests but in native mode.
} | [
"cpbosi@gmail.com"
] | cpbosi@gmail.com |
94f9d141010fbd9c76ca1179b0e5b9bb8b259fe3 | 2ceb806c65c7dbb9a859d7283388966702d3ee33 | /clubss/src/main/java/com/cjt/result/Result.java | 9b642d3a9f7675ecac452bab43b322126cf4d192 | [] | no_license | Kaylacv/Outdoor-club-platform | 7640384347c84d850037191e668a565b00215396 | bb680a6cc9d6e972a19f7c8d0cbf7c73f4cdf43c | refs/heads/main | 2023-05-22T03:30:04.571836 | 2021-06-13T08:46:38 | 2021-06-13T08:46:38 | 376,452,427 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 338 | java | package com.cjt.result;
import lombok.Data;
/**
* @author Evan
* @date 2019/4
*/
@Data
public class Result {
private int code;
private String message;
private Object result;
Result(int code, String message, Object data) {
this.code = code;
this.message = message;
this.result = data;
}
}
| [
"1098635575@qq.com"
] | 1098635575@qq.com |
3974992481fd032c3827beeb8dfd57816837e7ff | 2e516708ea9cbadc4a1ad4b43f3a44f6f902196a | /task management/Java Code/ust-springtaskmanagement/src/main/java/com/ust/springtaskmanagement/UstSpringtaskmanagementApplication.java | 5bd1b522f34c84165b739da2b0b12c711a976ae4 | [] | no_license | gadenehakiran/USTGLOBAL-15july-19-Neha-Gade | 9899e5fcace8e12e9f0d2d8a0389d39a3ae5dd31 | 0c24c646937dee7c1bf531580453e5c5cec00d2e | refs/heads/master | 2023-01-25T03:16:05.123176 | 2019-11-07T14:40:57 | 2019-11-07T14:40:57 | 210,046,057 | 0 | 0 | null | 2023-01-07T11:30:14 | 2019-09-21T19:59:24 | TypeScript | UTF-8 | Java | false | false | 355 | java | package com.ust.springtaskmanagement;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class UstSpringtaskmanagementApplication {
public static void main(String[] args) {
SpringApplication.run(UstSpringtaskmanagementApplication.class, args);
}
}
| [
"nehagade96@gmail.com"
] | nehagade96@gmail.com |
2f87f6563ba6816a8ee60631a6a9c8144f977d4e | 48f48e03ec33db20bfbe38707fc6a485ee7e5da1 | /app/src/test/java/cn/edu/gdmec/s07150724/alertdialog/ExampleUnitTest.java | 91c05683e181dc5558e85145fcd809b2e5f88ed2 | [] | no_license | kelvinleungv/Alertdialog | 29e9f3409302159602ef03b3d3fe54460fda8ac3 | 3cdcb25c91ae96f90d63dee69f9f157cef6529c5 | refs/heads/master | 2021-01-11T03:04:48.446755 | 2016-10-16T17:29:51 | 2016-10-16T17:29:51 | 71,065,887 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 327 | java | package cn.edu.gdmec.s07150724.alertdialog;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"568750031@qq.com"
] | 568750031@qq.com |
c250883a79d239f2616e3975f19a827b6cf4fbd1 | 0fca6240a045687a771bb0e743555f1b74f69e1c | /WebSeivices/3.RESTful/lesson_41/FlightsRSClient_lesson41_h/src/ru/javabegin/training/flight/object/ExtPlace.java | 6c6e9d2bce3cfa081b06d35da05a41955dc6ec62 | [] | no_license | Abergaz/JavaBeginWork-WEB | 88fabec28f4b3275b21e1113a34cbc18c67ec5ef | b721f2d49ddf260acf4e43a22025959270d023ae | refs/heads/master | 2022-12-08T10:49:54.358706 | 2020-03-12T13:16:57 | 2020-03-12T13:16:57 | 227,131,968 | 0 | 0 | null | 2022-11-24T07:19:43 | 2019-12-10T13:48:08 | TSQL | UTF-8 | Java | false | false | 258 | java | package ru.javabegin.training.flight.object;
import ru.javabegin.training.flight.rs.objects.Place;
public class ExtPlace extends Place{
@Override
public String toString() {
return seatLetter+String.valueOf(seatNumber);
}
}
| [
"zagreba@gmail.com"
] | zagreba@gmail.com |
4930860ea8bfe39afffca61c4d333ca4e88feb4c | 41f48e8c39470d9857276b1b9ff4e278f6e11dff | /bcinfo/JobParser/src/test/Main.java | 9b4a42adecf52c86b023dad835a5fe633e939b5f | [] | no_license | dbabox/eastseven | 542ebe919d4c1711ea0feca376a2c5f7699945cc | bfab0858f368e5dd02596641f888409fe27440b5 | refs/heads/master | 2021-01-10T11:54:43.753589 | 2012-07-09T10:19:08 | 2012-07-09T10:19:08 | 43,064,877 | 2 | 2 | null | null | null | null | GB18030 | Java | false | false | 1,458 | java | /**
*
*/
package test;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import jxl.Sheet;
import jxl.Workbook;
/**
* @author dongq
*
* create time : 2009-12-9 下午03:52:11
*/
public class Main {
public static void main(String[] args) throws Exception{
String path = System.getProperties().getProperty("user.dir")+"/temp_xsp_x5.xls";
//System.out.println(path+"\n");
InputStream inp = new FileInputStream(path);
Workbook book = Workbook.getWorkbook(inp);
Sheet sheet = book.getSheet("非空终端型号分布");
//int columns = sheet.getColumns();
int rows = sheet.getRows();
String mobile = "";
String time = "";
List<String> mobiles = new ArrayList<String>();
List<String> times = new ArrayList<String>();
for(int row=1;row<rows;row++){
int key = row;
if(key%2==0){
times.add(sheet.getCell(0, row).getContents());
}else{
mobiles.add(sheet.getCell(0, row).getContents());
}
//String value = sheet.getCell(0, row).getContents();
//if("".equals(value)) continue;
//System.out.println("insert into temp_xsp_x5(MOBILE,time) values("+key+",'"+value+"');");
}
for(int index=0;index<mobiles.size();index++){
mobile = mobiles.get(index);
time = times.get(index);
System.out.println("insert into temp_xsp_x5(MOBILE,time) values("+mobile+",'"+time+"');");
}
}
}
| [
"eastseven@foxmail.com"
] | eastseven@foxmail.com |
d535ecc605669c2e5546189523d4fec093955624 | ffe972482a8c4150612872f50a23a82513e7c5c8 | /src/main/java/com/agile/pojo/Category.java | 9560e59b6d8a0b56ad0456e6df8aef4b8d05fee7 | [] | no_license | ahalzj/minjiekeshe | 5d627fc8ded6f7f596c69387bdb578c5f57d5da6 | 74f5300f7474d32612c02888d7edc8412c3dc686 | refs/heads/master | 2022-12-22T14:06:07.723336 | 2020-04-09T11:36:58 | 2020-04-09T11:38:57 | 254,352,819 | 0 | 0 | null | 2022-12-16T10:52:43 | 2020-04-09T11:29:14 | Java | UTF-8 | Java | false | false | 860 | java | package com.agile.pojo;
import java.util.List;
public class Category {
private Integer id;
private String name;
private List<Product> products;
private List<List<Product>> productByRow;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public List<Product> getProducts() {
return products;
}
public void setProducts(List<Product> products) {
this.products = products;
}
public List<List<Product>> getProductByRow() {
return productByRow;
}
public void setProductByRow(List<List<Product>> productByRow) {
this.productByRow = productByRow;
}
}
| [
"15001727895@163.com"
] | 15001727895@163.com |
3db84d20bf5ed88a3e56314d6fb42d5c44ddff82 | 5184a85e2e63ec35e8de711ca6fb2186b2c64590 | /driver/src/test/java/com/qa/driver/crunchyRollTest.java | d155067d45ce1d8b5c1c6152259c468b79269df3 | [] | no_license | melvingk/Testing | abed8be0c0f05a4cb0281626f3f9d89e502a21e2 | b3be9e6530888056d143577c57c427a95c1b1e26 | refs/heads/master | 2020-03-28T21:35:09.795621 | 2018-09-24T18:11:26 | 2018-09-24T18:11:26 | 149,167,252 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 482 | java | package com.qa.driver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
public class crunchyRollTest {
@FindBy(id="header_search_input")
private WebElement searchboxx;
@FindBy (xpath="//*[@id=\"main_results\"]/ul/li[2]/a/table/tbody/tr/td[2]/span/span[1]")
private WebElement link;
public void searchForNext (String text)
{
searchboxx.sendKeys(text);
searchboxx.submit();
}
public void clickOnLink()
{
link.click();
}
} | [
"me@hotmail.com"
] | me@hotmail.com |
42fd39967cf36b607cc81602f0de569f4d0503a4 | afab72f0209764c956d609873b7f2b517d67ad5f | /BankServicesEJB/.apt_generated/zw/co/esolutions/ewallet/bankservices/service/jaxws/GetClosingBalance.java | 3d4850b9535ac6ed38617404e659c8868f600859 | [] | no_license | wasadmin/ewallet | 899e66d4d03e77a8f85974d9d2cba8940cf2018a | e132a5e569f4bb67a83df0c3012bb341ffaaf2ed | refs/heads/master | 2021-01-23T13:48:34.618617 | 2012-11-15T10:47:55 | 2012-11-15T10:47:55 | 6,703,145 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,583 | java | //
// Generated By:JAX-WS RI IBM 2.1.1 in JDK 6 (JAXB RI IBM JAXB 2.1.3 in JDK 1.6)
//
package zw.co.esolutions.ewallet.bankservices.service.jaxws;
import java.util.Date;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "getClosingBalance", namespace = "http://service.bankservices.ewallet.esolutions.co.zw/")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "getClosingBalance", namespace = "http://service.bankservices.ewallet.esolutions.co.zw/", propOrder = {
"accountId",
"closingDate"
})
public class GetClosingBalance {
@XmlElement(name = "accountId", namespace = "")
private String accountId;
@XmlElement(name = "closingDate", namespace = "")
private Date closingDate;
/**
*
* @return
* returns String
*/
public String getAccountId() {
return this.accountId;
}
/**
*
* @param accountId
* the value for the accountId property
*/
public void setAccountId(String accountId) {
this.accountId = accountId;
}
/**
*
* @return
* returns Date
*/
public Date getClosingDate() {
return this.closingDate;
}
/**
*
* @param closingDate
* the value for the closingDate property
*/
public void setClosingDate(Date closingDate) {
this.closingDate = closingDate;
}
}
| [
"stanfordbangaba@gmail.com"
] | stanfordbangaba@gmail.com |
2aa62606860868ef40584bab68a7e2293aee2520 | cf85c17c1ad2ae91f4203892a5a259ced5026509 | /src/main/java/io/codelirium/unifiedpost/qms/configuration/tracker/http/log/appender/ConsoleAppenderCopyStrategy.java | a64f6de2335fc792867627a0baf68fcfc6293f1e | [] | no_license | codelirium/qms | d85bdb9cc05bb29dd8e4e73b9ea345bc95e1be10 | 7339b7cf19572eaf4c37076f26596fc974f1d501 | refs/heads/master | 2020-05-25T06:31:54.294844 | 2019-05-20T16:00:23 | 2019-05-20T16:00:23 | 187,669,423 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 698 | java | package io.codelirium.unifiedpost.qms.configuration.tracker.http.log.appender;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.ConsoleAppender;
import org.springframework.stereotype.Component;
@Component
public class ConsoleAppenderCopyStrategy extends AppenderCopyStrategy<ConsoleAppender<ILoggingEvent>> {
@Override
ConsoleAppender<ILoggingEvent> newAppender() {
return new ConsoleAppender<ILoggingEvent>();
}
@Override
void copyOtherAppenderProperties(final ConsoleAppender<ILoggingEvent> source, final ConsoleAppender<ILoggingEvent> destination) {
destination.setTarget(source.getTarget());
destination.setWithJansi(source.isWithJansi());
}
}
| [
"stavros.lekkas@gmail.com"
] | stavros.lekkas@gmail.com |
ff21dabef3820b25ddf79531cc63d0ab6a965484 | ad6ed3f73efdc678de82949cb92f6a5594c80594 | /Elevens/src/activity3/Shuffler.java | 10b97145aa82307c96540496a8c2a373e3defbfa | [] | no_license | corbant/AP-Computer-Science | b9efbc17a25771b3e54f9035f0d32b88f694ee12 | 56fc63366535118c3391a1c423d7a30cd0dfc663 | refs/heads/master | 2020-04-27T13:38:21.170092 | 2019-06-17T15:04:42 | 2019-06-17T15:04:42 | 174,377,036 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,767 | java | package activity3;
/**
* This class provides a convenient way to test shuffling methods.
*/
public class Shuffler {
/**
* The number of consecutive shuffle steps to be performed in each call
* to each sorting procedure.
*/
private static final int SHUFFLE_COUNT = 8;
/**
* Tests shuffling methods.
* @param args is not used.
*/
public static void main(String[] args) {
System.out.println("Results of " + SHUFFLE_COUNT +
" consecutive perfect shuffles:");
int[] values1 = {0, 1, 2, 3};
for (int j = 1; j <= SHUFFLE_COUNT; j++) {
perfectShuffle(values1);
System.out.print(" " + j + ":");
for (int k = 0; k < values1.length; k++) {
System.out.print(" " + values1[k]);
}
System.out.println();
}
System.out.println();
System.out.println("Results of " + SHUFFLE_COUNT +
" consecutive efficient selection shuffles:");
int[] values2 = {0, 1, 2, 3};
for (int j = 1; j <= SHUFFLE_COUNT; j++) {
selectionShuffle(values2);
System.out.print(" " + j + ":");
for (int k = 0; k < values2.length; k++) {
System.out.print(" " + values2[k]);
}
System.out.println();
}
System.out.println();
}
/**
* Apply a "perfect shuffle" to the argument.
* The perfect shuffle algorithm splits the deck in half, then interleaves
* the cards in one half with the cards in the other.
* @param values is an array of integers simulating cards to be shuffled.
*/
public static void perfectShuffle(int[] values) {
int[] shuffled = new int[values.length];
int k = 0;
for(int j = 0; j < (values.length + 1) / 2; j++) {
shuffled[k] = values[j];
k += 2;
}
k = 1;
for(int j = (values.length + 1) / 2; j < values.length; j++) {
shuffled[k] = values[j];
k += 2;
}
for(int j = 0; j < values.length; j++) {
values[j] = shuffled[j];
}
}
/**
* Apply an "efficient selection shuffle" to the argument.
* The selection shuffle algorithm conceptually maintains two sequences
* of cards: the selected cards (initially empty) and the not-yet-selected
* cards (initially the entire deck). It repeatedly does the following until
* all cards have been selected: randomly remove a card from those not yet
* selected and add it to the selected cards.
* An efficient version of this algorithm makes use of arrays to avoid
* searching for an as-yet-unselected card.
* @param values is an array of integers simulating cards to be shuffled.
*/
public static void selectionShuffle(int[] values) {
int r = 0;
for(int k = values.length - 1; k > 0; k--) {
r = (int)(Math.random() * k);
int temp = values[k];
values[k] = values[r];
values[r] = temp;
}
}
}
| [
"corbant25@gmail.com"
] | corbant25@gmail.com |
a995f43dd841afe107024f3df881a7dcaf481015 | 7349849d4b340e01e39b4e5db681932b8a406261 | /app/src/main/java/com/hap/trip/dagger/scope/ApplicationScope.java | f874f3df46633b3fa64fa3278325ef6ecc881a44 | [] | no_license | siullegna/trip | 7c1ba22f307b01548a415b032bf3c44c9e77c775 | d997713c55f1883ab932fc280331aeec7cdf5ba7 | refs/heads/master | 2020-03-20T18:30:37.792927 | 2018-09-10T16:48:41 | 2018-09-10T16:48:41 | 137,591,392 | 0 | 0 | null | 2018-09-10T16:48:42 | 2018-06-16T15:41:34 | Java | UTF-8 | Java | false | false | 270 | java | package com.hap.trip.dagger.scope;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.inject.Scope;
/**
* Created by luis on 6/16/18.
*/
@Scope
@Retention(RetentionPolicy.RUNTIME)
public @interface ApplicationScope {
}
| [
"siullegnak8@gmail.com"
] | siullegnak8@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.