+2
- 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
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Data;
using Indusoft.PolypropylenPowder.Info;
namespace Indusoft.PolypropylenPowder.Converters
{
public class BeginXxConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null) return null;
var s = value as IEnumerable<object>;
var res = 45.0;
var flag = false;
if (s != null)
{
foreach (var a in s)
{
var b = a as DataTemplate5Item;
if (b != null)
{
if (b.IsActive5)
{
flag = true;
break;
}
}
res += 91;
}
}
if (!flag)
{
return 0;
}
return res;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
ух сука питухи, а мне это говно поддерживать
GreatMASTERcpp,
12 Августа 2020
+1
- 1
- 2
- 3
- 4
- 5
else {
flashinstalled = true;
}
return flashinstalled;
https://csdrop.org/
main.js
Просто из за комментария ☺
GreatMASTERcpp,
04 Апреля 2019
+2
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
function isLogged() {
return '0';
return '';
}
function getForumPrefix() {
return 'forum/';
}
https://dota2.ru/forum/
GreatMASTERcpp,
13 Ноября 2017
−19
- 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
- 65
- 66
- 67
- 68
- 69
void main_calc(double *j0, double *v0, double *r0, double *L, double *L1, double *w0, double *gamma1, int *Num, double **array, int *Ng)
{
double *jc, *Pvh, *h, *vf, *R, *j0, *v0, *r0, *L,*L1, *w0, *gamma1, cm, vfm, *xi, *w, *b, *BB, *Num, E, v, z, t, k1[2], k2[2], k3[2], k4[2],TimeF,C0[mmax][pmax], gamma2[mmax][pmax];
const double PI = 3.14159265358979323;
int i, m, j, k, p, Size1, Size2;
const int mmax = 3000, pmax = 20;
double *jc2, *Pvih;
double CJ, x;
int i1;
ofstream fil;
fil.open("current");
Pvh = new double[*Num];
h = new double[*Num];
vf = new double[*Num];
R = new double[*Num];
TimeF = *Ng*dt;
for (i = 0; i < *Num; i++){
Pvh[i] = array[0][i];
h[i] = array[1][i];
vf[i] = array[2][i];
R[i] = array[3][i];
}
Size1 = *L1 / dz1;
for (i = 0; i<*Num; i++) {
if (TimeF<(2 * PI / (h[i] * (*w0)))) {
TimeF = (2 * PI / (h[i] * (*w0)));
}
}
cout << "TimeF=" << TimeF << endl;
Size2 = 20 * PI / (*w0*dt1);
if (Size1>mmax) { cout << "Error: increase mmax!" << endl; }
cout << "Size1=" << Size1 << " Size2=" << Size2 << endl;
jc = new double[*Ng];
jc2 = new double[*Ng];
b = new double[*Num];
w = new double[*Num];
xi = new double[*Num];
BB = new double[*Num];
ofstream fil2;
fil2.open("w");
for (i = 0; i<*Num; i++) {
w[i] = h[i] * (*w0);
fil2 << w[i] << endl;
b[i] = w[i] / vf[i];
cm = 3.0; vfm = vf[i] / 1e8;
xi[i] = w[i] * sqrt(1.0 / (cm*cm) + 1.0 / (vfm*vfm)) / 1e8;
BB[i] = (I0(xi[i] * (*r0))*I0(xi[i] * (*r0)) - I1(xi[i] * (*r0))*I1(xi[i] * (*r0)) - 1.0);
BB[i] = b[i] * sqrt(2.0*R[i] * Pvh[i] / (BB[i]));
}
fil2.close();
m = 0;
t = 0;
do {
m = m + 1;
t = t + dt;
jc[m] = 0.0;
} while (t<TimeF);
for (j = 0; j<*Num; j++) {
i = 0;
z = 0.0;
do {
C0[i][j] = BB[j]; //initial data
gamma2[i][j] = 0.0; //initial data
i = i + 1;
z = z + dz1;
} while (z<*L1);
t = 0;
do {
C0[0][j] = BB[j]; //initial data
gamma2[0][j] = 0.0; //initial data
z = dz1;
p = 1;
do {
C0[p][j] = C0[p][j] - (vf[j] * dt / dz1)*(C0[p][j] - C0[p - 1][j]) - vf[j] * dt*exp(-5 * z)*(F1n(z, j, jc2, BB, w, b, xi, r0)*cos(gamma2[p][j] * z) - F2n(z, j, jc2, BB, w, b, xi, r0)*sin(gamma2[p][j] * z)) / (4.0*PI*Pvh[j]);
gamma2[p][j] = gamma2[p][j] - (vf[j] * dt / dz1)*(gamma2[p][j] - gamma2[p - 1][j]) + (vf[j] * dt / (C0[p][j] * z))*exp(-5 * z)*(F1n(z, j, jc2, BB, w, b, xi, r0)*sin(gamma2[p][j] * z) + F2n(z, j, jc2, BB, w, b, xi, r0)*cos(gamma2[p][j] * z)) / (4.0*PI*Pvh[j]);
//this string for checking the result:
cout << C0[p][j] << " " << gamma2[p][j] << endl;
z = z + dz1;
p = p + 1;
} while (z<*L1);
t = t + dt;
} while (t<TimeF);
Pvih[j] = C0[p - 3][j] * C0[p - 3][j] * (I0(xi[j] * (*r0))*I0(xi[j] * (*r0)) - I1(xi[j] * (*r0))*I1(xi[j] * (*r0)) - 1.0) / (2.0*R[j] * b[j] * b[j]);
cout <<w[j]<<" "<< Pvih[j] << endl;
fil1 << Pvih[j] << endl;
}
GreatMASTERcpp,
27 Декабря 2015
−2
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
void TMainForm::MakeScreenPrint()
{
MainForm->Print();
}
void __fastcall TMainForm::N18Click(TObject *Sender)
{
MakeScreenPrint();
}
Обертка
GreatMASTERcpp,
27 Декабря 2015
+144
- 1
- 2
- 3
- 4
- 5
- 6
#include <stdio.h>
int main(void)
{
puts("1\n3\n5\n7\n9\n11\n13\n15\n17\n19\n21\n23\n25\n27\n29\n31\n33\n35\n37\n39\n41\n43\n45\n47\n49\n51\n53\n55\n57\n59\n61\n63\n65\n67\n69\n71\n73\n75\n77\n79\n81\n83\n85\n87\n89\n91\n93\n95\n97\n99");
return 0;
}
Выводим все нечетные числа от 0 до 100. Одно число - одна строка.
GreatMASTERcpp,
19 Января 2015
+57
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
if (this->IsWhiteFigure())
{
if (abs(position_x - this->GetPositionX()) == 1 && position_y - this->GetPositionY() == -1)
{
this->SetPositionX(position_x);
this->SetPositionY(position_y);
}
else
{
throw IncorrectMoveException();
}
}
else
{
if (abs(position_x - this->GetPositionX() == 1) && position_y - this->GetPositionY() == 1)
{
this->SetPositionX(position_x);
this->SetPositionY(position_y);
}
else
{
throw IncorrectMoveException();
}
}
Тест на внимательность. Сможете ли вы догадаться почему это не работает ?
GreatMASTERcpp,
13 Декабря 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
- 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
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
if(is_ai_on && !white_move)
{
int tries;
start:
srand (time(NULL));
select_figure:
int figure = rand() % (game_field.figures.size() - 1) + 0;
if(game_field.figures[figure]->IsWhiteFigure()) goto select_figure;
int pos_x;
int pos_y;
tries = 0;
try_move:
try
{
switch(game_field.figures[figure]->GetType())
{
case PawnType:
{
pos_x = rand() % (game_field.figures[figure]->GetPositionX() + 2) + (game_field.figures[figure]->GetPositionX() - 2);
if(pos_x < 0) pos_x = 0;
if(pos_x >= game_field.size) pos_x = game_field.size - 1;
pos_y = game_field.figures[figure]->GetPositionY() + 1;
if(pos_x == game_field.figures[figure]->GetPositionX() &&
pos_y == game_field.figures[figure]->GetPositionY())
{
if(tries < 6)
{
tries++;
goto try_move;
}
else
{
goto select_figure;
}
}
}break;
default:
{
pos_x = rand() % (game_field.figures[figure]->GetPositionX() + 5) + (game_field.figures[figure]->GetPositionX() - 5);
pos_y = rand() % (game_field.figures[figure]->GetPositionY() + 5) + (game_field.figures[figure]->GetPositionY() - 5);
if(pos_x < 0) pos_x = 0;
if(pos_x >= game_field.size) pos_x = game_field.size - 1;
if(pos_y < 0) pos_y = 0;
if(pos_y >= game_field.size) pos_y= game_field.size - 1;
if(pos_x == game_field.figures[figure]->GetPositionX() &&
pos_y == game_field.figures[figure]->GetPositionY())
{
if(tries < 6)
{
tries++;
goto try_move;
}
else
{
goto select_figure;
}
}
}break;
}
game_field.DoMove(figure, pos_x, pos_y, this->white_move);
}
catch(...)
{
if(tries < 6)
{
tries++;
goto try_move;
}
else
{
goto select_figure;
}
}
this->white_move = true;
}
Скайнет - версия 0.0000000000000000000000000000000001
GreatMASTERcpp,
12 Декабря 2014
+53
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
void _debugPrintWaveHeader(const char *path, const WAVHEADER &source_header)
{
FILE *debug = fopen("path", "wt");
fprintf(debug, "chunkId = %s\n", source_header.chunkId);
fprintf(debug, "chunkSize = %u\n", source_header.chunkSize);
fprintf(debug, "format = %s\n", source_header.format);
fprintf(debug, "subCh1Id = %s\n", source_header.subchunk1Id);
fprintf(debug, "subCh1Size = %u\n", source_header.subchunk1Size);
fprintf(debug, "audioform = %u\n", source_header.audioFormat);
fprintf(debug, "numChanels = %u\n", source_header.numChannels);
fprintf(debug, "sampleRate = %u\n", source_header.sampleRate);
fprintf(debug, "byteRate = %u\n", source_header.byteRate);
fprintf(debug, "blockAlign = %u\n", source_header.blockAlign);
fprintf(debug, "bitsPerSam = %u\n", source_header.bitsPerSample);
fprintf(debug, "subCh2Id = %s\n", source_header.subchunk2Id);
fprintf(debug, "subCh2Size = %u\n", source_header.subchunk2Size);
fclose(debug);
}
Начал разгребать один говнопроект... При отладке программа всё падает и падает, падает и не может остановится. Смотрю на код - все в норме, а потом, по прошествии нескольких часов...
GreatMASTERcpp,
25 Августа 2014
+58
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
if(ext == ".wav")
{
if(main_header.bitsPerSample == 8)
{
switch(main_header.bitsPerSample)
{
case 8:
{
open_mode = n8bit_mode;
}break;
case 16:
{
open_mode = n16bit_mode;
}break;
default: open_mode = nNULL;
}
....далее какото код
}
...
GreatMASTERcpp,
25 Августа 2014