- 1
params['query[accountable_of_' + usersRole.charAt(0).toUpperCase() + usersRole.slice(1) + '_type_super_user_id_eq]'] = vm.superUser.id;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+5
params['query[accountable_of_' + usersRole.charAt(0).toUpperCase() + usersRole.slice(1) + '_type_super_user_id_eq]'] = vm.superUser.id;
Пацаны, нормальный же код?
+1
.selection-href {
height: inherit !important;
font-size: 1em !important;
font-weight: inherit !important;
box-sizing: inherit !important;
width: inherit !important;
text-transform: none !important;
}
+5
<input styles = "display: none"></input>
Боги вёрстки!
+2
string[] array=new string[10];
array[0] = "?";
array[1] = "?";
array[2] = "?";
array[3] = "?";
array[4] = "?";
array[5] = "?";
array[6] = "?";
array[7] = "?";
array[8] = "?";
....
if (DS.Tables[0].Rows[i][3].ToString() == "1")
{
checkBox20.Checked = true;
}
if (DS.Tables[0].Rows[i][4].ToString() == "1")
{
checkBox23.Checked = true;
}
if (DS.Tables[0].Rows[i][5].ToString() == "1")
{
checkBox22.Checked = true;
}
if (DS.Tables[0].Rows[i][6].ToString() == "1")
{
checkBox25.Checked = true;
}
if (DS.Tables[0].Rows[i][7].ToString() == "1")
{
checkBox24.Checked = true;
}
if (DS.Tables[0].Rows[i][8].ToString() == "1")
{
checkBox27.Checked = true;
}
if (DS.Tables[0].Rows[i][9].ToString() == "1")
{
checkBox11.Checked = true;
}
...
if (checkBox17.Checked)
{
array[0] = "application/";
}
if (checkBox18.Checked)
{
array[1] = "audio/";
}
if (checkBox21.Checked)
{
array[2] = "example/";
}
if (checkBox20.Checked)
{
array[3] = "image/";
}
if (checkBox23.Checked)
{
array[4] = "message/";
}
if (checkBox22.Checked)
{
array[5] = "model/";
}
if (checkBox25.Checked)
{
array[6] = "multipart/";
}
if (checkBox24.Checked)
{
array[7] = "text/";
}
if (checkBox27.Checked)
Дали на рецензию одну научную работу...
+4
header .phone .icons .vk {
background: url(/images/design/vk.png) rgba(221, 221, 221, 0.22);
}
header .phone .icons .vk:hover {
background-color:rgba(221, 221, 221, 0);
display:none;
}
Если пользователь нашёл элемент, прячем его
−1
$(function ($) {
$.tradeticket = $.tradeticket || {};
}(jQuery));
Genious!
+3
if ($w>$n) {
print round(100/($w/$n))
} else if ($n>$w) {
print round(100/($n/$w))
}
процентное соотношение между $w и $n
−123
#!/usr/blin/python
Навеяно говнокодом № 55.
+142
### TASK 1
R <- 1.987
toSi <- function (value, molar_mass) {
return (value * 4190 / molar_mass)
}
delta <- function (experiment, theory) {
return((experiment - theory)/experiment*100)
}
einsteinFormula <- function (t, A, B, D) {
return(A + B * t + D * t^2)
}
bennewitzRossner <- function (cv, Cnu, n, m, Cd, q) {
coeff1 = (3*n-6-m-q)/q
return(cv + R + 1/2 * m * R + Cnu + coeff1*Cd)
}
heatCapacity <- function(n, links, t, Anu, Bnu, Dnu, Ad, Bd, Dd, m, M) {
c_nu <- einsteinFormula(t, Anu, Bnu, Dnu)
#print(c_nu)
c_d <- einsteinFormula(t, Ad, Bd, Dd)
#print(c_d)
C_rot <- sum(c_nu*links)
C_bend <- sum(c_d*links)
q <- sum(links)
C_kalmol <- bennewitzRossner(3*R, C_rot, n, m, C_bend, q)
C_br <- toSi(C_kalmol, M)
return(data.frame(C_kalmol, C_br, C_rot, C_bend))
}
task11 <- function () {
t_C6H14 <- c(400, 600, 800)
n_C6H14 <- 20
m_C6H14 <- 5
M_C6H14 <- 86.2
Cp_C6H14_kalmol <- (3 * n_C6H14 - 2) * R
#print(Cp_C6H14_kalmol)
Cp_C6H14_mkt <- toSi(Cp_C6H14_kalmol, M_C6H14)
# print(Cp_C6H14_mkt)
Cp_C6H14_exp <- c(1890, 2611, 3159)
deltaC <- delta(Cp_C6H14_exp, Cp_C6H14_mkt)
cp_C6H14_1 <- heatCapacity(
20,
c(5, 14), #Links number
400, #Temperatures
c(-1.09, 0.229), c(6*10^-3, -1.224*10^-3), c(-4.495*10^-6, 1.658*10^-6), #A, B, D rotational
c(0.73, -0.928), c(3.414*10^-3, 3.9*10^-3), c(-2.577*10^-6, -1.324*10^-6), #A, B, D bending
m_C6H14, 86.2
)
cp_C6H14_2 <- heatCapacity(
20,
c(5, 14), #Links number
600, #Temperatures
c(-1.09, 0.229), c(6*10^-3, -1.224*10^-3), c(-4.495*10^-6, 1.658*10^-6), #A, B, D rotational
c(0.73, -0.928), c(3.414*10^-3, 3.9*10^-3), c(-2.577*10^-6, -1.324*10^-6), #A, B, D bending
m_C6H14, 86.2
)
cp_C6H14_3 <- heatCapacity(
20,
c(5, 14), #Links number
800, #Temperatures
c(-1.09, 0.229), c(6*10^-3, -1.224*10^-3), c(-4.495*10^-6, 1.658*10^-6), #A, B, D rotational
c(0.73, -0.928), c(3.414*10^-3, 3.9*10^-3), c(-2.577*10^-6, -1.324*10^-6), #A, B, D bending
m_C6H14, 86.2
)
cp <- c(cp_C6H14_1$C_br, cp_C6H14_2$C_br, cp_C6H14_3$C_br)
print(c(cp_C6H14_1$C_rot, cp_C6H14_2$C_rot, cp_C6H14_3$C_rot))
print(c(cp_C6H14_1$C_bend, cp_C6H14_2$C_bend, cp_C6H14_3$C_bend))
deltaC_br <- delta(Cp_C6H14_exp, cp)
#r <- data.frame(t, Cp_C6H14_mkt, Cp_C6H14_exp, cp, deltaC, deltaC_br)
return(data.frame(t_C6H14, Cp_C6H14_mkt, Cp_C6H14_exp, deltaC, cp, deltaC_br))
}
Мой грязный говнокод на R. Решал дз в инст, рассчет теплоемкости дряни по методу -Д-ж-и-г-у-р-д-ы-и-Б-а-р-р-и-А-л-е-б-а-с-о-в-а- Бенневица-Росснера. Шлю в кучу, потому что нет раздела для эрочки :( Особая ржака начинается со строчки №46.
−90
var data:String = "{\"data\":[" + vsya_data
+ "{\"Id\":0,\"Value\":\"" + String(Klass_vzaimosvyazey.region) + "\",\"Type\":\"String\",\"Ip\":0,\"Group\":\"Контактная\",\"GroupOrder\":4,\"Name\":\"Регион\",\"Seach_flag\":2},"
+ "{\"Id\":0,\"Value\":\"" + String(Klass_vzaimosvyazey.nazvaniye_kliyenta) + "\",\"Type\":\"String\",\"Ip\":0,\"Group\":\"Контактная\",\"Order\":4,\"Name\":\"Название\",\"Seach\":2},"
+ "{\"Id\":0,\"Value\":\"" + String(Klass_vzaimosvyazey.zakazchik) + "\",\"Type\":\"String\",\"Ip\":0,\"Group\":\"Контактная\",\"GroupOrder\":4,\"Name\":\"Организация\",\"Seach_flag\":2},"
...
А так мы формируем JSON-строку. Как вы понимаете, это только верхушка айсберга. Таких строк миллион. Многое берется из шутки, описанной тут: http://govnokod.ru/18325 . Ну класс, который хранит ВСЕ переменные.