blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ac43aa38431db7ef7e47060a82669283d9bba5d2 | 9cd9adf05960ebe45a159dffe2de8e221210796b | /tally/src/main/java/vip/bzsy/advice/GlobalExceptionAdvice.java | a1b3974fd2786943a1ff241957676530720fa37d | [] | no_license | thankingfor/myGraduationProject | ae22266ac4c6ec96ace3757481478181dbff55a8 | 8189814940c8c80b54a83cf2e97c1246929fc51f | refs/heads/master | 2022-07-02T16:18:47.306186 | 2020-01-15T04:12:00 | 2020-01-15T04:12:00 | 183,770,620 | 1 | 0 | null | 2022-06-21T02:38:22 | 2019-04-27T12:34:23 | Java | UTF-8 | Java | false | false | 1,100 | java | package vip.bzsy.advice;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import vip.bzsy.common.CommonResponse;
import vip.bzsy.common.CommonStatus;
import vip.bzsy.exception.CommonException;
import javax.servlet.http.HttpServletRequest;
@Slf4j
@RestControllerAdvice
public class GlobalExceptionAdvice {
@ExceptionHandler(value = Exception.class)
public CommonResponse handlerException(HttpServletRequest req,
CommonException ex) {
CommonResponse response = new CommonResponse(CommonStatus.EXCEPTION);
log.info(ex.getMessage());
return response;
}
@ExceptionHandler(value = CommonException.class)
public CommonResponse handlerCommonException(HttpServletRequest req,
CommonException ex) {
CommonResponse response = new CommonResponse(CommonStatus.EXCEPTION);
response.setMsg(ex.getMessage());
return response;
}
}
| [
"984213466@qq.com"
] | 984213466@qq.com |
df9008e6b5bfb2e553ed92b4c1285bfa30d42e3a | 222ab4307a5844a7d2eeeb7df7a19fcbfbfbe0f1 | /src/main/java/com/strzalkom/domain/Car.java | 94bda8efc37f63f189daed0f2402fceae74c0212 | [] | no_license | strzalkom/Car_Rental | 6234481d07f10c85402cb8bce218db8b7c2db74c | 6359ee523d8e4477c11d43268dab6513fb7f2600 | refs/heads/master | 2023-05-06T13:58:00.654907 | 2021-01-03T19:44:24 | 2021-01-03T19:44:24 | 279,246,584 | 0 | 0 | null | 2021-06-04T21:59:25 | 2020-07-13T08:45:12 | Java | UTF-8 | Java | false | false | 1,963 | java | package com.strzalkom.domain;
import org.hibernate.validator.constraints.Range;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Objects;
@Entity
public class Car {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
@NotNull
@Size(min=2, max=20,message = "Marka samochodu musi mieć: 3, a 20 znakow")
private String name;
@NotNull
@Range(min=60, max=200, message = "Cena za dzień od 60 do 200 PLN")
private int cost;
private int level;
@OneToOne
private State state;
public Car() {
this.level = 1;
}
public Car(String name, int cost) {
this.name = name;
this.cost = cost;
this.level = 1;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Car car = (Car) o;
return cost == car.cost;
}
@Override
public int hashCode() {
return Objects.hash(cost);
}
public void setState(State state) {
if(state !=null) {
state.setStarted(true);
}
this.state = state;
}
public State getState() {
return state;
}
public void setCost(int cost) {
this.cost = cost;
}
public int getCost() {
return this.cost;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
@Override
public String toString() {
return "Samochód o nazwie : " + name + "(" + cost + "). Jego aktualny stan: " + state;
}
}
| [
"mateusz.strzalko@esysco.pl"
] | mateusz.strzalko@esysco.pl |
219b8e5f88544093e35394338d581ea2500832f5 | e4b99200c41588f08095fdca2e925750bd6280f2 | /src/test/java/com/aws/sample/HelloAwsApplicationTests.java | 314e92a9734df509d27b90bd48eede14828d91fc | [] | no_license | suresh28/HelloAWS | 625053163b62d655f93086e22bf433323fbf60e8 | 1ba4d477ee991fedc4706b22242ee91b76b7fec2 | refs/heads/master | 2020-03-25T00:34:00.863309 | 2018-08-06T04:49:33 | 2018-08-06T04:49:33 | 143,192,733 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 333 | java | package com.aws.sample;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class HelloAwsApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"sur.learn2812@gmail.com"
] | sur.learn2812@gmail.com |
979a0892023dc72eccec04e12c1d93c31f4d42cd | 53e9817e58d1c1b4785ca1649405256304474b80 | /app/src/main/java/com/expense/tamal/expenseshare/activity/AddEditMembersActivity.java | 2887a91093ddcb68965483fe91c182d3685d6c79 | [] | no_license | tbhattacharya/party_expense_tracker | 40cb5a13898483fa85ecee5c839e0bb464d98670 | 18e2f4b95d9480a1877e163457de5340d4cb3251 | refs/heads/master | 2021-01-16T22:06:46.510172 | 2016-10-24T15:49:16 | 2016-10-24T15:49:16 | 65,725,793 | 0 | 0 | null | 2016-10-24T15:49:16 | 2016-08-15T10:57:14 | Java | UTF-8 | Java | false | false | 460 | java | package com.expense.tamal.expenseshare.activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.expense.tamal.expenseshare.R;
public class AddEditMembersActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_edit_members);
}
@Override
public void initUI() {
}
}
| [
"bhattacharya.tamal@gmail.com"
] | bhattacharya.tamal@gmail.com |
e77299ebebb831a0d30d04de1bbedc5151a747df | 7d8734fee6d1cf032e7c5bf0c77ead333f0a2cb7 | /app/src/main/java/com/bolo1/tweet_app/ui/activites/MainTab.java | e0538b0a4b546e9c77f6b80104550a7492082c75 | [
"Apache-2.0"
] | permissive | Dbolo1/Tweet | aead8e0e713f5310c45d1b6eb595cdb4da7bcd0f | a5b35af5f2ef48e78634f520c93e49b4099cd1f2 | refs/heads/master | 2020-04-03T17:08:57.339409 | 2018-10-30T18:35:44 | 2018-10-30T18:35:44 | 155,433,378 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,644 | java | package com.bolo1.tweet_app.ui.activites;
import com.bolo1.tweet_app.R;
import com.bolo1.tweet_app.bean.ShortVideo;
import com.bolo1.tweet_app.ui.fragment.CommentFragment;
import com.bolo1.tweet_app.ui.fragment.LoadTestMoreFragment;
import com.bolo1.tweet_app.ui.fragment.MeFragment;
import com.bolo1.tweet_app.ui.fragment.NewsFragment;
import com.bolo1.tweet_app.ui.fragment.ShortVideoFragment;
import com.bolo1.tweet_app.ui.fragment.TestFragment;
import com.bolo1.tweet_app.ui.fragment.TweetFragment;
/**
* Created by 菠萝 on 2018/4/20.
*/
public enum MainTab {
//写三个枚举
NEWS(0, R.string.news_title,R.drawable.tab_icon_news,NewsFragment.class),
TWEET(1, R.string.home_title,R.drawable.tab_icon_tweet,LoadTestMoreFragment.class),
ME(2, R.string.me_title,R.drawable.tab_icon_me,MeFragment.class);
private int idx;
private Class<?> clz;
private int ResName;
private int ResIcon;
public int getIdx() {
return idx;
}
public void setIdx(int idx) {
this.idx = idx;
}
public Class<?> getClz() {
return clz;
}
public void setClass(java.lang.Class<?> aClass) {
clz = aClass;
}
public int getResName() {
return ResName;
}
public void setResName(int resName) {
ResName = resName;
}
public int getResIcon() {
return ResIcon;
}
public void setResIcon(int resIcon) {
ResIcon = resIcon;
}
MainTab(int idx, int ResName, int ResIcon,Class<?> clz) {
this.idx = idx;
this.clz = clz;
this.ResIcon = ResIcon;
this.ResName = ResName;
}
}
| [
"879160616@qq.com"
] | 879160616@qq.com |
209e59c62088f9c06feeea28261aca99e8588c76 | 388ae495522aad871efff33bb457b96827b89d21 | /cartridges/andromda-jsf/src/java/org/andromda/cartridges/jsf/metafacades/JSFEnumerationLogicImpl.java | f462f89a73369434ea44bd3275c71de2bbc54aa2 | [] | no_license | DiegoSVL/mdarte | 5d281c659c1fbcfb7f49e4a0d144126bdd1c7b30 | 87f83b3df8ce5b514f240028712ae94c48be3435 | refs/heads/master | 2021-01-21T15:26:13.346197 | 2013-08-06T19:43:33 | 2013-08-06T19:43:33 | 25,666,335 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,446 | java | package org.andromda.cartridges.jsf.metafacades;
import org.andromda.cartridges.jsf.JSFGlobals;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils;
/**
* MetafacadeLogic implementation for org.andromda.cartridges.jsf.metafacades.JSFEnumeration.
*
* @see org.andromda.cartridges.jsf.metafacades.JSFEnumeration
*/
public class JSFEnumerationLogicImpl
extends JSFEnumerationLogic
{
public JSFEnumerationLogicImpl (Object metaObject, String context)
{
super (metaObject, context);
}
/**
* @see org.andromda.cartridges.jsf.metafacades.JSFEnumeration#getConverterName()
*/
protected java.lang.String handleGetConverterName()
{
return StringUtils.replace(
ObjectUtils.toString(this.getConfiguredProperty(JSFGlobals.CONVERTER_PATTERN)),
"{0}",
this.getName());
}
/**
* @see org.andromda.cartridges.jsf.metafacades.JSFEnumeration#getFullyQualifiedConverterName()
*/
protected java.lang.String handleGetFullyQualifiedConverterName()
{
return this.getPackageName() + "." + this.getConverterName();
}
/**
* @see org.andromda.cartridges.jsf.metafacades.JSFEnumeration#getConverterPath()
*/
protected String handleGetConverterPath()
{
return this.getFullyQualifiedConverterName().replace('.', '/');
}
} | [
"filipebraida@gmail.com"
] | filipebraida@gmail.com |
6fa60862d567e2ea4b6244426f2a88091b694127 | 0d0a6a8750ffd29a7c70f6d4ccee0abc4fb2c8f2 | /OPC47/src/com/opc/schedule/ScheduleDel.java | 27629c41da30fb752d6050fcb2636ebe339598ec | [] | no_license | Kaavyadeepika7/OPC47test | 677f42201c49c793b8e6a0906c6c672816cad36f | 87dacb84f9dd65bf90df511b1813b58b78fd5134 | refs/heads/master | 2021-01-01T17:37:57.468124 | 2015-04-01T11:44:00 | 2015-04-01T11:57:12 | 33,244,573 | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 2,203 | java | package com.opc.schedule;
import java.io.IOException;
import java.sql.Connection;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.opc.connection.ConnectionManager;
/**
*
* @author: Jayarathina Madharasan. Y
* @Date: January 25, 2012
* @Copyright_Notice: © 2012 Cognizant, all rights reserved
* @Description: Upcoming Events - Deleting a Schedule
*/
public class ScheduleDel extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
* response)
*/
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
//getting session attributes
String user_typ = request.getSession().getAttribute("TYPE") + "";
if (!user_typ.equalsIgnoreCase("A")) {
//display You are not authorized to view this page
response.sendRedirect("index.jsp?msg=" + 8);
}
String id = request.getParameter("S_ID");
Connection conn = null;
Statement statement =null;
try {
conn = ConnectionManager.getConnection();
statement = conn.createStatement();
int i = statement
.executeUpdate("DELETE FROM OPC_schedule WHERE S_ID = "
+ id + " ");
if (i > 0)
//Display Deleted Sucessfully
response.sendRedirect("index.jsp?msg=B");
else
//No records matched for your input
response.sendRedirect("index.jsp?msg=C");
}
catch (Exception e) {
//save the error message in the log
//Logger.getLogger(ScheduleDel.class.getName()).log(Level.SEVERE, null, e);
e.printStackTrace();
response.sendRedirect("index.jsp?msg=C");
}
finally
{
try {
statement.close();
conn.close();
} catch (Exception e) {
//save the error message in the log
//Logger.getLogger(ScheduleDel.class.getName()).log(Level.SEVERE, null, e);
e.printStackTrace();
}
}
}
}
| [
"360640@PC283237.cts.com"
] | 360640@PC283237.cts.com |
223ef96a71ac386f703e4ecab4c722c4e1822ddb | bd295a745d2fd845d5a379b00fa3fe55b5e28b47 | /clover-android-sdk/src/main/java/com/clover/sdk/v1/printer/job/BillPrintJob.java | 9dada23e3dcf7a5bc48058ff566320a503d75c3d | [] | no_license | Gauthaman-A/clover-android-sdk | 3b4decc703213c35b801076aed494dd84250f296 | 773b22344f44877426ecae6a1325d4dabf5fb847 | refs/heads/master | 2020-12-28T22:12:25.578319 | 2014-02-10T19:53:33 | 2014-02-10T19:53:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,356 | java | /*
* Copyright (C) 2013 Clover Network, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.clover.sdk.v1.printer.job;
import com.clover.sdk.v1.printer.Category;
import java.io.Serializable;
public class BillPrintJob extends ReceiptPrintJob implements Serializable {
public static class Builder extends ReceiptPrintJob.Builder {
private String binName;
public Builder binName(String binName) {
this.binName = binName;
return this;
}
public BillPrintJob build() {
return new BillPrintJob(orderId, binName, flags | FLAG_BILL);
}
}
public final String binName;
protected BillPrintJob(String orderId, String binName, int flags) {
super(orderId, flags);
this.binName = binName;
}
@Override
public Category getPrinterCategory() {
return Category.RECEIPT;
}
}
| [
"duane.moore@ieee.org"
] | duane.moore@ieee.org |
ad690ab3f77de9acff472a413286284395f388dd | 7e508014c1b6476dd163aafc720070fcd9184875 | /lianxin/app/src/main/java/com/example/whitebooks/lianxin_android/adapters/LianKetangAdapter.java | bc6a61b52065c50c759af10b423b942eb62d0b9b | [] | no_license | whitebooks1982114/lianxin-android-new | 4eb89e6225eb460780243de1fbfd98e10663dd4b | 8092af46d24616e46a6cdd035b42c372d435586f | refs/heads/master | 2021-05-12T18:30:42.966155 | 2018-01-11T08:04:13 | 2018-01-11T08:04:13 | 117,069,230 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,691 | java | package com.example.whitebooks.lianxin_android.adapters;
import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.example.whitebooks.lianxin_android.R;
import com.example.whitebooks.lianxin_android.activities.LianKetangContent;
import com.example.whitebooks.lianxin_android.utilclass.media;
import com.facebook.drawee.view.SimpleDraweeView;
import java.util.List;
/**
* Created by whitebooks on 17/5/18.
*/
public class LianKetangAdapter extends RecyclerView.Adapter<LianKetangAdapter.ViewHolder> {
private List<media> medias;
private Context context;
private LayoutInflater layoutInflater = null;
public LianKetangAdapter(Context context,List<media> medias){
this.context = context;
layoutInflater = LayoutInflater.from(context);
this.medias = medias;
}
public LianKetangAdapter(List<media> medias){
this.medias = medias;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = layoutInflater.from(parent.getContext()).inflate(R.layout.lianketang_item_layout,parent,false);
final ViewHolder viewHolder = new ViewHolder(view);
viewHolder.ketang.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int position = viewHolder.getAdapterPosition();
media media = medias.get(position);
Intent intent = new Intent(context, LianKetangContent.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("name",media.getName());
context.startActivity(intent);
}
});
return viewHolder;
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
media media = medias.get(position);
holder.simpleDraweeView.setImageURI(media.getImage().getFileUrl());
holder.textView.setText(media.getName());
}
@Override
public int getItemCount() {
return medias.size();
}
static class ViewHolder extends RecyclerView.ViewHolder {
SimpleDraweeView simpleDraweeView;
TextView textView;
View ketang;
public ViewHolder(View itemView) {
super(itemView);
ketang = itemView;
simpleDraweeView = (SimpleDraweeView)itemView.findViewById(R.id.lian_ketang_sv);
textView = (TextView)itemView.findViewById(R.id.lian_ketang_tv);
}
}
}
| [
"whitebooks@163.com"
] | whitebooks@163.com |
4c035cc5db27b9686480c65d46d4dccfa11e277d | 33185a0983c7cd0f80e577bdb042fe05465863d0 | /src/main/java/uk/ac/ebi/jmzidml/model/mzidml/SpecificityRules.java | 23a42a6f691c3de3df4f0b7ec27b0a477de73e5b | [] | no_license | PRIDE-Utilities/jmzIdentML | 6f0fe5a80b720296761d8e90d12a69894ccc69cd | 1a54a8184b6c7d55edd9ecaf0fc332dd9921a1a3 | refs/heads/master | 2022-09-13T02:19:09.523338 | 2022-08-26T15:52:10 | 2022-08-26T15:52:10 | 42,942,761 | 4 | 6 | null | 2022-08-26T15:52:11 | 2015-09-22T15:29:46 | Java | UTF-8 | Java | false | false | 2,385 | java |
package uk.ac.ebi.jmzidml.model.mzidml;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import uk.ac.ebi.jmzidml.model.CvParamListCapable;
import uk.ac.ebi.jmzidml.model.MzIdentMLObject;
/**
* The specificity rules of the searched modification including for example the probability of a modification's presence or peptide or protein termini. Standard fixed or variable status should be provided by the attribute fixedMod.
*
* <p>Java class for SpecificityRulesType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="SpecificityRulesType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="cvParam" type="{http://psidev.info/psi/pi/mzIdentML/1.1}CVParamType" maxOccurs="unbounded"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SpecificityRulesType", propOrder = {
"cvParam"
})
public class SpecificityRules
extends MzIdentMLObject
implements Serializable, CvParamListCapable
{
private final static long serialVersionUID = 100L;
@XmlElement(required = true)
protected List<CvParam> cvParam;
/**
* Gets the value of the cvParam property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the cvParam property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getCvParam().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link CvParam }
*
*
*/
public List<CvParam> getCvParam() {
if (cvParam == null) {
cvParam = new ArrayList<>();
}
return this.cvParam;
}
}
| [
"ypriverol@gmail.com"
] | ypriverol@gmail.com |
ca08689d76c99a0e37ba1c905b804e7113d199ee | cac720b6eba2447afba4a5f68e88ea514f107495 | /appbaselibrary/src/main/java/com/frankzhu/appbaselibrary/adpater/FZBaseViewPagerAdapter.java | 85c2d3a8a3ebc44072bd9a5420b1f459cf230a2c | [
"Apache-2.0"
] | permissive | shitou9999/FZBaseLib | 87e07f6d7a5f9d47be16716adf7c6686c5c390d8 | 716d57313d927aa7dd9fb5890a274f8777ee965d | refs/heads/master | 2021-01-13T10:05:01.370292 | 2016-07-26T08:25:20 | 2016-07-26T08:25:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,568 | java | package com.frankzhu.appbaselibrary.adpater;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.frankzhu.appbaselibrary.base.FZBaseFragment;
import java.util.ArrayList;
/**
* Author: ZhuWenWu
* Version V1.0
* Date: 16/1/27 上午11:09.
* Description:
* Modification History:
* Date Author Version Description
* -----------------------------------------------------------------------------------
* 16/1/27 ZhuWenWu 1.0 1.0
* Why & What is modified:
*/
public class FZBaseViewPagerAdapter extends FragmentPagerAdapter {
private final ArrayList<FZBaseFragment> mFragments;
private String[] mTitles;
public FZBaseViewPagerAdapter(FragmentManager fm, ArrayList<FZBaseFragment> fragments) {
super(fm);
mFragments = fragments;
}
public FZBaseViewPagerAdapter(FragmentManager fm, ArrayList<FZBaseFragment> fragments, String[] titles) {
super(fm);
mFragments = fragments;
mTitles = titles;
}
public void setTitles(String[] titles) {
this.mTitles = titles;
}
@Override
public Fragment getItem(int position) {
return mFragments.get(position);
}
@Override
public int getCount() {
return mFragments == null ? 0 : mFragments.size();
}
@Override
public CharSequence getPageTitle(int position) {
return mTitles == null ? "" : mTitles[position];
}
}
| [
"zhuwenwu2008@gmail.com"
] | zhuwenwu2008@gmail.com |
795e13f2041ffa6de833717b00fa38d699fa60bf | fde1dd452fef4a08fbdb097dce90878b3f92f611 | /src/mc/alk/arena/util/PermissionsUtil.java | 7ae52b7472e4af54d93ecc383d73024ab6d97d5a | [] | no_license | ToxicDeath/BattleArena | 3b1e25ffabbc7586449fd2a9f850acc35d22f766 | 03050fc2d1136b63998284c9a3eac9012763ee43 | refs/heads/master | 2021-01-18T09:33:10.408239 | 2012-10-22T16:11:10 | 2012-10-22T16:11:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,824 | java | package mc.alk.arena.util;
import mc.alk.arena.BattleArena;
import mc.alk.arena.Defaults;
import mc.alk.arena.objects.ArenaPlayer;
import org.bukkit.entity.Player;
public class PermissionsUtil {
static final int ticks = 2;
public static void givePlayerInventoryPerms(ArenaPlayer p){
givePlayerInventoryPerms(p.getPlayer());
}
public static void givePlayerInventoryPerms(Player p){
if (BattleArena.getSelf().isEnabled()){
if (Defaults.PLUGIN_MULTI_INV){ /// Give the multiinv permission node to ignore this player
p.getPlayer().addAttachment(BattleArena.getSelf(), Defaults.MULTI_INV_IGNORE_NODE, true, ticks);}
if (Defaults.PLUGIN_MULITVERSE_CORE){ /// Give the multiverse-core permission node to ignore this player
p.getPlayer().addAttachment(BattleArena.getSelf(), Defaults.MULTIVERSE_CORE_IGNORE_NODE, true, ticks);}
if (Defaults.PLUGIN_MULITVERSE_INV){ /// Give the multiverse-inventories permission node to ignore this player
p.getPlayer().addAttachment(BattleArena.getSelf(), Defaults.MULTIVERSE_INV_IGNORE_NODE, true, ticks);}
}
}
/// TODO CLEANUP OR REMOVE
public static void setWorldGuardBypassPerms(ArenaPlayer p, String world, boolean newState) {
//// final String perm = +world;
// boolean state = p.getPlayer().hasPermission(perm);
// if (state != newState){
// p.getPlayer().addAttachment(BattleArena.getSelf(), perm, newState);
// }
}
public static int getPriority(Player player) {
if (player.hasPermission("arena.priority.lowest")){ return 1000;}
else if (player.hasPermission("arena.priority.low")){ return 900;}
else if (player.hasPermission("arena.priority.normal")){ return 800;}
else if (player.hasPermission("arena.priority.high")){ return 700;}
else if (player.hasPermission("arena.priority.highest")){ return 600;}
return 1000;
}
}
| [
"alkarin.v@gmail.com"
] | alkarin.v@gmail.com |
a9b24032923dfd721d7b16da5a12e9aba3b6cb80 | 78af9aa5f96e2718ed7930ba3ff19b3cc661aabc | /src/com/ramine/loc/operations/FileOperations.java | 7a5777579b868bb286d7e8c0c4938b2ca06d6c24 | [] | no_license | raminetinati/MARCFileParser | 052f2f4c003d12d3ee785fb1885564c7a84c6ab5 | 47a28380ff9512ee005f1ad504c86f849344c629 | refs/heads/master | 2021-01-23T20:56:10.324332 | 2017-05-23T16:48:56 | 2017-05-23T16:48:56 | 90,664,390 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,097 | java | package com.ramine.loc.operations;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import com.ctc.wstx.util.StringUtil;
import com.ramine.loc.functions.StringUtils;
import com.ramine.loc.objects.MARC.MARCControlField;
import com.ramine.loc.objects.MARC.MARCDataField;
import com.ramine.loc.objects.MARC.MARCDataFieldSubField;
import com.ramine.loc.objects.MARC.MARCRecord;
import net.sf.json.JSONObject;
import net.sf.json.JSONSerializer;
import org.w3c.dom.Node;
import org.w3c.dom.Element;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
public class FileOperations {
private static final String String = null;
public static void LoadXMLFile(String filename, ArrayList<MARCRecord> records){
try{
File fXmlFile = new File(filename);
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(fXmlFile);
//optional, but recommended
//read this - http://stackoverflow.com/questions/13786607/normalization-in-dom-parsing-with-java-how-does-it-work
doc.getDocumentElement().normalize();
System.out.println("Root element :" + doc.getDocumentElement().getNodeName());
NodeList nList = doc.getElementsByTagName("record");
System.out.println("----------------------------");
for (int temp = 0; temp < nList.getLength(); temp++) {
//create some MARC records
MARCRecord record = new MARCRecord();
Node nNode = nList.item(temp);
//System.out.println("\nCurrent Element :" + nNode.getNodeName());
if (nNode.getNodeType() == Node.ELEMENT_NODE) {
Element eElement = (Element) nNode;
record.leader = eElement.getElementsByTagName("leader").item(0).getTextContent();
//System.out.println("Leader : " + record.leader);
NodeList controlfieldsList = eElement.getElementsByTagName("controlfield");
for (int ctr = 0; ctr < controlfieldsList.getLength(); ctr++) {
Node ctrNode = controlfieldsList.item(ctr);
if (ctrNode.getNodeType() == Node.ELEMENT_NODE) {
Element ctrElement = (Element) ctrNode;
MARCControlField ctrField = new MARCControlField();
ctrField.tag = ctrElement.getAttribute("tag");
ctrField.content = ctrElement.getTextContent();
//System.out.println("controlfield tag: " + ctrField.tag);
//System.out.println("controlfield: " + ctrField.content);
record.controlList.add(ctrField);
}
}
NodeList tagList = eElement.getElementsByTagName("datafield");
for (int i = 0; i < tagList.getLength(); i++) {
Node tagNode = tagList.item(i);
if (tagNode.getNodeType() == Node.ELEMENT_NODE) {
Element tagElement = (Element) tagNode;
MARCDataField datafield = new MARCDataField();
datafield.ind1 = tagElement.getAttribute("ind1");
datafield.ind2 = tagElement.getAttribute("ind2");
datafield.tag = tagElement.getAttribute("tag");
//System.out.print("tagID: " + datafield.tag +" ");
//System.out.print("ind1: " +datafield.ind1 +" ");
//System.out.println("idn2: "+datafield.ind2 );
//and now the subfields
NodeList subfieldList = tagElement.getElementsByTagName("subfield");
for (int j = 0; j < subfieldList.getLength(); j++) {
Node subfieldNode = subfieldList.item(j);
if (subfieldNode.getNodeType() == Node.ELEMENT_NODE) {
Element subfieldElement = (Element) subfieldNode;
MARCDataFieldSubField subfield = new MARCDataFieldSubField();
subfield.code = subfieldElement.getAttribute("code");
subfield.content = subfieldElement.getTextContent();
//System.out.println("subfield code: " + subfield.code);
//System.out.println("subfield : " + subfield.content);
datafield.subfields.add(subfield);
}
}
record.datafields.add(datafield);
}
}
}
records.add(record);
}
System.out.println("Total Records added in this batch:" +records.size());
for(MARCRecord rcd: records){
//System.out.println(rcd.createJSONRecord().toString(4));
}
}catch(Exception e){
}
}
public static void LoadXMLFiles(String dir, ArrayList<MARCRecord> records ) {
File folder = new File(dir);
for (final File fileEntry : folder.listFiles()) {
if (fileEntry.isDirectory()) {
//listFilesForFolder(fileEntry);
} else {
System.out.println(fileEntry.getPath());
try {
LoadXMLFile(fileEntry.getPath(), records);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
public static void loadJSONObjects(String dir, ArrayList<MARCRecord> records ) {
File folder = new File(dir);
for (final File fileEntry : folder.listFiles()) {
if (fileEntry.isDirectory()) {
//listFilesForFolder(fileEntry);
} else {
System.out.println(fileEntry.getPath());
try {
loadJSONObject(records,fileEntry.getPath());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
public static void LoadAndSaveXMLFiles(String dir, ArrayList<MARCRecord> records ) {
File folder = new File(dir);
int pt = 0;
for (final File fileEntry : folder.listFiles()) {
if (fileEntry.isDirectory()) {
//listFilesForFolder(fileEntry);
} else {
System.out.println(fileEntry.getPath());
try {
LoadXMLFile(fileEntry.getPath(), records);
saveJSONtoFile(records, 10000, pt);
pt++;
records.clear();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
records.clear();
}
}
}
}
/**
* Filewriter to chunk the outputs into small enough files which wuill allow for them to be processsed int he future
*
* @param records
*/
public static void saveJSONtoFile(ArrayList<MARCRecord> records, int maxRecordsPerFile, int pt) throws Exception{
int cnt = 0;
FileWriter fw = new FileWriter("output_pt_"+pt+".json");
BufferedWriter bw = new BufferedWriter(fw);
for(MARCRecord record : records){
if(cnt > maxRecordsPerFile){
pt++;
cnt = 0;
bw.close();
fw.close();
fw = new FileWriter("output_pt_"+pt+".json");
bw = new BufferedWriter(fw);
}else{
bw.write(record.createJSONRecord().toString()+"\n");
cnt++ ;
}
}
}
public static ArrayList<MARCRecord> loadJSONObject(ArrayList<MARCRecord> records, String filename){
try{
FileReader fr = new FileReader(filename);
BufferedReader bufferedReader = new BufferedReader(fr);
String currentLine = "";
while ((currentLine = bufferedReader.readLine()) != null) {
MARCRecord recrd = new MARCRecord();
if(StringUtils.isPureAscii(currentLine)){
recrd.loadJSONFile((JSONObject) JSONSerializer.toJSON(currentLine));
records.add(recrd);
}
}
}catch(Exception e){
//e.printStackTrace();
}
return records;
}
public static void main(String[] args){
}
}
| [
"raminetinati@gmail.com"
] | raminetinati@gmail.com |
7b9fa8ca1f2e369c0bf058695003af211c9e3a3e | 559ea64c50ae629202d0a9a55e9a3d87e9ef2072 | /com/ifoer/expedition/BluetoothOrder/StatisticHelper.java | c953b67ede41a83f397b25c8c09617ddbb3dce3c | [] | no_license | CrazyWolf2014/VehicleBus | 07872bf3ab60756e956c75a2b9d8f71cd84e2bc9 | 450150fc3f4c7d5d7230e8012786e426f3ff1149 | refs/heads/master | 2021-01-03T07:59:26.796624 | 2016-06-10T22:04:02 | 2016-06-10T22:04:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 997 | java | package com.ifoer.expedition.BluetoothOrder;
public class StatisticHelper {
int bytesPerSecond;
int deltaBytes;
long deltaTimeInMillis;
int restTimeInSeconds;
public void calcResults(long restBytes, int deltaBytes, long startTime, long endTime) {
this.deltaTimeInMillis = endTime - startTime;
if (this.deltaTimeInMillis != 0) {
this.bytesPerSecond = (int) (((long) (deltaBytes * 1000)) / this.deltaTimeInMillis);
this.restTimeInSeconds = (int) (restBytes / ((long) this.bytesPerSecond));
return;
}
this.bytesPerSecond = 60;
this.restTimeInSeconds = 60;
}
public int getRestSeconds() {
return this.restTimeInSeconds % 60;
}
public int getRestMinutes() {
return this.restTimeInSeconds / 60;
}
public int getRestHours() {
return this.restTimeInSeconds / 3600;
}
public int getTransmissionSpeed() {
return this.bytesPerSecond;
}
}
| [
"ahhmedd16@hotmail.com"
] | ahhmedd16@hotmail.com |
345258e1d46b9ddc27bcf16fae32160c290d7269 | 4480db5f737c02ab52f72a8c1acd9180afd624ee | /net/minecraft/server/NetworkMasterThread.java | b937979bbfe7af4a04932ca95e4b593a3b453d0c | [] | no_license | CollinJ/mc-dev | 61850bb8ae68e57b5bef35f847ba5979ce2b66df | 3dcb2867b9995dba1f06ec51ffaa31c2f61ee5c1 | refs/heads/master | 2020-12-25T07:16:56.461543 | 2011-01-27T03:20:05 | 2011-01-27T03:20:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 803 | java | package net.minecraft.server;
class NetworkMasterThread extends Thread {
final NetworkManager a; /* synthetic field */
NetworkMasterThread(NetworkManager networkmanager) {
super();
a = networkmanager;
}
public void run() {
try {
Thread.sleep(5000L);
if (NetworkManager.e(a).isAlive()) {
try {
NetworkManager.e(a).stop();
} catch (Throwable throwable) {}
}
if (NetworkManager.f(a).isAlive()) {
try {
NetworkManager.f(a).stop();
} catch (Throwable throwable1) {}
}
} catch (InterruptedException interruptedexception) {
interruptedexception.printStackTrace();
}
}
}
| [
"erikbroes@grum.nl"
] | erikbroes@grum.nl |
42896d8993fe39f7b1d875ac4d5af134bdbf84ab | 6b7a6574ce1e1225d72de3fd001c4e963f2ceb6b | /GratextServer/src/gratext/server/dispositivos/sensores/Pulsometro.java | ffca6943c0cf8c3b659d0adc727055c0ed91cd19 | [] | no_license | debenito/GratextEjemplos | bdcf9b2fbc783e683c7fae757ce3b20a106608b5 | 40e3314d3692687468f62aa6c6815bf91135bef0 | refs/heads/master | 2020-12-30T12:00:48.136077 | 2017-07-05T15:43:56 | 2017-07-05T15:43:56 | 91,492,228 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,341 | java | package gratext.server.dispositivos.sensores;
/**
* Clase encargada del sensor del pulsometro de los animales
*/
import gratext.server.dispositivos.acciones.Acciones;
import gratext.server.dispositivos.acciones.Estado;
import java.util.List;
import java.util.Random;
public class Pulsometro extends Sensores implements SensoresAutomaticos {
/**
* Constructor que devuelve el nombre del sensor y el numero
*
* @param numero
*/
public Pulsometro(int numero) {
super("PULSOMETRO_GANADO", numero);
}
/**
* Metodo que devuelve el codigo del sensor
*/
@Override
protected String codigoSensores() {
if (contador == 3)
cambiarEstado();
return "H" + numero;
}
/**
* Metodo que devuelve la lista de acciones que puede realizar el sensor
*/
@Override
protected List<Acciones> inicializarAcciones(List<Acciones> acciones) {
Estado e = new Estado("PULSACIONES_CORRECTAS", 70);
acciones.add(e);
servicios.add(e);
return acciones;
}
/**
* Metodo que devuelve el dato
*/
@Override
public String Dato() {
return "int";
}
/**
* Metodo que cambia el estado del sensor
*/
@Override
public void cambiarEstado() {
contador = 0;
Random r = new Random();
int nuevo = r.nextInt(100);
removeServicio();
Estado e = new Estado(nuevo + "pulsaciones/min", nuevo);
addServicio(e);
}
}
| [
"debenito4@gmail.com"
] | debenito4@gmail.com |
79188f9b98f91c2b1a41b68d4d2e50bd5c0d4782 | 37cd0270e4ccda8d02900ad53c55deca1316e14e | /src/it/gioaudino/game/Service/MessageHandler.java | e3c07344c8960adf6980917d81c94957bba72836 | [] | no_license | gioaudino/p2pgame | 53354af419256f86f6f7291939aab42bcb5659da | d32c880d996d4db2aecf6b647b2fee6eb4194423 | refs/heads/master | 2020-12-02T21:01:12.138739 | 2017-07-15T12:40:32 | 2017-07-15T12:40:32 | 96,245,384 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,781 | java | package it.gioaudino.game.Service;
import it.gioaudino.game.Client.Player;
import it.gioaudino.game.Entity.*;
import it.gioaudino.game.Simulator.BombReceived;
import java.io.IOException;
import java.net.Socket;
import java.util.ListIterator;
import java.util.Map;
import java.util.NoSuchElementException;
/**
* Created by gioaudino on 01/06/17.
* Package it.gioaudino.game.Service in game
*/
public class MessageHandler {
public static Message handleMessage(Player player, Message message) {
if (player.getStatus() == ClientStatus.STATUS_NOT_PLAYING)
return buildResponseMessage(player, MessageType.TYPE_ACK);
switch (message.getType()) {
case TYPE_NEW:
return newPlayer(player, message);
case TYPE_TOKEN:
return token(player);
case TYPE_FIND_POSITION:
return findPosition(player, message);
case TYPE_QUIT:
return quit(player, message);
case TYPE_BOMB_THROWN:
return bombThrown(player, message);
case TYPE_BOMB_EXPLODED:
return bombExploded(player, message);
case TYPE_BOMB_DEAD:
return bombDead(player, message);
case TYPE_DEAD:
return dead(player, message);
case TYPE_WIN:
return win(player, message);
case TYPE_MOVE:
return move(player, message);
default:
return buildResponseMessage(player, MessageType.TYPE_PROBLEM);
}
}
private static Message bombDead(Player player, Message message) {
if (player.getUser().equals(message.getKiller())) {
new Thread(() -> player.increaseBombScore(message.getBomb(), message.getSender())).start();
}
removeSocketAndSetNext(player, message);
return buildResponseMessage(player, MessageType.TYPE_ACK);
}
private static Message move(Player player, Message message) {
if (player.getPosition().equals(message.getPosition())) {
player.setStatus(ClientStatus.STATUS_DEAD);
new Thread(() -> player.die(message.getSender(), null)).start();
}
return buildResponseMessage(player, MessageType.TYPE_ACK);
}
private static Message dead(Player player, Message message) {
if (player.getUser().equals(message.getKiller())) {
new Thread(() -> player.increaseScore(message.getSender())).start();
}
removeSocketAndSetNext(player, message);
return buildResponseMessage(player, MessageType.TYPE_ACK);
}
private static Message quit(Player player, Message message) {
removeSocketAndSetNext(player, message);
return buildResponseMessage(player, MessageType.TYPE_ACK);
}
public static void removeSocketAndSetNext(Player player, Message message) {
if (player.getConnections().size() == 1 && getCanonicalRemoteAddress(player.getConnections().get(0)).equals(message.getSender().toString())) {
player.clearConnections();
player.clearNext();
return;
}
Socket newNext = null;
Socket toBeRemoved = null;
ListIterator<Socket> sockets = player.getConnections().listIterator();
while (sockets.hasNext()) {
Socket s = sockets.next();
String canonicalAddress = getCanonicalRemoteAddress(s);
if (canonicalAddress.equals(message.getSender().toString())) {
toBeRemoved = s;
newNext = sockets.hasNext() ? sockets.next() : player.getConnections().get(0);
break;
}
}
player.removeConnection(toBeRemoved);
try {
toBeRemoved.close();
} catch (IOException | NullPointerException ignored) {
}
if (newNext != null)
player.setNext(newNext);
}
private static Message findPosition(Player player, Message message) {
Position position = message.getPosition();
if (player.getPosition() != null && player.getPosition().equals(position))
return buildResponseMessage(player, MessageType.TYPE_NACK);
return buildResponseMessage(player, MessageType.TYPE_ACK);
}
private static Message newPlayer(Player player, Message message) {
User sender = message.getSender();
try {
Socket socket = new Socket(sender.getAddress(), sender.getPort());
player.addConnection(socket);
try {
if (null == player.getNext()) {
player.setNext();
} else {
Map.Entry<String, User> fst = player.getGame().getUsers().entrySet().iterator().next();
if (getCanonicalRemoteAddress(player.getNext()).equals(fst.getValue().toString())) {
player.setNext(socket);
}
}
} catch (NoSuchElementException e) {
player.setNext();
}
return buildResponseMessage(player, MessageType.TYPE_ACK);
} catch (IOException ignored) {
}
return null;
}
private static Message token(Player player) {
while (player.getNext() != null && player.token.getStatus()) /* NO-OP */ ;
player.token.unlock();
return buildResponseMessage(player, MessageType.TYPE_ACK);
}
private static Message win(Player player, Message message) {
new Thread(() -> player.endGame(message.getSender())).start();
return buildResponseMessage(player, MessageType.TYPE_ACK);
}
private static Message bombThrown(Player player, Message message) {
player.getOutputPrinter().println("•*•*•*• A bomb was thrown! •*•*•*•");
player.getOutputPrinter().println(message.getSender().getUsername() + " has thrown a " + message.getBomb().getZone().toString().toLowerCase() + " bomb");
new Thread(new BombReceived(player, message.getBomb())).start();
return buildResponseMessage(player, MessageType.TYPE_ACK);
}
private static Message bombExploded(Player player, Message message) {
new Thread(() -> player.bombExploded(message.getBomb())).start();
return buildResponseMessage(player, MessageType.TYPE_ACK);
}
private static Message buildResponseMessage(Player player, MessageType messageType) {
Message message = new Message();
message.setSender(player.getUser());
message.setType(messageType);
return message;
}
private static String getCanonicalRemoteAddress(Socket socket) {
return socket.getInetAddress().getCanonicalHostName() + ":" + socket.getPort();
}
}
| [
"gioaudino91@gmail.com"
] | gioaudino91@gmail.com |
999397a0dbf423e59d0b00ad92f07495a43eabdb | 6873eacca9437e712c77e8ef7089c44fbe65a6d4 | /src/semestralka1_us2/Utilities/ZadaniaText.java | c1a12290d43cadf8a314045bcaf71fae9e3ce564 | [] | no_license | Flashikez/Data-Management | 9cbb1fbb0d6bf3454523b9e4180cdfcd9b97aa8e | f2fe5fed32eea14898ac7c027f95b2ee1820682c | refs/heads/master | 2022-11-20T08:00:57.095505 | 2020-07-10T09:01:05 | 2020-07-10T09:01:05 | 278,587,629 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,424 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package semestralka1_us2.Utilities;
/**
* Trieda obsahujúce texty jednotlivých zadaní
* @author MarekPC
*/
public class ZadaniaText {
public static String ZADANIE_1 = "Vyhľadanie nehnuteľnosti podľa súpisného čísla a čísla katastrálneho územia.\n"
+ "Po nájdení nehnuteľnosti je potrebné zobraziť všetky evidované údaje vrátane všetkých\n"
+ "údajov z listu vlastníctva na ktorom je nehnuteľnosť zapísaná. ";
public static String ZADANIE_2 = "Vyhľadanie obyvateľa podľa rodného čísla a výpis jeho trvalého pobytu (vypíšu sa\n"
+ "všetky informácie o nehnuteľnosti, ktorú obýva).";
public static String ZADANIE_3 = "Výpis všetkých osôb, ktoré majú trvalý pobyt v zadanej nehnuteľnosti (zadá sa číslo\n"
+ "katastrálneho územia, číslo listu vlastníctva a súpisné číslo).";
public static String ZADANIE_4 = "Vyhľadanie listu vlastníctva podľa jeho čísla a čísla katastrálneho územia. Po nájdení\n"
+ "listu vlastníctva je potrebné zobraziť všetky evidované údaje vrátane všetkých údajov\n"
+ "o majiteľoch nehnuteľností zapísaných na liste vlastníctva (mená, priezviská, majetkové\n"
+ "podiely...). ";
public static String ZADANIE_5 = "Vyhľadanie nehnuteľnosti podľa súpisného čísla a názvu katastrálneho územia.\n"
+ "Po nájdení nehnuteľnosti je potrebné zobraziť všetky evidované údaje vrátane všetkých\n"
+ "údajov z listu vlastníctva na ktorom je nehnuteľnosť zapísaná. ";
public static String ZADANIE_6 = "Vyhľadanie listu vlastníctva podľa jeho čísla a názvu katastrálneho územia. Po nájdení\n"
+ "listu vlastníctva je potrebné zobraziť všetky evidované údaje vrátane všetkých údajov\n"
+ "o majiteľoch nehnuteľností zapísaných na liste vlastníctva (mená, priezviská, majetkové\n"
+ "podiely...). ";
public static String ZADANIE_7 = "Výpis nehnuteľností v zadanom katastrálnom území (definované názvom) utriedených\n"
+ "podľa ich súpisných čísel aj s ich popisom.";
public static String ZADANIE_8 = "Výpis všetkých nehnuteľností majiteľa (definovaný rodným číslom) v zadanom\n"
+ "katastrálnom území (definované jeho číslom) aj s jeho majetkovými podielmi na nich.";
public static String ZADANIE_9 = "Výpis všetkých nehnuteľností majiteľa (definovaný rodným číslom) aj s jeho\n"
+ "majetkovými podielmi na nich";
public static String ZADANIE_10 = ". Zápis nového trvalého pobytu obyvateľa (definovaný rodným číslom) do nehnuteľnosti\n"
+ "(definovaná súpisným číslom) v zadanom katastrálnom území (definované jeho\n"
+ "názvom)";
public static String ZADANIE_11 = "Zmena majiteľa (definovaný rodným číslom) nehnuteľnosti (definovaná súpisným\n"
+ "číslom) v zadanom katastrálnom území (definované jeho číslom). Nový majiteľ je\n"
+ "definovaný rodným číslom. ";
public static String ZADANIE_12 = "Zapísanie/Zmena majetkového podielu majiteľa (definovaný rodným číslom) na list\n"
+ "vlastníctva (definovaný číslom) v zadanom katastrálnom území (definované jeho\n"
+ "číslom). Zároveň sa nastavia nové majetkové podiely ostatných vlastníkov (definovaní\n"
+ "svojim rodným číslom)";
public static String ZADANIE_13 = ". Odstránenie majetkového podielu majiteľa (definovaný rodným číslom) z listu\n"
+ "vlastníctva (definovaný číslom) v zadanom katastrálnom území (definované jeho\n"
+ "číslom). Zároveň sa nastavia nové majetkové podiely ostatných vlastníkov (definovaní\n"
+ "svojim rodným číslom)";
public static String ZADANIE_14 = "Výpis všetkých katastrálnych území utriedených podľa ich názvov.";
public static String ZADANIE_15 = "Pridanie občana.";
public static String ZADANIE_16 = "Pridanie listu vlastníctva do zadaného katastrálneho územia (definované názvom)";
public static String ZADANIE_17 = "Pridanie nehnuteľnosti na list vlastníctva (definovaný číslom) v zadanom katastrálnom\n"
+ "území (definované jeho číslom).";
public static String ZADANIE_18 = "Odstránenie listu vlastníctva (definovaný číslom) v zadanom katastrálnom území\n"
+ "(definované jeho číslom). Nehnuteľnosti a majetkové podiely sa presunú na iný list\n"
+ "vlastníctva (definovaný číslom).";
public static String ZADANIE_19 = "Odstránenie nehnuteľnosti (definovaná popisným číslom) z listu vlastníctva (definovaný\n"
+ "číslom) v zadanom katastrálnom území (definované jeho číslom).";
public static String ZADANIE_20 = "Pridanie katastrálneho územia";
public static String ZADANIE_21 = "Odstránenie katastrálneho územia (definované jeho číslom). Agenda sa presunie do\n"
+ "iného katastrálneho územia (definované jeho číslom).";
}
| [
"kuko9990@gnail.com"
] | kuko9990@gnail.com |
1dcf206e964a6f18f4e584549ddb5b8c9e8270c4 | 90940f87559bc3b43f57e35f6c63e0467a4c55a5 | /javaproject/airport/src/airport/logwindow.java | 3380dfa61dc73bc0e01881a0caa230fdd9a81424 | [] | no_license | Mnting/TO-SEE-THE-WORLD | c9fb93372ad67940f64958f6e55219d9630ce084 | c84e118058b94cc8618899e4b5a4ada74a0b26f8 | refs/heads/master | 2021-01-23T18:30:59.855647 | 2019-03-02T05:59:26 | 2019-03-02T05:59:26 | 102,795,123 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,365 | java | package airport;
import java.awt.Color;
import java.awt.Dialog;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Window;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.sql.SQLException;
import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.FocusManager;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPasswordField;
import java.awt.event.MouseAdapter;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
class JJPasswordField extends JPasswordField{
/**
*
*/
private static final long serialVersionUID = 1L;
String sstr=null;
public JJPasswordField(String str){
sstr=str;
}
protected void paintComponent(java.awt.Graphics g) {
super.paintComponent(g);
if (getText().isEmpty() && !(FocusManager.getCurrentKeyboardFocusManager().getFocusOwner() == this)) {
Graphics2D g2 = (Graphics2D) g.create();
g2.setFont(new Font("Verdana",Font.PLAIN,16));
g2.setColor(Color.gray);
g2.drawString(this.sstr,10,25); // figure out x, y from font's
// FontMetrics and size of
// component.
g2.dispose();
}
}
}
public class logwindow {
public static String nowuser = null;
static JJFrame frame;
private JJTextField textField;
private JLabel label;
private JLabel label_1;
static String str;
/**
* Launch the application.
*/
private JPasswordField passwordField;
private JLabel label_2;
private JButton btnNewButton_2;
public static void main(String args) {
str=args;
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
logwindow window = new logwindow();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public logwindow() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JJFrame(str);
frame.setBounds(100, 100, 666, 520);
//frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
textField = new JJTextField("Username(phone-number)");
textField.setBounds(213, 149, 230, 35);
frame.getContentPane().add(textField);
passwordField = new JJPasswordField("Password");
passwordField.setBounds(213, 215, 230, 35);
passwordField.addKeyListener(new KeyListener(){
@Override
public void keyTyped(KeyEvent e) {
// TODO Auto-generated method stub
}
@Override
public void keyPressed(KeyEvent e) {
// TODO Auto-generated method stub
if(e.getKeyChar()==KeyEvent.VK_ENTER)
{
UserInformation.username=textField.getText();
UserInformation.password1=passwordField.getText();
try {
try {
if(UserInformation.checkpassword()==true)
{
MainHome.lblNewLabel_1.setText("尊敬的用户:"+textField.getText());
MainHome.logflag = 1;
nowuser = textField.getText();
; MainHome.lblNewLabel1.setVisible(false);
MainHome.logout.setVisible(true);
MainHome.label_1.setVisible(false);
frame.setVisible(false);
}
} catch (ClassNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
@Override
public void keyReleased(KeyEvent e) {
// TODO Auto-generated method stub
}
});
frame.getContentPane().add(passwordField);
JButton btnNewButton = new JButton("登录");
btnNewButton.setBounds(213, 279, 100, 29);
btnNewButton.addMouseListener(new MouseListener(){
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
UserInformation.username=textField.getText();
UserInformation.password1=passwordField.getText();
try {
try {
if(UserInformation.checkpassword()==true)
{
MainHome.lblNewLabel_1.setText("尊敬的用户:"+textField.getText());
MainHome.logflag = 1;
nowuser = textField.getText();
MainHome.logout.setVisible(true);
MainHome.label_1.setVisible(false);
MainHome.lblNewLabel1.setVisible(false);
frame.setVisible(false);
}
else{
JOptionPane.showMessageDialog(null, "账户密码错误", "账户密码错误", JOptionPane.ERROR_MESSAGE);
}
} catch (ClassNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
}
});
frame.getContentPane().add(btnNewButton);
label_2 = new JLabel("注册成功");
label_2.setVisible(false);
label_2.setBounds(213, 250, 61, 16);
frame.getContentPane().add(label_2);
JButton btnNewButton_1 = new JButton("注册");
btnNewButton_1.addMouseListener(new MouseListener() {
@Override
public void mouseClicked(MouseEvent e) {
UserInformation.username=textField.getText();
UserInformation.password1=passwordField.getText();
try {
if(UserInformation.checkusername()==true)
{
MainHome.lblNewLabel_1.setText("尊敬的用户:"+textField.getText());
MainHome.logflag = 1;
nowuser = textField.getText();
MainHome.logout.setVisible(true);
MainHome.lblNewLabel1.setVisible(false);
MainHome.label_1.setVisible(false);
frame.setVisible(false);
}
} catch (ClassNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
}
});
btnNewButton_1.setBounds(321, 279, 100, 29);
frame.getContentPane().add(btnNewButton_1);
label = new JLabel("用户名:");
label.setBounds(213, 121, 61, 16);
frame.getContentPane().add(label);
label_1 = new JLabel("密码:");
label_1.setBounds(213, 187, 61, 16);
frame.getContentPane().add(label_1);
btnNewButton_2 = new JButton("");
btnNewButton_2.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
frame.setVisible(false);
}
});
btnNewButton_2.setBounds(640, 0, 26, 26);
frame.getContentPane().add(btnNewButton_2);
}
}
| [
"31748932+Mnting@users.noreply.github.com"
] | 31748932+Mnting@users.noreply.github.com |
8a6f339f25a6e74b268d6ecc884850912cecd98c | 3db0cbd0e5b009008d975798dffe50127a167c89 | /src/com/github/unchama/seichiassist/SerializeItemStackList.java | bd4ceb4229bdae8e3cf846d9618903857ca0465b | [] | no_license | kakun-1218/SeichiAssist | a6917cc024d4854ac093d830a85e00f032ce98bf | 0837f764f2306156cd305409cf6212dfcdceecea | refs/heads/master | 2021-01-17T23:36:31.688572 | 2016-08-01T23:09:22 | 2016-08-01T23:09:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,218 | java | package com.github.unchama.seichiassist;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.bukkit.Material;
import org.bukkit.configuration.serialization.ConfigurationSerialization;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
public final class SerializeItemStackList {
public final static List<HashMap<Map<String, Object>, Map<String, Object>>> serializeItemStackList(final ItemStack[] itemStackList) {
final List<HashMap<Map<String, Object>, Map<String, Object>>> serializedItemStackList = new ArrayList<HashMap<Map<String, Object>, Map<String, Object>>>();
for (ItemStack itemStack : itemStackList) {
Map<String, Object> serializedItemStack, serializedItemMeta;
HashMap<Map<String, Object>, Map<String, Object>> serializedMap = new HashMap<Map<String, Object>, Map<String, Object>>();
if (itemStack == null) itemStack = new ItemStack(Material.AIR);
serializedItemMeta = (itemStack.hasItemMeta())
? itemStack.getItemMeta().serialize()
: null;
itemStack.setItemMeta(null);
serializedItemStack = itemStack.serialize();
serializedMap.put(serializedItemStack, serializedItemMeta);
serializedItemStackList.add(serializedMap);
}
return serializedItemStackList;
}
public final static ItemStack[] deserializeItemStackList(final List<HashMap<Map<String, Object>, Map<String, Object>>> serializedItemStackList) {
final ItemStack[] itemStackList = new ItemStack[serializedItemStackList.size()];
int i = 0;
for (HashMap<Map<String, Object>, Map<String, Object>> serializedItemStackMap : serializedItemStackList) {
Entry<Map<String, Object>, Map<String, Object>> serializedItemStack = serializedItemStackMap.entrySet().iterator().next();
ItemStack itemStack = ItemStack.deserialize(serializedItemStack.getKey());
if (serializedItemStack.getValue() != null) {
ItemMeta itemMeta = (ItemMeta)ConfigurationSerialization.deserializeObject(serializedItemStack.getValue(), ConfigurationSerialization.getClassByAlias("ItemMeta"));
itemStack.setItemMeta(itemMeta);
}
itemStackList[i++] = itemStack;
}
return itemStackList;
}
} | [
"tar0sscom@gmail.com"
] | tar0sscom@gmail.com |
9839d857d4f9d931dbf47c3190d990a441d031f1 | 96083219d9ec1a9963e5b134ba080f726119b65f | /src/android/media/AudioPatch.java | 51da9437953f6eadc2701feefa977b1ef5aee42b | [] | no_license | rajatgupta1998/packages_apps_MusicFX | 484d91e01b1a9d2107c4664889ada957430a3607 | 914cb57a93b5811dd84349d55228aed7beb2bfbe | refs/heads/master | 2020-04-22T00:14:16.192475 | 2019-02-22T17:23:18 | 2019-02-22T17:23:18 | 169,972,135 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,429 | java | /*
* Copyright (C) 2014 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 android.media;
/**
* An AudioPatch describes a connection between audio sources and audio sinks.
* An audio source can be an output mix (playback AudioBus) or an input device (microphone).
* An audio sink can be an output device (speaker) or an input mix (capture AudioBus).
* An AudioPatch is created by AudioManager.createAudioPatch() and released by
* AudioManager.releaseAudioPatch()
* It contains the list of source and sink AudioPortConfig showing audio port configurations
* being connected.
*
* @hide
*/
public class AudioPatch {
private final AudioHandle mHandle;
private final AudioPortConfig[] mSources;
private final AudioPortConfig[] mSinks;
AudioPatch(AudioHandle patchHandle, AudioPortConfig[] sources, AudioPortConfig[] sinks) {
mHandle = patchHandle;
mSources = sources;
mSinks = sinks;
}
/**
* Retrieve the list of sources of this audio patch.
*/
public AudioPortConfig[] sources() {
return mSources;
}
/**
* Retreive the list of sinks of this audio patch.
*/
public AudioPortConfig[] sinks() {
return mSinks;
}
/**
* Get the system unique patch ID.
*/
public int id() {
return mHandle.id();
}
@Override
public String toString() {
StringBuilder s = new StringBuilder();
s.append("mHandle: ");
s.append(mHandle.toString());
s.append(" mSources: {");
for (AudioPortConfig source : mSources) {
s.append(source.toString());
s.append(", ");
}
s.append("} mSinks: {");
for (AudioPortConfig sink : mSinks) {
s.append(sink.toString());
s.append(", ");
}
s.append("}");
return s.toString();
}
} | [
"azaidi@live.nl"
] | azaidi@live.nl |
903b9cce2ef8318ac068303ffa5680b2bf2e8e4a | 3b2b894bc4bab6ec14c4aedd78263e23b8dec114 | /web/src/main/java/com/recse4cloud/web/xss/XssFilter.java | 60f12503bdd6321183cd9818df78e9478d219bfa | [] | no_license | yyyyqq/recse | b01b1db8278909f5ab94a5522cc8992385eafeb7 | 8703b515eb2612604146c9d4bbae2ac902489566 | refs/heads/master | 2022-07-03T15:09:01.166728 | 2019-07-13T10:24:30 | 2019-07-13T10:24:30 | 196,330,282 | 3 | 0 | null | 2022-06-17T02:16:21 | 2019-07-11T06:08:13 | Java | UTF-8 | Java | false | false | 989 | java | package com.recse4cloud.web.xss;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
* XSS攻击过滤器
*/
public class XssFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
String path = ((HttpServletRequest) servletRequest).getServletPath();
if (path.contains("/css") || path.contains("/js") || path.contains("/images") || path.contains("/fonts")) {
filterChain.doFilter(servletRequest, servletResponse);
} else {
HttpServletRequest request = new XssHttpServletRequestWrapper((HttpServletRequest) servletRequest);
filterChain.doFilter(request, servletResponse);
}
}
@Override
public void destroy() {
}
}
| [
"ayyq7866189"
] | ayyq7866189 |
319a0b53686a141a24990086c6e421987c7c884b | f3e6a4e6010f76be40e80fa18392ec004507f9f7 | /bojha/test/ht/MeMomTest.java | f8530a0e70d7875a024cdfa2f6de4ee7a4a66779 | [] | no_license | Fawzy1/allgo | be1008e003e39e32a6f76e3c5fb145c16e6a6fec | 3516e52541884f767dc590e3544f1e5291b25d5e | refs/heads/master | 2021-01-19T23:24:48.757555 | 2016-03-08T16:55:21 | 2016-03-08T16:55:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,117 | java | package ht;
import org.junit.Assert;
import org.junit.Test;
public class MeMomTest {
@Test
public void testSeating() {
MeMom me = new MeMom();
MeMom.Bus bus = me.new Bus(new String[]{"3 2","1","2","1 2"});
bus.process();
Assert.assertNotNull(bus);
bus.printOccupancy();
String seatingArrangement = bus.printFinalSeats();
System.out.println(seatingArrangement);
Assert.assertEquals("1 3", seatingArrangement);
Assert.assertTrue("1 3".equals(seatingArrangement));
bus = me.new Bus(new String[]{"3 2","1","3","1 2 3"});
bus.process();
Assert.assertNotNull(bus);
bus.printOccupancy();
seatingArrangement = bus.printFinalSeats();
System.out.println(seatingArrangement);
Assert.assertEquals("1 3 2", seatingArrangement);
Assert.assertTrue("1 3 2".equals(seatingArrangement));
bus = me.new Bus(new String[]{"3 2","3","3","1 2 3"});
bus.process();
Assert.assertNotNull(bus);
bus.printOccupancy();
seatingArrangement = bus.printFinalSeats();
System.out.println(seatingArrangement);
Assert.assertEquals("3 1 2", seatingArrangement);
Assert.assertTrue("3 1 2".equals(seatingArrangement));
bus = me.new Bus(new String[]{"3 2","2","3","1 2 3"});
bus.process();
Assert.assertNotNull(bus);
bus.printOccupancy();
seatingArrangement = bus.printFinalSeats();
System.out.println(seatingArrangement);
Assert.assertEquals("2 1 3", seatingArrangement);
Assert.assertTrue("2 1 3".equals(seatingArrangement));
bus = me.new Bus(new String[]{"5 5","5","3","1 3 5"});
bus.process();
Assert.assertNotNull(bus);
bus.printOccupancy();
seatingArrangement = bus.printFinalSeats();
System.out.println(seatingArrangement);
Assert.assertEquals("5 3 4", seatingArrangement);
Assert.assertTrue("5 3 4".equals(seatingArrangement));
bus = me.new Bus(new String[]{"5 5","1","3","1 3 5"});
bus.process();
Assert.assertNotNull(bus);
bus.printOccupancy();
seatingArrangement = bus.printFinalSeats();
System.out.println(seatingArrangement);
Assert.assertEquals("1 3 4", seatingArrangement);
Assert.assertTrue("1 3 4".equals(seatingArrangement));
bus = me.new Bus(new String[]{"5 5","3","3","1 3 5"});
bus.process();
Assert.assertNotNull(bus);
bus.printOccupancy();
seatingArrangement = bus.printFinalSeats();
System.out.println(seatingArrangement);
Assert.assertEquals("3 5 4", seatingArrangement);
Assert.assertTrue("3 5 4".equals(seatingArrangement));
bus = me.new Bus(new String[]{"5 5","2","3","1 3 5"});
bus.process();
Assert.assertNotNull(bus);
bus.printOccupancy();
seatingArrangement = bus.printFinalSeats();
System.out.println(seatingArrangement);
Assert.assertEquals("2 1 4", seatingArrangement);
Assert.assertTrue("2 1 4".equals(seatingArrangement));
bus = me.new Bus(new String[]{"20000 5","2","3","1 2 3"});
bus.process();
Assert.assertNotNull(bus);
// bus.printOccupancy();
seatingArrangement = bus.printFinalSeats();
System.out.println(seatingArrangement);
// Assert.assertEquals("2 1 4", seatingArrangement);
// Assert.assertTrue("2 1 4".equals(seatingArrangement));
}
}
| [
"debmalya.jash@gmail.com"
] | debmalya.jash@gmail.com |
08dc474f5614e002c39e7dd62f90ca9240ba6ad8 | 01745fe30e5220e5e3e61ec51e4d4c7759167c52 | /app/src/main/java/com/cse25/medicaid/features/UpdateDonorActivity.java | 6397154a0e26a284ae59991bb65b71bf349746c2 | [] | no_license | Fahim45/MedicAid | 69c619e4efeb4ec8544ef939992c874b0cf08b88 | 6f3387e1079c397bdec92140bfc27c3443507bb6 | refs/heads/master | 2023-03-09T15:04:51.959571 | 2021-02-23T18:26:35 | 2021-02-23T18:26:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 696 | java | package com.cse25.medicaid.features;
import com.cse25.medicaid.R;
import com.cse25.medicaid.support.BaseActivity;
public class UpdateDonorActivity extends BaseActivity {
@Override
protected String setActionBarTitle() {
return "Update Donor";
}
@Override
protected String setDebugTag() {
return "UpdateDonorActivity";
}
@Override
protected int getLayoutId() {
return R.layout.activity_update_donor;
}
@Override
protected boolean doYouWantToEnableBackButton() {
return false;
}
@Override
protected void initViewComponents() {
}
@Override
protected void addObserversAndHandlers() {
}
}
| [
"slyfox741@gmail.com"
] | slyfox741@gmail.com |
168478a68162559c4f7b6a647a05dfe7bc87cabb | 2eee2ee1add568484d410aa301b64395c6066e8c | /app/src/main/java/com/example/minglishmantra_beta/CircleImageView.java | 7239bd34fe30136cf713a5f634bbea2b82c48dd8 | [] | no_license | git1998/MyTuation-App | 1351be43a1775d03ac51e9d78907af024a81de6a | f41a46db8da8749d403c5179d8a94ca1c460d62a | refs/heads/main | 2023-01-31T13:44:56.015054 | 2020-12-16T11:58:45 | 2020-12-16T11:58:45 | 321,900,104 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,484 | java | package com.example.minglishmantra_beta;/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RadialGradient;
import android.graphics.Shader;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.view.animation.Animation;
import android.widget.ImageView;
import androidx.core.view.ViewCompat;
/**
* Private class created to work around issues with AnimationListeners being
* called before the animation is actually complete and support shadows on older
* platforms.
*
* @hide
*/
class CircleImageView extends ImageView {
private static final int KEY_SHADOW_COLOR = 0x1E000000;
private static final int FILL_SHADOW_COLOR = 0x3D000000;
// PX
private static final float X_OFFSET = 0f;
private static final float Y_OFFSET = 1.75f;
private static final float SHADOW_RADIUS = 3.5f;
private static final int SHADOW_ELEVATION = 4;
private Animation.AnimationListener mListener;
private int mShadowRadius;
public CircleImageView(Context context, int color, final float radius) {
super(context);
final float density = getContext().getResources().getDisplayMetrics().density;
final int diameter = (int) (radius * density * 2);
final int shadowYOffset = (int) (density * Y_OFFSET);
final int shadowXOffset = (int) (density * X_OFFSET);
mShadowRadius = (int) (density * SHADOW_RADIUS);
ShapeDrawable circle;
if (elevationSupported()) {
circle = new ShapeDrawable(new OvalShape());
ViewCompat.setElevation(this, SHADOW_ELEVATION * density);
} else {
OvalShape oval = new OvalShadow(mShadowRadius, diameter);
circle = new ShapeDrawable(oval);
ViewCompat.setLayerType(this, ViewCompat.LAYER_TYPE_SOFTWARE, circle.getPaint());
circle.getPaint().setShadowLayer(mShadowRadius, shadowXOffset, shadowYOffset,
KEY_SHADOW_COLOR);
final int padding = (int) mShadowRadius;
// set padding so the inner image sits correctly within the shadow.
setPadding(padding, padding, padding, padding);
}
circle.getPaint().setColor(color);
setBackgroundDrawable(circle);
}
private boolean elevationSupported() {
return android.os.Build.VERSION.SDK_INT >= 21;
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if (!elevationSupported()) {
setMeasuredDimension(getMeasuredWidth() + mShadowRadius*2, getMeasuredHeight()
+ mShadowRadius*2);
}
}
public void setAnimationListener(Animation.AnimationListener listener) {
mListener = listener;
}
@Override
public void onAnimationStart() {
super.onAnimationStart();
if (mListener != null) {
mListener.onAnimationStart(getAnimation());
}
}
@Override
public void onAnimationEnd() {
super.onAnimationEnd();
if (mListener != null) {
mListener.onAnimationEnd(getAnimation());
}
}
/**
* Update the background color of the circle image view.
*/
public void setBackgroundColor(int colorRes) {
if (getBackground() instanceof ShapeDrawable) {
final Resources res = getResources();
((ShapeDrawable) getBackground()).getPaint().setColor(res.getColor(colorRes));
}
}
private class OvalShadow extends OvalShape {
private RadialGradient mRadialGradient;
private int mShadowRadius;
private Paint mShadowPaint;
private int mCircleDiameter;
public OvalShadow(int shadowRadius, int circleDiameter) {
super();
mShadowPaint = new Paint();
mShadowRadius = shadowRadius;
mCircleDiameter = circleDiameter;
mRadialGradient = new RadialGradient(mCircleDiameter / 2, mCircleDiameter / 2,
mShadowRadius, new int[] {
FILL_SHADOW_COLOR, Color.TRANSPARENT
}, null, Shader.TileMode.CLAMP);
mShadowPaint.setShader(mRadialGradient);
}
@Override
public void draw(Canvas canvas, Paint paint) {
final int viewWidth = CircleImageView.this.getWidth();
final int viewHeight = CircleImageView.this.getHeight();
canvas.drawCircle(viewWidth / 2, viewHeight / 2, (mCircleDiameter / 2 + mShadowRadius),
mShadowPaint);
canvas.drawCircle(viewWidth / 2, viewHeight / 2, (mCircleDiameter / 2), paint);
}
}
} | [
"abhibodulwar007@gmail.com"
] | abhibodulwar007@gmail.com |
15ba402d020e3d286dcef1b26c74555a6d3f9812 | d02da1985613d2de2c3a6b7542c596905004fa04 | /src/chapter1/Audience.java | ad40dc646396227a0a21a7d5a1eac17a7e9b0bd5 | [] | no_license | jee1994/ObjectPractice | 25c353550635ef0b96669c6ba8470c8e7e046a23 | 23bcc83296988cc241079c4c13a81bcd506e1c78 | refs/heads/master | 2022-02-21T17:16:02.779235 | 2019-10-18T01:40:41 | 2019-10-18T01:40:41 | 198,241,709 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 205 | java | package chapter1;
public class Audience {
private Bag bag;
public Audience(Bag bag) {
this.bag = bag;
}
public long buy(Ticket ticket) {
return bag.hold(ticket);
}
}
| [
"jeewoon.han@navercorp.com"
] | jeewoon.han@navercorp.com |
88acf96743bb319ffb7a07f0a18c69daf8ab0475 | 159a33213bfb16d89d6e8aae8bd11ffe783cc605 | /src/tst/project/bean/goods/GoodsImgBean.java | db5f378482f6b51322819ef32d693f40df421eb3 | [] | no_license | sw0928/word | 999a4bdc321775dcd96c7a9e62482b093dfb1025 | 4a572c3aedf111f3b9cc42f1a483a5ab74b54aca | refs/heads/master | 2021-01-06T20:44:19.839442 | 2017-08-08T10:13:41 | 2017-08-08T10:13:41 | 99,550,516 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 785 | java | package tst.project.bean.goods;
public class GoodsImgBean {
private String goods_img_id;
private String goods_id;
private String goods_img;
private String sort;
public String getSort() {
return sort;
}
public GoodsImgBean setSort(String sort) {
this.sort = sort;
return this;
}
public String getGoods_img_id() {
return goods_img_id;
}
public GoodsImgBean setGoods_img_id(String goods_img_id) {
this.goods_img_id = goods_img_id;
return this;
}
public String getGoods_id() {
return goods_id;
}
public GoodsImgBean setGoods_id(String goods_id) {
this.goods_id = goods_id;
return this;
}
public String getGoods_img() {
return goods_img;
}
public GoodsImgBean setGoods_img(String goods_img) {
this.goods_img = goods_img;
return this;
}
}
| [
"shiwei@163.com"
] | shiwei@163.com |
02996196104abd79b0197292e728055320976e8c | 1f1668befbde5f32b4ce3f7b762a39f0eea51866 | /behavioral-patterns/src/main/java/state/Fan.java | 18977e123c0a7b4d4fbfa3aeac936823ed7d966b | [] | no_license | mudit1993/design-patterns | f3366383c22750e53ba9a92f2ffbd9951b921918 | 72688e49e18d6f0b38d25b5bfaecac3296557698 | refs/heads/master | 2022-07-28T23:19:03.015342 | 2020-04-08T09:30:47 | 2020-04-08T09:30:47 | 254,041,166 | 0 | 0 | null | 2022-06-29T19:34:14 | 2020-04-08T09:20:21 | JavaScript | UTF-8 | Java | false | false | 826 | java | package state;
public class Fan {
FanOffState fanOffState;
FanLowState fanLowState;
FanMedState fanMedState;
FanHighState fanHighState;
State state;
public Fan() {
fanOffState = new FanOffState(this);
fanLowState = new FanLowState(this);
fanMedState = new FanMedState(this);
fanHighState = new FanHighState(this);
state = fanOffState;
}
public void pullChain() {
state.handleRequest();
}
public State getState() {
return state;
}
public void setState(State state) {
this.state = state;
}
public State getFanOffState() {
return fanOffState;
}
public State getFanMedState() {
return fanMedState;
}
public State getFanLowState() {
return fanLowState;
}
public State getFanHighState() {
return fanHighState;
}
public String toString() {
return state.toString();
}
}
| [
"mudit.madhogaria@sap.com"
] | mudit.madhogaria@sap.com |
f9d172b03a97c8090c795b55b7522106cb90f987 | 1b2d7996136363b954011328da8c432786b243b3 | /snack-user-server/user-server/src/main/java/com/yc/snack/user/util/SendMailUtil.java | d9705d709f4fc34836a56a32bb13d429077df071 | [] | no_license | lalala12138-dev/snack | b9712cf71777c72fb0b4e05f76f5a89ee1d0f2ea | b0f379e26dcc2558c94cb2bf614468d5b2cf29fc | refs/heads/master | 2022-12-24T05:34:24.012817 | 2020-10-06T02:51:20 | 2020-10-06T02:51:20 | 300,466,428 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,612 | java | package com.yc.snack.user.util;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Properties;
import javax.mail.internet.MimeMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.stereotype.Component;
@Component
@PropertySource("classpath:application.yml")
@ConfigurationProperties(prefix="spring.mail")
public class SendMailUtil {
@Value("${spring.mail.username}")
private String username; // 发件箱
@Autowired
private JavaMailSender mailSender;
/**
* 发送HTML格式的邮件
* @param receiveEmail
* @param nickName
* @param code
* @return
*/
public boolean sendHtmlMail(String receiveEmail, String nickName, String code) {
if (StringUtil.checkNull(receiveEmail, nickName, code)) {
return false;
}
try {
// 建立邮件的消息,我们需要发送的是html格式邮件
MimeMessage mimeMessage = mailSender.createMimeMessage();
MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage);
// 设置收件人,寄件人
messageHelper.setTo(receiveEmail);
messageHelper.setFrom(username);
messageHelper.setSubject("天天注册中心");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
String str = "<!DOCTYPE html><html><head><meta charset='UTF-8'></head><body><p style='font-size: 20px;font-weight:bold;'>尊敬的:"+nickName+",您好!</p>"
+ "<p style='text-indent:2em; font-size: 20px;'>欢迎注册天天生鲜网,您本次的注册码是 "
+ "<span style='font-size:30px;font-weight:bold;color:red'>"+code+"</span>,3分钟之内有效,请尽快使用!</p>"
+ "<p style='text-align:right; padding-right: 20px;'>"
+ "<a href='http://www.hyycinfo.com' style='font-size:18px'>衡阳市源辰信息科技有限公司技术部</a></p>"
+ "<span style='font-size:18px; float:right; margin-right: 60px;'>"+sdf.format(new Date())+"</span></body></html>";
// 设置邮件正文
messageHelper.setText(str, true);
mailSender.send(mimeMessage);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
}
| [
"1061864403@qq.com"
] | 1061864403@qq.com |
cc4cd2be4f1aa9c4a731f383fc918cc73a0e12ac | 36946ad79a3f41784b1eeff8cbfdb249e8a9c2df | /SocketClient/src/sample2/nio/ClientReceiver.java | 9110fc6fd6e3e07cecc4f18f12f4b1a43fa2380b | [] | no_license | jonghyeon-paper/java-SocketProgram | fdfbfd0106a35fa9670dc84de1bbfa011ab8c914 | 5407c42403cb1b18f0dd9046bd57af14d64f4308 | refs/heads/master | 2021-05-08T12:01:34.493255 | 2018-02-14T00:40:27 | 2018-02-14T00:40:27 | 119,920,766 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 802 | java | package sample2.nio;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
import java.nio.charset.Charset;
public class ClientReceiver extends Thread {
private SocketChannel socketChannel;
public ClientReceiver(SocketChannel socketChannel) {
this.socketChannel = socketChannel;
}
@Override
public void run() {
try {
ByteBuffer byteBuffer = ByteBuffer.allocate(100);
int count = socketChannel.read(byteBuffer);
byteBuffer.flip();
Charset charset = Charset.forName("UTF-8");
String data = charset.decode(byteBuffer).toString();
while (true) {
System.out.println("receive message : " + data);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
System.out.println("Thread cr end");
}
}
}
| [
"lieniece@gmail.com"
] | lieniece@gmail.com |
28a69b54a180cfb32947afc16d621e7f4e94dbe5 | 0ad7cb3c88af6f3a59ef1e2d7b8729e21b091f92 | /src/main/java/ir/ac/ut/joboonja/exceptions/ForbiddenException.java | d30642b9f374a5b1a0c0a936d828f2718eaf0e9c | [] | no_license | internet-engineering-course/IE-backend | 312dbe2c0d8eaa966a0f3b62dab419ed23c75923 | 27a36aefeada002e5c98339acbd4ace173614821 | refs/heads/master | 2020-04-21T07:59:18.540003 | 2019-06-11T13:22:44 | 2019-06-11T13:22:44 | 169,405,979 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 178 | java | package ir.ac.ut.joboonja.exceptions;
public class ForbiddenException extends RuntimeException {
public ForbiddenException(String message) {
super(message);
}
}
| [
"ahmadreza.saboor2012@gmail.com"
] | ahmadreza.saboor2012@gmail.com |
3a6a33b96bb59e1c7495014feb9c7085add43a59 | 58562f40e9188b7ccf50afede295a99763a28bad | /test-service/src/main/java/com/lc/TestSpringBootApplication.java | e8bacd6684fac0d2832768687de447ac0ebd235e | [] | no_license | Superliu123/springboot-test | 1f8400a9ac590342a2174115a16bf65bb9273878 | 7309869fca416eef9e074a0aaa0156092b3356a2 | refs/heads/master | 2020-09-13T15:29:18.376597 | 2019-12-23T09:11:20 | 2019-12-23T09:11:20 | 222,829,019 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,892 | java | package com.lc;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.util.StringUtils;
/**
* @description:
* @author: liu_chao[liu_chao2@suixingpay.com]
* @data: 2019-11-19 20:29
*/
@SpringBootApplication
@Slf4j
@MapperScan("com.lc.mapper")
public class TestSpringBootApplication {
public static void main(String[] args) {
try {
SpringApplication app = new SpringApplication(TestSpringBootApplication.class);
//app.setBannerMode(Banner.Mode.OFF);
ApplicationContext context = app.run(args);
String[] activeProfiles = context.getEnvironment().getActiveProfiles();
log.info(print());
log.info("ActiveProfiles = " + StringUtils.arrayToCommaDelimitedString(activeProfiles));
} catch (Exception e) { // 一定要加此try catch, 方便解决问题
// 打印启动失败的错误信息
log.error("启动失败:", e);
}
}
public static String print() {
StringBuilder sb = new StringBuilder();
sb.append("\n");
sb.append(" ┌─┐ ┌─┐\n");
sb.append(" ┌──┘ ┴───────┘ ┴──┐\n");
sb.append(" │ │\n");
sb.append(" │ ─── │\n");
sb.append(" │ ─┬┘ └┬─ │\n");
sb.append(" │ │\n");
sb.append(" │ ─┴─ │\n");
sb.append(" │ │\n");
sb.append(" └───┐ ┌───┘\n");
sb.append(" │ │\n");
sb.append(" │ │\n");
sb.append(" │ │\n");
sb.append(" │ └──────────────┐\n");
sb.append(" │ │\n");
sb.append(" │ ├─┐\n");
sb.append(" │ ┌─┘\n");
sb.append(" │ │\n");
sb.append(" └─┐ ┐ ┌───────┬──┐ ┌──┘\n");
sb.append(" │ ─┤ ─┤ │ ─┤ ─┤\n");
sb.append(" └──┴──┘ └──┴──┘\n");
sb.append(" 神兽保佑\n");
sb.append(" 代码无BUG!\n");
return sb.toString();
}
}
| [
"1974552862@qq.com"
] | 1974552862@qq.com |
947e4f4516585e3e39864f7a69959ae95dada54b | c54062a41a990c192c3eadbb9807e9132530de23 | /solutions/lambdacomparator/src/main/java/lambdacomparator/cloud/Clouds.java | bc2bac79b2280c209e38b184641c80b3f6d91bea | [] | no_license | Training360/strukturavalto-java-public | 0d76a9dedd7f0a0a435961229a64023931ec43c7 | 82d9b3c54437dd7c74284f06f9a6647ec62796e3 | refs/heads/master | 2022-07-27T15:07:57.915484 | 2021-12-01T08:57:06 | 2021-12-01T08:57:06 | 306,286,820 | 13 | 115 | null | null | null | null | UTF-8 | Java | false | false | 939 | java | package lambdacomparator.cloud;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class Clouds {
public CloudStorage alphabeticallyFirst(List<CloudStorage> storages) {
return Collections.min(storages, Comparator.comparing(CloudStorage::getProvider, String::compareToIgnoreCase));
}
public CloudStorage bestPriceForShortestPeriod(List<CloudStorage> storages) {
return Collections.min(storages, Comparator.comparing(CloudStorage::getPeriod, Comparator.nullsFirst(Comparator.comparingInt(PayPeriod::getLength))).thenComparingDouble(CloudStorage::getPrice));
}
public List<CloudStorage> worstOffers(List<CloudStorage> storages) {
List<CloudStorage> copyStorages = new ArrayList<>(storages);
copyStorages.sort(Comparator.reverseOrder());
return copyStorages.subList(0, Math.min(copyStorages.size(), 3));
}
}
| [
"viczian.istvan@gmail.com"
] | viczian.istvan@gmail.com |
db7f99763afcf05c38b3d967882696ed48134389 | 1cd1042636f835b3653d1c3aa5683f9b4c330523 | /javaSpring endterm/src/main/java/kz/spring/demo/controller/TextController.java | 26a4a48c2ec881a47e69677cc0d624fca9037e0e | [] | no_license | MoldakynSagi/SpringFinal | fcdf45f975a287b551970d4b79495e46ff02913c | 9dd57b2528797ad3b2272bf9bbde25392cda79df | refs/heads/main | 2023-05-04T01:30:56.547850 | 2021-05-25T17:38:53 | 2021-05-25T17:38:53 | 370,778,297 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,134 | java | package kz.spring.demo.controller;
import kz.spring.demo.entity.Text;
import kz.spring.demo.service.iservice.ITextService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api/texts")
public class TextController {
@Autowired
private ITextService iTextService;
// GET
@GetMapping("")
public ResponseEntity<?> getTextsByProductId(@RequestParam("musicId") Long musicId) {
return ResponseEntity.ok(iTextService.getTextByProductId(musicId));
}
// POST
@PostMapping("/create")
public ResponseEntity<?> createNewText(@RequestBody Text text) {
return ResponseEntity.ok(iTextService.createNew(text));
}
// PUT
@PutMapping("/update")
public ResponseEntity<?> updateText(@RequestBody Text text) {
return ResponseEntity.ok(iTextService.updateText(text));
}
// DELETE
@DeleteMapping("/delete/{id}")
public void deleteText(@PathVariable("id") Long id) {
iTextService.deleteTextById(id);
}
}
| [
"tomboffos@gmail.com"
] | tomboffos@gmail.com |
a1411497a704bb643947f76b763d9339a4647517 | 51c8b7110d0d3709d605bea7e0c949b9888ab81b | /DIMBuses/src/main/java/co/gov/dian/muisca/diligenciamientomasivo/acciones/pagocaja/DCmdAccActSolicitudDocConciliaPago.java | 3e999916df64ba49a9bf35b99e0ad630f3e1b63b | [] | no_license | davidamurciac/Pru_concepto | ab1c2bf0e4655895b61dade5df7aa06c95d2e1d8 | 1b5eef98c3025e4f821ab4e0fbd2f5cfa605e747 | refs/heads/master | 2020-09-01T01:17:47.974033 | 2019-11-01T21:26:43 | 2019-11-01T21:26:43 | 218,838,631 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,552 | java | /**
* Republica de Colombia
* Copyright (c) 2004 Dirección de Impuestos y Aduanas Nacionales.
* (DIAN - www.dian.gov.co). Todos los Derechos reservados.
*
* $Header:$
*/
package co.gov.dian.muisca.diligenciamientomasivo.acciones.pagocaja;
import java.util.*;
import co.gov.dian.muisca.arquitectura.general.excepcion.*;
import co.gov.dian.muisca.arquitectura.interfaces.*;
import co.gov.dian.muisca.arquitectura.interfaces.implgenerica.comandos.*;
import co.gov.dian.muisca.diligenciamientomasivo.general.to.pagocaja.*;
import co.gov.dian.muisca.diligenciamientomasivo.servicios.pagocaja.*;
/**
* <p>Titulo: Proyecto MUISCA</p>
* <p>Descripcion: Comando de acci� utilizado para actualizar un objeto SolicitudDocConciliaPago.</p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: DIAN</p>
*
* @author Plugin Middlegen-MUISCA
* @version $Revision:$
* <pre>
* $Log[10]:$
* </pre>
*/
public class DCmdAccActSolicitudDocConciliaPago extends DComandoAccion {
/** Objeto de transporte de SolicitudDocConciliaPago */
protected DSolicitudDocConciliaPagoTO toSolicitudDocConciliaPago;
/** Llave primaria de SolicitudDocConciliaPago */
protected DSolicitudDocConciliaPagoPKTO pkSolicitudDocConciliaPago;
/** Atributos de SolicitudDocConciliaPago */
protected DSolicitudDocConciliaPagoAttTO attSolicitudDocConciliaPago;
/**
* Inicializa la actualizaci�n de SolicitudDocConciliaPago.
* @param toSolicitudDocConciliaPago Objeto de Transporte de SolicitudDocConciliaPago
*/
public void inicializar(DSolicitudDocConciliaPagoTO toSolicitudDocConciliaPago) {
isOk = false;
this.toSolicitudDocConciliaPago = toSolicitudDocConciliaPago;
if (toSolicitudDocConciliaPago != null) {
pkSolicitudDocConciliaPago = this.toSolicitudDocConciliaPago.getPK();
attSolicitudDocConciliaPago = this.toSolicitudDocConciliaPago.getAtt();
}
}
/**
* Ejecuta el comando de acci�n.
*/
protected void ejecutarComando() {
throw new UnsupportedOperationException();
}
/**
* Obtiene una copia (clon) del comando.
* @return Un Object con la copia del comando
*/
public Object clonar() {
return new DCmdAccActSolicitudDocConciliaPago();
}
/**
* Indica si el comando es auditable.
* @return true si el comando es auditable; false de lo contrario
*/
public boolean isAuditable() {
return true;
}
/**
* Obtiene la descripci�n del comando.
* @return Un String con la descripci�n del comando
*/
public String getDescripcion() {
return "Permite actualizar un objeto SolicitudDocConciliaPago";
}
/**
* M�odo para validar los par�metros inicializados, invocado
* previamente a la ejecuci�n del comando.
* @return true si los par�metros son v�lidos; false de lo contrario
* @throws DValidarExcepcion Si los par�metros no son v�lidos
*/
public boolean validar() throws DValidarExcepcion {
Map parametros=new HashMap();
parametros.put(this.getClass().getName()+":validar:toSolicitudDocConciliaPago",toSolicitudDocConciliaPago);
parametros.put(this.getClass().getName()+":validar:pkSolicitudDocConciliaPago",pkSolicitudDocConciliaPago);
parametros.put(this.getClass().getName()+":validar:attSolicitudDocConciliaPago",attSolicitudDocConciliaPago);
parametros.put(this.getClass().getName()+":validar:pkSolicitudDocConciliaPago.getIdeSolicitud()",pkSolicitudDocConciliaPago.getIdeSolicitud());
parametros.put(this.getClass().getName()+":validar:pkSolicitudDocConciliaPago.getIdeDocumentoConcilia()",pkSolicitudDocConciliaPago.getIdeDocumentoConcilia());
parametros.put(this.getClass().getName()+":validar:pkSolicitudDocConciliaPago.getIdeDeclaracion()",pkSolicitudDocConciliaPago.getIdeDeclaracion());
parametros.put(this.getClass().getName()+":validar:attSolicitudDocConciliaPago.getCodEstadoProceso()",attSolicitudDocConciliaPago.getCodEstadoProceso());
validarParametros("Actualizar",parametros);
return true;
}
/**
* Para copiar el contenido del comando actual al comando enviado como par�etro.
* @param comando Comando sobre el cual copiar
*/
public void asignar(IDComando comando) {
if (comando instanceof DCmdAccActSolicitudDocConciliaPago) {
DCmdAccActSolicitudDocConciliaPago copia = (DCmdAccActSolicitudDocConciliaPago) comando;
copia.toSolicitudDocConciliaPago = toSolicitudDocConciliaPago;
copia.pkSolicitudDocConciliaPago = pkSolicitudDocConciliaPago;
copia.attSolicitudDocConciliaPago = attSolicitudDocConciliaPago;
}
}
} | [
"dmurciac1@dian.gov.co"
] | dmurciac1@dian.gov.co |
bc5a5647b25ad803f957334005a78ae23e6d0940 | 8d9d71e5bfe06d5d5d34f082c3835ff6de381b54 | /HeartSound/app/src/main/java/com/example/heartsound/Result_analysis/LineChartData/LineChartData_6.java | 768dbdf82605adc593d43584055c2a9a5b3a7fb9 | [] | no_license | pccucsiea10/HeartSound_final1 | 4e629966d7de47642a0e91cde8cd615a02d44653 | 94d90be7fb7b0714dcf7e0ff1fab46d33dcba24d | refs/heads/main | 2023-08-22T04:29:42.104699 | 2021-10-08T17:31:46 | 2021-10-08T17:31:46 | 415,073,655 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,142 | java | package com.example.heartsound.Result_analysis.LineChartData;
import android.graphics.Color;
import com.example.heartsound.R;
import com.example.heartsound.Result_analysis.ResultDepartment.ResultDepartment_6;
import com.github.mikephil.charting.charts.LineChart;
import com.github.mikephil.charting.components.AxisBase;
import com.github.mikephil.charting.components.Description;
import com.github.mikephil.charting.components.Legend;
import com.github.mikephil.charting.components.XAxis;
import com.github.mikephil.charting.components.YAxis;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.data.LineData;
import com.github.mikephil.charting.data.LineDataSet;
import com.github.mikephil.charting.formatter.IAxisValueFormatter;
import com.github.mikephil.charting.formatter.IndexAxisValueFormatter;
import java.text.DecimalFormat;
import java.util.ArrayList;
public class LineChartData_6 {
ResultDepartment_6 context;
LineChart lineChart;
public LineChartData_6(LineChart lineChart, ResultDepartment_6 context){
this.context = context;
this.lineChart = lineChart;
}
public void initDataSet(ArrayList<Entry> valuesY) {
if(valuesY.size()>0){
for(int i = 0 ;i<valuesY.size();i++){
final LineDataSet set;
set = new LineDataSet(valuesY, "心率");
set.setMode(LineDataSet.Mode.LINEAR);//類型為折線
set.setColor(context.getResources().getColor(R.color.black));//線的顏色
set.setCircleColor(context.getResources().getColor(R.color.black));//圓點顏色
set.setCircleRadius(4);//圓點大小
set.setDrawCircleHole(false);//圓點為實心(預設空心)
set.setLineWidth(2);//線寬
set.setDrawValues(true);//顯示座標點對應Y軸的數字(預設顯示)
set.setValueTextSize(8);//座標點數字大小
set.setAxisDependency(YAxis.AxisDependency.LEFT);
// set.setFillColor(Color.RED);
set.setFillAlpha(50);
set.setDrawFilled(true);
// set.setValueTextColor(Color.BLACK);
set.setDrawValues(false);
lineChart.setDragEnabled(true);
lineChart.setTouchEnabled(true);
// lineChart.setVisibleXRange(0,100);
Legend legend = lineChart.getLegend();
legend.setEnabled(false);//不顯示圖例 (預設顯示)
Description description = lineChart.getDescription();
description.setEnabled(false);//不顯示Description Label (預設顯示)
LineData data = new LineData(set);
lineChart.setData(data);//一定要放在最後
lineChart.moveViewToX(data.getEntryCount());
}
}else{
lineChart.setNoDataText("暫時沒有數據");
lineChart.setNoDataTextColor(Color.BLUE);//文字顏色
}
//重新整理顯示
lineChart.notifyDataSetChanged();
lineChart.invalidate();//繪製圖表
}
public void initX(ArrayList dateList) {
XAxis xAxis = lineChart.getXAxis();
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);//X軸標籤顯示位置(預設顯示在上方,分為上方內/外側、下方內/外側及上下同時顯示)
xAxis.setTextColor(Color.GRAY);//X軸標籤顏色
xAxis.setTextSize(12);//X軸標籤大小
xAxis.setLabelCount(6);//X軸標籤個數 xAxis.setLabelCount(dateList.size());
xAxis.setSpaceMin(0.5f);//折線起點距離左側Y軸距離
xAxis.setSpaceMax(0.5f);//折線終點距離右側Y軸距離
xAxis.setGranularityEnabled(true);
xAxis.setGranularity(1f);
xAxis.setDrawGridLines(false);//不顯示每個座標點對應X軸的線 (預設顯示)
xAxis.setValueFormatter(new IndexAxisValueFormatter(dateList));
}
public void initY(Float min, Float max) {
YAxis rightAxis = lineChart.getAxisRight();//獲取右側的軸線
rightAxis.setEnabled(false);//不顯示右側Y軸
YAxis leftAxis = lineChart.getAxisLeft();//獲取左側的軸線
leftAxis.setLabelCount(5);//Y軸標籤個數
leftAxis.setTextColor(Color.GRAY);//Y軸標籤顏色
leftAxis.setTextSize(12);//Y軸標籤大小
leftAxis.setAxisMinimum(50);//Y軸標籤最小值
leftAxis.setAxisMaximum(100);//Y軸標籤最大值
leftAxis.setValueFormatter(new LineChartData_6.MyYAxisValueFormatter());
}
class MyYAxisValueFormatter implements IAxisValueFormatter {
private DecimalFormat mFormat;
public MyYAxisValueFormatter() {
mFormat = new DecimalFormat("###,##");//Y軸數值格式及小數點位數
}
@Override
public String getFormattedValue(float value, AxisBase axis) {
return mFormat.format(value);
}
}
}
| [
"pccucsiea10@gmail.com"
] | pccucsiea10@gmail.com |
0fd54a743b515c931a200828fffec8c19a3c08a8 | ab173e6db9ad65d4c869db8f09fad86d39976ae0 | /src/controlador/PrincipalController.java | e1cf501ee0ebb8df6e2ff20c91b72ef2400d040a | [] | no_license | ThalesCloss/ProjetoBD | 87b033bee496bc9615f7fef8e3710e04dc04a096 | e5c069bf39cfabff31136e058c306c4210772e20 | refs/heads/master | 2021-01-17T22:45:51.171644 | 2017-03-23T21:04:05 | 2017-03-23T21:04:05 | 84,202,175 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,139 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package controlador;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.control.Alert;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Pane;
import utilitarios.Alertas;
/**
*
* @author tcloss
*/
public class PrincipalController implements Initializable {
@FXML
private GridPane painel;
private static Pane sPainel;
@FXML
private static Parent cadastroUsuario, listaUsuario, listaProduto, cadastroProduto, cadastroFornecedor,listaFornecedor,cadastroPedido;
private FXMLLoader fxControlador;
public static CadastroUsuarioController cadastroUsuarioCtr;
private static ListaUsuarioController listaUsuarioCtr;
public static CadastroProdutoController cadastroProdutoCtr;
public static ListaProdutoController listaProdutoCtr;
public static CadastroFornecedorController cadastroFornecedorCtr;
public static ListaFornecedorController listaFornecedorCtr;
public PrincipalController() {
try {
fxControlador = new FXMLLoader(getClass().getResource("../view/usuario/cadastro.fxml"));
cadastroUsuario = fxControlador.load();
cadastroUsuarioCtr = (CadastroUsuarioController) fxControlador.getController();
fxControlador = new FXMLLoader(getClass().getResource("../view/usuario/lista.fxml"));
listaUsuario = fxControlador.load();
listaUsuarioCtr = fxControlador.getController();
fxControlador = new FXMLLoader(getClass().getResource("../view/produto/lista.fxml"));
listaProduto = fxControlador.load();
listaProdutoCtr = fxControlador.getController();
fxControlador = new FXMLLoader(getClass().getResource("../view/produto/cadastro.fxml"));
cadastroProduto = fxControlador.load();
cadastroProdutoCtr = fxControlador.getController();
fxControlador = new FXMLLoader(getClass().getResource("../view/fornecedor/cadastro.fxml"));
cadastroFornecedor = fxControlador.load();
cadastroFornecedorCtr=fxControlador.getController();
fxControlador=new FXMLLoader(getClass().getResource("../view/fornecedor/lista.fxml"));
listaFornecedor=fxControlador.load();
listaFornecedorCtr=fxControlador.getController();
fxControlador=new FXMLLoader(getClass().getResource("../view/pedido/cadastro.fxml"));
cadastroPedido=fxControlador.load();
} catch (IOException ex) {
System.out.println(ex);
Alertas.exibirAlerta(Alert.AlertType.ERROR, "Erro", "Erro ao carregar a tela", ex.getLocalizedMessage());
}
}
@Override
public void initialize(URL location, ResourceBundle resources) {
sPainel = painel;
}
public void btUsuarioOnAction(ActionEvent e) {
abrirListaUsuario();
}
public void btProdutoOnAction(ActionEvent e) {
abrirListaProduto();
}
public void btFornecedorOnAction(ActionEvent e) {
abrirListaFornecedor();
}
public void btPedidoOnAction(ActionEvent e){
abrirCadastroPedido();
}
private static void carregarTela(Parent tela) {
sPainel.getChildren().clear();
sPainel.getChildren().add(tela);
}
public static void abrirCadastroPedido(){
carregarTela(cadastroPedido);
}
public static void abrirCadastroFornecedor() {
carregarTela(cadastroFornecedor);
}
public static void abrirListaFornecedor(){
listaFornecedorCtr.atualizarTabela();
carregarTela(listaFornecedor);
}
public static void abrirListaUsuario() {
listaUsuarioCtr.preencherTabela();
carregarTela(listaUsuario);
}
public static void abrirListaProduto() {
listaProdutoCtr.atualizarTabela();
carregarTela(listaProduto);
}
public static void abrirCadastroUsuario() {
carregarTela(cadastroUsuario);
}
public static void abrirCadastroProduto() {
carregarTela(cadastroProduto);
}
public static void limparTextField() {
limpar(sPainel);
}
private static void limpar(Parent limpar) {
limpar.getChildrenUnmodifiable().forEach(component -> {
if (component instanceof ComboBox) {
((ComboBox) component).getSelectionModel().select(-1);
} else if (component instanceof TextField) {
((TextField) component).setText("");
} else if (component instanceof Parent) {
limpar((Parent) component);
}
}
);
}
}
| [
"thales.a.closs@gmail.com"
] | thales.a.closs@gmail.com |
39f4cbf3c9c4f9fb1a84e7da57be25df6a81b311 | 42e94aa09fe8d979f77449e08c67fa7175a3e6eb | /src/net/s7.java | 58f981ee697fda1461db5a4be21e63667940442f | [
"Unlicense"
] | permissive | HausemasterIssue/novoline | 6fa90b89d5ebf6b7ae8f1d1404a80a057593ea91 | 9146c4add3aa518d9aa40560158e50be1b076cf0 | refs/heads/main | 2023-09-05T00:20:17.943347 | 2021-11-26T02:35:25 | 2021-11-26T02:35:25 | 432,312,803 | 1 | 0 | Unlicense | 2021-11-26T22:12:46 | 2021-11-26T22:12:45 | null | UTF-8 | Java | false | false | 1,187 | java | package net;
import com.google.gson.JsonElement;
import net.aK7;
import net.aRY;
import net.aRp;
import net.acE;
import viaversion.viaversion.api.PacketWrapper;
import viaversion.viaversion.api.Via;
import viaversion.viaversion.api.remapper.PacketHandler;
import viaversion.viaversion.api.type.Type;
import viaversion.viaversion.protocols.protocol1_12to1_11_1.ChatItemRewriter;
import viaversion.viaversion.protocols.protocol1_12to1_11_1.TranslateRewriter;
class s7 implements PacketHandler {
final aK7 a;
s7(aK7 var1) {
this.a = var1;
}
public void handle(PacketWrapper var1) throws Exception {
acE[] var2 = aRp.a();
if(Via.getConfig().is1_12NBTArrayFix()) {
try {
JsonElement var3 = (JsonElement)aRY.i.transform((PacketWrapper)null, ((JsonElement)var1.passthrough(Type.COMPONENT)).toString());
TranslateRewriter.toClient(var3, var1.user());
ChatItemRewriter.toClient(var3, var1.user());
var1.set(Type.COMPONENT, 0, var3);
} catch (Exception var4) {
var4.printStackTrace();
}
}
}
private static Exception a(Exception var0) {
return var0;
}
}
| [
"91408199+jeremypelletier@users.noreply.github.com"
] | 91408199+jeremypelletier@users.noreply.github.com |
b8fe473d57e3516afe6c67458f58a9088c62b049 | 0b3c94f63aa1dba0b0aa1fd29c7c31eb9b10b6b1 | /app/src/main/java/com/njit/yh454/instaclone/MainActivity.java | cd78464c5b35cd7cdcb32818694672858187628e | [
"Apache-2.0"
] | permissive | bigyihsuan/03-Instaclone | 27d55d8620eb9f35aa1532f4db042575560cef0f | fb7b58367fedc2276f4c1473816fddc50a5fe645 | refs/heads/master | 2023-08-15T19:55:34.160607 | 2021-10-22T21:30:50 | 2021-10-22T21:30:50 | 417,951,122 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,268 | java | package com.njit.yh454.instaclone;
import android.os.Bundle;
import android.view.MenuItem;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.njit.yh454.instaclone.fragment.ComposeFragment;
import com.njit.yh454.instaclone.fragment.PostsFragment;
import com.njit.yh454.instaclone.fragment.ProfileFragment;
public class MainActivity extends AppCompatActivity {
public static final String TAG = "MainActivity";
final FragmentManager fragmentManager = getSupportFragmentManager();
private BottomNavigationView bottomNavigation;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
bottomNavigation = findViewById(R.id.bottomNavigation);
bottomNavigation.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
Fragment fragment;
switch (item.getItemId()) {
case R.id.actionHome:
// Toast.makeText(MainActivity.this, "home", Toast.LENGTH_SHORT).show();
fragment = new PostsFragment();
break;
case R.id.actionCompose:
// Toast.makeText(MainActivity.this, "compose", Toast.LENGTH_SHORT).show();
fragment = new ComposeFragment();
break;
case R.id.actionProfile:
default:
// Toast.makeText(MainActivity.this, "profile", Toast.LENGTH_SHORT).show();
fragment = new ProfileFragment();
break;
}
fragmentManager.beginTransaction().replace(R.id.flContainer, fragment).commit();
return true;
}
});
// default selection
bottomNavigation.setSelectedItemId(R.id.actionHome);
}
} | [
"bigyihsuan@hotmail.com"
] | bigyihsuan@hotmail.com |
c0425ef733e2af96c9702ef78c621b95a6c9e0eb | e65bd894902324fd9d3ce076aee7db9519d160f9 | /commons/business-commons/src/main/java/xyz/yhhu/financial/exception/BusinessException.java | 96786a05ec2b0640f374c1185542fdebdca5dc4d | [] | no_license | yhuihu/financial | 7128e6ad5577d18990735c2f4dc4825992800299 | 80d7939322f06f4fb7a37fc3bb65f81d625807bf | refs/heads/master | 2022-12-20T00:34:54.755099 | 2020-09-12T03:31:57 | 2020-09-12T03:31:57 | 291,265,682 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 589 | java | package xyz.yhhu.financial.exception;
/**
* @author Tiger
* @date 2020-06-17
* @see xyz.yhhu.financial.exception
**/
public class BusinessException extends RuntimeException {
private static final long serialVersionUID = -5691472265585910797L;
private Integer code;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public BusinessException() {
}
public BusinessException(ExceptionStatus status) {
super(status.getMessage());
this.code = status.getCode();
}
}
| [
"35516186+yhuihu@users.noreply.github.com"
] | 35516186+yhuihu@users.noreply.github.com |
822a6724616ad51f226d6f2fa251cda567fe782c | bbff0410a337fd5dcf7e808f0ca0c30d94f45b55 | /app/src/main/java/com/griffith/horiot/assignment1/activities/MainActivity.java | 6e8a457fc50081ae96c2ab6c53640f99975dc0db | [] | no_license | FowlingLight/ToDoList | a4f15b9e6e662ef83cd0ef1494b7cfbc573e2307 | cf786418e04e43dd99cbcde64b33da922181ecb6 | refs/heads/master | 2021-01-19T02:37:43.412909 | 2016-06-20T13:22:19 | 2016-06-20T13:22:19 | 61,548,910 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,855 | java | package com.griffith.horiot.assignment1.activities;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import com.google.gson.Gson;
import com.griffith.horiot.assignment1.objs.CustomArrayAdapter;
import com.griffith.horiot.assignment1.R;
import com.griffith.horiot.assignment1.objs.ToDoItem;
import java.util.ArrayList;
import java.util.Arrays;
public class MainActivity extends AppCompatActivity {
private ListView listView;
private EditText editText;
private CustomArrayAdapter customArrayAdapter;
private SharedPreferences pref;
private Gson gson;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button button = (Button) findViewById(R.id.add_task_button);
this.listView = (ListView) findViewById(R.id.todo_list);
this.editText = (EditText) findViewById(R.id.add_task_name);
this.pref = getApplicationContext().getSharedPreferences("mySavedToDoList", 0);
this.gson = new Gson();
if(!this.pref.getString("list", "").equals("")) {
ToDoItem[] tab = this.gson.fromJson(this.pref.getString("list", ""), ToDoItem[].class);
this.customArrayAdapter = new CustomArrayAdapter(this, new ArrayList<>(Arrays.asList(tab)));
} else {
this.customArrayAdapter = new CustomArrayAdapter(this);
}
this.listView.setAdapter(this.customArrayAdapter);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!editText.getText().toString().isEmpty()) {
customArrayAdapter.addItem(new ToDoItem(editText.getText().toString()));
customArrayAdapter.notifyDataSetChanged();
editText.setText("");
listView.setSelection(customArrayAdapter.getCount() - 1);
}
}
});
this.listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> adapterview, View view, int pos, long id) {
customArrayAdapter.removeItem(pos);
customArrayAdapter.notifyDataSetChanged();
return true;
}
});
}
@Override
public void onStop() {
SharedPreferences.Editor editor = this.pref.edit();
editor.putString("list", gson.toJson(this.customArrayAdapter.getAllItems()));
editor.apply();
super.onStop();
}
}
| [
"benjamin.horiot@epitech.eu"
] | benjamin.horiot@epitech.eu |
689354171e88c482cd86f73136b46dc0ec082469 | a8d4733daea81597e434f9acae25659da00e6253 | /InventoryManagement/src/main/java/com/spring/maven/dao/impl/IAllStockDAO.java | 54c34b331521e0c04c584ab27e2f516f974ebcb4 | [] | no_license | sumyiaswarna721/InventoryManagement | 6d046bf07ae4812fb16c8df94865382b1b0262bb | b3e7cfc79d2e6d594583bd309aeab543ebefc32e | refs/heads/master | 2023-02-28T19:07:50.496050 | 2021-02-02T07:59:45 | 2021-02-02T07:59:45 | 335,211,080 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 448 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.spring.maven.dao.impl;
import com.spring.maven.common.ICommonDAO;
import com.spring.maven.model.AllStock;
/**
*
* @author Dell
*/
public interface IAllStockDAO extends ICommonDAO<AllStock>{
// public AllStock getByProductCode(int id);
}
| [
"58595995+sumyiaswarna721@users.noreply.github.com"
] | 58595995+sumyiaswarna721@users.noreply.github.com |
9f65f19f4f3b56d386452719e6dcf81590b913ac | 97c0b344a5e03afef88e1de21acc7cb6b4c04257 | /app/src/main/java/com/github/kongpf8848/rxhttp/sample/image/transfrom/RoundCornerTransform.java | 2d738f8f281bd7f548665630db581e90bda239e6 | [
"Apache-2.0"
] | permissive | Lovingd/RxHttp | a07fcef4432d989e07763e97d684c5d77a4274d0 | 8df7379fe07b164cb1b1d9b81dda55b057e8794f | refs/heads/master | 2023-03-14T15:11:16.717266 | 2021-02-22T23:30:48 | 2021-02-22T23:30:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,084 | java | package com.github.kongpf8848.rxhttp.sample.image.transfrom;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.graphics.Shader;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
import com.bumptech.glide.load.resource.bitmap.TransformationUtils;
import java.security.MessageDigest;
import java.util.Arrays;
/**
* 圆角
*/
public class RoundCornerTransform extends BitmapTransformation {
private static final String ID = "com.jsy.tk.library.image.transfrom.RoundCornerTransform";
private static final byte[] ID_BYTES = ID.getBytes(CHARSET);
private float[] radii = null;
private ImageView.ScaleType mScaleType;
public RoundCornerTransform(ImageView.ScaleType scaleType, int leftTop, int rightTop, int rightBottom, int leftBottom) {
this.mScaleType=scaleType;
this.radii = new float[]{leftTop, leftTop, rightTop, rightTop, rightBottom, rightBottom, leftBottom, leftBottom};
}
@Override
protected Bitmap transform(BitmapPool pool, Bitmap toTransform, int outWidth, int outHeight) {
Bitmap source=null;
if(mScaleType== ImageView.ScaleType.CENTER_CROP){
source= TransformationUtils.centerCrop(pool,toTransform,outWidth,outHeight);
}
else if(mScaleType== ImageView.ScaleType.FIT_CENTER){
source= TransformationUtils.fitCenter(pool,toTransform,outWidth,outHeight);
}
else {
source=toTransform;
}
return roundCorner(pool, source);
}
private Bitmap roundCorner(BitmapPool pool, Bitmap source) {
if (source == null) return null;
int width = source.getWidth();
int height = source.getHeight();
Bitmap bitmap = pool.get(width, height, Bitmap.Config.ARGB_8888);
if (bitmap == null) {
bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
}
Canvas canvas = new Canvas(bitmap);
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setShader(new BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));
RectF rect = new RectF(0, 0, width, height);
Path path = new Path();
path.addRoundRect(rect, radii, Path.Direction.CW);
canvas.drawPath(path, paint);
return bitmap;
}
@Override
public boolean equals(Object o) {
if (o instanceof RoundCornerTransform) {
RoundCornerTransform other = (RoundCornerTransform) o;
return Arrays.equals(radii,other.radii);
}
return false;
}
@Override
public int hashCode() {
return ID.hashCode();
}
@Override
public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {
messageDigest.update(ID_BYTES);
}
}
| [
"kongpf8848@gmail.com"
] | kongpf8848@gmail.com |
45a41cba10e2913b563cd87b554d74f46fcb1f28 | eff2943a6cc907b2752f4ce183803b61211ff31a | /src/test/java/com/zackehh/jackson/stream/collectors/ObjectNodeCollectorTest.java | fc29dce601bb637ce9a2e419a8841a7a6c40599c | [
"MIT"
] | permissive | whitfin/jive | 11f1f8c1cb96c74953c5648e55a96ce35a43aa56 | 6bf6defb3ff83a38286a5fd7c6915b93a56b6201 | refs/heads/master | 2021-06-19T17:05:49.405737 | 2017-06-26T02:46:25 | 2017-06-26T02:46:25 | 65,139,896 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,798 | java | package com.zackehh.jackson.stream.collectors;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.*;
import com.zackehh.jackson.stream.JiveCollectors;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.AbstractMap;
import java.util.Map;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.stream.Collector;
public class ObjectNodeCollectorTest {
private final ObjectNodeCollector objectNodeCollector = JiveCollectors.toObjectNode();
@Test
public void testSupplier() {
ObjectNode actual = objectNodeCollector.supplier().get();
ObjectNode expected = JsonNodeFactory.instance.objectNode();
Assert.assertEquals(actual, expected);
}
@Test
public void testAccumulator() {
BiConsumer<ObjectNode, Map.Entry<String, JsonNode>> consumer = objectNodeCollector.accumulator();
ObjectNode base = JsonNodeFactory.instance.objectNode();
Map.Entry<String, JsonNode> value = new AbstractMap.SimpleEntry<>("key", TextNode.valueOf("test"));
consumer.accept(base, value);
Assert.assertEquals(base.size(), 1);
Assert.assertEquals(base.path("key"), TextNode.valueOf("test"));
}
@Test
public void testCombiner() {
BinaryOperator<ObjectNode> combiner = objectNodeCollector.combiner();
ObjectNode left = JsonNodeFactory.instance.objectNode()
.put("key1", 1).put("key2", 2);
ObjectNode right = JsonNodeFactory.instance.objectNode()
.put("key3", 3).put("key4", 4);
combiner.apply(left, right);
Assert.assertEquals(left.size(), 4);
Assert.assertEquals(left.path("key1"), IntNode.valueOf(1));
Assert.assertEquals(left.path("key2"), IntNode.valueOf(2));
Assert.assertEquals(left.path("key3"), IntNode.valueOf(3));
Assert.assertEquals(left.path("key4"), IntNode.valueOf(4));
}
@Test
public void testFinisher() {
Function<ObjectNode, ObjectNode> finisher = objectNodeCollector.finisher();
ObjectNode base = JsonNodeFactory.instance.objectNode()
.put("key1", 1).put("key2", 2).put("key3", 3);
ObjectNode kept = finisher.apply(base);
Assert.assertEquals(kept, base);
}
@Test
public void testCharacteristics() {
Set<Collector.Characteristics> characteristics = objectNodeCollector.characteristics();
Assert.assertEquals(characteristics.size(), 2);
Assert.assertTrue(characteristics.contains(Collector.Characteristics.IDENTITY_FINISH));
Assert.assertTrue(characteristics.contains(Collector.Characteristics.UNORDERED));
}
}
| [
"iw@zackehh.com"
] | iw@zackehh.com |
1b22787b2612dcd1627e8553d588bd2577029f29 | 2d4ebe89c326c43e4f746024c346dee129ccf270 | /src/MiftahulHuda_1955201012_UTS_Java/looping_for.java | 0a3d22b3c025cf07aa5e9bab3869d7ab4fa8d667 | [] | no_license | hudaseftiana/1955201012_UTS_JAVA_NO2 | 43a62c0f273a62be59215efa38fcbb259983b01d | 5b3bdcd5fd4031572808c1726203ad348e5e76ac | refs/heads/master | 2022-10-13T04:19:49.991099 | 2020-06-14T17:01:38 | 2020-06-14T17:01:38 | 272,241,788 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 458 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package MiftahulHuda_1955201012_UTS_Java;
/**
*
* @author acr
*/
public class looping_for {
public static void main(String[] args) {
int angka;
for(angka=0;angka<=20;angka++){
System.out.println(angka+" ");
}
}
} | [
"acr@DESKTOP-9PCOBMI"
] | acr@DESKTOP-9PCOBMI |
d2de8e166f45f2b9f2018d845b65af892ba676de | ae6490a3fc09ad4614a69f4b6bf9f1fef1a7e2f5 | /Modulo4/src/PAISES/Pakistan.java | a1b5756e899df4129de7fd63ab58fbb030d46fad | [] | no_license | Celeste0013/operaciones | b86257290626f784f808474957d0cd4ae01166cb | b5082d8e27452e4896592a781b7b8aec98ac3f1a | refs/heads/master | 2023-01-07T19:32:34.058920 | 2020-11-05T05:31:14 | 2020-11-05T05:31:14 | 310,193,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 236 | java |
package PAISES;
public class Pakistan {
public String getpais(){
return "República Islámica de Pakistán";
}
public String getpresidente(){
return "Arif Alvi";
}
}
| [
"Estrella@192.168.0.13"
] | Estrella@192.168.0.13 |
a9b9cc6c39a6022001075c28837b72032e18cf1c | 6c75bc3f0b09f3d01765f973020b0b2a5af35deb | /sdk_framework/src/main/java/com/enjoy/sdk/framework/view/dialog/BounceEnter/BounceRightEnter.java | a910ca180ed4dfcf3347c1f5991d05f399a91369 | [] | no_license | luckkiss/enjoySDK | 40d15593b2e31fedcdb7ca18e58381469bbc1037 | 7ccd4bd4a13ecf7a4376ebe0dc0ef41c7ee67c81 | refs/heads/main | 2023-08-31T12:34:59.553328 | 2021-11-08T10:28:00 | 2021-11-08T10:28:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 636 | java | package com.enjoy.sdk.framework.view.dialog.BounceEnter;
import android.animation.ObjectAnimator;
import android.util.DisplayMetrics;
import android.view.View;
import com.enjoy.sdk.framework.view.dialog.animation.BaseAnimatorSet;
public class BounceRightEnter extends BaseAnimatorSet {
public BounceRightEnter() {
duration = 500;
}
@Override
public void setAnimation(View view) {
DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
animatorSet.playTogether(ObjectAnimator.ofFloat(view, "alpha", 0, 1, 1, 1),//
ObjectAnimator.ofFloat(view, "translationX", 250 * dm.density, -30, 10, 0));
}
}
| [
"1628103949@qq.com"
] | 1628103949@qq.com |
e4f7201ad06c3be33c95dc20658340dfd24efd1c | 0880839edbc4381bc861e6835cae3b176b2fc50a | /src/test/java/com/postgreskillsession/test/PostgresKillSessionTestApplicationTests.java | eef15729a7a4a504e653c234bf4eb66898b1bfac | [] | no_license | devusersdatarynx/PostgresKillSessionTest | 0bdf00b1b166f614467341e81c6f0fcd1aa9ece3 | ff5154af972504d7f2a6bce97143a1d3fd9a99bb | refs/heads/master | 2023-02-26T17:31:25.962310 | 2021-02-03T12:37:21 | 2021-02-03T12:37:21 | 333,311,758 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 237 | java | package com.postgreskillsession.test;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class PostgresKillSessionTestApplicationTests {
@Test
void contextLoads() {
}
}
| [
"74243901+brijesh139@users.noreply.github.com"
] | 74243901+brijesh139@users.noreply.github.com |
e0562f8c63d2a46300780a153797c79560a8be51 | 90e32bf0b90537fb0ddbd4d4912e7a1cd5c4e398 | /src/main/java/top/lionxxw/learn/algorithm/lesson/day05/TrieTree.java | bcb2aabd5cf4221409e770ec84059257f6fb1799 | [] | no_license | fimi2008/algorithm-every-day | 27c2543843e8629a2d9ff9310de13ae2de778c4e | 2a6da588e457d887416f725ee98075d6f52d31ec | refs/heads/master | 2022-12-28T04:48:04.631066 | 2020-08-13T01:36:43 | 2020-08-13T01:36:43 | 259,269,301 | 1 | 0 | null | 2020-10-13T21:32:25 | 2020-04-27T09:38:36 | Java | UTF-8 | Java | false | false | 3,276 | java | package top.lionxxw.learn.algorithm.lesson.day05;
import top.lionxxw.learn.algorithm.lesson.day01.BaseClass;
/**
* 前缀树
* <p>
*
* @author wangxiang
* created on 2020/5/27 23:08
*/
public class TrieTree extends BaseClass {
public static void main(String[] args) {
TrieTree trieTree = new TrieTree();
trieTree.insert("abc");
trieTree.insert("abcd");
trieTree.insert("abd");
trieTree.insert("ksg");
trieTree.insert("xxws");
System.out.println(trieTree.search("ksg"));
System.out.println(trieTree.search("ab"));
System.out.println(trieTree.prefixNumber("ab"));
System.out.println(trieTree.search("abd"));
trieTree.delete("abd");
System.out.println(trieTree.search("abd"));
System.out.println(trieTree.prefixNumber("ab"));
}
private Node root;
public TrieTree() {
this.root = new Node();
}
/**
* 插入字符串
* @param words
*/
public void insert(String words) {
if (words == null) {
return;
}
char[] chars = words.toCharArray();
Node node = root;
node.pass++;
int index;
for (char c : chars) {
index = c - 'a';
if (node.nexts[index] == null) {
node.nexts[index] = new Node();
}
node = node.nexts[index];
node.pass++;
}
node.end++;
}
/**
* 查询满足字符串的个数
* @param words
* @return
*/
public int search(String words) {
if (words == null) {
return 0;
}
char[] chars = words.toCharArray();
Node node = root;
int index;
for (char c : chars) {
index = c - 'a';
if (node.nexts[index] == null) {
return 0;
}
node = node.nexts[index];
}
return node.end;
}
/**
* 查询满足pre前缀的字符串个数
* @param pre 前缀
* @return
*/
public int prefixNumber(String pre) {
if (pre == null) {
return 0;
}
char[] chars = pre.toCharArray();
Node node = root;
int index;
for (char c : chars) {
index = c - 'a';
if (node.nexts[index] == null) {
return 0;
}
node = node.nexts[index];
}
return node.pass;
}
public void delete(String words) {
if (search(words) > 0) {
char[] chars = words.toCharArray();
Node node = root;
node.pass--;
int index;
for (char c : chars) {
index = c - 'a';
if (--node.nexts[index].pass == 0) {
node.nexts[index] = null;
return;
}
node = node.nexts[index];
}
node.end--;
}
}
class Node {
private int pass;
private int end;
private Node[] nexts;
public Node() {
this.pass = 0;
this.end = 0;
// 创建小写a-z的26个分叉路
this.nexts = new Node[26];
}
}
}
| [
"vonshine15@163.com"
] | vonshine15@163.com |
e5d696eb03be3105ac44627a3ef942a8c73aff61 | 001c84f9996778e4bcf818bf3d590929d27b32c2 | /src/main/java/net/nyavro/spring/social/signinmvc/services/SuggestionServiceImpl.java | 83f3f4829a9882c67240471f0c436671c2427d4e | [] | no_license | nyavro/spring-social-signin | a35efdc837f5c3c7ce3f6e4dfda06ce32c8da3b0 | 0d5786ec33fc16ece2c4a718e311fbe59a8bd0cf | refs/heads/master | 2022-12-21T13:18:41.372738 | 2020-07-02T01:50:19 | 2020-07-02T01:50:19 | 16,065,888 | 0 | 0 | null | 2022-12-16T02:21:54 | 2014-01-20T09:11:41 | Java | UTF-8 | Java | false | false | 1,510 | java | package net.nyavro.spring.social.signinmvc.services;
import com.nyavro.dienstleustigen.model.Suggestion;
import net.nyavro.spring.social.signinmvc.repository.SuggestionRepository;
import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class SuggestionServiceImpl implements SuggestionService {
@Autowired
private SuggestionRepository repository;
@Override
public List<Suggestion> findAll(int page, int batchSize) {
return repository.findAll(
new PageRequest(
page, batchSize, new Sort(Sort.Direction.DESC, "published")
)
).getContent();
}
@Override
public Suggestion findById(String id) {
return repository.findOne(new ObjectId(id));
}
@Override
public Suggestion findByCreator(String id) {
return repository.findByCreator(id);
}
@Override
public Suggestion save(Suggestion suggestion) {
return repository.save(suggestion);
}
@Override
public List<Suggestion> findByCategory(String category, int page, int batchSize) {
return repository.findByCategory(
new PageRequest(
page, batchSize, new Sort(Sort.Direction.DESC, "published")
),
category
).getContent();
}
}
| [
"e.nyavro@eastbanctech.ru"
] | e.nyavro@eastbanctech.ru |
86e47bee6e748012059eb71c9e9afb30c6810bb5 | 9783bc7dac5a9bd441a6ad28908b4458ad0a7218 | /Theomachy/src/septagram/Theomachy/Ability/HUMAN/Teleporter.java | ae3d4d5a3594f7993c951acad341dab76f3f8358 | [] | no_license | Flair-Delta/Theomachy-Pi-English | 3b5af18a9281f73b3a23e6361ce6033225ea38f3 | 2076ef28631dbdfc22c3a9167bad303ef35e1a12 | refs/heads/master | 2021-01-23T16:13:53.570579 | 2017-06-05T12:33:50 | 2017-06-05T12:33:50 | 93,288,206 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,550 | java | package septagram.Theomachy.Ability.HUMAN;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerInteractEvent;
import septagram.Theomachy.Theomachy;
import septagram.Theomachy.Ability.Ability;
import septagram.Theomachy.DB.GameData;
import septagram.Theomachy.Utility.BlockFilter;
import septagram.Theomachy.Utility.CoolTimeChecker;
import septagram.Theomachy.Utility.EventFilter;
import septagram.Theomachy.Utility.PlayerInventory;
import septagram.Theomachy.Utility.Skill;
public class Teleporter extends Ability
{
private final int coolTime1=25;
private final int coolTime2=30;
private final int material=4;
private final int stack1=2;
private final int stack2=2;
private String abilitytarget;
private final static String[] des= {"순간이동을 돕는 마법사입니다.",
"좌클릭으로 자신이 25간 이내의 가리키고 있는 곳으로 텔레포트합니다." ,
"우클릭으로 타겟에 등록해 둔 자신의 팀원과 위치를 치환합니다.",
"목표 지정: /x <대상>"};
public Teleporter(String playerName)
{
super(playerName,"텔레포터", 104, true, false, false, des);
Theomachy.log.info(playerName+abilityName);
this.cool1=coolTime1;
this.cool2=coolTime2;
this.sta1=stack1;
this.sta2=stack2;
this.rank=2;
}
public void T_Active(PlayerInteractEvent event)
{
Player player = event.getPlayer();
if (PlayerInventory.InHandItemCheck(player, 369))
{
switch(EventFilter.PlayerInteract(event))
{
case 0:case 1:
leftAction(player);
break;
case 2:case 3:
rightAction(player);
break;
}
}
}
private void leftAction(Player player)
{
if (CoolTimeChecker.Check(player, 1)&&PlayerInventory.ItemCheck(player, material, stack1))
{
Block block = player.getTargetBlock(null, 25);
if (BlockFilter.AirToFar(player, block))
{
Location location0 = block.getLocation();
Location location1 = block.getLocation();
location0.setY(location0.getY()+1);
location1.setY(location1.getY()+2);
Block block0 = location0.getBlock();
Block block1 = location1.getBlock();
if ((block0.getTypeId()==0 || block1.getTypeId() == 78)&&block1.getTypeId()==0)
{
Skill.Use(player, material, stack1, 1, coolTime1);
Location plocation = player.getLocation();
Location tlocation = block.getLocation();
tlocation.setPitch(plocation.getPitch());
tlocation.setYaw(plocation.getYaw());
tlocation.setY(tlocation.getY()+1);
tlocation.setX(tlocation.getX()+0.5);
tlocation.setZ(tlocation.getZ()+0.5);
player.teleport(tlocation);
}
else
player.sendMessage("텔레포트 할 수 있는 공간이 없어 텔레포트에 실패 했습니다.");
}
}
}
private void rightAction(Player player)
{
if (CoolTimeChecker.Check(player, 2)&&PlayerInventory.ItemCheck(player, material, stack2))
{
if (abilitytarget != null)
{
Player target = GameData.OnlinePlayer.get(abilitytarget);
if (target != null)
{
Location location = player.getLocation();
location.setY(location.getY()-1);
Skill.Use(player, material, stack2, 2, coolTime2);
Location tloc = target.getLocation();
Location ploc = player.getLocation();
target.teleport(ploc);
player.teleport(tloc);
target.sendMessage("텔레포터의 능력에 의해 위치가 텔레포터의 위치로 변경되었습니다.");
}
else
player.sendMessage("플레이어가 온라인이 아닙니다.");
}
else
player.sendMessage("타겟이 지정되지 않았습니다. (타겟 등록법 : /x <Player>)");
}
}
public void targetSet(CommandSender sender, String targetName)
{
String playerTeamName = GameData.PlayerTeam.get(playerName);
String targetTeamName = GameData.PlayerTeam.get(targetName);
if (playerTeamName != null &&
targetTeamName != null &&
playerTeamName.equals(targetTeamName))
{
if (!playerName.equals(targetName))
{
this.abilitytarget = targetName;
sender.sendMessage("타겟을 등록했습니다. "+ChatColor.GREEN+targetName);
}
else
sender.sendMessage("자기 자신을 타겟으로 등록 할 수 없습니다.");
}
else
sender.sendMessage("자신의 팀의 멤버가 아닙니다.");
}
}
| [
"humin@DESKTOP-MABJLDR"
] | humin@DESKTOP-MABJLDR |
6d701b1ecdfeffbe05f96d6c7f261fe18e2195da | 9641d6ff07709688680f6878ed89c24b2a801d80 | /app/src/androidTest/java/com/carconnectivity/testapp/test/ApplicationContextTestCase.java | d05cca2991cbbf63837d09ea7d4e74b1b1ad8121 | [
"Apache-2.0"
] | permissive | PinkDiamond1/MirrorLink_Android_CommonAPI_TestApplication | 071b3d3f5550fe3ce19358c87c72a6a9b24f86b4 | f971e5f8b37aa3d48c54c97413b825bab0b927db | refs/heads/master | 2023-04-06T11:40:32.884297 | 2019-06-26T17:06:18 | 2019-06-26T17:06:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,393 | java | /*
* Copyright Car Connectivity Consortium
*
* 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.
*
* You may decide to give the Car Connectivity Consortium input, suggestions
* or feedback of a technical nature which may be implemented on the
* Car Connectivity Consortium products (“Feedback”).
*
* You agrees that any such Feedback is given on non-confidential
* basis and Licensee hereby waives any confidentiality restrictions
* for such Feedback. In addition, Licensee grants to the Car Connectivity Consortium
* and its affiliates a worldwide, non-exclusive, perpetual, irrevocable,
* sub-licensable, royalty-free right and license under Licensee’s copyrights to copy,
* reproduce, modify, create derivative works and directly or indirectly
* distribute, make available and communicate to public the Feedback
* in or in connection to any CCC products, software and/or services.
*/
package com.carconnectivity.testapp.test;
import android.content.Intent;
import android.os.Bundle;
import android.os.RemoteException;
import android.test.ActivityUnitTestCase;
import com.carconnectivity.testapp.MainActivity;
import com.carconnectivity.testapp.MirrorLinkApplicationContext;
import com.mirrorlink.android.commonapi.ICertificationManager;
import com.mirrorlink.android.commonapi.IConnectionListener;
import com.mirrorlink.android.commonapi.IConnectionManager;
import com.mirrorlink.android.commonapi.IContextManager;
import com.mirrorlink.android.commonapi.IDataServicesManager;
import com.mirrorlink.android.commonapi.IDeviceInfoManager;
import com.mirrorlink.android.commonapi.IDeviceStatusManager;
import com.mirrorlink.android.commonapi.IDisplayManager;
import com.mirrorlink.android.commonapi.IEventMappingManager;
import com.mirrorlink.android.commonapi.INotificationManager;
public class ApplicationContextTestCase extends ActivityUnitTestCase<MainActivity> {
MainActivity mActivity = null;
public ApplicationContextTestCase() {
super(MainActivity.class);
}
@Override
public void setUp() throws Exception {
super.setUp();
startActivity(new Intent(getInstrumentation().getTargetContext(), MainActivity.class), null, null);
mActivity = getActivity();
}
public void testNotificationManagerReference() {
MirrorLinkApplicationContext context = (MirrorLinkApplicationContext) mActivity.getApplicationContext();
INotificationManager manager = context.getNotificationManager();
assertNull(manager);
context.registerNotificationManager(this, null);
manager = context.getNotificationManager();
assertNotNull(manager);
context.unregisterNotificationManager(this, null);
manager = context.getNotificationManager();
assertNull(manager);
}
public void testDataServicesManagerManagerReference() {
MirrorLinkApplicationContext context = (MirrorLinkApplicationContext) mActivity.getApplicationContext();
IDataServicesManager manager = context.getDataServicesManager();
assertNull(manager);
context.registerDataServicesManager(this, null);
manager = context.getDataServicesManager();
assertNotNull(manager);
context.unregisterDataServicesManager(this, null);
manager = context.getDataServicesManager();
assertNull(manager);
}
public void testDeviceStatusManagerReference() {
MirrorLinkApplicationContext context = (MirrorLinkApplicationContext) mActivity.getApplicationContext();
IDeviceStatusManager manager = context.getDeviceStatusManager();
assertNull(manager);
context.registerDeviceStatusManager(this, null);
manager = context.getDeviceStatusManager();
assertNotNull(manager);
context.unregisterDeviceStatusManager(this, null);
manager = context.getDeviceStatusManager();
assertNull(manager);
}
public void testContextManagerReference() {
MirrorLinkApplicationContext context = (MirrorLinkApplicationContext) mActivity.getApplicationContext();
IContextManager manager = context.getContextManager ();
assertNull(manager);
context.registerContextManager(this, null);
manager = context.getContextManager ();
assertNotNull(manager);
context.unregisterContextManager(this, null);
manager = context.getContextManager ();
assertNull(manager);
}
public void testEventMappingManagerReference() {
MirrorLinkApplicationContext context = (MirrorLinkApplicationContext) mActivity.getApplicationContext();
IEventMappingManager manager = context.getEventMappingManager();
assertNull(manager);
context.registerEventMappingManager(this, null);
manager = context.getEventMappingManager();
assertNotNull(manager);
context.unregisterEventMappingManager(this, null);
manager = context.getEventMappingManager();
assertNull(manager);
}
public void testDisplayManagerReference() {
MirrorLinkApplicationContext context = (MirrorLinkApplicationContext) mActivity.getApplicationContext();
IDisplayManager manager = context.getDisplayManager();
assertNull(manager);
context.registerDisplayManager(this, null);
manager = context.getDisplayManager();
assertNotNull(manager);
context.unregisterDisplayManager(this, null);
manager = context.getDisplayManager();
assertNull(manager);
}
public void testCertificationManagerReference() {
MirrorLinkApplicationContext context = (MirrorLinkApplicationContext) mActivity.getApplicationContext();
ICertificationManager manager = context.getCertificationManager();
assertNull(manager);
context.registerCertificationManager(this, null);
manager = context.getCertificationManager();
assertNotNull(manager);
context.unregisterCertificationManager(this, null);
manager = context.getCertificationManager();
assertNull(manager);
}
public void testDeviceInfoManagerReference() {
MirrorLinkApplicationContext context = (MirrorLinkApplicationContext) mActivity.getApplicationContext();
IDeviceInfoManager manager = context.getDeviceInfoManager();
assertNull(manager);
context.registerDeviceInfoManager(this, null);
manager = context.getDeviceInfoManager();
assertNotNull(manager);
context.unregisterDeviceInfoManager(this, null);
manager = context.getDeviceInfoManager();
assertNull(manager);
}
public void testConnectionManagerReference() {
MirrorLinkApplicationContext context = (MirrorLinkApplicationContext) mActivity.getApplicationContext();
IConnectionManager manager = context.getConnectionManager();
assertNull(manager);
context.registerConnectionManager(this, null);
manager = context.getConnectionManager();
assertNotNull(manager);
context.unregisterConnectionManager(this, null);
manager = context.getConnectionManager();
assertNull(manager);
}
public void testTwoReference() {
Object o = new Object();
MirrorLinkApplicationContext context = (MirrorLinkApplicationContext) mActivity.getApplicationContext();
IConnectionManager manager = context.getConnectionManager();
assertNull(manager);
context.registerConnectionManager(this, null);
manager = context.getConnectionManager();
assertNotNull(manager);
context.registerConnectionManager(o, null);
manager = context.getConnectionManager();
assertNotNull(manager);
context.unregisterConnectionManager(this, null);
manager = context.getConnectionManager();
assertNotNull(manager);
context.unregisterConnectionManager(o, null);
manager = context.getConnectionManager();
assertNull(manager);
assertNotNull(mActivity);
}
public void testTwoReferenceWithListener() {
Object o = new Object();
IConnectionListener l = new IConnectionListener.Stub() {
@Override
public void onRemoteDisplayConnectionChanged(int remoteDisplayConnection) throws RemoteException {
// TODO Auto-generated method stub
}
@Override
public void onMirrorLinkSessionChanged(boolean mirrolinkSessionIsEstablished) throws RemoteException {
// TODO Auto-generated method stub
}
@Override
public void onAudioConnectionsChanged(Bundle audioConnections) throws RemoteException {
// TODO Auto-generated method stub
}
};
MirrorLinkApplicationContext context = (MirrorLinkApplicationContext) mActivity.getApplicationContext();
IConnectionManager manager = context.getConnectionManager();
assertNull(manager);
context.registerConnectionManager(this, null);
manager = context.getConnectionManager();
assertNotNull(manager);
context.registerConnectionManager(o, l);
manager = context.getConnectionManager();
assertNotNull(manager);
context.unregisterConnectionManager(this, null);
manager = context.getConnectionManager();
assertNotNull(manager);
context.unregisterConnectionManager(o, l);
manager = context.getConnectionManager();
assertNull(manager);
assertNotNull(mActivity);
}
} | [
"laurent.cremmer@realvnc.com"
] | laurent.cremmer@realvnc.com |
8eeb9bca6d4439b69f62bb7c34744197bf1cf97d | dd16f982d9d92b1327a69b9ef79fbd255a500f1b | /Collection/Demo6.java | e6f3ef351953399fbb825cc73668d9d9d8346484 | [] | no_license | WangS0000/Java | e2cb3e1de8bce129ccc8de01a3854e90d8b8e176 | 0a4fa19d70d7847f181c47687cd64fb2f4459093 | refs/heads/master | 2020-08-08T01:04:29.655671 | 2020-02-17T02:34:19 | 2020-02-17T02:34:19 | 213,651,428 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,257 | java | package Collection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
public class Demo6 {
public static void main(String[] args){
Collection c = new ArrayList();
c.add(new Student("张三",23));
c.add(new Student("李四",24));
c.add(new Student("王五",25));
c.add(new Student("赵六",26));
c.add(new Student("文文",21));
Iterator it = c.iterator();
while(it.hasNext()){
Student s = (Student)it.next();
System.out.println(s.getName());
}
}
public static void deno1(){
Collection c = new ArrayList();
c.add("a");
c.add("b");
c.add("c");
c.add("d");
Iterator it = c.iterator();
boolean b1 = it.hasNext();
Object obj1 = it.next();
Object obj2 = it.next();
System.out.println(b1);
System.out.println(obj1);
System.out.println(obj2);
}
public static void demo2(){
Collection c = new ArrayList();
c.add("a");
c.add("b");
c.add("c");
c.add("d");
Iterator it = c.iterator();
while(it.hasNext()){
System.out.print(it.next());
}
}
}
| [
"374817364@qq.com"
] | 374817364@qq.com |
98e1fd8ff9e754c2e218e073902c740515bf0049 | 558818895f2487fe1a90320e625d6fe20eca6a80 | /src/utilities/InvalidRsaKey.java | d7682352f40605a14269c1dc294a5b676f360a44 | [] | no_license | Subrato92/HybridEncryption | f6349c25d6a217651c4aa72147f6fcbdc3e6325f | d8b4080adbbad0aa47baa6137ae401bfc162eeca | refs/heads/master | 2022-09-22T17:33:45.078177 | 2020-06-05T03:32:07 | 2020-06-05T03:32:07 | 268,866,272 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 304 | java | package utilities;
public class InvalidRsaKey extends Exception {
/**
*
*/
private static final long serialVersionUID = 1064859649016229151L;
String msg;
public InvalidRsaKey (String msg) {
this.msg = msg;
}
@Override
public String toString() {
return "[Exception: "+msg+"]";
}
}
| [
"subrato.mondal18@gmail.com"
] | subrato.mondal18@gmail.com |
e07343dcb943cee46360558e48aa707b7545b0bb | 943d8c28a8881f06374231243122f72459aa0745 | /app/src/main/java/com/errorstation/cricbd/TVPlayerActivity.java | 075020271dbf91ea06e1ecf5c22a24774acbff51 | [] | no_license | rubayetevan/SportsTV1 | 7241a0771124a638876cafb95191c628d13895f0 | 3f427b317bca3b68cb8b050ef341d5bfd3640f45 | refs/heads/master | 2021-01-20T08:29:52.803036 | 2017-01-05T11:59:55 | 2017-01-05T11:59:55 | 77,280,480 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,047 | java | package com.errorstation.cricbd;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Typeface;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.MobileAds;
import com.google.android.gms.ads.NativeExpressAdView;
import tcking.github.com.giraffeplayer.GiraffePlayer;
public class TVPlayerActivity extends AppCompatActivity {
String channelURL, liveStatus;
GiraffePlayer player;
LinearLayout tvLayout;
NativeExpressAdView mAdView;
TextView liveTV, teamsTV, matchTV, placeTV;
Typeface typeFace;
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tvplayer);
//tvLayout = (LinearLayout) findViewById(R.id.tvLayout);
mAdView = (NativeExpressAdView) findViewById(R.id.adViewF4);
liveTV = (TextView) findViewById(R.id.liveTV);
teamsTV = (TextView) findViewById(R.id.teamsTV);
matchTV = (TextView) findViewById(R.id.matchTV);
placeTV = (TextView) findViewById(R.id.placeTV);
typeFace = Typeface.createFromAsset(getAssets(), "Siyamrupali.ttf");
liveTV.setTypeface(typeFace);
teamsTV.setTypeface(typeFace);
matchTV.setTypeface(typeFace);
placeTV.setTypeface(typeFace);
Intent intent = getIntent();
int channelCode = intent.getIntExtra("channel", 0);
SharedPreferences sharedPref = getSharedPreferences("channelList", Context.MODE_PRIVATE);
if (channelCode == 1) {
channelURL = sharedPref.getString("channel1", "");
} else if (channelCode == 2) {
channelURL = sharedPref.getString("channel2", "");
}
liveStatus = sharedPref.getString("liveStatus", "");
if (liveStatus.equals("0")) {
liveTV.setVisibility(View.GONE);
teamsTV.setVisibility(View.GONE);
matchTV.setVisibility(View.GONE);
placeTV.setVisibility(View.GONE);
} else if (liveStatus.equals("1")) {
String team1="",team2="",matchNo="",place="",matchType="";
team1 = sharedPref.getString("team1", "");
team2 = sharedPref.getString("team2", "");
matchNo = sharedPref.getString("matchNo", "");
place = sharedPref.getString("place", "");
matchType = sharedPref.getString("matchType", "");
liveTV.setVisibility(View.VISIBLE);
teamsTV.setVisibility(View.VISIBLE);
teamsTV.setText(team1+" বনাম "+team2);
matchTV.setVisibility(View.VISIBLE);
matchTV.setText(matchNo+" খেলা, "+matchType);
placeTV.setVisibility(View.VISIBLE);
placeTV.setText(place);
}
MobileAds.initialize(this, "ca-app-pub-4958954259926855~7413974922");
AdRequest adRequest = new AdRequest.Builder().addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("EB7E6FA39C4BDD75B5A17F5285A52364")
.build();
mAdView.loadAd(adRequest);
Log.d("SplashScreen", String.valueOf(channelCode));
Log.d("SplashScreen", String.valueOf(channelURL));
player = new GiraffePlayer(this);
player.play(channelURL);
}
@Override protected void onPause() {
super.onPause();
if (player != null) {
player.onPause();
}
}
@Override protected void onResume() {
super.onResume();
if (player != null) {
player.onResume();
}
}
@Override protected void onDestroy() {
super.onDestroy();
if (player != null) {
player.onDestroy();
}
}
@Override public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (player != null) {
player.onConfigurationChanged(newConfig);
}
}
@Override public void onBackPressed() {
if (player != null && player.onBackPressed()) {
return;
}
super.onBackPressed();
}
}
| [
"rubayet.evan@gmail.com"
] | rubayet.evan@gmail.com |
acb992560a1caa8640a0a39e893ce6137998a41c | 806d2d89d6c11b3b29cee4aeb3f9516338e5691d | /src/java/Services/SearchService.java | f88a390488652649dd1202cd0bff4fad91a5c470 | [] | no_license | namlai000/Java-XML-Project | 26604aa176a8306244cc2852538611774082f95b | 005a9caa4a110c68906b8ee0c3c871755d3ee03a | refs/heads/master | 2021-01-22T11:28:01.217787 | 2017-07-18T01:06:30 | 2017-07-18T01:06:30 | 92,697,454 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,519 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Services;
import Entities.TblNewsHeader;
import Entities.TblUserInfo;
import Resources.Resource;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.TypedQuery;
/**
*
* @author thegu
*/
public class SearchService {
private EntityManagerFactory emf = Persistence.createEntityManagerFactory(Resource.Persistence);
private EntityManager em = emf.createEntityManager();
public List<TblNewsHeader> SearchByTittle(String tittle) {
TypedQuery<TblNewsHeader> query = em.createQuery("SELECT c FROM TblNewsHeader c JOIN c.tblNews d JOIN d.authorID f WHERE c.tittle LIKE :query ORDER BY c.date DESC", TblNewsHeader.class);
query.setParameter("query", "%" + tittle + "%");
return query.getResultList();
}
public List<TblUserInfo> SearchAuthorByName(String tittle) {
TypedQuery<TblUserInfo> query = em.createQuery("SELECT c FROM TblUserInfo c JOIN c.tblUser d WHERE d.role.id <= 2 AND (c.firstname LIKE :query OR c.middlename LIKE :query OR c.lastname LIKE :query) ORDER BY c.createDate DESC", TblUserInfo.class);
query.setParameter("query", "%" + tittle + "%");
return query.getResultList();
}
}
| [
"theguncrusher@gmail.com"
] | theguncrusher@gmail.com |
d741b5b353143b9663aeaaeaabae7d51dcccd62d | 224cb33c4eb68e45cc7ab77f749cb95512d7dcf6 | /jihuan/src/main/java/com/algorithm/tree2/BinaryTreeToLists.java | 1ddcd301ef00d8376e732890057ee9a2954832de | [] | no_license | jk01/jihuan_alg | 00d6dea990a31125570b3b033e8ae80d5096fdb8 | e6c54a56d6d6c91437631a811b424de2ee36ba5a | refs/heads/master | 2023-04-19T00:44:54.233991 | 2021-03-01T16:56:25 | 2021-03-01T16:56:25 | 104,908,644 | 0 | 0 | null | 2021-04-26T20:42:51 | 2017-09-26T16:13:20 | Java | UTF-8 | Java | false | false | 1,163 | java | package com.algorithm.tree2;
import com.algorithm.link.ListNode;
import com.algorithm.link.TreeNode;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
public class BinaryTreeToLists {
public List<ListNode> binaryTreeToLists(TreeNode root) {
List<ListNode> result = new ArrayList<ListNode>();
if (root == null)
return result;
Queue<TreeNode> queue = new LinkedList<TreeNode>();
queue.offer(root);
ListNode dummy = new ListNode(0);
ListNode lastNode = null;
while (!queue.isEmpty()) {
dummy.next = null;
lastNode = dummy;
int size = queue.size();
for (int i = 0; i < size; i++) {
TreeNode head = queue.poll();
lastNode.next = new ListNode(head.val);
lastNode = lastNode.next;
if (head.left != null)
queue.offer(head.left);
if (head.right != null)
queue.offer(head.right);
}
result.add(dummy.next);
}
return result;
}
}
| [
"jk_g@163.com"
] | jk_g@163.com |
4fab4b160e52b9e8c67c20769f241335de7e1ccf | 33d6519301c1efb5d3427326cbb3414bf6a6b104 | /Items-Back-End/src/main/java/com/ItemsBackEnd/validator/BookValidator.java | 9643d4eae8aae9bc0eda64c1de7d5ddb26bf6955 | [] | no_license | artursvaitilavics/Junior-Dev-Test-Task | 63fc4fad2aef9b903a3a2577f2b623b9c766e63f | 567c71b00c3b7b5119858d9ef769bc61a8f049f7 | refs/heads/main | 2023-03-28T10:18:53.117826 | 2021-03-31T19:45:23 | 2021-03-31T19:45:23 | 345,296,192 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 413 | java | package com.ItemsBackEnd.validator;
import com.ItemsBackEnd.model.Book;
import org.springframework.stereotype.Component;
@Component
public class BookValidator implements ItemValid<Book>{
@Override
public boolean isValid(Book book) {
if (book.getName().equals("") || book.getPrice().equals("") || book.getProperty().equals("")) {
return false;
}
return true;
}
}
| [
"artyvt@gmail.com"
] | artyvt@gmail.com |
5b84702c5173da3e2e8de2c8525733c55777498c | 8f85fedb1f052b2eeb960387f65915350ba75830 | /net.certware.argument.aml/src/net/certware/argument/aml/QuestionRelationships.java | eec75c0135eb3067e8c3de71ce07308c300decf7 | [
"Apache-2.0"
] | permissive | mrbcuda/CertWare | bc3dd18ff803978d84143c26bfc7e3f74bd0c6aa | 67ff7f9dc00a2298bfcb574e2acf056f7b7786b2 | refs/heads/master | 2021-01-17T21:26:34.643174 | 2013-08-06T22:01:30 | 2013-08-06T22:01:30 | null | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 2,049 | java | /**
* AML metamodel copyright © 2000-2005 SRI International.
* Implementation into plugin copyright © 2010-2011 United States Government as represented by the Administrator for The National Aeronautics and Space Administration. All Rights Reserved.
*
*/
package net.certware.argument.aml;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Question Relationships</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link net.certware.argument.aml.QuestionRelationships#getDependent <em>Dependent</em>}</li>
* </ul>
* </p>
*
* @see net.certware.argument.aml.AmlPackage#getQuestionRelationships()
* @model extendedMetaData="name='questionRelationships_._type' kind='elementOnly'"
* @generated
*/
public interface QuestionRelationships extends EObject {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String copyright = "AML metamodel copyright © 2000-2005 SRI International.\nImplementation into plugin copyright © 2010-2011 United States Government as represented by the Administrator for The National Aeronautics and Space Administration. All Rights Reserved. \n"; //$NON-NLS-1$
/**
* Returns the value of the '<em><b>Dependent</b></em>' containment reference list.
* The list contents are of type {@link net.certware.argument.aml.Dependent}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Dependent</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Dependent</em>' containment reference list.
* @see net.certware.argument.aml.AmlPackage#getQuestionRelationships_Dependent()
* @model containment="true"
* extendedMetaData="kind='element' name='dependent' namespace='##targetNamespace'"
* @generated
*/
EList<Dependent> getDependent();
} // QuestionRelationships
| [
"mrbarry@kestreltechnology.com"
] | mrbarry@kestreltechnology.com |
a6d924643ec0610c0bc21b2a558c9a27fa70010a | 77736eef58a2a105ffcd15d30e9beb81226f6398 | /array_study/array_study/ArrayTest.java | 70237b39bab2db80fc57440ad5461e3640fd1feb | [] | no_license | apaqi/javabase_wpx | e6a1d07a17ef52d081b7060e4aac144ed899ff44 | e1c7c129d214968ce919812d3deabd38c98775dd | refs/heads/master | 2020-03-18T20:31:37.422651 | 2018-05-29T00:31:22 | 2018-05-29T00:31:22 | 135,221,454 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 530 | java | package array_study;
import java.util.Arrays;
public class ArrayTest {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int[][] array2 = new int[1][];
System.out.println("Result:"+Arrays.deepToString(array2));
//方式一:申明数组
int[] a = new int[3];
//方式二:聚集初始化,只能在声明的地方赋值
int b[] = {1,2,3,4};
//方式二:动态聚集初始化,可以在任何地方赋值
int[] c;
c = new int[]{1,2,3};
}
}
| [
"wangpeixuan00@126.com"
] | wangpeixuan00@126.com |
0364e25dcd25e78234649383758f88ac4beac449 | 98affc5738c52ada16f99f268aa17292d7ecde78 | /book-server/src/main/java/com/book/api/UserinfoApi.java | c0cfc24ce43a6e92db74ce59104f2b56a6ed093f | [] | no_license | banbanzzz/J2ee-Book | f747a03e0ee02f0fc39571150d878b024a7516d1 | 2cedd29b6762732ae3e7853897ef8d364b683302 | refs/heads/master | 2020-06-08T07:33:30.061356 | 2019-09-07T07:22:45 | 2019-09-07T07:22:45 | 193,187,553 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,063 | java | package com.book.api;
import com.book.model.Userinfo;
//import com.book.redis.RedisPoolUtil;
import com.book.service.UserinfoService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import redis.clients.jedis.Jedis;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.List;
@RestController //返回数据内容
@RequestMapping("/user")
public class UserinfoApi {
@Autowired
private UserinfoService user_service;
/**
* 处理登录/login
*/
@RequestMapping("/login")
public Userinfo user_login(HttpServletRequest request) throws Exception{
request.setCharacterEncoding("utf-8");
String user_name = request.getParameter("user_name");
String user_pwd = request.getParameter("user_pwd");
Userinfo userinfo = this.user_service.login(user_name,user_pwd);
if(userinfo == null){
Userinfo user = new Userinfo();
return user;
}else {
request.getSession().setAttribute("user",userinfo);
// RedisPoolUtil.setEx(userinfo.getUser_name(),userinfo.getUser_name(),60*60);
Userinfo user = new Userinfo();
user.setUser_name(userinfo.getUser_name());
return user;
}
}
/**
* 处理注销/logout
*/
@RequestMapping("/logout")
public ResponseModel user_logout(HttpServletRequest request,@Param("user_name")String user_name){
try{
HttpSession session = request.getSession();
session.removeAttribute("user");
// RedisPoolUtil.del(user_name);
return new ResponseModel("注销成功!");
}catch (Exception ex){
ex.printStackTrace();
return new ResponseModel(false,"注销失败!"+ ex.getMessage());
}
}
@RequestMapping("/queryUserByName")
public Userinfo queryUserByName(String user_name){
return this.user_service.getUserByname(user_name);
}
@RequestMapping("/list")
public List<Userinfo> list(){
return this.user_service.getAllUserinfos();
}
@RequestMapping("/stop")
public ResponseModel user_stop(long user_id){
try{
this.user_service.user_editstatus(0, user_id);
return new ResponseModel("注销成功!");
}catch (Exception ex){
ex.printStackTrace();
return new ResponseModel(false,"注销失败" + ex.getMessage());
}
}
@RequestMapping("/activate")
public ResponseModel user_activate(long user_id){
try{
this.user_service.user_editstatus(1, user_id);
return new ResponseModel("激活成功!");
}catch (Exception ex){
ex.printStackTrace();
return new ResponseModel(false,"激活失败" + ex.getMessage());
}
}
@RequestMapping("/editPwd")
public ResponseModel user_editPwd(HttpServletRequest request) throws Exception{
request.setCharacterEncoding("utf-8");
String user_oldpwd = request.getParameter("user_oldpwd");
String user_newpwd = request.getParameter("user_newpwd");
String user_name = request.getParameter("user_name");
if((this.user_service.getUserByname(user_name)).getUser_pwd().equals(user_oldpwd)){
this.user_service.user_editpwd(user_newpwd, user_name);
return new ResponseModel("修改成功,请重新登录!");
}else {
return new ResponseModel(false,"修改失败,原密码错误!");
}
}
@RequestMapping("/add")
public ResponseModel user_insert(Userinfo user){
try{
if((this.user_service.getUserByname(user.getUser_name())) == null){
this.user_service.user_insert(user);
return new ResponseModel("创建成功!");
}else {
return new ResponseModel(false,"创建失败,名称重复!");
}
}catch (Exception ex){
ex.printStackTrace();
return new ResponseModel(false,"创建失败!" + ex.getMessage());
}
}
@RequestMapping("/edit")
public ResponseModel user_edit(Userinfo user) {
Userinfo userinfo = this.user_service.getUserByname(user.getUser_name());
//如果等于空,可修改user_name
if (userinfo == null) {
this.user_service.user_edit(user);
return new ResponseModel("保存成功!");
} else {
//有此人 判断是不是本人
if (userinfo.getUser_id() == user.getUser_id()) {
this.user_service.user_edit(user);
return new ResponseModel("保存成功!");
} else {
return new ResponseModel(false, "保存失败,名称重复!");
}
}
}
}
| [
"937872621@qq.com"
] | 937872621@qq.com |
96e8ffab43985e8d19f924ea346f9d5dfbf4f334 | 4e1c1b00ee7f75ee5a8b7e0cc913159d097bff72 | /src/com/example/apps/basictwitter/models/Tweet.java | 56ee53a908d50952b1e3158d03ee5ff7b655d948 | [] | no_license | cdsurfer0212/Android-Training-SimpleTwitterClient | b7ad628d85388233a8df643d5ed7d3ec1b0ad003 | 14003ed71976f7ab6220912dad4b6f594ccae938 | refs/heads/master | 2020-12-03T09:15:15.128212 | 2014-12-08T06:46:42 | 2014-12-08T06:46:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,797 | java | package com.example.apps.basictwitter.models;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.activeandroid.Model;
import com.activeandroid.annotation.Column;
import com.activeandroid.annotation.Column.ForeignKeyAction;
import com.activeandroid.annotation.Table;
import com.activeandroid.query.Select;
import com.activeandroid.util.SQLiteUtils;
@Table(name = "Tweets")
public class Tweet extends Model implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1168884680425837754L;
@Column(name = "tweet_createdAt")
private String createdAt;
@Column(name = "tweet_id", unique = true, onUniqueConflict = Column.ConflictAction.REPLACE)
private long tweetId;
@Column(name = "tweet_text")
private String text;
@Column(name = "tweet_user", onUpdate = ForeignKeyAction.CASCADE, onDelete = ForeignKeyAction.CASCADE)
private User user;
private List<Media> medias;
public String getCreatedAt() {
return createdAt;
}
public long getTweetId() {
return tweetId;
}
public String getText() {
return text;
}
public User getUser() {
return user;
}
public List<Media> getMedias() {
return medias;
}
public Tweet() {
super();
}
public static Tweet fromJson(JSONObject json) {
Tweet tweet = new Tweet();
try {
tweet.createdAt = json.getString("created_at");
tweet.tweetId = json.getLong("id");
tweet.text = json.getString("text");
tweet.user = User.fromJSON(json.getJSONObject("user"));
if (json.getJSONObject("entities").has("media"))
tweet.medias = Media.fromJSONArray(json.getJSONObject("entities").getJSONArray("media"));
} catch (JSONException e) {
e.printStackTrace();
return null;
}
return tweet;
}
public static ArrayList<Tweet> fromJSONArray(JSONArray jsonArray) {
ArrayList<Tweet> tweets = new ArrayList<Tweet>(jsonArray.length());
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject tweetJson = null;
try {
tweetJson = jsonArray.getJSONObject(i);
} catch (Exception e) {
e.printStackTrace();
continue;
}
Tweet tweet = Tweet.fromJson(tweetJson);
if (tweet != null) {
tweets.add(tweet);
}
}
return tweets;
}
public static void deleteTweets() {
SQLiteUtils.execSql("DELETE FROM Users");
SQLiteUtils.execSql("DELETE FROM Tweets");
//SQLiteUtils.execSql("drop table if exists Tweets");
}
public static List<Tweet> getTweet(long id) {
return new Select()
.from(Tweet.class)
.where("tweet_id = ?", id)
.execute();
}
public static List<Tweet> getTweets(int count) {
return new Select()
.from(Tweet.class)
.orderBy("tweet_id DESC")
.limit(count)
.execute();
}
public static List<Tweet> getTweetsWithMaxId(long maxId, int count) {
return new Select()
.from(Tweet.class)
.where("tweet_id < ?", maxId)
.orderBy("tweet_id DESC")
.limit(count)
.execute();
}
public static void insertTweets(List<Tweet> tweets) {
for (Tweet tweet: tweets) {
tweet.getUser().save();
tweet.save();
}
}
}
| [
"cdsurfer0212@gmail.com"
] | cdsurfer0212@gmail.com |
872576c1f5fd14cb4dda348cbe65bbeca689e62f | 3da4725ab688d80211bae450796a4175910d3724 | /patient-pojo/src/main/java/hu/kuncystem/patient/pojo/session/Session.java | 405eae8d6b2f48d98e1a1cade2ac69ccfd5f336d | [] | no_license | kuncy88/patient_management | b81442096fac63941ea65eed405e8740b0125837 | 5dba7cd503987f8af978d1b452b5678cfd8a36e0 | refs/heads/master | 2021-01-22T16:04:59.469062 | 2018-03-25T05:36:56 | 2018-03-25T05:36:56 | 102,388,469 | 2 | 1 | null | 2018-03-25T05:36:57 | 2017-09-04T18:02:56 | Java | UTF-8 | Java | false | false | 3,513 | java | package hu.kuncystem.patient.pojo.session;
/**
* This object is a simple POJO containing get/set methods. This object is going
* to work as a Model.
*
* @author Csaba Kun <kuncy88@gmail.com>
* @date 2017. nov. 7.
*
* @version 1.0
*/
public class Session {
// Identification of one session.
private long id;
// Object.User -> id
private long userId;
// Normal ip address
private String ip;
// Data of browser or pc
private String userAgent;
// This session is enabled or disabled
private boolean disable;
/**
* This class will pass information to session dao object to get the data it
* needs.
*
*/
public Session() {
}
/**
* This class will pass information to session dao object to get the data it
* needs.
*
* @param id
* Identification of one session.
*/
public Session(long id) {
setId(id);
}
/**
* This class will pass information to session dao object to get the data it
* needs.
*
* @param userId
* This is the unique user id. This id identifies one row in the
* User table.
* @param ip
* Ip address of user.
*/
public Session(long userId, String ip) {
setUserId(userId);
setIp(ip);
}
/**
* Get identification of one session.
*
* @return long unique row id.
*/
public long getId() {
return id;
}
/**
* Get current session ip.
*/
public String getIp() {
return ip;
}
/**
* Get data of browser or pc
*/
public String getUserAgent() {
return userAgent;
}
/**
* Get user's id who belongs to session.
*/
public long getUserId() {
return userId;
}
/**
* Check the session that it is enabled or not.
*/
public boolean isDisabled() {
return disable;
}
/**
* Set that the session is enabled or not.
*
* @param disabled
* true: session is disabled, false: session is enabled
*/
public void setDisabled(boolean disabled) {
this.disable = disabled;
}
/**
* Set new identification.
*
* @param id
* Identification of one session. If the value is -1 then it
* means that the set data will be a new data. This isn�t in
* database, yet.
*/
public void setId(long id) {
this.id = id;
}
/**
* This ip is current ip which belongs to user's pc.
*
* @param ip
* Ip address of user
*/
public void setIp(String ip) {
this.ip = ip;
}
/**
* Add user's data from the pc or the web browser. This string have to
* contains more information which identifies the workstation.
*
* @param userAgent
* Data of browser or pc
*/
public void setUserAgent(String userAgent) {
this.userAgent = userAgent;
}
/**
* Set user's unique id. This user will be doctor or patient, too.
*
* @param userId
* This is the unique user id. This id identifies one row in the
* User table.
*/
public void setUserId(long userId) {
this.userId = userId;
}
}
| [
"kuncy88@gmail.com"
] | kuncy88@gmail.com |
071569b63a4587b6cbb2851eba9d2b5e21f8dece | cc5fcb6fb603f7c63614c6a902ff5b79ada9b7f7 | /Rememberme/src/main/java/com/anhtuan/springmvc/dao/AbstractDao.java | a491a07d562d1a0ed47eb6561582858f26eb7aa6 | [] | no_license | tuandinhanh/My-Spring-Project | 34d3ab31fc3d2d86176ecc93225fb95dd6c6e8fe | 6eae358679207000c5cfd9cf7ff2110636db4427 | refs/heads/master | 2021-05-14T10:22:32.977454 | 2018-08-04T12:04:11 | 2018-08-04T12:04:11 | 116,352,225 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,013 | java | package com.anhtuan.springmvc.dao;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
public abstract class AbstractDao<PK extends Serializable, T> {
private final Class<T> persistentClass;
protected AbstractDao() {
this.persistentClass = (Class<T>) ((ParameterizedType) this.getClass().getGenericSuperclass()).getActualTypeArguments()[1];
}
@Autowired
private SessionFactory sessionFactory;
protected Session getSession() {
return sessionFactory.getCurrentSession();
}
public T getByKey(PK key) {
return (T) getSession().get(persistentClass, key);
}
public void persist(T entity) {
getSession().persist(entity);
}
public void update(T entity) {
getSession().update(entity);
}
public void delete(T entity) {
getSession().delete(entity);
}
}
| [
"dinhanhtuantuan@gmail.com"
] | dinhanhtuantuan@gmail.com |
7b55de3b4f231ff7ab1a226a80a761f730daa8a0 | 37d8b470e71ea6edff6ed108ffd2b796322b7943 | /zcms/src/com/zving/framework/utility/FileUtil.java | 5f18d2bb217cee893af7ac4f4654925f358113a7 | [] | no_license | haifeiforwork/myfcms | ef9575be5fc7f476a048d819e7c0c0f2210be8ca | fefce24467df59d878ec5fef2750b91a29e74781 | refs/heads/master | 2020-05-15T11:37:50.734759 | 2014-06-28T08:31:55 | 2014-06-28T08:31:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,272 | java | package com.zving.framework.utility;
import com.zving.framework.Constant;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.PrintStream;
import java.io.Serializable;
import java.net.URL;
import java.util.Date;
import java.util.regex.Pattern;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.logging.Log;
public class FileUtil {
public static boolean writeText(String fileName, String content) {
return writeText(fileName, content, Constant.GlobalCharset);
}
public static boolean writeText(String fileName, String content, String encoding) {
return writeText(fileName, content, encoding, false);
}
public static boolean writeText(String fileName, String content, String encoding,
boolean bomFlag) {
try {
byte[] bs = content.getBytes(encoding);
if ((encoding.equalsIgnoreCase("UTF-8")) && (bomFlag)) {
bs = ArrayUtils.addAll(StringUtil.BOM, bs);
}
writeByte(fileName, bs);
} catch (Exception e) {
return false;
}
return true;
}
public static byte[] readByte(String fileName) {
try {
FileInputStream fis = new FileInputStream(fileName);
byte[] r = new byte[fis.available()];
fis.read(r);
fis.close();
return r;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static byte[] readByte(File f) {
try {
FileInputStream fis = new FileInputStream(f);
byte[] r = readByte(fis);
fis.close();
return r;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static byte[] readByte(InputStream is) {
try {
byte[] r = new byte[is.available()];
is.read(r);
return r;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static boolean writeByte(String fileName, byte[] b) {
try {
BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(fileName));
fos.write(b);
fos.close();
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
public static boolean writeByte(File f, byte[] b) {
try {
BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(f));
fos.write(b);
fos.close();
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
public static String readText(File f) {
return readText(f, Constant.GlobalCharset);
}
public static String readText(File f, String encoding) {
try {
InputStream is = new FileInputStream(f);
String str = readText(is, encoding);
is.close();
return str;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static String readText(InputStream is, String encoding) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(is, encoding));
StringBuffer sb = new StringBuffer();
String line;
while ((line = br.readLine()) != null) {
sb.append(line);
sb.append("\n");
}
br.close();
return sb.toString();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static String readText(String fileName) {
return readText(fileName, Constant.GlobalCharset);
}
public static String readText(String fileName, String encoding) {
try {
InputStream is = new FileInputStream(fileName);
BufferedReader br = new BufferedReader(new InputStreamReader(is, encoding));
StringBuffer sb = new StringBuffer();
int c = br.read();
if ((!(encoding.equalsIgnoreCase("utf-8"))) || (c != 65279))
sb.append((char) c);
String line;
while ((line = br.readLine()) != null) {
sb.append(line);
sb.append("\n");
}
br.close();
is.close();
return sb.toString();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static String readURLText(String urlPath) {
return readURLText(urlPath, Constant.GlobalCharset);
}
public static String readURLText(String urlPath, String encoding) {
try {
URL url = new URL(urlPath);
BufferedReader in = new BufferedReader(
new InputStreamReader(url.openStream(), encoding));
StringBuffer sb = new StringBuffer();
String line;
while ((line = in.readLine()) != null) {
sb.append(line + "\n");
}
in.close();
return sb.toString();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static boolean delete(String path) {
File file = new File(path);
return delete(file);
}
public static boolean delete(File file) {
if (!(file.exists())) {
LogUtil.getLogger().warn("文件或文件夹不存在:" + file);
return false;
}
if (file.isFile()) {
return file.delete();
}
return deleteDir(file);
}
private static boolean deleteDir(File dir) {
try {
return ((deleteFromDir(dir)) && (dir.delete()));
} catch (Exception e) {
LogUtil.getLogger().warn("删除文件夹操作出错");
}
return false;
}
public static boolean mkdir(String path) {
File dir = new File(path);
if (!(dir.exists())) {
dir.mkdirs();
}
return true;
}
public static boolean deleteEx(String fileName) {
int index1 = fileName.lastIndexOf("\\");
int index2 = fileName.lastIndexOf("/");
index1 = (index1 > index2) ? index1 : index2;
String path = fileName.substring(0, index1);
String name = fileName.substring(index1 + 1);
File f = new File(path);
if ((f.exists()) && (f.isDirectory())) {
File[] files = f.listFiles();
int i = 0;
while (true) {
if (Pattern.matches(name, files[i].getName()))
files[i].delete();
++i;
if (i >= files.length) {
return true;
}
}
}
return false;
}
public static boolean deleteFromDir(String dirPath) {
File file = new File(dirPath);
return deleteFromDir(file);
}
public static boolean deleteFromDir(File dir) {
if (!(dir.exists())) {
LogUtil.getLogger().warn("文件夹不存在:" + dir);
return false;
}
if (!(dir.isDirectory())) {
LogUtil.getLogger().warn(dir + "不是文件夹");
return false;
}
File[] tempList = dir.listFiles();
for (int i = 0; i < tempList.length; ++i) {
if (!(delete(tempList[i]))) {
return false;
}
}
return true;
}
public static boolean copy(String oldPath, String newPath, FileFilter filter) {
File oldFile = new File(oldPath);
File[] oldFiles = oldFile.listFiles(filter);
boolean flag = true;
if (oldFiles != null) {
for (int i = 0; i < oldFiles.length; ++i) {
if (!(copy(oldFiles[i], newPath + "/" + oldFiles[i].getName()))) {
flag = false;
}
}
}
return flag;
}
public static boolean copy(String oldPath, String newPath) {
File oldFile = new File(oldPath);
return copy(oldFile, newPath);
}
public static boolean copy(File oldFile, String newPath) {
if (!(oldFile.exists())) {
LogUtil.getLogger().warn("文件或者文件夹不存在:" + oldFile);
return false;
}
if (oldFile.isFile()) {
return copyFile(oldFile, newPath);
}
return copyDir(oldFile, newPath);
}
private static boolean copyFile(File oldFile, String newPath) {
if (!(oldFile.exists())) {
LogUtil.getLogger().warn("文件不存在:" + oldFile);
return false;
}
if (!(oldFile.isFile())) {
LogUtil.getLogger().warn(oldFile + "不是文件");
return false;
}
try {
int byteread = 0;
InputStream inStream = new FileInputStream(oldFile);
FileOutputStream fs = new FileOutputStream(newPath);
byte[] buffer = new byte[1024];
while ((byteread = inStream.read(buffer)) != -1) {
fs.write(buffer, 0, byteread);
}
fs.close();
inStream.close();
} catch (Exception e) {
LogUtil.getLogger().warn("复制单个文件" + oldFile.getPath() + "操作出错。错误原因:" + e.getMessage());
return false;
}
return true;
}
private static boolean copyDir(File oldDir, String newPath) {
if (!(oldDir.exists())) {
LogUtil.info("文件夹不存在:" + oldDir);
return false;
}
if (!(oldDir.isDirectory())) {
LogUtil.info(oldDir + "不是文件夹");
return false;
}
try {
new File(newPath).mkdirs();
File[] files = oldDir.listFiles();
File temp = null;
for (int i = 0; i < files.length; ++i) {
temp = files[i];
if (temp.isFile()) {
if (!(copyFile(temp, newPath + "/" + temp.getName())))
return false;
} else if ((temp.isDirectory())
&& (!(copyDir(temp, newPath + "/" + temp.getName())))) {
return false;
}
}
return true;
} catch (Exception e) {
LogUtil.getLogger().info("复制整个文件夹内容操作出错。错误原因:" + e.getMessage());
}
return false;
}
public static boolean move(String oldPath, String newPath) {
return ((copy(oldPath, newPath)) && (delete(oldPath)));
}
public static boolean move(File oldFile, String newPath) {
return ((copy(oldFile, newPath)) && (delete(oldFile)));
}
public static void serialize(Serializable obj, String fileName) {
try {
FileOutputStream f = new FileOutputStream(fileName);
ObjectOutputStream s = new ObjectOutputStream(f);
s.writeObject(obj);
s.flush();
s.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public static byte[] serialize(Serializable obj) {
try {
ByteArrayOutputStream b = new ByteArrayOutputStream();
ObjectOutputStream s = new ObjectOutputStream(b);
s.writeObject(obj);
s.flush();
s.close();
return b.toByteArray();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public static Object unserialize(String fileName) {
try {
FileInputStream in = new FileInputStream(fileName);
ObjectInputStream s = new ObjectInputStream(in);
Object o = s.readObject();
s.close();
return o;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public static Object unserialize(byte[] bs) {
try {
ByteArrayInputStream in = new ByteArrayInputStream(bs);
ObjectInputStream s = new ObjectInputStream(in);
Object o = s.readObject();
s.close();
return o;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public static byte[] mapToBytes(Mapx map) {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try {
Object[] ks = map.keyArray();
Object[] vs = map.valueArray();
for (int i = 0; i < map.size(); ++i) {
String k = String.valueOf(ks[i]);
Object v = vs[i];
if (v == null)
bos.write(new byte[1]);
else if (v instanceof String)
bos.write(new byte[] { 1 });
else if (v instanceof Long)
bos.write(new byte[] { 2 });
else if (v instanceof Integer)
bos.write(new byte[] { 3 });
else if (v instanceof Boolean)
bos.write(new byte[] { 4 });
else if (v instanceof Date)
bos.write(new byte[] { 5 });
else if (v instanceof Mapx)
bos.write(new byte[] { 6 });
else if (v instanceof Serializable)
bos.write(new byte[] { 7 });
else {
throw new RuntimeException("未知的数据类型:" + v.getClass().getName());
}
byte[] bs = k.getBytes();
bos.write(NumberUtil.toBytes(bs.length));
bos.write(bs);
if (v == null)
continue;
if (v instanceof String) {
bs = v.toString().getBytes();
bos.write(NumberUtil.toBytes(bs.length));
bos.write(bs);
} else if (v instanceof Long) {
bos.write(NumberUtil.toBytes(((Long) v).longValue()));
} else if (v instanceof Integer) {
bos.write(NumberUtil.toBytes(((Integer) v).intValue()));
} else if (v instanceof Boolean) {
bos.write((((Boolean) v).booleanValue()) ? 1 : 0);
} else if (v instanceof Date) {
bos.write(NumberUtil.toBytes(((Date) v).getTime()));
} else {
byte[] arr;
if (v instanceof Mapx) {
arr = mapToBytes((Mapx) v);
bos.write(NumberUtil.toBytes(arr.length));
bos.write(arr);
} else if (v instanceof Serializable) {
arr = serialize((Serializable) v);
bos.write(NumberUtil.toBytes(arr.length));
bos.write(arr);
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
return bos.toByteArray();
}
public static Mapx bytesToMap(byte[] arr) {
ByteArrayInputStream bis = new ByteArrayInputStream(arr);
int b = -1;
Mapx map = new Mapx();
byte[] kbs = new byte[4];
byte[] vbs = (byte[]) null;
try {
while ((b = bis.read()) != -1) {
bis.read(kbs);
int len = NumberUtil.toInt(kbs);
vbs = new byte[len];
bis.read(vbs);
String k = new String(vbs);
Object v = null;
if (b == 1) {
bis.read(kbs);
len = NumberUtil.toInt(kbs);
vbs = new byte[len];
bis.read(vbs);
v = new String(vbs);
} else if (b == 2) {
vbs = new byte[8];
bis.read(vbs);
v = new Long(NumberUtil.toLong(vbs));
} else if (b == 3) {
vbs = new byte[4];
bis.read(vbs);
v = new Integer(NumberUtil.toInt(vbs));
} else if (b == 4) {
int i = bis.read();
v = new Boolean(i == 1);
} else if (b == 5) {
vbs = new byte[8];
bis.read(vbs);
v = new Date(NumberUtil.toLong(vbs));
} else if (b == 6) {
bis.read(kbs);
len = NumberUtil.toInt(kbs);
vbs = new byte[len];
bis.read(vbs);
v = bytesToMap(vbs);
} else if (b == 7) {
bis.read(kbs);
len = NumberUtil.toInt(kbs);
vbs = new byte[len];
bis.read(vbs);
v = unserialize(vbs);
}
map.put(k, v);
}
} catch (IOException e) {
e.printStackTrace();
}
return map;
}
public static void main(String[] args) {
byte[] bs = { 1, 0, 0, 0, 3, 85, 114, 108, 0, 0, 0, 22, 104, 116, 116, 112, 58, 47, 47,
110, 101, 119, 115, 46, 99, 104, 101, 115, 104, 105, 46, 99, 111, 109, 0, 0, 0, 6,
82, 101, 102, 85, 114, 108, 0, 0, 0, 7, 99, 104, 97, 114, 115, 101, 116, 4, 0, 0,
0, 13, 105, 115, 84, 101, 120, 116, 67, 111, 110, 116, 101, 110, 116, 0, 0, 0, 0,
16, 108, 97, 115, 116, 109, 111, 100, 105, 102, 105, 101, 100, 68, 97, 116, 101, 2,
0, 0, 0, 16, 108, 97, 115, 116, 68, 111, 119, 110, 108, 111, 97, 100, 84, 105, 109,
101, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 5, 108, 101, 118, 101, 108, 0, 0, 0, 0, 0,
0, 0, 12, 69, 114, 114, 111, 114, 77, 101, 115, 115, 97, 103, 101, 4, 0, 0, 0, 9,
105, 115, 80, 97, 103, 101, 85, 114, 108, 0, 0, 0, 0, 4, 102, 111, 114, 109 };
Mapx map = bytesToMap(bs);
System.out.println(map);
}
}
/*
* Location: F:\JAVA\Tomcat5.5\webapps\zcms\WEB-INF\classes\ Qualified Name:
* com.zving.framework.utility.FileUtil JD-Core Version: 0.5.3
*/ | [
"yourfei@live.cn@c1c2bf6e-ae9d-b823-7fc2-ff1dc594729e"
] | yourfei@live.cn@c1c2bf6e-ae9d-b823-7fc2-ff1dc594729e |
9eeec91ad42c41936f5a2d9fc519cb6e088d74d4 | 4a355e0dff2328d4eea94312e4a50bcb3b534d01 | /src/main/java/com/netshoes/paypal/conf/feign/Token.java | 724bd0a0e4340e77b266063288dcc88f3dcc8098 | [] | no_license | andreotto/teste-paypal | 02d47029de3f1c3ab2bbbf0df71991d3232dab02 | 82c8a3ca29afb2b951f9b903e6241029a26de477 | refs/heads/master | 2021-01-19T19:10:13.397872 | 2017-08-23T14:13:19 | 2017-08-23T14:13:19 | 101,186,560 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 320 | java | package com.netshoes.paypal.conf.feign;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class Token {
private String scope;
private String nonce;
private String access_token;
private String token_type;
private String app_id;
private String expires_in;
}
| [
"andreotto@gmail.com"
] | andreotto@gmail.com |
58920425f6dc15167190353844a8f26c7d5f47a7 | b44a102cd20146a858e004476e64da30842a1019 | /app/src/main/java/org/sunbird/ui/HorizontalScroller.java | f8af36b5c9fb531c242679bb78b8c18f9d295643 | [
"MIT"
] | permissive | G33tha/sunbird-android | 25fe082c0ec77e5f0eeb199a01dc9f65c672c874 | 10e56a9b67826ee96560fb8a38714218dc71c1c1 | refs/heads/master | 2020-04-10T03:53:47.323324 | 2018-12-07T06:44:12 | 2018-12-07T06:44:12 | 160,782,287 | 0 | 0 | MIT | 2018-12-07T06:39:23 | 2018-12-07T06:39:23 | null | UTF-8 | Java | false | false | 3,074 | java | package org.sunbird.ui;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.widget.HorizontalScrollView;
/**
* Created by nikith.shetty on 02/03/18.
*/
public class HorizontalScroller implements View.OnTouchListener{
private static String TAG = "HorizontalScroller";
OnScrollStopListener listener;
int initialX = 0;
int posOnTouch = 0;
HorizontalScrollView scrollView;
GestureDetector gestureDetector;
int SWIPE_MIN_DISTANCE = 15;
int SWIPE_THRESHOLD_VELOCITY = 300;
public HorizontalScroller(HorizontalScrollView scrollView) {
this.scrollView = scrollView;
this.scrollView.setOnTouchListener(this);
this.gestureDetector = new GestureDetector(scrollView.getContext(), new CustomGestureDetector());
}
public interface OnScrollStopListener {
void onScrollStopped(int deltaX);
}
@Override
public boolean onTouch(View view, MotionEvent ev) {
if (gestureDetector.onTouchEvent(ev)){
Log.e(TAG, "onTouch: -> handled by gesture");
return true;
}
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
posOnTouch = scrollView.getScrollX();
break;
case MotionEvent.ACTION_UP:
Log.e(TAG, "onTouch: -> handled by scroll stop");
checkIfScrollStopped();
}
return false;
}
private void checkIfScrollStopped() {
initialX = scrollView.getScrollX();
scrollView.postDelayed(new Runnable() {
@Override
public void run() {
int updatedX = scrollView.getScrollX();
if (updatedX == initialX) {
//we've stopped
scrollView.smoothScrollBy(0,0);
if (listener != null) {
listener.onScrollStopped(scrollView.getScrollX() - posOnTouch);
}
} else {
initialX = updatedX;
checkIfScrollStopped();
}
}
}, 50);
}
public void setOnScrollStoppedListener(OnScrollStopListener yListener) {
listener = yListener;
}
class CustomGestureDetector extends GestureDetector.SimpleOnGestureListener{
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
if (e1 != null && e2 != null) {
if (Math.abs(e1.getX() - e2.getX()) > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) {
scrollView.smoothScrollBy(0,0);
if (listener != null) {
listener.onScrollStopped(Math.round(e1.getX() - e2.getX()));
}
return true;
}
return false;
}
return false;
//super.onFling(e1, e2, velocityX, velocityY);
}
}
}
| [
"nikith.shetty@juspay.in"
] | nikith.shetty@juspay.in |
47ad9cdd0930526d471e451f41be368fe6c7b145 | ae2a43ae7bf5c6543c84fee63693082bceb9ac23 | /spring-cloud-demo/service-fegin/src/test/java/com/cloud/fegin/FeginApplicationTests.java | e69196a1bf5aff02b66ebc26720e1334aae8adc4 | [] | no_license | luckysky1013/springcloud | d71ed77f43ee21445d85d6033025a6773e7ceae2 | 9259fd2689b155657cec2d51c0a45178f4a54eff | refs/heads/master | 2020-04-16T12:26:39.745169 | 2019-01-14T02:11:44 | 2019-01-14T02:11:44 | 165,579,642 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 347 | java | package com.cloud.fegin;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class FeginApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"luckysky1013@163.com"
] | luckysky1013@163.com |
fec695ba4883d7a867c9ed841c9a50de9be6bc4e | 0108eebefe99ad22beb5e267ea2515f2523203f2 | /app/src/main/java/com/sanwenyu/stemplate/ui/zone/bean/User.java | 2c315ce4e5dedeb1f5eadf13ced4c38275465a90 | [] | no_license | sanwenyulm/STemplate | 5439164236600e73db8e53fa517aa2516e8f3b58 | 4217233dd9ef80ef0e29fed5607c5363ee7d468f | refs/heads/master | 2022-04-01T12:33:43.189389 | 2020-01-28T12:55:29 | 2020-01-28T12:55:29 | 236,731,108 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,662 | java | package com.sanwenyu.stemplate.ui.zone.bean;
import android.os.Parcel;
import android.os.Parcelable;
/**
* des:发说说者实体类
* Created by xsf
* on 2016.07.11:11
*/
public class User implements Parcelable {
private String id;
private String name;
private String headUrl;
private boolean isOpen=false;
public User(String id, String name, String headUrl){
this.id = id;
this.name = name;
this.headUrl = headUrl;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getHeadUrl() {
return headUrl;
}
public void setHeadUrl(String headUrl) {
this.headUrl = headUrl;
}
public boolean isOpen() {
return isOpen;
}
public void setOpen(boolean open) {
isOpen = open;
}
@Override
public String toString() {
return "id = " + id
+ "; name = " + name
+ "; headUrl = " + headUrl;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.id);
dest.writeString(this.name);
dest.writeString(this.headUrl);
dest.writeByte(isOpen ? (byte) 1 : (byte) 0);
}
protected User(Parcel in) {
this.id = in.readString();
this.name = in.readString();
this.headUrl = in.readString();
this.isOpen = in.readByte() != 0;
}
public static final Creator<User> CREATOR = new Creator<User>() {
@Override
public User createFromParcel(Parcel source) {
return new User(source);
}
@Override
public User[] newArray(int size) {
return new User[size];
}
};
}
| [
"you@example.com"
] | you@example.com |
2c2baec8f5171a3f1872ec862b6d571ba89c8510 | faf7d2e5ac7c5fe55f005f08a2cadf9e26e8cb86 | /iflytransporter-api/src/main/java/com/iflytransporter/api/service/FeedbackService.java | ee8bda4cc9dabe9316d835b0468a5ee23fd4f6ca | [
"Apache-2.0"
] | permissive | zhangyiran0314/20180316 | 7ab39b4eb49048d79bf795b0fc7212aa78a94241 | bddf49414cbc25f43fedf8b708c70f3c0e9cb0d1 | refs/heads/master | 2021-09-09T17:59:23.816269 | 2018-03-18T19:08:38 | 2018-03-18T19:08:38 | 110,239,220 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 159 | java | package com.iflytransporter.api.service;
import com.iflytransporter.common.bean.Feedback;
public interface FeedbackService {
int sava(Feedback record);
}
| [
"252543781@qq.com"
] | 252543781@qq.com |
8e17be482ba3510675a0ecfce486eee641bc99e3 | ef21209a731237771d679dedd1f32813c0ba1dcc | /Builder/Builder.java | 78e532a44c7f41f762695bf337588f27bbd273ed | [] | no_license | yaho2k/DesignPattern | 15e9229d5f4d677f4f316a303ce61a84bb9a9677 | bab6fa49683345c0fe17afc9e80e030b88d7c3d4 | refs/heads/main | 2023-08-17T03:12:01.771928 | 2021-09-27T15:31:30 | 2021-09-27T15:31:30 | 403,957,529 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 242 | java | package Builder;
public abstract class Builder {
public abstract void makeTitle(String title);
public abstract void makeString(String str);
public abstract void makeItems(String[] itmes);
public abstract void close();
}
| [
"yaho2k@gmail.com"
] | yaho2k@gmail.com |
66ef3bf42bdfafb5699cb4559b2c9a3d08a015b6 | 3f479c2616fa809e9958d12efbbb5e6ac24db753 | /src/main/java/com/designpatterns/cinema/NachosDecorator.java | f4634dd62d2d09e1c24189ea7f6dff9d1802d494 | [] | no_license | FreeTimeGit/DesignPatterns | 6fc27d62f4a091ffe0b187dd5579ebed8393add8 | fdd34f40e73c8ebcb58e6c10806edc42269b00ab | refs/heads/master | 2020-03-16T20:26:50.328227 | 2018-05-10T22:06:40 | 2018-05-10T22:06:40 | 132,958,791 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 341 | java | package com.designpatterns.cinema;
public class NachosDecorator implements Movie {
private Movie movie;
private double price = 7;
public NachosDecorator(Movie movie) {
this.movie = movie;
}
public double calculatePriceBeforeDiscount() {
return movie.calculatePriceBeforeDiscount()+this.price;
}
}
| [
"kudow44@gmail.com"
] | kudow44@gmail.com |
8d5af9ab09ed6230fa8b76b540a4192db8505a44 | 7b9daa39a477bec7dcbe7c556a528375c9af035e | /darkhour99/darkhourutils/items/DU_GrinderBlade.java | a10e3bd74332ba16964486c39d666f6a57a07708 | [] | no_license | Darkhour99/DarkhourUtils | d8d30bb5acad8755631caac4b2ec589247bbc0f5 | 49ee53c0a39a108aeb67583edfe5b67a86c7c1a5 | refs/heads/master | 2021-03-12T20:29:01.533498 | 2015-03-23T00:40:03 | 2015-03-23T00:40:03 | 32,654,891 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 75 | java | package darkhour99.darkhourutils.items;
public class DU_GrinderBlade {
}
| [
"darkhour97@gmail.com"
] | darkhour97@gmail.com |
96010b9db78c0686b9e5a5d2adaa36413b8a3645 | c163c4e90659a9dbb46c478fa85d7d31a4abcbf5 | /src/com/example/exemplojackson/Pagamento.java | d0a3d182ed163398529c4174dc37acbe9e93e719 | [] | no_license | carloscavalcanti/ExemploJackson | 139331ea338b0a874833b7e26c1ac199d5f64681 | 4d6658eb1c2f9d3a1397beb593149b57ec431535 | refs/heads/master | 2016-09-10T14:59:51.400316 | 2012-11-13T23:59:00 | 2012-11-13T23:59:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 574 | java | package com.example.exemplojackson;
public class Pagamento {
private Funcionario funcionario;
private Double valor;
public Pagamento() {
}
public Pagamento(Funcionario funcionario, Double valor) {
this.funcionario = funcionario;
this.valor = valor;
}
public Funcionario getFuncionario() {
return funcionario;
}
public void setFuncionario(Funcionario funcionario) {
this.funcionario = funcionario;
}
public Double getValor() {
return valor;
}
public void setValor(Double valor) {
this.valor = valor;
}
}
| [
"carlos.cavalcanti@abacomm.com.br"
] | carlos.cavalcanti@abacomm.com.br |
dad8829bffd8a86b8b1fca5988d8621de598a90a | 33d0dd5425072effaf044b5a2ee914b60205905e | /FinalProject/src/Model.java | 74da38b1d7d76612343fd9c272442840dd8481ba | [] | no_license | JohnKraft93/ConnectFour | d32e247c0869c034fd69d112684b5589fdd43313 | c1a6f18c1d07fa0662ebe6874bb101dd87c6077c | refs/heads/master | 2022-09-07T17:09:28.351934 | 2020-05-22T18:59:00 | 2020-05-22T18:59:00 | 259,106,483 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,035 | java | import java.util.Arrays;
public class Model {
private final int maxCol = 7;
private final int maxRow = 6;
private final Integer[][] grid = new Integer[maxRow][maxCol];
private ClientHandler CurrentPlayer;
public Model() {
for(Integer[] row: grid) {
Arrays.fill(row, 0);
}
}
public ClientHandler getCurrentPlayer() {
return CurrentPlayer;
}
public void setCurrentPlayer(ClientHandler ch) {
this.CurrentPlayer = ch;
}
public synchronized Integer validMove(ClientHandler player, int col) {
if(player == CurrentPlayer){
for(int i = maxRow-1; i >= 0; i--) {
if(grid[i][col] == 0){
grid[i][col] = Integer.parseInt(player.getPlayer());
CurrentPlayer = CurrentPlayer.getOpponent();
return i;
}
}
}
return -1;
}
public boolean CheckforFullBoard(){
System.out.println("CEHCKING FULL");
int count = 0;
for(int i = 0; i < maxRow; i++){
for(int j = 0; j < maxCol; j++){
if(grid[i][j] != 0){
count++;
}
}
}
return (count == 42);
}
public boolean CheckforWinner(ClientHandler player, int row, int col) {
int count = 0;
for(int i = 0; i < maxCol; i++){
if(grid[row][i]==Integer.parseInt(player.getPlayer())){
count++;
} else { count = 0;}
if(count >= 4){
return true;
}
}
for(int i = 0; i < maxRow; i++){
if(grid[i][col]==Integer.parseInt(player.getPlayer())){
count++;
} else { count = 0;}
if(count >= 4){
return true;
}
}
for (int tempRow = 0; tempRow < maxRow - 3; tempRow++){
for (int tempCol = 0; tempCol < maxCol - 3; tempCol++){
if (!grid[tempRow][tempCol].equals(0) &&
grid[tempRow][tempCol].equals(grid[tempRow+1][tempCol+1]) &&
grid[tempRow][tempCol].equals(grid[tempRow+2][tempCol+2]) &&
grid[tempRow][tempCol].equals(grid[tempRow+3][tempCol+3])) {
return true;
}
}
}
for (int tempRow = 0; tempRow < maxRow - 3; tempRow++){
for (int tempCol = 3; tempCol < maxCol; tempCol++){
if (!grid[tempRow][tempCol].equals(0) &&
grid[tempRow][tempCol].equals(grid[tempRow+1][tempCol-1]) &&
grid[tempRow][tempCol].equals(grid[tempRow+2][tempCol-2]) &&
grid[tempRow][tempCol].equals(grid[tempRow+3][tempCol-3])){
return true;
}
}
}
return false;
}
} | [
"43728778+JohnKraft93@users.noreply.github.com"
] | 43728778+JohnKraft93@users.noreply.github.com |
2b1073b49b901f45af85dd47ae6b1173c1c79e45 | 82a58b10217539d081840bd0420d1ca6e1c61752 | /src/test/MahjongServerTest.java | 803bc9b7e3cec6e402495ffdd40796f01c0c55f6 | [] | no_license | Asheng321/MahjongJava | 541a9144738c38e64a730fc1e1233d0d362a1043 | aa027f8c478d3b14c7e7a5aa4dcf19af874cbf0f | refs/heads/master | 2021-01-21T07:54:19.670480 | 2013-05-31T15:58:54 | 2013-05-31T15:58:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,314 | java | package test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import server.MahjongGame;
import server.Server;
import server.Transporter;
import system.Player;
import system.Rule;
/**
* コンソール用の麻雀サーバー
*/
public class MahjongServerTest {
public static Player p = new Player(10, "imatom", true);
public static Server server;
public static Map<Player, Transporter> transMap = new HashMap<Player, Transporter>(4);
// DEBUG
public static void main(String[] args) {
List<Player> plist = new ArrayList<Player>(4);
plist.add(p);
plist.add(new Player(21, "moseshi", false));
plist.add(new Player(34, "fillshion", false));
plist.add(new Player(47, "morimitsu", false));
Transporter trs = new Transporter();
transMap.put(plist.get(0), trs);
// transMap.put(plist.get(1), new Transporter());
// transMap.put(plist.get(2), new Transporter());
// transMap.put(plist.get(3), new Transporter());
// 結合用
for (Transporter tr : transMap.values()) {
ConsoleClient2 client = new ConsoleClient2(p, tr);
tr.setClient(client);
// tr.setWait(false);
Thread th = new Thread(client);
th.start();
}
Rule rule = new Rule();
MahjongGame game = new MahjongGame(plist, rule, transMap);
game.run();
}
}
| [
"moseshi@gmail.com"
] | moseshi@gmail.com |
503f03ed0fed84acfe8bbcbb509019337d16fc50 | e14ecf52633126191453b0bfbb1d5d5253cfc81b | /Java/JavaProject/JavaProject2/JavaProject2/java/src/main/java/com/dio/java/service/WorkJourneyService.java | ea54ec3a14fbfccc1c7b6ba93c6b84e6fd450907 | [] | no_license | SCvieira0/BootcampsDigitalInnovatioOne | a85112a4c0337fe2d3aead0b34e8396ad027edbe | d5934fa11ddd648339161d613e3b62401afbbd4e | refs/heads/master | 2023-07-28T03:28:21.735243 | 2021-08-19T02:49:14 | 2021-08-19T02:49:14 | 389,727,454 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 999 | java | package com.dio.java.service;
import com.dio.java.model.WorkJourney;
import com.dio.java.repository.WorkJourneyRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@Service
public class WorkJourneyService {
@Autowired
WorkJourneyRepository workJourneyRepository;
public WorkJourney saveWorkJourney(WorkJourney workJourney){
return workJourneyRepository.save(workJourney);
}
public List<WorkJourney> findAll(){
return workJourneyRepository.findAll();
}
public Optional<WorkJourney> getById(Long idWorkJourney){
return workJourneyRepository.findById(idWorkJourney);
}
public WorkJourney updateWorkJourney(WorkJourney workJourney){
return workJourneyRepository.save(workJourney);
}
public void deleteWorkJourney(Long idWorkJourney){
workJourneyRepository.deleteById(idWorkJourney);
}
}
| [
"scvieira09@gmail.com"
] | scvieira09@gmail.com |
f451d080718c0621d6f7942574df50769ced54fb | 7520047049c0d1938fbeffdddac956d971747021 | /shop_common/src/main/java/com/hdx/domain/Order.java | ec75138e0eb129a22f78a2c7260efc18bab64b80 | [] | no_license | a2636846734/-aaa | 348fd9285385ac8d5ba469afa39215f5df71f049 | d6e887a11f3e621fe3f8ccca31927e88e04535e6 | refs/heads/master | 2022-12-24T14:11:42.455325 | 2020-10-07T10:33:26 | 2020-10-07T10:33:26 | 302,001,797 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 586 | java | package com.hdx.domain;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
//订单
@Entity(name = "shop_order")
@Data
public class Order {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long oid;//订单id
private Integer uid;//用户id
private String username;//用户名
private Integer pid;//商品id
private String pname;//商品名称
private Double pprice;//商品单价
private Integer number;//购买数量
} | [
"2636846734@qq.com"
] | 2636846734@qq.com |
1a71c481c3131e1226d46c5d6932c1b4cfceb2c4 | 77499ab233b7766e14fffac6ffa698e7cd8650a3 | /OSATE-AADL2_projects/osate.tests/src/aadl2/tests/StructuralFeatureTest.java | 050e6fc0a2033dd4b5a3feeea07c2e5950009659 | [
"MIT"
] | permissive | carduswork/SmartFireAlarm | a15fb2857810742521c6976466f5fdea54143b8b | 6085b3998d106cd030974f887ae1f428bdd5d3cd | refs/heads/master | 2022-01-09T14:52:42.523976 | 2019-06-22T06:55:47 | 2019-06-22T06:55:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,368 | java | /**
*/
package aadl2.tests;
import aadl2.StructuralFeature;
/**
* <!-- begin-user-doc -->
* A test case for the model object '<em><b>Structural Feature</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are tested:
* <ul>
* <li>{@link aadl2.ClassifierFeature#getFeaturingClassifier() <em>Featuring Classifier</em>}</li>
* </ul>
* </p>
* @generated
*/
public abstract class StructuralFeatureTest extends RefinableElementTest {
/**
* Constructs a new Structural Feature test case with the given name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public StructuralFeatureTest(String name) {
super(name);
}
/**
* Returns the fixture for this Structural Feature test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected StructuralFeature getFixture() {
return (StructuralFeature)fixture;
}
/**
* Tests the '{@link aadl2.ClassifierFeature#getFeaturingClassifier() <em>Featuring Classifier</em>}' feature getter.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see aadl2.ClassifierFeature#getFeaturingClassifier()
* @generated
*/
public void testGetFeaturingClassifier() {
// TODO: implement this feature getter test method
// Ensure that you remove @generated or mark it @generated NOT
fail();
}
} //StructuralFeatureTest
| [
"renangreca@gmail.com"
] | renangreca@gmail.com |
16556d0560841048a6b2616cf1f6fdf077d16b96 | 7893e095972bd30b07548fedc48649fb120de32c | /gradle_dryclean/src/main/java/com/cg/gradle_dryclean/services/CustomerItemService.java | 819c2234b3c836b9ca5317c22ac31303f3490f28 | [] | no_license | Nikita98-web/sample | 8e0f24b1d9a4365219ab1bee94da58a84c4afac8 | c3caa3d292acef02e8f83d0eac29d48036cd3789 | refs/heads/master | 2023-05-07T12:14:09.199043 | 2021-05-22T09:11:49 | 2021-05-22T09:11:49 | 369,728,837 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,637 | java | package com.cg.gradle_dryclean.services;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cg.gradle_dryclean.models.CustomerItem;
import com.cg.gradle_dryclean.repository.ICustomerItemRepository;
@Service
public class CustomerItemService implements ICustomerItemService {
static final Logger LOGGER = LoggerFactory.getLogger(CustomerItemService.class);
@Autowired
private ICustomerItemRepository customerItemRepository;
//Add item
public CustomerItem addItem(CustomerItem item) {
LOGGER.info("customerItem service - addItem method executed");
return customerItemRepository.addItem(item);
}
//Remove Item by id
public CustomerItem removeItem(long id) throws Exception{
LOGGER.info("customerItem service - removeItem method executed");
return customerItemRepository.removeItem(id);
}
//Update item by id
public CustomerItem updateItem(long id, CustomerItem item)throws Exception {
LOGGER.info("customerItem service - updateItemr method executed");
return customerItemRepository.updateItem(id, item);
}
//Get item by id
public CustomerItem getItem(long id) throws Exception{
LOGGER.info("customerItem service - getItem method executed");
return customerItemRepository.getItem(id);
}
//Get items by customer
public List<CustomerItem> getItemsByCustomer(long customerId)throws Exception{
LOGGER.info("customerItem service - getItemsByCustomer Customer method executed");
return customerItemRepository.getItemsByCustomer(customerId);
}
}
| [
"nikitadeogade98@gamil.com"
] | nikitadeogade98@gamil.com |
91e9a610f2cda176507d928c48d2455cdbcb924c | 63fed11bdb45be5fe5ac6205e32947ca06dcdb87 | /src/net/medsouz/miney/common/data/FriendRequest.java | f7f02b9740eca7a05d140f93a43445725e632eb3 | [] | no_license | medsouz/Miney-Client | 9702f0e562c12eb466c55d5fcc94dc73e3db611c | fd3cef15e9f89b3b0b295127ac231c5be236178d | refs/heads/master | 2020-05-20T04:34:07.052148 | 2013-06-19T22:34:10 | 2013-06-19T22:34:10 | 9,568,618 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 211 | java | package net.medsouz.miney.common.data;
public class FriendRequest extends Message {
public FriendRequest(String sent, long time, boolean read) {
super("Friend Request", "", sent, time, -1, -1, read);
}
}
| [
"medsouz99@gmail.com"
] | medsouz99@gmail.com |
3c9320d277a14bc770d3381202d41b7f117a5831 | c355d33f6e46776357352587d2c2059b513178d9 | /src/org/dlut/sample/pojo/comment/Reply.java | 790b63e0d203e4a90f0d8f96ee69768af0e849ec | [] | no_license | conferteam/ConferencePortal | 5f9045cdbcf03b13fb31ba3289a9ecd111f0c873 | 116dbd9e5d51906709ad143dd5240fdc8cd249f9 | refs/heads/master | 2021-01-22T07:49:03.199656 | 2017-05-27T08:52:10 | 2017-05-27T08:52:10 | 92,580,525 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,346 | java | package org.dlut.sample.pojo.comment;
import java.sql.Timestamp;
public class Reply {
private Integer reply_id;
private Integer evaluation_id;
private Integer from_id;
private Integer to_id;
private String fromname;
private String toname;
private String content;
private Timestamp reply_date;
private Integer confer_id;
public Integer getConfer_id() {
return confer_id;
}
public void setConfer_id(Integer confer_id) {
this.confer_id = confer_id;
}
public Integer getReply_id() {
return reply_id;
}
public void setReply_id(Integer reply_id) {
this.reply_id = reply_id;
}
public Integer getEvaluation_id() {
return evaluation_id;
}
public void setEvaluation_id(Integer evaluation_id) {
this.evaluation_id = evaluation_id;
}
public Integer getFrom_id() {
return from_id;
}
public void setFrom_id(Integer from_id) {
this.from_id = from_id;
}
public Integer getTo_id() {
return to_id;
}
public void setTo_id(Integer to_id) {
this.to_id = to_id;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Timestamp getReply_date() {
return reply_date;
}
public void setReply_date(Timestamp reply_date) {
this.reply_date = reply_date;
}
public String getFromname() {
return fromname;
}
public void setFromname(String fromname) {
this.fromname = fromname;
}
public String getToname() {
return toname;
}
public void setToname(String toname) {
this.toname = toname;
}
public Reply() {
super();
}
public Reply(Integer reply_id, Integer evaluation_id, Integer from_id,
Integer to_id, String fromname, String toname, String content,
Timestamp reply_date) {
super();
this.reply_id = reply_id;
this.evaluation_id = evaluation_id;
this.from_id = from_id;
this.to_id = to_id;
this.fromname = fromname;
this.toname = toname;
this.content = content;
this.reply_date = reply_date;
}
@Override
public String toString() {
return "{'reply_id':" + reply_id + ", 'evaluation_id':"
+ evaluation_id + ", 'from_id':" + from_id + ", 'to_id':" + to_id
+ ", 'fromname':'" + fromname + "', 'toname':'" + toname
+ "', 'content':'" + content + "', 'reply_date':'" + reply_date + "'}";
}
}
| [
"798791044@qq.com"
] | 798791044@qq.com |
d620dfd988ee630f0d040ce20c86b5c3fa219bf7 | fdd3ae97a2d8e1073a6d5adeeeaff6ba221d0887 | /tag-api/src/main/java/com/timec/tag/api/util/TextDivider.java | bedd94cc2c03c6bf38617236baedad333cf600c6 | [] | no_license | Timec/tag-service | a752b3c9cf5e4c1317672e806301da3342603060 | e2744f79e3f7f8a81265f8fe742e32cadc9817ca | refs/heads/master | 2020-03-18T03:04:21.043191 | 2018-05-21T05:23:33 | 2018-05-21T05:23:33 | 134,221,285 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,798 | java | package com.timec.tag.api.util;
import java.util.Arrays;
/**
* Created by timec on 2018-05-14.
*/
public class TextDivider {
// 일반 분해
private final static char[] KO_INIT_S =
{
'ㄱ', 'ㄲ', 'ㄴ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅃ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅉ', 'ㅊ',
'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ'
}; // 19
private final static char[] KO_INIT_M =
{
'ㅏ', 'ㅐ', 'ㅑ', 'ㅒ', 'ㅓ', 'ㅔ', 'ㅕ', 'ㅖ', 'ㅗ', 'ㅘ', 'ㅙ', 'ㅚ', 'ㅛ', 'ㅜ', 'ㅝ',
'ㅞ', 'ㅟ', 'ㅠ', 'ㅡ', 'ㅢ', 'ㅣ'
}; // 21
private final static char[] KO_INIT_E =
{
0, 'ㄱ', 'ㄲ', 'ㄳ', 'ㄴ', 'ㄵ', 'ㄶ', 'ㄷ', 'ㄹ', 'ㄺ', 'ㄻ', 'ㄼ', 'ㄽ', 'ㄾ', 'ㄿ',
'ㅀ', 'ㅁ', 'ㅂ', 'ㅄ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ'
}; // 28
// 완전 분해
private final static char[][] KO_ATOM_S =
{
{ 'ㄱ' }, { 'ㄱ', 'ㄱ' }, { 'ㄴ' }, { 'ㄷ' }, { 'ㄷ', 'ㄷ' }, { 'ㄹ' }, { 'ㅁ' },
{ 'ㅂ' }, { 'ㅂ', 'ㅂ' }, { 'ㅅ' }, { 'ㅅ', 'ㅅ' }, { 'ㅇ' }, { 'ㅈ' }, { 'ㅈ', 'ㅈ' }, { 'ㅊ' }, { 'ㅋ' }, { 'ㅌ' },
{ 'ㅍ' }, { 'ㅎ' }
};
private final static char[][] KO_ATOM_M =
{
{ 'ㅏ' }, { 'ㅐ' }, { 'ㅑ' }, { 'ㅒ' }, { 'ㅓ' }, { 'ㅔ' }, { 'ㅕ' }, { 'ㅖ' },
{ 'ㅗ' }, { 'ㅗ', 'ㅏ' }, { 'ㅗ', 'ㅐ' }, { 'ㅗ', 'ㅣ' }, { 'ㅛ' }, { 'ㅜ' }, { 'ㅜ', 'ㅓ' }, { 'ㅜ', 'ㅔ' },
{ 'ㅜ', 'ㅣ' }, { 'ㅠ' }, { 'ㅡ' }, { 'ㅡ', 'ㅣ' }, { 'ㅣ' }
};
private final static char[][] KO_ATOM_E =
{
{}, { 'ㄱ' }, { 'ㄱ', 'ㄱ' }, { 'ㄱ', 'ㅅ' }, { 'ㄴ' }, { 'ㄴ', 'ㅈ' },
{ 'ㄴ', 'ㅎ' }, { 'ㄷ' }, { 'ㄹ' }, { 'ㄹ', 'ㄱ' }, { 'ㄹ', 'ㅁ' }, { 'ㄹ', 'ㅂ' }, { 'ㄹ', 'ㅅ' }, { 'ㄹ', 'ㅌ' },
{ 'ㄹ', 'ㅍ' }, { 'ㄹ', 'ㅎ' }, { 'ㅁ' }, { 'ㅂ' }, { 'ㅂ', 'ㅅ' }, { 'ㅅ' }, { 'ㅅ', 'ㅅ' }, { 'ㅇ' }, { 'ㅈ' },
{ 'ㅊ' }, { 'ㅋ' }, { 'ㅌ' }, { 'ㅍ' }, { 'ㅎ' }
};
// 쌍자음이나 이중모음을 분해
private final static char[][] KO_ATOM_P =
{
{ 'ㄱ' }, { 'ㄱ', 'ㄱ' }, { 'ㄱ', 'ㅅ' }, { 'ㄴ' }, { 'ㄴ', 'ㅈ' },
{ 'ㄴ', 'ㅎ' }, { 'ㄷ' }, { 'ㄸ' }, { 'ㄹ' }, { 'ㄹ', 'ㄱ' }, { 'ㄹ', 'ㅁ' }, { 'ㄹ', 'ㅂ' }, { 'ㄹ', 'ㅅ' },
{ 'ㄹ', 'ㄷ' }, { 'ㄹ', 'ㅍ' }, { 'ㄹ', 'ㅎ' }, { 'ㅁ' }, { 'ㅂ' }, { 'ㅂ', 'ㅂ' }, { 'ㅂ', 'ㅅ' }, { 'ㅅ' },
{ 'ㅅ', 'ㅅ' }, { 'ㅇ' }, { 'ㅈ' }, { 'ㅈ', 'ㅈ' }, { 'ㅊ' }, { 'ㅋ' }, { 'ㅌ' }, { 'ㅍ' }, { 'ㅎ' }, { 'ㅏ' }, { 'ㅐ' },
{ 'ㅑ' }, { 'ㅒ' }, { 'ㅓ' }, { 'ㅔ' }, { 'ㅕ' }, { 'ㅖ' }, { 'ㅗ' }, { 'ㅗ', 'ㅏ' }, { 'ㅗ', 'ㅐ' }, { 'ㅗ', 'ㅣ' },
{ 'ㅛ' }, { 'ㅜ' }, { 'ㅜ', 'ㅓ' }, { 'ㅜ', 'ㅔ' }, { 'ㅜ', 'ㅣ' }, { 'ㅠ' }, { 'ㅡ' }, { 'ㅡ', 'ㅣ' }, { 'ㅣ' }
};
/** 한글부분을 초성으로 교체합니다. */
public static String toInitialConsonant(String text)
{
if (text == null) {
return null;
}
// 한글자가 한글자와 그대로 대응됨.
// 때문에 기존 텍스트를 토대로 작성된다.
char[] rv = text.toCharArray();
char ch;
for (int i = 0 ; i < rv.length ; i++) {
ch = rv[i];
if (ch >= '가' && ch <= '힣') {
rv[i] = KO_INIT_S[(ch - '가') / 588]; // 21 * 28
}
}
return new String(rv);
}
/** 한글부분을 자소로 분리합니다. <br>많다 = [ㅁㅏㄶㄷㅏ] */
public static String toConsonantNvowel(String text)
{
if (text == null) { return null; }
// StringBuilder의 capacity가 0으로 등록되는 것 방지.
if (text.length() == 0) { return ""; }
// 한글자당 최대 3글자가 될 수 있다.
// 추가 할당 없이 사용하기위해 capacity 를 최대 글자 수 만큼 지정하였다.
StringBuilder rv = new StringBuilder(text.length() * 3);
for (char ch : text.toCharArray())
{
if (ch >= '가' && ch <= '힣')
{
// 한글의 시작부분을 구함
int ce = ch - '가';
// 초성을 구함
rv.append(KO_INIT_S[ce / (588)]); // 21 * 28
// 중성을 구함
rv.append(KO_INIT_M[(ce = ce % (588)) / 28]); // 21 * 28
// 종성을 구함
if ((ce = ce % 28) != 0)
{
rv.append(KO_INIT_E[ce]);
}
}
else
{
rv.append(ch);
}
}
return rv.toString();
}
/** 한글부분을 자소로 완전 분리합니다. <br>많다 = [ㅁㅏㄴㅎㄷㅏ]*/
public static String toKoJasoAtom(String text)
{
if (text == null) { return null; }
// StringBuilder의 capacity가 0으로 등록되는 것 방지.
if (text.length() == 0) { return ""; }
// 한글자당 최대 6글자가 될 수 있다.
// 추가 할당 없이 사용하기위해 capacity 를 최대 글자 수 만큼 지정하였다.
StringBuilder rv = new StringBuilder(text.length() * 6);
for (char ch : text.toCharArray())
{
if (ch >= '가' && ch <= '힣')
{
// 한글의 시작부분을 구함
int ce = ch - '가';
// 초성을 구함
rv.append(KO_ATOM_S[ce / (588)]); // 21 * 28
// 중성을 구함
rv.append(KO_ATOM_M[(ce = ce % (588)) / 28]); // 21 * 28
// 종성을 구함
if ((ce = ce % 28) != 0)
{
rv.append(KO_ATOM_E[ce]);
}
}
// 쌍자음과 이중모음 분리
else if (ch >= 'ㄱ' && ch <= 'ㅣ')
{
rv.append(KO_ATOM_P[ch - 'ㄱ']);
}
else
{
rv.append(ch);
}
}
return rv.toString();
}
public static boolean isInitialConsonant(final String word){
if(word != null && word.length() > 1){
return (Arrays.binarySearch(KO_INIT_S, word.charAt(0)) > -1);
}
return false;
}
}
| [
"timec@ncsoft.com"
] | timec@ncsoft.com |
b6551aac9bacd260f7f43e6c62a67d365705e274 | 7c46a44f1930b7817fb6d26223a78785e1b4d779 | /store/src/java/com/zimbra/cs/redolog/logger/LogWriter.java | 4f339b93ae574b5421be733589730b53ec06ceb3 | [] | no_license | Zimbra/zm-mailbox | 20355a191c7174b1eb74461a6400b0329907fb02 | 8ef6538e789391813b65d3420097f43fbd2e2bf3 | refs/heads/develop | 2023-07-20T15:07:30.305312 | 2023-07-03T06:44:00 | 2023-07-06T10:09:53 | 85,609,847 | 67 | 128 | null | 2023-09-14T10:12:10 | 2017-03-20T18:07:01 | Java | UTF-8 | Java | false | false | 4,219 | java | /*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra Collaboration Suite Server
* Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2013, 2014, 2016 Synacor, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software Foundation,
* version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
* ***** END LICENSE BLOCK *****
*/
/*
* Created on 2004. 7. 22.
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
package com.zimbra.cs.redolog.logger;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.LinkedHashMap;
import com.zimbra.cs.redolog.op.RedoableOp;
/**
* @author jhahm
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
public interface LogWriter {
/**
* Opens the log.
* @throws IOException
*/
public void open() throws IOException;
/**
* Closes the log.
* @throws IOException
*/
public void close() throws IOException;
/**
* Logs an entry.
* @param op entry being logged
* @param data the data stream; must not be null;
* while it is possible to compute data from op, only what
* is passed in as data gets logged
* @param synchronous if true, method doesn't return until log entry
* has been written to disk safely, or has been
* securely stored in an equivalent manner depending
* on the logger implementation
* @throws IOException
*/
public void log(RedoableOp op, InputStream data, boolean synchronous) throws IOException;
/**
* Make sure all writes are committed to disk, or whatever the log
* destination medium is. This is mainly useful only when we need to
* make sure the commit record is on disk, because fsync of commit record
* is deferred until the logging of the next redo record for performance
* reasons.
* @throws IOException
*/
public void flush() throws IOException;
/**
* Returns the current size of the log. Used for rollover tracking.
* @return
*/
public long getSize();
/**
* Returns the time of the log creation.
* @return
*/
public long getCreateTime();
/**
* Returns the time of the last entry logged.
* @return
*/
public long getLastLogTime();
/**
* Whether the current log is empty, i.e. has no entries logged.
* @return
* @throws IOException
*/
public boolean isEmpty() throws IOException;
/**
* Whether the underlying logfile exists.
* @return
*/
public boolean exists();
/**
* Returns the absolute pathname for the underlying logfile.
* @return
*/
public String getAbsolutePath();
/**
* Renames the underlying logfile.
* @param dest
* @return true if and only if the renaming succeeded; false otherwise
*/
public boolean renameTo(File dest);
/**
* Deletes the underlying logfile. The logger should be closed first
* if open.
* @return true if and only if the deletion succeeded; false otherwise
*/
public boolean delete();
/**
* Performs log rollover.
* @param activeOps map of pending transactions; these should be logged
* at the beginning of new log file
* @return java.io.File object for rolled over logfile
* @throws IOException
*/
public File rollover(LinkedHashMap /*<TxnId, RedoableOp>*/ activeOps)
throws IOException;
/**
* Returns the sequence number of redolog. Only file-based log writers
* will return a meaningful number. Others return 0.
* @return
* @throws IOException
*/
public long getSequence();
}
| [
"shriram.vishwanathan@synacor.com"
] | shriram.vishwanathan@synacor.com |
534e955c50678b3eedf76b536e779e0537436e24 | 37db8f6b2e7907b71f748808ea9ff8e8d033d564 | /JavaSource/org/unitime/timetable/form/DeptStatusTypeEditForm.java | f596f5eb3dd83f4b645e50da68ee2c5857623a31 | [
"Apache-2.0",
"EPL-2.0",
"CDDL-1.0",
"MIT",
"CC-BY-3.0",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-freemarker",
"LGPL-2.1-only",
"EPL-1.0",
"BSD-3-Clause",
"LGPL-2.1-or-later",
"LGPL-3.0-only",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-generic-cla",
... | permissive | UniTime/unitime | 48eaa44ae85db344d015577d21dcc1a41cecd862 | bc69f2e18f82bdb6c995c4e6490cb650fa4fa98e | refs/heads/master | 2023-08-18T00:52:29.614387 | 2023-08-16T16:08:17 | 2023-08-16T16:08:17 | 29,594,752 | 253 | 185 | Apache-2.0 | 2023-05-17T14:16:13 | 2015-01-21T14:58:53 | Java | UTF-8 | Java | false | false | 17,472 | java | /*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* The Apereo Foundation 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.unitime.timetable.form;
import java.util.Iterator;
import java.util.Vector;
import org.unitime.localization.impl.Localization;
import org.unitime.localization.messages.CourseMessages;
import org.unitime.timetable.action.UniTimeAction;
import org.unitime.timetable.model.Department;
import org.unitime.timetable.model.DepartmentStatusType;
import org.unitime.timetable.model.Session;
import org.unitime.timetable.model.dao.DepartmentStatusTypeDAO;
import org.unitime.timetable.util.IdValue;
/**
* @author Tomas Muller
*/
public class DeptStatusTypeEditForm implements UniTimeForm {
private static final long serialVersionUID = -684686223274367430L;
protected static final CourseMessages MSG = Localization.create(CourseMessages.class);
private String iOp;
private Long iUniqueId;
private String iReference;
private String iLabel;
private int iApply = 0;
private int iOrder = -1;
private boolean iCanManagerView = false;
private boolean iCanManagerEdit = false;
private boolean iCanManagerLimitedEdit = false;
private boolean iCanOwnerView = false;
private boolean iCanOwnerEdit = false;
private boolean iCanOwnerLimitedEdit = false;
private boolean iCanAudit = false;
private boolean iCanTimetable = false;
private boolean iCanCommit = false;
private boolean iCanExamView = false;
private boolean iCanExamEdit = false;
private boolean iCanExamTimetable = false;
private boolean iCanNoRoleReportExamFin = false;
private boolean iCanNoRoleReportExamMid = false;
private boolean iCanNoRoleReportClass = false;
private boolean iCanSectioningStudents = false;
private boolean iCanPreRegisterStudents = false;
private boolean iCanOnlineSectionStudents = false;
private boolean iTestSession = false;
private boolean iAllowNoRole = false;
private boolean iAllowRollForward = false;
private boolean iEventManagement = false;
private boolean iInstructorSurvey = false;
public DeptStatusTypeEditForm() {
reset();
}
public void validate(UniTimeAction action) {
if(iReference==null || iReference.trim().length()==0) {
action.addFieldError("form.reference", MSG.errorRequiredField(MSG.fieldReference()));
} else {
try {
DepartmentStatusType ds = DepartmentStatusType.findByRef(iReference);
if (ds!=null && !ds.getUniqueId().equals(iUniqueId))
action.addFieldError("form.reference", MSG.errorAlreadyExists(iReference));
} catch (Exception e) {
action.addFieldError("form.reference", e.getMessage());
}
}
if(iLabel==null || iLabel.trim().length()==0)
action.addFieldError("form.label", MSG.errorRequiredField(MSG.fieldLabel()));
if (iApply<0)
action.addFieldError("form.label", MSG.errorRequiredField(MSG.fieldApply()));
}
public void reset() {
iOp = "List"; iUniqueId = Long.valueOf(-1);
iReference = null; iLabel = null;
iApply = 0; iOrder = DepartmentStatusType.findAll().size();
iCanManagerView = false;
iCanManagerEdit = false;
iCanManagerLimitedEdit = false;
iCanOwnerView = false;
iCanOwnerEdit = false;
iCanOwnerLimitedEdit = false;
iCanAudit = false;
iCanTimetable = false;
iCanCommit = false;
iCanExamView = false;
iCanExamEdit = false;
iCanExamTimetable = false;
iCanNoRoleReportExamFin = false;
iCanNoRoleReportExamMid = false;
iCanNoRoleReportClass = false;
iCanSectioningStudents = false;
iCanPreRegisterStudents = false;
iCanOnlineSectionStudents = false;
iTestSession = false;
iAllowNoRole = false;
iAllowRollForward = false;
iEventManagement = false;
iInstructorSurvey = false;
}
public void setOp(String op) { iOp = op; }
public String getOp() { return iOp; }
public void setUniqueId(Long uniqueId) { iUniqueId = uniqueId; }
public Long getUniqueId() { return iUniqueId; }
public void setReference(String reference) { iReference = reference; }
public String getReference() { return iReference; }
public void setLabel(String label) { iLabel = label; }
public String getLabel() { return iLabel; }
public void setOrder(int order) { iOrder = order; }
public int getOrder() { return iOrder; }
public int getApply() { return iApply; }
public void setApply(int apply) { iApply = apply; }
public void setApply(Long apply) { iApply = (apply==null?-1:(int)apply.longValue()); }
public Vector getApplyOptions() {
Vector options = new Vector();
options.add(new IdValue(Long.valueOf(DepartmentStatusType.Apply.Session.toInt()), MSG.applyToSession()));
options.add(new IdValue(Long.valueOf(DepartmentStatusType.Apply.Department.toInt()), MSG.applyToDepartment()));
options.add(new IdValue(Long.valueOf(DepartmentStatusType.Apply.ExamStatus.toInt()), MSG.applyToExaminations()));
options.add(new IdValue(Long.valueOf(DepartmentStatusType.Apply.Session.toInt() | DepartmentStatusType.Apply.Department.toInt()), MSG.applyToSessionAndDepartment()));
options.add(new IdValue(Long.valueOf(DepartmentStatusType.Apply.Session.toInt() | DepartmentStatusType.Apply.Department.toInt() | DepartmentStatusType.Apply.ExamStatus.toInt()), MSG.applyToAll()));
return options;
}
public void setCanManagerView(boolean canManagerView) { iCanManagerView = canManagerView; }
public boolean getCanManagerView() { return iCanManagerView; }
public void setCanManagerEdit(boolean canManagerEdit) { iCanManagerEdit = canManagerEdit; }
public boolean getCanManagerEdit() { return iCanManagerEdit; }
public void setCanManagerLimitedEdit(boolean canManagerLimitedEdit) { iCanManagerLimitedEdit = canManagerLimitedEdit; }
public boolean getCanManagerLimitedEdit() { return iCanManagerLimitedEdit; }
public void setCanOwnerView(boolean canOwnerView) { iCanOwnerView = canOwnerView; }
public boolean getCanOwnerView() { return iCanOwnerView; }
public void setCanOwnerEdit(boolean canOwnerEdit) { iCanOwnerEdit = canOwnerEdit; }
public boolean getCanOwnerEdit() { return iCanOwnerEdit; }
public void setCanOwnerLimitedEdit(boolean canOwnerLimitedEdit) { iCanOwnerLimitedEdit = canOwnerLimitedEdit; }
public boolean getCanOwnerLimitedEdit() { return iCanOwnerLimitedEdit; }
public void setCanAudit(boolean canAudit) { iCanAudit = canAudit; }
public boolean getCanAudit() { return iCanAudit; }
public void setCanTimetable(boolean canTimetable) { iCanTimetable = canTimetable; }
public boolean getCanTimetable() { return iCanTimetable; }
public void setCanCommit(boolean canCommit) { iCanCommit = canCommit; }
public boolean getCanCommit() { return iCanCommit; }
public boolean getCanExamView() { return iCanExamView; }
public void setCanExamView(boolean canExamView) { iCanExamView = canExamView; }
public boolean getCanExamEdit() { return iCanExamEdit; }
public void setCanExamEdit(boolean canExamEdit) { iCanExamEdit = canExamEdit; }
public boolean getCanExamTimetable() { return iCanExamTimetable; }
public void setCanExamTimetable(boolean canExamTimetable) { iCanExamTimetable = canExamTimetable; }
public void setCanNoRoleReportExamFin(boolean canNoRoleReportExamFin) { iCanNoRoleReportExamFin = canNoRoleReportExamFin; }
public boolean getCanNoRoleReportExamFin() { return iCanNoRoleReportExamFin; }
public void setCanNoRoleReportExamMid(boolean canNoRoleReportExamMid) { iCanNoRoleReportExamMid = canNoRoleReportExamMid; }
public boolean getCanNoRoleReportExamMid() { return iCanNoRoleReportExamMid; }
public void setCanNoRoleReportClass(boolean canNoRoleReportClass) { iCanNoRoleReportClass = canNoRoleReportClass; }
public boolean getCanNoRoleReportClass() { return iCanNoRoleReportClass; }
public void setCanSectioningStudents(boolean canSectioningStudents) { iCanSectioningStudents = canSectioningStudents; }
public boolean getCanSectioningStudents() { return iCanSectioningStudents; }
public void setCanPreRegisterStudents(boolean canPreRegisterStudents) { iCanPreRegisterStudents = canPreRegisterStudents; }
public boolean getCanPreRegisterStudents() { return iCanPreRegisterStudents; }
public void setCanOnlineSectionStudents(boolean canOnlineSectionStudents) { iCanOnlineSectionStudents = canOnlineSectionStudents; }
public boolean getCanOnlineSectionStudents() { return iCanOnlineSectionStudents; }
public void setTestSession(boolean testSession) { iTestSession = testSession; }
public boolean getTestSession() { return iTestSession; }
public void setAllowNoRole(boolean allowNoRole) { iAllowNoRole = allowNoRole; }
public boolean getAllowNoRole() { return iAllowNoRole; }
public void setAllowRollForward(boolean allowRollForward) { iAllowRollForward = allowRollForward; }
public boolean getAllowRollForward() { return iAllowRollForward; }
public void setEventManagement(boolean eventManagement) { iEventManagement = eventManagement; }
public boolean getEventManagement() { return iEventManagement; }
public void setInstructorSurvey(boolean instructorSurvey) { iInstructorSurvey = instructorSurvey; }
public boolean getInstructorSurvey() { return iInstructorSurvey; }
public int getRights() {
int rights = 0;
if (getCanManagerView()) rights += DepartmentStatusType.Status.ManagerView.toInt();
if (getCanManagerEdit()) rights += DepartmentStatusType.Status.ManagerEdit.toInt();
if (getCanManagerLimitedEdit()) rights += DepartmentStatusType.Status.ManagerLimitedEdit.toInt();
if (getCanOwnerView()) rights += DepartmentStatusType.Status.OwnerView.toInt();
if (getCanOwnerEdit()) rights += DepartmentStatusType.Status.OwnerEdit.toInt();
if (getCanOwnerLimitedEdit()) rights += DepartmentStatusType.Status.OwnerLimitedEdit.toInt();
if (getCanAudit()) rights += DepartmentStatusType.Status.Audit.toInt();
if (getCanTimetable()) rights += DepartmentStatusType.Status.Timetable.toInt();
if (getCanCommit()) rights += DepartmentStatusType.Status.Commit.toInt();
if (getCanExamView()) rights += DepartmentStatusType.Status.ExamView.toInt();
if (getCanExamEdit()) rights += DepartmentStatusType.Status.ExamEdit.toInt();
if (getCanExamTimetable()) rights += DepartmentStatusType.Status.ExamTimetable.toInt();
if (getCanNoRoleReportExamFin()) rights += DepartmentStatusType.Status.ReportExamsFinal.toInt();
if (getCanNoRoleReportExamMid()) rights += DepartmentStatusType.Status.ReportExamsMidterm.toInt();
if (getCanNoRoleReportClass()) rights += DepartmentStatusType.Status.ReportClasses.toInt();
if (getCanSectioningStudents()) rights += DepartmentStatusType.Status.StudentsAssistant.toInt();
if (getCanPreRegisterStudents()) rights += DepartmentStatusType.Status.StudentsPreRegister.toInt();
if (getCanOnlineSectionStudents()) rights += DepartmentStatusType.Status.StudentsOnline.toInt();
if (getTestSession()) rights += DepartmentStatusType.Status.TestSession.toInt();
if (getAllowNoRole()) rights += DepartmentStatusType.Status.AllowNoRole.toInt();
if (getAllowRollForward()) rights += DepartmentStatusType.Status.AllowRollForward.toInt();
if (getEventManagement()) rights += DepartmentStatusType.Status.EventManagement.toInt();
if (getInstructorSurvey()) rights += DepartmentStatusType.Status.InstructorSurvey.toInt();
return rights;
}
public void setRights(int rights) {
setCanManagerView(DepartmentStatusType.Status.ManagerView.has(rights));
setCanManagerEdit(DepartmentStatusType.Status.ManagerEdit.has(rights));
setCanManagerLimitedEdit(DepartmentStatusType.Status.ManagerLimitedEdit.has(rights));
setCanOwnerView(DepartmentStatusType.Status.OwnerView.has(rights));
setCanOwnerEdit(DepartmentStatusType.Status.OwnerEdit.has(rights));
setCanOwnerLimitedEdit(DepartmentStatusType.Status.OwnerLimitedEdit.has(rights));
setCanAudit(DepartmentStatusType.Status.Audit.has(rights));
setCanTimetable(DepartmentStatusType.Status.Timetable.has(rights));
setCanCommit(DepartmentStatusType.Status.Commit.has(rights));
setCanExamView(DepartmentStatusType.Status.ExamView.has(rights));
setCanExamEdit(DepartmentStatusType.Status.ExamEdit.has(rights));
setCanExamTimetable(DepartmentStatusType.Status.ExamTimetable.has(rights));
setCanNoRoleReportExamFin(DepartmentStatusType.Status.ReportExamsFinal.has(rights));
setCanNoRoleReportExamMid(DepartmentStatusType.Status.ReportExamsMidterm.has(rights));
setCanNoRoleReportClass(DepartmentStatusType.Status.ReportClasses.has(rights));
setCanSectioningStudents(DepartmentStatusType.Status.StudentsAssistant.has(rights));
setCanPreRegisterStudents(DepartmentStatusType.Status.StudentsPreRegister.has(rights));
setCanOnlineSectionStudents(DepartmentStatusType.Status.StudentsOnline.has(rights));
setTestSession(DepartmentStatusType.Status.TestSession.has(rights));
setAllowNoRole(DepartmentStatusType.Status.AllowNoRole.has(rights));
setAllowRollForward(DepartmentStatusType.Status.AllowRollForward.has(rights));
setEventManagement(DepartmentStatusType.Status.EventManagement.has(rights));
setInstructorSurvey(DepartmentStatusType.Status.InstructorSurvey.has(rights));
}
public void load(DepartmentStatusType s) {
if (s==null) {
reset();
setOp(MSG.actionSaveStatusType());
} else {
setUniqueId(s.getUniqueId());
setReference(s.getReference());
setLabel(s.getLabel());
setApply(s.getApply());
setRights(s.getStatus().intValue());
setOrder(s.getOrd());
setOp(MSG.actionUpdateStatusType());
}
}
public DepartmentStatusType saveOrUpdate(org.hibernate.Session hibSession) throws Exception {
DepartmentStatusType s = null;
if (getUniqueId().intValue()>=0)
s = (DepartmentStatusTypeDAO.getInstance()).get(getUniqueId());
if (s==null)
s = new DepartmentStatusType();
s.setReference(getReference());
s.setLabel(getLabel());
s.setApply(getApply());
if (s.getOrd()==null) s.setOrd(DepartmentStatusType.findAll().size());
s.setStatus(getRights());
if (s.getUniqueId() != null)
hibSession.persist(s);
else
hibSession.merge(s);
setUniqueId(s.getUniqueId());
return s;
}
public void delete(org.hibernate.Session hibSession) throws Exception {
if (getUniqueId().intValue()<0) return;
DepartmentStatusType s = (DepartmentStatusTypeDAO.getInstance()).get(getUniqueId());
for (Session session: hibSession.createQuery(
"select s from Session s where s.statusType.uniqueId=:id", Session.class).
setParameter("id", s.getUniqueId()).list()) {
DepartmentStatusType other = null;
for (Iterator j=DepartmentStatusType.findAll().iterator();j.hasNext();) {
DepartmentStatusType x = (DepartmentStatusType)j.next();
if (!x.getUniqueId().equals(s.getUniqueId()) && x.applySession()) {
other = x; break;
}
}
if (other==null)
throw new RuntimeException("Unable to delete session status "+getReference()+", no other session status available.");
session.setStatusType(other);
hibSession.merge(session);
}
for (Department dept: hibSession.createQuery(
"select d from Department d where d.statusType.uniqueId=:id",Department.class).
setParameter("id", s.getUniqueId()).list()) {
dept.setStatusType(null);
hibSession.merge(dept);
}
for (Iterator i=DepartmentStatusType.findAll().iterator();i.hasNext();) {
DepartmentStatusType x = (DepartmentStatusType)i.next();
if (x.getOrd()>s.getOrd()) {
x.setOrd(x.getOrd()-1);
hibSession.merge(x);
}
}
if (s!=null) hibSession.remove(s);
}
}
| [
"muller@unitime.org"
] | muller@unitime.org |
1a049095d9a0d21b1d6189a700a4f5c34bf5488c | 42161099f1c9191776cdb1a6e3316822f5cc41c1 | /app/src/main/java/com/example/admin/dogcollar/MainActivity.java | 4f281087449389954cafb85abc1dcee27fc33e08 | [] | no_license | CoderBackEndDev/DogCollar | 9ca926ef504fc188185d849880c23da47727407f | 950766e2d45e8517683639bec85c17ca699651e7 | refs/heads/master | 2020-03-17T03:52:38.209642 | 2018-05-13T16:15:01 | 2018-05-13T16:15:01 | 127,751,324 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,881 | java | package com.example.admin.dogcollar;
import android.app.ProgressDialog;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private String username;
//variables are declared below
private EditText email;
private EditText pass;
private EditText rePass;
private Button register;
private TextView signIn;
// an object reference of the ProgressDialog is created
private ProgressDialog await;
//an object reference of the FirebaseAuth is created
private FirebaseAuth AuthDB;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// gets the firebase Instance
AuthDB = FirebaseAuth.getInstance();
// for HCI we have innitialised the await reference
await = new ProgressDialog(this);
// here the variables are assigned to the xml elements in the page of activity_main
email = (EditText) findViewById(R.id.txt_log_email);
pass = (EditText) findViewById(R.id.ptxt_log_pass);
rePass = (EditText) findViewById(R.id.ptxt_repass);
register = (Button) findViewById(R.id.btn_log_register);
signIn = (TextView) findViewById(R.id.txt_log_loginredirect);
// the SetOnclick listeners are added
register.setOnClickListener(this);
signIn.setOnClickListener(this);
}
@Override
public void onClick(View compare) {
// here the lisnters are listened to and an if state ment is used to check
// which button action is click so if true the functions below are executed
if (compare == register) {
newUser();
}
if (compare == signIn) {
//redirects to login page
startActivity(new Intent(MainActivity.this,loadout.class));
}
}
private void newUser() {
//Strings created below assign the values gotten from the elements in the after user enters the value
String emailAddress = email.getText().toString().trim();
String Password = pass.getText().toString().trim();
String reenterpass =rePass.getText().toString().trim();
if (emailAddress.equals(" ")) {//checks if email is empty
Toast.makeText(this, "Please Enter Email", Toast.LENGTH_SHORT).show();
return;//if false stops the function executing further
}
if (Password.equals(" ")) {//checks if password is empty
Toast.makeText(this, "Please Enter Password", Toast.LENGTH_SHORT).show();
return;//if false stops the function executing further
}
if (reenterpass.equals(" ")) {//checks if re-password is empty
Toast.makeText(this, "Please Enter re-Password", Toast.LENGTH_SHORT).show();
return;//if false stops the function executing further
}
//after above validations are undertaken
// the values are passsed to firebase
if (Password.equals(reenterpass)) {
await.setMessage("Registering User");
await.show();
AuthDB.createUserWithEmailAndPassword(emailAddress, Password).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
await.dismiss();
if (task.isSuccessful()) {// sending User registration details
Toast.makeText(MainActivity.this, "Registered User", Toast.LENGTH_SHORT).show();
startActivity(new Intent(MainActivity.this,PetSaveFbase.class));//type here the code for user registration
} else {
// user registration has failed an error message is sent through toast message
Toast.makeText(MainActivity.this, "User Registration Failed", Toast.LENGTH_SHORT).show();
}
}
});
}else{
// the password is compared and an error is sent saying password mismatch
if(emailAddress.equals(" ")){
Toast.makeText(this,"Email not entered",Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(this,"Password mismatch",Toast.LENGTH_SHORT).show();
}
}
}
} | [
"yukthika.2016174@iit.ac.lk"
] | yukthika.2016174@iit.ac.lk |
5418afb8168abd0e164c1aefae91ac9030959f51 | 7fe1301912b523eeea1da307c4d2f5d722fde2dc | /mybatis-generator/src/org/qingyuan/sale/core/dao/SaleReceiptionMapper.java | 69197e2f0bedb853bd3c02cda78934dacdc8e790 | [] | no_license | keqingyuan/sale | 1e5300a273d50629845505137c026e749d0db6c8 | daf383d05cd7b75955ec7eb9f1019f6d953cd34b | refs/heads/master | 2020-11-26T01:48:02.347397 | 2016-08-31T13:29:51 | 2016-08-31T13:29:51 | 67,019,845 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 425 | java | package org.qingyuan.sale.core.dao;
import org.qingyuan.sale.core.model.SaleReceiption;
public interface SaleReceiptionMapper {
int deleteByPrimaryKey(Integer sn);
int insert(SaleReceiption record);
int insertSelective(SaleReceiption record);
SaleReceiption selectByPrimaryKey(Integer sn);
int updateByPrimaryKeySelective(SaleReceiption record);
int updateByPrimaryKey(SaleReceiption record);
} | [
"qingyuan@ftsafe.com"
] | qingyuan@ftsafe.com |
b9081cabd6ae2924dc50fa2d379d5275fe661e04 | b4bf2c32a6240296bc26e8eae084f88ed8d9bbc5 | /src/main/java/com/food/ordering/zinger/query/OrderItemQuery.java | 7339f97e96e13de73f0a7e4e59d2b84c90668312 | [] | no_license | suprajalvs/food_backend | 7b8c242a31726f74ccb2aed609bf70f864720767 | 36ad782394288b98436a5809cf53b3d219b2c18c | refs/heads/master | 2021-05-15T02:28:50.511899 | 2020-03-22T20:04:59 | 2020-03-22T20:04:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 549 | java | package com.food.ordering.zinger.query;
import static com.food.ordering.zinger.column.OrderItemColumn.*;
public class OrderItemQuery {
public static final String insertOrderItem = "INSERT INTO " + tableName + "(" + orderId + ", " + itemId + ", " + quantity + ", " + price + ") VALUES(:" + orderId + ", :" + itemId + ", :" + quantity + ", :" + price + ")";
public static final String getItemByOrderId = "SELECT " + orderId + ", " + itemId + ", " + quantity + ", " + price + " FROM " + tableName + " WHERE " + orderId + " = :" + orderId;
}
| [
"ddlogesh@gmail.com"
] | ddlogesh@gmail.com |
9623f3514b427835c8e2c0a4d192cb5fb688d7dd | 34c3dbe64f7f09a68c72d1a1f191fe6a302c25cb | /August2019/capstone-project/suchana/suchana-api/src/main/java/com/vastika/training/capstone/suchanaapi/controllers/AuthorController.java | 542c17b25b74a04a94e75cd316ea3b5d72a54677 | [] | no_license | YogenRaii/fullstack-training | f3cced6e404f3a1777259d8d688647ae7f6921fd | 7bc7872a88ef4990a39efc8073864e167bdf587c | refs/heads/master | 2023-03-10T03:09:44.104238 | 2023-01-27T04:07:37 | 2023-01-27T04:07:37 | 196,441,398 | 1 | 3 | null | 2023-03-01T08:03:31 | 2019-07-11T17:50:11 | Java | UTF-8 | Java | false | false | 3,900 | java | package com.vastika.training.capstone.suchanaapi.controllers;
import com.vastika.training.capstone.suchanaapi.exceptions.SuchanaDataException;
import com.vastika.training.capstone.suchanaapi.models.Article;
import com.vastika.training.capstone.suchanaapi.models.User;
import com.vastika.training.capstone.suchanaapi.models.dtos.CreateUserRequest;
import com.vastika.training.capstone.suchanaapi.models.types.RoleType;
import com.vastika.training.capstone.suchanaapi.services.ArticleService;
import com.vastika.training.capstone.suchanaapi.services.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import sun.nio.cs.US_ASCII;
import javax.validation.Valid;
import java.time.LocalDateTime;
import java.util.List;
@Slf4j
@RestController
public class AuthorController {
@Autowired
private UserService userService;
@Autowired
private ArticleService articleService;
@Autowired
private BCryptPasswordEncoder passwordEncoder;
@RequestMapping("/authors")
public ResponseEntity<List<User>> findAll() {
return new ResponseEntity<>(this.userService.findAll(), HttpStatus.OK);
}
@RequestMapping(value = "/authors/{id}", method = RequestMethod.PUT)
public ResponseEntity<User> updateAuthor(@RequestBody User user, @PathVariable("id") int id) {
log.info("updateAuthor() -> {}", id);
user.setId(id);
return new ResponseEntity<>(this.userService.update(user), HttpStatus.OK);
}
@RequestMapping(value = "/authors", method = RequestMethod.POST)
public ResponseEntity<User> createAuthor(@Valid @RequestBody CreateUserRequest user,
BindingResult result) {
log.info("createAuthor() -> {}", user);
if (result.hasErrors()) {
throw new SuchanaDataException("Invalid Payload!", result.getFieldErrors());
}
User userToCreate = new User();
userToCreate.setArticles(null);
userToCreate.setFirstName(user.getFirstName());
userToCreate.setLastName(user.getLastName());
userToCreate.setUsername(user.getUsername());
userToCreate.setPassword(passwordEncoder.encode(user.getPassword()));
userToCreate.setDateCreated(LocalDateTime.now());
userToCreate.setRole(RoleType.ROLE_AUTHOR);
userToCreate.setCategories(user.getCategories());
return new ResponseEntity<>(this.userService.createAuthor(userToCreate), HttpStatus.CREATED);
}
// /api/v1/users/{id}/accounts
@PostMapping("/authors/{id}/articles")
public ResponseEntity<Article> createArticle(@Valid @RequestBody Article article,
BindingResult result,
@PathVariable("id") int authorId) {
log.info("createArticle() -> authorId: {}", authorId);
if (result.hasErrors()) {
throw new SuchanaDataException("Invalid Payload!", result.getFieldErrors());
}
article.setPublishDate(LocalDateTime.now());
User user = this.userService.findById(authorId);
article.setUser(user);
Article saved = this.articleService.save(article);
log.info("Article saved -> id: {}", saved.getId());
return new ResponseEntity<>(saved, HttpStatus.CREATED);
}
@GetMapping("/authors/{id}/articles")
public ResponseEntity<List<Article>> getArticlesByAuthor(@PathVariable("id") int authorId) {
return new ResponseEntity<>(this.articleService.findByAuthorId(authorId),
HttpStatus.OK);
}
}
| [
"yogen.rai.992@gmail.com"
] | yogen.rai.992@gmail.com |
f52321aabf970a4f68f81559cc4cdaef2ea65e3e | 7d0973a221e45dc37a11880ab36c01d12b21190f | /app/src/main/java/br/com/ufc/quixada/housecleaning/dao/memory/UserMemoryDAO.java | 0d0cd317ad682c464f4833314236abe238963570 | [] | no_license | CaioWF/house-cleaning-mobile-java-native | ec219025b144c10957947c2517623e8a2b563582 | afadd9040d34105873238a0058768780ae668128 | refs/heads/master | 2020-08-01T22:18:46.633030 | 2019-12-05T21:52:55 | 2019-12-05T21:52:55 | 211,134,958 | 0 | 0 | null | 2019-12-03T21:57:07 | 2019-09-26T16:32:56 | Java | UTF-8 | Java | false | false | 1,258 | java | package br.com.ufc.quixada.housecleaning.dao.memory;
import java.util.ArrayList;
import java.util.List;
import br.com.ufc.quixada.housecleaning.dao.UserDAO;
import br.com.ufc.quixada.housecleaning.presenter.UserEventListener;
import br.com.ufc.quixada.housecleaning.transactions.User;
public class UserMemoryDAO extends GenericMemoryDAO<User> implements UserDAO {
private static UserDAO userDAO;
private UserEventListener userEventListener;
private UserMemoryDAO(UserEventListener userEventListener) {
super();
this.userEventListener = userEventListener;
}
@Override
public List<User> findAllWorkers() {
List<User> workers = new ArrayList<>();
for (User user : findAll()) {
if (user.isWorker())
workers.add(user);
}
return workers;
}
@Override
public User findByEmail(String email) {
for (User user : findAll()) {
if (user.getEmail().equals(email))
return user;
}
return null;
}
public static UserDAO getInstance(UserEventListener userEventListener) {
if (userDAO == null)
userDAO = new UserMemoryDAO(userEventListener);
return userDAO;
}
}
| [
"publio.blenilio@gmail.com"
] | publio.blenilio@gmail.com |
403c2bd946b9459d87321e05e44cb04c1d07c5cb | 9a6d72313dabd47216072350fa64fe31f136050e | /ext/openmuc/projects/core/datamanager/src/main/java/org/openmuc/framework/core/datamanager/LogRecordContainerImpl.java | 682ed73ddafdff3daf5c9781c8e513ee6eb5dc4e | [] | no_license | michaelmill/embaya_adk | cb2b6ef9a0d1116780a93158feb09b22fe22a702 | f5fa9d287036b1db28d8fb4e1ead2c0e3fd61c86 | refs/heads/master | 2021-01-10T06:31:17.581797 | 2015-12-15T06:23:04 | 2015-12-15T06:23:04 | 48,022,868 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,319 | java | /*
* Copyright 2011-15 Fraunhofer ISE
*
* This file is part of OpenMUC.
* For more information visit http://www.openmuc.org
*
* OpenMUC is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenMUC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenMUC. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.openmuc.framework.core.datamanager;
import org.openmuc.framework.data.Record;
import org.openmuc.framework.datalogger.spi.LogRecordContainer;
public final class LogRecordContainerImpl implements LogRecordContainer {
private final String channelId;
private final Record record;
public LogRecordContainerImpl(String channelId, Record record) {
this.channelId = channelId;
this.record = record;
}
@Override
public String getChannelId() {
return channelId;
}
@Override
public Record getRecord() {
return record;
}
}
| [
"michael@prepaidmeters.com"
] | michael@prepaidmeters.com |
852a8f8d599dfd83ff293b48b570f5239e7a0c7c | 2ebfda377a7bc9305d33a1d2ead7c10fdb1f2ef7 | /src/main/java/com/carloscursomvc/domain/Cliente.java | e8e48524cf9d317928e401297eda3f7aea5ebbad | [] | no_license | CarlosSantos39/projeto-spring | cb56bf5d79c51d04494bd2314a703ae1ee8c1048 | 06a62a8bc3457a452dcf4757232eb772b32fa320 | refs/heads/main | 2023-08-28T23:04:47.997989 | 2021-11-08T23:24:39 | 2021-11-08T23:24:39 | 420,412,711 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,040 | java | package com.carloscursomvc.domain;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import com.carloscursomvc.domain.enums.TipoCliente;
import com.fasterxml.jackson.annotation.JsonIgnore;
@Entity
public class Cliente implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String nome;
private String email;
@Column(unique=true)
private String cpfOuCnpg;
private Integer tipo;
@OneToMany(mappedBy="cliente",cascade=CascadeType.ALL)
private List<Endereco> enderecos = new ArrayList<>();
@ElementCollection
@CollectionTable(name = "telefone")
private Set<String> telefones = new HashSet<>();
@JsonIgnore
@OneToMany(mappedBy="cliente")
private List<Pedido> pedidos = new ArrayList<>();
public Cliente() {
}
public Cliente(Integer id, String nome, String email, String cpfOuCnpg, TipoCliente tipo) {
super();
this.id = id;
this.nome = nome;
this.email = email;
this.cpfOuCnpg = cpfOuCnpg;
this.tipo = (tipo==null)? null : tipo.getCod();
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getCpfOuCnpg() {
return cpfOuCnpg;
}
public void setCpfOuCnpg(String cpfOuCnpg) {
this.cpfOuCnpg = cpfOuCnpg;
}
public TipoCliente getTipo() {
return TipoCliente.toEnum(tipo);
}
public void setTipo(TipoCliente tipo) {
this.tipo = tipo.getCod();
}
public List<Endereco> getEnderecos() {
return enderecos;
}
public void setEnderecos(List<Endereco> enderecos) {
this.enderecos = enderecos;
}
public Set<String> getTelefones() {
return telefones;
}
public void setTelefones(Set<String> telefones) {
this.telefones = telefones;
}
public List<Pedido> getPedidos() {
return pedidos;
}
public void setPedidos(List<Pedido> pedidos) {
this.pedidos = pedidos;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Cliente other = (Cliente) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
}
| [
"novasintoniasp@gmail.com"
] | novasintoniasp@gmail.com |
22edd145b2aa5db1cc5218bf6335d59f20e1f596 | 2bed88bd002f0dddba462a30e4391755e238cd2d | /src/aula2/exercio1/Navio.java | 01b07a7d3339c8b586cab3e26500f46b32e00a94 | [] | no_license | jonatha1994/reset-01 | 9481a7b9472fa793127ca65c6cd84fe67a9d0b53 | 99f2cb40dabce64792ba9489293d6cde6085d350 | refs/heads/master | 2021-02-27T20:36:51.084073 | 2020-03-14T15:27:08 | 2020-03-14T15:27:08 | 245,634,369 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 48 | java | package aula2.exercio1;
public class Navio {
}
| [
"Reset@NB-004253.cwinet.local"
] | Reset@NB-004253.cwinet.local |
ab945f96357b6a44ad983e92731f0794f743fcdd | 39f63ff85ab9d5684edbc323c193916e031e35e7 | /cc_ipfs/src/main/java/cn/net/sinodata/service/TFuncService.java | 9a74ca48f3939025b3b354842bb5d3d515d87768 | [] | no_license | MMLoveMM/ipfs | f287d42cc7baf98820ab9b885b329b1e492bf062 | b9be2255575629875db81c652e1cdf63d2176f60 | refs/heads/master | 2020-05-19T13:39:43.989549 | 2019-05-05T15:04:21 | 2019-05-05T15:04:21 | 184,910,100 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 680 | java | package cn.net.sinodata.service;
import java.util.List;
import com.github.pagehelper.PageInfo;
import cn.net.sinodata.mapper.TFuncMapper;
import cn.net.sinodata.model.TFunc;
import cn.net.sinodata.model.TFuncExample;
/**
* 功能菜单
* @author Pangpj
*
*/
public interface TFuncService extends TFuncMapper{
/**
* 根据用户id查询用户可用资源
* @param userId
* @return
*/
List<TFunc> getResourcesByUserId(String userId);
/**
* 获取功能菜单列表
* @author xuj
* @param page
* @param rows
* @param tfuncs
* @return
*/
public PageInfo<?> getFuncList(int page,int rows, TFuncExample example);
}
| [
"pangpengj@163.com"
] | pangpengj@163.com |
57b037292701d43fd6dce488773dbbb47802b06b | 5f3e2a56be6e6a5d0b7800af835f74a669a23bbb | /JavaDay01/Test/src/Test/Test1.java | 91eb94059f778c3d807d6e229bff0302e1526047 | [] | no_license | GimoMeng/Java | 4c61bc90fbc0af649ef77f8c73db850a071a63e9 | 0360047b1b6868244d2905892a17cc3c5895e2ca | refs/heads/master | 2021-01-12T10:03:49.648160 | 2017-03-05T12:32:55 | 2017-03-05T12:32:55 | 76,247,989 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 171 | java | package Test;
public class Test1 {
public static void main(String[] args){
int sum = 0;
for(int i = 1;i<=100;i++){
sum+=i;
}
System.out.println(sum);
}
}
| [
"375858470@qq.com"
] | 375858470@qq.com |
e56b905ed1f14bd549226cf1e94e8757973a6e2c | 593f5242496c45775c01ca91ede098af35942917 | /datasources/src/main/java/com/github/jorgecastilloprz/dagger2scopes/datasources/mock/model/MockGame.java | e7bfcda87cce06111da9f0bb493e68216b136709 | [
"Apache-2.0"
] | permissive | moskvax/Dagger2Scopes | f86b304d3e4ac05d9f0f1d435ba7998f13ac0cbf | 4e837a6c642d8f072028ac029b34ca74b4d4bd0d | refs/heads/master | 2021-01-17T21:05:41.490226 | 2015-05-04T12:05:25 | 2015-05-04T12:05:25 | 35,031,929 | 0 | 0 | null | 2015-05-04T11:51:17 | 2015-05-04T11:51:17 | null | UTF-8 | Java | false | false | 3,549 | java | /*
* Copyright (C) 2015 Jorge Castillo Pérez
*
* 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.github.jorgecastilloprz.dagger2scopes.datasources.mock.model;
import java.io.Serializable;
/**
* Mock game model. "mockNotImportantInfo" fields are just examples of fields that would not reach
* the next layer, as the mapper for this layer would ignore them while doing the mapping.
*
* @author Jorge Castillo Pérez
*/
public class MockGame implements Serializable {
private static final long serialVersionUID = -6470090944414208496L;
protected int id;
protected String imageUrl;
protected String name;
protected String releaseDate;
protected String author;
protected String description;
protected boolean bookmarked;
//This fields will not reach the subsequent inner layer
protected String mockNotImportantInfo1;
protected String mockNotImportantInfo2;
protected String mockNotImportantInfo3;
protected String mockNotImportantInfo4;
protected String mockNotImportantInfo5;
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getReleaseDate() {
return releaseDate;
}
public void setReleaseDate(String releaseDate) {
this.releaseDate = releaseDate;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public boolean isBookmarked() {
return bookmarked;
}
public void setBookmarked(boolean bookmarked) {
this.bookmarked = bookmarked;
}
public String getMockNotImportantInfo1() {
return mockNotImportantInfo1;
}
public void setMockNotImportantInfo1(String mockNotImportantInfo1) {
this.mockNotImportantInfo1 = mockNotImportantInfo1;
}
public String getMockNotImportantInfo2() {
return mockNotImportantInfo2;
}
public void setMockNotImportantInfo2(String mockNotImportantInfo2) {
this.mockNotImportantInfo2 = mockNotImportantInfo2;
}
public String getMockNotImportantInfo3() {
return mockNotImportantInfo3;
}
public void setMockNotImportantInfo3(String mockNotImportantInfo3) {
this.mockNotImportantInfo3 = mockNotImportantInfo3;
}
public String getMockNotImportantInfo4() {
return mockNotImportantInfo4;
}
public void setMockNotImportantInfo4(String mockNotImportantInfo4) {
this.mockNotImportantInfo4 = mockNotImportantInfo4;
}
public String getMockNotImportantInfo5() {
return mockNotImportantInfo5;
}
public void setMockNotImportantInfo5(String mockNotImportantInfo5) {
this.mockNotImportantInfo5 = mockNotImportantInfo5;
}
}
| [
"jorge.castillo.prz@gmail.com"
] | jorge.castillo.prz@gmail.com |
8201c3df652c851567e853d2bc4d1ba05233efe4 | 161ed0ad953b3d4a1adc61bb76f2941c60829ec4 | /src/main/java/biz/advanceitgroup/taxirideserver/profiles/entities/EmergencyContact.java | d977d8c0a8915242ee535dad0a5ae93f8568d78c | [] | no_license | FanJups/taxi | 5b4dc1fe7b3ce9fff357d072f615b34086c37423 | f6d8e57d261e1696d8d3c5e0da7ea12d02c4bcf0 | refs/heads/master | 2022-05-11T20:47:25.935698 | 2020-01-30T12:54:48 | 2020-01-30T12:54:48 | 237,212,082 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,253 | java | package biz.advanceitgroup.taxirideserver.profiles.entities;
import biz.advanceitgroup.taxirideserver.authentification.entities.Users;
import biz.advanceitgroup.taxirideserver.commons.entities.MainEntity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
/**
* Cette classe représente un contact d'urgence (0) ou de confiance (1) qu'un utilisateur enregistre
* dans son profil sur la plateforme TaxiRide.
* @author Simon Ngang
*
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class EmergencyContact extends MainEntity {
@Id
@Column(name = "EMERGENCY_CONTACT_ID")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name; // Nom du contact
@Column(length = 30)
private String phone; // Le numéro de téléphone du contact
private Integer contactType; // 0 = Emergency, 1= Confidence
@ManyToOne(targetEntity = Users.class, fetch = FetchType.LAZY)
@JoinColumn(nullable = false, name = "USER_ID")
private Users user; // L'utilisateur possédant ce contact
}
| [
"jupsfan@gmail.com"
] | jupsfan@gmail.com |
b6a2324bf376eb09e866be68359ec4d22243d43a | b2c5a5f8c46616996417aa0682abd5624cff9950 | /src/STG/FactoryShape/Square.java | 12e88f6831911f7b0c43796afd6eac509acc259f | [] | no_license | pktkumar/STG | fcb37d1ab06b64e85ce87b093ae7c26a518e44eb | 9b15de00a1a00514c31826c956b317099e52605a | refs/heads/master | 2020-07-10T19:12:01.157270 | 2019-08-25T19:55:40 | 2019-08-25T19:55:40 | 204,343,751 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 164 | java | package STG.FactoryShape;
public class Square extends Shape {
@Override
public void drawShape(){
System.out.println("this is Square");
}
}
| [
"kumar_vaduganathan@homedepot.com"
] | kumar_vaduganathan@homedepot.com |
8bb6e4342f826dd99e8d6d068d713f9f0da04143 | c03bd68ddff3babc2a606aea04669f2286512b11 | /Furnitures2/app/src/main/java/com/example/furnitures2/Tables_f.java | 47de30814a4da00d9dded5befc94ac8e6a596969 | [] | no_license | RxAbdoo/E-commerce-furnitures-App | 2c18b7d904eac3132e10fe7bae295e703a0099f1 | 09847abe4aeaa95e22ba4d36160f8c1194038bf2 | refs/heads/main | 2023-06-22T18:55:51.902332 | 2021-07-12T15:09:47 | 2021-07-12T15:09:47 | 375,770,444 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,002 | java | package com.example.furnitures2;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A simple {@link Fragment} subclass.
* Use the {@link Tables_f#newInstance} factory method to
* create an instance of this fragment.
*/
public class Tables_f extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
public Tables_f() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment Tables_f.
*/
// TODO: Rename and change types and number of parameters
public static Tables_f newInstance(String param1, String param2) {
Tables_f fragment = new Tables_f();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_tables_f, container, false);
}
} | [
"abdelrhmanosama42@gmail.com"
] | abdelrhmanosama42@gmail.com |
6f0ea0bd4c333cc3617ec5c47d39c38f1c5ef814 | 90e8dacdb64f3310baef7d7c41563f847767a836 | /AVL.java | 385c11034adaeefd63865165d47d57c71be3d277 | [] | no_license | artureduard0/tradutorAVL | 1efeadc8df6c07c7e1fe929e9e722e8cc4c82a9a | 3cbe2f9f1cace19be6db36d13ebdae5e678af658 | refs/heads/master | 2020-10-01T19:31:11.844504 | 2019-12-12T13:06:22 | 2019-12-12T13:06:22 | 227,608,759 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 4,437 | java | package tradutor1;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class AVL {
AvlNode palavra = null;
public AVL() {
palavra = null;
}
// retorna se a árvore está vazia
public boolean isEmpty() {
return palavra == null;
}
// retorna a altura da árvore
private int getAltura(AvlNode n) {
return n == null ? -1 : n.altura;
}
// retorna o maior valor
private int max(int x, int y) {
return x > y ? x : y;
}
// retorna o fator de balanceamento da árvore com raiz n
private int getFator(AvlNode n) {
return this.getAltura(n.esquerda) - this.getAltura(n.direita);
}
public boolean insert(Dicionario d) {
palavra = insert(d, palavra);
return true;
}
private AvlNode insert(Dicionario d, AvlNode n) {
if (n == null)
n = new AvlNode(d, null, null);
else if (d.getPalavra().compareTo(n.chave.getPalavra()) < 0)
n.esquerda = this.insert(d, n.esquerda);
else if (d.getPalavra().compareTo(n.chave.getPalavra()) > 0)
n.direita = this.insert(d, n.direita);
n = this.balanceamento(n);
return n;
}
// faz o balanceamento
public AvlNode balanceamento(AvlNode n) {
if (this.getFator(n) == 2) {
if (this.getFator(n.esquerda) > 0)
n = rotacaoSimplesDireita(n);
else
n = rotacaoDuplaDireita(n);
} else if (this.getFator(n) == -2) {
if (this.getFator(n.direita) < 0)
n = rotacaoSimplesEsquerda(n);
else
n = rotacaoDuplaEsquerda(n);
}
n.altura = max(this.getAltura(n.esquerda), this.getAltura(n.direita)) + 1;
return n;
}
// faz a rotação simples a direita do nó recebido
private AvlNode rotacaoSimplesDireita(AvlNode n2) {
AvlNode n1 = n2.esquerda;
n2.esquerda = n1.direita;
n1.direita = n2;
n2.altura = max(this.getAltura(n2.esquerda), this.getAltura(n2.direita)) + 1;
n1.altura = max(this.getAltura(n1.esquerda), n2.altura) + 1;
return n1;
}
// faz a rotação simples a esquerda do nó recebido
private AvlNode rotacaoSimplesEsquerda(AvlNode n1) {
AvlNode n2 = n1.direita;
n1.direita = n2.esquerda;
n2.esquerda = n1;
n1.altura = max(this.getAltura(n1.esquerda), this.getAltura(n1.direita)) + 1;
n2.altura = max(this.getAltura(n2.direita), n1.altura) + 1;
return n2;
}
// faz a rotação dupla a direita do nó recebido
private AvlNode rotacaoDuplaDireita(AvlNode n3) {
n3.esquerda = this.rotacaoSimplesEsquerda(n3.esquerda);
return this.rotacaoSimplesDireita(n3);
}
// faz a rotação dupla a esquerda do nó recebido
private AvlNode rotacaoDuplaEsquerda(AvlNode n1) {
n1.direita = this.rotacaoSimplesDireita(n1.direita);
return this.rotacaoSimplesEsquerda(n1);
}
public AvlNode search(String p) {
return search(palavra, p);
}
private AvlNode search(AvlNode p, String palavra) {
while (p != null) {
// palavra do nó atual
String palavraNoAtual = p.chave.getPalavra();
// se o nó atual for igual a palavra procurada retorna o nó
if (palavraNoAtual.equals(palavra))
return p;
// se o valor da palavra do nó for menor que a comparada
// procura na sub-árvore a esquerda
else if (palavraNoAtual.compareTo(palavra) > 0)
p = p.esquerda;
// se o valor da palavra do nó for maior que a comparada
// procura na sub-árvore a direita
else
p = p.direita;
}
// caso não exista
return null;
}
private AvlNode acharPai(Dicionario d) {
AvlNode p = palavra;
AvlNode anterior = null;
while (p != null && !(p.chave.equals(d))) { // acha o nó p com a chave el
anterior = p;
if (p.chave.getPalavra().compareTo(d.palavra) < 0)
p = p.direita;
else
p = p.esquerda;
}
if (p != null && p.chave.equals(d))
return anterior;
return null;
}
public void exportar(File file, BufferedWriter bw) throws IOException {
if (file == null || palavra == null)
return;
String pai = palavra.toString();
bw.write(pai);
bw.newLine();
exportarSubArvore(palavra.esquerda, file, bw);
exportarSubArvore(palavra.direita, file, bw);
}
private void exportarSubArvore(AvlNode node, File file, BufferedWriter bw) throws IOException {
if (node != null) {
AvlNode pai = this.acharPai(node.chave);
if (node.equals(pai.esquerda) == true) {
bw.write(node.toString());
bw.newLine();
} else {
bw.write(node.toString());
bw.newLine();
}
exportarSubArvore(node.esquerda, file, bw);
exportarSubArvore(node.direita, file, bw);
}
}
}
| [
"arturgpr2@gmail.com"
] | arturgpr2@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.