blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
332
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
50
| license_type
stringclasses 2
values | repo_name
stringlengths 7
115
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 557
values | visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
684M
⌀ | star_events_count
int64 0
77.7k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 17
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 82
values | src_encoding
stringclasses 28
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 7
5.41M
| extension
stringclasses 11
values | content
stringlengths 7
5.41M
| authors
listlengths 1
1
| author
stringlengths 0
161
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ed67d11668817fde3dab154666f0f5bde14f095e
|
249455cc8308c24896a93b209e9f8a14a3321a83
|
/src/test/java/com/oleg/trello/manager/BoardHelper.java
|
49b151d496d80b9343b113e0d19ce08f2a09a945
|
[
"Apache-2.0"
] |
permissive
|
Oleg091188/trello_selenium_tests1-9
|
a3c12f99cdc9dbd6e7f51d8c70c05b21e84ceff9
|
890c5c972f2936ac57adac224700215416484854
|
refs/heads/master
| 2020-11-27T21:01:07.019683 | 2020-02-05T18:45:28 | 2020-02-05T18:45:28 | 229,599,422 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,119 |
java
|
package com.oleg.trello.manager;
import com.oleg.trello.model.BoardData;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
public class BoardHelper extends HelperBase {
public BoardHelper(WebDriver wd) {
super(wd);
}
public int getBoardsCount() {
return wd.findElements(By.cssSelector("//*[@class='icon-lg icon-member']/../../..//li")).size()-1;
}
public void confirmBoardCreation() {
click(By.cssSelector("[data-test-id='create-board-submit-button']"));
}
public void fillBoardForm(BoardData boardData) {
type(By.cssSelector("[data-test-id='create-board-title-input']"), boardData.getBoardName());
}
public void selectCreateBoardFromDropDown() {
click(By.xpath("//span[@name='board']/..//p"));
}
public void createBoard() throws InterruptedException {
clickOnPlusButton();
selectCreateBoardFromDropDown();
fillBoardForm(new BoardData().setBoardName("qa22" + System.currentTimeMillis()));
confirmBoardCreation();
pause(15000);
returnToHomePage();
}
public void clickOnPlusButton() {
click(By.cssSelector("[data-test-id='header-create-menu-button']"));
}
public boolean isThereBoard() {
return getBoardsCount() >1;
}
public void permanentlyDeleteBoard() {
click(By.cssSelector(".js-delete"));
confirmCloseBoard();
}
public void confirmCloseBoard() {
click(By.cssSelector(".js-confirm[type='submit']"));
}
public void startCloseBoard() throws InterruptedException {
pause(5000);
click(By.cssSelector(".js-close-board"));
}
public void clickOpenMore() {
click(By.cssSelector(".js-open-more"));
}
public void openFirstBoard() {
click(By.xpath("//*[@class='icon-lg icon-member']/../../..//li"));
}
public void deleteBoard() throws InterruptedException {
openFirstBoard();
pause(10000);
clickOpenMore();
startCloseBoard();
confirmCloseBoard();
returnToHomePage();
}
}
|
[
"[email protected]"
] | |
b21aa926d0969023d307834bbf59de417464eaaa
|
7a1735c374df0604824658ea20bf86a208effcd2
|
/chess/src/main/java/chess/game/rule/OccupiedSquareRule.java
|
90656a81ca5908b2da9addd3c8d1d7f9a233a4ad
|
[] |
no_license
|
slibonati/chess
|
0902194340d1710d6c5e2d60f591eea7c2f2c1cd
|
2327b5cf2665fde1d6dbd5dfa0a5ff9ebcece4d2
|
refs/heads/master
| 2023-07-05T01:53:37.869164 | 2015-12-02T21:27:54 | 2015-12-02T21:27:54 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 367 |
java
|
package chess.game.rule;
import chess.game.MoveContext;
public class OccupiedSquareRule implements Rule {
public OccupiedSquareRule() {
}
@Override
public boolean isCompliant(MoveContext moveContext) {
return moveContext.getBoard().isEmpty(moveContext.getMove().getTo());
}
@Override
public String getMessage() {
return "current is occupied.";
}
}
|
[
"[email protected]"
] | |
60624f4c64bfec73d9db56b344b1111813d2402a
|
219a224c03f2a6d4693674de84dd4d7f20a1486a
|
/app/src/main/java/com/myapp/beatify/OurPicksAdapter.java
|
96cfdcc87579e3270fdc36799c84c00165c4eb31
|
[
"MIT"
] |
permissive
|
2tanayk/Beatify_music_app
|
25ecc50966bd014a4340a1c480ee26b1b6307467
|
af5fd0f9f1429e40c50d97b018ab58872581aa38
|
refs/heads/master
| 2023-02-26T04:35:11.104533 | 2021-01-29T12:36:02 | 2021-01-29T12:36:02 | 280,091,727 | 1 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 8,778 |
java
|
package com.myapp.beatify;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.firebase.ui.firestore.FirestoreRecyclerAdapter;
import com.firebase.ui.firestore.FirestoreRecyclerOptions;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.firestore.CollectionReference;
import com.google.firebase.firestore.DocumentChange;
import com.google.firebase.firestore.DocumentReference;
import com.google.firebase.firestore.DocumentSnapshot;
import com.google.firebase.firestore.EventListener;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.FirebaseFirestoreException;
import com.google.firebase.firestore.ListenerRegistration;
import com.google.firebase.firestore.QuerySnapshot;
import java.util.List;
public class OurPicksAdapter extends FirestoreRecyclerAdapter<Music, OurPicksAdapter.MyViewHolder> {
//private List<CreateSong> mOurPicksList;
private OnItemClickListener mListener;
private OnSongLikeListener lListener;
private ListenerRegistration listenerRegistration;
FirebaseFirestore db = FirebaseFirestore.getInstance();
CollectionReference userFavouriteDoc = db.collection("Users").
document("" + FirebaseAuth.getInstance().getCurrentUser().getUid())
.collection("Favourites");
private boolean lFlag = false;
/**
* Create a new RecyclerView adapter that listens to a Firestore Query. See {@link
* FirestoreRecyclerOptions} for configuration options.
*
* @param options
*/
public OurPicksAdapter(@NonNull FirestoreRecyclerOptions<Music> options) {
super(options);
}
public interface OnItemClickListener {
void onItemClick(DocumentSnapshot documentSnapshot, int position);
}
public interface OnSongLikeListener {
void onSongLike(DocumentSnapshot documentSnapshot, int position, boolean liked);
}
public void setOnItemClickListener(OnItemClickListener listener) {
mListener = listener;
}
public void setOnItemLikeListener(OnSongLikeListener listener) {
lListener = listener;
}
@NonNull
@Override
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view;
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.create_our_picks, parent, false);
MyViewHolder myViewHolder = new MyViewHolder(view, mListener, lListener);
return myViewHolder;
}
@Override
protected void onBindViewHolder(@NonNull final MyViewHolder holder, int position, @NonNull final Music model) {
holder.textView.setText(model.getTitle());
Glide.with(holder.imageView.getContext()).load(model.getUrl()).into(holder.imageView);
DocumentReference pDoc = getSnapshots().
getSnapshot(position).
getReference().
collection("Likes").
document("" + FirebaseAuth.getInstance().getCurrentUser().getUid());
pDoc.get().
addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {
@Override
public void onComplete(@NonNull Task<DocumentSnapshot> task) {
if (task.isSuccessful()) {
DocumentSnapshot document = task.getResult();
if (document.exists()) {
Log.e("LikingSongAdapter", "Document exists!");
holder.lImgView.setImageResource(R.drawable.ic_heart_fill);
holder.lImgView.setTag("l");
Log.e(model.getTitle(), holder.lImgView.getTag().toString());
//lFlag = true;
} else {
holder.lImgView.setImageResource(R.drawable.ic_heart_unfill);
holder.lImgView.setTag("nl");
Log.e("LikingSongAdapter", "Document does not exist!");
}//else ends
} else {
Log.e("LikingSongAdapter", String.valueOf(task.getException()));
}//else ends
}//onComplete ends
}
);
}//onBindViewHolder ends
@Override
public void startListening() {
super.startListening();
Log.e("infoOPA", "started listening");
listenerRegistration = userFavouriteDoc.addSnapshotListener(new EventListener<QuerySnapshot>() {
@Override
public void onEvent(@Nullable QuerySnapshot value, @Nullable FirebaseFirestoreException error) {
if (error != null) {
Log.e("TAG", "listen:error", error);
return;
}
for (DocumentChange dc : value.getDocumentChanges()) {
switch (dc.getType()) {
case ADDED:
break;
case MODIFIED:
break;
case REMOVED:
//dc.getDocument()
break;
}//switch ends
}//for ends
}//onEvent ends
});
}//startListening ends
@Override
public void stopListening() {
super.stopListening();
Log.e("infoOPA", "stopped listening");
listenerRegistration.remove();
}//stopListening ends
public class MyViewHolder extends RecyclerView.ViewHolder {
public ImageView imageView;
public TextView textView;
public ImageView lImgView;
public MyViewHolder(@NonNull View itemView, final OnItemClickListener listener, final OnSongLikeListener likeListener) {
super(itemView);
this.imageView = itemView.findViewById(R.id.our_img);
this.textView = itemView.findViewById(R.id.our_txt);
this.lImgView = itemView.findViewById(R.id.likeOPImg);
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (listener != null) {
int position = getAdapterPosition();
if (position != RecyclerView.NO_POSITION) {
listener.onItemClick(getSnapshots().getSnapshot(position), position);
}
}
}
});
lImgView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String tag = String.valueOf(lImgView.getTag());
if (likeListener != null) {
int position = getAdapterPosition();
if (tag.equals("nl")) {
lFlag = true;
lImgView.setTag("l");
lImgView.setImageResource(R.drawable.ic_heart_fill);
Log.e("LikingAdapterLogL", "imgTag " + String.valueOf(lImgView.getTag()) + " like " + lFlag);
} else {
lFlag = false;
lImgView.setTag("nl");
lImgView.setImageResource(R.drawable.ic_heart_unfill);
Log.e("LikingAdapterLogNL", "imgTag " + String.valueOf(lImgView.getTag()) + " like " + lFlag);
}//else ends
if (position != RecyclerView.NO_POSITION) {
likeListener.onSongLike(getSnapshots().getSnapshot(position), position, lFlag);
}
}//outer if ends
}//onClick ends
});
}
}
}
|
[
"[email protected]"
] | |
06d9a38813e6e3c6aef6577c6cef3d1c63ee3cd7
|
2ee73c10aae5f38ada1b7164b60b228655ba879e
|
/src/main/java/com/tseong/learning/patterns/_06_factoryMethod/Main.java
|
9a6a04709c876209b631cc436c1ac780dd8117fe
|
[] |
no_license
|
shawn-zhong/JavaLearning
|
f5f43da9d0b83036f29a0d650726976a40d96f83
|
7e124d294c736c4f2010043211aee389c71ad96f
|
refs/heads/master
| 2021-04-27T06:29:45.940324 | 2020-10-30T07:55:25 | 2020-10-30T07:55:25 | 122,615,400 | 1 | 0 | null | 2021-03-12T21:56:32 | 2018-02-23T11:55:41 |
Java
|
UTF-8
|
Java
| false | false | 390 |
java
|
package com.tseong.learning.patterns._06_factoryMethod;
public class Main {
public static void main(String[] args) {
IVehicleFactory factory = null;
factory = new BikeFactory();
Vehicle vehicle = factory.getVehicle();
vehicle.gotoWork();
factory = new BusFactory();
vehicle = factory.getVehicle();
vehicle.gotoWork();
}
}
|
[
"[email protected]"
] | |
3443fa1dd12b6e5834ced16ca25bf52d66dfbde2
|
0a73c5e641d871add9bd66a40f6e66767b15b931
|
/src/main/java/com/miningmark48/prefixation/utility/HandlePrefix.java
|
0e7604f227014612f1f4fed7dcd78bb25404332d
|
[] |
no_license
|
SeanChengN/Prefixation
|
37489cef375f34aa37cae115a579a6ab787f8fa1
|
8809950c699ecb64605317b95c3b5f2753fb4794
|
refs/heads/master
| 2020-03-28T12:09:47.732158 | 2018-09-11T03:51:04 | 2018-09-11T03:51:04 | 148,274,300 | 0 | 0 | null | 2018-09-11T06:57:15 | 2018-09-11T06:57:15 | null |
UTF-8
|
Java
| false | false | 3,414 |
java
|
package com.miningmark48.prefixation.utility;
import com.google.common.collect.Multimap;
import com.miningmark48.mininglib.utility.ModLogger;
import com.miningmark48.prefixation.init.ModTriggers;
import com.miningmark48.prefixation.reference.EnumPrefixTypes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import org.apache.commons.lang3.StringUtils;
import java.util.HashMap;
import java.util.Random;
public class HandlePrefix {
public static void addPrefix(EntityPlayer player, ItemStack stack, EnumPrefixTypes type, HashMap<Integer, Enum> prefixNameMap, HashMap<Integer, AttributeModifier[]> modifierMap, HashMap<Integer, String[]> modifierNameMap){
addPrefix(player, stack, type, prefixNameMap, modifierMap, modifierNameMap, EntityEquipmentSlot.MAINHAND);
}
public static void addPrefix(EntityPlayer player, ItemStack stack, EnumPrefixTypes type, HashMap<Integer, Enum> prefixNameMap, HashMap<Integer, AttributeModifier[]> modifierMap, HashMap<Integer, String[]> modifierNameMap, EntityEquipmentSlot slot){
Random rand = new Random();
int r = rand.nextInt(prefixNameMap.size());
Enum prefix = prefixNameMap.get(r);
String prefixName = StringUtils.capitalize(prefix.toString().toLowerCase());
stack.setStackDisplayName(prefixName + " " + stack.getDisplayName());
Multimap<String, AttributeModifier> priorAttributes = stack.getAttributeModifiers(slot);
for (int i = 0; i <= modifierMap.get(r).length - 1; i++) {
stack.addAttributeModifier(modifierNameMap.get(r)[i], modifierMap.get(r)[i], slot);
}
priorAttributes.forEach((name, attribute) -> stack.addAttributeModifier(name, attribute, slot));
if (stack.getTagCompound() == null) {
stack.setTagCompound(new NBTTagCompound());
}
stack.getTagCompound().setString("prefix", prefixName);
stack.getTagCompound().setString("type", type.toString());
if (!player.getEntityWorld().isRemote) handleAdvancement(player, prefixName);
}
public static void reforgePrefix(EntityPlayer player, ItemStack stack, EnumPrefixTypes type, HashMap<Integer, Enum> prefixNameMap, HashMap<Integer, AttributeModifier[]> modifierMap, HashMap<Integer, String[]> modifierNameMap){
reforgePrefix(player, stack, type, prefixNameMap, modifierMap, modifierNameMap, EntityEquipmentSlot.MAINHAND);
}
public static void reforgePrefix(EntityPlayer player, ItemStack stack, EnumPrefixTypes type, HashMap<Integer, Enum> prefixNameMap, HashMap<Integer, AttributeModifier[]> modifierMap, HashMap<Integer, String[]> modifierNameMap, EntityEquipmentSlot slot){
if (!stack.hasTagCompound()) {
stack.setTagCompound(new NBTTagCompound());
}
stack.getTagCompound().removeTag("AttributeModifiers");
stack.getTagCompound().removeTag("display");
addPrefix(player, stack, type, prefixNameMap, modifierMap, modifierNameMap, slot);
}
private static void handleAdvancement(EntityPlayer player, String prefix) {
ModTriggers.Advancements.prefix.trigger((EntityPlayerMP) player, prefix.toLowerCase());
}
}
|
[
"[email protected]"
] | |
33ac71fd62a0ea81c53cade5bc1aa9ee691ac9ac
|
a7cbdf02527ab9eafdfbfa64184fdfda58f4133a
|
/src/test/java/factory_create/FactoryCreateSecurityConfig.java
|
fda7c8d957f583668379d60286c8b14e5c1b2852
|
[
"Apache-2.0"
] |
permissive
|
kagechan/winter-cardinal
|
d38631be1acbd5b416dd999ae579e87d2fccb20e
|
8e947c0ae099fc5d00b7bbdd93e786da5b33fe99
|
refs/heads/master
| 2022-11-17T00:12:41.241165 | 2020-03-11T05:30:28 | 2020-03-11T05:30:28 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 904 |
java
|
/*
* Copyright (C) 2019 Toshiba Corporation
* SPDX-License-Identifier: Apache-2.0
*/
package factory_create;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
@Configuration
@EnableWebSecurity
public class FactoryCreateSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/**").permitAll().anyRequest().permitAll();
http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.ALWAYS);
http.csrf().disable();
}
}
|
[
"[email protected]"
] | |
28041f867dceb22ed59532cc9857573573364cb7
|
1e77656f624d6f9ad9ffcaa56de33337b917a630
|
/src/medoffice/entity/VitalsNormalRange.java
|
cb41afe18f9d0cb5a30cf74c913d3c20935061b0
|
[] |
no_license
|
xxrepo/bzp-medoffice-domain
|
db27019fcca6d457d84a6bfba9aefedafdba60cc
|
829b089ad548ce3e58cd40838ae2e5f2ca2404da
|
refs/heads/master
| 2020-04-16T21:14:50.575928 | 2013-09-03T15:58:05 | 2013-09-03T15:58:05 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,039 |
java
|
package medoffice.entity;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "vitals_normal_range")
public class VitalsNormalRange implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Column(name = "systolic_blood_pressure_min")
private Integer systolicBloodPressureMin;
@Column(name = "systolic_blood_pressure_max")
private Integer systolicBloodPressureMax;
@Column(name = "diastolic_blood_pressure_min")
private Integer diastolicBloodPressureMin;
@Column(name = "diastolic_blood_pressure_max")
private Integer diastolicBloodPressureMax;
@Column(name = "pulse_rate_min")
private Integer pulseRateMin;
@Column(name = "pulse_rate_max")
private Integer pulseRateMax;
@Column(name = "respiratory_rate_min")
private Integer respiratoryRateMin;
@Column(name = "respiratory_rate_max")
private Integer respiratoryRateMax;
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Column(name = "temperature_f_min")
private Double temperatureFMin;
@Column(name = "temperature_f_max")
private Double temperatureFMax;
@Column(name = "temperature_c_min")
private Double temperatureCMin;
@Column(name = "temperature_c_max")
private Double temperatureCMax;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getSystolicBloodPressureMin() {
return systolicBloodPressureMin;
}
public void setSystolicBloodPressureMin(Integer systolicBloodPressureMin) {
this.systolicBloodPressureMin = systolicBloodPressureMin;
}
public Integer getSystolicBloodPressureMax() {
return systolicBloodPressureMax;
}
public void setSystolicBloodPressureMax(Integer systolicBloodPressureMax) {
this.systolicBloodPressureMax = systolicBloodPressureMax;
}
public Integer getDiastolicBloodPressureMin() {
return diastolicBloodPressureMin;
}
public void setDiastolicBloodPressureMin(Integer diastolicBloodPressureMin) {
this.diastolicBloodPressureMin = diastolicBloodPressureMin;
}
public Integer getDiastolicBloodPressureMax() {
return diastolicBloodPressureMax;
}
public void setDiastolicBloodPressureMax(Integer diastolicBloodPressureMax) {
this.diastolicBloodPressureMax = diastolicBloodPressureMax;
}
public Integer getPulseRateMin() {
return pulseRateMin;
}
public void setPulseRateMin(Integer pulseRateMin) {
this.pulseRateMin = pulseRateMin;
}
public Integer getPulseRateMax() {
return pulseRateMax;
}
public void setPulseRateMax(Integer pulseRateMax) {
this.pulseRateMax = pulseRateMax;
}
public Integer getRespiratoryRateMin() {
return respiratoryRateMin;
}
public void setRespiratoryRateMin(Integer respiratoryRateMin) {
this.respiratoryRateMin = respiratoryRateMin;
}
public Integer getRespiratoryRateMax() {
return respiratoryRateMax;
}
public void setRespiratoryRateMax(Integer respiratoryRateMax) {
this.respiratoryRateMax = respiratoryRateMax;
}
public Double getTemperatureFMin() {
return temperatureFMin;
}
public void setTemperatureFMin(Double temperatureFMin) {
this.temperatureFMin = temperatureFMin;
}
public Double getTemperatureFMax() {
return temperatureFMax;
}
public void setTemperatureFMax(Double temperatureFMax) {
this.temperatureFMax = temperatureFMax;
}
public Double getTemperatureCMin() {
return temperatureCMin;
}
public void setTemperatureCMin(Double temperatureCMin) {
this.temperatureCMin = temperatureCMin;
}
public Double getTemperatureCMax() {
return temperatureCMax;
}
public void setTemperatureCMax(Double temperatureCMax) {
this.temperatureCMax = temperatureCMax;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof VitalsNormalRange)) {
return false;
}
VitalsNormalRange other = (VitalsNormalRange) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "medoffice.entity.VitalsNormalRange[id=" + id + "]";
}
}
|
[
"[email protected]"
] | |
122056f7a1ec6436773565331954d26a0dd2174f
|
40665051fadf3fb75e5a8f655362126c1a2a3af6
|
/AddstarMC-Minigames/3a8aa25919e3b2eb197e99e0203a1a1829f630ca/30/FlatFileExporter.java
|
040eecd8e8b0dc584342d5b0eec3e164269f77c0
|
[] |
no_license
|
fermadeiral/StyleErrors
|
6f44379207e8490ba618365c54bdfef554fc4fde
|
d1a6149d9526eb757cf053bc971dbd92b2bfcdf1
|
refs/heads/master
| 2020-07-15T12:55:10.564494 | 2019-10-24T02:30:45 | 2019-10-24T02:30:45 | 205,546,543 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,594 |
java
|
package au.com.mineauz.minigames.backend.sqlite;
import au.com.mineauz.minigames.backend.BackendImportCallback;
import au.com.mineauz.minigames.backend.ExportNotifier;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Maps;
import com.google.common.collect.SetMultimap;
import com.google.common.collect.Sets;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
public class FlatFileExporter {
private final File file;
private final FileConfiguration config;
private final ExportNotifier notifier;
private final BackendImportCallback callback;
private SetMultimap<String, UUID> completions;
private Map<String, Integer> minigameIds;
private int nextMinigameId;
private String notifyState;
private int notifyCount;
private long notifyTime;
public FlatFileExporter(File file, BackendImportCallback callback, ExportNotifier notifier) {
this.file = file;
this.callback = callback;
this.notifier = notifier;
config = new YamlConfiguration();
minigameIds = Maps.newHashMap();
}
public boolean doExport() {
try {
callback.begin();
config.load(file);
loadCompletions();
exportPlayers();
exportMinigames();
exportStats();
notifyNext("Done");
callback.end();
notifier.onComplete();
return true;
} catch (InvalidConfigurationException | IOException e) {
notifier.onError(e, notifyState, notifyCount);
return false;
}
}
private void loadCompletions() {
completions = HashMultimap.create();
for (String minigame : config.getKeys(false)) {
List<String> rawIds = config.getStringList(minigame);
for (String rawPlayerId : rawIds) {
UUID playerId = UUID.fromString(rawPlayerId.replace('_', '-'));
completions.put(minigame, playerId);
}
}
}
private void exportPlayers() {
notifyNext("Exporting players...");
Set<UUID> uniquePlayers = Sets.newHashSet(completions.values());
for (UUID playerId : uniquePlayers) {
// Attempt to get information about this player
OfflinePlayer player = Bukkit.getPlayer(playerId);
if (player != null && player.getName() != null) {
callback.acceptPlayer(playerId, player.getName(), player.getName());
} else {
callback.acceptPlayer(playerId, "Unknown", "Unknown");
}
++notifyCount;
notifyProgress();
}
}
private void exportMinigames() {
notifyNext("Exporting minigames...");
for (String minigame : completions.keySet()) {
int id = nextMinigameId++;
minigameIds.put(minigame, id);
callback.acceptMinigame(id, minigame);
++notifyCount;
notifyProgress();
}
}
private void exportStats() {
notifyNext("Exporting stats...");
for (String minigame : completions.keySet()) {
int id = minigameIds.get(minigame);
for (UUID playerId : completions.get(minigame)) {
callback.acceptStat(playerId, id, "wins", 1);
callback.acceptStat(playerId, id, "attempts", 1);
++notifyCount;
notifyProgress();
}
}
}
private void notifyProgress() {
if (System.currentTimeMillis() - notifyTime >= 2000) {
notifier.onProgress(notifyState, notifyCount);
notifyTime = System.currentTimeMillis();
}
}
private void notifyNext(String state) {
if (notifyCount != 0) {
notifier.onProgress(notifyState, notifyCount);
}
notifyTime = System.currentTimeMillis();
notifyCount = 0;
notifyState = state;
notifier.onProgress(state, 0);
}
}
|
[
"[email protected]"
] | |
c953dcbb7cd6a578a46f9e54dd6d3e583201af3a
|
1f2889bb822520b08b2f6752b9c7da0e466d1643
|
/src/resource/serviceImpl/AndCriteria.java
|
cd6474b6f9cd7357ba35f21ba8639df12da608d3
|
[] |
no_license
|
crspeed/javaDesignPattern
|
4fb4ca284e8709c954751949720bb4fe7fe19b47
|
5352ccbff262e87dafb9d23f468cd5dd439497a8
|
refs/heads/master
| 2020-04-01T17:36:38.420953 | 2018-11-20T12:23:35 | 2018-11-20T12:23:35 | 153,439,678 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 582 |
java
|
package resource.serviceImpl;
import java.util.List;
import resource.VO.Person;
import resource.service.Criteria;
public class AndCriteria implements Criteria{
private Criteria criteria;
private Criteria otherCriteria;
public AndCriteria(Criteria criteria, Criteria otherCriteria) {
super();
this.criteria = criteria;
this.otherCriteria = otherCriteria;
}
@Override
public List<Person> meetCriteria(List<Person> persons) {
List<Person> firstCriteriaPersons = criteria.meetCriteria(persons);
return otherCriteria.meetCriteria(firstCriteriaPersons);
}
}
|
[
"[email protected]"
] | |
7f38dd8c7867ad56dcfb566743094fb02df8463c
|
28b69912a4f3be8b23ad33106302dbaaf903d11f
|
/Recursion/Power.java
|
26f3406dfd7ec8a17ec909000d9f50106738d460
|
[] |
no_license
|
vividsky/Java
|
7900204e33d30e8e6725c2f45101734d38c560df
|
c429d03c3ce89cc1f7da2bacf15e34a9cd7117fe
|
refs/heads/main
| 2023-07-09T10:08:09.187259 | 2021-08-17T13:03:21 | 2021-08-17T13:03:21 | 397,251,106 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 289 |
java
|
package Recursion;
public class Power {
public static void main(String[] args) {
int n = 2;
int m = 5;
System.out.println(power(2, 5));
}
public static int power(int n, int m) {
if (m == 1) return n;
return n * power(n, m - 1);
}
}
|
[
"[email protected]"
] | |
b23409bfd159c51abee4d12ff51c588efcf7ee62
|
f69ab5d54bf509a98095018c53313aa2e5c489b7
|
/java-programs/inheritance/poly.java
|
f5b6e6bafea7ad8039779d6c2e057a731d60ed1c
|
[] |
no_license
|
yveslox/Genesisras
|
39224ce0e33c8b20f9d3473dd5909a7d45938e9c
|
93a042ceff60cd081305bb8a7f9d83ee6bac41ac
|
refs/heads/master
| 2023-08-20T23:53:39.694347 | 2023-08-20T11:21:18 | 2023-08-20T11:21:18 | 169,721,914 | 3 | 0 | null | 2023-09-14T11:40:28 | 2019-02-08T11:00:00 |
Shell
|
UTF-8
|
Java
| false | false | 580 |
java
|
class shape
{
void draw()
{
System.out.println("Drawing shape.");
}
}
class rectangle extends shape
{
void draw()
{
System.out.println("Drawing rectangle.");
}
}
class triangle extends shape
{
void draw()
{
System.out.println("Drawing triangle.");
}
}
class poly
{
public static void main(String args[])
{
shape s = new shape();
s.draw();
rectangle r = new rectangle();
s = r;
s.draw();
triangle t = new triangle();
s = t;
s.draw();
}
}
|
[
"[email protected]"
] | |
31ce779145c401795548c7b75c4aa449c8913630
|
331657e1e5d8a04d4e6572006dcb33903a810c13
|
/114-java/Java labs/Chained and Linked hashtables lab/the.java
|
92b55cf061eb33e1a4971a1a7b8a1c28636093a6
|
[] |
no_license
|
ntmk/ICS-Labs
|
1019d08704012e257998508aec8e22d46d9c8387
|
82377501ef164a36a8ab7971384aa91165e2f121
|
refs/heads/master
| 2020-03-19T16:28:18.096326 | 2019-11-10T15:34:19 | 2019-11-10T15:34:19 | 136,716,669 | 1 | 0 | null | 2019-11-10T15:34:20 | 2018-06-09T11:17:30 |
HTML
|
UTF-8
|
Java
| false | false | 48 |
java
|
the
the
the
the
the
the
the
the
the
the
|
[
"[email protected]"
] | |
eba51242b0a2f3c9130d6d1d0bb713885ce0f1e0
|
f1a7559012c4fa9353fe3f55d568bb85f8b23608
|
/src/application/Subd.java
|
028f3be3a490984486ca4719e766d4b20931226f
|
[] |
no_license
|
theneoxs/java_prog
|
23491ec315fe8f1ffcf9dad82a09e36d6d76523d
|
308e6ddc20fe0ccf6781fb4383f87555b02a585f
|
refs/heads/master
| 2021-07-18T11:26:52.282916 | 2021-01-22T20:25:27 | 2021-01-22T20:25:27 | 231,584,313 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 996 |
java
|
package application;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
public class Subd {
private IntegerProperty idsubdividion;
private StringProperty full_name;
private StringProperty short_name;
public Subd() {
this.idsubdividion = new SimpleIntegerProperty(0);
this.full_name = new SimpleStringProperty("");
this.short_name = new SimpleStringProperty("");
}
public Subd(Integer idsubd, String fname, String shname) {
this.idsubdividion = new SimpleIntegerProperty(idsubd);
this.full_name = new SimpleStringProperty(fname);
this.short_name = new SimpleStringProperty(shname);
}
public Integer getIdsubdividion() {
return this.idsubdividion.get();
}
public String getFull_name() {
return this.full_name.get();
}
public String getShort_name() {
return this.short_name.get();
}
}
|
[
"[email protected]"
] | |
d34b13bd4e9241a9d07bce041ebec6ef00a4a8db
|
56456387c8a2ff1062f34780b471712cc2a49b71
|
/b/a/a/a/b/a.java
|
df472ab0173fca903b235ac4d4ebd8faac1ba086
|
[] |
no_license
|
nendraharyo/presensimahasiswa-sourcecode
|
55d4b8e9f6968eaf71a2ea002e0e7f08d16c5a50
|
890fc86782e9b2b4748bdb9f3db946bfb830b252
|
refs/heads/master
| 2020-05-21T11:21:55.143420 | 2019-05-10T19:03:56 | 2019-05-10T19:03:56 | 186,022,425 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 390 |
java
|
package b.a.a.a.b;
import b.a.a.a.a.c;
import b.a.a.a.n;
public abstract interface a
{
public abstract c a(n paramn);
public abstract void a(n paramn, c paramc);
public abstract void b(n paramn);
}
/* Location: C:\Users\haryo\Desktop\enjarify-master\presensi-enjarify.jar!\b\a\a\a\b\a.class
* Java compiler version: 5 (49.0)
* JD-Core Version: 0.7.1
*/
|
[
"[email protected]"
] | |
201863aa8271625e10e7fb077808f308af9cd827
|
65774e30f3906368be4760f5f97bfb98eb32fd46
|
/imagesci/src/edu/jhu/ece/iacl/jist/structures/geom/CurvePath.java
|
1935f9e5e0c3dfb9f0fe0d89363c08dffdcb1d54
|
[] |
no_license
|
jj-jabb/phd-thesis
|
aadd802beca42fa98be4fd0d9060359443f40f35
|
b0458e82fb7dd133a43fd9415669fdf833b0eeed
|
refs/heads/master
| 2021-01-19T22:29:04.818282 | 2016-11-11T18:11:35 | 2016-11-11T18:11:35 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,887 |
java
|
/**
* Java Image Science Toolkit (JIST)
*
* Image Analysis and Communications Laboratory &
* Laboratory for Medical Image Computing &
* The Johns Hopkins University
*
* http://www.nitrc.org/projects/jist/
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version. The license is available for reading at:
* http://www.gnu.org/copyleft/lgpl.html
*
*/
package edu.jhu.ece.iacl.jist.structures.geom;
import java.util.Vector;
import javax.vecmath.Point3f;
// TODO: Auto-generated Javadoc
/**
* The Class CurvePath.
*/
public class CurvePath implements Curve {
/** The pts. */
Vector<Point3f> pts;
/**
* Instantiates a new curve path.
*/
public CurvePath() {
pts = new Vector<Point3f>();
}
/**
* Adds the.
*
* @param p
* the p
*/
public void add(Point3f p) {
pts.add(p);
}
/*
* (non-Javadoc)
*
* @see edu.jhu.ece.iacl.jist.structures.geom.Curve#getCurve()
*/
@Override
public Point3f[] getCurve() {
Point3f[] points = new Point3f[pts.size()];
for (int i = 0; i < pts.size(); i++) {
points[i] = pts.get(i);
}
return points;
}
/**
* Gets the points.
*
* @return the points
*/
public float[][] getPoints() {
float[][] points = new float[3][pts.size()];
for (int i = 0; i < pts.size(); i++) {
Point3f pt = pts.get(i);
points[0][i] = pt.x;
points[1][i] = pt.y;
points[2][i] = pt.z;
}
return points;
}
/*
* (non-Javadoc)
*
* @see edu.jhu.ece.iacl.jist.structures.geom.Curve#getValue()
*/
@Override
public double getValue() {
double length = 0;
for (int i = 1; i < pts.size(); i++) {
length += pts.get(i - 1).distance(pts.get(i));
}
return length;
}
}
|
[
"[email protected]"
] | |
792f21f2f56ce15a66849954364da3c71c666f38
|
29f508e730f2794341593ad18cf352990888c067
|
/src/javax/swing/plaf/ScrollPaneUI.java
|
6de4b8d9803d46b3771ff3ca704e6e1e2a97dcbf
|
[] |
no_license
|
nhchanh/jdk1.6.0_21
|
daf40144acd19d92d15561235038e6e0343f8dec
|
cdcaafc11122944545c51efc49bb9f884b1ad0d1
|
refs/heads/master
| 2021-01-10T19:05:13.011208 | 2014-01-07T23:10:19 | 2014-01-07T23:10:19 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 395 |
java
|
/*
* @(#)ScrollPaneUI.java 1.19 10/03/23
*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package javax.swing.plaf;
/**
* Pluggable look and feel interface for JScrollPane.
*
* @version 1.19 03/23/10
* @author Hans Muller
*/
public abstract class ScrollPaneUI extends ComponentUI {
}
|
[
"[email protected]"
] | |
f504207c2547e9a59e33a2f672a2ae00484e151a
|
d9bb53be6087508ff8ba150e213778c896cc62b5
|
/lab1/src/test/java/ar/uba/fi/compiladores/parte4/NumbersoupTest.java
|
bbe574032c794cbc5c5ad06e568858fff97c5682
|
[] |
no_license
|
compiladores/labs
|
e12603cc8fcafe972b623644ec3fa8ab4af2625a
|
51cb4445ee716da8f7f7bf1a9a821350fccf6da2
|
refs/heads/master
| 2023-07-29T11:13:26.877809 | 2021-09-09T04:05:14 | 2021-09-09T04:05:14 | 404,099,365 | 1 | 5 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,612 |
java
|
package ar.uba.fi.compiladores.parte4;
import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import ar.uba.fi.compiladores.parte3.BadTokenException;
import ar.uba.fi.compiladores.parte3.ManualLexer;
import ar.uba.fi.compiladores.parte3.Token;
import ar.uba.fi.compiladores.parte4.Numbersoup.Automata;
import ar.uba.fi.compiladores.parte4.Numbersoup.State;
import ar.uba.fi.compiladores.parte4.Numbersoup.TokenTypes;
public class NumbersoupTest {
Automata language = new Automata();
ManualLexer<State,TokenTypes> lexer = new ManualLexer<State,TokenTypes>(language);
@Test void testOtherTokensAsPrefixes() throws BadTokenException{
List<Token<TokenTypes>> expected = Arrays.asList(
new Token<>(TokenTypes.BIN,"0110"),
new Token<>(TokenTypes.DEC,"102"),
new Token<>(TokenTypes.HEX,"018F"),
new Token<>(TokenTypes.BINHEX,"0AFx010")
);
assertEquals(expected, lexer.lex(" 0110 102 018F 0AFx010"));
}
@Test void testOtherTokensAsPostfixes() throws BadTokenException{
List<Token<TokenTypes>> expected = Arrays.asList(
new Token<>(TokenTypes.DEC,"210"),
new Token<>(TokenTypes.HEX,"F801")
);
assertEquals(expected, lexer.lex(" 210 F801"));
}
@Test(expected = BadTokenException.class) void testBadNumber() throws BadTokenException{
lexer.lex(" 0AFx0102");
}
@Test(expected = BadTokenException.class) void testBadCharacters() throws BadTokenException{
lexer.lex("ho1a");
}
}
|
[
"[email protected]"
] | |
ed3563ea01e8792c6d20f147e1acc9c31d3fc161
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/elastic--elasticsearch/2038429f63cd31721c0522d2d49eab66303c68fb/after/CategoryQueryContext.java
|
da5d8d0a66e9664eed0f32bfce38c6ef1a864aaf
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,475 |
java
|
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch 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.elasticsearch.search.suggest.completion.context;
import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.ObjectParser;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import java.io.IOException;
import java.util.Collections;
import java.util.Objects;
import static org.elasticsearch.search.suggest.completion.context.CategoryContextMapping.CONTEXT_BOOST;
import static org.elasticsearch.search.suggest.completion.context.CategoryContextMapping.CONTEXT_PREFIX;
import static org.elasticsearch.search.suggest.completion.context.CategoryContextMapping.CONTEXT_VALUE;
/**
* Defines the query context for {@link CategoryContextMapping}
*/
public final class CategoryQueryContext implements QueryContext {
public static final String NAME = "category";
public static final CategoryQueryContext PROTOTYPE = new CategoryQueryContext("", 1, false);
private final String category;
private final boolean isPrefix;
private final int boost;
private CategoryQueryContext(String category, int boost, boolean isPrefix) {
this.category = category;
this.boost = boost;
this.isPrefix = isPrefix;
}
/**
* Returns the category of the context
*/
public String getCategory() {
return category;
}
/**
* Returns if the context should be treated as a prefix
*/
public boolean isPrefix() {
return isPrefix;
}
/**
* Returns the query-time boost of the context
*/
public int getBoost() {
return boost;
}
public static Builder builder() {
return new Builder();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CategoryQueryContext that = (CategoryQueryContext) o;
if (isPrefix != that.isPrefix) return false;
if (boost != that.boost) return false;
return category != null ? category.equals(that.category) : that.category == null;
}
@Override
public int hashCode() {
int result = category != null ? category.hashCode() : 0;
result = 31 * result + (isPrefix ? 1 : 0);
result = 31 * result + boost;
return result;
}
@Override
public String getWriteableName() {
return NAME;
}
private static ObjectParser<Builder, Void> CATEGORY_PARSER = new ObjectParser<>(NAME, null);
static {
CATEGORY_PARSER.declareString(Builder::setCategory, new ParseField(CONTEXT_VALUE));
CATEGORY_PARSER.declareInt(Builder::setBoost, new ParseField(CONTEXT_BOOST));
CATEGORY_PARSER.declareBoolean(Builder::setPrefix, new ParseField(CONTEXT_PREFIX));
}
@Override
public CategoryQueryContext fromXContext(XContentParser parser) throws IOException {
XContentParser.Token token = parser.currentToken();
Builder builder = builder();
if (token == XContentParser.Token.START_OBJECT) {
CATEGORY_PARSER.parse(parser, builder);
} else if (token == XContentParser.Token.VALUE_STRING) {
builder.setCategory(parser.text());
} else {
throw new ElasticsearchParseException("category context must be an object or string");
}
return builder.build();
}
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject();
builder.field(CONTEXT_VALUE, category);
builder.field(CONTEXT_BOOST, boost);
builder.field(CONTEXT_PREFIX, isPrefix);
builder.endObject();
return builder;
}
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(isPrefix);
out.writeVInt(boost);
out.writeString(category);
}
@Override
public QueryContext readFrom(StreamInput in) throws IOException {
Builder builder = new Builder();
builder.isPrefix = in.readBoolean();
builder.boost = in.readVInt();
builder.category = in.readString();
return builder.build();
}
public static class Builder {
private String category;
private boolean isPrefix = false;
private int boost = 1;
public Builder() {
}
/**
* Sets the category of the category.
* This is a required field
*/
public Builder setCategory(String category) {
Objects.requireNonNull(category, "category must not be null");
this.category = category;
return this;
}
/**
* Sets if the context should be treated as a prefix or not.
* Defaults to false
*/
public Builder setPrefix(boolean prefix) {
this.isPrefix = prefix;
return this;
}
/**
* Sets the query-time boost of the context.
* Defaults to 1.
*/
public Builder setBoost(int boost) {
if (boost <= 0) {
throw new IllegalArgumentException("boost must be greater than 0");
}
this.boost = boost;
return this;
}
public CategoryQueryContext build() {
Objects.requireNonNull(category, "category must not be null");
return new CategoryQueryContext(category, boost, isPrefix);
}
}
}
|
[
"[email protected]"
] | |
794b8b754506ca69f44c3287a9bde41cbffac14a
|
d086793d2716f2590b2977f51064ae68b6ebd71c
|
/SearchInRotatedSortedArray.java
|
2c73ef8d92b5568ae568c65658ba11b1c72c2489
|
[] |
no_license
|
amankturka/CodingPractice-Java
|
73915fcccc82ec65cb38021ddb91dce1c08da0e1
|
0a8b05134a74fd82c68747f489a3b097e3b6f224
|
refs/heads/master
| 2020-05-31T23:01:30.365926 | 2019-06-23T03:03:51 | 2019-06-23T03:03:51 | 190,530,707 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 470 |
java
|
class Solution {
//use binary search logic
public int search(int[] nums, int target) {
int length = nums.length;
int mid = nums.length/2;
int index = -1;
for(int i = 0;i<mid;i++){
if(target == nums[i]){
index = i;
}
}
for(int i = mid;i<nums.length;i++){
if(target == nums[i]){
index = i;
}
}
return index;
}
}
|
[
"[email protected]"
] | |
70556faafb29f03e41de32957347a30784c6f9aa
|
481ea9c2e8d8c6977a2009fa1f9d73b82411468f
|
/src/main/java/com/github/luguo126/cqas/domain/Question.java
|
39c871bc215323af91be2e7664de683265a92a89
|
[
"Apache-2.0"
] |
permissive
|
luguo126/cqas
|
00ef99ea833cb70c3b1e9e4eb9d135b4b427c523
|
38776ff1c25d46db0aa44d29b9cd83329c4fac6a
|
refs/heads/master
| 2022-12-22T00:40:13.409795 | 2019-07-28T02:08:22 | 2019-07-28T02:08:22 | 195,507,991 | 0 | 0 |
Apache-2.0
| 2022-12-16T09:57:06 | 2019-07-06T06:51:57 |
JavaScript
|
UTF-8
|
Java
| false | false | 3,748 |
java
|
package com.github.luguo126.cqas.domain;
import java.sql.Date;
public class Question {
// create table question(
// question_id bigint(12) not null auto_increment primary key,
// type varchar(36) not null,
// title varchar(128) not null,
// content varchar(512) not null,
// like_number bigint(12) not null default 0,
// answer_number bigint(12) not null default 0,
// surf_number bigint(12) not null default 0,
// ask_date datetime not null default current_timestamp,
//
// user_id bigint(12) not null,
//
//
// constraint fk_user_question foreign key(user_id)
// references user(user_id)
// );
public long question_id;
public String type;
public String title;
public String content;
public long like_number;
public long answer_number;
public long surf_number;
public Date ask_date;
public String user_id;
public String content_md;
/**
* Returns value of question_id
* @return
*/
public long getQuestion_id() {
return question_id;
}
/**
* Sets new value of question_id
* @param
*/
public void setQuestion_id(long question_id) {
this.question_id = question_id;
}
/**
* Returns value of type
* @return
*/
public String getType() {
return type;
}
/**
* Sets new value of type
* @param
*/
public void setType(String type) {
this.type = type;
}
/**
* Returns value of title
* @return
*/
public String getTitle() {
return title;
}
/**
* Sets new value of title
* @param
*/
public void setTitle(String title) {
this.title = title;
}
/**
* Returns value of content
* @return
*/
public String getContent() {
return content;
}
/**
* Sets new value of content
* @param
*/
public void setContent(String content) {
this.content = content;
}
/**
* Returns value of like_number
* @return
*/
public long getLike_number() {
return like_number;
}
/**
* Sets new value of like_number
* @param
*/
public void setLike_number(long like_number) {
this.like_number = like_number;
}
/**
* Returns value of answer_number
* @return
*/
public long getAnswer_number() {
return answer_number;
}
/**
* Sets new value of answer_number
* @param
*/
public void setAnswer_number(long answer_number) {
this.answer_number = answer_number;
}
/**
* Returns value of surf_number
* @return
*/
public long getSurf_number() {
return surf_number;
}
/**
* Sets new value of surf_number
* @param
*/
public void setSurf_number(long surf_number) {
this.surf_number = surf_number;
}
/**
* Returns value of ask_date
* @return
*/
public Date getAsk_date() {
return ask_date;
}
/**
* Sets new value of ask_date
* @param
*/
public void setAsk_date(Date ask_date) {
this.ask_date = ask_date;
}
/**
* Returns value of user_id
* @return
*/
public String getUser_id() {
return user_id;
}
/**
* Sets new value of user_id
* @param
*/
public void setUser_id(String user_id) {
this.user_id = user_id;
}
/**
* Returns value of content_md
* @return
*/
public String getContent_md() {
return content_md;
}
/**
* Sets new value of content_md
* @param
*/
public void setContent_md(String content_md) {
this.content_md = content_md;
}
/**
* Create string representation of Question for printing
* @return
*/
@Override
public String toString() {
return "Question [question_id=" + question_id + ", type=" + type + ", title=" + title + ", content=" + content + ", like_number=" + like_number + ", answer_number=" + answer_number + ", surf_number=" + surf_number + ", ask_date=" + ask_date + ", user_id=" + user_id + ", content_md=" + content_md + "]";
}
}
|
[
"[email protected]"
] | |
8f59ce933f927ea921b49b5f39ce3c26e36ea9f2
|
8d1c39d2e192f341ad11a8ff57d8af54b711fbba
|
/src/main/java/com/sdacademy/programcasierie/persistence/ui/AppUI.java
|
851fd79292d5f2ee8feedbfc494fd85b2a6f9b8b
|
[] |
no_license
|
alexandrulungoci/ProgramDeCasierie
|
0c58fe2e8b7955bd8753f00a624733640310e22d
|
2d3083064f9eaf88af6c4f309af80db23a27745b
|
refs/heads/master
| 2020-12-23T23:06:08.750663 | 2020-04-21T19:09:36 | 2020-04-21T19:09:36 | 237,303,987 | 0 | 0 | null | 2020-10-13T21:23:20 | 2020-01-30T20:56:11 |
Java
|
UTF-8
|
Java
| false | false | 1,293 |
java
|
package com.sdacademy.programcasierie.persistence.ui;
import com.sdacademy.programcasierie.persistence.services.exception.CategoryNotFoundException;
import java.util.Scanner;
public class AppUI {
private Scanner scanner = new Scanner(System.in);
StockManagementUI stockManagementUI = new StockManagementUI();
CartUI cartUI = new CartUI();
public void startProgram() throws CategoryNotFoundException {
int option = 0;
while (option != 5) {
printMenu();
option = scanner.nextInt();
if (option == 1) {
cartUI.cumparaProduse();
} else if (option == 2) {
stockManagementUI.stockManagement();
} else if (option == 3) {
cartUI.stergeProdusDinCos();
} else if (option == 4) {
cartUI.finalizeazaComanda();
}
}
}
private void printMenu() {
System.out.println("Bine ati venit la Casierie");
System.out.println("Alegeti optiunea:");
System.out.println("1.Cumpara produse");
System.out.println("2.Stock Management");
System.out.println("3.Sterge produs din cos");
System.out.println("4.Finalizeaza comanda");
System.out.println("5.Exit");
}
}
|
[
"[email protected]"
] | |
03930a54385d78c7a5873a592860eb1a633647b4
|
9799b017bb5cff651a971787ac1b0aca42c810bb
|
/_210304_h/src/_7_quiz07/Airplane.java
|
27c02d795683d2896ad502a1108bdb8352be560e
|
[] |
no_license
|
jykim3097/java-basics
|
0551c38102aefeec7bddc2b4dfbc7dd557b56992
|
0b0f8997384f02ccc0fc4313ebf4acee4e42ea83
|
refs/heads/main
| 2023-06-28T16:52:59.117745 | 2021-08-06T10:04:43 | 2021-08-06T10:04:43 | 393,330,981 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 370 |
java
|
package _7_quiz07;
public class Airplane {
//멤버변수
String name;
//생성자
Airplane(String name){
this.name = name;
}
void takeOff() {
System.out.println("비행기가 이륙합니다.");
}
void fly() {
System.out.println("일반 모드로 비행합니다.");
}
void land() {
System.out.println("비행기가 착륙합니다.");
}
}
|
[
"[email protected]"
] | |
8c07e1ae31004c7d46511769c19aa4f85b9aa3d9
|
598b0d9f47abe2912d89b76e1e4e1844cd555d77
|
/src/main/java/adapter/USCensusAdapter.java
|
b2ed8463b709721a244dabf504e57b1f95c8707e
|
[] |
no_license
|
Prithvi0/IndianStatesCensusAnalyser
|
49573181e0d8b1fa8b4d2c531866f1113132e515
|
0a23d36751da2b469aa8c088be7bafaa552308b0
|
refs/heads/master
| 2021-05-24T08:00:02.983078 | 2020-04-17T23:08:54 | 2020-04-17T23:08:54 | 253,461,164 | 0 | 0 | null | 2020-04-07T16:58:58 | 2020-04-06T10:12:13 |
Java
|
UTF-8
|
Java
| false | false | 377 |
java
|
package adapter;
import Exception.*;
import dao.CensusDAO;
import dto.CSVCensusUS;
import java.util.Map;
public class USCensusAdapter extends CensusAdapter {
@Override
public Map<String, CensusDAO> CensusCSVData(String... csvFilePath) throws CSVException, StateCensusAnalyserException {
return super.CensusCSVData(CSVCensusUS.class, csvFilePath[0]);
}
}
|
[
"[email protected]"
] | |
25f64c42a59e48fb04f4bd5f062ce8ad9284c84f
|
a0e4f155a7b594f78a56958bca2cadedced8ffcd
|
/header/src/main/java/org/zstack/header/storage/snapshot/group/APIUpdateVolumeSnapshotGroupMsg.java
|
60efde9dd1c0f6bdac4427e76d6c76d7e9c7adff
|
[
"Apache-2.0"
] |
permissive
|
zhao-qc/zstack
|
e67533eabbbabd5ae9118d256f560107f9331be0
|
b38cd2324e272d736f291c836f01966f412653fa
|
refs/heads/master
| 2020-08-14T15:03:52.102504 | 2019-10-14T03:51:12 | 2019-10-14T03:51:12 | 215,187,833 | 3 | 0 |
Apache-2.0
| 2019-10-15T02:27:17 | 2019-10-15T02:27:16 | null |
UTF-8
|
Java
| false | false | 1,883 |
java
|
package org.zstack.header.storage.snapshot.group;
import org.springframework.http.HttpMethod;
import org.zstack.header.identity.Action;
import org.zstack.header.message.APIMessage;
import org.zstack.header.message.APIParam;
import org.zstack.header.rest.RestRequest;
import org.zstack.header.storage.snapshot.SnapshotBackendOperation;
import org.zstack.header.storage.snapshot.VolumeSnapshotConstant;
/**
* Created by MaJin on 2019/8/29.
*/
@Action(category = VolumeSnapshotConstant.ACTION_CATEGORY)
@RestRequest(
path = "/volume-snapshots/group/{uuid}/actions",
method = HttpMethod.PUT,
isAction = true,
responseClass = APIUpdateVolumeSnapshotGroupEvent.class
)
public class APIUpdateVolumeSnapshotGroupMsg extends APIMessage implements VolumeSnapshotGroupMessage {
@APIParam(required = false)
private String name;
@APIParam(required = false)
private String description;
@APIParam(resourceType = VolumeSnapshotGroupVO.class)
private String uuid;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
@Override
public String getGroupUuid() {
return uuid;
}
@Override
public SnapshotBackendOperation getBackendOperation() {
return SnapshotBackendOperation.NONE;
}
public static APIUpdateVolumeSnapshotGroupMsg __example__() {
APIUpdateVolumeSnapshotGroupMsg msg = new APIUpdateVolumeSnapshotGroupMsg();
msg.uuid = uuid();
msg.name = "new name";
return msg;
}
}
|
[
"[email protected]"
] | |
93e33668e1cdebe97d9ee270762fef1f31846304
|
4a519b568fd2ee6d5362bb53528f0ca2048b8f4e
|
/Fog/src/main/java/FunctionLayer/ShedCalculator.java
|
8a81291342da470c09419a7c2515a760515c5aaa
|
[] |
no_license
|
Stefaneliasen/JohannesFogEksamen
|
45453693bd672e5316401f9493495f9f0b3b88d0
|
fd7075faacd7e21e580496b8cac5b31e4bf2fcdb
|
refs/heads/master
| 2021-08-31T04:50:42.999722 | 2017-12-20T12:30:40 | 2017-12-20T12:30:40 | 111,386,873 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,763 |
java
|
package FunctionLayer;
import DBAccess.ProductMapper;
import entity.Material;
import java.util.ArrayList;
public class ShedCalculator {
ProductMapper pm = new ProductMapper();
//LENGTH SKAL RETTES TIL SKURETS LÆNGDE!!
public static void main(String[] args) throws CarportException {
ShedCalculator shed = new ShedCalculator();
int length = 780;
int width = 600;
int height = 230;
shed.lægteBagsideDør(length, width, height);
shed.shedMaterial(length, width, height);
}
public Material lægteBagsideDør(int sLength, int width, int height) throws CarportException {
// "til z på bagside af dør"
// døren vil altid have samme størrelse. derfor en fast længde
int stk1width = 420;
String pname = pm.getMaterialById(3).getPname();
int price = pm.getMaterialById(3).getPrice();
Material mat = new Material(pname, price);
mat.setId(3);
mat.setAmount(1);
mat.setLength(stk1width);
return mat;
}
public Material løsholtergavl(int sLength, int width, int height) throws CarportException {
// "løsholter til skur gavle"
// skuret starter 35 cm inde i hver side, derfor -70. deles med 2 fordi der er en stolpe i midten.
int stk1width = (width - 70)/2;
String pname = pm.getMaterialById(4).getPname();
int price = pm.getMaterialById(4).getPrice();
Material mat = new Material(pname, price);
mat.setId(4);
//
mat.setAmount(12);
mat.setLength(stk1width);
return mat;
}
public Material løsholterside(int sLength, int width, int height) throws CarportException {
// "løsholter til skur gavle"
// skuret starter 35 cm inde i hver side, derfor -70. deles med 2 fordi der er en stolpe i midten.
String pname = pm.getMaterialById(4).getPname();
int price = pm.getMaterialById(4).getPrice();
Material mat = new Material(pname, price);
mat.setId(4);
//bankes direkte i rem
mat.setAmount(4);
mat.setLength(sLength);
return mat;
}
public Material remmeISider(int sLength, int width, int height) throws CarportException {
// Remme i sider, sadles ned i stolper
String pname = pm.getMaterialById(5).getPname();
int price = pm.getMaterialById(5).getPrice();
Material mat = new Material(pname, price);
mat.setId(5);
//hvorfor skal der bruges 1?? skur del, deles??
mat.setAmount(1);
//forstår ikke length er 480 når siden er 530 og der kun skal bruges 1.
mat.setLength(sLength);
return mat;
}
public Material brætTilSkur(int sLength, int width, int height) throws CarportException {
// Til beklædning af skur
String pname = pm.getMaterialById(7).getPname();
int price = pm.getMaterialById(7).getPrice();
Material mat = new Material(pname, price);
mat.setId(7);
//Length og width divideres med 10, da brædderne er 10 cm i bredde.
int amount = (int) Math.ceil(((sLength / 5) * 2) + ((width / 5) * 2));
mat.setAmount(amount);
mat.setLength(height);
return mat;
}
public Material yderBeklædningSkruerTilSkur(int sLength, int width, int height) throws CarportException {
// til montering af yderste beklædning
String pname = pm.getMaterialById(16).getPname();
int price = pm.getMaterialById(16).getPrice();
Material mat = new Material(pname, price);
mat.setId(16);
//Antallet af brædder til ydre beklædning * med 4, fordi der bruges 4 skruer pr. bræt
int amount = (int) Math.ceil((brætTilSkur(sLength, width, height).getAmount() * 4)/400);
mat.setAmount(amount);
return mat;
}
public Material inderBeklædningSkruerTilSkur(int sLength, int width, int height) throws CarportException {
// til montering af yderste beklædning
String pname = pm.getMaterialById(17).getPname();
int price = pm.getMaterialById(17).getPrice();
Material mat = new Material(pname, price);
mat.setId(17);
//Antallet af brædder til inder beklædning * med 3, fordi der bruges 3 skruer pr. bræt
int amount = (int) Math.ceil((brætTilSkur(sLength, width, height).getAmount() * 3)/300);
mat.setAmount(amount);
return mat;
}
public Material stalddørsgrebTilSkur(int sLength, int width, int height) throws CarportException {
// Til lås på dør til skur
String pname = pm.getMaterialById(18).getPname();
int price = pm.getMaterialById(18).getPrice();
Material mat = new Material(pname, price);
mat.setId(18);
//Der skal kun bruges en lås/greb til 1 dør
mat.setAmount(1);
return mat;
}
public Material tHængselTilSkur(int sLength, int width, int height) throws CarportException {
// Til skurdør
String pname = pm.getMaterialById(19).getPname();
int price = pm.getMaterialById(19).getPrice();
Material mat = new Material(pname, price);
mat.setId(19);
//Bruges kun 2 hængsler til 1 dør.
mat.setAmount(2);
return mat;
}
public Material vinkelBeslagTilSkur(int sLength, int width, int height) throws CarportException {
// Til montering af løsholter i skur
String pname = pm.getMaterialById(16).getPname();
int price = pm.getMaterialById(16).getPrice();
Material mat = new Material(pname, price);
mat.setId(16);
// Bruges 2 vinkelbeslag pr. løsholter
int amount = (løsholtergavl(sLength, width, height).getAmount() + løsholterside(sLength, width, height).getAmount()) * 2; ;
mat.setAmount(amount);
return mat;
}
public ArrayList<Material> shedMaterial (int sLength, int width, int height) throws CarportException {
ArrayList<Material> shedMaterials = new ArrayList();
shedMaterials.add(lægteBagsideDør(sLength, width, height));
shedMaterials.add(løsholtergavl(sLength, width, height));
shedMaterials.add(løsholterside(sLength, width, height));
shedMaterials.add(remmeISider(sLength, width, height));
shedMaterials.add(brætTilSkur(sLength, width, height));
shedMaterials.add(yderBeklædningSkruerTilSkur(sLength, width, height));
shedMaterials.add(inderBeklædningSkruerTilSkur(sLength, width, height));
shedMaterials.add(stalddørsgrebTilSkur(sLength, width, height));
shedMaterials.add(tHængselTilSkur(sLength, width, height));
shedMaterials.add(vinkelBeslagTilSkur(sLength, width, height));
return shedMaterials;
}
}
|
[
"[email protected]"
] | |
aee3b5170746a07d778efc7945771e92572c4405
|
efc34c208348c06a6e20906d48eafae903e7b44d
|
/src/main/java/org/wso2/carbon/apimgt/dbsync/dto/TokenScopeDto.java
|
209d0b37d20c360f56347e2ee4efba5926d3bfac
|
[] |
no_license
|
ruks/db-sync-tool
|
15a32dbab7aa0270826ad48d3ef46f12fba7ce36
|
4042547c4adc7a4c49534c5868362d93967d7340
|
refs/heads/master
| 2022-06-12T23:11:07.427399 | 2019-08-29T09:26:00 | 2019-08-29T09:26:00 | 157,677,576 | 0 | 2 | null | 2022-05-20T20:55:49 | 2018-11-15T08:29:08 |
Java
|
UTF-8
|
Java
| false | false | 845 |
java
|
package org.wso2.carbon.apimgt.dbsync.dto;
public class TokenScopeDto {
int id;
String tokenId;
String tokenScope;
int tenantId;
public String getTokenId() {
return tokenId;
}
public void setTokenId(String tokenId) {
this.tokenId = tokenId;
}
public String getTokenScope() {
return tokenScope;
}
public void setTokenScope(String tokenScope) {
this.tokenScope = tokenScope;
}
public int getTenantId() {
return tenantId;
}
public void setTenantId(int tenantId) {
this.tenantId = tenantId;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Override
public String toString() {
return id + ":" + tokenId + ":" + tokenScope + ":" + tenantId;
}
}
|
[
"[email protected]"
] | |
45a98994e490643847db997008a62f772c04b52a
|
5a10b5bc5b142df45d212a219c9715d159167d94
|
/com/mycompany/firstpart/figures/Rectangle.java
|
1993bad8bd24bb0e83ec93d0e6fcf0698d77768e
|
[] |
no_license
|
kspurtova/NChomework1
|
462ee0719975286f937ecea7d7b02cb3ca664948
|
029ae9cc48f86d90861e63b7527a0eb2f7d88079
|
refs/heads/master
| 2023-08-31T23:16:16.667996 | 2021-10-28T13:01:41 | 2021-10-28T13:01:41 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 875 |
java
|
package com.mycompany.firstpart.figures;
public class Rectangle {
private float length = 1.0f;
private float width = 1.0f;
public Rectangle() {
}
public Rectangle(float length, float width) {
this.length = length;
this.width = width;
}
public float getLength() {
return length;
}
public void setLength(float length) {
this.length = length;
}
public float getWidth() {
return width;
}
public void setWidth(float width) {
this.width = width;
}
public double getArea() {
return length*width;
}
public double getPerimeter () {
return 2*(length+width);
}
@Override
public String toString() {
return "Rectangle{" +
"length=" + length +
", width=" + width +
'}';
}
}
|
[
"[email protected]"
] | |
4a911b8500585451d7cb84061f1cee670931153a
|
6ccb00b133132f9bc510299fd25c9d6166134b08
|
/src/main/java/com/jp/algorithm/StackAndQueue/PopMinStack.java
|
4c92a494cd78fe7f587e44cdd335c10004ca81b6
|
[] |
no_license
|
androidjp/Algorithm
|
181ce16096bcc3c94407bb1dc0067b0deb61fbee
|
2021da683dc6b6f271bc919988835641d8289c91
|
refs/heads/master
| 2020-05-21T20:39:51.785886 | 2018-08-14T14:32:45 | 2018-08-14T14:32:47 | 65,353,086 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,105 |
java
|
package com.jp.algorithm.StackAndQueue;
import java.util.Stack;
/**
* 可以输出最小元素的栈(getMin()功能的栈)
*
* Created by androidjp on 16-8-8.
*/
public class PopMinStack {
private Stack<Integer> dataStack;
private Stack<Integer> minStack;
public PopMinStack() {
dataStack = new Stack<Integer>();
minStack = new Stack<Integer>();
}
/**
* 插入规则A(如果minStack的栈顶元素大于等于新元素,那么新元素才进minStack)
* @param newNum
*/
public void pushA(Integer newNum){
if(this.minStack.isEmpty()){
this.minStack.push(newNum);
}else if (newNum <= getMin()){
this.minStack.push(newNum);
}
this.dataStack.push(newNum);
}
/**
* 入栈规则B(minStack和dataStack一样大,只是,如果新元素大于minStack栈顶,那么,minStack重入一个它的栈顶值一样的元素)
* @param newNum
*/
public void pushB(Integer newNum){
if(this.minStack.isEmpty()){
this.minStack.push(newNum);
}else if (newNum <= getMin()){
this.minStack.push(newNum);
}else{
this.minStack.push(getMin());
}
this.dataStack.push(newNum);
}
/**
* 出栈规则A(直接输出栈顶元素,如果需要minStack出栈,才出栈)
* @return
*/
public Integer popA(){
if (this.dataStack.isEmpty())
throw new RuntimeException("栈空!");
Integer value = this.dataStack.pop();
if (getMin()==value){
this.minStack.pop();
}
return value;
}
/**
* 出栈规则B(简单)
* @return
*/
public Integer popB(){
if (this.dataStack.isEmpty())
throw new RuntimeException("栈空!");
this.minStack.pop();
return this.dataStack.pop();
}
public int getMin(){
if (this.minStack.isEmpty())
throw new RuntimeException("栈空!");
return this.minStack.peek();
}
}
|
[
"[email protected]"
] | |
9c6c3b2ccd04de024058fd6f56d74b2c85cb5ee1
|
abb07027039c875d178428ceb459de9fedc2baa0
|
/sungness-core/src/main/java/com/sungness/core/crawler/DocumentLoaderImpl.java
|
22c6b64893c3da608b129a49bb8f416b86906a98
|
[
"Apache-2.0"
] |
permissive
|
sungness/sungness-framework
|
636936fa7814eb3b788fae9c65b6a59bcaf68cd5
|
22d6c2c792623df7365c897622bc144e2db9a383
|
refs/heads/master
| 2021-05-16T23:38:33.185209 | 2020-03-27T11:43:00 | 2020-03-27T11:43:00 | 250,518,857 | 1 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,420 |
java
|
package com.sungness.core.crawler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import java.io.IOException;
import java.util.Map;
/**
* 页面加载接口实现类
*
* 根据给定的url加载页面内容
* @author wanghongwei
*/
public class DocumentLoaderImpl implements DocumentLoader {
/** 程序处理日志记录对象 */
private final Log logger = LogFactory.getLog(this.getClass().getSimpleName());
private int timeOutMillis;
public DocumentLoaderImpl() {
this.timeOutMillis = ClientConfigure.TIMEOUT_FIVE_MINUTE;
}
public void setTimeOutMillis(int timeOutMillis) {
this.timeOutMillis = timeOutMillis;
}
public int getTimeOutMillis() {
return timeOutMillis;
}
/**
* 读取目标URL地址的页面内容,返回Document对象
* @param url String 目标url地址
* @return Document 页面文档对象,如果读取失败返回null,
* 错误原因可查看异常或logger日志文件。
*/
@Override
public Document getDocument(String url) throws IOException {
try {
return Jsoup.connect(url)
.userAgent(ClientUserAgent.getRandomUserAgent())
.timeout(timeOutMillis)
.get();
} catch (IOException e) {
logger.error("获取文档失败,url地址:" + url + ",错误原因:" + e.getMessage());
throw e;
}
}
@Override
public Document getDocument(String url, Map<String, String> params) throws IOException {
try {
return Jsoup.connect(url)
.userAgent(ClientUserAgent.getRandomUserAgent())
.timeout(timeOutMillis)
.data(params)
.post();
} catch (IOException e) {
logger.error("获取文档失败,url地址:" + url + ",错误原因:" + e.getMessage());
throw e;
}
}
/**
* 读取目标URL地址的页面内容,返回Document对象
*
* @param url String 目标url地址
* @param params Map<String, String> POST方式提交的参数map
* @param cookies
* @return Document 页面文档对象,如果读取失败抛出IOException,
* 错误原因可查看异常或logger日志文件。
*/
@Override
public Document getDocument(String url, Map<String, String> params,
Map<String, String> cookies) throws IOException {
try {
return Jsoup.connect(url)
.followRedirects(true)
.ignoreContentType(true)
.userAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36")
.timeout(timeOutMillis)
.data(params)
.cookies(cookies)
.referrer("http://218.206.191.22/prm/portal/login_inner.jsp")
.post();
} catch (IOException e) {
logger.error("获取文档失败,url地址:" + url + ",错误原因:" + e.getMessage());
throw e;
}
}
@Override
public String getJson(String url, Map<String, String> params,
Map<String, String> cookies, String referer) throws IOException {
try {
return Jsoup.connect(url)
.followRedirects(true)
.ignoreContentType(true)
.userAgent(ClientUserAgent.getChromeUserAgent())
.timeout(timeOutMillis)
.data(params)
.method(Connection.Method.POST)
.cookies(cookies)
.referrer(referer)
.execute().body();
} catch (IOException e) {
logger.error("获取文档失败,url地址:" + url + ",错误原因:" + e.getMessage());
throw e;
}
}
@Override
public String getJson(String url) throws IOException {
try {
return Jsoup.connect(url)
.userAgent(ClientUserAgent.getRandomUserAgent())
.timeout(timeOutMillis)
.ignoreContentType(true)
.execute().body();
} catch (IOException e) {
logger.error("获取文档失败,url地址:" + url + ",错误原因:" + e.getMessage());
throw e;
}
}
public static void main(String[] argv) {
}
}
|
[
"[email protected]"
] | |
5e0cd98c7da551a76b0331714050c47b13ca5c7d
|
e3a326204aee3c1194f7328740f563c423b7a11f
|
/src/main/java/com/mauve/tzfe/TzfeApplication.java
|
43e7399677c5b525ccee4dff81394414757b3e10
|
[] |
no_license
|
Hukeqing/2048-backend
|
9209a43ac1ba53991df0d620c6f934397fdad45b
|
eaae34a0b0a445257d9767e86d0667c3b5fd6657
|
refs/heads/master
| 2023-01-01T08:59:02.692593 | 2020-10-22T01:52:39 | 2020-10-22T01:52:39 | 304,503,666 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 383 |
java
|
package com.mauve.tzfe;
import com.spring4all.swagger.EnableSwagger2Doc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@EnableSwagger2Doc
public class TzfeApplication {
public static void main(String[] args) {
SpringApplication.run(TzfeApplication.class, args);
}
}
|
[
"[email protected]"
] | |
886688d31a7d72e32d5e0f3e4be2e2d98f3bbbb1
|
a3e674680e45442f6d9626c80b2798865e78a177
|
/pfindr/src/edu/isi/pfindr/learn/util/PairsFileIO.java
|
969b10e4cee892dd8fd3a5e84f3bbd141024525a
|
[] |
no_license
|
bioint/phenoexplorer
|
83127bca377465d99c7506a9d7f47fb037fde8d0
|
0e04e9a836b2b44875c25b083b092a1e9be1a9ee
|
refs/heads/master
| 2020-12-24T16:58:43.053761 | 2015-09-18T23:37:50 | 2015-09-18T23:37:50 | 14,636,180 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 22,858 |
java
|
package edu.isi.pfindr.learn.util;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.apache.commons.collections.map.LinkedMap;
import org.apache.commons.io.FileUtils;
import cc.mallet.types.Instance;
/*
* Copyright 2012 University of Southern California
*
* 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.
*/
/**
* Copyright 2012 University of Southern California
*
* Utility file for the various operations to be performed on/with the "pairs" file
*
* @author [email protected]
*
*/
public class PairsFileIO {
//Reads an input file, shuffles it, and writes it out
@SuppressWarnings("unchecked")
public static void shuffler(String pairsFilename) throws IOException{
List<String> fileWithPairs = FileUtils.readLines(new File (pairsFilename));
Collections.shuffle(fileWithPairs);
String outputFilename = pairsFilename.split("\\.")[0] + "_s.txt"; //output filename derived from the pairs filename
FileUtils.writeLines(new File (outputFilename), fileWithPairs );
}
/* Read the pairs file (where each line is <string1, string2, weight>) and constructs a Map of
* distinct <elements, index>. This fixed index will be used to access a location in the
* n x n Matrix (for weight or depth)
*/
public static LinkedMap readDistinctElementsIntoMap(String pairsFilename){
File pairsFile = new File (pairsFilename);
LinkedMap phenotypeIndexMap = new LinkedMap();
try{
List<String> fileWithPairs = FileUtils.readLines(pairsFile); //Read one at a time to consume less memory
int index = 0;
for (String s : fileWithPairs) {
//distinctElementsSet.add(s.split("\t")[0]);
//distinctElementsSet.add(s.split("\t")[1]);
if(!phenotypeIndexMap.containsKey(s.split("\t")[0])){
phenotypeIndexMap.put(s.split("\t")[0], index );
index++;
}
}
for (String s : fileWithPairs) {
if(!phenotypeIndexMap.containsKey(s.split("\t")[1])){
phenotypeIndexMap.put(s.split("\t")[1], index );
index++;
}
}
System.out.println("Index "+ index);
}catch (IOException e){
System.out.println("Error while reading/writing file with pairs"+ e.getMessage());
e.printStackTrace();
}catch (Exception e){
e.printStackTrace();
}
return phenotypeIndexMap;
}
/* Read the pairs file (where each line is <string1, string2, weight>) and constructs a
* list of distinct elements
*/
public static List<Object> readDistinctElementsIntoList(String pairsFilename){
File pairsFile = new File (pairsFilename);
//Set<String> distinctElementsSet = new LinkedHashSet<String>();
List<Object> distinctElementList = new ArrayList<Object>();
try{
List<String> fileWithPairs = FileUtils.readLines(pairsFile); //Read one at a time to consume less memory
for (String s : fileWithPairs) {
//distinctElementsSet.add(s.split("\t")[0]);
//distinctElementsSet.add(s.split("\t")[1]);
if(!distinctElementList.contains(s.split("\t")[0]))
distinctElementList.add(s.split("\t")[0]);
}
for (String s : fileWithPairs) {
if(!distinctElementList.contains(s.split("\t")[1]))
distinctElementList.add(s.split("\t")[1]);
}
}catch (IOException e){
System.out.println("Error while reading/writing file with pairs"+ e.getMessage());
e.printStackTrace();
}catch (Exception e){
e.printStackTrace();
}
return distinctElementList;
//return new ArrayList<Object>(distinctElementsSet);
}
//Read two different input files and construct pairs from them, when no information of class is given
public void generatePairsFromTwoDifferentFilesWithClass(String inputFilePath1,
String inputFilePath2, String outputFilePath) {
List<String> phenotypeList1 = new ArrayList<String>();
List<String> phenotypeList2 = new ArrayList<String>();
try{
phenotypeList1 = FileUtils.readLines(new File (inputFilePath1));
phenotypeList2 = FileUtils.readLines(new File (inputFilePath2));
}catch (IOException ioe){
ioe.printStackTrace();
}
String[] phenotype1, phenotype2;
StringBuffer outputBuffer = new StringBuffer();
//List<String> resultList = new ArrayList<String>();
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter(outputFilePath));
int count =0;
for (int i = 0; i < phenotypeList1.size(); i++) {
phenotype1 = phenotypeList1.get(i).split("\t");
for (int j = 0; j < phenotypeList2.size(); j++) {
count++;
phenotype2 = phenotypeList2.get(j).split("\t");
System.out.println("i "+ i + "j "+ j + " " + phenotype1[0] + " " + phenotype2[0]);
if (phenotype1[1].equals(phenotype2[1])) { //if the classes are the same
//if (phenotype1[1].equals(phenotype2[0])) { //if the classes are the same
//resultList.add(String.format("%s\t%s\t%d", phenotype1[3], phenotype2[3], 1));
//resultList.add(String.format("%s\t%s\t%d", phenotype1[0], phenotype2[1], 1));
outputBuffer.append(String.format("%s\t%s\t%d", phenotype1[0], phenotype2[0], 1)).append("\n");
//bw.write(String.format("%s\t%s\t%d", phenotype1[0], phenotype2[0], 1) + "\n");
} else {
//resultList.add(String.format("%s\t%s\t%d", phenotype1[3], phenotype2[3], 0));
//resultList.add(String.format("%s\t%s\t%d", phenotype1[0], phenotype2[1], 0));
//bw.write(String.format("%s\t%s\t%d", phenotype1[0], phenotype2[0], 0) + "\n");
outputBuffer.append(String.format("%s\t%s\t%d", phenotype1[0], phenotype2[0], 0)).append("\n");
}
bw.append(outputBuffer.toString());
outputBuffer.setLength(0);
}
}
bw.flush();
System.out.println("The count is: "+ count);
}catch (IOException io) {
try {
if(bw != null)
bw.close();
io.printStackTrace();
} catch (IOException e) {
System.out.println("Problem occured while closing output stream "+ bw);
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}finally{
try {
if(bw != null)
bw.close();
} catch (IOException e) {
System.out.println("Problem occured while closing output stream "+ bw);
e.printStackTrace();
}
}
}
public static void generatePairsFromStringAndFileContentWithNoClass(String userInput, String inputFilePath, String outputFilePath) {
List<String> phenotypeList = new ArrayList<String>();
try{
phenotypeList = FileUtils.readLines(new File (inputFilePath));
}catch (IOException ioe){
ioe.printStackTrace();
}
String[] phenotype2;
StringBuffer outputBuffer = new StringBuffer();
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter(outputFilePath));
for (int j = 0; j < phenotypeList.size(); j++) {
phenotype2 = phenotypeList.get(j).split("\t");
outputBuffer.append(String.format("%s\t%s\t%d\n", userInput, phenotype2[3], 0));
bw.append(outputBuffer.toString());
outputBuffer.setLength(0);
}
}catch (IOException io) {
try {
if(bw != null){
bw.close();
bw = null;
}
io.printStackTrace();
} catch (IOException e) {
System.out.println("Problem occured while closing output stream "+ bw);
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}finally{
try {
if(bw != null){
bw.close();
bw = null;
}
} catch (IOException e) {
System.out.println("Problem occured while closing output stream "+ bw);
e.printStackTrace();
}
}
}
public static void generatePairsFromTwoDifferentFilesWithNoClass(String inputFilePath1, String inputFilePath2, String outputFilePath) {
List<String> phenotypeList1 = new ArrayList<String>();
List<String> phenotypeList2 = new ArrayList<String>();
try{
//Reader paramReader = new InputStreamReader(getClass().getResourceAsStream("/com/test/services/LoadRunner/FireCollection/fire.txt"));
//System.out.println(PairsFileIO.class.getClassLoader().getResource(inputFilePath1).getPath());
//System.out.println(PairsFileIO.class.getClassLoader().getResource(inputFilePath2).getPath());
//phenotypeList1 = FileUtils.readLines(new File (PairsFileIO.class.getClassLoader().getResource(inputFilePath1).getPath()));
//phenotypeList2 = FileUtils.readLines(new File (PairsFileIO.class.getClassLoader().getResource(inputFilePath2).getPath()));
phenotypeList1 = FileUtils.readLines(new File (inputFilePath1));
phenotypeList2 = FileUtils.readLines(new File (inputFilePath2));
}catch (IOException ioe){
ioe.printStackTrace();
}
String[] phenotype1, phenotype2;
StringBuffer outputBuffer = new StringBuffer();
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter(outputFilePath));
for (int i = 0; i < phenotypeList1.size(); i++) {
phenotype1 = phenotypeList1.get(i).split("\t");
for (int j = 0; j < phenotypeList2.size(); j++) {
phenotype2 = phenotypeList2.get(j).split("\t");
//System.out.println("The value is:"+ phenotype1[3] + " : " + phenotype2[3]);
outputBuffer.append(String.format("%s\t%s\t%d\n", phenotype1[3], phenotype2[3], 0));
bw.append(outputBuffer.toString());
outputBuffer.setLength(0);
}
}
}catch (IOException io) {
try {
if(bw != null){
bw.close();
bw = null;
}
io.printStackTrace();
} catch (IOException e) {
System.out.println("Problem occured while closing output stream "+ bw);
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}finally{
try {
if(bw != null){
bw.close();
bw = null;
}
} catch (IOException e) {
System.out.println("Problem occured while closing output stream "+ bw);
e.printStackTrace();
}
}
}
public static void generatePairsFromFileWithNoClassSpecified(String inputFilePath, String pairsFileName) {
//Buffered output file
BufferedWriter output = null;
try {
//Read input file into a list
List<String> inputList = FileUtils.readLines(new File (inputFilePath));
int fileSize = inputList.size();
System.out.println(fileSize);
output = new BufferedWriter(new FileWriter(pairsFileName));
for (int i = 0; i < fileSize; i++) {
for (int j = i + 1; j < fileSize; j++) {
output.write(inputList.get(i).split("\t")[2] + "\t" + inputList.get(j).split("\t")[2] + "\t" + 0 +
"\n");
}
}
} catch (IOException io) {
try {
if(output != null)
output.close();
io.printStackTrace();
} catch (IOException e) {
System.out.println("Problem occured while closing input stream while reading file "+ output);
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}
}
public static List<String> generatePairsFromFileWithClass(String inputFilePath) {
List<String[]> rawData = new ArrayList<String[]>();
List<String> resu = new ArrayList<String>();
BufferedReader br;
String thisLine;
String[] a, b;
try {
br = new BufferedReader(new FileReader(inputFilePath));
while ((thisLine = br.readLine()) != null) {
thisLine = thisLine.trim();
if (thisLine.equals(""))
continue;
a = thisLine.split("\\t");
rawData.add(new String[]{a[1], a[3]}); //1=class, 3=phenotype string
//rawData.add(new String[]{a[1], a[0]}); //1=class, 0=phenotype string
}
br.close();
} catch (Exception e) {
e.printStackTrace();
}
for (int i = 0; i < rawData.size(); i++) {
a = rawData.get(i);
for (int j = i + 1; j < rawData.size(); j++) {
b = rawData.get(j);
if(a[0].equals("null") || b[0].equals("null")){
resu.add(String.format("%s\t%s\t%d", a[1], b[1], 0));
}else{
if (a[0].equals(b[0])) {
resu.add(String.format("%s\t%s\t%d", a[1], b[1], 1));
} else {
resu.add(String.format("%s\t%s\t%d", a[1], b[1], 0));
}
}
}
}
return resu;
}
public static List<Instance> loadInputFile(String inputFilePath){//, boolean isPositive) {
System.out.print("loading " + inputFilePath + " ...");
List<Instance> instList = new ArrayList<Instance>();
int i = 0;
try {
BufferedReader br = new BufferedReader(new FileReader(inputFilePath));
String thisLine;
while ((thisLine = br.readLine()) != null) {
thisLine = thisLine.trim();
if (thisLine.equals(""))
continue;
//if (isPositive && thisLine.split("\\t")[2].equals("0"))
//continue;
/*instList.add(new Instance(thisLine.split("\\t")[0] + "\t" + thisLine.split("\\t")[1],
thisLine.split("\\t")[2], i, thisLine));*/
instList.add(new Instance(thisLine.split("\\t")[1] + "\t" + thisLine.split("\\t")[3], //data/target/name/source
thisLine.split("\\t")[4], i, thisLine.split("\\t")[0] + "\t" + thisLine.split("\\t")[2] + "\t" + thisLine.split("\\t")[4]));
i++;
}
br.close();
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("complete.");
return instList;
}
/*
* Reads distinct elements from pairs file into a list, and adds the (Gold) class from
* the original test file
*
*/
public void readDistinctElementsFromPairsAddClass(String pairsFilepath){
//readDistinctElementsIntoList
List<Object> distinctElements = readDistinctElementsIntoList(pairsFilepath);
System.out.println("Size of distinctElements"+ distinctElements.size());
for(int i=0; i<distinctElements.size(); i++){
System.out.println("distinctElements "+ i + " " + distinctElements.get(i));
}
//get class for those distinct elements from original cohort file
String originalFile = "data/cohort1/bio_nlp/cohort1_s.txt";
BufferedReader br = null;
String thisLine;
String[] lineArray;
LinkedMap originalMap = new LinkedMap();
BufferedWriter distinctPriorityPairsWriter = null;
try {
br = new BufferedReader(new FileReader(originalFile));
while ((thisLine = br.readLine()) != null) {
thisLine = thisLine.trim();
if (thisLine.equals(""))
continue;
lineArray = thisLine.split("\t");
originalMap.put(lineArray[3], lineArray[1]);
}
//write distinct elements with class to an output file
StringBuffer outfileBuffer = new StringBuffer();
for(int i = 0; i < distinctElements.size(); i++)
outfileBuffer.append(distinctElements.get(i)).append("\t")
.append(originalMap.get(distinctElements.get(i)) + "\n");
distinctPriorityPairsWriter = new BufferedWriter(
new FileWriter( pairsFilepath.split("\\.")[0] + "_distinct_with_class.txt"));
distinctPriorityPairsWriter.append(outfileBuffer.toString());
outfileBuffer.setLength(0);
distinctPriorityPairsWriter.flush();
} catch (IOException io) {
try {
if(br != null)
br.close();
io.printStackTrace();
} catch (IOException e) {
System.out.println("Problem occured while closing output stream "+ br);
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}
}
public LinkedMap readOriginalFileWithGoldClass(String originalTestFile){
//String originalTestFile = "data/cohort1/bio_nlp/cohort1_s_test.txt";
//Read the test file
String thisLine;
String[] lineArray;
BufferedReader br = null;
LinkedMap originalTestClassMap = new LinkedMap();
try {
br = new BufferedReader(new FileReader(originalTestFile));
while ((thisLine = br.readLine()) != null) {
thisLine = thisLine.trim();
if (thisLine.equals(""))
continue;
lineArray = thisLine.split("\t");
originalTestClassMap.put(lineArray[3], lineArray[1]); //phenotype, class
//System.out.println("Adding "+ lineArray[1] + " : " + lineArray[3]);
}
} catch (IOException io) {
try {
if(br != null)
br.close();
io.printStackTrace();
} catch (IOException e) {
System.out.println("Problem occured while closing output stream while writing file "+ br);
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}
return originalTestClassMap;
}
public void filterPairsThatExist(String inputFilePath1, String inputFilePath2){
//eg. testdata(the data to check), traindata(original data)
//Read the files
List<String> phenotypeList1 = new ArrayList<String>();
List<String> phenotypeList2 = new ArrayList<String>(); //sure pairs
LinkedMap surePairsAdjacencyMap = new LinkedMap();
try{
phenotypeList1 = FileUtils.readLines(new File (inputFilePath1));
phenotypeList2 = FileUtils.readLines(new File (inputFilePath2));
String[] lineArray;
List<String> resultList = new ArrayList<String>();
List<String> surePairsMapValue = null;
System.out.println(phenotypeList2.size());
//construct a map of phenotype and its neighbors for sure-pairs
for (int i = 0; i < phenotypeList2.size(); i++) {
lineArray = phenotypeList2.get(i).split("\t");
surePairsMapValue = new ArrayList<String>();
//if the first value is existing in the map, get the second value
if(surePairsAdjacencyMap.containsKey(lineArray[0])){
surePairsMapValue = (List<String>)surePairsAdjacencyMap.get(lineArray[0]);
}
//System.out.println("SurePairsMapValueSize " + surePairsMapValue.size());
//if the value does not already contain the second, add the string and add it back to the map
if(!surePairsMapValue.contains(lineArray[1]))
surePairsMapValue.add(lineArray[1]);
surePairsAdjacencyMap.put(lineArray[0], surePairsMapValue);
//In the same manner, update the adjacency of the second string
surePairsMapValue = new ArrayList<String>();
if(surePairsAdjacencyMap.containsKey(lineArray[1])){
surePairsMapValue = (List<String>)surePairsAdjacencyMap.get(lineArray[1]);
}
if(!surePairsMapValue.contains(lineArray[0]))
surePairsMapValue.add(lineArray[0]);
surePairsAdjacencyMap.put(lineArray[1], surePairsMapValue);
}
List valueList = null;
for (int i=0; i<surePairsAdjacencyMap.size(); i++) {
System.out.println("Key : " + surePairsAdjacencyMap.get(i)
+ " Value : " + ((List)surePairsAdjacencyMap.get(surePairsAdjacencyMap.get(i))).size());
/*valueList = (List)surePairsAdjacencyMap.get(surePairsAdjacencyMap.get(i));
for(int j =0; j<valueList.size(); j++)
System.out.println("Value :" + valueList.get(j) );
//break;*/
}
//Now parse the new pairs file, and check if the pairs already exists in the sure pairs map
boolean existsSurePairs = false;
System.out.println(phenotypeList1.size());
surePairsMapValue = new ArrayList<String>();
for (int j = 0; j < phenotypeList1.size(); j++) {
lineArray = phenotypeList1.get(j).split("\t");
if(surePairsAdjacencyMap.containsKey(lineArray[0])){
surePairsMapValue = (List) surePairsAdjacencyMap.get(lineArray[0]);
if(surePairsMapValue.contains(lineArray[1])){
existsSurePairs = true;
}
}else if(surePairsAdjacencyMap.containsKey(lineArray[1])){
surePairsMapValue = (List) surePairsAdjacencyMap.get(lineArray[1]);
if(surePairsMapValue.contains(lineArray[0])){
existsSurePairs = true;
}
}
if(!existsSurePairs) //if it does not exist in surepairs, then write to output file
resultList.add(String.format("%s\t%s\t%s", lineArray[0], lineArray[1], lineArray[2]));
existsSurePairs = false;
}
String resultFilePath = inputFilePath1.split("\\.")[0] + "_filtered.txt";
FileUtils.writeLines(new File (resultFilePath), resultList);
}catch (IOException ioe){
ioe.printStackTrace();
}
}
public void extractOriginalMappingFromClassificationFile(String inputFilePath1, String outputFileName){
String thisLine;
String[] lineArray;
BufferedReader br = null;
BufferedWriter bw = null;
try {
//read the phenotype of the smaller file into an arraylist
br = new BufferedReader(new FileReader(inputFilePath1));
bw = new BufferedWriter(new FileWriter(outputFileName));
while ((thisLine = br.readLine()) != null) {
thisLine = thisLine.trim();
if (thisLine.equals(""))
continue;
lineArray = thisLine.split("\t");
bw.write(lineArray[0]+"\t"+lineArray[1]+"\t"+lineArray[2]+"\n");
}
} catch (IOException io) {
io.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}finally{
try{
if(bw != null)
bw.close();
if(br != null)
br.close();
}catch(Exception e){
e.printStackTrace();
}
}
}
private void getGoldClassForPairs(String inputFilePath ){
LinkedMap originalTestPairsClassMap = new LinkedMap();
String originalTestPairsFile = "data/cohort1/bio_nlp/cohort1_s_test_pairs.txt";
BufferedReader br = null;
String[] lineArray;
String thisLine;
try {
br = new BufferedReader(new FileReader(originalTestPairsFile));
while ((thisLine = br.readLine()) != null) {
thisLine = thisLine.trim();
if (thisLine.equals(""))
continue;
lineArray = thisLine.split("\t");
originalTestPairsClassMap.put(lineArray[0]+"\t"+lineArray[1], lineArray[2] );
}
} catch (IOException io) {
try {
if(br != null)
br.close();
io.printStackTrace();
} catch (IOException e) {
System.out.println("Problem occured while closing output stream "+ br);
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}
List<String> phenotypeList = null;
StringBuffer resultFileBuffer = new StringBuffer();
//Read the pairs file, and write the pairs with class from actual test file
try{
BufferedWriter resultPairsWriter = new BufferedWriter(
new FileWriter(inputFilePath.split("\\.")[0] + "_with_gold_class.txt"));
phenotypeList = FileUtils.readLines(new File (inputFilePath));
for (int i = 0; i < phenotypeList.size(); i++) {
lineArray = phenotypeList.get(i).split("\t");
resultFileBuffer.append(lineArray[0]).append("\t").append(lineArray[1]).append("\t")
.append(originalTestPairsClassMap.get(lineArray[0]+"\t"+lineArray[1])).append("\n");
}
resultPairsWriter.append(resultFileBuffer.toString());
resultFileBuffer.setLength(0);
resultPairsWriter.flush();
}catch (IOException e){
System.out.println("Error while reading/writing file with pairs"+ e.getMessage());
e.printStackTrace();
}catch (Exception e){
e.printStackTrace();
}
}
public static void main(String[] args) throws Exception {
//PairsFileIO pi = new PairsFileIO();
}
}
|
[
"[email protected]"
] | |
d661d09883b8404e5d66529587691bc7a430b500
|
2c306f5cd1d1aae4257a53205cd0ce49a4c4df26
|
/src/main/java/com/checkOut/common/service/businessFunction/TableGoodsService.java
|
a348b1fd2c2982a55240858000b203fef4f274f9
|
[] |
no_license
|
yuanfanqi/check_out
|
51225766413f8a94af7aef696a7ae2f1f645aa2a
|
a1d701ef74b1bdfb206eded5839a5658d493ac5f
|
refs/heads/master
| 2020-03-27T04:38:52.423773 | 2019-02-28T03:05:11 | 2019-02-28T03:05:11 | 145,957,935 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,770 |
java
|
package com.checkOut.common.service.businessFunction;
import java.util.List;
import com.checkOut.common.model.businessFunction.GoodsStore;
import com.checkOut.common.model.businessFunction.TableGoods;
import com.checkOut.common.model.commonModel.GoodsModel;
import com.checkOut.common.model.commonModel.PageData;
/**
* 商品表-业务层接口
* @author 77 E-mail:[email protected]
* @date 创建时间:2018-09-05 14:06:15
* @version 1.0
* @since
*/
public interface TableGoodsService {
/**
* 条件分页清单列表查询
* @param tableGoods
* @param page
* @param limit
* @param sidx
* @param order
* @return
*/
public PageData<GoodsModel> selectPage(TableGoods tableGoods, Integer page, Integer limit,String sidx, String order) throws Exception;
/**
* 单个商品信息添加
* @param record
* @return
* @throws Exception
*/
public Integer add(TableGoods record, GoodsStore goodsStore) throws Exception;
/**
* 按主键查询记录
* @param goodsId
* @return
* @throws Exception
*/
public TableGoods select(String goodsId) throws Exception;
/**
* 根据主键修改商品信息
* @param record
* @throws Exception
*/
public void modify(TableGoods record) throws Exception;
/**
* 验证是否goodsId已经存在于数据库中
* @param goodsId
* @return
* @throws Exception
*/
public boolean isExist(String goodsId) throws Exception;
/**
* 商品信息删除操作
* @param goodsIds
* @throws Exception
*/
public Integer deleteByIds(List<String> goodsIds) throws Exception;
/**
* 按照给的字段进行模糊查询
* @param param
* @return
* @throws Exception
*/
public PageData<TableGoods> likeSelect(String paramName,String paramValue) throws Exception;
}
|
[
"[email protected]"
] | |
0d376727e40dd3afb1145e898900713ce2fcc4ae
|
031a884a6712b537011458d4a9194423b2db44b1
|
/src/com/buxi/practice/lambdas/amstrong/AmstrongPerformanceTest.java
|
a465bd6493212ef8ac2a31d1b4eb8b796af17943
|
[] |
no_license
|
tibor-varga/practice
|
ebad789a8e57698934455edef1e69acb140e7e5f
|
033d7cde3ed4bbdd81b805d22d70e04753c1a227
|
refs/heads/master
| 2021-06-25T01:19:42.764551 | 2017-09-11T12:15:32 | 2017-09-11T12:15:32 | 103,128,991 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 594 |
java
|
package com.buxi.practice.lambdas.amstrong;
import java.util.stream.IntStream;
public class AmstrongPerformanceTest {
public static void main(String[] args) {
// testing the lambda implementation
IntStream testRangesStream = IntStream.rangeClosed(3, 6);
testRangesStream.forEach(x -> new AmstrongFinderWithLambdas().findAmstrongNumber(x));
System.out.println("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
// testing the normal implementation
IntStream testRanges2Stream = IntStream.rangeClosed(3, 6);
testRanges2Stream.forEach(x -> new AmstrongFinder().findAmstrongNumber(x));
}
}
|
[
"[email protected]"
] | |
e9d386287a35d021c86b1bbe1d0d0389be3f4f6a
|
2c86b6741764f7ee08b234584d963aa65dfee6b4
|
/jagent/src/main/java/com/ethink/agent/decode/RdpDecoder.java
|
6b39edcacb3ad9220dc2851e30ba89fd4a757124
|
[] |
no_license
|
RonnyRay/AGENT
|
f21d479798a88a4d676171116a425b5b6b065e7c
|
23a941038c342e348cd8b84961b1aeb984851cc7
|
refs/heads/master
| 2021-09-09T19:00:35.025630 | 2018-03-19T01:59:46 | 2018-03-19T01:59:46 | 125,789,824 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,123 |
java
|
package com.ethink.agent.decode;
import com.ethink.agent.task.bean.RDPTask;
import com.ethink.agent.util.UuidUtil;
/* @类描述:解析Rdp报文并返回rdpTask对象
* @date: 2017年10月16日
* @author: dingfan
*/
public class RdpDecoder implements Decoder {
@Override
public RDPTask decode(String code) {
RDPTask rdpTask = new RDPTask();
String[] tcpDates = code.split("\\|");
for ( int i = 0; i < tcpDates.length; i++) {
switch (i) {
case 0:
rdpTask.setCMDRESULT(tcpDates[i]);
break;
case 1:
rdpTask.setTRNEJ(tcpDates[i]);
break;
case 2:
rdpTask.setCTIME(tcpDates[i]);
break;
case 3:
rdpTask.setSOF_VER(tcpDates[i]);
break;
case 4:
rdpTask.setADV_VER(tcpDates[i]);
break;
case 5:
rdpTask.setCFG_VER(tcpDates[i]);
break;
case 6:
rdpTask.setDEV_NUM(tcpDates[i]);
break;
default:
break;
}
}
rdpTask.setTaskType("RDPStartExecutor");
rdpTask.setTaskId(UuidUtil.uuid());
return rdpTask;
}
}
|
[
"[email protected]"
] | |
426a059d43fff8f645610d15245a6f17b0c5aa79
|
1e396c39aa1ef12e3351a1363b63d5f3c42928f9
|
/performance_main/src/main/java/com/byd/performance_main/dao/RolePermissionDao.java
|
06d5462768c4882e98c556d61c654f6be083b5d1
|
[] |
no_license
|
czy1004103643/back_shuijingcun
|
a00845853ec15be7ef303b226f46539ce3cddcc4
|
7c6fc75b60772f6ccb8fa396471b76a1d328fd08
|
refs/heads/master
| 2020-04-29T23:04:05.423183 | 2018-12-16T10:19:29 | 2018-12-16T10:19:29 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 452 |
java
|
package com.byd.performance_main.dao;
import com.byd.performance_main.model.RolePermissionBean;
import java.util.List;
public interface RolePermissionDao {
//todo
int insert(RolePermissionBean rolePermissionBean);
int delete(Integer id);
int update(RolePermissionBean rolePermissionBean);
RolePermissionBean queryOwnRolePermissionBeanFromRole(Integer roleLevel);
List<RolePermissionBean> queryAllRolePermissionBean();
}
|
[
"[email protected]"
] | |
6e364ef7cb7a919f4c3fadfbf5241db1c1776412
|
59f2c46908a25ed6ab5899fa903350350b5bc93b
|
/app/src/main/java/jp/techacademy/shun/sasaki/calcapp/SecondActivity.java
|
1e6ba716301dbd885dcb545ac3c49d2d7bc4d198
|
[] |
no_license
|
sanyama333/CalcApp
|
65fa83523ad6e215e5527f2c51956ac3fb2e87d9
|
be2447100e9d7bb8ab0565df3398d75a29375a28
|
refs/heads/master
| 2020-03-24T08:40:50.183958 | 2018-07-27T17:09:43 | 2018-07-27T17:09:43 | 142,603,859 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 706 |
java
|
package jp.techacademy.shun.sasaki.calcapp;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
public class SecondActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
Intent intent = getIntent();
Double value1 = intent.getDoubleExtra("VALUE1", 0);
TextView textView = (TextView) findViewById(R.id.textView);
textView.setText(String.valueOf(value1));
}
}
|
[
"[email protected]"
] | |
ca54257e78d06c9ad88feb94cf68542bad051b9e
|
4fafd83849cd2ab7e8d5450b5f1b5a0a29bd007f
|
/app/src/main/java/jumpup/imi/fb4/htw/de/jumpupandroid/portal/trip/list/request/TripListRequest.java
|
2c4a19a954c822d7b39dca3ff543e279136ce3df
|
[] |
no_license
|
JumpUpMe/jumpup_android
|
e6e4e2f6fc14443d49aa6fd01ca1fcb37b7d903c
|
339cbf72876edef052af6a6688b49172721a5300
|
refs/heads/master
| 2016-08-12T19:53:41.895805 | 2016-03-01T15:12:57 | 2016-03-01T15:12:57 | 49,870,404 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,138 |
java
|
package jumpup.imi.fb4.htw.de.jumpupandroid.portal.trip.list.request;
import jumpup.imi.fb4.htw.de.jumpupandroid.entity.User;
import jumpup.imi.fb4.htw.de.jumpupandroid.portal.trip.entity.TripList;
import jumpup.imi.fb4.htw.de.jumpupandroid.util.webservice.exception.ErrorResponseException;
import jumpup.imi.fb4.htw.de.jumpupandroid.util.webservice.exception.TechnicalErrorException;
/**
* Project: jumpup_android
* <p/>
* Service interface for the user's trips.
* This requests targets the JumpUpWebService endpoint to load the user's trips.
*
* @author Sascha Feldmann <a href="mailto:[email protected]">[email protected]</a>
* @since 02.02.2016
*/
public interface TripListRequest {
/**
* Load the given user's offered trips.
* @param user the user whose offered trips should be loaded
* @return the TripList on success
*
* @throws TechnicalErrorException on a technical error (e.g. from the network layer)
* @throws ErrorResponseException on an web service error response
*/
TripList loadUsersTrips(User user) throws TechnicalErrorException, ErrorResponseException;
}
|
[
"[email protected]"
] | |
5fe2c77b1a892df46e3b76406b4dea403cbbda83
|
d2a928b0956f40f334925e67b7ffb0212cf15383
|
/src/main/java/handler/GameHandler.java
|
1910313eb82dca50fe807f4d24897d692071c02f
|
[] |
no_license
|
GeKuaiKuai/game-server
|
b752447f11fc81095a5b9ca6f3343bd3885de69e
|
5dc3b3e63f97ac91b73f5a6e1a65bb401d268e0c
|
refs/heads/master
| 2023-03-09T20:42:34.096768 | 2021-02-11T10:36:20 | 2021-02-11T10:36:20 | 252,881,330 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 224 |
java
|
package handler;
import io.OnlineContext;
import protocol.GameProtocol;
public abstract class GameHandler<T extends GameProtocol> {
public abstract void handle(OnlineContext ctx, T data) throws InterruptedException;
}
|
[
"[email protected]"
] | |
b041ba21213276218849ffd564c16b252d87a3cc
|
2075ab4000dfa4f90230e54dc09c7f697a38bbc9
|
/app/src/test/java/com/zpz/workbench/ExampleUnitTest.java
|
ef16b83b614af256efd09aa5fd6d1474b7b6b2f3
|
[] |
no_license
|
lyx322888/Workbench
|
7bf95f4267f8afd60ed04bddfc200af636fcaed0
|
344e8d13e90cdda1574f9477404d849db5054919
|
refs/heads/master
| 2022-12-01T15:21:48.821899 | 2020-08-03T06:55:17 | 2020-08-03T06:55:17 | 263,003,137 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 378 |
java
|
package com.zpz.workbench;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
|
[
"[email protected]"
] | |
df9e7b40b4195882c3249301caf2849016235fcc
|
13ab3455cf71502c69815c4407678035d69d712c
|
/speech-android-wrapper/src/main/java/com/ibm/watson/developer_cloud/android/text_to_speech/v1/TextToSpeech.java
|
1b076be5b73c9d253cdd95ed82319898e20fb97a
|
[] |
no_license
|
timManas/ML_Chatbot_IBMWatson
|
78be984b7bd8370e3b2193822e7352902098f50c
|
aac897404d4aafa723048c1ba0da8ab9cb23f84e
|
refs/heads/master
| 2021-01-01T03:32:27.407159 | 2016-05-25T00:43:52 | 2016-05-25T00:43:52 | 58,819,017 | 1 | 2 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,183 |
java
|
/**
* © Copyright IBM Corporation 2015
*
* 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.ibm.watson.developer_cloud.android.text_to_speech.v1;
import android.util.Log;
import com.ibm.watson.developer_cloud.android.speech_common.v1.TokenProvider;
import org.apache.http.HttpResponse;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.auth.BasicScheme;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URI;
/**
* Speech Recognition Class for SDK functions
* @author Viney Ugave ([email protected])
*/
public class TextToSpeech {
protected static final String TAG = "TextToSpeech";
private TTSUtility ttsUtility;
private String username;
private String password;
private URI hostURL;
private TokenProvider tokenProvider = null;
private String voice;
/**Speech Recognition Shared Instance
*
*/
private static TextToSpeech _instance = null;
public static TextToSpeech sharedInstance(){
if(_instance == null){
synchronized(TextToSpeech.class){
_instance = new TextToSpeech();
}
}
return _instance;
}
/**
* Init the shared instance with the context
* @param uri
*/
public void initWithContext(URI uri){
this.setHostURL(uri);
}
/**
* Send request of TTS
* @param ttsString
*/
public void synthesize(String ttsString) {
Log.d(TAG, "synthesize called: " + this.hostURL.toString() + "/v1/synthesize");
String[] Arguments = { this.hostURL.toString()+"/v1/synthesize", this.username, this.password,
this.voice, ttsString, this.tokenProvider == null ? null : this.tokenProvider.getToken()};
try {
ttsUtility = new TTSUtility();
ttsUtility.setCodec(TTSUtility.CODEC_WAV);
ttsUtility.synthesize(Arguments);
}
catch (Exception e) {
e.printStackTrace();
}
}
private void buildAuthenticationHeader(HttpGet httpGet) {
// use token based authentication if possible, otherwise Basic Authentication will be used
if (this.tokenProvider != null) {
Log.d(TAG, "using token based authentication");
httpGet.setHeader("X-Watson-Authorization-Token",this.tokenProvider.getToken());
} else {
Log.d(TAG, "using basic authentication");
httpGet.setHeader(BasicScheme.authenticate(new UsernamePasswordCredentials(this.username, this.password), "UTF-8",false));
}
}
public JSONObject getVoices() {
JSONObject object = null;
try {
HttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(this.hostURL+"/v1/voices");
Log.d(TAG,"url: " + this.hostURL+"/v1/voices");
this.buildAuthenticationHeader(httpGet);
httpGet.setHeader("accept", "application/json");
HttpResponse executed = httpClient.execute(httpGet);
InputStream is = executed.getEntity().getContent();
// get the JSON object containing the models from the InputStream
BufferedReader streamReader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
StringBuilder responseStrBuilder = new StringBuilder();
String inputStr;
while ((inputStr = streamReader.readLine()) != null)
responseStrBuilder.append(inputStr);
object = new JSONObject(responseStrBuilder.toString());
Log.d(TAG, object.toString());
} catch (IOException | JSONException e) {
e.printStackTrace();
}
return object;
}
/**
* Set credentials
* @param username
* @param password
*/
public void setCredentials(String username, String password) {
this.username = username;
this.password = password;
}
/**
* Set host URL
* @param hostURL
*/
public void setHostURL(URI hostURL) {
this.hostURL = hostURL;
}
/**
* Set token provider (for token based authentication)
*/
public void setTokenProvider(TokenProvider tokenProvider) { this.tokenProvider = tokenProvider; }
/**
* Set TTS voice
*/
public void setVoice(String voice) {
this.voice = voice;
}
}
|
[
"[email protected]"
] | |
a22e22e44115bec95fc0e661746c6c3ba58c2a6b
|
b462fb6bcd14992715834f431e2418e2263886e9
|
/app/src/main/java/com/example/instantattendance/mtcnn/MTCNN.java
|
7d0d0947aafcc1f3af4151dcf4f17804e0ec6537
|
[] |
no_license
|
AbdullahQN/InstantAttendance
|
63ca0c47f00664ffd2532517baceecb297a76afe
|
998deb546e908d0585cd3e85f98ba4b5765b4947
|
refs/heads/master
| 2023-06-04T22:52:52.865255 | 2021-06-25T17:13:31 | 2021-06-25T17:13:31 | 294,471,692 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 12,700 |
java
|
package com.example.instantattendance.mtcnn;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.Point;
import com.example.instantattendance.mobilefacenet.MyUtil;
import org.tensorflow.lite.Interpreter;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;
/**
* MTCNN for Android.
*/
public class MTCNN {
private float factor = 0.709f;
private float pNetThreshold = 0.6f;
private float rNetThreshold = 0.7f;
private float oNetThreshold = 0.7f;
private static final String MODEL_FILE_PNET = "pnet.tflite";
private static final String MODEL_FILE_RNET = "rnet.tflite";
private static final String MODEL_FILE_ONET = "onet.tflite";
private Interpreter pInterpreter;
private Interpreter rInterpreter;
private Interpreter oInterpreter;
public MTCNN(AssetManager assetManager) throws IOException {
Interpreter.Options options = new Interpreter.Options();
options.setNumThreads(4);
pInterpreter = new Interpreter(MyUtil.loadModelFile(assetManager, MODEL_FILE_PNET), options);
rInterpreter = new Interpreter(MyUtil.loadModelFile(assetManager, MODEL_FILE_RNET), options);
oInterpreter = new Interpreter(MyUtil.loadModelFile(assetManager, MODEL_FILE_ONET), options);
}
/**
* Face Detection
* @param bitmap Picture to be processed
* @param minFaceSize
* The smallest face pixel value. (The larger the value, the faster the detection)
*/
public Vector<Box> detectFaces(Bitmap bitmap, int minFaceSize) {
Vector<Box> boxes;
try {
//【1】PNet generate candidate boxes
boxes = pNet(bitmap, minFaceSize);
square_limit(boxes, bitmap.getWidth(), bitmap.getHeight());
//【2】RNet
boxes = rNet(bitmap, boxes);
square_limit(boxes, bitmap.getWidth(), bitmap.getHeight());
//【3】ONet
boxes = oNet(bitmap, boxes);
} catch (IllegalArgumentException e) {
e.printStackTrace();
boxes = new Vector<>();
}
return boxes;
}
private void square_limit(Vector<Box> boxes, int w, int h) {
// square
for (int i = 0; i < boxes.size(); i++) {
boxes.get(i).toSquareShape();
boxes.get(i).limitSquare(w, h);
}
}
/**
* NMS执行完后,才执行Regression
* (1) For each scale , use NMS with threshold=0.5
* (2) For all candidates , use NMS with threshold=0.7
* (3) Calibrate Bounding Box
* 注意:CNN输入图片最上面一行,坐标为[0..width,0]。所以Bitmap需要对折后再跑网络;网络输出同理.
*
* @param bitmap
* @return
*/
private Vector<Box> pNet(Bitmap bitmap, int minSize) {
int whMin = Math.min(bitmap.getWidth(), bitmap.getHeight());
// currentFaceSize=minSize/(factor^k) k=0,1,2... until exceed whMin
float currentFaceSize = minSize;
Vector<Box> totalBoxes = new Vector<>();
//【1】Image Paramid and Feed to Pnet
while (currentFaceSize <= whMin) {
float scale = 12.0f / currentFaceSize;
// (1)Image Resize
Bitmap bm = MyUtil.bitmapResize(bitmap, scale);
int w = bm.getWidth();
int h = bm.getHeight();
// (2)RUN CNN
int outW = (int) (Math.ceil(w * 0.5 - 5) + 0.5);
int outH = (int) (Math.ceil(h * 0.5 - 5) + 0.5);
float[][][][] prob1 = new float[1][outW][outH][2];
float[][][][] conv4_2_BiasAdd = new float[1][outW][outH][4];
pNetForward(bm, prob1, conv4_2_BiasAdd);
prob1 = MyUtil.transposeBatch(prob1);
conv4_2_BiasAdd = MyUtil.transposeBatch(conv4_2_BiasAdd);
// (3)数据解析
Vector<Box> curBoxes = new Vector<>();
generateBoxes(prob1, conv4_2_BiasAdd, scale, curBoxes);
// (4)nms 0.5
nms(curBoxes, 0.5f, "Union");
// (5)add to totalBoxes
for (int i = 0; i < curBoxes.size(); i++)
if (!curBoxes.get(i).deleted)
totalBoxes.addElement(curBoxes.get(i));
// Face Size等比递增
currentFaceSize /= factor;
}
// NMS 0.7
nms(totalBoxes, 0.7f, "Union");
// BBR
BoundingBoxReggression(totalBoxes);
return updateBoxes(totalBoxes);
}
/**
* pnet前向传播
*
* @param bitmap
* @param prob1
* @param conv4_2_BiasAdd
* @return
*/
private void pNetForward(Bitmap bitmap, float[][][][] prob1, float[][][][] conv4_2_BiasAdd) {
float[][][] img = MyUtil.normalizeImage(bitmap);
float[][][][] pNetIn = new float[1][][][];
pNetIn[0] = img;
pNetIn = MyUtil.transposeBatch(pNetIn);
Map<Integer, Object> outputs = new HashMap<>();
outputs.put(pInterpreter.getOutputIndex("pnet/prob1"), prob1);
outputs.put(pInterpreter.getOutputIndex("pnet/conv4-2/BiasAdd"), conv4_2_BiasAdd);
pInterpreter.runForMultipleInputsOutputs(new Object[]{pNetIn}, outputs);
}
private int generateBoxes(float[][][][] prob1, float[][][][] conv4_2_BiasAdd, float scale, Vector<Box> boxes) {
int h = prob1[0].length;
int w = prob1[0][0].length;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
float score = prob1[0][y][x][1];
// only accept prob >threadshold(0.6 here)
if (score > pNetThreshold) {
Box box = new Box();
// core
box.score = score;
// box
box.box[0] = Math.round(x * 2 / scale);
box.box[1] = Math.round(y * 2 / scale);
box.box[2] = Math.round((x * 2 + 11) / scale);
box.box[3] = Math.round((y * 2 + 11) / scale);
// bbr
for (int i = 0; i < 4; i++) {
box.bbr[i] = conv4_2_BiasAdd[0][y][x][i];
}
// add
boxes.addElement(box);
}
}
}
return 0;
}
/**
* nms,不符合条件的deleted设置为true
*
* @param boxes
* @param threshold
* @param method
*/
private void nms(Vector<Box> boxes, float threshold, String method) {
// NMS.Pairwise comparison
// int delete_cnt = 0;
for (int i = 0; i < boxes.size(); i++) {
Box box = boxes.get(i);
if (!box.deleted) {
// score < 0
// Indicates that the current rectangular frame is deleted
for (int j = i + 1; j < boxes.size(); j++) {
Box box2 = boxes.get(j);
if (!box2.deleted) {
int x1 = Math.max(box.box[0], box2.box[0]);
int y1 = Math.max(box.box[1], box2.box[1]);
int x2 = Math.min(box.box[2], box2.box[2]);
int y2 = Math.min(box.box[3], box2.box[3]);
if (x2 < x1 || y2 < y1) continue;
int areaIoU = (x2 - x1 + 1) * (y2 - y1 + 1);
float iou = 0f;
if (method.equals("Union"))
iou = 1.0f * areaIoU / (box.area() + box2.area() - areaIoU);
else if (method.equals("Min"))
iou = 1.0f * areaIoU / (Math.min(box.area(), box2.area()));
if (iou >= threshold) {
// Delete the box with the smaller prob
if (box.score > box2.score)
box2.deleted = true;
else
box.deleted = true;
}
}
}
}
}
}
private void BoundingBoxReggression(Vector<Box> boxes) {
for (int i = 0; i < boxes.size(); i++)
boxes.get(i).calibrate();
}
/**
* Refine Net
* @param bitmap
* @param boxes
* @return
*/
private Vector<Box> rNet(Bitmap bitmap, Vector<Box> boxes) {
// RNet Input Init
int num = boxes.size();
float[][][][] rNetIn = new float[num][24][24][3];
for (int i = 0; i < num; i++) {
float[][][] curCrop = MyUtil.cropAndResize(bitmap, boxes.get(i), 24);
curCrop = MyUtil.transposeImage(curCrop);
rNetIn[i] = curCrop;
}
// Run RNet
rNetForward(rNetIn, boxes);
// RNetThreshold
for (int i = 0; i < num; i++) {
if (boxes.get(i).score < rNetThreshold) {
boxes.get(i).deleted = true;
}
}
// Nms
nms(boxes, 0.7f, "Union");
BoundingBoxReggression(boxes);
return updateBoxes(boxes);
}
/**
* RNET
* Run neural network and write score and bias into boxes
* @param rNetIn
* @param boxes
*/
private void rNetForward(float[][][][] rNetIn, Vector<Box> boxes) {
int num = rNetIn.length;
float[][] prob1 = new float[num][2];
float[][] conv5_2_conv5_2 = new float[num][4];
Map<Integer, Object> outputs = new HashMap<>();
outputs.put(rInterpreter.getOutputIndex("rnet/prob1"), prob1);
outputs.put(rInterpreter.getOutputIndex("rnet/conv5-2/conv5-2"), conv5_2_conv5_2);
rInterpreter.runForMultipleInputsOutputs(new Object[]{rNetIn}, outputs);
// Conversion
for (int i = 0; i < num; i++) {
boxes.get(i).score = prob1[i][1];
for (int j = 0; j < 4; j++) {
boxes.get(i).bbr[j] = conv5_2_conv5_2[i][j];
}
}
}
/**
* ONet
* @param bitmap
* @param boxes
* @return
*/
private Vector<Box> oNet(Bitmap bitmap, Vector<Box> boxes) {
// ONet Input Init
int num = boxes.size();
float[][][][] oNetIn = new float[num][48][48][3];
for (int i = 0; i < num; i++) {
float[][][] curCrop = MyUtil.cropAndResize(bitmap, boxes.get(i), 48);
curCrop = MyUtil.transposeImage(curCrop);
oNetIn[i] = curCrop;
}
// Run ONet
oNetForward(oNetIn, boxes);
// ONetThreshold
for (int i = 0; i < num; i++) {
if (boxes.get(i).score < oNetThreshold) {
boxes.get(i).deleted = true;
}
}
BoundingBoxReggression(boxes);
// Nms
nms(boxes, 0.7f, "Min");
return updateBoxes(boxes);
}
/**
* ONetRun neural network and write score and bias into boxes
* @param oNetIn
* @param boxes
*/
private void oNetForward(float[][][][] oNetIn, Vector<Box> boxes) {
int num = oNetIn.length;
float[][] prob1 = new float[num][2];
float[][] conv6_2_conv6_2 = new float[num][4];
float[][] conv6_3_conv6_3 = new float[num][10];
Map<Integer, Object> outputs = new HashMap<>();
outputs.put(oInterpreter.getOutputIndex("onet/prob1"), prob1);
outputs.put(oInterpreter.getOutputIndex("onet/conv6-2/conv6-2"), conv6_2_conv6_2);
outputs.put(oInterpreter.getOutputIndex("onet/conv6-3/conv6-3"), conv6_3_conv6_3);
oInterpreter.runForMultipleInputsOutputs(new Object[]{oNetIn}, outputs);
// Conversion
for (int i = 0; i < num; i++) {
// prob
boxes.get(i).score = prob1[i][1];
// bias
for (int j = 0; j < 4; j++) {
boxes.get(i).bbr[j] = conv6_2_conv6_2[i][j];
}
// landmark
for (int j = 0; j < 5; j++) {
int x = Math.round(boxes.get(i).left() + (conv6_3_conv6_3[i][j] * boxes.get(i).width()));
int y = Math.round(boxes.get(i).top() + (conv6_3_conv6_3[i][j + 5] * boxes.get(i).height()));
boxes.get(i).landmark[j] = new Point(x, y);
}
}
}
/**
* Delete the box marked with delete
* @param boxes
* @return
*/
public static Vector<Box> updateBoxes(Vector<Box> boxes) {
Vector<Box> b = new Vector<>();
for (int i = 0; i < boxes.size(); i++) {
if (!boxes.get(i).deleted) {
b.addElement(boxes.get(i));
}
}
return b;
}
}
|
[
"[email protected]"
] | |
1fdfea2af385e08038f58b2c09ec20347f2ae7f1
|
06eb9eacb7cdd5973bb62708c4c1a31835b95a21
|
/Change.java
|
59f876dcc0713dfa715e0d222bbf312a6a95a217
|
[] |
no_license
|
NadinkaRomanchenko/hw5
|
0b98cb932ca8919a2be7ecf5f595a175d2ce4b7b
|
8d16c01810c5e0de2ba2951869c11da8cbd71b1a
|
refs/heads/master
| 2022-11-21T20:15:19.809694 | 2020-07-19T12:59:13 | 2020-07-19T12:59:13 | 280,841,423 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,077 |
java
|
package com.itacademy.hw5;
/**
* 2. Написать программу, удаляющую все повторяющиеся целые
* числа из массива и печатающую результат. Массив должен
* использоваться тот же самый. На место удаленных элементов
* ставить цифру 0.
*/
public class Change {
public static void main(String[] args) {
int[] values = {3, 5, 7, 3, 8, 7, 5, 4};
print(values);
change(values);
print(values);
}
public static void print(int[] values) {
for (int i = 0; i < values.length; i++) {
System.out.print(values[i] + " ");
}
System.out.println();
}
public static void change(int[] values) {
for (int i = 1; i < values.length; i++) {
for (int j = 0; j < i; j++) {
if (values[i] == values[j]) {
values[i] = 0;
}
}
}
}
}
|
[
"[email protected]"
] | |
c0d05407fb14bd4c9a5ff72b53f1f8983b20e69e
|
0daa9f6f3b22224a02bb8e755bf62aedeb86f067
|
/app/src/main/java/com/fanikiosoftware/mynews/controllers/network/Post.java
|
b8e8d2be1b5ee71b2480be2e63544782ba7c981f
|
[] |
no_license
|
gelita/MyNews
|
a62095d48577bd99aba3c4fe30aa8da7d5988df2
|
16a3e635f534288d8ec9264177d82264d64eff30
|
refs/heads/master
| 2020-05-18T21:28:04.395794 | 2020-01-06T23:39:22 | 2020-01-06T23:39:22 | 184,663,572 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 835 |
java
|
package com.fanikiosoftware.mynews.controllers.network;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class Post {
// from "results" on API call
private String section;
private String subsection;
private String title;
private String url;
@SerializedName("created_date")
private String date;
@SerializedName("multimedia")
private List<Multimedia> multimediaList;
public String getSection() {
return section;
}
public String getSubsection() {
return subsection;
}
public List<Multimedia> getMultimediaList() {
return multimediaList;
}
public String getTitle() {
return title;
}
public String getDate() {
return date;
}
public String getUrl() {
return url;
}
}
|
[
"[email protected]"
] | |
4ec201a4579863a3ec718a88a0b9a00d91739c38
|
fdb86f040cee803034d8e0c84d4aa0b262bfb962
|
/src/com/nsu/MyChatRoom/UI/RegisterFrame.java
|
431ebd5ea56153e7f7652b29c36b82c9f6eee65c
|
[] |
no_license
|
xuing/MyChatRoom
|
67f7bdd2e2b4dce5095466dd6bd83bb3728b752c
|
cb325bcb6fddf039ef54da215fe9c5b755f21748
|
refs/heads/master
| 2020-03-09T16:34:35.294683 | 2018-04-10T07:18:36 | 2018-04-10T07:18:36 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,883 |
java
|
package com.nsu.MyChatRoom.UI;
import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.xml.crypto.dsig.keyinfo.RetrievalMethod;
import javax.xml.transform.Templates;
import com.mysql.jdbc.StatementInterceptor;
import com.nsu.MyChatRoom.Service.AccountService;
import com.nsu.MyChatRoom.Util.FrameUtil;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.awt.event.ActionEvent;
import javax.swing.JPasswordField;
public class RegisterFrame extends JFrame {
private JTextField userNameText;
private String userName,Password,imgPath = "img/temp_1.jpg";
private JPasswordField PasswordText;
private static int imgNumber = 0;
private String avaPath;
public RegisterFrame() {
getContentPane().setLayout(null);
userNameText = new JTextField();
userNameText.setBounds(102, 71, 86, 24);
getContentPane().add(userNameText);
JLabel lblUserName = new JLabel("\u7528\u6237\u540D");
lblUserName.setBounds(44, 73, 72, 18);
getContentPane().add(lblUserName);
JLabel label = new JLabel("\u5BC6\u7801");
label.setBounds(44, 132, 72, 18);
getContentPane().add(label);
JLabel label_2 = new JLabel("\u6CE8\u518C");
label_2.setFont(new Font("SimSun", Font.PLAIN, 33));
label_2.setBounds(65, 10, 123, 51);
getContentPane().add(label_2);
JButton button = new JButton("\u6CE8\u518C");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if(checkInput()){
AccountService.addAccount(userName,Password,avaPath);
FrameUtil.showInfoMessage("注册成功~~");
LoginFrame loginFrame = new LoginFrame(userName,Password);
loginFrame.setVisible(true);
dispose();
}
}
});
button.setBounds(65, 186, 113, 27);
getContentPane().add(button);
try {
ImageIcon img = new ImageIcon("img/reg.jpg");
JLabel avatar = new JLabel(img);
avatar.setBounds(219, 56, 180, 180);
avatar.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
JFileChooser chooser = new JFileChooser();
FileNameExtensionFilter filter = new FileNameExtensionFilter(
"JPG & GIF Images", "jpg", "gif");
chooser.setFileFilter(filter);
int returnVal = chooser.showOpenDialog(null);
if(returnVal == JFileChooser.APPROVE_OPTION) {
try {
imgPath = chooser.getSelectedFile().getAbsolutePath();
avaPath = FrameUtil.listImgToAvatar(imgPath);
// System.out.println("You chose to open this file: " + imaPath);
String temp = FrameUtil.regImaToAvatar(imgPath, imgNumber++);
System.out.println(temp);
avatar.setIcon(new ImageIcon(temp));
} catch (Exception e1) {
e1.printStackTrace();
}
}
}
});
getContentPane().add(avatar);
JLabel label_1 = new JLabel("\u5934\u50CF(\u70B9\u51FB\u4E0A\u4F20)");
label_1.setBounds(282, 35, 97, 15);
getContentPane().add(label_1);
PasswordText = new JPasswordField();
PasswordText.setBounds(102, 131, 86, 21);
getContentPane().add(PasswordText);
} catch (Exception e1) {
e1.printStackTrace();
}
//
//
// getContentPane().add(background);
}
public static boolean rexCheckNickName(String nickName) {
// 昵称格式:限16个字符,支持中英文、数字、减号或下划线
String regStr = "^[\\u4e00-\\u9fa5_a-zA-Z0-9-]{1,16}$";
return nickName.matches(regStr);
}
public static boolean rexCheckPassword(String input) {
// 6-20 位,字母、数字、字符
//String reg = "^([A-Z]|[a-z]|[0-9]|[`-=[];,./~!@#$%^*()_+}{:?]){6,20}$";
String regStr = "^([A-Z]|[a-z]|[0-9]|[`~!@#$%^&*()+=|{}':;',\\\\[\\\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]){6,20}$";
return input.matches(regStr);
}
protected boolean checkInput() {
userName = userNameText.getText();
Password = String.valueOf(PasswordText.getPassword());
if (rexCheckNickName(userName) && rexCheckPassword(Password)) {
return true;
} else {
FrameUtil.showErrorMessage("输入有误");
return false;
}
}
}
|
[
"[email protected]"
] | |
36dd3cbe790bbba0f704a66a108f0a7b8c5629cf
|
63d319fbd88e49701d8dcc2919c8f3a6013e90d0
|
/Applications/CIM/plugins/es.tid.cim/src/es/tid/cim/EnumEncryptionMethod.java
|
de20701cf86afffdd5bb9129529cece7ac4db361
|
[] |
no_license
|
DevBoost/Reuseware
|
2e6b3626c0d434bb435fcf688e3a3c570714d980
|
4c2f0170df52f110c77ee8cffd2705af69b66506
|
refs/heads/master
| 2021-01-19T21:28:13.184309 | 2019-06-09T20:39:41 | 2019-06-09T20:48:34 | 5,324,741 | 1 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,653 |
java
|
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package es.tid.cim;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.eclipse.emf.common.util.Enumerator;
/**
* <!-- begin-user-doc -->
* A representation of the literals of the enumeration '<em><b>Enum Encryption Method</b></em>',
* and utility methods for working with them.
* <!-- end-user-doc -->
* @see es.tid.cim.CimPackage#getEnumEncryptionMethod()
* @model
* @generated
*/
public enum EnumEncryptionMethod implements Enumerator {
/**
* The '<em><b>Other</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #OTHER_VALUE
* @generated
* @ordered
*/
OTHER(1, "Other", "Other"),
/**
* The '<em><b>WEP</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #WEP_VALUE
* @generated
* @ordered
*/
WEP(2, "WEP", "WEP"),
/**
* The '<em><b>TKIP</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #TKIP_VALUE
* @generated
* @ordered
*/
TKIP(3, "TKIP", "TKIP"),
/**
* The '<em><b>CCMP</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #CCMP_VALUE
* @generated
* @ordered
*/
CCMP(4, "CCMP", "CCMP"),
/**
* The '<em><b>None</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #NONE_VALUE
* @generated
* @ordered
*/
NONE(5, "None", "None");
/**
* The '<em><b>Other</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Other</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #OTHER
* @model name="Other"
* @generated
* @ordered
*/
public static final int OTHER_VALUE = 1;
/**
* The '<em><b>WEP</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>WEP</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #WEP
* @model
* @generated
* @ordered
*/
public static final int WEP_VALUE = 2;
/**
* The '<em><b>TKIP</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>TKIP</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #TKIP
* @model
* @generated
* @ordered
*/
public static final int TKIP_VALUE = 3;
/**
* The '<em><b>CCMP</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>CCMP</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #CCMP
* @model
* @generated
* @ordered
*/
public static final int CCMP_VALUE = 4;
/**
* The '<em><b>None</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>None</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #NONE
* @model name="None"
* @generated
* @ordered
*/
public static final int NONE_VALUE = 5;
/**
* An array of all the '<em><b>Enum Encryption Method</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static final EnumEncryptionMethod[] VALUES_ARRAY =
new EnumEncryptionMethod[] {
OTHER,
WEP,
TKIP,
CCMP,
NONE,
};
/**
* A public read-only list of all the '<em><b>Enum Encryption Method</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final List<EnumEncryptionMethod> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
/**
* Returns the '<em><b>Enum Encryption Method</b></em>' literal with the specified literal value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static EnumEncryptionMethod get(String literal) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
EnumEncryptionMethod result = VALUES_ARRAY[i];
if (result.toString().equals(literal)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Enum Encryption Method</b></em>' literal with the specified name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static EnumEncryptionMethod getByName(String name) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
EnumEncryptionMethod result = VALUES_ARRAY[i];
if (result.getName().equals(name)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Enum Encryption Method</b></em>' literal with the specified integer value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static EnumEncryptionMethod get(int value) {
switch (value) {
case OTHER_VALUE: return OTHER;
case WEP_VALUE: return WEP;
case TKIP_VALUE: return TKIP;
case CCMP_VALUE: return CCMP;
case NONE_VALUE: return NONE;
}
return null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private final int value;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private final String name;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private final String literal;
/**
* Only this class can construct instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EnumEncryptionMethod(int value, String name, String literal) {
this.value = value;
this.name = name;
this.literal = literal;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getValue() {
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getLiteral() {
return literal;
}
/**
* Returns the literal value of the enumerator, which is its string representation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
return literal;
}
} //EnumEncryptionMethod
|
[
"[email protected]"
] | |
08d8acebe13b7683f6d86abaa473a783ccef4cd8
|
fa88011737383354ee922285179b657fd0652ae6
|
/src/main/java/com/dxfLearn/swing/TestGUI.java
|
cb1bbfa2537099000acb843cb42454059b50c247
|
[] |
no_license
|
dxiufeng/nettyLearning
|
1a9d5a05a69007ff92a45d0a2f691e5455eb3a56
|
7d711836b54d179251a1481b69bdc6d1eb9311c2
|
refs/heads/master
| 2022-12-21T07:40:16.665652 | 2019-11-06T02:24:30 | 2019-11-06T02:24:46 | 215,673,571 | 0 | 0 | null | 2022-12-16T04:59:56 | 2019-10-17T01:03:33 |
Java
|
UTF-8
|
Java
| false | false | 2,883 |
java
|
package com.dxfLearn.swing;
import javax.swing.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.Random;
public class TestGUI {
public static void main(String[] args) {
//region 测试
/*
JFrame f = new JFrame("LoL");
f.setSize(400, 300);
f.setLocation(580, 200);
f.setLayout(null);
final JLabel l = new JLabel();
ImageIcon i = new ImageIcon("C:\\Users\\lilij667\\Desktop\\git\\NIODemo\\src\\main\\java\\com\\dxfLearn\\swing\\pic\\shana.png");
l.setIcon(i);
l.setBounds(50, 50, i.getIconWidth(), i.getIconHeight());
JButton b = new JButton("隐藏图片");
b.setBounds(150, 200, 100, 30);
// 给按钮 增加 监听
b.addActionListener(new ActionListener() {
// 当按钮被点击时,就会触发 ActionEvent事件
// actionPerformed 方法就会被执行
public void actionPerformed(ActionEvent e) {
l.setVisible(false);
}
});
f.add(l);
f.add(b);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
*/
//endregion
new TestGUI().getFrame();
}
public JFrame createInfo(){
JFrame frame = new JFrame("LOL");
frame.setLocation(300,300);
frame.setSize(300,300);
frame.setLayout(null);
return frame;
}
public void getFrame(){
JFrame frame = createInfo();
runable(frame);
closed(frame);
}
public void closed(JFrame frame){
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
public void runable(JFrame frame){
final JLabel label = new JLabel();
ImageIcon i = new ImageIcon("C:\\Users\\lilij667\\Desktop\\git\\NIODemo\\src\\main\\java\\com\\dxfLearn\\swing\\pic\\shana.png");
label.setIcon(i);
label.setBounds(50, 50, i.getIconWidth(), i.getIconHeight());
frame.add(label);
label.addMouseListener(new MouseListener() {
@Override
public void mouseClicked(MouseEvent e) {
}
@Override
public void mousePressed(MouseEvent e) {
}
@Override
public void mouseReleased(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent e) {
Random random = new Random();
int x= random.nextInt(frame.getWidth() - label.getWidth());
int y =random.nextInt(frame.getHeight()-label.getHeight());
label.setLocation(x,y);
}
@Override
public void mouseExited(MouseEvent e) {
}
});
frame.add(label);
}
}
|
[
"[email protected]"
] | |
9228a762d4ad9907403434ebd3528170d6609df6
|
53b4ad284ab9dc288ba7e4a39a40eb6b9a1c2629
|
/src/main/java/io/github/zeroone3010/geogpxparser/Log.java
|
2a93ec761e4566aba50924417b8a2245e7eb2c21
|
[
"MIT"
] |
permissive
|
ZeroOne3010/GeoGpxParser
|
3fe9ce8af545163663e06f2799c7c03927922173
|
0821def940e5d32c53f65e0b271ffcced1f6d87d
|
refs/heads/master
| 2022-12-28T22:35:36.182333 | 2020-10-19T17:55:58 | 2020-10-19T17:55:58 | 280,273,924 | 0 | 1 |
MIT
| 2020-10-19T17:56:00 | 2020-07-16T22:44:22 |
Java
|
UTF-8
|
Java
| false | false | 1,710 |
java
|
package io.github.zeroone3010.geogpxparser;
import java.time.LocalDateTime;
public final class Log {
private final long id;
private final String user;
private final LocalDateTime date;
private final LogType type;
private final String text;
private Log(final long id, final String user, final LocalDateTime date, final LogType type, final String text) {
this.id = id;
this.user = user;
this.date = date;
this.type = type;
this.text = text;
}
public long getId() {
return id;
}
public String getUser() {
return user;
}
public LocalDateTime getDate() {
return date;
}
public LogType getType() {
return type;
}
public String getText() {
return text;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private long id;
private String user;
private LocalDateTime date;
private LogType type;
private String text;
public Builder id(long id) {
this.id = id;
return this;
}
public Builder user(String user) {
this.user = user;
return this;
}
public Builder date(LocalDateTime date) {
this.date = date;
return this;
}
public Builder type(LogType type) {
this.type = type;
return this;
}
public Builder text(String text) {
this.text = text;
return this;
}
public Log build() {
return new Log(id, user, date, type, text);
}
}
}
|
[
"[email protected]"
] | |
dda7326fd54137bcda661d15a11cac29e8c62ba6
|
6754357bf5bae3f3787c74c2a949496c458cf728
|
/src/main/java/com/biscuit/product/service/rest/dao/BiscuitDaoImpl.java
|
ed10e547341777f74530be2c42b014620e721eb8
|
[] |
no_license
|
nandpoot23/SpringBootProductWebService
|
fc96afc1507617fb37ae65d8bc090af83bf7d76e
|
0a61007c84df218ec64f49c9b5b55870c5a34e22
|
refs/heads/master
| 2021-01-18T03:24:35.586554 | 2017-09-10T09:48:22 | 2017-09-10T09:48:22 | 85,823,873 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,106 |
java
|
package com.biscuit.product.service.rest.dao;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.biscuit.product.service.rest.connector.BiscuitDatabaseConnector;
import com.biscuit.product.service.rest.error.BiscuitErrorCode;
import com.biscuit.product.service.rest.error.ProductFrameworkError;
import com.biscuit.product.service.rest.extractor.BiscuitConfigResultSetExtractor;
import com.biscuit.product.service.rest.extractor.BiscuitSeasonResultSetExtractor;
import com.biscuit.product.service.rest.extractor.BiscuitStockResultSetExtractor;
import com.biscuit.product.service.rest.extractor.BrandNameResultSetExtractor;
import com.biscuit.product.service.rest.types.BiscuitDetails;
import com.biscuit.product.service.rest.types.BiscuitIdentity;
import com.biscuit.product.service.rest.types.BiscuitName;
import com.biscuit.product.service.rest.types.BiscuitSeason;
import com.biscuit.product.service.rest.types.BiscuitType;
import com.biscuit.product.service.rest.types.BrandName;
import com.biscuit.product.service.rest.types.BrandStock;
import com.biscuit.product.service.rest.util.NumericHelper;
/**
* @author mlahariya
* @version 1.0, March 2017
*/
@Repository("BiscuitDaoImpl")
public class BiscuitDaoImpl implements BiscuitDao {
private static final Logger LOG = LoggerFactory
.getLogger(BiscuitDaoImpl.class);
@Autowired
private BiscuitDatabaseConnector biscuitDatabaseConnector;
@Autowired
private NumericHelper numericValidation;
public BiscuitDatabaseConnector getBiscuitDatabaseConnector() {
return biscuitDatabaseConnector;
}
public void setBiscuitDatabaseConnector(
BiscuitDatabaseConnector biscuitDatabaseConnector) {
this.biscuitDatabaseConnector = biscuitDatabaseConnector;
}
@Override
public BiscuitDetails getBiscuitDetailsById(BiscuitIdentity bisId) {
List<BiscuitDetails> biscuitDetailsList = new ArrayList<BiscuitDetails>();
try {
String query = "select * from biscuit where id = ?";
biscuitDetailsList = biscuitDatabaseConnector.getJdbcTemplate()
.query(query, new Object[] { bisId.getBiscuitId() },
new BiscuitConfigResultSetExtractor());
LOG.debug(" Query for getBiscuitDetailsById : " + query);
} catch (Exception e) {
e.printStackTrace();
LOG.error("Exception while getting biscuit configurations ", e);
throw new ProductFrameworkError(
BiscuitErrorCode.BD_51555.getValue());
}
if (CollectionUtils.isEmpty(biscuitDetailsList)) {
throw new ProductFrameworkError(
BiscuitErrorCode.BD_51556.getValue());
}
return biscuitDetailsList.get(0);
}
@Override
public List<BrandName> getBiscuitByBrandType(BiscuitName bisName) {
List<BrandName> brandNameList = new ArrayList<BrandName>();
try {
String query = "select BiscuitType, BiscuitBrand from biscuit where BiscuitName = ?";
brandNameList = biscuitDatabaseConnector.getJdbcTemplate().query(
query, new Object[] { bisName.getBiscuitName() },
new BrandNameResultSetExtractor());
LOG.debug(" Query for getBiscuitByBrandType : " + query);
} catch (Exception e) {
e.printStackTrace();
LOG.error("Exception while getting biscuit brand ", e);
throw new ProductFrameworkError(
BiscuitErrorCode.BD_51558.getValue());
}
if (CollectionUtils.isEmpty(brandNameList)) {
throw new ProductFrameworkError(
BiscuitErrorCode.BD_51559.getValue());
}
return brandNameList;
}
@Override
public BrandStock getBiscuitByStock(BiscuitIdentity bisId) {
List<BrandStock> brandStockList = new ArrayList<BrandStock>();
try {
String query = "select BiscuitStock, BiscuitBrand from biscuit where id = ?";
brandStockList = biscuitDatabaseConnector.getJdbcTemplate().query(
query, new Object[] { bisId.getBiscuitId() },
new BiscuitStockResultSetExtractor());
LOG.debug(" Query for getBiscuitByStock : " + query);
} catch (Exception e) {
e.printStackTrace();
LOG.error("Exception while getting biscuit configurations ", e);
throw new ProductFrameworkError(
BiscuitErrorCode.BD_51560.getValue());
}
if (CollectionUtils.isEmpty(brandStockList)) {
throw new ProductFrameworkError(
BiscuitErrorCode.BD_51561.getValue());
}
return brandStockList.get(0);
}
@Override
public List<BiscuitType> getAllBrandBiscuitTypeBySeason(BiscuitSeason season) {
List<BiscuitType> biscuitTypeList = new ArrayList<BiscuitType>();
try {
String query = "select BiscuitName, BiscuitType from biscuit where BiscuitBrand = ?";
biscuitTypeList = biscuitDatabaseConnector.getJdbcTemplate().query(
query, new Object[] { season.getSeason() },
new BiscuitSeasonResultSetExtractor());
LOG.debug(" Query for getAllBrandBiscuitTypeBySeason : " + query);
} catch (Exception e) {
e.printStackTrace();
LOG.error("Exception while getting biscuit season ", e);
throw new ProductFrameworkError(
BiscuitErrorCode.BD_51563.getValue());
}
if (CollectionUtils.isEmpty(biscuitTypeList)) {
throw new ProductFrameworkError(
BiscuitErrorCode.BD_51564.getValue());
}
return biscuitTypeList;
}
@Override
public List<BiscuitType> getAllBrandEverGreenBiscuit(BiscuitName bisName) {
List<BiscuitType> biscuitTypeList = new ArrayList<BiscuitType>();
List<String> args = new ArrayList<String>();
args.add(bisName.getBiscuitName());
try {
String query = "select BiscuitName, BiscuitType from biscuit where BiscuitName = ?";
biscuitTypeList = biscuitDatabaseConnector.getJdbcTemplate().query(
query, args.toArray(),
new BiscuitSeasonResultSetExtractor());
LOG.debug(" Query for getAllBrandEverGreenBiscuit : " + query);
} catch (Exception e) {
e.printStackTrace();
LOG.error("Exception while getting biscuit season ", e);
throw new ProductFrameworkError(
BiscuitErrorCode.BD_51566.getValue());
}
if (biscuitTypeList.isEmpty()) {
throw new ProductFrameworkError(
BiscuitErrorCode.BD_51567.getValue());
}
return biscuitTypeList;
}
@Override
public String insertNewBrandBiscuit(BiscuitDetails biscuitDetails) {
try {
String query = "insert into biscuit(ID, BiscuitName, BiscuitType, BiscuitStock, BiscuitBrand) "
+ "values(?, ?, ?, ?, ?)";
int rowInserted = biscuitDatabaseConnector.getJdbcTemplate()
.update(query,
new Object[] { biscuitDetails.getBiscuitId(),
biscuitDetails.getBiscuitName(),
biscuitDetails.getBiscuitType(),
biscuitDetails.getBiscuitStock(),
biscuitDetails.getBiscuitBrandName() });
LOG.debug(" Query for insertNewBrandBiscuit : " + query);
if (rowInserted == 1) {
return "record inserted.";
}
} catch (Exception e) {
e.printStackTrace();
throw new ProductFrameworkError(
BiscuitErrorCode.BD_51571.getValue());
}
throw new ProductFrameworkError(BiscuitErrorCode.BD_51572.getValue());
}
}
|
[
"[email protected]"
] | |
f2fa72aa32aa30f1f4428432d98444e6cfd08452
|
4e9c06ff59fe91f0f69cb3dd80a128f466885aea
|
/src/o/ˢ.java
|
88d3a85aadcd34daee9753deb81a2cf12ccd67df
|
[] |
no_license
|
reverseengineeringer/com.eclipsim.gpsstatus2
|
5ab9959cc3280d2dc96f2247c1263d14c893fc93
|
800552a53c11742c6889836a25b688d43ae68c2e
|
refs/heads/master
| 2021-01-17T07:26:14.357187 | 2016-07-21T03:33:07 | 2016-07-21T03:33:07 | 63,834,134 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 587 |
java
|
package o;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver.OnPreDrawListener;
final class ˢ
implements ViewTreeObserver.OnPreDrawListener
{
ˢ(ʸ paramʸ, ViewGroup paramViewGroup, ʸ.ˊ paramˊ, int paramInt, Object paramObject) {}
public final boolean onPreDraw()
{
ᓸ.getViewTreeObserver().removeOnPreDrawListener(this);
ʸ.ˊ(ᓷ, ᓽ, ᔄ, ᔨ);
return true;
}
}
/* Location:
* Qualified Name: o.ˢ
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"[email protected]"
] | |
d431ecf3b0b066f07b5ddadd7adeeea4ac51e455
|
b31d179f0e6b9ab77525428e246b1dc0b77494b8
|
/payment-service/src/test/java/dev/lucasdeabreu/paymentservice/PaymentServiceApplicationTests.java
|
ebaa1eef207f3e380d25f41b7b77defb87a60d77
|
[] |
no_license
|
rahulsrivastava243/saga-pattern-example
|
a46ba40cda1fdfe5c94517d8ae2ef3d09bdac343
|
739dcc6e78e6daa6e582bf995168489a5a4a9b69
|
refs/heads/master
| 2022-02-16T05:41:52.592685 | 2019-06-23T23:02:51 | 2019-06-23T23:02:51 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 365 |
java
|
package dev.lucasdeabreu.paymentservice;
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 PaymentServiceApplicationTests {
@Test
public void contextLoads() {
}
}
|
[
"[email protected]"
] | |
aa27b5509c8f662cdb860bb48f6f600ab847e39f
|
4aa90348abcb2119011728dc067afd501f275374
|
/app/src/main/java/com/tencent/mm/plugin/appbrand/jsapi/f/c.java
|
be5a7f56ce6cf2fbec58c4fc3fdb06b0c2ca49b1
|
[] |
no_license
|
jambestwick/HackWechat
|
0d4ceb2d79ccddb45004ca667e9a6a984a80f0f6
|
6a34899c8bfd50d19e5a5ec36a58218598172a6b
|
refs/heads/master
| 2022-01-27T12:48:43.446804 | 2021-12-29T10:36:30 | 2021-12-29T10:36:30 | 249,366,791 | 0 | 0 | null | 2020-03-23T07:48:32 | 2020-03-23T07:48:32 | null |
UTF-8
|
Java
| false | false | 3,963 |
java
|
package com.tencent.mm.plugin.appbrand.jsapi.f;
import com.samsung.android.sdk.look.smartclip.SlookSmartClipMetaTag;
import com.tencent.mm.plugin.appbrand.config.AppBrandSysConfig;
import com.tencent.mm.plugin.appbrand.config.a;
import com.tencent.mm.plugin.appbrand.j;
import com.tencent.mm.plugin.appbrand.j.e;
import com.tencent.mm.plugin.appbrand.j.i;
import com.tencent.mm.plugin.appbrand.jsapi.f;
import com.tencent.mm.plugin.appbrand.page.p;
import com.tencent.mm.sdk.platformtools.bh;
import com.tencent.mm.sdk.platformtools.x;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONObject;
public class c extends a {
public static final int CTRL_INDEX = 242;
public static final String NAME = "createRequestTask";
protected final String agB() {
StringBuilder stringBuilder = new StringBuilder();
e.aiA();
return stringBuilder.append(e.aiw()).toString();
}
protected final String agC() {
return "requestTaskId";
}
public final void a(j jVar, JSONObject jSONObject, String str) {
x.d("MicroMsg.JsApiCreateRequestTask", "JsApiCreateRequestTask");
1 1 = new 1(this, System.currentTimeMillis(), jVar, str);
String optString = jSONObject.optString(SlookSmartClipMetaTag.TAG_TYPE_URL);
if (bh.ov(optString)) {
x.e("MicroMsg.JsApiCreateRequestTask", "url is null");
a(jVar, str, "url is null or nil");
return;
}
AppBrandSysConfig appBrandSysConfig = jVar.irP.iqx;
a aVar = jVar.irP.iqy;
int optInt = jSONObject.optInt("timeout", 0);
if (optInt <= 0) {
optInt = i.a(appBrandSysConfig, aVar, 0);
}
if (optInt <= 0) {
optInt = 60000;
}
if (appBrandSysConfig.iOq <= 0) {
x.i("MicroMsg.JsApiCreateRequestTask", "maxRequestConcurrent <= 0 use default concurrent");
}
Map a = i.a(jSONObject, appBrandSysConfig);
boolean a2 = i.a(appBrandSysConfig, jSONObject.optBoolean("__skipDomainCheck__", false));
if (!a2 || i.a(appBrandSysConfig.iOA, optString)) {
com.tencent.mm.plugin.appbrand.j.c cVar;
if (e.aiA().tt(jVar.mAppId) == null) {
p b = b(jVar);
String str2 = null;
if (!(b == null || b.jDS == null)) {
str2 = b.jDS.jFe;
}
com.tencent.mm.plugin.appbrand.j.c cVar2 = new com.tencent.mm.plugin.appbrand.j.c(jVar.mAppId, str2, jVar.irP.iqx);
e aiA = e.aiA();
String str3 = jVar.mAppId;
if (!aiA.jhY.containsKey(str3)) {
aiA.jhY.put(str3, cVar2);
}
cVar = cVar2;
} else {
cVar = e.aiA().tt(jVar.mAppId);
}
x.i("MicroMsg.JsApiCreateRequestTask", "request url: %s", new Object[]{optString});
if (cVar == null) {
a(jVar, str, "create request error");
return;
} else if (a2) {
cVar.a(jVar, this, optInt, jSONObject, a, appBrandSysConfig.iOA, 1, str, NAME);
return;
} else {
x.i("MicroMsg.JsApiCreateRequestTask", "debug type, do not verify domains");
cVar.a(jVar, this, optInt, jSONObject, a, null, 1, str, NAME);
return;
}
}
x.i("MicroMsg.JsApiCreateRequestTask", "not in domain url %s", new Object[]{optString});
a(jVar, str, "url not in domain list");
}
private static void a(j jVar, String str, String str2) {
Map hashMap = new HashMap();
hashMap.put("requestTaskId", str);
hashMap.put("state", "fail");
hashMap.put("errMsg", str2);
String jSONObject = new JSONObject(hashMap).toString();
f a = new a().a(jVar);
a.mData = jSONObject;
a.afs();
}
}
|
[
"[email protected]"
] | |
721fcd48d5c3f166fdb3c2fcc12b19a84311305a
|
a155aaa76660171d4ff7067c2aadd06b40d3e85c
|
/app/src/main/java/com/kennethiankerr/lvlightremote/util/SystemUiHider.java
|
b538b1976cdc0350d11774a5843774c76c95e70f
|
[] |
no_license
|
kenkerr/lvLights-Android
|
e34ac7733817baeeb7b429315453ab53d844a966
|
ed488c3ff30e66602287303eadb52501ce956d3c
|
refs/heads/master
| 2021-01-19T14:17:33.867104 | 2017-09-10T23:02:18 | 2017-09-10T23:02:18 | 100,894,474 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,858 |
java
|
package com.kennethiankerr.lvlightremote.util;
import android.app.Activity;
import android.os.Build;
import android.view.View;
/**
* A utility class that helps with showing and hiding system UI such as the
* status bar and navigation/system bar. This class uses backward-compatibility
* techniques described in <a href=
* "http://developer.android.com/training/backward-compatible-ui/index.html">
* Creating Backward-Compatible UIs</a> to ensure that devices running any
* version of ndroid OS are supported. More specifically, there are separate
* implementations of this abstract class: for newer devices,
* {@link #getInstance} will return a {@link SystemUiHiderHoneycomb} instance,
* while on older devices {@link #getInstance} will return a
* {@link SystemUiHiderBase} instance.
* <p/>
* For more on system bars, see <a href=
* "http://developer.android.com/design/get-started/ui-overview.html#system-bars"
* > System Bars</a>.
*
* @see android.view.View#setSystemUiVisibility(int)
* @see android.view.WindowManager.LayoutParams#FLAG_FULLSCREEN
*/
public abstract class SystemUiHider {
/**
* When this flag is set, the
* {@link android.view.WindowManager.LayoutParams#FLAG_LAYOUT_IN_SCREEN}
* flag will be set on older devices, making the status bar "float" on top
* of the activity layout. This is most useful when there are no controls at
* the top of the activity layout.
* <p/>
* This flag isn't used on newer devices because the <a
* href="http://developer.android.com/design/patterns/actionbar.html">action
* bar</a>, the most important structural element of an Android app, should
* be visible and not obscured by the system UI.
*/
public static final int FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES = 0x1;
/**
* When this flag is set, {@link #show()} and {@link #hide()} will toggle
* the visibility of the status bar. If there is a navigation bar, show and
* hide will toggle low profile mode.
*/
public static final int FLAG_FULLSCREEN = 0x2;
/**
* When this flag is set, {@link #show()} and {@link #hide()} will toggle
* the visibility of the navigation bar, if it's present on the device and
* the device allows hiding it. In cases where the navigation bar is present
* but cannot be hidden, show and hide will toggle low profile mode.
*/
public static final int FLAG_HIDE_NAVIGATION = FLAG_FULLSCREEN | 0x4;
/**
* The activity associated with this UI hider object.
*/
protected Activity mActivity;
/**
* The view on which {@link View#setSystemUiVisibility(int)} will be called.
*/
protected View mAnchorView;
/**
* The current UI hider flags.
*
* @see #FLAG_FULLSCREEN
* @see #FLAG_HIDE_NAVIGATION
* @see #FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES
*/
protected int mFlags;
/**
* The current visibility callback.
*/
protected OnVisibilityChangeListener mOnVisibilityChangeListener = sDummyListener;
/**
* Creates and returns an instance of {@link SystemUiHider} that is
* appropriate for this device. The object will be either a
* {@link SystemUiHiderBase} or {@link SystemUiHiderHoneycomb} depending on
* the device.
*
* @param activity The activity whose window's system UI should be
* controlled by this class.
* @param anchorView The view on which
* {@link View#setSystemUiVisibility(int)} will be called.
* @param flags Either 0 or any combination of {@link #FLAG_FULLSCREEN},
* {@link #FLAG_HIDE_NAVIGATION}, and
* {@link #FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES}.
*/
public static SystemUiHider getInstance(Activity activity, View anchorView, int flags) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
return new SystemUiHiderHoneycomb(activity, anchorView, flags);
} else {
return new SystemUiHiderBase(activity, anchorView, flags);
}
}
protected SystemUiHider(Activity activity, View anchorView, int flags) {
mActivity = activity;
mAnchorView = anchorView;
mFlags = flags;
}
/**
* Sets up the system UI hider. Should be called from
* {@link Activity#onCreate}.
*/
public abstract void setup();
/**
* Returns whether or not the system UI is visible.
*/
public abstract boolean isVisible();
/**
* Hide the system UI.
*/
public abstract void hide();
/**
* Show the system UI.
*/
public abstract void show();
/**
* Toggle the visibility of the system UI.
*/
public void toggle() {
if (isVisible()) {
hide();
} else {
show();
}
}
/**
* Registers a callback, to be triggered when the system UI visibility
* changes.
*/
public void setOnVisibilityChangeListener(OnVisibilityChangeListener listener) {
if (listener == null) {
listener = sDummyListener;
}
mOnVisibilityChangeListener = listener;
}
/**
* A dummy no-op callback for use when there is no other listener set.
*/
private static OnVisibilityChangeListener sDummyListener = new OnVisibilityChangeListener() {
@Override
public void onVisibilityChange(boolean visible) {
}
};
/**
* A callback interface used to listen for system UI visibility changes.
*/
public interface OnVisibilityChangeListener {
/**
* Called when the system UI visibility has changed.
*
* @param visible True if the system UI is visible.
*/
public void onVisibilityChange(boolean visible);
}
}
|
[
"[email protected]"
] | |
28a101331156a2a6c5e44be5463233f243b0d16b
|
3a3acf02e6ac75c15afa4feae00ba20553bb72a1
|
/iot-mqtt/src/main/java/com/example/iotmqtt/util/TreeUtil.java
|
db4f2b87f50e17fb545e81aecc29b8a41736ff94
|
[] |
no_license
|
hnyzlsw645/person
|
9e4be23290d4dcc74d8b3a8c60eff9b3bd2a2a59
|
b8f5217f95d8fc9678dfebf262b1fdf4ee6a5d85
|
refs/heads/master
| 2022-12-05T20:28:19.417832 | 2020-08-23T17:17:21 | 2020-08-23T17:17:21 | 289,731,747 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,252 |
java
|
package com.example.iotmqtt.util;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import java.util.Collection;
import java.util.List;
public class TreeUtil {
private TreeUtil(){}
private static volatile TreeUtil treeUtil;
public static TreeUtil getInstance(){
if (treeUtil == null){
synchronized (TreeUtil.class){
if (treeUtil == null){
treeUtil = new TreeUtil();
}
}
}
return treeUtil;
}
//2万条数据封装耗时15ms
public Collection<? extends Tree> getCompleteTrees(List<? extends Tree> treeList) {
//获取数据
// List<MyTree> treeList = initList();
//树节点封装
Multimap<Long, Tree> multimap = treeNodePackageByParentId(treeList);
//获取根节点
Collection<Tree> rootNodeList = multimap.get(0L);
//添加子节点
addTreeNodeDependency(rootNodeList, multimap);
return rootNodeList;
}
//按parentId聚合
private Multimap<Long, Tree> treeNodePackageByParentId(List<? extends Tree> treeList) {
Multimap<Long, Tree> multimap = HashMultimap.create();
for (Tree treeNode : treeList) {
multimap.put(treeNode.getParentId(), treeNode);
}
return multimap;
}
//添加依赖关系
private void addTreeNodeDependency(Collection<? extends Tree> rootTreeList, Multimap<Long, Tree> multiMap) {
for (Tree parentTreeNode : rootTreeList) {
addChildNode(parentTreeNode, multiMap);
}
}
private void addChildNode(Tree parentTreeNode, Multimap<Long, Tree> multiMap) {
Long id = parentTreeNode.getId();
if (!multiMap.isEmpty()){
parentTreeNode.setChild(Lists.newArrayList());
}
for (Tree chileTreeNode : multiMap.get(id)) {
Long childId = chileTreeNode.getId();
parentTreeNode.addChild(chileTreeNode);
if (multiMap.containsKey(childId)) {
addChildNode(chileTreeNode, multiMap);
}
}
}
}
|
[
"[email protected]"
] | |
eaacb8f06784102739cbbc7850c206b068e49e49
|
4dacb1ea3d77860e5a21ca5ee84654928cd9c669
|
/AddMovie/src/main/java/com/capgemini/entity/Show.java
|
9249e7ebc223432e607bff00cb48459916250b61
|
[] |
no_license
|
bajjuriteja/MicroServices
|
17fb3cbd16c789ab26fcdf5d5a7c38f014a1d167
|
cd9d6166a8826ca2c7ceb5cb80400d295aed6ea9
|
refs/heads/master
| 2022-07-17T01:27:54.203851 | 2020-05-18T16:29:58 | 2020-05-18T16:29:58 | 264,989,743 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,137 |
java
|
package com.capgemini.entity;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import com.fasterxml.jackson.annotation.JsonBackReference;
@Entity
public class Show {
@Id
private int shid;
public Screen getScreen() {
return screen;
}
public void setScreen(Screen screen) {
this.screen = screen;
}
@Override
public String toString() {
return "Show [shid=" + shid + ", stime=" + stime + ", etime=" + etime + ", shoname=" + shoname + ", screen="
+ screen + "]";
}
private int stime;
private int etime;
private String shoname;
@ManyToOne
@JsonBackReference
private Screen screen;
public int getShid() {
return shid;
}
public void setShid(int shid) {
this.shid = shid;
}
public int getStime() {
return stime;
}
public void setStime(int stime) {
this.stime = stime;
}
public int getEtime() {
return etime;
}
public void setEtime(int etime) {
this.etime = etime;
}
public String getShoname() {
return shoname;
}
public void setShoname(String shoname) {
this.shoname = shoname;
}
}
|
[
"bajjuriteja"
] |
bajjuriteja
|
0a7969c6925bc980cde2396fd32ea08d8845e085
|
3f534580b26c17e5719b22030bbe8557c4c3e754
|
/src/main/java/com/example/exercise3/model/GameStatus.java
|
50876c602fa235812f4e6e91557eca4323704006
|
[] |
no_license
|
zuzannaborowczyk/UserProfileandRanking
|
d41c9c43d9209a5dd94776531cf9b25365e47486
|
ac5d6243c9399a4931853e60c5dbcfe64e47e04e
|
refs/heads/master
| 2020-03-24T04:45:55.532131 | 2018-08-02T14:53:45 | 2018-08-02T14:53:45 | 142,464,103 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 97 |
java
|
package com.example.exercise3.model;
public enum GameStatus {
INACTIVE,
ACTIVE,
ENDED;
}
|
[
"[email protected]"
] | |
8a23403fc7b87c2684cb46b47adca0dca3fa0040
|
ae0164480bb18dbc5f32fc9059c999b9b314c749
|
/src/fiveKYU/designpaterns/builder/cars/CarType.java
|
2b7eaa96987cbc7dfb77fe0db52415b91ea3f1e8
|
[] |
no_license
|
migdalmateusz/KataExercise
|
83b55729ca497a8d3092fbe3eb8fc8cf488d21f5
|
cd38f64de4b15e00921c6208cc416f41d559ca2f
|
refs/heads/main
| 2023-04-13T06:11:27.572863 | 2021-04-26T20:54:55 | 2021-04-26T20:54:55 | 360,839,544 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 99 |
java
|
package fiveKYU.designpaterns.builder.cars;
public enum CarType {
CITY_CAR, SPORTS_CAR, SUV
}
|
[
"[email protected]"
] | |
1ae3c16c9f08aef51bef6a1d7a8feac0392137ed
|
6331263e60c9a20f0d7accacc9b4c73c0bbb5a77
|
/Ford/src/main/java/ru/kpfu/itis/group605/DrozdovAn/servlets/ProfileServlet.java
|
e11371e399f472cd357278e0632e64079ec1f087
|
[] |
no_license
|
Tynx11/Semestr
|
f80f9e8fb55e0fdbd37aed6edf3933295f7b5b46
|
c17e3c293fef98d4c5dae2871b9a11db23b06644
|
refs/heads/master
| 2021-08-29T12:21:29.950701 | 2017-12-14T00:15:47 | 2017-12-14T00:15:47 | 112,220,295 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,429 |
java
|
package ru.kpfu.itis.group605.DrozdovAn.servlets;
import ru.kpfu.itis.group605.DrozdovAn.dao.UserDao;
import ru.kpfu.itis.group605.DrozdovAn.entites.User;
import ru.kpfu.itis.group605.DrozdovAn.helpers.Helper;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class ProfileServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
UserDao x = new UserDao();
User user = (User) request.getSession().getAttribute("current_user");
user = x.findUser(user.getLogin());
request.getSession().setAttribute("current_user",user);
Map<String, Object> root = new HashMap<>();
root.put("login",user.getLogin());
root.put("name",user.getName());
root.put("email",user.getEmail());
root.put("town",user.getTown());
root.put("about",user.getAbout());
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
Helper.render(request,response,"profile.ftl",(HashMap) root);
}
}
|
[
"[email protected]"
] | |
a58fcedcef1b055579ca1501f11faa02cc1ff7c9
|
d57e50d89d3dbda00cb4d468be776dfc3a566269
|
/Oef_MarliesGeerts/Les2/Betaalbaar.java
|
bcfff8c5925ad358d5a5ae787a40d2d6f7c0d90c
|
[] |
no_license
|
ksoontjens/11_Marlies_Geerts_Willem_Gillis
|
eda8eab4d728bd6f07245a7e1a26702d47ed61df
|
7477132cdc44ba117ac2f1ddb86e6c940ea4e6ec
|
refs/heads/master
| 2016-09-15T05:49:05.415098 | 2016-05-21T19:47:01 | 2016-05-21T19:47:01 | 53,139,632 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 63 |
java
|
public interface Betaalbaar {
public abstract void betaal();
}
|
[
"[email protected]"
] | |
eb974c927b12bb7be7b6fae0afc13738ab7bc0c8
|
e816ba0a6d382ed219fcf0db4b143fc39e0aa088
|
/src/com/aotain/ods/PostMapper.java
|
9050a419bccd50ffd34f056898addd93438210d5
|
[] |
no_license
|
chennqqi/Hades
|
a76725e6792bbe9e885224365c5e538fc5ae32c8
|
0241a211e0308e52c9d9cb43441d614309367bc2
|
refs/heads/master
| 2021-01-15T21:30:50.301204 | 2017-08-02T08:53:26 | 2017-08-02T08:53:26 | 99,872,252 | 0 | 2 | null | 2017-08-10T02:28:03 | 2017-08-10T02:28:03 | null |
GB18030
|
Java
| false | false | 1,536 |
java
|
package com.aotain.ods;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
public class PostMapper extends Mapper<LongWritable,Text,Text,Text>{
@Override
public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException{
String kvsplit = context.getConfiguration().get("kvsplit");//keyvalue分隔符
String fieldsplit = context.getConfiguration().get("fieldsplit");//列属性分隔符
String column = context.getConfiguration().get("column");
String vkey="";
String[] items,tmps;
try
{
//字段处理
String[] columns = column.split("#",-1);
items = value.toString().split("\\"+fieldsplit,columns.length+1);
//列与正则
for(int i = 0;i < items.length; i++)
{
if(i==0)
{
tmps=items[i].split(kvsplit,-1);
if(tmps.length<2)
return;
}
if(i==items.length-2)
{
tmps=items[i].split(kvsplit,-1);
SimpleDateFormat dt = new SimpleDateFormat("yyyyMMddHHmmSS");
Date dStartTime = new Date(Long.parseLong(tmps[1])*1000L);
vkey+=tmps[0]+kvsplit+dt.format(dStartTime)+",";
}
else
vkey+=items[i]+",";
}
context.write(new Text(vkey),new Text(""));
}
catch(Exception e)
{;}
}
}
|
[
"[email protected]"
] | |
6221c3f4a5233ebb2ea5c530cd18d2b28127418f
|
5889bced330bfa719c24597dce7501a93fd08b2b
|
/app/src/main/java/com/stc/radio/player/LoadingActivity.java
|
188912561666be71da888d4a7ca62f41776fe2f4
|
[] |
no_license
|
ankit-trantor/Internet-Radio-Player-Android
|
230884c43016492404f1704f3789c40f2cb3c42e
|
7f697f5f85e46084f3b45cb751150231bcbfdba0
|
refs/heads/master
| 2021-01-12T01:43:24.467963 | 2016-12-28T15:42:02 | 2016-12-28T15:42:02 | 78,422,368 | 1 | 0 | null | 2017-01-09T11:22:11 | 2017-01-09T11:22:11 | null |
UTF-8
|
Java
| false | false | 3,552 |
java
|
package com.stc.radio.player;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.activeandroid.ActiveAndroid;
import com.activeandroid.query.Delete;
import com.stc.radio.player.contentmodel.ParsedPlaylistItem;
import com.stc.radio.player.contentmodel.Retro;
import com.stc.radio.player.db.Station;
import com.stc.radio.player.utils.PabloPicasso;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import rx.Observable;
import rx.Subscription;
import rx.schedulers.Schedulers;
import timber.log.Timber;
import static com.activeandroid.Cache.getContext;
public class LoadingActivity extends AppCompatActivity {
ProgressBar progressBar;
private TextView status;
ImageView imageView;
Subscription checkDbSubscription;
int counter;
private int size;
List<Station> allStations;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_loading);
progressBar = (ProgressBar) findViewById(R.id.progressDB);
status = (TextView) findViewById(R.id.textStatus);
imageView = (ImageView) findViewById(R.id.imageView);
status.setText("loading started");
Observable.just(Retro.hasValidToken()).observeOn(Schedulers.newThread()).subscribeOn(Schedulers.newThread()).subscribe(aBoolean -> {
if(!aBoolean) Timber.w("token %s",Retro.updateToken());
});
String[] playlists = {
"jazzradio",
"rockradio",
"classicalradio",
"radiotunes",
"di"
};
allStations=new ArrayList<>();
Observable.from(playlists).observeOn(Schedulers.newThread()).subscribeOn(Schedulers.computation()).delay(3000, TimeUnit.MILLISECONDS).doOnCompleted(() -> {
Timber.w("fin");
ActiveAndroid.beginTransaction();
try{
new Delete().from(Station.class).execute();
for(Station S:allStations) S.save();
ActiveAndroid.setTransactionSuccessful();
}catch (Exception er){
er.printStackTrace();
}finally {
ActiveAndroid.endTransaction();
}
/*runOnUiThread(() -> {
Station station = allStations.get(0);
assertNotNull(station);
Timber.w("art: ",station.getArtUrl());
PabloPicasso.with(getContext()).load(station.getArtUrl()).error(R.drawable.default_art).fit().into(imageView);
progressBar.setVisibility(View.GONE);
});*/
}).subscribe(this::loadPlaylistStations);
}
private void loadPlaylistStations(String pls) {
Timber.w("name=%s",pls);
Call<List<ParsedPlaylistItem>> loadSizeCall = Retro.getStationsCall(pls);
loadSizeCall.enqueue(new Callback<List<ParsedPlaylistItem>>() {
@Override
public void onResponse(Call<List<ParsedPlaylistItem>> call, Response<List<ParsedPlaylistItem>> response) {
for(ParsedPlaylistItem item: response.body()) {
Timber.w("%s",item.getKey());
Station s = new Station(item, pls,1,true);
allStations.add(s);
if(allStations.size()==50) PabloPicasso.with(getContext()).load(s.getArtUrl()).error(R.drawable.default_art).fit().into(imageView);
//progressBar.setVisibility(View.GONE);
Timber.w("station= %s", s.toString());
Timber.w("url= %s", s.getUrl());
Timber.w("ArtUrl= %s", s.getArtUrl());
}
}
@Override
public void onFailure(Call<List<ParsedPlaylistItem>> call, Throwable t) {
Timber.e("%s",t.toString());
}
});
}
}
|
[
"[email protected]"
] | |
f2e7cb77fcefc150b8eec92946777185a49dbeb6
|
0cafbda06ecb2f7ea957d7fd88b348e359fc7e70
|
/src/fileHandling/ExceptionUtil.java
|
c3d4e4e2758b00d9e78bcf54b7ac691c42a51c5c
|
[] |
no_license
|
johnarathy/JavaPractice
|
77b611129047a83791a63266c4af35abe7e56f20
|
459e6f8077b86562d56bacf7d1312ee4beb2d764
|
refs/heads/master
| 2022-11-14T18:04:13.637122 | 2020-06-20T11:08:43 | 2020-06-20T11:08:43 | 273,302,206 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 489 |
java
|
package fileHandling;
public class ExceptionUtil {
public static void main(String[] args) {
// TODO Auto-generated method stub
}
public int subtract10fromLargerNumber(int number) throws FooRuntimeException{
if(number < 10) {
throw new FooRuntimeException("Number passed was smaller than 10");
}
return number-10;
}
public class FooRuntimeException extends Exception{
public FooRuntimeException(String message) {
super(message);
}
}
}
|
[
"[email protected]"
] | |
6ed570f6f59d89a4486efbd8825376b6a6e745e7
|
c8dd1b5e2d32eb21ea9f4dead2a8d173ed784c17
|
/src/main/java/net/yozo/services/front/favorite/bean/Favorite.java
|
f8853ccff70c80b126af6daab38135c4909e3372
|
[
"Apache-2.0"
] |
permissive
|
huiminxu/First-Com
|
c059c57d1e5c3daf2f1075d3e32691bc87adedff
|
95084fb4b0bf74d1424c14c28ab7c9341a2319dc
|
refs/heads/master
| 2022-03-11T11:29:15.335934 | 2018-02-01T08:10:17 | 2018-02-01T08:10:17 | 116,234,980 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 529 |
java
|
package net.yozo.services.front.favorite.bean;
import net.yozo.services.front.template.bean.Template;
import java.io.Serializable;
public class Favorite extends net.yozo.services.common.Favorite implements Serializable {
private static final long serialVersionUID = 1L;
private Template template;
public void clear() {
super.clear();
if(template!=null){
template.clear();
}
}
public Template getTemplate() {
return template;
}
public void setTemplate(Template template) {
this.template = template;
}
}
|
[
"[email protected]"
] | |
8aaa6009efee81e1ff76519557cb17a6384e204e
|
55d5fc15f0c769d7faf341fe87a235bcb984ad95
|
/src/main/java/com/cleverdome/api/DocumentSecurityImagingSecurityLevel.java
|
919dbe2acf84c2fbca18f264f03a847caa5eee2e
|
[] |
no_license
|
objectstoragesolutions/java-client
|
074d82a2c0c5f9ec9706009abf15a18365afef44
|
356a0326441a033c1ce0d88999e77e3de5f563a1
|
refs/heads/master
| 2020-09-01T07:12:58.878320 | 2019-11-14T10:09:10 | 2019-11-14T10:09:10 | 218,905,607 | 0 | 0 | null | 2019-11-01T03:21:42 | 2019-11-01T03:21:41 | null |
UTF-8
|
Java
| false | false | 4,705 |
java
|
/**
* DocumentSecurityImagingSecurityLevel.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package com.cleverdome.api;
public class DocumentSecurityImagingSecurityLevel implements java.io.Serializable {
private java.lang.String _value_;
private static java.util.HashMap _table_ = new java.util.HashMap();
// Constructor
protected DocumentSecurityImagingSecurityLevel(java.lang.String value) {
_value_ = value;
_table_.put(_value_,this);
}
public static final java.lang.String _None = "None";
public static final java.lang.String _View = "View";
public static final java.lang.String _Modify = "Modify";
public static final java.lang.String _AddRevision = "AddRevision";
public static final java.lang.String _Delete = "Delete";
public static final java.lang.String _Owner = "Owner";
public static final java.lang.String _OSJReview = "OSJReview";
public static final java.lang.String _QualityReview = "QualityReview";
public static final java.lang.String _BOProcessing = "BOProcessing";
public static final java.lang.String _Compliance = "Compliance";
public static final java.lang.String _Admin = "Admin";
public static final DocumentSecurityImagingSecurityLevel None = new DocumentSecurityImagingSecurityLevel(_None);
public static final DocumentSecurityImagingSecurityLevel View = new DocumentSecurityImagingSecurityLevel(_View);
public static final DocumentSecurityImagingSecurityLevel Modify = new DocumentSecurityImagingSecurityLevel(_Modify);
public static final DocumentSecurityImagingSecurityLevel AddRevision = new DocumentSecurityImagingSecurityLevel(_AddRevision);
public static final DocumentSecurityImagingSecurityLevel Delete = new DocumentSecurityImagingSecurityLevel(_Delete);
public static final DocumentSecurityImagingSecurityLevel Owner = new DocumentSecurityImagingSecurityLevel(_Owner);
public static final DocumentSecurityImagingSecurityLevel OSJReview = new DocumentSecurityImagingSecurityLevel(_OSJReview);
public static final DocumentSecurityImagingSecurityLevel QualityReview = new DocumentSecurityImagingSecurityLevel(_QualityReview);
public static final DocumentSecurityImagingSecurityLevel BOProcessing = new DocumentSecurityImagingSecurityLevel(_BOProcessing);
public static final DocumentSecurityImagingSecurityLevel Compliance = new DocumentSecurityImagingSecurityLevel(_Compliance);
public static final DocumentSecurityImagingSecurityLevel Admin = new DocumentSecurityImagingSecurityLevel(_Admin);
public java.lang.String getValue() { return _value_;}
public static DocumentSecurityImagingSecurityLevel fromValue(java.lang.String value)
throws java.lang.IllegalArgumentException {
DocumentSecurityImagingSecurityLevel enumeration = (DocumentSecurityImagingSecurityLevel)
_table_.get(value);
if (enumeration==null) throw new java.lang.IllegalArgumentException();
return enumeration;
}
public static DocumentSecurityImagingSecurityLevel fromString(java.lang.String value)
throws java.lang.IllegalArgumentException {
return fromValue(value);
}
public boolean equals(java.lang.Object obj) {return (obj == this);}
public int hashCode() { return toString().hashCode();}
public java.lang.String toString() { return _value_;}
public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);}
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.EnumSerializer(
_javaType, _xmlType);
}
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.EnumDeserializer(
_javaType, _xmlType);
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(DocumentSecurityImagingSecurityLevel.class);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://schemas.datacontract.org/2004/07/CDSImaging", "DocumentSecurity.ImagingSecurityLevel"));
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
}
|
[
"[email protected]"
] | |
0dc0ab2c4c8e5e8aa78cdd94bb700c91f3d054dc
|
7a3d85b11b9e513fd2c8332a6403fa2232bec7f8
|
/src/lession17/Person.java
|
3188a433c11ac2913aaf349538ef3ae470dff692
|
[] |
no_license
|
github1901zx/JavaJunior19Project1Alexander
|
32d1cef6f2d6af7af1288b33ad52b4a5ead22286
|
04570046ea0aa8b977ca8888a2cf25fdd133ab95
|
refs/heads/master
| 2023-06-06T21:07:41.214776 | 2021-06-29T21:16:42 | 2021-06-29T21:16:42 | 356,326,613 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,323 |
java
|
package lession17;
public class Person {
private int age;
private String name;
public Person() {
//
}
public Person(int age, String name) {
this.age = age;
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) throws UncurrentAgeException {
if(age < 0 || age > 150){
throw new UncurrentAgeException(" Не может быть возраст отрицательный или больше 150 ");
}
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Person person = (Person) o;
if (age != person.age) return false;
return name != null ? name.equals(person.name) : person.name == null;
}
@Override
public int hashCode() {
int result = age;
result = 31 * result + (name != null ? name.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Person " +
" age " + age +
" name " + name;
}
}
|
[
"[email protected]"
] | |
10393788f929e683d35acbe120fd27178ca16f31
|
33a54c2672ebb433c74de77cd98cffe456d619ea
|
/app/src/main/java/net/duhnnie/android/sunshine/app/Utility.java
|
92948d23d00a5edb2e90cecfecb7570d3e46a742
|
[] |
no_license
|
duhnnie/Sunshine
|
5ae6530e86f113932da87ad9e232d4e79aab7a41
|
035bf2d460fd4b57a38ca58d71c8a57aafd5c1ff
|
refs/heads/master
| 2020-04-15T14:23:13.382611 | 2015-11-09T02:35:51 | 2015-11-09T02:35:51 | 164,753,704 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 10,475 |
java
|
package net.duhnnie.android.sunshine.app;
import android.content.ContentResolver;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.text.format.Time;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created by duhnnie on 5/23/15.
*/
public class Utility {
// Format used for storing dates in the database. ALso used for converting those strings
// back into date objects for comparison/processing.
public static final String DATE_FORMAT = "yyyyMMdd";
public static String getPreferredLocation(Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
return prefs.getString(context.getString(R.string.pref_location_key),
context.getString(R.string.pref_location_default));
}
public static boolean areNotificacionsEnabled (Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
return prefs.getBoolean("notifications", Boolean.parseBoolean(context.getString(R.string.pref_enable_notifications_key)));
}
public static boolean isMetric(Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
return prefs.getString(context.getString(R.string.pref_units_key),
context.getString(R.string.pref_units_metric))
.equals(context.getString(R.string.pref_units_metric));
}
public static String formatTemperature(Context context, double temperature, boolean isMetric) {
double temp;
if ( !isMetric ) {
temp = 9*temperature/5+32;
} else {
temp = temperature;
}
return context.getString(R.string.format_temperature, temperature);
}
static String formatDate(long dateInMillis) {
Date date = new Date(dateInMillis);
return DateFormat.getDateInstance().format(date);
}
/**
* Helper method to convert the database representation of the date into something to display
* to users. As classy and polished a user experience as "20140102" is, we can do better.
*
* @param context Context to use for resource localization
* @param dateInMillis The date in milliseconds
* @return a user-friendly representation of the date.
*/
public static String getFriendlyDayString(Context context, long dateInMillis) {
// The day string for forecast uses the following logic:
// For today: "Today, June 8"
// For tomorrow: "Tomorrow"
// For the next 5 days: "Wednesday" (just the day name)
// For all days after that: "Mon Jun 8"
Time time = new Time();
time.setToNow();
long currentTime = System.currentTimeMillis();
int julianDay = Time.getJulianDay(dateInMillis, time.gmtoff);
int currentJulianDay = Time.getJulianDay(currentTime, time.gmtoff);
// If the date we're building the String for is today's date, the format
// is "Today, June 24"
if (julianDay == currentJulianDay) {
//String today = context.getString(R.string.today);
//int formatId = R.string.format_full_friendly_date;
// return String.format(context.getString(
// formatId,
// today,
// getFormattedMonthDay(context, dateInMillis)));
return context.getString(R.string.today);
} else if ( julianDay < currentJulianDay + 7 ) {
// If the input date is less than a week in the future, just return the day name.
return getDayName(context, dateInMillis);
} else {
// Otherwise, use the form "Mon Jun 3"
SimpleDateFormat shortenedDateFormat = new SimpleDateFormat("EEE MMM dd");
return shortenedDateFormat.format(dateInMillis);
}
}
/**
* Given a day, returns just the name to use for that day.
* E.g "today", "tomorrow", "wednesday".
*
* @param context Context to use for resource localization
* @param dateInMillis The date in milliseconds
* @return
*/
public static String getDayName(Context context, long dateInMillis) {
// If the date is today, return the localized version of "Today" instead of the actual
// day name.
Time t = new Time();
t.setToNow();
int julianDay = Time.getJulianDay(dateInMillis, t.gmtoff);
int currentJulianDay = Time.getJulianDay(System.currentTimeMillis(), t.gmtoff);
if (julianDay == currentJulianDay) {
return context.getString(R.string.today);
} else if ( julianDay == currentJulianDay +1 ) {
return context.getString(R.string.tomorrow);
} else {
Time time = new Time();
time.setToNow();
// Otherwise, the format is just the day of the week (e.g "Wednesday".
SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE");
return dayFormat.format(dateInMillis);
}
}
/**
* Converts db date format to the format "Month day", e.g "June 24".
* @param context Context to use for resource localization
* @param dateInMillis The db formatted date string, expected to be of the form specified
* in Utility.DATE_FORMAT
* @return The day in the form of a string formatted "December 6"
*/
public static String getFormattedMonthDay(Context context, long dateInMillis ) {
Time time = new Time();
time.setToNow();
SimpleDateFormat dbDateFormat = new SimpleDateFormat(Utility.DATE_FORMAT);
SimpleDateFormat monthDayFormat = new SimpleDateFormat("MMMM dd");
String monthDayString = monthDayFormat.format(dateInMillis);
return monthDayString;
}
public static String getFormattedWind(Context context, float windSpeed, float degrees) {
int windFormat;
if (Utility.isMetric(context)) {
windFormat = R.string.format_wind_kmh;
} else {
windFormat = R.string.format_wind_mph;
windSpeed = .621371192237334f * windSpeed;
}
// From wind direction in degrees, determine compass direction as a string (e.g NW)
// You know what's fun, writing really long if/else statements with tons of possible
// conditions. Seriously, try it!
String direction = "Unknown";
if (degrees >= 337.5 || degrees < 22.5) {
direction = "N";
} else if (degrees >= 22.5 && degrees < 67.5) {
direction = "NE";
} else if (degrees >= 67.5 && degrees < 112.5) {
direction = "E";
} else if (degrees >= 112.5 && degrees < 157.5) {
direction = "SE";
} else if (degrees >= 157.5 && degrees < 202.5) {
direction = "S";
} else if (degrees >= 202.5 && degrees < 247.5) {
direction = "SW";
} else if (degrees >= 247.5 && degrees < 292.5) {
direction = "W";
} else if (degrees >= 292.5 || degrees < 22.5) {
direction = "NW";
}
return String.format(context.getString(windFormat), windSpeed, direction);
}
/**
* Helper method to provide the icon resource id according to the weather condition id returned
* by the OpenWeatherMap call.
* @param weatherId from OpenWeatherMap API response
* @return resource id for the corresponding icon. -1 if no relation is found.
*/
public static int getIconResourceForWeatherCondition(int weatherId) {
// Based on weather code data found at:
// http://bugs.openweathermap.org/projects/api/wiki/Weather_Condition_Codes
if (weatherId >= 200 && weatherId <= 232) {
return R.drawable.ic_storm;
} else if (weatherId >= 300 && weatherId <= 321) {
return R.drawable.ic_light_rain;
} else if (weatherId >= 500 && weatherId <= 504) {
return R.drawable.ic_rain;
} else if (weatherId == 511) {
return R.drawable.ic_snow;
} else if (weatherId >= 520 && weatherId <= 531) {
return R.drawable.ic_rain;
} else if (weatherId >= 600 && weatherId <= 622) {
return R.drawable.ic_snow;
} else if (weatherId >= 701 && weatherId <= 761) {
return R.drawable.ic_fog;
} else if (weatherId == 761 || weatherId == 781) {
return R.drawable.ic_storm;
} else if (weatherId == 800) {
return R.drawable.ic_clear;
} else if (weatherId == 801) {
return R.drawable.ic_light_clouds;
} else if (weatherId >= 802 && weatherId <= 804) {
return R.drawable.ic_cloudy;
}
return -1;
}
/**
* Helper method to provide the art resource id according to the weather condition id returned
* by the OpenWeatherMap call.
* @param weatherId from OpenWeatherMap API response
* @return resource id for the corresponding image. -1 if no relation is found.
*/
public static int getArtResourceForWeatherCondition(int weatherId) {
// Based on weather code data found at:
// http://bugs.openweathermap.org/projects/api/wiki/Weather_Condition_Codes
if (weatherId >= 200 && weatherId <= 232) {
return R.drawable.art_storm;
} else if (weatherId >= 300 && weatherId <= 321) {
return R.drawable.art_light_rain;
} else if (weatherId >= 500 && weatherId <= 504) {
return R.drawable.art_rain;
} else if (weatherId == 511) {
return R.drawable.art_snow;
} else if (weatherId >= 520 && weatherId <= 531) {
return R.drawable.art_rain;
} else if (weatherId >= 600 && weatherId <= 622) {
return R.drawable.art_snow;
} else if (weatherId >= 701 && weatherId <= 761) {
return R.drawable.art_fog;
} else if (weatherId == 761 || weatherId == 781) {
return R.drawable.art_storm;
} else if (weatherId == 800) {
return R.drawable.art_clear;
} else if (weatherId == 801) {
return R.drawable.art_light_clouds;
} else if (weatherId >= 802 && weatherId <= 804) {
return R.drawable.art_clouds;
}
return -1;
}
}
|
[
"[email protected]"
] | |
2ff0dd3aa496b882b688c94af26af82673c172f9
|
42f17985f12a6255a4c5e52d5dd119d1432b6eb2
|
/kodilla-hibernate/src/main/java/com/kodilla/hibernate/manytomany/facade/SearchFacade.java
|
b7a880e4e5dcc932b347e47050268240a449cc6b
|
[] |
no_license
|
TaQba/kodilla-course
|
be278c12598a0ad2d8f907965d1f793481ab2290
|
45e596c77ad408f92910be3af5f34b3d2a7f86ad
|
refs/heads/master
| 2020-04-05T05:53:26.722229 | 2019-03-28T00:07:24 | 2019-03-28T00:07:24 | 156,615,918 | 0 | 0 | null | 2019-03-28T00:07:24 | 2018-11-07T22:20:12 |
Java
|
UTF-8
|
Java
| false | false | 946 |
java
|
package com.kodilla.hibernate.manytomany.facade;
import com.kodilla.hibernate.manytomany.Company;
import com.kodilla.hibernate.manytomany.Employee;
import com.kodilla.hibernate.manytomany.dao.CompanyDao;
import com.kodilla.hibernate.manytomany.dao.EmployeeDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public final class SearchFacade {
@Autowired
CompanyDao companyDao;
@Autowired
EmployeeDao employeeDao;
public List searchCompany(final String value) {
String wrappedValue = "%" + value + "%";
List<Company> company = companyDao.searchNameLike(wrappedValue);
return company;
}
public List searchEmployee(final String value) {
String wrappedValue = "%" + value + "%";
List<Employee> employees = employeeDao.searchNameLike(wrappedValue);
return employees;
}
}
|
[
"!Madzia1980"
] |
!Madzia1980
|
44fae4a78bfceb37bc5f21ae2c53518b0f4d5c32
|
f789b671ff4ff9681d6e66c933c1acf876462ab9
|
/src/LogicalOperation/Logical.java
|
f8367e36904ed22e2a240511fbb6b0ec6d974b33
|
[] |
no_license
|
Musabir/C-Compiler
|
81ecbe04f31998b879c2394360a8364dcf32d3d7
|
78bfb5e6e0509df0e7e271bf8ac08ef3cac05871
|
refs/heads/master
| 2021-04-06T20:22:43.602583 | 2018-03-15T16:38:35 | 2018-03-15T16:38:35 | 125,396,598 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 53 |
java
|
package LogicalOperation;
public class Logical {
}
|
[
"[email protected]"
] | |
995082269ba9cd71515da864abb1b13261e58f67
|
5bb0812530bd038517fcfee58b90e55132955f68
|
/src/com/pdsu/sc/service/impl/JlruleServiceimpl.java
|
4b5138ba6c22c7f86098b3e320851146ae4c894c
|
[] |
no_license
|
lycProjects/sc
|
51d02c1534d9d2941aa5afe5238dddf851ff73b1
|
8460b62c633be4f2c7d7d933e60f319b7e8c4f93
|
refs/heads/master
| 2020-04-11T10:46:04.481298 | 2018-12-14T03:18:13 | 2018-12-14T03:18:13 | 161,725,560 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,269 |
java
|
package com.pdsu.sc.service.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.pdsu.sc.mapper.JlruleMapper;
import com.pdsu.sc.po.Jlrule;
import com.pdsu.sc.service.JlruleService;
@Service
public class JlruleServiceimpl implements JlruleService{
@Autowired
private JlruleMapper jlruleMapper;
public void deleteByPrimaryKey(Integer jlId) throws Exception {
jlruleMapper.deleteByPrimaryKey(jlId);
}
public void updateByPrimaryKeySelective(Integer jlId, String jlRecode,Date jlTime) throws Exception {
Jlrule jlrule=new Jlrule();
jlrule.setJlId(jlId);
jlrule.setJlRecode(jlRecode);
jlrule.setJlTime(jlTime);
jlruleMapper.updateByPrimaryKeySelective(jlrule);
}
public List<Jlrule> queryJlruleAll() throws Exception {
return jlruleMapper.queryJlruleAll();
}
public void insertSelective(Jlrule record) {
jlruleMapper.insertSelective(record);
}
@Override
public List<Jlrule> queryJlruleByTeam(Integer jlTeam) throws Exception {
return jlruleMapper.queryJlruleByTeam(jlTeam);
}
}
|
[
"[email protected]"
] | |
7ebadf0b2be24104927bbb19b86b48f631137f3a
|
5e9ab4fbcf339453b4b9cf5743277c4b9afa5361
|
/4. Spring 프레임워크기반 프로그래밍/03.05 bankDB/src/com/mulcam/err/AccountException.java
|
aa56ae5f1348381e2f56ef0a23be431afbaa7a9a
|
[] |
no_license
|
pakseulhee/K-Digital-lecture
|
ce45183b7f1a5bd886d49b0927f309b209dab826
|
f9fd9bc6f5a1ae6ba29ea1be7f897cf9532e1e4c
|
refs/heads/master
| 2023-04-02T18:47:33.011030 | 2021-03-29T14:37:46 | 2021-03-29T14:37:46 | 336,505,692 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,186 |
java
|
package com.mulcam.err;
public class AccountException extends Exception {
BankErrCode errCode;
public BankErrCode getErrCode() {
return errCode;
}
public void setErrCode(BankErrCode errCode) {
this.errCode = errCode;
}
public AccountException() {
super("계좌오류");
}
public AccountException(String message) {
super(message);
}
public AccountException(String message, BankErrCode errCode) {
super(message);
this.errCode=errCode;
}
public AccountException(BankErrCode errCode) {
super("계좌오류");
this.errCode=errCode;
}
@Override
public String toString() {
String msg = super.getMessage()+" : ";
switch(errCode) {
case NOT_ACC: msg+="계좌번호 오류입니다.";break;
case EXIST_ACC: msg+="사용할 수 없는 계좌번호입니다.";break;
case NO_DATA: msg+="개설된 계좌가 없습니다.";break;
case LACK_BALANCE: msg+="잔액이 부족합니다.";break;
case FAIL_MAKE: msg+="계좌 개설을 실패했습니다.";break;
case FAIL_DEPOSIT: msg+="입금을 실패했습니다.";break;
case FAIL_WITHDRAW: msg+="출금을 실패했습니다.";break;
}
return msg;
}
}
|
[
"[email protected]"
] | |
8242a9625da0fa12401ec6b41f6927ee64760f0a
|
c49e5f25daf4764120c72e7c2a6340e68643db63
|
/XTPFinalHomework/app/src/test/java/com/example/huaizhi/xtpfinalhomework/ExampleUnitTest.java
|
413749dcd432f2c8f061e2f935619d566d3fb2ac
|
[] |
no_license
|
EvergreenHZ/Face_Recognitioin_and_Android
|
3af401ec32dfd42913e33498ee9e0a94f6d766d7
|
dd111057182b3a3e92b0b5807788ccbb7be915ea
|
refs/heads/master
| 2021-10-24T18:29:29.067661 | 2019-03-27T13:36:37 | 2019-03-27T13:36:37 | 114,446,182 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 414 |
java
|
package com.example.huaizhi.xtpfinalhomework;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
|
[
"[email protected]"
] | |
af87de78a130182298efa7b626cd6d897d2fd8ba
|
1a9b7e417509f8e5d526368dd1c986631a017931
|
/src/main/java/com/tft/framework/menuRes/service/MenuResService.java
|
d69ee829c3e560dd45b247847677f87e48bf5ee3
|
[] |
no_license
|
liuwanliGit/tft
|
731649ed56f3f2254cbc1edcc92095fd554bf75b
|
145f53f961c3e58f712ebce176bab4b53beb7c74
|
refs/heads/master
| 2020-04-01T19:58:10.971513 | 2019-04-25T08:10:40 | 2019-04-25T08:10:40 | 153,581,087 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,875 |
java
|
package com.tft.framework.menuRes.service;
import com.tft.framework.common.bean.TftSort;
import com.tft.framework.menuRes.bean.MenuRes;
import java.util.List;
public interface MenuResService {
/**
* @Title: searchMenuRes
* @Description: 按条件加载菜单
* @处理逻辑
* @param
* @throws
* @return java.util.List<com.tft.framework.menuRes.bean.MenuRes>
* @author lwl [email protected] 2018/5/17 23:32
* @modify {修改人 修改原因 修改时间}
* @see #
*/
public List<MenuRes> searchAllMenusRes()throws Exception;
/**
<br>功能描述: 保存菜单
<br>处理逻辑:
<br>作者: lwl [email protected] 2018/6/15 16:45
<br>修改记录: {修改人 修改原因 修改时间}
* @param [menuRes]
* @throws
* @return void
* @see #
*/
public void createOrModifyMenusRes(MenuRes menuRes)throws Exception;
/**
<br>功能描述: 删除菜单
<br>处理逻辑: 删除菜单必须先确定其下无子菜单
<br>作者: lwl [email protected] 2018/6/15 16:55
<br>修改记录: {修改人 修改原因 修改时间}
* @param [menuRes]
* @throws
* @return void
* @see #
*/
public void removeMenusRes(MenuRes menuRes)throws Exception;
/**
<br>功能描述: 按条件查询菜单
<br>处理逻辑:
<br>作者: lwl [email protected] 2018/6/15 16:59
<br>修改记录: {修改人 修改原因 修改时间}
* @param [menuRes]
* @throws
* @return void
* @see #
*/
public List<MenuRes> searchMenusRes(MenuRes menuRes,TftSort sort)throws Exception;
/**
<br>功能描述: 通过id查询菜单详情
<br>处理逻辑:
<br>作者: lwl [email protected] 2018/6/15 17:00
<br>修改记录: {修改人 修改原因 修改时间}
* @param [id]
* @throws
* @return com.tft.framework.menuRes.bean.MenuRes
* @see #
*/
public MenuRes searchById(String id)throws Exception;
/**
<br>功能描述: 通过url查询菜单详情
<br>处理逻辑:
<br>作者: lwl [email protected] 2018/6/15 17:00
<br>修改记录: {修改人 修改原因 修改时间}
* @param [id]
* @throws
* @return com.tft.framework.menuRes.bean.MenuRes
* @see #
*/
public List<MenuRes> searchByUrl(String url)throws Exception;
/**
<br>功能描述: 通过父节点id查询子菜单列表(懒加载)
<br>处理逻辑:
<br>作者: lwl [email protected] 2018/6/15 17:00
<br>修改记录: {修改人 修改原因 修改时间}
* @param [pIdOrUrl]
* @throws
* @return java.util.List<com.tft.framework.menuRes.bean.MenuRes>
* @see #
*/
public List<MenuRes> searchByParent(String pId)throws Exception;
}
|
[
"[email protected]"
] | |
2088c6b8a0470ee1c1a0b54ddaf54bc8124e4c71
|
39bab20fe1c4642eea8aa6dac1123d7cd4f77cc9
|
/app/src/test/java/com/polyglotprogramminginc/beantest/ExampleUnitTest.java
|
7d5480c5fc6ca2a3d8aed49769b40c665e6a7327
|
[] |
no_license
|
lgleasain/bean_example
|
77b291ae55e4c4506f5e124211e4c21427a05149
|
fc1d25a3580b61187072d0815738b7215afab6c2
|
refs/heads/master
| 2021-01-10T08:43:31.111247 | 2016-02-09T15:05:10 | 2016-02-09T15:05:10 | 51,373,832 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 328 |
java
|
package com.polyglotprogramminginc.beantest;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
|
[
"[email protected]"
] | |
85461344017b0f6916970d37eeedd803106466fa
|
c8443b95b00184ed05a86a5d9ad8019bd893c0e1
|
/jdbc-template/src/main/java/com/nowin/spring/dataacces/office/Office.java
|
8117a1399261bf603666524707b96308ff361f79
|
[] |
no_license
|
michlu/WebApp-Java
|
413b5bbeec27d39f9a93c15cd4f56dc9d052db94
|
a39a017d9abf5322bc860a466db90a2d7661c0ca
|
refs/heads/master
| 2021-01-12T03:22:32.896220 | 2017-02-25T18:03:32 | 2017-02-25T18:03:32 | 78,202,821 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,338 |
java
|
package com.nowin.spring.dataacces.office;
/**
* @author Michlu
* @sience 2017-02-11
*/
public class Office {
private String officeCode;
private String city;
private String phone;
private String addressLine1;
private String adressLine2;
private String state;
private String country;
private String postalCode;
private String territory;
public String getOfficeCode() {
return officeCode;
}
public void setOfficeCode(String officeCode) {
this.officeCode = officeCode;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getAddressLine1() {
return addressLine1;
}
public void setAddressLine1(String addressLine1) {
this.addressLine1 = addressLine1;
}
public String getAdressLine2() {
return adressLine2;
}
public void setAdressLine2(String adressLine2) {
this.adressLine2 = adressLine2;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getPostalCode() {
return postalCode;
}
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
public String getTerritory() {
return territory;
}
public void setTerritory(String territory) {
this.territory = territory;
}
@Override
public String toString() {
return "Office{" +
"officeCode='" + officeCode + '\'' +
", city='" + city + '\'' +
", phone='" + phone + '\'' +
", addressLine1='" + addressLine1 + '\'' +
", adressLine2='" + adressLine2 + '\'' +
", state='" + state + '\'' +
", country='" + country + '\'' +
", postalCode='" + postalCode + '\'' +
", territory='" + territory + '\'' +
'}';
}
}
|
[
"[email protected]"
] | |
79d76642b2723be8d0902da28d0d53b07c6c00a5
|
a92b564af64f641b1f1b523c8ae8793735f4e7dc
|
/Java/src/object_oriented_programming/classes/Car.java
|
c0ce6e6a6702670a1c65c55793527b99a37fc26a
|
[] |
no_license
|
syth3/Teaching-Tech-Topics
|
29aa6f935d97c503a7a4eea8d93c8e2970ad2945
|
ad6cc9bf673ed9f89e6462ea63c30ee0d39cb962
|
refs/heads/main
| 2023-05-27T09:32:20.288298 | 2021-06-10T21:30:26 | 2021-06-10T21:30:26 | 375,783,971 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,961 |
java
|
package object_oriented_programming.classes;
import java.util.Objects;
public class Car {
//defining field of the class which act as characteristics of the class car
private String make;
private String model;
private String color;
private int year;
private double mpg;
//Constructor for an object car
public Car(String make, String model, String color, int year, double mpg) {
this.make = make;
this.model = model;
this.color = color;
this.year = year;
this.mpg = mpg;
}
//defining getters & setters (Methods)
public String getMake() {
return make;
}
public void setMake(String make) {
this.make = make;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
public double getMpg() {
return mpg;
}
public void setMpg(double mpg) {
this.mpg = mpg;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Car car = (Car) o;
return year == car.year
&& Objects.equals(make, car.make)
&& Objects.equals(model, car.model);
}
@Override
public int hashCode() {
return Objects.hash(make, model, year);
}
@Override
public String toString() {
return "Car{" +
"make='" + make + '\'' +
", model='" + model + '\'' +
", color='" + color + '\'' +
", year=" + year +
", mpg=" + mpg +
'}';
}
}
|
[
"[email protected]"
] | |
66117788bfb771a0d86b40443d47057cb8ea64ab
|
61323e40d67eabcc18e45460cdba3929bfdc507e
|
/src/main/java/com/spring/core/oop/order/Order.java
|
60bd56a43e6841a9bd0dcedc3d97fb13a723fcfd
|
[] |
no_license
|
Min4542/spring_basic
|
79b05094d03a3d049fad66a33f814644b4c288af
|
e17756b6835579fa091f6be70de65dc4bae63a28
|
refs/heads/master
| 2023-08-10T19:27:12.440500 | 2021-09-27T02:53:49 | 2021-09-27T02:53:49 | 409,793,830 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 362 |
java
|
package com.spring.core.oop.order;
import lombok.*;
//주문 정보 객체
@Setter @Getter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class Order {
private Long memberId; //주문한 회원 아이디
private String itemName; //상품명
private int itemPrice; //상품 금액
private int discountPrice; //할인받은 금액
}
|
[
"[email protected]"
] | |
1b0273a3943551555d5f83e20ee32b5ccbe8277f
|
61cb0d72a5bd4ac110485b1e09fe2364814e59a0
|
/app/src/main/java/com/example/contactsapp/ui/authentication/fragments/LoginFragment.java
|
5378cd72de6b7cb5c90bbc2d40dd19d098a56859
|
[] |
no_license
|
mrunknown6/ContactsApp
|
6a185956ed6a576358f42bed1ac0b57c82b1ce68
|
2cd213fb3719a3056960ebb044a091c4f51986c8
|
refs/heads/master
| 2023-01-19T03:53:50.465859 | 2020-11-26T11:18:36 | 2020-11-26T11:18:36 | 316,189,859 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,765 |
java
|
package com.example.contactsapp.ui.authentication.fragments;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.example.contactsapp.R;
import com.example.contactsapp.ui.authentication.Resource;
import com.example.contactsapp.tools.AuthenticationTools;
import com.example.contactsapp.ui.authentication.viewmodel.AuthenticationViewModel;
import com.example.contactsapp.ui.dashboard.DashboardActivity;
import com.example.contactsapp.util.SpannableStringUtil;
import com.google.android.material.textfield.TextInputLayout;
public class LoginFragment extends Fragment {
// widgets
private TextInputLayout tilUsername;
private TextInputLayout tilPassword;
private Button btnLogin;
// viewmodel
private AuthenticationViewModel viewModel;
public LoginFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_login, container, false);
// instantiate viewmodel
viewModel = new ViewModelProvider(this).get(AuthenticationViewModel.class);
// set spannable string
SpannableStringUtil.setSpannableStringLoginRegister(
getFragmentManager(),
getString(R.string.no_account_register),
23,
31,
new RegistrationFragment(),
(TextView) view.findViewById(R.id.tvNoAccount)
);
// instantiate widget references
tilUsername = view.findViewById(R.id.tilUsername);
tilPassword = view.findViewById(R.id.tilPassword);
btnLogin = view.findViewById(R.id.btnLogin);
return view;
}
@Override
public void onViewCreated(@NonNull final View view, @Nullable Bundle savedInstanceState) {
btnLogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// get username and password
String username = tilUsername.getEditText().getText().toString();
String password = tilPassword.getEditText().getText().toString();
// check for correctness
boolean isUsernameCorrect = AuthenticationTools.checkUsername(tilUsername);
boolean isPasswordCorrect = AuthenticationTools.checkPassword(tilPassword);
// animate progress bar observer
viewModel.getIsAuthenticating().observe(getViewLifecycleOwner(), new Observer<Boolean>() {
@Override
public void onChanged(Boolean isAuthenticating) {
if (getActivity() != null) {
ProgressBar pbLoading = getActivity().findViewById(R.id.pbLoading);
if (isAuthenticating) {
pbLoading.setVisibility(View.VISIBLE);
} else {
pbLoading.setVisibility(View.GONE);
}
} else {
Toast.makeText(getContext(), "ACTIVITY IS NULL", Toast.LENGTH_SHORT).show();
}
}
});
// log in response observer
viewModel.getResponse().observe(getViewLifecycleOwner(), new Observer<Resource<String>>() {
@Override
public void onChanged(Resource<String> response) {
if (response instanceof Resource.Unsuccessful) {
Toast.makeText(getContext(), ((Resource.Unsuccessful<String>) response).getData(), Toast.LENGTH_SHORT).show();
} else if (response instanceof Resource.Successful) {
Intent intent = new Intent(getActivity(), DashboardActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
getActivity().startActivity(intent);
}
}
});
if (isUsernameCorrect && isPasswordCorrect) {
viewModel.logIn(username, password);
}
}
});
}
}
|
[
"[email protected]"
] | |
eaf03fda45b50c4f44e0766cea78fa7f5fcaddda
|
0af8b92686a58eb0b64e319b22411432aca7a8f3
|
/api-vs-impl-small/domain/src/main/java/org/gradle/testdomain/performancenull_28/Productionnull_2743.java
|
8aca4e4aefba593c277d488c165f709849203b99
|
[] |
no_license
|
gradle/performance-comparisons
|
b0d38db37c326e0ce271abebdb3c91769b860799
|
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
|
refs/heads/master
| 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null |
UTF-8
|
Java
| false | false | 591 |
java
|
package org.gradle.testdomain.performancenull_28;
public class Productionnull_2743 {
private final String property;
public Productionnull_2743(String param) {
this.property = param;
}
public String getProperty() {
return property;
}
private String prop0;
public String getProp0() {
return prop0;
}
public void setProp0(String value) {
prop0 = value;
}
private String prop1;
public String getProp1() {
return prop1;
}
public void setProp1(String value) {
prop1 = value;
}
}
|
[
"[email protected]"
] | |
ccd74be2e0c5dfd538d1163f406eab3e698f6b6d
|
2ae045807aa9b60f9d2d6d0f0f185c455f34a06c
|
/app/src/androidTest/java/ru/reactiveturtle/reactivemusic/ExampleInstrumentedTest.java
|
a03e1a14896bd0decb460e023552a7176231f6a1
|
[] |
no_license
|
ReactiveTurtle/ReactiveMusic
|
0828149aafe9d8ebcc4c13f116dbb158e406e8e4
|
27740f4d8256c64846a531e9af8eb5a19e221416
|
refs/heads/master
| 2023-07-31T09:11:51.550732 | 2021-09-24T15:31:39 | 2021-09-24T15:31:39 | 291,920,907 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 776 |
java
|
package ru.reactiveturtle.reactivemusic;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("ru.reactiveturtle.reactivemusic", appContext.getPackageName());
}
}
|
[
"[email protected]"
] | |
e9fc4e1e2518b1a708fd6605891476129504136a
|
987dc0846447e665007e84c4a78ff79c2f6a3a23
|
/assignment5/BSTRefBased.java
|
9bd120d481bb5629daa032dd23885f2135bb13ba
|
[] |
no_license
|
zrawhite/csc115
|
61afda8e2bdfcd24d0de70abce704b07f342392d
|
b9a3d9acacaf1d0725fc240e791f7a4428f22a06
|
refs/heads/master
| 2020-06-29T09:19:42.379209 | 2016-11-22T05:35:18 | 2016-11-22T05:35:18 | 74,436,722 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 11,039 |
java
|
import java.util.Iterator;
/*
* ID: V00759566 Zach White
* Name: BSTRefBased.java
* Description: This program contains methods to control a reference based binary search tree.
* Input: TreeNodes and strings to insert into the tree
* Output: Info about the tree
*/
public class BSTRefBased extends AbstractBinaryTree
implements Iterable<WordRefs>
{
private TreeNode root;
public BSTRefBased() {
root = null;
}
public BSTRefBased(WordRefs item,
AbstractBinaryTree left,
AbstractBinaryTree right)
{
root = new TreeNode(item, null, null);
if (left != null) {
attachLeftSubtree(left);
}
if (right != null) {
attachRightSubtree(right);
}
}
/*
* Name: isEmpty
* Description: Determines whether the tree is empty
* Input: No input.
* Output: boolean.
*/
public boolean isEmpty() {
return (root == null);
}
/*
* Name: makeEmpty
* Description: Makes the root of the tree null
* Input: No input.
* Output: No output.
*/
public void makeEmpty() {
root = null;
}
/*
* Name: getRoot
* Description: Returns the root of the tree
* Input: No input.
* Output: TreeNode.
*/
protected TreeNode getRoot() {
return root;
}
/*
* Name: setRoot
* Description: Sets the root to the desired TreenNode
* Input: TreeNode.
* Output: No output.
*/
protected void setRoot(TreeNode r) {
this.root = r;
}
/*
* Name: getRootItem
* Description: Returns a WordRefs that is contained within the root
* Input: No input.
* Output: WordRefs.
*/
public WordRefs getRootItem() throws TreeException {
if (root == null) {
throw new TreeException("getRootItem() on empty tree");
}
return root.item;
}
/*
* Name: setRootItem
* Description: Sets the item
* Input: No input.
* Output: boolean.
*/
public void setRootItem(WordRefs item) {
if (root == null) {
root = new TreeNode(item);
} else {
root.item = item;
}
}
/*
* Name: attachLeft
* Description: Attaches a TreeNode to the left branch of a different node
* Input: WordRefs.
* Output: No output.
*/
public void attachLeft(WordRefs item) throws TreeException {
if (isEmpty()) {
throw new TreeException("attachLeft to empty tree");
}
if (!isEmpty() && root.left != null) {
throw new TreeException("attachLeft to occupied left child");
}
root.left = new TreeNode(item, null, null);
return;
}
/*
* Name: attachLeftSubtree
* Description: Attaches a subtree to the left side of a node
* Input: AbstractBinaryTree.
* Output: No output.
*/
public void attachLeftSubtree(AbstractBinaryTree left) {
if (isEmpty()) {
throw new TreeException("attachLeftSubtree to empty tree");
}
if (!isEmpty() && root.left != null) {
throw new
TreeException("attachLeftSubtree to occupied right child");
}
root.left = left.getRoot();
left.makeEmpty();
return;
}
/*
* Name: attachRight
* Description: Attaches a TreeNode to the right branch of a different node
* Input: WordRefs.
* Output: No output.
*/
public void attachRight(WordRefs item) throws TreeException {
if (isEmpty()) {
throw new TreeException("attachRight to empty tree");
}
if (!isEmpty() && root.right != null) {
throw new TreeException("attachRight to occupied right child");
}
root.right = new TreeNode(item, null, null);
return;
}
/*
* Name: attachRightSubtree
* Description: Attaches a subtree to the right side of a node
* Input: AbstractBinaryTree.
* Output: No output.
*/
public void attachRightSubtree(AbstractBinaryTree right) {
if (isEmpty()) {
throw new TreeException("attachRightSubtree to empty tree");
}
if (!isEmpty() && root.right != null) {
throw new
TreeException("attachRightSubtree to occupied right child");
}
root.right = right.getRoot();
right.makeEmpty();
return;
}
/*
* Name: detachLeftSubtree
* Description: Removes the left subtree from desired node
* Input: No input.
* Output: AbstractBinaryTree.
*/
public AbstractBinaryTree detachLeftSubtree()
throws TreeException
{
if (root == null) {
throw new TreeException("detachLeftSubtree on empty tree");
}
BSTRefBased result = new BSTRefBased();
result.setRoot(root.left);
root.left = null;
return result;
}
/*
* Name: detachRightSubtree
* Description: Removes the right subtree from desired node
* Input: No input.
* Output: AbstractBinaryTree.
*/
public AbstractBinaryTree detachRightSubtree()
throws TreeException
{
if (root == null) {
throw new TreeException("detachLeftSubtree on empty tree");
}
BSTRefBased result = new BSTRefBased();
result.setRoot(root.right);
root.right = null;
return result;
}
/*
* Name: insert
* Description: Calls the recursive method insertItem
* Input: String.
* Output: No output.
*/
public void insert(String word) {
this.root = insertItem(root, word);
}
/*
* Name: insertItem
* Description: Inserts an item into the binary search tree
* Input: TreeNode and String.
* Output: TreeNode.
*/
protected TreeNode insertItem(TreeNode r, String word) {
if (r == null) {
r = new TreeNode(new WordRefs(word));
}
else if (word.compareTo(r.item.getWord()) < 0){
r.left = insertItem(r.left, word);
} else {
r.right = insertItem(r.right, word);
}
return r;
}
/*
* Name: retrieve
* Description: Calls the recursive method retrieveItem
* Input: String.
* Output: WordRefs.
*/
public WordRefs retrieve(String word) {
TreeNode retrieve = retrieveItem(root, word);
if (retrieve != null){
String word1 = retrieve.item.getWord();
return new WordRefs(word1);
} else {
return null;
}
}
/*
* Name: retrieveItem
* Description: retrieves the desired tree node
* Input: TreeNode and String.
* Output: TreeNode.
*/
protected TreeNode retrieveItem(TreeNode r, String word) {
if (r == null) {
return null;
}
if (word.equals(r.item.getWord())){
return r;
} else if (word.compareTo(r.item.getWord()) < 0){
return retrieveItem(r.left, word);
} else {
return retrieveItem(r.right, word);
}
}
/*
* Name: delete
* Description: Calls the recursive method deleteItem
* Input: String.
* Output: No output.
*/
public void delete(String word) {
deleteItem(root, word);
}
/*
* Name: deleteItem
* Description: Deletes desired item
* Input: TreeNode and String.
* Output: TreeNode.
*/
protected TreeNode deleteItem(TreeNode r, String word) {
if (r == null) {
return null;
} else if(word.equals(r.item.getWord())){
TreeNode newNode = deleteItem(r.left, word);
return newNode;
} else if (word.compareTo(r.item.getWord()) < 0){
TreeNode left = deleteItem(r.left, word);
r.left = left;
return r;
} else {
TreeNode right = deleteItem(r.right, word);
r.right = right;
return r;
}
}
/*
* Name: deleteNode
* Description: Deletes desired node
* Input: TreeNode.
* Output: TreeNode.
*/
protected TreeNode deleteNode(TreeNode node) {
if (node.left == null && node.right == null){
return null;
} else if (node.left != null && node.right == null){
return node.left;
} else if (node.left == null && node.right != null){
return node.right;
} else {
TreeNode replaceNode = findLeftMost(node.right);
TreeNode delete = deleteLeftMost(node.right);
return node;
}
}
/*
* Name: findLeftMost
* Description: Finds the left most node the in the tree
* Input: TreeNode.
* Output: TreeNode.
*/
protected TreeNode findLeftMost(TreeNode node) {
if (node.left == null){
return node;
} else {
return findLeftMost(node.left);
}
}
/*
* Name: deleteLeftMost
* Description: deletes the left most node in the tree
* Input: TreeNode.
* Output: Treenode.
*/
protected TreeNode deleteLeftMost(TreeNode node) {
if (node.left == null){
return node.right;
} else {
TreeNode replace = deleteLeftMost(node.left);
node.left = replace;
return node;
}
}
/*
* Name: iterator
* Description: Implements the BSTIterator class
* Input: No input.
* Output: Iterator<>.
*/
public Iterator<WordRefs> iterator() {
return new BSTIterator(this);
}
public static void main(String args[]) {
BSTRefBased t;
AbstractBinaryTree tt;
int i;
boolean result;
String message;
message = "Test 1: inserting 'humpty' -- ";
t = new BSTRefBased();
try {
t.insert("humpty");
System.out.println("root "+ t.getRootItem().getWord());
result = t.getRootItem().getWord().equals("humpty");
} catch (Exception e) {
result = false;
e.printStackTrace();
}
System.out.println(message + (result ? "passed" : "FAILED"));
message = "Test 2: inserting 'humpty', 'dumpty', 'sat' -- ";
t = new BSTRefBased();
try {
t.insert("humpty");
t.insert("dumpty");
t.insert("sat");
result = t.getRootItem().getWord().equals("humpty");
tt = t.detachLeftSubtree();
result &= tt.getRootItem().getWord().equals("dumpty");
tt = t.detachRightSubtree();
result &= tt.getRootItem().getWord().equals("sat");
} catch (Exception e) {
result = false;
e.printStackTrace();
}
System.out.println(message + (result ? "passed" : "FAILED"));
t = new BSTRefBased();
t.insert("humpty");
t.insert("dumpty");
t.insert("sat");
WordRefs retrieve = t.retrieve("sat");
if (retrieve.getWord().equals("sat")){
System.out.println("Test 3 (retrieve): Passed");
} else {
System.out.println("Test 3 (retrieve): Failed");
}
}
}
|
[
"[email protected]"
] | |
6b51fdad014f5dd9578bd831c7e147ee0179ce9c
|
f9e0b569eef95278b5166863ea1554e1f44a5be7
|
/src/main/java/jiracli/XDG.java
|
bc5836f6a344fc6a22e4c274dbb2641b2bf216da
|
[] |
no_license
|
Otanikotani/jiracli
|
3ab4587872a54b6581481c3d2c73b1f856833db3
|
2ae2a20681b2131aa3f91b61093891a67a8ec80c
|
refs/heads/master
| 2020-08-02T18:22:39.805728 | 2019-09-28T08:04:35 | 2019-09-28T08:04:35 | 211,463,403 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 921 |
java
|
package jiracli;
import static java.nio.file.Paths.get;
import java.io.File;
import java.nio.file.Path;
import java.util.function.Supplier;
public enum XDG {
Cache("XDG_CACHE_HOME", () -> get(System.getenv("HOME"), ".cache", "jiracli")),
Config("XDG_CONFIG_HOME", () -> get(System.getenv("HOME"), ".config", "jiracli")),
ConfigDirs("XDG_CONFIG_DIRS", () -> get(File.separator, "etc", "xdg")),
Data("XDG_DATA_HOME", () -> get(System.getenv("HOME"), ".local", "share", "jiracli")),
RuntimeDir("XDG_RUNTIME_DIR", () -> get(System.getenv("XDG_RUNTIME_DIR")));
public final String name;
public final String path;
XDG(String name, Supplier<Path> path) {
this.name = name;
String envPath = System.getenv(name);
if (envPath != null && !envPath.isEmpty()) {
this.path = envPath;
} else {
this.path = path.get().toString();
}
}
Path toPath() {
return get(path);
}
}
|
[
"[email protected]"
] | |
029b7c3fa54731a194a40d2d7378353d12fddd46
|
8573ee6ad51378cd6f837f7020fe87aa7fee7052
|
/src/main/java/com/kujirahand/KEPUB/EPubFile.java
|
ece94abc85deb788b7a38cf0c444d2d9ae3d5b51
|
[] |
no_license
|
minstrelsy/UsagiEPubReaderForAndroid
|
0a7513d8285e24392622f6920d46080ff55d3791
|
7a1d071fe944aa1411e898492748b086b2a78f1c
|
refs/heads/master
| 2020-07-22T15:26:54.435979 | 2016-08-01T13:08:13 | 2016-08-01T13:08:13 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 13,590 |
java
|
package com.kujirahand.KEPUB;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import com.kujirahand.KEPUB.utils.ProcTime;
import com.kujirahand.KPage.EPubMarkerList;
import com.kujirahand.KPage.KCharList;
import com.kujirahand.KPage.KCharMeasureIF;
import com.kujirahand.KPage.KPage;
import com.kujirahand.KPage.KPageParser;
import com.kujirahand.KPage.KTagLoader;
import com.kujirahand.KXml.KXmlNode;
import com.kujirahand.KXml.KXmlNodeList;
import com.kujirahand.KXml.KXmlParser;
import com.kujirahand.utils.EnumFiles;
import com.kujirahand.utils.IniFile;
import com.kujirahand.utils.KFile;
import com.kujirahand.utils.StringList;
import com.kujirahand.utils.ZipUtil;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
// TODO: mobi形式のファイルをサポートすること
/**
* Created by kujira on 2016/04/07.
*/
public class EPubFile {
private String cache_dir;
private File cache_dir_f;
private String epub_path;
public StringList chapters;
private String target_html_path;
private String target_html_dir;
private String cover_image_path;
public String linkId = null;
public String bookTitle = null;
public int chapter = -1;
public EPubMarkerList markerList = new EPubMarkerList();
public IniFile ini = new IniFile();
private String ini_path;
private EPubFile() {
}
protected static StringBuilder logStr = new StringBuilder();
public static String getLog() {
String s = logStr.toString();
logStr = new StringBuilder();
return s;
}
public static String getAbsolutePath(String href) {
if (null == instanceInternal) return href;
return instanceInternal.parseRelativeURL(href);
}
public static void setAbsolutePath(String path) {
if (null == instanceInternal) return; // error
instanceInternal.target_html_path = path;
File f = new File(path);
instanceInternal.target_html_dir = f.getParent();
}
private static EPubFile instanceInternal = null;
public static EPubFile openEPubFile(String epub_path) {
// create EpubFile
EPubFile epub = new EPubFile();
instanceInternal = epub;
// get Cache dir
epub.cache_dir = PathConfig.getCacheDir(epub_path);
epub.cache_dir_f = new File(epub.cache_dir);
epub.cover_image_path = PathConfig.getCoverImage(epub_path);
epub.ini_path = PathConfig.getIniFilePath(epub_path);
log("epub_path=" + epub_path);
boolean b = epub.open(epub_path);
if (!b) return null;
return epub;
}
public static void log(String msg) {
logStr.append(msg+"\n");
}
private boolean open(String epub_path) {
this.epub_path = epub_path;
unzipEpub();
if (!readIndex()) return false;
return true;
}
public String getHtmlPath() { return target_html_path; }
public String getEpubPath() { return epub_path; }
public String parseRelativeURL(String href) {
if (href == null) href = "";
String full_path;
String file_path = href;
String link_id = "";
int i = href.indexOf('#');
if (i >= 0) {
file_path = href.substring(0, i);
link_id = href.substring(i+1);
}
if (file_path.equals("")) {
full_path = target_html_path;
}
else {
// ofile resource
if (file_path.indexOf("file:/") == 0) {
// キャッシュパス以下であればOK
file_path = file_path.replace("file:/", "");
if (file_path.indexOf(cache_dir) != 0) {
// NG
log("wrong file path = " + file_path);
return target_html_path; // NG
}
}
// check already full path
if (file_path.indexOf(cache_dir) == 0) {
// nothing to do
full_path = file_path;
} else {
// add dir
if (file_path.charAt(0) == '/') { // full path
full_path = cache_dir + file_path;
} else {
file_path = trimPrefixPath(file_path);
full_path = target_html_dir + "/" + file_path;
}
}
}
this.linkId = link_id;
return full_path;
}
// ASync
public void saveAsEPUBAsync() {
// cache_dirを圧縮して、epub_pathに保存
ArrayList<String> list = new ArrayList<String>();
EnumFiles.enumAllFiles(this.cache_dir_f, list);
ZipUtil.compress(list, this.cache_dir, this.epub_path);
}
public void savePage(KPage page) throws IOException {
if (page == null) return;
if (!page.isModified) return;
page.isModified = false;
String body = page.toStringForSave();
String cache_file = page.path + EPubConfig.CACHE_FOOTER;
KFile.save(cache_file, body);
//TODO: EPUBに書き戻す
log("savePage=" + cache_file);
}
public int getChapter() {
return chapter;
}
public String getPathFromHTML(String path) {
path = trimPrefixPath(path);
return this.target_html_dir + "/" + path;
}
public String getCacheDir() {
return this.cache_dir;
}
private void unzipEpub() {
// check Cache
if (!cache_dir_f.exists()) {
cache_dir_f.mkdirs();
}
List<String> files = ZipUtil.extract(epub_path, cache_dir);
// enum files
for (String fname : files) {
log("- file=" + fname);
}
}
public void saveIniFile() {
try {
ini.saveToFile(ini_path);
} catch (Exception e) {
e.printStackTrace();
}
}
private boolean readIndex() {
// check cache
if (KFile.exists(ini_path)) {
try {
ini.loadFromFile(ini_path);
String ini_epub_path = ini.get("epub_path", "");
if (!ini_epub_path.equals(epub_path)) {
ini.clear();
ini.put("epub_path", epub_path);
}
} catch (IOException e) {
log(e.getMessage());
e.printStackTrace();
}
}
String root_path = ini.get("root_path");
if ( root_path == null || (!KFile.exists(root_path)) ) {
// ROOT_FILE = META-INF/container.xml
KXmlNode cont = KXmlParser.loadAndParse(cache_dir + "/META-INF/container.xml");
if (cont == null) {
log("Broken EPUB file, no container.xml");
return false;
}
root_path = cont.getTagAttrValue("rootfile", "full-path");
if (root_path == null) return false;
root_path = trimPrefixPath(root_path);
root_path = cache_dir + "/" + root_path;
ini.put("root_path", root_path);
}
return readRootXMLFile(root_path);
}
private boolean readRootXMLFile(String root_path) {
// content.opf
this.bookTitle = ini.get("bookTitle", null);
if (this.bookTitle == null || EPubConfig.useCache == false) {
return readRootXMLFileFromXML(root_path);
}
// from Ini file
// chapters
this.chapters = new StringList();
int chapter_size = Integer.valueOf(ini.get("chapter.size", "0"));
for (int i = 1; i <= chapter_size; i++) {
String f = ini.get("chapter" + i, null);
if (f != null) chapters.add(f);
}
log("readRootXMLFile=fromIni");
log(ini.toString());
return true;
}
private boolean readRootXMLFileFromXML(String rootfile_path) {
File base_f = new File(rootfile_path);
String base_path = base_f.getParentFile().getAbsolutePath();
KXmlNode root_x = KXmlParser.loadAndParse(rootfile_path);
// | - title
KXmlNode title = root_x.getByTag("dc:title");
if (title != null) {
this.bookTitle = title.getText();
} else {
this.bookTitle = "No title";
}
ini.put("bookTitle", bookTitle);
// | - cover image
if (!checkCoverImage(epub_path, base_path, root_x)) {
return false;
}
// | - spine (目次)
KXmlNode spine = root_x.getByTag("spine");
KXmlNodeList nodelist = spine.findChildren("itemref");
chapters = new StringList();
for (KXmlNode n : nodelist) {
String ref = n.getAttrValue("idref");
String linear = n.getAttrValue("linear");
if (linear != null) {
if (linear.toLowerCase().equals("no")) continue;
}
KXmlNode book = root_x.getById(ref);
if (book == null) {
// view.log("broken link = " + ref);
continue;
}
String book_href = book.getAttrValue("href");
if (book_href == null) continue;
book_href = trimPrefixPath(book_href);
chapters.add(base_path + "/" + book_href);
// Log.d("Usagi", "chapter=" + book_href);
}
if (chapters.size() == 0) return false;
ini.put("chapter.size", ""+chapters.size());
for (int i = 1; i <= chapters.size(); i++) {
String f = chapters.get(i - 1);
ini.put("chapter" + i, f);
}
saveIniFile();
return true;
}
public String getMarkerListPath() {
return cache_dir + "/_marker_list_usagireader.tsv";
}
private String trimPrefixPath(String path) {
if (path.indexOf("/") == 0) path = path.substring(1);
if (path.indexOf("./") == 0) path = path.substring(2);
return path;
}
private String toc_path = null;
public String getTOCPath() {
return toc_path;
}
public void saveTableOfContents(String save_path) {
log("saveTableOfContents=" + save_path);
toc_path = save_path;
File f = new File(save_path);
String base_path= f.getParent();
// chapters フルパスを相対パスに変更してリンクして保存
String html = "<html><head><title>Table of contents</title></head><body><ul>";
int index = 1;
for (String href : chapters) {
String title = KFile.getTitleTagFromFile(href);
String apath = href.replace(base_path, "");
if (title == null || title.equals("")) title = "Chapter" + index;
html += "<li><a href='"+apath+"'>" + title + "</a></li>";
index++;
}
html += "</ul></body></html>";
try {
KFile.save(save_path, html);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void resizeBitmap(Canvas canvas, String img_src, Rect size) throws IOException {
try {
Bitmap bmp;
// Get only size
BitmapFactory.Options opt = new BitmapFactory.Options();
opt.inJustDecodeBounds = true;
BitmapFactory.decodeFile(img_src, opt);
int real_w = opt.outWidth;
int real_h = opt.outHeight;
// for Memory set scale
float w, r, h;
h = size.width();//px
r = h / real_h;
w = r * real_w;
int scale = 1 + (int)Math.floor(real_h / h);
opt.inJustDecodeBounds = false;
opt.inSampleSize = scale;
float x = size.left + (size.width() - w) / 2;
bmp = BitmapFactory.decodeFile(img_src, opt);
// copy to canvas
Rect src = new Rect(0, 0, bmp.getWidth(), bmp.getHeight());
Rect dst = new Rect((int)x, (int)size.top, (int) Math.ceil(x + w), (int) Math.ceil(size.top + h));
//
Paint paint = new Paint();
paint.setFilterBitmap(true);
canvas.drawBitmap(bmp, src, dst, paint);
bmp.recycle();
} catch (Exception e) {
throw new IOException("Image load error");
}
}
private boolean checkCoverImage(String epub_path, String cpath, KXmlNode root) {
// simple
KXmlNode meta = root.getByTagAndAttr("meta", "name", "cover");
if (meta == null) return false;
String image_content = meta.getAttrValue("content");
if (image_content == null) return false;
KXmlNode item = root.getByTagAndAttr("item", "id", image_content);
if (item == null) return false;
String path = item.getAttrValue("href");
path = trimPrefixPath(path);
String src = cpath + "/" + path;
// resize
int px = 128;
Bitmap bmp = Bitmap.createBitmap(px, px, Bitmap.Config.ARGB_8888);
Canvas cv = new Canvas(bmp);
try {
resizeBitmap(cv, src, new Rect(0, 0, px, px));
String savePath = cover_image_path;
FileOutputStream fos = null;
fos = new FileOutputStream(new File(savePath));
bmp.compress(Bitmap.CompressFormat.PNG, 100, fos);
} catch (IOException e) {
log("Could make cover image.");
return false;
}
return true;
}
}
|
[
"[email protected]"
] | |
5c087571306050f9d6515890159fb7307d7cbbe6
|
a03733c4c7b5438641a79a66174d654b39f0bae1
|
/src/main/java/com/kl/mapper/UserMapper.java
|
462fbc8c9a30f1d61efe7a7f9e0630f2eadc1a98
|
[] |
no_license
|
ahmachan/jpamybatis
|
bbea5a7136eecdb146e3e72a22d9cd58242d86e6
|
14b067259886055ab7d5a27296c96e350930e7b9
|
refs/heads/master
| 2020-03-28T13:37:48.780968 | 2018-09-21T10:30:02 | 2018-09-21T10:30:02 | 148,412,131 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,270 |
java
|
package com.kl.mapper;
import com.github.pagehelper.Page;
import com.kl.model.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface UserMapper {
//使用注解的方式
@Select("select * from t_user where username like #{name}")
public List<User> likeName(String name);
@Select("select * from t_user where id = #{id}")
public User getInfoById(Long id);
@Select("select id,username,nickname,age,status,address,add_time from t_user where id >0")
public List<User> getUserList();
/**
* 分页查询数据
* @return
*/
@Select("select id,username,nickname,age,status,address,add_time from t_user where id >0")
public Page<User> getListByPageWithAnnotationFetchPage();
/**
* 分页查询数据
* @return
*/
@Select("select id,username,nickname,age,status,address,add_time from t_user where id >0")
public List<User> getListByPageWithAnnotationFetchList();
@Delete("DELETE FROM t_user WHERE id = #{id}")
int delete(Long id);
//使用xml的方式
public List<User> getUsers();
public List<User> getListByPageWithXmlFetchList();
public Page<User> getListByPageWithXmlFetchPage();
}
|
[
"[email protected]"
] | |
b05efd0264b4f52d9a56d5e58beec9dbc5529cee
|
b42fd4d17ca5e556a467927501d516df9528f742
|
/QLCV/src/java/app/qlcv/entities/TkWsPeople.java
|
6375ae96057ae7215f0dc23d62840639b4f36c6d
|
[] |
no_license
|
vthgiang/LuanVanCH_NguyenCongSon_KPI
|
fe869f039e33af75de09fe3ac8c19783047a1590
|
6adf2121a7dbb5ad0594b102bef8c3c3d166abb5
|
refs/heads/main
| 2023-04-28T10:49:04.309420 | 2021-05-28T03:27:11 | 2021-05-28T03:27:11 | 371,462,629 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,927 |
java
|
package app.qlcv.entities;
// Generated Feb 20, 2021 4:59:14 PM by Hibernate Tools 4.3.1
import java.util.HashSet;
import java.util.Set;
/**
* TkWsPeople generated by hbm2java
*/
public class TkWsPeople implements java.io.Serializable {
private int id;
private TkWorkspace tkWorkspace;
private String roleWorkspace;
private String status;
private Integer userId;
private Set tkWsTeamses = new HashSet(0);
public TkWsPeople() {
}
public TkWsPeople(int id, TkWorkspace tkWorkspace) {
this.id = id;
this.tkWorkspace = tkWorkspace;
}
public TkWsPeople(int id, TkWorkspace tkWorkspace, String roleWorkspace, String status, Integer userId, Set tkWsTeamses) {
this.id = id;
this.tkWorkspace = tkWorkspace;
this.roleWorkspace = roleWorkspace;
this.status = status;
this.userId = userId;
this.tkWsTeamses = tkWsTeamses;
}
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public TkWorkspace getTkWorkspace() {
return this.tkWorkspace;
}
public void setTkWorkspace(TkWorkspace tkWorkspace) {
this.tkWorkspace = tkWorkspace;
}
public String getRoleWorkspace() {
return this.roleWorkspace;
}
public void setRoleWorkspace(String roleWorkspace) {
this.roleWorkspace = roleWorkspace;
}
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
public Integer getUserId() {
return this.userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Set getTkWsTeamses() {
return this.tkWsTeamses;
}
public void setTkWsTeamses(Set tkWsTeamses) {
this.tkWsTeamses = tkWsTeamses;
}
}
|
[
"[email protected]"
] | |
61a045dfacf5b62927b6fb74828ec8105d3047c2
|
fb2e40c57b3acdf8e5b5786fb180cdc0da8bc1b7
|
/DAOO/thread/exemplo1.java
|
307c236a79c5aa76ad7e41ac371981ef4f95194f
|
[] |
no_license
|
g4brielklein/ads-ulbra
|
b512e9a766b2fb72077d46a99c8e3bf9eda67edd
|
3e00cdf4eed8275a85781c150553b45575bd668d
|
refs/heads/master
| 2021-12-22T17:58:37.801378 | 2021-12-20T03:44:22 | 2021-12-20T03:44:22 | 242,031,603 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 439 |
java
|
public void calculaTotalRecebido(){
//Recebe aproximadamente 70mil registros.
List<HistoricoRecebimento> recebidos = getListRecebimentos();
Integer soma = 0;
for(HistoricoRecebimento h1: recebidos){
soma = soma + recebidos.getValorRecebido();
}
Integer porcentagemImposto = getReajusteAtualFromWebService();
soma = soma + ((porcentagemImposto/100)*soma);
retornaParaWebServiceValorTotal(soma);
}
|
[
"[email protected]"
] | |
e2d6151d91a7238f0ae683c40fc10d7092f28a07
|
dcf8d8b9d8aa1a378344f2cd8fa2d93e798b5243
|
/src/main/java/com/numberONe/controller/system/ResourcesController.java
|
2bba7598ce375fecf6a044296b6682e79c3e616b
|
[] |
no_license
|
aaa2550/numberone-auth-Maven
|
1ca8782f351053afe9b54ebc1f708385e605aea6
|
785ac0b82c6d88511ce3f76473bbacded3130b3a
|
refs/heads/master
| 2021-07-13T23:41:25.574721 | 2017-10-19T09:25:48 | 2017-10-19T09:25:48 | 106,650,242 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 9,062 |
java
|
package com.numberONe.controller.system;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import com.numberONe.controller.CustomerInfoController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.numberONe.annotation.SystemLog;
import com.numberONe.controller.index.BaseController;
import com.numberONe.entity.ButtomFormMap;
import com.numberONe.entity.Params;
import com.numberONe.entity.ResFormMap;
import com.numberONe.entity.ResUserFormMap;
import com.numberONe.entity.UserGroupsFormMap;
import com.numberONe.mapper.ResourcesMapper;
import com.numberONe.util.Common;
import com.numberONe.util.TreeObject;
import com.numberONe.util.TreeUtil;
/**
*
* @author numberONe 2014-11-19
* @version 3.0v
*/
@Controller
@RequestMapping("/resources/")
public class ResourcesController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(ResourcesController.class);
@Inject
private ResourcesMapper resourcesMapper;
/**
* @param model
* 存放返回界面的model
* @return
*/
@ResponseBody
@RequestMapping("treelists")
public ResFormMap treelists(Model model) {
try {
ResFormMap resFormMap = getFormMap(ResFormMap.class);
String order = " order by level asc";
resFormMap.put("$orderby", order);
List<ResFormMap> mps = resourcesMapper.findByNames(resFormMap);
List<TreeObject> list = new ArrayList<TreeObject>();
for (ResFormMap map : mps) {
TreeObject ts = new TreeObject();
Common.flushObject(ts, map);
list.add(ts);
}
TreeUtil treeUtil = new TreeUtil();
List<TreeObject> ns = treeUtil.getChildTreeObjects(list, 0);
resFormMap = new ResFormMap();
resFormMap.put("treelists", ns);
return resFormMap;
} catch (Throwable e) {
e.printStackTrace();
logger.error("treelists error.", e);
return null;
}
}
@ResponseBody
@RequestMapping("reslists")
public List<TreeObject> reslists(Model model) throws Exception {
ResFormMap resFormMap = getFormMap(ResFormMap.class);
List<ResFormMap> mps = resourcesMapper.findByWhere(resFormMap);
List<TreeObject> list = new ArrayList<TreeObject>();
for (ResFormMap map : mps) {
TreeObject ts = new TreeObject();
Common.flushObject(ts, map);
list.add(ts);
}
TreeUtil treeUtil = new TreeUtil();
List<TreeObject> ns = treeUtil.getChildTreeObjects(list, 0, " ");
return ns;
}
/**
* @param model
* 存放返回界面的model
* @return
*/
@RequestMapping("list")
public String list(Model model) {
model.addAttribute("res", findByRes());
return Common.BACKGROUND_PATH + "/system/resources/list";
}
/**
* 跳转到修改界面
*
* @param model
* @param resourcesId
* 修改菜单信息ID
* @return
*/
@RequestMapping("editUI")
public String editUI(Model model) {
String id = getPara("id");
if(Common.isNotEmpty(id)){
model.addAttribute("resources", resourcesMapper.findbyFrist("id", id, ResFormMap.class));
}
return Common.BACKGROUND_PATH + "/system/resources/edit";
}
/**
* 跳转到新增界面
*
* @return
*/
@RequestMapping("addUI")
public String addUI(Model model) {
return Common.BACKGROUND_PATH + "/system/resources/add";
}
/**
* 权限分配页面
*
* @author numberONe date:2014-4-14
* @param model
* @return
*/
@RequestMapping("permissions")
public String permissions(Model model) {
ResFormMap resFormMap = getFormMap(ResFormMap.class);
List<ResFormMap> mps = resourcesMapper.findByWhere(resFormMap);
List<TreeObject> list = new ArrayList<TreeObject>();
for (ResFormMap map : mps) {
TreeObject ts = new TreeObject();
Common.flushObject(ts, map);
list.add(ts);
}
TreeUtil treeUtil = new TreeUtil();
List<TreeObject> ns = treeUtil.getChildTreeObjects(list, 0);
model.addAttribute("permissions", ns);
return Common.BACKGROUND_PATH + "/system/resources/permissions";
}
/**
* 添加菜单
*
* @param resources
* @return Map
* @throws Exception
*/
@RequestMapping("addEntity")
@ResponseBody
@Transactional(readOnly=false)//需要事务操作必须加入此注解
@SystemLog(module="系统管理",methods="资源管理-新增资源")//凡需要处理业务逻辑的.都需要记录操作日志
public String addEntity() throws Exception {
ResFormMap resFormMap = getFormMap(ResFormMap.class);
if("2".equals(resFormMap.get("type"))){
resFormMap.put("description", Common.htmltoString(resFormMap.get("description")+""));
}
Object o = resFormMap.get("ishide");
if(null==o){
resFormMap.set("ishide", "0");
}
resourcesMapper.addEntity(resFormMap);
return "success";
}
/**
* 更新菜单
*
* @param model
* @param Map
* @return
* @throws Exception
*/
@ResponseBody
@RequestMapping("editEntity")
@Transactional(readOnly=false)//需要事务操作必须加入此注解
@SystemLog(module="系统管理",methods="资源管理-修改资源")//凡需要处理业务逻辑的.都需要记录操作日志
public String editEntity(Model model) throws Exception {
ResFormMap resFormMap = getFormMap(ResFormMap.class);
if("2".equals(resFormMap.get("type"))){
resFormMap.put("description", Common.htmltoString(resFormMap.get("description")+""));
}
Object o = resFormMap.get("ishide");
if(null==o){
resFormMap.set("ishide", "0");
}
resourcesMapper.editEntity(resFormMap);
return "success";
}
/**
* 根据ID删除菜单
*
* @param model
* @param ids
* @return
* @throws Exception
*/
@ResponseBody
@RequestMapping("deleteEntity")
@SystemLog(module="系统管理",methods="资源管理-删除资源")//凡需要处理业务逻辑的.都需要记录操作日志
public String deleteEntity(Model model) throws Exception {
String[] ids = getParaValues("ids");
for (String id : ids) {
resourcesMapper.deleteByAttribute("id", id, ResFormMap.class);
};
return "success";
}
@RequestMapping("sortUpdate")
@ResponseBody
@Transactional(readOnly=false)//需要事务操作必须加入此注解
public String sortUpdate(Params params) throws Exception {
List<String> ids = params.getId();
List<String> es = params.getRowId();
List<ResFormMap> maps = new ArrayList<ResFormMap>();
for (int i = 0; i < ids.size(); i++) {
ResFormMap map = new ResFormMap();
map.put("id", ids.get(i));
map.put("level", es.get(i));
maps.add(map);
}
resourcesMapper.updateSortOrder(maps);
return "success";
}
@ResponseBody
@RequestMapping("findRes")
public List<ResFormMap> findUserRes() {
ResFormMap resFormMap = getFormMap(ResFormMap.class);
List<ResFormMap> rs = resourcesMapper.findRes(resFormMap);
return rs;
}
@ResponseBody
@RequestMapping("addUserRes")
@Transactional(readOnly=false)//需要事务操作必须加入此注解
@SystemLog(module="系统管理",methods="用户管理/组管理-修改权限")//凡需要处理业务逻辑的.都需要记录操作日志
public String addUserRes() throws Exception {
String userId = "";
String u = getPara("userId");
String g = getPara("roleId");
if (null != u && !Common.isEmpty(u.toString())) {
userId = u.toString();
} else if (null != g && !Common.isEmpty(g.toString())) {
List<UserGroupsFormMap> gs = resourcesMapper.findByAttribute("roleId", g.toString(), UserGroupsFormMap.class);
for (UserGroupsFormMap ug : gs) {
userId += ug.get("userId") + ",";
}
}
userId = Common.trimComma(userId);
if(Common.isEmpty(userId)){
return "分配失败,该角色下没有用户!";
}
String[] users = userId.split(",");
for (String uid : users) {
resourcesMapper.deleteByAttribute("userId", uid, ResUserFormMap.class);
String[] s = getParaValues("resId[]");
List<ResUserFormMap> resUserFormMaps = new ArrayList<ResUserFormMap>();
for (String rid : s) {
ResUserFormMap resUserFormMap = new ResUserFormMap();
resUserFormMap.put("resId", rid);
resUserFormMap.put("userId", uid);
resUserFormMaps.add(resUserFormMap);
}
resourcesMapper.batchSave(resUserFormMaps);
}
return "success";
}
@ResponseBody
@RequestMapping("findByButtom")
public List<ButtomFormMap> findByButtom(){
return resourcesMapper.findByWhere(new ButtomFormMap());
}
/**
* 验证菜单是否存在
*
* @param name
* @return
*/
@RequestMapping("isExist")
@ResponseBody
public boolean isExist(String name,String resKey) {
ResFormMap resFormMap = getFormMap(ResFormMap.class);
List<ResFormMap> r = resourcesMapper.findByNames(resFormMap);
if (r.size()==0) {
return true;
} else {
return false;
}
}
}
|
[
"[email protected]"
] | |
1d7e7668b1cf05ec2238ae0f757fc75627ddf6ee
|
a139b682db3961f2af5e07529983ef2a5b8d413d
|
/Distributore Automatico/src/doc/tests/TextStrategiaRepositoryUnderTest.java
|
766e923a98ff1083055cdb95deaa2efdfcaa0fbc
|
[] |
no_license
|
nicolasebastianelli/Foundations_of_Informatics_T-2
|
540ed82673fea9c615a68b6050ccc041457c2413
|
f44a08297605afaadf4cdc3a0e1243ac8d330eaa
|
refs/heads/master
| 2021-08-30T16:23:34.705546 | 2017-12-18T16:28:27 | 2017-12-18T16:28:27 | 59,346,235 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 893 |
java
|
package doc.tests;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import doc.model.DentoStrategiaConfigurabile;
import doc.persistence.MalformedFileException;
import doc.persistence.TextStrategieRepository;
public class TextStrategiaRepositoryUnderTest extends TextStrategieRepository {
private static Reader reader;
public TextStrategiaRepositoryUnderTest(String fileName)
throws IOException, MalformedFileException {
super(fileName);
}
public static void setReader(Reader reader) {
TextStrategiaRepositoryUnderTest.reader = reader;
}
@Override
public Reader getReader() {
return reader;
}
public DentoStrategiaConfigurabile exposedReadElement(BufferedReader bufferedReader) throws MalformedFileException, IOException {
return (DentoStrategiaConfigurabile) readElement(bufferedReader);
}
}
|
[
"[email protected]"
] | |
8431c6c11de23ad2d5602a5095ca50152e24af5f
|
d32447aaf85cba1cee48ace24e0c2e187932def7
|
/studentdal/src/main/java/com/asheet/student/dal/StudentdalApplication.java
|
5ca58efdd4a43b03a1d83cd9dbd7cd8b8c12c169
|
[] |
no_license
|
RepoAsheet/STS
|
61b80f87440d697d7c90ef65d27d46ff5e515714
|
f1f1f8eaa3e1b07859551b687fc69ae47dbedca4
|
refs/heads/master
| 2020-05-20T10:19:54.249628 | 2019-05-08T03:47:17 | 2019-05-08T03:47:17 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 323 |
java
|
package com.asheet.student.dal;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class StudentdalApplication {
public static void main(String[] args) {
SpringApplication.run(StudentdalApplication.class, args);
}
}
|
[
"[email protected]"
] | |
9062ead53e5946eae26cddaa679bdaf9a7eb9b75
|
571a9a707f2af883d7b1b1efba035d4789f86a17
|
/BasicCode/NetCode/src/demo10/TcpServer.java
|
78f2bd325b6a1d0b1293d89094d8dfb9449b40dc
|
[] |
no_license
|
monster6699/JavaBasicsCode
|
8c50610efdd2128e0a690fc4bb890090e4325ccd
|
22f484de449addb51abca06dde96f86dff0ec679
|
refs/heads/master
| 2023-01-31T22:10:50.089539 | 2020-12-09T10:48:36 | 2020-12-09T10:48:36 | 296,530,514 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,042 |
java
|
package demo10;
import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
public class TcpServer {
public static void main(String[] args) throws IOException {
ServerSocket serverSocket = new ServerSocket(1314);
Socket accept = serverSocket.accept();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(accept.getInputStream()));
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter("NetCode/b.iml"));
String line;
while ((line=bufferedReader.readLine()) != null) {
bufferedWriter.write(line);
bufferedWriter.newLine();
bufferedWriter.flush();
}
BufferedWriter bufferedWriter1 = new BufferedWriter(new OutputStreamWriter(accept.getOutputStream()));
bufferedWriter1.write("服务器接收文件成功");
bufferedWriter1.newLine();
bufferedWriter1.flush();
bufferedWriter.close();
serverSocket.close();
}
}
|
[
"[email protected]"
] | |
e3d11743af1f449bfe12c6f923a126b3a50b5f68
|
f19cca8c5a4f41648060925819861a3b63fd01b8
|
/cuowuchuli.java
|
c098a9735edf941a2632724bfa69582acc1f0d9e
|
[] |
no_license
|
SeanYuCheng/SeanJava
|
e19ec6f85106af04170eacfc78352ecba022641c
|
57f19a1cdc64aeb6f990ea943576b9ba6d9b5310
|
refs/heads/master
| 2020-03-15T09:36:26.955661 | 2018-05-04T03:23:46 | 2018-05-04T03:23:46 | 132,076,571 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 367 |
java
|
package wycthestudyofjava;
import java.util.Scanner;
public class cuowuchuli {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
try {
int a = in.nextInt();
int b = in.nextInt();
}catch(Exception e) {
System.out.println(e.toString());
}
System.out.println("232");
}
}
|
[
"[email protected]"
] | |
8ca18d8525020e4ac4749a7b9a1a25a24d1687e7
|
d1c42e149d86080fbdd5308e820b1846c9ae95b3
|
/whileComp/src-gen/org/xtext/example/whileCpp/ExprAnd.java
|
96039a770dc5376942fb7932c9bd63f1f80e4386
|
[] |
no_license
|
Tha1n/CompilerWhileCpp
|
89d6ea2ca519f95cbbe83ada54cfcdd8fe565b20
|
28799436bd82ff5d67eb1ab359ca111156c7ee08
|
refs/heads/master
| 2020-05-29T11:53:29.029965 | 2016-01-21T13:39:09 | 2016-01-21T13:39:09 | 45,477,477 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,358 |
java
|
/**
*/
package org.xtext.example.whileCpp;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Expr And</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link org.xtext.example.whileCpp.ExprAnd#getExprOr <em>Expr Or</em>}</li>
* <li>{@link org.xtext.example.whileCpp.ExprAnd#getExprAnd <em>Expr And</em>}</li>
* <li>{@link org.xtext.example.whileCpp.ExprAnd#getExprAndAtt <em>Expr And Att</em>}</li>
* </ul>
*
* @see org.xtext.example.whileCpp.WhileCppPackage#getExprAnd()
* @model
* @generated
*/
public interface ExprAnd extends EObject
{
/**
* Returns the value of the '<em><b>Expr Or</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Expr Or</em>' containment reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Expr Or</em>' containment reference.
* @see #setExprOr(ExprOr)
* @see org.xtext.example.whileCpp.WhileCppPackage#getExprAnd_ExprOr()
* @model containment="true"
* @generated
*/
ExprOr getExprOr();
/**
* Sets the value of the '{@link org.xtext.example.whileCpp.ExprAnd#getExprOr <em>Expr Or</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Expr Or</em>' containment reference.
* @see #getExprOr()
* @generated
*/
void setExprOr(ExprOr value);
/**
* Returns the value of the '<em><b>Expr And</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Expr And</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Expr And</em>' attribute.
* @see #setExprAnd(String)
* @see org.xtext.example.whileCpp.WhileCppPackage#getExprAnd_ExprAnd()
* @model
* @generated
*/
String getExprAnd();
/**
* Sets the value of the '{@link org.xtext.example.whileCpp.ExprAnd#getExprAnd <em>Expr And</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Expr And</em>' attribute.
* @see #getExprAnd()
* @generated
*/
void setExprAnd(String value);
/**
* Returns the value of the '<em><b>Expr And Att</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Expr And Att</em>' containment reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Expr And Att</em>' containment reference.
* @see #setExprAndAtt(ExprAnd)
* @see org.xtext.example.whileCpp.WhileCppPackage#getExprAnd_ExprAndAtt()
* @model containment="true"
* @generated
*/
ExprAnd getExprAndAtt();
/**
* Sets the value of the '{@link org.xtext.example.whileCpp.ExprAnd#getExprAndAtt <em>Expr And Att</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Expr And Att</em>' containment reference.
* @see #getExprAndAtt()
* @generated
*/
void setExprAndAtt(ExprAnd value);
} // ExprAnd
|
[
"[email protected]"
] | |
74b92c76371ef9ea8ab7cd6eb4be1c9f71e0c6f8
|
1d88a12d1bac65ece5af69d5d9d82cb268a310aa
|
/publiccms-core/src/main/java/com/publiccms/logic/dao/sys/SysModuleDao.java
|
2b477bc7c012774ee6c4f447e6867f8c31a33994
|
[] |
no_license
|
apexwang/publiccms-parent
|
1d9e7095fd7268de69e4411773a25167c0b44ac5
|
c8b6bc3711da15e84d8cc450e85cc89e40d608fb
|
refs/heads/master
| 2022-12-23T01:16:41.177571 | 2020-03-09T02:46:12 | 2020-03-09T02:46:12 | 245,928,198 | 1 | 0 | null | 2022-12-16T12:25:27 | 2020-03-09T02:39:27 |
JavaScript
|
UTF-8
|
Java
| false | false | 1,618 |
java
|
package com.publiccms.logic.dao.sys;
import org.springframework.stereotype.Repository;
import com.publiccms.common.base.BaseDao;
import com.publiccms.common.handler.PageHandler;
import com.publiccms.common.handler.QueryHandler;
import com.publiccms.common.tools.CommonUtils;
import com.publiccms.entities.sys.SysModule;
/**
*
* SysModuleDao
*
*/
@Repository
public class SysModuleDao extends BaseDao<SysModule> {
/**
* @param parentId
* @param menu
* @param pageIndex
* @param pageSize
* @return results page
*/
public PageHandler getPage(String parentId, Boolean menu, Integer pageIndex, Integer pageSize) {
QueryHandler queryHandler = getQueryHandler("from SysModule bean");
if (CommonUtils.notEmpty(parentId)) {
queryHandler.condition("bean.parentId = :parentId").setParameter("parentId", parentId);
} else {
queryHandler.condition("bean.parentId is null");
}
if (null != menu) {
queryHandler.condition("bean.menu = :menu").setParameter("menu", menu);
}
queryHandler.order("bean.sort asc,bean.id asc");
return getPage(queryHandler, pageIndex, pageSize);
}
@Override
protected SysModule init(SysModule entity) {
if (CommonUtils.empty(entity.getAuthorizedUrl())) {
entity.setAuthorizedUrl(null);
}
if (CommonUtils.empty(entity.getUrl())) {
entity.setUrl(null);
}
if (CommonUtils.empty(entity.getParentId())) {
entity.setParentId(null);
}
return entity;
}
}
|
[
"[email protected]"
] | |
97c50277c076bd60c43c36d97e3353dcdd9098ac
|
8a3832ada7c95f38a03827291d0179a490b54f3e
|
/compiler/src/aeminium/compiler/east/EMethodInvocation.java
|
1ce52d43cb97fa78d9adf657085ba5b4e60ef3f8
|
[] |
no_license
|
AEminium/java2aeminium
|
b26822063b2a4293d23da270f7b1f63ddea049c8
|
4047e8d0ba50d11af1624c0eda043b4ed4b9916b
|
refs/heads/master
| 2021-01-25T12:02:42.637521 | 2012-12-05T22:11:11 | 2012-12-05T22:11:11 | 2,328,755 | 0 | 0 | null | 2013-09-04T13:44:51 | 2011-09-05T14:50:17 |
Java
|
UTF-8
|
Java
| false | false | 7,130 |
java
|
package aeminium.compiler.east;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.eclipse.jdt.core.dom.*;
import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword;
import aeminium.compiler.DependencyStack;
import aeminium.compiler.signature.DataGroup;
import aeminium.compiler.signature.Signature;
import aeminium.compiler.signature.SignatureItemDeferred;
import aeminium.compiler.signature.SimpleDataGroup;
import aeminium.compiler.task.Task;
public class EMethodInvocation extends EDeferredExpression
{
private static final boolean OPTIMIZE_PARALLELIZE = true;
protected final DataGroup datagroup;
protected final EExpression expr;
protected final ArrayList<EExpression> arguments;
public EMethodInvocation(EAST east, MethodInvocation original, EASTDataNode scope, EASTExecutableNode parent, EMethodInvocation base)
{
super(east, original, scope, original.resolveMethodBinding(), parent, base);
this.datagroup = scope.getDataGroup().append(new SimpleDataGroup("invoke " + original.getName().toString()));
if (original.getExpression() == null)
this.expr = null;
else
this.expr = EExpression.create(this.east, original.getExpression(), scope, this, base == null ? null : base.expr);
this.arguments = new ArrayList<EExpression>();
for (int i = 0; i < original.arguments().size(); i++)
{
this.arguments.add
(
EExpression.create
(
this.east,
(Expression) original.arguments().get(i),
scope,
this,
base == null ? null : base.arguments.get(i)
)
);
}
}
/* factory */
public static EMethodInvocation create(EAST east, MethodInvocation invoke, EASTDataNode scope, EASTExecutableNode parent, EMethodInvocation base)
{
return new EMethodInvocation(east, invoke, scope, parent, base);
}
@Override
public MethodInvocation getOriginal()
{
return (MethodInvocation) this.original;
}
@Override
public DataGroup getDataGroup()
{
return this.datagroup;
}
@Override
public void checkSignatures()
{
if (!this.isStatic())
this.expr.checkSignatures();
for (EExpression arg : this.arguments)
arg.checkSignatures();
ArrayList<DataGroup> dgsArgs = new ArrayList<DataGroup>();
for (EExpression arg : this.arguments)
dgsArgs.add(arg.getDataGroup());
DataGroup dgExpr = this.isStatic() ? null : this.expr.getDataGroup();
EMethodDeclaration method = this.getMethod();
if (method != null)
{
this.deferred = new SignatureItemDeferred(method, this.getDataGroup(), dgExpr, dgsArgs);
this.signature.addItem(this.deferred);
} else
{
Signature def = this.getEAST().getCompiler().getSignatureReader().getSignature(this.binding.getKey(), this.getDataGroup(), dgExpr, dgsArgs);
this.signature.addAll(def);
}
}
@Override
public Signature getFullSignature()
{
Signature sig = new Signature();
sig.addAll(this.signature);
if (!this.isStatic())
sig.addAll(this.expr.getFullSignature());
for (EExpression arg : this.arguments)
sig.addAll(arg.getFullSignature());
return sig;
}
@Override
public void checkDependencies(DependencyStack stack)
{
if (!this.isStatic())
{
this.expr.checkDependencies(stack);
this.addStrongDependency(this.expr);
}
for (EExpression arg : this.arguments)
{
arg.checkDependencies(stack);
this.addStrongDependency(arg);
}
Signature sig;
if (this.deferred != null)
sig = this.deferred.closure();
else
sig = this.signature;
Set<EASTExecutableNode> deps = stack.getDependencies(this, sig);
for (EASTExecutableNode node : deps)
this.addWeakDependency(node);
}
@Override
public int optimize()
{
int sum = 0;
if (!this.isStatic())
sum += this.expr.optimize();
for (EExpression arg : this.arguments)
sum += arg.optimize();
sum += super.optimize();
return sum;
}
/* @Override
public int inline(EASTExecutableNode inlineTo)
{
if (!this.isAeminium())
return super.inline(inlineTo);
// TODO inline ClassInstanceCreation
System.err.println("TODO: EMethodInvocation.inline()");
return 0;
}
*/
@Override
public void preTranslate(Task parent)
{
if (this.inlineTask)
this.task = parent;
else
this.task = parent.newSubTask(this, "invoke", this.base == null ? null : this.base.task);
if (!this.isStatic())
this.expr.preTranslate(this.task);
for (int i = 0; i < this.arguments.size(); i++)
this.arguments.get(i).preTranslate(this.task);
}
/* Returns the inlined version */
@SuppressWarnings("unchecked")
@Override
public Expression build(List<CompilationUnit> out)
{
AST ast = this.getAST();
MethodInvocation invoke = ast.newMethodInvocation();
invoke.setName(ast.newSimpleName(this.binding.getName()));
if (this.isStatic())
invoke.setExpression(ast.newName(this.binding.getDeclaringClass().getName()));
else
invoke.setExpression(this.expr.translate(out));
for (EExpression arg : this.arguments)
invoke.arguments().add(arg.translate(out));
return invoke;
}
@SuppressWarnings("unchecked")
public Statement buildStmt(List<CompilationUnit> out)
{
AST ast = this.getAST();
if (this.isSequential() || !this.isAeminium())
return ast.newExpressionStatement(this.build(out));
ClassInstanceCreation create = ast.newClassInstanceCreation();
create.setType(ast.newSimpleType(ast.newSimpleName(this.getMethod().getTask().getTypeName())));
create.arguments().add(ast.newThisExpression());
if (!this.isStatic())
create.arguments().add(this.expr.translate(out));
for (EExpression arg : this.arguments)
create.arguments().add(arg.translate(out));
if (!EMethodInvocation.OPTIMIZE_PARALLELIZE)
return ast.newExpressionStatement(create);
IfStatement ifstmt = ast.newIfStatement();
MethodInvocation parallelize = ast.newMethodInvocation();
parallelize.setExpression(ast.newSimpleName("rt"));
parallelize.setName(ast.newSimpleName("parallelize"));
FieldAccess access = ast.newFieldAccess();
access.setExpression(ast.newThisExpression());
access.setName(ast.newSimpleName("ae_ret"));
Assignment assign = ast.newAssignment();
assign.setLeftHandSide(access);
/* can't use build() here because that would translate() arguments twice */
MethodInvocation invoke = ast.newMethodInvocation();
invoke.setName(ast.newSimpleName(this.binding.getName()));
invoke.arguments().addAll(ASTNode.copySubtrees(ast, create.arguments()));
invoke.arguments().remove(0); /* task pointer */
if (this.isStatic())
invoke.setExpression(ast.newName(this.binding.getDeclaringClass().getName()));
else
{
invoke.setExpression(this.expr.translate(out));
invoke.arguments().remove(0); /* ae_this */
}
assign.setRightHandSide(invoke);
ifstmt.setExpression(parallelize);
ifstmt.setThenStatement(ast.newExpressionStatement(create));
ifstmt.setElseStatement(ast.newExpressionStatement(assign));
return ifstmt;
}
public boolean isStatic()
{
for (ModifierKeyword keyword : this.getModifiers())
if (keyword.toString().equals("static"))
return true;
return false;
}
}
|
[
"[email protected]"
] | |
ac750f5801f2fabfa9de3cac718894ea691269f9
|
5fd47e6d796dd4412b56c233236703a52728de7c
|
/src/datastructure/Stack.java
|
e905c3b68287393ac4b5bcb6cef899b24304eddc
|
[] |
no_license
|
liuzhi136/codecraft
|
31de41806a104cdcc527d8273dc4351f50b67627
|
56ef24334173bf484a0a3d3da081e30a6fa97bd1
|
refs/heads/master
| 2021-01-10T08:15:15.345935 | 2016-03-30T13:21:37 | 2016-03-30T13:21:37 | 55,062,534 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,207 |
java
|
package datastructure;
import java.util.Iterator;
public class Stack<T> implements Iterable<T>{
private int N;
private Node first;
private class Node{
T item;
Node next;
}
public void push(T item){
Node oldfirst = first;
first = new Node();
first.item = item;
first.next = oldfirst;
N++;
}
public T pop(){
T item = first.item;
N--;
first = first.next;
return item;
}
public T peek(){
T item = first.item;
return item;
}
public static Stack<String> copy(Stack<String> s){
Stack<String> duplicate = new Stack<>();
for (String val : s){
duplicate.push(val);
}
return duplicate;
}
public int size(){
return N;
}
public boolean isEmpty(){
return first == null;
}
@Override
public Iterator<T> iterator() {
return new ListIterator();
}
private class ListIterator implements Iterator<T>{
private Node current = first;
@Override
public boolean hasNext() {
return current != null;
}
@Override
public T next() {
T item = current.item;
current = current.next;
return item;
}
@Override
public void remove() {
}
}
}
|
[
"[email protected]"
] | |
03f3b2f0f2390a5b5c0c7da5bdb5a81d9bef1c10
|
996bedf9e4ac05eb1f1fd1cf3e2d5b22cf6eaf29
|
/src/com/microsoftapi/searchapp/datastructure/Journal.java
|
adc9f671d96a5e5dc5140de1cdbcaa0050805c44
|
[] |
no_license
|
richardkaplan/MicrosoftAcademicSearchCrawler
|
7d3c3aaf2bf9d83bc89002a483a9ebefcbd58868
|
93f9aaeaa9083912338a0bacf431dd34b9c9b628
|
refs/heads/master
| 2020-12-11T09:24:15.196960 | 2014-05-27T16:07:52 | 2014-05-27T16:07:52 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,937 |
java
|
package com.microsoftapi.searchapp.datastructure;
import java.util.ArrayList;
import java.util.HashMap;
import org.json.simple.JSONArray;
import com.microsoftapi.searchapp.Constants;
public class Journal {
private long ID;
private long PublicationCount;
private long CitationCount;
private String FullName;
private String ShortName;
private ArrayList<Domain> ResearchInterestDomain;
private String ISSN;
public Journal(HashMap map){
this.ID = (Long)map.get(Constants.ID);
this.PublicationCount = (Long)map.get(Constants.PUBLICATION_COUNT);
this.CitationCount = (Long)map.get(Constants.CITATION_COUNT);
this.FullName = (String)map.get(Constants.FULLNAME);
this.ShortName = (String)map.get(Constants.SHORTNAME);
JSONArray array = (JSONArray)map.get(Constants.RESEARCH_INTEREST_DOMAIN);
this.ISSN = (String)map.get(Constants.ISSN);
}
public long getID() {
return ID;
}
public void setID(int iD) {
ID = iD;
}
public long getPublicationCount() {
return PublicationCount;
}
public void setPublicationCount(int publicationCount) {
PublicationCount = publicationCount;
}
public long getCitationCount() {
return CitationCount;
}
public void setCitationCount(int citationCount) {
CitationCount = citationCount;
}
public String getFullName() {
return FullName;
}
public void setFullName(String fullName) {
FullName = fullName;
}
public String getShortName() {
return ShortName;
}
public void setShortName(String shortName) {
ShortName = shortName;
}
public ArrayList<Domain> getResearchInterestDomain() {
return ResearchInterestDomain;
}
public void setResearchInterestDomain(ArrayList<Domain> researchInterestDomain) {
ResearchInterestDomain = researchInterestDomain;
}
public String getISSN() {
return ISSN;
}
public void setISSN(String iSSN) {
ISSN = iSSN;
}
}
|
[
"[email protected]"
] | |
6c02d794211bc61b1bab13838eb9035c2aaf9d42
|
2aa1d6a7ba34e89d3401f65bb2ef5d73e1eeea41
|
/core/src/main/java/de/raysha/lib/jsimpleshell/handler/CommandAccessManagerDependent.java
|
d6ee6deb1f1f375e0af614cb9e3d9381975fb063
|
[
"BSD-3-Clause"
] |
permissive
|
rainu/jsimpleshell
|
418f131887e24f35acab9fb7ea91ac5b59b3d7a0
|
c89ec822ed62e4d4837ea2e2b9c33b2da4d21145
|
refs/heads/master
| 2023-03-20T17:25:13.235839 | 2015-09-06T11:25:57 | 2015-09-06T11:25:57 | 21,977,200 | 4 | 1 | null | 2015-09-06T11:25:58 | 2014-07-18T10:47:28 |
Java
|
UTF-8
|
Java
| false | false | 634 |
java
|
package de.raysha.lib.jsimpleshell.handler;
import de.raysha.lib.jsimpleshell.annotation.Inject;
/**
* Classes that want to get the access of used {@link CommandAccessManager} should implement this interface.
*
* @deprecated Use the {@link Inject} annotation over a setter-method instead of using this interface
* (it has the same effect).
*
* @author rainu
*/
public interface CommandAccessManagerDependent {
/**
* This method pass a {@link CommandAccessManager}.
*
* @param accessManager The {@link CommandAccessManager} instance.
*/
public void cliSetCommandAccessManager(CommandAccessManager accessManager);
}
|
[
"[email protected]"
] | |
d5c1f80116c7a00a27211a53f6f0918b293c5649
|
1c2ef52f9ea8cac05b2fc15d8999146e91d9aa6f
|
/src/spittr/alert/SpitterHandler.java
|
e698849e70197e94b5fadd053b726d81d9b06c66
|
[] |
no_license
|
toyindipo/Spittr
|
776660599f4146cef9795a4886ad74c9b336da92
|
e39649266119e878d538c3698d2699dc67199b3f
|
refs/heads/master
| 2021-01-18T20:57:25.227206 | 2016-09-18T01:22:32 | 2016-09-18T01:22:32 | 68,487,751 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 246 |
java
|
package spittr.alert;
import org.springframework.stereotype.Component;
import spittr.misc.Spitter;
@Component
public class SpitterHandler {
public void handleSpitterAlert(Spitter spitter) {
System.out.println(spitter.getUsername());
}
}
|
[
"[email protected]"
] | |
e4b838757f34401f6f8b3f26eb335b3d06baaedf
|
1ea38cf303bf05f8e576586918745330aabdac03
|
/Toy-Shop-Application/src/main/java/com/hai/config/security/MyAuthenticationSucessHandler.java
|
5b47446405cdcb080c8dba053caa0efde6c42b43
|
[] |
no_license
|
marocvi/Toy-Shop
|
24f701addd405201aa5d4b30eebe635df751325b
|
1ea061fc550de48c66a79f7da58192e72f023d61
|
refs/heads/master
| 2020-04-14T23:34:01.438683 | 2019-02-13T02:23:44 | 2019-02-13T02:23:44 | 164,207,008 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 673 |
java
|
package com.hai.config.security;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
public class MyAuthenticationSucessHandler implements AuthenticationSuccessHandler {
@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
Authentication authentication) throws IOException, ServletException {
System.out.println("Do something ");
}
}
|
[
"marocvi@DESKTOP-58I423K"
] |
marocvi@DESKTOP-58I423K
|
4d3a53d9878c4672a5fed828c46d41785500c2e3
|
1ff876dc0e02954eabfb19a7fdd41e321a80768c
|
/andexmaphelper/src/main/java/ir/androidexception/andexmaphelper/MarkerStatus.java
|
a5dab3da7fe0afbb604af6b15ceaa1589a587e91
|
[
"Apache-2.0"
] |
permissive
|
salehyarahmadi/AndExMapHelper
|
e3f8a45cb41938b2375d18e4909271260521da4e
|
e133e0daa2d9b4073dfa39f52c62120e94383368
|
refs/heads/master
| 2020-12-10T11:39:26.394204 | 2020-01-15T19:53:59 | 2020-01-15T19:53:59 | 233,583,354 | 29 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 600 |
java
|
package ir.androidexception.andexmaphelper;
public class MarkerStatus {
private String name;
private Integer iconResourceId;
public MarkerStatus(String name, Integer iconResourceId) {
this.name = name;
this.iconResourceId = iconResourceId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getIconResourceId() {
return iconResourceId;
}
public void setIconResourceId(Integer iconResourceId) {
this.iconResourceId = iconResourceId;
}
}
|
[
"[email protected]"
] | |
cb2b54829ee7045ddde80cbedbf7c17e57e7dc3e
|
2415a4e2cab1a726bea653e42bc7eab2373e26aa
|
/app/src/main/java/com/example/ilham/uas/model/FriendModel.java
|
0780174524634755418b998d2058a9540afc7389
|
[] |
no_license
|
ilhammaulanap/UAS_AKB
|
5d7db001b54426987de5ad787a49dd6eaefed278
|
1729efbe5f19987d56a8e3e646cab79806a0711d
|
refs/heads/master
| 2020-07-03T14:49:36.097651 | 2019-08-12T14:39:26 | 2019-08-12T14:39:26 | 201,941,869 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,483 |
java
|
package com.example.ilham.uas.model;
import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
import io.realm.annotations.Required;
//Nama : Ilham Maulana Pratama
//NIM : 10116335
//KLS : IF 8
//TGL : 3 Agustus 2019
public class FriendModel extends RealmObject {
@PrimaryKey
private Integer id;
@Required
private String nim;
@Required
private String Nama;
@Required
private String kelas;
@Required
private String telp;
@Required
private String email;
@Required
private String sosmed;
public Integer getId() {
return id;
}
public String getNim() {
return nim;
}
public String getNama() {
return Nama;
}
public String getKelas() {
return kelas;
}
public String getTelp() {
return telp;
}
public String getEmail() {
return email;
}
public String getSosmed() {
return sosmed;
}
public void setId(Integer id) {
this.id = id;
}
public void setNim(String nim) {
this.nim = nim;
}
public void setNama(String nama) {
this.Nama = nama;
}
public void setKelas(String kelas) {
this.kelas = kelas;
}
public void setTelp(String telp) {
this.telp = telp;
}
public void setEmail(String email) {
this.email = email;
}
public void setSosmed(String sosmed) {
this.sosmed = sosmed;
}
}
|
[
"[email protected]"
] | |
ce06e864bc18fd9b6c77e52a1b74d7953bdc2be7
|
099e566d636a9afa456588b7bee3d02ff829ca76
|
/src/main/java/rs/ac/uns/ftn/rezervacije/stranice/kupac/home/Kridencijali.java
|
6ca5b2ca62b72aec12a9f06f31447229400edca7
|
[] |
no_license
|
milandinic/rezervacija
|
e9ca634d9b7a265ab46733ac19e8ffae2ab2a0a9
|
491b166607fb1e9a88fbc72f5694b1754f219184
|
refs/heads/master
| 2021-01-21T12:26:16.823482 | 2012-04-22T14:08:05 | 2012-04-22T14:08:05 | 3,451,660 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 715 |
java
|
package rs.ac.uns.ftn.rezervacije.stranice.kupac.home;
import java.io.Serializable;
public class Kridencijali implements Serializable {
public static String KORISNICKO_IME = "korisnickoIme";
public static String LOZINKA = "lozinka";
private static final long serialVersionUID = -3297269925695453590L;
private String korisnickoIme;
private String lozinka;
public String getKorisnickoIme() {
return korisnickoIme;
}
public void setKorisnickoIme(String korisnickoIme) {
this.korisnickoIme = korisnickoIme;
}
public String getLozinka() {
return lozinka;
}
public void setLozinka(String lozinka) {
this.lozinka = lozinka;
}
}
|
[
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.