blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1e7d22d81ea3aba7559728a51b4836424ba87b52 | 3ddeeb06543267a97bdd15aed5d4bef6d3d8f5e6 | /app/src/main/java/br/com/veteritec/usecase/UseCaseAbstract.java | 77d9e5dce3c2742c023b2251849b593623fbc689 | [] | no_license | cleysondiego/veteritec-mobile | 75dc8a8183d79460de5714e71a53f8ffdbc38d68 | 1af31729e02c57fbd2683af14f1de536b8279c8c | refs/heads/master | 2021-03-02T14:12:56.341386 | 2020-11-14T16:10:43 | 2020-11-14T16:10:43 | 245,873,094 | 2 | 0 | null | 2020-05-08T12:57:09 | 2020-03-08T19:15:37 | Java | UTF-8 | Java | false | false | 297 | java | package br.com.veteritec.usecase;
public abstract class UseCaseAbstract implements UseCase {
private Executor executor;
public UseCaseAbstract(Executor executor) {
this.executor = executor;
}
@Override
public void execute() {
executor.execute(this);
}
}
| [
"[email protected]"
] | |
b8afa6a18570d700a6083984807a3d3645d13ac4 | d1a6d1e511df6db8d8dd0912526e3875c7e1797d | /genny_JavaWithoutLambdas/applicationModule/src/main/java/applicationModulepackageJava17/Foo835.java | 16b4a5b95a5713b80211960ca7630e63a8e6eeb9 | [] | no_license | NikitaKozlov/generated-project-for-desugaring | 0bc1443ab3ddc84cd289331c726761585766aea7 | 81506b3711004185070ca4bb9a93482b70011d36 | refs/heads/master | 2020-03-20T00:35:06.996525 | 2018-06-12T09:30:37 | 2018-06-12T09:30:37 | 137,049,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 348 | java | package applicationModulepackageJava17;
public class Foo835 {
public void foo0() {
new applicationModulepackageJava17.Foo834().foo5();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
}
| [
"[email protected]"
] | |
d2754e709a87911fdb731d1cf62fb68b3495ec6a | bcd4be1e1e06ad5e1aa396a76fb956feded52426 | /app/src/main/java/com/w1761940/coursework2/Database.java | 673c6849f5e795472cc69436bf0c9d0bfe1e6e92 | [] | no_license | thirandev/Imdb-Tracker-Mobile-App | fe73e4c6f73859d7e6a331cbf034f357804c8f22 | e809b25a3d054ab973af6d6c60a7cd0b7102855e | refs/heads/main | 2023-04-24T00:56:11.981234 | 2021-05-16T08:52:55 | 2021-05-16T08:52:55 | 367,824,794 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,924 | java | package com.w1761940.coursework2;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import java.util.ArrayList;
public class Database extends SQLiteOpenHelper {
private static final String DATABASE_NAME = "MoviesDB";
private static final String DATABASE_TABLE = "movies";
private static final int DATABASE_VERSION = 1;
private int id;
private String title;
private int year;
private String director;
private String cast;
private int rating;
private String review;
private int fav;
private Movie movie;
private Context context;
private SQLiteDatabase liteDatabase;
// Database Construct which sets the context
public Database(Context ct) {
super(ct, DATABASE_NAME, null, DATABASE_VERSION);
context = ct;
}
@Override
public void onCreate(SQLiteDatabase db) {
// Creating a SQLite database table
db.execSQL("create table " + DATABASE_TABLE + " (_id integer primary key autoincrement," +
"mov_name text,mov_year integer,mov_dir text,mov_cast text,mov_rating integer," +
"mov_review text,mov_fav integer);");
Log.i("Database", "Table Created");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// Dropping a table when creating if it exists.
db.execSQL("drop table if exists " + DATABASE_TABLE);
onCreate(liteDatabase);
}
public void insertData(Movie movie) {
//Writing to the Database
liteDatabase = getWritableDatabase();
//Inserting data in the movie table using a sql query
liteDatabase.execSQL("insert into " + DATABASE_TABLE + " (mov_name,mov_year,mov_dir," +
"mov_cast,mov_rating,mov_review,mov_fav)" +
" values('" + movie.getTitle() + "','" + movie.getYear() + "','" + movie.getDirector() +
"','" + movie.getCast()
+ "','" + movie.getRating() + "','" + movie.getReview() + "','" + movie.getSelected() + "');");
}
public ArrayList<Movie> getAllData() {
// Making the connection for getting data
liteDatabase = getReadableDatabase();
// Fetching all the data in alphabetical order
Cursor cursor = liteDatabase.rawQuery("SELECT * FROM " + DATABASE_TABLE +
" ORDER BY mov_name ASC", null);
ArrayList<Movie> list = new ArrayList<>();
// Creating a movie object with the fetched variables and adding to a Movie Object List
while (cursor.moveToNext()) {
id = cursor.getInt(0);
title = cursor.getString(1);
year = cursor.getInt(2);
director = cursor.getString(3);
cast = cursor.getString(4);
rating = cursor.getInt(5);
review = cursor.getString(6);
fav = cursor.getInt(7);
movie = new Movie(title, director, cast, review, year, rating);
movie.setId(id);
movie.setSelected(fav);
list.add(movie);
}
return list;
}
public void setFavourite(ArrayList<Movie> selectedList) {
//Writing to the Database
liteDatabase = getWritableDatabase();
for (int i = 0; i < selectedList.size(); i++) {
String idString = String.valueOf(selectedList.get(i).getId());
String value = String.valueOf(selectedList.get(i).getSelected());
liteDatabase.execSQL("UPDATE movies SET mov_fav = " + value + " WHERE _id =" + idString);
}
}
public ArrayList<Movie> getFavourite() {
// Making the connection for getting data
liteDatabase = getReadableDatabase();
// Fetching all stored data from database
Cursor cursor = liteDatabase.rawQuery("SELECT * FROM " + DATABASE_TABLE +
" WHERE mov_fav = 1", null);
ArrayList<Movie> list = new ArrayList<>();
//Getting only the Favorite Movies from the database
while (cursor.moveToNext()) {
id = cursor.getInt(0);
String title = cursor.getString(1);
year = cursor.getInt(2);
director = cursor.getString(3);
cast = cursor.getString(4);
rating = cursor.getInt(5);
review = cursor.getString(6);
fav = cursor.getInt(7);
movie = new Movie(title, director, cast, review, year, rating);
movie.setId(id);
movie.setSelected(fav);
list.add(movie);
}
return list;
}
public Movie getMovieData(int movieId) {
// Making the connection for getting data
liteDatabase = getReadableDatabase();
//Fetching data by id from a data base
Cursor cursor = liteDatabase.rawQuery("SELECT * FROM " + DATABASE_TABLE +
" WHERE _id = " + movieId, null);
Movie movie = null;
//Assigning fetched data to the data which will be just a single movie object
while (cursor.moveToNext()) {
int id = cursor.getInt(0);
String title = cursor.getString(1);
int year = cursor.getInt(2);
String director = cursor.getString(3);
String cast = cursor.getString(4);
int rating = cursor.getInt(5);
String review = cursor.getString(6);
int fav = cursor.getInt(7);
movie = new Movie(title, director, cast, review, year, rating);
movie.setId(id);
movie.setSelected(fav);
}
return movie;
}
public void updateMovie(Movie movie) {
//Writing to the Database
liteDatabase = getWritableDatabase();
id = movie.getId();
title = movie.getTitle();
fav = movie.getSelected();
year = movie.getYear();
director = movie.getDirector();
cast = movie.getCast();
review = movie.getReview();
rating = movie.getRating();
//Updating the database after the user edits the fields from the UI
liteDatabase.execSQL("UPDATE movies SET mov_name = '" + title +
"',mov_fav = " + fav + ",mov_year = " +
year + ",mov_dir = '" + director + "',mov_cast = '" + cast + "',mov_review = '" + review +
"',mov_rating = " + rating + " WHERE _id = " + id);
}
public ArrayList<Movie> getSearchData(String keyword) {
// Making the connection for getting data
liteDatabase = getReadableDatabase();
Cursor cursor = liteDatabase.rawQuery("SELECT * FROM " + DATABASE_TABLE +
" ORDER BY mov_name ASC", null);
ArrayList<Movie> list = new ArrayList<>();
Boolean contains;
// Search for movies within the database to match the keyword the user entered.
while (cursor.moveToNext()) {
contains = cursor.getString(1).toLowerCase().contains(keyword) ||
cursor.getString(3).toLowerCase().contains(keyword) ||
cursor.getString(4).toLowerCase().contains(keyword);
//if only the keyword is contains in the database it is added to the movie object list
if (contains) {
id = cursor.getInt(0);
title = cursor.getString(1);
year = cursor.getInt(2);
director = cursor.getString(3);
cast = cursor.getString(4);
rating = cursor.getInt(5);
review = cursor.getString(6);
fav = cursor.getInt(7);
movie = new Movie(title, director, cast, review, year, rating);
movie.setId(id);
movie.setSelected(fav);
list.add(movie);
}
}
return list;
}
}
| [
"[email protected]"
] | |
675ce157b9bbf032d593b5b53175224547ff9616 | d3df25004d54f6ae14a1c140db18d071023ec656 | /src/main/java/rojbot/PhotoBot.java | ba396b3a8624c9db1dea07d1a17d6f5ba50315b5 | [] | no_license | ormeno/R_1 | b3bf41c838f2ccff45a4a212d006f6c132828594 | 49bae31a7dcb1ca29311450a296d2cb28c70338b | refs/heads/master | 2020-04-30T23:18:07.060471 | 2019-03-29T13:27:02 | 2019-03-29T13:27:02 | 177,140,582 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,300 | java | package rojbot;
import org.telegram.telegrambots.meta.api.methods.send.SendMessage;
import org.telegram.telegrambots.meta.api.methods.send.SendPhoto;
import org.telegram.telegrambots.meta.api.objects.PhotoSize;
import org.telegram.telegrambots.meta.api.objects.Update;
import org.telegram.telegrambots.meta.api.objects.replykeyboard.ReplyKeyboardMarkup;
import org.telegram.telegrambots.meta.api.objects.replykeyboard.ReplyKeyboardRemove;
import org.telegram.telegrambots.meta.api.objects.replykeyboard.buttons.KeyboardRow;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import org.telegram.telegrambots.bots.DefaultBotOptions;
import org.telegram.telegrambots.bots.TelegramLongPollingBot;
import org.telegram.telegrambots.meta.exceptions.TelegramApiException;
public class PhotoBot extends TelegramLongPollingBot {
protected PhotoBot(DefaultBotOptions botOptions) {
super(botOptions);
}
@Override
public void onUpdateReceived(Update update) {
// We check if the update has a message and the message has text
if (update.hasMessage() && update.getMessage().hasText()) {
// Set variables
String message_text = update.getMessage().getText();
long chat_id = update.getMessage().getChatId();
if (message_text.equals("/start")) {
// User send /start
SendMessage message = new SendMessage() // Create a message object object
.setChatId(chat_id)
.setText(message_text);
try {
execute(message); // Sending our message object to user
} catch (TelegramApiException e) {
e.printStackTrace();
}
} else if (message_text.equals("/consulta")) {
// Se envia contenido de la tabla autors
database db = new database();
Connection con = db.connect();
String resultado = "";
try {
PreparedStatement pst = con.prepareStatement("SELECT * FROM authors");
ResultSet rs = pst.executeQuery();
while (rs.next()) {
resultado = resultado + rs.getInt(1) + " - " + rs.getString(2) ;
//System.out.print(rs.getInt(1));
//System.out.print(": ");
//System.out.println(rs.getString(2));
}
} catch (SQLException ex) {
System.out.println("Error SQL: " + ex);
//Logger lgr = Logger.getLogger(JavaPostgreSqlRetrieve.class.getName());
//lgr.log(Level.SEVERE, ex.getMessage(), ex);
}
SendMessage msgQuery = new SendMessage() // Create a message object object
.setChatId(chat_id)
.setText(resultado);
try {
execute(msgQuery); // Call method to send the photo
} catch (TelegramApiException e) {
e.printStackTrace();
}
} else if (message_text.equals("/pic")) {
// User sent /pic
SendPhoto msg = new SendPhoto()
.setChatId(chat_id)
.setPhoto("AgADBAADmK4xG69RGFGhCZgjXI9K2UwgHxsABJ3upjeuKWV2m94AAgI")
.setCaption("Photo");
try {
execute(msg); // Call method to send the photo
} catch (TelegramApiException e) {
e.printStackTrace();
}
} else if (message_text.equals("/markup")) {
SendMessage message = new SendMessage() // Create a message object object
.setChatId(chat_id)
.setText("Here is your keyboard");
// Create ReplyKeyboardMarkup object
ReplyKeyboardMarkup keyboardMarkup = new ReplyKeyboardMarkup();
// Create the keyboard (list of keyboard rows)
List<KeyboardRow> keyboard = new ArrayList<>();
// Create a keyboard row
KeyboardRow row = new KeyboardRow();
// Set each button, you can also use KeyboardButton objects if you need something else than text
row.add("Row 1 Button 1");
row.add("Row 1 Button 2");
row.add("Row 1 Button 3");
// Add the first row to the keyboard
keyboard.add(row);
// Create another keyboard row
row = new KeyboardRow();
// Set each button for the second line
row.add("Row 2 Button 1");
row.add("Row 2 Button 2");
row.add("Row 2 Button 3");
// Add the second row to the keyboard
keyboard.add(row);
// Set the keyboard to the markup
keyboardMarkup.setKeyboard(keyboard);
// Add it to the message
message.setReplyMarkup(keyboardMarkup);
try {
execute(message); // Sending our message object to user
} catch (TelegramApiException e) {
e.printStackTrace();
}
} else if (message_text.equals("Row 1 Button 1")) {
SendPhoto msg = new SendPhoto()
.setChatId(chat_id)
.setPhoto("AgADBAADmK4xG69RGFGhCZgjXI9K2UwgHxsABJ3upjeuKWV2m94AAgI")
.setCaption("Photo");
SendMessage msg2 = new SendMessage()
.setChatId(chat_id)
.setText("VAMOS");
try {
execute(msg); // Call method to send the photo
execute(msg2);
} catch (TelegramApiException e) {
e.printStackTrace();
}
} else if (message_text.equals("/hide")) {
SendMessage msg = new SendMessage()
.setChatId(chat_id)
.setText("Keyboard hidden");
ReplyKeyboardRemove keyboardMarkup = new ReplyKeyboardRemove();
msg.setReplyMarkup(keyboardMarkup);
try {
execute(msg); // Call method to send the photo
} catch (TelegramApiException e) {
e.printStackTrace();
}
}
else {
// Unknown command
SendMessage message = new SendMessage() // Create a message object object
.setChatId(chat_id)
.setText("Unknown command");
try {
execute(message); // Sending our message object to user
} catch (TelegramApiException e) {
e.printStackTrace();
}
}
} else if (update.hasMessage() && update.getMessage().hasPhoto()) {
// Message contains photo
// Set variables
long chat_id = update.getMessage().getChatId();
// Array with photo objects with different sizes
// We will get the biggest photo from that array
List<PhotoSize> photos = update.getMessage().getPhoto();
// Know file_id
String f_id = photos.stream()
.sorted(Comparator.comparing(PhotoSize::getFileSize).reversed())
.findFirst()
.orElse(null).getFileId();
// Know photo width
int f_width = photos.stream()
.sorted(Comparator.comparing(PhotoSize::getFileSize).reversed())
.findFirst()
.orElse(null).getWidth();
// Know photo height
int f_height = photos.stream()
.sorted(Comparator.comparing(PhotoSize::getFileSize).reversed())
.findFirst()
.orElse(null).getHeight();
// Set photo caption
String caption = "file_id: " + f_id + "\nwidth: " + Integer.toString(f_width) + "\nheight: " + Integer.toString(f_height);
SendPhoto msg = new SendPhoto()
.setChatId(chat_id)
.setPhoto(f_id)
.setCaption(caption);
try {
execute(msg); // Call method to send the photo with caption
} catch (TelegramApiException e) {
e.printStackTrace();
}
}
}
@Override
public String getBotUsername() {
// Return bot username
// If bot username is @MyAmazingBot, it must return 'MyAmazingBot'
return "OrmenoBot";
}
@Override
public String getBotToken() {
// Return bot token from BotFather
return "584953347:AAHVkaPORXeYADLarPmKEOAR2WKyW_sLiUU";
}
}
| [
"[email protected]"
] | |
29f7671ea4eeeec330749a3fa1f2052c17f177a5 | 05542e2cda404697913c65bef9764454543b0ed5 | /src/day10/inherit/player/Mage.java | a62d2fc79e99547373a12b8119303f53fc17c493 | [] | no_license | pfull-coder/java_study | b75610570826c3d618fac9d9b3a05aeb25167af6 | e95ca6d99f49492df362734a9fcf5d8742b9ee89 | refs/heads/master | 2023-03-12T03:32:38.480219 | 2021-02-26T02:42:38 | 2021-02-26T02:42:38 | 334,021,104 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 277 | java | package day10.inherit.player;
public class Mage extends Player {
int mana;
public Mage() {
super("마법사", 1,50);
}
void meteo() {}
@Override
void info() {
super.info();
System.out.println("# 마력: " + this.mana);
}
} | [
"[email protected]"
] | |
ceba24fb2cb6d63ad7628d413a806b6817815399 | 54ef079676a462a75a321d73fe20eb0ef45c01d1 | /src/servlets/ServletAlumno.java | 11b83da737014ae6d01dfb1bc6c15b3d281247f5 | [] | no_license | JulioLimache/Proyecto_Voluntariado | a00b061b285fc67d81f3c04dd91e34eb9fc6ef3e | 95d2ef0938270ed6c3c80f8465003c8bd8c28347 | refs/heads/master | 2021-07-23T14:42:03.124584 | 2017-10-19T02:58:39 | 2017-10-19T02:58:39 | 107,610,337 | 0 | 0 | null | 2017-10-19T23:46:54 | 2017-10-19T23:46:54 | null | ISO-8859-10 | Java | false | false | 2,667 | java | package servlets;
import java.io.IOException;
import java.text.ParseException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import beans.AlumnoDTO;
import beans.UsuarioDTO;
import service.AlumnoService;
import service.UsuarioService;
/**
* Servlet implementation class ServletAlumno
*/
@WebServlet("/ServletAlumno")
public class ServletAlumno extends HttpServlet {
private static final long serialVersionUID = 1L;
UsuarioService serviceUsuario = new UsuarioService();
AlumnoService service =new AlumnoService();
/**
* @see HttpServlet#HttpServlet()
*/
public ServletAlumno() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response)
*/
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String xtipo = request.getParameter("tipo");
if(xtipo.equals("registrar"))
registrar(request,response);
}
private void registrar(HttpServletRequest request, HttpServletResponse response) {
String codigo = request.getParameter("codigo");
String nombre = request.getParameter("nombre");
String apellido = request.getParameter("apellido"); //aņadir en interfaz
String carrera = request.getParameter("carrera"); //debe ser el codigo carrera el value del combo
String seccion = request.getParameter("seccion"); //debe ser el codigo seccion el value del combo
String fono = request.getParameter("fono");
String correo = request.getParameter("correo");
UsuarioDTO usuario = new UsuarioDTO();
usuario.setCodigo(codigo);
usuario.setNombre(nombre);
usuario.setApellido(apellido);
usuario.setTelefono(fono);
usuario.setEstado(10); //10 activo, 11 inactivo fijo en bd
usuario.setLogin(codigo);
usuario.setPassword(codigo);
usuario.setCorreo(correo);
AlumnoDTO alumno = new AlumnoDTO();
alumno.setCodigo_usuario(codigo); //igual
alumno.setCodigo(codigo);
alumno.setCarrera(Integer.parseInt(carrera));
alumno.setSeccion(Integer.parseInt(seccion));
//se actualiza luego por una actividad existente
alumno.setCod_actividad(0);
serviceUsuario.insertarUsuario(usuario); //siempre crear usuario primero
service.insertarAlumno(alumno);
//request.setAttribute("msg", "Usuario no existe...");
// request.getRequestDispatcher("login.jsp").forward(request, response);
}
}
| [
"[email protected]"
] | |
a0efa9418dd16b34b1b939f0b267d882d725a07f | adaad49512645463be44a148a82026d4cf11aea2 | /modules/andes-core/common/src/main/java/org/wso2/andes/framing/ContentHeaderBodyFactory.java | ad1cd460fc874c60374469734fa8b97329f479c4 | [
"Apache-2.0"
] | permissive | isurulucky/andes | d0ec4a036124060363c25e50f95537271308e842 | 0d23e9507a8e3076cb3789c42d3539cd80c744e9 | refs/heads/master | 2022-06-03T00:37:00.994308 | 2022-05-31T04:26:11 | 2022-05-31T04:26:11 | 66,438,011 | 0 | 0 | Apache-2.0 | 2022-05-31T04:18:05 | 2016-08-24T06:41:47 | Java | UTF-8 | Java | false | false | 1,731 | java | /*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
package org.wso2.andes.framing;
import org.apache.mina.common.ByteBuffer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ContentHeaderBodyFactory implements BodyFactory
{
private static final Logger _log = LoggerFactory.getLogger(AMQMethodBodyFactory.class);
private static final ContentHeaderBodyFactory _instance = new ContentHeaderBodyFactory();
public static ContentHeaderBodyFactory getInstance()
{
return _instance;
}
private ContentHeaderBodyFactory()
{
_log.debug("Creating content header body factory");
}
public AMQBody createBody(ByteBuffer in, long bodySize) throws AMQFrameDecodingException
{
// all content headers are the same - it is only the properties that differ.
// the content header body further delegates construction of properties
return new ContentHeaderBody(in, bodySize);
}
}
| [
"[email protected]"
] | |
e777196efd1503960214f4191410b04e97fd54b8 | 2fd1b33dd3110777e9b41ee1371daf12a749a9ee | /Chap15/src/EyeHandCoordination.java | 93d847e60cda88964ecf2604049b9fafde0dd941 | [] | no_license | HULLZHU/eclipse-workspace | 04c474c3cdfdfc79567342974ef04c037e684fae | 3989116abd9a994336e649af11650761693e92c3 | refs/heads/master | 2021-06-09T18:34:17.479825 | 2019-11-05T20:39:05 | 2019-11-05T20:39:05 | 145,763,364 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,408 | java | import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class EyeHandCoordination extends Application {
private Pane pane = new Pane();
private Circle circle1 = new Circle(10);
private Circle circle2 = new Circle(10);
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
long startTime = System.currentTimeMillis();
circle1.setFill(Color.color(Math.random(), Math.random(), Math.random()));
pane.getChildren().add(circle1);
circle1.setCenterX(200*Math.random());
circle1.setCenterY(200*Math.random());
circle1.setOnMouseClicked( e->{
pane.getChildren().clear();
pane.getChildren().add(circle2);
circle2.setCenterX(200*Math.random());
circle2.setCenterY(200*Math.random());
});
circle2.setOnMouseClicked( e->{
pane.getChildren().clear();
Text text = new Text();
long endTime = System.currentTimeMillis();
text.setText("The Time Spend IS "+(endTime-startTime)+" MilliSeconds");
pane.getChildren().add(text);
text.setX(100);
text.setY(100);
});
Scene scene = new Scene(pane,400,400);
primaryStage.setScene(scene);
primaryStage.show();
}
}
| [
"[email protected]"
] | |
163e78a3cd3863b2d38ea31a11dd71c9389622aa | 96f51591d0c0a71a1f67668a844d17c45fc5a3e1 | /src/test/java/com/timshaya/springboot/web/TodoApp/TodoAppApplicationTests.java | 57680640cc9bcbf08ff217a11b1c1ca3a7b52d49 | [] | no_license | timshaya/TodoApp | 201482b767caf73f398bcdb401424e7f960a3f89 | 7dd2a58e26349dca522bf8d063787d74dbfe86a4 | refs/heads/master | 2020-04-08T09:48:11.414501 | 2018-11-28T19:37:40 | 2018-11-28T19:37:40 | 159,240,324 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 353 | java | package com.timshaya.springboot.web.TodoApp;
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 TodoAppApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"[email protected]"
] | |
d33a93277fe1a1b8f5a003dcc66f7cd2abecfcff | 18ad8213a95cce1d8c3e10188f9f605f2f2e77d6 | /Core-2/Core-2/CompositionEncapsulationPolymorphism/src/main/java/com/purplewisteria/CompositionEncapsulationPolymorphism/polymorphism/ex01/CrossCountryMountainBike.java | 8899c382e24eda305a0d4b6b89774520996f1353 | [] | no_license | vishucloud/Project_1 | 3a52f507f3f0322286d05bbc9ab0f463cfa5364a | 48cf1d4877ba421a4af3f8215536b9ce05cf5d9e | refs/heads/master | 2023-04-14T06:53:34.913898 | 2021-04-28T20:39:32 | 2021-04-28T20:39:32 | 362,598,377 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 431 | java | package com.purplewisteria.CompositionEncapsulationPolymorphism.polymorphism.ex01;
public class CrossCountryMountainBike extends Bike {
public CrossCountryMountainBike(String bikeType, String model, double price) {
super(bikeType, model, price);
// TODO Auto-generated constructor stub
}
@Override
public String showBikeDetails () {
return "Cross Country Mountain Bike: " + "\n" + super.showBikeDetails();
}
}
| [
"[email protected]"
] | |
b366d5fe65b7163306f455abf9669cbe5cf6daf5 | 8eeca7aa9f558d575e7db306bd708302c61ccc79 | /Midterm/app/src/main/java/hu/cai/ait/midterm/MainActivity.java | add1fbde7dca00e5f0ebe9e68bb0119df788d454 | [] | no_license | Cai-Glencross/AndroidProjects | eff918e364c4fc01a5c28ff7a5226720aaa3a0d8 | 70cd7c6abe133143b6ba2885f295f094d90be918 | refs/heads/master | 2022-03-12T21:33:53.433610 | 2017-04-09T12:57:45 | 2017-04-09T12:57:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,707 | java | package hu.cai.ait.midterm;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Layout;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.ToggleButton;
import org.w3c.dom.Text;
public class MainActivity extends AppCompatActivity {
private EditText etName;
private EditText etAmt;
private Button btnSave;
private ToggleButton btnIncome;
private Button btnClear;
private LinearLayout scrollLayout;
private TextView tvBalance;
private float balance;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
etName = (EditText) findViewById(R.id.etName);
etAmt = (EditText) findViewById(R.id.etAmt);
btnSave = (Button) findViewById(R.id.btnSave);
btnIncome = (ToggleButton) findViewById(R.id.btnIncome);
scrollLayout = (LinearLayout) findViewById(R.id.scrollLayout);
btnClear = (Button) findViewById(R.id.btnClear);
tvBalance = (TextView) findViewById(R.id.tvBalance);
balance = 0;
btnSave.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(!etName.getText().toString().equals("") &&
(!etAmt.getText().toString().equals("") && !etAmt.getText().toString().equals(getString(R.string.amount)))) {
final View item = getLayoutInflater().inflate(R.layout.layout_money, null);
TextView tvName = (TextView) item.findViewById(R.id.tvName);
tvName.setText(etName.getText());
TextView tvAmt = (TextView) item.findViewById(R.id.tvAmt);
tvAmt.setText(getString(R.string.dollaSign) + etAmt.getText());
ImageView imgIcon = (ImageView) item.findViewById(R.id.imgIcon);
if (btnIncome.isChecked()) {
imgIcon.setImageResource(R.drawable.expense_icon);
balance -= Float.parseFloat(etAmt.getText().toString());
tvBalance.setText(getString(R.string.balancePrecursor)+ Float.toString(balance));
} else {
imgIcon.setImageResource(R.drawable.income_icon);
balance += Float.parseFloat(etAmt.getText().toString());
tvBalance.setText(getString(R.string.balancePrecursor)+ Float.toString(balance));
}
scrollLayout.addView(item);
etAmt.setText("");
etName.setText("");
}else{
if (etName.getText().toString().equals("")){
etName.setError(getString(R.string.nameError));
}
if (etAmt.getText().toString().equals("")||etAmt.getText().toString().equals(getString(R.string.amount))){
etAmt.setError(getString(R.string.AmtError));
}
}
}
});
btnClear.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
scrollLayout.removeAllViews();
balance = 0;
tvBalance.setText(getString(R.string.balancePrecursor)+ Float.toString(balance));
}
});
}
}
| [
"[email protected]"
] | |
a3757e342f0153fe59a16149a957cbd5c26e5302 | e82c1473b49df5114f0332c14781d677f88f363f | /MED-CLOUD/med-data/src/main/java/nta/med/data/dao/medi/cpl/Cpl0608RepositoryCustom.java | 1a700eaadaffd0b879e470a7608a404f718ff825 | [] | no_license | zhiji6/mih | fa1d2279388976c901dc90762bc0b5c30a2325fc | 2714d15853162a492db7ea8b953d5b863c3a8000 | refs/heads/master | 2023-08-16T18:35:19.836018 | 2017-12-28T09:33:19 | 2017-12-28T09:33:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 112 | java | package nta.med.data.dao.medi.cpl;
/**
* @author dainguyen.
*/
public interface Cpl0608RepositoryCustom {
}
| [
"[email protected]"
] | |
470287d0a1bf459e3cb27dc91159a93a3040673b | bd1f79f99474bbb1efbdb65d1cf8c7ec157caa01 | /cineast-api/src/main/java/org/vitrivr/cineast/api/rest/handlers/actions/segment/FindSegmentsByIdGetHandler.java | cf208a7dc904fefe0e169da897b67a122548a67d | [
"MIT"
] | permissive | mpas97/cineast | 83084d7390ea4ae5fd1c40f44aeef01fac1d0129 | 82e3df6663ca5c3538ce0d2fe2a9421651b5eecd | refs/heads/dev | 2022-12-27T21:15:20.781110 | 2020-09-14T11:38:32 | 2020-09-14T11:38:32 | 255,859,359 | 0 | 0 | MIT | 2020-09-22T09:36:19 | 2020-04-15T08:54:35 | Java | UTF-8 | Java | false | false | 2,141 | java | package org.vitrivr.cineast.api.rest.handlers.actions.segment;
import io.javalin.http.Context;
import io.javalin.plugin.openapi.dsl.OpenApiBuilder;
import io.javalin.plugin.openapi.dsl.OpenApiDocumentation;
import org.vitrivr.cineast.api.messages.result.MediaSegmentQueryResult;
import org.vitrivr.cineast.api.rest.handlers.interfaces.GetRestHandler;
import org.vitrivr.cineast.core.data.entities.MediaSegmentDescriptor;
import org.vitrivr.cineast.core.db.dao.reader.MediaSegmentReader;
import org.vitrivr.cineast.standalone.config.Config;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class FindSegmentsByIdGetHandler implements GetRestHandler<MediaSegmentQueryResult> {
public static final String ID_NAME = "id";
public static final String ROUTE = "find/segments/by/id/:" + ID_NAME;
@Override
public MediaSegmentQueryResult doGet(Context ctx) {
final Map<String, String> parameters = ctx.pathParamMap();
final String segmentId = parameters.get(ID_NAME);
final MediaSegmentReader sl = new MediaSegmentReader(Config.sharedConfig().getDatabase().getSelectorSupplier().get());
final List<MediaSegmentDescriptor> list = sl.lookUpSegment(segmentId).map(s -> {
final List<MediaSegmentDescriptor> segments = new ArrayList<>(1);
segments.add(s);
return segments;
}).orElse(new ArrayList<>(0));
sl.close();
return new MediaSegmentQueryResult("", list);
}
@Override
public Class<MediaSegmentQueryResult> outClass() {
return MediaSegmentQueryResult.class;
}
@Override
public String route() {
return ROUTE;
}
@Override
public OpenApiDocumentation docs() {
return OpenApiBuilder.document()
.operation(op -> {
op.summary("Finds segments for specified id");
op.description("Finds segments for specified id");
op.operationId("findSegmentById");
op.addTagsItem("Segment");
})
.pathParam(ID_NAME, String.class, p -> p.description("The id of the segments"))
.json("200", outClass());
}
}
| [
"[email protected]"
] | |
cbd4039101dbad4c823d6e6580f779bddd8471bf | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-13316-6-3-FEMO-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/internal/template/InternalTemplateManager_ESTest.java | 240448866d6750f86d37fa69cae88109515695cf | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 584 | java | /*
* This file was automatically generated by EvoSuite
* Fri Apr 03 23:51:55 UTC 2020
*/
package com.xpn.xwiki.internal.template;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class InternalTemplateManager_ESTest extends InternalTemplateManager_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"[email protected]"
] | |
fce6ba77a030d36023052b44d8b310ff0828d633 | 99c14585111f3c73a305242473b6e7a79a5743f8 | /src/main/old/com/workasintended/chromaggus/ai/behavior/FindClosestCity.java | c264ba1418ed8184d1b318e3ac91b1f43fdb7245 | [] | no_license | mazimeng/chromaggus | 3a5fdb68108a6d50c5d8f1636519cd8752a9309e | 912ae7fdf50d46dc7f312b812af4339b327a4c2a | refs/heads/master | 2021-01-16T18:33:02.030430 | 2017-09-17T15:43:41 | 2017-09-17T15:43:41 | 100,087,622 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,115 | java | package com.workasintended.chromaggus.ai.behavior;
import com.badlogic.gdx.ai.btree.LeafTask;
import com.badlogic.gdx.ai.btree.Task;
import com.badlogic.gdx.utils.Predicate;
import com.workasintended.chromaggus.Unit;
import com.workasintended.chromaggus.WorldStage;
/**
* Created by mazimeng on 5/2/16.
*/
public abstract class FindClosestCity extends LeafTask<Blackboard> {
@Override
public Task.Status execute() {
final Blackboard b = getObject();
WorldStage worldStage = b.getWorldStage();
Unit city = b.getTarget();
if(city == null || city.city == null) {
city = b.findNearest(worldStage.getUnits(), new Predicate<Unit>() {
@Override
public boolean evaluate(Unit u) {
return u.city!=null && filter(u);
}
});
}
b.setTarget(city);
return city!=null?
Task.Status.SUCCEEDED : Task.Status.FAILED;
}
protected abstract boolean filter(Unit city);
@Override
protected Task copyTo(Task task) {
return task;
}
}
| [
"[email protected]"
] | |
ce85d465d41762307703a9845d3fe9757fb296df | d4757083d1b938a23d97a1158ed16f510634799f | /алгоритмы и структуры данных + установка Java/src/JavaCore/laba1_2/Part2/WorkWithArray.java | a572681f461784a9fc4ed9410ba69526b8ffcf41 | [] | no_license | DmitryiIvanoff/learn | 8cc0d1542e9ef7ac8d22e989fd16d666cabc5794 | 1280a52e9a841a935f63500c8c7572219dc8b667 | refs/heads/master | 2021-04-29T22:11:34.444634 | 2018-02-17T13:48:46 | 2018-02-17T13:48:46 | 121,631,007 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,324 | java | package JavaCore.laba1_2.Part2;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class WorkWithArray {
public int[] parseArray(String string){
int[] array;
String[] arrayOfStrings = string.split("\\D+");
int length = 0;
for (int i = 0; i < arrayOfStrings.length; i++) {
if(arrayOfStrings[i].equals("")){
length--;
}
else{
length++;
}
}
array = new int[length + 1];
for (int i = 0 , j = 0; i < arrayOfStrings.length; i++) {
if(!arrayOfStrings[i].equals("")) {
array[j] = Integer.parseInt(arrayOfStrings[i]);
j++;
}
}
return array;
}
public double[] parseArrayDouble(String string){
double[] array;
String[] arrayOfStrings = string.split("[^\\d\\.]+" );
int length = 0;
for (int i = 0; i < arrayOfStrings.length; i++) {
if(arrayOfStrings[i].equals("")){
length--;
}
else{
length++;
}
}
array = new double[length + 1];
for (int i = 0 , j = 0; i < arrayOfStrings.length; i++) {
if(!arrayOfStrings[i].equals("")) {
try {
Pattern p = Pattern.compile("^\\.{1,}$");
Matcher m = p.matcher(arrayOfStrings[i]);
if(m.find()){
throw new ExceptionNotNumber(arrayOfStrings[i]);
}
array[j] = Double.parseDouble(arrayOfStrings[i]);
}
catch (ExceptionNotNumber t){
System.out.println("ne tot format chisla: " + t.getMessage());
System.exit(1);
}
j++;
}
}
return array;
}
public int[] generateArray(int count){
int[] array = new int[count];
for (int i= 0; i < count; i++) {
array[i] = (int)(Math.random()*100);
}
return array;}
public static double getSumSinuses(double[] angles, int type){
double sum = 0;
if(type == 1){
for (double d:angles) {
sum += Math.sin(d);
}
}else {
for (double d:angles) {
sum += (Math.sin(d * 180 / Math.PI));
}
}
return sum;}
public static double getSumCosines(double[] angles, int type){
double sum = 0;
if(type == 1){
for (double d:angles) {
sum += Math.cos(d);
}
}else {
for (double d:angles) {
sum += (Math.cos(d * 180 / Math.PI));
}
}
return sum;}
public static double getSubstractionCosines(double[] angles, int type){
double sub = 0;
if(type == 1){
for (double d:angles) {
sub += Math.cos(d);
}
}else {
for (double d:angles) {
sub -= (Math.cos(d * 180 / Math.PI));
}
}
return sub;}
public static double getSubstractionSines(double[] angles, int type){
double sub = 0;
if(type == 1){
for (double d:angles) {
sub += Math.sin(d);
}
}else {
for (double d:angles) {
sub -= (Math.sin(d * 180 / Math.PI));
}
}
return sub;}
public static double getSumSinuses(double[] angles, int type, int decimals){
double sum = 0;
if(type == 1){
for (double d:angles) {
sum += Math.sin(d);
}
}else {
for (double d:angles) {
sum += (Math.sin(d * 180 / Math.PI));
}
}
double d = new BigDecimal(sum).setScale(decimals,BigDecimal.ROUND_HALF_EVEN).doubleValue();
return d;}
public void print(double[] array){
for (double r: array) {
System.out.print(r + " ");
}
System.out.println();
}
}
| [
"[email protected]"
] | |
be5b99dd7a887b34ab979ae2d6f5a496e95a8c02 | 385e3414ccb7458bbd3cec326320f11819decc7b | /frameworks/base/services/core/java/com/android/server/statusbar/StatusBarManagerService.java | 9d2353c003460e0d1e072e6e9f04108e070766f5 | [
"LicenseRef-scancode-unicode",
"Apache-2.0"
] | permissive | carlos22211/Tango_AL813 | 14de7f2693c3045b9d3c0cb52017ba2bb6e6b28f | b50b1b7491dc9c5e6b92c2d94503635c43e93200 | refs/heads/master | 2020-03-28T08:09:11.127995 | 2017-06-26T05:05:29 | 2017-06-26T05:05:29 | 147,947,860 | 1 | 0 | null | 2018-09-08T15:55:46 | 2018-09-08T15:55:45 | null | UTF-8 | Java | false | false | 28,634 | java | /*
* Copyright (C) 2014 MediaTek Inc.
* Modification based on code covered by the mentioned copyright
* and/or permission notice(s).
*/
/*
* Copyright (C) 2007 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.server.statusbar;
import android.app.StatusBarManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.util.Slog;
import android.view.KeyEvent;
import com.android.internal.statusbar.IStatusBar;
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.statusbar.StatusBarIcon;
import com.android.internal.statusbar.StatusBarIconList;
import com.android.server.LocalServices;
import com.android.server.notification.NotificationDelegate;
import com.android.server.wm.WindowManagerService;
import com.mediatek.common.dm.DmAgent; /// M: DM Lock Feature.
import com.mediatek.xlog.Xlog;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
/**
* A note on locking: We rely on the fact that calls onto mBar are oneway or
* if they are local, that they just enqueue messages to not deadlock.
*/
public class StatusBarManagerService extends IStatusBarService.Stub {
private static final String TAG = "StatusBarManagerService";
private static final boolean SPEW = false;
private final Context mContext;
private final WindowManagerService mWindowManager;
private Handler mHandler = new Handler();
private NotificationDelegate mNotificationDelegate;
private volatile IStatusBar mBar;
private StatusBarIconList mIcons = new StatusBarIconList();
// for disabling the status bar
private final ArrayList<DisableRecord> mDisableRecords = new ArrayList<DisableRecord>();
private IBinder mSysUiVisToken = new Binder();
private int mDisabled = 0;
private Object mLock = new Object();
// encompasses lights-out mode and other flags defined on View
private int mSystemUiVisibility = 0;
private boolean mMenuVisible = false;
private int mImeWindowVis = 0;
private int mImeBackDisposition;
private boolean mShowImeSwitcher;
private IBinder mImeToken = null;
private int mCurrentUserId;
private class DisableRecord implements IBinder.DeathRecipient {
int userId;
String pkg;
int what;
IBinder token;
public void binderDied() {
Slog.i(TAG, "binder died for pkg=" + pkg);
disableInternal(userId, 0, token, pkg);
token.unlinkToDeath(this, 0);
}
}
/**
* Construct the service, add the status bar view to the window manager
*/
public StatusBarManagerService(Context context, WindowManagerService windowManager) {
mContext = context;
mWindowManager = windowManager;
final Resources res = context.getResources();
mIcons.defineSlots(res.getStringArray(com.android.internal.R.array.config_statusBarIcons));
LocalServices.addService(StatusBarManagerInternal.class, mInternalService);
/// M: DM Lock Feature.
registerDMLock();
}
/**
* Private API used by NotificationManagerService.
*/
private final StatusBarManagerInternal mInternalService = new StatusBarManagerInternal() {
private boolean mNotificationLightOn;
@Override
public void setNotificationDelegate(NotificationDelegate delegate) {
mNotificationDelegate = delegate;
}
@Override
public void buzzBeepBlinked() {
if (mBar != null) {
try {
mBar.buzzBeepBlinked();
} catch (RemoteException ex) {
}
}
}
@Override
public void notificationLightPulse(int argb, int onMillis, int offMillis) {
mNotificationLightOn = true;
if (mBar != null) {
try {
mBar.notificationLightPulse(argb, onMillis, offMillis);
} catch (RemoteException ex) {
}
}
}
@Override
public void notificationLightOff() {
if (mNotificationLightOn) {
mNotificationLightOn = false;
if (mBar != null) {
try {
mBar.notificationLightOff();
} catch (RemoteException ex) {
}
}
}
}
@Override
public void showScreenPinningRequest() {
if (mBar != null) {
try {
mBar.showScreenPinningRequest();
} catch (RemoteException e) {
}
}
}
};
// ================================================================================
// From IStatusBarService
// ================================================================================
@Override
public void expandNotificationsPanel() {
enforceExpandStatusBar();
if (mBar != null) {
try {
mBar.animateExpandNotificationsPanel();
} catch (RemoteException ex) {
}
}
}
@Override
public void collapsePanels() {
enforceExpandStatusBar();
if (mBar != null) {
try {
mBar.animateCollapsePanels();
} catch (RemoteException ex) {
}
}
}
@Override
public void expandSettingsPanel() {
enforceExpandStatusBar();
if (mBar != null) {
try {
mBar.animateExpandSettingsPanel();
} catch (RemoteException ex) {
}
}
}
@Override
public void disable(int what, IBinder token, String pkg) {
disableInternal(mCurrentUserId, what, token, pkg);
}
private void disableInternal(int userId, int what, IBinder token, String pkg) {
enforceStatusBar();
synchronized (mLock) {
disableLocked(userId, what, token, pkg);
}
}
private void disableLocked(int userId, int what, IBinder token, String pkg) {
// It's important that the the callback and the call to mBar get done
// in the same order when multiple threads are calling this function
// so they are paired correctly. The messages on the handler will be
// handled in the order they were enqueued, but will be outside the lock.
manageDisableListLocked(userId, what, token, pkg);
// Ensure state for the current user is applied, even if passed a non-current user.
final int net = gatherDisableActionsLocked(mCurrentUserId);
if (net != mDisabled) {
mDisabled = net;
mHandler.post(new Runnable() {
public void run() {
mNotificationDelegate.onSetDisabled(net);
}
});
if (mBar != null) {
try {
/// M:[ALPS01673960] Fix User cannot drag down the notification bar.
Slog.d(TAG, "disable statusbar calling PID = " + Binder.getCallingPid());
mBar.disable(net);
} catch (RemoteException ex) {
}
}
}
}
@Override
public void setIcon(String slot, String iconPackage, int iconId, int iconLevel,
String contentDescription) {
enforceStatusBar();
synchronized (mIcons) {
int index = mIcons.getSlotIndex(slot);
if (index < 0) {
throw new SecurityException("invalid status bar icon slot: " + slot);
}
StatusBarIcon icon = new StatusBarIcon(iconPackage, UserHandle.OWNER, iconId,
iconLevel, 0,
contentDescription);
//Slog.d(TAG, "setIcon slot=" + slot + " index=" + index + " icon=" + icon);
mIcons.setIcon(index, icon);
if (mBar != null) {
try {
mBar.setIcon(index, icon);
} catch (RemoteException ex) {
}
}
}
}
@Override
public void setIconVisibility(String slot, boolean visible) {
enforceStatusBar();
synchronized (mIcons) {
int index = mIcons.getSlotIndex(slot);
if (index < 0) {
throw new SecurityException("invalid status bar icon slot: " + slot);
}
StatusBarIcon icon = mIcons.getIcon(index);
if (icon == null) {
return;
}
if (icon.visible != visible) {
icon.visible = visible;
if (mBar != null) {
try {
mBar.setIcon(index, icon);
} catch (RemoteException ex) {
}
}
}
}
}
@Override
public void removeIcon(String slot) {
enforceStatusBar();
synchronized (mIcons) {
int index = mIcons.getSlotIndex(slot);
if (index < 0) {
throw new SecurityException("invalid status bar icon slot: " + slot);
}
mIcons.removeIcon(index);
if (mBar != null) {
try {
mBar.removeIcon(index);
} catch (RemoteException ex) {
}
}
}
}
/**
* Hide or show the on-screen Menu key. Only call this from the window manager, typically in
* response to a window with {@link android.view.WindowManager.LayoutParams#needsMenuKey} set
* to {@link android.view.WindowManager.LayoutParams#NEEDS_MENU_SET_TRUE}.
*/
@Override
public void topAppWindowChanged(final boolean menuVisible) {
enforceStatusBar();
if (SPEW) Slog.d(TAG, (menuVisible?"showing":"hiding") + " MENU key");
synchronized(mLock) {
mMenuVisible = menuVisible;
mHandler.post(new Runnable() {
public void run() {
if (mBar != null) {
try {
mBar.topAppWindowChanged(menuVisible);
} catch (RemoteException ex) {
}
}
}
});
}
}
@Override
public void setImeWindowStatus(final IBinder token, final int vis, final int backDisposition,
final boolean showImeSwitcher) {
enforceStatusBar();
if (SPEW) {
Slog.d(TAG, "swetImeWindowStatus vis=" + vis + " backDisposition=" + backDisposition);
}
synchronized(mLock) {
// In case of IME change, we need to call up setImeWindowStatus() regardless of
// mImeWindowVis because mImeWindowVis may not have been set to false when the
// previous IME was destroyed.
mImeWindowVis = vis;
mImeBackDisposition = backDisposition;
mImeToken = token;
mShowImeSwitcher = showImeSwitcher;
mHandler.post(new Runnable() {
public void run() {
if (mBar != null) {
try {
mBar.setImeWindowStatus(token, vis, backDisposition, showImeSwitcher);
} catch (RemoteException ex) {
}
}
}
});
}
}
@Override
public void setSystemUiVisibility(int vis, int mask, String cause) {
// also allows calls from window manager which is in this process.
enforceStatusBarService();
if (SPEW) Slog.d(TAG, "setSystemUiVisibility(0x" + Integer.toHexString(vis) + ")");
synchronized (mLock) {
updateUiVisibilityLocked(vis, mask);
disableLocked(
mCurrentUserId,
vis & StatusBarManager.DISABLE_MASK,
mSysUiVisToken,
cause);
}
}
private void updateUiVisibilityLocked(final int vis, final int mask) {
if (mSystemUiVisibility != vis) {
mSystemUiVisibility = vis;
mHandler.post(new Runnable() {
public void run() {
if (mBar != null) {
try {
mBar.setSystemUiVisibility(vis, mask);
} catch (RemoteException ex) {
}
}
}
});
}
}
@Override
public void toggleRecentApps() {
if (mBar != null) {
try {
mBar.toggleRecentApps();
} catch (RemoteException ex) {}
}
}
@Override
public void preloadRecentApps() {
if (mBar != null) {
try {
mBar.preloadRecentApps();
} catch (RemoteException ex) {}
}
}
@Override
public void cancelPreloadRecentApps() {
if (mBar != null) {
try {
mBar.cancelPreloadRecentApps();
} catch (RemoteException ex) {}
}
}
@Override
public void showRecentApps(boolean triggeredFromAltTab) {
if (mBar != null) {
try {
mBar.showRecentApps(triggeredFromAltTab);
} catch (RemoteException ex) {}
}
}
@Override
public void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) {
if (mBar != null) {
try {
mBar.hideRecentApps(triggeredFromAltTab, triggeredFromHomeKey);
} catch (RemoteException ex) {}
}
}
@Override
public void setCurrentUser(int newUserId) {
if (SPEW) Slog.d(TAG, "Setting current user to user " + newUserId);
mCurrentUserId = newUserId;
}
@Override
public void setWindowState(int window, int state) {
if (mBar != null) {
try {
mBar.setWindowState(window, state);
} catch (RemoteException ex) {}
}
}
private void enforceStatusBar() {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR,
"StatusBarManagerService");
}
private void enforceExpandStatusBar() {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.EXPAND_STATUS_BAR,
"StatusBarManagerService");
}
private void enforceStatusBarService() {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR_SERVICE,
"StatusBarManagerService");
}
// ================================================================================
// Callbacks from the status bar service.
// ================================================================================
@Override
public void registerStatusBar(IStatusBar bar, StatusBarIconList iconList,
int switches[], List<IBinder> binders) {
enforceStatusBarService();
Slog.i(TAG, "registerStatusBar bar=" + bar);
mBar = bar;
synchronized (mIcons) {
iconList.copyFrom(mIcons);
}
synchronized (mLock) {
switches[0] = gatherDisableActionsLocked(mCurrentUserId);
switches[1] = mSystemUiVisibility;
switches[2] = mMenuVisible ? 1 : 0;
switches[3] = mImeWindowVis;
switches[4] = mImeBackDisposition;
switches[5] = mShowImeSwitcher ? 1 : 0;
binders.add(mImeToken);
}
}
/**
* @param clearNotificationEffects whether to consider notifications as "shown" and stop
* LED, vibration, and ringing
*/
@Override
public void onPanelRevealed(boolean clearNotificationEffects) {
enforceStatusBarService();
long identity = Binder.clearCallingIdentity();
try {
mNotificationDelegate.onPanelRevealed(clearNotificationEffects);
} finally {
Binder.restoreCallingIdentity(identity);
}
}
@Override
public void clearNotificationEffects() throws RemoteException {
enforceStatusBarService();
long identity = Binder.clearCallingIdentity();
try {
mNotificationDelegate.clearEffects();
} finally {
Binder.restoreCallingIdentity(identity);
}
}
@Override
public void onPanelHidden() throws RemoteException {
enforceStatusBarService();
long identity = Binder.clearCallingIdentity();
try {
mNotificationDelegate.onPanelHidden();
} finally {
Binder.restoreCallingIdentity(identity);
}
}
@Override
public void onNotificationClick(String key) {
enforceStatusBarService();
final int callingUid = Binder.getCallingUid();
final int callingPid = Binder.getCallingPid();
long identity = Binder.clearCallingIdentity();
try {
mNotificationDelegate.onNotificationClick(callingUid, callingPid, key);
} finally {
Binder.restoreCallingIdentity(identity);
}
}
@Override
public void onNotificationActionClick(String key, int actionIndex) {
enforceStatusBarService();
final int callingUid = Binder.getCallingUid();
final int callingPid = Binder.getCallingPid();
long identity = Binder.clearCallingIdentity();
try {
mNotificationDelegate.onNotificationActionClick(callingUid, callingPid, key,
actionIndex);
} finally {
Binder.restoreCallingIdentity(identity);
}
}
@Override
public void onNotificationError(String pkg, String tag, int id,
int uid, int initialPid, String message, int userId) {
enforceStatusBarService();
final int callingUid = Binder.getCallingUid();
final int callingPid = Binder.getCallingPid();
long identity = Binder.clearCallingIdentity();
try {
// WARNING: this will call back into us to do the remove. Don't hold any locks.
mNotificationDelegate.onNotificationError(callingUid, callingPid,
pkg, tag, id, uid, initialPid, message, userId);
} finally {
Binder.restoreCallingIdentity(identity);
}
}
@Override
public void onNotificationClear(String pkg, String tag, int id, int userId) {
enforceStatusBarService();
final int callingUid = Binder.getCallingUid();
final int callingPid = Binder.getCallingPid();
long identity = Binder.clearCallingIdentity();
try {
mNotificationDelegate.onNotificationClear(callingUid, callingPid, pkg, tag, id, userId);
} finally {
Binder.restoreCallingIdentity(identity);
}
}
@Override
public void onNotificationVisibilityChanged(
String[] newlyVisibleKeys, String[] noLongerVisibleKeys) throws RemoteException {
enforceStatusBarService();
long identity = Binder.clearCallingIdentity();
try {
mNotificationDelegate.onNotificationVisibilityChanged(
newlyVisibleKeys, noLongerVisibleKeys);
} finally {
Binder.restoreCallingIdentity(identity);
}
}
@Override
public void onNotificationExpansionChanged(String key, boolean userAction,
boolean expanded) throws RemoteException {
enforceStatusBarService();
long identity = Binder.clearCallingIdentity();
try {
mNotificationDelegate.onNotificationExpansionChanged(
key, userAction, expanded);
} finally {
Binder.restoreCallingIdentity(identity);
}
}
@Override
public void onClearAllNotifications(int userId) {
enforceStatusBarService();
final int callingUid = Binder.getCallingUid();
final int callingPid = Binder.getCallingPid();
long identity = Binder.clearCallingIdentity();
try {
mNotificationDelegate.onClearAll(callingUid, callingPid, userId);
} finally {
Binder.restoreCallingIdentity(identity);
}
}
// ================================================================================
// Can be called from any thread
// ================================================================================
// lock on mDisableRecords
void manageDisableListLocked(int userId, int what, IBinder token, String pkg) {
if (SPEW) {
Slog.d(TAG, "manageDisableList userId=" + userId
+ " what=0x" + Integer.toHexString(what) + " pkg=" + pkg);
}
// update the list
final int N = mDisableRecords.size();
DisableRecord tok = null;
int i;
for (i=0; i<N; i++) {
DisableRecord t = mDisableRecords.get(i);
if (t.token == token && t.userId == userId) {
tok = t;
break;
}
}
if (what == 0 || !token.isBinderAlive()) {
if (tok != null) {
mDisableRecords.remove(i);
tok.token.unlinkToDeath(tok, 0);
}
} else {
if (tok == null) {
tok = new DisableRecord();
tok.userId = userId;
try {
token.linkToDeath(tok, 0);
}
catch (RemoteException ex) {
return; // give up
}
mDisableRecords.add(tok);
}
tok.what = what;
tok.token = token;
tok.pkg = pkg;
}
}
// lock on mDisableRecords
int gatherDisableActionsLocked(int userId) {
final int N = mDisableRecords.size();
// gather the new net flags
int net = 0;
for (int i=0; i<N; i++) {
final DisableRecord rec = mDisableRecords.get(i);
if (rec.userId == userId) {
net |= rec.what;
}
}
return net;
}
// ================================================================================
// Always called from UI thread
// ================================================================================
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP)
!= PackageManager.PERMISSION_GRANTED) {
pw.println("Permission Denial: can't dump StatusBar from from pid="
+ Binder.getCallingPid()
+ ", uid=" + Binder.getCallingUid());
return;
}
synchronized (mIcons) {
mIcons.dump(pw);
}
synchronized (mLock) {
pw.println(" mDisabled=0x" + Integer.toHexString(mDisabled));
final int N = mDisableRecords.size();
pw.println(" mDisableRecords.size=" + N);
for (int i=0; i<N; i++) {
DisableRecord tok = mDisableRecords.get(i);
pw.println(" [" + i + "] userId=" + tok.userId
+ " what=0x" + Integer.toHexString(tok.what)
+ " pkg=" + tok.pkg
+ " token=" + tok.token);
}
}
}
/** M: Support "SystemUI SIM indicator" feature. @{ */
/**
* @param businessType the type of the default SIM setting. ex. VOICE_CALL
* @param indicatorID the ID of SIM Indicator
*/
public void showSimIndicator(String businessType, long indicatorID) {
/* HQ_xionghaifeng 20150724 for HWSystemUI crash start
if (mBar != null) {
try {
Xlog.d(TAG, "showSimIndicator , businiss is " + businessType +
", indicatorID is " + indicatorID + ".");
mBar.showSimIndicator(businessType, indicatorID);
} catch (RemoteException ex) {
/// M: The exception from system server will throw exception there
Slog.e(TAG, "unable to showSimIndicator: " + businessType + " Exception:", ex);
}
}
HQ_xionghaifeng 20150724 for HWSystemUI crash end */
}
public void hideSimIndicator() {
/* HQ_xionghaifeng 20150724 for HWSystemUI crash start
if (mBar != null) {
try {
mBar.hideSimIndicator();
} catch (RemoteException ex) {
/// M: The exception from system server will throw exception there
Slog.e(TAG, "unable to hideSimIndicator: Exception:", ex);
}
}
HQ_xionghaifeng 20150724 for HWSystemUI crash end */
}
/** }@ */
/// M: [SystemUI] Support Smartbook Feature. @{
public void dispatchStatusBarKeyEvent(KeyEvent event) {
if (mBar != null) {
try {
mBar.dispatchStatusBarKeyEvent(event);
} catch (RemoteException ex) {
/// M: The exception from system server will throw exception there
Slog.e(TAG, "unable to dispatchStatusBarKeyEvent: " + event + " Exception:", ex);
}
}
}
/** }@ */
/// M: DM Lock Feature.
IBinder mDMToken = new Binder();
void registerDMLock() {
try {
IBinder binder = ServiceManager.getService("DmAgent");
if (binder != null) {
DmAgent agent = DmAgent.Stub.asInterface(binder);
boolean locked = agent.isLockFlagSet();
Xlog.i(TAG, "dm state lock is " + locked);
dmEnable(!locked);
} else {
Xlog.e(TAG, "dm binder is null!");
}
} catch (RemoteException e) {
Xlog.e(TAG, "remote error");
}
Xlog.i(TAG, "registerDMLock");
IntentFilter filter = new IntentFilter();
filter.addAction("com.mediatek.ppl.NOTIFY_LOCK");
filter.addAction("com.mediatek.ppl.NOTIFY_UNLOCK");
filter.addAction("com.mediatek.dm.LAWMO_LOCK");
filter.addAction("com.mediatek.dm.LAWMO_UNLOCK");
mContext.registerReceiver(mReceiver, filter);
}
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals("com.mediatek.ppl.NOTIFY_LOCK") ||
action.equals("com.mediatek.dm.LAWMO_LOCK")) {
dmEnable(false);
} else if (action.equals("com.mediatek.ppl.NOTIFY_UNLOCK") ||
action.equals("com.mediatek.dm.LAWMO_UNLOCK")) {
dmEnable(true);
}
}
};
private int dmEnable(boolean enable) {
Xlog.i(TAG, " enable state is " + enable);
int net = 0;
if (!enable) {
net = StatusBarManager.DISABLE_EXPAND | StatusBarManager.DISABLE_NOTIFICATION_ALERTS
| StatusBarManager.DISABLE_NOTIFICATION_ICONS
| StatusBarManager.DISABLE_NOTIFICATION_TICKER;
}
disable(net, mDMToken, mContext.getPackageName());
return 0;
}
/*< DTS2014110604349 zhaifeng/00107904 20141106 begin */
public IStatusBar getStatusBar() {
return mBar;
}
/* DTS2014110604349 zhaifeng/00107904 20141106 end >*/
}
| [
"[email protected]"
] | |
b89985142dae2cbbe905b507aab9b986cbbbb221 | 53bec2582b32ad49ac02e902395b316212ec4a1c | /APersist/src/com/ng/apersist/dao/NoIterableTypeAsToManyRelationException.java | 98ca276b31b353519d0cd4d44610483ca28e07bd | [] | no_license | gundermann/APersist | 42933da7e805436be4ccc3ea015d853edf0411f2 | bef9e055e2b7730cd46b913e549c8698abd96c0e | refs/heads/master | 2021-01-10T20:13:23.407973 | 2019-01-12T12:16:55 | 2019-01-12T12:16:55 | 35,281,056 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 384 | java | package com.ng.apersist.dao;
public class NoIterableTypeAsToManyRelationException extends Exception {
private Class<? extends Object> class1;
public NoIterableTypeAsToManyRelationException(
Class<? extends Object> class1) {
this.class1 = class1;
}
@Override
public String getMessage() {
return class1.getSimpleName() +" is not iterable";
}
}
| [
"[email protected]"
] | |
66a07f43d5b2fd194324f9e3593e6a8bf71fbb61 | 0f9028514d74feaebfd9b1a8641fc2c5ed82516a | /src/queue/CircleArrayQueue.java | 3a7b7d066e8fd0601a1c6ad1f4c20158012d7150 | [] | no_license | luxx2019/DataStructureAndAlgorithms | 3b5e59efaa0288bc16e60c9ffe518883ddcc1866 | 4094504400f717e97a8a862c45a58fc2f9f4bff3 | refs/heads/master | 2022-12-15T02:49:59.970209 | 2020-09-09T07:39:53 | 2020-09-09T07:39:53 | 294,039,414 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,129 | java | package queue;
/**
* 关于循环队列的一些想法
* 循环队列与普通队列大致相同,不同点在于,出队列和进队列时, front 和 rear 自增后需要模上数组的长度
* 此时存在一个问题需要解决,队空和队满两种情况无法做出区分,此处以头指针指向队列的头下标,尾指针指向队列尾下标进行说明
* 判空判满的的条件都是 front == (rear + 1) % arr.length
* 此时我们把队列尾部留下一个空格不用,用以区分
* 那么,此时判空条件不变,判满的条件为 front == (rear + 2) % arr.length
*
* 在debug的过程中,发现当 front 初始值为 0,rear 初始值为 -1 时,如果不进行一次出队列操作,那么就永远不会满足判满的条件
* 因为是循环队列,不在乎从数组的什么地方开始存储队列数据,更改初始值为 front = 0 , rear = size - 1
*
* 类型参数无法实例化
*/
public class CircleArrayQueue<E> implements Queue<E> {
private int size = 1000;
private int front;
private int rear;
private Object[] elements;
public CircleArrayQueue() {
elements = new Object[size];
front = 0;
rear = size - 1;
}
public CircleArrayQueue(int size) {
this.size = size;
elements = new Object[size];
front = 0;
rear = size - 1;
}
public boolean isFull() {
return front == (rear + 2) % size;
}
public boolean isEmpty() {
return front == (rear + 1) % size;
}
public boolean push(E e) {
if(isFull()) return false;
rear = (rear + 1) % size;
elements[rear] = e;
return true;
}
public E pop(){
if(isEmpty()) return null;
E e = (E) elements[front];
front = (front + 1) % size;
return e;
}
public E peek() {
if(isEmpty()) return null;
E e = (E) elements[front];
return e;
}
@Override
public int size() {
if (isEmpty()) return 0;
return rear >= front ? rear + 1 - front : rear + size + 1 - front;
}
}
| [
"[email protected]"
] | |
1bd96a56d02c80d4183bf8112ca2843b27460cea | beabf30419ef33ffeea6e661b13880064df46aed | /OO_3/src/entities8/UsedProduct.java | a442c2ebfe2c03ae79111d71107f39cb22d1a858 | [] | no_license | rodwanz/OO----AN----Un----2 | 4773eca8813f05d3ce95999151c742437b3461c8 | 0f2fc109e21cdea24ecd52962d54167b02f89779 | refs/heads/main | 2023-08-14T08:01:28.218662 | 2021-09-27T14:57:47 | 2021-09-27T14:57:47 | 410,923,950 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 834 | java | package entities8;
import java.text.SimpleDateFormat;
import java.util.Date;
public class UsedProduct extends Product3{
private static final SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
private Date manufactureDate;
public UsedProduct() {
super();
}
public UsedProduct(String name, Double price, Date manufactureDate) {
super(name, price);
this.manufactureDate = manufactureDate;
}
public Date getManufactureDate() {
return manufactureDate;
}
public void setManufactureDate(Date manufactureDate) {
this.manufactureDate = manufactureDate;
}
public String priceTag() {
return getName()
+ " (used) $ "
+ String.format("%.2f", getPrice())
+ "(Manufacture date: "
+ sdf.format(manufactureDate)
+ ")";
}
}
| [
"[email protected]"
] | |
4df83a3f9c41e087cdaeed42e5ce45555b9a1841 | 4863ad3f5abf8492062cb27f7d23d9157534c848 | /TicTacToe.java | 9ec3fe2a4485a409a4e54e8bf5bb8d6dbf27e006 | [] | no_license | ccydouglas/tictactoe | 26851c7348a83566daf9d1e02dbb75f119855ce0 | 464c2aaa13a28a871707b61b42753e2cbf0e55b8 | refs/heads/master | 2020-03-11T07:43:54.146606 | 2018-04-17T08:18:51 | 2018-04-17T08:18:51 | 129,864,896 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,816 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package chun_chan_assignment6;
import java.util.Scanner;
/**
* This TicTaeToe class is the program of a tic tac toe board game. It has
* method to display the board, define who is the winner and receive user input.
*
* @author douglas
*/
public class TicTacToe {
final private int boardSize = 4;
private boolean gameStatus = false;
private char whoWins = 'T';
private char whoTurns = 'X';
private final char board[][] = new char[boardSize][boardSize];
char[] boardValue = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g'};
/*
this method creates the initial setting on the board and gives initial values to all fields.
*/
public TicTacToe() {
int count = 0;
for (int row = 0; row < boardSize; row++) {
for (int col = 0; col < boardSize; col++) {
board[row][col] = boardValue[count];
count++;
}
}
}
/**
* This method print the current board to the user
*/
public void printBoard() {
for (int i = 0; i < boardSize; i++) {
for (int j = 0; j < boardSize; j++) {
System.out.print(board[i][j] + "\t");
}
System.out.println();
}
}
/**
* this method provides the prompt and gathers input from the user.
*/
public void input() {
printBoard();
Scanner keyboard = new Scanner(System.in);
boolean again = true;
while (again) {
System.out.println();
System.out.println("Hi player '" + whoTurns + "' please select your next move.");
char m = keyboard.next().trim().charAt(0);
char move = Character.toLowerCase(m);
//check If the character provided by the user is valid
boolean found = false;
for (int index = 0; index < boardValue.length; index++) {
if (move == boardValue[index]) {
found = true;
}
}
if (!found) {
System.out.println("The value you input is not valid");
// break;
} else {
//covert user's input into the 2D array
int i = 0;
for (; i < boardValue.length; i++) {
if (move == boardValue[i]) {
break;
}
}
int row = i / boardSize;
int col = i % boardSize;
if (board[row][col] == 'X' || board[row][col] == 'O') {
System.out.println("The place has been taken. Please try again.");
} else {
board[row][col] = whoTurns;
again = false;
}
}
}
//switch user
if (whoTurns == 'X') {
whoTurns = 'O';
} else {
whoTurns = 'X';
}
}
/**
* This method allows to simulate the moves of two opponents.
*
* @param player X or O
* @param letter the move (as a character)
*/
public void simulateInput(char player, char letter) {
boolean again = true;
player = Character.toUpperCase(player);
if (player != 'X' && player != 'O') {
throw new IllegalArgumentException("The player need to be 'X' or 'O' ");
}
if (letter < 1) {
throw new IllegalArgumentException("Error: Value cannot be empty. ");
}
boolean found = false;
for (int index = 0; index < boardValue.length; index++) {
if (letter == boardValue[index]) {
found = true;
}
}
if (!found) {
throw new IllegalArgumentException("The value you input is not valid");
}
int i = 0;
for (; i < boardValue.length; i++) {
if (letter == boardValue[i]) {
break;
}
}
int row = i / boardSize;
int col = i % boardSize;
if (board[row][col] == 'X' || board[row][col] == 'O') {
throw new IllegalArgumentException("The place has been taken. Please try again.");
} else {
board[row][col] = player;
}
if (whoTurns != player) {
throw new IllegalArgumentException("Error: It is not your turn");
}
if (whoTurns == 'X') {
whoTurns = 'O';
} else {
whoTurns = 'X';
}
}
/**
* this method analyzes the current board and determines if there is a
* winning position present or if it is a tie.
*
*/
public void analyzeBoard() {
boolean freeSpace = true;
//check rows if there is a winner
for (int row = 0; row < boardSize; row++) {
if (board[row][0] == board[row][1] && board[row][1] == board[row][2]) {
whoWins = board[row][1];
gameStatus = true;
}
if (board[row][1] == board[row][2] && board[row][2] == board[row][3]) {
whoWins = board[row][1];
gameStatus = true;
}
}
//check columns if there is a winner
for (int col = 0; col < boardSize; col++) {
if (board[0][col] == board[1][col] && board[1][col] == board[2][col]) {
whoWins = board[1][col];
gameStatus = true;
}
if (board[1][col] == board[2][col] && board[2][col] == board[3][col]) {
whoWins = board[2][col];
gameStatus = true;
}
}
//diagonally across the board if there is a winner
for (int d = 0; d < 2; d++) {
if (board[d][d] == board[d + 1][d + 1] && board[d + 1][d + 1] == board[d + 2][d + 2]) {
whoWins = board[d + 1][d + 1];
gameStatus = true;
}
if (board[d + 1][d + 1] == board[d + 2][d + 2] && board[d + 2][d + 2] == board[d + 3][d + 3]) {
whoWins = board[d + 2][d + 2];
gameStatus = true;
}
}
if (board[0][2] == board[1][1] && board[1][1] == board[2][0]) {
whoWins = board[1][1];
gameStatus = true;
}
if (board[3][1] == board[2][2] && board[2][2] == board[1][3]) {
whoWins = board[2][2];
gameStatus = true;
}
if (board[0][1] == board[1][2] && board[1][2] == board[2][3]) {
whoWins = board[1][2];
gameStatus = true;
}
if (board[1][0] == board[2][1] && board[2][1] == board[3][2]) {
whoWins = board[2][1];
gameStatus = true;
}
//check if there are any free spaces on the board
for (int row = 0; row < boardSize; row++) {
for (int col = 0; col < boardSize; col++) {
if (board[row][col] != 'X' && board[row][col] != 'O') {
freeSpace = true;
} else {
freeSpace = false;
}
}
}
if (!freeSpace) {
gameStatus = true;
}
}
/**
* this method returns true if the game came to the end.
*
* @return game status
*/
public boolean done() {
return gameStatus;
}
/**
* this method returns a character (X, O or T – for tie),
*
* @return whoWins- who is the winner of the game
*/
public char whoWon() {
return whoWins;
}
}
| [
"[email protected]"
] | |
9d6fc4bae0b7aa49c835c5763096455b105f67d6 | d584a67371be79bd392036850515e83eb6eb505c | /src/test/java/com/java/login/LoginApplicationTests.java | f2b468270489742b107750f8d554135a78aa029a | [] | no_license | vishalpaalakurthi/SpringBootLoginExample | 826ff5fc918c7ccb75ebd554582b45b82dc956fd | 58d4e515a581557334e6f5100a28e8af86eca2b6 | refs/heads/master | 2020-05-17T06:01:57.255775 | 2019-04-26T12:44:44 | 2019-04-26T12:44:44 | 183,550,091 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 330 | java | package com.java.login;
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 LoginApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"[email protected]"
] | |
50e6ccf011403ebdac865ca30c1a3d1d279d6dd2 | 586874a36ba77d438e386e72792e40255660a841 | /src/main/java/AppForTestConnect/Main.java | 92cb92ba5f7afadf6301b458fd88338de5de3849 | [] | no_license | lapitus/AppForTestConnect | c4b3c28ca2b123a1ef6c14152f4ef671fceebebf | fec67a5ed527a4cae815c4e3c3918d0135d1bded | refs/heads/master | 2023-03-30T07:30:08.067406 | 2021-04-08T10:49:01 | 2021-04-08T10:49:01 | 355,622,487 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 789 | java | package AppForTestConnect;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
//@EnableJpaAuditing
public class Main {
public static void main(String[] args) {
SpringApplication.run(Main.class,args);
}
}
| [
"[email protected]"
] | |
781fe295313d4c1c775632ebea2bcb8cd8cd9322 | 5ca3901b424539c2cf0d3dda52d8d7ba2ed91773 | /src_cfr/com/google/security/zynamics/zylib/gui/JStackView/IStackModel.java | 6ea8407da9892b704969283f4b3deafd5a0952dc | [] | no_license | fjh658/bindiff | c98c9c24b0d904be852182ecbf4f81926ce67fb4 | 2a31859b4638404cdc915d7ed6be19937d762743 | refs/heads/master | 2021-01-20T06:43:12.134977 | 2016-06-29T17:09:03 | 2016-06-29T17:09:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 502 | java | /*
* Decompiled with CFR 0_115.
*/
package com.google.security.zynamics.zylib.gui.JStackView;
import com.google.security.zynamics.zylib.gui.JStackView.IStackModelListener;
public interface IStackModel {
public void addListener(IStackModelListener var1);
public String getElement(long var1);
public int getNumberOfEntries();
public long getStackPointer();
public long getStartAddress();
public boolean hasData(long var1, long var3);
public boolean keepTrying();
}
| [
"[email protected]"
] | |
9c085bd4008d3899d691dce7d1ca982b0f30be20 | a2b648c56a521eac4c47161400385944cfa9d4e5 | /api-test/src/main/java/com/gdrive/apitest/controllers/HomeController.java | e79e15e2156165fbdfa114005d7fac00cb283b47 | [] | no_license | pathtolearn/gdrive-api-test | aec0176d914f48b16be3bb09588f51b35ba5350d | 3618a4e28dc20e11957cfcaf0da613e7f075b7f3 | refs/heads/master | 2020-05-15T22:42:42.504025 | 2019-04-21T13:18:30 | 2019-04-21T13:18:30 | 181,952,895 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,446 | java | package com.gdrive.apitest.controllers;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.List;
import java.util.Optional;
import javax.activation.MimetypesFileTypeMap;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.gdrive.apitest.models.Folders;
import com.gdrive.apitest.service.GDriveService;
import io.swagger.annotations.ApiParam;
@RestController
public class HomeController {
@Autowired
private GDriveService service;
private ObjectMapper mapper = new ObjectMapper();
@GetMapping("/")
public String welcome() {
return "Welcome";
}
@CrossOrigin
@GetMapping("/folders")
public ResponseEntity<String> getFilesAndFolders(@RequestParam String Authorization, @RequestParam String id,
@ApiParam(required = false) @RequestParam Optional<Boolean> includeTeamDrives,
@ApiParam(required = false) @RequestParam Optional<String> orderBy,
@ApiParam(required = false) @RequestParam Optional<Boolean> fetchTags,
@ApiParam(required = false) @RequestParam Optional<Boolean> calculateFolderPath,
@ApiParam(required = false) @RequestParam Optional<Integer> pageSize,
@ApiParam(required = false) @RequestParam Optional<String> nextPage,
@ApiParam(required = false) @RequestParam Optional<String> fields) throws JsonProcessingException {
ResponseEntity<String> returnEntity = null;
try {
List<Folders> folders = service.getFilesAndFolders(Authorization, id, includeTeamDrives, orderBy, fetchTags,
calculateFolderPath, pageSize, nextPage, fields);
returnEntity = new ResponseEntity<String>(mapper.writeValueAsString(folders), HttpStatus.OK);
} catch (Exception e) {
return new ResponseEntity<String>(mapper.writeValueAsString(e.getLocalizedMessage()), HttpStatus.INTERNAL_SERVER_ERROR);
}
return returnEntity;
}
@CrossOrigin
@RequestMapping(value = "/upload/files", method = RequestMethod.POST, produces = "application/json", consumes = {
"multipart/form-data" })
public ResponseEntity<String> uploadFilesToAFolder(@RequestPart String Authorization,
@RequestPart MultipartFile file, @ApiParam(required = false) @RequestPart MultipartFile thumbnail, @RequestPart String path,
@ApiParam(required = false) @RequestParam Optional<String> folderId,
@ApiParam(required = false) @RequestPart Optional<String> mimeType,
@ApiParam(required = false) @RequestPart Optional<Integer> size,
@ApiParam(required = false) @RequestPart Optional<String[]> tags,
@ApiParam(required = false) @RequestPart Optional<String> description,
@ApiParam(required = false) @RequestPart Optional<Boolean> overwrite,
@ApiParam(required = false) @RequestPart Optional<Boolean> calculateFolderPath) throws JsonProcessingException {
ResponseEntity<String> returnEntity = null;
try {
Folders folder = service.uploadFilesToAFolder(Authorization, file, thumbnail, path, folderId, mimeType, size, tags, description,
overwrite, calculateFolderPath);
returnEntity = new ResponseEntity<String>(mapper.writeValueAsString(folder), HttpStatus.CREATED);
} catch (Exception e) {
return new ResponseEntity<String>(mapper.writeValueAsString(e.getLocalizedMessage()), HttpStatus.INTERNAL_SERVER_ERROR);
}
return returnEntity;
}
@CrossOrigin
@GetMapping("/file/id")
public ResponseEntity<Resource> downloadFile(@RequestParam String Authorization, @RequestParam String id,
@ApiParam(required = false) @RequestParam Optional<Boolean> calculateFolderPath,
@ApiParam(required = false) @RequestParam Optional<Boolean> includeTeamDrives, HttpServletResponse response) {
try {
String downloadedFilePath = service.downloadFile(Authorization, id, calculateFolderPath, includeTeamDrives);
File file = new File(downloadedFilePath);
response.setContentType(new MimetypesFileTypeMap().getContentType(file));
response.setContentLength((int)file.length());
response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(file.getName(), "UTF-8"));
InputStream is = new FileInputStream(file);
FileCopyUtils.copy(is, response.getOutputStream());
} catch (Exception e) {
System.out.println(e.getStackTrace());
}
return null;
}
@CrossOrigin
@GetMapping("/folder/contents")
public ResponseEntity<String> getFolderContents(@RequestParam String Authorization, @RequestParam String path,
@ApiParam(required = false) @RequestParam Optional<Boolean> includeTeamDrives,
@ApiParam(required = false) @RequestParam Optional<String> teamDriveId,
@ApiParam(required = false) @RequestParam Optional<String> where,
@ApiParam(required = false) @RequestParam Optional<String> orderBy,
@ApiParam(required = false) @RequestParam Optional<Boolean> fetchTags,
@ApiParam(required = false) @RequestParam Optional<Boolean> calculateFolderPath,
@ApiParam(required = false) @RequestParam Optional<Integer> pageSize,
@ApiParam(required = false) @RequestParam Optional<String> nextPage,
@ApiParam(required = false) @RequestParam Optional<String> fields) throws JsonProcessingException {
ResponseEntity<String> returnEntity = null;
try {
List<Folders> folders = service.getFolderContents(Authorization, path, includeTeamDrives, teamDriveId,
where, orderBy, fetchTags, calculateFolderPath, pageSize, nextPage, fields);
returnEntity = new ResponseEntity<String>(mapper.writeValueAsString(folders), HttpStatus.OK);
} catch (Exception e) {
return new ResponseEntity<String>(mapper.writeValueAsString(e.getLocalizedMessage()), HttpStatus.INTERNAL_SERVER_ERROR);
}
return returnEntity;
}
}
| [
"[email protected]"
] | |
d1f64af0830f0a72d871ee9826fbd85261bcaea4 | adaef51ca14f6b60a8d59bc6df2d345c36a7180a | /vgandroid/src/main/java/com/hucanhui/vgandroid/testview/view/GraphView.java | 184e0d87ff6939646316b05e11b69561e3fae6b8 | [] | no_license | HuCanui/drawplant | 0d84d53b4ca0f3272086470389b6fb81f6374ddc | 0ae8729d39dbed7cd265248d3088f577cfd4038f | refs/heads/master | 2020-12-31T00:39:57.371279 | 2017-03-29T10:00:37 | 2017-03-29T10:00:37 | 86,559,265 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,425 | java | //! \file GraphView.java
//! \brief Drawing view class
// Copyright (c) 2012-2015, https://github.com/rhcad/vgandroid-demo, BSD license
package com.hucanhui.vgandroid.testview.view;
import rhcad.touchvg.core.GiCoreView;
import rhcad.touchvg.core.GiGestureState;
import rhcad.touchvg.core.GiGestureType;
import rhcad.touchvg.core.GiView;
import rhcad.touchvg.view.CanvasAdapter;
import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.util.DisplayMetrics;
import android.view.MotionEvent;
import android.view.View;
//! Drawing view class
public class GraphView extends View {
private CanvasAdapter mCanvasAdapter;
private ViewAdapter mViewAdapter;
private GiCoreView mCoreView;
private DynDrawView mDynDrawView;
private long mDrawnTime;
private long mEndPaintTime;
private long mBeginTime;
public GraphView(Context context) {
super(context);
mCanvasAdapter = new CanvasAdapter(this);
mViewAdapter = new ViewAdapter();
mCoreView = GiCoreView.createView(mViewAdapter, 0);
DisplayMetrics dm = context.getApplicationContext().getResources().getDisplayMetrics();
GiCoreView.setScreenDpi(dm.densityDpi);
this.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
onGesture(GiGestureType.kGiGesturePan, GiGestureState.kGiGestureBegan, event);
} else if (event.getAction() == MotionEvent.ACTION_UP) {
onGesture(GiGestureType.kGiGesturePan, GiGestureState.kGiGestureEnded, event);
showTime();
} else if (mDynDrawView != null
&& event.getEventTime() > mDynDrawView.getEndPaintTime()) {
onGesture(GiGestureType.kGiGesturePan, GiGestureState.kGiGestureMoved, event);
showTime();
} else if (mDynDrawView == null && event.getEventTime() > mEndPaintTime) {
onGesture(GiGestureType.kGiGesturePan, GiGestureState.kGiGestureMoved, event);
showTime();
}
return true;
}
});
}
private void onGesture(GiGestureType type, GiGestureState state, MotionEvent event) {
mCoreView.onGesture(mViewAdapter, type, state, event.getX(), event.getY());
}
public GiCoreView coreView() {
return mCoreView;
}
public void setDynDrawView(DynDrawView view) {
mDynDrawView = view;
if (mDynDrawView != null) {
mDynDrawView.setCoreView(mViewAdapter, mCoreView);
}
}
public long getDrawnTime() {
return mDrawnTime;
}
private void showTime() {
Activity activity = (Activity) this.getContext();
String title = activity.getTitle().toString();
int pos = title.indexOf(" - ");
if (pos >= 0) {
title = title.substring(0, pos);
}
String dyntext = mDynDrawView != null ? mDynDrawView.getDrawnTime() + "/" : "";
activity.setTitle(title + " - " + dyntext + mDrawnTime + " ms");
}
private void doDraw() {
mBeginTime = android.os.SystemClock.uptimeMillis();
invalidate();
}
@Override
protected void onDraw(Canvas canvas) {
mCoreView.onSize(mViewAdapter, this.getWidth(), this.getHeight());
if (mCanvasAdapter.beginPaint(canvas)) {
mCoreView.drawAll(mViewAdapter, mCanvasAdapter);
if (mDynDrawView == null) {
mCoreView.dynDraw(mViewAdapter, mCanvasAdapter);
}
mCanvasAdapter.endPaint();
}
mEndPaintTime = android.os.SystemClock.uptimeMillis();
mDrawnTime = mEndPaintTime - mBeginTime;
}
@Override
protected void onDetachedFromWindow() {
if (mDynDrawView != null) {
mDynDrawView.setCoreView(null, null);
mDynDrawView = null;
}
if (mViewAdapter != null) {
mViewAdapter.delete();
mViewAdapter = null;
}
if (mCoreView != null) {
mCoreView.delete();
mCoreView = null;
}
if (mCanvasAdapter != null) {
mCanvasAdapter.delete();
mCanvasAdapter = null;
}
super.onDetachedFromWindow();
}
private class ViewAdapter extends GiView {
@Override
public void regenAll(boolean changed) {
synchronized (mCoreView) {
if (changed) {
mCoreView.submitBackDoc(mViewAdapter, changed);
mCoreView.submitDynamicShapes(mViewAdapter);
}
}
doDraw();
if (mDynDrawView != null) {
mDynDrawView.doDraw();
}
}
@Override
public void regenAppend(int sid, int playh) {
regenAll(true);
}
@Override
public void redraw(boolean changed) {
synchronized (mCoreView) {
if (changed) {
mCoreView.submitDynamicShapes(mViewAdapter);
}
}
if (mDynDrawView != null) {
mDynDrawView.doDraw();
} else {
doDraw();
}
}
}
}
| [
"[email protected]"
] | |
d7f0e4f9c6f2254e32a9fe50a619f727d9318885 | fd86e54ce3088976b33aea13e95446248f009ce9 | /src/main/java/com/example/projekat/controller/TrenerController.java | 2dc588a3b3d220b1aff7373b1b8e497804bae75a | [] | no_license | zolten95/projekat | 861a2b2a043357ad5817380e111b72d41022243a | 42be76476c6d16d8f5a3763966830d36a08d1ff5 | refs/heads/main | 2023-07-21T17:23:04.498908 | 2021-09-01T19:59:29 | 2021-09-01T19:59:29 | 365,722,289 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,008 | java | package com.example.projekat.controller;
import com.example.projekat.model.Clan;
import com.example.projekat.model.DTO.ClanDTO;
import com.example.projekat.model.DTO.TrenerDTO;
import com.example.projekat.model.Trener;
import com.example.projekat.service.TrenerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
@RestController
@RequestMapping(value = "/api/treneri")
public class TrenerController {
private final TrenerService trenerService;
@Autowired
public TrenerController(TrenerService trenerService) {
this.trenerService = trenerService;
}
@PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<TrenerDTO> dodajTrenera(@RequestBody TrenerDTO trenerDTO) throws Exception
{
Trener trener = new Trener(trenerDTO.getIme(),trenerDTO.getPrezime(),trenerDTO.getDatum_rodjenja(),trenerDTO.getKorisnicko_ime(),trenerDTO.getLozinka(),trenerDTO.getKontakt(),trenerDTO.getEmail(),trenerDTO.isObrisan(), trenerDTO.isAktivan());
trener.setObrisan(false);
trener.setAktivan(true);
trener.setUloga("trener");
Trener noviTrener = trenerService.create(trener);
TrenerDTO noviTrenerDTO = new TrenerDTO(noviTrener.getId(),noviTrener.getKorisnicko_ime(),noviTrener.getLozinka(),noviTrener.getIme(),noviTrener.getPrezime(),noviTrener.getKontakt(),noviTrener.getEmail(),noviTrener.getDatum_rodjenja(),noviTrener.isObrisan(),noviTrener.isAktivan());
return new ResponseEntity<>(noviTrenerDTO,HttpStatus.CREATED);
}
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<TrenerDTO>> getTrener() {
List<Trener> trenerList = this.trenerService.findAll();
List<TrenerDTO> treneriDTOS = new ArrayList<>();
for (Trener trener: trenerList) {
if(!trener.isObrisan()) {
TrenerDTO trenerDTO = new TrenerDTO( trener.getId(),trener.getKorisnicko_ime(),
trener.getLozinka(), trener.getIme(),trener.getPrezime(),trener.getKontakt(), trener.getEmail(),trener.getDatum_rodjenja(), trener.isObrisan(),trener.isAktivan());
treneriDTOS.add(trenerDTO);
}
}
return new ResponseEntity<>(treneriDTOS, HttpStatus.OK);
}
@DeleteMapping(value = "/{id}")
public ResponseEntity<Void> delete(@PathVariable Long id) {
System.out.println(id);
this.trenerService.delete(id);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
}
| [
"[email protected]"
] | |
7cc579f21b3f3036440b4767e156085b3ed93c82 | 2564e90aad15d50bc3e9101cd8f261aaae654418 | /android/app/src/main/java/com/second/MainApplication.java | 43a2c6749800938e9153b1f3520a62652816328f | [] | no_license | Ipek-GitHub/Trivia_Game_App | bcce0b4a59bd57dfbc01396d47f2c1740f3c7d76 | 357af233df8d7d1f298a33f80713a85166946862 | refs/heads/master | 2023-01-09T07:00:51.466641 | 2020-11-08T15:25:11 | 2020-11-08T15:25:11 | 311,085,373 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,595 | java | package com.second;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.second.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
| [
"[email protected]"
] | |
b630e1a14e13a924f2f69f619f040d11cb63c599 | 466912406272829982f75854cf0104c6ce8c9814 | /web/site-v2/api/service-company/src/main/java/com/tsb/company/dao/DealScoreVODao.java | be6e8cedeb9bb910cff198c78472e8849d125146 | [] | no_license | logonmy/Codes | 9631fa103fc499663361fa7eeccd7cedb9bb08e4 | 92723efdeccfc193f9ee5d0ab77203c254f34bc2 | refs/heads/master | 2021-09-21T18:07:22.985184 | 2018-08-30T05:53:26 | 2018-08-30T05:53:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 888 | java | package com.tsb.company.dao;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.tsb.company.vo.DealScoreVO;
public interface DealScoreVODao {
int countAssigned(@Param("organizationId") int organizationId, @Param("userId") int userId, @Param("type") int type, @Param("fromDate") Date fromDate, @Param("toDate") Date toDate);
int countTODO(@Param("organizationId") int organizationId, @Param("userId") int userId, @Param("type") int type, @Param("filter") int filter);
List<DealScoreVO> listTODO(@Param("organizationId") int organizationId, @Param("userId") int userId, @Param("type") int type, @Param("filter") int filter, @Param("from") int from, @Param("pageSize") int pageSize);
DealScoreVO getNextScoring(@Param("organizationId") int organizationId, @Param("userId") int userId, @Param("companyId") int exceptCompanyId);
}
| [
"[email protected]"
] | |
ca037b1ee87f893f98d07914e9d6ef6685b467f9 | 7ee709db6967587dcf6a3f75f725fc69b7ed91af | /190628/src/Ex0313_eunbiSsem.java | 623228ecead909e87a587ed3cdeedab20e4d40cc | [] | no_license | kumdori/java_smhrd | 316bcdc5a63dfb0afd69ce993365d36b679791d5 | efe31360751f71b8c895c684216c67d68b7c98df | refs/heads/master | 2020-06-05T02:40:38.192995 | 2019-07-17T04:39:11 | 2019-07-17T04:39:11 | 192,285,266 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,960 | java | import java.util.ArrayList;
import java.util.Scanner;
public class Ex0313_eunbiSsem {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
ArrayList<String> musiclist = new ArrayList<String>();
ArrayList<ArrayList<String>> allPlayList = new ArrayList<ArrayList<String>>();
ArrayList<String> playListName = new ArrayList<String>();
boolean isRunning = true;
while (isRunning) {
System.out.print("[1]노래추가 [2]노래삭제 [3]PlayList추가 [4]PlayList조회 [5]종료");
switch (scan.nextInt()) {
case 1:
musicAdd(musiclist, scan);
break;
case 2:
musicDelete(musiclist, scan);
break;
case 3:
System.out.print("PlayList이름 >> ");
String name = scan.next();
playListName.add(name);
allPlayList.add(musiclist);
break;
case 4:
System.out.println("0. 새로운 트랙");
print(playListName);
System.out.print("index >> ");
int choice = scan.nextInt();
if (choice == 0) {
musiclist = new ArrayList<String>();
}else {
musiclist = allPlayList.get(choice - 1);
}
break;
case 5:
isRunning = false;
System.out.println("종료되었습니다.");
break;
}
}
}
private static void musicDelete(ArrayList<String> current, Scanner scan) {
print(current);
if (current.size() > 0) {
System.out.print("[1]선택삭제 [2]모두삭제");
switch (scan.nextInt()) {
case 1:
System.out.print("index >> ");
int index = scan.nextInt();
current.remove(index - 1);
break;
case 2:
current.clear();
break;
}
}
}
private static void musicAdd(ArrayList<String> current, Scanner scan) {
print(current);
System.out.print("[1]마지막위치에 추가 [2]원하는 위치에 추가");
int choice = scan.nextInt();
System.out.println("노래제목 >> ");
String music = scan.next();
switch (choice) {
case 1:
current.add(music);
break;
case 2:
System.out.print("index : ");
int index = scan.nextInt();
current.add(index - 1, music);
break;
}
}
private static void print(ArrayList<String> current) {
if (current.size() == 0) {
System.out.println("재생목록이 존재하지 않습니다.");
} else {
for (int i = 0; i < current.size(); i++) {
System.out.println(i + 1 + "." + current.get(i));
}
}
}
} | [
"SM14@DESKTOP-G8C6S9Q"
] | SM14@DESKTOP-G8C6S9Q |
961ef1f927aeb10fabbdb21c01cd5df4f2724a5b | 6264d334cc6a2af608d0e57d3eb62bb7811b12f1 | /dabenxiang-security-core/src/main/java/com/dabenxiang/security/core/authorize/GycAuthorizeConfigManager.java | efba13ea64323123e3262f3f31f53afed6bcc1e6 | [] | no_license | dabengxiang/dabenxiang-security | bf4d4fb50546c3a38b7b97fc54b814215d67cf33 | 92211922d1289d5cc762ed10e4c53b97387af671 | refs/heads/master | 2020-03-23T20:18:21.946322 | 2018-10-14T15:02:44 | 2018-10-14T15:02:44 | 142,033,960 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,164 | java | package com.dabenxiang.security.core.authorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* Date:2018/9/30
* Author: yc.guo the one whom in nengxun
* Desc:
*/
@Component
public class GycAuthorizeConfigManager implements AuthorizeConfigManager {
@Autowired(required = false)
private List<AuthorizeConfigProvider> providersList;
@Override
public void config(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry config) {
if(providersList==null)
return ;
for (AuthorizeConfigProvider authorizeConfigProvider : providersList) {
authorizeConfigProvider.config(config);
}
}
}
| [
"[email protected]"
] | |
b331db949cd8fd8bcb0229d4f545d1a85dc377aa | e2151b1e55920e180a1a837d50ed4c0a47a3e07c | /src/de/xcom/keshlib/keshlibandroiddemo/KeshApplication.java | cfecb261c8ee1b39a06fa0e6f12182ff28535470 | [
"MIT"
] | permissive | xcom-ag/keshlib-android-demo | 74abcbaeb1d44e700b99ed03ff21dcadba4eebc0 | 9aa20cc9aced8a09b0189af1805dc7ac57858891 | refs/heads/master | 2016-09-10T19:08:01.178783 | 2016-01-13T08:35:37 | 2016-01-13T08:35:37 | 31,542,696 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 268 | java | package de.xcom.keshlib.keshlibandroiddemo;
import android.app.Application;
public class KeshApplication extends Application {
/*
* (non-Javadoc)
*
* @see android.app.Application#onCreate()
*/
@Override
public void onCreate() {
super.onCreate();
}
}
| [
"[email protected]"
] | |
9d97450f53f807ecf87417e54df9d426ad337ecc | 9b01ffa3db998c4bca312fd28aa977f370c212e4 | /app/src/streamD/java/com/loki/singlemoduleapp/stub/SampleClass7281.java | e00a65e1cd6d3b6091d4ba9aceb41670ea249ae5 | [] | no_license | SergiiGrechukha/SingleModuleApp | 932488a197cb0936785caf0e73f592ceaa842f46 | b7fefea9f83fd55dbbb96b506c931cc530a4818a | refs/heads/master | 2022-05-13T17:15:21.445747 | 2017-07-30T09:55:36 | 2017-07-30T09:56:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 281 | java | package com.loki.singlemoduleapp.stub;
public class SampleClass7281 {
private SampleClass7282 sampleClass;
public SampleClass7281(){
sampleClass = new SampleClass7282();
}
public String getClassName() {
return sampleClass.getClassName();
}
} | [
"[email protected]"
] | |
81e7c95a9dfdb34d9c4fbc43dcb4cd5bf96c44fe | b218f5aeed569041e458cae50ed76e77c2235021 | /OrbOfDeception.java | 0826eb6453869b8b97d444165fd1d81d0702c389 | [] | no_license | gaberies/DungeonAdventure | 9b1f65a333c76a4eb9ccd93a124fe945b023ec53 | 5f36b31b57b4ac70547460b436a8b19a8fd71658 | refs/heads/master | 2020-09-27T19:00:18.747769 | 2019-12-12T04:26:06 | 2019-12-12T04:26:06 | 226,586,567 | 0 | 0 | null | 2019-12-12T04:26:07 | 2019-12-07T22:56:13 | Java | UTF-8 | Java | false | false | 911 | java |
public class OrbOfDeception implements SkillBehavior {
@Override
public String skillName() {
return "Orb of Deception";
}
@Override
public void execute(Hero hero, Monster monster) {
if (Math.random() <= .4)
{
int orbPoints = (int)(Math.random() * 76) + 100;
System.out.println(hero.getName() + " sends out and pulls back her orb, dealing magic damage on the way out and true damage on the way back for " + orbPoints
+ " damage!");
monster.subtractHitPoints(orbPoints);
int hPoints = (int)(Math.random() * (hero.getDamageMax() - hero.getDamageMin() + 1)) + hero.getDamageMin();
hero.addHitPoints(hPoints);
System.out.println("Ahri's next orb hits restored her health for [" + hPoints + "] points.\n");
}//end blow succeeded
else
{
System.out.println(hero.getName() + " failed to land her Orb of Deception");
System.out.println();
}//blow failed
}
}
| [
"[email protected]"
] | |
70b622f14cdfc6280c31ec5d43a6c14874e69bdf | 90c50a85dd77e1dcb1aa71e6bc9997deb1ac5906 | /pyg-mapper/src/main/java/com/dt/pyg/mapper/ContentMapper.java | f118a2e2e595e54a32d9753f445d939a5f312a43 | [] | no_license | github-dt/pyg | 928d59b59273026038b066c07f2aac0d33dfea89 | 6beb3db6ded8636b64ad182c9e0701016348c777 | refs/heads/master | 2020-07-07T09:56:53.842015 | 2019-09-07T14:41:48 | 2019-09-07T14:41:48 | 203,319,202 | 0 | 0 | null | 2019-08-22T06:06:47 | 2019-08-20T07:03:53 | JavaScript | UTF-8 | Java | false | false | 161 | java | package com.dt.pyg.mapper;
import com.dt.pyg.pojo.Content;
import tk.mybatis.mapper.common.Mapper;
public interface ContentMapper extends Mapper<Content>{
} | [
"[email protected]"
] | |
84ec47e1f2924a70ac5a385be4ac811493b42096 | 182b7e5ca415043908753d8153c541ee0e34711c | /spring-basics/spring-core/xml/src/main/java/com/vinaylogics/springbasics/core/xml/LifeCycleBean.java | b445ece5c267d8a4dab2849bfe7892080756f492 | [] | no_license | akamatagi/Java9AndAbove | 2b62886441241ef4cd62990243d7b29e895452f7 | ff002a2395edf506091b3571a470c15fa0742550 | refs/heads/master | 2023-02-09T17:38:21.467950 | 2020-12-30T14:47:59 | 2020-12-30T14:47:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 155 | java | package com.vinaylogics.springbasics.core.xml;
public interface LifeCycleBean {
void init() throws Exception;
void destroy() throws Exception;
}
| [
"[email protected]"
] | |
44c7fae6934d32d94a2ba7215ee9e5773fc92946 | 0e309678d59fa85285d034059e3bd5ca1ffb56cf | /telemetry-netty/src/test/java/me/dmexe/telemetery/netty/channel/TestEnv.java | 74d659b38da860219628b36ab323ba0c3f4cba73 | [
"Apache-2.0"
] | permissive | dmexe/telemetry | 26357ed37cf5f49a050ed0c0e39a8afbd6e8dcf4 | 3a09f1b3cf97a2d46d265dfb1e46c44986cd5246 | refs/heads/master | 2021-09-15T04:14:00.940619 | 2018-03-13T16:47:30 | 2018-05-25T15:56:20 | 105,984,813 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,953 | java | package me.dmexe.telemetery.netty.channel;
import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.handler.codec.http.HttpResponse;
import io.opentracing.Span;
import io.opentracing.Tracer;
import io.prometheus.client.CollectorRegistry;
import java.io.Closeable;
import java.net.InetSocketAddress;
import java.time.Duration;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import me.dmexe.telemetery.netty.channel.support.ClientChannelInit;
import me.dmexe.telemetery.netty.channel.support.ServerChannelInit;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
abstract class TestEnv {
private static Duration lifecycleDuration = Duration.ofSeconds(3);
private static Logger log = LoggerFactory.getLogger(TestEnv.class);
Client newClient(InetSocketAddress address, CollectorRegistry collectorRegistry, Tracer tracer) throws Exception {
final EventLoopGroup group = new NioEventLoopGroup(2);
final BlockingQueue<HttpResponse> queue = new ArrayBlockingQueue<>(1);
try {
final Bootstrap bootstrap = new Bootstrap()
.group(group)
.channel(NioSocketChannel.class)
.handler(new ClientChannelInit(queue, collectorRegistry, tracer));
final ChannelFuture future = bootstrap.connect(address).sync();
return new Client(group, future, queue);
} catch (Exception err) {
group.shutdownGracefully(0, lifecycleDuration.getSeconds(), TimeUnit.SECONDS);
throw err;
}
}
Server newServer(CollectorRegistry collectorRegistry, Tracer tracer) throws Exception {
final EventLoopGroup group = new NioEventLoopGroup(2);
try {
final ServerBootstrap bootstrap = new ServerBootstrap()
.group(group)
.channel(NioServerSocketChannel.class)
.childHandler(new ServerChannelInit(collectorRegistry, tracer));
final ChannelFuture future = bootstrap.bind(0).sync();
return new Server(group, future);
} catch (Exception err) {
group.shutdownGracefully(0, lifecycleDuration.getSeconds(), TimeUnit.SECONDS);
throw err;
}
}
static List<String> samples(CollectorRegistry collectorRegistry, String filter) {
return samples(collectorRegistry).stream()
.filter(it -> it.startsWith(filter))
.collect(Collectors.toList());
}
private static List<String> samples(CollectorRegistry collectorRegistry) {
return Collections.list(collectorRegistry.metricFamilySamples()).stream()
.flatMap(family ->
family.samples.stream().map(sample ->
sample.name + "{" + String.join(",", sample.labelValues) + "}=" + sample.value
)
)
.sorted()
.collect(Collectors.toList());
}
static class Client implements Closeable {
private final EventLoopGroup group;
private final ChannelFuture future;
private final InetSocketAddress address;
private final BlockingQueue<HttpResponse> queue;
Client(EventLoopGroup group, ChannelFuture future, BlockingQueue<HttpResponse> queue) {
Objects.requireNonNull(group, "group cannot be null");
Objects.requireNonNull(future, "future cannot be null");
Objects.requireNonNull(queue, "queue cannot be null");
this.group = group;
this.future = future;
this.address = (InetSocketAddress) future.channel().localAddress();
this.queue = queue;
log.info("client connected at {}", address());
}
@Override
public void close() {
group.shutdownGracefully(0, lifecycleDuration.getSeconds(), TimeUnit.SECONDS);
try {
future.channel().closeFuture().sync();
log.info("client disconnected at {}", address());
} catch (InterruptedException err) {
throw new RuntimeException(err);
}
}
InetSocketAddress address() {
return address;
}
Channel channel() {
return future.channel();
}
@Nullable
HttpResponse response() {
try {
return queue.poll(lifecycleDuration.getSeconds(), TimeUnit.SECONDS);
} catch (InterruptedException err) {
throw new RuntimeException(err);
}
}
void request(HttpRequest request) {
channel().writeAndFlush(request).awaitUninterruptibly(lifecycleDuration.toMillis());
}
void request(HttpRequest request, Span root) {
NettyHttpTracingContext.addClientParentContext(channel(), root.context());
request(request);
}
}
static class Server implements Closeable {
private final EventLoopGroup group;
private final ChannelFuture future;
private final InetSocketAddress address;
Server(EventLoopGroup group, ChannelFuture future) {
Objects.requireNonNull(group, "group cannot be null");
Objects.requireNonNull(future, "future cannot be null");
this.group = group;
this.future = future;
this.address = (InetSocketAddress) future.channel().localAddress();
log.info("server started at {}", address());
}
@Override
public void close() {
group.shutdownGracefully(0, lifecycleDuration.getSeconds(), TimeUnit.SECONDS);
try {
future.channel().closeFuture().sync();
log.info("server stopped at {}", address());
} catch (InterruptedException err) {
throw new RuntimeException(err);
}
}
InetSocketAddress address() {
return address;
}
}
}
| [
"[email protected]"
] | |
7d584684a309bf0fb46c75cb91951ce6955ffe40 | e75be673baeeddee986ece49ef6e1c718a8e7a5d | /submissions/blizzard/Corpus/eclipse.jdt.ui/1154.java | da704d5bfc94322b63fb982a2c309f0f6a2d59bf | [
"MIT"
] | permissive | zhendong2050/fse18 | edbea132be9122b57e272a20c20fae2bb949e63e | f0f016140489961c9e3c2e837577f698c2d4cf44 | refs/heads/master | 2020-12-21T11:31:53.800358 | 2018-07-23T10:10:57 | 2018-07-23T10:10:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,444 | java | /*******************************************************************************
* Copyright (c) 2007, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.ui.text.spelling;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext;
import org.eclipse.ui.texteditor.spelling.SpellingService;
import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.text.correction.IProposalRelevance;
/**
* Proposal to disable spell checking.
*
* @since 3.3
*/
public class DisableSpellCheckingProposal implements IJavaCompletionProposal {
/** The invocation context */
private IQuickAssistInvocationContext fContext;
/**
* Creates a new proposal.
*
* @param context the invocation context
*/
public DisableSpellCheckingProposal(IQuickAssistInvocationContext context) {
fContext = context;
}
/*
* @see org.eclipse.jface.text.contentassist.ICompletionProposal#apply(org.eclipse.jface.text.IDocument)
*/
@Override
public final void apply(final IDocument document) {
IPreferenceStore store = EditorsUI.getPreferenceStore();
store.setValue(SpellingService.PREFERENCE_SPELLING_ENABLED, false);
}
/*
* @see org.eclipse.jface.text.contentassist.ICompletionProposal#getAdditionalProposalInfo()
*/
@Override
public String getAdditionalProposalInfo() {
return JavaUIMessages.Spelling_disable_info;
}
/*
* @see org.eclipse.jface.text.contentassist.ICompletionProposal#getContextInformation()
*/
@Override
public final IContextInformation getContextInformation() {
return null;
}
/*
* @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
*/
@Override
public String getDisplayString() {
return JavaUIMessages.Spelling_disable_label;
}
/*
* @see org.eclipse.jface.text.contentassist.ICompletionProposal#getImage()
*/
@Override
public Image getImage() {
return JavaPluginImages.get(JavaPluginImages.IMG_OBJS_NLS_NEVER_TRANSLATE);
}
/*
* @see org.eclipse.jdt.ui.text.java.IJavaCompletionProposal#getRelevance()
*/
@Override
public final int getRelevance() {
return IProposalRelevance.DISABLE_SPELL_CHECKING;
}
/*
* @see org.eclipse.jface.text.contentassist.ICompletionProposal#getSelection(org.eclipse.jface.text.IDocument)
*/
@Override
public final Point getSelection(final IDocument document) {
return new Point(fContext.getOffset(), fContext.getLength());
}
}
| [
"[email protected]"
] | |
710735569aa2e883e62c03534ac0c624cecd74ae | bfe61e2f03d91e31a9191f3aa3940c9be9cde949 | /src/main/java/com/one/mongoreactivehumanresources/documents/Job.java | ee450795a00d94250b851b053ff6e2a5c4a09d86 | [] | no_license | TomasOtano25/mongo-reactive-human-resources | 215cf8d6c5a9f7413cf9fec06fbc121abd3bb195 | 6c49f9ffb9a7bda9afec01bc3604fdd0fc70ce3b | refs/heads/master | 2022-12-20T13:04:07.668551 | 2020-10-15T17:06:59 | 2020-10-15T17:06:59 | 300,307,579 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,190 | java | package com.one.mongoreactivehumanresources.documents;
import com.one.mongoreactivehumanresources.documents.enums.Risk;
import com.one.mongoreactivehumanresources.dtos.JobDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
@EqualsAndHashCode
@ToString
@Data
@Document
public class Job {
@Id
private String id;
private String name;
private Risk risk;
private double minSalary;
private double maxSalary;
private boolean state;
public Job() {
this.state = true;
}
public Job(String name, Risk risk, double minSalary, double maxSalary) {
this.name = name;
this.risk = risk;
this.minSalary = minSalary;
this.maxSalary = maxSalary;
this.state = true;
}
public Job(JobDto jobDto) {
this.id = jobDto.getId();
this.name = jobDto.getName();
this.risk = jobDto.getRisk();
this.minSalary = jobDto.getMinSalary();
this.maxSalary = jobDto.getMaxSalary();
this.state = true;
}
}
| [
"[email protected]"
] | |
0bbbbf7b3e59f3a76a96189321fc074edebbb232 | 6cf6e5c9c63a621fdfb4794c8ae0831ec725970f | /tulingmall-getway-demo/src/main/java/com/tuling/exception/GateWayExceptionHandlerAdvice.java | 8f3a7f13bc580c3d572125b41beba87dd3921824 | [] | no_license | LCcFw/tuling-mall | 469ebc188a2ea581bb67ce79007bf126330757e7 | 77987691111bdf93d71c26023450c7d1cf9414be | refs/heads/master | 2023-04-17T04:55:16.274800 | 2021-04-26T15:46:32 | 2021-04-26T15:46:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,077 | java | package com.tuling.exception;
import com.tuling.tulingmall.common.api.CommonResult;
import com.tuling.tulingmall.common.exception.GateWayException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
@Slf4j
@Component
public class GateWayExceptionHandlerAdvice {
@ExceptionHandler(value = {GateWayException.class})
public CommonResult handle(GateWayException ex) {
log.error("网关异常code:{},msg:{}", ex.getCode(),ex.getMessage());
return CommonResult.failed(ex.getCode(),ex.getMessage());
}
@ExceptionHandler(value = {Throwable.class})
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public CommonResult handle(Throwable throwable) {
if(throwable instanceof GateWayException) {
return handle((GateWayException) throwable);
}else {
return CommonResult.failed();
}
}
}
| [
"[email protected]"
] | |
9a04c6075cd346523cff099a7b9e1984366f2b20 | e1b44f655f4102eb06b133220a0f6c0ab58b1e20 | /src/main/java/com/loohp/interactivechat/NMS/V1_8_R3.java | cb358fc08dc650cedc02a7fe14d7a5703746953e | [] | no_license | NotYusta/InteractiveChat | 3a37e1f198dd9cf3b73ccfd3b57d0823e4956090 | adf91a5241e360676b19682d0b09c85da7173f99 | refs/heads/master | 2023-03-04T11:10:00.618442 | 2021-02-19T14:14:02 | 2021-02-19T14:14:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,345 | java | package com.loohp.interactivechat.NMS;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.entity.Player;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.chat.ComponentSerializer;
import net.minecraft.server.v1_8_R3.IChatBaseComponent;
import net.minecraft.server.v1_8_R3.IChatBaseComponent.ChatSerializer;
import net.minecraft.server.v1_8_R3.PacketPlayOutTitle;
import net.minecraft.server.v1_8_R3.PacketPlayOutTitle.EnumTitleAction;
public class V1_8_R3 {
public static void sendTitle(Player player, String title, String subtitle, int time) {
IChatBaseComponent chatTitle = ChatSerializer.a(ComponentSerializer.toString(TextComponent.fromLegacyText(title)));
IChatBaseComponent chatSubtitle = ChatSerializer.a(ComponentSerializer.toString(TextComponent.fromLegacyText(subtitle)));
PacketPlayOutTitle titlepacket = new PacketPlayOutTitle(EnumTitleAction.TITLE, chatTitle);
PacketPlayOutTitle subtitlepacket = new PacketPlayOutTitle(EnumTitleAction.SUBTITLE, chatSubtitle);
PacketPlayOutTitle length = new PacketPlayOutTitle(10, time, 20);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(titlepacket);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(subtitlepacket);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(length);
}
}
| [
"[email protected]"
] | |
95ea25b11a97f30c17462b2615de430506342f32 | f6b23975d200f554b892f6f8ace299092357501d | /wechatDev/src/main/java/com/lex/model/BaseMessage.java | 150c96f03debf1049d36815e2a7ef01ef351ddd5 | [] | no_license | lex19950102/wechatDev | f9bdac5a3f5ecb227de0c3e7e4ba6738d52dd586 | cb637ba9a4eb8e68c74fd6e4f4c5aa6602c351d9 | refs/heads/master | 2020-04-04T18:47:37.555164 | 2018-11-07T06:25:39 | 2018-11-07T06:25:39 | 156,179,124 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 692 | java | package com.lex.model;
public class BaseMessage {
private String ToUserName;
private String FromUserName;
private Long CreateTime;
private String MsgType;
public String getToUserName() {
return ToUserName;
}
public void setToUserName(String toUserName) {
ToUserName = toUserName;
}
public String getFromUserName() {
return FromUserName;
}
public void setFromUserName(String fromUserName) {
FromUserName = fromUserName;
}
public Long getCreateTime() {
return CreateTime;
}
public void setCreateTime(Long createTime) {
CreateTime = createTime;
}
public String getMsgType() {
return MsgType;
}
public void setMsgType(String msgType) {
MsgType = msgType;
}
}
| [
"[email protected]"
] | |
1b2b8db777b5865723a33d265b54ae826601934a | 63ca33ae98f64b52c7586e68c639f177d78fe6be | /microservice-provider-pay/src/main/java/com/hzg/tools/SignInUtil.java | f4180041b9f5a7624dacdeb6b6e218011c7d2dab | [
"MIT"
] | permissive | smjie2800/spring-cloud-microservice-redis-activemq-hibernate-mysql | 366b6e5106f3014bc17823a0bea7d6c3d53a868c | 9ef2aa11622cee3d03be9ad5ed5350259d71f239 | refs/heads/master | 2021-01-19T19:08:44.659496 | 2018-05-23T07:01:59 | 2018-05-23T07:01:59 | 86,646,685 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 5,325 | java | package com.hzg.tools;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Set;
import java.util.concurrent.TimeUnit;
@Component
public class SignInUtil {
@Autowired
public RedisTemplate<String, Object> redisTemplate;
//如果用户失败登录次数 >= waitToSignInCount,则需要等待 2^signInFailCount * waitTimeUnit 毫秒,才可以再次登录
public int waitToSignInCount = 3;
public int waitTimeUnit = 10 * 1000;
/**
* 取到用户等待一段时间
*
* @param username
*/
public long userWait(String username) {
Long signInFailTime = (Long)redisTemplate.opsForValue().get("signInFailTime_" + username);
if (signInFailTime != null) {
long timeDiff = System.currentTimeMillis() - signInFailTime;
long waitTime = getWaitTime(username);
if (timeDiff < waitTime) {
return (waitTime - timeDiff);
}
}
return 0;
}
/**
* 设置登录失败次数。及失败登录次数 >= waitToSignInCount时,该次登录的登录时间
*
* @param username
*/
public void setSignInFailInfo(String username) {
Integer signInFailCount = (Integer) redisTemplate.opsForValue().get("signInFailCount_" + username);
if (signInFailCount == null) {
redisTemplate.opsForValue().set("signInFailCount_" + username, 1);
} else {
signInFailCount = signInFailCount + 1;
redisTemplate.opsForValue().set("signInFailCount_" + username, signInFailCount);
if (signInFailCount >= waitToSignInCount) {
redisTemplate.opsForValue().set("signInFailTime_" + username, System.currentTimeMillis());
}
}
}
public void removeSignInFailInfo(String username) {
if (redisTemplate.opsForValue().get("signInFailCount_" + username) != null) {
redisTemplate.opsForValue().getOperations().delete("signInFailCount_" + username);
}
if (redisTemplate.opsForValue().get("signInFailTime_" + username) != null) {
redisTemplate.opsForValue().getOperations().delete("signInFailTime_" + username);
}
}
public int getSignInFailCount(String username) {
Integer signInFailCount = (Integer) redisTemplate.opsForValue().get("signInFailCount_" + username);
return signInFailCount == null ? 0 : signInFailCount;
}
/**
* 获取等待时间(毫秒)
* @param username
* @return
*/
public long getWaitTime(String username) {
long waitTime = 0;
int signInFailCount = getSignInFailCount(username);
if (signInFailCount >= waitToSignInCount) {
waitTime = (int)Math.pow(2, signInFailCount) * waitTimeUnit;
}
return waitTime;
}
/**
* 获取等待秒数
* @param username
* @return
*/
public long getWaitSeconds(String username) {
return getWaitTime(username)/1000;
}
public int removedSignInFailCount = 10;
/**
* 每隔1个小时,移除登录失败次数 >= 10(等待2^10 * waitTimeUnit毫秒)的用户对应的 map 元素
*/
@Scheduled(cron = "0 0 0/1 * * ?")
public void clearMap(){
Set<String> keys = redisTemplate.keys("signInFailCount_*");
for (String key : keys) {
if ((Integer)redisTemplate.opsForValue().get(key) > removedSignInFailCount) {
removeSignInFailInfo(key.substring(key.indexOf(CommonConstant.underline)+1));
}
}
}
/**
* 用户会话设置
*/
/**
* 判断用户是否存在
* @param username
*/
public boolean isUserExist(String username) {
return redisTemplate.opsForValue().get(CommonConstant.user + CommonConstant.underline + username) != null;
}
/**
* 设置用户
* @param sessionId
* @param username
*/
public void setUser(String sessionId, String username) {
if (!isUserExist(username)) {
redisTemplate.boundValueOps(CommonConstant.sessionId + CommonConstant.underline + sessionId).set(username, 1800, TimeUnit.SECONDS);
redisTemplate.boundValueOps(CommonConstant.user + CommonConstant.underline + username).set(sessionId, 1800, TimeUnit.SECONDS);
}
}
/**
* 移除用户
* @param username
*/
public void removeUser(String username) {
if (isUserExist(username)) {
redisTemplate.opsForValue().getOperations().delete(CommonConstant.sessionId + CommonConstant.underline + (String)redisTemplate.opsForValue().get(CommonConstant.user + CommonConstant.underline + username));
redisTemplate.opsForValue().getOperations().delete(CommonConstant.user + CommonConstant.underline + username);
}
}
/**
* 根据用户名取得 sessionId
* @param username
* @return
*/
public String getSessionIdByUser(String username) {
return (String)redisTemplate.opsForValue().get(CommonConstant.user + CommonConstant.underline + username);
}
} | [
"[email protected]"
] | |
ec8c4069c6c12cde22ffef505a0f4a403c3ea099 | 4c19b724f95682ed21a82ab09b05556b5beea63c | /XMSYGame/java2/server/zxyy-webhome/src/main/java/com/xmsy/server/zxyy/webhome/modules/manager/webhomepopulargames/entity/WebhomePopularGamesEntity.java | 1098c11d6c5bee0d43eeeb9450ad4a241774c64d | [] | no_license | angel-like/angel | a66f8fda992fba01b81c128dd52b97c67f1ef027 | 3f7d79a61dc44a9c4547a60ab8648bc390c0f01e | refs/heads/master | 2023-03-11T03:14:49.059036 | 2022-11-17T11:35:37 | 2022-11-17T11:35:37 | 222,582,930 | 3 | 5 | null | 2023-02-22T05:29:45 | 2019-11-19T01:41:25 | JavaScript | UTF-8 | Java | false | false | 1,053 | java | package com.xmsy.server.zxyy.webhome.modules.manager.webhomepopulargames.entity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.xmsy.server.zxyy.webhome.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 官网热门游戏
*
* @author xiaoliu
* @email xxxxx
* @date 2019-01-29 16:07:37
*/
@Data
@EqualsAndHashCode(callSuper=false)
@Accessors(chain=true)
@TableName("webhome_popular_games")
public class WebhomePopularGamesEntity extends BaseEntity<WebhomePopularGamesEntity> {
private static final long serialVersionUID = 1L;
/**
* 名称
*/
private String name;
/**
* 附件ID
*/
private Long enclosureId;
/**
* 介绍
*/
private String introduction;
/**
* 类型(menu,game)
*/
private String type;
/**
* 类型Id
*/
private Long typeId;
/**
* 路径
*/
private String url;
/**
* 状态
*/
private Boolean enable;
/**
* 排序号
*/
private Integer orderNum;
}
| [
"[email protected]"
] | |
352c0d7d65376a51dd546d501e1907a9e9b7070e | 311f1237e7498e7d1d195af5f4bcd49165afa63a | /sourcedata/lucene-solr-releases-lucene-2.2.0/contrib/gdata-server/src/core/src/java/org/apache/lucene/gdata/storage/ResourceNotFoundException.java | f7470fa48ffd545e5772a339f18d4dc2cae597be | [
"Apache-2.0"
] | permissive | DXYyang/SDP | 86ee0e9fb7032a0638b8bd825bcf7585bccc8021 | 6ad0daf242d4062888ceca6d4a1bd4c41fd99b63 | refs/heads/master | 2023-01-11T02:29:36.328694 | 2019-11-02T09:38:34 | 2019-11-02T09:38:34 | 219,128,146 | 10 | 1 | Apache-2.0 | 2023-01-02T21:53:42 | 2019-11-02T08:54:26 | Java | UTF-8 | Java | false | false | 2,233 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.gdata.storage;
/**
* This exception will be thrown if an requested resource of a resource to modify can not be found
* @author Simon Willnauer
*
*/
public class ResourceNotFoundException extends StorageException {
private static final long serialVersionUID = -8549987918130998249L;
/**
* Constructs an empty ResourceNotFoundException
*/
public ResourceNotFoundException() {
super();
// TODO Auto-generated constructor stub
}
/**
* Constructs a new ResourceNotFoundException with an exception message
* @param message - the exception message
*/
public ResourceNotFoundException(String message) {
super(message);
// TODO Auto-generated constructor stub
}
/**
* Constructs a new ResourceNotFoundException with an exception message and a root cause
* @param message - the exception message
* @param cause - the root cause of this exception
*/
public ResourceNotFoundException(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}
/**
* Constructs a new ResourceNotFoundException with a root cause
* @param cause - the root cause of this exception
*
*/
public ResourceNotFoundException(Throwable cause) {
super(cause);
// TODO Auto-generated constructor stub
}
}
| [
"[email protected]"
] | |
20517b657455380925e0e5dc5255b1df20b8e970 | 39ab9de5107dc1df998156a8aa4dcdea66730f33 | /ucv-android-master/ucv-android-master/app/src/main/java/com/creatio/imm/Adapters/ADBusiness.java | d061b1c1f94d4cce17f1cc5368b0b5bfeae7cef3 | [] | no_license | JuanPenaloza1987/Unidas_Con_Valor | b4bbd6cc6868088c82afc6640171e92542f1ba12 | e9fb41a86c7f659b0fafcaf08b369c3a8476a05b | refs/heads/master | 2021-02-16T17:12:27.851576 | 2020-03-05T00:03:31 | 2020-03-05T00:03:31 | 245,027,261 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,842 | java | package com.creatio.imm.Adapters;
import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.CardView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
import com.creatio.imm.ItemsBusiness;
import com.creatio.imm.Objects.OBusiness;
import com.creatio.imm.R;
import java.util.ArrayList;
/**
* Created by gerardo on 18/06/18.
*/
public class ADBusiness extends BaseAdapter {
private Context context;
private ArrayList<OBusiness> data = new ArrayList<>();
public ADBusiness(Context context, ArrayList<OBusiness> data) {
this.context = context;
this.data = data;
}
@Override
public int getCount() {
return data.size();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
final LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View item = inflater.inflate(R.layout.item_business, parent, false);
ImageView img = item.findViewById(R.id.img);
TextView txtName = item.findViewById(R.id.txtName);
TextView txtCan = item.findViewById(R.id.txtCan);
TextView txtDescription = item.findViewById(R.id.txtDesc);
Button btnCupons = item.findViewById(R.id.btnCupons);
CardView cv = item.findViewById(R.id.cv);
if (data.get(position).getCan_reserve().equalsIgnoreCase("0")){
txtCan.setVisibility(View.INVISIBLE);
}else{
txtCan.setVisibility(View.INVISIBLE);
}
cv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context, ItemsBusiness.class);
intent.putExtra("ID_business", data.get(position).getID());
intent.putExtra("image", data.get(position).getImage());
intent.putExtra("name", data.get(position).getName());
intent.putExtra("can_reserve", data.get(position).getCan_reserve());
context.startActivity(intent);
}
});
txtName.setText(data.get(position).getName());
txtDescription.setText(data.get(position).getDescription());
RequestOptions options = new RequestOptions()
.placeholder(R.drawable.no_image)
.error(R.drawable.no_image)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.centerCrop()
.override(1000, 1000)
.priority(Priority.HIGH);
Glide.with(context)
.load(data.get(position).getImage())
.apply(options)
.into(img);
btnCupons.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context, ItemsBusiness.class);
intent.putExtra("ID_business", data.get(position).getID());
intent.putExtra("image", data.get(position).getImage());
intent.putExtra("name", data.get(position).getName());
intent.putExtra("can_reserve", data.get(position).getCan_reserve());
context.startActivity(intent);
}
});
return item;
}
}
| [
"[email protected]"
] | |
ea4802fe554a9b1b30320998559606129cd3d627 | db2cd2a4803e546d35d5df2a75b7deb09ffadc01 | /nemo-tfl-batch/src/main/java/com/novacroft/nemo/tfl/batch/action/impl/cubic/ReconcileAutoLoadChangeActionImpl.java | 7200f586a42383934cd2b9494b174ee24b631945 | [] | no_license | balamurugan678/nemo | 66d0d6f7062e340ca8c559346e163565c2628814 | 1319daafa5dc25409ae1a1872b1ba9b14e5a297e | refs/heads/master | 2021-01-19T17:47:22.002884 | 2015-06-18T12:03:43 | 2015-06-18T12:03:43 | 37,656,983 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,281 | java | package com.novacroft.nemo.tfl.batch.action.impl.cubic;
import com.novacroft.nemo.tfl.batch.action.cubic.ImportRecordAction;
import com.novacroft.nemo.tfl.batch.domain.ImportRecord;
import com.novacroft.nemo.tfl.batch.domain.cubic.AutoLoadChangeRecord;
import com.novacroft.nemo.tfl.common.application_service.ReconcileAutoLoadChangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Action to reconcile all auto load change records from CUBIC
*/
@Component("reconcileAutoLoadChangeAction")
public class ReconcileAutoLoadChangeActionImpl implements ImportRecordAction {
@Autowired
protected ReconcileAutoLoadChangeService reconcileAutoLoadChangeService;
@Override
public void handle(ImportRecord record) {
AutoLoadChangeRecord autoLoadChangeRecord = (AutoLoadChangeRecord) record;
this.reconcileAutoLoadChangeService
.reconcileChange(autoLoadChangeRecord.getRequestSequenceNumber(), autoLoadChangeRecord.getPrestigeId(),
autoLoadChangeRecord.getNewAutoLoadConfiguration(), autoLoadChangeRecord.getStatusOfAttemptedAction(),
autoLoadChangeRecord.getFailureReasonCode());
}
}
| [
"[email protected]"
] | |
261c8fbbd5443ad1d8cec8225d1fdcfe9d4acf96 | 27fdfa63b4d062058440a95ec29a334033fd2f77 | /app/src/test/java/com/kk/solution/dev/chatfirebase/ExampleUnitTest.java | 45d907c7d75484035a699fbfa81dec342a0312fc | [] | no_license | UncagedMist/ChatFireBase | 6dc4c595cba208772f7a75431f0e1427983a8e27 | fea4c67f46b1ca5b93ec038c79caeb45bd2888bf | refs/heads/master | 2021-09-15T04:22:30.358792 | 2018-05-25T19:24:05 | 2018-05-25T19:24:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 410 | java | package com.kk.solution.dev.chatfirebase;
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]"
] | |
5ff764f1cf8c79ad3ca3a6a2852943bf3d21c98a | 891ee6fd497c8aab932b386d78801700c6e2f24e | /Day-17/similar.java | 9a09c8a3b86363506490ca74811bc2c40b4777f9 | [] | no_license | Namanshkh/100daysofcode | 24451dfed12532f4850f5baf8df84baebba9dc7d | 483c0d94a71445d9784d6a3d1500461caf2b470f | refs/heads/main | 2023-08-20T02:14:02.703339 | 2021-10-08T14:46:17 | 2021-10-08T14:46:17 | 392,814,434 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | public static boolean areSimilar(Node n1, Node n2) {
if (n1.children.size() != n2.children.size()) {
return false;
}
for (int i = 0; i < n1.children.size(); i++) {
Node c1 = n1.children.get(i);
Node c2 = n2.children.get(i);
if (areSimilar(c1, c2) == false) {
return false;
}
}
return true;
}
| [
"[email protected]"
] | |
5dad0eb91c31699ff5a10738de5a3daa4d5658bd | 1f30af7bf56cda8a0f2ac66b03874ce2566cd9ff | /languages/BSML/source_gen/BSML/behavior/RegionLocalDeclaration_Behavior.java | 605fb8974654c2baa5d5886a0998b22aa2785655 | [] | no_license | z9luo/BSML-mbeddr-MPS3.2 | 26cd19f0d524d0932bd9ecc7086e54b89800cf50 | 466cbf0d92c8c5d45b19062a6ba069eab333a48a | refs/heads/master | 2020-07-05T17:58:39.262828 | 2016-10-24T07:33:10 | 2016-10-24T07:33:10 | 67,258,964 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 203 | java | package BSML.behavior;
/*Generated by MPS */
/**
* Will be removed after 3.3
* Need to support the legacy static direct method calls
*/
@Deprecated
public class RegionLocalDeclaration_Behavior {
}
| [
"[email protected]"
] | |
13a89966c7f14e8ae778a125b1ce0953644be937 | 67878c79f8f92bad9f20d4b65419016273a9c392 | /back_end/ChildHood/src/edu/buu/childhood/login/service/LoginServiceImpl.java | 7a07612eefa42cb49988c4f7a03aa51408d6421f | [] | no_license | buutongnian/ChildHood | ef3724968afcbfe249607cf44c7f798348bc5db2 | 3cc129f7238f7ddac2543e5d1fe1ba2a8071de04 | refs/heads/master | 2021-01-19T02:29:51.323050 | 2017-01-23T08:14:20 | 2017-01-23T08:14:20 | 60,964,086 | 0 | 0 | null | 2017-01-07T17:08:26 | 2016-06-12T11:37:30 | Java | UTF-8 | Java | false | false | 4,150 | java | package edu.buu.childhood.login.service;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import edu.buu.childhood.achvmt.service.EventSupport;
import edu.buu.childhood.achvmt.service.TriggerService;
import edu.buu.childhood.common.C;
import edu.buu.childhood.login.dao.LoginDao;
import edu.buu.childhood.login.pojo.UserLogin;
import edu.buu.childhood.util.MD5;
/**
* 2016/6/22
*
* @author joe
* @note 登录模块业务逻辑操作类
*/
public class LoginServiceImpl implements LoginService,EventSupport {
@Override
public String moduleName() {
return "login";
}
private Logger logger = Logger.getLogger(this.getClass());
@Autowired
private LoginDao loginDao;
private TriggerService triggerService;
public LoginServiceImpl() {
super();
}
public LoginServiceImpl(TriggerService triggerService){
super();
this.triggerService = triggerService;
triggerService.registerModule(this);
}
/**
* 2016/6/22 判断登录是否合法,检测用户是否存在、用户名是否正确 密码采用MD5小写32位加密方法
*
* @author joe
* @param userName
* 用户名
* @param password
* 密码
* @param userFromDB
* 通过用户名从数据库中取出的用户登录信息对象
* @return 返回登录状态编码,对应C.java常量文件中定义
*/
@Override
@Transactional
public String loginCheck(String userName, String userPwd) {
UserLogin userFromDB = loginDao.queryByUserName(userName);
if (userFromDB != null) {
if (userFromDB.getUserPwd().trim()
.equals(MD5.enc32Bit(userPwd).trim())) {
// 返回登录成功信息,供Action判断转发信息(Web端或App端分别处理)
return C.LoginStatus.LOGIN_SUCCESS;
} else {
// 返回密码错误信息,供Action判断转发信息(Web端或App端分别处理)
return C.LoginStatus.PASSWORD_INCORRECT;
}
} else {
// 返回用户不存在信息,供Action判断转发信息(Web端或App端分别处理)
return C.LoginStatus.USER_NOT_EXIST;
}
}
/**
* 2016/6/22 更改登录状态(主要供App端使用)
*
* @author joe
* @param userName
* 用户名
* @param loginStatus
* 登录状态编码,传入时使用C.java中定义的常量
* @return 返回是否修改成功(true或false)
*/
@Override
@Transactional
public boolean changeLoginStatus(String userName, String loginStatus) {
try {
UserLogin user = new UserLogin();
user.setUserName(userName);
user.setLoginStatus(loginStatus);
loginDao.update(user);
triggerService.triggerEvent(this, userName);
// 记录登录状态修改日志
logger.info("[" + userName + "]修改登录状态为:" + loginStatus);
return true;
} catch (Exception e) {
logger.error(e, e);
return false;
}
}
/**
* 2016/6/24 更改登录经纬度信息(主要供App端使用)
*
* @author joe
* @param userName
* 用户名
* @param lastLatitude
* 登录纬度
* @param lastLongitude
* 登录经度
* @return 返回是否修改成功(true或false)
*/
@Override
@Transactional
public boolean updateLoginInf(String userName, double lastLatitude,
double lastLongitude) {
try {
loginDao.update(userName, lastLatitude, lastLongitude);
logger.info(userName + "在纬度:[" + lastLatitude + "]经度:["
+ lastLongitude + "]登录");
return true;
} catch (Exception e) {
logger.error(e, e);
return false;
}
}
public String statusCheck(String userName) {
UserLogin userFromDB = loginDao.queryByUserName(userName);
if (userFromDB != null) {
if (C.status.ONLINE.equals(userFromDB.getLoginStatus())) {
// 返回API请求验证合法信息,供Filter判断请求是否合法
return C.security.LEGAL;
} else {
// 返回API请求不合法,请求API用户未登陆
return C.security.USER_NOT_LOGIN;
}
} else {
// 返回API请求不合法,用户不存在
return C.security.USER_NOT_EXIST;
}
};
}
| [
"[email protected]"
] | |
d49bf969739694d2deb75f5f705c7e5ef5cb620b | ccb220316d0e5721e3097293d3dbb77a3452b7b2 | /cadastro_produto.java | a337a5ed233ba9f6930a58dd4c07bf2f1be9c2e0 | [] | no_license | agcanthony/SistemaAFG | bc6077eb8094a97a6f13296c8d0171508c0df221 | 274fcc52520b0d159bad55f0a096cb0d2389c299 | refs/heads/main | 2023-02-27T06:16:18.897856 | 2021-02-01T15:15:29 | 2021-02-01T15:15:29 | 334,990,445 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 9,711 | java | import java.sql.*;
import javax.swing.*;
import javax.swing.text.*;
import java.awt.*;
import java.awt.event.*;
import java.text.*;
import javax.swing.JButton;
//----------------------------------------------------//
public class cadastro_produto extends JFrame implements ActionListener{
ResultSet resultSet;
Statement statement;
JLabel P,
rotuloValor,
rotuloCod,
rotuloDes,
rotuloMarca;
//------------------------------------------------------//
static JTextField Cod,
Valor,
Descri,
Marca;
//------------------------------------------------------//
MaskFormatter mascaraCod,
mascaraDes,
mascaraMarca;
//------------------------------------------------------//
JButton btGravar,
btAlterar,
btExcluir,
btlocalizar,
btNovo,
btCancelar;
//------------------------------------------------------//
JScrollPane caixa;
//------------------------------------------------------//
public static void main(String args[]){
JFrame janela = new cadastro_produto();
janela.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
janela.setVisible(true);
}
cadastro_produto(){
super("Cadastro de Produto");
P=new JLabel("Produtos");
P.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
P.setForeground(new java.awt.Color(100, 10, 0));
Container tela = getContentPane();
setLayout(null);
rotuloCod = new JLabel("Código: ");
rotuloDes = new JLabel("Descrição: ");
rotuloMarca = new JLabel("Marca: ");
rotuloValor = new JLabel("Valor: ");
P.setBounds(290,20,200,20);
rotuloCod.setBounds(100,80,120,40);
rotuloDes.setBounds(100,120,130,40);
rotuloMarca.setBounds(100,160,100,40);
rotuloValor.setBounds(100,200,80,40);
try{
mascaraCod =new MaskFormatter("#####");
mascaraDes =new MaskFormatter("*********************************************");
mascaraMarca = new MaskFormatter("******************************************");
mascaraCod.setPlaceholderCharacter('_');
mascaraDes.setPlaceholderCharacter(' ');
mascaraMarca.setPlaceholderCharacter(' ');
}
catch(ParseException excp){}
Cod = new JTextField(6);
Descri = new JTextField(30);
Marca = new JTextField(15);
Valor = new JTextField(10);
Cod.setBounds(180,90,41,20);
Descri.setBounds(180,130,350,20);
Marca.setBounds(180,170,117,20);
Valor.setBounds(180,210,60,20);
tela.add(rotuloCod);
tela.add(rotuloDes);
tela.add(rotuloMarca);
tela.add(rotuloValor);
tela.add(P);
tela.add(Cod);
tela.add(Descri);
tela.add(Marca);
tela.add(Valor);
btGravar = new JButton();
btGravar.setText("Gravar");
btGravar.setBounds(325,300,100,30);
btGravar.setSize(100,25);
btGravar.setBackground(new Color(27,75,153));
btGravar.setForeground(Color.white);
btGravar.setFont(new Font("Tahoma",Font.BOLD,14));
btGravar.addActionListener(this);
tela.add(btGravar);
btAlterar = new JButton();
btAlterar.setText("Alterar");
btAlterar.setBounds(115,250,100,30);
btAlterar.setSize(100,25);
btAlterar.setBackground(new Color(27,75,153));
btAlterar.setForeground(Color.white);
btAlterar.setFont(new Font("Tahoma",Font.BOLD,14));
btAlterar.addActionListener(this);
tela.add(btAlterar);
btExcluir = new JButton();
btExcluir.setText("Excluir");
btExcluir.setBounds(250,250,100,30);
btExcluir.setSize(100,25);
btExcluir.setBackground(new Color(27,75,153));
btExcluir.setForeground(Color.white);
btExcluir.setFont(new Font("Tahoma",Font.BOLD,14));
btExcluir.addActionListener(this);
tela.add(btExcluir);
btlocalizar = new JButton();
btlocalizar.setText("Localizar");
btlocalizar.setBounds(385,250,100,30);
btlocalizar.setSize(100,25);
btlocalizar.setBackground(new Color(27,75,153));
btlocalizar.setForeground(Color.white);
btlocalizar.setFont(new Font("Tahoma",Font.BOLD,14));
btlocalizar.addActionListener(this);
tela.add(btlocalizar);
btNovo = new JButton();
btNovo.setText("Novo");
btNovo.setBounds(190,300,100,30);
btNovo.setSize(100,25);
btNovo.setBackground(new Color(27,75,153));
btNovo.setForeground(Color.white);
btNovo.setFont(new Font("Tahoma",Font.BOLD,14));
btNovo.addActionListener(this);
tela.add(btNovo);
btCancelar = new JButton();
btCancelar.setText("Cancelar");
btCancelar.setBounds(250,350,100,30);
btCancelar.setSize(100,25);
btCancelar.setBackground(new Color(27,75,153));
btCancelar.setForeground(Color.white);
btCancelar.setFont(new Font("Tahoma",Font.BOLD,14));
btCancelar.addActionListener(this);
tela.add(btCancelar);
setBotoes(true,true,false,false,false,false);
setResizable(false);
carregaResultSet();
setSize(620,500);
setLocationRelativeTo(null);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==btNovo)
{
limpaCampos();
setBotoes(false, false,true, false, false,true );
return;
}
if( e.getSource()==btCancelar)
{
limpaCampos();
setBotoes(true,true, false, false, false, false);
return;
}
if(e.getSource()==btGravar)
//gravar registro novo
{
try
{
String sql="INSERT INTO cadastroprod(Cod,Produto1,Marca,ValorProduto)Values('"+
Cod.getText()+"','"+
Descri.getText()+"','"+
Marca.getText()+"','"+
Valor.getText()+"')";
statement.executeUpdate(sql);
JOptionPane.showMessageDialog(null,"Gravacao realizada com sucesso");
setBotoes(true,true,false,true,true,false);
}
catch(SQLException erro)
{
}
carregaResultSet();
}
// --Final da inclusao
//alterar um registro
if(e.getSource()== btAlterar)
{
try
{
String sql = "UPDATE cadastroprod SET " +
"Cod ='"+ Cod.getText()+"',"+
"Produto1 ='"+ Descri.getText()+"',"+
"Marca ='"+ Descri.getText()+"',"+
"ValorProduto ='"+Marca.getText()+"'"+
"WHERE Cod ='"+ Cod.getText()+"'";
int r = statement.executeUpdate(sql);
if(r==1)
JOptionPane.showMessageDialog(null,"Problemas na alteracao");
else
JOptionPane.showMessageDialog(null,"Alteração realizada com sucesso");
setBotoes(true,true,true,true,true,true);
}
catch(SQLException erro)
{
JOptionPane.showMessageDialog(null,"Atualização nao realizada");
}
carregaResultSet();
}
//-------------Final da alteracao
if(e.getSource()==btExcluir)
//Excluir um registro
{
try
{
String sql="SELECT Cod, Descri FROM cadastroprod Where Cod='" +Cod.getText()+"'";
resultSet=statement.executeQuery(sql);
String nome="";
try
{
resultSet.next(); nome="Deletar o Cadastro: " + resultSet.getString("Descri");
}
catch(SQLException exl)
{
JOptionPane.showMessageDialog(null, "Cadastrado nao efetuado");
carregaResultSet(); return; }
int n = JOptionPane.showConfirmDialog(null,nome,"",JOptionPane.YES_NO_OPTION);
if (n==JOptionPane.YES_OPTION)
{
sql="DELETE FROM cadastroprod Where Cod='"+Cod.getText()+"'";
int r=statement.executeUpdate(sql);
if(r==1)
JOptionPane.showMessageDialog(null, "Exclusao realizada com sucesso");
else
JOptionPane.showMessageDialog(null, "Nao foi possivel excluir o Cadastro");
limpaCampos();
setBotoes(true,true,false,false,false,false);
}
}
catch(SQLException erro) {}
carregaResultSet();
}
//-------------Final da exclusao
if(e.getSource()==btlocalizar || e.getSource()==Cod)
{
try
{
String sql ="SELECT * FROM cadastroprod Where Cod ='" +Cod.getText()+"'";
resultSet=statement.executeQuery(sql);
resultSet.next();
atualizaCampos();
setBotoes(true,true, false,true, true, false);
}
catch(SQLException erro)
{
JOptionPane.showMessageDialog(null,"Cadastro nao encontrado");
carregaResultSet();
return;
}
}
}
//-------------------Final da localizacao
public void carregaResultSet(){
String url="jdbc:mysql://localhost/afsistemadb";
try {
Class.forName("com.mysql.jdbc.Driver");
Connection minhaConexao=DriverManager.getConnection(url,"root","");
statement=minhaConexao.createStatement(resultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);;
resultSet=statement.executeQuery("SELECT * FROM cadastroprod");
}
catch(ClassNotFoundException erro)
{
System.out.println("Driver nao encontrado");
}
catch(SQLException erro)
{
System.out.println("Problemas na conexao com a fonte de dados");
}
}
public static void limpaCampos()
{
Cod.setText("");
Descri.setText("");
Marca.setText("");
Valor.setText("");
}
public void atualizaCampos()
{
try
{
Cod.setText(resultSet.getString("Cod"));
Descri.setText(resultSet.getString("Produto1"));
Marca.setText(resultSet.getString("Marca"));
Valor.setText(resultSet.getString("ValorProduto"));
}
catch(SQLException erro){}
}
public void setBotoes(boolean bNovo, boolean blocalizar, boolean bGravar, boolean bAlterar, boolean bExcluir, boolean bCancelar)
{
btNovo.setEnabled(bNovo);
btlocalizar.setEnabled(blocalizar);
btGravar.setEnabled(bGravar);
btAlterar.setEnabled(bAlterar);
btExcluir.setEnabled(bExcluir);
btCancelar.setEnabled(bCancelar);
}
} | [
"[email protected]"
] | |
cea2eee87153d1279a6eb8dff255aa2e5afe163a | 7f20b1bddf9f48108a43a9922433b141fac66a6d | /coreplugins/tags/Cyto-2.5.0-beta3/RFilters/src/RFilters/cytoscape/CsFilter.java | 46140b867c49a41eeb650331ccbaa777b4bfac05 | [] | no_license | ahdahddl/cytoscape | bf783d44cddda313a5b3563ea746b07f38173022 | a3df8f63dba4ec49942027c91ecac6efa920c195 | refs/heads/master | 2020-06-26T16:48:19.791722 | 2013-08-28T04:08:31 | 2013-08-28T04:08:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,613 | java |
/*
Copyright (c) 2006, 2007, The Cytoscape Consortium (www.cytoscape.org)
The Cytoscape Consortium is:
- Institute for Systems Biology
- University of California San Diego
- Memorial Sloan-Kettering Cancer Center
- Institut Pasteur
- Agilent Technologies
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
any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
documentation provided hereunder is on an "as is" basis, and the
Institute for Systems Biology and the Whitehead Institute
have no obligations to provide maintenance, support,
updates, enhancements or modifications. In no event shall the
Institute for Systems Biology and the Whitehead Institute
be liable to any party for direct, indirect, special,
incidental or consequential damages, including lost profits, arising
out of the use of this software and its documentation, even if the
Institute for Systems Biology and the Whitehead Institute
have been advised of the possibility of such damage. See
the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
package filter.cytoscape;
import cytoscape.*;
import cytoscape.data.*;
import cytoscape.plugin.*;
import cytoscape.util.*;
import cytoscape.view.*;
import filter.model.*;
import filter.view.*;
import java.awt.event.*;
import java.beans.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
/**
*
*/
public class CsFilter extends CytoscapePlugin implements PropertyChangeListener {
protected JFrame frame;
protected FilterUsePanel filterUsePanel;
/**
* Creates a new CsFilter object.
*/
public CsFilter() {
initialize();
}
/**
* DOCUMENT ME!
*
* @param e DOCUMENT ME!
*/
public void propertyChange(PropertyChangeEvent e) {
if (e.getPropertyName() == Cytoscape.CYTOSCAPE_EXIT) {
Iterator i = FilterManager.defaultManager().getFilters();
// StringBuffer buffer = new StringBuffer();
try {
File filter_file = CytoscapeInit.getConfigFile("filter.props");
BufferedWriter writer = new BufferedWriter(new FileWriter(filter_file));
while (i.hasNext()) {
try {
Filter f = (Filter) i.next();
writer.write(FilterManager.defaultManager().getFilterID(f) + "\t"
+ f.getClass() + "\t" + f.output());
writer.newLine();
} catch (Exception ex) {
System.out.println("Error with Filter output");
}
}
writer.close();
} catch (Exception ex) {
System.out.println("Filter Write error");
ex.printStackTrace();
}
}
}
/**
* DOCUMENT ME!
*/
public void initialize() {
Cytoscape.getSwingPropertyChangeSupport().addPropertyChangeListener(this);
try {
File filter_file = CytoscapeInit.getConfigFile("filter.props");
BufferedReader in = new BufferedReader(new FileReader(filter_file));
String oneLine = in.readLine();
while (oneLine != null) {
if (oneLine.startsWith("#")) {
// comment
} else {
FilterManager.defaultManager().createFilterFromString(oneLine);
}
oneLine = in.readLine();
}
in.close();
} catch (Exception ex) {
System.out.println("Filter Read error");
ex.printStackTrace();
}
// create icons
ImageIcon icon = new ImageIcon(getClass().getResource("/stock_filter-data-by-criteria.png"));
ImageIcon icon2 = new ImageIcon(getClass()
.getResource("/stock_filter-data-by-criteria-16.png"));
//
//FilterPlugin action = new FilterPlugin(icon, this);
FilterMenuItem menu_action = new FilterMenuItem(icon2, this);
//Cytoscape.getDesktop().getCyMenus().addCytoscapeAction( ( CytoscapeAction )action );
Cytoscape.getDesktop().getCyMenus().addCytoscapeAction((CytoscapeAction) menu_action);
//CytoscapeDesktop desktop = Cytoscape.getDesktop();
//CyMenus cyMenus = desktop.getCyMenus();
//CytoscapeToolBar toolBar = cyMenus.getToolBar();
//JButton button = new JButton(icon);
//button.addActionListener(action);
//button.setToolTipText("Create and apply filters");
//button.setBorderPainted(false);
//toolBar.add(button);
FilterEditorManager.defaultManager().addEditor(new NumericAttributeFilterEditor());
FilterEditorManager.defaultManager().addEditor(new StringPatternFilterEditor());
FilterEditorManager.defaultManager().addEditor(new NodeTopologyFilterEditor());
FilterEditorManager.defaultManager().addEditor(new BooleanMetaFilterEditor());
FilterEditorManager.defaultManager().addEditor(new NodeInteractionFilterEditor());
FilterEditorManager.defaultManager().addEditor(new EdgeInteractionFilterEditor());
}
/**
* DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public FilterUsePanel getFilterUsePanel() {
if (filterUsePanel == null) {
filterUsePanel = new FilterUsePanel(frame);
}
return filterUsePanel;
}
/**
* DOCUMENT ME!
*/
public void show() {
if (frame == null) {
frame = new JFrame("Use Filters");
frame.getContentPane().add(getFilterUsePanel());
frame.pack();
//Cytoscape.getDesktop().getCytoPanel( SwingConstants.SOUTH ).add(getFilterUsePanel());
}
frame.setVisible(true);
}
}
| [
"mes@0ecc0d97-ab19-0410-9704-bfe1a75892f5"
] | mes@0ecc0d97-ab19-0410-9704-bfe1a75892f5 |
d1939dd4da54980729de43e7635697218ee71003 | a4f86ab8dd9a6e73024b6647622eb47562b016da | /src/com/review/AbstractAppDemo.java | 565861879085c16eaee6d8542e451b23c486db96 | [] | no_license | zjs1224522500/JavaSE | 819f637e9b5df3e3f33e7d12c45f712c3826d075 | e4b38541a55dd0dba59a7d3b5d2c04663c8dad97 | refs/heads/master | 2021-01-21T18:21:10.099571 | 2017-05-30T07:14:28 | 2017-05-30T07:14:28 | 92,033,914 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,081 | java | /**
* <p>Project: 网络管理委员会招新网站, NetUnion Recruit WebSite </p>
* <p>File: AbstractAppDemo.java</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2017</p>
* @author 张健顺
* @email: [email protected]
* @date 2017年5月14日
*/
package com.review;
import java.util.Random;
/**
* 抽象类的应用
*/
public class AbstractAppDemo {
public static void main(String[] args) {
Palace palace = new Shemale("Lucy");
System.out.println("start !!!");
palace.action();
}
}
abstract class Palace{
public void action(){
if(competition()){
System.out.println("success!!!");
}else{
System.out.println("failure");
}
}
//比赛方法
public abstract boolean competition();//抽象方法
}
class Shemale extends Palace{
private String name;
public Shemale(String name){
this.name = name;
}
@Override
public boolean competition() {
System.out.println("I am "+name);
System.out.println("Competition starts!!!");
Random random = new Random();
//随机产生 boolean 值
return random.nextBoolean();
}
}
| [
"[email protected]"
] | |
77a2ed4e1bb3f85dee21fcd85f5e049d77ca72b9 | 4c78e2c7e129493ed849033a8333f6b0a4f149e6 | /myenum/PlaceEnum.java | f66bac6460938419d6852ed1b4306e3f32dbaffb | [] | no_license | IshinagiMoeta/LostFind | cbd86153f625f7ffe6a6199fd9cb462f5d8f5cdc | 8506047310a0d321f901f97e2dae5232155c91f6 | refs/heads/master | 2021-01-01T18:38:41.043256 | 2017-07-26T06:26:05 | 2017-07-26T06:26:05 | 98,387,167 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 124 | java | package com.whitesharkapps.lostfind.myenum;
/**
* Created by ketianxing on 2017/7/13.
*/
public interface PlaceEnum {
}
| [
"[email protected]"
] | |
750c8a21d90547cb6fbfe4efdee47ab36d8bebb5 | 743592757b5229f2dc1386d38146d323e46da967 | /02 Java/Ex04/ConstructorDemo.java | 2e54842c9966c3c90dd33b59248297eda79b9ddf | [] | no_license | Sherlock20200304/fullstackdeveloper | 74db1abbc9f5abecc53513349c711adc867fda9f | 9cc949137a287719744ca106f568924a714d7ec3 | refs/heads/master | 2023-04-13T16:14:35.503222 | 2021-04-20T15:01:35 | 2021-04-20T15:01:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 443 | java | class ConstructorDemo
{
public ConstructorDemo()
{
System.out.println("Inside ConstructorDemo Constructor ");
}
public ConstructorDemo(String name)
{
System.out.println("Inside ConstructorDemo Constructor Name: "+ name);
}
public static void main(String[] args) {
ConstructorDemo obj = new ConstructorDemo();
ConstructorDemo obj1 = new ConstructorDemo("Zack");
System.out.println("Inside ConstructorDemo Main Method");
}
} | [
"[email protected]"
] | |
d4992eb53e27f72ac9da0a50c6db5dc713bc3d92 | 733534e3b5d1ac3a2c49962007f12f526cba6cdb | /QUIZ_PBO_ARI-GUNAWAN_A-/src/com/pbo_p2/Main.java | 352a998f0b1636f886a82c8936dfa6f733e7ef0e | [] | no_license | ari-gunawan/PBO | 75bfc2e3007050b2904ee333af2cf88b312cd292 | 0fe7fc4600e100de731138c182e30c7d30e71608 | refs/heads/main | 2023-01-21T16:40:29.194521 | 2020-11-24T15:41:30 | 2020-11-24T15:41:30 | 301,753,433 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,526 | java | package com.pbo_p2;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// 1. Buatlah program dengan konsep OOP, untuk menginput 3 buah
// nilai dari keyboard. Lalu hasilnya dikumlah dan ditampilkan ke layar monitor
Scanner in = new Scanner(System.in);
Scanner in2 = new Scanner(System.in);
Scanner in3 = new Scanner(System.in);
variable ob = new variable();
int a;
int b;
int c;
System.out.println("Masukkan Nilai A : ");
a =in.nextInt();
System.out.println("Masukkan Nilai B : ");
b = in2.nextInt();
System.out.println("Masukkan Nilai C : ");
c = in3.nextInt();
ob.setA(a);
ob.setB(b);
ob.setC(c);
// no.1
ob.hitung();
// no.2
ob.hitung1();
//no.3
ob.hitung2();
// no.4
soalEmpat ob4 = new soalEmpat();
Scanner in4 = new Scanner(System.in);
Scanner in5 = new Scanner(System.in);
Scanner in6 = new Scanner(System.in);
Scanner in7 = new Scanner(System.in);
Scanner in8 = new Scanner(System.in);
Scanner in9 = new Scanner(System.in);
Scanner in10 = new Scanner(System.in);
int internet,ketik,gameOnline;
int scan,warna,hitamPutih,tehBotol;
System.out.println("~~~WARNET CONNECT~~~");
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~");
System.out.println("Masukkan waktu pemakaian");
System.out.println("Internet : ");
internet = in4.nextInt();
System.out.println("Mengetik : ");
ketik = in5.nextInt();
System.out.println("Game online : ");
gameOnline = in6.nextInt();
ob4.setInternet(internet);
ob4.setKetik(ketik);
ob4.setGameOnline(gameOnline);
System.out.println("Tambahan fasilitas");
System.out.println("Scan file : ");
scan = in7.nextInt();
System.out.println("print= warna : ");
warna = in8.nextInt();
System.out.println("print= hitam putih : ");
hitamPutih = in9.nextInt();
System.out.println("teh botol : ");
tehBotol = in10.nextInt();
ob4.setScan(scan);
ob4.setWarna(warna);
ob4.setHitamPutih(hitamPutih);
ob4.setTehBotol(tehBotol);
ob4.biaya();
}
}
| [
"[email protected]"
] | |
29ab8e86a05b814df8b69c8ccf43558e17f5cfef | ea43f4cbcd1a1ae58dea0b6fbe51ffd4ec37a017 | /src/me/xiaopan/pullview/PullTouchListener.java | 6c9658256e3113ffd7817f7948929fd367a24117 | [
"Apache-2.0"
] | permissive | wang9090980/Android-PullView | d83dadc65faa7683de0373912be7bda97000d71f | 05088663d30df3b26551110441faeb070f1a0d3e | refs/heads/master | 2021-01-22T10:22:39.029272 | 2014-03-26T09:17:37 | 2014-03-26T09:17:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,890 | java | /*
* Copyright (C) 2013 Peng fei Pan <[email protected]>
*
* 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 me.xiaopan.pullview;
import me.xiaopan.pullview.PullGestureDetector.OnTouchListener;
import me.xiaopan.pullview.PullViewBase.PullStatus;
import android.view.MotionEvent;
/**
* 触摸事件处理监听器
*/
@SuppressWarnings("rawtypes")
public class PullTouchListener implements OnTouchListener {
private PullViewBase pullViewBase;
public PullTouchListener(PullViewBase pullViewBase) {
super();
this.pullViewBase = pullViewBase;
}
@Override
public boolean onTouchDown(MotionEvent e) {
if(pullViewBase.getPullScroller().isScrolling()){
pullViewBase.getPullScroller().abortScroll();
}
pullViewBase.setInterceptTouchEvent(false);
return true;
}
@SuppressWarnings("unchecked")
@Override
public boolean onTouchScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
switch(pullViewBase.getPullStatus()){
case PULL_HEADER :
if(pullViewBase.isVerticalPull()){
pullViewBase.scrollBy(0, (int) (distanceY * pullViewBase.getElasticForce()));
if(pullViewBase.getScrollY() >= 0 && Math.abs(distanceY) <= 10){
pullViewBase.setPullStatus(PullStatus.NORMAL);
}
}else{
pullViewBase.scrollBy((int) (distanceX * pullViewBase.getElasticForce()), 0);
if(pullViewBase.getScrollX() >= 0 && Math.abs(distanceX) <= 10){
pullViewBase.setPullStatus(PullStatus.NORMAL);
}
}
if(pullViewBase.getPullHeaderView() != null){
pullViewBase.getPullHeaderView().onScroll(Math.abs(pullViewBase.isVerticalPull()?pullViewBase.getScrollY():pullViewBase.getScrollX()));
}
pullViewBase.scrollPullViewToHeader(pullViewBase.getPullView());
break;
case PULL_FOOTER :
if(pullViewBase.isVerticalPull()){
pullViewBase.scrollBy(0, (int) (distanceY * pullViewBase.getElasticForce()));
if(pullViewBase.getScrollY() <= 0 && Math.abs(distanceY) <= 10){
pullViewBase.setPullStatus(PullStatus.NORMAL);
}
}else{
pullViewBase.scrollBy((int) (distanceX * pullViewBase.getElasticForce()), 0);
if(pullViewBase.getScrollX() <= 0 && Math.abs(distanceX) <= 10){
pullViewBase.setPullStatus(PullStatus.NORMAL);
}
}
if(pullViewBase.getPullFooterView() != null){
pullViewBase.getPullFooterView().onScroll(Math.abs(pullViewBase.isVerticalPull()?pullViewBase.getScrollY():pullViewBase.getScrollX()));
}
pullViewBase.scrollPullViewToFooter(pullViewBase.getPullView());
break;
default :
if(pullViewBase.isVerticalPull()){
if(distanceY < 0){ //如果向下拉
if(pullViewBase.getScrollY() > 0){
//如果Footer正在显示就先通过滚动隐藏Footer
pullViewBase.logD("滚动:手动回滚Footer,ScrollY=" + pullViewBase.getScrollY());
pullViewBase.scrollBy(0, (int) (distanceY));
pullViewBase.scrollPullViewToFooter(pullViewBase.getPullView());
}else{
//如果可以拉伸Header并且
if(pullViewBase.isCanPullHeader(pullViewBase.getPullView())){
if(pullViewBase.getScrollY() <= (pullViewBase.getPullHeaderView() != null?pullViewBase.getPullHeaderView().getMinScrollValue():0)){
pullViewBase.logD("滚动:开始拉伸头部,ScrollY=" + pullViewBase.getScrollY());
pullViewBase.setPullStatus(PullStatus.PULL_HEADER);
}
}
}
}else if(distanceY > 0){ //如果向上拉
if(pullViewBase.getScrollY() < 0){
//如果Header正在显示就先通过滚动隐藏Header
pullViewBase.logD("滚动:手动回滚Header,ScrollY=" + pullViewBase.getScrollY());
pullViewBase.scrollBy(0, (int) (distanceY));
pullViewBase.scrollPullViewToHeader(pullViewBase.getPullView());
}else{
//如果可以拉伸Footer
if(pullViewBase.isCanPullFooter(pullViewBase.getPullView())){
pullViewBase.logD("滚动:开始拉伸尾部,ScrollY=" + pullViewBase.getScrollY());
pullViewBase.setPullStatus(PullStatus.PULL_FOOTER);
}
}
}
}else{
if(distanceX < 0){ //如果向右拉
if(pullViewBase.getScrollX() > 0){
//如果Footer正在显示就先通过滚动隐藏Footer
pullViewBase.logD("滚动:手动回滚Footer,ScrollX=" + pullViewBase.getScrollX());
pullViewBase.scrollBy((int) (distanceX), 0);
pullViewBase.scrollPullViewToFooter(pullViewBase.getPullView());
}else{
//如果可以拉伸Header并且
if(pullViewBase.isCanPullHeader(pullViewBase.getPullView())){
if(pullViewBase.getScrollX() <= (pullViewBase.getPullHeaderView() != null?pullViewBase.getPullHeaderView().getMinScrollValue():0)){
pullViewBase.logD("滚动:开始拉伸头部,ScrollX=" + pullViewBase.getScrollX());
pullViewBase.setPullStatus(PullStatus.PULL_HEADER);
}
}
}
}else if(distanceX > 0){ //如果向左拉
if(pullViewBase.getScrollX() < 0){
//如果Header正在显示就先通过滚动隐藏Header
pullViewBase.logD("滚动:手动回滚Header,ScrollX=" + pullViewBase.getScrollX());
pullViewBase.scrollBy((int) (distanceX), 0);
pullViewBase.scrollPullViewToHeader(pullViewBase.getPullView());
}else{
//如果可以拉伸Footer
if(pullViewBase.isCanPullFooter(pullViewBase.getPullView())){
pullViewBase.logD("滚动:开始拉伸尾部,ScrollX=" + pullViewBase.getScrollX());
pullViewBase.setPullStatus(PullStatus.PULL_FOOTER);
}
}
}
}
break;
}
return true;
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
pullViewBase.setInterceptTouchEvent(pullViewBase.getPullStatus() != PullStatus.NORMAL);
return true;
}
@Override
public void onTouchUpOrCancel() {
pullViewBase.getPullScroller().rollback();
}
}
| [
"[email protected]"
] | |
0c597def8c5edd17bbf6738f4fb2af6276bb423f | 44ec741b7dcd961b3d189f25d2c2f3d23280525b | /app/src/main/java/com/slightech/testwficonnectandsave/ObjectSaveUitls.java | e74ddf3029450f3070e335aa7ced7db27fa4aa21 | [] | no_license | zhaozong/TestWfiConnectAndSave | 5b030cac8fe5010da3ee980afeeddcc1044d7c12 | 6c19c490895069cefef7aba3da4c674cf37f675f | refs/heads/master | 2021-01-18T15:42:15.665292 | 2017-03-30T07:42:45 | 2017-03-30T07:42:45 | 86,673,837 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,518 | java | package com.slightech.testwficonnectandsave;
import android.content.SharedPreferences;
import android.text.TextUtils;
import android.util.Log;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Rokey on 2017/3/29.
*/
public class ObjectSaveUitls {
/**
* 存储ObjectList
* @param sp
* @param sKey
* @param <T>
* @return
*/
public static <T> boolean saveArray(SharedPreferences sp, List<T> sKey) {
SharedPreferences.Editor mEdit1 = sp.edit();
mEdit1.putInt("Status_size", sKey.size());
for (int i = 0; i < sKey.size(); i++) {
mEdit1.remove("Status_" + i);
saveObject("Status_" + i,sKey.get(i),mEdit1);
}
return mEdit1.commit();
}
/**
* 获取objectList
* @param sp
* @param <T>
* @return
*/
public static <T> List<T> loadArray(SharedPreferences sp) {
List<T> sKey = new ArrayList<>();
sKey.clear();
int size = sp.getInt("Status_size", 0);
for (int i = 0; i < size; i++) {
T t = (T) readObject("Status_" + i,sp);
sKey.add(t);
}
return sKey;
}
/**
* desc:保存对象
*
* @param key
* @param obj 要保存的对象,只能保存实现了serializable的对象
*/
public static void saveObject(String key, Object obj, SharedPreferences.Editor sharedata) {
try {
// 保存对象
//先将序列化结果写到byte缓存中,其实就分配一个内存空间
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream os = new ObjectOutputStream(bos);
//将对象序列化写入byte缓存
os.writeObject(obj);
//将序列化的数据转为16进制保存
String bytesToHexString = bytesToHexString(bos.toByteArray());
//保存该16进制数组
sharedata.putString(key, bytesToHexString);
sharedata.commit();
} catch (IOException e) {
e.printStackTrace();
Log.e("", "保存obj失败");
}
}
/**
* desc:将数组转为16进制
*
* @param bArray
* @return modified:
*/
private static String bytesToHexString(byte[] bArray) {
if (bArray == null) {
return null;
}
if (bArray.length == 0) {
return "";
}
StringBuffer sb = new StringBuffer(bArray.length);
String sTemp;
for (int i = 0; i < bArray.length; i++) {
sTemp = Integer.toHexString(0xFF & bArray[i]);
if (sTemp.length() < 2)
sb.append(0);
sb.append(sTemp.toUpperCase());
}
return sb.toString();
}
/**
* desc:获取保存的Object对象
*
* @param key
* @return modified:
*/
public static Object readObject(String key, SharedPreferences sharedata) {
try {
if (sharedata.contains(key)) {
String string = sharedata.getString(key, "");
if (TextUtils.isEmpty(string)) {
return null;
} else {
//将16进制的数据转为数组,准备反序列化
byte[] stringToBytes = StringToBytes(string);
ByteArrayInputStream bis = new ByteArrayInputStream(stringToBytes);
ObjectInputStream is = new ObjectInputStream(bis);
//返回反序列化得到的对象
return is.readObject();
}
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
}catch (IOException e) {
e.printStackTrace();
}
//所有异常返回null
return null;
}
/**
* desc:将16进制的数据转为数组
*
* @param data
* @return modified:
*/
private static byte[] StringToBytes(String data) {
String hexString = data.toUpperCase().trim();
if (hexString.length() % 2 != 0) {
return null;
}
byte[] retData = new byte[hexString.length() / 2];
for (int i = 0; i < hexString.length(); i++) {
int int_ch; // 两位16进制数转化后的10进制数
char hex_char1 = hexString.charAt(i); //两位16进制数中的第一位(高位*16)
int int_ch1;
if (hex_char1 >= '0' && hex_char1 <= '9')
int_ch1 = (hex_char1 - 48) * 16; // 0 的Ascll - 48
else if (hex_char1 >= 'A' && hex_char1 <= 'F')
int_ch1 = (hex_char1 - 55) * 16; // A 的Ascll - 65
else
return null;
i++;
char hex_char2 = hexString.charAt(i); //两位16进制数中的第二位(低位)
int int_ch2;
if (hex_char2 >= '0' && hex_char2 <= '9')
int_ch2 = (hex_char2 - 48); // 0 的Ascll - 48
else if (hex_char2 >= 'A' && hex_char2 <= 'F')
int_ch2 = hex_char2 - 55; // A 的Ascll - 65
else
return null;
int_ch = int_ch1 + int_ch2;
retData[i / 2] = (byte) int_ch;//将转化后的数放入Byte里
}
return retData;
}
}
| [
"[email protected]"
] | |
9701c6a90fd4ab8ee32f62ad794932770a7be8f2 | 741d24ba3f1cb9687add839face5511da9bb3256 | /AndroidFree/src/test/java/com/chewielouie/textadventure/LocationExitFactoryTests.java | 576c84effdee7c454413f211939a5eb06bdf43f8 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | SergeyPtica/text-adventure | efd605197dc8424fd3595700df535bf60002dc1b | 2da3f2d289a7d6e62bde353d69628111769f2e59 | refs/heads/master | 2020-04-07T20:21:12.061355 | 2014-11-14T20:04:44 | 2014-11-14T20:04:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 317 | java | package com.chewielouie.textadventure;
import static org.junit.Assert.*;
import org.junit.Test;
public class LocationExitFactoryTests {
@Test
public void produces_LocationExit_objects() {
Exit exit = new LocationExitFactory().create();
assertTrue( exit instanceof LocationExit );
}
}
| [
"[email protected]"
] | |
f3aa7124265078f4f8bfbd87bc48a6a5e1a3a25b | bb0d45a5d60aad37f528227a70e8912d0a39b924 | /src/main/java/net/caseif/flint/steel/lobby/type/SteelStatusLobbySign.java | 8f39cb052a1c5b7da909f0b6270f57cfec30388e | [
"MIT"
] | permissive | caseif/Steel | e56a18a1ae04c48ee40c868986b5403c13b1ad41 | d2608e62d3a3742c4ea4bae3af735e6e56469942 | refs/heads/master | 2022-04-30T13:47:24.708824 | 2019-04-23T21:55:18 | 2019-04-23T21:55:18 | 34,961,217 | 7 | 8 | null | 2016-04-07T13:55:11 | 2015-05-02T19:49:55 | Java | UTF-8 | Java | false | false | 1,678 | java | /*
* The MIT License (MIT)
*
* Copyright (c) 2015-2016, Max Roncace <[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package net.caseif.flint.steel.lobby.type;
import net.caseif.flint.common.arena.CommonArena;
import net.caseif.flint.lobby.type.StatusLobbySign;
import net.caseif.flint.steel.lobby.SteelLobbySign;
import net.caseif.flint.util.physical.Location3D;
/**
* Implements {@link StatusLobbySign}.
*/
public class SteelStatusLobbySign extends SteelLobbySign implements StatusLobbySign {
public SteelStatusLobbySign(Location3D location, CommonArena arena) {
super(location, arena, Type.STATUS);
}
}
| [
"[email protected]"
] | |
3246ed9ad906fe65d8310b90826e991728d7a432 | e0dd9c46388a928d284f794d4a2428372d5acabc | /app/src/main/java/ru/nsu/bobrofon/easysshfs/log/LogFragment.java | c8cb516f4769114fc3169ac79d350a529c251854 | [] | no_license | cantenna/easysshfs | d54c88e0f1a7f6d92aad81fb29a49b5e8f47c8ae | 329eb46ac562c3c56b8ab42221034efac2cf2ce5 | refs/heads/master | 2020-06-08T23:38:20.948500 | 2015-05-10T14:40:14 | 2015-05-10T14:40:14 | 193,327,765 | 0 | 0 | null | 2019-06-23T09:10:42 | 2019-06-23T09:10:42 | null | UTF-8 | Java | false | false | 2,527 | java | package ru.nsu.bobrofon.easysshfs.log;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import ru.nsu.bobrofon.easysshfs.DrawerStatus;
import ru.nsu.bobrofon.easysshfs.EasySSHFSActivity;
import ru.nsu.bobrofon.easysshfs.R;
public class LogFragment extends Fragment implements LogModel.Observer {
private static final String TAG = "LogFragment";
public static final String TAG_WORKER = "TAG_LOG_WORKER";
private TextView mLogTextView;
private LogModel mLogModel;
private DrawerStatus mDrawerStatus;
public LogFragment() {
// Required empty public constructor
}
public void setDrawerStatus(final DrawerStatus drawerStatus) {
mDrawerStatus = drawerStatus;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
Log.i(TAG, "onCreateView");
super.onCreateView(inflater, container, savedInstanceState);
setHasOptionsMenu(true);
// Inflate the layout for this fragment
View selfView = inflater.inflate(R.layout.fragment_log, container, false);
mLogTextView = (TextView) selfView.findViewById(R.id.log);
mLogModel = LogWorkerFragment.getLogModelByTag(getFragmentManager(), TAG_WORKER);
mLogModel.registerObserver(this);
return selfView;
}
@Override
public void onDestroyView () {
Log.i(TAG, "onDestroyView");
super.onDestroyView();
mLogModel.unregisterObserver(this);
}
@Override
public void onLogChanged(LogModel logModel) {
final String logHeader = getString(R.string.debug_log_header);
final String logBody = logModel.getLog();
mLogTextView.setText(logHeader + logBody);
}
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
((EasySSHFSActivity) activity).onSectionAttached(R.string.debug_log_title);
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
if (mDrawerStatus == null || !mDrawerStatus.isDrawerOpen()) {
inflater.inflate(R.menu.log, menu);
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_clean) {
mLogModel.clean();
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
] | |
35971a43b9d2408600701d5db03a04e066dcaeac | a662a01c51e2514ecfc96c5b01c201b246646417 | /src/main/java/vavi/util/archive/rar/JunrarRarEntry.java | 5f66fd056ba7d0f1acf83473f00a71479a81b5a5 | [] | no_license | umjammer/vavi-util-archive | d19d81a7e9bae6f438212cf73893458fc9ff6121 | fec692501830809d215b088c378c79f6d20b3bec | refs/heads/master | 2022-10-30T04:10:05.365947 | 2022-10-24T04:14:19 | 2022-10-24T04:14:19 | 33,908,487 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,083 | java | /*
* Copyright (c) 2022 by Naohide Sano, All rights reserved.
*
* Programmed by Naohide Sano
*/
package vavi.util.archive.rar;
import com.github.junrar.rarfile.FileHeader;
import vavi.util.archive.WrappedEntry;
/**
* Represents RAR archived file.
* warring the library 'com.github.junrar:junrar'
*
* @author <a href="mailto:[email protected]">Naohide Sano</a> (nsano)
* @version 0.00 220922 nsano initial version <br>
*/
public class JunrarRarEntry implements WrappedEntry<FileHeader> {
/** */
private FileHeader entry;
/** */
public JunrarRarEntry(FileHeader header) {
this.entry = header;
}
@Override
public String getComment() {
return null;
}
@Override
public long getCompressedSize() {
return entry.getFullPackSize();
}
@Override
public long getCrc() {
return entry.getFileCRC();
}
@Override
public Object getExtra() {
return null;
}
@Override
public int getMethod() {
return 0;
}
@Override
public String getName() {
return entry.getFileName();
}
@Override
public long getSize() {
return entry.getDataSize();
}
@Override
public long getTime() {
return entry.getMTime().getTime();
}
@Override
public boolean isDirectory() {
return entry.isDirectory();
}
@Override
public void setComment(String comment) {
// TODO
}
@Override
public void setCompressedSize(long csize) {
}
@Override
public void setCrc(long crc) {
}
@Override
public void setExtra(Object extra) {
// TODO
}
@Override
public void setMethod(int method) {
// TODO
}
@Override
public void setSize(long size) {
}
@Override
public void setTime(long time) {
// TODO
}
@Override
public Object clone() {
throw new UnsupportedOperationException();
}
@Override
public FileHeader getWrappedObject() {
return entry;
}
}
/* */
| [
"[email protected]"
] | |
87855f32d61728a58e4a97714dda61408fff8d34 | 1fc1bc95e0eea6431d826968f9d1c66f19bc3da9 | /disfrutapp/src/com/disfruta/gestion/logistica/GestionPresentacionPrecioVenta.java | 9430d56dc2954eba7b776af77da4eadbebd2f72d | [] | no_license | josejuape/ProjectDisfrutapp | e4f6e1a726754a11c14a1204119a854093e385c7 | 2cf41c2bf470c0cc59ccd85513e84c606f06b69e | refs/heads/master | 2020-12-24T15:31:13.810491 | 2015-04-14T14:17:57 | 2015-04-14T14:17:57 | 29,478,188 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,751 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.disfruta.gestion.logistica;
import com.disfruta.bean.logistica.PresentacionPrecioVenta;
import com.disfruta.bean.logistica.ProductoCarta;
import com.disfruta.conexion.ObjConexion;
import com.disfruta.logic.logistica.LogicPresentacionPrecioVenta;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Juape
*/
public class GestionPresentacionPrecioVenta {
ObjConexion objCnx = new ObjConexion();
public String registrar(PresentacionPrecioVenta beanPresentacion) {
String mensaje = "Operacion incorrecta";
try {
LogicPresentacionPrecioVenta logicPresentacionVenta = new LogicPresentacionPrecioVenta(objCnx);
if (beanPresentacion.getTipoOperacion().equalsIgnoreCase("i")) {
mensaje = logicPresentacionVenta.mantenimiento(beanPresentacion);
}else{
return mensaje;
}
objCnx.getMysql().confirmar();
return mensaje;
} catch (ClassNotFoundException ex) {
Logger.getLogger(GestionProductoCarta.class.getName()).log(Level.SEVERE, null, ex);
ex.getMessage();
} catch (InstantiationException ex) {
Logger.getLogger(GestionProductoCarta.class.getName()).log(Level.SEVERE, null, ex);
ex.getMessage();
} catch (IllegalAccessException ex) {
Logger.getLogger(GestionProductoCarta.class.getName()).log(Level.SEVERE, null, ex);
ex.getMessage();
} catch (SQLException ex) {
Logger.getLogger(GestionProductoCarta.class.getName()).log(Level.SEVERE, null, ex);
ex.getMessage();
} catch (Exception ex) {
Logger.getLogger(GestionProductoCarta.class.getName()).log(Level.SEVERE, null, ex);
ex.getMessage();
}finally{
try {
objCnx.getMysql().deshacer();
objCnx.getMysql().desconectarBD();
return mensaje;
} catch (SQLException ex) {
Logger.getLogger(GestionProductoCarta.class.getName()).log(Level.SEVERE, null, ex);
return mensaje;
}
}
}
public String eliminarPorProducto(ProductoCarta producto) {
String mensaje = "Operacion incorrecta";
try {
LogicPresentacionPrecioVenta logicPresentacionVenta = new LogicPresentacionPrecioVenta(objCnx);
if (producto.getTipoOperacion().equalsIgnoreCase("e1")) {
mensaje = logicPresentacionVenta.eliminarPorProducto(producto);
}else{
return mensaje;
}
objCnx.getMysql().confirmar();
return mensaje;
} catch (ClassNotFoundException ex) {
Logger.getLogger(GestionProductoCarta.class.getName()).log(Level.SEVERE, null, ex);
ex.getMessage();
} catch (InstantiationException ex) {
Logger.getLogger(GestionProductoCarta.class.getName()).log(Level.SEVERE, null, ex);
ex.getMessage();
} catch (IllegalAccessException ex) {
Logger.getLogger(GestionProductoCarta.class.getName()).log(Level.SEVERE, null, ex);
ex.getMessage();
} catch (SQLException ex) {
Logger.getLogger(GestionProductoCarta.class.getName()).log(Level.SEVERE, null, ex);
ex.getMessage();
} catch (Exception ex) {
Logger.getLogger(GestionProductoCarta.class.getName()).log(Level.SEVERE, null, ex);
ex.getMessage();
}finally{
try {
objCnx.getMysql().deshacer();
objCnx.getMysql().desconectarBD();
return mensaje;
} catch (SQLException ex) {
Logger.getLogger(GestionProductoCarta.class.getName()).log(Level.SEVERE, null, ex);
return mensaje;
}
}
}
public ArrayList<PresentacionPrecioVenta> listarPorProducto(ProductoCarta producto) throws ClassNotFoundException, Exception {
ArrayList array = new ArrayList();
try {
LogicPresentacionPrecioVenta logicPresentacionVenta = new LogicPresentacionPrecioVenta(objCnx);
array=logicPresentacionVenta.listarPorProducto(producto);
return array;
} catch (ClassNotFoundException ex) {
Logger.getLogger(GestionPresentacionVenta.class.getName()).log(Level.SEVERE, null, ex);
throw ex;
} catch (InstantiationException ex) {
Logger.getLogger(GestionPresentacionVenta.class.getName()).log(Level.SEVERE, null, ex);
throw ex;
} catch (IllegalAccessException ex) {
Logger.getLogger(GestionPresentacionVenta.class.getName()).log(Level.SEVERE, null, ex);
throw ex;
} catch (SQLException ex) {
Logger.getLogger(GestionPresentacionVenta.class.getName()).log(Level.SEVERE, null, ex);
throw ex;
} catch (Exception ex) {
Logger.getLogger(GestionPresentacionVenta.class.getName()).log(Level.SEVERE, null, ex);
throw ex;
}finally{
try {
objCnx.getMysql().desconectarBD();
} catch (SQLException ex) {
Logger.getLogger(GestionPresentacionVenta.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}
| [
"[email protected]"
] | |
18587ec2a7eb97971ed367fb3fa2e83666de52c1 | ee56df0d8f4d58a6c3b45ed0d2cfb9e47b2e04e0 | /app/src/androidTest/java/com/example/javierescobar/tallerlistview/ExampleInstrumentedTest.java | e6da37e608f855b93296e449be9cdf984dadac92 | [] | no_license | javieresos12/Taller-de-List-View | 8edc7fb108cfc469fb62cec2a1b13fc094721073 | 80564d8edeb24770647d485268f11bc9307c7c40 | refs/heads/master | 2020-03-28T14:51:12.246266 | 2018-09-14T21:15:42 | 2018-09-14T21:15:42 | 148,529,157 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 764 | java | package com.example.javierescobar.tallerlistview;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.javierescobar.tallerlistview", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
3d3ad013341382b4d9fc76659b4ef6ec14be426d | b98514eaefbc30b7b573922bd09887162d31aedd | /app/src/main/java/cn/flyrise/feep/collaboration/matter/MatterListFragment.java | 40f70d15ef306667500260729805c311e624b5e0 | [] | no_license | mofangwan23/LimsOA | c7a6c664531fcd8b950aed62d02f8a5fe6ca233c | 37da27081432a719fddd1a7784f9a2f29274a083 | refs/heads/main | 2023-05-29T22:25:44.839145 | 2021-06-18T09:41:17 | 2021-06-18T09:41:17 | 363,003,883 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 7,069 | java | package cn.flyrise.feep.collaboration.matter;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import cn.flyrise.android.protocol.entity.AssociationKnowledgeListRequest;
import cn.flyrise.android.protocol.entity.AssociationListResponse;
import cn.flyrise.android.protocol.entity.MatterListRequest;
import cn.flyrise.feep.R;
import cn.flyrise.feep.collaboration.matter.adpater.MatterListAdapter;
import cn.flyrise.feep.collaboration.matter.model.DirectoryNode;
import cn.flyrise.feep.collaboration.matter.model.Matter;
import cn.flyrise.feep.collaboration.matter.model.MatterPageInfo;
import cn.flyrise.feep.core.base.views.LoadMoreRecyclerView;
import cn.flyrise.feep.core.common.utils.CommonUtil;
import cn.flyrise.feep.core.network.FEHttpClient;
import cn.flyrise.feep.core.network.RepositoryException;
import cn.flyrise.feep.core.network.callback.ResponseCallback;
import java.util.List;
/**
* Created by klc on 2017/5/12.
*/
public class MatterListFragment extends Fragment {
private boolean isLoading;
private static final int PAGE_SIZE = 20;
private LoadMoreRecyclerView mRecyclerView;
private SwipeRefreshLayout mSwipeRefreshLayout;
private Handler mHandler = new Handler(Looper.getMainLooper());
private MatterPageInfo mPageInfo;
private int mMatterType;
private DirectoryNode node;
private List<Matter> mSelectedAssociations;
private MatterListAdapter mAdapter;
public static MatterListFragment newInstance(int matterType) {
Bundle args = new Bundle();
MatterListFragment fragment = new MatterListFragment();
fragment.setMatterType(matterType);
fragment.setArguments(args);
return fragment;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View contentView = inflater.inflate(R.layout.fragment_matter_list, container, false);
initViewsAndListener(contentView);
return contentView;
}
public void setMatterType(int matterType) {
this.mMatterType = matterType;
}
public void setKnowledgePageInfo(DirectoryNode node, MatterPageInfo pageInfo) {
this.node = node;
this.mPageInfo = pageInfo;
if (pageInfo.currentPage != 0) {
mAdapter.setAssociationList(mPageInfo.dataList);
}
else {
showLoading();
requestList(++pageInfo.currentPage);
}
}
private void initViewsAndListener(View contentView) {
View emptyView = contentView.findViewById(R.id.ivEmptyView);
if (mMatterType == MatterListActivity.MATTER_KNOWLEDGE) {
TextView tvHint = emptyView.findViewById(R.id.empty_hint);
tvHint.setText(R.string.common_empty_file_hint);
}
mSwipeRefreshLayout = (SwipeRefreshLayout) contentView.findViewById(R.id.swipeRefreshLayout);
mSwipeRefreshLayout.setColorSchemeResources(R.color.login_btn_defulit);
mRecyclerView = (LoadMoreRecyclerView) contentView.findViewById(R.id.recyclerView);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mRecyclerView.setAdapter(mAdapter = new MatterListAdapter());
mAdapter.setSelectedAssociations(mSelectedAssociations);
mAdapter.setEmptyView(emptyView);
mAdapter.setOnItemClickListener(new MatterListAdapter.OnAssociationCheckChangeListener() {
@Override
public void onAssociationAdd(Matter association) {
MatterListActivity activity = (MatterListActivity) getActivity();
activity.addSelectedAssociation(association);
}
@Override
public void onAssociationDelete(Matter deletedAssociation) {
MatterListActivity activity = (MatterListActivity) getActivity();
activity.removeSelectedAssociation(deletedAssociation);
}
});
mRecyclerView.setOnLoadMoreListener(() -> {
if (!isLoading && hasMoreData()) {
isLoading = true;
requestList(++mPageInfo.currentPage);
}
else {
mAdapter.removeFooterView();
}
});
mSwipeRefreshLayout.setOnRefreshListener(() -> {
if (mPageInfo != null) {
requestList(mPageInfo.currentPage = 1);
}
else {
mSwipeRefreshLayout.setRefreshing(false);
}
});
if (mMatterType != MatterListActivity.MATTER_KNOWLEDGE) {
showLoading();
mPageInfo = new MatterPageInfo();
requestList(mPageInfo.currentPage = 1);
}
}
public void showLoading() {
mSwipeRefreshLayout.post(() -> mSwipeRefreshLayout.setRefreshing(true));
}
public boolean hasMoreData() {
return mPageInfo.hasMore;
}
public void deleteAssociation(Matter association) {
mAdapter.deleteSelectedAssociation(association);
}
public void addAssociation(Matter association) {
mAdapter.addSelectedAssociation(association);
}
public void setSelectedAssociations(List<Matter> associations) {
this.mSelectedAssociations = associations;
}
public void notifyDataSetChange() {
this.mAdapter.notifyDataSetChanged();
}
private void requestList(int page) {
if (mMatterType == MatterListActivity.MATTER_KNOWLEDGE) {
AssociationKnowledgeListRequest request = new AssociationKnowledgeListRequest(node.id, node.attr, "",
String.valueOf(mPageInfo.currentPage), PAGE_SIZE + "");
FEHttpClient.getInstance().post(request, responseCallback);
}
else {
MatterListRequest request = new MatterListRequest("", page, PAGE_SIZE, mMatterType);
FEHttpClient.getInstance().post(request, responseCallback);
}
}
public ResponseCallback responseCallback = new ResponseCallback<AssociationListResponse>() {
@Override
public void onCompleted(AssociationListResponse response) {
isLoading = false;
mHandler.postDelayed(() -> mSwipeRefreshLayout.setRefreshing(false), 1000);
AssociationListResponse.Result result = response.getResult();
if (result != null) {
mPageInfo.hasMore = result.getTotalPage() > mPageInfo.currentPage;
List<Matter> associationList = result.getAssociationList();
if (CommonUtil.nonEmptyList(associationList)) {
for (int i = 0, n = associationList.size(); i < n; i++) {
associationList.get(i).matterType = mMatterType;
}
}
if (mPageInfo.currentPage == 1) {
mAdapter.setAssociationList(associationList);
mPageInfo.dataList = associationList;
}
else {
mAdapter.addAssociationList(associationList);
}
if (hasMoreData()) {
mAdapter.setFooterView(cn.flyrise.feep.core.R.layout.core_refresh_bottom_loading);
}
else {
mAdapter.removeFooterView();
}
}
}
@Override
public void onFailure(RepositoryException repositoryException) {
mRecyclerView.scrollLastItem2Bottom(mAdapter);
isLoading = false;
mHandler.postDelayed(() -> mSwipeRefreshLayout.setRefreshing(false), 1000);
}
};
@Override
public void onDestroy() {
super.onDestroy();
if (mHandler != null) {
mHandler.removeCallbacksAndMessages(null);
}
}
} | [
"[email protected]"
] | |
d35a434aad2038074d9493c20ad4dd5fd8225b94 | 765a421b9911bd1aa855c9802e35faf95be028d3 | /src/proyectoprogra/Componente.java | 2f198c8725999357e46dadc985ce03c0b28314c0 | [] | no_license | brmusic9957/AjedrezHexagonal | fb9c027773c765238fd70f7eae777130903ff60b | d7074c75d3fabea87db7366e6362d2ad371c1dbd | refs/heads/master | 2021-09-02T23:30:23.339599 | 2018-01-04T03:38:14 | 2018-01-04T03:38:14 | 115,671,811 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 472 | java | package proyectoprogra;
import javax.swing.JLabel;
public class Componente extends JLabel {
public static int CELDA = 1;
public static int PIEZA = 2;
private int tipo;
public Componente(int tipo, int size, int posx, int posy) {
this.tipo = tipo;
this.setBorder(null);
this.setSize(size, size);
this.setLocation(posx, posy);
this.setVisible(true);
}
public int getTipo() {
return tipo;
}
}
| [
"bruce dilan lopez velasquez"
] | bruce dilan lopez velasquez |
2a85fb97436c565c812508141ca1c2de05afc96c | 7360a4690e7aac8f768eacde499fdc09c0195e55 | /Project01/src/main/java/StoreRunner.java | 8569313e0a2d0b9db2187818a68bd88e70d387c5 | [] | no_license | Gumennnik/JavaCourses_TeachMeSkills | e3f40c09cd34530ffbcb2ca3fee500a7c6baa539 | e102da71dd5003a66b702245757ecd5e8a5074a5 | refs/heads/master | 2022-06-24T08:28:48.970420 | 2019-07-04T20:32:34 | 2019-07-04T20:32:34 | 179,712,013 | 0 | 0 | null | 2022-06-21T01:17:48 | 2019-04-05T15:53:21 | Java | UTF-8 | Java | false | false | 29 | java | public class StoreRunner {
}
| [
"[email protected]"
] | |
0ab3e4b394dde248f94dcd1dfd4793ff717458f7 | 51d351448a5ea1fd481a869ec3466e5c505539e1 | /CM5/deployment-tool/src/main/java/ru/intertrust/cm/deployment/tool/task/attachment/temp/AttachmentUnzipTempTask.java | 4838a8637ca0cff49dc555e9180ffdc510d5a47d | [
"Apache-2.0"
] | permissive | mrBertieWooster/ActiveFrame5 | b17fa77156981ad63d147fcd15a18a67e22bd824 | 3a8f0281b4f1fafa23db01027fa2e049f55c06d8 | refs/heads/master | 2020-11-30T03:18:12.028257 | 2019-12-26T15:36:17 | 2019-12-26T15:36:17 | 230,284,850 | 0 | 0 | null | 2019-12-26T15:19:53 | 2019-12-26T15:19:53 | null | UTF-8 | Java | false | false | 764 | java | package ru.intertrust.cm.deployment.tool.task.attachment.temp;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import ru.intertrust.cm.deployment.tool.task.TaskResult;
import ru.intertrust.cm.deployment.tool.task.attachment.AttachmentUnzipTask;
import static ru.intertrust.cm.deployment.tool.property.AttachmentType.TEMP_STORAGE;
/**
* Created by Alexander Bogatyrenko on 08.08.16.
* <p>
* This class represents...
*/
@Component
@Scope("prototype")
public class AttachmentUnzipTempTask extends AttachmentUnzipTask {
@Override
public TaskResult call() throws Exception {
String path = serverProperties.get(TEMP_STORAGE);
return new TaskResult(unzip(TEMP_STORAGE, path));
}
}
| [
"[email protected]"
] | |
f7787c82d8d57cce80818c1c2e289bfd09ef2e08 | 95a54e3f3617bf55883210f0b5753b896ad48549 | /java_src/com/liber8tech/tago/Constants.java | cf3031288ad58bc84e122c99e32a47dd9bb17818 | [] | no_license | aidyk/TagoApp | ffc5a8832fbf9f9819f7f8aa7af29149fbab9ea5 | e31a528c8f931df42075fc8694754be146eddc34 | refs/heads/master | 2022-12-22T02:20:58.486140 | 2021-05-16T07:42:02 | 2021-05-16T07:42:02 | 325,695,453 | 3 | 1 | null | 2022-12-16T00:32:10 | 2020-12-31T02:34:45 | Smali | UTF-8 | Java | false | false | 3,009 | java | package com.liber8tech.tago;
import java.io.File;
import kotlin.Metadata;
import org.jetbrains.annotations.NotNull;
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0006\n\u0000\n\u0002\u0010\u000e\n\u0002\b\f\n\u0002\u0010\u0007\n\u0002\b\u0005\bÆ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u000e\u0010\u0003\u001a\u00020\u0004XT¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006XT¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\u0006XT¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\u0006XT¢\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\u0006XT¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\u0006XT¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\u0006XT¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\u0006XT¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u0006XT¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u0006XT¢\u0006\u0002\n\u0000R\u0011\u0010\u000f\u001a\u00020\u0006¢\u0006\b\n\u0000\u001a\u0004\b\u0010\u0010\u0011R\u001a\u0010\u0012\u001a\u00020\u0013X\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0014\u0010\u0015\"\u0004\b\u0016\u0010\u0017¨\u0006\u0018"}, d2 = {"Lcom/liber8tech/tago/Constants;", "", "()V", "PatternRatio", "", Constants.SignUpActivity, "", "autoUpload", Constants.collectionType, Constants.created, "currentPack", "isLogin", "pattern", "profile", Constants.purchased, "purchasedFolderPath", "getPurchasedFolderPath", "()Ljava/lang/String;", "tagoCameraGapHeightPx", "", "getTagoCameraGapHeightPx", "()F", "setTagoCameraGapHeightPx", "(F)V", "app_release"}, k = 1, mv = {1, 1, 13})
/* compiled from: Constants.kt */
public final class Constants {
public static final Constants INSTANCE = new Constants();
public static final double PatternRatio = 4.387096774193548d;
@NotNull
public static final String SignUpActivity = "SignUpActivity";
@NotNull
public static final String autoUpload = "AutoUpload";
@NotNull
public static final String collectionType = "collectionType";
@NotNull
public static final String created = "created";
@NotNull
public static final String currentPack = "Current_pack";
@NotNull
public static final String isLogin = "previousActivityLogin";
@NotNull
public static final String pattern = "Pattern";
@NotNull
public static final String profile = "profile";
@NotNull
public static final String purchased = "purchased";
@NotNull
private static final String purchasedFolderPath = (purchased + File.separator);
private static float tagoCameraGapHeightPx;
private Constants() {
}
public final float getTagoCameraGapHeightPx() {
return tagoCameraGapHeightPx;
}
public final void setTagoCameraGapHeightPx(float f) {
tagoCameraGapHeightPx = f;
}
@NotNull
public final String getPurchasedFolderPath() {
return purchasedFolderPath;
}
}
| [
"[email protected]"
] | |
6588fa2d9acbf47e204f5d4c191ade179ed2dece | b5f6622cc5eaec6bfa146ee32e925c60b79cc787 | /src/Model/Payment.java | 4affb48220d5c5f62cb1f9a501c64bed00110d4a | [] | no_license | yasinduramanayake/itp_java | bb89d643154b62ee082644196314438eaf6b5d02 | 90f177f78f7d8262afe9f7e10b51150b9c1c01bd | refs/heads/master | 2023-03-05T10:50:39.544075 | 2021-02-06T08:27:19 | 2021-02-06T08:27:19 | 336,493,529 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,043 | java | package Model;
public class Payment {
private double Amount;
private String Email;
private int PhoneNo;
private String CrdName ;
private int CrdNo;
private String Ex_Date ;
private int CVV;
private int P_id;
private String name;
private int cus_id;
public int getCus_id() {
return cus_id;
}
public void setCus_id(int cus_id) {
this.cus_id = cus_id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
/**
* @return the Amount
*/
public double getAmount() {
return Amount;
}
/**
* @param Amount the Amount to set
*/
public void setAmount(double Amount) {
this.Amount = Amount;
}
/**
* @return the PhoneNo
*/
public int getPhoneNo() {
return PhoneNo;
}
/**
* @param PhoneNo the PhoneNo to set
*/
public void setPhoneNo(int PhoneNo) {
this. PhoneNo = PhoneNo;
}
/**
* @return the Email
*/
public String getEmail() {
return Email;
}
/**
* @param Email the Email to set
*/
public void setEmail(String Email) {
this. Email = Email;
}
/**
* @return the CrdName
*/
public String getCrdName() {
return CrdName;
}
/**
* @param the CrdName to set
*/
public void setCrdName(String CrdName ) {
this. CrdName = CrdName ;
}
/**
* @return the CrdNo
*/
public int getCrdNo() {
return CrdNo;
}
/**
* @param CrdNo the CrdNo to set
*/
public void setCrdNo(int CrdNo) {
this. CrdNo = CrdNo;
}
/**
* @return the CVV
*/
public int getCVV() {
return CVV;
}
/**
* @param CVV the CVV to set
*/
public void setCVV(int CVV) {
this. CVV = CVV;
}
/**
* @return the Ex_Date
*/
public String getEx_Date() {
return Ex_Date;
}
/**
* @param Ex_Date the Ex_Date to set
*/
public void setEx_Date(String Ex_Date) {
this. Ex_Date = Ex_Date;
}
/**
* @return the P_id
*/
public int getP_id() {
return P_id;
}
/**
* @param P_id the P_id to set
*/
public void setP_id(int P_id) {
this. P_id = P_id;
}
}
| [
"[email protected]"
] | |
261034fe850bb7d8b2bef1daff8d02391d58eaea | 1385f704f09e5d2239773b539229f86e5a3df003 | /dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java | 223236d6b08e34eefe50e1fc88be4d92e02e13f4 | [
"BSD-3-Clause"
] | permissive | hispindia/PLAN-2.22 | 685af400a458d2dd5d79e1a51c2338c6f60d65b8 | e25d2d4eb2164f8f6f84208334e60768a96c7543 | refs/heads/master | 2020-05-25T14:13:00.336780 | 2017-03-14T11:07:57 | 2017-03-14T11:07:57 | 84,938,376 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 46,702 | java | package org.hisp.dhis.common;
/*
* Copyright (c) 2004-2016, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of the HISP project nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import static org.hisp.dhis.common.DimensionalObject.CATEGORYOPTIONCOMBO_DIM_ID;
import static org.hisp.dhis.common.DimensionalObject.DATA_COLLAPSED_DIM_ID;
import static org.hisp.dhis.common.DimensionalObject.DATA_X_DIM_ID;
import static org.hisp.dhis.common.DimensionalObject.DIMENSION_SEP;
import static org.hisp.dhis.common.DimensionalObject.ORGUNIT_DIM_ID;
import static org.hisp.dhis.common.DimensionalObject.PERIOD_DIM_ID;
import static org.hisp.dhis.common.DimensionalObject.STATIC_DIMS;
import static org.hisp.dhis.organisationunit.OrganisationUnit.KEY_LEVEL;
import static org.hisp.dhis.organisationunit.OrganisationUnit.KEY_ORGUNIT_GROUP;
import static org.hisp.dhis.organisationunit.OrganisationUnit.KEY_USER_ORGUNIT;
import static org.hisp.dhis.organisationunit.OrganisationUnit.KEY_USER_ORGUNIT_CHILDREN;
import static org.hisp.dhis.organisationunit.OrganisationUnit.KEY_USER_ORGUNIT_GRANDCHILDREN;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.hisp.dhis.analytics.AggregationType;
import org.hisp.dhis.common.adapter.JacksonPeriodDeserializer;
import org.hisp.dhis.common.adapter.JacksonPeriodSerializer;
import org.hisp.dhis.common.annotation.Scanned;
import org.hisp.dhis.common.view.DetailedView;
import org.hisp.dhis.common.view.DimensionalView;
import org.hisp.dhis.common.view.ExportView;
import org.hisp.dhis.dataelement.CategoryOptionGroup;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryDimension;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.dataelement.DataElementGroup;
import org.hisp.dhis.i18n.I18nFormat;
import org.hisp.dhis.indicator.Indicator;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
import org.hisp.dhis.period.ConfigurablePeriod;
import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.RelativePeriodEnum;
import org.hisp.dhis.period.RelativePeriods;
import org.hisp.dhis.period.comparator.AscendingPeriodComparator;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeDimension;
import org.hisp.dhis.trackedentity.TrackedEntityDataElementDimension;
import org.hisp.dhis.trackedentity.TrackedEntityProgramIndicatorDimension;
import org.hisp.dhis.user.User;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonView;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Maps;
/**
* This class contains associations to dimensional meta-data. Should typically
* be sub-classed by analytical objects like tables, maps and charts.
* <p/>
* Implementation note: Objects currently managing this class are AnalyticsService,
* DefaultDimensionService and the getDimensionalObject and getDimensionalObjectList
* methods of this class.
*
* @author Lars Helge Overland
*/
@JacksonXmlRootElement( localName = "analyticalObject", namespace = DxfNamespaces.DXF_2_0 )
public abstract class BaseAnalyticalObject
extends BaseIdentifiableObject
implements AnalyticalObject
{
public static final int ASC = -1;
public static final int DESC = 1;
public static final int NONE = 0;
// -------------------------------------------------------------------------
// Persisted properties
// -------------------------------------------------------------------------
protected List<DataDimensionItem> dataDimensionItems = new ArrayList<>();
@Scanned
protected List<OrganisationUnit> organisationUnits = new ArrayList<>();
@Scanned
protected List<Period> periods = new ArrayList<>();
protected RelativePeriods relatives;
@Scanned
protected List<DataElementGroup> dataElementGroups = new ArrayList<>();
@Scanned
protected List<OrganisationUnitGroup> organisationUnitGroups = new ArrayList<>();
@Scanned
protected List<Integer> organisationUnitLevels = new ArrayList<>();
@Scanned
protected List<DataElementCategoryDimension> categoryDimensions = new ArrayList<>();
@Scanned
protected List<CategoryOptionGroup> categoryOptionGroups = new ArrayList<>();
@Scanned
protected List<TrackedEntityAttributeDimension> attributeDimensions = new ArrayList<>();
@Scanned
protected List<TrackedEntityDataElementDimension> dataElementDimensions = new ArrayList<>();
@Scanned
protected List<TrackedEntityProgramIndicatorDimension> programIndicatorDimensions = new ArrayList<>();
private Program program;
protected boolean userOrganisationUnit;
protected boolean userOrganisationUnitChildren;
protected boolean userOrganisationUnitGrandChildren;
@Scanned
protected List<OrganisationUnitGroup> itemOrganisationUnitGroups = new ArrayList<>();
protected DigitGroupSeparator digitGroupSeparator;
protected int sortOrder;
protected int topLimit;
protected AggregationType aggregationType;
protected boolean completedOnly;
// -------------------------------------------------------------------------
// Analytical properties
// -------------------------------------------------------------------------
protected transient List<DimensionalObject> columns = new ArrayList<>();
protected transient List<DimensionalObject> rows = new ArrayList<>();
protected transient List<DimensionalObject> filters = new ArrayList<>();
protected transient Map<String, String> parentGraphMap = new HashMap<>();
// -------------------------------------------------------------------------
// Transient properties
// -------------------------------------------------------------------------
protected transient List<OrganisationUnit> transientOrganisationUnits = new ArrayList<>();
protected transient List<DataElementCategoryOptionCombo> transientCategoryOptionCombos = new ArrayList<>();
protected transient Date relativePeriodDate;
protected transient OrganisationUnit relativeOrganisationUnit;
// -------------------------------------------------------------------------
// Logic
// -------------------------------------------------------------------------
public abstract void init( User user, Date date, OrganisationUnit organisationUnit,
List<OrganisationUnit> organisationUnitsAtLevel, List<OrganisationUnit> organisationUnitsInGroups, I18nFormat format );
@Override
public abstract void populateAnalyticalProperties();
public boolean hasUserOrgUnit()
{
return userOrganisationUnit || userOrganisationUnitChildren || userOrganisationUnitGrandChildren;
}
public boolean hasRelativePeriods()
{
return relatives != null && !relatives.isEmpty();
}
public boolean hasOrganisationUnitLevels()
{
return organisationUnitLevels != null && !organisationUnitLevels.isEmpty();
}
public boolean hasItemOrganisationUnitGroups()
{
return itemOrganisationUnitGroups != null && !itemOrganisationUnitGroups.isEmpty();
}
public boolean hasSortOrder()
{
return sortOrder != 0;
}
protected void addTransientOrganisationUnits( Collection<OrganisationUnit> organisationUnits )
{
if ( organisationUnits != null )
{
this.transientOrganisationUnits.addAll( organisationUnits );
}
}
protected void addTransientOrganisationUnit( OrganisationUnit organisationUnit )
{
if ( organisationUnit != null )
{
this.transientOrganisationUnits.add( organisationUnit );
}
}
/**
* Returns dimension items for data dimensions.
*/
public List<DimensionalItemObject> getDataDimensionNameableObjects()
{
return dataDimensionItems.stream().map( DataDimensionItem::getDimensionalItemObject ).collect( Collectors.toList() );
}
/**
* Adds a data dimension object.
*
* @return true if a data dimension was added, false if not.
*/
public boolean addDataDimensionItem( DimensionalItemObject object )
{
if ( object != null && DataDimensionItem.DATA_DIMENSION_CLASSES.contains( object.getClass() ) )
{
return dataDimensionItems.add( DataDimensionItem.create( object ) );
}
return false;
}
/**
* Removes a data dimension object.
*
* @return true if a data dimension was removed, false if not.
*/
public boolean removeDataDimensionItem( DimensionalItemObject object )
{
if ( object != null && DataDimensionItem.DATA_DIMENSION_CLASSES.contains( object.getClass() ) )
{
return dataDimensionItems.remove( DataDimensionItem.create( object ) );
}
return false;
}
/**
* Adds all given data dimension objects.
*/
public void addAllDataDimensionItems( Collection<? extends DimensionalItemObject> objects )
{
for ( DimensionalItemObject object : objects )
{
addDataDimensionItem( object );
}
}
/**
* Returns all data elements in the data dimensions. The returned list is
* immutable.
*/
@JsonIgnore
public List<DataElement> getDataElements()
{
return ImmutableList.copyOf( dataDimensionItems.stream().
filter( i -> i.getDataElement() != null ).
map( DataDimensionItem::getDataElement ).collect( Collectors.toList() ) );
}
/**
* Returns all indicators in the data dimensions. The returned list is
* immutable.
*/
@JsonIgnore
public List<Indicator> getIndicators()
{
return ImmutableList.copyOf( dataDimensionItems.stream().
filter( i -> i.getIndicator() != null ).
map( DataDimensionItem::getIndicator ).collect( Collectors.toList() ) );
}
/**
* Assembles a DimensionalObject based on the persisted properties of this
* AnalyticalObject. Collapses indicators, data elements, data element
* operands and data sets into the dx dimension.
* <p/>
* Collapses fixed and relative periods into the pe dimension. Collapses
* fixed and user organisation units into the ou dimension.
*
* @param dimension the dimension identifier.
* @param date the date used for generating relative periods.
* @param user the current user.
* @param dynamicNames whether to use dynamic or static names.
* @param format the I18nFormat.
* @return a DimensionalObject.
*/
protected DimensionalObject getDimensionalObject( String dimension, Date date, User user, boolean dynamicNames,
List<OrganisationUnit> organisationUnitsAtLevel, List<OrganisationUnit> organisationUnitsInGroups, I18nFormat format )
{
List<DimensionalItemObject> items = new ArrayList<>();
DimensionType type = null;
List<String> categoryDims = getCategoryDims();
if ( DATA_X_DIM_ID.equals( dimension ) )
{
items.addAll( getDataDimensionNameableObjects() );
type = DimensionType.DATA_X;
}
else if ( PERIOD_DIM_ID.equals( dimension ) )
{
setPeriodNames( periods, dynamicNames, format );
items.addAll( periods );
if ( hasRelativePeriods() )
{
items.addAll( relatives.getRelativePeriods( date, format, dynamicNames ) );
}
type = DimensionType.PERIOD;
}
else if ( ORGUNIT_DIM_ID.equals( dimension ) )
{
items.addAll( organisationUnits );
items.addAll( transientOrganisationUnits );
if ( userOrganisationUnit && user != null && user.hasOrganisationUnit() )
{
items.add( user.getOrganisationUnit() );
}
if ( userOrganisationUnitChildren && user != null && user.hasOrganisationUnit() )
{
items.addAll( user.getOrganisationUnit().getSortedChildren() );
}
if ( userOrganisationUnitGrandChildren && user != null && user.hasOrganisationUnit() )
{
items.addAll( user.getOrganisationUnit().getSortedGrandChildren() );
}
if ( organisationUnitLevels != null && !organisationUnitLevels.isEmpty() && organisationUnitsAtLevel != null )
{
items.addAll( organisationUnitsAtLevel ); // Must be set externally
}
if ( itemOrganisationUnitGroups != null && !itemOrganisationUnitGroups.isEmpty() && organisationUnitsInGroups != null )
{
items.addAll( organisationUnitsInGroups ); // Must be set externally
}
type = DimensionType.ORGANISATIONUNIT;
}
else if ( CATEGORYOPTIONCOMBO_DIM_ID.equals( dimension ) )
{
items.addAll( transientCategoryOptionCombos );
type = DimensionType.CATEGORY_OPTION_COMBO;
}
else if ( categoryDims.contains( dimension ) )
{
DataElementCategoryDimension categoryDimension = categoryDimensions.get( categoryDims.indexOf( dimension ) );
items.addAll( categoryDimension.getItems() );
type = DimensionType.CATEGORY;
}
else if ( STATIC_DIMS.contains( dimension ) )
{
type = DimensionType.STATIC;
}
else
{
// Data element group set
ListMap<String, DimensionalItemObject> deGroupMap = new ListMap<>();
for ( DataElementGroup group : dataElementGroups )
{
if ( group.getGroupSet() != null )
{
deGroupMap.putValue( group.getGroupSet().getDimension(), group );
}
}
if ( deGroupMap.containsKey( dimension ) )
{
items.addAll( deGroupMap.get( dimension ) );
type = DimensionType.DATAELEMENT_GROUPSET;
}
// Organisation unit group set
ListMap<String, DimensionalItemObject> ouGroupMap = new ListMap<>();
for ( OrganisationUnitGroup group : organisationUnitGroups )
{
if ( group.getGroupSet() != null )
{
ouGroupMap.putValue( group.getGroupSet().getUid(), group );
}
}
if ( ouGroupMap.containsKey( dimension ) )
{
items.addAll( ouGroupMap.get( dimension ) );
type = DimensionType.ORGANISATIONUNIT_GROUPSET;
}
// Category option group set
ListMap<String, DimensionalItemObject> coGroupMap = new ListMap<>();
for ( CategoryOptionGroup group : categoryOptionGroups )
{
if ( group.getGroupSet() != null )
{
coGroupMap.putValue( group.getGroupSet().getUid(), group );
}
}
if ( coGroupMap.containsKey( dimension ) )
{
items.addAll( coGroupMap.get( dimension ) );
type = DimensionType.CATEGORYOPTION_GROUPSET;
}
// Tracked entity attribute
Map<String, TrackedEntityAttributeDimension> attributes = Maps.uniqueIndex( attributeDimensions, TrackedEntityAttributeDimension::getUid );
if ( attributes.containsKey( dimension ) )
{
TrackedEntityAttributeDimension tead = attributes.get( dimension );
return new BaseDimensionalObject( dimension, DimensionType.PROGRAM_ATTRIBUTE, null, tead.getDisplayName(), tead.getLegendSet(), tead.getFilter() );
}
// Tracked entity data element
Map<String, TrackedEntityDataElementDimension> dataElements = Maps.uniqueIndex( dataElementDimensions, TrackedEntityDataElementDimension::getUid );
if ( dataElements.containsKey( dimension ) )
{
TrackedEntityDataElementDimension tedd = dataElements.get( dimension );
return new BaseDimensionalObject( dimension, DimensionType.PROGRAM_DATAELEMENT, null, tedd.getDisplayName(), tedd.getLegendSet(), tedd.getFilter() );
}
// Tracked entity program indicator
Map<String, TrackedEntityProgramIndicatorDimension> programIndicators = Maps.uniqueIndex( programIndicatorDimensions, TrackedEntityProgramIndicatorDimension::getUid );
if ( programIndicators.containsKey( dimension ) )
{
TrackedEntityProgramIndicatorDimension teid = programIndicators.get( dimension );
return new BaseDimensionalObject( dimension, DimensionType.PROGRAM_INDICATOR, null, teid.getDisplayName(), teid.getLegendSet(), teid.getFilter() );
}
}
IdentifiableObjectUtils.removeDuplicates( items );
return new BaseDimensionalObject( dimension, type, items );
}
/**
* Assembles a list of DimensionalObjects based on the concrete objects in
* this BaseAnalyticalObject.
* <p/>
* Merges fixed and relative periods into the pe dimension, where the
* RelativePeriods object is represented by enums (e.g. LAST_MONTH). Merges
* fixed and user organisation units into the ou dimension, where user
* organisation units properties are represented by enums (e.g. USER_ORG_UNIT).
* <p/>
* This method is useful when serializing the AnalyticalObject.
*
* @param dimension the dimension identifier.
* @return a list of DimensionalObjects.
*/
protected DimensionalObject getDimensionalObject( String dimension )
{
List<String> categoryDims = getCategoryDims();
if ( DATA_X_DIM_ID.equals( dimension ) )
{
return new BaseDimensionalObject( dimension, DimensionType.DATA_X, getDataDimensionNameableObjects() );
}
else if ( PERIOD_DIM_ID.equals( dimension ) )
{
List<Period> periodList = new ArrayList<>( periods );
if ( hasRelativePeriods() )
{
List<RelativePeriodEnum> list = relatives.getRelativePeriodEnums();
for ( RelativePeriodEnum periodEnum : list )
{
periodList.add( new ConfigurablePeriod( periodEnum.toString() ) );
}
}
Collections.sort( periodList, new AscendingPeriodComparator() );
return new BaseDimensionalObject( dimension, DimensionType.PERIOD, periodList );
}
else if ( ORGUNIT_DIM_ID.equals( dimension ) )
{
List<DimensionalItemObject> ouList = new ArrayList<>();
ouList.addAll( organisationUnits );
ouList.addAll( transientOrganisationUnits );
if ( userOrganisationUnit )
{
ouList.add( new BaseDimensionalItemObject( KEY_USER_ORGUNIT ) );
}
if ( userOrganisationUnitChildren )
{
ouList.add( new BaseDimensionalItemObject( KEY_USER_ORGUNIT_CHILDREN ) );
}
if ( userOrganisationUnitGrandChildren )
{
ouList.add( new BaseDimensionalItemObject( KEY_USER_ORGUNIT_GRANDCHILDREN ) );
}
if ( organisationUnitLevels != null && !organisationUnitLevels.isEmpty() )
{
for ( Integer level : organisationUnitLevels )
{
String id = KEY_LEVEL + level;
ouList.add( new BaseDimensionalItemObject( id ) );
}
}
if ( itemOrganisationUnitGroups != null && !itemOrganisationUnitGroups.isEmpty() )
{
for ( OrganisationUnitGroup group : itemOrganisationUnitGroups )
{
String id = KEY_ORGUNIT_GROUP + group.getUid();
ouList.add( new BaseDimensionalItemObject( id ) );
}
}
return new BaseDimensionalObject( dimension, DimensionType.ORGANISATIONUNIT, ouList );
}
else if ( CATEGORYOPTIONCOMBO_DIM_ID.equals( dimension ) )
{
return new BaseDimensionalObject( dimension, DimensionType.CATEGORY_OPTION_COMBO, new ArrayList<DimensionalItemObject>() ) ;
}
else if ( categoryDims.contains( dimension ) )
{
DataElementCategoryDimension categoryDimension = categoryDimensions.get( categoryDims.indexOf( dimension ) );
return new BaseDimensionalObject( dimension, DimensionType.CATEGORY, categoryDimension.getItems() );
}
else if ( DATA_COLLAPSED_DIM_ID.contains( dimension ) )
{
return new BaseDimensionalObject( dimension, DimensionType.DATA_COLLAPSED, new ArrayList<>() );
}
else if ( STATIC_DIMS.contains( dimension ) )
{
return new BaseDimensionalObject( dimension, DimensionType.STATIC, new ArrayList<>() );
}
else
{
// Data element group set
ListMap<String, DimensionalItemObject> deGroupMap = new ListMap<>();
for ( DataElementGroup group : dataElementGroups )
{
if ( group.getGroupSet() != null )
{
deGroupMap.putValue( group.getGroupSet().getDimension(), group );
}
}
if ( deGroupMap.containsKey( dimension ) )
{
return new BaseDimensionalObject( dimension, DimensionType.DATAELEMENT_GROUPSET, deGroupMap.get( dimension ) );
}
// Organisation unit group set
ListMap<String, DimensionalItemObject> ouGroupMap = new ListMap<>();
for ( OrganisationUnitGroup group : organisationUnitGroups )
{
if ( group.getGroupSet() != null )
{
ouGroupMap.putValue( group.getGroupSet().getUid(), group );
}
}
if ( ouGroupMap.containsKey( dimension ) )
{
return new BaseDimensionalObject( dimension, DimensionType.ORGANISATIONUNIT_GROUPSET, ouGroupMap.get( dimension ) );
}
// Category option group set
ListMap<String, DimensionalItemObject> coGroupMap = new ListMap<>();
for ( CategoryOptionGroup group : categoryOptionGroups )
{
if ( group.getGroupSet() != null )
{
coGroupMap.putValue( group.getGroupSet().getUid(), group );
}
}
if ( coGroupMap.containsKey( dimension ) )
{
return new BaseDimensionalObject( dimension, DimensionType.CATEGORYOPTION_GROUPSET, coGroupMap.get( dimension ) );
}
// Tracked entity attribute
Map<String, TrackedEntityAttributeDimension> attributes = Maps.uniqueIndex( attributeDimensions, TrackedEntityAttributeDimension::getUid );
if ( attributes.containsKey( dimension ) )
{
TrackedEntityAttributeDimension tead = attributes.get( dimension );
return new BaseDimensionalObject( dimension, DimensionType.PROGRAM_ATTRIBUTE, null, tead.getDisplayName(), tead.getLegendSet(), tead.getFilter() );
}
// Tracked entity data element
Map<String, TrackedEntityDataElementDimension> dataElements = Maps.uniqueIndex( dataElementDimensions, TrackedEntityDataElementDimension::getUid );
if ( dataElements.containsKey( dimension ) )
{
TrackedEntityDataElementDimension tedd = dataElements.get( dimension );
return new BaseDimensionalObject( dimension, DimensionType.PROGRAM_DATAELEMENT, null, tedd.getDisplayName(), tedd.getLegendSet(), tedd.getFilter() );
}
// Tracked entity program indicator
Map<String, TrackedEntityProgramIndicatorDimension> programIndicators = Maps.uniqueIndex( programIndicatorDimensions, TrackedEntityProgramIndicatorDimension::getUid );
if ( programIndicators.containsKey( dimension ) )
{
TrackedEntityProgramIndicatorDimension teid = programIndicators.get( dimension );
return new BaseDimensionalObject( dimension, DimensionType.PROGRAM_INDICATOR, null, teid.getDisplayName(), teid.getLegendSet(), teid.getFilter() );
}
}
throw new IllegalArgumentException( "Not a valid dimension: " + dimension );
}
private List<String> getCategoryDims()
{
List<String> categoryDims = new ArrayList<>();
for ( DataElementCategoryDimension dim : categoryDimensions )
{
categoryDims.add( dim.getDimension().getDimension() );
}
return categoryDims;
}
private void setPeriodNames( List<Period> periods, boolean dynamicNames, I18nFormat format )
{
for ( Period period : periods )
{
RelativePeriods.setName( period, null, dynamicNames, format );
}
}
/**
* Sorts the keys in the given map by splitting on the '-' character and
* sorting the components alphabetically.
*
* @param valueMap the mapping of keys and values.
*/
public static void sortKeys( Map<String, Object> valueMap )
{
Map<String, Object> map = new HashMap<>();
for ( String key : valueMap.keySet() )
{
String sortKey = sortKey( key );
if ( sortKey != null )
{
map.put( sortKey, valueMap.get( key ) );
}
}
valueMap.clear();
valueMap.putAll( map );
}
/**
* Sorts the given key by splitting on the '-' character and sorting the
* components alphabetically.
*
* @param valueMap the mapping of keys and values.
*/
public static String sortKey( String key )
{
if ( key != null )
{
String[] ids = key.split( DIMENSION_SEP );
Collections.sort( Arrays.asList( ids ) );
key = StringUtils.join( ids, DIMENSION_SEP );
}
return key;
}
/**
* Generates an identifier based on the given lists of NameableObjects. Uses
* the UIDs for each NameableObject, sorts them and writes them out as a key.
*/
public static String getIdentifier( List<DimensionalItemObject> column, List<DimensionalItemObject> row )
{
List<String> ids = new ArrayList<>();
List<DimensionalItemObject> dimensions = new ArrayList<>();
dimensions.addAll( column != null ? column : new ArrayList<>() );
dimensions.addAll( row != null ? row : new ArrayList<>() );
for ( DimensionalItemObject item : dimensions )
{
ids.add( item.getDimensionItem() );
}
Collections.sort( ids );
return StringUtils.join( ids, DIMENSION_SEP );
}
/**
* Returns meta-data mapping for this analytical object. Includes a identifier
* to name mapping for dynamic dimensions.
*/
public Map<String, String> getMetaData()
{
Map<String, String> meta = new HashMap<>();
for ( DataElementGroup group : dataElementGroups )
{
meta.put( group.getGroupSet().getUid(), group.getGroupSet().getName() );
}
for ( OrganisationUnitGroup group : organisationUnitGroups )
{
meta.put( group.getGroupSet().getUid(), group.getGroupSet().getName() );
}
for ( DataElementCategoryDimension category : categoryDimensions )
{
meta.put( category.getDimension().getUid(), category.getDimension().getName() );
}
return meta;
}
/**
* Clear or set to false all persistent dimensional (not option) properties for this object.
*/
public void clear()
{
dataDimensionItems.clear();
periods.clear();
relatives = null;
organisationUnits.clear();
dataElementGroups.clear();
organisationUnitGroups.clear();
organisationUnitLevels.clear();
categoryDimensions.clear();
categoryOptionGroups.clear();
attributeDimensions.clear();
dataElementDimensions.clear();
programIndicatorDimensions.clear();
userOrganisationUnit = false;
userOrganisationUnitChildren = false;
userOrganisationUnitGrandChildren = false;
itemOrganisationUnitGroups.clear();
}
@Override
public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
{
super.mergeWith( other, strategy );
if ( other.getClass().isInstance( this ) )
{
BaseAnalyticalObject object = (BaseAnalyticalObject) other;
this.clear();
if ( strategy.isReplace() )
{
relatives = object.getRelatives();
program = object.getProgram();
aggregationType = object.getAggregationType();
}
else if ( strategy.isMerge() )
{
relatives = object.getRelatives() == null ? relatives : object.getRelatives();
program = object.getProgram() == null ? program : object.getProgram();
aggregationType = object.getAggregationType() == null ? aggregationType : object.getAggregationType();
}
dataDimensionItems.addAll( object.getDataDimensionItems() );
periods.addAll( object.getPeriods() );
organisationUnits.addAll( object.getOrganisationUnits() );
dataElementGroups.addAll( object.getDataElementGroups() );
organisationUnitGroups.addAll( object.getOrganisationUnitGroups() );
organisationUnitLevels.addAll( object.getOrganisationUnitLevels() );
categoryDimensions.addAll( object.getCategoryDimensions() );
categoryOptionGroups.addAll( object.getCategoryOptionGroups() );
attributeDimensions.addAll( object.getAttributeDimensions() );
dataElementDimensions.addAll( object.getDataElementDimensions() );
programIndicatorDimensions.addAll( object.getProgramIndicatorDimensions() );
userOrganisationUnitChildren = object.isUserOrganisationUnitChildren();
userOrganisationUnitGrandChildren = object.isUserOrganisationUnitGrandChildren();
itemOrganisationUnitGroups = object.getItemOrganisationUnitGroups();
digitGroupSeparator = object.getDigitGroupSeparator();
userOrganisationUnit = object.isUserOrganisationUnit();
sortOrder = object.getSortOrder();
topLimit = object.getTopLimit();
completedOnly = object.isCompletedOnly();
}
}
// -------------------------------------------------------------------------
// Getters and setters
// -------------------------------------------------------------------------
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlElementWrapper( localName = "dataDimensionItems", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "dataDimensionItem", namespace = DxfNamespaces.DXF_2_0 )
public List<DataDimensionItem> getDataDimensionItems()
{
return dataDimensionItems;
}
public void setDataDimensionItems( List<DataDimensionItem> dataDimensionItems )
{
this.dataDimensionItems = dataDimensionItems;
}
@JsonProperty
@JsonSerialize( contentAs = BaseNameableObject.class )
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlElementWrapper( localName = "organisationUnits", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "organisationUnit", namespace = DxfNamespaces.DXF_2_0 )
public List<OrganisationUnit> getOrganisationUnits()
{
return organisationUnits;
}
public void setOrganisationUnits( List<OrganisationUnit> organisationUnits )
{
this.organisationUnits = organisationUnits;
}
@JsonProperty
@JsonSerialize( contentUsing = JacksonPeriodSerializer.class )
@JsonDeserialize( contentUsing = JacksonPeriodDeserializer.class )
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlElementWrapper( localName = "periods", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "period", namespace = DxfNamespaces.DXF_2_0 )
public List<Period> getPeriods()
{
return periods;
}
public void setPeriods( List<Period> periods )
{
this.periods = periods;
}
@JsonProperty( value = "relativePeriods" )
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public RelativePeriods getRelatives()
{
return relatives;
}
public void setRelatives( RelativePeriods relatives )
{
this.relatives = relatives;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlElementWrapper( localName = "dataElementGroups", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "dataElementGroup", namespace = DxfNamespaces.DXF_2_0 )
public List<DataElementGroup> getDataElementGroups()
{
return dataElementGroups;
}
public void setDataElementGroups( List<DataElementGroup> dataElementGroups )
{
this.dataElementGroups = dataElementGroups;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlElementWrapper( localName = "organisationUnitGroups", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "organisationUnitGroup", namespace = DxfNamespaces.DXF_2_0 )
public List<OrganisationUnitGroup> getOrganisationUnitGroups()
{
return organisationUnitGroups;
}
public void setOrganisationUnitGroups( List<OrganisationUnitGroup> organisationUnitGroups )
{
this.organisationUnitGroups = organisationUnitGroups;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlElementWrapper( localName = "organisationUnitLevels", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "organisationUnitLevel", namespace = DxfNamespaces.DXF_2_0 )
public List<Integer> getOrganisationUnitLevels()
{
return organisationUnitLevels;
}
public void setOrganisationUnitLevels( List<Integer> organisationUnitLevels )
{
this.organisationUnitLevels = organisationUnitLevels;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlElementWrapper( localName = "categoryDimensions", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "categoryDimension", namespace = DxfNamespaces.DXF_2_0 )
public List<DataElementCategoryDimension> getCategoryDimensions()
{
return categoryDimensions;
}
public void setCategoryDimensions( List<DataElementCategoryDimension> categoryDimensions )
{
this.categoryDimensions = categoryDimensions;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlElementWrapper( localName = "categoryOptionGroups", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "categoryOptionGroup", namespace = DxfNamespaces.DXF_2_0 )
public List<CategoryOptionGroup> getCategoryOptionGroups()
{
return categoryOptionGroups;
}
public void setCategoryOptionGroups( List<CategoryOptionGroup> categoryOptionGroups )
{
this.categoryOptionGroups = categoryOptionGroups;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlElementWrapper( localName = "attributeDimensions", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "attributeDimension", namespace = DxfNamespaces.DXF_2_0 )
public List<TrackedEntityAttributeDimension> getAttributeDimensions()
{
return attributeDimensions;
}
public void setAttributeDimensions( List<TrackedEntityAttributeDimension> attributeDimensions )
{
this.attributeDimensions = attributeDimensions;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlElementWrapper( localName = "dataElementDimensions", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "dataElementDimension", namespace = DxfNamespaces.DXF_2_0 )
public List<TrackedEntityDataElementDimension> getDataElementDimensions()
{
return dataElementDimensions;
}
public void setDataElementDimensions( List<TrackedEntityDataElementDimension> dataElementDimensions )
{
this.dataElementDimensions = dataElementDimensions;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlElementWrapper( localName = "programIndicatorDimensions", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "programIndicatorDimension", namespace = DxfNamespaces.DXF_2_0 )
public List<TrackedEntityProgramIndicatorDimension> getProgramIndicatorDimensions()
{
return programIndicatorDimensions;
}
public void setProgramIndicatorDimensions( List<TrackedEntityProgramIndicatorDimension> programIndicatorDimensions )
{
this.programIndicatorDimensions = programIndicatorDimensions;
}
@JsonProperty
@JsonSerialize( as = BaseIdentifiableObject.class )
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public Program getProgram()
{
return program;
}
public void setProgram( Program program )
{
this.program = program;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public boolean isUserOrganisationUnit()
{
return userOrganisationUnit;
}
public void setUserOrganisationUnit( boolean userOrganisationUnit )
{
this.userOrganisationUnit = userOrganisationUnit;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public boolean isUserOrganisationUnitChildren()
{
return userOrganisationUnitChildren;
}
public void setUserOrganisationUnitChildren( boolean userOrganisationUnitChildren )
{
this.userOrganisationUnitChildren = userOrganisationUnitChildren;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public boolean isUserOrganisationUnitGrandChildren()
{
return userOrganisationUnitGrandChildren;
}
public void setUserOrganisationUnitGrandChildren( boolean userOrganisationUnitGrandChildren )
{
this.userOrganisationUnitGrandChildren = userOrganisationUnitGrandChildren;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlElementWrapper( localName = "itemOrganisationUnitGroups", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "itemOrganisationUnitGroup", namespace = DxfNamespaces.DXF_2_0 )
public List<OrganisationUnitGroup> getItemOrganisationUnitGroups()
{
return itemOrganisationUnitGroups;
}
public void setItemOrganisationUnitGroups( List<OrganisationUnitGroup> itemOrganisationUnitGroups )
{
this.itemOrganisationUnitGroups = itemOrganisationUnitGroups;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public DigitGroupSeparator getDigitGroupSeparator()
{
return digitGroupSeparator;
}
public void setDigitGroupSeparator( DigitGroupSeparator digitGroupSeparator )
{
this.digitGroupSeparator = digitGroupSeparator;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public int getSortOrder()
{
return sortOrder;
}
public void setSortOrder( int sortOrder )
{
this.sortOrder = sortOrder;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public int getTopLimit()
{
return topLimit;
}
public void setTopLimit( int topLimit )
{
this.topLimit = topLimit;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public AggregationType getAggregationType()
{
return aggregationType;
}
public void setAggregationType( AggregationType aggregationType )
{
this.aggregationType = aggregationType;
}
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public boolean isCompletedOnly()
{
return completedOnly;
}
public void setCompletedOnly( boolean completedOnly )
{
this.completedOnly = completedOnly;
}
// -------------------------------------------------------------------------
// Transient properties
// -------------------------------------------------------------------------
@JsonIgnore
public List<OrganisationUnit> getTransientOrganisationUnits()
{
return transientOrganisationUnits;
}
@Override
@JsonIgnore
public Date getRelativePeriodDate()
{
return relativePeriodDate;
}
@Override
@JsonIgnore
public OrganisationUnit getRelativeOrganisationUnit()
{
return relativeOrganisationUnit;
}
// -------------------------------------------------------------------------
// Analytical properties
// -------------------------------------------------------------------------
@Override
@JsonProperty
@JsonDeserialize( contentAs = BaseDimensionalObject.class )
@JsonView( { DimensionalView.class } )
@JacksonXmlElementWrapper( localName = "columns", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "column", namespace = DxfNamespaces.DXF_2_0 )
public List<DimensionalObject> getColumns()
{
return columns;
}
public void setColumns( List<DimensionalObject> columns )
{
this.columns = columns;
}
@Override
@JsonProperty
@JsonDeserialize( contentAs = BaseDimensionalObject.class )
@JsonView( { DimensionalView.class } )
@JacksonXmlElementWrapper( localName = "rows", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "row", namespace = DxfNamespaces.DXF_2_0 )
public List<DimensionalObject> getRows()
{
return rows;
}
public void setRows( List<DimensionalObject> rows )
{
this.rows = rows;
}
@Override
@JsonProperty
@JsonDeserialize( contentAs = BaseDimensionalObject.class )
@JsonView( { DimensionalView.class } )
@JacksonXmlElementWrapper( localName = "filters", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "filter", namespace = DxfNamespaces.DXF_2_0 )
public List<DimensionalObject> getFilters()
{
return filters;
}
public void setFilters( List<DimensionalObject> filters )
{
this.filters = filters;
}
@Override
@JsonProperty
@JsonView( { DimensionalView.class } )
public Map<String, String> getParentGraphMap()
{
return parentGraphMap;
}
public void setParentGraphMap( Map<String, String> parentGraphMap )
{
this.parentGraphMap = parentGraphMap;
}
}
| [
"[email protected]"
] | |
703bc20699795373364d0110d84e4fddfa6e7a26 | c9b8db6ceff0be3420542d0067854dea1a1e7b12 | /web/KoreanAir/src/main/java/com/ke/css/cimp/fwb/fwb13/Rule_SHIPPER_STATE_PROVINCE.java | 82eb1e141df32f7b18f34236d3710ede4486ab2a | [
"Apache-2.0"
] | permissive | ganzijo/portfolio | 12ae1531bd0f4d554c1fcfa7d68953d1c79cdf9a | a31834b23308be7b3a992451ab8140bef5a61728 | refs/heads/master | 2021-04-15T09:25:07.189213 | 2018-03-22T12:11:00 | 2018-03-22T12:11:00 | 126,326,291 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,250 | java | package com.ke.css.cimp.fwb.fwb13;
/* -----------------------------------------------------------------------------
* Rule_SHIPPER_STATE_PROVINCE.java
* -----------------------------------------------------------------------------
*
* Producer : com.parse2.aparse.Parser 2.5
* Produced : Tue Mar 06 10:35:29 KST 2018
*
* -----------------------------------------------------------------------------
*/
import java.util.ArrayList;
final public class Rule_SHIPPER_STATE_PROVINCE extends Rule
{
public Rule_SHIPPER_STATE_PROVINCE(String spelling, ArrayList<Rule> rules)
{
super(spelling, rules);
}
public Object accept(Visitor visitor)
{
return visitor.visit(this);
}
public static Rule_SHIPPER_STATE_PROVINCE parse(ParserContext context)
{
context.push("SHIPPER_STATE_PROVINCE");
boolean parsed = true;
int s0 = context.index;
ParserAlternative a0 = new ParserAlternative(s0);
ArrayList<ParserAlternative> as1 = new ArrayList<ParserAlternative>();
parsed = false;
{
int s1 = context.index;
ParserAlternative a1 = new ParserAlternative(s1);
parsed = true;
if (parsed)
{
boolean f1 = true;
@SuppressWarnings("unused")
int c1 = 0;
for (int i1 = 0; i1 < 9 && f1; i1++)
{
Rule rule = Rule_Typ_Text.parse(context);
if ((f1 = rule != null))
{
a1.add(rule, context.index);
c1++;
}
}
parsed = true;
}
if (parsed)
{
as1.add(a1);
}
context.index = s1;
}
ParserAlternative b = ParserAlternative.getBest(as1);
parsed = b != null;
if (parsed)
{
a0.add(b.rules, b.end);
context.index = b.end;
}
Rule rule = null;
if (parsed)
{
rule = new Rule_SHIPPER_STATE_PROVINCE(context.text.substring(a0.start, a0.end), a0.rules);
}
else
{
context.index = s0;
}
context.pop("SHIPPER_STATE_PROVINCE", parsed);
return (Rule_SHIPPER_STATE_PROVINCE)rule;
}
}
/* -----------------------------------------------------------------------------
* eof
* -----------------------------------------------------------------------------
*/
| [
"[email protected]"
] | |
506f8e2ff5f765bb2adc28a88c59d7997dbba5c5 | 7efbda1bff2d304f9f86259ece5127dc9ee69111 | /BIServer/src/main/java/com/tonbeller/wcf/table/TableModelChangeListener.java | abaa176fdb51b7e579b2ea2a894870def4df5b62 | [] | no_license | kalyansvm/biproject | 8f1bafd57b4cb8affa443a394dee2e774b9a9992 | 482b461f3b05b33b9a468526c5a59ed98dd4551c | refs/heads/master | 2021-01-10T09:34:25.669950 | 2009-05-13T01:50:17 | 2009-05-13T01:50:17 | 50,026,186 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 668 | java | /*
* ====================================================================
* This software is subject to the terms of the Common Public License
* Agreement, available at the following URL:
* http://www.opensource.org/licenses/cpl.html .
* Copyright (C) 2003-2004 TONBELLER AG.
* All Rights Reserved.
* You must accept the terms of that agreement to use this software.
* ====================================================================
*
*
*/
package com.tonbeller.wcf.table;
import java.util.EventListener;
public interface TableModelChangeListener extends EventListener {
void tableModelChanged(TableModelChangeEvent event);
}
| [
"[email protected]"
] | |
5b09c167fe7f5fd3d356a636d68145114f84375c | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/12/12_34939cea663c63f64a18549e15787e3a8de964c6/OpenStackAuthenticationHeaderManager/12_34939cea663c63f64a18549e15787e3a8de964c6_OpenStackAuthenticationHeaderManager_s.java | 515efaf21c671be7c54959f48515ac5a3701f31c | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 7,969 | java | package com.rackspace.papi.components.clientauth.openstack.v1_0;
import com.rackspace.auth.AuthGroup;
import com.rackspace.auth.AuthToken;
import com.rackspace.papi.commons.util.StringUtilities;
import com.rackspace.papi.commons.util.http.HttpStatusCode;
import com.rackspace.papi.commons.util.http.IdentityStatus;
import com.rackspace.papi.commons.util.http.OpenStackServiceHeader;
import com.rackspace.papi.commons.util.http.PowerApiHeader;
import com.rackspace.papi.filter.logic.FilterAction;
import com.rackspace.papi.filter.logic.FilterDirector;
import com.rackspace.papi.commons.util.http.header.HeaderValueImpl;
import org.slf4j.Logger;
import java.util.Date;
import com.rackspace.papi.commons.util.http.HttpDate;
import java.util.List;
/**
* Responsible for adding Authentication headers from validating token response
*/
public class OpenStackAuthenticationHeaderManager {
private static final Logger LOG = org.slf4j.LoggerFactory.getLogger(OpenStackAuthenticationHeaderManager.class);
// Proxy is specified in the OpenStack auth blue print:
// http://wiki.openstack.org/openstack-authn
private static final String X_AUTH_PROXY = "Proxy";
private final String authToken;
private final AuthToken cachableToken;
private final Boolean isDelagable;
private final FilterDirector filterDirector;
private final String tenantId;
private final Boolean validToken;
private final List<AuthGroup> groups;
// Hard code QUALITY for now as the auth component will have
// the highest QUALITY in terms of using the user it supplies for rate limiting
private static final String QUALITY = ";q=1.0";
private final String wwwAuthHeaderContents;
private static final String WWW_AUTHENTICATE_HEADER = "WWW-Authenticate";
private final String endpointsBase64;
//add base 64 string in here
public OpenStackAuthenticationHeaderManager(String authToken, AuthToken token, Boolean isDelegatable,
FilterDirector filterDirector, String tenantId, List<AuthGroup> groups, String wwwAuthHeaderContents, String endpointsBase64) {
this.authToken = authToken;
this.cachableToken = token;
this.isDelagable = isDelegatable;
this.filterDirector = filterDirector;
this.tenantId = tenantId;
this.validToken = token != null && token.getTokenId() != null;
this.groups = groups;
this.wwwAuthHeaderContents = wwwAuthHeaderContents;
this.endpointsBase64 = endpointsBase64;
}
//set header with base64 string here
public void setFilterDirectorValues() {
if (validToken) {
filterDirector.setFilterAction(FilterAction.PASS);
setExtendedAuthorization();
setUser();
setRoles();
setGroups();
setTenant();
setImpersonator();
setEndpoints();
setExpirationDate();
setDefaultRegion();
if (isDelagable) {
setIdentityStatus();
}
} else if (isDelagable && nullCredentials() && filterDirector.getResponseStatus() != HttpStatusCode.INTERNAL_SERVER_ERROR) {
filterDirector.setFilterAction(FilterAction.PROCESS_RESPONSE);
setExtendedAuthorization();
setIdentityStatus();
} else if (filterDirector.getResponseStatusCode() == HttpStatusCode.UNAUTHORIZED.intValue()) {
filterDirector.responseHeaderManager().putHeader(WWW_AUTHENTICATE_HEADER, wwwAuthHeaderContents);
}
}
private boolean nullCredentials() {
final boolean nullCreds = StringUtilities.isBlank(authToken) && StringUtilities.isBlank(tenantId);
LOG.debug("Credentials null = " + nullCreds);
return nullCreds;
}
/**
* EXTENDED AUTHORIZATION
*/
private void setExtendedAuthorization() {
filterDirector.requestHeaderManager().putHeader(OpenStackServiceHeader.EXTENDED_AUTHORIZATION.toString(), StringUtilities.isBlank(tenantId) ? X_AUTH_PROXY : X_AUTH_PROXY + " " + tenantId);
}
/**
* IDENTITY STATUS
*/
private void setIdentityStatus() {
IdentityStatus identityStatus = IdentityStatus.Confirmed;
if (!validToken) {
identityStatus = IdentityStatus.Indeterminate;
}
filterDirector.requestHeaderManager().putHeader(OpenStackServiceHeader.IDENTITY_STATUS.toString(), identityStatus.name());
}
private void setImpersonator() {
filterDirector.requestHeaderManager().removeHeader(OpenStackServiceHeader.IMPERSONATOR_NAME.toString());
filterDirector.requestHeaderManager().removeHeader(OpenStackServiceHeader.IMPERSONATOR_ID.toString());
if (StringUtilities.isNotBlank(cachableToken.getImpersonatorTenantId())) {
filterDirector.requestHeaderManager().putHeader(OpenStackServiceHeader.IMPERSONATOR_NAME.toString(), cachableToken.getImpersonatorUsername());
filterDirector.requestHeaderManager().putHeader(OpenStackServiceHeader.IMPERSONATOR_ID.toString(), cachableToken.getImpersonatorTenantId());
}
}
/**
* TENANT
*/
private void setTenant() {
filterDirector.requestHeaderManager().putHeader(OpenStackServiceHeader.TENANT_NAME.toString(), cachableToken.getTenantName());
filterDirector.requestHeaderManager().putHeader(OpenStackServiceHeader.TENANT_ID.toString(), cachableToken.getTenantId());
}
/**
* USER
* The PowerApiHeader is used for Rate Limiting
* The OpenStackServiceHeader is used for an OpenStack service
*/
private void setUser() {
filterDirector.requestHeaderManager().appendHeader(PowerApiHeader.USER.toString(), cachableToken.getUsername() + QUALITY);
filterDirector.requestHeaderManager().putHeader(OpenStackServiceHeader.USER_NAME.toString(), cachableToken.getUsername());
filterDirector.requestHeaderManager().putHeader(OpenStackServiceHeader.USER_ID.toString(), cachableToken.getUserId());
}
/**
* ROLES
* The OpenStackServiceHeader is used for an OpenStack service
*/
private void setRoles() {
String roles = cachableToken.getRoles();
if (StringUtilities.isNotBlank(roles)) {
filterDirector.requestHeaderManager().putHeader(OpenStackServiceHeader.ROLES.toString(), roles);
}
}
/**
* GROUPS
* The PowerApiHeader is used for Rate Limiting
*/
private void setGroups() {
for (AuthGroup group : groups) {
filterDirector.requestHeaderManager().appendHeader(PowerApiHeader.GROUPS.toString(), group.getId() + QUALITY);
}
}
/**
* ENDPOINTS
* The base 64 encoded list of endpoints in an x-catalog header.
*/
private void setEndpoints() {
if (!StringUtilities.isBlank(endpointsBase64)) {
filterDirector.requestHeaderManager().putHeader(PowerApiHeader.X_CATALOG.toString(), endpointsBase64);
}
}
/**
* ExpirationDate
* token expiration date in x-token-expires header that follows http spec rfc1123 GMT time format
*/
private void setExpirationDate() {
if (cachableToken.getExpires()>0) {
HttpDate date = new HttpDate(new Date(cachableToken.getExpires()));
filterDirector.requestHeaderManager().putHeader(OpenStackServiceHeader.X_EXPIRATION.toString(), date.toRFC1123());
}
}
/**
* Default Region
* Default region of user
*/
private void setDefaultRegion(){
String region = cachableToken.getDefaultRegion();
if(!StringUtilities.isBlank(region)){
filterDirector.requestHeaderManager().putHeader(OpenStackServiceHeader.DEFAULT_REGION.toString(), region);
}
}
}
| [
"[email protected]"
] | |
fa84988d2f6954bc7a39fd2323e37c043a5ca9ad | 75024dc0736e5405045a46e0a123cd7b69d28626 | /src/huellitasjsf/model/entities/Adopcion.java | 0b630f2736c51554f5daf1e600116372f8514a96 | [] | no_license | Gersong11/proyectohuellitas | 745975fa2ed784b9f038c1b46b96f571d5f5d43b | 0caeda26654eb60d7f301462e8a47e4d429065c9 | refs/heads/main | 2023-04-20T18:04:33.612195 | 2021-05-20T20:15:24 | 2021-05-20T20:15:24 | 369,278,142 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,574 | java | package huellitasjsf.model.entities;
import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
/**
* The persistent class for the adopcion database table.
*
*/
@Entity
@NamedQuery(name="Adopcion.findAll", query="SELECT a FROM Adopcion a")
public class Adopcion implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id_adopcion")
private int idAdopcion;
@Temporal(TemporalType.DATE)
private Date fechaFinAdop;
@Temporal(TemporalType.DATE)
private Date fechaInicioAdop;
//bi-directional many-to-one association to Perro
@ManyToOne
@JoinColumn(name="nombre")
private Perro perro;
//bi-directional many-to-one association to Persona
@ManyToOne
@JoinColumn(name="cedula")
private Persona persona;
public Adopcion() {
}
public int getIdAdopcion() {
return this.idAdopcion;
}
public void setIdAdopcion(int idAdopcion) {
this.idAdopcion = idAdopcion;
}
public Date getFechaFinAdop() {
return this.fechaFinAdop;
}
public void setFechaFinAdop(Date fechaFinAdop) {
this.fechaFinAdop = fechaFinAdop;
}
public Date getFechaInicioAdop() {
return this.fechaInicioAdop;
}
public void setFechaInicioAdop(Date fechaInicioAdop) {
this.fechaInicioAdop = fechaInicioAdop;
}
public Perro getPerro() {
return this.perro;
}
public void setPerro(Perro perro) {
this.perro = perro;
}
public Persona getPersona() {
return this.persona;
}
public void setPersona(Persona persona) {
this.persona = persona;
}
} | [
"[email protected]"
] | |
f56180526ce708c062457aa7bf5e1165716015b3 | 806f62ffbc260f44bdeb88ae8bd1104da6da0b9b | /changgou-parent/changgou-service/changgou-service-seckill/src/main/java/com/changgou/seckill/service/SeckillOrderService.java | 2680a3e128ff326a23e14041f48403e9b2832bee | [] | no_license | zwz001/changgou | ca8ae841521a54547e52e9bec4ffadbdde70a5e7 | 05ad0b688efc6643ccf5849846985853b49001b3 | refs/heads/master | 2022-06-22T05:53:48.736625 | 2020-02-12T01:03:51 | 2020-02-12T01:03:51 | 239,896,972 | 0 | 0 | null | 2022-06-21T02:47:06 | 2020-02-12T00:52:54 | JavaScript | UTF-8 | Java | false | false | 1,643 | java | package com.changgou.seckill.service;
import com.changgou.seckill.pojo.SeckillOrder;
import com.changgou.seckill.pojo.SeckillStatus;
import com.github.pagehelper.PageInfo;
import java.util.List;
/****
* @Author:admin
* @Description:SeckillOrder业务层接口
* @Date 2019/6/14 0:16
*****/
public interface SeckillOrderService {
/***
* SeckillOrder多条件分页查询
* @param seckillOrder
* @param page
* @param size
* @return
*/
PageInfo<SeckillOrder> findPage(SeckillOrder seckillOrder, int page, int size);
/***
* SeckillOrder分页查询
* @param page
* @param size
* @return
*/
PageInfo<SeckillOrder> findPage(int page, int size);
/***
* SeckillOrder多条件搜索方法
* @param seckillOrder
* @return
*/
List<SeckillOrder> findList(SeckillOrder seckillOrder);
/***
* 删除SeckillOrder
* @param id
*/
void delete(Long id);
/***
* 修改SeckillOrder数据
* @param seckillOrder
*/
void update(SeckillOrder seckillOrder);
/***
* 新增SeckillOrder
* @param seckillOrder
*/
void add(SeckillOrder seckillOrder);
/**
* 根据ID查询SeckillOrder
* @param id
* @return
*/
SeckillOrder findById(Long id);
/***
* 查询所有SeckillOrder
* @return
*/
List<SeckillOrder> findAll();
/**
* 添加订单
* @param id
* @param time
* @param username
* @return
*/
Boolean add(Long id, String time, String username);
SeckillStatus getUserSeckillStatus(String username);
}
| [
"[email protected]"
] | |
bcd84e37fd92ca9d7262ec4ed3f42816e659ba1b | eeba21320e1cabcc03d5d743ae7b819df955c500 | /src/lrsbp7saxparser/XMLLoader.java | a752cf437c0a97bb62cd57749798c7295d538021 | [] | no_license | lydsnyder/Java-Sax-Parser | fb21ffe896a380509cf12e2dcd2a418b0e7773b4 | b2109d6bfb7c02b6a123ef25b6bdef41f822222c | refs/heads/master | 2021-09-07T20:48:21.850495 | 2018-02-28T21:56:02 | 2018-02-28T21:57:03 | 123,346,020 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,132 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package lrsbp7saxparser;
import java.io.File;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
/**
*
* @author Lydia
*/
public class XMLLoader {
public static Node load(File xmlFile) throws Exception {
Node rootNode = new Node();
rootNode.setTitle("Root");
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser saxParser = factory.newSAXParser();
DefaultHandler handler = new DefaultHandler() {
Node parentNode = null;
Node currentNode = rootNode;
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
//System.out.println("Start element:" + qName);
parentNode = currentNode;
currentNode = new Node();
currentNode.setParent(parentNode);
currentNode.setTitle(qName);
//System.out.println(qName);
int attributeNum = attributes.getLength();
int i;
for(i = 0; i < attributeNum; i++ ){
Attribute attribute = new Attribute();
attribute.setTitle(attributes.getQName(i));
attribute.setData(attributes.getValue(i));
//System.out.println("Attribute" + i +": " + attribute.getTitle() + ", " + attribute.getData() + "\n");
currentNode.addAttribute(attribute);
}
}
@Override
public void endElement(String uri, String localName, String qName) throws SAXException {
// at some point add child node to parent
//System.out.println("End element:" + qName);
if(parentNode != null) {
parentNode.addChild(currentNode);
System.out.println("Parent node is not null. Parent node:" + parentNode.getTitle() + "\n");
currentNode = parentNode;
parentNode = currentNode.getParent();
}
}
@Override
public void characters(char ch[], int start, int length) throws SAXException {
currentNode.setData(new String(ch, start, length));
}
};
saxParser.parse(xmlFile.getAbsoluteFile(), handler);
} catch (Exception e) {
throw e;
}
System.out.println("Size here:" + rootNode.getChildren().size());
return rootNode;
}
}
| [
"[email protected]"
] | |
c25030970b1f5f005b21b91e3f52f8c3ffb176d4 | 60d0b76ed27d8afb01e08c8b8e3e9cfbce085091 | /src/model/entities/Department.java | 2ae2630123b0af2d6aba6fe21873fa73ac00fdbe | [] | no_license | crisaoo/demo-dao-jdbc | d95f3049183fdb06fc42ab1fa347d04d38b0ba3d | 0814144102db89c6bacb734001684cf9660b82f5 | refs/heads/master | 2022-11-10T10:59:05.141074 | 2020-07-01T19:10:34 | 2020-07-01T19:10:34 | 275,465,355 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,053 | java | package model.entities;
import java.io.Serializable;
public class Department implements Serializable{
private static final long serialVersionUID = 1L;
private Integer id;
private String name;
public Department() {}
public Department(Integer id, String name) {
this.id =id;
this.name = name;
}
public Integer getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Department other = (Department) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
@Override
public String toString() {
return "Department: " + name + ", ID: " + id;
}
} | [
"[email protected]"
] | |
0e501ef676018bc12430b362a8e32e8d29b03a81 | 8d82c3a4fd44c82523f6dc2191d694bd6a3de4e5 | /src/main/java/com/poc/patientportal/web/rest/errors/FieldErrorVM.java | 21dc19cd2bc06aa51a1e4958f2dcc6d9bcffabe5 | [] | no_license | maurofokker/patient-portal | a20a76fd3da6dca34f85df5eba20242e841a0f68 | 3ede18d735aafa2ebb73909f236e2372b477e81a | refs/heads/master | 2020-03-23T08:37:58.254976 | 2018-07-17T22:18:06 | 2018-07-17T22:18:06 | 141,337,762 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 653 | java | package com.poc.patientportal.web.rest.errors;
import java.io.Serializable;
public class FieldErrorVM implements Serializable {
private static final long serialVersionUID = 1L;
private final String objectName;
private final String field;
private final String message;
public FieldErrorVM(String dto, String field, String message) {
this.objectName = dto;
this.field = field;
this.message = message;
}
public String getObjectName() {
return objectName;
}
public String getField() {
return field;
}
public String getMessage() {
return message;
}
}
| [
"[email protected]"
] | |
99739a1246a4c70e716dcb7a8fde0a941cede203 | e5116b8d162c761d537f026c3921536398b05d30 | /app/src/main/java/com/example/testing/MainActivity.java | 481e10bf08e3215e28aad6e38875dccd091d5c37 | [] | no_license | keyman500/firstapp | 25a0d28612b4e954b398b8fb7361bd1236789c42 | 26b6ee84821a6e6196da83e6a35a10068b34c036 | refs/heads/master | 2022-12-20T02:53:56.635084 | 2020-10-14T05:34:23 | 2020-10-14T05:34:23 | 303,890,465 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,839 | java | package com.example.testing;
import android.os.Bundle;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private EditText num1;
private EditText num2;
private Button myButton,addbtn;
private TextView answer;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
answer= findViewById(R.id.textView);
addbtn = findViewById(R.id.button4);
num1 = findViewById(R.id.editText);
num2 = findViewById(R.id.editText2);
addbtn.setOnClickListener(this);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public void onClick(View v) {
if(v==myButton){
Toast.makeText(this,"button2 clicked bro",Toast.LENGTH_LONG).show();
}
if(v==addbtn){
int num1 = Integer.parseInt(this.num1.getText().toString());
int num2 = Integer.parseInt(this.num2.getText().toString());
int answer = num1 + num2;
String an = "" + answer;
this.answer.setText(an);
String t = an + " is the answer";
Toast.makeText(this,t,Toast.LENGTH_LONG).show();
}
}
}
| [
"[email protected]"
] | |
e509b26c03805d37b30ded26be26e5fafba1e787 | 28e099b5e7306d601dea4f11480de69cad07140e | /Data Structures/src/binary_tree/Node.java | 8ebacb1baf97682e96e75ca8423ed1bddbab7650 | [] | no_license | roalts/Data_Structures | c4fe6126df68583e9f5c84108ce50d8b51e7669c | f57e73789a645009b0b4ce80f74a12a79b5c831f | refs/heads/master | 2020-12-24T15:49:13.485805 | 2015-09-27T05:02:52 | 2015-09-27T05:02:52 | 37,371,505 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 71 | java | package binary_tree;
public class Node<T> {
T data;
Node<T> next;
}
| [
"[email protected]"
] | |
a476787dad0df7b4d4c64de2fcb4874d32a77f69 | 6d60a8adbfdc498a28f3e3fef70366581aa0c5fd | /codebase/dataset/t1/2275_frag2.java | 3f0f0380823148b84ed2423e3c8db48b93135772 | [] | no_license | rayhan-ferdous/code2vec | 14268adaf9022d140a47a88129634398cd23cf8f | c8ca68a7a1053d0d09087b14d4c79a189ac0cf00 | refs/heads/master | 2022-03-09T08:40:18.035781 | 2022-02-27T23:57:44 | 2022-02-27T23:57:44 | 140,347,552 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 538 | java | public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream _input, org.omg.CORBA.portable.ResponseHandler handler) throws org.omg.CORBA.SystemException {
org.omg.CORBA.portable.OutputStream _out = null;
java.lang.Integer opsIndex = (java.lang.Integer) m_opsHash.get(method);
if (null == opsIndex) throw new org.omg.CORBA.BAD_OPERATION(method + " not found");
switch(opsIndex.intValue()) {
case 0:
{
try {
| [
"[email protected]"
] | |
c9ac5d146874f393817cda3773f9578a4829cc10 | f2db7ebc9c1b82ee772bf5358dad363799a54557 | /BankOfAmerica/src/main/java/com/revature/driver/Driver.java | 75db555b95c2dbe67ebb47e7bfb627a768ceb795 | [] | no_license | 2010USFJava/HowardM | bd54d1166f84e9cb86f557a59b7aa1433138427d | ff14674b352a5d8c91d615ff41000b371f8201eb | refs/heads/master | 2023-01-18T17:49:12.348310 | 2020-11-18T15:37:26 | 2020-11-18T15:37:26 | 305,754,516 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 282 | java | package com.revature.driver;
import com.revature.menu.Menu;
import com.revature.users.User;
public class Driver {
public static void main(String[] args) {
User u1 = new User("Beyonce", "Knowles-Carter", "111 Main", "queenbey", "444");
Menu.greeting();
}
}
| [
"[email protected]"
] | |
a5aeb57a3b2658e2253afa9748fd33394265e85f | ab88e7de951de23c9c1ebf7c1dde4a54577c1261 | /src/at/dbo/cc/objects/musiker/Schlagzeuger.java | 06574f6840ab4c0b6382c626fc0220d44842b8e0 | [] | no_license | dboljevic/CC_02_Objektorientierung | 9f7b4960be37850c59ab3f31a60b173502ba5a80 | 41b0cf1f5c6634930a042d713a07a19f22559f95 | refs/heads/main | 2023-05-15T07:42:55.628956 | 2021-06-14T18:14:34 | 2021-06-14T18:14:34 | 366,795,976 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 290 | java | package at.dbo.cc.objects.musiker;
public class Schlagzeuger extends Musiker{
public Schlagzeuger(String name, int alter) {
super(name, alter);
}
@Override
public void singenSolo(){
System.out.println("You got mud on your face, you big disgrace");
}
}
| [
"[email protected]"
] | |
696a59281698315abf51357e13c9eb7851805ef7 | 58105e31d1378db95dc81645bbb196a77162f344 | /src/main/java/com/yanfeitech/application/config/UserIDAuditorBean.java | 13be578216eccd730e84f04f6b4010538c466427 | [] | no_license | Obito-hy/heyang | fae755ed13e6403907df8c2cc78231827210182f | 0ab1938c723e98124bcf64cf042dbbdcd0e97456 | refs/heads/master | 2023-04-09T05:25:00.274644 | 2021-04-26T13:31:24 | 2021-04-26T13:31:24 | 361,764,316 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,505 | java | package com.yanfeitech.application.config;
import java.util.Optional;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.domain.AuditorAware;
import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import com.yanfeitech.application.entity.User;
/**
*
* <p>
* Title: UserIDAuditorBean
* </p>
* <p>
* Description:使用上下文中的用户id,提供给JPA,用于数据库表操作人createby与updateby
* </p>
*
* @author zhudelin
* @date 2020年11月24日
*/
@Configuration
public class UserIDAuditorBean implements AuditorAware<String> {
@Override
public Optional<String> getCurrentAuditor() {
SecurityContext ctx = SecurityContextHolder.getContext();
if (ctx == null) {
return null;
}
if (ctx.getAuthentication() == null) {
return null;
}
if (ctx.getAuthentication().getPrincipal() == null) {
return null;
}
if (ctx.getAuthentication() instanceof AnonymousAuthenticationToken) {
return null;
}
if (ctx.getAuthentication() instanceof UsernamePasswordAuthenticationToken) {
Object principal = ctx.getAuthentication().getPrincipal();
User user = (User) principal;
if (user != null) {
return Optional.of(user.getId());
}
}
return null;
}
} | [
"[email protected]"
] | |
0d52f671704ad938753f457ffa2be33f0e8bb4cc | 7191cb83b268c7b5f9871699a02106351b3bb0fd | /android/app/src/main/java/com/pianeta/MainApplication.java | 39b552ba354d55f3eecc5b3c95020ede36a3f045 | [] | no_license | naniii17/pianetaApp | c170fe2abd68b563d13f40d38e99d1bc1cb73fed | 806de05c3ab3653545e26f090d3d1ab927a67099 | refs/heads/master | 2023-02-04T13:39:32.657950 | 2020-03-29T14:38:02 | 2020-03-29T14:38:02 | 251,052,206 | 0 | 0 | null | 2023-01-26T18:44:10 | 2020-03-29T14:29:52 | Objective-C | UTF-8 | Java | false | false | 2,274 | java | package com.pianeta;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this); // Remove this line if you don't want Flipper enabled
}
/**
* Loads Flipper in React Native templates.
*
* @param context
*/
private static void initializeFlipper(Context context) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper");
aClass.getMethod("initializeFlipper", Context.class).invoke(null, context);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
| [
"[email protected]"
] | |
d68d2d17a99e078106b4071d4738c759ef159f91 | 37de4516e2da3495cb3e59713be08fa6e2209f19 | /chat/src/chat/Setting.java | fd37f52c7590a890fbffe38dd3790dd26bd73b5a | [] | no_license | Dar9586/workspace | afac3c818513e8cbede58e9374a851bc20babc0f | f7ae503c8313bc9bdeda8a49f79b203cf45bb5db | refs/heads/master | 2020-05-30T12:28:31.132121 | 2017-04-14T20:51:24 | 2017-04-14T20:51:24 | 83,596,392 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 707 | java | package chat;
import java.awt.EventQueue;
import javax.swing.JFrame;
public class Setting {
private JFrame frame;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Setting window = new Setting();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public Setting() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 450, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
| [
"[email protected]"
] | |
ba547172da73b26206e9bacbb62e6f88b691197d | cf5e34bfaa9900df687652f92c9dce3cbfd8266c | /src/main/java/recursion/RecursionBasics.java | 9c3390df78f3588ef107250b1488e9f1d82f45be | [] | no_license | deepanshu7211/DataStructureUdPractice | fa58ffe0fb8f8905c07bb4192c59fb3179303bbe | e3cad594a00a9e4af2f1dab18f568e11fdfaea7c | refs/heads/master | 2023-06-27T16:43:58.436754 | 2021-08-02T16:21:18 | 2021-08-02T16:21:18 | 296,819,712 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 493 | java | package recursion;
public class RecursionBasics {
public static void main(String[] args) {
headRecursion(3);
tailRecursion(3);
}
public static void headRecursion(int n){
if(n>0){
headRecursion(n-1);
System.out.println("headRecursion N value " +n);
}
}
public static void tailRecursion(int n){
if(n>0){
System.out.println("tailRecursion N value " +n);
tailRecursion(n-1);
}
}
}
| [
"“[email protected]”"
] | |
4260f38b929c29682fe1b8201fe674a1fa86afc1 | d4b0afbdbfe705678a868a016f7e5f1309486d99 | /Comp1451_Assignment_2_Payroll_Framework/src/ca/bcit/comp1451/a2/payroll/test/VolunteerTest2.java | e45bef32af53178048fafea41ed343e00a2fd8bf | [] | no_license | e1212545/COMP-1451-Introduction-to-Java-2 | 17926018ec7ca17b14143cf1655147bd2b6086ce | da747c4ef52115383340d32a2b8c67027f16bbcc | refs/heads/master | 2020-04-18T06:25:20.426611 | 2017-03-01T20:47:45 | 2017-03-01T20:47:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,022 | java | package ca.bcit.comp1451.a2.payroll.test;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import ca.bcit.comp1451.a2.payroll.Volunteer;
/**
* A Test2 Class for Volunteer methods
*
* @author Ronnie Manimtim
* @version 1.0 29 Feb 2016
*/
public class VolunteerTest2 {
private static final double DEFAULT_PAY_RATE = 0.0;
private static Volunteer testVolunteer;
/**
* @throws java.lang.Exception
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
testVolunteer = new Volunteer();
}
/**
* @throws java.lang.Exception
*/
@AfterClass
public static void tearDownAfterClass() throws Exception {
testVolunteer = null;
}
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
testVolunteer = new Volunteer("Kimberly", "1200 West Point Grey Road", "514-8374");
}
/**
* @throws java.lang.Exception
*/
@After
public void tearDown() throws Exception {
testVolunteer = null;
}
/**
* Test method for {@link ca.bcit.comp1451.a2.payroll.Volunteer#pay()}.
*/
@Test
public final void testPay() {
testVolunteer = new Volunteer("Kimberly", "1200 West Point Grey Road", "514-8374");
double testPay = DEFAULT_PAY_RATE;
double actualPay = testVolunteer.pay();
assertTrue(testPay == actualPay);
}
/**
* Test method for {@link ca.bcit.comp1451.a2.payroll.Volunteer#toString()}.
*/
@Test
public final void testToString() {
testVolunteer = new Volunteer("Kimberly", "1200 West Point Grey Road", "514-8374");
String testVolunteer = "Volunteer Staff Member" + "\n";
testVolunteer += "Name: " + "Kimberly" + "\n";
testVolunteer += "Address: " + "1200 West Point Grey Road" + "\n";
testVolunteer += "Phone Number: " + "514-8374";
String actualToString = testVolunteer.toString();
assertEquals(testVolunteer, actualToString);
}
/**
* Test method for {@link ca.bcit.comp1451.a2.payroll.Volunteer#Volunteer()}
* .
*/
@Test
public final void testVolunteer() {
assertTrue(testVolunteer instanceof Volunteer);
}
/**
* Test method for
* {@link ca.bcit.comp1451.a2.payroll.Volunteer#Volunteer(java.lang.String, java.lang.String, java.lang.String)}
* .
*/
@Test
public final void testVolunteerStringStringString() {
assertTrue(testVolunteer instanceof Volunteer);
}
/**
* Test method for
* {@link ca.bcit.comp1451.a2.payroll.Volunteer#Volunteer()(String name)}.
*/
@Test
public final void testDefaultConstructorName() {
Volunteer testDefault = new Volunteer();
String name = "Enter a name";
assertEquals(name, testDefault.getName());
}
/**
* Test method for
* {@link ca.bcit.comp1451.a2.payroll.Volunteer#Volunteer()(String address)}
* .
*/
@Test
public final void testDefaultConstructorAddress() {
Volunteer testDefault = new Volunteer();
String address = "Enter an address";
assertEquals(address, testDefault.getAddress());
}
/**
* Test method for
* {@link ca.bcit.comp1451.a2.payroll.Volunteer#Volunteer()(String
* phoneNumber)}.
*/
@Test
public final void testDefaultConstructorPhoneNumber() {
Volunteer testDefault = new Volunteer();
String phoneNumber = "Enter a phone number";
assertEquals(phoneNumber, testDefault.getPhoneNumber());
}
/**
* Test method for {@link ca.bcit.comp1451.a2.payroll.StaffMember#getName()}
* .
*/
@Test
public void testGetName() {
testVolunteer = new Volunteer("Kimberly", "1200 West Point Grey Road", "514-8374");
assertEquals("Kimberly", testVolunteer.getName());
}
/**
* Test method for
* {@link ca.bcit.comp1451.a2.payroll.StaffMember#setName(java.lang.String)}
* .
*/
@Test
public void testSetName() {
testVolunteer.setName("Ollie");
assertEquals("Ollie", testVolunteer.getName());
}
/**
* Test method for
* {@link ca.bcit.comp1451.a2.payroll.StaffMember#getAddress()}.
*/
@Test
public void testGetAddress() {
testVolunteer = new Volunteer("Kimberly", "1200 West Point Grey Road", "514-8374");
assertEquals("1200 West Point Grey Road", testVolunteer.getAddress());
}
/**
* Test method for
* {@link ca.bcit.comp1451.a2.payroll.StaffMember#setAddress(java.lang.String)}
* .
*/
@Test
public void testSetAddress() {
testVolunteer.setAddress("11121 Horseshoe Way");
assertEquals("11121 Horseshoe Way", testVolunteer.getAddress());
}
/**
* Test method for
* {@link ca.bcit.comp1451.a2.payroll.StaffMember#getPhoneNumber()}.
*/
@Test
public void testGetPhoneNumber() {
testVolunteer = new Volunteer("Kimberly", "1200 West Point Grey Road", "514-8374");
assertEquals("514-8374", testVolunteer.getPhoneNumber());
}
/**
* Test method for
* {@link ca.bcit.comp1451.a2.payroll.StaffMember#setPhoneNumber(java.lang.String)}
* .
*/
@Test
public void testSetPhoneNumber() {
testVolunteer.setPhoneNumber("299-9000");
assertEquals("299-9000", testVolunteer.getPhoneNumber());
}
} | [
"[email protected]"
] | |
7f21e8997234cd9214ef279cd082f0494e6ff71b | 1c59e750d2cdf1f6268d7c35303d2f412ed2f597 | /home-modules/home-customer/home-customer-common/src/main/java/com/home/customer/common/vo/CustomerVo.java | fcaf412e54f1d8cec73b410c9c2812ddd165bbe6 | [] | no_license | chocoai/home-platform | 9e03f8cd7243ffd96e689238c7fefd2e4e26c7ba | 05c0f4e0823fe5a7f04839462d12393e20f3f3d2 | refs/heads/master | 2020-04-28T20:12:38.528072 | 2018-08-06T01:17:58 | 2018-08-06T01:17:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,090 | java | package com.home.customer.common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* Customer 视图对象
*
* @author roger
* @email [email protected]
* @create 2018-06-29 14:32
**/
@Data
@ApiModel(value = "Customer响应")
public class CustomerVo {
/**
* 主键id
*/
@ApiModelProperty(value = "主键id")
private Long id;
/**
* 电话
*/
@ApiModelProperty(value = "电话")
private String mobile;
/**
* 邮箱
*/
@ApiModelProperty(value = "邮箱")
private String email;
/**
* 姓名
*/
@ApiModelProperty(value = "姓名")
private String customerName;
/**
* 头像
*/
@ApiModelProperty(value = "头像")
private String headImage;
/**
* 性别性别(0-男、1-女)
*/
@ApiModelProperty(value = "性别性别(0-男、1-女)")
private Boolean gender;
/**
* 出生日期
*/
@ApiModelProperty(value = "出生日期")
private Date birthday;
}
| [
"[email protected]"
] | |
c304771f976bd6ded447c25511df074db7dd3699 | d154422af1f25d821f71d7ca8491139a5b26cefe | /Jsp/src/board/command/CDelete.java | 91ca3fc9b5d789c4d2322570858b4924f291ca21 | [] | no_license | navang/-Studying-java | d6c6f1b932f35ca4b15c3a3907a8481eeeab9e45 | d737ca06acbb268a506f9cd6abdcb5b83f3ffb05 | refs/heads/master | 2020-05-16T03:05:04.211372 | 2019-06-27T16:45:36 | 2019-06-27T16:45:36 | 182,648,703 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 807 | java | package board.command;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import board.model.BoardDao;
import board.model.BoardException;
public class CDelete implements Comm {
private String next;
public CDelete( String _next ){
next = _next;
}
public String execute(HttpServletRequest request, HttpServletResponse response ) throws CException {
try{
int article_id = Integer.parseInt(request.getParameter("article_id"));
String password = request.getParameter("password");
int resultCnt = BoardDao.getInstance().delete(article_id, password);
request.setAttribute("rs", resultCnt);
}catch( BoardException ex ){
throw new CException("CDelete.java < 삭제시 > " + ex.toString() );
}
return next;
}
}
| [
"[email protected]"
] | |
4b9831e4cd02baea9425bc5f42a825fa7ddc2bbe | c76549d852b520ef6b6aa1cae5ff395d7550f53a | /app/src/main/java/org/stepic/droid/util/resolvers/StepTypeResolverImpl.java | 0c6c01f5e5a5da5f886c23a1f11ee27e7ae8412f | [
"Apache-2.0"
] | permissive | meanmail/stepik-android | e592433e1b61fd2394454a6ac16c8b091a32d84f | d9a6b303f9d94035fcc5d3dc47b0252c02805e8b | refs/heads/master | 2021-01-11T04:30:03.091518 | 2016-10-10T08:21:53 | 2016-10-10T08:21:53 | 71,148,437 | 1 | 0 | null | 2016-10-17T14:42:13 | 2016-10-17T14:42:13 | null | UTF-8 | Java | false | false | 9,694 | java | package org.stepic.droid.util.resolvers;
import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import org.jetbrains.annotations.NotNull;
import org.stepic.droid.R;
import org.stepic.droid.base.StepBaseFragment;
import org.stepic.droid.model.Step;
import org.stepic.droid.util.AppConstants;
import org.stepic.droid.ui.fragments.ChoiceStepFragment;
import org.stepic.droid.ui.fragments.FreeResponseStepFragment;
import org.stepic.droid.ui.fragments.MatchingStepFragment;
import org.stepic.droid.ui.fragments.MathStepFragment;
import org.stepic.droid.ui.fragments.NotSupportedYetStepFragment;
import org.stepic.droid.ui.fragments.NumberStepFragment;
import org.stepic.droid.ui.fragments.PyCharmStepFragment;
import org.stepic.droid.ui.fragments.SortingStepFragment;
import org.stepic.droid.ui.fragments.StringStepFragment;
import org.stepic.droid.ui.fragments.TextStepFragment;
import org.stepic.droid.ui.fragments.VideoStepFragment;
import java.util.HashMap;
import java.util.Map;
import javax.inject.Singleton;
import timber.log.Timber;
@Singleton
public class StepTypeResolverImpl implements StepTypeResolver {
private Map<String, Drawable> mapFromTypeToDrawable;
private Map<String, Drawable> mapFromTypeToDrawableNotViewed;
private Context context;
private Drawable peerReviewDrawable;
private Drawable peerReviewDrawableNotViewed;
public StepTypeResolverImpl(Context context) {
Timber.d("create step type resolver: %s", toString());
this.context = context;
mapFromTypeToDrawable = new HashMap<>();
mapFromTypeToDrawableNotViewed = new HashMap<>();
peerReviewDrawableNotViewed = getDrawable(context, R.drawable.ic_peer_review);
peerReviewDrawable = getViewedDrawable(getDrawable(context, R.drawable.ic_peer_review).mutate());
Drawable simpleQuestionDrawableNotViewed = getDrawable(context, R.drawable.ic_easy_quiz);
Drawable simpleQuestionDrawable = getViewedDrawable(getDrawable(context, R.drawable.ic_easy_quiz).mutate());
Drawable videoDrawableNotViewed = getDrawable(context, R.drawable.ic_video_pin);
Drawable videoDrawable = getViewedDrawable(getDrawable(context, R.drawable.ic_video_pin).mutate());
Drawable animationDrawableNotViewed = getDrawable(context, R.drawable.ic_animation);
Drawable animationDrawable = getViewedDrawable(getDrawable(context, R.drawable.ic_animation).mutate());
Drawable hardQuizDrawableNotViewed = getDrawable(context, R.drawable.ic_hard_quiz);
Drawable hardQuizDrawable = getViewedDrawable(getDrawable(context, R.drawable.ic_hard_quiz).mutate());
Drawable theoryDrawableNotViewed = getDrawable(context, R.drawable.ic_theory);
Drawable theoryQuizDrawable = getViewedDrawable(getDrawable(context, R.drawable.ic_theory).mutate());
mapFromTypeToDrawable.put(AppConstants.TYPE_TEXT, theoryQuizDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_VIDEO, videoDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_MATCHING, simpleQuestionDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_SORTING, simpleQuestionDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_MATH, simpleQuestionDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_FREE_ANSWER, simpleQuestionDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_TABLE, simpleQuestionDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_STRING, simpleQuestionDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_CHOICE, simpleQuestionDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_NUMBER, simpleQuestionDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_DATASET, hardQuizDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_ANIMATION, animationDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_CHEMICAL, simpleQuestionDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_FILL_BLANKS, simpleQuestionDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_PUZZLE, simpleQuestionDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_PYCHARM, simpleQuestionDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_CODE, hardQuizDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_ADMIN, hardQuizDrawable);
mapFromTypeToDrawable.put(AppConstants.TYPE_SQL, simpleQuestionDrawable);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_TEXT, theoryDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_VIDEO, videoDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_MATCHING, simpleQuestionDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_SORTING, simpleQuestionDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_MATH, simpleQuestionDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_FREE_ANSWER, simpleQuestionDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_TABLE, simpleQuestionDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_STRING, simpleQuestionDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_CHOICE, simpleQuestionDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_NUMBER, simpleQuestionDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_DATASET, simpleQuestionDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_ANIMATION, animationDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_CHEMICAL, simpleQuestionDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_FILL_BLANKS, simpleQuestionDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_PUZZLE, simpleQuestionDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_PYCHARM, simpleQuestionDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_CODE, hardQuizDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_ADMIN, hardQuizDrawableNotViewed);
mapFromTypeToDrawableNotViewed.put(AppConstants.TYPE_SQL, simpleQuestionDrawableNotViewed);
}
public Drawable getDrawableForType(String type, boolean viewed, boolean isPeerReview) {
//todo:two maps for viewed and not, if viewed 1st map, not viewed the second?
if (isPeerReview) {
if (viewed) {
return peerReviewDrawable;
} else {
return peerReviewDrawableNotViewed;
}
}
if (viewed) {
Drawable drawable = mapFromTypeToDrawable.get(type);
if (drawable == null) {
drawable = mapFromTypeToDrawable.get(AppConstants.TYPE_TEXT);
}
return drawable;
} else {
Drawable drawable = mapFromTypeToDrawableNotViewed.get(type);
if (drawable == null) {
drawable = mapFromTypeToDrawableNotViewed.get(AppConstants.TYPE_TEXT);
}
return drawable;
}
}
@NonNull
private Drawable getViewedDrawable(Drawable drawable) {
int COLOR2 = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
COLOR2 = context.getColor(R.color.stepic_viewed_steps);
} else {
COLOR2 = context.getResources().getColor(R.color.stepic_viewed_steps);
}
PorterDuff.Mode mMode = PorterDuff.Mode.SRC_ATOP;
drawable.setColorFilter(COLOR2, mMode);
return drawable;
}
@Override
@NotNull
public StepBaseFragment getFragment(Step step) {
StepBaseFragment errorStep = new NotSupportedYetStepFragment();//todo: error and update?
if (step == null
|| step.getBlock() == null
|| step.getBlock().getName() == null
|| step.getBlock().getName().equals(""))
return errorStep;
String type = step.getBlock().getName();
switch (type) {
case AppConstants.TYPE_VIDEO:
return new VideoStepFragment();
case AppConstants.TYPE_TEXT:
return new TextStepFragment();
case AppConstants.TYPE_CHOICE:
return new ChoiceStepFragment();
case AppConstants.TYPE_FREE_ANSWER:
return new FreeResponseStepFragment();
case AppConstants.TYPE_STRING:
return new StringStepFragment();
case AppConstants.TYPE_MATH:
return new MathStepFragment();
case AppConstants.TYPE_NUMBER:
return new NumberStepFragment();
case AppConstants.TYPE_PYCHARM:
return new PyCharmStepFragment();
case AppConstants.TYPE_SORTING:
return new SortingStepFragment();
case AppConstants.TYPE_MATCHING:
return new MatchingStepFragment();
default:
return new NotSupportedYetStepFragment();
}
}
private Drawable getDrawable(Context context, @DrawableRes int drawableRes) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return context.getDrawable(drawableRes);
} else {
return context.getResources().getDrawable(drawableRes);
}
}
}
| [
"[email protected]"
] | |
24204775c5d8616f8aefb9e7c7d785493a9237ee | e4178cd5b13e31e35d07667658a7e7cc5e7a884d | /src/lbs/goodplace/com/View/main/MainIHaveView.java | c9b50848e5cb9e80a94ed34c954e3adc06adf5da | [] | no_license | itman83/ShopMall-Android | 7285d14b6215a0f53bdf4fafc57f7e5b20bf0adf | ee52fdab6a24379180bc762ae1fbf6199c7cb897 | refs/heads/master | 2020-12-31T06:22:54.926454 | 2014-01-23T12:09:57 | 2014-01-23T12:10:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,020 | java | package lbs.goodplace.com.View.main;
import java.util.ArrayList;
import java.util.List;
import lbs.goodplace.com.R;
import lbs.goodplace.com.controls.RefreshListView;
import lbs.goodplace.com.controls.RefreshListView.OnRefreshListener;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
public class MainIHaveView extends LinearLayout {
private Context mContext;
private RefreshListView mListview;
public MainIHaveView(final Context context) {
super(context);
this.mContext = context;
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.mainihave_view, this);
mListview = (RefreshListView)findViewById(R.id.ihaveListview);
mListview.setCacheColorHint(Color.WHITE) ;
//一定要SetAdapter先会有“下拉刷新”果个头(set个空的Adapter都得)
mListview.setAdapter(new ArrayAdapter<String>(mContext, android.R.layout.simple_expandable_list_item_1,getData()));
mListview.setonRefreshListener(new OnRefreshListener() {
@Override
public void onRefreshData() {
initData();
}
@Override
public void loadNextPageData() {
// TODO Auto-generated method stub
}
});
// setListviewHead();
}
/**
* 控制列表头
*/
private void setListviewHead(){
//列表头
if (mListview.getCount() > 1) { //1是因为有HEADVIEW
mListview.hideHeadView();
} else {
mListview.setHeadViewVisible();
}
}
/**
* 初始化 按钮数据
*/
private void initData() {
}
private List<String> getData(){
List<String> data = new ArrayList<String>();
data.add("测试数据1");
data.add("测试数据2");
data.add("测试数据3");
data.add("测试数据4");
return data;
}
}
| [
"[email protected]"
] | |
14ef987665ce7a4ccd134edacbe859284801a878 | 57414c0898b42f1891060806cf27ec8129f2cc7d | /src/main/java/boipelo/domain/user/UserEventHandler.java | 38807ce3c9339fd0b3d237f17b1526f28e70b96d | [] | no_license | Jamil-Najafov/Boipelo | daf343a81583a29df3bdb1c77c16d94b3a930c9f | d0dd4902c4e886bc46873d3eaeed7f096a9ca256 | refs/heads/master | 2021-01-15T17:51:11.705693 | 2015-03-25T00:21:44 | 2015-03-25T00:21:44 | 32,987,265 | 0 | 0 | null | 2015-03-27T13:22:10 | 2015-03-27T13:22:10 | null | UTF-8 | Java | false | false | 614 | java | package boipelo.domain.user;
import org.springframework.data.rest.core.annotation.HandleBeforeCreate;
import org.springframework.data.rest.core.annotation.HandleBeforeSave;
import org.springframework.data.rest.core.annotation.RepositoryEventHandler;
import org.springframework.security.access.prepost.PreAuthorize;
@RepositoryEventHandler(User.class)
public class UserEventHandler {
@HandleBeforeSave
// Application logic polluting the domain.
@PreAuthorize("#user.getId() == principal.id")
public void checkUpdateAuthority(User user) {
//only authority check
}
}
| [
"Aycan@Corsair"
] | Aycan@Corsair |
5d1545a6bc3ab828ae9c008a190a85e0274470cc | 0b051a5272e12ea7bcc7424b7e98122b6e82807c | /app/src/main/java/com/example/plauction/Common/CenteringTabLayout.java | 90561dd526697a98ae2156f481a48bea4b0d5632 | [] | no_license | mrchaos10/PLAuction | d19be284e8211025a0441d242757d60d899290cc | 4d37af2d48e378a21a404f44207a147691183afa | refs/heads/master | 2023-01-29T13:13:18.798398 | 2020-12-07T10:20:31 | 2020-12-07T10:20:31 | 294,385,955 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,136 | java | package com.example.plauction.Common;
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;
import com.google.android.material.tabs.TabLayout;
public class CenteringTabLayout extends TabLayout {
public CenteringTabLayout(Context context) {
super(context);
}
public CenteringTabLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CenteringTabLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@SuppressLint("NewApi")
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
if (!changed) return;
int totalTabsWidth = 0;
for (int i = 0; i < getTabCount(); i++)
totalTabsWidth += ((ViewGroup) getChildAt(0)).getChildAt(i).getWidth();
int padding = (getWidth() - totalTabsWidth) / 2;
if (padding < 0) padding = 0;
getChildAt(0).setPaddingRelative(padding, 0, padding, 0);
}
}
| [
"[email protected]"
] | |
687fed4c57eb65e2cd997bf0bdd0a9769abc8f32 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/24/24_4eb2fea10ec0985554499c054920d234eb4404f7/MediatedBannerAdViewController/24_4eb2fea10ec0985554499c054920d234eb4404f7_MediatedBannerAdViewController_t.java | 162fee4686794c253cf254562bf5e5e50f30cc5d | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,168 | java | /*
* Copyright 2013 APPNEXUS INC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.appnexus.opensdk;
import com.appnexus.opensdk.utils.Clog;
import android.app.Activity;
import android.view.View;
public class MediatedBannerAdViewController implements Displayable {
AdView owner;
int width;
int height;
String uid;
String className;
String param;
Class<?> c;
MediatedBannerAdView mAV;
View placeableView;
public MediatedBannerAdViewController(AdView owner, AdResponse response) {
width = response.getWidth();
height = response.getHeight();
uid = response.getMediatedUID();
className = response.getMediatedViewClassName();
param = response.getParameter();
try {
c = Class.forName(className);
} catch (ClassNotFoundException e) {
Clog.e(Clog.mediationLogTag, Clog.getString(R.string.class_not_found_exception));
return;
}
try {
mAV = (MediatedBannerAdView) c.newInstance();
} catch (InstantiationException e) {
Clog.e(Clog.mediationLogTag, Clog.getString(R.string.instantiation_exception));
return;
} catch (IllegalAccessException e) {
Clog.e(Clog.mediationLogTag, Clog.getString(R.string.illegal_access_exception));
return;
}
placeableView = mAV.requestAd((Activity)owner.getContext(), param, uid, width, height, owner);
}
@Override
public View getView() {
return placeableView;
}
@Override
public boolean failed() {
// TODO Auto-generated method stub
// Will spawn an ad request with the fail url and await further instruction
return false;
}
}
| [
"[email protected]"
] | |
478c93c5ac12de71ee2fac2252736ee1576ea6c5 | 4abb3d0bbabfef16f6f5142d70e4261e912cc329 | /src/test/java/tw/edu/ntub/imd/camping/request/MockRequest.java | 1fce09f5086b7b2e0bba3c1faa5aa9c59b83dc7a | [] | no_license | bbblu/camping-backend | 1bcbe5d480aea015a9009bd634e3fb0a84e268de | e5ce9c3b37e803c188c5f6ababeb8ae05c832feb | refs/heads/master | 2023-01-28T12:35:46.691937 | 2020-10-11T08:40:52 | 2020-10-11T08:40:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 871 | java | package tw.edu.ntub.imd.camping.request;
import tw.edu.ntub.imd.camping.enumerate.ContentType;
import java.time.LocalDateTime;
public interface MockRequest {
default MockRequest setContentType(ContentType contentType) {
return addHeader("Content-Type", contentType.type);
}
MockRequest addHeader(String header, String value);
MockRequest addHeader(String header, String... valueArray);
MockRequest addHeader(String header, LocalDateTime value);
MockRequest addQueryParameter(String key, Long... valueArray);
MockRequest addQueryParameter(String key, Double... valueArray);
MockRequest addQueryParameter(String key, Character... valueArray);
MockRequest addQueryParameter(String key, String... valueArray);
MockJsonRequest json();
MockFormDataRequest formData();
MockResponse send() throws Exception;
}
| [
"[email protected]"
] | |
b998e580ddbcfa62fbeea233c8eb3cdd172eb113 | c454a46ca3831dd5df13ae6a3ff6b31bd0dd06de | /workspace/02-ServiceBuilder/02-ServiceBuilder-api/src/main/java/com/liferay/curso/service/BarService.java | 25363127c43c71a1237da50e5cb8e08043420d44 | [] | no_license | victorherrerocazurro/CursoLiferayNalandaJulio2018 | d44f75414bde4c8e358b353c04ef40c209e52c33 | e5c5bca170d789a6d8ee7da1fa48443d427fdc31 | refs/heads/master | 2020-03-23T22:08:56.829387 | 2018-07-26T11:59:29 | 2018-07-26T11:59:29 | 142,156,277 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,391 | java | /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* 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.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.curso.service;
import aQute.bnd.annotation.ProviderType;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.jsonwebservice.JSONWebService;
import com.liferay.portal.kernel.security.access.control.AccessControlled;
import com.liferay.portal.kernel.service.BaseService;
import com.liferay.portal.kernel.spring.osgi.OSGiBeanProperties;
import com.liferay.portal.kernel.transaction.Isolation;
import com.liferay.portal.kernel.transaction.Transactional;
/**
* Provides the remote service interface for Bar. Methods of this
* service are expected to have security checks based on the propagated JAAS
* credentials because this service can be accessed remotely.
*
* @author Brian Wing Shun Chan
* @see BarServiceUtil
* @see com.liferay.curso.service.base.BarServiceBaseImpl
* @see com.liferay.curso.service.impl.BarServiceImpl
* @generated
*/
@AccessControlled
@JSONWebService
@OSGiBeanProperties(property = {
"json.web.service.context.name=foo", "json.web.service.context.path=Bar"}, service = BarService.class)
@ProviderType
@Transactional(isolation = Isolation.PORTAL, rollbackFor = {
PortalException.class, SystemException.class})
public interface BarService extends BaseService {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify or reference this interface directly. Always use {@link BarServiceUtil} to access the bar remote service. Add custom service methods to {@link com.liferay.curso.service.impl.BarServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
*/
/**
* Returns the OSGi service identifier.
*
* @return the OSGi service identifier
*/
public java.lang.String getOSGiServiceIdentifier();
} | [
"[email protected]"
] | |
ffa6289742265392d6af3e26d2b77e20cbc355d1 | 8ec981e516cd7254d53bdb225d53aad2c06ee7a2 | /src/main/java/com/t248/lmf/crm/CrmApplication.java | be47192f0c6029b0d5cfd5939d58849f51e2ca10 | [] | no_license | 2767274907/crm | 5d728c4ace6e31d46a62cab5342e4ab04f5505e1 | c5446e76c5d86df6d788ad7987e1cf0db53e76c6 | refs/heads/master | 2023-05-12T20:12:46.996859 | 2020-02-29T03:05:16 | 2020-02-29T03:05:16 | 243,885,521 | 3 | 0 | null | 2023-05-08T04:15:02 | 2020-02-29T01:36:54 | HTML | UTF-8 | Java | false | false | 342 | java | package com.t248.lmf.crm;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
//@EnableAutoConfiguration
public class CrmApplication {
public static void main(String[] args) {
SpringApplication.run(CrmApplication.class, args);
}
}
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.