blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
a1e1891d8fcb5f0bc513e11cb8099307a85b9bc5
117466d8121a7fdcf61ce3d7a5be91f817e3a5ce
/src/com/zanimaux/gui/ProduitController.java
9f758dd6b21ea145bfedd7e66b24529bfcbcd60d
[]
no_license
emnou9/PiJavaZanimaux
cd661ad827c378a6b020de43a82bb324b202909b
dd1c517760c12ce3a13751ed7777af6b07907a12
refs/heads/master
2021-04-27T11:16:14.523692
2018-03-02T07:24:26
2018-03-02T07:24:26
122,557,996
0
0
null
null
null
null
UTF-8
Java
false
false
1,931
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.zanimaux.gui; import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXDrawer; import com.jfoenix.controls.JFXHamburger; import com.jfoenix.controls.JFXListView; import com.jfoenix.controls.JFXTextField; import java.net.URL; import java.util.ResourceBundle; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.ChoiceBox; import javafx.scene.control.Label; import javafx.scene.image.ImageView; import javafx.scene.input.MouseEvent; /** * FXML Controller class * * @author Emna */ public class ProduitController implements Initializable { @FXML private JFXListView<?> listproduit; @FXML private JFXTextField nomprod; @FXML private ImageView ivModif; @FXML private JFXButton btnModifier; @FXML private JFXButton btnImagemodifier; @FXML private Label ab; @FXML private Label ab1; @FXML private Label ab2; @FXML private Label ab3; @FXML private Label ab4; @FXML private JFXTextField prixprod; @FXML private JFXTextField quantiteprod; @FXML private ChoiceBox<?> tchoice; @FXML private JFXHamburger Hamburger; @FXML private JFXDrawer drawer; @FXML private JFXTextField lasto; /** * Initializes the controller class. */ @Override public void initialize(URL url, ResourceBundle rb) { // TODO } @FXML private void remplirInputs(MouseEvent event) { } @FXML private void modifierBug(ActionEvent event) { } @FXML private void uploadModifier(MouseEvent event) { } }
[ "emna.khalfa@esprit.tn" ]
emna.khalfa@esprit.tn
2ba8e719cf41723f80a6ee6e596169e31ad8be88
cf5ff8e0bbd93e0d3110169bc7f89e2a2b2be60d
/yzim-easeui-SDK_3.1.3/src/com/yz/im/model/im/receiver/StartServiceReceiver.java
a50fb32f66b5f5dbea1ee86db97c4ef43e58112a
[ "Apache-2.0" ]
permissive
yaolu0311/ThinkcooRefactor-2016526
993c09b50719322d9d89621f2d991e4687ab81f8
bfe011a0650ca0c80932dc45c2e60868966afda6
refs/heads/master
2020-09-26T05:30:24.155465
2016-09-05T07:12:13
2016-09-05T07:12:13
67,396,724
0
0
null
null
null
null
UTF-8
Java
false
false
1,016
java
/************************************************************ * * Hyphenate CONFIDENTIAL * __________________ * Copyright (C) 2016 Hyphenate Inc. All rights reserved. * * NOTICE: All information contained herein is, and remains * the property of Hyphenate Inc.. * Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained * from Hyphenate Inc. */ package com.yz.im.model.im.receiver; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import com.hyphenate.chat.EMChatService; import com.hyphenate.util.EMLog; public class StartServiceReceiver extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { EMLog.d("boot", "start IM service on boot"); Intent startServiceIntent=new Intent(context, EMChatService.class); startServiceIntent.putExtra("reason", "boot"); context.startService(startServiceIntent); } }
[ "yaolu0311@163.com" ]
yaolu0311@163.com
8cd9a7bc78fb835f5189afe5dd54199058afbf08
2cd23e4efba66172e78516cca8e52d6746e8c332
/Seminar 7/src/ro/ase/cts/decorator/clase/OperatorBilet.java
d44fdb948a3873183297df767c950b3a14d17186
[]
no_license
SagharPourFarhad/CTS
5991bda57d9a24373edbfc0ee88a32aa98edd12b
f0a5c528665fbddc64a16d5716c659c419329c91
refs/heads/master
2023-05-09T12:37:07.979232
2021-05-10T22:28:05
2021-05-10T22:28:05
342,800,695
0
0
null
null
null
null
UTF-8
Java
false
false
165
java
package ro.ase.cts.decorator.clase; public interface OperatorBilet { void rezervaBilet(); String getNumeEchipaGazda(); String getNumeEchipaOaspeti(); }
[ "pourfarhadsaghar18@stud.ase.ro" ]
pourfarhadsaghar18@stud.ase.ro
a8a47af038994194155b516ad9c729335507047c
9fb58555b6ad35e085ce4a4e1e9b651873174d6a
/src/test/java/com.corneti/elasticsearch/plugin/ingest/geocoding/GeocodingProcessorTests.java
3a179c29ee5f9f6d7047b84920d2302ec63bd749
[]
no_license
mostrilla/ingest-geocoding
919ac7e80f078ba52a16f5f63c517d48c900f85c
50e75df574dc72c8c682a45d728090f3097994e0
refs/heads/master
2023-08-13T09:03:43.271715
2018-10-28T02:19:04
2018-10-28T02:19:04
417,463,923
0
0
null
2021-10-15T10:48:03
2021-10-15T10:47:12
null
UTF-8
Java
false
false
10,170
java
/* * Copyright [2017] [Fabio Corneti] * * 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.corneti.elasticsearch.plugin.ingest.geocoding; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.ingest.IngestDocument; import org.elasticsearch.ingest.RandomDocumentPicks; import org.elasticsearch.test.ESTestCase; import java.util.HashMap; import java.util.List; import java.util.Map; import static com.corneti.elasticsearch.plugin.ingest.geocoding.IngestGeocodingPlugin.API_KEY; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; public class GeocodingProcessorTests extends ESTestCase { static final String KNOWN_ADDRESS = "1600 Amphitheatre Parkway, Mountain+View, CA, US"; static final String MOCK_KEY = "mock_key"; /** * This mocks returns a valid {@link GeocodingOutput} for the known address if the expected mock key * was specified in the settings, otherwise null. */ static final class GeocodingServiceMock extends GeocodingService { GeocodingServiceMock(Settings settings) { super(settings); } @Override GeocodingOutput geocode(String address) { if (API_KEY.get(super.settings).equals(MOCK_KEY)) { if (address.equals(KNOWN_ADDRESS)) { return new GeocodingOutput(1.0, -1.0); } return null; } return new GeocodingOutput(new Exception("Invalid API key (mock).")); } } @SuppressWarnings("unchecked") public void testKnownAddressWithMissingAPIKey() throws Exception { final Map<String, Object> document = new HashMap<>(); document.put("address", KNOWN_ADDRESS); final IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), document); final GeocodingService service = new GeocodingService(Settings.EMPTY); service.start(); try { final GeocodingProcessor processor = new GeocodingProcessor(service, "geocoding", "address", "loc"); processor.execute(ingestDocument); assertThat(ingestDocument.getFieldValue("address", String.class, true), equalTo(KNOWN_ADDRESS)); assertThat(ingestDocument.hasField("loc.coordinates"), is(false)); final List<String> errors = ingestDocument.getFieldValue("loc._errors", List.class); assertThat(errors.size(), is(1)); assertThat(errors.get(0), equalTo("Invalid API key.")); } finally { service.stop(); service.close(); } } @SuppressWarnings("unchecked") public void testAddressAsMapWithMissingAPIKey() throws Exception { final Map<String, String> addressMap = new HashMap<>(); addressMap.put("road", "to nowhere"); final Map<String, Object> document = new HashMap<>(); document.put("address", addressMap); final IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), document); final GeocodingService service = new GeocodingService(Settings.EMPTY); service.start(); try { final GeocodingProcessor processor = new GeocodingProcessor(service, "geocoding", "address", "loc"); processor.execute(ingestDocument); assertThat(ingestDocument.getFieldValue("address", Map.class, true), equalTo(addressMap)); assertThat(ingestDocument.hasField("loc.coordinates"), is(false)); final List<String> errors = ingestDocument.getFieldValue("loc._errors", List.class); assertThat(errors.size(), is(1)); assertThat(errors.get(0), equalTo("field [address] of type [java.util.HashMap] cannot be cast to [java.lang.String]")); } finally { service.stop(); service.close(); } } public void testEmptyAddressWithMissingAPIKey() throws Exception { final Map<String, Object> document = new HashMap<>(); document.put("address", " "); final IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), document); final GeocodingService service = new GeocodingService(Settings.EMPTY); service.start(); try { final GeocodingProcessor processor = new GeocodingProcessor(service, "geocoding", "address", "loc"); processor.execute(ingestDocument); assertThat(ingestDocument.getFieldValue("address", String.class, true), equalTo(" ")); assertThat(ingestDocument.hasField("loc._errors"), is(false)); assertThat(ingestDocument.getFieldValue("loc.coordinates", Map.class), nullValue()); } finally { service.stop(); service.close(); } } public void testNullAddressWithMissingAPIKey() throws Exception { final Map<String, Object> document = new HashMap<>(); document.put("address", null); final IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), document); final GeocodingService service = new GeocodingService(Settings.EMPTY); service.start(); try { final GeocodingProcessor processor = new GeocodingProcessor(service, "geocoding", "address", "loc"); processor.execute(ingestDocument); assertThat(ingestDocument.getFieldValue("address", String.class, true), nullValue()); assertThat(ingestDocument.hasField("loc._errors"), is(false)); assertThat(ingestDocument.getFieldValue("loc.coordinates", Map.class), nullValue()); } finally { service.stop(); service.close(); } } public void testNoAddressWithMissingAPIKey() throws Exception { final Map<String, Object> document = new HashMap<>(); final IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), document); final GeocodingService service = new GeocodingService(Settings.EMPTY); service.start(); try { final GeocodingProcessor processor = new GeocodingProcessor(service, "geocoding", "address", "loc"); processor.execute(ingestDocument); assertThat(ingestDocument.hasField("loc"), is(false)); } finally { service.stop(); service.close(); } } @SuppressWarnings("unchecked") public void testKnownAddressUsingMockWithCorrectApiKey() throws Exception { final Map<String, Object> document = new HashMap<>(); document.put("address", KNOWN_ADDRESS); final IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), document); final Settings settings = Settings.builder() .put(API_KEY.getKey(), MOCK_KEY) .build(); final GeocodingService service = new GeocodingServiceMock(settings); service.start(); try { final GeocodingProcessor processor = new GeocodingProcessor(service, "geocoding", "address", "loc"); processor.execute(ingestDocument); assertThat(ingestDocument.getFieldValue("address", String.class, true), equalTo(KNOWN_ADDRESS)); assertThat(ingestDocument.hasField("loc._errors"), is(false)); assertThat(ingestDocument.hasField("loc.coordinates.lat"), is(true)); assertThat(ingestDocument.hasField("loc.coordinates.lon"), is(true)); final Map<String, Double> coordinates = ingestDocument.getFieldValue("loc.coordinates", Map.class); assertThat(coordinates.size(), is(2)); final Double lat = ingestDocument.getFieldValue("loc.coordinates.lat", Double.class); final Double lon = ingestDocument.getFieldValue("loc.coordinates.lon", Double.class); assertThat(lat, equalTo(1.0)); assertThat(lon, equalTo(-1.0)); } finally { service.stop(); service.close(); } } @SuppressWarnings("unchecked") public void testKnownAddressUsingMockWithIncorrectApiKey() throws Exception { final Map<String, Object> document = new HashMap<>(); document.put("address", KNOWN_ADDRESS); final IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), document); final Settings settings = Settings.builder() .put(API_KEY.getKey(), "abc") .build(); final GeocodingService service = new GeocodingServiceMock(settings); service.start(); try { final GeocodingProcessor processor = new GeocodingProcessor(service, "geocoding", "address", "loc"); processor.execute(ingestDocument); assertThat(ingestDocument.getFieldValue("address", String.class, true), equalTo(KNOWN_ADDRESS)); assertThat(ingestDocument.hasField("loc.coordinates"), is(false)); final List<String> errors = ingestDocument.getFieldValue("loc._errors", List.class); assertThat(errors.size(), is(1)); assertThat(errors.get(0), equalTo("Invalid API key (mock).")); } finally { service.stop(); service.close(); } } public void testUnknownAddressUsingMockWithCorrectApiKey() throws Exception { final Map<String, Object> document = new HashMap<>(); document.put("address", "unknown"); final IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), document); final Settings settings = Settings.builder() .put(API_KEY.getKey(), MOCK_KEY) .build(); final GeocodingService service = new GeocodingServiceMock(settings); service.start(); try { final GeocodingProcessor processor = new GeocodingProcessor(service, "geocoding", "address", "loc"); processor.execute(ingestDocument); assertThat(ingestDocument.getFieldValue("address", String.class, true), equalTo("unknown")); assertThat(ingestDocument.hasField("loc.coordinates"), is(true)); assertThat(ingestDocument.hasField("loc._errors"), is(false)); assertThat(ingestDocument.getFieldValue("loc.coordinates", Map.class), nullValue()); } finally { service.stop(); service.close(); } } }
[ "info@corneti.com" ]
info@corneti.com
63da8dfd5f5cc25c4365cb3ea1049d733cba1cc8
6568a24a834ed1fd2ac2e590656653cf1612769b
/src/quan/Main/Main.java
520703a41bc4022b7bc1ecf8230345392433a912
[]
no_license
nguyenquan2707/EncodeAndDecodeUsingBase64
1e0fd45b287783d5a416e581293268da2dd5cae5
0cb39cd62094381c1dcdf5055e5b0120d0fe3460
refs/heads/master
2023-05-13T18:37:21.120934
2018-12-23T03:59:17
2018-12-23T03:59:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,375
java
package quan.Main; import java.util.Base64; import java.util.UUID; public class Main { // refer https://gpcoder.com/4144-base64-encoding-va-decoding-trong-java-8/ // encode: Mã Hóa, decode: Giải mã public static void main(String[] args) { // Basic //encode String string = "Nguyen Viet Quan"; String encode = Base64.getEncoder().encodeToString(string.getBytes()); System.out.println(encode); // decode byte[] decode = Base64.getDecoder().decode(encode); String string2 = new String(decode); System.out.println(string2); //Base 64URL String URL = "https://faucet.rinkeby.io/"; String encodeToString = Base64.getUrlEncoder().encodeToString(URL.getBytes()); System.out.println(encodeToString); byte[] decode2 = Base64.getUrlDecoder().decode(encodeToString); String decodeURL = new String(decode2); System.out.println(decodeURL); //Base64 MIME StringBuffer stringBuffer = new StringBuffer(); for (int i = 0; i < 10; i++) { stringBuffer.append( UUID.randomUUID().toString()); } String stringMIME = stringBuffer.toString(); String encodeToString2 = Base64.getMimeEncoder().encodeToString(stringMIME.getBytes()); System.out.println(encodeToString2); //decode byte[] decode3 = Base64.getMimeDecoder().decode(encodeToString2.getBytes()); System.out.println(new String(decode3)); } }
[ "vozermuonnam1@gmail.com" ]
vozermuonnam1@gmail.com
36148b94fe0c1ae0043f32720aaa04962a111f44
000ad1311e24c4001ae2e9afa62787e354ba9172
/src/net/fand/cheer/demo/ch06/MyExceptionTest.java
d4cbe50ae3a9420a45204d35fc60dbac5027e366
[]
no_license
fsjw1234/boom
b80aba9725327f0b350d3f2f1d7716e2f2a4513e
7d50d5b9403a101448f3deceb37ea83e4072305d
refs/heads/master
2020-12-30T13:19:52.153909
2017-06-25T01:30:31
2017-06-25T01:30:31
91,343,392
0
0
null
null
null
null
UTF-8
Java
false
false
575
java
package net.fand.cheer.demo.ch06; import java.util.Scanner; public class MyExceptionTest{ public static void main(String[] args) throws MyException{ System.out.println("enter your age"); Scanner scan=null; try{ scan=new Scanner(System.in); while(scan.hasNextInt()){ int age=scan.nextInt(); if(age==-1){ break; } if(age<1||age>120){ throw new MyException(); } } }finally { scan.close(); } } } class MyException extends Exception{ public MyException(){ super("Age should be<=0 and <120"); } }
[ "793139278@qq.com" ]
793139278@qq.com
083d434571a6c5886aa91ac45c59f9128bc86410
e0e4eedbe00b79f9c00d8e14c3e49395c98b79ae
/app/src/main/java/com/cmbpizza/razor/golubev/AdminMenu.java
455cbfdb35e783170cffbe06519e28b75014ce24
[]
no_license
leaderout/Course-work2
67b2a50b9d1b1fcc5c41f2e7c7a29b2c3732e35e
665ac7fcf97f4d28e7ea11ef9043f269c0ddceb5
refs/heads/main
2023-02-05T14:10:06.400418
2020-12-17T21:40:28
2020-12-17T21:40:28
322,300,411
0
0
null
null
null
null
UTF-8
Java
false
false
20,864
java
package com.cmbpizza.razor.golubev; import android.Manifest; import android.app.Activity; import android.app.ActivityOptions; import android.app.Dialog; import android.app.SearchManager; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.database.Cursor; import android.database.DataSetObserver; import android.database.MatrixCursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.net.Uri; import android.provider.BaseColumns; import android.provider.MediaStore; import android.support.annotation.NonNull; import android.support.design.widget.FloatingActionButton; import android.os.Bundle; import android.support.v4.app.ActivityCompat; import android.util.Base64; import android.util.Pair; import android.util.TypedValue; import android.view.View; import android.view.WindowManager; import android.widget.AdapterView; import android.widget.AutoCompleteTextView; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.SearchView; import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; import java.io.ByteArrayOutputStream; import java.util.ArrayList; public class AdminMenu extends Activity implements View.OnClickListener, SearchView.OnQueryTextListener, SearchView.OnSuggestionListener, SearchView.OnCloseListener, ListView.OnItemClickListener { private static final String[] COLUMNS = { BaseColumns._ID, SearchManager.SUGGEST_COLUMN_TEXT_1, SearchManager.SUGGEST_COLUMN_ICON_1 }; private static SQLLiteHelperProducts sqLiteHelper; final int REQUEST_CODE_GALLERY = 999; public int orderCount = 0; public Dialog addProductDialog; public Dialog orderDialog; FloatingActionButton FabAddProduct; Button AddProductButton, CancelButton, ChooseImageButton, CheckOrderButton; EditText AddProductTitle, AddProductPrice, AddProductDescription; Spinner SpinnerProductCategory; ImageView ImgProductImageView; SearchView AdminSearchView; ListView ProductListView, OrderListView; ArrayList<Products> ProductList; ArrayList<Integer> ProductIDList; ArrayList<Orders> OrderList; ProductListAdapter ListAdapter; OrderListAdapter OrderListAdapter; private SearchSuggestionsAdapter mSuggestionsAdapter; @Override protected void onCreate(Bundle savedInstanceState) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); super.onCreate(savedInstanceState); setContentView(R.layout.activity_admin_menu); initializeComponents(); initializeListeners(); sqlLiteDB(); getAllData(); getAllSearchSuggestions(); } @Override protected void onStart() { super.onStart(); AdminSearchView.setIconified(true); AdminSearchView.clearFocus(); getOrderCount(); checkOrderCount(); getAllData(); } private void initializeComponents() { orderDialog = new Dialog(AdminMenu.this); orderDialog.setContentView(R.layout.admin_check_order_dialog); ProductListView = findViewById(R.id.adminListView); AdminSearchView = findViewById(R.id.adminSearchView); OrderListView = orderDialog.findViewById(R.id.adminOrderListView); AutoCompleteTextView searchAutoCompleteTextView = AdminSearchView.findViewById(AdminSearchView.getContext().getResources().getIdentifier("android:id/search_src_text", null, null)); searchAutoCompleteTextView.setThreshold(0); ProductList = new ArrayList<>(); ProductIDList = new ArrayList<>(); OrderList = new ArrayList<>(); ListAdapter = new ProductListAdapter(AdminMenu.this, R.layout.admin_product_items_list, ProductList); ProductListView.setAdapter(ListAdapter); OrderListAdapter = new OrderListAdapter(orderDialog.getContext(), R.layout.admin_check_order_list_view, OrderList); OrderListView.setAdapter(OrderListAdapter); FabAddProduct = findViewById(R.id.add_product_fab); CheckOrderButton = findViewById(R.id.adminOrderCheckButton); addProductDialog = new Dialog(AdminMenu.this); addProductDialog.setContentView(R.layout.admin_add_product_dialog); AddProductButton = addProductDialog.findViewById(R.id.btnAdminAddProduct); CancelButton = addProductDialog.findViewById(R.id.btnAdminCancel); ChooseImageButton = addProductDialog.findViewById(R.id.btnAdminAddProductImage); ImgProductImageView = addProductDialog.findViewById(R.id.imgProductImage); AddProductTitle = addProductDialog.findViewById(R.id.txtNewProductTitle); AddProductPrice = addProductDialog.findViewById(R.id.txtNewProductPrice); AddProductDescription = addProductDialog.findViewById(R.id.txtNewProductDescription); SpinnerProductCategory = addProductDialog.findViewById(R.id.spinnerAddProductCategory); } private void initializeListeners() { AddProductButton.setOnClickListener(this); CancelButton.setOnClickListener(this); ChooseImageButton.setOnClickListener(this); FabAddProduct.setOnClickListener(this); AdminSearchView.setOnQueryTextListener(this); AdminSearchView.setOnSuggestionListener(this); AdminSearchView.setOnCloseListener(this); ProductListView.setOnItemClickListener(this); CheckOrderButton.setOnClickListener(this); OrderListAdapter.registerDataSetObserver(new DataSetObserver() { @Override public void onChanged() { super.onChanged(); getOrderCount(); checkOrderCount(); } }); } @Override public void onClick(View view) { switch (view.getId()) { case R.id.btnAdminAddProduct: addProductToDB(); break; case R.id.btnAdminCancel: AddProductTitle.getText().clear(); AddProductPrice.getText().clear(); AddProductDescription.getText().clear(); ImgProductImageView.setImageBitmap(null); addProductDialog.cancel(); getAllData(); break; case R.id.btnAdminAddProductImage: ActivityCompat.requestPermissions( AdminMenu.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, REQUEST_CODE_GALLERY ); break; case R.id.add_product_fab: addProductFAB(); break; case R.id.adminOrderCheckButton: showOrderDialog(); break; } } private void showOrderDialog() { getOrderDetails(); orderDialog.setCancelable(true); orderDialog.setCanceledOnTouchOutside(true); orderDialog.show(); } private void getOrderDetails() { OrderList.clear(); //Toast.makeText(this, "ArrayLength: " + String.valueOf(sqLiteHelper.getCartCount(randomID)), Toast.LENGTH_SHORT).show(); OrderList.addAll(sqLiteHelper.getAllOrderItems()); //Toast.makeText(this, "ArrayLength: " + String.valueOf(CartItemsList.size()), Toast.LENGTH_SHORT).show(); OrderListAdapter.notifyDataSetChanged(); } private void getOrderCount() { orderCount = sqLiteHelper.getOrderCount(); } @Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { TextView ListProductId = view.findViewById(R.id.productId); Intent newIntent = new Intent(AdminMenu.this, AdminProductView.class); Pair<View, String> pairImage = Pair.create(view.findViewById(R.id.productImage), "productImageAdmin"); Pair<View, String> pairTitle = Pair.create(view.findViewById(R.id.productTitle), "productTitleAdmin"); Pair<View, String> pairDescription = Pair.create(view.findViewById(R.id.productDescription), "productDescriptionAdmin"); Pair<View, String> pairCategory = Pair.create(view.findViewById(R.id.productCategory), "productCategoryAdmin"); Pair<View, String> pairPrice = Pair.create(view.findViewById(R.id.productPrice), "productPriceAdmin"); ActivityOptions activityOptions = ActivityOptions.makeSceneTransitionAnimation( AdminMenu.this, pairImage, pairTitle, pairDescription, pairCategory, pairPrice); newIntent.putExtra("productId", ListProductId.getText().toString()); startActivity(newIntent, activityOptions.toBundle()); } public static String getPath(Uri uri, Context context) { if (uri == null) { Toast.makeText(context, "Невозможно обновить картинку, поробуйте ещё раз", Toast.LENGTH_SHORT).show(); return null; } String[] projection = {MediaStore.Images.Media.DATA}; Cursor cursor = context.getContentResolver().query(uri, projection, null, null, null); if (cursor != null) { int column_index = cursor .getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cursor.moveToFirst(); String path = cursor.getString(column_index); cursor.close(); return path; } return uri.getPath(); } public static Bitmap decodeBitmapFromFilePath(String path, int reqHeight, int reqWidth) { BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeFile(path, options); options.inSampleSize = calculateInSampleSize(options, reqHeight, reqWidth); options.inJustDecodeBounds = false; return BitmapFactory.decodeFile(path, options); } private static int calculateInSampleSize(BitmapFactory.Options options, int reqHeight, int reqWidth) { final int height = options.outHeight; final int width = options.outWidth; int inSampleSize = 1; if (height > reqHeight || width > reqWidth) { final int halfHeight = height / 2; final int halfWidth = width / 2; while ((halfHeight / inSampleSize) >= reqHeight && (halfWidth / inSampleSize) >= reqWidth) { inSampleSize *= 2; } } return inSampleSize; } private void getAllSearchSuggestions() { MatrixCursor cursor = new MatrixCursor(COLUMNS); for(int i: ProductIDList){ cursor.addRow(new String[]{String.valueOf(sqLiteHelper.getProductID(i)), sqLiteHelper.getProductTitle(i), android.util.Base64.encodeToString(sqLiteHelper.getProductImage(i), Base64.DEFAULT)}); } mSuggestionsAdapter = new SearchSuggestionsAdapter(AdminSearchView.getContext(), cursor, R.layout.search_suggestion_view, false); AdminSearchView.setSuggestionsAdapter(mSuggestionsAdapter); } public void getSearchTextSuggestions(String searchString) { MatrixCursor cursor = new MatrixCursor(COLUMNS); ArrayList<Products> filterProductList = new ArrayList<>(); filterProductList.clear(); if (!searchString.isEmpty()) { String searchStringLower = searchString.toLowerCase(); for (Products list : ProductList) { String ProductName = list.getProductTitle().toLowerCase(); if (ProductName.startsWith(searchStringLower)) { filterProductList.add(list); } } for(Products filterList: filterProductList){ cursor.addRow(new String[]{String.valueOf(filterList.getProductId()), filterList.getProductTitle(), android.util.Base64.encodeToString(filterList.getProductImage(), Base64.DEFAULT)}); } } else { for(int i: ProductIDList){ cursor.addRow(new String[]{String.valueOf(sqLiteHelper.getProductID(i)), sqLiteHelper.getProductTitle(i), android.util.Base64.encodeToString(sqLiteHelper.getProductImage(i), Base64.DEFAULT)}); } } mSuggestionsAdapter = new SearchSuggestionsAdapter(AdminSearchView.getContext(), cursor, R.layout.search_suggestion_view, false); AdminSearchView.setSuggestionsAdapter(mSuggestionsAdapter); } public byte[] imageViewToByte(ImageView image) { Bitmap bitmap = ((BitmapDrawable) image.getDrawable()).getBitmap(); ByteArrayOutputStream stream = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream); return stream.toByteArray(); } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if (requestCode == REQUEST_CODE_GALLERY) { if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { Intent intent = new Intent(Intent.ACTION_PICK); intent.setType("image/*"); startActivityForResult(intent, REQUEST_CODE_GALLERY); } else { Toast.makeText(AdminMenu.this, "У вас нет разрешения для доступа к галлереи", Toast.LENGTH_SHORT).show(); } return; } super.onRequestPermissionsResult(requestCode, permissions, grantResults); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_CODE_GALLERY && resultCode == RESULT_OK && data != null) { Uri uri = data.getData(); ImgProductImageView.setImageBitmap(decodeBitmapFromFilePath(getPath(uri, this), 150, 150)); } super.onActivityResult(requestCode, resultCode, data); } private void addProductFAB() { addProductDialog.setCancelable(true); addProductDialog.setCanceledOnTouchOutside(true); addProductDialog.show(); } private void sqlLiteDB() { sqLiteHelper = new SQLLiteHelperProducts(AdminMenu.this, "ProductDB", null, 1); sqLiteHelper.dataQuery("CREATE TABLE IF NOT EXISTS productTable (productId INTEGER PRIMARY KEY AUTOINCREMENT, productTitle VARCHAR, productCategory VARCHAR, productPrice INTEGER, productDescription VARCHAR, productImage BLOB)"); sqLiteHelper.dataQuery("CREATE TABLE IF NOT EXISTS productOrderTable (orderId INTEGER PRIMARY KEY, memberId INTEGER, idList VARCHAR, quantityList VARCHAR, totalPrice INTEGER, orderStatus INTEGER)"); } private void getAllData() { ProductIDList.clear(); ProductList.clear(); for (Products product: sqLiteHelper.getAllData()) { ProductIDList.add(product.getProductId()); ProductList.add(new Products(product.getProductId(), product.getProductTitle(), product.getProductCategory(), product.getProductPrice(), product.getProductDescription(), product.getProductImage())); } ListAdapter.notifyDataSetChanged(); } private void addProductToDB() { if (inputValidation()) { try { sqLiteHelper.insertData( AddProductTitle.getText().toString().trim(), SpinnerProductCategory.getSelectedItem().toString(), Integer.parseInt(AddProductPrice.getText().toString()), AddProductDescription.getText().toString(), imageViewToByte(ImgProductImageView) ); Toast.makeText(AdminMenu.this, "Продукт успешно добавлен!", Toast.LENGTH_SHORT).show(); } catch (Exception ex) { ex.printStackTrace(); } getAllData(); AddProductTitle.getText().clear(); AddProductPrice.getText().clear(); AddProductDescription.getText().clear(); ImgProductImageView.setImageBitmap(null); addProductDialog.cancel(); } } private boolean inputValidation() { boolean valid; if (ImgProductImageView.getDrawable() == null) { valid = false; Toast.makeText(this, "Пожалуйста, включите изображение продукта", Toast.LENGTH_SHORT).show(); } else if (String.valueOf(AddProductTitle.getText()).isEmpty()) { valid = false; Toast.makeText(this, "Пожалуйста, введите название продукта", Toast.LENGTH_SHORT).show(); } else if (String.valueOf(AddProductPrice.getText()).isEmpty()) { valid = false; Toast.makeText(this, "Пожалуйста, введите цену продукта", Toast.LENGTH_SHORT).show(); } else if (String.valueOf(AddProductDescription.getText()).isEmpty()) { valid = false; Toast.makeText(this, "Пожалуйста, введите описание продукта", Toast.LENGTH_SHORT).show(); } else { valid = true; } return valid; } @Override public boolean onQueryTextSubmit(String s) { String searchStringLower = s.toLowerCase(); ArrayList<Products> filterProductList = new ArrayList<>(); for (Products list : ProductList) { String ProductName = list.getProductTitle().toLowerCase(); if (ProductName.startsWith(searchStringLower)) { filterProductList.add(list); } } ProductList.clear(); ProductList.addAll(filterProductList); ListAdapter.notifyDataSetChanged(); filterProductList.clear(); Toast.makeText(this, "Вы искали: " + s, Toast.LENGTH_LONG).show(); return true; } @Override public boolean onQueryTextChange(String searchString) { if (!searchString.isEmpty()) { getSearchTextSuggestions(searchString); } else { getAllSearchSuggestions(); getAllData(); } return true; } @Override public boolean onSuggestionSelect(int i) { return false; } @Override public boolean onSuggestionClick(int i) { Cursor c = (Cursor) mSuggestionsAdapter.getItem(i); String query = c.getString(c.getColumnIndex(SearchManager.SUGGEST_COLUMN_TEXT_1)); AdminSearchView.setQuery(query, true); return true; } @Override public boolean onClose() { getAllData(); return true; } private void checkOrderCount() { RelativeLayout relativeLayoutButton, relativeLayoutBadge; relativeLayoutButton = findViewById(R.id.layoutRelativeOrderCheckButton); relativeLayoutBadge = findViewById(R.id.layoutRelativeOrderButtonBadge); RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT); if (orderCount > 0) { layoutParams.setMargins(layoutParams.getMarginStart(), 0, layoutParams.getMarginEnd(), 0); layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, R.layout.activity_admin_menu); relativeLayoutButton.setLayoutParams(layoutParams); RelativeLayout.LayoutParams layoutParamsBadge = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); layoutParamsBadge.setMargins(0, 0, 0, 0); layoutParamsBadge.addRule(RelativeLayout.ALIGN_START, R.id.layoutLinearOrderCheckButton); layoutParamsBadge.addRule(RelativeLayout.ALIGN_TOP, R.id.layoutLinearOrderCheckButton); relativeLayoutBadge.setLayoutParams(layoutParamsBadge); relativeLayoutBadge.setVisibility(View.VISIBLE); TextView cartBadgeCount = findViewById(R.id.txtOrderButtonBadge); cartBadgeCount.setText(String.valueOf(orderCount)); } else { int value = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, -50.0f, getResources().getDisplayMetrics()); layoutParams.setMargins(layoutParams.getMarginStart(), 0, layoutParams.getMarginEnd(), value); layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, R.layout.activity_admin_menu); relativeLayoutButton.setLayoutParams(layoutParams); } } }
[ "golubev1701@mail.ru" ]
golubev1701@mail.ru
788100ef0f57031958d7a1f6f7c08e78e14fd697
d1bd1246f161b77efb418a9c24ee544d59fd1d20
/java/Lightning/src/org/javenstudio/lightning/context/ConfigPluginInfo.java
8032457ef4265df143978ad6872192e0dff8b37c
[]
no_license
navychen2003/javen
f9a94b2e69443291d4b5c3db5a0fc0d1206d2d4a
a3c2312bc24356b1c58b1664543364bfc80e816d
refs/heads/master
2021-01-20T12:12:46.040953
2015-03-03T06:14:46
2015-03-03T06:14:46
30,912,222
0
1
null
2023-03-20T11:55:50
2015-02-17T10:24:28
Java
UTF-8
Java
false
false
3,231
java
package org.javenstudio.lightning.context; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import org.javenstudio.falcon.ErrorException; import org.javenstudio.falcon.util.ContextNode; import org.javenstudio.falcon.util.NamedList; import org.javenstudio.falcon.util.PluginInfo; public class ConfigPluginInfo extends PluginInfo { @SuppressWarnings("rawtypes") public static final PluginInfo EMPTY_INFO = new ConfigPluginInfo("", Collections.<String,String>emptyMap(), new NamedList(), Collections.<PluginInfo>emptyList()); private static final Set<String> NL_TAGS = new HashSet<String>( Arrays.asList("lst", "arr", "bool", "str", "int", "long", "float", "double")); private final String mName, mClassName, mType; private final NamedList<?> mInitArgs; private final Map<String, String> mAttributes; private final List<PluginInfo> mChildren; public ConfigPluginInfo(String type, Map<String,String> attrs, NamedList<?> initArgs, List<PluginInfo> children) { mType = type; mName = attrs.get("name"); mClassName = attrs.get("class"); mInitArgs = initArgs; mAttributes = Collections.unmodifiableMap(attrs); mChildren = (children == null) ? Collections.<PluginInfo>emptyList() : Collections.unmodifiableList(children); } public ConfigPluginInfo(ContextNode node, String error, boolean requireName, boolean requireClass) throws ErrorException { mType = node.getNodeName(); mName = node.getAttribute("name", requireName ? error : null); mClassName = node.getAttribute("class", requireClass ? error : null); mInitArgs = node.getChildNodesAsNamedList(); mAttributes = Collections.unmodifiableMap(node.getAttributes()); mChildren = loadSubPlugins(node); } public final String getName() { return mName; } public final String getClassName() { return mClassName; } public final String getType() { return mType; } public final NamedList<?> getInitArgs() { return mInitArgs; } public final List<PluginInfo> getChildren() { return mChildren; } @Override public final String getAttribute(String name) { return mAttributes.get(name); } private List<PluginInfo> loadSubPlugins(ContextNode node) throws ErrorException { List<PluginInfo> children = new ArrayList<PluginInfo>(); //if there is another sub tag with a non namedlist tag that has to be another plugin Iterator<ContextNode> nodes = node.getChildNodes(); while (nodes.hasNext()) { ConfigNode nd = (ConfigNode)nodes.next(); if (!nd.isElementNode()) continue; if (NL_TAGS.contains(nd.getNodeName())) continue; PluginInfo pluginInfo = new ConfigPluginInfo(nd, null, false, false); if (pluginInfo.isEnabled()) children.add(pluginInfo); } return children.isEmpty() ? Collections.<PluginInfo>emptyList() : Collections.unmodifiableList(children); } @Override public boolean isEnabled() { String enable = mAttributes.get("enable"); return enable == null || Boolean.parseBoolean(enable); } @Override public boolean isDefault() { return Boolean.parseBoolean(mAttributes.get("default")); } }
[ "navychen2003@hotmail.com" ]
navychen2003@hotmail.com
ed6689ad8fe694aa613723af07cde68175499971
fc1130124c3d8c5277d3dbb26e899ebf20c90ce8
/app/src/main/java/com/example/login/Lista/Clientes/ClienteAdapter.java
396622cdfe3075547d94a41128db1651cb01d1af
[]
no_license
TiagoPereiraIfsul/TCC
8a022e2557a2d8c637070856a434cb8d8c28e9fb
974621639672dcf3ee69c13a0290eebaa904e70a
refs/heads/master
2020-08-06T03:51:26.349046
2019-12-06T14:35:41
2019-12-06T14:35:41
212,823,006
0
0
null
null
null
null
UTF-8
Java
false
false
5,314
java
package com.example.login.Lista.Clientes; import android.content.Context; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.example.login.Modelo.ModeloCliente; import com.example.login.R; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.database.FirebaseDatabase; import com.squareup.picasso.Picasso; import java.util.Date; import java.util.List; public class ClienteAdapter extends RecyclerView.Adapter<ClienteAdapter.ModeloClientesViewHolder>{ private final List<ModeloCliente> clientes; private final Context context; private final ClienteAdapter.ModeloClienteOnClickListener onClickListener; public interface ModeloClienteOnClickListener { void onClickModeloCliente(ModeloClientesViewHolder holder, int idx); } public ClienteAdapter(Context context, List<ModeloCliente> clientes, ModeloClienteOnClickListener onClickListener) { this.context = context; this.clientes = clientes; this.onClickListener = onClickListener; } @Override public ModeloClientesViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { // Este método cria uma subclasse de RecyclerView.ViewHolder // Infla a view do layout View view = LayoutInflater.from(context).inflate(R.layout.adapter_do_recycler_cliente, viewGroup, false); // Cria a classe do ViewHolder ModeloClientesViewHolder holder = new ModeloClientesViewHolder(view); return holder; } @Override public void onBindViewHolder(final ModeloClientesViewHolder holder, final int position) { // Este método recebe o índice do elemento, e atualiza as views que estão dentro do ViewHolder ModeloCliente c = clientes.get(position); // Atualizada os valores nas views holder.tNome.setText(c.getNome()); holder.tCabelo.setText(c.getCabelo()); holder.tBarba.setText(c.getBarba()); holder.tSobrancelha.setText(c.getSobrancelha()); holder.tHorario.setText(c.getHorario()); holder.tValor.setText(c.getValorTotal()); holder.tData.setText(c.getData()); //holder.tData.; if(c.getFoto() != null) { Picasso.with(this.context).load(c.getFoto()).into(holder.img); //Bitmap bitmap = BitmapFactory.decodeByteArray(c.getFoto(), 0, c.getFoto().length()); //holder.img.setImageBitmap(bitmap); } else { holder.img.setImageResource(R.mipmap.ic_launcher); } // holder.img.setImageResource(c.foto); // Click if (onClickListener != null) { holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // Chama o listener para informar que clicou no Cachorro onClickListener.onClickModeloCliente(holder, position); } }); } holder.deletar.setOnClickListener(v -> { // Chama o listener para informar que clicou no Cachorro //onClickListener.onClickModeloEstilo(holder, position); System.out.println("cloicou na merdada lixeira"); FirebaseDatabase.getInstance().getReference("HorariosMarcados").child(c.getId()).removeValue().addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { Toast.makeText(context, "Apagou", Toast.LENGTH_SHORT).show(); } }); }); } @Override public int getItemCount() { return this.clientes != null ? this.clientes.size() : 0; } // Subclasse de RecyclerView.ViewHolder. Contém todas as views. public static class ModeloClientesViewHolder extends RecyclerView.ViewHolder { public TextView tNome; public TextView tCabelo; public TextView tSobrancelha; public TextView tBarba; public TextView tHorario; public TextView tValor; public TextView tData; public ImageView img; public ImageView deletar; private View view; public ModeloClientesViewHolder(View view) { super(view); this.view = view; // Cria as views para salvar no ViewHolder img = (ImageView) view.findViewById(R.id.img); tNome = (TextView) view.findViewById(R.id.tNome); tCabelo = (TextView) view.findViewById(R.id.tCabelo); tSobrancelha = (TextView) view.findViewById(R.id.tSobrancelha); tBarba = (TextView) view.findViewById(R.id.tBarba); tHorario = (TextView) view.findViewById(R.id.tHorario); tValor = (TextView) view.findViewById(R.id.tValor); tData = (TextView) view.findViewById(R.id.tData); deletar = (ImageView) view.findViewById(R.id.deletarrr); //img = (ImageView) view.findViewById(R.id.img); } } }
[ "kgtiagotyga5@gmail.com" ]
kgtiagotyga5@gmail.com
d687598d40a922f91944cf13d7150e1848f262b2
311918587dec5cce54cd436aa437222481c93073
/coding_tx/src/main/java/com/temp/common/complier/test/demo1/compiler.java
186b7566bf21ffb65354fd13ac567f85370c28c4
[]
no_license
liwen666/component
7f7ad2290e77632490012306cc835d43c71c8ca6
2b1839954bb58eb0adad9e32090d9b971c1577b9
refs/heads/master
2022-12-21T11:14:17.461104
2021-04-25T08:49:41
2021-04-25T08:49:41
163,070,384
0
1
null
2022-12-10T06:15:07
2018-12-25T09:55:09
Java
UTF-8
Java
false
false
2,493
java
package com.temp.common.complier.test.demo1; import com.temp.common.complier.tools.JavaStringCompiler; import com.temp.common.utils.PackageScanUtils; import lombok.Cleanup; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import com.temp.common.complier.tools.JavaStringCompiler; import com.temp.common.utils.PackageScanUtils; import lombok.Cleanup; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import com.google.common.collect.Lists; import com.temp.common.base.io.pagescan.PageScanUtil; import com.temp.common.complier.tools.JavaStringCompiler; import com.temp.common.utils.PackageScanUtils; import lombok.Cleanup; import org.springframework.core.io.Resource; import java.io.*; import java.util.ArrayList; import java.util.Map; /** * <p> * 描述 * </p> * * @author LW * @since 2021/3/11 13:58 */ public class compiler { public static void main(String[] args) throws IOException { String flinkJob = "hello"; ArrayList<File> objects = Lists.newArrayList(); PackageScanUtils.findResourceByPath("D:\\workspace\\test_workspace\\coding_tx\\src\\main\\java\\com\\temp\\common\\complier\\test\\demo1", objects); String outPath = "D:\\workspace\\test_workspace\\coding_tx\\src\\main\\java\\com\\temp\\common\\complier\\test\\out\\"; objects.forEach(e -> { System.out.println(e.getName()); System.out.println(e.getPath()); try { @Cleanup FileInputStream fileInputStream = new FileInputStream(e); byte[] cache = new byte[fileInputStream.available()]; fileInputStream.read(cache); String java = new String(cache, "utf-8"); System.out.println(java); Map<String, byte[]> results = new JavaStringCompiler().compile(e.getName(), java,""); System.out.println(results.size()); File outFile = new File(outPath + e.getName().split("\\.")[0] + ".class"); FileOutputStream outputStream = new FileOutputStream(outFile); outputStream.write(results.entrySet().iterator().next().getValue()); } catch (FileNotFoundException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } }); } }
[ "1438131288@qq.com" ]
1438131288@qq.com
e4ef51b85fce733048194555e2563ac307a1bae3
d60e287543a95a20350c2caeabafbec517cabe75
/LACCPlus/Hadoop/2884_1.java
781571358946d9f49c7583f9c8f67264e609ea45
[ "MIT" ]
permissive
sgholamian/log-aware-clone-detection
242067df2db6fd056f8d917cfbc143615c558b2c
9993cb081c420413c231d1807bfff342c39aa69a
refs/heads/main
2023-07-20T09:32:19.757643
2021-08-27T15:02:50
2021-08-27T15:02:50
337,837,827
0
0
null
null
null
null
UTF-8
Java
false
false
881
java
//,temp,TestFileBasedCopyListing.java,429,452,temp,TestIntegration.java,343,361 //,3 public class xxx { @Test public void testGlobTargetDirMultiLevel() { try { Path listFile = new Path("/tmp1/listing"); Path target = new Path("/tmp/target"); addEntries(listFile, "/tmp/*/*"); createFiles("/tmp/multifile/file3", "/tmp/multifile/file4", "/tmp/multifile/file5"); createFiles("/tmp/singledir1/dir3/file7", "/tmp/singledir1/dir3/file8", "/tmp/singledir1/dir3/file9"); mkdirs(target.toString()); runTest(listFile, target, true); checkResult(listFile, 6); } catch (IOException e) { LOG.error("Exception encountered while testing build listing", e); Assert.fail("build listing failure"); } finally { TestDistCpUtils.delete(fs, "/tmp"); TestDistCpUtils.delete(fs, "/tmp1"); } } };
[ "sgholami@uwaterloo.ca" ]
sgholami@uwaterloo.ca
a3e9a1b80e4e20aea248b19c21a59926748e88ed
f7893ba1f93dca28afd1759c3f1a2c40eede6763
/backend/build/generated-source/endpoints/java/com/example/abhilash/myapplication/backend/myApi/MyApiRequest.java
892f2a7be2edca3caf58a65a9a0bd4abf594b571
[]
no_license
das-abhilash/JokeTellingApp
8592726194e691286b8b0bf197d7a1513717255e
19b8e97f391578d67270aec1d15a6c9f8ee7b961
refs/heads/master
2021-01-01T03:44:17.737636
2016-04-28T02:31:46
2016-04-28T02:31:46
57,190,070
1
0
null
null
null
null
UTF-8
Java
false
false
6,429
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ /* * This code was generated by https://github.com/google/apis-client-generator/ * (build: 2016-04-08 17:16:44 UTC) * on 2016-04-27 at 05:42:02 UTC * Modify at your own risk. */ package com.example.abhilash.myapplication.backend.myApi; /** * MyApi request. * * @since 1.3 */ @SuppressWarnings("javadoc") public abstract class MyApiRequest<T> extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest<T> { /** * @param client Google client * @param method HTTP Method * @param uriTemplate URI template for the path relative to the base URL. If it starts with a "/" * the base path from the base URL will be stripped out. The URI template can also be a * full URL. URI template expansion is done using * {@link com.google.api.client.http.UriTemplate#expand(String, String, Object, boolean)} * @param content A POJO that can be serialized into JSON or {@code null} for none * @param responseClass response class to parse into */ public MyApiRequest( MyApi client, String method, String uriTemplate, Object content, Class<T> responseClass) { super( client, method, uriTemplate, content, responseClass); } /** Data format for the response. */ @com.google.api.client.util.Key private java.lang.String alt; /** * Data format for the response. [default: json] */ public java.lang.String getAlt() { return alt; } /** Data format for the response. */ public MyApiRequest<T> setAlt(java.lang.String alt) { this.alt = alt; return this; } /** Selector specifying which fields to include in a partial response. */ @com.google.api.client.util.Key private java.lang.String fields; /** * Selector specifying which fields to include in a partial response. */ public java.lang.String getFields() { return fields; } /** Selector specifying which fields to include in a partial response. */ public MyApiRequest<T> setFields(java.lang.String fields) { this.fields = fields; return this; } /** * API key. Your API key identifies your project and provides you with API access, quota, and * reports. Required unless you provide an OAuth 2.0 token. */ @com.google.api.client.util.Key private java.lang.String key; /** * API key. Your API key identifies your project and provides you with API access, quota, and * reports. Required unless you provide an OAuth 2.0 token. */ public java.lang.String getKey() { return key; } /** * API key. Your API key identifies your project and provides you with API access, quota, and * reports. Required unless you provide an OAuth 2.0 token. */ public MyApiRequest<T> setKey(java.lang.String key) { this.key = key; return this; } /** OAuth 2.0 token for the current user. */ @com.google.api.client.util.Key("oauth_token") private java.lang.String oauthToken; /** * OAuth 2.0 token for the current user. */ public java.lang.String getOauthToken() { return oauthToken; } /** OAuth 2.0 token for the current user. */ public MyApiRequest<T> setOauthToken(java.lang.String oauthToken) { this.oauthToken = oauthToken; return this; } /** Returns response with indentations and line breaks. */ @com.google.api.client.util.Key private java.lang.Boolean prettyPrint; /** * Returns response with indentations and line breaks. [default: true] */ public java.lang.Boolean getPrettyPrint() { return prettyPrint; } /** Returns response with indentations and line breaks. */ public MyApiRequest<T> setPrettyPrint(java.lang.Boolean prettyPrint) { this.prettyPrint = prettyPrint; return this; } /** * Available to use for quota purposes for server-side applications. Can be any arbitrary string * assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. */ @com.google.api.client.util.Key private java.lang.String quotaUser; /** * Available to use for quota purposes for server-side applications. Can be any arbitrary string * assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. */ public java.lang.String getQuotaUser() { return quotaUser; } /** * Available to use for quota purposes for server-side applications. Can be any arbitrary string * assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. */ public MyApiRequest<T> setQuotaUser(java.lang.String quotaUser) { this.quotaUser = quotaUser; return this; } /** * IP address of the site where the request originates. Use this if you want to enforce per-user * limits. */ @com.google.api.client.util.Key private java.lang.String userIp; /** * IP address of the site where the request originates. Use this if you want to enforce per-user * limits. */ public java.lang.String getUserIp() { return userIp; } /** * IP address of the site where the request originates. Use this if you want to enforce per-user * limits. */ public MyApiRequest<T> setUserIp(java.lang.String userIp) { this.userIp = userIp; return this; } @Override public final MyApi getAbstractGoogleClient() { return (MyApi) super.getAbstractGoogleClient(); } @Override public MyApiRequest<T> setDisableGZipContent(boolean disableGZipContent) { return (MyApiRequest<T>) super.setDisableGZipContent(disableGZipContent); } @Override public MyApiRequest<T> setRequestHeaders(com.google.api.client.http.HttpHeaders headers) { return (MyApiRequest<T>) super.setRequestHeaders(headers); } @Override public MyApiRequest<T> set(String parameterName, Object value) { return (MyApiRequest<T>) super.set(parameterName, value); } }
[ "abhilashmyworld@gmail.com" ]
abhilashmyworld@gmail.com
e83bbe2dec8f2a608373522b2a65dbe1d099faec
a546db78e9806979e459831fb16c6e51878eb60b
/src/main/model/data/Value.java
0affc32c898c337fdf427e5f8aa62dcb7f3c49e5
[]
no_license
Bryce-MW/WikidataExplorer
92fd35b8e9364d9bd7e005a39d321bc788ea049f
9ad2dac3c82077466dcb36f25128611881f8965b
refs/heads/master
2023-06-22T20:58:25.975518
2021-07-25T22:33:33
2021-07-25T22:33:33
287,648,884
5
1
null
2020-08-16T06:03:52
2020-08-15T00:23:27
Java
UTF-8
Java
false
false
10,501
java
package model.data; import model.data.additional.*; import model.data.additional.helpers.*; import model.data.pages.Item; import model.data.pages.Property; import model.data.pages.language.Form; import model.data.pages.language.Lexeme; import model.data.pages.language.Sense; import model.data.source.template.DataValue; import ui.GUInterface; import ui.cli.ItemView; import ui.cli.StatementList; import javax.swing.*; import java.awt.*; import java.util.List; import java.util.Map; public abstract class Value extends JPanel { /* * Class Description: * This is the abstract class for any "Value". Originally, this was basically just going to be any Wikidata * datatype, but my poor planning meant that it ended up also including things that should really be left to * rendering or a different type of class entirely. It works well enough. This class also handles converting from * a "snak" to an actual Value which is a reasonable static function for this class to have. This class also * does its own rendering for the GUI but it does it in a very weird way since it's not actually as a panel but * as an item in a statement list. This makes it very confusing to debug and use. I would definitely write this * class very differently if I was doing this again. */ protected DatumQueryService queryService; protected ItemView view = null; protected final String id; protected boolean initialized; protected JButton button; /* * REQUIRES: queryService is not null, id is a valid Wikidata ID * MODIFIES: this * EFFECTS : sets up fields which are common to all Values */ protected Value(DatumQueryService queryService, String id) { this.id = id; this.queryService = queryService; setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); setAlignmentX(Component.LEFT_ALIGNMENT); setBackground(GUInterface.midGray); } /* * REQUIRES: dataType is a valid Wikidata datatype which has LiteralString as its backing, queryService is not * null, stringValue is not null * MODIFIES: none * EFFECTS : interprets a literal string and returns the specific type of value which it corresponds to */ private static LiteralString getLiteralString(String dataType, DatumQueryService queryService, String stringValue) { switch (dataType) { case "commonsMedia": return new CommonsMedia(stringValue, queryService); case "geographic-shape": return new GeographicShape(stringValue, queryService); case "string": return new LiteralString(stringValue, queryService); case "tabular-data": return new TabularData(stringValue, queryService); case "url": return new URL(stringValue, queryService); case "external-id": return new ExternalIdentifier(stringValue, queryService); case "musical-notation": return new MusicalNotation(stringValue, queryService); case "mathematical-expression": return new MathematicalExpression(stringValue, queryService); } throw new Error("Datatype: " + dataType + " not found"); } /* * REQUIRES: value is a valid Wikidata datatype, value is a valid DataValue corresponding to the datatype, * queryService is not null * MODIFIES: none * EFFECTS : parses snak data into the specific type of Value which it represents */ public static Value parseData(DataValue value, String dataType, DatumQueryService queryService) { switch (value.type) { case "string": String stringValue = (String) value.value; return getLiteralString(dataType, queryService, stringValue); case "globecoordinate": GlobeCoordinateData globeCoordinateValue = new GlobeCoordinateData((Map<String, Object>) value.value); return new GlobeCoordinate(globeCoordinateValue, queryService); case "monolingualtext": MonolingualTextData monolingualTextValue = new MonolingualTextData((Map<String, String>) value.value); return new MonolingualText(monolingualTextValue, queryService); case "quantity": QuantityData quantityValue = new QuantityData((Map<String, String>) value.value); return new Quantity(quantityValue, queryService); case "time": TimeData timeValue = new TimeData((Map<String, Object>) value.value); return new Time(timeValue, queryService); case "wikibase-entityid": EntityData entityValue = new EntityData((Map<String, Object>) value.value); return getDatum(dataType, queryService, entityValue); } throw new Error("Datatype: " + dataType + " not found"); } /* * REQUIRES: dataType is a valid Wikidata datatype with an item as its backing, queryService is not null, * entityValue is not a valid EntityData corresponding to the dataType given * MODIFIES: none * EFFECTS : parses snak item data to return the specific type of Datum which this Item is */ private static Datum getDatum(String dataType, DatumQueryService queryService, EntityData entityValue) { try { switch (dataType) { case "wikibase-item": return new Item(entityValue, queryService); case "wikibase-property": return new Property(entityValue, queryService); case "wikibase-lexeme": return new Lexeme(entityValue, queryService); case "wikibase-form": return new Form(entityValue, queryService); case "wikibase-sense": return new Sense(entityValue, queryService); } } catch (NotFoundException e) { throw new Error("ID: " + entityValue.id + " not found", e); } throw new Error("Datatype: " + dataType + " not found"); } /* * REQUIRES: none * MODIFIES: this * EFFECTS : finishes initializing the GUI components after it is added to another component (to allow for the * subclasses to finish initializing first) */ @Override public void addNotify() { super.addNotify(); if (!initialized) { initialized = true; Value thisValue = this; button = new JButton("◄"); button.addActionListener(i -> { Container parent = getParent(); if (parent instanceof StatementList) { StatementList guInterface = (StatementList) parent; guInterface.toggle(new ItemView(thisValue)); } }); button.setMargin(new Insets(0, 0, 0, 0)); add(button); JLabel idComp = new JLabel(getID()); idComp.setForeground(Color.WHITE); add(idComp); JLabel separator = new JLabel(": "); separator.setForeground(Color.WHITE); add(separator); JLabel titleComp = new JLabel(getTitle()); titleComp.setForeground(Color.WHITE); add(titleComp); } } /* * REQUIRES: none * MODIFIES: none * EFFECTS : gets the title to be displayed */ public abstract String getTitle(); /* * REQUIRES: none * MODIFIES: none * EFFECTS : gets the description to be displayed */ public abstract String getDescription(); /* * REQUIRES: none * MODIFIES: none * EFFECTS : gets the id if this Value (if there is one, often returns the title otherwise) */ public String getID() { return id; } /* * REQUIRES: none * MODIFIES: none * EFFECTS : returns the list of statements associated with this Value */ public abstract StatementList getStatements(); /* * REQUIRES: none * MODIFIES: this * EFFECTS : parses a REPL command directed at this Value */ public abstract Boolean parse(List<String> subList); /* * REQUIRES: view is not null * MODIFIES: this * EFFECTS : sets of the ItemView which contains this Value */ public void setView(ItemView view) { this.view = view; } /* * REQUIRES: none * MODIFIES: none * EFFECTS : returns if an ItemView needs to include a search bar */ public boolean needsSearchBar() { return false; } /* * REQUIRES: none * MODIFIES: none * EFFECTS : returns if an ItemView needs a right arrow */ public boolean needsRightArrow() { return true; } /* * REQUIRES: none * MODIFIES: none * EFFECTS : returns the query service that this Value uses */ public DatumQueryService getQuery() { return queryService; } /* * REQUIRES: none * MODIFIES: none * EFFECTS : returns true if this object has the same ID as another */ @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Value)) { return false; } Value value = (Value) o; return getID().equals(value.getID()); } /* * REQUIRES: none * MODIFIES: none * EFFECTS : returns the hashcode of the description */ @Override public int hashCode() { int result = getDescription().hashCode(); result = 31 * result; return result; } /* * REQUIRES: value is not null * MODIFIES: this * EFFECTS : toggles the value in the controller to the left */ protected Boolean toggleLeft(Value value) { if (this.view == null) { return false; } return view.toggleLeft(value); } /* * REQUIRES: value is not null and does not already exist * MODIFIES: this * EFFECTS : adds a statement to this statement list */ public void addStatement(Value value) { getStatements().add(value); } /* * REQUIRES: none * MODIFIES: none * EFFECTS : returns the image name or an empty string if there is no image */ public String getImage() { return ""; } }
[ "bryce@thenetworknerds.ca" ]
bryce@thenetworknerds.ca
bb045318e9babb4c2e1847cda349f5b4c66c935e
2c86de84391b65a4ad3dc18ba0764d73bd89df81
/src/main/java/com/springmvc/models/OperationLog.java
dfc0c717e5da60e4ed9c0536752deb1d90e8ca77
[]
no_license
tsball/springmvc-hibernate
4babb557443dcb5e2b6e87a6fa61f27b30bef9a6
42b17d71e7d83872c5198422be8c2a921a52d182
refs/heads/master
2020-09-19T23:17:50.683247
2018-06-08T07:07:30
2018-06-08T07:07:30
67,872,899
0
0
null
null
null
null
UTF-8
Java
false
false
1,943
java
package com.springmvc.models; import java.sql.Timestamp; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; @Entity @Table(name = "operation_logs") public class OperationLog { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; @Enumerated(EnumType.STRING) @Column(nullable = false) private OperationLogRiskLevel riskLevel; @Enumerated(EnumType.STRING) @Column(nullable = false) private OperationLogEvent event; @Enumerated(EnumType.STRING) @Column(nullable = false) private OperationLogCategory category; @Column(nullable = false) private String message; @ManyToOne @JoinColumn(name="user_id") private User user; @Column(nullable = false) private Timestamp createdAt; public long getId() { return id; } public void setId(long id) { this.id = id; } public OperationLogRiskLevel getRiskLevel() { return riskLevel; } public void setRiskLevel(OperationLogRiskLevel riskLevel) { this.riskLevel = riskLevel; } public OperationLogEvent getEvent() { return event; } public void setEvent(OperationLogEvent event) { this.event = event; } public OperationLogCategory getCategory() { return category; } public void setCategory(OperationLogCategory category) { this.category = category; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public Timestamp getCreatedAt() { return createdAt; } public void setCreatedAt(Timestamp createdAt) { this.createdAt = createdAt; } }
[ "tsball@qq.com" ]
tsball@qq.com
a674f3e593a2e8111c645539da40ae0b42055139
c119200e73847cbcb9eb956f5254fb05f912238e
/core/org.wso2.carbon.tomcat.ext/src/main/java/org/wso2/carbon/tomcat/ext/filter/CharacterSetFilter.java
27b9241a525716f8ea813564bfcf5d9ab27f0e95
[]
no_license
kasunbg/carbon-kernel-4.x
ac04423bc482ae4cdf98cbb92ad19b9b2be1dd9f
ea7a3cfea7b657d187f38e7628c56970b70c0491
refs/heads/master
2022-06-05T21:32:00.953299
2016-12-01T06:52:35
2016-12-01T06:52:35
75,286,577
0
2
null
2022-05-20T20:47:53
2016-12-01T11:33:12
Java
UTF-8
Java
false
false
2,155
java
/* * Copyright (c) 2005-2012, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. 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.wso2.carbon.tomcat.ext.filter; import javax.servlet.*; import java.io.IOException; /*** * This is a filter class to force the java webapp to handle all requests and responses as UTF-8 encoded by default. * This requires that we define a character set filter. * This filter makes sure that if the browser hasn't set the encoding used in the request, that it's set to UTF-8. */ public class CharacterSetFilter implements Filter { private static final String UTF8 = "UTF-8"; private static final String CONTENT_TYPE = "text/html; charset=UTF-8"; private String encoding; @Override public void init(FilterConfig config) throws ServletException { encoding = config.getInitParameter("requestEncoding"); if (encoding == null) { encoding = UTF8; } } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { // Respect the client-specified character encoding // (see HTTP specification section 3.4.1) if (null == request.getCharacterEncoding()) { request.setCharacterEncoding(encoding); } /** * Set the default response content type and encoding */ response.setContentType(CONTENT_TYPE); response.setCharacterEncoding(UTF8); chain.doFilter(request, response); } @Override public void destroy() { } }
[ "eranda@wso2.com" ]
eranda@wso2.com
315d6aedfd69a40d5b79e53b48abc1f0f50cb90f
9c9067d9bfa19f052a433ec4111c97b686a6ac5e
/ch12/spring-java-config/src/main/java/jun/projavawebapp/config/RootContextConfiguration.java
a68390fe6c3a7f8b5212d9412b876bc70b7d229f
[ "MIT" ]
permissive
jdcsma/projavawebapp
c289123b59db4901a6d1760a9641c3117a357e73
50c596fb91fdc9e4c8b97b76557929fea2041bb6
refs/heads/master
2022-12-22T01:59:01.812147
2020-05-27T17:21:11
2020-05-27T17:21:11
185,805,881
0
0
MIT
2022-12-16T15:27:38
2019-05-09T13:36:51
Java
UTF-8
Java
false
false
419
java
package jun.projavawebapp.config; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.stereotype.Controller; @Configuration @ComponentScan(basePackages = {"jun.projavawebapp.site", "jun.projavawebapp.awarer"}, excludeFilters = {@ComponentScan.Filter(Controller.class)}) public class RootContextConfiguration { }
[ "jdcsma@163.com" ]
jdcsma@163.com
a0673fb05ae3d2d7a3ea4fe235d562084ad0b1df
08a6239e875c207367d4149a6b9978768d03c40a
/src/main/java/com/demo/shipapp/models/Ship.java
5f8632f028313c78607db1ec2a86fd45d3ed8955
[]
no_license
flowtheci/shipappdemo
bfc3e5b6e7256080b1d2521b64e870b0e1010854
7320f5459500ac3f2d9788dcb7dfc3d3ff7f9fbf
refs/heads/master
2023-05-19T15:22:11.343684
2021-06-11T19:24:55
2021-06-11T19:24:55
376,122,041
0
0
null
null
null
null
UTF-8
Java
false
false
1,404
java
package com.demo.shipapp.models; import groovy.transform.EqualsAndHashCode; import groovy.transform.ToString; import javax.persistence.*; @Entity public class Ship { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private int grossTonnage; private String shipType; private String iceClass; private String flagCountry; public Ship() {} public Ship(int grossTonnage, String shipType, String iceClass, String flagCountry){ this.grossTonnage = grossTonnage; this.shipType = shipType; this.iceClass = iceClass; this.flagCountry = flagCountry; } public Long getId(){ return id; } public int getGrossTonnage() { return grossTonnage; } public String getShipType() { return shipType; } public String getIceClass() { return iceClass; } public String getFlagCountry() { return flagCountry; } public void setId(Long id) { this.id = id; } public void setGrossTonnage(int grossTonnage) { this.grossTonnage = grossTonnage; } public void setShipType(String shipType) { this.shipType = shipType; } public void setIceClass(String iceClass) { this.iceClass = iceClass; } public void setFlagCountry(String flagCountry) { this.flagCountry = flagCountry; } }
[ "playsbykevin@gmail.com" ]
playsbykevin@gmail.com
c0f8c04d64893e9391df3e4c601bb2557d821027
e27ca5fe3e7f49a0e39a9cacec516e5b63fcae32
/src/com/clouds/www/QuickSort.java
1c8030a489cf23ae6c46c38684a761866b33c639
[]
no_license
yao23/Java_Playground
0cb49c98df5c3c149bdc174a2e27aac11b914d58
aa7496b9e55e30952075b47d82be01190166c0ad
refs/heads/master
2023-09-03T05:21:11.864445
2023-09-02T05:46:29
2023-09-02T05:46:29
92,258,959
3
1
null
null
null
null
UTF-8
Java
false
false
1,270
java
package com.clouds.www; /** * Stability: No relative partition position guaranteed * stability: No */ public class QuickSort { // time: average O(nlogn), worst O(n^2), space: O(1) private void doQuickSort(int[] arr, int start, int end) { if (start >= end) { return; } int partitionPos = partition(arr, start, end); doQuickSort(arr, start, partitionPos); doQuickSort(arr, partitionPos + 1, end); } private int partition(int[] arr, int left, int right) { int ran = left + (int)(Math.random() * (right - left + 1)); int pivot = arr[ran]; // switch pivot to the leftmost arr[ran] = arr[left]; arr[left] = pivot; while (left < right) { // find a smaller element from right while (left < right && arr[right] >= pivot) { right--; } // put to the left arr[left] = arr[right]; // find a larger element from left while (left < right && arr[left] <= pivot) { left++; } // put to the right arr[right] = arr[left]; } // put the pivot back arr[left] = pivot; return left; } }
[ "myspiritcrazy@gmail.com" ]
myspiritcrazy@gmail.com
9397defac63ca86988d474d720e1ed4696d323cb
ba6a8f0a9a2c2a524061ab353ab7a6626e1ecb1b
/src/main/java/com/learning/recipebook/controllers/ControllerExceptionHandler.java
1c75385d7bceac3aa89dcb3e753dc78f651ee7ef
[]
no_license
mehj123/Spring-recipe-book
c661e8156eab4f798d7f28ee4e1dcc2fd9a62256
7e84ce17769d9058566d2e90272a18ce0beee64b
refs/heads/master
2020-05-29T13:20:02.909903
2019-08-04T08:39:54
2019-08-04T08:39:54
189,157,832
0
0
null
null
null
null
UTF-8
Java
false
false
778
java
package com.learning.recipebook.controllers; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.servlet.ModelAndView; @Slf4j @ControllerAdvice public class ControllerExceptionHandler { @ResponseStatus(HttpStatus.BAD_REQUEST) @ExceptionHandler(NumberFormatException.class) public ModelAndView handleBadRequest(Exception e){ ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("400error"); modelAndView.addObject("exception", e); return modelAndView; } }
[ "mehjabeen.begum@outlook.com" ]
mehjabeen.begum@outlook.com
53e0557008421a395d548921b7b2555b9baea525
1adc22edc043702123b60680228e55d93b386d90
/src/tests/string/OneEditAwayTest.java
b689e58224bd1e7c0e8158d1a04a7cba4454a287
[]
no_license
astro-wolf/area51
50b0646697f69d614e2848806252d133b0ae6dc7
990ffd7252418bc7bed360c103a21cc89694a5a5
refs/heads/master
2023-05-04T08:03:49.272720
2021-05-28T02:02:19
2021-05-28T02:02:19
298,648,823
1
0
null
null
null
null
UTF-8
Java
false
false
960
java
package tests.string; import org.junit.jupiter.api.Test; import problems.string.OneEditAway; import static org.junit.jupiter.api.Assertions.*; class OneEditAwayTest { private OneEditAway oneEditAway; @Test void hugelyUnequalLengths() { oneEditAway = new OneEditAway(); assertFalse(oneEditAway.areOneAway("m", "masdfasf")); } @Test void equalButDifferent() { oneEditAway = new OneEditAway(); assertFalse(oneEditAway.areOneAway("asdf", "lkjh")); } @Test void gotOneWordSame() { oneEditAway = new OneEditAway(); assertFalse(oneEditAway.areOneAway("car", "bat")); } @Test void oneAwayEqualLengths() { oneEditAway = new OneEditAway(); assertTrue(oneEditAway.areOneAway("car", "cat")); } @Test void oneAwayUnequalLengths() { oneEditAway = new OneEditAway(); assertTrue(oneEditAway.areOneAway("pup", "pump")); } }
[ "vishwas.vishi.24@gmail.com" ]
vishwas.vishi.24@gmail.com
24dac2de7c50ba3563d7083ed565c17188b1117e
9839e5d8aee9d014ab7aada4a203379b947dd43f
/java/day0513/0000src/day0513/FileReaderEx1.java
1add6c32df4bc2c513f66bebfc1b8a670c524338
[]
no_license
Yooogh/Gongboo
a2acc589e90730d21dff9b60a8ef19dc7f9e3962
6838ec20fea81b0502c1642dee64607ff325011f
refs/heads/main
2023-08-04T04:25:32.140295
2021-09-10T01:00:06
2021-09-10T01:00:06
378,591,441
0
0
null
null
null
null
UHC
Java
false
false
593
java
package day0513; import java.io.*; public class FileReaderEx1 { public static void main(String[] args) { try { String fileName = "test.txt"; FileInputStream fis = new FileInputStream(fileName); FileReader fr = new FileReader(fileName); int data = 0; while((data=fis.read())!=-1) { System.out.print((char)data);//형변환 한 경우 } System.out.println(); fis.close(); while((data=fr.read())!=-1) { System.out.print(data);//형변환 안한 경우 } System.out.println(); fr.close(); }catch (IOException e) { e.printStackTrace(); } } }
[ "yoogh95@gmail.com" ]
yoogh95@gmail.com
1c5ad15a9d104687492be616c5f065b293f76249
8d4e9768693971b5c96512cded189295d9502316
/app/src/main/java/com/example/apporderfood/ThemLoaiThucDonActivity.java
01e38662946c047393935691fe3e12ca7b0ef67e
[]
no_license
M26644/AppOrderFood
f2179433e091d6100d3fe7d2c6534d91a8904f96
25df33d2efa145dfb04ac6167d4f8bd1c02f525b
refs/heads/master
2023-08-11T07:18:58.105079
2021-10-15T08:40:45
2021-10-15T08:40:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,549
java
package com.example.apporderfood; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; import com.example.apporderfood.DAO.LoaiMonAnDAO; public class ThemLoaiThucDonActivity extends AppCompatActivity implements View.OnClickListener { Button btnDongYThemLoaiThucDon; EditText edTenLoai; LoaiMonAnDAO loaiMonAnDAO; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout_themloaithucdon); loaiMonAnDAO = new LoaiMonAnDAO(this); btnDongYThemLoaiThucDon = (Button) findViewById(R.id.btnDongYThemLoaiThucDon); edTenLoai = (EditText) findViewById(R.id.edThemLoaiThucDon); btnDongYThemLoaiThucDon.setOnClickListener(this); } @Override public void onClick(View v) { String sTenLoaiThucDon = edTenLoai.getText().toString(); if(sTenLoaiThucDon != null || sTenLoaiThucDon.equals("")){ boolean kiemtra = loaiMonAnDAO.ThemLoaiMonAn(sTenLoaiThucDon); Intent iDuLieu = new Intent(); iDuLieu.putExtra("kiemtraloaithucdon",kiemtra); setResult(Activity.RESULT_OK,iDuLieu); finish(); }else{ Toast.makeText(this,getResources().getString(R.string.vuilongnhapdulieu),Toast.LENGTH_SHORT).show(); } } }
[ "89495096+M26644@users.noreply.github.com" ]
89495096+M26644@users.noreply.github.com
31c0c99c0e54b672ff842de19df37305edd8590f
afba8ff8767f5bd24b9faaf233f2c0ff4d984705
/src/main/java/DataBase.java
c73884478da440fd812128151fb1bb531bd9a526
[]
no_license
Baklysha9/WebJavaPractic
db1c199a98e5fa1f1de514c62cf54d61ab25253b
c7020f2de14db107afa0ac19726253f853c49fd5
refs/heads/master
2020-03-16T01:55:15.394154
2018-05-08T05:59:28
2018-05-08T05:59:28
132,452,142
0
0
null
null
null
null
UTF-8
Java
false
false
3,272
java
import org.sql2o.Connection; import org.sql2o.Sql2o; import java.util.List; public class DataBase { public void createTable() { Sql2o sql2o = new Sql2o("jdbc:postgresql://192.168.99.100:5432/vote", "admin", "admin"); String sql = "CREATE TABLE IF NOT EXISTS task (id int, title varchar(255), content varchar(255), status boolean)"; try (Connection con = sql2o.open()) { con.createQuery(sql).executeUpdate(); } } public List<Task> getAllTasks() { Sql2o sql2o = new Sql2o("jdbc:postgresql://192.168.99.100:5432/vote", "admin", "admin"); String sql = "SELECT * FROM task"; try (Connection con = sql2o.beginTransaction()) { return con.createQuery(sql).executeAndFetch(Task.class); } } public List<Task> fetchCustomers(int id) { Sql2o sql2o = new Sql2o("jdbc:postgresql://192.168.99.100:5432/vote", "admin", "admin"); try (Connection con = sql2o.beginTransaction()) { final String query = "SELECT id, title, content, status FROM task WHERE id = :id"; return con.createQuery(query) .addParameter("id",id) .executeAndFetch(Task.class); } } public void addTask(Task task) { Sql2o sql2o = new Sql2o("jdbc:postgresql://192.168.99.100:5432/vote", "admin", "admin"); final String insertQuery = "INSERT INTO task (id, title, content, status) " + "VALUES (:id, :title, :content, :status)"; try (Connection con = sql2o.open()) { con.createQuery(insertQuery) .addParameter("id", task.getId()) .addParameter("title", task.getTitle()) .addParameter("content", task.getContent()) .addParameter("status", task.isStatus()) .executeUpdate(); // Remember to call commit() when a transaction is opened, // default is to roll back. } } public void editTask(Task task) { Sql2o sql2o = new Sql2o("jdbc:postgresql://192.168.99.100:5432/vote", "admin", "admin"); final String insertQuery = "UPDATE task SET title = :title, content = :content, status = :status WHERE id = :id"; try (Connection con = sql2o.beginTransaction()) { con.createQuery(insertQuery) .addParameter("id", task.getId()) .addParameter("title", task.getTitle()) .addParameter("content", task.getContent()) .addParameter("status", task.isStatus()) .executeUpdate(); con.commit(); // Remember to call commit() when a transaction is opened, // default is to roll back. } } public void delete(int id) { Sql2o sql2o = new Sql2o("jdbc:postgresql://192.168.99.100:5432/vote", "admin", "admin"); try(Connection con = sql2o.open()) { String sql = "DELETE FROM task WHERE id = :id;"; con.createQuery(sql) .addParameter("id", id) .executeUpdate(); } } }
[ "bogdancoo@yandex.ru" ]
bogdancoo@yandex.ru
1adf60cd39ac97d09254881bce38fa2caef5eccd
d1778d4fa86dc2d645eade6b268bdcca96ac1c4c
/plugin-controller-api/src/main/java/com/windf/plugin/controller/api/configure/WebApiConfigure.java
719029ee226ce5b322636c5254ab7d0477f3456b
[]
no_license
windfChen/study.springcloud
15d0946b2a4f441f4c34d2b3b9937e84295586ca
f7037343cdfffeb50b77ef8e25cc785b243423dd
refs/heads/master
2022-12-20T12:39:15.698970
2020-01-19T01:19:24
2020-01-19T01:19:24
226,325,972
0
0
null
2022-12-10T05:53:54
2019-12-06T12:29:50
Java
UTF-8
Java
false
false
1,226
java
package com.windf.plugin.controller.api.configure; import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.support.config.FastJsonConfig; import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; import com.windf.core.Constant; import org.springframework.boot.autoconfigure.http.HttpMessageConverters; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.MediaType; import java.util.ArrayList; import java.util.List; @Configuration public class WebApiConfigure { @Bean public HttpMessageConverters fastJsonConfigure(){ FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter(); FastJsonConfig fastJsonConfig = new FastJsonConfig(); //处理中文乱码问题 List<MediaType> fastMediaTypes = new ArrayList<>(); fastMediaTypes.add(MediaType.APPLICATION_JSON); converter.setSupportedMediaTypes(fastMediaTypes); //日期格式化 fastJsonConfig.setDateFormat("yyyy-MM-dd HH:mm:ss"); converter.setFastJsonConfig(fastJsonConfig); return new HttpMessageConverters(converter); } }
[ "q3400p@sina.cn" ]
q3400p@sina.cn
347e2eedd3a6f0f3e78515a1e2dd39255d56a37e
358c053b91085e8d93a52d2ef24b994f63c3ffaf
/src/fynal/project/MainWindow.java
345bf236d4aee30c1f0f350c1fc53acdde8d2128
[]
no_license
DylanBarrios/Proyecto_Final
52b028481147a1551517a1303232521a5730a1c4
fdae84ff6507c1ce03799e6193ddbc0e05bdc0a0
refs/heads/master
2020-05-19T16:49:02.496929
2019-05-13T23:52:46
2019-05-13T23:52:46
185,114,105
0
0
null
null
null
null
UTF-8
Java
false
false
43,307
java
package fynal.project; import java.util.Random; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; /** *MainWindow * @author Usuario */ public class MainWindow extends javax.swing.JFrame { PlayersDialog pd; ReportsDialog rd; private Random ale = new Random(); ReportsDialog rp = new ReportsDialog(); private TypeField matrixField[][]; private JButton matrixBtt[][]; private int x,y,poInitX,poInitY; private int diceMov; DefaultTableModel dtm; TypeField posan; private String mensaje; public int anterior; /** * MainWindow */ public MainWindow() { pd = new PlayersDialog(); rd = new ReportsDialog(); this.setResizable(false); initComponents(); bttAddVehicles.setEnabled(false); } //Metodo qeu me envia el numero del archivo que haya elejido para jugar public void sacarTexto(){ tmp tm = new tmp(); System.out.println("El valor es "+tm.getTmp()); } /** * 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() { PanelBattle = new javax.swing.JPanel(); PanelButtons = new javax.swing.JPanel(); bttUP = new javax.swing.JButton(); BttLeft = new javax.swing.JButton(); bttRight = new javax.swing.JButton(); bttDown = new javax.swing.JButton(); ComboPlayer2 = new javax.swing.JComboBox(); ComboPlayer1 = new javax.swing.JComboBox(); diceMovementsGUI = new javax.swing.JLabel(); diceShotGUI = new javax.swing.JLabel(); diceWildcardGUI = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); Player1 = new javax.swing.JLabel(); Player2 = new javax.swing.JLabel(); bttAddVehicles = new javax.swing.JButton(); jLabel3 = new javax.swing.JLabel(); txt2 = new javax.swing.JLabel(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenu7 = new javax.swing.JMenu(); jMenu3 = new javax.swing.JMenu(); jMenuItem4 = new javax.swing.JMenuItem(); jMenuItem5 = new javax.swing.JMenuItem(); jMenu4 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); jMenuItem7 = new javax.swing.JMenuItem(); jMenu6 = new javax.swing.JMenu(); jMenuItem6 = new javax.swing.JMenuItem(); jMenuItem8 = new javax.swing.JMenuItem(); jMenuItem9 = new javax.swing.JMenuItem(); jMenuItem10 = new javax.swing.JMenuItem(); jMenuItem3 = new javax.swing.JMenuItem(); jMenu2 = new javax.swing.JMenu(); jMenuItem2 = new javax.swing.JMenuItem(); jMenuItem11 = new javax.swing.JMenuItem(); jMenuItem12 = new javax.swing.JMenuItem(); jMenuItem13 = new javax.swing.JMenuItem(); jMenu8 = new javax.swing.JMenu(); jMenuItem15 = new javax.swing.JMenuItem(); jMenuItem16 = new javax.swing.JMenuItem(); jMenuItem17 = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); PanelBattle.setBackground(new java.awt.Color(255, 255, 255)); javax.swing.GroupLayout PanelBattleLayout = new javax.swing.GroupLayout(PanelBattle); PanelBattle.setLayout(PanelBattleLayout); PanelBattleLayout.setHorizontalGroup( PanelBattleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 1023, Short.MAX_VALUE) ); PanelBattleLayout.setVerticalGroup( PanelBattleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE) ); PanelButtons.setBackground(new java.awt.Color(255, 255, 255)); bttUP.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/ArrowUP.png"))); // NOI18N bttUP.setBorder(null); bttUP.setContentAreaFilled(false); bttUP.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bttUPActionPerformed(evt); } }); BttLeft.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/ArrowLeft.png"))); // NOI18N BttLeft.setBorder(null); BttLeft.setContentAreaFilled(false); BttLeft.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { BttLeftActionPerformed(evt); } }); bttRight.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/ArrowRight.png"))); // NOI18N bttRight.setBorder(null); bttRight.setContentAreaFilled(false); bttRight.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bttRightActionPerformed(evt); } }); bttDown.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/ArrowDown.png"))); // NOI18N bttDown.setBorder(null); bttDown.setContentAreaFilled(false); bttDown.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bttDownActionPerformed(evt); } }); ComboPlayer2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Choose a vehicle" })); ComboPlayer1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Choose a Vehicle" })); ComboPlayer1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ComboPlayer1ActionPerformed(evt); } }); diceMovementsGUI.setFont(new java.awt.Font("Monotype Corsiva", 1, 48)); // NOI18N diceMovementsGUI.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); diceMovementsGUI.setText("DICE"); diceMovementsGUI.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); diceShotGUI.setFont(new java.awt.Font("Monotype Corsiva", 1, 48)); // NOI18N diceShotGUI.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); diceShotGUI.setText("DICE"); diceWildcardGUI.setFont(new java.awt.Font("Monotype Corsiva", 1, 48)); // NOI18N diceWildcardGUI.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); diceWildcardGUI.setText("DICE"); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 13)); // NOI18N jLabel1.setText("AMOUNT OF MOVEMENTS"); jLabel4.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel4.setText("shooting percentage"); jLabel2.setFont(new java.awt.Font("Monotype Corsiva", 1, 24)); // NOI18N jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel2.setText("MOVE"); jLabel2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jLabel5.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel5.setText("wildcard"); Player1.setText("Player 1"); Player2.setText("Player 2"); bttAddVehicles.setBackground(new java.awt.Color(0, 204, 204)); bttAddVehicles.setFont(new java.awt.Font("Tahoma", 1, 13)); // NOI18N bttAddVehicles.setForeground(new java.awt.Color(255, 255, 255)); bttAddVehicles.setText("Add Vehicles"); bttAddVehicles.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bttAddVehiclesActionPerformed(evt); } }); jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Rhombus_34545.png"))); // NOI18N txt2.setText("jLabel6"); javax.swing.GroupLayout PanelButtonsLayout = new javax.swing.GroupLayout(PanelButtons); PanelButtons.setLayout(PanelButtonsLayout); PanelButtonsLayout.setHorizontalGroup( PanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PanelButtonsLayout.createSequentialGroup() .addContainerGap() .addGroup(PanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PanelButtonsLayout.createSequentialGroup() .addComponent(Player1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Player2) .addGap(124, 124, 124)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PanelButtonsLayout.createSequentialGroup() .addGroup(PanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PanelButtonsLayout.createSequentialGroup() .addGap(10, 10, 10) .addComponent(bttAddVehicles)) .addComponent(diceWildcardGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(79, 79, 79)) .addGroup(PanelButtonsLayout.createSequentialGroup() .addComponent(txt2) .addGap(17, 17, 17) .addGroup(PanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PanelButtonsLayout.createSequentialGroup() .addComponent(ComboPlayer1, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(ComboPlayer2, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) .addGroup(PanelButtonsLayout.createSequentialGroup() .addGap(94, 94, 94) .addGroup(PanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(PanelButtonsLayout.createSequentialGroup() .addGap(10, 10, 10) .addComponent(bttUP, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PanelButtonsLayout.createSequentialGroup() .addGap(0, 33, Short.MAX_VALUE) .addGroup(PanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PanelButtonsLayout.createSequentialGroup() .addGroup(PanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(diceMovementsGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(diceShotGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(86, 86, 86)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PanelButtonsLayout.createSequentialGroup() .addComponent(jLabel4) .addGap(105, 105, 105)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PanelButtonsLayout.createSequentialGroup() .addGroup(PanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(PanelButtonsLayout.createSequentialGroup() .addComponent(BttLeft, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(27, 27, 27) .addComponent(jLabel3) .addGap(18, 18, 18) .addComponent(bttRight, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(54, 54, 54)))))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PanelButtonsLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(bttDown, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(145, 145, 145)) ); PanelButtonsLayout.setVerticalGroup( PanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PanelButtonsLayout.createSequentialGroup() .addContainerGap() .addGroup(PanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txt2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(bttUP, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(PanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(BttLeft) .addComponent(bttRight) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(bttDown, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(2, 2, 2) .addComponent(diceMovementsGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(diceShotGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(diceWildcardGUI, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(bttAddVehicles) .addGap(17, 17, 17) .addGroup(PanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(Player1) .addComponent(Player2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(PanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ComboPlayer1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ComboPlayer2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(25, 25, 25)) ); jMenu1.setText("BattleField"); jMenu7.setText("New Game"); jMenu3.setText("4 X 4 "); jMenu3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenu3ActionPerformed(evt); } }); jMenuItem4.setText("Player vs Computer"); jMenuItem4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem4ActionPerformed(evt); } }); jMenu3.add(jMenuItem4); jMenuItem5.setText("Player vs Player"); jMenuItem5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem5ActionPerformed(evt); } }); jMenu3.add(jMenuItem5); jMenu7.add(jMenu3); jMenu4.setText("6 X 4"); jMenuItem1.setText("Player vs Computer"); jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); jMenu4.add(jMenuItem1); jMenuItem7.setText("Player vs Player"); jMenuItem7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem7ActionPerformed(evt); } }); jMenu4.add(jMenuItem7); jMenu7.add(jMenu4); jMenu6.setText("8 X 9"); jMenuItem6.setText("Player vs Computer"); jMenuItem6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem6ActionPerformed(evt); } }); jMenu6.add(jMenuItem6); jMenuItem8.setText("Player vs Player"); jMenuItem8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem8ActionPerformed(evt); } }); jMenu6.add(jMenuItem8); jMenu7.add(jMenu6); jMenu1.add(jMenu7); jMenuItem9.setText("Load Game"); jMenuItem9.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem9ActionPerformed(evt); } }); jMenu1.add(jMenuItem9); jMenuItem10.setText("Save Game"); jMenu1.add(jMenuItem10); jMenuItem3.setText("Clear"); jMenuItem3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem3ActionPerformed(evt); } }); jMenu1.add(jMenuItem3); jMenuBar1.add(jMenu1); jMenu2.setText("Reports"); jMenuItem2.setText("Vehicles reports"); jMenuItem2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem2ActionPerformed(evt); } }); jMenu2.add(jMenuItem2); jMenuItem11.setText("Battle Reports"); jMenuItem11.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem11ActionPerformed(evt); } }); jMenu2.add(jMenuItem11); jMenuItem12.setText("Best Vehicle"); jMenu2.add(jMenuItem12); jMenuItem13.setText("Worst Vehicle"); jMenuItem13.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem13ActionPerformed(evt); } }); jMenu2.add(jMenuItem13); jMenuBar1.add(jMenu2); jMenu8.setText("More Optiones"); jMenuItem15.setText("Shop Store"); jMenuItem15.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem15ActionPerformed(evt); } }); jMenu8.add(jMenuItem15); jMenuItem16.setText("Create Vehicles"); jMenuItem16.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem16ActionPerformed(evt); } }); jMenu8.add(jMenuItem16); jMenuItem17.setText("Create Weapons"); jMenu8.add(jMenuItem17); jMenuBar1.add(jMenu8); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(21, 21, 21) .addComponent(PanelBattle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(PanelButtons, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(5, 5, 5)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(PanelButtons, javax.swing.GroupLayout.PREFERRED_SIZE, 947, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(PanelBattle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void bttUPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bttUPActionPerformed mensaje = ComboPlayer1.getSelectedItem().toString(); clear(); movements(); shot(); diceWildcardGUI.setText("NOT"); poInitY-=diceMov; if(poInitY<0){ poInitY+=diceMov; addPanel(); JOptionPane.showMessageDialog(rootPane,"Out of Matrix"); } else if( mensaje.equals("War Tank")&&(matrixField[poInitX][poInitY] instanceof Lake || matrixField[poInitX][poInitY] instanceof Enemies)){ poInitY+=diceMov; addPanel(); JOptionPane.showMessageDialog(rootPane, "A tank can not be on the water or on an enemy"); } else if( mensaje.equals("War Plane")&&(matrixField[poInitX][poInitY] instanceof Mountain || matrixField[poInitX][poInitY] instanceof Enemies)){ poInitY+=diceMov; addPanel(); JOptionPane.showMessageDialog(rootPane, "A Plane can not be on the Mountains or on an enemy"); }else{ poInitY+=diceMov; //Me imprime donde estaba antes matrixField[poInitX][poInitY] = posan; poInitY-=diceMov; //Me guarda el nuevo campo posan = matrixField[poInitX][poInitY]; //Me configura el nuevo lugar matrixField[poInitX][poInitY] = pd.one; addPanel(); } }//GEN-LAST:event_bttUPActionPerformed private void ComboPlayer1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ComboPlayer1ActionPerformed }//GEN-LAST:event_ComboPlayer1ActionPerformed /** * Introduzco el numero de archivo sleccionado para cargar juego * a una varibale qeu esta en otra clase */ private void set(){ tmp tm = new tmp(); txt2.setText(tm.getTmp()); } private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed pd.TextFieldP2.setEnabled(false); pd.TextFieldP1.setText(null); pd.TextFieldP2.setText(null); clear(); pd.setVisible(true); newBattliedfield4(); bttAddVehicles.setEnabled(true); ComboPlayer1.removeAllItems(); ComboPlayer1.addItem("Choose a Vehicle"); }//GEN-LAST:event_jMenuItem4ActionPerformed private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed pd.TextFieldP2.setEnabled(true); pd.TextFieldP1.setText(null); pd.TextFieldP2.setText(null); clear(); pd.setVisible(true); newBattliedfield4(); bttAddVehicles.setEnabled(true); ComboPlayer1.removeAllItems(); ComboPlayer1.addItem("Choose a Vehicle"); }//GEN-LAST:event_jMenuItem5ActionPerformed private void jMenu3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu3ActionPerformed }//GEN-LAST:event_jMenu3ActionPerformed private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed pd.TextFieldP2.setEnabled(false); pd.TextFieldP1.setText(null); pd.TextFieldP2.setText(null); clear(); pd.setVisible(true); newBattliedfield6(); bttAddVehicles.setEnabled(true); ComboPlayer1.removeAllItems(); ComboPlayer1.addItem("Choose a Vehicle"); }//GEN-LAST:event_jMenuItem1ActionPerformed private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed pd.TextFieldP2.setEnabled(true); pd.TextFieldP1.setText(null); pd.TextFieldP2.setText(null); clear(); pd.setVisible(true); newBattliedfield6(); bttAddVehicles.setEnabled(true); ComboPlayer1.removeAllItems(); ComboPlayer1.addItem("Choose a Vehicle"); }//GEN-LAST:event_jMenuItem7ActionPerformed private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed pd.TextFieldP2.setEnabled(false); pd.TextFieldP1.setText(null); pd.TextFieldP2.setText(null); clear(); pd.setVisible(true); newBattliedfield8(); bttAddVehicles.setEnabled(true); ComboPlayer1.removeAllItems(); ComboPlayer1.addItem("Choose a Vehicle"); }//GEN-LAST:event_jMenuItem6ActionPerformed private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed pd.TextFieldP2.setEnabled(true); pd.TextFieldP1.setText(null); pd.TextFieldP2.setText(null); clear(); pd.setVisible(true); newBattliedfield8(); bttAddVehicles.setEnabled(true); ComboPlayer1.removeAllItems(); ComboPlayer1.addItem("Choose a Vehicle"); }//GEN-LAST:event_jMenuItem8ActionPerformed private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed clear(); }//GEN-LAST:event_jMenuItem3ActionPerformed private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed rd.setVisible(true); }//GEN-LAST:event_jMenuItem2ActionPerformed private void jMenuItem11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem11ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jMenuItem11ActionPerformed private void jMenuItem13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem13ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jMenuItem13ActionPerformed private void bttAddVehiclesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bttAddVehiclesActionPerformed addVehicles(); bttAddVehicles.setEnabled(false); }//GEN-LAST:event_bttAddVehiclesActionPerformed private void bttRightActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bttRightActionPerformed mensaje = ComboPlayer1.getSelectedItem().toString(); clear(); movements(); shot(); diceWildcardGUI.setText("NOT"); poInitX+=diceMov; if(poInitX>(x-1)){ poInitX-=diceMov; addPanel(); JOptionPane.showMessageDialog(rootPane, "Out of Matrix"); } else if( mensaje.equals("War Tank")&&(matrixField[poInitX][poInitY] instanceof Lake || matrixField[poInitX][poInitY] instanceof Enemies)){ poInitX-=diceMov; addPanel(); JOptionPane.showMessageDialog(rootPane, "A tank can not be on the water or on an enemy"); } else if( mensaje.equals("War Plane")&&(matrixField[poInitX][poInitY] instanceof Mountain || matrixField[poInitX][poInitY] instanceof Enemies)){ poInitX-=diceMov; addPanel(); JOptionPane.showMessageDialog(rootPane, "A Plane can not be on the Mountains or on an enemy"); }else{ poInitX-=diceMov; //Me imprime donde estaba antes matrixField[poInitX][poInitY] = posan; poInitX+=diceMov; //Me guarda el nuevo campo posan = matrixField[poInitX][poInitY]; //Me configura el nuevo lugar matrixField[poInitX][poInitY] = pd.one; addPanel(); } }//GEN-LAST:event_bttRightActionPerformed private void BttLeftActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BttLeftActionPerformed mensaje = ComboPlayer1.getSelectedItem().toString(); clear(); movements(); shot(); diceWildcardGUI.setText("NOT"); poInitX-=diceMov; if(poInitX<0){ poInitX+=diceMov; addPanel(); JOptionPane.showMessageDialog(rootPane, "Out of Matrix"); } else if( mensaje.equals("War Tank")&&(matrixField[poInitX][poInitY] instanceof Lake || matrixField[poInitX][poInitY] instanceof Enemies)){ poInitX+=diceMov; addPanel(); JOptionPane.showMessageDialog(rootPane, "A tank can not be on the water or on an enemy"); } else if( mensaje.equals("War Plane")&&(matrixField[poInitX][poInitY] instanceof Mountain || matrixField[poInitX][poInitY] instanceof Enemies)){ poInitX+=diceMov; addPanel(); JOptionPane.showMessageDialog(rootPane, "A Plane can not be on the Mountains or on an enemy"); }else{ poInitX+=diceMov; //Me imprime donde estaba antes matrixField[poInitX][poInitY] = posan; poInitX-=diceMov; //Me guarda el nuevo campo posan = matrixField[poInitX][poInitY]; //Me configura el nuevo lugar matrixField[poInitX][poInitY] = pd.one; addPanel(); } }//GEN-LAST:event_BttLeftActionPerformed private void bttDownActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bttDownActionPerformed mensaje = ComboPlayer1.getSelectedItem().toString(); clear(); movements(); shot(); diceWildcardGUI.setText("NOT"); poInitY+=diceMov; if(poInitY>(y-1)){ poInitY-=diceMov; addPanel(); JOptionPane.showMessageDialog(rootPane, "Out of Matrix"); } else if( mensaje.equals("War Tank")&&(matrixField[poInitX][poInitY] instanceof Lake || matrixField[poInitX][poInitY] instanceof Enemies)){ poInitY-=diceMov; addPanel(); JOptionPane.showMessageDialog(rootPane, "A tank can not be on the water or on an enemy"); } else if( mensaje.equals("War Plane")&&(matrixField[poInitX][poInitY] instanceof Mountain || matrixField[poInitX][poInitY] instanceof Enemies)){ poInitY-=diceMov; addPanel(); JOptionPane.showMessageDialog(rootPane, "A Plane can not be on the Mountains or on an enemy"); }else{ poInitY-=diceMov; //Me imprime donde estaba antes matrixField[poInitX][poInitY] = posan; poInitY+=diceMov; //Me guarda el nuevo campo posan = matrixField[poInitX][poInitY]; //Me configura el nuevo lugar matrixField[poInitX][poInitY] = pd.one; addPanel(); } }//GEN-LAST:event_bttDownActionPerformed private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed bttAddVehicles.setEnabled(true); rd.setVisible(true); }//GEN-LAST:event_jMenuItem9ActionPerformed private void jMenuItem15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem15ActionPerformed ShopStore_ ss = new ShopStore_(); ss.setVisible(true); }//GEN-LAST:event_jMenuItem15ActionPerformed private void jMenuItem16ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem16ActionPerformed CreateVehicles cv = new CreateVehicles(); cv.setVisible(true); }//GEN-LAST:event_jMenuItem16ActionPerformed /** *Me limpia todo lo que tenga en matriz del juego */ public void clear(){ for (int i = 0; i < x; i++) { for (int j = 0; j < y; j++) { PanelBattle.remove(matrixBtt[i][j]); } } repaint(); } /** *Metodos que me serviran para indicar tamaño a mis matrices */ private void newBattliedfield4() { battliedfield(4, 4); } private void newBattliedfield6() { battliedfield(6, 4); } private void newBattliedfield8() { battliedfield(9, 8); } /** *Metodo que resive el tamaño de la matriz que desee * @param x * @param y */ private void battliedfield(int x, int y){ this.x = x; this.y = y; matrixField = new TypeField[x][y]; matrixBtt = new JButton[x][y]; createMatrix(); } /** *Me genera una matriz de instancias qeu me serviran para comparar al momento * de estar jugando */ private void createMatrix(){ int instances = 0; for (int i = 0; i < x; i++) { for (int j = 0; j < y; j++) { instances = ale.nextInt(3); switch(instances){ case 0: matrixField[i][j] = new Grass(); break; case 1: matrixField[i][j] = new Mountain(); break; case 2: matrixField[i][j] = new Lake(); break; } } } for (int i = 0; i < x; i++) { for (int j = 0; j < 2; j++) { instances = ale.nextInt(5); switch(instances){ case 0: break; case 1: matrixField[i][j] = new Enemies(); break; case 2: break; case 3: matrixField[i][j] = new Enemies(); break; case 4: break; } } } poInitX=0; poInitY=3; posan = matrixField[poInitX][poInitY]; matrixField[poInitX][poInitY] = pd.one; addPanel(); } /** *Metodo que me va a poner imagenes dependeindo de la instancia qeu tengan */ private void addPanel() { mensaje = ComboPlayer1.getSelectedItem().toString(); for (int i = 0; i < x; i++) { for (int j = 0; j < y; j++) { matrixBtt[i][j] = new JButton(); matrixBtt[i][j].setSize(100, 100); matrixBtt[i][j].setLocation(i*110, j*110); if(matrixField[i][j] instanceof Grass) matrixBtt[i][j].setIcon(new ImageIcon("src/Imagenes/Grass.jpg")); else if(matrixField[i][j] instanceof Mountain) matrixBtt[i][j].setIcon(new ImageIcon("src/Imagenes/Mountain.jpg")); else if(matrixField[i][j] instanceof Lake) matrixBtt[i][j].setIcon(new ImageIcon("src/Imagenes/Lake.jpg")); else if(matrixField[i][j] instanceof Vehicles&&mensaje.equals("War Plane")) matrixBtt[poInitX][poInitY].setIcon(new ImageIcon("src/Imagenes/plane.jpg")); else if(matrixField[i][j] instanceof Vehicles&&mensaje.equals("War Tank")) matrixBtt[poInitX][poInitY].setIcon(new ImageIcon("src/Imagenes/tank.jpg")); else if(matrixField[i][j] instanceof Enemies) matrixBtt[i][j].setIcon(new ImageIcon("src/Imagenes/Enemy.jpg")); else matrixBtt[poInitX][poInitY].setIcon(new ImageIcon("src/Imagenes/plane.jpg")); matrixBtt[i][j].setVisible(true); PanelBattle.add(matrixBtt[i][j]); } } } /** *Me genera el dado para moverme */ private void movements() { diceMov = (int) (Math.random() * 3)+1; String textMovs = Integer.toString(diceMov); diceMovementsGUI.setText(textMovs); } /** *Me genera el dado para la precision al disparar */ private void shot(){ int diceShot; diceShot = (int) (Math.random() * 100) + 1; String textShot = Integer.toString(diceShot); diceShotGUI.setText(textShot+"%"); } /** *AGrega los vehiculos al combo box de jugar */ public void addVehicles(){ ComboPlayer1.addItem(pd.vehicle1); ComboPlayer1.addItem(pd.vehicle2); ComboPlayer1.addItem(pd.vehicle3); ComboPlayer2.addItem(pd.vehicle4); ComboPlayer2.addItem(pd.vehicle5); ComboPlayer2.addItem(pd.vehicle6); } public void prueba(){ // tmp t = new tmp(); // System.out.println(t.getTmp()); // String tmpo = Integer.toString(t.getTmp()); // System.out.println(tmpo); // File URL = new File(pd.ubicacion+pd.registros[0].getName()); // try { // FileInputStream fis = new FileInputStream(URL); // rp.mostrar.load(fis); // pd.vehicle1 = rp.mostrar.getProperty("TipoVehiculo1"); // System.out.println("Ella tiene"+pd.vehicle1); // pd.vehicle2 = rp.mostrar.getProperty("TipoVehiculo2"); // System.out.println("Ella tiene"+pd.vehicle2); // pd.vehicle3 = rp.mostrar.getProperty("TipoVehiculo3"); // System.out.println("Ella tiene"+pd.vehicle3); // } // catch(Exception e){System.out.println("Fallo"+e);} } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton BttLeft; public javax.swing.JComboBox ComboPlayer1; public javax.swing.JComboBox ComboPlayer2; private javax.swing.JPanel PanelBattle; private javax.swing.JPanel PanelButtons; public javax.swing.JLabel Player1; public javax.swing.JLabel Player2; public javax.swing.JButton bttAddVehicles; private javax.swing.JButton bttDown; private javax.swing.JButton bttRight; private javax.swing.JButton bttUP; private javax.swing.JLabel diceMovementsGUI; private javax.swing.JLabel diceShotGUI; private javax.swing.JLabel diceWildcardGUI; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JMenu jMenu1; private javax.swing.JMenu jMenu2; private javax.swing.JMenu jMenu3; private javax.swing.JMenu jMenu4; private javax.swing.JMenu jMenu6; private javax.swing.JMenu jMenu7; private javax.swing.JMenu jMenu8; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JMenuItem jMenuItem1; private javax.swing.JMenuItem jMenuItem10; private javax.swing.JMenuItem jMenuItem11; private javax.swing.JMenuItem jMenuItem12; private javax.swing.JMenuItem jMenuItem13; private javax.swing.JMenuItem jMenuItem15; private javax.swing.JMenuItem jMenuItem16; private javax.swing.JMenuItem jMenuItem17; private javax.swing.JMenuItem jMenuItem2; private javax.swing.JMenuItem jMenuItem3; private javax.swing.JMenuItem jMenuItem4; private javax.swing.JMenuItem jMenuItem5; private javax.swing.JMenuItem jMenuItem6; private javax.swing.JMenuItem jMenuItem7; private javax.swing.JMenuItem jMenuItem8; private javax.swing.JMenuItem jMenuItem9; public javax.swing.JLabel txt2; // End of variables declaration//GEN-END:variables }
[ "48546058+DylanBarrios@users.noreply.github.com" ]
48546058+DylanBarrios@users.noreply.github.com
7bf65af5bd7f41f2c964432c2f3cf0ec246c13da
38f8944b4a80f38d158a075d4c1e96b09345763b
/version-1/src/com/hive/Mode/HiveSearch.java
4d2dcd11d8ac8f5f3f3f97102ff6d54bc2b3df59
[]
no_license
Glacier759/MyHive
bf2982d2da0a80d9d7e42a0d86985e7bc6c6c91f
13272ad5f5c546524b424ac18ab7c5dc3ddf8bb4
refs/heads/master
2021-01-20T09:01:06.085528
2014-08-02T09:49:07
2014-08-02T09:49:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,532
java
package com.hive.Mode; import java.io.IOException; import java.net.SocketTimeoutException; import java.net.URL; import java.util.Iterator; import java.util.Set; import org.jsoup.HttpStatusException; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import com.hive.Parameter.HiveParameter; import com.hive.Save.HiveSaveData; import com.hive.SearchEngine.ThreeSixZeroSpider; public class HiveSearch { private HiveParameter hiveParameter = null; public HiveSearch( HiveParameter hiveParameter ) { this.hiveParameter = hiveParameter; } public void doSaveData() { try { //添加搜索引擎 ThreeSixZeroSpider Spider360 = new ThreeSixZeroSpider( hiveParameter ); Set<String> UrlSet = Spider360.doParse360(); System.out.println(UrlSet.size()); Iterator<String> itr = UrlSet.iterator(); int NO = UrlSet.size(); while( itr.hasNext() ) { String purl = itr.next(); System.out.println("剩余:"+NO+"\t"+purl); String Hostname = new URL(purl).getHost(); NO--; Document Doc = null; try { Doc = Jsoup.connect(purl).timeout(5000) .userAgent("Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36") .get(); } catch( SocketTimeoutException e ) { System.out.println("HiveSearch-doSaveData-42:\t" + e); continue; } catch( HttpStatusException e ) { System.out.println("HiveSearch-doSaveData-45:\t" + e); continue; } catch( Exception e ) { System.out.println(e); } //hiveParameter.hiveDatabase.insertUrl(purl); new HiveSaveData(hiveParameter).doSaveToDB(Doc.title(), purl, Doc.select("p").text(), hiveParameter.config.getSavePath()+hiveParameter.Ttag, true); Elements pageAllUrls = Doc.select("a[href]"); for ( Element pageAllUrl : pageAllUrls ) { String pageUrl = pageAllUrl.attr("abs:href"); if ( pageUrl.isEmpty() ) continue; String hostname = new URL(pageUrl).getHost(); //if ( (hostname.equals(Hostname) && !(hiveParameter.hiveDatabase.isUniqueURL(pageUrl))) ) { if ( (hostname.equals(Hostname)) && !(hiveParameter.hiveBloomFilter.isUniqueValue(pageUrl)) ) { //System.out.println("push redis" + hiveParameter.hiveRedis.getKey()); hiveParameter.hiveRedis.pushValue(pageUrl); //hiveParameter.hiveDatabase.insertUrl(pageUrl); //抓取后再加入数据库才对 } } } } catch( Exception e ) { System.out.println(e); } } }
[ "OurHom.759@gmail.com" ]
OurHom.759@gmail.com
3467f43258b9ef2dc7a57dd4dddb94302fef04b5
e108f887c811d995eff5e8a0606e3d94ec57c95c
/InhertitancePractice/src/com/mikesimagination/Driver.java
62d495b435b9c1bae04f3cdcceb733660eae319d
[]
no_license
michaelgarza496/My_Personal_Repo_Practice
a177d40ea81d9321995f650c19af2c846dbf5463
a649dfec5ab0b375a2973952c64b014796a90698
refs/heads/master
2021-01-19T16:21:14.230573
2017-10-07T21:09:11
2017-10-07T21:09:11
101,003,214
0
0
null
null
null
null
UTF-8
Java
false
false
1,365
java
package com.mikesimagination; public class Driver { { System.out.println("Just a block in the Driver class"); } public static void main(String[] args) { { System.out.println("Just a block in the main method"); } new Driver(); /* * Don't need to cast if it's a subtype * * Doesn't matter the reference. Whatever the object is, that's the method that's going to print */ C c = new C(); System.out.println("int a = " + c.a); System.out.println(c); B b = c; System.out.println("int a = " + b.a); System.out.println(b); A a = c; System.out.println("int a = " + a.a); System.out.println(a); b = (B) a; System.out.println("int a = " + b.a); System.out.println(b); /* * Can't cast a parent object to subclass on the second block */ a = b = c = null; a = new A(); System.out.println("int a = " + a.a); System.out.println(a); b = (B) a; System.out.println("int a = " + b.a); System.out.println(b); } static{ System.out.println("A static block"); } } class A{ int a = 0; @Override public String toString() { return "Inside Class A"; } } class B extends A{ int a = 1; @Override public String toString() { return "Inside Class B"; } } class C extends B{ int a = 2; @Override public String toString() { return "Inside Class C"; } }
[ "michaelgarza496@gmail.com" ]
michaelgarza496@gmail.com
070300fa7de278d8cf9fe2181b121dfc14a52300
2c6e2ba03eb71ca45fe690ff6e4586f6e2fa0f17
/material/apks/banco/sources/com/google/common/util/concurrent/ListenableScheduledFuture.java
56d0983b3e3d91eb52a5c3ac377f4a3f694cf885
[]
no_license
lcrcastor/curso-mobile-2019
3088a196139b3e980ed6e09797a0bbf5efb6440b
7585fccb6437a17c841772c1d9fb0701d6c68042
refs/heads/master
2023-04-06T21:46:32.333236
2020-10-30T19:47:54
2020-10-30T19:47:54
308,680,747
0
1
null
2023-03-26T06:57:57
2020-10-30T16:08:31
Java
UTF-8
Java
false
false
308
java
package com.google.common.util.concurrent; import com.google.common.annotations.Beta; import com.google.common.annotations.GwtIncompatible; import java.util.concurrent.ScheduledFuture; @GwtIncompatible @Beta public interface ListenableScheduledFuture<V> extends ListenableFuture<V>, ScheduledFuture<V> { }
[ "luis@MARK-2.local" ]
luis@MARK-2.local
137f9cdc43bd5b56a54b64db5782dde5148a9b12
70ab4ad77435fbd0c893a4487c21b2bd232b8b1d
/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/device/dao/DeviceFlowDAO.java
24a0b44d2a2b8ad7efd5b10a82918ff77ced1ae7
[ "Apache-2.0" ]
permissive
janakamarasena/identity-inbound-auth-oauth-clone
47d5dd05f10b66fc72ce8e0e14fcec7cb7607ad2
cb6115d55c7256811934715c0f2d200e4cff2fb0
refs/heads/master
2022-12-20T02:48:35.448565
2020-10-24T18:49:48
2020-10-24T18:49:48
306,883,487
0
1
Apache-2.0
2020-10-24T19:33:54
2020-10-24T12:55:32
Java
UTF-8
Java
false
false
5,789
java
/* * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. 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.wso2.carbon.identity.oauth2.device.dao; import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser; import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception; import org.wso2.carbon.identity.oauth2.device.model.DeviceFlowDO; import java.sql.Timestamp; /** * New set of DAO classes for each purpose and factory class to get instance of each DAO classes were introduced * during this step. */ public interface DeviceFlowDAO { /** * This will be used to enter the value to the database tables. * * @param deviceCode Code that is used to identify the device. * @param userCode Code that is used to correlate user and device. * @param consumerKey Consumer key of the client application. * @param expiresIn Device code valid period. * @param interval Polling interval. * @param scopes Requested scopes. * @throws IdentityOAuth2Exception Error while inserting device flow parameters. */ void insertDeviceFlowParameters(String deviceCode, String userCode, String consumerKey, Long expiresIn, int interval, String scopes) throws IdentityOAuth2Exception; /** * Get the client id that has involved with user code. * * @param userCode Code that is used to correlate user and device. * @return client_id * @throws IdentityOAuth2Exception Error while getting client id for user code. */ String getClientIdByUserCode(String userCode) throws IdentityOAuth2Exception; /** * Set the status of the user code and device code. * * @param userCode Code that is used to correlate user and device. * @param status Status of the device and user codes. * @throws IdentityOAuth2Exception Error while setting authentication status. */ void setAuthenticationStatus(String userCode, String status) throws IdentityOAuth2Exception; /** * Get the authentication status for device code. * * @param deviceCode Code that is used to identify the device. * @return Map of values. * @throws IdentityOAuth2Exception Error while getting authentication details. */ DeviceFlowDO getAuthenticationDetails(String deviceCode) throws IdentityOAuth2Exception; /** * Check client id is exist or not. * * @param clientId Consumer key of the application. * @return Exist or not. * @throws IdentityOAuth2Exception Error while checking client id exist. */ boolean checkClientIdExist(String clientId) throws IdentityOAuth2Exception; /** * Get the status of the user code. * * @param userCode Code that is used to correlate user and device. * @return status * @throws IdentityOAuth2Exception Error while getting status for user code. */ String getStatusForUserCode(String userCode) throws IdentityOAuth2Exception; /** * Set last poll time of the token request. * * @param deviceCode Code that is used to identify the device. * @param newPollTime Last poll time. * @throws IdentityOAuth2Exception Error while setting last poll time. */ void setLastPollTime(String deviceCode, Timestamp newPollTime) throws IdentityOAuth2Exception; /** * Set authenticated user. * * @param userCode Code that is used to correlate user and device. * @param status Status of the device code. * @param authzUser Authenticated user. * @throws IdentityOAuth2Exception Error while setting authenticated user and status. */ void setAuthzUserAndStatus(String userCode, String status, AuthenticatedUser authzUser) throws IdentityOAuth2Exception; /** * Set device code as expired. * * @param deviceCode Code that is used to identify the device. * @param status Status of the device code. * @throws IdentityOAuth2Exception Error while setting device code as expired. */ void setDeviceCodeExpired(String deviceCode, String status) throws IdentityOAuth2Exception; /** * Set callback uri of the service provider. * * @param clientId Consumer key of service provide. * @param callBackUri Callback uri of the service provider. * @throws IdentityOAuth2Exception Error while Setting callback uri. */ void setCallbackURI(String clientId, String callBackUri) throws IdentityOAuth2Exception; /** * Return scope array for user code. * * @param userCode Code that is used to correlate user and device. * @return Array of scopes. * @throws IdentityOAuth2Exception Error while getting scopes for user code. */ String[] getScopesForUserCode(String userCode) throws IdentityOAuth2Exception; /** * Return scope array for device code. * * @param deviceCode Code that is used to identify the device. * @return Array of scopes. * @throws IdentityOAuth2Exception Error while getting scopes for device code. */ String[] getScopesForDeviceCode(String deviceCode) throws IdentityOAuth2Exception; }
[ "janakamarasena@gmail.com" ]
janakamarasena@gmail.com
27c606c59a2abddfb1e99bd63e5a87a1ce079698
709d61a802585b3097f5ddb70a5ea9e2e99c3b8d
/src/main/java/Customer.java
485ef5e3fba8acbf133db192e6f5c0b9c27e3a40
[]
no_license
Harry29-exe/hibernate1
9031b22c30c99edc1399c5a6f62058a40cf6c7b2
d98e957af2320a87c74154eb1ecc366f42a1f97c
refs/heads/master
2022-12-08T20:46:17.980518
2020-08-31T13:12:17
2020-08-31T13:12:17
291,718,998
0
0
null
null
null
null
UTF-8
Java
false
false
872
java
import javax.persistence.*; import java.io.Serializable; @Entity @Table(name = "customer") public class Customer implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long customerId = 1; @Column(name = "firstName", nullable = false) private String firstName; @Column(name = "lastName", nullable = false) private String lastName; public long getCustomerId() { return customerId; } public void setCustomerId(long customerId) { this.customerId = customerId; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } }
[ "wojcikakamil@gmail.com" ]
wojcikakamil@gmail.com
076be54d304b4b4700979f94a53b7a1c38900028
1af1cfbaab4829584ec012ff637999f3ae3de017
/DoctorCar/app/src/main/java/com/doctorcar/mobile/view/layout/OverScrollView.java
17cc494c2ca9199ab730fb2338ce130b36c5b401
[]
no_license
ldqsxsl/DoctorCar
8681e3e1415320eb3143fb2da6b23c74417fba43
fd00b2471c11ca2697976ff561ac82612e34dfc9
refs/heads/master
2020-06-11T09:54:05.372717
2017-06-19T09:47:50
2017-06-19T09:47:50
75,686,236
0
0
null
null
null
null
UTF-8
Java
false
false
45,749
java
package com.doctorcar.mobile.view.layout; /* * Copyright (C) 2006 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import android.content.Context; import android.graphics.Rect; import android.util.AttributeSet; import android.util.DisplayMetrics; import android.view.FocusFinder; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.VelocityTracker; import android.view.View; import android.view.ViewConfiguration; import android.view.ViewGroup; import android.view.ViewParent; import android.view.animation.AnimationUtils; import android.view.animation.OvershootInterpolator; import android.widget.FrameLayout; import android.widget.Scroller; import android.view.View.OnTouchListener; import java.lang.reflect.Field; import java.util.List; /** * Layout container for a view hierarchy that can be scrolled by the user, * allowing it to be larger than the physical display. A ScrollView is a * {@link FrameLayout}, meaning you should place one child in it containing the * entire contents to scroll; this child may itself be a layout manager with a * complex hierarchy of objects. A child that is often used is a * {@link } in a vertical orientation, presenting a vertical array * of top-level items that the user can scroll through. * * <p> * The {@link } class also takes care of its own scrolling, so does not * require a ScrollView, but using the two together is possible to achieve the * effect of a text view within a larger container. * * <p> * ScrollView only supports vertical scrolling. */ public class OverScrollView extends FrameLayout implements OnTouchListener { static final int ANIMATED_SCROLL_GAP = 250; static final float MAX_SCROLL_FACTOR = 0.5f; static final float OVERSHOOT_TENSION = 0.75f; private long mLastScroll; private final Rect mTempRect = new Rect(); private Scroller mScroller; protected Context mContext; Field mScrollYField; Field mScrollXField; boolean hasFailedObtainingScrollFields; int prevScrollY; boolean isInFlingMode = false; DisplayMetrics metrics; LayoutInflater inflater; protected View child; private Runnable overScrollerSpringbackTask; /** * Flag to indicate that we are moving focus ourselves. This is so the code * that watches for focus changes initiated outside this ScrollView knows * that it does not have to do anything. */ private boolean mScrollViewMovedFocus; /** * Position of the last motion event. */ private float mLastMotionY; /** * True when the layout has changed but the traversal has not come through * yet. Ideally the view hierarchy would keep track of this for us. */ private boolean mIsLayoutDirty = true; /** * The child to give focus to in the event that a child has requested focus * while the layout is dirty. This prevents the scroll from being wrong if * the child has not been laid out before requesting focus. */ private View mChildToScrollTo = null; /** * True if the user is currently dragging this ScrollView around. This is * not the same as 'is being flinged', which can be checked by * mScroller.isFinished() (flinging begins when the user lifts his finger). */ private boolean mIsBeingDragged = false; /** * Determines speed during touch scrolling */ private VelocityTracker mVelocityTracker; /** * When set to true, the scroll view measure its child to make it fill the * currently visible area. */ private boolean mFillViewport; /** * Whether arrow scrolling is animated. */ private boolean mSmoothScrollingEnabled = true; private int mTouchSlop; private int mMinimumVelocity; private int mMaximumVelocity; /** * ID of the active pointer. This is used to retain consistency during * drags/flings if multiple pointers are used. */ private int mActivePointerId = INVALID_POINTER; /** * Sentinel value for no current active pointer. Used by * {@link #mActivePointerId}. */ private static final int INVALID_POINTER = -1; public OverScrollView(Context context) { this(context, null); } public OverScrollView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public OverScrollView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mContext = context; initScrollView(); setFillViewport(true); initBounce(); } private void initBounce() { metrics = this.mContext.getResources().getDisplayMetrics(); // init the bouncy scroller, and make sure the layout is being drawn // after the top padding mScroller = new Scroller(getContext(), new OvershootInterpolator(OVERSHOOT_TENSION)); overScrollerSpringbackTask = new Runnable() { @Override public void run() { // scroll till after the padding mScroller.computeScrollOffset(); scrollTo(0, mScroller.getCurrY()); if (!mScroller.isFinished()) { post(this); } } }; prevScrollY = getPaddingTop(); try { mScrollXField = View.class.getDeclaredField("mScrollX"); mScrollYField = View.class.getDeclaredField("mScrollY"); } catch (Exception e) { hasFailedObtainingScrollFields = true; } } private void SetScrollY(int value) { if (mScrollYField != null) { try { mScrollYField.setInt(this, value); } catch (Exception e) { } } } private void SetScrollX(int value) { if (mScrollXField != null) { try { mScrollXField.setInt(this, value); } catch (Exception e) { } } } public void initChildPointer() { child = getChildAt(0); child.setPadding(0, 1500, 0, 1500); } @Override protected float getTopFadingEdgeStrength() { if (getChildCount() == 0) { return 0.0f; } final int length = getVerticalFadingEdgeLength(); if (getScrollY() < length) { return getScrollY() / (float) length; } return 1.0f; } @Override protected float getBottomFadingEdgeStrength() { if (getChildCount() == 0) { return 0.0f; } final int length = getVerticalFadingEdgeLength(); final int bottomEdge = getHeight() - getPaddingBottom(); final int span = getChildAt(0).getBottom() - getScrollY() - bottomEdge; if (span < length) { return span / (float) length; } return 1.0f; } /** * @return The maximum amount this scroll view will scroll in response to an * arrow event. */ public int getMaxScrollAmount() { return (int) (MAX_SCROLL_FACTOR * (getBottom() - getTop())); } private void initScrollView() { mScroller = new Scroller(getContext()); setFocusable(true); setDescendantFocusability(FOCUS_AFTER_DESCENDANTS); setWillNotDraw(false); final ViewConfiguration configuration = ViewConfiguration.get(mContext); mTouchSlop = configuration.getScaledTouchSlop(); mMinimumVelocity = configuration.getScaledMinimumFlingVelocity(); mMaximumVelocity = configuration.getScaledMaximumFlingVelocity(); setOnTouchListener(this); post(new Runnable() { public void run() { scrollTo(0, child.getPaddingTop()); } }); } @Override public void addView(View child) { if (getChildCount() > 0) { throw new IllegalStateException("ScrollView can host only one direct child"); } super.addView(child); initChildPointer(); } @Override public void addView(View child, int index) { if (getChildCount() > 0) { throw new IllegalStateException("ScrollView can host only one direct child"); } super.addView(child, index); initChildPointer(); } @Override public void addView(View child, ViewGroup.LayoutParams params) { if (getChildCount() > 0) { throw new IllegalStateException("ScrollView can host only one direct child"); } super.addView(child, params); initChildPointer(); } @Override public void addView(View child, int index, ViewGroup.LayoutParams params) { if (getChildCount() > 0) { throw new IllegalStateException("ScrollView can host only one direct child"); } super.addView(child, index, params); } /** * @return Returns true this ScrollView can be scrolled */ private boolean canScroll() { View child = getChildAt(0); if (child != null) { int childHeight = child.getHeight(); return getHeight() < childHeight + getPaddingTop() + getPaddingBottom(); } return false; } /** * Indicates whether this ScrollView's content is stretched to fill the * viewport. * * @return True if the content fills the viewport, false otherwise. */ public boolean isFillViewport() { return mFillViewport; } /** * Indicates this ScrollView whether it should stretch its content height to * fill the viewport or not. * * @param fillViewport * True to stretch the content's height to the viewport's * boundaries, false otherwise. */ public void setFillViewport(boolean fillViewport) { if (fillViewport != mFillViewport) { mFillViewport = fillViewport; requestLayout(); } } /** * @return Whether arrow scrolling will animate its transition. */ public boolean isSmoothScrollingEnabled() { return mSmoothScrollingEnabled; } /** * Set whether arrow scrolling will animate its transition. * * @param smoothScrollingEnabled * whether arrow scrolling will animate its transition */ public void setSmoothScrollingEnabled(boolean smoothScrollingEnabled) { mSmoothScrollingEnabled = smoothScrollingEnabled; } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); if (!mFillViewport) { return; } final int heightMode = MeasureSpec.getMode(heightMeasureSpec); if (heightMode == MeasureSpec.UNSPECIFIED) { return; } if (getChildCount() > 0) { final View child = getChildAt(0); int height = getMeasuredHeight(); if (child.getMeasuredHeight() < height) { final LayoutParams lp = (LayoutParams) child.getLayoutParams(); int childWidthMeasureSpec = getChildMeasureSpec(widthMeasureSpec, getPaddingLeft() + getPaddingRight(), lp.width); height -= getPaddingTop(); height -= getPaddingBottom(); int childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY); child.measure(childWidthMeasureSpec, childHeightMeasureSpec); } } } @Override public boolean dispatchKeyEvent(KeyEvent event) { // Let the focused view and/or our descendants get the key first return super.dispatchKeyEvent(event) || executeKeyEvent(event); } /** * You can call this function yourself to have the scroll view perform * scrolling from a key event, just as if the event had been dispatched to * it by the view hierarchy. * * @param event * The key event to execute. * @return Return true if the event was handled, else false. */ public boolean executeKeyEvent(KeyEvent event) { mTempRect.setEmpty(); if (!canScroll()) { if (isFocused() && event.getKeyCode() != KeyEvent.KEYCODE_BACK) { View currentFocused = findFocus(); if (currentFocused == this) currentFocused = null; View nextFocused = FocusFinder.getInstance().findNextFocus(this, currentFocused, View.FOCUS_DOWN); return nextFocused != null && nextFocused != this && nextFocused.requestFocus(View.FOCUS_DOWN); } return false; } boolean handled = false; if (event.getAction() == KeyEvent.ACTION_DOWN) { switch (event.getKeyCode()) { case KeyEvent.KEYCODE_DPAD_UP: if (!event.isAltPressed()) { handled = arrowScroll(View.FOCUS_UP); } else { handled = fullScroll(View.FOCUS_UP); } break; case KeyEvent.KEYCODE_DPAD_DOWN: if (!event.isAltPressed()) { handled = arrowScroll(View.FOCUS_DOWN); } else { handled = fullScroll(View.FOCUS_DOWN); } break; case KeyEvent.KEYCODE_SPACE: pageScroll(event.isShiftPressed() ? View.FOCUS_UP : View.FOCUS_DOWN); break; } } return handled; } public boolean inChild(int x, int y) { if (getChildCount() > 0) { final int scrollY = getScrollY(); final View child = getChildAt(0); return !(y < child.getTop() - scrollY || y >= child.getBottom() - scrollY || x < child.getLeft() || x >= child.getRight()); } return false; } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { /* * This method JUST determines whether we want to intercept the motion. * If we return true, onMotionEvent will be called and we do the actual * scrolling there. */ /* * Shortcut the most recurring case: the user is in the dragging state * and he is moving his finger. We want to intercept this motion. */ final int action = ev.getAction(); if ((action == MotionEvent.ACTION_MOVE) && (mIsBeingDragged)) { return true; } switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_MOVE: { /* * mIsBeingDragged == false, otherwise the shortcut would have * caught it. Check whether the user has moved far enough from his * original down touch. */ /* * Locally do absolute value. mLastMotionY is set to the y value of * the down event. */ final int activePointerId = mActivePointerId; if (activePointerId == INVALID_POINTER) { // If we don't have a valid id, the touch down wasn't on // content. break; } final int pointerIndex = ev.findPointerIndex(activePointerId); final float y = ev.getY(pointerIndex); final int yDiff = (int) Math.abs(y - mLastMotionY); if (yDiff > mTouchSlop) { mIsBeingDragged = true; mLastMotionY = y; } break; } case MotionEvent.ACTION_DOWN: { final float y = ev.getY(); if (!inChild((int) ev.getX(), (int) y)) { mIsBeingDragged = false; break; } /* * Remember location of down touch. ACTION_DOWN always refers to * pointer index 0. */ mLastMotionY = y; mActivePointerId = ev.getPointerId(0); /* * If being flinged and user touches the screen, initiate drag; * otherwise don't. mScroller.isFinished should be false when being * flinged. */ mIsBeingDragged = !mScroller.isFinished(); break; } case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_UP: /* Release the drag */ mIsBeingDragged = false; mActivePointerId = INVALID_POINTER; break; case MotionEvent.ACTION_POINTER_UP: onSecondaryPointerUp(ev); break; } /* * The only time we want to intercept motion events is if we are in the * drag mode. */ return mIsBeingDragged; } @Override public boolean onTouchEvent(MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_DOWN && ev.getEdgeFlags() != 0) { // Don't handle edge touches immediately -- they may actually belong // to one of our // descendants. return false; } if (mVelocityTracker == null) { mVelocityTracker = VelocityTracker.obtain(); } mVelocityTracker.addMovement(ev); final int action = ev.getAction(); switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: { final float y = ev.getY(); if (!(mIsBeingDragged = inChild((int) ev.getX(), (int) y))) { return false; } /* * If being flinged and user touches, stop the fling. isFinished * will be false if being flinged. */ if (!mScroller.isFinished()) { mScroller.abortAnimation(); } // Remember where the motion event started mLastMotionY = y; mActivePointerId = ev.getPointerId(0); break; } case MotionEvent.ACTION_MOVE: if (mIsBeingDragged) { // Scroll to follow the motion event final int activePointerIndex = ev.findPointerIndex(mActivePointerId); final float y = ev.getY(activePointerIndex); final int deltaY = (int) (mLastMotionY - y); mLastMotionY = y; if (isOverScrolled()) { // when overscrolling, move the scroller just half of the // finger movement, to make it feel like a spring... scrollBy(0, deltaY / 2); } else { scrollBy(0, deltaY); } } break; case MotionEvent.ACTION_UP: if (mIsBeingDragged) { final VelocityTracker velocityTracker = mVelocityTracker; velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity); int initialVelocity = (int) velocityTracker.getYVelocity(mActivePointerId); if (getChildCount() > 0 && Math.abs(initialVelocity) > mMinimumVelocity) { fling(-initialVelocity); } mActivePointerId = INVALID_POINTER; mIsBeingDragged = false; if (mVelocityTracker != null) { mVelocityTracker.recycle(); mVelocityTracker = null; } } break; case MotionEvent.ACTION_CANCEL: if (mIsBeingDragged && getChildCount() > 0) { mActivePointerId = INVALID_POINTER; mIsBeingDragged = false; if (mVelocityTracker != null) { mVelocityTracker.recycle(); mVelocityTracker = null; } } break; case MotionEvent.ACTION_POINTER_UP: onSecondaryPointerUp(ev); break; } return true; } public boolean isOverScrolled() { return (getScrollY() < child.getPaddingTop() || getScrollY() > child.getBottom() - child.getPaddingBottom() - getHeight()); } private void onSecondaryPointerUp(MotionEvent ev) { final int pointerIndex = (ev.getAction() & MotionEvent.ACTION_POINTER_INDEX_MASK) >> MotionEvent.ACTION_POINTER_INDEX_SHIFT; final int pointerId = ev.getPointerId(pointerIndex); if (pointerId == mActivePointerId) { // This was our active pointer going up. Choose a new // active pointer and adjust accordingly. // TODO: Make this decision more intelligent. final int newPointerIndex = pointerIndex == 0 ? 1 : 0; mLastMotionY = ev.getY(newPointerIndex); mActivePointerId = ev.getPointerId(newPointerIndex); if (mVelocityTracker != null) { mVelocityTracker.clear(); } } } /** * <p> * Finds the next focusable component that fits in this View's bounds * (excluding fading edges) pretending that this View's top is located at * the parameter top. * </p> * * @param topFocus * look for a candidate is the one at the top of the bounds if * topFocus is true, or at the bottom of the bounds if topFocus * is false * @param top * the top offset of the bounds in which a focusable must be * found (the fading edge is assumed to start at this position) * @param preferredFocusable * the View that has highest priority and will be returned if it * is within my bounds (null is valid) * @return the next focusable component in the bounds or null if none can be * found */ private View findFocusableViewInMyBounds(final boolean topFocus, final int top, View preferredFocusable) { /* * The fading edge's transparent side should be considered for focus * since it's mostly visible, so we divide the actual fading edge length * by 2. */ final int fadingEdgeLength = getVerticalFadingEdgeLength() / 2; final int topWithoutFadingEdge = top + fadingEdgeLength; final int bottomWithoutFadingEdge = top + getHeight() - fadingEdgeLength; if ((preferredFocusable != null) && (preferredFocusable.getTop() < bottomWithoutFadingEdge) && (preferredFocusable.getBottom() > topWithoutFadingEdge)) { return preferredFocusable; } return findFocusableViewInBounds(topFocus, topWithoutFadingEdge, bottomWithoutFadingEdge); } /** * <p> * Finds the next focusable component that fits in the specified bounds. * </p> * * @param topFocus * look for a candidate is the one at the top of the bounds if * topFocus is true, or at the bottom of the bounds if topFocus * is false * @param top * the top offset of the bounds in which a focusable must be * found * @param bottom * the bottom offset of the bounds in which a focusable must be * found * @return the next focusable component in the bounds or null if none can be * found */ private View findFocusableViewInBounds(boolean topFocus, int top, int bottom) { List<View> focusables = getFocusables(View.FOCUS_FORWARD); View focusCandidate = null; /* * A fully contained focusable is one where its top is below the bound's * top, and its bottom is above the bound's bottom. A partially * contained focusable is one where some part of it is within the * bounds, but it also has some part that is not within bounds. A fully * contained focusable is preferred to a partially contained focusable. */ boolean foundFullyContainedFocusable = false; int count = focusables.size(); for (int i = 0; i < count; i++) { View view = focusables.get(i); int viewTop = view.getTop(); int viewBottom = view.getBottom(); if (top < viewBottom && viewTop < bottom) { /* * the focusable is in the target area, it is a candidate for * focusing */ final boolean viewIsFullyContained = (top < viewTop) && (viewBottom < bottom); if (focusCandidate == null) { /* No candidate, take this one */ focusCandidate = view; foundFullyContainedFocusable = viewIsFullyContained; } else { final boolean viewIsCloserToBoundary = (topFocus && viewTop < focusCandidate.getTop()) || (!topFocus && viewBottom > focusCandidate.getBottom()); if (foundFullyContainedFocusable) { if (viewIsFullyContained && viewIsCloserToBoundary) { /* * We're dealing with only fully contained views, so * it has to be closer to the boundary to beat our * candidate */ focusCandidate = view; } } else { if (viewIsFullyContained) { /* * Any fully contained view beats a partially * contained view */ focusCandidate = view; foundFullyContainedFocusable = true; } else if (viewIsCloserToBoundary) { /* * Partially contained view beats another partially * contained view if it's closer */ focusCandidate = view; } } } } } return focusCandidate; } /** * <p> * Handles scrolling in response to a "page up/down" shortcut press. This * method will scroll the view by one page up or down and give the focus to * the topmost/bottommost component in the new visible area. If no component * is a good candidate for focus, this scrollview reclaims the focus. * </p> * * @param direction * the scroll direction: {@link View#FOCUS_UP} to go * one page up or {@link View#FOCUS_DOWN} to go one * page down * @return true if the key event is consumed by this method, false otherwise */ public boolean pageScroll(int direction) { boolean down = direction == View.FOCUS_DOWN; int height = getHeight(); if (down) { mTempRect.top = getScrollY() + height; int count = getChildCount(); if (count > 0) { View view = getChildAt(count - 1); if (mTempRect.top + height > view.getBottom()) { mTempRect.top = view.getBottom() - height; } } } else { mTempRect.top = getScrollY() - height; if (mTempRect.top < 0) { mTempRect.top = 0; } } mTempRect.bottom = mTempRect.top + height; return scrollAndFocus(direction, mTempRect.top, mTempRect.bottom); } /** * <p> * Handles scrolling in response to a "home/end" shortcut press. This method * will scroll the view to the top or bottom and give the focus to the * topmost/bottommost component in the new visible area. If no component is * a good candidate for focus, this scrollview reclaims the focus. * </p> * * @param direction * the scroll direction: {@link View#FOCUS_UP} to go * the top of the view or {@link View#FOCUS_DOWN} to * go the bottom * @return true if the key event is consumed by this method, false otherwise */ public boolean fullScroll(int direction) { boolean down = direction == View.FOCUS_DOWN; int height = getHeight(); mTempRect.top = 0; mTempRect.bottom = height; if (down) { int count = getChildCount(); if (count > 0) { View view = getChildAt(count - 1); mTempRect.bottom = view.getBottom(); mTempRect.top = mTempRect.bottom - height; } } return scrollAndFocus(direction, mTempRect.top, mTempRect.bottom); } /** * <p> * Scrolls the view to make the area defined by <code>top</code> and * <code>bottom</code> visible. This method attempts to give the focus to a * component visible in this area. If no component can be focused in the new * visible area, the focus is reclaimed by this scrollview. * </p> * * @param direction * the scroll direction: {@link View#FOCUS_UP} to go * upward {@link View#FOCUS_DOWN} to downward * @param top * the top offset of the new area to be made visible * @param bottom * the bottom offset of the new area to be made visible * @return true if the key event is consumed by this method, false otherwise */ private boolean scrollAndFocus(int direction, int top, int bottom) { boolean handled = true; int height = getHeight(); int containerTop = getScrollY(); int containerBottom = containerTop + height; boolean up = direction == View.FOCUS_UP; View newFocused = findFocusableViewInBounds(up, top, bottom); if (newFocused == null) { newFocused = this; } if (top >= containerTop && bottom <= containerBottom) { handled = false; } else { int delta = up ? (top - containerTop) : (bottom - containerBottom); doScrollY(delta); } if (newFocused != findFocus() && newFocused.requestFocus(direction)) { mScrollViewMovedFocus = true; mScrollViewMovedFocus = false; } return handled; } /** * Handle scrolling in response to an up or down arrow click. * * @param direction * The direction corresponding to the arrow key that was pressed * @return True if we consumed the event, false otherwise */ public boolean arrowScroll(int direction) { View currentFocused = findFocus(); if (currentFocused == this) currentFocused = null; View nextFocused = FocusFinder.getInstance().findNextFocus(this, currentFocused, direction); final int maxJump = getMaxScrollAmount(); if (nextFocused != null && isWithinDeltaOfScreen(nextFocused, maxJump, getHeight())) { nextFocused.getDrawingRect(mTempRect); offsetDescendantRectToMyCoords(nextFocused, mTempRect); int scrollDelta = computeScrollDeltaToGetChildRectOnScreen(mTempRect); doScrollY(scrollDelta); nextFocused.requestFocus(direction); } else { // no new focus int scrollDelta = maxJump; if (direction == View.FOCUS_UP && getScrollY() < scrollDelta) { scrollDelta = getScrollY(); } else if (direction == View.FOCUS_DOWN) { if (getChildCount() > 0) { int daBottom = getChildAt(0).getBottom(); int screenBottom = getScrollY() + getHeight(); if (daBottom - screenBottom < maxJump) { scrollDelta = daBottom - screenBottom; } } } if (scrollDelta == 0) { return false; } doScrollY(direction == View.FOCUS_DOWN ? scrollDelta : -scrollDelta); } if (currentFocused != null && currentFocused.isFocused() && isOffScreen(currentFocused)) { // previously focused item still has focus and is off screen, give // it up (take it back to ourselves) // (also, need to temporarily force FOCUS_BEFORE_DESCENDANTS so we // are // sure to // get it) final int descendantFocusability = getDescendantFocusability(); // save setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS); requestFocus(); setDescendantFocusability(descendantFocusability); // restore } return true; } /** * @return whether the descendant of this scroll view is scrolled off * screen. */ private boolean isOffScreen(View descendant) { return !isWithinDeltaOfScreen(descendant, 0, getHeight()); } /** * @return whether the descendant of this scroll view is within delta pixels * of being on the screen. */ private boolean isWithinDeltaOfScreen(View descendant, int delta, int height) { descendant.getDrawingRect(mTempRect); offsetDescendantRectToMyCoords(descendant, mTempRect); return (mTempRect.bottom + delta) >= getScrollY() && (mTempRect.top - delta) <= (getScrollY() + height); } /** * Smooth scroll by a Y delta * * @param delta * the number of pixels to scroll by on the Y axis */ private void doScrollY(int delta) { if (delta != 0) { if (mSmoothScrollingEnabled) { smoothScrollBy(0, delta); } else { scrollBy(0, delta); } } } /** * Like {@link View#scrollBy}, but scroll smoothly instead of immediately. * * @param dx * the number of pixels to scroll by on the X axis * @param dy * the number of pixels to scroll by on the Y axis */ public final void smoothScrollBy(int dx, int dy) { if (getChildCount() == 0) { // Nothing to do. return; } long duration = AnimationUtils.currentAnimationTimeMillis() - mLastScroll; if (duration > ANIMATED_SCROLL_GAP) { final int height = getHeight() - getPaddingBottom() - getPaddingTop(); final int bottom = getChildAt(0).getHeight(); final int maxY = Math.max(0, bottom - height); final int scrollY = getScrollY(); dy = Math.max(0, Math.min(scrollY + dy, maxY)) - scrollY; mScroller.startScroll(getScrollX(), scrollY, 0, dy); invalidate(); } else { if (!mScroller.isFinished()) { mScroller.abortAnimation(); } scrollBy(dx, dy); } mLastScroll = AnimationUtils.currentAnimationTimeMillis(); } public final void smoothScrollToTop() { smoothScrollTo(0, child.getPaddingTop()); } public final void smoothScrollToBottom() { smoothScrollTo(0, child.getHeight() - child.getPaddingTop() - getHeight()); } /** * Like {@link #scrollTo}, but scroll smoothly instead of immediately. * * @param x * the position where to scroll on the X axis * @param y * the position where to scroll on the Y axis */ public final void smoothScrollTo(int x, int y) { smoothScrollBy(x - getScrollX(), y - getScrollY()); } /** * <p> * The scroll range of a scroll view is the overall height of all of its * children. * </p> */ @Override protected int computeVerticalScrollRange() { final int count = getChildCount(); final int contentHeight = getHeight() - getPaddingBottom() - getPaddingTop(); if (count == 0) { return contentHeight; } return getChildAt(0).getBottom(); } @Override protected int computeVerticalScrollOffset() { return Math.max(0, super.computeVerticalScrollOffset()); } @Override protected void measureChild(View child, int parentWidthMeasureSpec, int parentHeightMeasureSpec) { ViewGroup.LayoutParams lp = child.getLayoutParams(); int childWidthMeasureSpec; int childHeightMeasureSpec; childWidthMeasureSpec = getChildMeasureSpec(parentWidthMeasureSpec, getPaddingLeft() + getPaddingRight(), lp.width); childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); child.measure(childWidthMeasureSpec, childHeightMeasureSpec); } @Override protected void measureChildWithMargins(View child, int parentWidthMeasureSpec, int widthUsed, int parentHeightMeasureSpec, int heightUsed) { final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams(); final int childWidthMeasureSpec = getChildMeasureSpec(parentWidthMeasureSpec, getPaddingLeft() + getPaddingRight() + lp.leftMargin + lp.rightMargin + widthUsed, lp.width); final int childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(lp.topMargin + lp.bottomMargin, MeasureSpec.UNSPECIFIED); child.measure(childWidthMeasureSpec, childHeightMeasureSpec); } @Override public void computeScroll() { // If android implementation has changed and we cannot obtain mScrollY - // The default behavior will be applied by the parent. if (hasFailedObtainingScrollFields) { super.computeScroll(); return; } if (mScroller.computeScrollOffset()) { // This is called at drawing time by ViewGroup. We don't want to // re-show the scrollbars at this point, which scrollTo will do, // so we replicate most of scrollTo here. // // It's a little odd to call onScrollChanged from inside the // drawing. // // It is, except when you remember that computeScroll() is used to // animate scrolling. So unless we want to defer the // onScrollChanged() // until the end of the animated scrolling, we don't really have a // choice here. // // I agree. The alternative, which I think would be worse, is to // post // something and tell the subclasses later. This is bad because // there // will be a window where getScrollX()/Y is different from what the // app // thinks it is. // int oldX = getScrollX(); int oldY = getScrollY(); int x = mScroller.getCurrX(); int y = mScroller.getCurrY(); if (getChildCount() > 0) { View child = getChildAt(0); x = clamp(x, getWidth() - getPaddingRight() - getPaddingLeft(), child.getWidth()); y = clamp(y, getHeight() - getPaddingBottom() - getPaddingTop(), child.getHeight()); if (x != oldX || y != oldY) { SetScrollX(x); // mScrollX = x; SetScrollY(y); // mScrollY = y; onScrollChanged(x, y, oldX, oldY); } } awakenScrollBars(); // Keep on drawing until the animation has finished. postInvalidate(); } } /** * Scrolls the view to the given child. * * @param child * the View to scroll to */ private void scrollToChild(View child) { child.getDrawingRect(mTempRect); /* Offset from child's local coordinates to ScrollView coordinates */ offsetDescendantRectToMyCoords(child, mTempRect); int scrollDelta = computeScrollDeltaToGetChildRectOnScreen(mTempRect); if (scrollDelta != 0) { scrollBy(0, scrollDelta); } } /** * If rect is off screen, scroll just enough to get it (or at least the * first screen size chunk of it) on screen. * * @param rect * The rectangle. * @param immediate * True to scroll immediately without animation * @return true if scrolling was performed */ private boolean scrollToChildRect(Rect rect, boolean immediate) { final int delta = computeScrollDeltaToGetChildRectOnScreen(rect); final boolean scroll = delta != 0; if (scroll) { if (immediate) { scrollBy(0, delta); } else { smoothScrollBy(0, delta); } } return scroll; } /** * Compute the amount to scroll in the Y direction in order to get a * rectangle completely on the screen (or, if taller than the screen, at * least the first screen size chunk of it). * * @param rect * The rect. * @return The scroll delta. */ protected int computeScrollDeltaToGetChildRectOnScreen(Rect rect) { if (getChildCount() == 0) return 0; int height = getHeight(); int screenTop = getScrollY(); int screenBottom = screenTop + height; int fadingEdge = getVerticalFadingEdgeLength(); // leave room for top fading edge as long as rect isn't at very top if (rect.top > 0) { screenTop += fadingEdge; } // leave room for bottom fading edge as long as rect isn't at very // bottom if (rect.bottom < getChildAt(0).getHeight()) { screenBottom -= fadingEdge; } int scrollYDelta = 0; if (rect.bottom > screenBottom && rect.top > screenTop) { // need to move down to get it in view: move down just enough so // that the entire rectangle is in view (or at least the first // screen size chunk). if (rect.height() > height) { // just enough to get screen size chunk on scrollYDelta += (rect.top - screenTop); } else { // get entire rect at bottom of screen scrollYDelta += (rect.bottom - screenBottom); } // make sure we aren't scrolling beyond the end of our content int bottom = getChildAt(0).getBottom(); int distanceToBottom = bottom - screenBottom; scrollYDelta = Math.min(scrollYDelta, distanceToBottom); } else if (rect.top < screenTop && rect.bottom < screenBottom) { // need to move up to get it in view: move up just enough so that // entire rectangle is in view (or at least the first screen // size chunk of it). if (rect.height() > height) { // screen size chunk scrollYDelta -= (screenBottom - rect.bottom); } else { // entire rect at top scrollYDelta -= (screenTop - rect.top); } // make sure we aren't scrolling any further than the top our // content scrollYDelta = Math.max(scrollYDelta, -getScrollY()); } return scrollYDelta; } @Override public void requestChildFocus(View child, View focused) { if (!mScrollViewMovedFocus) { if (!mIsLayoutDirty) { scrollToChild(focused); } else { // The child may not be laid out yet, we can't compute the // scroll yet mChildToScrollTo = focused; } } super.requestChildFocus(child, focused); } /** * When looking for focus in children of a scroll view, need to be a little * more careful not to give focus to something that is scrolled off screen. * * This is more expensive than the default {@link ViewGroup} * implementation, otherwise this behavior might have been made the default. */ @Override protected boolean onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect) { // convert from forward / backward notation to up / down / left / right // (ugh). if (direction == View.FOCUS_FORWARD) { direction = View.FOCUS_DOWN; } else if (direction == View.FOCUS_BACKWARD) { direction = View.FOCUS_UP; } final View nextFocus = previouslyFocusedRect == null ? FocusFinder.getInstance().findNextFocus(this, null, direction) : FocusFinder .getInstance().findNextFocusFromRect(this, previouslyFocusedRect, direction); if (nextFocus == null) { return false; } if (isOffScreen(nextFocus)) { return false; } return nextFocus.requestFocus(direction, previouslyFocusedRect); } @Override public boolean requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate) { // offset into coordinate space of this scroll view rectangle.offset(child.getLeft() - child.getScrollX(), child.getTop() - child.getScrollY()); return scrollToChildRect(rectangle, immediate); } @Override public void requestLayout() { mIsLayoutDirty = true; super.requestLayout(); } @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); mIsLayoutDirty = false; // Give a child focus if it needs it if (mChildToScrollTo != null && isViewDescendantOf(mChildToScrollTo, this)) { scrollToChild(mChildToScrollTo); } mChildToScrollTo = null; // Calling this with the present values causes it to re-clam them scrollTo(getScrollX(), getScrollY()); } @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); View currentFocused = findFocus(); if (null == currentFocused || this == currentFocused) return; // If the currently-focused view was visible on the screen when the // screen was at the old height, then scroll the screen to make that // view visible with the new screen height. if (isWithinDeltaOfScreen(currentFocused, 0, oldh)) { currentFocused.getDrawingRect(mTempRect); offsetDescendantRectToMyCoords(currentFocused, mTempRect); int scrollDelta = computeScrollDeltaToGetChildRectOnScreen(mTempRect); doScrollY(scrollDelta); } } @Override protected void onScrollChanged(int leftOfVisibleView, int topOfVisibleView, int oldLeftOfVisibleView, int oldTopOfVisibleView) { int displayHeight = getHeight(); int paddingTop = child.getPaddingTop(); int contentBottom = child.getHeight() - child.getPaddingBottom(); if (isInFlingMode) { if (topOfVisibleView < paddingTop || topOfVisibleView > contentBottom - displayHeight) { if (topOfVisibleView < paddingTop) { mScroller.startScroll(0, topOfVisibleView, 0, paddingTop - topOfVisibleView, 1000); } else if (topOfVisibleView > contentBottom - displayHeight) { mScroller.startScroll(0, topOfVisibleView, 0, contentBottom - displayHeight - topOfVisibleView, 1000); } // Start animation. post(overScrollerSpringbackTask); isInFlingMode = false; return; } } super.onScrollChanged(leftOfVisibleView, topOfVisibleView, oldLeftOfVisibleView, oldTopOfVisibleView); } /** * Return true if child is an descendant of parent, (or equal to the * parent). */ private boolean isViewDescendantOf(View child, View parent) { if (child == parent) { return true; } final ViewParent theParent = child.getParent(); return (theParent instanceof ViewGroup) && isViewDescendantOf((View) theParent, parent); } /** * Fling the scroll view * * @param velocityY * The initial velocity in the Y direction. Positive numbers mean * that the finger/cursor is moving down the screen, which means * we want to scroll towards the top. */ public void fling(int velocityY) { if (getChildCount() > 0) { int height = getHeight() - getPaddingBottom() - getPaddingTop(); int bottom = getChildAt(0).getHeight(); mScroller.fling(getScrollX(), getScrollY(), 0, velocityY, 0, 0, 0, Math.max(0, bottom - height)); final boolean movingDown = velocityY > 0; View newFocused = findFocusableViewInMyBounds(movingDown, mScroller.getFinalY(), findFocus()); if (newFocused == null) { newFocused = this; } if (newFocused != findFocus() && newFocused.requestFocus(movingDown ? View.FOCUS_DOWN : View.FOCUS_UP)) { mScrollViewMovedFocus = true; mScrollViewMovedFocus = false; } invalidate(); } } /** * {@inheritDoc} * * <p> * This version also clamps the scrolling to the bounds of our child. */ @Override public void scrollTo(int x, int y) { // we rely on the fact the View.scrollBy calls scrollTo. if (getChildCount() > 0) { View child = getChildAt(0); x = clamp(x, getWidth() - getPaddingRight() - getPaddingLeft(), child.getWidth()); y = clamp(y, getHeight() - getPaddingBottom() - getPaddingTop(), child.getHeight()); if (x != getScrollX() || y != getScrollY()) { super.scrollTo(x, y); } } } private int clamp(int n, int my, int child) { if (my >= child || n < 0) { /* * my >= child is this case: |--------------- me ---------------| * |------ child ------| or |--------------- me ---------------| * |------ child ------| or |--------------- me ---------------| * |------ child ------| * * n < 0 is this case: |------ me ------| |-------- child --------| * |-- getScrollX() --| */ return 0; } if ((my + n) > child) { /* * this case: |------ me ------| |------ child ------| |-- * getScrollX() --| */ return child - my; } return n; } @Override public boolean onTouch(View v, MotionEvent event) { // Stop scrolling calculation. mScroller.forceFinished(true); // Stop scrolling animation. removeCallbacks(overScrollerSpringbackTask); if (event.getAction() == MotionEvent.ACTION_UP) { return overScrollView(); } else if (event.getAction() == MotionEvent.ACTION_CANCEL) { return overScrollView(); } return false; } private boolean overScrollView() { // The height of scroll view, in pixels int displayHeight = getHeight(); // The top of content view, in pixels. int contentTop = child.getPaddingTop(); // The top of content view, in pixels. int contentBottom = child.getHeight() - child.getPaddingBottom(); // The scrolled top position of scroll view, in pixels. int currScrollY = getScrollY(); int scrollBy; // Scroll to content top if (currScrollY < contentTop) { onOverScroll(currScrollY); scrollBy = contentTop - currScrollY; } else if (currScrollY + displayHeight > contentBottom) { // Scroll to content top if (child.getHeight() - child.getPaddingTop() - child.getPaddingBottom() < displayHeight) { scrollBy = contentTop - currScrollY; } // Scroll to content bottom else { scrollBy = contentBottom - displayHeight - currScrollY; // Log.d(Definitions.LOG_TAG, "scrollBy=" + scrollBy); } // fire onOverScroll event, and update scrollBy if a loadingView has // been added to the scroller. scrollBy += onOverScroll(currScrollY); } // scrolling between the contentTop and contentBottom else { isInFlingMode = true; return false; } mScroller.startScroll(0, currScrollY, 0, scrollBy, 500); // Start animation. post(overScrollerSpringbackTask); prevScrollY = currScrollY; // consume(to stop fling) return true; } protected int onOverScroll(int scrollY) { return 0; } }
[ "ldqsxsl@163.com" ]
ldqsxsl@163.com
863f269b6fc1bd7a738cea83ef9197dbb72ab766
727a283aea2c6c3c8c6ab33c04a860993a5089c9
/src/main/java/com/lmg/enties/n21/both/test.java
3f4cdaa44db61230faefee98ccbf01745a09861b
[]
no_license
as943000866/hibernate-2
1b863e646e7616032d08f444a0d0455a0babaa79
e1af25386020f866c225dac362044f7d3b6e23f2
refs/heads/master
2020-03-31T21:09:28.835274
2018-10-16T10:01:20
2018-10-16T10:01:20
152,569,764
0
0
null
null
null
null
UTF-8
Java
false
false
4,560
java
package com.lmg.enties.n21.both; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.sql.Blob; import java.sql.Connection; import java.sql.SQLException; import java.util.Date; import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.hibernate.jdbc.Work; import org.hibernate.service.ServiceRegistry; import org.hibernate.service.ServiceRegistryBuilder; import org.junit.After; import org.junit.Before; import org.junit.Test; import com.lmg.enties.New; import com.lmg.enties.Pay; import com.lmg.enties.Worker; public class test { private SessionFactory sessionFactory; private Session session; private Transaction transaction; @Before public void init(){ Configuration configuration = new Configuration().configure(); ServiceRegistry serviceRegistry = new ServiceRegistryBuilder() .applySettings(configuration.getProperties()) .buildServiceRegistry(); sessionFactory = configuration.buildSessionFactory(serviceRegistry); session = sessionFactory.openSession(); transaction = session.beginTransaction(); } @After public void destory(){ transaction.commit(); session.close(); sessionFactory.close(); } @Test public void testDelete2(){ Customer customer = (Customer) session.get(Customer.class, 2); customer.getOrders().clear(); } @Test public void testDelete(){ //在不设定级联的情况下, 且 1 这一端的对象有 n 的对象在引用, 不能直接删除 1 这一端的对象 Customer customer = (Customer) session.get(Customer.class, 1); session.delete(customer); } @Test public void testUpdate2(){ Customer customer = (Customer) session.get(Customer.class, 1); customer.getOrders().iterator().next().setOrderName("GGG"); } @Test public void testUpdate(){ Order order = (Order) session.get(Order.class, 1); order.getCustomer().setCustomerName("AAA"); } @Test public void testOne2ManyGet(){ //1. 对 n 的一端的集合使用延迟加载 Customer customer = (Customer) session.get(Customer.class, 3); System.out.println(customer.getCustomerName()); //2. 返回的多的一端的集合是 Hibernate 内置的集合类型 //该类型具有延迟加载和存放代理对象的功能. System.out.println(customer.getOrders().getClass()); //session.close(); //3. 可能会抛出 LazyInitializationException 异常 System.out.println(customer.getOrders().size()); //4. 在需要使用集合中的元素的时候进行初始化. } @Test public void testMany2OneGet(){ //1. 若查询多的一端的一个对象, 则默认情况下, 只查询了多的一端的对象. 而没有查询关联的 //1 的那一端的记录 Order order = (Order) session.get(Order.class, 1); System.out.println(order.getOrderName()); System.out.println(order.getCustomer().getClass().getName()); session.close(); //2. 在需要使用到关联的对象时, 才会发送对应的 SQL 语句. Customer customer = order.getCustomer(); System.out.println(customer.getCustomerName()); //3. 在查询 Customer 对象时, 由多的一端导航到 1 的一端时, //若此时 session 已被关闭, 则会 //发生 LazyInitializationException 异常 //4. 获取 Order 对象时, 默认情况下, 其关联的 Customer 对象是一个代理对象! } @Test public void testMany2OneSave(){ Customer customer = new Customer(); customer.setCustomerName("CC"); Order order1 = new Order(); order1.setOrderName("ORDER-5"); Order order2 = new Order(); order2.setOrderName("ORDER-6"); //设定关联关系 order1.setCustomer(customer); order2.setCustomer(customer); customer.getOrders().add(order1); customer.getOrders().add(order2); //执行 save 操作: 先插入 Customer, 再插入 Order, 3条 INSERT, 2 条 UPDATE //因为 1 的一端和 n 的一端都维护关联关系. 所以会多出 UPDATE //可以在 1 的一端的 set 节点指定 inverse=true, 来使 1 的一端放弃维护关联关系! //建议设定 set 的 inverse=true, 建议先插入 1 的一端, 后插入多的一端 //好处是不会多出 UPDATE 语句 session.save(customer); // session.save(order1); // session.save(order2); //先插入 Order, 再插入 Customer, 3 条 INSERT, 4 条 UPDATE // session.save(order1); // session.save(order2); // // session.save(customer); } }
[ "as943000866" ]
as943000866
59118e3346191ae6cc76e4c60f21c163ae8fb3cf
cba28a584a274d2b43c35e94c1b9b4e19eab87e5
/jeecg/src/main/java/org/jeecgframework/tag/core/easyui/AuthFilterTag.java
10055533fb2c93b114b731dbe15d3a2cffc3e069
[]
no_license
Chulf/baizhi-manager
a234c22bf4d03e242cead5045448d0ccfaf915dd
b7b4df492844531471ecf115c3b59e381152e52e
refs/heads/master
2021-01-25T00:00:21.957535
2018-03-19T02:08:23
2018-03-19T02:08:23
123,286,825
1
3
null
null
null
null
UTF-8
Java
false
false
1,462
java
package org.jeecgframework.tag.core.easyui; import java.io.IOException; import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.tagext.TagSupport; import org.jeecgframework.core.util.ApplicationContextUtil; import org.jeecgframework.web.system.service.SystemService; import org.springframework.beans.factory.annotation.Autowired; /** * * @Title:AuthFilterTag * @description:列表按钮权限过滤 * @author 赵俊夫 * @date Aug 24, 2013 7:46:57 PM * @version V1.0 */ public class AuthFilterTag extends TagSupport{ /** * */ private static final long serialVersionUID = 1L; /**列表容器的ID*/ protected String name; @Autowired private SystemService systemService; public int doStartTag() throws JspException { return super.doStartTag(); } public int doEndTag() throws JspException { JspWriter out = null; try { out = this.pageContext.getOut(); systemService = ApplicationContextUtil.getContext().getBean(SystemService.class); out.print(systemService.getAuthFilterJS()); out.flush(); } catch (IOException e) { e.printStackTrace(); }finally{ if(out!=null){ try { out.clearBuffer(); } catch (Exception e) { e.printStackTrace(); } } } return EVAL_PAGE; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "chulf@zparkhr.com.cn" ]
chulf@zparkhr.com.cn
1ccefbcd1cf0b98900d459502e254b5e4e61925d
009e70fc9c458797947ab11959b1fc1e11725c3f
/app/src/main/java/com/fupengpeng/shoppingmall/entity/IntegralSequenceObject.java
7bb1d8f36540ca09808d2bb3c38e30a376e5c58f
[]
no_license
fupengpeng/ShoppingMall
eca29dc1b584c02df5df42ecccb877b5417cb088
47203b1788f1db071a39aeb88c7b5295606fce27
refs/heads/master
2020-04-05T13:31:49.051180
2017-07-11T10:05:03
2017-07-11T10:05:03
94,762,349
0
0
null
null
null
null
UTF-8
Java
false
false
1,850
java
package com.fupengpeng.shoppingmall.entity; import java.io.Serializable; /** * Created by fupengpeng on 2017/6/13 0013. * 积分排名实体类 */ public class IntegralSequenceObject implements Serializable{ /** * 用户名次 */ private String integralSequenceRanking; /** * 用户图像 */ private int integralSequenceUserPic; /** * 用户名 */ private String integralSequenceUsername; /** * 名次图像 */ private int integralSequenceRankingPic; /** * 用户积分 */ private String integralSequenceIntegral; public String getIntegralSequenceRanking() { return integralSequenceRanking; } public void setIntegralSequenceRanking(String integralSequenceRanking) { this.integralSequenceRanking = integralSequenceRanking; } public int getIntegralSequenceUserPic() { return integralSequenceUserPic; } public void setIntegralSequenceUserPic(int integralSequenceUserPic) { this.integralSequenceUserPic = integralSequenceUserPic; } public String getIntegralSequenceUsername() { return integralSequenceUsername; } public void setIntegralSequenceUsername(String integralSequenceUsername) { this.integralSequenceUsername = integralSequenceUsername; } public int getIntegralSequenceRankingPic() { return integralSequenceRankingPic; } public void setIntegralSequenceRankingPic(int integralSequenceRankingPic) { this.integralSequenceRankingPic = integralSequenceRankingPic; } public String getIntegralSequenceIntegral() { return integralSequenceIntegral; } public void setIntegralSequenceIntegral(String integralSequenceIntegral) { this.integralSequenceIntegral = integralSequenceIntegral; } }
[ "564055710@qq.com" ]
564055710@qq.com
8acc2db347a99eb87fb360fe2fc8d00fa72b4eed
a51cc60fe45f689e5ed13ed1bdfe3501ee37bcf1
/app/src/main/java/com/madar/madardemo/Fragment/OrdersFragment.java
501c4ae0177082f978458b3da0419a03bf16e7da
[]
no_license
Sotra970/MadarDemo
8cb051915bd8ad3cf8b7e4fb19e7b71cc94b78dd
5b8a3b13037f00b04a7eb723aa127467f5a61ac5
refs/heads/master
2021-05-03T10:14:19.588448
2018-04-08T00:19:14
2018-04-08T00:19:14
120,531,586
0
0
null
null
null
null
UTF-8
Java
false
false
13,295
java
package com.madar.madardemo.Fragment; import android.content.Context; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.support.annotation.Nullable; import android.support.design.widget.TabLayout; import android.support.v4.content.res.ResourcesCompat; import android.support.v4.view.ViewPager; import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.TextView; import com.madar.madardemo.Adapter.OrderFragmentsAdapter; import com.madar.madardemo.AppManger.MadarApplication; import com.madar.madardemo.Fragment.Abstract.TitledFragment; import com.madar.madardemo.Interface.NoConn; import com.madar.madardemo.Model.OrderItem; import com.madar.madardemo.Model.ServerResponse.UserOrdersResponse; import com.madar.madardemo.R; import com.madar.madardemo.Service.CallbackWithRetry; import com.madar.madardemo.Service.Injector; import com.madar.madardemo.Service.onRequestFailure; import java.util.ArrayList; import butterknife.BindView; import butterknife.ButterKnife; import retrofit2.Call; import retrofit2.Response; import uk.co.chrisjenx.calligraphy.CalligraphyUtils; /** * Created by Ahmed on 8/23/2017. */ public class OrdersFragment extends TitledFragment { @BindView(R.id.progressView) View progrssView ; @BindView(R.id.container) View containerHolder ; public static OrdersFragment getInstance() { return new OrdersFragment(); } private ArrayList<OrderItem> orderItems; private OrderFragmentsAdapter fragmentsAdapter; private TabLayout tabLayout; private ViewPager viewPager; private ArrayList<BaseOrderListFragment> fragments; private View v; @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { /*if(v == null){ }*/ v = inflater.inflate(R.layout.fragment_orders, container, false); ButterKnife.bind(this, v) ; initLoading(this.progrssView, this.containerHolder) ; viewPager = (ViewPager) v.findViewById(R.id.fragment_orders_view_pager); fragments = new ArrayList<>(); fragments.add(BaseOrderListFragment.getInstance(null)); fragments.add(BaseOrderListFragment.getInstance(null)); fragments.add(BaseOrderListFragment.getInstance(null)); fragmentsAdapter = new OrderFragmentsAdapter(getChildFragmentManager(), fragments, getContext()); viewPager.setAdapter(fragmentsAdapter); viewPager.setOffscreenPageLimit(3); tabLayout = (TabLayout) v.findViewById(R.id.fragment_orders_tab_layout); tabLayout.setupWithViewPager(viewPager); initTabLayout(tabLayout); return v; } @Override public void onAttach(Context context) { super.onAttach(context); } private void initTabLayout(final TabLayout tabLayout){ for (int i = 0; i < tabLayout.getTabCount(); i++) { TabLayout.Tab tab = tabLayout.getTabAt(i); if(tab != null){ View v = getTabView(i); if(v != null){ tab.setCustomView(getTabView(i)); } } } tabLayout.addOnTabSelectedListener( new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { if(tab.getCustomView() != null){ View v = tab.getCustomView(); v.setBackgroundColor( ResourcesCompat.getColor( getResources(), R.color.yellow_button_background_selected, null ) ); } } @Override public void onTabUnselected(TabLayout.Tab tab) { if(tab.getCustomView() != null) { View v = tab.getCustomView(); v.setBackgroundColor( ResourcesCompat.getColor( getResources(), R.color.yellow_button_background_unselected, null ) ); } } @Override public void onTabReselected(TabLayout.Tab tab) { if(tab.getCustomView() != null){ View v = tab.getCustomView(); v.setBackgroundColor( ResourcesCompat.getColor( getResources(), R.color.yellow_button_background_selected, null ) ); } } } ); TabLayout.Tab first = tabLayout.getTabAt(0); if(first != null){ first.select(); } } @Override public void onStart() { super.onStart(); } @Override public void onResume() { super.onResume(); loadOrdersList(); } private View getTabView(int index){ int textResId = -1; switch (index){ case 0: textResId = R.string.text_all_orders; break; case 1: textResId = R.string.text_i_deliver; break; case 2: textResId = R.string.text_i_receive; break; } if(textResId != - 1){ LinearLayout linearLayout = new LinearLayout(getContext()); linearLayout.setLayoutParams( new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT ) ); linearLayout.setGravity(Gravity.CENTER); TextView textView = new TextView(getContext()); textView.setTextColor( ResourcesCompat.getColor( getResources(), R.color.grey_700, null ) ); CalligraphyUtils.applyFontToTextView(getContext(), textView, "fonts/Changa-Bold.ttf"); textView.setText(textResId); textView.setLayoutParams( new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT ) ); linearLayout.addView(textView); return linearLayout; } return null; } @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); setTitle(R.string.fragment_title_orders); } protected void loadOrdersList(){ if(orderItems != null){ showLoading(true); if(MadarApplication.getExecutorService() != null){ MadarApplication.getExecutorService() .submit( new Runnable() { @Override public void run() { showOrderItems(orderItems); } } ); } } else{ String secret = null; try { secret = MadarApplication.getInstance().getPrefManager().getUser().getSecret(); } catch (Exception e){ // ignore } if(secret != null){ showLoading(true); final Call<UserOrdersResponse> receiptItemCall = Injector.Api() .getUserOrderInfo("getUserAllOrders", secret); receiptItemCall.enqueue(new CallbackWithRetry<UserOrdersResponse>( CallbackWithRetry.HTTP_REQUEST_RETRY_COUNT, CallbackWithRetry.HTTP_REQUEST_RETRY_INTERVAl_MILISECONDS, receiptItemCall, new onRequestFailure() { @Override public void onFailure() { if(tabLayout != null){ tabLayout.setVisibility(View.GONE); } Log.e("orders Request", "failure"); showNoConn( new NoConn() { @Override public void onRetry() { loadOrdersList(); } } ); showLoading(false); } }) { @Override public void onResponse(Call<UserOrdersResponse> call, Response<UserOrdersResponse> response) { final UserOrdersResponse userOrdersResponse = response.body(); if(userOrdersResponse != null){ orderItems = userOrdersResponse.getOrders(); if(MadarApplication.getExecutorService() != null){ MadarApplication.getExecutorService() .submit( new Runnable() { @Override public void run() { initOrderDates(orderItems); showOrderItems(orderItems); } } ); } } } }); } } } private void initOrderDates(final ArrayList<OrderItem> orderItems){ // do not call on ui thread if(orderItems != null && !orderItems.isEmpty()){ for(OrderItem orderItem : orderItems){ orderItem.initDate(); } } } private void showOrderItems(final ArrayList<OrderItem> orderItems){ final ArrayList<OrderItem> receiving = new ArrayList<OrderItem>(); final ArrayList<OrderItem> sending = new ArrayList<OrderItem>(); if(orderItems != null && !orderItems.isEmpty()){ for(OrderItem orderItem : orderItems){ if(orderItem.isReceiving()){ receiving.add(orderItem); } else{ sending.add(orderItem); } } } Handler uiHandler = new Handler(Looper.getMainLooper()); uiHandler.post( new Runnable() { @Override public void run() { if(fragmentsAdapter != null){ if(fragments != null){ BaseOrderListFragment f; for(int i = 0; i < fragments.size(); i++){ f = fragments.get(i); switch (i){ case 0: f.setOrderItems(orderItems); break; case 1: f.setOrderItems(sending); break; case 2: f.setOrderItems(receiving); break; } } } } showLoading(false); } } ); } }
[ "abdelstar.ahmed97@gmail.com" ]
abdelstar.ahmed97@gmail.com
f67b97ebe39a379eae10d5cd3032b8ec685a8af2
dda3b5d166d7a057fc586cc200f5ffffd418400f
/src/main/java/com/reed/rmi/base/HessianConnectionFactoryByTimeout.java
074345752dcd59292c892eb498aa8c79b7011e4a
[]
no_license
reedF/rmi-demo
0532b2494a33228c3c20cdf771b4970a41908e78
00be506278e92ca7fd08f64c24893d628b5cae95
refs/heads/master
2021-05-16T02:53:37.927434
2018-10-19T08:28:33
2018-10-19T08:28:33
18,282,499
1
3
null
null
null
null
UTF-8
Java
false
false
761
java
package com.reed.rmi.base; import org.springframework.aop.framework.ProxyFactory; import org.springframework.beans.factory.FactoryBean; /** * 继承HessianProxyFactoryBean,扩展对connection timeout的配置 * * @author reed * */ public class HessianConnectionFactoryByTimeout extends HessianClientInterceptorByTimeout implements FactoryBean<Object> { private Object serviceProxy; @Override public void afterPropertiesSet() { super.afterPropertiesSet(); this.serviceProxy = new ProxyFactory(getServiceInterface(), this).getProxy(getBeanClassLoader()); } public Object getObject() { return this.serviceProxy; } public Class<?> getObjectType() { return getServiceInterface(); } public boolean isSingleton() { return true; } }
[ "reed.fym@gmail.com" ]
reed.fym@gmail.com
f645f970f9a87c3d863f158cd87d8ed76a69ec4f
df7a73b04679da8e1aba210af222f8be7723e7a2
/fangjia-fsh-api/src/main/java/com/fangjia/fsh/api/fallback/ServiceConsumerFallbackProvider.java
c6bdce315efed7a27802f13ad1ed809a37636875
[]
no_license
isxuran/spring-cloud-safe
60c27fe82c6d640eda41bb943cf3f44d476e51c8
6f1c5d61d5c950b969e1e1fe8c76b995d593937d
refs/heads/master
2020-04-02T20:50:01.365845
2018-10-26T05:12:32
2018-10-26T05:12:32
154,780,600
1
0
null
null
null
null
UTF-8
Java
false
false
2,274
java
package com.fangjia.fsh.api.fallback; import com.netflix.zuul.context.RequestContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.netflix.zuul.filters.route.ZuulFallbackProvider; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.client.ClientHttpResponse; import org.springframework.stereotype.Component; import com.fangjia.common.base.ResponseCode; import com.fangjia.common.base.ResponseData; import com.fangjia.common.util.JsonUtils; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; /** * 服务不可用时回退功能 * @author yinjihuan * */ @Component public class ServiceConsumerFallbackProvider implements ZuulFallbackProvider { private Logger log = LoggerFactory.getLogger(ServiceConsumerFallbackProvider.class); /** * 需要回退的服务名称,必须是Eureka中注册的,全部用* */ @Override public String getRoute() { return "*"; } @Override public ClientHttpResponse fallbackResponse() { return new ClientHttpResponse() { @Override public HttpStatus getStatusCode() throws IOException { return HttpStatus.OK; } @Override public int getRawStatusCode() throws IOException { return this.getStatusCode().value(); } @Override public String getStatusText() throws IOException { return this.getStatusCode().getReasonPhrase(); } @Override public void close() { } @Override public InputStream getBody() throws IOException { RequestContext ctx = RequestContext.getCurrentContext(); Throwable throwable = ctx.getThrowable(); if (throwable != null) { log.error("", throwable.getCause()); } ResponseData data = ResponseData.fail("服务器内部错误", ResponseCode.SERVER_ERROR_CODE.getCode()); return new ByteArrayInputStream(JsonUtils.toJson(data).getBytes()); } @Override public HttpHeaders getHeaders() { HttpHeaders headers = new HttpHeaders(); MediaType mt = new MediaType("application", "json", Charset.forName("UTF-8")); headers.setContentType(mt); return headers; } }; } }
[ "2217106032@qq.com" ]
2217106032@qq.com
8fe7662e7f33fc18103c747c90b66a7044a1afd2
9d376922bfa5efa214e06bd467a1e8df5c322cdd
/app/src/main/java/com/example/abbasahmednawaz/prayeralert/Activities/Events_List_Activity.java
a57f5404a4ef95382d0d97acc7e655d46c7ee815
[]
no_license
fazalwahab/Android-Based-Prayer-Alert-System-For-District-Mansehra
5596fc5f02010064d9524a1ac86d49504b7c05bc
2bf3b13c8bd5c04f29b11d5806ef475bd7e4f3ed
refs/heads/master
2020-09-23T05:20:07.592883
2019-12-02T17:15:07
2019-12-02T17:15:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,053
java
package com.example.abbasahmednawaz.prayeralert.Activities; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.widget.Toast; import com.example.abbasahmednawaz.prayeralert.Classes.PrefConfig; import com.example.abbasahmednawaz.prayeralert.Classes.RecyclerAdapter; import com.example.abbasahmednawaz.prayeralert.Classes.RecyclerAdapter_Events; import com.example.abbasahmednawaz.prayeralert.R; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; public class Events_List_Activity extends AppCompatActivity { private RecyclerView recyclerView; private RecyclerAdapter_Events recyclerAdapter; public PrefConfig prefConfig; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_events__list_); //------------ prefConfig = new PrefConfig(getApplicationContext()); //---------------------------------------------------------------------------------------- recyclerView = (RecyclerView) findViewById(R.id.recyclerview_events_list); recyclerView.setHasFixedSize(true); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getApplicationContext()); recyclerView.setLayoutManager(layoutManager); //------------------getting info array----- showData(); //------------- } public void showData() { if( prefConfig.readEvent() != null ) { Gson gson = new Gson(); String json = prefConfig.readEvent(); Type type = new TypeToken<ArrayList<String>>() {}.getType(); ArrayList<String> list = gson.fromJson(json, type); recyclerAdapter = new RecyclerAdapter_Events(list); recyclerView.setAdapter(recyclerAdapter); } } }
[ "you@example.com" ]
you@example.com
fd63d43bc62b5b19baf7d39f05125972df950650
39ef743596d11bded67d0fb88a180da0b2d92d4a
/Backend/src/main/java/nl/han/ica/oose/dea/spotitube/exceptions/EntityNotFoundException.java
77e2d9b1ce89a9d81b35badf2d0c7e4742de88a8
[ "MIT" ]
permissive
SanderTeunissen/Spotitube
89fa3730d14a3e285200221d5652dbde622719ed
38d97323aab2efbb3c06b4962b02e10b9c2c1808
refs/heads/master
2020-04-15T23:06:29.254367
2019-01-10T16:53:10
2019-01-10T16:53:10
165,094,630
0
2
null
null
null
null
UTF-8
Java
false
false
259
java
package nl.han.ica.oose.dea.spotitube.exceptions; public class EntityNotFoundException extends Exception { public EntityNotFoundException(Class classType) { super(String.format("Couldn't find instance of class: %s", classType.getName())); } }
[ "sander.teunissen@home.nl" ]
sander.teunissen@home.nl
a1e565ea9e864922634436c6573d1f4274d2eb9a
87162f40b7c0a5958e2a4c4dcd04c9b79d5bd97e
/Work1/src/com/epam/javaQA/homework/Main.java
9edf580f054201976667a06b300422ed92cd539c
[]
no_license
KhyzhniakAlex/Java-QA-winter-2019
98b205bfb7781c32ea549260b05a4ca835367373
d6dc50dbc69ec8f984d38fb91386bc901ab0d2b9
refs/heads/master
2020-04-22T23:36:23.460734
2019-05-02T12:26:26
2019-05-02T12:26:26
170,746,675
0
0
null
null
null
null
UTF-8
Java
false
false
578
java
package com.epam.javaQA.homework; public class Main { public static void main(String[] args) { WriteEPAM(); } private static void WriteEPAM() { //the amount of stars is not the same, because this variant is better System.out.println("***** ***** * * *"); System.out.println("* * * * * * * * *"); System.out.println("*** ***** * * * * *"); System.out.println("* * ******* * *"); System.out.println("***** * * * * *"); } }
[ "sasha.khyzhniak@gmail.com" ]
sasha.khyzhniak@gmail.com
ef4a4f7bd9a9e8c71a582161e5af8100bdf4dab1
8b42c325b7e47ead8cad7322c44262cd7ffb98cd
/WeatherStationArduino/src/main/java/org/thingml/tobegenerated/REST_RemoteControl_Server.java
57e601102d4a16915535f14e11407b545168cf6b
[ "MIT" ]
permissive
HEADS-project/WeatherStationDemo
8ca1f9e500b7487239790e55a834f5762997e158
2df8d7bf53ad6415ad473e531ea01e0c1a28e64e
refs/heads/master
2021-01-02T09:20:54.094499
2015-06-24T11:49:03
2015-06-24T11:49:03
23,834,799
0
1
null
null
null
null
UTF-8
Java
false
false
676
java
package org.thingml.tobegenerated; import org.thingml.generated.WeatherStation; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; @Path("/RemoteControl") public class REST_RemoteControl_Server { private WeatherStation weatherStation; public REST_RemoteControl_Server(WeatherStation thing) { weatherStation = thing; } @PUT @Path("/changeDisplay") @Produces(MediaType.TEXT_PLAIN) // @Consumes(MediaType.TEXT_PLAIN) public String changeDisplay() { weatherStation.changeDisplay_via_gui(); System.out.println("Got changeDisplay"); return "OK"; } }
[ "brice.morin1@gmail.com" ]
brice.morin1@gmail.com
9792c18e95802fbb2f1e583717b2bc2320985f2d
ee4b7fd7a6da9929f01076520ba9c2e82ba6cc20
/src/main/java/ru/house/manager/EntityDB/Users.java
e53ebcc2ea062d00d5dfcc4fe8daff2bff753eb9
[]
no_license
Marchuk27/houseManagerMVC
01ebc7d7babd03d0a083f659968532d4666bb89f
2f6b0f01a9e9b09f41e632070871a8b4f92bc792
refs/heads/master
2020-09-11T06:40:07.619233
2019-11-15T17:47:29
2019-11-15T17:47:29
221,975,192
0
0
null
2019-11-19T18:34:24
2019-11-15T17:48:02
null
UTF-8
Java
false
false
1,711
java
package ru.house.manager.EntityDB; public class Users { private int id; public int getHouseId() { return houseId; } public void setHouseId(int houseId) { this.houseId = houseId; } private int houseId; public int getAccount_id() { return account_id; } public void setAccount_id(int account_id) { this.account_id = account_id; } private int account_id; private String firstName; private String lastName; private String fatherName; private String phoneNumber; private String roomNumber; private String eMail; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getFatherName() { return fatherName; } public void setFatherName(String fatherName) { this.fatherName = fatherName; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } public String getRoomNumber() { return roomNumber; } public void setRoomNumber(String roomNumber) { this.roomNumber = roomNumber; } public String geteMail() { return eMail; } public void seteMail(String eMail) { this.eMail = eMail; } public Users() { } }
[ "igor.bykov.96@bk.ru" ]
igor.bykov.96@bk.ru
fca3cbabc12145776b9bfc4c3319888ffd0927be
f607c52f2f9e585900577f9dd8824823710ff9d8
/GetUsers/src/main/java/com/rm334439/UserRegistryModify/domain/Photo.java
38dde0665fc7ef960d2a3c400bf3cdcd3e1ff808
[]
no_license
edgardpavanellio/handson6
6450b266f64a7eb2b2cd26d9331055aa96446eb9
c42fa958a6bfe68a04748e02342d5415103edabc
refs/heads/master
2021-04-23T21:51:18.030169
2020-04-11T00:26:04
2020-04-11T00:26:04
250,013,481
0
0
null
null
null
null
UTF-8
Java
false
false
2,592
java
package com.rm334439.UserRegistryModify.domain; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "photo_table") public class Photo { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long photo_id; private PhotoType photo_type; private PhotoPosition photo_position; private String photo_path; public Photo() { super(); // TODO Auto-generated constructor stub } public Photo(PhotoType photo_type, PhotoPosition photo_position, String photo_path) { super(); this.photo_type = photo_type; this.photo_position = photo_position; this.photo_path = photo_path; } public Long getPhoto_id() { return photo_id; } public void setPhoto_id(Long photo_id) { this.photo_id = photo_id; } public PhotoType getPhoto_type() { return photo_type; } public void setPhoto_type(PhotoType photo_type) { this.photo_type = photo_type; } public PhotoPosition getPhoto_position() { return photo_position; } public void setPhoto_position(PhotoPosition photo_position) { this.photo_position = photo_position; } public String getPhoto_path() { return photo_path; } public void setPhoto_path(String photo_path) { this.photo_path = photo_path; } @Override public String toString() { return "Photo [photo_id=" + photo_id + ", photo_type=" + photo_type + ", photo_position=" + photo_position + ", photo_path=" + photo_path + "]"; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((photo_id == null) ? 0 : photo_id.hashCode()); result = prime * result + ((photo_path == null) ? 0 : photo_path.hashCode()); result = prime * result + ((photo_position == null) ? 0 : photo_position.hashCode()); result = prime * result + ((photo_type == null) ? 0 : photo_type.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Photo other = (Photo) obj; if (photo_id == null) { if (other.photo_id != null) return false; } else if (!photo_id.equals(other.photo_id)) return false; if (photo_path == null) { if (other.photo_path != null) return false; } else if (!photo_path.equals(other.photo_path)) return false; if (photo_position != other.photo_position) return false; if (photo_type != other.photo_type) return false; return true; } }
[ "epavanelli@technisys.com" ]
epavanelli@technisys.com
e72c90c4ee2cd4426b8077e6a8ee97be2bd8e46c
93a4d1b3befb832db6377bb559510ba9b6f226e9
/Practice/696/Main.java
5470e2133a1c3a8289e6b0bdf2ae78fbbe8c4de9
[]
no_license
rjjfdn/Comprog-Stuffs
7176c6ac01a777d6d753268bbee6189d6eaa56e2
4aabb183f66976ff14aa4d84df0f85c0540c0caa
refs/heads/master
2021-01-06T20:41:01.399552
2014-06-11T10:20:02
2014-06-11T10:20:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
740
java
import java.util.*; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); while(true) { int tmp = s.nextInt(); int tmp2 = s.nextInt(); if(tmp == 0 && tmp2 == 0) break; int x = Math.min(tmp, tmp2); int y = Math.max(tmp, tmp2); int ans = 0; if(x == 1) ans = y; else if(x == 2) { ans += y/4*4; if(y%4 == 1) ans += 2; else if(y%4 != 0) ans += 4; } else { if(x%2 == 1 && y%2 == 1) ans = x*y/2 + 1; else ans = x*y/2; } System.out.println(ans + " knights may be placed on a " + tmp + " row " + tmp2 + " column board."); } } }
[ "hu_u21@yahoo.com.ph" ]
hu_u21@yahoo.com.ph
08d6c93cd2d0fcf89f226fff0af9634743724d50
f22bb10ab6d29fc4fc1e14586237911f4d45bd49
/app/src/main/java/com/example/root/httprequest/Rain.java
5becc1a3738d1fc20e444c3aa63338f70965ad46
[]
no_license
mams2/HttpRequest
62b895a83a258c2695bfa159d4ec2a2b2835b1d1
cb184e8abe64a00e0bc911b42b99a6c4f235c830
refs/heads/master
2021-01-13T03:42:47.233563
2016-12-24T13:01:05
2016-12-24T13:01:05
77,267,329
0
0
null
null
null
null
UTF-8
Java
false
false
208
java
package com.example.root.httprequest; import com.google.gson.annotations.SerializedName; /** * Created by root on 24/12/16. */ public class Rain { @SerializedName("3h") public double treshoras; }
[ "mams2@cin.ufpe.br" ]
mams2@cin.ufpe.br
e3dd8e369785fb37c8e4679c8396cd9054a045f8
b25b1776168b8498403fe074ded2e61d89e1d5b1
/src/org/jrm/test/FileCryptoTest.java
f559803f17444000507fa9e0dd0cd2a128291275
[]
no_license
jmallas1/encrypt
f2592c35956e2375d7ae7d152d94b4daec5c1ea8
09387e27123ae885ba88678ce33a423d86ff154d
refs/heads/master
2020-03-27T22:43:28.362267
2018-09-04T03:45:18
2018-09-04T03:45:18
147,254,917
0
0
null
2018-09-04T03:45:19
2018-09-03T21:23:39
Java
UTF-8
Java
false
false
648
java
package org.jrm.test; import org.jrm.crypto.FileCrypto; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; class FileCryptoTest { FileCrypto fc; @org.junit.jupiter.api.BeforeEach void setUp() { fc = new FileCrypto( "jrm123");} @org.junit.jupiter.api.AfterEach void tearDown() { } @Test void decrypt() { assertEquals("Jared was here", fc.decrypt(fc.encrypt("Jared was here")), "Encrypt decrypt functions"); } @Test void encrypt() { assertNotEquals("Jared was here", fc.encrypt("Jared was here"), "Encrypt turns string to garbage"); } }
[ "jrtytn@gmail.com" ]
jrtytn@gmail.com
fbab0d45c3d868bef415e8b17780cffdf8146f91
dc51a0642db90f246377b4b1b5159eac708999e3
/src/main/java/edu/unimagdalena/domicilios/api/DomicilioController.java
0791477e66724c8b66496ff5474c6c090484c3bd
[]
no_license
derekcantillo/DeliveriesBackend
778b5b6776ee7c5f6d7085de9d3f7a9733dfb0ec
6f35fba2add38ed33449a8d02c977a8bae88aa5e
refs/heads/main
2023-07-10T19:48:04.273811
2021-08-20T21:53:13
2021-08-20T21:53:13
398,407,910
0
0
null
null
null
null
UTF-8
Java
false
false
4,066
java
package edu.unimagdalena.domicilios.api; import java.util.List; import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import edu.unimagdalena.domicilios.modelo.Domicilio; import edu.unimagdalena.domicilios.modelo.Mensajero; import edu.unimagdalena.domicilios.repository.DomicilioRepository; import edu.unimagdalena.domicilios.repository.MensajeroRepository; @RestController @CrossOrigin(origins = {"http://localhost:8080","http://localhost:3000"}) @RequestMapping("/api/domicilios") public class DomicilioController { @Autowired private DomicilioRepository domicilioRepositorio; @Autowired private MensajeroRepository mensajeroRepositorio; @GetMapping //@PreAuthorize("hasRole('USER')") public ResponseEntity<List<Domicilio>> getTodosDomicilios(){ List<Domicilio> listaDomicilios = domicilioRepositorio.findAll(); if(listaDomicilios.isEmpty()) { return new ResponseEntity<>(HttpStatus.NO_CONTENT); } return new ResponseEntity<>(listaDomicilios, HttpStatus.OK); } @GetMapping("/mensajeros/{id}") //@PreAuthorize("hasRole('USER')") public ResponseEntity<List<Domicilio>> getDomiciliosByMensajero(@PathVariable("id") Long idMensajero){ List<Domicilio> domicilios = domicilioRepositorio.findByMensajeroId(idMensajero); if(domicilios.isEmpty()) { return new ResponseEntity<>(HttpStatus.NO_CONTENT); }else { return new ResponseEntity<>(domicilios, HttpStatus.OK); } } @PostMapping("/mensajeros/{id}") //@PreAuthorize("hasRole('USER')") public ResponseEntity<Domicilio> createDomicilio(@PathVariable("id") Long idMensajero, @RequestBody Domicilio domicilio ){ Optional<Mensajero> mensajero = mensajeroRepositorio.findById(idMensajero); if(mensajero.isPresent()) { domicilio.setMensajero(mensajero.get()); Domicilio nuevoDomicilio = domicilioRepositorio.save(domicilio); return new ResponseEntity<>(nuevoDomicilio, HttpStatus.CREATED); }else { return new ResponseEntity<>(HttpStatus.FAILED_DEPENDENCY); } } @PutMapping("/{id}") //@PreAuthorize("hasRole('USER')") public ResponseEntity<Domicilio> updateDomicilio(@PathVariable("id") Long id, @RequestBody Domicilio domi){ Optional<Domicilio> datosDomicilio = domicilioRepositorio.findById(id); if(datosDomicilio.isPresent()) { Domicilio domicilio = datosDomicilio.get(); domicilio.setValor(domi.getValor()); domicilio.setDireccionOrigen(domi.getDireccionOrigen()); domicilio.setDireccionDestino(domi.getDireccionDestino()); domicilio.setNombreClienteOrigen(domi.getNombreClienteOrigen()); domicilio.setNombreClienteDestino(domi.getNombreClienteDestino()); domicilio.setEstado(domi.isEstado()); domicilio.setFechaDomicilio(domi.getFechaDomicilio()); Domicilio nuevoDomicilio = domicilioRepositorio.save(domicilio); return new ResponseEntity<>(nuevoDomicilio, HttpStatus.OK); }else { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } } @DeleteMapping("/{id}") //@PreAuthorize("hasRole('USER')") public ResponseEntity<Domicilio> deleteDomicilio (@PathVariable("id") Long id){ try { domicilioRepositorio.deleteById(id); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } catch (Exception e) { return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); } } }
[ "cantilloderek@gmail.com" ]
cantilloderek@gmail.com
e8682db73304beb7a7b19ac868e2892843ad23e2
aa82c44707cbb70da67c3dabdde11e162e56a1b6
/com.jtrent238.jtcraft/src/main/java/beh.java
c88d78c002cdba18004f54bafffc2d7c659f5589
[]
no_license
jtrent238/jtcraft
c6804899969c7e5776253c5122539848c7de5f50
290820012690e87a491eaa450b9154fd9cf96115
refs/heads/master
2021-01-10T09:28:28.084577
2016-03-03T02:52:04
2016-03-03T02:52:04
53,013,456
0
0
null
null
null
null
UTF-8
Java
false
false
4,154
java
/* */ import org.lwjgl.opengl.GL11; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class beh /* */ extends bbw /* */ { /* 16 */ private static final bqx a = new bqx("textures/gui/achievement/achievement_background.png"); /* */ private bao f; /* */ private int g; /* */ private int h; /* */ private String i; /* */ private String j; /* */ private pb k; /* */ private long l; /* */ private bny m; /* */ private boolean n; /* */ /* */ public beh(bao parambao) { /* 28 */ this.f = parambao; /* 29 */ this.m = new bny(); /* */ } /* */ /* */ public void a(pb parampb) { /* 33 */ this.i = brp.a("achievement.get", new Object[0]); /* 34 */ this.j = parampb.e().c(); /* 35 */ this.l = bao.K(); /* 36 */ this.k = parampb; /* 37 */ this.n = false; /* */ } /* */ /* */ public void b(pb parampb) { /* 41 */ this.i = parampb.e().c(); /* 42 */ this.j = parampb.f(); /* */ /* 44 */ this.l = (bao.K() + 2500L); /* 45 */ this.k = parampb; /* 46 */ this.n = true; /* */ } /* */ /* */ private void c() { /* 50 */ GL11.glViewport(0, 0, this.f.d, this.f.e); /* 51 */ GL11.glMatrixMode(5889); /* 52 */ GL11.glLoadIdentity(); /* 53 */ GL11.glMatrixMode(5888); /* 54 */ GL11.glLoadIdentity(); /* */ /* 56 */ this.g = this.f.d; /* 57 */ this.h = this.f.e; /* */ /* 59 */ bca localbca = new bca(this.f, this.f.d, this.f.e); /* 60 */ this.g = localbca.a(); /* 61 */ this.h = localbca.b(); /* */ /* 63 */ GL11.glClear(256); /* 64 */ GL11.glMatrixMode(5889); /* 65 */ GL11.glLoadIdentity(); /* 66 */ GL11.glOrtho(0.0D, this.g, this.h, 0.0D, 1000.0D, 3000.0D); /* 67 */ GL11.glMatrixMode(5888); /* 68 */ GL11.glLoadIdentity(); /* 69 */ GL11.glTranslatef(0.0F, 0.0F, -2000.0F); /* */ } /* */ /* */ public void a() { /* 73 */ if ((this.k == null) || (this.l == 0L) || (bao.B().h == null)) { return; /* */ } /* 75 */ double d1 = (bao.K() - this.l) / 3000.0D; /* 76 */ if (!this.n) { /* 77 */ if ((d1 < 0.0D) || (d1 > 1.0D)) { /* 78 */ this.l = 0L; /* */ } /* */ /* */ } /* 82 */ else if (d1 > 0.5D) { d1 = 0.5D; /* */ } /* */ /* 85 */ c(); /* 86 */ GL11.glDisable(2929); /* 87 */ GL11.glDepthMask(false); /* */ /* 89 */ double d2 = d1 * 2.0D; /* 90 */ if (d2 > 1.0D) d2 = 2.0D - d2; /* 91 */ d2 *= 4.0D; /* 92 */ d2 = 1.0D - d2; /* 93 */ if (d2 < 0.0D) d2 = 0.0D; /* 94 */ d2 *= d2; /* 95 */ d2 *= d2; /* */ /* 97 */ int i1 = this.g - 160; /* 98 */ int i2 = 0 - (int)(d2 * 36.0D); /* 99 */ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); /* 100 */ GL11.glEnable(3553); /* 101 */ this.f.P().a(a); /* 102 */ GL11.glDisable(2896); /* */ /* 104 */ b(i1, i2, 96, 202, 160, 32); /* */ /* 106 */ if (this.n) { /* 107 */ this.f.l.a(this.j, i1 + 30, i2 + 7, 120, -1); /* */ } else { /* 109 */ this.f.l.b(this.i, i1 + 30, i2 + 7, 65280); /* 110 */ this.f.l.b(this.j, i1 + 30, i2 + 18, -1); /* */ } /* */ /* 113 */ bam.c(); /* 114 */ GL11.glDisable(2896); /* 115 */ GL11.glEnable(32826); /* 116 */ GL11.glEnable(2903); /* */ /* 118 */ GL11.glEnable(2896); /* 119 */ this.m.b(this.f.l, this.f.P(), this.k.d, i1 + 8, i2 + 8); /* 120 */ GL11.glDisable(2896); /* */ /* 122 */ GL11.glDepthMask(true); /* 123 */ GL11.glEnable(2929); /* */ } /* */ /* */ public void b() { /* 127 */ this.k = null; /* 128 */ this.l = 0L; /* */ } /* */ } /* Location: C:\Users\trent\.gradle\caches\minecraft\net\minecraft\minecraft\1.7.10\minecraft-1.7.10.jar!\beh.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "jtrent238@outlook.com" ]
jtrent238@outlook.com
b08695a3e97a25dcee5d8fa7ae9beb01057cacc0
7eb746c88662e75a19f66f363aadd5d5237242af
/app/src/main/java/org/newstand/datamigration/data/model/FileBasedRecord.java
7ffff6041730642965a90a8200d045a2acc28cd1
[]
no_license
Tornaco/DataMigration
f03824288e995fa2088d325afa76849a839591b4
7304d95a5feb2068d4f26585f5a8c50e087fcefa
refs/heads/master
2022-10-18T15:49:45.564065
2022-10-08T07:29:31
2022-10-08T07:29:31
84,621,616
19
5
null
2017-07-14T03:59:40
2017-03-11T03:42:24
Java
UTF-8
Java
false
false
807
java
package org.newstand.datamigration.data.model; import com.google.common.io.Files; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; /** * Created by Nick@NewStand.org on 2017/3/7 13:24 * E-Mail: NewStand@163.com * All right reserved. */ @Getter @Setter @NoArgsConstructor @ToString(callSuper = true) public class FileBasedRecord extends DataRecord { private long size; private String path; public long calculateSize() throws IOException { if (path == null || !new File(path).exists()) throw new FileNotFoundException(path); return size == 0 ? Files.asByteSource(new File(path)).size() : size; } }
[ "guohao4@lenovo.com" ]
guohao4@lenovo.com
c1f6089de9af60948c2f0c6267b3adbfc88437ff
9d72a9310420e9e5a52e2e0ce78f4a403ba53a3b
/src/com/javarush/test/level04/lesson13/task02/Solution.java
9719483d223ad36538d896c8b68bde33ffb10267
[]
no_license
VladimirPen/rush
9ef4808480cbf8c576bb86e8da18a8371a4f9930
f5151f1ef498c078063c199c555046ab561ca499
refs/heads/master
2021-01-17T06:53:39.798974
2016-08-10T17:44:31
2016-08-10T17:44:31
45,965,972
0
0
null
null
null
null
UTF-8
Java
false
false
911
java
package com.javarush.test.level04.lesson13.task02; import java.io.BufferedReader; import java.io.InputStreamReader; /* Рисуем прямоугольник Ввести с клавиатуры два числа m и n. Используя цикл for вывести на экран прямоугольник размером m на n из восьмёрок. Пример: m=2, n=4 8888 8888 */ public class Solution { public static void main(String[] args) throws Exception { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); int m = Integer.parseInt(bufferedReader.readLine()); int n = Integer.parseInt(bufferedReader.readLine()); for (int i = 0;i<m;i++){ for (int j = 0;j<n;j++){ System.out.print("8"); } System.out.println(); } } }
[ "corner85@list.ru" ]
corner85@list.ru
c99a5f60b09ea3dbbc1682512a550545d9f8564e
41c9381ec1061ecdee0829f92712ec4b7d4c5bd8
/springboot/springboot-all/src/main/java/org/spring/springboot/common/aop/APPControllerAOP.java
948600371e96ce8e461e48b2c240d6c89628e732
[]
no_license
0100chf/study-java
9d3b0cc7e178b82a0d57a12326007f3982c342cc
bc8723aaaa84290a86b1c7cede06d31f92237b6c
refs/heads/master
2020-03-23T11:51:27.401127
2018-09-21T06:59:33
2018-09-21T06:59:33
141,523,822
1
0
null
null
null
null
UTF-8
Java
false
false
2,859
java
package org.spring.springboot.common.aop; import org.apache.shiro.authc.IncorrectCredentialsException; import org.apache.shiro.authc.UnknownAccountException; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; import org.spring.springboot.common.exceptions.CheckException; import org.spring.springboot.common.result.ResultBean; import org.spring.springboot.common.result.ResultStatus; /** * 接口开发一般在controller返回ResultBean * 对此拦截,计算运行时间和统一处理异常,如果有异常返回异常json * @author chen haifeng * */ @Aspect @Component public class APPControllerAOP { private static final Logger logger = LoggerFactory.getLogger(APPControllerAOP.class); @Pointcut("execution(public org.spring.springboot.common.result.ResultBean *(..))") public void controllerMethod(){} @Around("controllerMethod()") public Object handlerControllerMethod(ProceedingJoinPoint pjp) { long startTime = System.currentTimeMillis(); ResultBean<?> result=null; logger.info("APPControllerAOP-------"); try { result = (ResultBean<?>)pjp.proceed(); logger.info(pjp.getSignature() + "use time:" + (System.currentTimeMillis() - startTime)); return new ResultBean(new ResultStatus(result.getData())); } catch (Throwable e) { return handlerAppException(pjp, e); } } private ResultBean<ResultStatus> handlerAppException(ProceedingJoinPoint pjp, Throwable e) { // 已知异常,可以登录 if (e instanceof CheckException) { return ResultStatus.exceptionResult(e.getLocalizedMessage()); } //else if (e instanceof UnloginException) { // return ResultStatus.exceptionResult(ResultStatus.NO_LOGIN); //} else if (e instanceof UnknownAccountException) { //shiro 异常 return ResultStatus.exceptionResult(ResultStatus.INCORRECT_LOGIN); } else if (e instanceof IncorrectCredentialsException) { //shiro 异常 return ResultStatus.exceptionResult(ResultStatus.INCORRECT_LOGIN); } else if ("kaptchaValidateFailed".equals(e)) { //406,验证码错误,不允许进 return ResultStatus.exceptionResult(ResultStatus.VERICODE_ERROR); } /* else if (User.STATUS_LOCK.equals(user.getStatus())) { throw new LockedAccountException("账号已被锁定,请联系管理员!"); }*/ else { ResultStatus status=new ResultStatus(); logger.error(pjp.getSignature() + " error ", e); //TODO 发邮件 status.setMsg(e.toString()); status.setMsgCode(ResultStatus.FAIL); return new ResultBean<>(status,HttpStatus.INTERNAL_SERVER_ERROR);//500 } } }
[ "1536021562@qq.com" ]
1536021562@qq.com
2ecd0e4e194dfd52d483f17abdea7fcd8d5b025e
3447b9cbca807cc921a3abd72094196bf4599288
/Omnom.Android/Omnom/src/main/java/com/omnom/android/acquiring/mailru/OrderInfoMailRu.java
1bd4a0e98ad3861fbead9b6ea5012c7536d86127
[]
no_license
saintlab/mobileapp_android
a1f6614d0837f0527ce426baa232916b985f4b43
14ab2f0ae62ee432a740922f5c2784799dac6a99
refs/heads/master
2021-05-29T11:32:21.305429
2015-07-02T06:24:50
2015-07-02T06:24:50
21,729,682
0
0
null
null
null
null
UTF-8
Java
false
false
1,007
java
package com.omnom.android.acquiring.mailru; import com.omnom.android.acquiring.OrderInfo; /** * Created by Ch3D on 24.09.2014. */ public class OrderInfoMailRu implements OrderInfo { public static OrderInfoMailRu create(double amount, String orderId, String orderMsg) { return new OrderInfoMailRu(amount, orderId, orderMsg); } private double amount; private String orderId; private String orderMsg; private OrderInfoMailRu(double amount, String orderId, String orderMsg) { this.amount = amount; this.orderId = orderId; this.orderMsg = orderMsg; } @Override public String getOrderId() { return orderId; } @Override public void setOrderId(String orderId) { this.orderId = orderId; } @Override public String getOrderMsg() { return orderMsg; } @Override public void setOrderMsg(String orderMsg) { this.orderMsg = orderMsg; } @Override public double getAmount() { return amount; } @Override public void setAmount(double amount) { this.amount = amount; } }
[ "xch3dx@gmail.com" ]
xch3dx@gmail.com
37ad97bef4fdcfc00a9cdceed87f1e306ef5a827
09d0ddd512472a10bab82c912b66cbb13113fcbf
/TestApplications/TF-BETA-THERMATK-v5.7.1/DecompiledCode/JADX/src/main/java/org/telegram/p004ui/Components/C2516-$$Lambda$ChatActivityEnterView$0PqxYA4Sm4DXenEKSdETEwDwen0.java
70c7fac49e22406146c1316140a3f5fd5c72883e
[]
no_license
sgros/activity_flow_plugin
bde2de3745d95e8097c053795c9e990c829a88f4
9e59f8b3adacf078946990db9c58f4965a5ccb48
refs/heads/master
2020-06-19T02:39:13.865609
2019-07-08T20:17:28
2019-07-08T20:17:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
734
java
package org.telegram.p004ui.Components; import android.view.View; import android.view.View.OnClickListener; /* compiled from: lambda */ /* renamed from: org.telegram.ui.Components.-$$Lambda$ChatActivityEnterView$0PqxYA4Sm4DXenEKSdETEwDwen0 */ public final /* synthetic */ class C2516-$$Lambda$ChatActivityEnterView$0PqxYA4Sm4DXenEKSdETEwDwen0 implements OnClickListener { private final /* synthetic */ ChatActivityEnterView f$0; public /* synthetic */ C2516-$$Lambda$ChatActivityEnterView$0PqxYA4Sm4DXenEKSdETEwDwen0(ChatActivityEnterView chatActivityEnterView) { this.f$0 = chatActivityEnterView; } public final void onClick(View view) { this.f$0.lambda$new$5$ChatActivityEnterView(view); } }
[ "crash@home.home.hr" ]
crash@home.home.hr
c6617e59d6251f66efd37e213d30995c59fbcf45
b641e97d985535e4f1d52c7891aa907f3eb0a254
/src/Components/net/raumzeitfalle/fx/filechooser/FindFilesTask.java
c1887e4f0952ec6763b4f7dbe44ffdd4a39d164a
[]
no_license
mmaciag1991/HarnessDesignSystemInterfaceDiagram
7e6f5dc078205475700dc2f63abc3f1e88e62728
4569676541a80dff1ffb5df6080799367e835065
refs/heads/main
2023-05-19T00:43:10.113472
2021-06-11T21:54:03
2021-06-11T21:54:03
375,101,913
0
0
null
null
null
null
UTF-8
Java
false
false
2,309
java
/*- * #%L * FXFileChooser * %% * Copyright (C) 2017 - 2019 Oliver Loeffler, Raumzeitfalle.net * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ package Components.net.raumzeitfalle.fx.filechooser; import javafx.collections.ObservableList; import javafx.concurrent.Task; import java.io.File; import java.nio.file.Path; import java.util.Objects; final class FindFilesTask extends Task<Integer>{ private final ObservableList<IndexedPath> pathsToUpdate; private final Path directory; public FindFilesTask(Path searchFolder, ObservableList<IndexedPath> listOfPaths) { this.pathsToUpdate = Objects.requireNonNull(listOfPaths, "listOfPaths must not be null"); this.directory = searchFolder; } /** * Even in case the directory to be processed is empty or does not exist, * the consumer collection is always cleared as first step. * * @return number of files found and processed */ @Override protected Integer call() throws Exception { Invoke.andWait(pathsToUpdate::clear); if (null == directory) return 0; File[] files = directory.toAbsolutePath().toFile().listFiles(); if (null == files) return 0; updateProgress(0, files.length); RefreshBuffer buffer = RefreshBuffer.get(this,files.length, pathsToUpdate); for (int f = 0; f < files.length; f++) { if (isCancelled()) break; updateProgress(f+1, files.length); if (files[f].isFile()) buffer.update(files[f].toPath()); } buffer.flush(); updateProgress(files.length, files.length); return files.length; } }
[ "mateo.m@wp.pl" ]
mateo.m@wp.pl
c2382155b7797dff0efb13679f3bd55d71399111
9fb166524f673dfae75aae6b42c59a9a50560ce1
/chap6/DollarFormatFirstTryDriver.java
18bca501b911593a6ab79a03b1a2d3178d2ba3fe
[]
no_license
akplearner/JAVA101
b9050306349bccce0081f3856d5ffe2b672b4350
78e053726030ab8fc6de14b0277117d4b373092c
refs/heads/master
2020-03-19T02:44:42.593972
2018-06-02T01:47:48
2018-06-02T01:47:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
567
java
//listing 6.12 import java.util.Scanner; public class DollarFormatFirstTryDriver{ public static void main(String[] args){ double amount; String response; Scanner kb = new Scanner(System.in); do{ System.out.println("enter value of type double:"); amount = kb.nextDouble(); DollarFormatFirstTry.write(amount); System.out.println("\n"+"Test again?"); response = kb.next(); }while(response.equalsIgnoreCase("yes")); System.out.println("End of test."); } }
[ "akplearner@gmail.com" ]
akplearner@gmail.com
2b1188642970119eb3f002a5aede1c42dd5e0680
5fc1d203f8dbc9adce92bec5346f18d54fd37aa9
/Project2/OrderProcess/src/OrderResponseAction.java
ab877540427ab8cdf3427abd6853b0920cd9bbe5
[]
no_license
jinguanz/Rep-for-Arch-Course
6656b51d9190b97bb96ee1b32dc8ee8aaa7c07f4
31b53128afc387b78163c6ee38c2eeade547aac3
refs/heads/master
2021-01-17T07:28:28.939893
2013-09-25T06:04:52
2013-09-25T06:04:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,373
java
import org.jboss.soa.esb.actions.AbstractActionLifecycle; import org.jboss.soa.esb.actions.ActionUtils; import org.jboss.soa.esb.helpers.ConfigTree; import org.jboss.soa.esb.message.Body; import org.jboss.soa.esb.message.Message; import java.util.Map; public class OrderResponseAction extends AbstractActionLifecycle { protected ConfigTree _config; public OrderResponseAction(ConfigTree config) { _config = config; } public Message noOperation(Message message) { return message; } /* * Retrieve and output the webservice response. */ public Message process(Message message) throws Exception { logHeader(); Map responseMsg = (Map) message.getBody().get(); System.out.println("Response Map is: " + responseMsg); logFooter(); return message; } public void exceptionHandler(Message message, Throwable exception) { logHeader(); System.out.println("!ERROR!"); System.out.println(exception.getMessage()); System.out.println("For Message: "); System.out.println(message.getBody().get()); logFooter(); } // This makes it easier to read on the console private void logHeader() { System.out.println("Start of Order response..\n"); } private void logFooter() { System.out.println("End of Order response..\n"); } }
[ "ruiliwonderful@gmail.com" ]
ruiliwonderful@gmail.com
881538668387f5610b90bb31c69053abe90fa72b
ce46a3711e62bb1cfa442d1891691c8e337fff00
/Family/CC1/src/cn/jxufe/test1/Way.java
7ed6553064d3c649243763b1427d737a6d6f0930
[]
no_license
bigcaiyujie/FamilyTree
ed57aeb92a8256292ff5ae9b5185eefafddcc641
501a0edc74b781c0968092c852451c71ca228a0d
refs/heads/master
2021-07-13T14:57:54.377988
2017-12-27T02:31:24
2017-12-27T02:31:24
96,073,241
1
0
null
null
null
null
GB18030
Java
false
false
2,523
java
package cn.jxufe.test1; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.ansj.domain.Term; import org.ansj.splitWord.analysis.ToAnalysis; import cn.jxufe.data.CatchTxt; import cn.jxufe.data.Data_xml; import cn.jxufe.test.Family; public class Way { public static final int BOUND = 3; private CatchTxt txt = new CatchTxt(); private Family family = new Family(); private Data_xml data = new Data_xml("xml/name1.xml"); private BasicWay sd = new BasicWay(); private ArrayList<String> relative = this.data.getList(); public Family getFamily() { return family; } public void setFamily(Family family) { this.family = family; } /* * 把相应的人称,名字 放入到类中 */ public ArrayList<ArrayList<String>> word() { HashMap<String, Integer> map = this.data.getMap(); String context = txt.readTxtFile(); ArrayList<List<Term>> clearword = clear(context); for (int i = 0; i < clearword.size(); i++) { int num = 1; if (exit(clearword.get(i),"毛泽东/nr")) { while (num <= 10) { //范围在后10句之内 sd.way(clearword.get(i)); num++; if((i+1)<clearword.size()) i++; } } } for (int i = 0; i < sd.getTerm().size(); i++) { System.out.println(sd.getTerm().get(i)); } return sd.getTerm(); } /* * 判断出现最多的人物次数 */ public String select(ArrayList<String> allPeo) { int n = 0; String keys = new String(); Map<String, Integer> map = new HashMap<>(); for (int s = 0; s < allPeo.size(); s++) { if (map.get(allPeo.get(s)) == null) { map.put(allPeo.get(s), 1); } else { int i = map.get(allPeo.get(s)); map.put(allPeo.get(s), ++i); } } System.out.println(map); for (String key : map.keySet()) { if (map.get(key) > n) { n = map.get(key); keys = new String(key); } } return keys; } /* * 分句 分词最终结果 */ public ArrayList<List<Term>> clear(String str) { ArrayList<String> list = new ArrayList<>(); ArrayList<List<Term>> list_term = new ArrayList<>(); String[] word = str.split("[,。]"); for (int i = 0; i < word.length; i++) { list.add(word[i]); } for (int i = 0; i < list.size(); i++) { List<Term> parse = ToAnalysis.parse(list.get(i)); list_term.add(parse); } return list_term; } public boolean exit(List<Term> parse,String str){ boolean e=false; for(int i=0;i<parse.size();i++){ if(parse.get(i).toString().equals(str)) e=true; } return e; } }
[ "853160177@qq.com" ]
853160177@qq.com
0943f2d287e81f2be72f7231d2c83d3acd640d43
21ab7480dfc055dbb0f275218bb6a67ddf14e3f4
/QuanlyHsWs_server/src/entities/QuanheId.java
ba4963909646619d4b1bd25b5984f1399afff6ae
[]
no_license
x981/Rest-sercurity
3a0f708a4712cf5a412573e8e26eead048fc7ad5
752d1b7e371cfeadc5e30c8610873fb3a100729c
refs/heads/master
2021-01-01T03:49:55.839197
2016-05-19T03:15:24
2016-05-19T03:15:24
59,079,127
0
0
null
null
null
null
UTF-8
Java
false
false
1,229
java
package entities; // Generated Nov 23, 2015 4:06:50 PM by Hibernate Tools 3.4.0.CR1 import javax.persistence.Column; import javax.persistence.Embeddable; /** * QuanheId generated by hbm2java */ @Embeddable public class QuanheId implements java.io.Serializable { private int maHs01; private int maHs02; public QuanheId() { } public QuanheId(int maHs01, int maHs02) { this.maHs01 = maHs01; this.maHs02 = maHs02; } @Column(name = "MaHS01", nullable = false) public int getMaHs01() { return this.maHs01; } public void setMaHs01(int maHs01) { this.maHs01 = maHs01; } @Column(name = "MaHS02", nullable = false) public int getMaHs02() { return this.maHs02; } public void setMaHs02(int maHs02) { this.maHs02 = maHs02; } public boolean equals(Object other) { if ((this == other)) return true; if ((other == null)) return false; if (!(other instanceof QuanheId)) return false; QuanheId castOther = (QuanheId) other; return (this.getMaHs01() == castOther.getMaHs01()) && (this.getMaHs02() == castOther.getMaHs02()); } public int hashCode() { int result = 17; result = 37 * result + this.getMaHs01(); result = 37 * result + this.getMaHs02(); return result; } }
[ "aff0511@gmail.com" ]
aff0511@gmail.com
7c311c41720d9d66ccfce50f79244836c0c57889
28fc83a12cc8951c4ba7ca0351ca535f5b476166
/exercism-examples/hello-world/src/main/java/Greeter.java
af2100084f246d9b6130a1907d7f63911542e536
[]
no_license
AlaineCMiller/Java
756868a6955cb75a6a2fb42698c9f82503d8a05c
d91247609afa1047a45cd6f44477dc1768ce5938
refs/heads/master
2021-10-08T18:17:07.867776
2021-10-07T00:50:49
2021-10-07T00:50:49
203,431,082
0
0
null
null
null
null
UTF-8
Java
false
false
92
java
class Greeter { String getGreeting() { return "Hello, World!"; } }
[ "alaine.miller@bbc.co.uk" ]
alaine.miller@bbc.co.uk
f4714c622e69bce2855336486d47d1d77fae3586
86abb891438a71d2ed054447d3b7b157f4ae6257
/Term Project/src/FileWriterReader/CustomFileReader.java
6b5116d4c8c07a11273df0fe13ad03cfbdf7a96b
[]
no_license
ShanjinurIslam/Object-Oriented-Programming
8e4142a62d53e401d7b491bd7fad08c74a96fe9a
8f48bf14ab2d2308310d39b518ff9add756a3a6b
refs/heads/master
2020-07-02T15:28:15.422305
2019-08-10T03:28:16
2019-08-10T03:28:16
201,572,434
0
0
null
null
null
null
UTF-8
Java
false
false
1,045
java
package FileWriterReader; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; /** * Created by Spondon on 12/12/2016. */ public class CustomFileReader implements AutoCloseable { private File file ; private BufferedReader in ; private String targetString ; public CustomFileReader(File file) throws Exception { this.file = file ; in = new BufferedReader(new FileReader(file)) ; } public boolean isPresent(String targetString) throws Exception{ String tem ; this.targetString = targetString ; while ((tem=in.readLine())!=null){ if(tem.equals(targetString)){ return true ; } } return false ; } public String copy() throws Exception{ String tem ; String sout ="" ; while ((tem=in.readLine())!=null){ sout += tem + "\n" ; } return sout ; } @Override public void close() throws Exception { in.close(); } }
[ "spondoncsebuet@gmail.com" ]
spondoncsebuet@gmail.com
462e453749d2bc1f565991b41c666e2d847c851a
51934a954934c21cae6a8482a6f5e6c3b3bd5c5a
/output/23d95e1bc4ea422d9c549c279a989112.java
4e5ad843f78629ef5f65376da02d4f06ad156294
[ "MIT", "Apache-2.0" ]
permissive
comprakt/comprakt-fuzz-tests
e8c954d94b4f4615c856fd3108010011610a5f73
c0082d105d7c54ad31ab4ea461c3b8319358eaaa
refs/heads/master
2021-09-25T15:29:58.589346
2018-10-23T17:33:46
2018-10-23T17:33:46
154,370,249
0
0
null
null
null
null
UTF-8
Java
false
false
37,177
java
class qX6FEjSJg { } class WU { public void[] o7DI6fQJyHLhaF (qocx4o5IEl QqbII7i, int iSwgAv, oByI lctNeRfw5P, boolean SJaOO, int RI6y0hqVh, int ouVjvthscXgohw) throws QgVlVgByUA9 { kLgNlRRL[][] A_0AkKR9xFkOtE; boolean[] PIIgL = !!new sDiHMV6GEb7o2L().i(); boolean ii5; void[][] IPa5SZFHNrc; int[] bUZ = ( this.cJtI()).wqOq(); while ( ( 64169746.MNaD_NG())[ !TXTw3RlMI0Yx.aKM()]) ; void mSKX49E4svGhD = --this[ !null[ false.g()]]; } public static void aN (String[] zBBe) throws X { boolean S9OXF0l; } public static void W9LX (String[] E11L8FX8O) { { int rGP; x6f1He[][] NAAMC7a; return; int VokTFCluedHQ; } ; ; !!35751.O3EB3owETiKx(); ; if ( !!new void[ -469.n8h62QA][ --( 23573.wIsO3FUjQR).CWaD()]) if ( -this[ -false.jjdYh]) return; ; { return; void[] Ilk0rLVbJSw87; boolean KP12JJOk; void[][] mkv_aZVnPc; while ( new br_G()[ !!---!null[ -!!B2kfwzuiBVNq_().b4BxAsIaYJ]]) if ( JmmffgvqPTlCO.NrbGBgjjhImf4G) ; { !-( -043.CxT4EF).jhSwhy(); } boolean[] ztulb5FaO5v; while ( new M().faII49uDaaq()) if ( false[ --!!this[ !!!true.mqixum9Pvt]]) !true.yxlTOV9; iw[] u0P2kfqN; void[] q4aobZWQX96gDm; } if ( false.b3) false[ Bv1NH.KC()];else { return; } void tza54zz8Jv = !--new h().VNiypi4XyblT; if ( !this.qENmIptv) return;else -WHdWsG71sF[ null[ this.rWRl0gvM()]]; void RQMoR7egCpkl; int[][][][][] VvAYVWedfM5 = -!-!this.pUkd9 = -!!LS9STRDKB.x8L_0; boolean kWbsLeINRtn; ; int R2a; void[] xyDWnZ9NaAIn = ( !!new void[ !( !---( new BF39VoTLDyr().J9auEO())[ new lL()[ false.AAfQSIwlkTVVe]]).CW2hI91Ck1RK()][ X9oE2()[ !false[ -kRxERs().n7bx_Qp6m()]]])[ -( new void[ this[ ez5()[ !XnlZrbYXnCs()[ false[ n01ddOzVdZTTC().JAkru]]]]].GHXW)[ -!true[ !-9.mj4L0gJ5WQ()]]] = this[ new boolean[ this.lZGF9KTx2][ !03.aa5mkKWEUmJ_9()]]; b95L3[] ktRpjTCJEJ; if ( !!!zR9o().yBjeFy()) return; } public boolean[][][] vu () { void[][][][][][][] K1tA; int[] OEKmlk7RUcAY = -this[ -this.j8]; void r6zR = null.CpdGdUnwTN() = new boolean[ !new e5_g0SamD[ this.vFWSvZk5][ this[ !!!this.ma]]].MZHtRaJ3; ; boolean[][][] UmD7pc7; ---this.u55qh0(); boolean Wfk1mRsY = ------!false[ -!OPTi7SK4vq[ -!false[ true.ZOJMvxamDG6l()]]] = 743808.SJq(); PwSVyjMGn rtQMGg9Twxa0; int[][][] TRX8vaP = rB2Ac2GIg()[ !null.g] = !-new pyFfz().HpZphNYf7oAJ(); int[][] OEUPv = true[ new boolean[ !wMkYmcGP().iT41HIQAFDxF()][ -new pPEDcXnXsQ0C1F().tvJ()]] = 23024606.Ye1qRNgM7_; boolean[][][] PswB5w6 = -hRTuzmkZZ().po() = new boolean[ ( null[ --false[ LSHxX17avG8fiP()[ !IOd.ueXMVYcb()]]]).q9iBFpwF].ahSl1(); int LQT; ; void[] PA2MPGCMFW; boolean KlEQt0ghBjJAqG; tKoq p = !-new wbrMV8uenCDN[ -!null.i0Z4b9w8()].YI; } public int gw () { boolean[] ORSS5u = !--!!!-!-!new boQ8DWJv7rxLaZ().wi7DDzw2t; if ( ---!!-this[ -( !nBRfh().N5lt).cfobLgl()]) ;else if ( this[ null.ivMac]) oG2.KmJ8; { return; boolean[][][] pZbCcAoAooiJ; new void[ ---37271[ --this[ !this.GBcOJqATORX5LM]]].iM; ( new XTJ[ -!--4580.fs].Es18mq)[ -false[ ( --!-!this[ !true.iIFGHiCBe()]).c3nwasaqP()]]; return; -null.E3k3crL4Q0d; void cU; void[][] LT5dVA1XROh6; { { int _w0D68y; } } boolean w95A; int NR; return; ; } while ( !!!!new Lkm().dX9UKVwUvRVc6t()) if ( -77950312.EvocEjFd4()) if ( !---!( -952373317.c)[ !-true.tbrpV3fSsoH()]) if ( true.QoIKRL) { while ( !XdFiMJY_9eN[ !-994[ !!---ajRy().N23M()]]) { void tGLAoJU9; } } int[][][][][][] CDGLKYK4A3 = --TUj7l7O3AaBO.jyxKR7E = new void[ --!null.Os10_QiR].AfTX5p(); !!null[ false[ 2.tBH]]; ; if ( new dkfb_().W()) while ( 881778362.JhJQq9jrWce) !!-null[ --!-!this[ !!true.OAAI9()]];else if ( -WtUI3x2bLa().Y()) return; ; int aKoQic; v8p3[] DzOznumZslQij = true.vQDh6gaNU() = false.l(); if ( !Nh()[ ( new int[ !Qpv9t0ItNV0m5.q0c60aGgBw()].ESWpwGQ6ZlXl).EbxaugUVna]) ;else ; return; boolean[] UsqHmSeya0SerZ = ( -!null[ -!null[ !WiH9fciU_zqvB().vNNv8izn_NM]]).G6DH(); ulX_NciXLEHzaM[] rz; int[][][][][][][] ANIMmj; ; } public static void OihGh (String[] gc6TKUplU3C) throws n4HtQs { while ( -!-!new void[ WCne7_kRWtzZv()[ Rl1z_hdHjLo[ new boolean[ !!!( dm()[ new XdiT().H3i2Y1k2()]).qUpKTI].kMQ]]].rwEDu7()) { int[] QA4OPAqt; } hc9ZG[] idgKw2C5Fits; boolean[] Vx07Kx; while ( new boolean[ new _jmQ3uy6()[ Cdp4wxPc[ !!!APV9jodIl_F.PFUHdV5l55D()]]][ this.FLUOIxdTVKB]) return; boolean akme = -( -( !--new ai8rBChn().EA)[ ToSDmXa().UdqAJ])[ !new D()[ new jq8WN5vJtCuVBq()[ new RlgIU_o4N3vQ().tSRqyfqk5fMZLk()]]]; nrUq4[][] R4g4380jZW; } public void[] DlAMxGl (void _zB_E2oy, boolean[] H4Zuax, void[] O64lb_, boolean[] ezMmCt9, void UBQhlmMwI, zG2Ja3QtW KucZZBs8IJ) throws a8Kl_8rXZWu { 9500.g7U_dAM1XvLvW(); return; { int QzJ36IbvbhpvI; void[][][] Uq6txa; -false.NClbAfGgMq6; int[][][] gCfn35TxxeJEA; void[] y3U9; return; int[] p4rofo; int[] KfW7cwDg5C5XY; boolean[][][][][][] IU9sXQ; int uts2SiVUExnaT; } void[][] DZdwsKu60 = !!-false.zMQ4Qu = ( ( 40481255._P()).sa_Bqc7).idE(); return true.W4x; 027506[ --new JEiGX7sh()[ null.TMKRRpLX]]; Sh1K().a; ; if ( 947397[ 5.owmzcan()]) !this[ !!!-new VCYwPrFz[ null.WLNukGSG()][ 853685109.KWFC49vKITF8L0]];else if ( 092778.ipnOL) if ( true.ESbqzhJmhr) dzpH1V2.lJxGZFfAyrK(); boolean to; uLoveA0[] OSYocs7r6HmqM; boolean[] QM8iLcJGy9NKd = -oJjPh4gYa14ncz.nDzCuC8(); int[][] AQ3i9 = dkItZkvZ01yJ[ ----ifk0VhbU[ --47376013[ true[ !this[ ( true.LgmbreQx()).TvrzD]]]]]; while ( this.lbW) { while ( new kAdyDmhS8Ui().VP__rOd0D()) while ( ( !this.tEXjNIpCz()).aQkgo()) if ( --!Q5ckv.RdKwlSNpk9n) while ( KrKkTlAwS1cmm8.wffk5I1r) { return; } } wcSYs_HH_[] k = new Q6fstYekeC53wu()[ -null[ !this[ -!new void[ --!this.DlHRKi].Nl]]]; t8 Fpr22WdJ = ( true.QlNtI6mkAp)[ !--false[ !this.B()]] = new SpauRildoXz().ZeRimGuwWkMY(); _3DMwwd2[] wsgclsR4wgH_6 = new wfFpy6TPGbe().lMkK() = -new vkDpfnx8().qnJaAuxjCCKqb(); tqwtLY[][] RtAw; } public static void q34ehpLQu (String[] KXE7k3Az) throws tzVG5 { { boolean[][] OPs3A0uHujZn; ; while ( !null.BuB) return; ; boolean[][] ibMc; { void[][] Shze; } while ( new QUIxp3s()[ wPQqmoQ_egbG.N9HWSYx0Ma_Xf]) !!!!!true._AUhtAKV(); } return; void wk8TSQIBwiaqu = this[ -this.RhM6()]; return 3.dRkcQd; { void[] FRpkSAM6; } if ( -true.gK) while ( !--null[ ( -!this.KCaR9j())[ -new XqEfrwmtSd().TlLtF4UHb()]]) { boolean lje1; }else ; boolean lQnam; fVA djK1SB4zcKEZ1; ; void IHzdxU3bkZS; } public Tti6fIKKWd5[] Y1Wj_s2h_ () { while ( YyExSdZ()[ ( Shyn().BNXSZ9t4U7w())[ !r.fTgZsjN0JJ()]]) { ----true[ !qEb[ -!null.AE]]; } 01985.GQIvHhZ(); { while ( new cSUh_MJaopK().X5KcY()) return; void YRpwPnAPTV; { boolean U9tFrgR; } ; boolean[][] m1A_aavhMfPaIp; ; ; ; return; Sf7 vyg5d; int[][] z; boolean Cl1nosGUmQ; while ( false.fcEwI4NRz7TqVL()) if ( !!( ( true.pDK_ei7G26J).DB7lkHvtUr()).M7P5b()) if ( -!-!!!--!yXk[ new lkHXSx0Z2OrE()[ zwR7yC9gIcVt.T_]]) { while ( new H1gGaqiJ227f().adpI4yy81gV()) ; } boolean[][] L14RQepKg; vxHMYlGxtqteer eUxBE1kARnH; new CVOxSIU6JX1().zsPkdkqIc6u6OM; qsU y1IjOOMzRrDK; if ( -true[ !true.nwm()]) ; return; } ; int Rpa2qwJe = !new hGMM9Leh().naWP3dYBEE(); void[][][][][] R7YF0IIv = yzAb()[ null.fsrnU7MN5Ip()] = !null[ Ri4PVvB7H().dNZg]; Task79Jdb63j jx9er; boolean[] NMmJyF5LkQ = EOjflcmp[ 204346419.PQxb()]; int nfQ; return -new Owg6LFJ()[ -( G.ZBO2CnU3).N6]; return; int[][] JqxD8jXzBSA = lWC7.q(); return !this.q4GBrv(); boolean[][][] z; void[] aedu5hjc9ois = ( !-true.MjYKvcw1Rz0DqG).Oh; false[ -!55155618[ ( new void[ null.tr2EAp()].Y49dT)[ true.cWUi()]]]; { void[][] AsBluSxU; if ( 34309.nHA()) ; } ; if ( ---Dnywdqu7nj7().ZkOFgKA()) while ( new OxyV().YrrdYZQJtWC) if ( kkF()[ false.nT1UT2()]) if ( BzDf4ID()[ !( !-!-qJCFIgTZfES().zVaHVJ_h7bH2k).LAhrtY4z]) ;else return; } public static void DqZvUQU7vd (String[] IxscM7jzUXNB) { boolean j = -( new fSramn().sn34aQ())[ WrgDrGtH()[ -new UKqOzqi()[ null.Cez]]] = -15.ILznVW_z(); if ( --QEYQARXbOeeg().N76isNDsndoRRd()) !-new NX0mE()[ ( -( true.AQjjrOP).hRIB1r()).hGU2z()];else !!!null.btigrIZjDGB(); ; int v; ; if ( ( -new LMWgnlCKtP()[ new Qoms4GuN()[ qaiUXRGYaMt().hCF()]]).inOAcRP3_6uXj()) !-!AkPckr4s()[ -this.KlgmmT]; int gAcNz = true[ !new s_()[ false.POwrb4]]; drKWADd3TeT[] hJDGdCy = false.uyOVT_876DXF; } public int[] R_al7lCg1rcOe () { void u = d_TALWMx().pDVRZVKd(); void[][] VpmfwDJ1v = -new int[ new Al().iHA3K7q8s1_Uei()].Gqh01i76DI6KI8() = new void[ !ANJyBuPt.nD7r].ixRYFFCiSsDgBB; return; { return; boolean XN3Jml_x7; return; } ; void[][] aLVC; while ( rdT6nIm3[ new iBII_lUDTTzL().wSxdc5h()]) if ( new boolean[ true.Fskn()].idF6DMUldnC()) new int[ true.y_IhuyR()].eK; int[][][] VgBXAIQ2v = -( ( new RQivnN2sKkndq()._QzyQnQw81v()).Hg8lOxFcQ()).ao(); void[] dut4ecixyL; ; boolean[][][] D; int X; if ( new HCRZQnSN5R1()[ this[ -!new vYmbY5uiht56xY[ !( false.P())[ true[ !-!null.cjYBNvjqZ57Z0Z()]]].VJJU()]]) ;else return; qg85DOKXjhq64 A = -!!new dC21eMlpdRzs().R8(); int QUFfWxWOVgX; if ( -!new boolean[ new bN8().BAikRfYEfP1()].FyBe7iFo3tb8()) ;else -false.NJP9dR3; } public boolean vH8mPEKlwgH8 (void xBKazUbu, Sf4A4HK QOt, int[][] u3Zen9b07qce, boolean g20) throws moAzalR { void Kv6oNskzsQQTTf; ; oRONQAXg kJ7 = 82.lI_UfF99tUxY(); boolean[] bWeu9UieI4Wvcd = -new uBvISl1nSyQ81A()[ !!true.YnE35m4YWYrth()]; void[] fjw2x7jyafRb4J; while ( !false[ null.qhMvqmne2()]) return; new wsNzzjUHSu().hzZMMFWK; return ---!-!!--( -!!false[ ( !582391.FvWQewVfDF()).I_]).E0Lc6jR5MCfhQ1(); return false.PVS06N4xYlbrLE; return; ; int[] RR = !-true.c = -!false.CKkXzH(); sPsvRof5[][][] TQYb; boolean Uo; boolean SVXfyLO; H4XE4F[][][] uYOFIGH14zdI; int yNQLIvB5dDH = new boolean[ -new wt().JUWKnH8b8Xt()].yz3FF(); return -false.zxG2sAnZw(); boolean H34Xk26; } public void wSlaD0n4pZSI3e () { boolean kdOo = !!!new void[ !-!PkEbjWdfd.MDLFTL3].wZua = ( -new d2TYrA8b930go().a5fR97y1d).yMyF05le; ; } public boolean[][][][] qpxSWA08PwED5; } class tp8kDxPl { public boolean VTyFk () { !Px5CR.wp; int ZP = fXWX54gCbpsf.Hm; if ( new r8Osx3()[ Ok().sS5bvjebea9XN()]) while ( !-!!-( 7134[ new void[ -!!true.cgYu8yhq9I()].EKryq1O])._aNHhbs9ybM2bA) if ( this.Ql8g8Np8Kvb()) while ( DFDALy3C().qkpXVU_N5w) while ( LVJpGG1gkVS().grEAI6tI7GGoRW) while ( !true.h_s()) return;else return; int x9 = true.gdxlcBnrwhM_pm = !new whFobuIkgNX()[ Q3ZJyQukkf3.aG()]; int jWlyQnD = null.PDt(); { { return; } if ( !new t5j[ !-this[ --null.ie2NtdtiM()]].btSEbSVwhluDcQ) ; void[] RvIN_dm9np; boolean[][][] T6_; return; !!true.BJ; void IZsO6IC; void[] tZ5PkefamP; int[] HAx8sf; int[][][][] lWF; while ( --new int[ 9.fnZ].RKMVv()) !true.JlUx2oSe8R5_0(); } { void[] Fd4Dfm; void MX0SpJCxJ3D9; vntswRrPEVd6g zWM3Lml9HsV; boolean[][] u; if ( ( new jyztWo1o9d[ !this.D7Nd()].EdUB2D()).goKs7Bk31h6ZB) { void xxY4O3yIp6N; } boolean[][] LbXGygh; boolean[] Aas09; } while ( -null[ !false[ ( -new lMQqjCPH().u0FRERd1())[ yoJGqU8e482rP[ --false.LIeNfAb]]]]) return; rFOhT_erdGx3 TCdld_2; CRv3[][][][][][] WhTBM8pBBnf; { void uqV9HZl_; !null.uuLS00; boolean EkUFiW; new boolean[ !true.iaIYZbBPhaggp7()].Eru7bBIzxf; if ( -new t6y[ new void[ new eVhmIIPSwag().o][ !( null.u9ZayXqxQ).dzvUt1vaR2()]].f1()) ; } void[][] YkeM1bgQR = !--!true.TcPvx4kBiD7(); int B41g8U; } public boolean[] jU (pGwwHsYKmVKI[] TTGVchZTcHQp, int DXBVJYmLRoLEe0) { { int Lf; L0F3cneLtofj[] cYj9LVp3rha80q; void[] eih94lcIeSGW; int PtsSkCT5M; return; { int RVvMj; } boolean[] NtlLCZ; Dn.JA5VY; while ( LJ294zC3N().TGAc6jkzBWN()) return; boolean[][][][] hN3vgbHDuV3; new cU7().RgcoyTZjEX; jBG yZ; } ; { int[][] lZEXX68zH8zn85; ( true.WRm5J32).fs_0vng_I; return; int GkJ32gSIyVVmx; FRlDLYwYROKGa[][][] yBjOT4DH5exA49; boolean[][] y93SN4Ggu; wBmRpjU IiMakL; } { while ( -yQoT7()[ 995837824[ ---new H().FZR2LJeaLHA]]) while ( !true.L()) if ( !DMm_OOmB().grtC5) return; if ( -xs2iGf5naGAO().NO_qt) return; } Q[][][] hKKArRZ; iGyY1NWnSNMR PsU = umqxmjHOfJL[ Mgbbe()[ 6.lxPKAYRRZflE()]]; ; if ( -!new Q3IQ0h[ !null.Psum()].cFee) { return; }else while ( true[ b()[ -51[ -true[ !-!866621.htS()]]]]) while ( false[ new U32a3v().It5u()]) return; return new HwEF1BKvcN2tI7[ !-true.MfpJ()][ !new YKgsXJgnZ().mVAG0UHGAriJ()]; void[][][][][][] OigT = ( -!-!ozosu()[ !( --!new ScoQCOuN[ -new IlONe()[ false[ SCxK2IQG()[ true.V3j5s9u9iV]]]].u).e8o()])[ -!!stP().ENwUu()]; void _LQ; wZ CnK = -new boolean[ 3511392[ 420143405.Nek]][ new void[ !new Iq().A9JXsr66].T5FKeNm] = !-new hNvw6hX0hu()[ vKkei_XafRz.E()]; boolean V = this.egq6egF97OWxwS = !32056.LJVo339T32XV(); new int[ !this.IcIH9].VcU9JQDJldk; } public static void EhlEc1O75mN (String[] U) throws x { int n2U = !5[ !( ( 18.mI_kUcx2TX()).AVLY5ubzxY())[ -null.rnwmOxmrhI9()]] = -u1.ARSLsrAk(); boolean[] zCngHPrH = -!new boolean[ -true.RW()][ null.ogoYC0l]; ; { fsyR9i6YUR[] g5crRGQ0; boolean[][] H_3v2AX9C7aBc; return; return; ; !!rEOtE.w; } return; if ( !new nRKG2MZQl()[ -false.A1qWBF()]) while ( ( ( wzikrbC.mYzQWdVPI11TB7()).I0YY7_7DyVgzr).vY()) ;else { return; } if ( -null.Ag1YYRRUb7L) { ; } BDOsaUC[] a_AMoP; if ( this.HLVs1JfTknsi) ; while ( 41175106.VYGmvOYv5M()) return; void[] sO11mzIya = null.x0wUYInLp97() = new int[ !!null[ --( -false.ruWgbRzWrKkFGs()).sBoSTuG]].R4vfUcyQzqOaoR(); boolean[] AL_sh; hW GrA = this.chjMeJ79uM0; ; } public int VMLbE (VVtNrP6zCI _0D, void GwMS4, rbp4NPnkG lTGHH2RxxxvyT, _Cnvv4AGKkfc7 WPlEnguAY9P, void AfS8, boolean[] FUdp5lr4cie) { int TasDCmIPul = !( true[ this[ new _fZlMuiZvkKQV().a()]]).lep3Q() = this.hrY; Ro9[] faPU; -!-( ( !this.yNw0ZwV_54vUR).Q3x()).ZoPQ(); void VWDnTA7X8jS; ; new Zn()[ this.Kta]; ; OqQjx08ilR7 Uq46ClTk = null.oI2oJLJmFh = !90589338.hnbfYR; int[] IDAcmyNFp; boolean NYS0rw = !!-!545600.c3TlCMM_Lodlpx(); if ( BD5nCfEdq().xg7dRJ3fZ3Lv) while ( this.w) ; !null[ -true[ -new void[ !APsXa8DIH()[ !!!new W6p9gZn6VcxF[ !!new boolean[ -!!-true.EYLdNjW].bxO()]._()]].UTtGYHA()]]; void[] EvqE0wRcL; ; ; if ( this.PE9S5()) { return; }else return; void vfbOpOdBofqNLe; ; ; } public int[][] Dkj5FmxDVfck; } class Qb { public static void nvtwn3_Q5aoO (String[] VghEGpBf9E) throws Lph6Ks { b5UX_ f8BFq = Fdl()[ new Aa4Hv().xaFeW2Hhrz] = !YYiwAi__6.gdI_mBAQbT; nc1FqhdMw c = jZJNVlaqWfV().Js; return --new void[ LlNgFKGV3xHgNv()[ -true.uaWV]][ !bUd().zbfZJs7wwJtB6]; ; } public int[] Sf2n2Jo5d () throws Ffg { void bSgqPZk; void HRy0; if ( -627612.Hp2()) return;else { ; } while ( bYY9ezM4GJk().GiN) { boolean[] wwgZHcX_2BwA; } return; return -this.JQ8j2(); int Ve3iSbg8Nc4cu7 = false.V; RKU42gVsMj[][] t3 = --this.m5773OPkjsiKk() = !-!( ( null.kum7zRrVEZ7YR()).U5E02qt).XjaKr8BKM4Jg56; boolean J1; } public static void r (String[] Td8bop8OVRM) throws Wrsmz { void[][][] o6_B = null._2uCPEDyJuECEr; void j = n()[ --this.az8()]; int[] _eb_m0QVi6 = -!!( 684250176[ -!-qN_Wl5CvBsWjJ().L()]).nUxU(); ; int XSdEf8; r8bRXNwphknZ_r[][][] zw4P98sJ4FWtV = !-true.I8JgYfRSm8AFJ(); } public static void HYRVB4fqY4L6Fp (String[] PlYsF) { { boolean[][][] sBVr; } void[][][] vxPR6; NdAdgcoobH tzLVKy625 = this[ !true.K5dw3bGs7()] = new r_VPp2f0().VP409H8uMxVAx(); return !!!!new int[ --( null.E1emckw1()).BaxUbTy].a2Vie3Y4W; boolean[][][][][][][][][] IKXdC35NSUIwVx; return; x4NC KPZQvr = -!-true[ false._PjDuX()] = true.mf3V5gCGAXM1; if ( --!pZ35[ fOdGGk1Qor.BGwp()]) if ( !zwxGg36Un.AYrpaZ()) { int[] Mmcti; } { { JT_7W34[][] wBgkqW; } i jb; -new TOpCjTP1rQWY62()[ -new int[ ( true[ ---!new void[ !false.j2N()].Ss]).Si()].IOE()]; ; { { if ( -this.Oeji05KW()) while ( 2158198.OZHY) ; } } void[] u6y; void DMLB; boolean uKPZd; boolean[][][] ehSLig2n; return; { fePRrCs64cv Q9AMxY; } void l9Fv3lS2SS; } return -this.HLdY46g; boolean[][][] kJnRFa; return; void[] tpwWOrqtDLW9L = false.Eh() = 4183.dsgAm04(); { int[] XZ9G; while ( this.K) !null.DCESJoRjQ; int[] KApxLDa; if ( true.nvrHq) if ( !false.H) { while ( false.qaKsomETlo0nGy) if ( !!5.rF4KYorS) Zhmiw3myC.BKS_F(); } if ( null.ECDo) { yOvSEDpm9y8QoA()[ !new EVVwU().sN81U8xRH()]; } ; qPjc89r eeUWFdZEUUm2PR; while ( !g2w[ 39332834.eP()]) { ; } ; } NLOXAkTH[] R5VAMu = --!new Hbf1[ -false.J36oKBjlcDAkO].EvC92562ozw3l = null.roJR2C(); int[] K = vES().r0puVps = true.l7f7TpJqHPNBi; { jgivHSyyeoSbOa[] RC86pp; } } public int[] UM53pdv (boolean[] WRn, boolean eaI3, boolean pYaWvTZ, int[][] L2jZZk, boolean QXnS60DfUDjd, void b_WBwAi, int xGMeyR) throws p__TmB { Pin3tsOei[][] YGuscijCftK3Hi = !( _5o.vuc).Y2l_TW = u6MkbgMLZTj().R14Tj; while ( PEmCV0tN[ -true.tecyF()]) ; int XhmqDnCVcygbVl; while ( fQrcEkPEaGn.u) if ( ---false.lFSScmJv5q) while ( new int[ ---!!zgFXfdxFyV7o3I.dA7kMfW()].esrBor3VaaYA()) ; while ( cKOlD2cwiW7hwd[ j0keyJW4Cwk5[ sp56gwWMWh().vqlHw_xMDUROvC]]) while ( --l_[ new boolean[ !true.b].RM()]) while ( -_oWSbrF.f()) !gcxn9()[ null[ !P()[ -this.AoSy5r]]]; void[][][] YAGnZm7H27eNO; if ( !new int[ --( !( false.w8uCK4e8wYR_T())[ null.rgSCE82()])[ -IiI8EwPGyq2()[ -new int[ -( !d31b.ycvq())[ !NzJBL2J[ false.dZfNer()]]][ -null.J4ueW()]]]].ytAnjT()) ;else while ( true.p9vXCAVKi78()) if ( !!--822.lcJYXGKJjo()) ; Ql2e7KIyBgJ_m[][] htshCSBy2 = -!new fYSrns().VgV3z9JJAz; !ZbLyx6()[ ( new Xx[ !!( 838776.SACXRvrFT).pqFp89U()].DCMiQEQt()).DYwiMI3()]; void N; void[][] WftpIUdj3Ghc = -!false[ new PgxkPu90q()[ oy40frcM8[ -false.OY45C85YJ8tsD]]] = -true.Tijpb6B3nD_(); { A23tSRPHm P4iovnsJpXTc; while ( null.tYs) return; ; while ( ( --4688.voPFS())[ AF()[ -!!rPBPcV9U7B().XIZdYEUcoqIin()]]) { if ( new int[ !true.o__DJ()].Ol) { { { if ( true.F5) if ( -!-!!---false[ !-t2zkzTlrG.hPaB]) { boolean jIKeg; } } } } } if ( !this[ !!-new int[ true[ null.q5MyXlfZ4()]][ 7228623.fIwnU()]]) while ( ( !-true[ !-!-!-!!false.NOQV2eeQjQgSDq])[ new void[ !!-!-!!-null[ null.rOR7tCAKaL()]].Bu4euozW]) if ( new hUgyCsYSbFR[ true.Rr7x()].yk5nB()) if ( -false.WZgQ) return; CPIz[][][] nYPgPOgL8X9HH; } ; } public void JswLLVh; public int[][] x1YwJr1_5fFWKv; public a6tNhM O9XWvvCjOa4; public void gW8uXCKegjCV72 (boolean[] Qp7A3W, void dRZIa, boolean[] pS5QWK, int wsU3, void[][][][] on4d0v, int[] AMs) { return; ; return; while ( false[ -new S8gTWvJlw_u().C]) return; if ( f0tBVifnSu().dcjubUdlLWp()) return;else if ( 2[ !new IM5KTZ95().SqoQbm]) if ( ( !!-KtDPgia0Od().vine8NFksetWL).r9_xG) return; null[ true.PEL7l7v2NhSyHC()]; sxOPqhE8HK[] dpb7y5S8e = mgWjkh.Otba(); boolean YIB; { ; while ( -!new void[ new Of4dm7[ !!this.PWsh2JulrrL][ !-null.F5oweO()]][ -null[ new tjE()[ !-!false[ !( -!!new OtHspGp[ --!new d527().DNzN6UP2qSE].bMFbjjHeINxLn)[ !-new GklOhmj[ false.G()].fW3A()]]]]]) ; boolean xWHXJnIM2psRr; while ( -false.VznMsVnH_9B3) if ( -!5735931.hMNgpVgxyIDiD()) return; boolean iHMbWHbJH; if ( --SfcSLe9bHLS().kedI8) I.F8O(); { { void SzUPPTKhhsXagN; } } { boolean jkN9kF_z72qF8; } int[] e; void kKdo5SshMwO; int[] pCDOvz8K0j; ( false.u8q5opFXQjSY)[ false.AIcY5cS()]; { void TlAGC0; } { int[][] c_o4eeOSGn9C_U; } void[] NLIWXqnVf; } } } class gwY { } class onM { } class qBS { } class m30c4v5e1_Ad { public void Kos (void Wga4H6mLdqNxR, void[][][] tnEBxKT9kOxE8F, int[][][] upY285Pb3SC_, RVEq2X7g MNqeIQg) throws lan6VCYi { { { return; } } while ( -!-new qlOKUiuaUL().fZ) return; if ( 40848559.r86x2) return; } public int nSBO () throws VFazelr1Y { void d27V7NZJa9zP; UxIwHEj7()[ true.tiY]; while ( --true.wnZ6A) ; { boolean KGlaF; void TDhk; while ( true.biExN4H_F0DoF()) ; ; nnIv7c4bL[] k; void[] gG; void[][][][] _UXrVjabq5DtwJ; return; int EL_GWf; wfo0ICUEg[] Xt; } { int XOiqkPi0uPt; while ( 44136121[ ( null.SH4kgh4T()).OsVu]) return; pFcbIK4PXYbLG[][] bgDCWU; void[] ZXlOD2z; this.U1_6s_5; void[][] BwMc1KmnthK; !!null.poS2hJWLFbpo; int i9jn3ljX; return; { boolean[] yQe; } int F; !!new int[ !nmUa.B4327h5HcNLV()][ new UsY_Sa[ vwl_()[ ( --true.iIw1dzJjcb())[ this.H6]]][ FeTOYuW().hwfy2fhO()]]; fAvu SibFfwO; return; -new gzMVMcY_8910jT[ !tsm3S99M.E].Of(); } ; ; while ( new GK5Ugau[ ( !!03.Hj_PMU7G).KrH70ZO()][ ( X[ ---null.eEmVwjv6v8()]).cNoUDEjP()]) ; return; void[][] _y = -null.f_7eSDs1c = true.VAXyLWjgf3PFX(); return; !-Wt9eRI.G; void[][] FZT8EX875 = -!ZRhjx0tkdqf().iPW6; ; void Z20kxc5515S; } public sGVuyah6SqsCO L2xRLE0SvB2btR; public void Vbpg; public void gTLyPKU7owj7k; public void OWiR6 () { if ( !new GF().A0diSh2w()) { int[] dfmqV2GkFqs; } { int i; void[][] vZZt2I1v; NN[][] fX1oZQ5v; boolean[][] mlfI7; int VvxT5e9sRXxu; { boolean[][][] _qt9KpYbhC; } while ( new int[ true[ !false[ null[ ( --!!true.eqzf6an1Vuw()).CDKJL]]]].KuiEpkc) { !-true[ KLfklh0UQEpK1().YWn]; } { if ( --!ewl9B.P7) { hiBhsT9Irr12fu[][][] xzGNgdGrK; } } boolean giTs0T1s; return; boolean G; int[] XdFwtrpYYh; void[] rcU7ylV1fY; this[ null.KrFO]; kh682G[][] K76A4QRTNtDl8F; ; void y74Is5xiS1jvsN; ; new void[ !( !null[ z7SZ3.mhTz7H()])[ 98[ !09445.ZgJIiGM1g3P()]]].JLM5Hgxhx(); } QW91ChEm9s FqH = -cVX4inrb4[ !false[ !--( !new I01Y3ykcmHDwN().sH()).ycky()]] = true.lfPlkdCzYWuXW(); boolean ozwTird9mp6 = null.vC3_h5gygJI; if ( !-( !this.F9mpWcTE())._mMP) if ( !--( -false._()).KvwZ1Qn()) return;else ; int UJ7jYTiiX = new JI()[ 47116131.t5bkZ] = TzO9L0[ !--( !!-!!new M().SVvoVz()).BZ6r7]; { while ( L6E_EN[ yTeUrSA[ -true[ !( new XKIJ9YJ1Em8().wa)[ -!new aJgYZf9seKIc().W0LEn7UX]]]]) { while ( null.o) if ( -!!-D7Dq4FQ4Su().g9aj()) { arXI4LZ[] JdfNCX12m1G; } } void[][] U4yovpzalCnZ50; int[] US4wOm; bq qO; ; void NjhmpuwDV7; !-new grSi999().NDY(); return; int dY; } boolean u3Apgq6zD = new void[ -this.UJ6cwg1tW][ --RA.Fwf0b05()] = this.eDn_NaJs3rGU3R(); int[] Gu9_3wBlOgW5Y = !( new Z6WvO()[ false.VQq6Sd])[ new dxUr7B2yUTl().kwvJrGZ_DSdfK4()] = -false[ !( !PHiL7C.FRy).jk55Mvv]; if ( !!30587648.kAOs6VJZOnh) if ( false.AavTYt7kM()) !false.f4ri();else while ( new void[ -mMZ.nqnN()][ -!BHTpyk1s()[ new z().qTv0yLbxNrCc]]) while ( !739452858.d6FYcTWRfzkEs) ; { fLoO2CAlTKBGY[][] Maa_myviqw; int[][] IIdRV6djF0; void[] w6OVpwMjj5J; while ( this.s2k) ; int o; } boolean[][][] arOA8SSYB; boolean wf; if ( 457038280.qaL6()) ;else new cxCXop0K().g06bs6cXwBqAC(); } public void[] JX70_c8Uni () { H_Ai4vengkDdfe Y4txV_O9P83o = !-( !689427.H15).RF3v(); return; ; ncqwkq3vLvRASV[][] SY9WDD3PLox = !-true.isXkw0D8cXDmZL; boolean hr0V4Cr5uHX; return ( !---02074087[ --!-new TcXzE()[ -!-new goBgYKWYw[ false.njopt].UJgeN_dDMA]]).iPE6eQefUS; while ( true.vwVlhv) { void m8Sq; } if ( new djZ().UlA7URXQoKEQx()) while ( pTzC4().f) ;else ; while ( ( this.WQBYoJRF7w()).AncdpdAjlc3t()) this.D9vDagRDLGML; void[][] mwolPjk; void ae1MM = 8111482[ !-( new KS0Xv3I9()[ -!-mLT4W8sIIBzsgS().XgqaQO]).aSgtCYuLaGpxK] = -new void[ 38427500[ fd4nrmFiDHy5.m9FCgXcBWLmKmu]].ztIB4X; void[][] r4 = !!-794309447[ null[ -( new LaWaVdtsHRdf()[ y_ifvUCn().cmAeI4]).NEo()]]; this.DvfxewM(); boolean b8QY = ZvlBxVc0().GPPF5bY35eEWmR() = -26331[ -false.Q()]; BFncrUei[][] pNe_NfWZX = -new KY().A5nHkA(); int WejeSr; int OkwyvV = new VFRHf48MixVOKa()[ ( qTFq[ !true[ !new ZvMGxLCw().c9c6x()]]).bb1()] = !VR0L.jyHxz36V4P9F(); } public int MEhG7Y; public boolean MSspB; public void[] PkQC; } class MhPQv83u7 { public static void I4 (String[] iyb) throws XetKdg { boolean q2ghVzj23oTL2 = -null.VwZZxFRjk = !!!!new boolean[ new void[ yQg2().rBNr9x7_AFn_Hi][ -!D3L4kViOET().bPu2PgI()]].ne(); boolean[][][] rIY8r3hrR = ( !( false.MYnsEce1bo_)[ null.Qk6F9pdNW]).zWNmwEi() = !!!dAqpZDLps()[ !!!-null.eHwZwSBjRi()]; ; } public jMNZDxpGqyHyi yXxmv (boolean[][] YJuDmYOkK9v0bx) throws c8PDXGHPvmdzt { void u58 = true[ ( zJ5n.vstueJoJrAgF()).Ibe3EW()] = eJBlEfBaBY[ -true[ true.gBecLFu6RcU()]]; int rjwCw9OuIq_Ima = !new wXwbEkl().ndcnsPtPfUO = !this[ !!-this.Ho()]; !-null.xI4; if ( !!!-this._21A0kHDA) if ( -null.FOFRa4Iixdy0()) while ( this.cDn) if ( -!AWJ[ !new w1FkXgVZ4Ek7()[ -Yza6().LQL9b2()]]) ;else while ( new B1M1oA().xg7xbcvS()) while ( -qmmPyfAnajh6Z[ new xqpdw85DzLLqK[ !0853104.PRfgDzO].E67h0WdPO()]) if ( new boolean[ true[ new JGErR8mu().LVjwXoMaLo]].moOMAg8bGCuMt) if ( !-1.cqK()) ; return _r50Y3DGjd()[ ( ( Fp().RDPiysj).pUU3URq()).bdP42QNqlVv()]; while ( 52398228.LxN_JN3()) ; int[] xzGRGgBsH = new boolean[ --!-new void[ -!!new tM0().o4D74jwWg76eO][ true[ -X7uP8EkTBI().f34uM()]]][ !2046878.laYgkVGr()] = false.COwWnQ5bsge1Z; return; boolean[] u7D8MyVn4N; Px_pP[ false.Im_()]; if ( true.K) if ( !( !-null[ xniE20.zBMhvCm()]).R1k8I3x()) { return; } return; void VX = !739049424.W0Xc00JS24IYIK(); ; return !!!a5LPVI53x()[ null.AOBxW6JKAj21D]; gPqYcop8fB0[][] tyb; ; boolean[][][] Td3djmGsaSIwr = null.FZX_kEhh9r_3d = true[ this.Vk5NeVdG()]; PTeP7EXw1 KH = true._I(); ; } public void FUW (int[] ijkYRTe4c) { if ( false[ new xcP()[ --v5yET96fYa().xejjixca]]) if ( true[ --!1692.mN90Y9DYHX()]) { int ttMfzz; } wKeRCPjv3 n6PFWwUhMfy; { if ( true.vT()) ( !new int[ true[ new a().r()]].knTE)[ wSMkFJJ_hGHa.yALpZnQD2]; { if ( !203.iuHB3I0TuppGuh) if ( !!!B84kSamtdMIp[ new int[ oORkscU7()[ --!-!( --!--!this.TXzPtb1sF)[ true.pfHcuP47qM]]][ !!true.tscgnT]]) { M3j1Pu[][] R47zG2ypSF4ty; } } } boolean FfQfnB_OZfq7f; while ( ---!R_NrtV4L.pV52DVAjGEnn) { while ( ( null.VX).FJ3J1JRJ()) -new ovUoYT()[ -!( !-!this.MWxqrA35m).WTc7Z()]; } void[][] sBbnDL = 23761035[ new Cl3ZwKzLVgT2T[ 3839[ Z_6ti10WBK.Z1K7]].bU9SDkfw4SG8t()]; } public static void HfH8GGI (String[] pA) throws cnRc453 { while ( false[ -!this.whylSOhUAC()]) return; int Rxg7AQaImp3fh; R39TB[][] rRp43Uq3AWUxEW = AaG().fg1KFF5N5; !!41657516.lrlBVWtwL_W(); { _Wxyh6POxB l; while ( -true.FGOrlPJxd2()) { return; } ; -new boolean[ null[ !!!( 131[ W8FTT0().IcHxJb()])[ ( !!!-!-----true[ ( -Se().cDVzdrPIDb7BV).Ue0d()]).qH2()]]].MW; if ( -!-nqz4hGm6rH4()[ false[ !null.D1]]) while ( null.fup2bsgPgK5bs()) !!!!-!!!this[ -gCYtAI747u3().AvouT3K]; boolean s; boolean au_5QrE5_c; return; ( !this.Fpp()).A1yPPs3Hr9(); while ( -new aWCahD2uNn8Xa[ new boolean[ null[ null.RsdCzR0O83uCe()]][ true.jVV8r1kukHN]].z543AeW()) while ( --!false.q1tA8o()) if ( -( !this.WmN1_AZ()).Xg6i9PKWcmfFC) { XshwST0zgfDyn M6maun; } return; zLd_KLGfwzv eYXlTDGv_1gZ8j; !new boolean[ this.V()].Siw3PkS; OCYoIULBA2BK sYLuwkooGK2PrM; return; int Bg; ; if ( this.d()) { return; } } ; boolean[][][][][] B69ISulXs; rEPFR9HOQpft[][][][] hspa92tu460; } public boolean[] RubrFXqpcj4K () throws MCP { return ( -( new kQe5yZXuM26()[ -!-new boolean[ !!!true[ 18.D2]].kb1Z0tPXVrjsJ]).LytlgFEEj()).N5aF0rj_(); eq_5sgTAMJ6i[][] UGC36rq2QM = ( new T8f_4K[ ZoY6().l39W()].c())[ -!-new LSIHYC18tw().QjPAz()]; wI41 b; } public boolean[][] dRFFm2hF; public HkNWC4c57[] U (int CPEhTt5lyX_Iw, void[] On1E, int TzogaNruOm7, t[] E, lNakRRC[] iG, int[][] HsdeC) throws Pf26P { void Y; boolean[] v = !null.eyXLr1K52eYbG = -new OdC().N7hqqW82go4Zj1; sQcQ9[][][] K; void[] WrASNuqm6PRK2 = new int[ !--this.JOPZ5jVsthWW][ -null.qsy()]; --new boolean[ _UNt72oEz8zD8q[ -MrOplk[ !( !!!5265808.So5())[ true[ this.ddI2jvyvXK]]]]].K85(); int UP7RS; void vNdKGE3mPq = -!--true.yWjowoSv = vwTjr.EjQ8jBwn(); boolean gxWe; ; while ( --true[ false.jHkvHw6eCnatrj]) false.wm; boolean pa_KU = null.j(); int WyjxHZeeljqM; int gHkX = ( -false.Ka9osOb).HuUejgXa_v7 = !!-false.YWVqFhm1; xIE8 XqkfCXa8Kd8zfy = -( !new void[ G3cr8F().QXdUu5r6i31L()][ new EEOg()[ -true.M()]]).o() = true.dB_MO_b9Gmc(); while ( !false.miBEaY8y1()) return; boolean yTova = !-true[ --!pF().MGiVLz2illz7()]; boolean kT_Nmf_wO; } public OKdgGi_d1Ib i07hVK (boolean h2yoGqBVdnJ, N[] RuXSTp5) throws IJ4R0VZc59 { { void[] GE; ; while ( ---new uYn()[ !--1027922.tNV15b9Sh]) ; return; Pa2Og[] LAUdm; true.OhBPp43nZ; new _ktTzPpY4().d(); int aXDPoBzw54ayw; pcUxE8ttQRCM jczch04Dc9zDVq; M7LC5D1_TB6Rt5[] A7B525; if ( this.K9PZl) !( !-17631.phk()).cIx_CJ(); return; int q5a3rlQe6qqW; int[] ioXXHR; int[][] CQwKM; { return; } X9 LcE; boolean Xnjk; } QhV[] RN0_n8cR6t; int Y; int pl0n1vF6aMm; void[][] PdrruyamhaAC; { int[] uZtODh; void r42Ymhx; if ( this[ -null.xqNRR()]) while ( false.XZegCx) return; void nvwLZTibT8R9pB; return; O[][][] DEQNdyeuT; return; { while ( -!Z3g0L().ylKXN()) if ( -new QkJPFHA().Ka) { qZnKVfi_[][][][] WWo; } } } int[][] RcN18QUWKw = -( --!true.XmztQ4CO)[ !dWRT9F.c] = !!!-null.fiCkGByf(); } public int Ug8S; public static void w8JUllfu (String[] t797FLGoB) { ; ; L Rh2F; void[][][] se261s6 = ( !rTP[ this[ new vfOnXUIE().cenBW7FKgM8]]).JDuSXnEFdaQY = 350358942.WyeAuE7QrEe8D9(); { if ( this.ztE7P()) if ( Otkb2MALNkxy()[ new xLz()[ ( !true.cpBQJzPO)[ -new boolean[ new T[ -true.dSCRnnOGP75bW][ null.VXoMCA()]][ ( !!!-fAfl().xG())[ -!60.pEN2d]]]]]) ; true.sPluhUYNpI(); TSD1Eca59lMlN[] D2P8UjC; ; return; if ( null.fa) while ( this[ this.mN1L5oK()]) !!99.a9VOO9; } ; -!-true[ lMIVA[ -nIp6yFZvT().Fla]]; if ( !--wauAROPMLR()[ -ximUfCvA.tKiktI7d1]) Q2yxYpyWY[ IIr5ozv.Nb]; return R5sZL[ !( -!null.KPOQEjRTN2NAG()).OQS6()]; while ( !!!-!false[ new void[ false._5()].HYu44IVv3ZJLJ()]) if ( false.bcrzy) ; while ( null[ !WAcAedYmxjIF.sObyBo]) ; int wtgd1h5JKcq; } public int tPnZOfgApAe; }
[ "hello@philkrones.com" ]
hello@philkrones.com
8e016ce7998415483a47093a304e4cae9b63d290
4082835d52d668dfa6fce72bb97df156805bcd53
/src/com/javarush/test/level36/lesson04/home01/Model.java
ad21f9890c563ee2024a61f3197958e2650d1771
[]
no_license
Arkadiu/JavaRush
00cd04072fa1af70020d03510b9694f565423aec
c467f58c433b99a7374e11c60a83d30860ae866a
refs/heads/master
2021-06-25T18:14:15.204111
2017-04-17T18:32:06
2017-04-17T18:32:06
57,323,182
0
2
null
null
null
null
UTF-8
Java
false
false
295
java
package com.javarush.test.level36.lesson04.home01; import java.util.List; /** * Created by Администратор on 21.04.2016. */ public class Model { private Service service = new Service(); public List<String> getStringDataList() { return service.getData(); } }
[ "ntfs2002@gmail.com" ]
ntfs2002@gmail.com
80562860440bc5838557b24ad0963b7601b5d1c0
e3d35d1114bcdb5b9010f6781d25305f37426090
/Task 3.1C/Project_Task_3_1C/Task_3_1C/app/src/main/java/com/task_3_1c/MainActivity.java
9b6858b0f0ff6d0b78f71ccfaae9a685fc78c242
[]
no_license
agrawal2598/Task3.1C
3f5b2ef852e924965a907e8e4c9ad72a77432344
1cec593cc45a4429f7838ffccdab6b7322a4ee3d
refs/heads/main
2023-04-08T19:59:42.283850
2021-04-16T06:05:51
2021-04-16T06:05:51
356,270,172
0
0
null
null
null
null
UTF-8
Java
false
false
1,153
java
package com.task_3_1c; import android.content.Intent; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.AppCompatButton; import androidx.appcompat.widget.AppCompatEditText; import androidx.appcompat.widget.Toolbar; public class MainActivity extends AppCompatActivity { AppCompatButton btnStartQuiz; AppCompatEditText etEnterName; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); btnStartQuiz = findViewById(R.id.btnStart); etEnterName = findViewById(R.id.etEnterName); btnStartQuiz.setOnClickListener(v -> { if (etEnterName.getText().toString().isEmpty()) etEnterName.setError("Please Enter Your Name"); else { finish(); startActivity(new Intent(getApplicationContext(), QuizActivity.class).putExtra("Name",etEnterName.getText().toString())); } }); } }
[ "81298480+agrawal2598@users.noreply.github.com" ]
81298480+agrawal2598@users.noreply.github.com
19e903840149b921646d5c90451411c4d8f2bc67
e0003ea761b368a094fedbb844c0c73ec856a809
/src/main/java/com/services/impl/GaodeDataResolverImpl.java
6772e46da50c8070d9eaed9c45377972e8ed61fd
[]
no_license
eddypei/gaodePbf
0f84d9e1b7f74c56037e1c726a1a689547cc6a1e
3e78ebd321e400b1308a6cd4f5d8fbe3f49177f4
refs/heads/master
2020-07-05T16:28:34.190951
2018-07-05T01:22:15
2018-07-05T01:22:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
11,606
java
package com.services.impl; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.bean.*; import com.services.GaodeDataResolver; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.Comparator; import java.util.Hashtable; import java.util.Map; @Service public class GaodeDataResolverImpl implements GaodeDataResolver { private double[] resolutions = new double[]{156543.0339, 78271.516953125, 39135.7584765625, 19567.87923828125, 9783.939619140625, 4891.9698095703125, 2445.9849047851562, 1222.9924523925781, 611.4962261962891, 305.74811309814453, 152.87405654907226, 76.43702827453613, 38.218514137268066, 19.109257068634033, 9.554628534317016, 4.777314267158508, 2.388657133579254, 1.194328566789627, 0.5971642833948135}; private GaoDeMapUtil util = null; public GaodeDataResolverImpl() { util = new GaoDeMapUtil(this.resolutions); } public final String ToJson(Object obj) { return com.alibaba.fastjson.JSON.toJSONString(obj); } static Map<String, String> roadMap = new Hashtable<String, String>(); static Map<String, String> regionMap = new Hashtable<>(); public static String getRegionCatagroy(Object code){ if(regionMap.containsKey(code)){ return regionMap.get(code); } return null; } public static String getRoadCatagroy(Object code){ if(roadMap.containsKey(code)){ return roadMap.get(code); } return null; } static { roadMap.put("roads:guideBoards", "道路标牌"); roadMap.put("roads:roadsBeingBuilt", "在建道路"); roadMap.put("roads:railway", "铁路"); roadMap.put("roads:highWay", "高速公路"); roadMap.put("roads:highSpeedRailway", "高铁"); roadMap.put("roads:nationalRoad", "国道"); roadMap.put("roads:ringRoad", "城市环线"); roadMap.put("roads:subway", "地铁"); roadMap.put("roads:secondaryRoad", "二级公路"); roadMap.put("roads:levelThreeRoad", "三级公路"); roadMap.put("roads:provincialRoad", "省道"); roadMap.put("roads:other", "其他线路"); roadMap.put("roads:levelFourRoad", "四级公路"); roadMap.put("roads:subwayBeingBuilt", "在建地铁"); roadMap.put("roads:overPass", "天桥"); roadMap.put("roads:underPass", "地道"); regionMap.put("", "陆地"); regionMap.put("regions:green", "绿地"); regionMap.put("regions:edu", "教育体育"); regionMap.put("regions:public", "公共设施"); regionMap.put("regions:traffic", "交通枢纽"); regionMap.put("regions:scenicSpot", "景区"); regionMap.put("regions:culture", "文化"); regionMap.put("regions:health", "医疗卫生"); regionMap.put("regions:sports", "运动场所"); regionMap.put("regions:business", "商业场所"); regionMap.put("regions:parkingLot", "停车场"); regionMap.put("regions:subway", "地铁设施"); regionMap.put("water","水系"); } public JSONObject covertGaodeToNPGIS(String result, int zoom, int row, int col) { GaoDeRoad gaodeRoad = null; GaoDeImg gaodeImg = null; XYZ xyz = new XYZ(); xyz.setZ(zoom); xyz.setX(row); xyz.setY(col); Pix lp = util.getPixPosition(0, 0, zoom, col, row); gaodeRoad = new GaoDeRoad(); gaodeRoad.setKey(zoom + "_" + row + "_" + col + "_region,building,road"); gaodeRoad.setXyz(xyz); gaodeImg = new GaoDeImg(); gaodeImg.setKey(zoom + "_" + row + "_" + col); gaodeImg.setXyz(xyz); if (!DotNetToJavaStringHelper.isNullOrEmpty(result)) { String[] c = result.split("\\|"); for (String r : c) { if (r == null || r.equals("")) { continue; } JSONArray g = null; try { g = com.alibaba.fastjson.JSON.parseArray(r); } catch (Exception e) { } if (g != null && g.size() > 0) { String[] l = g.get(0).toString().split("-"); String m = l[3]; ArrayList<JSONObject> data = new ArrayList<JSONObject>(); ArrayList<GaoDeLabel> labelData = new ArrayList<GaoDeLabel>(); GaoDeMapUtil h = util; for (int j = g.size() - 1; j >= 1; j--) { JSONArray p = (JSONArray) ((g.get(j) instanceof JSONArray) ? g.get(j) : null); switch (m) { case "road": h.roadLine(data, p, m, j - 1); break; case "region": h.region(data, p, m); break; case "building": h.building(data, p, m); break; case "poilabel": case "roadlabel": String[] s = null; String fillStyle = null; String strokeStyle = null; String icon = null; if (p.get(1) != null) { s = p.get(1).toString().split("[&]", -1); fillStyle = h.getRgb(s[2]); strokeStyle = h.getRgb(s[3]); icon = s[0]; } else { continue; } JSONArray pk = (JSONArray) ((p.get(0) instanceof JSONArray) ? p.get(0) : null); Object labels = p.get(m.equals("roadlabel") ? 3 : 4); for (int k = 0; k < pk.size(); k++) { JSONArray w = (JSONArray) ((pk.get(k) instanceof JSONArray) ? pk.get(k) : null); GaoDeLabel O = h.poiFill(w, l); O.setFontSize(s[1]); O.setPoiType(p.get(m.equals("roadlabel") ? 4 : 6)); O.setLabels(labels); if (!"roadlabel".equals(m.toString()) && "labels:pois".equals(labels.toString())) { O.setCode(p.get(5)); } else { String temp = ""; switch (labels.toString()) { case "labels:city": temp = "城市"; break; case "labels:aois": temp = "区域标注"; break; case "labels:district": temp = "区县"; break; case "labels:town": temp = "乡镇"; break; case "labels:village": temp = "村庄"; break; case "water": temp = "水系"; break; default: if (roadMap.containsKey(labels.toString())) { temp = roadMap.get(labels.toString()); } break; } O.setCode(labels); O.setCatagroy(temp); } O.setfillStyle(fillStyle); O.setStrokeStyle(strokeStyle); h.poiLabelIcon(w, O, icon, s); if (m.equals("poilabel") && !s[4].equals("")) { O.setBgColor(h.getRgb(s[4])); } labelData.add(O); } // break; } } if (m.equals("road") || m.equals("region") || m.equals("building")) { data.sort(new Comparator<JSONObject>() { @Override public int compare(JSONObject o1, JSONObject o2) { return o1.getDouble("rank") - o2.getDouble("rank") > 0 ? 1 : 0; //return 1;//x.rank - y.rank; } }); switch (m) { case "road": gaodeRoad.setRoad(data); break; case "region": gaodeRoad.setRegion(data); break; case "building": gaodeRoad.setBuilding(data); break; } } else if (m.equals("poilabel") || m.equals("roadlabel")) { if (m.equals("poilabel")) { gaodeImg.setPoilabel(labelData); } else { gaodeImg.setRoadlabel(labelData); } } } } } JSONObject obj = new JSONObject(); JSONObject limg = new JSONObject(); JSONObject region_building_road = new JSONObject(); limg.put("poilabel", this.ToJson(gaodeImg.getPoilabel())); limg.put("roadlabel", this.ToJson(gaodeImg.getRoadlabel())); region_building_road.put("building", this.ToJson(gaodeRoad.getBuilding())); region_building_road.put("region", this.ToJson(gaodeRoad.getRegion())); region_building_road.put("road", this.ToJson(gaodeRoad.getRoad())); obj.put("limg", limg); obj.put("region_building_road", region_building_road); return obj; } }
[ "ssjylsg@126.com" ]
ssjylsg@126.com
5bf9945858da8a2fb7dfcd6e0ddc71fc0ae08f2b
08047f920fa0dde9b865e0557b09da0075b8774b
/simple-registration-app/src/main/java/eg/com/unifonic/assignment/aop/aspect/UserRegistrationAppAspect.java
ddc455c1c2c7262206a13037dc5d8667a029c01c
[]
no_license
manargalal/SimpleRegistrationForm
25962466e08cd0e86b2e15751c2c39006547ad9f
b965b473cde7e743c604b263f8b117ef5db3937e
refs/heads/master
2022-03-24T03:04:11.414612
2019-12-18T10:24:10
2019-12-18T10:24:10
198,036,986
0
0
null
null
null
null
UTF-8
Java
false
false
5,302
java
package eg.com.unifonic.assignment.aop.aspect; import java.util.Arrays; import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.util.StopWatch; public class UserRegistrationAppAspect { Logger log = LoggerFactory.getLogger(this.getClass()); @Pointcut("within(@org.springframework.web.bind.annotation.RestController *)") public void controller() { } @Pointcut("execution(* *.*(..))") protected void allMethod() { } @Pointcut("execution(public * *(..))") protected void loggingPublicOperation() { } @Pointcut("execution(* *.*(..))") protected void loggingAllOperation() { } @Pointcut("within(eg.com.redshift.doctorhome.*)") private void logAnyFunctionWithinResource() { } //before -> Any resource annotated with @Controller annotation //and all method and function taking HttpServletRequest as first parameter @Before("controller() && allMethod()") public void logBefore(JoinPoint joinPoint) { log.debug("Entering in Method : " + joinPoint.getSignature().getName()); log.debug("Class Name : " + joinPoint.getSignature().getDeclaringTypeName()); log.debug("Arguments : " + Arrays.toString(joinPoint.getArgs())); log.debug("Target class : " + joinPoint.getTarget().getClass().getName()); } //After -> All method within resource annotated with @Controller annotation // and return a value @AfterReturning(pointcut = "controller() && allMethod()", returning = "result") public void logAfter(JoinPoint joinPoint, Object result) { String returnValue = this.getValue(result); log.debug("Method Return value : " + returnValue); } //After -> Any method within resource annotated with @Controller annotation // throws an exception ...Log it @AfterThrowing(pointcut = "execution(* eg.com.unifonic.assignment.exception.UserRegistartionExceptionHandler.handleUserRegistrationException(..))", throwing = "exception") public void logAfterThrowing(JoinPoint joinPoint, Throwable exception) { log.error("An exception has been thrown in " + joinPoint.getSignature().getName() + " ()"); log.error("Cause : " + exception.getCause()); } //Around -> Any method within resource annotated with @Controller annotation @Around("controller() && allMethod()") public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable { long start = System.currentTimeMillis(); try { String className = joinPoint.getSignature().getDeclaringTypeName(); String methodName = joinPoint.getSignature().getName(); Object result = joinPoint.proceed(); long elapsedTime = System.currentTimeMillis() - start; log.debug("Method " + className + "." + methodName + " ()" + " execution time : " + elapsedTime + " ms"); return result; } catch (IllegalArgumentException e) { log.error("Illegal argument " + Arrays.toString(joinPoint.getArgs()) + " in " + joinPoint.getSignature().getName() + "()"); throw e; } } @Around("execution(* eg.com.unifonic.assignment.*.**(..))") public Object logMethod(ProceedingJoinPoint joinPoint) throws Throwable{ final Logger logger = LoggerFactory.getLogger(joinPoint.getTarget().getClass().getName()); Object retVal = null; try { StringBuffer startMessageStringBuffer = new StringBuffer(); startMessageStringBuffer.append("Start method "); startMessageStringBuffer.append(joinPoint.getSignature().getName()); startMessageStringBuffer.append("("); Object[] args = joinPoint.getArgs(); for (int i = 0; i < args.length; i++) { startMessageStringBuffer.append(args[i]).append(","); } if (args.length > 0) { startMessageStringBuffer.deleteCharAt(startMessageStringBuffer.length() - 1); } startMessageStringBuffer.append(")"); logger.debug(startMessageStringBuffer.toString()); StopWatch stopWatch = new StopWatch(); stopWatch.start(); retVal = joinPoint.proceed(); stopWatch.stop(); StringBuffer endMessageStringBuffer = new StringBuffer(); endMessageStringBuffer.append("Finish method "); endMessageStringBuffer.append(joinPoint.getSignature().getName()); endMessageStringBuffer.append("(..); in : "+joinPoint.getSignature().getDeclaringTypeName()); endMessageStringBuffer.append("execution time: "); endMessageStringBuffer.append(stopWatch.getTotalTimeMillis()); endMessageStringBuffer.append(" ms;"); logger.debug(endMessageStringBuffer.toString()); } catch (Throwable ex) { StringBuffer errorMessageStringBuffer = new StringBuffer(); // Create error message logger.error(errorMessageStringBuffer.toString(), ex); throw ex; } return retVal; } private String getValue(Object result) { String returnValue = null; if (null != result) { if (result.toString().endsWith("@" + Integer.toHexString(result.hashCode()))) { returnValue = ReflectionToStringBuilder.toString(result); } else { returnValue = result.toString(); } } return returnValue; } }
[ "manar.anan@beetleware.com" ]
manar.anan@beetleware.com
99b4a8b1bd22f295745266693c61a8e9ea8c6053
e31d6ea59cb574e7981aa7b31d1c8b56d08e989e
/tree/MaxPathSum.java
c56be8c9b4e06283624be9d66c3197e0d079c65c
[]
no_license
wuzhuang0/algorithm
303df16dd82bec05b2d6b237a140705aa9ee83dc
d2e8d5d9e7e24105a3f5c0dccf65f90ed3d15e0d
refs/heads/master
2022-12-20T04:03:24.842068
2020-09-28T03:54:02
2020-09-28T03:54:02
290,748,556
0
0
null
2020-08-27T10:41:18
2020-08-27T10:41:18
null
UTF-8
Java
false
false
376
java
/** * @Description: leetcode 124 给定一个二叉树,返回最大路径和 * 路径被定义为一条从树中任意节点出发,沿父节点-子节点连接,达到任意节点的序列。该路径至少包含一个节点,且不一定经过根节点 * @Author: wz */ public class MaxPathSum { public int maxPathSum(TreeNode root) { return 0; } }
[ "935212650@qq.com" ]
935212650@qq.com
2bf3a77eca40e0d73505d96a3a96fb354bd2ea0a
a5e51767d0f67ae13ed13c03b8822817ba4b0167
/src/de/bsd/zwitscher/MultiSelectListActivity.java
0b9f5d82f076df53f24e86c5c7051e5249793fb0
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
annamharikrishna01/ZwitscherA
c47fce5bd887c875666f0ddec0ebcfc9b4884b73
55c501a1a08bc648ee561263fb9497a8c71a57a7
refs/heads/master
2020-12-25T04:35:46.135880
2013-07-26T07:36:52
2013-07-26T07:36:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,177
java
package de.bsd.zwitscher; import android.app.ListActivity; import android.content.Intent; import android.os.Bundle; import android.util.SparseBooleanArray; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import java.util.List; /** * Show a list with multiple items where the * user can select some from * * @author Heiko W. Rupp */ public class MultiSelectListActivity extends ListActivity implements AdapterView.OnItemClickListener { private String mode; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle bundle = getIntent().getExtras(); List<String> data = bundle.getStringArrayList("data"); boolean[] checked = bundle.getBooleanArray("checked"); mode = bundle.getString("mode"); final ListView listView = getListView(); if (mode.equals("single")) { setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_single_choice, data)); listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE); listView.setOnItemClickListener(this); } else { Button okButton = new Button(this); okButton.setText("ok"); okButton.setEnabled(true); okButton.setVisibility(View.VISIBLE); okButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { SparseBooleanArray positions = getListView().getCheckedItemPositions(); int count = getListView().getCheckedItemCount(); long[] items = new long[count]; int pos = 0; for (int i = 0; i < getListView().getCount(); i++) { if (positions.get(i)) items[pos++] = i; } Intent intent = prepareReturnedIntent(); intent.putExtra("data", items); finish(); } }); listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); listView.addFooterView(okButton); // Needs to be called before setAdapter setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_multiple_choice, data)); for (int i = 0; i < checked.length; i++) { getListView().setItemChecked(i,checked[i]); // does not check } } listView.setItemsCanFocus(false); } public void onItemClick(AdapterView<?> parent, View view, int position, long id) { ListView listView = getListView(); String item = (String) listView.getItemAtPosition(position); Intent intent = prepareReturnedIntent(); intent.putExtra("data", item); finish(); } private Intent prepareReturnedIntent() { Intent intent = new Intent(); intent.putExtra("mode",mode); setResult(RESULT_OK,intent); return intent; } }
[ "hwr@pilhuhn.de" ]
hwr@pilhuhn.de
d6792233af50421b862fe22b4e3e178f9f79ff9a
7de840e11447e9784f63c4281b03e93d8cf69457
/oneVRE/Web/Services/IoComService/src/main/java/com/googlecode/onevre/web/IoComService/IoComService.java
9a9d07a10e322b0a86db40a447589e5a73497c1e
[ "BSD-2-Clause" ]
permissive
rowleya/onevre
553cedc7e868ae399608676310fd5274b7465ece
4e6a6de560a8f4feea60e2e0010471c749fe8a6f
refs/heads/master
2016-09-05T23:34:29.889486
2011-02-21T16:04:26
2011-02-21T16:04:26
32,145,754
0
0
null
null
null
null
UTF-8
Java
false
false
8,805
java
/* * @(#)InSorsService.java * Created: 11-Oct-2007 * Version: 1.0 * Copyright (c) 2005-2006, University of Manchester All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. Redistributions in binary * form must reproduce the above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or other materials * provided with the distribution. Neither the name of the University of * Manchester nor the names of its contributors may be used to endorse or * promote products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ package com.googlecode.onevre.web.IoComService; import java.io.FileOutputStream; import java.io.InputStream; import java.net.Authenticator; import java.net.HttpURLConnection; import java.net.PasswordAuthentication; import java.net.URL; import com.googlecode.onevre.ag.types.Capability; import com.googlecode.onevre.ag.types.StreamDescription; import com.googlecode.onevre.ag.types.network.NetworkLocation; import com.googlecode.onevre.ag.types.server.AGService; import com.googlecode.onevre.ag.types.service.parameter.TextParameter; import com.googlecode.onevre.platform.SystemConfig; /** * An AG3 Service for using IoCom software * * @author Anja Le Blanc * @version 1.0 * */ public class IoComService extends AGService { private static final int BUFFER_SIZE = 8096; private static final String H261 = "H261"; private static final String L16 = "L16"; private static final String L8 = "L8"; private static final String PCMU = "PCMU"; private static final Capability[] CAPABILITY = new Capability[] { new Capability(Capability.CONSUMER, Capability.AUDIO, L16, 16000, 1), new Capability(Capability.CONSUMER, Capability.AUDIO, L16, 8000, 1), new Capability(Capability.CONSUMER, Capability.AUDIO, L8, 16000, 1), new Capability(Capability.CONSUMER, Capability.AUDIO, L8, 8000, 1), new Capability(Capability.CONSUMER, Capability.AUDIO, PCMU, 16000, 1), new Capability(Capability.CONSUMER, Capability.AUDIO, PCMU, 8000, 1), new Capability(Capability.PRODUCER, Capability.AUDIO, PCMU, 16000, 1), new Capability(Capability.CONSUMER, Capability.VIDEO, H261, 90000, 1), new Capability(Capability.PRODUCER, Capability.VIDEO, H261, 90000, 1)}; private TextParameter igClient = new TextParameter("IG Client", "C:\\Program Files\\inSORS\\IGClient.exe"); private TextParameter iocomServer = new TextParameter("IoCom Server", ""); private TextParameter username = new TextParameter("Username", ""); private TextParameter password = new TextParameter("Password", ""); private boolean started = false; private boolean inSorsLaunched = false; private StreamDescription audioDescription = null; private StreamDescription videoDescription = null; private Process process = null; /** * Creates a new AudioService * */ public IoComService() { System.err.println("InSorsService construced"); for (int i = 0; i < CAPABILITY.length; i++) { addCapability(CAPABILITY[i]); } setIdentity(null); addConfigurationOption(iocomServer); addConfigurationOption(username); addConfigurationOption(password); } /** * * @see com.googlecode.onevre.ag.types.server.AGService#deallocate() */ public void deallocate() { // Does Nothing } /** * * @see com.googlecode.onevre.ag.types.server.AGService#isStarted() */ public boolean isStarted() { return started; } /** * Configure the service according to the StreamDescription, and stop and * start rat * * @param description * description of the stream (StreamDescription) */ public void setStream(StreamDescription description) { Capability cap = this.configureStream(description); if (cap != null) { if (cap.getType().equals(Capability.AUDIO)) { audioDescription = description; } else if (cap.getType().equals(Capability.VIDEO)) { videoDescription = description; } } // if started stop if (isStarted()) { stop(); } if (isEnabled()) { start(); } } /** * Start service */ public void start() { if (!inSorsLaunched) { if ((audioDescription != null) && (videoDescription != null)) { if (iocomServer.getValue().equals("") || username.getValue().equals("") || password.getValue().equals("")) { System.err.println("Missing configuration for service"); } else { try { Authenticator.setDefault(new Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication( (String) username.getValue(), ((String) password.getValue()).toCharArray()); } }); NetworkLocation videoLocation = videoDescription.getLocation(); NetworkLocation audioLocation = audioDescription.getLocation(); String startupfile = SystemConfig.getInstance().getTempDir() + "/" + "IoCom_" + System.currentTimeMillis() + ".igv"; String server = (String) iocomServer.getValue(); server += "?MMDS=\"Multicast%20Connect\"" + "&MBVIP=" + videoLocation.getHost() + "&MBVP=" + videoLocation.getPort() + "&MBAIP=" + audioLocation.getHost() + "&MBAP=" + audioLocation.getPort(); URL url = new URL(server); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); InputStream inputStream = connection.getInputStream(); FileOutputStream outputStream = new FileOutputStream(startupfile); byte[] data = new byte[BUFFER_SIZE]; int bytesRead = inputStream.read(data); while (bytesRead != -1) { outputStream.write(data, 0, bytesRead); bytesRead = inputStream.read(data); } outputStream.close(); inputStream.close(); process = Runtime.getRuntime().exec(new String[]{ "\"" + igClient.getValue() + "\"", "\"" + startupfile + "\""}); inSorsLaunched = true; } catch (Exception e) { e.printStackTrace(); } } } } } /** * * @see com.googlecode.onevre.ag.types.server.AGService#stop() */ public void stop() { if (inSorsLaunched) { process.destroy(); inSorsLaunched = false; } } }
[ "ts23gm@ff34145c-7872-3b35-6561-e9169588922b" ]
ts23gm@ff34145c-7872-3b35-6561-e9169588922b
f9c10286e22da0acaf88ba696aa89aabd3be94e2
440c0e2923f3734cb4e536f715d8dcb3f4b9c9b6
/titan2-everett-master/src/main/java/frc/robot/subsystems/Riser.java
68960af78151e9cd22c0f31c76ca2cee415d24f8
[]
no_license
Sagecoyote77/titan2-everett2
51855767e7fde8ec151a607153ad27d6e39f814a
5115abc0e15f226a824d3a03623ae4704abf9cc3
refs/heads/main
2023-03-20T23:00:09.833939
2021-03-16T19:05:59
2021-03-16T19:05:59
332,862,770
1
0
null
null
null
null
UTF-8
Java
false
false
498
java
package frc.robot.subsystems; import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj.Jaguar; import edu.wpi.first.wpilibj.SpeedControllerGroup; import frc.robot.Constants; public class Riser extends SubsystemBase{ public Jaguar elevatorUpMotor; public SpeedControllerGroup elevating; public Riser() { elevatorUpMotor = new Jaguar(Constants.PWDConstants.ELEVATORUP); elevating = new SpeedControllerGroup(elevatorUpMotor); } }
[ "charliemendes@msn.com" ]
charliemendes@msn.com
1fa98dc67578d3f8bae9e9ce62c0ef2ecc31a97d
1882e6f69b689d804559cdf956e3968ccfa42bd0
/Meal_Management_System/src/meal_management_system/Meal_Management_System.java
bf7927eebcbf963aaa3a581c0b81438cde1fa6b4
[]
no_license
3-Shamim/JavaRawCode
7bfef1e8c491ff7dded353ff3260cfa72ba16e10
e08c1cb449909a588bfa9df0033b099d996a1c63
refs/heads/master
2021-07-18T19:36:01.870286
2017-10-27T12:03:17
2017-10-27T12:03:17
108,540,570
1
0
null
null
null
null
UTF-8
Java
false
false
1,050
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 meal_management_system; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.image.Image; import javafx.stage.Stage; import javafx.stage.StageStyle; /** * * @author MD SHAMIM */ public class Meal_Management_System extends Application { @Override public void start(Stage stage) throws Exception { Parent root = FXMLLoader.load(getClass().getResource("SplashScreen.fxml")); Scene scene = new Scene(root); stage.setScene(scene); stage.initStyle(StageStyle.UNDECORATED); stage.setTitle("Meal Management System"); stage.show(); } /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } }
[ "mdshamim723@gmail.com" ]
mdshamim723@gmail.com
4f757023f207f95d8f87be34e515b7238f5a5a4a
dfe5caf190661c003619bfe7a7944c527c917ee4
/src/main/java/com/vmware/vim25/AnswerFile.java
8e8fed71f0c8f474a33262643ed0bcdd2cd74284
[ "BSD-3-Clause" ]
permissive
timtasse/vijava
c9787f9f9b3116a01f70a89d6ea29cc4f6dc3cd0
5d75bc0bd212534d44f78e5a287abf3f909a2e8e
refs/heads/master
2023-06-01T08:20:39.601418
2022-10-31T12:43:24
2022-10-31T12:43:24
150,118,529
4
1
BSD-3-Clause
2023-05-01T21:19:53
2018-09-24T14:46:15
Java
UTF-8
Java
false
false
2,505
java
/*================================================================================ Copyright (c) 2013 Steve Jin. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of VMware, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================================================*/ package com.vmware.vim25; import java.util.Calendar; /** * @author Steve Jin (http://www.doublecloud.org) * @version 5.1 */ @SuppressWarnings("all") public class AnswerFile extends DynamicData { public ProfileDeferredPolicyOptionParameter[] userInput; public Calendar createdTime; public Calendar modifiedTime; public ProfileDeferredPolicyOptionParameter[] getUserInput() { return this.userInput; } public Calendar getCreatedTime() { return this.createdTime; } public Calendar getModifiedTime() { return this.modifiedTime; } public void setUserInput(ProfileDeferredPolicyOptionParameter[] userInput) { this.userInput=userInput; } public void setCreatedTime(Calendar createdTime) { this.createdTime=createdTime; } public void setModifiedTime(Calendar modifiedTime) { this.modifiedTime=modifiedTime; } }
[ "stefan.dilk@freenet.ag" ]
stefan.dilk@freenet.ag
9b5b32e6593a8cabadb9f8b5c356c080529e4c14
421f0a75a6b62c5af62f89595be61f406328113b
/generated_tests/model_seeding/89_jiggler-jigl.image.types.InterpolatedGrayImage-1.0-6/jigl/image/types/InterpolatedGrayImage_ESTest.java
973218d8d8ad0fa322156178df3b3cfc58287b40
[]
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
664
java
/* * This file was automatically generated by EvoSuite * Fri Oct 25 21:42:26 GMT 2019 */ package jigl.image.types; 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 InterpolatedGrayImage_ESTest extends InterpolatedGrayImage_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pderakhshanfar@bsr01.win.tue.nl" ]
pderakhshanfar@bsr01.win.tue.nl
367a61843a9a0289f96893b816cdbbfdaf794458
492ab60eaa5619551af16c79c569bdb704b4d231
/src/net/sourceforge/plantuml/code/Transcoder.java
6c33d27d72d1fcb65d4c2b7bd3cd73caa5042e1c
[]
no_license
ddcjackm/plantuml
36b89d07401993f6cbb109c955db4ab10a47ac78
4638f93975a0af9374cec8200d16e1fa180dafc2
refs/heads/master
2021-01-12T22:34:56.588483
2016-07-25T19:25:28
2016-07-25T19:25:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,447
java
/* ======================================================================== * PlantUML : a free UML diagram generator * ======================================================================== * * (C) Copyright 2009-2017, Arnaud Roques * * Project Info: http://plantuml.com * * This file is part of PlantUML. * * PlantUML is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * PlantUML distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. * * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * Original Author: Arnaud Roques * * Revision $Revision: 19109 $ * */ package net.sourceforge.plantuml.code; import java.io.IOException; public interface Transcoder { public String encode(String text) throws IOException; public String decode(String code) throws IOException; }
[ "plantuml@gmail.com" ]
plantuml@gmail.com
a7571131213410b4fd87e29b3f196842e6ec1951
50b56568d6d31140464ce645228ade7fa08f5c22
/src/test/java/org/wildfly/util/xml/to/cli/subsystem/SimpleSubsystemRemove.java
1088f2cf5de2edb39b1234e10d30f09a6c92d922
[]
no_license
kabir/wildfly-xml-to-cli
916b67e66fa1470fd647e38e42274f87a3c5ede5
a228f950027234203dcc9412d1be1d4f412a9e01
refs/heads/master
2022-09-28T15:32:45.690412
2019-07-22T19:47:11
2019-07-23T07:14:01
197,612,383
0
0
null
2022-09-02T21:15:24
2019-07-18T15:23:28
Java
UTF-8
Java
false
false
896
java
package org.wildfly.util.xml.to.cli.subsystem; import org.jboss.as.controller.AbstractRemoveStepHandler; import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationFailedException; import org.jboss.dmr.ModelNode; import org.jboss.logging.Logger; /** * Handler responsible for adding the subsystem resource to the model * * @author <a href="kabir.khan@jboss.com">Kabir Khan</a> */ class SimpleSubsystemRemove extends AbstractRemoveStepHandler { static final SimpleSubsystemRemove INSTANCE = new SimpleSubsystemRemove(); private final Logger log = Logger.getLogger(SimpleSubsystemRemove.class); private SimpleSubsystemRemove() { } @Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { super.performRuntime(context, operation, model); } }
[ "kkhan@redhat.com" ]
kkhan@redhat.com
25205d29523089330f3e55bdfb2419f9b5ce3742
b29afb6e32701bfc5b816bc92fe7383acc4b4b8e
/Account-prize-checker/src/main/java/com/adonayg/util/PrizeChecker.java
af37f302a4f6c17a31a9ef3463768046ac2724b2
[]
no_license
Adonayg/Microservices
bbfb52007f4aaae95e18244c9edcc386fa07c2a5
665fdd9369187702a98c7ce1fce2cf59e88a2408
refs/heads/master
2020-04-09T05:01:02.645373
2019-02-14T18:53:05
2019-02-14T18:53:05
160,047,378
0
0
null
2019-02-14T18:53:06
2018-12-02T12:57:27
Java
UTF-8
Java
false
false
865
java
package com.adonayg.util; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import com.adonayg.domain.Prize; @Component public class PrizeChecker { @Value("${prize.base}") private int basePrize; @Value("${prize.multiplier}") private int multiplier; @Value("${message.win}") private String winMessage; @Value("${message.lose}") private String loseMessage; public Prize checkPrize(String accountNumber) { String letter = accountNumber.substring(0, 1); switch (letter) { case PrizeConstants.basePrize: return new Prize(winMessage + String.valueOf(basePrize), true); case PrizeConstants.multiplierPrize: return new Prize(winMessage + String.valueOf(multiplier * basePrize), true); default: return new Prize(loseMessage, false); } } }
[ "adonay@tutanota.com" ]
adonay@tutanota.com
1bffa96438b806aa7dbbb1f7e9661ae7088ec5b2
705dfdc5147fc433be370e41a8cdc026fdffcfd8
/src/main/java/cn/jsfund/devtools/service/impl/EventGroupServiceImpl.java
9698e81bab25be6ef5e04c1c3d94801189062b30
[ "Apache-2.0" ]
permissive
hutx/devtools
7bda4756f8d146afbc6e01102dfb2902cd6dbc35
bb8700230733fdad9ff215bb0473415189c40f95
refs/heads/mybatis_plus
2022-11-07T20:45:53.528352
2019-10-15T09:40:27
2019-10-15T09:40:27
215,231,697
0
0
Apache-2.0
2022-10-12T20:32:46
2019-10-15T07:12:37
JavaScript
UTF-8
Java
false
false
532
java
package cn.jsfund.devtools.service.impl; import cn.jsfund.devtools.entity.EventGroup; import cn.jsfund.devtools.mapper.EventGroupMapper; import cn.jsfund.devtools.service.IEventGroupService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; /** * <p> * 事件分组 服务实现类 * </p> * * @author hutx * @since 2019-01-05 */ @Service public class EventGroupServiceImpl extends ServiceImpl<EventGroupMapper, EventGroup> implements IEventGroupService { }
[ "tianxin@live.cn" ]
tianxin@live.cn
36ab14f092dbd428881e1ede888080e36fd922cf
ffeaf567e9b1aadb4c00d95cd3df4e6484f36dcd
/Hotgram/org/ocpsoft/prettytime/i18n/Resources_ca.java
640f26a2ccaa08fd147b50aefcc52d634e3ff12b
[]
no_license
danielperez9430/Third-party-Telegram-Apps-Spy
dfe541290c8512ca366e401aedf5cc5bfcaa6c3e
f6fc0f9c677bd5d5cd3585790b033094c2f0226d
refs/heads/master
2020-04-11T23:26:06.025903
2018-12-18T10:07:20
2018-12-18T10:07:20
162,166,647
0
0
null
null
null
null
UTF-8
Java
false
false
4,308
java
package org.ocpsoft.prettytime.i18n; import java.util.ListResourceBundle; public class Resources_ca extends ListResourceBundle { private static final Object[][] a; static { Resources_ca.a = new Object[][]{new Object[]{"CenturyPattern", "%n %u"}, new Object[]{"CenturyFuturePrefix", "d\'aquí a "}, new Object[]{"CenturyFutureSuffix", ""}, new Object[]{"CenturyPastPrefix", "fa "}, new Object[]{"CenturyPastSuffix", ""}, new Object[]{"CenturySingularName", "segle"}, new Object[]{"CenturyPluralName", "segles"}, new Object[]{"DayPattern", "%n %u"}, new Object[]{"DayFuturePrefix", "d\'aquí a "}, new Object[]{"DayFutureSuffix", ""}, new Object[]{"DayPastPrefix", "fa "}, new Object[]{"DayPastSuffix", ""}, new Object[]{"DaySingularName", "dia"}, new Object[]{"DayPluralName", "dies"}, new Object[]{"DecadePattern", "%n %u"}, new Object[]{"DecadeFuturePrefix", "d\'aquí a "}, new Object[]{"DecadeFutureSuffix", ""}, new Object[]{"DecadePastPrefix", "fa "}, new Object[]{"DecadePastSuffix", ""}, new Object[]{"DecadeSingularName", "deseni"}, new Object[]{"DecadePluralName", "desenis"}, new Object[]{"HourPattern", "%n %u"}, new Object[]{"HourFuturePrefix", "d\'aquí a "}, new Object[]{"HourFutureSuffix", ""}, new Object[]{"HourPastPrefix", "fa "}, new Object[]{"HourPastSuffix", ""}, new Object[]{"HourSingularName", "hora"}, new Object[]{"HourPluralName", "hores"}, new Object[]{"JustNowPattern", "%u"}, new Object[]{"JustNowFuturePrefix", ""}, new Object[]{"JustNowFutureSuffix", "en un instant"}, new Object[]{"JustNowPastPrefix", "fa uns instants"}, new Object[]{"JustNowPastSuffix", ""}, new Object[]{"JustNowSingularName", ""}, new Object[]{"JustNowPluralName", ""}, new Object[]{"MillenniumPattern", "%n %u"}, new Object[]{"MillenniumFuturePrefix", "d\'aquí a "}, new Object[]{"MillenniumFutureSuffix", ""}, new Object[]{"MillenniumPastPrefix", "fa "}, new Object[]{"MillenniumPastSuffix", ""}, new Object[]{"MillenniumSingularName", "mileni"}, new Object[]{"MillenniumPluralName", "milenis"}, new Object[]{"MillisecondPattern", "%n %u"}, new Object[]{"MillisecondFuturePrefix", "d\'aquí a "}, new Object[]{"MillisecondFutureSuffix", ""}, new Object[]{"MillisecondPastPrefix", "fa "}, new Object[]{"MillisecondPastSuffix", ""}, new Object[]{"MillisecondSingularName", "mil·lisegon"}, new Object[]{"MillisecondPluralName", "mil·lisegons"}, new Object[]{"MinutePattern", "%n %u"}, new Object[]{"MinuteFuturePrefix", "d\'aquí a "}, new Object[]{"MinuteFutureSuffix", ""}, new Object[]{"MinutePastPrefix", "fa "}, new Object[]{"MinutePastSuffix", ""}, new Object[]{"MinuteSingularName", "minut"}, new Object[]{"MinutePluralName", "minuts"}, new Object[]{"MonthPattern", "%n %u"}, new Object[]{"MonthFuturePrefix", "d\'aquí a "}, new Object[]{"MonthFutureSuffix", ""}, new Object[]{"MonthPastPrefix", "fa "}, new Object[]{"MonthPastSuffix", ""}, new Object[]{"MonthSingularName", "mes"}, new Object[]{"MonthPluralName", "mesos"}, new Object[]{"SecondPattern", "%n %u"}, new Object[]{"SecondFuturePrefix", "d\'aquí a "}, new Object[]{"SecondFutureSuffix", ""}, new Object[]{"SecondPastPrefix", "fa "}, new Object[]{"SecondPastSuffix", ""}, new Object[]{"SecondSingularName", "segon"}, new Object[]{"SecondPluralName", "segons"}, new Object[]{"WeekPattern", "%n %u"}, new Object[]{"WeekFuturePrefix", "d\'aquí a "}, new Object[]{"WeekFutureSuffix", ""}, new Object[]{"WeekPastPrefix", "fa "}, new Object[]{"WeekPastSuffix", ""}, new Object[]{"WeekSingularName", "setmana"}, new Object[]{"WeekPluralName", "setmanes"}, new Object[]{"YearPattern", "%n %u"}, new Object[]{"YearFuturePrefix", "d\'aquí a "}, new Object[]{"YearFutureSuffix", ""}, new Object[]{"YearPastPrefix", "fa "}, new Object[]{"YearPastSuffix", ""}, new Object[]{"YearSingularName", "any"}, new Object[]{"YearPluralName", "anys"}, new Object[]{"AbstractTimeUnitPattern", ""}, new Object[]{"AbstractTimeUnitFuturePrefix", ""}, new Object[]{"AbstractTimeUnitFutureSuffix", ""}, new Object[]{"AbstractTimeUnitPastPrefix", ""}, new Object[]{"AbstractTimeUnitPastSuffix", ""}, new Object[]{"AbstractTimeUnitSingularName", ""}, new Object[]{"AbstractTimeUnitPluralName", ""}}; } public Resources_ca() { super(); } protected Object[][] getContents() { return Resources_ca.a; } }
[ "dpefe@hotmail.es" ]
dpefe@hotmail.es
d5cd483ef193e8a9067ee0cfb46a520041484843
421459319bcf4374794cc65f573b0708a43e1558
/PdP/Woche_10/UsePoint.java
0bebe8b09c4f2a77f41085bad79e29cfa2bd2b35
[]
no_license
CaptainUnbrauchbar/programming-assignments
08a4545e6e6afadbf96bc37ef21e523c34066feb
b7d3b2317c7b6557dd317c3248fbe1abc384568f
refs/heads/master
2022-11-25T22:42:20.706243
2020-08-09T23:15:39
2020-08-09T23:15:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
880
java
/** * UsePoint.java * * Ein Programm, das Objekte der Klasse Point erzeugt und manipuliert. */ class UsePoint { public static void main(String[] args) { // Erzeugen von zwei Exemplaren des Typs Point mit den Namen p und q; // p soll an den Koordinaten (30,10) erzeugt werden, // q mit dem parameterlosen Konstruktor am Koordinatenursprung. Point p = new Point(30,10); Point q = new Point(); // Verschieben von q auf die Koordinaten (40,40) q.moveTo(40,20); // Ausgabe der Attribute von p und q System.out.println(); System.out.println(" x-Koordinate von p: " + p.getX()); System.out.println(" y-Koordinate von p: " + p.getY()); System.out.println(); System.out.println(" x-Koordinate von q: " + q.getX()); System.out.println(" y-Koordinate von q: " + q.getY()); System.out.println(); } } // UsePoint
[ "CaptainUnbrauchbar@users.noreply.github.com" ]
CaptainUnbrauchbar@users.noreply.github.com
f4065765e99a0915e8b42cd4874cf4c467ee5407
d4e09f22ff945ed9dcf515b47b1f865339c6608d
/src/net/morematerials/manager/WGenManager.java
4add18d21c7d7e3da1f87f63b5c2ce2b7715bc56
[]
no_license
AlmuraDev/MoreMaterialsPlus
4b13a3813a54b18be1be83e973eadfdda80f6e08
65985acc099bccc8fac26b851a7c3b9f039b9e6c
refs/heads/master
2018-12-29T02:34:37.924070
2012-07-12T04:11:07
2012-07-12T04:11:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,943
java
/* The MIT License Copyright (c) 2012 Zloteanu Nichita (ZNickq) and Andre Mohren (IceReaper) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package net.morematerials.manager; import java.io.File; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Random; import java.util.Set; import net.morematerials.Main; import net.morematerials.materials.SMCustomBlock; import org.bukkit.Chunk; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.generator.BlockPopulator; import org.getspout.spoutapi.SpoutManager; import org.getspout.spoutapi.material.CustomBlock; public class WGenManager extends BlockPopulator { private Main plugin; private Map<String, Set<ConfigurationSection>> populators = new HashMap<String, Set<ConfigurationSection>>(); public WGenManager(Main plugin) { this.plugin = plugin; // Create new materials file, if none found. File active = new File(plugin.getDataFolder().getPath(), "wgen.yml"); if (!active.exists()) { try { active.createNewFile(); } catch (Exception e) { MainManager.getUtils().log("Couldn't read wgen.yml."); } } // Loading the wgen.yml File wgenYml = new File(plugin.getDataFolder().getPath(), "wgen.yml"); YamlConfiguration config = YamlConfiguration.loadConfiguration(wgenYml); for (String worldName : config.getKeys(false)) { Set<ConfigurationSection> pops = new HashSet<ConfigurationSection>(); ConfigurationSection datWorld = config.getConfigurationSection(worldName); for (String matName : datWorld.getKeys(false)) { ConfigurationSection section = datWorld.getConfigurationSection(matName); pops.add(section); } this.populators.put(worldName, pops); } // Registering for worlds. for (World world : this.plugin.getServer().getWorlds()) { if (this.populators.containsKey(world.getName())) { world.getPopulators().add(this); } } } @Override public void populate(World world, Random random, Chunk chunk) { // Do not do anything for world which are not defined in wgen.yml. if (!this.populators.containsKey(world.getName())) { return; } // Doing all wgen stuff for this world. for (ConfigurationSection entry : this.populators.get(world.getName())) { Object material = MainManager.getSmpManager().getMaterial(entry.getName()); // If given material was not found if (!(material instanceof SMCustomBlock)) { continue; } // Getting values Integer chance = entry.getInt("Chance", 0); Integer minY = entry.getInt("MinY", 0); Integer maxY = entry.getInt("MaxY", 128); Integer veins = entry.getInt("Veins", 0); Integer veinSize = entry.getInt("VeinSize", 0); String replaces = entry.getString("Replaces", "1 3 13"); // Calculate chance that blocks will be present in this chunk. int rn = random.nextInt(100); if (rn > chance) { return; } // Calculate how many veins will be present in this chunk. int howMany = random.nextInt(veins - 1) + 1; // Calculate how large a vein may become. int howLarge = random.nextInt(veinSize - 1) + 1; int x; int y; int z; Block curBlock; for (int i = 0; i < howMany; i++) { // Get a random block in this chunk. x = random.nextInt(16); y = random.nextInt(maxY - minY) + minY; z = random.nextInt(16); curBlock = chunk.getBlock(x, y, z); // Generate this vein. for (int j = 1; j < howLarge; j++) { for (String replacement : replaces.split(" ")) { if (curBlock.getTypeId() == Integer.parseInt(replacement)) { SpoutManager.getMaterialManager().overrideBlock(curBlock, (CustomBlock) material); } } rn = random.nextInt(BlockFace.values().length); curBlock = curBlock.getRelative(BlockFace.values()[rn]); } } } } }
[ "andrashe@gmail.com" ]
andrashe@gmail.com
18c1aac7ac9b173ead385ec6817c6722b9f77c49
12a5c729344523e41682b78413c33f8d05fece9c
/webofneeds/won-utils/won-utils-conversation/src/main/java/won/protocol/agreement/effect/Claims.java
714bcb6c41879a26af1150d43cbd43556303d8c0
[ "Zlib", "EPL-1.0", "LZMA-exception", "bzip2-1.0.6", "CPL-1.0", "CDDL-1.0", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
researchstudio-sat/webofneeds
04ebba7e73430c1454cd9f3d7324bc24f0fe7012
c64a0889e7ac0f81c1f3a6a2d2b3f01372457686
refs/heads/master
2022-05-06T04:57:47.753441
2021-12-21T14:32:08
2021-12-21T14:32:08
6,154,058
62
22
Apache-2.0
2021-06-10T10:47:02
2012-10-10T08:08:56
Java
UTF-8
Java
false
false
518
java
package won.protocol.agreement.effect; import java.net.URI; public class Claims extends MessageEffect { private URI claimedMessageUri; public Claims(URI messageUri, URI claimedMessageUri) { super(messageUri, MessageEffectType.CLAIMS); this.claimedMessageUri = claimedMessageUri; } public URI getClaimedMessageUri() { return claimedMessageUri; } @Override public String toString() { return "Claims [claimedMessageUri=" + claimedMessageUri + "]"; } }
[ "florian.kleedorfer@austria.fm" ]
florian.kleedorfer@austria.fm
1df21c0a9ebbaf3fc47e7d6f990753ff39d9212c
e3741a855164fbece2494348d40e99798f1b064b
/app/src/main/java/org/androidtown/multimemoapp/common/TitleBitmapButton.java
72214ca2dfa213a6559b5f3d4b958d7b7e09107e
[]
no_license
sellester/MultiMemoApp
1fe6392a4c42f0ccaebff4fbc0a48265b2161a2e
72a35236675ba1a7c3a2c67d78674279f26fcd3d
refs/heads/master
2020-04-23T15:54:44.257687
2019-02-26T07:14:51
2019-02-26T07:14:51
171,280,406
0
0
null
null
null
null
UTF-8
Java
false
false
6,223
java
package org.androidtown.multimemoapp.common; import org.androidtown.multimemoapp.R; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.Typeface; import android.support.v7.widget.AppCompatButton; import android.util.AttributeSet; import android.view.MotionEvent; public class TitleBitmapButton extends AppCompatButton { /** * Base Context */ Context context; /** * Paint instance */ Paint paint; /** * Default Color */ int defaultColor = 0xffffffff; /** * Default Size */ float defaultSize = 18F; /** * Default ScaleX */ float defaultScaleX = 1.0F; /** * Default Typeface */ Typeface defaultTypeface = Typeface.DEFAULT; /** * Title Text */ String titleText = ""; /** * Icon Status : 0 - Normal, 1 - Clicked */ int iconStatus = 0; /** * Icon Clicked Bitmap */ Bitmap iconNormalBitmap; /** * Icon Clicked Bitmap */ Bitmap iconClickedBitmap; public static final int BITMAP_ALIGN_CENTER = 0; public static final int BITMAP_ALIGN_LEFT = 1; public static final int BITMAP_ALIGN_RIGHT = 2; int backgroundBitmapNormal = R.drawable.title_button; int backgroundBitmapClicked = R.drawable.title_button_clicked; /** * Alignment */ int bitmapAlign = BITMAP_ALIGN_CENTER; /** * Padding for Left or Right */ int bitmapPadding = 10; /** * Flag for paint changed */ boolean paintChanged = false; private boolean selected; private int tabId; public TitleBitmapButton(Context context) { super(context); this.context = context; init(); } public TitleBitmapButton(Context context, AttributeSet atts) { super(context, atts); this.context = context; init(); } public void setTabId(int id) { tabId = id; } public void setSelected(boolean flag) { selected = flag; if (selected) { setBackgroundResource(backgroundBitmapClicked); paintChanged = true; defaultColor = Color.BLACK; } else { setBackgroundResource(backgroundBitmapNormal); paintChanged = true; defaultColor = Color.WHITE; } } public boolean isSelected() { return selected; } /** * Initialize */ public void init() { setBackgroundResource(backgroundBitmapNormal); paint = new Paint(); paint.setColor(defaultColor); paint.setAntiAlias(true); paint.setTextScaleX(defaultScaleX); paint.setTextSize(defaultSize); paint.setTypeface(defaultTypeface); selected = false; } /** * Set icon bitmap * * @param icon */ public void setIconBitmap(Bitmap iconNormal, Bitmap iconClicked) { iconNormalBitmap = iconNormal; iconClickedBitmap = iconClicked; } public void setBackgroundBitmap(int resNormal, int resClicked) { backgroundBitmapNormal = resNormal; backgroundBitmapClicked = resClicked; setBackgroundResource(backgroundBitmapNormal); } /** * Handles touch event, move to main screen */ public boolean onTouchEvent(MotionEvent event) { super.onTouchEvent(event); int action = event.getAction(); switch (action) { case MotionEvent.ACTION_UP: if (selected) { } else { setBackgroundResource(backgroundBitmapNormal); iconStatus = 0; paintChanged = true; defaultColor = Color.WHITE; // fire event //khc 100913 - 아래코드 제거시 탭 이동현상 없어짐. //MainScreenActivity.getInstance().tabSelected(tabId); } break; case MotionEvent.ACTION_DOWN: if (selected) { } else { setBackgroundResource(backgroundBitmapClicked); iconStatus = 1; paintChanged = true; defaultColor = Color.BLACK; } break; } // repaint the screen invalidate(); return true; } /** * Draw the text */ public void onDraw(Canvas canvas) { super.onDraw(canvas); int curWidth = getWidth(); int curHeight = getHeight(); // apply paint attributes if (paintChanged) { paint.setColor(defaultColor); paint.setTextScaleX(defaultScaleX); paint.setTextSize(defaultSize); paint.setTypeface(defaultTypeface); paintChanged = false; } // bitmap Bitmap iconBitmap = iconNormalBitmap; if (iconStatus == 1) { iconBitmap = iconClickedBitmap; } if (iconBitmap != null) { int iconWidth = iconBitmap.getWidth(); int iconHeight = iconBitmap.getHeight(); int bitmapX = 0; if (bitmapAlign == BITMAP_ALIGN_CENTER) { bitmapX = (curWidth-iconWidth)/2; } else if(bitmapAlign == BITMAP_ALIGN_LEFT) { bitmapX = bitmapPadding; } else if(bitmapAlign == BITMAP_ALIGN_RIGHT) { bitmapX = curWidth-bitmapPadding; } canvas.drawBitmap(iconBitmap, bitmapX, (curHeight-iconHeight)/2, paint); } // text Rect bounds = new Rect(); paint.getTextBounds(titleText, 0, titleText.length(), bounds); float textWidth = ((float)curWidth - bounds.width())/2.0F; float textHeight = ((float)curHeight + bounds.height())/2.0F+4.0F; canvas.drawText(titleText, textWidth, textHeight, paint); } public String getTitleText() { return titleText; } public void setTitleText(String titleText) { this.titleText = titleText; } public int getDefaultColor() { return defaultColor; } public void setDefaultColor(int defaultColor) { this.defaultColor = defaultColor; paintChanged = true; } public float getDefaultSize() { return defaultSize; } public void setDefaultSize(float defaultSize) { this.defaultSize = defaultSize; paintChanged = true; } public float getDefaultScaleX() { return defaultScaleX; } public void setDefaultScaleX(float defaultScaleX) { this.defaultScaleX = defaultScaleX; paintChanged = true; } public Typeface getDefaultTypeface() { return defaultTypeface; } public void setDefaultTypeface(Typeface defaultTypeface) { this.defaultTypeface = defaultTypeface; paintChanged = true; } public int getBitmapAlign() { return bitmapAlign; } public void setBitmapAlign(int bitmapAlign) { this.bitmapAlign = bitmapAlign; } public int getBitmapPadding() { return bitmapPadding; } public void setBitmapPadding(int bitmapPadding) { this.bitmapPadding = bitmapPadding; } }
[ "sellester@naver.com" ]
sellester@naver.com
9eac49d28572d7e0628115a7169715234e8e1359
cf5116f8c02250b392b5c0172f600aa044662986
/management/src/main/java/com/babeeta/butterfly/application/management/dao/impl/StatDaoImpl.java
6b20493c392a95cbe75d5bd0fe3385f30d073620
[]
no_license
jfatty/application-1.5.22
69ecfb828cbb1682451385d50c82d6305c1cbe15
e7553193ba455cfeb099a49dd74f62a887a3f5ed
refs/heads/master
2021-05-31T11:03:17.044608
2016-04-01T06:22:43
2016-04-01T06:22:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,666
java
package com.babeeta.butterfly.application.management.dao.impl; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import com.babeeta.butterfly.application.management.dao.StatDao; import com.mongodb.BasicDBObject; import com.mongodb.DBCollection; import com.mongodb.DBCursor; import com.mongodb.DBObject; import com.mongodb.Mongo; public class StatDaoImpl implements StatDao { private DBCollection statCollection; private static final SimpleDateFormat SDF=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public StatDaoImpl(Mongo mongo) { statCollection = mongo.getDB("stat").getCollection("stat"); } public void ensureIndex() { BasicDBObject indexOptions = new BasicDBObject().append("background", true).append("unique", true); statCollection.ensureIndex(new BasicDBObject().append("rate", 1) .append("createTime", -1), indexOptions); } @Override public List<Map> getStats(String rate, int limit) { DBCursor cursor=statCollection.find(new BasicDBObject().append("rate", rate)).sort( new BasicDBObject().append("createTime", -1)).limit(limit); List<Map> list=new ArrayList<Map>(); while(cursor.hasNext()){ DBObject obj=cursor.next(); Iterator<String> keyIt=obj.keySet().iterator(); Map map=new LinkedHashMap(); while(keyIt.hasNext()){ String key=keyIt.next(); if(key.equals("createTime")){ map.put(key, SDF.format(obj.get(key))); }else if(key.equals("_id")){ continue; }else{ map.put(key, obj.get(key)); } } list.add(map); } return list; } }
[ "zhaominhe@gmail.com" ]
zhaominhe@gmail.com
1a23a136cfa2af4c6e2c470b6d918926aafe54c4
ae6588fac8d054ef278a0e8e2a8a7e65bd1bedf0
/jfinal_hadoop_webdisk/src/com/hadoop/gy404/service/DirOperateService.java
4e77c20f8c5f470807d5c786cd319941edbedb57
[]
no_license
FashtimeDotCom/angularjs-bootstrap-jfinal-hadoop-netdisk
4e0272f6ceed4bd381f5254e1257578cd7ac0db8
729ded732f35cd0072115f6ebc331b1e85832415
refs/heads/master
2021-01-18T14:34:21.426743
2014-07-09T10:40:27
2014-07-09T10:40:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,538
java
package com.hadoop.gy404.service; import java.io.IOException; import java.sql.Timestamp; import com.hadoop.gy404.model.Dir; import com.hadoop.gy404.tools.hadoop.HDFSConfig; import com.hadoop.gy404.tools.hadoop.HDFSOperation; import com.jfinal.core.Controller; public class DirOperateService { private HDFSOperation hdfsoperation;//hdfs file oper class public DirOperateService() throws IOException{ hdfsoperation =new HDFSOperation(); } //get all dir info(获取所有文件夹信息) public void getAllDir(Controller c) { String sql="select * from dir order by createtime"; c.setAttr("dirlist", Dir.dao.find(sql)); c.renderJson(); } //add dir(添加文件夹) public void addDir(Controller c,String name){ String isexist="select * from dir where name=?"; if(Dir.dao.findFirst(isexist, name)!=null) c.renderJson("message",name+"-the dir name exist, please change other name.(文件夹已经存在,请更换文件夹名称!)"); else{ String dirname=HDFSConfig.getHDFSPath()+name; if(hdfsoperation.mkdir(dirname)){ new Dir().set("name", name).set("hdfspath", dirname) .set("createtime", new Timestamp(System.currentTimeMillis())) .set("updatetime", new Timestamp(System.currentTimeMillis())).save(); c.setAttr("message","dir create success!(文件夹创建成功!)"); c.setAttr("status", 1); c.renderJson(); } else{ c.setAttr("status", 0); c.setAttr("message","dir create error!(文件夹创建失败!)"); c.renderJson(); } } } }
[ "fc13240@gmail.com" ]
fc13240@gmail.com
8fad3badfd4a46aad564009737fcbba413e9ee03
8111d31b49e42b31cce365b4971a46cf18d96a9d
/day01/src/com/bianyiit/domain/Student.java
f03c6fd0fcad5f3343d338d1468a6f8ca65a266f
[]
no_license
flyhigh19/github_firstPush
1e72b55f1ee57e64d82f2ae68d542d20dc055790
0e43a321046382acf63d8792468276abeedf9a13
refs/heads/master
2022-10-18T06:50:57.121444
2020-06-09T13:57:46
2020-06-09T13:57:46
270,888,178
0
0
null
null
null
null
UTF-8
Java
false
false
975
java
package com.bianyiit.domain; public class Student { private int id; private String username; private String password; public Student() { } public Student(int id, String username, String password) { this.id = id; this.username = username; this.password = password; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } @Override public String toString() { return "Student{" + "id=" + id + ", username='" + username + '\'' + ", password='" + password + '\'' + '}'; } }
[ "zhangzhen8015@163.com" ]
zhangzhen8015@163.com
fb97677b14fcc8c417697dbacf0d3d93866904e8
b11c565b83c90d5a8d979b31439fa1c547909a69
/src/main/java/com/partydecoration/CarpetDecorator.java
60dc315ea459ae6a75b91cab3809e0e2235f5065
[]
no_license
Johan-Carrillo-UMG/analisis1-2021-final
ba17200d3a6ba048571c46029f01e347e6d24b64
35dcc15dced88527d8aa84f713d0bbf5c9fb37e5
refs/heads/main
2023-06-03T10:26:28.378526
2021-06-17T03:46:57
2021-06-17T03:46:57
376,362,954
0
0
null
2021-06-12T18:50:19
2021-06-12T18:50:18
null
UTF-8
Java
false
false
358
java
package com.partydecoration; import java.util.*; public class CarpetDecorator extends PartyDecorationsDecorate { public CarpetDecorator() { } public void addCarpet(IDecoration decoration) { if(decoration instanceof Floor){ System.out.println("1\t\t\tQ60\t\tQ60\t\t\tALFOMBRA SINTETICA"); } return; } }
[ "jcarrillob3@miumg.edu.gt" ]
jcarrillob3@miumg.edu.gt
80a53c45964b03d72ed452f9d68fc884037b2b8d
5f2fb08c46b2acdfe52583cf95925325b36c6820
/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/MessageEvent.java
ffdabe546aaeafcf1b5461b2a743f366b3fabfc3
[]
no_license
309925753/xinfuyouyue
7324fb7062c126156ee350a0e14b8b18bed7afe6
0bc8f8bb387d2203b74af05bfcc6733cde51cda2
refs/heads/master
2022-11-30T23:46:53.082249
2020-05-19T11:48:55
2020-05-19T11:48:55
287,436,362
3
6
null
null
null
null
UTF-8
Java
false
false
624
java
package fm.jiecao.jcvideoplayer_lib; /** * Created by Administrator on 2017/3/17 0017. * 1. 视频播放控件 已准备,通知朋友圈页面停止播放录音,防止同时播放两种声音 * 2. 我的同事 其他页面调用api成功,通知同事页面刷新UI * 3. 消息群发 收到回执后,通知群发页面,当群发页面收到所有人回执时,在隐藏等待符 * 4. 视频播放完成,通知单聊界面,判断是否为阅后即焚视频 */ public class MessageEvent { public final String message; public MessageEvent(String message) { this.message = message; } }
[ "309925753@qq.com" ]
309925753@qq.com
0b4c36c76194cf78fa2ec4610c1eda7bee28f84c
c544cebc51939c42bef2ac996bd1533739992aea
/app/src/test/java/com/srb9181/srbrxandroid/ExampleUnitTest.java
3ddf0653cfb8a12831c32b662f1f9148ea3f1e40
[]
no_license
srb9181/SrbRxAndroid
807672ca44212c34634f86fe1d96c365ea93f81e
dcf50c5e4c05dd226a555c5788575f57310068ac
refs/heads/master
2021-01-21T03:33:57.623136
2017-11-23T16:16:32
2017-11-23T16:16:32
101,896,998
0
0
null
null
null
null
UTF-8
Java
false
false
402
java
package com.srb9181.srbrxandroid; 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); } }
[ "srb9181@gmail.com" ]
srb9181@gmail.com
40b96082c75cdc99a1e99a2b94de8c659cbae3c5
13645e8eadeb91f6f02947317fcbc9659802ccec
/app/src/main/java/com/example/librarymanagementsystem/user/UserLogin.java
dd11a145b8afce546f78fea7ab8b0f7e97424e6b
[]
no_license
dhanashree2200/Library-Management-System
53fb6c7434c6e58a04856cccf6934674190688b6
cdfc8bf948b57eda6f842de6b6215bc35e3c6185
refs/heads/master
2023-04-02T23:13:07.877879
2021-04-16T06:26:00
2021-04-16T06:26:00
358,497,727
0
0
null
null
null
null
UTF-8
Java
false
false
3,574
java
package com.example.librarymanagementsystem.user; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.cardview.widget.CardView; import androidx.core.app.NavUtils; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.TextView; import android.widget.Toast; import com.example.librarymanagementsystem.DatabaseHandler; import com.example.librarymanagementsystem.DbModel; import com.example.librarymanagementsystem.R; import com.google.android.material.textfield.TextInputEditText; import com.google.android.material.textfield.TextInputLayout; import java.util.List; public class UserLogin extends AppCompatActivity { TextView register; CardView userLogin; TextInputEditText userID,userPass; TextInputLayout idEL,passEL; SharedPreferences sharedpreferences; Toolbar tb; public static final String MyPREFERENCES = "UserLogin" ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_user_login); // getSupportActionBar().setDisplayHomeAsUpEnabled(true); register=findViewById(R.id.register); userLogin=findViewById(R.id.adminLoginSuccess); userID=findViewById(R.id.uID1); userPass=findViewById(R.id.uPass1); idEL=findViewById(R.id.uID); passEL=findViewById(R.id.uPass); tb=findViewById(R.id.toolBar); tb.setNavigationIcon(R.drawable.arrow_back); tb.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { NavUtils.navigateUpFromSameTask(UserLogin.this); } }); sharedpreferences = getSharedPreferences(MyPREFERENCES, MODE_PRIVATE); String name=sharedpreferences.getString("Name",null); if(name!=null){ startActivity(new Intent(UserLogin.this, UserMainPage.class)); } userLogin.setOnClickListener(new Userlogin()); register.setOnClickListener(new UserRegistration()); } class UserRegistration implements View.OnClickListener{ @Override public void onClick(View v) { startActivity(new Intent(UserLogin.this, UserRegisration.class)); } } class Userlogin implements View.OnClickListener{ @Override public void onClick(View v) { int f=0; DatabaseHandler db=new DatabaseHandler(UserLogin.this); List<DbModel> list=db.getAllStud(); for (DbModel stud:list){ if(stud.getStud_id().equals(userID.getText().toString()) && stud.getStud_pass().equals(userPass.getText().toString())){ f=1; Log.d("TAG", " "); Toast.makeText(UserLogin.this, "Success", Toast.LENGTH_LONG).show(); SharedPreferences.Editor editor = sharedpreferences.edit(); editor.putString("Name", userID.getText().toString()); editor.putString("Password", userPass.getText().toString()); editor.apply(); } } if(f==0) Toast.makeText(UserLogin.this, "No such user found", Toast.LENGTH_LONG).show(); if(f==1) startActivity(new Intent(UserLogin.this,UserMainPage.class)); } } }
[ "dhanashreekp2200@gmail.com" ]
dhanashreekp2200@gmail.com
33356d055252fa86ac660e7ca0caef414d2f5e64
5843c978b0bf420e977bbcaf6f6b1d1b4c9b32c3
/src/main/java/br/com/fiap/financiamentos/service/FinanciamentoService.java
cb6494e53764617bcc1ecaf068a5cf2409d6e6dc
[]
no_license
sjose03/nac2_web_services
37aa5576ce56776afed402320db3c868e0fc4f54
80ca7322a634a19615e2e564e07f138e2a6afe26
refs/heads/master
2023-04-27T00:56:54.318842
2021-05-21T02:34:17
2021-05-21T02:34:17
369,392,849
0
0
null
null
null
null
UTF-8
Java
false
false
330
java
package br.com.fiap.financiamentos.service; import br.com.fiap.financiamentos.dto.Financiamento; import java.util.List; public interface FinanciamentoService { List<Financiamento>listaFinanciamentos(); Financiamento salvaFinanciamento(Financiamento financiamento); Financiamento editarFinanciamento(Long id); }
[ "jose.petrolio0308@gmail.com" ]
jose.petrolio0308@gmail.com
0252c6a32315e0dc3e9e4e661be4bd5069c8d0f2
24743935bf4b94a321964a1bd23134c579cec4cc
/src/fr/parisnanterre/poa/td1/ex3/Langues.java
d776e771ed5478e3cc2f07e371999e9e7b383bb0
[]
no_license
ThibaultSartre/POA
d63528fbdc2f220c60911d09f9d18d6cf58fdb9a
65ded8b7bf1b2cc001b2d1f53997692486ada67d
refs/heads/master
2021-08-28T08:12:01.212048
2017-12-11T16:40:41
2017-12-11T16:40:41
104,227,474
0
0
null
2017-09-20T14:53:04
2017-09-20T14:38:33
null
UTF-8
Java
false
false
131
java
package fr.parisnanterre.poa.td1.ex3; /** * Created by thsartre on 25/09/2017. */ public class Langues extends Departement { }
[ "sartre.thibault@hotmail.fr" ]
sartre.thibault@hotmail.fr
0bdfbaee6480f57e8813f6bbfd4ed5e40c74f537
e29febf27d9e26a03e1072aea99e528d07419104
/app/src/androidTest/java/com/example/hyl/person/ExampleInstrumentedTest.java
3ead42a63fd3adc5c4655afd8ab56c2471f0ef52
[]
no_license
HUIZHai/Androidstudio-person
1d48b488e126aa66d19288491e57fa860c39cd1d
f76d0a15b3f2b458368e23ec2b7fc935fa299d1c
refs/heads/master
2020-06-15T17:58:55.379306
2019-07-07T06:29:50
2019-07-07T06:29:50
195,358,219
0
0
null
null
null
null
UTF-8
Java
false
false
728
java
package com.example.hyl.person; 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() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.hyl.person", appContext.getPackageName()); } }
[ "31601342@stu.zucc.edu.cn" ]
31601342@stu.zucc.edu.cn
9bb6c82a18e20925919c5d37970a4e2238a108a5
ee370fe8600269233f2379d2f7409d1d20e91a64
/src/pieces/Piece.java
eecfb1fd081f76401cdf68b06446e4e70153c9d3
[]
no_license
Kalak30/Chess
b68025ed2b9cd875902d4b4865657afc44865033
6de0cc0ea308d2a67ae560a413b4b89a5b67ec56
refs/heads/master
2020-03-29T04:53:42.944516
2018-09-22T23:14:00
2018-09-22T23:14:00
149,553,879
0
0
null
null
null
null
UTF-8
Java
false
false
4,460
java
package pieces; import game.Handler; import java.awt.*; import java.util.ArrayList; import java.util.Map; /** * Abstract class to store the basics of each piece. * Cannot be instantiated. */ public abstract class Piece{ /** * Static variables to store the default width and default height of a piece */ public static final int DEFAULT_WIDTH = 64, DEFAULT_HEIGHT = 64; /** * integer to store the current column of the game board the piece is on */ protected int column; /** * integer to store the current row of the game board the piece is on */ protected int row; /** * Position in the piece list in the board class. Unique to each piece */ protected Integer id; /** * static int to store the total amount of pieces have been created */ public static int totalPieces = 0; /** * Boolean to store if the piece has moved. Once moved never is set to false again */ protected boolean hasMoved; /** * An instance of the handler class */ protected Handler handler; /** * String to store the color of the piece */ public String color; /** * String to store the type(King,Queen,...) of the piece */ public String type; protected int value; /** * Basic constructor for a piece. Initializes the above variables. * @param handler Handler for information about the board and the game class * @param color Color of the piece * @param type whether it is a queen or king or any other piece * @param column column the piece will start on * @param row row the piece will start on */ public Piece(Handler handler, String color, String type, int column, int row){ this.handler = handler; this.color = color; this.type = type; this.column = column; this.row = row; hasMoved = false; id = totalPieces; totalPieces++; } public void moveTo(Point p){ handler.getBoard().setSelectedPiece(id); handler.getBoard().moveSelectedPiece(p); } public void setPos(Point p){ column = p.x; row = p.y; } public Point getPos(){ return new Point(column,row); } public boolean isMoveOnBoard(Point p){ if(p.x >= 0 && p.x < 8 && p.y >= 0 && p.y < 8) { return true; } else return false; } /** * Returns if the piece has moved during this game or not * @return hasMoved */ public boolean isHasMoved() { return hasMoved; } /** * Sets the hasMoved variable for the piece * @param hasMoved Boolean value - should only every be true; */ public void setHasMoved(boolean hasMoved) { this.hasMoved = hasMoved; } /** * Gets the current column on the board the piece is at * @return column */ public int getPieceColumn() { return column; } /** * Gets the current row on the board the piece is at * @return row */ public int getPieceRow(){ return row; } /** * Sets column to the column parameter that is given * @param column integer where 0 <= column < 8 */ public void setColumn(int column) { this.column = column; } /** * Sets row to the row parameter that is giveen * @param row integer where 0 <= row < 8 */ public void setRow(int row) { this.row = row; } /** * Returns true if this piece's color is equal to the players color, false * if it isn't */ public boolean isPlayers(){ return color == handler.getBoard().getPlayerColor(); } /** * Abstract method to be used in rendering the piece * @param g graphics Component that is used to draw the piece */ public abstract void render(Graphics g); /** * Abstract method to return a list of possible points the piece could move to. * @return possibleMovements */ public abstract ArrayList<Move> getMovement(); public String getColor() { return color; } public Integer getId() { return id; } public String toString(){ return "Column: " + column + " Row: "+ row; } public int getValue() { return value; } public void setId(Integer id) { this.id = id; } }
[ "kopbros2@gmail.com" ]
kopbros2@gmail.com
81b4843ce11aaca8b47fc0cc49009ffb89a11b89
fe39e9e83eed8c29bbdad95f46fa8aac538a671b
/forloop/fibonaciiproj.java
8fa24b9ce7e5cdf8461e4223c7655e3ce9d00628
[]
no_license
bhange24/Selenium_Java1
88e35b40bc4cc656168100a61fc75ad7e2613ebf
e5c013879bbd1baf5e8d298800e8734b5eca97e9
refs/heads/master
2020-03-17T21:01:03.227150
2018-06-19T10:05:24
2018-06-19T10:05:24
133,939,241
4
0
null
null
null
null
UTF-8
Java
false
false
295
java
package com.forloop; public class fibonaciiproj { public static void main(String[] args) { // TODO Auto-generated method stub int a = 0; int b = 1; int c = a + b; for (int i = 0; i <= 10; i++) { c = a + b; a = b; b = c; System.out.println("Series is " + c); } } }
[ "shraddha.bhange24@gmail.com" ]
shraddha.bhange24@gmail.com
2e7a70bca4dbc8b7eee405117b5e6e9b41bff18a
e0e2b50412bdc5742af17607688df722f2359891
/7.2/misc/ImageVisualizer/ImageEditor/src/org/netbeans/modules/image/ZoomOutAction.java
cf659d0c8298709f3af6117c78115071e6903870
[]
no_license
redporrot/nbp-resources
faf4b4662779d038bc8770d3cea38b4f1653d70c
ef8a41ae6ab18dd1cd1460fa99a52757bf98916b
refs/heads/master
2020-04-01T17:24:22.481434
2015-06-12T21:37:01
2015-06-12T21:37:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,605
java
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. * * Oracle and Java are registered trademarks of Oracle and/or its affiliates. * Other names may be trademarks of their respective owners. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common * Development and Distribution License("CDDL") (collectively, the * "License"). You may not use this file except in compliance with the * License. You can obtain a copy of the License at * http://www.netbeans.org/cddl-gplv2.html * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the * specific language governing permissions and limitations under the * License. When distributing the software, include this License Header * Notice in each file and include the License file at * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the GPL Version 2 section of the License file that * accompanied this code. If applicable, add the following below the * License Header, with the fields enclosed by brackets [] replaced by * your own identifying information: * "Portions Copyrighted [year] [name of copyright owner]" * * Contributor(s): * * The Original Software is NetBeans. The Initial Developer of the Original * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun * Microsystems, Inc. All Rights Reserved. * * If you wish your version of this file to be governed by only the CDDL * or only the GPL Version 2, indicate your decision by adding * "[Contributor] elects to include this software in this distribution * under the [CDDL or GPL Version 2] license." If you do not indicate a * single choice of license, a recipient has the option to distribute * your version of this file under either the CDDL, the GPL Version 2 or * to extend the choice of license to its licensees as provided above. * However, if you add GPL Version 2 code and therefore, elected the GPL * Version 2 license, then the option applies only if the new code is * made subject to such option by the copyright holder. */ package org.netbeans.modules.image; import org.openide.util.actions.CallableSystemAction; import org.openide.util.HelpCtx; import org.openide.windows.TopComponent; import org.openide.util.NbBundle; /** * Action which zooms out of an image. * * @author Lukas Tadial */ public class ZoomOutAction extends CallableSystemAction { /** Generated serial version UID. */ static final long serialVersionUID = 1859897546585041051L; /** Peforms action. */ public void performAction() { TopComponent curComponent = TopComponent.getRegistry().getActivated(); if(curComponent instanceof ImageViewer) ((ImageViewer) curComponent).zoomOut(); } /** Gets name of action. Implements superclass abstract method. */ public String getName() { return NbBundle.getBundle(ZoomOutAction.class).getString("LBL_ZoomOut"); } /** Gets help context for action. Implements superclass abstract method. */ public org.openide.util.HelpCtx getHelpCtx() { return HelpCtx.DEFAULT_HELP; } /** Overrides superclass method. */ public boolean isEnabled() { return true; } /** Gets icon resource. Overrides superclass method. */ protected String iconResource() { return "org/netbeans/modules/image/zoomOut.gif"; // NOI18N } }
[ "doriancuentas@gmail.com" ]
doriancuentas@gmail.com
e91f72f7a87666f5a164fbbd2478aa50ea469a84
6b42a5c49f6394ef989a955a99e0d90081d67d8e
/source/src/com/ipx/json/Cuenta.java
6d1ec99add5f6194d2a7ba43da74f7e75ac8302c
[]
no_license
Alucarth/goldenpos
ab8324a631ed340fade28d313e8d824371b2ee07
894e7d974dfb7838417923f265898c054d107366
refs/heads/master
2016-09-01T14:27:25.701671
2016-01-12T21:13:53
2016-01-12T21:13:53
49,528,666
0
0
null
null
null
null
UTF-8
Java
false
false
1,517
java
/* * Esta clase trata una respuesta json con la siguiente estructura: * { "clientes": [{ "id": 1, "name": "Pollos Copacabana", "nit": "987654321" }, { "id": 2, "name": "APLP", "nit": "123456798" }, { "id": 3, "name": "Coca Cola", "nit": "2308379" }], "productos": [{ "id": 1, "notes": "Servicios", "cost": "253.4000" }, { "id": 2, "notes": "consumo", "cost": "300.0000" }] } * se quito los clientes de la respuesta debido a excesivo trafico de datos */ package com.ipx.json; import java.util.Vector; import org.json.me.JSONException; import org.json.me.JSONObject; /** * * @author David Torrez */ public class Cuenta { private Vector productos; private Vector sucursales; public Cuenta(String jsonText) { try { JSONObject json = new JSONObject(jsonText); if(json.has("productos")) { this.productos = Products.fromJsonArray(json.getString("productos")); } if(json.has("sucursales")) { this.sucursales= Sucursal.fromJSONArray(json.getString("sucursales")); } } catch (JSONException ex) { ex.printStackTrace(); } } public Vector getProductos() { return this.productos; } public Vector getSucursales() { return sucursales; } }
[ "ltorrezs2008@gmail.com" ]
ltorrezs2008@gmail.com
46d2fb856cefc540adc2c06144d01480387f1ab6
ebb160ae32e1bf46c5c1339f88de71a15c02088d
/src/main/java/com/huawei/www/bme/cbsinterface/bcservices/CustDeactivationRequestAdditionalProperty.java
736d2b2164d2293cae91205dc85d9baf33a40030
[]
no_license
benjamin-Ndugga/ocsconnect
55b583c0f5135a753eaaa853042987a5ba6946a1
9e66bc99456dbf8c279cc973d80bc0d43d9ab47e
refs/heads/master
2023-04-06T01:20:54.801374
2020-04-15T17:55:35
2020-05-19T13:36:39
352,567,373
0
0
null
null
null
null
UTF-8
Java
false
false
2,905
java
/** * CustDeactivationRequestAdditionalProperty.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package com.huawei.www.bme.cbsinterface.bcservices; public class CustDeactivationRequestAdditionalProperty extends com.huawei.www.bme.cbsinterface.bccommon.SimpleProperty implements java.io.Serializable { public CustDeactivationRequestAdditionalProperty() { } public CustDeactivationRequestAdditionalProperty( java.lang.String code, java.lang.String value) { super( code, value); } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof CustDeactivationRequestAdditionalProperty)) return false; CustDeactivationRequestAdditionalProperty other = (CustDeactivationRequestAdditionalProperty) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = super.equals(obj); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = super.hashCode(); __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(CustDeactivationRequestAdditionalProperty.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.huawei.com/bme/cbsinterface/bcservices", ">CustDeactivationRequest>AdditionalProperty")); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
[ "" ]
708f69480d4ee27a282271da4de3fa6b58d603aa
5b9a04d3c911c16aba63258d48606d6ea364a6da
/distribution_sales/modules/sales/app/entity/sales/Sequence.java
4584899983b892638dee091ff3a0064deed1f407
[ "Apache-2.0" ]
permissive
yourant/repository1
40fa5ce602bbcad4e6f61ad6eb1330cfe966f780
9ab74a2dfecc3ce60a55225e39597e533975a465
refs/heads/master
2021-12-15T04:22:23.009473
2017-07-28T06:06:35
2017-07-28T06:06:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
939
java
package entity.sales; public class Sequence { private Integer id; private String seqName; private Long currentValue; private Integer increment; private String remark; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getSeqName() { return seqName; } public void setSeqName(String seqName) { this.seqName = seqName; } public Long getCurrentValue() { return currentValue; } public void setCurrentValue(Long currentValue) { this.currentValue = currentValue; } public Integer getIncrement() { return increment; } public void setIncrement(Integer increment) { this.increment = increment; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } }
[ "3002781863@qq.com" ]
3002781863@qq.com
e41240109c8c9d6e81bc9018f082f4d1c76aac6c
a292b2564e4b05ce513f2a037186d6d5801a4ba2
/1 Two Sum/solution2.java
2e64478507b1afc4b848ad27aef720340c5c7689
[]
no_license
wbq2101116/LeetCode
cfcec67d307d0da088d276b3ad18bcc02c5bed10
a1fe00e25e5afc8784fbb785a344275ee97786dc
refs/heads/master
2021-05-08T04:30:34.892593
2018-04-03T05:57:50
2018-04-03T05:57:50
108,410,755
0
0
null
null
null
null
UTF-8
Java
false
false
468
java
class Solution { public int[] twoSum(int[] nums, int target) { Map<Integer, Integer> map = new HashMap<Integer, Integer>(); for (int i = 0; i < nums.length; i++) { map.put(nums[i], i); } for (int i = 0; i < nums.length; i++) { int complement = target - nums[i]; if (map.containsKey(complement) && map.get(complement) != i) { return new int[] {i, map.get(complement)}; } } throw new IllegalArgumentException("No two sum solution"); } }
[ "773854936@qq.com" ]
773854936@qq.com
155bd6c41998bcb4ceea32e15649e979ea73669f
b111b77f2729c030ce78096ea2273691b9b63749
/db-example-large-multi-project/project11/src/test/java/org/gradle/test/performance/mediumjavamultiproject/project11/p56/Test1125.java
a59b905ba9bdf1d780fff90f5d1b673fac521040
[]
no_license
WeilerWebServices/Gradle
a1a55bdb0dd39240787adf9241289e52f593ccc1
6ab6192439f891256a10d9b60f3073cab110b2be
refs/heads/master
2023-01-19T16:48:09.415529
2020-11-28T13:28:40
2020-11-28T13:28:40
256,249,773
1
0
null
null
null
null
UTF-8
Java
false
false
3,026
java
package org.gradle.test.performance.mediumjavamultiproject.project11.p56; import org.gradle.test.performance.mediumjavamultiproject.project11.p55.Production1116; import org.gradle.test.performance.mediumjavamultiproject.project8.p41.Production825; import org.gradle.test.performance.mediumjavamultiproject.project9.p46.Production925; import org.gradle.test.performance.mediumjavamultiproject.project10.p51.Production1025; import org.junit.Test; import static org.junit.Assert.*; public class Test1125 { Production1125 objectUnderTest = new Production1125(); @Test public void testProperty0() throws Exception { Production1116 value = new Production1116(); objectUnderTest.setProperty0(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty0()); } @Test public void testProperty1() throws Exception { Production1120 value = new Production1120(); objectUnderTest.setProperty1(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty1()); } @Test public void testProperty2() throws Exception { Production1124 value = new Production1124(); objectUnderTest.setProperty2(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty2()); } @Test public void testProperty3() throws Exception { Production825 value = new Production825(); objectUnderTest.setProperty3(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty3()); } @Test public void testProperty4() throws Exception { Production925 value = new Production925(); objectUnderTest.setProperty4(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty4()); } @Test public void testProperty5() throws Exception { Production1025 value = new Production1025(); objectUnderTest.setProperty5(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty5()); } @Test public void testProperty6() throws Exception { String value = "value"; objectUnderTest.setProperty6(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty6()); } @Test public void testProperty7() throws Exception { String value = "value"; objectUnderTest.setProperty7(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty7()); } @Test public void testProperty8() throws Exception { String value = "value"; objectUnderTest.setProperty8(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty8()); } @Test public void testProperty9() throws Exception { String value = "value"; objectUnderTest.setProperty9(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty9()); } }
[ "nateweiler84@gmail.com" ]
nateweiler84@gmail.com
ffe7e8eafc648ba0492baa28c56eb915d4fbd20c
51967281cd64a42aa86d01b204415b82cf53956a
/vcd_votedevice/src/main/java/de/tud/vcd/votedevice/tuTestElection/TUTestShowOption.java
be2ffb21ac7a82377ea3801813436ee7c2e43795
[ "Apache-2.0" ]
permissive
SecUSo/EasyVote
13e1ceeee11a57486404b71c56c75433597c43ca
676b20d416999a480495c45c535f5e4bc96e50c2
refs/heads/master
2021-04-23T09:47:20.114468
2015-05-18T14:46:38
2015-05-18T14:46:38
35,817,012
4
2
null
null
null
null
ISO-8859-1
Java
false
false
6,276
java
/******************************************************************************* * # Copyright 2015 SecUSo.org / Jurlind Budurushi / Roman Jöris * # * # Licensed under the Apache License, Version 2.0 (the "License"); * # you may not use this file except in compliance with the License. * # You may obtain a copy of the License at * # * # http://www.apache.org/licenses/LICENSE-2.0 * # * # Unless required by applicable law or agreed to in writing, software * # distributed under the License is distributed on an "AS IS" BASIS, * # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * # See the License for the specific language governing permissions and * # limitations under the License. *******************************************************************************/ package de.tud.vcd.votedevice.tuTestElection; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.RenderingHints; import java.awt.Shape; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.geom.Ellipse2D; import java.io.IOException; import java.net.URL; import java.util.ArrayList; import javax.imageio.ImageIO; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.SwingUtilities; import de.tud.vcd.votedevice.municipalElection.model.Party; import de.tud.vcd.votedevice.tuTestElection.TUTestElectionModel.VoteState; public class TUTestShowOption extends JPanel { /** * */ private static final long serialVersionUID = 1L; private Color foreground; //private int id_maxSize; private String name; private boolean voted; private VoteState voteState; private Font font; private Image imgBallotChecked; private Image imgBallotUnchecked; private ArrayList<ActionListener> al; private String actionCommand; private JComponent comp; private Shape ballotShape; public TUTestShowOption(int x, int y, int width, int height, Color foreground, VoteState vs){ this.voteState=vs; this.foreground=foreground; setBackground(Color.ORANGE); setOpaque(false); setSize(width, height); setLocation(x, y); // font= new Font("SanfSerif", Font.PLAIN,24 ); actionCommand=""; comp=this; // // FontMetrics fm = getFontMetrics(font); // id_maxSize=fm.stringWidth(id); name="Name"; voted=false; URL imageURLl =getClass().getClassLoader().getResource("ballotChecked50.gif"); imgBallotChecked=null; if (imageURLl != null) { try { imgBallotChecked = ImageIO.read(imageURLl); imgBallotChecked= imgBallotChecked.getScaledInstance(50, 50,Image.SCALE_SMOOTH); } catch (IOException e) { e.printStackTrace(); } //Image image = imgBallotChecked.getImage(); // transform it //image = image.getScaledInstance(20, 20, Image.SCALE_FAST); // scale it the smooth way //imgBallotChecked = new ImageIcon(image); // transform it back } imageURLl =getClass().getClassLoader().getResource("ballotUnchecked50.gif"); imgBallotUnchecked=null; if (imageURLl != null) { try { imgBallotUnchecked = ImageIO.read(imageURLl); imgBallotUnchecked= imgBallotUnchecked.getScaledInstance(50, 50,Image.SCALE_SMOOTH); } catch (IOException e) { e.printStackTrace(); } // Image image = imgBallotUnchecked.getImage(); // transform it // image = image.getScaledInstance(20, 20, Image.SCALE_FAST); // scale it the smooth way // imgBallotUnchecked = new ImageIcon(image); // transform it back } al=new ArrayList<ActionListener>(); addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { if (SwingUtilities.isLeftMouseButton(e) && contains(e.getPoint())) { //pressed = true; //repaint(); } } public void mouseReleased(MouseEvent e) { if (SwingUtilities.isLeftMouseButton(e) && ballotShape.contains(e.getPoint()) ) { //call all actionPerformed: for(ActionListener a:al){ ActionEvent ae=new ActionEvent(comp, ActionEvent.ACTION_PERFORMED, actionCommand); a.actionPerformed(ae); } //pressed = false; //repaint(); } } }); } public void paintComponent(Graphics g) { super.paintComponent(g); //Upcast --> more functions in Graphics2D Graphics2D g2d=(Graphics2D)g; // Antialiasing einschalten g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ); //g.drawString("FOO", 10, 5); g2d.setColor(foreground); //g2d.drawLine(0 , ); g2d.drawRect(0, 0 , this.getSize().width-1, this.getSize().height-1); g2d.setFont(font); g2d.drawString(name, 10, (int)(this.getSize().height*(0.70))); g2d.setFont(new Font(font.getFamily(), Font.BOLD, font.getSize())); //paint boxes ballotShape=new Ellipse2D.Double((int)(this.getSize().width-60) , 15, 50, 50); if (voted){ g2d.drawImage(imgBallotChecked, (int)(this.getSize().width-60) , 15, 50, 50, null, null); }else{ g2d.drawImage(imgBallotUnchecked, (int)(this.getSize().width-60) ,15, 50, 50, null, null); } } public void addActionListener(ActionListener al){ this.al.add(al); } public void setActionCommand(String actionCommand){ this.actionCommand=actionCommand; //.paramString= } public String getActionCommmand(){ return actionCommand; } public void setParty(Party p) { if (!(p == null)) { actionCommand = p.getName(); name=p.getName(); if (name.equals("invalid")){ name="Ungültig wählen"; } voted=p.isVoted(); setVisible(true); } else { name=""; actionCommand = ""; voted=false; setVisible(false); } repaint(); } public void setVoteState(VoteState vs, String text, boolean selected){ //System.out.println("SET:"+vs.toString()+": "+selected); name=text; actionCommand=vs.toString(); voted=selected; repaint(); } public VoteState getVoteState(){ return voteState; } }
[ "jurlindbudurushi@gmail.com" ]
jurlindbudurushi@gmail.com