blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9eb529a4a76af6b336add0c97720de11b34ac54d | 846a3695e2c5257b6b812e3d389caf94eca82b47 | /app/src/main/java/com/weima/aishangyi/jiaoshi/adapter/FilterConditionAdapter.java | 2208fecfb9f3a5b5274aaaf07ea84e1a4d48eb03 | [] | no_license | cgy529387306/AiShangYiTeacher | 2482759cb8540cf4c30b02bc1a62a1146de2e5d2 | 6129f6aa5396a95bb9a9ebb73873b30cd359f4be | refs/heads/master | 2020-04-26T03:21:41.866430 | 2019-03-01T08:32:27 | 2019-03-01T08:32:27 | 173,264,544 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,440 | java | package com.weima.aishangyi.jiaoshi.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.weima.aishangyi.jiaoshi.R;
import java.util.ArrayList;
import java.util.List;
/**
* 一级分类(即左侧菜单)的adapter
* Created by hanj on 14-9-25.
*/
public class FilterConditionAdapter extends BaseAdapter {
private Context context;
private List<String> list;
private int tempIndex = 0;
public FilterConditionAdapter(Context context, List<String> list) {
this.context = context;
this.list = list == null?getTestData():list;
}
private List<String> getTestData(){
List<String> dataList = new ArrayList<>();
dataList.add("老师上门");
dataList.add("学生上门");
dataList.add("支持试课");
dataList.add("不支持试课");
dataList.add("男老师");
dataList.add("女老师");
return dataList;
}
public void setTempIndex(int index){
this.tempIndex = index;
notifyDataSetChanged();
}
@Override
public int getCount() {
return list == null ? 0 : list.size();
}
@Override
public Object getItem(int i) {
return null;
}
@Override
public long getItemId(int i) {
return 0;
}
@Override
public View getView(final int position, View convertView, ViewGroup viewGroup) {
ViewHolder holder;
if (convertView == null) {
convertView = LayoutInflater.from(context).inflate(R.layout.item_filter_sort, null);
holder = new ViewHolder();
holder.imv_checkbox = (ImageView) convertView.findViewById(R.id.imv_checkbox);
holder.tv_name = (TextView) convertView.findViewById(R.id.tv_name);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.tv_name.setSelected(position == tempIndex);
holder.tv_name.setText(list.get(position));
holder.imv_checkbox.setImageResource(position == tempIndex ? R.drawable.ic_checkbox_checked : R.drawable.ic_checkbox_uncheck);
return convertView;
}
private class ViewHolder {
TextView tv_name;
ImageView imv_checkbox;
}
}
| [
"661005@nd.com"
] | 661005@nd.com |
beb2b66df5668b4bad552ac77d9dbb2f6c68a84d | 661e2d2249a5dbcfbf882bbb0e4ea61060eeb9b4 | /src/cs4230/struts/ChatAction.java | 0f3a32b2aa4708a039e6ec355753fccd16fa2530 | [] | no_license | yingliang1/struts-and-chat | 4b1e3a434b1d91600d54ab3a5790103e46eff501 | 8c21236273a364e7a185830afd1eb949a90a6310 | refs/heads/master | 2020-04-05T03:11:34.484957 | 2019-12-24T23:47:12 | 2019-12-24T23:47:12 | 156,504,577 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 409 | java | package cs4230.struts;
import java.io.*;
import javax.servlet.*;
import javax.servlet.annotation.*;
import javax.servlet.http.*;
@WebServlet("/chatAction")
public class ChatAction extends HttpServlet {
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
request.getRequestDispatcher("login.jsp").forward(request, response);
}
}
| [
"yingliang@mail.weber.edu"
] | yingliang@mail.weber.edu |
6d510bc633fb905eb5e53ba41221134d3274e7de | 9fbd2ba8247f7bc8cd884c1c2f89c45e4ee54bf6 | /lib/org.apache.lucene/lucene-3.0.3/contrib/swing/src/test/org/apache/lucene/swing/models/DataStore.java | 8c19db7f1c4e5bd6a02274fd55da45398b5a8a8a | [
"MIT",
"BSD-3-Clause",
"Apache-2.0",
"ICU",
"Python-2.0",
"LicenseRef-scancode-unicode-mappings"
] | permissive | rappazzo/PartyDJ | 94906fc5d93dad9d7d45aa6ccf20bdd4050b5ac2 | 7c3abe4ae0402dbdbb1a0ddaabe141c3112be6c6 | refs/heads/master | 2021-01-10T19:36:47.817717 | 2012-02-16T17:31:09 | 2012-02-16T17:31:25 | 1,173,147 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,999 | java | package org.apache.lucene.swing.models;
/**
* Copyright 2005 The Apache Software Foundation
*
* 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.
*/
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
public class DataStore {
private static final String ITALIAN_CATEGORY = "Italian";
private static final String CUBAN_CATEGORY = "Cuban";
private static final String STEAK_CATEGORY = "Steak";
private static int id = 0;
static Collection restaurants = new ArrayList();
static RestaurantInfo pinos = new RestaurantInfo();
static RestaurantInfo canolis = new RestaurantInfo();
static RestaurantInfo picadillo = new RestaurantInfo();
static RestaurantInfo versailles = new RestaurantInfo();
static RestaurantInfo laCaretta = new RestaurantInfo();
static RestaurantInfo laCaretta2 = new RestaurantInfo();
static RestaurantInfo laCaretta3 = new RestaurantInfo();
static RestaurantInfo ranchaLuna = new RestaurantInfo();
static RestaurantInfo leMerais = new RestaurantInfo();
static RestaurantInfo chris = new RestaurantInfo();
static RestaurantInfo outback = new RestaurantInfo();
static RestaurantInfo outback2 = new RestaurantInfo();
static RestaurantInfo outback3 = new RestaurantInfo();
static RestaurantInfo outback4 = new RestaurantInfo();
public static Iterator getRestaurants(){
return restaurants.iterator();
}
static {
pinos.setId(getNextId());
pinos.setType(ITALIAN_CATEGORY);
pinos.setName("Pino's");
pinos.setPhone("(305) 111-2222");
pinos.setStreet("12115 105th Street ");
pinos.setCity("Miami");
pinos.setState("FL");
pinos.setZip("33176");
restaurants.add(pinos);
canolis.setId(getNextId());
canolis.setType(ITALIAN_CATEGORY);
canolis.setName("Canoli's");
canolis.setPhone("(305) 234-5543");
canolis.setStreet("12123 85th Street ");
canolis.setCity("Miami");
canolis.setState("FL");
canolis.setZip("33176");
restaurants.add(canolis);
picadillo.setId(getNextId());
picadillo.setType(CUBAN_CATEGORY);
picadillo.setName("Picadillo");
picadillo.setPhone("(305) 746-7865");
picadillo.setStreet("109 12th Street ");
picadillo.setCity("Miami");
picadillo.setState("FL");
picadillo.setZip("33176");
restaurants.add(picadillo);
versailles.setId(getNextId());
versailles.setType(CUBAN_CATEGORY);
versailles.setName("Cafe Versailles");
versailles.setPhone("(305) 201-5438");
versailles.setStreet("312 8th Street ");
versailles.setCity("Miami");
versailles.setState("FL");
versailles.setZip("33176");
restaurants.add(versailles);
laCaretta.setId(getNextId());
laCaretta.setType(CUBAN_CATEGORY);
laCaretta.setName("La Carretta");
laCaretta.setPhone("(305) 342-9876");
laCaretta.setStreet("348 8th Street ");
laCaretta.setCity("Miami");
laCaretta.setState("FL");
laCaretta.setZip("33176");
restaurants.add(laCaretta);
laCaretta2.setId(getNextId());
laCaretta2.setType(CUBAN_CATEGORY);
laCaretta2.setName("La Carretta");
laCaretta2.setPhone("(305) 556-9876");
laCaretta2.setStreet("31224 23rd Street ");
laCaretta2.setCity("Miami");
laCaretta2.setState("FL");
laCaretta2.setZip("33176");
restaurants.add(laCaretta2);
laCaretta3.setId(getNextId());
laCaretta3.setType(CUBAN_CATEGORY);
laCaretta3.setName("La Carretta");
laCaretta3.setPhone("(305) 682-9876");
laCaretta3.setStreet("23543 107th Street ");
laCaretta3.setCity("Miami");
laCaretta3.setState("FL");
laCaretta3.setZip("33176");
restaurants.add(laCaretta3);
ranchaLuna.setId(getNextId());
ranchaLuna.setType(CUBAN_CATEGORY);
ranchaLuna.setName("Rancha Luna");
ranchaLuna.setPhone("(305) 777-4384");
ranchaLuna.setStreet("110 23rd Street ");
ranchaLuna.setCity("Miami");
ranchaLuna.setState("FL");
ranchaLuna.setZip("33176");
restaurants.add(ranchaLuna);
leMerais.setId(getNextId());
leMerais.setType(STEAK_CATEGORY);
leMerais.setName("Le Merais");
leMerais.setPhone("(212) 654-9187");
leMerais.setStreet("11 West 46th Street");
leMerais.setCity("New York");
leMerais.setState("NY");
leMerais.setZip("10018");
restaurants.add(leMerais);
chris.setId(getNextId());
chris.setType(STEAK_CATEGORY);
chris.setName("Ruth's Chris Seakhouse");
chris.setPhone("(305) 354-8885");
chris.setStreet("12365 203rd Street ");
chris.setCity("Miami");
chris.setState("FL");
chris.setZip("33176");
restaurants.add(chris);
outback.setId(getNextId());
outback.setType(STEAK_CATEGORY);
outback.setName("Outback");
outback.setPhone("(305) 244-7623");
outback.setStreet("348 136th Street ");
outback.setCity("Miami");
outback.setState("FL");
outback.setZip("33176");
restaurants.add(outback);
outback2.setId(getNextId());
outback2.setType(STEAK_CATEGORY);
outback2.setName("Outback");
outback2.setPhone("(305) 533-6522");
outback2.setStreet("21 207th Street ");
outback2.setCity("Miami");
outback2.setState("FL");
outback2.setZip("33176");
restaurants.add(outback2);
outback3.setId(getNextId());
outback3.setType(STEAK_CATEGORY);
outback3.setName("Outback");
outback3.setPhone("(305) 244-7623");
outback3.setStreet("10117 107th Street ");
outback3.setCity("Miami");
outback3.setState("FL");
outback3.setZip("33176");
restaurants.add(outback3);
outback4.setId(getNextId());
outback4.setType(STEAK_CATEGORY);
outback4.setName("Outback");
outback4.setPhone("(954) 221-3312");
outback4.setStreet("10 11th Street ");
outback4.setCity("Aventura");
outback4.setState("FL");
outback4.setZip("32154");
restaurants.add(outback4);
}
private static int getNextId(){
id++;
return id;
}
}
| [
"mrappazzo@tradecard.com"
] | mrappazzo@tradecard.com |
0cddced39e3636ad3f41a973a8bf1c38dfddcb09 | ff3215eae3122189340e8b5677fa9d0e67acb4ea | /android/app/src/main/java/com/rowger/flutter_app/MainActivity.java | 70f35aba5cd46f33e2e43ea6bb6d91abece88b36 | [] | no_license | ruan115/Flutter_movie | d19e0771e2f55fbfbc8f609f52197178a96705b2 | f43abdfe118b6b3f1516024370b9f8dd4a701b52 | refs/heads/master | 2022-02-23T23:56:07.964765 | 2019-10-13T06:37:44 | 2019-10-13T06:37:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 367 | java | package com.rowger.flutter_app;
import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class MainActivity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}
}
| [
"php_echo@163.com"
] | php_echo@163.com |
41d86550dfbaf55f91eb915083d9c709cc3823ac | 76e7aa7b2f4f3b336faaed76e70d741c38679934 | /src/test/java/com/careerit/configurations/ConnectionUtil.java | 7023b8c76ac37eb87f7a7fe4901cba4460557a82 | [] | no_license | learnwithlakshman/json-configurations | 32b88b2e7e19d084892e8905505332635735270f | ec072aa409acbf3736dd782f4169bb01bb3f8176 | refs/heads/main | 2023-03-29T21:55:49.711982 | 2021-04-06T03:02:58 | 2021-04-06T03:02:58 | 352,502,672 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,393 | java | package com.careerit.configurations;
import java.io.FileInputStream;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
public class ConnectionUtil {
public Connection getConnection() {
Connection con = null;
try {
Properties properties = new Properties();
properties.load(new FileInputStream("src/test/resources/application.properties"));
con = DriverManager.getConnection(properties.getProperty("db.url"), properties.getProperty("db.username"),
properties.getProperty("db.password"));
} catch (IOException e) {
System.out.println("Configuration file not found :" + e);
} catch (SQLException e) {
System.out.println("While connecting with db: " + e);
}
return con;
}
public void close(ResultSet rs, Statement st, Connection con) {
try {
if (rs != null) {
rs.close();
}
if (st != null) {
st.close();
}
if (con != null) {
con.close();
}
} catch (SQLException e) {
System.out.println("While closing resources :" + e);
}
}
public void close(Statement st, Connection con) {
try {
if (st != null) {
st.close();
}
if (con != null) {
con.close();
}
} catch (SQLException e) {
System.out.println("While closing resources :" + e);
}
}
}
| [
"lakshman.miani@mail.com"
] | lakshman.miani@mail.com |
985dc6eebbe327741a3d392a344b5658f3d3fc06 | 87a388ef7a7f9733d67a889fce2980be1340fbf9 | /rest-sample/src/test/java/ru/stqa/pft/rest/tests/RestAssuredTests.java | c80ff739a73fc6414271bc008e85d712a26db6c7 | [
"Apache-2.0"
] | permissive | piersto/java_1 | 9fd7ae52be0a8ecc3ee4e2ae360bf657d2e15499 | 0559fadaca9f2f38b3dfca94187014b2e9ce792f | refs/heads/main | 2023-08-18T11:42:22.837623 | 2021-10-12T00:07:10 | 2021-10-12T00:07:10 | 333,890,798 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,911 | java | package ru.stqa.pft.rest.tests;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.google.gson.reflect.TypeToken;
import com.jayway.restassured.RestAssured;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import ru.stqa.pft.rest.model.Issue;
import java.io.IOException;
import java.util.Set;
public class RestAssuredTests {
@BeforeClass
public void init() {
RestAssured.authentication = RestAssured.basic
("288f44776e7bec4bf44fdfeb1e646490", "");
}
@Test
public void testCreateIssue() throws IOException {
Set<Issue> oldIssues = getIssues();
Issue newIssue = new Issue().withSubject("Login failed")
.withDescription("Login failed for admin");
int issueId = createIssue(newIssue);
Set<Issue> newIssues = getIssues();
oldIssues.add(newIssue.withId(issueId));
Assert.assertEquals(oldIssues, newIssues);
}
private Set<Issue> getIssues() throws IOException {
String json = RestAssured.get("https://bugify.stqa.ru/api/issues.json").asString();
JsonElement parsed = new JsonParser().parse(json);
JsonElement issues = parsed.getAsJsonObject().get("issues");
return new Gson().fromJson(issues, new TypeToken<Set<Issue>>(){}.getType());
}
private int createIssue(Issue newIssue) throws IOException {
String json = RestAssured.given()
.parameter("subject", newIssue.getSubject())
.parameter("description", newIssue.getDescription())
.post("https://bugify.stqa.ru/api/issues.json").asString();
JsonElement parsed = new JsonParser().parse(json);
return parsed.getAsJsonObject().get("issue_id").getAsInt();
}
}
| [
"44554156+piersto@users.noreply.github.com"
] | 44554156+piersto@users.noreply.github.com |
3824a6568393ddfe4b7017fb02c0b8670ac08d6b | 701e4db344595cb5c18d059f071e8c258fb89a67 | /src/main/java/uz/indicator/db/dao/Interfaces/ProductDAO.java | 0a5bf1335adcb1519c412fe19c0a81b7ad697652 | [] | no_license | UchqunBahodirovich/indicatorStore | f539d07e5379cf91d239a8ee077a026342ec591f | 7422103bd532afa8ae2024ef1bbc8d748c6340c0 | refs/heads/main | 2023-08-06T04:00:58.441110 | 2021-10-05T17:42:42 | 2021-10-05T17:42:42 | 413,919,433 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 380 | java | package uz.indicator.db.dao.Interfaces;
import uz.indicator.collections.ObjectAndMessage;
import uz.indicator.db.entities.Products;
import java.util.List;
public interface ProductDAO {
ObjectAndMessage saveProduct(Products product);
Products getById(int id);
List<Products> getAll();
String deleteById(int id);
List<Products> getByBarCode(String code);
}
| [
"noreply@github.com"
] | noreply@github.com |
287671c15982dd89bc6ad2ae2e9f304e2e15205c | 87a7c6fcf7a308b34d69276c54ebf428c0813030 | /app/src/main/java/com/example/neven/exchangeratesapp/presenters/ExchangeRatesPresenterImpl.java | 2705474b20c237c77ef83d01021dab60dc8295ad | [] | no_license | Nenco1993/ExchangeRatesApp | 9e1282e1b24bd8e8c76183ee24b73f00ca666021 | 92ff341e03d8ad710988e8d9a097ecd86803ee48 | refs/heads/master | 2020-12-03T00:02:13.229157 | 2017-07-01T17:13:23 | 2017-07-01T17:13:23 | 95,806,066 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,156 | java | package com.example.neven.exchangeratesapp.presenters;
import com.example.neven.exchangeratesapp.adapters.ChildItem;
import com.example.neven.exchangeratesapp.adapters.HeaderItem;
import com.example.neven.exchangeratesapp.adapters.Item;
import com.example.neven.exchangeratesapp.models.ExchangeRate;
import com.example.neven.exchangeratesapp.views.ExchangeRatesView;
import javax.inject.Inject;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Neven on 16.6.2017..
*/
public class ExchangeRatesPresenterImpl implements ExchangeRatesPresenter {
private final ExchangeRatesView view;
@Inject
public ExchangeRatesPresenterImpl(ExchangeRatesView view) {
this.view = view;
}
@Override
public void addDataToList(List<ExchangeRate> listRate) {
List<Item> listItems = new ArrayList<>();
listItems.add(new HeaderItem(null, null, null, null));
for (ExchangeRate singleRate : listRate) {
listItems.add(new ChildItem(singleRate.medianRate, singleRate.buyingRate, singleRate.sellingRate, singleRate.currencyCode));
}
view.showData(listItems);
}
}
| [
"nevenmagdalenic1993@gmail.com"
] | nevenmagdalenic1993@gmail.com |
20dbbd3b0e67abfa762d3c143b345a40a509abc2 | e46ba6363d7d16bc48ca5a1d86092377383f88b7 | /tools/sra_dnld_mgr/src/ngs/itf/ReferenceItf.java | 66be172dbe031ab118d81c48f561db770695743d | [
"LicenseRef-scancode-ncbi",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | This-Roxx/ngs-tools | a2a107b69018f66e1d46de2be51ff3fbfac3d5af | aa3adfb181f55ff24142914cbd68b94e5cd27b38 | refs/heads/master | 2022-01-19T20:11:52.006002 | 2019-03-18T17:02:04 | 2019-03-18T17:02:04 | 198,117,828 | 2 | 1 | null | 2019-07-22T00:10:58 | 2019-07-22T00:10:57 | null | UTF-8 | Java | false | false | 11,334 | java | /*===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for Biotechnology Information
*
* This software/database is a "United States Government Work" under the
* terms of the United States Copyright Act. It was written as part of
* the author's official duties as a United States Government employee and
* thus cannot be copyrighted. This software/database is freely available
* to the public for use. The National Library of Medicine and the U.S.
* Government have not placed any restriction on its use or reproduction.
*
* Although all reasonable efforts have been taken to ensure the accuracy
* and reliability of the software and data, the NLM and the U.S.
* Government do not and cannot warrant the performance or results that
* may be obtained by using this software or data. The NLM and the U.S.
* Government disclaim all warranties, express or implied, including
* warranties of performance, merchantability or fitness for any particular
* purpose.
*
* Please cite the author in any work or product based on this material.
*
* ===========================================================================
*
*/
package ngs.itf;
import ngs.ErrorMsg;
import ngs.Reference;
import ngs.Alignment;
import ngs.AlignmentIterator;
import ngs.PileupIterator;
/*==========================================================================
* ReferenceItf
* represents a reference sequence
*/
class ReferenceItf
extends Refcount
implements Reference
{
/***********************
* Reference Interface *
***********************/
/* getCommonName
* returns the common name of reference, e.g. "chr1"
*/
public String getCommonName ()
throws ErrorMsg
{
return this . GetCommonName ( self );
}
/* getCanonicalName
* returns the accessioned name of reference, e.g. "NC_000001.11"
*/
public String getCanonicalName ()
throws ErrorMsg
{
return this . GetCanonicalName ( self );
}
/* getIsCircular
* returns true if reference is circular
*/
public boolean getIsCircular ()
throws ErrorMsg
{
return this . GetIsCircular ( self );
}
/* getLength
* returns the length of the reference sequence
*/
public long getLength ()
throws ErrorMsg
{
return this . GetLength ( self );
}
/* getReferenceBases
* return sub-sequence bases for Reference
* "offset" is zero-based
* "size" must be >= 0
*/
public String getReferenceBases ( long offset )
throws ErrorMsg
{
return this . getReferenceBases ( offset, -1 );
}
public String getReferenceBases ( long offset, long length )
throws ErrorMsg
{
return this . GetReferenceBases ( self, offset, length );
}
/* getReferenceChunk
* return largest contiguous chunk available of
* sub-sequence bases for Reference
* "offset" is zero-based
* "size" must be >= 0
*
* NB - actual returned sequence may be shorter
* than requested. to obtain all bases available
* in chunk, use a negative "size" value
*/
public String getReferenceChunk ( long offset )
throws ErrorMsg
{
return this . getReferenceChunk ( offset, -1 );
}
public String getReferenceChunk ( long offset, long length )
throws ErrorMsg
{
return this . GetReferenceChunk ( self, offset, length );
}
/*----------------------------------------------------------------------
* ALIGNMENTS
*/
/* getAlignmentCount
*/
public long getAlignmentCount ()
throws ErrorMsg
{
return this . GetAlignmentCount ( self, Alignment . all );
}
public long getAlignmentCount ( int categories )
throws ErrorMsg
{
return this . GetAlignmentCount ( self, categories );
}
/* getAlignment
* returns an individual Alignment
* throws ErrorMsg if Alignment does not exist
* or is not part of this Reference
*/
public Alignment getAlignment ( String alignmentId )
throws ErrorMsg
{
long ref = this . GetAlignment ( self, alignmentId );
try
{
return new AlignmentItf ( ref );
}
catch ( Exception x )
{
this . release ( ref );
throw new ErrorMsg ( x . toString () );
}
}
/* AlignmentCategory
* see Alignment for categories
*/
/* getAlignments
* returns an iterator of contained alignments
*/
public AlignmentIterator getAlignments ( int categories )
throws ErrorMsg
{
long ref = this . GetAlignments ( self, categories );
try
{
return new AlignmentIteratorItf ( ref );
}
catch ( Exception x )
{
this . release ( ref );
throw new ErrorMsg ( x . toString () );
}
}
/* getAlignmentSlice
* returns an iterator across a range of Alignments
* "first" is an unsigned ordinal into set
* "categories" provides a means of filtering by AlignmentCategory
*/
public AlignmentIterator getAlignmentSlice ( long offset, long length )
throws ErrorMsg
{
return this . getAlignmentSlice ( offset, length, Alignment . all );
}
public AlignmentIterator getAlignmentSlice ( long offset, long length, int categories )
throws ErrorMsg
{
long ref = this . GetAlignmentSlice ( self, offset, length, categories );
try
{
return new AlignmentIteratorItf ( ref );
}
catch ( Exception x )
{
this . release ( ref );
throw new ErrorMsg ( x . toString () );
}
}
/* getFilteredAlignmentSlice
* returns a filtered iterator across a slice of the Reference
* behaves like "getAlignmentSlice" except that supported filters are applied to selection
* "filters" is a set of filter bits defined in Alignment
* "mappingQuality" is a cutoff to be used according to bits in "filters"
*/
public AlignmentIterator getFilteredAlignmentSlice ( long offset, long length, int categories, int filters, int mappingQuality )
throws ErrorMsg
{
long ref = this . GetFilteredAlignmentSlice ( self, offset, length, categories, filters, mappingQuality );
try
{
return new AlignmentIteratorItf ( ref );
}
catch ( Exception x )
{
this . release ( ref );
throw new ErrorMsg ( x . toString () );
}
}
/*----------------------------------------------------------------------
* PILEUP
*/
/* getPileups
* returns an iterator of contained Pileups
*/
public PileupIterator getPileups ( int categories )
throws ErrorMsg
{
long ref = this . GetPileups ( self, categories );
try
{
return new PileupIteratorItf ( ref );
}
catch ( Exception x )
{
this . release ( ref );
throw new ErrorMsg ( x . toString () );
}
}
public PileupIterator getFilteredPileups ( int categories, int filters, int mappingQuality )
throws ErrorMsg
{
long ref = this . GetFilteredPileups ( self, categories, filters, mappingQuality );
try
{
return new PileupIteratorItf ( ref );
}
catch ( Exception x )
{
this . release ( ref );
throw new ErrorMsg ( x . toString () );
}
}
/* getPileupSlice
* creates a PileupIterator on a slice (window) of reference
* "start" is the signed starting position on reference
* "length" is the unsigned number of bases in the window
* "categories" provides a means of filtering by AlignmentCategory
*/
public PileupIterator getPileupSlice ( long offset, long length )
throws ErrorMsg
{
return this . getPileupSlice ( offset, length, Alignment . all );
}
public PileupIterator getPileupSlice ( long offset, long length, int categories )
throws ErrorMsg
{
long ref = this . GetPileupSlice ( self, offset, length, categories );
try
{
return new PileupIteratorItf ( ref );
}
catch ( Exception x )
{
this . release ( ref );
throw new ErrorMsg ( x . toString () );
}
}
public PileupIterator getFilteredPileupSlice ( long offset, long length, int categories, int filters, int mappingQuality )
throws ErrorMsg
{
long ref = this . GetFilteredPileupSlice ( self, offset, length, categories, filters, mappingQuality );
try
{
return new PileupIteratorItf ( ref );
}
catch ( Exception x )
{
this . release ( ref );
throw new ErrorMsg ( x . toString () );
}
}
/*******************************
* ReferenceItf Implementation *
*******************************/
// constructors
ReferenceItf ( long ref )
{
super ( ref );
}
ReferenceItf ( Reference obj )
throws ErrorMsg
{
super ( 0 );
try
{
ReferenceItf ref = ( ReferenceItf ) obj;
this . self = ref . duplicate ();
}
catch ( Exception x )
{
throw new ErrorMsg ( x . toString () );
}
}
// native interface
private native String GetCommonName ( long self )
throws ErrorMsg;
private native String GetCanonicalName ( long self )
throws ErrorMsg;
private native boolean GetIsCircular ( long self )
throws ErrorMsg;
private native long GetLength ( long self )
throws ErrorMsg;
private native String GetReferenceBases ( long self, long offset, long length )
throws ErrorMsg;
private native String GetReferenceChunk ( long self, long offset, long length )
throws ErrorMsg;
private native long GetAlignmentCount ( long self, int categories )
throws ErrorMsg;
private native long GetAlignment ( long self, String alignmentId )
throws ErrorMsg;
private native long GetAlignments ( long self, int categories )
throws ErrorMsg;
private native long GetAlignmentSlice ( long self, long offset, long length, int categories )
throws ErrorMsg;
private native long GetFilteredAlignmentSlice ( long self, long offset, long length, int categories, int filters, int mappingQuality )
throws ErrorMsg;
private native long GetPileups ( long self, int categories )
throws ErrorMsg;
private native long GetFilteredPileups ( long self, int categories, int filters, int mappingQuality )
throws ErrorMsg;
private native long GetPileupSlice ( long self, long offset, long count, int categories )
throws ErrorMsg;
private native long GetFilteredPileupSlice ( long self, long offset, long count, int categories, int filters, int mappingQuality )
throws ErrorMsg;
}
| [
"raetzw@ncbi.nlm.nih.gov"
] | raetzw@ncbi.nlm.nih.gov |
ccfcca7a03e1bc6c7e5786cbbb645579e1d308d2 | 4c50f39f7412125204d2514693dcfb08162d656e | /src/org/prom5/analysis/ltlchecker/formulatree/AndNode.java | 9f5fe00fe2085e03dd75781bc92314b8ab421c8c | [] | no_license | alex-fedorov-012088/SMD | 7e956d92701835bbac3f584a2dea05690c201a94 | 9b2a025b9124639d8262331487ee136d56b9b93b | refs/heads/master | 2023-03-15T19:15:15.273499 | 2015-03-30T01:31:44 | 2015-03-30T01:31:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,846 | java | /***********************************************************
* This software is part of the ProM package *
* http://www.processmining.org/ *
* *
* Copyright (c) 2003-2006 TU/e Eindhoven *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by Eindhoven University of Technology *
* Department of Information Systems *
* http://is.tm.tue.nl *
* *
**********************************************************/
package org.prom5.analysis.ltlchecker.formulatree;
import java.util.LinkedList;
import org.prom5.framework.log.ProcessInstance;
/**
* AndNode is a node class of the formula tree denoting the and operator.
*
* @version 0.2
* @author HT de Beer
*/
public class AndNode extends BinaryNode {
// FIELDS
// CONSTRUCTORS
public AndNode() {
super();
}
// METHODS
/**
* Compute the value of this node, that is te value of this node given the
* i-th ate of pi, computed by calling the value method of the children.
*
* @param pi The current process instance.
* @param ate The current audit trail entry of pi.
*
* @return The value of this node computed by calling the value method of
* the children applied to the operator of this node.
*/
public boolean value(ProcessInstance pi, LinkedList ates, int ateNr) {
nr = ateNr;
boolean l = leftChild.value(pi, ates, ateNr);
boolean r = rightChild.value(pi, ates, ateNr);
return (l && r);
}
protected String getOperator() {
return "/\\";
}
}
| [
"apromore@gmail.com"
] | apromore@gmail.com |
add20d87f853aa5bfb05b3e1bb0e65015685baf0 | a2b6c7337634ea9aed8b16eb2c4f49eafdcdee55 | /src/entities/Personne.java | 56592a8f68406f700fdd70b04936fc54d908c5f2 | [] | no_license | iLaziKx/pdfgenerator | 122618de718bd4210319b3aa63842d31995917ed | a8397d54e81f5c618232b766caaae02daf760a16 | refs/heads/master | 2020-03-22T20:08:51.732737 | 2018-07-11T13:04:47 | 2018-07-11T13:04:47 | 140,576,197 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 998 | java | package entities;
import java.time.LocalDate;
public abstract class Personne {
private String nom;
private String prenom;
private LocalDate dteNaissance;
public Personne(String nom, String prenom, LocalDate dteNaissance) {
this.nom = nom;
this.prenom = prenom;
this.dteNaissance = dteNaissance;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getPrenom() {
return prenom;
}
public void setPrenom(String prenom) {
this.prenom = prenom;
}
public LocalDate getDteNaissance() {
return dteNaissance;
}
public void setDteNaissance(LocalDate dteNaissance) {
this.dteNaissance = dteNaissance;
}
@Override
public String toString() {
return this.getPrenom()+" - "+this.getNom()+"\n date de naissance : "+this.getDteNaissance();
}
}
| [
"julian.courbez@gmail.com"
] | julian.courbez@gmail.com |
670c780b4bd863332bbed1c105224349c3d1d744 | 5734d92d0a18852ace26ee540e7c205b81e86e02 | /ServerPlatform3/link/src/main/java/com/borqs/server/impl/link/linkutils/JpgZoom.java | 7a4d9fa4c76d8aade4a1a82734bb78638c7d0b42 | [] | no_license | FreeDao/wutongservice | 16c5f833763d3cbb9a4ee20d6d7593c5faafeec2 | 81d66d3cc06d362a355582d38d691f341db565da | refs/heads/master | 2020-12-30T22:09:26.037600 | 2013-09-24T08:52:00 | 2013-09-24T08:52:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,956 | java | package com.borqs.server.impl.link.linkutils;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.io.File;
public class JpgZoom {
protected String sFile = "";
protected String dFile = "";
protected int nw = -1;
protected int nh = -1;
protected int defaultNw = 80;
protected int defaultNh = 80;
public JpgZoom() {};
public JpgZoom(String _sFile, String _dFile) {
this.sFile = _sFile;
this.dFile = _dFile;
}
public JpgZoom(String _sFile, String _dFile, int _nw, int _nh) {
this(_sFile, _dFile);
this.setNw(_nw);
this.setNh(_nh);
}
public JpgZoom(String _sFile, String _dFile, int _nw, int _nh, int _defaultNw, int _defaultNh) {
this(_sFile, _dFile, _nw, _nh);
this.setDefaultNw(_defaultNw);
this.setDefaultNh(_defaultNh);
}
protected void setNw (int _nw) {
if (_nw == -1) {
this.nw = this.defaultNw;
} else {
this.nw = _nw;
}
}
protected void setNh (int _nh) {
if (_nh == -1) {
this.nh = this.defaultNh;
} else {
this.nh = _nh;
}
}
protected void setDefaultNw (int _nw) {
this.defaultNw = _nw;
}
protected void setDefaultNh (int _nh) {
this.defaultNh = _nh;
}
public void makeImg() {
try {
File fi = new File(this.sFile); //��ͼ�ļ�
File fo = new File(this.dFile); //��Ҫת������Сͼ�ļ�
AffineTransform transform = new AffineTransform();
BufferedImage bis = ImageIO.read(fi);
int w = bis.getWidth(); //ԭͼƬ�Ŀ�
int h = bis.getHeight(); //ԭͼƬ�ĸ�
double sx = (double)this.nw / w;
double sy = (double)this.nh / h;
transform.setToScale(sx, sy);
System.out.println("Old Width and Height is: " + w + " " + h);
System.out.println("New Width and Height is: " + this.nw + " " + this.nh);
System.out.println("");
// AffineTransformOp ato = new AffineTransformOp(transform, null);
// BufferedImage bid = new BufferedImage(this.nw, nh, BufferedImage.TYPE_3BYTE_BGR);
// ato.filter(bis, bid);
// ImageIO.write(bid, "jpg", fo);
//create new image
BufferedImage bid = new BufferedImage(this.nw, nh, BufferedImage.TYPE_3BYTE_BGR);
//draw the source image transformed onto the destination
Graphics2D g2 = bid.createGraphics();
g2.drawImage(bis,transform,null);
g2.dispose();
ImageIO.write(bid, "jpg", fo);
} catch(Exception e) {
e.printStackTrace();
}
}
/*public static void main(String[] args) {
String _sFile = String.valueOf(args[0]);
String _dFile = String.valueOf(args[1]);
int _nw = Integer.parseInt(args[2]);
int _nh = Integer.parseInt(args[3]);
JpgZoom test = new JpgZoom(_sFile, _dFile, _nw, _nh);
test.makeImg();
}*/
}
| [
"liuhuadong78@gmail.com"
] | liuhuadong78@gmail.com |
c90bd0a88f08813b755bb6dc115e28b472694364 | b547c97f2295722fe9ef2172ec054f3568e60b44 | /src/test/java/kr/or/connect/MysqlConnectTest.java | c59c9b606a4b5d116848591f6f673f6b3cbae3f5 | [] | no_license | A-YEYE/09box | e558ce9bb9852c4a01b552dc53f8ce6e42ca0bc8 | edfeb494caed8f29e3301f9a06919b151f8e2a4c | refs/heads/master | 2022-12-23T11:34:40.816639 | 2019-09-27T18:26:04 | 2019-09-27T18:26:04 | 199,689,755 | 0 | 0 | null | 2022-12-16T09:49:23 | 2019-07-30T16:34:30 | JavaScript | UTF-8 | Java | false | false | 675 | java | package kr.or.connect;
import java.sql.Connection;
import java.sql.DriverManager;
import org.junit.Test;
public class MysqlConnectTest {
private String driverClassName = "com.mysql.jdbc.Driver";
private static String url = "jdbc:mysql://localhost:3306/connectdb?serverTimezone=Asia/Seoul&useSSL=false";
private static String username = "connectuser";
private static String password = "connect123!@#";
@Test
public void testConnection() throws Exception{
Class.forName(driverClassName);
try (Connection con = DriverManager.getConnection(url, username, password)) {
System.out.println(con);
}catch(Exception e){
System.err.println(e);
}
}
}
| [
"jdh5333@naver.com"
] | jdh5333@naver.com |
fc7def37e406e23bf7bc78faddedfbb253056542 | fa3653559005d32d363b1f2180f5504ae3659ed6 | /src/main/java/com/luopeng/ui/client.java | 949d38fab878a24945241654a4e69b4b1ca24233 | [] | no_license | robot-coding/springBean | 86c3b16b6364c376b6f5b8b607aac6cbb41d0147 | dd0bccb02e5ae402108c018e32a76796a6b77c3c | refs/heads/master | 2020-09-03T17:48:20.623079 | 2019-11-04T15:37:09 | 2019-11-04T15:37:09 | 219,525,095 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,009 | java | package com.luopeng.ui;
//import com.luopeng.factory.BeanFactory;
import com.luopeng.service.IAccountService;
import com.luopeng.service.impl.AccountServiceImpl;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
/**
* 模拟一个表现层,用于调用业务层
*/
public class client {
/**
*
* @param args
*/
public static void main(String[] args) {
// 1、获取核心容器对象
ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml");
// 2、根据id获取Bean对象
IAccountService as = (IAccountService)ac.getBean("accountService");
as.saveAccount();
// 手动销毁容器
ac.close();
}
}
| [
"tiejia@mogu.com"
] | tiejia@mogu.com |
94c04089bd3defbbdac8c61206a1c07530a3d57e | 25780a76c482e222ef3ba01c14394c6c0872aaaf | /practice/src/main/java/ca/jrvs/practice/coding_challenges/RemoveDuplicatesFromSortedArray.java | 7c70aebef3a6964c0aed18dda3aa08550a5ed204 | [] | no_license | jarviscanada/jarvis_data_eng_YerinAn | 1cf5f44da31dec9a405851b559cce7db736a0854 | b5393fe23b9044a220af259068545403aeb62fea | refs/heads/master | 2023-06-16T18:25:10.229993 | 2021-07-07T23:17:27 | 2021-07-07T23:17:27 | 346,045,594 | 0 | 0 | null | 2021-07-07T23:17:28 | 2021-03-09T15:04:40 | Jupyter Notebook | UTF-8 | Java | false | false | 980 | java | package ca.jrvs.practice.coding_challenges;
/**
* https://www.notion.so/jarvisdev/Duplicates-from-Sorted-Array-0160a121ebc649eb9a236a95d8c29566
* Given a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new length.
* Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
*/
public class RemoveDuplicatesFromSortedArray {
/**
* Big-O: O(n) time
* O(1) space
* using two pointers which are slow and fast
* if the fast and slow value are different,
* slow's next value is changing as fast value
* at the same time slow counts the number of unique values.
*/
public static int removeDuplicates(int[] nums) {
if(nums.length == 0) return 0;
int slow = 0;
for(int fast = 1; fast < nums.length; fast ++){
if(nums[slow] != nums[fast]){
nums[++slow] = nums[fast];
}
}
return slow+1;
}
}
| [
"anyerin01@gmail.com"
] | anyerin01@gmail.com |
e6ae0ebc564e7635ea3704b7f302e7fb4c55e894 | 7a6549b79afd0c0d701ee5e14b946f5a905bc301 | /src/main/java/com/lian/joole/Services/UserService.java | b0382119086385ae685e7622a9666126744e3bcd | [] | no_license | whoisryan11/joole | cb72434e52c81a0dfd72b02f672c98291ec86538 | 8c6e3afaeea359c9d0e19eed14a2b306ab37b728 | refs/heads/main | 2023-01-04T23:36:48.163140 | 2020-11-03T02:37:45 | 2020-11-03T02:37:45 | 307,390,584 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 237 | java | package com.lian.joole.Services;
import com.lian.joole.Entity.User;
import org.springframework.stereotype.Service;
public interface UserService {
User createUser(String username, String password, String email) throws Exception;
}
| [
"44442503+zerolzhy@users.noreply.github.com"
] | 44442503+zerolzhy@users.noreply.github.com |
675775fb19a93eada75560fed8696c17568cb460 | c1bd0814a7745d258f88aa703a91a5cd69d8fe82 | /car-park/src/main/java/pl/soa/parkometer/carpark_mock/soap_client/SOAPClient.java | b1e442395fdf5aaab80a5d96846c07d849f3ff18 | [] | no_license | JakubZol/SOA-Parkometer | 8b344164d860e3362adf849c3917331ba9850624 | 4bfaf65a480829f5fa80e58abebb338d8fe66258 | refs/heads/master | 2023-05-01T16:20:46.738755 | 2019-06-24T13:23:26 | 2019-06-24T13:23:26 | 190,539,650 | 0 | 0 | null | 2023-04-14T17:48:49 | 2019-06-06T07:56:06 | Java | UTF-8 | Java | false | false | 981 | java | package pl.soa.parkometer.carpark_mock.soap_client;
import pl.soa.parkometer.carpark_mock.soap_client.wsdl.Spot;
import pl.soa.parkometer.carpark_mock.soap_client.wsdl.SpotsSOAPService;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
public class SOAPClient {
private SpotsSOAPService spotsSOAPService;
public SOAPClient(String serviceUrl){
try {
URL url = new URL(serviceUrl);
spotsSOAPService = new SpotsSOAPService(url);
}
catch (MalformedURLException e){
System.out.println(e.getMessage());
}
}
public List<Spot> getFreeSpots(){
return spotsSOAPService.getSpotService().getFreeSpots().getItem();
}
public void updateSpot(Spot spot){
spotsSOAPService.getSpotService().updateSpot(spot);
}
public List<Spot> getOccupiedSpots(){
return spotsSOAPService.getSpotService().getAllOccupiedSpots().getItem();
}
}
| [
"jakubzol@student.agh.edu.pl"
] | jakubzol@student.agh.edu.pl |
72cc923c15ad0404ef4fef811b5e99083399bb1f | e41fa9ddec6328cc9b2cc7a20b35968f13f81d8d | /01)EvenorOdd.java | 7d414b83a710a0fcd456578e562cdc92a78f8f58 | [] | no_license | souj1902/JAD_PROG | b419039d2aa897a3886856bb56f784e9ea660f82 | 8587750e6e9ab5392ea4be156c786845fca437cd | refs/heads/master | 2020-03-27T04:44:15.476631 | 2018-10-05T10:16:40 | 2018-10-05T10:16:40 | 145,964,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 555 | java | import java.util.Scanner;
public class EvenorOdd
{
public static void main(String[] args)
{
int n;
Scanner s = new Scanner(System.in);
System.out.print("Enter the number you want to check:");
n = s.nextInt();
if(n % 2 == 0)
{
System.out.println("The given number "+n+" is Even ");
}
else
{
System.out.println("The given number "+n+" is Odd ");
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
8c631780b93474121a40d9b4c56bf701b01531c9 | 99c03face59ec13af5da080568d793e8aad8af81 | /hom_classifier/2om_classifier/scratch/ROR6AOIS68/Pawn.java | d8d7241f247987b7bc2bdb5a31554872f2f18bb4 | [] | no_license | fouticus/HOMClassifier | 62e5628e4179e83e5df6ef350a907dbf69f85d4b | 13b9b432e98acd32ae962cbc45d2f28be9711a68 | refs/heads/master | 2021-01-23T11:33:48.114621 | 2020-05-13T18:46:44 | 2020-05-13T18:46:44 | 93,126,040 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,759 | java | // This is a mutant program.
// Author : ysma
import java.util.ArrayList;
public class Pawn extends ChessPiece
{
public Pawn( ChessBoard board, ChessPiece.Color color )
{
super( board, color );
}
public java.lang.String toString()
{
if (color == ChessPiece.Color.WHITE) {
return "♙";
} else {
return "♟";
}
}
public java.util.ArrayList<String> legalMoves()
{
java.util.ArrayList<String> returnList = new java.util.ArrayList<String>();
if (this.getColor().equals( ChessPiece.Color.WHITE )) {
int currentCol = this.getColumn();
int nextRow = this.getRow() + 1;
if (nextRow != 7) {
if (board.getPiece( onePossibleMove( nextRow, currentCol ) ) == null) {
returnList.add( onePossibleMove( nextRow, currentCol ) );
}
}
if (this.getRow() == 1) {
int nextNextRow = this.getRow() + 2;
if (board.getPiece( onePossibleMove( nextRow, currentCol ) ) == null && board.getPiece( onePossibleMove( nextNextRow, currentCol ) ) == null) {
returnList.add( onePossibleMove( nextNextRow, currentCol ) );
}
}
int leftColumn = currentCol - 1;
int rightColumn = currentCol + 1;
if (leftColumn >= 0) {
if (board.getPiece( onePossibleMove( nextRow, leftColumn ) ) != null) {
if (!board.getPiece( onePossibleMove( nextRow, leftColumn ) ).getColor().equals( this.getColor() )) {
returnList.add( onePossibleMove( nextRow, leftColumn ) );
}
}
}
if (rightColumn <= 7) {
if (board.getPiece( onePossibleMove( nextRow--, rightColumn ) ) != null) {
if (!board.getPiece( onePossibleMove( nextRow, rightColumn ) ).getColor().equals( this.getColor() )) {
returnList.add( onePossibleMove( nextRow, rightColumn ) );
}
}
}
} else {
int currentCol = this.getColumn();
int nextRow = this.getRow() - 1;
if (nextRow >= 0) {
if (board.getPiece( onePossibleMove( nextRow, currentCol ) ) == null) {
returnList.add( onePossibleMove( nextRow, currentCol ) );
}
}
if (this.getRow() == 6) {
int nextNextRow = this.getRow() - 2;
if (board.getPiece( onePossibleMove( nextRow, currentCol ) ) == null && board.getPiece( onePossibleMove( nextNextRow, currentCol ) ) == null) {
returnList.add( onePossibleMove( nextNextRow, currentCol ) );
}
}
int leftColumn = currentCol - 1;
int rightColumn = currentCol + 1;
if (leftColumn >= 0) {
if (board.getPiece( onePossibleMove( nextRow, leftColumn ) ) != null) {
if (!board.getPiece( onePossibleMove( nextRow, leftColumn ) ).getColor().equals( this.getColor() )) {
returnList.add( onePossibleMove( nextRow, leftColumn ) );
}
}
}
if (rightColumn <= 7) {
if (board.getPiece( onePossibleMove( nextRow, rightColumn ) ) != null) {
if (!board.getPiece( onePossibleMove( nextRow, rightColumn ) ).getColor().equals( this.getColor() )) {
returnList.add( onePossibleMove( nextRow, rightColumn ) );
}
}
}
}
return returnList;
}
} | [
"fout.alex@gmail.com"
] | fout.alex@gmail.com |
c935b28959de5aa93717f4ad842485ec2fc3c5c6 | 3173887caf5893ea89639117a11de35d7a91ec9d | /org.jrebirth/fxform/src/main/java/org/jrebirth/fxform/AbstractFormModel.java | 579f8423bc3e61a22359a40d4b08dd5083c94468 | [
"Apache-2.0"
] | permissive | amischler/JRebirth | 875116eba814fcad772ef9b5c1840ed706b29093 | cf22e3eb042015cace84cb5ada35e40361aefef6 | refs/heads/master | 2020-12-25T04:19:50.250090 | 2013-09-26T14:04:36 | 2013-09-26T14:04:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,035 | java | package org.jrebirth.fxform;
import org.jrebirth.core.exception.CoreException;
import org.jrebirth.core.exception.CoreRuntimeException;
import org.jrebirth.core.ui.object.DefaultObjectModel;
import org.jrebirth.core.util.ClassUtility;
/**
* User: Antoine Mischler <antoine@dooapp.com>
* Date: 13/08/13
* Time: 11:17
*/
public class AbstractFormModel<T> extends DefaultObjectModel<AbstractFormModel<T>, AbstractFormView<T>, T> {
@Override
protected void buildView() {
this.view = new AbstractFormView<>(this);
}
@Override
protected void buildObject() {
// Build the current view by reflection
try {
this.object = (T) ClassUtility.buildGenericType(this.getClass(), 0);
} catch (final CoreException e) {
throw new CoreRuntimeException("Failure while building the bindable object for model " + getClass(), e);
}
}
@Override
protected void bind() {
super.bind();
getView().getRootNode().setSource(getObject());
}
}
| [
"antoine@dooapp.com"
] | antoine@dooapp.com |
e2504a14034d1c995a9da3ee05dbea3c9627b12f | 421f0a75a6b62c5af62f89595be61f406328113b | /generated_tests/model_seeding/84_ifx-framework-org.sourceforge.ifx.framework.pain004.simpletype.SmallNetworkIdentifier-0.5-9/org/sourceforge/ifx/framework/pain004/simpletype/SmallNetworkIdentifier_ESTest.java | acb7805c7da39b76ecdbfb85a69e9e3e5a94b570 | [] | no_license | tigerqiu712/evosuite-model-seeding-empirical-evaluation | c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6 | 11a920b8213d9855082d3946233731c843baf7bc | refs/heads/master | 2020-12-23T21:04:12.152289 | 2019-10-30T08:02:29 | 2019-10-30T08:02:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 698 | java | /*
* This file was automatically generated by EvoSuite
* Tue Oct 29 17:37:41 GMT 2019
*/
package org.sourceforge.ifx.framework.pain004.simpletype;
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(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true)
public class SmallNetworkIdentifier_ESTest extends SmallNetworkIdentifier_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pderakhshanfar@bsr01.win.tue.nl"
] | pderakhshanfar@bsr01.win.tue.nl |
edb0f031cef1a45c49c2254a5272e91b8a98cb94 | a694bd389001a8e951249e7097c727626d3a9464 | /advancedqueries/Countries/src/main/java/com/shahan/countries/repositories/CountryRepository.java | 316334e045a56b6ee40f83c76c3e8788cfcf9fd0 | [] | no_license | ShahanKrakirian/Java | 3eafa2b5772c4f4bfd2374de5891979187675870 | 5551d6f9511b0b87c699c0ff4e6cfbc727c9be13 | refs/heads/master | 2020-03-19T06:54:11.005810 | 2018-06-21T02:25:34 | 2018-06-21T02:25:34 | 136,065,245 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,833 | java | package com.shahan.countries.repositories;
import java.util.List;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import com.shahan.countries.models.Country;
public interface CountryRepository extends CrudRepository<Country, Long>{
@Query(value="SELECT c.name, l.language, l.percentage FROM Country c JOIN c.languages l WHERE l.language = 'Slovene' ORDER BY l.language desc")
List<Object[]> findAllSloveneCountries();
@Query(value="SELECT c.name, count(city.id) FROM Country c JOIN c.cities city GROUP BY c.name ORDER BY count(city.id) desc")
List<Object[]> citiesPerCountry();
@Query(value="SELECT city.name, city.population FROM Country c JOIN c.cities city WHERE c.name = 'Mexico' ORDER BY city.population desc")
List<Object[]> citiesInMexico();
@Query(value="SELECT c.name, lang.language, lang.percentage FROM Country c JOIN c.languages lang WHERE lang.percentage > 89 ORDER BY lang.percentage desc")
List<Object[]> languagesByPercentage();
@Query(value="SELECT c.name, c.surface_area, c.population FROM Country c WHERE c.surface_area < 501 AND c.population > 100000")
List<Object[]> sizeAndPopulation();
@Query(value="SELECT c.name, c.government_form, c.surface_area, c.life_expectancy FROM Country c WHERE c.government_form = 'Constitutional Monarchy' AND c.surface_area > 200 AND c.life_expectancy > 75")
List<Object[]> constMonarchy();
@Query(value="SELECT c.name, city.district, city.name, city.population FROM Country c JOIN c.cities city WHERE c.name = 'Argentina' AND city.district = 'Buenos Aires' AND city.population > 500000")
List<Object[]> buenosAiresDistrict();
@Query(value="SELECT c.region, count(c.name) FROM Country c GROUP BY c.region ORDER BY count(c.name) desc")
List<Object[]> countryCountPerRegion();
}
| [
"shahankrakirian@gmail.com"
] | shahankrakirian@gmail.com |
9b29f1c857102f650f875323a286214822dea5c7 | 0ac05e3da06d78292fdfb64141ead86ff6ca038f | /OSWE/oswe/openCRX/rtjar/rt.jar.src/com/sun/xml/internal/messaging/saaj/soap/ContextClassloaderLocal.java | baa7b028b915d104f3a1a0c841f829872e4a3277 | [] | no_license | qoo7972365/timmy | 31581cdcbb8858ac19a8bb7b773441a68b6c390a | 2fc8baba4f53d38dfe9c2b3afd89dcf87cbef578 | refs/heads/master | 2023-07-26T12:26:35.266587 | 2023-07-17T12:35:19 | 2023-07-17T12:35:19 | 353,889,195 | 7 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,730 | java | /* */ package com.sun.xml.internal.messaging.saaj.soap;
/* */
/* */ import java.security.AccessController;
/* */ import java.security.PrivilegedAction;
/* */ import java.text.MessageFormat;
/* */ import java.util.ResourceBundle;
/* */ import java.util.WeakHashMap;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ abstract class ContextClassloaderLocal<V>
/* */ {
/* */ private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE";
/* 41 */ private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<>();
/* */
/* */ public V get() throws Error {
/* 44 */ ClassLoader tccl = getContextClassLoader();
/* 45 */ V instance = this.CACHE.get(tccl);
/* 46 */ if (instance == null) {
/* 47 */ instance = createNewInstance();
/* 48 */ this.CACHE.put(tccl, instance);
/* */ }
/* 50 */ return instance;
/* */ }
/* */
/* */ public void set(V instance) {
/* 54 */ this.CACHE.put(getContextClassLoader(), instance);
/* */ }
/* */
/* */ protected abstract V initialValue() throws Exception;
/* */
/* */ private V createNewInstance() {
/* */ try {
/* 61 */ return initialValue();
/* 62 */ } catch (Exception e) {
/* 63 */ throw new Error(format("FAILED_TO_CREATE_NEW_INSTANCE", new Object[] { getClass().getName() }), e);
/* */ }
/* */ }
/* */
/* */ private static String format(String property, Object... args) {
/* 68 */ String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property);
/* 69 */ return MessageFormat.format(text, args);
/* */ }
/* */
/* */ private static ClassLoader getContextClassLoader() {
/* 73 */ return
/* 74 */ AccessController.<ClassLoader>doPrivileged(new PrivilegedAction<ClassLoader>() {
/* */ public Object run() {
/* 76 */ ClassLoader cl = null;
/* */ try {
/* 78 */ cl = Thread.currentThread().getContextClassLoader();
/* 79 */ } catch (SecurityException securityException) {}
/* */
/* 81 */ return cl;
/* */ }
/* */ });
/* */ }
/* */ }
/* Location: /Users/timmy/timmy/OSWE/oswe/openCRX/rt.jar!/com/sun/xml/internal/messaging/saaj/soap/ContextClassloaderLocal.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/ | [
"t0984456716"
] | t0984456716 |
ee8631fa0f63cbecb9073db3c93d6c97e1509096 | 76ae8b84155bf1ac2acb1eca9aebc6d27240a352 | /toolbox-core/src/main/java/com/codigo/aplios/toolbox/core/math/PrimeNumberChecker.java | 04bfea100024c52acbfc420d470955ef05a0b0a9 | [] | no_license | andyradz/toolbox | 6192fecdb0358a4f960ed3d41ca85b13070e20ff | d26d170e3bc31d5c5a5697c648082af94e36af67 | refs/heads/master | 2019-07-10T05:17:00.848907 | 2017-11-15T21:44:22 | 2017-11-15T21:45:27 | 91,020,863 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 633 | java | package com.codigo.aplios.toolbox.core.math;
/**
* Klasa realizuej sprawdzenie czy dana liczba jest liczbą pierwszą
*
* @author andrzej.radziszewski
*/
public final class PrimeNumberChecker {
/**
* @param primeNumber Wartość numeryczna do weryfikacji czy jest liczbą pierwszą
* @return Wartość logiczna <b>TRUE</b> gdy liczba jest liczbą pierwszą, <b>FALSE</b> - gdy liczba nie jest liczbą
* pierwszą
*/
public Boolean validate(final Integer primeNumber) {
for (int i = 2; i < (primeNumber / 2); i++)
if ((primeNumber % i) == 0)
return false;
return true;
}
}
| [
"and.radz@wp.pl"
] | and.radz@wp.pl |
d6133578fdbdc80680a27a6c8687534aec99f14a | 3439bb663372d3c628c7299b209ef2b3090e7fda | /housing_association/src/main/java/com/jee/spring_labs/user/dao/UserRepository.java | 49c651ad8ae0cc532d8e38bd2cde361ad722310e | [] | no_license | MateuszOgrodniczak/JavaEE | a680a4923c5142ddacad99b12e3c57d8985b601a | c2f14689d4f453638c80bc3ecf5a4e335e2184ed | refs/heads/master | 2022-12-24T12:13:22.769482 | 2020-10-06T14:11:17 | 2020-10-06T14:11:17 | 301,746,273 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,442 | java | package com.jee.spring_labs.user.dao;
import com.jee.spring_labs.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import javax.transaction.Transactional;
import java.util.List;
@Transactional
@Repository
public interface UserRepository extends JpaRepository<User, Long> {
User findUserByUsername(String username);
User findUserByUsernameAndRemovedIsFalse(String username);
User findUserById(long id);
User findUserByEmail(String email);
@Query("SELECT u FROM User u WHERE u.removed = :removed")
List<User> filterUsersByRemoved(@Param("removed") boolean removed);
@Query("SELECT u FROM User u WHERE u.username LIKE :username%")
List<User> filterUsersByUsername(@Param("username") String username);
@Query("SELECT u FROM User u WHERE u.username LIKE :username% AND u.removed = :removed")
List<User> filterUsersByUsernameAndRemoved(@Param("username") String username, @Param("removed") boolean removed);
@Query("SELECT u.username FROM User u WHERE u.username <> :adminUsername")
List<String> getUsernames(@Param("adminUsername") String adminUsername);
@Query("SELECT u FROM User u WHERE u.username IN :usernames")
List<User> getUsersByUsernames(@Param("usernames") List<String> usernames);
}
| [
"mateusz.ogrodniczak96@gmail.com"
] | mateusz.ogrodniczak96@gmail.com |
edcbd5df4e50435f44956713c3e768b22fd72a5f | bac7e90c24995b5b35f48e47826e52a3a2e1e627 | /113_Path_Sum_II_Recursion/main.java | ef17e6e93de7289c919cecbcec2d61aac7af19c7 | [] | no_license | WeiChienHsu/Java_Practice | 3a4d195744596aa9ad08120ee52c72b63fe39c29 | 6403a6d3799447db7f043d97b7eaa9acfc125fd6 | refs/heads/master | 2021-07-21T07:06:08.302888 | 2018-11-17T05:10:44 | 2018-11-17T05:10:44 | 114,281,944 | 2 | 5 | null | null | null | null | UTF-8 | Java | false | false | 1,173 | java | /**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/
class Solution {
public List<List<Integer>> pathSum(TreeNode root, int sum) {
List<List<Integer>> res = new ArrayList<List<Integer>>();
List<Integer> list = new ArrayList<Integer>(); //Record Each result in the leaf
if(root == null) {
return res;
}
helper(root, sum, list, res);
return res;
}
private void helper(TreeNode root, int sum, List<Integer> list, List<List<Integer>> res) {
if (root == null) return;
// Add the number we go through
list.add(root.val);
if( sum == root.val && root.right == null && root.left == null ) {
res.add(new ArrayList<Integer>(list));
} else {
helper(root.left, sum - root.val, list, res);
helper(root.right, sum - root.val, list, res);
}
// Remove the node value from list since we'll back to last level
list.remove(list.size() - 1);
}
} | [
"weichien711@gmail.com"
] | weichien711@gmail.com |
131e85922ee8d73fe9fc94341b67630df6ce8c34 | d28e6cacbdb7f164f04675efac2d5cf137055fdc | /app/src/main/java/com/example/mdp/BluetoothMain.java | 437f147f776cd84eb5265002ee8ab39c8f2ca4b7 | [] | no_license | randynyl/MDP-Android | f7dec734700b374c01c5c1b89c6d0d212d56825e | 81e94caeec4c7154ebb7e318635b9ddfdeb01d35 | refs/heads/master | 2022-12-04T20:03:25.558929 | 2020-08-26T06:34:48 | 2020-08-26T06:34:48 | 288,640,473 | 0 | 0 | null | 2020-08-25T19:24:14 | 2020-08-19T05:19:53 | Java | UTF-8 | Java | false | false | 25,785 | java | package com.example.mdp;
import android.Manifest;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadset;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Set;
import java.util.UUID;
public class BluetoothMain extends AppCompatActivity {
private static final String TAG = "BluetoothMain";
public ArrayList<BluetoothDevice> BTDeviceList = new ArrayList<>();
public ArrayList<BluetoothDevice> BTPairedDeviceList = new ArrayList<>();
public DeviceListAdapter DeviceListAdapter;
public DeviceListAdapter PairedDeviceListAdapter;
//Bounded Device
static BluetoothDevice myBTDevice;
BluetoothDevice myBTConnectionDevice;
BluetoothAdapter myBluetoothAdapter;
//ListView, Button, TextView
ListView ListDevices;
ListView ListPairedDevices;
Button sendBtn;
Button searchBtn;
Button connectBtn;
TextView receiveMsgView;
TextView BTDevice;
TextView pairedDevice;
EditText sendMsg;
ProgressDialog myProgressDialog;
StringBuilder receiveMsg;
Intent connectIntent;
//UUID
private static final UUID myUUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
public static BluetoothDevice getBluetoothDevice(){
return myBTDevice;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.actvity_bluetoothmain);
connectBtn = (Button) findViewById(R.id.connectBtn);
searchBtn = (Button) findViewById(R.id.searchBtn);
sendBtn = (Button) findViewById(R.id.sendBtn);
ListDevices = (ListView) findViewById(R.id.listDevice);
ListPairedDevices = (ListView) findViewById(R.id.listPairedDevice);;
receiveMsgView = (TextView) findViewById(R.id.receiveMsg);
BTDevice = (TextView) findViewById(R.id.BTDevice);
pairedDevice = (TextView) findViewById(R.id.pairedDevice);
sendMsg = (EditText) findViewById(R.id.sendMsg);
receiveMsg = new StringBuilder();
myBTDevice = null;
//REGISTER BROADCAST RECEIVER FOR INCOMING MSG
LocalBroadcastManager.getInstance(this).registerReceiver(btConnectionReceiver, new IntentFilter("btConnectionStatus"));
LocalBroadcastManager.getInstance(this).registerReceiver(myReceiver, new IntentFilter("receiveMsg"));
//REGISTER BROADCAST WHEN BOND STATE CHANGES (E.G PAIRING)
IntentFilter bondFilter = new IntentFilter(BluetoothDevice.ACTION_BOND_STATE_CHANGED);
registerReceiver(bondingBroadcastReceiver, bondFilter);
//REGISTER DISCOVERABILITY BROADCAST RECEIVER
IntentFilter intentFilter = new IntentFilter(myBluetoothAdapter.ACTION_SCAN_MODE_CHANGED);
registerReceiver(discoverabilityBroadcastReceiver, intentFilter);
//REGISTER ENABLE/DISABLE BT BROADCAST RECEIVER
IntentFilter BTIntent = new IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED);
registerReceiver(enableBTBroadcastReceiver, BTIntent);
//REGISTER DISCOVERED DEVICE BROADCAST RECEIVER
IntentFilter discoverDevicesIntent = new IntentFilter(BluetoothDevice.ACTION_FOUND);
registerReceiver(discoveryBroadcastReceiver, discoverDevicesIntent);
//REGISTER START DISCOVERING BROADCAST RECEIVER
IntentFilter discoverStartedIntent = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_STARTED);
registerReceiver(discoveryStartedBroadcastReceiver, discoverStartedIntent);
//REGISTER END DISCOVERING BROADCAST RECEIVER
IntentFilter discoverEndedIntent = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);
registerReceiver(discoveryEndedBroadcastReceiver, discoverEndedIntent);
BTDeviceList = new ArrayList<>();
BTPairedDeviceList = new ArrayList<>();
myBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
//ONCLICK LISTENER FOR PAIRED DEVICE LIST
ListPairedDevices.setOnItemClickListener(
new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
//CANCEL DEVICE SEARCH DISCOVERY
myBluetoothAdapter.cancelDiscovery();
myBTDevice = BTPairedDeviceList.get(i);
ListDevices.setAdapter(DeviceListAdapter);
Log.d(TAG, "onItemClick: Paired Device = " + BTPairedDeviceList.get(i).getName());
Log.d(TAG, "onItemClick: DeviceAddress = " + BTPairedDeviceList.get(i).getAddress());
}
}
);
//ONCLICK LISTENER FOR SEARCH DEVICE LIST
ListDevices.setOnItemClickListener(
new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
//CANCEL DEVICE SEARCH DISCOVERY
myBluetoothAdapter.cancelDiscovery();
Log.d(TAG, "onItemClick: Item Selected");
String deviceName = BTDeviceList.get(i).getName();
String deviceAddress = BTDeviceList.get(i).getAddress();
ListPairedDevices.setAdapter(PairedDeviceListAdapter);
Log.d(TAG, "onItemClick: DeviceName = " + deviceName);
Log.d(TAG, "onItemClick: DeviceAddress = " + deviceAddress);
//CREATE BOND if > JELLY BEAN
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR2) {
Log.d(TAG, "Trying to pair with: " + deviceName);
//CREATE BOUND WITH SELECTED DEVICE
BTDeviceList.get(i).createBond();
//ASSIGN SELECTED DEVICE INFO TO myBTDevice
myBTDevice = BTDeviceList.get(i);
}
}
}
);
//SEARCH BUTTON
searchBtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Log.d(TAG, "onClick: search button");
enableBT();
BTDeviceList.clear();
}
});
//CONNECT BUTTON
connectBtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
if (myBTDevice == null) {
Toast.makeText(BluetoothMain.this, "There is no Paired Device! Please Search/Select a Device.",
Toast.LENGTH_LONG).show();
} else if(myBluetoothAdapter.getProfileConnectionState(BluetoothHeadset.HEADSET) == BluetoothHeadset.STATE_CONNECTED){
Toast.makeText(BluetoothMain.this, "Bluetooth has been connected",
Toast.LENGTH_LONG).show();
}
else{
Log.d(TAG, "onClick: connect button");
startBTConnection(myBTDevice, myUUID);
}
ListPairedDevices.setAdapter(PairedDeviceListAdapter);
}
});
//END BUTTON
sendBtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
byte[] bytes = sendMsg.getText().toString().getBytes(Charset.defaultCharset());
BluetoothChat.writeMsg(bytes);
sendMsg.setText("");
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu1, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.home:
Intent intent = new Intent(BluetoothMain.this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);
}
switch (item.getItemId()) {
case R.id.reconfigure:
Intent intent = new Intent(BluetoothMain.this, ReconfigBottomFragment.class);
//intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);
}
return super.onOptionsItemSelected(item);
}
@Override
public void onBackPressed() {
Intent intent = new Intent(BluetoothMain.this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);
}
//BROADCAST RECEIVER FOR BLUETOOTH CONNECTION STATUS
BroadcastReceiver btConnectionReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Log.d(TAG, "Receiving connection status");
String connectionStatus = intent.getStringExtra("ConnectionStatus");
myBTConnectionDevice = intent.getParcelableExtra("Device");
//DISCONNECTED FROM BLUETOOTH CHAT
if(connectionStatus.equals("disconnect")){
Log.d("BluetoothMain:","Device Disconnected");
if(connectIntent != null) {
//Stop Bluetooth Connection Service
stopService(connectIntent);
}
//RECONNECT DIALOG MSG
AlertDialog alertDialog = new AlertDialog.Builder(BluetoothMain.this).create();
alertDialog.setTitle("BLUETOOTH DISCONNECTED");
alertDialog.setMessage("Connection with device: '"+myBTConnectionDevice.getName()+"' has ended. Do you wish to reconnect?");
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, "Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
startBTConnection(myBTConnectionDevice, myUUID);
}
});
alertDialog.setButton(AlertDialog.BUTTON_NEGATIVE, "No",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
alertDialog.show();
}
//SUCCESSFULLY CONNECTED TO BLUETOOTH DEVICE
else if(connectionStatus.equals("connect")){
Log.d("BluetoothMain:","Device Connected");
Toast.makeText(BluetoothMain.this, "Connection Established: "+ myBTConnectionDevice.getName(),
Toast.LENGTH_LONG).show();
}
//BLUETOOTH CONNECTION FAILED
else if(connectionStatus.equals("connectionFail")) {
Toast.makeText(BluetoothMain.this, "Connection Failed: "+ myBTConnectionDevice.getName(),
Toast.LENGTH_LONG).show();
}
}
};
// Create a BroadcastReceiver for ACTION_FOUND to turn on the bluetooth
private final BroadcastReceiver enableBTBroadcastReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(myBluetoothAdapter.ACTION_STATE_CHANGED)) {
final int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, myBluetoothAdapter.ERROR);
switch (state) {
//BLUETOOTH TURNED OFF STATE
case BluetoothAdapter.STATE_OFF:
Log.d(TAG, "OnReceiver: STATE OFF");
break;
//BLUETOOTH TURNING OFF STATE
case BluetoothAdapter.STATE_TURNING_OFF:
Log.d(TAG, "OnReceiver: STATE TURNING OFF");
break;
//BLUETOOTH TURNED ON STATE
case BluetoothAdapter.STATE_ON:
Log.d(TAG, "OnReceiver: STATE ON");
//TURN DISCOVERABILITY ON
discoverabilityON();
break;
//BLUETOOTH TURNING ON STATE
case BluetoothAdapter.STATE_TURNING_ON:
Log.d(TAG, "OnReceiver: STATE TURNING ON");
break;
}
}
}
};
// Create a BroadcastReceiver for ACTION_FOUND to turn on the discovery for bluetooth
private final BroadcastReceiver discoverabilityBroadcastReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if (action.equals(BluetoothAdapter.ACTION_SCAN_MODE_CHANGED)) {
int mode = intent.getIntExtra(BluetoothAdapter.EXTRA_SCAN_MODE, BluetoothAdapter.ERROR);
switch (mode) {
//DEVICE IS IN DISCOVERABLE MODE
case BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE:
Log.d(TAG, "OnReceiver: DISCOVERABILITY ENABLED");
//DISCOVER OTHER DEVICES
startSearch();
//START BLUETOOTH CONNECTION SERVICE WHICH WILL START THE ACCEPT THREAD TO LISTEN FOR CONNECTION
connectIntent = new Intent(BluetoothMain.this, BluetoothConnectionService.class);
connectIntent.putExtra("serviceType", "listen");
startService(connectIntent);
//CHECK PAIRED DEVICE LIST
checkPairedDevice();
break;
//WHEN DEVICE IS NOT IN DISCOVERABLE MODE
case BluetoothAdapter.SCAN_MODE_CONNECTABLE:
Log.d(TAG, "OnReceiver: DISCOVERABILITY DISABLED, ABLE TO RECEIVE CONNECTION");
break;
//BLUETOOTH TURNING ON STATE
case BluetoothAdapter.SCAN_MODE_NONE:
Log.d(TAG, "OnReceiver: DISCOVERABILITY DISABLED, NOT ABLE TO RECEIVE CONNECTION");
break;
//BLUETOOTH TURNED ON STATE
case BluetoothAdapter.STATE_CONNECTING:
Log.d(TAG, "OnReceiver: CONNECTING");
break;
//BLUETOOTH TURNED ON STATE
case BluetoothAdapter.STATE_CONNECTED:
Log.d(TAG, "OnReceiver: CONNECTED");
break;
}
}
}
};
// Create a BroadcastReceiver for ACTION_FOUND Getting Discovered Devices Info
private final BroadcastReceiver discoveryBroadcastReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
Log.d(TAG, "SEARCH ME!");
if (action.equals(BluetoothDevice.ACTION_FOUND)) {
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
BTDeviceList.add(device);
Log.d(TAG, "OnReceive: " + device.getName() + ": " + device.getAddress());
DeviceListAdapter = new DeviceListAdapter(context, R.layout.device_adapter_view, BTDeviceList);
ListDevices.setAdapter(DeviceListAdapter);
}
}
};
// Create a BroadcastReceiver for ACTION_FOUND for paring device
private final BroadcastReceiver bondingBroadcastReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if (action.equals(BluetoothDevice.ACTION_BOND_STATE_CHANGED)) {
//FOR BONDING DEVICE
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
//IF ITS ALREADY BOUNDED
if (device.getBondState() == BluetoothDevice.BOND_BONDED) {
Log.d(TAG, "BoundReceiver: Bond Bonded with: " + device.getName());
myProgressDialog.dismiss();
Toast.makeText(BluetoothMain.this, "Bound Successfully With: " + device.getName(), Toast.LENGTH_LONG).show();
myBTDevice = device;
checkPairedDevice();
ListDevices.setAdapter(DeviceListAdapter);
}
//BONDING WITH ANOTHER DEVICES
if (device.getBondState() == BluetoothDevice.BOND_BONDING) {
Log.d(TAG, "BoundReceiver: Bonding With Another Device");
myProgressDialog = ProgressDialog.show(BluetoothMain.this, "Bonding With Device", "Please Wait...", true);
}
//TO BREAK A BOND
if (device.getBondState() == BluetoothDevice.BOND_NONE) {
Log.d(TAG, "BoundReceiver: Breaking Bond");
myProgressDialog.dismiss();
//DIALOG MSG POPUP
AlertDialog alertDialog = new AlertDialog.Builder(BluetoothMain.this).create();
alertDialog.setTitle("Bonding Status");
alertDialog.setMessage("Bond Disconnected!");
alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
alertDialog.show();
myBTDevice = null;
}
}
}
};
// Create a BroadcastReceiver for ACTION_DISCOVERY_STARTED
private final BroadcastReceiver discoveryStartedBroadcastReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if (action.equals(BluetoothAdapter.ACTION_DISCOVERY_STARTED)) {
Log.d(TAG, "STARTED DISCOVERY!!!");
BTDevice.setText("Searching for device ");
}
}
};
// Create a BroadcastReceiver for ACTION_DISCOVERY_FINISHED, ending the process
private final BroadcastReceiver discoveryEndedBroadcastReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if (action.equals(BluetoothAdapter.ACTION_DISCOVERY_FINISHED)) {
Log.d(TAG, "DISCOVERY ENDED!!!");
BTDevice.setText("Device found");
}
}
};
//BROADCAST RECEIVER FOR INCOMING MESSAGE
BroadcastReceiver myReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Log.d(TAG, "Receiving Msg!!!");
String msg = intent.getStringExtra("receivingMsg");
receiveMsg.append(msg + "\n");
receiveMsgView.setText(receiveMsg);
}
};
//TURNING ON/OFF BLUETOOTH
public void enableBT() {
//DEVICE DOES NOT HAVE BLUETOOTH
if (myBluetoothAdapter == null) {
Toast.makeText(BluetoothMain.this, "Device Does Not Support Bluetooth.",
Toast.LENGTH_LONG).show();
Log.d(TAG, "enableDisableBT: Does not have BT capabilities.");
}
//IF BLUETOOTH NOT ENABLED
if (!myBluetoothAdapter.isEnabled()) {
Intent enableBTIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivity(enableBTIntent);
}
//IF BLUETOOTH ENABLED
if (myBluetoothAdapter.isEnabled()) {
discoverabilityON();
}
}
// TURN DISCOVERABILITY ON
private void discoverabilityON() {
Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);
startActivity(discoverableIntent);
}
// Check BT permission in manifest (For Start Discovery)
private void checkBTPermission() {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
int permissionCheck = ContextCompat.checkSelfPermission(getApplicationContext(),
Manifest.permission.ACCESS_FINE_LOCATION);
permissionCheck += ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.ACCESS_COARSE_LOCATION);
if (permissionCheck != 0) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 1001);
}
} else {
Log.d(TAG, "checkBTPermissions: No need to check permissions. SDK version < LOLLIPOP.");
}
}
//Discovering other device
private void startSearch() {
Log.d(TAG, "btnDiscover: Looking for unpaired devices.");
if (myBluetoothAdapter.isDiscovering()) {
myBluetoothAdapter.cancelDiscovery();
Log.d(TAG, "BTDiscovery: canceling discovery");
//check BT permission in manifest
checkBTPermission();
myBluetoothAdapter.startDiscovery();
Log.d(TAG, "BTDiscovery: enable discovery");
}
if (!myBluetoothAdapter.isDiscovering()) {
//check BT permission in manifest
checkBTPermission();
myBluetoothAdapter.startDiscovery();
Log.d(TAG, "BTDiscovery: enable discovery");
}
}
//Call Bluetooth chat service
public void startBTConnection(BluetoothDevice device, UUID uuid) {
Log.d(TAG, "StartBTConnection: Initializing RFCOM Bluetooth Connection");
connectIntent = new Intent(BluetoothMain.this, BluetoothConnectionService.class);
connectIntent.putExtra("serviceType", "connect");
connectIntent.putExtra("device", device);
connectIntent.putExtra("id", uuid);
Log.d(TAG, "StartBTConnection: Starting Bluetooth Connection Service!");
startService(connectIntent);
}
public void checkPairedDevice() {
//CHECK IF THERE IS PAIRED DEVICES
Set<BluetoothDevice> pairedDevices = myBluetoothAdapter.getBondedDevices();
BTPairedDeviceList.clear();
if (pairedDevices.size() > 0) {
for (BluetoothDevice device : pairedDevices) {
Log.d(TAG, "PAIRED DEVICES: " + device.getName() + "," + device.getAddress());
BTPairedDeviceList.add(device);
}
pairedDevice.setText("Paired Devices: ");
PairedDeviceListAdapter = new DeviceListAdapter(this, R.layout.device_adapter_view, BTPairedDeviceList);
ListPairedDevices.setAdapter(PairedDeviceListAdapter);
} else {
pairedDevice.setText("No Paired Devices: ");
Log.d(TAG, "NO PAIRED DEVICE!!");
}
}
// CHECKING OF INCOMING MESSAGE TYPE
public String checkIncomingMsgType(String msg) {
String msgType = null;
String[] splitedMsg = msg.split(":");
switch (splitedMsg[0]) {
//RobotStatus
case "status":
// Statements
msgType = "robotstatus";
break; // optional
//Auto / Manual Refresh Of Map
case "maprefresh":
// Statements
msgType = "maprefresh";
break; // optional
default: // Optional
Log.d(TAG, "Checking Msg Type: Error - " + splitedMsg[0] + ":" + splitedMsg[1]);
break;
// Statements
}
return msgType;
}
@Override
protected void onDestroy() {
Log.d(TAG, "Bluetooth activity: Destroyed");
super.onDestroy();
unregisterReceiver(discoverabilityBroadcastReceiver);
unregisterReceiver(discoveryBroadcastReceiver);
unregisterReceiver(bondingBroadcastReceiver);
unregisterReceiver(discoveryStartedBroadcastReceiver);
unregisterReceiver(discoveryEndedBroadcastReceiver);
unregisterReceiver(enableBTBroadcastReceiver);
LocalBroadcastManager.getInstance(this).unregisterReceiver(myReceiver);
LocalBroadcastManager.getInstance(this).unregisterReceiver(btConnectionReceiver);
}
} | [
"54987863+MelvinWong96@users.noreply.github.com"
] | 54987863+MelvinWong96@users.noreply.github.com |
dceb3dee35aab8c8cf9f20e9d3b347627f8b4426 | c22b7328f81effac6895ef4730b98b2ce75b4359 | /src/servlet/OrderTicketServlet.java | 608feac684b4522cff63d33a859c98250fc425a0 | [] | no_license | tsubasa-kun/TrainTicketServer | 10dd57c86cc05619f1d5bdb71575a53a6f0d2407 | ed703b65c50b9402cf89ab8a16d6eecd23d9019b | refs/heads/master | 2021-01-18T16:12:06.019298 | 2017-05-20T18:07:56 | 2017-05-20T18:07:56 | 86,725,444 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,679 | java | package servlet;
import java.util.List;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import bean.MemberListBean;
import bean.OrderBean;
import bean.OrderListBean;
import bean.ResultBean;
import com.google.gson.Gson;
import db.DBHelper;
/**
* 购买车票Servlet
*
* @author cookie
*
*/
public class OrderTicketServlet extends HttpServlet {
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request
* the request send by the client to the server
* @param response
* the response send by the server to the client
* @throws ServletException
* if an error occurred
* @throws IOException
* if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}
/**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to
* post.
*
* @param request
* the request send by the client to the server
* @param response
* the response send by the server to the client
* @throws ServletException
* if an error occurred
* @throws IOException
* if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// 设置请求编码
response.setContentType("text/html;charset=utf-8");
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
PrintWriter out = response.getWriter();
Gson gson = new Gson();
// 获取参数
String orderId = request.getParameter("orderId");
String account = request.getParameter("account");
MemberListBean members = gson.fromJson(request.getParameter("members"),
MemberListBean.class);
String trainNo = request.getParameter("trainNo");
String fromStation = request.getParameter("fromStation");
String startTime = request.getParameter("startTime");
String toStation = request.getParameter("toStation");
String endTime = request.getParameter("endTime");
String date = request.getParameter("date");
String seat = request.getParameter("seat");
String carriage = request.getParameter("carriage");
String seatNo = request.getParameter("seatNo");
String money = request.getParameter("money");
String type = request.getParameter("type");
String id = request.getParameter("id");
//数量操作符
if (id != null) {
String theTrainNo = "";
String theSeat = "";
//查询车次
String sql_que = "SELECT * FROM orders WHERE id = '" + id + "'";
//改签把此票的status改成3,orderID改成0
String sql_upd = "UPDATE orders SET order_id = '0', pay_status = '3' WHERE id = '" + id + "'";
// 执行数据库操作
Statement stat = null;
Connection conn = new DBHelper().getConnect();
try {
stat = conn.createStatement();
ResultSet rs = stat.executeQuery(sql_que); // 获取结果
while (rs.next()) {
theTrainNo = rs.getString("train_no");
theSeat = rs.getString("seat");
}
stat.executeUpdate(sql_upd);
// 车票+1
String sql_upd2 = "UPDATE tickets SET";
if (theSeat.equals("商务座")) {
sql_upd2 = sql_upd2 + " swz_num = swz_num + 1";
} else if (theSeat.equals("一等座")) {
sql_upd2 = sql_upd2 + " zy_num = zy_num + 1";
} else if (theSeat.equals("二等座")) {
sql_upd2 = sql_upd2 + " ze_num = ze_num + 1";
} else if (theSeat.equals("硬座")) {
sql_upd2 = sql_upd2 + " yz_num = yz_num + 1";
} else if (theSeat.equals("硬卧")) {
sql_upd2 = sql_upd2 + " yw_num = yw_num + 1";
} else if (theSeat.equals("无座")) {
sql_upd2 = sql_upd2 + " wz_num = wz_num + 1";
}
sql_upd2 = sql_upd2 + " WHERE train_code = '" + theTrainNo + "'";
stat.executeUpdate(sql_upd2);
} catch (SQLException ex) {
ex.printStackTrace();
}
}
// 车票-1
String sql_upd = "UPDATE tickets SET";
if (seat.equals("商务座")) {
sql_upd = sql_upd + " swz_num = swz_num - 1";
} else if (seat.equals("一等座")) {
sql_upd = sql_upd + " zy_num = zy_num - 1";
} else if (seat.equals("二等座")) {
sql_upd = sql_upd + " ze_num = ze_num - 1";
} else if (seat.equals("硬座")) {
sql_upd = sql_upd + " yz_num = yz_num - 1";
} else if (seat.equals("硬卧")) {
sql_upd = sql_upd + " yw_num = yw_num - 1";
} else if (seat.equals("无座")) {
sql_upd = sql_upd + " wz_num = wz_num - 1";
}
sql_upd = sql_upd + " WHERE train_code = '" + trainNo + "'";
int n = 0;
OrderListBean orderListBean = new OrderListBean();
List<OrderBean> orders = new ArrayList<OrderBean>();
for (int i = 0; i < members.getMembers().size(); i++) {
String temp_seatNo = "无";
if (!seatNo.equals("无")) {
temp_seatNo = (Integer.parseInt(seatNo) + i) + "";
}
// 执行数据库操作
String sql_ins = "INSERT INTO orders(order_id, account, real_name, train_no, from_station, start_time, to_station, end_time, date, seat, carriage, seat_no, money, type) VALUES('"
+ orderId
+ "', '"
+ account
+ "', '"
+ members.getMembers().get(i).getMemberRealName()
+ "', '"
+ trainNo
+ "', '"
+ fromStation
+ "', '"
+ startTime
+ "', '"
+ toStation
+ "', '"
+ endTime
+ "', '"
+ date
+ "', '"
+ seat
+ "', '"
+ carriage
+ "', '"
+ temp_seatNo
+ "', '" + money + "', '" + type + "')";
Statement stat = null;
OrderBean orderBean = new OrderBean();
orderBean.setOrderId(orderId);
orderBean.setAccount(account);
orderBean.setRealName(members.getMembers().get(i).getMemberRealName());
orderBean.setTrainNo(trainNo);
orderBean.setFromStation(fromStation);
orderBean.setStartTime(startTime);
orderBean.setToStation(toStation);
orderBean.setEndTime(endTime);
orderBean.setDate(date);
orderBean.setSeat(seat);
orderBean.setCarriage(carriage);
orderBean.setSeatNo(temp_seatNo);
orderBean.setMoney(money);
orderBean.setType(type);
orderBean.setResStatus("failed");
orderBean.setResMsg("生成订单失败");
Connection conn = new DBHelper().getConnect();
try {
stat = conn.createStatement();
int row = stat.executeUpdate(sql_ins);
if (row == 1) {
orderBean.setResStatus("success");
orderBean.setResMsg("生成订单成功");
ResultSet rs = stat.getGeneratedKeys(); // 获取结果
if (rs.next()) {
orderBean.setId(rs.getInt(1));// 取得ID
}
stat.executeUpdate(sql_upd);
} else {
orderBean.setResStatus("failed");
orderBean.setResMsg("生成订单失败");
}
} catch (SQLException ex) {
ex.printStackTrace();
orderBean.setResStatus("failed");
orderBean.setResMsg("生成订单失败");
}
orders.add(orderBean);
n++;
}
if (n == members.getMembers().size()) {
// 通过输出流把业务逻辑的结果输出
orderListBean.setOrders(orders);
orderListBean.setResMsg(orders.get(0).getResMsg());
orderListBean.setResStatus(orders.get(0).getResStatus());
String result = gson.toJson(orderListBean);
out.print(result);
out.flush();
out.close();
}
}
}
| [
"tsubasa-kun@foxmail.com"
] | tsubasa-kun@foxmail.com |
01c5e0728ffc3d3b7360be2a41de7ed6735acc4d | a32e207c098cc9fa3b82cbedc29d6342a85d33a6 | /app/src/main/java/com/mvpdemoapp/AppPinPresenter.java | d18472ac289ed3cb970366eafe87c4f406c012ce | [] | no_license | ayansGit/MVP_Architecture_Android | 1e205febb105bd856fed4a32caa1464af567589e | d40583a4a2555f4af09aa388975bd0f51a60e43a | refs/heads/master | 2020-05-30T08:18:37.362545 | 2019-07-12T15:47:47 | 2019-07-12T15:47:47 | 189,618,726 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,193 | java | package com.mvpdemoapp;
import android.view.View;
public class AppPinPresenter implements AppPinConf.Presenter {
private AppPinConf.View view;
private PinModel model;
public AppPinPresenter(AppPinConf.View view) {
this.view = view;
model = new PinModel();
}
@Override
public void loadNextScreen() {
view.navigateToNextPage();
}
@Override
public void defaultSettings() {
view.setButtonColor(R.color.lightGrey,R.color.white);
view.showOnButtonClick(false);
view.showTickImage(View.INVISIBLE);
}
@Override
public void verifyEntries() {
view.setButtonColor(R.color.colorAccent,R.color.white);
view.showOnButtonClick(true);
view.showTickImage(View.VISIBLE);
}
@Override
public void savePassword(String password) {
model.setPin(password);
}
@Override
public String appendIndvidualPassword(String first, String second, String third, String fourth) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(first).append(second).append(third).append(fourth);
return stringBuilder.toString();
}
}
| [
"wtsayan@webskitterss-iMac.local"
] | wtsayan@webskitterss-iMac.local |
487180283d1eef11af18759428d7f834e7846514 | 22322aa3ebca89c21d10fe4da388bb80142e7e6e | /Car.java | 096645c7a18ca0a54d8a7e8a23019257fc9bcccd | [] | no_license | DevNam2k1/OOP | 58984133f51bc51729b51513fc392027f5680b51 | 0893e01234b110686f8a98deec2296a98b734656 | refs/heads/master | 2023-04-19T07:36:00.893005 | 2021-05-08T04:23:48 | 2021-05-08T04:23:48 | 365,295,810 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 732 | java | package Study;
public class Car {
private String make;
private String model;
private int year;
Car(String make, String model, int year){
this.setMake(make);
this.setModel(model);
this.setYear(year);
}
public String getMake() {
return make;
}
public String getModel() {
return model;
}
public int getYear() {
return year;
}
public void setMake(String make) {
this.make = make;
}
public void setModel(String model) {
this.model = model;
}
public void setYear(int year) {
this.year = year;
}
public void copy(Car x) {
this.setMake(x.getMake());
this.setModel(x.getModel());
this.setYear(x.getYear());
}
}
| [
"dinhnamsaker@gmail.com"
] | dinhnamsaker@gmail.com |
f3eeb1577fa2ca3e3b5e09452df27b8057ab2d6b | 6542bdd12112891a1dce08a87791802369d036e7 | /BFS/103. Binary Tree Zigzag Level Order Traversal.java | a3ac09b3b6e9caaa8db48b4f14db46a8aaf91415 | [] | no_license | TONGWU97/LeetCode-in-Java | 1a5ba93a4abc0b70baa855e3a3d3ca6d48529779 | f4158c0dcc1ba6124e542e5147485c95de436ea6 | refs/heads/master | 2020-04-30T10:30:35.691981 | 2019-05-08T00:39:41 | 2019-05-08T00:39:41 | 176,779,397 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,841 | java | /*
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).
For example:
Given binary tree [3,9,20,null,null,15,7],
3
/ \
9 20
/ \
15 7
return its zigzag level order traversal as:
[
[3],
[20,9],
[15,7]
]
*/
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/
class Solution {
public List<List<Integer>> zigzagLevelOrder(TreeNode root) {
List<List<Integer>> results = new ArrayList<>();
if(root == null) {
return results;
}
// Interface
// 1.创建一个队列,把起始节点都放到里面(第一层节点)
Queue<TreeNode> queue= new LinkedList<>();
// 也可以用ArrayList的方式 ArrayList<TreeNode> queue = ...
queue.offer(root);
// 2.while队列不空,处理队列中的节点并拓展出新的节点
while(!queue.isEmpty()) {
List<Integer> level = new ArrayList<>();
// for上一层的节点拓展出下一层的节点
int size = queue.size();
for(int i = 0; i < size; i++) {
TreeNode node = queue.poll();
level.add(node.val);
if(node.left != null) {
queue.offer(node.left);
}
if(node.right != null) {
queue.offer(node.right);
}
}
results.add(level);
}
// 将results中偶数项倒序
for(int j = 1; j < results.size(); j+=2) {
Collections.reverse(results.get(j));
}
return results;
}
}
| [
"wu.to@husky.neu.edu"
] | wu.to@husky.neu.edu |
5b6284b8f1d0fb9b5002bdb90004de1df7497da1 | 2ce90c5ac6543b4cb448ce54e8eb8da1142e5658 | /Pilotage_metier/.svn/pristine/5b/5b6284b8f1d0fb9b5002bdb90004de1df7497da1.svn-base | 2e47232cb7eef228fe82c5f9e68c56551e5715cb | [] | no_license | aelbarji/pfm-workspaceAG2R | 5c2467094024de9f74dc05da30af2dd34456b86c | a46f05aa2771b2c660f694d1463e602ebc268f1f | refs/heads/master | 2021-01-17T15:20:25.243262 | 2016-06-12T14:26:58 | 2016-06-12T14:26:58 | 49,145,850 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 622 | /**
* pilotage.admin.metier
* 10 juin 2011
*/
package pilotage.admin.metier;
/**
* @author xxu
*
*/
public class Parametre {
private String libelle;
private String valeur;
/**
* @return the libelle
*/
public String getLibelle() {
return libelle;
}
/**
* @param libelle the libelle to set
*/
public void setLibelle(String libelle) {
this.libelle = libelle;
}
/**
* @return the valeur
*/
public String getValeur() {
return valeur;
}
/**
* @param valeur the valeur to set
*/
public void setValeur(String valeur) {
this.valeur = valeur;
}
}
| [
"aelbarji@groupehn.com"
] | aelbarji@groupehn.com | |
6bad6dee06fd4bb61a6c8b4e98a2891d824876f4 | e49ddf6e23535806c59ea175b2f7aa4f1fb7b585 | /tags/release-5.2.0/mipav/src/gov/nih/mipav/model/file/FileDM3.java | 6931dad028da4e051c10f3186343d5a7b9c4616a | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | svn2github/mipav | ebf07acb6096dff8c7eb4714cdfb7ba1dcace76f | eb76cf7dc633d10f92a62a595e4ba12a5023d922 | refs/heads/master | 2023-09-03T12:21:28.568695 | 2019-01-18T23:13:53 | 2019-01-18T23:13:53 | 130,295,718 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 57,931 | java | package gov.nih.mipav.model.file;
import gov.nih.mipav.model.structures.ModelImage;
import gov.nih.mipav.model.structures.ModelLUT;
import gov.nih.mipav.model.structures.ModelStorageBase;
import gov.nih.mipav.view.MipavUtil;
import gov.nih.mipav.view.Preferences;
import gov.nih.mipav.view.ViewJProgressBar;
import java.awt.Toolkit;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
/**
* Some of this code is derived from DM3_Reader.java in ImageJ.
*
* <hr>
* <p>
* ImageJ disclaimer:
* </p>
*
* <p>
* ImageJ is being developed at the National Institutes of Health by an employee of the Federal Government in the course
* of his official duties. Pursuant to Title 17, Section 105 of the United States Code, this software is not subject to
* copyright protection and is in the public domain. ImageJ is an experimental system. NIH assumes no responsibility
* whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality,
* reliability, or any other characteristic.
* </p>
*/
public class FileDM3 extends FileBase {
// ~ Static fields/initializers
// -------------------------------------------------------------------------------------
/** Different encoded data types used in DM3 files. */
private static final int SHORT = 2;
/** DOCUMENT ME! */
private static final int LONG = 3;
/** DOCUMENT ME! */
private static final int USHORT = 4;
/** DOCUMENT ME! */
private static final int ULONG = 5;
/** DOCUMENT ME! */
private static final int FLOAT = 6;
/** DOCUMENT ME! */
private static final int DOUBLE = 7;
/** DOCUMENT ME! */
private static final int BOOLEAN = 8;
/** DOCUMENT ME! */
private static final int CHAR = 9;
/** DOCUMENT ME! */
private static final int OCTET = 10;
/** DOCUMENT ME! */
private static final int STRUCT = 15;
/** DOCUMENT ME! */
private static final int STRING = 18;
/** DOCUMENT ME! */
private static final int ARRAY = 20;
// ~ Instance fields
// ------------------------------------------------------------------------------------------------
/** DOCUMENT ME! */
private long[] arrayLocationArray = new long[100];
/** DOCUMENT ME! */
private int[] arraySizeArray = new int[100];
/** DOCUMENT ME! */
private int byteOrder;
/** DOCUMENT ME! */
private boolean dataEndianess;
/** DOCUMENT ME! */
private int[] dataTypeArray = new int[100];
/** DOCUMENT ME! */
private int desiredArraySize;
/** DOCUMENT ME! */
private int desiredImageNumber;
/** DOCUMENT ME! */
private String[] desiredPixelUnitsArray = new String[10];
/** DOCUMENT ME! */
private int[][] dimArray = new int[100][10];
/** DOCUMENT ME! */
private boolean endianess;
/** DOCUMENT ME! */
private File file;
/** DOCUMENT ME! */
private int fileBytes;
/** DOCUMENT ME! */
private String fileDir;
/** DOCUMENT ME! */
private FileInfoDM3 fileInfo;
private FileInfoDM3 fileInfoCopy;
/** DOCUMENT ME! */
private String fileName;
/** DOCUMENT ME! */
private int fileVersion;
/** DOCUMENT ME! */
private int identicalDesiredArraySize = 0;
/** DOCUMENT ME! */
private ModelImage image;
/** DOCUMENT ME! */
private int imageNum = -1;
/** DOCUMENT ME! */
private int[] imgExtents;
/** DOCUMENT ME! */
private boolean isCalibrations = false;
/** DOCUMENT ME! */
private boolean isData = false;
/** DOCUMENT ME! */
private boolean isDataType = false;
/** DOCUMENT ME! */
private boolean isDimension = false;
/** DOCUMENT ME! */
private boolean isDimensions = false;
/** DOCUMENT ME! */
private boolean isImageData = false;
/** DOCUMENT ME! */
private boolean isScale = false;
/** DOCUMENT ME! */
private boolean isUnits = false;
/** DOCUMENT ME! */
private ModelLUT LUT = null;
/** DOCUMENT ME! */
private int nDimensions = 2;
/** DOCUMENT ME! */
private int numberSlices; // 1 for 2D, zDim for 3D, and zDim * tDim for 4D
/** DOCUMENT ME! */
private int[] numDimArray = new int[100];
/** DOCUMENT ME! */
private float[][] pixelScaleArray = new float[100][10];
/** DOCUMENT ME! */
private String[][] pixelUnitsArray = new String[100][10];
/** DOCUMENT ME! */
private int[] pixelUnitsNumber = new int[100];
/** DOCUMENT ME! */
private ViewJProgressBar progressBar = null;
/** DOCUMENT ME! */
private int routineTagEntry = 0;
/** DOCUMENT ME! */
private int routineTagGroup = 0;
/** DOCUMENT ME! */
private int scaleIndex = 0;
/** DOCUMENT ME! */
private int sourceType = ModelStorageBase.USHORT;
/** DOCUMENT ME! */
private int unitsIndex = 0;
// ~ Constructors
// ---------------------------------------------------------------------------------------------------
/**
* DM3 reader constructor.
*
* @param fileName file name
* @param fileDir file directory
*
* @exception IOException if there is an error making the file
*/
public FileDM3(final String fileName, final String fileDir) throws IOException {
this.fileName = fileName;
this.fileDir = fileDir;
}
// ~ Methods
// --------------------------------------------------------------------------------------------------------
/**
* Prepares this class for cleanup. Calls the <code>finalize</code> method for existing elements, closes any open
* files and sets other elements to <code>null</code>.
*/
public void finalize() {
int i, j;
arrayLocationArray = null;
arraySizeArray = null;
dataTypeArray = null;
if (desiredPixelUnitsArray != null) {
for (i = 0; i < desiredPixelUnitsArray.length; i++) {
desiredPixelUnitsArray[i] = null;
}
desiredPixelUnitsArray = null;
}
if (dimArray != null) {
for (i = 0; i < dimArray.length; i++) {
dimArray[i] = null;
}
dimArray = null;
}
imgExtents = null;
LUT = null;
numDimArray = null;
if (pixelScaleArray != null) {
for (i = 0; i < pixelScaleArray.length; i++) {
pixelScaleArray[i] = null;
}
pixelScaleArray = null;
}
if (pixelUnitsArray != null) {
for (i = 0; i < pixelUnitsArray.length; i++) {
for (j = 0; j < pixelUnitsArray[i].length; j++) {
pixelUnitsArray[i][j] = null;
}
pixelUnitsArray[i] = null;
}
pixelUnitsArray = null;
}
pixelUnitsNumber = null;
fileName = null;
fileDir = null;
fileInfo = null;
fileInfoCopy = null;
file = null;
image = null;
try {
super.finalize();
} catch (final Throwable er) {}
}
/**
* returns LUT if defined.
*
* @return the LUT if defined else it is null
*/
public ModelLUT getModelLUT() {
return LUT;
}
/**
* reads the DM3 file header and data.
*
* @exception IOException if there is an error reading the file
*
* @param one DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public ModelImage readImage(final boolean one) throws IOException {
int i, j;
int bufferSize;
float[] imgBuffer;
float[] imgBufferI;
double[] imgDBuffer;
double[] imgDBufferI;
long[] imgLBuffer;
try {
progressBar = new ViewJProgressBar(fileName, "Reading DM3 file...", 0, 100, false, null, null);
progressBar.setLocation((int) Toolkit.getDefaultToolkit().getScreenSize().getWidth() / 2, 50);
file = new File(fileDir + fileName);
endianess = FileBase.BIG_ENDIAN; // true
fileInfo = new FileInfoDM3(fileName, fileDir, FileUtility.DM3);
raFile = new RandomAccessFile(file, "r");
fileVersion = getInt(endianess);
Preferences.debug("DM3 file version = " + fileVersion + "\n");
if (fileVersion != 3) {
raFile.close();
MipavUtil.displayError("File version number = " + fileVersion + " instead of required 3");
throw new IOException();
}
// Location contains number of file bytes - 16
fileBytes = getInt(endianess) + 16;
Preferences.debug(fileName + " length = " + fileBytes + " bytes\n");
// The next location contains the byte ordering of the tag data
// Only the tag data is in this order.
// All other data is big endian.
byteOrder = getInt(endianess);
if (byteOrder == 0) {
Preferences.debug("Tag data is big endian\n");
dataEndianess = FileBase.BIG_ENDIAN;
} else if (byteOrder == 1) {
dataEndianess = FileBase.LITTLE_ENDIAN;
Preferences.debug("Tag data is little endian\n");
} else {
Preferences.debug("byteOrder is an illegal = " + byteOrder + "\n");
raFile.close();
MipavUtil.displayError("Byte order is an illegal = " + byteOrder);
throw new IOException();
}
fileInfo.setEndianess(dataEndianess);
// Read tag group
readTagGroup();
Preferences.debug("Have completed readTagGroup()\n");
desiredImageNumber = 0;
desiredArraySize = arraySizeArray[0];
identicalDesiredArraySize = 1;
// In 4 images that I examined a smaller 192 by 192 image is the first image present.
// This image is in ARGB representation although it has R = G = B so a black and
// white image appears. It is a smaller version of the second image.
// The second image was a 512 by 512 or 1024 by 1024 float or short image
for (i = 1; i <= imageNum; i++) {
if (arraySizeArray[i] > desiredArraySize) {
desiredImageNumber = i;
desiredArraySize = arraySizeArray[i];
identicalDesiredArraySize = 1;
} else if (arraySizeArray[i] == desiredArraySize) {
identicalDesiredArraySize++;
}
}
Preferences.debug("Number of arrays of largest size = " + identicalDesiredArraySize + "\n");
nDimensions = numDimArray[desiredImageNumber];
imgExtents = new int[nDimensions];
for (i = 0; i < nDimensions; i++) {
imgExtents[i] = dimArray[desiredImageNumber][i];
}
fileInfo.setExtents(imgExtents);
// Data type definitions from GatanDM3.h.
switch (dataTypeArray[desiredImageNumber]) {
case 0: // NULL_DATA
break;
case 1: // SIGNED_INT16_DATA
sourceType = ModelStorageBase.SHORT;
break;
case 2: // REAL4_DATA
sourceType = ModelStorageBase.FLOAT;
break;
case 3: // COMPLEX8_DATA
sourceType = ModelStorageBase.COMPLEX;
break;
case 4: // OBSOLETE_DATA
break;
case 5: // PACKED_DATA
break;
case 6: // UNSIGNED_INT8_DATA
sourceType = ModelStorageBase.UBYTE;
break;
case 7: // SIGNED_INT32_DATA
sourceType = ModelStorageBase.INTEGER;
break;
case 8: // RGB_DATA
break;
case 9: // SIGNED_INT8_DATA
sourceType = ModelStorageBase.BYTE;
break;
case 10: // UNSIGNED_INT16_DATA
sourceType = ModelStorageBase.USHORT;
break;
case 11: // UNSIGNED_INT32_DATA
sourceType = ModelStorageBase.UINTEGER;
break;
case 12: // REAL8_DATA
sourceType = ModelStorageBase.DOUBLE;
break;
case 13: // COMPLEX16_DATA
sourceType = ModelStorageBase.DCOMPLEX;
break;
case 14: // BINARY_DATA
// bitmap
break;
case 15: // RGB_UINT8_0_DATA
break;
case 16: // RGB_UINT8_1_DATA
break;
case 17: // RGB_UINT16_DATA
break;
case 18: // RGB_FLOAT32_DATA
break;
case 19: // RGB_FLOAT64_DATA
break;
case 20: // RGBA_UINT8_0_DATA
break;
case 21: // RGBA_UINT8_1_DATA
break;
case 22: // RGBA_UINT8_2_DATA
break;
case 23: // RGBA_UINT8_3_DATA
sourceType = ModelStorageBase.ARGB;
break;
case 24: // RGBA_UINT16_DATA
break;
case 25: // RGBA_FLOAT32_DATA
break;
case 26: // RGBA_FLOAT64_DATA
break;
case 27: // POINT2_SINT16_0_DATA
break;
case 28: // POINT2_SINT16_1_DATA
break;
case 29: // POINT2_SINT32_0_DATA
break;
case 30: // POINT2_FLOAT32_0_DATA
break;
case 31: // RECT_SINT16_1_DATA
break;
case 32: // RECT_SINT32_1_DATA
break;
case 33: // RECT_FLOAT32_1_DATA
break;
case 34: // RECT_FLOAT32_0_DATA
break;
case 35: // SIGNED_INT64_DATA
sourceType = ModelStorageBase.LONG;
break;
case 36: // UNSIGNED_INT64_DATA - Actually ULONG but treat as LONG
sourceType = ModelStorageBase.LONG;
break;
case 37: // LAST_DATA
break;
}
if (one) {
image = new ModelImage(sourceType, new int[] {imgExtents[0], imgExtents[1]}, fileInfo.getFileName());
} else {
image = new ModelImage(sourceType, imgExtents, fileInfo.getFileName());
}
fileInfo.setDataType(sourceType);
if ( (nDimensions == 3)
&& (pixelScaleArray[desiredImageNumber][0] != pixelScaleArray[desiredImageNumber][1])
&& (pixelScaleArray[desiredImageNumber][1] == pixelScaleArray[desiredImageNumber][2])) {
for (i = 0; i < nDimensions; i++) {
fileInfo.setResolutions(pixelScaleArray[desiredImageNumber][nDimensions - i - 1], i);
}
} else {
for (i = 0; i < nDimensions; i++) {
fileInfo.setResolutions(pixelScaleArray[desiredImageNumber][i], i);
}
}
for (i = nDimensions - 1, j = 0; i >= 0; i--, j++) {
desiredPixelUnitsArray[i] = pixelUnitsArray[desiredImageNumber][pixelUnitsNumber[desiredImageNumber]
- 1 - j].trim();
}
for (i = 0; i < nDimensions; i++) {
if (desiredPixelUnitsArray[i].equals("n")) {
fileInfo.setUnitsOfMeasure(FileInfoBase.NANOMETERS, i);
}
// micro sign = 00B5 Greek letter mu = 03BC
else if (desiredPixelUnitsArray[i].equals("\u00B5")) {
fileInfo.setUnitsOfMeasure(FileInfoBase.MICROMETERS, i);
} else {
fileInfo.setUnitsOfMeasure(FileInfoBase.UNKNOWN_MEASURE, i);
}
}
if ( (nDimensions == 2) || one) {
numberSlices = 1;
} else if (nDimensions == 3) {
numberSlices = imgExtents[2];
} else {
numberSlices = imgExtents[2] * imgExtents[3];
}
raFile.seek(arrayLocationArray[desiredImageNumber]);
if (sourceType == ModelStorageBase.ARGB) {
bufferSize = 4 * imgExtents[0] * imgExtents[1];
} else {
bufferSize = imgExtents[0] * imgExtents[1];
}
switch (sourceType) {
case ModelStorageBase.BYTE:
case ModelStorageBase.UBYTE:
case ModelStorageBase.SHORT:
case ModelStorageBase.USHORT:
case ModelStorageBase.INTEGER:
case ModelStorageBase.FLOAT:
case ModelStorageBase.ARGB:
imgBuffer = new float[bufferSize];
for (i = 0; i < numberSlices; i++) {
fileInfoCopy = (FileInfoDM3) fileInfo.clone();
image.setFileInfo(fileInfoCopy, i);
readBuffer(i, imgBuffer);
image.importData(i * bufferSize, imgBuffer, false);
}
break;
case ModelStorageBase.UINTEGER:
case ModelStorageBase.LONG:
imgLBuffer = new long[bufferSize];
for (i = 0; i < numberSlices; i++) {
fileInfoCopy = (FileInfoDM3) fileInfo.clone();
image.setFileInfo(fileInfoCopy, i);
readLBuffer(i, imgLBuffer);
image.importData(i * bufferSize, imgLBuffer, false);
}
break;
case ModelStorageBase.DOUBLE:
imgDBuffer = new double[bufferSize];
for (i = 0; i < numberSlices; i++) {
fileInfoCopy = (FileInfoDM3) fileInfo.clone();
image.setFileInfo(fileInfoCopy, i);
readDBuffer(i, imgDBuffer);
image.importData(i * bufferSize, imgDBuffer, false);
}
break;
case ModelStorageBase.COMPLEX:
imgBuffer = new float[bufferSize];
imgBufferI = new float[bufferSize];
for (i = 0; i < numberSlices; i++) {
fileInfoCopy = (FileInfoDM3) fileInfo.clone();
image.setFileInfo(fileInfoCopy, i);
readComplexBuffer(i, imgBuffer, imgBufferI);
image.importComplexData(2 * i * bufferSize, imgBuffer, imgBufferI, false, Preferences.is(Preferences.PREF_LOGMAG_DISPLAY));
}
break;
case ModelStorageBase.DCOMPLEX:
imgDBuffer = new double[bufferSize];
imgDBufferI = new double[bufferSize];
for (i = 0; i < numberSlices; i++) {
fileInfoCopy = (FileInfoDM3) fileInfo.clone();
image.setFileInfo(fileInfoCopy, i);
readDComplexBuffer(i, imgDBuffer, imgDBufferI);
image.importDComplexData(2 * i * bufferSize, imgDBuffer, imgDBufferI, false, Preferences.is(Preferences.PREF_LOGMAG_DISPLAY));
}
break;
} // switch(sourceType)
image.calcMinMax();
raFile.close();
if (progressBar != null) {
progressBar.dispose();
}
return image;
} catch (final Exception e) {
if (image != null) {
image.disposeLocal();
image = null;
}
System.gc();
throw new IOException();
}
}
/**
* DOCUMENT ME!
*
* @throws IOException DOCUMENT ME!
*/
private void readArray() throws IOException {
int arrayType;
int[] encodedType;
int arraySize;
int elementBytes = 0;
int bufferSize;
long arrayLocation;
int i;
try {
arrayType = getInt(endianess);
if (arrayType == FileDM3.STRUCT) {
encodedType = readStructTypes();
} else if (arrayType == FileDM3.ARRAY) {
encodedType = readArrayTypes();
} else {
encodedType = new int[] {arrayType};
}
arraySize = getInt(endianess);
Preferences.debug("Array size = " + arraySize + "\n");
if (isData) {
arraySizeArray[imageNum] = arraySize;
}
for (i = 0; i < encodedType.length; i++) {
switch (encodedType[i]) {
case BOOLEAN:
case CHAR:
case OCTET:
elementBytes += 1;
break;
case SHORT:
case USHORT:
elementBytes += 2;
break;
case LONG:
case ULONG:
case FLOAT:
elementBytes += 4;
break;
case DOUBLE:
elementBytes += 8;
break;
} // switch(encodedType[i])
} // for (i = 0; i < encodedType.length; i++)
Preferences.debug("elementBytes = " + elementBytes + "\n");
bufferSize = arraySize * elementBytes;
Preferences.debug("bufferSize = " + bufferSize + "\n");
arrayLocation = raFile.getFilePointer();
if (isData) {
arrayLocationArray[imageNum] = arrayLocation;
isData = false;
}
if ( (isImageData) && (isCalibrations) && (isDimension) && (isUnits)) {
pixelUnitsArray[imageNum][unitsIndex] = getString(elementBytes);
Preferences.debug("pixelUnitsArray[" + imageNum + "][ " + unitsIndex + "] = "
+ pixelUnitsArray[imageNum][unitsIndex] + "\n");
unitsIndex++;
pixelUnitsNumber[imageNum] = unitsIndex;
isUnits = false;
}
Preferences.debug("Array location = " + arrayLocation + "\n");
raFile.seek(arrayLocation + bufferSize);
return;
} catch (final Exception e) {
if (image != null) {
image.disposeLocal();
image = null;
}
System.gc();
raFile.close();
throw new IOException();
}
}
/**
* DOCUMENT ME!
*
* @return DOCUMENT ME!
*
* @throws IOException DOCUMENT ME!
*/
private int[] readArrayTypes() throws IOException {
int arrayType;
int[] itemTypes;
try {
arrayType = getInt(endianess);
if (arrayType == FileDM3.STRUCT) {
itemTypes = readStructTypes();
} else if (arrayType == FileDM3.ARRAY) {
itemTypes = readArrayTypes();
} else {
itemTypes = new int[] {arrayType};
}
return itemTypes;
} catch (final Exception e) {
if (image != null) {
image.disposeLocal();
image = null;
}
System.gc();
raFile.close();
throw new IOException();
}
}
/**
* Reads a slice of data at a time and stores the results in the buffer.
*
* @param slice offset into the file stored in the dataOffset array
* @param buffer buffer where the info is stored
*
* @exception IOException if there is an error reading the file
*/
private void readBuffer(final int slice, final float[] buffer) throws IOException {
int i = 0;
int j;
int nBytes;
int b1, b2, b3, b4;
byte[] byteBuffer;
int progress, progressLength, mod;
int tmpInt;
switch (sourceType) {
case ModelStorageBase.BYTE:
nBytes = buffer.length;
byteBuffer = new byte[nBytes];
raFile.read(byteBuffer, 0, nBytes);
progress = slice * buffer.length;
progressLength = buffer.length * numberSlices;
mod = progressLength / 100;
for (j = 0; j < nBytes; j++, i++) {
if ( ( (i + progress) % mod) == 0) {
fireProgressStateChanged(Math.round((float) (i + progress) / progressLength * 100));
}
buffer[i] = byteBuffer[j];
}
break;
case ModelStorageBase.UBYTE:
byteBuffer = new byte[buffer.length];
nBytes = buffer.length;
raFile.read(byteBuffer, 0, nBytes);
progress = slice * buffer.length;
progressLength = buffer.length * numberSlices;
mod = progressLength / 100;
for (j = 0; j < nBytes; j++, i++) {
if ( ( (i + progress) % mod) == 0) {
fireProgressStateChanged(Math.round((float) (i + progress) / progressLength * 100));
}
buffer[i] = byteBuffer[j] & 0xff;
}
break;
case ModelStorageBase.SHORT:
byteBuffer = new byte[2 * buffer.length];
nBytes = 2 * buffer.length;
raFile.read(byteBuffer, 0, nBytes);
progress = slice * buffer.length;
progressLength = buffer.length * numberSlices;
mod = progressLength / 10;
for (j = 0; j < nBytes; j += 2, i++) {
if ( ( (i + progress) % mod) == 0) {
fireProgressStateChanged(Math.round((float) (i + progress) / progressLength * 100));
}
b1 = getUnsignedByte(byteBuffer, j);
b2 = getUnsignedByte(byteBuffer, j + 1);
if (dataEndianess) {
buffer[i] = (short) ( (b1 << 8) + b2);
} else {
buffer[i] = (short) ( (b2 << 8) + b1);
}
} // for (j = 0; j < nBytes; j+=2, i++ )
break;
case ModelStorageBase.FLOAT:
byteBuffer = new byte[4 * buffer.length];
nBytes = 4 * buffer.length;
raFile.read(byteBuffer, 0, nBytes);
progress = slice * buffer.length;
progressLength = buffer.length * numberSlices;
mod = progressLength / 10;
for (j = 0; j < nBytes; j += 4, i++) {
if ( ( (i + progress) % mod) == 0) {
fireProgressStateChanged(Math.round((float) (i + progress) / progressLength * 100));
}
b1 = getUnsignedByte(byteBuffer, j);
b2 = getUnsignedByte(byteBuffer, j + 1);
b3 = getUnsignedByte(byteBuffer, j + 2);
b4 = getUnsignedByte(byteBuffer, j + 3);
if (dataEndianess) {
tmpInt = ( (b1 << 24) | (b2 << 16) | (b3 << 8) | b4); // Big Endian
} else {
tmpInt = ( (b4 << 24) | (b3 << 16) | (b2 << 8) | b1); // Little Endian
}
buffer[i] = Float.intBitsToFloat(tmpInt);
} // for (j =0; j < nBytes; j+=4, i++ )
break;
case ModelStorageBase.USHORT:
byteBuffer = new byte[2 * buffer.length];
nBytes = 2 * buffer.length;
raFile.read(byteBuffer, 0, nBytes);
progress = slice * buffer.length;
progressLength = buffer.length * numberSlices;
mod = progressLength / 10;
for (j = 0; j < nBytes; j += 2, i++) {
if ( ( (i + progress) % mod) == 0) {
fireProgressStateChanged(Math.round((float) (i + progress) / progressLength * 100));
}
b1 = getUnsignedByte(byteBuffer, j);
b2 = getUnsignedByte(byteBuffer, j + 1);
if (dataEndianess) {
buffer[i] = ( (b1 << 8) + b2);
} else {
buffer[i] = ( (b2 << 8) + b1);
}
} // for (j = 0; j < nBytes; j+=2, i++ )
break;
case ModelStorageBase.INTEGER:
byteBuffer = new byte[4 * buffer.length];
nBytes = 4 * buffer.length;
raFile.read(byteBuffer, 0, nBytes);
progress = slice * buffer.length;
progressLength = buffer.length * numberSlices;
mod = progressLength / 10;
for (j = 0; j < nBytes; j += 4, i++) {
if ( ( (i + progress) % mod) == 0) {
fireProgressStateChanged(Math.round((float) (i + progress) / progressLength * 100));
}
b1 = getUnsignedByte(byteBuffer, j);
b2 = getUnsignedByte(byteBuffer, j + 1);
b3 = getUnsignedByte(byteBuffer, j + 2);
b4 = getUnsignedByte(byteBuffer, j + 3);
if (dataEndianess) {
buffer[i] = ( (b1 << 24) | (b2 << 16) | (b3 << 8) | b4); // Big Endian
} else {
buffer[i] = ( (b4 << 24) | (b3 << 16) | (b2 << 8) | b1); // Little Endian
}
} // for (j =0; j < nBytes; j+=4, i++ )
break;
case ModelStorageBase.ARGB:
nBytes = buffer.length;
byteBuffer = new byte[nBytes];
raFile.read(byteBuffer, 0, nBytes);
progress = slice * nBytes;
progressLength = nBytes * numberSlices;
mod = progressLength / 100;
for (j = 0; j < nBytes; j += 4, i++) {
if ( ( (i + progress) % mod) == 0) {
fireProgressStateChanged(Math.round((float) (i + progress) / progressLength * 100));
}
buffer[ (4 * i) + 1] = byteBuffer[j] & 0xff;
buffer[ (4 * i) + 2] = byteBuffer[j + 1] & 0xff;
buffer[ (4 * i) + 3] = byteBuffer[j + 2] & 0xff;
}
break;
} // switch(sourceType)
}
/**
* Reads a slice of data at a time and stores the results in the buffer.
*
* @param slice offset into the file stored in the dataOffset array
* @param bufferR buffer where the real info is stored
* @param bufferI buffer where the imaginary info is stored
*
* @exception IOException if there is an error reading the file
*/
private void readComplexBuffer(final int slice, final float[] bufferR, final float[] bufferI) throws IOException {
int i = 0;
int j;
int nBytes;
int b1, b2, b3, b4;
byte[] byteBuffer;
int progress, progressLength, mod;
int tmpInt;
nBytes = 8 * bufferR.length;
byteBuffer = new byte[nBytes];
raFile.read(byteBuffer, 0, nBytes);
progress = slice * bufferR.length;
progressLength = bufferR.length * numberSlices;
mod = progressLength / 10;
for (j = 0; j < nBytes; j += 8, i++) {
if ( ( (i + progress) % mod) == 0) {
fireProgressStateChanged(Math.round((float) (i + progress) / progressLength * 100));
}
b1 = getUnsignedByte(byteBuffer, j);
b2 = getUnsignedByte(byteBuffer, j + 1);
b3 = getUnsignedByte(byteBuffer, j + 2);
b4 = getUnsignedByte(byteBuffer, j + 3);
if (dataEndianess) {
tmpInt = ( (b1 << 24) | (b2 << 16) | (b3 << 8) | b4); // Big Endian
} else {
tmpInt = ( (b4 << 24) | (b3 << 16) | (b2 << 8) | b1); // Little Endian
}
bufferR[i] = Float.intBitsToFloat(tmpInt);
b1 = getUnsignedByte(byteBuffer, j + 4);
b2 = getUnsignedByte(byteBuffer, j + 5);
b3 = getUnsignedByte(byteBuffer, j + 6);
b4 = getUnsignedByte(byteBuffer, j + 7);
if (dataEndianess) {
tmpInt = ( (b1 << 24) | (b2 << 16) | (b3 << 8) | b4); // Big Endian
} else {
tmpInt = ( (b4 << 24) | (b3 << 16) | (b2 << 8) | b1); // Little Endian
}
bufferI[i] = Float.intBitsToFloat(tmpInt);
} // for (j =0; j < nBytes; j+=8, i++ )
}
/**
* Reads a slice of data at a time and stores the results in the buffer.
*
* @param slice offset into the file stored in the dataOffset array
* @param buffer buffer where the info is stored
*
* @exception IOException if there is an error reading the file
*/
private void readDBuffer(final int slice, final double[] buffer) throws IOException {
int i = 0;
int j;
int nBytes;
long b1, b2, b3, b4, b5, b6, b7, b8;
byte[] byteBuffer;
int progress, progressLength, mod;
long tmpLong;
byteBuffer = new byte[8 * buffer.length];
nBytes = 8 * buffer.length;
raFile.read(byteBuffer, 0, nBytes);
progress = slice * buffer.length;
progressLength = buffer.length * numberSlices;
mod = progressLength / 10;
for (j = 0; j < nBytes; j += 8, i++) {
if ( ( (i + progress) % mod) == 0) {
fireProgressStateChanged(Math.round((float) (i + progress) / progressLength * 100));
}
b1 = getUnsignedByte(byteBuffer, j);
b2 = getUnsignedByte(byteBuffer, j + 1);
b3 = getUnsignedByte(byteBuffer, j + 2);
b4 = getUnsignedByte(byteBuffer, j + 3);
b5 = getUnsignedByte(byteBuffer, j + 4);
b6 = getUnsignedByte(byteBuffer, j + 5);
b7 = getUnsignedByte(byteBuffer, j + 6);
b8 = getUnsignedByte(byteBuffer, j + 7);
if (dataEndianess) {
tmpLong = ( (b1 << 56) | (b2 << 48) | (b3 << 40) | (b4 << 32) | (b5 << 24) | (b6 << 16) | (b7 << 8) | b8); // Big
// Endian
} else {
tmpLong = ( (b8 << 56) | (b7 << 48) | (b6 << 40) | (b5 << 32) | (b4 << 24) | (b3 << 16) | (b2 << 8) | b1); // Little
// Endian
}
buffer[i] = Double.longBitsToDouble(tmpLong);
} // for (j =0; j < nBytes; j+=8, i++ )
}
/**
* Reads a slice of data at a time and stores the results in the buffer.
*
* @param slice offset into the file stored in the dataOffset array
* @param bufferR buffer where the real info is stored
* @param bufferI buffer where the imaginary info is stored
*
* @exception IOException if there is an error reading the file
*/
private void readDComplexBuffer(final int slice, final double[] bufferR, final double[] bufferI) throws IOException {
int i = 0;
int j;
int nBytes;
long b1, b2, b3, b4, b5, b6, b7, b8;
byte[] byteBuffer;
int progress, progressLength, mod;
long tmpLong;
nBytes = 16 * bufferR.length;
byteBuffer = new byte[nBytes];
raFile.read(byteBuffer, 0, nBytes);
progress = slice * bufferR.length;
progressLength = bufferR.length * numberSlices;
mod = progressLength / 10;
for (j = 0; j < nBytes; j += 16, i++) {
if ( ( (i + progress) % mod) == 0) {
fireProgressStateChanged(Math.round((float) (i + progress) / progressLength * 100));
}
b1 = getUnsignedByte(byteBuffer, j);
b2 = getUnsignedByte(byteBuffer, j + 1);
b3 = getUnsignedByte(byteBuffer, j + 2);
b4 = getUnsignedByte(byteBuffer, j + 3);
b5 = getUnsignedByte(byteBuffer, j + 4);
b6 = getUnsignedByte(byteBuffer, j + 5);
b7 = getUnsignedByte(byteBuffer, j + 6);
b8 = getUnsignedByte(byteBuffer, j + 7);
if (dataEndianess) {
tmpLong = ( (b1 << 56) | (b2 << 48) | (b3 << 40) | (b4 << 32) | (b5 << 24) | (b6 << 16) | (b7 << 8) | b8); // Big
// Endian
} else {
tmpLong = ( (b8 << 56) | (b7 << 48) | (b6 << 40) | (b5 << 32) | (b4 << 24) | (b3 << 16) | (b2 << 8) | b1); // Little
// Endian
}
bufferR[i] = Double.longBitsToDouble(tmpLong);
b1 = getUnsignedByte(byteBuffer, j + 8);
b2 = getUnsignedByte(byteBuffer, j + 9);
b3 = getUnsignedByte(byteBuffer, j + 10);
b4 = getUnsignedByte(byteBuffer, j + 11);
b5 = getUnsignedByte(byteBuffer, j + 12);
b6 = getUnsignedByte(byteBuffer, j + 13);
b7 = getUnsignedByte(byteBuffer, j + 14);
b8 = getUnsignedByte(byteBuffer, j + 15);
if (dataEndianess) {
tmpLong = ( (b1 << 56) | (b2 << 48) | (b3 << 40) | (b4 << 32) | (b5 << 24) | (b6 << 16) | (b7 << 8) | b8); // Big
// Endian
} else {
tmpLong = ( (b8 << 56) | (b7 << 48) | (b6 << 40) | (b5 << 32) | (b4 << 24) | (b3 << 16) | (b2 << 8) | b1); // Little
// Endian
}
bufferI[i] = Double.longBitsToDouble(tmpLong);
} // for (j =0; j < nBytes; j+=16, i++ )
}
/**
* Reads a slice of data at a time and stores the results in the buffer.
*
* @param slice offset into the file stored in the dataOffset array
* @param buffer buffer where the info is stored
*
* @exception IOException if there is an error reading the file
*/
private void readLBuffer(final int slice, final long[] buffer) throws IOException {
int i = 0;
int j;
int nBytes;
long b1, b2, b3, b4, b5, b6, b7, b8;
byte[] byteBuffer;
int progress, progressLength, mod;
if (sourceType == ModelStorageBase.UINTEGER) { // reading 4 byte unsigned integers
byteBuffer = new byte[4 * buffer.length];
nBytes = 4 * buffer.length;
raFile.read(byteBuffer, 0, nBytes);
progress = slice * buffer.length;
progressLength = buffer.length * numberSlices;
mod = progressLength / 10;
for (j = 0; j < nBytes; j += 4, i++) {
if ( ( (i + progress) % mod) == 0) {
fireProgressStateChanged(Math.round((float) (i + progress) / progressLength * 100));
}
b1 = getUnsignedByte(byteBuffer, j);
b2 = getUnsignedByte(byteBuffer, j + 1);
b3 = getUnsignedByte(byteBuffer, j + 2);
b4 = getUnsignedByte(byteBuffer, j + 3);
if (dataEndianess) {
buffer[i] = ( (b1 << 24) | (b2 << 16) | (b3 << 8) | b4) & 0xffffffffL;
} else {
buffer[i] = ( (b4 << 24) | (b3 << 16) | (b2 << 8) | b1) & 0xffffffffL;
}
} // for (j =0; j < nBytes; j+=4, i++ )
} // if (type == ModelStorageBase.UINTEGER)
else { // reading 8 byte LONGS
byteBuffer = new byte[8 * buffer.length];
nBytes = 8 * buffer.length;
raFile.read(byteBuffer, 0, nBytes);
progress = slice * buffer.length;
progressLength = buffer.length * numberSlices;
mod = progressLength / 10;
for (j = 0; j < nBytes; j += 8, i++) {
if ( ( (i + progress) % mod) == 0) {
fireProgressStateChanged(Math.round((float) (i + progress) / progressLength * 100));
}
b1 = getUnsignedByte(byteBuffer, j);
b2 = getUnsignedByte(byteBuffer, j + 1);
b3 = getUnsignedByte(byteBuffer, j + 2);
b4 = getUnsignedByte(byteBuffer, j + 3);
b5 = getUnsignedByte(byteBuffer, j + 4);
b6 = getUnsignedByte(byteBuffer, j + 5);
b7 = getUnsignedByte(byteBuffer, j + 6);
b8 = getUnsignedByte(byteBuffer, j + 7);
if (dataEndianess) {
buffer[i] = ( (b1 << 56) | (b2 << 48) | (b3 << 40) | (b4 << 32) | (b5 << 24) | (b6 << 16)
| (b7 << 8) | b8); // Big Endian
} else {
buffer[i] = ( (b8 << 56) | (b7 << 48) | (b6 << 40) | (b5 << 32) | (b4 << 24) | (b3 << 16)
| (b2 << 8) | b1); // Little Endian
}
} // for (j =0; j < nBytes; j+=8, i++ )
} // else reading 8 byte integers
}
/**
* DOCUMENT ME!
*
* @param index DOCUMENT ME!
* @param encodedType DOCUMENT ME!
*
* @throws IOException DOCUMENT ME!
*/
private void readSimpleData(final int index, final int encodedType) throws IOException {
final byte[] dataByte = new byte[1];
int dataShort;
int dataInt;
long dataUInt;
float dataFloat;
double dataDouble;
String s;
try {
switch (encodedType) {
case BOOLEAN:
Preferences.debug("Data is 1 boolean = ");
break;
case CHAR:
Preferences.debug("Data is 1 char = ");
break;
case OCTET:
Preferences.debug("Data is 1 octet = ");
break;
case SHORT:
Preferences.debug("Data is 1 short = ");
break;
case USHORT:
Preferences.debug("Data is 1 USHORT = ");
break;
case LONG:
Preferences.debug("Data is 1 long = ");
break;
case ULONG:
Preferences.debug("Data is 1 ULONG = ");
break;
case FLOAT:
Preferences.debug("Data is 1 FLOAT = ");
break;
case DOUBLE:
Preferences.debug("Data is 1 DOUBLE = ");
break;
default:
Preferences.debug("Illegal encoded data type = " + encodedType + "\n");
MipavUtil.displayError("Illegal encoded data type");
throw new IOException();
}
if ( (encodedType == FileDM3.BOOLEAN) || (encodedType == FileDM3.CHAR) || (encodedType == FileDM3.OCTET)) {
dataByte[0] = raFile.readByte();
if (encodedType == FileDM3.CHAR) {
s = new String(dataByte);
Preferences.debug(s + "\n");
} else {
Preferences.debug(dataByte[0] + "\n");
}
} // if ((encodedType == BOOLEAN) || (encodedType == CHAR) || (encodedType == OCTET))
else if (encodedType == FileDM3.SHORT) {
dataShort = getSignedShort(dataEndianess);
Preferences.debug(dataShort + "\n");
} else if (encodedType == FileDM3.USHORT) {
dataShort = getSignedShort(dataEndianess);
Preferences.debug(dataShort + "\n");
} else if (encodedType == FileDM3.LONG) {
dataInt = getInt(dataEndianess);
Preferences.debug(dataInt + "\n");
if ( (isImageData) && (isDimensions)) {
dimArray[imageNum][index] = dataInt;
} else if ( (isImageData) && (isDataType)) {
dataTypeArray[imageNum] = dataInt;
isDataType = false;
}
} else if (encodedType == FileDM3.ULONG) {
dataUInt = getUInt(dataEndianess);
Preferences.debug(dataUInt + "\n");
if ( (isImageData) && (isDimensions)) {
dimArray[imageNum][index] = (int) dataUInt;
} else if ( (isImageData) && (isDataType)) {
dataTypeArray[imageNum] = (int) dataUInt;
isDataType = false;
}
} else if (encodedType == FileDM3.FLOAT) {
dataFloat = getFloat(dataEndianess);
Preferences.debug(dataFloat + "\n");
if ( (isImageData) && (isCalibrations) && (isDimension) && (isScale)) {
Preferences.debug("About to set pixelScaleArray[" + imageNum + "][" + scaleIndex + "]\n");
pixelScaleArray[imageNum][scaleIndex++] = dataFloat;
isScale = false;
}
} else if (encodedType == FileDM3.DOUBLE) {
dataDouble = getDouble(dataEndianess);
Preferences.debug(dataDouble + "\n");
}
} catch (final Exception e) {
if (image != null) {
image.disposeLocal();
image = null;
}
System.gc();
raFile.close();
throw new IOException();
}
}
/**
* DOCUMENT ME!
*
* @throws IOException DOCUMENT ME!
*/
private void readString() throws IOException {
int stringSize;
byte[] buffer;
String dataString;
try {
stringSize = getInt(endianess);
buffer = new byte[stringSize];
raFile.read(buffer, 0, stringSize);
if (dataEndianess) {
dataString = new String(buffer, "UTF-16BE");
} else {
dataString = new String(buffer, "UTF-16LE");
}
Preferences.debug(dataString + "\n");
} catch (final Exception e) {
if (image != null) {
image.disposeLocal();
image = null;
}
System.gc();
raFile.close();
throw new IOException();
}
}
/**
* DOCUMENT ME!
*
* @throws IOException DOCUMENT ME!
*/
private void readStruct() throws IOException {
int fieldNum;
int[] fieldType;
int i;
try {
getInt(endianess);
fieldNum = getInt(endianess);
fieldType = new int[fieldNum];
for (i = 0; i < fieldNum; i++) {
getInt(endianess);
fieldType[i] = getInt(endianess);
}
for (i = 0; i < fieldNum; i++) {
readSimpleData(i, fieldType[i]);
}
} catch (final Exception e) {
if (image != null) {
image.disposeLocal();
image = null;
}
System.gc();
raFile.close();
throw new IOException();
}
}
/**
* DOCUMENT ME!
*
* @return DOCUMENT ME!
*
* @throws IOException DOCUMENT ME!
*/
private int[] readStructTypes() throws IOException {
int fieldNum;
int[] fieldType;
int i;
try {
getInt(endianess);
fieldNum = getInt(endianess);
fieldType = new int[fieldNum];
for (i = 0; i < fieldNum; i++) {
getInt(endianess);
fieldType[i] = getInt(endianess);
}
return fieldType;
} catch (final Exception e) {
if (image != null) {
image.disposeLocal();
image = null;
}
System.gc();
raFile.close();
throw new IOException();
}
}
/**
* DOCUMENT ME!
*
* @param index DOCUMENT ME!
*
* @throws IOException DOCUMENT ME!
*/
private void readTagEntry(final int index) throws IOException {
final int i;
byte dataByte;
int entryStringLength;
String entryString;
routineTagEntry++;
int calibrationsEntry = -1;
int dimensionEntry = -1;
int imageDataEntry = -1;
try {
dataByte = raFile.readByte();
if (dataByte == 21) {
Preferences.debug("Tag entry byte indicates data\n");
} else if (dataByte == 20) {
Preferences.debug("Tag entry byte indicates another tag group\n");
} else {
Preferences.debug("Tag entry byte is an illegal = " + isData + "\n");
MipavUtil.displayError("Tag entry byte is an illegal " + isData);
throw new IOException();
}
entryStringLength = getUnsignedShort(endianess);
if (entryStringLength != 0) {
entryString = getString(entryStringLength);
Preferences.debug("Tag label = " + entryString + "\n");
if (entryString.equalsIgnoreCase("ImageData")) {
isImageData = true;
imageDataEntry = routineTagEntry;
imageNum++;
} else if (entryString.equalsIgnoreCase("Dimensions")) {
isDimensions = true;
} else if (entryString.equalsIgnoreCase("Data")) {
isData = true;
} else if (entryString.equalsIgnoreCase("DataType")) {
isDataType = true;
} else if (entryString.equalsIgnoreCase("Calibrations")) {
calibrationsEntry = routineTagEntry;
isCalibrations = true;
} else if (entryString.equalsIgnoreCase("Dimension")) {
isDimension = true;
dimensionEntry = routineTagEntry;
scaleIndex = 0;
unitsIndex = 0;
} else if (entryString.equalsIgnoreCase("Scale")) {
isScale = true;
} else if (entryString.equalsIgnoreCase("Units")) {
isUnits = true;
}
}
if (dataByte == 21) {
readTagType(index);
} else {
readTagGroup();
}
if (imageDataEntry == routineTagEntry) {
isImageData = false;
} else if (calibrationsEntry == routineTagEntry) {
isCalibrations = false;
} else if (dimensionEntry == routineTagEntry) {
isDimension = false;
}
} catch (final Exception e) {
if (image != null) {
image.disposeLocal();
image = null;
}
System.gc();
raFile.close();
throw new IOException();
}
}
/**
* DOCUMENT ME!
*
* @throws IOException DOCUMENT ME!
*/
private void readTagGroup() throws IOException {
int i;
int tagEntries;
byte groupSorted;
byte groupOpen;
int dimensionsEntry = -1;
routineTagGroup++;
try {
groupSorted = raFile.readByte();
Preferences.debug("Group sorted = " + groupSorted + "\n");
groupOpen = raFile.readByte();
Preferences.debug("Group open = " + groupOpen + "\n");
tagEntries = getInt(endianess);
Preferences.debug("Number of tag entries = " + tagEntries + "\n");
if (isDimensions) {
dimensionsEntry = routineTagGroup;
numDimArray[imageNum] = tagEntries;
}
for (i = 0; i < tagEntries; i++) {
Preferences.debug("Reading tag entry " + (i + 1) + " of " + tagEntries + " in this group\n");
readTagEntry(i);
}
if (dimensionsEntry == routineTagGroup) {
isDimensions = false;
}
} catch (final Exception e) {
if (image != null) {
image.disposeLocal();
image = null;
}
System.gc();
raFile.close();
throw new IOException();
}
} // private void readTagGroup
/**
* DOCUMENT ME!
*
* @param index DOCUMENT ME!
*
* @throws IOException DOCUMENT ME!
*/
private void readTagType(final int index) throws IOException {
String delimString;
int encodedType;
final byte[] dataByte = new byte[1];
final int dataShort;
final int dataInt;
final long dataUInt;
final float dataFloat;
final double dataDouble;
final String s;
try {
delimString = getString(4);
// The first 4 bytes should always be %%%%
if ( !delimString.equals("%%%%")) {
Preferences.debug("delimString is an illegal = " + delimString + "|n");
MipavUtil.displayError("Illegal delimiter string");
throw new IOException();
}
// Ignore
getInt(endianess);
encodedType = getInt(endianess);
if ( (encodedType != FileDM3.STRING) && (encodedType != FileDM3.ARRAY) && (encodedType != FileDM3.STRUCT)) {
readSimpleData(index, encodedType);
return;
}
switch (encodedType) {
case STRING:
Preferences.debug("Data is STRING\n");
readString();
break;
case STRUCT:
Preferences.debug("Data is STRUCT\n");
readStruct();
break;
case ARRAY:
Preferences.debug("Data is ARRAY\n");
readArray();
break;
default:
Preferences.debug("Illegal encoded data type = " + encodedType + "\n");
MipavUtil.displayError("Illegal encoded data type");
throw new IOException();
}
} catch (final Exception e) {
if (image != null) {
image.disposeLocal();
image = null;
}
System.gc();
raFile.close();
throw new IOException();
}
}
}
| [
"mccreedy@NIH.GOV@ba61647d-9d00-f842-95cd-605cb4296b96"
] | mccreedy@NIH.GOV@ba61647d-9d00-f842-95cd-605cb4296b96 |
c9d6c36ad2a0f70f436cf1bce9c6e7e991853a31 | 7b3e25fddcc4db6f3bd32b824cea91ee32300460 | /workspace/MoviesData/src/com/lee/movieBeans/rtInfo/ReviewLinks.java | 6aa78bc15bb7335562c150815958a68dbb3c8cd4 | [] | no_license | UncleLeeee/movieGetter | 77a15bc94e762044f12457229476d32da05494ac | 80844367746301fa9ace6892d5328d4610992e60 | refs/heads/master | 2021-01-01T17:31:41.384201 | 2013-05-16T18:17:49 | 2013-05-16T18:17:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 261 | java | package com.lee.movieBeans.rtInfo;
import java.io.Serializable;
public class ReviewLinks implements Serializable{
private String review;
public String getReview() {
return review;
}
public void setReview(String review) {
this.review = review;
}
} | [
"unclelee@master.(none)"
] | unclelee@master.(none) |
8fcb46cb9a9762ebe5e2d337b1499bdfb028183e | 9cc4f028a5727456b84ec0d0e60aef75abaf0377 | /gson/test/org/immutables/gson/adapter/ExpectedSubtypesAdapterTest.java | 391a68b26be30c03df3078da277c476b59144739 | [
"Apache-2.0"
] | permissive | anuraaga/immutables | 6a3bdfe1deb7b244f12de96f4991998a1b80cb72 | 2a1792afa77634990d0b9a7d1dfd3e1c5c8ea5f9 | refs/heads/master | 2021-01-20T01:36:11.400712 | 2017-02-05T20:47:26 | 2017-02-05T20:47:26 | 83,807,433 | 1 | 0 | Apache-2.0 | 2019-03-05T05:05:06 | 2017-03-03T14:37:09 | Java | UTF-8 | Java | false | false | 2,158 | java | /*
Copyright 2015 Immutables Authors and Contributors
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.immutables.gson.adapter;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonParseException;
import com.google.gson.JsonPrimitive;
import com.google.gson.reflect.TypeToken;
import org.junit.Test;
import static org.immutables.check.Checkers.*;
public class ExpectedSubtypesAdapterTest {
final TypeToken<Long> longType = TypeToken.get(Long.class);
final TypeToken<Boolean> booleanType = TypeToken.get(Boolean.class);
final TypeToken<Object> objectType = TypeToken.get(Object.class);
final Gson gson = new Gson();
@Test
public void readSubtype() {
Gson gson = new Gson();
ExpectedSubtypesAdapter<Object> subtypesAdaper =
ExpectedSubtypesAdapter.create(gson, objectType, longType, booleanType);
check(subtypesAdaper.fromJsonTree(new JsonPrimitive(true))).is(true);
check(subtypesAdaper.fromJsonTree(new JsonPrimitive(111))).is(111L);
}
@Test
public void writeSubtype() {
Gson gson = new Gson();
ExpectedSubtypesAdapter<Object> subtypesAdaper =
ExpectedSubtypesAdapter.create(gson, objectType, longType, booleanType);
check(subtypesAdaper.toJsonTree(true)).is(new JsonPrimitive(true));
check(subtypesAdaper.toJsonTree(111L)).is(new JsonPrimitive(111L));
}
@Test(expected = JsonParseException.class)
public void failSubtype() {
ExpectedSubtypesAdapter<Object> subtypesAdaper =
ExpectedSubtypesAdapter.create(gson, objectType, longType, booleanType);
subtypesAdaper.fromJsonTree(new JsonArray());
}
}
| [
"e.lucash@gmail.com"
] | e.lucash@gmail.com |
2d57c515b48c513bd5b81bf85cbb5ded871fc1e7 | 55c99028cf4b436766adbe066a07413daa39bb84 | /src/main/java/com/cruise/thinking/in/concurrency/threadstate/State3.java | 15565f5bff8c71ef60556d2aac6f400647a1b7d6 | [] | no_license | Cruise-cat/thinking-in-concurrency | b2e774c0b3d9f7c2bbb8ad0056e326c3fa1d0e8c | bf850f2e46cdc06365657623bf049c729bbc7d08 | refs/heads/master | 2022-11-28T00:59:36.622974 | 2020-08-11T14:08:51 | 2020-08-11T14:08:51 | 279,506,721 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 953 | java | package com.cruise.thinking.in.concurrency.threadstate;
/**
* 验证线程的 BLOCKED 状态
*
* @author Cruise
* @version 1.0
* @see Thread.State
* @since 2020/7/18
*/
public class State3 {
public static void main(String[] args){
MyService myThread = new MyService();
Thread t1 = new Thread(() -> myThread.test());
Thread t2 = new Thread(() -> myThread.test());
t1.start();
t2.start();
// RUNNABLE
System.out.println("main 方法 t1 中的状态 " + t1.getState());
// BLOCKED
System.out.println("main 方法 t2 中的状态 " + t2.getState());
}
private static class MyService {
public synchronized void test() {
try {
System.out.println("线程 " + Thread.currentThread().getName() + "进入方法");
Thread.sleep(6000);
} catch (InterruptedException e) {
}
}
}
}
| [
"517552705@qq.com"
] | 517552705@qq.com |
9bfaf43e48411587baeade35018a62cb8084a792 | 3a3528c152130b6b31e2dd28f74643ec32686328 | /src/main/java/com/web/StudentServ.java | 2ee883ab20ed132a5931c6ca3c0609146a84d9e7 | [] | no_license | mcvrvikram/LearnersAcademy | ac8fa19ee3b5c17b2e042a88fad641177387af92 | 697ba3b496135831d5032852aa6ce4e3c1ae3f22 | refs/heads/main | 2023-06-25T08:01:53.355780 | 2021-08-01T15:12:36 | 2021-08-01T15:12:36 | 391,630,611 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,627 | java | package com.web;
import java.io.IOException;
import java.sql.SQLException;
import java.time.LocalDate;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.bean.Address;
import com.bean.ClassTable;
import com.bean.Student;
import com.dao.ClassDao;
import com.dao.StudentDao;
/**
* Servlet implementation class StudentServ
*/
@WebServlet(urlPatterns = {"/snew","/sedit","/sinsert","/sdelete","/supdate","/slist","/student-list"})
public class StudentServ extends HttpServlet {
private static final long serialVersionUID = 1L;
private StudentDao studentDao;
/**
* @see HttpServlet#HttpServlet()
*/
public StudentServ() {
super();
// TODO Auto-generated constructor stub
}
public void init() {
System.out.println("Inside student");
studentDao = new StudentDao();
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String action = request.getServletPath();
System.out.println("Servlet path "+action);
try {
switch (action) {
case "/snew":
showNewForm(request, response);
break;
case "/sinsert":
insertStudent(request, response);
break;
case "/sdelete":
deleteStudent(request, response);
break;
case "/sedit":
showEditForm(request, response);
break;
case "/supdate":
updateStudent(request, response);
break;
default:
listStudent(request, response);
break;
}
} catch (SQLException ex) {
throw new ServletException(ex);
}
}
private void listStudent(HttpServletRequest request, HttpServletResponse response)
throws SQLException, IOException, ServletException {
List<Student> listStudent = studentDao.showAllStudents();
request.setAttribute("listStudent", listStudent);
RequestDispatcher dispatcher = request.getRequestDispatcher("student-list.jsp");
dispatcher.forward(request, response);
}
private void showNewForm(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
ClassDao classaDao = new ClassDao();
List<ClassTable> listclass = classaDao.showAllClasses();
request.setAttribute("listClass", listclass);
RequestDispatcher dispatcher = request.getRequestDispatcher("student.jsp");
dispatcher.forward(request, response);
}
private void showEditForm(HttpServletRequest request, HttpServletResponse response)
throws SQLException, ServletException, IOException {
int id = Integer.parseInt(request.getParameter("id"));
Student existingStudent = studentDao.selectStudent(id);
ClassDao classaDao = new ClassDao();
List<ClassTable> listclass = classaDao.showAllClasses();
request.setAttribute("listClass", listclass);
RequestDispatcher dispatcher = request.getRequestDispatcher("student.jsp");
request.setAttribute("student", existingStudent);
dispatcher.forward(request, response);
}
private void insertStudent(HttpServletRequest request, HttpServletResponse response)
throws SQLException, IOException,NumberFormatException {
Address address = new Address();
Student student = new Student();
student.setFname(request.getParameter("fname"));
student.setLname(request.getParameter("lname"));
student.setDob(LocalDate.parse(request.getParameter("dob")));
student.setPhone(request.getParameter("phone"));
int cid = Integer.parseInt(request.getParameter("class"));
ClassTable newClass = new ClassTable();
newClass.setCid(cid);
System.out.println("inside insert");
// address.setD_no(request.getParameter("dno"));
//
address.setStreet(request.getParameter("street"));
// address.setCity(request.getParameter("city"));
// address.setZipcode(request.getParameter("zipcode"));
// address.setState(request.getParameter("state"));
student.setAddress(address);
studentDao.addStudent(student,newClass);
response.sendRedirect("student-list");
}
private void updateStudent(HttpServletRequest request, HttpServletResponse response)
throws SQLException, IOException,NumberFormatException {
Address address = new Address();
Student student = new Student();
student.setFname(request.getParameter("fname"));
student.setLname(request.getParameter("lname"));
student.setDob(LocalDate.parse(request.getParameter("dob")));
student.setPhone(request.getParameter("phone"));
int id = Integer.parseInt(request.getParameter("id"));
student.setId(id);
// address.setD_no(request.getParameter("dno"));
address.setStreet(request.getParameter("street"));
int cid = Integer.parseInt(request.getParameter("class"));
ClassTable newClass = new ClassTable();
newClass.setCid(cid);
// address.setCity(request.getParameter("city"));
// address.setZipcode(request.getParameter("zipcode"));
// address.setState(request.getParameter("state"));
student.setAddress(address);
studentDao.updateStudent(student,newClass);
response.sendRedirect("student-list");
}
private void deleteStudent(HttpServletRequest request, HttpServletResponse response)
throws SQLException, IOException {
int id = Integer.parseInt(request.getParameter("id"));
Student student = new Student();
student.setId(id);
studentDao.deleteStudent(student);
response.sendRedirect("student-list");
}
}
| [
"vikrammcreddy@gmail.com"
] | vikrammcreddy@gmail.com |
2dcf6ba04eb024dab9af3a66f98f14d388f33963 | ab8d50664a05c7d444c9335af99a8484f0d61729 | /src/main/java/com/json/web/vo/CoronavirusVO.java | 91d9edbdfbfa6c3accada6b7c82ef9f3701525e5 | [] | no_license | zhihuiwang88/jsonsecurityadministration | ec1878903b66aa949add6b0cc173218168cecf20 | ba05ad96f88bad7db600a570ed72ca8e8c1bd3ae | refs/heads/master | 2022-12-21T01:17:04.099634 | 2020-03-20T10:43:48 | 2020-03-20T10:43:48 | 248,729,813 | 0 | 1 | null | 2022-12-16T10:42:33 | 2020-03-20T10:37:41 | Java | UTF-8 | Java | false | false | 508 | java | package com.json.web.vo;
public class CoronavirusVO {
private String staffCode;
private String devId;
private String appCode;
public String getStaffCode() {
return staffCode;
}
public void setStaffCode(String staffCode) {
this.staffCode = staffCode;
}
public String getDevId() {
return devId;
}
public void setDevId(String devId) {
this.devId = devId;
}
public String getAppCode() {
return appCode;
}
public void setAppCode(String appCode) {
this.appCode = appCode;
}
}
| [
"test01@test01.com"
] | test01@test01.com |
541e3225b98a344da18372c82fc9d7dd3f6a40b6 | 664593c572ca64a5ca557f6b8273b14ef3c8e925 | /CorComponentIM/src/main/java/com/xsimple/im/event/RouterMsgEvent.java | 9eefb98f234ce3bebd4d495b720f019eabb6ffe1 | [] | no_license | huangljCSDN/android-s-plan | 44bb4a75e33d1ea44e108e2ee316bad24458d4c3 | 0f71e00fa3207ef48bb4d8234ec61d58e91717a0 | refs/heads/master | 2020-03-31T13:40:31.519130 | 2019-03-06T06:24:27 | 2019-03-06T06:24:27 | 152,264,676 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 476 | java | package com.xsimple.im.event;
import com.networkengine.event.BaseEventBusAction;
/**
* Created by liuhao on 2018/5/10.
*/
public class RouterMsgEvent extends BaseEventBusAction {
private String localMsgId;
public RouterMsgEvent(String localMsgId) {
this.localMsgId = localMsgId;
}
public String getLocalMsgId() {
return localMsgId;
}
public void setLocalMsgId(String localMsgId) {
this.localMsgId = localMsgId;
}
}
| [
"lingjunhuang@snsshop.net"
] | lingjunhuang@snsshop.net |
f50458ccf3f2e828e4bf5681483fb616150cdd4f | a412be89bcc023acabee8154958e0e299239bb1e | /src/main/java/lk/wid/model/Category.java | 5bfc9e2ec68d79e2a0fb662683ee1103c23dd6d3 | [] | no_license | lkwid/qwejk | a6834c53b07bb8289173233477a530ddec30b73e | 5bfe25c1b7e4b77d396c38e5380cdec25c2f5fe9 | refs/heads/master | 2020-12-31T07:41:44.010763 | 2017-02-10T21:15:18 | 2017-02-10T21:15:18 | 80,545,875 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 669 | java | package lk.wid.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public class Category {
@Id
@GeneratedValue
private int id;
private String name;
public Category(int id, String name) {
this.id = id;
this.name = name;
}
public Category(String name) {
this.name = name;
}
public Category() {};
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"lk.widawski@gmail.com"
] | lk.widawski@gmail.com |
b45e4763a3b90105c910e0e2de41f236eb54c04c | ea93aeefe5d8550d21999281721852584994f0f6 | /HelloServlet/src/MySQLServlet.java | 2779a08ab13b0d6510be525b3d2b139a624ca5d6 | [] | no_license | D1097/workspace | 4ce532915375c41402b0525822fb3698907ab984 | 59a59f7513a94501f8f9be374a5b571d0cc403e1 | refs/heads/master | 2020-05-25T05:49:19.904204 | 2019-07-31T12:26:12 | 2019-07-31T12:26:12 | 187,656,793 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,121 | java |
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/MySQLServlet")
public class MySQLServlet extends HttpServlet {
public MySQLServlet() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=UTF-8");
PrintWriter out=response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>データベーステスト</title>");
out.println("</head>");
out.println("<body>");
Connection conn=null;
String url="jdbc:mysql://localhost/testdb";
String user="root";
String password="root";
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn=DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement();
String sql="select * from test_table";
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()){
int userID=rs.getInt("user_id");
String userName=rs.getString("user_name");
String userPassword=rs.getString("password");
out.println("<p>");
out.println("ユーザーID:"+userID+",ユーザー名:"+userName+",パスワード:"+userPassword);
out.println("</p>");
}
rs.close();
stmt.close();
}catch (ClassNotFoundException e){
out.println("ClassNotFoundException:"+ e.getMessage());
}catch (SQLException e){
out.println("SQLException:"+e.getMessage());
}catch (Exception e){
out.println("Exception:"+e.getMessage());
}finally{
try{
if(conn!=null){
conn.close();
}
}catch (SQLException e){
out.println("SQLException"+e.getMessage());
}
}
out.println("</body>");
out.println("</html>");
}
}
| [
"itoito761@gmail.com"
] | itoito761@gmail.com |
48865679cb3cd96e99345afed38344c110527b1b | 6a276b2769d1eec689566d21e485799de78cc922 | /src/techquiz/gui/EditQuestionsFrame.java | e1fc8f7768590293db2194da2f11d4fc35418a37 | [] | no_license | shubham-manmohan/quizapplication | c2870b42c47e68b5f8872c1a26413f044e190cf1 | ec5447e2043d519846b279dc11597aef0528a24c | refs/heads/master | 2023-06-06T20:24:27.266904 | 2021-07-15T17:26:19 | 2021-07-15T17:26:19 | 386,367,707 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 26,544 | 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 techquiz.gui;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Font;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;
import javax.swing.JOptionPane;
import techquiz.dao.QuestionDAO;
import techquiz.pojo.ExamPOJO;
import techquiz.pojo.QuestionPOJO;
import techquiz.pojo.QuestionsStore;
import techquiz.pojo.UserProfile;
/**
*
* @author SHUBHAM MANMOHAN
*/
public class EditQuestionsFrame extends javax.swing.JFrame {
private ExamPOJO editExam;
private QuestionsStore questionStore;
private int pos=0;
private HashMap<String,String> options;
private int qno;
private String question,option1,option2,option3,option4,correctOption;
/**
* Creates new form EditQuestionsFrame
*/
public EditQuestionsFrame(ExamPOJO editExam){
this();
this.editExam=editExam;
lblTitle.setText("EDITING "+editExam.getSubject().toUpperCase()+" PAPER");
loadQuestions();
showQuestion();
}
public EditQuestionsFrame() {
this.setTitle("Edit Questions - "+"OnlineTechQuizApp");
initComponents();
this.setLocationRelativeTo(null);
lblUser.setText("Hello "+UserProfile.getUserName());
questionStore=new QuestionsStore();
options=new HashMap<>();
options.put("Option 1", "Answer1");
options.put("Option 2", "Answer2");
options.put("Option 3", "Answer3");
options.put("Option 4", "Answer4");
qno=1;
lblQuestionNo.setText(lblQuestionNo.getText()+" "+qno);
}
/**
* 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() {
editQuestionsPanel = new javax.swing.JPanel();
lblImage = new javax.swing.JLabel();
lblUser = new javax.swing.JLabel();
lblLogout = new javax.swing.JLabel();
lblTitle = new javax.swing.JLabel();
lblQuestionNo = new javax.swing.JLabel();
lblOption1 = new javax.swing.JLabel();
lblOption2 = new javax.swing.JLabel();
lblOption3 = new javax.swing.JLabel();
lblOption4 = new javax.swing.JLabel();
lblCorrectOption = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
txtQuestion = new javax.swing.JTextArea();
txtAnswer1 = new javax.swing.JTextField();
txtAnswer2 = new javax.swing.JTextField();
txtAnswer3 = new javax.swing.JTextField();
txtAnswer4 = new javax.swing.JTextField();
jcbCorrectOption = new javax.swing.JComboBox();
btnNext = new javax.swing.JButton();
btnCancel = new javax.swing.JButton();
btnDone = new javax.swing.JButton();
btnPrevious = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
setResizable(false);
editQuestionsPanel.setBackground(new java.awt.Color(0, 102, 102));
lblImage.setIcon(new javax.swing.ImageIcon(getClass().getResource("/techquiz/gui/appimages/questionpaper4 - Copy.jpg"))); // NOI18N
lblUser.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
lblUser.setForeground(new java.awt.Color(255, 153, 0));
lblUser.setText("Hello");
lblLogout.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
lblLogout.setForeground(new java.awt.Color(255, 153, 0));
lblLogout.setText("Logout");
lblLogout.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
lblLogoutMouseClicked(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
lblLogoutMouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
lblLogoutMouseExited(evt);
}
});
lblTitle.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
lblTitle.setForeground(new java.awt.Color(204, 153, 0));
lblTitle.setText("EDITING PAPER");
lblQuestionNo.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
lblQuestionNo.setForeground(new java.awt.Color(255, 153, 0));
lblQuestionNo.setText("Question no: ");
lblOption1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
lblOption1.setForeground(new java.awt.Color(255, 153, 0));
lblOption1.setText("Option 1");
lblOption2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
lblOption2.setForeground(new java.awt.Color(255, 153, 0));
lblOption2.setText("Option 2");
lblOption3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
lblOption3.setForeground(new java.awt.Color(255, 153, 0));
lblOption3.setText("Option 3");
lblOption4.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
lblOption4.setForeground(new java.awt.Color(255, 153, 0));
lblOption4.setText("Option 4");
lblCorrectOption.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
lblCorrectOption.setForeground(new java.awt.Color(255, 153, 0));
lblCorrectOption.setText("Correct Answer:");
txtQuestion.setColumns(20);
txtQuestion.setRows(5);
jScrollPane1.setViewportView(txtQuestion);
jcbCorrectOption.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jcbCorrectOption.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Option 1", "Option 2", "Option 3", "Option 4" }));
btnNext.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
btnNext.setForeground(new java.awt.Color(102, 51, 0));
btnNext.setText("Next");
btnNext.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnNextActionPerformed(evt);
}
});
btnCancel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
btnCancel.setForeground(new java.awt.Color(102, 51, 0));
btnCancel.setText("Cancel");
btnCancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCancelActionPerformed(evt);
}
});
btnDone.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
btnDone.setForeground(new java.awt.Color(102, 51, 0));
btnDone.setText("Done");
btnDone.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDoneActionPerformed(evt);
}
});
btnPrevious.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
btnPrevious.setForeground(new java.awt.Color(102, 51, 0));
btnPrevious.setText("Previous");
btnPrevious.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnPreviousActionPerformed(evt);
}
});
javax.swing.GroupLayout editQuestionsPanelLayout = new javax.swing.GroupLayout(editQuestionsPanel);
editQuestionsPanel.setLayout(editQuestionsPanelLayout);
editQuestionsPanelLayout.setHorizontalGroup(
editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(editQuestionsPanelLayout.createSequentialGroup()
.addGroup(editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, editQuestionsPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(editQuestionsPanelLayout.createSequentialGroup()
.addComponent(lblUser, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lblLogout))
.addGroup(editQuestionsPanelLayout.createSequentialGroup()
.addComponent(lblQuestionNo)
.addGroup(editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(editQuestionsPanelLayout.createSequentialGroup()
.addGap(330, 330, 330)
.addComponent(lblOption2))
.addGroup(editQuestionsPanelLayout.createSequentialGroup()
.addGap(330, 330, 330)
.addComponent(lblOption4))
.addGroup(editQuestionsPanelLayout.createSequentialGroup()
.addGap(26, 26, 26)
.addGroup(editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblOption1)
.addComponent(lblOption3)
.addGroup(editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 545, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtAnswer4, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(editQuestionsPanelLayout.createSequentialGroup()
.addComponent(btnPrevious)
.addGap(30, 30, 30)
.addComponent(btnNext)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnCancel)
.addGap(31, 31, 31)
.addGroup(editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btnDone)
.addGroup(editQuestionsPanelLayout.createSequentialGroup()
.addComponent(lblCorrectOption)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jcbCorrectOption, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))))
.addGroup(editQuestionsPanelLayout.createSequentialGroup()
.addGap(77, 77, 77)
.addGroup(editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtAnswer3, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtAnswer1, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(txtAnswer2, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(0, 121, Short.MAX_VALUE))))
.addGroup(editQuestionsPanelLayout.createSequentialGroup()
.addGap(277, 277, 277)
.addComponent(lblImage)
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
.addGroup(editQuestionsPanelLayout.createSequentialGroup()
.addGap(235, 235, 235)
.addComponent(lblTitle)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
editQuestionsPanelLayout.setVerticalGroup(
editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(editQuestionsPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblUser)
.addComponent(lblLogout))
.addGap(18, 18, 18)
.addComponent(lblTitle)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(lblImage)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)
.addGroup(editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblQuestionNo))
.addGap(18, 18, 18)
.addGroup(editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblOption1)
.addComponent(lblOption2, javax.swing.GroupLayout.Alignment.TRAILING))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtAnswer1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtAnswer2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(12, 12, 12)
.addGroup(editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblOption4, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(lblOption3))
.addGap(18, 18, 18)
.addGroup(editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtAnswer3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtAnswer4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(33, 33, 33)
.addGroup(editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblCorrectOption)
.addComponent(jcbCorrectOption, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)
.addGroup(editQuestionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnDone)
.addComponent(btnCancel)
.addComponent(btnPrevious)
.addComponent(btnNext))
.addGap(18, 18, 18))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(editQuestionsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(editQuestionsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed
EditPaperFrame editPaper=new EditPaperFrame();
editPaper.setVisible(true);
this.dispose();
}//GEN-LAST:event_btnCancelActionPerformed
private void lblLogoutMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblLogoutMouseClicked
this.dispose();
LoginFrame loginFrame=new LoginFrame();
loginFrame.setVisible(true);
}//GEN-LAST:event_lblLogoutMouseClicked
private void lblLogoutMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblLogoutMouseEntered
lblLogout.setForeground(Color.WHITE);
Font f=new Font("Tahoma",Font.ITALIC,14);
lblLogout.setFont(f);
Cursor c=new Cursor(Cursor.HAND_CURSOR);
lblLogout.setCursor(c);
}//GEN-LAST:event_lblLogoutMouseEntered
private void lblLogoutMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblLogoutMouseExited
lblLogout.setForeground(new Color(255,153,0));
Font f=new Font("Tahoma",Font.BOLD,14);
lblLogout.setFont(f);
}//GEN-LAST:event_lblLogoutMouseExited
private void btnNextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNextActionPerformed
if(!validateInput())
{
JOptionPane.showMessageDialog(null, "Please fill all the input fields","Cannot Add Question!",JOptionPane.ERROR_MESSAGE);
return;
}
String optionName=options.get(correctOption);
QuestionPOJO obj=new QuestionPOJO(editExam.getExamId(),editExam.getSubject(),qno,question,option1,option2,option3,option4,optionName);
System.out.println(obj);
questionStore.removeQuestion(pos);
questionStore.setQuestionAt(pos,obj);
pos++;
if(pos>=questionStore.getCount())
{
JOptionPane.showMessageDialog(null, "Your question set has been successfully updated.\nPress the DONE button to send it to the database ","Exam Added!",JOptionPane.INFORMATION_MESSAGE);
pos=0;
}
showQuestion();
qno++;
if(qno>questionStore.getCount())
qno=1;
lblQuestionNo.setText("Question no:"+qno);
}//GEN-LAST:event_btnNextActionPerformed
private void btnPreviousActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPreviousActionPerformed
if(!validateInput())
{
JOptionPane.showMessageDialog(null, "Please fill all the input fields","Cannot Add Question!",JOptionPane.ERROR_MESSAGE);
return;
}
String optionName=options.get(correctOption);
QuestionPOJO obj=new QuestionPOJO(editExam.getExamId(),editExam.getSubject(),qno,question,option1,option2,option3,option4,optionName);
System.out.println(obj);
questionStore.removeQuestion(pos);
questionStore.setQuestionAt(pos,obj);
pos--;
if(pos<0)
{
JOptionPane.showMessageDialog(null, "Your question set has been successfully updated.\nPress the DONE button to send it to the database ","Exam Added!",JOptionPane.INFORMATION_MESSAGE);
pos=questionStore.getCount()-1;
}
showQuestion();
qno--;
if(qno<=0)
qno=questionStore.getCount();
lblQuestionNo.setText("Question no:"+qno);
}//GEN-LAST:event_btnPreviousActionPerformed
private void btnDoneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDoneActionPerformed
try{
QuestionDAO.updateQuestions(questionStore);
JOptionPane.showMessageDialog(null, "Your question set has been successfully updated in the Database","Exam Added!",JOptionPane.INFORMATION_MESSAGE);
EditPaperFrame paperFrame=new EditPaperFrame();
paperFrame.setVisible(true);
this.dispose();
}
catch(SQLException ex){
JOptionPane.showMessageDialog(null, "Error while connecting to DB!","Exception!",JOptionPane.ERROR_MESSAGE);
ex.printStackTrace();
}
}//GEN-LAST:event_btnDoneActionPerformed
private void loadQuestions(){
try
{
ArrayList <QuestionPOJO> question=QuestionDAO.getQuestionsByExamId(editExam.getExamId());
for(QuestionPOJO q:question)
{
questionStore.addQuestion(q);
}
System.out.println(questionStore);
}
catch(SQLException ex)
{
JOptionPane.showMessageDialog(null, "DB Error!!!","Edit Questions Error!!!",JOptionPane.ERROR_MESSAGE);
ex.printStackTrace();
}
}
private void showQuestion()
{
QuestionPOJO q=questionStore.getQuestion(pos);
txtQuestion.setText(q.getQuestion());
txtAnswer1.setText(q.getAnswer1());
txtAnswer2.setText(q.getAnswer2());
txtAnswer3.setText(q.getAnswer3());
txtAnswer4.setText(q.getAnswer4());
String correct=q.getCorrectAnswer();
String correctOption=getKeyFromValue(correct);
jcbCorrectOption.setSelectedItem(correctOption);
}
private String getKeyFromValue(String value)
{
Set <String> keys=options.keySet();
for(String k:keys)
{
String v=options.get(k);
if(v.equalsIgnoreCase(value))
return k;
}
return null;
}
public boolean validateInput(){
question=txtQuestion.getText().trim();
option1=txtAnswer1.getText().trim();
option2=txtAnswer2.getText().trim();
option3=txtAnswer3.getText().trim();
option4=txtAnswer4.getText().trim();
correctOption=jcbCorrectOption.getSelectedItem().toString();
if(question.isEmpty()||option1.isEmpty()||option2.isEmpty()||option3.isEmpty()||option4.isEmpty()||correctOption.isEmpty())
return false;
else
return true;
}
/**
* @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(EditQuestionsFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(EditQuestionsFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(EditQuestionsFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(EditQuestionsFrame.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 EditQuestionsFrame().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCancel;
private javax.swing.JButton btnDone;
private javax.swing.JButton btnNext;
private javax.swing.JButton btnPrevious;
private javax.swing.JPanel editQuestionsPanel;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JComboBox jcbCorrectOption;
private javax.swing.JLabel lblCorrectOption;
private javax.swing.JLabel lblImage;
private javax.swing.JLabel lblLogout;
private javax.swing.JLabel lblOption1;
private javax.swing.JLabel lblOption2;
private javax.swing.JLabel lblOption3;
private javax.swing.JLabel lblOption4;
private javax.swing.JLabel lblQuestionNo;
private javax.swing.JLabel lblTitle;
private javax.swing.JLabel lblUser;
private javax.swing.JTextField txtAnswer1;
private javax.swing.JTextField txtAnswer2;
private javax.swing.JTextField txtAnswer3;
private javax.swing.JTextField txtAnswer4;
private javax.swing.JTextArea txtQuestion;
// End of variables declaration//GEN-END:variables
}
| [
""
] | |
5bd9f5cec133744af540d66d0016360b45444c1d | 173ee15a41be8ad81a053716ef06a75dcf29dec1 | /src/com/sforce/soap/enterprise/NameObjectValuePair.java | 42dd91b3d424cafaef9d0a708417987b091c6ec7 | [] | no_license | des-albert/gustFX | b0c1ca1619cf76b6617b2eea49e65bb5b437afd3 | cbcf0f10cb8e62fb5dbfde89f97b84b272f7d9d5 | refs/heads/master | 2020-06-12T15:06:23.066047 | 2020-04-07T19:55:16 | 2020-04-07T19:55:16 | 194,340,150 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,963 | java | package com.sforce.soap.enterprise;
/**
* This is a generated class for the SObject Enterprise API.
* Do not edit this file, as your changes will be lost.
*/
public class NameObjectValuePair implements com.sforce.ws.bind.XMLizable {
/**
* Constructor
*/
public NameObjectValuePair() {}
/* Cache the typeInfo instead of declaring static fields throughout*/
private transient java.util.Map<String, com.sforce.ws.bind.TypeInfo> typeInfoCache = new java.util.HashMap<String, com.sforce.ws.bind.TypeInfo>();
private com.sforce.ws.bind.TypeInfo _lookupTypeInfo(String fieldName, String namespace, String name, String typeNS, String type, int minOcc, int maxOcc, boolean elementForm) {
com.sforce.ws.bind.TypeInfo typeInfo = typeInfoCache.get(fieldName);
if (typeInfo == null) {
typeInfo = new com.sforce.ws.bind.TypeInfo(namespace, name, typeNS, type, minOcc, maxOcc, elementForm);
typeInfoCache.put(fieldName, typeInfo);
}
return typeInfo;
}
/**
* element : name of type {http://www.w3.org/2001/XMLSchema}string
* java type: java.lang.String
*/
private boolean name__is_set = false;
private java.lang.String name;
public java.lang.String getName() {
return name;
}
public void setName(java.lang.String name) {
this.name = name;
name__is_set = true;
}
protected void setName(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
__in.peekTag();
if (__typeMapper.verifyElement(__in, _lookupTypeInfo("name", "urn:enterprise.soap.sforce.com","name","http://www.w3.org/2001/XMLSchema","string",1,1,true))) {
setName(__typeMapper.readString(__in, _lookupTypeInfo("name", "urn:enterprise.soap.sforce.com","name","http://www.w3.org/2001/XMLSchema","string",1,1,true), java.lang.String.class));
}
}
private void writeFieldName(com.sforce.ws.parser.XmlOutputStream __out, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException {
__typeMapper.writeObject(__out, _lookupTypeInfo("name", "urn:enterprise.soap.sforce.com","name","http://www.w3.org/2001/XMLSchema","string",1,1,true), name, name__is_set);
}
/**
* element : value of type {http://www.w3.org/2001/XMLSchema}anyType
* java type: java.lang.Object[]
*/
private boolean value__is_set = false;
private java.lang.Object[] value = new java.lang.Object[0];
public java.lang.Object[] getValue() {
return value;
}
public void setValue(java.lang.Object[] value) {
this.value = value;
value__is_set = true;
}
protected void setValue(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
__in.peekTag();
if (__typeMapper.verifyElement(__in, _lookupTypeInfo("value", "urn:enterprise.soap.sforce.com","value","http://www.w3.org/2001/XMLSchema","anyType",1,-1,true))) {
setValue((java.lang.Object[])__typeMapper.readObject(__in, _lookupTypeInfo("value", "urn:enterprise.soap.sforce.com","value","http://www.w3.org/2001/XMLSchema","anyType",1,-1,true), java.lang.Object[].class));
}
}
private void writeFieldValue(com.sforce.ws.parser.XmlOutputStream __out, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException {
__typeMapper.writeObject(__out, _lookupTypeInfo("value", "urn:enterprise.soap.sforce.com","value","http://www.w3.org/2001/XMLSchema","anyType",1,-1,true), value, value__is_set);
}
/**
*/
@Override
public void write(javax.xml.namespace.QName __element,
com.sforce.ws.parser.XmlOutputStream __out, com.sforce.ws.bind.TypeMapper __typeMapper)
throws java.io.IOException {
__out.writeStartTag(__element.getNamespaceURI(), __element.getLocalPart());
writeFields(__out, __typeMapper);
__out.writeEndTag(__element.getNamespaceURI(), __element.getLocalPart());
}
protected void writeFields(com.sforce.ws.parser.XmlOutputStream __out,
com.sforce.ws.bind.TypeMapper __typeMapper)
throws java.io.IOException {
writeFields1(__out, __typeMapper);
}
@Override
public void load(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
__typeMapper.consumeStartTag(__in);
loadFields(__in, __typeMapper);
__typeMapper.consumeEndTag(__in);
}
protected void loadFields(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
loadFields1(__in, __typeMapper);
}
@Override
public String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder();
sb.append("[NameObjectValuePair ");
toString1(sb);
sb.append("]\n");
return sb.toString();
}
private void toStringHelper(StringBuilder sb, String name, Object value) {
sb.append(' ').append(name).append("='").append(com.sforce.ws.util.Verbose.toString(value)).append("'\n");
}
private void writeFields1(com.sforce.ws.parser.XmlOutputStream __out,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException {
writeFieldName(__out, __typeMapper);
writeFieldValue(__out, __typeMapper);
}
private void loadFields1(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
setName(__in, __typeMapper);
setValue(__in, __typeMapper);
}
private void toString1(StringBuilder sb) {
toStringHelper(sb, "name", name);
toStringHelper(sb, "value", value);
}
}
| [
"dalbert@cray.com"
] | dalbert@cray.com |
a9925e5739047178964810da0edfe8e04214617b | e104892af303d85c5e661d099b500dc1e35b882d | /Sample12_12/app/src/main/java/com/bn/Sample12_12/MyActivity.java | a1d4cacfd181a2495c18696c092278f838fbba65 | [
"Unlicense"
] | permissive | siwangqishiq/Vulkan_Develpment_Samples | 624900dabaca75c9ad21ef5a1ee5af6709dcc9a8 | 409c973e0b37086c854cde07b1e620c3d8d9f15d | refs/heads/master | 2023-08-16T04:13:54.777841 | 2021-10-14T06:53:11 | 2021-10-14T06:53:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 160 | java | package com.bn.Sample12_12;
public class MyActivity extends android.app.NativeActivity
{
static
{
System.loadLibrary("bn-vulkan-lib");
}
}
| [
"709165253@qq.com"
] | 709165253@qq.com |
47debddd0d9290136b24b789431e2321c232651c | 13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3 | /crash-reproduction-ws/results/XRENDERING-418-15-6-Single_Objective_GGA-WeightedSum/org/xwiki/rendering/internal/parser/xhtml/wikimodel/XHTMLXWikiGeneratorListener_ESTest.java | 58917f4329e4be0784577ee7e0ecaa6af4560914 | [
"MIT",
"CC-BY-4.0"
] | permissive | STAMP-project/Botsing-basic-block-coverage-application | 6c1095c6be945adc0be2b63bbec44f0014972793 | 80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da | refs/heads/master | 2022-07-28T23:05:55.253779 | 2022-04-20T13:54:11 | 2022-04-20T13:54:11 | 285,771,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 612 | java | /*
* This file was automatically generated by EvoSuite
* Tue Mar 31 04:44:54 UTC 2020
*/
package org.xwiki.rendering.internal.parser.xhtml.wikimodel;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class XHTMLXWikiGeneratorListener_ESTest extends XHTMLXWikiGeneratorListener_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
7fe2523edd62be9b61bb86ac1d41c8e87316a1c0 | 420da1503b6d72e866b1d672642dfc283140b3fd | /Section 6/InheritenceChallenge/src/com/company/Main.java | dd9483e4f19dba6736938f82938595ac4b7abc8a | [] | no_license | SarahGG/JavaProgrammingMasterclassByTimBuchalka | bb17e270e112a8823c356acd99ccbbee3717f32a | d555e2d06eac699852cb9b8ef882eb69bb532395 | refs/heads/master | 2020-07-21T08:59:49.873562 | 2019-11-22T20:35:39 | 2019-11-22T20:35:39 | 206,806,380 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 502 | java | package com.company;
public class Main {
public static void main(String[] args) {
Car car = new Car(4, 5, 4, 3);
System.out.println("Our car has " + car.getWheels() + " wheels!");
System.out.println("Let's go somewhere!");
car.setGear(1);
car.setSpeed(10.00);
car.setGear(6);
car.setSpeed(50.00);
FordMustang myFord = new FordMustang(2,7);
System.out.println("We've got another car!");
myFord.setGear(9);
}
}
| [
"guarino.sgg@gmail.com"
] | guarino.sgg@gmail.com |
427898b5249140ab30382b68dddb61cd1e991d40 | 66a987298116c922a471321ca06c2ddd82ae31ef | /src/chapter8/TextProcessor2.java | c0cc7633345937e93d7b20c2a79d873017cffdaa | [] | no_license | GeoHernandez27/JavaCourse | c2ddbb34399bf60145bba885f4cc466c50393d30 | 6724216984aa57c00aa0a5742658b14962409eea | refs/heads/master | 2020-08-02T01:05:00.923048 | 2019-10-07T17:55:04 | 2019-10-07T17:55:04 | 211,187,041 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,167 | java | package chapter8;
public class TextProcessor2 {
public static void main(String[] args){
// countWords("I love Test Automation University");
// reverseString("Hello TAU!");
addSpaces("HeyWorld!It'sMeAngie");
}
/**
* Splits a string into an array by tokenizing it.
* counts words and prints them
* @param text full string to be split
*/
public static void countWords(String text){
}
/**
* Prints a string in a reverse order
* @param text String to reverse
*/
public static void reverseString(String text){
for(int i=text.length()-1; i>=0; i--){
System.out.print(text.charAt(i));
}
}
/**
* adds spaces before each uppercase letter
* @param text jumbled text
*/
public static void addSpaces(String text){
var modifiedText = new StringBuilder(text);
for(int i=0; i< modifiedText.length(); i++){
if(i!=0 && Character.isUpperCase(modifiedText.charAt(i))){
modifiedText.insert(i, " ");
i++;
}
}
System.out.println(modifiedText);
}
}
| [
"leopardo2@gmail.com"
] | leopardo2@gmail.com |
d8fb5434aae649a6109950b2f54178d58daabd13 | b98e2d0d06777e77018b982f3ee467de09dd8470 | /src/test/java/ClearRule.java | 41c242749e8c3b984501e6e406e7d233d1cb24b4 | [
"MIT"
] | permissive | annarbecker/university-registrar | 9e8e43abd593919f8b71587c4dfaaddf4acd9dcc | d566cb9286bb29fbe09effa2ee456347506397d0 | refs/heads/master | 2021-01-10T13:45:52.204171 | 2016-03-01T23:58:47 | 2016-03-01T23:58:47 | 52,893,726 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 198 | java | import org.junit.rules.ExternalResource;
public class ClearRule extends ExternalResource {
protected void before() { }
protected void after() {
Student.clear();
Course.clear();
}
}
| [
"anna.r.becker@gmail.com"
] | anna.r.becker@gmail.com |
a6a2d1f48040a8518e15b0eab35aca6083572560 | fef0f65e604ca1357ed7da2153ff1e6e424fc8f1 | /app/classes/Tag.java | 99c6c66ce3473b1e676da1168eefa6f34d7f21e7 | [] | no_license | kris121411/java-test | 693e2f3c288cc02e064c1c367bacc26ce4a59414 | 705a82a5ef868646763d130ce51c1ed422741efd | refs/heads/master | 2021-01-12T15:07:27.945711 | 2016-10-28T11:16:13 | 2016-10-28T11:16:13 | 71,705,563 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 502 | java | package classes;
import org.simpleframework.xml.*;
@Root
public class Tag {
@Element
private int id;
@Element
private String name;
public Tag(int id, String name) {
this.setId(id);
this.setName(name);
}
public void setId(int id) {
this.id = id;
}
public int getId() {
return this.id;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return this.name;
}
}
| [
"kris121411@gmail.com"
] | kris121411@gmail.com |
50cc8b21c781238ac54939cfde8030d424f69be4 | eef7a43c9bdc9c124429a7758ce29644de7782cd | /core/src/main/java/com/gitee/kooder/models/QueryResult.java | 38165879c9342fd2caab66927691b3d4207b5597 | [
"Apache-2.0"
] | permissive | zzdx713/kooder | 61f94a735b5eedb8788309dabd62935396344a80 | f5cd493e9f22baafafa8109f96aee5a4a1a840b8 | refs/heads/master | 2023-08-22T22:23:01.463601 | 2021-10-08T07:06:39 | 2021-10-08T07:06:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,367 | java | /**
* Copyright (c) 2021, OSChina (oschina.net@gmail.com).
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.gitee.kooder.models;
import com.gitee.kooder.core.Constants;
import com.gitee.kooder.utils.JsonUtils;
import org.apache.lucene.document.Document;
import org.apache.lucene.facet.LabelAndValue;
import org.apache.lucene.search.ScoreDoc;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
/**
* lucene search result object
* @author Winter Lau<javayou@gmail.com>
*/
public class QueryResult {
private String type;
private int totalHits;
private int totalPages;
private int pageIndex;
private int pageSize;
private long timeUsed;
private String query;
private List<Searchable> objects;
private Map<String,List<LabelAndValue>> facets;
public QueryResult(String type) {
this.type = type;
this.objects = new ArrayList<>();
this.facets = new TreeMap<>();
}
/**
* get object from document and add it to list
* @param doc
* @param doc_score
*/
public void addDocument(Document doc, ScoreDoc doc_score) {
switch(type){
case Constants.TYPE_REPOSITORY:
Repository repo = new Repository();
repo.setDocument(doc);
repo.set_doc_id(doc_score.doc);
repo.set_doc_score(doc_score.score);
addObject(repo);
break;
case Constants.TYPE_ISSUE:
Issue issue = new Issue(doc);
issue.set_doc_id(doc_score.doc);
issue.set_doc_score(doc_score.score);
addObject(issue);
break;
case Constants.TYPE_CODE:
SourceFile file = new SourceFile();
file.setDocument(doc);
file.set_doc_id(doc_score.doc);
file.set_doc_score(doc_score.score);
addObject(file);
}
}
/**
* generate json string
* @return
*/
public String json() {
return JsonUtils.toJson(this);
}
@Override
public String toString() {
return this.json();
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public int getTotalHits() {
return totalHits;
}
public void setTotalHits(int totalHits) {
this.totalHits = totalHits;
}
public int getTotalPages() {
return totalPages;
}
public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
}
public int getPageIndex() {
return pageIndex;
}
public void setPageIndex(int pageIndex) {
this.pageIndex = pageIndex;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public long getTimeUsed() {
return timeUsed;
}
public void setTimeUsed(long timeUsed) {
this.timeUsed = timeUsed;
}
public String getQuery() {
return query;
}
public void setQuery(String query) {
this.query = query;
}
public List<Searchable> getObjects() {
return objects;
}
public void setObjects(List<Searchable> objects) {
this.objects = objects;
}
public void addObject(Searchable obj) {
this.objects.add(obj);
}
public Map<String, List<LabelAndValue>> getFacets() {
return facets;
}
public void setFacets(Map<String, List<LabelAndValue>> facets) {
this.facets = facets;
}
public void addFacet(String facetName, LabelAndValue facet) {
facets.computeIfAbsent(facetName, f -> new ArrayList<>()).add(facet);
}
}
| [
"liudong@oschina.cn"
] | liudong@oschina.cn |
67d4577c7998bc8360dd341359681b2870142a48 | c4d419a24cf90d75f654073b25aa29d56005c8e6 | /adventOfCode/shuttle-search/src/main/java/com/kk/aoc/ss/model/TimeScheduleBrowser.java | ebc16bfa3f811225aa4534af21b5b10e97a2eb99 | [] | no_license | kondzio/aoc | d74cb034182c070d4b9178faea602967e6d8202b | 5c2f5a58829415769b08bb44d078044cdd04a55f | refs/heads/main | 2023-02-10T16:03:24.612337 | 2021-01-03T17:10:05 | 2021-01-03T17:10:05 | 318,187,771 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,333 | java | package com.kk.aoc.ss.model;
import lombok.RequiredArgsConstructor;
import java.util.Collections;
import java.util.List;
@RequiredArgsConstructor
public class TimeScheduleBrowser {
private final List<TimeSchedule> busSchedules;
public DepartureDetails findNextBus(int timestamp) {
int busNo = 0;
int closestDeparture = Integer.MAX_VALUE;
for (TimeSchedule busSchedule : busSchedules) {
int nextDeparture = busSchedule.nextDeparture(timestamp);
if (nextDeparture < closestDeparture) {
closestDeparture = nextDeparture;
busNo = busSchedule.getBusNo();
}
}
return DepartureDetails.builder().busNo(busNo).departureTime(closestDeparture).build();
}
public int findDesiredConnectionDeparture(List<Connection> connections) {
Connection max = Collections.max(connections);
int nextTry = max.getBusNo() - max.getDelay();
while (true) {
int finalNextTry = nextTry;
boolean found = connections.stream().filter(connection -> connection != max).noneMatch(connection -> 0 != ((finalNextTry + connection.getDelay()) % connection.getBusNo()));
if (found) {
return nextTry;
}
nextTry += max.getBusNo();
}
}
}
| [
"konrad.kielbasa@ihsmarkit.com"
] | konrad.kielbasa@ihsmarkit.com |
737a48e020216c19f874f4878a347ad4b8d19e06 | f76fb72f06d1392f5f0e20e64c0f1564e7c9c6ac | /src/Stack.java | 862949132a14241d0c99cef31989e1ad3ef627a4 | [] | no_license | dareenkhanash/Java_DataStructures | eef8116480cb089ef2c63fcf030b64039f8097aa | 228bb7252c0931103ee7f06ef32aeea1fa341b79 | refs/heads/master | 2020-03-22T21:58:14.454019 | 2018-07-15T16:06:42 | 2018-07-15T16:06:42 | 140,725,106 | 0 | 0 | null | 2018-07-12T14:33:51 | 2018-07-12T14:33:51 | null | UTF-8 | Java | false | false | 534 | java | public class Stack {
private int maxSize=3;
private int[] Storage=new int[maxSize];
private int top = -1;
static int indx=-1;
public void push(int pushedElement) {
if(indx<maxSize) {
Storage[++indx] = pushedElement;
}
}
public long pop() {
int temp=Storage[indx];
Storage[indx]=0;
indx--;
return temp;
}
public void display(){
for(int i = 0;i <Storage.length;i++){
System.out.println(Storage[i]);
}
}
} | [
"dareenhanash1988@gmail.com"
] | dareenhanash1988@gmail.com |
ab28c6396f5f89800665e33e3ed483fd047e564b | 1eb48c39ef8f22754ce36f3a3cff4436c8cdbc3b | /phoenix-video-web/src/main/java/com/ginkgocap/ywxt/video/utils/agora/media/ByteBuf.java | 5673eb44407e29e66cb949297a72395cd42583f0 | [] | no_license | gosions/phoenix-video | a47e84c017a615e49e64fd6ba807e1ab2a3beb90 | ca1ed8242b0f123cc89ab9432971f8b1faa03d88 | refs/heads/master | 2020-05-01T16:57:55.133315 | 2017-12-25T03:19:41 | 2017-12-25T03:19:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,935 | java | package com.ginkgocap.ywxt.video.utils.agora.media;
import java.nio.*;
import java.util.Map;
import java.util.TreeMap;
/**
* Created by Li on 10/1/2016.
*/
public class ByteBuf {
ByteBuffer buffer = ByteBuffer.allocate(1024).order(ByteOrder.LITTLE_ENDIAN);
public ByteBuf() {
}
public ByteBuf(byte[] bytes) {
this.buffer = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN);
}
public byte[] asBytes() {
byte[] out = new byte[buffer.position()];
buffer.rewind();
buffer.get(out, 0, out.length);
return out;
}
public ByteBuf put(short v) {
buffer.putShort(v);
return this;
}
public ByteBuf put(byte[] v) {
put((short)v.length);
buffer.put(v);
return this;
}
public ByteBuf put(int v) {
buffer.putInt(v);
return this;
}
public ByteBuf put(String v) {
return put(v.getBytes());
}
public ByteBuf put(TreeMap<Short, String> extra) {
put((short)extra.size());
for (Map.Entry<Short, String> pair : extra.entrySet()) {
put(pair.getKey());
put(pair.getValue());
}
return this;
}
public short readShort() {
return buffer.getShort();
}
public int readInt() {
return buffer.getInt();
}
public byte[] readBytes() {
short length = readShort();
byte[] bytes = new byte[length];
buffer.get(bytes);
return bytes;
}
public String readString() {
byte[] bytes = readBytes();
return new String(bytes);
}
public TreeMap readMap() {
TreeMap<Short, String> map = new TreeMap<>();
short length = readShort();
for (short i = 0; i < length; ++i) {
short k = readShort();
String v = readString();
map.put(k, v);
}
return map;
}
}
| [
"duanaihua@gintong.com"
] | duanaihua@gintong.com |
b69c3c16a4120675c58fbcf3658a79aa9e735b05 | deacdfb67fc54d97e411267a71fc7d1bbcc17bcf | /GwtBulletDemo/core/src/com/byrfb/tests/BulletTest1.java | 61aa17102e86c2506139763f61dcb0d95c675467 | [
"Apache-2.0"
] | permissive | recaifurkan/java-bullet-gwt | 0226fbc1fcce8fdf75252b141d365b6a44dfd1df | 0534692c2b83941ac0669662362731137f76a5dc | refs/heads/master | 2020-06-25T03:36:52.538871 | 2019-08-01T20:00:54 | 2019-08-01T20:00:54 | 199,186,590 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,374 | java |
package com.byrfb.tests;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.PerspectiveCamera;
import com.badlogic.gdx.graphics.VertexAttributes.Usage;
import com.badlogic.gdx.graphics.g3d.Environment;
import com.badlogic.gdx.graphics.g3d.Material;
import com.badlogic.gdx.graphics.g3d.Model;
import com.badlogic.gdx.graphics.g3d.ModelBatch;
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
import com.badlogic.gdx.graphics.g3d.environment.DirectionalLight;
import com.badlogic.gdx.graphics.g3d.utils.CameraInputController;
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.ArrayMap;
import com.bulletphysics.BulletGlobals;
import com.bulletphysics.ContactAddedCallback;
import com.bulletphysics.collision.broadphase.BroadphaseInterface;
import com.bulletphysics.collision.broadphase.DbvtBroadphase;
import com.bulletphysics.collision.broadphase.Dispatcher;
import com.bulletphysics.collision.dispatch.*;
import com.bulletphysics.collision.narrowphase.ManifoldPoint;
import com.bulletphysics.collision.shapes.*;
import com.bulletphysics.linearmath.Transform;
import com.byrfb.tests.objects.Constructor;
import com.byrfb.tests.objects.GameObject;
/** @see https://xoppa.github.io/blog/using-the-libgdx-3d-physics-bullet-wrapper-part2/
* @author Xoppa */
public class BulletTest1 implements ApplicationListener {
final static short GROUND_FLAG = 1 << 8;
final static short OBJECT_FLAG = 1 << 9;
final static short ALL_FLAG = -1;
class MyContactListener extends ContactAddedCallback {
@Override
public boolean contactAdded(ManifoldPoint cp, CollisionObject colObj0, int partId0, int index0,
CollisionObject colObj1, int partId1, int index1) {
Object col0 = colObj0.getUserPointer();
Object col1 = colObj1.getUserPointer();
System.out.println("Collision");
if(col0 !=null) {
instances.get((Integer) col0).moving = false;
}
if(col1 !=null) {
instances.get((Integer) col1).moving = false;
}
return true;
}
}
PerspectiveCamera cam;
CameraInputController camController;
ModelBatch modelBatch;
Environment environment;
Model model;
Array<GameObject> instances;
ArrayMap<String, Object> constructors;
float spawnTimer;
CollisionConfiguration collisionConfig;
Dispatcher dispatcher;
MyContactListener contactListener;
BroadphaseInterface broadphase;
CollisionWorld collisionWorld;
@Override
public void create () {
contactListener = new MyContactListener();
BulletGlobals.setContactAddedCallback(contactListener);
modelBatch = new ModelBatch();
environment = new Environment();
environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1f));
environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));
cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
cam.position.set(3f, 7f, 10f);
cam.lookAt(0, 4f, 0);
cam.near = 1f;
cam.far = 300f;
cam.update();
camController = new CameraInputController(cam);
Gdx.input.setInputProcessor(camController);
ModelBuilder mb = new ModelBuilder();
mb.begin();
mb.node().id = "ground";
mb.part("ground", GL20.GL_TRIANGLES, Usage.Position | Usage.Normal, new Material(ColorAttribute.createDiffuse(Color.RED)))
.box(5f, 1f, 5f);
mb.node().id = "sphere";
mb.part("sphere", GL20.GL_TRIANGLES, Usage.Position | Usage.Normal, new Material(ColorAttribute.createDiffuse(Color.GREEN)))
.sphere(1f, 1f, 1f, 10, 10);
mb.node().id = "box";
mb.part("box", GL20.GL_TRIANGLES, Usage.Position | Usage.Normal, new Material(ColorAttribute.createDiffuse(Color.BLUE)))
.box(1f, 1f, 1f);
mb.node().id = "cone";
mb.part("cone", GL20.GL_TRIANGLES, Usage.Position | Usage.Normal, new Material(ColorAttribute.createDiffuse(Color.YELLOW)))
.cone(1f, 2f, 1f, 10);
mb.node().id = "capsule";
mb.part("capsule", GL20.GL_TRIANGLES, Usage.Position | Usage.Normal, new Material(ColorAttribute.createDiffuse(Color.CYAN)))
.capsule(0.5f, 2f, 10);
mb.node().id = "cylinder";
mb.part("cylinder", GL20.GL_TRIANGLES, Usage.Position | Usage.Normal,
new Material(ColorAttribute.createDiffuse(Color.MAGENTA))).cylinder(1f, 2f, 1f, 10);
model = mb.end();
constructors = new ArrayMap<String, Object>(String.class, Object.class);
constructors.put("ground", new Constructor(model, "ground", new BoxShape(new Vector3(2.5f, 0.5f, 2.5f)), 0f));
constructors.put("sphere", new Constructor(model, "sphere", new SphereShape(0.5f), 1f));
constructors.put("box", new Constructor(model, "box", new BoxShape(new Vector3(0.5f, 0.5f, 0.5f)), 1f));
constructors.put("cone", new Constructor(model, "cone", new ConeShape(0.5f, 2f), 1f));
constructors.put("capsule", new Constructor(model, "capsule", new CapsuleShape(.5f, 1f), 1f));
constructors.put("cylinder", new Constructor(model, "cylinder", new CylinderShape(new Vector3(.5f, 1f, .5f)),
1f));
collisionConfig = new DefaultCollisionConfiguration();
dispatcher = new CollisionDispatcher(collisionConfig);
broadphase = new DbvtBroadphase();
collisionWorld = new CollisionWorld(dispatcher, broadphase, collisionConfig);
instances = new Array<GameObject>();
GameObject object = ((Constructor) constructors.get("ground")).construct();
instances.add(object);
collisionWorld.addCollisionObject(object.body, GROUND_FLAG, ALL_FLAG);
}
public void spawn () {
GameObject obj = ((Constructor) constructors.values[1 + MathUtils.random(constructors.size - 2)]).construct();
obj.moving = true;
obj.transform.setFromEulerAngles(MathUtils.random(360f), MathUtils.random(360f), MathUtils.random(360f));
obj.transform.trn(MathUtils.random(-2.5f, 2.5f), 9f, MathUtils.random(-2.5f, 2.5f));
obj.body.setWorldTransform(new Transform(obj.transform));
obj.body.setUserPointer(instances.size);
obj.body.setCollisionFlags(obj.body.getCollisionFlags() | CollisionFlags.CUSTOM_MATERIAL_CALLBACK);
instances.add(obj);
collisionWorld.addCollisionObject(obj.body, OBJECT_FLAG, GROUND_FLAG);
}
@Override
public void render () {
final float delta = Math.min(1f / 30f, Gdx.graphics.getDeltaTime());
for (GameObject obj : instances) {
if (obj.moving) {
obj.transform.trn(0f, -delta, 0f);
obj.body.setWorldTransform(new Transform(obj.transform));
}
}
collisionWorld.performDiscreteCollisionDetection();
if ((spawnTimer -= delta) < 0) {
spawn();
spawnTimer = 1.5f;
}
camController.update();
Gdx.gl.glClearColor(0.3f, 0.3f, 0.3f, 1.f);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
modelBatch.begin(cam);
modelBatch.render(instances, environment);
modelBatch.end();
}
@Override
public void dispose () {
for (GameObject obj : instances)
obj.dispose();
instances.clear();
for (Object ctor : constructors.values())
((Constructor) ctor).dispose();
constructors.clear();
modelBatch.dispose();
model.dispose();
}
@Override
public void pause () {
}
@Override
public void resume () {
}
@Override
public void resize (int width, int height) {
}
}
| [
"recaifurkan@users.noreply.github.com"
] | recaifurkan@users.noreply.github.com |
ac6c1dff18ab648467f268ca8a39866eeae798b5 | 159ca3f398496e5b9ee48c60cdab11a593741785 | /src/main/java/Library.java | 5e705eb81cfb7add8e4d1607c91cf74316d9144f | [] | no_license | marcinszydelko/week10-day2-hw | 4bbceb9bc1d8adac1a7413876e4f14108080658b | 7a4586a1434be35e2988e4a8a462f5ef41ed7721 | refs/heads/master | 2020-12-06T09:42:49.671257 | 2020-01-08T09:46:48 | 2020-01-08T09:46:48 | 232,427,438 | 0 | 0 | null | 2020-10-13T18:41:51 | 2020-01-07T22:14:33 | Java | UTF-8 | Java | false | false | 674 | java | import java.util.ArrayList;
public class Library {
private ArrayList<Book> bookCollection;
private int capacity;
public Library(int capacity) {
this.capacity = capacity;
this.bookCollection = new ArrayList<Book>();
}
public int countBooksInLibrary() {
return bookCollection.size();
}
public void addBookToLibrary(Book book) {
if( capacity > countBooksInLibrary()) {
this.bookCollection.add(book);
}
}
public void rentOutBook(Borrower borrower, Book book) {
borrower.addBookToCollection(book);
this.bookCollection.remove(this.bookCollection.indexOf(book));
}
}
| [
"marcinszydelko@yahoo.com"
] | marcinszydelko@yahoo.com |
2cc2bcf90b0d6338eb5f4eb5b81bf0bf7b3b7549 | 8aac068aaeb2f3edd5a8e4516711ac503500f926 | /icosom 16-12-19 backup/iCosom Social/app/src/main/java/com/icosom/social/activity/VerifyKyc.java | 4de2f9b89600f685751c8bd23fa1cc7ada3637d5 | [] | no_license | greenusys/androidBackUp | f436c0f2d7c91ad99b2223556acc8a0b1c730bf1 | 2cb69c8087f7758f7711ab79ea4b1b05ec47dc34 | refs/heads/master | 2020-12-14T11:14:33.403690 | 2020-01-18T11:29:22 | 2020-01-18T11:29:22 | 234,721,480 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,352 | java | package com.icosom.social.activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.preference.PreferenceManager;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.icosom.social.R;
import com.icosom.social.utility.AppController;
import com.icosom.social.utility.RequestBuilder;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.XML;
import java.io.IOException;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class VerifyKyc extends AppCompatActivity {
String dataa;
int i =0;
SharedPreferences sp;
AppController appController;
String selfId;
LinearLayout otp,datas;
EditText edts,kyc_otp;
String otps;
LinearLayout kyc_next,btn_finish;
String uid,name,yob,gender,street,location,post_office,district,sub_district,state,pinCode,dob,mobile;
@Override
public void onBackPressed() {
super.onBackPressed();
startActivity(new Intent(VerifyKyc.this, MainActivity.class));
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_verify_kyc);
appController = (AppController) getApplicationContext();
sp = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
selfId = sp.getString("userId", "1");
//dataa = getIntent().getStringExtra("userId");
// Toast.makeText(this, ""+dataa, Toast.LENGTH_SHORT).show();
Log.e("kyc", "onCreate: "+dataa );
Log.e("selfId", "selfId: "+selfId );
JSONObject jsonObj = null;
try {
jsonObj = XML.toJSONObject(selfId);
JSONObject jsonObject=jsonObj.getJSONObject("PrintLetterBarcodeData");
uid = jsonObject.getString("uid");
name = jsonObject.getString("name");
yob = jsonObject.getString("yob");
gender = jsonObject.getString("gender");
street = jsonObject.getString("street");
location = jsonObject.getString("lm");
post_office = jsonObject.getString("po");
district = jsonObject.getString("dist");
sub_district = jsonObject.getString("subdist");
state = jsonObject.getString("state");
pinCode = jsonObject.getString("pc");
dob = jsonObject.getString("dob");
Log.d("JSON", jsonObject.toString());
} catch (JSONException e) {
Log.e("JSON exception", e.getMessage());
e.printStackTrace();
}
// Log.d("XML", dataa);
Log.d("JSON", jsonObj.toString());
otp = findViewById(R.id.otp);
datas=findViewById(R.id.datas);
kyc_otp = findViewById(R.id.edt_kyc_otp);
edts = findViewById(R.id.edt_kyc_phone);
btn_finish = findViewById(R.id.btn_finish_kyc);
btn_finish.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String ED_OTP = kyc_otp.getText().toString().trim();
if (ED_OTP.equalsIgnoreCase(""))
{
// progressDialog.dismiss();
Toast.makeText(VerifyKyc.this, "Enter otp", Toast.LENGTH_SHORT).show();
} else if ((ED_OTP.length()) < 6) {
// progressDialog.dismiss();
Toast.makeText(VerifyKyc.this, "Enter 6 digit otp", Toast.LENGTH_SHORT).show();
}
else if(ED_OTP.equalsIgnoreCase(otps)){
finishs();
}
else {
Toast.makeText(VerifyKyc.this, "otp not match try again", Toast.LENGTH_SHORT).show();
kyc_otp.setText("");
}
}
});
kyc_next = findViewById(R.id.btn_kyc);
kyc_next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mobile = edts.getText().toString().trim();
if (mobile.equalsIgnoreCase("")) {
// progressDialog.dismiss();
Toast.makeText(VerifyKyc.this, "Enter phone number", Toast.LENGTH_SHORT).show();
} else if ((mobile.length()) < 10) {
// progressDialog.dismiss();
Toast.makeText(VerifyKyc.this, "Enter 10 digit phone number", Toast.LENGTH_SHORT).show();
}
else {
getDatas();
// new VerifyKyc.SignIn1().execute();
}
}
});
}
private void getDatas() {
JSONObject jsonObj = null;
try {
jsonObj = XML.toJSONObject(selfId);
JSONObject jsonObject=jsonObj.getJSONObject("PrintLetterBarcodeData");
uid = jsonObject.getString("uid");
Log.e("JSON exception", uid);
name = jsonObject.getString("name");
Log.e("JSON exception", name);
yob = jsonObject.getString("yob");
Log.e("JSON exception", yob);
gender = jsonObject.getString("gender");
Log.e("JSON exception", gender);
street = jsonObject.getString("street");
Log.e("JSON exception", street);
location = jsonObject.getString("lm");
Log.e("JSON exception",location);
post_office = jsonObject.getString("po");
Log.e("JSON exception", post_office);
district = jsonObject.getString("dist");
Log.e("JSON exception", district);
sub_district = jsonObject.getString("subdist");
Log.e("JSON exception", sub_district);
state = jsonObject.getString("state");
Log.e("JSON exception", state);
pinCode = jsonObject.getString("pc");
Log.e("JSON exception", pinCode);
dob = jsonObject.getString("dob");
Log.e("JSON exception",dob);
if(uid.equalsIgnoreCase("")){
getDatas();
}else {
fetchNotification();
}
Log.d("JSON", jsonObject.toString());
} catch (JSONException e) {
Log.e("JSON exception", e.getMessage());
e.printStackTrace();
}
}
private void fetchNotification()
{
RequestBody body = new FormBody.Builder().
add("user_id",selfId).
add("uid",uid).
add("name",name).
add("yob",yob).
add("gender",gender).
add("street",street).
add("location",location).
add("post_office",post_office).
add("district",district).
add("sub_district",sub_district).
add("state",state).
add("pinCode",pinCode).
add("dob",dob).
add("mobile",mobile).
build();
Log.e("plansss", "fetchNotification: "+body );
Request request = new Request.Builder().
url("https://icosom.com/social/main/KYC_API.php").
post(body).
build();
appController.getOkHttpClient().newCall(request).enqueue(new Callback()
{
@Override
public void onFailure(Call call, IOException e)
{
System.out.println("Errorrrrr "+e.getMessage());
VerifyKyc.this.runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(VerifyKyc.this, "Error", Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onResponse(Call call, Response response) throws IOException
{
Log.e("plansss", "onResponse: "+response );
String myResponse = response.body().string();
Log.e("plansss", "onResponse: "+myResponse );
try {
JSONObject jsonObject = new JSONObject(myResponse);
String code = jsonObject.getString("code");
if(code.equalsIgnoreCase("1")) {
//String msg = jsonObject.getString("msg");
otps = jsonObject.getString("OTP");
runOnUiThread(new Runnable() {
@Override
public void run() {
datas.setVisibility(View.GONE);
otp.setVisibility(View.VISIBLE);
}
});
}
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
private class SignIn1 extends AsyncTask<String, Void, String> {
private String key_a = "user_id";
private String value_a = selfId;
private String key_b = "uid";
private String value_b = uid;
private String key_c = "name";
private String value_c = name;
private String key_d = "yob";
private String value_d = yob;
private String key_e = "gender";
private String value_e = gender;
private String key_f = "street";
private String value_f = street;
private String key_g = "location";
private String value_g = location;
private String key_h = "post_office";
private String value_h = post_office;
private String key_i = "district";
private String value_i = district;
private String key_j = "sub_district";
private String value_j = sub_district;
private String key_k = "state";
private String value_k = state;
private String key_l = "pinCode";
private String value_l = pinCode;
private String key_m = "dob";
private String value_m = dob;
private String key_n = "mobile";
private String value_n =mobile;
private String response;
private RequestBody body;
private String url = "https://icosom.com/wallet/main/KYC_API.php";
@Override
protected String doInBackground(String... strings) {
// value_b = strings[0];
// value_d = strings[1];
Log.e("back", "doInBackground: " + value_a + value_d);
body = RequestBuilder.kycParameter(
key_a, value_a, key_b, value_b, key_c,value_c,key_d, value_d,key_e,value_e,key_f,value_f,key_g,value_g,key_h,value_h,key_i,value_i,key_j,value_j,key_k,value_k,key_l,value_l,key_m,value_m,key_n,value_n);
try {
response = appController.POST(url, body);
} catch (IOException e) {
e.printStackTrace();
}
return response;
}
@Override
protected void onPostExecute(String s) {
Log.e("RESSS", "onPostExecute: " + s);
if (s != null) {
try {
Log.e("planss", "onPostExecute: " + response);
JSONObject jsonObject = new JSONObject(response);
String code = jsonObject.getString("code");
if(code.equalsIgnoreCase("1")) {
//String msg = jsonObject.getString("msg");
otps = jsonObject.getString("OTP");
datas.setVisibility(View.GONE);
otp.setVisibility(View.VISIBLE);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}
}
private void finishs()
{
RequestBody body = new FormBody.Builder().
add("user_id",selfId).
build();
Request request = new Request.Builder().
url("https://icosom.com/social/main/KYC_status.php").
post(body).
build();
appController.getOkHttpClient().newCall(request).enqueue(new Callback()
{
@Override
public void onFailure(Call call, IOException e)
{
System.out.println("Errorrrrr "+e.getMessage());
VerifyKyc.this.runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(VerifyKyc.this, "Error", Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onResponse(Call call, Response response) throws IOException
{
String myResponse = response.body().string();
Log.e("plansss", "onResponse: "+myResponse );
try {
JSONObject jsonObject = new JSONObject(myResponse);
String code = jsonObject.getString("code");
if(code.equalsIgnoreCase("1")) {
// Toast.makeText(VerifyKyc.this, jsonObject.getString("msg"), Toast.LENGTH_SHORT).show();
startActivity(new Intent(VerifyKyc.this,MainActivity.class));
}
else {
Toast.makeText(VerifyKyc.this, jsonObject.getString("msg"), Toast.LENGTH_SHORT).show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
}
| [
"sayed@Sayed.Md.Kaif"
] | sayed@Sayed.Md.Kaif |
7b62bf4d5eb28a3e6390f81c0fbce05a27027dc3 | 7a9883e891baa718d3afe2041fd2f48fe40dc3d3 | /app/src/main/java/com/mjchoi/finalapp/RegistrationActivity.java | 79047a21154dac5f1f8f76222e39e40997d37358 | [] | no_license | rhymermj/Android_App | 5bee963ee154b9cfb9c10831c98e854db2ef7223 | 5dc6287e09e7372250981caf38893b26de5e7c27 | refs/heads/master | 2020-07-22T03:08:20.377307 | 2019-09-08T03:26:13 | 2019-09-08T03:26:13 | 207,056,235 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,516 | java | package com.mjchoi.finalapp;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.mjchoi.finalapp.data.UserDbHelper;
public class RegistrationActivity extends AppCompatActivity {
private EditText emailReg;
private EditText passwordReg;
private EditText confirmPwd;
private Button regButton;
private UserDbHelper db;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registration);
db = new UserDbHelper(this);
emailReg = findViewById(R.id.email_reg);
passwordReg = findViewById(R.id.password_reg);
confirmPwd = findViewById(R.id.password_confirm);
regButton = findViewById(R.id.reg_button);
regButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String email = emailReg.getText().toString();
String password = passwordReg.getText().toString();
String cpassword = confirmPwd.getText().toString();
if(email.equals("") || password.equals("") || cpassword.equals("")){
Toast.makeText(getApplicationContext(), "Empty Fields Not Allowed", Toast.LENGTH_SHORT).show();
}
else {
if (password.equals(cpassword)) {
Boolean echeck = db.checkEmail(email);
if (echeck == true) {
Boolean dcheck = db.addUser(email, password);
if (dcheck == true) {
Toast.makeText(getApplicationContext(), "Registration Successful", Toast.LENGTH_SHORT).show();
startActivity(new Intent(RegistrationActivity.this, NavigationActivity.class));
}
}
else{
Toast.makeText(getApplicationContext(), "Email already exists", Toast.LENGTH_SHORT).show();
}
}
else{
Toast.makeText(getApplicationContext(), "Passwords do not match", Toast.LENGTH_SHORT).show();
}
}
}
});
}
}
| [
"rhymermj@gmail.com"
] | rhymermj@gmail.com |
182bd84378695fc5435f4f6cbaea15afb2d51666 | a80001e5f0978fbbcd18e76b87457d7bc9a26282 | /Data_Structures/elementary_Data_Structures_Trees/BinaryTrees/LowsetComAncestor.java | 856d3fffc4c2a299c9e94878eb8261db4bd8dd0e | [] | no_license | TimJFY/Codes | b2ad2b57694461baa1c059c63645b0a410e4c9fa | d2286311413631b7abc37871206622ca1fd1919f | refs/heads/master | 2020-05-03T03:59:02.727996 | 2014-04-11T16:34:33 | 2014-04-11T16:34:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,649 | java | package elementary_Data_Structures_Trees.BinaryTrees;
import java.util.ArrayList;
public class LowsetComAncestor {
ArrayList<Node> pathA = new ArrayList<Node>();
ArrayList<Node> pathA_ = new ArrayList<Node>();
ArrayList<Node> pathB = new ArrayList<Node>();
ArrayList<Node> pathB_ = new ArrayList<Node>();
// find the path from the root to a target node
public boolean findPath(Node root, Node c, int index) {
Node current = root;
boolean isAns = false;
if (current.getValue() == c.getValue()) {
isAns = true;
} else {
if (current.getLeftChild() != null && !isAns) {
isAns = findPath(current.getLeftChild(), c, index);
}
if (current.getRightChild() != null && !isAns) {
isAns = findPath(current.getRightChild(), c, index);
}
}
// construct the path in a bottom-up manner
if (isAns && index == 1)
pathA.add(current);
if (isAns && index == 2)
pathB.add(current);
return isAns;
}
// find the path from the root to a target node
public boolean findPath2(Node root, Node c, int index,
ArrayList<Node> curPath) {
// construct the path in a top-down manner
curPath.add(root);
boolean found = false;
if (root.getValue() == c.getValue()) {
if (index == 1) {
pathA_ = curPath;
} else {
pathB_ = curPath;
}
found = true;
} else {
if (root.getLeftChild() != null && !found) {
found = findPath2(root.getLeftChild(), c, index,
(ArrayList<Node>) curPath.clone());
}
if (root.getRightChild() != null && !found) {
found = findPath2(root.getRightChild(), c, index,
(ArrayList<Node>) curPath.clone());
}
}
return found;
}
public void showPaths() {
System.out.println("Bottom-Up");
for (int i = 0; i < pathA.size(); i++) {
System.out.print(pathA.get(i).getValue());
if (i + 1 < pathA.size()) {
System.out.print(" --> ");
} else {
System.out.print(" : 1st node");
}
}
System.out.println();
for (int i = 0; i < pathB.size(); i++) {
System.out.print(pathB.get(i).getValue());
if (i + 1 < pathB.size()) {
System.out.print(" --> ");
} else {
System.out.print(" : 2nd node");
}
}
System.out.println();
System.out.println("Top-Down");
for (int i = 0; i < pathA_.size(); i++) {
System.out.print(pathA_.get(i).getValue());
if (i + 1 < pathA_.size()) {
System.out.print(" --> ");
} else {
System.out.print(" : 1st node");
}
}
System.out.println();
for (int i = 0; i < pathB_.size(); i++) {
System.out.print(pathB_.get(i).getValue());
if (i + 1 < pathB_.size()) {
System.out.print(" --> ");
} else {
System.out.print(" : 2nd node");
}
}
System.out.println();
}
public void findLowestCommonAncestor() {
if (pathA.size() == 0 || pathA_.size() == 0) {
System.out.println("1st node does not exist in the tree");
return;
} else if (pathB.size() == 0 || pathB_.size() == 0) {
System.out.println("2nd node does not exist in the tree");
return;
}
int minLength = Math.min(pathA_.size(), pathB_.size()) - 1;
int commonNode = 0;
while (commonNode <= minLength) {
if (pathA_.get(commonNode) != pathB_.get(commonNode)) {
System.out.println("The lowset common ancestor is: "
+ pathA_.get(commonNode - 1));
break;
}
if (commonNode == minLength) {
if (pathA_.size() == pathB_.size()) {
System.out
.println("Same node, The lowset common ancestor is: "
+ pathA_.get(commonNode - 1));
} else {
System.out
.println("The lowset common ancestor is: "
+ pathA_.get(commonNode));
}
}
commonNode++;
}
}
public static void main(String[] args) {
Node n31 = new Node(8, null, null);
Node n32;
Node n33 = new Node(10, null, null);
Node n34;
Node n35;
Node n36;
Node n37 = new Node(14, null, null);
Node n38 = new Node(15, null, null);
Node n21 = new Node(4, n31, null);
Node n22 = new Node(5, n33, null);
Node n23 = new Node(6, null, null);
Node n24 = new Node(7, n37, n38);
Node n11 = new Node(2, n21, n22);
Node n12 = new Node(3, n23, n24);
Node root = new Node(1, n11, n12);
Node notExist = new Node(100, null, null);
LowsetComAncestor lowComAns = new LowsetComAncestor();
lowComAns.findPath(root, n21, 1);
lowComAns.findPath(root, n33, 2);
lowComAns.findPath2(root, n21, 1, new ArrayList<Node>());
lowComAns.findPath2(root, n33, 2, new ArrayList<Node>());
lowComAns.showPaths();
lowComAns.findLowestCommonAncestor();
}
} | [
"apple@applematoMacBook-Pro-5.local"
] | apple@applematoMacBook-Pro-5.local |
dcb1c9e4fcb6010c05b8fa7012cd03f9e9c6ed6f | ad8feb1a40e4e2e06693a831df291aa73b72a38b | /zxing_old/src/main/java/com/yang/zxing/camera/AutoFocusCallback.java | d5fc4f8f15892bebac76489fc7f15db4623132de | [] | no_license | jinxiyang/ZXing-Android | ce29103d04fccca3259c65c3774b5647daa1daa0 | 45d26cd5aae8f59b2dea84377f9fb61c16d63814 | refs/heads/master | 2020-03-11T13:55:13.219993 | 2018-06-20T11:50:48 | 2018-06-20T11:50:48 | 130,038,618 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 780 | java | package com.yang.zxing.camera;
import android.hardware.Camera;
import android.os.Handler;
import android.os.Message;
final class AutoFocusCallback implements Camera.AutoFocusCallback {
private static final long AUTOFOCUS_INTERVAL_MS = 1500L;
private Handler autoFocusHandler;
private int autoFocusMessage;
void setHandler(Handler autoFocusHandler, int autoFocusMessage) {
this.autoFocusHandler = autoFocusHandler;
this.autoFocusMessage = autoFocusMessage;
}
public void onAutoFocus(boolean success, Camera camera) {
if (autoFocusHandler != null) {
Message message = autoFocusHandler.obtainMessage(autoFocusMessage, success);
autoFocusHandler.sendMessageDelayed(message, AUTOFOCUS_INTERVAL_MS);
autoFocusHandler = null;
}
}
}
| [
"jinxi.yang@bl.com"
] | jinxi.yang@bl.com |
3e11ee1b4f422791bd38263138499a1ca4b4b7ce | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/3/3_2472da148b6949ffff88477afacbeeccfc0134ca/FindServer/3_2472da148b6949ffff88477afacbeeccfc0134ca_FindServer_s.java | 5cf28079f30465cd90011473e830d65d4d9fdb0c | [] | 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 | 7,126 | java | // Copyright (c) 1999 Brian Wellington (bwelling@xbill.org)
// Portions Copyright (c) 1999 Network Associates, Inc.
package org.xbill.DNS;
import java.io.*;
import java.util.*;
/**
* A helper class that tries to locate name servers and the search path to
* be appended to unqualified names. Currently, this works if either the
* appropriate properties are set, the OS has a unix-like /etc/resolv.conf,
* or the system is Windows based with ipconfig or winipcfg. There is no
* reason for these routines to be called directly except curiosity.
*
* @author Brian Wellington
*/
public class FindServer {
private static String [] servers = null;
private static Name [] searchlist = null;
static {
findProperty();
if (servers == null || searchlist == null) {
String OS = System.getProperty("os.name");
if (OS.indexOf("Windows") != -1) {
if (OS.indexOf("NT") != -1 ||
OS.indexOf("2000") != -1 ||
OS.indexOf("XP") != -1)
findNT();
else
find95();
} else if (OS.indexOf("NetWare") != -1)
findNetware();
else
findUnix();
}
}
private
FindServer() {}
private static void
addServer(String server, List list) {
if (list.contains(server))
return;
if (Options.check("verbose"))
System.out.println("adding server " + server);
list.add(server);
}
private static void
addSearch(String search, List list) {
Name name;
if (Options.check("verbose"))
System.out.println("adding search " + search);
try {
name = Name.fromString(search, Name.root);
}
catch (TextParseException e) {
return;
}
if (list.contains(name))
return;
list.add(name);
}
/**
* Looks in the system properties to find servers and a search path.
* Servers are defined by dns.server=server1,server2...
* The search path is defined by dns.search=domain1,domain2...
*/
private static void
findProperty() {
String s, prop;
List l = new ArrayList(0);
StringTokenizer st;
prop = System.getProperty("dns.server");
if (prop != null) {
st = new StringTokenizer(prop, ",");
while (st.hasMoreTokens())
addServer(st.nextToken(), l);
if (l.size() > 0)
servers = (String []) l.toArray(new String[l.size()]);
}
l.clear();
prop = System.getProperty("dns.search");
if (prop != null) {
st = new StringTokenizer(prop, ",");
while (st.hasMoreTokens()) {
addSearch(st.nextToken(), l);
}
if (l.size() > 0)
searchlist = (Name []) l.toArray(new Name[l.size()]);
}
}
/**
* Looks in /etc/resolv.conf to find servers and a search path.
* "nameserver" lines specify servers. "domain" and "search" lines
* define the search path.
*/
private static void
findResolvConf(String file) {
InputStream in = null;
try {
in = new FileInputStream(file);
}
catch (FileNotFoundException e) {
return;
}
InputStreamReader isr = new InputStreamReader(in);
BufferedReader br = new BufferedReader(isr);
List lserver = new ArrayList(0);
List lsearch = new ArrayList(0);
try {
String line;
while ((line = br.readLine()) != null) {
if (line.startsWith("nameserver")) {
StringTokenizer st = new StringTokenizer(line);
st.nextToken(); /* skip nameserver */
addServer(st.nextToken(), lserver);
}
else if (line.startsWith("domain")) {
StringTokenizer st = new StringTokenizer(line);
st.nextToken(); /* skip domain */
if (!st.hasMoreTokens())
continue;
addSearch(st.nextToken(), lsearch);
}
else if (line.startsWith("search")) {
StringTokenizer st = new StringTokenizer(line);
st.nextToken(); /* skip search */
String s;
while (st.hasMoreTokens())
addSearch(st.nextToken(), lsearch);
}
}
br.close();
}
catch (IOException e) {
}
if (servers == null && lserver.size() > 0)
servers =
(String [])lserver.toArray(new String[lserver.size()]);
if (searchlist == null && lsearch.size() > 0)
searchlist =
(Name [])lsearch.toArray(new Name[lsearch.size()]);
}
private static void
findUnix() {
findResolvConf("/etc/resolv.conf");
}
private static void
findNetware() {
findResolvConf("sys:/etc/resolv.cfg");
}
/**
* Parses the output of winipcfg or ipconfig.
*/
private static void
findWin(InputStream in) {
BufferedReader br = new BufferedReader(new InputStreamReader(in));
try {
List lserver = new ArrayList();
List lsearch = new ArrayList();
String line = null;
boolean readingServers = false;
boolean readingSearches = false;
while ((line = br.readLine()) != null) {
StringTokenizer st = new StringTokenizer(line);
if (!st.hasMoreTokens()) {
readingServers = false;
readingSearches = false;
continue;
}
String s = st.nextToken();
if (line.indexOf(":") != -1) {
readingServers = false;
readingSearches = false;
}
if (line.indexOf("Host Name") != -1) {
while (st.hasMoreTokens())
s = st.nextToken();
Name name;
try {
name = Name.fromString(s, null);
}
catch (TextParseException e) {
continue;
}
if (name.labels() == 1)
continue;
addSearch(s, lsearch);
} else if (line.indexOf("Primary Dns Suffix") != -1) {
while (st.hasMoreTokens())
s = st.nextToken();
if (s.equals(":"))
continue;
addSearch(s, lsearch);
} else if (readingSearches ||
line.indexOf("DNS Suffix") != -1)
{
while (st.hasMoreTokens())
s = st.nextToken();
if (s.equals(":"))
continue;
addSearch(s, lsearch);
} else if (readingServers ||
line.indexOf("DNS Servers") != -1)
{
while (st.hasMoreTokens())
s = st.nextToken();
if (s.equals(":"))
continue;
addServer(s, lserver);
readingServers = true;
}
}
if (servers == null && lserver.size() > 0)
servers = (String [])lserver.toArray
(new String[lserver.size()]);
}
catch (IOException e) {
}
finally {
try {
br.close();
}
catch (IOException e) {
}
}
return;
}
/**
* Calls winipcfg and parses the result to find servers and a search path.
*/
private static void
find95() {
String s = "winipcfg.out";
try {
Process p;
p = Runtime.getRuntime().exec("winipcfg /all /batch " + s);
p.waitFor();
File f = new File(s);
findWin(new FileInputStream(f));
new File(s).delete();
}
catch (Exception e) {
return;
}
}
/**
* Calls ipconfig and parses the result to find servers and a search path.
*/
private static void
findNT() {
try {
Process p;
p = Runtime.getRuntime().exec("ipconfig /all");
findWin(p.getInputStream());
p.destroy();
}
catch (Exception e) {
return;
}
}
/** Returns all located servers */
public static String []
servers() {
return servers;
}
/** Returns the first located server */
public static String
server() {
if (servers == null)
return null;
return servers[0];
}
/** Returns all entries in the located search path */
public static Name []
searchPath() {
return searchlist;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
15a3f3445f5ce705f095fc1e32f63bba3bb5f5aa | 81cbac118c8db62948f72d9e80c92e6ebfae76e5 | /src/de/projects/github/designpattern/structural/compositePattern/AComponent.java | 89d76ef98f5baf9bb6f2f532e00c8c6f2f4f2e6f | [] | no_license | PeterGessler/DesignPatternTutorial | b41397f9ac8a08f7ae1f940029f5de324a610467 | 85a737efb44cce2972522192897b010abeb36a0d | refs/heads/master | 2021-01-10T16:01:26.046520 | 2016-05-15T21:27:49 | 2016-05-15T21:27:49 | 53,698,328 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,159 | java | package de.projects.github.designpattern.structural.compositePattern;
/**
*
* @author Peter Gessler
* @description Die abstrakte Klasse AComponent bildet die Wurzel im Composite Modell.
* Im hier dargestellten Modell sind alle nicht abstrakten Klassen die von
* AComponent erben gezwungen, operation() als Methode zu implementierten.
*
* Die Methoden add(AComponent pComponent), remove(AComponent pComponent)
* und getChild(int pIndex) sind ebenfalls in allen abgeleiteten Klassen
* aufrufbar, besitzen jedoch keine Implementierung.
*
*/
public abstract class AComponent {
// Methode die jede Unterklasse besitzt
public abstract void operation();
// Defaultimplementierung
// Methode wird nur in der Composite Klasse verwendet
// und ist deswegen nicht als abstrakte Methode deklariert
public void add(AComponent pComponent) {
}
// siehe Beschreibung add-Methode
public void remove(AComponent pComponent) {
// Defaultimplementierung
}
// siehe Beschreibung add-Methode
public AComponent getChild(int pIndex) {
// Defaultimplementierung
return null;
}
}
| [
"peter.gessler@b-tu.de"
] | peter.gessler@b-tu.de |
060ffe9aa936bb732c5bdab73c3855c84cc9e7cf | 20a7dd69d2a922ab16975f2fc1ec306944c6ea2e | /src/main/java/com/hyc/userabbitmq/enums/BaseEnum.java | e20ffc1474b4574f42f6d6d5e061e7fe52dc1a28 | [] | no_license | hyc2613/use_rabbitmq | 1cf98bb84c804ca2e03b57bada0905e0c13cdcbe | 9844bc45387707c104f2f48b7707e9b816b27290 | refs/heads/master | 2022-07-02T15:50:03.058551 | 2019-08-29T09:09:42 | 2019-08-29T09:09:42 | 204,448,162 | 0 | 0 | null | 2022-06-17T02:25:53 | 2019-08-26T10:02:38 | Java | UTF-8 | Java | false | false | 91 | java | package com.hyc.userabbitmq.enums;
public interface BaseEnum {
Integer getValue();
}
| [
"hyc2613@163.com"
] | hyc2613@163.com |
c3c811d08376d927045acc5a05ac0507e067447b | e86893351d3e0157094d44a140b0aeb6508ddce7 | /src/main/java/algorithm/lesson4/Main.java | beb563a0fe9ebc5ff96337d9d480dbeaa9a3daca | [] | no_license | AlekseyMishanin/geekuniversity | 946850e09c66b722e9d070bc91c2926440739ce5 | f4dea9f6832bed49f76db16c75669b359ba4c38f | refs/heads/master | 2020-04-02T04:07:40.319290 | 2019-04-14T17:59:06 | 2019-04-14T17:59:06 | 154,001,076 | 0 | 1 | null | 2019-04-14T17:59:45 | 2018-10-21T11:30:01 | Java | UTF-8 | Java | false | false | 487 | java | package algorithm.lesson4;
public class Main {
public static void main(String[] args) {
MyLinkedList<Character> list = new MyLinkedList<>();
list.addFirst('1');
list.addFirst('2');
list.addFirst('3');
list.addFirst('4');
list.addFirst('5');
list.addFirst('6');
list.addFirst('7');
System.out.println(list.get(6));
System.out.println(list.get(5));
System.out.println(list.get(4));
}
}
| [
"mishanin_a_a@mail.ru"
] | mishanin_a_a@mail.ru |
718e30e8a9f3f354f651c8ad299ed791cac1c2e1 | 082e26b011e30dc62a62fae95f375e4f87d9e99c | /docs/weixin_7.0.4_source/反编译源码/反混淆后/src/main/java/com/tencent/p177mm/plugin/appbrand/appcache/C42348am.java | 0a886abea52579c126728ee69fe5260c439bf810 | [] | no_license | xsren/AndroidReverseNotes | 9631a5aabc031006e795a112b7ac756a8edd4385 | 9202c276fe9f04a978e4e08b08e42645d97ca94b | refs/heads/master | 2021-04-07T22:50:51.072197 | 2019-07-16T02:24:43 | 2019-07-16T02:24:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,572 | java | package com.tencent.p177mm.plugin.appbrand.appcache;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.p177mm.kernel.C1720g;
import com.tencent.p177mm.p178a.C1173e;
import com.tencent.p177mm.sdk.platformtools.C4990ab;
import java.io.File;
import java.io.FilenameFilter;
/* renamed from: com.tencent.mm.plugin.appbrand.appcache.am */
public final class C42348am {
/* renamed from: a */
public static void m74896a(FilenameFilter filenameFilter) {
AppMethodBeat.m2504i(59481);
String str = C1720g.m3536RP().cachePath;
if (!str.endsWith("/")) {
str = str + "/";
}
File file = new File(str + "appbrand/jscache");
if (file.exists() && file.isDirectory()) {
File[] listFiles = file.listFiles(filenameFilter);
if (listFiles != null && listFiles.length > 0) {
for (File t : listFiles) {
C1173e.m2575t(t);
C4990ab.m7417i("WxaJsCacheStorage", "clear file:%s", t.getName());
}
}
}
AppMethodBeat.m2505o(59481);
}
public final void clear(final String str) {
AppMethodBeat.m2504i(59482);
C42348am.m74896a(new FilenameFilter() {
public final boolean accept(File file, String str) {
AppMethodBeat.m2504i(59480);
boolean endsWith = str.endsWith("_" + str);
AppMethodBeat.m2505o(59480);
return endsWith;
}
});
AppMethodBeat.m2505o(59482);
}
}
| [
"alwangsisi@163.com"
] | alwangsisi@163.com |
36465764f488d407f2bfe9ce06e866a6dbc4821f | 6ab67c0b388bf39b65af35930540136154d07957 | /couteau-strings/src/main/java/com/agileapes/couteau/strings/document/DocumentReader.java | b821f9a2d1039a43209fc35bba3453cb5dfca145 | [
"MIT"
] | permissive | pooyaho/couteau | 32f43ba40646ed79c1bd43bc2cf9dd4d0e91e958 | a5fbc39f28d5112a9e4d2911adf2d034727a33a6 | refs/heads/master | 2021-01-16T18:41:44.781541 | 2014-04-07T10:14:26 | 2014-04-07T10:14:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,741 | java | /*
* Copyright (c) 2013. AgileApes (http://www.agileapes.scom/), and
* associated organization.
*
* 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.
*/
package com.agileapes.couteau.strings.document;
import com.agileapes.couteau.strings.token.Token;
import com.agileapes.couteau.strings.token.TokenReader;
import java.util.Set;
import java.util.regex.Pattern;
/**
* The DocumentReader will expose tools for parsing and reading through a document.
*
* @author Mohammad Milad Naseri (m.m.naseri@gmail.com)
* @since 1.0 (7/23/13, 11:18 AM)
*/
public interface DocumentReader {
/**
* This method will add a token reader to the document reader so that tokens can be read more easily
* @param reader the reader to be registered with the document reader
*/
void addReader(TokenReader reader);
/**
* This should give report as to where the reader stands within the document at this moment
* @return the part of document currently read through
*/
String taken();
/**
* This will return the parts of document not yet read through by the reader
* @return the part of the document not processed by the reader
*/
String rest();
/**
* This method will skip all the characters matching the pattern from this point in the document
* onwards (if any)
*/
void skip(Pattern pattern);
/**
* This method will determine whether the indicated pattern can be found at this point in the document or not
* @param pattern the lookup pattern
* @return <code>true</code> if the pattern can be found
*/
boolean has(Pattern pattern);
/**
* This method will determine whether the indicated pattern can be found at this point in the document or not
* @param pattern the lookup pattern
* @return <code>true</code> if the pattern can be found
*/
boolean has(String pattern);
/**
* This method will determine if another token can be found in the document
* @return <code>true</code> if a valid token exists to be read
*/
boolean hasTokens();
/**
* This method will determine if another token can be found in the document
* @param tokenReader the token designator for discovering tokens
* @return <code>true</code> if a token that can be read by the given reader exists in the document
*/
boolean hasTokens(TokenReader tokenReader);
/**
* Determines whether we have hit the end of the document or not
* @return <code>true</code> if we have no more to go
*/
boolean hasMore();
/**
* Will return the next character
* @return next character in the document stream
*/
char nextChar();
/**
* Will determine possible tokens that can be read from the document
* @return a set of all tokens that could be read from the document
*/
Set<Token> nextToken();
/**
* Will give the next token. If no tokens can be found, the method will either take further action
* to fix this, or throw an Exception. You can confer {@link #hasTokens} to see if another token exists
* in the document.<br/>
* <strong>NB</strong> This method will attempt to read the <em>first</em> identifiable token, meaning
* that if one token is the prefix of another, then the first will be discovered.
*
* @param tokenReader the token designator
* @return next token (if any can be found)
*/
Token nextToken(TokenReader tokenReader);
/**
* Works the same as {@link #nextToken(TokenReader)} with the exception that if the token cannot be read,
* an exception will be thrown
*
* @param tokenReader the token designator
* @return next token (if any can be found)
*/
Token expectToken(TokenReader tokenReader);
/**
* Takes in a token definition and reads the token from the cursor position.
* @param token the token definition
* @return the token described by the parameter. {@code null} if no such token exists
*/
String read(Token token);
/**
* Will attempt to read the string matching the given parameter. If the string matched with this pattern
* does not start at the current point in the document, the result will be considered to be negative.
* @param pattern the compiled pattern to be matched against
* @param skipWhitespaces will cause a call to {@link #skip(java.util.regex.Pattern)} with whitespace pattern
* before going forth
* @return the string read by the method, or <code>null</code> if it cannot be found
* @see Pattern#compile(String)
* @see Pattern#compile(String, int)
*/
String read(Pattern pattern, boolean skipWhitespaces);
/**
* Will attempt to read the string matching the given parameter. If the string matched with this pattern
* does not start at the current point in the document, the result will be considered to be negative.
* @param pattern the compiled pattern to be matched against
* @param skipWhitespaces will cause a call to {@link #skip(java.util.regex.Pattern)} with whitespace pattern
* before going forth
* @return the string read by the method, or <code>null</code> if it cannot be found
* @see Pattern#compile(String)
* @see Pattern#compile(String, int)
*/
String read(String pattern, boolean skipWhitespaces);
/**
* This will attempt to read string matching the given pattern from the document at the current point
* indicated by the cursor. If failed to do so, the method will be expected to throw an exception or take corrective measures.
* @param pattern the regular to query for
* @param skipWhitespaces will cause a call to {@link #skip(java.util.regex.Pattern)} with whitespace pattern
* before going forth
* @return the read string
*/
String expect(Pattern pattern, boolean skipWhitespaces);
/**
* This will attempt to read string matching the given pattern from the document at the current point
* indicated by the cursor. If failed to do so, the method will be expected to throw an exception or take corrective measures.
* @param pattern the regular to query for
* @param skipWhitespaces will cause a call to {@link #skip(java.util.regex.Pattern)} with whitespace pattern
* before going forth
* @return the read string
*/
String expect(String pattern, boolean skipWhitespaces);
/**
* This will cause the state of the reading to be reset. The cursor will be set back to the beginning of the document,
* and the line/column positioning data will be reset to their initial value.
*/
void reset();
/**
* This method will give the control momentarily to the given {@link SnippetParser} instance.
* @param parser the parser to give over the flow to
* @return the data returned by the parser
*/
<E> E parse(SnippetParser<E> parser);
/**
* Peeks ahead for the specified length of characters
* @param length the number of characters to read
* @return the string with the specified length
*/
String peek(int length);
/**
* Remembers the current position in the document, returning the corresponding snapshot.
* @return the snapshot representing the current position of the document reader
*/
ReaderSnapshot remember();
/**
* Forgets the latest remembered position
*/
ReaderSnapshot forget();
/**
* Rewinds back to the latest remembered position
*/
void rewind();
/**
* Repositions the reader according to the snapshot
* @param snapshot the snapshot to reposition to
*/
void reposition(ReaderSnapshot snapshot);
/**
* @return the current line of the document at which the reader stands. Starts at 1.
*/
int getLine();
/**
* @return the column in the current line to which the reader has advanced. Starts at 1.
*/
int getColumn();
}
| [
"m.m.naseri@gmail.com"
] | m.m.naseri@gmail.com |
d8f366b95a084ab888e0d9d95349e1b87211ccbf | 6e153ea34a8bf66acd43c3c48ea33be346c05872 | /service-ribbon/src/test/java/com/lz/ServiceRibbonApplicationTests.java | 5b4b3f73217aaec176f7a28e3317ef1fef7ac71f | [] | no_license | linz12120/spring-cloud | 23945f33ca16b73edcc0447ec59e4301cbe70085 | 1bdbb10334a266293fcb4e20d2eb490aa6f84e3d | refs/heads/master | 2020-03-13T13:55:53.394243 | 2018-04-28T02:50:49 | 2018-04-28T02:50:49 | 131,148,216 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 339 | java | package com.lz;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class ServiceRibbonApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"583120896@qq.com"
] | 583120896@qq.com |
b0185ca252ce9d367e3ebf76fa98877af91ebd58 | 2ff822f345a58a6eacc611126d4281c536905184 | /SearchFiles.java | 2e2ac4def3ebdccd4fb188c966cce9ec0bf3322c | [] | no_license | UCR-CS242-Team1/Proj1a | bad268a822c31697e6166a836c84677bc6a2d5a7 | 927e9c2576c16b90b4aa91313d2d52f2d7e1d6fb | refs/heads/master | 2020-12-15T13:16:32.163499 | 2020-02-07T05:50:28 | 2020-02-07T05:50:28 | 235,115,393 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,755 | java | package Lucene;
// Code from:
// https://lucene.apache.org/core/7_3_0/demo/src-html/org/apache/lucene/demo/SearchFiles.html
// https://github.com/apache/lucene-solr/blob/master/lucene/demo/src/java/org/apache/lucene/demo/SearchFiles.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.lucene.demo;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Date;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.FSDirectory;
/** Simple command-line based search demo. */
public class SearchFiles {
private SearchFiles() {}
/** Simple command-line based search demo. */
public static void main(String[] args) throws Exception {
String usage =
"Usage:\tjava org.apache.lucene.demo.SearchFiles [-index dir] [-field f] [-repeat n] [-queries file] [-query string] [-raw] [-paging hitsPerPage]\n\nSee http://lucene.apache.org/core/4_1_0/demo/ for details.";
if (args.length > 0 && ("-h".equals(args[0]) || "-help".equals(args[0]))) {
System.out.println(usage);
System.exit(0);
}
String index = "C:\\\\Users\\\\maint\\\\Desktop\\\\Lucene-Tutorials-master\\\\index";
String field = "contents";
String queries = null;
int repeat = 0;
boolean raw = false;
String queryString = null;
int hitsPerPage = 10;
for(int i = 0;i < args.length;i++) {
if ("-index".equals(args[i])) {
index = args[i+1];
i++;
} else if ("-field".equals(args[i])) {
field = args[i+1];
i++;
} else if ("-queries".equals(args[i])) {
queries = args[i+1];
i++;
} else if ("-query".equals(args[i])) {
queryString = args[i+1];
i++;
} else if ("-repeat".equals(args[i])) {
repeat = Integer.parseInt(args[i+1]);
i++;
} else if ("-raw".equals(args[i])) {
raw = true;
} else if ("-paging".equals(args[i])) {
hitsPerPage = Integer.parseInt(args[i+1]);
if (hitsPerPage <= 0) {
System.err.println("There must be at least 1 hit per page.");
System.exit(1);
}
i++;
}
}
IndexReader reader = DirectoryReader.open(FSDirectory.open(Paths.get(index)));
IndexSearcher searcher = new IndexSearcher(reader);
Analyzer analyzer = new StandardAnalyzer();
BufferedReader in = null;
if (queries != null) {
in = Files.newBufferedReader(Paths.get(queries), StandardCharsets.UTF_8);
} else {
in = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));
}
QueryParser parser = new QueryParser(field, analyzer);
while (true) {
if (queries == null && queryString == null) { // prompt the user
System.out.println("Enter query: ");
}
String line = queryString != null ? queryString : in.readLine();
if (line == null || line.length() == -1) {
break;
}
line = line.trim();
if (line.length() == 0) {
break;
}
Query query = parser.parse(line);
System.out.println("Searching for: " + query.toString(field));
if (repeat > 0) { // repeat & time as benchmark
Date start = new Date();
for (int i = 0; i < repeat; i++) {
searcher.search(query, 100);
}
Date end = new Date();
System.out.println("Time: "+(end.getTime()-start.getTime())+"ms");
}
doPagingSearch(in, searcher, query, hitsPerPage, raw, queries == null && queryString == null);
if (queryString != null) {
break;
}
}
reader.close();
}
/**
* This demonstrates a typical paging search scenario, where the search engine presents
* pages of size n to the user. The user can then go to the next page if interested in
* the next hits.
*
* When the query is executed for the first time, then only enough results are collected
* to fill 5 result pages. If the user wants to page beyond this limit, then the query
* is executed another time and all hits are collected.
*
*/
public static void doPagingSearch(BufferedReader in, IndexSearcher searcher, Query query,
int hitsPerPage, boolean raw, boolean interactive) throws IOException {
// Collect enough docs to show 5 pages
TopDocs results = searcher.search(query, 5 * hitsPerPage);
ScoreDoc[] hits = results.scoreDocs;
int numTotalHits = Math.toIntExact(results.totalHits.value);
System.out.println(numTotalHits + " total matching documents");
int start = 0;
int end = Math.min(numTotalHits, hitsPerPage);
while (true) {
if (end > hits.length) {
System.out.println("Only results 1 - " + hits.length +" of " + numTotalHits + " total matching documents collected.");
System.out.println("Collect more (y/n) ?");
String line = in.readLine();
if (line.length() == 0 || line.charAt(0) == 'n') {
break;
}
hits = searcher.search(query, numTotalHits).scoreDocs;
}
end = Math.min(hits.length, start + hitsPerPage);
for (int i = start; i < end; i++) {
if (raw) { // output raw format
System.out.println("doc="+hits[i].doc+" score="+hits[i].score);
continue;
}
Document doc = searcher.doc(hits[i].doc);
String path = doc.get("path");
if (path != null) {
System.out.println((i+1) + ". " + path);
String title = doc.get("title");
if (title != null) {
System.out.println(" Title: " + doc.get("title"));
}
} else {
System.out.println((i+1) + ". " + "No path for this document");
}
}
if (!interactive || end == 0) {
break;
}
if (numTotalHits >= end) {
boolean quit = false;
while (true) {
System.out.print("Press ");
if (start - hitsPerPage >= 0) {
System.out.print("(p)revious page, ");
}
if (start + hitsPerPage < numTotalHits) {
System.out.print("(n)ext page, ");
}
System.out.println("(q)uit or enter number to jump to a page.");
String line = in.readLine();
if (line.length() == 0 || line.charAt(0)=='q') {
quit = true;
break;
}
if (line.charAt(0) == 'p') {
start = Math.max(0, start - hitsPerPage);
break;
} else if (line.charAt(0) == 'n') {
if (start + hitsPerPage < numTotalHits) {
start+=hitsPerPage;
}
break;
} else {
int page = Integer.parseInt(line);
if ((page - 1) * hitsPerPage < numTotalHits) {
start = (page - 1) * hitsPerPage;
break;
} else {
System.out.println("No such page");
}
}
}
if (quit) break;
end = Math.min(numTotalHits, start + hitsPerPage);
}
}
}
} | [
"noreply@github.com"
] | noreply@github.com |
78be5a4a99843badf9c12ec62c8df92eeda79766 | 8cef62f26ee6b33586d554f32d7743365bc08ab6 | /src/com/goide/util/GoPathSearchScope.java | fb1c2bb39d291f6a11905429a03e4f1215666b54 | [
"Apache-2.0",
"CC-BY-3.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | puyox/go-lang-idea-plugin | 4b4ac304410e43df4dbaa092b1153f59420cb2da | 5cad2e1448ce0ebc86a0cb5a9cd080e11c1eb43c | refs/heads/master | 2020-04-04T22:45:54.345020 | 2016-03-21T22:11:59 | 2016-03-21T22:11:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,669 | java | /*
* Copyright 2013-2016 Sergey Ignatov, Alexander Zolotov, Florin Patan
*
* 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.goide.util;
import com.goide.project.GoVendoringUtil;
import com.goide.sdk.GoSdkService;
import com.goide.sdk.GoSdkUtil;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiElement;
import com.intellij.psi.search.GlobalSearchScope;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Set;
public class GoPathSearchScope extends GlobalSearchScope {
@NotNull private final Set<VirtualFile> myRoots;
@Nullable private final VirtualFile myContextDirectory;
@Nullable private final VirtualFile mySdkHome;
private final boolean mySupportsInternalPackages;
private final boolean mySupportsSdkInternalPackages;
public static GoPathSearchScope create(@NotNull Project project, @Nullable Module module, @Nullable PsiElement context) {
VirtualFile contextDirectory = null;
if (context != null) {
PsiDirectory psiDirectory = context.getContainingFile().getContainingDirectory();
if (psiDirectory != null) {
contextDirectory = psiDirectory.getVirtualFile();
}
}
VirtualFile sdk = GoSdkUtil.getSdkSrcDir(project, module);
String sdkVersion = GoSdkService.getInstance(project).getSdkVersion(module);
return new GoPathSearchScope(project, GoSdkUtil.getSourcesPathsToLookup(project, module, context), contextDirectory, sdk, sdkVersion);
}
private GoPathSearchScope(@NotNull Project project,
@NotNull Set<VirtualFile> roots,
@Nullable VirtualFile contextDirectory,
@Nullable VirtualFile sdkHome,
@Nullable String sdkVersion) {
super(project);
if (contextDirectory != null && !contextDirectory.isDirectory()) {
throw new IllegalArgumentException("Context should be a directory, given " + contextDirectory);
}
myRoots = roots;
myContextDirectory = contextDirectory;
mySdkHome = sdkHome;
mySupportsInternalPackages = GoVendoringUtil.supportsInternalPackages(sdkVersion);
mySupportsSdkInternalPackages = GoVendoringUtil.supportsSdkInternalPackages(sdkVersion);
}
@Override
public boolean contains(@NotNull VirtualFile file) {
VirtualFile packageDirectory = file.isDirectory() ? file : file.getParent();
if (packageDirectory == null) {
return false;
}
if (ApplicationManager.getApplication().isUnitTestMode() && myRoots.contains(packageDirectory)) {
return true;
}
String importPath = GoSdkUtil.getRelativePathToRoots(packageDirectory, myRoots);
if (importPath == null) {
return false;
}
if (importPath.isEmpty()) {
return true;
}
if (myContextDirectory != null) {
if (GoSdkUtil.isUnreachableVendoredPackage(packageDirectory, myContextDirectory, myRoots)) {
return false;
}
if (mySupportsInternalPackages || mySupportsSdkInternalPackages && mySdkHome != null &&
VfsUtilCore.isAncestor(mySdkHome, packageDirectory, false)) {
if (GoSdkUtil.isUnreachableInternalPackage(packageDirectory, myContextDirectory, myRoots)) {
return false;
}
}
}
for (VirtualFile root : myRoots) {
// returns false if directory was shadowed
VirtualFile realDirectoryToResolve = root.findFileByRelativePath(importPath);
if (realDirectoryToResolve != null) {
return packageDirectory.equals(realDirectoryToResolve);
}
}
return true;
}
@Override
public int compare(@NotNull VirtualFile file1, @NotNull VirtualFile file2) {
return 0;
}
@Override
public boolean isSearchInModuleContent(@NotNull Module aModule) {
return true;
}
@Override
public boolean isSearchInLibraries() {
return false;
}
}
| [
"goldifit@gmail.com"
] | goldifit@gmail.com |
8fb529fa97f9d0168da57ffe4dd218968c63826c | 09fa9125db608348c3794df8af37ac5fc69ffbe8 | /mvplib/src/test/java/com/taichuan/mvplib/ExampleUnitTest.java | e7caedffc56dab397ce5be942c5d0cb859b3f9cb | [] | no_license | chenyugui/CommonLib | e56823636536c4c51cd6066d705b36588e28420a | 3d7ad7a618bd2657e6c0c1e1ea00eb5441553629 | refs/heads/master | 2021-01-22T08:47:30.189739 | 2017-07-25T03:20:57 | 2017-07-25T03:20:57 | 92,632,452 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 397 | java | package com.taichuan.mvplib;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"474593676@qq.com"
] | 474593676@qq.com |
a32f95d0af570e62f335279fea02e57537b2ff11 | b77818b29a5f71b2564d01aa491a16a22e74939a | /CinemaApp-Practice1/src/main/java/com/cinemaapp/entity/BaseEntity.java | a29b655a054715b47f1ea2d242b16ff7efef633d | [] | no_license | karinatech/spring-kd | c51abed2ec52ceef85b8d2bf02041f12a3203479 | 7a90774606bc6d0da22a650bae15fdad1d8e2e06 | refs/heads/main | 2023-03-21T10:44:54.180438 | 2021-02-08T00:24:04 | 2021-02-08T00:24:04 | 304,911,117 | 0 | 0 | null | 2021-02-08T00:24:06 | 2020-10-17T15:41:08 | JavaScript | UTF-8 | Java | false | false | 195 | java | package com.cinemaapp.entity;
import javax.persistence.*;
@MappedSuperclass
public class BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
}
| [
"karinaminty@gmail.com"
] | karinaminty@gmail.com |
556f374f0d3be2cee60f0aff3bbda1982a7ff1b0 | 7738a40c403f0e8342aa36475a6f152cf8a172aa | /app/src/main/java/com/abhidev/HelpDesk/OrderTermsActivity.java | 27a114a8b50748a9f6bef7af49ffe02544cb841a | [] | no_license | rishabhjainj/AbhiDev | 33343755f5775ac71d6d202a5c77920dafe0c1ae | beb29c30b0889fb5053456a4c0923059e0fb6ab2 | refs/heads/master | 2022-02-26T09:29:34.390585 | 2019-09-17T08:26:27 | 2019-09-17T08:26:27 | 208,992,239 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,450 | java | package com.abhidev.HelpDesk;
import android.content.Context;
import android.os.Bundle;
import androidx.appcompat.widget.Toolbar;
import android.view.MenuItem;
import com.abhidev.Activities.BaseActivity;
import com.abhidev.R;
public class OrderTermsActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_order_terms);
Toolbar toolbar = (Toolbar) findViewById(R.id.tool);
toolbar.setBackgroundColor(getResources().getColor(R.color.filter_blue));
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setTitle("Terms and Conditions");
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId())
{
case android.R.id.home:
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(newBase);
}
@Override
public void showMessage(String message) {
super.showMessage(message);
}
@Override
public void showNetworkError(String message) {
super.showNetworkError(message);
}
}
| [
"parasjain.jain@outlook.com"
] | parasjain.jain@outlook.com |
f81202a3cfed5f3cf5352a8e7648354a28a5e88e | 5aaee855b18a66d6352ae4968fdf019ddafe867b | /app/src/androidTest/java/multitypesliding/privatecom/wwei/multitypesliding/ExampleInstrumentedTest.java | c3c5c48c22006d5308d866bed8f68a220f64de2f | [] | no_license | youqihei/MultitypeSliding | 405f8c5cb7effcb2a6e07a1d1be5f2dc9bfafa38 | cc7dc650cf81181a3d2c39dcd766309be3c485b7 | refs/heads/master | 2020-04-15T21:20:24.829906 | 2019-02-20T09:13:14 | 2019-02-20T09:13:14 | 165,029,174 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 799 | java | package multitypesliding.privatecom.wwei.multitypesliding;
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.*;
/**
* Instrumented 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("multitypesliding.privatecom.wwei.multitypesliding", appContext.getPackageName());
}
}
| [
"574419586@qq.com"
] | 574419586@qq.com |
0118d07ca0d37a3c0cd248b32cd54daad75dee1b | d90f269706cf1f84f4b52d7e1d07b0c5469a6a5a | /src/main/java/com/gregoriopalama/examples/ogmwildfly/service/UserServiceBean.java | a52926bebcd7289731b0a83f4e515d6ec91c8905 | [] | no_license | gregoriopalama/mongodb-wildfly-hibernate-example | a0708ae4ba4e37e0d90b27313996b546b1123569 | 3c4f2e2aa40db8a984aefe20a4baf04b06c4dbea | refs/heads/master | 2020-09-14T17:36:38.103864 | 2016-09-06T20:36:50 | 2016-09-06T20:36:50 | 67,544,445 | 2 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,951 | java | package com.gregoriopalama.examples.ogmwildfly.service;
import com.gregoriopalama.examples.ogmwildfly.dao.Session;
import com.gregoriopalama.examples.ogmwildfly.dao.User;
import com.gregoriopalama.examples.ogmwildfly.repository.UserRepositoryBean;
import com.gregoriopalama.examples.ogmwildfly.service.dto.MessageDto;
import com.gregoriopalama.examples.ogmwildfly.service.dto.UserDto;
import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import java.util.Date;
/**
* Created by gregorio on 24/08/16.
*/
@Stateless
@LocalBean
@Path("/user")
public class UserServiceBean implements UserServiceBeanLocal {
@EJB
UserRepositoryBean userRepository;
@PUT
@Produces(MediaType.APPLICATION_JSON)
@Path("/{username}")
@Override
public MessageDto addUser(@PathParam("username") String username) {
MessageDto result = new MessageDto();
try {
if (userRepository.findByUsername(username) != null) {
result.setMessage("User already in the system");
return result;
}
} catch (Exception e) {
//should implement the exception handling, but this code is merely for example purpose
}
User model = new User();
model.setUsername(username);
Session session = new Session();
session.setStartDate(new Date());
session.setEndDate(new Date());
model.setSession(session);
userRepository.insert(model);
result.setMessage("User added");
return result;
}
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/{username}")
@Override
public UserDto getUser(@PathParam("username") String username) {
User model = userRepository.findByUsername(username);
UserDto dto = new UserDto();
dto.setUsername(model.getUsername());
return dto;
}
}
| [
"gregoriopalama@gmail.com"
] | gregoriopalama@gmail.com |
3ce1bb2203a333bbd2d4c2070544a81d140508bf | fa064974ed5b77f17d5be0ff1d28d8770e144d4f | /checkers-server/src/main/java/agh/sr/rmi/baszczyk/checkers/server/core/Borad.java | ff727146c29fbb79541da2cd8f95bc203af7fadf | [] | no_license | wbaszczyk/SR-javaRMI | c85945bc9e21ae8cccc9bd5b2e7092beccf75a19 | dcfb18767166af444f5a05c22d8c28d695bd2ec4 | refs/heads/master | 2021-01-25T05:22:11.446886 | 2014-05-20T13:45:43 | 2014-05-20T13:45:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,033 | java | package agh.sr.rmi.baszczyk.checkers.server.core;
import java.rmi.RemoteException;
import agh.sr.rmi.baszczyk.checkers.api.Checker;
import agh.sr.rmi.baszczyk.checkers.api.Color;
import agh.sr.rmi.baszczyk.checkers.api.Size;
import agh.sr.rmi.baszczyk.checkers.api.core.CheckerImpl;
public class Borad {
private Checker[][] table;
private int size;
private Size onePieceSize;
public Borad(int size, Size onePieceSize) throws RemoteException {
table = new Checker[size][size];
this.onePieceSize = onePieceSize;
this.size = size;
Color tmp;
for (int i = 0; i < size * size; i++) {
tmp = (i / size) % 2 == 0 ? Color.BLACK : Color.WHITE;
tmp = (i % size) % 2 == 0 ? Color.reverse(tmp) : tmp;
table[i / size][i % size] = new CheckerImpl(tmp, onePieceSize, true);
}
}
public Checker[][] getBoard() throws RemoteException {
return table;
}
public int getSize() throws RemoteException {
return size;
}
public Size getOnePieceSize() throws RemoteException {
return onePieceSize;
}
}
| [
"wbaszczyk@gmail.com"
] | wbaszczyk@gmail.com |
f9536e9e5aaa23a41849ddd39374f2051d0a2b5b | 0c24018543c983fd771bacc412522e1d5008528b | /app/src/test/java/com/example/image/view/ExampleUnitTest.java | a56e30b78b09c5bc72431f070b600e1f781b04a0 | [] | no_license | imagec/ViewPager | f7c4816f78dace16f3dd421a5cb5edbda22b52ea | 9ad299de624424ae5dd44df842b4625eaba683ae | refs/heads/master | 2021-01-01T04:04:40.437172 | 2017-07-13T17:22:06 | 2017-07-15T08:01:52 | 97,119,435 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 400 | java | package com.example.image.view;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"405830598@qq.com"
] | 405830598@qq.com |
22a6a849fa98d11b45fd04c75e40abffe2ac4013 | ca4d738e86162222d051c22e31f579fbde7fb9c4 | /src/main/java/mx/ourpodcast/model/MessageInformation.java | 8312d3918da8daa29ee2c17787efc7d15fb49dab | [] | no_license | jiaccanche/proyecto_nube | fc2d50d39bbcd020eeb28409b24175609d7b7ae8 | cec721f8dea9642e23ce227bf2ad6d90be654984 | refs/heads/master | 2022-03-27T09:18:58.108096 | 2019-12-04T00:34:51 | 2019-12-04T00:34:51 | 209,867,175 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 344 | java | package mx.ourpodcast.model;
public class MessageInformation{
private String content;
/**
* @return the content
*/
public String getContent() {
return content;
}
/**
* @param content the content to set
*/
public void setContent(String content) {
this.content = content;
}
} | [
"jcanchecauich@gmail.com"
] | jcanchecauich@gmail.com |
5a74c51e72caaeabd9d08d4cd534c06e53772ff0 | 6715f82cddd7c65020dd727a62fff7f8efa96c8c | /springmvc-start/src/main/java/cn/china/controller/HelloController.java | 60a8b56e8e35799eecdbd828739adbced4c4fe62 | [] | no_license | li2ui2/Spring-MVC | 544da30aad8c24dcfc6b0f7597f33c25b0688738 | 569c993e73b1e9f6519d5e145edb2dc4cd482406 | refs/heads/master | 2023-04-19T10:31:06.128929 | 2021-04-28T14:50:55 | 2021-04-28T14:50:55 | 361,462,443 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 804 | java | package cn.china.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* @author LiWei
* @date 2021/04/24 16:39
* @description 控制器类
*/
// 控制器类
@Controller
@RequestMapping(path="/user")
public class HelloController {
/**
* 入门案例
* @return
*/
@RequestMapping(path="/hello")
public String sayHello(){
System.out.println("Hello StringMVC");
return "success";
}
/**
* RequestMapping注解
* @return
*/
@RequestMapping(value="/testRequestMapping",params = {"username=heihei"},headers = {"Accept"})
public String testRequestMapping(){
System.out.println("测试RequestMapping注解...");
return "success";
}
}
| [
"21824087@zju.edu.cn"
] | 21824087@zju.edu.cn |
88a61c4208a07369df30838a8121b84f19db1004 | cb58fcd42c06a4cc9474a991466e62ece9c31327 | /src/main/java/com/boot/template/enum_class/EnumMain.java | 06e7ca2d1786b26479b33f0c18ecf3159f5ee5f6 | [] | no_license | shangshier/springboot01 | 91f428ad6cbd360137d04617d766e836742f405a | 05cf41bbc2fbc37fd480a4185548655284543ac8 | refs/heads/master | 2021-08-12T06:48:28.525828 | 2020-04-14T06:57:05 | 2020-04-14T06:57:05 | 209,731,581 | 0 | 0 | null | 2021-08-02T17:18:45 | 2019-09-20T07:27:49 | Java | UTF-8 | Java | false | false | 318 | java | package com.boot.template.enum_class;
/**
* @author: shangshanshan
* @date: 2019-8-7 21:55
* @Description: TODO
*/
public class EnumMain {
public static void main(String[] args) {
for (EnumClass c : EnumClass.values()){
System.out.println(c.ordinal() + "-" + c.name());
}
}
}
| [
"2384471184@qq.com"
] | 2384471184@qq.com |
0abae6634a1fbaed7895927e3ce5747a1811d364 | 1ecfe796431a55113989b8fcded85c8655e4d6e2 | /app/src/main/java/com/example/autobot/quicksolutionfinal/Upload.java | 1975db97aa33d319e1e49f65960538832e5f4072 | [] | no_license | abrarfahimalam/QuickSolution | 2c36ec08832c81200abf58b9a5439f2fae00fe25 | 735907463d1549aacfcc7835bddc7dfd854c12a1 | refs/heads/master | 2021-08-16T10:38:28.323740 | 2017-11-19T16:53:32 | 2017-11-19T16:53:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,218 | java | package com.example.autobot.quicksolutionfinal;
import android.app.ProgressDialog;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
import com.firebase.client.Firebase;
import com.firebase.client.snapshot.PriorityIndex;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;
import static com.example.autobot.quicksolutionfinal.SignUp.UN;
public class Upload extends AppCompatActivity {
private ImageButton SelectPhoto;
private Button Submit;
private EditText TitleOfPhoto, DescOfPhoto;
private FirebaseAuth firebaseAuth;
private StorageReference StorePhoto;
private DatabaseReference mDatabaseUser;
private Firebase mainDatabase;
private Firebase chidDatabase;
private Uri ImageUri = null;
private FirebaseUser mCurrentUser;
private static final int GALLERY_REQUEST =1;
ProgressDialog mProgressBar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_upload);
Firebase.setAndroidContext(this);
firebaseAuth = FirebaseAuth.getInstance();
mCurrentUser = firebaseAuth.getCurrentUser();
SelectPhoto = (ImageButton) findViewById(R.id.imageButtonUp);
Submit = (Button) findViewById(R.id.ButtonSubmit);
TitleOfPhoto = (EditText)findViewById(R.id.txtTitle);
DescOfPhoto = (EditText)findViewById(R.id.txtDesc);
String Title = TitleOfPhoto.getText().toString();
mainDatabase = new Firebase("https://quicksolution-b9d5f.firebaseio.com/");
StorePhoto = FirebaseStorage.getInstance().getReference();
mDatabaseUser = FirebaseDatabase.getInstance().getReference().child("Users").child(mCurrentUser.getUid());
mProgressBar = new ProgressDialog(this);
SelectPhoto.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent galleryIntent = new Intent(Intent.ACTION_PICK);
galleryIntent.setType("image/*");
startActivityForResult(galleryIntent,GALLERY_REQUEST);
}
});
Submit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startPosting();
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode == GALLERY_REQUEST && resultCode == RESULT_OK)
{
ImageUri = data.getData();
SelectPhoto.setImageURI(ImageUri);
}
}
private void startPosting()
{
mProgressBar.setMessage("Posting.....");
mProgressBar.show();
final String title_val = TitleOfPhoto.getText().toString().trim();
final String desc_val = DescOfPhoto.getText().toString().trim();
if(!TextUtils.isEmpty(title_val) && ImageUri !=null){
StorageReference filepath = StorePhoto.child("Problem_Images").child(ImageUri.getLastPathSegment());
filepath.putFile(ImageUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
Uri downloadUrl = taskSnapshot.getDownloadUrl();
mProgressBar.dismiss();
chidDatabase = new Firebase("https://quicksolution-b9d5f.firebaseio.com/Users" +":"+title_val);
Firebase dbTitle = chidDatabase.child("title");
Firebase dbDesc = chidDatabase.child("desc");
Firebase dbImage = chidDatabase.child("image");
Firebase dbUID = chidDatabase.child("UID");
Firebase newPost = chidDatabase.push();
dbTitle.setValue(title_val);
dbDesc.setValue(desc_val);
dbImage.setValue(downloadUrl.toString());
dbUID.setValue(dbUID);
// mProgressBar.dismiss();
Toast.makeText(Upload.this, "Uploaded", Toast.LENGTH_LONG).show();
intentChanger();
}
}) ;
}
}
private void intentChanger()
{
// TitleOfPhoto.setText("");
// DescOfPhoto.setText("");
Intent ic = new Intent(Upload.this, MainInterface.class);
startActivity(ic);
}
}
| [
"33423523+FahimNirzhar@users.noreply.github.com"
] | 33423523+FahimNirzhar@users.noreply.github.com |
8b14a6ea76cde21ed1a1d8e9c5eefe13d229fafa | 16f792c790cf60616f3ee159b2154fe6f9af95a2 | /lemonade-change/Solution.java | fa2a2e92dac7187604e6551b4c78f67cf0a250fe | [] | no_license | nisargshh/Leetcode | 0bce1bcc0c960b9119062f9dd6f7b9bfa0c9a479 | 14d0463e209204af1d3193644c06872e76e548da | refs/heads/master | 2022-11-27T12:22:57.456505 | 2020-08-01T03:11:08 | 2020-08-01T03:11:08 | 277,210,270 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 733 | java | class Solution {
public boolean lemonadeChange(int[] bills) {
int bill5 = 0, bill10 = 0;
for(int i = 0; i < bills.length; i++){
if(bills[i] == 5){
bill5++;
}
if(bills[i] == 10){
if(bill5 == 0){
return false;
}
bill10++;
bill5--;
}
if(bills[i] == 20){
if (bill5 > 0 && bill10 > 0) {
bill5--;
bill10--;
}else if(bill5 >=3){
bill5 -= 3;
}else{
return false;
}
}
}
return true;
}
} | [
"emailtonisarg@gmail.com"
] | emailtonisarg@gmail.com |
fafd0a9c1cfa8417dbd930af537abee9d0b2bf8c | 36e144f1d6a23ac0b99b08729b7de457bcf98359 | /src/test/java/com/miner/test/MinerExecution_1412.java | ea7140dbb657cf7ecda5a32a754a046116960cb0 | [
"Apache-2.0"
] | permissive | lucassgcarvalho/Bet365 | 394ed27d6c99794da329a2feb8e69b015cf17d40 | 64e34e62624746f8e97d0d5a2674fd4dd2928cb0 | refs/heads/master | 2021-05-04T00:44:07.089702 | 2018-02-05T19:29:47 | 2018-02-05T19:29:47 | 120,350,607 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,568 | java | package com.miner.test;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import com.miner.Locomotive;
import com.miner.entity.Jogador;
import com.miner.entity.Partida;
public class MinerExecution_1412 {
public static void main(String[] args) {
Locomotive loco = new Locomotive();
Map<String, Partida> mapGames = new HashMap<>();
Map<String, Partida> mapGamesGanhos = new HashMap<>();
Map<String, Partida> mapGamesPerdidos = new HashMap<>();
Bot miner = new Bot();
loco.click(By
.cssSelector("html body.por form#frmMain div center div div ul.lpnm li a.lpdgl"));
loco.click(By.xpath(Bot.XPATH_MENU_AO_VIVO));
loco.click(By.xpath(Bot.XPATH_LINK_FUTEBOL));
loco.click(By.xpath(Bot.XPATH_MENU_AO_VIVO_HM_BIG_BUTTON));
// funcionando
loco.click(By.xpath(Bot.XPATH_MENU_EVENTO));
// Fecha Aba Futebol
miner.fecharAba(Bot.FUTEBOL, loco);
BigDecimal valorPote = new BigDecimal(90);
while (true) {
try {
loco.driver.switchTo().defaultContent();
// Fecha Aba Futebol
miner.fecharAba(Bot.FUTEBOL, loco);
WebElement abaPartida = loco.getWebElement(By.xpath(Bot.XPATH_LINK_TAB_TENIS));
loco.scrollTo(abaPartida);
// teste performance
// loco.waitForCondition(ExpectedConditions.visibilityOfElementLocated(By.xpath(Miner.XPATH_LIST_PLAYER_NAME)));
List<WebElement> listNamesPlayers = abaPartida.findElements(By.xpath(Bot.XPATH_LIST_PLAYER_NAME_UM));
int size = listNamesPlayers.size();
for (int indexNamesPlayers = 0; indexNamesPlayers < (size > 6 ? 6
: size); indexNamesPlayers++) {
WebElement player = listNamesPlayers.get(indexNamesPlayers);
loco.scrollTo(player);
// loco.waitForCondition(ExpectedConditions.visibilityOfElementLocated(By.xpath(String.format(Miner.XPATH_GAME_BY_PLAYER,
// player.getText().toString()))));
List<WebElement> gameActual = abaPartida.findElements(By.xpath(String.format(Bot.XPATH_GAME_BY_PLAYER,player.getText().toString())));
for (int indexGameAtual = 0; indexGameAtual < gameActual.size(); indexGameAtual++) {
WebElement elementGameAtual = gameActual.get(indexGameAtual);
WebElement campeonato = player.findElements(By.xpath("../../../../../*")).get(0);
String nomeCampeonato = campeonato.getText();
loco.scrollTo(elementGameAtual);
elementGameAtual.click();
String[] playersNamesActual = elementGameAtual.getText().split("\n");
// loco.waitForCondition(ExpectedConditions.visibilityOfElementLocated(By.xpath(Miner.XPATH_PONTOS_PLAYERS)));
String[] pontos = elementGameAtual.findElement(By.xpath(Bot.XPATH_PONTOS_PLAYERS)).getText().split("\n");
WebElement gameEmExecucao = null;
String stringNumeroJogoAtual = "";
int numeroPartidafinalizada = 1;// se n�o houver,
// poss�vel estar no
// primeiro, validar
// regra
// System.out.println(gameEmExecucao.getText());
try {
// loco.waitForCondition(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@class=\\\"ipe-SummaryButton_Label \\\"]")));
gameEmExecucao = elementGameAtual.findElement(By.xpath("//div[@class=\"ipe-SummaryButton_Label \"]"));
stringNumeroJogoAtual = gameEmExecucao.getText().split("-")[0].split("Jogo")[1];
numeroPartidafinalizada = Integer.parseInt(loco
.getOnlyNumbers(stringNumeroJogoAtual));
} catch (Exception e) {
// System.out.println("Erro - In�cio de jogo:"+playersNamesActual[0]+" VS "+playersNamesActual[1]);
continue;
}
Integer numeroPartidaAtual = 0;
try {
loco.waitForCondition(ExpectedConditions.visibilityOfElementLocated(By.xpath(Bot.XPATH_LINK_ABA_DEUCE)));
List<WebElement> abaDeuce = loco.getWebElements(By.xpath(Bot.XPATH_LINK_ABA_DEUCE));
WebElement deuce = abaDeuce.get(0);
if (abaDeuce.size() > 1) {
for (int i = 0; i < abaDeuce.size(); i++) {
numeroPartidaAtual = Integer.parseInt(loco.getOnlyNumbers(abaDeuce.get(i).getText().substring(0, 2)));
Integer numeroJogoDeuce = Integer.parseInt(loco.getOnlyNumbers(deuce.getText().substring(0, 2)));
if (numeroPartidaAtual < numeroJogoDeuce) {
deuce = abaDeuce.get(i);
}
}
}
loco.scrollTo(deuce);
numeroPartidaAtual = Integer.parseInt(loco.getOnlyNumbers(deuce.getText().substring(0, 2)));
String keyEntrySet = Bot.getEntrySetName(nomeCampeonato, playersNamesActual[0],playersNamesActual[1]);
//cria nova estrutura
if (!mapGames.containsKey(keyEntrySet)
|| (mapGames.get(keyEntrySet) == null
|| mapGames.get(keyEntrySet).getNumeroPartidaFinalizada() != numeroPartidafinalizada)) {
Partida partida = new Partida();
partida.setCampeonato(nomeCampeonato);
partida.setNumeroPartidaAnterior(new Integer(mapGames.get(keyEntrySet) == null ? numeroPartidaAtual: mapGames.get(keyEntrySet).getNumeroPartida()));
partida.setNumeroPartida(numeroPartidaAtual);
partida.setPartidaFinalizada(numeroPartidafinalizada);
partida.setJogador(new Jogador());
partida.getJogador().setNome(playersNamesActual[0]);
partida.getJogador().setPontos(pontos[0]);
partida.setJogadorAdversario(new Jogador());
partida.getJogadorAdversario().setNome(playersNamesActual[1]);
partida.getJogadorAdversario().setPontos(pontos[1]);
partida.setPartidaAnterior(mapGames.get(keyEntrySet) == null ? null: mapGames.get(keyEntrySet));
//partida.setQuantidadeEmpates(mapGames.get(keyEntrySet) == null ? 0: mapGames.get(keyEntrySet).getQuantidadeEmpates());//add 14/12 20:41
mapGames.put(keyEntrySet, partida);
} else {
Partida partida = mapGames.get(keyEntrySet);
partida.getJogador().setPontos(pontos[0]);
partida.getJogadorAdversario().setPontos(pontos[1]);
}
if (mapGames.get(keyEntrySet).getJogador().getPontos().equals("40")
&& mapGames.get(keyEntrySet).getJogadorAdversario().getPontos().equals("40")
&& mapGames.get(keyEntrySet).isPartidaBloqueada()
&& mapGames.get(keyEntrySet).getNumeroPartidaFinalizada() == numeroPartidafinalizada) {
mapGames.get(keyEntrySet).setPartidaGanha(false);
// int numeroEmpates = mapGames.get(keyEntrySet).getQuantidadeEmpates()==null?0:mapGames.get(keyEntrySet).getQuantidadeEmpates();
System.out.println("numero empate teste: "+mapGames.get(keyEntrySet).getQuantidadeEmpates());
//estava zerando o contador de partidas empatadas
/*int numeroEmpates = 0;
mapGames.get(keyEntrySet).setQuantidadeEmpates(numeroEmpates);*/
mapGames.get(keyEntrySet).setPartidaEmpatada(true);
mapGamesPerdidos.put(keyEntrySet,mapGames.get(keyEntrySet));
if (mapGamesPerdidos.get(keyEntrySet) != null) {
mapGamesPerdidos.get(keyEntrySet).setQuantidadeEmpates(mapGamesPerdidos.get(keyEntrySet).getQuantidadeEmpates()+1);
}
// quando cirar uma nova, quando zerar os pontos
// e mudar o jogo, n�o pode estar block
// mapGames.get(keyEntrySet).setPartidaBloqueada(false);
System.out.println("Partida Perdida");
System.out.println("Numero Partida: "
+ numeroPartidaAtual);
System.out.println("Jogadores: "+ mapGames.get(keyEntrySet).getJogador().getNome()+ " VS "+ mapGames.get(keyEntrySet).getJogadorAdversario().getNome());
System.out.println("Pontos: " + pontos[0]+ " - " + pontos[1]);
System.out.println("N�mero empates seguidos: "+ mapGames.get(keyEntrySet).getQuantidadeEmpates());
System.out.println("Valor Aposta: "+ mapGames.get(keyEntrySet).getValorAposta());
System.out.println("Retorno Aposta: "+ mapGames.get(keyEntrySet).getValorRetornoAposta());
// valorPote = valorPote.add(new
// BigDecimal(-3));
System.out.println("Valor Atual: " + valorPote);
System.out.println("Horario: "+ mapGames.get(keyEntrySet).getHorarioPartida());
System.out.println("\n");
// mapGamesPerdidos.put(keyEntrySet+"_numeropartida"+numeroPartidaAtual,
// mapGames.get(keyEntrySet));
mapGames.remove(keyEntrySet);
continue;
// }else
// if(mapGames.get(keyEntrySet).getNumeroPartidaAnterior()
// < numeroPartida) {
} else if (mapGames.get(keyEntrySet).getPartidaAnterior() != null
&& mapGames.get(keyEntrySet).getPartidaAnterior().getNumeroPartidaFinalizada() < numeroPartidafinalizada
&& mapGames.get(keyEntrySet).getPartidaAnterior().isPartidaBloqueada()
/* && mapGames.get(keyEntrySet).isPartidaBloqueada() */) {
// System.out.println("Trocando de partida de "+mapGamesGanhos.get(keyEntrySet).getNumeroPartidaAnterior()+" para "+mapGames.get(keyEntrySet).getNumeroPartida());
valorPote = valorPote.add(mapGames.get(keyEntrySet).getPartidaAnterior().getValorRetornoAposta());
System.out.println("Aposta ganha");
System.out.println("Trocando de partida de "+ mapGames.get(keyEntrySet).getPartidaAnterior().getNumeroPartidaFinalizada()+ " para " + numeroPartidafinalizada);
System.out.println("Numero Partida ganha: "+ mapGames.get(keyEntrySet).getPartidaAnterior().getNumeroPartidaFinalizada());
System.out.println("Numero proxima Partida "+ numeroPartidafinalizada);
System.out.println("Jogadores: "+ mapGames.get(keyEntrySet).getPartidaAnterior().getJogador().getNome()+ " VS "+ mapGames.get(keyEntrySet).getPartidaAnterior().getJogadorAdversario().getNome());
System.out.println("Valor Aposta: "+ mapGames.get(keyEntrySet).getPartidaAnterior().getValorAposta());
System.out.println("Retorno Aposta: "+ mapGames.get(keyEntrySet).getPartidaAnterior().getValorRetornoAposta());
System.out.println("Valor anterior: "+ valorPote);
System.out.println("Valor Atual: " + valorPote);
System.out.println("Horario: "+ mapGames.get(keyEntrySet).getPartidaAnterior().getHorarioPartida());
System.out.println("\n");
mapGames.get(keyEntrySet).setNumeroPartida(numeroPartidaAtual);
mapGames.get(keyEntrySet).setPartidaGanha(true);
mapGames.get(keyEntrySet).setPartidaBloqueada(false);
mapGames.get(keyEntrySet).setNumeroPartidaAnterior(numeroPartidaAtual);
mapGamesGanhos.put(keyEntrySet + "_numeropartida"+ numeroPartidaAtual, mapGames.get(keyEntrySet).getPartidaAnterior());
mapGames.get(keyEntrySet).setPartidaAnterior(null);
mapGames.remove(keyEntrySet);
mapGamesPerdidos.remove(keyEntrySet);
continue;
// se apenas for 40-40n n�o fazer jogada
} else if (mapGames.get(keyEntrySet).getJogador().getPontos().equals("40")
&& mapGames.get(keyEntrySet).getJogadorAdversario().getPontos().equals("40")
|| (mapGames.get(keyEntrySet).getJogador().getPontos().equals("A")
|| mapGames.get(keyEntrySet).getJogadorAdversario().getPontos().equals("A"))) {
continue;
}
// se excedeu o limite de jogadas por empates
if (mapGamesPerdidos.get(keyEntrySet) != null
&& mapGamesPerdidos.get(keyEntrySet) != null
&& !mapGamesPerdidos.get(keyEntrySet).isPartidaGanha()
&& mapGamesPerdidos.get(keyEntrySet).getQuantidadeEmpates() > Bot.MAXIMO_EMPATES) {
mapGamesPerdidos.remove(keyEntrySet);
mapGames.remove(keyEntrySet);
continue;
}
if (mapGames.get(keyEntrySet) != null
&& mapGames.get(keyEntrySet).isPartidaBloqueada()) {
continue;
}
loco.scrollTo(deuce);
String classAbaDeuce = "";
try {
classAbaDeuce = deuce.findElement(By.xpath(Bot.XPATH_PARENT)).getAttribute("class");
} catch (Exception e) {
System.out.println("Falha ao obter parent class da aba Deuce. "
+ Bot.XPATH_PARENT
+ "\n"
+ e.getMessage());
}
if (!classAbaDeuce.contains(Bot.STRING_OPEN)) {
deuce.click();
}
loco.waitForCondition(ExpectedConditions.visibilityOfElementLocated(By.xpath(Bot.XPATH_SPAN_ODDS)));
WebElement webElementValorOdds = deuce.findElements(By.xpath("../.."+ Bot.XPATH_SPAN_ODDS)).get(1);
loco.scrollTo(webElementValorOdds);
webElementValorOdds.click();
WebElement iframeBoletim = loco.getWebElement(By.xpath(Bot.XPATH_FRAME_BOLETIM));
Locomotive switchToFrame = loco.switchToFrame(iframeBoletim);
List<WebElement> listTodasApostas = switchToFrame.getWebElements(By.xpath(Bot.XPATH_LI_TODAS_APOSTAS));
List<WebElement> listsApostasIndividuais = listTodasApostas
.get(0).findElements(
By.xpath(Bot.XPATH_LI));
for (int i = 0; i < listsApostasIndividuais.size(); i++) {
WebElement apostaSelecionada = listsApostasIndividuais
.get(i);
loco.scrollTo(apostaSelecionada);
BigDecimal valorAposta = BigDecimal.ZERO;
if (mapGamesPerdidos.get(keyEntrySet) != null
&& mapGamesPerdidos.get(keyEntrySet) != null
&& mapGamesPerdidos.get(keyEntrySet).isPartidaEmpatada()
&& mapGamesPerdidos.get(keyEntrySet).getQuantidadeEmpates() <= Bot.MAXIMO_EMPATES) {
valorAposta = miner.calcularValorAposta(mapGamesPerdidos.get(keyEntrySet).getValorAposta(), true, mapGamesPerdidos.get(keyEntrySet)).add(new BigDecimal(Bot.VALOR_PADRAO_APOSTA));
} else
valorAposta = miner.calcularValorAposta(Bot.VALOR_PADRAO_APOSTA, false, mapGamesPerdidos.get(keyEntrySet));
mapGames.get(keyEntrySet).setValorAposta(valorAposta);
if(valorAposta.compareTo(valorPote)>1){
System.out.println("Pote insuficiente: Aposta: "+valorAposta+" - Pote: "+valorPote);
continue;
}
loco.waitForCondition(ExpectedConditions.visibilityOfElementLocated(By.xpath(Bot.XPATH_INPUT)));
apostaSelecionada.findElement(By.xpath(Bot.XPATH_INPUT)).sendKeys(valorAposta.toString());
WebElement webElementRetorno = apostaSelecionada.findElement(By.xpath("//div[@class='bs-StakeToReturn']"));
String valor = webElementRetorno.getText().substring(Bot.STRING_RETORNOS.length());
mapGames.get(keyEntrySet).setValorRetornoAposta(new BigDecimal(valor.replace(",", ".").trim()));
mapGames.get(keyEntrySet).setNumeroPartida(numeroPartidaAtual);
mapGames.get(keyEntrySet).setPartidaBloqueada(true);
boolean producao = false;
if (producao) {
boolean apostaEfetuada = false;
while (!apostaEfetuada) {
try {
// loco.waitForElement(By.xpath("//div[@class='bs-Btn bs-BtnHover']"));
loco.getWebElement(By.xpath("//div[@class='bs-Btn bs-BtnHover']")).click();
apostaEfetuada = true;
} catch (Exception e) {
// loco.waitForElement(By.xpath("//a[@class='acceptChanges bs-BtnWrapper']"));
loco.getWebElement(By.xpath("//a[@class='acceptChanges bs-BtnWrapper']")).click();
}
}
loco.waitForElement(By.xpath("//span[@class='br-Header_Done']"));
loco.getWebElement(By.xpath("//span[@class='br-Header_Done']")).click();
} else {
loco.waitForCondition(ExpectedConditions.visibilityOfElementLocated(By.xpath(Bot.XPATH_REMOVER_TODAS_APOSTAS)));
WebElement btnRemoverApostas = loco.getWebElement(By.xpath(Bot.XPATH_REMOVER_TODAS_APOSTAS));
loco.scrollTo(btnRemoverApostas);
btnRemoverApostas.click();
}
loco.driver.switchTo().defaultContent();
//Set Horario Aposta
WebElement horarioAposta = loco.getWebElement(By.xpath("//time[@class='hm-Clock ']"));
valorPote = valorPote.subtract(new BigDecimal(Bot.VALOR_PADRAO_APOSTA));
mapGames.get(keyEntrySet).setHorarioPartida(horarioAposta == null ? "": horarioAposta.getText());
System.out.println("Partida bloqueada - jogo Realizado");
System.out.println("partida apostada: "+ mapGames.get(keyEntrySet).getNumeroPartida());
System.out.println("Jogadores: "+ mapGames.get(keyEntrySet).getJogador().getNome()
+ " VS "+ mapGames.get(keyEntrySet).getJogadorAdversario().getNome());
System.out.println("Entrou na Partida "+ mapGames.get(keyEntrySet).getJogador().getPontos()
+ " - "+ mapGames.get(keyEntrySet).getJogadorAdversario().getPontos());
System.out.println("Valor Aposta: "+ valorAposta);
System.out.println("Retorno: "+ mapGames.get(keyEntrySet).getValorRetornoAposta());
System.out.println("Valor Anterior: "+ valorPote.add(new BigDecimal(Bot.VALOR_PADRAO_APOSTA)));
System.out.println("Valor Atual: " + valorPote);
System.out.println("Horario: "
+ horarioAposta.getText());
System.out.println("\n");
}
} catch (Exception e) {
// System.err.println(e.getMessage());
}
}
loco.driver.switchTo().defaultContent();
}
} catch (Exception e) {
loco.driver.navigate().refresh();
// e.printStackTrace();
// System.out.println(e.getMessage());
}
}
}
} | [
"lucas.sgcarvalho@gmail.com"
] | lucas.sgcarvalho@gmail.com |
2d5a4c3d6923db4e12329cc5ea22dc39473ae632 | 00bfe82cc06143d8827559ffa079a66f60008d2f | /springcloud/test/src/main/java/top/zhangeaky/test/justTest/person.java | 28b3b6b338ba5d565fa2f60ef796b36b8d05e4f9 | [] | no_license | Zhangeaky/JAVASE | de7680058b491cb25e70284f237364dc67ca4927 | 2e97e3dbb9019f89356e9386545509726bf16324 | refs/heads/master | 2023-04-12T02:58:36.605425 | 2021-05-21T12:36:05 | 2021-05-21T12:36:05 | 335,182,265 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 89 | java | package top.zhangeaky.test.justTest;
public interface person {
public void say();
}
| [
"zyk090104@163.com"
] | zyk090104@163.com |
65b346d3c91d5912b85939e4eae09513d21000ce | ade5e4c34a709c13bf8e391f2224c54493f1110f | /src/main/java/cn/wolfcode/crm/domain/Role.java | 48c23656664f47836b7fa911a808000e315a44d4 | [] | no_license | fhlbjay/carinsurance-linzhijian- | 6384ddb1acbcdb62bb0f686d0b3ee5cc92b58f26 | 72f4f0d08a2a13a947c4f93f3084ab159d342565 | refs/heads/master | 2021-03-16T05:56:07.675433 | 2017-12-27T13:49:37 | 2017-12-27T13:49:37 | 115,525,725 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 371 | java | package cn.wolfcode.crm.domain;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
public class Role extends BaseDomain {
private static final long serialVersionUID = 4608551593128875913L;
private String sn;
private String name;
private List<Permission> permissions = new ArrayList<>();
} | [
"790787580@qq.com"
] | 790787580@qq.com |
f0f0716caf4e933c87929f5b91f442f4040c72e8 | f3144ae72104cee233c2053e88deec7f46cdcdc2 | /src/main/java/parser/ast/stmt/ddl/create/DDLCreateFunctionStatement.java | d872e04023b81ec69594ebf7b4968e93ae63c1d4 | [
"MIT"
] | permissive | dizhaung/DagonParser | 45827eaca55a1ada81154323390809d35a198cd8 | d4f433d68c5774384b3ebcce2be4f032c00493df | refs/heads/master | 2023-04-05T01:12:47.198340 | 2021-04-03T03:57:56 | 2021-04-03T03:57:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,796 | java | package parser.ast.stmt.ddl.create;
import parser.SQLType;
import parser.ast.expression.Expression;
import parser.ast.expression.primary.Identifier;
import parser.ast.fragment.ddl.DataType;
import parser.ast.stmt.SQLStatement;
import parser.ast.stmt.compound.condition.Characteristic;
import parser.util.Pair;
import parser.visitor.Visitor;
import java.util.List;
/**
* @author Dagon0577
* @date 2020/7/17
*/
public class DDLCreateFunctionStatement implements SQLStatement {
private final Expression definer;
private final Identifier name;
private final List<Pair<Identifier, DataType>> parameters;
private final DataType returns;
private final List<Characteristic> characteristics;
private final SQLStatement stmt;
public DDLCreateFunctionStatement(Expression definer, Identifier name, List<Pair<Identifier, DataType>> parameters,
DataType returns, List<Characteristic> characteristics, SQLStatement stmt) {
this.definer = definer;
this.name = name;
this.parameters = parameters;
this.returns = returns;
this.characteristics = characteristics;
this.stmt = stmt;
}
public Expression getDefiner() {
return definer;
}
public Identifier getName() {
return name;
}
public List<Pair<Identifier, DataType>> getParameters() {
return parameters;
}
public DataType getReturns() {
return returns;
}
public List<Characteristic> getCharacteristics() {
return characteristics;
}
public SQLStatement getStmt() {
return stmt;
}
@Override
public void accept(Visitor visitor) {
visitor.visit(this);
}
@Override
public int getSQLType() {
return SQLType.CREATE_FUNCTION;
}
}
| [
"dagon0577@gmail.com"
] | dagon0577@gmail.com |
bce677258834cb84f907c4080c3f32c09e046cf1 | c885ef92397be9d54b87741f01557f61d3f794f3 | /tests-without-trycatch/Closure-108/com.google.javascript.jscomp.ScopedAliases/BBC-F0-opt-40/9/com/google/javascript/jscomp/ScopedAliases_ESTest_scaffolding.java | 09689fafb8891b2aee8d025a21e968187bdbddfa | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 76,613 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Wed Oct 13 15:58:00 GMT 2021
*/
package com.google.javascript.jscomp;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.junit.AfterClass;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class ScopedAliases_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "com.google.javascript.jscomp.ScopedAliases";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@AfterClass
public static void clearEvoSuiteFramework(){
Sandbox.resetDefaultSecurityManager();
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
setSystemProperties();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(ScopedAliases_ESTest_scaffolding.class.getClassLoader() ,
"com.google.common.collect.ArrayListMultimap",
"com.google.javascript.jscomp.Tracer$1",
"com.google.javascript.jscomp.CheckRequiresForConstructors",
"com.google.common.collect.Collections2",
"com.google.common.collect.PeekingIterator",
"com.google.javascript.jscomp.NodeTraversal$Callback",
"com.google.javascript.rhino.head.jdk13.VMBridge_jdk13",
"com.google.javascript.jscomp.CheckSideEffects",
"com.google.javascript.rhino.head.ast.Yield",
"com.google.javascript.jscomp.Scope$Arguments",
"com.google.javascript.jscomp.graph.Graph",
"com.google.javascript.rhino.jstype.StaticScope",
"com.google.javascript.jscomp.parsing.IRFactory$TransformDispatcher",
"com.google.common.collect.AbstractMapBasedMultiset$1",
"com.google.javascript.jscomp.JSModule",
"com.google.javascript.rhino.jstype.ObjectType",
"com.google.common.collect.Platform",
"com.google.common.collect.NullsLastOrdering",
"com.google.common.collect.RegularImmutableMap",
"com.google.common.collect.RegularImmutableBiMap",
"com.google.javascript.rhino.Node$NodeMismatch",
"com.google.javascript.rhino.head.ast.Jump",
"com.google.javascript.jscomp.Tracer",
"com.google.javascript.jscomp.HotSwapCompilerPass",
"com.google.javascript.jscomp.SourceFile$Builder",
"com.google.javascript.rhino.jstype.JSType$1",
"com.google.javascript.rhino.head.AttachJsDocs",
"com.google.javascript.jscomp.CheckEventfulObjectDisposal$EventfulObjectState",
"com.google.javascript.jscomp.CodingConvention",
"com.google.javascript.jscomp.type.ChainableReverseAbstractInterpreter",
"com.google.javascript.jscomp.SourceMap$DetailLevel",
"com.google.javascript.jscomp.MemoizedScopeCreator",
"com.google.javascript.rhino.head.ast.EmptyStatement",
"com.google.common.collect.ImmutableMapEntry$TerminalEntry",
"com.google.javascript.jscomp.CompilerOptions$1",
"com.google.common.base.Joiner",
"com.google.javascript.jscomp.CheckAccessControls",
"com.google.javascript.jscomp.CheckDebuggerStatement",
"com.google.javascript.jscomp.CheckEventfulObjectDisposal",
"com.google.javascript.jscomp.ReplaceIdGenerators",
"com.google.javascript.jscomp.CleanupPasses",
"com.google.common.collect.NullsFirstOrdering",
"com.google.javascript.rhino.head.ast.XmlFragment",
"com.google.javascript.jscomp.CompilerOptions$Reach",
"com.google.javascript.rhino.head.ast.CatchClause",
"com.google.javascript.jscomp.AnonymousFunctionNamingPolicy",
"com.google.javascript.rhino.InputId",
"com.google.common.collect.Lists$Partition",
"com.google.common.collect.AbstractMapBasedMultimap",
"com.google.javascript.rhino.head.ast.AstRoot",
"com.google.javascript.rhino.head.ast.NewExpression",
"com.google.javascript.rhino.ErrorReporter",
"com.google.javascript.rhino.jstype.ValueType",
"com.google.javascript.rhino.head.ast.ParenthesizedExpression",
"com.google.javascript.rhino.Token",
"com.google.javascript.jscomp.CssRenamingMap",
"com.google.javascript.rhino.head.Context$ClassShutterSetter",
"com.google.common.base.CharMatcher$5",
"com.google.common.base.CharMatcher$4",
"com.google.common.base.CharMatcher$3",
"com.google.javascript.jscomp.MakeDeclaredNamesUnique$ContextualRenamer",
"com.google.common.base.CharMatcher$2",
"com.google.common.base.CharMatcher$9",
"com.google.common.base.CharMatcher$8",
"com.google.common.base.CharMatcher$7",
"com.google.javascript.rhino.head.ast.Label",
"com.google.common.collect.Sets$ImprovedAbstractSet",
"com.google.common.base.CharMatcher$6",
"com.google.javascript.jscomp.type.SemanticReverseAbstractInterpreter",
"com.google.javascript.jscomp.SuppressDocWarningsGuard",
"com.google.javascript.jscomp.MessageFormatter",
"com.google.javascript.rhino.JSDocInfo",
"com.google.javascript.jscomp.SourceExcerptProvider$ExcerptFormatter",
"com.google.common.base.CharMatcher$1",
"com.google.javascript.jscomp.parsing.Config",
"com.google.common.collect.ImmutableMapValues",
"com.google.common.collect.ImmutableEntry",
"com.google.common.base.CharMatcher$FastMatcher",
"com.google.javascript.rhino.head.CompilerEnvirons",
"com.google.common.base.Joiner$1",
"com.google.common.base.Joiner$2",
"com.google.javascript.jscomp.ErrorHandler",
"com.google.javascript.rhino.head.Callable",
"com.google.javascript.jscomp.SourceFile$Preloaded",
"com.google.common.collect.ImmutableEnumMap",
"com.google.common.collect.ImmutableCollection",
"com.google.javascript.rhino.head.ast.ScriptNode",
"com.google.javascript.rhino.head.ast.XmlString",
"com.google.javascript.jscomp.StrictModeCheck",
"com.google.javascript.rhino.head.ast.WhileLoop",
"com.google.javascript.jscomp.Result",
"com.google.common.base.CharMatcher$BitSetMatcher",
"com.google.javascript.jscomp.CompilerPass",
"com.google.javascript.jscomp.VariableRenamingPolicy",
"com.google.common.collect.ImmutableCollection$Builder",
"com.google.javascript.rhino.head.ast.IfStatement",
"com.google.javascript.jscomp.CodeChangeHandler",
"com.google.common.collect.Lists$AbstractListWrapper",
"com.google.javascript.jscomp.MakeDeclaredNamesUnique$Renamer",
"com.google.javascript.jscomp.FunctionTypeBuilder",
"com.google.javascript.jscomp.FunctionInformationMap",
"com.google.javascript.jscomp.RecentChange",
"com.google.common.collect.AbstractMapBasedMultiset",
"com.google.javascript.jscomp.NodeUtil$MayBeStringResultPredicate",
"com.google.javascript.jscomp.JsMessageVisitor$MalformedException",
"com.google.javascript.rhino.head.Evaluator",
"com.google.javascript.jscomp.CodingConventions$DefaultCodingConvention",
"com.google.javascript.rhino.head.ast.XmlElemRef",
"com.google.javascript.rhino.head.ast.VariableDeclaration",
"com.google.javascript.rhino.head.TokenStream",
"com.google.javascript.jscomp.CheckEventfulObjectDisposal$ComputeEventizeTraversal",
"com.google.javascript.rhino.head.ast.ObjectLiteral",
"com.google.common.collect.Lists$2",
"com.google.javascript.jscomp.JSSourceFile",
"com.google.javascript.jscomp.CodingConventions",
"com.google.common.collect.RegularImmutableMap$NonTerminalMapEntry",
"com.google.common.collect.Lists$1",
"com.google.javascript.rhino.jstype.StaticReference",
"com.google.javascript.jscomp.PreprocessorSymbolTable",
"com.google.common.collect.Multiset",
"com.google.javascript.rhino.head.ast.InfixExpression",
"com.google.javascript.rhino.head.BaseFunction",
"com.google.common.base.Supplier",
"com.google.protobuf.MessageOrBuilder",
"com.google.javascript.jscomp.GlobalVarReferenceMap",
"com.google.javascript.jscomp.graph.LinkedDirectedGraph",
"com.google.common.collect.Maps$ImprovedAbstractMap",
"com.google.javascript.rhino.head.ast.XmlPropRef",
"com.google.javascript.jscomp.TypeValidator",
"com.google.common.collect.ImmutableList",
"com.google.common.collect.ReverseOrdering",
"com.google.protobuf.GeneratedMessage",
"com.google.javascript.rhino.Node$AbstractPropListItem",
"com.google.javascript.jscomp.Tracer$InternalClock",
"com.google.common.collect.SortedMultisetBridge",
"com.google.javascript.rhino.head.ast.VariableInitializer",
"com.google.javascript.rhino.head.ast.ThrowStatement",
"com.google.protobuf.MessageLiteOrBuilder",
"com.google.protobuf.MessageLite",
"com.google.common.collect.Maps$EntryTransformer",
"com.google.common.collect.Ordering",
"com.google.javascript.jscomp.CustomPassExecutionTime",
"com.google.javascript.jscomp.SyntacticScopeCreator",
"com.google.javascript.rhino.head.debug.DebuggableScript",
"com.google.common.collect.AllEqualOrdering",
"com.google.javascript.jscomp.CompilerOptions$TweakProcessing",
"com.google.common.collect.Hashing",
"com.google.javascript.rhino.head.DefaultErrorReporter",
"com.google.javascript.jscomp.SourceMap$Format",
"com.google.javascript.rhino.head.Script",
"com.google.javascript.rhino.head.ScriptRuntime$DefaultMessageProvider",
"com.google.javascript.rhino.TokenStream",
"com.google.common.collect.AbstractMapBasedMultimap$WrappedCollection",
"com.google.common.collect.SortedMultiset",
"com.google.javascript.rhino.head.ast.Comment",
"com.google.javascript.jscomp.CodingConventions$Proxy",
"com.google.javascript.jscomp.SourceExcerptProvider$SourceExcerpt",
"com.google.common.base.CharMatcher$NegatedFastMatcher",
"com.google.javascript.rhino.head.optimizer.Codegen",
"com.google.javascript.rhino.head.ast.FunctionCall",
"com.google.common.collect.SortedMapDifference",
"com.google.javascript.jscomp.RhinoErrorReporter$NewRhinoErrorReporter",
"com.google.common.collect.RegularImmutableSet",
"com.google.javascript.jscomp.NodeUtil",
"com.google.javascript.jscomp.JsMessageVisitor",
"com.google.javascript.rhino.head.EcmaError",
"com.google.javascript.rhino.head.FunctionObject",
"com.google.common.collect.LexicographicalOrdering",
"com.google.common.collect.Multisets$5",
"com.google.javascript.rhino.head.NativeContinuation",
"com.google.javascript.rhino.head.xml.XMLObject",
"com.google.javascript.rhino.head.Node$NodeIterator",
"com.google.common.collect.ImmutableAsList",
"com.google.javascript.jscomp.PassConfig",
"com.google.common.collect.RegularImmutableAsList",
"com.google.common.collect.SingletonImmutableSet",
"com.google.javascript.jscomp.Normalize$NormalizeStatements",
"com.google.javascript.rhino.head.InterpretedFunction",
"com.google.common.collect.ImmutableMapEntrySet",
"com.google.javascript.rhino.Node$SideEffectFlags",
"com.google.javascript.jscomp.ReferenceCollectingCallback$ReferenceMap",
"com.google.javascript.jscomp.LightweightMessageFormatter",
"com.google.javascript.jscomp.Compiler$CodeBuilder",
"com.google.javascript.jscomp.FunctionInformationMapOrBuilder",
"com.google.javascript.jscomp.ScopedAliases$Traversal",
"com.google.common.collect.ObjectArrays",
"com.google.common.collect.AbstractIterator",
"com.google.javascript.rhino.head.ScriptableObject$GetterSlot",
"com.google.javascript.jscomp.BasicErrorManager$ErrorWithLevel",
"com.google.common.base.CharMatcher$And",
"com.google.javascript.jscomp.DiagnosticType",
"com.google.javascript.jscomp.CompilerOptions$NullAliasTransformationHandler$NullAliasTransformation",
"com.google.common.collect.ImmutableList$1",
"com.google.javascript.jscomp.PrepareAst",
"com.google.javascript.rhino.head.ast.ForLoop",
"com.google.common.collect.ImmutableMap$MapViewOfValuesAsSingletonSets",
"com.google.common.collect.SortedIterable",
"com.google.javascript.jscomp.CompilerInput",
"com.google.javascript.rhino.head.ast.FunctionNode",
"com.google.javascript.jscomp.AbstractCompiler",
"com.google.javascript.jscomp.CheckEventfulObjectDisposal$DisposalCheckingPolicy",
"com.google.common.collect.UnmodifiableIterator",
"com.google.javascript.rhino.head.Context",
"com.google.common.collect.AbstractMapBasedMultimap$RandomAccessWrappedList",
"com.google.javascript.jscomp.DiagnosticGroup",
"com.google.javascript.jscomp.SyntacticScopeCreator$RedeclarationHandler",
"com.google.javascript.jscomp.NodeUtil$Visitor",
"com.google.javascript.rhino.head.NativeBoolean",
"com.google.javascript.rhino.Node$AncestorIterable",
"com.google.javascript.rhino.head.ast.Name",
"com.google.common.collect.ImmutableEnumSet",
"com.google.common.collect.AbstractMapBasedMultimap$WrappedList",
"com.google.common.collect.HashMultiset",
"com.google.protobuf.AbstractMessageLite",
"com.google.javascript.jscomp.ErrorManager",
"com.google.common.base.CharMatcher$RangesMatcher",
"com.google.javascript.jscomp.NodeUtil$NumbericResultPredicate",
"com.google.common.collect.SingletonImmutableList",
"com.google.javascript.rhino.head.ast.ConditionalExpression",
"com.google.javascript.jscomp.CheckLevel",
"com.google.javascript.rhino.jstype.StaticSlot",
"com.google.javascript.rhino.head.ast.PropertyGet",
"com.google.javascript.rhino.head.ContextFactory",
"com.google.common.base.Function",
"com.google.common.collect.ImmutableMap",
"com.google.javascript.rhino.head.VMBridge",
"com.google.common.collect.Multiset$Entry",
"com.google.javascript.rhino.head.ast.Loop",
"com.google.common.collect.ExplicitOrdering",
"com.google.javascript.jscomp.Region",
"com.google.javascript.rhino.head.ast.GeneratorExpressionLoop",
"com.google.javascript.rhino.IR",
"com.google.javascript.jscomp.NodeTraversal$AbstractPostOrderCallback",
"com.google.javascript.jscomp.DefaultPassConfig",
"com.google.javascript.jscomp.Normalize",
"com.google.javascript.jscomp.CompilerOptions$TracerMode",
"com.google.javascript.jscomp.RhinoErrorReporter$OldRhinoErrorReporter",
"com.google.common.collect.AbstractMultiset",
"com.google.javascript.jscomp.CheckMissingReturn$1",
"com.google.javascript.jscomp.CheckMissingReturn$2",
"com.google.common.collect.Iterators",
"com.google.common.collect.CompoundOrdering",
"com.google.javascript.rhino.head.IdFunctionCall",
"com.google.javascript.jscomp.ProcessTweaks$TweakFunction",
"com.google.javascript.rhino.head.ast.SwitchStatement",
"com.google.javascript.jscomp.DependencyOptions",
"com.google.common.collect.SingletonImmutableBiMap",
"com.google.common.collect.Multisets$EntrySet",
"com.google.javascript.rhino.head.ast.DoLoop",
"com.google.javascript.jscomp.SourceFile$OnDisk",
"com.google.javascript.jscomp.RenamingMap",
"com.google.javascript.rhino.head.ScriptRuntime",
"com.google.common.collect.Maps",
"com.google.common.primitives.Ints",
"com.google.javascript.rhino.head.ast.ExpressionStatement",
"com.google.common.collect.Iterators$MergingIterator",
"com.google.javascript.jscomp.Tracer$Stat",
"com.google.javascript.rhino.head.ScriptableObject",
"com.google.javascript.rhino.head.IdScriptableObject",
"com.google.javascript.rhino.head.NativeFunction",
"com.google.javascript.rhino.head.ast.ObjectProperty",
"com.google.javascript.rhino.head.Icode",
"com.google.javascript.jscomp.MakeDeclaredNamesUnique",
"com.google.javascript.jscomp.type.ReverseAbstractInterpreter",
"com.google.javascript.jscomp.CompilerOptions$LanguageMode",
"com.google.javascript.rhino.head.ast.UnaryExpression",
"com.google.javascript.jscomp.CheckEventfulObjectDisposal$SeenType",
"com.google.javascript.rhino.jstype.PrototypeObjectType",
"com.google.javascript.rhino.SimpleErrorReporter",
"com.google.common.collect.Lists$RandomAccessPartition",
"com.google.javascript.rhino.head.WrappedException",
"com.google.javascript.rhino.head.debug.DebuggableObject",
"com.google.javascript.rhino.head.Function",
"com.google.javascript.jscomp.PassFactory",
"com.google.common.collect.Sets$2",
"com.google.javascript.rhino.Node$IntPropListItem",
"com.google.common.collect.Sets$3",
"com.google.javascript.rhino.head.ast.LetNode",
"com.google.common.collect.Sets$1",
"com.google.javascript.jscomp.parsing.IRFactory$1",
"com.google.javascript.jscomp.ControlFlowGraph",
"com.google.javascript.jscomp.graph.GraphvizGraph",
"com.google.javascript.rhino.head.ContextFactory$Listener",
"com.google.javascript.rhino.head.NativeCall",
"com.google.common.collect.ByFunctionOrdering",
"com.google.common.collect.AbstractMapEntry",
"com.google.common.collect.Iterators$12",
"com.google.common.collect.Iterators$11",
"com.google.javascript.jscomp.ClosureCodingConvention",
"com.google.common.collect.EmptyImmutableBiMap",
"com.google.common.base.Predicate",
"com.google.javascript.jscomp.ReplaceIdGenerators$NameSupplier",
"com.google.javascript.jscomp.ReplaceIdGenerators$UniqueRenamingToken",
"com.google.javascript.jscomp.ControlStructureCheck",
"com.google.javascript.jscomp.VariableReferenceCheck",
"com.google.javascript.jscomp.WarningsGuard",
"com.google.javascript.jscomp.SourceMap",
"com.google.javascript.rhino.head.ast.ForInLoop",
"com.google.javascript.jscomp.Tracer$AtomicTracerStatMap",
"com.google.javascript.jscomp.parsing.TypeSafeDispatcher",
"com.google.javascript.jscomp.LightweightMessageFormatter$LineNumberingFormatter",
"com.google.common.collect.AbstractListMultimap",
"com.google.javascript.jscomp.CompilerOptions",
"com.google.javascript.rhino.Node$StringNode",
"com.google.common.collect.Iterators$13",
"com.google.common.collect.Lists",
"com.google.javascript.jscomp.CheckProvides",
"com.google.javascript.rhino.head.ast.Block",
"com.google.common.collect.UnmodifiableListIterator",
"com.google.javascript.rhino.head.ast.SwitchCase",
"com.google.javascript.jscomp.CheckEventfulObjectDisposal$Traversal",
"com.google.javascript.jscomp.RhinoErrorReporter",
"com.google.javascript.jscomp.CompilerOptions$AliasTransformation",
"com.google.common.base.Charsets",
"com.google.javascript.rhino.head.ast.StringLiteral",
"com.google.javascript.jscomp.CheckGlobalNames",
"com.google.javascript.rhino.Node$FileLevelJsDocBuilder",
"com.google.javascript.rhino.jstype.StaticSourceFile",
"org.mozilla.classfile.ClassFileWriter$ClassFileFormatException",
"com.google.javascript.rhino.head.ScriptableObject$Slot",
"com.google.javascript.rhino.head.ast.ReturnStatement",
"com.google.javascript.jscomp.parsing.ParserRunner$ParseResult",
"com.google.common.base.CharMatcher",
"com.google.common.base.Joiner$MapJoiner",
"com.google.javascript.jscomp.CheckRegExp",
"com.google.javascript.jscomp.CheckGlobalThis",
"com.google.common.collect.AbstractMultiset$EntrySet",
"com.google.javascript.jscomp.SourceExcerptProvider$SourceExcerpt$2",
"com.google.javascript.jscomp.DiagnosticGroupWarningsGuard",
"com.google.common.base.Preconditions",
"com.google.javascript.jscomp.SourceExcerptProvider$SourceExcerpt$1",
"com.google.javascript.rhino.head.ast.ArrayLiteral",
"com.google.javascript.rhino.head.ast.RegExpLiteral",
"com.google.javascript.jscomp.BasicErrorManager",
"com.google.javascript.jscomp.PerformanceTracker",
"com.google.javascript.jscomp.ComposeWarningsGuard$GuardComparator",
"com.google.javascript.jscomp.ProcessDefines",
"com.google.javascript.jscomp.ScopedAliases",
"com.google.javascript.rhino.head.NativeArray",
"com.google.javascript.rhino.Node$NumberNode",
"com.google.javascript.jscomp.Scope",
"com.google.javascript.rhino.head.Parser",
"com.google.common.collect.Iterators$6",
"com.google.javascript.jscomp.ErrorFormat$2",
"com.google.common.collect.BiMap",
"com.google.common.collect.Iterators$7",
"com.google.javascript.rhino.head.NativeString",
"com.google.javascript.jscomp.ErrorFormat$3",
"com.google.javascript.jscomp.Scope$Var",
"com.google.javascript.jscomp.ErrorFormat$4",
"com.google.javascript.rhino.head.ast.XmlRef",
"com.google.common.collect.ImmutableSet",
"com.google.common.collect.ImmutableMapEntry",
"com.google.javascript.rhino.head.ast.ElementGet",
"com.google.common.collect.Iterators$1",
"com.google.javascript.jscomp.DisambiguateProperties$Warnings",
"com.google.common.collect.Iterators$2",
"com.google.javascript.jscomp.JSModuleGraph$MissingModuleException",
"com.google.common.collect.Iterators$3",
"com.google.javascript.jscomp.parsing.Annotation",
"com.google.javascript.jscomp.AbstractMessageFormatter",
"com.google.common.collect.Lists$StringAsImmutableList",
"com.google.javascript.rhino.head.JavaScriptException",
"com.google.javascript.rhino.head.ast.IdeErrorReporter",
"com.google.javascript.jscomp.ProcessTweaks",
"com.google.javascript.jscomp.NodeUtil$1",
"com.google.javascript.rhino.head.ast.TryStatement",
"com.google.javascript.jscomp.parsing.IRFactory",
"com.google.javascript.rhino.head.TopLevel",
"com.google.javascript.jscomp.ErrorFormat$1",
"com.google.javascript.jscomp.PrepareAst$PrepareAnnotations",
"com.google.javascript.jscomp.Compiler$1",
"com.google.javascript.jscomp.Scope$1",
"com.google.javascript.jscomp.Compiler$4",
"com.google.common.collect.AbstractMultimap",
"com.google.common.collect.EmptyImmutableSet",
"com.google.common.collect.AbstractMapBasedMultimap$SortedAsMap",
"com.google.javascript.jscomp.ScopedAliases$Traversal$1",
"com.google.common.collect.AbstractMapBasedMultimap$SortedKeySet",
"com.google.javascript.jscomp.NodeUtil$MatchNotFunction",
"com.google.javascript.jscomp.parsing.Config$LanguageMode",
"com.google.javascript.rhino.head.ast.ArrayComprehension",
"com.google.protobuf.AbstractMessage",
"com.google.javascript.rhino.head.ScriptRuntime$1",
"com.google.javascript.rhino.head.ObjToIntMap",
"com.google.javascript.jscomp.CheckEventfulObjectDisposal$1",
"com.google.common.collect.ImmutableMap$Builder",
"com.google.javascript.rhino.head.ConstProperties",
"com.google.javascript.jscomp.deps.SortedDependencies$MissingProvideException",
"com.google.common.collect.NaturalOrdering",
"com.google.common.collect.ImmutableList$SubList",
"com.google.common.collect.ListMultimap",
"com.google.javascript.rhino.head.ast.DestructuringForm",
"com.google.javascript.jscomp.SourceMap$Format$4",
"com.google.javascript.jscomp.SourceMap$Format$3",
"com.google.javascript.jscomp.SourceMap$Format$2",
"com.google.javascript.jscomp.SourceMap$Format$1",
"com.google.javascript.jscomp.SourceAst",
"com.google.common.collect.RegularImmutableList",
"com.google.javascript.jscomp.MessageBundle",
"com.google.javascript.jscomp.CheckUnreachableCode",
"com.google.javascript.jscomp.SourceExcerptProvider",
"com.google.javascript.rhino.head.ScriptableObject$RelinkedSlot",
"com.google.common.collect.Lists$TransformingRandomAccessList",
"com.google.javascript.jscomp.ReferenceCollectingCallback$Behavior",
"com.google.javascript.rhino.Node$PropListItem",
"com.google.common.collect.Maps$KeySet",
"com.google.javascript.rhino.Node",
"com.google.javascript.rhino.head.RhinoException",
"com.google.javascript.rhino.SourcePosition",
"com.google.javascript.rhino.head.ast.EmptyExpression",
"com.google.javascript.rhino.head.ast.XmlLiteral",
"com.google.javascript.rhino.head.ast.ContinueStatement",
"com.google.common.collect.ImmutableMapKeySet",
"com.google.javascript.jscomp.LoggerErrorManager",
"com.google.javascript.jscomp.ComposeWarningsGuard",
"com.google.javascript.jscomp.NodeTraversal",
"com.google.javascript.rhino.head.ErrorReporter",
"com.google.common.collect.Multisets",
"com.google.javascript.jscomp.VariableMap",
"com.google.javascript.jscomp.JsAst",
"com.google.javascript.rhino.head.ast.XmlMemberGet",
"com.google.javascript.jscomp.ErrorFormat",
"com.google.javascript.rhino.head.ast.Scope",
"com.google.javascript.jscomp.AbstractCompiler$LifeCycleStage",
"com.google.javascript.rhino.head.Scriptable",
"com.google.javascript.jscomp.NodeUtil$BooleanResultPredicate",
"com.google.javascript.jscomp.CompilerOptions$NullAliasTransformationHandler",
"com.google.javascript.rhino.jstype.JSType",
"com.google.common.collect.Sets$SetView",
"com.google.javascript.jscomp.PhaseOptimizer",
"com.google.javascript.jscomp.DiagnosticGroups",
"com.google.javascript.rhino.jstype.RelationshipVisitor",
"com.google.javascript.jscomp.ScopeCreator",
"com.google.common.collect.UsingToStringOrdering",
"com.google.javascript.jscomp.graph.AdjacencyGraph",
"com.google.javascript.jscomp.deps.SortedDependencies$CircularDependencyException",
"com.google.javascript.rhino.head.NativeNumber",
"com.google.common.collect.Lists$TransformingSequentialList",
"com.google.javascript.jscomp.SourceFile",
"com.google.javascript.rhino.head.ast.BreakStatement",
"com.google.common.collect.AbstractMapBasedMultimap$AsMap",
"com.google.javascript.jscomp.PropertyRenamingPolicy",
"com.google.common.base.CharMatcher$NegatedMatcher",
"com.google.javascript.rhino.head.ast.WithStatement",
"com.google.javascript.rhino.head.ScriptRuntime$MessageProvider",
"com.google.common.collect.MapDifference",
"com.google.javascript.jscomp.CompilerOptions$AliasTransformationHandler",
"com.google.javascript.jscomp.SourceFile$Generated",
"com.google.javascript.rhino.jstype.FunctionType",
"com.google.javascript.rhino.head.ast.AstNode",
"com.google.javascript.jscomp.Compiler",
"com.google.javascript.jscomp.NodeTraversal$ScopedCallback",
"com.google.javascript.jscomp.TypedScopeCreator",
"com.google.javascript.rhino.jstype.CanCastToVisitor",
"com.google.common.base.CharMatcher$12",
"com.google.common.base.CharMatcher$11",
"com.google.javascript.rhino.head.Node",
"com.google.common.base.CharMatcher$10",
"com.google.javascript.jscomp.JSError",
"com.google.common.base.CharMatcher$15",
"com.google.common.base.CharMatcher$14",
"com.google.common.collect.AbstractMapBasedMultimap$KeySet",
"com.google.common.collect.Lists$RandomAccessListWrapper",
"com.google.common.base.CharMatcher$13",
"com.google.javascript.jscomp.Scope$TypeResolver",
"com.google.javascript.jscomp.TypedScopeCreator$GlobalScopeBuilder",
"com.google.javascript.jscomp.CheckMissingReturn",
"com.google.javascript.rhino.head.ast.KeywordLiteral",
"com.google.javascript.rhino.head.ast.Assignment",
"com.google.common.collect.ImmutableList$ReverseImmutableList",
"com.google.javascript.rhino.head.ast.LabeledStatement",
"com.google.common.collect.ComparatorOrdering",
"com.google.common.collect.AbstractIndexedListIterator",
"com.google.common.collect.Maps$1",
"com.google.javascript.rhino.head.ast.XmlExpression",
"com.google.javascript.jscomp.JSModuleGraph",
"com.google.common.collect.CollectPreconditions",
"com.google.javascript.rhino.jstype.SimpleSlot",
"com.google.javascript.jscomp.SyntacticScopeCreator$DefaultRedeclarationHandler",
"com.google.common.collect.Sets",
"com.google.javascript.rhino.head.Kit",
"com.google.javascript.jscomp.TypedScopeCreator$LocalScopeBuilder",
"com.google.javascript.jscomp.BasicErrorManager$LeveledJSErrorComparator",
"com.google.javascript.rhino.head.jdk15.VMBridge_jdk15",
"com.google.javascript.rhino.Node$ObjectPropListItem",
"com.google.javascript.rhino.head.ContextAction",
"com.google.javascript.rhino.head.EvaluatorException",
"com.google.javascript.rhino.head.ast.NumberLiteral",
"com.google.javascript.jscomp.Compiler$IntermediateState",
"com.google.javascript.rhino.head.ast.ErrorNode",
"com.google.common.collect.Multimap",
"com.google.javascript.jscomp.SourceMap$DetailLevel$2",
"com.google.javascript.jscomp.SourceMap$DetailLevel$1",
"com.google.common.collect.ImmutableBiMap",
"com.google.javascript.jscomp.VarCheck",
"com.google.javascript.jscomp.CompilerOptions$DevMode",
"com.google.javascript.jscomp.TypedScopeCreator$AbstractScopeBuilder",
"com.google.javascript.rhino.head.Interpreter",
"com.google.javascript.rhino.head.ImporterTopLevel",
"com.google.javascript.rhino.jstype.StaticSymbolTable",
"com.google.javascript.jscomp.JSModuleGraph$ModuleDependenceException",
"com.google.javascript.rhino.jstype.JSTypeRegistry",
"com.google.javascript.jscomp.graph.DiGraph",
"com.google.javascript.jscomp.CheckSuspiciousCode",
"com.google.javascript.jscomp.Compiler$11",
"com.google.javascript.jscomp.parsing.ParserRunner",
"com.google.common.collect.RegularImmutableMap$EntrySet",
"com.google.javascript.rhino.head.ast.GeneratorExpression",
"com.google.javascript.rhino.head.ast.XmlDotQuery",
"com.google.javascript.jscomp.ConstCheck",
"com.google.javascript.rhino.jstype.Visitor",
"com.google.javascript.jscomp.TypeCheck",
"com.google.javascript.jscomp.SymbolTable",
"com.google.javascript.jscomp.deps.DependencyInfo",
"com.google.javascript.jscomp.WarningsGuard$Priority",
"com.google.javascript.rhino.head.ContextFactory$GlobalSetter",
"com.google.common.base.CharMatcher$Or",
"com.google.javascript.rhino.head.ast.NodeVisitor",
"com.google.protobuf.Message",
"com.google.javascript.rhino.head.ast.ArrayComprehensionLoop",
"com.google.javascript.rhino.head.Parser$ParserException",
"com.google.javascript.rhino.head.NativeObject"
);
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(ScopedAliases_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"com.google.javascript.jscomp.DiagnosticType",
"com.google.javascript.jscomp.CheckLevel",
"com.google.javascript.jscomp.ScopedAliases",
"com.google.javascript.jscomp.ScopedAliases$Traversal",
"com.google.javascript.jscomp.ScopedAliases$AliasUsage",
"com.google.javascript.jscomp.ScopedAliases$AliasedNode",
"com.google.javascript.jscomp.ScopedAliases$AliasedTypeNode",
"com.google.common.collect.ImmutableCollection",
"com.google.common.collect.ImmutableSet",
"com.google.common.collect.EmptyImmutableSet",
"com.google.javascript.jscomp.AbstractCompiler",
"com.google.javascript.jscomp.Compiler$1",
"com.google.javascript.jscomp.Compiler",
"com.google.javascript.jscomp.AbstractCompiler$LifeCycleStage",
"com.google.common.base.Joiner",
"com.google.common.base.Preconditions",
"com.google.common.base.Joiner$1",
"com.google.common.collect.Collections2",
"com.google.common.base.Joiner$MapJoiner",
"com.google.common.collect.Maps",
"com.google.javascript.jscomp.CodingConventions$Proxy",
"com.google.javascript.jscomp.ClosureCodingConvention",
"com.google.javascript.jscomp.CodingConventions",
"com.google.javascript.jscomp.CodingConventions$DefaultCodingConvention",
"com.google.common.collect.ObjectArrays",
"com.google.common.collect.Hashing",
"com.google.common.collect.RegularImmutableSet",
"com.google.common.collect.Sets",
"com.google.common.collect.RegularImmutableList",
"com.google.common.collect.ImmutableList",
"com.google.common.collect.UnmodifiableIterator",
"com.google.common.collect.UnmodifiableListIterator",
"com.google.common.collect.Iterators$1",
"com.google.common.collect.Iterators$2",
"com.google.common.collect.Iterators",
"com.google.javascript.jscomp.RhinoErrorReporter",
"com.google.javascript.jscomp.RhinoErrorReporter$OldRhinoErrorReporter",
"com.google.common.collect.ImmutableMap",
"com.google.common.collect.ImmutableMap$Builder",
"com.google.javascript.rhino.head.Kit",
"com.google.javascript.rhino.head.optimizer.Codegen",
"com.google.javascript.rhino.head.Icode",
"com.google.javascript.rhino.head.Interpreter",
"com.google.javascript.rhino.head.Context",
"com.google.javascript.rhino.head.ContextFactory",
"com.google.javascript.rhino.head.ScriptableObject",
"com.google.javascript.rhino.head.ScriptRuntime$DefaultMessageProvider",
"com.google.javascript.rhino.head.ScriptRuntime",
"com.google.javascript.rhino.head.jdk13.VMBridge_jdk13",
"com.google.javascript.rhino.head.jdk15.VMBridge_jdk15",
"com.google.javascript.rhino.head.VMBridge",
"com.google.common.collect.CollectPreconditions",
"com.google.common.collect.AbstractMapEntry",
"com.google.common.collect.ImmutableEntry",
"com.google.common.collect.ImmutableMapEntry",
"com.google.common.collect.ImmutableMapEntry$TerminalEntry",
"com.google.javascript.rhino.SimpleErrorReporter",
"com.google.common.collect.ImmutableCollection$Builder",
"com.google.common.collect.Platform",
"com.google.common.collect.RegularImmutableMap",
"com.google.javascript.jscomp.RhinoErrorReporter$NewRhinoErrorReporter",
"com.google.common.collect.RegularImmutableMap$NonTerminalMapEntry",
"com.google.javascript.jscomp.PassFactory",
"com.google.javascript.jscomp.Compiler$4",
"com.google.javascript.jscomp.RecentChange",
"com.google.common.collect.Lists",
"com.google.javascript.jscomp.PassConfig",
"com.google.javascript.jscomp.DefaultPassConfig",
"com.google.javascript.jscomp.CrossModuleMethodMotion$IdGenerator",
"com.google.javascript.jscomp.DefaultPassConfig$HotSwapPassFactory",
"com.google.javascript.jscomp.DefaultPassConfig$1",
"com.google.javascript.jscomp.DefaultPassConfig$2",
"com.google.javascript.jscomp.DefaultPassConfig$3",
"com.google.javascript.jscomp.DefaultPassConfig$4",
"com.google.javascript.jscomp.DefaultPassConfig$5",
"com.google.javascript.jscomp.DefaultPassConfig$6",
"com.google.javascript.jscomp.DefaultPassConfig$7",
"com.google.javascript.jscomp.DefaultPassConfig$8",
"com.google.javascript.jscomp.DefaultPassConfig$9",
"com.google.javascript.jscomp.DefaultPassConfig$10",
"com.google.javascript.jscomp.DefaultPassConfig$11",
"com.google.javascript.jscomp.DefaultPassConfig$12",
"com.google.javascript.jscomp.DefaultPassConfig$13",
"com.google.javascript.jscomp.DefaultPassConfig$14",
"com.google.javascript.jscomp.DefaultPassConfig$15",
"com.google.javascript.jscomp.DefaultPassConfig$16",
"com.google.javascript.jscomp.DefaultPassConfig$17",
"com.google.javascript.jscomp.DefaultPassConfig$18",
"com.google.javascript.jscomp.DefaultPassConfig$19",
"com.google.javascript.jscomp.DefaultPassConfig$20",
"com.google.javascript.jscomp.DefaultPassConfig$21",
"com.google.javascript.jscomp.DefaultPassConfig$22",
"com.google.javascript.jscomp.DefaultPassConfig$23",
"com.google.javascript.jscomp.DefaultPassConfig$24",
"com.google.javascript.jscomp.DefaultPassConfig$25",
"com.google.javascript.jscomp.DefaultPassConfig$26",
"com.google.javascript.jscomp.DefaultPassConfig$27",
"com.google.javascript.jscomp.DefaultPassConfig$28",
"com.google.javascript.jscomp.DefaultPassConfig$29",
"com.google.javascript.jscomp.DefaultPassConfig$30",
"com.google.javascript.jscomp.DefaultPassConfig$31",
"com.google.javascript.jscomp.DefaultPassConfig$32",
"com.google.javascript.jscomp.DefaultPassConfig$33",
"com.google.javascript.jscomp.DefaultPassConfig$34",
"com.google.javascript.jscomp.DefaultPassConfig$35",
"com.google.javascript.jscomp.DefaultPassConfig$36",
"com.google.javascript.jscomp.DefaultPassConfig$37",
"com.google.javascript.jscomp.DefaultPassConfig$38",
"com.google.javascript.jscomp.DefaultPassConfig$39",
"com.google.javascript.jscomp.DefaultPassConfig$40",
"com.google.javascript.jscomp.DefaultPassConfig$41",
"com.google.javascript.jscomp.DefaultPassConfig$42",
"com.google.javascript.jscomp.DefaultPassConfig$43",
"com.google.javascript.jscomp.DefaultPassConfig$44",
"com.google.javascript.jscomp.DefaultPassConfig$45",
"com.google.javascript.jscomp.DefaultPassConfig$46",
"com.google.javascript.jscomp.DefaultPassConfig$47",
"com.google.javascript.jscomp.DefaultPassConfig$48",
"com.google.javascript.jscomp.DefaultPassConfig$49",
"com.google.javascript.jscomp.DefaultPassConfig$50",
"com.google.javascript.jscomp.DefaultPassConfig$51",
"com.google.javascript.jscomp.DefaultPassConfig$52",
"com.google.javascript.jscomp.DefaultPassConfig$53",
"com.google.javascript.jscomp.DefaultPassConfig$54",
"com.google.javascript.jscomp.DefaultPassConfig$55",
"com.google.javascript.jscomp.DefaultPassConfig$56",
"com.google.javascript.jscomp.DefaultPassConfig$57",
"com.google.javascript.jscomp.DefaultPassConfig$58",
"com.google.javascript.jscomp.DefaultPassConfig$59",
"com.google.javascript.jscomp.DefaultPassConfig$60",
"com.google.javascript.jscomp.DefaultPassConfig$61",
"com.google.javascript.jscomp.DefaultPassConfig$62",
"com.google.javascript.jscomp.DefaultPassConfig$63",
"com.google.javascript.jscomp.DefaultPassConfig$64",
"com.google.javascript.jscomp.DefaultPassConfig$65",
"com.google.javascript.jscomp.DefaultPassConfig$66",
"com.google.javascript.jscomp.DefaultPassConfig$67",
"com.google.javascript.jscomp.DefaultPassConfig$68",
"com.google.javascript.jscomp.DefaultPassConfig$69",
"com.google.javascript.jscomp.DefaultPassConfig$70",
"com.google.javascript.jscomp.DefaultPassConfig$71",
"com.google.javascript.jscomp.DefaultPassConfig$72",
"com.google.javascript.jscomp.DefaultPassConfig$73",
"com.google.javascript.jscomp.DefaultPassConfig$74",
"com.google.javascript.jscomp.DefaultPassConfig$75",
"com.google.javascript.jscomp.DefaultPassConfig$76",
"com.google.javascript.jscomp.DefaultPassConfig$77",
"com.google.javascript.jscomp.DefaultPassConfig$78",
"com.google.javascript.jscomp.DefaultPassConfig$79",
"com.google.javascript.jscomp.DefaultPassConfig$80",
"com.google.javascript.jscomp.DefaultPassConfig$81",
"com.google.javascript.jscomp.DefaultPassConfig$82",
"com.google.javascript.jscomp.DefaultPassConfig$83",
"com.google.javascript.jscomp.DefaultPassConfig$84",
"com.google.javascript.jscomp.DefaultPassConfig$85",
"com.google.javascript.jscomp.DefaultPassConfig$86",
"com.google.javascript.jscomp.DefaultPassConfig$87",
"com.google.javascript.jscomp.DefaultPassConfig$88",
"com.google.javascript.jscomp.DefaultPassConfig$89",
"com.google.javascript.jscomp.DefaultPassConfig$90",
"com.google.javascript.jscomp.DefaultPassConfig$91",
"com.google.javascript.jscomp.DefaultPassConfig$92",
"com.google.javascript.jscomp.DefaultPassConfig$93",
"com.google.javascript.jscomp.DefaultPassConfig$94",
"com.google.javascript.jscomp.DefaultPassConfig$95",
"com.google.javascript.jscomp.DefaultPassConfig$96",
"com.google.javascript.jscomp.DefaultPassConfig$97",
"com.google.javascript.jscomp.DefaultPassConfig$98",
"com.google.javascript.jscomp.DefaultPassConfig$99",
"com.google.javascript.jscomp.DefaultPassConfig$100",
"com.google.javascript.jscomp.DefaultPassConfig$101",
"com.google.javascript.jscomp.DefaultPassConfig$102",
"com.google.javascript.jscomp.DefaultPassConfig$103",
"com.google.javascript.jscomp.DefaultPassConfig$104",
"com.google.javascript.jscomp.DefaultPassConfig$108",
"com.google.javascript.jscomp.DefaultPassConfig$109",
"com.google.javascript.jscomp.Tracer$1",
"com.google.javascript.jscomp.Tracer$Stat",
"com.google.javascript.jscomp.Tracer",
"com.google.javascript.jscomp.BasicErrorManager",
"com.google.javascript.jscomp.LoggerErrorManager",
"com.google.javascript.jscomp.ErrorFormat",
"com.google.javascript.jscomp.AbstractMessageFormatter",
"com.google.javascript.jscomp.LightweightMessageFormatter$LineNumberingFormatter",
"com.google.javascript.jscomp.LightweightMessageFormatter",
"com.google.javascript.jscomp.SourceExcerptProvider$SourceExcerpt",
"com.google.javascript.jscomp.BasicErrorManager$LeveledJSErrorComparator",
"com.google.javascript.jscomp.ReplaceIdGenerators$UniqueRenamingToken",
"com.google.javascript.jscomp.ReplaceIdGenerators",
"com.google.javascript.jscomp.CompilerOptions$NullAliasTransformationHandler$NullAliasTransformation",
"com.google.javascript.jscomp.CompilerOptions$NullAliasTransformationHandler",
"com.google.javascript.jscomp.CompilerOptions",
"com.google.javascript.jscomp.DependencyOptions",
"com.google.javascript.jscomp.WarningsGuard",
"com.google.javascript.jscomp.ComposeWarningsGuard",
"com.google.common.primitives.Ints",
"com.google.javascript.jscomp.ComposeWarningsGuard$GuardComparator",
"com.google.javascript.jscomp.SourceMap$DetailLevel",
"com.google.javascript.jscomp.SourceMap$Format",
"com.google.javascript.jscomp.CompilerOptions$LanguageMode",
"com.google.javascript.jscomp.CompilerOptions$DevMode",
"com.google.javascript.jscomp.CheckEventfulObjectDisposal$DisposalCheckingPolicy",
"com.google.javascript.jscomp.VariableRenamingPolicy",
"com.google.javascript.jscomp.PropertyRenamingPolicy",
"com.google.javascript.jscomp.AnonymousFunctionNamingPolicy",
"com.google.javascript.jscomp.CompilerOptions$TweakProcessing",
"com.google.common.collect.ImmutableBiMap",
"com.google.common.collect.EmptyImmutableBiMap",
"com.google.javascript.jscomp.CompilerOptions$TracerMode",
"com.google.common.collect.AbstractMultiset",
"com.google.common.collect.AbstractMapBasedMultiset",
"com.google.common.collect.HashMultiset",
"com.google.common.collect.Ordering",
"com.google.common.collect.Multisets$5",
"com.google.common.collect.Multisets",
"com.google.common.collect.Sets$ImprovedAbstractSet",
"com.google.common.collect.Multisets$EntrySet",
"com.google.common.collect.AbstractMultiset$EntrySet",
"com.google.common.collect.AbstractMapBasedMultiset$1",
"com.google.javascript.jscomp.NodeTraversal",
"com.google.javascript.jscomp.SyntacticScopeCreator",
"com.google.javascript.jscomp.SyntacticScopeCreator$DefaultRedeclarationHandler",
"com.google.javascript.jscomp.NodeUtil$1",
"com.google.javascript.jscomp.NodeUtil$NumbericResultPredicate",
"com.google.javascript.jscomp.NodeUtil$BooleanResultPredicate",
"com.google.javascript.jscomp.NodeUtil$MayBeStringResultPredicate",
"com.google.javascript.jscomp.NodeUtil$MatchNotFunction",
"com.google.javascript.jscomp.NodeUtil",
"com.google.javascript.rhino.Node",
"com.google.javascript.jscomp.PreprocessorSymbolTable",
"com.google.common.collect.AbstractMultimap",
"com.google.common.collect.AbstractMapBasedMultimap",
"com.google.common.collect.AbstractListMultimap",
"com.google.common.collect.ArrayListMultimap",
"com.google.javascript.jscomp.AbstractPeepholeOptimization",
"com.google.javascript.jscomp.CodeGenerator",
"com.google.javascript.jscomp.PeepholeSubstituteAlternateSyntax",
"com.google.javascript.rhino.Node$NumberNode",
"com.google.javascript.jscomp.ControlFlowAnalysis",
"com.google.javascript.jscomp.TightenTypes",
"com.google.javascript.jscomp.VerboseMessageFormatter",
"com.google.javascript.jscomp.Normalize",
"com.google.javascript.jscomp.CompilerInput",
"com.google.javascript.jscomp.SourceFile",
"com.google.javascript.jscomp.SourceFile$Builder",
"com.google.common.base.Charsets",
"com.google.javascript.jscomp.SourceFile$Preloaded",
"com.google.javascript.jscomp.JsAst",
"com.google.javascript.rhino.InputId",
"com.google.javascript.jscomp.SyntheticAst",
"com.google.javascript.rhino.IR",
"com.google.javascript.rhino.Node$AbstractPropListItem",
"com.google.javascript.rhino.Node$ObjectPropListItem",
"com.google.javascript.rhino.jstype.JSTypeRegistry",
"com.google.javascript.jscomp.CheckGlobalThis",
"com.google.javascript.jscomp.DiagnosticGroup",
"com.google.common.collect.SingletonImmutableSet",
"com.google.javascript.jscomp.CheckAccessControls",
"com.google.common.collect.AbstractIndexedListIterator",
"com.google.common.collect.Iterators$11",
"com.google.javascript.jscomp.TypeValidator",
"com.google.javascript.jscomp.NodeTraversal$AbstractPostOrderCallback",
"com.google.javascript.jscomp.VarCheck",
"com.google.javascript.jscomp.CheckGlobalNames",
"com.google.javascript.jscomp.VariableReferenceCheck",
"com.google.javascript.jscomp.StrictModeCheck",
"com.google.javascript.jscomp.ProcessDefines",
"com.google.common.base.CharMatcher$1",
"com.google.common.base.CharMatcher$FastMatcher",
"com.google.common.base.CharMatcher$13",
"com.google.common.base.CharMatcher$RangesMatcher",
"com.google.common.base.CharMatcher$2",
"com.google.common.base.CharMatcher$3",
"com.google.common.base.CharMatcher$4",
"com.google.common.base.CharMatcher$5",
"com.google.common.base.CharMatcher$6",
"com.google.common.base.CharMatcher$Or",
"com.google.common.base.CharMatcher$7",
"com.google.common.base.CharMatcher$8",
"com.google.common.base.CharMatcher$15",
"com.google.common.base.CharMatcher",
"com.google.common.base.CharMatcher$11",
"com.google.javascript.jscomp.ProcessTweaks$TweakFunction",
"com.google.javascript.jscomp.ProcessTweaks",
"com.google.javascript.rhino.jstype.CanCastToVisitor",
"com.google.javascript.rhino.jstype.JSType$1",
"com.google.javascript.rhino.jstype.JSType",
"com.google.javascript.rhino.jstype.ObjectType",
"com.google.javascript.jscomp.TypedScopeCreator",
"com.google.javascript.jscomp.FunctionTypeBuilder",
"com.google.javascript.jscomp.TypeCheck",
"com.google.javascript.jscomp.CheckMissingReturn$1",
"com.google.javascript.jscomp.CheckMissingReturn$2",
"com.google.javascript.jscomp.CheckMissingReturn",
"com.google.javascript.jscomp.CheckDebuggerStatement",
"com.google.javascript.jscomp.CheckRegExp",
"com.google.javascript.jscomp.CheckEventfulObjectDisposal",
"com.google.javascript.jscomp.CheckSideEffects",
"com.google.javascript.jscomp.CheckUnreachableCode",
"com.google.javascript.jscomp.ConstCheck",
"com.google.javascript.jscomp.DisambiguateProperties$Warnings",
"com.google.javascript.jscomp.ControlStructureCheck",
"com.google.javascript.jscomp.CheckProvides",
"com.google.javascript.jscomp.CheckRequiresForConstructors",
"com.google.javascript.jscomp.JsMessageVisitor",
"com.google.javascript.jscomp.CheckSuspiciousCode",
"com.google.javascript.jscomp.DiagnosticGroups",
"com.google.javascript.jscomp.DiagnosticGroupWarningsGuard",
"com.google.javascript.jscomp.WarningsGuard$Priority",
"com.google.javascript.jscomp.SuppressDocWarningsGuard",
"com.google.common.collect.ImmutableMapEntrySet",
"com.google.common.collect.RegularImmutableMap$EntrySet",
"com.google.common.collect.ImmutableAsList",
"com.google.common.collect.RegularImmutableAsList",
"com.google.javascript.jscomp.Compiler$11",
"com.google.javascript.jscomp.parsing.Config$LanguageMode",
"com.google.javascript.jscomp.parsing.ParserRunner",
"com.google.javascript.jscomp.parsing.Config",
"com.google.javascript.jscomp.parsing.Annotation",
"com.google.javascript.rhino.head.DefaultErrorReporter",
"com.google.javascript.rhino.head.CompilerEnvirons",
"com.google.javascript.rhino.head.Parser",
"com.google.javascript.rhino.head.TokenStream",
"com.google.javascript.rhino.head.ObjToIntMap",
"com.google.javascript.rhino.head.Node",
"com.google.javascript.rhino.head.ast.AstNode",
"com.google.javascript.rhino.head.ast.Jump",
"com.google.javascript.rhino.head.ast.Scope",
"com.google.javascript.rhino.head.ast.ScriptNode",
"com.google.javascript.rhino.head.ast.AstRoot",
"com.google.javascript.rhino.head.AttachJsDocs",
"com.google.javascript.jscomp.parsing.IRFactory",
"com.google.javascript.rhino.Node$FileLevelJsDocBuilder",
"com.google.javascript.jscomp.parsing.TypeSafeDispatcher",
"com.google.javascript.jscomp.parsing.IRFactory$TransformDispatcher",
"com.google.javascript.jscomp.parsing.IRFactory$1",
"com.google.javascript.rhino.head.Node$NodeIterator",
"com.google.javascript.rhino.Node$IntPropListItem",
"com.google.javascript.jscomp.parsing.ParserRunner$ParseResult",
"com.google.javascript.jscomp.PrepareAst",
"com.google.javascript.jscomp.PrepareAst$PrepareAnnotations",
"com.google.javascript.jscomp.ExploitAssigns",
"com.google.javascript.jscomp.Compiler$3",
"com.google.javascript.jscomp.DefaultPassConfig$105",
"com.google.javascript.jscomp.PrintStreamErrorManager",
"com.google.common.collect.AbstractSetMultimap",
"com.google.common.collect.LinkedHashMultimap",
"com.google.common.collect.LinkedHashMultimap$ValueEntry",
"com.google.javascript.rhino.jstype.TemplateTypeMap",
"com.google.javascript.rhino.jstype.ModificationVisitor",
"com.google.javascript.rhino.jstype.TemplateTypeMapReplacer",
"com.google.common.collect.ImmutableCollection$ArrayBasedBuilder",
"com.google.common.collect.ImmutableList$Builder",
"com.google.javascript.rhino.jstype.ProxyObjectType",
"com.google.javascript.rhino.jstype.TemplateType",
"com.google.javascript.rhino.jstype.ValueType",
"com.google.javascript.rhino.jstype.BooleanType",
"com.google.javascript.rhino.jstype.NullType",
"com.google.javascript.rhino.jstype.NumberType",
"com.google.javascript.rhino.jstype.StringType",
"com.google.javascript.rhino.jstype.UnknownType",
"com.google.javascript.rhino.jstype.VoidType",
"com.google.javascript.rhino.jstype.AllType",
"com.google.javascript.rhino.jstype.PrototypeObjectType",
"com.google.javascript.rhino.jstype.PropertyMap$1",
"com.google.javascript.rhino.jstype.PropertyMap",
"com.google.javascript.rhino.jstype.FunctionType",
"com.google.javascript.rhino.jstype.FunctionParamBuilder",
"com.google.javascript.rhino.Node$StringNode",
"com.google.javascript.rhino.jstype.ArrowType",
"com.google.javascript.rhino.jstype.FunctionType$Kind",
"com.google.javascript.rhino.jstype.FunctionType$PropAccess",
"com.google.javascript.rhino.jstype.InstanceObjectType",
"com.google.javascript.rhino.jstype.Property",
"com.google.javascript.rhino.jstype.NoObjectType",
"com.google.javascript.rhino.jstype.NoType",
"com.google.javascript.rhino.jstype.NoResolvedType",
"com.google.common.collect.SingletonImmutableList",
"com.google.javascript.rhino.jstype.ErrorFunctionType",
"com.google.javascript.rhino.jstype.UnionTypeBuilder",
"com.google.javascript.rhino.jstype.EquivalenceMethod",
"com.google.javascript.rhino.jstype.TemplateTypeMap$EquivalenceMatch",
"com.google.javascript.rhino.jstype.UnionType",
"com.google.javascript.rhino.jstype.FunctionBuilder",
"com.google.javascript.rhino.jstype.JSTypeRegistry$1",
"com.google.javascript.rhino.jstype.NamedType",
"com.google.javascript.jscomp.NameGenerator",
"com.google.javascript.jscomp.NameGenerator$CharPriority",
"com.google.common.primitives.Chars",
"com.google.common.primitives.Chars$CharArrayAsList",
"com.google.javascript.rhino.head.ast.Name",
"com.google.javascript.rhino.head.ast.ExpressionStatement",
"com.google.javascript.jscomp.JSError",
"com.google.javascript.jscomp.BasicErrorManager$ErrorWithLevel",
"com.google.javascript.rhino.head.Parser$ParserException",
"com.google.javascript.rhino.head.ast.EmptyStatement",
"com.google.javascript.rhino.head.RhinoException",
"com.google.javascript.rhino.head.EvaluatorException",
"com.google.javascript.jscomp.Normalize$NormalizeStatements",
"com.google.javascript.jscomp.MakeDeclaredNamesUnique",
"com.google.javascript.jscomp.MakeDeclaredNamesUnique$ContextualRenamer",
"com.google.javascript.jscomp.RemoveUnusedClassProperties",
"com.google.javascript.jscomp.Compiler$IntermediateState",
"com.google.javascript.jscomp.PassConfig$State",
"com.google.javascript.jscomp.PeepholeRemoveDeadCode$MatchUnnamedBreak",
"com.google.javascript.jscomp.PeepholeRemoveDeadCode",
"com.google.javascript.jscomp.ReorderConstantExpression",
"com.google.javascript.jscomp.graph.Graph",
"com.google.javascript.jscomp.graph.DiGraph",
"com.google.javascript.jscomp.graph.LinkedDirectedGraph",
"com.google.javascript.jscomp.PeepholeMinimizeConditions",
"com.google.javascript.jscomp.SourceFile$Generated",
"com.google.javascript.jscomp.Compiler$6",
"com.google.javascript.rhino.head.ast.UnaryExpression",
"com.google.common.collect.Iterables",
"com.google.javascript.rhino.Token",
"com.google.javascript.jscomp.Tracer$ThreadTrace",
"com.google.javascript.rhino.TokenStream",
"com.google.javascript.rhino.jstype.SimpleSourceFile",
"com.google.javascript.jscomp.GlobalNamespace$Ref",
"com.google.javascript.jscomp.StatementFusion",
"com.google.javascript.jscomp.PeepholeSimplifyRegExp",
"com.google.javascript.rhino.Node$AncestorIterable",
"com.google.javascript.rhino.Node$AncestorIterable$1",
"com.google.javascript.jscomp.ControlFlowAnalysis$1",
"com.google.common.collect.HashMultimap",
"com.google.javascript.jscomp.Compiler$CodeBuilder",
"com.google.javascript.jscomp.Compiler$10",
"com.google.javascript.jscomp.CheckMissingGetCssName",
"com.google.javascript.rhino.head.ast.InfixExpression",
"com.google.javascript.rhino.head.Token$CommentType",
"com.google.javascript.rhino.head.ast.Comment",
"com.google.javascript.rhino.head.ast.AstNode$PositionComparator",
"com.google.javascript.jscomp.SimpleDefinitionFinder",
"com.google.javascript.rhino.head.ast.PropertyGet",
"com.google.common.io.CharStreams",
"com.google.javascript.rhino.Node$NodeMismatch",
"com.google.javascript.jscomp.NodeTraversal$AbstractShallowCallback",
"com.google.javascript.jscomp.FieldCleanupPass$QualifiedNameSearchTraversal",
"com.google.javascript.jscomp.SymbolTable",
"com.google.javascript.rhino.Node$SiblingNodeIterable",
"com.google.javascript.rhino.head.ast.NumberLiteral",
"com.google.javascript.jscomp.CleanupPasses",
"com.google.javascript.jscomp.CleanupPasses$1",
"com.google.javascript.jscomp.CleanupPasses$2",
"com.google.javascript.jscomp.CleanupPasses$3",
"com.google.javascript.jscomp.PeepholeReplaceKnownMethods",
"com.google.javascript.rhino.head.ast.Label",
"com.google.javascript.rhino.head.ast.LabeledStatement",
"com.google.javascript.rhino.head.Token",
"com.google.javascript.jscomp.InferJSDocInfo",
"com.google.javascript.jscomp.PassConfig$PassConfigDelegate",
"com.google.javascript.jscomp.PeepholeFoldConstants",
"com.google.javascript.jscomp.AngularPass",
"com.google.javascript.jscomp.Compiler$5",
"com.google.javascript.jscomp.ProcessCommonJSModules",
"com.google.javascript.jscomp.Compiler$9",
"com.google.javascript.jscomp.SourceFile$OnDisk",
"com.google.javascript.jscomp.NameReferenceGraph$Reference",
"com.google.javascript.jscomp.TightenTypes$ConcreteScope",
"com.google.javascript.jscomp.PeepholeFoldWithTypes",
"com.google.javascript.jscomp.JSModuleGraph",
"com.google.javascript.rhino.jstype.NamespaceType",
"com.google.javascript.rhino.JSDocInfo",
"com.google.javascript.jscomp.PeepholeCollectPropertyAssignments",
"com.google.javascript.jscomp.Result",
"com.google.javascript.jscomp.JSModule",
"com.google.javascript.jscomp.RecordFunctionInformation",
"com.google.protobuf.AbstractMessageLite",
"com.google.protobuf.AbstractMessage",
"com.google.protobuf.GeneratedMessage",
"com.google.protobuf.UnknownFieldSet",
"com.google.javascript.jscomp.FunctionInformationMap",
"com.google.protobuf.AbstractMessageLite$Builder",
"com.google.protobuf.AbstractMessage$Builder",
"com.google.protobuf.GeneratedMessage$Builder",
"com.google.javascript.jscomp.FunctionInformationMap$Builder",
"com.google.common.collect.TreeTraverser",
"com.google.common.io.Files$2",
"com.google.common.io.Files",
"com.google.common.io.ByteSource",
"com.google.common.io.Files$FileByteSource",
"com.google.common.io.CharSource",
"com.google.common.io.ByteSource$AsCharSource",
"com.google.common.io.Closer$SuppressingSuppressor",
"com.google.common.io.Closer",
"com.google.common.base.Throwables",
"com.google.javascript.rhino.JSDocInfo$LazilyInitializedInfo",
"com.google.javascript.rhino.head.ast.FunctionCall",
"com.google.javascript.jscomp.CustomPassExecutionTime",
"com.google.javascript.rhino.jstype.EnumType",
"com.google.javascript.rhino.jstype.EnumElementType",
"com.google.javascript.jscomp.ShowByPathWarningsGuard",
"com.google.common.base.Splitter",
"com.google.common.base.Splitter$2",
"com.google.javascript.jscomp.WhitelistWarningsGuard",
"com.google.javascript.jscomp.EmptyMessageBundle",
"com.google.javascript.jscomp.Compiler$8",
"com.google.common.collect.Iterators$12",
"com.google.javascript.jscomp.SourceInformationAnnotator",
"com.google.javascript.jscomp.LinkedFlowScope",
"com.google.javascript.jscomp.LinkedFlowScope$FlatFlowScopeCache",
"com.google.javascript.jscomp.NameReferenceGraphConstruction",
"com.google.javascript.jscomp.NameReferenceGraph",
"com.google.javascript.jscomp.NameReferenceGraph$Name",
"com.google.common.collect.FluentIterable",
"com.google.common.collect.Iterables$2",
"com.google.common.collect.TransformedIterator",
"com.google.common.collect.Iterables$3",
"com.google.common.collect.Iterators$5",
"com.google.javascript.jscomp.graph.LinkedDirectedGraph$LinkedDirectedGraphNode",
"com.google.javascript.jscomp.graph.LinkedDirectedGraph$LinkedDirectedGraphEdge",
"com.google.javascript.jscomp.ConcreteType$ConcreteNoneType",
"com.google.javascript.jscomp.ConcreteType$ConcreteAll",
"com.google.javascript.jscomp.ConcreteType",
"com.google.javascript.jscomp.ConcreteType$ConcreteFunctionType",
"com.google.javascript.jscomp.DeadAssignmentsElimination$1",
"com.google.javascript.jscomp.DeadAssignmentsElimination",
"com.google.javascript.rhino.head.ast.ArrayLiteral",
"com.google.javascript.rhino.head.ast.Assignment",
"com.google.javascript.jscomp.LineNumberCheck",
"com.google.javascript.jscomp.Scope$1",
"com.google.javascript.jscomp.Scope",
"com.google.javascript.jscomp.GlobalNamespace",
"com.google.javascript.jscomp.GlobalNamespace$BuildGlobalNamespace",
"com.google.javascript.jscomp.GlobalNamespace$Name$Type",
"com.google.javascript.jscomp.type.ChainableReverseAbstractInterpreter",
"com.google.javascript.jscomp.type.SemanticReverseAbstractInterpreter$1",
"com.google.javascript.jscomp.type.SemanticReverseAbstractInterpreter$2",
"com.google.javascript.jscomp.type.SemanticReverseAbstractInterpreter$3",
"com.google.javascript.jscomp.type.SemanticReverseAbstractInterpreter$4",
"com.google.javascript.jscomp.type.SemanticReverseAbstractInterpreter",
"com.google.javascript.jscomp.GatherRawExports",
"com.google.javascript.rhino.jstype.SimpleSlot",
"com.google.common.collect.AbstractMapBasedMultimap$WrappedCollection",
"com.google.common.collect.AbstractMapBasedMultimap$WrappedList",
"com.google.common.collect.AbstractMapBasedMultimap$RandomAccessWrappedList",
"com.google.javascript.jscomp.TypeInferencePass",
"com.google.javascript.jscomp.type.ChainableReverseAbstractInterpreter$1",
"com.google.javascript.jscomp.type.ChainableReverseAbstractInterpreter$2",
"com.google.javascript.jscomp.type.SemanticReverseAbstractInterpreter$5",
"com.google.javascript.jscomp.CodingConvention$AssertionFunctionSpec",
"com.google.javascript.jscomp.ClosureCodingConvention$AssertFunctionByTypeName",
"com.google.javascript.jscomp.ClosureCodingConvention$AssertInstanceofSpec",
"com.google.javascript.jscomp.MakeDeclaredNamesUnique$BoilerplateRenamer",
"com.google.javascript.rhino.head.ast.VariableDeclaration",
"com.google.javascript.rhino.head.ast.Symbol",
"com.google.javascript.rhino.head.ast.ObjectLiteral",
"com.google.javascript.rhino.head.ast.VariableInitializer",
"com.google.javascript.rhino.head.Node$PropListItem",
"com.google.javascript.rhino.head.AttachJsDocs$NodePos",
"com.google.javascript.jscomp.parsing.JsDocInfoParser",
"com.google.javascript.jscomp.parsing.JsDocTokenStream",
"com.google.javascript.jscomp.parsing.JsDocInfoParser$ErrorReporterParser",
"com.google.javascript.rhino.JSDocInfoBuilder",
"com.google.javascript.jscomp.parsing.JsDocInfoParser$State",
"com.google.javascript.jscomp.parsing.JsDocToken",
"com.google.javascript.jscomp.parsing.JsDocInfoParser$1",
"com.google.javascript.rhino.JSDocInfo$Visibility",
"com.google.common.collect.Count",
"com.google.javascript.jscomp.OptimizeArgumentsArray",
"com.google.javascript.jscomp.StripCode",
"com.google.javascript.jscomp.StripCode$Strip",
"com.google.javascript.rhino.Node$SideEffectFlags",
"com.google.javascript.jscomp.AbstractMessageFormatter$1",
"com.google.javascript.jscomp.AbstractMessageFormatter$Color",
"com.google.javascript.jscomp.GatherCharacterEncodingBias",
"com.google.javascript.jscomp.NodeTraversal$AbstractShallowStatementCallback",
"com.google.javascript.jscomp.TypedScopeCreator$DiscoverEnumsAndTypedefs",
"com.google.javascript.jscomp.Scope$Var",
"com.google.javascript.jscomp.IgnoreCajaProperties",
"com.google.javascript.jscomp.IgnoreCajaProperties$Traversal",
"com.google.javascript.jscomp.DefaultPassConfig$36$1",
"com.google.javascript.jscomp.GoogleCodingConvention",
"com.google.javascript.jscomp.DisambiguatePrivateProperties",
"com.google.javascript.jscomp.RemoveTryCatch",
"com.google.javascript.jscomp.RemoveTryCatch$RemoveTryCatchCode",
"com.google.javascript.jscomp.GoogleJsMessageIdGenerator",
"com.google.javascript.jscomp.ReplaceMessagesForChrome",
"com.google.javascript.jscomp.CodePrinter$Builder",
"com.google.javascript.jscomp.CodePrinter$Format",
"com.google.javascript.jscomp.CodePrinter",
"com.google.javascript.jscomp.CodeConsumer",
"com.google.javascript.jscomp.CodePrinter$MappedCodePrinter",
"com.google.javascript.jscomp.CodePrinter$CompactCodePrinter",
"com.google.javascript.jscomp.CodeGenerator$Context",
"com.google.javascript.jscomp.ClosureRewriteClass",
"com.google.javascript.jscomp.RenameLabels",
"com.google.javascript.jscomp.RenameLabels$DefaultNameSupplier",
"com.google.javascript.jscomp.RenameLabels$ProcessLabels",
"com.google.javascript.jscomp.RenameLabels$LabelNamespace",
"com.google.javascript.rhino.head.ast.ErrorNode",
"com.google.javascript.jscomp.GatherSideEffectSubexpressionsCallback",
"com.google.javascript.jscomp.ConstParamCheck",
"com.google.javascript.jscomp.JqueryCodingConvention",
"com.google.javascript.jscomp.CoalesceVariableNames$1",
"com.google.javascript.jscomp.CoalesceVariableNames",
"com.google.javascript.jscomp.ReferenceCollectingCallback$Reference",
"com.google.common.collect.AbstractTable",
"com.google.common.collect.StandardTable",
"com.google.common.collect.HashBasedTable",
"com.google.common.collect.HashBasedTable$Factory",
"com.google.common.collect.NaturalOrdering",
"com.google.common.collect.NullsFirstOrdering",
"com.google.javascript.jscomp.SymbolTable$2",
"com.google.javascript.jscomp.SymbolTable$3",
"com.google.javascript.jscomp.SymbolTable$4",
"com.google.javascript.jscomp.NodeTraversal$AbstractScopedCallback",
"com.google.javascript.jscomp.SymbolTable$1",
"com.google.javascript.jscomp.FunctionRewriter",
"com.google.javascript.jscomp.ForbiddenChange",
"com.google.common.collect.ImmutableSortedMapFauxverideShim",
"com.google.common.collect.EmptyImmutableSortedMap",
"com.google.common.collect.ImmutableSortedSetFauxverideShim",
"com.google.common.collect.EmptyImmutableSortedSet",
"com.google.common.collect.ImmutableSortedSet",
"com.google.common.collect.ImmutableSortedMap",
"com.google.javascript.jscomp.MoveFunctionDeclarations",
"com.google.javascript.jscomp.Compiler$7",
"com.google.javascript.jscomp.InlineProperties$PropertyInfo",
"com.google.javascript.jscomp.InlineProperties",
"com.google.javascript.jscomp.CollapseProperties",
"com.google.javascript.jscomp.PhaseOptimizer",
"com.google.javascript.jscomp.PhaseOptimizer$ProgressRange",
"com.google.javascript.jscomp.PhaseOptimizer$Loop",
"com.google.javascript.jscomp.PhaseOptimizer$NamedPass",
"com.google.javascript.jscomp.DefaultPassConfig$107",
"com.google.javascript.jscomp.InlineProperties$GatherCandidates",
"com.google.javascript.jscomp.LoggerErrorManager$1",
"com.google.javascript.jscomp.PerformanceTracker",
"com.google.javascript.jscomp.PerformanceTracker$2",
"com.google.javascript.jscomp.ReplaceMessages",
"com.google.javascript.jscomp.ControlFlowGraph",
"com.google.javascript.jscomp.ControlFlowAnalysis$AstControlFlowGraph",
"com.google.common.io.CharSource$ConcatenatedCharSource",
"com.google.common.io.MultiReader",
"com.google.common.io.LineReader",
"com.google.common.io.LineBuffer",
"com.google.common.io.LineReader$1",
"com.google.javascript.jscomp.JSError$1",
"com.google.javascript.jscomp.ReferenceCollectingCallback$1",
"com.google.javascript.jscomp.ReferenceCollectingCallback",
"com.google.common.base.Predicates",
"com.google.common.base.Predicates$ObjectPredicate",
"com.google.javascript.rhino.head.ast.KeywordLiteral",
"com.google.javascript.jscomp.GlobalNamespace$Name",
"com.google.javascript.rhino.head.ast.ObjectProperty",
"com.google.javascript.jscomp.TransformAMDToCJSModule",
"com.google.javascript.jscomp.TransformAMDToCJSModule$TransformAMDModulesCallback",
"com.google.common.collect.Maps$EntryFunction",
"com.google.common.collect.ByFunctionOrdering",
"com.google.javascript.jscomp.FlowSensitiveInlineVariables$1",
"com.google.javascript.jscomp.FlowSensitiveInlineVariables",
"com.google.javascript.jscomp.AnalyzePrototypeProperties$SymbolType",
"com.google.javascript.jscomp.AnalyzePrototypeProperties",
"com.google.javascript.jscomp.AnalyzePrototypeProperties$NameInfo",
"com.google.javascript.jscomp.GroupVariableDeclarations",
"com.google.javascript.jscomp.MemoizedScopeCreator",
"com.google.javascript.jscomp.ProcessClosurePrimitives",
"com.google.javascript.jscomp.ProcessClosurePrimitives$ProvidedName",
"com.google.javascript.jscomp.XtbMessageBundle$SecureEntityResolver",
"com.google.javascript.jscomp.XtbMessageBundle",
"com.google.javascript.jscomp.XtbMessageBundle$Handler",
"com.google.javascript.jscomp.ConvertToDottedProperties",
"com.google.javascript.jscomp.NodeUtil$MatchNodeType",
"com.google.common.base.Predicates$OrPredicate",
"com.google.javascript.jscomp.GatherSideEffectSubexpressionsCallback$GetReplacementSideEffectSubexpressions",
"com.google.common.base.Splitter$3",
"com.google.javascript.jscomp.VariableMap",
"com.google.javascript.jscomp.MethodCompilerPass",
"com.google.javascript.jscomp.InlineSimpleMethods$1",
"com.google.javascript.jscomp.InlineSimpleMethods",
"com.google.javascript.jscomp.InvocationsCallback",
"com.google.javascript.jscomp.InlineSimpleMethods$InlineTrivialAccessors",
"com.google.javascript.rhino.head.Parser$ConditionData",
"com.google.javascript.jscomp.CheckSideEffects$StripProtection",
"com.google.javascript.jscomp.NameAnalyzer$1",
"com.google.javascript.jscomp.NameAnalyzer",
"com.google.javascript.jscomp.MinimizeExitPoints",
"com.google.javascript.rhino.jstype.TemplatizedType",
"com.google.javascript.jscomp.Denormalize",
"com.google.javascript.jscomp.CoverageInstrumentationCallback",
"com.google.javascript.jscomp.Denormalize$StripConstantAnnotations",
"com.google.javascript.jscomp.ConcreteType$ConcreteInstanceType",
"com.google.javascript.jscomp.TightenTypes$ConcreteSlot",
"com.google.common.base.Splitter$5",
"com.google.common.base.AbstractIterator",
"com.google.common.base.Splitter$SplittingIterator",
"com.google.common.base.Splitter$3$1",
"com.google.common.base.AbstractIterator$State",
"com.google.common.base.AbstractIterator$1",
"com.google.javascript.jscomp.MethodCompilerPass$GatherSignatures",
"com.google.javascript.jscomp.CombinedCompilerPass",
"com.google.common.collect.ImmutableList$ReverseImmutableList",
"com.google.common.collect.ImmutableList$1",
"com.google.javascript.jscomp.ExpandJqueryAliases",
"com.google.javascript.jscomp.PeepholeOptimizationsPass",
"com.google.javascript.rhino.head.ast.ConditionalExpression",
"com.google.javascript.jscomp.NameAnonymousFunctions",
"com.google.javascript.jscomp.AnonymousFunctionNamingCallback",
"com.google.javascript.jscomp.NameAnonymousFunctions$AnonymousFunctionNamer",
"com.google.javascript.jscomp.NodeNameExtractor",
"com.google.common.collect.RegularImmutableSortedMap",
"com.google.common.collect.RegularImmutableSortedSet",
"com.google.common.io.CharSource$CharSequenceCharSource",
"com.google.common.io.CharSource$EmptyCharSource",
"com.google.common.io.CharSequenceReader",
"com.google.javascript.jscomp.ReplaceCssNames",
"com.google.javascript.jscomp.FunctionNames",
"com.google.javascript.jscomp.FunctionNames$FunctionListExtractor",
"com.google.javascript.jscomp.FindExportableNodes",
"com.google.javascript.jscomp.Compiler$2",
"com.google.javascript.rhino.head.ast.StringLiteral",
"com.google.common.collect.RegularImmutableBiMap",
"com.google.javascript.rhino.head.ast.ParenthesizedExpression",
"com.google.javascript.rhino.head.ast.RegExpLiteral",
"com.google.javascript.jscomp.Normalize$PropagateConstantAnnotationsOverVars",
"com.google.javascript.jscomp.CrossModuleCodeMotion",
"com.google.javascript.jscomp.Normalize$VerifyConstants",
"com.google.javascript.jscomp.CompilerOptions$1",
"com.google.javascript.jscomp.CombinedCompilerPass$CallbackWrapper",
"com.google.javascript.jscomp.ControlFlowGraph$Branch",
"com.google.javascript.jscomp.InlineVariables",
"com.google.javascript.jscomp.InlineVariables$IdentifyConstants",
"com.google.javascript.jscomp.InlineVariables$InliningBehavior",
"com.google.javascript.jscomp.InlineVariables$1",
"com.google.common.base.Strings",
"com.google.javascript.jscomp.AnalyzeNameReferences",
"com.google.javascript.rhino.SourcePosition",
"com.google.javascript.jscomp.ScopedAliases$Traversal$1"
);
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
80fe9279739cd24779efc8b5d74e6e7ed8374c4c | 275af73fb521c1ae663fa8467c492ebd86302476 | /Source/edu/utah/seq/parsers/MpileupParser.java | 39dcb9650b46705f1ffc1f306085c3c387fd2647 | [] | no_license | readbio/USeq | e038d4d6f34cefc8f0ff892925c30ba2cb18e91f | 751fc6581ac9907e404c2715f37234af2e135c3c | refs/heads/master | 2021-05-29T23:01:11.459969 | 2015-10-13T14:59:52 | 2015-10-13T14:59:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,383 | java | package edu.utah.seq.parsers;
import java.io.*;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import edu.utah.seq.data.Info;
import edu.utah.seq.data.Point;
import edu.utah.seq.data.PointData;
import edu.utah.seq.useq.apps.Bar2USeq;
import trans.tpmap.WindowMaker;
import util.gen.*;
/**@author davidnix*/
public class MpileupParser {
//user defined fields
private File pileupFile;
private float minimumReadCoverage = 15.0f;
private float maxError = 0.05f;
private String versionedGenome;
private File saveDirectory;
private File baseFractionNonRef;
private Gzipper failingBasesBed;
//for window scanning
private float maxFailing = 0.05f;
private int windowSize = 50;
private int minObs;
//internal fields
private Pattern rBase = Pattern.compile("[\\.,]");
private int chromIndex = 0;
private int positionIndex = 1;
private ArrayList<Integer> positions = new ArrayList<Integer>();
private ArrayList<Float> reference = new ArrayList<Float>();
private ArrayList<Float> nonReference = new ArrayList<Float>();
private WindowMaker windowMaker = new WindowMaker(windowSize, minObs);
private LinkedHashSet<String> uniRegions = new LinkedHashSet<String>();
public static Pattern INDEL = Pattern.compile("[-+](\\d+)");
private Histogram nonRefFreqHistogram = new Histogram(0,1,100);
//constructor
public MpileupParser(String[] args){
long startTime = System.currentTimeMillis();
processArgs(args);
//print thresholds
System.out.println("Thresholds:");
System.out.println((int)minimumReadCoverage+"\tMinimum Read Coverage");
System.out.println(windowSize + "\tWindow size");
System.out.println(maxError + "\tMax error");
System.out.println(maxFailing + "\tMax fraction bp in win failing max error");
System.out.println(minObs+"\tMinimum obs in window");
System.out.println("\nProcessing chr");
parseFile(pileupFile);
try {
failingBasesBed.close();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("\nWriting out high non ref regions "+uniRegions.size());
IO.writeHashSet(uniRegions, new File(saveDirectory, "highNonRefRegions.bed"));
new Bar2USeq(saveDirectory, true);
System.out.println("\nHistogram of non-zero non-ref base frequencies:");
nonRefFreqHistogram.setSkipZeroBins(false);
nonRefFreqHistogram.printScaledHistogram();
//finish and calc run time
double diffTime = ((double)(System.currentTimeMillis() -startTime))/60000;
System.out.println("\nDone! "+Math.round(diffTime)+" min\n");
}
public void clearArrayLists(){
positions.clear();
reference.clear();
nonReference.clear();
}
public void parseFile(File pileupFile){
String line = null;
try {
BufferedReader in = IO.fetchBufferedReader(pileupFile);
String chromosome = null;
//for each line in the file
while ((line = in.readLine()) != null){
String[] tokens = Misc.TAB.split(line);
if (tokens.length < 4) Misc.printErrAndExit("\nMalformed pileup line, skipping -> "+line+"\n\t"+tokens.length+" Tokens");
//set first chrom?
if (chromosome == null) chromosome = tokens[chromIndex];
//new chromosome?
else if (tokens[chromIndex].equals(chromosome) == false){
System.out.print(" "+chromosome);
//process old
processParsedData(positions, reference, nonReference, chromosome);
//clear old
clearArrayLists();
chromosome = tokens[chromIndex];
}
Integer position = Integer.parseInt(tokens[positionIndex]) -1;
//split by sample, first three indexes are chr, pos, refBase; then sets three for each bam: readDepth, baseString, baseQualString
float numBases = 0f;
float numRef = 0f;
for (int i=3; i< tokens.length; i+=3){
//check that there are three
if ((i+2) < tokens.length){
//fetch num bases
numBases+= Float.parseFloat(tokens[i]);
//count ref bases in baseCalls
numRef+= countRefs(tokens[i+1]);
}
}
//save em
positions.add(position);
reference.add(numRef);
nonReference.add(numBases-numRef);
}
//process final
System.out.print(" "+chromosome);
processParsedData(positions, reference, nonReference, chromosome);
clearArrayLists();
in.close();
System.out.println();
} catch (Exception e) {
e.printStackTrace();
Misc.printErrAndExit("\nProblem parsing "+ line);
}
}
private void processParsedData(ArrayList<Integer> positions, ArrayList<Float> refAL, ArrayList<Float> nonRefAL, String chromosome) throws IOException {
String chr = chromosome;
if (chr.startsWith("chr") == false) chr = "chr"+chromosome;
int[] pos = Num.arrayListOfIntegerToInts(positions);
if (pos.length == 0) return;
float[] refCount = Num.arrayListOfFloatToArray(refAL);
float[] nonRefCount = Num.arrayListOfFloatToArray(nonRefAL);
//make a Point for bases where non refs are observed
ArrayList<Point> pts = new ArrayList<Point>(10000);
//make base fraction bases
for (int i=0; i< pos.length; i++){
float total = refCount[i]+ nonRefCount[i];
if (total < minimumReadCoverage) continue;
float fraction = nonRefCount[i]/ total;
if (fraction !=0) nonRefFreqHistogram.count(fraction);
if (fraction >= maxError) failingBasesBed.println(chr+"\t"+pos[i]+"\t"+(pos[i]+1)+"\t"+(int)nonRefCount[i]+"/"+(int)total+"\t"+fraction+"\t.");
pts.add(new Point(pos[i], fraction));
}
if (pts.size() != 0){
PointData pd = Point.extractPositionScores(pts);
Info info = pd.getInfo();
info.setName("NonRefBaseFraction");
info.setVersionedGenome(versionedGenome);
info.setChromosome(chr);
info.setStrand(".");
info.setReadLength(1);
pd.writePointData(baseFractionNonRef);
windowScan(pd, chr);
}
}
private void windowScan(PointData pd, String chr) {
float[] frac = pd.getScores();
int[] bpPosition = pd.getPositions();
int[][] startStops = windowMaker.makeWindows(pd.getPositions());
//for each
for (int[] ss : startStops){
int numFailing = 0;
int bpPosStartFail = -1;
int bpPosStopFail = -1;
for (int i=ss[0]; i<= ss[1]; i++){
if (frac[i] > maxError) {
numFailing++;
//set start?
if (bpPosStartFail == -1) bpPosStartFail = bpPosition[i];
//set end?
else if (bpPosition[i] > bpPosStopFail) bpPosStopFail = bpPosition[i];
}
}
if (numFailing >= minObs) {
uniRegions.add(chr+"\t"+ bpPosStartFail+"\t"+ (bpPosStopFail+1));
}
}
}
public float countRefs(String baseCalls){
Matcher mat = rBase.matcher(baseCalls);
float num = 0;
while (mat.find()) num++;
return num;
}
public static void main(String[] args) {
if (args.length ==0){
printDocs();
System.exit(0);
}
new MpileupParser(args);
}
/**This method will process each argument and assign new variables*/
public void processArgs(String[] args){
Pattern pat = Pattern.compile("-[a-z]");
System.out.println("\n"+IO.fetchUSeqVersion()+" Arguments: "+Misc.stringArrayToString(args, " ")+"\n");
for (int i = 0; i<args.length; i++){
String lcArg = args[i].toLowerCase();
Matcher mat = pat.matcher(lcArg);
if (mat.matches()){
char test = args[i].charAt(1);
try{
switch (test){
case 'p': pileupFile = new File(args[++i]); break;
case 'r': minimumReadCoverage = Float.parseFloat(args[++i]); break;
case 'e': maxError = Float.parseFloat(args[++i]); break;
case 'f': maxFailing = Float.parseFloat(args[++i]); break;
case 'w': windowSize = Integer.parseInt(args[++i]); break;
case 's': saveDirectory = new File(args[++i]); saveDirectory.mkdir(); break;
case 'v': versionedGenome = args[i+1]; i++; break;
case 'h': printDocs(); System.exit(0);
default: Misc.printErrAndExit("\nProblem, unknown option! " + mat.group());
}
}
catch (Exception e){
Misc.printErrAndExit("\nSorry, something doesn't look right with this parameter: -"+test+"\n");
}
}
}
//look for bam files
if (pileupFile == null || pileupFile.canRead() == false) Misc.printErrAndExit("\nError: cannot find or read your pileup file?\n");
if (versionedGenome == null) Misc.printExit("\nPlease enter a genome version recognized by UCSC, see http://genome.ucsc.edu/FAQ/FAQreleases.\n");
if (saveDirectory == null ) {
String baseName = Misc.capitalizeFirstLetter(Misc.removeExtension(pileupFile.getName()));
saveDirectory = new File (pileupFile.getParentFile(), baseName);
}
saveDirectory.mkdirs();
//where to save base fraction edited
baseFractionNonRef = new File (saveDirectory, "BaseFractionNonRef_" +(int)minimumReadCoverage +"RC");
baseFractionNonRef.mkdir();
//create per base bed with > maxError non ref
File bad5 = new File (saveDirectory, "baseFracME"+maxError+"RC"+(int)minimumReadCoverage+".bed.gz");
try {
failingBasesBed = new Gzipper(bad5);
} catch (Exception e) {
e.printStackTrace();
}
//set min obs
minObs = (int)Math.round((float)windowSize * maxFailing);
}
public static void printDocs(){
System.out.println("\n" +
"**************************************************************************************\n" +
"** MpileUp Parser: Sept 2015 **\n" +
"**************************************************************************************\n" +
"Parses a SAMTools mpileup output file for non reference bases generating bed files and\n" +
"data tracks with information related to error prone bases. Multiple samples are merged.\n\n"+
"Options:\n"+
"-p Path to a mpileup file (.gz or.zip OK, use 'samtools mpileup -Q 20 -A -B *bam').\n"+
"-v Versioned Genome (ie H_sapiens_Mar_2006), see UCSC Browser,\n"+
" http://genome.ucsc.edu/FAQ/FAQreleases.\n" +
"-s Save directory, full path, defaults to pileup file directory.\n"+
"-r Minimum read coverage, defaults to 15.\n"+
"-e Max nonRef base fraction, defaults to 0.05\n"+
"-w Window size, defaults to 50\n"+
"-f Max fraction failing bp in window, defaults to 0.05\n"+
"\nExample: java -Xmx4G -jar pathTo/USeq/Apps/MpileupParser -p /Pileups/N2.mpileup.gz -v\n"+
" H_sapiens_Feb_2009 -e 0.1 -w 25\n\n" +
"**************************************************************************************\n");
}
}
| [
"biotelerock@a763469b-d363-47ea-a6e5-8f617fc850fa"
] | biotelerock@a763469b-d363-47ea-a6e5-8f617fc850fa |
ad51d965fbc0b58e6cfa5d952e981e78ff07b730 | 2100e816ad239e6a630da033d1f461917f48e81f | /RandomStudy/src/com/RandomExer/Emp1.java | 1d225b180850ebf1ce5f85041f1ceb9d085c8d09 | [] | no_license | sathyaprakash123/micro-config | 3220cfd55deaeef6f35baf4b253f68cdef1d9693 | f5025282cada0a468439c5b9e44ea40cf4b5cce4 | refs/heads/master | 2020-03-18T13:56:38.879300 | 2018-05-25T07:26:05 | 2018-05-25T07:26:05 | 134,819,321 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 406 | java | package com.RandomExer;
import java.io.Serializable;
public class Emp1 implements Serializable{
public enum value{
HIGH,
LOW,
MEDIUM
}
public String name;
public int age;
public int sal;
public transient int id;
public value val;
public void displayAll()
{
System.out.println("Name :"+name +" Age: "+age+ " Sal: "+sal+ " id "+id+" Value : "+ val);
}
}
| [
"sathya@Sathyas-MacBook-Pro.local"
] | sathya@Sathyas-MacBook-Pro.local |
cff50e7badd7d39cd96ce750bff5da582f67ea1d | 135b168ee0a54ccaf831fba55a65b52a236b8515 | /src/lbw_mims/LBW_MIMS.java | ac01d2209bab4dacf0522df4f1f423a44b34c5e5 | [] | no_license | lancewo16/Java-InvMgmt | 7e6c00abe7fd64a297cc3421bdd2890a6f4e403a | 14e7ddd102df77e5fd3847f7c70fc99d36554cd5 | refs/heads/main | 2023-02-13T10:03:04.499968 | 2021-01-07T17:28:25 | 2021-01-07T17:28:25 | 327,677,625 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 848 | 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 lbw_mims;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
/**
*
* @author theworthens
*/
public class LBW_MIMS extends Application {
@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("MainScreen.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
1bbe0ca1aa619994d4f89a1ced22139641493148 | f315fdc999c9e8b31f36bd76939f3aa2b9ac3fe4 | /dryuf-concurrent-benchmark/collection-benchmark/src/main/java/net/dryuf/concurrent/collection/benchmark/LazilyBuiltLoadingCacheBenchmark.java | 28e920cbea869bfb2dbc25d1995904fc67783200 | [
"Apache-2.0"
] | permissive | dryuf/dryuf-concurrent | bd0cdb81eae427ee1ad5bc3b7c4fb9e593329574 | 28b4e62358cb1e5482cf55a10655129d5f0900b1 | refs/heads/master | 2023-06-26T03:51:21.385320 | 2023-04-10T04:39:59 | 2023-04-10T04:39:59 | 47,892,506 | 0 | 1 | Apache-2.0 | 2023-06-14T22:51:11 | 2015-12-12T19:58:23 | Java | UTF-8 | Java | false | false | 4,532 | java | /*
* Copyright 2015-2022 Zbynek Vyskovsky mailto:kvr000@gmail.com http://github.com/kvr000/ https://github.com/dryuf/ https://www.linkedin.com/in/zbynek-vyskovsky/
*
* 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.dryuf.concurrent.collection.benchmark;
import net.dryuf.concurrent.SharedScheduledExecutorInstance;
import net.dryuf.concurrent.collection.LazilyBuiltLoadingCache;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.TearDown;
import org.openjdk.jmh.annotations.Warmup;
import java.lang.reflect.Field;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
@Warmup(iterations = 2, time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 2, time = 1, timeUnit = TimeUnit.SECONDS, batchSize = 1)
@Fork(value = 1)
public class LazilyBuiltLoadingCacheBenchmark
{
static {
System.setProperty("net.dryuf.concurrent.memoryPropagationDelay", "2100000000");
}
public static Function<Integer, Integer> populateCache(Function<Integer, Integer> cache)
{
lookupCacheInner(cache);
return cache;
}
@State(Scope.Benchmark)
public static class DirectConcurrentCacheState
{
@Setup(Level.Trial)
public void setup()
{
cache = populateCache(new Function<Integer, Integer>() {
@Override
public Integer apply(Integer input)
{
return store.computeIfAbsent(input, Function.identity());
}
private final ConcurrentHashMap<Integer, Integer> store = new ConcurrentHashMap<>();
});
}
public static Function<Integer, Integer> cache;
}
@State(Scope.Benchmark)
public static class ColdCacheState
{
@Setup(Level.Iteration)
public void setup()
{
cache = populateCache(new LazilyBuiltLoadingCache<>(Function.identity()));
}
@TearDown
public void teardown() throws NoSuchFieldException, IllegalAccessException
{
Field snapshotMapField = LazilyBuiltLoadingCache.class.getDeclaredField("snapshotMap");
snapshotMapField.setAccessible(true);
Map<?, ?> snapshotMap = (Map<?, ?>) snapshotMapField.get(cache);
if (snapshotMap.size() != 0) {
throw new IllegalStateException("Cold cache populated");
}
}
public static Function<Integer, Integer> cache;
}
@State(Scope.Benchmark)
public static class WarmCacheState
{
@Setup(Level.Trial)
public void setup() throws NoSuchFieldException, IllegalAccessException
{
cache = populateCache(new LazilyBuiltLoadingCache<>(Function.identity()));
try {
Thread.sleep((SharedScheduledExecutorInstance.MEMORY_PROPAGATION_DELAY_NS*2)/1_000_000+100);
}
catch (InterruptedException e) {
throw new RuntimeException(e);
}
Field snapshotMapField = LazilyBuiltLoadingCache.class.getDeclaredField("snapshotMap");
snapshotMapField.setAccessible(true);
Map<?, ?> snapshotMap = (Map<?, ?>) snapshotMapField.get(cache);
if (snapshotMap.size() != 128) {
throw new IllegalStateException("Warm cache not fully populated");
}
}
public static Function<Integer, Integer> cache;
}
@Benchmark
public void directConcurrentBenchmark(DirectConcurrentCacheState state)
{
lookupCacheBulk(state.cache);
}
@Benchmark
public void coldLazilyBuiltLoadingCacheBenchmark(ColdCacheState state)
{
lookupCacheBulk(state.cache);
}
@Benchmark
public void warmLazilyBuiltLoadingCacheBenchmark(WarmCacheState state)
{
lookupCacheBulk(state.cache);
}
private static void lookupCacheBulk(Function<Integer, Integer> cache)
{
for (int i = 0; i < 7812; ++i) {
lookupCacheInner(cache);
}
}
private static void lookupCacheInner(Function<Integer, Integer> cache)
{
for (int i = 0; i < 128; ++i) {
cache.apply(i);
}
}
}
| [
"kvr000@gmail.com"
] | kvr000@gmail.com |
076e622c671acce3835261ee24afc3850eece148 | 0345d97bfb0486b7146c3127b3b59bdecc367371 | /app/src/main/java/com/example/rouzi/lineacharview/KLineChartActivity.java | 8d047b248041373db57b60c444a55714d324ae3b | [] | no_license | rouzi/LineaCharView | 76acf2b425672cfc94bfff05912c5a1595269994 | 50f08d6f6d9dad83f68c6a99df94aff21324b44b | refs/heads/master | 2021-07-25T11:01:52.100072 | 2017-11-06T09:35:29 | 2017-11-06T09:35:29 | 109,673,122 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,913 | java | package com.example.rouzi.lineacharview;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import com.example.rouzi.lineacharview.KLineChart.KData;
import com.example.rouzi.lineacharview.KLineChart.KLineChartView;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
/**
* Created by rouzi on 2017/10/31.
*
*/
public class KLineChartActivity extends AppCompatActivity {
private KLineChartView kLineChartView;
private List<KData> kDataList;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_k_chart);
kLineChartView = (KLineChartView) findViewById(R.id.k_chart_view);
kDataList = new ArrayList<>();
setData();
findViewById(R.id.btn_refresh).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setData();
}
});
}
private void setData(){
kDataList.clear();
Random random = new Random();
int n = random.nextInt(10) + 30;
for(int i=0;i<n;i++){
KData data = new KData();
data.setDate("08-" + i);
float openValue = (float) Math.random()*100 + 3300;
float closeValue = (float) Math.random()*100 + 3300;
float maxValue = Math.max(openValue, closeValue) + (float) Math.random()*50;
float minValue = Math.min(openValue, closeValue) - (float) Math.random()*50;
data.setOpenValue(openValue);
data.setCloseValue(closeValue);
data.setMinValue(minValue);
data.setMaxValue(maxValue);
kDataList.add(data);
}
kLineChartView.setkDataList(kDataList);
}
}
| [
"lizhirou1230@gmail.com"
] | lizhirou1230@gmail.com |
090f62c61194f55a2c6650cca4d982717c854c60 | 01213aea4a503f6f082161e738a662b8b484ca86 | /securityhttp/src/main/java/com/kk/securityhttp/net/contains/HttpConfig.java | 7904a36a731529b9ef7836329b194701ebb5bd91 | [] | no_license | Nightqq/CarTrail | 6215c4306603346eda6ed64a4cd278d4139bae04 | c5923f7948b99312b35d176dac2e94438adef983 | refs/heads/master | 2020-03-28T20:20:37.303968 | 2019-07-25T06:29:36 | 2019-07-25T06:29:36 | 108,822,383 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 983 | java | package com.kk.securityhttp.net.contains;
import com.kk.securityhttp.domain.GoagalInfo;
import com.kk.securityhttp.net.utils.OKHttpUtil;
import java.util.Map;
import okhttp3.MediaType;
/**
* Created by zhangkai on 16/9/9.
*/
public class HttpConfig {
public static final MediaType MEDIA_TYPE = MediaType.parse("text/html");
public static final int TIMEOUT = 10 * 1000;
public static final int STATUS_OK = 0;
public static final int SERVICE_ERROR_CODE = -110;
public static final int PUBLICKEY_ERROR = -100;
public static final String NET_ERROR = "网络不给力";
public static final String SERVICE_ERROR = "服务器出现异常,请重试";
public static final String JSON_ERROR = "数据解析异常";
public static void setDefaultParams(Map<String, String> params) {
OKHttpUtil.setDefaultParams(params);
}
public static void setPublickey(String publickey){
GoagalInfo.get().publicKey = publickey;
}
}
| [
"you@example.com"
] | you@example.com |
7b8dbb3ec98d120891baa0d8be7fa3e5763111d1 | 80a10f96cc7406d5a998f1dc586e64d7409d0ffd | /clientApp/src/main/java/client_app/Service/Impl/httpClientImpl.java | b4d61fda87d19d8428308ca7f10118437bc6c0e3 | [] | no_license | Amalbekov96/marketJavaFX | 9710a28912b9e4675cfec18dea1b03d3b2f07d46 | f09a42f6d24695a4a094b1096587d2fa41d65836 | refs/heads/master | 2023-06-24T05:04:05.628783 | 2021-07-23T03:34:29 | 2021-07-23T03:34:29 | 386,566,120 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,385 | java | package client_app.Service.Impl;
import client_app.Model.Account;
import client_app.Model.Category;
import client_app.Model.Product;
import client_app.Model.User;
import client_app.Service.httpClient;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import okhttp3.*;
import java.io.IOException;
import java.util.List;
public class httpClientImpl implements httpClient {
private ObjectMapper objectMapper = new ObjectMapper();
private OkHttpClient client = new OkHttpClient();
private String baseAccountUrl = "http://localhost:9090/api/account";
private String baseCategoryUrl = "http://localhost:9090/api/category";
private String baseUserUrl = "http://localhost:9090/api/user";
private String baseProductUrl = "http://localhost:9090/api/product";
@Override
public void save(Account account) {
OkHttpClient okHttpClient = new OkHttpClient();
try {
RequestBody requestBody = RequestBody.create(objectMapper.writeValueAsString(account), MediaType.parse("application/json"));
Request request = new Request.Builder()
.post(requestBody)
.url(baseAccountUrl + "/save")
.build();
Call call = okHttpClient.newCall(request);
Response response = call.execute();
response.close();
} catch (JsonProcessingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public Account findByIdAc(Long id) {
return null;
}
@Override
public Account update(Account account) {
return null;
}
@Override
public void deleteById(Long id) {
}
@Override
public List<Account> findAllAc() {
Request request = new Request.Builder()
.url( baseAccountUrl +"/all")
.build();
Call call = client.newCall(request);
try {
Response response = call.execute();
List<Account> accountList = objectMapper.readValue(response.body().string(), new TypeReference<List<Account>>(){});
return accountList;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
//-------------------------------------------------------------------------------------------------------
// Catefroy Service
@Override
public List<Category> findAllCa() {
Request request = new Request.Builder()
.url( baseCategoryUrl +"/all")
.build();
Call call = client.newCall(request);
try {
Response response = call.execute();
List<Category> categoryList = objectMapper.readValue(response.body().string(), new TypeReference<List<Category>>(){});
return categoryList;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
public void save(Category category) {
try {
RequestBody requestBody = RequestBody.create(objectMapper.writeValueAsString(category), MediaType.parse("application/json"));
Request request = new Request.Builder()
.post(requestBody)
.url( baseCategoryUrl + "/save")
.build();
Call call = client.newCall(request);
Response response = call.execute();
response.close();
} catch (JsonProcessingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public void update(Category category) {
OkHttpClient okHttpClient = new OkHttpClient();
try {
RequestBody requestBody = RequestBody.create(objectMapper.writeValueAsString(category), MediaType.parse("application/json"));
Request request = new Request.Builder()
.post(requestBody)
.url(baseCategoryUrl + "/update")
.build();
Call call = okHttpClient.newCall(request);
Response response = call.execute();
response.close();
} catch (JsonProcessingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public void delete(Long id) {
Request request = new Request.Builder()
.delete()
.url(baseCategoryUrl + "/deleteById/"+id)
.build();
Call call = client.newCall(request);
try {
Response response = call.execute();
System.out.println(response.body().string());
response.close();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public Category findByIdCa(Long id) {
Request request = new Request.Builder()
.url(baseCategoryUrl + "/findById/"+id)
.build();
Call call = client.newCall(request);
try {
Response response = call.execute();
Category category = objectMapper.readValue(response.body().string(), Category.class);
return category;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
public List<Product> findAllPr() {
Request request = new Request.Builder()
.url( baseProductUrl +"/all")
.build();
Call call = client.newCall(request);
try {
Response response = call.execute();
ObjectMapper mapper = new ObjectMapper();
mapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
List<Product> productList = mapper.readValue(response.body().string(), new TypeReference<List<Product>>(){});
return productList;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
public void save(Product product) {
}
@Override
public void update(Product product) {
}
@Override
public void deleteByIdPr(Long id) {
Request request = new Request.Builder()
.delete()
.url(baseProductUrl + "/deleteById/"+id)
.build();
Call call = client.newCall(request);
try {
Response response = call.execute();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public Product findByIdPr(Long id) {
return null;
}
@Override
public List<User> findAllUs() {
return null;
}
@Override
public void save(User user) {
try {
RequestBody requestBody = RequestBody.create(objectMapper.writeValueAsString(user), MediaType.parse("application/json"));
Request request = new Request.Builder()
.post(requestBody)
.url( baseUserUrl + "/save")
.build();
Call call = client.newCall(request);
Response response = call.execute();
response.close();
} catch (JsonProcessingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public void update(User user) {
}
@Override
public void deleteByIdUs(Long id) {
}
@Override
public User findByIdUs(Long id) {
return null;
}
@Override
public User findByNameUs(String name) {
Request request = new Request.Builder()
.url( baseUserUrl +"/findByName/" + name)
.build();
Call call = client.newCall(request);
try {
Response response = call.execute();
if(response != null){
User user = objectMapper.readValue(response.body().string(), User.class);
return user;
}
} catch (IOException e) {
return null;
}
return null;
}
}
| [
"amalbekov312@gmail.com"
] | amalbekov312@gmail.com |
a7145d238d7d36f229e88ea808e72215e6768503 | 20e2607725dca78d0dafffe8aa2ad03aea516648 | /exampleProject/ebuy/src/main/java/site/jimblog/entity/ShoppingCartItem.java | e2acfd4a1d4b11bb1744b0ad9ea7efae5b39d067 | [] | no_license | MrYangXxx/oldProjectCode | 9f1ae1d36fbcfabce4e70016209ee85062152d84 | e92a1bc089de9867efb492443d87d0b2c860bf15 | refs/heads/master | 2020-05-18T11:16:01.664020 | 2019-05-15T11:24:43 | 2019-05-15T11:24:43 | 184,373,046 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 558 | java | package site.jimblog.entity;
/**
* <p>Title: ShoppingCartItem</p>
* <p>Description: </p>
* @author Jim
* @date May 13, 2018
*
*/
public class ShoppingCartItem {
private int id;
private Product product;
private int count;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Product getProduct() {
return product;
}
public void setProduct(Product product) {
this.product = product;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
}
| [
"MrYangXxx@users.noreply.github.com"
] | MrYangXxx@users.noreply.github.com |
f9002c149e4148758d83dc5792b3328ff4fb2fa4 | c3394012b1afc7c79994638b685d89063ae6c8e9 | /Spring_JavaFx_swing/springfx/src/main/java/com/storm/springfx/test/Swing/MaListner.java | 446f7b440e9aa458c6ed9047c190d6967d59ec52 | [] | no_license | 768Ares/Help | a78b081d0cfab6738ff2acbd0e9b2895b6ad4a16 | 4b9696a3d7eef8b5267b60b9a978dbb9ca7eb638 | refs/heads/master | 2020-03-27T19:39:02.574651 | 2018-09-01T14:15:42 | 2018-09-01T14:15:42 | 147,003,269 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 589 | java | package com.storm.springfx.test.Swing;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
public class MaListner implements MouseListener {
@Override
public void mouseClicked(MouseEvent mouseEvent) {
System.out.println("mouse cliked xD");
}
@Override
public void mousePressed(MouseEvent mouseEvent) {
}
@Override
public void mouseReleased(MouseEvent mouseEvent) {
}
@Override
public void mouseEntered(MouseEvent mouseEvent) {
}
@Override
public void mouseExited(MouseEvent mouseEvent) {
}
}
| [
"danieljaskolski768@gmail.com"
] | danieljaskolski768@gmail.com |
d03bdabb80575aac37408dc74415541a88af3d36 | e8a9ad14fbedb5c9f1990b07e5a3ed58225a78c3 | /app/src/main/java/com/lema/simplecarlist/CarDescription.java | 897b9e897a6f614800831794b98d0e0297a5beb0 | [] | no_license | KrzysztofLema/SimpleCarListAndroid | cad1f6f3f9cbe095bc8149dcc8513fa502922a9a | 3feae753c44cfcf3069c6fcf03986f1e1d345948 | refs/heads/master | 2021-09-06T01:50:07.390425 | 2018-02-01T12:15:45 | 2018-02-01T12:15:45 | 119,831,497 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,320 | java | package com.lema.simplecarlist;
/**
* Created by Krzysiek on 01.02.2018.
*/
public class CarDescription {
private String name;
private String description;
public CarDescription(String name, String description) {
this.name = name;
this.description = description;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public static final CarDescription[]CAR_DESCRIPTIONS = {
new CarDescription("Mercedes","niemiecka marka samochodów produkowanych przez koncern Daimler AG (uprzednio DaimlerChrysler AG), zaś wcześniej przez koncern Daimler-Benz, popularnie nazywana mercedes. Pod marką tą produkowane są samochody osobowe, dostawcze, ciężarowe i autobusy. W kategorii samochodów osobowych, mercedes-Benz uważany jest za jedną z najbardziej prestiżowych marek na świecie, zarazem jedną z najstarszych."),
new CarDescription("Audi", " niemiecki producent samochodów osobowych z siedzibą w Ingolstadt w Bawarii, należący do koncernu Volkswagen AG. Założony w 1909 roku przez Augusta Horcha. Nazwa przedsiębiorstwa wywodzi się z gry słów: Audi to łacińska transkrypcja nazwiska Horch (oznacza „słuchaj!”)."),
new CarDescription("BMW","niemiecki koncern motoryzacyjny produkujący od 1916 roku samochody osobowe, motocykle, skutery oraz silniki"),
new CarDescription("Chevrolet","amerykańska marka motoryzacyjna należąca do koncernu General Motors, której samochody dostępne są w ponad 140 krajach na całym świecie. Jest czwartą najczęściej kupowaną marką samochodów na świecie."),
new CarDescription("Fiat","włoski koncern motoryzacyjny z siedzibą w Turynie założony 11 lipca 1899 roku przez Giovanniego Agnellego[1]. W 2014 roku w wyniku połączenia z amerykańskim koncernem Chrysler przekształcony w koncern Fiat Chrysler Automobiles "),
new CarDescription("Ford","amerykański koncern motoryzacyjny założony 16 czerwca 1903 roku przez Henry'ego Forda w Detroit"),
new CarDescription("Suzuki","japońskie przedsiębiorstwo produkujące wiele modeli samochodów, motocykli, silników do motorówek i wiele innych silników spalinowych różnego zastosowania. Należy do wielkiej czwórki (Suzuki, Yamaha, Honda oraz Kawasaki) największych dystrybutorów motocykli na świecie. Suzuki posiada 15 fabryk w 14 krajach i 133 dystrybutorów w 119 krajach."),
new CarDescription("Honda"," japońskie przedsiębiorstwo produkujące samochody, motocykle, skutery, samoloty, silniki oraz różnego rodzaju maszyny do celów budowlanych, rolniczych i innych. Obecnie jest największym producentem silników na świecie. Produkuje ich ponad 25 milionów rocznie. Zakłady produkcyjne umieszczono w ponad 30 różnych krajach. Główna siedziba znajduje się w Tokio. Natomiast siedziba Honda Motor Europe Limited znajduje się w Slough (Wielka Brytania). Montesa Honda to jednostka zależna Hondy, znajdująca się Prowincji Barcelony w Hiszpanii."),
new CarDescription("Volkswagen","marka samochodów produkowanych od 1937 roku przez niemiecki koncern Volkswagen AG. W dosłownym tłumaczeniu znaczy samochód ludu"),
new CarDescription("Toyota","Historia firmy Toyota sięga 1918 roku, kiedy to Sakichi Toyoda założył firmę Toyoda Spinning and Weaving Co. Ltd.. Przy pomocy swojego syna - Kiichirō Toyody zbudował w 1924 roku automatyczny warsztat tkacki. W 1926 roku Toyoda założył zakład Toyoda Automatic Loom Works. Pod koniec lat 20. XX wieku Kiichirō Toyoda przebywał w Europie i Stanach Zjednoczonych, gdzie zainteresował się branżą motoryzacyjną. W 1933 roku we warsztatach tkackich utworzony został dział samochodów[3]. Początkowo zbudowany został sześciocylindrowy silnik o pojemności 3.4l")
};
public static final int carImages[] ={R.drawable.mercedes,R.drawable.audi,R.drawable.bmw,R.drawable.chevrolet,R.drawable.fiat,R.drawable.ford,R.drawable.suzuki,R.drawable.honda,R.drawable.volkswagen,R.drawable.toyota};
}
| [
"lema10@o2.pl"
] | lema10@o2.pl |
d269969cfec556a1216ef2301b8782704e0bf710 | 0fae65e32b3decd3af2e1a32f1b89bff7f95cf52 | /tls/src/test/java/org/bouncycastle/tls/test/MockRawKeysTlsServer.java | 0c0ccbc24d4cad3898f0d2f3a5071f22a3ca5c9d | [
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"Apache-2.0"
] | permissive | prashanthbn/bc-java | 4d4c45f376650fbf65693750ca9dee6e9b360d1d | d52d2be9799a9f59984dcd8a71faa618bd9e80e3 | refs/heads/master | 2022-11-22T03:49:02.445899 | 2022-11-09T00:05:45 | 2022-11-09T00:05:45 | 195,117,181 | 0 | 0 | NOASSERTION | 2019-07-03T19:44:21 | 2019-07-03T19:44:20 | null | UTF-8 | Java | false | false | 5,828 | java | package org.bouncycastle.tls.test;
import java.io.IOException;
import java.security.SecureRandom;
import java.util.Hashtable;
import java.util.Vector;
import org.bouncycastle.crypto.params.Ed25519PrivateKeyParameters;
import org.bouncycastle.crypto.util.SubjectPublicKeyInfoFactory;
import org.bouncycastle.tls.Certificate;
import org.bouncycastle.tls.CertificateEntry;
import org.bouncycastle.tls.CertificateRequest;
import org.bouncycastle.tls.CertificateType;
import org.bouncycastle.tls.CipherSuite;
import org.bouncycastle.tls.ClientCertificateType;
import org.bouncycastle.tls.DefaultTlsServer;
import org.bouncycastle.tls.ProtocolVersion;
import org.bouncycastle.tls.SignatureAlgorithm;
import org.bouncycastle.tls.SignatureAndHashAlgorithm;
import org.bouncycastle.tls.TlsCredentialedSigner;
import org.bouncycastle.tls.TlsCredentials;
import org.bouncycastle.tls.TlsUtils;
import org.bouncycastle.tls.crypto.TlsCertificate;
import org.bouncycastle.tls.crypto.TlsCryptoParameters;
import org.bouncycastle.tls.crypto.impl.bc.BcDefaultTlsCredentialedSigner;
import org.bouncycastle.tls.crypto.impl.bc.BcTlsCrypto;
import org.bouncycastle.tls.crypto.impl.bc.BcTlsRawKeyCertificate;
import junit.framework.TestCase;
class MockRawKeysTlsServer extends DefaultTlsServer
{
private short serverCertType;
private short clientCertType;
private short[] allowedClientCertTypes;
private Ed25519PrivateKeyParameters privateKey;
private ProtocolVersion tlsVersion;
private TlsCredentialedSigner credentials;
Hashtable receivedClientExtensions;
MockRawKeysTlsServer(short serverCertType, short clientCertType, short[] allowedClientCertTypes,
Ed25519PrivateKeyParameters privateKey, ProtocolVersion tlsVersion) throws Exception
{
super(new BcTlsCrypto(new SecureRandom()));
this.serverCertType = serverCertType;
this.clientCertType = clientCertType;
this.allowedClientCertTypes = allowedClientCertTypes;
this.privateKey = privateKey;
this.tlsVersion = tlsVersion;
}
public TlsCredentials getCredentials() throws IOException
{
/*
* TODO[tls13] Should really be finding the first client-supported signature scheme that the
* server also supports and has credentials for.
*/
if (TlsUtils.isTLSv13(context))
{
return getECDSASignerCredentials();
}
return super.getCredentials();
}
protected ProtocolVersion[] getSupportedVersions()
{
return new ProtocolVersion[]{ tlsVersion };
}
protected int[] getSupportedCipherSuites()
{
return TlsUtils.isTLSv13(tlsVersion)
? new int[]{ CipherSuite.TLS_AES_128_GCM_SHA256 }
: new int[]{ CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 };
}
public void processClientExtensions(Hashtable clientExtensions) throws IOException
{
this.receivedClientExtensions = clientExtensions;
super.processClientExtensions(clientExtensions);
}
protected TlsCredentialedSigner getECDSASignerCredentials() throws IOException
{
if (credentials == null)
{
BcTlsCrypto crypto = (BcTlsCrypto)getCrypto();
switch (serverCertType)
{
case CertificateType.X509:
credentials = TlsTestUtils.loadSignerCredentials(context,
context.getSecurityParametersHandshake().getClientSigAlgs(), SignatureAlgorithm.ed25519,
"x509-client-ed25519.pem", "x509-client-key-ed25519.pem");
break;
case CertificateType.RawPublicKey:
TlsCertificate rawKeyCert = new BcTlsRawKeyCertificate(crypto,
SubjectPublicKeyInfoFactory.createSubjectPublicKeyInfo(privateKey.generatePublicKey()));
Certificate cert = new Certificate(CertificateType.RawPublicKey,
TlsUtils.isTLSv13(context) ? TlsUtils.EMPTY_BYTES : null,
new CertificateEntry[]{ new CertificateEntry(rawKeyCert, null) });
credentials = new BcDefaultTlsCredentialedSigner(new TlsCryptoParameters(context),
crypto, privateKey, cert, SignatureAndHashAlgorithm.ed25519);
break;
default:
throw new IllegalArgumentException("Only supports X509 and raw keys");
}
}
return credentials;
}
protected short[] getAllowedClientCertificateTypes()
{
return allowedClientCertTypes;
}
protected boolean allowCertificateStatus()
{
return serverCertType == CertificateType.RawPublicKey ? false : super.allowCertificateStatus();
}
protected boolean allowMultiCertStatus()
{
return serverCertType == CertificateType.RawPublicKey ? false : super.allowMultiCertStatus();
}
public CertificateRequest getCertificateRequest() throws IOException
{
if (clientCertType < 0)
{
return null;
}
short[] certificateTypes = new short[]{ ClientCertificateType.ecdsa_sign };
Vector serverSigAlgs = null;
if (TlsUtils.isSignatureAlgorithmsExtensionAllowed(context.getServerVersion()))
{
serverSigAlgs = TlsUtils.getDefaultSupportedSignatureAlgorithms(context);
}
return TlsUtils.isTLSv13(tlsVersion)
? new CertificateRequest(TlsUtils.EMPTY_BYTES, serverSigAlgs, null, null)
: new CertificateRequest(certificateTypes, serverSigAlgs, null);
}
public void notifyClientCertificate(Certificate clientCertificate) throws IOException
{
TestCase.assertEquals("client certificate is the wrong type", clientCertType, clientCertificate.getCertificateType());
}
}
| [
"peter.dettman@bouncycastle.org"
] | peter.dettman@bouncycastle.org |
af662adae4169283b6eaf96141f1edefa54ce410 | e062d30c0f661ce10a69ac0eac5a51ebbe40e723 | /src/Model/Main.java | efad90c3da9c5595bb79e6bde2f2a4466b3c9970 | [] | no_license | juangallego11/Organizador-de-Futbol | 93aaa1e692c5198364834db82969db7e97bfcbf5 | 8a11a1f1f24e1d2595370d51ea891e2458a39283 | refs/heads/master | 2022-10-17T00:57:00.423596 | 2020-06-08T20:42:29 | 2020-06-08T20:42:29 | 270,819,324 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 210 | java | package Model;
import View.Login;
public class Main {
public static void main(String[] args) {
Login newLogin = new Login();
newLogin.setVisible(true);
}
}
| [
"fbdavid37@utp.edu.co"
] | fbdavid37@utp.edu.co |
92bc4d06a4f52d0a8ca4d115fbbd48bb14ebaffb | ac90216c9a97102adee9205ff67a667d2b1117ee | /chapter19/BinaryStream/CaesarEncryptor.java | f89f166e6643934e38c5b946eabc013d53d44242 | [] | no_license | Farooq-azam-khan/Horstmann-LateObjects | 8a1bb749cb6bdeffb2a594f907f22c96c8af5dd8 | c0fe1ee227346f4ccf24e8e401f7588f4984888f | refs/heads/master | 2021-04-18T18:44:20.735939 | 2018-05-24T00:43:21 | 2018-05-24T00:43:21 | 126,360,867 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,493 | java | import java.io.File;
import java.util.Scanner;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.FileInputStream;
import java.io.FileOutputStream;
public class CaesarEncryptor
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
try
{
System.out.print("Input File: ");
String inputFileName = in.next();
System.out.print("Output File: ");
String outputFileName = in.next();
System.out.print("(e) encrypt or (d) decrypt or (c) crack: ");
String action = in.next();
System.out.print("Key: ");
int key = in.nextInt();
InputStream inStream = new FileInputStream(inputFileName);
OutputStream outStream = new FileOutputStream(outputFileName, true);
CaesarCipher cipher = new CaesarCipher(key);
if (action.equals("e"))
{
cipher.encryptStream(inStream, outStream);
}
else if (action.equals("d"))
{
cipher.decryptStream(inStream, outStream);
}
else if (action.equals("c"))
{
FileOutputStream crackStream = new FileOutputStream(outputFileName, true);
for (int i=1; i<256; i++)
{
cipher.setKey(i);
cipher.decryptStream(inStream, crackStream);
}
crackStream.close();
}
inStream.close();
outStream.close();
}
catch(IOException e)
{
System.out.println(e.getMessage());
}
}
}
| [
"farooq1.khan@ryerson.ca"
] | farooq1.khan@ryerson.ca |
c47f516c4caf59ecb2045976e52918177a8a05d9 | 8c910a1253ef6f495243c4d4550d2aa774d94ae2 | /Hydra/src/org/hydra/text/abstracts/PropertyLoader.java | 43b85fbe8bc4ebe493f7d4beef30c734d9145727 | [] | no_license | maksudnurullaev/supposition | 5f822c65de9919df9d4c8c341dca171d30eb150d | 591d98258d3f2aab3016b1116ac62e30cffee6fc | refs/heads/master | 2021-01-22T11:59:11.381082 | 2010-03-13T11:25:45 | 2010-03-13T11:25:45 | 32,127,712 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,997 | java | package org.hydra.text.abstracts;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Properties;
import java.util.ResourceBundle;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public abstract class PropertyLoader {
/**
* Looks up a resource named 'name' in the classpath. The resource must map
* to a file with .properties extention. The name is assumed to be absolute
* and can use either "/" or "." for package segment separation with an
* optional leading "/" and optional ".properties" suffix. Thus, the
* following names refer to the same resource:
*
* <pre>
* some.pkg.Resource
* some.pkg.Resource.properties
* some/pkg/Resource
* some/pkg/Resource.properties
* /some/pkg/Resource
* /some/pkg/Resource.properties
* </pre>
*
* @param name
* classpath resource name [may not be null]
* @param loader
* classloader through which to load the resource [null is
* equivalent to the application loader]
*
* @return resource converted to java.util.Properties [may be null if the
* resource was not found and THROW_ON_LOAD_FAILURE is false]
* @throws IllegalArgumentException
* if the resource was not found and THROW_ON_LOAD_FAILURE is
* true
*/
public static Properties loadProperties(String name, ClassLoader loader) {
if (name == null)
throw new IllegalArgumentException("null input: name");
if (name.startsWith("/"))
name = name.substring(1);
if (name.endsWith(SUFFIX))
name = name.substring(0, name.length() - SUFFIX.length());
Properties result = null;
InputStream in = null;
try {
if (loader == null)
loader = ClassLoader.getSystemClassLoader();
if (LOAD_AS_RESOURCE_BUNDLE) {
name = name.replace('/', '.');
// Throws MissingResourceException on lookup failures:
final ResourceBundle rb = ResourceBundle.getBundle(name, Locale
.getDefault(), loader);
result = new Properties();
for (Enumeration<?> keys = rb.getKeys(); keys.hasMoreElements();) {
final String key = (String) keys.nextElement();
final String value = rb.getString(key);
result.put(key, value);
}
} else {
name = name.replace('.', '/');
if (!name.endsWith(SUFFIX))
name = name.concat(SUFFIX);
// Returns null on lookup failures:
in = loader.getResourceAsStream(name);
if (in != null) {
result = new Properties();
parsePropertyFile(result, in);
}
}
} catch (Exception e) {
result = null;
} finally {
if (in != null)
try {
in.close();
} catch (Throwable ignore) {
}
}
if (THROW_ON_LOAD_FAILURE && (result == null)) {
throw new IllegalArgumentException("could not load ["
+ name
+ "]"
+ " as "
+ (LOAD_AS_RESOURCE_BUNDLE ? "a resource bundle"
: "a classloader resource"));
}
return result;
}
private static void parsePropertyFile(Properties result, InputStream in)
throws UnsupportedEncodingException, IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(in,
"UTF8"));
String line = null;
String curKey = null;
String curValue = null;
int NOT_FOUND = -1;
int found = NOT_FOUND;
while ((line = reader.readLine()) != null) {
if (line.trim().isEmpty() || line.charAt(0) == '#')
continue;
if (line.charAt(0) != '/') {
found = line.indexOf("=");
if (found != NOT_FOUND) {
savePreviousKeyValue(result, curKey, curValue);
curKey = line.substring(0, found - 1).trim();
curValue = line.substring(found + 1, line.length());
}
} else {
curValue += line.substring(1);
}
}
// Save last pair
savePreviousKeyValue(result, curKey, curValue);
}
private static void savePreviousKeyValue(Properties inProp, String inKey,
String inValue) {
if ((inKey != null) && (inValue != null)) {
inProp.setProperty(inKey, inValue);
_log.debug(String.format("KEY(%s) and VALUE(%s) found", inKey,
inValue));
}
}
/**
* A convenience overload of {@link #loadProperties(String, ClassLoader)}
* that uses the current thread's context classloader.
*/
public static Properties loadProperties(final String name) {
_log.debug("Loading property file " + name);
return loadProperties(name, Thread.currentThread()
.getContextClassLoader());
}
private static final Log _log = LogFactory
.getLog(org.hydra.executors.Executor.class);
private static final boolean THROW_ON_LOAD_FAILURE = true;
private static final boolean LOAD_AS_RESOURCE_BUNDLE = false;
private static final String SUFFIX = ".properties";
}
| [
"maksud.nurullaev@637863ca-8676-11de-bed6-6d316fbe0868"
] | maksud.nurullaev@637863ca-8676-11de-bed6-6d316fbe0868 |
d5cef0650d98d8d1c626be3fdb5e815cdf4dde82 | 64bbf74f3eb6448aae6485c3ab80375f67f6071e | /addOns/scripts/src/main/java/org/zaproxy/zap/extension/scripts/automation/actions/EnableScriptAction.java | 0bc5f1934d5c390097889e819d66da892bdef7f7 | [
"Apache-2.0"
] | permissive | zaproxy/zap-extensions | 0ce06cd939b5c2b4183c0ccb399b625d1674667a | ed8f0469cd7ed4bfcafda99849736ab138942861 | refs/heads/main | 2023-08-25T05:10:57.321613 | 2023-08-24T13:50:37 | 2023-08-24T13:50:37 | 35,210,580 | 790 | 977 | Apache-2.0 | 2023-09-14T18:48:40 | 2015-05-07T09:17:13 | Java | UTF-8 | Java | false | false | 1,102 | java | /*
* Zed Attack Proxy (ZAP) and its related class files.
*
* ZAP is an HTTP/HTTPS proxy for assessing web application security.
*
* Copyright 2022 The ZAP Development Team
*
* 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.zaproxy.zap.extension.scripts.automation.actions;
import org.zaproxy.zap.extension.scripts.automation.ScriptJobParameters;
public class EnableScriptAction extends EnableableScriptAction {
public static final String NAME = "enable";
public EnableScriptAction(ScriptJobParameters parameters) {
super(NAME, true, parameters);
}
}
| [
"garg.lakshya@gmail.com"
] | garg.lakshya@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.