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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e4a50cd0bb03b23b64aa1b6b1b94e05c1569215d | 24424b5490ca6af33fa21d8475db6b0e1e042005 | /app/controllers/admin/TerrainFeatures.java | f8e4217f29ede0c183fe7c15d203a9a4dd286fb1 | [] | no_license | ristes/apple-game | dc188632845669ec58d28ed3be06d783256c0c64 | 5789d61deedf4a74c910c38b97fba5c8419f404b | refs/heads/master | 2021-01-17T10:33:22.470919 | 2016-06-23T14:49:49 | 2016-06-23T14:49:49 | 15,433,419 | 0 | 0 | null | 2015-01-01T14:10:31 | 2013-12-25T10:13:10 | JavaScript | UTF-8 | Java | false | false | 101 | java | package controllers.admin;
import controllers.CRUD;
public class TerrainFeatures extends CRUD {
}
| [
"[email protected]"
] | |
659d00fcbc29445d4acb38824b3ec6944c1f4d61 | 15291c1264f52680724c2bc82ebde97588d533a7 | /src/main/java/pl/marcinek/spring_boot_datajpa/repository/TutorialRepository.java | 5cdc0707be027844c9d7f4966c6582c7feb6e28f | [] | no_license | KacperMarcinek/spring-boot-postgreql-crud | e527f4eb4564026d0fec70dfd20d6290dce80154 | 8847a5c4d33fa95d4f8aa938f9ce6df2751c7465 | refs/heads/master | 2022-12-11T23:15:32.126608 | 2020-09-07T09:42:55 | 2020-09-07T09:42:55 | 293,485,764 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 446 | java | package pl.marcinek.spring_boot_datajpa.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import pl.marcinek.spring_boot_datajpa.model.Tutorial;
import java.util.List;
@Repository
public interface TutorialRepository extends JpaRepository<Tutorial, Long> {
List<Tutorial> findByPublished(boolean published);
List<Tutorial> findByTitleContaining(String title);
}
| [
"[email protected]"
] | |
f7b6a19e8a55e3112dde7b70ef009705c23ea958 | 128eb90ce7b21a7ce621524dfad2402e5e32a1e8 | /laravel-converted/src/main/java/com/project/convertedCode/globalNamespace/classes/PHP_Token_INCLUDE_ONCE.java | c4c8c2fe5e0e193b2beffb3c113bbff47242aa69 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | RuntimeConverter/RuntimeConverterLaravelJava | 657b4c73085b4e34fe4404a53277e056cf9094ba | 7ae848744fbcd993122347ffac853925ea4ea3b9 | refs/heads/master | 2020-04-12T17:22:30.345589 | 2018-12-22T10:32:34 | 2018-12-22T10:32:34 | 162,642,356 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,984 | java | package com.project.convertedCode.globalNamespace.classes;
import java.lang.invoke.MethodHandles;
import com.runtimeconverter.runtime.passByReference.PassByReferenceArgs;
import com.project.convertedCode.globalNamespace.classes.PHP_Token_Includes;
import com.runtimeconverter.runtime.classes.NoConstructor;
import com.runtimeconverter.runtime.classes.RuntimeClassBase;
import com.runtimeconverter.runtime.RuntimeEnv;
import com.runtimeconverter.runtime.reflection.ReflectionClassData;
import com.runtimeconverter.runtime.arrays.ZPair;
/*
Converted with The Runtime Converter (runtimeconverter.com)
vendor/phpunit/php-token-stream/src/Token.php
*/
public class PHP_Token_INCLUDE_ONCE extends PHP_Token_Includes {
public PHP_Token_INCLUDE_ONCE(RuntimeEnv env, Object... args) {
super(env);
if (this.getClass() == PHP_Token_INCLUDE_ONCE.class) {
this.__construct(env, args);
}
}
public PHP_Token_INCLUDE_ONCE(NoConstructor n) {
super(n);
}
public static final Object CONST_class = "PHP_Token_INCLUDE_ONCE";
// Runtime Converter Internals
// RuntimeStaticCompanion contains static methods
// RequestStaticProperties contains static (per-request) properties
// ReflectionClassData contains php reflection data used by the runtime library
public static class RuntimeStaticCompanion extends PHP_Token_Includes.RuntimeStaticCompanion {
private static final MethodHandles.Lookup staticCompanionLookup = MethodHandles.lookup();
}
public static final RuntimeStaticCompanion runtimeStaticObject = new RuntimeStaticCompanion();
private static final ReflectionClassData runtimeConverterReflectionData =
ReflectionClassData.builder()
.setName("PHP_Token_INCLUDE_ONCE")
.setLookup(
PHP_Token_INCLUDE_ONCE.class,
MethodHandles.lookup(),
RuntimeStaticCompanion.staticCompanionLookup)
.setLocalProperties("id", "line", "name", "text", "tokenStream", "type")
.setFilename("vendor/phpunit/php-token-stream/src/Token.php")
.addExtendsClass("PHP_Token_Includes")
.addExtendsClass("PHP_Token")
.get();
@Override
public ReflectionClassData getRuntimeConverterReflectionData() {
return runtimeConverterReflectionData;
}
@Override
public Object converterRuntimeCallExtended(
RuntimeEnv env,
String method,
Class<?> caller,
PassByReferenceArgs passByReferenceArgs,
Object... args) {
return RuntimeClassBase.converterRuntimeCallExtendedWithDataStatic(
this,
runtimeConverterReflectionData,
env,
method,
caller,
passByReferenceArgs,
args);
}
}
| [
"[email protected]"
] | |
9c75bc8c14386a1051e6aa4617837900b92a66bc | 72d1d0bf648c2895eee46b73a6b3a735c677c059 | /src/br/com/trabalho/bd2/beans/LoginController.java | f50c053195f803a9da0fe2c2002736227c884287 | [
"Apache-2.0"
] | permissive | wyll1an/LocadoraVeiculos | c611a1522b3745353325c7864c773c4fb04dbd22 | 54971739ee7a8a2aa1024462e3ec3c571071531f | refs/heads/master | 2022-01-19T17:45:13.290157 | 2017-08-05T20:24:56 | 2017-08-05T20:24:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,596 | java | package br.com.trabalho.bd2.beans;
import java.io.Serializable;
import java.sql.SQLException;
import javax.annotation.PostConstruct;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;
import br.com.trabalho.bd2.dao.LoginDAO;
import br.com.trabalho.bd2.jsf.util.SessionUtils;
import br.com.trabalho.bd2.model.Usuario;
@ManagedBean
@SessionScoped
public class LoginController implements Serializable {
private static final long serialVersionUID = 1094801825228386363L;
private Usuario usuario;
private LoginDAO loginDAO;
@PostConstruct
public void init(){
this.usuario = new Usuario();
this.loginDAO = new LoginDAO();
}
//validate login
public String validateUsernamePassword() throws SQLException {
boolean valid = loginDAO.validate(usuario.getUser(), usuario.getPwd());
if (valid) {
HttpSession session = SessionUtils.getSession();
session.setAttribute("username", usuario.getUser());
return "index";
} else {
FacesContext.getCurrentInstance().addMessage(
null,
new FacesMessage(FacesMessage.SEVERITY_WARN,
"Nome ou senha Incorreto",
"Tente novamente"));
return "login";
}
}
//logout event, invalidate session
public String logout() {
HttpSession session = SessionUtils.getSession();
session.invalidate();
return "login";
}
public Usuario getUsuario() {
return usuario;
}
public void setUsuario(Usuario usuario) {
this.usuario = usuario;
}
}
| [
"Willian@Willian"
] | Willian@Willian |
8decf8d5f7090ff3ffc5cee4e490b77cf72cf5cf | 738af35341bbe42f0b97882e162a4abda57c3072 | /src/Elementary/Shell.java | f69e2b5edc5b2792b7e252928148efe5551896e3 | [] | no_license | jimmypham92/Sort-algorithm | 4825276e07d66d73b1029623f27a1789ddc8241c | 7db8615a30fb8e59f26bc561900e1eccc6e6f7c1 | refs/heads/master | 2021-05-31T07:13:58.035415 | 2015-12-24T05:09:01 | 2015-12-24T05:09:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,122 | java | package Elementary;
/**
* Author: Gác Xanh (phamanh)
* Date: 24/12/2015
* Class: OOP2
* Project: Sort-algorithm
*/
public class Shell {
public static void sort(Comparable[] a)
{
int N = a.length;
int h = 1;
while (h < N/3) h = 3*h + 1;
while (h >= 1)
{
for (int i = h; i < N; i++)
{
for (int j = i; j >= h && less(a[j], a[j-h]); j -= h)
exch(a,j,j-h);
}
h = h/3;
}
}
private static void exch(Comparable[] a, int i, int j){
Comparable t = a[i];
a[i] = a[j];
a[j] = t;
}
private static boolean less(Comparable v, Comparable w) {
return v.compareTo(w) < 0;
}
public static boolean isSorted(Comparable[] a){
for (int i = 1; i < a.length; i++) {
if (less(a[i],a[i-1])) return false;
}
return true;
}
public static void show(Comparable[] a){
for (int i = 0; i < a.length; i++) {
System.out.print(a[i] + " ");
}
System.out.println();
}
}
| [
"[email protected]"
] | |
3272386cf539bc880e7d9e56df22952675b3e723 | 4a0c455fda9a877c3be148a3bef724c954dd7e7f | /src/main/java/com/upit/algo/shuffle/KnuthShuffle.java | d397d99a15031e610ba6da5e76ddaa32dca84e93 | [] | no_license | ypitsishin/algorithms | e6524e70c87143a2adf713252c152fec774f1e98 | 5429ca57fdc58b5b825afe8d95b1bd6f7b01b5a9 | refs/heads/master | 2021-06-01T00:44:18.416792 | 2015-12-23T07:46:19 | 2015-12-23T07:46:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 547 | java | package com.upit.algo.shuffle;
import java.util.Random;
public class KnuthShuffle implements Shuffle {
@Override
public void shuffle(Comparable[] values) {
int n = values.length;
Random random = new Random();
for (int i = 1; i < n; i++) {
int randomIndex = random.nextInt(i + 1);
swap(values, i, randomIndex);
}
}
private void swap(Comparable[] values, int i, int j) {
Comparable temp = values[i];
values[i] = values[j];
values[j] = temp;
}
}
| [
"[email protected]"
] | |
3cfb03152b028e8e6b2e51317e5a54b2b930b22d | afb351c778f405586c11f859117d406b273ad222 | /task3/BigChat.java | 5172c5c74c297be27a9229515b1c03ffd967c379 | [] | no_license | CHRNV/java_oh | cba3427ada73e5e8795ce9d33e57e6afc0ccf34b | a9485e24e4f3d432a5dcac3af045f60aa2505969 | refs/heads/master | 2016-09-13T04:57:45.069289 | 2016-05-12T22:31:21 | 2016-05-12T22:31:21 | 58,672,711 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,367 | java |
import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
public class BigChat {
public static void main(String[] args) {
try {
Socket up1 = null;
Socket down1 = null;
if (!args[0].equals("0")) {
ServerSocket ss = new ServerSocket(Integer.parseInt(args[0]));
up1 = ss.accept();
}
if (!args[1].equals("0")) {
down1 = new Socket("localhost", Integer.parseInt(args[1]));
}
final Socket up = up1;
final Socket down = down1;
if (up != null) {
Thread listenUp = new Thread() {
public void run() {
try {
while (true) {
BufferedReader br = new BufferedReader(new InputStreamReader(up.getInputStream()));
String strUp = br.readLine();
System.out.println(strUp);
if (down != null)
sendMessage(down, strUp);
}
} catch (Exception e) {
System.out.println("Oh,exception!!! - 1 " + e);
}
}
};
listenUp.start();
}
if (down != null) {
Thread listenDown = new Thread() {
public void run() {
try {
while (true) {
BufferedReader br = new BufferedReader(new InputStreamReader(down.getInputStream()));
String strDown = br.readLine();
System.out.println(strDown);
if (up != null)
sendMessage(up, strDown);
}
} catch (Exception e) {
System.out.println("Oh,exception!!! - 2" + e);
}
}
};
listenDown.start();
}
Thread send = new Thread() {
public void run() {
try {
while (true) {
BufferedReader br2 = new BufferedReader(new InputStreamReader(System.in));
String str = br2.readLine();
if (up != null)
sendMessage(up, str);
if (down != null)
sendMessage(down, str);
}
} catch (Exception e) {
System.out.println("Oh,exception!!! - 3" + e);
}
}
};
send.start();
} catch (Exception e) {
System.out.println("Oh,exception!!! - 4" + e);
}
}
public static synchronized void sendMessage(Socket socket, String message)throws IOException {
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
bw.write(message, 0, message.length());
bw.newLine();
bw.flush();
}
}
| [
"[email protected]"
] | |
9fca8516fa9f1f5d199e54bf7a114ca6e7c4747f | fa62eabe8a65747e33f49d00f94aa71fb2f19cab | /hopeofseed/src/main/java/com/hopeofseed/hopeofseed/curView/SquareImageView.java | 980455ddef7294a6cba129b44aca323a08e22def | [] | no_license | yeai007/LGM_Project | b4de9574c6f775640cd45c6efeac5464f6f179a5 | 510ba1d19c6d07977b3471cabed1e2b590499c62 | refs/heads/master | 2021-01-13T07:31:57.496897 | 2017-01-17T04:52:30 | 2017-01-17T04:52:30 | 69,972,250 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,154 | java | package com.hopeofseed.hopeofseed.curView;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
* 项目名称:LGM_Project
* 类描述:
* 创建人:whisper
* 创建时间:2016/11/17 15:58
* 修改人:whisper
* 修改时间:2016/11/17 15:58
* 修改备注:
*/
public class SquareImageView extends ImageView {
public SquareImageView(Context context) {
super(context);
}
public SquareImageView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public SquareImageView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
setMeasuredDimension(getDefaultSize(0, widthMeasureSpec), getDefaultSize(0, heightMeasureSpec));
int childWidthSize = getMeasuredWidth();
//高度和宽度一样
heightMeasureSpec = widthMeasureSpec = MeasureSpec.makeMeasureSpec(childWidthSize, MeasureSpec.EXACTLY);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
| [
"[email protected]"
] | |
25970730a2d7b29623529a1b345fe9b609bd8516 | 0c058eb915718384c55136b7f9181fa9beb087f6 | /Lab03/ex02b/AndGate2.java | 63f8beaeb0b376151f0744a57a3242b029d4b67b | [
"MIT"
] | permissive | DavidAkaFunky/OOP2020 | 8d7db3d8533c3a4262b637ae069fdb02959c06d0 | 5fdb0c75766a955a233a2ab9b6c23aae89fc0396 | refs/heads/master | 2023-03-02T20:27:39.430633 | 2021-01-15T16:03:51 | 2021-01-15T16:03:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,140 | java | public class AndGate2{
private boolean _gate1 = false;
private boolean _gate2 = false;
public AndGate2(){}
public AndGate2(boolean bool){this._gate1 = this._gate2 = bool;}
public AndGate2(boolean bool1, boolean bool2){
this._gate1 = bool1;
this._gate2 = bool2;
}
public void setGate1(boolean bool){this._gate1 = bool;}
public void setGate2(boolean bool){this._gate2 = bool;}
public void setGates(boolean bool1, boolean bool2){
this._gate1 = bool1;
this._gate2 = bool2;
}
public boolean getGate1(){return this._gate1;}
public boolean getGate2(){return this._gate2;}
public boolean getOutput(){return this._gate1 && this._gate2;}
@Override
public boolean equals(Object other){
if (other instanceof AndGate2){
AndGate2 gate = (AndGate2) other;
return this.getGate1() == gate.getGate1() && this.getGate2() == gate.getGate2();
}
return false;
}
@Override
public String toString(){
return "A: " + this._gate1 + " B: " + this._gate2;
}
} | [
"[email protected]"
] | |
471d2656236480ccbc0c81ff81025384ceab3f92 | 446dcda88ad3e468bfbc27e7b079c9b50ff20624 | /app/src/main/java/universconception/conception/cegepstefoy/restaurantconcept/Model/CustomerAdapter.java | 7fa1abf324377542d10bcbd1a4b69e2917b3831a | [] | no_license | sediu88/MaVersionLesRestaurantsConceptWebApp | 82da8972cc4842cb404f448c803fa222c12ac7db | 61598bee4f4712d2c1a02a9e16267cf1d0478b38 | refs/heads/master | 2020-04-16T15:48:03.137456 | 2019-01-15T17:39:07 | 2019-01-15T17:39:07 | 165,714,864 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,339 | java | package universconception.conception.cegepstefoy.restaurantconcept.Model;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
import universconception.conception.cegepstefoy.restaurantconcept.R;
public class CustomerAdapter extends BaseAdapter {
Context context;
List<Mets> rowItems;
public CustomerAdapter(Context pContext, List<Mets> pRowItems) {
context = pContext;
rowItems = pRowItems;
}
@Override
public int getCount() {
return rowItems.size();
}
@Override
public Object getItem(int position) {
return rowItems.get(position);
}
@Override
public long getItemId(int position) {
return rowItems.indexOf(getItem(position));
}
private class ViewHolder {
ImageView profile_pic;
TextView member_name;
TextView quantity;
TextView contactType;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
LayoutInflater mInflater = (LayoutInflater) context
.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
if (convertView == null) {
convertView = mInflater.inflate(R.layout.liste_item, null);
holder = new ViewHolder();
holder.member_name = convertView.findViewById(R.id.member_name);
holder.profile_pic = convertView.findViewById(R.id.profile_pic);
holder.quantity = convertView.findViewById(R.id.quantity);
holder.contactType = convertView.findViewById(R.id.contact_type);
Mets row_pos = rowItems.get(position);
holder.profile_pic.setImageResource(row_pos.getProfile_pic_id());
holder.member_name.setText(row_pos.getNomMet());
holder.quantity.setText(Integer.toString(row_pos.getQuantity()));
holder.contactType.setText(" " + row_pos.getPrice().toString() + " \n$CAD");
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
return convertView;
}
}
| [
"[email protected]"
] | |
1107f9cbb7317d17ecafd129d49db28897ff858a | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/27/27_70ef7805163b1dd39ff5da1ff50babfd42e898b8/TabataActivity/27_70ef7805163b1dd39ff5da1ff50babfd42e898b8_TabataActivity_s.java | 5d27d497a2cb41f13ea162a638b3d04eda9920a6 | [] | 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,271 | java | package com.vorsk.crossfitr;
import com.vorsk.crossfitr.models.WorkoutModel;
import com.vorsk.crossfitr.models.WorkoutRow;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Typeface;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Message;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class TabataActivity extends Activity {
private static final int TOTAL_TIME = 30000 * 8;
// View elements in stopwatch.xml
private TextView mWorkoutDescription, mStateLabel, mWorkoutName;
private Button mStartStop, mReset, mFinish;
private Time tabata = new Time();
private boolean newStart, cdRun, goStop;
private long id;
private MediaPlayer mp;
// Timer to update the elapsedTime display
private final long mFrequency = 100; // milliseconds
private final int TICK_WHAT = 2;
private Handler mHandler = new Handler() {
public void handleMessage(Message m) {
updateElapsedTime();
sendMessageDelayed(Message.obtain(this, TICK_WHAT), mFrequency);
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tabata_tab);
cdRun = false;
//open model to put data into database
//get the id passed from previous activity (workout lists)
id = getIntent().getLongExtra("ID", -1);
//if ID is invalid, go back to home screen
if(id < 0)
{
getParent().setResult(RESULT_CANCELED);
finish();
}
newStart = true;
//create model object
WorkoutModel model = new WorkoutModel(this);
model.open();
WorkoutRow workout = model.getByID(id);
model.close();
Typeface roboto = Typeface.createFromAsset(getAssets(),"fonts/Roboto-Light.ttf");
mStateLabel = (TextView)findViewById(R.id.state_label);
mStateLabel.setTypeface(roboto);
mStateLabel.setText("");
mWorkoutDescription = (TextView)findViewById(R.id.workout_des_time);
mWorkoutDescription.setMovementMethod(new ScrollingMovementMethod());
mWorkoutDescription.setTypeface(roboto);
mWorkoutDescription.setText(workout.description);
mWorkoutName = (TextView)findViewById(R.id.workout_name_time);
mWorkoutName.setText(workout.name);
mWorkoutName.setTypeface(roboto);
mStartStop = (Button)findViewById(R.id.start_stop_button);
mStartStop.setTypeface(roboto);
mReset = (Button)findViewById(R.id.reset_button);
mReset.setTypeface(roboto);
mReset.setEnabled(false);
mFinish = (Button)findViewById(R.id.finish_workout_button);
mFinish.setTypeface(roboto);
mFinish.setEnabled(false);
mHandler.sendMessageDelayed(Message.obtain(mHandler, TICK_WHAT), mFrequency);
}
@Override
protected void onDestroy() {
super.onDestroy();
}
public void onStartStopClicked(View V) {
if(!tabata.isRunning()){
newStart = false;
((TimeTabWidget) getParent()).getTabHost().getTabWidget().getChildTabViewAt(0).setEnabled(false);
((TimeTabWidget) getParent()).getTabHost().getTabWidget().getChildTabViewAt(1).setEnabled(false);
playSound(R.raw.countdown_3_0);
new CountDownTimer(3000, 100) {
public void onTick(long millisUntilFinished) {
mStartStop.setText("" + (millisUntilFinished / 1000 + 1));
mStartStop.setEnabled(false);
mStateLabel.setText("Press To Stop");
mStateLabel.setTextColor(-65536);
mReset.setEnabled(false);
mFinish.setEnabled(false);
cdRun = true;
}
public void onFinish() {
goStop = true;
playSound(R.raw.bell_ring);
//mStartStop.setText("Go!");
tabata.start();
cdRun = false;
mStartStop.setEnabled(true);
}
}.start();
}
else{
tabata.stop();
newStart = false;
((TimeTabWidget) getParent()).getTabHost().getTabWidget().getChildTabViewAt(0).setEnabled(true);
((TimeTabWidget) getParent()).getTabHost().getTabWidget().getChildTabViewAt(1).setEnabled(true);
mStateLabel.setText("Press To Start");
mStateLabel.setTextColor(-16711936);
mReset.setEnabled(true);
mFinish.setEnabled(true);
}
}
public void onResetClicked(View v) {
newStart = true;
tabata.reset();
mReset.setEnabled(false);
mFinish.setEnabled(false);
}
public void onFinishClicked(View v) {
Intent result = new Intent();
result.putExtra("time", getFormattedElapsedTime());
getParent().setResult(RESULT_OK, result);
finish();
}
/**
* method to do when 8 sets are done
*/
private void endTabata() {
newStart = true;
//playSound(R.raw.boxing_bellx3);
tabata.reset();
}
public void updateElapsedTime() {
if(!cdRun)
mStartStop.setText(getFormattedElapsedTime());
}
private String formatElapsedTime(long now, int set) {
long seconds = 0, tenths = 0;
StringBuilder sb = new StringBuilder();
if(newStart){
now = 20000;
}
if (now < 1000) {
tenths = now / 100;
} else if (now < 60000) {
seconds = now / 1000;
now -= seconds * 1000;
tenths = now / 100;
}
sb.append("SET : ").append(set).append("\n").append(formatDigits(seconds)).append(".").append(tenths);
return sb.toString();
}
private String formatDigits(long num) {
return (num < 10) ? "0" + num : new Long(num).toString();
}
public String getFormattedElapsedTime() {
long time = tabata.getElapsedTime();
int set = 1 + ((int)time / 30000);
long diff = TOTAL_TIME - time;
long remain = diff % 30000;
int green = Color.GREEN;
int red = Color.RED;
//reset at end of set 8 workout. no last 10 sec break
if(diff <= 10000){
set = 1;
this.endTabata();
}
// if logic to display sets and time for tabata
if(remain > 10000 ){
if(!goStop){
playSound(R.raw.bell_ring);
goStop = true;
}
this.setActivityBackgroundColor(green);
return formatElapsedTime(20000 - (time % 30000), set);
}else if(remain == 10000){
return formatElapsedTime(0, set);
}else{
if(goStop){
playSound(R.raw.air_horn);
goStop = false;
}
this.setActivityBackgroundColor(red);
return formatElapsedTime(30000 - (time % 30000), set);
}
}
/**
* method to change background color
* @param color
*/
public void setActivityBackgroundColor(int color){
View view = this.getWindow().getDecorView();
view.setBackgroundColor(color);
}
/**
* method to play sound file
* @param r
*/
private void playSound(int r) {
//Release any resources from previous MediaPlayer
if (mp != null) {
mp.release();
}
// Create a new MediaPlayer to play this sound
mp = MediaPlayer.create(this, r);
mp.start();
}
}
| [
"[email protected]"
] | |
e6d346c5dac2bf2e30b0b2e253b02d07086b3a0f | 3c9b43b47b30bd861c140d0f8d91c9e349c52094 | /src/dicomanalyser/DICOMStore.java | c5519b50e0a3b139066bbaad1f205ad1754b05b8 | [] | no_license | evgenyorlov1/Dicom-Viewer | 2c591a437f523646fa007fb172c206fd7f314509 | 2089472e87091455879fb49415f27b5d02bfcf28 | refs/heads/master | 2021-01-01T05:17:07.218349 | 2016-05-20T03:17:16 | 2016-05-20T03:17:16 | 57,183,548 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,318 | 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 dicomanalyser;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map;
/**
*
* @author pc
*/
public class DICOMStore {
public ArrayList<Float> uniqueSliceLocations = new ArrayList<>();
public ArrayList<DICOMImage> dcmImages = new ArrayList<>();
public Map<Float, ArrayList<Integer>> instanceNumbersBySlice = new LinkedHashMap<>();
public void add(DICOMImage image) {
try {
dcmImages.add(image);
if(!uniqueSliceLocations.contains(image.sliceLocation)) {
uniqueSliceLocations.add((float) image.sliceLocation);
TagSorter.insertionSortFloat(uniqueSliceLocations);
}
} catch(Exception e) {System.out.println("DICOMStore.add error: " + e);}
}
public void sortBySlice() {
try {
for(int i=0; i<uniqueSliceLocations.size(); i++) {
ArrayList<Integer> instancesPerSlice = new ArrayList<>();
for(int j=0; j<dcmImages.size(); j++) {
if(Float.compare(dcmImages.get(j).sliceLocation,
uniqueSliceLocations.get(i)) == 0) {
instancesPerSlice.add(dcmImages.get(j).instanceNumber);
}
}
TagSorter.insertionSortInteger(instancesPerSlice);
instanceNumbersBySlice.put(uniqueSliceLocations.get(i),
instancesPerSlice);
}
} catch(Exception e) {System.out.println("DICOMStore.sortBySlice error: " + e);}
}
public DICOMImage get(int sliceLocationIndex, int instanceNumberIndex) {
try {
float sliceLocation = uniqueSliceLocations.get(sliceLocationIndex);
int instanceNumber = instanceNumbersBySlice.get(sliceLocation).
get(instanceNumberIndex);
for(int i=0; i<dcmImages.size(); i++) {
DICOMImage image = dcmImages.get(i);
if(Float.compare(image.sliceLocation, sliceLocation) == 0 &&
(image.instanceNumber == instanceNumber)) {
System.out.println("-----------");
System.out.println("instance: " + image.instanceNumber);
System.out.println("slice: " + image.sliceLocation);
return image;
}
}
} catch(Exception e) {System.out.println("DICOMStore.get error: " + e);}
return get(0,0);
}
public int getZcount() {
return uniqueSliceLocations.size() - 1;
}
public int getTcount(int sliceLocationIndex) {
int numberOfInstances = 0;
float sliceLocation = uniqueSliceLocations.get(sliceLocationIndex);
numberOfInstances = instanceNumbersBySlice.get(sliceLocation).size();
return numberOfInstances - 1;
}
}
| [
"[email protected]"
] | |
311cbcb39df73033ccf5c532773ba0848c99428b | d5f09c7b0e954cd20dd613af600afd91b039c48a | /sources/com/github/salomonbrys/kotson/GsonKt$fromJson$$inlined$typeToken$2.java | eba0072026251e9d62d0adaf0c4dc17286acddcb | [] | no_license | t0HiiBwn/CoolapkRelease | af5e00c701bf82c4e90b1033f5c5f9dc8526f4b3 | a6a2b03e32cde0e5163016e0078391271a8d33ab | refs/heads/main | 2022-07-29T23:28:35.867734 | 2021-03-26T11:41:18 | 2021-03-26T11:41:18 | 345,290,891 | 5 | 2 | null | null | null | null | UTF-8 | Java | false | false | 635 | java | package com.github.salomonbrys.kotson;
import com.google.gson.reflect.TypeToken;
import kotlin.Metadata;
@Metadata(bv = {1, 0, 0}, d1 = {"\u0000\r\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001B\u0005¢\u0006\u0002\u0010\u0002¨\u0006\u0003"}, d2 = {"com/github/salomonbrys/kotson/GsonBuilderKt$gsonTypeToken$1", "Lcom/google/gson/reflect/TypeToken;", "()V", "kotson_main"}, k = 1, mv = {1, 1, 1})
/* compiled from: GsonBuilder.kt */
public final class GsonKt$fromJson$$inlined$typeToken$2 extends TypeToken<T> {
GsonKt$fromJson$$inlined$typeToken$2() {
}
}
| [
"[email protected]"
] | |
d0c1732b23fbfa78b592c57499616faede748afa | eb4809dee3680268b8f5ba3b3fb2a31a41a28708 | /bankproject/src/com/hcl/bank/SearchAccountMain.java | 5314185a314e0ce3fff345843eb86fd251e10d84 | [] | no_license | pavanimallem/javatraining | 326182623e65048bc66c3df41f78dd2b2715599d | e6a3068b37a2cfe8edbcdcbcd3da1fb8a4d253e8 | refs/heads/master | 2023-01-01T03:03:07.842035 | 2019-12-27T07:02:38 | 2019-12-27T07:02:38 | 223,158,423 | 0 | 0 | null | 2022-12-16T03:47:43 | 2019-11-21T11:26:38 | Java | UTF-8 | Java | false | false | 849 | java | package com.hcl.bank;
import java.util.Scanner;
public class SearchAccountMain {
public static void main(String[] args) {
int accountNo;
Scanner sc=new Scanner(System.in);
System.out.println("enter accountno ");
accountNo=sc.nextInt();
AccountDAO dao=new AccountDAO();
Account account=dao.searchAccount(accountNo);
if(account!=null) {
System.out.println("first name " +account.getFirstName());
System.out.println("last name " +account.getLastName());
System.out.println("city "+account.getCity());
System.out.println("state "+account.getState());
System.out.println("amount"+account.getAmount());
System.out.println("cheqfacil "+account.getCheqFacil());
System.out.println("accounttype "+account.getAccountType());
} else {
System.out.println("accountno not found..");
}
}
}
| [
"[email protected]"
] | |
a0c7290be47a43b73f36f5b2e831e16bdfcbd8aa | ea7fc73837faaa38c489b9d109fa921d5c972a5c | /src/main/java/com/ibs/proyecto/model/Inventario.java | a9496075bad6195b4722a84977dd085c97f7c493 | [] | no_license | eliassalazar/Ejamplo_IBS | def51aad34c7bc6df2b47a57c7fba0713f4f0311 | 99fd9cf9c09f2d9e1335ca4c2a7e6a0da359b0fd | refs/heads/master | 2020-08-11T08:44:48.567104 | 2019-10-11T21:27:54 | 2019-10-11T21:27:54 | 214,530,798 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,410 | java | package com.ibs.proyecto.model;
import java.io.Serializable;
import java.sql.Timestamp;
import javax.persistence.*;
import java.util.List;
/**
* The persistent class for the inventarios database table.
*
*/
@Entity
@Table(name="inventarios")
@NamedQuery(name="InventarioController.findAll", query="SELECT i FROM Inventario i")
public class Inventario implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long idInventario;
private String descripcion;
private Timestamp fecha;
//bi-directional many-to-one association to Compra
@ManyToOne
@JoinColumn(name="idCompra")
private Compra compras;
//bi-directional many-to-one association to Venta
@ManyToOne
@JoinColumn(name="idVenta")
private Venta ventas;
//bi-directional many-to-one association to Inventariosproducto
@OneToMany(mappedBy="inventarios", fetch=FetchType.LAZY)
private List<Inventariosproducto> inventariosproductos;
public Inventario() {
}
public Long getIdInventario() {
return this.idInventario;
}
public void setIdInventario(Long idInventario) {
this.idInventario = idInventario;
}
public String getDescripcion() {
return this.descripcion;
}
public void setDescripcion(String descripcion) {
this.descripcion = descripcion;
}
public Timestamp getFecha() {
return this.fecha;
}
public void setFecha(Timestamp fecha) {
this.fecha = fecha;
}
public Compra getCompras() {
return this.compras;
}
public void setCompras(Compra compras) {
this.compras = compras;
}
public Venta getVentas() {
return this.ventas;
}
public void setVentas(Venta ventas) {
this.ventas = ventas;
}
public List<Inventariosproducto> getInventariosproductos() {
return this.inventariosproductos;
}
public void setInventariosproductos(List<Inventariosproducto> inventariosproductos) {
this.inventariosproductos = inventariosproductos;
}
public Inventariosproducto addInventariosproducto(Inventariosproducto inventariosproducto) {
getInventariosproductos().add(inventariosproducto);
inventariosproducto.setInventarios(this);
return inventariosproducto;
}
public Inventariosproducto removeInventariosproducto(Inventariosproducto inventariosproducto) {
getInventariosproductos().remove(inventariosproducto);
inventariosproducto.setInventarios(null);
return inventariosproducto;
}
} | [
"[email protected]"
] | |
cbd06d722c288bed2122dda4c4494db724ab608d | 5bcaa91d0c8eb5d63414a4a39589f640f7ce760a | /src/main/java/com/revolut/task/controller/BalanceController.java | 2085246181d216c477b0dfaade8a628a1f604630 | [] | no_license | passingbyreloaded/testTask | c7cefe8ef75917153d4859290083dfbae872a400 | 32273f4b29829c08e05a5212f963a467f17eba41 | refs/heads/master | 2022-05-31T05:12:13.591798 | 2019-10-06T11:53:03 | 2019-10-06T11:53:03 | 212,373,988 | 0 | 0 | null | 2022-05-20T21:10:36 | 2019-10-02T15:17:35 | Java | UTF-8 | Java | false | false | 886 | java | package com.revolut.task.controller;
import com.revolut.task.exception.AccountNotFoundException;
import com.revolut.task.service.AccountService;
import spark.Request;
import spark.Response;
import spark.Route;
import java.math.BigDecimal;
import static com.revolut.task.Application.*;
public class BalanceController implements Route {
private final AccountService accountService;
public BalanceController(AccountService accountService) {
this.accountService = accountService;
}
@Override
public Object handle(Request request, Response response) {
try {
BigDecimal balance = accountService.getBalance(request.params(":number"));
response.status(OK);
return balance;
} catch (AccountNotFoundException ex) {
response.status(NOT_FOUND);
return ex.getMessage();
}
}
}
| [
"[email protected]"
] | |
d8a113167a79cf4bc6e79309527f4535089356d2 | 4eef2b56352c03b07659c5129ab45dc521a2f89a | /src/mp/display/StandingArea.java | 367cce5c68220dff05be97b510dc3c524cb4a9be | [] | no_license | pmq101/Monty-Python-Bridge-of-Death-Simulation | a278317977a0f799b27ce3d2b10e40fd82de01f1 | 25e318dc82a59153a7d9b30722829944127b2e2f | refs/heads/master | 2020-04-14T03:27:31.290124 | 2018-12-30T19:03:49 | 2018-12-30T19:03:49 | 163,608,409 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 83 | java | package mp.display;
public interface StandingArea extends BoundedShape {
}
| [
"[email protected]"
] | |
810f8839a7866ff3811fcbf8c9e6283066659d0d | 3c808334c4d56d69b75f1846d3cfe3d646b57f6c | /app/src/main/java/br/com/valterdiascalhas/orcamentos/Orcamento.java | a8b65007f0d07cf5e5eef84bd0a14268ad85ae58 | [] | no_license | george-rodes/calhas-vila-nova | 9b91d102bc0742a31cac59b3eb36681e89c97ce0 | 51dd07c162de17f04a053c83f8d596545ee6c073 | refs/heads/master | 2020-07-23T17:58:01.960588 | 2016-11-29T11:19:09 | 2016-11-29T11:19:09 | 73,802,966 | 0 | 1 | null | 2016-11-15T22:51:29 | 2016-11-15T10:29:20 | Java | UTF-8 | Java | false | false | 2,375 | java | package br.com.valterdiascalhas.orcamentos;
/**
* Created by George on 25/08/2016.
*/
public class Orcamento {
private int orcamento, ano, mes, dia;
/** int para long **/
private long total;
private String nome, data, rua, bairro, cidade, observacao;
//private float total;
//Empty Constructor for Test
public Orcamento(){
}
public Orcamento(int orcamento, String nome, String data,
int ano, int mes, int dia,
String rua, String bairro, String cidade,
long total, String observacao) {
this.orcamento = orcamento;
this.nome = nome;
this.data = data;
this.ano = ano;
this.mes = mes;
this.dia = dia;
this.rua = rua;
this.bairro = bairro;
this.cidade = cidade;
this.total = total; //centavos
this.observacao = observacao;
}
public int getOrcamento() {
return orcamento;
}
public void setOrcamento(int orcamento) {
this.orcamento = orcamento;
}
public int getAno() {
return ano;
}
public void setAno(int ano) {
this.ano = ano;
}
public int getMes() {
return mes;
}
public void setMes(int mes) {
this.mes = mes;
}
public int getDia() {
return dia;
}
public void setDia(int dia) {
this.dia = dia;
}
public long getTotal() {
return total;
}
public void setTotal(long total) {
this.total = total;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
public String getRua() {
return rua;
}
public void setRua(String rua) {
this.rua = rua;
}
public String getBairro() {
return bairro;
}
public void setBairro(String bairro) {
this.bairro = bairro;
}
public String getCidade() {
return cidade;
}
public void setCidade(String cidade) {
this.cidade = cidade;
}
public String getObservacao() {
return observacao;
}
public void setObservacao(String observacao) {
this.observacao = observacao;
}
}
| [
"George Anagnostou"
] | George Anagnostou |
af01ec07a9d6302071249eec38335cfc0c1415e8 | bd699577d8da72c8acc57f886b090b7dfe82d45e | /src/main/java/Lambda_And_Functional_Interfaces/Employee.java | eb0d8935175447cb8ea5066d7622c20403d1fa24 | [] | no_license | saurabhchaturvedy/java8_musings_2021 | 943716712267f5b6cec280e1ed73f379ba2a4571 | 71ff0403f01391c0cf08edf19d635ea8e016b818 | refs/heads/main | 2023-06-23T12:13:19.422142 | 2021-07-20T14:08:58 | 2021-07-20T14:08:58 | 387,482,082 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,318 | java | package main.java;
import java.util.*;
import java.util.stream.Collectors;
class Employee
{
int id;
String name;
int age;
String gender;
String department;
int yearOfJoining;
double salary;
public Employee(int id, String name, int age, String gender, String department, int yearOfJoining, double salary)
{
this.id = id;
this.name = name;
this.age = age;
this.gender = gender;
this.department = department;
this.yearOfJoining = yearOfJoining;
this.salary = salary;
}
public int getId()
{
return id;
}
public String getName()
{
return name;
}
public int getAge()
{
return age;
}
public String getGender()
{
return gender;
}
public String getDepartment()
{
return department;
}
public int getYearOfJoining()
{
return yearOfJoining;
}
public double getSalary()
{
return salary;
}
@Override
public String toString()
{
return "Id : "+id
+", Name : "+name
+", age : "+age
+", Gender : "+gender
+", Department : "+department
+", Year Of Joining : "+yearOfJoining
+", Salary : "+salary;
}
public static void main(String[] args) {
List<Employee> employeeList = new ArrayList<Employee>();
employeeList.add(new Employee(111, "Jiya Brein", 32, "Female", "HR", 2011, 25000.0));
employeeList.add(new Employee(122, "Paul Niksui", 25, "Male", "Sales And Marketing", 2015, 13500.0));
employeeList.add(new Employee(133, "Martin Theron", 29, "Male", "Infrastructure", 2012, 18000.0));
employeeList.add(new Employee(144, "Murali Gowda", 28, "Male", "Product Development", 2014, 32500.0));
employeeList.add(new Employee(155, "Nima Roy", 27, "Female", "HR", 2013, 22700.0));
employeeList.add(new Employee(166, "Iqbal Hussain", 43, "Male", "Security And Transport", 2016, 10500.0));
employeeList.add(new Employee(177, "Manu Sharma", 35, "Male", "Account And Finance", 2010, 27000.0));
employeeList.add(new Employee(188, "Wang Liu", 31, "Male", "Product Development", 2015, 34500.0));
employeeList.add(new Employee(199, "Amelia Zoe", 24, "Female", "Sales And Marketing", 2016, 11500.0));
employeeList.add(new Employee(200, "Jaden Dough", 38, "Male", "Security And Transport", 2015, 11000.5));
employeeList.add(new Employee(211, "Jasna Kaur", 27, "Female", "Infrastructure", 2014, 15700.0));
employeeList.add(new Employee(222, "Nitin Joshi", 25, "Male", "Product Development", 2016, 28200.0));
employeeList.add(new Employee(233, "Jyothi Reddy", 27, "Female", "Account And Finance", 2013, 21300.0));
employeeList.add(new Employee(244, "Nicolus Den", 24, "Male", "Sales And Marketing", 2017, 10700.5));
employeeList.add(new Employee(255, "Ali Baig", 23, "Male", "Infrastructure", 2018, 12700.0));
employeeList.add(new Employee(266, "Sanvi Pandey", 20, "Female", "Product Development", 2015, 28900.0));
employeeList.add(new Employee(277, "Anuj Chettiar", 31, "Male", "Product Development", 2012, 35700.0));
Map<String, Long> collect = employeeList.stream().collect(Collectors.groupingBy(Employee::getGender, Collectors.counting()));
System.out.println(collect);
List<String> collect1 = employeeList.stream().map(Employee::getDepartment).distinct().collect(Collectors.toList());
System.out.println(collect1);
Map<String, Double> collect2 = employeeList.stream().collect(Collectors.groupingBy(Employee::getGender, Collectors.averagingInt(Employee::getAge)));
System.out.println(collect2);
Optional<Employee> collect3 = employeeList.stream().max(Comparator.comparing(Employee::getSalary));
System.out.println(collect3.get());
List<Employee> collect4 = employeeList.stream().filter(employee -> employee.getYearOfJoining() > 2015).collect(Collectors.toList());
System.out.println(collect4);
Map<String, Long> collect5 = employeeList.stream().collect(Collectors.groupingBy(Employee::getDepartment, Collectors.counting()));
System.out.println(collect5);
Map<String, Double> collect6 = employeeList.stream().collect(Collectors.groupingBy(Employee::getDepartment, Collectors.averagingInt(Employee::getAge)));
System.out.println(collect6);
Optional<Employee> min = employeeList.stream().filter(employee -> employee.getDepartment().equals("Product Development")).min(Comparator.comparing(Employee::getAge));
System.out.println(min);
Optional<Employee> first = employeeList.stream().sorted(Comparator.comparingInt(Employee::getYearOfJoining)).findFirst();
System.out.println(first);
Map<String, Long> sales_and_marketing = employeeList.stream().filter(employee -> employee.getDepartment().equals("Sales And Marketing")).collect(Collectors.groupingBy(Employee::getGender, Collectors.counting()));
System.out.println(sales_and_marketing);
Map<String, Double> collect7 = employeeList.stream().collect(Collectors.groupingBy(Employee::getGender, Collectors.averagingDouble(Employee::getSalary)));
System.out.println(collect7);
Map<String, List<Employee>> collect8 = employeeList.stream().collect(Collectors.groupingBy(Employee::getDepartment));
for(Map.Entry<String,List<Employee>> entry : collect8.entrySet())
{
System.out.println(entry.getKey()+" "+collect8.get(entry.getKey()));
}
DoubleSummaryStatistics collect9 = employeeList.stream().collect(Collectors.summarizingDouble(Employee::getSalary));
System.out.println(collect9);
Map<Boolean, List<Employee>> collect10 = employeeList.stream().collect(Collectors.partitioningBy(employee -> employee.getAge() <= 25));
System.out.println(collect10);
Optional<Employee> min1 = employeeList.stream().max(Comparator.comparingInt(Employee::getAge));
System.out.println(min1);
}
}
| [
"[email protected]"
] | |
1dbe3ac501aaf391dda5d144306187fe9154112b | 354ed8b713c775382b1e2c4d91706eeb1671398b | /spring-context/src/main/java/org/springframework/instrument/classloading/package-info.java | a96b965b3cd01eb9d22893df7ab3ed087d44b018 | [] | no_license | JessenPan/spring-framework | 8c7cc66252c2c0e8517774d81a083664e1ad4369 | c0c588454a71f8245ec1d6c12f209f95d3d807ea | refs/heads/master | 2021-06-30T00:54:08.230154 | 2019-10-08T10:20:25 | 2019-10-08T10:20:25 | 91,221,166 | 2 | 0 | null | 2017-05-14T05:01:43 | 2017-05-14T05:01:42 | null | UTF-8 | Java | false | false | 183 | java | /**
* Support package for load time weaving based on class loaders,
* as required by JPA providers (but not JPA-specific).
*/
package org.springframework.instrument.classloading;
| [
"[email protected]"
] | |
1ccb36f16f3bf49f32b0b130dd1c0c9f0fc25d98 | ed3de519d3ef9f8ff0b3602488824b54f3f23fb2 | /src/main/java/com/base/Constants.java | 7f166d1436302125953a159a1a882a7fd5854862 | [] | no_license | mankiran1310/ZeroPersonalBanking | 1a7f900baa5174d3bbc4c73ee702134f431e8bd9 | 284931293bcbd8a48f6e2383dbe09001a71d26fd | refs/heads/master | 2022-07-27T03:53:52.747127 | 2019-12-07T16:28:50 | 2019-12-07T16:28:50 | 226,429,808 | 0 | 0 | null | 2022-06-29T17:49:45 | 2019-12-06T23:50:23 | HTML | UTF-8 | Java | false | false | 232 | java | package com.base;
public class Constants {
//Configurations
public static final String browser = "chrome";
public static final String testUrl= "http://zero.webappsecurity.com";
public static final long implicitwait = 20;
}
| [
"[email protected]"
] | |
cdce91f0a530a49018269185c6b9f20e0c257152 | b1520e2d3daa2848c2905480c2117850864b4895 | /config-client/src/main/java/com/john/sc/configclient/controller/GitController.java | b3ae2be4b3ec72d9f502239d46cf10260d170509 | [] | no_license | John520/sc | b123f1fb0f3ed64567477e3b7d3d463500518e8f | 36cbe383617a2f5e9ed69d2ac9f4d776132da5cb | refs/heads/master | 2020-11-30T01:41:25.722261 | 2020-03-14T08:04:31 | 2020-03-14T08:04:31 | 230,266,220 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 482 | java | package com.john.sc.configclient.controller;
import com.john.sc.configclient.domain.GitConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class GitController {
@Autowired
private GitConfig gitConfig;
@GetMapping(value = "show")
public Object show(){
return gitConfig.toString();
}
} | [
"[email protected]"
] | |
e174fe5b8107bf77c775d9aaa27e97734b4fdaba | 7c82db10fc0d0448460f5cd308465c555967b081 | /tcc/src/main/java/io/mmtx/rm/tcc/remoting/RemotingDesc.java | 2b7dec836ed6b1459874ba8d002282be0a92a520 | [
"Apache-2.0"
] | permissive | qq962155660/mmtx | 0d1dbf24f89180f9dec893459f0a577d04a8551b | b62729f464a97f065cf5c50c8b07026ddec6246a | refs/heads/master | 2022-11-24T06:17:16.308311 | 2020-02-05T02:06:13 | 2020-02-05T02:06:13 | 235,230,686 | 0 | 0 | Apache-2.0 | 2022-11-16T12:26:09 | 2020-01-21T01:19:03 | Java | UTF-8 | Java | false | false | 3,901 | java | /*
* Copyright 1999-2019 Mmtx.io Group.
*
* 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 io.mmtx.rm.tcc.remoting;
/**
* remoting bean info
*
* @author zhangsen
*/
public class RemotingDesc {
/**
* is referenc bean ?
*/
private boolean isReference = false;
/**
* rpc target bean, the service bean has this property
*/
private Object targetBean;
/**
* the tcc interface tyep
*/
private Class<?> interfaceClass;
/**
* interface class name
*/
private String interfaceClassName;
/**
* rpc uniqueId: hsf, dubbo's version, sofa-rpc's uniqueId
*/
private String uniqueId;
/**
* dubbo/hsf 's group
*/
private String group;
/**
* protocol: sofa-rpc, dubbo, injvm etc.
*/
private short protocol;
/**
* Gets target bean.
*
* @return the target bean
*/
public Object getTargetBean() {
return targetBean;
}
/**
* Sets target bean.
*
* @param targetBean the target bean
*/
public void setTargetBean(Object targetBean) {
this.targetBean = targetBean;
}
/**
* Gets interface class.
*
* @return the interface class
*/
public Class<?> getInterfaceClass() {
return interfaceClass;
}
/**
* Sets interface class.
*
* @param interfaceClass the interface class
*/
public void setInterfaceClass(Class<?> interfaceClass) {
this.interfaceClass = interfaceClass;
}
/**
* Gets interface class name.
*
* @return the interface class name
*/
public String getInterfaceClassName() {
return interfaceClassName;
}
/**
* Sets interface class name.
*
* @param interfaceClassName the interface class name
*/
public void setInterfaceClassName(String interfaceClassName) {
this.interfaceClassName = interfaceClassName;
}
/**
* Gets unique id.
*
* @return the unique id
*/
public String getUniqueId() {
return uniqueId;
}
/**
* Sets unique id.
*
* @param uniqueId the unique id
*/
public void setUniqueId(String uniqueId) {
this.uniqueId = uniqueId;
}
/**
* Gets group.
*
* @return the group
*/
public String getGroup() {
return group;
}
/**
* Sets group.
*
* @param group the group
*/
public void setGroup(String group) {
this.group = group;
}
/**
* Gets protocol.
*
* @return the protocol
*/
public short getProtocol() {
return protocol;
}
/**
* Sets protocol.
*
* @param protocol the protocol
*/
public void setProtocol(short protocol) {
this.protocol = protocol;
}
/**
* Is reference boolean.
*
* @return the boolean
*/
public boolean isReference() {
return isReference;
}
/**
* Sets reference.
*
* @param reference the reference
*/
public void setReference(boolean reference) {
isReference = reference;
}
}
| [
"[email protected]"
] | |
dfab2465ad498adc0494ae37130e3ebe34be9caf | 82ba1c0f9d4275a3c4dd9c222aa65356f4965446 | /app/src/test/java/com/keatssalazar/groupchat/ExampleUnitTest.java | ff36179404937f29920203584134761264274bf5 | [] | no_license | sineboi/GroupChat | 4bc4ee29782028eb8c01313d140d5a6f864ba5e4 | 23d6371113f1eeae2d9cf9646d17a437ce8a4111 | refs/heads/master | 2021-01-01T07:41:18.486539 | 2020-02-08T18:03:45 | 2020-02-08T18:03:45 | 239,176,662 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 399 | java | package com.keatssalazar.groupchat;
import org.junit.jupiter.api.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
b9d2e90ab6037cef1448e64195051cafbc09d271 | 695a88266fd3f073a9669f4a5a9ff31feadcc446 | /kodilla-stream/src/test/java/com/kodilla/stream/book/BookTestSuite.java | 245fd13e0e61a025ea9b52be82df3c1586bd083a | [] | no_license | KarolDmowski/Karol-Dmowski-Kodilla-Java | 1acdc66bfd25683444949a5899202d17adf1485b | cd66e5686d2185c2b781458f83c4ea38d1d7cd19 | refs/heads/master | 2021-09-10T02:15:56.658482 | 2018-03-20T17:13:19 | 2018-03-20T17:13:19 | 111,609,106 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,617 | java | package com.kodilla.stream.book;
import org.junit.Assert;
import org.junit.Test;
import java.util.List;
import java.util.stream.IntStream;
public class BookTestSuite {
@Test
public void testGetListUsingFor() {
//Given
BookDirectory bookDirectory = new BookDirectory();
//When
List<Book> books = bookDirectory.getList();
//Then
int numberOfBookPublicatedAfter2007 = 0;
for(Book book : books){
if(book.getYearOfPublication() > 2007) {
numberOfBookPublicatedAfter2007++;
}
}
Assert.assertEquals(3, numberOfBookPublicatedAfter2007);
}
@Test
public void testGetListUsingIntStream(){
//Given
BookDirectory bookDirectory = new BookDirectory();
//When
List<Book> books = bookDirectory.getList();
//Then
int numberOfBooksPiblicatedAfter2007 = IntStream.range(0,books.size())
.filter((n -> books.get(n).getYearOfPublication()>2007))
.map(n -> 1)
.sum();
Assert.assertEquals(3,numberOfBooksPiblicatedAfter2007);
}
@Test
public void testGetListUsingIntStreamUsingLong(){
//Given
BookDirectory bookDirectory = new BookDirectory();
//When
List<Book> books = bookDirectory.getList();
//Then
long numberOfBooksPublicatedAfter2007 = IntStream.range(0,books.size())
.filter(n -> books.get(n).getYearOfPublication()>2007)
.count();
Assert.assertEquals(3,numberOfBooksPublicatedAfter2007);
}
}
| [
"[email protected]"
] | |
bdb8d4b9a270ae2340b43e893be2384c033de92f | 6e25feecfe596bf46ed822a91762ae3dbd6be083 | /project3/libraries/OpenCV-android-sdk/samples/color-blob-detection/src/org/opencv/samples/colorblobdetect/ColorBlobDetectionActivity.java | ca2ac12e43be5e6be48d5856078ab4d70b6f80ac | [
"BSD-3-Clause"
] | permissive | qubick/MAD2015 | f42edb89860ea7332dcc94568172c2e3020b72f3 | 009a752ccb8de897a37d46c93e64d9ee00fa73a5 | refs/heads/master | 2020-05-13T23:33:25.246704 | 2015-12-18T18:35:11 | 2015-12-18T18:35:11 | 41,751,420 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,900 | java | package org.opencv.samples.colorblobdetect;
import java.util.List;
import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.CameraBridgeViewBase.CvCameraViewFrame;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfPoint;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.core.Size;
import org.opencv.android.CameraBridgeViewBase;
import org.opencv.android.CameraBridgeViewBase.CvCameraViewListener2;
import org.opencv.imgproc.Imgproc;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import android.view.SurfaceView;
import android.view.WindowManager;
import android.view.View.OnTouchListener;
public class ColorBlobDetectionActivity extends Activity implements OnTouchListener, CvCameraViewListener2 {
private static final String TAG = "OCVSample::Activity";
private boolean mIsColorSelected = false;
private Mat mRgba;
private Scalar mBlobColorRgba;
private Scalar mBlobColorHsv;
private ColorBlobDetector mDetector;
private Mat mSpectrum;
private Size SPECTRUM_SIZE;
private Scalar CONTOUR_COLOR;
private CameraBridgeViewBase mOpenCvCameraView;
private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
@Override
public void onManagerConnected(int status) {
switch (status) {
case LoaderCallbackInterface.SUCCESS:
{
Log.i(TAG, "OpenCV loaded successfully");
mOpenCvCameraView.enableView();
mOpenCvCameraView.setOnTouchListener(ColorBlobDetectionActivity.this);
} break;
default:
{
super.onManagerConnected(status);
} break;
}
}
};
public ColorBlobDetectionActivity() {
Log.i(TAG, "Instantiated new " + this.getClass());
}
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
Log.i(TAG, "called onCreate");
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
setContentView(R.layout.color_blob_detection_surface_view);
mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.color_blob_detection_activity_surface_view);
mOpenCvCameraView.setCvCameraViewListener(this);
}
@Override
public void onPause()
{
super.onPause();
if (mOpenCvCameraView != null)
mOpenCvCameraView.disableView();
}
@Override
public void onResume()
{
super.onResume();
if (!OpenCVLoader.initDebug()) {
Log.d(TAG, "Internal OpenCV library not found. Using OpenCV Manager for initialization");
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_0_0, this, mLoaderCallback);
} else {
Log.d(TAG, "OpenCV library found inside package. Using it!");
mLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS);
}
}
public void onDestroy() {
super.onDestroy();
if (mOpenCvCameraView != null)
mOpenCvCameraView.disableView();
}
public void onCameraViewStarted(int width, int height) {
mRgba = new Mat(height, width, CvType.CV_8UC4);
mDetector = new ColorBlobDetector();
mSpectrum = new Mat();
mBlobColorRgba = new Scalar(255);
mBlobColorHsv = new Scalar(255);
SPECTRUM_SIZE = new Size(200, 64);
CONTOUR_COLOR = new Scalar(255,0,0,255);
}
public void onCameraViewStopped() {
mRgba.release();
}
public boolean onTouch(View v, MotionEvent event) {
int cols = mRgba.cols();
int rows = mRgba.rows();
int xOffset = (mOpenCvCameraView.getWidth() - cols) / 2;
int yOffset = (mOpenCvCameraView.getHeight() - rows) / 2;
int x = (int)event.getX() - xOffset;
int y = (int)event.getY() - yOffset;
Log.i(TAG, "Touch image coordinates: (" + x + ", " + y + ")");
if ((x < 0) || (y < 0) || (x > cols) || (y > rows)) return false;
Rect touchedRect = new Rect();
touchedRect.x = (x>4) ? x-4 : 0;
touchedRect.y = (y>4) ? y-4 : 0;
touchedRect.width = (x+4 < cols) ? x + 4 - touchedRect.x : cols - touchedRect.x;
touchedRect.height = (y+4 < rows) ? y + 4 - touchedRect.y : rows - touchedRect.y;
Mat touchedRegionRgba = mRgba.submat(touchedRect);
Mat touchedRegionHsv = new Mat();
Imgproc.cvtColor(touchedRegionRgba, touchedRegionHsv, Imgproc.COLOR_RGB2HSV_FULL);
// Calculate average color of touched region
mBlobColorHsv = Core.sumElems(touchedRegionHsv);
int pointCount = touchedRect.width*touchedRect.height;
for (int i = 0; i < mBlobColorHsv.val.length; i++)
mBlobColorHsv.val[i] /= pointCount;
mBlobColorRgba = converScalarHsv2Rgba(mBlobColorHsv);
Log.i(TAG, "Touched rgba color: (" + mBlobColorRgba.val[0] + ", " + mBlobColorRgba.val[1] +
", " + mBlobColorRgba.val[2] + ", " + mBlobColorRgba.val[3] + ")");
mDetector.setHsvColor(mBlobColorHsv);
Imgproc.resize(mDetector.getSpectrum(), mSpectrum, SPECTRUM_SIZE);
mIsColorSelected = true;
touchedRegionRgba.release();
touchedRegionHsv.release();
return false; // don't need subsequent touch events
}
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
mRgba = inputFrame.rgba();
if (mIsColorSelected) {
mDetector.process(mRgba);
List<MatOfPoint> contours = mDetector.getContours();
Log.e(TAG, "Contours count: " + contours.size());
Imgproc.drawContours(mRgba, contours, -1, CONTOUR_COLOR);
Mat colorLabel = mRgba.submat(4, 68, 4, 68);
colorLabel.setTo(mBlobColorRgba);
Mat spectrumLabel = mRgba.submat(4, 4 + mSpectrum.rows(), 70, 70 + mSpectrum.cols());
mSpectrum.copyTo(spectrumLabel);
}
return mRgba;
}
private Scalar converScalarHsv2Rgba(Scalar hsvColor) {
Mat pointMatRgba = new Mat();
Mat pointMatHsv = new Mat(1, 1, CvType.CV_8UC3, hsvColor);
Imgproc.cvtColor(pointMatHsv, pointMatRgba, Imgproc.COLOR_HSV2RGB_FULL, 4);
return new Scalar(pointMatRgba.get(0, 0));
}
}
| [
"[email protected]"
] | |
29f75c403ac8d07fa22c8a3d2f409459d149111c | 9a9e382c86ae676f051c9441a597d017337d3347 | /src/com/example/helloworld/MainActivity.java | ec8deb7a9ce171fa752c89444b7dbe96ff63b7f9 | [] | no_license | jdmellor/helloWorld | 2b5419d83bd4c4bfa0652e1a7ccef7e38f3a58cc | 7a8d58a634fcdbd7b255cc8536135e313496575a | refs/heads/master | 2021-01-10T18:59:33.757509 | 2012-08-27T22:04:30 | 2012-08-27T22:04:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 529 | java | package com.example.helloworld;
import org.apache.cordova.*;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class MainActivity extends DroidGap {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
| [
"[email protected]"
] | |
4263ba7bcea987253acd7cb62738cd88fd24ab9b | 63c0ce2d0e1c090ecf3fe5d289596dadc0ef3b85 | /s20GridLayoutDemo/app/src/test/java/kr/android/s20gridlayoutdemo/ExampleUnitTest.java | db61041bc0fa3167d2001c0cd242617b4a3af3ff | [] | no_license | JR-A/android-tutorials | aa5388c926c900ba66c023fee48b189fc0f6632e | 476c397dae53630c43810fd1b1b10bc442e9625a | refs/heads/main | 2023-01-10T20:33:48.746223 | 2020-11-18T03:07:05 | 2020-11-18T03:07:05 | 312,159,712 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 389 | java | package kr.android.s20gridlayoutdemo;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
d97fe84bcd496a47cdbc529b466ca79048031c4a | 49f5bc67772197af09beb1a0b151c917825e4924 | /src/main/java/com/cc/common/utils/ArrayUtil.java | 37556e47ff4c1f945d7865e99dd0c26949344103 | [] | no_license | wangchuan98/springboot-api | c246158720adff3f3e88a14e15a235bbd02d000f | 3150208d23df867e865583cce7e23ff4d3d7adf6 | refs/heads/master | 2022-06-25T10:15:24.865369 | 2020-02-27T07:11:09 | 2020-02-27T07:11:09 | 235,104,755 | 0 | 0 | null | 2022-06-17T02:50:39 | 2020-01-20T13:12:44 | CSS | UTF-8 | Java | false | false | 457 | java | package com.cc.common.utils;
/**
* @program: springboot-api
* @description: 一个数组的工具类
* @author: wangchuan
* @create: 2019-12-25
*/
public class ArrayUtil {
public static Boolean contain(String[] agrs,String str){
Boolean flag=false;
if(agrs==null||str==null)
return flag;
for(String item:agrs) {
if(item.equals(str))
flag=true;
}
return flag;
}
}
| [
"[email protected]"
] | |
dd4d81833c55d363294ef0267d3ef51a4773322a | 7f84966b904c89fffe7b452a5bbe9d96ac16360c | /src/ru/billing/client/CatalogStubLoader.java | 755d3b173ef8de0536d05c8dffaf654af1b4ff4b | [] | no_license | chinarev/lab2BaseProg | 42cbb4e8efc7c1885208f8dc4c275be838013651 | a49ae366cb342451453fe9af7c5188fb5d043f42 | refs/heads/master | 2021-02-11T00:31:10.543829 | 2020-04-16T23:04:39 | 2020-04-16T23:04:39 | 244,433,842 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 938 | java | package ru.billing.client;
import ru.billing.exceptions.CatalogLoadException;
import ru.billing.exceptions.ItemAlreadyExistsException;
import ru.billing.stocklist.Category;
import ru.billing.stocklist.FoodItem;
import ru.billing.stocklist.GenericItem;
import ru.billing.stocklist.ItemCatalog;
import javax.xml.catalog.CatalogException;
import java.util.Date;
public class CatalogStubLoader implements CatalogLoader {
public void load(ItemCatalog itemCatalog) throws CatalogLoadException {
GenericItem item1 = new GenericItem("Sony TV&", 23000, Category.GENERAL);
FoodItem item2 = new FoodItem("Bread", 12, null, new Date(), (short) 10);
try {
itemCatalog.addItem(item1);
itemCatalog.addItem(item2);
} catch (ItemAlreadyExistsException e) { // TODO Auto-generated catch block
e.printStackTrace();
throw new CatalogLoadException(e);
}
}
}
| [
"[email protected]"
] | |
5bd1a8c547bf27793c0d9ab9bb5f406bab2b7c49 | b4280c4821707d7424b12d0bfca963f14570981f | /Programmers/src/Level2/가장큰수.java | b7e2eeac045f6eb3f615d50242cc6c4f02f9cb55 | [] | no_license | dahui3765/algorithm | 61032ee307cd9276b7d6971d194d38aac672cd25 | e2a14fd48e94241c3649f538cd15c6ad2a1741c2 | refs/heads/main | 2023-07-13T02:51:37.371591 | 2021-08-15T11:40:36 | 2021-08-15T11:40:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,044 | java | package Level2;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class 가장큰수 {
public static void main(String[] args) {
int [] numbers = {3, 30, 34, 5, 9};
solution(numbers);
}
public static String solution(int[] numbers) {
String answer = "";
String arr[] = new String[numbers.length];
for (int i = 0; i < numbers.length; i++) {
arr[i] = Integer.toString(numbers[i]);
}
Arrays.sort(arr, new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
String s1 = o1+o2;
String s2 = o2+o1;
return Integer.parseInt(s2) - Integer.parseInt(s1);
}
});
StringBuilder sb = new StringBuilder();
for (int i = 0; i < arr.length; i++) {
sb.append(arr[i]);
}
answer = sb.toString();
if(answer.charAt(0) == '0')
return "0";
System.out.println(answer);
return answer;
}
}
| [
"[email protected]"
] | |
955fa898c53e4f91f25e88f69f55a8bc60346eb8 | c9be9f5abba5ef121fe27a3969a47fba7ddbf275 | /app/src/main/java/com/android/trungnh2/musicplayeruidesign/MainActivity.java | 32688f512899147524f493ed13b286efa2431ce1 | [] | no_license | espresso995/music-player-ui-design | e684994f50a6e8dd031baecaaa646f041df417ac | a71a6a4b4f0cf3d7b5dfb5a574c4373f212a5463 | refs/heads/master | 2023-02-20T01:48:47.127399 | 2021-01-22T03:34:44 | 2021-01-22T03:34:44 | 331,592,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 715 | java | package com.android.trungnh2.musicplayeruidesign;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import com.makeramen.roundedimageview.RoundedImageView;
public class MainActivity extends AppCompatActivity {
RoundedImageView imageAlbum;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
imageAlbum = findViewById(R.id.imageAlbum);
Animation animation = AnimationUtils.loadAnimation(this, R.anim.rotate_anim);
imageAlbum.setAnimation(animation);
}
}
| [
"[email protected]"
] | |
7eb0a7d70f7c7eb5bc3d9939755e75f696828485 | 716e011ebc5751b87ba309c2eb30d70fd059125f | /app/src/main/java/com/example/djamel/salate/login.java | b7893e40b1d8aa8566c819f063ca75baaa727039 | [] | no_license | djamelzerrouki/Hay-Ala-Al-SALAT-App-Android-and-server-node-js | 28cba4434581e3e63e49a64d5dbffb8e3e005587 | c85f7019834daacdb1c0df2cf98318ba020c5064 | refs/heads/master | 2021-07-23T08:22:59.486401 | 2020-05-05T05:18:37 | 2020-05-05T05:18:37 | 160,763,731 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 356 | java | package com.example.djamel.salate;
/**
* Created by djamel on 26/12/2017.
*/
public class login {
public static String id;
public static String username;
public static String pasword;
public login(String id, String username, String pasword ) {
this.id=id;
this.username=username;
this.pasword=pasword;
}
}
| [
"[email protected]"
] | |
430c05afdef3e76df542403707e0a2b9d9130124 | c3f696f5eb33ccd9645e0634be654a0c2a537607 | /app/src/main/java/com/example/beatmaster/PlayerActivity.java | 4a961eb3ebc566874bb11870b607485a27c88665 | [] | no_license | AdityaKanikdaley/Beat_Master | 6c7961f9b950487c590924326ab932147e7d767e | 9da5e2dc06e0b4c24c844bfc9dc9d93911c2f7f1 | refs/heads/master | 2023-01-08T07:37:51.872489 | 2020-11-11T17:05:18 | 2020-11-11T17:05:18 | 292,601,306 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,340 | java | package com.example.beatmaster;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.media.MediaMetadataRetriever;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.ArrayList;
import static com.example.beatmaster.MainActivity.musicFiles;
public class PlayerActivity extends AppCompatActivity {
TextView song_name, artist_name, duration_played, duration_total;
ImageView cover_art, nextBtn, prevBtn, backBtn, shuffleBtn, repeatBtn;
FloatingActionButton playPauseBtn;
SeekBar seekBar;
int position = -1;
static ArrayList<MusicFiles> listSongs = new ArrayList<>();
static Uri uri;
static MediaPlayer mediaPlayer;
private Handler handler = new Handler();
private Thread playThread, prevThread, nextThread;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_player);
initViews();
getIntentMethod();
song_name.setText(listSongs.get(position).getTitle());
artist_name.setText(listSongs.get(position).getArtist());
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if(mediaPlayer != null && fromUser)
{
mediaPlayer.seekTo(progress * 1000);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
PlayerActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
if(mediaPlayer != null)
{
int mCurrentPosition = mediaPlayer.getCurrentPosition() / 1000;
seekBar.setProgress(mCurrentPosition);
duration_played.setText(formattedTime(mCurrentPosition));
}
handler.postDelayed(this, 1000);
}
});
}
@Override
protected void onPostResume() {
playThreadBtn();
nextThreadBtn();
prevThreadBtn();
super.onPostResume();
}
private void prevThreadBtn() {
prevThread = new Thread()
{
@Override
public void run() {
super.run();
prevBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
prevBtnClicked();
}
});
}
};
prevThread.start();
}
private void prevBtnClicked() {
if(mediaPlayer.isPlaying())
{
mediaPlayer.start();
mediaPlayer.release();
position = ((position - 1) < 0 ? (listSongs.size() - 1) : (position - 1));
uri = Uri.parse(listSongs.get(position).getPath());
mediaPlayer = MediaPlayer.create(getApplicationContext(),uri);
metaData(uri);
song_name.setText(listSongs.get(position).getTitle());
artist_name.setText(listSongs.get(position).getArtist());
seekBar.setMax(mediaPlayer.getDuration() / 1000);
PlayerActivity.this.runOnUiThread(new Runnable() {
public void run() {
if(mediaPlayer != null)
{
int mCurrentPosition = mediaPlayer.getCurrentPosition() / 1000;
seekBar.setProgress(mCurrentPosition);
}
handler.postDelayed(this, 1000);
}
});
playPauseBtn.setImageResource(R.drawable.ic_pause);
mediaPlayer.start();
}
else
{
mediaPlayer.start();
mediaPlayer.release();
position = ((position - 1) < 0 ? (listSongs.size() - 1) : (position - 1));
uri = Uri.parse(listSongs.get(position).getPath());
mediaPlayer = MediaPlayer.create(getApplicationContext(),uri);
metaData(uri);
song_name.setText(listSongs.get(position).getTitle());
artist_name.setText(listSongs.get(position).getArtist());
seekBar.setMax(mediaPlayer.getDuration() / 1000);
PlayerActivity.this.runOnUiThread(new Runnable() {
public void run() {
if(mediaPlayer != null)
{
int mCurrentPosition = mediaPlayer.getCurrentPosition() / 1000;
seekBar.setProgress(mCurrentPosition);
}
handler.postDelayed(this, 1000);
}
});
playPauseBtn.setImageResource(R.drawable.ic_play);
}
}
private void nextThreadBtn() {
nextThread = new Thread()
{
@Override
public void run() {
super.run();
nextBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
nextBtnClicked();
}
});
}
};
nextThread.start();
}
private void nextBtnClicked() {
if(mediaPlayer.isPlaying())
{
mediaPlayer.start();
mediaPlayer.release();
position = ((position + 1) % listSongs.size());
uri = Uri.parse(listSongs.get(position).getPath());
mediaPlayer = MediaPlayer.create(getApplicationContext(),uri);
metaData(uri);
song_name.setText(listSongs.get(position).getTitle());
artist_name.setText(listSongs.get(position).getArtist());
seekBar.setMax(mediaPlayer.getDuration() / 1000);
PlayerActivity.this.runOnUiThread(new Runnable() {
public void run() {
if(mediaPlayer != null)
{
int mCurrentPosition = mediaPlayer.getCurrentPosition() / 1000;
seekBar.setProgress(mCurrentPosition);
}
handler.postDelayed(this, 1000);
}
});
playPauseBtn.setImageResource(R.drawable.ic_pause);
mediaPlayer.start();
}
else
{
mediaPlayer.start();
mediaPlayer.release();
position = ((position + 1) % listSongs.size());
uri = Uri.parse(listSongs.get(position).getPath());
mediaPlayer = MediaPlayer.create(getApplicationContext(),uri);
metaData(uri);
song_name.setText(listSongs.get(position).getTitle());
artist_name.setText(listSongs.get(position).getArtist());
seekBar.setMax(mediaPlayer.getDuration() / 1000);
PlayerActivity.this.runOnUiThread(new Runnable() {
public void run() {
if(mediaPlayer != null)
{
int mCurrentPosition = mediaPlayer.getCurrentPosition() / 1000;
seekBar.setProgress(mCurrentPosition);
}
handler.postDelayed(this, 1000);
}
});
playPauseBtn.setImageResource(R.drawable.ic_play);
}
}
private void playThreadBtn() {
playThread = new Thread()
{
@Override
public void run() {
super.run();
playPauseBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
playPauseBtnClicked();
}
});
}
};
playThread.start();
}
private void playPauseBtnClicked() {
if(mediaPlayer.isPlaying())
{
playPauseBtn.setImageResource(R.drawable.ic_play);
mediaPlayer.pause();
seekBar.setMax(mediaPlayer.getDuration() / 1000);
PlayerActivity.this.runOnUiThread(new Runnable() {
public void run() {
if(mediaPlayer != null)
{
int mCurrentPosition = mediaPlayer.getCurrentPosition() / 1000;
seekBar.setProgress(mCurrentPosition);
}
handler.postDelayed(this, 1000);
}
});
}
else
{
playPauseBtn.setImageResource(R.drawable.ic_pause);
mediaPlayer.start();
seekBar.setMax(mediaPlayer.getDuration() / 1000);
PlayerActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
if(mediaPlayer != null)
{
int mCurrentPosition = mediaPlayer.getCurrentPosition() / 1000;
seekBar.setProgress(mCurrentPosition);
}
handler.postDelayed(this, 1000);
}
});
}
}
private String formattedTime(int mCurrentPosition) {
String totalout = "";
String totalNew = "";
String seconds = String.valueOf(mCurrentPosition % 60);
String minutes = String.valueOf(mCurrentPosition / 60);
totalout = minutes + ":" + seconds;
totalNew = minutes + ":" + "0" + seconds;
if(seconds.length() == 1)
{
return totalNew;
}
else
{
return totalout;
}
}
private void getIntentMethod() {
position = getIntent().getIntExtra("position", -1);
listSongs = musicFiles;
if(listSongs != null)
{
playPauseBtn.setImageResource(R.drawable.ic_pause);
uri = Uri.parse(listSongs.get(position).getPath());
}
if(mediaPlayer != null)
{
mediaPlayer.start();
mediaPlayer.release();
mediaPlayer = MediaPlayer.create(getApplicationContext(), uri);
mediaPlayer.start();
}
else
{
mediaPlayer = MediaPlayer.create(getApplicationContext(), uri);
mediaPlayer .start();
}
seekBar.setMax(mediaPlayer.getDuration() / 1000);
metaData(uri);
}
private void initViews() {
song_name = findViewById(R.id.song_name);
artist_name = findViewById(R.id.song_artist);
duration_played = findViewById(R.id.durationPlayed);
duration_total = findViewById(R.id.durationTotal);
cover_art = findViewById(R.id.cover_art);
nextBtn = findViewById(R.id.id_next);
prevBtn = findViewById(R.id.id_prev);
backBtn = findViewById(R.id.back_btn);
shuffleBtn = findViewById(R.id.id_shuffle);
repeatBtn = findViewById(R.id.id_repeat);
playPauseBtn = findViewById(R.id.play_pause);
seekBar = findViewById(R.id.seekbar);
}
private void metaData(Uri uri)
{
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
retriever.setDataSource(uri.toString());
int durationTotal = Integer.parseInt(listSongs.get(position).getDuration()) / 1000;
duration_total.setText(formattedTime(durationTotal));
byte[] art = retriever.getEmbeddedPicture();
if(art != null)
{
Glide.with(this)
.asBitmap()
.load(art)
.into(cover_art);
}
else
{
Glide.with(this)
.asBitmap()
.load(R.drawable.bewedoc)
.into(cover_art);
}
}
} | [
"[email protected]"
] | |
241f7b8554dd2097d5fb74da74d58e7a5e339a26 | 9b830f20e4a0c45942a4d732a759363f9c9a9271 | /Introduction/Project 2/Agriculture Drone/com/dronerecon/ws/PortalDBService.java | d75aa843a9d9d1359d3edc0dc5d65a69688a8751 | [] | no_license | jnguyen326/IntermediateJavaSP2019 | 04e3a6ec20f75bec2a5f7e6dd23d97c01c1ab7f8 | 451c96aee5f073eae5e1aec182009943294adbe6 | refs/heads/master | 2022-12-10T18:50:56.018168 | 2019-05-22T03:12:22 | 2019-05-22T03:12:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,858 | java | package com.dronerecon.ws;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class PortalDBService extends HttpServlet{
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("application/json;charset=utf-8");
response.addHeader("Access-Control-Allow-Origin", "*");
PrintWriter out = response.getWriter();
// ############
// Get 5 parameter values from the request object (these are passed in from part 1 code).
// "area_id" : String type
// "tilex" : int type (Reference part 1 of Project 2 for converting string to int).
// "tiley"
// "r"
// "g"
String sAreaid = request.getParameter("area_id");
int iTileX = Integer.parseInt(request.getParameter("tilex"));
int iTileY = Integer.parseInt(request.getParameter("tiley"));
int r = Integer.parseInt(request.getParameter("r"));
int g = Integer.parseInt(request.getParameter("g"));
// ############
// ############
// Instantiate a DBManager instance.
DBManager oDBManager = new DBManager();
// ############
// Set DB location (Currently uses current DB file name and adds direct path from C drive before it).
oDBManager.DBLocation = System.getProperty("catalina.base") + "\\webapps\\dronereconportal\\db\\" +
oDBManager.DBLocation;
// ############
// Call insertAreaGridTile on db manager object and pass the 5 values from above.
oDBManager.insertAreaGridTile(sAreaid,iTileX,iTileY,r,g);
// ############
// Response with confirmation of DB record written.
out.println("{\"success\":true}");
}
}
| [
"[email protected]"
] | |
3a39178a7f42ace01371f992e4c2e5e40e3a689f | cc793d96dd091a179a994908a5a77d281fc86cfb | /FileRulerWithDesign/src/fileruler/view/ImageViewCustom.java | c4c416f3665cedf7a232ce403383579281849acb | [] | no_license | VictorVangelov/FileRuler | c7c5bb116a623b38d2027f6ea9c7c5ef1fd795c1 | 01e178ad7b3161f916b7f4e8badf01600adb4537 | refs/heads/master | 2020-05-29T11:53:15.431263 | 2015-06-01T14:50:43 | 2015-06-01T14:50:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 372 | java | package fileruler.view;
import javafx.scene.image.ImageView;
public class ImageViewCustom<T> extends ImageView {
private T source;
public ImageViewCustom(T source) {
this.source = source;
}
public T getMovieSource(){
return this.source;
}
public void setMovieSource(T source){
this.source = source;
}
}
| [
"[email protected]"
] | |
faf67425aff9b106ce8eca507c4c6cf90059235f | c72acaabb03bfbf4b6f44fd89a71a9dcf52871a6 | /app/src/test/java/com/monami/mrc/box8category/ExampleUnitTest.java | 385efd655a54f8a2d8213629bc5ca8691a24f50b | [] | no_license | monami-roychowdhury/Category | b1edfc2a8c54364403827d2ad24e71012118977d | cc4262005c215d5b7fb3b6bf396df91d3764632c | refs/heads/master | 2020-03-10T19:54:31.517159 | 2018-04-15T14:37:13 | 2018-04-15T14:37:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 388 | java | package com.monami.mrc.box8category;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
a8f27885d208821df1ea50915ca02d3f386fb962 | 3a3d75adef890aea8f601914c74d81c358c5864b | /WeatherBureau.java | 49b286988c93e985705e5eba67b8d82e48ec5d94 | [] | no_license | musaab98/rainfall-analyzer | 599dffbb33fabd398273d3eb7010a3446c95c30d | 984514f8e05893fb666590ca326217084bbe644e | refs/heads/master | 2021-03-21T12:05:42.009753 | 2020-03-14T14:27:19 | 2020-03-14T14:27:19 | 247,291,295 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,969 | java | // Virginia Tech Honor Code Pledge:
//
// As a Hokie, I will conduct myself with honor and integrity at all times.
// I will not lie, cheat, or steal, nor will I accept the actions of those
// who do.
// -- Musaab Elsheikh (melsheikh)
import java.util.*;
//-------------------------------------------------------------------------
/**
* Weather Bureau class that manages weather station data
*
* @author Musaab Elsheikh (melsheikh)
* @version (2019.12.09)
*/
public class WeatherBureau
{
//~ Fields ................................................................
private HashMap<String, WeatherStation> weatherMap;
//~ Constructor ...........................................................
// ----------------------------------------------------------
/**
* Creates a new WeatherBureau object.
*/
public WeatherBureau()
{
weatherMap = new HashMap<String, WeatherStation>();
}
//~ Methods ...............................................................
// ----------------------------------------------------------
/**
* Records the rainfall from a string of text
* @param text given text w/ rainfall
*/
public void recordDailySummary(String text)
{
Scanner scanner = new Scanner(text);
String iD = scanner.next();
if (!weatherMap.containsKey(iD))
{
weatherMap.put(iD, new WeatherStation(iD));
}
WeatherStation station = weatherMap.get(iD);
String word = "";
scanner.next();
scanner.next();
scanner.next();
word = scanner.next();
int day = word.indexOf("/");
String month = word.substring(0, day);
double rainfall = Double.parseDouble(scanner.next());
int monthInt = Integer.parseInt(month);
if (rainfall != -1.0)
{
station.recordDailyRain(monthInt, rainfall);
}
}
/**
* Records daily summaries for weather stations
* @param input from data source
*/
public void recordDailySummaries(Scanner input)
{
while (input.hasNextLine())
{
String line = input.nextLine();
recordDailySummary(line);
}
}
/**
* Weather station getter
* @param iD the station's identification
* @return the weather station object
*/
public WeatherStation getStation(String iD)
{
return weatherMap.get(iD);
}
/**
* Gets weather station with lowest average rainfall for month
* @param month given month of rain
* @return station with the least rainfall
*/
public WeatherStation lowestStation(int month)
{
WeatherStation station = null;
double min = 999999.9;
for (WeatherStation values : weatherMap.values())
{
double average = values.getAvgForMonth(month);
if (average != -1 && average < min)
{
min = average;
station = values;
}
}
return station;
}
/**
* Gets weather station with lowest average rainfall in ANY month
* @return station with the least rainfall
*/
public WeatherStation lowestStation()
{
WeatherStation station = null;
double min = 999999.0;
double avg = 0.0;
for (String keys : weatherMap.keySet())
{
WeatherStation s = weatherMap.get(keys);
avg = s.getAvgForMonth(s.getLowestMonth());
if (station == null) {
station = s;
min = station.getAvgForMonth(station.getLowestMonth());
}
else if (avg < min)
{
station = s;
min = s.getAvgForMonth(station.getLowestMonth());
}
}
return station;
}
}
| [
"[email protected]"
] | |
2b10f6f1ccdd899d61ae8397e90839e8563d2870 | d78ba692d6ef3dd93e004eed6ae9ae46ea23e4b8 | /nifi-registry-core/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/extension/component/manifest/Restricted.java | 82ab09de15ac42d7fd29073894aed5230410a54b | [
"Apache-2.0",
"MIT"
] | permissive | apache/nifi-registry | bf3c36321f258d2e5dd18809201bc8c1230c1c25 | ab9975139a87763fa1a66ce0d9e54ed445c03fcf | refs/heads/main | 2023-07-02T21:15:32.036942 | 2021-07-15T19:48:17 | 2021-07-15T19:48:17 | 81,920,458 | 106 | 122 | Apache-2.0 | 2021-07-15T19:48:18 | 2017-02-14T08:00:07 | Java | UTF-8 | Java | false | false | 2,109 | 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.nifi.registry.extension.component.manifest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.Valid;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import java.util.List;
@ApiModel
@XmlAccessorType(XmlAccessType.FIELD)
public class Restricted {
private String generalRestrictionExplanation;
@Valid
@XmlElementWrapper
@XmlElement(name = "restriction")
private List<Restriction> restrictions;
@ApiModelProperty(value = "The general restriction for the extension, or null if only specific restrictions exist")
public String getGeneralRestrictionExplanation() {
return generalRestrictionExplanation;
}
public void setGeneralRestrictionExplanation(String generalRestrictionExplanation) {
this.generalRestrictionExplanation = generalRestrictionExplanation;
}
@ApiModelProperty(value = "The specific restrictions")
public List<Restriction> getRestrictions() {
return restrictions;
}
public void setRestrictions(List<Restriction> restrictions) {
this.restrictions = restrictions;
}
}
| [
"[email protected]"
] | |
93004102448063957f604e7f57bdf63cb50f71e1 | 6f9a534c8e1b46f300be6bdeec99b0b0ed5236b0 | /dfgx/sceneTask/src/main/java/com/bonc/common/thread/ThreadPoolManage.java | c09292628e091946f5d7590989a17d76aec05f2e | [] | no_license | snailshen2014/career | 4ffd7e30fdc2e4ae74b990e679ac3f1c2998d588 | c5f08e0f007d23b13150ef18e999a39f87e64b17 | refs/heads/master | 2020-04-10T12:15:58.280308 | 2018-12-09T09:32:16 | 2018-12-09T09:32:16 | 161,016,843 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,773 | java | package com.bonc.common.thread;
/*
* 线程管理类
* @author:曾定勇
*/
import java.lang.Thread;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
//import com.dave.jfs.core.base.SysGlobal;
public class ThreadPoolManage {
private final static Logger log= LoggerFactory.getLogger(ThreadPoolManage.class);
ThreadBaseFunction ThreadBaseFunctionIns = null;
int iThreadNum = 5;
boolean bNodataQuitFlag = true;
public ThreadPoolManage(ThreadBaseFunction func){
if(func == null) return ;
this.ThreadBaseFunctionIns = func;
}
public ThreadPoolManage(int threadNum,ThreadBaseFunction func){
if(func == null) return ;
if(threadNum <= 0 || threadNum >50) iThreadNum = 5;
else this.iThreadNum = threadNum;
this.ThreadBaseFunctionIns = func;
}
public ThreadPoolManage(int threadNum,ThreadBaseFunction func,boolean bNodataQuit){
if(func == null) return ;
if(threadNum <= 0 || threadNum >50) iThreadNum = 25;
else this.iThreadNum = threadNum;
this.ThreadBaseFunctionIns = func;
this.bNodataQuitFlag = bNodataQuit;
}
public void start(){
log.info(" --- 线程任务执行开始 ---");
ThreadBaseFunctionIns.begin();
//创建一个可重用固定线程数的线程池
ExecutorService pool = Executors.newFixedThreadPool(iThreadNum);
for(int i=0;i < iThreadNum;++i){
//log.debug("--- create thread :{}",i);
Thread ThreadIns = new PoolThread(ThreadBaseFunctionIns,bNodataQuitFlag);
pool.execute(ThreadIns);
}
//关闭线程池
pool.shutdown();
try{
//pool.awaitTermination(3600, TimeUnit.SECONDS); // --- 等待1小时---
pool.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS);
ThreadBaseFunctionIns.end();
}catch(Exception e){
log.error(e.toString());
}
log.info(" --- 线程任务执行结束 ---");
}
/*
* 网上参考代码
* void shutdownAndAwaitTermination(ExecutorService pool) {
pool.shutdown(); // Disable new tasks from being submitted
try {
// Wait a while for existing tasks to terminate
if (!pool.awaitTermination(60, TimeUnit.SECONDS)) {
pool.shutdownNow(); // Cancel currently executing tasks
// Wait a while for tasks to respond to being cancelled
if (!pool.awaitTermination(60, TimeUnit.SECONDS))
System.err.println("Pool did not terminate");
}
} catch (InterruptedException ie) {
// (Re-)Cancel if current thread also interrupted
pool.shutdownNow();
// Preserve interrupt status
Thread.currentThread().interrupt();
}
}
*/
}
| [
"[email protected]"
] | |
f4c9a3f9a1d972eedcbda8152da954d4a13b9541 | 14da20bf0e7da4eaab5f89da1911f9eb24b5c7ce | /src/test/java/org/curious/felidae/AppTest.java | e855ba06698b9a397aa8b91af08542bba72cfc6e | [] | no_license | jarl-haggerty/felidae | 2b42f245789da7150aaa22a836e0bf3c11c2f7e4 | f416ca736aa2b0f7d7d41d1d60d7e7ad904edab6 | refs/heads/master | 2021-01-20T00:40:18.082844 | 2011-03-17T19:12:25 | 2011-03-17T19:12:25 | 1,163,948 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 647 | java | package org.curious.felidae;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}
| [
"[email protected]"
] | |
36947b7ac99c309ad9df20862c8027224a2a466e | 5807d83ec7d9517e423d6a763bb62e169e1fc8dd | /app/src/main/java/com/example/petagram/MainActivity.java | 240c41adc077f1259b59c2fe30429f03fdb3866a | [] | no_license | pedrofranciscofranco/Petagram | aa2adb70868121c2cd8b2648a4db4db36a4aba10 | a3fc1261c0c5010759c498e29e6a6c3a12346162 | refs/heads/master | 2022-12-19T18:21:57.657214 | 2020-10-04T05:36:22 | 2020-10-04T05:36:22 | 298,216,212 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,198 | java | package com.example.petagram;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager;
import androidx.viewpager2.widget.ViewPager2;
import android.content.ClipData;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.tabs.TabLayout;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
private MaterialToolbar toolbar;
private TabLayout tabLayout;
static ViewPager viewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
toolbar = findViewById(R.id.toolbar);
tabLayout = findViewById(R.id.tablayout);
viewPager = findViewById(R.id.viewpager);
setUpViewPager();
/*
petagram = findViewById(R.id.rvAnimalitos);
LinearLayoutManager llm = new LinearLayoutManager(this);
llm.setOrientation(RecyclerView.VERTICAL);
petagram.setLayoutManager(llm);
cargardatos();
inicializaradaptador();
*/
if (toolbar!=null){
setSupportActionBar(toolbar);
}
}
/*
public void clik (View view) {
Toast.makeText(this, "like", Toast.LENGTH_SHORT).show();
}
*/
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.action_favorite:
Intent afavoritos = new Intent(this, favoritos5.class);
startActivity(afavoritos);
return true;
case R.id.menu_Contacto:
Intent aContacto = new Intent(this, Contacto.class);
startActivity(aContacto);
return true;
case R.id.menu_Acercade:
Intent aAcercade = new Intent(this, bio.class);
startActivity(aAcercade);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
private ArrayList<Fragment> agregarfragmetn(){
ArrayList<Fragment> fragments = new ArrayList<>();
fragments.add(new fragmentrecycler());
fragments.add(new PerfilMascota());
return fragments;
}
private void setUpViewPager(){
viewPager.setAdapter(new PageAdapter(getSupportFragmentManager(), agregarfragmetn()));
tabLayout.setupWithViewPager(viewPager);
tabLayout.getTabAt(0).setIcon(R.drawable.iconhouse);
tabLayout.getTabAt(1).setIcon(R.drawable.iconpet);
}
}
| [
"[email protected]"
] | |
8fd80932c5898c6fedc10502e9a66197f9204764 | c84cdbb4b1adfa86a37cd3c85dde4a3a45448760 | /ksearch-web-utils/src/main/java/com/youqianhuan/ksearch/util/util/ClassHelper.java | 2881f1549e0db4a3c843f768e315c1d202d329c6 | [] | no_license | chenghuanhuan/ksearch-web | d811d87f7c1b97610246b896a3011bc5dac7b062 | 183056ad86c609ded16bb97863f8cd510cb3bf8c | refs/heads/master | 2021-01-01T04:36:32.661447 | 2018-03-01T08:49:13 | 2018-03-01T08:49:13 | 120,998,247 | 1 | 0 | null | 2018-02-10T09:12:11 | 2018-02-10T08:27:21 | null | UTF-8 | Java | false | false | 7,621 | java | /**
* kaike.la Inc.
* Copyright (c) 2014-2016 All Rights Reserved.
*/
package com.youqianhuan.ksearch.util.util;
import java.lang.reflect.Array;
import java.util.*;
/**
* @author [email protected]
* @since $Revision:1.0.0, $Date: 2018年01月12日 下午7:29 $
*/
public class ClassHelper {
public static Class<?> forNameWithThreadContextClassLoader(String name)
throws ClassNotFoundException {
return forName(name, Thread.currentThread().getContextClassLoader());
}
public static Class<?> forNameWithCallerClassLoader(String name, Class<?> caller)
throws ClassNotFoundException {
return forName(name, caller.getClassLoader());
}
public static ClassLoader getCallerClassLoader(Class<?> caller) {
return caller.getClassLoader();
}
/**
* get class loader
*
* @param cls
* @return class loader
*/
public static ClassLoader getClassLoader(Class<?> cls) {
ClassLoader cl = null;
try {
cl = Thread.currentThread().getContextClassLoader();
} catch (Throwable ex) {
// Cannot access thread context ClassLoader - falling back to system class loader...
}
if (cl == null) {
// No thread context class loader -> use class loader of this class.
cl = cls.getClassLoader();
}
return cl;
}
/**
* Return the default ClassLoader to use: typically the thread context
* ClassLoader, if available; the ClassLoader that loaded the ClassUtils
* class will be used as fallback.
* <p>
* Call this method if you intend to use the thread context ClassLoader in a
* scenario where you absolutely need a non-null ClassLoader reference: for
* example, for class path resource loading (but not necessarily for
* <code>Class.forName</code>, which accepts a <code>null</code> ClassLoader
* reference as well).
*
* @return the default ClassLoader (never <code>null</code>)
* @see java.lang.Thread#getContextClassLoader()
*/
public static ClassLoader getClassLoader() {
return getClassLoader(ClassHelper.class);
}
/**
* Same as <code>Class.forName()</code>, except that it works for primitive
* types.
*/
public static Class<?> forName(String name) throws ClassNotFoundException {
return forName(name, getClassLoader());
}
/**
* Replacement for <code>Class.forName()</code> that also returns Class
* instances for primitives (like "int") and array class names (like
* "String[]").
*
* @param name the name of the Class
* @param classLoader the class loader to use (may be <code>null</code>,
* which indicates the default class loader)
* @return Class instance for the supplied name
* @throws ClassNotFoundException if the class was not found
* @throws LinkageError if the class file could not be loaded
* @see Class#forName(String, boolean, ClassLoader)
*/
public static Class<?> forName(String name, ClassLoader classLoader)
throws ClassNotFoundException, LinkageError {
Class<?> clazz = resolvePrimitiveClassName(name);
if (clazz != null) {
return clazz;
}
// "java.lang.String[]" style arrays
if (name.endsWith(ARRAY_SUFFIX)) {
String elementClassName = name.substring(0, name.length() - ARRAY_SUFFIX.length());
Class<?> elementClass = forName(elementClassName, classLoader);
return Array.newInstance(elementClass, 0).getClass();
}
// "[Ljava.lang.String;" style arrays
int internalArrayMarker = name.indexOf(INTERNAL_ARRAY_PREFIX);
if (internalArrayMarker != -1 && name.endsWith(";")) {
String elementClassName = null;
if (internalArrayMarker == 0) {
elementClassName = name
.substring(INTERNAL_ARRAY_PREFIX.length(), name.length() - 1);
} else if (name.startsWith("[")) {
elementClassName = name.substring(1);
}
Class<?> elementClass = forName(elementClassName, classLoader);
return Array.newInstance(elementClass, 0).getClass();
}
ClassLoader classLoaderToUse = classLoader;
if (classLoaderToUse == null) {
classLoaderToUse = getClassLoader();
}
return classLoaderToUse.loadClass(name);
}
/**
* Resolve the given class name as primitive class, if appropriate,
* according to the JVM's naming rules for primitive classes.
* <p>
* Also supports the JVM's internal class names for primitive arrays. Does
* <i>not</i> support the "[]" suffix notation for primitive arrays; this is
* only supported by {@link #forName}.
*
* @param name the name of the potentially primitive class
* @return the primitive class, or <code>null</code> if the name does not
* denote a primitive class or primitive array class
*/
public static Class<?> resolvePrimitiveClassName(String name) {
Class<?> result = null;
// Most class names will be quite long, considering that they
// SHOULD sit in a package, so a length check is worthwhile.
if (name != null && name.length() <= 8) {
// Could be a primitive - likely.
result = (Class<?>) primitiveTypeNameMap.get(name);
}
return result;
}
/** Suffix for array class names: "[]" */
public static final String ARRAY_SUFFIX = "[]";
/** Prefix for internal array class names: "[L" */
private static final String INTERNAL_ARRAY_PREFIX = "[L";
/**
* Map with primitive type name as key and corresponding primitive type as
* value, for example: "int" -> "int.class".
*/
private static final Map<String,Class<?>> primitiveTypeNameMap = new HashMap<String, Class<?>>(16);
/**
* Map with primitive wrapper type as key and corresponding primitive type
* as value, for example: Integer.class -> int.class.
*/
private static final Map<Class<?>,Class<?>> primitiveWrapperTypeMap = new HashMap<Class<?>, Class<?>>(8);
static {
primitiveWrapperTypeMap.put(Boolean.class, boolean.class);
primitiveWrapperTypeMap.put(Byte.class, byte.class);
primitiveWrapperTypeMap.put(Character.class, char.class);
primitiveWrapperTypeMap.put(Double.class, double.class);
primitiveWrapperTypeMap.put(Float.class, float.class);
primitiveWrapperTypeMap.put(Integer.class, int.class);
primitiveWrapperTypeMap.put(Long.class, long.class);
primitiveWrapperTypeMap.put(Short.class, short.class);
Set<Class<?>> primitiveTypeNames = new HashSet<Class<?>>(16);
primitiveTypeNames.addAll(primitiveWrapperTypeMap.values());
primitiveTypeNames.addAll(Arrays
.asList(new Class<?>[] { boolean[].class, byte[].class, char[].class, double[].class,
float[].class, int[].class, long[].class, short[].class }));
for (Iterator<Class<?>> it = primitiveTypeNames.iterator(); it.hasNext();) {
Class<?> primitiveClass = (Class<?>) it.next();
primitiveTypeNameMap.put(primitiveClass.getName(), primitiveClass);
}
}
public static String toShortString(Object obj){
if(obj == null){
return "null";
}
return obj.getClass().getSimpleName() + "@" + System.identityHashCode(obj);
}
}
| [
"[email protected]"
] | |
b02563c821e68350483b8fc259b2833c8860c906 | 655b1a0601b8be654c9321eb480b7c98926b0907 | /CountDownLatchDemo/src/com/company/Main.java | 62b3301127fb40cb02a1c4e4062fda25d39a85bd | [] | no_license | dspatched/Concurrency_Examples | 71abb5b6235216c70aa7214f9356f6c6fee02203 | b90d1ba0ff1926f56ed3f8dc1fd1cf3c0e2abe58 | refs/heads/master | 2020-05-29T23:32:48.253068 | 2019-05-22T11:20:39 | 2019-05-22T11:20:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 335 | java | package com.company;
public class Main {
/*
* CountDownLatch demo
* Developers work on their features while the manager awaits for all the features to be completed
*/
public static void main(String[] args) throws InterruptedException {
SWProject project = new SWProject(5);
project.start();
}
}
| [
"[email protected]"
] | |
9d03a0afc50f6da3e964cb7b3cc389560750ce3f | 5c009ccdde089a427bd2e3a5684ccb9b759896d9 | /src/main/java/com/wemsuser/app/Response/Feedbackdata.java | 49219eb0e242913d53b7b44011edd6a826830125 | [] | no_license | UmraoNidhi/iparknidhi | 062e12fd0e919dab89de0178c912d1c6ffbfff27 | 5c660ffefd783816ca2a1d390e2ff2b1b2e2057a | refs/heads/master | 2022-12-08T14:55:12.126549 | 2020-01-29T13:36:21 | 2020-01-29T13:36:21 | 288,910,023 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,105 | java | package com.wemsuser.app.Response;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Feedbackdata {
@SerializedName("user_id")
@Expose
private String userId;
@SerializedName("merchant_id")
@Expose
private String merchantId;
@SerializedName("service_type_id")
@Expose
private String serviceTypeId;
@SerializedName("user_feedback")
@Expose
private String userFeedback;
@SerializedName("creation_ip")
@Expose
private String creationIp;
@SerializedName("creation_date")
@Expose
private String creationDate;
@SerializedName("status")
@Expose
private String status;
@SerializedName("browse_type")
@Expose
private String browseType;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getMerchantId() {
return merchantId;
}
public void setMerchantId(String merchantId) {
this.merchantId = merchantId;
}
public String getServiceTypeId() {
return serviceTypeId;
}
public void setServiceTypeId(String serviceTypeId) {
this.serviceTypeId = serviceTypeId;
}
public String getUserFeedback() {
return userFeedback;
}
public void setUserFeedback(String userFeedback) {
this.userFeedback = userFeedback;
}
public String getCreationIp() {
return creationIp;
}
public void setCreationIp(String creationIp) {
this.creationIp = creationIp;
}
public String getCreationDate() {
return creationDate;
}
public void setCreationDate(String creationDate) {
this.creationDate = creationDate;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getBrowseType() {
return browseType;
}
public void setBrowseType(String browseType) {
this.browseType = browseType;
}
}
| [
"[email protected]"
] | |
cc11215a0f7f5c1360759f4d071c13dcba47a241 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/17/17_a77682d4012f36b1a678a450bff12d829ad8e963/SMSParser/17_a77682d4012f36b1a678a450bff12d829ad8e963_SMSParser_s.java | 1ff2010f7a70d86780f38ab275d3582588984fce | [] | 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 | 3,514 | java | package mobserv.smsgaming;
import java.util.ArrayList;
import android.app.Activity;
import android.database.Cursor;
import android.net.Uri;
import android.util.Log;
/**
* Provides methods to see if a given challenge has been completed
* @author lolo
*
*/
public class SMSParser {
ArrayList<Group> groups = new ArrayList<Group>();
Player user;
SMSParser() {
groups = null;
}
SMSParser(Player user, ArrayList<Group> groups) {
this.groups = groups;
this.user = user;
if (null == user){
Log.e("SMSParser", "No user provided !");
}
}
/**
* Looks through the SMS inbox for messages containing
* <code>chall.objective</code>.
*
* @param chall(Challenge) challenge we're looking for
* @param act(Activity) activity the method was called from
* @return first matching SMS, null if nothing found
*/
public String searchSMS(Challenge chall, Activity act){
if (chall.isCompleted()){
return "challenge already completed";
}
String[] projection = {"address","date","body", "_id"};//The informations we are interested in the SMSs
Group group = null;
ArrayList<String> playerNumbers;
Cursor cursor = act.getContentResolver().query(Uri.parse("content://sms/inbox"), projection, null, null, null);
//int lastSearch = chall.lastSearch;
Log.d("SMSParser", "Searching for challenge "+chall.toString());
//Try to find the group...
for (Group g : groups){
if (g.getName() == chall.getGroupname()){
group = g;
}
}
if (null == group){
Log.e("SMSParser", "Group "+chall.getGroupname()+" was not found.");
// return "No group !";
}
playerNumbers = group.getPlayerNumbers();
if (cursor.getCount() == 0){
Log.e("SMSParser", "You don't have any SMS, loser !");
return "No SMS !";
}
//cursor.moveToPosition(cursor.getCount() - lastSearch - 1);//Go to the last message checked, according to the Challenge object
cursor.moveToLast();
do{
String msgData = cursor.getString(2);
String sender = cursor.getString(0);
//Log.d("SMSParser", "Message "+cursor.getString(3)+" from : "+cursor.getString(0)+" : "+msgData);
//if (msgData.contains(chall.objective) ){
if (msgData.contains(chall.objective) && playerNumbers.contains(sender) ){
Log.d("SMSParser", " Challenge completed : "+msgData);
user.challengeCompleted(group,chall);
return "Success";
}
}while(cursor.moveToPrevious());
chall.lastSearch = cursor.getCount();
return "No matching sms !!";
}
/**
* Looks through the SMS inbox for messages containing <code>obj</code>.
*
* @param obj string we're looking for
* @param act activity the method was called for
* @return first matching SMS
*/
public String searchSMS(String obj, Activity act){
return searchSMS(
new Challenge(act, obj, 0, null, false),
act);
}
/**
* This method is called by SMSReceiver when messages are incoming
* Currently only printing the SMS
*
* @param msg : String containing one or more SMS
*/
@Deprecated
public void parse(String msg){
Log.i("SMSParser", msg);
try{
//groups.get(0).getUser().challengeCompleted(groups.get(0), groups.get(0).getChallenges().get(0));
//groups.get(0).getChallenges().get(0).setCompleted();
}
catch (java.lang.NullPointerException e){
Log.e("SMSParser", "I don't know where the 'groups' is !!!");
}
}
}
| [
"[email protected]"
] | |
9e9077668752f900810c08a2b8c97d3ab5a406ea | 3370d2bcf49a84dc06b899038029291eca1a3086 | /app/src/main/java/com/mtcle/learnandroid/day324/pattern/instances/SingleInstancClass.java | 715ae61198fc8ee063c78bd19aa0ee458e000312 | [] | no_license | mtcle/LearnAndroid | 2591094e9de8b0e9e59fab3ecfbf75249896d208 | 1a27c33a7c9fc410769ff726c5d45d0e8eb60974 | refs/heads/master | 2020-04-27T19:55:02.922608 | 2019-04-28T01:48:54 | 2019-04-28T01:48:54 | 174,639,112 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 467 | java | package com.mtcle.learnandroid.day324.pattern.instances;
/**
* 作者:Lenovo on 2019/3/20 17:17
* <p>
* 邮箱:[email protected]
* <p>
* 描述:线程安全的,有jvm保证线程安全
*/
public class SingleInstancClass {
private static final SingleInstancClass ourInstance = new SingleInstancClass();
public static SingleInstancClass getInstance() {
return ourInstance;
}
private SingleInstancClass() {
//TODO
}
}
| [
"[email protected]"
] | |
79c9e6a3fd9386bbd4f3cd6a78e25f040d99a889 | ef33ab032cbf79179f127cb317721ddc508daa5f | /app/src/androidTest/java/hyeon/woo/com/capstone/ExampleInstrumentedTest.java | 3d2698df0d2ca5aef91f587d723185c75fc1326b | [] | no_license | dkanskcj/capstone_design | 5889dff5c5116157342d874f39be4dc5f5b315c8 | 551063804db5999786559c7c5fc60f99b49c6d38 | refs/heads/master | 2023-02-22T14:11:48.663764 | 2021-01-24T13:35:35 | 2021-01-24T13:35:35 | 326,425,002 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 728 | java | package hyeon.woo.com.capstone;
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("hyeon.woo.com.capstone", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
6216492f8bc9ebe2387bbb5a72563cf782971eb8 | 0b949c5c930a97ec6b2d2ff4a8430cdc38401fba | /tags/SMSPopup v0.9.9/src/net/everythingandroid/smspopup/SMSPopupActivity.java | fc359cdaa10c775968146e354f927060fd408a90 | [] | no_license | KhalidElSayed/Android-smspopup | 4633176474643b6aa01f39f75993618f78d1ccf6 | 0f9e8070b27da1b9e5ec8a36d17e3b82eeaa341d | refs/heads/master | 2021-01-18T00:31:52.145270 | 2012-03-06T16:02:38 | 2012-03-06T16:02:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,013 | java | package net.everythingandroid.smspopup;
import net.everythingandroid.smspopup.ManageKeyguard.LaunchOnKeyguardExit;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.view.Display;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
public class SMSPopupActivity extends Activity {
private SmsMmsMessage message;
private boolean exitingKeyguardSecurely = false;
private Bundle bundle = null;
private SharedPreferences myPrefs;
private TextView headerTV;
private TextView messageTV;
private TextView fromTV;
private TextView mmsSubjectTV;
private LinearLayout viewButtonLayout;
private LinearLayout mmsLinearLayout;
private ScrollView messageScrollView;
private boolean wasVisible = false;
private boolean replying = false;
private final double WIDTH = 0.8;
private static final int DELETE_DIALOG = 0;
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
Log.v("SMSPopupActivity: onCreate()");
//First things first, acquire wakelock, otherwise the phone may sleep
ManageWakeLock.acquirePartial(getApplicationContext());
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.popup);
//Get shared prefs
myPrefs = PreferenceManager.getDefaultSharedPreferences(this);
//Check preferences and then blur out background behind window
if (myPrefs.getBoolean(getString(R.string.pref_blur_key),
Boolean.valueOf(getString(R.string.pref_blur_default)))) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
}
//This sets the minimum width of the activity to 75% of the screen size
//only needed because the theme of this activity is "dialog" so it looks
//like it's floating and doesn't seem to fill_parent like a regular activity
LinearLayout mainLL = (LinearLayout) findViewById(R.id.MainLinearLayout);
Display d = getWindowManager().getDefaultDisplay();
int width = (int)(d.getWidth() * WIDTH);
Log.v("setting width to: " + width);
mainLL.setMinimumWidth(width);
//Find the main textviews
fromTV = (TextView) findViewById(R.id.FromTextView);
messageTV = (TextView) findViewById(R.id.MessageTextView);
headerTV = (TextView) findViewById(R.id.HeaderTextView);
mmsSubjectTV = (TextView) findViewById(R.id.MmsSubjectTextView);
viewButtonLayout = (LinearLayout) findViewById(R.id.ViewButtonLinearLayout);
messageScrollView = (ScrollView) findViewById(R.id.MessageScrollView);
mmsLinearLayout = (LinearLayout) findViewById(R.id.MmsLinearLayout);
//The close button
Button closeButton = (Button) findViewById(R.id.closeButton);
closeButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent i = new Intent(SMSPopupActivity.this.getApplicationContext(),
SMSPopupUtilsService.class);
i.setAction(SMSPopupUtilsService.ACTION_MARK_MESSAGE_READ);
i.putExtras(message.toBundle());
SMSPopupUtilsService.beginStartingService(
SMSPopupActivity.this.getApplicationContext(), i);
// Finish up this activity
myFinish();
}
});
//The inbox button
Button inboxButton = (Button) findViewById(R.id.InboxButton);
inboxButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
exitingKeyguardSecurely = true;
ManageKeyguard.exitKeyguardSecurely(new LaunchOnKeyguardExit() {
public void LaunchOnKeyguardExitSuccess() {
Intent i = SMSPopupUtils.getSmsIntent();
SMSPopupActivity.this.getApplicationContext().startActivity(i);
myFinish();
}
});
//myFinish();
}
});
//The view button (if in privacy mode)
Button viewButton = (Button) findViewById(R.id.ViewButton);
viewButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
exitingKeyguardSecurely = true;
ManageKeyguard.exitKeyguardSecurely(new LaunchOnKeyguardExit() {
public void LaunchOnKeyguardExitSuccess() {
Intent i = getIntent();
i.putExtra(SmsMmsMessage.EXTRAS_NOTIFY, false);
startActivity(i);
}
});
}
});
//The reply button
Button replyButton = (Button) findViewById(R.id.replyButton);
replyButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
exitingKeyguardSecurely = true;
ManageKeyguard.exitKeyguardSecurely(new LaunchOnKeyguardExit() {
public void LaunchOnKeyguardExitSuccess() {
Intent reply = message.getReplyIntent();
SMSPopupActivity.this.getApplicationContext().startActivity(reply);
replying = true;
myFinish();
}
});
//ManageNotification.clearAll(SMSPopupActivity.this.getApplicationContext(), true);
//myFinish();
}
});
// The ViewMMS button
Button viewMmsButton = (Button) findViewById(R.id.ViewMmsButton);
viewMmsButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
exitingKeyguardSecurely = true;
ManageKeyguard.exitKeyguardSecurely(new LaunchOnKeyguardExit() {
public void LaunchOnKeyguardExitSuccess() {
Intent reply = message.getReplyIntent();
SMSPopupActivity.this.getApplicationContext().startActivity(reply);
myFinish();
}
});
//ManageNotification.clearAll(SMSPopupActivity.this.getApplicationContext(), true);
//myFinish();
}
});
// The Delete button
Button deleteButton = (Button) findViewById(R.id.deleteButton);
if (myPrefs.getBoolean(getString(R.string.pref_show_delete_button_key),
Boolean.valueOf(getString(R.string.pref_show_delete_button_default)))) {
deleteButton.setVisibility(View.VISIBLE);
} else {
deleteButton.setVisibility(View.GONE);
}
deleteButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
showDialog(DELETE_DIALOG);
}
});
if (bundle == null) {
populateViews(getIntent().getExtras());
} else {
populateViews(bundle);
}
wakeApp();
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
Log.v("SMSPopupActivity: onNewIntent()");
//First things first, acquire wakelock, otherwise the phone may sleep
ManageWakeLock.acquirePartial(getApplicationContext());
setIntent(intent);
//Re-populate views with new intent data (ie. new sms data)
populateViews(intent.getExtras());
wakeApp();
}
@Override
protected void onStart() {
super.onStart();
Log.v("SMSPopupActivity: onStart()");
ManageWakeLock.acquirePartial(getApplicationContext());
}
@Override
protected void onResume() {
super.onResume();
Log.v("SMSPopupActivity: onResume()");
wasVisible = false;
//Reset exitingKeyguardSecurely bool to false
exitingKeyguardSecurely = false;
}
@Override
protected void onPause() {
super.onPause();
Log.v("SMSPopupActivity: onPause()");
if (wasVisible) {
//Cancel the receiver that will clear our locks
ClearAllReceiver.removeCancel(getApplicationContext());
ClearAllReceiver.clearAll(!exitingKeyguardSecurely);
}
}
@Override
protected void onStop() {
super.onStop();
Log.v("SMSPopupActivity: onStop()");
//Cancel the receiver that will clear our locks
ClearAllReceiver.removeCancel(getApplicationContext());
ClearAllReceiver.clearAll(!exitingKeyguardSecurely);
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
Log.v("SMSPopupActivity: onWindowFocusChanged(" + hasFocus + ")");
if (hasFocus) {
// This is really hacky, basically a flag that is set if the message
// was at some point visible. I tried using onResume() or other methods
// to prevent doing some things 2 times but this seemed to be the only
// reliable way (?)
wasVisible = true;
}
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
Log.v("SMSPopupActivity: onSaveInstanceState()");
// Save values from most recent bundle (ie. most recent message)
outState.putAll(bundle);
}
private void myFinish() {
Log.v("myFinish()");
// Start a service that will update the notification in the status bar
Intent i = new Intent(
SMSPopupActivity.this.getApplicationContext(),
SMSPopupUtilsService.class);
i.setAction(SMSPopupUtilsService.ACTION_UPDATE_NOTIFICATION);
// Convert current message to bundle
i.putExtras(message.toBundle());
// We need to know if the user is replying - if so, the entire thread id should
// be ignored when working out the message tally in the notification bar. We
// can't rely on the system database as it may take a little while for the reply
// intent to fire and load up the messaging up (after which the messages will be
// marked read in the database).
i.putExtra(SmsMmsMessage.EXTRAS_REPLYING, replying);
// Start the service
SMSPopupUtilsService.beginStartingService(
SMSPopupActivity.this.getApplicationContext(), i);
// Cancel any reminder notifications
ReminderReceiver.cancelReminder(getApplicationContext());
// Finish up the activity
finish();
}
private void populateViews(Bundle b) {
// Store bundle
bundle = b;
// Regenerate the SmsMmsMessage from the extras bundle
message = new SmsMmsMessage(getApplicationContext(), bundle);
// Refresh privacy settings (hide/show message)
refreshPrivacy();
// Find the ImageView that will show the contact photo
ImageView iv = (ImageView) findViewById(R.id.FromImageView);
// See if we have a contact photo, if so set it to the IV, if not, show a
// generic dialog info icon
Bitmap contactPhoto = message.getContactPhoto();
if (contactPhoto != null) {
iv.setImageBitmap(contactPhoto);
} else {
iv.setImageDrawable(
getResources().getDrawable(android.R.drawable.ic_dialog_info));
}
// Show/hide the LinearLayout and update the unread message count
// if there are >1 unread messages waiting
LinearLayout mLL = (LinearLayout) findViewById(R.id.UnreadCountLinearLayout);
TextView tv = (TextView) findViewById(R.id.UnreadCountTextView);
if (message.getUnreadCount() <= 1) {
mLL.setVisibility(View.GONE);
tv.setText("");
} else {
String textWaiting = String.format(
getString(R.string.unread_text_waiting), message
.getUnreadCount() - 1);
tv.setText(textWaiting);
mLL.setVisibility(View.VISIBLE);
}
// Update TextView that contains the timestamp for the incoming message
String headerText = getString(R.string.new_text_at);
headerText = headerText.replaceAll("%s", message.getFormattedTimestamp());
//Set the from, message and header views
fromTV.setText(message.getContactName());
if (message.getMessageType() == SmsMmsMessage.MESSAGE_TYPE_SMS) {
messageTV.setText(message.getMessageBody());
} else {
mmsSubjectTV.setText(getString(R.string.mms_subject) + " " + message.getMessageBody());
}
headerTV.setText(headerText);
}
private void refreshPrivacy() {
//We need to init the keyguard class so we can check if the keyguard is on
ManageKeyguard.initialize(getApplicationContext());
//Fetch privacy mode
boolean privacyMode = myPrefs.getBoolean(
getString(R.string.pref_privacy_key),
Boolean.valueOf(getString(R.string.pref_privacy_default)));
// If it's a MMS message, just show the MMS layout
if (message.getMessageType() == SmsMmsMessage.MESSAGE_TYPE_MMS) {
viewButtonLayout.setVisibility(View.GONE);
messageScrollView.setVisibility(View.GONE);
mmsLinearLayout.setVisibility(View.VISIBLE);
// If no MMS subject, hide the subject text view
if (TextUtils.isEmpty(message.getMessageBody())) {
mmsSubjectTV.setVisibility(View.GONE);
} else {
mmsSubjectTV.setVisibility(View.VISIBLE);
}
} else {
// Otherwise hide MMS layout and show either the view button if in
// privacy mode or the message body textview if not
mmsLinearLayout.setVisibility(View.GONE);
if (privacyMode && ManageKeyguard.inKeyguardRestrictedInputMode()) {
viewButtonLayout.setVisibility(View.VISIBLE);
messageScrollView.setVisibility(View.GONE);
} else {
viewButtonLayout.setVisibility(View.GONE);
messageScrollView.setVisibility(View.VISIBLE);
}
}
}
private void wakeApp() {
// Time to acquire a full WakeLock (turn on screen)
ManageWakeLock.acquireFull(getApplicationContext());
// See if a notification has been played for this message...
if (message.getNotify()) {
// Store extra to signify we have already notified for this message
bundle.putBoolean(SmsMmsMessage.EXTRAS_NOTIFY, false);
// Reset the reminderCount to 0 just to be sure
message.updateReminderCount(0);
// Schedule a reminder notification
ReminderReceiver.scheduleReminder(getApplicationContext(), message);
// Run the notification
ManageNotification.show(getApplicationContext(), message);
}
}
@Override
protected void onDestroy() {
Log.v("onDestroy()");
// ClearAllReceiver.clearAll(!exitingKeyguardSecurely);
super.onDestroy();
}
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case DELETE_DIALOG:
return new AlertDialog.Builder(this)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(getString(R.string.pref_show_delete_button_dialog_title))
.setMessage(getString(R.string.pref_show_delete_button_dialog_text))
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
Intent i = new Intent(
SMSPopupActivity.this.getApplicationContext(),
SMSPopupUtilsService.class);
i.setAction(SMSPopupUtilsService.ACTION_DELETE_MESSAGE);
i.putExtras(message.toBundle());
SMSPopupUtilsService.beginStartingService(
SMSPopupActivity.this.getApplicationContext(), i);
myFinish();
}
})
.setNegativeButton(android.R.string.cancel, null)
.create();
}
return null;
}
} | [
"[email protected]"
] | |
49de516704f4c8429f44c5aff6d272510989564c | 3ea6e1880e17739edb7ef8c1eb65bd47cf5c0e6f | /src/java/estructuras/lista.java | b7cbbf2218844b6fbe856236deb5ad67864c0999 | [] | no_license | sicmmar/proyecto2edd | 33aeafe4f612b64dc57627e3f17aae7daf07321b | 4dcc0b5c959ad766316e8eea681c851702f0f64b | refs/heads/master | 2023-04-30T01:53:12.720520 | 2021-05-21T19:12:27 | 2021-05-21T19:12:27 | 181,247,576 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,325 | java | package estructuras;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author marianasic
*/
public class lista {
private int tamano;
private nodolista raiz;
public lista(){
this.tamano = 0;
this.raiz = null;
}
/**
* @return the tamano
*/
public int getTamano() {
return tamano;
}
/**
* @param tamano the tamano to set
*/
public void setTamano(int tamano) {
this.tamano = tamano;
}
/**
* @return the raiz
*/
public nodolista getRaiz() {
return raiz;
}
/**
* @param raiz the raiz to set
*/
public void setRaiz(nodolista raiz) {
this.raiz = raiz;
}
public void RemoveAt(int index)
{
if(index == 0)
{
raiz = raiz.getSiguiente();
}
else
{
int contador = 0;
nodolista temporal = raiz;
while(contador < index -1)
{
temporal = temporal.getSiguiente();
contador ++;
}
temporal.setSiguiente(temporal.getSiguiente().getSiguiente());
temporal.getSiguiente().setAnterior(temporal);
}
tamano --;
}
public int getIndexOf(Object obj)
{
int index = 0;
nodolista temporal = raiz;
for (int i = 0; i <tamano; i++) {
if(temporal.getValor1().equals(obj))
{
break;
}
else{
temporal = temporal.getSiguiente();
index++;
}
}
return index;
}
public boolean Contains(Object obj)
{
boolean contiene = false;
nodolista temporal = raiz;
for (int i = 0; i <tamano; i++) {
if(temporal.getValor1().equals(obj))
{
contiene = true;
break;
}
else{
temporal = temporal.getSiguiente();
}
}
return contiene;
}
//este metodo agrega un nodo al principio de la lista
public void addPrimero(Object obj1)
{
if(raiz == null)
{
raiz = new nodolista(obj1);
}
else
{
nodolista temp = raiz;
nodolista nuevo = new nodolista(obj1);
nuevo.setSiguiente(temp);
raiz = nuevo;
}
tamano++;
}
//da el valor que halla en el nodo que se le especifique en el parametro index
public nodolista getnodolista(int index)
{
int contador = 0;
nodolista temporal = raiz;
while(contador < index)
{
temporal = temporal.getSiguiente();
contador ++;
}
return temporal;
}
public Object getValor1(int index)
{
int contador = 0;
nodolista temporal = raiz;
while(contador < index)
{
temporal = temporal.getSiguiente();
contador ++;
}
return temporal.getValor1();
}
//elimina solo el primer nodo
public void eliminarPrimero()
{
raiz = raiz.getSiguiente();
tamano--;
}
//corta todos los nodos que hallan desde el numero escogido en adelante
//ejemplo 1 -> 2 -> 3 -> 4 -> 5 -> 6
// si se escoge el 3 cortaría el 4 5 y 6 no prro >:v que mamon jajaja NADAAAAAAAA, NADAAAAAAAAAAAAAAAAAAAAAA no hay excusa >:V
/*
public void cortar(int index)
{
int contador = 0;
nodolista temporal = raiz;
while(contador < index-1)
{
temporal = temporal.getSiguiente();
contador ++;
}
temporal.setSiguiente(null);
tamano = index;
}
*/
public void vaciar()
{
raiz = null;
tamano = 0;
}
//devuelve el tamaño de la lista
public int tamano()
{
return tamano;
}
//dice si la lista esta vacia o no
public boolean estaVacia()
{
return(raiz == null);
}
}
| [
"[email protected]"
] | |
64dd669d0c45ddfc8279e4054f8c58471d32a1cf | 0bab1663db7b947917b6b4660dd0fb9ea267eeaa | /osgiwebservlet/src/jetty_osgi_example/Activator.java | 48d62ec9d0e592c4474e27a34eadc0f943169b52 | [] | no_license | abdul99/OSGi | d368b0028fd133a7729787f6343a9987b646c515 | b090684e1efd91af530c39fbe1cefd5d15361469 | refs/heads/master | 2021-01-17T17:45:57.857326 | 2016-06-28T05:08:21 | 2016-06-28T05:08:21 | 62,111,589 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,432 | java | package jetty_osgi_example;
import java.util.Hashtable;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHandler;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
public class Activator implements BundleActivator {
private static BundleContext context;
static BundleContext getContext() {
return context;
}
public void start(BundleContext bundleContext) throws Exception {
Activator.context = bundleContext;
//1. We create a Servlet Handler
ServletHandler handler = new ServletHandler();
//2. We register our Servlet and its URL mapping
handler.addServletWithMapping(JcgServlet.class, "/*");
//3. We are creating a Servlet Context handler
ServletContextHandler ch= new ServletContextHandler();
//4. We are defining the context path
ch.setContextPath("/jcgservletpath");
//5. We are attaching our servlet handler
ch.setServletHandler(handler);
//6. We are creating an empty Hashtable as the properties
Hashtable props = new Hashtable();
// 7. Here we register the ServletContextHandler as the OSGi service
bundleContext.registerService(ContextHandler.class.getName(), ch, props);
System.out.println("Registration Complete");
}
public void stop(BundleContext bundleContext) throws Exception {
Activator.context = null;
}
}
| [
"[email protected]"
] | |
34d031ce6915abd078f2e97a0b94a8f423c23599 | 08335a2d0dde25f08b4f82d21b2a7fd788b414c0 | /src/main/java/com/meadowcottage/roboticcraft/common/init/ModTools.java | 972cbbc65a2c5e6b0ad118a0b8cad256d6186cb6 | [
"MIT"
] | permissive | Mazdallier/Roboticcraft | e8f6d74abbcc29590006cfb4a2abfa2e3204d426 | c628937b905db6f73ed8fcb3cb6eb6244bf7f6d9 | refs/heads/master | 2020-04-09T05:04:16.486748 | 2015-02-05T19:01:04 | 2015-02-05T19:01:04 | 30,405,097 | 0 | 0 | null | 2015-02-06T09:33:10 | 2015-02-06T09:33:10 | null | UTF-8 | Java | false | false | 1,538 | java | package com.meadowcottage.roboticcraft.common.init;
import com.meadowcottage.roboticcraft.common.items.tools.ItemSteelAxe;
import com.meadowcottage.roboticcraft.common.items.tools.ItemSteelPick;
import com.meadowcottage.roboticcraft.common.items.tools.ItemSteelShovel;
import com.meadowcottage.roboticcraft.common.items.tools.ItemSteelSword;
import com.meadowcottage.roboticcraft.common.items.tools.ItemWrench;
import com.meadowcottage.roboticcraft.common.reference.Names;
import com.meadowcottage.roboticcraft.common.reference.Reference;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.item.Item;
@GameRegistry.ObjectHolder(Reference.MOD_ID)
public class ModTools
{
//Declare Tools
public static final ItemWrench Wrench = new ItemWrench();
public static final ItemSteelSword SteelSword = new ItemSteelSword(Item.ToolMaterial.IRON );
public static final ItemSteelPick SteelPick = new ItemSteelPick(Item.ToolMaterial.IRON );
public static final ItemSteelShovel SteelShovel = new ItemSteelShovel(Item.ToolMaterial.IRON );
public static final ItemSteelAxe SteelAxe = new ItemSteelAxe(Item.ToolMaterial.IRON );
public static void init()
{
//Registering Items
GameRegistry.registerItem(Wrench, Names.Tools.Wrench);
GameRegistry.registerItem(SteelSword, Names.Tools.SteelSword);
GameRegistry.registerItem(SteelPick, Names.Tools.SteelPick);
GameRegistry.registerItem(SteelShovel, Names.Tools.SteelShovel);
GameRegistry.registerItem(SteelAxe, Names.Tools.SteelAxe);
}
} | [
"[email protected]"
] | |
d9f893378cb1e26e85683f8c3f18fc9c16aeeb39 | b9abf72fe96cb69c8537026dd13b0b64e9f74236 | /src/main/java/com/bbstone/pisces/server/base/ReqDispatcher.java | bfd4861771d65a5cfca32aeb8ecf6cab5a0ac005 | [
"Apache-2.0"
] | permissive | bbstone101/pisces | 5b22a0c56e03e42dc2af00a7297e8aac92133efd | 77368ba0e5f00d590916e0abab0c44d847a977aa | refs/heads/master | 2023-03-14T14:20:17.348681 | 2021-02-25T13:29:31 | 2021-02-25T13:29:31 | 333,356,918 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 498 | java | package com.bbstone.pisces.server.base;
import com.bbstone.pisces.proto.BFileMsg;
import com.bbstone.pisces.server.cmd.CmdHandler;
import io.netty.channel.ChannelHandlerContext;
/**
* client request will dispatch to different server cmdHandler according cmd
*
*/
public class ReqDispatcher {
public static void dispatch(ChannelHandlerContext ctx, BFileMsg.BFileReq msg) {
CmdHandler cmdHandler = CmdRegister.getHandler(msg.getCmd());
cmdHandler.handle(ctx, msg);
}
}
| [
"[email protected]"
] | |
691d1df12cd6d6f1a05cec1b9ef1550c145c71e4 | 38ee0271dd601420dba9dd133343a6d06a2880d7 | /EasyTest/src/main/java/com/java/singleAsync/TaskHelper.java | a60800719d8f5e6c14a1693c6d924b718b5c32ec | [] | no_license | tankmyb/EasyProject | c630ba69f458fe13449c0ff5b88d797bb46e90cf | e699826d41c034d1ca1f8092463e7426e85778b3 | refs/heads/master | 2016-09-06T02:36:59.128880 | 2015-02-17T02:03:51 | 2015-02-17T02:03:51 | 30,898,342 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,188 | java | package com.java.singleAsync;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
public class TaskHelper {
public static TaskEventEmitter createIOTask(TaskExecutor executor, String fileName){
final IOTask task = new IOTask(executor, fileName, "UTF-8");
task.on("open", new EventHandler() {
@Override
public void handle(EventObject event) {
String fileName = (String) event.getArgs()[0];
System.out.println(Thread.currentThread() + " - " + fileName + " has been opened.");
}
});
task.on("next", new EventHandler() {
@Override
public void handle(EventObject event) {
BufferedReader reader = (BufferedReader) event.getArgs()[0];
try {
String line = reader.readLine();
if (line != null) {
task.emit("ready", line);
task.emit("next", reader);
} else {
task.emit("close", task.getFileName());
}
} catch (IOException e) {
task.emit(e.getClass().getName(), e, task.getFileName());
try {
reader.close();
task.emit("close", task.getFileName());
} catch (IOException e1) {
e1.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
}
});
task.on("ready", new EventHandler() {
@Override
public void handle(EventObject event) {
String line = (String) event.getArgs()[0];
int len = line.length();
int wordCount = line.split("[\\s+,.]+").length;
System.out.println(Thread.currentThread()+" - word count: "+wordCount+" length: "+len);
}
});
task.on(IOException.class.getName(), new EventHandler() {
@Override
public void handle(EventObject event) {
Object[] args = event.getArgs();
IOException e = (IOException) args[0];
String fileName = (String) args[1];
System.out.println(Thread.currentThread()+ " - An IOException occurred while reading " + fileName + ", error: " + e.getMessage());
}
});
task.on("close", new EventHandler() {
@Override
public void handle(EventObject event) {
String fileName = (String) event.getArgs()[0];
System.out.println(Thread.currentThread() + " - " + fileName + " has been closed.");
}
});
task.on(FileNotFoundException.class.getName(), new EventHandler() {
@Override
public void handle(EventObject event) {
FileNotFoundException e = (FileNotFoundException) event.getArgs()[0];
e.printStackTrace();
System.exit(1);
}
});
return task;
}
} | [
"="
] | = |
b5982a26d3a73dffd62d5cf0899cef59950de941 | 83080abf46771f90236e4ebb09799e559770f27f | /src/TermBrowser/src/java/de/fhdo/collaboration/discgroup/DiscGroupData.java | 9252cfbf4f65939c6a9a72b7a19a3c619845b484 | [
"Apache-2.0"
] | permissive | vonkc2/Termserver | a82babd23aaee7bee660f443faea254161d30a24 | 5bc2652f27eca7c559ed69b2600d6872f4ad52e5 | refs/heads/master | 2021-01-15T18:51:40.562365 | 2015-03-11T13:39:50 | 2015-03-11T13:39:50 | 31,499,798 | 0 | 0 | null | 2015-03-01T15:03:00 | 2015-03-01T15:03:00 | null | UTF-8 | Java | false | false | 1,346 | java | /*
* CTS2 based Terminology Server and Terminology Browser
* Copyright (C) 2014 FH Dortmund: Peter Haas, Robert Muetzner
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.fhdo.collaboration.discgroup;
import de.fhdo.collaboration.db.classes.Collaborationuser;
import de.fhdo.collaboration.db.classes.Discussiongroup;
/**
*
* @author Philipp Urbauer
*/
public class DiscGroupData {
private Discussiongroup group;
private Collaborationuser headOfGroup;
public Discussiongroup getGroup() {
return group;
}
public void setGroup(Discussiongroup group) {
this.group = group;
}
public Collaborationuser getHeadOfGroup() {
return headOfGroup;
}
public void setHeadOfGroup(Collaborationuser headOfGroup) {
this.headOfGroup = headOfGroup;
}
}
| [
"[email protected]"
] | |
d8270519a176bdbaaa099425f45171fb4e948ac1 | c4eb564ebb1cb98b513698dd074d943488d0dc89 | /icc-wechat-api/src/main/java/com/icc/common/IdFactory.java | e6fec4542e2675303e8d96159cbc63130a839186 | [] | no_license | csiizhur/iccspace_projects | 92d3df66754db6668042c9ce4743d4ef1a48cac8 | e4b944a7f74469cb55ba11e753493a97bba9982a | refs/heads/master | 2021-01-11T21:33:50.875197 | 2017-01-13T06:43:26 | 2017-01-13T06:43:26 | 78,807,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 380 | java | package com.icc.common;
import java.util.UUID;
/**
*
* @description 主键工厂
* @author zhur
* @date 2016年9月23日上午11:53:21
*/
public class IdFactory {
/**
* 获取uuid并且去掉-
* @return
*/
public String getUUID(){
UUID uuid=UUID.randomUUID();
String replUUID=uuid.toString().replaceAll("-", "");
return replUUID;
}
}
| [
"[email protected]"
] | |
cfdacf89ae517a53000e8af461fcfbc0b9cf007c | 37317fc21744b1e64312f931626c0b140453508b | /src/test/java/org/brewman/examples/logger/LoggerOutputStreamTest.java | 5a0d95fe50e70b043835e9fe9a1544168a4267fd | [] | no_license | danielshiplett/examples | 1fe42466f4dcd5947d6927c962fa37eead54c6f8 | e8c598d969d084d500505f331ae85451242bad06 | refs/heads/master | 2021-01-10T12:51:41.662346 | 2015-05-29T18:40:39 | 2015-05-29T18:40:39 | 35,988,199 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 605 | java | package org.brewman.examples.logger;
import java.io.PrintStream;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ch.qos.logback.classic.Level;
public class LoggerOutputStreamTest {
private static final Logger LOG = LoggerFactory
.getLogger(LoggerOutputStreamTest.class);
@Test
public void test() {
/*
* Configure the System.ERR to go to our logger.
*/
System.setErr(new PrintStream(new LoggerOutputStream(LOG, Level.ERROR),
true));
System.err.print("This is a test!");
}
}
| [
"[email protected]"
] | |
7158441c30f9958e533c7595b239c74c54e1a038 | 47034e7fcb058b3df4bf5928455951e5f455897e | /javatools/hserranalysis/src/main/java/me/hatter/tools/hserranalysis/sun/jvm/hotspot/asm/x86/X86CondJmpInstruction.java | 8e494d90328b45015c5ac6d153247f39d05c4f8a | [] | no_license | KingBowser/hatter-source-code | 2858a651bc557e3aacb4a07133450f62dc7a15c6 | f10d4f0ec5f5adda1baa942e179f76301ebc328a | refs/heads/master | 2021-01-01T06:49:52.889183 | 2015-03-21T17:00:28 | 2015-03-21T17:00:28 | 32,662,581 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,277 | java | /*
* Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package me.hatter.tools.hserranalysis.sun.jvm.hotspot.asm.x86;
import me.hatter.tools.hserranalysis.sun.jvm.hotspot.asm.*;
public class X86CondJmpInstruction extends X86Instruction
implements BranchInstruction {
final private X86PCRelativeAddress addr;
public X86CondJmpInstruction(String name, X86PCRelativeAddress addr, int size, int prefixes) {
super(name, size, prefixes);
this.addr = addr;
if(addr instanceof X86PCRelativeAddress) {
addr.setInstructionSize(getSize());
}
}
public String asString(long currentPc, SymbolFinder symFinder) {
StringBuffer buf = new StringBuffer();
buf.append(getPrefixString());
buf.append(getName());
buf.append(spaces);
if(addr instanceof X86PCRelativeAddress) {
long disp = ((X86PCRelativeAddress)addr).getDisplacement();
long address = disp + currentPc;
buf.append(symFinder.getSymbolFor(address));
}
return buf.toString();
}
public Address getBranchDestination() {
return addr;
}
public boolean isBranch() {
return true;
}
public boolean isConditional() {
return true;
}
}
| [
"[email protected]@dd6f9e7e-b4fe-0bd6-ab9c-0ed876a8e821"
] | [email protected]@dd6f9e7e-b4fe-0bd6-ab9c-0ed876a8e821 |
9fdf9bf6b86984e945c7b2275034bc959c48d6a0 | 9cd8e7c05b59e247e07d9f3e8db8ed91b2ed205e | /src/main/java/org/fpml/fpml_5/master/AbstractEvent.java | ab812d4e25adf435954b73cc8c27dd1269bed9b8 | [] | no_license | silvionetto/gapp | d534f919cf732b0eb475abfd46e3dd5a213d7e6d | 655e3740216d2a7e55625d5c1ebfcbe3b72ef1af | refs/heads/master | 2022-01-09T03:35:18.331184 | 2022-01-04T10:03:41 | 2022-01-04T10:03:41 | 113,552,613 | 0 | 0 | null | 2022-01-04T10:03:42 | 2017-12-08T08:46:54 | Java | UTF-8 | Java | false | false | 2,644 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-b170531.0717
// See <a href="https://jaxb.java.net/">https://jaxb.java.net/</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2018.02.10 at 05:14:53 PM CET
//
package org.fpml.fpml_5.master;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
/**
* Abstract base type for all events.
*
* <p>Java class for AbstractEvent complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="AbstractEvent">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="eventIdentifier" type="{http://www.fpml.org/FpML-5/master}BusinessEventIdentifier" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AbstractEvent", propOrder = {
"eventIdentifier"
})
@XmlSeeAlso({
AdditionalEvent.class,
ChangeEvent.class,
OptionEvent.class,
OptionExercise.class,
OptionExpiry.class,
TradeAmendmentContent.class,
TradeChangeBase.class,
TradeNovationContent.class
})
public abstract class AbstractEvent {
protected List<BusinessEventIdentifier> eventIdentifier;
/**
* Gets the value of the eventIdentifier property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the eventIdentifier property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getEventIdentifier().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link BusinessEventIdentifier }
*
*
*/
public List<BusinessEventIdentifier> getEventIdentifier() {
if (eventIdentifier == null) {
eventIdentifier = new ArrayList<BusinessEventIdentifier>();
}
return this.eventIdentifier;
}
}
| [
"[email protected]"
] | |
58db81f49a33fc3017b1e3f4bb4314f734ee6ccc | b76ce8f33bf7db8203b8192d0a94a1f0973f715a | /src/java/filediff/DiffException.java | 9d85a57550ea0997fb045bc05de2e440e92b1e43 | [
"MIT"
] | permissive | nendhruv/data-dictionary | 320eb33bcba2b883eed844a7b5f9a7805cf2a823 | 2c4183f15a83c65cdceed36083267f02a2597be7 | refs/heads/master | 2021-01-22T06:59:20.634232 | 2014-12-07T09:17:46 | 2014-12-07T09:17:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 237 | java |
package filediff;
public class DiffException extends Exception {
private static final long serialVersionUID = 1L;
public DiffException() {
}
public DiffException(String msg) {
super(msg);
}
}
| [
"[email protected]"
] | |
acc4252ab26004c529515bfcacd4a73c03849838 | dbad3213f6544564d580932e20dca31c7c1943da | /src/org/apache/catalina/storeconfig/StoreRegistry.java | 7fb6e21e61f219cc58b35b0e7b258548ebac5452 | [] | no_license | Lyon1994/MyTomcatServerApp | 0ef3db59bc3bc0ecdbd35e4d616ca75d082420be | 37304fdfa03a7d03f119ae7eaa54f13539021b50 | refs/heads/master | 2021-01-19T03:19:02.243034 | 2015-07-28T06:21:44 | 2015-07-28T06:58:51 | 39,816,568 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,537 | 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.catalina.storeconfig;
import java.util.HashMap;
import java.util.Map;
import javax.naming.directory.DirContext;
import org.apache.catalina.CredentialHandler;
import org.apache.catalina.LifecycleListener;
import org.apache.catalina.Manager;
import org.apache.catalina.Realm;
import org.apache.catalina.Valve;
import org.apache.catalina.WebResourceRoot;
import org.apache.catalina.WebResourceSet;
import org.apache.catalina.ha.CatalinaCluster;
import org.apache.catalina.ha.ClusterDeployer;
import org.apache.catalina.ha.ClusterListener;
import org.apache.catalina.tribes.Channel;
import org.apache.catalina.tribes.ChannelInterceptor;
import org.apache.catalina.tribes.ChannelReceiver;
import org.apache.catalina.tribes.ChannelSender;
import org.apache.catalina.tribes.Member;
import org.apache.catalina.tribes.MembershipService;
import org.apache.catalina.tribes.MessageListener;
import org.apache.catalina.tribes.transport.DataSender;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
/**
* Central StoreRegistry for all server.xml elements
*/
public class StoreRegistry {
private static Log log = LogFactory.getLog(StoreRegistry.class);
private Map<String, StoreDescription> descriptors = new HashMap<>();
private String encoding = "UTF-8";
private String name;
private String version;
// Access Information
private static Class<?> interfaces[] = { CatalinaCluster.class,
ChannelSender.class, ChannelReceiver.class, Channel.class,
MembershipService.class, ClusterDeployer.class, Realm.class,
Manager.class, DirContext.class, LifecycleListener.class,
Valve.class, ClusterListener.class, MessageListener.class,
DataSender.class, ChannelInterceptor.class, Member.class,
WebResourceRoot.class, WebResourceSet.class,
CredentialHandler.class };
/**
* @return Returns the name.
*/
public String getName() {
return name;
}
/**
* @param name
* The name to set.
*/
public void setName(String name) {
this.name = name;
}
/**
* @return Returns the version.
*/
public String getVersion() {
return version;
}
/**
* @param version
* The version to set.
*/
public void setVersion(String version) {
this.version = version;
}
/**
* Find a description for id. Handle interface search when no direct match
* found.
*
* @param id
* @return The description
*/
public StoreDescription findDescription(String id) {
if (log.isDebugEnabled())
log.debug("search descriptor " + id);
StoreDescription desc = descriptors.get(id);
if (desc == null) {
Class<?> aClass = null;
try {
aClass = Class.forName(id, true, this.getClass()
.getClassLoader());
} catch (ClassNotFoundException e) {
log.error("ClassName:" + id, e);
}
if (aClass != null) {
desc = descriptors.get(aClass.getName());
for (int i = 0; desc == null && i < interfaces.length; i++) {
if (interfaces[i].isAssignableFrom(aClass)) {
desc = descriptors.get(interfaces[i].getName());
}
}
}
}
if (log.isDebugEnabled())
if (desc != null)
log.debug("find descriptor " + id + "#" + desc.getTag() + "#"
+ desc.getStoreFactoryClass());
else
log.debug(("Can't find descriptor for key " + id));
return desc;
}
/**
* Find Description by class
*
* @param aClass
* @return The description
*/
public StoreDescription findDescription(Class<?> aClass) {
return findDescription(aClass.getName());
}
/**
* Find factory from classname
*
* @param aClassName
* @return The factory
*/
public IStoreFactory findStoreFactory(String aClassName) {
StoreDescription desc = findDescription(aClassName);
if (desc != null)
return desc.getStoreFactory();
else
return null;
}
/**
* find factory from class
*
* @param aClass
* @return The factory
*/
public IStoreFactory findStoreFactory(Class<?> aClass) {
return findStoreFactory(aClass.getName());
}
/**
* Register a new description
*
* @param desc
*/
public void registerDescription(StoreDescription desc) {
String key = desc.getId();
if (key == null || "".equals(key))
key = desc.getTagClass();
descriptors.put(key, desc);
if (log.isDebugEnabled())
log.debug("register store descriptor " + key + "#" + desc.getTag()
+ "#" + desc.getTagClass());
}
public StoreDescription unregisterDescription(StoreDescription desc) {
String key = desc.getId();
if (key == null || "".equals(key))
key = desc.getTagClass();
return descriptors.remove(key);
}
// Attributes
/**
* @return The encoding
*/
public String getEncoding() {
return encoding;
}
/**
* @param string
*/
public void setEncoding(String string) {
encoding = string;
}
}
| [
"[email protected]"
] | |
2556b468332a87483e4a54d7ede6ffcebc0b7378 | 44b2a693c6396fb241e2c21a49a4b3054b4af2c2 | /src/main/java/io/gr1d/ic/usage/api/subscriptions/model/ApiGatewayResponse.java | 114a540c25f1f11893315009ef2c40cd4b98aa08 | [] | no_license | thiagozampieri/devPortal | 0b9ebf3559ee80d659fe122740845bbe769bbdd6 | 7089747bd9028f2e4d070fa423e7f5f1d516f5b9 | refs/heads/master | 2021-04-22T15:04:48.538153 | 2020-03-23T20:00:11 | 2020-03-23T20:00:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 514 | java | package io.gr1d.ic.usage.api.subscriptions.model;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class ApiGatewayResponse {
private String uuid;
private String apiUuid;
private PlanResponse apiPlan;
private String splitMode;
private String name;
private String externalId;
private String productionExternalId;
private GatewayResponse gateway;
private ProviderResponse provider;
private LocalDateTime createdAt;
private LocalDateTime removedAt;
}
| [
"[email protected]"
] | |
70dd097ea4707aadde02d638ce2d6b65dc9b07bb | 07c47485051bea8faec924fb1bf13336ae48856f | /PaintSourceCodeDemo/app/src/main/java/com/dyx/pscd/MainActivity.java | 1a0ff420dd1035ceb0ae3e5ee4dcedd7a04463ab | [] | no_license | caozhen456521/BlogCode | e10322a7453912445797d40ed6dfc8bb825550b0 | a5bb63ef5193cb827e56ccea5ce17be877714589 | refs/heads/master | 2020-06-27T12:38:33.564498 | 2018-10-19T17:02:13 | 2018-10-19T17:02:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 296 | java | package com.dyx.pscd;
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"[email protected]"
] | |
2769b187cdad8f28790a1a873813fb98b862ea5c | a8a0afc76179156d1ea837a20bd41fe7d6940580 | /app/src/main/java/com/example/android/logindemo/Repeating_activity.java | e887c20126e3f088fa3b8f9660e9012e88ea9dd1 | [] | no_license | shan7030/collect-chunk | 1fed8af401807d6061ec863c5e38e3d62a4846b8 | 15a27ee9af5ae0a5baf5ab936018078dfbd2d406 | refs/heads/master | 2021-09-23T23:15:27.807060 | 2018-09-28T19:33:22 | 2018-09-28T19:33:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 596 | java | package com.example.android.logindemo;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
/**
* Created by shantanu on 26/9/18.
*/
public class Repeating_activity extends AppCompatActivity{
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_daily);
Intent intenter = new Intent (Repeating_activity.this, DailyActivity.class);
startActivity(intenter);
}
}
| [
"[email protected]"
] | |
9e412e76bba30cdbd63cf6cfc7c96bb358743353 | 6d00c76588e6e8c129391b566920b24e119d48b6 | /src/com/arpit/iitg/presentsir/AutoUpdateBunkMeter.java | c9df9947309e890b7e82f632d985f18fb742adc5 | [] | no_license | calvincodes/PresentSir | 38ebc80650893f0c15659df3e698ef96141533ba | 5f4e3402b85c9cfa15b124233c72012ec0f3407f | refs/heads/master | 2020-12-21T09:46:49.130793 | 2020-01-26T23:24:06 | 2020-01-26T23:24:06 | 236,389,997 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,370 | java | package com.arpit.iitg.presentsir;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Vibrator;
import android.util.TypedValue;
import android.widget.TextView;
public class AutoUpdateBunkMeter extends Activity {
int hours;
String today;
TextView auto_update_tv;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.auto_bm_count_update_page);
android.app.ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
Drawable action_bar_bg = getResources().getDrawable(R.drawable.sides_chalkboard);
actionBar.setBackgroundDrawable(action_bar_bg);
Typeface comic_font = Typeface.createFromAsset(getAssets(),"fonts/Action_Man.ttf");
int titleId = getResources().getIdentifier("action_bar_title", "id", "android");
TextView app_title_tv = (TextView) findViewById(titleId);
app_title_tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 22);
app_title_tv.setTypeface(comic_font);
SharedPreferences sound_prefs_sp = getSharedPreferences("SoundPrefs",Context.MODE_PRIVATE);
int sound_val = sound_prefs_sp.getInt("sound_pref", 1);
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);
if(sound_val == 1){ // Vib + Mel
v.vibrate(1500); // Vibrate for 1000 milliseconds = 1.5 sec
r.play(); // Play the current ringtone of the phone
}else if(sound_val == 2){ // Mel only
r.play();
}else if(sound_val == 3){ // Vib only
v.vibrate(1500);
}
hours = getIntent().getExtras().getInt("hours");
auto_update_tv = (TextView) findViewById(R.id.auto_update_notification_tv);
auto_update_tv.setTypeface(comic_font);
SimpleDateFormat dayFormat = new SimpleDateFormat("EEEE", Locale.US);
Calendar calendar = Calendar.getInstance();
today = dayFormat.format(calendar.getTime()); // Get today's day
String slot_to_show = null;
switch(hours){
case 9: slot_to_show = "8to9"; break;
case 10: slot_to_show = "9to10"; break;
case 11: slot_to_show = "10to11"; break;
case 12: slot_to_show = "11to12"; break;
case 13: slot_to_show = "12to1"; break;
case 14: slot_to_show = "1to2"; break;
case 15: slot_to_show = "2to3"; break;
case 16: slot_to_show = "3to4"; break;
case 17: slot_to_show = "4to5"; break;
case 18: slot_to_show = "5to6"; break;
case 19: slot_to_show = "6to7"; break;
}
SharedPreferences open_tt_to_incr_bm = getApplicationContext().getSharedPreferences(today,Context.MODE_PRIVATE);
SharedPreferences incr_bunk_sp = getSharedPreferences(open_tt_to_incr_bm.getString("name_" + slot_to_show,"N/A"),Context.MODE_PRIVATE);
SharedPreferences.Editor edit_bunk_counter = incr_bunk_sp.edit();
String set_update_msg = "No Response!\nWe assumed you bunked "+open_tt_to_incr_bm.getString("name_" + slot_to_show,"N/A")+" ("+
open_tt_to_incr_bm.getString("num_" + slot_to_show,"N/A")+
") class. If you attended the class, decrease the bunk meter manually";
auto_update_tv.setText(set_update_msg);
int last_bunk_count = incr_bunk_sp.getInt("bunk_count", 0);
edit_bunk_counter.putInt("bunk_count", (last_bunk_count+1));
edit_bunk_counter.commit();
}
@Override
public void onBackPressed() {
go_to_home();
}
private void go_to_home() {
Intent home_screen = new Intent(AutoUpdateBunkMeter.this, AppHome.class);
home_screen.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(home_screen);
finish();
}
}
| [
"[email protected]"
] | |
4b2e57018c258486b9af2177d746fa41f1d8b1f5 | d049893e680f6f7736748459a2bcd0d2f52be645 | /Lp-common/src/main/java/com/lp/rpc/domain/LpRequest.java | f7e5c8447a5f991fab2af6e7193a17c47b8da0cf | [
"MIT"
] | permissive | steakliu/Lp-Rpc | c3337c9d5ee3166df6523833769cf574637d5b22 | 6616190763c2e3006d486bbf8bec1f1d81162ff0 | refs/heads/master | 2023-07-16T10:20:28.297058 | 2021-08-31T09:26:40 | 2021-08-31T09:26:40 | 399,060,021 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 410 | java | package com.lp.rpc.domain;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@Setter
@Getter
@ToString
public class LpRequest implements Serializable {
private String requestId;
private String className;
private String methodName;
private Class<?>[] paramTypes;
private Object[] params;
}
| [
"[email protected]"
] | |
37f4bae5b07c77df33a8aa5820e48ac37db34af0 | 6e0fe0c6b38e4647172259d6c65c2e2c829cdbc5 | /modules/base/indexing-impl/src/main/java/com/intellij/psi/search/GlobalSearchScopeUtil.java | 77549114f739be90bedfd219d6651f8ce0d11db9 | [
"Apache-2.0",
"LicenseRef-scancode-jgraph"
] | permissive | TCROC/consulo | 3f9a6df84e0fbf2b6211457b8a5f5857303b3fa6 | cda24a03912102f916dc06ffce052892a83dd5a7 | refs/heads/master | 2023-01-30T13:19:04.216407 | 2020-12-06T16:57:00 | 2020-12-06T16:57:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,115 | java | /*
* Copyright 2000-2016 JetBrains s.r.o.
*
* 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.intellij.psi.search;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Computable;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.util.containers.ContainerUtil;
import javax.annotation.Nonnull;
import java.util.LinkedHashSet;
import java.util.Set;
public class GlobalSearchScopeUtil {
@Nonnull
public static GlobalSearchScope toGlobalSearchScope(@Nonnull final SearchScope scope, @Nonnull Project project) {
if (scope instanceof GlobalSearchScope) {
return (GlobalSearchScope)scope;
}
return ApplicationManager.getApplication()
.runReadAction((Computable<GlobalSearchScope>)() -> GlobalSearchScope.filesScope(project, getLocalScopeFiles((LocalSearchScope)scope)));
}
@Nonnull
public static Set<VirtualFile> getLocalScopeFiles(@Nonnull final LocalSearchScope scope) {
return ApplicationManager.getApplication().runReadAction((Computable<Set<VirtualFile>>)() -> {
Set<VirtualFile> files = new LinkedHashSet<>();
for (PsiElement element : scope.getScope()) {
PsiFile file = element.getContainingFile();
if (file != null) {
ContainerUtil.addIfNotNull(files, file.getVirtualFile());
ContainerUtil.addIfNotNull(files, file.getNavigationElement().getContainingFile().getVirtualFile());
}
}
return files;
});
}
}
| [
"[email protected]"
] | |
2afa6a613554c962922c41bf20c19a382a01e0a7 | 3ba7ac115976d891a041a58cad53e4be0beb7c50 | /src/org/rs2server/rs2/packet/InspectPacket.java | 2be9c513b69eec6c42a7c07a336a6baaab776767 | [
"MIT"
] | permissive | Hueyrs/GAPOOoapskpogaskpokpogkpogPOKAGKPgkpgsakpagkpoagokpgokpgakpopoagskgassasasagg | 8a27c1970dde36c67057c25d1810e32e91878039 | c568043e36b7051eee3865df73dfe6c24caf3595 | refs/heads/master | 2021-01-19T10:20:08.984644 | 2012-01-01T16:50:35 | 2012-01-01T16:50:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 352 | java | package org.rs2server.rs2.packet;
import org.rs2server.rs2.model.Player;
import org.rs2server.rs2.net.Packet;
public class InspectPacket implements PacketHandler {
@Override
public void handle(Player player, Packet packet) {
player.getActionSender().sendMessage("Your dragonfire shield currently has: " + player.dfsCharges + " charge(s)");
}
}
| [
"[email protected]"
] | |
0735e56c93f3340a8a01cf5e0629b57fcbf593b3 | 9194befd6b5b1ed427ba8553d49da36c9efc0da4 | /src/main/java/com/memsource/demotestproject/config/MemsourceConfig.java | 7c742484b5cec719839e640461e1a3a3a1e0686e | [] | no_license | Jahom55/memsource-demo | 87d6c4a3ca7649acd8dd549e5e0f7a9d7a334788 | 810288a1ba7b871996516a9896f6d5fda84abd40 | refs/heads/master | 2023-06-22T17:03:14.019289 | 2020-08-10T13:25:59 | 2020-08-10T13:36:31 | 286,481,997 | 0 | 0 | null | 2023-06-19T17:08:31 | 2020-08-10T13:24:16 | Java | UTF-8 | Java | false | false | 740 | java | package com.memsource.demotestproject.config;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
@Component
@Data
@AllArgsConstructor
@NoArgsConstructor
@Configuration
@ConfigurationProperties("memsource")
public class MemsourceConfig {
private String baseUrl;
private String loginUrl;
private String projectsUrl;
private Login login;
@Data
@AllArgsConstructor
@NoArgsConstructor
public static class Login {
private String username;
private String password;
}
}
| [
"[email protected]"
] | |
41cc0ad9a4a22d67476992e15084dd29613ec6e9 | 53f0e22b43c624dae0b5d46d0fc4bca1f089cb67 | /addressbook-web-tests/src/test/java/ru/stqa/pft/addressbook/tests/ContactMailTests.java | 85aac915c7e464cc71e1a7c5b9698ac3fa2e1102 | [
"Apache-2.0"
] | permissive | SweetyDonut/java_pft | da9f78b4b09f5849e821d13bd17b06a54e8d191e | 777994895029b7aed0983c6458e6da57d542a5ae | refs/heads/master | 2021-01-19T19:15:22.434055 | 2017-06-16T20:58:57 | 2017-06-16T20:58:57 | 88,408,935 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,170 | java | package ru.stqa.pft.addressbook.tests;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import ru.stqa.pft.addressbook.model.ContactData;
import java.util.Arrays;
import java.util.stream.Collectors;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.*;
/**
* Created by Даниил on 10.06.2017.
*/
public class ContactMailTests extends TestBase {
@BeforeMethod
public void ensurePreconditions() {
app.goTo().HomePage();
if (app.contact().all().size() == 0) {
app.contact().create(new ContactData().withFirstname("Danil").withLastname("Babin"));
}
}
@Test
public void testContactMail(){
ContactData contact = app.contact().all().iterator().next();
ContactData contactInfoFromEditor = app.contact().infoFromEditForm(contact);
assertThat(contact.getAllMails(), equalTo(getMergeMails(contactInfoFromEditor)));
}
private String getMergeMails(ContactData contact) {
return Arrays.asList(contact.getMail(),contact.getMail2(),contact.getMail3())
.stream().filter((s -> !s.equals("")))
.collect(Collectors.joining("\n"));
}
}
| [
"[email protected]"
] | |
2f7516eab7a96f379fb46f965cfc802cdacf5f60 | e380a3272dd6bbcf85add30dca25f072e1ef0ca2 | /src/org/vanda/workflows/hyper/SyntaxAnalysis.java | ee3f92e59e385dc71324c7143a2b67582745bb1b | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | mbuechse/vanda-studio | 52b3aa7164d7998b096e415cc1ce37541e277053 | 4e9d3545304d02c9656c80cdcda1dc7b9875883c | refs/heads/master | 2020-05-06T14:04:40.065781 | 2019-03-13T07:33:53 | 2019-03-13T07:33:53 | 180,171,443 | 0 | 0 | BSD-3-Clause | 2019-04-08T14:51:01 | 2019-04-08T14:51:01 | null | UTF-8 | Java | false | false | 1,759 | java | package org.vanda.workflows.hyper;
import java.util.Collections;
import java.util.Comparator;
import java.util.Map;
import org.vanda.types.Type;
import org.vanda.util.MultiplexObserver;
import org.vanda.workflows.hyper.TopSorter.TopSortException;
/**
* Performs type checking and topological sorting of a Workflow, and stores the results
* @author kgebhardt
*
*/
public class SyntaxAnalysis {
private MutableWorkflow hwf;
private Map<Object, Type> types = Collections.emptyMap();
private Type fragmentType = null;
private MultiplexObserver<SyntaxAnalysis> syntaxChangedObservable;
protected Job[] sorted = null;
private final Comparator<Job> priorities;
public SyntaxAnalysis(MutableWorkflow hwf, Comparator<Job> priorities) {
this.hwf = hwf;
this.priorities = priorities;
syntaxChangedObservable = new MultiplexObserver<SyntaxAnalysis>();
try {
checkWorkflow();
} catch (Exception e) {
// do nothing
}
}
public SyntaxAnalysis(MutableWorkflow hwf) {
this(hwf, null);
}
public void typeCheck() throws TypeCheckingException {
TypeChecker tc = new TypeChecker();
hwf.typeCheck(tc);
tc.check();
types = tc.getTypes();
fragmentType = tc.getFragmentType();
}
public void checkWorkflow() throws TypeCheckingException, TopSortException {
sorted = null;
typeCheck();
if (priorities != null)
sorted = hwf.getSorted(priorities);
else
sorted = hwf.getSorted();
syntaxChangedObservable.notify(this);
}
public Job[] getSorted() {
return sorted;
}
public Type getFragmentType() {
return fragmentType;
}
public Type getType(Object variable) {
return types.get(variable);
}
public MultiplexObserver<SyntaxAnalysis> getSyntaxChangedObservable() {
return syntaxChangedObservable;
}
}
| [
"[email protected]"
] | |
7a1bf43438dab337727bcc1051969043d660c0d6 | cef6fd979b7b9723460ee30e5f5cdbb306c6c0f9 | /src/ParticleArray.java | 01afeb316668de127a09c3cab9cfa52779fb7378 | [] | no_license | roboman2444/nbody | 1860a8383525d8d388ce6edd3a69735585ddf794 | 1a0586a3d810ff354779b3ff0cc6da79a36c1228 | refs/heads/master | 2020-08-25T03:30:13.630497 | 2013-07-29T02:38:56 | 2013-07-29T02:38:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,955 | java |
public class ParticleArray {
public static float[] posx;
public static float[] posy;
public static float[] posz;
public static float[] velx;
public static float[] vely;
public static float[] velz;
public static float[] colr;
public static float[] colb;
public static float[] colg;
public static float[] mass;
public static int[] suns = new int[2];
public static void spawnSun(int i){
suns[0] = i;
posx[i] = 0f;
posy[i] = 0f;
posz[i] = 0f;
velx[i] = 0f;
vely[i] = 0f;
velz[i] = 0f;
mass[i] = 100f;
}
public static void spawnSun2(int i){
suns[1] = i;
posx[i] = 21f;
posy[i] = 20f;
posz[i] = 2f;
velx[i] = -0.01f;
vely[i] = -0.01f;
velz[i] = 0f;
mass[i] = 200f;
}
public static void spawnGalaxy(int n){
for(int i=0;i < n; i++){
velx[i] = 0.0f;
vely[i] = 0.0f;
velx[i] += (float) -(posy[i]/50);
vely[i] += (float) (posx[i]/50);
velz[i] = 0.0f;
posz[i] = 0.0f;
}
}
public static void spawnGalaxy2(int n){
for(int i=0;i < n; i++){
velx[i] = -0.01f;
vely[i] = -0.01f;
velx[i] += (float) -(posy[i]/30);
vely[i] += (float) (posx[i]/30);
velz[i] = 0.0f;
posz[i] = 0.0f;
posx[i] += 21;
posy[i] += 20;
posz[i] += 2;
}
}
public static void spawnParticleRandom(int n){
posx = new float[n];
posy = new float[n];
posz = new float[n];
velx = new float[n];
vely = new float[n];
velz = new float[n];
colr = new float[n];
colb = new float[n];
colg = new float[n];
mass = new float[n];
for(int i=0;i < n; i++){
posx[i] = (float) (Math.random()-0.5);
posy[i] = (float) (Math.random()-0.5);
posz[i] = (float) (Math.random()-0.5);
velx[i] = (float) ((Math.random()-0.5)/500);
vely[i] = (float) ((Math.random()-0.5)/500);
velz[i] = (float) ((Math.random()-0.5)/500);
colr[i] = (float) (Math.random());
colg[i] = (float) (Math.random());
colb[i] = (float) (Math.random());
mass[i] = (float) (Math.random());
}
}
public static void getnBodyVelocityChange(float timescale,int p){
float acceleration, deltax, deltay, deltaz, distance;
for(int i=0; i< nbody.numberofparticles; i++){
if(i == p) continue;//dont do crackulations against self
deltax = posx[p] - posx[i];
deltay = posy[p] - posy[i];
deltaz = posz[p] - posz[i];
//distance = (float) Math.sqrt(Math.pow(deltax, 2)+Math.pow(deltay, 2)+Math.pow(deltaz, 2)); // shits SLOW
distance = (float) Math.sqrt((deltax * deltax)+(deltay*deltay)+(deltaz*deltaz));
acceleration = (mass[i] / (distance))/10000000;
velx[p] -= (deltax/distance) * acceleration;
vely[p] -= (deltay/distance) * acceleration;
velz[p] -= (deltaz/distance) * acceleration;
}
}
public static void updatePositions(float timescale, int p){
posx[p] += velx[p]*timescale;
posy[p] += vely[p]*timescale;
posz[p] += velz[p]*timescale;
}
}
| [
"[email protected]"
] | |
fc2e4a872326d6de28546defab4202fb2f7db380 | 9ff81eac90a3cfcb6bc4e4d174cb324c29b73464 | /CCF_Java/src/_2017/_12/_1/Main.java | a15717fbb62c05cc7b1f0d265067534ae865f007 | [] | no_license | shuxiaoyuan/CCF_Java | 37d12f33499f03a8af57973c9770e953bf6ed37c | 048fe752518f26b5ac16d38b2cbcbad50828e0a1 | refs/heads/master | 2020-03-27T23:49:17.298742 | 2018-09-08T11:31:24 | 2018-09-08T11:31:24 | 147,349,380 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 654 | java | package _2017._12._1;
import java.util.Arrays;
import java.util.Scanner;
// 最小差值
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] nums = new int[n];
for(int i = 0; i < n; i++) {
nums[i] = sc.nextInt();
}
Arrays.sort(nums);
int res = 10000;
for(int i = 0; i < n-1; i++) {
int diff = nums[i+1] - nums[i];
if(diff < res) {
res = diff;
}
}
System.out.println(res);
sc.close();
}
}
| [
"[email protected]"
] | |
36268266e348ed4c4fe4a7cb681cc78f356e1678 | d0c2e07934c3f8c8a13d9bcfdbd7afb8715dc341 | /3-spring/projects/conferene-spring/src/main/java/dev/syscode/conference/repository/SpeakerRepository.java | abd21dc8d4b33583de2ce8ec973e9ffaddce57d0 | [] | no_license | gnujavasergio/spring-experiments | 5cc5ddc41ed7f89a91610a4cf7588570790983ee | 1c133ae7f1e3c1d61ae87f05d69ac25e7ca96732 | refs/heads/master | 2022-09-01T10:14:00.235661 | 2022-08-11T15:43:53 | 2022-08-11T15:43:53 | 250,904,395 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 179 | java | package dev.syscode.conference.repository;
import dev.syscode.conference.model.Speaker;
import java.util.List;
public interface SpeakerRepository {
List<Speaker> findAll();
}
| [
"[email protected]"
] | |
ee7349e22b2700fcb4d1ee0f9ee767990797af7c | 1bbc5c34520b3fa1992994441d475d3c25544f1f | /src/Sistem/makePreview.java | a03977ed14eaaa44fe7f38b3f1ed77bb02bda738 | [] | no_license | fidiarya/inventory_telkom_akses | 7a93d15e1576794a0bd274ab8f553fdeaae561f2 | d99e06f6db494a1b56e90661cb7fbd944516f87e | refs/heads/master | 2023-02-18T05:14:01.498242 | 2021-01-23T12:58:35 | 2021-01-23T12:58:35 | 317,589,864 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,445 | java |
package Sistem;
import java.io.File;
import java.sql.Connection;
import java.util.HashMap;
import javax.swing.JOptionPane;
import mainkoneksi.Koneksi;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.util.JRLoader;
import net.sf.jasperreports.view.JasperViewer;
public class makePreview {
public void makePreview (String vName){
try {
String KopLaporan = getClass().getResource("/IMG/icon_telkom.png").toString();
// String User = getClass().getResource("txUser.getText()").toString();
String locFile = "src/report/";
String namaFile = locFile + vName + ".jasper";
Connection conn = new Koneksi().connect();
HashMap parameter = new HashMap();
parameter.put("Logo", KopLaporan);
// parameter.put("txUser", User);
File report_file = new File (namaFile);
JasperReport jasperReport = (JasperReport) JRLoader.loadObject(report_file.getPath());
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameter, conn);
JasperViewer.viewReport(jasperPrint, false );
JasperViewer.setDefaultLookAndFeelDecorated(true);
} catch (Exception e){
JOptionPane.showMessageDialog(null, e.getMessage());
}
}
}
| [
"[email protected]"
] | |
20fc940480d035031a937c0b6a30c18a6514608b | 3a82fbfd7550f1a5f979d4a4e7c9b28070395c43 | /app/src/test/java/com/appsmontreal/menu2/ExampleUnitTest.java | ebdee468cabf48aa3a69403c5f00c958987ccee3 | [] | no_license | michukanyto/Menu | 81b850fd04adcb5603acf5fc0f140cabaaf301c2 | 08de108a69c68ee75297ffbae71c26980127d305 | refs/heads/master | 2020-04-22T18:53:10.406470 | 2019-02-14T21:31:41 | 2019-02-14T21:31:41 | 170,590,570 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package com.appsmontreal.menu2;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
cb7388253c2d3e7d98740fc96bf637d5bc7cae3b | 505445050d68cd1bcb63c1b38fc88c0dacc3de10 | /admin/src/main/java/com/aojiaoo/core/shiro/realm/DbRealm.java | 31dcc857bbf04e3363f06b8e71c199f44a3d9c9a | [] | no_license | puremdq/kissPlan | 03b0e7f7c1eb0c862a151c84807d06468a372729 | 53a728cc911ac5e1249f139cd5517debd4e26205 | refs/heads/master | 2022-12-24T17:30:12.266260 | 2019-07-04T01:58:22 | 2019-07-04T01:58:22 | 157,180,418 | 1 | 0 | null | 2022-12-15T23:52:15 | 2018-11-12T08:29:45 | Java | UTF-8 | Java | false | false | 2,675 | java | package com.aojiaoo.core.shiro.realm;
import com.aojiaoo.modules.sys.entity.User;
import com.aojiaoo.modules.sys.service.UserService;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.shiro.authc.*;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
public class DbRealm extends AuthorizingRealm {
@Autowired
UserService userService;
/*授权时使用*/
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) {
// 从 principals获取主身份信息
// 将getPrimaryPrincipal方法返回值转为真实身份类型(在上边的doGetAuthenticationInfo认证通过填充到SimpleAuthenticationInfo中身份类型),
User user = (User) principalCollection.getPrimaryPrincipal();
System.out.println(user);
// 根据身份信息获取权限信息
// 连接数据库...
// 模拟从数据库获取到数据
List<String> permissions = new ArrayList<String>();
permissions.add("user:create");// 用户的创建
permissions.add("items:add");// 商品添加权限
// ....
// 查到权限数据,返回授权信息(要包括 上边的permissions)
SimpleAuthorizationInfo simpleAuthorizationInfo = new SimpleAuthorizationInfo();
// 将上边查询到授权信息填充到simpleAuthorizationInfo对象中
simpleAuthorizationInfo.addStringPermissions(permissions);
simpleAuthorizationInfo.addRole("sd");
return simpleAuthorizationInfo;
}
/*登录时调用*/
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException {
//1.把AuthenticationToken转换为UsernamePasswordToken
UsernamePasswordToken userToken = (UsernamePasswordToken) authenticationToken;
User user = userService.getByUserName(userToken.getUsername());
//若用户不行存在,可以抛出UnknownAccountException
if (user == null) {
throw new UnknownAccountException("用户不存在");
}
String afterMd5Password = DigestUtils.md5Hex(String.valueOf(userToken.getPassword()) + user.getSalt());
userToken.setPassword(afterMd5Password.toCharArray());
return new SimpleAuthenticationInfo(user, user.getPassword(), getName());
}
}
| [
"[email protected]"
] | |
c08e5d5fb066e8a3f3b7ab3f6843aaa54c06b181 | 493d1f3ae87bcdb7705621b511653d844b4e7e80 | /src/main/java/org/ocr/service/UserService.java | b748e02031fa6e0821303abbe60b5b8495cff4d4 | [] | no_license | BulkSecurityGeneratorProject/ocr-app | e06c3370ce3aa2fa9ab426d618fcd67edb3e1c0a | e3a7617d15ab25a3f40a670b4c3177a8d355d2aa | refs/heads/master | 2022-12-13T17:52:53.492414 | 2017-07-01T21:04:06 | 2017-07-01T21:04:06 | 296,647,021 | 0 | 0 | null | 2020-09-18T14:38:34 | 2020-09-18T14:38:34 | null | UTF-8 | Java | false | false | 9,186 | java | package org.ocr.service;
import org.ocr.domain.Authority;
import org.ocr.domain.User;
import org.ocr.repository.AuthorityRepository;
import org.ocr.config.Constants;
import org.ocr.repository.UserRepository;
import org.ocr.security.AuthoritiesConstants;
import org.ocr.security.SecurityUtils;
import org.ocr.service.util.RandomUtil;
import org.ocr.service.dto.UserDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
/**
* Service class for managing users.
*/
@Service
@Transactional
public class UserService {
private final Logger log = LoggerFactory.getLogger(UserService.class);
private final UserRepository userRepository;
private final PasswordEncoder passwordEncoder;
private final AuthorityRepository authorityRepository;
public UserService(UserRepository userRepository, PasswordEncoder passwordEncoder, AuthorityRepository authorityRepository) {
this.userRepository = userRepository;
this.passwordEncoder = passwordEncoder;
this.authorityRepository = authorityRepository;
}
public Optional<User> activateRegistration(String key) {
log.debug("Activating user for activation key {}", key);
return userRepository.findOneByActivationKey(key)
.map(user -> {
// activate given user for the registration key.
user.setActivated(true);
user.setActivationKey(null);
log.debug("Activated user: {}", user);
return user;
});
}
public Optional<User> completePasswordReset(String newPassword, String key) {
log.debug("Reset user password for reset key {}", key);
return userRepository.findOneByResetKey(key)
.filter(user -> user.getResetDate().isAfter(Instant.now().minusSeconds(86400)))
.map(user -> {
user.setPassword(passwordEncoder.encode(newPassword));
user.setResetKey(null);
user.setResetDate(null);
return user;
});
}
public Optional<User> requestPasswordReset(String mail) {
return userRepository.findOneByEmail(mail)
.filter(User::getActivated)
.map(user -> {
user.setResetKey(RandomUtil.generateResetKey());
user.setResetDate(Instant.now());
return user;
});
}
public User createUser(String login, String password, String firstName, String lastName, String email,
String imageUrl, String langKey) {
User newUser = new User();
Authority authority = authorityRepository.findOne(AuthoritiesConstants.USER);
Set<Authority> authorities = new HashSet<>();
String encryptedPassword = passwordEncoder.encode(password);
newUser.setLogin(login);
// new user gets initially a generated password
newUser.setPassword(encryptedPassword);
newUser.setFirstName(firstName);
newUser.setLastName(lastName);
newUser.setEmail(email);
newUser.setImageUrl(imageUrl);
newUser.setLangKey(langKey);
// new user is not active
newUser.setActivated(false);
// new user gets registration key
newUser.setActivationKey(RandomUtil.generateActivationKey());
authorities.add(authority);
newUser.setAuthorities(authorities);
userRepository.save(newUser);
log.debug("Created Information for User: {}", newUser);
return newUser;
}
public User createUser(UserDTO userDTO) {
User user = new User();
user.setLogin(userDTO.getLogin());
user.setFirstName(userDTO.getFirstName());
user.setLastName(userDTO.getLastName());
user.setEmail(userDTO.getEmail());
user.setImageUrl(userDTO.getImageUrl());
if (userDTO.getLangKey() == null) {
user.setLangKey("en"); // default language
} else {
user.setLangKey(userDTO.getLangKey());
}
if (userDTO.getAuthorities() != null) {
Set<Authority> authorities = new HashSet<>();
userDTO.getAuthorities().forEach(
authority -> authorities.add(authorityRepository.findOne(authority))
);
user.setAuthorities(authorities);
}
String encryptedPassword = passwordEncoder.encode(RandomUtil.generatePassword());
user.setPassword(encryptedPassword);
user.setResetKey(RandomUtil.generateResetKey());
user.setResetDate(Instant.now());
user.setActivated(true);
userRepository.save(user);
log.debug("Created Information for User: {}", user);
return user;
}
/**
* Update basic information (first name, last name, email, language) for the current user.
*
* @param firstName first name of user
* @param lastName last name of user
* @param email email id of user
* @param langKey language key
* @param imageUrl image URL of user
*/
public void updateUser(String firstName, String lastName, String email, String langKey, String imageUrl) {
userRepository.findOneByLogin(SecurityUtils.getCurrentUserLogin()).ifPresent(user -> {
user.setFirstName(firstName);
user.setLastName(lastName);
user.setEmail(email);
user.setLangKey(langKey);
user.setImageUrl(imageUrl);
log.debug("Changed Information for User: {}", user);
});
}
/**
* Update all information for a specific user, and return the modified user.
*
* @param userDTO user to update
* @return updated user
*/
public Optional<UserDTO> updateUser(UserDTO userDTO) {
return Optional.of(userRepository
.findOne(userDTO.getId()))
.map(user -> {
user.setLogin(userDTO.getLogin());
user.setFirstName(userDTO.getFirstName());
user.setLastName(userDTO.getLastName());
user.setEmail(userDTO.getEmail());
user.setImageUrl(userDTO.getImageUrl());
user.setActivated(userDTO.isActivated());
user.setLangKey(userDTO.getLangKey());
Set<Authority> managedAuthorities = user.getAuthorities();
managedAuthorities.clear();
userDTO.getAuthorities().stream()
.map(authorityRepository::findOne)
.forEach(managedAuthorities::add);
log.debug("Changed Information for User: {}", user);
return user;
})
.map(UserDTO::new);
}
public void deleteUser(String login) {
userRepository.findOneByLogin(login).ifPresent(user -> {
userRepository.delete(user);
log.debug("Deleted User: {}", user);
});
}
public void changePassword(String password) {
userRepository.findOneByLogin(SecurityUtils.getCurrentUserLogin()).ifPresent(user -> {
String encryptedPassword = passwordEncoder.encode(password);
user.setPassword(encryptedPassword);
log.debug("Changed password for User: {}", user);
});
}
@Transactional(readOnly = true)
public Page<UserDTO> getAllManagedUsers(Pageable pageable) {
return userRepository.findAllByLoginNot(pageable, Constants.ANONYMOUS_USER).map(UserDTO::new);
}
@Transactional(readOnly = true)
public Optional<User> getUserWithAuthoritiesByLogin(String login) {
return userRepository.findOneWithAuthoritiesByLogin(login);
}
@Transactional(readOnly = true)
public User getUserWithAuthorities(Long id) {
return userRepository.findOneWithAuthoritiesById(id);
}
@Transactional(readOnly = true)
public User getUserWithAuthorities() {
return userRepository.findOneWithAuthoritiesByLogin(SecurityUtils.getCurrentUserLogin()).orElse(null);
}
/**
* Not activated users should be automatically deleted after 3 days.
* <p>
* This is scheduled to get fired everyday, at 01:00 (am).
* </p>
*/
@Scheduled(cron = "0 0 1 * * ?")
public void removeNotActivatedUsers() {
List<User> users = userRepository.findAllByActivatedIsFalseAndCreatedDateBefore(Instant.now().minus(3, ChronoUnit.DAYS));
for (User user : users) {
log.debug("Deleting not activated user {}", user.getLogin());
userRepository.delete(user);
}
}
/**
* @return a list of all the authorities
*/
public List<String> getAuthorities() {
return authorityRepository.findAll().stream().map(Authority::getName).collect(Collectors.toList());
}
}
| [
"[email protected]"
] | |
f9a2835285a855d8fa7c9fd9f40d325da9afbf34 | 57beb16f196058dcbc59888199494cf3d5277509 | /Modul_3_String_and_basics_of_text_processing/src/m_2_object_String_or_StringBuilder/Task_03.java | 9ec30a3eaa2cb75ce00786a95076b678dc996e23 | [] | no_license | P1ethora/EPAM_training_online | 65db496a912ce248531ff95df9524a69942f789b | 1eae98f2cd78179a187c653881f6365a28890a6a | refs/heads/master | 2021-05-20T12:28:06.822019 | 2020-11-02T21:14:19 | 2020-11-02T21:14:19 | 252,541,845 | 9 | 3 | null | null | null | null | UTF-8 | Java | false | false | 671 | java | package m_2_object_String_or_StringBuilder;
/**
* Проверить, является ли заданное слово палиндромом.
*/
public class Task_03 {
public static void main(String[] args) {
String word = "level",
word1 = "java",
word2 = "noon";
System.out.println(check(word) + "\n" + check(word1) + "\n" + check(word2));
}
private static boolean check(String text) {
while (text.length() > 1) {
if (!text.endsWith(text.substring(0, 1)))
return false;
text = text.substring(1, text.length() - 1);
}
return true;
}
} | [
"[email protected]"
] | |
fde02b3b39cbac8d4a8171acb6ffd13262c69ed3 | ad25232967a408cd58d1e3c49b939884f165a6c3 | /app/src/main/java/baidumapsdk/demo/mybaidumap/PoiSearchDemo.java | b84556bc69ab405f0ef888bcb57dda60c99229a7 | [] | no_license | aliliqu/BaiduMapsORTuYa | 1951187b014447ca659783411c0abfccc118e98e | 237ffa43ad56b459768544958c775a8d1be0bad4 | refs/heads/master | 2021-01-17T22:23:08.952504 | 2016-06-30T08:08:44 | 2016-06-30T08:08:50 | 62,290,265 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,653 | java | package baidumapsdk.demo.mybaidumap;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.EditText;
import android.widget.Toast;
import com.baidu.mapapi.map.BaiduMap;
import com.baidu.mapapi.map.BitmapDescriptor;
import com.baidu.mapapi.map.BitmapDescriptorFactory;
import com.baidu.mapapi.map.CircleOptions;
import com.baidu.mapapi.map.GroundOverlayOptions;
import com.baidu.mapapi.map.MapStatusUpdate;
import com.baidu.mapapi.map.MapStatusUpdateFactory;
import com.baidu.mapapi.map.MarkerOptions;
import com.baidu.mapapi.map.OverlayOptions;
import com.baidu.mapapi.map.Stroke;
import com.baidu.mapapi.map.SupportMapFragment;
import com.baidu.mapapi.model.LatLng;
import com.baidu.mapapi.model.LatLngBounds;
import com.baidu.mapapi.overlayutil.PoiOverlay;
import com.baidu.mapapi.search.core.CityInfo;
import com.baidu.mapapi.search.core.PoiInfo;
import com.baidu.mapapi.search.core.SearchResult;
import com.baidu.mapapi.search.poi.OnGetPoiSearchResultListener;
import com.baidu.mapapi.search.poi.PoiBoundSearchOption;
import com.baidu.mapapi.search.poi.PoiCitySearchOption;
import com.baidu.mapapi.search.poi.PoiDetailResult;
import com.baidu.mapapi.search.poi.PoiDetailSearchOption;
import com.baidu.mapapi.search.poi.PoiIndoorResult;
import com.baidu.mapapi.search.poi.PoiNearbySearchOption;
import com.baidu.mapapi.search.poi.PoiResult;
import com.baidu.mapapi.search.poi.PoiSearch;
import com.baidu.mapapi.search.poi.PoiSortType;
import com.baidu.mapapi.search.sug.OnGetSuggestionResultListener;
import com.baidu.mapapi.search.sug.SuggestionResult;
import com.baidu.mapapi.search.sug.SuggestionSearch;
import com.baidu.mapapi.search.sug.SuggestionSearchOption;
import java.util.ArrayList;
import java.util.List;
import baidumapsdk.demo.R;
/**
* 演示poi搜索功能
*/
public class PoiSearchDemo extends FragmentActivity implements
OnGetPoiSearchResultListener, OnGetSuggestionResultListener {
private PoiSearch mPoiSearch = null;
private SuggestionSearch mSuggestionSearch = null;
private BaiduMap mBaiduMap = null;
private List<String> suggest;
/**
* 搜索关键字输入窗口
*/
//搜索城市 输入框
private EditText editCity = null;
//根据输入文字更改的
private AutoCompleteTextView keyWorldsView = null;
private ArrayAdapter<String> sugAdapter = null;
private int loadIndex = 0;
//
LatLng center = new LatLng(39.92235, 116.380338);
int radius = 500;
LatLng southwest = new LatLng( 39.92235, 116.380338 );
LatLng northeast = new LatLng( 39.947246, 116.414977);
LatLngBounds searchbound = new LatLngBounds.Builder().include(southwest).include(northeast).build();
int searchType = 0; // 搜索的类型,在显示时区分
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_poisearch);
// 初始化搜索模块,
mPoiSearch = PoiSearch.newInstance();
//注册搜索事件监听
mPoiSearch.setOnGetPoiSearchResultListener(this);
// 初始化建议搜索模块
mSuggestionSearch = SuggestionSearch.newInstance();
//注册建议搜索事件监听
mSuggestionSearch.setOnGetSuggestionResultListener(this);
editCity = (EditText) findViewById(R.id.city);
keyWorldsView = (AutoCompleteTextView) findViewById(R.id.searchkey);
sugAdapter = new ArrayAdapter<String>(this,
android.R.layout.simple_dropdown_item_1line);
keyWorldsView.setAdapter(sugAdapter);
keyWorldsView.setThreshold(1);
mBaiduMap = ((SupportMapFragment) (getSupportFragmentManager()
.findFragmentById(R.id.map))).getBaiduMap();
/**
* 当输入关键字变化时,动态更新建议列表
*/
keyWorldsView.addTextChangedListener(new TextWatcher() {
@Override
public void afterTextChanged(Editable arg0) {
}
@Override
public void beforeTextChanged(CharSequence arg0, int arg1,
int arg2, int arg3) {
}
@Override
public void onTextChanged(CharSequence cs, int arg1, int arg2,
int arg3) {
if (cs.length() <= 0) {
return;
}
/**
* 使用建议搜索服务获取建议列表,结果在onSuggestionResult()中更新
*/
mSuggestionSearch
.requestSuggestion((new SuggestionSearchOption())
.keyword(cs.toString()).city(editCity.getText().toString()));
}
});
}
@Override
protected void onPause() {
super.onPause();
}
@Override
protected void onResume() {
super.onResume();
}
@Override
protected void onDestroy() {
mPoiSearch.destroy();
mSuggestionSearch.destroy();
super.onDestroy();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
}
/**
* 响应城市内搜索按钮点击事件
*
* @param v
*/
public void searchButtonProcess(View v) {
searchType = 1;
String citystr = editCity.getText().toString();
String keystr = keyWorldsView.getText().toString();
mPoiSearch.searchInCity((new PoiCitySearchOption())
.city(citystr).keyword(keystr).pageNum(loadIndex));
}
/**
* 响应周边搜索按钮点击事件
*
* @param v
*/
public void searchNearbyProcess(View v) {
searchType = 2;
PoiNearbySearchOption nearbySearchOption = new PoiNearbySearchOption().keyword(keyWorldsView.getText()
.toString()).sortType(PoiSortType.distance_from_near_to_far).location(center)
.radius(radius).pageNum(loadIndex);
mPoiSearch.searchNearby(nearbySearchOption);
}
public void goToNextPage(View v) {
loadIndex++;
searchButtonProcess(null);
}
/**
* 响应区域搜索按钮点击事件
*
* @param v
*/
public void searchBoundProcess(View v) {
searchType = 3;
mPoiSearch.searchInBound(new PoiBoundSearchOption().bound(searchbound)
.keyword(keyWorldsView.getText().toString()));
}
/**
* 获取POI搜索结果,包括searchInCity,searchNearby,searchInBound返回的搜索结果
* @param result
*/
public void onGetPoiResult(PoiResult result) {
if (result == null || result.error == SearchResult.ERRORNO.RESULT_NOT_FOUND) {
Toast.makeText(PoiSearchDemo.this, "未找到结果", Toast.LENGTH_LONG)
.show();
return;
}
if (result.error == SearchResult.ERRORNO.NO_ERROR) {
mBaiduMap.clear();
PoiOverlay overlay = new MyPoiOverlay(mBaiduMap);
mBaiduMap.setOnMarkerClickListener(overlay);
overlay.setData(result);
overlay.addToMap();
overlay.zoomToSpan();
switch( searchType ) {
case 2:
showNearbyArea(center, radius);
break;
case 3:
showBound(searchbound);
break;
default:
break;
}
return;
}
if (result.error == SearchResult.ERRORNO.AMBIGUOUS_KEYWORD) {
// 当输入关键字在本市没有找到,但在其他城市找到时,返回包含该关键字信息的城市列表
String strInfo = "在";
for (CityInfo cityInfo : result.getSuggestCityList()) {
strInfo += cityInfo.city;
strInfo += ",";
}
strInfo += "找到结果";
Toast.makeText(PoiSearchDemo.this, strInfo, Toast.LENGTH_LONG)
.show();
}
}
/**
* 获取POI详情搜索结果,得到searchPoiDetail返回的搜索结果
* @param result
*/
public void onGetPoiDetailResult(PoiDetailResult result) {
if (result.error != SearchResult.ERRORNO.NO_ERROR) {
Toast.makeText(PoiSearchDemo.this, "抱歉,未找到结果", Toast.LENGTH_SHORT)
.show();
} else {
Toast.makeText(PoiSearchDemo.this, result.getName() + ": " + result.getAddress(), Toast.LENGTH_SHORT)
.show();
}
}
@Override
public void onGetPoiIndoorResult(PoiIndoorResult poiIndoorResult) {
}
/**
* 获取在线建议搜索结果,得到requestSuggestion返回的搜索结果
* @param res
*/
@Override
public void onGetSuggestionResult(SuggestionResult res) {
if (res == null || res.getAllSuggestions() == null) {
return;
}
suggest = new ArrayList<String>();
for (SuggestionResult.SuggestionInfo info : res.getAllSuggestions()) {
if (info.key != null) {
suggest.add(info.key);
}
}
sugAdapter = new ArrayAdapter<String>(PoiSearchDemo.this, android.R.layout.simple_dropdown_item_1line, suggest);
keyWorldsView.setAdapter(sugAdapter);
sugAdapter.notifyDataSetChanged();
}
private class MyPoiOverlay extends PoiOverlay {
public MyPoiOverlay(BaiduMap baiduMap) {
super(baiduMap);
}
@Override
public boolean onPoiClick(int index) {
super.onPoiClick(index);
PoiInfo poi = getPoiResult().getAllPoi().get(index);
// if (poi.hasCaterDetails) {
mPoiSearch.searchPoiDetail((new PoiDetailSearchOption())
.poiUid(poi.uid));
// }
return true;
}
}
/**
* 对周边检索的范围进行绘制
* @param center
* @param radius
*/
public void showNearbyArea( LatLng center, int radius) {
BitmapDescriptor centerBitmap = BitmapDescriptorFactory
.fromResource(R.drawable.icon_geo);
MarkerOptions ooMarker = new MarkerOptions().position(center).icon(centerBitmap);
mBaiduMap.addOverlay(ooMarker);
OverlayOptions ooCircle = new CircleOptions().fillColor( 0xCCCCCC00 )
.center(center).stroke(new Stroke(5, 0xFFFF00FF ))
.radius(radius);
mBaiduMap.addOverlay(ooCircle);
}
/**
* 对区域检索的范围进行绘制
* @param bounds
*/
public void showBound( LatLngBounds bounds) {
BitmapDescriptor bdGround = BitmapDescriptorFactory
.fromResource(R.drawable.ground_overlay);
OverlayOptions ooGround = new GroundOverlayOptions()
.positionFromBounds(bounds).image(bdGround).transparency(0.8f);
mBaiduMap.addOverlay(ooGround);
MapStatusUpdate u = MapStatusUpdateFactory
.newLatLng(bounds.getCenter());
mBaiduMap.setMapStatus(u);
bdGround.recycle();
}
}
| [
"[email protected]"
] | |
3afd0c6b934590dbad2ed6d36106232dd619602f | ad6f19b13a42dbfef86ea68e2ca5ca66d701d2ff | /src/test/java/ADV/EMCO/login2.java | 5831e623f26e6b8a56998e422c33993d5478616b | [] | no_license | guptahitesh4u/Myfirst | 8cb1977f51008680fae8e4fc54abd0877f9bdca7 | 6815058ce62d9cdb3968d666ee3403a35a822593 | refs/heads/main | 2023-06-14T05:24:25.798625 | 2021-06-23T04:01:07 | 2021-06-23T04:01:07 | 378,562,834 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,073 | java | package ADV.EMCO;
import java.io.IOException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.openqa.selenium.WebDriver;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
public class login2 extends base {
WebDriver driver;
reusables reu=new reusables();
private static Logger log= LogManager.getLogger(login2.class.getName());
@BeforeTest
public void preTest() throws IOException
{
driver = initializeDriver();
driver.get(prop.getProperty("url"));
driver.manage().window().maximize();
log.info("URL Launched");
}
@Test
public void emcoLogin() throws IOException, IllegalArgumentException, IllegalAccessException {
driver=reu.emcoLogin(driver);
driver=reu.checkHeader(driver);
driver=reu.workspace(driver);
}
@Test
public void projectManagement() throws IOException, IllegalArgumentException, IllegalAccessException {
}
@AfterTest
public void teardown()
{
driver.close();
}
}
| [
"[email protected]"
] | |
ae0f06dc68fcec0b5728e7b5d53c927409bb6a54 | 93f44ee976fd6d1c42663e1fb0f72aed80c2dc89 | /Day0511MON/src/Person/President.java | 6fb02b0d200d7ac24d0251369b7fabd16fc16dbb | [] | no_license | jaedeokhan/dcusl-20-1-web-developer | 87a56fd70f8e17bad6af94ee3cb6fe19893dcf54 | 548b7f5dde4cf29999743680a29205652d353399 | refs/heads/master | 2022-10-16T23:40:10.284260 | 2020-06-19T15:07:43 | 2020-06-19T15:07:43 | 255,309,880 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 168 | java | package Person;
public class President extends Person{
@Override
public void showSleepingStyel() {
System.out.println("대통령도 그냥 사람이다.");
}
}
| [
"[email protected]"
] | |
68f815854a458bd6e3a82f976054eaa1dca8c863 | 58bb4736570e8692eede412afad3b64822eea742 | /src/main/java/com/yuqmettal/voting/entity/EmployeeVotesEntity.java | c5ed10ac80e9b1ea3082bed83e5096b95b84e830 | [] | no_license | yuqmettal/avalith-voting | 51a334a53fa1b43fdb20c08eb44bfa3850dd5d91 | d8ee9c05cedaaaf10fd075bb800a66df3f689c2a | refs/heads/master | 2022-10-23T20:26:18.833202 | 2020-06-09T21:14:46 | 2020-06-09T21:14:46 | 271,109,074 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,496 | java | package com.yuqmettal.voting.entity;
import javax.persistence.Entity;
import javax.persistence.Id;
import org.hibernate.annotations.Immutable;
import org.hibernate.annotations.Subselect;
@Entity
@Immutable
@Subselect("SELECT * from vote")
public class EmployeeVotesEntity {
@Id
Long id;
private String username;
private String name;
private int votes;
public EmployeeVotesEntity() {
}
public EmployeeVotesEntity(Long id, String username, String name, int votes) {
this.id = id;
this.username = username;
this.name = name;
this.votes = votes;
}
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public int getVotes() {
return this.votes;
}
public void setVotes(int votes) {
this.votes = votes;
}
public EmployeeVotesEntity username(String username) {
this.username = username;
return this;
}
public EmployeeVotesEntity name(String name) {
this.name = name;
return this;
}
public EmployeeVotesEntity votes(int votes) {
this.votes = votes;
return this;
}
} | [
"[email protected]"
] | |
b9bcef9b2b344ed7b6c151eab6a83e6743460da9 | 0e6616c9e79e75a5fa54d9cbb3f5da9a0e9e5e37 | /Cake.java | 2d1084818a4be9e1b1b0f8061bbe333fc8bad513 | [] | no_license | missaGuo/TaoGuo | 99855844a3cbbbdd54f7924fed78fbc74deac7c5 | 26974c256e6c3180cc66700478216142d94b8b9e | refs/heads/master | 2020-05-26T15:37:58.922958 | 2017-04-13T22:17:19 | 2017-04-13T22:17:19 | 85,011,281 | 1 | 1 | null | 2017-04-14T01:51:57 | 2017-03-15T00:36:18 | Java | UTF-8 | Java | false | false | 1,018 | java |
/**
* BakeItem program.
*
* Project9
* @author Tao Guo
* @version 4/13/2017
*/
public class Cake extends BakedItem {
protected int layers;
/**
* base rate.
*/
public static final double BASE_RATE = 8.0;
/**
* @param nameIn to name;
* @param flavorIn to flavor;
* @param quantityIn to quantity;
* @param layersIn to layers;
* @param ingredientsIn to ingredients;
*/
public Cake(String nameIn, String flavorIn, int quantityIn,
int layersIn, String ... ingredientsIn) {
super(nameIn, flavorIn, quantityIn, ingredientsIn);
layers = layersIn;
}
/**
* @return layers.
*/
public int getLayers() {
return layers;
}
/**
* @param layersIn to layers.
*/
public void setLayers(int layersIn) {
layers = layersIn;
}
/**
* @return price.
*/
public double price() {
return (BASE_RATE * layers) * quantity;
}
} | [
"[email protected]"
] | |
22ce34828ac2e4c17034eb8d0f914ec432d97e5a | 3a6c9d1dc936cd6596d686793cb973a97445db70 | /src/main/java/com/store/com/security/jwt/TokenProvider.java | 4ad294a13d757b24e373646677bc76ffdd3c1a4a | [] | no_license | ANDERSON1808/store | 7b3bb2f2781f852be8e5a25aa70c28c25e5ba934 | 5a2f67ef8ea50733448ca1c7f5a204fccd4a3395 | refs/heads/main | 2023-05-02T07:47:34.257298 | 2021-05-29T03:18:50 | 2021-05-29T03:18:50 | 371,864,498 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,214 | java | package com.store.com.security.jwt;
import java.nio.charset.StandardCharsets;
import java.security.Key;
import java.util.*;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import io.github.jhipster.config.JHipsterProperties;
import io.jsonwebtoken.*;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
@Component
public class TokenProvider {
private final Logger log = LoggerFactory.getLogger(TokenProvider.class);
private static final String AUTHORITIES_KEY = "auth";
private Key key;
private long tokenValidityInMilliseconds;
private long tokenValidityInMillisecondsForRememberMe;
private final JHipsterProperties jHipsterProperties;
public TokenProvider(JHipsterProperties jHipsterProperties) {
this.jHipsterProperties = jHipsterProperties;
}
@PostConstruct
public void init() {
byte[] keyBytes;
String secret = jHipsterProperties.getSecurity().getAuthentication().getJwt().getSecret();
if (!StringUtils.isEmpty(secret)) {
log.warn("Warning: the JWT key used is not Base64-encoded. " +
"We recommend using the `jhipster.security.authentication.jwt.base64-secret` key for optimum security.");
keyBytes = secret.getBytes(StandardCharsets.UTF_8);
} else {
log.debug("Using a Base64-encoded JWT secret key");
keyBytes = Decoders.BASE64.decode(jHipsterProperties.getSecurity().getAuthentication().getJwt().getBase64Secret());
}
this.key = Keys.hmacShaKeyFor(keyBytes);
this.tokenValidityInMilliseconds =
1000 * jHipsterProperties.getSecurity().getAuthentication().getJwt().getTokenValidityInSeconds();
this.tokenValidityInMillisecondsForRememberMe =
1000 * jHipsterProperties.getSecurity().getAuthentication().getJwt()
.getTokenValidityInSecondsForRememberMe();
}
public String createToken(Authentication authentication, boolean rememberMe) {
String authorities = authentication.getAuthorities().stream()
.map(GrantedAuthority::getAuthority)
.collect(Collectors.joining(","));
long now = (new Date()).getTime();
Date validity;
if (rememberMe) {
validity = new Date(now + this.tokenValidityInMillisecondsForRememberMe);
} else {
validity = new Date(now + this.tokenValidityInMilliseconds);
}
return Jwts.builder()
.setSubject(authentication.getName())
.claim(AUTHORITIES_KEY, authorities)
.signWith(key, SignatureAlgorithm.HS512)
.setExpiration(validity)
.compact();
}
public Authentication getAuthentication(String token) {
Claims claims = Jwts.parserBuilder()
.setSigningKey(key)
.build()
.parseClaimsJws(token)
.getBody();
Collection<? extends GrantedAuthority> authorities =
Arrays.stream(claims.get(AUTHORITIES_KEY).toString().split(","))
.map(SimpleGrantedAuthority::new)
.collect(Collectors.toList());
User principal = new User(claims.getSubject(), "", authorities);
return new UsernamePasswordAuthenticationToken(principal, token, authorities);
}
public boolean validateToken(String authToken) {
try {
Jwts.parserBuilder().setSigningKey(key).build().parseClaimsJws(authToken);
return true;
} catch (JwtException | IllegalArgumentException e) {
log.info("Invalid JWT token.");
log.trace("Invalid JWT token trace.", e);
}
return false;
}
}
| [
"[email protected]"
] | |
fdc73fae90757b6ec54b7e8677273e5a5052beff | 97635912078f3e3ebd0e0caa14684c9723e165b7 | /gui_slidingbars/src/ent/dom/slidingbars/widget/AnimationLayout.java | 7eb155ca6e82718dd06b55250f2ae25800aa2bb3 | [] | no_license | Sjith/WorkspaceExamplesBackup | 5afd3cc5bfd905bdec734bafc5441143bbcc6d7b | 7dfa8217e21ba40f92be2409a110abf354d420ea | refs/heads/master | 2021-01-18T07:57:07.848197 | 2013-02-25T14:29:31 | 2013-02-25T14:29:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,559 | java | /*
* Copyright (C) 2012 0xlab - http://0xlab.org/
*
* 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.
*
* Authored by Julian Chu <walkingice AT 0xlab.org>
*/
package ent.dom.slidingbars.widget;
// update the package name to match your app
import ent.dom.slidingbars.R;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.TranslateAnimation;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.MeasureSpec;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
public class AnimationLayout extends ViewGroup {
public final static int DURATION = 400;
protected boolean mPlaceLeft=false;
protected boolean mOpened;
protected View mSidebar;
protected View mContent;
protected int mSidebarWidth = 150; /* assign default value. It will be overwrite
in onMeasure by Layout xml resource. */
protected int mSidebarHeight = 150;
protected Animation mAnimation;
protected OpenListener mOpenListener;
protected CloseListener mCloseListener;
protected Listener mListener;
int dir=0,constVal = 120;
protected boolean mPressed = false;
public AnimationLayout(Context context) {
this(context, null);
}
public AnimationLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public void onFinishInflate() {
super.onFinishInflate();
mSidebar = findViewById(R.id.animation_layout_sidebar);
mContent = findViewById(R.id.animation_layout_content);
if (mSidebar == null) {
throw new NullPointerException("no view id = animation_sidebar");
}
if (mContent == null) {
throw new NullPointerException("no view id = animation_content");
}
mOpenListener = new OpenListener(mSidebar, mContent);
mCloseListener = new CloseListener(mSidebar, mContent);
}
@Override
public void onLayout(boolean changed, int l, int t, int r, int b) {
/* the title bar assign top padding, drop it */
int sidebarLeft = l;
if (!mPlaceLeft) {
sidebarLeft = r - mSidebarWidth;
}
mSidebar.layout(sidebarLeft,
0,
sidebarLeft + mSidebarWidth,
0 + mSidebar.getMeasuredHeight());
if (mOpened) {
Log.d("mOpened","true");
if (mPlaceLeft) {
mContent.layout(mSidebarWidth-constVal, mSidebarHeight-constVal,r+mSidebarWidth,b+mSidebarHeight);
} else {
//mContent.layout(-mSidebarWidth+constVal,mSidebarHeight-constVal,constVal,(r+(mSidebarHeight))); -- This is right top to left bottom animation
mContent.layout(-mSidebarWidth+constVal,-mSidebarHeight+constVal,constVal,constVal);
}
} else {
Log.d("mOpened","false");
if(mPlaceLeft) {
mContent.layout(0, 0, mSidebarWidth, mSidebarHeight);
} else {
//mContent.layout(0, 0, mSidebarWidth, mSidebarHeight); -- This is right top to left bottom animation
mContent.layout(0, 0, mSidebarWidth, mSidebarHeight);
}
}
}
@Override
public void onMeasure(int w, int h) {
super.onMeasure(w, h);
super.measureChildren(w, h);
mSidebarWidth = mSidebar.getMeasuredWidth();
mSidebarHeight = mSidebar.getMeasuredHeight();
}
@Override
protected void measureChild(View child, int parentWSpec, int parentHSpec) {
/* the max width of Sidebar is 90% of Parent */
if (child == mSidebar) {
int mode = MeasureSpec.getMode(parentWSpec);
int width = (int)(getMeasuredWidth() * 1);//should be 0.9
int height = (int)(getMeasuredHeight() * 1);//should be 0.9
super.measureChild(child, MeasureSpec.makeMeasureSpec(width, mode),
MeasureSpec.makeMeasureSpec(height, MeasureSpec.getMode(parentHSpec)));
} else {
super.measureChild(child, parentWSpec, parentHSpec);
}
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
if (!isOpening()) {
return false;
}
int action = ev.getAction();
if (action != MotionEvent.ACTION_UP
&& action != MotionEvent.ACTION_DOWN) {
return false;
}
/* if user press and release both on Content while
* sidebar is opening, call listener. otherwise, pass
* the event to child. */
int x = (int)ev.getX();
int y = (int)ev.getY();
if (mContent.getLeft() < x
&& mContent.getRight() > x
&& mContent.getTop() < y
&& mContent.getBottom() > y) {
if (action == MotionEvent.ACTION_DOWN) {
mPressed = true;
}
if (mPressed
&& action == MotionEvent.ACTION_UP
&& mListener != null) {
mPressed = false;
return mListener.onContentTouchedWhenOpening();
}
} else {
mPressed = false;
}
return false;
}
public void setListener(Listener l) {
mListener = l;
}
/* to see if the Sidebar is visible */
public boolean isOpening() {
return mOpened;
}
public void toggleSidebar(int dir) {
this.dir = dir;
if(dir == 0)
mPlaceLeft = true;
else if(dir == 1)
mPlaceLeft = false;
if (mContent.getAnimation() != null) {
return;
}
if (mOpened) {
/* opened, make close animation*/
if (mPlaceLeft) {
mAnimation = new TranslateAnimation(0,-(mSidebarWidth-constVal),0,-(mSidebarHeight-constVal));
} else {
//mAnimation = new TranslateAnimation(0, mSidebarWidth-constVal, 0, -(mSidebarHeight-constVal)); -- This is right top to left bottom animation
mAnimation = new TranslateAnimation(0, mSidebarWidth-constVal, 0, mSidebarHeight-constVal);
//mAnimation = AnimationUtils.loadAnimation(getContext(), R.anim.hyperspace_jump);
}
mAnimation.setAnimationListener(mCloseListener);
} else {
/* not opened, make open animation */
if (mPlaceLeft) {
mAnimation = new TranslateAnimation(0, mSidebarWidth-constVal, 0, mSidebarHeight-constVal);
} else {
//mAnimation = new TranslateAnimation(0, -mSidebarWidth+constVal, 0, mSidebarHeight-constVal); -- This is right top to left bottom animation
mAnimation = new TranslateAnimation(0, -mSidebarWidth+constVal, 0, -mSidebarHeight+constVal);
}
mAnimation.setAnimationListener(mOpenListener);
}
mAnimation.setDuration(DURATION);
mAnimation.setFillAfter(true);
mAnimation.setFillEnabled(true);
mContent.startAnimation(mAnimation);
}
public void openSidebar() {
if (!mOpened) {
toggleSidebar(dir);
}
}
public void closeSidebar() {
if (mOpened) {
toggleSidebar(dir);
}
}
class OpenListener implements Animation.AnimationListener {
View iSidebar;
View iContent;
OpenListener(View sidebar, View content) {
iSidebar = sidebar;
iContent = content;
}
public void onAnimationRepeat(Animation animation) {
}
public void onAnimationStart(Animation animation) {
iSidebar.setVisibility(View.VISIBLE);
}
public void onAnimationEnd(Animation animation) {
iContent.clearAnimation();
mOpened = !mOpened;
requestLayout();
if (mListener != null) {
mListener.onSidebarOpened();
}
}
}
class CloseListener implements Animation.AnimationListener {
View iSidebar;
View iContent;
CloseListener(View sidebar, View content) {
iSidebar = sidebar;
iContent = content;
}
public void onAnimationRepeat(Animation animation) {
}
public void onAnimationStart(Animation animation) {
}
public void onAnimationEnd(Animation animation) {
iContent.clearAnimation();
iSidebar.setVisibility(View.INVISIBLE);
mOpened = !mOpened;
requestLayout();
if (mListener != null) {
mListener.onSidebarClosed();
}
}
}
public interface Listener {
public void onSidebarOpened();
public void onSidebarClosed();
public boolean onContentTouchedWhenOpening();
}
}
| [
"[email protected]"
] | |
36fd26d13ab63879ae26d31cc0883938a8939081 | bc0d2927268668c3ac7115c21dd0c1dfa299cd38 | /jwtrolebased/src/main/java/com/youtube/jwt/controller/UserController.java | de44d1f974d51e517a2d34ece74b829950ae1af9 | [] | no_license | vinothkumar198910/jwt | e5738794908d708c77452314d2df438509c62a82 | 388edf078188ac3031d1d680cdce71f4fc1cdef5 | refs/heads/main | 2023-08-30T10:52:46.461438 | 2021-11-12T12:19:28 | 2021-11-12T12:19:28 | 427,349,238 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,260 | java | package com.youtube.jwt.controller;
import com.youtube.jwt.entity.User;
import com.youtube.jwt.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.PostConstruct;
@RestController
public class UserController {
@Autowired
private UserService userService;
@PostConstruct
public void initRoleAndUser() {
userService.initRoleAndUser();
}
@PostMapping({"/registerNewUser"})
public User registerNewUser(@RequestBody User user) {
return userService.registerNewUser(user);
}
@GetMapping({"/forAdmin"})
@PreAuthorize("hasRole('Admin')")
public String forAdmin(){
return "This URL is only accessible to the admin";
}
@GetMapping({"/forUser"})
//@PreAuthorize("hasAnyRole('User','Admin')")
@PreAuthorize("hasRole('User')")
public String forUser(){
return "This URL is only accessible to the user";
}
}
| [
"[email protected]"
] | |
d71144ca0b38647e55ae92dbfa06afa71736fd9c | bb21a6c41649faf4d53c05a479ee221b57f3c570 | /app/src/main/java/com/hencoder/hencoderpracticedraw2/practice/Practice13ShadowLayerView.java | a9fd0d2ea4c21a1ee0edb6cedd78c50e312ec2f9 | [] | no_license | bihailantian/PracticeDraw2-master | af19045485c6bc6e1a0a2907ad5caa57fcd81f56 | 2451182947739130dd52eff757cba9320652df01 | refs/heads/master | 2021-08-16T22:08:44.215800 | 2017-11-20T11:38:50 | 2017-11-20T11:38:50 | 111,402,761 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,065 | java | package com.hencoder.hencoderpracticedraw2.practice;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
public class Practice13ShadowLayerView extends View {
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
public Practice13ShadowLayerView(Context context) {
super(context);
}
public Practice13ShadowLayerView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public Practice13ShadowLayerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
{
// 使用 Paint.setShadowLayer() 设置阴影
paint.setShadowLayer(20,10,10, Color.RED);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
paint.setTextSize(120);
canvas.drawText("Hello HenCoder", 50, 200, paint);
}
}
| [
"[email protected]"
] | |
0b9ac4ba29afccc89504f65d4df4a2e3c6c8f785 | abebf020ffc473b9c8974e575fc94ecb6d33fd06 | /src/com/dietactics/presentation/controller/servlets/IndexServlet.java | 4cda2cdaf33bc8be5a0b725e2ecc2ef4032e87ad | [] | no_license | michallegut/Dietactics | f2cc629b2d68422df18a30d3b43eebf6d345fd49 | 56b71cf1a71b246a3cde455cb60f99c0e6058205 | refs/heads/master | 2020-04-14T05:20:31.843183 | 2019-12-01T11:28:45 | 2019-12-01T11:28:45 | 163,657,979 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 573 | java | package com.dietactics.presentation.controller.servlets;
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 java.io.IOException;
@WebServlet("/index")
public class IndexServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.getRequestDispatcher("index.jsp").forward(req, resp);
}
} | [
"[email protected]"
] | |
51a437070da4c744017f33c438972daf678023d7 | f78c2630cc4e1ec445534a6bb07e85567036d3d9 | /src/main/java/com/cmr/hotshop/dao/UmsAdminLoginLogMapper.java | c436817db4df3b4e0bbd48fe3448044b1854243b | [] | no_license | chenmrU/hot_shop | 007d283f3157b953fcd0539c3209baa8559dd091 | bf3b4dae5347ff4e08b65ef5dfcd755bf8a05a8a | refs/heads/master | 2020-11-28T18:09:35.421006 | 2020-01-11T03:11:14 | 2020-01-11T03:11:14 | 229,888,939 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 985 | java | package com.cmr.hotshop.dao;
import com.cmr.hotshop.entity.UmsAdminLoginLog;
import com.cmr.hotshop.entity.UmsAdminLoginLogExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface UmsAdminLoginLogMapper {
long countByExample(UmsAdminLoginLogExample example);
int deleteByExample(UmsAdminLoginLogExample example);
int deleteByPrimaryKey(Long id);
int insert(UmsAdminLoginLog record);
int insertSelective(UmsAdminLoginLog record);
List<UmsAdminLoginLog> selectByExample(UmsAdminLoginLogExample example);
UmsAdminLoginLog selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") UmsAdminLoginLog record, @Param("example") UmsAdminLoginLogExample example);
int updateByExample(@Param("record") UmsAdminLoginLog record, @Param("example") UmsAdminLoginLogExample example);
int updateByPrimaryKeySelective(UmsAdminLoginLog record);
int updateByPrimaryKey(UmsAdminLoginLog record);
} | [
"[email protected]"
] | |
1a8b7e3fc660aa01d4804221e390bf8b9606c996 | a8887f2d310faa92a23e3edded2dd5f5390a3431 | /app/src/main/java/org/kprsongs/domain/AuthorSong.java | 4e64c7ab003221198f5f12e533e2b5ebd09bc183 | [] | no_license | kpreddygithub/LyricsApp | de5ec5c3121334a7d4511ab33ae698d3a8cb3bda | 3b0724e5ba7d334fea43f168735cf0f08cb7cfe2 | refs/heads/master | 2021-04-27T06:55:30.530754 | 2018-04-10T10:28:12 | 2018-04-10T10:28:12 | 122,621,615 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,146 | java | package org.kprsongs.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
/**
* Created by K Purushotham Reddy on 3/24/2015.
*/
public class AuthorSong {
private int authorId;
private int songId;
private Song song;
private Author author;
public int getAuthorId() {
return authorId;
}
public void setAuthorId(int authorId) {
this.authorId = authorId;
}
public int getSongId() {
return songId;
}
public void setSongId(int songId) {
this.songId = songId;
}
public Song getSong()
{
return song;
}
public void setSong(Song song)
{
this.song = song;
}
public Author getAuthor()
{
return author;
}
public void setAuthor(Author author)
{
this.author = author;
}
@Override
public String toString()
{
ToStringBuilder stringBuilder = new ToStringBuilder(this);
stringBuilder.append("authorname", getAuthor().getDisplayName());
stringBuilder.append("song title", getSong().getTitle());
return stringBuilder.toString();
}
}
| [
"[email protected]"
] | |
57b3de948f23efd6bba107b214bb8274fdc66275 | ea74d502f1057a241b6cceabbe5c7e6cd0bc9d51 | /src/com/fastjavaframework/listener/SystemSet.java | a3aa88bfda80ac4ca3eb19f0407073ccdbded3ef | [] | no_license | CRayFish07/fastjava | 16f2fa94804780b5c04176936d71c48cc82e54b1 | 4409570c2710d58c1cc3cfeef703232820e16923 | refs/heads/master | 2021-01-20T16:38:39.655811 | 2017-06-26T10:24:54 | 2017-06-26T10:24:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 551 | java | package com.fastjavaframework.listener;
import org.springframework.context.ApplicationContext;
public class SystemSet extends ContextLoader {
@Override
public void runBeforeContext(ApplicationContext context) {
String projectPath = getClass().getResource("/").getFile().toString();
String[] projectPaths = projectPath.split("/WEB-INF")[0].split("/");
System.setProperty("project.name", projectPaths.length>0?projectPaths[projectPaths.length - 1]:"project");
}
@Override
public void runAferContext(ApplicationContext context) {
}
}
| [
"[email protected]"
] | |
3f07865ffb7c8afeb409bf811c8e4ad56621259d | 753244933fc4465b0047821aea81c311738e1732 | /promise/target/java-D no-opt/ts3/src/thx/promise/PromiseTuple2_mapTuplePromise_445__Fun_0.java | fa1268b05bbde92af9320507ff871411a672c39d | [
"MIT"
] | permissive | mboussaa/HXvariability | abfaba5452fecb1b83bc595dc3ed942a126510b8 | ea32b15347766b6e414569b19cbc113d344a56d9 | refs/heads/master | 2021-01-01T17:45:54.656971 | 2017-07-26T01:27:49 | 2017-07-26T01:27:49 | 98,127,672 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | true | 1,101 | java | // Generated by Haxe 3.3.0
package thx.promise;
import haxe.root.*;
@SuppressWarnings(value={"rawtypes", "unchecked"})
public class PromiseTuple2_mapTuplePromise_445__Fun_0<TOut, T2, T1> extends haxe.lang.Function
{
public PromiseTuple2_mapTuplePromise_445__Fun_0(haxe.lang.Function success)
{
//line 446 "/HXvariability/promise/src/thx/promise/Promise.hx"
super(1, 0);
//line 446 "/HXvariability/promise/src/thx/promise/Promise.hx"
this.success = success;
}
@Override public java.lang.Object __hx_invoke1_o(double __fn_float1, java.lang.Object __fn_dyn1)
{
//line 445 "/HXvariability/promise/src/thx/promise/Promise.hx"
java.lang.Object t = ( (( __fn_dyn1 == haxe.lang.Runtime.undefined )) ? (((java.lang.Object) (__fn_float1) )) : (((java.lang.Object) (__fn_dyn1) )) );
//line 446 "/HXvariability/promise/src/thx/promise/Promise.hx"
return ((thx.promise.Future<thx.Either>) (this.success.__hx_invoke2_o(0.0, ((T1) (haxe.lang.Runtime.getField(t, "_0", true)) ), 0.0, ((T2) (haxe.lang.Runtime.getField(t, "_1", true)) ))) );
}
public haxe.lang.Function success;
}
| [
"[email protected]"
] | |
dd68cb4ca25498ad281a54357289f18db7e3fffa | 07e2b658d5a9b17d1f99c811f433b9a71efe7ad7 | /src/main/java/coding/test/ZiJIe2.java | b02cf8899abb31dd832365a2112227b49754584c | [] | no_license | YasinZhangX/LeetCodeEx | b2ea2a57b15e31bb40166a647f8f0020da8da222 | 7679d0ce1d9c6c871bb93d05add318e4807a41fd | refs/heads/master | 2021-06-25T01:59:09.385022 | 2020-11-18T04:04:33 | 2020-11-18T04:04:33 | 160,682,540 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,424 | java | package coding.test;
import java.util.Scanner;
/**
* @author Yasin Zhang
*/
public class ZiJIe2 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] arr = new int[n+1];
for(int i = 1; i <= n; i++){
arr[i] = sc.nextInt();
}
System.out.println(solution(arr));
}
private static long solution(int[] arr) {
long max = 0;
int n = arr.length - 1;
int[] memo = new int[n+1];
for (int i = 1; i <= n; i++) {
int L = L(arr, i, memo);
int R = R(arr, i);
memo[i] = L;
max = Math.max((long)L*(long)R, max);
}
return max;
}
private static int L(int[] arr, int i, int[] memo) {
int l = i - 1;
int ans = 0;
while (l >= 1) {
if (arr[l] > arr[i]) {
ans = l;
break;
} else if (arr[l] == arr[i]) {
ans = memo[l];
break;
}
l--;
}
return ans;
}
private static int R(int[] arr, int i) {
int r = i + 1;
int n = arr.length - 1;
int ans = 0;
while (r <= n) {
if (arr[r] > arr[i]) {
ans = r;
break;
}
r++;
}
return ans;
}
}
| [
"[email protected]"
] | |
f9819a0051b8617effa22d0d06a7b4a625bbb975 | 7822eb2f86317aebf6e689da2a6708e9cc4ee1ea | /Rachio_apk/sources/com/squareup/okhttp/internal/http/HttpMethod.java | c356a83601cb627c6f0a6a08189770ad4f1c2e26 | [
"BSD-2-Clause"
] | permissive | UCLA-ECE209AS-2018W/Haoming-Liang | 9abffa33df9fc7be84c993873dac39159b05ef04 | f567ae0adc327b669259c94cc49f9b29f50d1038 | refs/heads/master | 2021-04-06T20:29:41.296769 | 2018-03-21T05:39:43 | 2018-03-21T05:39:43 | 125,328,864 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 540 | java | package com.squareup.okhttp.internal.http;
public final class HttpMethod {
public static boolean requiresRequestBody(String method) {
return method.equals("POST") || method.equals("PUT") || method.equals("PATCH") || method.equals("PROPPATCH") || method.equals("REPORT");
}
public static boolean permitsRequestBody(String method) {
return requiresRequestBody(method) || method.equals("OPTIONS") || method.equals("DELETE") || method.equals("PROPFIND") || method.equals("MKCOL") || method.equals("LOCK");
}
}
| [
"[email protected]"
] | |
958c69450b8ae7b2399838361a12a6ad63abaf36 | 58cd843ee0ab084aeb3b27699d748fd434a15e35 | /easycode-common/src/main/java/com/easycodebox/common/file/UploadFileInfo.java | 059d25c8732f76414b0e943751eb0f7ccd838fc1 | [
"Apache-2.0"
] | permissive | yuanzj/easycode | b9f55560d93b66bcae117ba6731db36ba2636330 | b3de71c3c28aca85c61f7514d2d759b8ec28889b | refs/heads/master | 2021-01-12T08:01:38.874325 | 2016-12-20T13:34:24 | 2016-12-20T13:34:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 666 | java | package com.easycodebox.common.file;
import java.io.InputStream;
/**
* @author WangXiaoJin
*
*/
public class UploadFileInfo extends FileInfo {
private static final long serialVersionUID = -5758401252814280071L;
/**
* 上传图片时用到的参数名
*/
private String paramKey;
private InputStream inputStream;
public UploadFileInfo() {
super();
}
public InputStream getInputStream() {
return inputStream;
}
public void setInputStream(InputStream inputStream) {
this.inputStream = inputStream;
}
public String getParamKey() {
return paramKey;
}
public void setParamKey(String paramKey) {
this.paramKey = paramKey;
}
}
| [
"[email protected]"
] | |
78e2a9e26199ed9843770b7260443291d5e7e631 | e49d9edb5df3fa241bed2018dd1f225ba16a4557 | /src/src/in/definex/Looper.java | 89d9c8e250385001b0e06e700e116d62390edb1e | [
"MIT"
] | permissive | iamstan13y/supbot | e5097c583cc98ed0aa9cb40d1b9127115d80eb44 | e082306f86ef68368c3391d4c12ea0b6a8118295 | refs/heads/master | 2022-04-26T16:10:28.762852 | 2020-05-01T12:23:16 | 2020-05-01T12:23:16 | 387,380,819 | 4 | 0 | MIT | 2021-07-19T07:43:40 | 2021-07-19T07:43:39 | null | UTF-8 | Java | false | false | 7,163 | java | package in.definex;
import in.definex.Action.ActionManager;
import in.definex.Action.Checker;
import in.definex.Action.Core.Checker.CheckInCurrentGroupAction;
import in.definex.Action.Core.Checker.CheckOtherGroupForNewAction;
import in.definex.Action.Core.MoveToChatAction;
import in.definex.Action.Core.SendMessageAction;
import in.definex.Action.StringActionInitializer;
import in.definex.ChatSystem.ChatGroupsManager;
import in.definex.ChatSystem.ChatProcessorManager;
import in.definex.ChatSystem.Core.CommandCP;
import in.definex.Console.Console;
import in.definex.Console.Core.*;
import in.definex.Console.Log;
import in.definex.Database.Configuration;
import in.definex.Database.Core.ChatGroupDatabase;
import in.definex.Database.Core.ClientDatabase;
import in.definex.Database.DatabaseManager;
import in.definex.Feature.Accounts.AccountsFeature;
import in.definex.Feature.FeatureManager;
import in.definex.Feature.GroupConfig.GroupConfigFeature;
import in.definex.Feature.Help.HelpFeature;
import in.definex.Functions.Utils;
import in.definex.NetworkJob.NetworkJobManager;
import in.definex.Scheduler.ScheduleDatabase;
import in.definex.Scheduler.ScheduleManager;
import in.definex.Scheduler.ScheduleTaskInitializer;
import in.definex.String.Strings;
import in.definex.String.XPaths;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
/**
* Looper class
*
* Initializes features, checkers, console commands,
* creates and runs checkerAndActionThread thread and console command threads
*
* Created by adam_ on 30-11-2017.
*/
public class Looper {
private ExtraLooperFunctions extraLooperFunctions;
private Thread checkerAndActionThread;
private boolean quit = false;
private String chromeProfileLoc;
/**
* Status of the program.
*
* @return true if the program has quit.
*/
public boolean isQuit() { return quit; }
/**
* Called to exit the program
*/
public void quit() { quit = true; }
/**
* Constructor,
* Creates checkerAndActionThread thread,
* starts selenium
*
* @param extraLooperFunctions passed from the main Class,
* contains initialization of checker, features and console commands
*/
public Looper(ExtraLooperFunctions extraLooperFunctions) {
this.extraLooperFunctions = extraLooperFunctions;
checkerAndActionThread = new Thread("CheckerActionThread"){
@Override
public void run() {
while(!quit)
loop();
}
};
}
public void setChromeProfileLoc(String chromeProfileLoc) {
this.chromeProfileLoc = chromeProfileLoc;
}
/***
* Method called to start the program from main
*
* Waits wait for whatsapp to initialize (scan qr code)
* then runs the init() method
* then runs checkerAndActionThread and console thread
* then waits for the threads to exit
*/
public void start(){
WebDriver driver;
if(chromeProfileLoc == null || !chromeProfileLoc.isEmpty()) {
ChromeOptions options = new ChromeOptions();
options.addArguments("user-data-dir="+chromeProfileLoc);
driver = new ChromeDriver(options);
}
else
driver = new ChromeDriver();
driver.get("http://web.whatsapp.com/");
Bot.CreateBot(
driver,
new ActionManager(),
new Checker(() -> Log.a("RESETTING CHECKERS")),
new FeatureManager(),
new ChatProcessorManager(),
new Console(this),
new ChatGroupsManager(),
this,
new DatabaseManager(),
new Configuration(),
new StringActionInitializer(),
new ScheduleManager(),
new NetworkJobManager(),
new ScheduleTaskInitializer()
);
Strings.commandPrefix = Bot.getConfiguration().GetConfig("command_prefix",";;");
Strings.titlePrefix = Bot.getConfiguration().GetConfig("group_title_prefix", ";;");
System.out.println("Waiting for Whatsapp web to initialize.");
while (Bot.getWebDriver().findElements(By.xpath(XPaths.autoStartReady)).size() == 0) Utils.waitFor(500);
Utils.waitFor(1000);
System.out.println("Program starting.");
init();
checkerAndActionThread.start();
Bot.getConsole().getMyThread().start();
}
/**
* Initializes ActionManger, FeatureManager, ChatgroupManager, Console with core objects
* also initializes non core objects
*
* Ran inside start function
*/
private void init(){
//core features
Bot.getFeatureManager().add(
new HelpFeature(),
new GroupConfigFeature(),
new AccountsFeature()
);
//core checkers
Bot.getChecker().addCheckers(
new CheckInCurrentGroupAction(),
new CheckOtherGroupForNewAction()
);
//coreConsoleCommands
Bot.getConsole().getConsoleCommandManager().add(
new QuitCC(),
new GroupCC(),
new LogCC(),
new RunCC(),
new ActionCallerCC(),
new CheckerCallerCC(),
new VersionCC(),
new HelpCC(),
new ScheduleCC()
);
//core database
Bot.getDatabaseManager().add(
new ChatGroupDatabase(),
new ClientDatabase(),
new ScheduleDatabase()
);
//core ChatProcessors
Bot.getChatProcessorManager().add(
new CommandCP()
);
Bot.getRemoteActionCall().add(
MoveToChatAction.class,
SendMessageAction.class
);
extraLooperFunctions.addThingsInBot();
//init managers
Bot.getDatabaseManager().init();
Bot.getChatGroupsManager().loadGroups();
Log.init();
Bot.getScheduleManager().init();
extraLooperFunctions.moreInits();
}
/***
* Loop ran by checkerAndActionThread
*/
private void loop(){
if(!Bot.getActionManager().hasPendingWork())
Bot.getActionManager().add(Bot.getChecker().getNextChecker());
Bot.getActionManager().popAndPerform();
Utils.waitFor(500);
}
public void join(){
try {
checkerAndActionThread.join();
Bot.getConsole().getMyThread().join();
Bot.getScheduleManager().cancelAll();
} catch (InterruptedException e) {
e.printStackTrace();
}
Bot.getWebDriver().quit();
}
/**
* Interface made to pass initialization of
* feature, check and console commands from main
*/
public interface ExtraLooperFunctions {
void addThingsInBot();
void moreInits();
}
}
| [
"[email protected]"
] | |
b9f4a7d8dd31cc0c352f9292b75f64fd143b93ef | 3116cce9a40edb4786c8f784197cae78dcfd4fe2 | /app/src/main/java/com/cfish/rvb/fragment/SiteFragment.java | 97920d2f833802de0f81a9e401dd583debcebd54 | [] | no_license | fishho/NKBBS | 23640a0028ac0997873d10855c63a6d1495f334a | 7f06140d6f10257003bd0a42f078fe53e6b12dbc | refs/heads/master | 2020-05-21T12:26:08.963405 | 2017-01-05T12:56:22 | 2017-01-05T12:56:22 | 50,716,931 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,155 | java | package com.cfish.rvb.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.alibaba.fastjson.JSON;
import com.cfish.rvb.R;
import com.cfish.rvb.SiteArticleActivity;
import com.cfish.rvb.adapter.NewsAdapter;
import com.cfish.rvb.bean.SiteDetails;
import com.cfish.rvb.util.CommonData;
import com.cfish.rvb.util.HttpUtil;
import com.cfish.rvb.util.JsonParse;
import com.loopj.android.http.JsonHttpResponseHandler;
import com.loopj.android.http.RequestParams;
import com.loopj.android.http.TextHttpResponseHandler;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import cz.msebera.android.httpclient.Header;
/**
* A simple {@link Fragment} subclass.
* Use the {@link SiteFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class SiteFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String TAG = "SiteFragment";
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
private RequestParams params, paramsTest;
private NewsAdapter adapter;
private List<Map<String,String>> newsList;
private RecyclerView siteArticleRv;
private View view;
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment SiteFragment.
*/
// TODO: Rename and change types and number of parameters
public static SiteFragment newInstance(String param1, String param2) {
SiteFragment fragment = new SiteFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
public SiteFragment() {
// Required empty public constructor
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
view = inflater.inflate(R.layout.fragment_site, container, false);
initView();
//initData();
initAction();
view.setLayoutParams(new android.widget.LinearLayout.LayoutParams(
android.widget.LinearLayout.LayoutParams.MATCH_PARENT,
android.widget.LinearLayout.LayoutParams.MATCH_PARENT));
return view;
}
public void initView() {
siteArticleRv = (RecyclerView)view.findViewById(R.id.site_article_rv);
siteArticleRv.setLayoutManager(new LinearLayoutManager(getActivity()));
}
public void initData() {
newsList = new ArrayList<>();
adapter = new NewsAdapter(getActivity(),newsList);
siteArticleRv.setAdapter(adapter);
getDada();
}
public void initAction() {
}
public void getDada() {
String uid = (CommonData.user.getUid() == null)? "-1" : CommonData.user.getUid();
Log.d(TAG, "SiteFragment uid = " + uid);
params = new RequestParams();
params.add("uid",uid);
params.add("type","get_site_articles");
HttpUtil.post(CommonData.siteURL, params, new JsonHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
super.onSuccess(statusCode, headers, response);
Log.d(TAG, "SiteFragment SS " + response);
//List<Topic> topics = JsonParse.parseGroupArticles(JSON.parseObject(responseString));
// for (Topic topic : topics) {
// topicList.add(topic);
// }
// topicList.addAll(topics);
// adapter.refreshData(topicList);
JSONArray data =null;
Map<String,String> map = new HashMap<>();
try {
data = response.getJSONArray("data");
for (int i=0;i<data.length();i++) {
map = new HashMap();
map.put("sid",data.getJSONObject(i).getString("sid"));
map.put("s_a_id",data.getJSONObject(i).getString("s_a_id"));
map.put("author",data.getJSONObject(i).getString("author"));
map.put("creatime",data.getJSONObject(i).getString("creatime"));
map.put("reply",data.getJSONObject(i).getString("reply_num"));
map.put("name",data.getJSONObject(i).getString("name"));
map.put("signature",data.getJSONObject(i).getString("signature"));
newsList.add(map);
}
} catch (JSONException e) {
Log.e(TAG,e.getMessage(),e);
}
adapter.refreshData(newsList);
adapter.setOnItemClickListener(new NewsAdapter.OnRecyclerViewItemClickListener() {
@Override
public void onItemClick(View v, String data) {
Intent intent = new Intent(getActivity(), SiteArticleActivity.class);
intent.putExtra("s_a_id", data);
getActivity().startActivity(intent);
// paramsTest = new RequestParams();
// paramsTest.add("uid","-1");
// paramsTest.add("reply_order", CommonData.user.getReply_order());
// paramsTest.add("type", "get_site_article");
// paramsTest.add("s_a_id", data);
// Log.d(TAG, "onItemClick: "+data);
// HttpUtil.post(CommonData.siteURL, paramsTest, new TextHttpResponseHandler() {
// @Override
// public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
// Log.d(TAG, "onFailure: "+responseString);
// }
//
// @Override
// public void onSuccess(int statusCode, Header[] headers, String responseString) {
// // Log.d("DDDDD", responseString);
// if (responseString.length() > 4000){
// Log.d("Dfish","Article part1"+responseString.length()+responseString.substring(0,4000));
// Log.d("Dfish","Article part2"+responseString.substring(4000));
//
// if (responseString.startsWith("<")) {
// responseString = responseString.substring(responseString.indexOf("{"),responseString.length());
// }
// com.alibaba.fastjson.JSONObject resp = com.alibaba.fastjson.JSON.parseObject(responseString);
// if (resp.getString("status").equals("0")) {
// Snackbar.make(view, "找不见了", Snackbar.LENGTH_SHORT).show();
// } else {
// SiteDetails details = JsonParse.parseSiteDetails(resp);
// Log.d("Dddd",details.getArticle().getContent());
// }
// }
// }
// });
}
});
}
@Override
public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {
super.onFailure(statusCode, headers, throwable, errorResponse);
Log.d(TAG, " siteFragment FF" + errorResponse);
}
});
}
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if(isVisibleToUser){
initData();
} else {
Log.d(TAG,"SiteFragment is not visible");
}
}
}
| [
"[email protected]"
] | |
18eb8c61af15b318ccb91142028af2a9f4181e7b | 124825172040ac22562fc8ab4e6401bd80e5ba09 | /Java/R 2 copy.java | efdaea3c48a4eb4c4cae672b1b6e88427585d7b0 | [] | no_license | nfgallimore/Software | 75e516cbc1f11de39147a5111cff33f2b718f641 | c12c2259dbd23e003554551f5529d7969260e07a | refs/heads/master | 2020-05-24T11:10:25.993491 | 2017-03-14T05:49:39 | 2017-03-14T05:49:39 | 84,850,472 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 151,589 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.virtualtheologies.helloandroid;
public final class R {
public static final class anim {
public static final int abc_fade_in=0x7f040000;
public static final int abc_fade_out=0x7f040001;
public static final int abc_slide_in_bottom=0x7f040002;
public static final int abc_slide_in_top=0x7f040003;
public static final int abc_slide_out_bottom=0x7f040004;
public static final int abc_slide_out_top=0x7f040005;
}
public static final class attr {
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarDivider=0x7f010000;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarItemBackground=0x7f010001;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int actionBarSize=0x7f010002;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarSplitStyle=0x7f010003;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarStyle=0x7f010004;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarTabBarStyle=0x7f010005;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarTabStyle=0x7f010006;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarTabTextStyle=0x7f010007;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionBarWidgetTheme=0x7f010008;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionButtonStyle=0x7f010009;
/** Default ActionBar dropdown style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionDropDownStyle=0x7f010062;
/**
An optional layout to be used as an action view.
See {@link android.view.MenuItem#setActionView(android.view.View)}
for more info.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionLayout=0x7f010059;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionMenuTextAppearance=0x7f01000a;
/** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
*/
public static final int actionMenuTextColor=0x7f01000b;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeBackground=0x7f01000c;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeCloseButtonStyle=0x7f01000d;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeCloseDrawable=0x7f01000e;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeCopyDrawable=0x7f01000f;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeCutDrawable=0x7f010010;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeFindDrawable=0x7f010011;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModePasteDrawable=0x7f010012;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModePopupWindowStyle=0x7f010013;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeSelectAllDrawable=0x7f010014;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeShareDrawable=0x7f010015;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeSplitBackground=0x7f010016;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeStyle=0x7f010017;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionModeWebSearchDrawable=0x7f010018;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int actionOverflowButtonStyle=0x7f010019;
/**
The name of an optional ActionProvider class to instantiate an action view
and perform operations such as default action for that menu item.
See {@link android.view.MenuItem#setActionProvider(android.view.ActionProvider)}
for more info.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int actionProviderClass=0x7f01005b;
/**
The name of an optional View class to instantiate and use as an
action view. See {@link android.view.MenuItem#setActionView(android.view.View)}
for more info.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int actionViewClass=0x7f01005a;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int activityChooserViewStyle=0x7f01001a;
/** Specifies a background drawable for the action bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int background=0x7f010047;
/** Specifies a background drawable for the bottom component of a split action bar.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
*/
public static final int backgroundSplit=0x7f010049;
/** Specifies a background drawable for a second stacked row of the action bar.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
*/
public static final int backgroundStacked=0x7f010048;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int buttonBarButtonStyle=0x7f01001b;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int buttonBarStyle=0x7f01001c;
/** Specifies a layout for custom navigation. Overrides navigationMode.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int customNavigationLayout=0x7f01004a;
/**
Whether this spinner should mark child views as enabled/disabled when
the spinner itself is enabled/disabled.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int disableChildrenWhenDisabled=0x7f010061;
/** Options affecting how the action bar is displayed.
<p>Must be one or more (separated by '|') of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>useLogo</code></td><td>0x1</td><td></td></tr>
<tr><td><code>showHome</code></td><td>0x2</td><td></td></tr>
<tr><td><code>homeAsUp</code></td><td>0x4</td><td></td></tr>
<tr><td><code>showTitle</code></td><td>0x8</td><td></td></tr>
<tr><td><code>showCustom</code></td><td>0x10</td><td></td></tr>
<tr><td><code>disableHome</code></td><td>0x20</td><td></td></tr>
</table>
*/
public static final int displayOptions=0x7f010040;
/** Specifies the drawable used for item dividers.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int divider=0x7f010046;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int dividerHorizontal=0x7f01001d;
/** Size of padding on either end of a divider.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int dividerPadding=0x7f010057;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int dividerVertical=0x7f01001e;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int dropDownListViewStyle=0x7f01001f;
/** The preferred item height for dropdown lists.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int dropdownListPreferredItemHeight=0x7f010063;
/**
The drawable to show in the button for expanding the activities overflow popup.
<strong>Note:</strong> Clients would like to set this drawable
as a clue about the action the chosen activity will perform. For
example, if share activity is to be chosen the drawable should
give a clue that sharing is to be performed.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int expandActivityOverflowButtonDrawable=0x7f010054;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int height=0x7f010020;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int homeAsUpIndicator=0x7f010021;
/** Specifies a layout to use for the "home" section of the action bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int homeLayout=0x7f01004b;
/** Specifies the drawable used for the application icon.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int icon=0x7f010044;
/**
The default state of the SearchView. If true, it will be iconified when not in
use and expanded when clicked.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int iconifiedByDefault=0x7f01005c;
/** Specifies a style resource to use for an indeterminate progress spinner.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int indeterminateProgressStyle=0x7f01004d;
/** The maximal number of items initially shown in the activity list.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int initialActivityCount=0x7f010053;
/** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int isLightTheme=0x7f010022;
/**
Specifies padding that should be applied to the left and right sides of
system-provided items in the bar.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int itemPadding=0x7f01004f;
/** Drawable used as a background for selected list items.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int listChoiceBackgroundIndicator=0x7f010067;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int listPopupWindowStyle=0x7f010023;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int listPreferredItemHeight=0x7f010024;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int listPreferredItemHeightLarge=0x7f010025;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int listPreferredItemHeightSmall=0x7f010026;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int listPreferredItemPaddingLeft=0x7f010027;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int listPreferredItemPaddingRight=0x7f010028;
/** Specifies the drawable used for the application logo.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int logo=0x7f010045;
/** The type of navigation to use.
<p>Must be one of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>normal</code></td><td>0</td><td> Normal static title text </td></tr>
<tr><td><code>listMode</code></td><td>1</td><td> The action bar will use a selection list for navigation. </td></tr>
<tr><td><code>tabMode</code></td><td>2</td><td> The action bar will use a series of horizontal tabs for navigation. </td></tr>
</table>
*/
public static final int navigationMode=0x7f01003f;
/** Sets the padding, in pixels, of the end edge; see {@link android.R.attr#padding}.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int paddingEnd=0x7f010069;
/** Sets the padding, in pixels, of the start edge; see {@link android.R.attr#padding}.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int paddingStart=0x7f010068;
/** Default Panel Menu style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int panelMenuListTheme=0x7f010066;
/** Default Panel Menu width.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int panelMenuListWidth=0x7f010065;
/** Default PopupMenu style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int popupMenuStyle=0x7f010064;
/**
Reference to a layout to use for displaying a prompt in the dropdown for
spinnerMode="dropdown". This layout must contain a TextView with the id
{@code @android:id/text1} to be populated with the prompt text.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int popupPromptView=0x7f010060;
/** Specifies the horizontal padding on either end for an embedded progress bar.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int progressBarPadding=0x7f01004e;
/** Specifies a style resource to use for an embedded progress bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int progressBarStyle=0x7f01004c;
/** The prompt to display when the spinner's dialog is shown.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int prompt=0x7f01005e;
/** An optional query hint string to be displayed in the empty query field.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int queryHint=0x7f01005d;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int searchDropdownBackground=0x7f010029;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int searchResultListItemHeight=0x7f01002a;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int searchViewAutoCompleteTextView=0x7f01002b;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int searchViewCloseIcon=0x7f01002c;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int searchViewEditQuery=0x7f01002d;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int searchViewEditQueryBackground=0x7f01002e;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int searchViewGoIcon=0x7f01002f;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int searchViewSearchIcon=0x7f010030;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int searchViewTextField=0x7f010031;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int searchViewTextFieldRight=0x7f010032;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int searchViewVoiceIcon=0x7f010033;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int selectableItemBackground=0x7f010034;
/** How this item should display in the Action Bar, if present.
<p>Must be one or more (separated by '|') of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>never</code></td><td>0</td><td>
Never show this item in an action bar, show it in the overflow menu instead.
Mutually exclusive with "ifRoom" and "always".
</td></tr>
<tr><td><code>ifRoom</code></td><td>1</td><td>
Show this item in an action bar if there is room for it as determined
by the system. Favor this option over "always" where possible.
Mutually exclusive with "never" and "always".
</td></tr>
<tr><td><code>always</code></td><td>2</td><td>
Always show this item in an actionbar, even if it would override
the system's limits of how much stuff to put there. This may make
your action bar look bad on some screens. In most cases you should
use "ifRoom" instead. Mutually exclusive with "ifRoom" and "never".
</td></tr>
<tr><td><code>withText</code></td><td>4</td><td>
When this item is shown as an action in the action bar, show a text
label with it even if it has an icon representation.
</td></tr>
<tr><td><code>collapseActionView</code></td><td>8</td><td>
This item's action view collapses to a normal menu
item. When expanded, the action view takes over a
larger segment of its container.
</td></tr>
</table>
*/
public static final int showAsAction=0x7f010058;
/** Setting for which dividers to show.
<p>Must be one or more (separated by '|') of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>none</code></td><td>0</td><td></td></tr>
<tr><td><code>beginning</code></td><td>1</td><td></td></tr>
<tr><td><code>middle</code></td><td>2</td><td></td></tr>
<tr><td><code>end</code></td><td>4</td><td></td></tr>
</table>
*/
public static final int showDividers=0x7f010056;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int spinnerDropDownItemStyle=0x7f010035;
/** Display mode for spinner options.
<p>Must be one of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>dialog</code></td><td>0</td><td> Spinner options will be presented to the user as a dialog window. </td></tr>
<tr><td><code>dropdown</code></td><td>1</td><td>
Spinner options will be presented to the user as an inline dropdown
anchored to the spinner widget itself.
</td></tr>
</table>
*/
public static final int spinnerMode=0x7f01005f;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int spinnerStyle=0x7f010036;
/** Specifies subtitle text used for navigationMode="normal"
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int subtitle=0x7f010041;
/** Specifies a style to use for subtitle text.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int subtitleTextStyle=0x7f010043;
/** Present the text in ALL CAPS. This may use a small-caps form when available.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a boolean value, either "<code>true</code>" or "<code>false</code>".
*/
public static final int textAllCaps=0x7f010055;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int textAppearanceLargePopupMenu=0x7f010037;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int textAppearanceListItem=0x7f010038;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int textAppearanceListItemSmall=0x7f010039;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int textAppearanceSearchResultSubtitle=0x7f01003a;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int textAppearanceSearchResultTitle=0x7f01003b;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int textAppearanceSmallPopupMenu=0x7f01003c;
/** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
*/
public static final int textColorSearchUrl=0x7f01003d;
/** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int title=0x7f01003e;
/** Specifies a style to use for title text.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int titleTextStyle=0x7f010042;
/** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int windowActionBar=0x7f010050;
/** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int windowActionBarOverlay=0x7f010051;
/** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int windowSplitActionBar=0x7f010052;
}
public static final class bool {
public static final int abc_action_bar_embed_tabs_pre_jb=0x7f050000;
public static final int abc_action_bar_expanded_action_views_exclusive=0x7f050001;
public static final int abc_config_actionMenuItemAllCaps=0x7f050002;
public static final int abc_config_allowActionMenuItemTextWithIcon=0x7f050003;
public static final int abc_config_showMenuShortcutsWhenKeyboardPresent=0x7f050004;
public static final int abc_split_action_bar_is_narrow=0x7f050005;
}
public static final class color {
public static final int abc_search_url_text_holo=0x7f060003;
public static final int abc_search_url_text_normal=0x7f060000;
public static final int abc_search_url_text_pressed=0x7f060001;
public static final int abc_search_url_text_selected=0x7f060002;
}
public static final class dimen {
public static final int abc_action_bar_default_height=0x7f080000;
public static final int abc_action_bar_icon_vertical_padding=0x7f080001;
public static final int abc_action_bar_stacked_max_height=0x7f080002;
public static final int abc_action_bar_stacked_tab_max_width=0x7f080003;
public static final int abc_action_bar_subtitle_bottom_margin=0x7f080004;
public static final int abc_action_bar_subtitle_text_size=0x7f080005;
public static final int abc_action_bar_subtitle_top_margin=0x7f080006;
public static final int abc_action_bar_title_text_size=0x7f080007;
public static final int abc_action_button_min_width=0x7f080008;
public static final int abc_config_prefDialogWidth=0x7f080009;
public static final int abc_dropdownitem_icon_width=0x7f08000a;
public static final int abc_dropdownitem_text_padding_left=0x7f08000b;
public static final int abc_dropdownitem_text_padding_right=0x7f08000c;
public static final int abc_panel_menu_list_width=0x7f08000d;
public static final int abc_search_view_preferred_width=0x7f08000e;
public static final int abc_search_view_text_min_width=0x7f08000f;
public static final int activity_horizontal_margin=0x7f080010;
public static final int activity_vertical_margin=0x7f080011;
}
public static final class drawable {
public static final int abc_ab_bottom_solid_dark_holo=0x7f020000;
public static final int abc_ab_bottom_solid_light_holo=0x7f020001;
public static final int abc_ab_bottom_transparent_dark_holo=0x7f020002;
public static final int abc_ab_bottom_transparent_light_holo=0x7f020003;
public static final int abc_ab_share_pack_holo_dark=0x7f020004;
public static final int abc_ab_share_pack_holo_light=0x7f020005;
public static final int abc_ab_solid_dark_holo=0x7f020006;
public static final int abc_ab_solid_light_holo=0x7f020007;
public static final int abc_ab_stacked_solid_dark_holo=0x7f020008;
public static final int abc_ab_stacked_solid_light_holo=0x7f020009;
public static final int abc_ab_stacked_transparent_dark_holo=0x7f02000a;
public static final int abc_ab_stacked_transparent_light_holo=0x7f02000b;
public static final int abc_ab_transparent_dark_holo=0x7f02000c;
public static final int abc_ab_transparent_light_holo=0x7f02000d;
public static final int abc_cab_background_bottom_holo_dark=0x7f02000e;
public static final int abc_cab_background_bottom_holo_light=0x7f02000f;
public static final int abc_cab_background_top_holo_dark=0x7f020010;
public static final int abc_cab_background_top_holo_light=0x7f020011;
public static final int abc_ic_ab_back_holo_dark=0x7f020012;
public static final int abc_ic_ab_back_holo_light=0x7f020013;
public static final int abc_ic_cab_done_holo_dark=0x7f020014;
public static final int abc_ic_cab_done_holo_light=0x7f020015;
public static final int abc_ic_clear=0x7f020016;
public static final int abc_ic_clear_disabled=0x7f020017;
public static final int abc_ic_clear_holo_light=0x7f020018;
public static final int abc_ic_clear_normal=0x7f020019;
public static final int abc_ic_clear_search_api_disabled_holo_light=0x7f02001a;
public static final int abc_ic_clear_search_api_holo_light=0x7f02001b;
public static final int abc_ic_commit_search_api_holo_dark=0x7f02001c;
public static final int abc_ic_commit_search_api_holo_light=0x7f02001d;
public static final int abc_ic_go=0x7f02001e;
public static final int abc_ic_go_search_api_holo_light=0x7f02001f;
public static final int abc_ic_menu_moreoverflow_normal_holo_dark=0x7f020020;
public static final int abc_ic_menu_moreoverflow_normal_holo_light=0x7f020021;
public static final int abc_ic_menu_share_holo_dark=0x7f020022;
public static final int abc_ic_menu_share_holo_light=0x7f020023;
public static final int abc_ic_search=0x7f020024;
public static final int abc_ic_search_api_holo_light=0x7f020025;
public static final int abc_ic_voice_search=0x7f020026;
public static final int abc_ic_voice_search_api_holo_light=0x7f020027;
public static final int abc_item_background_holo_dark=0x7f020028;
public static final int abc_item_background_holo_light=0x7f020029;
public static final int abc_list_divider_holo_dark=0x7f02002a;
public static final int abc_list_divider_holo_light=0x7f02002b;
public static final int abc_list_focused_holo=0x7f02002c;
public static final int abc_list_longpressed_holo=0x7f02002d;
public static final int abc_list_pressed_holo_dark=0x7f02002e;
public static final int abc_list_pressed_holo_light=0x7f02002f;
public static final int abc_list_selector_background_transition_holo_dark=0x7f020030;
public static final int abc_list_selector_background_transition_holo_light=0x7f020031;
public static final int abc_list_selector_disabled_holo_dark=0x7f020032;
public static final int abc_list_selector_disabled_holo_light=0x7f020033;
public static final int abc_list_selector_holo_dark=0x7f020034;
public static final int abc_list_selector_holo_light=0x7f020035;
public static final int abc_menu_dropdown_panel_holo_dark=0x7f020036;
public static final int abc_menu_dropdown_panel_holo_light=0x7f020037;
public static final int abc_menu_hardkey_panel_holo_dark=0x7f020038;
public static final int abc_menu_hardkey_panel_holo_light=0x7f020039;
public static final int abc_search_dropdown_dark=0x7f02003a;
public static final int abc_search_dropdown_light=0x7f02003b;
public static final int abc_spinner_ab_default_holo_dark=0x7f02003c;
public static final int abc_spinner_ab_default_holo_light=0x7f02003d;
public static final int abc_spinner_ab_disabled_holo_dark=0x7f02003e;
public static final int abc_spinner_ab_disabled_holo_light=0x7f02003f;
public static final int abc_spinner_ab_focused_holo_dark=0x7f020040;
public static final int abc_spinner_ab_focused_holo_light=0x7f020041;
public static final int abc_spinner_ab_holo_dark=0x7f020042;
public static final int abc_spinner_ab_holo_light=0x7f020043;
public static final int abc_spinner_ab_pressed_holo_dark=0x7f020044;
public static final int abc_spinner_ab_pressed_holo_light=0x7f020045;
public static final int abc_tab_indicator_ab_holo=0x7f020046;
public static final int abc_tab_selected_focused_holo=0x7f020047;
public static final int abc_tab_selected_holo=0x7f020048;
public static final int abc_tab_selected_pressed_holo=0x7f020049;
public static final int abc_tab_unselected_pressed_holo=0x7f02004a;
public static final int abc_textfield_search_default_holo_dark=0x7f02004b;
public static final int abc_textfield_search_default_holo_light=0x7f02004c;
public static final int abc_textfield_search_right_default_holo_dark=0x7f02004d;
public static final int abc_textfield_search_right_default_holo_light=0x7f02004e;
public static final int abc_textfield_search_right_selected_holo_dark=0x7f02004f;
public static final int abc_textfield_search_right_selected_holo_light=0x7f020050;
public static final int abc_textfield_search_selected_holo_dark=0x7f020051;
public static final int abc_textfield_search_selected_holo_light=0x7f020052;
public static final int abc_textfield_searchview_holo_dark=0x7f020053;
public static final int abc_textfield_searchview_holo_light=0x7f020054;
public static final int abc_textfield_searchview_right_holo_dark=0x7f020055;
public static final int abc_textfield_searchview_right_holo_light=0x7f020056;
public static final int ic_launcher=0x7f020057;
}
public static final class id {
public static final int action_bar=0x7f07001a;
public static final int action_bar_activity_content=0x7f070014;
public static final int action_bar_container=0x7f070019;
public static final int action_bar_overlay_layout=0x7f07001d;
public static final int action_bar_root=0x7f070018;
public static final int action_bar_subtitle=0x7f070021;
public static final int action_bar_title=0x7f070020;
public static final int action_context_bar=0x7f07001b;
public static final int action_menu_divider=0x7f070015;
public static final int action_menu_presenter=0x7f070016;
public static final int action_mode_bar=0x7f07002f;
public static final int action_mode_bar_stub=0x7f07002e;
public static final int action_mode_close_button=0x7f070022;
public static final int action_settings=0x7f070043;
public static final int activity_chooser_view_content=0x7f070023;
public static final int always=0x7f07000f;
public static final int beginning=0x7f07000a;
public static final int checkbox=0x7f07002b;
public static final int collapseActionView=0x7f070011;
public static final int container=0x7f070042;
public static final int default_activity_button=0x7f070026;
public static final int dialog=0x7f070012;
public static final int disableHome=0x7f070008;
public static final int dropdown=0x7f070013;
public static final int edit_query=0x7f070036;
public static final int end=0x7f07000c;
public static final int expand_activities_button=0x7f070024;
public static final int expanded_menu=0x7f07002a;
public static final int home=0x7f070017;
public static final int homeAsUp=0x7f070005;
public static final int icon=0x7f070028;
public static final int ifRoom=0x7f07000e;
public static final int image=0x7f070025;
public static final int left_icon=0x7f070031;
public static final int listMode=0x7f070001;
public static final int list_item=0x7f070027;
public static final int middle=0x7f07000b;
public static final int never=0x7f07000d;
public static final int none=0x7f070009;
public static final int normal=0x7f070000;
public static final int progress_circular=0x7f070034;
public static final int progress_horizontal=0x7f070035;
public static final int radio=0x7f07002d;
public static final int right_container=0x7f070032;
public static final int right_icon=0x7f070033;
public static final int search_badge=0x7f070038;
public static final int search_bar=0x7f070037;
public static final int search_button=0x7f070039;
public static final int search_close_btn=0x7f07003e;
public static final int search_edit_frame=0x7f07003a;
public static final int search_go_btn=0x7f070040;
public static final int search_mag_icon=0x7f07003b;
public static final int search_plate=0x7f07003c;
public static final int search_src_text=0x7f07003d;
public static final int search_voice_btn=0x7f070041;
public static final int shortcut=0x7f07002c;
public static final int showCustom=0x7f070007;
public static final int showHome=0x7f070004;
public static final int showTitle=0x7f070006;
public static final int split_action_bar=0x7f07001c;
public static final int submit_area=0x7f07003f;
public static final int tabMode=0x7f070002;
public static final int title=0x7f070029;
public static final int title_container=0x7f070030;
public static final int top_action_bar=0x7f07001e;
public static final int up=0x7f07001f;
public static final int useLogo=0x7f070003;
public static final int withText=0x7f070010;
}
public static final class integer {
public static final int abc_max_action_buttons=0x7f090000;
}
public static final class layout {
public static final int abc_action_bar_decor=0x7f030000;
public static final int abc_action_bar_decor_include=0x7f030001;
public static final int abc_action_bar_decor_overlay=0x7f030002;
public static final int abc_action_bar_home=0x7f030003;
public static final int abc_action_bar_tab=0x7f030004;
public static final int abc_action_bar_tabbar=0x7f030005;
public static final int abc_action_bar_title_item=0x7f030006;
public static final int abc_action_bar_view_list_nav_layout=0x7f030007;
public static final int abc_action_menu_item_layout=0x7f030008;
public static final int abc_action_menu_layout=0x7f030009;
public static final int abc_action_mode_bar=0x7f03000a;
public static final int abc_action_mode_close_item=0x7f03000b;
public static final int abc_activity_chooser_view=0x7f03000c;
public static final int abc_activity_chooser_view_include=0x7f03000d;
public static final int abc_activity_chooser_view_list_item=0x7f03000e;
public static final int abc_expanded_menu_layout=0x7f03000f;
public static final int abc_list_menu_item_checkbox=0x7f030010;
public static final int abc_list_menu_item_icon=0x7f030011;
public static final int abc_list_menu_item_layout=0x7f030012;
public static final int abc_list_menu_item_radio=0x7f030013;
public static final int abc_popup_menu_item_layout=0x7f030014;
public static final int abc_screen=0x7f030015;
public static final int abc_search_dropdown_item_icons_2line=0x7f030016;
public static final int abc_search_view=0x7f030017;
public static final int activity_main=0x7f030018;
public static final int fragment_main=0x7f030019;
public static final int support_simple_spinner_dropdown_item=0x7f03001a;
}
public static final class menu {
public static final int main=0x7f0c0000;
}
public static final class string {
public static final int abc_action_bar_home_description=0x7f0a0000;
public static final int abc_action_bar_up_description=0x7f0a0001;
public static final int abc_action_menu_overflow_description=0x7f0a0002;
public static final int abc_action_mode_done=0x7f0a0003;
public static final int abc_activity_chooser_view_see_all=0x7f0a0004;
public static final int abc_activitychooserview_choose_application=0x7f0a0005;
public static final int abc_searchview_description_clear=0x7f0a0006;
public static final int abc_searchview_description_query=0x7f0a0007;
public static final int abc_searchview_description_search=0x7f0a0008;
public static final int abc_searchview_description_submit=0x7f0a0009;
public static final int abc_searchview_description_voice=0x7f0a000a;
public static final int abc_shareactionprovider_share_with=0x7f0a000b;
public static final int abc_shareactionprovider_share_with_application=0x7f0a000c;
public static final int action_settings=0x7f0a000d;
public static final int app_name=0x7f0a000e;
public static final int hello_world=0x7f0a000f;
}
public static final class style {
/** Customize your theme here.
*/
public static final int AppTheme=0x7f0b0000;
public static final int TextAppearance_AppCompat_Base_CompactMenu_Dialog=0x7f0b0001;
public static final int TextAppearance_AppCompat_Base_SearchResult=0x7f0b0002;
public static final int TextAppearance_AppCompat_Base_SearchResult_Subtitle=0x7f0b0003;
public static final int TextAppearance_AppCompat_Base_SearchResult_Title=0x7f0b0004;
public static final int TextAppearance_AppCompat_Base_Widget_PopupMenu_Large=0x7f0b0005;
public static final int TextAppearance_AppCompat_Base_Widget_PopupMenu_Small=0x7f0b0006;
public static final int TextAppearance_AppCompat_Light_Base_SearchResult=0x7f0b0007;
public static final int TextAppearance_AppCompat_Light_Base_SearchResult_Subtitle=0x7f0b0008;
public static final int TextAppearance_AppCompat_Light_Base_SearchResult_Title=0x7f0b0009;
public static final int TextAppearance_AppCompat_Light_Base_Widget_PopupMenu_Large=0x7f0b000a;
public static final int TextAppearance_AppCompat_Light_Base_Widget_PopupMenu_Small=0x7f0b000b;
public static final int TextAppearance_AppCompat_Light_SearchResult_Subtitle=0x7f0b000c;
public static final int TextAppearance_AppCompat_Light_SearchResult_Title=0x7f0b000d;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large=0x7f0b000e;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small=0x7f0b000f;
public static final int TextAppearance_AppCompat_SearchResult_Subtitle=0x7f0b0010;
public static final int TextAppearance_AppCompat_SearchResult_Title=0x7f0b0011;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Menu=0x7f0b0012;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle=0x7f0b0013;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse=0x7f0b0014;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title=0x7f0b0015;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse=0x7f0b0016;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle=0x7f0b0017;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse=0x7f0b0018;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title=0x7f0b0019;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse=0x7f0b001a;
public static final int TextAppearance_AppCompat_Widget_Base_ActionBar_Menu=0x7f0b001b;
public static final int TextAppearance_AppCompat_Widget_Base_ActionBar_Subtitle=0x7f0b001c;
public static final int TextAppearance_AppCompat_Widget_Base_ActionBar_Subtitle_Inverse=0x7f0b001d;
public static final int TextAppearance_AppCompat_Widget_Base_ActionBar_Title=0x7f0b001e;
public static final int TextAppearance_AppCompat_Widget_Base_ActionBar_Title_Inverse=0x7f0b001f;
public static final int TextAppearance_AppCompat_Widget_Base_ActionMode_Subtitle=0x7f0b0020;
public static final int TextAppearance_AppCompat_Widget_Base_ActionMode_Subtitle_Inverse=0x7f0b0021;
public static final int TextAppearance_AppCompat_Widget_Base_ActionMode_Title=0x7f0b0022;
public static final int TextAppearance_AppCompat_Widget_Base_ActionMode_Title_Inverse=0x7f0b0023;
public static final int TextAppearance_AppCompat_Widget_Base_DropDownItem=0x7f0b0024;
public static final int TextAppearance_AppCompat_Widget_DropDownItem=0x7f0b0025;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Large=0x7f0b0026;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Small=0x7f0b0027;
public static final int TextAppearance_Widget_AppCompat_Base_ExpandedMenu_Item=0x7f0b0028;
public static final int TextAppearance_Widget_AppCompat_ExpandedMenu_Item=0x7f0b0029;
public static final int Theme_AppCompat=0x7f0b002a;
public static final int Theme_AppCompat_Base_CompactMenu=0x7f0b002b;
public static final int Theme_AppCompat_Base_CompactMenu_Dialog=0x7f0b002c;
public static final int Theme_AppCompat_CompactMenu=0x7f0b002d;
public static final int Theme_AppCompat_CompactMenu_Dialog=0x7f0b002e;
public static final int Theme_AppCompat_Light=0x7f0b002f;
public static final int Theme_AppCompat_Light_DarkActionBar=0x7f0b0030;
public static final int Theme_Base=0x7f0b0031;
public static final int Theme_Base_AppCompat=0x7f0b0032;
public static final int Theme_Base_AppCompat_Light=0x7f0b0033;
public static final int Theme_Base_AppCompat_Light_DarkActionBar=0x7f0b0034;
public static final int Theme_Base_Light=0x7f0b0035;
public static final int Widget_AppCompat_ActionBar=0x7f0b0036;
public static final int Widget_AppCompat_ActionBar_Solid=0x7f0b0037;
public static final int Widget_AppCompat_ActionBar_TabBar=0x7f0b0038;
public static final int Widget_AppCompat_ActionBar_TabText=0x7f0b0039;
public static final int Widget_AppCompat_ActionBar_TabView=0x7f0b003a;
public static final int Widget_AppCompat_ActionButton=0x7f0b003b;
public static final int Widget_AppCompat_ActionButton_CloseMode=0x7f0b003c;
public static final int Widget_AppCompat_ActionButton_Overflow=0x7f0b003d;
public static final int Widget_AppCompat_ActionMode=0x7f0b003e;
public static final int Widget_AppCompat_ActivityChooserView=0x7f0b003f;
public static final int Widget_AppCompat_AutoCompleteTextView=0x7f0b0040;
public static final int Widget_AppCompat_Base_ActionBar=0x7f0b0041;
public static final int Widget_AppCompat_Base_ActionBar_Solid=0x7f0b0042;
public static final int Widget_AppCompat_Base_ActionBar_TabBar=0x7f0b0043;
public static final int Widget_AppCompat_Base_ActionBar_TabText=0x7f0b0044;
public static final int Widget_AppCompat_Base_ActionBar_TabView=0x7f0b0045;
public static final int Widget_AppCompat_Base_ActionButton=0x7f0b0046;
public static final int Widget_AppCompat_Base_ActionButton_CloseMode=0x7f0b0047;
public static final int Widget_AppCompat_Base_ActionButton_Overflow=0x7f0b0048;
public static final int Widget_AppCompat_Base_ActionMode=0x7f0b0049;
public static final int Widget_AppCompat_Base_ActivityChooserView=0x7f0b004a;
public static final int Widget_AppCompat_Base_AutoCompleteTextView=0x7f0b004b;
public static final int Widget_AppCompat_Base_DropDownItem_Spinner=0x7f0b004c;
public static final int Widget_AppCompat_Base_ListView_DropDown=0x7f0b004d;
public static final int Widget_AppCompat_Base_ListView_Menu=0x7f0b004e;
public static final int Widget_AppCompat_Base_PopupMenu=0x7f0b004f;
public static final int Widget_AppCompat_Base_ProgressBar=0x7f0b0050;
public static final int Widget_AppCompat_Base_ProgressBar_Horizontal=0x7f0b0051;
public static final int Widget_AppCompat_Base_Spinner=0x7f0b0052;
public static final int Widget_AppCompat_DropDownItem_Spinner=0x7f0b0053;
public static final int Widget_AppCompat_Light_ActionBar=0x7f0b0054;
public static final int Widget_AppCompat_Light_ActionBar_Solid=0x7f0b0055;
public static final int Widget_AppCompat_Light_ActionBar_Solid_Inverse=0x7f0b0056;
public static final int Widget_AppCompat_Light_ActionBar_TabBar=0x7f0b0057;
public static final int Widget_AppCompat_Light_ActionBar_TabBar_Inverse=0x7f0b0058;
public static final int Widget_AppCompat_Light_ActionBar_TabText=0x7f0b0059;
public static final int Widget_AppCompat_Light_ActionBar_TabText_Inverse=0x7f0b005a;
public static final int Widget_AppCompat_Light_ActionBar_TabView=0x7f0b005b;
public static final int Widget_AppCompat_Light_ActionBar_TabView_Inverse=0x7f0b005c;
public static final int Widget_AppCompat_Light_ActionButton=0x7f0b005d;
public static final int Widget_AppCompat_Light_ActionButton_CloseMode=0x7f0b005e;
public static final int Widget_AppCompat_Light_ActionButton_Overflow=0x7f0b005f;
public static final int Widget_AppCompat_Light_ActionMode_Inverse=0x7f0b0060;
public static final int Widget_AppCompat_Light_ActivityChooserView=0x7f0b0061;
public static final int Widget_AppCompat_Light_AutoCompleteTextView=0x7f0b0062;
public static final int Widget_AppCompat_Light_Base_ActionBar=0x7f0b0063;
public static final int Widget_AppCompat_Light_Base_ActionBar_Solid=0x7f0b0064;
public static final int Widget_AppCompat_Light_Base_ActionBar_Solid_Inverse=0x7f0b0065;
public static final int Widget_AppCompat_Light_Base_ActionBar_TabBar=0x7f0b0066;
public static final int Widget_AppCompat_Light_Base_ActionBar_TabBar_Inverse=0x7f0b0067;
public static final int Widget_AppCompat_Light_Base_ActionBar_TabText=0x7f0b0068;
public static final int Widget_AppCompat_Light_Base_ActionBar_TabText_Inverse=0x7f0b0069;
public static final int Widget_AppCompat_Light_Base_ActionBar_TabView=0x7f0b006a;
public static final int Widget_AppCompat_Light_Base_ActionBar_TabView_Inverse=0x7f0b006b;
public static final int Widget_AppCompat_Light_Base_ActionButton=0x7f0b006c;
public static final int Widget_AppCompat_Light_Base_ActionButton_CloseMode=0x7f0b006d;
public static final int Widget_AppCompat_Light_Base_ActionButton_Overflow=0x7f0b006e;
public static final int Widget_AppCompat_Light_Base_ActionMode_Inverse=0x7f0b006f;
public static final int Widget_AppCompat_Light_Base_ActivityChooserView=0x7f0b0070;
public static final int Widget_AppCompat_Light_Base_AutoCompleteTextView=0x7f0b0071;
public static final int Widget_AppCompat_Light_Base_DropDownItem_Spinner=0x7f0b0072;
public static final int Widget_AppCompat_Light_Base_ListView_DropDown=0x7f0b0073;
public static final int Widget_AppCompat_Light_Base_PopupMenu=0x7f0b0074;
public static final int Widget_AppCompat_Light_Base_Spinner=0x7f0b0075;
public static final int Widget_AppCompat_Light_DropDownItem_Spinner=0x7f0b0076;
public static final int Widget_AppCompat_Light_ListView_DropDown=0x7f0b0077;
public static final int Widget_AppCompat_Light_PopupMenu=0x7f0b0078;
public static final int Widget_AppCompat_Light_Spinner_DropDown_ActionBar=0x7f0b0079;
public static final int Widget_AppCompat_ListView_DropDown=0x7f0b007a;
public static final int Widget_AppCompat_ListView_Menu=0x7f0b007b;
public static final int Widget_AppCompat_PopupMenu=0x7f0b007c;
public static final int Widget_AppCompat_ProgressBar=0x7f0b007d;
public static final int Widget_AppCompat_ProgressBar_Horizontal=0x7f0b007e;
public static final int Widget_AppCompat_Spinner_DropDown_ActionBar=0x7f0b007f;
}
public static final class styleable {
/** Attributes that can be used with a ActionBar.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #ActionBar_background com.virtualtheologies.helloandroid:background}</code></td><td> Specifies a background drawable for the action bar.</td></tr>
<tr><td><code>{@link #ActionBar_backgroundSplit com.virtualtheologies.helloandroid:backgroundSplit}</code></td><td> Specifies a background drawable for the bottom component of a split action bar.</td></tr>
<tr><td><code>{@link #ActionBar_backgroundStacked com.virtualtheologies.helloandroid:backgroundStacked}</code></td><td> Specifies a background drawable for a second stacked row of the action bar.</td></tr>
<tr><td><code>{@link #ActionBar_customNavigationLayout com.virtualtheologies.helloandroid:customNavigationLayout}</code></td><td> Specifies a layout for custom navigation.</td></tr>
<tr><td><code>{@link #ActionBar_displayOptions com.virtualtheologies.helloandroid:displayOptions}</code></td><td> Options affecting how the action bar is displayed.</td></tr>
<tr><td><code>{@link #ActionBar_divider com.virtualtheologies.helloandroid:divider}</code></td><td> Specifies the drawable used for item dividers.</td></tr>
<tr><td><code>{@link #ActionBar_height com.virtualtheologies.helloandroid:height}</code></td><td> Specifies a fixed height.</td></tr>
<tr><td><code>{@link #ActionBar_homeLayout com.virtualtheologies.helloandroid:homeLayout}</code></td><td> Specifies a layout to use for the "home" section of the action bar.</td></tr>
<tr><td><code>{@link #ActionBar_icon com.virtualtheologies.helloandroid:icon}</code></td><td> Specifies the drawable used for the application icon.</td></tr>
<tr><td><code>{@link #ActionBar_indeterminateProgressStyle com.virtualtheologies.helloandroid:indeterminateProgressStyle}</code></td><td> Specifies a style resource to use for an indeterminate progress spinner.</td></tr>
<tr><td><code>{@link #ActionBar_itemPadding com.virtualtheologies.helloandroid:itemPadding}</code></td><td>
Specifies padding that should be applied to the left and right sides of
system-provided items in the bar.</td></tr>
<tr><td><code>{@link #ActionBar_logo com.virtualtheologies.helloandroid:logo}</code></td><td> Specifies the drawable used for the application logo.</td></tr>
<tr><td><code>{@link #ActionBar_navigationMode com.virtualtheologies.helloandroid:navigationMode}</code></td><td> The type of navigation to use.</td></tr>
<tr><td><code>{@link #ActionBar_progressBarPadding com.virtualtheologies.helloandroid:progressBarPadding}</code></td><td> Specifies the horizontal padding on either end for an embedded progress bar.</td></tr>
<tr><td><code>{@link #ActionBar_progressBarStyle com.virtualtheologies.helloandroid:progressBarStyle}</code></td><td> Specifies a style resource to use for an embedded progress bar.</td></tr>
<tr><td><code>{@link #ActionBar_subtitle com.virtualtheologies.helloandroid:subtitle}</code></td><td> Specifies subtitle text used for navigationMode="normal" </td></tr>
<tr><td><code>{@link #ActionBar_subtitleTextStyle com.virtualtheologies.helloandroid:subtitleTextStyle}</code></td><td> Specifies a style to use for subtitle text.</td></tr>
<tr><td><code>{@link #ActionBar_title com.virtualtheologies.helloandroid:title}</code></td><td> Specifies title text used for navigationMode="normal" </td></tr>
<tr><td><code>{@link #ActionBar_titleTextStyle com.virtualtheologies.helloandroid:titleTextStyle}</code></td><td> Specifies a style to use for title text.</td></tr>
</table>
@see #ActionBar_background
@see #ActionBar_backgroundSplit
@see #ActionBar_backgroundStacked
@see #ActionBar_customNavigationLayout
@see #ActionBar_displayOptions
@see #ActionBar_divider
@see #ActionBar_height
@see #ActionBar_homeLayout
@see #ActionBar_icon
@see #ActionBar_indeterminateProgressStyle
@see #ActionBar_itemPadding
@see #ActionBar_logo
@see #ActionBar_navigationMode
@see #ActionBar_progressBarPadding
@see #ActionBar_progressBarStyle
@see #ActionBar_subtitle
@see #ActionBar_subtitleTextStyle
@see #ActionBar_title
@see #ActionBar_titleTextStyle
*/
public static final int[] ActionBar = {
0x7f010020, 0x7f01003e, 0x7f01003f, 0x7f010040,
0x7f010041, 0x7f010042, 0x7f010043, 0x7f010044,
0x7f010045, 0x7f010046, 0x7f010047, 0x7f010048,
0x7f010049, 0x7f01004a, 0x7f01004b, 0x7f01004c,
0x7f01004d, 0x7f01004e, 0x7f01004f
};
/**
<p>
@attr description
Specifies a background drawable for the action bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:background
*/
public static final int ActionBar_background = 10;
/**
<p>
@attr description
Specifies a background drawable for the bottom component of a split action bar.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:backgroundSplit
*/
public static final int ActionBar_backgroundSplit = 12;
/**
<p>
@attr description
Specifies a background drawable for a second stacked row of the action bar.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:backgroundStacked
*/
public static final int ActionBar_backgroundStacked = 11;
/**
<p>
@attr description
Specifies a layout for custom navigation. Overrides navigationMode.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:customNavigationLayout
*/
public static final int ActionBar_customNavigationLayout = 13;
/**
<p>
@attr description
Options affecting how the action bar is displayed.
<p>Must be one or more (separated by '|') of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>useLogo</code></td><td>0x1</td><td></td></tr>
<tr><td><code>showHome</code></td><td>0x2</td><td></td></tr>
<tr><td><code>homeAsUp</code></td><td>0x4</td><td></td></tr>
<tr><td><code>showTitle</code></td><td>0x8</td><td></td></tr>
<tr><td><code>showCustom</code></td><td>0x10</td><td></td></tr>
<tr><td><code>disableHome</code></td><td>0x20</td><td></td></tr>
</table>
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:displayOptions
*/
public static final int ActionBar_displayOptions = 3;
/**
<p>
@attr description
Specifies the drawable used for item dividers.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:divider
*/
public static final int ActionBar_divider = 9;
/**
<p>
@attr description
Specifies a fixed height.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:height
*/
public static final int ActionBar_height = 0;
/**
<p>
@attr description
Specifies a layout to use for the "home" section of the action bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:homeLayout
*/
public static final int ActionBar_homeLayout = 14;
/**
<p>
@attr description
Specifies the drawable used for the application icon.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:icon
*/
public static final int ActionBar_icon = 7;
/**
<p>
@attr description
Specifies a style resource to use for an indeterminate progress spinner.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:indeterminateProgressStyle
*/
public static final int ActionBar_indeterminateProgressStyle = 16;
/**
<p>
@attr description
Specifies padding that should be applied to the left and right sides of
system-provided items in the bar.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:itemPadding
*/
public static final int ActionBar_itemPadding = 18;
/**
<p>
@attr description
Specifies the drawable used for the application logo.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:logo
*/
public static final int ActionBar_logo = 8;
/**
<p>
@attr description
The type of navigation to use.
<p>Must be one of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>normal</code></td><td>0</td><td> Normal static title text </td></tr>
<tr><td><code>listMode</code></td><td>1</td><td> The action bar will use a selection list for navigation. </td></tr>
<tr><td><code>tabMode</code></td><td>2</td><td> The action bar will use a series of horizontal tabs for navigation. </td></tr>
</table>
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:navigationMode
*/
public static final int ActionBar_navigationMode = 2;
/**
<p>
@attr description
Specifies the horizontal padding on either end for an embedded progress bar.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:progressBarPadding
*/
public static final int ActionBar_progressBarPadding = 17;
/**
<p>
@attr description
Specifies a style resource to use for an embedded progress bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:progressBarStyle
*/
public static final int ActionBar_progressBarStyle = 15;
/**
<p>
@attr description
Specifies subtitle text used for navigationMode="normal"
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:subtitle
*/
public static final int ActionBar_subtitle = 4;
/**
<p>
@attr description
Specifies a style to use for subtitle text.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:subtitleTextStyle
*/
public static final int ActionBar_subtitleTextStyle = 6;
/**
<p>
@attr description
Specifies title text used for navigationMode="normal"
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:title
*/
public static final int ActionBar_title = 1;
/**
<p>
@attr description
Specifies a style to use for title text.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:titleTextStyle
*/
public static final int ActionBar_titleTextStyle = 5;
/** Attributes that can be used with a ActionBarLayout.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #ActionBarLayout_android_layout_gravity android:layout_gravity}</code></td><td></td></tr>
</table>
@see #ActionBarLayout_android_layout_gravity
*/
public static final int[] ActionBarLayout = {
0x010100b3
};
/**
<p>This symbol is the offset where the {@link android.R.attr#layout_gravity}
attribute's value can be found in the {@link #ActionBarLayout} array.
@attr name android:layout_gravity
*/
public static final int ActionBarLayout_android_layout_gravity = 0;
/** Attributes that can be used with a ActionBarWindow.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #ActionBarWindow_windowActionBar com.virtualtheologies.helloandroid:windowActionBar}</code></td><td></td></tr>
<tr><td><code>{@link #ActionBarWindow_windowActionBarOverlay com.virtualtheologies.helloandroid:windowActionBarOverlay}</code></td><td></td></tr>
<tr><td><code>{@link #ActionBarWindow_windowSplitActionBar com.virtualtheologies.helloandroid:windowSplitActionBar}</code></td><td></td></tr>
</table>
@see #ActionBarWindow_windowActionBar
@see #ActionBarWindow_windowActionBarOverlay
@see #ActionBarWindow_windowSplitActionBar
*/
public static final int[] ActionBarWindow = {
0x7f010050, 0x7f010051, 0x7f010052
};
/**
<p>This symbol is the offset where the {@link com.virtualtheologies.helloandroid.R.attr#windowActionBar}
attribute's value can be found in the {@link #ActionBarWindow} array.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.virtualtheologies.helloandroid:windowActionBar
*/
public static final int ActionBarWindow_windowActionBar = 0;
/**
<p>This symbol is the offset where the {@link com.virtualtheologies.helloandroid.R.attr#windowActionBarOverlay}
attribute's value can be found in the {@link #ActionBarWindow} array.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.virtualtheologies.helloandroid:windowActionBarOverlay
*/
public static final int ActionBarWindow_windowActionBarOverlay = 1;
/**
<p>This symbol is the offset where the {@link com.virtualtheologies.helloandroid.R.attr#windowSplitActionBar}
attribute's value can be found in the {@link #ActionBarWindow} array.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.virtualtheologies.helloandroid:windowSplitActionBar
*/
public static final int ActionBarWindow_windowSplitActionBar = 2;
/** Attributes that can be used with a ActionMenuItemView.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #ActionMenuItemView_android_minWidth android:minWidth}</code></td><td></td></tr>
</table>
@see #ActionMenuItemView_android_minWidth
*/
public static final int[] ActionMenuItemView = {
0x0101013f
};
/**
<p>This symbol is the offset where the {@link android.R.attr#minWidth}
attribute's value can be found in the {@link #ActionMenuItemView} array.
@attr name android:minWidth
*/
public static final int ActionMenuItemView_android_minWidth = 0;
/** Size of padding on either end of a divider.
*/
public static final int[] ActionMenuView = {
};
/** Attributes that can be used with a ActionMode.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #ActionMode_background com.virtualtheologies.helloandroid:background}</code></td><td> Specifies a background for the action mode bar.</td></tr>
<tr><td><code>{@link #ActionMode_backgroundSplit com.virtualtheologies.helloandroid:backgroundSplit}</code></td><td> Specifies a background for the split action mode bar.</td></tr>
<tr><td><code>{@link #ActionMode_height com.virtualtheologies.helloandroid:height}</code></td><td> Specifies a fixed height for the action mode bar.</td></tr>
<tr><td><code>{@link #ActionMode_subtitleTextStyle com.virtualtheologies.helloandroid:subtitleTextStyle}</code></td><td> Specifies a style to use for subtitle text.</td></tr>
<tr><td><code>{@link #ActionMode_titleTextStyle com.virtualtheologies.helloandroid:titleTextStyle}</code></td><td> Specifies a style to use for title text.</td></tr>
</table>
@see #ActionMode_background
@see #ActionMode_backgroundSplit
@see #ActionMode_height
@see #ActionMode_subtitleTextStyle
@see #ActionMode_titleTextStyle
*/
public static final int[] ActionMode = {
0x7f010020, 0x7f010042, 0x7f010043, 0x7f010047,
0x7f010049
};
/**
<p>
@attr description
Specifies a background for the action mode bar.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:background
*/
public static final int ActionMode_background = 3;
/**
<p>
@attr description
Specifies a background for the split action mode bar.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:backgroundSplit
*/
public static final int ActionMode_backgroundSplit = 4;
/**
<p>
@attr description
Specifies a fixed height for the action mode bar.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:height
*/
public static final int ActionMode_height = 0;
/**
<p>
@attr description
Specifies a style to use for subtitle text.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:subtitleTextStyle
*/
public static final int ActionMode_subtitleTextStyle = 2;
/**
<p>
@attr description
Specifies a style to use for title text.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:titleTextStyle
*/
public static final int ActionMode_titleTextStyle = 1;
/** Attributes that can be used with a ActivityChooserView.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #ActivityChooserView_expandActivityOverflowButtonDrawable com.virtualtheologies.helloandroid:expandActivityOverflowButtonDrawable}</code></td><td>
The drawable to show in the button for expanding the activities overflow popup.</td></tr>
<tr><td><code>{@link #ActivityChooserView_initialActivityCount com.virtualtheologies.helloandroid:initialActivityCount}</code></td><td> The maximal number of items initially shown in the activity list.</td></tr>
</table>
@see #ActivityChooserView_expandActivityOverflowButtonDrawable
@see #ActivityChooserView_initialActivityCount
*/
public static final int[] ActivityChooserView = {
0x7f010053, 0x7f010054
};
/**
<p>
@attr description
The drawable to show in the button for expanding the activities overflow popup.
<strong>Note:</strong> Clients would like to set this drawable
as a clue about the action the chosen activity will perform. For
example, if share activity is to be chosen the drawable should
give a clue that sharing is to be performed.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:expandActivityOverflowButtonDrawable
*/
public static final int ActivityChooserView_expandActivityOverflowButtonDrawable = 1;
/**
<p>
@attr description
The maximal number of items initially shown in the activity list.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:initialActivityCount
*/
public static final int ActivityChooserView_initialActivityCount = 0;
/** Attributes that can be used with a CompatTextView.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #CompatTextView_textAllCaps com.virtualtheologies.helloandroid:textAllCaps}</code></td><td> Present the text in ALL CAPS.</td></tr>
</table>
@see #CompatTextView_textAllCaps
*/
public static final int[] CompatTextView = {
0x7f010055
};
/**
<p>
@attr description
Present the text in ALL CAPS. This may use a small-caps form when available.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:textAllCaps
*/
public static final int CompatTextView_textAllCaps = 0;
/** Attributes that can be used with a LinearLayoutICS.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #LinearLayoutICS_divider com.virtualtheologies.helloandroid:divider}</code></td><td> Drawable to use as a vertical divider between buttons.</td></tr>
<tr><td><code>{@link #LinearLayoutICS_dividerPadding com.virtualtheologies.helloandroid:dividerPadding}</code></td><td> Size of padding on either end of a divider.</td></tr>
<tr><td><code>{@link #LinearLayoutICS_showDividers com.virtualtheologies.helloandroid:showDividers}</code></td><td> Setting for which dividers to show.</td></tr>
</table>
@see #LinearLayoutICS_divider
@see #LinearLayoutICS_dividerPadding
@see #LinearLayoutICS_showDividers
*/
public static final int[] LinearLayoutICS = {
0x7f010046, 0x7f010056, 0x7f010057
};
/**
<p>
@attr description
Drawable to use as a vertical divider between buttons.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:divider
*/
public static final int LinearLayoutICS_divider = 0;
/**
<p>
@attr description
Size of padding on either end of a divider.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:dividerPadding
*/
public static final int LinearLayoutICS_dividerPadding = 2;
/**
<p>
@attr description
Setting for which dividers to show.
<p>Must be one or more (separated by '|') of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>none</code></td><td>0</td><td></td></tr>
<tr><td><code>beginning</code></td><td>1</td><td></td></tr>
<tr><td><code>middle</code></td><td>2</td><td></td></tr>
<tr><td><code>end</code></td><td>4</td><td></td></tr>
</table>
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:showDividers
*/
public static final int LinearLayoutICS_showDividers = 1;
/** Attributes that can be used with a MenuGroup.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #MenuGroup_android_checkableBehavior android:checkableBehavior}</code></td><td> Whether the items are capable of displaying a check mark.</td></tr>
<tr><td><code>{@link #MenuGroup_android_enabled android:enabled}</code></td><td> Whether the items are enabled.</td></tr>
<tr><td><code>{@link #MenuGroup_android_id android:id}</code></td><td> The ID of the group.</td></tr>
<tr><td><code>{@link #MenuGroup_android_menuCategory android:menuCategory}</code></td><td>
The category applied to all items within this group.</td></tr>
<tr><td><code>{@link #MenuGroup_android_orderInCategory android:orderInCategory}</code></td><td>
The order within the category applied to all items within this group.</td></tr>
<tr><td><code>{@link #MenuGroup_android_visible android:visible}</code></td><td> Whether the items are shown/visible.</td></tr>
</table>
@see #MenuGroup_android_checkableBehavior
@see #MenuGroup_android_enabled
@see #MenuGroup_android_id
@see #MenuGroup_android_menuCategory
@see #MenuGroup_android_orderInCategory
@see #MenuGroup_android_visible
*/
public static final int[] MenuGroup = {
0x0101000e, 0x010100d0, 0x01010194, 0x010101de,
0x010101df, 0x010101e0
};
/**
<p>
@attr description
Whether the items are capable of displaying a check mark.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#checkableBehavior}.
@attr name android:checkableBehavior
*/
public static final int MenuGroup_android_checkableBehavior = 5;
/**
<p>
@attr description
Whether the items are enabled.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#enabled}.
@attr name android:enabled
*/
public static final int MenuGroup_android_enabled = 0;
/**
<p>
@attr description
The ID of the group.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#id}.
@attr name android:id
*/
public static final int MenuGroup_android_id = 1;
/**
<p>
@attr description
The category applied to all items within this group.
(This will be or'ed with the orderInCategory attribute.)
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#menuCategory}.
@attr name android:menuCategory
*/
public static final int MenuGroup_android_menuCategory = 3;
/**
<p>
@attr description
The order within the category applied to all items within this group.
(This will be or'ed with the category attribute.)
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#orderInCategory}.
@attr name android:orderInCategory
*/
public static final int MenuGroup_android_orderInCategory = 4;
/**
<p>
@attr description
Whether the items are shown/visible.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#visible}.
@attr name android:visible
*/
public static final int MenuGroup_android_visible = 2;
/** Attributes that can be used with a MenuItem.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #MenuItem_actionLayout com.virtualtheologies.helloandroid:actionLayout}</code></td><td>
An optional layout to be used as an action view.</td></tr>
<tr><td><code>{@link #MenuItem_actionProviderClass com.virtualtheologies.helloandroid:actionProviderClass}</code></td><td>
The name of an optional ActionProvider class to instantiate an action view
and perform operations such as default action for that menu item.</td></tr>
<tr><td><code>{@link #MenuItem_actionViewClass com.virtualtheologies.helloandroid:actionViewClass}</code></td><td>
The name of an optional View class to instantiate and use as an
action view.</td></tr>
<tr><td><code>{@link #MenuItem_android_alphabeticShortcut android:alphabeticShortcut}</code></td><td>
The alphabetic shortcut key.</td></tr>
<tr><td><code>{@link #MenuItem_android_checkable android:checkable}</code></td><td> Whether the item is capable of displaying a check mark.</td></tr>
<tr><td><code>{@link #MenuItem_android_checked android:checked}</code></td><td>
Whether the item is checked.</td></tr>
<tr><td><code>{@link #MenuItem_android_enabled android:enabled}</code></td><td> Whether the item is enabled.</td></tr>
<tr><td><code>{@link #MenuItem_android_icon android:icon}</code></td><td>
The icon associated with this item.</td></tr>
<tr><td><code>{@link #MenuItem_android_id android:id}</code></td><td> The ID of the item.</td></tr>
<tr><td><code>{@link #MenuItem_android_menuCategory android:menuCategory}</code></td><td>
The category applied to the item.</td></tr>
<tr><td><code>{@link #MenuItem_android_numericShortcut android:numericShortcut}</code></td><td>
The numeric shortcut key.</td></tr>
<tr><td><code>{@link #MenuItem_android_onClick android:onClick}</code></td><td>
Name of a method on the Context used to inflate the menu that will be
called when the item is clicked.</td></tr>
<tr><td><code>{@link #MenuItem_android_orderInCategory android:orderInCategory}</code></td><td>
The order within the category applied to the item.</td></tr>
<tr><td><code>{@link #MenuItem_android_title android:title}</code></td><td> The title associated with the item.</td></tr>
<tr><td><code>{@link #MenuItem_android_titleCondensed android:titleCondensed}</code></td><td>
The condensed title associated with the item.</td></tr>
<tr><td><code>{@link #MenuItem_android_visible android:visible}</code></td><td> Whether the item is shown/visible.</td></tr>
<tr><td><code>{@link #MenuItem_showAsAction com.virtualtheologies.helloandroid:showAsAction}</code></td><td> How this item should display in the Action Bar, if present.</td></tr>
</table>
@see #MenuItem_actionLayout
@see #MenuItem_actionProviderClass
@see #MenuItem_actionViewClass
@see #MenuItem_android_alphabeticShortcut
@see #MenuItem_android_checkable
@see #MenuItem_android_checked
@see #MenuItem_android_enabled
@see #MenuItem_android_icon
@see #MenuItem_android_id
@see #MenuItem_android_menuCategory
@see #MenuItem_android_numericShortcut
@see #MenuItem_android_onClick
@see #MenuItem_android_orderInCategory
@see #MenuItem_android_title
@see #MenuItem_android_titleCondensed
@see #MenuItem_android_visible
@see #MenuItem_showAsAction
*/
public static final int[] MenuItem = {
0x01010002, 0x0101000e, 0x010100d0, 0x01010106,
0x01010194, 0x010101de, 0x010101df, 0x010101e1,
0x010101e2, 0x010101e3, 0x010101e4, 0x010101e5,
0x0101026f, 0x7f010058, 0x7f010059, 0x7f01005a,
0x7f01005b
};
/**
<p>
@attr description
An optional layout to be used as an action view.
See {@link android.view.MenuItem#setActionView(android.view.View)}
for more info.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:actionLayout
*/
public static final int MenuItem_actionLayout = 14;
/**
<p>
@attr description
The name of an optional ActionProvider class to instantiate an action view
and perform operations such as default action for that menu item.
See {@link android.view.MenuItem#setActionProvider(android.view.ActionProvider)}
for more info.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:actionProviderClass
*/
public static final int MenuItem_actionProviderClass = 16;
/**
<p>
@attr description
The name of an optional View class to instantiate and use as an
action view. See {@link android.view.MenuItem#setActionView(android.view.View)}
for more info.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:actionViewClass
*/
public static final int MenuItem_actionViewClass = 15;
/**
<p>
@attr description
The alphabetic shortcut key. This is the shortcut when using a keyboard
with alphabetic keys.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#alphabeticShortcut}.
@attr name android:alphabeticShortcut
*/
public static final int MenuItem_android_alphabeticShortcut = 9;
/**
<p>
@attr description
Whether the item is capable of displaying a check mark.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#checkable}.
@attr name android:checkable
*/
public static final int MenuItem_android_checkable = 11;
/**
<p>
@attr description
Whether the item is checked. Note that you must first have enabled checking with
the checkable attribute or else the check mark will not appear.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#checked}.
@attr name android:checked
*/
public static final int MenuItem_android_checked = 3;
/**
<p>
@attr description
Whether the item is enabled.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#enabled}.
@attr name android:enabled
*/
public static final int MenuItem_android_enabled = 1;
/**
<p>
@attr description
The icon associated with this item. This icon will not always be shown, so
the title should be sufficient in describing this item.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#icon}.
@attr name android:icon
*/
public static final int MenuItem_android_icon = 0;
/**
<p>
@attr description
The ID of the item.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#id}.
@attr name android:id
*/
public static final int MenuItem_android_id = 2;
/**
<p>
@attr description
The category applied to the item.
(This will be or'ed with the orderInCategory attribute.)
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#menuCategory}.
@attr name android:menuCategory
*/
public static final int MenuItem_android_menuCategory = 5;
/**
<p>
@attr description
The numeric shortcut key. This is the shortcut when using a numeric (e.g., 12-key)
keyboard.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#numericShortcut}.
@attr name android:numericShortcut
*/
public static final int MenuItem_android_numericShortcut = 10;
/**
<p>
@attr description
Name of a method on the Context used to inflate the menu that will be
called when the item is clicked.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#onClick}.
@attr name android:onClick
*/
public static final int MenuItem_android_onClick = 12;
/**
<p>
@attr description
The order within the category applied to the item.
(This will be or'ed with the category attribute.)
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#orderInCategory}.
@attr name android:orderInCategory
*/
public static final int MenuItem_android_orderInCategory = 6;
/**
<p>
@attr description
The title associated with the item.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#title}.
@attr name android:title
*/
public static final int MenuItem_android_title = 7;
/**
<p>
@attr description
The condensed title associated with the item. This is used in situations where the
normal title may be too long to be displayed.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#titleCondensed}.
@attr name android:titleCondensed
*/
public static final int MenuItem_android_titleCondensed = 8;
/**
<p>
@attr description
Whether the item is shown/visible.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#visible}.
@attr name android:visible
*/
public static final int MenuItem_android_visible = 4;
/**
<p>
@attr description
How this item should display in the Action Bar, if present.
<p>Must be one or more (separated by '|') of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>never</code></td><td>0</td><td>
Never show this item in an action bar, show it in the overflow menu instead.
Mutually exclusive with "ifRoom" and "always".
</td></tr>
<tr><td><code>ifRoom</code></td><td>1</td><td>
Show this item in an action bar if there is room for it as determined
by the system. Favor this option over "always" where possible.
Mutually exclusive with "never" and "always".
</td></tr>
<tr><td><code>always</code></td><td>2</td><td>
Always show this item in an actionbar, even if it would override
the system's limits of how much stuff to put there. This may make
your action bar look bad on some screens. In most cases you should
use "ifRoom" instead. Mutually exclusive with "ifRoom" and "never".
</td></tr>
<tr><td><code>withText</code></td><td>4</td><td>
When this item is shown as an action in the action bar, show a text
label with it even if it has an icon representation.
</td></tr>
<tr><td><code>collapseActionView</code></td><td>8</td><td>
This item's action view collapses to a normal menu
item. When expanded, the action view takes over a
larger segment of its container.
</td></tr>
</table>
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:showAsAction
*/
public static final int MenuItem_showAsAction = 13;
/** Attributes that can be used with a MenuView.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #MenuView_android_headerBackground android:headerBackground}</code></td><td> Default background for the menu header.</td></tr>
<tr><td><code>{@link #MenuView_android_horizontalDivider android:horizontalDivider}</code></td><td> Default horizontal divider between rows of menu items.</td></tr>
<tr><td><code>{@link #MenuView_android_itemBackground android:itemBackground}</code></td><td> Default background for each menu item.</td></tr>
<tr><td><code>{@link #MenuView_android_itemIconDisabledAlpha android:itemIconDisabledAlpha}</code></td><td> Default disabled icon alpha for each menu item that shows an icon.</td></tr>
<tr><td><code>{@link #MenuView_android_itemTextAppearance android:itemTextAppearance}</code></td><td> Default appearance of menu item text.</td></tr>
<tr><td><code>{@link #MenuView_android_preserveIconSpacing android:preserveIconSpacing}</code></td><td> Whether space should be reserved in layout when an icon is missing.</td></tr>
<tr><td><code>{@link #MenuView_android_verticalDivider android:verticalDivider}</code></td><td> Default vertical divider between menu items.</td></tr>
<tr><td><code>{@link #MenuView_android_windowAnimationStyle android:windowAnimationStyle}</code></td><td> Default animations for the menu.</td></tr>
</table>
@see #MenuView_android_headerBackground
@see #MenuView_android_horizontalDivider
@see #MenuView_android_itemBackground
@see #MenuView_android_itemIconDisabledAlpha
@see #MenuView_android_itemTextAppearance
@see #MenuView_android_preserveIconSpacing
@see #MenuView_android_verticalDivider
@see #MenuView_android_windowAnimationStyle
*/
public static final int[] MenuView = {
0x010100ae, 0x0101012c, 0x0101012d, 0x0101012e,
0x0101012f, 0x01010130, 0x01010131, 0x0101041a
};
/**
<p>
@attr description
Default background for the menu header.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#headerBackground}.
@attr name android:headerBackground
*/
public static final int MenuView_android_headerBackground = 4;
/**
<p>
@attr description
Default horizontal divider between rows of menu items.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#horizontalDivider}.
@attr name android:horizontalDivider
*/
public static final int MenuView_android_horizontalDivider = 2;
/**
<p>
@attr description
Default background for each menu item.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#itemBackground}.
@attr name android:itemBackground
*/
public static final int MenuView_android_itemBackground = 5;
/**
<p>
@attr description
Default disabled icon alpha for each menu item that shows an icon.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#itemIconDisabledAlpha}.
@attr name android:itemIconDisabledAlpha
*/
public static final int MenuView_android_itemIconDisabledAlpha = 6;
/**
<p>
@attr description
Default appearance of menu item text.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#itemTextAppearance}.
@attr name android:itemTextAppearance
*/
public static final int MenuView_android_itemTextAppearance = 1;
/**
<p>
@attr description
Whether space should be reserved in layout when an icon is missing.
<p>This is a private symbol.
@attr name android:preserveIconSpacing
*/
public static final int MenuView_android_preserveIconSpacing = 7;
/**
<p>
@attr description
Default vertical divider between menu items.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#verticalDivider}.
@attr name android:verticalDivider
*/
public static final int MenuView_android_verticalDivider = 3;
/**
<p>
@attr description
Default animations for the menu.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#windowAnimationStyle}.
@attr name android:windowAnimationStyle
*/
public static final int MenuView_android_windowAnimationStyle = 0;
/** Attributes that can be used with a SearchView.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #SearchView_android_imeOptions android:imeOptions}</code></td><td> The IME options to set on the query text field.</td></tr>
<tr><td><code>{@link #SearchView_android_inputType android:inputType}</code></td><td> The input type to set on the query text field.</td></tr>
<tr><td><code>{@link #SearchView_android_maxWidth android:maxWidth}</code></td><td> An optional maximum width of the SearchView.</td></tr>
<tr><td><code>{@link #SearchView_iconifiedByDefault com.virtualtheologies.helloandroid:iconifiedByDefault}</code></td><td>
The default state of the SearchView.</td></tr>
<tr><td><code>{@link #SearchView_queryHint com.virtualtheologies.helloandroid:queryHint}</code></td><td> An optional query hint string to be displayed in the empty query field.</td></tr>
</table>
@see #SearchView_android_imeOptions
@see #SearchView_android_inputType
@see #SearchView_android_maxWidth
@see #SearchView_iconifiedByDefault
@see #SearchView_queryHint
*/
public static final int[] SearchView = {
0x0101011f, 0x01010220, 0x01010264, 0x7f01005c,
0x7f01005d
};
/**
<p>
@attr description
The IME options to set on the query text field.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#imeOptions}.
@attr name android:imeOptions
*/
public static final int SearchView_android_imeOptions = 2;
/**
<p>
@attr description
The input type to set on the query text field.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#inputType}.
@attr name android:inputType
*/
public static final int SearchView_android_inputType = 1;
/**
<p>
@attr description
An optional maximum width of the SearchView.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#maxWidth}.
@attr name android:maxWidth
*/
public static final int SearchView_android_maxWidth = 0;
/**
<p>
@attr description
The default state of the SearchView. If true, it will be iconified when not in
use and expanded when clicked.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:iconifiedByDefault
*/
public static final int SearchView_iconifiedByDefault = 3;
/**
<p>
@attr description
An optional query hint string to be displayed in the empty query field.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:queryHint
*/
public static final int SearchView_queryHint = 4;
/** Attributes that can be used with a Spinner.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #Spinner_android_dropDownHorizontalOffset android:dropDownHorizontalOffset}</code></td><td>
Horizontal offset from the spinner widget for positioning the dropdown
in spinnerMode="dropdown".</td></tr>
<tr><td><code>{@link #Spinner_android_dropDownSelector android:dropDownSelector}</code></td><td> List selector to use for spinnerMode="dropdown" display.</td></tr>
<tr><td><code>{@link #Spinner_android_dropDownVerticalOffset android:dropDownVerticalOffset}</code></td><td>
Vertical offset from the spinner widget for positioning the dropdown in
spinnerMode="dropdown".</td></tr>
<tr><td><code>{@link #Spinner_android_dropDownWidth android:dropDownWidth}</code></td><td> Width of the dropdown in spinnerMode="dropdown".</td></tr>
<tr><td><code>{@link #Spinner_android_gravity android:gravity}</code></td><td> Gravity setting for positioning the currently selected item.</td></tr>
<tr><td><code>{@link #Spinner_android_popupBackground android:popupBackground}</code></td><td> Background drawable to use for the dropdown in spinnerMode="dropdown".</td></tr>
<tr><td><code>{@link #Spinner_disableChildrenWhenDisabled com.virtualtheologies.helloandroid:disableChildrenWhenDisabled}</code></td><td>
Whether this spinner should mark child views as enabled/disabled when
the spinner itself is enabled/disabled.</td></tr>
<tr><td><code>{@link #Spinner_popupPromptView com.virtualtheologies.helloandroid:popupPromptView}</code></td><td>
Reference to a layout to use for displaying a prompt in the dropdown for
spinnerMode="dropdown".</td></tr>
<tr><td><code>{@link #Spinner_prompt com.virtualtheologies.helloandroid:prompt}</code></td><td> The prompt to display when the spinner's dialog is shown.</td></tr>
<tr><td><code>{@link #Spinner_spinnerMode com.virtualtheologies.helloandroid:spinnerMode}</code></td><td> Display mode for spinner options.</td></tr>
</table>
@see #Spinner_android_dropDownHorizontalOffset
@see #Spinner_android_dropDownSelector
@see #Spinner_android_dropDownVerticalOffset
@see #Spinner_android_dropDownWidth
@see #Spinner_android_gravity
@see #Spinner_android_popupBackground
@see #Spinner_disableChildrenWhenDisabled
@see #Spinner_popupPromptView
@see #Spinner_prompt
@see #Spinner_spinnerMode
*/
public static final int[] Spinner = {
0x010100af, 0x01010175, 0x01010176, 0x01010262,
0x010102ac, 0x010102ad, 0x7f01005e, 0x7f01005f,
0x7f010060, 0x7f010061
};
/**
<p>
@attr description
Horizontal offset from the spinner widget for positioning the dropdown
in spinnerMode="dropdown".
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#dropDownHorizontalOffset}.
@attr name android:dropDownHorizontalOffset
*/
public static final int Spinner_android_dropDownHorizontalOffset = 4;
/**
<p>
@attr description
List selector to use for spinnerMode="dropdown" display.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#dropDownSelector}.
@attr name android:dropDownSelector
*/
public static final int Spinner_android_dropDownSelector = 1;
/**
<p>
@attr description
Vertical offset from the spinner widget for positioning the dropdown in
spinnerMode="dropdown".
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#dropDownVerticalOffset}.
@attr name android:dropDownVerticalOffset
*/
public static final int Spinner_android_dropDownVerticalOffset = 5;
/**
<p>
@attr description
Width of the dropdown in spinnerMode="dropdown".
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#dropDownWidth}.
@attr name android:dropDownWidth
*/
public static final int Spinner_android_dropDownWidth = 3;
/**
<p>
@attr description
Gravity setting for positioning the currently selected item.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#gravity}.
@attr name android:gravity
*/
public static final int Spinner_android_gravity = 0;
/**
<p>
@attr description
Background drawable to use for the dropdown in spinnerMode="dropdown".
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#popupBackground}.
@attr name android:popupBackground
*/
public static final int Spinner_android_popupBackground = 2;
/**
<p>
@attr description
Whether this spinner should mark child views as enabled/disabled when
the spinner itself is enabled/disabled.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:disableChildrenWhenDisabled
*/
public static final int Spinner_disableChildrenWhenDisabled = 9;
/**
<p>
@attr description
Reference to a layout to use for displaying a prompt in the dropdown for
spinnerMode="dropdown". This layout must contain a TextView with the id
{@code @android:id/text1} to be populated with the prompt text.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:popupPromptView
*/
public static final int Spinner_popupPromptView = 8;
/**
<p>
@attr description
The prompt to display when the spinner's dialog is shown.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:prompt
*/
public static final int Spinner_prompt = 6;
/**
<p>
@attr description
Display mode for spinner options.
<p>Must be one of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>dialog</code></td><td>0</td><td> Spinner options will be presented to the user as a dialog window. </td></tr>
<tr><td><code>dropdown</code></td><td>1</td><td>
Spinner options will be presented to the user as an inline dropdown
anchored to the spinner widget itself.
</td></tr>
</table>
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:spinnerMode
*/
public static final int Spinner_spinnerMode = 7;
/** Attributes that can be used with a Theme.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #Theme_actionDropDownStyle com.virtualtheologies.helloandroid:actionDropDownStyle}</code></td><td> Default ActionBar dropdown style.</td></tr>
<tr><td><code>{@link #Theme_dropdownListPreferredItemHeight com.virtualtheologies.helloandroid:dropdownListPreferredItemHeight}</code></td><td> The preferred item height for dropdown lists.</td></tr>
<tr><td><code>{@link #Theme_listChoiceBackgroundIndicator com.virtualtheologies.helloandroid:listChoiceBackgroundIndicator}</code></td><td> Drawable used as a background for selected list items.</td></tr>
<tr><td><code>{@link #Theme_panelMenuListTheme com.virtualtheologies.helloandroid:panelMenuListTheme}</code></td><td> Default Panel Menu style.</td></tr>
<tr><td><code>{@link #Theme_panelMenuListWidth com.virtualtheologies.helloandroid:panelMenuListWidth}</code></td><td> Default Panel Menu width.</td></tr>
<tr><td><code>{@link #Theme_popupMenuStyle com.virtualtheologies.helloandroid:popupMenuStyle}</code></td><td> Default PopupMenu style.</td></tr>
</table>
@see #Theme_actionDropDownStyle
@see #Theme_dropdownListPreferredItemHeight
@see #Theme_listChoiceBackgroundIndicator
@see #Theme_panelMenuListTheme
@see #Theme_panelMenuListWidth
@see #Theme_popupMenuStyle
*/
public static final int[] Theme = {
0x7f010062, 0x7f010063, 0x7f010064, 0x7f010065,
0x7f010066, 0x7f010067
};
/**
<p>
@attr description
Default ActionBar dropdown style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:actionDropDownStyle
*/
public static final int Theme_actionDropDownStyle = 0;
/**
<p>
@attr description
The preferred item height for dropdown lists.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:dropdownListPreferredItemHeight
*/
public static final int Theme_dropdownListPreferredItemHeight = 1;
/**
<p>
@attr description
Drawable used as a background for selected list items.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:listChoiceBackgroundIndicator
*/
public static final int Theme_listChoiceBackgroundIndicator = 5;
/**
<p>
@attr description
Default Panel Menu style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:panelMenuListTheme
*/
public static final int Theme_panelMenuListTheme = 4;
/**
<p>
@attr description
Default Panel Menu width.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:panelMenuListWidth
*/
public static final int Theme_panelMenuListWidth = 3;
/**
<p>
@attr description
Default PopupMenu style.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:popupMenuStyle
*/
public static final int Theme_popupMenuStyle = 2;
/** Attributes that can be used with a View.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #View_android_focusable android:focusable}</code></td><td>
Boolean that controls whether a view can take focus.</td></tr>
<tr><td><code>{@link #View_paddingEnd com.virtualtheologies.helloandroid:paddingEnd}</code></td><td> Sets the padding, in pixels, of the end edge; see {@link android.R.attr#padding}.</td></tr>
<tr><td><code>{@link #View_paddingStart com.virtualtheologies.helloandroid:paddingStart}</code></td><td> Sets the padding, in pixels, of the start edge; see {@link android.R.attr#padding}.</td></tr>
</table>
@see #View_android_focusable
@see #View_paddingEnd
@see #View_paddingStart
*/
public static final int[] View = {
0x010100da, 0x7f010068, 0x7f010069
};
/**
<p>
@attr description
Boolean that controls whether a view can take focus. By default the user can not
move focus to a view; by setting this attribute to true the view is
allowed to take focus. This value does not impact the behavior of
directly calling {@link android.view.View#requestFocus}, which will
always request focus regardless of this view. It only impacts where
focus navigation will try to move focus.
<p>This corresponds to the global attribute
resource symbol {@link android.R.attr#focusable}.
@attr name android:focusable
*/
public static final int View_android_focusable = 0;
/**
<p>
@attr description
Sets the padding, in pixels, of the end edge; see {@link android.R.attr#padding}.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:paddingEnd
*/
public static final int View_paddingEnd = 2;
/**
<p>
@attr description
Sets the padding, in pixels, of the start edge; see {@link android.R.attr#padding}.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>This is a private symbol.
@attr name com.virtualtheologies.helloandroid:paddingStart
*/
public static final int View_paddingStart = 1;
};
}
| [
"[email protected]"
] | |
c4dea28326ffa5f52a4006e7fc83a20991f4d46c | 45f30472f4a8a94f1a026eeefd01b6fc93d9a567 | /p6/ast.java | f28737e73708223488485a6b9a9e5b4c859771a1 | [] | no_license | danghao96/Compiler | 5e97ea9de7a5cad6d403544947b73e38803db56c | 567009784dc9ea29f84670078d345ca03a70a217 | refs/heads/master | 2020-05-19T22:34:29.009269 | 2019-05-07T01:45:35 | 2019-05-07T01:45:35 | 185,249,359 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 81,813 | java | import java.io.*;
import java.util.*;
// **********************************************************************
// The ASTnode class defines the nodes of the abstract-syntax tree that
// represents a C-- program.
//
// Internal nodes of the tree contain pointers to children, organized
// either in a list (for nodes that may have a variable number of
// children) or as a fixed set of fields.
//
// The nodes for literals and ids contain line and character number
// information; for string literals and identifiers, they also contain a
// string; for integer literals, they also contain an integer value.
//
// Here are all the different kinds of AST nodes and what kinds of children
// they have. All of these kinds of AST nodes are subclasses of "ASTnode".
// Indentation indicates further subclassing:
//
// Subclass Kids
// -------- ----
// ProgramNode DeclListNode
// DeclListNode linked list of DeclNode
// DeclNode:
// VarDeclNode TypeNode, IdNode, int
// FnDeclNode TypeNode, IdNode, FormalsListNode, FnBodyNode
// FormalDeclNode TypeNode, IdNode
// StructDeclNode IdNode, DeclListNode
//
// FormalsListNode linked list of FormalDeclNode
// FnBodyNode DeclListNode, StmtListNode
// StmtListNode linked list of StmtNode
// ExpListNode linked list of ExpNode
//
// TypeNode:
// IntNode -- none --
// BoolNode -- none --
// VoidNode -- none --
// StructNode IdNode
//
// StmtNode:
// AssignStmtNode AssignNode
// PostIncStmtNode ExpNode
// PostDecStmtNode ExpNode
// ReadStmtNode ExpNode
// WriteStmtNode ExpNode
// IfStmtNode ExpNode, DeclListNode, StmtListNode
// IfElseStmtNode ExpNode, DeclListNode, StmtListNode,
// DeclListNode, StmtListNode
// WhileStmtNode ExpNode, DeclListNode, StmtListNode
// RepeatStmtNode ExpNode, DeclListNode, StmtListNode
// CallStmtNode CallExpNode
// ReturnStmtNode ExpNode
//
// ExpNode:
// IntLitNode -- none --
// StrLitNode -- none --
// TrueNode -- none --
// FalseNode -- none --
// IdNode -- none --
// DotAccessNode ExpNode, IdNode
// AssignNode ExpNode, ExpNode
// CallExpNode IdNode, ExpListNode
// UnaryExpNode ExpNode
// UnaryMinusNode
// NotNode
// BinaryExpNode ExpNode ExpNode
// PlusNode
// MinusNode
// TimesNode
// DivideNode
// AndNode
// OrNode
// EqualsNode
// NotEqualsNode
// LessNode
// GreaterNode
// LessEqNode
// GreaterEqNode
//
// Here are the different kinds of AST nodes again, organized according to
// whether they are leaves, internal nodes with linked lists of kids, or
// internal nodes with a fixed number of kids:
//
// (1) Leaf nodes:
// IntNode, BoolNode, VoidNode, IntLitNode, StrLitNode,
// TrueNode, FalseNode, IdNode
//
// (2) Internal nodes with (possibly empty) linked lists of children:
// DeclListNode, FormalsListNode, StmtListNode, ExpListNode
//
// (3) Internal nodes with fixed numbers of kids:
// ProgramNode, VarDeclNode, FnDeclNode, FormalDeclNode,
// StructDeclNode, FnBodyNode, StructNode, AssignStmtNode,
// PostIncStmtNode, PostDecStmtNode, ReadStmtNode, WriteStmtNode
// IfStmtNode, IfElseStmtNode, WhileStmtNode, CallStmtNode
// ReturnStmtNode, DotAccessNode, AssignExpNode, CallExpNode,
// UnaryExpNode, BinaryExpNode, UnaryMinusNode, NotNode,
// PlusNode, MinusNode, TimesNode, DivideNode,
// AndNode, OrNode, EqualsNode, NotEqualsNode,
// LessNode, GreaterNode, LessEqNode, GreaterEqNode
//
// **********************************************************************
// **********************************************************************
// ASTnode class (base class for all other kinds of nodes)
// **********************************************************************
abstract class ASTnode {
public void codeGen(PrintWriter p){}
// every subclass must provide an unparse operation
abstract public void unparse(PrintWriter p, int indent);
// this method can be used by the unparse methods to do indenting
protected void doIndent(PrintWriter p, int indent) {
for (int k=0; k<indent; k++) p.print(" ");
}
}
// **********************************************************************
// ProgramNode, DeclListNode, FormalsListNode, FnBodyNode,
// StmtListNode, ExpListNode
// **********************************************************************
class ProgramNode extends ASTnode {
public ProgramNode(DeclListNode L) {
myDeclList = L;
}
/**
* nameAnalysis
* Creates an empty symbol table for the outermost scope, then processes
* all of the globals, struct defintions, and functions in the program.
*/
public void nameAnalysis() {
SymTable symTab = new SymTable();
myDeclList.nameAnalysis(symTab);
Sym s = symTab.lookupGlobal("main");
if(s == null || !(s instanceof FnSym)){
ErrMsg.fatal(0, 0, "No main function");
}
}
/**
* typeCheck
*/
public void typeCheck() {
myDeclList.typeCheck();
}
public void codeGen(PrintWriter p) {
myDeclList.codeGen(p);
}
public void unparse(PrintWriter p, int indent) {
myDeclList.unparse(p, indent);
}
// 1 kid
private DeclListNode myDeclList;
}
class DeclListNode extends ASTnode {
public DeclListNode(List<DeclNode> S) {
myDecls = S;
}
/**
* nameAnalysis
* Given a symbol table symTab, process all of the decls in the list.
*/
public void nameAnalysis(SymTable symTab) {
nameAnalysis(symTab, symTab);
}
/**
* nameAnalysis
* Given a symbol table symTab and a global symbol table globalTab
* (for processing struct names in variable decls), process all of the
* decls in the list.
*/
public void nameAnalysis(SymTable symTab, SymTable globalTab) {
for (DeclNode node : myDecls) {
if (node instanceof VarDeclNode) {
((VarDeclNode)node).nameAnalysis(symTab, globalTab);
} else {
node.nameAnalysis(symTab);
}
}
}
/**
* typeCheck
*/
public void typeCheck() {
for (DeclNode node : myDecls) {
node.typeCheck();
}
}
public void codeGen(PrintWriter p) {
for (DeclNode node : myDecls) {
node.codeGen(p);
}
}
public void unparse(PrintWriter p, int indent) {
Iterator it = myDecls.iterator();
try {
while (it.hasNext()) {
((DeclNode)it.next()).unparse(p, indent);
}
} catch (NoSuchElementException ex) {
System.err.println("unexpected NoSuchElementException in DeclListNode.print");
System.exit(-1);
}
}
// list of kids (DeclNodes)
private List<DeclNode> myDecls;
}
class FormalsListNode extends ASTnode {
public FormalsListNode(List<FormalDeclNode> S) {
myFormals = S;
}
/**
* nameAnalysis
* Given a symbol table symTab, do:
* for each formal decl in the list
* process the formal decl
* if there was no error, add type of formal decl to list
*/
public List<Type> nameAnalysis(SymTable symTab) {
List<Type> typeList = new LinkedList<Type>();
for (FormalDeclNode node : myFormals) {
Sym sym = node.nameAnalysis(symTab);
if (sym != null) {
typeList.add(sym.getType());
}
}
return typeList;
}
/**
* Return the number of formals in this list.
*/
public int length() {
return myFormals.size();
}
public void codeGen(PrintWriter p) {
}
public void unparse(PrintWriter p, int indent) {
Iterator<FormalDeclNode> it = myFormals.iterator();
if (it.hasNext()) { // if there is at least one element
it.next().unparse(p, indent);
while (it.hasNext()) { // print the rest of the list
p.print(", ");
it.next().unparse(p, indent);
}
}
}
// list of kids (FormalDeclNodes)
private List<FormalDeclNode> myFormals;
}
class FnBodyNode extends ASTnode {
public FnBodyNode(DeclListNode declList, StmtListNode stmtList) {
myDeclList = declList;
myStmtList = stmtList;
}
/**
* nameAnalysis
* Given a symbol table symTab, do:
* - process the declaration list
* - process the statement list
*/
public void nameAnalysis(SymTable symTab) {
myDeclList.nameAnalysis(symTab);
myStmtList.nameAnalysis(symTab);
}
/**
* typeCheck
*/
public void typeCheck(Type retType) {
myStmtList.typeCheck(retType);
}
public void codeGen(PrintWriter p, String retLab) {
myStmtList.codeGen(p, retLab);
}
public void unparse(PrintWriter p, int indent) {
myDeclList.unparse(p, indent);
myStmtList.unparse(p, indent);
}
// 2 kids
private DeclListNode myDeclList;
private StmtListNode myStmtList;
}
class StmtListNode extends ASTnode {
public StmtListNode(List<StmtNode> S) {
myStmts = S;
}
/**
* nameAnalysis
* Given a symbol table symTab, process each statement in the list.
*/
public void nameAnalysis(SymTable symTab) {
for (StmtNode node : myStmts) {
node.nameAnalysis(symTab);
}
}
/**
* typeCheck
*/
public void typeCheck(Type retType) {
for(StmtNode node : myStmts) {
node.typeCheck(retType);
}
}
public void codeGen(PrintWriter p, String retLab) {
for(StmtNode node : myStmts) {
if(node instanceof ReturnStmtNode){
((ReturnStmtNode)node).codeGen(p, retLab);
}else{
node.codeGen(p);
}
}
}
public void unparse(PrintWriter p, int indent) {
Iterator<StmtNode> it = myStmts.iterator();
while (it.hasNext()) {
it.next().unparse(p, indent);
}
}
// list of kids (StmtNodes)
private List<StmtNode> myStmts;
}
class ExpListNode extends ASTnode {
public ExpListNode(List<ExpNode> S) {
myExps = S;
}
public int size() {
return myExps.size();
}
/**
* nameAnalysis
* Given a symbol table symTab, process each exp in the list.
*/
public void nameAnalysis(SymTable symTab) {
for (ExpNode node : myExps) {
node.nameAnalysis(symTab);
}
}
/**
* typeCheck
*/
public void typeCheck(List<Type> typeList) {
int k = 0;
try {
for (ExpNode node : myExps) {
Type actualType = node.typeCheck(); // actual type of arg
if (!actualType.isErrorType()) { // if this is not an error
Type formalType = typeList.get(k); // get the formal type
if (!formalType.equals(actualType)) {
ErrMsg.fatal(node.lineNum(), node.charNum(),
"Type of actual does not match type of formal");
}
}
k++;
}
} catch (NoSuchElementException e) {
System.err.println("unexpected NoSuchElementException in ExpListNode.typeCheck");
System.exit(-1);
}
}
public void codeGen(PrintWriter p) {
for (ExpNode node : myExps) {
node.codeGen(p);
}
}
public void unparse(PrintWriter p, int indent) {
Iterator<ExpNode> it = myExps.iterator();
if (it.hasNext()) { // if there is at least one element
it.next().unparse(p, indent);
while (it.hasNext()) { // print the rest of the list
p.print(", ");
it.next().unparse(p, indent);
}
}
}
// list of kids (ExpNodes)
private List<ExpNode> myExps;
}
// **********************************************************************
// DeclNode and its subclasses
// **********************************************************************
abstract class DeclNode extends ASTnode {
/**
* Note: a formal decl needs to return a sym
*/
abstract public Sym nameAnalysis(SymTable symTab);
// default version of typeCheck for non-function decls
public void typeCheck() { }
}
class VarDeclNode extends DeclNode {
public VarDeclNode(TypeNode type, IdNode id, int size) {
myType = type;
myId = id;
mySize = size;
}
/**
* nameAnalysis (overloaded)
* Given a symbol table symTab, do:
* if this name is declared void, then error
* else if the declaration is of a struct type,
* lookup type name (globally)
* if type name doesn't exist, then error
* if no errors so far,
* if name has already been declared in this scope, then error
* else add name to local symbol table
*
* symTab is local symbol table (say, for struct field decls)
* globalTab is global symbol table (for struct type names)
* symTab and globalTab can be the same
*/
public Sym nameAnalysis(SymTable symTab) {
return nameAnalysis(symTab, symTab);
}
public Sym nameAnalysis(SymTable symTab, SymTable globalTab) {
boolean badDecl = false;
String name = myId.name();
Sym sym = null;
IdNode structId = null;
if (myType instanceof VoidNode) { // check for void type
ErrMsg.fatal(myId.lineNum(), myId.charNum(),
"Non-function declared void");
badDecl = true;
}
else if (myType instanceof StructNode) {
structId = ((StructNode)myType).idNode();
sym = globalTab.lookupGlobal(structId.name());
// if the name for the struct type is not found,
// or is not a struct type
if (sym == null || !(sym instanceof StructDefSym)) {
ErrMsg.fatal(structId.lineNum(), structId.charNum(),
"Invalid name of struct type");
badDecl = true;
}
else {
structId.link(sym);
}
}
if (symTab.lookupLocal(name) != null) {
ErrMsg.fatal(myId.lineNum(), myId.charNum(),
"Multiply declared identifier");
badDecl = true;
}
if (!badDecl) { // insert into symbol table
try {
if(symTab.size() == 1){
myId.myIsGlobal = true;
}
if (myType instanceof StructNode) {
sym = new StructSym(structId);
}
else {
sym = new Sym(myType.type());
}
symTab.addDecl(name, sym);
myId.link(sym);
} catch (DuplicateSymException ex) {
System.err.println("Unexpected DuplicateSymException " +
" in VarDeclNode.nameAnalysis");
System.exit(-1);
} catch (EmptySymTableException ex) {
System.err.println("Unexpected EmptySymTableException " +
" in VarDeclNode.nameAnalysis");
System.exit(-1);
} catch (WrongArgumentException ex) {
System.err.println("Unexpected WrongArgumentException " +
" in VarDeclNode.nameAnalysis");
System.exit(-1);
}
}
return sym;
}
public void codeGen(PrintWriter p) {
if(myId.myIsGlobal){
Codegen.p.println("\t.data");
Codegen.p.println("\t.align 2");
Codegen.p.println("_" + myId.name() + ":\t.space 4");
}
}
public void unparse(PrintWriter p, int indent) {
doIndent(p, indent);
myType.unparse(p, 0);
p.print(" ");
p.print(myId.name());
p.println(";");
}
// 3 kids
private TypeNode myType;
private IdNode myId;
private int mySize; // use value NOT_STRUCT if this is not a struct type
public static int NOT_STRUCT = -1;
}
class FnDeclNode extends DeclNode {
public FnDeclNode(TypeNode type,
IdNode id,
FormalsListNode formalList,
FnBodyNode body) {
myType = type;
myId = id;
myFormalsList = formalList;
myBody = body;
}
/**
* nameAnalysis
* Given a symbol table symTab, do:
* if this name has already been declared in this scope, then error
* else add name to local symbol table
* in any case, do the following:
* enter new scope
* process the formals
* if this function is not multiply declared,
* update symbol table entry with types of formals
* process the body of the function
* exit scope
*/
public Sym nameAnalysis(SymTable symTab) {
String name = myId.name();
FnSym sym = null;
if (symTab.lookupLocal(name) != null) {
ErrMsg.fatal(myId.lineNum(), myId.charNum(),
"Multiply declared identifier");
}
else { // add function name to local symbol table
try {
sym = new FnSym(myType.type(), myFormalsList.length());
symTab.addDecl(name, sym);
myId.link(sym);
} catch (DuplicateSymException ex) {
System.err.println("Unexpected DuplicateSymException " +
" in FnDeclNode.nameAnalysis");
System.exit(-1);
} catch (EmptySymTableException ex) {
System.err.println("Unexpected EmptySymTableException " +
" in FnDeclNode.nameAnalysis");
System.exit(-1);
} catch (WrongArgumentException ex) {
System.err.println("Unexpected WrongArgumentException " +
" in FnDeclNode.nameAnalysis");
System.exit(-1);
}
}
symTab.addScope(); // add a new scope for locals and params
// process the formals
List<Type> typeList = myFormalsList.nameAnalysis(symTab);
if (sym != null) {
sym.addFormals(typeList);
}
myBody.nameAnalysis(symTab); // process the function body
try {
symTab.removeScope(); // exit scope
} catch (EmptySymTableException ex) {
System.err.println("Unexpected EmptySymTableException " +
" in FnDeclNode.nameAnalysis");
System.exit(-1);
}
return null;
}
/**
* typeCheck
*/
public void typeCheck() {
myBody.typeCheck(myType.type());
}
public void codeGen(PrintWriter p) {
if(myId.name().equals("main")){
Codegen.p.println(".text");
Codegen.generate(".globl main");
Codegen.genLabel(myId.name());
Codegen.genLabel("__start");
} else {
Codegen.generate(".text");
Codegen.p.print("_");
Codegen.genLabel(myId.name());
}
Codegen.genPush(Codegen.RA);
Codegen.genPush(Codegen.FP);
String retLab = Codegen.nextLabel();
Codegen.generate("addu", Codegen.FP, Codegen.SP, 8 + myParamSize);
if (myLocalsSize != 0) {
Codegen.generate("subu",Codegen.SP, Codegen.SP, myLocalsSize);
}
myBody.codeGen(p, retLab);
Codegen.genLabel(retLab);
Codegen.generateIndexed("lw", Codegen.RA, Codegen.FP, (-myParamSize));//0);
Codegen.generate("move", Codegen.T0, Codegen.FP);
Codegen.generateIndexed("lw", Codegen.FP, Codegen.FP,-(myParamSize+4)); // -4);
Codegen.generate("move", Codegen.SP, Codegen.T0);
if(myId.name().equals("main")) {
Codegen.generate("li", Codegen.V0, 10);
Codegen.generate("syscall");
}
else {
Codegen.generate("jr", Codegen.RA);
}
}
public void unparse(PrintWriter p, int indent) {
doIndent(p, indent);
myType.unparse(p, 0);
p.print(" ");
p.print(myId.name());
p.print("(");
myFormalsList.unparse(p, 0);
p.println(") {");
myBody.unparse(p, indent+4);
p.println("}\n");
}
// 4 kids
private TypeNode myType;
private IdNode myId;
private FormalsListNode myFormalsList;
private FnBodyNode myBody;
private int myLocalsSize;
private int myParamSize;
}
class FormalDeclNode extends DeclNode {
public FormalDeclNode(TypeNode type, IdNode id) {
myType = type;
myId = id;
}
/**
* nameAnalysis
* Given a symbol table symTab, do:
* if this formal is declared void, then error
* else if this formal is already in the local symble table,
* then issue multiply declared error message and return null
* else add a new entry to the symbol table and return that Sym
*/
public Sym nameAnalysis(SymTable symTab) {
String name = myId.name();
boolean badDecl = false;
Sym sym = null;
if (myType instanceof VoidNode) {
ErrMsg.fatal(myId.lineNum(), myId.charNum(),
"Non-function declared void");
badDecl = true;
}
if (symTab.lookupLocal(name) != null) {
ErrMsg.fatal(myId.lineNum(), myId.charNum(),
"Multiply declared identifier");
badDecl = true;
}
if (!badDecl) { // insert into symbol table
try {
sym = new Sym(myType.type());
symTab.addDecl(name, sym);
myId.link(sym);
} catch (DuplicateSymException ex) {
System.err.println("Unexpected DuplicateSymException " +
" in VarDeclNode.nameAnalysis");
System.exit(-1);
} catch (EmptySymTableException ex) {
System.err.println("Unexpected EmptySymTableException " +
" in VarDeclNode.nameAnalysis");
System.exit(-1);
} catch (WrongArgumentException ex) {
System.err.println("Unexpected WrongArgumentException " +
" in VarDeclNode.nameAnalysis");
System.exit(-1);
}
}
return sym;
}
public void codeGen(PrintWriter p) {
}
public void unparse(PrintWriter p, int indent) {
myType.unparse(p, 0);
p.print(" ");
p.print(myId.name());
}
// 2 kids
private TypeNode myType;
private IdNode myId;
}
class StructDeclNode extends DeclNode {
public StructDeclNode(IdNode id, DeclListNode declList) {
myId = id;
myDeclList = declList;
}
/**
* nameAnalysis
* Given a symbol table symTab, do:
* if this name is already in the symbol table,
* then multiply declared error (don't add to symbol table)
* create a new symbol table for this struct definition
* process the decl list
* if no errors
* add a new entry to symbol table for this struct
*/
public Sym nameAnalysis(SymTable symTab) {
String name = myId.name();
boolean badDecl = false;
if (symTab.lookupLocal(name) != null) {
ErrMsg.fatal(myId.lineNum(), myId.charNum(),
"Multiply declared identifier");
badDecl = true;
}
SymTable structSymTab = new SymTable();
// process the fields of the struct
myDeclList.nameAnalysis(structSymTab, symTab);
if (!badDecl) {
try { // add entry to symbol table
StructDefSym sym = new StructDefSym(structSymTab);
symTab.addDecl(name, sym);
myId.link(sym);
} catch (DuplicateSymException ex) {
System.err.println("Unexpected DuplicateSymException " +
" in StructDeclNode.nameAnalysis");
System.exit(-1);
} catch (EmptySymTableException ex) {
System.err.println("Unexpected EmptySymTableException " +
" in StructDeclNode.nameAnalysis");
System.exit(-1);
} catch (WrongArgumentException ex) {
System.err.println("Unexpected WrongArgumentException " +
" in StructDeclNode.nameAnalysis");
System.exit(-1);
}
}
return null;
}
public void codeGen(PrintWriter p) {
}
public void unparse(PrintWriter p, int indent) {
doIndent(p, indent);
p.print("struct ");
p.print(myId.name());
p.println("{");
myDeclList.unparse(p, indent+4);
doIndent(p, indent);
p.println("};\n");
}
// 2 kids
private IdNode myId;
private DeclListNode myDeclList;
}
// **********************************************************************
// TypeNode and its Subclasses
// **********************************************************************
abstract class TypeNode extends ASTnode {
/* all subclasses must provide a type method */
abstract public Type type();
}
class IntNode extends TypeNode {
public IntNode() {
}
/**
* type
*/
public Type type() {
return new IntType();
}
public void codeGen(PrintWriter p) {
}
public void unparse(PrintWriter p, int indent) {
p.print("int");
}
}
class BoolNode extends TypeNode {
public BoolNode() {
}
/**
* type
*/
public Type type() {
return new BoolType();
}
public void codeGen(PrintWriter p) {
}
public void unparse(PrintWriter p, int indent) {
p.print("bool");
}
}
class VoidNode extends TypeNode {
public VoidNode() {
}
/**
* type
*/
public Type type() {
return new VoidType();
}
public void codeGen(PrintWriter p) {
}
public void unparse(PrintWriter p, int indent) {
p.print("void");
}
}
class StructNode extends TypeNode {
public StructNode(IdNode id) {
myId = id;
}
public IdNode idNode() {
return myId;
}
/**
* type
*/
public Type type() {
return new StructType(myId);
}
public void codeGen(PrintWriter p) {
}
public void unparse(PrintWriter p, int indent) {
p.print("struct ");
p.print(myId.name());
}
// 1 kid
private IdNode myId;
}
// **********************************************************************
// StmtNode and its subclasses
// **********************************************************************
abstract class StmtNode extends ASTnode {
abstract public void nameAnalysis(SymTable symTab);
abstract public void typeCheck(Type retType);
}
class AssignStmtNode extends StmtNode {
public AssignStmtNode(AssignNode assign) {
myAssign = assign;
}
/**
* nameAnalysis
* Given a symbol table symTab, perform name analysis on this node's child
*/
public void nameAnalysis(SymTable symTab) {
myAssign.nameAnalysis(symTab);
}
/**
* typeCheck
*/
public void typeCheck(Type retType) {
myAssign.typeCheck();
}
public void codeGen(PrintWriter p) {
myAssign.codeGen(p);
Codegen.genPop(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
doIndent(p, indent);
myAssign.unparse(p, -1); // no parentheses
p.println(";");
}
// 1 kid
private AssignNode myAssign;
}
class PostIncStmtNode extends StmtNode {
public PostIncStmtNode(ExpNode exp) {
myExp = exp;
}
/**
* nameAnalysis
* Given a symbol table symTab, perform name analysis on this node's child
*/
public void nameAnalysis(SymTable symTab) {
myExp.nameAnalysis(symTab);
}
/**
* typeCheck
*/
public void typeCheck(Type retType) {
Type type = myExp.typeCheck();
if (!type.isErrorType() && !type.isIntType()) {
ErrMsg.fatal(myExp.lineNum(), myExp.charNum(),
"Arithmetic operator applied to non-numeric operand");
}
}
public void codeGen(PrintWriter p) {
((IdNode)myExp).codeGen(p);
((IdNode)myExp).addrGen();
Codegen.genPop(Codegen.T0);
Codegen.genPop(Codegen.T1);
Codegen.generate("add", Codegen.T1, Codegen.T1, 1);
Codegen.generateIndexed("sw", Codegen.T1, Codegen.T0, 0);
Codegen.genPush(Codegen.T1);
}
public void unparse(PrintWriter p, int indent) {
doIndent(p, indent);
myExp.unparse(p, 0);
p.println("++;");
}
// 1 kid
private ExpNode myExp;
}
class PostDecStmtNode extends StmtNode {
public PostDecStmtNode(ExpNode exp) {
myExp = exp;
}
/**
* nameAnalysis
* Given a symbol table symTab, perform name analysis on this node's child
*/
public void nameAnalysis(SymTable symTab) {
myExp.nameAnalysis(symTab);
}
/**
* typeCheck
*/
public void typeCheck(Type retType) {
Type type = myExp.typeCheck();
if (!type.isErrorType() && !type.isIntType()) {
ErrMsg.fatal(myExp.lineNum(), myExp.charNum(),
"Arithmetic operator applied to non-numeric operand");
}
}
public void codeGen(PrintWriter p) {
((IdNode)myExp).codeGen(p);
((IdNode)myExp).addrGen();
Codegen.genPop(Codegen.T0);
Codegen.genPop(Codegen.T1);
Codegen.generate("sub", Codegen.T1, Codegen.T1, 1);
Codegen.generateIndexed("sw", Codegen.T1, Codegen.T0, 0);
Codegen.genPush(Codegen.T1);
}
public void unparse(PrintWriter p, int indent) {
doIndent(p, indent);
myExp.unparse(p, 0);
p.println("--;");
}
// 1 kid
private ExpNode myExp;
}
class ReadStmtNode extends StmtNode {
public ReadStmtNode(ExpNode e) {
myExp = e;
}
/**
* nameAnalysis
* Given a symbol table symTab, perform name analysis on this node's child
*/
public void nameAnalysis(SymTable symTab) {
myExp.nameAnalysis(symTab);
}
/**
* typeCheck
*/
public void typeCheck(Type retType) {
Type type = myExp.typeCheck();
if (type.isFnType()) {
ErrMsg.fatal(myExp.lineNum(), myExp.charNum(),
"Attempt to read a function");
}
if (type.isStructDefType()) {
ErrMsg.fatal(myExp.lineNum(), myExp.charNum(),
"Attempt to read a struct name");
}
if (type.isStructType()) {
ErrMsg.fatal(myExp.lineNum(), myExp.charNum(),
"Attempt to read a struct variable");
}
}
public void codeGen(PrintWriter p) {
Codegen.generate("li", Codegen.V0, 5);
Codegen.generate("syscall");
((IdNode)myExp).addrGen();
Codegen.genPop(Codegen.T0);
Codegen.generateIndexed("sw", Codegen.V0, Codegen.T0, 0);
}
public void unparse(PrintWriter p, int indent) {
doIndent(p, indent);
p.print("cin >> ");
myExp.unparse(p, 0);
p.println(";");
}
// 1 kid (actually can only be an IdNode or an ArrayExpNode)
private ExpNode myExp;
}
class WriteStmtNode extends StmtNode {
public WriteStmtNode(ExpNode exp) {
myExp = exp;
}
/**
* nameAnalysis
* Given a symbol table symTab, perform name analysis on this node's child
*/
public void nameAnalysis(SymTable symTab) {
myExp.nameAnalysis(symTab);
}
/**
* typeCheck
*/
public void typeCheck(Type retType) {
Type type = myExp.typeCheck();
if (type.isFnType()) {
ErrMsg.fatal(myExp.lineNum(), myExp.charNum(),
"Attempt to write a function");
}
if (type.isStructDefType()) {
ErrMsg.fatal(myExp.lineNum(), myExp.charNum(),
"Attempt to write a struct name");
}
if (type.isStructType()) {
ErrMsg.fatal(myExp.lineNum(), myExp.charNum(),
"Attempt to write a struct variable");
}
if (type.isVoidType()) {
ErrMsg.fatal(myExp.lineNum(), myExp.charNum(),
"Attempt to write void");
}
}
public void codeGen(PrintWriter p) {
myExp.codeGen(p);
Codegen.genPop(Codegen.A0);
if (myExp instanceof StringLitNode) Codegen.generate("li", Codegen.V0, 4);
else Codegen.generate("li", Codegen.V0, 1);
Codegen.generate("syscall");
}
public void unparse(PrintWriter p, int indent) {
doIndent(p, indent);
p.print("cout << ");
myExp.unparse(p, 0);
p.println(";");
}
// 1 kid
private ExpNode myExp;
}
class IfStmtNode extends StmtNode {
public IfStmtNode(ExpNode exp, DeclListNode dlist, StmtListNode slist) {
myDeclList = dlist;
myExp = exp;
myStmtList = slist;
}
/**
* nameAnalysis
* Given a symbol table symTab, do:
* - process the condition
* - enter a new scope
* - process the decls and stmts
* - exit the scope
*/
public void nameAnalysis(SymTable symTab) {
myExp.nameAnalysis(symTab);
symTab.addScope();
myDeclList.nameAnalysis(symTab);
myStmtList.nameAnalysis(symTab);
try {
symTab.removeScope();
} catch (EmptySymTableException ex) {
System.err.println("Unexpected EmptySymTableException " +
" in IfStmtNode.nameAnalysis");
System.exit(-1);
}
}
/**
* typeCheck
*/
public void typeCheck(Type retType) {
Type type = myExp.typeCheck();
if (!type.isErrorType() && !type.isBoolType()) {
ErrMsg.fatal(myExp.lineNum(), myExp.charNum(),
"Non-bool expression used as an if condition");
}
myStmtList.typeCheck(retType);
}
public void codeGen(PrintWriter p) {
String skip = Codegen.nextLabel();
myExp.codeGen(p);
Codegen.genPop(Codegen.T0);
Codegen.generate("beq", Codegen.T0, Codegen.FALSE, skip);
myStmtList.codeGen(p);
Codegen.genLabel(skip);
}
public void unparse(PrintWriter p, int indent) {
doIndent(p, indent);
p.print("if (");
myExp.unparse(p, 0);
p.println(") {");
myDeclList.unparse(p, indent+4);
myStmtList.unparse(p, indent+4);
doIndent(p, indent);
p.println("}");
}
// e kids
private ExpNode myExp;
private DeclListNode myDeclList;
private StmtListNode myStmtList;
}
class IfElseStmtNode extends StmtNode {
public IfElseStmtNode(ExpNode exp, DeclListNode dlist1,
StmtListNode slist1, DeclListNode dlist2,
StmtListNode slist2) {
myExp = exp;
myThenDeclList = dlist1;
myThenStmtList = slist1;
myElseDeclList = dlist2;
myElseStmtList = slist2;
}
/**
* nameAnalysis
* Given a symbol table symTab, do:
* - process the condition
* - enter a new scope
* - process the decls and stmts of then
* - exit the scope
* - enter a new scope
* - process the decls and stmts of else
* - exit the scope
*/
public void nameAnalysis(SymTable symTab) {
myExp.nameAnalysis(symTab);
symTab.addScope();
myThenDeclList.nameAnalysis(symTab);
myThenStmtList.nameAnalysis(symTab);
try {
symTab.removeScope();
} catch (EmptySymTableException ex) {
System.err.println("Unexpected EmptySymTableException " +
" in IfStmtNode.nameAnalysis");
System.exit(-1);
}
symTab.addScope();
myElseDeclList.nameAnalysis(symTab);
myElseStmtList.nameAnalysis(symTab);
try {
symTab.removeScope();
} catch (EmptySymTableException ex) {
System.err.println("Unexpected EmptySymTableException " +
" in IfStmtNode.nameAnalysis");
System.exit(-1);
}
}
/**
* typeCheck
*/
public void typeCheck(Type retType) {
Type type = myExp.typeCheck();
if (!type.isErrorType() && !type.isBoolType()) {
ErrMsg.fatal(myExp.lineNum(), myExp.charNum(),
"Non-bool expression used as an if condition");
}
myThenStmtList.typeCheck(retType);
myElseStmtList.typeCheck(retType);
}
public void codeGen(PrintWriter p) {
String skip = Codegen.nextLabel();
String done = Codegen.nextLabel();
myExp.codeGen(p);
Codegen.genPop(Codegen.T0);
Codegen.generate("beq", Codegen.T0, Codegen.FALSE, skip);
myThenStmtList.codeGen(p);
Codegen.generate("j", done);
Codegen.genLabel(skip);
myElseStmtList.codeGen(p);
Codegen.genLabel(done);
}
public void unparse(PrintWriter p, int indent) {
doIndent(p, indent);
p.print("if (");
myExp.unparse(p, 0);
p.println(") {");
myThenDeclList.unparse(p, indent+4);
myThenStmtList.unparse(p, indent+4);
doIndent(p, indent);
p.println("}");
doIndent(p, indent);
p.println("else {");
myElseDeclList.unparse(p, indent+4);
myElseStmtList.unparse(p, indent+4);
doIndent(p, indent);
p.println("}");
}
// 5 kids
private ExpNode myExp;
private DeclListNode myThenDeclList;
private StmtListNode myThenStmtList;
private StmtListNode myElseStmtList;
private DeclListNode myElseDeclList;
}
class WhileStmtNode extends StmtNode {
public WhileStmtNode(ExpNode exp, DeclListNode dlist, StmtListNode slist) {
myExp = exp;
myDeclList = dlist;
myStmtList = slist;
}
/**
* nameAnalysis
* Given a symbol table symTab, do:
* - process the condition
* - enter a new scope
* - process the decls and stmts
* - exit the scope
*/
public void nameAnalysis(SymTable symTab) {
myExp.nameAnalysis(symTab);
symTab.addScope();
myDeclList.nameAnalysis(symTab);
myStmtList.nameAnalysis(symTab);
try {
symTab.removeScope();
} catch (EmptySymTableException ex) {
System.err.println("Unexpected EmptySymTableException " +
" in IfStmtNode.nameAnalysis");
System.exit(-1);
}
}
/**
* typeCheck
*/
public void typeCheck(Type retType) {
Type type = myExp.typeCheck();
if (!type.isErrorType() && !type.isBoolType()) {
ErrMsg.fatal(myExp.lineNum(), myExp.charNum(),
"Non-bool expression used as a while condition");
}
myStmtList.typeCheck(retType);
}
public void codeGen(PrintWriter p) {
String start = Codegen.nextLabel();
String done = Codegen.nextLabel();
Codegen.genLabel(start);
myExp.codeGen(p);
Codegen.genPop(Codegen.T0);
Codegen.generate("beq", Codegen.T0, Codegen.FALSE, done);
myStmtList.codeGen(p);
Codegen.generate("j", start);
Codegen.genLabel(done);
}
public void unparse(PrintWriter p, int indent) {
doIndent(p, indent);
p.print("while (");
myExp.unparse(p, 0);
p.println(") {");
myDeclList.unparse(p, indent+4);
myStmtList.unparse(p, indent+4);
doIndent(p, indent);
p.println("}");
}
// 3 kids
private ExpNode myExp;
private DeclListNode myDeclList;
private StmtListNode myStmtList;
}
class RepeatStmtNode extends StmtNode {
public RepeatStmtNode(ExpNode exp, DeclListNode dlist, StmtListNode slist) {
myExp = exp;
myDeclList = dlist;
myStmtList = slist;
}
/**
* nameAnalysis
* Given a symbol table symTab, do:
* - process the condition
* - enter a new scope
* - process the decls and stmts
* - exit the scope
*/
public void nameAnalysis(SymTable symTab) {
myExp.nameAnalysis(symTab);
symTab.addScope();
myDeclList.nameAnalysis(symTab);
myStmtList.nameAnalysis(symTab);
try {
symTab.removeScope();
} catch (EmptySymTableException ex) {
System.err.println("Unexpected EmptySymTableException " +
" in IfStmtNode.nameAnalysis");
System.exit(-1);
}
}
/**
* typeCheck
*/
public void typeCheck(Type retType) {
Type type = myExp.typeCheck();
if (!type.isErrorType() && !type.isIntType()) {
ErrMsg.fatal(myExp.lineNum(), myExp.charNum(),
"Non-integer expression used as a repeat clause");
}
myStmtList.typeCheck(retType);
}
public void codeGen(PrintWriter p) {
}
public void unparse(PrintWriter p, int indent) {
doIndent(p, indent);
p.print("repeat (");
myExp.unparse(p, 0);
p.println(") {");
myDeclList.unparse(p, indent+4);
myStmtList.unparse(p, indent+4);
doIndent(p, indent);
p.println("}");
}
// 3 kids
private ExpNode myExp;
private DeclListNode myDeclList;
private StmtListNode myStmtList;
}
class CallStmtNode extends StmtNode {
public CallStmtNode(CallExpNode call) {
myCall = call;
}
/**
* nameAnalysis
* Given a symbol table symTab, perform name analysis on this node's child
*/
public void nameAnalysis(SymTable symTab) {
myCall.nameAnalysis(symTab);
}
/**
* typeCheck
*/
public void typeCheck(Type retType) {
myCall.typeCheck();
}
public void codeGen(PrintWriter p) {
myCall.codeGen(p);
Codegen.genPop(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
doIndent(p, indent);
myCall.unparse(p, indent);
p.println(";");
}
// 1 kid
private CallExpNode myCall;
}
class ReturnStmtNode extends StmtNode {
public ReturnStmtNode(ExpNode exp) {
myExp = exp;
}
/**
* nameAnalysis
* Given a symbol table symTab, perform name analysis on this node's child,
* if it has one
*/
public void nameAnalysis(SymTable symTab) {
if (myExp != null) {
myExp.nameAnalysis(symTab);
}
}
/**
* typeCheck
*/
public void typeCheck(Type retType) {
if (myExp != null) { // return value given
Type type = myExp.typeCheck();
if (retType.isVoidType()) {
ErrMsg.fatal(myExp.lineNum(), myExp.charNum(),
"Return with a value in a void function");
}
else if (!retType.isErrorType() && !type.isErrorType() && !retType.equals(type)){
ErrMsg.fatal(myExp.lineNum(), myExp.charNum(),
"Bad return value");
}
}
else { // no return value given -- ok if this is a void function
if (!retType.isVoidType()) {
ErrMsg.fatal(0, 0, "Missing return value");
}
}
}
public void codeGen(PrintWriter p, String retLab) {
if (myExp != null) {
myExp.codeGen(p);
Codegen.genPop(Codegen.V0);
}
Codegen.generate("j", retLab);
}
public void unparse(PrintWriter p, int indent) {
doIndent(p, indent);
p.print("return");
if (myExp != null) {
p.print(" ");
myExp.unparse(p, 0);
}
p.println(";");
}
// 1 kid
private ExpNode myExp; // possibly null
}
// **********************************************************************
// ExpNode and its subclasses
// **********************************************************************
abstract class ExpNode extends ASTnode {
/**
* Default version for nodes with no names
*/
public void nameAnalysis(SymTable symTab) { }
abstract public Type typeCheck();
abstract public int lineNum();
abstract public int charNum();
}
class IntLitNode extends ExpNode {
public IntLitNode(int lineNum, int charNum, int intVal) {
myLineNum = lineNum;
myCharNum = charNum;
myIntVal = intVal;
}
/**
* Return the line number for this literal.
*/
public int lineNum() {
return myLineNum;
}
/**
* Return the char number for this literal.
*/
public int charNum() {
return myCharNum;
}
/**
* typeCheck
*/
public Type typeCheck() {
return new IntType();
}
public void codeGen(PrintWriter p) {
Codegen.generate("li", Codegen.T0, myIntVal);
Codegen.genPush(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
p.print(myIntVal);
}
private int myLineNum;
private int myCharNum;
private int myIntVal;
}
class StringLitNode extends ExpNode {
public StringLitNode(int lineNum, int charNum, String strVal) {
myLineNum = lineNum;
myCharNum = charNum;
myStrVal = strVal;
}
/**
* Return the line number for this literal.
*/
public int lineNum() {
return myLineNum;
}
/**
* Return the char number for this literal.
*/
public int charNum() {
return myCharNum;
}
/**
* typeCheck
*/
public Type typeCheck() {
return new StringType();
}
public String strVal(){
return myStrVal;
}
public void codeGen(PrintWriter p) {
String strLab = Codegen.nextLabel();
Codegen.p.println("\t.data");
Codegen.generateLabeled(strLab, ".asciiz " + myStrVal, "");
Codegen.p.println("\t.text");
Codegen.generate("la", Codegen.T0, strLab);
Codegen.genPush(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
p.print(myStrVal);
}
private int myLineNum;
private int myCharNum;
private String myStrVal;
}
class TrueNode extends ExpNode {
public TrueNode(int lineNum, int charNum) {
myLineNum = lineNum;
myCharNum = charNum;
}
/**
* Return the line number for this literal.
*/
public int lineNum() {
return myLineNum;
}
/**
* Return the char number for this literal.
*/
public int charNum() {
return myCharNum;
}
/**
* typeCheck
*/
public Type typeCheck() {
return new BoolType();
}
public void codeGen(PrintWriter p) {
Codegen.generate("li", Codegen.T0, 1);
Codegen.genPush(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
p.print("true");
}
private int myLineNum;
private int myCharNum;
}
class FalseNode extends ExpNode {
public FalseNode(int lineNum, int charNum) {
myLineNum = lineNum;
myCharNum = charNum;
}
/**
* Return the line number for this literal.
*/
public int lineNum() {
return myLineNum;
}
/**
* Return the char number for this literal.
*/
public int charNum() {
return myCharNum;
}
/**
* typeCheck
*/
public Type typeCheck() {
return new BoolType();
}
public void codeGen(PrintWriter p) {
Codegen.generate("li", Codegen.T0, 0);
Codegen.genPush(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
p.print("false");
}
private int myLineNum;
private int myCharNum;
}
class IdNode extends ExpNode {
public IdNode(int lineNum, int charNum, String strVal) {
myLineNum = lineNum;
myCharNum = charNum;
myStrVal = strVal;
myIsGlobal = false;
}
/**
* Link the given symbol to this ID.
*/
public void link(Sym sym) {
mySym = sym;
}
/**
* Return the name of this ID.
*/
public String name() {
return myStrVal;
}
/**
* Return the symbol associated with this ID.
*/
public Sym sym() {
return mySym;
}
/**
* Return the line number for this ID.
*/
public int lineNum() {
return myLineNum;
}
/**
* Return the char number for this ID.
*/
public int charNum() {
return myCharNum;
}
public int offset() {
return myOffset;
}
/**
* nameAnalysis
* Given a symbol table symTab, do:
* - check for use of undeclared name
* - if ok, link to symbol table entry
*/
public void nameAnalysis(SymTable symTab) {
Sym sym = symTab.lookupGlobal(myStrVal);
if (sym == null) {
ErrMsg.fatal(myLineNum, myCharNum, "Undeclared identifier");
} else {
link(sym);
}
}
/**
* typeCheck
*/
public Type typeCheck() {
if (mySym != null) {
return mySym.getType();
}
else {
System.err.println("ID with null sym field in IdNode.typeCheck");
System.exit(-1);
}
return null;
}
public void jmpLnkGen() {
if (myStrVal.equals("main")) {
Codegen.generate("jal", "main");
}
Codegen.generate("jal", "_" + myStrVal);
}
public void codeGen(PrintWriter p) {
if(myIsGlobal) {
Codegen.generate("lw", Codegen.T0, "_" + myStrVal);
Codegen.genPush(Codegen.T0);
}
else {
Codegen.generateIndexed("lw", Codegen.T0, Codegen.FP, -1 * myOffset);
Codegen.genPush(Codegen.T0);
}
}
public void addrGen() {
if(myIsGlobal) {
Codegen.generate("la", Codegen.T0, "_" + myStrVal);
Codegen.genPush(Codegen.T0);
}
else {
Codegen.generateIndexed("la", Codegen.T0, Codegen.FP, -1 * myOffset);
Codegen.genPush(Codegen.T0);
}
}
public void unparse(PrintWriter p, int indent) {
p.print(myStrVal);
if (mySym != null) {
p.print("(" + mySym + ")");
}
}
private int myLineNum;
private int myCharNum;
private String myStrVal;
private Sym mySym;
public boolean myIsGlobal;
private int myOffset;
}
class DotAccessExpNode extends ExpNode {
public DotAccessExpNode(ExpNode loc, IdNode id) {
myLoc = loc;
myId = id;
mySym = null;
}
/**
* Return the symbol associated with this dot-access node.
*/
public Sym sym() {
return mySym;
}
/**
* Return the line number for this dot-access node.
* The line number is the one corresponding to the RHS of the dot-access.
*/
public int lineNum() {
return myId.lineNum();
}
/**
* Return the char number for this dot-access node.
* The char number is the one corresponding to the RHS of the dot-access.
*/
public int charNum() {
return myId.charNum();
}
/**
* nameAnalysis
* Given a symbol table symTab, do:
* - process the LHS of the dot-access
* - process the RHS of the dot-access
* - if the RHS is of a struct type, set the sym for this node so that
* a dot-access "higher up" in the AST can get access to the symbol
* table for the appropriate struct definition
*/
public void nameAnalysis(SymTable symTab) {
badAccess = false;
SymTable structSymTab = null; // to lookup RHS of dot-access
Sym sym = null;
myLoc.nameAnalysis(symTab); // do name analysis on LHS
// if myLoc is really an ID, then sym will be a link to the ID's symbol
if (myLoc instanceof IdNode) {
IdNode id = (IdNode)myLoc;
sym = id.sym();
// check ID has been declared to be of a struct type
if (sym == null) { // ID was undeclared
badAccess = true;
}
else if (sym instanceof StructSym) {
// get symbol table for struct type
Sym tempSym = ((StructSym)sym).getStructType().sym();
structSymTab = ((StructDefSym)tempSym).getSymTable();
}
else { // LHS is not a struct type
ErrMsg.fatal(id.lineNum(), id.charNum(),
"Dot-access of non-struct type");
badAccess = true;
}
}
// if myLoc is really a dot-access (i.e., myLoc was of the form
// LHSloc.RHSid), then sym will either be
// null - indicating RHSid is not of a struct type, or
// a link to the Sym for the struct type RHSid was declared to be
else if (myLoc instanceof DotAccessExpNode) {
DotAccessExpNode loc = (DotAccessExpNode)myLoc;
if (loc.badAccess) { // if errors in processing myLoc
badAccess = true; // don't continue proccessing this dot-access
}
else { // no errors in processing myLoc
sym = loc.sym();
if (sym == null) { // no struct in which to look up RHS
ErrMsg.fatal(loc.lineNum(), loc.charNum(),
"Dot-access of non-struct type");
badAccess = true;
}
else { // get the struct's symbol table in which to lookup RHS
if (sym instanceof StructDefSym) {
structSymTab = ((StructDefSym)sym).getSymTable();
}
else {
System.err.println("Unexpected Sym type in DotAccessExpNode");
System.exit(-1);
}
}
}
}
else { // don't know what kind of thing myLoc is
System.err.println("Unexpected node type in LHS of dot-access");
System.exit(-1);
}
// do name analysis on RHS of dot-access in the struct's symbol table
if (!badAccess) {
sym = structSymTab.lookupGlobal(myId.name()); // lookup
if (sym == null) { // not found - RHS is not a valid field name
ErrMsg.fatal(myId.lineNum(), myId.charNum(),
"Invalid struct field name");
badAccess = true;
}
else {
myId.link(sym); // link the symbol
// if RHS is itself as struct type, link the symbol for its struct
// type to this dot-access node (to allow chained dot-access)
if (sym instanceof StructSym) {
mySym = ((StructSym)sym).getStructType().sym();
}
}
}
}
/**
* typeCheck
*/
public Type typeCheck() {
return myId.typeCheck();
}
public void codeGen(PrintWriter p) {
}
public void unparse(PrintWriter p, int indent) {
myLoc.unparse(p, 0);
p.print(".");
myId.unparse(p, 0);
}
// 2 kids
private ExpNode myLoc;
private IdNode myId;
private Sym mySym; // link to Sym for struct type
private boolean badAccess; // to prevent multiple, cascading errors
}
class AssignNode extends ExpNode {
public AssignNode(ExpNode lhs, ExpNode exp) {
myLhs = lhs;
myExp = exp;
}
/**
* Return the line number for this assignment node.
* The line number is the one corresponding to the left operand.
*/
public int lineNum() {
return myLhs.lineNum();
}
/**
* Return the char number for this assignment node.
* The char number is the one corresponding to the left operand.
*/
public int charNum() {
return myLhs.charNum();
}
/**
* nameAnalysis
* Given a symbol table symTab, perform name analysis on this node's
* two children
*/
public void nameAnalysis(SymTable symTab) {
myLhs.nameAnalysis(symTab);
myExp.nameAnalysis(symTab);
}
/**
* typeCheck
*/
public Type typeCheck() {
Type typeLhs = myLhs.typeCheck();
Type typeExp = myExp.typeCheck();
Type retType = typeLhs;
if (typeLhs.isFnType() && typeExp.isFnType()) {
ErrMsg.fatal(lineNum(), charNum(), "Function assignment");
retType = new ErrorType();
}
if (typeLhs.isStructDefType() && typeExp.isStructDefType()) {
ErrMsg.fatal(lineNum(), charNum(), "Struct name assignment");
retType = new ErrorType();
}
if (typeLhs.isStructType() && typeExp.isStructType()) {
ErrMsg.fatal(lineNum(), charNum(), "Struct variable assignment");
retType = new ErrorType();
}
if (!typeLhs.equals(typeExp) && !typeLhs.isErrorType() && !typeExp.isErrorType()) {
ErrMsg.fatal(lineNum(), charNum(), "Type mismatch");
retType = new ErrorType();
}
if (typeLhs.isErrorType() || typeExp.isErrorType()) {
retType = new ErrorType();
}
return retType;
}
public void codeGen(PrintWriter p) {
myExp.codeGen(p);
if(!(myLhs instanceof DotAccessExpNode)){
((IdNode)myLhs).addrGen();
Codegen.genPop(Codegen.T0);
Codegen.genPop(Codegen.T1);
Codegen.generateIndexed("sw", Codegen.T1, Codegen.T0, 0);
Codegen.genPush(Codegen.T1);
}
}
public void unparse(PrintWriter p, int indent) {
if (indent != -1) p.print("(");
myLhs.unparse(p, 0);
p.print(" = ");
myExp.unparse(p, 0);
if (indent != -1) p.print(")");
}
// 2 kids
private ExpNode myLhs;
private ExpNode myExp;
}
class CallExpNode extends ExpNode {
public CallExpNode(IdNode name, ExpListNode elist) {
myId = name;
myExpList = elist;
}
public CallExpNode(IdNode name) {
myId = name;
myExpList = new ExpListNode(new LinkedList<ExpNode>());
}
/**
* Return the line number for this call node.
* The line number is the one corresponding to the function name.
*/
public int lineNum() {
return myId.lineNum();
}
/**
* Return the char number for this call node.
* The char number is the one corresponding to the function name.
*/
public int charNum() {
return myId.charNum();
}
/**
* nameAnalysis
* Given a symbol table symTab, perform name analysis on this node's
* two children
*/
public void nameAnalysis(SymTable symTab) {
myId.nameAnalysis(symTab);
myExpList.nameAnalysis(symTab);
}
/**
* typeCheck
*/
public Type typeCheck() {
if (!myId.typeCheck().isFnType()) {
ErrMsg.fatal(myId.lineNum(), myId.charNum(),
"Attempt to call a non-function");
return new ErrorType();
}
FnSym fnSym = (FnSym)(myId.sym());
if (fnSym == null) {
System.err.println("null sym for Id in CallExpNode.typeCheck");
System.exit(-1);
}
if (myExpList.size() != fnSym.getNumParams()) {
ErrMsg.fatal(myId.lineNum(), myId.charNum(),
"Function call with wrong number of args");
return fnSym.getReturnType();
}
myExpList.typeCheck(fnSym.getParamTypes());
return fnSym.getReturnType();
}
public void codeGen(PrintWriter p) {
myExpList.codeGen(p);
myId.jmpLnkGen();
Codegen.genPush(Codegen.V0);
}
// ** unparse **
public void unparse(PrintWriter p, int indent) {
myId.unparse(p, 0);
p.print("(");
if (myExpList != null) {
myExpList.unparse(p, 0);
}
p.print(")");
}
// 2 kids
private IdNode myId;
private ExpListNode myExpList; // possibly null
}
abstract class UnaryExpNode extends ExpNode {
public UnaryExpNode(ExpNode exp) {
myExp = exp;
}
/**
* Return the line number for this unary expression node.
* The line number is the one corresponding to the operand.
*/
public int lineNum() {
return myExp.lineNum();
}
/**
* Return the char number for this unary expression node.
* The char number is the one corresponding to the operand.
*/
public int charNum() {
return myExp.charNum();
}
/**
* nameAnalysis
* Given a symbol table symTab, perform name analysis on this node's child
*/
public void nameAnalysis(SymTable symTab) {
myExp.nameAnalysis(symTab);
}
// one child
protected ExpNode myExp;
}
abstract class BinaryExpNode extends ExpNode {
public BinaryExpNode(ExpNode exp1, ExpNode exp2) {
myExp1 = exp1;
myExp2 = exp2;
}
/**
* Return the line number for this binary expression node.
* The line number is the one corresponding to the left operand.
*/
public int lineNum() {
return myExp1.lineNum();
}
/**
* Return the char number for this binary expression node.
* The char number is the one corresponding to the left operand.
*/
public int charNum() {
return myExp1.charNum();
}
/**
* nameAnalysis
* Given a symbol table symTab, perform name analysis on this node's
* two children
*/
public void nameAnalysis(SymTable symTab) {
myExp1.nameAnalysis(symTab);
myExp2.nameAnalysis(symTab);
}
// two kids
protected ExpNode myExp1;
protected ExpNode myExp2;
}
// **********************************************************************
// Subclasses of UnaryExpNode
// **********************************************************************
class UnaryMinusNode extends UnaryExpNode {
public UnaryMinusNode(ExpNode exp) {
super(exp);
}
/**
* typeCheck
*/
public Type typeCheck() {
Type type = myExp.typeCheck();
Type retType = new IntType();
if (!type.isErrorType() && !type.isIntType()) {
ErrMsg.fatal(lineNum(), charNum(),
"Arithmetic operator applied to non-numeric operand");
retType = new ErrorType();
}
if (type.isErrorType()) {
retType = new ErrorType();
}
return retType;
}
public void codeGen(PrintWriter p) {
myExp.codeGen(p);
Codegen.genPop(Codegen.T0);
Codegen.generate("li", Codegen.T1, 0);
Codegen.generate("sub", Codegen.T0, Codegen.T1, Codegen.T0);
Codegen.genPush(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
p.print("(-");
myExp.unparse(p, 0);
p.print(")");
}
}
class NotNode extends UnaryExpNode {
public NotNode(ExpNode exp) {
super(exp);
}
/**
* typeCheck
*/
public Type typeCheck() {
Type type = myExp.typeCheck();
Type retType = new BoolType();
if (!type.isErrorType() && !type.isBoolType()) {
ErrMsg.fatal(lineNum(), charNum(),
"Logical operator applied to non-bool operand");
retType = new ErrorType();
}
if (type.isErrorType()) {
retType = new ErrorType();
}
return retType;
}
public void codeGen(PrintWriter p) {
myExp.codeGen(p);
Codegen.genPop(Codegen.T0);
Codegen.generate("li", Codegen.T1, 1);
Codegen.generate("xor", Codegen.T0, Codegen.T0, Codegen.T1);
Codegen.genPush(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
p.print("(!");
myExp.unparse(p, 0);
p.print(")");
}
}
// **********************************************************************
// Subclasses of BinaryExpNode
// **********************************************************************
abstract class ArithmeticExpNode extends BinaryExpNode {
public ArithmeticExpNode(ExpNode exp1, ExpNode exp2) {
super(exp1, exp2);
}
/**
* typeCheck
*/
public Type typeCheck() {
Type type1 = myExp1.typeCheck();
Type type2 = myExp2.typeCheck();
Type retType = new IntType();
if (!type1.isErrorType() && !type1.isIntType()) {
ErrMsg.fatal(myExp1.lineNum(), myExp1.charNum(),
"Arithmetic operator applied to non-numeric operand");
retType = new ErrorType();
}
if (!type2.isErrorType() && !type2.isIntType()) {
ErrMsg.fatal(myExp2.lineNum(), myExp2.charNum(),
"Arithmetic operator applied to non-numeric operand");
retType = new ErrorType();
}
if (type1.isErrorType() || type2.isErrorType()) {
retType = new ErrorType();
}
return retType;
}
}
abstract class LogicalExpNode extends BinaryExpNode {
public LogicalExpNode(ExpNode exp1, ExpNode exp2) {
super(exp1, exp2);
}
/**
* typeCheck
*/
public Type typeCheck() {
Type type1 = myExp1.typeCheck();
Type type2 = myExp2.typeCheck();
Type retType = new BoolType();
if (!type1.isErrorType() && !type1.isBoolType()) {
ErrMsg.fatal(myExp1.lineNum(), myExp1.charNum(),
"Logical operator applied to non-bool operand");
retType = new ErrorType();
}
if (!type2.isErrorType() && !type2.isBoolType()) {
ErrMsg.fatal(myExp2.lineNum(), myExp2.charNum(),
"Logical operator applied to non-bool operand");
retType = new ErrorType();
}
if (type1.isErrorType() || type2.isErrorType()) {
retType = new ErrorType();
}
return retType;
}
}
abstract class EqualityExpNode extends BinaryExpNode {
public EqualityExpNode(ExpNode exp1, ExpNode exp2) {
super(exp1, exp2);
}
/**
* typeCheck
*/
public Type typeCheck() {
Type type1 = myExp1.typeCheck();
Type type2 = myExp2.typeCheck();
Type retType = new BoolType();
if (type1.isVoidType() && type2.isVoidType()) {
ErrMsg.fatal(lineNum(), charNum(),
"Equality operator applied to void functions");
retType = new ErrorType();
}
if (type1.isFnType() && type2.isFnType()) {
ErrMsg.fatal(lineNum(), charNum(),
"Equality operator applied to functions");
retType = new ErrorType();
}
if (type1.isStructDefType() && type2.isStructDefType()) {
ErrMsg.fatal(lineNum(), charNum(),
"Equality operator applied to struct names");
retType = new ErrorType();
}
if (type1.isStructType() && type2.isStructType()) {
ErrMsg.fatal(lineNum(), charNum(),
"Equality operator applied to struct variables");
retType = new ErrorType();
}
if (!type1.equals(type2) && !type1.isErrorType() && !type2.isErrorType()) {
ErrMsg.fatal(lineNum(), charNum(),
"Type mismatch");
retType = new ErrorType();
}
if (type1.isErrorType() || type2.isErrorType()) {
retType = new ErrorType();
}
return retType;
}
}
abstract class RelationalExpNode extends BinaryExpNode {
public RelationalExpNode(ExpNode exp1, ExpNode exp2) {
super(exp1, exp2);
}
/**
* typeCheck
*/
public Type typeCheck() {
Type type1 = myExp1.typeCheck();
Type type2 = myExp2.typeCheck();
Type retType = new BoolType();
if (!type1.isErrorType() && !type1.isIntType()) {
ErrMsg.fatal(myExp1.lineNum(), myExp1.charNum(),
"Relational operator applied to non-numeric operand");
retType = new ErrorType();
}
if (!type2.isErrorType() && !type2.isIntType()) {
ErrMsg.fatal(myExp2.lineNum(), myExp2.charNum(),
"Relational operator applied to non-numeric operand");
retType = new ErrorType();
}
if (type1.isErrorType() || type2.isErrorType()) {
retType = new ErrorType();
}
return retType;
}
}
class PlusNode extends ArithmeticExpNode {
public PlusNode(ExpNode exp1, ExpNode exp2) {
super(exp1, exp2);
}
public void codeGen(PrintWriter p) {
myExp1.codeGen(p);
myExp2.codeGen(p);
Codegen.genPop(Codegen.T0);
Codegen.genPop(Codegen.T1);
Codegen.generate("add", Codegen.T0, Codegen.T0, Codegen.T1);
Codegen.genPush(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
p.print("(");
myExp1.unparse(p, 0);
p.print(" + ");
myExp2.unparse(p, 0);
p.print(")");
}
}
class MinusNode extends ArithmeticExpNode {
public MinusNode(ExpNode exp1, ExpNode exp2) {
super(exp1, exp2);
}
public void codeGen(PrintWriter p) {
myExp1.codeGen(p);
myExp2.codeGen(p);
Codegen.genPop(Codegen.T0);
Codegen.genPop(Codegen.T1);
Codegen.generate("sub", Codegen.T0, Codegen.T0, Codegen.T1);
Codegen.genPush(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
p.print("(");
myExp1.unparse(p, 0);
p.print(" - ");
myExp2.unparse(p, 0);
p.print(")");
}
}
class TimesNode extends ArithmeticExpNode {
public TimesNode(ExpNode exp1, ExpNode exp2) {
super(exp1, exp2);
}
public void codeGen(PrintWriter p) {
myExp1.codeGen(p);
myExp2.codeGen(p);
Codegen.genPop(Codegen.T0);
Codegen.genPop(Codegen.T1);
Codegen.generate("mult", Codegen.T0, Codegen.T1);
Codegen.generate("mflo", Codegen.T0);
Codegen.genPush(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
p.print("(");
myExp1.unparse(p, 0);
p.print(" * ");
myExp2.unparse(p, 0);
p.print(")");
}
}
class DivideNode extends ArithmeticExpNode {
public DivideNode(ExpNode exp1, ExpNode exp2) {
super(exp1, exp2);
}
public void codeGen(PrintWriter p) {
myExp1.codeGen(p);
myExp2.codeGen(p);
Codegen.genPop(Codegen.T0);
Codegen.genPop(Codegen.T1);
Codegen.generate("mult", Codegen.T0, Codegen.T1);
Codegen.generate("mflo", Codegen.T0);
Codegen.genPush(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
p.print("(");
myExp1.unparse(p, 0);
p.print(" / ");
myExp2.unparse(p, 0);
p.print(")");
}
}
class AndNode extends LogicalExpNode {
public AndNode(ExpNode exp1, ExpNode exp2) {
super(exp1, exp2);
}
public void codeGen(PrintWriter p) {
myExp1.codeGen(p);
String skip = Codegen.nextLabel();
String done = Codegen.nextLabel();
Codegen.genPop(Codegen.T0);
Codegen.generate("beq", Codegen.T0, "0", skip);
myExp2.codeGen(p);
Codegen.generate("j", done);
Codegen.genLabel(skip);
Codegen.genPush(Codegen.T0);
Codegen.genLabel(done);
}
public void unparse(PrintWriter p, int indent) {
p.print("(");
myExp1.unparse(p, 0);
p.print(" && ");
myExp2.unparse(p, 0);
p.print(")");
}
}
class OrNode extends LogicalExpNode {
public OrNode(ExpNode exp1, ExpNode exp2) {
super(exp1, exp2);
}
public void codeGen(PrintWriter p) {
myExp1.codeGen(p);
String skip = Codegen.nextLabel();
String done = Codegen.nextLabel();
Codegen.genPop(Codegen.T0);
Codegen.generate("beq", Codegen.T0, "1", skip);
myExp2.codeGen(p);
Codegen.generate("j", done);
Codegen.genLabel(skip);
Codegen.genPush(Codegen.T0);
Codegen.genLabel(done);
}
public void unparse(PrintWriter p, int indent) {
p.print("(");
myExp1.unparse(p, 0);
p.print(" || ");
myExp2.unparse(p, 0);
p.print(")");
}
}
class EqualsNode extends EqualityExpNode {
public EqualsNode(ExpNode exp1, ExpNode exp2) {
super(exp1, exp2);
}
public void codeGen(PrintWriter p) {
if(myExp1 instanceof StringLitNode && myExp2 instanceof StringLitNode){
String s1 = ((StringLitNode)myExp1).strVal();
String s2 = ((StringLitNode)myExp2).strVal();
if (s1.equals(s2)) {
Codegen.generate("li", Codegen.T0, 0);
Codegen.genPush(Codegen.T0);
Codegen.generate("li", Codegen.T1, 0);
Codegen.genPush(Codegen.T1);
} else {
Codegen.generate("li", Codegen.T0, 0);
Codegen.genPush(Codegen.T0);
Codegen.generate("li", Codegen.T1, 1);
Codegen.genPush(Codegen.T1);
}
}else{
myExp1.codeGen(p);
myExp2.codeGen(p);
}
String skip = Codegen.nextLabel();
String done = Codegen.nextLabel();
Codegen.genPop(Codegen.T0);
Codegen.genPop(Codegen.T1);
Codegen.generate("beq", Codegen.T0, Codegen.T1, skip);
Codegen.generate("li", Codegen.T0, "0");
Codegen.generate("j", done);
Codegen.genLabel(skip);
Codegen.generate("li", Codegen.T0, "1");
Codegen.genLabel(done);
Codegen.genPush(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
p.print("(");
myExp1.unparse(p, 0);
p.print(" == ");
myExp2.unparse(p, 0);
p.print(")");
}
}
class NotEqualsNode extends EqualityExpNode {
public NotEqualsNode(ExpNode exp1, ExpNode exp2) {
super(exp1, exp2);
}
public void codeGen(PrintWriter p) {
if(myExp1 instanceof StringLitNode && myExp2 instanceof StringLitNode){
String s1 = ((StringLitNode)myExp1).strVal();
String s2 = ((StringLitNode)myExp2).strVal();
if (s1.equals(s2)) {
Codegen.generate("li", Codegen.T0, 1);
Codegen.genPush(Codegen.T0);
Codegen.generate("li", Codegen.T1, 0);
Codegen.genPush(Codegen.T1);
} else {
Codegen.generate("li", Codegen.T0, 0);
Codegen.genPush(Codegen.T0);
Codegen.generate("li", Codegen.T1, 0);
Codegen.genPush(Codegen.T1);
}
}else{
myExp1.codeGen(p);
myExp2.codeGen(p);
}
String skip = Codegen.nextLabel();
String done = Codegen.nextLabel();
Codegen.genPop(Codegen.T0);
Codegen.genPop(Codegen.T1);
Codegen.generate("bne", Codegen.T0, Codegen.T1, skip);
Codegen.generate("li", Codegen.T0, "0");
Codegen.generate("j", done);
Codegen.genLabel(skip);
Codegen.generate("li", Codegen.T0, "1");
Codegen.genLabel(done);
Codegen.genPush(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
p.print("(");
myExp1.unparse(p, 0);
p.print(" != ");
myExp2.unparse(p, 0);
p.print(")");
}
}
class LessNode extends RelationalExpNode {
public LessNode(ExpNode exp1, ExpNode exp2) {
super(exp1, exp2);
}
public void codeGen(PrintWriter p) {
myExp1.codeGen(p);
myExp2.codeGen(p);
Codegen.genPop(Codegen.T0);
Codegen.genPop(Codegen.T1);
Codegen.generate("slt", Codegen.T0, Codegen.T1, Codegen.T0);
Codegen.genPush(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
p.print("(");
myExp1.unparse(p, 0);
p.print(" < ");
myExp2.unparse(p, 0);
p.print(")");
}
}
class GreaterNode extends RelationalExpNode {
public GreaterNode(ExpNode exp1, ExpNode exp2) {
super(exp1, exp2);
}
public void codeGen(PrintWriter p) {
myExp1.codeGen(p);
myExp2.codeGen(p);
Codegen.genPop(Codegen.T0);
Codegen.genPop(Codegen.T1);
Codegen.generate("slt", Codegen.T0, Codegen.T0, Codegen.T1);
Codegen.genPush(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
p.print("(");
myExp1.unparse(p, 0);
p.print(" > ");
myExp2.unparse(p, 0);
p.print(")");
}
}
class LessEqNode extends RelationalExpNode {
public LessEqNode(ExpNode exp1, ExpNode exp2) {
super(exp1, exp2);
}
public void codeGen(PrintWriter p) {
myExp1.codeGen(p);
myExp2.codeGen(p);
Codegen.genPop(Codegen.T0);
Codegen.genPop(Codegen.T1);
Codegen.generate("slt", Codegen.T0, Codegen.T0, Codegen.T1);
Codegen.generate("li", Codegen.T1, 1);
Codegen.generate("xor", Codegen.T0, Codegen.T0, Codegen.T1);
Codegen.genPush(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
p.print("(");
myExp1.unparse(p, 0);
p.print(" <= ");
myExp2.unparse(p, 0);
p.print(")");
}
}
class GreaterEqNode extends RelationalExpNode {
public GreaterEqNode(ExpNode exp1, ExpNode exp2) {
super(exp1, exp2);
}
public void codeGen(PrintWriter p) {
myExp1.codeGen(p);
myExp2.codeGen(p);
Codegen.genPop(Codegen.T0);
Codegen.genPop(Codegen.T1);
Codegen.generate("slt", Codegen.T0, Codegen.T1, Codegen.T0);
Codegen.generate("li", Codegen.T1, 1);
Codegen.generate("xor", Codegen.T0, Codegen.T0, Codegen.T1);
Codegen.genPush(Codegen.T0);
}
public void unparse(PrintWriter p, int indent) {
p.print("(");
myExp1.unparse(p, 0);
p.print(" >= ");
myExp2.unparse(p, 0);
p.print(")");
}
}
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.