using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using System.Data;
using System.Text;
using lwz.Models;
using Microsoft.EntityFrameworkCore;
using MySql.Data.MySqlClient;
using lwz.Date;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Http;
using System.Net.Http.Headers;
using System.IO;
usingstatic HighchartsNETCore.HighChartsTagHelper;
namespace lwz.Controllers
{
publicclass HomeController : Controller
{
private DataContext con;
public HomeController(DataContext context)
{
this.con = context;
}//通过析构函数来依赖注入public IActionResult Index()
{
//ChartsSeries series = new ChartsSeries();
//Dictionary//Random r = new Random();
//for (int i = 0; i < 12; i++)
//{
// dic.Add(DateTime.Now.AddDays(i).ToString("yyyyMMdd"), r.Next(20));
//}
//series.SeriesName = "温度";
//series.SeriesData = dic;
//ViewBag.Series = series;return View();
}
public IActionResult ChartHomeworkCount()//单独增加数据
{
ChartsSeries series = new ChartsSeries();
Dictionary<object, object> dic = new Dictionary<object, object>();
var Tasks = from p in con.Tasks
select p;
var Tasks1 = Tasks.Where(d => d.Teachername == "宋光");
dic.Add("宋光", Tasks1.Count());
Tasks = from p in con.Tasks
select p;
var Tasks2 = Tasks.Where(d => d.Teachername == "习一平");
dic.Add("习一平", Tasks2.Count());
Tasks = from p in con.Tasks
select p;
var Tasks3 = Tasks.Where(d => d.Teachername == "梁老师");
dic.Add("梁老师", Tasks3.Count());
Tasks = from p in con.Tasks
select p;
var Tasks4 = Tasks.Where(d => d.Teachername == "马玉");
dic.Add("马玉", Tasks4.Count());
Tasks = from p in con.Tasks
select p;
var Tasks5 = Tasks.Where(d => d.Teachername == "郭老师");
dic.Add("郭老师", Tasks5.Count());
Tasks = from p in con.Tasks
select p;
var Tasks6 = Tasks.Where(d => d.Teachername == "李家宝");
dic.Add("李家宝", Tasks6.Count());
Tasks = from p in con.Tasks
select p;
series.SeriesName = "作业量/条";
series.SeriesData = dic;
ViewBag.Series = series;
return View();
}
public IActionResult Index3()//循环读取多条数据
{
//ChartsSeries series = new ChartsSeries();
//Dictionary dic = new Dictionary();
//var kucuns = from p in con.kucun
// select p;
//for (int i = 1; i <= kucuns.Count(); i++)
//{
// var kucunnum = kucuns.Where(d => d.KucunId == i).FirstOrDefault();
// dic.Add(kucunnum.Name, kucunnum.Number);
//}
//series.SeriesName = "商品库存量";
//series.SeriesData = dic;
//ViewBag.Series = series;return View();
}
}
}
1,java读取.properties配置文件
InputStream in;
try {
in = test.class.getClassLoader().getResourceAsStream("config/ipnetOracle.properties");//配置文件的路径
Properties p = new Properties()
create or replace procedure proc_test01
as
type emp_row is record(
empno emp.empno%type,
ename emp.ename%type,
job emp.job%type,
mgr emp.mgr%type,
hiberdate emp.hiredate%type,
sal emp.sal%t
今天在执行一个脚本时,本来是想在脚本中启动hdfs和hive等程序,可以在执行到service hive-server start等启动服务的命令时会报错,最终解决方法记录一下:
脚本报错如下:
./olap_quick_intall.sh: line 57: service: command not found
./olap_quick_intall.sh: line 59
最近重新安装的电脑,配置了新环境,老是出现:
adb server is out of date. killing...
ADB server didn't ACK
* failed to start daemon *
百度了一下,说是端口被占用,我开个eclipse,然后打开cmd,就提示这个,很烦人。
一个比较彻底的解决办法就是修改
import java.util.HashMap;
public class Title {
public static void main(String[] args){
f();
}
// 二位数组的应用
//12、二维数组中,哪一行或哪一列的连续存放的0的个数最多,是几个0。注意,是“连续”。
public static void f(){