blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d13fc1b5a8897fd15b03a88afb9b36100c68dfe8 | fe774f001d93d28147baec987a1f0afe0a454370 | /ml-model/files/old-files/set5/novice/shersin9891_birthday-cake-candles_solution.java | e5a524915728150c5b669eb05ec655b120b03232 | [] | no_license | gabrielchl/ml-novice-expert-dev-classifier | 9dee42e04e67ab332cff9e66030c27d475592fe9 | bcfca5870a3991dcfc1750c32ebbc9897ad34ea3 | refs/heads/master | 2023-03-20T05:07:20.148988 | 2021-03-19T01:38:13 | 2021-03-19T01:38:13 | 348,934,427 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 658 | java | import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Solution {
// Complete the birthdayCakeCandles function below.
static int birthdayCakeCandles(int[] ar) {
int m = max(ar);
int count = 0;
for(int i =0;i<ar.length;i++){
if(ar[i]==m)
count++;
}
return count;
}
public static int max(int[] a){
int m = a[0];
for(int i = 1;i<a.length;i++){
if(a[i]>m){
m=a[i];
}
}
return m;
}
}
| [
"chihonglee777@gmail.com"
] | chihonglee777@gmail.com |
429a32c5393c06c8b980abd29d11a3bf76fb55c3 | 8e78170c21537dff732b5d7dd7a365acf6da2215 | /bag2/mr-nom/src/main/java/com/example/framework/impl/AndroidPixmap.java | 243ead42d92ce0b1f7103f2c3465689a2ed2c81c | [] | no_license | andbard/Playground | b612c0a8ab3abe0065643f2b290f77f069562d30 | 08f1589360ea2fe55d6d2e36745f190cd9eb9318 | refs/heads/master | 2023-06-26T14:54:44.119993 | 2021-07-29T20:02:34 | 2021-07-29T20:02:34 | 290,608,022 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 662 | java | package com.example.framework.impl;
import android.graphics.Bitmap;
import com.example.framework.Graphics.PixmapFormat;
import com.example.framework.Pixmap;
public class AndroidPixmap implements Pixmap {
Bitmap bitmap;
PixmapFormat format;
public AndroidPixmap(Bitmap bitmap, PixmapFormat format) {
this.bitmap = bitmap;
this.format = format;
}
public int getWidth() {
return bitmap.getWidth();
}
public int getHeight() {
return bitmap.getHeight();
}
public PixmapFormat getFormat() {
return format;
}
public void dispose() {
bitmap.recycle();
}
}
| [
"bardella.andrea@gmail.com"
] | bardella.andrea@gmail.com |
4657570972c04b149c9d9321d0296770ff7c409a | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/29/29_f69eb2e3f5c008ec4ad2ffdebaf66062adb2062a/UpdateRecentDataTask/29_f69eb2e3f5c008ec4ad2ffdebaf66062adb2062a_UpdateRecentDataTask_s.java | f4d6d26af99577d1f279623a3f6cc62571fa5790 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 4,681 | java | /*
* Copyright (C) 2007 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.redgeek.android.eventrend.backgroundtasks;
import java.util.Calendar;
import net.redgeek.android.eventrend.db.EntryDbTable;
import net.redgeek.android.eventrend.primitives.Datapoint;
import net.redgeek.android.eventrend.primitives.TimeSeries;
import net.redgeek.android.eventrend.primitives.TimeSeriesCollector;
import net.redgeek.android.eventrend.util.DateUtil;
import net.redgeek.android.eventrend.util.DateUtil.Period;
/**
* Task to perform one or both of the two actions:
* <ul>
* <li>Zero-fill any periods for a category, or all categories, that have no
* entries since the last entry.
* <li>Fetch the recent history for a category, or all categories, calculate the
* new trend, and store the results.
* </ul>
*
* <p>
* If both actions are to be performed, the actions are performed in the order
* listed above, so that the zeros can be taken into account when calculating
* the new trend.
*
* <p>
* Note that since this is "backgroundtask", no UI operations may be performed.
*
* @author barclay
*
*/
public class UpdateRecentDataTask {
private TimeSeriesCollector mTSC;
private Calendar mCal;
private int mHistory;
private boolean mZerofill;
private boolean mUpdateTrend;
public UpdateRecentDataTask(TimeSeriesCollector tsc, int history) {
mTSC = tsc;
mCal = Calendar.getInstance();
mHistory = history;
mZerofill = false;
mUpdateTrend = false;
}
public void setZerofill(boolean b) {
mZerofill = b;
}
public void setUpdateTrend(boolean b) {
mUpdateTrend = b;
}
public void fillAllCategories() {
for (int i = 0; i < mTSC.numSeries(); i++) {
fillCategory(mTSC.getSeries(i).getDbRow().getId(), mZerofill,
mUpdateTrend);
}
return;
}
public void fillCategory(long catId) {
fillCategory(catId, mZerofill, mUpdateTrend);
return;
}
private void fillCategory(long catId, boolean zerofill,
boolean updateTrend) {
EntryDbTable.Row entry = new EntryDbTable.Row();
if (zerofill == false && updateTrend == true) {
// quick check to see if we need to update trends only...
mTSC.updateCategoryTrend(catId);
return;
}
TimeSeries ts = mTSC.getSeriesByIdLocking(catId);
if (ts.getDbRow().getZeroFill() == false)
return;
mTSC.gatherLatestDatapointsLocking(catId, mHistory);
Datapoint d = mTSC.getLastDatapoint(catId);
if (d == null)
return;
long periodMs = ts.getDbRow().getPeriodMs();
long now = System.currentTimeMillis();
mCal.setTimeInMillis(d.mMillis);
while (mCal.getTimeInMillis() + periodMs < now) {
if (periodMs == DateUtil.HOUR_MS) {
DateUtil.setToPeriodStart(mCal, Period.HOUR);
mCal.add(Calendar.HOUR, 1);
} else if (periodMs == DateUtil.AMPM_MS) {
DateUtil.setToPeriodStart(mCal, Period.AMPM);
mCal.add(Calendar.HOUR, 12);
} else if (periodMs == DateUtil.DAY_MS) {
DateUtil.setToPeriodStart(mCal, Period.DAY);
mCal.add(Calendar.DAY_OF_MONTH, 1);
} else if (periodMs == DateUtil.WEEK_MS) {
DateUtil.setToPeriodStart(mCal, Period.WEEK);
mCal.add(Calendar.WEEK_OF_YEAR, 1);
} else if (periodMs == DateUtil.MONTH_MS) {
DateUtil.setToPeriodStart(mCal, Period.MONTH);
mCal.add(Calendar.MONTH, 1);
} else if (periodMs == DateUtil.QUARTER_MS) {
DateUtil.setToPeriodStart(mCal, Period.QUARTER);
mCal.add(Calendar.MONTH, 3);
} else if (periodMs == DateUtil.YEAR_MS) {
DateUtil.setToPeriodStart(mCal, Period.YEAR);
mCal.add(Calendar.YEAR, 1);
}
entry.setCategoryId(catId);
entry.setTimestamp(mCal.getTimeInMillis());
entry.setValue(0.0f);
entry.setNEntries(0);
mTSC.getDbh().createEntry(entry);
}
if (updateTrend == true)
mTSC.updateCategoryTrend(entry.getCategoryId());
return;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
c3b686f2751c24f512b88c389b5c9c0b7a67cea5 | b8aa178512d8acf2bd1f23b185158ff1c7604d8a | /src/main/java/org/shop/service/OrdersService.java | c8bba2c3feea4ee7862bc6082aaa73030a852819 | [] | no_license | Taras-SH13/spring-jdbc-workshop | 2b468f23a24dac3c3c35bb855e35dca6b77e73e2 | 0bd19a36e0cc216cbceb919ca6df4239950beb38 | refs/heads/master | 2022-12-05T16:09:59.097862 | 2020-07-11T06:47:05 | 2020-07-11T06:47:05 | 278,806,977 | 0 | 0 | null | 2020-07-11T06:56:34 | 2020-07-11T06:56:33 | null | UTF-8 | Java | false | false | 837 | java | package org.shop.service;
import org.shop.dto.OrderDto;
import java.util.List;
public interface OrdersService {
/**
* @return all orders and their details
*/
List<OrderDto> findAll();
/**
*
* @param id - order unique identifier
* @return order and its' details
*/
OrderDto findOrderBy(long id);
double findOrderPrice(long orderId);
void saveOrder(OrderDto orderDto);
void deleteOrder(long orderId);
// THESE methods should be implemented optionally only if you finished your task early
// /**
// * this method should find
// */
// List<OrderDto> findOrdersWithPriceGreaterThen(double price);
//
// /**
// * the order is considered to be big if it has more then 3 order details
// * @return
// */
// List<OrderDto> findBigOrders();
}
| [
"kremnyovvv@gmail.com"
] | kremnyovvv@gmail.com |
e7fd90b8beeb50898d2b9c3a03ea8245de04fcd8 | cedcd19cf8693eb9bb834b6517ef8a31b4f653e2 | /src/main/java/data_science/ui/stat/pie/package-info.java | 52b92443029eb4b972df56cf403aee0b51433bb3 | [
"Apache-2.0"
] | permissive | sinoz/project-data3 | 259caf1ce9dbba02b86149cbb7f940cadcb368eb | c988dace7507c15253e8373647d75be44ea325b7 | refs/heads/master | 2021-01-18T21:12:35.547768 | 2017-04-20T09:59:52 | 2017-04-20T09:59:52 | 87,013,591 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 121 | java | /**
* Contains {@link javafx.scene.chart.PieChart} implementations.
* @author I.A
*/
package data_science.ui.stat.pie; | [
"ilyas.alfan.b@gmail.com"
] | ilyas.alfan.b@gmail.com |
77783551ce0a6b58bbdc04729c45538f081877fb | 3ca9b520f649fe0aad67fd673eaae380c02e93c7 | /spi-stub/src/main/java/de/adorsys/psd2/stub/impl/service/SpiMockData.java | 4995cf2ecc0f8519643c97e133ad112617b42e7d | [
"Apache-2.0"
] | permissive | snakx/xs2ajava | d41d9ffaa9ffb0272bbb274369c7be3f52e7f16c | e8f1eef5bb49f440f6626ad2b4056b4ec6f9d045 | refs/heads/master | 2023-04-23T19:40:56.172037 | 2021-05-05T12:36:26 | 2021-05-05T12:36:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,643 | java | /*
* Copyright 2018-2021 adorsys GmbH & Co KG
*
* 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.adorsys.psd2.stub.impl.service;
import de.adorsys.psd2.xs2a.core.domain.TppMessageInformation;
import de.adorsys.psd2.xs2a.core.error.MessageErrorCode;
import de.adorsys.psd2.xs2a.spi.domain.common.SpiHrefType;
import de.adorsys.psd2.xs2a.spi.domain.common.SpiLinks;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import java.util.Collections;
import java.util.Set;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class SpiMockData {
public static final SpiLinks SPI_LINKS = buildSpiLinks();
public static final Set<TppMessageInformation> TPP_MESSAGES = buildTppMessages();
private static SpiLinks buildSpiLinks() {
SpiLinks spiLinks = new SpiLinks();
spiLinks.setAccount(new SpiHrefType("Mock spi account link"));
return spiLinks;
}
private static Set<TppMessageInformation> buildTppMessages() {
return Collections.singleton(TppMessageInformation.buildWithCustomWarning(MessageErrorCode.FORMAT_ERROR, "Mocked tpp message from the bank"));
}
}
| [
"kya@adorsys.com.ua"
] | kya@adorsys.com.ua |
1fa15645236ca655e72dee28135d26d2644f0853 | 742dc223a9f3228b9098e2a9944e9dc580ccc637 | /src/main/java/com/epam/jwd/final_project/validation/BudgetValidator.java | 549b800fadc5303b89df1da7355e67b1518edddd | [] | no_license | Sviatlana-Zenko/jwd-final-project | 794c28b6ca491b6775fcd651746a0e77575c69f6 | 2fe0591ebc49522bb8db06f114a1541d07a5a400 | refs/heads/main | 2023-02-28T04:04:42.905961 | 2021-02-11T06:51:44 | 2021-02-11T06:51:44 | 333,456,678 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 796 | java | package com.epam.jwd.final_project.validation;
import com.epam.jwd.final_project.domain.CinemaProduct;
import com.epam.jwd.final_project.domain.Movie;
import java.util.List;
public class BudgetValidator extends Validator<CinemaProduct> {
public void validate(CinemaProduct product, List<String> validationErrors, ValidationType type) {
Integer budget = ((Movie) product).getBudget();
if (budget == null) {
if (type == ValidationType.CREATE_OBJECT) {
validationErrors.add("'budget' field is not filled or has wrong format");
}
} else {
if (budget < 0) {
validationErrors.add("'budget' can't be negative");
}
}
super.validate(product, validationErrors, type);
}
}
| [
"s.zenko1772453@gnail.com"
] | s.zenko1772453@gnail.com |
9c0a419b02d2fc43ec213d4fdb46af18cbaa9149 | 144f56dbc715a66b516f0a856945805e4c9ed1e9 | /app/src/main/java/com/br/compras/activity/CadastroSetorActivity.java | 4f68ce55c92d4f40fc9717aeb875b082c60ab8a2 | [] | no_license | micdias/ComprasApp | 68d372d4b273d8537885e3a5adb36b1e1e2aec10 | bb4349961c8580ca458b782c2763c8c397493b9a | refs/heads/master | 2020-01-27T10:03:28.759520 | 2016-08-21T02:06:38 | 2016-08-21T02:06:38 | 66,176,825 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,344 | java | package com.br.compras.activity;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.PopupMenu;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.br.compras.Enum.Cor;
import com.br.compras.R;
import com.br.compras.dados.Setor;
import com.br.compras.dao.SetorDAO;
import java.util.Arrays;
import java.util.List;
/**
* Created by Michel on 12/04/16.
*/
public class CadastroSetorActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.cadastro_setor);
List<Cor> listCores = Arrays.asList(Cor.values());
Spinner spinnerSetor = (Spinner) findViewById(R.id.spinnerCores);
ArrayAdapter<Cor> dataAdapter = new ArrayAdapter<Cor>(this, android.R.layout.simple_spinner_dropdown_item, listCores);
dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerSetor.setAdapter(dataAdapter);
spinnerSetor.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
Spinner spinnerSetor = (Spinner) findViewById(R.id.spinnerCores);
Cor corSelecionada = (Cor) spinnerSetor.getSelectedItem();
spinnerSetor.setBackgroundColor(Color.parseColor(corSelecionada.getRGB()));
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
Button botaoSalvar = (Button) findViewById(R.id.btnSalvar);
Toast.makeText(CadastroSetorActivity.this,"BEM VINDO",Toast.LENGTH_LONG).show();
botaoSalvar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TextView categoriaView = (TextView) findViewById(R.id.editTextCategoria);
Spinner spinnerSetor = (Spinner) findViewById(R.id.spinnerCores);
Cor corSelecionada = (Cor) spinnerSetor.getSelectedItem();
spinnerSetor.setBackgroundColor(Color.parseColor(corSelecionada.getRGB()));
Setor setor = new Setor(categoriaView.getText().toString(),corSelecionada);
SetorDAO setorDAO = SetorDAO.getInstance(CadastroSetorActivity.this);
if(setorDAO.gravar(setor)){
Toast.makeText(CadastroSetorActivity.this, "cadastro com sucesso"+ categoriaView.getText(),Toast.LENGTH_SHORT).show();
}else
{
Toast.makeText(CadastroSetorActivity.this, "erro no cadastro"+ categoriaView.getText(),Toast.LENGTH_SHORT).show();
}
//setorDAO.fecharConexao();
//voltando para tela inicial
Intent ir = new Intent(CadastroSetorActivity.this, ListaSetorActivity.class);
startActivity(ir);
finish();
}
});
}
}
| [
"Michel@MacBook.local"
] | Michel@MacBook.local |
8c15d97db747ea51315a0450c9042fb1aacd4564 | 01633d6c2d0f8666cc1654c6d69dcf0e58fd0710 | /pds/java/src/main/java/com/aliyun/pds/client/models/VideoDrmLicenseModel.java | f03d456ee58a3197f35119502de56d7b654deb54 | [
"Apache-2.0"
] | permissive | aliyun/alibabacloud-pds-sdk | 8ce0319629e28c157e693f3524dbb56084191ce8 | 6a908f186154de94a3167f991bf6d8631a2e4ce0 | refs/heads/master | 2023-07-02T14:35:34.726825 | 2022-05-20T21:55:32 | 2023-06-21T09:55:38 | 289,220,881 | 8 | 27 | Apache-2.0 | 2023-06-21T09:55:39 | 2020-08-21T08:40:16 | Java | UTF-8 | Java | false | false | 1,006 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.pds.client.models;
import com.aliyun.tea.*;
public class VideoDrmLicenseModel extends TeaModel {
@NameInMap("headers")
public java.util.Map<String, String> headers;
@NameInMap("body")
@Validation(required = true)
public CCPVideoDRMLicenseResponse body;
public static VideoDrmLicenseModel build(java.util.Map<String, ?> map) throws Exception {
VideoDrmLicenseModel self = new VideoDrmLicenseModel();
return TeaModel.build(map, self);
}
public VideoDrmLicenseModel setHeaders(java.util.Map<String, String> headers) {
this.headers = headers;
return this;
}
public java.util.Map<String, String> getHeaders() {
return this.headers;
}
public VideoDrmLicenseModel setBody(CCPVideoDRMLicenseResponse body) {
this.body = body;
return this;
}
public CCPVideoDRMLicenseResponse getBody() {
return this.body;
}
}
| [
"tianxuan.cl@alibaba-inc.com"
] | tianxuan.cl@alibaba-inc.com |
dbbbd2a42715212cbb7468c882db9f178c068f9a | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/JetBrains--intellij-community/d5bb7ee88443466df8d5c09a77c44bc98ea833ee/before/RedundantMethodOverrideInspection.java | 8d0344de8a222dd8e31c0fcb5873c05f08b62b26 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,366 | java | /*
* Copyright 2005-2007 Bas Leijdekkers
*
* 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.siyeh.ig.inheritance;
import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
import com.intellij.psi.search.searches.SuperMethodsSearch;
import com.intellij.psi.util.MethodSignatureBackedByPsiMethod;
import com.intellij.util.IncorrectOperationException;
import com.intellij.util.Query;
import com.siyeh.InspectionGadgetsBundle;
import com.siyeh.ig.BaseInspection;
import com.siyeh.ig.BaseInspectionVisitor;
import com.siyeh.ig.InspectionGadgetsFix;
import com.siyeh.ig.psiutils.EquivalenceChecker;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class RedundantMethodOverrideInspection extends BaseInspection {
@NotNull
public String getDisplayName() {
return InspectionGadgetsBundle.message(
"redundant.method.override.display.name");
}
@NotNull
protected String buildErrorString(Object... infos) {
return InspectionGadgetsBundle.message(
"redundant.method.override.problem.descriptor");
}
@Nullable
protected InspectionGadgetsFix buildFix(PsiElement location) {
return new RedundantMethodOverrideFix();
}
private static class RedundantMethodOverrideFix
extends InspectionGadgetsFix {
@NotNull
public String getName() {
return InspectionGadgetsBundle.message(
"redundant.method.override.quickfix");
}
public void doFix(Project project, ProblemDescriptor descriptor)
throws IncorrectOperationException {
final PsiElement methodNameIdentifier = descriptor.getPsiElement();
final PsiElement method = methodNameIdentifier.getParent();
assert method != null;
deleteElement(method);
}
}
public BaseInspectionVisitor buildVisitor() {
return new RedundantMethodOverrideVisitor();
}
private static class RedundantMethodOverrideVisitor
extends BaseInspectionVisitor {
@Override public void visitMethod(PsiMethod method) {
super.visitMethod(method);
final PsiCodeBlock body = method.getBody();
if (body == null) {
return;
}
if (method.getNameIdentifier() == null) {
return;
}
final Query<MethodSignatureBackedByPsiMethod> superMethodQuery =
SuperMethodsSearch.search(method, null, true, false);
final MethodSignatureBackedByPsiMethod signature =
superMethodQuery.findFirst();
if (signature == null) {
return;
}
final PsiMethod superMethod = signature.getMethod();
final PsiCodeBlock superBody = superMethod.getBody();
if (superBody == null) {
return;
}
final PsiModifierList superModifierList =
superMethod.getModifierList();
final PsiModifierList modifierList = method.getModifierList();
if (!EquivalenceChecker.modifierListsAreEquivalent(
modifierList, superModifierList)) {
return;
}
final PsiType superReturnType = superMethod.getReturnType();
if (superReturnType == null) {
return;
}
final PsiType returnType = method.getReturnType();
if (!superReturnType.equals(returnType)) {
return;
}
if (!EquivalenceChecker.codeBlocksAreEquivalent(body, superBody)) {
return;
}
registerMethodError(method);
}
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
fff091a27ba93e9543930b9014c2cacefcb8bdc7 | d1743e2901ec893df4a581017e7b3696b76a9b61 | /hrm_rebuild/src/main/java/com/company/hrm/hrm_rebuild/dao/entity/Mobilize.java | ec2ecff2be1f84842be5c0e27cd90c9b50624dfb | [
"Apache-2.0"
] | permissive | 1461664558/hrmRebuildBySpringBoot | ec4cf40e30840b58294f88f233c0729eb92a7183 | 3b518484b9da99a6276c78862a31265d7359d775 | refs/heads/master | 2020-05-02T19:37:19.630649 | 2019-03-28T08:55:42 | 2019-03-28T08:55:42 | 178,163,769 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,345 | java | package com.company.hrm.hrm_rebuild.dao.entity;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@Table(name = "t_emp_mobilize")
@Entity
public class Mobilize implements Serializable {
@Id
@GeneratedValue
private int eno;
private Date emdate;
@Column(length = 10, nullable = false)
private int odno;
@Column(length = 10, nullable = false)
private int idno;
@Override
public String toString() {
return "Mobilize{" +
"eno=" + eno +
", emdate=" + emdate +
", odno=" + odno +
", idno=" + idno +
'}';
}
public int getEno() {
return eno;
}
public void setEno(int eno) {
this.eno = eno;
}
public Date getEmdate() {
return emdate;
}
public void setEmdate(Date emdate) {
this.emdate = emdate;
}
public int getOdno() {
return odno;
}
public void setOdno(int odno) {
this.odno = odno;
}
public int getIdno() {
return idno;
}
public void setIdno(int idno) {
this.idno = idno;
}
public Mobilize(Date emdate, int odno, int idno) {
this.emdate = emdate;
this.odno = odno;
this.idno = idno;
}
public Mobilize() {
}
}
| [
"1461664558@qq.com"
] | 1461664558@qq.com |
0c2cf2c58f1bd075ee3d8585d0ca7b32ebe8aa85 | e0cb9c7a7ff3afb2d8b04da53c85f71a999f05f6 | /MyTest/app/src/main/java/exam/shidongming/me/mytest/PagerFragment2.java | a5837d7d71ef7bd48b65f67617fc3ce9c9d2be96 | [] | no_license | shidm/sdm_work | af6840224e2dc51d4695eb7795c818cd63f3ecc6 | 51481b55bd49deaa090e82fbc634d897251a611e | refs/heads/master | 2021-01-10T03:47:22.114499 | 2015-05-31T15:56:09 | 2015-05-31T15:56:09 | 36,607,426 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,157 | java | package exam.shidongming.me.mytest;
import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class PagerFragment2 extends Fragment implements MyListView.ILoadListener {
private static List mList;
private static boolean sd;
private MyListViewAdapter myAdapter;
private List myList = new ArrayList();
private MyListView listView;
private String theContent1,theContent,theContent2;
private Handler handler = new Handler();
private Handler mHandler = new Handler();
int a =0;
private View view;
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
// it();
myAdapter = new MyListViewAdapter(activity,R.layout.lv_item1,myList,false);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
view = inflater.inflate(R.layout.fragment2, container, false);
listView = (MyListView) view.findViewById(R.id.tv_ListView);
listView.setInterface(this);
listView.setAdapter(myAdapter);
listView.setonRefreshListener(new MyListView.OnRefreshListener() {
@Override
public void onRefresh() {
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
for (int i = 0; i < mList.size(); i++) {
myList.add(mList.get(i));
}
listView.onRefreshComplete();
myAdapter.notifyDataSetChanged();
}
}, 2000);
}
});
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
GetImageOrContent contentShow = (GetImageOrContent) myList.get(position - 1);
String myContent = contentShow.myContent;
Show.getBitmapOrContent(null, myContent, true);
Show show = new Show();
FragmentManager fm = getFragmentManager();
FragmentTransaction fragmentTransaction = fm.beginTransaction();
fragmentTransaction.add(R.id.myShow, show);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
}
});
handler.postDelayed(new Runnable() {
@Override
public void run() {
for (int i = 0; i < mList.size(); i++) {
myList.add(mList.get(i));
}
myAdapter.notifyDataSetChanged();
}
}, 1000);
return view;
}
public static void getContentList(List list,boolean x){
mList = list;
sd = x;
}
@Override
public void onLoad() {
final String[] url = new String[]{"http://jandan.net/?oxwlxojflwblxbsapi=jandan.get_duan_comments&page=2"
, "http://jandan.net/?oxwlxojflwblxbsapi=jandan.get_duan_comments&page=3"
, "http://jandan.net/?oxwlxojflwblxbsapi=jandan.get_duan_comments&page=4",
"http://jandan.net/?oxwlxojflwblxbsapi=jandan.get_duan_comments&page=5"};
if (a < 4) {
new Thread(new Runnable() {
@Override
public void run() {
new AsyncTask<String, Integer, Void>() {
@Override
protected Void doInBackground(String... params) {
String Url = params[a];
HttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(Url);
HttpResponse httpResponse = null;
try {
httpResponse = httpClient.execute(httpGet);
if (httpResponse.getStatusLine().getStatusCode() == 200) {
HttpEntity httpEntity = httpResponse.getEntity();
final String read = EntityUtils.toString(httpEntity, "utf-8");
parseJson(read);
a++;
}
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
myAdapter.notifyDataSetChanged();
listView.loadComplete();
}
}.execute(url);
}
}).start();
}
}
private void parseJson(String jsonData){
JSONObject jsonObject = null;
try {
jsonObject = new JSONObject(jsonData);
String comments = jsonObject.getString("comments");
parseArryJson(comments);
} catch (JSONException e) {
e.printStackTrace();
}
}
private void parseArryJson(String jsonData) {
JSONArray jsonArray = null;
try {
jsonArray = new JSONArray(jsonData);
for (int i = 0;i<jsonArray.length();i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
String content = jsonObject.getString("comment_content");
String title = jsonObject.getString("comment_author");
String time = jsonObject.getString("comment_date");
String dz = jsonObject.getString("vote_positive");
String cp = jsonObject.getString("vote_negative");
String tc = jsonObject.getString("comment_approved");
GetImageOrContent myGetImageOrContent = new GetImageOrContent(title, time
, dz, cp, tc, null, 0,content);
myList.add(myGetImageOrContent);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}
| [
"m18223549356@163.com"
] | m18223549356@163.com |
03ddf1b40d88d5259652d27cebc83036beeeaa74 | d0ac1fc199edcc6f5ad0056dbe1b5d886b563f89 | /gui/GeneratorOsob2/src/MainFrame.java | 4e85f746b7f5b2dc53ad9fa1f08dc0e1900bdd66 | [] | no_license | krzysztofkramarz/cwiczeniaJurczyk | 754326a4242cf5290dcd0fc468fbc42e49031b23 | ca0fd9e7f7df2423d0aec16262e5e8ed3fa64082 | refs/heads/master | 2021-01-11T08:03:10.248582 | 2017-02-11T23:48:21 | 2017-02-11T23:48:21 | 72,917,691 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,076 | java |
import java.awt.Component;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JCheckBox;
/*
* 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.
*/
/**
*
* @author kkramarz
*/
public class MainFrame extends javax.swing.JFrame {
List<String> imiona = new ArrayList<>();
Component[] tytulChecked;
/**
* Creates new form MainFrame
*/
public MainFrame() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
grupaPlec = new javax.swing.ButtonGroup();
jPanel1 = new javax.swing.JPanel();
radioPan = new javax.swing.JRadioButton();
radioPani = new javax.swing.JRadioButton();
tytulPanel = new javax.swing.JPanel();
checkProf = new javax.swing.JCheckBox();
checkDr = new javax.swing.JCheckBox();
checkMgr = new javax.swing.JCheckBox();
checkLicencjat = new javax.swing.JCheckBox();
checkMatura = new javax.swing.JCheckBox();
checkPodstawowka = new javax.swing.JCheckBox();
jPanel3 = new javax.swing.JPanel();
jPanel7 = new javax.swing.JPanel();
suwakMeski = new javax.swing.JScrollPane();
listaImionZenskich = new javax.swing.JList<>();
suwakDamski = new javax.swing.JScrollPane();
listaImionMeskich = new javax.swing.JList<>();
jPanel4 = new javax.swing.JPanel();
nazwisko = new javax.swing.JTextField();
jPanel5 = new javax.swing.JPanel();
jFormattedTextField1 = new javax.swing.JFormattedTextField();
jComboBox1 = new javax.swing.JComboBox<>();
jSpinner1 = new javax.swing.JSpinner();
jPanel6 = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new java.awt.GridLayout(2, 3));
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Płeć", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP));
jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.PAGE_AXIS));
radioPan.setBackground(new java.awt.Color(204, 255, 0));
grupaPlec.add(radioPan);
radioPan.setSelected(true);
radioPan.setText("Pan");
radioPan.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
radioPanActionPerformed(evt);
}
});
jPanel1.add(radioPan);
radioPani.setBackground(new java.awt.Color(255, 255, 0));
grupaPlec.add(radioPani);
radioPani.setText("Pani");
radioPani.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
radioPaniActionPerformed(evt);
}
});
jPanel1.add(radioPani);
getContentPane().add(jPanel1);
tytulPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Tytuł"));
tytulPanel.setLayout(new javax.swing.BoxLayout(tytulPanel, javax.swing.BoxLayout.PAGE_AXIS));
checkProf.setText("Prof.");
checkProf.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
checkProfActionPerformed(evt);
}
});
tytulPanel.add(checkProf);
checkDr.setText("hab.");
checkDr.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
checkDrActionPerformed(evt);
}
});
tytulPanel.add(checkDr);
checkMgr.setText("Dr");
checkMgr.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
checkMgrActionPerformed(evt);
}
});
tytulPanel.add(checkMgr);
checkLicencjat.setText("inż.");
checkLicencjat.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
checkLicencjatActionPerformed(evt);
}
});
tytulPanel.add(checkLicencjat);
checkMatura.setSelected(true);
checkMatura.setText("Mgr");
checkMatura.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
checkMaturaActionPerformed(evt);
}
});
tytulPanel.add(checkMatura);
checkPodstawowka.setText("licencjat");
checkPodstawowka.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
checkPodstawowkaActionPerformed(evt);
}
});
tytulPanel.add(checkPodstawowka);
getContentPane().add(tytulPanel);
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Imię"));
jPanel3.setLayout(new java.awt.BorderLayout());
jPanel7.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jPanel7.setLayout(new javax.swing.BoxLayout(jPanel7, javax.swing.BoxLayout.LINE_AXIS));
listaImionZenskich.setModel(new javax.swing.AbstractListModel<String>() {
String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
public int getSize() { return strings.length; }
public String getElementAt(int i) { return strings[i]; }
});
suwakMeski.setViewportView(listaImionZenskich);
jPanel7.add(suwakMeski);
listaImionMeskich.setModel(new javax.swing.AbstractListModel<String>() {
String[] strings = { "Wacek", "Bonifacy", "Ambroży", "Cezary", "Wójt gminy Kłaj", "Anna" };
public int getSize() { return strings.length; }
public String getElementAt(int i) { return strings[i]; }
});
listaImionMeskich.setSelectedIndex(2);
listaImionMeskich.setVisibleRowCount(4);
suwakDamski.setViewportView(listaImionMeskich);
jPanel7.add(suwakDamski);
jPanel3.add(jPanel7, java.awt.BorderLayout.CENTER);
getContentPane().add(jPanel3);
jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Nazwisko"));
nazwisko.setToolTipText("");
nazwisko.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
nazwiskoActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(nazwisko, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(118, Short.MAX_VALUE))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(nazwisko, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(150, Short.MAX_VALUE))
);
getContentPane().add(jPanel4);
jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Data ur."));
jFormattedTextField1.setText("jFormattedTextField1");
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(12, 12, 12)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jFormattedTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(36, 36, 36)
.addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(85, Short.MAX_VALUE))
);
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jFormattedTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(76, Short.MAX_VALUE))
);
getContentPane().add(jPanel5);
jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Menu"));
jPanel6.setLayout(new java.awt.GridBagLayout());
jButton1.setText("wypisz");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jPanel6.add(jButton1, new java.awt.GridBagConstraints());
jButton2.setText("zeruj");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jPanel6.add(jButton2, new java.awt.GridBagConstraints());
dopasujListeImion();
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 0, Short.MAX_VALUE)
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 0, Short.MAX_VALUE)
);
jPanel6.add(jPanel2, new java.awt.GridBagConstraints());
getContentPane().add(jPanel6);
pack();
}// </editor-fold>//GEN-END:initComponents
private void radioPanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioPanActionPerformed
listaImionMeskich.setEnabled(true);
listaImionZenskich.setEnabled(false);
}//GEN-LAST:event_radioPanActionPerformed
void dopasujListeImion() {
suwakDamski.setVisible(true);
suwakMeski.setVisible(false);
pack();
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
radioPani.setSelected(true);
tytulChecked = tytulPanel.getComponents();
for (Component c : tytulChecked) {
((JCheckBox) c).setSelected(false);
}
listaImionMeskich.setSelectedIndex(1);
boolean czyPan = radioPan.isSelected();
listaImionMeskich.setEnabled(czyPan);
listaImionZenskich.setEnabled(!czyPan);
}//GEN-LAST:event_jButton2ActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
String opis = "";
if (radioPan.isSelected()) {
opis += "Pan";
} else {
opis += "Pani";
}
tytulChecked = tytulPanel.getComponents();
for (Component c : tytulChecked) {
JCheckBox rb = (JCheckBox) c;
if (rb.isSelected()) {
opis += " " + rb.getText();
}
}
opis += " o imionach:";
imiona = listaImionMeskich.getSelectedValuesList();
for (String imie : imiona) {
opis += " " + imie;
}
System.out.println("Osoba " + opis);
}//GEN-LAST:event_jButton1ActionPerformed
private void radioPaniActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioPaniActionPerformed
listaImionMeskich.setVisible(false);
listaImionZenskich.setVisible(true);
}//GEN-LAST:event_radioPaniActionPerformed
private void checkProfActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkProfActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_checkProfActionPerformed
private void checkMgrActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkMgrActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_checkMgrActionPerformed
private void checkDrActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkDrActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_checkDrActionPerformed
private void checkLicencjatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkLicencjatActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_checkLicencjatActionPerformed
private void checkMaturaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkMaturaActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_checkMaturaActionPerformed
private void checkPodstawowkaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkPodstawowkaActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_checkPodstawowkaActionPerformed
private void nazwiskoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nazwiskoActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_nazwiskoActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new MainFrame().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JCheckBox checkDr;
private javax.swing.JCheckBox checkLicencjat;
private javax.swing.JCheckBox checkMatura;
private javax.swing.JCheckBox checkMgr;
private javax.swing.JCheckBox checkPodstawowka;
private javax.swing.JCheckBox checkProf;
private javax.swing.ButtonGroup grupaPlec;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JComboBox<String> jComboBox1;
private javax.swing.JFormattedTextField jFormattedTextField1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel6;
private javax.swing.JPanel jPanel7;
private javax.swing.JSpinner jSpinner1;
private javax.swing.JList<String> listaImionMeskich;
private javax.swing.JList<String> listaImionZenskich;
private javax.swing.JTextField nazwisko;
private javax.swing.JRadioButton radioPan;
private javax.swing.JRadioButton radioPani;
private javax.swing.JScrollPane suwakDamski;
private javax.swing.JScrollPane suwakMeski;
private javax.swing.JPanel tytulPanel;
// End of variables declaration//GEN-END:variables
}
| [
"krzysztofkramarz@tlen.pl"
] | krzysztofkramarz@tlen.pl |
8677ef1988de088ae052fda4b9a9fda25e36406c | 9254e7279570ac8ef687c416a79bb472146e9b35 | /linkedmall-20180116/src/main/java/com/aliyun/linkedmall20180116/models/SettleOrderResponse.java | 4250bab967b2e5e6de4d42e10bb71347f31f2741 | [
"Apache-2.0"
] | permissive | lquterqtd/alibabacloud-java-sdk | 3eaa17276dd28004dae6f87e763e13eb90c30032 | 3e5dca8c36398469e10cdaaa34c314ae0bb640b4 | refs/heads/master | 2023-08-12T13:56:26.379027 | 2021-10-19T07:22:15 | 2021-10-19T07:22:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,829 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.linkedmall20180116.models;
import com.aliyun.tea.*;
public class SettleOrderResponse extends TeaModel {
@NameInMap("Code")
@Validation(required = true)
public String code;
@NameInMap("Message")
@Validation(required = true)
public String message;
@NameInMap("RequestId")
@Validation(required = true)
public String requestId;
@NameInMap("TradeOrderSettleResponse")
@Validation(required = true)
public SettleOrderResponseTradeOrderSettleResponse tradeOrderSettleResponse;
public static SettleOrderResponse build(java.util.Map<String, ?> map) throws Exception {
SettleOrderResponse self = new SettleOrderResponse();
return TeaModel.build(map, self);
}
public SettleOrderResponse setCode(String code) {
this.code = code;
return this;
}
public String getCode() {
return this.code;
}
public SettleOrderResponse setMessage(String message) {
this.message = message;
return this;
}
public String getMessage() {
return this.message;
}
public SettleOrderResponse setRequestId(String requestId) {
this.requestId = requestId;
return this;
}
public String getRequestId() {
return this.requestId;
}
public SettleOrderResponse setTradeOrderSettleResponse(SettleOrderResponseTradeOrderSettleResponse tradeOrderSettleResponse) {
this.tradeOrderSettleResponse = tradeOrderSettleResponse;
return this;
}
public SettleOrderResponseTradeOrderSettleResponse getTradeOrderSettleResponse() {
return this.tradeOrderSettleResponse;
}
public static class SettleOrderResponseTradeOrderSettleResponse extends TeaModel {
@NameInMap("OutRequestNo")
@Validation(required = true)
public String outRequestNo;
@NameInMap("TradeNo")
@Validation(required = true)
public String tradeNo;
public static SettleOrderResponseTradeOrderSettleResponse build(java.util.Map<String, ?> map) throws Exception {
SettleOrderResponseTradeOrderSettleResponse self = new SettleOrderResponseTradeOrderSettleResponse();
return TeaModel.build(map, self);
}
public SettleOrderResponseTradeOrderSettleResponse setOutRequestNo(String outRequestNo) {
this.outRequestNo = outRequestNo;
return this;
}
public String getOutRequestNo() {
return this.outRequestNo;
}
public SettleOrderResponseTradeOrderSettleResponse setTradeNo(String tradeNo) {
this.tradeNo = tradeNo;
return this;
}
public String getTradeNo() {
return this.tradeNo;
}
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
f0723c5426e7c55e953ae2a782429510d69a50aa | 63ba6b16877fe2ae633d83adfc2564fa44604d11 | /Top Down Parser/src/ArithOp.java | 064e0e86153d0ae3901d7da656456a4eb98add49 | [] | no_license | daisyramos317/Java-Projects | 56dd83b0f5564f10610cd7114e0960d7cd95975d | 21425a3fe18051b479673599a0c80a082edb0cdb | refs/heads/master | 2016-09-06T18:03:00.100754 | 2015-05-22T03:24:49 | 2015-05-22T03:24:49 | 34,091,880 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 602 | java | abstract class ArithOp extends FunOp
{
}
class Arith_Plus extends ArithOp
{
void printParseTree(String indent)
{
LexArithArray.displayln(indent + indent.length() + " +");
}
}
class Arith_Minus extends ArithOp
{
void printParseTree(String indent)
{
LexArithArray.displayln(indent + indent.length() + " -");
}
}
class Arith_Mul extends ArithOp
{
void printParseTree(String indent)
{
LexArithArray.displayln(indent + indent.length() + " *");
}
}
class Arith_Div extends ArithOp
{
void printParseTree(String indent)
{
LexArithArray.displayln(indent + indent.length() + " /");
}
}
| [
"daisyramos317@gmail.com"
] | daisyramos317@gmail.com |
0b77949535b7aa346f1d2d7463ae143d241c5232 | 3b17adef5680d6cdf58f763693cd5a58219793c9 | /src/main/java/com/aliniribeiro/helpdesk/api/security/jwt/JwtUserFactory.java | b34476feb0a49906d3b2c59336590610e990a106 | [] | no_license | liniribeiro/helpdesk-backend | 422a42a38225e38b71a9f8d9d50a6d9ce0804919 | a8c35576a4b1d261b04f405e286792e13f963fef | refs/heads/master | 2021-09-18T01:37:09.864171 | 2018-07-08T22:39:32 | 2018-07-08T22:39:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,076 | java | package com.aliniribeiro.helpdesk.api.security.jwt;
import com.aliniribeiro.helpdesk.api.entitiy.User;
import com.aliniribeiro.helpdesk.api.enums.ProfileEnum;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import java.util.ArrayList;
import java.util.List;
public class JwtUserFactory {
private JwtUserFactory() {
}
/**
* Converte e gera um Usuário com base nos dados do usuário
*
* @param user
* @return
*/
public static JwtUser create(User user) {
return new JwtUser(user.getId() , user.getEmail(), user.getPassword(),
mapToGrantedAuthorities(user.getProfile()));
}
/**
* Converte o perfil do usuário para o formato utilizado no Spring Security
*
* @return uma lista de GrantedAuthority
*/
private static List<GrantedAuthority> mapToGrantedAuthorities(ProfileEnum profile) {
List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
authorities.add(new SimpleGrantedAuthority(profile.toString()));
return authorities;
}
}
| [
"aliniribeiroo@gmail.com"
] | aliniribeiroo@gmail.com |
9dda45a186c1bacb2a4ab81066bfe5988766f233 | 9ac181282aa8a1cfd4e01d7d056984092f36f0c3 | /src/main/java/com/ofs/heroku/addonwizard/impl/dto/DeployData.java | 178b88d16e2115866b85852ba0f724a17b10cc39 | [] | no_license | ganeshramr/addon-wizard | 100d7dcce7205310c0a59a604e6158d9006bd01e | 35a00331757e40ae4cfeaf4e74a7f8327a5e8b9d | refs/heads/master | 2021-01-25T09:44:23.713761 | 2018-03-07T15:09:12 | 2018-03-07T15:09:12 | 123,315,384 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,145 | java | package com.ofs.heroku.addonwizard.impl.dto;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({ "source_blob" })
public class DeployData {
@JsonProperty("source_blob")
private SourceBlob sourceBlob;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("source_blob")
public SourceBlob getSourceBlob() {
return sourceBlob;
}
@JsonProperty("source_blob")
public void setSourceBlob(SourceBlob sourceBlob) {
this.sourceBlob = sourceBlob;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}
| [
"mailganesh@gmail.com"
] | mailganesh@gmail.com |
344a2f896d74dd5fd3564c66b0a5411a2393a2cc | c2ec81d2664c8d82593818e589802a7984e43b3d | /src/exercicios/Exe04.java | 4c3a738c0a22b550c5caf4ddd449d732acf6eb74 | [] | no_license | FABRICIOZARLING/entra21 | 6e6b7288666afd95162bfd9ea30d9af14eb813ea | 97a1d1a055bc03b039875eb574f529bdf57c11ff | refs/heads/master | 2020-03-17T19:09:51.179598 | 2018-05-18T20:25:13 | 2018-05-18T20:25:13 | 133,848,241 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 2,331 | java | package exercicios;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class Exe04 {
public static void main(String[] args) {
JFrame formulario = new JFrame("Registro de produto e desconto com formulário de Input");
formulario.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
formulario.setSize(330, 500);
formulario.setLocationRelativeTo(null);
formulario.setLayout(null);
//JLabel
JLabel produto = new JLabel("Produto");
produto.setBounds(30, 30, 100, 20);
JLabel valor = new JLabel("Valor");
valor.setBounds(30, 60, 100, 20);
JLabel pagamento= new JLabel("Pagamento");
pagamento.setBounds(30, 90, 100, 20);
JLabel resultado = new JLabel();
resultado.setBounds(30, 210, 250, 50);
//resultado.setBackground(Color.red);
//resultado.setOpaque(true);
//JTextfield
JTextField c_prod = new JTextField();
c_prod .setBounds(120, 30, 150, 20);
JTextField c_valor = new JTextField();
c_valor.setBounds(120, 60, 150, 20);
JComboBox<String> combo = new JComboBox<>();
combo.setBounds(120, 90, 150, 20);
combo.addItem("Á Prazo");
combo.addItem("Á vista");
//JButton
JButton acao = new JButton("Calcular preço");
acao.setBounds(30, 150, 250, 20);
acao.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String texto = "O produto "+produto.getText()+" custará R$ ";
if(Double.parseDouble(c_valor.getText())>500&&combo.getSelectedIndex()==1) {
texto += String.format("%.2f", (Double.parseDouble(c_valor.getText())*0.9));
}else {
texto += String.format("%.2f", Double.parseDouble(c_valor.getText()));
}
texto = "<html><div style=\"width: 200px;\"><center>"+texto+"</center><div></html>";
resultado.setText(texto);
}
});
formulario.add(produto);
formulario.add(valor);
formulario.add(pagamento);
formulario.add(c_prod);
formulario.add(c_valor);
formulario.add(combo);
formulario.add(acao);
formulario.add(resultado);
//Exibir
formulario.setVisible(true);
}
}
| [
"100392@SALA120A.proway.treina"
] | 100392@SALA120A.proway.treina |
1a2004e0ffccea8871af58a3d62e6b34fec79f2a | 34f08cfab7c3889a4e2181fe82fc67421a0a4414 | /src/main/java/gr/alexc/employees/service/EmployeeService.java | dae14a7d501b4faf5cdb0be11757f8bfcbaf03a3 | [] | no_license | Alex18gr/employees-spring | 00e81b55652b5e757a619b594aa550a857971fc6 | e84b21030ebba41236109d1fee26f254708c8602 | refs/heads/master | 2023-03-16T03:55:24.996699 | 2021-02-28T23:19:02 | 2021-02-28T23:19:02 | 342,989,307 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 269 | java | package gr.alexc.employees.service;
import gr.alexc.employees.dto.EmployeeDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
public interface EmployeeService {
Page<EmployeeDTO> getEmployees(Pageable pageable);
}
| [
"alexchih02@gmail.com"
] | alexchih02@gmail.com |
866fbf65363ee1dda9ee120ce48eb1cee6b249e2 | 5aa8f056d86e9320456e3acb9462a9e6e545231f | /Laboratorio 1/Implementacion/ServidorCentral/target/generated-sources/annotations/Entidades/InscripcionPrograma_.java | 09867bf8ddc426e655ddc88c02566143e4a2f4f5 | [] | no_license | Agu458/EdExt | 3902dc80b9fb8fac30a70c632539fb18bfdb84d7 | 9f79bc6c4f1d45ef67827b1fb221161c13ee07da | refs/heads/master | 2023-01-27T17:17:34.260901 | 2020-11-21T12:40:09 | 2020-11-21T12:40:09 | 292,038,774 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 748 | java | package Entidades;
import Entidades.ProgramaFormacion;
import Entidades.Usuario;
import java.util.Date;
import javax.annotation.Generated;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
@Generated(value="EclipseLink-2.5.2.v20140319-rNA", date="2020-10-29T15:04:10")
@StaticMetamodel(InscripcionPrograma.class)
public class InscripcionPrograma_ {
public static volatile SingularAttribute<InscripcionPrograma, Usuario> estudiante;
public static volatile SingularAttribute<InscripcionPrograma, Date> fecha;
public static volatile SingularAttribute<InscripcionPrograma, ProgramaFormacion> programa;
public static volatile SingularAttribute<InscripcionPrograma, Long> id;
} | [
"66385798+Agu458@users.noreply.github.com"
] | 66385798+Agu458@users.noreply.github.com |
c27ff073cc0be6a0416fa18f3f78eb857fcd9a16 | bf816b8395e34421a352b7326570723d0e569f6b | /JavaWordIp.java | da67140886b2682a966fd650b3824655eca59f56 | [
"MIT"
] | permissive | xingzhicn/sparkip | 86c5df4850cd7fd32605b2088575a57853bd4f2a | 5cb689acc404c91edeb57631581cc3537406c6c8 | refs/heads/master | 2022-04-05T05:59:31.353778 | 2020-01-10T01:58:21 | 2020-01-10T01:58:21 | 113,434,434 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,637 | java | package com.lehoolive.spark.utils;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.broadcast.Broadcast;
import java.util.ArrayList;
import java.util.List;
public class JavaWordIp {
private static volatile Broadcast<List<String[]>> instance = null;
public static Broadcast<List<String[]>> getInstance(JavaSparkContext jsc) {
if (instance == null) {
synchronized (JavaWordIp.class) {
if (instance == null) {
List<String> ipCollect = jsc.textFile("hdfs://master:8020/user/ip.txt").collect();
List<String[]> ipList = new ArrayList<>();
try {
for (String line : ipCollect) {
if (!"".equals(line)) {
String[] split = line.split("\\|");
if (split[2] != null && split[3] != null && split[7] != null) {
String[] ipSection = new String[3];
ipSection[0] = split[2];
ipSection[1] = split[3];
ipSection[2] = split[7];
ipList.add(ipSection);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
instance = jsc.broadcast(ipList);
}
}
}
return instance;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
91bd6150c016e8d4cf8d42817d32c55a914c89bc | bef8a88af27287f31868a25e4291a594aee40fbc | /ProjetFinalJavaV2/app/src/main/java/getrekt/projetfinaljavav2/appli/gui/SeuilSansTaxeDialog.java | 167c6ed745dece9810290aa846c5a2529b2f46ff | [] | no_license | wilomgfx/AndroidFinalProject | 5fab05b80c8c05d79843201d8b2da90c93d0d1d5 | 3d74c84585356c209b6889a15521d0182ec532f6 | refs/heads/master | 2021-01-24T20:59:05.507940 | 2015-05-29T01:24:47 | 2015-05-29T01:24:54 | 35,503,179 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,247 | java | package getrekt.projetfinaljavav2.appli.gui;
/**
* Created by William on 2015-05-19.
*/
import android.app.DialogFragment;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import getrekt.projetfinaljavav2.R;
import getrekt.projetfinaljavav2.models.InvalidDataException;
import getrekt.projetfinaljavav2.service.TransactionService;
/**
* Created by William on 2015-05-19.
*/
public class SeuilSansTaxeDialog extends DialogFragment {
public Context context;
TransactionService transService;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
final View v = inflater.inflate(R.layout.seuil_sans_taxe_dialog, container, false);
transService = new TransactionService(context);
Button btnSansTaxes = (Button)v.findViewById(R.id.buttonSansTaxes);
final EditText txtSansTaxes = (EditText)v.findViewById(R.id.txt_seuil);
getDialog().setTitle((getString(R.string.tax_freeAmount)));
btnSansTaxes.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
Double valeur = Double.parseDouble(txtSansTaxes.getText().toString());
transService.AppliquerSeuilSansTaxes(valeur);
Toast.makeText(getActivity().getApplicationContext(), (getString(R.string.tax_freeIsnow)) + valeur.toString(), Toast.LENGTH_LONG).show();
dismiss();
} catch (InvalidDataException e) {
Toast.makeText(getActivity().getApplicationContext(), e.getMessage(), Toast.LENGTH_LONG).show();
} catch (NumberFormatException e) {
Toast.makeText(getActivity().getApplicationContext(), e.getMessage(), Toast.LENGTH_LONG).show();
}
Log.i("sansTaxeDebug", transService.getNoTaxAmount().toString());
}
});
return v;
}
}
| [
"william@hugocantin.info"
] | william@hugocantin.info |
dce8025ae872df63a9b280051f372a7db5e1ba60 | 7086b3a58546b8b49060fb7f0f33e949fc899185 | /arithmetic-java/src/main/java/xyz/tmlh/datastruct/tree/huffman/HuffmanCode.java | 6d065989fabbfae2173cacc67b70ec2fdd92106c | [] | no_license | tmlh98/arithmetic | a16708c0c3efe130150bdf681267121465135a8a | 82e1663cfce1ca61dfef63f85ff2577781530f65 | refs/heads/master | 2020-05-17T17:24:49.397857 | 2019-08-06T14:01:00 | 2019-08-06T14:01:00 | 183,851,000 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 13,101 | java | package xyz.tmlh.datastruct.tree.huffman;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
public class HuffmanCode {
// 生成赫夫曼树对应的赫夫曼编码
// 思路:
// 1. 将赫夫曼编码表存放在 Map<Byte,String> 形式
// 生成的赫夫曼编码表{32=01, 97=100, 100=11000, 117=11001, 101=1110, 118=11011, 105=101, 121=11010, 106=0010, 107=1111,
// 108=000, 111=0011}
static Map<Byte, String> huffmanCodes = new HashMap<Byte, String>();
// 2. 在生成赫夫曼编码表示,需要去拼接路径, 定义一个StringBuilder 存储某个叶子结点的路径
static StringBuilder stringBuilder = new StringBuilder();
public static void main(String[] args) {
String content = "i like like like java do you like a java";
byte[] bytes = content.getBytes();
byte[] huffmanZip = huffmanZip(bytes);
byte[] decode = decode(huffmanCodes, huffmanZip);
for (byte b : decode) {
System.out.print((char)b);
}
System.out.println("---------------------------------------------------------------------");
//测试解压文件
String zipFile = "D:\\note\\note.txt";
String dstFile = "D:\\note\\note.xml";
zipFile(zipFile, "D:\\note");
// unZipFile(zipFile, dstFile);
System.out.println("解压成功!");
}
//编写一个方法,完成对压缩文件的解压
/**
*
* @param zipFile 准备解压的文件
* @param dstFile 将文件解压到哪个路径
*/
public static void unZipFile(String zipFile, String dstFile) {
//定义文件输入流
InputStream is = null;
//定义一个对象输入流
ObjectInputStream ois = null;
//定义文件的输出流
OutputStream os = null;
try {
//创建文件输入流
is = new FileInputStream(zipFile);
//创建一个和 is关联的对象输入流
ois = new ObjectInputStream(is);
//读取byte数组 huffmanBytes
byte[] huffmanBytes = (byte[])ois.readObject();
//读取赫夫曼编码表
Map<Byte,String> huffmanCodes = (Map<Byte,String>)ois.readObject();
//解码
byte[] bytes = decode(huffmanCodes, huffmanBytes);
//将bytes 数组写入到目标文件
os = new FileOutputStream(dstFile);
//写数据到 dstFile 文件
os.write(bytes);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
os.close();
ois.close();
is.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
/**
* 将一个文件进行压缩
*
* @param srcFile 你传入的希望压缩的文件的全路径
* @param dstFile 我们压缩后将压缩文件放到哪个目录
*/
public static void zipFile(String srcFile, String dstFile) {
//创建输出流
OutputStream os = null;
ObjectOutputStream oos = null;
//创建文件的输入流
FileInputStream is = null;
try {
//创建文件的输入流
is = new FileInputStream(srcFile);
//创建一个和源文件大小一样的byte[]
byte[] b = new byte[is.available()];
//读取文件
is.read(b);
//直接对源文件压缩
byte[] huffmanBytes = huffmanZip(b);
//创建文件的输出流, 存放压缩文件
os = new FileOutputStream(dstFile);
//创建一个和文件输出流关联的ObjectOutputStream
oos = new ObjectOutputStream(os);
//把 赫夫曼编码后的字节数组写入压缩文件
oos.writeObject(huffmanBytes); //我们是把
//这里我们以对象流的方式写入 赫夫曼编码,是为了以后我们恢复源文件时使用
//注意一定要把赫夫曼编码 写入压缩文件
oos.writeObject(huffmanCodes);
}catch (Exception e) {
e.printStackTrace();
}finally {
try {
is.close();
oos.close();
os.close();
}catch (Exception e) {
e.printStackTrace();
}
}
}
//完成数据的解压
//思路
//1. 将huffmanCodeBytes [-88, -65, -56, -65, -56, -65, -55, 77, -57, 6, -24, -14, -117, -4, -60, -90, 28]
// 重写先转成 赫夫曼编码对应的二进制的字符串 "1010100010111..."
//2. 赫夫曼编码对应的二进制的字符串 "1010100010111..." =》 对照 赫夫曼编码 =》 "i like like like java do you like a java"
/**
* 完成对压缩数据的解码
*
* @param huffmanCodes 赫夫曼编码表 map
* @param huffmanBytes 赫夫曼编码得到的字节数组
* @return 就是原来的字符串对应的数组
*/
private static byte[] decode(Map<Byte,String> huffmanCodes, byte[] huffmanBytes) {
//1. 先得到 huffmanBytes 对应的 二进制的字符串 , 形式 1010100010111...
StringBuilder sBuilder = new StringBuilder();
//将byte数组转成二进制的字符串
for(int i = 0; i < huffmanBytes.length; i++) {
byte b = huffmanBytes[i];
//判断是不是最后一个字节
boolean flag = (i == huffmanBytes.length - 1);
sBuilder.append(byteToBitString(!flag, b));
}
//把字符串按照指定的赫夫曼编码进行解码
//把赫夫曼编码表进行调换,因为反向查询 a->100 100->a
Map<String, Byte> map = new HashMap<String,Byte>();
for(Map.Entry<Byte, String> entry: huffmanCodes.entrySet()) {
map.put(entry.getValue(), entry.getKey());
}
//创建要给集合,存放byte
List<Byte> list = new ArrayList<Byte>();
String temp = "";
String bytes = sBuilder.toString();
for (int i = 0; i < bytes.length(); i++) {
temp += bytes.charAt(i);
if(map.containsKey(temp)) {
list.add(map.get(temp));
temp = "";
}
}
byte b[] = new byte[list.size()];
for(int i = 0;i < b.length; i++) {
b[i] = list.get(i);
}
return b;
}
/**
* 将一个byte 转成一个二进制的字符串
* @param b 传入的 byte
* @param flag 标志是否需要补高位如果是true ,表示需要补高位,如果是false表示不补, 如果是最后一个字节,无需补高位
* @return 是该b 对应的二进制的字符串,(注意是按补码返回)
*/
private static String byteToBitString(boolean flag, byte b) {
//使用变量保存 b
int temp = b; //将 b 转成 int`
//如果是正数我们还存在补高位
if(flag) {
temp |= 256; //按位与 256 1 0000 0000 | 0000 0001 => 1 0000 0001
}
String str = Integer.toBinaryString(temp); //返回的是temp对应的二进制的补码
if(flag) {
return str.substring(str.length() - 8);
} else {
return str;
}
}
/**
* 将前面的方法封装起来
*
* @param bytes 原始的字符串对应的字节数组
* @return 是经过 赫夫曼编码处理后的字节数组(压缩后的数组)
*/
private static byte[] huffmanZip(byte[] bytes) {
List<CodeNode> nodes = getNodes(bytes);
//获取哈夫曼编码表
Map<Byte, String> haffmanCodeTable = getCodes(createHuffmanTree(nodes));
byte[] zip = zip(bytes , haffmanCodeTable);
return zip;
}
/**
* 编写一个方法,将字符串对应的byte[] 数组,通过生成的赫夫曼编码表,返回一个赫夫曼编码 压缩后的byte[]
*
* @param bytes 这时原始的字符串对应的 byte[]
* @param huffmanCodes 生成的赫夫曼编码map
* @return 返回赫夫曼编码处理后的 byte[]
*/
private static byte[] zip(byte[] bytes, Map<Byte, String> huffmanCodes) {
StringBuilder sBuilder = new StringBuilder();
for (byte b : bytes) {
sBuilder.append(huffmanCodes.get(b));
}
int len = (sBuilder.length() + 7) / 8;
//创建 存储压缩后的 byte数组
byte[] huffmanCodeBytes = new byte[len];
for (int i = 0,index = 0; i < sBuilder.length(); i += 8, index ++) {
String str = "";
if(i + 8 > sBuilder.length()) {
str = sBuilder.substring(i);
}else {
str = sBuilder.substring(i , i + 8);
}
huffmanCodeBytes[index] = (byte)Integer.parseInt(str, 2);
}
return huffmanCodeBytes;
}
/**
* 重载getCodes 方法
*
* @param @param root
* @param @return 参数
* @return Map<Byte,String> 返回类型
* @throws
*/
private static Map<Byte, String> getCodes(CodeNode root) {
if (root == null) {
return null;
}
// 处理root的左子树
getCodes((CodeNode)root.getLeft(), "0", stringBuilder);
// 处理root的右子树
getCodes((CodeNode)root.getRight(), "1", stringBuilder);
return huffmanCodes;
}
/**
* 功能:将传入的node结点的所有叶子结点的赫夫曼编码得到,并放入到huffmanCodes集合
*
* @param node 传入结点
* @param code 路径: 左子结点是 0, 右子结点 1
* @param stringBuilder 用于拼接路径
*/
private static void getCodes(CodeNode node, String code, StringBuilder stringBuilder) {
StringBuilder stringBuilder2 = new StringBuilder(stringBuilder);
// 将code 加入到 stringBuilder2
stringBuilder2.append(code);
if (node != null) { // 如果node == null不处理
// 判断当前node 是叶子结点还是非叶子结点
if (node.getData() == null) { // 非叶子结点
// 递归处理
// 向左递归
getCodes((CodeNode)node.getLeft(), "0", stringBuilder2);
// 向右递归
getCodes((CodeNode)node.getRight(), "1", stringBuilder2);
} else { // 说明是一个叶子结点
// 就表示找到某个叶子结点的最后
huffmanCodes.put(node.getData(), stringBuilder2.toString());
}
}
}
/**
*
* @param bytes 接收字节数组
* @return 返回的就是 List 形式 [Node[date=97 ,weight = 5], Node[]date=32,weight = 9]......],
*/
private static List<CodeNode> getNodes(byte[] bytes) {
LinkedList<CodeNode> nodes = new LinkedList<CodeNode>();
// 遍历 bytes , 统计 每一个byte出现的次数->map[key,value]
Map<Byte, Integer> counts = new HashMap<Byte, Integer>();
for (byte b : bytes) {
Integer count = counts.get(b);
if (count == null) { // Map还没有这个字符数据,第一次
counts.put(b, 1);
} else {
counts.put(b, count + 1);
}
}
for (Map.Entry<Byte, Integer> entry : counts.entrySet()) {
nodes.add(new CodeNode(entry.getKey(), entry.getValue()));
}
return nodes;
}
// 创建一颗哈夫曼树
private static CodeNode createHuffmanTree(List<CodeNode> nodes) {
LinkedList<CodeNode> nodeList = (LinkedList<CodeNode>)nodes;
while (nodeList.size() > 1) {
Collections.sort(nodeList);
CodeNode firstNode = nodeList.poll();
CodeNode secondNode = nodeList.poll();
CodeNode rootNode = new CodeNode(firstNode.getNo() + secondNode.getNo());
rootNode.setLeft(firstNode);
rootNode.setRight(secondNode);
nodeList.add(rootNode);
}
return nodeList.peek();
}
}
class CodeNode extends Node {
/**
* 字符
*/
private Byte data;
/**
* @param no 表示字符出现的次数
*/
public CodeNode(int no) {
super(no);
}
public CodeNode(Byte data, int no) {
super(no);
this.data = data;
}
public Byte getData() {
return data;
}
public String toString() {
return "data:" + data + ",weight:" + getNo();
}
} | [
"tmlh98@aliyun.com"
] | tmlh98@aliyun.com |
996cb2f255eecb16b89497b566cc677fb615534e | e56f8a02c22c4e9d851df4112dee0c799efd7bfe | /vip/trade/src/main/java/com/alipay/api/request/AlipayMpointprodBenefitDetailGetRequest.java | e2f35d536e5f9dfc5220185c230c3ca0ef271810 | [] | no_license | wu-xian-da/vip-server | 8a07e2f8dc75722328a3fa7e7a9289ec6ef1d1b1 | 54a6855224bc3ae42005b341a2452f25cfeac2c7 | refs/heads/master | 2020-12-31T00:29:36.404038 | 2017-03-27T07:00:02 | 2017-03-27T07:00:02 | 85,170,395 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,643 | java | package com.alipay.api.request;
import java.util.Map;
import com.alipay.api.AlipayRequest;
import com.alipay.api.internal.util.AlipayHashMap;
import com.alipay.api.response.AlipayMpointprodBenefitDetailGetResponse;
/**
* ALIPAY API: alipay.mpointprod.benefit.detail.get request
*
* @author auto create
* @since 1.0, 2015-01-29 15:46:36
*/
public class AlipayMpointprodBenefitDetailGetRequest implements AlipayRequest<AlipayMpointprodBenefitDetailGetResponse> {
private AlipayHashMap udfParams; // add user-defined text parameters
private String apiVersion="1.0";
/**
* 消息体内容,JSON格式,不含换行、空格
参数:
userId: 支付用户ID, 可以直接传递openId
benefitType: 权益类型,支持(MemberGrade:会员等级)
benefitStatus: 状态只支持(VALID:生效、WAIT:待生效、INVALID:失效), 默认:全部
*/
private String bizContent;
public void setBizContent(String bizContent) {
this.bizContent = bizContent;
}
public String getBizContent() {
return this.bizContent;
}
private String terminalType;
private String terminalInfo;
private String prodCode;
private String notifyUrl;
public String getNotifyUrl() {
return this.notifyUrl;
}
public void setNotifyUrl(String notifyUrl) {
this.notifyUrl = notifyUrl;
}
public String getApiVersion() {
return this.apiVersion;
}
public void setApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
}
public void setTerminalType(String terminalType){
this.terminalType=terminalType;
}
public String getTerminalType(){
return this.terminalType;
}
public void setTerminalInfo(String terminalInfo){
this.terminalInfo=terminalInfo;
}
public String getTerminalInfo(){
return this.terminalInfo;
}
public void setProdCode(String prodCode) {
this.prodCode=prodCode;
}
public String getProdCode() {
return this.prodCode;
}
public String getApiMethodName() {
return "alipay.mpointprod.benefit.detail.get";
}
public Map<String, String> getTextParams() {
AlipayHashMap txtParams = new AlipayHashMap();
txtParams.put("biz_content", this.bizContent);
if(udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public void putOtherTextParam(String key, String value) {
if(this.udfParams == null) {
this.udfParams = new AlipayHashMap();
}
this.udfParams.put(key, value);
}
public Class<AlipayMpointprodBenefitDetailGetResponse> getResponseClass() {
return AlipayMpointprodBenefitDetailGetResponse.class;
}
}
| [
"programboy@126.com"
] | programboy@126.com |
f7bebd4c8938537df685cff1332682eb83c71b78 | b5a159ce0ec147ad20487713380bd96998a8ad15 | /app/src/main/java/com/shushan/thomework101/mvp/ui/fragment/student/MineStudentFragmentControl.java | d44112525371f83a55f855f8274b25f67632e580 | [] | no_license | llxqb/homework101_tea_new | 14208c07c0e32d630a9966450772fbd4c98991f7 | 67f9ca561f4cde9fa7434f987fb2ea863c62bf80 | refs/heads/master | 2022-03-17T01:08:14.229889 | 2019-12-02T09:44:07 | 2019-12-02T09:44:07 | 206,764,693 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 871 | java | package com.shushan.thomework101.mvp.ui.fragment.student;
import com.shushan.thomework101.entity.request.MineStudentListRequest;
import com.shushan.thomework101.entity.response.MineStudentResponse;
import com.shushan.thomework101.mvp.presenter.LoadDataView;
import com.shushan.thomework101.mvp.presenter.Presenter;
/**
* Created by li.liu on 2019/05/28.
*/
public class MineStudentFragmentControl {
/**
* 我的辅导记录、老师页面辅导反馈
*/
public interface MineStudentFragmentView extends LoadDataView {
void getMineStudentInfoSuccess(MineStudentResponse response);
}
public interface MineStudentFragmentPresenter extends Presenter<MineStudentFragmentView> {
/**
* 请求我的学生列表
*/
void onRequestMineStudentInfo(MineStudentListRequest mineStudentListRequest);
}
}
| [
"liuli7168165"
] | liuli7168165 |
eaceb938c368591405cc7a2813bad46372c3168b | 9137da7c8de4106cda2f1fdcf9e3dadf55542d4c | /src/test/java/com/games/online/shop/repository/OrderRepositoryTest.java | 97eb7b2943be69172e5a2a18321062c514b57e62 | [] | no_license | madi-and-matti/games-online-shop | e3cce12f209a82a4b4c1a85d93f13fd4926df8d8 | f59740d3eed7ffcc49385a1b12751c435e220067 | refs/heads/main | 2023-08-24T05:29:05.501081 | 2021-09-23T13:52:52 | 2021-09-23T13:52:52 | 304,039,874 | 0 | 0 | null | 2021-10-13T22:54:30 | 2020-10-14T14:25:02 | Java | UTF-8 | Java | false | false | 4,150 | java | package com.games.online.shop.repository;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import com.games.online.shop.GamesOnlineShopApp;
import com.games.online.shop.domain.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.transaction.annotation.Transactional;
/**
* Integration tests for {@link OrderRepository}.
*/
@SpringBootTest(classes = GamesOnlineShopApp.class)
@Transactional
public class OrderRepositoryTest {
@Autowired
private OrderRepository orderRepository;
@Autowired
private OrderItemRepository orderItemRepository;
@Autowired
private GameRepository gameRepository;
@Test
public void testOrderIsCreated() {
Order order = new Order();
order = orderRepository.save(order);
assertThat(order.getId()).isNotNull();
}
@Test
public void testOrderIsDeleted() {
Order order = new Order();
order = orderRepository.save(order);
orderRepository.deleteById(order.getId());
Optional<Order> deletedOrder = orderRepository.findById(order.getId());
assertThat(deletedOrder).isEmpty();
}
@Test
public void getOrderItemsReturnsAListOfOrderItems() {
Order order = new Order();
order = orderRepository.save(order);
List<OrderItem> orderItemList = new ArrayList<>();
for (int i = 0; i < 3; i++) {
OrderItem mockedItem = mock(OrderItem.class);
orderItemList.add(mockedItem);
}
order.setOrderItems(orderItemList);
List<OrderItem> testList = order.getOrderItems();
assertThat(testList).isNotEmpty();
assertThat(testList.size()).isEqualTo(3);
}
@Test
public void testLinkingOrderItemAndOrderAddsOrderItemToList() {
Order order = new Order();
OrderItem orderItem = new OrderItem();
OrderItemId orderItemId = new OrderItemId(order.getId(), "y56td93iXw");
orderItem.setId(orderItemId);
orderItem.setOrder(order);
order.addOrderItem(orderItem);
Order savedOrder = orderRepository.saveAndFlush(order);
Optional<Order> orderFromDb = orderRepository.findById(savedOrder.getId());
List<OrderItem> orderItemList = orderFromDb.get().getOrderItems();
assertThat(orderItemList).hasSize(1);
}
@Test
public void testRemovingOrderItemDeletesItFromOrderItemListOfOrder() {
Order order = new Order();
OrderItem orderItem = new OrderItem();
OrderItemId orderItemId = new OrderItemId(order.getId(), "y56td93iXw");
orderItem.setId(orderItemId);
orderItem.setOrder(order);
order.addOrderItem(orderItem);
Order savedOrder = orderRepository.saveAndFlush(order);
orderItemRepository.saveAndFlush(orderItem);
orderItemRepository.delete(orderItem);
savedOrder.getOrderItems().remove(orderItem);
Optional<Order> orderFromDb = orderRepository.findById(savedOrder.getId());
List<OrderItem> orderItemList = orderFromDb.get().getOrderItems();
assertThat(orderItemList).hasSize(0);
}
@Test
public void testDeletingOrderDeletesItsOrderItemsButNotGame() {
String productId = "y56td93iXw";
Order order = new Order();
OrderItem orderItem = new OrderItem();
OrderItemId orderItemId = new OrderItemId(order.getId(), productId);
orderItem.setId(orderItemId);
orderItem.setOrder(order);
order.addOrderItem(orderItem);
Order savedOrder = orderRepository.saveAndFlush(order);
orderItemRepository.saveAndFlush(orderItem);
orderRepository.delete(savedOrder);
Optional<OrderItem> orderItemFromDb = orderItemRepository.findById(orderItemId);
assertThat(orderItemFromDb).isEmpty();
Optional<Game> game = gameRepository.findById(productId);
assertThat(game).isPresent();
}
}
| [
"madison.carr@utexas.edu"
] | madison.carr@utexas.edu |
f4626f56205bc735b4368ec1781e1339b204fea1 | ea399d4fc8050450ad9440c8e433bba8e1f1f735 | /CS2210/Assignment4/src/Record.java | d06aa3a3f8ccca8a92da5b3c451925eeba831b69 | [] | no_license | LesterX/Assignments | 1edef1f819e958b88153bdd54a4049c9e20f90b0 | b2e1c88f8b4383b2000b42e831073449a573565f | refs/heads/master | 2021-01-20T14:58:26.354702 | 2017-05-10T03:55:13 | 2017-05-10T03:55:13 | 90,694,940 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 396 | java | /**
* Record
* @author Yimin Xu 250876566
*
*/
public class Record
{
private Key recordKey;
private String recordData;
// Constructor
public Record(Key k, String data)
{
recordKey = k;
recordData = data;
}
// Return the key of the record
public Key getKey()
{
return recordKey;
}
// Return the data of the record
public String getData()
{
return recordData;
}
}
| [
"xymtz@live.com"
] | xymtz@live.com |
23dd9e28308086741f2d18e21a5f7595f5358888 | f0c694f0ed36caca3d1a25b532ecbdd6f97bff7f | /hw5/hw5/Invoice.java | a60900cf3d356fc942e990d3e51698f085fda1da | [] | no_license | dimitrovanalysis/CS151-OOD | f9d8ba2d2994fc1530ade5f0874770a9aad3d7ad | 0c20a19f7f511d214f963e7d116234ef56a47122 | refs/heads/master | 2020-03-27T09:46:40.228713 | 2018-11-05T00:21:05 | 2018-11-05T00:21:05 | 146,371,400 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,184 | java | import java.util.*;
import javax.swing.event.*;
/**
An invoice for a sale, consisting of line items.
*/
public class Invoice
{
/**
Constructs a blank invoice.
*/
public Invoice()
{
items = new ArrayList<>();
listeners = new ArrayList<>();
}
/**
Adds an item to the invoice.
@param item the item to add
*/
public void addItem(LineItem item)
{
if(items.contains(item)) {
item.increaseQuantity();
}
else {
items.add(item);
}
// Notify all observers of the change to the invoice
ChangeEvent event = new ChangeEvent(this);
for (ChangeListener listener : listeners)
listener.stateChanged(event);
}
/**
32 Adds a change listener to the invoice.
33 @param listener the change listener to add
34 */
public void addChangeListener(ChangeListener listener)
{
listeners.add(listener);
}
/**
41 Gets an iterator that iterates through the items.
42 @return an iterator for the items
43 */
public Iterator<LineItem> getItems()
{
return new
Iterator<LineItem>()
{
public boolean hasNext()
{
return current < items.size();
}
public LineItem next()
{
return items.get(current++);
}
public void remove()
{
throw new UnsupportedOperationException();
}
private int current = 0;
};
}
public String format(InvoiceFormatter formatter)
{
String r = formatter.formatHeader();
Iterator<LineItem> iter = getItems();
while (iter.hasNext())
r += formatter.formatLineItem(iter.next());
return r + formatter.formatFooter();
}
private ArrayList<LineItem> items;
private ArrayList<ChangeListener> listeners;
} | [
"noreply@github.com"
] | noreply@github.com |
ed9b8eed52e6e10014ffdaa90609b8e49211a96d | 785ea36ed516b5702d9a5f8d049fbd01b5d8483d | /app/src/main/java/com/voodoo/termowifi/MainActivity.java | 20a66b83df47155fc8aa162740edb6a36fad6f93 | [] | no_license | tsbp/termowifi_android | ea82142036b78cc9061cc89b51fa2113a2de1cbe | 42861cf81a2bc37ed829161751e9ec1fd55c2fe7 | refs/heads/master | 2020-06-16T10:13:24.363758 | 2016-12-03T15:11:19 | 2016-12-03T15:11:19 | 75,115,511 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,845 | java | package com.voodoo.termowifi;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.voodoo.termowifi.UDPProcessor.OnReceiveListener;
import java.net.InetAddress;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;
public class MainActivity extends Activity implements OnReceiveListener
{
TextView tvTime, inTemp, outTemp;;
public static UDPProcessor udpProcessor ;
Button btnGetdata, btnStat,setBtn;
ProgressBar pbWait;
com.voodoo.termowifi.plot inCanvas, outCanvas;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// tv = (TextView) findViewById(R.id.tvLabel);
tvTime = (TextView) findViewById(R.id.response);
ipMaster = null;
udpProcessor = new UDPProcessor(7777);
udpProcessor.start();
udpProcessor.setOnReceiveListener(this);
inTemp = (TextView) findViewById(R.id.inTemp);
inTemp.setShadowLayer(5, 2, 2, Color.BLACK);
outTemp = (TextView) findViewById(R.id.outTemp);
outTemp.setShadowLayer(5, 2, 2, Color.BLACK);
inCanvas = (com.voodoo.termowifi.plot) findViewById(R.id.inCanvas);
outCanvas = (com.voodoo.termowifi.plot) findViewById(R.id.outCanvas);
pbWait = (ProgressBar) findViewById(R.id.progressBar);
pbWait.setVisibility(View.VISIBLE);
btnGetdata = (Button) findViewById(R.id.updtbtn);
btnStat = (Button) findViewById(R.id.espbtn);
setBtn = (Button) findViewById(R.id.setbtn);
//==========================================================================================
btnGetdata.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
extTemp = false;
plotDataRequest();
}
});
//==========================================================================================
setBtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
udpProcessor.stop();
Intent intent = new Intent(MainActivity.this, settingsActivity.class);
startActivity(intent);
}
});
}
//==============================================================================================
boolean extTemp;
//==============================================================================================
void plotDataRequest()
{
pbWait.setVisibility(View.VISIBLE);
byte [] pack = new byte[8];
SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMddHHmmss", Locale.UK);
Calendar cal = Calendar.getInstance();
String timeString = dateFormat.format(cal.getTime());
byte[] timeBuf = new byte[6];
for(int i = 0; i < 6; i++)
pack[i+2] = (byte)Integer.parseInt(timeString.substring(i*2,(i*2 +2)));
pack[0] = 0x20;
if(extTemp) pack[1] = (byte)0x80;
else pack[1] = (byte)0x00;
DataFrame df = new DataFrame(pack);
udpProcessor.send(ipMaster,df);
}
//==============================================================================================
//String _ipMaster = "";
public static InetAddress ipMaster = null;
//==============================================================================================
public void onFrameReceived(InetAddress ip, IDataFrame frame)
{
byte[] in = frame.getFrameData();
String str = new String(in);
switch(in[0])
{
case (byte)0x10: // BROADCAST_DATA
str = str.substring(1, 9) + " ";
if(in.length > 9) {
if(ipMaster == null) {
setBtn.setVisibility(View.VISIBLE);
btnGetdata.setVisibility(View.VISIBLE);
// _ipMaster = ip.toString();
ipMaster = ip;
btnStat.setBackgroundResource(R.drawable.heater_icon);
Toast t = Toast.makeText(getApplicationContext(),
"Connected", Toast.LENGTH_SHORT);
t.setGravity(Gravity.BOTTOM, 0, 0);
t.show();
pbWait.setVisibility(View.INVISIBLE);
plotDataRequest();
}
tvTime.setText(ip.toString() + "/ " + in[11] + ":" + in[10] + ":" + in[9] + ", " + in[12] + "." + (in[13] + 1) + "." + in[14]);
}
if(str.charAt(0) != '0') {
String s = str.substring(0, 3) + "." + str.substring(3, 4);
if(s.charAt(1) == '0') s = s.substring(0,1) + s.substring(2);
inTemp.setText(s);
}
if(str.charAt(4) != '0') {
String s = (str.substring(4, 7) + "." + str.substring(7, 8));
if(s.charAt(1) == '0') s = s.substring(0,1) + s.substring(2);
outTemp.setText(s);
}
//tv.setText(rTmp1 + " ... " + rTmp2);
break;
case (byte) 0x21://#define PLOT_DATA_ANS
pbWait.setVisibility(View.INVISIBLE);
short[] pData = new short[24];
for(int i = 0; i < 24; i++)
pData[i] = ((short)((in[1 + i*2] & 0xff) | ((in[1+ i*2 +1] & 0xff) << 8)));
plot.aBuf = pData;
String sign = "";
if(pData[23] > 0) sign = "+";
//tvTime.setText(ip.toString());
if(extTemp) {
plot.aColor = new int[]{120, 255, 255, 0};
outCanvas.invalidate();
outTemp.setText(sign + String.valueOf((float) pData[23] / 10));
}
else
{
plot.aColor = new int[]{150, 102, 204, 255};
inCanvas.invalidate();
inTemp.setText(sign + String.valueOf((float) pData[23] / 10));
extTemp = true;
plotDataRequest();
}
break;
default: //case (byte) 0xAA: //OK_ANS
tvTime.setText("SAVED!!!");
break;
}
}
@Override
protected void onDestroy() {
super.onDestroy();
udpProcessor.stop();
}
}
| [
"tsbp82@gmail.com"
] | tsbp82@gmail.com |
49d21b4dfb0aac95041dca541fd2f5d6c6554664 | 65b2fa4eaf9385c2242c32245d583d1e766ec934 | /src/main/java/org/revo/txok/Repository/ExamRepository.java | 2661127cbe3af8e6ff508a0bc2da6adeccbcf810 | [] | no_license | ashraf-revo/txok | 53efd1199feaaf4401091e80b41ec1bee0b339bc | 188e427aa50e302dacef786431c2d84cc682b69d | refs/heads/master | 2020-03-25T04:56:00.701478 | 2018-08-16T16:25:43 | 2018-08-16T16:25:43 | 143,416,793 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 228 | java | package org.revo.txok.Repository;
import org.revo.txok.Domain.Exam;
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;
public interface ExamRepository extends ReactiveMongoRepository<Exam, String> {
}
| [
"ashraf1abdelrasool@gmail.com"
] | ashraf1abdelrasool@gmail.com |
d18b67a318977b5a1b8aaaea0afd9124fac7698d | 83ac7d1b06f966fb762754d2f68f078e80ccf5e7 | /ExerciciVariablesFase1/ExerciciM1/ClaseFase1.java | c3d828c529b7b8c93cf8decbf6c4dd62f202a72a | [] | no_license | dasucard/Exercici_Variables | c02bc1492e7d4592ebb5d096bcd6289563440127 | 24cd615de334ffeb1cdf694604db1ff8664ef50b | refs/heads/master | 2023-01-20T00:16:44.734439 | 2020-11-24T10:45:20 | 2020-11-24T10:45:20 | 313,972,719 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 322 | java | package ExerciciM1;
public class ClaseFase1 {
public static void main(String[] args) {
String Nom="David";
String Cognom1="Suárez";
String Cognom2="Cárdenas";
System.out.println(Cognom1+Cognom2+Nom);
int dia=18;
int mes=11;
int any=2020;
System.out.println(dia+"/"+mes+"/"+any);
}
}
| [
"dasucard@gmail.com"
] | dasucard@gmail.com |
25e0026a80e6b5d3609ca6102e79c464bd614633 | 1081885a90250f1a103d952a787f83c8384ee7be | /artisynth/core/mechmodels/MechSystem.java | e789a2b55ce09696e622db69cba92668860101f4 | [] | no_license | edwardwang1/artisynth_core | b1b3136e629fcad80d37c90fa3301c291851258f | 25317ca777f44b687086442e66c964dc6072166a | refs/heads/master | 2021-01-21T04:05:12.482477 | 2017-08-30T17:24:08 | 2017-08-30T17:24:08 | 101,908,896 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 29,089 | java | /**
* Copyright (c) 2014, by the Authors: John E Lloyd (UBC)
*
* This software is freely available under a 2-clause BSD license. Please see
* the LICENSE file in the ArtiSynth distribution directory for details.
*/
package artisynth.core.mechmodels;
import java.util.*;
import artisynth.core.modelbase.StepAdjustment;
import maspack.matrix.*;
import maspack.util.IntHolder;
/**
* Interface to a second order mechanical system that can be integrated by
* a variety of integrators.
*/
public interface MechSystem {
/**
* Flag passed to {@link #updateConstraints updateConstraints()}
* indicating that contact information should be computed.
*/
public static final int COMPUTE_CONTACTS = 0x01;
/**
* Flag passed to {@link #updateConstraints updateConstraints()} indicating
* that contact information should be updated. This means that there has
* only been an adjustment in position and existing contacts between bodies
* should be maintained, though possibly with a modified set of constraints.
*/
public static final int UPDATE_CONTACTS = 0x02;
/**
* Contains information for a single constraint direction
*/
public class ConstraintInfo {
// Note: distance to the constraint surface should be signed in such a
// way that solving the constraint equation G dx = -dist will produce
// an impulse that moves the system back towards the constraint surface.
public double dist; // distance to the constraint surface.
public double compliance;// inverse stiffness; 0 implies rigid constraint
public double damping; // damping; only used if compliance > 0
public double force; // used for computing non-linear compliance
};
/**
* Contains information for a single friction constraint set.
* This is associated with one bilateral or unilateral constraint,
* and corresponds to a single column block entry in the transposed friction
* constraint matrix <code>DT</code> produced by
* {@link #getFrictionConstraints getFrictionConstraints()}.
* The constraint set contains either one or two friction directions
* (corresponding to a column block size of either 1 or 2).
*/
public class FrictionInfo {
// Flag indicating that the associated contact constraint is BILATERAL
public static final int BILATERAL = 0x01;
public double mu; // friction coefficient
public int contactIdx0; // corresponding contact constraint index
public int contactIdx1; // second contact constraint index (if needed)
public int flags; // information flags
/**
* Returns the maximum friction value based on the most recent
* contact force and the coefficient of friction. Contacts forces
* are stored in the supplied vector lam, at the location(s) indexed
* by contactIdx0 and (possibly) contactIdx1.
*/
public double getMaxFriction (VectorNd lam) {
if (contactIdx1 == -1) {
return mu*lam.get(contactIdx0);
}
else {
return mu*Math.hypot (lam.get(contactIdx0), lam.get(contactIdx1));
}
}
};
/**
* Returns the current structure version of this system. The structure
* version should be incremented whenever the number and arrangement
* of active and parametric components changes, implying that
* any mass and solve matrices should be be rebuilt.
*
* @return current structure version number for this system
*/
public int getStructureVersion();
/**
* Returns the size of the position state for all active components.
* This should remain unchanged as long as the current structure
* version (returned by {@link #getStructureVersion getStructureVersion()}
* remains unchanged.
*
* @return size of the active position state
*/
public int getActivePosStateSize();
/**
* Gets the current position state for all active components. This is stored
* in the vector <code>q</code> (which will be sized appropriately by the
* system).
*
* @param q
* vector in which the state is stored
*/
public void getActivePosState (VectorNd q);
/**
* Sets the current position state for all active components. This is
* supplied in the vector <code>q</code>, whose size should be greater than
* or equal to the value returned by {@link #getActivePosStateSize
* getActivePosStateSize()}.
*
* @param q
* vector supplying the state information
*/
public void setActivePosState (VectorNd q);
/**
* Returns the size of the velocity state for all active components.
* This should remain unchanged as long as the current structure
* version (returned by {@link #getStructureVersion getStructureVersion()}
* remains unchanged.
*
* @return size of the velocity state
*/
public int getActiveVelStateSize();
/**
* Gets the current velocity state for all active components. This is stored
* in the vector <code>u</code> (which will be sized appropriately by the
* system).
*
* @param u
* vector in which the state is stored
*/
public void getActiveVelState (VectorNd u);
/**
* Sets the current velocity state for all active components. This is
* supplied in the vector <code>u</code>, whose size should be greater than
* or equal to the value returned by {@link #getActiveVelStateSize
* getActiveVelStateSize()}.
*
* @param u
* vector supplying the state information
*/
public void setActiveVelState (VectorNd u);
/**
* Returns the size of the position state for all parametric components.
* This should remain unchanged as long as the current structure
* version (returned by {@link #getStructureVersion getStructureVersion()}
* remains unchanged.
*
* @return size of the parametric position state
*/
public int getParametricPosStateSize();
/**
* Obtains the desired target position for all parametric components at a
* particular time. This is stored in the vector <code>q</code> (which will
* be sized appropriately by the system).
*
* The system interpolates between the current parametric position values
* and those desired for the end of the time step, using a parameter
* <code>s</code> defined on the interval [0,1]. In particular, specifying
* s = 0 yields the current parametric positions, and s = 1 yields the
* positions desired for the end of the step. The actual time step size
* <code>h</code> is also provided, as this may be needed by some
* interpolation methods.
*
* <p>The interpolation uses the current parametric positions, and possibly
* the current parametric velocities as well. Hence this method should be
* called before either of these are changed using {@link
* #setParametricPosState setParametricPosState()} or {@link
* #setParametricVelState setParametricVelState()}.
*
* @param q
* vector returning the state information
* @param s
* specifies time relative to the current time step
* @param h
* time step size
*/
public void getParametricPosTarget (VectorNd q, double s, double h);
/**
* Gets the current position state for all parametric components. This is
* stored in the vector <code>q</code> (which will be sized appropriately by
* the system).
*
* @param q
* vector in which the state is stored
*/
public void getParametricPosState (VectorNd q);
/**
* Sets the current position state for all parametric components. This is
* supplied in the vector <code>q</code>, whose size should be greater than
* or equal to the value returned by {@link #getParametricPosStateSize
* getParametricPosStateSize()}.
*
* @param q
* vector supplying the state information
*/
public void setParametricPosState (VectorNd q);
/**
* Returns the size of the velocity state for all parametric components.
* This should remain unchanged as long as the current structure
* version (returned by {@link #getStructureVersion getStructureVersion()}
* remains unchanged.
*
* @return size of the parametric velocity state
*/
public int getParametricVelStateSize();
/**
* Obtains the desired target velocity for all parametric components at a
* particular time. This is stored in the vector <code>u</code> (which will
* be sized appropriately by the system).
*
* The system interpolates between the current parametric velocity values
* and those desired for the end of the time step, using a parameter
* <code>s</code> defined on the interval [0,1]. In particular, specifying
* s = 0 yields the current parametric velocities, and s = 1 yields the
* velocities desired for the end of the step. The actual time step size
* <code>h</code> is also provided, as this may be needed by some
* interpolation methods.
*
* <p>The interpolation uses the current parametric velocities, and possibly
* the current parametric positions as well. Hence this method should be
* called before either of these are changed using {@link
* #setParametricPosState setParametricPosState()} or {@link
* #setParametricVelState setParametricVelState()}.
*
* @param u
* vector returning the parametric target velocites
* @param s
* specifies time relative to the current time step
* @param h
* time step size
*/
public void getParametricVelTarget (VectorNd u, double s, double h);
/**
* Gets the current velocity state for all parametric components. This is
* stored in the vector <code>u</code> (which will be sized appropriately by
* the system).
*
* @param u
* vector in which state is stored
*/
public void getParametricVelState (VectorNd u);
/**
* Sets the current velocity state for all parametric components. This is
* supplied in the vector <code>u</code>, whose size should be greater than
* or equal to the value returned by {@link #getParametricVelStateSize
* getParametricVelStateSize()}.
*
* @param u
* vector supplying the state information
*/
public void setParametricVelState (VectorNd u);
/**
* Sets the forces associated with parametric components. This is supplied
* in the vector <code>f</code>, whose size should be greater or equal to
* the value returned by {@link #getParametricVelStateSize
* getParametricVelStateSize()}.
*
* @param f
* vector supplying the force information
*/
public void setParametricForces (VectorNd f);
/**
* Gets the forces associated with parametric components. This is returned
* in the vector <code>f</code> (which will be sized appropriately by the
* system).
*
* @param f
* vector in which to return the force information
*/
public void getParametricForces (VectorNd f);
/**
* Gets the current value of the position derivative for all active
* components. This is stored in the vector <code>dxdt</code> (which will be
* sized appropriately by the system).
*
* @param dxdt
* vector in which the derivative is stored
* @param t
* current time value
*/
public void getActivePosDerivative (VectorNd dxdt, double t);
/**
* Returns the generalized forces acting on all the active components in this
* system. This is stored in the vector <code>f</code> (which will be
* sized appropriately by the system).
*
* @param f
* vector in which the forces are stored
*/
public void getActiveForces (VectorNd f);
/**
* Sets the generalized forces acting on all the active components in this
* system. The values are specifies in the vector <code>f</code>, whose size
* should be greater or equal to the value returned by
* {@link #getActiveVelStateSize getActiveVelStateSize()}.
*
* @param f
* vector specifying the forces to be set
*/
public void setActiveForces (VectorNd f);
/**
* Builds a mass matrix for this system. This is done by adding blocks of an
* appropriate type to the sparse block matrix <code>M</code>. On input,
* <code>M</code> should be empty with zero size; it will be sized
* appropriately by the system.
*
* <p>This method returns <code>true</code> if the mass matrix is constant;
* i.e., does not vary with time. It does not place actual values in the
* matrix; that must be done by calling {@link #getMassMatrix
* getMassMatrix()}.
*
* <p>A new mass matrix should be built whenever the system's structure
* version (as returned by {@link #getStructureVersion
* getStructureVersion()}) changes.
*
* @param M matrix in which the mass matrix will be built
* @return true if the mass matrix is constant.
*/
public boolean buildMassMatrix (SparseBlockMatrix M);
/**
* Sets <code>M</code> to the current value of the mass matrix for this
* system, evaluated at time <code>t</code>. <code>M</code> should
* have been previously created with a call to
* {@link #buildMassMatrix buildMassMatrix()}. The curzrent mass forces
* are returned in the vector <code>f</code>, which should have a
* size greater or equal to the size of <code>M</code>.
* The mass forces (also known as the fictitious forces)
* are given by
* <pre>
* - dM/dt u
* </pre>
* where <code>u</code> is the current system velocity.
* <code>f</code> will be sized appropriately by the system.
*
* @param M returns the mass matrix
* @param f returns the mass forces
* @param t current time
*/
public void getMassMatrix (SparseBlockMatrix M, VectorNd f, double t);
/**
* Sets <code>Minv</code> to the inverse of the mass matrix <code>M</code>.
* <code>Minv</code> should have been previously created with a call to
* {@link #buildMassMatrix buildMassMatrix()}.
*
* <p> This method assumes that <code>M</code> is block diagonal and hence
* <code>Minv</code> has the same block structure. Although it is possible
* to compute <code>Minv</code> by simply inverting each block of
* <code>M</code>, the special structure of each mass block may permit
* the system to do this in a highly optimized way.
*
* @param Minv returns the inverted mass matrix
* @param M mass matrix to invert
*/
public void getInverseMassMatrix (SparseBlockMatrix Minv, SparseBlockMatrix M);
public void mulInverseMass (SparseBlockMatrix M, VectorNd a, VectorNd f);
/**
* Builds a solve matrix for this system. This is done by adding blocks of
* an appropriate type to the sparse block matrix <code>S</code>. On input,
* <code>S</code> should be empty with zero size; it will be sized
* appropriately by the system. The resulting matrix should have all the
* blocks required to store any combination of the mass matrix, the
* force-position Jacobian, and the force-velocity Jacobian.
*
* This method does not place actual values in the matrix; that must be done
* by adding a mass matrix to it, or by calling {@link #addVelJacobian
* addVelJacobian()} or
* {@link #addPosJacobian addPosJacobian()}.
*
* <p>A new solve matrix should be built whenever the system's structure
* version (as returned by {@link #getStructureVersion
* getStructureVersion()}) changes.
*
* @param S matrix in which the solve matrix will be built
*/
public void buildSolveMatrix (SparseNumberedBlockMatrix S);
/**
* Returns information about the solve matrix for this system. This consists
* of an or-ed set of flags, including {@link
* maspack.matrix.Matrix#SYMMETRIC SYMMETRIC} or {@link
* maspack.matrix.Matrix#SYMMETRIC POSITIVE_DEFINITE},
* which aid in determining the best way to solve the matrix.
*
* @return type information for the solve matrix
*/
public int getSolveMatrixType();
/**
* Returns the current number of active components in this system.
* This should remain unchanged as long as the current structure
* version (returned by {@link #getStructureVersion getStructureVersion()}
* remains unchanged.
*
* @return number of active components
*/
public int numActiveComponents();
/**
* Returns the current number of parametric components in this system.
* This should remain unchanged as long as the current structure
* version (returned by {@link #getStructureVersion getStructureVersion()}
* remains unchanged.
*
* @return number of parametric components
*/
public int numParametricComponents();
/**
* Adds the current force-velocity Jacobian, scaled by <code>h</code>, to
* the matrix <code>S</code>, which should have been previously created with
* a call to {@link #buildSolveMatrix buildSolveMatrix()}.
* Addition fictitious forces associated
* with the Jacobian can be optionally returned in the vector
* <code>f</code>, which will be sized appropriately by the system.
*
* @param S
* matrix to which scaled Jacobian is to be added
* @param f
* if non-null, returns fictitious forces associated with the Jacobian
* @param h
* scale factor for the Jacobian
*/
public void addVelJacobian (SparseNumberedBlockMatrix S, VectorNd f, double h);
/**
* Adds the current force-position Jacobian, scaled by <code>h</code>, to
* the matrix <code>S</code>, which should have been previously created with
* a call to {@link #buildSolveMatrix buildSolveMatrix()}. Addition
* fictitious forces associated with the Jacobian can be optionally returned
* in the vector <code>f</code>, which will be sized appropriately by the
* system.
*
* @param S
* matrix to which scaled Jacobian is to be added
* @param f
* if non-null, returns fictitious forces associated with the Jacobian
* @param h
* scale factor for the Jacobian
*/
public void addPosJacobian (SparseNumberedBlockMatrix S, VectorNd f, double h);
/**
* Obtains the transpose of the current bilateral constraint matrix G for this
* system. This is built and stored in <code>GT</code>. On input,
* <code>GT</code> should be empty with zero size; it will be sized
* appropriately by the system. The derivative term is returned
* in <code>dg</code>; this is given by
* <pre>
* dG/dt u
* </pre>
* where <code>u</code> is the current system velocity.
* <code>dg</code> will also be sized appropriately by the system.
*
* <p>The method returns a version number for the constraint structure. This
* number should be incremented whenever the block structure of the
* constraint matrix changes.
*
* @param GT returns the transpose of G
* @param dg returns the derivative term for G
* @return constraint structure version number
*/
public int getBilateralConstraints (SparseBlockMatrix GT, VectorNd dg);
/**
* Obtains information for all the constraint directions returned
* by the most recent call to {@link #getBilateralConstraints
* getBilateralConstraints()}.
* The information is returned in the array <code>ginfo</code>,
* which should contain preallocated
* {@link artisynth.core.mechmodels.MechSystem.ConstraintInfo ConstraintInfo}
* structures and should have a length greater or equal to
* the column size of <code>GT</code> returned by
* {@link #getBilateralConstraints getBilateralConstraints()}.
*
* @param ginfo
* Array of
* {@link artisynth.core.mechmodels.MechSystem.ConstraintInfo ConstraintInfo}
* objects used to return the constraint information.
*/
public void getBilateralInfo (ConstraintInfo[] ginfo);
//public int getNumBilateralImpulses ();
/**
* Supplies to the system the most recently computed bilateral constraint
* impulses. These are supplied by the vector <code>lam</code>, which
* should have a size greater or equal to the column size of
* <code>GT</code> returned by {@link #getBilateralConstraints
* getBilateralConstraints()}.
*
* @param lam
* Bilateral constraint impulses being supplied to the system.
* @param h
* Time interval associated with the impulses. Dividing by this
* should give the average constraint forces.
*/
public void setBilateralImpulses (VectorNd lam, double h);
/**
* Returns from the system the most recently computed bilateral constraint
* impulses. These are stored in the vector <code>lam</code>, which should
* have a size greater or equal to the column size of <code>GT</code>
* returned by {@link #getBilateralConstraints getBilateralConstraints()}.
* For constraints which
* where present in the previous solve step, the impulse values should equal
* those which were set by the prevous call to {@link
* #setBilateralImpulses setBilateralImpulses()}.
* Otherwise, values can be estimated from
* previous impulse values (where appropriate), or supplied as 0.
*
* @param lam
* Bilateral constraint impulses being returned from the system.
*/
public void getBilateralImpulses (VectorNd lam);
/**
* Obtains the transpose of the current unilateral constraint matrix N for this
* system. This is built and stored in <code>NT</code>. On input,
* <code>NT</code> should be empty with zero size; it will be sized
* appropriately by the system. The derivative term is returned
* in <code>dn</code>; this is given by
* <pre>
* dn/dt u
* </pre>
* where <code>u</code> is the current system velocity.
* <code>dn</code> will also be sized appropriately by the system.
*
* @param NT returns the transpose of N
* @param dn returns the derivative term for N
*/
public void getUnilateralConstraints (SparseBlockMatrix NT, VectorNd dn);
/**
* Obtains information for all the constraint directions returned
* by the most recent call to {@link #getUnilateralConstraints
* getUnilateralConstraints()}.
* The information is returned in the array <code>ninfo</code>,
* which should contain preallocated
* {@link artisynth.core.mechmodels.MechSystem.ConstraintInfo ConstraintInfo}
* structures and should have a length greater or equal to
* the column size of <code>NT</code> returned by
* {@link #getUnilateralConstraints getUnilateralConstraints()}.
*
* @param ninfo
* Array of
* {@link artisynth.core.mechmodels.MechSystem.ConstraintInfo ConstraintInfo}
* objects used to return the constraint information.
*/
public void getUnilateralInfo (ConstraintInfo[] ninfo);
//public int getNumUnilateralImpulses ();
/**
* Supplies to the system the most recently computed unilateral constraint
* impulses. These are supplied by the vector <code>the</code>, which
* should have a size greater or equal to the column size of
* <code>NT</code> returned by {@link #getUnilateralConstraints
* getUnilateralConstraints()}.
*
* @param the
* Unilateral constraint impulses being supplied to the system.
* @param h
* Time interval associated with the impulses. Dividing by this
* should give the average constraint forces.
*/
public void setUnilateralImpulses (VectorNd the, double h);
/**
* Returns from the system the most recently computed unilateral constraint
* impulses. These are stored in the vector <code>the</code>, which should
* have a size greater or equal to the column size of <code>NT</code>
* returned by {@link #getUnilateralConstraints getUnilateralConstraints()}.
* For constraints which where present in the previous solve step, the
* impulse values should equal those which were set by the prevous call to
* {@link #setUnilateralImpulses setUnilateralImpulses()}. Otherwise,
* values can be estimated from previous impulse values (where appropriate),
* or supplied as 0.
*
* @param the
* Unilateral constraint impulses being returned from the system.
*/
public void getUnilateralImpulses (VectorNd the);
/**
* Returns that maximum number of friction constraint set that may be added by
* the method {@link #getFrictionConstraints getFrictionConstraints()}.
* This is used to size the <code>finfo</code> array supplied to that
* method.
*
* @return maximum friction constraint sets
*/
public int maxFrictionConstraintSets();
/**
* Obtains the transpose of the current friction constraint matrix D for
* this system. This is built and stored in <code>DT</code>. On input,
* <code>DT</code> should be empty with zero size; it will be sized
* appropriately by the system.
*
* <p>Each column block in <code>DT</code> describes a friction constraint
* set associated with one unilateral or bilateral constraint. Information
* about each friction constraint set is returned in the array
* <code>finfo</code>, which should contain preallocated
* {@link artisynth.core.mechmodels.MechSystem.FrictionInfo FrictionInfo}
* structures and should have a length greater or
* equal to the value returned by
* {@link #maxFrictionConstraintSets FrictionConstraintSets()}.
*
* @param DT returns the transpose of D
* @param finfo returns information for each friction constraint set
*/
public void getFrictionConstraints (
SparseBlockMatrix DT, FrictionInfo[] finfo);
/**
* Computes an adjustment to the active positions of the system (stored
* in the vector <code>q</code>) by applying
* a velocity <code>u</code> for time
* <code>h</code>. Where velocity equals position derivative,
* this corresponds to computing
* <pre>
* q += h u.
* </pre>
* In other situations, such as where position is orientation expressed as a
* quaternion and velocity is angular velocity, the system should perform
* the analagous computation.
*
* <code>q</code> should have a size greater or equal to the value
* returned by {@link #getActivePosStateSize getActivePosStateSize()}, and
* <code>u</code> should have a size greater or equal to the value
* returned by {@link #getActiveVelStateSize getActiveVelStateSize()}.
*
* @param q positions to be adjusted
* @param h length of time to apply velocity
* @param u velocity to be applied
*/
public void addActivePosImpulse (VectorNd q, double h, VectorNd u);
/**
* Updates the constraints associated with this system to be consistent with
* the current position and indicated time. This method should be called
* between any change to position values and any call that obtains
* constraint information (such as {@link #getBilateralConstraints
* getBilateralConstraints()}.
*
* <p>Because contact computations are expensive, the constraints associated
* with contact should only be computed if the flags {@link
* #COMPUTE_CONTACTS} or {@link #UPDATE_CONTACTS} are specified. The former
* calls for contact information to be computed from scratch, while the
* latter calls for contact information to be modified to reflect changes in
* body positions, while preserving the general contact state between
* bodies.
*
* <p>In the process of updating the constraints, the system may determine
* that a smaller step size is needed. This is particulary true when
* contact calculations show an unacceptable level of interpenetration.
* A smaller step size can be recommended If so, it can indicate this through
* the optional argument <code>stepAdjust</code>, if present.
*
* @param t current time
* @param stepAdjust
* (optional) can be used to indicate whether the current advance
* should be redone with a smaller step size.
* @param flags information flags
*/
public void updateConstraints (
double t, StepAdjustment stepAdjust, int flags);
/**
* Updates all internal forces associated with this system to be
* consistent with the current position and velocity and the indicated time
* <code>t</code>. This method should be called between any change to
* position or velocity values (such as through
* {@link #setActivePosState setActivePosState()} or
* {@link #setActiveVelState setActiveVelState()},
* and any call to {@link #getActiveForces getActiveForces()}.
*
* <p>In the process of updating the forces, the system may determine that a
* smaller step size is needed. If so, it can indicate this through the
* argument optional <code>stepAdjust</code>, if present.
*
* @param t
* current time
*/
public void updateForces (double t);
}
| [
"ed1996@gmail.com"
] | ed1996@gmail.com |
84c0e360fec3781b3faea2a66bd933a0b38031ea | bd7b2f839e76e37bf8a3fd841a7451340f7df7a9 | /archunit/src/test/java/com/tngtech/archunit/core/importer/testexamples/fieldaccesstointerfaces/InterfaceWithFields.java | 503d1556c22634ad1b4813c9ade562d01e7a3b9e | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | TNG/ArchUnit | ee7a1cb280360481a004c46f9861c5db181d7335 | 87cc595a281f84c7be6219714b22fbce337dd8b1 | refs/heads/main | 2023-09-01T14:18:52.601280 | 2023-08-29T09:15:13 | 2023-08-29T09:15:13 | 88,962,042 | 2,811 | 333 | Apache-2.0 | 2023-09-14T08:11:13 | 2017-04-21T08:39:20 | Java | UTF-8 | Java | false | false | 333 | java | package com.tngtech.archunit.core.importer.testexamples.fieldaccesstointerfaces;
// NOTE: The compiler will inline Strings or primitives, thus use field type Object
public interface InterfaceWithFields extends ParentInterfaceWithFields {
Object objectFieldOne = "objectFieldOne";
Object objectFieldTwo = "objectFieldTwo";
}
| [
"peter.gafert@tngtech.com"
] | peter.gafert@tngtech.com |
1e94a6ed828b7dad7a85dc88863c1c184ef29c3d | c8a4f66c121f107a1807497b8d18d13c6aec84ea | /src/main/java/com/si/dao/AdminEstSetStatusDaoInterface.java | e310f14d35e6f39c289b8b0534b3305da942d4b7 | [] | no_license | agupsa/SkillIndia | b0e02588a512303378d1ddd9c4ccc5a94c06c7f8 | 8fd5679ff1f4e09023f04fadde3da6fd8efb99d0 | refs/heads/master | 2020-04-08T04:39:30.223351 | 2018-12-04T14:09:40 | 2018-12-04T14:09:40 | 159,026,319 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 166 | java | package com.si.dao;
public interface AdminEstSetStatusDaoInterface {
//Sets Status of establishment by admin
int setEstStatus(int estRegno, int action);
} | [
"ayush.gu96@gmail.com"
] | ayush.gu96@gmail.com |
86ad6f86da21e71fabecbac236b39326d071851f | bcdc89f67dcc43767ae669211421e3dd13641b11 | /src/4_Relasi_Class/MainPercobaan1841720070yayak.java | 1d810cf23b8d1c3cf2759d28caf3286267f0393d | [] | no_license | Cahyaabdi/laporaam-praktikum-pbo-2019 | c96ba772270d6577a94903e029ac1cf3477be280 | aaf2506fe9ca3bd21535a5099630fa8e40bbf84a | refs/heads/master | 2021-07-15T22:16:30.631542 | 2019-12-10T08:45:19 | 2019-12-10T08:45:19 | 205,991,153 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,671 | java | <<<<<<< HEAD
/*
* 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 Percobaan1;
/**
*
* @author can
*/
public class MainPercobaan1841720070yayak {
public static void main(String[] args) {
Processor1841720070yayak p = new Processor1841720070yayak("intel i5", 3);
Laptop1841720070yayak L = new Laptop1841720070yayak("Thinkpad", p);
L.infoyayak();
Processor1841720070yayak p1 = new Processor1841720070yayak();
p1.setMerkyayak("Intel i5");
p1.setCacheyayak(4);
Laptop1841720070yayak L1 = new Laptop1841720070yayak();
L1.setMerk("Thinkpad");
L1.setProc(p1);
L1.infoyayak();
}
}
=======
/*
* 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 Percobaan1;
/**
*
* @author can
*/
public class MainPercobaan1841720070yayak {
public static void main(String[] args) {
Processor1841720070yayak p = new Processor1841720070yayak("intel i5", 3);
Laptop1841720070yayak L = new Laptop1841720070yayak("Thinkpad", p);
L.infoyayak();
Processor1841720070yayak p1 = new Processor1841720070yayak();
p1.setMerkyayak("Intel i5");
p1.setCacheyayak(4);
Laptop1841720070yayak L1 = new Laptop1841720070yayak();
L1.setMerk("Thinkpad");
L1.setProc(p1);
L1.infoyayak();
}
}
>>>>>>> 039777f585ae00e1a830a9a1fe783a0d451a4ecc
| [
"cahya.asoy@gmail.com"
] | cahya.asoy@gmail.com |
5943367c2b42c7dd821fe32c7185701d34860b45 | 4a804562cec0ae45130c7e08423bf67b71858f69 | /kie-wb-common-stunner/kie-wb-common-stunner-extensions/kie-wb-common-stunner-lienzo-extensions/src/test/java/org/kie/workbench/common/stunner/lienzo/toolbox/grid/AutoGridTest.java | ace321da33fa3dc072f350cf5f744e928e73be75 | [
"Apache-2.0"
] | permissive | albfan/kie-wb-common | 8cac1afce6b6dba47dc23d3d74ca10708947efb6 | bc6fbbddd0944ae1d9394bf6cf9af512ab43956f | refs/heads/master | 2020-08-29T18:28:26.137857 | 2019-10-25T20:55:14 | 2019-10-25T20:55:14 | 218,126,735 | 1 | 0 | Apache-2.0 | 2019-10-28T19:17:07 | 2019-10-28T19:17:06 | null | UTF-8 | Java | false | false | 8,475 | java | /*
* Copyright 2017 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kie.workbench.common.stunner.lienzo.toolbox.grid;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.ait.lienzo.client.core.types.BoundingBox;
import com.ait.lienzo.client.core.types.Point2D;
import com.ait.lienzo.shared.core.types.Direction;
import com.ait.lienzo.test.LienzoMockitoTestRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertEquals;
@RunWith(LienzoMockitoTestRunner.class)
public class AutoGridTest {
private AutoGrid tested;
@Test
public void testGrid1() {
final double size = 10;
final double padding = 5;
final Direction direction = Direction.EAST;
final BoundingBox boundingBox = new BoundingBox(0d,
0d,
100d,
100d);
tested = new AutoGrid.Builder()
.forBoundingBox(boundingBox)
.withIconSize(size)
.withPadding(padding)
.towards(direction)
.build();
assertEquals(size,
tested.getIconSize(),
0);
assertEquals(padding,
tested.getPadding(),
0);
assertEquals(direction,
tested.getDirection());
assertEquals(100,
tested.getMaxSize(),
0);
assertEquals((size + padding) / 2,
tested.getMargin(),
0);
final List<Point2D> expectedPoints = new ArrayList<>();
final Iterator<Point2D> points = tested.iterator();
int count = 5;
for (int i = 0; i < count; i++) {
final Point2D point = points.next();
expectedPoints.add(point);
}
assertEquals(5,
expectedPoints.size());
assertEquals(new Point2D(0d,
-15d),
expectedPoints.get(0));
assertEquals(new Point2D(15d,
-15d),
expectedPoints.get(1));
assertEquals(new Point2D(30d,
-15d),
expectedPoints.get(2));
assertEquals(new Point2D(45d,
-15d),
expectedPoints.get(3));
assertEquals(new Point2D(60d,
-15d),
expectedPoints.get(4));
}
@Test
public void testGrid2() {
final double size = 2.5;
final double padding = 0.5;
final Direction direction = Direction.SOUTH;
final BoundingBox boundingBox = new BoundingBox(0d,
0d,
100d,
100d);
tested = new AutoGrid.Builder()
.forBoundingBox(boundingBox)
.withIconSize(size)
.withPadding(padding)
.towards(direction)
.build();
assertEquals(size,
tested.getIconSize(),
0);
assertEquals(padding,
tested.getPadding(),
0);
assertEquals(direction,
tested.getDirection());
assertEquals(100,
tested.getMaxSize(),
0);
assertEquals((size + padding) / 2,
tested.getMargin(),
0);
final List<Point2D> expectedPoints = new ArrayList<>();
final Iterator<Point2D> points = tested.iterator();
int count = 5;
for (int i = 0; i < count; i++) {
final Point2D point = points.next();
expectedPoints.add(point);
}
assertEquals(5,
expectedPoints.size());
assertEquals(new Point2D(0d,
0d),
expectedPoints.get(0));
assertEquals(new Point2D(0d,
3d),
expectedPoints.get(1));
assertEquals(new Point2D(0d,
6d),
expectedPoints.get(2));
assertEquals(new Point2D(0d,
9d),
expectedPoints.get(3));
assertEquals(new Point2D(0d,
12d),
expectedPoints.get(4));
}
@Test
public void testUpdateSize() {
final double size = 2.5;
final double padding = 0.5;
final double shapeSize = 100;
final Direction direction = Direction.SOUTH;
final BoundingBox boundingBox = new BoundingBox(0d,
0d,
shapeSize,
shapeSize);
tested = new AutoGrid.Builder()
.forBoundingBox(boundingBox)
.withIconSize(size)
.withPadding(padding)
.towards(direction)
.build();
assertEquals(size,
tested.getIconSize(),
0);
assertEquals(padding,
tested.getPadding(),
0);
assertEquals(direction,
tested.getDirection());
assertEquals(shapeSize,
tested.getMaxSize(),
0);
assertEquals((size + padding) / 2,
tested.getMargin(),
0);
final List<Point2D> expectedPoints = new ArrayList<>();
final Iterator<Point2D> points = tested.iterator();
int count = 5;
for (int i = 0; i < count; i++) {
final Point2D point = points.next();
expectedPoints.add(point);
}
assertEquals(5,
expectedPoints.size());
assertEquals(new Point2D(0d,
0d),
expectedPoints.get(0));
assertEquals(new Point2D(0d,
3d),
expectedPoints.get(1));
assertEquals(new Point2D(0d,
6d),
expectedPoints.get(2));
assertEquals(new Point2D(0d,
9d),
expectedPoints.get(3));
assertEquals(new Point2D(0d,
12d),
expectedPoints.get(4));
tested.setSize(6,
6);
assertEquals(6,
tested.getMaxSize(),
0);
expectedPoints.clear();
final Iterator<Point2D> points2 = tested.iterator();
for (int i = 0; i < count; i++) {
final Point2D point = points2.next();
expectedPoints.add(point);
}
assertEquals(5,
expectedPoints.size());
assertEquals(new Point2D(0d,
0d),
expectedPoints.get(0));
assertEquals(new Point2D(0d,
3d),
expectedPoints.get(1));
assertEquals(new Point2D(3d,
0d),
expectedPoints.get(2));
assertEquals(new Point2D(3d,
3d),
expectedPoints.get(3));
assertEquals(new Point2D(6d,
0d),
expectedPoints.get(4));
}
}
| [
"manstis@users.noreply.github.com"
] | manstis@users.noreply.github.com |
c6fba8be35602402712cbf95fa6e2a87b5f79bfd | af9fe507b31bfa8eb7a0463811fa11c83636cf65 | /src/Buoi9/BaiTap/QuanLyDat/Test.java | 5d5e1c91d034a886c7b321032462d3c8002f6869 | [] | no_license | viethoang1999/JavaBase | 9b2766b99c62527355599e3d3b5600507f904e87 | 78517e4763fad3ed890ae28bc05f80126b506a20 | refs/heads/master | 2023-06-28T20:17:51.074953 | 2021-08-09T13:38:07 | 2021-08-09T13:38:07 | 374,878,305 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 630 | java | package Buoi9.BaiTap.QuanLyDat;
import java.time.LocalDate;
public class Test {
public static void main(String[] args) {
Quanlygiaodichdat quanlygiaodichdat=new Quanlygiaodichdat(2);
quanlygiaodichdat.input();
quanlygiaodichdat.output();
double a=quanlygiaodichdat.Tongsoluongtunggiaodich();
System.out.println("Tổng số lượng từng loại : "+a);
double b= quanlygiaodichdat.trungBinhThanhTienTungLoai();
System.out.println("Trung bình từng loại giao dịch: "+b);
quanlygiaodichdat.output(LocalDate.of(2013,9,1),LocalDate.of(2013,9,30));
}
}
| [
"="
] | = |
80c211a3f4de69df816c3f9b82e3277dabb072b7 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/androidx/gridlayout/widget/GridLayout.java | 5cd8cfddba1d5f4577892b4cf19b9445a5080cb4 | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 81,409 | java | package androidx.gridlayout.widget;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.LogPrinter;
import android.util.Pair;
import android.util.Printer;
import android.view.View;
import android.view.View.MeasureSpec;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.ViewGroup.MarginLayoutParams;
import androidx.core.g.ab;
import androidx.core.g.z;
import androidx.gridlayout.a.a;
import androidx.gridlayout.a.b;
import com.tencent.matrix.trace.core.AppMethodBeat;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.List<Landroidx.gridlayout.widget.GridLayout.b;>;
import java.util.Map;
public class GridLayout
extends ViewGroup
{
public static final a bFA;
public static final a bFB;
static final Printer bFb;
static final Printer bFc;
private static final int bFd;
private static final int bFe;
private static final int bFf;
private static final int bFg;
private static final int bFh;
private static final int bFi;
private static final int bFj;
static final a bFq;
private static final a bFr;
private static final a bFs;
public static final a bFt;
public static final a bFu;
public static final a bFv;
public static final a bFw;
public static final a bFx;
public static final a bFy;
public static final a bFz;
final d bFk;
final d bFl;
boolean bFm;
int bFn;
int bFo;
int bFp;
int mOrientation;
Printer mPrinter;
static
{
AppMethodBeat.i(192773);
bFb = new LogPrinter(3, GridLayout.class.getName());
bFc = new Printer()
{
public final void println(String paramAnonymousString) {}
};
bFd = a.b.GridLayout_orientation;
bFe = a.b.GridLayout_rowCount;
bFf = a.b.GridLayout_columnCount;
bFg = a.b.GridLayout_useDefaultMargins;
bFh = a.b.GridLayout_alignmentMode;
bFi = a.b.GridLayout_rowOrderPreserved;
bFj = a.b.GridLayout_columnOrderPreserved;
bFq = new a()
{
final int F(View paramAnonymousView, int paramAnonymousInt)
{
return -2147483648;
}
final String GR()
{
return "UNDEFINED";
}
public final int h(View paramAnonymousView, int paramAnonymousInt1, int paramAnonymousInt2)
{
return -2147483648;
}
};
bFr = new a()
{
final int F(View paramAnonymousView, int paramAnonymousInt)
{
return 0;
}
final String GR()
{
return "LEADING";
}
public final int h(View paramAnonymousView, int paramAnonymousInt1, int paramAnonymousInt2)
{
return 0;
}
};
bFs = new a()
{
final int F(View paramAnonymousView, int paramAnonymousInt)
{
return paramAnonymousInt;
}
final String GR()
{
return "TRAILING";
}
public final int h(View paramAnonymousView, int paramAnonymousInt1, int paramAnonymousInt2)
{
return paramAnonymousInt1;
}
};
bFt = bFr;
bFu = bFs;
bFv = bFr;
bFw = bFs;
bFx = a(bFv, bFw);
bFy = a(bFw, bFv);
bFz = new a()
{
final int F(View paramAnonymousView, int paramAnonymousInt)
{
return paramAnonymousInt >> 1;
}
final String GR()
{
return "CENTER";
}
public final int h(View paramAnonymousView, int paramAnonymousInt1, int paramAnonymousInt2)
{
return paramAnonymousInt1 >> 1;
}
};
bFA = new a()
{
final int F(View paramAnonymousView, int paramAnonymousInt)
{
return 0;
}
final String GR()
{
return "BASELINE";
}
public final GridLayout.e GS()
{
AppMethodBeat.i(192613);
GridLayout.e local1 = new GridLayout.e()
{
private int size;
protected final int a(GridLayout paramAnonymous2GridLayout, View paramAnonymous2View, GridLayout.a paramAnonymous2a, int paramAnonymous2Int, boolean paramAnonymous2Boolean)
{
AppMethodBeat.i(192531);
paramAnonymous2Int = Math.max(0, super.a(paramAnonymous2GridLayout, paramAnonymous2View, paramAnonymous2a, paramAnonymous2Int, paramAnonymous2Boolean));
AppMethodBeat.o(192531);
return paramAnonymous2Int;
}
protected final void aL(int paramAnonymous2Int1, int paramAnonymous2Int2)
{
AppMethodBeat.i(192510);
super.aL(paramAnonymous2Int1, paramAnonymous2Int2);
this.size = Math.max(this.size, paramAnonymous2Int1 + paramAnonymous2Int2);
AppMethodBeat.o(192510);
}
protected final int aR(boolean paramAnonymous2Boolean)
{
AppMethodBeat.i(192519);
int i = Math.max(super.aR(paramAnonymous2Boolean), this.size);
AppMethodBeat.o(192519);
return i;
}
protected final void reset()
{
AppMethodBeat.i(192499);
super.reset();
this.size = -2147483648;
AppMethodBeat.o(192499);
}
};
AppMethodBeat.o(192613);
return local1;
}
public final int h(View paramAnonymousView, int paramAnonymousInt1, int paramAnonymousInt2)
{
AppMethodBeat.i(192606);
if (paramAnonymousView.getVisibility() == 8)
{
AppMethodBeat.o(192606);
return 0;
}
paramAnonymousInt1 = paramAnonymousView.getBaseline();
if (paramAnonymousInt1 == -1)
{
AppMethodBeat.o(192606);
return -2147483648;
}
AppMethodBeat.o(192606);
return paramAnonymousInt1;
}
};
bFB = new a()
{
final int F(View paramAnonymousView, int paramAnonymousInt)
{
return 0;
}
final String GR()
{
return "FILL";
}
public final int aM(int paramAnonymousInt1, int paramAnonymousInt2)
{
return paramAnonymousInt2;
}
public final int h(View paramAnonymousView, int paramAnonymousInt1, int paramAnonymousInt2)
{
return -2147483648;
}
};
AppMethodBeat.o(192773);
}
public GridLayout(Context paramContext, AttributeSet paramAttributeSet)
{
this(paramContext, paramAttributeSet, 0);
}
public GridLayout(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
{
super(paramContext, paramAttributeSet, paramInt);
AppMethodBeat.i(192491);
this.bFk = new d(true);
this.bFl = new d(false);
this.mOrientation = 0;
this.bFm = false;
this.bFn = 1;
this.bFp = 0;
this.mPrinter = bFb;
this.bFo = paramContext.getResources().getDimensionPixelOffset(a.a.default_gap);
paramContext = paramContext.obtainStyledAttributes(paramAttributeSet, a.b.GridLayout);
try
{
setRowCount(paramContext.getInt(bFe, -2147483648));
setColumnCount(paramContext.getInt(bFf, -2147483648));
setOrientation(paramContext.getInt(bFd, 0));
setUseDefaultMargins(paramContext.getBoolean(bFg, false));
setAlignmentMode(paramContext.getInt(bFh, 1));
setRowOrderPreserved(paramContext.getBoolean(bFi, true));
setColumnOrderPreserved(paramContext.getBoolean(bFj, true));
return;
}
finally
{
paramContext.recycle();
AppMethodBeat.o(192491);
}
}
private boolean GL()
{
AppMethodBeat.i(192563);
if (z.U(this) == 1)
{
AppMethodBeat.o(192563);
return true;
}
AppMethodBeat.o(192563);
return false;
}
private void GM()
{
AppMethodBeat.i(192596);
this.bFp = 0;
if (this.bFk != null) {
this.bFk.GM();
}
if (this.bFl != null) {
this.bFl.GM();
}
GN();
AppMethodBeat.o(192596);
}
private void GN()
{
AppMethodBeat.i(192602);
if ((this.bFk != null) && (this.bFl != null))
{
this.bFk.GN();
this.bFl.GN();
}
AppMethodBeat.o(192602);
}
private int GO()
{
AppMethodBeat.i(192649);
int i = 1;
int k = getChildCount();
int j = 0;
if (j < k)
{
View localView = getChildAt(j);
if (localView.getVisibility() == 8) {
break label69;
}
i = ((LayoutParams)localView.getLayoutParams()).hashCode() + i * 31;
}
label69:
for (;;)
{
j += 1;
break;
AppMethodBeat.o(192649);
return i;
}
}
private void GP()
{
AppMethodBeat.i(192658);
int i2;
Object localObject;
label34:
int i3;
label51:
int i;
int j;
int[] arrayOfInt;
int i4;
LayoutParams localLayoutParams;
label103:
f localf;
boolean bool1;
int i7;
label147:
boolean bool2;
int i5;
if (this.bFp == 0) {
if (this.mOrientation == 0)
{
i2 = 1;
if (i2 == 0) {
break label266;
}
localObject = this.bFk;
if (((d)localObject).bFL == -2147483648) {
break label275;
}
i3 = ((d)localObject).bFL;
i = 0;
j = 0;
arrayOfInt = new int[i3];
int i6 = getChildCount();
i4 = 0;
if (i4 >= i6) {
break label477;
}
localLayoutParams = (LayoutParams)getChildAt(i4).getLayoutParams();
if (i2 == 0) {
break label281;
}
localObject = localLayoutParams.bGF;
localf = ((i)localObject).bFF;
bool1 = ((i)localObject).bGJ;
i7 = localf.size();
if (bool1) {
i = localf.min;
}
if (i2 == 0) {
break label291;
}
localObject = localLayoutParams.bGG;
localf = ((i)localObject).bFF;
bool2 = ((i)localObject).bGJ;
i5 = localf.size();
if (i3 != 0) {
break label301;
}
if (!bool2) {
break label529;
}
}
}
label266:
label396:
label529:
for (int k = localf.min;; k = j)
{
int n = k;
int i1 = i;
if (i3 != 0)
{
j = k;
int m = i;
if (bool1)
{
n = k;
i1 = i;
if (!bool2)
{
m = i;
j = k;
}
}
else
{
for (;;)
{
label221:
k = j + i5;
if (k > arrayOfInt.length) {
i = 0;
}
for (;;)
{
n = j;
i1 = m;
if (i != 0) {
break label396;
}
if (!bool2) {
break label369;
}
m += 1;
break label221;
i2 = 0;
break;
localObject = this.bFl;
break label34;
label275:
i3 = 0;
break label51;
label281:
localObject = localLayoutParams.bGG;
break label103;
label291:
localObject = localLayoutParams.bGF;
break label147;
label301:
if (bool2) {}
for (k = Math.min(localf.min, i3);; k = 0)
{
i5 = Math.min(i5, i3 - k);
break;
}
i = j;
for (;;)
{
if (i >= k) {
break label364;
}
if (arrayOfInt[i] > m)
{
i = 0;
break;
}
i += 1;
}
label364:
i = 1;
}
label369:
if (j + i5 <= i3)
{
j += 1;
}
else
{
j = 0;
m += 1;
}
}
}
i = arrayOfInt.length;
Arrays.fill(arrayOfInt, Math.min(n, i), Math.min(n + i5, i), i1 + i7);
}
if (i2 != 0) {
a(localLayoutParams, i1, i7, n, i5);
}
for (;;)
{
j = n + i5;
i4 += 1;
i = i1;
break;
a(localLayoutParams, n, i5, i1, i7);
}
label477:
this.bFp = GO();
AppMethodBeat.o(192658);
return;
if (this.bFp != GO())
{
this.mPrinter.println("The fields of some layout parameters were modified in between layout operations. Check the javadoc for GridLayout.LayoutParams#rowSpec.");
GM();
break;
}
AppMethodBeat.o(192658);
return;
}
}
public static i GQ()
{
AppMethodBeat.i(192735);
i locali = a(-2147483648, 1, bFq, 0.0F);
AppMethodBeat.o(192735);
return locali;
}
private static a a(a parama1, final a parama2)
{
AppMethodBeat.i(192750);
parama1 = new a()
{
final int F(View paramAnonymousView, int paramAnonymousInt)
{
int i = 1;
AppMethodBeat.i(192611);
if (z.U(paramAnonymousView) == 1) {
if (i != 0) {
break label45;
}
}
label45:
for (GridLayout.a locala = this.bFC;; locala = parama2)
{
paramAnonymousInt = locala.F(paramAnonymousView, paramAnonymousInt);
AppMethodBeat.o(192611);
return paramAnonymousInt;
i = 0;
break;
}
}
final String GR()
{
AppMethodBeat.i(192638);
String str = "SWITCHING[L:" + this.bFC.GR() + ", R:" + parama2.GR() + "]";
AppMethodBeat.o(192638);
return str;
}
public final int h(View paramAnonymousView, int paramAnonymousInt1, int paramAnonymousInt2)
{
int i = 1;
AppMethodBeat.i(192624);
if (z.U(paramAnonymousView) == 1) {
if (i != 0) {
break label49;
}
}
label49:
for (GridLayout.a locala = this.bFC;; locala = parama2)
{
paramAnonymousInt1 = locala.h(paramAnonymousView, paramAnonymousInt1, paramAnonymousInt2);
AppMethodBeat.o(192624);
return paramAnonymousInt1;
i = 0;
break;
}
}
};
AppMethodBeat.o(192750);
return parama1;
}
public static i a(int paramInt1, int paramInt2, a parama, float paramFloat)
{
AppMethodBeat.i(192723);
if (paramInt1 != -2147483648) {}
for (boolean bool = true;; bool = false)
{
parama = new i(bool, paramInt1, paramInt2, parama, paramFloat);
AppMethodBeat.o(192723);
return parama;
}
}
private static void a(LayoutParams paramLayoutParams, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
{
AppMethodBeat.i(192586);
f localf = new f(paramInt1, paramInt1 + paramInt2);
paramLayoutParams.bGF = paramLayoutParams.bGF.a(localf);
localf = new f(paramInt3, paramInt3 + paramInt4);
paramLayoutParams.bGG = paramLayoutParams.bGG.a(localf);
AppMethodBeat.o(192586);
}
private void a(LayoutParams paramLayoutParams, boolean paramBoolean)
{
AppMethodBeat.i(192635);
String str;
label24:
f localf;
if (paramBoolean)
{
str = "column";
if (!paramBoolean) {
break label195;
}
paramLayoutParams = paramLayoutParams.bGG;
localf = paramLayoutParams.bFF;
if ((localf.min != -2147483648) && (localf.min < 0)) {
aJ(str + " indices must be positive");
}
if (!paramBoolean) {
break label203;
}
}
label195:
label203:
for (paramLayoutParams = this.bFk;; paramLayoutParams = this.bFl)
{
int i = paramLayoutParams.bFL;
if (i != -2147483648)
{
if (localf.max > i) {
aJ(str + " indices (start + span) mustn't exceed the " + str + " count");
}
if (localf.size() > i) {
aJ(str + " span mustn't exceed the " + str + " count");
}
}
AppMethodBeat.o(192635);
return;
str = "row";
break;
paramLayoutParams = paramLayoutParams.bGF;
break label24;
}
}
static <T> T[] a(T[] paramArrayOfT1, T[] paramArrayOfT2)
{
AppMethodBeat.i(192536);
Object[] arrayOfObject = (Object[])Array.newInstance(paramArrayOfT1.getClass().getComponentType(), paramArrayOfT1.length + paramArrayOfT2.length);
System.arraycopy(paramArrayOfT1, 0, arrayOfObject, 0, paramArrayOfT1.length);
System.arraycopy(paramArrayOfT2, 0, arrayOfObject, paramArrayOfT1.length, paramArrayOfT2.length);
AppMethodBeat.o(192536);
return arrayOfObject;
}
static void aJ(String paramString)
{
AppMethodBeat.i(192619);
paramString = new IllegalArgumentException(paramString + ". ");
AppMethodBeat.o(192619);
throw paramString;
}
private static int aK(int paramInt1, int paramInt2)
{
AppMethodBeat.i(192693);
paramInt1 = View.MeasureSpec.makeMeasureSpec(View.MeasureSpec.getSize(paramInt1 + paramInt2), View.MeasureSpec.getMode(paramInt1));
AppMethodBeat.o(192693);
return paramInt1;
}
private int b(View paramView, boolean paramBoolean1, boolean paramBoolean2)
{
AppMethodBeat.i(192578);
if (this.bFn == 1)
{
i = a(paramView, paramBoolean1, paramBoolean2);
AppMethodBeat.o(192578);
return i;
}
Object localObject;
if (paramBoolean1)
{
localObject = this.bFk;
if (!paramBoolean2) {
break label150;
}
if (((d)localObject).bFT == null) {
((d)localObject).bFT = new int[((d)localObject).getCount() + 1];
}
if (!((d)localObject).bFU)
{
((d)localObject).aU(true);
((d)localObject).bFU = true;
}
localObject = ((d)localObject).bFT;
label95:
paramView = (LayoutParams)paramView.getLayoutParams();
if (!paramBoolean1) {
break label202;
}
paramView = paramView.bGG;
label112:
if (!paramBoolean2) {
break label210;
}
}
label150:
label202:
label210:
for (int i = paramView.bFF.min;; i = paramView.bFF.max)
{
i = localObject[i];
AppMethodBeat.o(192578);
return i;
localObject = this.bFl;
break;
if (((d)localObject).bFV == null) {
((d)localObject).bFV = new int[((d)localObject).getCount() + 1];
}
if (!((d)localObject).bFW)
{
((d)localObject).aU(false);
((d)localObject).bFW = true;
}
localObject = ((d)localObject).bFV;
break label95;
paramView = paramView.bGF;
break label112;
}
}
static LayoutParams bd(View paramView)
{
AppMethodBeat.i(369497);
paramView = (LayoutParams)paramView.getLayoutParams();
AppMethodBeat.o(369497);
return paramView;
}
static boolean eV(int paramInt)
{
return (paramInt & 0x2) != 0;
}
static int f(View paramView, boolean paramBoolean)
{
AppMethodBeat.i(192706);
if (paramBoolean)
{
i = paramView.getMeasuredWidth();
AppMethodBeat.o(192706);
return i;
}
int i = paramView.getMeasuredHeight();
AppMethodBeat.o(192706);
return i;
}
private void f(int paramInt1, int paramInt2, boolean paramBoolean)
{
AppMethodBeat.i(192681);
int j = getChildCount();
int i = 0;
if (i < j)
{
View localView = getChildAt(i);
LayoutParams localLayoutParams;
if (localView.getVisibility() != 8)
{
localLayoutParams = (LayoutParams)localView.getLayoutParams();
if (!paramBoolean) {
break label81;
}
i(localView, paramInt1, paramInt2, localLayoutParams.width, localLayoutParams.height);
}
for (;;)
{
i += 1;
break;
label81:
boolean bool;
label91:
label103:
f localf;
if (this.mOrientation == 0)
{
bool = true;
if (!bool) {
break label198;
}
localObject = localLayoutParams.bGG;
if (((i)localObject).aV(bool) != bFB) {
break label206;
}
localf = ((i)localObject).bFF;
if (!bool) {
break label208;
}
}
int k;
label198:
label206:
label208:
for (Object localObject = this.bFk;; localObject = this.bFl)
{
localObject = ((d)localObject).Hd();
k = localObject[localf.max] - localObject[localf.min] - e(localView, bool);
if (!bool) {
break label217;
}
i(localView, paramInt1, paramInt2, k, localLayoutParams.height);
break;
bool = false;
break label91;
localObject = localLayoutParams.bGF;
break label103;
break;
}
label217:
i(localView, paramInt1, paramInt2, localLayoutParams.width, k);
}
}
AppMethodBeat.o(192681);
}
private void i(View paramView, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
{
AppMethodBeat.i(192668);
paramView.measure(getChildMeasureSpec(paramInt1, e(paramView, true), paramInt3), getChildMeasureSpec(paramInt2, e(paramView, false), paramInt4));
AppMethodBeat.o(192668);
}
static int j(int[] paramArrayOfInt)
{
AppMethodBeat.i(192515);
int j = -1;
int i = 0;
int k = paramArrayOfInt.length;
while (i < k)
{
j = Math.max(j, paramArrayOfInt[i]);
i += 1;
}
AppMethodBeat.o(192515);
return j;
}
static a u(int paramInt, boolean paramBoolean)
{
int i;
if (paramBoolean)
{
i = 7;
label7:
if (!paramBoolean) {
break label86;
}
}
label86:
for (int j = 0;; j = 4) {
switch ((i & paramInt) >> j)
{
default:
return bFq;
i = 112;
break label7;
}
}
if (paramBoolean) {
return bFx;
}
return bFt;
if (paramBoolean) {
return bFy;
}
return bFu;
return bFB;
return bFz;
return bFv;
return bFw;
}
final int a(View paramView, boolean paramBoolean1, boolean paramBoolean2)
{
AppMethodBeat.i(192916);
Object localObject = (LayoutParams)paramView.getLayoutParams();
int i;
if (paramBoolean1) {
if (paramBoolean2) {
i = ((LayoutParams)localObject).leftMargin;
}
}
while (i == -2147483648) {
if (!this.bFm)
{
AppMethodBeat.o(192916);
return 0;
i = ((LayoutParams)localObject).rightMargin;
continue;
if (paramBoolean2) {
i = ((LayoutParams)localObject).topMargin;
} else {
i = ((LayoutParams)localObject).bottomMargin;
}
}
else
{
d locald;
label107:
boolean bool;
if (paramBoolean1)
{
localObject = ((LayoutParams)localObject).bGG;
if (!paramBoolean1) {
break label189;
}
locald = this.bFk;
localObject = ((i)localObject).bFF;
bool = paramBoolean2;
if (paramBoolean1)
{
bool = paramBoolean2;
if (GL())
{
if (paramBoolean2) {
break label198;
}
bool = true;
}
}
label138:
if (!bool) {
break label204;
}
if (((f)localObject).min == 0) {}
}
for (;;)
{
if ((paramView.getClass() != androidx.legacy.widget.Space.class) && (paramView.getClass() != android.widget.Space.class)) {
break label213;
}
AppMethodBeat.o(192916);
return 0;
localObject = ((LayoutParams)localObject).bGF;
break;
label189:
locald = this.bFl;
break label107;
label198:
bool = false;
break label138;
label204:
locald.getCount();
}
label213:
i = this.bFo / 2;
AppMethodBeat.o(192916);
return i;
}
}
AppMethodBeat.o(192916);
return i;
}
protected boolean checkLayoutParams(ViewGroup.LayoutParams paramLayoutParams)
{
AppMethodBeat.i(192938);
if (!(paramLayoutParams instanceof LayoutParams))
{
AppMethodBeat.o(192938);
return false;
}
paramLayoutParams = (LayoutParams)paramLayoutParams;
a(paramLayoutParams, true);
a(paramLayoutParams, false);
AppMethodBeat.o(192938);
return true;
}
final int e(View paramView, boolean paramBoolean)
{
AppMethodBeat.i(192928);
int i = b(paramView, paramBoolean, true);
int j = b(paramView, paramBoolean, false);
AppMethodBeat.o(192928);
return i + j;
}
public int getAlignmentMode()
{
return this.bFn;
}
public int getColumnCount()
{
AppMethodBeat.i(192828);
int i = this.bFk.getCount();
AppMethodBeat.o(192828);
return i;
}
public int getOrientation()
{
return this.mOrientation;
}
public Printer getPrinter()
{
return this.mPrinter;
}
public int getRowCount()
{
AppMethodBeat.i(192808);
int i = this.bFl.getCount();
AppMethodBeat.o(192808);
return i;
}
public boolean getUseDefaultMargins()
{
return this.bFm;
}
protected void onLayout(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
{
AppMethodBeat.i(192969);
GP();
paramInt3 -= paramInt1;
int i = getPaddingLeft();
int j = getPaddingTop();
int k = getPaddingRight();
paramInt1 = getPaddingBottom();
this.bFk.eX(paramInt3 - i - k);
this.bFl.eX(paramInt4 - paramInt2 - j - paramInt1);
int[] arrayOfInt1 = this.bFk.Hd();
int[] arrayOfInt2 = this.bFl.Hd();
paramInt4 = getChildCount();
paramInt1 = 0;
if (paramInt1 < paramInt4)
{
View localView = getChildAt(paramInt1);
int m;
int i1;
int n;
int i5;
int i7;
int i4;
int i2;
if (localView.getVisibility() != 8)
{
Object localObject2 = (LayoutParams)localView.getLayoutParams();
Object localObject1 = ((LayoutParams)localObject2).bGG;
localObject2 = ((LayoutParams)localObject2).bGF;
Object localObject3 = ((i)localObject1).bFF;
Object localObject4 = ((i)localObject2).bFF;
paramInt2 = arrayOfInt1[localObject3.min];
m = arrayOfInt2[localObject4.min];
i1 = arrayOfInt1[localObject3.max];
n = arrayOfInt2[localObject4.max];
i5 = i1 - paramInt2;
i7 = n - m;
int i10 = f(localView, true);
int i8 = f(localView, false);
localObject1 = ((i)localObject1).aV(true);
localObject2 = ((i)localObject2).aV(false);
localObject3 = (e)this.bFk.GX().eZ(paramInt1);
localObject4 = (e)this.bFl.GX().eZ(paramInt1);
int i6 = ((a)localObject1).F(localView, i5 - ((e)localObject3).aR(true));
n = ((a)localObject2).F(localView, i7 - ((e)localObject4).aR(true));
int i3 = b(localView, true, true);
i1 = b(localView, false, true);
i4 = b(localView, true, false);
i2 = b(localView, false, false);
int i11 = i3 + i4;
int i12 = i1 + i2;
int i9 = ((e)localObject3).a(this, localView, (a)localObject1, i10 + i11, true);
i2 = ((e)localObject4).a(this, localView, (a)localObject2, i8 + i12, false);
i5 = ((a)localObject1).aM(i10, i5 - i11);
i7 = ((a)localObject2).aM(i8, i7 - i12);
paramInt2 = i9 + (paramInt2 + i6);
if (GL()) {
break label531;
}
paramInt2 += i + i3;
}
for (;;)
{
m = i2 + (j + m + n) + i1;
if ((i5 != localView.getMeasuredWidth()) || (i7 != localView.getMeasuredHeight())) {
localView.measure(View.MeasureSpec.makeMeasureSpec(i5, 1073741824), View.MeasureSpec.makeMeasureSpec(i7, 1073741824));
}
localView.layout(paramInt2, m, i5 + paramInt2, i7 + m);
paramInt1 += 1;
break;
label531:
paramInt2 = paramInt3 - i5 - k - i4 - paramInt2;
}
}
AppMethodBeat.o(192969);
}
protected void onMeasure(int paramInt1, int paramInt2)
{
AppMethodBeat.i(192947);
GP();
GN();
int m = getPaddingLeft() + getPaddingRight();
int k = getPaddingTop() + getPaddingBottom();
int n = aK(paramInt1, -m);
int i1 = aK(paramInt2, -k);
f(n, i1, true);
int j;
int i;
if (this.mOrientation == 0)
{
j = this.bFk.eW(n);
f(n, i1, false);
i = this.bFl.eW(i1);
}
for (;;)
{
j = Math.max(j + m, getSuggestedMinimumWidth());
i = Math.max(i + k, getSuggestedMinimumHeight());
setMeasuredDimension(View.resolveSizeAndState(j, paramInt1, 0), View.resolveSizeAndState(i, paramInt2, 0));
AppMethodBeat.o(192947);
return;
i = this.bFl.eW(i1);
f(n, i1, false);
j = this.bFk.eW(n);
}
}
public void requestLayout()
{
AppMethodBeat.i(192956);
super.requestLayout();
GM();
AppMethodBeat.o(192956);
}
public void setAlignmentMode(int paramInt)
{
AppMethodBeat.i(192872);
this.bFn = paramInt;
requestLayout();
AppMethodBeat.o(192872);
}
public void setColumnCount(int paramInt)
{
AppMethodBeat.i(192838);
this.bFk.setCount(paramInt);
GM();
requestLayout();
AppMethodBeat.o(192838);
}
public void setColumnOrderPreserved(boolean paramBoolean)
{
AppMethodBeat.i(192889);
this.bFk.aS(paramBoolean);
GM();
requestLayout();
AppMethodBeat.o(192889);
}
public void setOrientation(int paramInt)
{
AppMethodBeat.i(192794);
if (this.mOrientation != paramInt)
{
this.mOrientation = paramInt;
GM();
requestLayout();
}
AppMethodBeat.o(192794);
}
public void setPrinter(Printer paramPrinter)
{
Printer localPrinter = paramPrinter;
if (paramPrinter == null) {
localPrinter = bFc;
}
this.mPrinter = localPrinter;
}
public void setRowCount(int paramInt)
{
AppMethodBeat.i(192818);
this.bFl.setCount(paramInt);
GM();
requestLayout();
AppMethodBeat.o(192818);
}
public void setRowOrderPreserved(boolean paramBoolean)
{
AppMethodBeat.i(192880);
this.bFl.aS(paramBoolean);
GM();
requestLayout();
AppMethodBeat.o(192880);
}
public void setUseDefaultMargins(boolean paramBoolean)
{
AppMethodBeat.i(192855);
this.bFm = paramBoolean;
requestLayout();
AppMethodBeat.o(192855);
}
public static class LayoutParams
extends ViewGroup.MarginLayoutParams
{
private static final int bGA;
private static final int bGB;
private static final int bGC;
private static final int bGD;
private static final int bGE;
private static final GridLayout.f bGr;
private static final int bGs;
private static final int bGt;
private static final int bGu;
private static final int bGv;
private static final int bGw;
private static final int bGx;
private static final int bGy;
private static final int bGz;
public GridLayout.i bGF;
public GridLayout.i bGG;
static
{
AppMethodBeat.i(192641);
GridLayout.f localf = new GridLayout.f(-2147483648, -2147483647);
bGr = localf;
bGs = localf.size();
bGt = a.b.GridLayout_Layout_android_layout_margin;
bGu = a.b.GridLayout_Layout_android_layout_marginLeft;
bGv = a.b.GridLayout_Layout_android_layout_marginTop;
bGw = a.b.GridLayout_Layout_android_layout_marginRight;
bGx = a.b.GridLayout_Layout_android_layout_marginBottom;
bGy = a.b.GridLayout_Layout_layout_column;
bGz = a.b.GridLayout_Layout_layout_columnSpan;
bGA = a.b.GridLayout_Layout_layout_columnWeight;
bGB = a.b.GridLayout_Layout_layout_row;
bGC = a.b.GridLayout_Layout_layout_rowSpan;
bGD = a.b.GridLayout_Layout_layout_rowWeight;
bGE = a.b.GridLayout_Layout_layout_gravity;
AppMethodBeat.o(192641);
}
public LayoutParams()
{
this(locali, locali, (byte)0);
AppMethodBeat.i(192593);
AppMethodBeat.o(192593);
}
/* Error */
public LayoutParams(Context paramContext, AttributeSet paramAttributeSet)
{
// Byte code:
// 0: aload_0
// 1: aload_1
// 2: aload_2
// 3: invokespecial 129 android/view/ViewGroup$MarginLayoutParams:<init> (Landroid/content/Context;Landroid/util/AttributeSet;)V
// 6: ldc 130
// 8: invokestatic 35 com/tencent/matrix/trace/core/AppMethodBeat:i (I)V
// 11: aload_0
// 12: getstatic 122 androidx/gridlayout/widget/GridLayout$i:bGI Landroidx/gridlayout/widget/GridLayout$i;
// 15: putfield 132 androidx/gridlayout/widget/GridLayout$LayoutParams:bGF Landroidx/gridlayout/widget/GridLayout$i;
// 18: aload_0
// 19: getstatic 122 androidx/gridlayout/widget/GridLayout$i:bGI Landroidx/gridlayout/widget/GridLayout$i;
// 22: putfield 134 androidx/gridlayout/widget/GridLayout$LayoutParams:bGG Landroidx/gridlayout/widget/GridLayout$i;
// 25: aload_1
// 26: aload_2
// 27: getstatic 138 androidx/gridlayout/a$b:GridLayout_Layout [I
// 30: invokevirtual 144 android/content/Context:obtainStyledAttributes (Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;
// 33: astore 7
// 35: aload 7
// 37: getstatic 58 androidx/gridlayout/widget/GridLayout$LayoutParams:bGt I
// 40: ldc 38
// 42: invokevirtual 150 android/content/res/TypedArray:getDimensionPixelSize (II)I
// 45: istore 4
// 47: aload_0
// 48: aload 7
// 50: getstatic 63 androidx/gridlayout/widget/GridLayout$LayoutParams:bGu I
// 53: iload 4
// 55: invokevirtual 150 android/content/res/TypedArray:getDimensionPixelSize (II)I
// 58: putfield 153 androidx/gridlayout/widget/GridLayout$LayoutParams:leftMargin I
// 61: aload_0
// 62: aload 7
// 64: getstatic 68 androidx/gridlayout/widget/GridLayout$LayoutParams:bGv I
// 67: iload 4
// 69: invokevirtual 150 android/content/res/TypedArray:getDimensionPixelSize (II)I
// 72: putfield 156 androidx/gridlayout/widget/GridLayout$LayoutParams:topMargin I
// 75: aload_0
// 76: aload 7
// 78: getstatic 73 androidx/gridlayout/widget/GridLayout$LayoutParams:bGw I
// 81: iload 4
// 83: invokevirtual 150 android/content/res/TypedArray:getDimensionPixelSize (II)I
// 86: putfield 159 androidx/gridlayout/widget/GridLayout$LayoutParams:rightMargin I
// 89: aload_0
// 90: aload 7
// 92: getstatic 78 androidx/gridlayout/widget/GridLayout$LayoutParams:bGx I
// 95: iload 4
// 97: invokevirtual 150 android/content/res/TypedArray:getDimensionPixelSize (II)I
// 100: putfield 162 androidx/gridlayout/widget/GridLayout$LayoutParams:bottomMargin I
// 103: aload 7
// 105: invokevirtual 165 android/content/res/TypedArray:recycle ()V
// 108: aload_1
// 109: aload_2
// 110: getstatic 138 androidx/gridlayout/a$b:GridLayout_Layout [I
// 113: invokevirtual 144 android/content/Context:obtainStyledAttributes (Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;
// 116: astore_1
// 117: aload_1
// 118: getstatic 113 androidx/gridlayout/widget/GridLayout$LayoutParams:bGE I
// 121: iconst_0
// 122: invokevirtual 168 android/content/res/TypedArray:getInt (II)I
// 125: istore 4
// 127: aload_1
// 128: getstatic 83 androidx/gridlayout/widget/GridLayout$LayoutParams:bGy I
// 131: ldc 38
// 133: invokevirtual 168 android/content/res/TypedArray:getInt (II)I
// 136: istore 5
// 138: aload_1
// 139: getstatic 88 androidx/gridlayout/widget/GridLayout$LayoutParams:bGz I
// 142: getstatic 51 androidx/gridlayout/widget/GridLayout$LayoutParams:bGs I
// 145: invokevirtual 168 android/content/res/TypedArray:getInt (II)I
// 148: istore 6
// 150: aload_1
// 151: getstatic 93 androidx/gridlayout/widget/GridLayout$LayoutParams:bGA I
// 154: fconst_0
// 155: invokevirtual 172 android/content/res/TypedArray:getFloat (IF)F
// 158: fstore_3
// 159: aload_0
// 160: iload 5
// 162: iload 6
// 164: iload 4
// 166: iconst_1
// 167: invokestatic 176 androidx/gridlayout/widget/GridLayout:u (IZ)Landroidx/gridlayout/widget/GridLayout$a;
// 170: fload_3
// 171: invokestatic 180 androidx/gridlayout/widget/GridLayout:a (IILandroidx/gridlayout/widget/GridLayout$a;F)Landroidx/gridlayout/widget/GridLayout$i;
// 174: putfield 134 androidx/gridlayout/widget/GridLayout$LayoutParams:bGG Landroidx/gridlayout/widget/GridLayout$i;
// 177: aload_1
// 178: getstatic 98 androidx/gridlayout/widget/GridLayout$LayoutParams:bGB I
// 181: ldc 38
// 183: invokevirtual 168 android/content/res/TypedArray:getInt (II)I
// 186: istore 5
// 188: aload_1
// 189: getstatic 103 androidx/gridlayout/widget/GridLayout$LayoutParams:bGC I
// 192: getstatic 51 androidx/gridlayout/widget/GridLayout$LayoutParams:bGs I
// 195: invokevirtual 168 android/content/res/TypedArray:getInt (II)I
// 198: istore 6
// 200: aload_1
// 201: getstatic 108 androidx/gridlayout/widget/GridLayout$LayoutParams:bGD I
// 204: fconst_0
// 205: invokevirtual 172 android/content/res/TypedArray:getFloat (IF)F
// 208: fstore_3
// 209: aload_0
// 210: iload 5
// 212: iload 6
// 214: iload 4
// 216: iconst_0
// 217: invokestatic 176 androidx/gridlayout/widget/GridLayout:u (IZ)Landroidx/gridlayout/widget/GridLayout$a;
// 220: fload_3
// 221: invokestatic 180 androidx/gridlayout/widget/GridLayout:a (IILandroidx/gridlayout/widget/GridLayout$a;F)Landroidx/gridlayout/widget/GridLayout$i;
// 224: putfield 132 androidx/gridlayout/widget/GridLayout$LayoutParams:bGF Landroidx/gridlayout/widget/GridLayout$i;
// 227: aload_1
// 228: invokevirtual 165 android/content/res/TypedArray:recycle ()V
// 231: ldc 130
// 233: invokestatic 116 com/tencent/matrix/trace/core/AppMethodBeat:o (I)V
// 236: return
// 237: astore_1
// 238: aload 7
// 240: invokevirtual 165 android/content/res/TypedArray:recycle ()V
// 243: ldc 130
// 245: invokestatic 116 com/tencent/matrix/trace/core/AppMethodBeat:o (I)V
// 248: aload_1
// 249: athrow
// 250: astore_2
// 251: aload_1
// 252: invokevirtual 165 android/content/res/TypedArray:recycle ()V
// 255: ldc 130
// 257: invokestatic 116 com/tencent/matrix/trace/core/AppMethodBeat:o (I)V
// 260: aload_2
// 261: athrow
// Local variable table:
// start length slot name signature
// 0 262 0 this LayoutParams
// 0 262 1 paramContext Context
// 0 262 2 paramAttributeSet AttributeSet
// 158 63 3 f float
// 45 170 4 i int
// 136 75 5 j int
// 148 65 6 k int
// 33 206 7 localTypedArray TypedArray
// Exception table:
// from to target type
// 35 103 237 finally
// 117 227 250 finally
}
public LayoutParams(ViewGroup.LayoutParams paramLayoutParams)
{
super();
this.bGF = GridLayout.i.bGI;
this.bGG = GridLayout.i.bGI;
}
public LayoutParams(ViewGroup.MarginLayoutParams paramMarginLayoutParams)
{
super();
this.bGF = GridLayout.i.bGI;
this.bGG = GridLayout.i.bGI;
}
public LayoutParams(LayoutParams paramLayoutParams)
{
super();
this.bGF = GridLayout.i.bGI;
this.bGG = GridLayout.i.bGI;
this.bGF = paramLayoutParams.bGF;
this.bGG = paramLayoutParams.bGG;
}
private LayoutParams(GridLayout.i parami1, GridLayout.i parami2)
{
super(-2);
AppMethodBeat.i(192576);
this.bGF = GridLayout.i.bGI;
this.bGG = GridLayout.i.bGI;
setMargins(-2147483648, -2147483648, -2147483648, -2147483648);
this.bGF = parami1;
this.bGG = parami2;
AppMethodBeat.o(192576);
}
private LayoutParams(GridLayout.i parami1, GridLayout.i parami2, byte paramByte)
{
this(parami1, parami2);
}
public boolean equals(Object paramObject)
{
AppMethodBeat.i(192661);
if (this == paramObject)
{
AppMethodBeat.o(192661);
return true;
}
if ((paramObject == null) || (getClass() != paramObject.getClass()))
{
AppMethodBeat.o(192661);
return false;
}
paramObject = (LayoutParams)paramObject;
if (!this.bGG.equals(paramObject.bGG))
{
AppMethodBeat.o(192661);
return false;
}
if (!this.bGF.equals(paramObject.bGF))
{
AppMethodBeat.o(192661);
return false;
}
AppMethodBeat.o(192661);
return true;
}
public int hashCode()
{
AppMethodBeat.i(192670);
int i = this.bGF.hashCode();
int j = this.bGG.hashCode();
AppMethodBeat.o(192670);
return i * 31 + j;
}
protected void setBaseAttributes(TypedArray paramTypedArray, int paramInt1, int paramInt2)
{
AppMethodBeat.i(192651);
this.width = paramTypedArray.getLayoutDimension(paramInt1, -2);
this.height = paramTypedArray.getLayoutDimension(paramInt2, -2);
AppMethodBeat.o(192651);
}
}
public static abstract class a
{
abstract int F(View paramView, int paramInt);
abstract String GR();
GridLayout.e GS()
{
return new GridLayout.e();
}
int aM(int paramInt1, int paramInt2)
{
return paramInt1;
}
abstract int h(View paramView, int paramInt1, int paramInt2);
public String toString()
{
return "Alignment:" + GR();
}
}
static final class b
{
public final GridLayout.f bFF;
public final GridLayout.g bFG;
public boolean bFH = true;
public b(GridLayout.f paramf, GridLayout.g paramg)
{
this.bFF = paramf;
this.bFG = paramg;
}
public final String toString()
{
AppMethodBeat.i(192504);
StringBuilder localStringBuilder = new StringBuilder().append(this.bFF).append(" ");
if (!this.bFH) {}
for (String str = "+>";; str = "->")
{
str = str + " " + this.bFG;
AppMethodBeat.o(192504);
return str;
}
}
}
static final class c<K, V>
extends ArrayList<Pair<K, V>>
{
private final Class<K> bFI;
private final Class<V> bFJ;
private c(Class<K> paramClass, Class<V> paramClass1)
{
this.bFI = paramClass;
this.bFJ = paramClass1;
}
public static <K, V> c<K, V> a(Class<K> paramClass, Class<V> paramClass1)
{
AppMethodBeat.i(192506);
paramClass = new c(paramClass, paramClass1);
AppMethodBeat.o(192506);
return paramClass;
}
public final GridLayout.h<K, V> GT()
{
AppMethodBeat.i(192533);
int j = size();
Object localObject = (Object[])Array.newInstance(this.bFI, j);
Object[] arrayOfObject = (Object[])Array.newInstance(this.bFJ, j);
int i = 0;
while (i < j)
{
localObject[i] = ((Pair)get(i)).first;
arrayOfObject[i] = ((Pair)get(i)).second;
i += 1;
}
localObject = new GridLayout.h((Object[])localObject, arrayOfObject);
AppMethodBeat.o(192533);
return localObject;
}
public final void m(K paramK, V paramV)
{
AppMethodBeat.i(192517);
add(Pair.create(paramK, paramV));
AppMethodBeat.o(192517);
}
}
final class d
{
public final boolean bFK;
public int bFL;
private int bFM;
GridLayout.h<GridLayout.i, GridLayout.e> bFN;
public boolean bFO;
GridLayout.h<GridLayout.f, GridLayout.g> bFP;
public boolean bFQ;
GridLayout.h<GridLayout.f, GridLayout.g> bFR;
public boolean bFS;
public int[] bFT;
public boolean bFU;
public int[] bFV;
public boolean bFW;
public GridLayout.b[] bFX;
public boolean bFY;
public int[] bFZ;
public boolean bGa;
public boolean bGb;
public boolean bGc;
public int[] bGd;
boolean bGe;
private GridLayout.g bGf;
private GridLayout.g bGg;
static
{
AppMethodBeat.i(192747);
if (!GridLayout.class.desiredAssertionStatus()) {}
for (boolean bool = true;; bool = false)
{
$assertionsDisabled = bool;
AppMethodBeat.o(192747);
return;
}
}
d(boolean paramBoolean)
{
AppMethodBeat.i(192524);
this.bFL = -2147483648;
this.bFM = -2147483648;
this.bFO = false;
this.bFQ = false;
this.bFS = false;
this.bFU = false;
this.bFW = false;
this.bFY = false;
this.bGa = false;
this.bGc = false;
this.bGe = true;
this.bGf = new GridLayout.g(0);
this.bGg = new GridLayout.g(-100000);
this.bFK = paramBoolean;
AppMethodBeat.o(192524);
}
private int GU()
{
AppMethodBeat.i(192537);
int i;
if (this.bFM == -2147483648)
{
int k = GridLayout.this.getChildCount();
int j = 0;
i = -1;
if (j < k)
{
Object localObject = GridLayout.bd(GridLayout.this.getChildAt(j));
if (this.bFK) {}
for (localObject = ((GridLayout.LayoutParams)localObject).bGG;; localObject = ((GridLayout.LayoutParams)localObject).bGF)
{
localObject = ((GridLayout.i)localObject).bFF;
i = Math.max(Math.max(Math.max(i, ((GridLayout.f)localObject).min), ((GridLayout.f)localObject).max), ((GridLayout.f)localObject).size());
j += 1;
break;
}
}
if (i != -1) {
break label137;
}
i = -2147483648;
}
label137:
for (;;)
{
this.bFM = Math.max(0, i);
i = this.bFM;
AppMethodBeat.o(192537);
return i;
}
}
private GridLayout.h<GridLayout.i, GridLayout.e> GV()
{
AppMethodBeat.i(192547);
GridLayout.c localc = GridLayout.c.a(GridLayout.i.class, GridLayout.e.class);
int j = GridLayout.this.getChildCount();
int i = 0;
if (i < j)
{
localObject = GridLayout.bd(GridLayout.this.getChildAt(i));
if (this.bFK) {}
for (localObject = ((GridLayout.LayoutParams)localObject).bGG;; localObject = ((GridLayout.LayoutParams)localObject).bGF)
{
localc.m(localObject, ((GridLayout.i)localObject).aV(this.bFK).GS());
i += 1;
break;
}
}
Object localObject = localc.GT();
AppMethodBeat.o(192547);
return localObject;
}
private void GW()
{
AppMethodBeat.i(192557);
Object localObject = (GridLayout.e[])this.bFN.aqm;
int i = 0;
while (i < localObject.length)
{
localObject[i].reset();
i += 1;
}
int m = GridLayout.this.getChildCount();
i = 0;
if (i < m)
{
View localView = GridLayout.this.getChildAt(i);
localObject = GridLayout.bd(localView);
label88:
GridLayout localGridLayout;
boolean bool;
int j;
if (this.bFK)
{
localObject = ((GridLayout.LayoutParams)localObject).bGG;
localGridLayout = GridLayout.this;
bool = this.bFK;
if (localView.getVisibility() != 8) {
break label167;
}
j = 0;
label112:
if (((GridLayout.i)localObject).qL != 0.0F) {
break label190;
}
}
label167:
label190:
for (int k = 0;; k = Hc()[i])
{
((GridLayout.e)this.bFN.eZ(i)).a(GridLayout.this, localView, (GridLayout.i)localObject, this, j + k);
i += 1;
break;
localObject = ((GridLayout.LayoutParams)localObject).bGF;
break label88;
j = GridLayout.f(localView, bool);
j = localGridLayout.e(localView, bool) + j;
break label112;
}
}
AppMethodBeat.o(192557);
}
private GridLayout.h<GridLayout.f, GridLayout.g> GY()
{
AppMethodBeat.i(192587);
if (this.bFP == null) {
this.bFP = aT(true);
}
if (!this.bFQ)
{
a(this.bFP, true);
this.bFQ = true;
}
GridLayout.h localh = this.bFP;
AppMethodBeat.o(192587);
return localh;
}
private GridLayout.h<GridLayout.f, GridLayout.g> GZ()
{
AppMethodBeat.i(192594);
if (this.bFR == null) {
this.bFR = aT(false);
}
if (!this.bFS)
{
a(this.bFR, false);
this.bFS = true;
}
GridLayout.h localh = this.bFR;
AppMethodBeat.o(192594);
return localh;
}
private void Ha()
{
AppMethodBeat.i(192633);
GY();
GZ();
AppMethodBeat.o(192633);
}
private GridLayout.b[] Hb()
{
AppMethodBeat.i(192646);
if (this.bFX == null)
{
localObject = new ArrayList();
ArrayList localArrayList = new ArrayList();
a((List)localObject, GY());
a(localArrayList, GZ());
if (this.bGe)
{
i = 0;
while (i < getCount())
{
a((List)localObject, new GridLayout.f(i, i + 1), new GridLayout.g(0));
i += 1;
}
}
int i = getCount();
a((List)localObject, new GridLayout.f(0, i), this.bGf, false);
a(localArrayList, new GridLayout.f(i, 0), this.bGg, false);
this.bFX = ((GridLayout.b[])GridLayout.a(Z((List)localObject), Z(localArrayList)));
}
if (!this.bFY)
{
Ha();
this.bFY = true;
}
Object localObject = this.bFX;
AppMethodBeat.o(192646);
return localObject;
}
private int[] Hc()
{
AppMethodBeat.i(192692);
if (this.bGd == null) {
this.bGd = new int[GridLayout.this.getChildCount()];
}
int[] arrayOfInt = this.bGd;
AppMethodBeat.o(192692);
return arrayOfInt;
}
private GridLayout.b[] Z(List<GridLayout.b> paramList)
{
AppMethodBeat.i(192612);
paramList = new Object()
{
GridLayout.b[] bGi;
int bGj;
GridLayout.b[][] bGk;
int[] bGl;
static
{
AppMethodBeat.i(192592);
if (!GridLayout.class.desiredAssertionStatus()) {}
for (boolean bool = true;; bool = false)
{
$assertionsDisabled = bool;
AppMethodBeat.o(192592);
return;
}
}
final void eY(int paramAnonymousInt)
{
AppMethodBeat.i(192599);
switch (this.bGl[paramAnonymousInt])
{
}
do
{
AppMethodBeat.o(192599);
return;
this.bGl[paramAnonymousInt] = 1;
localObject1 = this.bGk[paramAnonymousInt];
int j = localObject1.length;
int i = 0;
while (i < j)
{
Object localObject2 = localObject1[i];
eY(localObject2.bFF.max);
GridLayout.b[] arrayOfb = this.bGi;
int k = this.bGj;
this.bGj = (k - 1);
arrayOfb[k] = localObject2;
i += 1;
}
this.bGl[paramAnonymousInt] = 2;
AppMethodBeat.o(192599);
return;
} while ($assertionsDisabled);
Object localObject1 = new AssertionError();
AppMethodBeat.o(192599);
throw ((Throwable)localObject1);
}
};
int i = 0;
int j = paramList.bGk.length;
while (i < j)
{
paramList.eY(i);
i += 1;
}
if ((!1.$assertionsDisabled) && (paramList.bGj != -1))
{
paramList = new AssertionError();
AppMethodBeat.o(192612);
throw paramList;
}
paramList = paramList.bGi;
AppMethodBeat.o(192612);
return paramList;
}
private void a(GridLayout.h<GridLayout.f, GridLayout.g> paramh, boolean paramBoolean)
{
int j = 0;
AppMethodBeat.i(192581);
Object localObject = (GridLayout.g[])paramh.aqm;
int i = 0;
while (i < localObject.length)
{
localObject[i].value = -2147483648;
i += 1;
}
localObject = (GridLayout.e[])GX().aqm;
i = j;
if (i < localObject.length)
{
j = localObject[i].aR(paramBoolean);
GridLayout.g localg = (GridLayout.g)paramh.eZ(i);
int k = localg.value;
if (paramBoolean) {}
for (;;)
{
localg.value = Math.max(k, j);
i += 1;
break;
j = -j;
}
}
AppMethodBeat.o(192581);
}
private static void a(List<GridLayout.b> paramList, GridLayout.f paramf, GridLayout.g paramg)
{
AppMethodBeat.i(192604);
a(paramList, paramf, paramg, true);
AppMethodBeat.o(192604);
}
private static void a(List<GridLayout.b> paramList, GridLayout.f paramf, GridLayout.g paramg, boolean paramBoolean)
{
AppMethodBeat.i(192600);
if (paramf.size() == 0)
{
AppMethodBeat.o(192600);
return;
}
if (paramBoolean)
{
Iterator localIterator = paramList.iterator();
while (localIterator.hasNext()) {
if (((GridLayout.b)localIterator.next()).bFF.equals(paramf))
{
AppMethodBeat.o(192600);
return;
}
}
}
paramList.add(new GridLayout.b(paramf, paramg));
AppMethodBeat.o(192600);
}
private static void a(List<GridLayout.b> paramList, GridLayout.h<GridLayout.f, GridLayout.g> paramh)
{
AppMethodBeat.i(192622);
int i = 0;
while (i < ((GridLayout.f[])paramh.aqk).length)
{
a(paramList, ((GridLayout.f[])paramh.aqk)[i], ((GridLayout.g[])paramh.aqm)[i], false);
i += 1;
}
AppMethodBeat.o(192622);
}
private static boolean a(int[] paramArrayOfInt, GridLayout.b paramb)
{
if (!paramb.bFH) {}
int j;
int i;
do
{
return false;
GridLayout.f localf = paramb.bFF;
j = localf.min;
i = localf.max;
int k = paramb.bFG.value;
j = paramArrayOfInt[j] + k;
} while (j <= paramArrayOfInt[i]);
paramArrayOfInt[i] = j;
return true;
}
private boolean a(GridLayout.b[] paramArrayOfb, int[] paramArrayOfInt, boolean paramBoolean)
{
AppMethodBeat.i(192676);
String str;
int n;
Object localObject1;
int i;
int j;
if (this.bFK)
{
str = "horizontal";
n = getCount() + 1;
localObject1 = null;
i = 0;
if (i < paramArrayOfb.length)
{
Arrays.fill(paramArrayOfInt, 0);
j = 0;
}
}
else
{
int k;
GridLayout.b localb;
for (;;)
{
if (j >= n) {
break label267;
}
boolean bool = false;
k = 0;
int i1 = paramArrayOfb.length;
for (;;)
{
if (k < i1)
{
bool |= a(paramArrayOfInt, paramArrayOfb[k]);
k += 1;
continue;
str = "vertical";
break;
}
}
if (!bool)
{
if (localObject1 != null)
{
paramArrayOfInt = new ArrayList();
localObject2 = new ArrayList();
i = 0;
while (i < paramArrayOfb.length)
{
localb = paramArrayOfb[i];
if (localObject1[i] != 0) {
paramArrayOfInt.add(localb);
}
if (!localb.bFH) {
((List)localObject2).add(localb);
}
i += 1;
}
GridLayout.this.mPrinter.println(str + " constraints: " + aa(paramArrayOfInt) + " are inconsistent; permanently removing: " + aa((List)localObject2) + ". ");
}
AppMethodBeat.o(192676);
return true;
}
j += 1;
}
label267:
if (!paramBoolean)
{
AppMethodBeat.o(192676);
return false;
}
Object localObject2 = new boolean[paramArrayOfb.length];
j = 0;
while (j < n)
{
k = 0;
int m = paramArrayOfb.length;
while (k < m)
{
localObject2[k] |= a(paramArrayOfInt, paramArrayOfb[k]);
k += 1;
}
j += 1;
}
if (i == 0) {
localObject1 = localObject2;
}
j = 0;
for (;;)
{
if (j < paramArrayOfb.length)
{
if (localObject2[j] != 0)
{
localb = paramArrayOfb[j];
if (localb.bFF.min >= localb.bFF.max) {
localb.bFH = false;
}
}
}
else
{
i += 1;
break;
}
j += 1;
}
}
AppMethodBeat.o(192676);
return true;
}
private void aN(int paramInt1, int paramInt2)
{
this.bGf.value = paramInt1;
this.bGg.value = (-paramInt2);
this.bGa = false;
}
private int aO(int paramInt1, int paramInt2)
{
AppMethodBeat.i(192737);
aN(paramInt1, paramInt2);
paramInt1 = Hd()[getCount()];
AppMethodBeat.o(192737);
return paramInt1;
}
private GridLayout.h<GridLayout.f, GridLayout.g> aT(boolean paramBoolean)
{
AppMethodBeat.i(192572);
GridLayout.c localc = GridLayout.c.a(GridLayout.f.class, GridLayout.g.class);
GridLayout.i[] arrayOfi = (GridLayout.i[])GX().aqk;
int j = arrayOfi.length;
int i = 0;
if (i < j)
{
if (paramBoolean) {}
for (localObject = arrayOfi[i].bFF;; localObject = new GridLayout.f(((GridLayout.f)localObject).max, ((GridLayout.f)localObject).min))
{
localc.m(localObject, new GridLayout.g());
i += 1;
break;
localObject = arrayOfi[i].bFF;
}
}
Object localObject = localc.GT();
AppMethodBeat.o(192572);
return localObject;
}
private String aa(List<GridLayout.b> paramList)
{
AppMethodBeat.i(192665);
String str;
label40:
label68:
int j;
int k;
int m;
if (this.bFK)
{
str = "x";
localObject = new StringBuilder();
Iterator localIterator = paramList.iterator();
int i = 1;
paramList = (List<GridLayout.b>)localObject;
if (!localIterator.hasNext()) {
break label232;
}
localObject = (GridLayout.b)localIterator.next();
if (i == 0) {
break label169;
}
i = 0;
j = ((GridLayout.b)localObject).bFF.min;
k = ((GridLayout.b)localObject).bFF.max;
m = ((GridLayout.b)localObject).bFG.value;
if (j >= k) {
break label180;
}
}
label169:
label180:
for (Object localObject = str + k + "-" + str + j + ">=" + m;; localObject = str + j + "-" + str + k + "<=" + -m)
{
paramList.append((String)localObject);
break label40;
str = "y";
break;
paramList = paramList.append(", ");
break label68;
}
label232:
paramList = paramList.toString();
AppMethodBeat.o(192665);
return paramList;
}
private void g(int paramInt, float paramFloat)
{
AppMethodBeat.i(192704);
Arrays.fill(this.bGd, 0);
int k = GridLayout.this.getChildCount();
int j = 0;
int i = paramInt;
paramInt = j;
Object localObject;
if (paramInt < k)
{
localObject = GridLayout.this.getChildAt(paramInt);
if (((View)localObject).getVisibility() == 8) {
break label146;
}
localObject = GridLayout.bd((View)localObject);
if (this.bFK)
{
localObject = ((GridLayout.LayoutParams)localObject).bGG;
label79:
float f = ((GridLayout.i)localObject).qL;
if (f == 0.0F) {
break label146;
}
j = Math.round(i * f / paramFloat);
this.bGd[paramInt] = j;
i -= j;
paramFloat -= f;
}
}
label146:
for (;;)
{
paramInt += 1;
break;
localObject = ((GridLayout.LayoutParams)localObject).bGF;
break label79;
AppMethodBeat.o(192704);
return;
}
}
private boolean k(int[] paramArrayOfInt)
{
AppMethodBeat.i(192682);
boolean bool = a(Hb(), paramArrayOfInt, true);
AppMethodBeat.o(192682);
return bool;
}
private void l(int[] paramArrayOfInt)
{
float f = 0.0F;
boolean bool2 = true;
int n = 0;
AppMethodBeat.i(192718);
int j;
int i;
Object localObject;
label79:
boolean bool1;
if (!this.bGc)
{
j = GridLayout.this.getChildCount();
i = 0;
if (i >= j) {
break label174;
}
localObject = GridLayout.this.getChildAt(i);
if (((View)localObject).getVisibility() == 8) {
break label167;
}
localObject = GridLayout.bd((View)localObject);
if (this.bFK)
{
localObject = ((GridLayout.LayoutParams)localObject).bGG;
if (((GridLayout.i)localObject).qL == 0.0F) {
break label167;
}
bool1 = true;
label92:
this.bGb = bool1;
this.bGc = true;
}
}
else
{
if (this.bGb) {
break label180;
}
k(paramArrayOfInt);
}
label116:
int k;
for (;;)
{
if (!this.bGe)
{
j = paramArrayOfInt[0];
k = paramArrayOfInt.length;
i = n;
for (;;)
{
label277:
if (i < k)
{
paramArrayOfInt[i] -= j;
i += 1;
continue;
localObject = ((GridLayout.LayoutParams)localObject).bGF;
break label79;
label167:
i += 1;
break;
label174:
bool1 = false;
break label92;
label180:
Arrays.fill(Hc(), 0);
k(paramArrayOfInt);
j = this.bGf.value * GridLayout.this.getChildCount() + 1;
if (j < 2) {
break label116;
}
k = GridLayout.this.getChildCount();
i = 0;
label230:
if (i < k)
{
localObject = GridLayout.this.getChildAt(i);
if (((View)localObject).getVisibility() == 8) {
break label422;
}
localObject = GridLayout.bd((View)localObject);
if (this.bFK)
{
localObject = ((GridLayout.LayoutParams)localObject).bGG;
f = ((GridLayout.i)localObject).qL + f;
}
}
}
}
}
}
label422:
for (;;)
{
i += 1;
break label230;
localObject = ((GridLayout.LayoutParams)localObject).bGF;
break label277;
int m = -1;
k = 0;
i = j;
bool1 = bool2;
j = m;
while (k < i)
{
m = (int)((k + i) / 2L);
GN();
g(m, f);
bool1 = a(Hb(), paramArrayOfInt, false);
if (bool1)
{
k = m + 1;
j = m;
}
else
{
i = m;
}
}
if ((j <= 0) || (bool1)) {
break;
}
GN();
g(j, f);
k(paramArrayOfInt);
break;
AppMethodBeat.o(192718);
return;
}
}
public final void GM()
{
AppMethodBeat.i(192842);
this.bFM = -2147483648;
this.bFN = null;
this.bFP = null;
this.bFR = null;
this.bFT = null;
this.bFV = null;
this.bFX = null;
this.bFZ = null;
this.bGd = null;
this.bGc = false;
GN();
AppMethodBeat.o(192842);
}
public final void GN()
{
this.bFO = false;
this.bFQ = false;
this.bFS = false;
this.bFU = false;
this.bFW = false;
this.bFY = false;
this.bGa = false;
}
public final GridLayout.h<GridLayout.i, GridLayout.e> GX()
{
AppMethodBeat.i(192784);
if (this.bFN == null) {
this.bFN = GV();
}
if (!this.bFO)
{
GW();
this.bFO = true;
}
GridLayout.h localh = this.bFN;
AppMethodBeat.o(192784);
return localh;
}
public final int[] Hd()
{
AppMethodBeat.i(192814);
if (this.bFZ == null) {
this.bFZ = new int[getCount() + 1];
}
if (!this.bGa)
{
l(this.bFZ);
this.bGa = true;
}
int[] arrayOfInt = this.bFZ;
AppMethodBeat.o(192814);
return arrayOfInt;
}
final GridLayout.b[][] a(GridLayout.b[] paramArrayOfb)
{
int j = 0;
AppMethodBeat.i(192796);
int k = getCount() + 1;
GridLayout.b[][] arrayOfb; = new GridLayout.b[k][];
int[] arrayOfInt = new int[k];
int m = paramArrayOfb.length;
int i = 0;
while (i < m)
{
int n = paramArrayOfb[i].bFF.min;
arrayOfInt[n] += 1;
i += 1;
}
i = 0;
while (i < k)
{
arrayOfb;[i] = new GridLayout.b[arrayOfInt[i]];
i += 1;
}
Arrays.fill(arrayOfInt, 0);
k = paramArrayOfb.length;
i = j;
while (i < k)
{
GridLayout.b localb = paramArrayOfb[i];
j = localb.bFF.min;
[Landroidx.gridlayout.widget.GridLayout.b localb; = arrayOfb;[j];
m = arrayOfInt[j];
arrayOfInt[j] = (m + 1);
localb;[m] = localb;
i += 1;
}
AppMethodBeat.o(192796);
return arrayOfb;;
}
public final void aS(boolean paramBoolean)
{
AppMethodBeat.i(192776);
this.bGe = paramBoolean;
GM();
AppMethodBeat.o(192776);
}
final void aU(boolean paramBoolean)
{
AppMethodBeat.i(192804);
int[] arrayOfInt;
int i;
label27:
View localView;
Object localObject;
if (paramBoolean)
{
arrayOfInt = this.bFT;
int k = GridLayout.this.getChildCount();
i = 0;
if (i >= k) {
break label151;
}
localView = GridLayout.this.getChildAt(i);
if (localView.getVisibility() != 8)
{
localObject = GridLayout.bd(localView);
if (!this.bFK) {
break label132;
}
localObject = ((GridLayout.LayoutParams)localObject).bGG;
label74:
localObject = ((GridLayout.i)localObject).bFF;
if (!paramBoolean) {
break label142;
}
}
}
label132:
label142:
for (int j = ((GridLayout.f)localObject).min;; j = ((GridLayout.f)localObject).max)
{
arrayOfInt[j] = Math.max(arrayOfInt[j], GridLayout.this.a(localView, this.bFK, paramBoolean));
i += 1;
break label27;
arrayOfInt = this.bFV;
break;
localObject = ((GridLayout.LayoutParams)localObject).bGF;
break label74;
}
label151:
AppMethodBeat.o(192804);
}
public final int eW(int paramInt)
{
AppMethodBeat.i(192824);
int i = View.MeasureSpec.getMode(paramInt);
paramInt = View.MeasureSpec.getSize(paramInt);
switch (i)
{
default:
if (!$assertionsDisabled)
{
AssertionError localAssertionError = new AssertionError();
AppMethodBeat.o(192824);
throw localAssertionError;
}
break;
case 0:
paramInt = aO(0, 100000);
AppMethodBeat.o(192824);
return paramInt;
case 1073741824:
paramInt = aO(paramInt, paramInt);
AppMethodBeat.o(192824);
return paramInt;
case -2147483648:
paramInt = aO(0, paramInt);
AppMethodBeat.o(192824);
return paramInt;
}
AppMethodBeat.o(192824);
return 0;
}
public final void eX(int paramInt)
{
AppMethodBeat.i(192833);
aN(paramInt, paramInt);
Hd();
AppMethodBeat.o(192833);
}
public final int getCount()
{
AppMethodBeat.i(192757);
int i = Math.max(this.bFL, GU());
AppMethodBeat.o(192757);
return i;
}
public final void setCount(int paramInt)
{
AppMethodBeat.i(192766);
StringBuilder localStringBuilder;
if ((paramInt != -2147483648) && (paramInt < GU()))
{
localStringBuilder = new StringBuilder();
if (!this.bFK) {
break label68;
}
}
label68:
for (String str = "column";; str = "row")
{
GridLayout.aJ(str + "Count must be greater than or equal to the maximum of all grid indices (and spans) defined in the LayoutParams of each child");
this.bFL = paramInt;
AppMethodBeat.o(192766);
return;
}
}
}
static class e
{
public int bGo;
public int bGp;
public int bGq;
e()
{
AppMethodBeat.i(192495);
reset();
AppMethodBeat.o(192495);
}
protected int a(GridLayout paramGridLayout, View paramView, GridLayout.a parama, int paramInt, boolean paramBoolean)
{
AppMethodBeat.i(192546);
int i = this.bGo;
paramInt = parama.h(paramView, paramInt, ab.c(paramGridLayout));
AppMethodBeat.o(192546);
return i - paramInt;
}
protected final void a(GridLayout paramGridLayout, View paramView, GridLayout.i parami, GridLayout.d paramd, int paramInt)
{
AppMethodBeat.i(192558);
int j = this.bGq;
if ((parami.bGK == GridLayout.bFq) && (parami.qL == 0.0F)) {}
for (int i = 0;; i = 2)
{
this.bGq = (i & j);
i = parami.aV(paramd.bFK).h(paramView, paramInt, ab.c(paramGridLayout));
aL(i, paramInt - i);
AppMethodBeat.o(192558);
return;
}
}
protected void aL(int paramInt1, int paramInt2)
{
AppMethodBeat.i(192518);
this.bGo = Math.max(this.bGo, paramInt1);
this.bGp = Math.max(this.bGp, paramInt2);
AppMethodBeat.o(192518);
}
protected int aR(boolean paramBoolean)
{
AppMethodBeat.i(192534);
if ((!paramBoolean) && (GridLayout.eV(this.bGq)))
{
AppMethodBeat.o(192534);
return 100000;
}
int i = this.bGo;
int j = this.bGp;
AppMethodBeat.o(192534);
return i + j;
}
protected void reset()
{
this.bGo = -2147483648;
this.bGp = -2147483648;
this.bGq = 2;
}
public String toString()
{
AppMethodBeat.i(192573);
String str = "Bounds{before=" + this.bGo + ", after=" + this.bGp + '}';
AppMethodBeat.o(192573);
return str;
}
}
static final class f
{
public final int max;
public final int min;
public f(int paramInt1, int paramInt2)
{
this.min = paramInt1;
this.max = paramInt2;
}
public final boolean equals(Object paramObject)
{
AppMethodBeat.i(192569);
if (this == paramObject)
{
AppMethodBeat.o(192569);
return true;
}
if ((paramObject == null) || (getClass() != paramObject.getClass()))
{
AppMethodBeat.o(192569);
return false;
}
paramObject = (f)paramObject;
if (this.max != paramObject.max)
{
AppMethodBeat.o(192569);
return false;
}
if (this.min != paramObject.min)
{
AppMethodBeat.o(192569);
return false;
}
AppMethodBeat.o(192569);
return true;
}
public final int hashCode()
{
return this.min * 31 + this.max;
}
final int size()
{
return this.max - this.min;
}
public final String toString()
{
AppMethodBeat.i(192588);
String str = "[" + this.min + ", " + this.max + "]";
AppMethodBeat.o(192588);
return str;
}
}
static final class g
{
public int value;
public g()
{
this.value = -2147483648;
}
public g(int paramInt)
{
this.value = paramInt;
}
public final String toString()
{
AppMethodBeat.i(192560);
String str = Integer.toString(this.value);
AppMethodBeat.o(192560);
return str;
}
}
static final class h<K, V>
{
public final K[] aqk;
public final V[] aqm;
public final int[] bGH;
h(K[] paramArrayOfK, V[] paramArrayOfV)
{
AppMethodBeat.i(192523);
this.bGH = f(paramArrayOfK);
this.aqk = a(paramArrayOfK, this.bGH);
this.aqm = a(paramArrayOfV, this.bGH);
AppMethodBeat.o(192523);
}
private static <K> K[] a(K[] paramArrayOfK, int[] paramArrayOfInt)
{
AppMethodBeat.i(192545);
int j = paramArrayOfK.length;
Object[] arrayOfObject = (Object[])Array.newInstance(paramArrayOfK.getClass().getComponentType(), GridLayout.j(paramArrayOfInt) + 1);
int i = 0;
while (i < j)
{
arrayOfObject[paramArrayOfInt[i]] = paramArrayOfK[i];
i += 1;
}
AppMethodBeat.o(192545);
return arrayOfObject;
}
private static <K> int[] f(K[] paramArrayOfK)
{
AppMethodBeat.i(192535);
int j = paramArrayOfK.length;
int[] arrayOfInt = new int[j];
HashMap localHashMap = new HashMap();
int i = 0;
while (i < j)
{
K ? = paramArrayOfK[i];
Integer localInteger2 = (Integer)localHashMap.get(?);
Integer localInteger1 = localInteger2;
if (localInteger2 == null)
{
localInteger1 = Integer.valueOf(localHashMap.size());
localHashMap.put(?, localInteger1);
}
arrayOfInt[i] = localInteger1.intValue();
i += 1;
}
AppMethodBeat.o(192535);
return arrayOfInt;
}
public final V eZ(int paramInt)
{
return this.aqm[this.bGH[paramInt]];
}
}
public static class i
{
static final i bGI;
final GridLayout.f bFF;
final boolean bGJ;
final GridLayout.a bGK;
final float qL;
static
{
AppMethodBeat.i(192574);
bGI = GridLayout.GQ();
AppMethodBeat.o(192574);
}
i(boolean paramBoolean, int paramInt1, int paramInt2, GridLayout.a parama, float paramFloat)
{
this(paramBoolean, new GridLayout.f(paramInt1, paramInt1 + paramInt2), parama, paramFloat);
AppMethodBeat.i(192561);
AppMethodBeat.o(192561);
}
private i(boolean paramBoolean, GridLayout.f paramf, GridLayout.a parama, float paramFloat)
{
this.bGJ = paramBoolean;
this.bFF = paramf;
this.bGK = parama;
this.qL = paramFloat;
}
final i a(GridLayout.f paramf)
{
AppMethodBeat.i(192591);
paramf = new i(this.bGJ, paramf, this.bGK, this.qL);
AppMethodBeat.o(192591);
return paramf;
}
public final GridLayout.a aV(boolean paramBoolean)
{
if (this.bGK != GridLayout.bFq) {
return this.bGK;
}
if (this.qL == 0.0F)
{
if (paramBoolean) {
return GridLayout.bFv;
}
return GridLayout.bFA;
}
return GridLayout.bFB;
}
public boolean equals(Object paramObject)
{
AppMethodBeat.i(192598);
if (this == paramObject)
{
AppMethodBeat.o(192598);
return true;
}
if ((paramObject == null) || (getClass() != paramObject.getClass()))
{
AppMethodBeat.o(192598);
return false;
}
paramObject = (i)paramObject;
if (!this.bGK.equals(paramObject.bGK))
{
AppMethodBeat.o(192598);
return false;
}
if (!this.bFF.equals(paramObject.bFF))
{
AppMethodBeat.o(192598);
return false;
}
AppMethodBeat.o(192598);
return true;
}
public int hashCode()
{
AppMethodBeat.i(192603);
int i = this.bFF.hashCode();
int j = this.bGK.hashCode();
AppMethodBeat.o(192603);
return i * 31 + j;
}
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes10.jar
* Qualified Name: androidx.gridlayout.widget.GridLayout
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
09e9b9a026bf5bfc22af3b441d1f528311914a02 | ac3b8f13c9735af3e1cedce90bcfe2393dfbf38e | /symphony-client/src/main/java/org/symphonyoss/exceptions/FirehoseException.java | 3ca5e8566a3417727b98a2d7bb89cfccabbf89de | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] | permissive | timleecasey/symphony-java-client | 9d50997aab8daeaed311b2a7c782931c540b1535 | 848eabc2c0796bf19069470db813b6957f3a2d44 | refs/heads/master | 2020-08-04T03:34:31.806633 | 2016-10-30T02:57:59 | 2016-10-30T02:57:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,331 | java | /*
*
* *
* * Copyright 2016 The Symphony Software Foundation
* *
* * Licensed to The Symphony Software Foundation (SSF) under one
* * or more contributor license agreements. See the NOTICE file
* * distributed with this work for additional information
* * regarding copyright ownership. The ASF licenses this file
* * to you under the Apache License, Version 2.0 (the
* * "License"); you may not use this file except in compliance
* * with the License. You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing,
* * software distributed under the License is distributed on an
* * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* * KIND, either express or implied. See the License for the
* * specific language governing permissions and limitations
* * under the License.
*
*/
package org.symphonyoss.exceptions;
/**
* Created by Frank Tarsillo on 9/11/2016.
*/
public class FirehoseException extends SymException {
public FirehoseException(String message) {
super(message);
}
public FirehoseException(Throwable cause) {
super(cause);
}
public FirehoseException(String message, Throwable cause) {
super(message, cause);
}
}
| [
"ftarsillo@gmail.com"
] | ftarsillo@gmail.com |
40bde41a7fd62854ed077b1fb2f4440a480e2571 | f05da94a529b985159213c3accdeb4315eae288d | /src/Cluster.java | fa4803b4f9da2fbb279a6337c24d1baf2d3ae9e8 | [] | no_license | karlc1/Object-tracking-color-analysis | 670cb79d1b118048c32dd0758a8c145acbfd8141 | 06839473bb043800a3605a88c828c4c04beedd98 | refs/heads/master | 2021-09-13T20:18:03.943059 | 2018-05-03T20:52:56 | 2018-05-03T20:52:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,599 | java | import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.Size;
import org.opencv.core.TermCriteria;
import org.opencv.imgproc.Imgproc;
/** This class is based on the following repo:
* https://github.com/badlogic/opencv-fun/blob/master/src/pool/tests/Cluster.java
*
* Edited to fit this project and added some extra features, removed the display features from the original
* Can be heavily optimized to suite this implementation
*/
public class Cluster {
// Global for convenience, should be refactored
static Map<Integer, Integer> counts;
static Mat centers;
// For debug/presentation
static Display testDisplay1 = new Display();
// Load open cv core lib
static {
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
}
public static int[] getColor (Mat original, Mat mask, double scale, boolean SHOW_MASKED_ORIGINAL) {
// Rescale original and save a clone
Mat originalScaled = original.clone();
Imgproc.resize(originalScaled, originalScaled, new Size(original.width() * scale, original.height() * scale));
// Rescale mask to be compatible with rescaled original
Mat maskScaled = mask.clone();
Imgproc.resize(maskScaled, maskScaled, new Size(mask.width() * scale, mask.height() * scale));
// Create en empty mat to fill with the foreground pixels of the original (as indicated in mask)
Mat img = Mat.zeros(originalScaled.rows(), originalScaled.cols(), originalScaled.type());
// Fill the mat
for (int i = 0; i < maskScaled.height(); i++) {
for (int j = 0; j < maskScaled.width(); j++) {
if (maskScaled.get(i, j)[0] != 0) {
int r = (int) originalScaled.get(i, j)[0];
int g = (int) originalScaled.get(i, j)[1];
int b = (int) originalScaled.get(i, j)[2];
img.put(i, j, r, g ,b);
}
}
}
if (SHOW_MASKED_ORIGINAL) {
Mat imgEnlarged = img.clone();
Imgproc.resize(img, imgEnlarged, new Size(img.width() / scale, img.height() / scale));
testDisplay1.displayImage(imgEnlarged);
}
// Empty the list of counts, having the label as key and cluster size as value
counts = new HashMap<Integer, Integer>();
// Perform the kNN clustering
List<Mat> cluster = cluster(img, 5);
// Find largest cluster and its label
int maxCount = 0;
int maxIndex = 0;
for (int i = 0; i < 5; i++) {
if (counts.get(i) > maxCount &&
(centers.get(i, 2)[0] != 0 &&
centers.get(i, 1)[0] != 0 &&
centers.get(i, 0)[0] != 0)) {
maxCount = counts.get(i);
maxIndex = i;
}
}
// Get centroid color value from largest cluster
int r = (int)centers.get(maxIndex, 2)[0];
int g = (int)centers.get(maxIndex, 1)[0];
int b = (int)centers.get(maxIndex, 0)[0];
// Return RGB of centroid
int[] prominentColor = {r,g,b};
return prominentColor;
}
/**
* Perform clustering
* @param cutout
* @param k
* @return
*/
public static List<Mat> cluster(Mat cutout, int k) {
Mat samples = cutout.reshape(1, cutout.cols() * cutout.rows());
Mat samples32f = new Mat();
samples.convertTo(samples32f, CvType.CV_32F, 1.0 / 255.0);
Mat labels = new Mat();
TermCriteria criteria = new TermCriteria(TermCriteria.COUNT, 100, 1);
centers = new Mat();
Core.kmeans(samples32f, k, labels, criteria, 1, Core.KMEANS_PP_CENTERS, centers);
return showClusters(cutout, labels, centers);
}
/**
* This method is written by author of repo linked in top of file, used there for visualizing color cluster
* Here it is edited to be used only for counting the entries in the clusters, could be heavily optimized in future
* @param cutout
* @param labels
* @param centers
* @return
*/
private static List<Mat> showClusters (Mat cutout, Mat labels, Mat centers) {
centers.convertTo(centers, CvType.CV_8UC1, 255.0);
centers.reshape(3);
List<Mat> clusters = new ArrayList<Mat>();
for(int i = 0; i < centers.rows(); i++) {
clusters.add(Mat.zeros(cutout.size(), cutout.type()));
}
for(int i = 0; i < centers.rows(); i++) counts.put(i, 0);
int rows = 0;
for(int y = 0; y < cutout.rows(); y++) {
for(int x = 0; x < cutout.cols(); x++) {
int label = (int)labels.get(rows, 0)[0];
int r = (int)centers.get(label, 2)[0];
int g = (int)centers.get(label, 1)[0];
int b = (int)centers.get(label, 0)[0];
counts.put(label, counts.get(label) + 1);
clusters.get(label).put(y, x, b, g, r);
rows++;
}
}
return clusters;
}
} | [
"karl.casserfelt@gmail.com"
] | karl.casserfelt@gmail.com |
e9c5497f123d79affa05fdc553f1ffac8aad334a | 6edab2a1f49efbc5b395cdf0479e491a0c345a76 | /GraphicsAssignment1/src/Renderer/Bubbles.java | dce90fad06a6e8572cbfe182e562b4b420fdf0c1 | [] | no_license | narrat32/FishTank | 1896a91ad66db7adb899b76b2c2e14510f2e6741 | ef72e34234f793895695c7cc97e26059e5ac74d8 | refs/heads/master | 2020-04-28T09:06:59.509917 | 2019-03-21T11:44:51 | 2019-03-21T11:44:51 | 175,154,611 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 513 | java | package Renderer;
import java.util.ArrayList;
public class Bubbles {
public double bubbleXLocation, y;
public double bubbleSize, bubbleMovement;
public double age;
public double ageMax;
public Bubbles(double bubbleXLocation, double y, double bubbleSize, double bubbleMovement) {
this.bubbleXLocation = bubbleXLocation;
this.y = y;
this.bubbleSize = bubbleSize;
this.bubbleMovement = bubbleMovement;
this.age = 0.0f;
this.ageMax = 1.0f + (double)Math.random() * 10;
}
}
| [
"tarran.oshaughnessy@gmail.com"
] | tarran.oshaughnessy@gmail.com |
b62262102ee41d1faea302d02f14faf2eb908bcf | d1a6d1e511df6db8d8dd0912526e3875c7e1797d | /genny_JavaWithLambdasApi21/applicationModule/src/test/java/applicationModulepackageJava2/Foo708Test.java | f743745942aa24e4925325b1da500581a60e4d2a | [] | no_license | NikitaKozlov/generated-project-for-desugaring | 0bc1443ab3ddc84cd289331c726761585766aea7 | 81506b3711004185070ca4bb9a93482b70011d36 | refs/heads/master | 2020-03-20T00:35:06.996525 | 2018-06-12T09:30:37 | 2018-06-12T09:30:37 | 137,049,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 741 | java | package applicationModulepackageJava2;
import org.junit.Test;
public class Foo708Test {
@Test
public void testFoo0() {
new Foo708().foo0();
}
@Test
public void testFoo1() {
new Foo708().foo1();
}
@Test
public void testFoo2() {
new Foo708().foo2();
}
@Test
public void testFoo3() {
new Foo708().foo3();
}
@Test
public void testFoo4() {
new Foo708().foo4();
}
@Test
public void testFoo5() {
new Foo708().foo5();
}
@Test
public void testFoo6() {
new Foo708().foo6();
}
@Test
public void testFoo7() {
new Foo708().foo7();
}
@Test
public void testFoo8() {
new Foo708().foo8();
}
@Test
public void testFoo9() {
new Foo708().foo9();
}
}
| [
"nikita.e.kozlov@gmail.com"
] | nikita.e.kozlov@gmail.com |
c18605c046a23c192a80e26e518b8b6790ea0317 | 0083de670506bd33d871de217643c4e72cffec73 | /src/array/Triangle.java | 56a0dfe3a1783f65c66128eda80502934124694c | [] | no_license | dingluoneu/LeetCode2017 | 2ba0264d8344b8f2bf75010da8c28b281ffaae0f | 080731fc45c6288fdd86f16442ad5ff171936608 | refs/heads/master | 2021-07-10T18:17:16.375986 | 2017-10-13T03:38:50 | 2017-10-13T03:38:50 | 103,871,334 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 800 | java | package array;
import java.util.ArrayList;
import java.util.List;
public class Triangle {
/* Solution1: Bottom-up */
public static int minimumTotal(List<List<Integer>> triangle) {
if (triangle == null || triangle.size() == 0) return -1;
int[] total = new int[triangle.size()];
int lastLevel = triangle.size() - 1;
for (int i = 0; i < triangle.get(lastLevel).size(); i++) {
total[i] = triangle.get(lastLevel).get(i);
}
/* Iterate from last second row */
for (int i = triangle.size() - 2; i >= 0; i--) {
for (int j = 0; j < triangle.get(i + 1).size() - 1; j++) {
total[j] = triangle.get(i).get(j) + Math.min(total[j], total[j + 1]);
}
}
return total[0];
}
}
| [
"dingluo.bupt@gmail.com"
] | dingluo.bupt@gmail.com |
256f371950facd710ed99d05766c7077ee009ea1 | a5d4689a6f40cde386d7565ec8741a7f4d72ace2 | /src/main/java/com/task/quartz/quartz/quartz/task/HelloWorldJob.java | c50acd938de86689d0395ed8af2487c273078d39 | [] | no_license | syzpig/quartz | 8dd951b84f020de24dca4130f06f224d0e4ae37a | 12ec51cd3039e5d94579b02fe26541796c1e3365 | refs/heads/master | 2022-06-23T14:17:11.889780 | 2019-10-24T07:58:03 | 2019-10-24T07:58:03 | 217,243,228 | 0 | 0 | null | 2022-06-21T02:06:28 | 2019-10-24T07:55:06 | Java | UTF-8 | Java | false | false | 605 | java | package com.task.quartz.quartz.quartz.task;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.stereotype.Component;
import java.util.Date;
@DisallowConcurrentExecution //作业不并发
@Component
public class HelloWorldJob implements Job{
@Override
public void execute(JobExecutionContext arg0) throws JobExecutionException {
System.out.println("欢迎使用yyblog,这是一个定时任务 --小卖铺的老爷爷!"+ new Date());
}
} | [
"1037185543@qq.com"
] | 1037185543@qq.com |
563617e5e01d9b7cbccf0a4a22723a581f2795ee | 11b068c141d0a8e9466e3d4ec285f4dc87af6c49 | /src/main/groovy/io/xh/hoist/json/JSONFormatCached.java | 0c7e5989c23645d090f8e46441cee55b13e41de1 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-free-unknown"
] | permissive | xh/hoist-core | a5e1a926eacf1cf48a04d6a7047ff74d74c1ba74 | 8c9d6de341ceee932815d044ef8b164c10246d97 | refs/heads/develop | 2023-08-18T08:26:00.460175 | 2023-08-17T13:00:57 | 2023-08-17T13:00:57 | 117,719,530 | 4 | 1 | Apache-2.0 | 2023-09-13T21:25:53 | 2018-01-16T17:52:16 | Groovy | UTF-8 | Java | false | false | 1,086 | java | /*
* This file belongs to Hoist, an application development toolkit
* developed by Extremely Heavy Industries (www.xh.io | info@xh.io)
*
* Copyright © 2023 Extremely Heavy Industries Inc.
*/
package io.xh.hoist.json;
import com.fasterxml.jackson.core.JsonProcessingException;
/**
* Superclass to provide support for cached JSON serialization. Consider for classes that:
*
* + Are likely to have the same instances serialized multiple times (e.g. a cached resultset
* provided to multiple users).
* + Have final / immutable properties that won't change after the first serialization.
* + Are serialized in bulk, contain large collections, or are otherwise performance-sensitive.
*/
abstract public class JSONFormatCached {
private String _cache = null;
public JSONFormatCached() { }
abstract protected Object formatForJSON();
public String getCachedJSON() throws JsonProcessingException {
if (_cache == null) {
_cache = JSONSerializer.serialize(this.formatForJSON());
}
return _cache;
}
}
| [
"atm@xh.io"
] | atm@xh.io |
839f34083279b821bf48dfacadb92aa30a10f8f8 | 531ef6203fb8b4d16e9921a12500a440792a8151 | /intro-maven-module/src/test/java/com/sirma/itt/javacourse/intro/HangmanTests.java | 94fcd49c8ee23f745a9d6efe4fb0e4b1729b6f7c | [] | no_license | stiliyan-koev/my-java-studying | 6fd15fd2358edab8314c576d8b31d25ce869612f | f7052af369947922747c14b54e001faa6bbf31a8 | refs/heads/master | 2021-09-03T04:12:16.059528 | 2017-11-30T20:40:00 | 2017-11-30T20:40:00 | 106,920,016 | 0 | 0 | null | 2017-11-30T20:40:00 | 2017-10-14T10:48:35 | Java | UTF-8 | Java | false | false | 1,137 | java | package com.sirma.itt.javacourse.intro;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import com.sirma.itt.javacourse.intro.utils.Hangman;
/**
* JUnit tests for {@link Hangman}.
*
* @author Stiliyan Koev
*/
public class HangmanTests {
/**
* Testing modifyTheWord method.
*/
@Test
public void testModifyTheWord() {
Hangman hangman = new Hangman();
String expected = "T__T_E";
String actual = hangman.modifyTheWord(new StringBuilder("TURTLE")).toString();
assertEquals(expected, actual);
}
/**
* Testing remainingLetters method.
*/
@Test
public void testRemainingLetters() {
Hangman hangman = new Hangman();
int actual = hangman.getRemainingLettersForGuess(new StringBuilder("T__T_E"));
int expected = 3;
assertEquals(expected, actual);
}
/**
* Testing chooseWord method.
*/
@Test
public void testChooseWord() {
Hangman hangman = new Hangman();
String[] words = new String[1];
words[0] = "cheese";
String actual = hangman.chooseWord(words);
String expected = "cheese";
assertEquals(expected, actual);
}
}
| [
"stiliyan.koev@sirma.bg"
] | stiliyan.koev@sirma.bg |
b4fd366da0a8e00d69c8a9bfce9fd71d6022ae76 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/5/5_347598514d5e243ba1c36dc7c9b1c475c4ad72f1/Application/5_347598514d5e243ba1c36dc7c9b1c475c4ad72f1_Application_t.java | 902e2e7c47e5c69a82260bffe1c6e69fc0a2f7c9 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,607 | java | package controllers;
import models.Topic;
import org.joda.time.DateTime;
import play.*;
import play.data.format.Formatters;
import static play.data.format.Formatters.*;
import play.mvc.*;
import play.data.Form;
import static play.data.Form.*;
import play.data.validation.Constraints;
import play.mvc.*;
import views.html.*;
import java.util.Locale;
public class Application extends Controller {
final static Form<Topic> topicForm = form(Topic.class);
public static Result index() {
Topic result = Topic.findByTitle("Crisis");
if (result == null) {
result = Topic.find.byId(1l);
}
return ok(index.render(result.title, result.getFullJson().toString()));
}
public static Result show(String title) {
Topic result = Topic.findByTitle(title);
if (result == null) {
return index();
}
return ok(index.render(result.title, result.getFullJson().toString()));
}
public static Result getTopicJson() {
Form<Topic> t = topicForm.bindFromRequest();
Topic topic = Topic.findByTitle(t.get().title);
if (topic == null) {
return ok("{}");
}
return ok(topic.getFullJson());
}
public static Result adminTools() {
String sessionData = session().get("administrator");
boolean isAdmin = sessionData != null && sessionData.equals("yes");
if (!isAdmin) {
return ok(enter_password.render());
} else {
return ok(edit_topics.render());
}
}
public static class Password {
@Constraints.Required
public String password;
}
final static Form<Password> passwordForm = form(Password.class);
public static Result verifyPassword() {
Form<Password> form = passwordForm.bindFromRequest();
if(!form.hasErrors() && form.get().password.equals(Play.application().configuration().getString("password"))) {
session("administrator", "yes");
return redirect("/admin_tools");
}
return ok("Access Denied");
}
public static Result postTopic() {
Form<Topic> form = topicForm.bindFromRequest();
String supers = form.field("supers").valueOr("");
String subs = form.field("subs").valueOr("");
String title = Topic.handleForm(form, supers, subs);
if (title == null)
return redirect("/admin_tools");
else
return redirect("/topic/" + title);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
a077e28f7db83c39dee5c29afdb2aa58000a029d | b1e3faa9970fd84a4c76fcb6fe06ba05b4caba5e | /app/src/main/java/com/example/muhanxi/kuaikanmanhua/listener/ViewListener.java | 8b9846cddcc4f167329f16936ca180fd871251ee | [] | no_license | bwei1503d/KuaiKanManHua | 196dec83983971d1be190180503d23571226a6fa | 9da0ea8d223d0af15adb6770e6be2c32f0048ca0 | refs/heads/master | 2021-01-20T10:23:42.373891 | 2017-05-05T07:40:12 | 2017-05-05T07:40:12 | 90,350,298 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 180 | java | package com.example.muhanxi.kuaikanmanhua.listener;
/**
* Created by muhanxi on 17/4/24.
*/
public interface ViewListener {
// 控件初始化
public void init();
}
| [
"zmuhanxibaweiZ1"
] | zmuhanxibaweiZ1 |
9a45d0bbf0e6041edfc166a5a1ddfb8597faeb43 | d56793c52a83487ef0bc1f0844dfb446204faf9a | /spring-social-facebook3/src/main/java/com/example/demo/web/controller/LoginController.java | a399eb08269896a255f82b6a43918c4f280e3bdc | [] | no_license | softcontext/spring-social | 9a63d07c5922f237972eea94f1de5e0942328820 | a893c40583bd5fbf2c45358e22e2958b97bef1e7 | refs/heads/master | 2021-04-27T15:24:56.276044 | 2018-02-22T11:25:50 | 2018-02-22T11:25:50 | 122,469,576 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,230 | java | package com.example.demo.web.controller;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import com.example.demo.web.model.MyUser;
import com.example.demo.web.service.LoginService;
// 아이디/패스워드 정보를 받아 로그인 처리를 한다.
@Controller
@RequestMapping("/login")
public class LoginController {
@Autowired
private LoginService loginService;
@GetMapping
public String getLoginView() {
return "user/login";
}
@PostMapping
public String doLogin(MyUser account, Model model, HttpSession session) {
if (loginService.authorize(account)) {
loginService.proceedLogin(account, session);
return "redirect:";
} else {
model.addAttribute("error", "아이디/패스워드가 일치하지 않습니다.");
return "user/login";
}
}
@GetMapping(params="logout")
public String doLogout(HttpSession session) {
session.invalidate();
return "redirect:";
}
}
| [
"softcontext@gmail.com"
] | softcontext@gmail.com |
328b9f4d71a3e49f9c537a8b50f59cda3ee9f47f | 9e611af56d433593e5fb81496522012c31c204de | /src/main/java/zin/zone/configuration/JpaConfiguration.java | be6e6ffa6a0132ec02230615f49ec92d69436d06 | [] | no_license | bruceleefinalkungfu/zone | 8cd601ad203c0eab6b26892cf4dc991081025f80 | 1429a4b8df0dcdc05464fc28c9f431bb3e483d68 | refs/heads/master | 2021-05-14T15:57:42.401325 | 2018-01-10T11:51:24 | 2018-01-10T11:51:24 | 116,008,373 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,623 | java | package zin.zone.configuration;
import java.util.Properties;
import javax.naming.NamingException;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.env.Environment;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.JpaVendorAdapter;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import com.zaxxer.hikari.HikariDataSource;
@Configuration
@EnableJpaRepositories(basePackages = "zin.zone.repositories",
entityManagerFactoryRef = "entityManagerFactory",
transactionManagerRef = "transactionManager")
@EnableTransactionManagement
public class JpaConfiguration {
@Autowired
private Environment environment;
@Value("${datasource.sampleapp.maxPoolSize:10}")
private int maxPoolSize;
/*
* Populate SpringBoot DataSourceProperties object directly from application.yml
* based on prefix.Thanks to .yml, Hierachical data is mapped out of the box with matching-name
* properties of DataSourceProperties object].
*/
@Bean
@Primary
@ConfigurationProperties(prefix = "datasource.sampleapp")
public DataSourceProperties dataSourceProperties(){
return new DataSourceProperties();
}
/*
* Configure HikariCP pooled DataSource.
*/
@Bean
public DataSource dataSource() {
DataSourceProperties dataSourceProperties = dataSourceProperties();
HikariDataSource dataSource = (HikariDataSource) DataSourceBuilder
.create(dataSourceProperties.getClassLoader())
.driverClassName(dataSourceProperties.getDriverClassName())
.url(dataSourceProperties.getUrl())
.username(dataSourceProperties.getUsername())
.password(dataSourceProperties.getPassword())
.type(HikariDataSource.class)
.build();
dataSource.setMaximumPoolSize(maxPoolSize);
return dataSource;
}
/*
* Entity Manager Factory setup.
*/
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() throws NamingException {
LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
factoryBean.setDataSource(dataSource());
factoryBean.setPackagesToScan(new String[] { "zin.zone.model" });
factoryBean.setJpaVendorAdapter(jpaVendorAdapter());
factoryBean.setJpaProperties(jpaProperties());
return factoryBean;
}
/*
* Provider specific adapter.
*/
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter();
return hibernateJpaVendorAdapter;
}
/*
* Here you can specify any provider specific properties.
*/
private Properties jpaProperties() {
Properties properties = new Properties();
properties.put("hibernate.dialect", environment.getRequiredProperty("datasource.sampleapp.hibernate.dialect"));
properties.put("hibernate.hbm2ddl.auto", environment.getRequiredProperty("datasource.sampleapp.hibernate.hbm2ddl.method"));
properties.put("hibernate.show_sql", environment.getRequiredProperty("datasource.sampleapp.hibernate.show_sql"));
properties.put("hibernate.format_sql", environment.getRequiredProperty("datasource.sampleapp.hibernate.format_sql"));
if(StringUtils.isNotEmpty(environment.getRequiredProperty("datasource.sampleapp.defaultSchema"))){
properties.put("hibernate.default_schema", environment.getRequiredProperty("datasource.sampleapp.defaultSchema"));
}
return properties;
}
@Bean
@Autowired
public PlatformTransactionManager transactionManager(EntityManagerFactory emf) {
JpaTransactionManager txManager = new JpaTransactionManager();
txManager.setEntityManagerFactory(emf);
return txManager;
}
}
| [
"trueindiantiger@gmail.com"
] | trueindiantiger@gmail.com |
72680f5ebe4c0af0784c5227f0be3c9b36584c4c | 14ac350737d4573b7b792a4d3b3dec593c00bafe | /src/test/java/com/lalitpatil/ormLiteDemo/OrmLiteDemoApplicationTests.java | 82139053c7f387a086b51ded0c2fc0a4cc2f88f1 | [] | no_license | redlalitp/sqlite-ormLite-demo | eb984c5c52448e69c0b899eb2f31842db03f64b9 | 6ef3d45eb25dce0be1053b5c5e71d8e7d86509d6 | refs/heads/master | 2023-05-08T11:09:20.945705 | 2021-06-03T13:06:03 | 2021-06-03T13:06:03 | 373,510,171 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 223 | java | package com.lalitpatil.ormLiteDemo;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class OrmLiteDemoApplicationTests {
@Test
void contextLoads() {
}
}
| [
"lalitpatil@outlook.com"
] | lalitpatil@outlook.com |
9e35bd2a23b64e954556a72fffcce5acf8d06760 | d2087783a13def19a1ad30cf0dd411a193334736 | /src/main/java/com/ypw/springboothello/GOF23/proxy/dynamicProxy/cglib/Client.java | a07090fa454855f65187d24a01bd7b433894b7da | [] | no_license | see-ya/spring-boot-hello | 8ccbce885cdde65f469145b6c083fb48021e10e2 | ad6dc527457a073eb6b372b190c6d8256eb3142c | refs/heads/master | 2021-10-19T10:08:23.901058 | 2019-02-20T07:06:24 | 2019-02-20T07:06:24 | 263,298,985 | 1 | 0 | null | 2020-05-12T09:59:40 | 2020-05-12T09:59:39 | null | UTF-8 | Java | false | false | 703 | java | package com.ypw.springboothello.GOF23.proxy.dynamicProxy.cglib;
import org.springframework.cglib.proxy.Enhancer;
import java.lang.reflect.Proxy;
/**
* cglib实现动态代理(基于字节码,运行效率高)
*
* @param
* @author yupengwu
* @date 2018/10/10 09:16
* @return
*/
public class Client {
public static void main(String[] args) {
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName());
Enhancer enhancer = new Enhancer();
enhancer.setSuperclass(RealStar.class);
enhancer.setCallback(new StarHandler());
RealStar realStar = (RealStar) enhancer.create();
realStar.bookTicket();
realStar.sing();
}
}
| [
"384556909@qq.com"
] | 384556909@qq.com |
341789ad23c8f94087b0f2614dc9942b51818ff7 | 2c616f3cc6ede3e623b355dd748177f9d5d59ad6 | /src/escape/pathfind/MovementPatternIDSpecifier.java | dfbd74201e787e05eb4cb617b9daebc422f6b5bb | [] | no_license | GabeAponte/EscapeGame | de53feee416386604361e411186b4a2fd5c58b4b | b701c5549e93c95b60e4c81cd4aac0fa14f78fd1 | refs/heads/master | 2022-12-14T22:44:58.641793 | 2020-09-18T18:38:41 | 2020-09-18T18:38:41 | 296,701,564 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,442 | java | /*******************************************************************************
* This files was developed for CS4233: Object-Oriented Analysis & Design.
* The course was taken at Worcester Polytechnic Institute.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* Copyright ©2016-2020 Gabriel Aponte
*******************************************************************************/
package escape.pathfind;
import escape.board.coordinate.AbsCoordinate;
import escape.board.coordinate.CoordinateID;
/**
* This interface is used to provide the MovementPatternID enums with the ability
* to have methods with specific implementations
*
* @version Apr 30, 2020
*/
public interface MovementPatternIDSpecifier {
/**
* Checks if moving from the current coordinate and the next adjacent coordinate
* in the BFS algorithm violates the movement pattern restrictions
*
* @param c the current coordinate
* @param next the next adjacent coordinate
* @param direction the directionID being used by BFS
* @param coordID the coordinateID of the escapeGame
* @return boolean value of true or false
*/
public boolean checkValidMove(AbsCoordinate c, AbsCoordinate next, DirectionID direction, CoordinateID coordID);
}
| [
"36209249+GabeAponte@users.noreply.github.com"
] | 36209249+GabeAponte@users.noreply.github.com |
2b60e8f85f2dbb4b28d12568cc616173a47c539e | ee63930722137539e989a36cdc7a3ac235ca1932 | /app/src/main/java/com/yksj/consultation/sonDoc/chatting/avchat/module/input/robot/animation/SlideInBottomAnimation.java | a71def0eb918ba5f79f0ccb2073472c2b66d19e8 | [] | no_license | 13525846841/SixOneD | 3189a075ba58e11eedf2d56dc4592f5082649c0b | 199809593df44a7b8e2485ca7d2bd476f8faf43a | refs/heads/master | 2020-05-22T07:21:27.829669 | 2019-06-05T09:59:58 | 2019-06-05T09:59:58 | 186,261,515 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 453 | java | package com.yksj.consultation.sonDoc.chatting.avchat.module.input.robot.animation;
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.view.View;
public class SlideInBottomAnimation implements BaseAnimation {
@Override
public Animator[] getAnimators(View view) {
return new Animator[]{
ObjectAnimator.ofFloat(view, "translationY", view.getMeasuredHeight(), 0)
};
}
}
| [
"762900942@qq.com"
] | 762900942@qq.com |
b7ff6d441e1ea9a365445650f6e88f343348a802 | cb90144061071ebe7ef069b10289129df0ce19a8 | /src/main/java/seleniumCucumber/Utils.java | 0d1eb9550e02babd6ba11faada497ad9b909d4ac | [] | no_license | radha475/seleniumcucumber | 69b4267851d3d5527b40a0c24b88401705391e9f | 44d256e70477d960953817bf8d66f2f86218328d | refs/heads/main | 2023-05-31T04:53:19.227651 | 2021-06-23T17:29:39 | 2021-06-23T17:29:39 | 379,196,491 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 51 | java | package seleniumCucumber;
public class Utils {
}
| [
"radhakrishnakompalli@gmail.com"
] | radhakrishnakompalli@gmail.com |
1b9ddc40c63da98cd7adcf5561c423de17d29fce | 228b606fb3fa5ce07191df00435b29c9dfe1bf40 | /JavaCore/src/chapter2_4/PostTest.java | e6938e379378af29551080b58d7fbb19dd35bbe7 | [] | no_license | rvfedorin/JavaStudy | 0453ff9b70d4772185530f83330edf8a51830710 | 0fe55fcb2b81a239920ccd208ab41147d435f7db | refs/heads/master | 2021-12-23T08:21:01.278181 | 2021-12-16T14:58:44 | 2021-12-16T14:58:44 | 156,690,124 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,869 | java | package chapter2_4;
import java.io.*;
import java.net.*;
import java.nio.file.*;
import java.util.*;
/**
* This program demonstrates how to use the URLConnection class for a POST request.
* @version 1.40 2016-04-24
* @author Cay Horstmann
*/
public class PostTest
{
public static void main(String[] args) throws IOException
{
String propsFilename = args.length > 0 ? args[0] : "post.properties";
Properties props = new Properties();
try (InputStream in = Files.newInputStream(Paths.get(propsFilename)))
{
props.load(in);
}
String urlString = props.remove("url").toString();
Object userAgent = props.remove("User-Agent");
Object redirects = props.remove("redirects");
CookieHandler.setDefault(new CookieManager(null, CookiePolicy.ACCEPT_ALL));
String result = doPost(new URL(urlString), props,
userAgent == null ? null : userAgent.toString(),
redirects == null ? -1 : Integer.parseInt(redirects.toString()));
System.out.println(result);
}
/**
* Do an HTTP POST.
* @param url the URL to post to
* @param nameValuePairs the query parameters
* @param userAgent the user agent to use, or null for the default user agent
* @param redirects the number of redirects to follow manually, or -1 for automatic redirects
* @return the data returned from the server
*/
public static String doPost(URL url, Map<Object, Object> nameValuePairs, String userAgent, int redirects)
throws IOException
{
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
if (userAgent != null)
connection.setRequestProperty("User-Agent", userAgent);
if (redirects >= 0)
connection.setInstanceFollowRedirects(false);
connection.setDoOutput(true);
try (PrintWriter out = new PrintWriter(connection.getOutputStream()))
{
boolean first = true;
for (Map.Entry<Object, Object> pair : nameValuePairs.entrySet())
{
if (first) first = false;
else out.print('&');
String name = pair.getKey().toString();
String value = pair.getValue().toString();
out.print(name);
out.print('=');
out.print(URLEncoder.encode(value, "UTF-8"));
}
}
String encoding = connection.getContentEncoding();
if (encoding == null) encoding = "UTF-8";
if (redirects > 0)
{
int responseCode = connection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_MOVED_PERM
|| responseCode == HttpURLConnection.HTTP_MOVED_TEMP
|| responseCode == HttpURLConnection.HTTP_SEE_OTHER)
{
String location = connection.getHeaderField("Location");
if (location != null)
{
URL base = connection.getURL();
connection.disconnect();
return doPost(new URL(base, location), nameValuePairs, userAgent, redirects - 1);
}
}
}
else if (redirects == 0)
{
throw new IOException("Too many redirects");
}
StringBuilder response = new StringBuilder();
try (Scanner in = new Scanner(connection.getInputStream(), encoding))
{
while (in.hasNextLine())
{
response.append(in.nextLine());
response.append("\n");
}
}
catch (IOException e)
{
InputStream err = connection.getErrorStream();
if (err == null) throw e;
try (Scanner in = new Scanner(err))
{
response.append(in.nextLine());
response.append("\n");
}
}
return response.toString();
}
}
| [
"35657347+rvfedorin@users.noreply.github.com"
] | 35657347+rvfedorin@users.noreply.github.com |
fc12d3716c91dd839fdeaa3c82ed85430258c091 | 8f0783e0236e64ccfda4f70bae3240c45ce670b4 | /src/main/java/com/userfront/userfront/domain/SavingsTransaction.java | 528aa461e4172930c79ca24ccf4de780edb7d46c | [] | no_license | robertobiero/UserFront | b7810c5b04f67d5c804737b935dd7f8110b0feb9 | 49ab0e6d24e2a6efbf9aa366eba638cf9499d609 | refs/heads/master | 2021-05-06T15:33:33.197411 | 2017-12-08T14:32:24 | 2017-12-08T14:32:24 | 113,583,603 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,420 | java | package com.userfront.userfront.domain;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
@Entity
public class SavingsTransaction {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private Date date;
private String description;
private String type;
private String status;
private double amount;
private BigDecimal availableBalance;
@ManyToOne
@JoinColumn(name = "savings_account_id")
private SavingsAccount savingsAccount;
public SavingsTransaction() {}
public SavingsTransaction(Date date, String description, String type, String status, double amount, BigDecimal availableBalance, SavingsAccount savingsAccount) {
this.date = date;
this.description = description;
this.type = type;
this.status = status;
this.amount = amount;
this.availableBalance = availableBalance;
this.savingsAccount = savingsAccount;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public double getAmount() {
return amount;
}
public void setAmount(double amount) {
this.amount = amount;
}
public BigDecimal getAvailableBalance() {
return availableBalance;
}
public void setAvailableBalance(BigDecimal availableBalance) {
this.availableBalance = availableBalance;
}
public SavingsAccount getSavingsAccount() {
return savingsAccount;
}
public void setSavingsAccount(SavingsAccount savingsAccount) {
this.savingsAccount = savingsAccount;
}
}
| [
"robert_m_obiero@homedepot.com"
] | robert_m_obiero@homedepot.com |
a2de6f5e5294c76b109e306b8baf5a55952fd92b | 98c529d07df92d3ffb299164df952fe0c866edee | /src/util/FileUploadBean.java | 1ce1f8b09ab3b934f9babb38f62543153e35ecba | [] | no_license | karim10/ter-cms-seam-jboss | d5db06b7f8c97859d950dcfca815f662c691bd06 | 8795f8060cd5f1669e33674d698d9bbb7139f658 | refs/heads/master | 2021-01-25T12:01:42.262190 | 2009-04-03T09:51:23 | 2009-04-03T09:51:23 | 35,299,824 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 5,060 | java | package util;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.richfaces.event.UploadEvent;
import org.richfaces.model.UploadItem;
import composant.GestionContenu;
import composant.GestionFrontEnd;
import composant.GestionNews;
import entite.File;
@SuppressWarnings("serial")
@Scope(ScopeType.SESSION)
@Name("fileUploadBean")
public class FileUploadBean implements Serializable{
@In(required=false)
private GestionNews gestionNews;
@In(required=false)
private GestionFrontEnd gestionFrontEnd;
@In(required=false)
private GestionContenu gestionContenu;
private List<File> files = new ArrayList<File>();
private File logo;
private int uploadsAvailableFiles = 5;
private int uploadsAvailableLogo = 1;
private boolean autoUpload = false;
public int getSize() {
if (getFiles().size()>0){
return getFiles().size();
}else
{
return 0;
}
}
public FileUploadBean() {
}
public synchronized void paintLogoContenu(OutputStream stream, Object object) throws IOException {
stream.write(gestionContenu.getContenu().getLogo().getData());
setUploadsAvailableLogo(0);
}
public synchronized void paintUploadLogo(OutputStream stream, Object object) throws IOException {
stream.write(getLogo().getData());
setUploadsAvailableLogo(0);
}
public synchronized void paintLogoContenuGF(OutputStream stream, Object object) throws IOException {
stream.write(gestionFrontEnd.getContenu().getLogo().getData());
setUploadsAvailableLogo(0);
}
public synchronized void paintLogoContenuGN(OutputStream stream, Object object) throws IOException {
stream.write(gestionNews.getNews().getLogo().getData());
setUploadsAvailableLogo(0);
}
public synchronized void paintLogo(OutputStream stream, Object object) throws IOException {
stream.write(gestionFrontEnd.getListContenuFront().get(((Integer)object)).getLogo().getData());
setUploadsAvailableLogo(0);
}
public synchronized void listenerFiles(UploadEvent event) throws Exception {
UploadItem item = event.getUploadItem();
File file = new File();
byte[] ImageData = getBytesFromFile(item.getFile());
file.setSize(item.getFile().length());
file.setName(item.getFileName());
file.setData(ImageData);
files.add(file);
uploadsAvailableFiles--;
}
public synchronized void listenerLogo(UploadEvent event) throws Exception {
UploadItem item = event.getUploadItem();
File file = new File();
byte[] ImageData = getBytesFromFile(item.getFile());
file.setSize(item.getFile().length());
file.setName(item.getFileName());
file.setData(ImageData);
setLogo(file);
uploadsAvailableLogo--;
}
/**
* <p></p>
* @param file
* @return
* @throws Exception
*/
public static byte[] getBytesFromFile(java.io.File file) throws Exception {
InputStream is = new FileInputStream(file);
long length = file.length();
// Verifie la taille pour convertir en int ensuite
if (length > Integer.MAX_VALUE) throw new Exception("la taille du fichier est trop grande");
// Création du tableau pour contenir les données du fichiers
byte[] bytes = new byte[(int)length];
// lie le fichier
int offset = 0;
int numRead = 0;
while (offset < bytes.length
&& (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
offset += numRead;
}
// assure que tous les bytes du fichiers on été lu
if (offset < bytes.length) {
throw new IOException("le fichier n'a pas pu être lu entierement "+file.getName());
}
is.close();
return bytes;
}
public String clearUploadData() {
files.clear();
logo = new File();
setUploadsAvailableFiles(5);
setUploadsAvailableLogo(1);
return null;
}
public long getTimeStamp(){
return System.currentTimeMillis();
}
public List<File> getFiles() {
return files;
}
public void setFiles(List<File> files) {
this.files = files;
}
public boolean isAutoUpload() {
return autoUpload;
}
public void setAutoUpload(boolean autoUpload) {
this.autoUpload = autoUpload;
}
public void setLogo(File logo) {
this.logo = logo;
}
public File getLogo() {
return logo;
}
public void setUploadsAvailableFiles(int uploadsAvailableFiles) {
this.uploadsAvailableFiles = uploadsAvailableFiles;
}
public int getUploadsAvailableFiles() {
return uploadsAvailableFiles;
}
public void setUploadsAvailableLogo(int uploadsAvailableLogo) {
this.uploadsAvailableLogo = uploadsAvailableLogo;
}
public int getUploadsAvailableLogo() {
return uploadsAvailableLogo;
}
@Destroy
public void destroy(){}
}
| [
"simon.duval.fr@1d6b5afe-e653-11dd-ab07-b19b4dad1b3d"
] | simon.duval.fr@1d6b5afe-e653-11dd-ab07-b19b4dad1b3d |
34d9fb5ac89aac655d04bd705db0e2d965478ba8 | 1aafef706280a00378c6f336c6a3c425179ee589 | /app/src/main/java/charge/prueba1/LoginRequest.java | 9311f67860f37437543ad069cc8ddc6ecd43d509 | [] | no_license | ChemaVadillo/tfg_jose_maria | 44f2b4cbb5eee134c59cfd0d8cb48ebb8423cd83 | ee21d855eebf6b3d4719c0d617295e9681a61ec0 | refs/heads/master | 2021-08-30T15:02:42.376754 | 2017-12-18T11:10:53 | 2017-12-18T11:10:53 | 114,631,591 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 806 | java | package charge.prueba1;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.toolbox.StringRequest;
import java.util.HashMap;
import java.util.Map;
/**
* Created by NB23626 on 10/11/2017.
*/
public class LoginRequest extends StringRequest {
private static final String LOGIN_REQUEST_URL="http://192.168.1.37/Login1.php";
private Map<String,String> params;
public LoginRequest (String username, String password, Response.Listener<String> listener) {
super(Request.Method.POST, LOGIN_REQUEST_URL, listener, null);
params = new HashMap<>();
params.put("username",username);
params.put("password", password);
}
@Override
public Map<String, String> getParams() {
return params;
}
}
| [
"34647902+ChemaVadillo@users.noreply.github.com"
] | 34647902+ChemaVadillo@users.noreply.github.com |
596d4d4cf806b33e184118b0e5a97b793ed139ae | a12219ccdb34c2f34e9f04a93b8a6fcecf32dac9 | /src/main/java/net/java_school/config/MyWebApplicationInitializer.java | cbcb6d0d88a560e5a547981d16bdb79a70cfdcda | [] | no_license | kimjonghoon/spring-thymeleaf | cff1cb7d6c0bf853b14f1cd94755b5d6b4b9e37f | 434fabc3ab16f80b4028a627cb0e16bc702cb42c | refs/heads/master | 2023-02-09T02:34:08.590623 | 2023-02-05T01:39:39 | 2023-02-05T01:39:39 | 191,003,511 | 0 | 0 | null | 2023-02-05T01:23:36 | 2019-06-09T12:26:17 | HTML | UTF-8 | Java | false | false | 535 | java | package net.java_school.config;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
public class MyWebApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getRootConfigClasses() {
return null;
}
@Override
protected Class<?>[] getServletConfigClasses() {
return new Class[] { AppConfig.class };
}
@Override
protected String[] getServletMappings() {
return new String[] { "/" };
}
} | [
"kim0070@gmail.com"
] | kim0070@gmail.com |
94c67ada043b25364948a300983a989bab1b01f8 | dcac884c13f05b413cdb4aab809b6c9f9b09ee14 | /FinalizedDBOptimizationAndAnalysisDolibarrWithMandator/src/com/containment/analysis/AnalyzeRelatedBOS.java | 391df4bb3aa075e19f0bdbdfb69fcadf0381ad5c | [] | no_license | AnuruddhaDeAlwis/BORelationshipDerivation | 2b5b395228cbd904524169b8d7f667513e9ba057 | 4865b634278a7a7d05696d64620636f9535b8685 | refs/heads/master | 2020-06-20T00:33:25.941357 | 2019-07-15T05:43:21 | 2019-07-15T05:43:21 | 196,929,496 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,764 | java | package com.containment.analysis;
import java.util.ArrayList;
import java.util.List;
public class AnalyzeRelatedBOS {
//This is the class to analyse the business objects which have the relationships between each other and then return arraylist
//defining the business object relationships.
public static List<List<String>> analyseBORelatinoshinps(ArrayList foriegnKeys, List<List<String>>finalClusters){
List<List<String>> boRelationshipsAndCount = new ArrayList<List<String>>();
ArrayList boRelatinoships = new ArrayList();//This will store the relationship between two BOs
ArrayList noOfCalls = new ArrayList();//This will stre the total number of relationships between the identified BOs
for(int i=0;i<foriegnKeys.size();i++){
String splitted[] = foriegnKeys.get(i).toString().split("=");
int one = -1;
int two = -1;
for(int j=0;j<finalClusters.size();j++){
if(finalClusters.get(j).contains(splitted[0])){
one = j;
}else if(finalClusters.get(j).contains(splitted[1])){
two = j;
}
}
String stOne = one+"-"+two;
String stTwo = two+"-"+one;
if(!boRelatinoships.contains(stOne) && !boRelatinoships.contains(stTwo)){
boRelatinoships.add(stOne);
noOfCalls.add(1);
}else if(boRelatinoships.contains(stOne)){
int value = (int)noOfCalls.get(boRelatinoships.indexOf(stOne)) +1;
noOfCalls.set(boRelatinoships.indexOf(stOne), value);
}else if(boRelatinoships.contains(stTwo)){
int value = (int)noOfCalls.get(boRelatinoships.indexOf(stTwo)) +1;
noOfCalls.set(boRelatinoships.indexOf(stTwo), value);
}
}
boRelationshipsAndCount.add(boRelatinoships);
boRelationshipsAndCount.add(noOfCalls);
return boRelationshipsAndCount;
}
}
| [
"n9572791@qut.edu.au"
] | n9572791@qut.edu.au |
be7bc192dfc9b6a3ad9f36edec15d0f0d8cc48ac | 1ead46df21ea5eb9a4de620c584e58ea41f22f1c | /Smart_Community/src/main/java/com/firstCapacity/business/powerProject/service/powerProjectExcelServiceImpl.java | d2d8cd08602a2643f3bda7a240e1c1b0752a59e7 | [] | no_license | HKHXF/Smart_Community | 82c9ca31a49d1d3edd24623ad57713bdef63d691 | 66ce402e47d51cb05669843220bb6ba93d4934e9 | refs/heads/master | 2021-05-08T07:37:47.032977 | 2017-11-22T14:44:07 | 2017-11-22T14:44:07 | 106,777,885 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,486 | java | package com.firstCapacity.business.powerProject.service;
import java.util.List;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.stereotype.Service;
import com.firstCapacity.business.powerProject.entity.powerProject;
import com.firstCapacity.util.PageHelper;
import com.firstCapacity.util.Pager;
@Transactional
@Service
public class powerProjectExcelServiceImpl implements powerProjectExcelService{
@Resource
private powerProjectService powerProjectService;
/**
* 能源项目 Excel 导出信息
* @param powerProject
* @return
*/
public HSSFWorkbook createExcel(powerProject powerProject,Integer page) {
// PageHelper.startPager(page);
List<powerProject> selectqueryList = powerProjectService.selectqueryList(powerProject);
// 创建一个webbook,对应一个excel文件
HSSFWorkbook workbook = new HSSFWorkbook();
// 在webbook中添加一个sheet,对应excel文件中的sheet
HSSFSheet sheet = workbook.createSheet("能源项目信息");
// 设置列宽
sheet.setColumnWidth(0, 70 * 100);
sheet.setColumnWidth(1, 70 * 100);
sheet.setColumnWidth(2, 50 * 100);
sheet.setColumnWidth(3, 50 * 100);
sheet.setColumnWidth(4, 70 * 100);
sheet.setColumnWidth(5, 70 * 100);
sheet.setColumnWidth(6, 50 * 100);
sheet.setColumnWidth(7, 50 * 100);
sheet.setColumnWidth(8, 50 * 100);
sheet.setColumnWidth(9, 50 * 100);
sheet.setColumnWidth(10, 60 * 100);
sheet.setColumnWidth(11, 100 * 100);
sheet.setColumnWidth(12, 50 * 100);
sheet.setColumnWidth(13, 50 * 100);
sheet.setColumnWidth(14, 50 * 100);
sheet.setColumnWidth(15, 70 * 100);
sheet.setColumnWidth(16, 70 * 100);
sheet.setColumnWidth(17, 50 * 100);
sheet.setColumnWidth(18, 50 * 100);
sheet.setColumnWidth(19, 50 * 100);
// 在sheet中添加表头第0行
HSSFRow row = sheet.createRow(0);
// 创建单元格,并设置表头,设置表头居中
HSSFCellStyle style = workbook.createCellStyle();
// 创建一个居中格式
style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); // 居中
style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
// 带边框
style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
// 生成一个字体
HSSFFont font = workbook.createFont();
// 字体增粗
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
// 字体大小
font.setFontHeightInPoints((short) 12);
// 把字体应用到当前的样式
style.setFont(font);
// 单独设置整列居中或居左
HSSFCellStyle style1 = workbook.createCellStyle();
style1.setAlignment(HSSFCellStyle.ALIGN_CENTER);
HSSFCellStyle style2 = workbook.createCellStyle();
style2.setAlignment(HSSFCellStyle.ALIGN_LEFT);
HSSFCellStyle style3 = workbook.createCellStyle();
style3.setAlignment(HSSFCellStyle.ALIGN_LEFT);
HSSFFont hssfFont = workbook.createFont();
hssfFont.setColor(HSSFFont.COLOR_RED);
hssfFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
style3.setFont(hssfFont);
HSSFCellStyle style4 = workbook.createCellStyle();
style4.setAlignment(HSSFCellStyle.ALIGN_LEFT);
HSSFFont hssfFont1 = workbook.createFont();
hssfFont1.setColor(HSSFFont.COLOR_NORMAL);
hssfFont1.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
style4.setFont(hssfFont1);
HSSFCell cell;
cell = row.createCell(0);
cell.setCellValue("项目名称");
cell.setCellStyle(style);
cell = row.createCell(1);
cell.setCellValue("项目区域");
cell.setCellStyle(style);
cell = row.createCell(2);
cell.setCellValue("项目面积(万平米)");
cell.setCellStyle(style);
cell = row.createCell(3);
cell.setCellValue("项目类型");
cell.setCellStyle(style);
cell = row.createCell(4);
cell.setCellValue("托管日期");
cell.setCellStyle(style);
cell = row.createCell(5);
cell.setCellValue("合同到期");
cell.setCellStyle(style);
cell = row.createCell(6);
cell.setCellValue("合同期限");
cell.setCellStyle(style);
cell = row.createCell(7);
cell.setCellValue("物业平米收费(元/㎡)");
cell.setCellStyle(style);
cell = row.createCell(8);
cell.setCellValue("收费面积(㎡)");
cell.setCellStyle(style);
cell = row.createCell(9);
cell.setCellValue("项目地址");
cell.setCellStyle(style);
cell = row.createCell(10);
cell.setCellValue("签约客户");
cell.setCellStyle(style);
cell = row.createCell(11);
cell.setCellValue("项目简介");
cell.setCellStyle(style);
// cell = row.createCell(12);
// cell.setCellValue("能源费定价(元/㎡)");
// cell.setCellStyle(style);
cell = row.createCell(12);
cell.setCellValue("设计热负荷(kW)");
cell.setCellStyle(style);
cell = row.createCell(13);
cell.setCellValue("设计冷负荷(kW)");
cell.setCellStyle(style);
cell = row.createCell(14);
cell.setCellValue("主机形式");
cell.setCellStyle(style);
cell = row.createCell(15);
cell.setCellValue("设计单位热负荷(kW/m2)");
cell.setCellStyle(style);
cell = row.createCell(16);
cell.setCellValue("设计单位冷负荷(kW/m2)");
cell.setCellStyle(style);
cell = row.createCell(17);
cell.setCellValue("电价(元/kW·h)");
cell.setCellStyle(style);
cell = row.createCell(18);
cell.setCellValue("水价(元/吨)");
cell.setCellStyle(style);
cell = row.createCell(19);
cell.setCellValue("气价(元/Nm³)");
cell.setCellStyle(style);
for (int i = 0; i < selectqueryList.size(); i++) {
row = sheet.createRow(i + 1);
powerProject powerproject = selectqueryList.get(i);
// 创建单元格,并设置值
// 编号列居左
HSSFCell c1 = row.createCell(0);
c1.setCellStyle(style1);
String projectName = powerproject.getProjectName();
if(projectName != "" || projectName != null) {
c1.setCellValue(projectName); //项目名称
}else {
c1.setCellValue(""); //项目名称
}
HSSFCell c2 = row.createCell(1);
c2.setCellStyle(style1);
String proName = powerproject.getProName();
if(proName != "" || proName != null) {
c2.setCellValue(proName); //项目区域
}else {
c2.setCellValue(""); //项目区域
}
HSSFCell c3 = row.createCell(2);
c3.setCellStyle(style1);
Double projectArea = powerproject.getProjectArea();
if(projectArea != 0 || projectArea != null) {
c3.setCellValue(projectArea); //项目面积(万平米)
}else {
c3.setCellValue(""); //项目面积(万平米)
}
HSSFCell c4 = row.createCell(3);
c4.setCellStyle(style1);
String conditionerArea = powerproject.getConditionerArea();
if(conditionerArea != "" || conditionerArea != null) {
c4.setCellValue(conditionerArea); //项目类型
}else {
c4.setCellValue(""); //项目类型
}
HSSFCell c5 = row.createCell(4);
c5.setCellStyle(style1);
String trusteeshipTime = powerproject.getTrusteeshipTime();
if(trusteeshipTime != "" || trusteeshipTime != null) {
c5.setCellValue(trusteeshipTime); //托管日期
}else {
c5.setCellValue(""); //托管日期
}
HSSFCell c6 = row.createCell(5);
c6.setCellStyle(style1);
String expireTime = powerproject.getExpireTime();
if(expireTime != "" || expireTime != null) {
c6.setCellValue(expireTime); //合同到期
}else {
c6.setCellValue(""); //合同到期
}
HSSFCell c7 = row.createCell(6);
c7.setCellStyle(style1);
String contractLife = powerproject.getContractLife();
if(contractLife != "" || contractLife != null) {
c7.setCellValue(contractLife); //合同期限
}else {
c7.setCellValue(""); //合同期限
}
HSSFCell c8 = row.createCell(7);
c8.setCellStyle(style1);
Double energyPrice = powerproject.getEnergyPrice();
if(energyPrice != 0 || energyPrice != null) {
c8.setCellValue(energyPrice); //物业平米收费(元/㎡)
}else {
c8.setCellValue(""); //物业平米收费(元/㎡)
}
HSSFCell c9 = row.createCell(8);
c9.setCellStyle(style1);
Double chargingArea = powerproject.getChargingArea();
if(chargingArea != 0 || chargingArea != null) {
c9.setCellValue(chargingArea); //收费面积(㎡)
}else {
c9.setCellValue(""); //收费面积(㎡)
}
HSSFCell c10 = row.createCell(9);
c10.setCellStyle(style1);
String projectAddress = powerproject.getProjectAddress();
if(projectAddress != "" || projectAddress != null) {
c10.setCellValue(projectAddress); //项目地址
}else {
c10.setCellValue(""); //项目地址
}
HSSFCell c11 = row.createCell(10);
c11.setCellStyle(style1);
String contractCustomer = powerproject.getContractCustomer();
if(contractCustomer != "" || contractCustomer != null) {
c11.setCellValue(contractCustomer); //签约客户
}else {
c11.setCellValue(""); //签约客户
}
HSSFCell c12 = row.createCell(11);
c12.setCellStyle(style1);
String projectIntroduce = powerproject.getProjectIntroduce();
if(projectIntroduce != "" || projectIntroduce != null) {
c12.setCellValue(projectIntroduce); //项目简介
}else {
c12.setCellValue(""); //项目简介
}
HSSFCell c13 = row.createCell(12);
c13.setCellStyle(style1);
Double designHeatingLoad = powerproject.getDesignHeatingLoad();
if(designHeatingLoad != 0 || designHeatingLoad != null) {
c13.setCellValue(designHeatingLoad); //设计热负荷(kW)
}else {
c13.setCellValue(""); //设计热负荷(kW)
}
HSSFCell c14 = row.createCell(13);
c14.setCellStyle(style1);
Double designCoolingLoad = powerproject.getDesignCoolingLoad();
if(designCoolingLoad != 0 || designCoolingLoad != null) {
c14.setCellValue(designCoolingLoad); //设计冷负荷(kW)
}else {
c14.setCellValue(""); //设计冷负荷(kW)
}
HSSFCell c15 = row.createCell(14);
c15.setCellStyle(style1);
String hostOnly = powerproject.getHostOnly();
if(hostOnly != "" || hostOnly != null) {
c15.setCellValue(hostOnly); //主机形式
}else {
c15.setCellValue(""); //主机形式
}
HSSFCell c16 = row.createCell(15);
c16.setCellStyle(style1);
Double companyHeatingLoad = powerproject.getCompanyHeatingLoad();
if(companyHeatingLoad != 0 || companyHeatingLoad != null) {
c16.setCellValue(companyHeatingLoad); //设计单位热负荷(kW/m2)
}else {
c16.setCellValue(""); //设计单位热负荷(kW/m2)
}
HSSFCell c17 = row.createCell(16);
c17.setCellStyle(style1);
Double companyCoolingLoad = powerproject.getCompanyCoolingLoad();
if(companyCoolingLoad != 0 || companyCoolingLoad != null) {
c17.setCellValue(companyCoolingLoad); //设计单位冷负荷(kW/m2)
}else {
c17.setCellValue(""); //设计单位冷负荷(kW/m2)
}
HSSFCell c18 = row.createCell(17);
c18.setCellStyle(style1);
Double electricPrice = powerproject.getElectricPrice();
if(electricPrice != 0 || electricPrice != null) {
c18.setCellValue(electricPrice); //电价(元/kW·h)
}else {
c18.setCellValue(""); //电价(元/kW·h)
}
HSSFCell c19 = row.createCell(18);
c19.setCellStyle(style1);
Double waterPrice = powerproject.getWaterPrice();
if(waterPrice != 0 || waterPrice != null) {
c19.setCellValue(waterPrice); //水价(元/吨)
}else {
c19.setCellValue(""); //水价(元/吨)
}
HSSFCell c20 = row.createCell(19);
c20.setCellStyle(style1);
Double gasPrice = powerproject.getGasPrice();
if(gasPrice != 0 || gasPrice != null) {
c20.setCellValue(gasPrice); //气价(元/Nm3)
}else {
c20.setCellValue(""); //气价(元/Nm3)
}
}
return workbook;
}
}
| [
"hexiangfeng@hexiangengdembp"
] | hexiangfeng@hexiangengdembp |
da337ac143307481f77da7509b4c7e8ea72b5c95 | 8988c577894030296d935c0ec4398d41430e86dd | /SelectionCommitte/src/com/training/model/entity/document/Document.java | 1b00dc2010c3955744c15f6b282c099ebfbf35b4 | [] | no_license | Zhuchkov/Training | a52e768ea1569c73ff442d681ae6cb6635d8e007 | 3033160d8dca63459f6bc70889a2edaf2299d4cc | refs/heads/master | 2021-01-19T20:27:30.509871 | 2017-05-26T09:43:59 | 2017-05-26T09:43:59 | 88,509,157 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 297 | java | package com.training.model.entity.document;
public class Document {
private final DocumentType type;
Document(DocumentType type) {
this.type = type;
}
public DocumentType getType(){
return type;
}
@Override
public String toString() {
return "Document [type=" + type + "]";
}
} | [
"Zhuchkov.vlad@gmail.com"
] | Zhuchkov.vlad@gmail.com |
c97c902e1166b7a3d359d3ddaad6d0ef8f1ec10c | b6e8584716ffabdd7c4a1d23343567d757778257 | /src/main/java/com/takeaway/service/myCenter/impl/MyCenterServiceImpl.java | f69087684c7ec951d5c92e02bd084b1a57676712 | [] | no_license | ShinobuChyan/Take-away | e1f80edc9c18327bad9f9677db3f8078e7a6cc52 | 7846146149e8387e7eac6bda2813eb19d5d4902f | refs/heads/master | 2021-01-19T15:09:29.735175 | 2017-05-30T13:10:02 | 2017-05-30T13:10:02 | 88,200,873 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,805 | java | package com.takeaway.service.myCenter.impl;
import com.takeaway.model.order.Order;
import com.takeaway.model.page.PageResponse;
import com.takeaway.model.response.CommonResponse;
import com.takeaway.model.user.Address;
import com.takeaway.model.user.User;
import com.takeaway.repository.order.OrderRepo;
import com.takeaway.repository.user.AddressRepo;
import com.takeaway.repository.user.UserRepo;
import com.takeaway.service.myCenter.MyCenterService;
import com.takeaway.service.page.PageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpSession;
import java.util.Date;
@Service
public class MyCenterServiceImpl implements MyCenterService {
private final UserRepo userRepo;
private final PageService pageService;
private final AddressRepo addressRepo;
private final OrderRepo orderRepo;
private final HttpSession session;
@Autowired
public MyCenterServiceImpl(UserRepo userRepo, PageService pageService, AddressRepo addressRepo, OrderRepo orderRepo, HttpSession session) {
this.userRepo = userRepo;
this.pageService = pageService;
this.addressRepo = addressRepo;
this.orderRepo = orderRepo;
this.session = session;
}
@Override
public CommonResponse changePwd(User user, String oldPwd, String newPwd) {
if (user == null || oldPwd == null || newPwd == null)
return new CommonResponse("1", "密码为空");
if (!oldPwd.equals(user.getPassword()))
return new CommonResponse("1", "原密码错误");
if (oldPwd.equals(newPwd))
return new CommonResponse("1", "新密码与原密码相同");
user.setPassword(newPwd);
userRepo.save(user);
return new CommonResponse("0", "更改密码成功");
}
@Override
public PageResponse getOrderList(User user, Integer page) {
return pageService.orderList(page, user.getId());
}
@Override
public CommonResponse cancleOrder(Long id) {
Order order = orderRepo.findById(id);
if (order.getState() == 0)
return new CommonResponse("1", "订单已被配送,无法取消");
if (new Date().getTime() - order.getCreateTime().getTime() > 1800000)
return new CommonResponse("1", "订单建立超过三十分钟,无法取消");
orderRepo.delete(id);
return new CommonResponse("0", "订单取消成功");
}
@Override
public CommonResponse saveAddressChanges(Address address) {
User user = (User) session.getAttribute("userInfo");
address.setUserId(user.getId());
addressRepo.save(address);
return new CommonResponse("0", "修改地址成功");
}
}
| [
"18951853959@163.com"
] | 18951853959@163.com |
c2c7095394224713152d1e36c02c822da6509d1d | 8c2cbe89c8dcf90405753850843d7e1ed9fb7bd8 | /src/main/java/br/com/posts/controllers/PostController.java | 0d8d069db3b6c3b4ed36e34a586b765190f2f7e4 | [] | no_license | Gustavo-Akira/posts_back | 6f1dc7e6c1fa7857375ba5f440bca28ac6a38725 | a4beff6a497c302da3b3a11fbb37fce12ffdb7a4 | refs/heads/master | 2022-12-03T03:39:48.209210 | 2020-08-19T17:21:03 | 2020-08-19T17:21:03 | 287,834,363 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,404 | java | package br.com.posts.controllers;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.servlet.ServletContext;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import br.com.posts.controllers.helpers.Helper;
import br.com.posts.models.Posts;
import br.com.posts.models.User;
import br.com.posts.repositories.PostsRepository;
import br.com.posts.repositories.UsersRepository;
@RestController
@RequestMapping("/posts")
public class PostController {
@Autowired
private UsersRepository userRepository;
@Autowired
private PostsRepository repository;
@Autowired
private ServletContext servletContext;
@Autowired
private Helper helper;
@GetMapping("/")
public ResponseEntity<Page<Posts>> getAll() {
PageRequest pages = PageRequest.of(0, 5);
Page<Posts> posts = repository.findAll(pages);
return ResponseEntity.ok(posts);
}
@GetMapping("/{id}")
public ResponseEntity<Posts> getOne(@PathVariable("id") long id) {
Posts post = repository.findById(id).get();
return ResponseEntity.ok(post);
}
@PostMapping("/")
public ResponseEntity<Posts> save(@ModelAttribute Posts post,MultipartFile file) throws Exception{
User user = helper.getUserActive();
post.setUser(user);
if (file != null && !file.isEmpty()) {
String path = servletContext.getContextPath() + "resources/images/posts/" + file.getOriginalFilename();
Helper.saveFile(path, file);
post.setUrl(path);
}else {
throw new IOException("");
}
post = repository.save(post);
return ResponseEntity.ok(post);
}
@PutMapping("/{id}")
public ResponseEntity<Posts> change(@RequestBody Posts post, @PathVariable("id") long id) {
User user = helper.getUserActive();
Posts old = repository.findById(id).get();
if (user != old.getUser()) {
return ResponseEntity.status(401).body(post);
}
post.setId(id);
repository.save(post);
return ResponseEntity.ok(post);
}
@DeleteMapping("/{id}")
public ResponseEntity<String> delete(@PathVariable("id") long id) {
User user = helper.getUserActive();
Posts post = repository.getOne(id);
if (post == null) {
return ResponseEntity.ok("Dont have a post wiht that id");
}
if (user != post.getUser()) {
return ResponseEntity.status(401).body("You dont have authorization to delete this post");
}
return ResponseEntity.ok("Post removed com success");
}
}
| [
"akirauekita2002@gmail.com"
] | akirauekita2002@gmail.com |
e28654ba2c8d249aab706e97a687c15c4fb76a93 | a52434e65a98cf65198520614bbd4b2146736495 | /inventory_backend/src/main/java/com/personiv/service/CustomUserDetailsService.java | de66afb96c6476208e47761ddc41036b0ded8782 | [] | no_license | it-ph/inventory | f0d2dffc3afb473040c6b6742e321b133dc62dd5 | 946868866c130db7f636453e0cad52363f4234da | refs/heads/master | 2020-04-07T00:49:42.774633 | 2018-11-16T21:04:38 | 2018-11-16T21:04:38 | 157,920,301 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,226 | java | package com.personiv.service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import com.personiv.dao.UserDao;
import com.personiv.model.User;
import com.personiv.model.UserDetailsImpl;
@Service
public class CustomUserDetailsService implements UserDetailsService{
private static final Logger logger = LoggerFactory.getLogger(CustomUserDetailsService.class);
@Autowired
private UserDao userDao;
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
//User user = userService.getUserByUsername(username);
User user = userDao.getUserByUsername(username);
UserDetails userDetails = null;
if (user == null) {
logger.debug("user not found with the provided username");
return null;
}else {
userDetails = new UserDetailsImpl(user);
}
return userDetails;
}
}
| [
"it.ph@personiv.com"
] | it.ph@personiv.com |
4edb852923d48e5e5fda5744084d8f05b0be5d32 | 0f1aed768f2b0617000d30c7ef34bed0018ce34a | /src/main/java/unimelb/bitbox/Peer.java | edeefe90288776c5147570a1793536c102ae66a5 | [] | no_license | zhyi0128/BitBox | d1bfaa8fec1dfc1b4b245086e1c59fdbf06d1598 | aca61fb601cf2c9e02684338fd693468e14500e1 | refs/heads/master | 2022-04-04T23:53:00.166448 | 2020-02-19T13:08:38 | 2020-02-19T13:08:38 | 241,169,085 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,184 | java | package unimelb.bitbox;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.util.logging.Logger;
import unimelb.bitbox.util.Configuration;
/**
* A peer class which contains the main method. The entrance of the program. Handles the starting process of the server
* and its services.
* To use it, choose main as the Main class and run directly.
*
* @author Zhe Wang
* @version 1.1
*/
public class Peer {
static Logger log = Logger.getLogger(Peer.class.getName());
public static void main(String[] args) throws IOException, NumberFormatException, NoSuchAlgorithmException {
System.setProperty("java.util.logging.SimpleFormatter.format",
"[%1$tc] %2$s %4$s: %5$s%n");
log.info("BitBox Peer starting...");
Configuration.getConfiguration();
ServerMain server = ServerMain.getServerMain();
Thread serve_client = new Thread(server.new ServeClient()); //open a new thread to serve the client
serve_client.start();
//server.tcpInitialConnect();
Thread sync_event = server.new TCPSyncEvent();
sync_event.start();
server.tcpListen();
}
} | [
"zhyi0128@126.com"
] | zhyi0128@126.com |
91bfa515e4b5f49276a67286e74d6bbc3eee6b0f | d67ae24f3b8ce988240d6c1a1f56e38c9a095a8c | /sp5-chap14/src/main/java/controller/ChangePwdController.java | d59c8cf7e81092a4c0ec0bc000e95b90d69453d9 | [] | no_license | saoov/TIL_spring | 25d5d543ba32ba643066978f4ef365c4777419e4 | bdc51d3d6e0bdade8e753688316edd0ea3e73e68 | refs/heads/master | 2023-03-08T00:40:55.646719 | 2021-02-20T14:54:39 | 2021-02-20T14:54:39 | 331,932,995 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,524 | java | package controller;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import spring.AuthInfo;
import spring.ChangePasswordService;
import spring.WrongIdPasswordException;
@Controller
@RequestMapping("/edit/changePassword")
public class ChangePwdController {
private ChangePasswordService changePasswordService;
public void setChangePasswordService(ChangePasswordService changePasswordService) {
this.changePasswordService = changePasswordService;
}
@GetMapping
public String form(@ModelAttribute("command") ChangePwdCommand pwdCmd) {
return "edit/changePwdForm";
}
@PostMapping
public String submit(@ModelAttribute("command") ChangePwdCommand pwdCmd, Errors errors, HttpSession session) {
new ChangePwdCommandValidator().validate(pwdCmd, errors);
if(errors.hasErrors()) {
return "edit/changePwdForm";
}
AuthInfo authInfo = (AuthInfo) session.getAttribute("authInfo");
try {
changePasswordService.changePassword(authInfo.getEmail(), pwdCmd.getCurrentPassword(), pwdCmd.getNewPassword());
return "edit/changedPwd";
} catch (WrongIdPasswordException e) {
errors.rejectValue("currentPassword", "notMatching");
return "edit/changePwdForm";
}
}
}
| [
"saoov0927@naver.com"
] | saoov0927@naver.com |
0ce722919b21e6dbffe8e2675332785bc1629b45 | 7a627e357fc6a980b64c5b5f64f0c6c3a0b24502 | /ImageScaling/IteratedFilter.java | 1e35d85a4d3f92c5d7c3483c219ef44984568a04 | [] | no_license | thebigG/Journal | 78e6599ce4ee1ea23763943ff746cbcba8b1ca7a | 055a0ef3e248402887b87a5ce78069002aac3bd2 | refs/heads/master | 2021-01-01T05:10:49.961566 | 2019-01-19T13:52:52 | 2019-01-19T13:52:52 | 59,579,323 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,280 | java | /*
Copyright 2006 Jerry Huxtable
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 ImageScaling;
import java.awt.image.*;
/**
* A BufferedImageOp which iterates another BufferedImageOp.
*/
public class IteratedFilter extends AbstractBufferedImageOp {
private BufferedImageOp filter;
private int iterations;
/**
* Construct an IteratedFilter.
* @param filter the filetr to iterate
* @param iterations the number of iterations
*/
public IteratedFilter( BufferedImageOp filter, int iterations ) {
this.filter = filter;
this.iterations = iterations;
}
public BufferedImage filter( BufferedImage src, BufferedImage dst ) {
BufferedImage image = src;
for ( int i = 0; i < iterations; i++ )
image = filter.filter( image, dst );
return image;
}
}
| [
"yunior.eury@gmail.com"
] | yunior.eury@gmail.com |
c6e1a811c9701f2ea1f8da324bbabd1275cfffb4 | ed03478dc06eb8fea7c98c03392786cd04034b82 | /src/com/era/community/wiki/ui/dto/WikiDto.java | 783e154449e0fd71843fe6ac8dd96cff045de005 | [] | no_license | sumit-kul/cera | 264351934be8f274be9ed95460ca01fa9fc23eed | 34343e2f5349bab8f5f78b9edf18f2e0319f62d5 | refs/heads/master | 2020-12-25T05:17:19.207603 | 2016-09-04T00:02:31 | 2016-09-04T00:02:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 122 | java | package com.era.community.wiki.ui.dto;
public class WikiDto extends com.era.community.wiki.dao.generated.WikiEntity
{
} | [
"sumitkul2005@gmail.com"
] | sumitkul2005@gmail.com |
b20b720d84c61f2f7dfcefddd1558c92af4a99ef | 5ea3463bd6c5c0fe2e6872aa80789a97ef4164f7 | /src/main/java/exceptions/DuplicateEntryException.java | fac0c6edc16f81baacd572e9ee419abeac343a0e | [] | no_license | IskanderValiev/wc_proj_hibernate_and_jpa | 8a01cfbdeaf36310799e891796fd75f42c15bbf8 | 4ede2f021f948b593c918181634684f7c7efe68d | refs/heads/master | 2021-08-15T20:04:28.767505 | 2017-11-18T06:51:08 | 2017-11-18T06:51:08 | 108,580,404 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 164 | java | package exceptions;
public class DuplicateEntryException extends Exception {
public DuplicateEntryException(String message) {
super(message);
}
}
| [
"iskand.valiev@yandex.ru"
] | iskand.valiev@yandex.ru |
67432f7a601fff629bd908fe41e3851d6e906b84 | 808041d5f91415948a3ee28f7620f3b6b99c16d9 | /tube/src/main/java/org/revo/Service/MediaService.java | 4fc5300214dc0e7b1ebafde614e81e6463334e6b | [] | no_license | ashraf-revo/Revotube | 29d03262230797bd3c0e6b63bb5d7e4669cdd8cd | b9ff257269640fa764f82e4fbf66f2bf12e51483 | refs/heads/master | 2021-03-24T12:32:42.935427 | 2017-11-23T19:05:35 | 2017-11-23T19:05:35 | 109,124,874 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 757 | java | package org.revo.Service;
import org.revo.Domain.Media;
import org.revo.Domain.Status;
import java.io.File;
import java.io.IOException;
import java.util.List;
/**
* Created by ashraf on 15/04/17.
*/
public interface MediaService {
File saveInFileSystem(Media media) throws IOException;
Media saveFile(Media media);
Media save(Media media);
List<Media> findAll(Status status);
List<Media> findAll(Status status, List<String> ids);
Media findOne(String id);
String findOneParsed(String id);
String lastId();
List<Media> findByUser(String id, Status status);
/*
Media publish(Media media, User user);
*/
File convertImage(File video);
Media process(Media media) throws IOException;
}
| [
"ashraf1abdelrasool@gmail.com"
] | ashraf1abdelrasool@gmail.com |
d24c189b44c5391d8d1f3104f5873a6cf90a775d | 2954c9106e4737c80fcf42807cd690194ee03e16 | /security-spring/src/main/java/com/doublev/security/springmvc/model/UserDto.java | 21cbc8c86687898585b05f138ca54acc31dd79f6 | [] | no_license | qiuTowei/Spring-Security | 1304132e0a16d5fafc962c731a1f6f6c0654d2a2 | 5a4dd3cb4d409249170ee204b78db8032aa7c63a | refs/heads/master | 2023-01-11T02:45:57.970652 | 2020-10-30T03:20:37 | 2020-10-30T03:20:37 | 305,243,559 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 870 | java | package com.doublev.security.springmvc.model;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.Set;
/**
* @ Project: security-springmvc
* @ Package: com.doublev.security.springmvc.model
* @ Title 标题(要求能简洁地表达出类的功能和职责)
* @ Description: 描述(简要描述类的职责、实现方式、使用注意事项等)
* @ author : qw
* @ CreateDate: 2020/10/19 14:28
* @ Version: 1.0
* @ Copyright: Copyright (c) 2020
* @ History: 修订历史(历次修订内容、修订人、修订时间等)
*/
@Data
@AllArgsConstructor
public class UserDto {
public static final String SESSION_USER_KEY = "_user";
private String id;
private String username;
private String password;
private String fullName;
private String city;
// 权限集合
private Set<String> authorities;
}
| [
"qiuwei1991@yeah.net"
] | qiuwei1991@yeah.net |
e6c7a2cbc8b91f350cd84e6aa48920033dd49cea | 667b169912840feb29954ca4c24526553aeaa906 | /extension/richfaces/src/main/java/org/jboss/portletbridge/richfaces/application/ApplicationImpl.java | b34cfc0a263893b1a797fe203c94dea4b94d70de | [] | no_license | ppalaga/portletbridge | 8f074bfc46c39c9ad8789a94c82bd38b416e6935 | ef01fa82f46ed4eff91702dcfd54cbcbc4e94621 | refs/heads/master | 2021-01-18T06:36:28.441861 | 2013-04-16T20:10:06 | 2013-04-16T20:10:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,190 | java | /*
* JBoss, Home of Professional Open Source.
* Copyright 2012, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.portletbridge.richfaces.application;
import javax.faces.application.Application;
import javax.faces.application.ApplicationWrapper;
import javax.faces.application.ResourceHandler;
import org.jboss.portletbridge.richfaces.application.resource.OutermostRichFacesPortletResourceHandler;
import org.richfaces.resource.ResourceHandlerImpl;
/**
* @author <a href="http://community.jboss.org/people/kenfinni">Ken Finnigan</a>
*/
public class ApplicationImpl extends ApplicationWrapper {
private Application wrapped;
public ApplicationImpl(Application application) {
wrapped = application;
}
/**
* @see javax.faces.application.ApplicationWrapper#getWrapped()
*/
@Override
public Application getWrapped() {
return wrapped;
}
@Override
public ResourceHandler getResourceHandler() {
ResourceHandler resourceHandler = wrapped.getResourceHandler();
if (null != resourceHandler && resourceHandler instanceof ResourceHandlerImpl) {
resourceHandler = new OutermostRichFacesPortletResourceHandler(resourceHandler);
}
return resourceHandler;
}
}
| [
"ken@kenfinnigan.me"
] | ken@kenfinnigan.me |
8020de91ab09a11adc0313c387d757b71e483862 | e8a157c54b4525e184f0abd8fb7b6448999354f9 | /src/main/java/com/flying/phone_store_demo/repository/OrderMasterRepository.java | 38d2853347d393948088681659d5afb846f9860a | [] | no_license | Flying943/phone_store_demo_springboot | 7ae29480aa2adf06f1793f3680671a5c29ac64b4 | f2f7eae24e3ea52f561396d2a2845f15a3a9ce9b | refs/heads/master | 2023-03-02T05:33:51.505914 | 2021-01-23T21:35:50 | 2021-01-23T21:35:50 | 332,312,680 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 253 | java | package com.flying.phone_store_demo.repository;
import com.flying.phone_store_demo.entity.OrderMaster;
import org.springframework.data.jpa.repository.JpaRepository;
public interface OrderMasterRepository extends JpaRepository<OrderMaster,String> {
}
| [
"zhf793331855@163.com"
] | zhf793331855@163.com |
afada54ced590e1cb995f7341219181d7e4ad159 | 496470f08d404e545753ff83a785269cdcd52660 | /src/ems/idls/alarms/IsAutoClearingHelper.java | d203608883c947c215703617d6114ae446d6e0c6 | [
"Apache-2.0"
] | permissive | shorton3/dashingplatforms | 065bc1fc5b070c0a21c9c5a23b6a41cf7b932b9c | f461c967827b92c8bcf872c365afa64e56871aba | refs/heads/master | 2021-01-20T13:56:04.007176 | 2017-05-14T21:22:03 | 2017-05-14T21:22:03 | 90,538,349 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,525 | java | package ems.idls.alarms;
/**
* ems/idls/alarms/IsAutoClearingHelper.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from alarms.idl
* Tuesday, January 15, 2015 5:02:23 PM CST
*/
/**
* Auto Clearing Indicator (If manual clearing is required)
*/
abstract public class IsAutoClearingHelper
{
private static String _id = "IDL:alarms/IsAutoClearing:1.0";
public static void insert (org.omg.CORBA.Any a, boolean that)
{
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
a.type (type ());
write (out, that);
a.read_value (out.create_input_stream (), type ());
}
public static boolean extract (org.omg.CORBA.Any a)
{
return read (a.create_input_stream ());
}
private static org.omg.CORBA.TypeCode __typeCode = null;
synchronized public static org.omg.CORBA.TypeCode type ()
{
if (__typeCode == null)
{
__typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_boolean);
__typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (ems.idls.alarms.IsAutoClearingHelper.id (), "IsAutoClearing", __typeCode);
}
return __typeCode;
}
public static String id ()
{
return _id;
}
public static boolean read (org.omg.CORBA.portable.InputStream istream)
{
boolean value = false;
value = istream.read_boolean ();
return value;
}
public static void write (org.omg.CORBA.portable.OutputStream ostream, boolean value)
{
ostream.write_boolean (value);
}
}
| [
"shorton3@yahoo.com"
] | shorton3@yahoo.com |
54e6fa8548ddc73bebb96622744f08eaf3b9f443 | c0feb57b8d60f787ced8b7f16cd8e0e311a2175e | /app/src/main/java/com/blm/comparepoint/interfacer/UpdateRedAmountInterfacer.java | ac21305a72c657a70af947af7550fbfcc80260d1 | [] | no_license | WhiteorBlack/ComparePoint | 323b6ddea02373ca8003130558a1c11d2d67ae2b | a3da33c617a8c9ee2239e3d83a711cef92a233c4 | refs/heads/master | 2021-01-14T08:04:00.197726 | 2017-06-13T04:18:57 | 2017-06-13T04:18:57 | 81,910,854 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 180 | java | package com.blm.comparepoint.interfacer;
/**
* Created by Administrator on 2017/5/5.
*/
public interface UpdateRedAmountInterfacer {
void updateRedAmount(int redAmount);
}
| [
"415082375@qq.com"
] | 415082375@qq.com |
bae3f680b8922d4acb9837a0ea9267901fe2c118 | 6c4859a5f37fdb832540ff4c12e462c82441eb67 | /src/dist/edu/umd/cloud9/collection/wikipedia/ExtractWikipediaRedirects.java | abdc1a03d6faa8f4a8d384f72ce6f5066ad9a07b | [] | no_license | atomicjets/Cloud9-forked | 9d052495db7e421d32feeb749484893a8296f08f | f9b9a01225f9f863c16abe897fcdf6ed742e897f | refs/heads/master | 2020-03-30T16:46:45.753047 | 2018-06-01T14:23:15 | 2018-06-01T14:23:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,497 | java | package edu.umd.cloud9.collection.wikipedia;
import org.apache.commons.cli.*;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
import org.apache.log4j.Logger;
import java.io.IOException;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Tool for taking a Wikipedia XML dump file and writing out article titles and ambiguous related titles
* in a flat text file (article title and related titles, separated by tabs; related titles are '\002' separated).
*
* @author Gaurav Ragtah (gaurav.ragtah@lithium.com)
*/
//EXAMPLE REDIRECT PAGE: http://en.wikipedia.org/wiki/Special:Export/Soccer
public class ExtractWikipediaRedirects extends Configured implements Tool {
private static final Logger LOG = Logger.getLogger(ExtractWikipediaRedirects.class);
private static enum PageTypes {
TOTAL, REDIRECT, DISAMBIGUATION, EMPTY, ARTICLE, STUB, OTHER
}
private static class WikiRedirectMapper extends Mapper<LongWritable, WikipediaPage, Text, Text> {
private static final Pattern LANG_LINKS = Pattern.compile("\\[\\[[a-z\\-]+:[^\\]]+\\]\\]");
private static final Pattern REF = Pattern.compile("<ref>.*?</ref>");
private static final Pattern HTML_COMMENT = Pattern.compile("<!--.*?-->", Pattern.DOTALL);
// Sometimes, URLs bump up against comments e.g., <!-- http://foo.com/-->
// So remove comments first, since the URL pattern might capture comment terminators.
private static final Pattern URL = Pattern.compile("http://[^ <]+");
private static final Pattern DOUBLE_CURLY = Pattern.compile("\\{\\{.*?\\}\\}");
private static final Pattern HTML_TAG = Pattern.compile("<[^!][^>]*>");
private static final Pattern NEWLINE = Pattern.compile("[\\r\\n]+");
private static final String SINGLE_SPACE = " ";
private static final Pattern[] patternsToCleanUp = {LANG_LINKS, REF, HTML_COMMENT, URL, DOUBLE_CURLY, HTML_TAG, NEWLINE};
private static final String REDIRECT_TITLE_START_TAG_TEXT = "<redirect title=\"";
private static final String REDIRECT_TITLE_END_TAG_TEXT = "\" />";
// TODO: The XML field for redirect title is fine, but the redirect page identifier might have additional alternatives
// for other languages. Investigate at some point.
// Or maybe just change how redirect pages are identified (boolean): just find the redirect field OR find redirect indicator in text field
private static final Text title = new Text();
private static final Text redirectTitle = new Text();
@Override
public void map(LongWritable key, WikipediaPage p, Context context) throws IOException, InterruptedException {
context.getCounter(PageTypes.TOTAL).increment(1);
if (p.isEmpty()) {
context.getCounter(PageTypes.EMPTY).increment(1);
} else if (p.isRedirect()) {
context.getCounter(PageTypes.REDIRECT).increment(1);
title.set(p.getTitle());
String rawXML = p.getRawXML();
int redirectTitleStart = rawXML.indexOf(REDIRECT_TITLE_START_TAG_TEXT);
int redirectTitleEnd = rawXML.indexOf(REDIRECT_TITLE_END_TAG_TEXT, redirectTitleStart);
if (redirectTitleStart == -1) {
context.getCounter(WikiRedirectMapper.class.getSimpleName(), "NO_REDIRECT_TITLE_START").increment(1);
return;
}
redirectTitle.set(rawXML.substring(redirectTitleStart + 17, redirectTitleEnd).trim());
context.write(title, redirectTitle);
} else if (p.isDisambiguation()) {
context.getCounter(PageTypes.DISAMBIGUATION).increment(1);
} else if (p.isArticle()) {
context.getCounter(PageTypes.ARTICLE).increment(1);
if (p.isStub()) {
context.getCounter(PageTypes.STUB).increment(1);
}
} else {
context.getCounter(PageTypes.OTHER).increment(1);
}
}
}
private static final String INPUT_OPTION = "input";
private static final String OUTPUT_OPTION = "output";
private static final String LANGUAGE_OPTION = "wiki_language";
@SuppressWarnings("static-access")
@Override
public int run(String[] args) throws Exception {
Options options = new Options();
options.addOption(OptionBuilder.withArgName("path").hasArg()
.withDescription("XML dump file").create(INPUT_OPTION));
options.addOption(OptionBuilder.withArgName("path").hasArg()
.withDescription("output path").create(OUTPUT_OPTION));
options.addOption(OptionBuilder.withArgName("en|sv|nl|de|fr|ru|it|es|vi|pl|ja|pt|zh|uk|ca|fa|no|fi|id|ar|sr|ko|hi|zh_yue|cs|tr").hasArg()
.withDescription("two-letter or six-letter language code").create(LANGUAGE_OPTION));
CommandLine cmdline;
CommandLineParser parser = new GnuParser();
try {
cmdline = parser.parse(options, args);
} catch (ParseException exp) {
LOG.error("Error parsing command line: " + exp.getMessage());
return -1;
}
if (!cmdline.hasOption(INPUT_OPTION) || !cmdline.hasOption(OUTPUT_OPTION)) {
HelpFormatter formatter = new HelpFormatter();
formatter.printHelp(this.getClass().getName(), options);
ToolRunner.printGenericCommandUsage(System.out);
return -1;
}
String language = "en"; // Assume "en" by default.
if (cmdline.hasOption(LANGUAGE_OPTION)) {
language = cmdline.getOptionValue(LANGUAGE_OPTION);
if (!(language.length() == 2 || language.length() == 6)) {
LOG.error("Error: \"" + language + "\" unknown language!");
return -1;
}
}
String inputPath = cmdline.getOptionValue(INPUT_OPTION);
String outputPath = cmdline.getOptionValue(OUTPUT_OPTION);
LOG.info("Tool name: " + this.getClass().getName());
LOG.info(" - XML dump file: " + inputPath);
LOG.info(" - output path: " + outputPath);
LOG.info(" - language: " + language);
Job job = Job.getInstance(getConf());
job.setJarByClass(ExtractWikipediaRedirects.class);
job.setJobName(String.format("ExtractWikipediaRedirects[%s: %s, %s: %s, %s: %s]", INPUT_OPTION,
inputPath, OUTPUT_OPTION, outputPath, LANGUAGE_OPTION, language));
job.setNumReduceTasks(0);
FileInputFormat.setInputPaths(job, new Path(inputPath));
FileOutputFormat.setOutputPath(job, new Path(outputPath));
if (language != null) {
job.getConfiguration().set("wiki.language", language);
}
job.setInputFormatClass(WikipediaPageInputFormat.class);
job.setOutputFormatClass(TextOutputFormat.class);
job.setMapperClass(WikiRedirectMapper.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(Text.class);
// Delete the output directory if it exists already.
FileSystem.get(getConf()).delete(new Path(outputPath), true);
job.waitForCompletion(true);
return 0;
}
public ExtractWikipediaRedirects() {
}
public static void main(String[] args) throws Exception {
ToolRunner.run(new ExtractWikipediaRedirects(), args);
}
}
| [
"spideyunlimited@gmail.com"
] | spideyunlimited@gmail.com |
70515b26ec706684f62be5d8e49b40c031b43414 | 6d2e855e3db017f50c0c6f05bf874484c4d165b8 | /Matrix/JaggedArray.java | c25a6df0cf15d5381f4292975164113f538f2791 | [] | no_license | kumaratul60/Data-Structures-and-Algorithms | 7c74bf91d10254221afae51d1daaf65242763f05 | b98c43e45700bda6670a7037b06e48126e4705b6 | refs/heads/main | 2023-04-13T07:39:18.568455 | 2021-04-20T08:51:17 | 2021-04-20T08:51:17 | 357,965,592 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 407 | java | package Matrix;
public class JaggedArray {
// jagged array if all the rows are of not same size
public static void main(String[] args) {
int m = 5;
int arr[][] = new int[m][];
for (int i = 0; i < arr.length; i++) {
arr[i] = new int[i + 1];
for (int j = 0; j < arr[i].length; j++) {
arr[i][j] = i;
System.out.print(arr[i][j] + " ");
}
System.out.println();
}
}
}
| [
"atulreso1@gmail.com"
] | atulreso1@gmail.com |
3da100f9f585ecd0c3bea87405244ff6d7b6190a | 53d677a55e4ece8883526738f1c9d00fa6560ff7 | /com/tencent/mm/model/bv$18.java | 45ca5e87251b1329bc183635be601aa5ad2c0927 | [] | no_license | 0jinxing/wechat-apk-source | 544c2d79bfc10261eb36389c1edfdf553d8f312a | f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d | refs/heads/master | 2020-06-07T20:06:03.580028 | 2019-06-21T09:17:26 | 2019-06-21T09:17:26 | 193,069,132 | 9 | 4 | null | null | null | null | UTF-8 | Java | false | false | 899 | java | package com.tencent.mm.model;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.sdk.platformtools.bo;
final class bv$18 extends bv.a
{
bv$18(bv parambv)
{
super(parambv, (byte)0);
}
public final boolean a(bt parambt)
{
boolean bool = false;
AppMethodBeat.i(72636);
if ((System.currentTimeMillis() - parambt.eRt > 3600000L) && (bo.getInt(parambt.fns, 0) > 0))
{
bv.s(parambt.key, parambt.fns);
parambt.fns = "0";
parambt.eRt = System.currentTimeMillis();
bool = true;
AppMethodBeat.o(72636);
}
while (true)
{
return bool;
AppMethodBeat.o(72636);
}
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes8-dex2jar.jar
* Qualified Name: com.tencent.mm.model.bv.18
* JD-Core Version: 0.6.2
*/ | [
"172601673@qq.com"
] | 172601673@qq.com |
8977018e6d928d86c746ecf590bd527572f570ab | 22c54696ff9a69ccb0f19b7267112fd4c4f3b73d | /BSM_Total0326/src/main/java/com/mrhi/bsm/model/keyword/KeywordService.java | 1786764c926e431befaac3e6a231164b0b22bfd3 | [] | no_license | jrojb00/BSM | d1b7362cdc42f76d9b493ffc25eacbb8284cbb74 | 8821565038352eaa54ac830ce3e9d3a85a865ab7 | refs/heads/master | 2020-03-08T12:59:01.027086 | 2018-04-05T01:41:46 | 2018-04-05T01:41:46 | 128,145,304 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 700 | java | package com.mrhi.bsm.model.keyword;
import java.util.List;
import com.mrhi.bsm.model.item.ItemPageVO;
import com.mrhi.bsm.model.item.ItemVO;
public interface KeywordService {
//DB에 겹치지 않는 키워드를 새로 등록하고 같은 것은 매핑 연결만
public void addKeywordList(ItemVO vo);
//키워드와 관련된 ItemVO 검색
public List<ItemVO> searchKeyword(KeywordVO keyword);
//인기 검색어 리스트
public List<KeywordVO> hitKeyword();
//상품 삭제할때 키워드 맵핑 동시 삭제
public void deleteKeywordMapping(ItemVO vo);
public ItemPageVO getSearchItemPage(KeywordVO vo);
public ItemPageVO next();
public ItemPageVO prev();
}
| [
"PC7-11@PC7-11"
] | PC7-11@PC7-11 |
06eb83da074a0006703e2acc411c58c8e896ba95 | e9affefd4e89b3c7e2064fee8833d7838c0e0abc | /aws-java-sdk-proton/src/main/java/com/amazonaws/services/proton/model/transform/UpdateEnvironmentAccountConnectionResultJsonUnmarshaller.java | 98f5d45a2c20230bfbadfd75d9685885744a591b | [
"Apache-2.0"
] | permissive | aws/aws-sdk-java | 2c6199b12b47345b5d3c50e425dabba56e279190 | bab987ab604575f41a76864f755f49386e3264b4 | refs/heads/master | 2023-08-29T10:49:07.379135 | 2023-08-28T21:05:55 | 2023-08-28T21:05:55 | 574,877 | 3,695 | 3,092 | Apache-2.0 | 2023-09-13T23:35:28 | 2010-03-22T23:34:58 | null | UTF-8 | Java | false | false | 3,168 | java | /*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.proton.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.proton.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* UpdateEnvironmentAccountConnectionResult JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UpdateEnvironmentAccountConnectionResultJsonUnmarshaller implements
Unmarshaller<UpdateEnvironmentAccountConnectionResult, JsonUnmarshallerContext> {
public UpdateEnvironmentAccountConnectionResult unmarshall(JsonUnmarshallerContext context) throws Exception {
UpdateEnvironmentAccountConnectionResult updateEnvironmentAccountConnectionResult = new UpdateEnvironmentAccountConnectionResult();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return updateEnvironmentAccountConnectionResult;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("environmentAccountConnection", targetDepth)) {
context.nextToken();
updateEnvironmentAccountConnectionResult.setEnvironmentAccountConnection(EnvironmentAccountConnectionJsonUnmarshaller.getInstance()
.unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return updateEnvironmentAccountConnectionResult;
}
private static UpdateEnvironmentAccountConnectionResultJsonUnmarshaller instance;
public static UpdateEnvironmentAccountConnectionResultJsonUnmarshaller getInstance() {
if (instance == null)
instance = new UpdateEnvironmentAccountConnectionResultJsonUnmarshaller();
return instance;
}
}
| [
""
] | |
0f058c9830f37cdf20fecab9676d77fa59330b50 | 2f7b585bc87c88e46747c969f49b86706e05cfa6 | /iefas-ws/src/main/java/hk/oro/iefas/ws/casemgt/repository/assembler/CaseDTOAssembler.java | 80257fe1a3a2c058a4789c9e03b8b4b3f2a0f0c4 | [] | no_license | peterso05168/oro | 3fd5ee3e86838215b02b73e8c5a536ba2bb7c525 | 6ca20e6dc77d4716df29873c110eb68abbacbdbd | refs/heads/master | 2020-03-21T17:10:58.381531 | 2018-06-27T02:19:08 | 2018-06-27T02:19:08 | 138,818,244 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,368 | java | package hk.oro.iefas.ws.casemgt.repository.assembler;
import java.util.ArrayList;
import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import hk.oro.iefas.core.util.BusinessUtils;
import hk.oro.iefas.core.util.CommonUtils;
import hk.oro.iefas.core.util.DataUtils;
import hk.oro.iefas.domain.casemgt.dto.CaseDTO;
import hk.oro.iefas.domain.casemgt.dto.SearchCaseDetailResultDTO;
import hk.oro.iefas.domain.casemgt.entity.Case;
/**
* @version $Revision: 3208 $ $Date: 2018-06-20 10:50:21 +0800 (週三, 20 六月 2018) $
* @author $Author: dante.fang $
*/
public class CaseDTOAssembler {
public static Page<SearchCaseDetailResultDTO> toResultDTO(Page<Case> page) {
List<Case> content = page.getContent();
List<SearchCaseDetailResultDTO> dtoList = new ArrayList<>();
if (CommonUtils.isNotEmpty(content)) {
content.stream().forEach(item -> {
SearchCaseDetailResultDTO dto = new SearchCaseDetailResultDTO();
dto.setCaseId(item.getCaseId());
dto.setCaseName(item.getCaseName());
dto.setCaseNo(BusinessUtils.addZeroToCaseNo(item.getCaseNo()));
dto.setCaseTypeCode(item.getCaseType().getCaseTypeCode());
dto.setCaseTypeDesc(item.getCaseType().getCaseTypeDesc());
dto.setCaseYear(String.valueOf(item.getCaseYear()));
dto.setCaseNumber(item.getWholeCaseNo());
dto.setOutsiderName(item.getOutsider() != null ? item.getOutsider().getOutsiderName() : null);
dto.setOutsiderTypeName(
item.getOutsider() != null ? item.getOutsider().getOutsiderType().getOutsiderTypeDesc() : null);
dto.setHandlingOfficerPostTitle(item.getPost().getPostTitle());
dto.setStatus(item.getStatus());
dtoList.add(dto);
});
}
return new PageImpl<>(dtoList, new PageRequest(page.getNumber(), page.getSize(), page.getSort()),
page.getTotalElements());
}
public static CaseDTO toDTO(Case caseInfo) {
CaseDTO dto = null;
if (caseInfo != null) {
dto = DataUtils.copyProperties(caseInfo, CaseDTO.class);
}
return dto;
}
}
| [
"peterso05168@gmail.com"
] | peterso05168@gmail.com |
1622c45f6bdda8186a2931bfcfdb99a344d208ff | e6cb9525dbfa760086e715e4926f0f0e41e72ad4 | /qyds-dao/src/main/java/net/dlyt/qyds/dao/GdsDetailMapper.java | 0d70e21d713cbc3d372dbd3f0f00cd273505348f | [] | no_license | 422517423/QYDS | 97fbd76d05ef47d23468a173972e734e82768817 | bcee5294c0554a2c35d11ea15663cba978b84016 | refs/heads/master | 2021-10-08T10:10:31.652107 | 2018-12-11T02:03:31 | 2018-12-11T02:03:31 | 113,963,190 | 0 | 3 | null | 2018-01-04T12:44:58 | 2017-12-12T08:22:33 | JavaScript | UTF-8 | Java | false | false | 447 | java | package net.dlyt.qyds.dao;
import net.dlyt.qyds.common.dto.GdsDetail;
import org.springframework.stereotype.Repository;
@Repository
public interface GdsDetailMapper {
int deleteByPrimaryKey(String goodsId);
int insert(GdsDetail record);
int insertSelective(GdsDetail record);
GdsDetail selectByPrimaryKey(String goodsId);
int updateByPrimaryKeySelective(GdsDetail record);
int updateByPrimaryKey(GdsDetail record);
} | [
"422517423@qq.com"
] | 422517423@qq.com |
6439532e67d3b86c38cf4a8929a17303bb21dc6f | d3b1774612f0dfb8204523bead9d6d20d4f1ab28 | /src/main/java/com/xgsxd/blog/bean/Message.java | b9d299334afdda4c5696a569f954b068ab25ecdb | [] | no_license | wuweiguang123/springboot-vue-blog | ac35f9b973ce92d4d7dbe2d36e4048e114fb76ea | 34c278e09a05a602d9461061936d57d2719a704c | refs/heads/master | 2023-04-30T03:32:53.296491 | 2019-06-12T06:43:44 | 2019-06-12T06:43:44 | 191,513,089 | 2 | 1 | null | 2023-04-14T17:39:56 | 2019-06-12T06:42:18 | Java | UTF-8 | Java | false | false | 1,650 | java | package com.xgsxd.blog.bean;
import java.util.Date;
public class Message {
private Integer messageId;
private String messageName;
private String messageEmail;
private Date messageTime;
private String messageMark;
private String messageContent;
private String readMark;
public Integer getMessageId() {
return messageId;
}
public void setMessageId(Integer messageId) {
this.messageId = messageId;
}
public String getMessageName() {
return messageName;
}
public void setMessageName(String messageName) {
this.messageName = messageName == null ? null : messageName.trim();
}
public String getMessageEmail() {
return messageEmail;
}
public void setMessageEmail(String messageEmail) {
this.messageEmail = messageEmail == null ? null : messageEmail.trim();
}
public Date getMessageTime() {
return messageTime;
}
public void setMessageTime(Date messageTime) {
this.messageTime = messageTime;
}
public String getMessageMark() {
return messageMark;
}
public void setMessageMark(String messageMark) {
this.messageMark = messageMark == null ? null : messageMark.trim();
}
public String getMessageContent() {
return messageContent;
}
public void setMessageContent(String messageContent) {
this.messageContent = messageContent == null ? null : messageContent.trim();
}
public String getReadMark() {
return readMark;
}
public void setReadMark(String readMark) {
this.readMark = readMark;
}
} | [
"lr1997rrrrr@163.com"
] | lr1997rrrrr@163.com |
176db089defbe71dd013e702e79cf2ea70e68f40 | 00f894937b511382b61744c95a2bb161314ea40a | /src/main/java/org/space/hulu/io/DiskSizeComputer.java | 55f7ce0d1fc5fd9033a5eba97b0187772dab6048 | [] | no_license | dennyy/hulu-kv | cc05b95504ce62efc4d627e6acbfe1e4fec51838 | 47b44e94a1a77107d73bc4b279010d65edf1a0dd | refs/heads/master | 2021-01-16T21:23:14.785441 | 2014-11-06T02:22:00 | 2014-11-06T02:22:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,022 | java | package org.space.hulu.io;
import java.io.File;
import org.space.hulu.util.Validation;
public class DiskSizeComputer {
private final File file;
private DiskSizeComputer(String filePath) {
super();
Validation.isExistedFilePath(filePath);
this.file = new File(filePath);
}
public static DiskSizeComputer getInstance(String filePath) {
return new DiskSizeComputer(filePath);
}
public long getTotalSpace() {
return file.getTotalSpace();
}
/**
* according to disk file path right and other control factor to computer.
* @return
*/
public long getUsableSpace() {
return file.getUsableSpace();
}
public File getFile() {
return file;
}
public String getAbsolutePath() {
return file.getAbsolutePath();
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("DiskSizeComputer [file=");
builder.append(file.getAbsolutePath());
builder.append("]");
return builder.toString();
}
}
| [
"denny@shinemo.com"
] | denny@shinemo.com |
8f5b22b51e9921d7d1b8afea3295285b515e0a93 | 28152c75f8efe5abf09a11998eb2fb53edaa545f | /Springbreak/src/at/newsagg/dao/CommentDAO.java | ff69c073e45450e9b22fe891f75dc2e9e7c02410 | [] | no_license | BackupTheBerlios/springbreak | cbf8209ef7f8a2224f3a2bfbcc6e46b30a1a30f3 | d27e25b5ba0cbb4c68dbdc17f1dfa96dc3b5c537 | refs/heads/master | 2021-01-22T01:55:07.162006 | 2006-05-03T15:27:26 | 2006-05-03T15:27:26 | 40,260,340 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,395 | java | /*
* Created on 30.03.2005
* king
*
*/
package at.newsagg.dao;
import java.util.Collection;
import at.newsagg.model.Comment;
/**
* @author Roland Vecera
* @version
* created on 30.03.2005 11:33:46
*
*/
public interface CommentDAO {
/**
* save a new comment.
*
* @param comment
*/
public void savecomment(Comment comment);
public void saveOrUpdatecomment(Comment comment);
/**
* update a persisted comment. updates a comment, thats already in db.
*
* @param comment
*/
public void updatecomment(Comment comment);
/**
* Delete comment Object.
*
* @param comment
*/
public void removecomment(Comment comment);
/**
* Get all comments from a given user order by addedDate (latest first).
*/
public Collection getCommentsByUser (int user_id);
/**
* Get all comments to a given channel order by addedDate (latest first).
*
*/
public Collection getCommentsToChannel (int channel_id);
/**
* Get Average rating of a given Channel
*
*/
public float getAVGRatingToChannel (int channel_id) throws IndexOutOfBoundsException, NumberFormatException;
/**
* Counts how many Comments to given Channel are in DB.
* @param channel_id
* @return
*/
public int countCommentsToChannel (int channel_id);
} | [
"vecego"
] | vecego |
6ce36d2592313d27eaadc8d94985815a035f0b64 | 498dd2daff74247c83a698135e4fe728de93585a | /clients/google-api-services-dialogflow/v3beta1/1.31.0/com/google/api/services/dialogflow/v3beta1/model/GoogleCloudDialogflowV2Message.java | 64bf5e6c341ea4a9f8d6a5bbb88f07c19d9c0b4c | [
"Apache-2.0"
] | permissive | googleapis/google-api-java-client-services | 0e2d474988d9b692c2404d444c248ea57b1f453d | eb359dd2ad555431c5bc7deaeafca11af08eee43 | refs/heads/main | 2023-08-23T00:17:30.601626 | 2023-08-20T02:16:12 | 2023-08-20T02:16:12 | 147,399,159 | 545 | 390 | Apache-2.0 | 2023-09-14T02:14:14 | 2018-09-04T19:11:33 | null | UTF-8 | Java | false | false | 7,945 | 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/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.dialogflow.v3beta1.model;
/**
* Represents a message posted into a conversation.
*
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Dialogflow API. For a detailed explanation see:
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
* </p>
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class GoogleCloudDialogflowV2Message extends com.google.api.client.json.GenericJson {
/**
* Required. The message content.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String content;
/**
* Output only. The time when the message was created in Contact Center AI.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private String createTime;
/**
* Optional. The message language. This should be a [BCP-47](https://www.rfc-
* editor.org/rfc/bcp/bcp47.txt) language tag. Example: "en-US".
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String languageCode;
/**
* Output only. The annotation for the message.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private GoogleCloudDialogflowV2MessageAnnotation messageAnnotation;
/**
* Optional. The unique identifier of the message. Format:
* `projects//locations//conversations//messages/`.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String name;
/**
* Output only. The participant that sends this message.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String participant;
/**
* Output only. The role of the participant.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String participantRole;
/**
* Optional. The time when the message was sent.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private String sendTime;
/**
* Output only. The sentiment analysis result for the message.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private GoogleCloudDialogflowV2SentimentAnalysisResult sentimentAnalysis;
/**
* Required. The message content.
* @return value or {@code null} for none
*/
public java.lang.String getContent() {
return content;
}
/**
* Required. The message content.
* @param content content or {@code null} for none
*/
public GoogleCloudDialogflowV2Message setContent(java.lang.String content) {
this.content = content;
return this;
}
/**
* Output only. The time when the message was created in Contact Center AI.
* @return value or {@code null} for none
*/
public String getCreateTime() {
return createTime;
}
/**
* Output only. The time when the message was created in Contact Center AI.
* @param createTime createTime or {@code null} for none
*/
public GoogleCloudDialogflowV2Message setCreateTime(String createTime) {
this.createTime = createTime;
return this;
}
/**
* Optional. The message language. This should be a [BCP-47](https://www.rfc-
* editor.org/rfc/bcp/bcp47.txt) language tag. Example: "en-US".
* @return value or {@code null} for none
*/
public java.lang.String getLanguageCode() {
return languageCode;
}
/**
* Optional. The message language. This should be a [BCP-47](https://www.rfc-
* editor.org/rfc/bcp/bcp47.txt) language tag. Example: "en-US".
* @param languageCode languageCode or {@code null} for none
*/
public GoogleCloudDialogflowV2Message setLanguageCode(java.lang.String languageCode) {
this.languageCode = languageCode;
return this;
}
/**
* Output only. The annotation for the message.
* @return value or {@code null} for none
*/
public GoogleCloudDialogflowV2MessageAnnotation getMessageAnnotation() {
return messageAnnotation;
}
/**
* Output only. The annotation for the message.
* @param messageAnnotation messageAnnotation or {@code null} for none
*/
public GoogleCloudDialogflowV2Message setMessageAnnotation(GoogleCloudDialogflowV2MessageAnnotation messageAnnotation) {
this.messageAnnotation = messageAnnotation;
return this;
}
/**
* Optional. The unique identifier of the message. Format:
* `projects//locations//conversations//messages/`.
* @return value or {@code null} for none
*/
public java.lang.String getName() {
return name;
}
/**
* Optional. The unique identifier of the message. Format:
* `projects//locations//conversations//messages/`.
* @param name name or {@code null} for none
*/
public GoogleCloudDialogflowV2Message setName(java.lang.String name) {
this.name = name;
return this;
}
/**
* Output only. The participant that sends this message.
* @return value or {@code null} for none
*/
public java.lang.String getParticipant() {
return participant;
}
/**
* Output only. The participant that sends this message.
* @param participant participant or {@code null} for none
*/
public GoogleCloudDialogflowV2Message setParticipant(java.lang.String participant) {
this.participant = participant;
return this;
}
/**
* Output only. The role of the participant.
* @return value or {@code null} for none
*/
public java.lang.String getParticipantRole() {
return participantRole;
}
/**
* Output only. The role of the participant.
* @param participantRole participantRole or {@code null} for none
*/
public GoogleCloudDialogflowV2Message setParticipantRole(java.lang.String participantRole) {
this.participantRole = participantRole;
return this;
}
/**
* Optional. The time when the message was sent.
* @return value or {@code null} for none
*/
public String getSendTime() {
return sendTime;
}
/**
* Optional. The time when the message was sent.
* @param sendTime sendTime or {@code null} for none
*/
public GoogleCloudDialogflowV2Message setSendTime(String sendTime) {
this.sendTime = sendTime;
return this;
}
/**
* Output only. The sentiment analysis result for the message.
* @return value or {@code null} for none
*/
public GoogleCloudDialogflowV2SentimentAnalysisResult getSentimentAnalysis() {
return sentimentAnalysis;
}
/**
* Output only. The sentiment analysis result for the message.
* @param sentimentAnalysis sentimentAnalysis or {@code null} for none
*/
public GoogleCloudDialogflowV2Message setSentimentAnalysis(GoogleCloudDialogflowV2SentimentAnalysisResult sentimentAnalysis) {
this.sentimentAnalysis = sentimentAnalysis;
return this;
}
@Override
public GoogleCloudDialogflowV2Message set(String fieldName, Object value) {
return (GoogleCloudDialogflowV2Message) super.set(fieldName, value);
}
@Override
public GoogleCloudDialogflowV2Message clone() {
return (GoogleCloudDialogflowV2Message) super.clone();
}
}
| [
"noreply@github.com"
] | noreply@github.com |
1664f87f0e32d29b4d6890564a74035b481ee31c | d9d4bc9236e2aaddcd1bcd1ed5c5428f6e63026b | /app/src/main/java/com/na/newsapp/detail/DetailActivity.java | 332b0c388c1650e6328bec18835bb12c828c5ae2 | [] | no_license | AkshaySharma2843/NewsApp | d9d26a0fa91e0f65db85913589ea22dbb67c6b94 | e8c7e55527162456ccbc6fbf2d6dbb50ee09c1d1 | refs/heads/master | 2023-03-13T01:33:56.660546 | 2021-02-28T17:43:20 | 2021-02-28T17:43:20 | 343,170,705 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,276 | java | package com.na.newsapp.detail;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.na.newsapp.R;
import com.na.newsapp.data.model.Article;
public class DetailActivity extends AppCompatActivity {
Article article;
ImageView imageView;
TextView title;
TextView description;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
getData();
initView();
bindData();
}
private void bindData() {
title.setText(article.getTitle());
description.setText(article.getDescription());
Glide.with(this)
.load(article.getUrlToImage())
.into(imageView);
}
private void initView() {
imageView = findViewById(R.id.iv_news);
title = findViewById(R.id.tv_detail_title);
description = findViewById(R.id.tv_detail_description);
}
private void getData() {
Intent intent = getIntent();
article = (Article) intent.getSerializableExtra("ARTICLE_DATA");
}
} | [
"akshaysharma2843@gmail.com"
] | akshaysharma2843@gmail.com |
e2576b1d7553389632d23007b5622a59b565f440 | 2fa23a2c867181629fbc2ac5a7a6274deca0d445 | /app/src/main/java/com/example/obidi/eco_shopping_mall/MainActivityCallback.java | 2988a3aeb7669a957f40041db8ea69c0e7986c52 | [] | no_license | Ecobidi/EcoShoppingApp | 98a1581458e9abd572f79d1d9481c84b08510082 | de0e345ef985eba120d1417f74e5c17e8e1f2a66 | refs/heads/master | 2022-04-16T09:46:13.386455 | 2020-04-13T20:55:35 | 2020-04-13T20:55:35 | 255,444,059 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 170 | java | package com.example.obidi.eco_shopping_mall;
public interface MainActivityCallback {
public void updateCartBadge();
public void setToolbarTitle(String title);
}
| [
"ecobidi@gmail.com"
] | ecobidi@gmail.com |
d2c4fd39bd4f829b989fb3b0537a9df0abea10b7 | 1ec62a7e351ed029b2141ee01432d2fc8c44f43a | /java/isemba/Applet/j314/j314.java | d626c54826d9a94026630b21fe450399a8d3d951 | [] | no_license | hataka/codingground | 7a1b555d13b8e42320f5f5e4898664191da16a47 | 53d2b204ae2e0fb13bd6d293e07c68066226e26b | refs/heads/master | 2021-01-20T01:34:16.778320 | 2019-02-02T04:27:14 | 2019-02-02T04:27:14 | 89,292,259 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,648 | java | // -*- mode: java -*- Time-stamp: <2009-06-20 16:40:17 kahata>
/*====================================================================
* name: j314.java
* created : Time-stamp: <09/06/20(土) 15:52:08 hata>
* $Id$
* Programmed by kahata
* To compile:
* To run:
* links: http://jubilo.cis.ibaraki.ac.jp/~isemba/PROGRAM/JAVA/java.shtml
* http://jubilo.cis.ibaraki.ac.jp/~isemba/PROGRAM/JAVA/APPLET/j314.htm
* description:
* ====================================================================*/
////////////////////////////////////////////////////////////////////////////////
// << j314.java >>
//
// アプレット(1):グラフィックス(直線)
//
// n×nのマス目を描く。
//
// ●Graphicsクラスのメソッド
// public abstract void drawLine(int x0, int y0, int x1, int y1)
// 機能:点(x0,y0)と点(x1,y1)の間に直線を引く。
//
////////////////////////////////////////////////////////////////////////////////
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Color;
public class j314 extends Applet {
public void init() {
// アプレットの背景色を白色に設定。
this.setBackground(Color.white);
}
public void paint(Graphics g) {
// n×nのマス目を描画。
int x=30,y=30,h=40,n=3;
for( int i=0; i<=n; i++ ) {
g.drawLine(x,y+h*i,x+h*n,y+h*i);
g.drawLine(x+h*i,y,x+h*i,y+h*n);
}
}
}
/*
<!-- HTMLファイル -->
<html>
<head>
<title>アプレット</title>
</head>
<body bgcolor=white text=black>
<applet code="j314.class" width="300" height="200">
</applet>
</body>
</html>
*/
| [
"kazuhiko.hata@nifty.com"
] | kazuhiko.hata@nifty.com |
18fd74ecc1b4b39d782c11ad67b0a12707c06200 | e2ea8ccd6cce2cc6c61f69d9de50a3ade362957c | /latte-core/src/main/java/com/example/latte_core/util/timer/BaseTimerTask.java | 32de3480db65f23d88ced574860fe5d5d26ae89a | [] | no_license | jobinzhang/Fastec | cdfebb31c6aa8d3c79ac09478a7894fe4dcb0323 | 6530417fdb9c7f51743d806103dfa3f44d1304f8 | refs/heads/master | 2021-05-18T12:59:40.431442 | 2020-04-08T09:05:36 | 2020-04-08T09:05:36 | 251,252,169 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 463 | java | package com.example.latte_core.util.timer;
import java.util.TimerTask;
/**
* Created by 傅令杰 on 2017/4/22
*/
public class BaseTimerTask extends TimerTask {
private ITimerListener mITimerListener = null;
public BaseTimerTask(ITimerListener timerListener) {
this.mITimerListener = timerListener;
}
@Override
public void run() {
if (mITimerListener != null) {
mITimerListener.onTimer();
}
}
}
| [
"619440047@qq.com"
] | 619440047@qq.com |
3773a7d55f2df13758ee941905144cd770343090 | daca48fc03c6e6879b1157ad7e34a2d2e59da5f3 | /src/main/java/com/rpsls/dto/player/CommandLineIO.java | f69c9ee1c77aaf63e81128502d251edc216a3241 | [] | no_license | arunmohandas196/rpsls | ecc6678f6370a0b732c01d1187c28a4b0edbba22 | ac9c22cbccf6fb9c246a8bc5ff7b62374cff888d | refs/heads/master | 2020-12-13T05:17:11.562757 | 2020-01-16T13:16:10 | 2020-01-16T13:16:10 | 234,321,877 | 0 | 0 | null | 2020-01-16T13:16:12 | 2020-01-16T13:06:50 | null | UTF-8 | Java | false | false | 992 | java | /** */
package com.rpsls.dto.player;
import com.rpsls.dto.hand.Hand;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
/** Helper class for communicating via command line. */
class CommandLineIO {
public void printChoices(List<Hand> choices) {
StringBuffer message = new StringBuffer("Please select {");
for (Hand hand : choices) {
message.append(hand.name()).append(" ");
}
message.append("}");
System.out.println(message);
}
public void printHelpMessage(List<Hand> choices) {
System.out.println("Wrong choice. Please try again.");
printChoices(choices);
}
public String readLine() throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
return reader.readLine();
}
public void printAskForName() {
System.out.println("Your name?");
}
public void print(String message) {
System.out.println(message);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
f46e6800c3449b8876af156d5f602c6de61b77df | 5f1cd8deedf9694d29afb44409e3291440b0d84b | /Sprint/src/test/java/com/demo/SprintApplicationTests.java | 7996e3bf5e73d0739633eec033bb85c19f816e9d | [] | no_license | niranj100/employee_management | f572536609496b1b9e23bc8def141460b6931082 | d2a91a74a2ffa86e2302f81c687b9ff4118e96b9 | refs/heads/master | 2023-08-16T23:29:40.932434 | 2021-10-13T13:35:54 | 2021-10-13T13:35:54 | 416,748,590 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 213 | java | package com.demo;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SprintApplicationTests {
@Test
void contextLoads() {
}
}
| [
"noreply@github.com"
] | noreply@github.com |
dea78ba68b43b05c4f8966606f70f5119aee0749 | effe8465470d63616b3de0164233305ae32d0405 | /src/main/java/com/ms/portvaluation/repository/AbstractJpaDAO.java | 5c82410a459d8cccf04eb76fbed92ca0f87b88fe | [] | no_license | michaelyzq/Java-Portfolio-Valution-Project | 87157b3eae2ca1248570e2d8911b52a5164d54b8 | a46e2bedfc711d2c6b2a45ec3425902382860002 | refs/heads/master | 2020-04-08T15:59:51.578513 | 2018-11-28T12:46:56 | 2018-11-28T12:46:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,061 | java | package com.ms.portvaluation.repository;
import java.io.Serializable;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.springframework.transaction.annotation.Transactional;
/**
* @author michael yin
*
* @param <T>
*/
@Transactional
public abstract class AbstractJpaDAO<T extends Serializable> {
private Class<T> clazz;
@PersistenceContext
public EntityManager entityManager;
public final void setClazz(Class<T> clazzToSet) {
this.clazz = clazzToSet;
}
public T findOne(long id) {
return entityManager.find(clazz, id);
}
@SuppressWarnings("unchecked")
public List<T> findAll() {
return entityManager.createQuery("from " + clazz.getName()).getResultList();
}
public void create(T entity) {
entityManager.persist(entity);
}
public T update(T entity) {
return entityManager.merge(entity);
}
public void delete(T entity) {
entityManager.remove(entity);
}
public void deleteById(long entityId) {
T entity = findOne(entityId);
delete(entity);
}
}
| [
"michael.yin@greyspark.com"
] | michael.yin@greyspark.com |
d9048a8e9cb419651515ac359283d71bcf3718ab | 2cb3d17ae259d401746534b588465255be9a7377 | /Demo/app/src/test/java/project/demo/MainActivityTest.java | 9c3c0bd72be550c9938991ac5d7a373fbbe6fe59 | [] | no_license | hassanassi/mvp-vs-mvc | 8ec95158ae82108f9f8dacb474a1f33cc157f457 | ec06a09094f2a3824eedd6c6e1305e2e0d544cc9 | refs/heads/master | 2021-01-22T01:14:16.828240 | 2017-09-07T18:05:08 | 2017-09-07T18:05:08 | 102,213,112 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,790 | java | package project.demo;
import android.app.Activity;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ProgressBar;
import org.apache.tools.ant.Main;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowLooper;
import org.robolectric.shadows.ShadowToast;
import project.demo.presenter.MainPresenter;
import project.demo.view.MainActivity;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.*;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class,packageName = "project.demo",sdk = 21)
public class MainActivityTest {
MainActivity activity;
@Mock
MainPresenter mainPresenter;
@Before
public void setUp(){
MockitoAnnotations.initMocks(this);
activity = Robolectric.buildActivity(MainActivity.class).create().resume().get();
assertNotNull(activity);
activity.setPresenter(mainPresenter);
}
/**
* verify that progress bar is visible and recycleView is gone when showProgress is called
* @throws Exception
*/
@Test
public void testShowProgress() throws Exception {
activity.showProgress();
ProgressBar progressBar= (ProgressBar) activity.findViewById(R.id.progressBar);
RecyclerView recyclerView=(RecyclerView) activity.findViewById(R.id.recycleView);
assertTrue(progressBar.getVisibility()==View.VISIBLE);
assertTrue(recyclerView.getVisibility()==View.GONE);
}
/**
* verify that progress bar is gone and recycleView is visible when showProgress is called
* @throws Exception
*/
@Test
public void testHideProgress(){
activity.hideProgress();
ProgressBar progressBar= (ProgressBar) activity.findViewById(R.id.progressBar);
RecyclerView recyclerView=(RecyclerView) activity.findViewById(R.id.recycleView);
assertTrue(progressBar.getVisibility()==View.GONE);
assertTrue(recyclerView.getVisibility()==View.VISIBLE);
}
/**
* verify display error message in toast
*/
@Test
public void verifyErrorMessage(){
activity.displayMsgError();
ShadowLooper.idleMainLooper();
assertEquals(ShadowToast.getTextOfLatestToast(),activity.getString(R.string.error));
}
}
| [
"hassan1993assi@gmail.com"
] | hassan1993assi@gmail.com |
aea4683992d8c22c45f989f331f8f4e6892a48ee | d135b6d6d4ab48d317571baa42ce46cb604d1e98 | /src/main/java/pl/com/sniper/auction/xmpp/FailedMessageLogger.java | 765183f75383cdbce2bcfe05defe9dfdc7bb48fe | [] | no_license | mateuszszczurek/object_oriented | effd1fda895cfebd6a46709e99bd076bf9678a48 | 34dfe967d0a5dae81e1dfe39c8654c5ece8f84c3 | refs/heads/master | 2021-01-13T01:50:12.463555 | 2015-09-09T18:29:01 | 2015-09-09T18:29:01 | 30,201,302 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 442 | java | package pl.com.sniper.auction.xmpp;
import java.util.logging.Logger;
import static java.lang.String.format;
public class FailedMessageLogger {
private final Logger logger;
public FailedMessageLogger(Logger logger) {
this.logger = logger;
}
public void reportFailedMessage(FailedMessage messageContent) {
logger.severe(format("%s:%s", messageContent.getSniperId(), messageContent.getContent()));
}
}
| [
"mateusz.szczurek86@gmail.com"
] | mateusz.szczurek86@gmail.com |
196088dfd7a31a09e744f725106b44572e99fb5a | 3b6117c0ff791066a669e74404b4db6a5fb56340 | /星河/com.agdress.api/src/main/java/com/agdress/entity/Starship_UserAccountDetailEntity.java | 3401ba5bf293a0cffc366c81bf6a600ea388d040 | [] | no_license | wofxuan/yunjing | a7316565081bfda0360e769633d43cae5e3c5613 | 1909facbc5f90ca20591eda39f713301fa1c6787 | refs/heads/master | 2021-07-16T12:56:11.494760 | 2017-10-24T03:51:52 | 2017-10-24T03:51:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,489 | java | package com.agdress.entity;
import com.agdress.enums.TradeKindEnum;
import com.agdress.enums.TradeStatusEnum;
import com.agdress.enums.TradeTypeEnum;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
/**
* 用户财富实体
*/
@TableName(value = "t_user_account_detail")
public class Starship_UserAccountDetailEntity extends BaseEntity {
@TableId(type = IdType.AUTO,value = "trade_id")
private Long tradeId;
@TableField(value = "user_id")
private Long userId;
@TableField(value = "account_id")
private Long accountId;
@TableField(value = "trade_no")
private String tradeNo;
@TableField(value = "amount")
private Double amount;
@TableField(value = "new_balance")
private Double newBalance;
@TableField(value = "trade_currency")
private Integer tradeCurrency;
@TableField(value = "trade_kind")
private TradeKindEnum tradeKindEnum;
@TableField(value = "trade_status")
private TradeStatusEnum tradeStatusEnum;
@TableField(value = "trade_type")
private TradeTypeEnum tradeTypeEnum;
@TableField(value = "remarks")
private String remarks;
@TableField(value = "flow_id")
private Long flowId;
public Long getFlowId() {
return flowId;
}
public void setFlowId(Long flowId) {
this.flowId = flowId;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public Long getTradeId() {
return tradeId;
}
public void setTradeId(Long tradeId) {
this.tradeId = tradeId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getAccountId() {
return accountId;
}
public void setAccountId(Long accountId) {
this.accountId = accountId;
}
public String getTradeNo() {
return tradeNo;
}
public void setTradeNo(String tradeNo) {
this.tradeNo = tradeNo;
}
public Double getAmount() {
return amount;
}
public void setAmount(Double amount) {
this.amount = amount;
}
public Double getNewBalance() {
return newBalance;
}
public void setNewBalance(Double newBalance) {
this.newBalance = newBalance;
}
public Integer getTradeCurrency() {
return tradeCurrency;
}
public void setTradeCurrency(Integer tradeCurrency) {
this.tradeCurrency = tradeCurrency;
}
public TradeKindEnum getTradeKindEnum() {
return tradeKindEnum;
}
public void setTradeKindEnum(TradeKindEnum tradeKindEnum) {
this.tradeKindEnum = tradeKindEnum;
}
public TradeStatusEnum getTradeStatusEnum() {
return tradeStatusEnum;
}
public void setTradeStatusEnum(TradeStatusEnum tradeStatusEnum) {
this.tradeStatusEnum = tradeStatusEnum;
}
public TradeTypeEnum getTradeTypeEnum() {
return tradeTypeEnum;
}
public void setTradeTypeEnum(TradeTypeEnum tradeTypeEnum) {
this.tradeTypeEnum = tradeTypeEnum;
}
}
| [
"“"
] | “ |
7efb4575d80e32f404c80f0ce05731321bb82491 | acbc754e14586c9163bc45436dd093e6f9bf2a9b | /app/src/main/java/com/ecom/project/SIgnUp2ndScreen.java | cf9c44f00f438964d86e6ae2e2b25812f54726b8 | [] | no_license | nitinrai-dev/Ecommerce-Inventory | 6164c05c53ab28ec82c04b7eaf2d43bb0e6f9164 | edd64c4ff92634bb0f593b9e9b9a5fa5d39c5a80 | refs/heads/master | 2022-12-20T06:38:12.152885 | 2020-10-02T18:24:50 | 2020-10-02T18:24:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 783 | java | package com.ecom.project;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class SIgnUp2ndScreen extends AppCompatActivity {
Button callSignUp;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_s_ign_up2nd_screen);
callSignUp = findViewById(R.id.signup_btn);
callSignUp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(SIgnUp2ndScreen.this, Dashboard.class);
startActivity(intent);
}
});
}} | [
"37896075+dvlnitins@users.noreply.github.com"
] | 37896075+dvlnitins@users.noreply.github.com |
49c69b43cd69aade5d22743807662b395be97cb5 | 8380ac89ffae2cd6e22ca26a8986e176496d4cca | /LottoGame/src/Main.java | cc2cb4be4202594044e8d089826e9bf12cd29332 | [] | no_license | ydj515/JavaStudy | b4eeb6702eb4e7a4c56ee240b4daba6135ab20c4 | 421214ad42176d5bb981f33ed329046dfb1ab370 | refs/heads/master | 2022-12-20T10:23:42.752207 | 2020-09-19T09:21:23 | 2020-09-19T09:21:23 | 284,437,680 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 146 | java | import controller.LottoController;
public class Main {
public static void main(String[] args) {
new LottoController().run();
}
}
| [
"ydj515@hanmail.net"
] | ydj515@hanmail.net |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.