-
+157
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
for ($j=1; $j<8; $j++) {
$up = "";
$down = "";
for ($i=1; $i<7; $i++) {
if (($i==4)&&($j==4)) {
$up = $up.'<td class="simp" colspan="2" rowspan="4">Военная<br>Подготовка</td>';
continue;
}
if (($i==4)&&($j>3)&&($j<6)) {
continue;
}
$x = $i*2-1;
$y = $j*2-1;
if (($table[$x][$y]==$table[$x][$y+1])&&($table[$x+1][$y+1]==$table[$x+1][$y])&&($table[$x+1][$y+1]==$table[$x][$y])) {
$up = $up.str_replace("<br><br>","","<td title='".$table[$x][$y]['description']."' class='simp' colspan='2' rowspan='2'>".$table[$x][$y]['subject']."<br>".$table[$x][$y]['auditory']."<br>".$table[$x][$y]['lecturer']."</td>");
}
else {
$cnt = 0;
if ($table[$x][$y]==$s) $cnt++;
if ($table[$x][$y+1]==$s) $cnt++;
if ($table[$x+1][$y]==$s) $cnt++;
if ($table[$x+1][$y+1]==$s) $cnt++;
if ($cnt==3) {
$up = $up."<td title='".$table[$x][$y]['description']."' class='insm'>".$table[$x][$y]['subject']."<br>".$table[$x][$y]['auditory']."<br>".$table[$x][$y]['lecturer']."</td>";
$up = $up."<td title='".$table[$x+1][$y]['description']."' class='insm'>".$table[$x+1][$y]['subject']."<br>".$table[$x+1][$y]['auditory']."<br>".$table[$x+1][$y]['lecturer']."</td>";
$down = $down."<td title='".$table[$x][$y+1]['description']."' class='insm'>".$table[$x][$y+1]['subject']."<br>".$table[$x][$y+1]['auditory']."<br>".$table[$x][$y+1]['lecturer']."</td>";
$down = $down."<td title='".$table[$x+1][$y+1]['description']."' class='insm'>".$table[$x+1][$y+1]['subject']."<br>".$table[$x+1][$y+1]['auditory']."<br>".$table[$x+1][$y+1]['lecturer']."</td>";
}
else {
if ($table[$x][$y]==$table[$x][$y+1]) { // Левые совпадают
$up = $up."<td title='".$table[$x][$y]['description']."' class='insm' rowspan='2'>".$table[$x][$y]['subject']."<br>".$table[$x][$y]['auditory']."<br>".$table[$x][$y]['lecturer']."</td>";
if ($table[$x+1][$y]==$table[$x+1][$y+1]) {
$up = $up."<td title='".$table[$x+1][$y]['description']."' class='insm' rowspan='2'>".$table[$x+1][$y]['subject']."<br>".$table[$x+1][$y]['auditory']."<br>".$table[$x+1][$y]['lecturer']."</td>";
}
else {
$up = $up."<td title='".$table[$x+1][$y]['description']."' class='insm'>".$table[$x+1][$y]['subject']."<br>".$table[$x+1][$y]['auditory']."<br>".$table[$x+1][$y]['lecturer']."</td>";
$down = $down."<td title='".$table[$x+1][$y+1]['description']."' class='insm'>".$table[$x+1][$y+1]['subject']."<br>".$table[$x+1][$y+1]['auditory']."<br>".$table[$x+1][$y+1]['lecturer']."</td>";
}
} else {
if ($table[$x+1][$y]==$table[$x+1][$y+1]) { // Правые совпадают
$up = $up."<td title='".$table[$x][$y]['description']."' class='insm'>".$table[$x][$y]['subject']."<br>".$table[$x][$y]['auditory']."<br>".$table[$x][$y]['lecturer']."</td>";
$down = $down."<td title='".$table[$x][$y+1]['description']."' class='insm'>".$table[$x][$y+1]['subject']."<br>".$table[$x][$y+1]['auditory']."<br>".$table[$x][$y+1]['lecturer']."</td>";
$up = $up."<td title='".$table[$x+1][$y]['description']."' class='insm' rowspan='2'>".$table[$x+1][$y]['subject']."<br>".$table[$x+1][$y]['auditory']."<br>".$table[$x+1][$y]['lecturer']."</td>";
}
else {
if ($table[$x][$y]==$table[$x+1][$y]) { // Верхние совпадают
$up = $up."<td title='".$table[$x][$y]['description']."' class='insm' colspan='2'>".$table[$x][$y]['subject']."<br>".$table[$x][$y]['auditory']."<br>".$table[$x][$y]['lecturer']."</td>";
if ($table[$x][$y+1]==$table[$x+1][$y+1]) {
$down = $down."<td title='".$table[$x][$y+1]['description']."' class='insm' colspan='2'>".$table[$x][$y+1]['subject']."<br>".$table[$x][$y+1]['auditory']."<br>".$table[$x][$y+1]['lecturer']."</td>";
}
else {
$down = $down."<td title='".$table[$x][$y+1]['description']."' class='insm'>".$table[$x][$y+1]['subject']."<br>".$table[$x][$y+1]['auditory']."<br>".$table[$x][$y+1]['lecturer']."</td>";
$down = $down."<td title='".$table[$x+1][$y+1]['description']."' class='insm'>".$table[$x+1][$y+1]['subject']."<br>".$table[$x+1][$y+1]['auditory']."<br>".$table[$x+1][$y+1]['lecturer']."</td>";
}
}
else {
if ($table[$x][$y+1]==$table[$x+1][$y+1]) { // Нижние совпадают
$up = $up."<td title='".$table[$x][$y]['description']."' class='insm'>".$table[$x][$y]['subject']."<br>".$table[$x][$y]['auditory']."<br>".$table[$x][$y]['lecturer']."</td>";
$up = $up."<td title='".$table[$x+1][$y]['description']."' class='insm'>".$table[$x+1][$y]['subject']."<br>".$table[$x+1][$y]['auditory']."<br>".$table[$x+1][$y]['lecturer']."</td>";
$down = $down."<td title='".$table[$x][$y+1]['description']."' class='insm' colspan='2'>".$table[$x][$y+1]['subject']."<br>".$table[$x][$y+1]['auditory']."<br>".$table[$x][$y+1]['lecturer']."</td>";
}
else {
$up = $up."<td title='".$table[$x][$y]['description']."' class='insm'>".$table[$x][$y]['subject']."<br>".$table[$x][$y]['auditory']."<br>".$table[$x][$y]['lecturer']."</td>";
...
Рендер расписания занятий из базы данных в табличку на HTML
Evgesko,
28 Августа 2014
-
+133
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
if(ofd.ShowDialog() == DialogResult.OK)
{
gs_path = ofd.FileName;
BinaryReader br = new BinaryReader(new FileStream(gs_path, FileMode.Open, FileAccess.Read));
int sys = 0;
do {
ofset++;
br.BaseStream.Seek(ofset, SeekOrigin.Begin);
if (br.ReadInt64() == 6875716118506401907)
{
if (br.ReadInt64() == 521392779117)
{
sys = 1;
}
}
} while (sys == 0);
br.BaseStream.Seek(ofset + 20, SeekOrigin.Begin);
textBox1.Text = br.ReadSingle().ToString();
br.BaseStream.Seek(ofset + 24, SeekOrigin.Begin);
textBox2.Text = br.ReadSingle().ToString();
br.BaseStream.Seek(ofset + 28, SeekOrigin.Begin);
textBox3.Text = br.ReadSingle().ToString();
br.BaseStream.Seek(ofset + 32, SeekOrigin.Begin);
textBox4.Text = br.ReadSingle().ToString();
br.BaseStream.Seek(ofset + 36, SeekOrigin.Begin);
textBox5.Text = br.ReadSingle().ToString();
br.BaseStream.Seek(ofset + 40, SeekOrigin.Begin);
textBox6.Text = br.ReadSingle().ToString();
br.BaseStream.Seek(ofset + 44, SeekOrigin.Begin);
textBox7.Text = br.ReadSingle().ToString();
br.Close();
}
}
...
string gs_path;
int ofset = 0;
public Form1()
{
InitializeComponent();
}
...
private void button2_Click(object sender, EventArgs e)
{
BinaryWriter bw = new BinaryWriter(new FileStream(gs_path, FileMode.Open, FileAccess.Write));
bw.BaseStream.Seek(ofset + 20, SeekOrigin.Begin);
bw.Write(Convert.ToSingle(textBox1.Text));
bw.BaseStream.Seek(ofset + 24, SeekOrigin.Begin);
bw.Write(Convert.ToSingle(textBox2.Text));
bw.BaseStream.Seek(ofset + 28, SeekOrigin.Begin);
bw.Write(Convert.ToSingle(textBox3.Text));
bw.BaseStream.Seek(ofset + 32, SeekOrigin.Begin);
bw.Write(Convert.ToSingle(textBox4.Text));
bw.BaseStream.Seek(ofset + 36, SeekOrigin.Begin);
bw.Write(Convert.ToSingle(textBox5.Text));
bw.BaseStream.Seek(ofset + 40, SeekOrigin.Begin);
bw.Write(Convert.ToSingle(textBox6.Text));
bw.BaseStream.Seek(ofset + 44, SeekOrigin.Begin);
bw.Write(Convert.ToSingle(textBox7.Text));
bw.Close();
}
http://kn1fe-zone.ru/index.php?threads/%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80-%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0% BC%D0%BC%D1%8B-%D1%81-%D0%B0%D0%B2%D1%82%D0%BE%D0%BF%D0%BE%D0% B8%D1%81%D0%BA%D0%BE%D0%BC-%D0%B7%D0%BD%D0%B0%D1%87%D0%B5%D0%BD%D0% B8%D0%B9.381/
ХОСПАДИ ДЕСЯТЬ ИЗ ДЕСЯТИ!!!!1111 Принесите мачете и спирт!
DesmondHume,
28 Августа 2014
-
+155
- 1
- 2
- 3
- 4
- 5
- 6
- 7
global $strError, $MESS, $HTTP_GET_VARS, $arrFORM_FILTER;
global $find_date_create_1, $find_date_create_2, $lAdmin;
$str = "";
CheckFilterDates($find_date_create_1, $find_date_create_2, $date1_wrong, $date2_wrong, $date2_less);
if ($date1_wrong=="Y") $str.= GetMessage("FORM_WRONG_DATE_CREATE_FROM")."<br>";
if ($date2_wrong=="Y") $str.= GetMessage("FORM_WRONG_DATE_CREATE_TO")."<br>";
if ($date2_less=="Y") $str.= GetMessage("FORM_FROM_TILL_DATE_CREATE")."<br>";
bitrix
- использование HTTP_GET_VARS уже давно deprecated
- магические переменные find_date_create_1, find_date_create_2, да и lAdmin тоже не понятно что
- зачем-то используются символы Y и N вместо true и false или 1 и 0
memclutter,
28 Августа 2014
-
+134
- 1
- 2
- 3
- 4
- 5
- 6
- 7
if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0)
goto fail;
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
goto fail;
goto fail;
if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0)
goto fail;
https://www.imperialviolet.org/2014/02/22/applebug.html
Понятно, что третий if не выполнится. Кстати, это был баг в Apple SSL/TLS, привёдший к уязвимости.
Кстати, GCC с -Wall это не ловит. Ловит только Clang, и то только с -Wunreachable-code. Мораль: заключайте все тела ифов в блоки!
someone,
28 Августа 2014
-
+1
- 1
- 2
- 3
- 4
- 5
- 6
- 7
for (conn_vector::iterator i = m_connections.begin(); i != m_connections.end(); ++i) {
if (*i == conn) {
m_connections.erase(i);
toDelete = *i;
break;
}
}
Да, С++98. Да, в std::find не умеем. Да, сегфолт. Да, моё.
Elvenfighter,
27 Августа 2014
-
+144
- 1
- 2
- 3
- 4
- 5
- 6
- 7
for (conn_vector::iterator i = m_connections.begin(); i != m_connections.end(); ++i) {
if (*i == conn) {
toDelete = *i;
m_connections.erase(i);
break;
}
}
Да, С++98. Да, в std::find не умеем. Да, сегфолт. Да, моё.
Elvenfighter,
27 Августа 2014
-
−167
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
Функция НайтиСтатусРемонта(ВыбСтатус) Экспорт
Возврат Ремонт.Найти(ВыбСтатус, "СтатусРемонта");
КонецФункции
Процедура УстановитьДанныеСтрокиРемонта(СтатусРемонта, ДатаСтатуса, ДатаВх) Экспорт
СТЧ = НайтиСтатусРемонта(СтатусРемонта);
Попытка
Если СТЧ.Дата = Дата(1,1,1) Тогда
Попытка СТЧ.Дата = ДатаВх; Исключение КонецПопытки;
ИначеЕсли СТЧ.Дата <> ДатаВх Тогда
обСообщить(""+Ссылка+" "+СтатусРемонта+" Дата уже установлена",СтатусСообщения.Важное);
КонецЕсли;
Исключение
КонецПопытки;
КонецПроцедуры
На фоне всей базы это всего лишь цветочки ...
Есть еще отчет, для формирования которого создается 36 (!!!) запросов )))
Хотел отчет выложить, но ограничение из 100 строк меня остановило :(
anton903,
27 Августа 2014
-
+163
- 1
- 2
- 3
- 4
- 5
- 6
- 7
/**
* @param $data
*/
protected function echo_string($data)
{
echo $data;
}
Хитрый ход
andr435,
27 Августа 2014
-
+58
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
void Model::setPosition(GLfloat x, GLfloat y, GLfloat z) {
if (m_position == NULL) {
m_position = (float *) malloc(3 * sizeof(float));
}
if (m_position != NULL) {
m_position[0] = x;
m_position[1] = y;
m_position[2] = z;
}
}
void Model::setRotate(GLfloat x, GLfloat y, GLfloat z) {
if (m_rotate == NULL) {
m_rotate = (float *) malloc(3 * sizeof(float));
}
if (m_rotate != NULL) {
m_rotate[0] = x;
m_rotate[1] = y;
m_rotate[2] = z;
}
}
http://code.google.com/p/forget3d/
Во первых, умиляет умение людей взяв современный супернавороченый удобный автомат, вместо того чтоб нажать на курок и выстрелить в противника, взять этот автомат наперевес как дубинку, и идти им пиздить противника по голове. Я о сишке, слегка прикрытой крестами.
И во вторых, этот код при недостатке памяти просто нифига не делает, что чревато непонятками - вроде и повертел модель, вроде и подвинул, а оно никак не вертится и не двигается.
Pythoner,
27 Августа 2014
-
−163
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
Для Индекс = 0 По МассивДокументов.Количество()-1 Цикл
Документ = МассивДокументов.Получить(Индекс);
Если Документ.Проведен Тогда
УстановитьСтатусДокумента(ТаблицаДокументов, Документ, "Закрыт");
// Удаляем элемент из массива.
МассивДокументов.Удалить(Индекс);
КонецЕсли;
КонецЦикла;
Абстракция мастера игры в бисер протекла. Но работало долго =)
safer_bwd,
27 Августа 2014