active java_SecondActive.java

package com.example.jack.timetable;

import android.content.Context;

import android.content.Intent;

import android.os.Handler;

import android.os.Message;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.util.Log;

import android.widget.TextView;

import android.widget.Toast;

import org.jsoup.Jsoup;

import org.jsoup.nodes.Document;

import org.jsoup.nodes.Element;

import org.jsoup.select.Elements;

import java.io.ByteArrayOutputStream;

import java.io.InputStream;

import java.io.OutputStream;

import java.net.HttpURLConnection;

import java.net.URL;

import java.util.ArrayList;

import java.util.HashMap;

import java.util.List;

public class SecondActive extends AppCompatActivity {

String ID;

String path;

String cookie;

String referer;

String params;

String Data = null;

Handler handler;

String yzmCheck = null;

List classtable;

TextView textView_Mon_one;

TextView textView_Mon_two;

TextView textView_Mon_three ;

TextView textView_Mon_four;

TextView textView_Mon_five;

TextView textView_Mon_six;

TextView textView_Tues_one;

TextView textView_Tues_two ;

TextView textView_Tues_three ;

TextView textView_Tues_four;

TextView textView_Tues_five ;

TextView textView_Tues_six;

TextView textView_Wed_one;

TextView textView_Wed_two;

TextView textView_Wed_three;

TextView textView_Wed_four;

TextView textView_Wed_five;

TextView textView_Wed_six;

TextView textView_Thur_one;

TextView textView_Thur_two;

TextView textView_Thur_three;

TextView textView_Thur_four;

TextView textView_Thur_five;

TextView textView_Thur_six;

TextView textView_Fri_one;

TextView textView_Fri_two;

TextView textView_Fri_three;

TextView textView_Fri_four;

TextView textView_Fri_five;

TextView textView_Fri_six;

TextView textView_Sat_one;

TextView textView_Sat_two;

TextView textView_Sat_three;

TextView textView_Sat_four;

TextView textView_Sat_five;

TextView textView_Sat_six;

TextView textView_Sun_one;

TextView textView_Sun_two;

TextView textView_Sun_three;

TextView textView_Sun_four;

TextView textView_Sun_five;

TextView textView_Sun_six;

String[] classer = new String[42];

String yzm;

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_class_table);

Intent intent = getIntent();

ID =intent.getStringExtra("ID");

yzm = intent.getStringExtra("yzm");

path = "http://jwgl.lnc.edu.cn/ZNPK/TeacherKBFB_rpt.aspx";

cookie = intent.getStringExtra("cookie");

//

Log.i("cookie111222",cookie);

referer = "http://jwgl.lnc.edu.cn/ZNPK/TeacherKBFB.aspx";

params = "Sel_XNXQ=20170&Sel_JS="+ID+"&type=1&txt_yzm="+yzm;

/*"Sel_XNXQ=20170&Sel_JS="+ID+"&type=1&txt_yzm=8ufc";*/

Get();

handler = new Handler(){

public void handleMessage(Message msg) {

/*if (yzmCheck!=null){

Toast.makeText(SecondActive.this, "验证码有误,重新输入", Toast.LENGTH_SHORT);

Intent intent = new Intent(SecondActive.this,FirstActive.class);

intent.putExtra("check","false");

startActivity(intent);

}*/

if(classtable.size()>41) {

textView_Mon_one.setText(classtable.get(0));

textView_Mon_two.setText(classtable.get(7));

textView_Mon_three.setText(classtable.get(14));

textView_Mon_four.setText(classtable.get(21));

textView_Mon_five.setText(classtable.get(28));

textView_Mon_six.setText(classtable.get(35));

//星期二

textView_Tues_one.setText(classtable.get(1));

textView_Tues_two.setText(classtable.get(8));

textView_Tues_three.setText(classtable.get(15));

textView_Tues_four.setText(classtable.get(22));

textView_Tues_five.setText(classtable.get(29));

textView_Tues_six.setText(classtable.get(36));

//星期三

textView_Wed_one.setText(classtable.get(2));

textView_Wed_two.setText(classtable.get(9));

textView_Wed_three.setText(classtable.get(16));

textView_Wed_four.setText(classtable.get(23));

textView_Wed_five.setText(classtable.get(30));

textView_Wed_six.setText(classtable.get(37));

//星期四

textView_Thur_one.setText(classtable.get(3));

textView_Thur_two.setText(classtable.get(10));

textView_Thur_three.setText(classtable.get(17));

textView_Thur_four.setText(classtable.get(24));

textView_Thur_five.setText(classtable.get(31));

textView_Thur_six.setText(classtable.get(38));

//星期五

textView_Fri_one.setText(classtable.get(4));

textView_Fri_two.setText(classtable.get(11));

textView_Fri_three.setText(classtable.get(18));

textView_Fri_four.setText(classtable.get(25));

textView_Fri_five.setText(classtable.get(32));

textView_Fri_six.setText(classtable.get(39));

//星期六

textView_Sat_one.setText(classtable.get(5));

textView_Sat_two.setText(classtable.get(12));

textView_Sat_three.setText(classtable.get(19));

textView_Sat_four.setText(classtable.get(26));

textView_Sat_five.setText(classtable.get(33));

textView_Sat_six.setText(classtable.get(40));

//星期天

textView_Sun_one.setText(classtable.get(6));

textView_Sun_two.setText(classtable.get(19));

textView_Sun_three.setText(classtable.get(20));

textView_Sun_four.setText(classtable.get(27));

textView_Sun_five.setText(classtable.get(34));

textView_Sun_six.setText(classtable.get(41));

int i= 1;

for (String s:classtable){

Log.i("classtest",i+" "+s);

i++;

}

classtable.clear();

}

}

};

textView_Mon_one = (TextView) findViewById(R.id.Mon_one);

textView_Mon_two = (TextView) findViewById(R.id.Mon_two);

textView_Mon_three= (TextView) findViewById(R.id.Mon_three);

textView_Mon_four = (TextView) findViewById(R.id.Mon_four);

textView_Mon_five = (TextView) findViewById(R.id.Mon_five);

textView_Mon_six = (TextView) findViewById(R.id.Mon_six);

textView_Tues_one = (TextView) findViewById(R.id.Tues_one);

textView_Tues_two = (TextView) findViewById(R.id.Tues_two);

textView_Tues_three = (TextView) findViewById(R.id.Tues_three);

textView_Tues_four = (TextView) findViewById(R.id.Tues_four);

textView_Tues_five = (TextView) findViewById(R.id.Tues_five);

textView_Tues_six = (TextView) findViewById(R.id.Tues_six);

textView_Wed_one = (TextView) findViewById(R.id.Wed_one);

textView_Wed_two = (TextView) findViewById(R.id.Wed_two);

textView_Wed_three = (TextView) findViewById(R.id.Wed_three);

textView_Wed_four = (TextView) findViewById(R.id.Wed_four);

textView_Wed_five = (TextView) findViewById(R.id.Wed_five);

textView_Wed_six = (TextView) findViewById(R.id.Wed_six);

textView_Thur_one = (TextView) findViewById(R.id.Thur_one);

textView_Thur_two = (TextView) findViewById(R.id.Thur_two);

textView_Thur_three = (TextView) findViewById(R.id.Thur_three);

textView_Thur_four = (TextView) findViewById(R.id.Thur_four);

textView_Thur_five = (TextView) findViewById(R.id.Thur_five);

textView_Thur_six = (TextView) findViewById(R.id.Thur_six);

textView_Fri_one = (TextView) findViewById(R.id.Fri_one);

textView_Fri_two = (TextView) findViewById(R.id.Fri_two);

textView_Fri_three = (TextView) findViewById(R.id.Fri_three);

textView_Fri_four = (TextView) findViewById(R.id.Fri_four);

textView_Fri_five = (TextView) findViewById(R.id.Fri_five);

textView_Fri_six = (TextView) findViewById(R.id.Fri_six);

textView_Sat_one = (TextView) findViewById(R.id.Sat_one);

textView_Sat_two = (TextView) findViewById(R.id.Sat_two);

textView_Sat_three = (TextView) findViewById(R.id.Sat_three);

textView_Sat_four = (TextView) findViewById(R.id.Sat_four);

textView_Sat_five = (TextView) findViewById(R.id.Sat_five);

textView_Sat_six = (TextView) findViewById(R.id.Sat_six);

textView_Sun_one = (TextView) findViewById(R.id.Sun_one);

textView_Sun_two = (TextView) findViewById(R.id.Sun_two);

textView_Sun_three = (TextView) findViewById(R.id.Sun_three);

textView_Sun_four = (TextView) findViewById(R.id.Sun_four);

textView_Sun_five = (TextView) findViewById(R.id.Sun_five);

textView_Sun_six = (TextView) findViewById(R.id.Sun_six);

}

public void Get(){

new Thread(new Runnable() {

public void run() {

try {

/*获取数据*/

getClassData getclasstable = new getClassData();

classtable = getclasstable.getClassData(path,cookie,referer,params);

/*获取完成*/

Message message = Message.obtain();

message.obj="222";

//通过Handler发布传送消息,handler

handler.sendMessage(message);

} catch (Exception e) {

e.printStackTrace();

}

}

}).start();

}

public void setshow(){

textView_Mon_one.setText(classtable.get(0));

textView_Mon_two.setText(classtable.get(1));

textView_Mon_three.setText(classtable.get(2));

textView_Mon_four.setText(classtable.get(3));

textView_Mon_five.setText(classtable.get(4));

textView_Mon_six.setText(classtable.get(5));

//星期二

textView_Tues_one.setText(classtable.get(6));

textView_Tues_two.setText(classtable.get(7));

textView_Tues_three.setText(classtable.get(8));

textView_Tues_four.setText(classtable.get(9));

textView_Tues_five.setText(classtable.get(10));

textView_Tues_six.setText(classtable.get(11));

//星期三

textView_Wed_one.setText(classtable.get(12));

textView_Wed_two.setText(classtable.get(13));

textView_Wed_three.setText(classtable.get(14));

textView_Wed_four.setText(classtable.get(15));

textView_Wed_five.setText(classtable.get(16));

textView_Wed_six.setText(classtable.get(17));

//星期四

textView_Thur_one.setText(classtable.get(18));

textView_Thur_two.setText(classtable.get(19));

textView_Thur_three.setText(classtable.get(20));

textView_Thur_four.setText(classtable.get(21));

textView_Thur_five.setText(classtable.get(22));

textView_Thur_six.setText(classtable.get(23));

//星期五

textView_Fri_one.setText(classtable.get(24));

textView_Fri_two.setText(classtable.get(25));

textView_Fri_three.setText(classtable.get(26));

textView_Fri_four.setText(classtable.get(27));

textView_Fri_five.setText(classtable.get(28));

textView_Fri_six.setText(classtable.get(29));

//星期六

textView_Sat_one.setText(classtable.get(30));

textView_Sat_two.setText(classtable.get(31));

textView_Sat_three.setText(classtable.get(32));

textView_Sat_four.setText(classtable.get(33));

textView_Sat_five.setText(classtable.get(34));

textView_Sat_six.setText(classtable.get(35));

//星期天

textView_Sun_one.setText(classtable.get(36));

textView_Sun_two.setText(classtable.get(37));

textView_Sun_three.setText(classtable.get(38));

textView_Sun_four.setText(classtable.get(39));

textView_Sun_five.setText(classtable.get(40));

textView_Sun_six.setText(classtable.get(41));

}

}

一键复制

编辑

Web IDE

原始数据

按行查看

历史

请详细解释下这段代码Rect<float> Framer::ComputeActiveCropRegion(int frame_number) { const float min_crop_size = 1.0f / options_.max_zoom_ratio; const float new_x_crop_size = std::clamp(region_of_interest_.width * options_.target_crop_to_roi_ratio, min_crop_size, 1.0f); const float new_y_crop_size = std::clamp(region_of_interest_.height * options_.target_crop_to_roi_ratio, min_crop_size, 1.0f); // We expand the raw crop region to match the desired output aspect ratio. const float target_aspect_ratio = static_cast<float>(options_.input_size.height) / static_cast<float>(options_.input_size.width) * static_cast<float>(options_.target_aspect_ratio_x) / static_cast<float>(options_.target_aspect_ratio_y); Rect<float> new_crop; if (new_x_crop_size <= new_y_crop_size * target_aspect_ratio) { new_crop.width = std::min(new_y_crop_size * target_aspect_ratio, 1.0f); new_crop.height = new_crop.width / target_aspect_ratio; } else { new_crop.height = std::min(new_x_crop_size / target_aspect_ratio, 1.0f); new_crop.width = new_crop.height * target_aspect_ratio; } const float roi_x_mid = region_of_interest_.left + (region_of_interest_.width / 2); const float roi_y_mid = region_of_interest_.top + (region_of_interest_.height / 2); new_crop.left = std::clamp(roi_x_mid - (new_crop.width / 2), 0.0f, 1.0f - new_crop.width); new_crop.top = std::clamp(roi_y_mid - (new_crop.height / 2), 0.0f, 1.0f - new_crop.height); const float normalized_crop_strength = std::powf(options_.crop_filter_strength, ElapsedTimeMs(timestamp_) / kUnitTimeSlice); active_crop_region_.left = IirFilter(active_crop_region_.left, new_crop.left, normalized_crop_strength); active_crop_region_.top = IirFilter(active_crop_region_.top, new_crop.top, normalized_crop_strength); active_crop_region_.width = IirFilter( active_crop_region_.width, new_crop.width, normalized_crop_strength); active_crop_region_.height = IirFilter( active_crop_region_.height, new_crop.height, normalized_crop_strength); timestamp_ = base::TimeTicks::Now(); if (VLOG_IS_ON(2)) { DVLOGFID(2, frame_number) << "region_of_interest=" << region_of_interest_; DVLOGFID(2, frame_number) << "new_crop_region=" << new_crop; DVLOGFID(2, frame_number) << "active_crop_region=" << active_crop_region_; } return active_crop_region_; }
最新发布
06-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值