This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT n_tariff * ( | |
SELECT count(n_client) | |
FROM client | |
) * ( | |
SELECT sum(n_difference_hot) | |
FROM computation | |
WHERE to_char(d_computation, 'MM.YYYY') = '09.2008' | |
) | |
FROM tariff | |
WHERE d_tariff = ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::string toString(sf::Keyboard::Key key) | |
{ | |
#define BOOK_KEYTOSTRING_CASE(KEY) case sf::Keyboard::KEY: return #KEY; | |
switch (key) | |
{ | |
BOOK_KEYTOSTRING_CASE(Unknown) | |
BOOK_KEYTOSTRING_CASE(A) | |
BOOK_KEYTOSTRING_CASE(B) | |
BOOK_KEYTOSTRING_CASE(C) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT n_sum, d_pay, n_client | |
FROM payment | |
WHERE n_client = ( | |
SELECT n_client | |
FROM computation | |
WHERE n_debt = ( | |
SELECT max(n_debt) | |
FROM computation | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int get_days_in_month( int month, int year ) { | |
if ( month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12 ) { | |
return 31; | |
} else if ( month == 4 || month == 6 || month == 9 || month == 11 ) { | |
return 30; | |
} else if ( month == 2 && year % 4 == 0 ) { | |
return 29; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool solveQuadratic( const float a, const float b, const float c, float& x0, float& x1 ) { | |
float discr = b * b - 4 * a * c; | |
if ( discr < 0 ) { | |
return false; | |
} else if ( discr == 0 ) { | |
x0 = -0.5 * b / a; | |
x1 = x0; | |
} else { | |
float q = ( b > 0 ) ? | |
-0.5 * ( b + sqrt( discr ) ) : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def GetLuckyTriple( self ): | |
""" | |
Метод, который ищет отрезок, содержащий минимум функции. | |
""" | |
start = -1 | |
end = self._accuracy * 2 - 1 | |
for i in range( 10000 ): | |
middle = ( start + end ) / 2 | |
if self._IsTripleLucky( start, end, middle ): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OldMatrix OldMatrix::operator+ (OldMatrix &B) | |
{ | |
OldMatrix C(Row, Col); | |
if ((Row == B.Row) && (Col == B.Col)) | |
for (int i = 0; i < Row; i++) | |
{ | |
for (int j = 0; j < Col; j++) | |
C[i][j] = M[i][j] + B[i][j]; | |
} | |
return C; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mat3 = mat1 * mat2 + mat3; // correct | |
mat3 = mat1 * mat2 + mat3 * mat1; // produces next error | |
main.cpp: In function ‘void TestVectorMatrix()’: | |
main.cpp:28:21: error: no match for ‘operator*’ (operand types are ‘Matrix’ and ‘Matrix’) | |
mat3 = mat1 * ( mat2 + mat3 ) * mat2; | |
^ | |
main.cpp:28:21: note: candidate is: | |
In file included from main.cpp:1:0: | |
matrix.h:28:12: note: Matrix Matrix::operator*(Matrix&) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo |