blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2
values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 7 5.41M | extension stringclasses 11
values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
640f6cbcfd5a563b242ac80cd79562d1854a3a93 | ab9b9c62f36f8e37a07bbc4591442d56de9bbe1f | /TPNoteBis/src/controller/CtrlFermeture.java | b97dbdf630eeb65e4a3df9a2fddb172571ef69e9 | [] | no_license | lesquoyb/Quizz | 49b93b803bf7008b9b05e6ce951075f01f976d7d | 61f1b1000e3f243eb4ec63a972356336478d4500 | refs/heads/master | 2020-05-31T00:43:17.591059 | 2014-03-28T10:54:15 | 2014-03-28T10:54:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 302 | java | package controller;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import model.dao.MaConnection;
public class CtrlFermeture extends WindowAdapter {
@Override
public void windowClosing(WindowEvent e) {
MaConnection.fermer();
System.exit(0);
}
}
| [
"nouvelleaddresse@yahoo.fr"
] | nouvelleaddresse@yahoo.fr |
01cfea868eaa849118815a1a8a28e38ea143d6e1 | 45bd03654ffd77a00c1e0b035e09fb0fce55bfa8 | /Amazon/src/amazon/com/interview/Main.java | 6b2d3dbdf6ff276672f7ca8b866f5ce59c77a0e2 | [] | no_license | wjjjuniniho/Amazon | 1e3e1e8c3586fbf9b631e8a9a374c76f74056237 | c4693bd52dc1346aa93fd1de07c3f3b916de6313 | refs/heads/master | 2016-09-05T10:24:49.703217 | 2014-06-19T01:14:23 | 2014-06-19T01:14:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,223 | java | package amazon.com.interview;
import java.io.File;
import java.io.FileNotFoundException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Main {
/*
* assumption:
* the log file "access_log" is under the same dir of the application
* log format is apache combined log format
* the server can create as much logs as possible with 1000 different server ip addresses in "access_log"
*
* Solution:
* using a combination of hash map and min heap to solve the problem
*
*/
// log file name
private static final String LOG = "access_log";
// apache combined format
private static final String LOG_PATTERN = "^([\\d.]+) (\\S+) (\\S+) \\[([\\w:/]+\\s[+\\-]\\d{4})\\] \"(.+?)\" (\\d{3}) (\\d+) \"([^\"]+)\" \"([^\"]+)\"";
public static void main(String[] args) {
// for record all eligible ips
ArrayList<String> ips = new ArrayList<String>();
String line;
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.HOUR_OF_DAY, -1);
// get ts an hr ago
Date anHourAgo = calendar.getTime();
// for parse purpose
SimpleDateFormat sd = new SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss Z", Locale.ENGLISH);
Solution solution = new Solution();
try {
// read and store the ips in the past hour
Scanner scanner = new Scanner(new File(LOG));
while (scanner.hasNextLine()) {
line = scanner.nextLine();
// regex match
Pattern p = Pattern.compile(LOG_PATTERN);
Matcher matcher = p.matcher(line);
if (!matcher.matches() || matcher.groupCount() != 9) {
System.err.println("Pattern not matched");
return;
}
// get ip and date
String ip = matcher.group(1);
Date date = sd.parse(matcher.group(4));
// check if the date is in the past hour
if (date.after(anHourAgo)) {
ips.add(ip);
}
}
// print top 10 common urls
solution.printTopKFrequentHitIps(ips, 10);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
}
}
}
| [
"wjjjuniniho@gmail.com"
] | wjjjuniniho@gmail.com |
0e4fa3fd7476217cfd58fc7f43867d5d20203343 | 6844723c8c5b6e391c6888dad2a6ba15c6295514 | /aal_eficiency/FitbitPublisher/src/main/java/org/universAAL/FitbitPublisher/Activator.java | 9e7031a57f38c970c740339f429547a1b3c9d546 | [
"MIT",
"Apache-2.0"
] | permissive | universAAL/applications | db48294490c8ea845ad4b1b963ad4ded43294290 | c899dd1975474408671b583b96a6e0cafd0d6cf2 | refs/heads/master | 2021-06-27T15:19:57.468693 | 2020-10-30T10:11:41 | 2020-10-30T10:11:41 | 28,976,209 | 1 | 1 | null | 2021-06-04T01:00:01 | 2015-01-08T17:03:23 | Java | UTF-8 | Java | false | false | 2,527 | java | /*
Copyright 2011-2012 TSB, http://www.tsbtecnologias.es
TSB - Tecnolog�as para la Salud y el Bienestar
See the NOTICE file distributed with this work for additional
information regarding copyright ownership
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.universAAL.FitbitPublisher;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.universAAL.FitbitPublisher.database.FitbitDBInterface;
import org.universAAL.FitbitPublisher.utils.Setup;
import org.universAAL.middleware.container.ModuleContext;
import org.universAAL.middleware.container.osgi.uAALBundleContainer;
public class Activator implements BundleActivator {
public static BundleContext osgiContext = null;
public static ModuleContext context = null;
public void start(BundleContext bcontext) throws Exception {
System.out.print("FILE FITBIT "+Setup.getSetupFileName());
//FitbitDBInterface db = new FitbitDBInterface();
//db.createDB();
Activator.osgiContext = bcontext;
Activator.context = uAALBundleContainer.THE_CONTAINER
.registerModule(new Object[] { bcontext });
new Thread() {
public void run() {
FitbitPublisher f = new FitbitPublisher(osgiContext);
f.publishFitbitData();
System.out.print("FILE AALFFICIENCY "+Setup.getSetupFileName());
}
}.start();
// Timer t1 = new Timer();
// t1.scheduleAtFixedRate(new FitbitPublisher(bcontext), getTime(), 1000*60*60*24);
}
public void stop(BundleContext arg0) throws Exception {
}
public static Date getTime(){
Calendar tomorrow = new GregorianCalendar();
tomorrow.add(Calendar.DATE, 0);
Calendar result = new GregorianCalendar(
tomorrow.get(Calendar.YEAR),
tomorrow.get(Calendar.MONTH),
tomorrow.get(Calendar.DATE),
13,
56
);
return result.getTime();
}
}
| [
"imarti@tsbtecnologias.es"
] | imarti@tsbtecnologias.es |
32b47d338052d2290882e936c401c9f7f7812056 | a469a5fef20851790c79cb3a7d22317caaf9413b | /algafood-api/src/main/java/com/ffs/algafood/api/model/request/payment/method/PaymentMethodRequest.java | a182596fce8a8fb8bf31e14a41adb386dc561548 | [] | no_license | ffsfranciscosilva/algafood-api | b10abff9cab2ea4cf9eebff3a7384c929d616c03 | 6119ecdb2231d02347b0c018aef6f705ac4407ce | refs/heads/master | 2023-03-28T07:13:01.765856 | 2021-04-01T20:30:40 | 2021-04-01T20:30:40 | 292,910,995 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 616 | java | package com.ffs.algafood.api.model.request.payment.method;
import com.ffs.algafood.domain.model.restaurant.PaymentMethod;
import lombok.Getter;
import lombok.Setter;
import org.modelmapper.ModelMapper;
import javax.validation.constraints.NotBlank;
/**
*
* @author francisco
*/
@Getter
@Setter
public class PaymentMethodRequest {
@NotBlank
private String description;
public PaymentMethod toModel() {
return new ModelMapper().map(this, PaymentMethod.class);
}
public void copyPropertiesTo(PaymentMethod paymentMethod) {
new ModelMapper().map(this, paymentMethod);
}
}
| [
"fsilvafrancisco16@gmail.com"
] | fsilvafrancisco16@gmail.com |
3d1a41bb2d40d74c753bc511a3ba5bb4e87b4b56 | 7bddbcc6ae7a317abe1085c2d338529f9972500d | /app/src/main/java/com/orange/oy/activity/shakephoto_318/CommentDesActivity.java | c5cae8d8e409f7d3fe3ad735f6c79f7885a14d01 | [] | no_license | cherry98/Rose_ouye | a76158443444bb46bc03b402f44ff3f7723626a4 | 705a1cfedea65ac92e8cee2ef2421bbee56aed4c | refs/heads/master | 2020-03-28T15:44:50.818307 | 2018-09-13T10:36:14 | 2018-09-13T10:36:14 | 148,622,312 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,441 | java | package com.orange.oy.activity.shakephoto_318;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.orange.oy.R;
import com.orange.oy.activity.alipay.OuMiDetailActivity;
import com.orange.oy.base.AppInfo;
import com.orange.oy.base.BaseActivity;
import com.orange.oy.base.Tools;
import com.orange.oy.dialog.CustomProgressDialog;
import com.orange.oy.info.NewCommentInfo;
import com.orange.oy.network.NetworkConnection;
import com.orange.oy.network.Urls;
import com.orange.oy.util.ImageLoader;
import com.orange.oy.view.AppTitle;
import com.orange.oy.view.CircularImageView;
import com.orange.oy.view.MyListView;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import static com.orange.oy.R.id.iv_pic;
/**
* 评论详细回复
*/
public class CommentDesActivity extends BaseActivity implements AppTitle.OnBackClickForAppTitle {
private void initTitle() {
AppTitle appTitle = (AppTitle) findViewById(R.id.title);
appTitle.settingName(commentList.get(0).getActivity_name());
appTitle.showBack(this);
}
private String fi_id, comment_id, file_url, user_img, user_name, create_time, comment, content;
private ImageView iv_bigimg;
private TextView tv_submit;
private EditText ed_des;
private NetworkConnection sendComment;
private ArrayList<NewCommentInfo.CommentsBean> commentList = new ArrayList<>();
private ImageLoader imageLoader;
private MyListView lv_listview;
private String Username, Userimg;
private MyAdapter adapter;
@Override
protected void onStop() {
super.onStop();
if (sendComment != null) {
sendComment.stop(Urls.SendComment);
}
}
private void initNetworkConnection() {
sendComment = new NetworkConnection(this) {
@Override
public Map<String, String> getNetworkParams() {
Map<String, String> params = new HashMap<>();
params.put("token", Tools.getToken());
params.put("usermobile", AppInfo.getName(CommentDesActivity.this));
params.put("type", "1");
params.put("fi_id", fi_id);
params.put("comment_id", comment_id);
params.put("content", content);//回复内容
return params;
}
};
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_comment_des);
imageLoader = new ImageLoader(this);
Username = AppInfo.getUserName(this);
Userimg = AppInfo.getUserImagurl(this);
Intent data = getIntent();
commentList = (ArrayList<NewCommentInfo.CommentsBean>) data.getSerializableExtra("commentList");
initTitle();
initNetworkConnection();
lv_listview = (MyListView) findViewById(R.id.lv_listview);
iv_bigimg = (ImageView) findViewById(R.id.iv_bigimg);
ed_des = (EditText) findViewById(R.id.ed_des);
tv_submit = (TextView) findViewById(R.id.tv_submit);
String url = commentList.get(0).getFile_url();
if (!(url.startsWith("http://") || url.startsWith("https://"))) {
url = Urls.Endpoint3 + url;
}
imageLoader.setShowWH(500).DisplayImage(url, iv_bigimg, -2);
imageLoader.setShowWH(200).DisplayImage(Urls.Endpoint3 + commentList.get(0).getFile_url(), iv_bigimg, -2);
adapter = new MyAdapter();
lv_listview.setAdapter(adapter);
submit();
}
private void submit() {
tv_submit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (Tools.isEmpty(ed_des.getText().toString()) || "".equals(ed_des.getText().toString())) {
Tools.showToast(CommentDesActivity.this, "请填写评论~");
return;
}
content = ed_des.getText().toString();
fi_id = commentList.get(0).getFi_id();
comment_id = commentList.get(0).getComment_id();
Comment();
}
});
}
//评论提交
private void Comment() {
sendComment.sendPostRequest(Urls.SendComment, new Response.Listener<String>() {
@Override
public void onResponse(String s) {
Tools.d(s);
try {
JSONObject jsonObject = new JSONObject(s);
if (jsonObject.getInt("code") == 200) {
//加一个list
NewCommentInfo.CommentsBean commentsBean = new NewCommentInfo.CommentsBean();
commentsBean.setCreate_time(Tools.getNowDate());
commentsBean.setUser_name(commentList.get(0).getUser_name());
commentsBean.setUser_img(Userimg);
commentsBean.setComment(content);
commentList.add(commentsBean);
adapter.notifyDataSetChanged();
NewCommentActivity.IsRefresh = true;
content = "";
ed_des.setText("");
lv_listview.setSelection(lv_listview.getBottom());
} else {
Tools.showToast(CommentDesActivity.this, jsonObject.getString("msg"));
}
} catch (JSONException e) {
Tools.showToast(CommentDesActivity.this, getResources().getString(R.string.network_error));
}
CustomProgressDialog.Dissmiss();
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError volleyError) {
Tools.showToast(CommentDesActivity.this, getResources().getString(R.string.network_volleyerror));
CustomProgressDialog.Dissmiss();
}
});
}
class MyAdapter extends BaseAdapter {
@Override
public int getCount() {
return commentList.size();
}
@Override
public Object getItem(int position) {
return commentList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder;
if (convertView == null) {
viewHolder = new ViewHolder();
convertView = Tools.loadLayout(CommentDesActivity.this, R.layout.item_commentdes);
viewHolder.iv_pic = (CircularImageView) convertView.findViewById(iv_pic);
viewHolder.tv_name = (TextView) convertView.findViewById(R.id.tv_name);
viewHolder.tv_time = (TextView) convertView.findViewById(R.id.tv_time);
viewHolder.tv_des = (TextView) convertView.findViewById(R.id.tv_des);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
NewCommentInfo.CommentsBean commentsBean = commentList.get(position);
viewHolder.tv_time.setText(commentsBean.getCreate_time());
if (position == 0) {
viewHolder.tv_name.setText(commentsBean.getUser_name());
imageLoader.setShowWH(200).DisplayImage(Urls.ImgIp + commentsBean.getUser_img(), viewHolder.iv_pic, -2);
viewHolder.tv_des.setText(commentsBean.getComment());
} else {
viewHolder.tv_name.setText(Username);
imageLoader.setShowWH(200).DisplayImage(commentsBean.getUser_img(), viewHolder.iv_pic, -2);
String contents = Username + "@" + commentsBean.getUser_name() + commentsBean.getComment();
int end = contents.length() - commentsBean.getComment().length();
SpannableStringBuilder builder = new SpannableStringBuilder(contents);
builder.setSpan(new ForegroundColorSpan(getBaseContext().getResources().getColor(R.color.homepage_select)),
0, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
viewHolder.tv_des.setText(builder);
}
return convertView;
}
class ViewHolder {
TextView tv_name, tv_time, tv_des, tv_sure;
CircularImageView iv_pic;
}
}
public void onBackPressed() {
Intent intent = new Intent();
intent.putExtra("commentList", commentList);
setResult(RESULT_OK, intent);
baseFinish();
}
public void onBack() {
Intent intent = new Intent();
intent.putExtra("commentList", commentList);
setResult(RESULT_OK, intent);
baseFinish();
}
}
| [
"cherry18515@163.com"
] | cherry18515@163.com |
581296d8007ba4afcacbcdbe80f0f375cad5fe62 | 2ef2e1b5087df1bd48a39b4653736c71307ab9b4 | /Java/projeto-zini/src/main/java/programas/TelaDash.java | 3f2958f84418d9337a473a102e4e049a2b4f7ce9 | [] | no_license | Guilherme-NascimentoSantos/Integracao-Container | 479c32d58d8f886f41d9255d7d4998a5685d162b | de5de55fb804b691038ad4cb2876b95ed7845f23 | refs/heads/main | 2023-05-27T19:57:34.229452 | 2021-06-10T20:51:24 | 2021-06-10T20:51:24 | 375,530,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 22,935 | 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 programas;
import classes.AzureUser;
import classes.Componentes;
import classes.ConexaoAzure;
import classes.ConexaoConteiner;
import com.github.britooo.looca.api.core.Looca;
import javax.swing.ImageIcon;
import classes.DataAtual;
import classes.Leitura;
import java.awt.AWTException;
import java.awt.Image;
import java.awt.SystemTray;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.DecimalFormat;
import java.util.*;
import java.util.Timer;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import oshi.SystemInfo;
/**
*
* @author JAILSON e Vizer
*/
public class TelaDash extends javax.swing.JFrame {
DataAtual data = new DataAtual(new Date());
Integer alerta = Integer.parseInt(data.getMinuto()) + 1;
Integer agora;
Timer timerLeitura = new Timer();
TimerTask taskLeitura = new TimerTask() {
@Override
public void run() {
DataAtual data2 = new DataAtual(new Date());
agora = Integer.parseInt(data2.getMinuto());
System.out.println(alerta);
System.out.println(agora);
System.out.println("Ta testando");
if (alerta.equals(agora)) {
try {
System.out.println("FOIIIIIIIIIIIIIIIIIIIIIIIIII");
alerta += 1;
if (alerta.equals(60)) {
alerta = 0;
}
try {
mensagem();
} catch (IOException ex) {
Logger.getLogger(TelaDash.class.getName()).log(Level.SEVERE, null, ex);
}
} catch (AWTException e) {
}
}
}
};
final long SecondsLeitura = (1000 * 3);
//DataAtual data = new DataAtual(new Date());
SystemInfo systeminfo = new SystemInfo();
ConexaoAzure conectar = new ConexaoAzure();
Double memoria;
Double disco;
Double cpu;
// ConexaoConteiner conn = new ConexaoConteiner();
// Connection connection = conn.conexaoConteiner();
AzureUser consulta = new AzureUser();
Looca comp = new Looca();
Timer timer = new Timer();
TimerTask task = new TimerTask() {
@Override
public void run() {
memoria = comp.getMemoria().getEmUso().doubleValue() / 1000000000;
disco = comp.getGrupoDeDiscos().getTamanhoTotal().doubleValue() / 1000000000;
lbHDD.setText(String.format("%.0f GB", disco));
lbRAM.setText(String.format("%.2f %s", memoria, porcent));
}
};
TimerTask taskcpu = new TimerTask() {
@Override
public void run() {
cpu = comp.getProcessador().getUso();
lbProcessador.setText(String.format("%.1f %s", cpu, porcent));
}
};
final long Seconds = (2000 * 1);
final long SecondsCpu = (2000 * 1);
String porcent = "%";
String SO = comp.getSistema().getSistemaOperacional();
String ultimaverif = data.getDiaHora();
String fabSO = comp.getSistema().getFabricante();
// Long tempoIniciado = comp.getSistema().getTempoDeAtividade();
String nomeComputador;
String Memoriacad = "Memoria";
String Processcad = "Processador";
String Discocad = "Disco";
Integer fkEquipe = 1;
Integer fkUsuario = 2;
Integer contador = 1;
DecimalFormat deci = new DecimalFormat("####0.00");
/**
* Creates new form TelaDash
*/
public TelaDash() {
this.timer = new Timer();
initComponents();
timer.scheduleAtFixedRate(task, 0, Seconds);
timer.scheduleAtFixedRate(taskcpu, 0, SecondsCpu);
nomeComputador = JOptionPane.showInputDialog("Digite o nome do seu desktop");
List<Leitura> consultaCadastro = ConexaoAzure.jdbcTemplate.query(
"Select nomeComputador, idComputador from tbComputador where nomeComputador = ?",
new BeanPropertyRowMapper(Leitura.class),
nomeComputador);
List<Leitura> consultaDataHora = ConexaoAzure.jdbcTemplate.query(
"Select ultimaVerificacaoComponentes from tbComputador where nomeComputador = ?",
new BeanPropertyRowMapper(Leitura.class),
nomeComputador);
for (Leitura leitura : consultaDataHora) {
lbData.setText(leitura.getUltimaVerificacao());
}
if (!consultaCadastro.isEmpty()) {
ConexaoAzure.jdbcTemplate.update(
"update tbComputador set fabricanteSO = ?, tipoSistemaOperacional = ?, ultimaVerificacaoComponentes = ?, fkEquipe = ?, fkUsuario = ? "
+ "where nomeComputador = ?",
fabSO, SO, ultimaverif, fkEquipe, fkUsuario, nomeComputador);
for (Leitura leitura : consultaCadastro) {
System.out.println(leitura.getIdComputador());
List<Leitura> consultaIdComputador = ConexaoAzure.jdbcTemplate.query(
"select idComponente from tbComponentes "
+ "join tbComputador on fkComputador = idComputador\n"
+ "where nomeComponente in('Memoria', 'Processador', 'Disco') and fkComputador = ?", new BeanPropertyRowMapper(Leitura.class), leitura.getIdComputador());
Timer timer = new Timer();
TimerTask InsertLeitura = new TimerTask() {
@Override
public void run() {
for (Leitura leitura1 : consultaIdComputador) {
switch (contador) {
case 1:
ConexaoAzure.jdbcTemplate.update("insert into tbLeituras values ( ?, ?, ?, ?)",
data.getDiaHora(), leitura.getIdComputador(), leitura1.getIdComponente(), deci.format(memoria));
System.out.println(leitura1.getIdComponente());
contador++;
break;
case 2:
ConexaoAzure.jdbcTemplate.update("insert into tbLeituras values ( ?, ?, ?, ?)",
data.getDiaHora(), leitura.getIdComputador(), leitura1.getIdComponente(), deci.format(cpu));
System.out.println(leitura1.getIdComponente());
contador++;
break;
case 3:
ConexaoAzure.jdbcTemplate.update("insert into tbLeituras "
+ "values (?, ?, ?, ?)",
data.getDiaHora(), leitura.getIdComputador(), leitura1.getIdComponente(), deci.format(disco));
contador = 1;
System.out.println(leitura1.getIdComponente());
break;
}
}
}
};
final long SecondsCpu = (3000 * 1);
timer.scheduleAtFixedRate(InsertLeitura, 0, SecondsCpu);
break;
}
} else {
nomeComputador = JOptionPane.showInputDialog("Computador nao encontrado!! Registre um novo desktop");
ConexaoAzure.jdbcTemplate.update(
"insert into tbComputador"
+ "(nomeComputador, fabricanteSO, tipoSistemaOperacional, ultimaVerificacaoComponentes, fkEquipe, fkUsuario)"
+ " values (?, ?, ?, ?, ? ,?)", nomeComputador, fabSO, SO, ultimaverif, fkEquipe, fkUsuario);
// try {
//
// String insercao = String.format("insert into tbComputador"
// + "(idComputador, nomeComputador, fabricanteSO, tipoSistemaOperacional, ultimaVerificacaoComponentes, fkEquipe, fkUsuario)"
// + " values (null, '%s', '%s', '%s', '%s', %d ,%d)", nomeComputador, fabSO, SO, ultimaverif, fkEquipe, fkUsuario);
// System.out.println(insercao);
// PreparedStatement statement = connection.prepareStatement(insercao);
//// System.out.println(insercao);
// statement.execute();
// System.out.println("DEU CERTO!!!!!!!!");
//
// } catch (SQLException e) {
// System.out.println(e);
// }
List<Leitura> id = ConexaoAzure.jdbcTemplate.query(
"select top 1 idComputador from tbComputador order by idComputador desc",
new BeanPropertyRowMapper(Leitura.class));
for (Leitura caco : id) {
ConexaoAzure.jdbcTemplate.update(
"Insert into tbComponentes values (?,?,?,?,?)",
Memoriacad, Memoriacad, 75, 90, caco.getIdComputador());
ConexaoAzure.jdbcTemplate.update(
"Insert into tbComponentes values (?,?,?,?,?)",
Processcad, Processcad, 75, 90, caco.getIdComputador());
ConexaoAzure.jdbcTemplate.update(
"Insert into tbComponentes values (?,?,?,?,?)",
Discocad, Discocad, 75, 90, caco.getIdComputador());
}
}
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jPanel2 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
lbicon3 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
lbProcessador = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
lbHDD = new javax.swing.JLabel();
lbRAM = new javax.swing.JLabel();
lbData = new javax.swing.JLabel();
lbicon4 = new javax.swing.JLabel();
lbicon5 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(null);
jPanel1.setBackground(new java.awt.Color(51, 51, 51));
jPanel1.setLayout(null);
jPanel2.setBackground(new java.awt.Color(252, 197, 119));
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 760, Short.MAX_VALUE)
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 0, Short.MAX_VALUE)
);
jPanel1.add(jPanel2);
jPanel2.setBounds(10, 110, 760, 1);
jLabel1.setFont(new java.awt.Font("Monospaced", 1, 36)); // NOI18N
jLabel1.setForeground(new java.awt.Color(255, 255, 255));
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("Dashboards");
jPanel1.add(jLabel1);
jLabel1.setBounds(240, 40, 300, 50);
lbicon3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Grafico.png"))); // NOI18N
jPanel1.add(lbicon3);
lbicon3.setBounds(90, 190, 110, 90);
jLabel5.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jLabel5.setForeground(new java.awt.Color(255, 255, 255));
jLabel5.setText("Processador");
jPanel1.add(jLabel5);
jLabel5.setBounds(580, 300, 150, 40);
jLabel6.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jLabel6.setForeground(new java.awt.Color(255, 255, 255));
jLabel6.setText("Disco Rígido");
jPanel1.add(jLabel6);
jLabel6.setBounds(70, 300, 150, 40);
jLabel7.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jLabel7.setForeground(new java.awt.Color(255, 255, 255));
jLabel7.setText("Memória");
jPanel1.add(jLabel7);
jLabel7.setBounds(350, 300, 120, 40);
lbProcessador.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
lbProcessador.setForeground(new java.awt.Color(255, 255, 255));
lbProcessador.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
lbProcessador.setText("-----");
jPanel1.add(lbProcessador);
lbProcessador.setBounds(520, 340, 260, 40);
jLabel12.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
jLabel12.setForeground(new java.awt.Color(252, 197, 119));
jLabel12.setText("Ultima data visualizada:");
jPanel1.add(jLabel12);
jLabel12.setBounds(220, 450, 170, 40);
jLabel8.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
jLabel8.setForeground(new java.awt.Color(255, 255, 255));
jLabel8.setText("Copyright ©2020 ini. Designed By INI DEVELOPMENT"); // NOI18N
jPanel1.add(jLabel8);
jLabel8.setBounds(190, 510, 400, 50);
jLabel2.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
jLabel2.setForeground(new java.awt.Color(252, 197, 119));
jLabel2.setText("Z");
jPanel1.add(jLabel2);
jLabel2.setBounds(428, 527, 10, 17);
jLabel3.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
jLabel3.setForeground(new java.awt.Color(252, 197, 119));
jLabel3.setText("Z");
jPanel1.add(jLabel3);
jLabel3.setBounds(304, 527, 10, 17);
lbHDD.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
lbHDD.setForeground(new java.awt.Color(255, 255, 255));
lbHDD.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
lbHDD.setText("-----");
jPanel1.add(lbHDD);
lbHDD.setBounds(10, 340, 260, 40);
lbRAM.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
lbRAM.setForeground(new java.awt.Color(255, 255, 255));
lbRAM.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
lbRAM.setText("-----");
jPanel1.add(lbRAM);
lbRAM.setBounds(270, 340, 260, 40);
lbData.setFont(new java.awt.Font("Monospaced", 1, 14)); // NOI18N
lbData.setForeground(new java.awt.Color(252, 197, 119));
jPanel1.add(lbData);
lbData.setBounds(390, 450, 220, 40);
lbicon4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Grafico.png"))); // NOI18N
jPanel1.add(lbicon4);
lbicon4.setBounds(600, 200, 110, 90);
lbicon5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Grafico.png"))); // NOI18N
jPanel1.add(lbicon5);
lbicon5.setBounds(350, 190, 110, 90);
jLabel9.setFont(new java.awt.Font("Monospaced", 1, 24)); // NOI18N
jLabel9.setForeground(new java.awt.Color(255, 255, 255));
jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel9.setText("Sair");
jLabel9.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jLabel9.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel9MouseClicked(evt);
}
});
jPanel1.add(jLabel9);
jLabel9.setBounds(20, 40, 80, 50);
jLabel10.setFont(new java.awt.Font("Monospaced", 1, 14)); // NOI18N
jLabel10.setForeground(new java.awt.Color(255, 255, 255));
jLabel10.setText("Configurações");
jLabel10.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel10MouseClicked(evt);
}
});
jPanel1.add(jLabel10);
jLabel10.setBounds(620, 50, 140, 30);
getContentPane().add(jPanel1);
jPanel1.setBounds(0, -10, 790, 570);
setSize(new java.awt.Dimension(803, 601));
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
private void jLabel9MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel9MouseClicked
int trocaUsuario = JOptionPane.showConfirmDialog(null, "Tem certeza que deseja trocar de usúario ?", "Atenção!", JOptionPane.YES_NO_OPTION);
if (trocaUsuario == JOptionPane.YES_OPTION) {
// System.exit(0);
task.cancel();
taskcpu.cancel();
TelaLogin log = new TelaLogin();
log.setVisible(true);
dispose();
}
}//GEN-LAST:event_jLabel9MouseClicked
private void jLabel10MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel10MouseClicked
int trocaUsuario = JOptionPane.showConfirmDialog(null, "Gostaria de acessar a tela de Configurações ?", "Atenção!", JOptionPane.YES_NO_OPTION);
if (trocaUsuario == JOptionPane.YES_OPTION) {
ConfiguraçãoAlerta logg = new ConfiguraçãoAlerta();
logg.setVisible(true);
dispose();
}
}//GEN-LAST:event_jLabel10MouseClicked
/**
* @param args the command line arguments
*/
public static void main(String args[])throws AWTException , IOException{
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(TelaDash.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(TelaDash.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(TelaDash.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(TelaDash.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new TelaDash().setVisible(true);
}
});
if (SystemTray.isSupported()) {
TelaDash td = new TelaDash();
td.timer();
} else {
System.out.println("System not supported");
}
Logs gravandoLog = new Logs();
try {
gravandoLog.gravarLog("Usuário realizou login !!");
} catch (IOException ex) {
gravandoLog.gravarLog("usuário nao encontrado");
// Logger.getLogger(TelaLogin.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void timer() throws IOException {
this.timerLeitura = new Timer();
timerLeitura.scheduleAtFixedRate(taskLeitura, 0, SecondsLeitura);
Logs gravandoLog = new Logs();
try {
gravandoLog.gravarLog("Sistema zini está com o horário correto!!");
} catch (IOException ex) {
gravandoLog.gravarLog("Horário incorreto");
// Logger.getLogger(TelaLogin.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void mensagem() throws AWTException,IOException {
SystemTray tray = SystemTray.getSystemTray();
Image image = Toolkit.getDefaultToolkit().createImage("icon.png");
TrayIcon trayIcon = new TrayIcon(image, "Tray demo");
trayIcon.setImageAutoSize(true);
trayIcon.setToolTip("System tray icon demo");
tray.add(trayIcon);
trayIcon.displayMessage("Hello World",
"Isso é um teste da zini", TrayIcon.MessageType.INFO);
Logs gravandoLog = new Logs();
try {
gravandoLog.gravarLog("Sistema zini está exibindo mensagens corretamente!!");
} catch (IOException ex) {
gravandoLog.gravarLog("Sistema zini não está exibindo mensagens corretamente!!");
// Logger.getLogger(TelaLogin.class.getName()).log(Level.SEVERE, null, ex);
}
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JLabel lbData;
private javax.swing.JLabel lbHDD;
private javax.swing.JLabel lbProcessador;
private javax.swing.JLabel lbRAM;
private javax.swing.JLabel lbicon3;
private javax.swing.JLabel lbicon4;
private javax.swing.JLabel lbicon5;
// End of variables declaration//GEN-END:variables
}
| [
"guilherme.nascimento@bandtec.com.br"
] | guilherme.nascimento@bandtec.com.br |
eb2f33824152b39952f84616b2ee3759a42f920f | 095ec76939681f29a231dd2ebdcda3a42df70049 | /app/src/main/java/com/hencoder/hencoderpracticedraw3/sample/Sample18SetTextLocaleView.java | 72d3aac5e700582f6271975ae116fd65ef7022b7 | [] | no_license | zhanaotian/PracticeDraw3 | 73d2aaafa6bd15214bc35ff09b8fef1e4e9d4e6c | 07da978604129d98d24a49dcccb03851ab4b8045 | refs/heads/master | 2020-04-05T04:48:27.653862 | 2019-01-30T10:12:45 | 2019-01-30T10:12:45 | 156,567,777 | 0 | 0 | null | 2018-11-07T15:31:33 | 2018-11-07T15:31:32 | null | UTF-8 | Java | false | false | 1,356 | java | package com.hencoder.hencoderpracticedraw3.sample;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import java.util.Locale;
/**
* setTextLocale(Locale locale) / setTextLocales(LocaleList locales)
* 设置绘制所用的 Locale
*/
public class Sample18SetTextLocaleView extends View {
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
private String text = "雨骨底条今直算账";
public Sample18SetTextLocaleView(Context context) {
super(context);
}
public Sample18SetTextLocaleView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public Sample18SetTextLocaleView(Context context, @Nullable AttributeSet attrs,
int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
{
paint.setTextSize(60);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
//中文
paint.setTextLocale(Locale.CHINA);
canvas.drawText(text, 0, 150, paint);
//繁体中文
paint.setTextLocale(Locale.TAIWAN);
canvas.drawText(text, 0, 150 + paint.getFontSpacing(), paint);
//日语
paint.setTextLocale(Locale.JAPAN);
canvas.drawText(text, 0, 150 + paint.getFontSpacing() * 2, paint);
}
}
| [
"zhanaotian@users.noreply.github.com"
] | zhanaotian@users.noreply.github.com |
1ce552dd487fe08dfcce9f3f6267ff8a983d4cb0 | 204ff5a7cfd6325c9733479c5837ebb2e21d31d9 | /compiler/src/ConstMethodRef.java | aa3b4e77155b6c7435b6e6a4c73c450edba9e451 | [] | no_license | yang123vc/jfvm | f2a7726b5df3993d52da58720054b3e2fe6fdec8 | c6ec82fb68f44e733d795374fdb2989399568c1e | refs/heads/master | 2020-07-16T13:27:10.502379 | 2016-12-08T13:11:53 | 2016-12-08T13:11:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 161 | java | /**
*
* @author pquiring
*/
public class ConstMethodRef extends Const {
//type = 10
short cls_idx; //->UTF8
short name_type_idx; //->ConstNameType
}
| [
"pquiring@SFS-PQUIRING.magna.global"
] | pquiring@SFS-PQUIRING.magna.global |
7e28fdf967e1cd83b0dd7727bfcd59108db8fb72 | 01939b4780d074b5d4854712ee15cbaf1ecdd767 | /src/test/java/pages/android/AndroidGithubOrganizationsPage.java | ccaef3220cb5e7b6ea4f69e38446d795d7e0ad99 | [] | no_license | mgviscarra/Automation-Sample | a375a179fff814cda6afa53ae85814141c34e13d | c5297970ef27f50ba7f3820ab8b71a0083471856 | refs/heads/master | 2022-12-14T04:38:58.332768 | 2020-09-18T06:16:38 | 2020-09-18T06:16:38 | 296,510,958 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 600 | java | package pages.android;
import com.codeborne.selenide.Condition;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import pages.GithubOrganizationsPage;
import static cross.automationLibrary.configuration.Platform.Constants.ANDROID;
@Component
@Profile({ANDROID})
public class AndroidGithubOrganizationsPage extends GithubOrganizationsPage {
@Override
public void verifyOrganizationsPage() throws InterruptedException {
$("ORGANIZATIONS_LABEL").should(Condition.appear).isDisplayed();
$("BACK_BUTTON").click();
}
}
| [
"mviscarra@inmarket.com"
] | mviscarra@inmarket.com |
9d3a78596cc5f9966eb8d63b99746ae18ccb2af4 | b6b2223ad616709b2d84275e665c36987073590a | /WalletREST/src/wallet/dao/DonateDAO.java | 9e3b2a5764c96b9ed418737f3a185ce58ef1ba0d | [] | no_license | NikantVohra/JavaRest | 6def9f61bc2ecd61c7a01ad59e9544bf5d0c3e4f | 5090238295f63956c890c35f9df392fb219f2d47 | refs/heads/master | 2021-01-10T20:03:25.165225 | 2013-12-11T17:34:08 | 2013-12-11T17:34:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,419 | java | package wallet.dao;
import java.util.ArrayList;
import wallet.models.Artifact;
import wallet.models.DonatedArtifact;
import wallet.models.Offer;
import wallet.models.SharedArtifact;
import wallet.models.User;
import wallet.models.Wallet;
import wallet.utils.DAOFactory;
import wallet.utils.DBAccess;
import wallet.utils.Utils;
import com.google.code.morphia.Datastore;
import com.google.code.morphia.Morphia;
import com.google.code.morphia.dao.BasicDAO;
import com.google.code.morphia.query.Query;
import com.mongodb.DBCursor;
import com.mongodb.Mongo;
public class DonateDAO extends BasicDAO<DonatedArtifact, String> {
public DonateDAO(Mongo mongo, Morphia morphia, String DBname) {
super(mongo, morphia, DBname);
}
public boolean isPresent(String artifactId) {
if (ds.find(DonatedArtifact.class, "artifactId ==", artifactId).get() != null)
return true;
else
return false;
}
public String getAllDonatedArtifactsAsJSON(){
ArrayList<Artifact> result = new ArrayList<Artifact>();
Query<DonatedArtifact> curs = ds.find(DonatedArtifact.class);
for(DonatedArtifact s : curs.asList()){
Artifact a = DAOFactory.getArtifact(s.getArtifactId());
if(a != null)
result.add(a);
}
return Utils.ObjToJSON(result.toArray());
}
public boolean donate(String artifactId) {
if(!isPresent(artifactId)){
ds.save(new DonatedArtifact(artifactId));
return true;
}
return false;
}
}
| [
"nikant@outlook.com"
] | nikant@outlook.com |
5c28ef1867b990cadbce15f8e810dbe03d40b5d4 | 5b58eab4cad7f2d5f9efe0799bdd383c1cd496b2 | /src/gofish_assn/Main.java | 07978b77b7e02979d504fe3d54a1833dd7410c8b | [] | no_license | rchand20/EE422C_GoFish | cce7186fa7376033f3dd134bcbfd18cf1fcbb2c4 | 344d35f2bd53f5bd41c8db5e81d396596c778d27 | refs/heads/master | 2021-05-03T10:57:17.985169 | 2018-02-07T01:10:00 | 2018-02-07T01:10:00 | 120,541,233 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 560 | java | package gofish_assn;
public class Main {
public static void main(String args[]) {
System.out.println("Hello World!");
Card c = new Card();
Card c2 = new Card(4,'d');
System.out.println();
System.out.println(c.toString());
Deck d = new Deck();
d.printDeck();
System.out.println();
d.shuffle();
System.out.println();
d.printDeck();
c = d.dealCard();
System.out.println(c.toString());
Player p1 = new Player("Jane");
System.out.println(p1.getName());
}
}
| [
"rchand20@utexas.edu"
] | rchand20@utexas.edu |
385ea2d50d66a7fdc18d1dfab67491f201f8fe22 | 317cb97af3188aa11cbcff0a9de37b8a0c528d3e | /NewExperiment/ManuCheck/elasticsearch/0.1/refactor66/newCloneFile6.txt | c51cb272e0a2669ffe7ea50eed88be83eaf19b3c | [] | no_license | pldesei/CloneRefactoring | cea58e06abfcf049da331d7bf332dd05278dbafc | c989422ea3aab79b4b87a270d7ab948307569f11 | refs/heads/master | 2021-01-19T17:37:29.938335 | 2018-07-11T02:56:29 | 2018-07-11T02:56:29 | 101,065,962 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,810 | txt | /*
* Licensed to Elastic Search and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Elastic Search licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.search.facet.terms;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import org.apache.lucene.util.BytesRef;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.regex.Regex;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.fielddata.IndexFieldData;
import org.elasticsearch.index.fielddata.IndexNumericFieldData;
import org.elasticsearch.index.fielddata.IndexOrdinalFieldData;
import org.elasticsearch.index.mapper.FieldMapper;
import org.elasticsearch.script.SearchScript;
import org.elasticsearch.search.facet.Facet;
import org.elasticsearch.search.facet.FacetCollector;
import org.elasticsearch.search.facet.FacetPhaseExecutionException;
import org.elasticsearch.search.facet.FacetProcessor;
import org.elasticsearch.search.facet.terms.doubles.TermsDoubleFacetCollector;
import org.elasticsearch.search.facet.terms.index.IndexNameFacetCollector;
import org.elasticsearch.search.facet.terms.longs.TermsLongFacetCollector;
import org.elasticsearch.search.facet.terms.strings.FieldsTermsStringFacetCollector;
import org.elasticsearch.search.facet.terms.strings.ScriptTermsStringFieldFacetCollector;
import org.elasticsearch.search.facet.terms.strings.TermsStringFacetCollector;
import org.elasticsearch.search.facet.terms.strings.TermsStringOrdinalsFacetCollector;
import org.elasticsearch.search.internal.SearchContext;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
/**
*
*/
public class TermsFacetProcessor extends AbstractComponent implements FacetProcessor {
@Inject
public TermsFacetProcessor(Settings settings) {
super(settings);
InternalTermsFacet.registerStreams();
}
@Override
public String[] types() {
return new String[]{TermsFacet.TYPE};
}
@Override
public FacetCollector parse(String facetName, XContentParser parser, SearchContext context) throws IOException {
String field = null;
int size = 10;
String[] fieldsNames = null;
ImmutableSet<BytesRef> excluded = ImmutableSet.of();
String regex = null;
String regexFlags = null;
TermsFacet.ComparatorType comparatorType = TermsFacet.ComparatorType.COUNT;
String scriptLang = null;
String script = null;
Map<String, Object> params = null;
boolean allTerms = false;
String executionHint = null;
String currentFieldName = null;
XContentParser.Token token;
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
if (token == XContentParser.Token.FIELD_NAME) {
currentFieldName = parser.currentName();
} else if (token == XContentParser.Token.START_OBJECT) {
if ("params".equals(currentFieldName)) {
params = parser.map();
}
} else if (token == XContentParser.Token.START_ARRAY) {
if ("exclude".equals(currentFieldName)) {
ImmutableSet.Builder<BytesRef> builder = ImmutableSet.builder();
while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) {
builder.add(parser.bytes());
}
excluded = builder.build();
} else if ("fields".equals(currentFieldName)) {
List<String> fields = Lists.newArrayListWithCapacity(4);
while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) {
fields.add(parser.text());
}
fieldsNames = fields.toArray(new String[fields.size()]);
}
} else if (token.isValue()) {
if ("field".equals(currentFieldName)) {
field = parser.text();
} else if ("script_field".equals(currentFieldName)) {
script = parser.text();
} else if ("size".equals(currentFieldName)) {
size = parser.intValue();
} else if ("all_terms".equals(currentFieldName) || "allTerms".equals(currentFieldName)) {
allTerms = parser.booleanValue();
} else if ("regex".equals(currentFieldName)) {
regex = parser.text();
} else if ("regex_flags".equals(currentFieldName) || "regexFlags".equals(currentFieldName)) {
regexFlags = parser.text();
} else if ("order".equals(currentFieldName) || "comparator".equals(currentFieldName)) {
comparatorType = TermsFacet.ComparatorType.fromString(parser.text());
} else if ("script".equals(currentFieldName)) {
script = parser.text();
} else if ("lang".equals(currentFieldName)) {
scriptLang = parser.text();
} else if ("execution_hint".equals(currentFieldName) || "executionHint".equals(currentFieldName)) {
executionHint = parser.textOrNull();
}
}
}
if ("_index".equals(field)) {
return new IndexNameFacetCollector(facetName, context.shardTarget().index(), comparatorType, size);
}
Pattern pattern = null;
if (regex != null) {
pattern = Regex.compile(regex, regexFlags);
}
SearchScript searchScript = null;
if (script != null) {
searchScript = context.scriptService().search(context.lookup(), scriptLang, script, params);
}
if (fieldsNames != null) {
return new FieldsTermsStringFacetCollector(facetName, fieldsNames, size, comparatorType, allTerms, context, excluded, pattern, searchScript);
}
if (field == null && fieldsNames == null && script != null) {
return new ScriptTermsStringFieldFacetCollector(facetName, size, comparatorType, context, excluded, pattern, scriptLang, script, params);
}
FieldMapper fieldMapper = context.smartNameFieldMapper(field);
if (fieldMapper == null) {
throw new FacetPhaseExecutionException(facetName, "failed to find mapping for [" + field + "]");
}
IndexFieldData indexFieldData = context.fieldData().getForField(fieldMapper);
if (indexFieldData instanceof IndexNumericFieldData) {
IndexNumericFieldData indexNumericFieldData = (IndexNumericFieldData) indexFieldData;
if (indexNumericFieldData.getNumericType().isFloatingPoint()) {
return new TermsDoubleFacetCollector(facetName, indexNumericFieldData, size, comparatorType, allTerms, context, excluded, searchScript);
} else {
return new TermsLongFacetCollector(facetName, indexNumericFieldData, size, comparatorType, allTerms, context, excluded, searchScript);
}
} else {
if (script != null || "map".equals(executionHint)) {
return new TermsStringFacetCollector(facetName, indexFieldData, size, comparatorType, allTerms, context, excluded, pattern, searchScript);
} else if (indexFieldData instanceof IndexOrdinalFieldData) {
return new TermsStringOrdinalsFacetCollector(facetName, (IndexOrdinalFieldData) indexFieldData, size, comparatorType, allTerms, context, excluded, pattern);
} else {
return new TermsStringFacetCollector(facetName, indexFieldData, size, comparatorType, allTerms, context, excluded, pattern, searchScript);
}
}
}
@Override
public Facet reduce(String name, List<Facet> facets) {
InternalTermsFacet first = (InternalTermsFacet) facets.get(0);
return first.reduce(name, facets);
}
}
| [
"pldesei@163.com"
] | pldesei@163.com |
c1ee69a4d425e55ef6193d02211bc3c3155751d5 | 47ab9771d0c3a933788126b29c27bf09974939c0 | /src/com/rocks/source/java/io/OutputStream.java | 9ad9cdb5892c5c9caa17c0cb915f64d985690051 | [] | no_license | Rocks526/Jdk8-Notes | a15db2e63de44412e332887a3bc0f8b2d494d0aa | 6f3b33c1dcb7e9c2b77ea25259c91303756acc41 | refs/heads/master | 2022-05-04T00:44:45.115235 | 2022-04-18T14:26:22 | 2022-04-18T14:26:22 | 244,622,649 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,046 | java | package java.io;
/**
* 字节输出流 接收一些输出的字节 将他们输出到一些sink
*/
public abstract class OutputStream implements Closeable, Flushable {
public abstract void write(int b) throws IOException;
// 将字节数组参数输出到这个输出流
public void write(byte b[]) throws IOException {
write(b, 0, b.length);
}
public void write(byte b[], int off, int len) throws IOException {
if (b == null) {
throw new NullPointerException();
} else if ((off < 0) || (off > b.length) || (len < 0) ||
((off + len) > b.length) || ((off + len) < 0)) {
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return;
}
for (int i = 0 ; i < len ; i++) {
write(b[off + i]);
}
}
// 刷新缓冲区 将字节刷入sink (操作系统层)
public void flush() throws IOException {
}
// 关闭输出流
public void close() throws IOException {
}
}
| [
"lizhaoxuan@qianxin.com"
] | lizhaoxuan@qianxin.com |
d687b241bb94a4460f910fd1291f7bb95ab40f98 | e37dae679ed8065d8a32754bfb3590a7608a803b | /6,7 链表/CombineLink.java | 61f091745b278621d1f93eb2fe63748a02c00578 | [] | no_license | mitDarkMomo/Data-Structures-and-Algorithms | 02d47eb07e8fc1a6700359bc9f4fcae8c6fa700d | e8bf153239b6c2c5135f356a78ad878a86cd13d5 | refs/heads/master | 2020-03-31T13:10:55.774852 | 2018-10-15T14:49:01 | 2018-10-15T14:49:01 | 152,244,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,471 | java | //两个有序的链表合并
class Node {
int val;
Node next;
Node(int _val) {
val = _val;
}
}
public class CombineLink {
public static Node combineLink(Node _link1, Node _link2) {
Node cur = new Node(-1);
Node head = cur;
while(_link1 != null && _link2 != null) {
if(_link1.val <= _link2.val) {
cur.next = _link1;
_link1 = _link1.next;
} else {
cur.next = _link2;
_link2 = _link2.next;
}
cur = cur.next;
}
if(_link1 == null) {
cur.next = _link2;
} else {
cur.next = _link1;
}
return head.next;
}
public static void main(String[] args) {
Node link1 = new Node(0);
Node head = link1;
for(int i = 1; i < 4; i++) {
Node node = new Node(i);
link1.next = node;
link1 = link1.next;
}
link1 = head.next;
Node link2 = head;
for(int i = 4; i < 8; i++) {
Node node = new Node(i);
link2.next = node;
link2 = link2.next;
}
link2 = head.next;
head = combineLink(link1, link2);
while(head != null) {
System.out.println("Node value is: " + head.val);
head = head.next;
}
}
}
| [
"yx807582@gmail.com"
] | yx807582@gmail.com |
689618033f6d522ef3d8f2a1ca0c1eff8fb9e9a6 | 424860eb2e938df820dbc4c5c38ad91183d6c848 | /module-1/10_Classes_Encapsulation/lecture-final/java/src/main/java/com/techelevator/Person.java | 04a51f4fc082a0f059238c4b9962afa1960f35c9 | [] | no_license | knox-andrew/TechJava | f3ae878afcf4f415640111b034810c9a4ae48aa3 | 9c62d9848239b57f2a5f15835ed12cec7d026a98 | refs/heads/master | 2023-01-07T16:42:52.989548 | 2019-08-02T17:43:04 | 2019-08-02T17:43:04 | 203,193,244 | 0 | 0 | null | 2023-01-04T07:36:32 | 2019-08-19T14:50:39 | TSQL | UTF-8 | Java | false | false | 458 | java | package com.techelevator;
public class Person {
private final String name;
public static int numberOfEyes;
public static final String GREETING = "Hello";
public Person(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void sayName() {
System.out.println(GREETING + " my name is " + name + " and I have " + numberOfEyes + " eyes.");
}
public static void addAnEye() {
numberOfEyes++;
}
}
| [
"david.pc@techelevator.com"
] | david.pc@techelevator.com |
5bdc2f2d68ce6d4b66c41b740bca480a06c53059 | 2f01c487dcc1aaff60f300042974ac33aa9ccb47 | /app/src/main/java/com/mahta/rastin/broadcastapplication/activity/startup/SplashActivity.java | 7f9931b5e1d2e436575632a8af3204c860780713 | [] | no_license | rastinbw/broadcast_application_client | 1967f16b1ca5647edaff92fb9919ebf06b4e250e | 381e2da933eea1aa9cf906994f1a7d834fcdf54c | refs/heads/master | 2020-03-26T11:33:12.030419 | 2018-09-04T10:01:48 | 2018-09-04T10:01:48 | 144,847,130 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,284 | java | package com.mahta.rastin.broadcastapplication.activity.startup;
import android.content.ContentValues;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.View;
import com.mahta.rastin.broadcastapplication.R;
import com.mahta.rastin.broadcastapplication.activity.registration.RegistrationActivity;
import com.mahta.rastin.broadcastapplication.global.Constant;
import com.mahta.rastin.broadcastapplication.global.G;
import com.mahta.rastin.broadcastapplication.global.Keys;
import com.mahta.rastin.broadcastapplication.helper.HttpCommand;
import com.mahta.rastin.broadcastapplication.helper.JSONParser;
import com.mahta.rastin.broadcastapplication.interfaces.OnResultListener;
import com.mahta.rastin.broadcastapplication.model.Group;
import java.util.List;
import java.util.Locale;
public class SplashActivity extends AppCompatActivity {
boolean isSplashDone = false;
boolean isDataReceived = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setLocale(new Locale("en"));
setContentView(R.layout.activity_splash);
if (G.isNetworkAvailable(getApplicationContext())) {
// if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
// startService(new Intent(this, NotificationService.class));
// }
runSplash();
}else {
findViewById(R.id.rtlNoNetwork).setVisibility(View.VISIBLE);
findViewById(R.id.imgLogo).setVisibility(View.GONE);
}
findViewById(R.id.btnTryAgain).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (G.isNetworkAvailable(getApplicationContext())){
findViewById(R.id.rtlNoNetwork).setVisibility(View.GONE);
findViewById(R.id.imgLogo).setVisibility(View.VISIBLE);
runSplash();
}
}
});
}
private void runSplash() {
isSplashDone = false;
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
isSplashDone = true;
if (isDataReceived)
go();
else{
findViewById(R.id.rtlNoNetwork).setVisibility(View.VISIBLE);
findViewById(R.id.imgLogo).setVisibility(View.GONE);
}
}
}, Constant.SPLASH_TIME);
checkToken();
if (!isDataReceived) {
new HttpCommand(HttpCommand.COMMAND_GET_GROUP_LIST, null)
.setOnResultListener(new OnResultListener() {
@Override
public void onResult(String result) {
G.realmController.clearAllGroups();
List<Group> list = JSONParser.parseGroups(result);
if (list != null) {
for (Group group : list) {
G.realmController.addGroup(group);
G.i(group.getTitle());
}
}
isDataReceived = true;
if (isSplashDone) {
go();
}
}
}).execute();
}
}
private void go(){
Intent intent = new Intent(SplashActivity.this, RegistrationActivity.class);
startActivity(intent);
finish();
}
private void checkToken(){
if (G.isUserSignedIn()){
ContentValues contentValues = new ContentValues();
contentValues.put(Keys.KEY_TOKEN,G.realmController.getUserToken().getToken());
new HttpCommand(HttpCommand.COMMAND_CHECK_TOKEN,contentValues)
.setOnResultListener(new OnResultListener() {
@Override
public void onResult(String result) {
int resultCode = JSONParser.getResultCodeFromJson(result);
if (resultCode == Keys.RESULT_INVALID_TOKEN){
G.logout(getApplicationContext());
}
}
}).execute();
}
}
@SuppressWarnings("deprecation")
private void setLocale(Locale locale){
Resources resources = getResources();
Configuration configuration = resources.getConfiguration();
DisplayMetrics displayMetrics = resources.getDisplayMetrics();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1){
configuration.setLocale(locale);
getApplicationContext().createConfigurationContext(configuration);
}
else{
configuration.locale=locale;
resources.updateConfiguration(configuration,displayMetrics);
}
}
}
| [
"rastinbw@gmail.com"
] | rastinbw@gmail.com |
3a5a512e1c1abd2644d0cc256987f52dc09fddf1 | 78540432132ffd7697a4b56060e35142d07affbf | /src/com/company/task3/Computer.java | bd8b0f3e9202fb631e28c654938b221cb9068951 | [] | no_license | Vladeks/Semples | 95d490ac67a6f443dfabdc36ed1b25bf4223944c | fdaafef5890ef0c2f3a17623956e35b44fab01fe | refs/heads/master | 2020-04-09T09:46:28.380730 | 2018-12-18T19:18:30 | 2018-12-18T19:18:30 | 160,246,093 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,858 | java | package com.company.task3;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
public class Computer {
private List<Component> components;
private int totalPrice;
private int price;
public Computer(int totalPrice) {
this.totalPrice = totalPrice;
this.price = 0;
components = new ArrayList<>();
}
public boolean canUseThisComponent(Component component) {
return canUsePrice(component.getPrice()) && !hasComponent(component.getType());
}
public boolean canUsePrice(int componentPrice) {
return (this.price + componentPrice) <= this.totalPrice;
}
public void addComponent(Component component) {
components.add(component);
price+= component.getPrice();
}
public boolean hasComponent(Component.Type type) {
for (Component item : components) {
if(type.equals(item.getType())) {
return true;
}
}
return false;
}
private void checkAllComponent() {
// if(components.size() < Component.Type.values().length) {
// System.out.println("You need add all computer components");
// }
for (Component.Type type : Component.Type.values()) {
if(!hasComponent(type)) {
System.out.println("You need add " + type + " to your Computer");
}
}
}
private void sort() {
components.sort(Comparator.
comparing(Component::getManufacture).
thenComparing(Component::getPrice));
}
public void show() {
this.sort();
for (Component component: components) {
System.out.println(component.toString());
}
this.checkAllComponent();
System.out.println("\nComputer price = " + price);
}
}
| [
"gerogo333@gmail.com"
] | gerogo333@gmail.com |
14c0e2d42e92c73e53957e7057abc8d1a151528c | 774cdaf78f787262d919d677306e08ddb93bfc1b | /src/abstractClasses/Controller.java | ea48df82f12b6a70452b3c73856cc3a9258c1964 | [] | no_license | LogKan/Viserion | 5fa8fb7c4921fe2a6384a74313289f103d6e6c1a | e7672a0a551f7010d94d23d6fac61d8e562245d3 | refs/heads/master | 2021-07-06T00:01:20.007455 | 2017-10-01T08:38:58 | 2017-10-01T08:38:58 | 105,429,946 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 433 | java | package abstractClasses;
/**
* Copyright 2015, FHNW, Prof. Dr. Brad Richards. All rights reserved. This code
* is licensed under the terms of the BSD 3-clause license (see the file
* license.txt).
*
* @author Brad Richards
*/
public class Controller<Model, View> {
protected Model model;
protected View view;
protected Controller(Model model, View view){
this.model = model;
this.view = view;
}
}
| [
"Kaneda@DESKTOP-5DCQOU6.localdomain"
] | Kaneda@DESKTOP-5DCQOU6.localdomain |
d0bfc3e7e943e60c5f1a58514b3e3c5648fb2c62 | 5f1386d82bc45c510cbcdc5624a28a5118ce7555 | /Spring_Practice/Spring1_Basic/src/bean/MessageBeanKo.java | b0f28af76d2bf5a306b66036f34cc971154c4833 | [] | no_license | dalzzing2/Study | aaaca99fcbee4a263f1c7c6ff29500719d2f94d2 | 9cfbaf39d2583948a23f61286bf22628eae33071 | refs/heads/master | 2020-03-25T06:31:39.655911 | 2018-08-04T07:51:44 | 2018-08-04T07:51:44 | 143,507,533 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 175 | java | package bean;
// MessageBean 인터페이스 구현
public class MessageBeanKo implements MessageBean{
public void sayHello(){
System.out.println("안녕하세요");
}
}
| [
"dalzzing2@naver.com"
] | dalzzing2@naver.com |
a2ad88c8414405b6f3dc94e714cfca124972846b | 156b38df031a1757aa72dd83cb792f86d13dc9d6 | /Tick 2/uk/ac/cam/ap886/oopjava/tick2/TestArrayWorld.java | c35c724db8bfae977604c3edccfe847173c5cfee | [] | no_license | appetrosyan/year1-oop-ticks | 6e30d50035c49833866327ead1cea7282aa80324 | f44bd284d8dbb3005503d84c4121cdaaefd54d53 | refs/heads/master | 2021-01-23T18:44:17.066404 | 2016-01-22T18:30:20 | 2016-01-22T18:30:20 | 47,578,878 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,537 | java | package uk.ac.cam.ap886.oopjava.tick2;
import uk.ac.cam.acr31.life.World;
import java.io.Writer;
import java.awt.Graphics;
import java.io.PrintWriter;
public class TestArrayWorld implements World {
private int generation;
private int width;
private int height;
private boolean[][] cells;
public TestArrayWorld(int w, int h) {
width = w;
height = h;
generation = 0;
cells = new boolean [width][height];
for (int i=0; i<w;i++){
for (int j=0;j<h;j++){
cells [i][j] = false;
}
}
//DONE
}
protected TestArrayWorld(TestArrayWorld prev) {
width = prev.width;
height = prev.height;
generation++;
cells = new boolean [width][height];
//Done
}
public boolean getCell(int col, int row) {
return cells[col][row];
}
public void setCell(int col, int row, boolean alive) {
cells[col][row] = alive;
}
public int getWidth() {
return width;
}
public int getHeight() {
return height;
}
public int getGeneration() {
return generation;
}
public int getPopulation() {
return 0;
}
public void print(Writer w) {
PrintWriter pw = new PrintWriter (w);
pw.println("-");
for (int i=0; i<this.getWidth();i++){
for (int j=0; j<this.getHeight();j++){
pw.print(this.getCell(i, j)? "#":"_");
}
pw.println();
}
pw.flush();
}
public void draw(Graphics g, int width, int height) { /*Leave empty*/ }
private TestArrayWorld nextGeneration() {
//Construct a new TestArrayWorld object to hold the next generation:
TestArrayWorld future = new TestArrayWorld(this);
// Use Loops to update the NEW world cell by cell
for (int i=0; i<width;i++){
for (int j=0; j<height; j++){
future.setCell(i,j,this.computeCell(i, j));
}
}
return future;
}
public World nextGeneration(int log2StepSize) {
TestArrayWorld world = this;
int n=1<<log2StepSize;
for(int i=0;i<n;i++){
world = world.nextGeneration();
}
return world;
}
private boolean computeCell(int col,int row) {
boolean liveCell = this.getCell(col, row);
int neighbours = countNeighbours(this ,col, row);
boolean nextCell = false;
if (neighbours < 2) {
nextCell = false;
}
if(neighbours > 1 && neighbours < 4 && liveCell){
nextCell = true;
}
if(neighbours > 3 && liveCell) {
nextCell = false;
}
if(neighbours== 3 && !liveCell) {
nextCell = true;
}
return nextCell;
}
private static int countNeighbours(World world, int col, int row){
int i=0;
try{i+=world.getCell(col+1,row) ?1:0;}
catch (ArrayIndexOutOfBoundsException e){}
try{i+=world.getCell(col+1,row+1) ?1:0;}
catch (ArrayIndexOutOfBoundsException e){}
try{i+=world.getCell(col,row+1) ?1:0;}
catch (ArrayIndexOutOfBoundsException e){}
try{i+=world.getCell(col+1,row-1) ?1:0;}
catch (ArrayIndexOutOfBoundsException e){}
try{i+=world.getCell(col,row-1) ?1:0;}
catch (ArrayIndexOutOfBoundsException e){}
try{i+=world.getCell(col-1,row) ?1:0;}
catch (ArrayIndexOutOfBoundsException e){}
try{i+=world.getCell(col-1,row-1) ?1:0;}
catch (ArrayIndexOutOfBoundsException e){}
try{i+=world.getCell(col-1,row+1) ?1:0;}
catch (ArrayIndexOutOfBoundsException e){}
return i;
}
}
| [
"ap886@pcquns03.quns.pwf.cam.ac.uk"
] | ap886@pcquns03.quns.pwf.cam.ac.uk |
a918db3b005ece7f1d2e9e5de32d16564602253f | 325655ca787699e09e2a2526ade6d7f141bbe8dc | /src/org/pdfclown/objects/PdfObjectWrapper.java | 15930df0e0ec5fea90dd631b8d01c97b9c6a2575 | [] | no_license | siouxsoft/pdfclown-mod | 1ba788a612ab95c2985bd04159c9d09c9c00810c | 7d0a6a9287c63c1de1f342fad6a1f97aaacc4cfa | refs/heads/master | 2021-01-17T08:56:32.577930 | 2012-12-18T06:46:51 | 2012-12-18T06:46:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,133 | java | /*
Copyright 2006-2012 Stefano Chizzolini. http://www.pdfclown.org
Contributors:
* Stefano Chizzolini (original code developer, http://www.stefanochizzolini.it)
This file should be part of the source code distribution of "PDF Clown library"
(the Program): see the accompanying README files for more info.
This Program is free software; you can redistribute it and/or modify it under the terms
of the GNU Lesser General Public License as published by the Free Software Foundation;
either version 3 of the License, or (at your option) any later version.
This Program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY,
either expressed or implied; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the License for more details.
You should have received a copy of the GNU Lesser General Public License along with this
Program (see README files); if not, go to the GNU website (http://www.gnu.org/licenses/).
Redistribution and use, with or without modification, are permitted provided that such
redistributions retain the above copyright notice, license and disclaimer, along with
this list of conditions.
*/
package org.pdfclown.objects;
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Member;
import java.util.Collection;
import org.pdfclown.PDF;
import org.pdfclown.Version;
import org.pdfclown.VersionEnum;
import org.pdfclown.documents.Document;
import org.pdfclown.documents.Document.Configuration.CompatibilityModeEnum;
import org.pdfclown.documents.interchange.metadata.Metadata;
import org.pdfclown.files.File;
import org.pdfclown.util.NotImplementedException;
/**
High-level representation of a PDF object.
<p>Specialized objects don't inherit directly from their low-level counterparts
(e.g. {@link org.pdfclown.documents.contents.Contents Contents} extends
{@link org.pdfclown.objects.PdfStream PdfStream}, {@link org.pdfclown.documents.Pages Pages}
extends {@link org.pdfclown.objects.PdfArray PdfArray} and so on) because there's no plain one-to
one mapping between primitive PDF types and specialized instances: the <code>Content</code> entry
of <code>Page</code> dictionaries may be a simple reference to a <code>PdfStream</code> or a
<code>PdfArray</code> of references to <code>PdfStream</code>s, <code>Pages</code> collections
may be spread across a B-tree instead of a flat <code>PdfArray</code> and so on.</p>
<p>So, <i>in order to hide all these annoying inner workings, I chose to adopt a composition
pattern instead of the apparently-reasonable (but actually awkward!) inheritance pattern</i>.
Nonetheless, users can navigate through the low-level structure getting the
{@link #getBaseDataObject() baseDataObject} backing this object.</p>
@author Stefano Chizzolini (http://www.stefanochizzolini.it)
@version 0.1.2, 11/30/12
*/
public abstract class PdfObjectWrapper<TDataObject extends PdfDataObject>
implements IPdfObjectWrapper
{
// <class>
// <static>
// <interface>
// <public>
/**
Gets the PDF object backing the specified wrapper.
@param wrapper Object to extract the base from.
*/
public static PdfDirectObject getBaseObject(
PdfObjectWrapper<?> wrapper
)
{return (wrapper != null ? wrapper.getBaseObject() : null);}
// </public>
// </interface>
// </static>
// <dynamic>
// <fields>
private PdfDirectObject baseObject;
// </fields>
// <constructors>
/**
Instantiates an empty wrapper.
*/
protected PdfObjectWrapper(
)
{}
/**
Instantiates a wrapper from the specified base object.
@param baseObject PDF object backing this wrapper. MUST be a {@link PdfReference reference}
every time available.
*/
protected PdfObjectWrapper(
PdfDirectObject baseObject
)
{setBaseObject(baseObject);}
/**
Instantiates a wrapper registering the specified base data object into the specified document
context.
@param context Document context into which the specified data object has to be registered.
@param baseDataObject PDF data object backing this wrapper.
@see #PdfObjectWrapper(File, PdfDataObject)
*/
protected PdfObjectWrapper(
Document context,
TDataObject baseDataObject
)
{this(context.getFile(), baseDataObject);}
/**
Instantiates a wrapper registering the specified base data object into the specified file
context.
@param context File context into which the specified data object has to be registered.
@param baseDataObject PDF data object backing this wrapper.
@see #PdfObjectWrapper(Document, PdfDataObject)
*/
protected PdfObjectWrapper(
File context,
TDataObject baseDataObject
)
{this(context.register(baseDataObject));}
// </constructors>
// <interface>
// <public>
/**
Gets a clone of the object, registered inside the given document context.
@param context Which document the clone has to be registered in.
*/
public abstract Object clone(
Document context
);
/**
Removes the object from its document context.
<p>The object is no more usable after this method returns.</p>
@return Whether the object was actually decontextualized (only indirect objects can be
decontextualized).
*/
public boolean delete(
)
{
// Is the object indirect?
if(baseObject instanceof PdfReference) // Indirect object.
{
((PdfReference)baseObject).delete();
return true;
}
else // Direct object.
{return false;}
}
@Override
public boolean equals(
Object obj
)
{
return obj != null
&& obj.getClass().equals(getClass())
&& ((PdfObjectWrapper<?>)obj).baseObject.equals(baseObject);
}
/**
Gets whether the underlying data object is concrete.
*/
public boolean exists(
)
{return !getBaseDataObject().isVirtual();}
/**
Gets the underlying data object.
*/
@SuppressWarnings("unchecked")
public TDataObject getBaseDataObject(
)
{return (TDataObject)File.resolve(baseObject);}
/**
Gets the indirect object containing the base object.
*/
public PdfIndirectObject getContainer(
)
{return baseObject.getContainer();}
/**
Gets the indirect object containing the base data object.
*/
public PdfIndirectObject getDataContainer(
)
{return baseObject.getDataContainer();}
/**
Gets the document context.
*/
public Document getDocument(
)
{
File file = getFile();
return file != null ? file.getDocument() : null;
}
/**
Gets the file context.
*/
public File getFile(
)
{return baseObject.getFile();}
/**
Gets the metadata associated to this object.
@return <code>null</code>, if base data object's type isn't suitable (only {@link PdfDictionary}
and {@link PdfStream} objects are allowed).
*/
public Metadata getMetadata(
)
{
PdfDictionary dictionary = getDictionary();
if(dictionary == null)
return null;
return new Metadata(dictionary.get(PdfName.Metadata, PdfStream.class, false));
}
/**
@see #getMetadata()
@throws UnsupportedOperationException If base data object's type isn't suitable (only
{@link PdfDictionary} and {@link PdfStream} objects are allowed).
*/
public void setMetadata(
Metadata value
)
{
PdfDictionary dictionary = getDictionary();
if(dictionary == null)
throw new UnsupportedOperationException("Metadata can be attached only to PdfDictionary/PdfStream base data objects.");
dictionary.put(PdfName.Metadata, PdfObjectWrapper.getBaseObject(value));
}
// <IPdfObjectWrapper>
@Override
public PdfDirectObject getBaseObject(
)
{return baseObject;}
// </IPdfObjectWrapper>
// </public>
// <protected>
/**
Checks whether the specified feature is compatible with the {@link Document#getVersion() document's conformance version}.
@param feature Entity whose compatibility has to be checked. Supported types:
<ul>
<li>{@link VersionEnum}</li>
<li>{@link String Property name} resolvable to an {@link AnnotatedElement annotated getter method}</li>
<li>{@link AnnotatedElement}</li>
</ul>
@throws RuntimeException In case of version conflict (see {@link org.pdfclown.documents.Document.Configuration.CompatibilityModeEnum#Strict Strict compatibility mode}).
@since 0.1.0
*/
protected void checkCompatibility(
Object feature
)
{
/*
TODO: Caching!
*/
CompatibilityModeEnum compatibilityMode = getDocument().getConfiguration().getCompatibilityMode();
if(compatibilityMode == CompatibilityModeEnum.Passthrough) // No check required.
return;
if(feature instanceof Collection<?>)
{
for(Object featureItem : (Collection<?>)feature)
{checkCompatibility(featureItem);}
return;
}
Version featureVersion;
if(feature instanceof VersionEnum) // Explicit version.
{featureVersion = ((VersionEnum)feature).getVersion();}
else // Implicit version (element annotation).
{
PDF annotation;
{
if(feature instanceof String) // Property name.
{
BeanInfo classInfo;
try
{classInfo = Introspector.getBeanInfo(getClass());}
catch(IntrospectionException e)
{throw new RuntimeException(e);}
for(PropertyDescriptor property : classInfo.getPropertyDescriptors())
{
if(feature.equals(property.getName()))
{
feature = property.getReadMethod();
break;
}
}
}
else if(feature instanceof Enum<?>) // Enum constant.
{
try
{feature = feature.getClass().getField(((Enum<?>)feature).name());}
catch(NoSuchFieldException e)
{throw new RuntimeException(e);}
}
if(!(feature instanceof AnnotatedElement))
throw new IllegalArgumentException("Feature type '" + feature.getClass().getName() + "' not supported.");
while(true)
{
annotation = ((AnnotatedElement)feature).getAnnotation(PDF.class);
if(annotation != null)
break;
if(feature instanceof Member)
{feature = ((Member)feature).getDeclaringClass();}
else if(feature instanceof Class<?>)
{
Class<?> containerClass = ((Class<?>)feature).getDeclaringClass();
feature = (containerClass != null ? containerClass : ((Class<?>)feature).getPackage());
}
else // Element hierarchy walk complete.
return; // NOTE: As no annotation is available, we assume the feature has no specific compatibility requirements.
}
}
featureVersion = annotation.value().getVersion();
}
// Is the feature version compatible?
if(getDocument().getVersion().compareTo(featureVersion) >= 0)
return;
// The feature version is NOT compatible: how to solve the conflict?
switch(compatibilityMode)
{
case Loose: // Accepts the feature version.
// Synchronize the document version!
getDocument().setVersion(featureVersion);
break;
case Strict: // Refuses the feature version.
// Throw a violation to the document version!
throw new RuntimeException("Incompatible feature (version " + featureVersion + " was required against document version " + getDocument().getVersion());
default:
throw new NotImplementedException("Unhandled compatibility mode: " + compatibilityMode.name());
}
}
/**
Retrieves the name possibly associated to this object, walking through the document's name
dictionary.
*/
@SuppressWarnings("unchecked")
protected PdfString retrieveName(
)
{return retrieveNameHelper(getDocument().getNames().get(getClass()));}
/**
Retrieves the object name, if available; otherwise, behaves like
{@link PdfObjectWrapper#getBaseObject() getBaseObject()}.
*/
protected PdfDirectObject retrieveNamedBaseObject(
)
{
PdfString name = retrieveName();
return name != null ? name : getBaseObject();
}
protected void setBaseObject(
PdfDirectObject value
)
{baseObject = value;}
// </protected>
// <private>
private PdfDictionary getDictionary(
)
{
TDataObject baseDataObject = getBaseDataObject();
if(baseDataObject instanceof PdfDictionary)
return (PdfDictionary)baseDataObject;
else if(baseDataObject instanceof PdfStream)
return ((PdfStream)baseDataObject).getHeader();
else
return null;
}
/*
NOTE: Generics capture helper method.
*/
@SuppressWarnings("unchecked")
private <T extends PdfObjectWrapper<TDataObject>> PdfString retrieveNameHelper(
NameTree<T> names
)
{return names != null ? names.getKey((T)this) : null;}
// </private>
// </interface>
// </dynamic>
// </class>
} | [
"owq@gmx.com"
] | owq@gmx.com |
d290e0a74469e30e31b679fd4b30dee63ae2f29b | dba358b2699e083f4549cd90f32097954ad749a5 | /peopleList/src/main/java/com/springmvc/controller/FamilyController.java | ac471c18b0b8b78a87cee7d5f3fceaaaaeed2b88 | [] | no_license | andreww67/PeopleList | 0e5bbe9dab166ed36bff5c4cdd139a0b8fa5eea9 | a52ec364658083cd51745bd3bfa912aaf1744d9c | refs/heads/master | 2016-08-12T05:11:13.999082 | 2015-10-08T03:49:34 | 2015-10-08T03:49:34 | 43,848,250 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,223 | java | package com.springmvc.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.springmvc.model.Family;
import com.springmvc.model.FamilyPersonMap;
import com.springmvc.model.Person;
import com.springmvc.repository.FamilyPersonMapRepository;
import com.springmvc.repository.FamilyRepository;
import com.springmvc.repository.PersonRepository;
@RestController
@RequestMapping("/families")
public class FamilyController {
@Autowired
private FamilyRepository familyRepo;
@Autowired
private FamilyPersonMapRepository familyPersonRepo;
@Autowired
private PersonRepository personRepo;
@RequestMapping(method = RequestMethod.GET)
public List<Family> findFamily() {
return familyRepo.findAll();
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public Family getFamily(@PathVariable Integer id) {
return familyRepo.findOne(id);
}
@RequestMapping(method = RequestMethod.POST)
public Family addFamily(@RequestBody Family family) {
family.setId(null);
return familyRepo.saveAndFlush(family);
}
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
public Family updateFamily(@RequestBody Family updatedFamily, @PathVariable Integer id) {
updatedFamily.setId(id);
return familyRepo.saveAndFlush(updatedFamily);
}
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public void deleteFamily(@PathVariable Integer id) {
familyPersonRepo.delete(familyPersonRepo.findFPMByFamilyId(id));
familyRepo.delete(id);
}
@RequestMapping(value = "/{id}/addPerson/{personId}", method = RequestMethod.POST)
public FamilyPersonMap addPerson(@PathVariable Integer id, @PathVariable Integer personId){
FamilyPersonMap fpm = new FamilyPersonMap();
fpm.setId(null);
fpm.setFamily(familyRepo.findOne(id));
fpm.setPerson(personRepo.findOne(personId));
return familyPersonRepo.saveAndFlush(fpm);
}
@RequestMapping(value = "/{id}/getPeople", method = RequestMethod.GET)
public List<Person> findPeopleByFamilyId(@PathVariable Integer id){
return familyPersonRepo.findPeopleByFamilyId(id);
}
}
| [
"andreww67@yahoo.com"
] | andreww67@yahoo.com |
985215425866e77debe7a679fb8f33c156108560 | 442d88eb0a59bf196c01d543f5c424294ba3477a | /src/main/java/com/newcode/meeting/controller/UserLikeController.java | 51287292e41def8d5e94b1c8fd785b1a75351dad | [] | no_license | GuravskiyAlexandr/meeting | 6e9c10425cf6d4e57af8d3196b1457883646ed65 | 230be47d5b208fc04a7fe6e214316949cee6996a | refs/heads/master | 2023-01-10T04:02:26.449837 | 2021-04-08T00:02:05 | 2021-04-08T00:02:05 | 214,284,076 | 0 | 0 | null | 2023-01-05T16:20:43 | 2019-10-10T20:56:12 | Vue | UTF-8 | Java | false | false | 1,964 | java | package com.newcode.meeting.controller;
import com.fasterxml.jackson.annotation.JsonView;
import com.newcode.meeting.domain.User;
import com.newcode.meeting.domain.Views;
import com.newcode.meeting.pojo.UserPojo;
import com.newcode.meeting.domain.dto.UserPageDto;
import com.newcode.meeting.service.UserLikeService;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("userLike")
public class UserLikeController {
public static final int USER_PAGE = 1;
private final UserLikeService likeService;
public UserLikeController(UserLikeService likeService) {
this.likeService = likeService;
}
@JsonView(Views.FullProfileDetail.class)
@GetMapping("myLikes")
public UserPageDto getLikeMeUsersList(
@AuthenticationPrincipal User user,
@PageableDefault
(size = USER_PAGE, sort = {"timeLike"}, direction = Sort.Direction.DESC)
Pageable pageable
){
return likeService.getUsersMyLike(user, pageable);
}
@PutMapping("like/{id}")
public boolean like(
@PathVariable("id") User ownerLike,
@RequestBody UserPojo newUserPojo,
@AuthenticationPrincipal User userFromDb
) {
return likeService.setUserLike(ownerLike, newUserPojo, userFromDb);
}
@JsonView(Views.FullProfileDetail.class)
@GetMapping("coincidence")
public UserPageDto getCoincidenceList(
@AuthenticationPrincipal User user,
@PageableDefault
(size = USER_PAGE, sort = {"timeLike"}, direction = Sort.Direction.DESC)
Pageable pageable
){
return likeService.getUsersCoincidence(user, pageable);
}
}
| [
"guravskiy79@gmail.com"
] | guravskiy79@gmail.com |
09f1b0bba4628b7dcdc6e862626c5713912fc54a | 6cd4e69ad8e77c07d8760a71e39c8ce4222e9a03 | /sentence/src/main/java/com/akul/microservices/sentence/dao/ArticleClient.java | 31b1c448ed8edeff6f31da2f559f06a0212cad2b | [] | no_license | akulgoyal/Microservices-demo | 7e26cb89c7612537e2536b9152602d3e899c7d21 | 5537c1ef25a2d876dc8a033dac65a0f5a59a5384 | refs/heads/master | 2021-01-01T19:04:52.977618 | 2017-08-31T11:18:36 | 2017-08-31T11:18:36 | 98,502,836 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 432 | java | package com.akul.microservices.sentence.dao;
import com.akul.microservices.sentence.domain.Word;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@FeignClient("ARTICLE")
public interface ArticleClient {
@RequestMapping(method = RequestMethod.GET, value = "/")
public Word getWord();
}
| [
"akul@theinnovationinc.co"
] | akul@theinnovationinc.co |
1378f75927afe9217641f2e1886f20ced78dd165 | a0caa255f3dbe524437715adaee2094ac8eff9df | /src/main/java/p000/C0623x.java | 63c26d1d846e19ed9ca65374c27dec37d1442b42 | [] | no_license | AndroidTVDeveloper/com.google.android.tvlauncher | 16526208b5b48fd48931b09ed702fe606fe7d694 | 0f959c41bbb5a93e981145f371afdec2b3e207bc | refs/heads/master | 2021-01-26T07:47:23.091351 | 2020-02-26T20:58:19 | 2020-02-26T20:58:19 | 243,363,961 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 220 | java | package p000;
/* renamed from: x */
/* compiled from: PG */
public final class C0623x {
/* renamed from: a */
public final C0650y f10755a;
public C0623x(C0650y yVar) {
this.f10755a = yVar;
}
}
| [
"eliminater74@gmail.com"
] | eliminater74@gmail.com |
2f75907cb116f0693d5b4eaaf2f44fb7fa9354d5 | 029faba43665aa3435d65285f97db8220b0322ac | /src/main/java/base/core.java | 3be4ffb537cb5133bc987b2f013482c978349855 | [
"Apache-2.0"
] | permissive | nya-official/nya-server | 3c0f2ad279855d4ba4b33cef4347991b8bb1111e | 58593e6f7c43e4b75689da714a111883365de91a | refs/heads/main | 2023-06-05T07:21:21.566594 | 2021-06-27T19:09:15 | 2021-06-27T19:09:15 | 379,559,604 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,143 | java | /*
* Description: Core functions and variables
* License: Apache-2.0
* Copyright: x-file.xyz
*/
package base;
import genesis.Genesis;
import static base.Log.log;
import channel.ChannelManager;
import database.ConnectIPFS;
import coins.CoinManager;
import console.Commands;
import console.ConsoleWeb;
import user.Users;
import java.io.File;
/**
* Date: 2021-06-14
* Place: Zwingenberg, Germany
* @author brito
*/
public class core {
// definitions
public static String
dbFolderUsers = "users",
dbFolderChannels = "chans",
dbNameUsers = "users.db",
dbUserJSON = "user.json",
dbUsersJSON = "users.json",
dbChannelsJSON = "chans.json",
dbUserKey = "c",
dbUserPassword = "p",
dateFormat = "yyyy-MM-dd'_'HH:mm:ss";
public static final File
folderRoot = new File("."),
folderDB = new File(folderRoot, "db"),
folderTest = new File(folderRoot, "test"),
fileGenesis = new File("genesis.json");
// global variables
public static Config config;
public static Genesis genesis;
public static CoinManager coinManager = new CoinManager();
public static ChannelManager channelManager;
public static Users users;
public static ConnectIPFS ipfs;
public static Commands commands = new Commands();
public static String
version = "1.0.0";
public static int
lenghtMaxChannelName = 100, // max siz in name length for channels
maxMessagesPerDefault = 10_000;
static void start() {
// print the logo
System.out.println(Logo.get()
+ " "
+ version
+ "\n"
);
// start the config
startConfig();
// initiate the coins
coinManager.start();
//String result = ipfs.putContentAsText("Hello World 123!");
// String result = ipfs.getContentAsString("QmNacaCtPPduuiRvTdrEtxrBqHxcPBsN3r28Ng3S2a9Wuk");
// log("Result: " + result);
// start the command line
startCommandLine();
}
/**
* Close all the databases and related services
*/
public static void close() {
// close the user database
//dbUsers.close();
}
private static void startConfig() {
// read the genesis from disk or use default values
if(utils.files.isValidFile(fileGenesis)){
genesis = Genesis.jsonImportFile(fileGenesis);
}
// in case it did not work, just create a new one
if(genesis == null){
genesis = new Genesis();
// save it to disk like this
String output = genesis.jsonExport();
utils.files.SaveStringToFile(fileGenesis, output);
}
// connect to the IPFS services
log("Connecting to InterPlanetary File System..");
ipfs = new ConnectIPFS();
ipfs.start();
if(ipfs.canBeUsed()){
log("IPFS is connected");
}else{
log("Error: IPFS is NOT connected");
log("Please check your network connection or firewalls");
return;
}
// check if the genesis has a valid config id
String id = genesis.getGenesis();
String text = core.ipfs.getContentAsString(id);
if(text == null){
log("ERROR core-111: No valid genesis block found");
log("Creating a new genesis");
config = new Config();
}else{
// load up the config
config = Config.jsonImport(text);
}
if(config == null){
log("ERROR core-127: Genesis config is invalid, using a default one");
config = new Config();
}
// start up
config.setup();
// save this on IPFS
config.saveToIPFS();
}
/**
* Provides the command line for interacting with nya
*/
private static void startCommandLine() {
ConsoleWeb.main(null);
}
}
| [
"brito@triplecheck.tech"
] | brito@triplecheck.tech |
252e1dab58d9da1207983eee769ff0260eea0250 | 1aa274a1d3796d1be34852cf6b8b610a5ea75305 | /complit.sns/java/complit/sns/alogin.java | 0e95d6a8cb87e70b81deadfbf1ba492fe93d5e10 | [] | no_license | bhskr44/SNS | 14fa6effadfba0a2d210317694d706aa930596b5 | cd3a3ffb024ac5d945dd8d42b6aeb00e6752d4ae | refs/heads/master | 2021-07-24T06:21:21.768543 | 2017-11-06T17:07:45 | 2017-11-06T17:07:45 | 109,725,505 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,042 | java | package complit.sns;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
public class alogin extends AppCompatActivity {
Button b1;
Button b2;
int counter = 3;
EditText ed1;
EditText ed2;
TextView tx1;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_alogin);
this.b1 = (Button) findViewById(R.id.b1);
this.ed1 = (EditText) findViewById(R.id.ausern);
this.ed2 = (EditText) findViewById(R.id.apassword);
this.b2 = (Button) findViewById(R.id.b2);
this.tx1 = (TextView) findViewById(R.id.attempts);
this.tx1.setVisibility(8);
this.b1.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
if (alogin.this.ed1.getText().toString().equals(BuildConfig.FLAVOR) && alogin.this.ed2.getText().toString().equals(BuildConfig.FLAVOR)) {
Toast.makeText(alogin.this.getApplicationContext(), "Redirecting...", 0).show();
alogin.this.startActivity(new Intent(alogin.this.getApplicationContext(), aafterlogin.class));
return;
}
Toast.makeText(alogin.this.getApplicationContext(), "Wrong Credentials", 0).show();
alogin.this.tx1.setVisibility(0);
alogin.this.tx1.setBackgroundColor(-65536);
alogin complit_sns_alogin = alogin.this;
complit_sns_alogin.counter--;
alogin.this.tx1.setText(Integer.toString(alogin.this.counter));
if (alogin.this.counter == 0) {
alogin.this.b1.setEnabled(false);
}
}
});
this.b2.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
alogin.this.finish();
}
});
}
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_logout) {
finish();
return true;
} else if (id != R.id.action_share) {
return super.onOptionsItemSelected(item);
} else {
shareText();
return true;
}
}
public void shareText() {
Intent share = new Intent("android.intent.action.SEND");
share.setType("text/plain");
share.addFlags(524288);
share.putExtra("android.intent.extra.SUBJECT", "Student Notifying System of AEI");
share.putExtra("android.intent.extra.TEXT", "Hi,Share our app if have liked our app, Please do share http://www.bhaskar.esy.es/download/sns.apk");
startActivity(Intent.createChooser(share, "SNS of AEI"));
}
}
| [
"bhaskarranjan44@gmail.com"
] | bhaskarranjan44@gmail.com |
feb0e2b582f5a846535cbf366d432b61733235a8 | e52f5237d3effe7541b6688e9b092ea890f3b175 | /FixacaoVetor/src/entities/Rent.java | a275a482796084e3c08ed5f4fff143b92b71790a | [] | no_license | Jeanlucascastro/Java | df2c4351fef57247ee277683cc3424cb366cc1d1 | e2347134cdf8922bcddc101455593e73ecf83458 | refs/heads/master | 2022-12-06T05:43:34.004501 | 2020-09-04T00:23:41 | 2020-09-04T00:23:41 | 283,545,751 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 432 | java | package entities;
public class Rent {
private String nome;
private String email;
public Rent(String nome, String email) {
this.nome = nome;
this.email = email;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
0af29d02f937812fc1ae1f14e7fe5e25eca830c8 | 2d9b75851b7a949476ebbd5def963ff0e1b781f7 | /src/Testing/FloorSwitchTest.java | 43c8c2f9cff7b4ce205973722e36c83cce82cad1 | [] | no_license | sepetab/DungeonGame | 8d671f568b6b6f7dd348e9782250eda86d61d616 | f1dd6e5a2c90145ae9cbde2dc1dbd6750cc36ad5 | refs/heads/master | 2023-01-24T04:53:49.957220 | 2020-12-11T04:49:34 | 2020-12-11T04:49:34 | 320,468,491 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,661 | java | package Testing;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.jupiter.api.Test;
import unsw.dungeon.*;
import unsw.entites.*;
class FloorSwitchTest {
@Test
void testFloorSwitchTransparent() {
Dungeon dungeon = new Dungeon(10,10);
Player player = new Player(dungeon, 5, 5);
dungeon.addEntity(player);
dungeon.setPlayer(player);
Floorswitch floorswitch = new Floorswitch(6, 5);
dungeon.addEntity(floorswitch);
//player is next to boulder
player.moveRight();
//show player is allowed on top of floorswitch
//get player's x coordinate
assertTrue(player.getX() == 6 && player.getY() == 5);
}
@Test
void testTriggeruntruiggerSwitch() {
Dungeon dungeon = new Dungeon(10,10);
Player player = new Player(dungeon, 5, 5);
dungeon.addEntity(player);
dungeon.setPlayer(player);
Boulder boulder = new Boulder(6, 5, dungeon);
dungeon.addEntity(boulder);
Floorswitch floorswitch = new Floorswitch(7,5);
dungeon.addEntity(floorswitch);
//player is next to boulder
player.moveRight();
//get player's x coordinate
assertTrue(player.getX() == 6 && player.getY() == 5);
//get player's y coordinate
//boulder should be on top of floorswitch
//get boulder's x coordinate
assertTrue(boulder.getX() == 7 && boulder.getY() == 5);
assertTrue(floorswitch.triggered(dungeon) == true);
player.moveUp();
player.moveRight();
//System.out.println(player.getX() + " " + player.getY() + " " + boulder.getX() + " " + boulder.getY());
player.moveDown();
assertFalse(floorswitch.triggered(dungeon));
}
}
| [
"z5208102@ad.unsw.edu.au"
] | z5208102@ad.unsw.edu.au |
c1745ed62164d1dc3a6f8ac2561aa95983480486 | 96483be6d26126206523b6cea0bef9fc5e4ff0fb | /bms-api/src/main/java/com/jiuyescm/bms/pub/transport/service/IPubTransportOriginCityService.java | 04069ba5ecb6e4f027e508d7a58757b6ed094dfe | [] | no_license | wnagcehn/bms | 68d27cbc3e0a766d384b1627af043ca883e8bf4a | 787a095ba3c8aecca3ef4fb312355be4692dd192 | refs/heads/feature-1.4.14-wc | 2022-12-05T04:01:31.439454 | 2019-08-09T08:18:42 | 2019-08-09T08:18:42 | 201,433,238 | 3 | 9 | null | 2022-11-21T22:36:27 | 2019-08-09T09:10:46 | Java | UTF-8 | Java | false | false | 863 | java | /**
* Copyright (c) 2016, Jiuye SCM and/or its affiliates. All rights reserved.
*
*/
package com.jiuyescm.bms.pub.transport.service;
import java.util.List;
import java.util.Map;
import com.github.pagehelper.PageInfo;
import com.jiuyescm.bms.pub.transport.entity.PubTransportOriginCityEntity;
/**
* 运输始发城市信息service接口
* @author yangss
*
*/
public interface IPubTransportOriginCityService {
PageInfo<PubTransportOriginCityEntity> query(Map<String, Object> condition, int pageNo,
int pageSize);
List<PubTransportOriginCityEntity> queryList(Map<String, Object> condition);
PubTransportOriginCityEntity findById(Long id);
PubTransportOriginCityEntity save(PubTransportOriginCityEntity entity);
PubTransportOriginCityEntity update(PubTransportOriginCityEntity entity);
void delete(Long id);
}
| [
"caojianwei@jiuyescm.com"
] | caojianwei@jiuyescm.com |
eeffebf8b2408a0d35a53cdf563d2c0644454070 | 4ebc9c549a4f60c1e903924835984fdbd5d61b5f | /src/kodejava-master/core-sample/src/main/java/org/kodejava/example/fundamental/ClassExample.java | c34e0412a79491697031a4887f9711590974af71 | [] | no_license | rnoxiv/DeepSpace42 | e97476273bc48c6bdf5edc4c81fcc2f583cf25ac | 42656edb988e610b8800ae9908d1f6e059eaf2f3 | refs/heads/master | 2021-01-10T05:16:53.039132 | 2015-12-20T13:44:25 | 2015-12-20T13:44:25 | 43,808,785 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 585 | java | package org.kodejava.example.fundamental;
public class ClassExample {
public static void main(String[] args) {
Person person = new Person();
person.setName("Andy");
person.setTitle("MBA");
person.setAddress("NY City");
System.out.println(person);
String nameTitle1 = person.getNameWithTitle();
System.out.println("Name with title: " + nameTitle1);
Person person2 = new Person("Sarah");
String nameTitle2 = person2.getNameWithTitle();
System.out.println("Name with title 2: " + nameTitle2);
}
}
| [
"sabatier.david.93@gmail.com"
] | sabatier.david.93@gmail.com |
c0188200cff3892100efa3fe6827a38046c4ad12 | bd2939e4a852b372efe6fc8189f7a010ad30aeb3 | /zaoczne_spring/SpringApp/src/controllers/MainController.java | ca1997ea774578f1e7cf95f77f940b5e23044877 | [] | no_license | kpodlaski/JavaEE2017 | 203131af1d9359868cb9e76abff7c4c0d6f9f0cd | 5296d05dc577c2259757ff46f0a5eba7f9284f20 | refs/heads/master | 2021-09-04T17:21:39.083453 | 2018-01-20T09:05:40 | 2018-01-20T09:05:40 | 107,641,334 | 0 | 0 | null | null | null | null | WINDOWS-1250 | Java | false | false | 3,723 | java | package controllers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import model.Contact;
import model.ContactBook;
@Controller
public class MainController {
@Autowired
ContactBook book;
@RequestMapping("test.html")
public ModelAndView test(){
ModelAndView mv = new ModelAndView("contact");
mv.addObject("title","Kontakt Telefoniczny");
Contact c = new Contact("Ala","12121234");
mv.addObject("contact",c);
return mv;
}
@RequestMapping("show.php")
public ModelAndView showContact(String name,
String tel){
ModelAndView mv = new ModelAndView("contact");
Contact c = new Contact(name,tel);
mv.addObject("title","Tel "+c.getName());
mv.addObject("contact",c);
return mv;
}
@RequestMapping("show,{name},{tel}")
public ModelAndView showContact2(@PathVariable String name,
@PathVariable String tel){
ModelAndView mv = new ModelAndView("contact");
Contact c = new Contact(name,tel);
mv.addObject("title","Tel "+c.getName());
mv.addObject("contact",c);
return mv;
}
@RequestMapping(value="contact/new",method=RequestMethod.GET)
public ModelAndView newContact(){
ModelAndView mv = new ModelAndView("contact2");
mv.addObject("title","Nowy kontakt");
Contact c = new Contact("","");
mv.addObject("contact",c);
return mv;
}
@RequestMapping(value="contact/new",method=RequestMethod.POST)
public ModelAndView newContactPost(String name, String tel){
ModelAndView mv = new ModelAndView("contact2");
Contact c = new Contact(name,tel);
book.add(c);
mv.addObject("title","Stworzono nowy kontakt "+book.getContacts().size());
mv.addObject("contact",c);
return mv;
}
@RequestMapping(value="contact,{id}",method=RequestMethod.GET)
public ModelAndView newContact(@PathVariable int id){
ModelAndView mv = new ModelAndView("contact");
Contact c = book.getContacts().get(id);
mv.addObject("title","Kontakt "+id);
mv.addObject("contact",c);
return mv;
}
@RequestMapping(value="contact,{id}",method=RequestMethod.DELETE)
public ModelAndView deleteContact(@PathVariable int id){
ModelAndView mv = new ModelAndView("contact");
Contact c = book.getContacts().get(id);
mv.addObject("title","Skasowano Kontakt ");
mv.addObject("contact",c);
book.remove(c);
return mv;
}
@RequestMapping(value="contact,{id}",method=RequestMethod.PUT)
public ModelAndView putContact(@PathVariable int id, @RequestBody Contact newData){
ModelAndView mv = new ModelAndView("contact");
Contact c = book.getContacts().get(id);
c.setName(newData.getName());
c.setTel(newData.getTel());
mv.addObject("title","Zmodyfikowano Kontakt ");
mv.addObject("contact",c);
return mv;
}
@RequestMapping(value="contact",method=RequestMethod.GET)
public ModelAndView contactList(){
ModelAndView mv = new ModelAndView("contact_list");
mv.addObject("title","Lista Kontaktów");
mv.addObject("contacts",book.getContacts());
return mv;
}
@RequestMapping(value="contact",method=RequestMethod.POST)
public ModelAndView newContactPost(@RequestBody Contact c){
ModelAndView mv = new ModelAndView("contact2");
book.add(c);
mv.addObject("title","Stworzono nowy kontakt "+book.getContacts().size());
mv.addObject("contact",c);
return mv;
}
}
| [
"podlaski@uni.lodz.pl"
] | podlaski@uni.lodz.pl |
bd5c8e195b172641ee7e144e5e5b3c3df1209b5d | 869b72d3767ae095b8ba0c479f715d605479bc1a | /src/com/example/weather/tempd.java | 98146633cce8f837b69472659b2d4fb3386e02b9 | [] | no_license | darshanhs90/Android-WeatherApp | 2bdd0f671eab32eefabdac0346c268e58af3c692 | 02b6cbae8539d48f9b636bd35fd08840e3b90cca | refs/heads/master | 2020-05-19T07:46:57.474292 | 2015-04-05T03:05:34 | 2015-04-05T03:05:34 | 33,428,578 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,820 | java | package com.example.weather;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.location.Location;
import android.location.LocationManager;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import com.android.anup.weather.maps.R;
import com.example.weather.HomeFragment.Progress;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.GoogleMap.OnMapClickListener;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.CameraPosition;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
public class tempd extends Fragment {
// Google Map
private GoogleMap googleMap;
String mData,str;
Activity mActivity;
JSONParserTask mTask;
public tempd(Activity mActivity) {
this.mActivity = mActivity;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.activity_main, container,
false);
try {
// Loading map
initilizeMap();
// Changing map type
googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
// googleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
// googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
// googleMap.setMapType(GoogleMap.MAP_TYPE_TERRAIN);
// googleMap.setMapType(GoogleMap.MAP_TYPE_NONE);
// Showing / hiding your current location
googleMap.setMyLocationEnabled(true);
// Enable / Disable zooming controls
googleMap.getUiSettings().setZoomControlsEnabled(false);
// Enable / Disable my location button
googleMap.getUiSettings().setMyLocationButtonEnabled(true);
// Enable / Disable Compass icon
googleMap.getUiSettings().setCompassEnabled(true);
// Enable / Disable Rotate gesture
googleMap.getUiSettings().setRotateGesturesEnabled(true);
// Enable / Disable zooming functionality
googleMap.getUiSettings().setZoomGesturesEnabled(true);
// lets place some 10 random markers
} catch (Exception e) {
e.printStackTrace();
}
googleMap.setOnMapClickListener(new OnMapClickListener() {
@Override
public void onMapClick(LatLng value) {
// TODO Auto-generated method stub
Log.i("anup_check", "" + value.latitude + " "
+ value.longitude);
//Toast.makeText(mActivity.getApplicationContext(), "" + value.latitude + " "+ value.longitude, Toast.LENGTH_LONG).show();
str="http://forecast.weather.gov/MapClick.php?lat="+value.latitude+"&lon="+value.longitude+"&site=okx&unit=0&lg=en&FcstType=json";
mTask = new JSONParserTask();
mTask.execute(str);
}
});
return rootView;
}
void startthread()
{
Thread mThread = new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
/*LocationManager locationManager=(LocationManager) mActivity.getSystemService(Context.LOCATION_SERVICE);
Location location = locationManager.getLastKnownLocation
(LocationManager.GPS_PROVIDER);
if(location!=null){
Log.d("lat",location.getLatitude()+"");
Log.d("lat",location.getLongitude()+"");
String str="http://forecast.weather.gov/MapClick.php?lat="+location.getLatitude()+"&lon="+location.getLongitude()+"&site=okx&unit=0&lg=en&FcstType=json";
Log.d("asd",str);
System.out.println(str);
//Toast.makeText(getActivity(), str,Toast.LENGTH_LONG).show();
mTask.execute(str);
Log.d("qwe",mData+"");
}
else{
Toast.makeText(this, "Enable Location Services",Toast.LENGTH_LONG).show();
}*/
}
});
}
});
mThread.start();
}
/**
* function to load map If map is not created it will create it for you
* */
private void initilizeMap() {
if (googleMap == null) {
googleMap = ((MapFragment) getFragmentManager().findFragmentById(
R.id.map)).getMap();
// check if map is created successfully or not
if (googleMap == null) {
Toast.makeText(mActivity.getApplicationContext(),
"Sorry! unable to create maps", Toast.LENGTH_SHORT)
.show();
}
}
}
/*
* creating random postion around a location for testing purpose only
*/
private double[] createRandLocation(double latitude, double longitude) {
return new double[] { latitude + ((Math.random() - 0.5) / 500),
longitude + ((Math.random() - 0.5) / 500),
150 + ((Math.random() - 0.5) * 10) };
}
class JSONParserTask extends AsyncTask<String, Void, String> {
@Override
protected void onPreExecute() {
}
@Override
protected String doInBackground(String... params) {
String jsonString = null;
mData = null;
try {
URL obj = new URL(params[0]);
HttpURLConnection con = (HttpURLConnection) obj
.openConnection();
con.setRequestMethod("GET");
con.setReadTimeout(15 * 1000);
con.connect();
BufferedReader reader = new BufferedReader(
new InputStreamReader(con.getInputStream(), "utf-8"), 8);
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
Log.d("asd",line);
}
jsonString = sb.toString();
if (true) {
try {
mData = parseJsonNews(jsonString);
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
//mDaily.setText("Today's Weather @ "+mData.split("/")[1]+" is "+mData.split("/")[0]);
Toast.makeText(mActivity.getApplicationContext(), "Weather @ "+mData.split("/")[1]+" is "+mData.split("/")[0], Toast.LENGTH_LONG).show();
}
});
}
catch (Exception e) {
e.printStackTrace();
} finally {
System.out.println("asd");
}
}
else {
mData = null;
}
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
finally{
}
return mData;
}
@Override
protected void onPostExecute(final String data) {
if(data!=null)
{
//mDialog.dismiss();
try {
Log.d("asd","sc"+data);
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
//mScore.setText(data.split("/")[0]+"");
}
});
//
//new Progress().execute(today);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
else
{
//mDialog.dismiss();
Toast.makeText(mActivity, "Data not availiable", Toast.LENGTH_LONG).show();
}
}
}
public String parseJsonNews(String result) throws JSONException {
String mScore = new String();
JSONObject mResponseobject = new JSONObject(result);
mScore=(mResponseobject.getJSONObject("currentobservation").getString("Temp"));
String str=(mResponseobject.getJSONObject("currentobservation").getString("name"));
Log.d("asd",str);
//today=mScore;
return mScore+"/"+str;
}
}
| [
"hsdars@gmail.com"
] | hsdars@gmail.com |
591325f26f6225f79bef24be97f4c90b9df6db72 | ea81d5e467820066d60e07a909711624420133b0 | /src/main/java/dto/Credentials.java | 34337d1966707cc825440286c2c0b97293d301a1 | [
"Apache-2.0"
] | permissive | VladBrutal/POMSuperSchedule | 455ad36b48099d5f7b902d5cf902e05a0db16c2f | eff12da30abf106ce4409567395f74ac02dc5645 | refs/heads/master | 2023-05-27T20:34:32.346965 | 2021-06-17T20:59:37 | 2021-06-17T20:59:37 | 377,959,475 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 136 | java | package dto;
import lombok.*;
@Builder
@Setter
@Getter
@ToString
public class Credentials {
String email;
String password;
}
| [
"vladbrutal@gmail.com"
] | vladbrutal@gmail.com |
afd18983496537e25ceda6595aac54d46b3912ed | b7f11f8872ebc5d673f0c7512a1ae6a338316caa | /app/src/main/java/com/example/exameniacc/PrincipalActivity.java | 4ac77ce95b16f08ebd6e6af19d976e8b3d05f90b | [] | no_license | lonkonao/examenIacc | 342089d3227e8d01b1339549915a97d0c63704b1 | dac4ef00320b906f31991e3760f12c9de5c28906 | refs/heads/main | 2023-06-08T01:53:35.755171 | 2021-06-22T03:32:58 | 2021-06-22T03:32:58 | 379,130,727 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,438 | java | package com.example.exameniacc;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
public class PrincipalActivity extends AppCompatActivity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menuprincipal,menu);
return true;
}
public boolean onOptionsItemSelected(@NonNull MenuItem item){
switch (item.getItemId()){
case R.id.bt_vegan:
Intent afr_vegan = new Intent(this,fr_vegan.class);
startActivity(afr_vegan);
return true;
case R.id.bt_comida:
Intent afr_comida = new Intent(this,fr_comidaRapida.class);
startActivity(afr_comida);
return true;
case R.id.bt_bebestible:
Intent afr_bebestibles = new Intent(this,fr_bebestibles.class);
startActivity(afr_bebestibles);
return true;
default:
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_principal);
}
} | [
"giovanni.caceres.rubio@gmail.com"
] | giovanni.caceres.rubio@gmail.com |
89d16fca6f777bd402385154c5c6cf3d900b5316 | 5e38292af670960132795cc0323248acc3ed83eb | /rito-admin/src/main/java/com/stylefeng/guns/modular/system/dao/FileInfoMapper.java | ad50d05ea6c2d48e5855a78f715b460eb6196a62 | [
"Apache-2.0"
] | permissive | 527088995/dian | 2144590a61177c6be43afce4f3b9667bde74c69c | 5238b1c46290a3ab8281a2eb83590d27d8e020b1 | refs/heads/master | 2022-11-06T17:09:33.968961 | 2020-07-31T02:30:02 | 2020-07-31T02:30:02 | 193,050,897 | 20 | 7 | NOASSERTION | 2022-10-05T19:33:24 | 2019-06-21T07:19:51 | Java | UTF-8 | Java | false | false | 321 | java | package com.stylefeng.guns.modular.system.dao;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.stylefeng.guns.modular.system.model.FileInfo;
/**
* <p>
* 文件信息表
* Mapper 接口
* </p>
*
* @author ...
* @since 2018-12-07
*/
public interface FileInfoMapper extends BaseMapper<FileInfo> {
}
| [
"527088995@qq.com"
] | 527088995@qq.com |
fb96b3a9e3adf07aad8f72d54eb02acb15242c56 | 483d2f0df236e445651cc4e0bc137e1f6dca3454 | /src/com/github/nancarp/ch11/gumball/WinnerState.java | 86025d5db7dd84bdda0916be2b346c70d635794b | [] | no_license | NanCarp/head-first-design-pattern | c275bceeada7a399eed7d8e281aae17cfd13b1fc | c13e7d18246447eb4b6920d4e5f68f1b1b8f0429 | refs/heads/master | 2021-01-23T22:24:09.498514 | 2017-10-12T08:11:39 | 2017-10-12T08:11:39 | 102,932,619 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,407 | java | package com.github.nancarp.ch11.gumball;
public class WinnerState implements State {
GumballMachine gumballMachine;
public WinnerState(GumballMachine gumballMachine) {
this.gumballMachine = gumballMachine;
}
public void insertQuarter() {
System.out.println("Please wait, we're already giving you a Gumball");
}
public void ejectQuarter() {
System.out.println("Please wait, we're already giving you a Gumball");
}
public void turnCrank() {
System.out.println("Turning again doesn't get you another gumball!");
}
public void dispense() {
System.out.println("YOU'RE A WINNER! You get two gumballs for your quarter");
gumballMachine.releaseBall();
if (gumballMachine.getCount() == 0) {
gumballMachine.setState(gumballMachine.getSoldOutState());
} else {
gumballMachine.releaseBall();
if (gumballMachine.getCount() > 0) {
gumballMachine.setState(gumballMachine.getNoQuarterState());
} else {
System.out.println("Oops, out of gumballs!");
gumballMachine.setState(gumballMachine.getSoldOutState());
}
}
}
public String toString() {
return "despensing two gumballs for your quarter, because YOU'RE A WINNER!";
}
}
| [
"nancarpli@163.com"
] | nancarpli@163.com |
9b669b8322756c0a79f4be06affc75bb7953da24 | 0473c76a982cc9d701e71c271459d959860d5ea5 | /src/laboratoryWorks/linear/Task5.java | d99b391d7908c56f687eef110a44b326a87159c2 | [] | no_license | Evgen-Rum/rumiantsev-laboratory | 92dd24b9ad3c49224d0e2cc7d2ff49aa0c947a47 | d6d7e6ba181b7b12893fd42ccac787c01403345d | refs/heads/master | 2023-08-24T16:32:26.687962 | 2021-11-10T17:13:37 | 2021-11-10T17:13:37 | 420,676,939 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 974 | java | package laboratoryWorks.linear;
/*
Вычислить значение выражения по формуле (все переменные принимают действительные значения):
((sin x + cos y) / (cos x - sin y)) * tg xy
*/
import Util.UtilMethods;
public class Task5 {
public static void main(String[] args) {
double xValue = UtilMethods.readDoubleFromConsole(2.1,"Please enter x value!");
double yValue = UtilMethods.readDoubleFromConsole(2.1,"Please enter y value!");
double firstExpression = Math.toDegrees(Math.sin(xValue)) + Math.toDegrees(Math.cos(yValue));
double secondExpression = Math.toDegrees(Math.cos(xValue)) - Math.toDegrees(Math.sin(yValue));
double thirdResultingExpression = firstExpression / secondExpression * Math.toDegrees(Math.tan(xValue)
* Math.tan(yValue) );
System.out.println("The result of calculation is: " + thirdResultingExpression);
}
}
| [
"new.twunk@mail.ru"
] | new.twunk@mail.ru |
5a3b0082cd7b4372ff2fd8b8c7d5d84aed9e80bd | e40dabbf402beb9ceada6cf965839727b897c3d3 | /src/main/java/mateusz/milak/dev/usersystem/user/RegisterController.java | 8c999edf14f2a68176b70495ab97fcc2db3fc200 | [] | no_license | MateuszMilakDev/SpringBoot | 721aef8f5d601c2dc8ed9ec79669b15eb0e7b050 | 45d1a678866e0cad0a925fff0ae198d2c7da09f5 | refs/heads/master | 2020-04-05T17:26:38.581655 | 2018-11-11T08:33:48 | 2018-11-11T08:33:48 | 157,061,135 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 466 | java | package mateusz.milak.dev.usersystem.user;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.ws.rs.GET;
@Controller
public class RegisterController {
@GET
@RequestMapping(value = "/register")
public String registerForm(Model model) {
User u = new User();
model.addAttribute("user", u);
return "register";
}
}
| [
"mmilak197@gmail.com"
] | mmilak197@gmail.com |
a1730ef953f23321085bfe63e64ebedf2585089a | 53610cd22821ea1430330c780a2a1fbed5056e6b | /admin/src/main/java/com/quasar/backend/modules/base/service/PhoneService.java | a41822012b39fac78d2c1f032408adb4956dc3ce | [
"Apache-2.0"
] | permissive | qatix/ops-backend | f25edb061afa1af24b0921e80e249f3a0ebaf086 | 0bf8fdd2236f51ee9b9fc144e3a807688a2d0604 | refs/heads/master | 2022-08-28T20:53:29.194407 | 2020-11-20T12:18:48 | 2020-11-20T12:18:48 | 167,400,304 | 0 | 0 | Apache-2.0 | 2022-07-06T20:33:23 | 2019-01-24T16:34:14 | JavaScript | UTF-8 | Java | false | false | 435 | java | package com.quasar.backend.modules.base.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.quasar.backend.common.utils.PageUtils;
import com.quasar.backend.modules.base.entity.PhoneEntity;
import java.util.Map;
/**
* 机型信息
*
* @author Logan
* @date 2018-08-27 18:02:48
*/
public interface PhoneService extends IService<PhoneEntity> {
PageUtils queryPage(Map<String, Object> params);
}
| [
"tangxiaojun@checheweike.com"
] | tangxiaojun@checheweike.com |
ae5984e5068c8bbdd67dd9b9ebec604eeb5b0480 | 5637c49aae26518aff327641ab597f90f8126bff | /src/org/cakelab/omcl/config/GameConfig.java | 92de57fcb6ad0a2d95eba853674bcbc2a17d6891 | [] | no_license | homacs/org.cakelab.omcl | 596a28d52eb254c50cfd4670667796ca74ea32a0 | 9fd5f80673f6684ad36dec71ecbbb14534d811a8 | refs/heads/master | 2020-07-21T17:55:42.359978 | 2019-09-07T09:56:59 | 2019-09-07T09:56:59 | 206,935,711 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 647 | java | package org.cakelab.omcl.config;
import org.cakelab.omcl.setup.minecraft.Options;
public class GameConfig {
private String name;
protected String profileName;
boolean fullscreen = true;
int guiScale = Options.GUI_SCALE_AUTO;
public GameConfig(String name, String launcherProfileName) {
this.setName(name);
this.profileName = launcherProfileName;
}
public String getProfileName() {
return profileName;
}
public boolean getFullscreen() {
return fullscreen;
}
public int getGuiScale() {
return guiScale;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"homac@strace.org"
] | homac@strace.org |
2aaf760a187eedb2b70d940c633c2f63f9ff33e3 | 1a72626d54587fbad6a137007ff47d7fa662d1d1 | /app/src/main/java/com/mumu/fgotool/OutlineFragment.java | 0b5447748fa60c752a0d0c5ab26a5917b09a30e2 | [] | no_license | josh-hsu/FGOTool | bd71d0bef2770593ff611ce172a7d0f2ce416efd | 792bc480844d4b0bbcff86167e393058c895e089 | refs/heads/master | 2021-01-24T18:12:20.934195 | 2018-05-07T08:25:35 | 2018-05-07T08:25:35 | 84,411,489 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,168 | java | package com.mumu.fgotool;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Point;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AlertDialog;
import android.text.InputType;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;
import com.afollestad.materialdialogs.MaterialDialog;
import com.mumu.fgotool.records.ElectricityRecordHandler;
import com.mumu.fgotool.records.ElectricityRecordParser;
import com.mumu.fgotool.screencapture.PointSelectionActivity;
import com.mumu.fgotool.script.FGOJobHandler;
import com.mumu.fgotool.script.JobEventListener;
import com.mumu.fgotool.utility.Log;
import com.mumu.libjoshgame.JoshGameLibrary;
import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;
import static android.content.Context.WINDOW_SERVICE;
public class OutlineFragment extends MainFragment implements JobEventListener {
private static final String TAG = "FGOTool";
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
private String mParam1;
private String mParam2;
private Context mContext;
private static boolean mFGOFlag = false;
private FGOJobHandler mFGOJobs;
// Data Holder
private ElectricityRecordHandler mRecordHandler;
private PrivatePackageManager mPPM;
private Button mKillFGOButton;
private Button mBackupAccountButton;
private Button mRemoveAccountButton;
private Button mInfoButton;
private Button mRunJoshCmdButton;
private Button mScreenCaptureButton;
private TextView mAccountNumText;
private OnFragmentInteractionListener mListener;
private String mUpdatedString;
private final Handler mHandler = new Handler();
final Runnable mUpdateRunnable = new Runnable() {
public void run() {
updateView();
}
};
public OutlineFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment MoneyFragment.
*/
public static OutlineFragment newInstance(String param1, String param2) {
OutlineFragment fragment = new OutlineFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = getContext();
mPPM = PrivatePackageManager.getInstance();
mPPM.init(mContext.getPackageManager());
mFGOJobs = FGOJobHandler.getHandler();
mFGOJobs.setJobEventListener(FGOJobHandler.AUTO_TRAVERSE_JOB, this);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
prepareGL();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_ontline, container, false);
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OnFragmentInteractionListener) {
mListener = (OnFragmentInteractionListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnFragmentInteractionListener");
}
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
}
@Override
public void onFabClick(View view) {
Log.d(TAG, "Fab click from outline");
final Activity activity = getActivity();
if (activity instanceof MainActivity) {
final MainActivity deskClockActivity = (MainActivity) activity;
deskClockActivity.showSnackBarMessage("Test for outline");
}
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
prepareView(view);
prepareData();
updateView();
}
@Override
public void onDetailClick() {
Log.d(TAG, "Detail click on electricity fragment");
showBottomSheet();
}
private void prepareGL() {
int w, h;
WindowManager wm = (WindowManager) mContext.getSystemService(WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
Point size = new Point();
display.getSize(size);
Log.d(TAG, "Display size = " + size.toString());
// we always treat the short edge as width
// TODO: we need to find a new way to get actual panel width and height
if (size.x > size.y) {
w = size.y;
if (size.x > 2000)
h = 2160;
else
h = size.x;
} else {
w = size.x;
if (size.y > 2000)
h = 2160;
else
h = size.y;
}
JoshGameLibrary.getInstance().setScreenDimension(w, h);
}
private void prepareView(View view) {
mBackupAccountButton = (Button) view.findViewById(R.id.button_backup_account);
mRemoveAccountButton = (Button) view.findViewById(R.id.button_remove_account);
mInfoButton = (Button) view.findViewById(R.id.button_refresh);
mRunJoshCmdButton = (Button) view.findViewById(R.id.button_test_game);
mAccountNumText = (TextView) view.findViewById(R.id.textViewAccountNum);
mScreenCaptureButton = (Button) view.findViewById(R.id.button_screenshot);
mBackupAccountButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showAddDialog();
}
});
mRemoveAccountButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new AlertDialog.Builder(mContext)
.setTitle(R.string.outline_remove_fgo_title)
.setMessage(R.string.outline_remove_fgo_msg)
.setPositiveButton(R.string.action_confirm, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
try {
mPPM.moveData("com.aniplex.fategrandorder", "delete:account");
} catch (Exception e) {
e.printStackTrace();
}
}
})
.setNegativeButton(R.string.action_cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
})
.show();
}
});
mRemoveAccountButton.setBackgroundColor(Color.RED);
mInfoButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showBottomSheet();
}
});
mRunJoshCmdButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
runAutoLoginRoutine();
}
});
mScreenCaptureButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
intent.setClass(getMainActivity(), PointSelectionActivity.class);
startActivity(intent);
}
});
}
private void prepareData() {
mRecordHandler = ElectricityRecordHandler.getHandler();
mRecordHandler.initOnce(getActivity().getResources(), getActivity().getFilesDir().getAbsolutePath());
}
/*
* updateView will be called when mUpdateRunnable is triggered
*/
private void updateView() {
String accountNumText = getString(R.string.outline_account_num);
String currentProgressText = getString(R.string.outline_current_progress);
accountNumText = accountNumText + " " + mRecordHandler.getCount();
currentProgressText = currentProgressText + " " + mUpdatedString;
mAccountNumText.setText(accountNumText);
if (mFGOFlag)
mRunJoshCmdButton.setText(currentProgressText);
else
mRunJoshCmdButton.setText(R.string.outline_start_auto_traverse);
}
private void showBottomSheet() {
ElectricityBottomSheet ebs = new ElectricityBottomSheet();
ebs.show(getFragmentManager(), ebs.getTag());
}
private void runAutoLoginRoutine() {
if (!mFGOFlag) {
mFGOJobs.setExtra(FGOJobHandler.AUTO_TRAVERSE_JOB, ElectricityRecordHandler.getHandler());
mFGOJobs.startJob(FGOJobHandler.AUTO_TRAVERSE_JOB);
mRunJoshCmdButton.setText(R.string.outline_stop_auto_traverse);
} else {
mFGOJobs.stopJob(FGOJobHandler.AUTO_TRAVERSE_JOB);
mRunJoshCmdButton.setText(R.string.outline_start_auto_traverse);
}
mFGOFlag = !mFGOFlag;
}
@Override
public void onEventReceived(String msg, Object extra) {
Log.d(TAG, "Message Received " + msg);
mUpdatedString = msg;
mHandler.post(mUpdateRunnable);
}
public interface OnFragmentInteractionListener {
void onFragmentInteraction(Uri uri);
}
void createNewAccountFolder(String folderName) {
String baseFileName = mContext.getFilesDir().getAbsolutePath() +
File.separator + folderName;
File folderBase = new File(baseFileName);
File folderFiles = new File(baseFileName + "/files");
File folderPrefs = new File(baseFileName + "/shared_prefs");
if (!folderBase.exists()) {
if (!folderBase.mkdirs())
Log.d(TAG, "folder " + baseFileName + " create fail");
}
if (!folderFiles.exists()) {
if (!folderFiles.mkdirs())
Log.d(TAG, "folder " + baseFileName + "/files create fail");
}
if (!folderPrefs.exists()) {
if (!folderPrefs.mkdirs())
Log.d(TAG, "folder " + baseFileName + "/shared_prefs create fail");
}
}
/*
* Add electricity
*/
private void showAddDialog() {
new MaterialDialog.Builder(getContext())
.title(getString(R.string.electric_add))
.inputType(InputType.TYPE_CLASS_TEXT)
.input(getString(R.string.electric_add_field_holder), mRecordHandler.getTitle(0), new MaterialDialog.InputCallback() {
@Override
public void onInput(MaterialDialog dialog, CharSequence input) {
Log.d(TAG, "Get input " + input);
try {
String nextSerial = mRecordHandler.getNextSerial();
addNewRecordFromUser("account" + nextSerial, "NOW", input.toString());
updateView();
createNewAccountFolder("account" + nextSerial);
mPPM.moveData("com.aniplex.fategrandorder", "backupAll:com.mumu.fgotool/files/" + "account" + nextSerial);
} catch (Exception e) {
Log.e(TAG, e.getMessage());
}
}
}).negativeText(getString(R.string.electric_add_cancel)).show();
}
private int addNewRecordFromUser(String record, String date, String title) {
String targetDate;
if (date.equals("NOW")) {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.US);
targetDate = df.format(Calendar.getInstance().getTime());
} else {
targetDate = date;
}
try {
mRecordHandler.addRecord(new ElectricityRecordParser.Entry(mRecordHandler.getNextSerial(), targetDate, record, title));
mRecordHandler.refreshFromFile();
return 0;
} catch (Exception e) {
e.printStackTrace();
Log.e(TAG, "Fail to add record " + e.getMessage());
}
return -1;
}
}
| [
"alenbos0517@gmail.com"
] | alenbos0517@gmail.com |
b8e5ea095b77264270a2f55d6cf3aa9909733372 | e46d24dbbd2288d2dab21fd59480b636a7328dff | /src/main/java/org/bluemagic/config/api/Location.java | eeffb29defbf73e6f0f15b49d2005f387954ab83 | [
"Apache-2.0"
] | permissive | sdobberstein/magic-config-api | 73c91361c43f86403314a9faa3e30d63c4813dd2 | fff369b423cdb33bb87ec68c208198be0c3d0095 | refs/heads/master | 2021-01-24T05:15:30.210534 | 2012-05-02T10:10:12 | 2012-05-02T10:10:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 997 | java | package org.bluemagic.config.api;
import java.net.URI;
import java.util.Map;
import org.bluemagic.config.api.property.MagicProperty;
/**
* The data provider is responsible for using the incoming URI and parameters
* to resolve the requested data. Note that the parameters are optional and
* can clearly be ignored by the implementation if they wish.
**/
public interface Location {
/**
*
* @param key URI used to determine if a location can support it
* @return true if supports, false if no support
*/
public boolean supports(URI key);
/**
* @param key URI a unique identifier for a specific instance of data
* or set of data.
* @param parameters Map<MagicKey name, String value> name and value pairs
* of data. Note that the Map is required but it may be
* empty. However, the map itself cannot be null.
**/
public MagicProperty locate(URI key, Map<MagicKey, Object> parameters);
}
| [
"github@jrod.org"
] | github@jrod.org |
6b8a117d8408b40d4d3e6765e615b3a384531017 | e2739b8c6414f7f2590a3d6412d776a567f942f0 | /PSP2.0/Main.java | 6d260be2582ad9d9ae764287e389d8efcc2eed9a | [] | no_license | gerashdo/PSP_Programs | e2caaca4f01de2232fb2c3a91f6c4e08b373f4ce | 3e9ab8c4c3475408f404351a794a0d88d51b827c | refs/heads/main | 2023-01-30T00:26:03.676032 | 2020-12-02T17:38:18 | 2020-12-02T17:38:18 | 304,161,874 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,899 | java | import java.util.Scanner;
import java.io.*;
import static java.lang.Math.abs;
/**
/* Programa: 5, Calcula la Prediccion Mejorada con 4 Variables.
/* Autor: Gerardo Jiménez Argüelles.
/* Fecha: 24 Noviembre, 2020.
/* Descripcion: Calcula la Prediccion Mejorada entre 4 conjuntos.
*/
public class Main {
public static void main (String[] args) {
ListaLigada contenido;
String nombreArchivo;
double locAnadida;
double locReutilizada;
double locModificado;
double tiempo;
System.out.println("Introduce el Nombre del Archivo:");
nombreArchivo = InteraccionUsuario.pedirUsuario().toString();
System.out.println("Lineas nuevas:");
locAnadida = Double.parseDouble(InteraccionUsuario.pedirUsuario().toString());
System.out.println("Lineas a Reutilizar:");
locReutilizada = Double.parseDouble(InteraccionUsuario.pedirUsuario().toString());
System.out.println("Lineas a Modificar:");
locModificado = Double.parseDouble(InteraccionUsuario.pedirUsuario().toString());
contenido = LeerArchivo.leerArchivo(nombreArchivo);
Ecuacion paraEcuaciones;
paraEcuaciones = new Ecuacion(contenido,contenido.getPosicion());
paraEcuaciones.crearMatriz();
paraEcuaciones.gauss();
paraEcuaciones.sustitucionHaciaAtras();
tiempo = paraEcuaciones.obtenerNuevaVariable(locAnadida,locReutilizada,locModificado);
double betas[];
betas = paraEcuaciones.getBetas();
System.out.println("B0 = "+betas[0]);
System.out.println("B1 = "+betas[1]);
System.out.println("B2 = "+betas[2]);
System.out.println("B3 = "+betas[3]);
System.out.println("Tiempo Estimado = "+tiempo);
}
}
class Ecuacion {
private Matriz matriz;
private double betas[];
private ListaLigada contenido;
private int n;
public Ecuacion (ListaLigada contenido, int n) {
matriz = new Matriz(4,5);
betas = new double[4];
this.contenido = contenido;
this.n = n;
}
public double[] getBetas () {
return betas;
}
public double obtenerNuevaVariable (double val1, double val2, double val3) {
// Se puede hacer más generalizable
double suma;
suma = betas[0];
suma = suma + (betas[1] * val1) + (betas[2] * val2) + (betas[3] * val3);
return suma;
}
public void sustitucionHaciaAtras () {
int limite;
int col;
double valorResultado;
// iteraciones
for( limite = matriz.columnas()-2;limite >= 0;limite--) {
valorResultado = Double.parseDouble(matriz.getElemento(limite,matriz.columnas()-1).toString());
// Pasando los valores al lado contrario
for( col = matriz.columnas()-2; col > limite;col--){
valorResultado = valorResultado + (Double.parseDouble(matriz.getElemento(limite,col).toString()) * betas[col] * -1);
}
betas[limite] = valorResultado / Double.parseDouble(matriz.getElemento(limite,limite).toString());
}
}
public void gauss () {
int columna;
columna = 0;
int iteracion;
// Comienzan iteraciones
for( iteracion = 0;iteracion < matriz.renglones();iteracion++ ){
// Si hay una posicion más en los renglones
int posPivote;
posPivote = encontrarPivote(columna);
// Si la columna no esta ya en 0
if( Double.parseDouble(matriz.getElemento(posPivote,columna).toString()) != 0.0){
intercambiarPosiciones(columna,posPivote,columna);
// System.out.println("Privote = "+matriz.getElemento(columna,columna));
reducirCoeficiente(columna);
double vectorActual[];
vectorActual = new double[matriz.columnas()-columna];
int col;
int vecPos;
vecPos = 0;
// crear vector con valres de la columna actual
for( col = columna;col < matriz.columnas();col++ ){
// Valor del vector ya es double
vectorActual[vecPos] = Double.parseDouble(matriz.getElemento(columna,col).toString());
vecPos++;
}
// Eliminar a cada renglon el vector
int reng;
for(reng = columna + 1;reng < matriz.renglones();reng++){
eliminarEnRenglones(vectorActual,reng,columna);
}
}
columna++;
}
}
public void eliminarEnRenglones (double[] vectorInicial,int renglon, int columna) {
double vectorEliminar[];
vectorEliminar = new double[vectorInicial.length];
int pos2;
for( pos2 = 0;pos2 < vectorInicial.length;pos2++){
vectorEliminar[pos2] = vectorInicial[pos2];
}
int col;
int pos;
double valorEliminar;
valorEliminar = Double.parseDouble(matriz.getElemento(renglon,columna).toString()) * -1.0;
// Multiplicar el valor al contrario con el vector original
for( pos = 0;pos < vectorEliminar.length;pos++ ){
vectorEliminar[pos] = vectorEliminar[pos] * valorEliminar;
}
// Sumar valores del vector al renglón actual
pos = 0;
for( col = columna;col < matriz.columnas();col++){
matriz.setElemento(renglon,col,Double.parseDouble(matriz.getElemento(renglon,col).toString())+vectorEliminar[pos]);
pos++;
}
}
public void reducirCoeficiente (int reng) {
int col;
double valorAnterior;
double valorActual;
valorAnterior = Double.parseDouble(matriz.getElemento(reng,reng).toString());
for( col = reng;col < matriz.columnas();col++){
valorActual = Double.parseDouble(matriz.getElemento(reng,col).toString());
matriz.setElemento(reng,col,(1/valorAnterior)*valorActual);
}
}
public void intercambiarPosiciones (int reng1, int reng2, int col) {
int pos;
// si el pivote es el mismo que el primero no se intercambian
if( reng2 != reng1){
for( pos = col;pos < matriz.columnas();pos++){
Object aux;
aux = matriz.getElemento(reng1,pos);
matriz.setElemento(reng1,pos,matriz.getElemento(reng2,pos));
matriz.setElemento(reng2,pos,aux);
}
}
}
public int encontrarPivote (int col) {
double valorMax;
valorMax = 0.0;
int pos;
pos = col;
int reng;
for( reng = col;reng < matriz.renglones();reng++ ){
if( Math.abs(Double.parseDouble(matriz.getElemento(reng,col).toString())) > Math.abs(valorMax)){
valorMax = Double.parseDouble(matriz.getElemento(reng,col).toString());
pos = reng;
}
}
return pos;
}
public void matrizLinea1 () {
matriz.setElemento(0,0,n);
int col;
for( col = 1;col <= 4;col++ ){
matriz.setElemento(0,col,OperacionesConjuntos.sumatoriaConjunto(contenido,col-1));
}
}
public void crearMatriz () {
matriz.inicializar(0.0);
matrizLinea1();
int letra;
letra = 0;
int reng;
int col;
for( reng = 1;reng < 4;reng++ ){
matriz.setElemento(reng,0,OperacionesConjuntos.sumatoriaConjunto(contenido,letra));
for( col = 1;col <= 4;col++ ){
matriz.setElemento(reng,col,OperacionesConjuntos.sumMultDosConjuntos(contenido,letra,col-1));
}
letra++;
}
}
}
class OperacionesConjuntos {
public static double sumMultDosConjuntos (ListaLigada lista, int posicion1, int posicion2) {
Nodo nodo;
double suma;
suma = 0;
String contenido;
String[] arrCont;
lista.inicializaIterador();
while(lista.existeNodo()){
nodo = (Nodo)lista.obtenerSiguiente();
contenido = nodo.getInfo1().toString();
arrCont = contenido.split(" ");
suma = suma + (Double.parseDouble(arrCont[posicion1]) * Double.parseDouble(arrCont[posicion2]));
}
return suma;
}
public static double sumatoriaConjunto (ListaLigada lista, int posicion) {
Nodo nodo;
double suma;
suma = 0;
String contenido;
String[] arrCont;
lista.inicializaIterador();
while(lista.existeNodo()){
nodo = (Nodo)lista.obtenerSiguiente();
contenido = nodo.getInfo1().toString();
arrCont = contenido.split(" ");
suma = suma + Double.parseDouble(arrCont[posicion]);
}
return suma;
}
}
class Matriz {
protected Object datos[][];
protected int RENG;
protected int COL;
public Matriz (int reng, int col) {
RENG = reng;
COL = col;
datos = new Object[reng][col];
}
public void inicializar (Object valor) {
int reng;
int col;
for(reng = 0;reng<RENG;reng++){
for(col = 0;col<COL;col++){
datos[reng][col]=valor;
}
}
}
private boolean validarDim (int valor, int tam) {
if(valor >= 0 && valor < tam){
return true;
}else{
return false;
}
}
public boolean setElemento (int reng, int col, Object valor) {
if(validarDim(reng,RENG) && validarDim(col, COL)){
datos[reng][col] = valor;
return true;
}else{
return false;
}
}
public Object getElemento (int reng, int col) {
if(validarDim(reng,RENG) && validarDim(col, COL)){
return datos[reng][col];
}else{
return null;
}
}
public int renglones () {
return RENG;
}
public int columnas () {
return COL;
}
}
class InteraccionUsuario {
public static Object pedirUsuario () {
Scanner teclado;
teclado = new Scanner(System.in);
Object ingreso;
ingreso = (Object)teclado.nextLine();
return ingreso;
}
}
class Nodo {
protected Object info1;
protected Nodo ligaDer;
public Nodo () {
ligaDer = null;
}
public Object getInfo1 () {
return info1;
}
public void setInfo1 (Object info1) {
this.info1 = info1;
}
public Nodo getLigaDer () {
return ligaDer;
}
public void setLigaDer (Nodo ligaDer) {
this.ligaDer = ligaDer;
}
@Override
public String toString () {
return info1.toString();
}
}
class ListaLigada {
protected Nodo primero;
protected Nodo ultimo;
protected Nodo nodoActualIterador;
protected int posicion;
public ListaLigada () {
primero = null;
ultimo = null;
nodoActualIterador = null;
posicion = 0;
}
public boolean insertar (Nodo nodo) {
// Insertar al final
if( nodo != null ){
if( ultimo == null ){
// vacia
primero=nodo;
ultimo=nodo;
posicion ++;
}else{
ultimo.setLigaDer(nodo);
ultimo=nodo;
posicion++;
}
return true;
}else{
return false;
}
}
public void inicializaIterador () {
nodoActualIterador = primero;
}
public boolean existeNodo () {
if( nodoActualIterador!=null ){
return true;
}else{
return false;
}
}
public Object obtenerSiguiente () {
if( existeNodo() ){
Object contenido;
contenido=nodoActualIterador;
nodoActualIterador = nodoActualIterador.getLigaDer();
return contenido;
}else{
return null;
}
}
public int getPosicion () {
return posicion;
}
}
class LeerArchivo {
public static ListaLigada leerArchivo (String nombre) {
FileReader entrada;
entrada = null;
ListaLigada arreglo;
arreglo = new ListaLigada();
String cadenaDivid[];
cadenaDivid=null;
try{
String cadena;
cadena = null;
entrada = new FileReader(nombre);
BufferedReader buffer;
buffer = new BufferedReader(entrada);
while( (cadena = buffer.readLine()) != null ){
if( !cadena.isEmpty() ){
Nodo nodo;
nodo = new Nodo();
nodo.setInfo1(cadena);
arreglo.insertar(nodo);
}
}
}catch(FileNotFoundException e){
System.out.println("Error de archivo.");
}catch(IOException e){
System.out.println("Error de archivo.");
}finally{
try{
if( entrada != null ){
entrada.close();
}
}catch(IOException e){
e.printStackTrace();
}
}
return arreglo;
}
} | [
"33142689@uaz.edu.mx"
] | 33142689@uaz.edu.mx |
68ab8ad7266bdbc72069ecc39a8eec63f5dee60e | 6249a2b3928e2509b8a5d909ef9d8e18221d9637 | /revolsys-core/src/main/java/com/revolsys/connection/file/FileConnectionManager.java | 861ceab78e00eb20a1fcf35fb8036e8bde65084f | [
"Apache-2.0"
] | permissive | revolsys/com.revolsys.open | dbcdc3bdcee3276dc3680311948e91ec64e1264e | 7f4385c632094eb5ed67c0646ee3e2e258fba4e4 | refs/heads/main | 2023-08-22T17:18:48.499931 | 2023-05-31T01:59:22 | 2023-05-31T01:59:22 | 2,709,026 | 5 | 11 | NOASSERTION | 2023-05-31T01:59:23 | 2011-11-04T12:33:49 | Java | UTF-8 | Java | false | false | 7,574 | java | package com.revolsys.connection.file;
import java.beans.PropertyChangeEvent;
import java.io.File;
import java.io.IOException;
import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;
import java.nio.file.FileStore;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.nio.file.WatchService;
import java.nio.file.attribute.UserPrincipalLookupService;
import java.nio.file.spi.FileSystemProvider;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import com.revolsys.beans.PropertyChangeSupport;
import com.revolsys.connection.ConnectionRegistryManager;
import com.revolsys.spring.resource.Resource;
public class FileConnectionManager extends FileSystem
implements ConnectionRegistryManager<FolderConnectionRegistry>, URLStreamHandlerFactory {
static FileConnectionManager instance;
private static final FileSystem DEFAULT_FILE_SYSTEM = FileSystems.getDefault();
public static FileConnectionManager get() {
if (instance == null) {
new FileConnectionFileSystemProvider();
}
return instance;
}
public static File getConnection(final String name) {
final FileConnectionManager connectionManager = get();
final List<FolderConnectionRegistry> registries = new ArrayList<>();
registries.addAll(connectionManager.getConnectionRegistries());
final FolderConnectionRegistry threadRegistry = FolderConnectionRegistry.getForThread();
if (threadRegistry != null) {
registries.add(threadRegistry);
}
Collections.reverse(registries);
for (final FolderConnectionRegistry registry : registries) {
final FolderConnection connection = registry.getConnection(name);
if (connection != null) {
return connection.getFile();
}
}
return null;
}
private final FileConnectionFileSystemProvider provider;
private final PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
private final List<FolderConnectionRegistry> registries = new ArrayList<>();
public FileConnectionManager(final FileConnectionFileSystemProvider provider) {
this.provider = provider;
}
@Override
public void addConnectionRegistry(final FolderConnectionRegistry registry) {
if (registry != null) {
int index = -1;
synchronized (this.registries) {
if (!this.registries.contains(registry)) {
index = this.registries.size();
this.registries.add(registry);
registry.setConnectionManager(this);
}
}
if (index != -1) {
index = getVisibleConnectionRegistries().indexOf(registry);
if (index != -1) {
this.propertyChangeSupport.fireIndexedPropertyChange("registries", index, null, registry);
this.propertyChangeSupport.fireIndexedPropertyChange("children", index, null, registry);
}
}
}
}
public synchronized FolderConnectionRegistry addConnectionRegistry(final String name) {
final FolderConnectionRegistry registry = new FolderConnectionRegistry(this, name);
addConnectionRegistry(registry);
return registry;
}
public synchronized FolderConnectionRegistry addConnectionRegistry(final String name,
final Resource resource) {
final FolderConnectionRegistry registry = new FolderConnectionRegistry(this, name, resource,
false);
addConnectionRegistry(registry);
return registry;
}
@Override
public void close() throws IOException {
}
@Override
public URLStreamHandler createURLStreamHandler(final String protocol) {
return null;
}
protected FolderConnectionRegistry findConnectionRegistry(final String name) {
for (final FolderConnectionRegistry registry : this.registries) {
if (registry.getName().equals(name)) {
return registry;
}
}
return null;
}
@Override
public List<FolderConnectionRegistry> getConnectionRegistries() {
return new ArrayList<>(this.registries);
}
@Override
public FolderConnectionRegistry getConnectionRegistry(final String name) {
final FolderConnectionRegistry connectionRegistry = findConnectionRegistry(name);
if (connectionRegistry == null) {
return this.registries.get(0);
}
return connectionRegistry;
}
@Override
public Iterable<FileStore> getFileStores() {
return Collections.emptyList();
}
@Override
public String getIconName() {
return "folder:link";
}
@Override
public String getName() {
return "Folder Connections";
}
@Override
public Path getPath(final String first, final String... more) {
String path;
if (more.length == 0) {
path = first;
} else {
final StringBuilder sb = new StringBuilder();
sb.append(first);
for (final String segment : more) {
if (segment.length() > 0) {
if (sb.length() > 0) {
sb.append('/');
}
sb.append(segment);
}
}
path = sb.toString();
}
// return new FileConnectionPath(this, path);
return null;
}
@Override
public PathMatcher getPathMatcher(final String syntaxAndPattern) {
// TODO Auto-generated method stub
return null;
}
@Override
public PropertyChangeSupport getPropertyChangeSupport() {
return this.propertyChangeSupport;
}
@Override
public Iterable<Path> getRootDirectories() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getSeparator() {
return "/";
}
@Override
public UserPrincipalLookupService getUserPrincipalLookupService() {
return DEFAULT_FILE_SYSTEM.getUserPrincipalLookupService();
}
@Override
public List<FolderConnectionRegistry> getVisibleConnectionRegistries() {
final List<FolderConnectionRegistry> registries = new ArrayList<>();
for (final FolderConnectionRegistry registry : this.registries) {
if (registry != null && registry.isVisible()) {
registries.add(registry);
}
}
return registries;
}
@Override
public boolean isOpen() {
return true;
}
@Override
public boolean isReadOnly() {
return false;
}
@Override
public WatchService newWatchService() throws IOException {
return DEFAULT_FILE_SYSTEM.newWatchService();
}
@Override
public void propertyChange(final PropertyChangeEvent event) {
this.propertyChangeSupport.firePropertyChange(event);
}
@Override
public FileSystemProvider provider() {
return this.provider;
}
@Override
public void removeConnectionRegistry(final FolderConnectionRegistry registry) {
if (registry != null) {
final int index;
synchronized (this.registries) {
index = this.registries.indexOf(registry);
if (index != -1) {
this.registries.remove(registry);
registry.setConnectionManager(null);
registry.getPropertyChangeSupport().removePropertyChangeListener(this);
}
}
if (index != -1) {
this.propertyChangeSupport.fireIndexedPropertyChange("registries", index, registry, null);
}
}
}
public void removeConnectionRegistry(final String name) {
final FolderConnectionRegistry connectionRegistry = findConnectionRegistry(name);
removeConnectionRegistry(connectionRegistry);
}
@Override
public Set<String> supportedFileAttributeViews() {
return DEFAULT_FILE_SYSTEM.supportedFileAttributeViews();
}
@Override
public String toString() {
return getName();
}
}
| [
"paul.austin@revolsys.com"
] | paul.austin@revolsys.com |
589afb92b63decdbc637bcdcc68261a62ab18e32 | 0f09f9d2b94302bc21fe2cf1206f5d4be43d1443 | /src/main/java/org/theflyingtoasters/commands/autonomous/SwitchAuton.java | e5bd0cc94178b606c04822753e613acf6a9a48cb | [] | no_license | JackToaster/FlyingToasters2018-GradleRio | 020fbee95f7c04b870edebd50d0355fc4a5bed84 | 471aece772336fb33485bb4da2cb42bcfbb1f08a | refs/heads/master | 2020-03-14T07:00:18.386550 | 2018-07-12T22:14:27 | 2018-07-12T22:14:27 | 131,494,708 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,242 | java | package org.theflyingtoasters.commands.autonomous;
import org.theflyingtoasters.commands.IntakeCommand;
import org.theflyingtoasters.commands.LiftCommand;
import org.theflyingtoasters.commands.MotionProfileCommand;
import org.theflyingtoasters.commands.interfaces.Command;
import org.theflyingtoasters.commands.interfaces.OpMode;
import org.theflyingtoasters.hardware.Lift;
import org.theflyingtoasters.hardware.Intake.State;
import org.theflyingtoasters.path_generation.Point;
import org.theflyingtoasters.path_generation.Waypoint;
import org.theflyingtoasters.robot.Robot;
import org.theflyingtoasters.utilities.Logging;
/**
* An autonomous mode which automatically drives to the correct side of the
* switch based on the game data.
*
* @author jack
*
*/
public class SwitchAuton extends OpMode {
// meters from wall to switch
final static double switch_dist = 2.4;
final static double switch_left = 2.0;
final static double switch_right = -1.0;
Waypoint start = new Waypoint(new Point(0, 0), 0);
Waypoint end;
MotionProfileCommand motionProfileCmd;
LiftCommand flip;
public SwitchAuton(Robot bot, String gameData) {
super(bot, "Motion Profile Auton");
Logging.h(gameData);
if (gameData.charAt(0) == 'L') {
end = new Waypoint(new Point(switch_dist, switch_left), 0.0);
} else {
end = new Waypoint(new Point(switch_dist, switch_right), 0.0);
}
motionProfileCmd = new MotionProfileCommand(this, robot, "drive to switch", false, MotionProfileCommand.Speed.MED_LOW_ACCEL, start, end);
flip = new LiftCommand(this, bot, Lift.Positions.STARTING_FLIP);
}
public void init() {
//Logging.h("Init run!");
super.init();
addCommand(motionProfileCmd);
}
public void periodic(double deltaTime) {
super.periodic(deltaTime);
Logging.l("Left pos: " + robot.driveBase.left.getPosition() + ", right pos: "
+ robot.driveBase.right.getPosition());
}
public void stop() {
robot.driveBase.setFeedbackActive(false);
}
public void commandFinished(Command cmd) {
//Add the intake command to output the cube.
if (cmd == motionProfileCmd) {
addCommand(flip);
}else if(cmd == flip){
addCommand(new IntakeCommand(this, robot, State.OUTPUTTING));
}
super.commandFinished(cmd);
}
}
| [
"jackflef@gmail.com"
] | jackflef@gmail.com |
f126a4ea4f04c18030ffd965bd5000b5fbe5d7ac | c072d99c35291d82d5af0bba1efda3e3537aa4a1 | /src/main/java/dg/athena/sideprojects/SlotService/Exceptions/NotFoundException.java | cbdeca6cf6fff4deaf69c93873ad918ad34e0679 | [] | no_license | danishgarg/slotservicekafka | bc4cb84ecf42da536e121f19f3e08123a4b28f7a | 8819812dd0a19052e6daee23828d130740995078 | refs/heads/master | 2020-03-07T06:43:48.454883 | 2018-03-29T18:27:28 | 2018-03-29T18:27:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 638 | java | package dg.athena.sideprojects.SlotService.Exceptions;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(HttpStatus.NOT_FOUND)
public class NotFoundException extends RuntimeException{
private static final long serialVersionUID = 1L;
private String message;
public NotFoundException(String message){
this.message = message;
}
/**
* @return the message
*/
public String getMessage() {
return message;
}
/**
* @param message the message to set
*/
public void setMessage(String message) {
this.message = message;
}
} | [
"danish.garg@gmail.com"
] | danish.garg@gmail.com |
3818ffc66c9a92647fd2db54f9f46d43d1c89079 | f0aea12710e533f0cbcede5a7350a3f6a035c306 | /Gui/opensim/modeling/src/org/opensim/modeling/SWIGTYPE_p_VectorIteratorT_SimTK__VecT_6_double_1_t_SimTK__RowVectorBaseT_SimTK__VecT_6_double_1_t_t_t.java | e25dbea8c51a46a6976f0a944bee11d8daecdbcf | [
"LGPL-3.0-only",
"LGPL-2.0-or-later",
"Python-2.0",
"GPL-1.0-or-later",
"CDDL-1.0",
"BSD-3-Clause",
"GPL-3.0-only",
"Apache-2.0",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-public-domain"
] | permissive | opensim-org/opensim-gui | 4912532d2bdc0a62e67d0faf8a1bf30ef328585a | 2e49f88235435f71ba5d444eef7f94f642d2c201 | refs/heads/main | 2023-08-07T20:42:14.508138 | 2023-07-27T19:24:24 | 2023-07-27T19:24:24 | 21,282,751 | 41 | 34 | Apache-2.0 | 2023-08-23T18:22:19 | 2014-06-27T16:58:33 | Java | UTF-8 | Java | false | false | 1,292 | java | /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (https://www.swig.org).
* Version 4.1.1
*
* Do not make changes to this file unless you know what you are doing - modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package org.opensim.modeling;
public class SWIGTYPE_p_VectorIteratorT_SimTK__VecT_6_double_1_t_SimTK__RowVectorBaseT_SimTK__VecT_6_double_1_t_t_t {
private transient long swigCPtr;
protected SWIGTYPE_p_VectorIteratorT_SimTK__VecT_6_double_1_t_SimTK__RowVectorBaseT_SimTK__VecT_6_double_1_t_t_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
swigCPtr = cPtr;
}
protected SWIGTYPE_p_VectorIteratorT_SimTK__VecT_6_double_1_t_SimTK__RowVectorBaseT_SimTK__VecT_6_double_1_t_t_t() {
swigCPtr = 0;
}
protected static long getCPtr(SWIGTYPE_p_VectorIteratorT_SimTK__VecT_6_double_1_t_SimTK__RowVectorBaseT_SimTK__VecT_6_double_1_t_t_t obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected static long swigRelease(SWIGTYPE_p_VectorIteratorT_SimTK__VecT_6_double_1_t_SimTK__RowVectorBaseT_SimTK__VecT_6_double_1_t_t_t obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
4203cb21cf817aaa79ad0411995fa284f43ff127 | 2424e4a267197e8ffb1952dc0fdfdc74c861e068 | /FrmOPDAdmission.java | d22b1f0de4910938c9b7a8aff017671e0383b5b4 | [] | no_license | atishs078/Core-Java-Project | 637b9959de19724b3c30bf4534368966e4ab60fc | 030a3027599746c62163f5374a572a23e8f53e67 | refs/heads/master | 2023-04-10T12:05:29.764838 | 2019-03-15T04:42:22 | 2019-03-15T04:42:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,169 | java | package hms;
import javax.swing.*;
import javax.swing.table.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
class FrmOPDAdmission extends JInternalFrame
{
/**
*
*/
private static final long serialVersionUID = 1L;
static FrmOPDAdmission fpp;
JTable jtb;
Object [][]data;
JScrollPane jsp;
String heads[]={"OPD No.","Date","Patient","Amount","Doctor"};
JPanel p1;
JButton btnAdd,btnUpdate,btnSearch,btnShowAll,btnDelete;
JTableHeader header;
DConnection dc;
ResultSet rst;
static String query="";
FrmOPDAdmission(JDesktopPane jdp)
{
super("OPD Registration",true,true,true,true);
dc=new DConnection();
btnAdd=new JButton("Add");
btnUpdate=new JButton("Update");
btnSearch=new JButton("Search");
btnShowAll=new JButton("Show All");
btnDelete=new JButton("Delete");
p1=new JPanel();
p1.setLayout(new GridLayout(1,5));
fpp=this;
btnAdd.setForeground(Color.white);
btnAdd.setBackground(Color.blue);
btnAdd.setFont(new Font(Font.SERIF,Font.ITALIC+Font.BOLD,20));
btnAdd.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
FrmAddEditOPDAdmission pp =new FrmAddEditOPDAdmission(true,"",fpp);
jdp.add(pp);
jdp.setComponentZOrder(pp,0);
jdp.setComponentZOrder(fpp,1);
}
});
btnUpdate.setForeground(Color.white);
btnUpdate.setBackground(Color.blue);
btnUpdate.setFont(new Font(Font.SERIF,Font.ITALIC+Font.BOLD,20));
btnUpdate.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
int r=jtb.getSelectedRow();
if(r==-1)
{
JOptionPane.showMessageDialog(null,"No row selected");
}
else
{
String s1=(String)jtb.getValueAt(r,0);
FrmAddEditOPDAdmission pp=new FrmAddEditOPDAdmission(false,"select * from opd where reg_no="+s1,fpp);
jdp.add(pp);
jdp.setComponentZOrder(pp,0);
jdp.setComponentZOrder(fpp,1);
}
}
});
btnSearch.setForeground(Color.white);
btnSearch.setBackground(new Color(128,0,255));
btnSearch.setFont(new Font(Font.SERIF,Font.ITALIC+Font.BOLD,20));
btnSearch.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
query="";
FrmSearchOPDAdmission pp=new FrmSearchOPDAdmission(fpp);
jdp.add(pp);
jdp.setComponentZOrder(pp,0);
jdp.setComponentZOrder(fpp,1);
}
});
btnShowAll.setForeground(Color.white);
btnShowAll.setBackground(new Color(128,0,255));
btnShowAll.setFont(new Font(Font.SERIF,Font.ITALIC+Font.BOLD,20));
btnShowAll.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
query="";
reload();
}
});
btnDelete.setForeground(Color.white);
btnDelete.setBackground(Color.red);
btnDelete.setFont(new Font(Font.SERIF,Font.ITALIC+Font.BOLD,20));
btnDelete.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
int r=jtb.getSelectedRow();
if(r==-1)
{
JOptionPane.showMessageDialog(null,"No row selected");
}
else
{
String s1=(String)jtb.getValueAt(r,0);
dc.executeOther("delete from opd where reg_no="+s1);
reload();
}
}
});
p1.add(btnAdd); p1.add(btnUpdate);p1.add(btnSearch);
p1.add(btnShowAll);p1.add(btnDelete);
add(p1,"South");
jtb=createJTable();
jtb.setRowHeight(25);
jtb.setRowMargin(5);
Dimension d1=new Dimension(5,5);
jtb.setIntercellSpacing(d1);
jtb.setGridColor(Color.black);
jtb.setShowGrid(true);
jtb.setForeground(new Color(128,0,255));
jtb.setBackground(new Color(255,255,255));
jtb.setFont(new Font(Font.SERIF,Font.BOLD+Font.ITALIC,15));
header=jtb.getTableHeader();
header.setForeground(Color.white);
header.setBackground(new Color(64,0,128));
header.setFont(new Font(Font.SERIF,Font.BOLD,17));
jtb.setSelectionForeground(Color.black);
jtb.setSelectionBackground(new Color(128,0,128));
jsp=new JScrollPane(jtb);
add(jsp);
Dimension desktop=Toolkit.getDefaultToolkit().getScreenSize();
setSize(desktop.width,desktop.height-200);
Point p=CommonMethods.getCenterPoint(getSize());
setLocation(p.x,p.y-100);
setVisible(true);
}
void reload()
{
remove(jsp);
jtb=createJTable();
jtb.setRowHeight(25);
jtb.setRowMargin(5);
Dimension d1=new Dimension(5,5);
jtb.setIntercellSpacing(d1);
jtb.setGridColor(Color.black);
jtb.setShowGrid(true);
jtb.setForeground(new Color(128,0,255));
jtb.setBackground(new Color(255,255,255));
jtb.setFont(new Font(Font.SERIF,Font.BOLD+Font.ITALIC,15));
header=jtb.getTableHeader();
header.setForeground(Color.white);
header.setBackground(new Color(64,0,128));
header.setFont(new Font(Font.SERIF,Font.BOLD,17));
jtb.setSelectionForeground(Color.black);
jtb.setSelectionBackground(new Color(128,0,128));
jsp=new JScrollPane(jtb);
add(jsp);
revalidate();
}
JTable createJTable()
{
try
{
if(query==null || "".equals(query))
rst=dc.executeQuery("Select count(*) from opd");
else
rst=dc.executeQuery("Select count(*)" + query);
rst.next();
int n=rst.getInt(1);
if(n!=0)
{
if(query==null || "".equals(query))
rst=dc.executeQuery("Select * from opd");
else
rst=dc.executeQuery("Select * "+query);
data=new Object[n][5];
int i=0;
while(rst.next())
{
data[i][0]=rst.getString(1);
data[i][1]=rst.getString(2);
data[i][2]=CommonMethods.getPatientName(rst.getString(3));
data[i][3]=rst.getString(4);
data[i][4]=rst.getString(5);
i++;
}
dc.close();
}
else
{
data=new Object[0][5];
}
}
catch(SQLException e)
{
e.printStackTrace();
}
jtb=new JTable(data,heads);
return jtb;
}
} | [
"noreply@github.com"
] | noreply@github.com |
28aba311922419896b527a241c229c4484af712c | 34eeab9ab57c5981a3f73ae51d6702e87275c9f8 | /Mage.Sets/src/mage/cards/g/GarrukUnleashed.java | 6ec137afbc6eccf3f2010ae3bbff690c8fd8b951 | [
"MIT"
] | permissive | tylerFretz/mage | f12a3116119376c4ec50c2eff7f2f03ff3016e07 | cfa1dffc1e009c25d976dcca0063e8abb237aa46 | refs/heads/master | 2023-04-30T08:49:22.655044 | 2023-04-12T15:12:48 | 2023-04-12T15:12:48 | 238,129,169 | 1 | 0 | MIT | 2023-04-13T00:28:58 | 2020-02-04T05:17:50 | Java | UTF-8 | Java | false | false | 3,072 | java | package mage.cards.g;
import mage.abilities.LoyaltyAbility;
import mage.abilities.condition.common.OpponentControlsMoreCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.command.emblems.GarrukUnleashedEmblem;
import mage.game.permanent.token.BeastToken;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author htrajan
*/
public final class GarrukUnleashed extends CardImpl {
public GarrukUnleashed(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{G}{G}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.GARRUK);
this.setStartingLoyalty(4);
// +1: Up to one target creature gets +3/+3 and gains trample until end of turn.
Effect effect = new BoostTargetEffect(3, 3, Duration.EndOfTurn)
.setText("up to one target creature gets +3/+3");
LoyaltyAbility ability = new LoyaltyAbility(effect, 1);
effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn)
.setText("and gains trample until end of turn");
ability.addEffect(effect);
ability.addTarget(new TargetCreaturePermanent(0, 1));
this.addAbility(ability);
// −2: Create a 3/3 green Beast creature token. Then if an opponent controls more creatures than you, put a loyalty counter on Garruk, Unleashed.
ability = new LoyaltyAbility(new CreateTokenEffect(new BeastToken()), -2);
ability.addEffect(new ConditionalOneShotEffect(
new AddCountersSourceEffect(CounterType.LOYALTY.createInstance()),
new OpponentControlsMoreCondition(new FilterCreaturePermanent()))
.setText("Then if an opponent controls more creatures than you, put a loyalty counter on {this}"));
this.addAbility(ability);
// −7: You get an emblem with "At the beginning of your end step, you may search your library for a creature card, put it onto the battlefield, then shuffle your library."
this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new GarrukUnleashedEmblem()), -7));
}
private GarrukUnleashed(final GarrukUnleashed card) {
super(card);
}
@Override
public GarrukUnleashed copy() {
return new GarrukUnleashed(this);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
fb9d2d9768b47a418dbd51d1eecbd271ecc38ede | 4f9ad1eec3af37e193d213c81cf083c1f27a1e46 | /Motor.java | 11e1639c1bb2c10e9d1d83387165ea67ddff09a9 | [] | no_license | clodualdoluizjr/Carros-e-Caminh-es. | 2c740dedc5c236b647dbd355bb1efde9adc4b818 | 1f80bb6f9dfa8cb0bd9cff6ec55401647535cf91 | refs/heads/master | 2021-08-19T03:54:51.040552 | 2017-11-24T16:52:39 | 2017-11-24T16:52:39 | 111,939,382 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 191 | java |
public class Motor extends Executa{
public int getPotencia() {
return Potencia;
}
public void setPotencia(int potencia) {
Potencia = potencia;
}
int Potencia ;
}
| [
"noreply@github.com"
] | noreply@github.com |
df8e6cdaa3ee80c09048df786e76640891841ef6 | 39e261eafc6494ae9f40d0ab106f96ca36c630c7 | /src/java/metaData/MetaData.java | e1931ab7cdb6e006910471308bb1d006d35fc959 | [] | no_license | aryner/Photo_Grader | c09034db37ed8727ecc530e50abe90f70e97a7cc | 354a9125eea101fd6bfe1293aaa1498130a7e2ce | refs/heads/master | 2021-01-21T04:54:18.679087 | 2015-11-24T18:47:43 | 2015-11-24T18:47:43 | 31,552,757 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,748 | 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 metaData;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import model.Study;
import model.Photo;
import SQL.Helper;
/**
*
* @author aryner
*/
public class MetaData {
private String name;
private int type;
private int collection;
public static final int INTEGER = 1;
public static final int DECIMAL = 2;
public static final int STRING = 3;
public static final int NAME = 1;
public static final int EXCEL = 2;
public static final int CSV = 3;
public static final int MANUAL = 4;
public static final int START = 1;
public static final int END = 2;
public static final int NUMBER = 3;
public static final int DELIMITER = 4;
public static final int BEFORE = 5;
public static final int AFTER = 6;
public static final int NEXT_NUMBER = 7;
public static final int NEXT_LETTER = 8;
public static final int NEXT_NOT_NUMBER = 9;
public static final int NEXT_NOT_LETTER = 10;
public static final int TEXT = 1;
public static final int RADIO = 2;
public static final int CHECKBOX = 3;
public static final int META = 1;
public static final int GRADE = 2;
public MetaData(String name, int type, int collection) {
this.name = Helper.unprocess(name);
this.type = type;
this.collection = collection;
}
public static void makeLists(HttpServletRequest request, ArrayList<MetaData> metaData) {
int maxCount = Integer.parseInt(request.getParameter("maxCount"));
for(int i=0; i<maxCount; i++) {
String name = request.getParameter("name"+i);
if(name != null && !name.equals("")) {
int collect = Integer.parseInt(request.getParameter("collect"+i));
metaData.add(new MetaData(name,STRING,collect));
}
}
}
public static void processDefinitions(Study study, HttpServletRequest request) {
Map<String,String> types = createNameTypeMap(request);
Photo.generateAttributes(study, types);
ArrayList<PhotoNameMetaData> nameMeta = new ArrayList<PhotoNameMetaData>();
getSpecifications(nameMeta,NAME,request,study.getId());
PhotoNameMetaData.updateDB(nameMeta);
ArrayList<TableMetaData> tableMeta = new ArrayList<TableMetaData>();
getSpecifications(tableMeta,EXCEL,request,study.getId());
getSpecifications(tableMeta,CSV,request,study.getId());
TableMetaData.updateDB(tableMeta);
ArrayList<ManualMetaData> manualMeta = new ArrayList<ManualMetaData>();
getSpecifications(manualMeta,MANUAL,request,study.getId());
ManualMetaData.updateDB(manualMeta);
}
private static void getSpecifications(ArrayList meta, int type, HttpServletRequest request, int study_id) {
String identifier = request.getParameter((type == CSV ? "csv" : "excel")+"Identifier");
String identifier_col = request.getParameter((type == CSV ? "csv" : "excel")+"_column_0");
String typeString = type == NAME ? "name" :
type == EXCEL ? "excel" :
type == CSV ? "csv" : "manual";
String stringCount = request.getParameter(typeString+"Count");
int count = Integer.parseInt(stringCount != null ? stringCount : "0");
for(int i=1; i<=count; i++) {
MetaDataSource metaData = type == NAME ? new PhotoNameMetaData() :
type == MANUAL ? new ManualMetaData() : new TableMetaData();
metaData.setFields(study_id,request,i,identifier,identifier_col,type);
meta.add(metaData);
}
}
private static Map<String,String> createNameTypeMap(HttpServletRequest request) {
int metaDataCount = Integer.parseInt(request.getParameter("fieldsLength"));
Map<String,String> dataTypes = new HashMap<String,String>();
for(int i=0; i<metaDataCount; i++) {
String name_type = request.getParameter("data_type_"+i);
dataTypes.put(extractName(name_type),extractType(name_type));
}
return dataTypes;
}
private static String extractName(String name_type) {
return name_type.substring(0,name_type.indexOf("_"));
}
private static String extractType(String name_type) {
return name_type.substring(name_type.indexOf("_")+1);
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the type
*/
public int getType() {
return type;
}
/**
* @param type the type to set
*/
public void setType(int type) {
this.type = type;
}
/**
* @return the collection
*/
public int getCollection() {
return collection;
}
/**
* @param collection the collection to set
*/
public void setCollection(int collection) {
this.collection = collection;
}
}
| [
"aryner@gmail.com"
] | aryner@gmail.com |
23c6bf588ff3abc200afa85211c0ce057fc39acc | 6600e049717b62909e37801be92d19f91f3ed00e | /src/main/java/com/simplicityitself/koans/spring/Repository.java | ba573d69e15d1021dd002f61f8ec0d1cd7c1f1cf | [
"Apache-2.0"
] | permissive | simplicityitself/spring-koans | 794e0b43e2b5b684b542c30d7895ff15fbf6fb0b | c35d05addab5790189fed147f77e16df9efbb573 | refs/heads/master | 2016-09-06T05:50:56.605177 | 2013-02-12T20:39:43 | 2013-02-12T20:39:43 | 7,146,576 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 76 | java | package com.simplicityitself.koans.spring;
public interface Repository {
}
| [
"russ@russmiles.com"
] | russ@russmiles.com |
6048396accf82625384437f056b4c7a1ef8ba386 | e66992be8e95e2690d7d4b09d8f76144b1166d52 | /kumar/src/main/java/kumar1/nil1.java | aa9e7853f01eb2856f97894fe61ac93f48f2ae43 | [] | no_license | nilmanik/kumar | 1bff88cf796bf95384dde7efc2561f8464357e1c | 3b8ada8227c0004e013c5f791c25edc1c4873702 | refs/heads/master | 2020-03-28T17:41:16.126882 | 2018-09-14T16:21:15 | 2018-09-14T16:21:15 | 148,813,653 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 45 | java | package kumar1;
public class nil1 {
}
| [
"nilmani@nilmani-PC"
] | nilmani@nilmani-PC |
254f7afd32b44eb71067948ad082e31b34c7225f | 043f408ec06af4ce1a6d7a5e2a57232cd3847027 | /HttpModuleClientInterface/src/main/java/com/kzl/lib/http/client/interfaces/IAsyncHttpClient.java | 3d74f6c863aac0d110ecfb9558a32107b97639bb | [] | no_license | Alford087/kzl-sModuleLibs | d540c54948c80009ebd8033cd43e7558cc716fb7 | 762b37af1460e0b5eb7e605b31a29cad967903bd | refs/heads/master | 2020-12-28T23:50:03.372134 | 2014-04-22T08:48:39 | 2014-04-22T08:48:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,127 | java | package com.kzl.lib.http.client.interfaces;
import android.content.Context;
import com.kzl.lib.http.client.interfaces.callback.IHttpResponseFilter;
import com.kzl.lib.http.client.interfaces.callback.IHttpResponseHandler;
import com.kzl.lib.http.client.interfaces.model.EmptyHttpRequest;
import com.kzl.lib.http.client.interfaces.model.EmptyHttpResponse;
/**
* http异步请求实现接口
* Project:LuLuModuleLibs<br/>
* Module:HttpModuleProjectInterfaces<br/>
* Email: <A href="kezhenlu@qq.com">kezhenlu@qq.com</A><br/>
* User: kenny.ke<br/>
* Date: 2014/4/21<br/>
* Time: 17:32<br/>
* To change this template use File | Settings | File Templates.
*/
public interface IAsyncHttpClient<T extends EmptyHttpResponse> {
/**
* @param context
* @param requestUrl
* @param request
* @param classOfT
* @param handler
* @param filter
*/
public void execute(Context context, final String requestUrl,
final EmptyHttpRequest request, final Class<T> classOfT,
final IHttpResponseHandler<T> handler, final IHttpResponseFilter filter);
}
| [
"13622922233.sdo"
] | 13622922233.sdo |
da496a9ee318a0765bed52af58e728145c8d1000 | 58122c95facd54c14d10aa5b88a3c931f2c07c47 | /Datas/src/application/Program.java | c977e8eab07c23063defd5badc2c4b3ea7c6a907 | [] | no_license | fabiomattes2016/curso-java | fe8e47b1d6baedb66f48e09e6419769592220415 | a77f159c0c90bf810a978fbc023731ddba9ef07d | refs/heads/master | 2023-03-23T18:29:48.544647 | 2021-03-18T16:35:04 | 2021-03-18T16:35:04 | 267,941,914 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,868 | java | package application;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.util.Date;
import java.util.TimeZone;
public class Program {
public static void main(String[] args) throws ParseException {
SimpleDateFormat sdf1 = new SimpleDateFormat("dd/MM/yyyy");
SimpleDateFormat sdf2 = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
SimpleDateFormat sdf3 = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
sdf3.setTimeZone(TimeZone.getTimeZone("GMT"));
Date x1 = new Date();
Date x2 = new Date(System.currentTimeMillis());
Date x3 = new Date(0L);
Date x4 = new Date(1000L * 60L * 60L * 5L);
Date y1 = sdf1.parse("29/05/2020");
Date y2 = sdf2.parse("29/05/2020 14:07:00");
Date y3 = Date.from(Instant.parse("2020-05-29T16:19:07Z"));
System.out.println("--------------------------");
System.out.println("X1 " + x1);
System.out.println("X2 " + x2);
System.out.println("X3 " + x3);
System.out.println("X4 " + x4);
System.out.println("Y1 " + y1);
System.out.println("Y2 " + y2);
System.out.println("Y3 " + y3);
System.out.println("--------------------------");
System.out.println("X1 " + sdf2.format(x1));
System.out.println("X2 " + sdf2.format(x2));
System.out.println("X3 " + sdf2.format(x3));
System.out.println("X4 " + sdf2.format(x4));
System.out.println("Y1 " + sdf2.format(y1));
System.out.println("Y2 " + sdf2.format(y2));
System.out.println("Y3 " + sdf2.format(y3));
System.out.println("--------------------------");
System.out.println("X1 " + sdf3.format(x1));
System.out.println("X2 " + sdf3.format(x2));
System.out.println("X3 " + sdf3.format(x3));
System.out.println("X4 " + sdf3.format(x4));
System.out.println("Y1 " + sdf3.format(y1));
System.out.println("Y2 " + sdf3.format(y2));
System.out.println("Y3 " + sdf3.format(y3));
}
}
| [
"fabiomattes2007@gmail.com"
] | fabiomattes2007@gmail.com |
5873d2dde01241aacf6e5da38632c8ad14218489 | 4233b8ebc0d857c90be607287d2c89099945c2d7 | /GUIParser/src/guitree/object/IAbstractNode.java | 73b47319f165456bd3c7e2a5a89d010a18fba904 | [] | no_license | ducanhnguyen/uitesting-efg-generation | a3fdf42a6e3d76fc53c924dbd5662bd8f25d861a | 088aabb48d4f24adf30c273a48cb40a626d0ad13 | refs/heads/master | 2021-07-16T03:05:10.007143 | 2017-10-22T13:58:54 | 2017-10-22T13:58:54 | 107,790,098 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 268 | java | package guitree.object;
import java.util.List;
/**
*
* @author ducanhnguyen
*/
public interface IAbstractNode extends INode {
List<IProperty> getProperties();
void setProperties(List<IProperty> properties);
String getValueOfProperty(String propertyName);
}
| [
"anhnd.56@gmail.com"
] | anhnd.56@gmail.com |
03282843d941dd2400b5006c0bc5b74faab825e4 | 6edf618c580a9fd4475bcbf6f99e481f87d1966b | /VideoAndes/src/test/UnicidadTest.java | 516b136e0ba1361c60fa3076d301339b192c8e5b | [] | no_license | jscardona12/Iteracion5 | b7f1532789406bbe94d7602662176ded0eef8453 | 60c06e813e976ba67438f0e290ae5de9e43bf951 | refs/heads/master | 2021-01-18T10:59:32.620964 | 2016-05-24T13:44:41 | 2016-05-24T13:44:51 | 59,379,559 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,515 | java | package test;
import static org.junit.Assert.*;
import java.io.File;
import java.io.FileInputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.Properties;
import org.junit.Test;
import dao.DAOTablaGenerica;
import vos.Salida;
public class UnicidadTest extends DAOTablaGenerica {
private String user;
private String password;
private String url;
private String driver;
private Connection conn;
public UnicidadTest() {
try {
this.url = "jdbc:oracle:thin:@fn3.oracle.virtual.uniandes.edu.co:1521:prod";
this.user = "ISIS2304B061610";
this.password = "pzvWms5XesatHU3U";
this.driver = "oracle.jdbc.driver.OracleDriver";
Class.forName(driver);
// System.out.println("Connecting to: " + url + " With user: " + user);
conn = DriverManager.getConnection(url, user, password);
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void testUnicidad() {
probarConID1000("ALMACEN", "1000");
probarConID1000("BUQUES", "1000, 'X', 'X', 'X', 'X', 'MULTI_PROPOSITO'");
probarConID1000("CARGA", "1000, 'X', null, 0, 0, null");
probarConID1000("MUELLES", "1000, 'X'");
probarConID1000("PERSONAS", "1000, 1, 'X'");
probarConID1000("PUERTOEXTERNO", "1000, 'X', 'X', 'X'");
probarConID1000("ROLUSUARIO", "1000, 'X'");
probarConID1000("USUARIOS", "1000, 1, 'X'");
}
public void probarConID1000(String tabla, String values) {
String sql = "INSERT INTO " + tabla + " VALUES (" + values + ")";
try {
PreparedStatement prepStmt = conn.prepareStatement(sql);
recursos.add(prepStmt);
prepStmt.executeQuery();
} catch (SQLException e) {
e.printStackTrace();
fail("No debería lanzar excepción");
}
try {
PreparedStatement prepStmt = conn.prepareStatement(sql);
recursos.add(prepStmt);
prepStmt.executeQuery();
fail("Debería lanzar excepción");
} catch (SQLException e) {}
String sqlBorrar = "DELETE FROM " + tabla + " WHERE ID=1000";
try {
PreparedStatement prepStmt = conn.prepareStatement(sqlBorrar);
recursos.add(prepStmt);
prepStmt.executeQuery();
assertTrue(true);
} catch (SQLException e) {
e.printStackTrace();
fail("No debería lanzar excepción");
}
}
}
| [
"jj.castro10@uniandes.edu.co"
] | jj.castro10@uniandes.edu.co |
c2a3352ca44861cc7a50a8e11472efda94391708 | fb3a6e3ca10e29629b73086c4abe5bc2229dce8e | /app/src/main/java/com/eggman/localr/interactor/UserInteractor.java | 27191b093c1dc828a249a408171ee83e4c3d6ecf | [
"Apache-2.0"
] | permissive | eggman87/localr-android-mvp | a290556df97baee916dfdff92ae1f8a757ded6e6 | 93eb7de4497aae2e40c471505febf9392b56e876 | refs/heads/master | 2021-01-19T04:12:36.436752 | 2016-08-02T21:02:08 | 2016-08-02T21:02:08 | 64,567,274 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 843 | java | package com.eggman.localr.interactor;
import com.eggman.localr.model.User;
import com.eggman.localr.service.FlickrApi;
import com.eggman.localr.service.model.LoginResponse;
import com.eggman.localr.utils.RxScheduler;
import javax.inject.Inject;
import rx.Observable;
import rx.functions.Func1;
/**
* Created by mharris on 7/30/16.
* eggmanapps.
*/
public class UserInteractor {
private RxScheduler scheduler;
private FlickrApi flickrApi;
@Inject
public UserInteractor(RxScheduler scheduler, FlickrApi flickrApi) {
this.scheduler = scheduler;
this.flickrApi = flickrApi;
}
public Observable<User> validateUserStillAuthenticated() {
return flickrApi.validateToken()
.compose(scheduler.applySchedulers())
.map(loginResponse -> loginResponse.user);
}
}
| [
"mharris@Matthews-MacBook-Pro-2.local"
] | mharris@Matthews-MacBook-Pro-2.local |
e76c81617514fae71454a780af7dbdb8184b4d89 | 88a21329858dd94f81c7b8479e517db75335c595 | /src/main/java/fr/ensimag/deca/codegen/package-info.java | bfae6ad8377c238106225961117912896a5c79b9 | [] | no_license | ChristopheEhret/SE_Project | 4add274f01b6a4e2ed58f529879d24ae83ca3e3d | c7307b5b74e6fa98c399b1472bb2dbdc9e3a9782 | refs/heads/main | 2023-08-11T18:35:29.234589 | 2021-09-21T02:40:58 | 2021-09-21T02:40:58 | 408,665,555 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 231 | java | /**
* Utilities used for IMA code generation.
*
* The code generation itself is implement as methods of the {@link fr.ensimag.deca.tree.Tree}
* class.
*
* @author gl27
* @date 01/01/2021
*/
package fr.ensimag.deca.codegen;
| [
"negeko-inscriptions@hotmail.com"
] | negeko-inscriptions@hotmail.com |
efe6955b6abcb589c0c0a192e37978ba390ac01b | 79a2898a16a4084cce89dd8c850f80044d6ffa65 | /src/Other/Math_Radom.java | fe867e4632a3505a1769af035d0a1a1629bc52e0 | [] | no_license | NguyenVanTu1601/Java_Basic | 4efdbf57a108bc47a88f2dec552deed3ce0b7d44 | 6809e893a10bd2eb90c5714aac4d70104382c7a3 | refs/heads/master | 2020-07-22T13:19:25.461385 | 2019-09-09T03:18:40 | 2019-09-09T03:18:40 | 197,047,582 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 415 | java | package Other;
import java.util.Random;
public class Math_Radom {
public static void main(String[] args) {
int x = (int) (Math.random() * 100);
char y = (char) ((Math.random() * (122-97+1)) + 97);
System.out.println(x);
System.out.println(y);
Random random = new Random();
char z = (char) (random.nextInt(122-97+1) + 97);
System.out.println(z);
}
}
| [
"="
] | = |
745339d3972fd2996af902c1b842deb5f6f3827c | be820c293e79627fb5b454db56f947eca364b6d3 | /src/main/java/com/mike/utils/Constants.java | fef5be884ecfe5a6d667965b7dc140ec0e6a017c | [] | no_license | mikiebrenbren/jwt-poc | 25157faad86bdf28b84f7a3c0e9503666dcbddb1 | 3c883f80b5c0f111fdfd0c6ab61a2ce408531a7d | refs/heads/master | 2021-01-10T06:40:03.685861 | 2016-01-14T03:15:30 | 2016-01-14T03:15:30 | 48,298,357 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 345 | java | package com.mike.utils;
/**
* Created by Michael Brennan on 10/3/15.
*/
public class Constants {
public static final String HELLO = "hello";
//hardcoded user name a passwords meant to be replaced by an authentication scheme
public static final String USERNAME = "username";
public static final String PASSWORD = "pw1234";
}
| [
"mikiebrenbren@gmail.com"
] | mikiebrenbren@gmail.com |
956aa44e76650277e709bfc2b19f677d6550d6da | 0d303dd50228fbd4e89adf632b2c8130adfdfbda | /src/com/javayjm/excel/file/impl/ExcelToModelImpl.java | 27e26658cc1492f44eb3a25ebf1acf4445fee666 | [] | no_license | xiaoran27/packet | 32c98418062d4919265572675b042aedccc10d43 | 8c29989983b8802d9706c1611cbded989a3d6099 | refs/heads/master | 2021-01-10T20:29:13.262459 | 2015-01-06T07:55:07 | 2015-01-06T07:55:07 | 6,806,069 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 16,187 | java | /************************ CHANGE REPORT HISTORY ******************************\
** Product VERSION,UPDATED BY,UPDATE DATE *
* DESCRIPTION OF CHANGE *
*-----------------------------------------------------------------------------*
* Example:
*-----------------------------------------------------------------------------*
* V,xiaoran27,2013-8-20
* + //支持指定sheet
\*************************** END OF CHANGE REPORT HISTORY ********************/
package com.javayjm.excel.file.impl;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import jxl.Sheet;
import jxl.Workbook;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import com.javayjm.excel.config.RuturnConfig;
import com.javayjm.excel.config.RuturnPropertyParam;
import com.javayjm.excel.file.ExcelToModel;
public class ExcelToModelImpl implements ExcelToModel {
private File excelFile = null;
private RuturnConfig excelConfig = null;
private Map valueMap = null;
private List fixityList = null;
public ExcelToModelImpl(File excelFile, RuturnConfig excelConfig,
Map valueMap) {
this.excelConfig = excelConfig;
this.excelFile = excelFile;
this.valueMap = valueMap;
}
/*
* 对于配置文件中,指定取固定值的属性,先取到List中.无则为空
*/
private void setFixity() {
List fixityList = new ArrayList();
Map pmap = this.excelConfig.getPropertyMap();
for (Iterator it = pmap.values().iterator(); it.hasNext();) {
RuturnPropertyParam propertyBean = (RuturnPropertyParam) it.next();
if (propertyBean.getFixity().toUpperCase().trim().equals("YES")) {
fixityList.add(propertyBean);
}
}
this.fixityList = fixityList;
}
public List getModelList() {
if (excelFile.getName().toLowerCase().indexOf(".csv")>=0){
return getModelListByCsv();
}
this.setFixity();
List modelList = new ArrayList();
try {
Workbook book;
book = Workbook.getWorkbook(this.excelFile);
Sheet sheet = book.getSheet(excelConfig.getSheetNo()); //支持指定sheet
for (int i = excelConfig.getStartRow() - 1; i < sheet.getRows(); i++) { //从指定数据行开始
Object obj = this.getModelClass(excelConfig.getClassName());
BeanWrapper bw = new BeanWrapperImpl(obj);
boolean isTitle = true; //标题行跳过
// 对excel每一列的值进行取值.
for (int j = 0; j < sheet.getColumns(); j++) {
// 取得Excel表头
String excelTitleName = sheet.getCell(j, excelConfig.getStartRow()>1?excelConfig.getStartRow()-2:0).getContents()
.trim();
// 取得Excel值
String value = sheet.getCell(j, i).getContents().trim();
isTitle = isTitle && excelTitleName.equals(value);
if (isTitle){
continue;
}
//
// 取得配置属性
RuturnPropertyParam propertyBean = (RuturnPropertyParam) excelConfig.getPropertyMap()
.get(excelTitleName);
if (propertyBean == null) {
propertyBean = (RuturnPropertyParam) excelConfig.getPropertyMap()
.get(excelConfig.getClassName()+"#"+(j+1));
}
//System.out.println("i = " + i + " j =" + j + " value ="+ value + " title = " + excelTitleName);
if (propertyBean != null) {
// //做出判断,是否需要 Text/Value 值转换.
if (propertyBean.getCodeTableName().length() > 1) {
String valueKey = propertyBean.getCodeTableName()
.trim() + value;
Object obj1 = this.valueMap.get(valueKey);
if (obj1 == null) {
value = "";
} else {
value = obj1.toString();
}
}
if ((value == null) || (value.length() < 1)) {
value = propertyBean.getDefaultValue();
}
if (propertyBean.getDataType().equals("java.util.Date")
|| propertyBean.getDataType().equals("Date")
|| propertyBean.getDataType().equals("java.sql.Date")
|| propertyBean.getDataType().equals("java.sql.Timestamp")
|| propertyBean.getDataType().equals("Timestamp")){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = null;
if (value.length()>0){
try {
date = sdf.parse(value);
} catch (Exception e) {
try {
sdf = new SimpleDateFormat("yyyy/MM/dd");
date = sdf.parse(value);
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
bw.setPropertyValue(propertyBean.getName(), date);
}else if (propertyBean.getDataType().equals("int")
|| propertyBean.getDataType().equals("Integer")
|| propertyBean.getDataType().equals("BigInteger")
|| propertyBean.getDataType().equals("long")
|| propertyBean.getDataType().equals("Long")
|| propertyBean.getDataType().equals("short")
|| propertyBean.getDataType().equals("Short") ){
//BigDecimal, BigInteger, Byte, Double, Float, Integer, Long, Short
NumberFormat nf = new DecimalFormat("#####0");
nf.setParseIntegerOnly(true);
Number n = 0;
if (value.length()>0){
try {
n = nf.parse(value);
} catch (Exception e) {
}
}
bw.setPropertyValue(propertyBean.getName(), n);
}else if (propertyBean.getDataType().equals("float")
|| propertyBean.getDataType().equals("Float")
|| propertyBean.getDataType().equals("double")
|| propertyBean.getDataType().equals("Double")
|| propertyBean.getDataType().equals("BigDecimal") ){
NumberFormat nf = new DecimalFormat("#####0.0000") ;
Number n = 0;
if (value.length()>0){
try {
n = nf.parse(value);
} catch (Exception e) {
}
}
bw.setPropertyValue(propertyBean.getName(), n);
}else{
bw.setPropertyValue(propertyBean.getName(), value);
}
}
}
/*
* 设置属性中的固定值.
*/
for (Iterator it = this.fixityList.iterator(); it.hasNext();) {
RuturnPropertyParam propertyBean = (RuturnPropertyParam) it.next();
Object value = this.valueMap.get(propertyBean.getName());
if ((value == null) || (value.toString().length() < 1)) {
value = propertyBean.getDefaultValue();
}
bw.setPropertyValue(propertyBean.getName(), value);
}
if (!isTitle){
modelList.add(obj);
}
}
} catch (Exception e) {
e.printStackTrace();
}
return modelList;
}
public List getModelListByCsv() {
this.setFixity();
List modelList = new ArrayList();
BufferedReader in = null;
try {
in = new BufferedReader(new FileReader(this.excelFile));
String[] titleNames = null;
String[] values = null;
String line = in.readLine();
//从指定数据行开始,
for(int i=1; i<(excelConfig.getStartRow()>1?excelConfig.getStartRow()-1:1); i++){
line = in.readLine();
}
boolean first = true;
while ((null != line) && (line.trim().length() > 0)) {
values = line.split("[, \t]");
if(first){
titleNames = values;
first = false;
}
Object obj = this.getModelClass(excelConfig.getClassName());
BeanWrapper bw = new BeanWrapperImpl(obj);
boolean isTitle = true; //标题行跳过
// 对每一列的值进行取值.
for (int j = 0; j < titleNames.length; j++) {
// 取得表头
String titleName = titleNames[j].trim();
// 取得值
String value = j<values.length?values[j].trim():null;
isTitle = isTitle && titleName.equals(value);
//
// 取得配置属性
RuturnPropertyParam propertyBean = (RuturnPropertyParam) excelConfig.getPropertyMap()
.get(titleName);
if (propertyBean == null) {
propertyBean = (RuturnPropertyParam) excelConfig.getPropertyMap()
.get(excelConfig.getClassName()+"#"+(j+1));
}
if (propertyBean != null) {
// //做出判断,是否需要 Text/Value 值转换.
if (propertyBean.getCodeTableName().length() > 1) {
String valueKey = propertyBean.getCodeTableName()
.trim() + value;
Object obj1 = this.valueMap.get(valueKey);
if (obj1 == null) {
value = "";
} else {
value = obj1.toString();
}
}
if ((value == null) || (value.length() < 1)) {
value = propertyBean.getDefaultValue();
}
if (propertyBean.getDataType().equals("java.util.Date")
|| propertyBean.getDataType().equals("Date")
|| propertyBean.getDataType().equals("java.sql.Date")
|| propertyBean.getDataType().equals("java.sql.Timestamp")
|| propertyBean.getDataType().equals("Timestamp")){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = null;
if (value.length()>0){
try {
date = sdf.parse(value);
} catch (Exception e) {
try {
sdf = new SimpleDateFormat("yyyy/MM/dd");
date = sdf.parse(value);
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
bw.setPropertyValue(propertyBean.getName(), date);
}else if (propertyBean.getDataType().equals("int")
|| propertyBean.getDataType().equals("Integer")
|| propertyBean.getDataType().equals("BigInteger")
|| propertyBean.getDataType().equals("long")
|| propertyBean.getDataType().equals("Long")
|| propertyBean.getDataType().equals("short")
|| propertyBean.getDataType().equals("Short") ){
//BigDecimal, BigInteger, Byte, Double, Float, Integer, Long, Short
NumberFormat nf = new DecimalFormat("#####0");
nf.setParseIntegerOnly(true);
Number n = 0;
if (value.length()>0){
try {
n = nf.parse(value);
} catch (Exception e) {
}
}
bw.setPropertyValue(propertyBean.getName(), n);
}else if (propertyBean.getDataType().equals("float")
|| propertyBean.getDataType().equals("Float")
|| propertyBean.getDataType().equals("double")
|| propertyBean.getDataType().equals("Double")
|| propertyBean.getDataType().equals("BigDecimal") ){
NumberFormat nf = new DecimalFormat("#####0.0000") ;
Number n = 0;
if (value.length()>0){
try {
n = nf.parse(value);
} catch (Exception e) {
}
}
bw.setPropertyValue(propertyBean.getName(), n);
}else{
bw.setPropertyValue(propertyBean.getName(), value);
}
}
}
/*
* 设置属性中的固定值.
*/
for (Iterator it = this.fixityList.iterator(); it.hasNext();) {
RuturnPropertyParam propertyBean = (RuturnPropertyParam) it.next();
Object value = this.valueMap.get(propertyBean.getName());
if ((value == null) || (value.toString().length() < 1)) {
value = propertyBean.getDefaultValue();
}
bw.setPropertyValue(propertyBean.getName(), value);
}
if (!isTitle){
modelList.add(obj);
}
/*read next*/
line = in.readLine();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (null != in) {
try {
in.close();
} catch (IOException e) {
}
}
}
return modelList;
}
@SuppressWarnings("unused")
private Object getModelClass(String className) {
Object obj = null;
try {
obj = Class.forName(className).newInstance();
} catch (Exception e) {
e.printStackTrace();
}
return obj;
}
}
| [
"xiaoran27@163.com"
] | xiaoran27@163.com |
4e2e0476d9016b9b6bec69cefff9c3dead834ed4 | 5bd650a63ba215376df135b42fa91720a7393653 | /src/main/java/com/nioya/plak/ServletInitializer.java | db4b66305eedef6ecd2e96464311b93827ad8e37 | [] | no_license | emrahonder/Plak-Store-Application | 0263f0258d9a30d3513b6af5a1635fb8f0d054f3 | 6d92e7b0a55f92499dbd4ce2d2427745309c23ed | refs/heads/main | 2023-03-18T05:29:03.699556 | 2021-03-21T16:01:27 | 2021-03-21T16:01:27 | 346,059,584 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 417 | java | package com.nioya.plak;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(PlakApplication.class);
}
}
| [
"emrahonder@gmail.com"
] | emrahonder@gmail.com |
9056532d9379da2432744bc732fd2a816e180daa | 477d7d3f2c3bd8fb9ba6434be478a050e577e1e6 | /app/src/androidTest/java/kenhlaptrinh/net/pingicmp/ExampleInstrumentedTest.java | 9cde3bc55655b323b4564fe9eb0d7fa0045f9162 | [] | no_license | NinhvanLuyen/PingICMP | c885af6e5c9df497edfa15a40cb9c3f105c2d0e2 | cd0ca77c5ab91d0659e0b1efe5ade71834b3932b | refs/heads/master | 2020-03-11T22:55:07.467413 | 2018-04-20T06:59:37 | 2018-04-20T06:59:37 | 130,306,843 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 754 | java | package kenhlaptrinh.net.pingicmp;
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.*;
/**
* Instrumentation 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() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("kenhlaptrinh.net.pingicmp", appContext.getPackageName());
}
}
| [
"luyen@mysquar.com"
] | luyen@mysquar.com |
56070adde6d9ed2d4229f83545dd336c18169bea | d5e5129850e4332a8d4ccdcecef81c84220538d9 | /Programming Team/ProgrammingTeam/src/ship/pacise09/program7.java | 3f05d354b6910e70b84cbdf63b8b44b5e8af2c04 | [] | no_license | ClickerMonkey/ship | e52da76735d6bf388668517c033e58846c6fe017 | 044430be32d4ec385e01deb17de919eda0389d5e | refs/heads/master | 2020-03-18T00:43:52.330132 | 2018-05-22T13:45:14 | 2018-05-22T13:45:14 | 134,109,816 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 460 | java | import java.util.Scanner;
public class program7 {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
while (n > 0) {
double[] cof = new double[n+1];
for (int i = 0; i <= n; i++)
cof[i] = sc.nextDouble();
String mynum = ""
while (int i1 = 0; i1 < 10; i1++) {
is
}
n = sc.nextInt();
} //end?
} //main
public static boolean isGT(double x) {
}
} | [
"pdiffenderfer@gmail.com"
] | pdiffenderfer@gmail.com |
778051288ba21c4469ec4a4dcf847470db35549f | 7b962f2941172f960e4f2060f4cbfb1903ee9227 | /src/main/java/com/example/demo/common/resultbean/MyResult.java | c54cd5e98ef3f2ef2995ed7c1a0629455c0a09be | [] | no_license | macosong/flash-sale-system | e7955f0821f45138fd6199dc6011e41e2df79710 | 9b4ea5cc4cf811a9db0b808f92c815187d9aa58d | refs/heads/master | 2022-06-28T01:34:41.926355 | 2020-03-01T02:58:55 | 2020-03-01T02:58:55 | 218,745,446 | 1 | 0 | null | 2022-06-17T02:38:08 | 2019-10-31T10:57:14 | Java | UTF-8 | Java | false | false | 1,374 | java | package com.example.demo.common.resultbean;
import com.example.demo.common.enums.ResultStatus;
import java.io.Serializable;
/**
* MyResult
*
* @author maco
* @data 2019/10/24
*/
public class MyResult<T> extends AbstractResult implements Serializable {
private static final long serialVersionUID = 867933019328199779L;
private T data;
private Integer count;
protected MyResult(ResultStatus status, String message) {
super(status, message);
}
protected MyResult(ResultStatus status) {
super(status);
}
/**
* 返回到模板的结果对象
*
* @param <T>
* @return
*/
public static <T> MyResult<T> build() {
return new MyResult(ResultStatus.SUCCESS, null);
}
public static <T> MyResult<T> build(String message) {
return new MyResult(ResultStatus.SUCCESS, message);
}
public static <T> MyResult<T> error(ResultStatus status) {
return new MyResult<>(status);
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
public Integer getCount() {
return this.count;
}
public void setCount(Integer count) {
this.count = count;
}
public void success(T value) {
this.success();
this.data = value;
this.count = 0;
}
}
| [
"oracle_sq@sina.com"
] | oracle_sq@sina.com |
a10e7ff97bff465b8b3025938930c1be9c9de7b1 | 4830764ea480d346cda5a36f89e3b8cab050e5e0 | /src/main/java/com/stq/web/controller/mgr/BaseController.java | 5cbd19a6b0d23089fa99e038964eef5fb46bf284 | [] | no_license | chenzude666/tianjin | efdb63fd3648fb7719ac2ce5201c67a4c980e90f | 02442498aee322a31880ec7b1b2635cc02a2a478 | refs/heads/master | 2021-08-18T22:08:26.123270 | 2017-11-24T03:15:36 | 2017-11-24T03:15:36 | 111,871,102 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,555 | java | package com.stq.web.controller.mgr;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.ServletRequestDataBinder;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.servlet.ModelAndView;
import com.google.common.collect.Maps;
import com.stq.base.AppBizException;
import com.stq.base.SessionContext;
import com.stq.util.RandomUtils;
public abstract class BaseController {
private static Logger logger = LoggerFactory.getLogger(BaseController.class);
public static final String SUCCESS_MESSAGE = "SUCCESS_MESSAGE";
@ExceptionHandler({Exception.class, AppBizException.class})
public ModelAndView handleException(Exception ex, HttpServletRequest request) {
logger.error("Exception:", ex);
ModelAndView mav = new ModelAndView();
mav.addObject("message", ex.getMessage());
mav.setViewName("error");
return mav;
}
@Value("#{envProps.imagepath}")
private String filePath;
@InitBinder
protected void initBinder(ServletRequestDataBinder binder){
binder.registerCustomEditor(Date.class,new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd HH:mm"), true));
}
public SessionContext getSessionContext(){
return (SessionContext)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
}
protected String genFileName(String name){
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHH");
StringBuilder finFileName = new StringBuilder(sdf.format(new Date()));
finFileName.append( RandomUtils.get(5));
finFileName.append(name);
return finFileName.toString();
}
protected String genPath(String projectName){
SimpleDateFormat sdfYear = new SimpleDateFormat("yyyy");
SimpleDateFormat sdfMonth = new SimpleDateFormat("MM");
String fullPath= projectName + "/" + sdfYear.format(new Date()) + "/" + sdfMonth.format(new Date());
File file=new File(fullPath);
if(!file.exists()){
file.mkdirs();
}
return fullPath;
}
public final static Map<String, String> SUCCESS_RESULT = new HashMap<String, String>();
static{
SUCCESS_RESULT.put("status", "success");
}
}
| [
"chenzude@idatage.com"
] | chenzude@idatage.com |
7f612ff78f6434d34550c4cefd766c2d6594b5e7 | dd95c08fb74a9869083a9b226ecabd2439d30d81 | /corelibrary/src/main/java/com/ys/simple/corelibrary/utils/PackageParserCompat.java | 1e43c736326a534675ac7df11c3c25966c423062 | [] | no_license | sarah21cn/SimpleVirtualApk | 1b5e4a45a00cda7ba9f3c22abd5876a5bded49de | 1021058afde1430140f3ee6b86feff40c1e4b800 | refs/heads/main | 2023-01-04T14:27:34.587408 | 2020-10-29T03:59:21 | 2020-10-29T03:59:21 | 303,665,136 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,779 | java | /*
* Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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.ys.simple.corelibrary.utils;
import java.io.File;
import android.content.Context;
import android.content.pm.PackageParser;
import android.os.Build;
/**
* @author johnsonlee
*/
public final class PackageParserCompat {
public static final PackageParser.Package parsePackage(final Context context, final File apk, final int flags) {
try {
if (Build.VERSION.SDK_INT >= 28
|| (Build.VERSION.SDK_INT == 27 && Build.VERSION.PREVIEW_SDK_INT != 0)) { // Android P Preview
return PackageParserPPreview.parsePackage(context, apk, flags);
} else if (Build.VERSION.SDK_INT >= 24) {
return PackageParserV24.parsePackage(context, apk, flags);
} else if (Build.VERSION.SDK_INT >= 21) {
return PackageParserLollipop.parsePackage(context, apk, flags);
} else {
return PackageParserLegacy.parsePackage(context, apk, flags);
}
} catch (Throwable e) {
throw new RuntimeException("error", e);
}
}
private static final class PackageParserPPreview {
static final PackageParser.Package parsePackage(Context context, File apk, int flags) throws
Throwable {
PackageParser parser = new PackageParser();
PackageParser.Package pkg = parser.parsePackage(apk, flags);
Reflector.with(parser)
.method("collectCertificates", PackageParser.Package.class, boolean.class)
.call(pkg, false);
return pkg;
}
}
private static final class PackageParserV24 {
static final PackageParser.Package parsePackage(Context context, File apk, int flags) throws
Throwable {
PackageParser parser = new PackageParser();
PackageParser.Package pkg = parser.parsePackage(apk, flags);
Reflector.with(parser)
.method("collectCertificates", PackageParser.Package.class, int.class)
.call(pkg, flags);
return pkg;
}
}
private static final class PackageParserLollipop {
static final PackageParser.Package parsePackage(final Context context, final File apk, final int flags) throws
Throwable {
PackageParser parser = new PackageParser();
PackageParser.Package pkg = parser.parsePackage(apk, flags);
parser.collectCertificates(pkg, flags);
return pkg;
}
}
private static final class PackageParserLegacy {
static final PackageParser.Package parsePackage(Context context, File apk, int flags) throws
Throwable {
PackageParser parser = new PackageParser(apk.getAbsolutePath());
PackageParser.Package pkg = parser.parsePackage(apk, apk.getAbsolutePath(), context.getResources().getDisplayMetrics(), flags);
Reflector.with(parser)
.method("collectCertificates", PackageParser.Package.class, int.class)
.call(pkg, flags);
return pkg;
}
}
} | [
"yinshan@kuaishou.com"
] | yinshan@kuaishou.com |
49c53260798cdfc0ee434efda7071ec508bf4f2d | 435afa9f60e0b35d5d5b547b96655e0c1eb3e323 | /maven1/src/main/java/Chocolates.java | 7bc967234bd6b69cb432d8f7a8a70621cc8df217 | [] | no_license | BindhuBhargavi/maven1 | 292e640349115432dd55e1cef51275785f9b36bd | 96fe976f41396c19d055ed3286a4cacf873ec222 | refs/heads/master | 2020-12-29T15:44:56.625287 | 2020-02-06T10:05:27 | 2020-02-06T10:05:27 | 238,657,811 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 428 | java |
public class Chocolates {
int count;
public void finds(float[] st, float m) {
count = 0;
for (int i = 0; i < st.length; i++) {
if (st[i] == m) {
count++;
}
}
System.out.println("\nNumber of Occurrence of the Element:" + count);
}
}
class fuze extends Chocolates
{
public void printfun()
{
System.out.println("fuze");
}
}
| [
"bindhubhargavi621@gmail.com"
] | bindhubhargavi621@gmail.com |
3c7cbee004980b660d76645a9a8028b35728ac1d | f7b7a480c84fa94e1676193483a55b07e66622f3 | /springturnering/src/main/java/com/example/requests/UpdatePlayerRequest.java | 247b47cff9ff8e1770651c90846089b7e085bef7 | [] | no_license | JacobIngvarsson/init-spring-turnering | 2edb644640007d69ae0099452c8ceeb47a961b5e | 681ace51bb7a76a834d60d480d77de07633c26c9 | refs/heads/dev | 2023-05-05T20:45:09.624168 | 2021-05-28T12:36:30 | 2021-05-28T12:36:30 | 364,548,363 | 0 | 0 | null | 2021-05-28T12:36:30 | 2021-05-05T11:05:56 | Java | UTF-8 | Java | false | false | 228 | java | package com.example.requests;
public class UpdatePlayerRequest {
private String lastName;
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
6fd0bc5f590be7333380de0205756db231f1d7c8 | 89b04fe4a941a41a3b69e64be3662ef18fd94375 | /junit-servers-tomcat-10/src/test/java/com/github/mjeanroy/junit/servers/tomcat10/junit4/TomcatServerJunit4RunnerTest.java | 02699c4267c5c2a5c32bf7d07ce992a0659e7e84 | [
"MIT"
] | permissive | mjeanroy/junit-servers | a59bbb842df6ab528d75387cc44045c8dae6c87f | f74487bf0842c50425bea26f5d222acc82048ded | refs/heads/master | 2023-08-31T12:12:24.951659 | 2023-07-24T07:04:09 | 2023-08-14T16:12:53 | 22,883,472 | 33 | 14 | MIT | 2023-09-11T12:40:37 | 2014-08-12T15:57:41 | Java | UTF-8 | Java | false | false | 3,961 | java | /**
* The MIT License (MIT)
*
* Copyright (c) 2014-2022 <mickael.jeanroy@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.github.mjeanroy.junit.servers.tomcat10.junit4;
import com.github.mjeanroy.junit.servers.annotations.TestServer;
import com.github.mjeanroy.junit.servers.annotations.TestServerConfiguration;
import com.github.mjeanroy.junit.servers.servers.AbstractConfiguration;
import com.github.mjeanroy.junit.servers.servers.EmbeddedServer;
import com.github.mjeanroy.junit.servers.tomcat.EmbeddedTomcatConfiguration;
import com.github.mjeanroy.junit.servers.tomcat10.EmbeddedTomcat;
import org.junit.Ignore;
import org.junit.jupiter.api.Test;
import static com.github.mjeanroy.junit.servers.tomcat.EmbeddedTomcatConfiguration.defaultConfiguration;
import static org.apache.commons.lang3.reflect.FieldUtils.readField;
import static org.assertj.core.api.Assertions.assertThat;
class TomcatServerJunit4RunnerTest {
private static final EmbeddedTomcatConfiguration configuration = defaultConfiguration();
@Test
void it_should_instantiate_tomcat_with_default_configuration() throws Exception {
final TomcatServerJunit4Runner runner = createRunner(TestClassWithInjectedConfiguration.class);
final EmbeddedServer<?> server = (EmbeddedServer<?>) readField(runner, "server", true);
final AbstractConfiguration conf = (AbstractConfiguration) readField(runner, "configuration", true);
assertThat(server).isInstanceOf(EmbeddedTomcat.class);
assertThat(conf).isInstanceOf(EmbeddedTomcatConfiguration.class).isNotSameAs(configuration);
}
@Test
void it_should_instantiate_tomcat_with_configuration() throws Exception {
final TomcatServerJunit4Runner runner = createRunner(TestClassWithConfigurationInitializer.class);
final EmbeddedServer<?> server = (EmbeddedServer<?>) readField(runner, "server", true);
final AbstractConfiguration conf = (AbstractConfiguration) readField(runner, "configuration", true);
assertThat(server).isInstanceOf(EmbeddedTomcat.class);
assertThat(conf).isInstanceOf(EmbeddedTomcatConfiguration.class).isSameAs(configuration);
}
private static TomcatServerJunit4Runner createRunner(Class<?> klass) throws Exception {
return new TomcatServerJunit4Runner(klass);
}
@Ignore
public static class TestClassWithInjectedConfiguration {
@TestServer
private static EmbeddedServer<?> server;
@TestServerConfiguration
private static EmbeddedTomcatConfiguration configuration;
public TestClassWithInjectedConfiguration() {
}
@org.junit.Test
public void fooTest() {
}
}
@Ignore
public static class TestClassWithConfigurationInitializer {
@TestServer
private static EmbeddedServer<?> server;
@TestServerConfiguration
private static EmbeddedTomcatConfiguration initConfiguration() {
return configuration;
}
public TestClassWithConfigurationInitializer() {
}
@org.junit.Test
public void fooTest() {
}
}
}
| [
"mickael.jeanroy@gmail.com"
] | mickael.jeanroy@gmail.com |
1669cfed3ce7ca61b6d732d883a1955265b34002 | 46a62c499faaa64fe3cce2356c8b229e9c4c9c49 | /taobao-sdk-java-standard/taobao-sdk-java-online_standard-20120923-source/com/taobao/api/request/DeliveryTemplateGetRequest.java | a0bd8e85b6502da13ecab27c98a8cba07fa54e2c | [] | no_license | xjwangliang/learning-python | 4ed40ff741051b28774585ef476ed59963eee579 | da74bd7e466cd67565416b28429ed4c42e6a298f | refs/heads/master | 2021-01-01T15:41:22.572679 | 2015-04-27T14:09:50 | 2015-04-27T14:09:50 | 5,881,815 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,319 | java | package com.taobao.api.request;
import com.taobao.api.internal.util.RequestCheckUtils;
import java.util.Map;
import com.taobao.api.TaobaoRequest;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.response.DeliveryTemplateGetResponse;
import com.taobao.api.ApiRuleException;
/**
* TOP API: taobao.delivery.template.get request
*
* @author auto create
* @since 1.0, 2012-09-23 16:46:03
*/
public class DeliveryTemplateGetRequest implements TaobaoRequest<DeliveryTemplateGetResponse> {
private TaobaoHashMap udfParams; // add user-defined text parameters
private Long timestamp;
/**
* 需返回的字段列表。 <br/>
<B>
可选值:示例中的值;各字段之间用","隔开
</B>
<br/><br/>
<font color=blue>
template_id:查询模板ID <br/>
template_name:查询模板名称 <br/>
assumer:查询服务承担放 <br/>
valuation:查询计价规则 <br/>
supports:查询增值服务列表 <br/>
created:查询模板创建时间 <br/>
modified:查询修改时间<br/>
consign_area_id:运费模板上设置的卖家发货地址最小级别ID<br/>
address:卖家地址信息
</font>
<br/><br/>
<font color=bule>
query_cod:查询货到付款运费信息<br/>
query_post:查询平邮运费信息 <br/>
query_express:查询快递公司运费信息 <br/>
query_ems:查询EMS运费信息<br/>
query_bzsd:查询普通保障速递运费信息<br/>
query_wlb:查询物流宝保障速递运费信息<br/>
query_furniture:查询家装物流运费信息
<font color=blue>
<br/><br/>
<font color=red>不能有空格</font>
*/
private String fields;
/**
* 需要查询的运费模板ID列表
*/
private String templateIds;
/**
* 在没有登录的情况下根据淘宝用户昵称查询指定的模板
*/
private String userNick;
public void setFields(String fields) {
this.fields = fields;
}
public String getFields() {
return this.fields;
}
public void setTemplateIds(String templateIds) {
this.templateIds = templateIds;
}
public String getTemplateIds() {
return this.templateIds;
}
public void setUserNick(String userNick) {
this.userNick = userNick;
}
public String getUserNick() {
return this.userNick;
}
public Long getTimestamp() {
return this.timestamp;
}
public void setTimestamp(Long timestamp) {
this.timestamp = timestamp;
}
public String getApiMethodName() {
return "taobao.delivery.template.get";
}
public Map<String, String> getTextParams() {
TaobaoHashMap txtParams = new TaobaoHashMap();
txtParams.put("fields", this.fields);
txtParams.put("template_ids", this.templateIds);
txtParams.put("user_nick", this.userNick);
if(this.udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public void putOtherTextParam(String key, String value) {
if(this.udfParams == null) {
this.udfParams = new TaobaoHashMap();
}
this.udfParams.put(key, value);
}
public Class<DeliveryTemplateGetResponse> getResponseClass() {
return DeliveryTemplateGetResponse.class;
}
public void check() throws ApiRuleException {
RequestCheckUtils.checkNotEmpty(fields,"fields");
RequestCheckUtils.checkNotEmpty(templateIds,"templateIds");
}
}
| [
"shigushuyuan@gmail.com"
] | shigushuyuan@gmail.com |
246106eec7b9b6ae1337b0de45b092812539729d | 1b690158dd8bdbf9ec967fb375fc6f8c157b65a7 | /src/main/java/com/viaplay/api/exceptions/ViaplayCoverArtArchiveUnparsableResponseException.java | 4ad2c334a2ee22c73862504033c6de24be1dbffa | [] | no_license | gjavolce/viap_demo_api | 581091204b492c47a31d3cae23e491d380ff2348 | 152543dfeb2c5369d923684d8e2f47b8d1e23101 | refs/heads/master | 2020-03-22T06:39:14.770441 | 2018-07-04T09:00:09 | 2018-07-04T09:00:09 | 139,648,649 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 375 | java | package com.viaplay.api.exceptions;
public class ViaplayCoverArtArchiveUnparsableResponseException extends Exception {
public ViaplayCoverArtArchiveUnparsableResponseException(String message) {
super(message);
}
public ViaplayCoverArtArchiveUnparsableResponseException(String message, Throwable throwable) {
super(message, throwable);
}
}
| [
"gjavolce@gmail.com"
] | gjavolce@gmail.com |
af56ff40f7a630054958097b6732beff90cf5acc | 8044b8ecd2ead831ebef36a90c78247776624e6a | /app/src/main/java/com/zwhd/appbase/reciver/AppInstallSuccessReciver.java | 1f7e44392ec8b29d0d1f32a3430e0f1877f4b260 | [] | no_license | ZHENGZX123/Appbase3 | e9b7a9e197eb8ed5895524ef3b237dd1d4cba479 | 44667b7fff3496ae12c14fc382cd7814ed80f3f2 | refs/heads/master | 2021-01-01T19:28:03.653710 | 2017-07-28T02:09:33 | 2017-07-28T02:09:33 | 98,597,181 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,983 | java | package com.zwhd.appbase.reciver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import com.zwhd.appbase.IConstant;
import com.zwhd.appbase.IUrconstant;
import com.zwhd.appbase.http.BaseHttpConnectPool;
import com.zwhd.appbase.http.BaseHttpHandler;
import com.zwhd.appbase.http.HttpHandler;
import com.zwhd.appbase.http.HttpResponseModel;
import com.zwhd.appbase.util.AppUtil;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONObject;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 积分墙应用安装拦截
*
* @author YI
*/
public final class AppInstallSuccessReciver extends BroadcastReceiver implements HttpHandler {
final BaseHttpHandler handler = new BaseHttpHandler(this) {
};
Context context;
@Override
public void onReceive(Context context, Intent intent) {
this.context = context;
String action = intent.getAction();
if (action != null && action.startsWith(Intent.ACTION_PACKAGE_ADDED)) {
String pkgName = intent.getData().getSchemeSpecificPart();
AppUtil.startAPP(context, pkgName);
Map<String, String> params = new HashMap<>();
params.put("imei", AppUtil.getImei(context));
params.put("packagename", pkgName);
params.put("channel", AppUtil.readMetaDataByName(context, "UMENG_CHANNEL"));
IConstant.HTTP_CONNECT_POOL.addRequest(IUrconstant.INSTALL_SUCCESS_UPLOAD_URL, params, handler);
}
}
@Override
public void success(HttpResponseModel message) throws Exception {
}
@Override
public void error(HttpResponseModel message) throws Exception {
}
@Override
public void httpErr() throws Exception {
}
@Override
public void httpSuccess(HttpResponseModel message) throws Exception {
}
}
| [
"656701179@qq.com"
] | 656701179@qq.com |
6efaf0b5d3ce2eb532e27ea01e15c25709839ecc | afc94eecda1baa11b4d0beb5c011534478f9cf58 | /src/Lesson160.java | f5115ba5b91268a65bfc148e1f4abee7e059da2e | [] | no_license | gui66497/LeetCode_Learn | d4c10a36b7386a947b844b4a261da9d1bafe55fe | 039869eee3f55192ea62d86fde3a9fbe0a5b5e26 | refs/heads/main | 2023-04-19T02:09:29.439836 | 2021-04-29T02:44:07 | 2021-04-29T02:44:07 | 306,685,626 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,462 | java | // 160. 相交链表
// 编写一个程序,找到两个单链表相交的起始节点。
// 如下面的两个链表:
// 在节点 c1 开始相交。
// 示例 1:
// 输入:intersectVal = 8, listA = [4,1,8,4,5], listB = [5,0,1,8,4,5], skipA = 2, skipB = 3
// 输出:Reference of the node with value = 8
// 输入解释:相交节点的值为 8 (注意,如果两个链表相交则不能为 0)。从各自的表头开始算起,链表 A 为 [4,1,8,4,5],链表 B 为 [5,0,1,8,4,5]。在 A 中,相交节点前有 2 个节点;在 B 中,相交节点前有 3 个节点。
// 示例 2:
// 输入:intersectVal = 2, listA = [0,9,1,2,4], listB = [3,2,4], skipA = 3, skipB = 1
// 输出:Reference of the node with value = 2
// 输入解释:相交节点的值为 2 (注意,如果两个链表相交则不能为 0)。从各自的表头开始算起,链表 A 为 [0,9,1,2,4],链表 B 为 [3,2,4]。在 A 中,相交节点前有 3 个节点;在 B 中,相交节点前有 1 个节点。
// 示例 3:
// 输入:intersectVal = 0, listA = [2,6,4], listB = [1,5], skipA = 3, skipB = 2
// 输出:null
// 输入解释:从各自的表头开始算起,链表 A 为 [2,6,4],链表 B 为 [1,5]。由于这两个链表不相交,所以 intersectVal 必须为 0,而 skipA 和 skipB 可以是任意值。
// 解释:这两个链表不相交,因此返回 null。
// 注意:
// 如果两个链表没有交点,返回 null.
// 在返回结果后,两个链表仍须保持原有的结构。
// 可假定整个链表结构中没有循环。
// 程序尽量满足 O(n) 时间复杂度,且仅用 O(1) 内存。
class Lesson160 {
public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
// 走到尽头见不到你,于是走过你来时的路,等到相遇时才发现,你也走过我来时的路。
if (headA == null || headB == null)
return null;
ListNode a = headA;
ListNode b = headB;
while (a != b) {
a = a == null ? headB : a.next;
b = b == null ? headA : b.next;
}
return a;
}
public static void main(String[] args) {
ListNode head = new ListNode(1);
head.next = new ListNode(2);
head.next.next = new ListNode(3);
Lesson160 solution = new Lesson160();
ListNode res = solution.getIntersectionNode(head, head);
System.out.println(res);
}
}
| [
"gui66497@hotmail.com"
] | gui66497@hotmail.com |
0fe741671725419b6ddc235793834550e745d052 | 5f4e84bab41eb366236e4a4d1991128ff2da363a | /hawkular-inventory-json-helper/src/main/java/org/hawkular/inventory/json/mixins/EnvironmentMixin.java | 8fd1a82c288e3e654b507f84ca4a3a11d09c1dbf | [
"Apache-2.0"
] | permissive | karelhala/hawkular-inventory | c16fc216b1e518a33282b3d0d8dc7267a3bca647 | 8620a7ffb2eea0c994705217b59768e89dca57e8 | refs/heads/master | 2020-12-26T02:32:43.662219 | 2015-12-04T14:08:40 | 2015-12-04T14:08:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,166 | java | /*
* Copyright 2015 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hawkular.inventory.json.mixins;
import java.util.Map;
import org.hawkular.inventory.api.model.CanonicalPath;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* @author Lukas Krejci
* @since 0.2.0
*/
public final class EnvironmentMixin {
@JsonCreator
public EnvironmentMixin(@JsonProperty("path") CanonicalPath path,
@JsonProperty("properties") Map<String, Object> properties) {
}
}
| [
"lkrejci@redhat.com"
] | lkrejci@redhat.com |
af3b459ccdeaed62151b6b009ea971a7b99984cf | ba66137f6f43c071da30e58e3c2e247d61dfab61 | /microservices/product-composite-service/src/main/java/io/github/ddojai/channel/composite/product/services/ProductCompositeServiceImpl.java | 896f25a9bbc15d0540541abee123c77b4d011a76 | [] | no_license | ddojai/channel | dce31fa30381733d1d564dc8994a14dcad6b0c69 | 441b58ad4a8b9aead7413425b8ba6013a6b623d6 | refs/heads/main | 2023-07-04T21:07:40.875279 | 2021-08-29T13:10:28 | 2021-08-29T13:53:21 | 345,576,339 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,301 | java | package io.github.ddojai.channel.composite.product.services;
import io.github.ddojai.api.composite.product.*;
import io.github.ddojai.api.core.product.Product;
import io.github.ddojai.api.core.recommendation.Recommendation;
import io.github.ddojai.api.core.review.Review;
import io.github.ddojai.util.exceptions.NotFoundException;
import io.github.ddojai.util.http.ServiceUtil;
import io.github.resilience4j.circuitbreaker.CallNotPermittedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.ReactiveSecurityContextHolder;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextImpl;
import org.springframework.security.oauth2.jwt.Jwt;
import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
import java.net.URL;
import java.util.List;
import java.util.stream.Collectors;
@RestController
public class ProductCompositeServiceImpl implements ProductCompositeService {
private static final Logger LOG = LoggerFactory.getLogger(ProductCompositeServiceImpl.class);
private final SecurityContext nullSC = new SecurityContextImpl();
private final ServiceUtil serviceUtil;
private final ProductCompositeIntegration integration;
@Autowired
public ProductCompositeServiceImpl(ServiceUtil serviceUtil, ProductCompositeIntegration integration) {
this.serviceUtil = serviceUtil;
this.integration = integration;
}
@Override
public Mono<Void> createCompositeProduct(ProductAggregate body) {
return ReactiveSecurityContextHolder.getContext().doOnSuccess(sc -> internalCreateCompositeProduct(sc, body)).then();
}
public void internalCreateCompositeProduct(SecurityContext sc, ProductAggregate body) {
try {
logAuthorizationInfo(sc);
LOG.debug("createCompositeProduct: creates a new composite entity for productId: {}", body.getProductId());
Product product = new Product(body.getProductId(), body.getName(), body.getWeight(), null);
integration.createProduct(product);
if (body.getRecommendations() != null) {
body.getRecommendations().forEach(r -> {
Recommendation recommendation = new Recommendation(body.getProductId(), r.getRecommendationId(), r.getAuthor(), r.getRate(), r.getContent(), null);
integration.createRecommendation(recommendation);
});
}
if (body.getReviews() != null) {
body.getReviews().forEach(r -> {
Review review = new Review(body.getProductId(), r.getReviewId(), r.getAuthor(), r.getSubject(), r.getContent(), null);
integration.createReview(review);
});
}
LOG.debug("createCompositeProduct: composite entities created for productId: {}", body.getProductId());
} catch (RuntimeException re) {
LOG.warn("createCompositeProduct failed: {}", re.toString());
throw re;
}
}
@Override
public Mono<ProductAggregate> getCompositeProduct(int productId, int delay, int faultPercent) {
return Mono.zip(
values -> createProductAggregate((SecurityContext) values[0], (Product) values[1], (List<Recommendation>) values[2], (List<Review>) values[3], serviceUtil.getServiceAddress()),
ReactiveSecurityContextHolder.getContext().defaultIfEmpty(nullSC),
integration.getProduct(productId, delay, faultPercent)
.onErrorReturn(CallNotPermittedException.class, getProductFallbackValue(productId)),
integration.getRecommendations(productId).collectList(),
integration.getReviews(productId).collectList())
.doOnError(ex -> LOG.warn("getCompositeProduct failed: {}", ex.toString()))
.log();
}
@Override
public Mono<Void> deleteCompositeProduct(int productId) {
return ReactiveSecurityContextHolder.getContext().doOnSuccess(sc -> internalDeleteCompositeProduct(sc, productId)).then();
}
private void internalDeleteCompositeProduct(SecurityContext sc, int productId) {
try {
logAuthorizationInfo(sc);
LOG.debug("deleteCompositeProduct: Deletes a product aggregate for productId: {}", productId);
integration.deleteProduct(productId);
integration.deleteRecommendations(productId);
integration.deleteReviews(productId);
LOG.debug("deleteCompositeProduct: aggregate entities deleted for productId: {}", productId);
} catch (RuntimeException re) {
LOG.warn("deleteCompositeProduct failed: {}", re.toString());
throw re;
}
}
private Product getProductFallbackValue(int productId) {
LOG.warn("Creating a fallback product for productId = {}", productId);
if (productId == 13) {
String errMsg = "Product Id: " + productId + " not found in fallback cache!";
LOG.warn(errMsg);
throw new NotFoundException(errMsg);
}
return new Product(productId, "Fallback product" + productId, productId, serviceUtil.getServiceAddress());
}
private ProductAggregate createProductAggregate(SecurityContext sc, Product product, List<Recommendation> recommendations, List<Review> reviews, String serviceAddress) {
logAuthorizationInfo(sc);
// 1. Setup product info
int productId = product.getProductId();
String name = product.getName();
int weight = product.getWeight();
// 2. Copy summary recommendation info, if available
List<RecommendationSummary> recommendationSummaries = (recommendations == null) ? null :
recommendations.stream()
.map(r -> new RecommendationSummary(r.getRecommendationId(), r.getAuthor(), r.getRate(), r.getContent()))
.collect(Collectors.toList());
// 3. Copy summary review info, if available
List<ReviewSummary> reviewSummaries = (reviews == null) ? null :
reviews.stream()
.map(r -> new ReviewSummary(r.getReviewId(), r.getAuthor(), r.getSubject(), r.getContent()))
.collect(Collectors.toList());
// 4. Create info regarding the involved microservices addresses
String productAddress = product.getServiceAddress();
String reviewAddress = (reviews != null && reviews.size() > 0) ? reviews.get(0).getServiceAddress() : "";
String recommendationAddress = (recommendations != null && recommendations.size() > 0) ? recommendations.get(0).getServiceAddress() : "";
ServiceAddresses serviceAddresses = new ServiceAddresses(serviceAddress, productAddress, reviewAddress, recommendationAddress);
return new ProductAggregate(productId, name, weight, recommendationSummaries, reviewSummaries, serviceAddresses);
}
private void logAuthorizationInfo(SecurityContext sc) {
if (sc != null && sc.getAuthentication() != null && sc.getAuthentication() instanceof JwtAuthenticationToken) {
Jwt jwtToken = ((JwtAuthenticationToken)sc.getAuthentication()).getToken();
logAuthorizationInfo(jwtToken);
} else {
LOG.warn("No JWT based Authentication supplied, running tests are we?");
}
}
private void logAuthorizationInfo(Jwt jwt) {
if (jwt == null) {
LOG.warn("No JWT supplied, running tests are we?");
} else {
if (LOG.isDebugEnabled()) {
URL issuer = jwt.getIssuer();
List<String> audience = jwt.getAudience();
Object subject = jwt.getClaims().get("sub");
Object scopes = jwt.getClaims().get("scope");
Object expires = jwt.getClaims().get("exp");
LOG.debug("Authorization info: Subject: {}, scopes: {}, expires {}: issuer: {}, audience: {}", subject, scopes, expires, issuer, audience);
}
}
}
} | [
"favianred@gmail.com"
] | favianred@gmail.com |
05d9fe02440e29d1e582048b18dbd3e41880924d | 83ec15f6cdff2200e2a6751ba580e98b82cb9479 | /FoodandCocktail/app/src/main/java/com/letsrealize/develop/foodandcocktail/SignupActivity.java | f531bef533c01b21381fc7882103ed1b4309e595 | [] | no_license | Davidinho241/NotesBook-master | 867471c50aac9df46668bc7e7e9465991a8c37fa | bcf63406fcb7910be0ce2f92c05551899111f661 | refs/heads/master | 2021-01-22T02:12:51.875841 | 2017-05-24T21:11:52 | 2017-05-24T21:11:52 | 92,337,196 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,320 | java | package com.letsrealize.develop.foodandcocktail;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import butterknife.BindView;
import butterknife.ButterKnife;
public class SignupActivity extends AppCompatActivity {
private static final String TAG = "SignupActivity";
@BindView(R.id.name) EditText _nameText;
@BindView(R.id.email) EditText _emailText;
@BindView(R.id.password) EditText _passwordText;
@BindView(R.id.butn_signup) Button _signupButton;
@BindView(R.id.link_login) TextView _loginLink;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_signup);
ButterKnife.bind(this);
_signupButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
signup();
Intent but1 = new Intent(SignupActivity.this, MainActivity.class);
startActivity(but1);
}
});
_loginLink.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Finish the registration screen and return to the Login activity
finish();
}
});
}
public void signup() {
Log.d(TAG, "Signup");
if (!validate()) {
onSignupFailed();
return;
}
_signupButton.setEnabled(false);
final ProgressDialog progressDialog = new ProgressDialog(SignupActivity.this,
R.style.AppTheme_Dark_Dialog);
progressDialog.setIndeterminate(true);
progressDialog.setMessage("Creating Account...");
progressDialog.show();
String name = _nameText.getText().toString();
String email = _emailText.getText().toString();
String password = _passwordText.getText().toString();
// TODO: Implement your own signup logic here.
new android.os.Handler().postDelayed(
new Runnable() {
public void run() {
// On complete call either onSignupSuccess or onSignupFailed
// depending on success
onSignupSuccess();
// onSignupFailed();
progressDialog.dismiss();
}
}, 3000);
}
public void onSignupSuccess() {
_signupButton.setEnabled(true);
setResult(RESULT_OK, null);
finish();
}
public void onSignupFailed() {
Toast.makeText(getBaseContext(), "Login failed", Toast.LENGTH_LONG).show();
_signupButton.setEnabled(true);
}
public boolean validate() {
boolean valid = true;
String name = _nameText.getText().toString();
String email = _emailText.getText().toString();
String password = _passwordText.getText().toString();
if (name.isEmpty()) {
_nameText.setError("Fill the blank space");
valid = false;
} else {
_nameText.setError(null);
}
if (email.isEmpty() || !android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches()) {
_emailText.setError("enter a valid email address");
valid = false;
} else {
_emailText.setError(null);
}
if (password.isEmpty() || password.length() < 4 || password.length() > 10) {
_passwordText.setError("between 4 and 10 alphanumeric characters");
valid = false;
} else {
_passwordText.setError(null);
}
return valid;
}
}
| [
"David.Kalla@letsrealize.com"
] | David.Kalla@letsrealize.com |
a26f4e254f3326e330916ad100b2cd28568dffc8 | fef9ed7463e73987338a3880b38c7ac2aebadc19 | /src/Library/AcademicJournal.java | 832d4db3f831f8bffafb1a8be65c65dfd8a28699 | [] | no_license | nawidm/QAexercises | d0a1f2314f533e0eddba2615eac6d076c87807dd | ef094087767e9feda828d67d600727c1b15d195a | refs/heads/master | 2020-03-17T17:25:02.048970 | 2018-05-22T16:26:15 | 2018-05-22T16:26:15 | 133,787,397 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 660 | java | package Library;
public class AcademicJournal extends ReadingMaterial{
String author;
String topic;
public AcademicJournal(String name, String author, String topic) {
super(name);
this.author = author;
this.topic = topic;
}
public String read() {
setNumberOfReads(getNumberOfReads()+1);
return getName()+" has supposedly been read "+getNumberOfReads()+" times (Thats a lie, nobody reads this stuff)";
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getTopic() {
return topic;
}
public void setTopic(String topic) {
this.topic = topic;
}
}
| [
"nawid_m@hotmail.co.uk"
] | nawid_m@hotmail.co.uk |
1d986a59b4a65b3f8938c10140658e75e58a11f9 | d180b8b521a2e581635f33525605723e5f993a45 | /cadastroAlunos/src/cadastroalunos/Mensalidade.java | 9ac1c57b829a7211e7e0b8143d5000c505bd9da8 | [] | no_license | SenaiTI07BD/netbeansBD | 26845dacd2e6e85848debef0f3dbf90ce1268d7d | 548c4da5df349e5a63ddab9020cee4543ca70453 | refs/heads/master | 2020-03-28T14:42:03.873826 | 2018-09-26T19:34:42 | 2018-09-26T19:34:42 | 148,513,100 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,078 | 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 cadastroalunos;
/**
*
* @author senai
*/
public class Mensalidade{
private int numParcelas;
private float valor;
private String dataVencimento;
private String dataPagamento;
public int getNumParcelas() {
return numParcelas;
}
public void setNumParcelas(int numParcelas) {
this.numParcelas = numParcelas;
}
public float getValor() {
return valor;
}
public void setValor(float valor) {
this.valor = valor;
}
public String getDataVencimento() {
return dataVencimento;
}
public void setDataVencimento(String dataVencimento) {
this.dataVencimento = dataVencimento;
}
public String getDataPagamento() {
return dataPagamento;
}
public void setDataPagamento(String dataPagamento) {
this.dataPagamento = dataPagamento;
}
}
| [
"40775797+BrunoHoshino@users.noreply.github.com"
] | 40775797+BrunoHoshino@users.noreply.github.com |
0ca7d4070ee999ec3458092b596b966468ad1a2f | 960db256a00ff49261f0b03e9d7607aa7134ad19 | /herancasimples01/model/DesenvolvedorJuniorHS.java | 5052bb8dfd677ab2d476dd74023aabc61e8b9903 | [] | no_license | JeanMaxSKrebs/aula_OO_21 | 6f9bc0772c6cd7da2373c26694a9dd3c64a2d9f9 | fabedec8ffd09c70abc96a3a714a342a482c26fb | refs/heads/master | 2023-04-30T23:52:55.331668 | 2021-05-20T11:49:15 | 2021-05-20T11:49:15 | 352,476,080 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 582 | java | package model;
public class DesenvolvedorJuniorHS extends DesenvolvedorHS {
public DesenvolvedorJuniorHS() {
super();
// TODO Auto-generated constructor stub
}
public DesenvolvedorJuniorHS(String nome, double salario) {
super(nome, salario);
// TODO Auto-generated constructor stub
}
public double getBonus() {
double bonus = getSalario() * 0.05;
System.out.println("Bônus no Salário: "+bonus+" reais");
return bonus;
}
@Override
public String toString() {
return "DesenvolvedorHS [Nome=" + getNome() + ", Salario=" + getSalario() + "]\n";
}
} | [
"jeanmaxskrebs@gmail.com"
] | jeanmaxskrebs@gmail.com |
e9d75df2d6f66e0d0fb939848f70bcef05fc65f6 | 261ea540cf6f724c7adb294868e3d07de8771c18 | /vertx-lang-clojure/src/main/java/io/vertx/lang/clojure/ClojureDocGenerator.java | 5a66469c1a8a0f8c64579254209841f9f4dae7e2 | [] | no_license | luskwater/vertx-lang-clojure | 45bf971d6d07db1978219a972abadcf70c56ad84 | 6ce16416a9edf64f3ae32c5436ec208e4c4caa09 | refs/heads/master | 2020-04-05T12:47:58.627019 | 2018-04-12T15:51:21 | 2018-04-12T15:51:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,089 | java | package io.vertx.lang.clojure;
import io.vertx.codetrans.CodeTranslator;
import io.vertx.docgen.Coordinate;
import io.vertx.docgen.DocGenerator;
import io.vertx.docgen.JavaDocGenerator;
import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
/**
* Clojure document generator
* @author <a href="mailto:chengen.zhao@whitewoodcity.com">Chengen Zhao</a>
*/
public class ClojureDocGenerator implements DocGenerator {
private JavaDocGenerator javaGen = new JavaDocGenerator();
private CodeTranslator translator;
@Override
public void init(ProcessingEnvironment processingEnv) {
translator = new CodeTranslator(processingEnv);
javaGen.init(processingEnv);
}
@Override
public String getName() {
return "clojure";
}
@Override
public String renderSource(ExecutableElement elt, String source) {
// ClojureLang lang = new ClojureLang();
try {
return source;//translator.translate(elt, lang);
} catch (Exception e) {
System.out.println("Cannot generate " + elt.getEnclosingElement().getSimpleName() + "#" + elt.getSimpleName() + " : " + e.getMessage());
return "Code not translatable";
}
}
@Override
public String resolveTypeLink(TypeElement elt, Coordinate coordinate) {
return javaGen.resolveTypeLink(elt, coordinate);
}
@Override
public String resolveConstructorLink(ExecutableElement elt, Coordinate coordinate) {
return javaGen.resolveConstructorLink(elt, coordinate);
}
@Override
public String resolveMethodLink(ExecutableElement elt, Coordinate coordinate) {
return javaGen.resolveMethodLink(elt, coordinate);
}
@Override
public String resolveLabel(Element elt, String defaultLabel) {
return javaGen.resolveLabel(elt, defaultLabel);
}
@Override
public String resolveFieldLink(VariableElement elt, Coordinate coordinate) {
return javaGen.resolveFieldLink(elt, coordinate);
}
} | [
"chengen.zhao@mail.mcgill.ca"
] | chengen.zhao@mail.mcgill.ca |
dd7d775eb897f30a0651369c501efa8eebc92668 | 56f68085e74f81ec83cbae637002d1190c55d71e | /app/src/main/java/com/yogesh/eventhub/ui/adapters/UpcomingEventsAdapter.java | 80c6475cb7a2cc2cc5a9c49de273a787a7fdc3a5 | [
"Apache-2.0"
] | permissive | yogeshbalan/EventHub_Favcy | c4433ce5d1138489c36e5b48a11e8d2125db0252 | 4e6964b2d0075236563acc87cf1c3485a3a8052a | refs/heads/master | 2021-01-10T01:10:09.614266 | 2016-02-25T12:11:06 | 2016-02-25T12:11:06 | 52,521,552 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,969 | java | package com.yogesh.eventhub.ui.adapters;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.timehop.stickyheadersrecyclerview.StickyRecyclerHeadersAdapter;
import com.yogesh.eventhub.models.Events;
import com.yogesh.eventhub.ui.adapters.ViewHolders.EventHeader;
import com.yogesh.eventhub.ui.adapters.ViewHolders.UpcomingViewHolder;
import java.util.ArrayList;
import me.gilo.eventhub.R;
/**
* Created by Aron on 10/31/2015.
*/
public class UpcomingEventsAdapter extends RecyclerView.Adapter<UpcomingViewHolder> implements StickyRecyclerHeadersAdapter<EventHeader> {
private ArrayList<Events> events;
private Context context;
public UpcomingEventsAdapter(ArrayList<Events> events, Context context) {
this.events = events;
this.context = context;
}
@Override
public UpcomingViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return new UpcomingViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.upcoming_event_single_item, parent, false));
}
@Override
public void onBindViewHolder(UpcomingViewHolder holder, int position) {
holder.renderView(context, events.get(position));
}
@Override
public int getItemCount() {
return events.size() == 0 ? 0 : events.size();
}
@Override
public long getHeaderId(int position) {
return position;
}
@Override
public EventHeader onCreateHeaderViewHolder(ViewGroup parent) {
return new EventHeader(LayoutInflater.from(parent.getContext()).inflate(R.layout.event_sticky_header, parent, false));
}
@Override
public void onBindHeaderViewHolder(EventHeader holder, int position) {
//String date = DataFormatter.formatDate(events.get(position).getEventDateLocal());
holder.renderView(events.get(position).getEventReleaseDate());
}
}
| [
"balanyogesh@gmail.com"
] | balanyogesh@gmail.com |
c78f91e71cbd6a2c6b1c31ec47da0dbc4134b72d | 5e94073d55fcb46e1e4f341fe7249bd732604a6b | /hap/hap/src/main/java/com/hand/hap/system/mapper/SysUserDemoMapper.java | 2a20665ffc4bf1765fa97af481c5d1fd29e88201 | [] | no_license | helloexp/hap_work | 596cd18b88eb58010d2576ee4fc9afe652a7e1d0 | 7b263dedc8701f3d61ae002e324c197dc64ec6c7 | refs/heads/master | 2021-06-19T13:48:08.181165 | 2017-06-29T09:51:07 | 2017-06-29T09:51:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 246 | java | package com.hand.hap.system.mapper;
import com.hand.hap.mybatis.common.Mapper;
import com.hand.hap.system.dto.SysUserDemo;
/**
* @author hailin.xu@hand-china.com
*/
public interface SysUserDemoMapper extends Mapper<SysUserDemo> {
} | [
"goldberg3@163.com"
] | goldberg3@163.com |
558bc904b403bc278f1fa1d071325d56120132e0 | 3dcb5c601922d6e7ac0a39e05615621b034c0b95 | /semester-2/test1-1/src/test/java/com/spbsu/a1arick/ControllerTest.java | 7ff49d0bbf934c284a8ed390cf334f78c23f6668 | [] | no_license | a1arick/spbsu-programming-homework | 4a282c5a6e4a6f37508188ec1d5423971c430f47 | 124eea7209bb995d1b0139ab9f94dce50c259061 | refs/heads/master | 2021-01-25T13:47:32.461570 | 2018-06-13T12:10:01 | 2018-06-13T12:10:01 | 123,613,934 | 0 | 1 | null | 2018-06-13T12:10:02 | 2018-03-02T18:12:36 | Java | UTF-8 | Java | false | false | 95 | java | package com.spbsu.a1arick;
import static org.junit.Assert.*;
public class ControllerTest {
} | [
"algsavelev@gmail.com"
] | algsavelev@gmail.com |
ec94e19b30784e2912e77b9f77ffab626dd46b93 | 81f9b3cec04a534337eca84c75b7a4d89932fcb0 | /Mozzdownloader/src/main/java/com/downloader/httpclient/DefaultHttpClient.java | 4524a22d4411c6ad843726f06d344f4fbc38b5f1 | [] | no_license | manddy/MozillaUnderTestingDownloader | dc79132be9b423c65005f3c9f13f7726e51bb8bd | 6a921655e998bb65bf8f869cc3d31f3f7f2396ad | refs/heads/master | 2020-07-09T08:47:52.259929 | 2019-08-23T06:20:47 | 2019-08-23T06:20:47 | 203,932,057 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,159 | java |
package com.downloader.httpclient;
import com.downloader.Constants;
import com.downloader.request.DownloadRequest;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
public class DefaultHttpClient implements HttpClient {
private URLConnection connection;
public DefaultHttpClient() {
}
@SuppressWarnings("CloneDoesntCallSuperClone")
@Override
public HttpClient clone() {
return new DefaultHttpClient();
}
@Override
public void connect(DownloadRequest request) throws IOException {
connection = new URL(request.getUrl()).openConnection();
connection.setReadTimeout(request.getReadTimeout());
connection.setConnectTimeout(request.getConnectTimeout());
final String range = String.format(Locale.ENGLISH,
"bytes=%d-", request.getDownloadedBytes());
connection.addRequestProperty(Constants.RANGE, range);
connection.addRequestProperty(Constants.USER_AGENT, request.getUserAgent());
addHeaders(request);
connection.connect();
}
@Override
public int getResponseCode() throws IOException {
int responseCode = 0;
if (connection instanceof HttpURLConnection) {
responseCode = ((HttpURLConnection) connection).getResponseCode();
}
return responseCode;
}
@Override
public InputStream getInputStream() throws IOException {
return connection.getInputStream();
}
@Override
public long getContentLength() {
Integer length3=connection.getContentLength();
String length = connection.getHeaderField("Content-Length");
try {
return Long.parseLong(length);
} catch (NumberFormatException e) {
return -1;
}
}
@Override
public String getResponseHeader(String name) {
return connection.getHeaderField(name);
}
@Override
public void close() {
// no operation
}
@Override
public Map<String, List<String>> getHeaderFields() {
return connection.getHeaderFields();
}
@Override
public InputStream getErrorStream() {
if (connection instanceof HttpURLConnection) {
return ((HttpURLConnection) connection).getErrorStream();
}
return null;
}
private void addHeaders(DownloadRequest request) {
final HashMap<String, List<String>> headers = request.getHeaders();
if (headers != null) {
Set<Map.Entry<String, List<String>>> entries = headers.entrySet();
for (Map.Entry<String, List<String>> entry : entries) {
String name = entry.getKey();
List<String> list = entry.getValue();
if (list != null) {
for (String value : list) {
connection.addRequestProperty(name, value);
}
}
}
}
}
}
| [
"mandeep16242@iiitd.ac.in"
] | mandeep16242@iiitd.ac.in |
6311bc9b3bb8000b187fe29317c96e7d1c87596d | b12b4ad069a1cfc6f3d371e5361194b90b252515 | /src/data/CategoriaTransaccion.java | f2544b9e3f48d093a8bd55363007e8deaf418f5e | [] | no_license | keponer/GestorGastos | 0d9223d655fa7fbeb7eecb1933cb188203861262 | 0d62c878153a6868b40f8cf4227ddb9e0c4f0d7f | refs/heads/master | 2021-01-19T11:22:29.004068 | 2017-05-16T17:54:10 | 2017-05-16T17:54:10 | 87,961,602 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,518 | 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 data;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author angel
*/
public class CategoriaTransaccion {
private int id;
private String name;
private float iva;
public CategoriaTransaccion() {
}
public int getId() {
return id;
}
private void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public float getIva() {
return iva;
}
public void setIva(float iva) {
this.iva = iva;
}
/**
* Intenta insertar el objeto en la base de datos.
* Devuelve el identificador numérico generado si es posible.
* Devuelve 0 en caso de error.
* Devuelve negativo en caso de no error y no poder devolver identificador.
* @return int id autogenerado, 0 en caso de error, -1 si no se autogenera id
*/
public int insert() {
Connection db = SingletonDataConnection.getInstance().getConnection();
PreparedStatement query;
String queryText = "INSERT INTO categorias_transacciones (`name`, `iva`) VALUES (?, ?);";
try {
query = db.prepareStatement(queryText, Statement.RETURN_GENERATED_KEYS);
query.setString(1, this.name);
query.setFloat(2, this.iva);
query.execute();
ResultSet rs = query.getGeneratedKeys();
if (rs.next()) {
return rs.getInt(1);
}
}
catch(SQLException sqlException) {
System.out.println("Posible error de conexión a la db.");
return 0;
}
return -1;
}
public void update(){
}
public void selectById(int _id) {
}
public void selectByName(String _name) {
}
/**
* Devuelve una lista con todas las categorias existentes.
* @return List resultado
*/
public static List<CategoriaTransaccion> list() {
List<CategoriaTransaccion> lista = new ArrayList<>();
Connection db = SingletonDataConnection.getInstance().getConnection();
try {
Statement query = db.createStatement();
String queryTxt = "SELECT * FROM categorias_transacciones;";
query.execute(queryTxt);
ResultSet result = query.getResultSet();
while(!result.isLast()) {
result.next();
lista.add(parseResultRow(result));
}
}
catch(SQLException sqlException) {
System.out.println("Posible error de conexión a la db. No se pudo crear el objeto query.");
lista = null;
}
return lista;
}
public static CategoriaTransaccion parseResultRow(ResultSet set) {
CategoriaTransaccion cat = new CategoriaTransaccion();
try {
cat.setId(set.getInt(1));
cat.setName(set.getString(2));
cat.setIva(set.getFloat(3));
} catch (SQLException ex) {
System.out.println("Error de conexión.");
}
return cat;
}
}
| [
"alroigar@upv.es"
] | alroigar@upv.es |
2bfd3900d785ac7fd1b7766d3734a728befcf4a1 | 43affeea4ed64401d49f50b7bead384fa9561e2c | /Resolução exercícios em laboratório POO/src/ExemploCoesaoAcoplamento/src/Lista06_04_18CoesaoPlanejamento/dip/Piloto.java | 789d3194fbb3fca95516dc5ebfbcf007c68b7d49 | [] | no_license | Robertoeugenio/IFTM-EXERCICIOS_POO | c8348799fd0c6fdf9fcac3db001a8e50975018b3 | 61034eb00eb1c45662f0fbb3f4025869a7f69197 | refs/heads/master | 2021-01-24T16:27:07.427436 | 2018-05-30T19:02:47 | 2018-05-30T19:02:47 | 123,194,475 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 222 | java | package dip;
public class Piloto {
private Veiculo carro;
public Piloto(){
this.carro = new CarroDeCorrida(100);
}
public void aumentaVelocidade(){
carro.acelerar();
}
} | [
"noreply@github.com"
] | noreply@github.com |
87606e67a5876a76c82c376ceb8bc9cc664ec369 | 1f099c13317a9d769953a8f410b9b4fbfb8f244a | /src/com/ankit/design/pattern/observer/Warehouse.java | 78994bb258ee5fdcc4e56e0ac8dcdf4938a36910 | [] | no_license | ankirmishra073/Test | e2b1a47641a34702893b4ffca06ee9be08cd3f29 | 954ddf825f5ddfbebc0527edf8d3c1eea7274106 | refs/heads/master | 2021-01-17T14:30:18.421226 | 2016-10-07T10:11:44 | 2016-10-07T10:11:44 | 70,235,120 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 640 | java | package com.ankit.design.pattern.observer;
import java.util.ArrayList;
import java.util.List;
public class Warehouse {
private List<Product> products=new ArrayList<Product>();
private List<User> users=new ArrayList<User>();
public void addUserToWareHouse(User user){
users.add(user);
}
public void addProduct(Product product){
products.add(product);
notifyAllUsers(product);
}
public void notifyAllUsers(Product product){
users.forEach(user ->{
if(user.getproducts().contains(product)){
user.Alert(product);
}
});
}
public List<Product> getProducts(){
return products;
}
}
| [
"mishraa@3901C502985LM.local"
] | mishraa@3901C502985LM.local |
4cc6e3d364af4a3424da1e2501edd461c79e5874 | 9a34b100ca5ce6fbd4873c0bfaacf73177183d5e | /src/main/java/week07d05/SaveInput.java | e26467f4667f24fe108400637e1c9ff33f7621bc | [] | no_license | kondasg/training-solutions | 862a4704bd782a3cf7fdf4f07ec65228ed28ff8d | 337e96453eb50f628ce664aead00169317d99635 | refs/heads/master | 2023-04-30T03:11:28.852441 | 2021-05-14T16:24:54 | 2021-05-14T16:24:54 | 308,166,095 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,651 | java | package week07d05;
import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class SaveInput {
private final Scanner scanner;
// Dependenxy injection
public SaveInput(Scanner scanner) {
this.scanner = scanner;
}
public List<String> readLines() {
List<String> lines = new ArrayList<>();
for (int i = 0; i < 3; i++) {
System.out.println("Kérm a(z) " + (i + 1) + ". sort: ");
lines.add(scanner.nextLine());
}
return lines;
}
private Path readFilename() {
System.out.println("Kérem a file nevet: ");
String outputFile = scanner.nextLine();
Path path = Path.of(outputFile);
return path;
}
public void write(Path path, List<String> lines) {
try (BufferedWriter writer = Files.newBufferedWriter(path)) {
for (String s: lines) {
writer.write(s + "\n");
}
}
catch (IOException ioe) {
throw new IllegalStateException("Can not write file", ioe);
}
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
SaveInput saveInput = new SaveInput(scanner);
List<String> lines = saveInput.readLines();
Path file = saveInput.readFilename();
saveInput.write(file, lines);
}
}
// Kérj be a felhasználótól három sort, majd a fájl nevét.
// Mentsd el a sorokat ebbe a fájlba. A week07d05.SaveInput osztályba dolgozz! | [
"gabor@kondas.hu"
] | gabor@kondas.hu |
aaa19eb98792634720755bad6a73dc3de9d8d3f3 | 2e25f9cefc8497a69d64d9ce14367a1071934483 | /src/main/java/com/humansourceproject/hrms/core/adapters/abstracts/UserCheckService.java | 94047ee91ce4b5bace32edef0398b7785aa7902b | [] | no_license | bizimsiti/project_hrms | ea5a3601584b6de5bb3ac46b381e963c16f18109 | 5d56cb277fbaee5f56667115c99e320bbabfc8f5 | refs/heads/main | 2023-06-26T01:57:27.522956 | 2021-08-01T22:29:30 | 2021-08-01T22:29:30 | 375,461,433 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 205 | java | package com.humansourceproject.hrms.core.adapters.abstracts;
public interface UserCheckService {
public boolean CheckRealPerson(String identityNumber,String firstName,String lastName,int birthYear);
}
| [
"hoccalo@gmail.com"
] | hoccalo@gmail.com |
48142233d2a0b677e6efee7922b00ac34a4eb87a | 4707aa723600c0046b75c6b3a1b0358b6f1baa6c | /new ec2/JavaHotel/src/org/pack/hotel/Hotel.java | 120683d15a4973faa5fd1ae6f5a556e2de399c00 | [] | no_license | IliyanKozlovski/MainRepository | e7ab195a01423c61c8cc7d351584207e624a086b | fe91768be6f237c2b5169cd0ebe07249a7e50f3e | refs/heads/master | 2021-01-10T16:29:52.175614 | 2013-03-20T12:27:16 | 2013-03-20T12:27:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 604 | java | package org.pack.hotel;
import java.util.ArrayList;
public class Hotel {
private Raiting raiting;
private ArrayList<IGuest> guest;
public Hotel(Raiting raiting) {
super();
guest = new ArrayList<>();
this.raiting = raiting;
}
public Raiting getRaiting() {
return raiting;
}
public ArrayList<IGuest> getGuest() {
return guest;
}
void addGuest(Guest newGuest){
guest.add(newGuest);
}
void printall(){
for (int i = 0; i < guest.size(); i++) {
System.out.println(guest.get(i).getForname()+ " " +
guest.get(i).getSurname());
}
}
}
| [
"i.kozlovski.com@gmail.com"
] | i.kozlovski.com@gmail.com |
d917a967287eb0db8df6743176e5f4afb3cb2abf | 86e9e4f4fe0c0fced0870a5ce902b2e7357d0175 | /src/test/java/com/bin/ApplicationTests.java | 8dc9ca55720c77cc69088cf60a4878bcddcc518c | [] | no_license | zhubin1018/erp | eb25bcdb6f85ad73f7497a6f873d49a3ab8143ed | c01ec51383774ae9d709440c16f6601e2e81326f | refs/heads/master | 2022-06-28T22:30:58.655885 | 2020-03-23T08:39:17 | 2020-03-23T08:39:17 | 249,376,768 | 0 | 0 | null | 2022-02-09T22:23:40 | 2020-03-23T08:39:00 | Java | UTF-8 | Java | false | false | 202 | java | package com.bin;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class ApplicationTests {
@Test
void contextLoads() {
}
}
| [
"2470718490@qq.com"
] | 2470718490@qq.com |
844ef160336cfb6d4a5e9b5a4836689395c679ee | a8a57531e0d18ead4dbb54f444d049e9803a3280 | /BukkitAPI/src/main/java/me/matamor/generalapi/bukkit/bossbar/BossBar.java | 5e551c695bb528b762f1ae45cea808d1a5c6a265 | [] | no_license | MaTaMoR/GeneralAPI | 225bbb96c9d4e8190cee3a7b268f528af2ecccfa | 07ce263da6f71119362212b4330a87c7f09975a3 | refs/heads/master | 2023-05-02T22:20:01.480168 | 2021-05-21T14:45:16 | 2021-05-21T14:45:16 | 369,565,207 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 439 | java | package me.matamor.generalapi.bukkit.bossbar;
import org.bukkit.Location;
import org.bukkit.entity.Player;
public interface BossBar {
String getMessage();
void setVisible(boolean flag);
boolean isVisible();
float getMaxHealth();
void setHealth(float percentage);
float getHealth();
void setMessage(String message);
Player getReceiver();
Location getLocation();
void updateMovement();
}
| [
"matamor98@hotmail.com"
] | matamor98@hotmail.com |
1bcfa0b09a29ba4809c3e05f7d11b875255175a2 | 0c45be9e5ff1261a7eeeb80d656942acc343cae4 | /javawebv002/src/main/java/com/javaweb/tzhu/entity/Admininfo.java | eb6fab6287a597931a79a19243bf7e64131acc7e | [] | no_license | wanghuanqiang/repository | 40cbd514c830506f97da23a32fe3b3004fbc422a | c459bc7bec17825a6231ba494660d10b327ab3ca | refs/heads/master | 2020-05-22T12:17:16.416797 | 2019-05-13T09:56:53 | 2019-05-13T09:56:53 | 186,335,065 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,669 | java | package com.javaweb.tzhu.entity;
public class Admininfo {
private Integer adminld;
private String adminName;
private String adminPass;
private Integer adminSyle;
private String adminEmail;
public Admininfo() {
}
public Admininfo(Integer adminld, String adminName, String adminPass, Integer adminSyle, String adminEmail) {
this.adminld = adminld;
this.adminName = adminName;
this.adminPass = adminPass;
this.adminSyle = adminSyle;
this.adminEmail = adminEmail;
}
public Integer getAdminld() {
return adminld;
}
public void setAdminld(Integer adminld) {
this.adminld = adminld;
}
public String getAdminName() {
return adminName;
}
public void setAdminName(String adminName) {
this.adminName = adminName;
}
public String getAdminPass() {
return adminPass;
}
public void setAdminPass(String adminPass) {
this.adminPass = adminPass;
}
public Integer getAdminSyle() {
return adminSyle;
}
public void setAdminSyle(Integer adminSyle) {
this.adminSyle = adminSyle;
}
public String getAdminEmail() {
return adminEmail;
}
public void setAdminEmail(String adminEmail) {
this.adminEmail = adminEmail;
}
@Override
public String toString() {
return "Admininfo{" +
"adminld=" + adminld +
", adminName='" + adminName + '\'' +
", adminPass='" + adminPass + '\'' +
", adminSyle=" + adminSyle +
", adminEmail='" + adminEmail + '\'' +
'}';
}
}
| [
"1205549369@qq.com"
] | 1205549369@qq.com |
6854bad8b56fb1c60c5300d967bbf3fbdd17d19c | 80a2fad5b7b4caf5f23cd22f156bb952d7ccefc7 | /modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Notification.java | 409bd3d090f6c888ead04831a6c1df7975c302cf | [
"Apache-2.0"
] | permissive | ajinkya-dhamnaskar/airavata | d9b16aa999d26bc81c6667b0d96a2412254760a6 | 05ea66e11e8098af51fc95151be596d96b8ccb8c | refs/heads/master | 2021-01-17T12:14:28.283395 | 2016-08-23T17:20:07 | 2016-08-23T17:20:07 | 67,832,328 | 1 | 0 | null | 2017-03-21T15:29:24 | 2016-09-09T20:58:20 | Java | UTF-8 | Java | false | false | 3,246 | 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.airavata.registry.core.experiment.catalog.model;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.sql.Timestamp;
@Entity
@Table(name = "NOTIFICATION")
public class Notification {
private final static Logger logger = LoggerFactory.getLogger(Notification.class);
private String notificationId;
private String gatewayId;
private String title;
private String notificationMessage;
private String priority;
private Timestamp creationDate;
private Timestamp publishedDate;
private Timestamp expirationDate;
@Id
@Column(name = "NOTIFICATION_ID")
public String getNotificationId() {
return notificationId;
}
public void setNotificationId(String notificationId) {
this.notificationId = notificationId;
}
@Column(name = "GATEWAY_ID")
public String getGatewayId() {
return gatewayId;
}
public void setGatewayId(String gatewayId) {
this.gatewayId = gatewayId;
}
@Column(name = "TITLE")
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Column(name = "NOTIFICATION_MESSAGE")
public String getNotificationMessage() {
return notificationMessage;
}
public void setNotificationMessage(String notificationMessage) {
this.notificationMessage = notificationMessage;
}
@Column(name = "PRIORITY")
public String getPriority() {
return priority;
}
public void setPriority (String priority) {
this.priority = priority;
}
@Column(name = "CREATION_DATE")
public Timestamp getCreationDate() {
return creationDate;
}
public void setCreationDate (Timestamp creationDate) {
this.creationDate = creationDate;
}
@Column(name = "PUBLISHED_DATE")
public Timestamp getPublishedDate() {
return publishedDate;
}
public void setPublishedDate (Timestamp publishedDate) {
this.publishedDate = publishedDate;
}
@Column(name = "EXPIRATION_DATE")
public Timestamp getExpirationDate() {
return expirationDate;
}
public void setExpirationDate (Timestamp expirationDate) {
this.expirationDate = expirationDate;
}
} | [
"supun.nakandala@gmail.com"
] | supun.nakandala@gmail.com |
a6a248b4563cf9712b0c8bb1af3f7242658cdcaa | 6eb9945622c34e32a9bb4e5cd09f32e6b826f9d3 | /src/com/inponsel/android/details/TwitterInPonsel.java | c2d9d2ee395cdfcab9b8a408cddcc0af2b30a6d5 | [] | no_license | alexivaner/GadgetX-Android-App | 6d700ba379d0159de4dddec4d8f7f9ce2318c5cc | 26c5866be12da7b89447814c05708636483bf366 | refs/heads/master | 2022-06-01T09:04:32.347786 | 2020-04-30T17:43:17 | 2020-04-30T17:43:17 | 260,275,241 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 129,548 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.inponsel.android.details;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.net.ConnectivityManager;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.StrictMode;
import android.text.Html;
import android.util.Base64;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.MenuItem;
import com.google.android.gms.analytics.Tracker;
import com.inponsel.android.adapter.ItemTwitter;
import com.inponsel.android.adapter.ModelObserver;
import com.inponsel.android.adapter.PonselBaseApp;
import com.inponsel.android.utils.DatabaseHandler;
import com.inponsel.android.utils.EncodeDecodeAES;
import com.inponsel.android.utils.HttpPush;
import com.inponsel.android.utils.Log;
import com.inponsel.android.utils.NotificationLikeTwHelper;
import com.inponsel.android.utils.RestClient;
import com.inponsel.android.utils.UserFunctions;
import com.inponsel.android.utils.Util;
import com.inponsel.android.utils.Utility;
import com.inponsel.android.v2.ImagePagerActivity;
import com.inponsel.android.v2.LoginActivity;
import com.inponsel.android.v2.RegisterActivity;
import com.readystatesoftware.systembartint.SystemBarTintManager;
import com.squareup.picasso.Callback;
import com.squareup.picasso.Picasso;
import com.squareup.picasso.RequestCreator;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Observable;
import java.util.Observer;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
// Referenced classes of package com.inponsel.android.details:
// KomentarTwitter
public class TwitterInPonsel extends SherlockFragmentActivity
implements Observer
{
public class FavoritTask extends AsyncTask
{
final TwitterInPonsel this$0;
protected volatile transient Object doInBackground(Object aobj[])
{
return doInBackground((Void[])aobj);
}
protected transient Void doInBackground(Void avoid[])
{
try
{
avoid = (new StringBuilder("idtw=")).append(idkom_pos).append("&idusr=").append(user_id).append("&stat=").append(stat).append("&t=").append(t).toString();
String s = (new StringBuilder(String.valueOf(Util.BASE_PATH2))).append("add_favtw").append(Utility.BASE_FORMAT).append("?").append(avoid).toString();
Log.e("pushURL", s);
s = HttpPush.getResponse(s);
Log.e("push", (new StringBuilder(String.valueOf(s))).append(avoid).toString());
res = s.toString();
Log.e("url ", res);
res = res.trim();
res = res.replaceAll("\\s+", "");
}
// Misplaced declaration of an exception variable
catch (Void avoid[])
{
avoid.printStackTrace();
}
return null;
}
protected volatile void onPostExecute(Object obj)
{
onPostExecute((Void)obj);
}
protected void onPostExecute(Void void1)
{
super.onPostExecute(void1);
updateViewTWFav(idkom_pos, res);
}
protected void onPreExecute()
{
super.onPreExecute();
if (stat.equals("1"))
{
mDialog = ProgressDialog.show(TwitterInPonsel.this, "", "Menambahkan...", true);
} else
{
mDialog = ProgressDialog.show(TwitterInPonsel.this, "", "Menghapus...", true);
}
mDialog.setCancelable(true);
mDialog.show();
}
public FavoritTask()
{
this$0 = TwitterInPonsel.this;
super();
}
}
public class KomentarAsycTask extends AsyncTask
{
final TwitterInPonsel this$0;
protected volatile transient Object doInBackground(Object aobj[])
{
return doInBackground((String[])aobj);
}
protected transient Void doInBackground(String as[])
{
Log.e("KomentarAsycTask", "doInBackground");
JSONObject jsonobject = new JSONObject(getJSONUrl(urlKomen));
as = jsonobject.getJSONArray("InPonsel");
bottom_id = jsonobject.getString("bottom_id");
top_id = jsonobject.getString("top_id");
Log.e("bottom_id", bottom_id);
Log.e("top_id", top_id);
countKomOld = 0;
int i = 0;
_L1:
if (i >= as.length())
{
break MISSING_BLOCK_LABEL_279;
}
Object obj = TwitterInPonsel.this;
obj.countAllKom = ((TwitterInPonsel) (obj)).countAllKom + 1;
obj = TwitterInPonsel.this;
obj.countKomOld = ((TwitterInPonsel) (obj)).countKomOld + 1;
obj = as.getJSONObject(i);
mArrayListData.add(new ItemTwitter(((JSONObject) (obj)).getString("since_id"), ((JSONObject) (obj)).getString("tweet_content"), ((JSONObject) (obj)).getString("media_url"), ((JSONObject) (obj)).getString("avatar"), ((JSONObject) (obj)).getString("tweet_time"), ((JSONObject) (obj)).getString("real_name"), ((JSONObject) (obj)).getString("screen_name"), ((JSONObject) (obj)).getJSONObject("likedislike").getString("total_like"), ((JSONObject) (obj)).getJSONObject("likedislike").getString("total_dislike"), ((JSONObject) (obj)).getJSONObject("likedislike").getString("total_komen"), ((JSONObject) (obj)).getJSONObject("likedislike").getString("my_like_tweet"), ((JSONObject) (obj)).getJSONObject("likedislike").getString("my_fav_tweet")));
i++;
goto _L1
as;
as.printStackTrace();
strKonekStat = "0";
return null;
}
protected volatile void onPostExecute(Object obj)
{
onPostExecute((Void)obj);
}
protected void onPostExecute(Void void1)
{
if (!strKonekStat.equals("-"))
{
int i = 0;
do
{
if (i >= mArrayListData.size())
{
txtbtnheader.setOnClickListener(new android.view.View.OnClickListener() {
final KomentarAsycTask this$1;
public void onClick(View view)
{
try
{
txtbtnheader.setVisibility(8);
limit = 0;
urlKomenLast = (new StringBuilder(String.valueOf(Util.BASE_PATH2))).append("vendor_twitter").append(Utility.BASE_FORMAT).append("?screen_name=").append(twitter).append("&since_id=").append(top_id).append("&t=").append(t).append("&idusr=").append(user_id).toString();
Log.e("urlKomenLast", urlKomenLast);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new KomentarNextAsycTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
return;
}
}
// Misplaced declaration of an exception variable
catch (View view)
{
return;
}
(new KomentarNextAsycTask()).execute(new String[0]);
return;
}
{
this$1 = KomentarAsycTask.this;
super();
}
});
txtbtnfooter.setOnClickListener(new android.view.View.OnClickListener() {
final KomentarAsycTask this$1;
public void onClick(View view)
{
try
{
limit = 0;
urlKomenOld = (new StringBuilder(String.valueOf(Util.BASE_PATH2))).append("vendor_twitter").append(Utility.BASE_FORMAT).append("?screen_name=").append(twitter).append("&max_id=").append(bottom_id).append("&t=").append(t).append("&idusr=").append(user_id).toString();
Log.e("urlKomenOld", urlKomenOld);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new KomentarOldAsycTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
return;
}
}
// Misplaced declaration of an exception variable
catch (View view)
{
return;
}
(new KomentarOldAsycTask()).execute(new String[0]);
return;
}
{
this$1 = KomentarAsycTask.this;
super();
}
});
layout_empty.setVisibility(8);
scrollviewKomen.setVisibility(0);
return;
}
void1 = ((LayoutInflater)getSystemService("layout_inflater")).inflate(0x7f0300cb, null);
txtUsername = (TextView)void1.findViewById(0x7f0b0419);
img_kom_picture = (ImageView)void1.findViewById(0x7f0b054b);
imageMedia = (ImageView)void1.findViewById(0x7f0b046c);
txtIdKom = (TextView)void1.findViewById(0x7f0b054d);
txtKomentar = (TextView)void1.findViewById(0x7f0b054e);
txtWaktu = (TextView)void1.findViewById(0x7f0b054c);
txtImgAva = (TextView)void1.findViewById(0x7f0b05e9);
txtImgMedia = (TextView)void1.findViewById(0x7f0b05ea);
ImageView imageview = (ImageView)void1.findViewById(0x7f0b054f);
ImageView imageview1 = (ImageView)void1.findViewById(0x7f0b0552);
txtLikeKom = (TextView)void1.findViewById(0x7f0b0551);
txtdisLikeKom = (TextView)void1.findViewById(0x7f0b0554);
txtTotalKom = (TextView)void1.findViewById(0x7f0b034a);
bottom_list = (LinearLayout)void1.findViewById(0x7f0b0341);
list_lay_like = (RelativeLayout)void1.findViewById(0x7f0b0342);
list_lay_dislike = (RelativeLayout)void1.findViewById(0x7f0b0345);
list_lay_kom = (RelativeLayout)void1.findViewById(0x7f0b0348);
final String since_id = ((ItemTwitter)mArrayListData.get(i)).getSince_id();
final String tweet_content = ((ItemTwitter)mArrayListData.get(i)).getTweet_content();
final String media_url = ((ItemTwitter)mArrayListData.get(i)).getMedia_url();
final String avatar = ((ItemTwitter)mArrayListData.get(i)).getAvatar();
final String tweet_time = ((ItemTwitter)mArrayListData.get(i)).getTweet_time();
String s1 = ((ItemTwitter)mArrayListData.get(i)).getReal_name();
String s = ((ItemTwitter)mArrayListData.get(i)).getScreen_name();
String s2 = ((ItemTwitter)mArrayListData.get(i)).getTotal_like();
String s3 = ((ItemTwitter)mArrayListData.get(i)).getTotal_dislike();
String s4 = ((ItemTwitter)mArrayListData.get(i)).getTotal_komen();
((ItemTwitter)mArrayListData.get(i)).getTotal_komen();
String s5 = ((ItemTwitter)mArrayListData.get(i)).getMy_like_tweet();
String s6 = ((ItemTwitter)mArrayListData.get(i)).getMy_fav_tweet();
if (twitter.toLowerCase().equals("inponsel"))
{
bottom_list.setVisibility(0);
} else
{
bottom_list.setVisibility(8);
}
txtIdKom.setText(since_id);
txtUsername.setText(Html.fromHtml((new StringBuilder("<font color='#000000'>")).append(s1).append("</font>").append("<small><font color='#cacaca'>").append("<br>@").append(s).append("</font><small>").toString()));
txtImgAva.setText(avatar);
txtImgMedia.setText(media_url);
txtKomentar.setText(Html.fromHtml(Utility.parseTweet(tweet_content)));
txtKomentar.setMovementMethod(com.inponsel.android.widget.TextViewFixTouchConsume.LocalLinkMovementMethod.getInstance());
txtLikeKom.setText(s2);
txtdisLikeKom.setText(s3);
txtTotalKom.setText(s4);
if (s5.toString().equals("1"))
{
imageview.setBackgroundResource(0x7f020264);
list_lay_like.setEnabled(false);
list_lay_dislike.setEnabled(true);
} else
if (s5.toString().equals("0"))
{
imageview.setBackgroundResource(0x7f020265);
list_lay_like.setEnabled(true);
list_lay_dislike.setEnabled(false);
} else
{
list_lay_like.setEnabled(true);
list_lay_dislike.setEnabled(true);
imageview.setBackgroundResource(0x7f020265);
list_lay_like.setBackgroundResource(0x7f020079);
list_lay_dislike.setBackgroundResource(0x7f020079);
}
if (s6.toString().equals("1"))
{
imageview1.setBackgroundResource(0x7f020303);
} else
if (s6.toString().equals("0"))
{
imageview1.setBackgroundResource(0x7f020302);
} else
{
imageview1.setBackgroundResource(0x7f020302);
}
try
{
Picasso.with(TwitterInPonsel.this).load(((ItemTwitter)mArrayListData.get(i)).getAvatar().toString().trim()).into(img_kom_picture, new Callback() {
final KomentarAsycTask this$1;
public void onError()
{
}
public void onSuccess()
{
img_kom_picture.setVisibility(0);
}
{
this$1 = KomentarAsycTask.this;
super();
}
});
}
catch (Exception exception)
{
exception.printStackTrace();
}
if (((ItemTwitter)mArrayListData.get(i)).getMedia_url().trim().equals(""))
{
imageMedia.setVisibility(8);
} else
{
try
{
Picasso.with(TwitterInPonsel.this).load(((ItemTwitter)mArrayListData.get(i)).getMedia_url().toString().trim()).into(imageMedia, new Callback() {
final KomentarAsycTask this$1;
public void onError()
{
}
public void onSuccess()
{
imageMedia.setVisibility(0);
}
{
this$1 = KomentarAsycTask.this;
super();
}
});
}
catch (Exception exception1)
{
exception1.printStackTrace();
}
}
txtWaktu.setText(Utility.convertDate(((ItemTwitter)mArrayListData.get(i)).getTweet_time()));
mLinearListView.addView(void1);
imageMedia.setOnClickListener(media_url. new android.view.View.OnClickListener() {
final KomentarAsycTask this$1;
private final String val$media_url;
public void onClick(View view)
{
view = new ArrayList();
view.add(media_url);
view = (String[])view.toArray(new String[view.size()]);
Intent intent = new Intent(_fld0, com/inponsel/android/v2/ImagePagerActivity);
intent.putExtra("imgUrl", view);
intent.putExtra("pos", 0);
startActivity(intent);
}
{
this$1 = final_komentarasyctask;
media_url = String.this;
super();
}
});
img_kom_picture.setOnLongClickListener(avatar. new android.view.View.OnLongClickListener() {
final KomentarAsycTask this$1;
private final String val$avatar;
public boolean onLongClick(View view)
{
view = new ArrayList();
view.add((new StringBuilder(String.valueOf(Util.BASE_PATH_AVATAR))).append(avatar.toString().trim()).toString());
view = (String[])view.toArray(new String[view.size()]);
Intent intent = new Intent(_fld0, com/inponsel/android/v2/ImagePagerActivity);
intent.putExtra("imgUrl", view);
intent.putExtra("pos", 0);
startActivity(intent);
return false;
}
{
this$1 = final_komentarasyctask;
avatar = String.this;
super();
}
});
list_lay_like.setOnClickListener(since_id. new android.view.View.OnClickListener() {
final KomentarAsycTask this$1;
private final String val$since_id;
public void onClick(View view)
{
if (userFunctions.isUserLoggedIn(_fld0))
{
statuslike = "1";
idkom_pos = since_id;
querylike = (new StringBuilder("status=")).append(statuslike).append("&id_tw=").append(since_id).append("&id_usr=").append(user_id).append("&t=").append(t).toString();
Log.e("querylike", querylike);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new PostBagusKurangTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
return;
} else
{
(new PostBagusKurangTask()).execute(new Void[0]);
return;
}
} else
{
view = new android.app.AlertDialog.Builder(wrapperLight);
view.setMessage("Untuk memberi penilaian harus login terlebih dahulu.");
view.setPositiveButton("Tutup", new android.content.DialogInterface.OnClickListener() {
final KomentarAsycTask._cls5 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface.dismiss();
}
{
this$2 = KomentarAsycTask._cls5.this;
super();
}
});
view.setNeutralButton("Register", new android.content.DialogInterface.OnClickListener() {
final KomentarAsycTask._cls5 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface = new Intent(_fld0, com/inponsel/android/v2/RegisterActivity);
startActivity(dialoginterface);
}
{
this$2 = KomentarAsycTask._cls5.this;
super();
}
});
view.setNegativeButton("Login", new android.content.DialogInterface.OnClickListener() {
final KomentarAsycTask._cls5 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface = new Intent(_fld0, com/inponsel/android/v2/LoginActivity);
dialoginterface.putExtra("activity", "main");
startActivity(dialoginterface);
}
{
this$2 = KomentarAsycTask._cls5.this;
super();
}
});
view.show();
return;
}
}
{
this$1 = final_komentarasyctask;
since_id = String.this;
super();
}
});
list_lay_dislike.setOnClickListener(since_id. new android.view.View.OnClickListener() {
final KomentarAsycTask this$1;
private final String val$since_id;
public void onClick(View view)
{
idkom_pos = since_id;
if (userFunctions.isUserLoggedIn(_fld0))
{
if (db.checkIfExistTW(idkom_pos))
{
view = new android.app.AlertDialog.Builder(_fld0);
view.setMessage("Hapus tweet ini dari favorit?");
view.setPositiveButton("Ya", new android.content.DialogInterface.OnClickListener() {
final KomentarAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface.dismiss();
stat = "0";
(new FavoritTask()).execute(new Void[0]);
}
{
this$2 = KomentarAsycTask._cls6.this;
super();
}
});
view.setNegativeButton("Tidak", new android.content.DialogInterface.OnClickListener() {
final KomentarAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface.dismiss();
}
{
this$2 = KomentarAsycTask._cls6.this;
super();
}
});
view.show();
return;
} else
{
view = new android.app.AlertDialog.Builder(_fld0);
view.setMessage("Favoritkan tweet ini?");
view.setPositiveButton("Ya", new android.content.DialogInterface.OnClickListener() {
final KomentarAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
stat = "1";
(new FavoritTask()).execute(new Void[0]);
}
{
this$2 = KomentarAsycTask._cls6.this;
super();
}
});
view.setNeutralButton("Tidak", new android.content.DialogInterface.OnClickListener() {
final KomentarAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface.dismiss();
}
{
this$2 = KomentarAsycTask._cls6.this;
super();
}
});
view.show();
return;
}
} else
{
view = new android.app.AlertDialog.Builder(wrapperLight);
view.setMessage("Untuk menambahkan ke favorit harus login terlebih dahulu.");
view.setPositiveButton("Tutup", new android.content.DialogInterface.OnClickListener() {
final KomentarAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface.dismiss();
}
{
this$2 = KomentarAsycTask._cls6.this;
super();
}
});
view.setNeutralButton("Register", new android.content.DialogInterface.OnClickListener() {
final KomentarAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface = new Intent(_fld0, com/inponsel/android/v2/RegisterActivity);
startActivity(dialoginterface);
}
{
this$2 = KomentarAsycTask._cls6.this;
super();
}
});
view.setNegativeButton("Login", new android.content.DialogInterface.OnClickListener() {
final KomentarAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface = new Intent(_fld0, com/inponsel/android/v2/LoginActivity);
dialoginterface.putExtra("activity", "main");
startActivity(dialoginterface);
}
{
this$2 = KomentarAsycTask._cls6.this;
super();
}
});
view.show();
return;
}
}
{
this$1 = final_komentarasyctask;
since_id = String.this;
super();
}
});
list_lay_kom.setOnClickListener(s. new android.view.View.OnClickListener() {
final KomentarAsycTask this$1;
private final String val$avatar;
private final String val$media_url;
private final String val$screen_name;
private final String val$since_id;
private final String val$tweet_content;
private final String val$tweet_time;
public void onClick(View view)
{
idkom_pos = since_id;
view = new Intent(_fld0, com/inponsel/android/details/KomentarTwitter);
view.putExtra("tw_name", twitter);
view.putExtra("id_tw", idkom_pos);
view.putExtra("tweet_content", tweet_content);
view.putExtra("media_url", media_url);
view.putExtra("avatar", avatar);
view.putExtra("tweet_time", tweet_time);
view.putExtra("screen_name", screen_name);
startActivity(view);
}
{
this$1 = final_komentarasyctask;
since_id = s;
tweet_content = s1;
media_url = s2;
avatar = s3;
tweet_time = s4;
screen_name = String.this;
super();
}
});
void1.setOnClickListener(s. new android.view.View.OnClickListener() {
final KomentarAsycTask this$1;
private final String val$avatar;
private final String val$media_url;
private final String val$screen_name;
private final String val$since_id;
private final String val$tweet_content;
private final String val$tweet_time;
public void onClick(View view)
{
idkom_pos = since_id;
view = new Intent(_fld0, com/inponsel/android/details/KomentarTwitter);
view.putExtra("tw_name", twitter);
view.putExtra("id_tw", idkom_pos);
view.putExtra("tweet_content", tweet_content);
view.putExtra("media_url", media_url);
view.putExtra("avatar", avatar);
view.putExtra("tweet_time", tweet_time);
view.putExtra("screen_name", screen_name);
startActivity(view);
}
{
this$1 = final_komentarasyctask;
since_id = s;
tweet_content = s1;
media_url = s2;
avatar = s3;
tweet_time = s4;
screen_name = String.this;
super();
}
});
i++;
} while (true);
} else
{
txtbtnheader.setOnClickListener(new android.view.View.OnClickListener() {
final KomentarAsycTask this$1;
public void onClick(View view)
{
try
{
txtbtnheader.setVisibility(8);
limit = 0;
urlKomenLast = (new StringBuilder(String.valueOf(Util.BASE_PATH2))).append("vendor_twitter").append(Utility.BASE_FORMAT).append("?screen_name=").append(twitter).append("&since_id=").append(top_id).append("&t=").append(t).append("&idusr=").append(user_id).toString();
Log.e("urlKomenLast", urlKomenLast);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new KomentarNextAsycTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
return;
}
}
// Misplaced declaration of an exception variable
catch (View view)
{
return;
}
(new KomentarNextAsycTask()).execute(new String[0]);
return;
}
{
this$1 = KomentarAsycTask.this;
super();
}
});
txtbtnfooter.setOnClickListener(new android.view.View.OnClickListener() {
final KomentarAsycTask this$1;
public void onClick(View view)
{
try
{
limit = 0;
urlKomenOld = (new StringBuilder(String.valueOf(Util.BASE_PATH2))).append("vendor_twitter").append(Utility.BASE_FORMAT).append("?screen_name=").append(twitter).append("&max_id=").append(bottom_id).append("&t=").append(t).append("&idusr=").append(user_id).toString();
Log.e("urlKomenOld", urlKomenOld);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new KomentarOldAsycTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
return;
}
}
// Misplaced declaration of an exception variable
catch (View view)
{
return;
}
(new KomentarOldAsycTask()).execute(new String[0]);
return;
}
{
this$1 = KomentarAsycTask.this;
super();
}
});
scrollviewKomen.setVisibility(8);
layout_empty.setVisibility(0);
pop_progressbar_middle.setVisibility(8);
pop_txt_empty.setVisibility(0);
pop_txt_empty.setText("Belum ada komentar");
return;
}
}
protected void onPreExecute()
{
super.onPreExecute();
Log.e("KomentarAsycTask", "onPreExecute");
}
public KomentarAsycTask()
{
this$0 = TwitterInPonsel.this;
super();
}
}
public class KomentarNextAsycTask extends AsyncTask
{
final TwitterInPonsel this$0;
protected volatile transient Object doInBackground(Object aobj[])
{
return doInBackground((String[])aobj);
}
protected transient Void doInBackground(String as[])
{
JSONObject jsonobject = new JSONObject(getJSONUrl(urlKomenLast));
as = jsonobject.getJSONArray("InPonsel");
top_id = jsonobject.getString("top_id");
Log.e("top_id", top_id);
countKomOld = 0;
int i = 0;
_L1:
if (i >= as.length())
{
break MISSING_BLOCK_LABEL_247;
}
Object obj = TwitterInPonsel.this;
obj.countAllKom = ((TwitterInPonsel) (obj)).countAllKom + 1;
obj = TwitterInPonsel.this;
obj.countKomOld = ((TwitterInPonsel) (obj)).countKomOld + 1;
obj = as.getJSONObject(i);
mArrayListData.add(0, new ItemTwitter(((JSONObject) (obj)).getString("since_id"), ((JSONObject) (obj)).getString("tweet_content"), ((JSONObject) (obj)).getString("media_url"), ((JSONObject) (obj)).getString("avatar"), ((JSONObject) (obj)).getString("tweet_time"), ((JSONObject) (obj)).getString("real_name"), ((JSONObject) (obj)).getString("screen_name"), ((JSONObject) (obj)).getJSONObject("likedislike").getString("total_like"), ((JSONObject) (obj)).getJSONObject("likedislike").getString("total_dislike"), ((JSONObject) (obj)).getJSONObject("likedislike").getString("total_komen"), ((JSONObject) (obj)).getJSONObject("likedislike").getString("my_like_tweet"), ((JSONObject) (obj)).getJSONObject("likedislike").getString("my_fav_tweet")));
i++;
goto _L1
as;
as.printStackTrace();
strKonekStat = "0";
return null;
}
protected volatile void onPostExecute(Object obj)
{
onPostExecute((Void)obj);
}
protected void onPostExecute(Void void1)
{
txtbtnheader.setVisibility(0);
layout_header.setVisibility(8);
if (!strKonekStat.equals("-"))
{
int i = 0;
do
{
if (i >= mArrayListData.size())
{
txtbtnheader.setOnClickListener(new android.view.View.OnClickListener() {
final KomentarNextAsycTask this$1;
public void onClick(View view)
{
try
{
txtbtnheader.setVisibility(8);
limit = 0;
urlKomenLast = (new StringBuilder(String.valueOf(Util.BASE_PATH2))).append("vendor_twitter").append(Utility.BASE_FORMAT).append("?screen_name=").append(twitter).append("&since_id=").append(top_id).append("&t=").append(t).append("&idusr=").append(user_id).toString();
Log.e("urlKomenLast", urlKomenLast);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new KomentarNextAsycTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
return;
}
}
// Misplaced declaration of an exception variable
catch (View view)
{
return;
}
(new KomentarNextAsycTask()).execute(new String[0]);
return;
}
{
this$1 = KomentarNextAsycTask.this;
super();
}
});
txtbtnfooter.setOnClickListener(new android.view.View.OnClickListener() {
final KomentarNextAsycTask this$1;
public void onClick(View view)
{
try
{
limit = 0;
urlKomenOld = (new StringBuilder(String.valueOf(Util.BASE_PATH2))).append("vendor_twitter").append(Utility.BASE_FORMAT).append("?screen_name=").append(twitter).append("&max_id=").append(bottom_id).append("&t=").append(t).append("&idusr=").append(user_id).toString();
Log.e("urlKomenOld", urlKomenOld);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new KomentarOldAsycTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
return;
}
}
// Misplaced declaration of an exception variable
catch (View view)
{
return;
}
(new KomentarOldAsycTask()).execute(new String[0]);
return;
}
{
this$1 = KomentarNextAsycTask.this;
super();
}
});
layout_empty.setVisibility(8);
scrollviewKomen.setVisibility(0);
return;
}
void1 = ((LayoutInflater)getSystemService("layout_inflater")).inflate(0x7f0300cb, null);
txtUsername = (TextView)void1.findViewById(0x7f0b0419);
img_kom_picture = (ImageView)void1.findViewById(0x7f0b054b);
imageMedia = (ImageView)void1.findViewById(0x7f0b046c);
txtIdKom = (TextView)void1.findViewById(0x7f0b054d);
txtKomentar = (TextView)void1.findViewById(0x7f0b054e);
txtWaktu = (TextView)void1.findViewById(0x7f0b054c);
txtImgAva = (TextView)void1.findViewById(0x7f0b05e9);
txtImgMedia = (TextView)void1.findViewById(0x7f0b05ea);
ImageView imageview = (ImageView)void1.findViewById(0x7f0b054f);
ImageView imageview1 = (ImageView)void1.findViewById(0x7f0b0552);
txtLikeKom = (TextView)void1.findViewById(0x7f0b0551);
txtdisLikeKom = (TextView)void1.findViewById(0x7f0b0554);
txtTotalKom = (TextView)void1.findViewById(0x7f0b034a);
bottom_list = (LinearLayout)void1.findViewById(0x7f0b0341);
list_lay_like = (RelativeLayout)void1.findViewById(0x7f0b0342);
list_lay_dislike = (RelativeLayout)void1.findViewById(0x7f0b0345);
list_lay_kom = (RelativeLayout)void1.findViewById(0x7f0b0348);
final String since_id = ((ItemTwitter)mArrayListData.get(i)).getSince_id();
final String tweet_content = ((ItemTwitter)mArrayListData.get(i)).getTweet_content();
final String media_url = ((ItemTwitter)mArrayListData.get(i)).getMedia_url();
final String avatar = ((ItemTwitter)mArrayListData.get(i)).getAvatar();
final String tweet_time = ((ItemTwitter)mArrayListData.get(i)).getTweet_time();
String s1 = ((ItemTwitter)mArrayListData.get(i)).getReal_name();
String s = ((ItemTwitter)mArrayListData.get(i)).getScreen_name();
String s2 = ((ItemTwitter)mArrayListData.get(i)).getTotal_like();
String s3 = ((ItemTwitter)mArrayListData.get(i)).getTotal_dislike();
String s4 = ((ItemTwitter)mArrayListData.get(i)).getTotal_komen();
((ItemTwitter)mArrayListData.get(i)).getTotal_komen();
String s5 = ((ItemTwitter)mArrayListData.get(i)).getMy_like_tweet();
String s6 = ((ItemTwitter)mArrayListData.get(i)).getMy_fav_tweet();
if (twitter.toLowerCase().equals("inponsel"))
{
bottom_list.setVisibility(0);
} else
{
bottom_list.setVisibility(8);
}
txtIdKom.setText(since_id);
txtUsername.setText(Html.fromHtml((new StringBuilder("<font color='#000000'>")).append(s1).append("</font>").append("<small><font color='#cacaca'>").append("<br>@").append(s).append("</font><small>").toString()));
txtImgAva.setText(avatar);
txtImgMedia.setText(media_url);
txtKomentar.setText(Html.fromHtml(Utility.parseTweet(tweet_content)));
txtKomentar.setMovementMethod(com.inponsel.android.widget.TextViewFixTouchConsume.LocalLinkMovementMethod.getInstance());
txtLikeKom.setText(s2);
txtdisLikeKom.setText(s3);
txtTotalKom.setText(s4);
if (s5.toString().equals("1"))
{
imageview.setBackgroundResource(0x7f020264);
list_lay_like.setEnabled(false);
list_lay_dislike.setEnabled(true);
} else
if (s5.toString().equals("0"))
{
imageview.setBackgroundResource(0x7f020265);
imageview1.setBackgroundResource(0x7f0201a7);
list_lay_like.setEnabled(true);
list_lay_dislike.setEnabled(false);
} else
{
list_lay_like.setEnabled(true);
list_lay_dislike.setEnabled(true);
imageview.setBackgroundResource(0x7f020265);
list_lay_like.setBackgroundResource(0x7f020079);
list_lay_dislike.setBackgroundResource(0x7f020079);
}
if (s6.toString().equals("1"))
{
imageview1.setBackgroundResource(0x7f020303);
} else
if (s6.toString().equals("0"))
{
imageview1.setBackgroundResource(0x7f020302);
} else
{
imageview1.setBackgroundResource(0x7f020302);
}
try
{
Picasso.with(TwitterInPonsel.this).load(((ItemTwitter)mArrayListData.get(i)).getAvatar().toString().trim()).into(img_kom_picture, new Callback() {
final KomentarNextAsycTask this$1;
public void onError()
{
}
public void onSuccess()
{
img_kom_picture.setVisibility(0);
}
{
this$1 = KomentarNextAsycTask.this;
super();
}
});
}
catch (Exception exception)
{
exception.printStackTrace();
}
if (((ItemTwitter)mArrayListData.get(i)).getMedia_url().trim().equals(""))
{
imageMedia.setVisibility(8);
} else
{
try
{
Picasso.with(TwitterInPonsel.this).load(((ItemTwitter)mArrayListData.get(i)).getMedia_url().toString().trim()).into(imageMedia, new Callback() {
final KomentarNextAsycTask this$1;
public void onError()
{
}
public void onSuccess()
{
imageMedia.setVisibility(0);
}
{
this$1 = KomentarNextAsycTask.this;
super();
}
});
}
catch (Exception exception1)
{
exception1.printStackTrace();
}
}
txtWaktu.setText(Utility.convertDate(((ItemTwitter)mArrayListData.get(i)).getTweet_time()));
mLinearListView.addView(void1, 0);
imageMedia.setOnClickListener(media_url. new android.view.View.OnClickListener() {
final KomentarNextAsycTask this$1;
private final String val$media_url;
public void onClick(View view)
{
view = new ArrayList();
view.add(media_url);
view = (String[])view.toArray(new String[view.size()]);
Intent intent = new Intent(_fld0, com/inponsel/android/v2/ImagePagerActivity);
intent.putExtra("imgUrl", view);
intent.putExtra("pos", 0);
startActivity(intent);
}
{
this$1 = final_komentarnextasyctask;
media_url = String.this;
super();
}
});
img_kom_picture.setOnLongClickListener(avatar. new android.view.View.OnLongClickListener() {
final KomentarNextAsycTask this$1;
private final String val$avatar;
public boolean onLongClick(View view)
{
view = new ArrayList();
view.add((new StringBuilder(String.valueOf(Util.BASE_PATH_AVATAR))).append(avatar.toString().trim()).toString());
view = (String[])view.toArray(new String[view.size()]);
Intent intent = new Intent(_fld0, com/inponsel/android/v2/ImagePagerActivity);
intent.putExtra("imgUrl", view);
intent.putExtra("pos", 0);
startActivity(intent);
return false;
}
{
this$1 = final_komentarnextasyctask;
avatar = String.this;
super();
}
});
list_lay_like.setOnClickListener(since_id. new android.view.View.OnClickListener() {
final KomentarNextAsycTask this$1;
private final String val$since_id;
public void onClick(View view)
{
if (userFunctions.isUserLoggedIn(_fld0))
{
statuslike = "1";
idkom_pos = since_id;
querylike = (new StringBuilder("status=")).append(statuslike).append("&id_tw=").append(since_id).append("&id_usr=").append(user_id).append("&t=").append(t).toString();
Log.e("querylike", querylike);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new PostBagusKurangTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
return;
} else
{
(new PostBagusKurangTask()).execute(new Void[0]);
return;
}
} else
{
view = new android.app.AlertDialog.Builder(wrapperLight);
view.setMessage("Untuk memberi penilaian harus login terlebih dahulu.");
view.setPositiveButton("Tutup", new android.content.DialogInterface.OnClickListener() {
final KomentarNextAsycTask._cls5 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface.dismiss();
}
{
this$2 = KomentarNextAsycTask._cls5.this;
super();
}
});
view.setNeutralButton("Register", new android.content.DialogInterface.OnClickListener() {
final KomentarNextAsycTask._cls5 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface = new Intent(_fld0, com/inponsel/android/v2/RegisterActivity);
startActivity(dialoginterface);
}
{
this$2 = KomentarNextAsycTask._cls5.this;
super();
}
});
view.setNegativeButton("Login", new android.content.DialogInterface.OnClickListener() {
final KomentarNextAsycTask._cls5 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface = new Intent(_fld0, com/inponsel/android/v2/LoginActivity);
dialoginterface.putExtra("activity", "main");
startActivity(dialoginterface);
}
{
this$2 = KomentarNextAsycTask._cls5.this;
super();
}
});
view.show();
return;
}
}
{
this$1 = final_komentarnextasyctask;
since_id = String.this;
super();
}
});
list_lay_dislike.setOnClickListener(since_id. new android.view.View.OnClickListener() {
final KomentarNextAsycTask this$1;
private final String val$since_id;
public void onClick(View view)
{
idkom_pos = since_id;
if (userFunctions.isUserLoggedIn(_fld0))
{
if (db.checkIfExistTW(idkom_pos))
{
view = new android.app.AlertDialog.Builder(_fld0);
view.setMessage("Hapus tweet ini dari favorit?");
view.setPositiveButton("Ya", new android.content.DialogInterface.OnClickListener() {
final KomentarNextAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface.dismiss();
stat = "0";
(new FavoritTask()).execute(new Void[0]);
}
{
this$2 = KomentarNextAsycTask._cls6.this;
super();
}
});
view.setNegativeButton("Tidak", new android.content.DialogInterface.OnClickListener() {
final KomentarNextAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface.dismiss();
}
{
this$2 = KomentarNextAsycTask._cls6.this;
super();
}
});
view.show();
return;
} else
{
view = new android.app.AlertDialog.Builder(_fld0);
view.setMessage("Favoritkan tweet ini?");
view.setPositiveButton("Ya", new android.content.DialogInterface.OnClickListener() {
final KomentarNextAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
stat = "1";
(new FavoritTask()).execute(new Void[0]);
}
{
this$2 = KomentarNextAsycTask._cls6.this;
super();
}
});
view.setNeutralButton("Tidak", new android.content.DialogInterface.OnClickListener() {
final KomentarNextAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface.dismiss();
}
{
this$2 = KomentarNextAsycTask._cls6.this;
super();
}
});
view.show();
return;
}
} else
{
view = new android.app.AlertDialog.Builder(wrapperLight);
view.setMessage("Untuk menambahkan ke favorit harus login terlebih dahulu.");
view.setPositiveButton("Tutup", new android.content.DialogInterface.OnClickListener() {
final KomentarNextAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface.dismiss();
}
{
this$2 = KomentarNextAsycTask._cls6.this;
super();
}
});
view.setNeutralButton("Register", new android.content.DialogInterface.OnClickListener() {
final KomentarNextAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface = new Intent(_fld0, com/inponsel/android/v2/RegisterActivity);
startActivity(dialoginterface);
}
{
this$2 = KomentarNextAsycTask._cls6.this;
super();
}
});
view.setNegativeButton("Login", new android.content.DialogInterface.OnClickListener() {
final KomentarNextAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface = new Intent(_fld0, com/inponsel/android/v2/LoginActivity);
dialoginterface.putExtra("activity", "main");
startActivity(dialoginterface);
}
{
this$2 = KomentarNextAsycTask._cls6.this;
super();
}
});
view.show();
return;
}
}
{
this$1 = final_komentarnextasyctask;
since_id = String.this;
super();
}
});
list_lay_kom.setOnClickListener(s. new android.view.View.OnClickListener() {
final KomentarNextAsycTask this$1;
private final String val$avatar;
private final String val$media_url;
private final String val$screen_name;
private final String val$since_id;
private final String val$tweet_content;
private final String val$tweet_time;
public void onClick(View view)
{
idkom_pos = since_id;
view = new Intent(_fld0, com/inponsel/android/details/KomentarTwitter);
view.putExtra("tw_name", twitter);
view.putExtra("id_tw", idkom_pos);
view.putExtra("tweet_content", tweet_content);
view.putExtra("media_url", media_url);
view.putExtra("avatar", avatar);
view.putExtra("tweet_time", tweet_time);
view.putExtra("screen_name", screen_name);
startActivity(view);
}
{
this$1 = final_komentarnextasyctask;
since_id = s;
tweet_content = s1;
media_url = s2;
avatar = s3;
tweet_time = s4;
screen_name = String.this;
super();
}
});
void1.setOnClickListener(s. new android.view.View.OnClickListener() {
final KomentarNextAsycTask this$1;
private final String val$avatar;
private final String val$media_url;
private final String val$screen_name;
private final String val$since_id;
private final String val$tweet_content;
private final String val$tweet_time;
public void onClick(View view)
{
idkom_pos = since_id;
view = new Intent(_fld0, com/inponsel/android/details/KomentarTwitter);
view.putExtra("tw_name", twitter);
view.putExtra("id_tw", idkom_pos);
view.putExtra("tweet_content", tweet_content);
view.putExtra("media_url", media_url);
view.putExtra("avatar", avatar);
view.putExtra("tweet_time", tweet_time);
view.putExtra("screen_name", screen_name);
startActivity(view);
}
{
this$1 = final_komentarnextasyctask;
since_id = s;
tweet_content = s1;
media_url = s2;
avatar = s3;
tweet_time = s4;
screen_name = String.this;
super();
}
});
i++;
} while (true);
} else
{
txtbtnheader.setOnClickListener(new android.view.View.OnClickListener() {
final KomentarNextAsycTask this$1;
public void onClick(View view)
{
try
{
txtbtnheader.setVisibility(8);
limit = 0;
urlKomenLast = (new StringBuilder(String.valueOf(Util.BASE_PATH2))).append("vendor_twitter").append(Utility.BASE_FORMAT).append("?screen_name=").append(twitter).append("&since_id=").append(top_id).append("&t=").append(t).append("&idusr=").append(user_id).toString();
Log.e("urlKomenLast", urlKomenLast);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new KomentarNextAsycTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
return;
}
}
// Misplaced declaration of an exception variable
catch (View view)
{
return;
}
(new KomentarNextAsycTask()).execute(new String[0]);
return;
}
{
this$1 = KomentarNextAsycTask.this;
super();
}
});
txtbtnfooter.setOnClickListener(new android.view.View.OnClickListener() {
final KomentarNextAsycTask this$1;
public void onClick(View view)
{
try
{
limit = 0;
urlKomenOld = (new StringBuilder(String.valueOf(Util.BASE_PATH2))).append("vendor_twitter").append(Utility.BASE_FORMAT).append("?screen_name=").append(twitter).append("&max_id=").append(bottom_id).append("&t=").append(t).append("&idusr=").append(user_id).toString();
Log.e("urlKomenOld", urlKomenOld);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new KomentarOldAsycTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
return;
}
}
// Misplaced declaration of an exception variable
catch (View view)
{
return;
}
(new KomentarOldAsycTask()).execute(new String[0]);
return;
}
{
this$1 = KomentarNextAsycTask.this;
super();
}
});
scrollviewKomen.setVisibility(8);
layout_empty.setVisibility(0);
pop_progressbar_middle.setVisibility(8);
pop_txt_empty.setVisibility(0);
pop_txt_empty.setText("Belum ada komentar");
return;
}
}
protected void onPreExecute()
{
super.onPreExecute();
txtbtnheader.setVisibility(8);
layout_header.setVisibility(0);
mArrayListData.clear();
}
public KomentarNextAsycTask()
{
this$0 = TwitterInPonsel.this;
super();
}
}
public class KomentarOldAsycTask extends AsyncTask
{
final TwitterInPonsel this$0;
protected volatile transient Object doInBackground(Object aobj[])
{
return doInBackground((String[])aobj);
}
protected transient Void doInBackground(String as[])
{
JSONObject jsonobject = new JSONObject(getJSONUrl(urlKomenOld));
as = jsonobject.getJSONArray("InPonsel");
bottom_id = jsonobject.getString("bottom_id");
Log.e("bottom_id", bottom_id);
Log.e("top_id", top_id);
countKomOld = 0;
int i = 0;
_L1:
if (i >= as.length())
{
break MISSING_BLOCK_LABEL_259;
}
Object obj = TwitterInPonsel.this;
obj.countAllKom = ((TwitterInPonsel) (obj)).countAllKom + 1;
obj = TwitterInPonsel.this;
obj.countKomOld = ((TwitterInPonsel) (obj)).countKomOld + 1;
obj = as.getJSONObject(i);
mArrayListData.add(new ItemTwitter(((JSONObject) (obj)).getString("since_id"), ((JSONObject) (obj)).getString("tweet_content"), ((JSONObject) (obj)).getString("media_url"), ((JSONObject) (obj)).getString("avatar"), ((JSONObject) (obj)).getString("tweet_time"), ((JSONObject) (obj)).getString("real_name"), ((JSONObject) (obj)).getString("screen_name"), ((JSONObject) (obj)).getJSONObject("likedislike").getString("total_like"), ((JSONObject) (obj)).getJSONObject("likedislike").getString("total_dislike"), ((JSONObject) (obj)).getJSONObject("likedislike").getString("total_komen"), ((JSONObject) (obj)).getJSONObject("likedislike").getString("my_like_tweet"), ((JSONObject) (obj)).getJSONObject("likedislike").getString("my_fav_tweet")));
i++;
goto _L1
as;
as.printStackTrace();
strKonekStat = "0";
return null;
}
protected volatile void onPostExecute(Object obj)
{
onPostExecute((Void)obj);
}
protected void onPostExecute(Void void1)
{
txtbtnfooter.setVisibility(0);
layout_footerNext.setVisibility(8);
Log.e("mArrayListDataOld", String.valueOf(mArrayListData.size()));
if (!strKonekStat.equals("-"))
{
int i = 0;
do
{
if (i >= mArrayListData.size())
{
txtbtnheader.setOnClickListener(new android.view.View.OnClickListener() {
final KomentarOldAsycTask this$1;
public void onClick(View view)
{
try
{
txtbtnheader.setVisibility(8);
limit = 0;
urlKomenLast = (new StringBuilder(String.valueOf(Util.BASE_PATH2))).append("vendor_twitter").append(Utility.BASE_FORMAT).append("?screen_name=").append(twitter).append("&since_id=").append(top_id).append("&t=").append(t).append("&idusr=").append(user_id).toString();
Log.e("urlKomenLast", urlKomenLast);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new KomentarNextAsycTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
return;
}
}
// Misplaced declaration of an exception variable
catch (View view)
{
return;
}
(new KomentarNextAsycTask()).execute(new String[0]);
return;
}
{
this$1 = KomentarOldAsycTask.this;
super();
}
});
txtbtnfooter.setOnClickListener(new android.view.View.OnClickListener() {
final KomentarOldAsycTask this$1;
public void onClick(View view)
{
try
{
limit = 0;
urlKomenOld = (new StringBuilder(String.valueOf(Util.BASE_PATH2))).append("vendor_twitter").append(Utility.BASE_FORMAT).append("?screen_name=").append(twitter).append("&max_id=").append(bottom_id).append("&t=").append(t).append("&idusr=").append(user_id).toString();
Log.e("urlKomenOld", urlKomenOld);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new KomentarOldAsycTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
return;
}
}
// Misplaced declaration of an exception variable
catch (View view)
{
return;
}
(new KomentarOldAsycTask()).execute(new String[0]);
return;
}
{
this$1 = KomentarOldAsycTask.this;
super();
}
});
layout_empty.setVisibility(8);
scrollviewKomen.setVisibility(0);
return;
}
void1 = ((LayoutInflater)getSystemService("layout_inflater")).inflate(0x7f0300cb, null);
txtUsername = (TextView)void1.findViewById(0x7f0b0419);
img_kom_picture = (ImageView)void1.findViewById(0x7f0b054b);
imageMedia = (ImageView)void1.findViewById(0x7f0b046c);
txtIdKom = (TextView)void1.findViewById(0x7f0b054d);
txtKomentar = (TextView)void1.findViewById(0x7f0b054e);
txtWaktu = (TextView)void1.findViewById(0x7f0b054c);
txtImgAva = (TextView)void1.findViewById(0x7f0b05e9);
txtImgMedia = (TextView)void1.findViewById(0x7f0b05ea);
ImageView imageview = (ImageView)void1.findViewById(0x7f0b054f);
ImageView imageview1 = (ImageView)void1.findViewById(0x7f0b0552);
txtLikeKom = (TextView)void1.findViewById(0x7f0b0551);
txtdisLikeKom = (TextView)void1.findViewById(0x7f0b0554);
txtTotalKom = (TextView)void1.findViewById(0x7f0b034a);
bottom_list = (LinearLayout)void1.findViewById(0x7f0b0341);
list_lay_like = (RelativeLayout)void1.findViewById(0x7f0b0342);
list_lay_dislike = (RelativeLayout)void1.findViewById(0x7f0b0345);
list_lay_kom = (RelativeLayout)void1.findViewById(0x7f0b0348);
final String since_id = ((ItemTwitter)mArrayListData.get(i)).getSince_id();
final String tweet_content = ((ItemTwitter)mArrayListData.get(i)).getTweet_content();
final String media_url = ((ItemTwitter)mArrayListData.get(i)).getMedia_url();
final String avatar = ((ItemTwitter)mArrayListData.get(i)).getAvatar();
final String tweet_time = ((ItemTwitter)mArrayListData.get(i)).getTweet_time();
String s1 = ((ItemTwitter)mArrayListData.get(i)).getReal_name();
String s = ((ItemTwitter)mArrayListData.get(i)).getScreen_name();
String s2 = ((ItemTwitter)mArrayListData.get(i)).getTotal_like();
String s3 = ((ItemTwitter)mArrayListData.get(i)).getTotal_dislike();
String s4 = ((ItemTwitter)mArrayListData.get(i)).getTotal_komen();
((ItemTwitter)mArrayListData.get(i)).getTotal_komen();
String s5 = ((ItemTwitter)mArrayListData.get(i)).getMy_like_tweet();
String s6 = ((ItemTwitter)mArrayListData.get(i)).getMy_fav_tweet();
if (twitter.toLowerCase().equals("inponsel"))
{
bottom_list.setVisibility(0);
} else
{
bottom_list.setVisibility(8);
}
txtIdKom.setText(since_id);
txtUsername.setText(Html.fromHtml((new StringBuilder("<font color='#000000'>")).append(s1).append("</font>").append("<small><font color='#cacaca'>").append("<br>@").append(s).append("</font><small>").toString()));
txtImgAva.setText(avatar);
txtImgMedia.setText(media_url);
txtKomentar.setText(Html.fromHtml(Utility.parseTweet(tweet_content)));
txtKomentar.setMovementMethod(com.inponsel.android.widget.TextViewFixTouchConsume.LocalLinkMovementMethod.getInstance());
txtLikeKom.setText(s2);
txtdisLikeKom.setText(s3);
txtTotalKom.setText(s4);
if (s5.toString().equals("1"))
{
imageview.setBackgroundResource(0x7f020264);
list_lay_like.setEnabled(false);
list_lay_dislike.setEnabled(true);
} else
if (s5.toString().equals("0"))
{
imageview.setBackgroundResource(0x7f020265);
imageview1.setBackgroundResource(0x7f0201a7);
list_lay_like.setEnabled(true);
list_lay_dislike.setEnabled(false);
} else
{
list_lay_like.setEnabled(true);
list_lay_dislike.setEnabled(true);
imageview.setBackgroundResource(0x7f020265);
list_lay_like.setBackgroundResource(0x7f020079);
list_lay_dislike.setBackgroundResource(0x7f020079);
}
if (s6.toString().equals("1"))
{
imageview1.setBackgroundResource(0x7f020303);
} else
if (s6.toString().equals("0"))
{
imageview1.setBackgroundResource(0x7f020302);
} else
{
imageview1.setBackgroundResource(0x7f020302);
}
try
{
Picasso.with(TwitterInPonsel.this).load(((ItemTwitter)mArrayListData.get(i)).getAvatar().toString().trim()).into(img_kom_picture, new Callback() {
final KomentarOldAsycTask this$1;
public void onError()
{
}
public void onSuccess()
{
img_kom_picture.setVisibility(0);
}
{
this$1 = KomentarOldAsycTask.this;
super();
}
});
}
catch (Exception exception)
{
exception.printStackTrace();
}
if (((ItemTwitter)mArrayListData.get(i)).getMedia_url().trim().equals(""))
{
imageMedia.setVisibility(8);
} else
{
try
{
Picasso.with(TwitterInPonsel.this).load(((ItemTwitter)mArrayListData.get(i)).getMedia_url().toString().trim()).into(imageMedia, new Callback() {
final KomentarOldAsycTask this$1;
public void onError()
{
}
public void onSuccess()
{
imageMedia.setVisibility(0);
}
{
this$1 = KomentarOldAsycTask.this;
super();
}
});
}
catch (Exception exception1)
{
exception1.printStackTrace();
}
}
txtWaktu.setText(Utility.convertDate(((ItemTwitter)mArrayListData.get(i)).getTweet_time()));
mLinearListView.addView(void1, mLinearListView.getChildCount());
imageMedia.setOnClickListener(media_url. new android.view.View.OnClickListener() {
final KomentarOldAsycTask this$1;
private final String val$media_url;
public void onClick(View view)
{
view = new ArrayList();
view.add(media_url);
view = (String[])view.toArray(new String[view.size()]);
Intent intent = new Intent(_fld0, com/inponsel/android/v2/ImagePagerActivity);
intent.putExtra("imgUrl", view);
intent.putExtra("pos", 0);
startActivity(intent);
}
{
this$1 = final_komentaroldasyctask;
media_url = String.this;
super();
}
});
img_kom_picture.setOnLongClickListener(avatar. new android.view.View.OnLongClickListener() {
final KomentarOldAsycTask this$1;
private final String val$avatar;
public boolean onLongClick(View view)
{
view = new ArrayList();
view.add((new StringBuilder(String.valueOf(Util.BASE_PATH_AVATAR))).append(avatar.toString().trim()).toString());
view = (String[])view.toArray(new String[view.size()]);
Intent intent = new Intent(_fld0, com/inponsel/android/v2/ImagePagerActivity);
intent.putExtra("imgUrl", view);
intent.putExtra("pos", 0);
startActivity(intent);
return false;
}
{
this$1 = final_komentaroldasyctask;
avatar = String.this;
super();
}
});
list_lay_like.setOnClickListener(since_id. new android.view.View.OnClickListener() {
final KomentarOldAsycTask this$1;
private final String val$since_id;
public void onClick(View view)
{
if (userFunctions.isUserLoggedIn(_fld0))
{
statuslike = "1";
idkom_pos = since_id;
querylike = (new StringBuilder("status=")).append(statuslike).append("&id_tw=").append(since_id).append("&id_usr=").append(user_id).append("&t=").append(t).toString();
Log.e("querylike", querylike);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new PostBagusKurangTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
return;
} else
{
(new PostBagusKurangTask()).execute(new Void[0]);
return;
}
} else
{
view = new android.app.AlertDialog.Builder(wrapperLight);
view.setMessage("Untuk memberi penilaian harus login terlebih dahulu.");
view.setPositiveButton("Tutup", new android.content.DialogInterface.OnClickListener() {
final KomentarOldAsycTask._cls5 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface.dismiss();
}
{
this$2 = KomentarOldAsycTask._cls5.this;
super();
}
});
view.setNeutralButton("Register", new android.content.DialogInterface.OnClickListener() {
final KomentarOldAsycTask._cls5 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface = new Intent(_fld0, com/inponsel/android/v2/RegisterActivity);
startActivity(dialoginterface);
}
{
this$2 = KomentarOldAsycTask._cls5.this;
super();
}
});
view.setNegativeButton("Login", new android.content.DialogInterface.OnClickListener() {
final KomentarOldAsycTask._cls5 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface = new Intent(_fld0, com/inponsel/android/v2/LoginActivity);
dialoginterface.putExtra("activity", "main");
startActivity(dialoginterface);
}
{
this$2 = KomentarOldAsycTask._cls5.this;
super();
}
});
view.show();
return;
}
}
{
this$1 = final_komentaroldasyctask;
since_id = String.this;
super();
}
});
list_lay_dislike.setOnClickListener(since_id. new android.view.View.OnClickListener() {
final KomentarOldAsycTask this$1;
private final String val$since_id;
public void onClick(View view)
{
idkom_pos = since_id;
if (userFunctions.isUserLoggedIn(_fld0))
{
if (db.checkIfExistTW(idkom_pos))
{
view = new android.app.AlertDialog.Builder(_fld0);
view.setMessage("Hapus tweet ini dari favorit?");
view.setPositiveButton("Ya", new android.content.DialogInterface.OnClickListener() {
final KomentarOldAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface.dismiss();
stat = "0";
(new FavoritTask()).execute(new Void[0]);
}
{
this$2 = KomentarOldAsycTask._cls6.this;
super();
}
});
view.setNegativeButton("Tidak", new android.content.DialogInterface.OnClickListener() {
final KomentarOldAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface.dismiss();
}
{
this$2 = KomentarOldAsycTask._cls6.this;
super();
}
});
view.show();
return;
} else
{
view = new android.app.AlertDialog.Builder(_fld0);
view.setMessage("Favoritkan tweet ini?");
view.setPositiveButton("Ya", new android.content.DialogInterface.OnClickListener() {
final KomentarOldAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
stat = "1";
(new FavoritTask()).execute(new Void[0]);
}
{
this$2 = KomentarOldAsycTask._cls6.this;
super();
}
});
view.setNeutralButton("Tidak", new android.content.DialogInterface.OnClickListener() {
final KomentarOldAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface.dismiss();
}
{
this$2 = KomentarOldAsycTask._cls6.this;
super();
}
});
view.show();
return;
}
} else
{
view = new android.app.AlertDialog.Builder(wrapperLight);
view.setMessage("Untuk menambahkan ke favorit harus login terlebih dahulu.");
view.setPositiveButton("Tutup", new android.content.DialogInterface.OnClickListener() {
final KomentarOldAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface.dismiss();
}
{
this$2 = KomentarOldAsycTask._cls6.this;
super();
}
});
view.setNeutralButton("Register", new android.content.DialogInterface.OnClickListener() {
final KomentarOldAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface = new Intent(_fld0, com/inponsel/android/v2/RegisterActivity);
startActivity(dialoginterface);
}
{
this$2 = KomentarOldAsycTask._cls6.this;
super();
}
});
view.setNegativeButton("Login", new android.content.DialogInterface.OnClickListener() {
final KomentarOldAsycTask._cls6 this$2;
public void onClick(DialogInterface dialoginterface, int i)
{
dialoginterface = new Intent(_fld0, com/inponsel/android/v2/LoginActivity);
dialoginterface.putExtra("activity", "main");
startActivity(dialoginterface);
}
{
this$2 = KomentarOldAsycTask._cls6.this;
super();
}
});
view.show();
return;
}
}
{
this$1 = final_komentaroldasyctask;
since_id = String.this;
super();
}
});
list_lay_kom.setOnClickListener(s. new android.view.View.OnClickListener() {
final KomentarOldAsycTask this$1;
private final String val$avatar;
private final String val$media_url;
private final String val$screen_name;
private final String val$since_id;
private final String val$tweet_content;
private final String val$tweet_time;
public void onClick(View view)
{
idkom_pos = since_id;
view = new Intent(_fld0, com/inponsel/android/details/KomentarTwitter);
view.putExtra("tw_name", twitter);
view.putExtra("id_tw", idkom_pos);
view.putExtra("tweet_content", tweet_content);
view.putExtra("media_url", media_url);
view.putExtra("avatar", avatar);
view.putExtra("tweet_time", tweet_time);
view.putExtra("screen_name", screen_name);
startActivity(view);
}
{
this$1 = final_komentaroldasyctask;
since_id = s;
tweet_content = s1;
media_url = s2;
avatar = s3;
tweet_time = s4;
screen_name = String.this;
super();
}
});
void1.setOnClickListener(s. new android.view.View.OnClickListener() {
final KomentarOldAsycTask this$1;
private final String val$avatar;
private final String val$media_url;
private final String val$screen_name;
private final String val$since_id;
private final String val$tweet_content;
private final String val$tweet_time;
public void onClick(View view)
{
idkom_pos = since_id;
view = new Intent(_fld0, com/inponsel/android/details/KomentarTwitter);
view.putExtra("tw_name", twitter);
view.putExtra("id_tw", idkom_pos);
view.putExtra("tweet_content", tweet_content);
view.putExtra("media_url", media_url);
view.putExtra("avatar", avatar);
view.putExtra("tweet_time", tweet_time);
view.putExtra("screen_name", screen_name);
startActivity(view);
}
{
this$1 = final_komentaroldasyctask;
since_id = s;
tweet_content = s1;
media_url = s2;
avatar = s3;
tweet_time = s4;
screen_name = String.this;
super();
}
});
i++;
} while (true);
} else
{
txtbtnheader.setOnClickListener(new android.view.View.OnClickListener() {
final KomentarOldAsycTask this$1;
public void onClick(View view)
{
try
{
txtbtnheader.setVisibility(8);
limit = 0;
urlKomenLast = (new StringBuilder(String.valueOf(Util.BASE_PATH2))).append("vendor_twitter").append(Utility.BASE_FORMAT).append("?screen_name=").append(twitter).append("&since_id=").append(top_id).append("&t=").append(t).append("&idusr=").append(user_id).toString();
Log.e("urlKomenLast", urlKomenLast);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new KomentarNextAsycTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
return;
}
}
// Misplaced declaration of an exception variable
catch (View view)
{
return;
}
(new KomentarNextAsycTask()).execute(new String[0]);
return;
}
{
this$1 = KomentarOldAsycTask.this;
super();
}
});
txtbtnfooter.setOnClickListener(new android.view.View.OnClickListener() {
final KomentarOldAsycTask this$1;
public void onClick(View view)
{
try
{
limit = 0;
urlKomenOld = (new StringBuilder(String.valueOf(Util.BASE_PATH2))).append("vendor_twitter").append(Utility.BASE_FORMAT).append("?screen_name=").append(twitter).append("&max_id=").append(bottom_id).append("&t=").append(t).append("&idusr=").append(user_id).toString();
Log.e("urlKomenOld", urlKomenOld);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new KomentarOldAsycTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
return;
}
}
// Misplaced declaration of an exception variable
catch (View view)
{
return;
}
(new KomentarOldAsycTask()).execute(new String[0]);
return;
}
{
this$1 = KomentarOldAsycTask.this;
super();
}
});
scrollviewKomen.setVisibility(8);
layout_empty.setVisibility(0);
pop_progressbar_middle.setVisibility(8);
pop_txt_empty.setVisibility(0);
pop_txt_empty.setText("Belum ada komentar");
return;
}
}
protected void onPreExecute()
{
super.onPreExecute();
txtbtnfooter.setVisibility(8);
layout_footerNext.setVisibility(0);
Log.e("mArrayListDataOld", String.valueOf(mArrayListData.size()));
mArrayListData.clear();
Log.e("mArrayListDataOld", String.valueOf(mArrayListData.size()));
}
public KomentarOldAsycTask()
{
this$0 = TwitterInPonsel.this;
super();
}
}
public class PostBagusKurangTask extends AsyncTask
{
final TwitterInPonsel this$0;
private void parseJSONLikeKom(String s)
{
int i;
try
{
s = new JSONObject(s);
postStatusLikeKom = s.getString("success");
postMessageLikeKom = s.getString("message");
jArray = s.getJSONArray("InPonsel");
}
// Misplaced declaration of an exception variable
catch (String s)
{
s.printStackTrace();
return;
}
i = 0;
if (i >= jArray.length())
{
return;
}
s = jArray.getJSONObject(i);
tot_LikeKom = s.getString("total_like");
totdis_LikeKom = s.getString("total_dislike");
Log.e("tot_LikePon", tot_LikeKom);
Log.e("totdis_LikePon", totdis_LikeKom);
i++;
if (false)
{
} else
{
break MISSING_BLOCK_LABEL_50;
}
}
protected volatile transient Object doInBackground(Object aobj[])
{
return doInBackground((Void[])aobj);
}
protected transient Void doInBackground(Void avoid[])
{
try
{
if (android.os.Build.VERSION.SDK_INT >= 11)
{
avoid = StrictMode.getThreadPolicy();
StrictMode.setThreadPolicy((new android.os.StrictMode.ThreadPolicy.Builder(avoid)).permitDiskWrites().build());
StrictMode.setThreadPolicy(avoid);
}
avoid = (new StringBuilder(String.valueOf(Util.BASE_PATH2))).append("likedis_tweet.php?").append(querylike).toString();
Log.e("pushURL", avoid);
avoid = HttpPush.getResponse(avoid);
reslike = avoid.toString();
parseJSONLikeKom(reslike);
}
// Misplaced declaration of an exception variable
catch (Void avoid[])
{
avoid.printStackTrace();
}
return null;
}
protected volatile void onPostExecute(Object obj)
{
onPostExecute((Void)obj);
}
protected void onPostExecute(Void void1)
{
super.onPostExecute(void1);
Log.e("postStatusLikeKom", postStatusLikeKom);
if (!postStatusLikeKom.equals("1"))
{
break MISSING_BLOCK_LABEL_179;
}
if (!statuslike.equals("1"))
{
break MISSING_BLOCK_LABEL_134;
}
notificationLikeHelper.completed((new StringBuilder("Twitter ")).append(twitter).toString(), notificationLikeHelper.suclikefrontKomen);
_L1:
Log.e("mArrayListData", String.valueOf(mArrayListData.size()));
Log.e("index_komposlike", idkom_pos);
updateViewLikeDis(idkom_pos);
return;
try
{
notificationLikeHelper.completed((new StringBuilder("Twitter ")).append(twitter).toString(), notificationLikeHelper.sucdislikefrontKomen);
}
// Misplaced declaration of an exception variable
catch (Void void1)
{
return;
}
goto _L1
if (statuslike.equals("1"))
{
notificationLikeHelper.gagal((new StringBuilder("Twitter ")).append(twitter).toString(), notificationLikeHelper.gaglikefrontKomen);
return;
}
notificationLikeHelper.gagal((new StringBuilder("Twitter ")).append(twitter).toString(), notificationLikeHelper.gagdislikefrontKomen);
return;
}
protected void onPreExecute()
{
super.onPreExecute();
if (statuslike.equals("1"))
{
notificationLikeHelper.createNotification((new StringBuilder("Twitter ")).append(twitter).toString(), notificationLikeHelper.likefrontKomen);
return;
} else
{
notificationLikeHelper.createNotification((new StringBuilder("Twitter ")).append(twitter).toString(), notificationLikeHelper.dislikefrontKomen);
return;
}
}
public PostBagusKurangTask()
{
this$0 = TwitterInPonsel.this;
super();
}
}
ActionBar actionBar;
int actionBarTitleId;
String bottom_id;
LinearLayout bottom_list;
Button btnRefresh;
int charCount;
ConnectivityManager cm;
int countAllKom;
int countKomOld;
int countRemIndex;
Cursor cursor;
DatabaseHandler db;
String email_user;
Bundle extras;
LinearLayout grup_footer;
LinearLayout grup_header;
String idkom_pos;
ImageView imageMedia;
ImageView img_kom_picture;
InputMethodManager imm;
JSONArray jArray;
String jum_komen;
String komencount;
LinearLayout lay_quote;
LinearLayout layout_empty;
LinearLayout layout_footerNext;
LinearLayout layout_header;
int limit;
RelativeLayout list_lay_dislike;
RelativeLayout list_lay_kom;
RelativeLayout list_lay_like;
private ArrayList mArrayListData;
ProgressDialog mDialog;
private LinearLayout mLinearListView;
String nama_asli;
NotificationLikeTwHelper notificationLikeHelper;
PonselBaseApp ponselBaseApp;
ProgressBar pop_progressbar_middle;
TextView pop_txt_empty;
String postMessage;
String postMessageLikeKom;
String postStatus;
String postStatusLikeKom;
String querylike;
String querypopkomen;
int removeIndex;
int removeNextIndex;
int removeStartOld;
String res;
String reslike;
ScrollView scrollviewKomen;
String stat;
String statuslike;
String strKonekStat;
String succesStat;
String t;
String top_id;
String tot_LikeKom;
String tot_LikePon;
String totdis_LikeKom;
String totdis_LikePon;
String twitter;
TextView txtIdKom;
TextView txtImgAva;
TextView txtImgMedia;
TextView txtKomentar;
TextView txtKomentarQoute;
TextView txtLikeKom;
TextView txtTanggapan;
TextView txtTotalKom;
TextView txtUsername;
TextView txtUsernameQoute;
TextView txtWaktu;
TextView txtWaktuQoute;
TextView txtbtnfooter;
TextView txtbtnheader;
TextView txtdisLikeKom;
String urlKomen;
String urlKomenLast;
String urlKomenOld;
private boolean useLogo;
UserFunctions userFunctions;
String user_id;
String user_jekel;
String user_joindate;
String user_kota;
String user_photo;
String user_ponsel1;
String user_ponsel2;
String user_profile_update;
String user_provider1;
String user_provider2;
String user_provinsi;
String user_ttl;
String username;
ContextThemeWrapper wrapperLight;
public TwitterInPonsel()
{
urlKomen = "";
urlKomenOld = "";
urlKomenLast = "";
strKonekStat = "";
bottom_id = "";
top_id = "0";
jum_komen = "0";
tot_LikePon = "";
totdis_LikePon = "";
succesStat = "";
countKomOld = 0;
countAllKom = 0;
postStatus = "";
postMessage = "";
removeIndex = 0;
removeStartOld = 0;
removeNextIndex = 0;
countRemIndex = 0;
querylike = "";
postStatusLikeKom = "";
postMessageLikeKom = "Gagal mengirim";
tot_LikeKom = "0";
totdis_LikeKom = "0";
limit = 0;
komencount = "";
querypopkomen = "";
useLogo = false;
actionBarTitleId = Resources.getSystem().getIdentifier("action_bar_title", "id", "android");
user_photo = "";
username = "";
stat = "";
t = Utility.session(RestClient.pelihara);
}
private void setTranslucentStatus(boolean flag)
{
Window window = getWindow();
android.view.WindowManager.LayoutParams layoutparams = window.getAttributes();
if (flag)
{
layoutparams.flags = layoutparams.flags | 0x4000000;
} else
{
layoutparams.flags = layoutparams.flags & 0xfbffffff;
}
window.setAttributes(layoutparams);
}
public String BitMapToString(Bitmap bitmap)
{
ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
bitmap.compress(android.graphics.Bitmap.CompressFormat.PNG, 100, bytearrayoutputstream);
return Base64.encodeToString(bytearrayoutputstream.toByteArray(), 0);
}
public String getJSONUrl(String s)
{
StringBuilder stringbuilder;
Object obj;
stringbuilder = new StringBuilder();
obj = new DefaultHttpClient();
s = new HttpGet(s);
s = ((HttpClient) (obj)).execute(s);
if (s.getStatusLine().getStatusCode() != 200)
{
break MISSING_BLOCK_LABEL_107;
}
s = new BufferedReader(new InputStreamReader(s.getEntity().getContent()));
_L3:
obj = s.readLine();
if (obj != null) goto _L2; else goto _L1
_L1:
return stringbuilder.toString();
_L2:
stringbuilder.append(((String) (obj)));
goto _L3
try
{
Log.e("Log", "Failed to download file..");
}
// Misplaced declaration of an exception variable
catch (String s)
{
s.printStackTrace();
}
// Misplaced declaration of an exception variable
catch (String s)
{
s.printStackTrace();
}
goto _L1
}
protected void onActivityResult(int i, int j, Intent intent)
{
Log.e("onActivityResult", "RESULT_OK");
if (j != -1)
{
break MISSING_BLOCK_LABEL_102;
}
intent = intent.getStringExtra("postStatus");
android.util.Log.e("onActivityResultAct", intent);
if (!intent.equals("1"))
{
break MISSING_BLOCK_LABEL_111;
}
try
{
limit = 0;
Log.e("urlKomenLastKom", urlKomenLast);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new KomentarNextAsycTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
return;
}
}
// Misplaced declaration of an exception variable
catch (Intent intent)
{
return;
}
(new KomentarNextAsycTask()).execute(new String[0]);
return;
Log.e("onActivityResult", "false");
}
protected void onCreate(Bundle bundle)
{
super.onCreate(bundle);
setContentView(0x7f030113);
if (android.os.Build.VERSION.SDK_INT >= 19)
{
setTranslucentStatus(true);
}
bundle = new SystemBarTintManager(this);
bundle.setStatusBarTintEnabled(true);
bundle.setStatusBarTintResource(0x7f080160);
wrapperLight = new ContextThemeWrapper(this, 0x103006e);
ponselBaseApp = (PonselBaseApp)getApplication();
ponselBaseApp.getObserver().addObserver(this);
userFunctions = new UserFunctions();
db = new DatabaseHandler(this);
imm = (InputMethodManager)getSystemService("input_method");
cm = (ConnectivityManager)getSystemService("connectivity");
t = Utility.session(t);
extras = getIntent().getExtras();
twitter = extras.getString("twitter");
int i;
int j;
try
{
bundle = ((PonselBaseApp)getApplication()).getTracker(com.inponsel.android.adapter.PonselBaseApp.TrackerName.APP_TRACKER);
bundle.setScreenName((new StringBuilder("Twitter ")).append(twitter).toString());
bundle.send((new com.google.android.gms.analytics.HitBuilders.AppViewBuilder()).build());
}
// Misplaced declaration of an exception variable
catch (Bundle bundle)
{
bundle.printStackTrace();
}
t = Utility.session(t);
actionBar = getSupportActionBar();
actionBar.setDisplayUseLogoEnabled(useLogo);
actionBar.setBackgroundDrawable(getResources().getDrawable(0x7f0200e5));
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
j = Resources.getSystem().getIdentifier("action_bar_title", "id", "android");
i = j;
if (j == 0)
{
i = 0x7f0b0037;
}
getSupportActionBar().setTitle(Html.fromHtml((new StringBuilder("<font color='#FFFFFF'>")).append(URLDecoder.decode((new StringBuilder("Twitter ")).append(twitter).toString())).append("</font>").toString()));
bundle = (TextView)findViewById(i);
bundle.setSelected(true);
bundle.setTextColor(Color.parseColor("#FFFFFF"));
bundle.setText(URLDecoder.decode((new StringBuilder("Twitter ")).append(twitter).toString()));
bundle.setEllipsize(android.text.TextUtils.TruncateAt.MARQUEE);
mLinearListView = (LinearLayout)findViewById(0x7f0b04d8);
notificationLikeHelper = new NotificationLikeTwHelper(this);
mArrayListData = new ArrayList();
txtbtnheader = (TextView)findViewById(0x7f0b04d4);
txtbtnfooter = (TextView)findViewById(0x7f0b04d9);
layout_header = (LinearLayout)findViewById(0x7f0b04d5);
grup_footer = (LinearLayout)findViewById(0x7f0b00be);
layout_footerNext = (LinearLayout)findViewById(0x7f0b00c0);
grup_header = (LinearLayout)findViewById(0x7f0b04d3);
layout_empty = (LinearLayout)findViewById(0x7f0b0091);
scrollviewKomen = (ScrollView)findViewById(0x7f0b052d);
pop_progressbar_middle = (ProgressBar)findViewById(0x7f0b04ce);
pop_txt_empty = (TextView)findViewById(0x7f0b04cf);
pop_txt_empty.setVisibility(8);
scrollviewKomen.setVisibility(8);
btnRefresh = (Button)findViewById(0x7f0b04d0);
if (userFunctions.isUserLoggedIn(this))
{
cursor = db.getAllData();
cursor.moveToFirst();
try
{
user_id = EncodeDecodeAES.decrypt(RestClient.pelihara, cursor.getString(1));
}
// Misplaced declaration of an exception variable
catch (Bundle bundle) { }
nama_asli = cursor.getString(2);
username = cursor.getString(4);
email_user = cursor.getString(5);
user_ttl = cursor.getString(6);
user_provinsi = cursor.getString(7);
user_kota = cursor.getString(8);
user_jekel = cursor.getString(9);
user_ponsel1 = cursor.getString(10);
user_ponsel2 = cursor.getString(11);
user_provider1 = cursor.getString(12);
user_provider2 = cursor.getString(13);
user_joindate = cursor.getString(14);
user_profile_update = cursor.getString(15);
cursor.close();
}
try
{
urlKomen = (new StringBuilder(String.valueOf(Util.BASE_PATH2))).append("vendor_twitter").append(Utility.BASE_FORMAT).append("?screen_name=").append(twitter).append("&lmt=").append(limit).append("&t=").append(t).append("&idusr=").append(user_id).toString();
Log.e("urlKomen", urlKomen);
}
// Misplaced declaration of an exception variable
catch (Bundle bundle) { }
layout_empty.setVisibility(0);
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new KomentarAsycTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
} else
{
(new KomentarAsycTask()).execute(new String[0]);
}
grup_header.setOnClickListener(new android.view.View.OnClickListener() {
final TwitterInPonsel this$0;
public void onClick(View view)
{
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new KomentarNextAsycTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
return;
} else
{
(new KomentarNextAsycTask()).execute(new String[0]);
return;
}
}
{
this$0 = TwitterInPonsel.this;
super();
}
});
grup_footer.setOnClickListener(new android.view.View.OnClickListener() {
final TwitterInPonsel this$0;
public void onClick(View view)
{
if (android.os.Build.VERSION.SDK_INT >= 11)
{
(new KomentarOldAsycTask()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
return;
} else
{
(new KomentarOldAsycTask()).execute(new String[0]);
return;
}
}
{
this$0 = TwitterInPonsel.this;
super();
}
});
}
public boolean onMenuItemSelected(int i, MenuItem menuitem)
{
menuitem.getItemId();
JVM INSTR tableswitch 16908332 16908332: default 24
// 16908332 26;
goto _L1 _L2
_L1:
return true;
_L2:
finish();
overridePendingTransition(0x7f040001, 0x7f040002);
if (true) goto _L1; else goto _L3
_L3:
}
public void update(Observable observable, Object obj)
{
if (!ponselBaseApp.getObserver().getUpdateType().equals("komentartw")) goto _L2; else goto _L1
_L1:
int i;
Log.e("id_twup", ponselBaseApp.getObserver().getIndexTw());
Log.e("mLinearListView", String.valueOf(mLinearListView.getChildCount()));
i = 0;
_L5:
if (i < mLinearListView.getChildCount()) goto _L3; else goto _L2
_L2:
if (ponselBaseApp.getObserver().getLoginStat().equals("1") && userFunctions.isUserLoggedIn(this))
{
cursor = db.getAllData();
cursor.moveToFirst();
TextView textview;
Object obj1;
try
{
user_id = EncodeDecodeAES.decrypt(RestClient.pelihara, cursor.getString(1));
}
// Misplaced declaration of an exception variable
catch (Observable observable) { }
nama_asli = cursor.getString(2);
user_photo = (new StringBuilder(String.valueOf(Util.BASE_PATH_AVATAR))).append(cursor.getString(3)).toString();
username = cursor.getString(4);
email_user = cursor.getString(5);
user_ttl = cursor.getString(6);
user_provinsi = cursor.getString(7);
user_kota = cursor.getString(8);
user_jekel = cursor.getString(9);
user_ponsel1 = cursor.getString(10);
user_ponsel2 = cursor.getString(11);
user_provider1 = cursor.getString(12);
user_provider2 = cursor.getString(13);
user_joindate = cursor.getString(14);
user_profile_update = cursor.getString(15);
}
return;
_L3:
obj1 = mLinearListView.getChildAt(i);
observable = (TextView)((View) (obj1)).findViewById(0x7f0b054d);
obj = (TextView)((View) (obj1)).findViewById(0x7f0b0551);
textview = (TextView)((View) (obj1)).findViewById(0x7f0b0554);
obj1 = (TextView)((View) (obj1)).findViewById(0x7f0b034a);
if (observable.getText().toString().equals(ponselBaseApp.getObserver().getIndexTw()))
{
((TextView) (obj)).setText(ponselBaseApp.getObserver().getTot_LikeTw());
textview.setText(ponselBaseApp.getObserver().getTotdis_LikeTw());
((TextView) (obj1)).setText(ponselBaseApp.getObserver().getJum_komenLikeTw());
}
i++;
if (true) goto _L5; else goto _L4
_L4:
}
public void updateViewLikeDis(String s)
{
int i;
Log.e("id_kom", s);
Log.e("mLinearListView", String.valueOf(mLinearListView.getChildCount()));
i = 0;
_L2:
ImageView imageview;
ImageView imageview1;
RelativeLayout relativelayout;
Object obj;
if (i >= mLinearListView.getChildCount())
{
return;
}
obj = mLinearListView.getChildAt(i);
TextView textview = (TextView)((View) (obj)).findViewById(0x7f0b054d);
TextView textview1 = (TextView)((View) (obj)).findViewById(0x7f0b0551);
TextView textview2 = (TextView)((View) (obj)).findViewById(0x7f0b0554);
imageview = (ImageView)((View) (obj)).findViewById(0x7f0b054f);
imageview1 = (ImageView)((View) (obj)).findViewById(0x7f0b0552);
relativelayout = (RelativeLayout)((View) (obj)).findViewById(0x7f0b0342);
obj = (RelativeLayout)((View) (obj)).findViewById(0x7f0b0345);
if (textview.getText().toString().equals(s))
{
textview1.setText(tot_LikeKom);
textview2.setText(totdis_LikeKom);
if (!statuslike.equals("1"))
{
break; /* Loop/switch isn't completed */
}
imageview.setBackgroundResource(0x7f020264);
relativelayout.setEnabled(false);
((RelativeLayout) (obj)).setEnabled(true);
}
_L4:
i++;
if (true) goto _L2; else goto _L1
_L1:
if (!statuslike.equals("0")) goto _L4; else goto _L3
_L3:
imageview.setBackgroundResource(0x7f020265);
imageview1.setBackgroundResource(0x7f0201a7);
relativelayout.setEnabled(true);
((RelativeLayout) (obj)).setEnabled(false);
goto _L4
}
public void updateViewTWFav(String s, String s1)
{
int i;
Log.e("id_kom", s);
Log.e("resstat", s1);
Log.e("mLinearListView", String.valueOf(mLinearListView.getChildCount()));
i = 0;
_L2:
TextView textview;
Object obj;
if (i >= mLinearListView.getChildCount())
{
return;
}
obj = mLinearListView.getChildAt(i);
textview = (TextView)((View) (obj)).findViewById(0x7f0b054d);
TextView textview1 = (TextView)((View) (obj)).findViewById(0x7f0b0419);
TextView textview2 = (TextView)((View) (obj)).findViewById(0x7f0b054e);
TextView textview3 = (TextView)((View) (obj)).findViewById(0x7f0b054c);
TextView textview4 = (TextView)((View) (obj)).findViewById(0x7f0b05e9);
TextView textview5 = (TextView)((View) (obj)).findViewById(0x7f0b05ea);
ImageView imageview = (ImageView)((View) (obj)).findViewById(0x7f0b046c);
TextView textview6 = (TextView)((View) (obj)).findViewById(0x7f0b0551);
TextView textview7 = (TextView)((View) (obj)).findViewById(0x7f0b034a);
obj = (ImageView)((View) (obj)).findViewById(0x7f0b0552);
if (textview.getText().toString().equals(s))
{
if (!s1.equals("1") && !s1.equals("10"))
{
break; /* Loop/switch isn't completed */
}
if (imageview.getVisibility() == 8)
{
db.addTW(textview.getText().toString(), textview1.getText().toString(), textview4.getText().toString(), textview2.getText().toString(), "", textview3.getText().toString(), textview6.getText().toString(), textview7.getText().toString(), "");
} else
{
db.addTW(textview.getText().toString(), textview1.getText().toString(), textview4.getText().toString(), textview2.getText().toString(), textview5.getText().toString(), textview3.getText().toString(), textview6.getText().toString(), textview7.getText().toString(), "");
}
if (db.getTWCount() > 0)
{
Toast.makeText(this, "Berhasil menambahkan", 1).show();
((ImageView) (obj)).setBackgroundResource(0x7f020303);
} else
{
Toast.makeText(this, "Gagal menambahkan", 1).show();
((ImageView) (obj)).setBackgroundResource(0x7f020302);
}
mDialog.dismiss();
}
_L3:
i++;
if (true) goto _L2; else goto _L1
_L1:
if (s1.equals("00") || s1.equals("0"))
{
db.deleteHP(textview.getText().toString());
if (!db.checkIfExist(textview.getText().toString()))
{
Toast.makeText(getApplicationContext(), "Berhasil menghapus", 1).show();
((ImageView) (obj)).setBackgroundResource(0x7f020302);
} else
{
Toast.makeText(this, "Gagal menghapus", 1).show();
((ImageView) (obj)).setBackgroundResource(0x7f020303);
}
mDialog.dismiss();
} else
if (res.equals("40404"))
{
mDialog.dismiss();
} else
{
Toast.makeText(this, "Gagal menambahkan", 1).show();
}
goto _L3
if (true) goto _L2; else goto _L4
_L4:
}
}
| [
"hutomoivan@gmail.com"
] | hutomoivan@gmail.com |
5df55d72f37483ad9a4ec22ca4d7f06a27620fef | 2b7b08fc9b87d15f15e2a7b2503b6fe1bf27458a | /AdminEAP-framework/src/main/java/com/cnpc/framework/base/pojo/FieldSetting.java | 5c7d01ae31ed77c412c0f9d9d3b809d8284ddee8 | [
"MIT"
] | permissive | Squama/Master | ad535df8338569940724d50398666ea2f5f7a761 | 6e5eee0fcc17a54ec2bee54a862ba3dda6d803c4 | refs/heads/master | 2022-12-21T15:57:47.304360 | 2021-06-06T05:50:16 | 2021-06-06T05:50:16 | 106,529,787 | 1 | 1 | MIT | 2022-12-16T04:24:31 | 2017-10-11T08:54:14 | HTML | UTF-8 | Java | false | false | 6,106 | java | package com.cnpc.framework.base.pojo;
import com.cnpc.framework.annotation.Header;
import com.cnpc.framework.base.entity.Dict;
import com.cnpc.framework.utils.PingYinUtil;
import com.cnpc.framework.utils.StrUtil;
import javax.persistence.Column;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.Date;
public class FieldSetting {
private Integer rowIndex;
private String columnName;
private String labelName;
private String tagType;
private String type;
private String validateType;
//字典编码,或者url路径
private String dictCode;
private String isSelected;
private String isCondition;
//为FieldSetting赋值
public void setFieldParam(Field field) {
String remark = field.getAnnotation(Header.class).name();
this.setColumnName(field.getName());
String dataSource = field.getAnnotation(Header.class).dataSource();
if (!StrUtil.isEmpty(dataSource)) {
this.setDictCode(dataSource);
if (field.getAnnotation(Header.class).joinClass().equals(Dict.class)) {
this.setTagType("dictSelector");
}
} else if (field.getAnnotation(Header.class).joinClass().equals(Dict.class)) {
this.setDictCode(PingYinUtil.getFirstSpell(field.getName()).toUpperCase());
this.setTagType("dictSelector");
}
if (field.getType() == String.class) {
if (StrUtil.isEmpty(this.getTagType())) {
if (field.getAnnotation(Column.class).length() > 255) {
this.setTagType("textarea");
} else {
this.setTagType(field.getName().equals("id") ? "hidden" : "text");
}
}
this.setType("String");
this.setValidateType(field.getName().toLowerCase().endsWith("id") ? null : "notEmpty:{message:'" + remark + "不能为空'}");
if (this.getColumnName().toLowerCase().contains("email")) {
this.setValidateType(this.getValidateType() + (StrUtil.isEmpty(this.getValidateType()) ? "" : ",\r\n") + "emailAddress:{message:'请填写合法的邮件格式'}");
}
} else if (field.getType() == Date.class) {
this.setTagType("datepicker");
this.setType("Date");
this.setValidateType("notEmpty:{message:'" + remark + "不能为空'},\r\ndate:{format:$(this).data('format'),message:'请输入有效" + remark + "'}");
} else if (field.getType() == Integer.class) {
this.setTagType("text");
this.setType("Integer");
this.setValidateType("notEmpty:{message:'" + remark + "不能为空'},\r\ninteger:{message:'请填写整数'}");
} else if (field.getType() == Double.class) {
this.setTagType("number");
this.setType("Double");
this.setValidateType("notEmpty:{message:'" + remark + "不能为空'},\r\nnumeric:{message:'" + remark + "是数字类型'}");
} else if (field.getType() == Float.class) {
this.setTagType("number");
this.setType("Float");
this.setValidateType("notEmpty:{message:'" + remark + "不能为空'},\r\nnumeric:{message:'" + remark + "是数字类型'}");
} else if (field.getType() == BigDecimal.class) {
this.setTagType("number");
this.setType("BigDecimal");
this.setValidateType("notEmpty:{message:'" + remark + "不能为空'},\r\nnumeric:{message:'" + remark + "是数字类型'}");
} else if (field.getType() == Boolean.class) {
this.setTagType("icheck-radio");
this.setType("Boolean");
this.setValidateType("notEmpty:{message:'" + remark + "不能为空'}");
} else if (field.getType().getName().startsWith("com.cnpc")) {
this.setColumnName(field.getName() + ".id");
if (field.getType().getName().contains("Dict")) {
this.setTagType("dictSelector");
if (StrUtil.isEmpty(this.getDictCode()))
this.setDictCode(PingYinUtil.getFirstSpell(field.getName()).toUpperCase());
} else if (field.getType().getName().contains("Org"))
this.setTagType("orgSelector");
else
this.setTagType("hidden");
this.setType(field.getType().getSimpleName());
this.setValidateType("notEmpty:{message:'" + remark + "不能为空'}");
}
}
public Integer getRowIndex() {
return rowIndex;
}
public void setRowIndex(Integer rowIndex) {
this.rowIndex = rowIndex;
}
public String getIsCondition() {
return isCondition;
}
public void setIsCondition(String isCondition) {
this.isCondition = isCondition;
}
public String getIsSelected() {
return isSelected;
}
public void setIsSelected(String isSelected) {
this.isSelected = isSelected;
}
public String getColumnName() {
return columnName;
}
public void setColumnName(String columnName) {
this.columnName = columnName;
}
public String getLabelName() {
return labelName;
}
public void setLabelName(String labelName) {
this.labelName = labelName;
}
public String getValidateType() {
return validateType;
}
public void setValidateType(String validateType) {
this.validateType = validateType;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getTagType() {
return tagType;
}
public void setTagType(String tagType) {
this.tagType = tagType;
}
public String getDictCode() {
return dictCode;
}
public void setDictCode(String dictCode) {
this.dictCode = dictCode;
}
}
| [
"32840049+wzh0209@users.noreply.github.com"
] | 32840049+wzh0209@users.noreply.github.com |
4060837b019b154e1e92b6d19880c7c0e5f0fa30 | 319ab5393b0c60242937c56f97f189019c69014a | /src/com/crepezzi/pdf/WordlistFileCracker.java | 563e749bdebbbdeca517ad5c7af361f1887e297b | [
"MIT"
] | permissive | afarentino/Pretty-Damn-Fancy | 5b1223c72b5b41e306b8deb2d70af771b90f4991 | 339dfce3c8bbb76e694239659c452162ffeb73c3 | refs/heads/master | 2022-02-01T14:30:20.498705 | 2022-01-27T05:20:19 | 2022-01-27T05:20:19 | 451,163,918 | 0 | 0 | MIT | 2022-01-27T05:20:20 | 2022-01-23T16:33:10 | null | UTF-8 | Java | false | false | 2,402 | java | package com.crepezzi.pdf;
/*
Copyright (c) 2022 by Tony Castrogiovanni
<afarentino@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* Executes a Wordlist file crack from a thread
*/
public class WordlistFileCracker implements Runnable {
private String name;
private String fileName;
private String wordList;
public WordlistFileCracker(String s, String fileName, String wordList) {
this.name = s;
this.fileName = fileName;
this.wordList = wordList;
}
public void run()
{
/**
* Main Test Driver Program to crack password using iText 7
* No command-line args provided
* @param args
*/
System.out.println("Attempting to crack password for " + this.fileName + " using " + this.wordList);
try {
PdfCracker cracker = new PdfCracker(fileName);
String password = cracker.crackViaWordlistFile(wordList);
if (password != null) {
System.out.println("PDF password is: " + password);
}
else {
System.out.println("Password not found in wordlist");
}
}
catch (Exception e) {
System.out.println("Failed to crack password " + e.getMessage() );
e.printStackTrace();
}
}
}
| [
"afarentino@gmail.com"
] | afarentino@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.