Posts

Showing posts from January 11, 2019

Solve a linear problem using bounded variables method

Image
0 $begingroup$ Consider the following $$min 3x_1+4x_2\ s.t. 4x_1+3x_2ge12 \ 3x_1+4x_2le12\ x_1,x_2ge0$$ Substitute the first restriction by $x_1le3$ and solve the LP by bounded variable method. Attempt We first standarize and then set in a table begin{array}{r|rrrrr|r} & x_1 & x_2 & x_3 & x_4 & \ hline z & -3 & -4 & 0 & 0 & & 0 \ hline x_3 & -4 & -3 & 1 & 0 & & -12 \ x_4 & 3 & 4 & 0 & 1 & & 12 end{array} From here we see that $theta_1=min{12/4}=3$ $theta_2=min{frac{-12-?}{-3}}=?$ and $u_2=?$ The bounded variable method requires an upper bound of $x_3$ but does not have. How will I find $theta_2$ ? $u_2?$ Could someone help...

How can I prevent sql injection with groovy?

Image
1 I have a sql like: String sql = """SELECT id, name, sex, age, bron_year, address, phone, state, comment, is_hbp, is_dm, is_cva, is_copd, is_chd, is_cancer, is_floating, is_poor, is_disability, is_mental FROM statistics_stin WHERE 1=1 ${p.team_num == 0 ? "" : "AND team_num = ${p.team_num}"} ${p.zone == 0 ? "" : "AND team_id = ${p.zone}"} ${p.is_hbp == 2 ? "" : "AND is_hbp = ${p.is_hbp}"} ${p.is_dm == 2 ? "" : "AND is_dm = ${p.is_dm}"} ${p.is_chd == 2 ? "" : "AND is_chd = ${p.is_chd}"} ${p.is_cva == 2 ? "" : "AND is_cva = ${p.is_cva}"} ${p.is_copd == 2 ? "" : "AND is_copd = ${p.is_copd}"} ${p.is_cancer == 2 ? "" : "AND is_cancer...